From 28db1ede0629bfa1d63650fabba8b31f4e79eb05 Mon Sep 17 00:00:00 2001 From: Vitaly Kovalyshyn Date: Fri, 28 Jul 2017 15:01:39 +0300 Subject: [PATCH 001/264] FS-9096: [mod_commands] new uuid argument for bgapi --- .../applications/mod_commands/mod_commands.c | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index e592b3fabc..5082a60d9a 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -5178,19 +5178,38 @@ SWITCH_STANDARD_API(bgapi_function) switch_memory_pool_t *pool; switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; + + const char *p, *arg = cmd; + char my_uuid[SWITCH_UUID_FORMATTED_LENGTH + 1]; if (!cmd) { stream->write_function(stream, "-ERR Invalid syntax\n"); return SWITCH_STATUS_SUCCESS; } + if (!strncasecmp(cmd, "uuid:", 5)) { + p = cmd + 5; + if ((arg = strchr(p, ' ')) && *arg++) { + switch_copy_string(my_uuid, p, arg - p); + } + } + + if (zstr(arg)) { + stream->write_function(stream, "-ERR Invalid syntax\n"); + return SWITCH_STATUS_SUCCESS; + } + switch_core_new_memory_pool(&pool); job = switch_core_alloc(pool, sizeof(*job)); - job->cmd = switch_core_strdup(pool, cmd); + job->cmd = switch_core_strdup(pool, arg); job->pool = pool; - switch_uuid_get(&uuid); - switch_uuid_format(job->uuid_str, &uuid); + if (*my_uuid) { + switch_copy_string(job->uuid_str, my_uuid, strlen(my_uuid)+1); + } else { + switch_uuid_get(&uuid); + switch_uuid_format(job->uuid_str, &uuid); + } switch_threadattr_create(&thd_attr, job->pool); switch_threadattr_detach_set(thd_attr, 1); From 058fb317895ccd3753c472a44099c4ec17e3efc5 Mon Sep 17 00:00:00 2001 From: Italo Rossi Date: Tue, 28 Nov 2017 17:31:49 -0300 Subject: [PATCH 002/264] FS-10814 - [verto_communicator] Do not change video resolution if auto detect video settings is off --- .../src/vertoService/services/vertoService.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js index 509182d9a5..5f22eacebb 100644 --- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js +++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js @@ -427,6 +427,11 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora } updateResolutions(resolutions['validRes']); + /* Do not touch video device resolution if autoBand is off and we have selected a vidQual */ + if (!storage.data.autoBand && storage.data.vidQual) { + w = videoResolution[storage.data.vidQual].width; + h = videoResolution[storage.data.vidQual].height; + } data.instance.videoParams({ minWidth: w, minHeight: h, From 48fbcccd14d5e6fde56dafe33fd9776fbcbd045e Mon Sep 17 00:00:00 2001 From: Seven Du Date: Wed, 29 Nov 2017 20:45:37 +0800 Subject: [PATCH 003/264] FS-10815 #resove --- src/switch_rtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 480a10662b..15d7e4cc99 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -8534,7 +8534,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr); my_host = switch_get_addr(bufc, sizeof(bufc), rtp_session->local_addr); - printf( + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(rtp_session->session), SWITCH_LOG_CONSOLE, "W %s b=%4ld %s:%u %s:%u %s:%u pt=%d ts=%u seq=%u m=%d\n", rtp_session->session ? switch_channel_get_name(switch_core_session_get_channel(rtp_session->session)) : "NoName", (long) bytes, From 97d6bee3fcac17080775576b140d041d97ccd411 Mon Sep 17 00:00:00 2001 From: Praveen Kumar Date: Wed, 22 Nov 2017 17:59:59 +0000 Subject: [PATCH 004/264] FS-10805: Memory Leak fix in mod_amqp Memory allocated to hash iterators and hash tables isn't released during module shutdown. With these changes, memory allocated to hash iterators and hash tables will be freed properly. --- src/mod/event_handlers/mod_amqp/mod_amqp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp.c b/src/mod/event_handlers/mod_amqp/mod_amqp.c index e5deaf745a..cd8dcf849b 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp.c @@ -86,7 +86,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_amqp_load) */ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_amqp_shutdown) { - switch_hash_index_t *hi; + switch_hash_index_t *hi = NULL; mod_amqp_producer_profile_t *producer; mod_amqp_command_profile_t *command; mod_amqp_logging_profile_t *logging; @@ -94,22 +94,26 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_amqp_shutdown) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Mod starting shutting down\n"); switch_event_unbind_callback(mod_amqp_producer_event_handler); - while ((hi = switch_core_hash_first(mod_amqp_globals.producer_hash))) { + while ((hi = switch_core_hash_first_iter(mod_amqp_globals.producer_hash, hi))) { switch_core_hash_this(hi, NULL, NULL, (void **)&producer); mod_amqp_producer_destroy(&producer); } - while ((hi = switch_core_hash_first(mod_amqp_globals.command_hash))) { + while ((hi = switch_core_hash_first_iter(mod_amqp_globals.command_hash, hi))) { switch_core_hash_this(hi, NULL, NULL, (void **)&command); mod_amqp_command_destroy(&command); } switch_log_unbind_logger(mod_amqp_logging_recv); - while ((hi = switch_core_hash_first(mod_amqp_globals.logging_hash))) { + while ((hi = switch_core_hash_first_iter(mod_amqp_globals.logging_hash, hi))) { switch_core_hash_this(hi, NULL, NULL, (void **)&logging); mod_amqp_logging_destroy(&logging); } + switch_core_hash_destroy(&(mod_amqp_globals.producer_hash)); + switch_core_hash_destroy(&(mod_amqp_globals.command_hash)); + switch_core_hash_destroy(&(mod_amqp_globals.logging_hash)); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Mod finished shutting down\n"); return SWITCH_STATUS_SUCCESS; } From db3e6ec32f2a0bc8212e7ebbbfb1830740aa61c1 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Tue, 5 Dec 2017 13:56:40 +0300 Subject: [PATCH 005/264] FS-10789: [mod_v8] v8 segs on invalid instruction --- src/mod/languages/mod_v8/mod_v8.2015.vcxproj | 5 +++++ src/mod/languages/mod_v8/mod_v8.cpp | 7 ++++++- src/mod/languages/mod_v8/src/fsdbh.cpp | 2 +- src/mod/languages/mod_v8/src/jsbase.cpp | 6 +++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/mod/languages/mod_v8/mod_v8.2015.vcxproj b/src/mod/languages/mod_v8/mod_v8.2015.vcxproj index 8eeab47b18..dfdf26e0ec 100644 --- a/src/mod/languages/mod_v8/mod_v8.2015.vcxproj +++ b/src/mod/languages/mod_v8/mod_v8.2015.vcxproj @@ -86,6 +86,11 @@ NativeMinimumRules.ruleset false + + + 4100;%(DisableSpecificWarnings) + + Disabled diff --git a/src/mod/languages/mod_v8/mod_v8.cpp b/src/mod/languages/mod_v8/mod_v8.cpp index bd3882d0d8..1a73db85bf 100644 --- a/src/mod/languages/mod_v8/mod_v8.cpp +++ b/src/mod/languages/mod_v8/mod_v8.cpp @@ -665,7 +665,12 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu // Compile the source code. #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5 v8::ScriptCompiler::CompileOptions options = v8::ScriptCompiler::kNoCompileOptions; - Handle v8_script = v8::ScriptCompiler::Compile(context, &source, options).ToLocalChecked(); + Handle v8_script; + v8::MaybeLocal v8_script_check = v8::ScriptCompiler::Compile(context, &source, options); + + if (!v8_script_check.IsEmpty()) { + v8_script = v8_script_check.ToLocalChecked(); + } //Handle v8_script = v8::ScriptCompiler::Compile(context, source,/* String::NewFromUtf8(isolate, script_file),*/ v8::ScriptCompiler::kProduceCodeCache).ToLocalChecked(); //source->GetCachedData(); #else diff --git a/src/mod/languages/mod_v8/src/fsdbh.cpp b/src/mod/languages/mod_v8/src/fsdbh.cpp index 605df59b89..59bd3b8128 100644 --- a/src/mod/languages/mod_v8/src/fsdbh.cpp +++ b/src/mod/languages/mod_v8/src/fsdbh.cpp @@ -253,7 +253,7 @@ JS_DBH_FUNCTION_IMPL(query) if (err) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error %s\n", err); - switch_core_db_free(err); + switch_safe_free(err); info.GetReturnValue().Set(false); } } diff --git a/src/mod/languages/mod_v8/src/jsbase.cpp b/src/mod/languages/mod_v8/src/jsbase.cpp index 12d65b8996..4fd320f439 100644 --- a/src/mod/languages/mod_v8/src/jsbase.cpp +++ b/src/mod/languages/mod_v8/src/jsbase.cpp @@ -158,7 +158,11 @@ void JSBase::CreateInstance(const v8::FunctionCallbackInfo& args) v8::Local context = isolate->GetCurrentContext(); v8::Local key = String::NewFromUtf8(isolate, "constructor_method"); v8::Local privateKey = v8::Private::ForApi(isolate, key); - Handle ex = Handle::Cast(args.Callee()->GetPrivate(context, privateKey).ToLocalChecked()); + Handle ex; + v8::MaybeLocal hiddenValue = args.Callee()->GetPrivate(context, privateKey); + if (!hiddenValue.IsEmpty()) { + ex = Handle::Cast(hiddenValue.ToLocalChecked()); + } #else Handle ex = Handle::Cast(args.Callee()->GetHiddenValue(String::NewFromUtf8(args.GetIsolate(), "constructor_method"))); #endif From c1280938bf5f9821df846bd2c6871ce0ca24620b Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 13 Jul 2017 02:56:33 +0300 Subject: [PATCH 006/264] FS-10496: [mod_v8] Speedup JavaScript. Enabling Code Caching. --- conf/curl/autoload_configs/v8.conf.xml | 2 + conf/insideout/autoload_configs/v8.conf.xml | 2 + conf/vanilla/autoload_configs/v8.conf.xml | 2 + .../mod_v8/conf/autoload_configs/v8.conf.xml | 2 + src/mod/languages/mod_v8/mod_v8.cpp | 221 ++++++++++++++++-- src/mod/languages/mod_v8/mod_v8.h | 4 + src/mod/languages/mod_v8/src/fsglobal.cpp | 13 +- src/mod/languages/mod_v8/src/jsmain.cpp | 39 +++- 8 files changed, 257 insertions(+), 28 deletions(-) diff --git a/conf/curl/autoload_configs/v8.conf.xml b/conf/curl/autoload_configs/v8.conf.xml index 67c1f1ca06..0f57fff741 100644 --- a/conf/curl/autoload_configs/v8.conf.xml +++ b/conf/curl/autoload_configs/v8.conf.xml @@ -1,5 +1,7 @@ + + diff --git a/conf/insideout/autoload_configs/v8.conf.xml b/conf/insideout/autoload_configs/v8.conf.xml index 67c1f1ca06..0f57fff741 100644 --- a/conf/insideout/autoload_configs/v8.conf.xml +++ b/conf/insideout/autoload_configs/v8.conf.xml @@ -1,5 +1,7 @@ + + diff --git a/conf/vanilla/autoload_configs/v8.conf.xml b/conf/vanilla/autoload_configs/v8.conf.xml index 67c1f1ca06..0f57fff741 100644 --- a/conf/vanilla/autoload_configs/v8.conf.xml +++ b/conf/vanilla/autoload_configs/v8.conf.xml @@ -1,5 +1,7 @@ + + diff --git a/src/mod/languages/mod_v8/conf/autoload_configs/v8.conf.xml b/src/mod/languages/mod_v8/conf/autoload_configs/v8.conf.xml index 67c1f1ca06..0f57fff741 100644 --- a/src/mod/languages/mod_v8/conf/autoload_configs/v8.conf.xml +++ b/src/mod/languages/mod_v8/conf/autoload_configs/v8.conf.xml @@ -1,5 +1,7 @@ + + diff --git a/src/mod/languages/mod_v8/mod_v8.cpp b/src/mod/languages/mod_v8/mod_v8.cpp index 1a73db85bf..2a295283dd 100644 --- a/src/mod/languages/mod_v8/mod_v8.cpp +++ b/src/mod/languages/mod_v8/mod_v8.cpp @@ -109,6 +109,7 @@ SWITCH_MODULE_DEFINITION_EX(mod_v8, mod_v8_load, mod_v8_shutdown, NULL, SMODF_GL /* API interfaces */ static switch_api_interface_t *jsrun_interface = NULL; static switch_api_interface_t *jsapi_interface = NULL; +static switch_api_interface_t *jsmon_interface = NULL; /* Module manager for loadable modules */ module_manager_t module_manager = { 0 }; @@ -122,11 +123,26 @@ typedef struct { char *xml_handler; #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5 v8::Platform *v8platform; + switch_hash_t *compiled_script_hash; + switch_mutex_t *compiled_script_hash_mutex; + char *script_caching; + switch_time_t cache_expires_seconds; + bool performance_monitor; + switch_mutex_t *mutex; #endif } mod_v8_global_t; static mod_v8_global_t globals = { 0 }; +#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5 +/* Struct to store cached script data */ +typedef struct { + std::shared_ptr data; + int length; + switch_time_t compile_time; +} v8_compiled_script_cache_t; +#endif + /* Loadable module struct, used for external extension modules */ typedef struct { char *filename; @@ -318,6 +334,14 @@ static void load_configuration(void) char *var = (char *)switch_xml_attr_soft(param, "name"); char *val = (char *)switch_xml_attr_soft(param, "value"); +#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5 + if (!strcmp(var, "script-caching")) { + globals.script_caching = switch_core_strdup(globals.pool, val); + } else if (!strcmp(var, "cache-expires-sec")) { + int v = atoi(val); + globals.cache_expires_seconds = (v > 0) ? v : 0; + } else +#endif if (!strcmp(var, "xml-handler-script")) { globals.xml_handler = switch_core_strdup(globals.pool, val); } @@ -334,6 +358,12 @@ static void load_configuration(void) } } +#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5 + if (zstr(globals.script_caching)) { + globals.script_caching = switch_core_strdup(globals.pool, "disabled"); + } +#endif + for (hook = switch_xml_child(settings, "hook"); hook; hook = hook->next) { char *event = (char *)switch_xml_attr_soft(hook, "event"); char *subclass = (char *)switch_xml_attr_soft(hook, "subclass"); @@ -462,6 +492,121 @@ static char *v8_get_script_path(const char *script_file) } } +#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5 +void perf_log(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + + switch_mutex_lock(globals.mutex); + if (globals.performance_monitor) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, fmt, ap); + } + switch_mutex_unlock(globals.mutex); + + va_end(ap); +} + +template< typename T > +struct array_deleter +{ + void operator ()(T const * p) + { + delete[] p; + } +}; + +static void destructor(void *ptr) +{ + delete (v8_compiled_script_cache_t*)ptr; +} + +void LoadScript(MaybeLocal *v8_script, Isolate *isolate, const char *script_data, const char *script_file) +{ + switch_time_t start = switch_time_now(); + + ScriptCompiler::CachedData *cached_data = 0; + v8_compiled_script_cache_t *stored_compiled_script_cache = NULL; + ScriptCompiler::CompileOptions options; + + /* + Do not cache if the caching is disabled + Do not cache inline scripts + */ + if (!strcasecmp(globals.script_caching, "disabled") || !strcasecmp(globals.script_caching, "false") || !strcasecmp(globals.script_caching, "no") || !strcasecmp(script_file, "inline") || zstr(script_file)) { + options = ScriptCompiler::kNoCompileOptions; + perf_log("Javascript caching is disabled.\n", script_file); + } else { + options = ScriptCompiler::kConsumeCodeCache; + + switch_mutex_lock(globals.compiled_script_hash_mutex); + + void *hash_found = switch_core_hash_find(globals.compiled_script_hash, script_file); + if (hash_found) + { + stored_compiled_script_cache = new v8_compiled_script_cache_t; + *stored_compiled_script_cache = *((v8_compiled_script_cache_t *)hash_found); + } + + switch_mutex_unlock(globals.compiled_script_hash_mutex); + + if (stored_compiled_script_cache) + { + switch_time_t time_left_since_compile_sec = (switch_time_now() - stored_compiled_script_cache->compile_time) / 1000000; + if (time_left_since_compile_sec <= globals.cache_expires_seconds || globals.cache_expires_seconds == 0) { + cached_data = new ScriptCompiler::CachedData(stored_compiled_script_cache->data.get(), stored_compiled_script_cache->length, ScriptCompiler::CachedData::BufferNotOwned); + } else { + perf_log("Javascript ['%s'] cache expired.\n", script_file); + switch_core_hash_delete_locked(globals.compiled_script_hash, script_file, globals.compiled_script_hash_mutex); + } + + } + + if (!cached_data) options = ScriptCompiler::kProduceCodeCache; + + } + + ScriptCompiler::Source source(String::NewFromUtf8(isolate, script_data), cached_data); + *v8_script = ScriptCompiler::Compile(isolate->GetCurrentContext(), &source, options); + + if (!v8_script->IsEmpty()) { + + if (options == ScriptCompiler::kProduceCodeCache && !source.GetCachedData()->rejected) { + int length = source.GetCachedData()->length; + uint8_t* raw_cached_data = new uint8_t[length]; + v8_compiled_script_cache_t *compiled_script_cache = new v8_compiled_script_cache_t; + memcpy(raw_cached_data, source.GetCachedData()->data, static_cast(length)); + compiled_script_cache->data.reset(raw_cached_data, array_deleter()); + compiled_script_cache->length = length; + compiled_script_cache->compile_time = switch_time_now(); + + switch_mutex_lock(globals.compiled_script_hash_mutex); + switch_core_hash_insert_destructor(globals.compiled_script_hash, script_file, compiled_script_cache, destructor); + switch_mutex_unlock(globals.compiled_script_hash_mutex); + + perf_log("Javascript ['%s'] cache was produced.\n", script_file); + + } else if (options == ScriptCompiler::kConsumeCodeCache) { + + if (source.GetCachedData()->rejected) { + perf_log("Javascript ['%s'] cache was rejected.\n", script_file); + switch_core_hash_delete_locked(globals.compiled_script_hash, script_file, globals.compiled_script_hash_mutex); + } else { + perf_log("Javascript ['%s'] execution using cache.\n", script_file); + } + + } + } + + if (stored_compiled_script_cache) + delete stored_compiled_script_cache; + + switch_time_t end = switch_time_now(); + perf_log("Javascript ['%s'] loaded in %u microseconds.\n", script_file, (end - start)); + +} +#endif + static int v8_parse_and_execute(switch_core_session_t *session, const char *input_code, switch_stream_handle_t *api_stream, v8_event_t *v8_event, v8_xml_handler_t* xml_handler) { string res; @@ -653,27 +798,17 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu context->Global()->Set(String::NewFromUtf8(isolate, "scriptPath"), String::NewFromUtf8(isolate, path)); free(path); } - // Create a string containing the JavaScript source code. -#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5 - ScriptCompiler::Source source(String::NewFromUtf8(isolate, script_data)); -#else - Handle source = String::NewFromUtf8(isolate, script_data); -#endif TryCatch try_catch; // Compile the source code. #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5 - v8::ScriptCompiler::CompileOptions options = v8::ScriptCompiler::kNoCompileOptions; - Handle v8_script; - v8::MaybeLocal v8_script_check = v8::ScriptCompiler::Compile(context, &source, options); - - if (!v8_script_check.IsEmpty()) { - v8_script = v8_script_check.ToLocalChecked(); - } - //Handle v8_script = v8::ScriptCompiler::Compile(context, source,/* String::NewFromUtf8(isolate, script_file),*/ v8::ScriptCompiler::kProduceCodeCache).ToLocalChecked(); - //source->GetCachedData(); + switch_time_t start = switch_time_now(); + MaybeLocal v8_script; + LoadScript(&v8_script, isolate, script_data, script_file); #else + // Create a string containing the JavaScript source code. + Handle source = String::NewFromUtf8(isolate, script_data); Handle + diff --git a/html5/verto/verto_communicator/src/locales/locale-en.json b/html5/verto/verto_communicator/src/locales/locale-en.json index f5f778e6d4..8cb3d5ae9a 100644 --- a/html5/verto/verto_communicator/src/locales/locale-en.json +++ b/html5/verto/verto_communicator/src/locales/locale-en.json @@ -156,5 +156,6 @@ "LANGUAGE": "Language:", "BROWSER_LANGUAGE": "Browser Language", "FACTORY_RESET_SETTINGS": "Factory Reset Settings", - "AUTOGAIN_CONTROL": "Auto Gain Control" + "AUTOGAIN_CONTROL": "Auto Gain Control", + "WAITING_DEVICES": "Waiting for devices..." } diff --git a/html5/verto/verto_communicator/src/locales/locale-pt.json b/html5/verto/verto_communicator/src/locales/locale-pt.json index 7d3260b5ed..5a64454151 100644 --- a/html5/verto/verto_communicator/src/locales/locale-pt.json +++ b/html5/verto/verto_communicator/src/locales/locale-pt.json @@ -154,5 +154,6 @@ "CHAT_DEAF": "Ligar Áudio", "CHAT_UNDEAF": "Desligar Áudio", "FACTORY_RESET_SETTINGS": "Redefinir configurações", - "AUTOGAIN_CONTROL": "Controle de Ganho Automático (AGC)" + "AUTOGAIN_CONTROL": "Controle de Ganho Automático (AGC)", + "WAITING_DEVICES": "Aguardando dispositivos..." } diff --git a/html5/verto/verto_communicator/src/partials/loading.html b/html5/verto/verto_communicator/src/partials/loading.html new file mode 100644 index 0000000000..943a6cb118 --- /dev/null +++ b/html5/verto/verto_communicator/src/partials/loading.html @@ -0,0 +1,10 @@ +
+
+
+
+

{{ 'LOADING' | translate}}

+
{{ 'WAITING_DEVICES' | translate }}
+
+
+
+
\ No newline at end of file diff --git a/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js b/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js index dc3ce4a181..3fa2f0edaa 100644 --- a/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js +++ b/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js @@ -94,6 +94,11 @@ templateUrl: 'partials/incall.html', controller: 'InCallController' }). + when('/loading', { + title: 'Loading Verto Communicator', + templateUrl: 'partials/loading.html', + controller: 'LoadingController' + }). when('/preview', { title: 'Preview Video', templateUrl: 'partials/preview.html', diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js new file mode 100644 index 0000000000..43ceeae092 --- /dev/null +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js @@ -0,0 +1,14 @@ +(function() { + 'use strict'; + + angular + .module('vertoControllers') + .controller('LoadingController', ['$rootScope', '$scope', '$location', + function($rootScope, $scope, $location) { + console.log('Loading controller'); + $rootScope.$on('res_check_done', function() { + $location.path('/preview'); + }); + } + ]); +})(); diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js index ba305c363c..066b69b33e 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js @@ -98,7 +98,7 @@ } if (redirect && storage.data.preview) { - $location.path('/preview'); + $location.path('/loading'); } else if (redirect) { $location.path('/dialpad'); } diff --git a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js index 5f22eacebb..3e083bfe19 100644 --- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js +++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js @@ -448,6 +448,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora } }); + $rootScope.$emit('res_check_done'); } else { console.debug('There is no instance of verto.'); From 91f781d811b0cd27d937809bd424a9c33d7c07c3 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sun, 24 Dec 2017 10:23:13 +0800 Subject: [PATCH 011/264] FS-10859 #resolve --- src/switch_ivr_play_say.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 6a9298d2d4..b16dbaf388 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -3005,7 +3005,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *ses if (need_create) { memset(sh, 0, sizeof(*sh)); if ((status = switch_core_speech_open(sh, tts_name, voice_name, (uint32_t) rate, interval, read_impl.number_of_channels, &flags, NULL)) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid TTS module!\n"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid TTS module %s[%s]!\n", tts_name, voice_name); switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE); switch_ivr_clear_speech_cache(session); arg_recursion_check_stop(args); From 452b7d12d0fb72a93e9d7cb6fe1aca82ff5130bc Mon Sep 17 00:00:00 2001 From: Italo Rossi Date: Tue, 26 Dec 2017 14:40:56 -0300 Subject: [PATCH 012/264] FS-10858 - [verto_communicator] Removing emit of res_check_done, on slow connections the emit could happen before the listening thus freezing the app on loading --- .../controllers/LoadingController.js | 12 +++++++----- .../src/vertoService/services/vertoService.js | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js index 43ceeae092..0dfee15801 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js @@ -3,12 +3,14 @@ angular .module('vertoControllers') - .controller('LoadingController', ['$rootScope', '$scope', '$location', - function($rootScope, $scope, $location) { + .controller('LoadingController', ['$rootScope', '$scope', '$location', '$interval', 'verto', + function($rootScope, $scope, $location, $interval, verto) { console.log('Loading controller'); - $rootScope.$on('res_check_done', function() { - $location.path('/preview'); - }); + $interval(function() { + if (verto.data.resCheckEnded) { + $location.path('/preview'); + } + }, 1000); } ]); })(); diff --git a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js index 3e083bfe19..808aba539c 100644 --- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js +++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js @@ -174,7 +174,8 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora login: $cookieStore.get('verto_demo_login') || "1008", password: $cookieStore.get('verto_demo_passwd') || "1234", hostname: window.location.hostname, - wsURL: ("wss://" + window.location.hostname + ":8082") + wsURL: ("wss://" + window.location.hostname + ":8082"), + resCheckEnded: false }; function cleanShareCall(that) { @@ -448,7 +449,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora } }); - $rootScope.$emit('res_check_done'); + data.resCheckEnded = true; } else { console.debug('There is no instance of verto.'); From 726e52243429ac6f3935ba2aed7687124ea1cf41 Mon Sep 17 00:00:00 2001 From: Italo Rossi Date: Thu, 28 Dec 2017 17:36:35 -0300 Subject: [PATCH 013/264] FS-10858 - [verto_communicator] cancel timeout when done to avoid redirect loop --- .../controllers/LoadingController.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js index 0dfee15801..9aaeb6e20e 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/LoadingController.js @@ -6,11 +6,19 @@ .controller('LoadingController', ['$rootScope', '$scope', '$location', '$interval', 'verto', function($rootScope, $scope, $location, $interval, verto) { console.log('Loading controller'); - $interval(function() { - if (verto.data.resCheckEnded) { - $location.path('/preview'); - } + var int_id; + + $scope.stopInterval = function() { + $interval.cancel(int_id); + }; + + int_id = $interval(function() { + if (verto.data.resCheckEnded) { + $scope.stopInterval(); + $location.path('/preview'); + } }, 1000); + } ]); })(); From 78c189bfcc253ecc7281e0097da126f62fa69a7a Mon Sep 17 00:00:00 2001 From: Steve Underwood Date: Mon, 8 Jan 2018 18:15:47 +0000 Subject: [PATCH 014/264] A tweak to the PCAP file parsing code in spandsp to allow for 802.1Q headers in Ethernet packets. --- libs/spandsp/tests/g722_tests.c | 1 + libs/spandsp/tests/pcap_parse.c | 46 +++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/libs/spandsp/tests/g722_tests.c b/libs/spandsp/tests/g722_tests.c index 6a4251bb1b..9e51312361 100644 --- a/libs/spandsp/tests/g722_tests.c +++ b/libs/spandsp/tests/g722_tests.c @@ -593,6 +593,7 @@ int main(int argc, char *argv[]) exit(2); } } + dec_state = NULL; if (decode) { memset(&info, 0, sizeof(info)); diff --git a/libs/spandsp/tests/pcap_parse.c b/libs/spandsp/tests/pcap_parse.c index bc3805af2a..4e79743706 100644 --- a/libs/spandsp/tests/pcap_parse.c +++ b/libs/spandsp/tests/pcap_parse.c @@ -37,6 +37,7 @@ #if defined(HAVE_PCAP_H) #include +#include #endif #include #include @@ -95,15 +96,6 @@ typedef struct _ether_hdr uint16_t ether_type; } ether_hdr; -typedef struct _linux_sll_hdr -{ - uint16_t packet_type; - uint16_t arphrd; - uint16_t slink_length; - uint8_t bytes[8]; - uint16_t ether_type; -} linux_sll_hdr; - typedef struct _null_hdr { uint32_t pf_type; @@ -132,12 +124,13 @@ int pcap_scan_pkts(const char *file, pcap_t *pcap; struct pcap_pkthdr *pkthdr; uint8_t *pktdata; + uint8_t *pktptr; const uint8_t *body; int body_len; int total_pkts; uint32_t pktlen; ether_hdr *ethhdr; - linux_sll_hdr *sllhdr; + struct sll_header *sllhdr; null_hdr *nullhdr; struct iphdr *iphdr; #if !defined(__CYGWIN__) @@ -150,9 +143,10 @@ int pcap_scan_pkts(const char *file, total_pkts = 0; if ((pcap = pcap_open_offline(file, errbuf)) == NULL) { - fprintf(stderr, "Can't open PCAP file '%s'\n", file); + fprintf(stderr, "Can't open PCAP file: %s\n", errbuf); return -1; } + //printf("PCAP file version %d.%d\n", pcap_major_version(pcap), pcap_minor_version(pcap)); datalink = pcap_datalink(pcap); /* DLT_EN10MB seems to apply to all forms of ethernet, not just the 10MB kind. */ switch (datalink) @@ -185,11 +179,21 @@ int pcap_scan_pkts(const char *file, while ((pktdata = (uint8_t *) pcap_next(pcap, pkthdr)) != NULL) { #endif + pktptr = pktdata; switch (datalink) { case DLT_EN10MB: - ethhdr = (ether_hdr *) pktdata; + ethhdr = (ether_hdr *) pktptr; packet_type = ntohs(ethhdr->ether_type); + pktptr += sizeof(*ethhdr); + /* Check for a 802.1Q Virtual LAN entry we might need to step over */ + if (packet_type == 0x8100) + { + /* Step over the 802.1Q stuff, to get to the next packet type */ + pktptr += sizeof(uint16_t); + packet_type = ntohs(*((uint16_t *) pktptr)); + pktptr += sizeof(uint16_t); + } #if !defined(__CYGWIN__) if (packet_type != 0x0800 /* IPv4 */ && @@ -200,11 +204,12 @@ int pcap_scan_pkts(const char *file, { continue; } - iphdr = (struct iphdr *) ((uint8_t *) ethhdr + sizeof(*ethhdr)); + iphdr = (struct iphdr *) pktptr; break; case DLT_LINUX_SLL: - sllhdr = (linux_sll_hdr *) pktdata; - packet_type = ntohs(sllhdr->ether_type); + sllhdr = (struct sll_header *) pktptr; + packet_type = ntohs(sllhdr->sll_protocol); + pktptr += sizeof(*sllhdr); #if !defined(__CYGWIN__) if (packet_type != 0x0800 /* IPv4 */ && @@ -215,13 +220,14 @@ int pcap_scan_pkts(const char *file, { continue; } - iphdr = (struct iphdr *) ((uint8_t *) sllhdr + sizeof(*sllhdr)); + iphdr = (struct iphdr *) pktptr; break; case DLT_NULL: - nullhdr = (null_hdr *) pktdata; + nullhdr = (null_hdr *) pktptr; + pktptr += sizeof(*nullhdr); if (nullhdr->pf_type != PF_INET && nullhdr->pf_type != PF_INET6) continue; - iphdr = (struct iphdr *) ((uint8_t *) nullhdr + sizeof(*nullhdr)); + iphdr = (struct iphdr *) pktptr; break; default: continue; @@ -239,10 +245,10 @@ int pcap_scan_pkts(const char *file, if (iphdr && iphdr->version == 6) { /* ipv6 */ - pktlen = (uint32_t) pkthdr->len - sizeof(*ethhdr) - sizeof(*ip6hdr); ip6hdr = (ipv6_hdr *) (void *) iphdr; if (ip6hdr->nxt_header != IPPROTO_UDP) continue; + pktlen = (uint32_t) pkthdr->len - (pktptr - pktdata) - sizeof(*ip6hdr); udphdr = (struct udphdr *) ((uint8_t *) ip6hdr + sizeof(*ip6hdr)); } else @@ -256,7 +262,7 @@ int pcap_scan_pkts(const char *file, pktlen = (uint32_t) ntohs(udphdr->uh_ulen); #elif defined ( __HPUX) udphdr = (struct udphdr *) ((uint8_t *) iphdr + (iphdr->ihl << 2)); - pktlen = (uint32_t) pkthdr->len - sizeof(*ethhdr) - sizeof(*iphdr); + pktlen = (uint32_t) pkthdr->len - (pktptr - pktdata) - sizeof(*iphdr); #else udphdr = (struct udphdr *) ((uint8_t *) iphdr + (iphdr->ihl << 2)); pktlen = (uint32_t) ntohs(udphdr->len); From 6cc029b579b64e73908e56a29046f9581a7fe963 Mon Sep 17 00:00:00 2001 From: "Angel M. Adames" Date: Tue, 9 Jan 2018 13:31:32 -0400 Subject: [PATCH 015/264] FS-10875: #resolve Portability issues for non-bash interpreters. --- configure.ac | 2 +- libs/spandsp/configure.ac | 4 ++-- libs/spandsp/unpack_gsm0610_data.sh | 4 ++-- libs/unimrcp/configure.ac | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index ff1efdc533..f65b59997d 100644 --- a/configure.ac +++ b/configure.ac @@ -1506,7 +1506,7 @@ if test "$with_ldap" = "yes"; then OPENLDAP_LIBS="${OPENLDAP_LIBS} -lldap" fi -AM_CONDITIONAL([HAVE_LDAP],[test "x$with_ldap" == "xyes"]) +AM_CONDITIONAL([HAVE_LDAP],[test "x$with_ldap" = "xyes"]) AC_SUBST(OPENLDAP_LIBS) diff --git a/libs/spandsp/configure.ac b/libs/spandsp/configure.ac index 57998b8713..baef75ef69 100644 --- a/libs/spandsp/configure.ac +++ b/libs/spandsp/configure.ac @@ -231,7 +231,7 @@ case "$host" in ;; esac -if test "${build}" == "${host}" +if test "${build}" = "${host}" then AC_CHECK_HEADERS([X11/X.h]) fi @@ -275,7 +275,7 @@ AC_CHECK_HEADERS([FL/Fl_Audio_Meter.H]) AC_LANG([C]) -if test "${build}" == "${host}" +if test "${build}" = "${host}" then case "${host}" in x86_64-*) diff --git a/libs/spandsp/unpack_gsm0610_data.sh b/libs/spandsp/unpack_gsm0610_data.sh index cba7349dea..1141e6a3e1 100755 --- a/libs/spandsp/unpack_gsm0610_data.sh +++ b/libs/spandsp/unpack_gsm0610_data.sh @@ -53,7 +53,7 @@ else cd gsm0610 fi -if [ $1x == --no-exe-runx ] +if [ $1x = --no-exe-runx ] then # Run the .exe files, which should be here ./FR_A.EXE @@ -77,7 +77,7 @@ rm -rf READ_FRA.TXT rm -rf ACTION rm -rf unpacked -if [ $1x == --no-exex ] +if [ $1x = --no-exex ] then # We need to prepare the .exe files to be run separately rm -rf *.INP diff --git a/libs/unimrcp/configure.ac b/libs/unimrcp/configure.ac index ac1eacf3af..b13c0fab4c 100644 --- a/libs/unimrcp/configure.ac +++ b/libs/unimrcp/configure.ac @@ -92,7 +92,7 @@ AC_ARG_ENABLE(interlib-deps, [enable_interlib_deps="yes"]) AC_MSG_NOTICE([enable inter-library dependencies: $enable_interlib_deps]) -if test "${enable_interlib_deps}" == "yes"; then +if test "${enable_interlib_deps}" = "yes"; then link_all_deplibs=yes link_all_deplibs_CXX=yes else From 7f9e6f3e4b174d7c9e7455d0e3e7b475bb2c1818 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Mon, 8 Jan 2018 15:57:17 -0600 Subject: [PATCH 016/264] FS-10881: Debian sources parsing support for args --- debian/util.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/util.sh b/debian/util.sh index 024a510869..885eb0ff65 100755 --- a/debian/util.sh +++ b/debian/util.sh @@ -255,12 +255,13 @@ EOF get_sources () { local tgt_distro="$1" - while read type path distro components; do + while read type args path distro components; do test "$type" = deb || continue + if echo "$args" | grep -qv "\[" ; then components=$distro;distro=$path;path=$args;args=""; fi prefix=`echo $distro | awk -F/ '{print $1}'` suffix="`echo $distro | awk -F/ '{print $2}'`" if test -n "$suffix" ; then full="$tgt_distro/$suffix" ; else full="$tgt_distro" ; fi - printf "$type $path $full $components\n" + printf "$type $args $path $full $components\n" done < "$2" } From e380b41a8e67a18400af73a990cd56647842936c Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 10 Jan 2018 23:30:24 +0300 Subject: [PATCH 017/264] FS-10876: [Build-System] Fix build in Visual Studio 2017 and Windows SDK 10. --- .../libsofia-sip-ua/bnf/sofia-sip/bnf.h | 9 +++++---- libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c | 18 +++++++++--------- libs/win32/libx264/vsyasm.props | 1 + libs/win32/libx264/vsyasm.targets | 8 ++++---- libs/win32/v8/build-v8.bat | 2 ++ src/switch_apr.c | 12 ++++++++++-- src/switch_estimators.c | 3 +-- src/switch_rtp.c | 1 - w32/Library/FreeSwitchCore.2015.vcxproj | 5 +++++ 9 files changed, 37 insertions(+), 22 deletions(-) diff --git a/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/bnf.h b/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/bnf.h index 1c9b191e35..f048b9bff4 100644 --- a/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/bnf.h +++ b/libs/sofia-sip/libsofia-sip-ua/bnf/sofia-sip/bnf.h @@ -52,15 +52,16 @@ SOFIA_BEGIN_DECLS /** Horizontal tab */ #define HT "\t" /** Carriage return */ -#define CR "\r" +/* CR conflicts with Windows SDK 10, so it is now _CR */ +#define _CR "\r" /** Line feed */ #define LF "\n" /** Line-ending characters */ -#define CRLF CR LF +#define CRLF _CR LF /** Whitespace */ #define WS SP HT /** Linear whitespace */ -#define LWS SP HT CR LF +#define LWS SP HT _CR LF /** Lower-case alphabetic characters */ #define LOALPHA "abcdefghijklmnopqrstuvwxyz" /** Upper-case alphabetic characters */ @@ -160,7 +161,7 @@ enum { SOFIAPUBVAR unsigned char const _bnf_table[256]; /** Get number of characters before CRLF */ -#define span_non_crlf(s) strcspn(s, CR LF) +#define span_non_crlf(s) strcspn(s, _CR LF) /** Get number of characters before whitespace */ #define span_non_ws(s) strcspn(s, WS) diff --git a/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c b/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c index e889ceb633..6adf89b22c 100644 --- a/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c +++ b/libs/sofia-sip/libsofia-sip-ua/msg/msg_mime.c @@ -272,7 +272,7 @@ msg_multipart_boundary(su_home_t *home, char const *b) if (!b || !(boundary = su_alloc(home, 2 + 2 + strlen(b) + 2 + 1))) return NULL; - strcpy(boundary, CR LF "--"); + strcpy(boundary, _CR LF "--"); if (b[0] == '"') /* " See http://bugzilla.gnome.org/show_bug.cgi?id=134216 */ @@ -281,7 +281,7 @@ msg_multipart_boundary(su_home_t *home, char const *b) strcpy(boundary + 4, b); - strcat(boundary + 4, CR LF); + strcat(boundary + 4, _CR LF); return boundary; } @@ -321,9 +321,9 @@ msg_multipart_search_boundary(su_home_t *home, char const *p, size_t len) if (m > 2 && crlf) { boundary = su_alloc(home, 2 + m + 2 + 1); if (boundary) { - memcpy(boundary, CR LF, 2); + memcpy(boundary, _CR LF, 2); memcpy(boundary + 2, p, m); - strcpy(boundary + m + 2, CR LF); + strcpy(boundary + m + 2, _CR LF); } return boundary; } @@ -342,9 +342,9 @@ msg_multipart_search_boundary(su_home_t *home, char const *p, size_t len) if (m > 2 && crlf) { boundary = su_alloc(home, 2 + m + 2 + 1); if (boundary) { - memcpy(boundary, CR LF, 2); + memcpy(boundary, _CR LF, 2); memcpy(boundary + 2, p + 1, m); - strcpy(boundary + 2 + m, CR LF); + strcpy(boundary + 2 + m, _CR LF); } return boundary; } @@ -589,7 +589,7 @@ int msg_multipart_complete(su_home_t *home, b = mp->mp_data; m = mp->mp_len; - if (strncmp(b, CR LF "--", 4) == 0) + if (strncmp(b, _CR LF "--", 4) == 0) b += 4, m -= 4; else if (strncmp(b, "--", 2) == 0) b += 2, m -= 2; @@ -638,7 +638,7 @@ int msg_multipart_complete(su_home_t *home, if (mp->mp_next == NULL) { if (!mp->mp_close_delim) - mp->mp_close_delim = msg_payload_format(home, "%.*s--" CR LF, + mp->mp_close_delim = msg_payload_format(home, "%.*s--" _CR LF, (int)m, boundary); if (!mp->mp_close_delim) return -1; @@ -658,7 +658,7 @@ int msg_multipart_complete(su_home_t *home, mp->mp_common->h_len = mp->mp_len; if (!mp->mp_separator) - if (!(mp->mp_separator = msg_separator_make(home, CR LF))) + if (!(mp->mp_separator = msg_separator_make(home, _CR LF))) return -1; if (mp->mp_multipart) { diff --git a/libs/win32/libx264/vsyasm.props b/libs/win32/libx264/vsyasm.props index 9efa05172f..14f48a9a66 100644 --- a/libs/win32/libx264/vsyasm.props +++ b/libs/win32/libx264/vsyasm.props @@ -16,6 +16,7 @@ False $(IntDir) + $(IntDir)\$(Filename).asm.obj 0 0 $(YasmPath)libs\vsyasm.exe -Xvc -f $(Platform) [AllOptions] [AdditionalOptions] [Inputs] diff --git a/libs/win32/libx264/vsyasm.targets b/libs/win32/libx264/vsyasm.targets index 3c084119b1..5a57d425d2 100644 --- a/libs/win32/libx264/vsyasm.targets +++ b/libs/win32/libx264/vsyasm.targets @@ -20,7 +20,7 @@ AfterTargets="$(YASMAfterTargets)" Condition="'@(YASM)' != ''" DependsOnTargets="$(YASMDependsOn);ComputeYASMOutput" - Outputs="@(YASM->'%(ObjectFile)')" + Outputs="@(YASM->'%(ObjectFileName)')" Inputs="@(YASM);%(YASM.AdditionalDependencies);$(MSBuildProjectFile)"> @@ -30,8 +30,8 @@ + Include="%(YASM.ObjectFileName)" + Condition="'%(YASM.ObjectFileName)' != '' and '%(YASM.ExcludedFromBuild)' != 'true'"> @(YASM, '|') @@ -50,7 +50,7 @@ IncludePaths="%(YASM.IncludePaths)" Defines="%(YASM.Defines)" UnDefines="%(YASM.UnDefines)" - ObjectFile="%(YASM.ObjectFile)" + ObjectFile="%(YASM.ObjectFileName)" ListFile="%(YASM.ListFile)" MapFile="%(YASM.MapFile)" ErrorFile="%(YASM.ErrorFile)" diff --git a/libs/win32/v8/build-v8.bat b/libs/win32/v8/build-v8.bat index adcc81e02e..24268ba1b8 100644 --- a/libs/win32/v8/build-v8.bat +++ b/libs/win32/v8/build-v8.bat @@ -29,6 +29,8 @@ SET GYPFLAGS="-Dv8_use_external_startup_data=0" CALL .\third_party\python_26\setup_env.bat +SET GYP_MSVS_VERSION=2015 + IF "%VisualStudioVersion%" == "11.0" ( REM SET VS_VERSION=-Gmsvs_version=2012 SET GYP_MSVS_VERSION=2012 diff --git a/src/switch_apr.c b/src/switch_apr.c index 85edb040d0..f6a8d56ea6 100644 --- a/src/switch_apr.c +++ b/src/switch_apr.c @@ -59,6 +59,14 @@ #include #include +#ifdef WIN32 +#include "apr_arch_networkio.h" +/* Missing socket symbols */ +#ifndef SOL_TCP +#define SOL_TCP IPPROTO_TCP +#endif +#endif + /* apr_vformatter_buff_t definition*/ #include @@ -832,7 +840,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int int r = -10; #if defined(TCP_KEEPIDLE) - r = setsockopt(jsock->client_socket, SOL_TCP, TCP_KEEPIDLE, (void *)&on, sizeof(on)); + r = setsockopt(sock->socketdes, SOL_TCP, TCP_KEEPIDLE, (void *)&on, sizeof(on)); #endif if (r == -10) { return SWITCH_STATUS_NOTIMPL; @@ -846,7 +854,7 @@ SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int int r = -10; #if defined(TCP_KEEPINTVL) - r = setsockopt(jsock->client_socket, SOL_TCP, TCP_KEEPINTVL, (void *)&on, sizeof(on)); + r = setsockopt(sock->socketdes, SOL_TCP, TCP_KEEPINTVL, (void *)&on, sizeof(on)); #endif if (r == -10) { diff --git a/src/switch_estimators.c b/src/switch_estimators.c index 37a7d930df..86d7bfd35c 100644 --- a/src/switch_estimators.c +++ b/src/switch_estimators.c @@ -29,9 +29,8 @@ * */ -#include - #include + #ifndef _MSC_VER #include #endif diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 15d7e4cc99..afbd01a24e 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -48,7 +48,6 @@ #include #include #include -#include //#define DEBUG_TS_ROLLOVER //#define TS_ROLLOVER_START 4294951295 diff --git a/w32/Library/FreeSwitchCore.2015.vcxproj b/w32/Library/FreeSwitchCore.2015.vcxproj index aa3bff3223..62e2684aee 100644 --- a/w32/Library/FreeSwitchCore.2015.vcxproj +++ b/w32/Library/FreeSwitchCore.2015.vcxproj @@ -106,6 +106,11 @@ AllRules.ruleset false + + + ..\..\libs\apr\include\arch\win32;%(AdditionalIncludeDirectories) + + From bb4499ec24bd7a5cadb90eab1b1a05515d38eaa2 Mon Sep 17 00:00:00 2001 From: lazedo Date: Thu, 30 Nov 2017 19:29:27 +0000 Subject: [PATCH 018/264] FS-10820 [mod_kazoo] eventstream configuration --- src/mod/event_handlers/mod_kazoo/Makefile.am | 14 +- .../event_handlers/mod_kazoo/kazoo.conf.xml | 953 +++++++++++++++++ src/mod/event_handlers/mod_kazoo/kazoo_api.c | 396 +++++++ .../event_handlers/mod_kazoo/kazoo_commands.c | 21 +- .../event_handlers/mod_kazoo/kazoo_config.c | 535 ++++++++++ .../event_handlers/mod_kazoo/kazoo_config.h | 62 ++ .../event_handlers/mod_kazoo/kazoo_dptools.c | 199 +++- src/mod/event_handlers/mod_kazoo/kazoo_ei.h | 262 +++++ .../mod_kazoo/kazoo_ei_config.c | 543 ++++++++++ .../event_handlers/mod_kazoo/kazoo_ei_utils.c | 996 ++++++++++++++++++ .../mod_kazoo/kazoo_event_stream.c | 235 +++-- .../mod_kazoo/kazoo_fetch_agent.c | 180 +++- .../event_handlers/mod_kazoo/kazoo_fields.h | 195 ++++ .../event_handlers/mod_kazoo/kazoo_message.c | 458 ++++++++ .../event_handlers/mod_kazoo/kazoo_message.h | 65 ++ src/mod/event_handlers/mod_kazoo/kazoo_node.c | 221 +++- .../event_handlers/mod_kazoo/kazoo_tweaks.c | 502 +++++++++ .../event_handlers/mod_kazoo/kazoo_utils.c | 711 ++----------- src/mod/event_handlers/mod_kazoo/mod_kazoo.c | 687 +----------- src/mod/event_handlers/mod_kazoo/mod_kazoo.h | 163 +-- 20 files changed, 5723 insertions(+), 1675 deletions(-) create mode 100644 src/mod/event_handlers/mod_kazoo/kazoo.conf.xml create mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_api.c create mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_config.c create mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_config.h create mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_ei.h create mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c create mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c create mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_fields.h create mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_message.c create mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_message.h create mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c diff --git a/src/mod/event_handlers/mod_kazoo/Makefile.am b/src/mod/event_handlers/mod_kazoo/Makefile.am index 53fd7112e1..ed2eec7b9c 100644 --- a/src/mod/event_handlers/mod_kazoo/Makefile.am +++ b/src/mod/event_handlers/mod_kazoo/Makefile.am @@ -4,11 +4,23 @@ MODNAME=mod_kazoo if HAVE_ERLANG mod_LTLIBRARIES = mod_kazoo.la -mod_kazoo_la_SOURCES = mod_kazoo.c kazoo_utils.c kazoo_node.c kazoo_event_stream.c kazoo_fetch_agent.c kazoo_commands.c kazoo_dptools.c +mod_kazoo_la_SOURCES = mod_kazoo.c kazoo_utils.c kazoo_dptools.c kazoo_tweaks.c +mod_kazoo_la_SOURCES += kazoo_api.c kazoo_commands.c kazoo_config.c +mod_kazoo_la_SOURCES += kazoo_message.c +mod_kazoo_la_SOURCES += kazoo_ei_config.c kazoo_ei_utils.c kazoo_event_stream.c +mod_kazoo_la_SOURCES += kazoo_fetch_agent.c kazoo_node.c + mod_kazoo_la_CFLAGS = $(AM_CFLAGS) @ERLANG_CFLAGS@ -D_REENTRANT mod_kazoo_la_LIBADD = $(switch_builddir)/libfreeswitch.la mod_kazoo_la_LDFLAGS = -avoid-version -module -no-undefined -shared @ERLANG_LDFLAGS@ +mod_kazoo.la: kazoo_definitions.h $(mod_kazoo_la_OBJECTS) $(mod_kazoo_la_DEPENDENCIES) $(EXTRA_mod_kazoo_la_DEPENDENCIES) + $(AM_V_CCLD)$(mod_kazoo_la_LINK) $(am_mod_kazoo_la_rpath) $(mod_kazoo_la_OBJECTS) $(mod_kazoo_la_LIBADD) $(LIBS) + + +kazoo_definitions.h: + xxd -i kazoo.conf.xml > kazoo_definitions.h + else install: error all: error diff --git a/src/mod/event_handlers/mod_kazoo/kazoo.conf.xml b/src/mod/event_handlers/mod_kazoo/kazoo.conf.xml new file mode 100644 index 0000000000..7a5fdb4c7b --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo.conf.xml @@ -0,0 +1,953 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_api.c b/src/mod/event_handlers/mod_kazoo/kazoo_api.c new file mode 100644 index 0000000000..09d3d05419 --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_api.c @@ -0,0 +1,396 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2012, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Karl Anderson + * Darren Schreiber + * + * + * mod_kazoo.c -- Socket Controlled Event Handler + * + */ +#include "mod_kazoo.h" + +#define KAZOO_DESC "kazoo information" +#define KAZOO_SYNTAX " []" + +#define API_COMMAND_DISCONNECT 0 +#define API_COMMAND_REMOTE_IP 1 +#define API_COMMAND_STREAMS 2 +#define API_COMMAND_BINDINGS 3 + + +static switch_status_t api_erlang_status(switch_stream_handle_t *stream) { + switch_sockaddr_t *sa; + uint16_t port; + char ipbuf[48]; + const char *ip_addr; + ei_node_t *ei_node; + + switch_socket_addr_get(&sa, SWITCH_FALSE, kazoo_globals.acceptor); + + port = switch_sockaddr_get_port(sa); + ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); + + stream->write_function(stream, "Running %s\n", VERSION); + stream->write_function(stream, "Listening for new Erlang connections on %s:%u with cookie %s\n", ip_addr, port, kazoo_globals.ei_cookie); + stream->write_function(stream, "Registered as Erlang node %s, visible as %s\n", kazoo_globals.ei_cnode.thisnodename, kazoo_globals.ei_cnode.thisalivename); + + if (kazoo_globals.ei_compat_rel) { + stream->write_function(stream, "Using Erlang compatibility mode: %d\n", kazoo_globals.ei_compat_rel); + } + + switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); + ei_node = kazoo_globals.ei_nodes; + if (!ei_node) { + stream->write_function(stream, "No erlang nodes connected\n"); + } else { + stream->write_function(stream, "Connected to:\n"); + while(ei_node != NULL) { + unsigned int year, day, hour, min, sec, delta; + + delta = (switch_micro_time_now() - ei_node->created_time) / 1000000; + sec = delta % 60; + min = delta / 60 % 60; + hour = delta / 3600 % 24; + day = delta / 86400 % 7; + year = delta / 31556926 % 12; + stream->write_function(stream, " %s (%s:%d) up %d years, %d days, %d hours, %d minutes, %d seconds\n" + ,ei_node->peer_nodename, ei_node->remote_ip, ei_node->remote_port, year, day, hour, min, sec); + ei_node = ei_node->next; + } + } + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t api_erlang_event_filter(switch_stream_handle_t *stream) { + switch_hash_index_t *hi = NULL; + int column = 0; + + for (hi = (switch_hash_index_t *)switch_core_hash_first_iter(kazoo_globals.event_filter, hi); hi; hi = switch_core_hash_next(&hi)) { + const void *key; + void *val; + switch_core_hash_this(hi, &key, NULL, &val); + stream->write_function(stream, "%-50s", (char *)key); + if (++column > 2) { + stream->write_function(stream, "\n"); + column = 0; + } + } + + if (++column > 2) { + stream->write_function(stream, "\n"); + column = 0; + } + + stream->write_function(stream, "%-50s", kazoo_globals.kazoo_var_prefix); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t api_erlang_nodes_list(switch_stream_handle_t *stream) { + ei_node_t *ei_node; + + switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); + ei_node = kazoo_globals.ei_nodes; + while(ei_node != NULL) { + stream->write_function(stream, "%s (%s)\n", ei_node->peer_nodename, ei_node->remote_ip); + ei_node = ei_node->next; + } + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t api_erlang_nodes_count(switch_stream_handle_t *stream) { + ei_node_t *ei_node; + int count = 0; + + switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); + ei_node = kazoo_globals.ei_nodes; + while(ei_node != NULL) { + count++; + ei_node = ei_node->next; + } + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + + stream->write_function(stream, "%d\n", count); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t api_complete_erlang_node(const char *line, const char *cursor, switch_console_callback_match_t **matches) { + switch_console_callback_match_t *my_matches = NULL; + switch_status_t status = SWITCH_STATUS_FALSE; + ei_node_t *ei_node; + + switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); + ei_node = kazoo_globals.ei_nodes; + while(ei_node != NULL) { + switch_console_push_match(&my_matches, ei_node->peer_nodename); + ei_node = ei_node->next; + } + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + + if (my_matches) { + *matches = my_matches; + status = SWITCH_STATUS_SUCCESS; + } + + return status; +} + +static switch_status_t handle_node_api_event_stream(ei_event_stream_t *event_stream, switch_stream_handle_t *stream) { + ei_event_binding_t *binding; + int column = 0; + + switch_mutex_lock(event_stream->socket_mutex); + if (event_stream->connected == SWITCH_FALSE) { + switch_sockaddr_t *sa; + uint16_t port; + char ipbuf[48] = {0}; + const char *ip_addr; + + switch_socket_addr_get(&sa, SWITCH_TRUE, event_stream->acceptor); + port = switch_sockaddr_get_port(sa); + ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); + + if (zstr(ip_addr)) { + ip_addr = kazoo_globals.ip; + } + + stream->write_function(stream, "%s:%d -> disconnected\n" + ,ip_addr, port); + } else { + stream->write_function(stream, "%s:%d -> %s:%d\n" + ,event_stream->local_ip, event_stream->local_port + ,event_stream->remote_ip, event_stream->remote_port); + } + + binding = event_stream->bindings; + while(binding != NULL) { + if (binding->type == SWITCH_EVENT_CUSTOM) { + stream->write_function(stream, "CUSTOM %-43s", binding->subclass_name); + } else { + stream->write_function(stream, "%-50s", switch_event_name(binding->type)); + } + + if (++column > 2) { + stream->write_function(stream, "\n"); + column = 0; + } + + binding = binding->next; + } + switch_mutex_unlock(event_stream->socket_mutex); + + if (!column) { + stream->write_function(stream, "\n"); + } else { + stream->write_function(stream, "\n\n"); + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t handle_node_api_event_streams(ei_node_t *ei_node, switch_stream_handle_t *stream) { + ei_event_stream_t *event_stream; + + switch_mutex_lock(ei_node->event_streams_mutex); + event_stream = ei_node->event_streams; + while(event_stream != NULL) { + handle_node_api_event_stream(event_stream, stream); + event_stream = event_stream->next; + } + switch_mutex_unlock(ei_node->event_streams_mutex); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t handle_node_api_command(ei_node_t *ei_node, switch_stream_handle_t *stream, uint32_t command) { + unsigned int year, day, hour, min, sec, delta; + + switch (command) { + case API_COMMAND_DISCONNECT: + stream->write_function(stream, "Disconnecting erlang node %s at managers request\n", ei_node->peer_nodename); + switch_clear_flag(ei_node, LFLAG_RUNNING); + break; + case API_COMMAND_REMOTE_IP: + delta = (switch_micro_time_now() - ei_node->created_time) / 1000000; + sec = delta % 60; + min = delta / 60 % 60; + hour = delta / 3600 % 24; + day = delta / 86400 % 7; + year = delta / 31556926 % 12; + + stream->write_function(stream, "Uptime %d years, %d days, %d hours, %d minutes, %d seconds\n", year, day, hour, min, sec); + stream->write_function(stream, "Local Address %s:%d\n", ei_node->local_ip, ei_node->local_port); + stream->write_function(stream, "Remote Address %s:%d\n", ei_node->remote_ip, ei_node->remote_port); + break; + case API_COMMAND_STREAMS: + handle_node_api_event_streams(ei_node, stream); + break; + case API_COMMAND_BINDINGS: + handle_api_command_streams(ei_node, stream); + break; + default: + break; + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t api_erlang_node_command(switch_stream_handle_t *stream, const char *nodename, uint32_t command) { + ei_node_t *ei_node; + + switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); + ei_node = kazoo_globals.ei_nodes; + while(ei_node != NULL) { + int length = strlen(ei_node->peer_nodename); + + if (!strncmp(ei_node->peer_nodename, nodename, length)) { + handle_node_api_command(ei_node, stream, command); + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + return SWITCH_STATUS_SUCCESS; + } + + ei_node = ei_node->next; + } + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + + return SWITCH_STATUS_NOTFOUND; +} + +SWITCH_STANDARD_API(exec_api_cmd) +{ + char *argv[1024] = { 0 }; + int unknown_command = 1, argc = 0; + char *mycmd = NULL; + + const char *usage_string = "USAGE:\n" + "--------------------------------------------------------------------------------------------------------------------\n" + "erlang status - provides an overview of the current status\n" + "erlang event_filter - lists the event headers that will be sent to Erlang nodes\n" + "erlang nodes list - lists connected Erlang nodes (usefull for monitoring tools)\n" + "erlang nodes count - provides a count of connected Erlang nodes (usefull for monitoring tools)\n" + "erlang node disconnect - disconnects an Erlang node\n" + "erlang node connection - Shows the connection info\n" + "erlang node event_streams - lists the event streams for an Erlang node\n" + "erlang node fetch_bindings - lists the XML fetch bindings for an Erlang node\n" + "---------------------------------------------------------------------------------------------------------------------\n"; + + if (zstr(cmd)) { + stream->write_function(stream, "%s", usage_string); + return SWITCH_STATUS_SUCCESS; + } + + if (!(mycmd = strdup(cmd))) { + return SWITCH_STATUS_MEMERR; + } + + if (!(argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { + stream->write_function(stream, "%s", usage_string); + switch_safe_free(mycmd); + return SWITCH_STATUS_SUCCESS; + } + + if (zstr(argv[0])) { + stream->write_function(stream, "%s", usage_string); + switch_safe_free(mycmd); + return SWITCH_STATUS_SUCCESS; + } + + if (!strncmp(argv[0], "status", 6)) { + unknown_command = 0; + api_erlang_status(stream); + } else if (!strncmp(argv[0], "event_filter", 6)) { + unknown_command = 0; + api_erlang_event_filter(stream); + } else if (!strncmp(argv[0], "nodes", 6) && !zstr(argv[1])) { + if (!strncmp(argv[1], "list", 6)) { + unknown_command = 0; + api_erlang_nodes_list(stream); + } else if (!strncmp(argv[1], "count", 6)) { + unknown_command = 0; + api_erlang_nodes_count(stream); + } + } else if (!strncmp(argv[0], "node", 6) && !zstr(argv[1]) && !zstr(argv[2])) { + if (!strncmp(argv[2], "disconnect", 6)) { + unknown_command = 0; + api_erlang_node_command(stream, argv[1], API_COMMAND_DISCONNECT); + } else if (!strncmp(argv[2], "connection", 2)) { + unknown_command = 0; + api_erlang_node_command(stream, argv[1], API_COMMAND_REMOTE_IP); + } else if (!strncmp(argv[2], "event_streams", 6)) { + unknown_command = 0; + api_erlang_node_command(stream, argv[1], API_COMMAND_STREAMS); + } else if (!strncmp(argv[2], "fetch_bindings", 6)) { + unknown_command = 0; + api_erlang_node_command(stream, argv[1], API_COMMAND_BINDINGS); + } + } + + if (unknown_command) { + stream->write_function(stream, "%s", usage_string); + } + + switch_safe_free(mycmd); + return SWITCH_STATUS_SUCCESS; +} + +void add_cli_api(switch_loadable_module_interface_t **module_interface, switch_api_interface_t *api_interface) +{ + SWITCH_ADD_API(api_interface, "erlang", KAZOO_DESC, exec_api_cmd, KAZOO_SYNTAX); + switch_console_set_complete("add erlang status"); + switch_console_set_complete("add erlang event_filter"); + switch_console_set_complete("add erlang nodes list"); + switch_console_set_complete("add erlang nodes count"); + switch_console_set_complete("add erlang node ::erlang::node disconnect"); + switch_console_set_complete("add erlang node ::erlang::node connection"); + switch_console_set_complete("add erlang node ::erlang::node event_streams"); + switch_console_set_complete("add erlang node ::erlang::node fetch_bindings"); + switch_console_add_complete_func("::erlang::node", api_complete_erlang_node); + +} + +void remove_cli_api() +{ + switch_console_set_complete("del erlang"); + switch_console_del_complete_func("::erlang::node"); + +} + + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_commands.c b/src/mod/event_handlers/mod_kazoo/kazoo_commands.c index 2494bb9495..5002558398 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_commands.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_commands.c @@ -31,6 +31,7 @@ * */ #include "mod_kazoo.h" +#include #include #define UUID_SET_DESC "Set a variable" @@ -158,6 +159,11 @@ SWITCH_STANDARD_API(uuid_setvar_multi_function) { return SWITCH_STATUS_SUCCESS; } +static size_t body_callback(char *buffer, size_t size, size_t nitems, void *userdata) +{ + return size * nitems; +} + static size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata) { switch_event_t* event = (switch_event_t*)userdata; @@ -182,6 +188,7 @@ SWITCH_STANDARD_API(kz_http_put) switch_event_t *params = NULL; char *url = NULL; char *filename = NULL; + int delete = 0; switch_curl_slist_t *headers = NULL; /* optional linked-list of HTTP headers */ char *ext; /* file extension, used for MIME type identification */ @@ -279,6 +286,8 @@ SWITCH_STANDARD_API(kz_http_put) switch_curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-http-cache/1.0"); switch_curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, stream->param_event); switch_curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback); + switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, body_callback); + switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0L); switch_curl_easy_perform(curl_handle); switch_curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &httpRes); @@ -286,22 +295,24 @@ SWITCH_STANDARD_API(kz_http_put) if (httpRes == 200 || httpRes == 201 || httpRes == 202 || httpRes == 204) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s saved to %s\n", filename, url); - switch_event_add_header(stream->param_event, SWITCH_STACK_BOTTOM, "API-Output", "%s saved to %s\n", filename, url); - stream->write_function(stream, "+OK\n"); + switch_event_add_header(stream->param_event, SWITCH_STACK_BOTTOM, "API-Output", "%s saved to %s", filename, url); + stream->write_function(stream, "+OK %s saved to %s", filename, url); + delete = 1; } else { error = switch_mprintf("Received HTTP error %ld trying to save %s to %s", httpRes, filename, url); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s\n", error); switch_event_add_header(stream->param_event, SWITCH_STACK_BOTTOM, "API-Error", "%s", error); switch_event_add_header(stream->param_event, SWITCH_STACK_BOTTOM, "API-HTTP-Error", "%ld", httpRes); - stream->write_function(stream, "-ERR "); - stream->write_function(stream, error); - stream->write_function(stream, "\n"); + stream->write_function(stream, "-ERR %s", error); status = SWITCH_STATUS_GENERR; } done: if (file_to_put) { fclose(file_to_put); + if(delete && kazoo_globals.delete_file_after_put) { + remove(filename); + } } if (headers) { diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_config.c b/src/mod/event_handlers/mod_kazoo/kazoo_config.c new file mode 100644 index 0000000000..f953bfc391 --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_config.c @@ -0,0 +1,535 @@ +/* +* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* Copyright (C) 2005-2012, Anthony Minessale II +* +* Version: MPL 1.1 +* +* The contents of this file are subject to the Mozilla Public License Version +* 1.1 (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* http://www.mozilla.org/MPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* +* The Initial Developer of the Original Code is +* Anthony Minessale II +* Portions created by the Initial Developer are Copyright (C) +* the Initial Developer. All Rights Reserved. +* +* Based on mod_skel by +* Anthony Minessale II +* +* Contributor(s): +* +* Daniel Bryars +* Tim Brown +* Anthony Minessale II +* William King +* Mike Jerris +* +* kazoo.c -- Sends FreeSWITCH events to an AMQP broker +* +*/ + +#include "mod_kazoo.h" + +static const char *LOG_LEVEL_NAMES[] = { + "SWITCH_LOG_DEBUG10", + "SWITCH_LOG_DEBUG9", + "SWITCH_LOG_DEBUG8", + "SWITCH_LOG_DEBUG7", + "SWITCH_LOG_DEBUG6", + "SWITCH_LOG_DEBUG5", + "SWITCH_LOG_DEBUG4", + "SWITCH_LOG_DEBUG3", + "SWITCH_LOG_DEBUG2", + "SWITCH_LOG_DEBUG1", + "SWITCH_LOG_DEBUG", + "SWITCH_LOG_INFO", + "SWITCH_LOG_NOTICE", + "SWITCH_LOG_WARNING", + "SWITCH_LOG_ERROR", + "SWITCH_LOG_CRIT", + "SWITCH_LOG_ALERT", + "SWITCH_LOG_CONSOLE", + "SWITCH_LOG_INVALID", + "SWITCH_LOG_UNINIT", + NULL +}; + +static const switch_log_level_t LOG_LEVEL_VALUES[] = { + SWITCH_LOG_DEBUG10, + SWITCH_LOG_DEBUG9, + SWITCH_LOG_DEBUG8, + SWITCH_LOG_DEBUG7, + SWITCH_LOG_DEBUG6, + SWITCH_LOG_DEBUG5, + SWITCH_LOG_DEBUG4, + SWITCH_LOG_DEBUG3, + SWITCH_LOG_DEBUG2, + SWITCH_LOG_DEBUG1, + SWITCH_LOG_DEBUG, + SWITCH_LOG_INFO, + SWITCH_LOG_NOTICE, + SWITCH_LOG_WARNING, + SWITCH_LOG_ERROR, + SWITCH_LOG_CRIT, + SWITCH_LOG_ALERT, + SWITCH_LOG_CONSOLE, + SWITCH_LOG_INVALID, + SWITCH_LOG_UNINIT +}; + +switch_log_level_t log_str2level(const char *str) +{ + int x = 0; + switch_log_level_t level = SWITCH_LOG_INVALID; + + if (switch_is_number(str)) { + x = atoi(str); + + if (x > SWITCH_LOG_INVALID) { + return SWITCH_LOG_INVALID - 1; + } else if (x < 0) { + return 0; + } else { + return x; + } + } + + + for (x = 0;; x++) { + if (!LOG_LEVEL_NAMES[x]) { + break; + } + + if (!strcasecmp(LOG_LEVEL_NAMES[x], str)) { + level = LOG_LEVEL_VALUES[x]; //(switch_log_level_t) x; + break; + } + } + + return level; +} + +switch_status_t kazoo_config_loglevels(switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_loglevels_ptr *ptr) +{ + switch_xml_t xml_level, xml_logging; + kazoo_loglevels_ptr loglevels = (kazoo_loglevels_ptr) switch_core_alloc(pool, sizeof(kazoo_loglevels_t)); + + loglevels->failed_log_level = SWITCH_LOG_ALERT; + loglevels->filtered_event_log_level = SWITCH_LOG_DEBUG1; + loglevels->filtered_field_log_level = SWITCH_LOG_DEBUG1; + loglevels->info_log_level = SWITCH_LOG_INFO; + loglevels->warn_log_level = SWITCH_LOG_WARNING; + loglevels->success_log_level = SWITCH_LOG_DEBUG; + loglevels->time_log_level = SWITCH_LOG_DEBUG1; + + if ((xml_logging = switch_xml_child(cfg, "logging")) != NULL) { + for (xml_level = switch_xml_child(xml_logging, "log"); xml_level; xml_level = xml_level->next) { + char *var = (char *) switch_xml_attr_soft(xml_level, "name"); + char *val = (char *) switch_xml_attr_soft(xml_level, "value"); + + if (!var) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "logging param missing 'name' attribute\n"); + continue; + } + + if (!val) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "logging param[%s] missing 'value' attribute\n", var); + continue; + } + + if (!strncmp(var, "success", 7)) { + loglevels->success_log_level = log_str2level(val); + } else if (!strncmp(var, "failed", 6)) { + loglevels->failed_log_level = log_str2level(val); + } else if (!strncmp(var, "info", 4)) { + loglevels->info_log_level = log_str2level(val); + } else if (!strncmp(var, "warn", 4)) { + loglevels->warn_log_level = log_str2level(val); + } else if (!strncmp(var, "time", 4)) { + loglevels->time_log_level = log_str2level(val); + } else if (!strncmp(var, "filtered-event", 14)) { + loglevels->filtered_event_log_level = log_str2level(val); + } else if (!strncmp(var, "filtered-field", 14)) { + loglevels->filtered_field_log_level = log_str2level(val); + } + } /* xml_level for loop */ + } + + *ptr = loglevels; + return SWITCH_STATUS_SUCCESS; + +} + +switch_status_t kazoo_config_filters(switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_filter_ptr *ptr) +{ + switch_xml_t filters, filter; +// char *routing_key = NULL; + kazoo_filter_ptr root = NULL, prv = NULL, cur = NULL; + + + if ((filters = switch_xml_child(cfg, "filters")) != NULL) { + for (filter = switch_xml_child(filters, "filter"); filter; filter = filter->next) { + const char *var = switch_xml_attr(filter, "name"); + const char *val = switch_xml_attr(filter, "value"); + const char *type = switch_xml_attr(filter, "type"); + const char *compare = switch_xml_attr(filter, "compare"); + cur = (kazoo_filter_ptr) switch_core_alloc(pool, sizeof(kazoo_filter)); + memset(cur, 0, sizeof(kazoo_filter)); + if(prv == NULL) { + root = prv = cur; + } else { + prv->next = cur; + prv = cur; + } + cur->type = FILTER_EXCLUDE; + cur->compare = FILTER_COMPARE_VALUE; + + if(var) + cur->name = switch_core_strdup(pool, var); + + if(val) + cur->value = switch_core_strdup(pool, val); + + if(type) { + if (!strncmp(type, "exclude", 7)) { + cur->type = FILTER_EXCLUDE; + } else if (!strncmp(type, "include", 7)) { + cur->type = FILTER_INCLUDE; + } + } + + if(compare) { + if (!strncmp(compare, "value", 7)) { + cur->compare = FILTER_COMPARE_VALUE; + } else if (!strncmp(compare, "prefix", 6)) { + cur->compare = FILTER_COMPARE_PREFIX; + } else if (!strncmp(compare, "list", 4)) { + cur->compare = FILTER_COMPARE_LIST; + } else if (!strncmp(compare, "exists", 6)) { + cur->compare = FILTER_COMPARE_EXISTS; + } else if (!strncmp(compare, "regex", 5)) { + cur->compare = FILTER_COMPARE_REGEX; + } + } + + if(cur->value == NULL) + cur->compare = FILTER_COMPARE_EXISTS; + + if(cur->compare == FILTER_COMPARE_LIST) { + cur->list.size = switch_separate_string(cur->value, '|', cur->list.value, MAX_LIST_FIELDS); + } + + } + + } + + *ptr = root; + + return SWITCH_STATUS_SUCCESS; + +} + +switch_status_t kazoo_config_field(kazoo_config_ptr definitions, switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_field_ptr *ptr) +{ + const char *var = switch_xml_attr(cfg, "name"); + const char *val = switch_xml_attr(cfg, "value"); + const char *as = switch_xml_attr(cfg, "as"); + const char *type = switch_xml_attr(cfg, "type"); + const char *exclude_prefix = switch_xml_attr(cfg, "exclude-prefix"); + const char *serialize_as = switch_xml_attr(cfg, "serialize-as"); + kazoo_field_ptr cur = (kazoo_field_ptr) switch_core_alloc(pool, sizeof(kazoo_field)); + cur->in_type = FIELD_NONE; + cur->out_type = JSON_NONE; + + if(var) + cur->name = switch_core_strdup(pool, var); + + if(val) + cur->value = switch_core_strdup(pool, val); + + if(as) + cur->as = switch_core_strdup(pool, as); + + if(type) { + if (!strncmp(type, "copy", 4)) { + cur->in_type = FIELD_COPY; + } else if (!strncmp(type, "static", 6)) { + cur->in_type = FIELD_STATIC; + } else if (!strncmp(type, "first-of", 8)) { + cur->in_type = FIELD_FIRST_OF; + } else if (!strncmp(type, "expand", 6)) { + cur->in_type = FIELD_EXPAND; + } else if (!strncmp(type, "prefix", 10)) { + cur->in_type = FIELD_PREFIX; + } else if (!strncmp(type, "group", 5)) { + cur->in_type = FIELD_GROUP; + } else if (!strncmp(type, "reference", 9)) { + cur->in_type = FIELD_REFERENCE; + } + } + + if(serialize_as) { + if (!strncmp(serialize_as, "string", 5)) { + cur->out_type = JSON_STRING; + } else if (!strncmp(serialize_as, "number", 6)) { + cur->out_type = JSON_NUMBER; + } else if (!strncmp(serialize_as, "boolean", 7)) { + cur->out_type = JSON_BOOLEAN; + } else if (!strncmp(serialize_as, "object", 6)) { + cur->out_type = JSON_OBJECT; + } else if (!strncmp(serialize_as, "raw", 6)) { + cur->out_type = JSON_RAW; + } + } + + if(exclude_prefix) + cur->exclude_prefix = switch_true(exclude_prefix); + + kazoo_config_filters(pool, cfg, &cur->filter); + kazoo_config_fields(definitions, pool, cfg, &cur->children); + + if(cur->children != NULL + && (cur->in_type == FIELD_STATIC) + && (cur->out_type == JSON_NONE) + ) { + cur->out_type = JSON_OBJECT; + } + if(cur->in_type == FIELD_NONE) { + cur->in_type = FIELD_COPY; + } + + if(cur->out_type == JSON_NONE) { + cur->out_type = JSON_STRING; + } + + if(cur->in_type == FIELD_FIRST_OF) { + cur->list.size = switch_separate_string(cur->value, '|', cur->list.value, MAX_LIST_FIELDS); + } + + if(cur->in_type == FIELD_REFERENCE) { + cur->ref = (kazoo_definition_ptr)switch_core_hash_find(definitions->hash, cur->name); + if(cur->ref == NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "referenced field %s not found\n", cur->name); + } + } + + *ptr = cur; + + return SWITCH_STATUS_SUCCESS; + +} + +switch_status_t kazoo_config_fields_loop(kazoo_config_ptr definitions, switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_field_ptr *ptr) +{ + switch_xml_t field; + kazoo_field_ptr root = NULL, prv = NULL; + + + for (field = switch_xml_child(cfg, "field"); field; field = field->next) { + kazoo_field_ptr cur = NULL; + kazoo_config_field(definitions, pool, field, &cur); + if(root == NULL) { + root = prv = cur; + } else { + prv->next = cur; + prv = cur; + } + } + + *ptr = root; + + return SWITCH_STATUS_SUCCESS; + +} + +switch_status_t kazoo_config_fields(kazoo_config_ptr definitions, switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_fields_ptr *ptr) +{ + switch_xml_t fields; +// char *routing_key = NULL; + kazoo_fields_ptr root = NULL; + + + if ((fields = switch_xml_child(cfg, "fields")) != NULL) { + const char *verbose = switch_xml_attr(fields, "verbose"); + root = (kazoo_fields_ptr) switch_core_alloc(pool, sizeof(kazoo_fields)); + root->verbose = SWITCH_TRUE; + if(verbose) { + root->verbose = switch_true(verbose); + } + + kazoo_config_fields_loop(definitions, pool, fields, &root->head); + + } + + *ptr = root; + + return SWITCH_STATUS_SUCCESS; + +} + +kazoo_config_ptr kazoo_config_event_handlers(kazoo_config_ptr definitions, switch_xml_t cfg) +{ + switch_xml_t xml_profiles = NULL, xml_profile = NULL; + kazoo_config_ptr profiles = NULL; + switch_memory_pool_t *pool = NULL; + + if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "error creating memory pool for producers\n"); + return NULL; + } + + profiles = switch_core_alloc(pool, sizeof(kazoo_config)); + profiles->pool = pool; + switch_core_hash_init(&profiles->hash); + + if ((xml_profiles = switch_xml_child(cfg, "event-handlers"))) { + if ((xml_profile = switch_xml_child(xml_profiles, "profile"))) { + for (; xml_profile; xml_profile = xml_profile->next) { + const char *name = switch_xml_attr(xml_profile, "name"); + if(name == NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "missing attr name\n" ); + continue; + } + kazoo_config_event_handler(definitions, profiles, xml_profile, NULL); + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Unable to locate a event-handler profile for kazoo\n" ); + } + } else { + destroy_config(&profiles); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unable to locate event-handlers section for kazoo\n" ); + } + + return profiles; + +} + +kazoo_config_ptr kazoo_config_fetch_handlers(kazoo_config_ptr definitions, switch_xml_t cfg) +{ + switch_xml_t xml_profiles = NULL, xml_profile = NULL; + kazoo_config_ptr profiles = NULL; + switch_memory_pool_t *pool = NULL; + + if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "error creating memory pool for producers\n"); + return NULL; + } + + profiles = switch_core_alloc(pool, sizeof(kazoo_config)); + profiles->pool = pool; + switch_core_hash_init(&profiles->hash); + + if ((xml_profiles = switch_xml_child(cfg, "fetch-handlers"))) { + if ((xml_profile = switch_xml_child(xml_profiles, "profile"))) { + for (; xml_profile; xml_profile = xml_profile->next) { + const char *name = switch_xml_attr(xml_profile, "name"); + if(name == NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "missing attr name\n" ); + continue; + } + kazoo_config_fetch_handler(definitions, profiles, xml_profile, NULL); + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Unable to locate a fetch-handler profile for kazoo\n" ); + } + } else { + destroy_config(&profiles); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unable to locate fetch-handlers section for kazoo\n" ); + } + + return profiles; + +} + + +switch_status_t kazoo_config_definition(kazoo_config_ptr root, switch_xml_t cfg) +{ + kazoo_definition_ptr definition = NULL; + char *name = (char *) switch_xml_attr_soft(cfg, "name"); + + if (zstr(name)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to load kazoo profile. Check definition missing name attr\n"); + return SWITCH_STATUS_GENERR; + } + + definition = switch_core_alloc(root->pool, sizeof(kazoo_definition)); + definition->name = switch_core_strdup(root->pool, name); + + kazoo_config_filters(root->pool, cfg, &definition->filter); + kazoo_config_fields_loop(root, root->pool, cfg, &definition->head); + + if ( switch_core_hash_insert(root->hash, name, (void *) definition) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to insert new definition [%s] into kazoo definitions hash\n", name); + return SWITCH_STATUS_GENERR; + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Definition[%s] Successfully configured\n", definition->name); + return SWITCH_STATUS_SUCCESS; +} + +kazoo_config_ptr kazoo_config_definitions(switch_xml_t cfg) +{ + switch_xml_t xml_definitions = NULL, xml_definition = NULL; + kazoo_config_ptr definitions = NULL; + switch_memory_pool_t *pool = NULL; + + if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "error creating memory pool for definitions\n"); + return NULL; + } + + definitions = switch_core_alloc(pool, sizeof(kazoo_config)); + definitions->pool = pool; + switch_core_hash_init(&definitions->hash); + + if ((xml_definitions = switch_xml_child(cfg, "definitions"))) { + if ((xml_definition = switch_xml_child(xml_definitions, "definition"))) { + for (; xml_definition; xml_definition = xml_definition->next) { + kazoo_config_definition(definitions, xml_definition); + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "no definitions for kazoo\n" ); + } + } else { + destroy_config(&definitions); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "no definitions section for kazoo\n" ); + } + + return definitions; +} + +void destroy_config(kazoo_config_ptr *ptr) +{ + kazoo_config_ptr config = NULL; + switch_memory_pool_t *pool; + + if (!ptr || !*ptr) { + return; + } + config = *ptr; + pool = config->pool; + + switch_core_hash_destroy(&(config->hash)); + switch_core_destroy_memory_pool(&pool); + + *ptr = NULL; +} + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4 + */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_config.h b/src/mod/event_handlers/mod_kazoo/kazoo_config.h new file mode 100644 index 0000000000..cb6c92ba59 --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_config.h @@ -0,0 +1,62 @@ +/* +* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* Copyright (C) 2005-2012, Anthony Minessale II +* +* Version: MPL 1.1 +* +* The contents of this file are subject to the Mozilla Public License Version +* 1.1 (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* http://www.mozilla.org/MPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* +* The Initial Developer of the Original Code is +* Anthony Minessale II +* Portions created by the Initial Developer are Copyright (C) +* the Initial Developer. All Rights Reserved. +* +* Based on mod_skel by +* Anthony Minessale II +* +* Contributor(s): +* +* Daniel Bryars +* Tim Brown +* Anthony Minessale II +* William King +* Mike Jerris +* +* kazoo.c -- Sends FreeSWITCH events to an AMQP broker +* +*/ + +#ifndef KAZOO_CONFIG_H +#define KAZOO_CONFIG_H + +#include + + +struct kazoo_config_t { + switch_hash_t *hash; + switch_memory_pool_t *pool; +}; + +switch_status_t kazoo_config_loglevels(switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_loglevels_ptr *ptr); +switch_status_t kazoo_config_filters(switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_filter_ptr *ptr); +switch_status_t kazoo_config_fields(kazoo_config_ptr definitions, switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_fields_ptr *ptr); + +switch_status_t kazoo_config_event_handler(kazoo_config_ptr definitions, kazoo_config_ptr root, switch_xml_t cfg, kazoo_event_profile_ptr *ptr); +switch_status_t kazoo_config_fetch_handler(kazoo_config_ptr definitions, kazoo_config_ptr root, switch_xml_t cfg, kazoo_fetch_profile_ptr *ptr); +kazoo_config_ptr kazoo_config_event_handlers(kazoo_config_ptr definitions, switch_xml_t cfg); +kazoo_config_ptr kazoo_config_fetch_handlers(kazoo_config_ptr definitions, switch_xml_t cfg); +kazoo_config_ptr kazoo_config_definitions(switch_xml_t cfg); +void destroy_config(kazoo_config_ptr *ptr); + +#endif /* KAZOO_CONFIG_H */ + diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c b/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c index 0ea4cf6f2c..bf90626564 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c @@ -52,6 +52,14 @@ #define EXPORT_LONG_DESC "Export many channel variables for the channel calling the application" #define EXPORT_SYNTAX "[^^]= =" +#define PREFIX_UNSET_SHORT_DESC "clear variables by prefix" +#define PREFIX_UNSET_LONG_DESC "clears the channel variables that start with prefix supplied" +#define PREFIX_UNSET_SYNTAX "" + +#define UUID_MULTISET_SHORT_DESC "Set many channel variables" +#define UUID_MULTISET_LONG_DESC "Set many channel variables for a specific channel" +#define UUID_MULTISET_SYNTAX " [^^]= =" + static void base_set (switch_core_session_t *session, const char *data, switch_stack_t stack) { char *var, *val = NULL; @@ -99,6 +107,22 @@ static void base_set (switch_core_session_t *session, const char *data, switch_s } } +static int kz_is_exported(switch_core_session_t *session, char *varname) +{ + char *array[256] = {0}; + int i, argc; + switch_channel_t *channel = switch_core_session_get_channel(session); + const char *exports = switch_channel_get_variable(channel, SWITCH_EXPORT_VARS_VARIABLE); + char *arg = switch_core_session_strdup(session, exports); + argc = switch_split(arg, ',', array); + for(i=0; i < argc; i++) { + if(!strcasecmp(array[i], varname)) + return 1; + } + + return 0; +} + static void base_export (switch_core_session_t *session, const char *data, switch_stack_t stack) { char *var, *val = NULL; @@ -121,20 +145,52 @@ static void base_export (switch_core_session_t *session, const char *data, switc } } - if (val) { - expanded = switch_channel_expand_variables(channel, val); - } + if(!kz_is_exported(session, var)) { + if (val) { + expanded = switch_channel_expand_variables(channel, val); + } - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s EXPORT [%s]=[%s]\n", switch_channel_get_name(channel), var, - expanded ? expanded : "UNDEF"); - switch_channel_export_variable_var_check(channel, var, expanded, SWITCH_EXPORT_VARS_VARIABLE, SWITCH_FALSE); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s EXPORT [%s]=[%s]\n", switch_channel_get_name(channel), var, + expanded ? expanded : "UNDEF"); + switch_channel_export_variable_var_check(channel, var, expanded, SWITCH_EXPORT_VARS_VARIABLE, SWITCH_FALSE); - if (expanded && expanded != val) { - switch_safe_free(expanded); + if (expanded && expanded != val) { + switch_safe_free(expanded); + } + } else { + switch_channel_set_variable(channel, var, val); } } } +SWITCH_STANDARD_APP(prefix_unset_function) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_event_header_t *ei = NULL; + switch_event_t *clear; + char *arg = (char *) data; + + if(switch_event_create(&clear, SWITCH_EVENT_CLONE) != SWITCH_STATUS_SUCCESS) { + return; + } + + for (ei = switch_channel_variable_first(channel); ei; ei = ei->next) { + const char *name = ei->name; + char *value = ei->value; + if (!strncasecmp(name, arg, strlen(arg))) { + switch_event_add_header_string(clear, SWITCH_STACK_BOTTOM, name, value); + } + } + + switch_channel_variable_last(channel); + for (ei = clear->headers; ei; ei = ei->next) { + char *varname = ei->name; + switch_channel_set_variable(channel, varname, NULL); + } + + switch_event_destroy(&clear); +} + SWITCH_STANDARD_APP(multiset_function) { char delim = ' '; char *arg = (char *) data; @@ -145,25 +201,79 @@ SWITCH_STANDARD_APP(multiset_function) { delim = *arg++; } - if (arg) { + if(delim != '\0') { switch_channel_t *channel = switch_core_session_get_channel(session); - char *array[256] = {0}; - int i, argc; + if (arg) { + char *array[256] = {0}; + int i, argc; - arg = switch_core_session_strdup(session, arg); - argc = switch_split(arg, delim, array); + arg = switch_core_session_strdup(session, arg); + argc = switch_split(arg, delim, array); - for(i = 0; i < argc; i++) { - base_set(session, array[i], SWITCH_STACK_BOTTOM); + for(i = 0; i < argc; i++) { + base_set(session, array[i], SWITCH_STACK_BOTTOM); + } } - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { switch_channel_event_set_data(channel, event); switch_event_fire(&event); } - } else { - base_set(session, data, SWITCH_STACK_BOTTOM); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "multiset with empty args\n"); + } +} + +SWITCH_STANDARD_APP(uuid_multiset_function) { + + char delim = ' '; + char *arg0 = (char *) data; + char *arg = strchr(arg0, ' '); + switch_event_t *event; + + + if(arg == NULL) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "uuid_multiset with invalid args\n"); + return; + } + *arg = '\0'; + arg++; + + if(zstr(arg0)) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "uuid_multiset with invalid uuid\n"); + return; + } + + + if (!zstr(arg) && *arg == '^' && *(arg+1) == '^') { + arg += 2; + delim = *arg++; + } + + if(delim != '\0') { + switch_core_session_t *uuid_session = NULL; + if ((uuid_session = switch_core_session_force_locate(arg0)) != NULL) { + switch_channel_t *uuid_channel = switch_core_session_get_channel(uuid_session); + if (arg) { + char *array[256] = {0}; + int i, argc; + + arg = switch_core_session_strdup(session, arg); + argc = switch_split(arg, delim, array); + + for(i = 0; i < argc; i++) { + base_set(uuid_session, array[i], SWITCH_STACK_BOTTOM); + } + } + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_data(uuid_channel, event); + switch_event_fire(&event); + } + switch_core_session_rwunlock(uuid_session); + } else { + base_set(session, data, SWITCH_STACK_BOTTOM); + } + } else { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "multiset with empty args\n"); } } @@ -205,19 +315,23 @@ SWITCH_STANDARD_APP(multiunset_function) { delim = *arg++; } - if (arg) { - char *array[256] = {0}; - int i, argc; + if(delim != '\0') { + if (arg) { + char *array[256] = {0}; + int i, argc; - arg = switch_core_session_strdup(session, arg); - argc = switch_split(arg, delim, array); + arg = switch_core_session_strdup(session, arg); + argc = switch_split(arg, delim, array); - for(i = 0; i < argc; i++) { - switch_channel_set_variable(switch_core_session_get_channel(session), array[i], NULL); + for(i = 0; i < argc; i++) { + switch_channel_set_variable(switch_core_session_get_channel(session), array[i], NULL); + } + + } else { + switch_channel_set_variable(switch_core_session_get_channel(session), arg, NULL); } - } else { - switch_channel_set_variable(switch_core_session_get_channel(session), arg, NULL); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "multiunset with empty args\n"); } } @@ -230,18 +344,22 @@ SWITCH_STANDARD_APP(export_function) { delim = *arg++; } - if (arg) { - char *array[256] = {0}; - int i, argc; + if(delim != '\0') { + if (arg) { + char *array[256] = {0}; + int i, argc; - arg = switch_core_session_strdup(session, arg); - argc = switch_split(arg, delim, array); + arg = switch_core_session_strdup(session, arg); + argc = switch_split(arg, delim, array); - for(i = 0; i < argc; i++) { - base_export(session, array[i], SWITCH_STACK_BOTTOM); - } + for(i = 0; i < argc; i++) { + base_export(session, array[i], SWITCH_STACK_BOTTOM); + } + } else { + base_export(session, data, SWITCH_STACK_BOTTOM); + } } else { - base_export(session, data, SWITCH_STACK_BOTTOM); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "export with empty args\n"); } } @@ -254,6 +372,11 @@ void add_kz_dptools(switch_loadable_module_interface_t **module_interface, switc SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); SWITCH_ADD_APP(app_interface, "kz_multiunset", MULTISET_SHORT_DESC, MULTISET_LONG_DESC, multiunset_function, MULTIUNSET_SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); - SWITCH_ADD_APP(app_interface, "kz_export", EXPORT_SHORT_DESC, EXPORT_LONG_DESC, export_function, EXPORT_SYNTAX, - SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); + SWITCH_ADD_APP(app_interface, "kz_export", EXPORT_SHORT_DESC, EXPORT_LONG_DESC, export_function, EXPORT_SYNTAX, + SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); + SWITCH_ADD_APP(app_interface, "kz_prefix_unset", PREFIX_UNSET_SHORT_DESC, PREFIX_UNSET_LONG_DESC, prefix_unset_function, PREFIX_UNSET_SYNTAX, + SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); + SWITCH_ADD_APP(app_interface, "kz_uuid_multiset", UUID_MULTISET_SHORT_DESC, UUID_MULTISET_LONG_DESC, uuid_multiset_function, UUID_MULTISET_SYNTAX, + SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); + } diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_ei.h b/src/mod/event_handlers/mod_kazoo/kazoo_ei.h new file mode 100644 index 0000000000..c317b617be --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_ei.h @@ -0,0 +1,262 @@ +#ifndef KAZOO_EI_H +#define KAZOO_EI_H + +#include +#include + +#define MODNAME "mod_kazoo" +#define BUNDLE "community" +#define RELEASE "v1.5.0-1" +#define VERSION "mod_kazoo v1.5.0-1 community" + +typedef enum {KAZOO_FETCH_PROFILE, KAZOO_EVENT_PROFILE} kazoo_profile_type; + +typedef enum {ERLANG_TUPLE, ERLANG_MAP} kazoo_json_term; + +typedef struct ei_xml_agent_s ei_xml_agent_t; +typedef ei_xml_agent_t *ei_xml_agent_ptr; + +typedef struct kazoo_event kazoo_event_t; +typedef kazoo_event_t *kazoo_event_ptr; + +typedef struct kazoo_event_profile kazoo_event_profile_t; +typedef kazoo_event_profile_t *kazoo_event_profile_ptr; + +typedef struct kazoo_fetch_profile kazoo_fetch_profile_t; +typedef kazoo_fetch_profile_t *kazoo_fetch_profile_ptr; + +typedef struct kazoo_config_t kazoo_config; +typedef kazoo_config *kazoo_config_ptr; + +#include "kazoo_fields.h" +#include "kazoo_config.h" + +struct ei_send_msg_s { + ei_x_buff buf; + erlang_pid pid; +}; +typedef struct ei_send_msg_s ei_send_msg_t; + +struct ei_received_msg_s { + ei_x_buff buf; + erlang_msg msg; +}; +typedef struct ei_received_msg_s ei_received_msg_t; + + +typedef struct ei_event_stream_s ei_event_stream_t; +typedef struct ei_node_s ei_node_t; + +struct ei_event_binding_s { + char id[SWITCH_UUID_FORMATTED_LENGTH + 1]; + switch_event_node_t *node; + switch_event_types_t type; + const char *subclass_name; + ei_event_stream_t* stream; + kazoo_event_ptr event; + + struct ei_event_binding_s *next; +}; +typedef struct ei_event_binding_s ei_event_binding_t; + +struct ei_event_stream_s { + switch_memory_pool_t *pool; + ei_event_binding_t *bindings; + switch_queue_t *queue; + switch_socket_t *acceptor; + switch_pollset_t *pollset; + switch_pollfd_t *pollfd; + switch_socket_t *socket; + switch_mutex_t *socket_mutex; + switch_bool_t connected; + char remote_ip[48]; + uint16_t remote_port; + char local_ip[48]; + uint16_t local_port; + erlang_pid pid; + uint32_t flags; + ei_node_t *node; + struct ei_event_stream_s *next; +}; + +struct ei_node_s { + int nodefd; + switch_atomic_t pending_bgapi; + switch_atomic_t receive_handlers; + switch_memory_pool_t *pool; + ei_event_stream_t *event_streams; + switch_mutex_t *event_streams_mutex; + switch_queue_t *send_msgs; + switch_queue_t *received_msgs; + char *peer_nodename; + switch_time_t created_time; + switch_socket_t *socket; + char remote_ip[48]; + uint16_t remote_port; + char local_ip[48]; + uint16_t local_port; + uint32_t flags; + int legacy; + struct ei_node_s *next; +}; + + +struct xml_fetch_reply_s { + char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; + char *xml_str; + struct xml_fetch_reply_s *next; +}; +typedef struct xml_fetch_reply_s xml_fetch_reply_t; + +struct fetch_handler_s { + erlang_pid pid; + struct fetch_handler_s *next; +}; +typedef struct fetch_handler_s fetch_handler_t; + +struct ei_xml_client_s { + ei_node_t *ei_node; + fetch_handler_t *fetch_handlers; + struct ei_xml_client_s *next; +}; +typedef struct ei_xml_client_s ei_xml_client_t; + +struct ei_xml_agent_s { + switch_memory_pool_t *pool; + switch_xml_section_t section; + switch_thread_rwlock_t *lock; + ei_xml_client_t *clients; + switch_mutex_t *current_client_mutex; + ei_xml_client_t *current_client; + switch_mutex_t *replies_mutex; + switch_thread_cond_t *new_reply; + xml_fetch_reply_t *replies; + kazoo_fetch_profile_ptr profile; + +}; + +struct globals_s { + switch_memory_pool_t *pool; + switch_atomic_t threads; + switch_socket_t *acceptor; + struct ei_cnode_s ei_cnode; + switch_thread_rwlock_t *ei_nodes_lock; + ei_node_t *ei_nodes; + + switch_xml_binding_t *config_fetch_binding; + switch_xml_binding_t *directory_fetch_binding; + switch_xml_binding_t *dialplan_fetch_binding; + switch_xml_binding_t *channels_fetch_binding; + switch_xml_binding_t *languages_fetch_binding; + switch_xml_binding_t *chatplan_fetch_binding; + + switch_hash_t *event_filter; + int epmdfd; + int num_worker_threads; + switch_bool_t nat_map; + switch_bool_t ei_shortname; + int ei_compat_rel; + char *ip; + char *hostname; + char *ei_cookie; + char *ei_nodename; + char *kazoo_var_prefix; + int var_prefix_length; + uint32_t flags; + int send_all_headers; + int send_all_private_headers; + int connection_timeout; + int receive_timeout; + int receive_msg_preallocate; + int event_stream_preallocate; + int send_msg_batch; + short event_stream_framing; + switch_port_t port; + int config_fetched; + int io_fault_tolerance; + kazoo_event_profile_ptr events; + kazoo_config_ptr definitions; + kazoo_config_ptr event_handlers; + kazoo_config_ptr fetch_handlers; + kazoo_json_term json_encoding; + + int delete_file_after_put; + int enable_legacy; + +}; +typedef struct globals_s globals_t; +extern globals_t kazoo_globals; + +/* kazoo_event_stream.c */ +ei_event_stream_t *find_event_stream(ei_event_stream_t *event_streams, const erlang_pid *from); + +//ei_event_stream_t *new_event_stream(ei_event_stream_t **event_streams, const erlang_pid *from); +ei_event_stream_t *new_event_stream(ei_node_t *ei_node, const erlang_pid *from); + + +switch_status_t remove_event_stream(ei_event_stream_t **event_streams, const erlang_pid *from); +switch_status_t remove_event_streams(ei_event_stream_t **event_streams); +unsigned long get_stream_port(const ei_event_stream_t *event_stream); +switch_status_t add_event_binding(ei_event_stream_t *event_stream, const char *event_name); +//switch_status_t add_event_binding(ei_event_stream_t *event_stream, const switch_event_types_t event_type, const char *subclass_name); +switch_status_t remove_event_binding(ei_event_stream_t *event_stream, const switch_event_types_t event_type, const char *subclass_name); +switch_status_t remove_event_bindings(ei_event_stream_t *event_stream); + +/* kazoo_node.c */ +switch_status_t new_kazoo_node(int nodefd, ErlConnect *conn); + +/* kazoo_ei_utils.c */ +void close_socket(switch_socket_t **sock); +void close_socketfd(int *sockfd); +switch_socket_t *create_socket_with_port(switch_memory_pool_t *pool, switch_port_t port); +switch_socket_t *create_socket(switch_memory_pool_t *pool); +switch_status_t create_ei_cnode(const char *ip_addr, const char *name, struct ei_cnode_s *ei_cnode); +switch_status_t ei_compare_pids(const erlang_pid *pid1, const erlang_pid *pid2); +void ei_encode_switch_event_headers(ei_x_buff *ebuf, switch_event_t *event); +void ei_encode_switch_event_headers_2(ei_x_buff *ebuf, switch_event_t *event, int decode); +void ei_encode_json(ei_x_buff *ebuf, cJSON *JObj); +void ei_link(ei_node_t *ei_node, erlang_pid * from, erlang_pid * to); +void ei_encode_switch_event(ei_x_buff * ebuf, switch_event_t *event); +int ei_helper_send(ei_node_t *ei_node, erlang_pid* to, ei_x_buff *buf); +int ei_decode_atom_safe(char *buf, int *index, char *dst); +int ei_decode_string_or_binary_limited(char *buf, int *index, int maxsize, char *dst); +int ei_decode_string_or_binary(char *buf, int *index, char **dst); +switch_status_t create_acceptor(); +switch_hash_t *create_default_filter(); + +void fetch_config(); + +switch_status_t kazoo_load_config(); +void kazoo_destroy_config(); + + +#define _ei_x_encode_string(buf, string) { ei_x_encode_binary(buf, string, strlen(string)); } + +/* kazoo_fetch_agent.c */ +switch_status_t bind_fetch_agents(); +switch_status_t unbind_fetch_agents(); +switch_status_t remove_xml_clients(ei_node_t *ei_node); +switch_status_t add_fetch_handler(ei_node_t *ei_node, erlang_pid *from, switch_xml_binding_t *binding); +switch_status_t remove_fetch_handlers(ei_node_t *ei_node, erlang_pid *from); +switch_status_t fetch_reply(char *uuid_str, char *xml_str, switch_xml_binding_t *binding); +switch_status_t handle_api_command_streams(ei_node_t *ei_node, switch_stream_handle_t *stream); + +void bind_event_profiles(kazoo_event_ptr event); +void rebind_fetch_profiles(kazoo_config_ptr fetch_handlers); +switch_status_t kazoo_config_handlers(switch_xml_t cfg); + +/* runtime */ +SWITCH_MODULE_RUNTIME_FUNCTION(mod_kazoo_runtime); + +#endif /* KAZOO_EI_H */ + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c b/src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c new file mode 100644 index 0000000000..7eb93af5d8 --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c @@ -0,0 +1,543 @@ +/* +* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* Copyright (C) 2005-2012, Anthony Minessale II +* +* Version: MPL 1.1 +* +* The contents of this file are subject to the Mozilla Public License Version +* 1.1 (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* http://www.mozilla.org/MPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* +* The Initial Developer of the Original Code is +* Anthony Minessale II +* Portions created by the Initial Developer are Copyright (C) +* the Initial Developer. All Rights Reserved. +* +* Based on mod_skel by +* Anthony Minessale II +* +* Contributor(s): +* +* Daniel Bryars +* Tim Brown +* Anthony Minessale II +* William King +* Mike Jerris +* +* kazoo.c -- Sends FreeSWITCH events to an AMQP broker +* +*/ + +#include "mod_kazoo.h" +#include "kazoo_definitions.h" + +#define KAZOO_DECLARE_GLOBAL_STRING_FUNC(fname, vname) static void __attribute__((__unused__)) fname(const char *string) { if (!string) return;\ + if (vname) {free(vname); vname = NULL;}vname = strdup(string);} static void fname(const char *string) + +KAZOO_DECLARE_GLOBAL_STRING_FUNC(set_pref_ip, kazoo_globals.ip); +KAZOO_DECLARE_GLOBAL_STRING_FUNC(set_pref_ei_cookie, kazoo_globals.ei_cookie); +KAZOO_DECLARE_GLOBAL_STRING_FUNC(set_pref_ei_nodename, kazoo_globals.ei_nodename); +KAZOO_DECLARE_GLOBAL_STRING_FUNC(set_pref_kazoo_var_prefix, kazoo_globals.kazoo_var_prefix); + +static int read_cookie_from_file(char *filename) { + int fd; + char cookie[MAXATOMLEN + 1]; + char *end; + struct stat buf; + ssize_t res; + + if (!stat(filename, &buf)) { + if ((buf.st_mode & S_IRWXG) || (buf.st_mode & S_IRWXO)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s must only be accessible by owner only.\n", filename); + return 2; + } + if (buf.st_size > MAXATOMLEN) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s contains a cookie larger than the maximum atom size of %d.\n", filename, MAXATOMLEN); + return 2; + } + fd = open(filename, O_RDONLY); + if (fd < 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to open cookie file %s : %d.\n", filename, errno); + return 2; + } + + if ((res = read(fd, cookie, MAXATOMLEN)) < 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to read cookie file %s : %d.\n", filename, errno); + } + + cookie[MAXATOMLEN] = '\0'; + + /* replace any end of line characters with a null */ + if ((end = strchr(cookie, '\n'))) { + *end = '\0'; + } + + if ((end = strchr(cookie, '\r'))) { + *end = '\0'; + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set cookie from file %s: %s\n", filename, cookie); + + set_pref_ei_cookie(cookie); + return 0; + } else { + /* don't error here, because we might be blindly trying to read $HOME/.erlang.cookie, and that can fail silently */ + return 1; + } +} + + +switch_status_t kazoo_ei_config(switch_xml_t cfg) { + switch_xml_t child, param; + kazoo_globals.send_all_headers = 0; + kazoo_globals.send_all_private_headers = 1; + kazoo_globals.connection_timeout = 500; + kazoo_globals.receive_timeout = 200; + kazoo_globals.receive_msg_preallocate = 2000; + kazoo_globals.event_stream_preallocate = 4000; + kazoo_globals.send_msg_batch = 10; + kazoo_globals.event_stream_framing = 2; + kazoo_globals.port = 0; + kazoo_globals.io_fault_tolerance = 10; + kazoo_globals.json_encoding = ERLANG_TUPLE; + kazoo_globals.enable_legacy = SWITCH_TRUE; + kazoo_globals.delete_file_after_put = SWITCH_TRUE; + + if ((child = switch_xml_child(cfg, "settings"))) { + for (param = switch_xml_child(child, "param"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + char *val = (char *) switch_xml_attr_soft(param, "value"); + + if (!strcmp(var, "listen-ip")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set bind ip address: %s\n", val); + set_pref_ip(val); + } else if (!strcmp(var, "listen-port")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set bind port: %s\n", val); + kazoo_globals.port = atoi(val); + } else if (!strcmp(var, "cookie")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set cookie: %s\n", val); + set_pref_ei_cookie(val); + } else if (!strcmp(var, "cookie-file")) { + if (read_cookie_from_file(val) == 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to read cookie from %s\n", val); + } + } else if (!strcmp(var, "nodename")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set node name: %s\n", val); + set_pref_ei_nodename(val); + } else if (!strcmp(var, "shortname")) { + kazoo_globals.ei_shortname = switch_true(val); + } else if (!strcmp(var, "kazoo-var-prefix")) { + set_pref_kazoo_var_prefix(val); + } else if (!strcmp(var, "compat-rel")) { + if (atoi(val) >= 7) + kazoo_globals.ei_compat_rel = atoi(val); + else + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid compatibility release '%s' specified\n", val); + } else if (!strcmp(var, "nat-map")) { + kazoo_globals.nat_map = switch_true(val); + } else if (!strcmp(var, "send-all-headers")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-all-headers: %s\n", val); + kazoo_globals.send_all_headers = switch_true(val); + } else if (!strcmp(var, "send-all-private-headers")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-all-private-headers: %s\n", val); + kazoo_globals.send_all_private_headers = switch_true(val); + } else if (!strcmp(var, "connection-timeout")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set connection-timeout: %s\n", val); + kazoo_globals.connection_timeout = atoi(val); + } else if (!strcmp(var, "receive-timeout")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set receive-timeout: %s\n", val); + kazoo_globals.receive_timeout = atoi(val); + } else if (!strcmp(var, "receive-msg-preallocate")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set receive-msg-preallocate: %s\n", val); + kazoo_globals.receive_msg_preallocate = atoi(val); + } else if (!strcmp(var, "event-stream-preallocate")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set event-stream-preallocate: %s\n", val); + kazoo_globals.event_stream_preallocate = atoi(val); + } else if (!strcmp(var, "send-msg-batch-size")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-msg-batch-size: %s\n", val); + kazoo_globals.send_msg_batch = atoi(val); + } else if (!strcmp(var, "event-stream-framing")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set event-stream-framing: %s\n", val); + kazoo_globals.event_stream_framing = atoi(val); + } else if (!strcmp(var, "io-fault-tolerance")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set io-fault-tolerance: %s\n", val); + kazoo_globals.io_fault_tolerance = atoi(val); + } else if (!strcmp(var, "num-worker-threads")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set num-worker-threads: %s\n", val); + kazoo_globals.num_worker_threads = atoi(val); + } else if (!strcmp(var, "json-term-encoding")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set json-term-encoding: %s\n", val); + if(!strcmp(val, "map")) { + kazoo_globals.json_encoding = ERLANG_MAP; + } + } else if (!strcmp(var, "enable-legacy")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set enable-legacy: %s\n", val); + kazoo_globals.enable_legacy = switch_true(val); + } else if (!strcmp(var, "delete-file-after-put")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set delete-file-after-put: %s\n", val); + kazoo_globals.delete_file_after_put = switch_true(val); + } + } + } + + if ((child = switch_xml_child(cfg, "event-filter"))) { + switch_hash_t *filter; + + switch_core_hash_init(&filter); + for (param = switch_xml_child(child, "header"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + switch_core_hash_insert(filter, var, "1"); + } + kazoo_globals.event_filter = filter; + } + + if (kazoo_globals.receive_msg_preallocate < 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid receive message preallocate value, disabled\n"); + kazoo_globals.receive_msg_preallocate = 0; + } + + if (kazoo_globals.event_stream_preallocate < 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid event stream preallocate value, disabled\n"); + kazoo_globals.event_stream_preallocate = 0; + } + + if (kazoo_globals.send_msg_batch < 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid send message batch size, reverting to default\n"); + kazoo_globals.send_msg_batch = 10; + } + + if (kazoo_globals.io_fault_tolerance < 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid I/O fault tolerance, reverting to default\n"); + kazoo_globals.io_fault_tolerance = 10; + } + + if (!kazoo_globals.event_filter) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Event filter not found in configuration, using default\n"); + kazoo_globals.event_filter = create_default_filter(); + } + + if (kazoo_globals.event_stream_framing < 1 || kazoo_globals.event_stream_framing > 4) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid event stream framing value, using default\n"); + kazoo_globals.event_stream_framing = 2; + } + + if (zstr(kazoo_globals.kazoo_var_prefix)) { + set_pref_kazoo_var_prefix("variable_ecallmgr*"); + kazoo_globals.var_prefix_length = 17; //ignore the * + } else { + /* we could use the global pool but then we would have to conditionally + * free the pointer if it was not drawn from the XML */ + char *buf; + int size = switch_snprintf(NULL, 0, "variable_%s*", kazoo_globals.kazoo_var_prefix) + 1; + + switch_malloc(buf, size); + switch_snprintf(buf, size, "variable_%s*", kazoo_globals.kazoo_var_prefix); + switch_safe_free(kazoo_globals.kazoo_var_prefix); + kazoo_globals.kazoo_var_prefix = buf; + kazoo_globals.var_prefix_length = size - 2; //ignore the * + } + + if (!kazoo_globals.num_worker_threads) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Number of worker threads not found in configuration, using default\n"); + kazoo_globals.num_worker_threads = 10; + } + + if (zstr(kazoo_globals.ip)) { + set_pref_ip("0.0.0.0"); + } + + if (zstr(kazoo_globals.ei_cookie)) { + int res; + char *home_dir = getenv("HOME"); + char path_buf[1024]; + + if (!zstr(home_dir)) { + /* $HOME/.erlang.cookie */ + switch_snprintf(path_buf, sizeof (path_buf), "%s%s%s", home_dir, SWITCH_PATH_SEPARATOR, ".erlang.cookie"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Checking for cookie at path: %s\n", path_buf); + + res = read_cookie_from_file(path_buf); + if (res) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No cookie or valid cookie file specified, using default cookie\n"); + set_pref_ei_cookie("ClueCon"); + } + } + } + + if (!kazoo_globals.ei_nodename) { + set_pref_ei_nodename("freeswitch"); + } + + if (!kazoo_globals.nat_map) { + kazoo_globals.nat_map = 0; + } + + return SWITCH_STATUS_SUCCESS; +} + +switch_status_t kazoo_config_handlers(switch_xml_t cfg) +{ + switch_xml_t def; + char* xml = NULL; + kazoo_config_ptr definitions, fetch_handlers, event_handlers; + kazoo_event_profile_ptr events; + + xml = strndup((char*)kazoo_conf_xml, kazoo_conf_xml_len); + def = switch_xml_parse_str_dup(xml); + + kz_xml_process(def); + kz_xml_process(cfg); + + definitions = kazoo_config_definitions(cfg); + if(definitions == NULL) { + definitions = kazoo_config_definitions(def); + } + + fetch_handlers = kazoo_config_fetch_handlers(definitions, cfg); + if(fetch_handlers == NULL) { + fetch_handlers = kazoo_config_fetch_handlers(definitions, def); + } + + event_handlers = kazoo_config_event_handlers(definitions, cfg); + if(event_handlers == NULL) { + event_handlers = kazoo_config_event_handlers(definitions, def); + } + + if(event_handlers != NULL) { + events = (kazoo_event_profile_ptr) switch_core_hash_find(event_handlers->hash, "default"); + } + + if(events == NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to get default handler for events\n"); + destroy_config(&event_handlers); + destroy_config(&fetch_handlers); + destroy_config(&definitions); + switch_xml_free(def); + switch_safe_free(xml); + return SWITCH_STATUS_GENERR; + } + + bind_event_profiles(events->events); + kazoo_globals.events = events; + + destroy_config(&kazoo_globals.event_handlers); + kazoo_globals.event_handlers = event_handlers; + + rebind_fetch_profiles(fetch_handlers); + destroy_config(&kazoo_globals.fetch_handlers); + kazoo_globals.fetch_handlers = fetch_handlers; + + destroy_config(&kazoo_globals.definitions); + kazoo_globals.definitions = definitions; + + + switch_xml_free(def); + switch_safe_free(xml); + + return SWITCH_STATUS_SUCCESS; +} + +switch_status_t kazoo_load_config() +{ + char *cf = "kazoo.conf"; + switch_xml_t cfg, xml; + if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf); + return SWITCH_STATUS_FALSE; + } else { + kazoo_ei_config(cfg); + kazoo_config_handlers(cfg); + switch_xml_free(xml); + } + + return SWITCH_STATUS_SUCCESS; +} + +void kazoo_destroy_config() +{ + destroy_config(&kazoo_globals.event_handlers); + destroy_config(&kazoo_globals.fetch_handlers); + destroy_config(&kazoo_globals.definitions); +} + +switch_status_t kazoo_config_events(kazoo_config_ptr definitions, switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_event_profile_ptr profile) +{ + switch_xml_t events, event; + kazoo_event_ptr prv = NULL, cur = NULL; + + + if ((events = switch_xml_child(cfg, "events")) != NULL) { + for (event = switch_xml_child(events, "event"); event; event = event->next) { + const char *var = switch_xml_attr(event, "name"); + cur = (kazoo_event_ptr) switch_core_alloc(pool, sizeof(kazoo_event_t)); + memset(cur, 0, sizeof(kazoo_event_t)); + if(prv == NULL) { + profile->events = prv = cur; + } else { + prv->next = cur; + prv = cur; + } + cur->profile = profile; + cur->name = switch_core_strdup(pool, var); + kazoo_config_filters(pool, event, &cur->filter); + kazoo_config_fields(definitions, pool, event, &cur->fields); + + } + + } + + return SWITCH_STATUS_SUCCESS; + +} + + +switch_status_t kazoo_config_fetch_handler(kazoo_config_ptr definitions, kazoo_config_ptr root, switch_xml_t cfg, kazoo_fetch_profile_ptr *ptr) +{ + kazoo_fetch_profile_ptr profile = NULL; + switch_xml_t params, param; + switch_xml_section_t fetch_section; + int fetch_timeout = 2000000; + switch_memory_pool_t *pool = NULL; + + char *name = (char *) switch_xml_attr_soft(cfg, "name"); + if (zstr(name)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "missing name in profile\n"); + return SWITCH_STATUS_GENERR; + } + + if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error allocation pool for new profile : %s\n", name); + return SWITCH_STATUS_GENERR; + } + + profile = switch_core_alloc(pool, sizeof(kazoo_fetch_profile_t)); + profile->pool = pool; + profile->root = root; + profile->name = switch_core_strdup(profile->pool, name); + + fetch_section = switch_xml_parse_section_string(name); + + if ((params = switch_xml_child(cfg, "params")) != NULL) { + for (param = switch_xml_child(params, "param"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + char *val = (char *) switch_xml_attr_soft(param, "value"); + + if (!var) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Profile[%s] param missing 'name' attribute\n", name); + continue; + } + + if (!val) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Profile[%s] param[%s] missing 'value' attribute\n", name, var); + continue; + } + + if (!strncmp(var, "fetch-timeout", 13)) { + fetch_timeout = atoi(val); + } else if (!strncmp(var, "fetch-section", 13)) { + fetch_section = switch_xml_parse_section_string(val); + } + } + } + + if (fetch_section == SWITCH_XML_SECTION_RESULT) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Fetch Profile[%s] invalid fetch-section: %s\n", name, switch_xml_toxml(cfg, SWITCH_FALSE)); + goto err; + } + + + profile->fetch_timeout = fetch_timeout; + profile->section = fetch_section; + kazoo_config_fields(definitions, pool, cfg, &profile->fields); + kazoo_config_loglevels(pool, cfg, &profile->logging); + + if(root) { + if ( switch_core_hash_insert(root->hash, name, (void *) profile) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed to insert new fetch profile [%s] into kazoo profile hash\n", name); + goto err; + } + } + + if(ptr) + *ptr = profile; + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "fetch handler profile %s successfully configured\n", name); + return SWITCH_STATUS_SUCCESS; + + err: + /* Cleanup */ + if(pool) { + switch_core_destroy_memory_pool(&pool); + } + return SWITCH_STATUS_GENERR; + +} + +switch_status_t kazoo_config_event_handler(kazoo_config_ptr definitions, kazoo_config_ptr root, switch_xml_t cfg, kazoo_event_profile_ptr *ptr) +{ + kazoo_event_profile_ptr profile = NULL; + switch_memory_pool_t *pool = NULL; + + char *name = (char *) switch_xml_attr_soft(cfg, "name"); + if (zstr(name)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "missing name in profile\n"); + return SWITCH_STATUS_GENERR; + } + + if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error allocation pool for new profile : %s\n", name); + return SWITCH_STATUS_GENERR; + } + + profile = switch_core_alloc(pool, sizeof(kazoo_event_profile_t)); + profile->pool = pool; + profile->root = root; + profile->name = switch_core_strdup(profile->pool, name); + + kazoo_config_filters(pool, cfg, &profile->filter); + kazoo_config_fields(definitions, pool, cfg, &profile->fields); + kazoo_config_events(definitions, pool, cfg, profile); + kazoo_config_loglevels(pool, cfg, &profile->logging); + + if(root) { + if ( switch_core_hash_insert(root->hash, name, (void *) profile) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to insert new profile [%s] into kazoo profile hash\n", name); + goto err; + } + } + + if(ptr) + *ptr = profile; + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "event handler profile %s successfully configured\n", name); + return SWITCH_STATUS_SUCCESS; + + err: + /* Cleanup */ + if(pool) { + switch_core_destroy_memory_pool(&pool); + } + return SWITCH_STATUS_GENERR; + +} + + + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4 + */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c b/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c new file mode 100644 index 0000000000..96381f9b24 --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c @@ -0,0 +1,996 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2012, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Anthony Minessale II + * Andrew Thompson + * Rob Charlton + * Karl Anderson + * + * Original from mod_erlang_event. + * ei_helpers.c -- helper functions for ei + * + */ +#include "mod_kazoo.h" + +/* Stolen from code added to ei in R12B-5. + * Since not everyone has this version yet; + * provide our own version. + * */ + +#define put8(s,n) do { \ + (s)[0] = (char)((n) & 0xff); \ + (s) += 1; \ + } while (0) + +#define put32be(s,n) do { \ + (s)[0] = ((n) >> 24) & 0xff; \ + (s)[1] = ((n) >> 16) & 0xff; \ + (s)[2] = ((n) >> 8) & 0xff; \ + (s)[3] = (n) & 0xff; \ + (s) += 4; \ + } while (0) + +#ifdef EI_DEBUG +static void ei_x_print_reg_msg(ei_x_buff *buf, char *dest, int send) { + char *mbuf = NULL; + int i = 1; + + ei_s_print_term(&mbuf, buf->buff, &i); + + if (send) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Encoded term %s to '%s'\n", mbuf, dest); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Decoded term %s for '%s'\n", mbuf, dest); + } + + free(mbuf); +} + +static void ei_x_print_msg(ei_x_buff *buf, erlang_pid *pid, int send) { + char *pbuf = NULL; + int i = 0; + ei_x_buff pidbuf; + + ei_x_new(&pidbuf); + ei_x_encode_pid(&pidbuf, pid); + + ei_s_print_term(&pbuf, pidbuf.buff, &i); + + ei_x_print_reg_msg(buf, pbuf, send); + free(pbuf); +} +#endif + +void ei_encode_switch_event_headers(ei_x_buff *ebuf, switch_event_t *event) { + ei_encode_switch_event_headers_2(ebuf, event, 1); +} + +void ei_encode_switch_event_headers_2(ei_x_buff *ebuf, switch_event_t *event, int encode) { + switch_event_header_t *hp; + char *uuid = switch_event_get_header(event, "unique-id"); + int i; + + for (i = 0, hp = event->headers; hp; hp = hp->next, i++); + + if (event->body) + i++; + + ei_x_encode_list_header(ebuf, i + 1); + + if (uuid) { + char *unique_id = switch_event_get_header(event, "unique-id"); + ei_x_encode_binary(ebuf, unique_id, strlen(unique_id)); + } else { + ei_x_encode_atom(ebuf, "undefined"); + } + + for (hp = event->headers; hp; hp = hp->next) { + ei_x_encode_tuple_header(ebuf, 2); + ei_x_encode_binary(ebuf, hp->name, strlen(hp->name)); + if(encode) + switch_url_decode(hp->value); + ei_x_encode_binary(ebuf, hp->value, strlen(hp->value)); + } + + if (event->body) { + ei_x_encode_tuple_header(ebuf, 2); + ei_x_encode_binary(ebuf, "body", strlen("body")); + ei_x_encode_binary(ebuf, event->body, strlen(event->body)); + } + + ei_x_encode_empty_list(ebuf); +} + +int ei_json_child_count(cJSON *JObj) +{ + int mask = cJSON_False + | cJSON_True + | cJSON_NULL + | cJSON_Number + | cJSON_String + | cJSON_Array + | cJSON_Object + | cJSON_Raw; + + cJSON *item = JObj->child; + int i = 0; + while(item) { + if(item->type & mask) + i++; + item = item->next; + } + return i; + +} + +void ei_encode_json_array(ei_x_buff *ebuf, cJSON *JObj) { + cJSON *item; + int count = ei_json_child_count(JObj); + + ei_x_encode_list_header(ebuf, count); + if(count == 0) + return; + + item = JObj->child; + while(item) { + switch(item->type) { + case cJSON_String: + ei_x_encode_binary(ebuf, item->valuestring, strlen(item->valuestring)); + break; + + case cJSON_Number: + ei_x_encode_double(ebuf, item->valuedouble); + break; + + case cJSON_True: + ei_x_encode_boolean(ebuf, 1); + break; + + case cJSON_False: + ei_x_encode_boolean(ebuf, 0); + break; + + case cJSON_Object: + ei_encode_json(ebuf, item); + break; + + case cJSON_Array: + ei_encode_json_array(ebuf, item); + break; + + case cJSON_Raw: + { + cJSON *Decoded = cJSON_Parse(item->valuestring); + if(!Decoded) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR DECODING RAW JSON %s\n", item->valuestring); + ei_x_encode_tuple_header(ebuf, 0); + } else { + ei_encode_json(ebuf, Decoded); + cJSON_Delete(Decoded); + } + break; + } + + case cJSON_NULL: + ei_x_encode_atom(ebuf, "null"); + break; + + default: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NOT ENCODED %i\n", item->type); + break; + + } + item = item->next; + } + + ei_x_encode_empty_list(ebuf); + +} + +void ei_encode_json(ei_x_buff *ebuf, cJSON *JObj) { + cJSON *item; + int count = ei_json_child_count(JObj); + + if(kazoo_globals.json_encoding == ERLANG_TUPLE) { + ei_x_encode_tuple_header(ebuf, 1); + ei_x_encode_list_header(ebuf, count); + } else { + ei_x_encode_map_header(ebuf, count); + } + + if(count == 0) + return; + + item = JObj->child; + while(item) { + if(kazoo_globals.json_encoding == ERLANG_TUPLE) { + ei_x_encode_tuple_header(ebuf, 2); + } + ei_x_encode_binary(ebuf, item->string, strlen(item->string)); + + switch(item->type) { + case cJSON_String: + ei_x_encode_binary(ebuf, item->valuestring, strlen(item->valuestring)); + break; + + case cJSON_Number: + if ((fabs(((double)item->valueint) - item->valuedouble) <= DBL_EPSILON) + && (item->valuedouble <= INT_MAX) + && (item->valuedouble >= INT_MIN)) { + ei_x_encode_longlong(ebuf, item->valueint); + } else { + ei_x_encode_double(ebuf, item->valuedouble); + } + break; + + case cJSON_True: + ei_x_encode_boolean(ebuf, 1); + break; + + case cJSON_False: + ei_x_encode_boolean(ebuf, 0); + break; + + case cJSON_Object: + ei_encode_json(ebuf, item); + break; + + case cJSON_Array: + ei_encode_json_array(ebuf, item); + break; + + case cJSON_Raw: + { + cJSON *Decoded = cJSON_Parse(item->valuestring); + if(!Decoded) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR DECODING RAW JSON %s\n", item->valuestring); + ei_x_encode_tuple_header(ebuf, 0); + } else { + ei_encode_json(ebuf, Decoded); + cJSON_Delete(Decoded); + } + break; + } + + case cJSON_NULL: + ei_x_encode_atom(ebuf, "null"); + break; + + default: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NOT ENCODED %i\n", item->type); + break; + + } + item = item->next; + } + + if(kazoo_globals.json_encoding == ERLANG_TUPLE) { + ei_x_encode_empty_list(ebuf); + } + +} + +void close_socket(switch_socket_t ** sock) { + if (*sock) { + switch_socket_shutdown(*sock, SWITCH_SHUTDOWN_READWRITE); + switch_socket_close(*sock); + *sock = NULL; + } +} + +void close_socketfd(int *sockfd) { + if (*sockfd) { + shutdown(*sockfd, SHUT_RDWR); + close(*sockfd); + } +} + +switch_socket_t *create_socket_with_port(switch_memory_pool_t *pool, switch_port_t port) { + switch_sockaddr_t *sa; + switch_socket_t *socket; + + if(switch_sockaddr_info_get(&sa, kazoo_globals.ip, SWITCH_UNSPEC, port, 0, pool)) { + return NULL; + } + + if (switch_socket_create(&socket, switch_sockaddr_get_family(sa), SOCK_STREAM, SWITCH_PROTO_TCP, pool)) { + return NULL; + } + + if (switch_socket_opt_set(socket, SWITCH_SO_REUSEADDR, 1)) { + return NULL; + } + + if (switch_socket_bind(socket, sa)) { + return NULL; + } + + if (switch_socket_listen(socket, 5)){ + return NULL; + } + + switch_getnameinfo(&kazoo_globals.hostname, sa, 0); + + if (kazoo_globals.nat_map && switch_nat_get_type()) { + switch_nat_add_mapping(port, SWITCH_NAT_TCP, NULL, SWITCH_FALSE); + } + + return socket; +} + +switch_socket_t *create_socket(switch_memory_pool_t *pool) { + return create_socket_with_port(pool, 0); + +} + +switch_status_t create_ei_cnode(const char *ip_addr, const char *name, struct ei_cnode_s *ei_cnode) { + char hostname[EI_MAXHOSTNAMELEN + 1] = ""; + char nodename[MAXNODELEN + 1]; + char cnodename[EI_MAXALIVELEN + 1]; + //EI_MAX_COOKIE_SIZE+1 + char *atsign; + + /* copy the erlang interface nodename into something we can modify */ + strncpy(cnodename, name, EI_MAXALIVELEN); + + if ((atsign = strchr(cnodename, '@'))) { + /* we got a qualified node name, don't guess the host/domain */ + snprintf(nodename, MAXNODELEN + 1, "%s", kazoo_globals.ei_nodename); + /* truncate the alivename at the @ */ + *atsign = '\0'; + } else { + if (zstr(kazoo_globals.hostname) || !strncasecmp(kazoo_globals.ip, "0.0.0.0", 7) || !strncasecmp(kazoo_globals.ip, "::", 2)) { + memcpy(hostname, switch_core_get_hostname(), EI_MAXHOSTNAMELEN); + } else { + memcpy(hostname, kazoo_globals.hostname, EI_MAXHOSTNAMELEN); + } + + snprintf(nodename, MAXNODELEN + 1, "%s@%s", kazoo_globals.ei_nodename, hostname); + } + + if (kazoo_globals.ei_shortname) { + char *off; + if ((off = strchr(nodename, '.'))) { + *off = '\0'; + } + } + + /* init the ec stuff */ + if (ei_connect_xinit(ei_cnode, hostname, cnodename, nodename, (Erl_IpAddr) ip_addr, kazoo_globals.ei_cookie, 0) < 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to initialize the erlang interface connection structure\n"); + return SWITCH_STATUS_FALSE; + } + + return SWITCH_STATUS_SUCCESS; +} + +switch_status_t ei_compare_pids(const erlang_pid *pid1, const erlang_pid *pid2) { + if ((!strcmp(pid1->node, pid2->node)) + && pid1->creation == pid2->creation + && pid1->num == pid2->num + && pid1->serial == pid2->serial) { + return SWITCH_STATUS_SUCCESS; + } else { + return SWITCH_STATUS_FALSE; + } +} + +void ei_link(ei_node_t *ei_node, erlang_pid * from, erlang_pid * to) { + char msgbuf[2048]; + char *s; + int index = 0; + + index = 5; /* max sizes: */ + ei_encode_version(msgbuf, &index); /* 1 */ + ei_encode_tuple_header(msgbuf, &index, 3); + ei_encode_long(msgbuf, &index, ERL_LINK); + ei_encode_pid(msgbuf, &index, from); /* 268 */ + ei_encode_pid(msgbuf, &index, to); /* 268 */ + + /* 5 byte header missing */ + s = msgbuf; + put32be(s, index - 4); /* 4 */ + put8(s, ERL_PASS_THROUGH); /* 1 */ + /* sum: 542 */ + + if (write(ei_node->nodefd, msgbuf, index) == -1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to link to process on %s\n", ei_node->peer_nodename); + } +} + +void ei_encode_switch_event(ei_x_buff *ebuf, switch_event_t *event) { + ei_x_encode_tuple_header(ebuf, 2); + ei_x_encode_atom(ebuf, "event"); + ei_encode_switch_event_headers(ebuf, event); +} + +int ei_helper_send(ei_node_t *ei_node, erlang_pid *to, ei_x_buff *buf) { + int ret = 0; + + if (ei_node->nodefd) { +#ifdef EI_DEBUG + ei_x_print_msg(buf, to, 1); +#endif + ret = ei_send(ei_node->nodefd, to, buf->buff, buf->index); + } + + return ret; +} + +int ei_decode_atom_safe(char *buf, int *index, char *dst) { + int type, size; + + ei_get_type(buf, index, &type, &size); + + if (type != ERL_ATOM_EXT) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed atom\n", type, size); + return -1; + } else if (size > MAXATOMLEN) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Requested decoding of atom with size %d into a buffer of size %d\n", size, MAXATOMLEN); + return -1; + } else { + return ei_decode_atom(buf, index, dst); + } +} + +int ei_decode_string_or_binary(char *buf, int *index, char **dst) { + int type, size, res; + long len; + + ei_get_type(buf, index, &type, &size); + + if (type != ERL_STRING_EXT && type != ERL_BINARY_EXT && type != ERL_NIL_EXT) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed binary or string\n", type, size); + return -1; + } + + *dst = malloc(size + 1); + + if (type == ERL_NIL_EXT) { + res = 0; + **dst = '\0'; + } else if (type == ERL_BINARY_EXT) { + res = ei_decode_binary(buf, index, *dst, &len); + (*dst)[len] = '\0'; + } else { + res = ei_decode_string(buf, index, *dst); + } + + return res; +} + +int ei_decode_string_or_binary_limited(char *buf, int *index, int maxsize, char *dst) { + int type, size, res; + long len; + + ei_get_type(buf, index, &type, &size); + + if (type != ERL_STRING_EXT && type != ERL_BINARY_EXT && type != ERL_NIL_EXT) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed binary or string\n", type, size); + return -1; + } + + if (size > maxsize) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Requested decoding of %s with size %d into a buffer of size %d\n", + type == ERL_BINARY_EXT ? "binary" : "string", size, maxsize); + return -1; + } + + if (type == ERL_NIL_EXT) { + res = 0; + *dst = '\0'; + } else if (type == ERL_BINARY_EXT) { + res = ei_decode_binary(buf, index, dst, &len); + dst[len] = '\0'; /* binaries aren't null terminated */ + } else { + res = ei_decode_string(buf, index, dst); + } + + return res; +} + + +switch_status_t create_acceptor() { + switch_sockaddr_t *sa; + uint16_t port; + char ipbuf[48]; + const char *ip_addr; + + /* if the config has specified an erlang release compatibility then pass that along to the erlang interface */ + if (kazoo_globals.ei_compat_rel) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Compatability with OTP R%d requested\n", kazoo_globals.ei_compat_rel); + ei_set_compat_rel(kazoo_globals.ei_compat_rel); + } + + if (!(kazoo_globals.acceptor = create_socket_with_port(kazoo_globals.pool, kazoo_globals.port))) { + return SWITCH_STATUS_SOCKERR; + } + + switch_socket_addr_get(&sa, SWITCH_FALSE, kazoo_globals.acceptor); + + port = switch_sockaddr_get_port(sa); + ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Erlang connection acceptor listening on %s:%u\n", ip_addr, port); + + /* try to initialize the erlang interface */ + if (create_ei_cnode(ip_addr, kazoo_globals.ei_nodename, &kazoo_globals.ei_cnode) != SWITCH_STATUS_SUCCESS) { + return SWITCH_STATUS_SOCKERR; + } + + /* tell the erlang port manager where we can be reached. this returns a file descriptor pointing to epmd or -1 */ + if ((kazoo_globals.epmdfd = ei_publish(&kazoo_globals.ei_cnode, port)) == -1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to publish port to epmd, trying to start epmd via system()\n"); + if (system("epmd -daemon")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "Failed to start epmd manually! Is epmd in $PATH? If not, start it yourself or run an erl shell with -sname or -name\n"); + return SWITCH_STATUS_SOCKERR; + } + switch_yield(100000); + if ((kazoo_globals.epmdfd = ei_publish(&kazoo_globals.ei_cnode, port)) == -1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to publish port to epmd AGAIN\n"); + return SWITCH_STATUS_SOCKERR; + } + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connected to epmd and published erlang cnode name %s at port %d\n", kazoo_globals.ei_cnode.thisnodename, port); + + return SWITCH_STATUS_SUCCESS; +} + +switch_hash_t *create_default_filter() { + switch_hash_t *filter; + + switch_core_hash_init(&filter); + + switch_core_hash_insert(filter, "Acquired-UUID", "1"); + switch_core_hash_insert(filter, "action", "1"); + switch_core_hash_insert(filter, "Action", "1"); + switch_core_hash_insert(filter, "alt_event_type", "1"); + switch_core_hash_insert(filter, "Answer-State", "1"); + switch_core_hash_insert(filter, "Application", "1"); + switch_core_hash_insert(filter, "Application-Data", "1"); + switch_core_hash_insert(filter, "Application-Name", "1"); + switch_core_hash_insert(filter, "Application-Response", "1"); + switch_core_hash_insert(filter, "att_xfer_replaced_by", "1"); + switch_core_hash_insert(filter, "Auth-Method", "1"); + switch_core_hash_insert(filter, "Auth-Realm", "1"); + switch_core_hash_insert(filter, "Auth-User", "1"); + switch_core_hash_insert(filter, "Bridge-A-Unique-ID", "1"); + switch_core_hash_insert(filter, "Bridge-B-Unique-ID", "1"); + switch_core_hash_insert(filter, "Call-Direction", "1"); + switch_core_hash_insert(filter, "Caller-Callee-ID-Name", "1"); + switch_core_hash_insert(filter, "Caller-Callee-ID-Number", "1"); + switch_core_hash_insert(filter, "Caller-Caller-ID-Name", "1"); + switch_core_hash_insert(filter, "Caller-Caller-ID-Number", "1"); + switch_core_hash_insert(filter, "Caller-Screen-Bit", "1"); + switch_core_hash_insert(filter, "Caller-Privacy-Hide-Name", "1"); + switch_core_hash_insert(filter, "Caller-Privacy-Hide-Number", "1"); + switch_core_hash_insert(filter, "Caller-Context", "1"); + switch_core_hash_insert(filter, "Caller-Controls", "1"); + switch_core_hash_insert(filter, "Caller-Destination-Number", "1"); + switch_core_hash_insert(filter, "Caller-Dialplan", "1"); + switch_core_hash_insert(filter, "Caller-Network-Addr", "1"); + switch_core_hash_insert(filter, "Caller-Unique-ID", "1"); + switch_core_hash_insert(filter, "Call-ID", "1"); + switch_core_hash_insert(filter, "Channel-Call-State", "1"); + switch_core_hash_insert(filter, "Channel-Call-UUID", "1"); + switch_core_hash_insert(filter, "Channel-Presence-ID", "1"); + switch_core_hash_insert(filter, "Channel-State", "1"); + switch_core_hash_insert(filter, "Chat-Permissions", "1"); + switch_core_hash_insert(filter, "Conference-Name", "1"); + switch_core_hash_insert(filter, "Conference-Profile-Name", "1"); + switch_core_hash_insert(filter, "Conference-Unique-ID", "1"); + switch_core_hash_insert(filter, "contact", "1"); + switch_core_hash_insert(filter, "Detected-Tone", "1"); + switch_core_hash_insert(filter, "dialog_state", "1"); + switch_core_hash_insert(filter, "direction", "1"); + switch_core_hash_insert(filter, "Distributed-From", "1"); + switch_core_hash_insert(filter, "DTMF-Digit", "1"); + switch_core_hash_insert(filter, "DTMF-Duration", "1"); + switch_core_hash_insert(filter, "Event-Date-Timestamp", "1"); + switch_core_hash_insert(filter, "Event-Name", "1"); + switch_core_hash_insert(filter, "Event-Subclass", "1"); + switch_core_hash_insert(filter, "expires", "1"); + switch_core_hash_insert(filter, "Expires", "1"); + switch_core_hash_insert(filter, "Ext-SIP-IP", "1"); + switch_core_hash_insert(filter, "File", "1"); + switch_core_hash_insert(filter, "FreeSWITCH-Hostname", "1"); + switch_core_hash_insert(filter, "from", "1"); + switch_core_hash_insert(filter, "Hunt-Destination-Number", "1"); + switch_core_hash_insert(filter, "ip", "1"); + switch_core_hash_insert(filter, "Message-Account", "1"); + switch_core_hash_insert(filter, "metadata", "1"); + switch_core_hash_insert(filter, "old_node_channel_uuid", "1"); + switch_core_hash_insert(filter, "Other-Leg-Callee-ID-Name", "1"); + switch_core_hash_insert(filter, "Other-Leg-Callee-ID-Number", "1"); + switch_core_hash_insert(filter, "Other-Leg-Caller-ID-Name", "1"); + switch_core_hash_insert(filter, "Other-Leg-Caller-ID-Number", "1"); + switch_core_hash_insert(filter, "Other-Leg-Destination-Number", "1"); + switch_core_hash_insert(filter, "Other-Leg-Direction", "1"); + switch_core_hash_insert(filter, "Other-Leg-Unique-ID", "1"); + switch_core_hash_insert(filter, "Other-Leg-Channel-Name", "1"); + switch_core_hash_insert(filter, "Participant-Type", "1"); + switch_core_hash_insert(filter, "Path", "1"); + switch_core_hash_insert(filter, "profile_name", "1"); + switch_core_hash_insert(filter, "Profiles", "1"); + switch_core_hash_insert(filter, "proto-specific-event-name", "1"); + switch_core_hash_insert(filter, "Raw-Application-Data", "1"); + switch_core_hash_insert(filter, "realm", "1"); + switch_core_hash_insert(filter, "Resigning-UUID", "1"); + switch_core_hash_insert(filter, "set", "1"); + switch_core_hash_insert(filter, "sip_auto_answer", "1"); + switch_core_hash_insert(filter, "sip_auth_method", "1"); + switch_core_hash_insert(filter, "sip_from_host", "1"); + switch_core_hash_insert(filter, "sip_from_user", "1"); + switch_core_hash_insert(filter, "sip_to_host", "1"); + switch_core_hash_insert(filter, "sip_to_user", "1"); + switch_core_hash_insert(filter, "sub-call-id", "1"); + switch_core_hash_insert(filter, "technology", "1"); + switch_core_hash_insert(filter, "to", "1"); + switch_core_hash_insert(filter, "Unique-ID", "1"); + switch_core_hash_insert(filter, "URL", "1"); + switch_core_hash_insert(filter, "username", "1"); + switch_core_hash_insert(filter, "variable_channel_is_moving", "1"); + switch_core_hash_insert(filter, "variable_collected_digits", "1"); + switch_core_hash_insert(filter, "variable_current_application", "1"); + switch_core_hash_insert(filter, "variable_current_application_data", "1"); + switch_core_hash_insert(filter, "variable_domain_name", "1"); + switch_core_hash_insert(filter, "variable_effective_caller_id_name", "1"); + switch_core_hash_insert(filter, "variable_effective_caller_id_number", "1"); + switch_core_hash_insert(filter, "variable_holding_uuid", "1"); + switch_core_hash_insert(filter, "variable_hold_music", "1"); + switch_core_hash_insert(filter, "variable_media_group_id", "1"); + switch_core_hash_insert(filter, "variable_originate_disposition", "1"); + switch_core_hash_insert(filter, "variable_origination_uuid", "1"); + switch_core_hash_insert(filter, "variable_playback_terminator_used", "1"); + switch_core_hash_insert(filter, "variable_presence_id", "1"); + switch_core_hash_insert(filter, "variable_record_ms", "1"); + switch_core_hash_insert(filter, "variable_recovered", "1"); + switch_core_hash_insert(filter, "variable_silence_hits_exhausted", "1"); + switch_core_hash_insert(filter, "variable_sip_auth_realm", "1"); + switch_core_hash_insert(filter, "variable_sip_from_host", "1"); + switch_core_hash_insert(filter, "variable_sip_from_user", "1"); + switch_core_hash_insert(filter, "variable_sip_from_tag", "1"); + switch_core_hash_insert(filter, "variable_sip_h_X-AUTH-IP", "1"); + switch_core_hash_insert(filter, "variable_sip_received_ip", "1"); + switch_core_hash_insert(filter, "variable_sip_to_host", "1"); + switch_core_hash_insert(filter, "variable_sip_to_user", "1"); + switch_core_hash_insert(filter, "variable_sip_to_tag", "1"); + switch_core_hash_insert(filter, "variable_sofia_profile_name", "1"); + switch_core_hash_insert(filter, "variable_transfer_history", "1"); + switch_core_hash_insert(filter, "variable_user_name", "1"); + switch_core_hash_insert(filter, "variable_endpoint_disposition", "1"); + switch_core_hash_insert(filter, "variable_originate_disposition", "1"); + switch_core_hash_insert(filter, "variable_bridge_hangup_cause", "1"); + switch_core_hash_insert(filter, "variable_hangup_cause", "1"); + switch_core_hash_insert(filter, "variable_last_bridge_proto_specific_hangup_cause", "1"); + switch_core_hash_insert(filter, "variable_proto_specific_hangup_cause", "1"); + switch_core_hash_insert(filter, "VM-Call-ID", "1"); + switch_core_hash_insert(filter, "VM-sub-call-id", "1"); + switch_core_hash_insert(filter, "whistle_application_name", "1"); + switch_core_hash_insert(filter, "whistle_application_response", "1"); + switch_core_hash_insert(filter, "whistle_event_name", "1"); + switch_core_hash_insert(filter, "kazoo_application_name", "1"); + switch_core_hash_insert(filter, "kazoo_application_response", "1"); + switch_core_hash_insert(filter, "kazoo_event_name", "1"); + switch_core_hash_insert(filter, "sip_auto_answer_notify", "1"); + switch_core_hash_insert(filter, "eavesdrop_group", "1"); + switch_core_hash_insert(filter, "origination_caller_id_name", "1"); + switch_core_hash_insert(filter, "origination_caller_id_number", "1"); + switch_core_hash_insert(filter, "origination_callee_id_name", "1"); + switch_core_hash_insert(filter, "origination_callee_id_number", "1"); + switch_core_hash_insert(filter, "sip_auth_username", "1"); + switch_core_hash_insert(filter, "sip_auth_password", "1"); + switch_core_hash_insert(filter, "effective_caller_id_name", "1"); + switch_core_hash_insert(filter, "effective_caller_id_number", "1"); + switch_core_hash_insert(filter, "effective_callee_id_name", "1"); + switch_core_hash_insert(filter, "effective_callee_id_number", "1"); + switch_core_hash_insert(filter, "variable_destination_number", "1"); + switch_core_hash_insert(filter, "variable_effective_callee_id_name", "1"); + switch_core_hash_insert(filter, "variable_effective_callee_id_number", "1"); + switch_core_hash_insert(filter, "variable_record_silence_hits", "1"); + switch_core_hash_insert(filter, "variable_refer_uuid", "1"); + switch_core_hash_insert(filter, "variable_sip_call_id", "1"); + switch_core_hash_insert(filter, "variable_sip_h_Referred-By", "1"); + switch_core_hash_insert(filter, "variable_sip_h_X-AUTH-PORT", "1"); + switch_core_hash_insert(filter, "variable_sip_loopback_req_uri", "1"); + switch_core_hash_insert(filter, "variable_sip_received_port", "1"); + switch_core_hash_insert(filter, "variable_sip_refer_to", "1"); + switch_core_hash_insert(filter, "variable_sip_req_host", "1"); + switch_core_hash_insert(filter, "variable_sip_req_uri", "1"); + switch_core_hash_insert(filter, "variable_transfer_source", "1"); + switch_core_hash_insert(filter, "variable_uuid", "1"); + + /* Registration headers */ + switch_core_hash_insert(filter, "call-id", "1"); + switch_core_hash_insert(filter, "profile-name", "1"); + switch_core_hash_insert(filter, "from-user", "1"); + switch_core_hash_insert(filter, "from-host", "1"); + switch_core_hash_insert(filter, "presence-hosts", "1"); + switch_core_hash_insert(filter, "contact", "1"); + switch_core_hash_insert(filter, "rpid", "1"); + switch_core_hash_insert(filter, "status", "1"); + switch_core_hash_insert(filter, "expires", "1"); + switch_core_hash_insert(filter, "to-user", "1"); + switch_core_hash_insert(filter, "to-host", "1"); + switch_core_hash_insert(filter, "network-ip", "1"); + switch_core_hash_insert(filter, "network-port", "1"); + switch_core_hash_insert(filter, "username", "1"); + switch_core_hash_insert(filter, "realm", "1"); + switch_core_hash_insert(filter, "user-agent", "1"); + + switch_core_hash_insert(filter, "Hangup-Cause", "1"); + switch_core_hash_insert(filter, "Unique-ID", "1"); + switch_core_hash_insert(filter, "variable_switch_r_sdp", "1"); + switch_core_hash_insert(filter, "variable_rtp_local_sdp_str", "1"); + switch_core_hash_insert(filter, "variable_sip_to_uri", "1"); + switch_core_hash_insert(filter, "variable_sip_from_uri", "1"); + switch_core_hash_insert(filter, "variable_sip_user_agent", "1"); + switch_core_hash_insert(filter, "variable_duration", "1"); + switch_core_hash_insert(filter, "variable_billsec", "1"); + switch_core_hash_insert(filter, "variable_billmsec", "1"); + switch_core_hash_insert(filter, "variable_progresssec", "1"); + switch_core_hash_insert(filter, "variable_progress_uepoch", "1"); + switch_core_hash_insert(filter, "variable_progress_media_uepoch", "1"); + switch_core_hash_insert(filter, "variable_start_uepoch", "1"); + switch_core_hash_insert(filter, "variable_digits_dialed", "1"); + switch_core_hash_insert(filter, "Member-ID", "1"); + switch_core_hash_insert(filter, "Floor", "1"); + switch_core_hash_insert(filter, "Video", "1"); + switch_core_hash_insert(filter, "Hear", "1"); + switch_core_hash_insert(filter, "Speak", "1"); + switch_core_hash_insert(filter, "Talking", "1"); + switch_core_hash_insert(filter, "Current-Energy", "1"); + switch_core_hash_insert(filter, "Energy-Level", "1"); + switch_core_hash_insert(filter, "Mute-Detect", "1"); + + /* RTMP headers */ + switch_core_hash_insert(filter, "RTMP-Session-ID", "1"); + switch_core_hash_insert(filter, "RTMP-Profile", "1"); + switch_core_hash_insert(filter, "RTMP-Flash-Version", "1"); + switch_core_hash_insert(filter, "RTMP-SWF-URL", "1"); + switch_core_hash_insert(filter, "RTMP-TC-URL", "1"); + switch_core_hash_insert(filter, "RTMP-Page-URL", "1"); + switch_core_hash_insert(filter, "User", "1"); + switch_core_hash_insert(filter, "Domain", "1"); + + /* Fax headers */ + switch_core_hash_insert(filter, "variable_fax_bad_rows", "1"); + switch_core_hash_insert(filter, "variable_fax_document_total_pages", "1"); + switch_core_hash_insert(filter, "variable_fax_document_transferred_pages", "1"); + switch_core_hash_insert(filter, "variable_fax_ecm_used", "1"); + switch_core_hash_insert(filter, "variable_fax_result_code", "1"); + switch_core_hash_insert(filter, "variable_fax_result_text", "1"); + switch_core_hash_insert(filter, "variable_fax_success", "1"); + switch_core_hash_insert(filter, "variable_fax_transfer_rate", "1"); + switch_core_hash_insert(filter, "variable_fax_local_station_id", "1"); + switch_core_hash_insert(filter, "variable_fax_remote_station_id", "1"); + switch_core_hash_insert(filter, "variable_fax_remote_country", "1"); + switch_core_hash_insert(filter, "variable_fax_remote_vendor", "1"); + switch_core_hash_insert(filter, "variable_fax_remote_model", "1"); + switch_core_hash_insert(filter, "variable_fax_image_resolution", "1"); + switch_core_hash_insert(filter, "variable_fax_file_image_resolution", "1"); + switch_core_hash_insert(filter, "variable_fax_image_size", "1"); + switch_core_hash_insert(filter, "variable_fax_image_pixel_size", "1"); + switch_core_hash_insert(filter, "variable_fax_file_image_pixel_size", "1"); + switch_core_hash_insert(filter, "variable_fax_longest_bad_row_run", "1"); + switch_core_hash_insert(filter, "variable_fax_encoding", "1"); + switch_core_hash_insert(filter, "variable_fax_encoding_name", "1"); + switch_core_hash_insert(filter, "variable_fax_header", "1"); + switch_core_hash_insert(filter, "variable_fax_ident", "1"); + switch_core_hash_insert(filter, "variable_fax_timezone", "1"); + switch_core_hash_insert(filter, "variable_fax_doc_id", "1"); + switch_core_hash_insert(filter, "variable_fax_doc_database", "1"); + switch_core_hash_insert(filter, "variable_has_t38", "1"); + + /* Secure headers */ + switch_core_hash_insert(filter, "variable_sdp_secure_savp_only", "1"); + switch_core_hash_insert(filter, "variable_rtp_has_crypto", "1"); + switch_core_hash_insert(filter, "variable_rtp_secure_media", "1"); + switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed", "1"); + switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed_audio", "1"); + switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed_video", "1"); + switch_core_hash_insert(filter, "variable_zrtp_secure_media", "1"); + switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed", "1"); + switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed_audio", "1"); + switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed_video", "1"); + switch_core_hash_insert(filter, "sdp_secure_savp_only", "1"); + switch_core_hash_insert(filter, "rtp_has_crypto", "1"); + switch_core_hash_insert(filter, "rtp_secure_media", "1"); + switch_core_hash_insert(filter, "rtp_secure_media_confirmed", "1"); + switch_core_hash_insert(filter, "rtp_secure_media_confirmed_audio", "1"); + switch_core_hash_insert(filter, "rtp_secure_media_confirmed_video", "1"); + switch_core_hash_insert(filter, "zrtp_secure_media", "1"); + switch_core_hash_insert(filter, "zrtp_secure_media_confirmed", "1"); + switch_core_hash_insert(filter, "zrtp_secure_media_confirmed_audio", "1"); + switch_core_hash_insert(filter, "zrtp_secure_media_confirmed_video", "1"); + + /* Device Redirect headers */ + switch_core_hash_insert(filter, "variable_last_bridge_hangup_cause", "1"); + switch_core_hash_insert(filter, "variable_sip_redirected_by", "1"); + switch_core_hash_insert(filter, "intercepted_by", "1"); + switch_core_hash_insert(filter, "variable_bridge_uuid", "1"); + switch_core_hash_insert(filter, "Record-File-Path", "1"); + + /* Loopback headers */ + switch_core_hash_insert(filter, "variable_loopback_bowout_on_execute", "1"); + switch_core_hash_insert(filter, "variable_loopback_bowout", "1"); + switch_core_hash_insert(filter, "variable_other_loopback_leg_uuid", "1"); + switch_core_hash_insert(filter, "variable_loopback_leg", "1"); + switch_core_hash_insert(filter, "variable_is_loopback", "1"); + + // SMS + switch_core_hash_insert(filter, "Message-ID", "1"); + switch_core_hash_insert(filter, "Delivery-Failure", "1"); + switch_core_hash_insert(filter, "Delivery-Result-Code", "1"); + + return filter; +} + +static void fetch_config_filters(switch_memory_pool_t *pool) +{ + char *cf = "kazoo.conf"; + switch_xml_t cfg, xml, child, param; + switch_event_t *params; + + switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Action", "request-filter"); + + if (!(xml = switch_xml_open_cfg(cf, &cfg, params))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf); + } else if ((child = switch_xml_child(cfg, "event-filter"))) { + switch_hash_t *filter; + switch_hash_t *old_filter; + + switch_core_hash_init(&filter); + for (param = switch_xml_child(child, "header"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + switch_core_hash_insert(filter, var, "1"); + } + + old_filter = kazoo_globals.event_filter; + kazoo_globals.event_filter = filter; + if (old_filter) { + switch_core_hash_destroy(&old_filter); + } + + kazoo_globals.config_fetched = 1; + switch_xml_free(xml); + } + +} + +static void fetch_config_handlers(switch_memory_pool_t *pool) +{ + char *cf = "kazoo.conf"; + switch_xml_t cfg, xml; + switch_event_t *params; + + switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Action", "request-handlers"); + + if (!(xml = switch_xml_open_cfg(cf, &cfg, params))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf); + } else { + kazoo_config_handlers(cfg); + kazoo_globals.config_fetched = 1; + switch_xml_free(xml); + } + +} + +static void *SWITCH_THREAD_FUNC fetch_config_exec(switch_thread_t *thread, void *obj) +{ + switch_memory_pool_t *pool = (switch_memory_pool_t *)obj; + fetch_config_filters(pool); + fetch_config_handlers(pool); + + kazoo_globals.config_fetched = 1; + + return NULL; +} + +void fetch_config() { + switch_memory_pool_t *pool; + switch_thread_t *thread; + switch_threadattr_t *thd_attr = NULL; + switch_uuid_t uuid; + + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "fetching kazoo config\n"); + + switch_core_new_memory_pool(&pool); + + switch_threadattr_create(&thd_attr, pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + + switch_uuid_get(&uuid); + switch_thread_create(&thread, thd_attr, fetch_config_exec, pool, pool); + +} + + +SWITCH_MODULE_RUNTIME_FUNCTION(mod_kazoo_runtime) { + switch_os_socket_t os_socket; + + if(create_acceptor() != SWITCH_STATUS_SUCCESS) { + // TODO: what would we need to clean up here + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to create erlang connection acceptor!\n"); + close_socket(&kazoo_globals.acceptor); + return SWITCH_STATUS_TERM; + } + + switch_atomic_inc(&kazoo_globals.threads); + switch_os_sock_get(&os_socket, kazoo_globals.acceptor); + + while (switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { + int nodefd; + ErlConnect conn; + + /* zero out errno because ei_accept doesn't differentiate between a */ + /* failed authentication or a socket failure, or a client version */ + /* mismatch or a godzilla attack (and a godzilla attack is highly likely) */ + errno = 0; + + /* wait here for an erlang node to connect, timming out to check if our module is still running every now-and-again */ + if ((nodefd = ei_accept_tmo(&kazoo_globals.ei_cnode, (int) os_socket, &conn, kazoo_globals.connection_timeout)) == ERL_ERROR) { + if (erl_errno == ETIMEDOUT) { + continue; + } else if (errno) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Erlang connection acceptor socket error %d %d\n", erl_errno, errno); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, + "Erlang node connection failed - ensure your cookie matches '%s' and you are using a good nodename\n", kazoo_globals.ei_cookie); + } + continue; + } + + if (!switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { + break; + } + + /* NEW ERLANG NODE CONNECTION! Hello friend! */ + new_kazoo_node(nodefd, &conn); + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Erlang connection acceptor shut down\n"); + + switch_atomic_dec(&kazoo_globals.threads); + + return SWITCH_STATUS_TERM; +} + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_event_stream.c b/src/mod/event_handlers/mod_kazoo/kazoo_event_stream.c index 3ca0e3acc7..b52b6d4b81 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_event_stream.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_event_stream.c @@ -48,7 +48,8 @@ static char *my_dup(const char *s) { static const char* private_headers[] = {"variable_sip_h_", "sip_h_", "P-", "X-"}; static int is_private_header(const char *name) { - for(int i=0; i < 4; i++) { + int i; + for(i=0; i < 4; i++) { if(!strncmp(name, private_headers[i], strlen(private_headers[i]))) { return 1; } @@ -102,51 +103,105 @@ static switch_status_t kazoo_event_dup(switch_event_t **clone, switch_event_t *e return SWITCH_STATUS_SUCCESS; } -static void event_handler(switch_event_t *event) { +static int encode_event_old(switch_event_t *event, ei_x_buff *ebuf) { switch_event_t *clone = NULL; - ei_event_stream_t *event_stream = (ei_event_stream_t *) event->bind_user_data; + + if (kazoo_event_dup(&clone, event, kazoo_globals.event_filter) != SWITCH_STATUS_SUCCESS) { + return 0; + } + + ei_encode_switch_event(ebuf, clone); + + switch_event_destroy(&clone); + + return 1; +} + +static int encode_event_new(switch_event_t *event, ei_x_buff *ebuf) { + kazoo_message_ptr msg = NULL; + ei_event_binding_t *event_binding = (ei_event_binding_t *) event->bind_user_data; + + msg = kazoo_message_create_event(event, event_binding->event, kazoo_globals.events); + + if(msg == NULL) { + return 0; + } + + ei_x_encode_tuple_header(ebuf, 2); + ei_x_encode_atom(ebuf, "event"); + ei_encode_json(ebuf, msg->JObj); + + kazoo_message_destroy(&msg); + + return 1; +} + +/* + * event_handler is duplicated when there are 2+ nodes connected + * with the same bindings + * we should maintain a list of event_streams in event_binding struct + * and build a ref count in the message + * + */ +static void event_handler(switch_event_t *event) { + ei_event_binding_t *event_binding = (ei_event_binding_t *) event->bind_user_data; + ei_event_stream_t *event_stream = event_binding->stream; + ei_x_buff *ebuf = NULL; + int res = 0; /* if mod_kazoo or the event stream isn't running dont push a new event */ if (!switch_test_flag(event_stream, LFLAG_RUNNING) || !switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { return; } - if (event->event_id == SWITCH_EVENT_CUSTOM) { - ei_event_binding_t *event_binding = event_stream->bindings; - unsigned short int found = 0; + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Switch-Nodename", kazoo_globals.ei_cnode.thisnodename); - if (!event->subclass_name) { - return; - } - - while(event_binding != NULL) { - if (event_binding->type == SWITCH_EVENT_CUSTOM) { - if(event_binding->subclass_name - && !strcmp(event->subclass_name, event_binding->subclass_name)) { - found = 1; - break; - } - } - event_binding = event_binding->next; - } - - if (!found) { + switch_malloc(ebuf, sizeof(*ebuf)); + if(ebuf == NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate erlang buffer for mod_kazoo message\n"); + return; + } + memset(ebuf, 0, sizeof(*ebuf)); + + if(kazoo_globals.event_stream_preallocate > 0) { + ebuf->buff = malloc(kazoo_globals.event_stream_preallocate); + ebuf->buffsz = kazoo_globals.event_stream_preallocate; + ebuf->index = 0; + if(ebuf->buff == NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not pre-allocate memory for mod_kazoo message\n"); + switch_safe_free(ebuf); return; } + ei_x_encode_version(ebuf); + } else { + ei_x_new_with_version(ebuf); } - /* try to clone the event and push it to the event stream thread */ - /* TODO: someday maybe the filter comes from the event_stream (set during init only) - * and is per-binding so we only send headers that a process requests */ - if (kazoo_event_dup(&clone, event, kazoo_globals.event_filter) == SWITCH_STATUS_SUCCESS) { - if (switch_queue_trypush(event_stream->queue, clone) != SWITCH_STATUS_SUCCESS) { + + if(event_stream->node->legacy) { + res = encode_event_old(event, ebuf); + } else { + res = encode_event_new(event, ebuf); + } + + if(!res) { + ei_x_free(ebuf); + switch_safe_free(ebuf); + return; + } + + if (kazoo_globals.event_stream_preallocate > 0 && ebuf->buffsz > kazoo_globals.event_stream_preallocate) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "increased event stream buffer size to %d\n", ebuf->buffsz); + } + + if (switch_queue_trypush(event_stream->queue, ebuf) != SWITCH_STATUS_SUCCESS) { /* if we couldn't place the cloned event into the listeners */ /* event queue make sure we destroy it, real good like */ - switch_event_destroy(&clone); - } - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory error: Have a good trip? See you next fall!\n"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error placing the event in the listeners queue\n"); + ei_x_free(ebuf); + switch_safe_free(ebuf); } + } static void *SWITCH_THREAD_FUNC event_stream_loop(switch_thread_t *thread, void *obj) { @@ -178,7 +233,8 @@ static void *SWITCH_THREAD_FUNC event_stream_loop(switch_thread_t *thread, void /* check if a new connection is pending */ if (switch_pollset_poll(event_stream->pollset, 0, &numfds, &fds) == SWITCH_STATUS_SUCCESS) { - for (int32_t i = 0; i < numfds; i++) { + int32_t i; + for (i = 0; i < numfds; i++) { switch_socket_t *newsocket; /* accept the new client connection */ @@ -217,46 +273,25 @@ static void *SWITCH_THREAD_FUNC event_stream_loop(switch_thread_t *thread, void } /* if there was an event waiting in our queue send it to the client */ - if (switch_queue_pop_timeout(event_stream->queue, &pop, 500000) == SWITCH_STATUS_SUCCESS) { - switch_event_t *event = (switch_event_t *) pop; + if (switch_queue_pop_timeout(event_stream->queue, &pop, 200000) == SWITCH_STATUS_SUCCESS) { + ei_x_buff *ebuf = (ei_x_buff *) pop; if (event_stream->socket) { - ei_x_buff ebuf; char byte; short i = event_stream_framing; switch_size_t size = 1; - if(kazoo_globals.event_stream_preallocate > 0) { - ebuf.buff = malloc(kazoo_globals.event_stream_preallocate); - ebuf.buffsz = kazoo_globals.event_stream_preallocate; - ebuf.index = 0; - if(ebuf.buff == NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not pre-allocate memory for mod_kazoo message\n"); - break; - } - ei_x_encode_version(&ebuf); - } else { - ei_x_new_with_version(&ebuf); - } - - ei_encode_switch_event(&ebuf, event); - - if (kazoo_globals.event_stream_preallocate > 0 && ebuf.buffsz > kazoo_globals.event_stream_preallocate) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "increased event stream buffer size to %d\n", ebuf.buffsz); - } - while (i) { - byte = ebuf.index >> (8 * --i); + byte = ebuf->index >> (8 * --i); switch_socket_send(event_stream->socket, &byte, &size); } - size = (switch_size_t)ebuf.index; - switch_socket_send(event_stream->socket, ebuf.buff, &size); - - ei_x_free(&ebuf); + size = (switch_size_t)ebuf->index; + switch_socket_send(event_stream->socket, ebuf->buff, &size); } - switch_event_destroy(&event); + ei_x_free(ebuf); + switch_safe_free(ebuf); } } @@ -297,11 +332,12 @@ static void *SWITCH_THREAD_FUNC event_stream_loop(switch_thread_t *thread, void return NULL; } -ei_event_stream_t *new_event_stream(ei_event_stream_t **event_streams, const erlang_pid *from) { +ei_event_stream_t *new_event_stream(ei_node_t *ei_node, const erlang_pid *from) { switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; switch_memory_pool_t *pool = NULL; ei_event_stream_t *event_stream; + ei_event_stream_t **event_streams = &ei_node->event_streams; /* create memory pool for this event stream */ if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { @@ -320,6 +356,7 @@ ei_event_stream_t *new_event_stream(ei_event_stream_t **event_streams, const erl event_stream->bindings = NULL; event_stream->pool = pool; event_stream->connected = SWITCH_FALSE; + event_stream->node = ei_node; memcpy(&event_stream->pid, from, sizeof(erlang_pid)); switch_queue_create(&event_stream->queue, MAX_QUEUE_LEN, pool); @@ -443,17 +480,68 @@ switch_status_t remove_event_streams(ei_event_stream_t **event_streams) { return SWITCH_STATUS_SUCCESS; } -switch_status_t add_event_binding(ei_event_stream_t *event_stream, const switch_event_types_t event_type, const char *subclass_name) { +void bind_event_profile(ei_event_binding_t *event_binding, kazoo_event_ptr event) +{ + switch_event_types_t event_type; + while(event != NULL) { + if (switch_name_event(event->name, &event_type) != SWITCH_STATUS_SUCCESS) { + event_type = SWITCH_EVENT_CUSTOM; + } + if(event_binding->type != SWITCH_EVENT_CUSTOM + && event_binding->type == event_type) { + break; + } + if (event_binding->type == SWITCH_EVENT_CUSTOM + && event_binding->type == event_type + && !strcasecmp(event_binding->subclass_name, event->name)) { + break; + } + event = event->next; + } + event_binding->event = event; + if(event == NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "EVENT BINDING ERROR %s - %s\n",switch_event_name(event_binding->type), event_binding->subclass_name); + } +} + +void bind_event_profiles(kazoo_event_ptr event) +{ + ei_node_t *ei_node = kazoo_globals.ei_nodes; + while(ei_node) { + ei_event_stream_t *event_streams = ei_node->event_streams; + while(event_streams) { + ei_event_binding_t *bindings = event_streams->bindings; + while(bindings) { + bind_event_profile(bindings, event); + bindings = bindings->next; + } + event_streams = event_streams->next; + } + ei_node = ei_node->next; + } +} + +switch_status_t add_event_binding(ei_event_stream_t *event_stream, const char *event_name) { ei_event_binding_t *event_binding = event_stream->bindings; + switch_event_types_t event_type; + + if(!strcasecmp(event_name, "CUSTOM")) { + return SWITCH_STATUS_SUCCESS; + } + + if (switch_name_event(event_name, &event_type) != SWITCH_STATUS_SUCCESS) { + event_type = SWITCH_EVENT_CUSTOM; + } /* check if the event binding already exists, ignore if so */ while(event_binding != NULL) { if (event_binding->type == SWITCH_EVENT_CUSTOM) { - if(subclass_name - && event_binding->subclass_name - && !strcmp(subclass_name, event_binding->subclass_name)) { - return SWITCH_STATUS_SUCCESS; - } + if(event_type == SWITCH_EVENT_CUSTOM + && event_name + && event_binding->subclass_name + && !strcasecmp(event_name, event_binding->subclass_name)) { + return SWITCH_STATUS_SUCCESS; + } } else if (event_binding->type == event_type) { return SWITCH_STATUS_SUCCESS; } @@ -467,18 +555,21 @@ switch_status_t add_event_binding(ei_event_stream_t *event_stream, const switch_ } /* prepare the event binding struct */ + event_binding->stream = event_stream; event_binding->type = event_type; - if (!subclass_name || zstr(subclass_name)) { - event_binding->subclass_name = NULL; + if(event_binding->type == SWITCH_EVENT_CUSTOM) { + event_binding->subclass_name = switch_core_strdup(event_stream->pool, event_name); } else { - /* TODO: free strdup? */ - event_binding->subclass_name = strdup(subclass_name); + event_binding->subclass_name = SWITCH_EVENT_SUBCLASS_ANY; } event_binding->next = NULL; + bind_event_profile(event_binding, kazoo_globals.events->events); + + /* bind to the event with a unique ID and capture the event_node pointer */ switch_uuid_str(event_binding->id, sizeof(event_binding->id)); - if (switch_event_bind_removable(event_binding->id, event_type, subclass_name, event_handler, event_stream, &event_binding->node) != SWITCH_STATUS_SUCCESS) { + if (switch_event_bind_removable(event_binding->id, event_type, event_binding->subclass_name, event_handler, event_binding, &event_binding->node) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to bind to event %s %s!\n" ,switch_event_name(event_binding->type), event_binding->subclass_name ? event_binding->subclass_name : ""); return SWITCH_STATUS_GENERR; diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_fetch_agent.c b/src/mod/event_handlers/mod_kazoo/kazoo_fetch_agent.c index 006ffe32f0..0e4e842f2c 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_fetch_agent.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_fetch_agent.c @@ -32,38 +32,9 @@ */ #include "mod_kazoo.h" -struct xml_fetch_reply_s { - char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; - char *xml_str; - struct xml_fetch_reply_s *next; -}; -typedef struct xml_fetch_reply_s xml_fetch_reply_t; -struct fetch_handler_s { - erlang_pid pid; - struct fetch_handler_s *next; -}; -typedef struct fetch_handler_s fetch_handler_t; -struct ei_xml_client_s { - ei_node_t *ei_node; - fetch_handler_t *fetch_handlers; - struct ei_xml_client_s *next; -}; -typedef struct ei_xml_client_s ei_xml_client_t; -struct ei_xml_agent_s { - switch_memory_pool_t *pool; - switch_xml_section_t section; - switch_thread_rwlock_t *lock; - ei_xml_client_t *clients; - switch_mutex_t *current_client_mutex; - ei_xml_client_t *current_client; - switch_mutex_t *replies_mutex; - switch_thread_cond_t *new_reply; - xml_fetch_reply_t *replies; -}; -typedef struct ei_xml_agent_s ei_xml_agent_t; static char *xml_section_to_string(switch_xml_section_t section) { switch(section) { @@ -77,6 +48,8 @@ static char *xml_section_to_string(switch_xml_section_t section) { return "chatplan"; case SWITCH_XML_SECTION_CHANNELS: return "channels"; + case SWITCH_XML_SECTION_LANGUAGES: + return "languages"; default: return "unknown"; } @@ -133,6 +106,11 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con ei_xml_client_t *client; fetch_handler_t *fetch_handler; xml_fetch_reply_t reply, *pending, *prev = NULL; + switch_event_t *event = params; + kazoo_fetch_profile_ptr profile = agent->profile; + const char *fetch_call_id; + ei_send_msg_t *send_msg = NULL; + int sent = 0; now = switch_micro_time_now(); @@ -164,12 +142,60 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con return xml; } + if(event == NULL) { + if (switch_event_create(&event, SWITCH_EVENT_GENERAL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error creating event for fetch handler\n"); + return xml; + } + } + /* prepare the reply collector */ switch_uuid_get(&uuid); switch_uuid_format(reply.uuid_str, &uuid); reply.next = NULL; reply.xml_str = NULL; + if((fetch_call_id = switch_event_get_header(event, "Fetch-Call-UUID")) != NULL) { + switch_core_session_t *session = NULL; + if((session = switch_core_session_force_locate(fetch_call_id)) != NULL) { + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_channel_event_set_data(channel, event); + switch_core_session_rwunlock(session); + } + } + + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Fetch-UUID", reply.uuid_str); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Fetch-Section", section); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Fetch-Tag", tag_name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Fetch-Key-Name", key_name); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Fetch-Key-Value", key_value); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Fetch-Timeout", "%u", profile->fetch_timeout); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Fetch-Timestamp-Micro", "%ld", (uint64_t)now); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Kazoo-Version", VERSION); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Kazoo-Bundle", BUNDLE); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Kazoo-Release", RELEASE); + + switch_malloc(send_msg, sizeof(*send_msg)); + + if(client->ei_node->legacy) { + ei_x_new_with_version(&send_msg->buf); + ei_x_encode_tuple_header(&send_msg->buf, 7); + ei_x_encode_atom(&send_msg->buf, "fetch"); + ei_x_encode_atom(&send_msg->buf, section); + _ei_x_encode_string(&send_msg->buf, tag_name ? tag_name : "undefined"); + _ei_x_encode_string(&send_msg->buf, key_name ? key_name : "undefined"); + _ei_x_encode_string(&send_msg->buf, key_value ? key_value : "undefined"); + _ei_x_encode_string(&send_msg->buf, reply.uuid_str); + ei_encode_switch_event_headers(&send_msg->buf, event); + } else { + kazoo_message_ptr msg = kazoo_message_create_fetch(event, profile); + ei_x_new_with_version(&send_msg->buf); + ei_x_encode_tuple_header(&send_msg->buf, 2); + ei_x_encode_atom(&send_msg->buf, "fetch"); + ei_encode_json(&send_msg->buf, msg->JObj); + kazoo_message_destroy(&msg); + } + /* add our reply placeholder to the replies list */ switch_mutex_lock(agent->replies_mutex); if (!agent->replies) { @@ -181,28 +207,8 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con switch_mutex_unlock(agent->replies_mutex); fetch_handler = client->fetch_handlers; - while (fetch_handler != NULL) { - ei_send_msg_t *send_msg; - - switch_malloc(send_msg, sizeof(*send_msg)); + while (fetch_handler != NULL && sent == 0) { memcpy(&send_msg->pid, &fetch_handler->pid, sizeof(erlang_pid)); - - ei_x_new_with_version(&send_msg->buf); - - ei_x_encode_tuple_header(&send_msg->buf, 7); - ei_x_encode_atom(&send_msg->buf, "fetch"); - ei_x_encode_atom(&send_msg->buf, section); - _ei_x_encode_string(&send_msg->buf, tag_name ? tag_name : "undefined"); - _ei_x_encode_string(&send_msg->buf, key_name ? key_name : "undefined"); - _ei_x_encode_string(&send_msg->buf, key_value ? key_value : "undefined"); - _ei_x_encode_string(&send_msg->buf, reply.uuid_str); - - if (params) { - ei_encode_switch_event_headers(&send_msg->buf, params); - } else { - ei_x_encode_empty_list(&send_msg->buf); - } - if (switch_queue_trypush(client->ei_node->send_msgs, send_msg) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to send %s XML request to %s <%d.%d.%d>\n" ,section @@ -210,8 +216,6 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con ,fetch_handler->pid.creation ,fetch_handler->pid.num ,fetch_handler->pid.serial); - ei_x_free(&send_msg->buf); - switch_safe_free(send_msg); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending %s XML request (%s) to %s <%d.%d.%d>\n" ,section @@ -220,11 +224,19 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con ,fetch_handler->pid.creation ,fetch_handler->pid.num ,fetch_handler->pid.serial); + sent = 1; } - fetch_handler = fetch_handler->next; } + if(!sent) { + ei_x_free(&send_msg->buf); + switch_safe_free(send_msg); + } + + if(params == NULL) + switch_event_destroy(&event); + /* wait for a reply (if there isnt already one...amazingly improbable but lets not take shortcuts */ switch_mutex_lock(agent->replies_mutex); @@ -292,6 +304,42 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con return xml; } +void bind_fetch_profile(ei_xml_agent_t *agent, kazoo_config_ptr fetch_handlers) +{ + switch_hash_index_t *hi; + kazoo_fetch_profile_ptr val = NULL, ptr = NULL; + + for (hi = switch_core_hash_first(fetch_handlers->hash); hi; hi = switch_core_hash_next(&hi)) { + switch_core_hash_this(hi, NULL, NULL, (void**) &val); + if (val && val->section == agent->section) { + ptr = val; + break; + } + } + agent->profile = ptr; +} + +void rebind_fetch_profiles(kazoo_config_ptr fetch_handlers) +{ + if(kazoo_globals.config_fetch_binding != NULL) + bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.config_fetch_binding), fetch_handlers); + + if(kazoo_globals.directory_fetch_binding != NULL) + bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.directory_fetch_binding), fetch_handlers); + + if(kazoo_globals.dialplan_fetch_binding != NULL) + bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.dialplan_fetch_binding), fetch_handlers); + + if(kazoo_globals.channels_fetch_binding != NULL) + bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.channels_fetch_binding), fetch_handlers); + + if(kazoo_globals.languages_fetch_binding != NULL) + bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.languages_fetch_binding), fetch_handlers); + + if(kazoo_globals.chatplan_fetch_binding != NULL) + bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.chatplan_fetch_binding), fetch_handlers); +} + static switch_status_t bind_fetch_agent(switch_xml_section_t section, switch_xml_binding_t **binding) { switch_memory_pool_t *pool = NULL; ei_xml_agent_t *agent; @@ -326,6 +374,8 @@ static switch_status_t bind_fetch_agent(switch_xml_section_t section, switch_xml switch_thread_cond_create(&agent->new_reply, pool); agent->replies = NULL; + bind_fetch_profile(agent, kazoo_globals.fetch_handlers); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Bound to %s XML requests\n" ,xml_section_to_string(section)); @@ -336,6 +386,9 @@ static switch_status_t unbind_fetch_agent(switch_xml_binding_t **binding) { ei_xml_agent_t *agent; ei_xml_client_t *client; + if(*binding == NULL) + return SWITCH_STATUS_GENERR; + /* get a pointer to our user_data */ agent = (ei_xml_agent_t *)switch_xml_get_binding_user_data(*binding); @@ -399,6 +452,9 @@ static switch_status_t remove_xml_client(ei_node_t *ei_node, switch_xml_binding_ ei_xml_client_t *client, *prev = NULL; int found = 0; + if(binding == NULL) + return SWITCH_STATUS_GENERR; + agent = (ei_xml_agent_t *)switch_xml_get_binding_user_data(binding); /* write-lock the agent */ @@ -575,8 +631,9 @@ switch_status_t bind_fetch_agents() { bind_fetch_agent(SWITCH_XML_SECTION_CONFIG, &kazoo_globals.config_fetch_binding); bind_fetch_agent(SWITCH_XML_SECTION_DIRECTORY, &kazoo_globals.directory_fetch_binding); bind_fetch_agent(SWITCH_XML_SECTION_DIALPLAN, &kazoo_globals.dialplan_fetch_binding); - bind_fetch_agent(SWITCH_XML_SECTION_CHATPLAN, &kazoo_globals.chatplan_fetch_binding); bind_fetch_agent(SWITCH_XML_SECTION_CHANNELS, &kazoo_globals.channels_fetch_binding); + bind_fetch_agent(SWITCH_XML_SECTION_LANGUAGES, &kazoo_globals.languages_fetch_binding); + bind_fetch_agent(SWITCH_XML_SECTION_CHATPLAN, &kazoo_globals.chatplan_fetch_binding); return SWITCH_STATUS_SUCCESS; } @@ -585,8 +642,9 @@ switch_status_t unbind_fetch_agents() { unbind_fetch_agent(&kazoo_globals.config_fetch_binding); unbind_fetch_agent(&kazoo_globals.directory_fetch_binding); unbind_fetch_agent(&kazoo_globals.dialplan_fetch_binding); - unbind_fetch_agent(&kazoo_globals.chatplan_fetch_binding); unbind_fetch_agent(&kazoo_globals.channels_fetch_binding); + unbind_fetch_agent(&kazoo_globals.languages_fetch_binding); + unbind_fetch_agent(&kazoo_globals.chatplan_fetch_binding); return SWITCH_STATUS_SUCCESS; } @@ -595,8 +653,9 @@ switch_status_t remove_xml_clients(ei_node_t *ei_node) { remove_xml_client(ei_node, kazoo_globals.config_fetch_binding); remove_xml_client(ei_node, kazoo_globals.directory_fetch_binding); remove_xml_client(ei_node, kazoo_globals.dialplan_fetch_binding); - remove_xml_client(ei_node, kazoo_globals.chatplan_fetch_binding); remove_xml_client(ei_node, kazoo_globals.channels_fetch_binding); + remove_xml_client(ei_node, kazoo_globals.languages_fetch_binding); + remove_xml_client(ei_node, kazoo_globals.chatplan_fetch_binding); return SWITCH_STATUS_SUCCESS; } @@ -606,6 +665,9 @@ switch_status_t add_fetch_handler(ei_node_t *ei_node, erlang_pid *from, switch_x ei_xml_client_t *client; fetch_handler_t *fetch_handler; + if(binding == NULL) + return SWITCH_STATUS_GENERR; + agent = (ei_xml_agent_t *)switch_xml_get_binding_user_data(binding); /* write-lock the agent */ @@ -653,8 +715,9 @@ switch_status_t remove_fetch_handlers(ei_node_t *ei_node, erlang_pid *from) { remove_fetch_handler(ei_node, from, kazoo_globals.config_fetch_binding); remove_fetch_handler(ei_node, from, kazoo_globals.directory_fetch_binding); remove_fetch_handler(ei_node, from, kazoo_globals.dialplan_fetch_binding); - remove_fetch_handler(ei_node, from, kazoo_globals.chatplan_fetch_binding); remove_fetch_handler(ei_node, from, kazoo_globals.channels_fetch_binding); + remove_fetch_handler(ei_node, from, kazoo_globals.languages_fetch_binding); + remove_fetch_handler(ei_node, from, kazoo_globals.chatplan_fetch_binding); return SWITCH_STATUS_SUCCESS; } @@ -689,8 +752,9 @@ switch_status_t handle_api_command_streams(ei_node_t *ei_node, switch_stream_han handle_api_command_stream(ei_node, stream, kazoo_globals.config_fetch_binding); handle_api_command_stream(ei_node, stream, kazoo_globals.directory_fetch_binding); handle_api_command_stream(ei_node, stream, kazoo_globals.dialplan_fetch_binding); - handle_api_command_stream(ei_node, stream, kazoo_globals.chatplan_fetch_binding); handle_api_command_stream(ei_node, stream, kazoo_globals.channels_fetch_binding); + handle_api_command_stream(ei_node, stream, kazoo_globals.languages_fetch_binding); + handle_api_command_stream(ei_node, stream, kazoo_globals.chatplan_fetch_binding); return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_fields.h b/src/mod/event_handlers/mod_kazoo/kazoo_fields.h new file mode 100644 index 0000000000..95aab4e917 --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_fields.h @@ -0,0 +1,195 @@ +/* +* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* Copyright (C) 2005-2012, Anthony Minessale II +* +* Version: MPL 1.1 +* +* The contents of this file are subject to the Mozilla Public License Version +* 1.1 (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* http://www.mozilla.org/MPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* +* The Initial Developer of the Original Code is +* Anthony Minessale II +* Portions created by the Initial Developer are Copyright (C) +* the Initial Developer. All Rights Reserved. +* +* Based on mod_skel by +* Anthony Minessale II +* +* Contributor(s): +* +* Daniel Bryars +* Tim Brown +* Anthony Minessale II +* William King +* Mike Jerris +* +* kazoo.c -- Sends FreeSWITCH events to an AMQP broker +* +*/ + +#ifndef KAZOO_FIELDS_H +#define KAZOO_FIELDS_H + +#include + +#define MAX_LIST_FIELDS 25 + +typedef struct kazoo_log_levels kazoo_loglevels_t; +typedef kazoo_loglevels_t *kazoo_loglevels_ptr; + +struct kazoo_log_levels +{ + switch_log_level_t success_log_level; + switch_log_level_t failed_log_level; + switch_log_level_t warn_log_level; + switch_log_level_t info_log_level; + switch_log_level_t time_log_level; + switch_log_level_t filtered_event_log_level; + switch_log_level_t filtered_field_log_level; + +}; + +typedef struct kazoo_logging kazoo_logging_t; +typedef kazoo_logging_t *kazoo_logging_ptr; + +struct kazoo_logging +{ + kazoo_loglevels_ptr levels; + const char *profile_name; + const char *event_name; +}; + +typedef struct kazoo_list_s { + char *value[MAX_LIST_FIELDS]; + int size; +} kazoo_list_t; + +typedef enum { + FILTER_COMPARE_REGEX, + FILTER_COMPARE_LIST, + FILTER_COMPARE_VALUE, + FILTER_COMPARE_PREFIX, + FILTER_COMPARE_EXISTS +} kazoo_filter_compare_type; + +typedef enum { + FILTER_EXCLUDE, + FILTER_INCLUDE, + FILTER_ENSURE +} kazoo_filter_type; + +typedef struct kazoo_filter_t { + kazoo_filter_type type; + kazoo_filter_compare_type compare; + char* name; + char* value; + kazoo_list_t list; + struct kazoo_filter_t* next; +} kazoo_filter, *kazoo_filter_ptr; + + +typedef enum { + JSON_NONE, + JSON_STRING, + JSON_NUMBER, + JSON_BOOLEAN, + JSON_OBJECT, + JSON_RAW +} kazoo_json_field_type; + +typedef enum { + FIELD_NONE, + FIELD_COPY, + FIELD_STATIC, + FIELD_FIRST_OF, + FIELD_EXPAND, + FIELD_PREFIX, + FIELD_OBJECT, + FIELD_GROUP, + FIELD_REFERENCE, + +} kazoo_field_type; + +typedef struct kazoo_field_t kazoo_field; +typedef kazoo_field *kazoo_field_ptr; + +typedef struct kazoo_fields_t kazoo_fields; +typedef kazoo_fields *kazoo_fields_ptr; + +typedef struct kazoo_definition_t kazoo_definition; +typedef kazoo_definition *kazoo_definition_ptr; + +struct kazoo_field_t { + char* name; + char* value; + char* as; + kazoo_list_t list; + switch_bool_t exclude_prefix; + kazoo_field_type in_type; + kazoo_json_field_type out_type; + kazoo_filter_ptr filter; + + kazoo_definition_ptr ref; + kazoo_field_ptr next; + kazoo_fields_ptr children; +}; + +struct kazoo_fields_t { + kazoo_field_ptr head; + int verbose; +}; + + +struct kazoo_definition_t { + char* name; + kazoo_field_ptr head; + kazoo_filter_ptr filter; +}; + +struct kazoo_event { + kazoo_event_profile_ptr profile; + char *name; + kazoo_fields_ptr fields; + kazoo_filter_ptr filter; + + kazoo_event_t* next; +}; + +struct kazoo_event_profile { + char *name; + kazoo_config_ptr root; + switch_bool_t running; + switch_memory_pool_t *pool; + kazoo_filter_ptr filter; + kazoo_fields_ptr fields; + kazoo_event_ptr events; + + kazoo_loglevels_ptr logging; +}; + +struct kazoo_fetch_profile { + char *name; + kazoo_config_ptr root; + switch_bool_t running; + switch_memory_pool_t *pool; + kazoo_fields_ptr fields; + int fetch_timeout; + switch_mutex_t *fetch_reply_mutex; + switch_hash_t *fetch_reply_hash; + switch_xml_binding_t *fetch_binding; + switch_xml_section_t section; + + kazoo_loglevels_ptr logging; +}; + +#endif /* KAZOO_FIELDS_H */ + diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_message.c b/src/mod/event_handlers/mod_kazoo/kazoo_message.c new file mode 100644 index 0000000000..c95a254062 --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_message.c @@ -0,0 +1,458 @@ +/* +* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* Copyright (C) 2005-2012, Anthony Minessale II +* +* Version: MPL 1.1 +* +* The contents of this file are subject to the Mozilla Public License Version +* 1.1 (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* http://www.mozilla.org/MPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* +* The Initial Developer of the Original Code is +* Anthony Minessale II +* Portions created by the Initial Developer are Copyright (C) +* the Initial Developer. All Rights Reserved. +* +* Based on mod_skel by +* Anthony Minessale II +* +* Contributor(s): +* +* Daniel Bryars +* Tim Brown +* Anthony Minessale II +* William King +* Mike Jerris +* +* kazoo.c -- Sends FreeSWITCH events to an AMQP broker +* +*/ + +#include "mod_kazoo.h" + +/* deletes then add */ +void kazoo_cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) +{ + cJSON_DeleteItemFromObject(object, string); + cJSON_AddItemToObject(object, string, item); +} + +static int inline filter_compare(switch_event_t* evt, kazoo_filter_ptr filter) +{ + switch_event_header_t *header; + int hasValue = 0, /*size, */n; + char *value; + + switch(filter->compare) { + + case FILTER_COMPARE_EXISTS: + hasValue = switch_event_get_header(evt, filter->name) != NULL ? 1 : 0; + break; + + case FILTER_COMPARE_VALUE: + value = switch_event_get_header_nil(evt, filter->name); + hasValue = !strcmp(value, filter->value); + break; + + case FILTER_COMPARE_PREFIX: + for (header = evt->headers; header; header = header->next) { + if(!strncmp(header->name, filter->value, strlen(filter->value))) { + hasValue = 1; + break; + } + } + break; + + case FILTER_COMPARE_LIST: + value = switch_event_get_header(evt, filter->name); + if(value) { + for(n = 0; n < filter->list.size; n++) { + if(!strncmp(value, filter->list.value[n], strlen(filter->list.value[n]))) { + hasValue = 1; + break; + } + } + } + break; + + case FILTER_COMPARE_REGEX: + break; + + default: + break; + } + + return hasValue; +} + +static kazoo_filter_ptr inline filter_event(switch_event_t* evt, kazoo_filter_ptr filter) +{ + while(filter) { + int hasValue = filter_compare(evt, filter); + if(filter->type == FILTER_EXCLUDE) { + if(hasValue) + break; + } else if(filter->type == FILTER_INCLUDE) { + if(!hasValue) + break; + } + filter = filter->next; + } + return filter; +} + +static void kazoo_event_init_json_fields(switch_event_t *event, cJSON *json) +{ + switch_event_header_t *hp; + for (hp = event->headers; hp; hp = hp->next) { + if (hp->idx) { + cJSON *a = cJSON_CreateArray(); + int i; + + for(i = 0; i < hp->idx; i++) { + cJSON_AddItemToArray(a, cJSON_CreateString(hp->array[i])); + } + + cJSON_AddItemToObject(json, hp->name, a); + + } else { + cJSON_AddItemToObject(json, hp->name, cJSON_CreateString(hp->value)); + } + } +} + +static switch_status_t kazoo_event_init_json(kazoo_fields_ptr fields1, kazoo_fields_ptr fields2, switch_event_t* evt, cJSON** clone) +{ + switch_status_t status; + if( (fields2 && fields2->verbose) + || (fields1 && fields1->verbose) + || ( (!fields2) && (!fields1)) ) { + status = switch_event_serialize_json_obj(evt, clone); + } else { + status = SWITCH_STATUS_SUCCESS; + *clone = cJSON_CreateObject(); + if((*clone) == NULL) { + status = SWITCH_STATUS_GENERR; + } + } + return status; +} + +static cJSON * kazoo_event_json_value(kazoo_json_field_type type, const char *value) { + cJSON *item = NULL; + switch(type) { + case JSON_STRING: + item = cJSON_CreateString(value); + break; + + case JSON_NUMBER: + item = cJSON_CreateNumber(strtod(value, NULL)); + break; + + case JSON_BOOLEAN: + item = cJSON_CreateBool(switch_true(value)); + break; + + case JSON_OBJECT: + item = cJSON_CreateObject(); + break; + + case JSON_RAW: + item = cJSON_CreateRaw(value); + break; + + default: + break; + }; + + return item; +} + +static cJSON * kazoo_event_add_json_value(cJSON *dst, kazoo_field_ptr field, const char *as, const char *value) { + cJSON *item = NULL; + if(value || field->out_type == JSON_OBJECT) { + if((item = kazoo_event_json_value(field->out_type, value)) != NULL) { + kazoo_cJSON_AddItemToObject(dst, as, item); + } + } + return item; +} + +#define MAX_FIRST_OF 25 + +char * first_of(switch_event_t *src, char * in) +{ + switch_event_header_t *header; + char *y1, *y2, *y3 = NULL; + char *value[MAX_FIRST_OF]; + int n, size; + + y1 = strdup(in); + if((y2 = (char *) switch_stristr("first-of", y1)) != NULL) { + char tmp[2048] = ""; + y3 = switch_find_end_paren((const char *)y2 + 8, '(', ')'); + *++y3='\0'; + *y2 = '\0'; + size = switch_separate_string(y2 + 9, '|', value, MAX_FIRST_OF); + for(n=0; n < size; n++) { + header = switch_event_get_header_ptr(src, value[n]); + if(header) { + switch_snprintf(tmp, sizeof(tmp), "%s%s%s", y1, header->name, y3); + free(y1); + y2 = strdup(tmp); + y3 = first_of(src, y2); + if(y2 == y3) { + return y2; + } else { + return y3; + } + } + } + } + free(y1); + return in; + +} + +cJSON * kazoo_event_add_field_to_json(cJSON *dst, switch_event_t *src, kazoo_field_ptr field) +{ + switch_event_header_t *header; + char *expanded, *firstOf; + uint i, n; + cJSON *item = NULL; + + switch(field->in_type) { + case FIELD_COPY: + if((header = switch_event_get_header_ptr(src, field->name)) != NULL) { + if (header->idx) { + item = cJSON_CreateArray(); + for(i = 0; i < header->idx; i++) { + cJSON_AddItemToArray(item, kazoo_event_json_value(field->out_type, header->array[i])); + } + kazoo_cJSON_AddItemToObject(dst, field->as ? field->as : field->name, item); + } else { + item = kazoo_event_add_json_value(dst, field, field->as ? field->as : field->name, header->value); + } + } + break; + + case FIELD_EXPAND: + firstOf = first_of(src, field->value); + expanded = switch_event_expand_headers(src, firstOf); + if(expanded != NULL && !zstr(expanded)) { + item = kazoo_event_add_json_value(dst, field, field->as ? field->as : field->name, expanded); + } + if(expanded != firstOf) { + free(expanded); + } + if(firstOf != field->value) { + free(firstOf); + } + break; + + case FIELD_FIRST_OF: + for(n = 0; n < field->list.size; n++) { + if(*field->list.value[n] == '#') { + item = kazoo_event_add_json_value(dst, field, field->as ? field->as : field->name, ++field->list.value[n]); + break; + } else { + header = switch_event_get_header_ptr(src, field->list.value[n]); + if(header) { + if (header->idx) { + item = cJSON_CreateArray(); + for(i = 0; i < header->idx; i++) { + cJSON_AddItemToArray(item, kazoo_event_json_value(field->out_type, header->array[i])); + } + kazoo_cJSON_AddItemToObject(dst, field->as ? field->as : field->name, item); + } else { + item = kazoo_event_add_json_value(dst, field, field->as ? field->as : field->name, header->value); + } + break; + } + } + } + break; + + case FIELD_PREFIX: + for (header = src->headers; header; header = header->next) { + if(!strncmp(header->name, field->name, strlen(field->name))) { + if (header->idx) { + cJSON *array = cJSON_CreateArray(); + for(i = 0; i < header->idx; i++) { + cJSON_AddItemToArray(array, kazoo_event_json_value(field->out_type, header->array[i])); + } + kazoo_cJSON_AddItemToObject(dst, field->exclude_prefix ? header->name+strlen(field->name) : header->name, array); + } else { + kazoo_event_add_json_value(dst, field, field->exclude_prefix ? header->name+strlen(field->name) : header->name, header->value); + } + } + } + break; + + case FIELD_STATIC: + item = kazoo_event_add_json_value(dst, field, field->name, field->value); + break; + + case FIELD_GROUP: + item = dst; + break; + + default: + break; + } + + return item; +} + +static switch_status_t kazoo_event_add_fields_to_json(kazoo_logging_ptr logging, cJSON *dst, switch_event_t *src, kazoo_field_ptr field) { + + kazoo_filter_ptr filter; + cJSON *item = NULL; + while(field) { + if(field->in_type == FIELD_REFERENCE) { + if(field->ref) { + if((filter = filter_event(src, field->ref->filter)) != NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, logging->levels->filtered_field_log_level, "profile[%s] event %s, referenced field %s filtered by settings %s : %s\n", logging->profile_name, logging->event_name, field->ref->name, filter->name, filter->value); + } else { + kazoo_event_add_fields_to_json(logging, dst, src, field->ref->head); + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "profile[%s] event %s, referenced field %s not found\n", logging->profile_name, logging->event_name, field->name); + } + } else { + if((filter = filter_event(src, field->filter)) != NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, logging->levels->filtered_field_log_level, "profile[%s] event %s, field %s filtered by settings %s : %s\n", logging->profile_name, logging->event_name, field->name, filter->name, filter->value); + } else { + item = kazoo_event_add_field_to_json(dst, src, field); + if(field->children && item != NULL) { + if(field->children->verbose && field->out_type == JSON_OBJECT) { + kazoo_event_init_json_fields(src, item); + } + kazoo_event_add_fields_to_json(logging, field->out_type == JSON_OBJECT ? item : dst, src, field->children->head); + } + } + } + + field = field->next; + } + + return SWITCH_STATUS_SUCCESS; +} + + +kazoo_message_ptr kazoo_message_create_event(switch_event_t* evt, kazoo_event_ptr event, kazoo_event_profile_ptr profile) +{ + kazoo_message_ptr message; + cJSON *JObj = NULL; + kazoo_filter_ptr filtered; + kazoo_logging_t logging; + + logging.levels = profile->logging; + logging.event_name = switch_event_get_header_nil(evt, "Event-Name"); + logging.profile_name = profile->name; + + switch_event_add_header(evt, SWITCH_STACK_BOTTOM, "Switch-Nodename", "%s@%s", "freeswitch", switch_event_get_header(evt, "FreeSWITCH-Hostname")); + + + message = malloc(sizeof(kazoo_message_t)); + if(message == NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error allocating memory for serializing event to json\n"); + return NULL; + } + memset(message, 0, sizeof(kazoo_message_t)); + + if(profile->filter) { + // filtering + if((filtered = filter_event(evt, profile->filter)) != NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, logging.levels->filtered_event_log_level, "profile[%s] event %s filtered by profile settings %s : %s\n", logging.profile_name, logging.event_name, filtered->name, filtered->value); + kazoo_message_destroy(&message); + return NULL; + } + } + + if(event && event->filter) { + if((filtered = filter_event(evt, event->filter)) != NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, logging.levels->filtered_event_log_level, "profile[%s] event %s filtered by event settings %s : %s\n", logging.profile_name, logging.event_name, filtered->name, filtered->value); + kazoo_message_destroy(&message); + return NULL; + } + } + + kazoo_event_init_json(profile->fields, event ? event->fields : NULL, evt, &JObj); + + if(profile->fields) + kazoo_event_add_fields_to_json(&logging, JObj, evt, profile->fields->head); + + if(event && event->fields) + kazoo_event_add_fields_to_json(&logging, JObj, evt, event->fields->head); + + message->JObj = JObj; + + + return message; + + +} + +kazoo_message_ptr kazoo_message_create_fetch(switch_event_t* evt, kazoo_fetch_profile_ptr profile) +{ + kazoo_message_ptr message; + cJSON *JObj = NULL; + kazoo_logging_t logging; + + logging.levels = profile->logging; + logging.event_name = switch_event_get_header_nil(evt, "Event-Name"); + logging.profile_name = profile->name; + + switch_event_add_header(evt, SWITCH_STACK_BOTTOM, "Switch-Nodename", "%s@%s", "freeswitch", switch_event_get_header(evt, "FreeSWITCH-Hostname")); + + message = malloc(sizeof(kazoo_message_t)); + if(message == NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error allocating memory for serializing event to json\n"); + return NULL; + } + memset(message, 0, sizeof(kazoo_message_t)); + + + kazoo_event_init_json(profile->fields, NULL, evt, &JObj); + + if(profile->fields) + kazoo_event_add_fields_to_json(&logging, JObj, evt, profile->fields->head); + + message->JObj = JObj; + + + return message; + + +} + + +void kazoo_message_destroy(kazoo_message_ptr *msg) +{ + if (!msg || !*msg) return; + if((*msg)->JObj != NULL) + cJSON_Delete((*msg)->JObj); + switch_safe_free(*msg); + +} + + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4 + */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_message.h b/src/mod/event_handlers/mod_kazoo/kazoo_message.h new file mode 100644 index 0000000000..0674c71f0b --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_message.h @@ -0,0 +1,65 @@ +/* +* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* Copyright (C) 2005-2012, Anthony Minessale II +* +* Version: MPL 1.1 +* +* The contents of this file are subject to the Mozilla Public License Version +* 1.1 (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* http://www.mozilla.org/MPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application +* +* The Initial Developer of the Original Code is +* Anthony Minessale II +* Portions created by the Initial Developer are Copyright (C) +* the Initial Developer. All Rights Reserved. +* +* Based on mod_skel by +* Anthony Minessale II +* +* Contributor(s): +* +* Daniel Bryars +* Tim Brown +* Anthony Minessale II +* William King +* Mike Jerris +* +* kazoo.c -- Sends FreeSWITCH events to an AMQP broker +* +*/ + +#ifndef KAZOO_MESSAGE_H +#define KAZOO_MESSAGE_H + +#include + +typedef struct { + uint64_t timestamp; + uint64_t start; + uint64_t filter; + uint64_t serialize; + uint64_t print; + uint64_t rk; +} kazoo_message_times_t, *kazoo_message_times_ptr; + +typedef struct { + cJSON *JObj; +} kazoo_message_t, *kazoo_message_ptr; + + +kazoo_message_ptr kazoo_message_create_event(switch_event_t* evt, kazoo_event_ptr event, kazoo_event_profile_ptr profile); +kazoo_message_ptr kazoo_message_create_fetch(switch_event_t* evt, kazoo_fetch_profile_ptr profile); + +void kazoo_message_destroy(kazoo_message_ptr *msg); + + +#endif /* KAZOO_MESSAGE_H */ + diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_node.c b/src/mod/event_handlers/mod_kazoo/kazoo_node.c index 17da6dc582..3ec739e74b 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_node.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_node.c @@ -53,6 +53,8 @@ static char *REQUEST_ATOMS[] = { "nixevent", "sendevent", "sendmsg", + "commands", + "command", "bind", "getpid", "version", @@ -62,7 +64,8 @@ static char *REQUEST_ATOMS[] = { "fetch_reply", "config", "bgapi4", - "api4" + "api4", + "no_legacy" }; typedef enum { @@ -72,6 +75,8 @@ typedef enum { REQUEST_NIXEVENT, REQUEST_SENDEVENT, REQUEST_SENDMSG, + REQUEST_COMMANDS, + REQUEST_COMMAND, REQUEST_BIND, REQUEST_GETPID, REQUEST_VERSION, @@ -82,11 +87,13 @@ typedef enum { REQUEST_CONFIG, REQUEST_BGAPI4, REQUEST_API4, + REQUEST_NO_LEGACY, REQUEST_MAX } request_atoms_t; static switch_status_t find_request(char *atom, int *request) { - for (int i = 0; i < REQUEST_MAX; i++) { + int i; + for (i = 0; i < REQUEST_MAX; i++) { if(!strncmp(atom, REQUEST_ATOMS[i], MAXATOMLEN)) { *request = i; return SWITCH_STATUS_SUCCESS; @@ -267,7 +274,7 @@ static switch_status_t api_exec_stream(char *cmd, char *arg, switch_stream_handl } } else if (!stream->data || !strlen(stream->data)) { *reply = switch_mprintf("%s: Command returned no output", cmd); - status = SWITCH_STATUS_FALSE; + status = SWITCH_STATUS_SUCCESS; } else { *reply = strdup(stream->data); status = SWITCH_STATUS_SUCCESS; @@ -412,11 +419,10 @@ static void log_sendmsg_request(char *uuid, switch_event_t *event) switch_ssize_t hlen = -1; unsigned long CMD_EXECUTE = switch_hashfunc_default("execute", &hlen); unsigned long CMD_XFEREXT = switch_hashfunc_default("xferext", &hlen); - // unsigned long CMD_HANGUP = switch_hashfunc_default("hangup", &hlen); - // unsigned long CMD_NOMEDIA = switch_hashfunc_default("nomedia", &hlen); - // unsigned long CMD_UNICAST = switch_hashfunc_default("unicast", &hlen); if (zstr(cmd)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "log|%s|invalid \n", uuid); + DUMP_EVENT(event); return; } @@ -453,6 +459,7 @@ static void log_sendmsg_request(char *uuid, switch_event_t *event) static switch_status_t build_event(switch_event_t *event, ei_x_buff * buf) { int propslist_length, arity; + int n=0; if(!event) { return SWITCH_STATUS_FALSE; @@ -462,7 +469,7 @@ static switch_status_t build_event(switch_event_t *event, ei_x_buff * buf) { return SWITCH_STATUS_FALSE; } - while (!ei_decode_tuple_header(buf->buff, &buf->index, &arity)) { + while (!ei_decode_tuple_header(buf->buff, &buf->index, &arity) && n < propslist_length) { char key[1024]; char *value; @@ -482,9 +489,21 @@ static switch_status_t build_event(switch_event_t *event, ei_x_buff * buf) { switch_safe_free(event->body); event->body = value; } else { + if(!strcasecmp(key, "Call-ID")) { + switch_core_session_t *session = NULL; + if(!zstr(value)) { + if ((session = switch_core_session_force_locate(value)) != NULL) { + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_channel_event_set_data(channel, event); + switch_core_session_rwunlock(session); + } + } + } switch_event_add_header_string(event, SWITCH_STACK_BOTTOM | SWITCH_STACK_NODUP, key, value); } + n++; } + ei_skip_term(buf->buff, &buf->index); return SWITCH_STATUS_SUCCESS; } @@ -525,6 +544,16 @@ static switch_status_t erlang_response_ok(ei_x_buff *rbuf) { return SWITCH_STATUS_SUCCESS; } +static switch_status_t erlang_response_ok_uuid(ei_x_buff *rbuf, const char * uuid) { + if (rbuf) { + ei_x_encode_tuple_header(rbuf, 2); + ei_x_encode_atom(rbuf, "ok"); + ei_x_encode_binary(rbuf, uuid, strlen(uuid)); + } + + return SWITCH_STATUS_SUCCESS; +} + static switch_status_t handle_request_noevents(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { ei_event_stream_t *event_stream; @@ -554,6 +583,7 @@ static switch_status_t handle_request_nixevent(ei_node_t *ei_node, erlang_pid *p switch_event_types_t event_type; ei_event_stream_t *event_stream; int custom = 0, length = 0; + int i; if (ei_decode_list_header(buf->buff, &buf->index, &length) || length == 0) { @@ -566,7 +596,7 @@ static switch_status_t handle_request_nixevent(ei_node_t *ei_node, erlang_pid *p return erlang_response_ok(rbuf); } - for (int i = 1; i <= length; i++) { + for (i = 1; i <= length; i++) { if (ei_decode_atom_safe(buf->buff, &buf->index, event_name)) { switch_mutex_unlock(ei_node->event_streams_mutex); return erlang_response_badarg(rbuf); @@ -576,16 +606,22 @@ static switch_status_t handle_request_nixevent(ei_node_t *ei_node, erlang_pid *p remove_event_binding(event_stream, SWITCH_EVENT_CUSTOM, event_name); } else if (switch_name_event(event_name, &event_type) == SWITCH_STATUS_SUCCESS) { switch (event_type) { + case SWITCH_EVENT_CUSTOM: custom++; break; + case SWITCH_EVENT_ALL: - for (switch_event_types_t type = 0; type < SWITCH_EVENT_ALL; type++) { + { + switch_event_types_t type; + for (type = 0; type < SWITCH_EVENT_ALL; type++) { if(type != SWITCH_EVENT_CUSTOM) { remove_event_binding(event_stream, type, NULL); } } break; + } + default: remove_event_binding(event_stream, event_type, NULL); } @@ -632,6 +668,82 @@ static switch_status_t handle_request_sendevent(ei_node_t *ei_node, erlang_pid * return erlang_response_badarg(rbuf); } +static switch_status_t handle_request_command(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { + switch_core_session_t *session; + switch_event_t *event = NULL; + char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; + switch_uuid_t cmd_uuid; + char cmd_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; + + if (ei_decode_string_or_binary_limited(buf->buff, &buf->index, sizeof(uuid_str), uuid_str)) { + return erlang_response_badarg(rbuf); + } + + switch_uuid_get(&cmd_uuid); + switch_uuid_format(cmd_uuid_str, &cmd_uuid); + + switch_event_create(&event, SWITCH_EVENT_COMMAND); + if (build_event(event, buf) != SWITCH_STATUS_SUCCESS) { + return erlang_response_badarg(rbuf); + } + + log_sendmsg_request(uuid_str, event); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-uuid", cmd_uuid_str); + + if (zstr_buf(uuid_str) || !(session = switch_core_session_locate(uuid_str))) { + return erlang_response_baduuid(rbuf); + } + switch_core_session_queue_private_event(session, &event, SWITCH_FALSE); + switch_core_session_rwunlock(session); + + return erlang_response_ok_uuid(rbuf, cmd_uuid_str); +} + +static switch_status_t handle_request_commands(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { + switch_core_session_t *session; + char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; + int propslist_length, n; + switch_uuid_t cmd_uuid; + char cmd_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; + + if (ei_decode_string_or_binary_limited(buf->buff, &buf->index, sizeof(uuid_str), uuid_str)) { + return erlang_response_badarg(rbuf); + } + + if (zstr_buf(uuid_str) || !(session = switch_core_session_locate(uuid_str))) { + return erlang_response_baduuid(rbuf); + } + + switch_uuid_get(&cmd_uuid); + switch_uuid_format(cmd_uuid_str, &cmd_uuid); + + if (ei_decode_list_header(buf->buff, &buf->index, &propslist_length)) { + switch_core_session_rwunlock(session); + return SWITCH_STATUS_FALSE; + } + + for(n = 0; n < propslist_length; n++) { + switch_event_t *event = NULL; + switch_event_create(&event, SWITCH_EVENT_COMMAND); + if (build_event(event, buf) != SWITCH_STATUS_SUCCESS) { + switch_core_session_rwunlock(session); + return erlang_response_badarg(rbuf); + } + log_sendmsg_request(uuid_str, event); + if(n == (propslist_length - 1)) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-uuid", cmd_uuid_str); + } else { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-uuid", "null"); + } + switch_core_session_queue_private_event(session, &event, SWITCH_FALSE); + } + + switch_core_session_rwunlock(session); + + return erlang_response_ok_uuid(rbuf, cmd_uuid_str); + +} + static switch_status_t handle_request_sendmsg(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { switch_core_session_t *session; switch_event_t *event = NULL; @@ -659,8 +771,8 @@ static switch_status_t handle_request_sendmsg(ei_node_t *ei_node, erlang_pid *pi static switch_status_t handle_request_config(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { - fetch_config_filters(); - return erlang_response_ok(rbuf); + fetch_config(); + return erlang_response_ok(rbuf); } static switch_status_t handle_request_bind(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { @@ -675,8 +787,8 @@ static switch_status_t handle_request_bind(ei_node_t *ei_node, erlang_pid *pid, switch(section) { case SWITCH_XML_SECTION_CONFIG: add_fetch_handler(ei_node, pid, kazoo_globals.config_fetch_binding); - if(!kazoo_globals.config_filters_fetched) - fetch_config_filters(); + if(!kazoo_globals.config_fetched) + fetch_config(); break; case SWITCH_XML_SECTION_DIRECTORY: add_fetch_handler(ei_node, pid, kazoo_globals.directory_fetch_binding); @@ -684,12 +796,15 @@ static switch_status_t handle_request_bind(ei_node_t *ei_node, erlang_pid *pid, case SWITCH_XML_SECTION_DIALPLAN: add_fetch_handler(ei_node, pid, kazoo_globals.dialplan_fetch_binding); break; - case SWITCH_XML_SECTION_CHATPLAN: - add_fetch_handler(ei_node, pid, kazoo_globals.chatplan_fetch_binding); - break; case SWITCH_XML_SECTION_CHANNELS: add_fetch_handler(ei_node, pid, kazoo_globals.channels_fetch_binding); break; + case SWITCH_XML_SECTION_LANGUAGES: + add_fetch_handler(ei_node, pid, kazoo_globals.languages_fetch_binding); + break; + case SWITCH_XML_SECTION_CHATPLAN: + add_fetch_handler(ei_node, pid, kazoo_globals.chatplan_fetch_binding); + break; default: return erlang_response_badarg(rbuf); } @@ -856,11 +971,19 @@ static switch_status_t handle_request_api(ei_node_t *ei_node, erlang_pid *pid, e return SWITCH_STATUS_SUCCESS; } +static switch_status_t handle_request_no_legacy(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) +{ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "nolegacy: %s\n", ei_node->peer_nodename); + ei_node->legacy = SWITCH_FALSE; + + return erlang_response_ok(rbuf); +} + static switch_status_t handle_request_event(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { char event_name[MAXATOMLEN + 1]; - switch_event_types_t event_type; ei_event_stream_t *event_stream; - int custom = 0, length = 0; + int length = 0; + int i; if (ei_decode_list_header(buf->buff, &buf->index, &length) || !length) { return erlang_response_badarg(rbuf); @@ -868,38 +991,18 @@ static switch_status_t handle_request_event(ei_node_t *ei_node, erlang_pid *pid, switch_mutex_lock(ei_node->event_streams_mutex); if (!(event_stream = find_event_stream(ei_node->event_streams, pid))) { - event_stream = new_event_stream(&ei_node->event_streams, pid); + event_stream = new_event_stream(ei_node, pid); /* ensure we are notified if the requesting processes dies so we can clean up */ ei_link(ei_node, ei_self(&kazoo_globals.ei_cnode), pid); } - for (int i = 1; i <= length; i++) { + for (i = 1; i <= length; i++) { + if (ei_decode_atom_safe(buf->buff, &buf->index, event_name)) { switch_mutex_unlock(ei_node->event_streams_mutex); return erlang_response_badarg(rbuf); } - - if (custom) { - add_event_binding(event_stream, SWITCH_EVENT_CUSTOM, event_name); - } else if (switch_name_event(event_name, &event_type) == SWITCH_STATUS_SUCCESS) { - switch (event_type) { - case SWITCH_EVENT_CUSTOM: - custom++; - break; - case SWITCH_EVENT_ALL: - for (switch_event_types_t type = 0; type < SWITCH_EVENT_ALL; type++) { - if(type != SWITCH_EVENT_CUSTOM) { - add_event_binding(event_stream, type, NULL); - } - } - break; - default: - add_event_binding(event_stream, event_type, NULL); - } - } else { - switch_mutex_unlock(ei_node->event_streams_mutex); - return erlang_response_badarg(rbuf); - } + add_event_binding(event_stream, event_name); } switch_mutex_unlock(ei_node->event_streams_mutex); @@ -955,21 +1058,24 @@ static switch_status_t handle_request_fetch_reply(ei_node_t *ei_node, erlang_pid case SWITCH_XML_SECTION_DIALPLAN: result = fetch_reply(uuid_str, xml_str, kazoo_globals.dialplan_fetch_binding); break; - case SWITCH_XML_SECTION_CHATPLAN: - result = fetch_reply(uuid_str, xml_str, kazoo_globals.chatplan_fetch_binding); - break; case SWITCH_XML_SECTION_CHANNELS: result = fetch_reply(uuid_str, xml_str, kazoo_globals.channels_fetch_binding); break; + case SWITCH_XML_SECTION_LANGUAGES: + result = fetch_reply(uuid_str, xml_str, kazoo_globals.languages_fetch_binding); + break; + case SWITCH_XML_SECTION_CHATPLAN: + result = fetch_reply(uuid_str, xml_str, kazoo_globals.chatplan_fetch_binding); + break; default: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Recieved fetch reply for an unknown configuration section: %s\n", section_str); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received fetch reply for an unknown configuration section: %s\n", section_str); return erlang_response_badarg(rbuf); } if (result == SWITCH_STATUS_SUCCESS) { return erlang_response_ok(rbuf); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Recieved fetch reply for an unknown/expired UUID: %s\n", uuid_str); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received fetch reply for an unknown/expired UUID: %s\n", uuid_str); return erlang_response_baduuid(rbuf); } } @@ -1010,6 +1116,10 @@ static switch_status_t handle_kazoo_request(ei_node_t *ei_node, erlang_pid *pid, return handle_request_sendevent(ei_node, pid, buf, rbuf); case REQUEST_SENDMSG: return handle_request_sendmsg(ei_node, pid, buf, rbuf); + case REQUEST_COMMAND: + return handle_request_command(ei_node, pid, buf, rbuf); + case REQUEST_COMMANDS: + return handle_request_commands(ei_node, pid, buf, rbuf); case REQUEST_BIND: return handle_request_bind(ei_node, pid, buf, rbuf); case REQUEST_GETPID: @@ -1024,12 +1134,14 @@ static switch_status_t handle_kazoo_request(ei_node_t *ei_node, erlang_pid *pid, return handle_request_event(ei_node, pid, buf, rbuf); case REQUEST_FETCH_REPLY: return handle_request_fetch_reply(ei_node, pid, buf, rbuf); - case REQUEST_CONFIG: - return handle_request_config(ei_node, pid, buf, rbuf); - case REQUEST_BGAPI4: - return handle_request_bgapi4(ei_node, pid, buf, rbuf); + case REQUEST_CONFIG: + return handle_request_config(ei_node, pid, buf, rbuf); + case REQUEST_BGAPI4: + return handle_request_bgapi4(ei_node, pid, buf, rbuf); case REQUEST_API4: return handle_request_api4(ei_node, pid, buf, rbuf); + case REQUEST_NO_LEGACY: + return handle_request_no_legacy(ei_node, pid, buf, rbuf); default: return erlang_response_notimplemented(rbuf); } @@ -1214,7 +1326,7 @@ static switch_status_t handle_erl_send(ei_node_t *ei_node, erlang_msg *msg, ei_x } else if (!strncmp(msg->toname, "mod_kazoo", MAXATOMLEN)) { return handle_mod_kazoo_request(ei_node, msg, buf); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Recieved erlang message to unknown process \"%s\" (ensure you are using Kazoo v2.14+).\n", msg->toname); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received erlang message to unknown process \"%s\" (ensure you are using Kazoo v2.14+).\n", msg->toname); return SWITCH_STATUS_GENERR; } } @@ -1262,7 +1374,7 @@ static void *SWITCH_THREAD_FUNC receive_handler(switch_thread_t *thread, void *o while (switch_test_flag(ei_node, LFLAG_RUNNING) && switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { void *pop; - if (switch_queue_pop_timeout(ei_node->received_msgs, &pop, 500000) == SWITCH_STATUS_SUCCESS) { + if (switch_queue_pop_timeout(ei_node->received_msgs, &pop, 100000) == SWITCH_STATUS_SUCCESS) { ei_received_msg_t *received_msg = (ei_received_msg_t *) pop; handle_erl_msg(ei_node, &received_msg->msg, &received_msg->buf); ei_x_free(&received_msg->buf); @@ -1313,7 +1425,7 @@ static void *SWITCH_THREAD_FUNC handle_node(switch_thread_t *thread, void *obj) } while (++send_msg_count <= kazoo_globals.send_msg_batch - && switch_queue_trypop(ei_node->send_msgs, &pop) == SWITCH_STATUS_SUCCESS) { + && switch_queue_pop_timeout(ei_node->send_msgs, &pop, 20000) == SWITCH_STATUS_SUCCESS) { ei_send_msg_t *send_msg = (ei_send_msg_t *) pop; ei_helper_send(ei_node, &send_msg->pid, &send_msg->buf); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sent erlang message to %s <%d.%d.%d>\n" @@ -1431,6 +1543,7 @@ switch_status_t new_kazoo_node(int nodefd, ErlConnect *conn) { ei_node->nodefd = nodefd; ei_node->peer_nodename = switch_core_strdup(ei_node->pool, conn->nodename); ei_node->created_time = switch_micro_time_now(); + ei_node->legacy = kazoo_globals.enable_legacy; /* store the IP and node name we are talking with */ switch_os_sock_put(&ei_node->socket, (switch_os_socket_t *)&nodefd, pool); diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c b/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c new file mode 100644 index 0000000000..2aefb5ab98 --- /dev/null +++ b/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c @@ -0,0 +1,502 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2005-2012, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Luis Azedo + * + * mod_hacks.c -- hacks with state handlers + * + */ +#include "mod_kazoo.h" + +static const char *bridge_variables[] = { + "Call-Control-Queue", + "Call-Control-PID", + "ecallmgr_Call-Interaction-ID", + "ecallmgr_Ecallmgr-Node", + NULL +}; + +static switch_status_t kz_tweaks_signal_bridge_on_hangup(switch_core_session_t *session) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_event_t *my_event; + + const char *peer_uuid = switch_channel_get_variable(channel, "Bridge-B-Unique-ID"); + + if (switch_event_create(&my_event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); + switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", peer_uuid); + switch_channel_event_set_data(channel, my_event); + switch_event_fire(&my_event); + } + + return SWITCH_STATUS_SUCCESS; +} + +static const switch_state_handler_table_t kz_tweaks_signal_bridge_state_handlers = { + /*.on_init */ NULL, + /*.on_routing */ NULL, + /*.on_execute */ NULL, + /*.on_hangup */ kz_tweaks_signal_bridge_on_hangup, + /*.on_exchange_media */ NULL, + /*.on_soft_execute */ NULL, + /*.on_consume_media */ NULL, + /*.on_hibernate */ NULL +}; + +static void kz_tweaks_handle_bridge_variables(switch_event_t *event) +{ + switch_core_session_t *a_session = NULL, *b_session = NULL; + const char *a_leg = switch_event_get_header(event, "Bridge-A-Unique-ID"); + const char *b_leg = switch_event_get_header(event, "Bridge-B-Unique-ID"); + int i; + + if (a_leg && (a_session = switch_core_session_force_locate(a_leg)) != NULL) { + switch_channel_t *a_channel = switch_core_session_get_channel(a_session); + if(switch_channel_get_variable_dup(a_channel, bridge_variables[0], SWITCH_FALSE, -1) == NULL) { + if(b_leg && (b_session = switch_core_session_force_locate(b_leg)) != NULL) { + switch_channel_t *b_channel = switch_core_session_get_channel(b_session); + for(i = 0; bridge_variables[i] != NULL; i++) { + const char *val = switch_channel_get_variable_dup(b_channel, bridge_variables[i], SWITCH_TRUE, -1); + switch_channel_set_variable(a_channel, bridge_variables[i], val); + switch_safe_strdup(val); + } + switch_core_session_rwunlock(b_session); + } + } else { + if(b_leg && (b_session = switch_core_session_force_locate(b_leg)) != NULL) { + switch_channel_t *b_channel = switch_core_session_get_channel(b_session); + if(switch_channel_get_variable_dup(b_channel, bridge_variables[0], SWITCH_FALSE, -1) == NULL) { + for(i = 0; bridge_variables[i] != NULL; i++) { + const char *val = switch_channel_get_variable_dup(b_channel, bridge_variables[i], SWITCH_TRUE, -1); + switch_channel_set_variable(b_channel, bridge_variables[i], val); + switch_safe_strdup(val); + } + } + switch_core_session_rwunlock(b_session); + } + } + switch_core_session_rwunlock(a_session); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NOT FOUND : %s\n", a_leg); + } + +} + +static void kz_tweaks_handle_bridge_replaces(switch_event_t *event) +{ + switch_event_t *my_event; + + const char *replaced_call_id = switch_event_get_header(event, "variable_sip_replaces_call_id"); + const char *a_leg_call_id = switch_event_get_header(event, "variable_sip_replaces_a-leg"); + const char *peer_uuid = switch_event_get_header(event, "Unique-ID"); + int processed = 0; + + if(a_leg_call_id && replaced_call_id) { + const char *call_id = switch_event_get_header(event, "Bridge-B-Unique-ID"); + switch_core_session_t *session = NULL; + if ((session = switch_core_session_force_locate(peer_uuid)) != NULL) { + switch_channel_t *channel = switch_core_session_get_channel(session); + processed = switch_true(switch_channel_get_variable_dup(channel, "Bridge-Event-Processed", SWITCH_FALSE, -1)); + switch_channel_set_variable(channel, "Bridge-Event-Processed", "true"); + switch_core_session_rwunlock(session); + } + + if ((processed) && call_id && (session = switch_core_session_force_locate(call_id)) != NULL) { + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_channel_set_variable(channel, "Bridge-Event-Processed", "true"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "creating channel_bridge event A - %s , B - %s\n", switch_core_session_get_uuid(session), peer_uuid); + if (switch_event_create(&my_event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); + switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", peer_uuid); + switch_channel_event_set_data(channel, my_event); + switch_event_fire(&my_event); + } + switch_channel_set_variable(channel, "Bridge-B-Unique-ID", peer_uuid); + switch_channel_add_state_handler(channel, &kz_tweaks_signal_bridge_state_handlers); + switch_core_session_rwunlock(session); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NOT FOUND : %s\n", call_id); + } + + } + +} + +static void kz_tweaks_channel_bridge_event_handler(switch_event_t *event) +{ + kz_tweaks_handle_bridge_replaces(event); + kz_tweaks_handle_bridge_variables(event); +} + +// TRANSFERS + +static void kz_tweaks_channel_replaced_event_handler(switch_event_t *event) +{ + const char *uuid = switch_event_get_header(event, "Unique-ID"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "REPLACED : %s\n", uuid); +} + +static void kz_tweaks_channel_intercepted_event_handler(switch_event_t *event) +{ + const char *uuid = switch_event_get_header(event, "Unique-ID"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "INTERCEPTED : %s\n", uuid); +} + +static void kz_tweaks_channel_transferor_event_handler(switch_event_t *event) +{ + switch_core_session_t *uuid_session = NULL; + const char *uuid = switch_event_get_header(event, "Unique-ID"); + const char *call_id = switch_event_get_header(event, "att_xfer_destination_peer_uuid"); + const char *peer_uuid = switch_event_get_header(event, "att_xfer_destination_call_id"); + + const char *file = switch_event_get_header(event, "Event-Calling-File"); + const char *func = switch_event_get_header(event, "Event-Calling-Function"); + const char *line = switch_event_get_header(event, "Event-Calling-Line-Number"); + + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TRANSFEROR : %s , %s , %s, %s , %s , %s \n", uuid, call_id, peer_uuid, file, func, line); + if ((uuid_session = switch_core_session_force_locate(uuid)) != NULL) { + switch_channel_t *uuid_channel = switch_core_session_get_channel(uuid_session); + const char* interaction_id = switch_channel_get_variable_dup(uuid_channel, "ecallmgr_Call-Interaction-ID", SWITCH_TRUE, -1); + // set to uuid & peer_uuid + if(interaction_id != NULL) { + switch_core_session_t *session = NULL; + if(call_id && (session = switch_core_session_force_locate(call_id)) != NULL) { + switch_channel_t *channel = switch_core_session_get_channel(session); + const char* prv_interaction_id = switch_channel_get_variable_dup(channel, "ecallmgr_Call-Interaction-ID", SWITCH_TRUE, -1); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "LOCATING UUID PRV : %s : %s\n", prv_interaction_id, interaction_id); + switch_channel_set_variable(channel, "ecallmgr_Call-Interaction-ID", interaction_id); + switch_core_session_rwunlock(session); + switch_safe_strdup(prv_interaction_id); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TRANSFEROR NO UUID SESSION: %s , %s , %s \n", uuid, call_id, peer_uuid); + } + if(peer_uuid && (session = switch_core_session_force_locate(peer_uuid)) != NULL) { + switch_channel_t *channel = switch_core_session_get_channel(session); + const char* prv_interaction_id = switch_channel_get_variable_dup(channel, "ecallmgr_Call-Interaction-ID", SWITCH_TRUE, -1); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "LOCATING PEER UUID PRV : %s : %s\n", prv_interaction_id, interaction_id); + switch_channel_set_variable(channel, "ecallmgr_Call-Interaction-ID", interaction_id); + switch_core_session_rwunlock(session); + switch_safe_strdup(prv_interaction_id); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TRANSFEROR NO PEER SESSION: %s , %s , %s \n", uuid, call_id, peer_uuid); + } + switch_safe_strdup(interaction_id); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TRANSFEROR ID = NULL : %s , %s , %s \n", uuid, call_id, peer_uuid); + } + switch_core_session_rwunlock(uuid_session); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SESSION NOT FOUND : %s\n", call_id); + } +} + +static void kz_tweaks_channel_transferee_event_handler(switch_event_t *event) +{ + const char *uuid = switch_event_get_header(event, "Unique-ID"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TRANSFEREE : %s\n", uuid); +} + +// END TRANSFERS + + +static switch_status_t kz_tweaks_handle_loopback(switch_core_session_t *session) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + const char * loopback_leg = NULL; + const char * loopback_aleg = NULL; + switch_event_t *event = NULL; + switch_event_header_t *header = NULL; + switch_event_t *to_add = NULL; + switch_event_t *to_remove = NULL; + switch_caller_profile_t *caller; + int n = 0; + + caller = switch_channel_get_caller_profile(channel); + if(strncmp(caller->source, "mod_loopback", 12)) + return SWITCH_STATUS_SUCCESS; + + if((loopback_leg = switch_channel_get_variable(channel, "loopback_leg")) == NULL) + return SWITCH_STATUS_SUCCESS; + + if(strncmp(loopback_leg, "B", 1)) + return SWITCH_STATUS_SUCCESS; + + switch_channel_get_variables(channel, &event); + switch_event_create_plain(&to_add, SWITCH_EVENT_CHANNEL_DATA); + switch_event_create_plain(&to_remove, SWITCH_EVENT_CHANNEL_DATA); + + for(header = event->headers; header; header = header->next) { + if(!strncmp(header->name, "Export-Loopback-", 16)) { + switch_event_add_variable_name_printf(to_add, SWITCH_STACK_BOTTOM, header->value, "%s", header->name+16); + switch_channel_set_variable(channel, header->name, NULL); + n++; + } else if(!strncmp(header->name, "ecallmgr_", 9)) { + switch_event_add_header_string(to_remove, SWITCH_STACK_BOTTOM, header->name, header->value); + } + } + if(n) { + for(header = to_remove->headers; header; header = header->next) { + switch_channel_set_variable(channel, header->name, NULL); + } + for(header = to_add->headers; header; header = header->next) { + switch_channel_set_variable(channel, header->name, header->value); + } + + // cleanup leg A + loopback_aleg = switch_channel_get_variable(channel, "other_loopback_leg_uuid"); + if(loopback_aleg != NULL) { + switch_core_session_t *a_session = NULL; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "found loopback a-leg uuid - %s\n", loopback_aleg); + if ((a_session = switch_core_session_locate(loopback_aleg))) { + switch_channel_t *a_channel = switch_core_session_get_channel(a_session); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "found loopback session a - %s\n", loopback_aleg); + switch_channel_del_variable_prefix(a_channel, "Export-Loopback-"); + switch_core_session_rwunlock(a_session); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Couldn't locate loopback session a - %s\n", loopback_aleg); + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Couldn't find loopback a-leg uuid!\n"); + } + } + + switch_event_destroy(&event); + switch_event_destroy(&to_add); + switch_event_destroy(&to_remove); + + return SWITCH_STATUS_SUCCESS; + +} + +static void kz_tweaks_handle_caller_id(switch_core_session_t *session) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + const char *acl_token = switch_channel_get_variable(channel, "acl_token"); + if(acl_token) { + switch_ivr_set_user(session, acl_token); + } +} + +static switch_status_t kz_tweaks_handle_auth_token(switch_core_session_t *session) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_event_t *event; + const char *token = switch_channel_get_variable(channel, "sip_h_X-FS-Auth-Token"); + if(token) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Authenticating user for nightmare xfer %s\n", token); + if (switch_ivr_set_user(session, token) == SWITCH_STATUS_SUCCESS) { + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_data(channel, event); + switch_event_fire(&event); + } + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Authenticated user from nightmare xfer %s\n", token); + } else { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Error Authenticating user for nightmare xfer %s\n", token); + } + } + + return SWITCH_STATUS_SUCCESS; + +} + +static switch_status_t kz_tweaks_handle_nightmare_xfer(switch_core_session_t *session) +{ + switch_core_session_t *replace_session = NULL; + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_event_t *event; + const char *replaced_call_id = switch_channel_get_variable(channel, "sip_replaces_call_id"); + const char *core_uuid = switch_channel_get_variable(channel, "sip_h_X-FS-From-Core-UUID"); + const char *partner_uuid = switch_channel_get_variable(channel, "sip_h_X-FS-Refer-Partner-UUID"); + const char *interaction_id = switch_channel_get_variable(channel, "sip_h_X-FS-Call-Interaction-ID"); + if(core_uuid && partner_uuid && replaced_call_id && interaction_id) { + switch_channel_set_variable(channel, "ecallmgr_Call-Interaction-ID", interaction_id); + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_data(channel, event); + switch_event_fire(&event); + } + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "checking nightmare xfer tweak for %s\n", switch_channel_get_uuid(channel)); + if ((replace_session = switch_core_session_locate(replaced_call_id))) { + switch_channel_t *replaced_call_channel = switch_core_session_get_channel(replace_session); + switch_channel_set_variable(replaced_call_channel, "ecallmgr_Call-Interaction-ID", interaction_id); + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_data(replaced_call_channel, event); + switch_event_fire(&event); + } + switch_core_session_rwunlock(replace_session); + } + if ((replace_session = switch_core_session_locate(partner_uuid))) { + switch_channel_t *replaced_call_channel = switch_core_session_get_channel(replace_session); + switch_channel_set_variable(replaced_call_channel, "ecallmgr_Call-Interaction-ID", interaction_id); + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_data(replaced_call_channel, event); + switch_event_fire(&event); + } + switch_core_session_rwunlock(replace_session); + } + } + + return SWITCH_STATUS_SUCCESS; + +} + +static switch_status_t kz_tweaks_handle_replaces_id(switch_core_session_t *session) +{ + switch_core_session_t *replace_call_session = NULL; + switch_event_t *event; + switch_channel_t *channel = switch_core_session_get_channel(session); + const char *replaced_call_id = switch_channel_get_variable(channel, "sip_replaces_call_id"); + const char *core_uuid = switch_channel_get_variable(channel, "sip_h_X-FS-From-Core-UUID"); + if((!core_uuid) && replaced_call_id) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "checking replaces header tweak for %s\n", replaced_call_id); + if ((replace_call_session = switch_core_session_locate(replaced_call_id))) { + switch_channel_t *replaced_call_channel = switch_core_session_get_channel(replace_call_session); + int i; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "setting bridge variables from %s to %s\n", replaced_call_id, switch_channel_get_uuid(channel)); + for(i = 0; bridge_variables[i] != NULL; i++) { + const char *val = switch_channel_get_variable_dup(replaced_call_channel, bridge_variables[i], SWITCH_TRUE, -1); + switch_channel_set_variable(channel, bridge_variables[i], val); + switch_safe_strdup(val); + } + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { + switch_channel_event_set_data(channel, event); + switch_event_fire(&event); + } + switch_core_session_rwunlock(replace_call_session); + } + } + + return SWITCH_STATUS_SUCCESS; + +} + + +static switch_status_t kz_tweaks_handle_switch_uri(switch_core_session_t *session) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + const char *profile_url = switch_channel_get_variable(channel, "sofia_profile_url"); + if(profile_url) { + int n = strcspn(profile_url, "@"); + switch_channel_set_variable(channel, "Switch-URL", profile_url); + switch_channel_set_variable_printf(channel, "Switch-URI", "sip:%s", n > 0 ? profile_url + n + 1 : profile_url); + } + + return SWITCH_STATUS_SUCCESS; + +} + + +static switch_status_t kz_tweaks_on_init(switch_core_session_t *session) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "checking tweaks for %s\n", switch_channel_get_uuid(channel)); + kz_tweaks_handle_switch_uri(session); + kz_tweaks_handle_caller_id(session); + kz_tweaks_handle_auth_token(session); + kz_tweaks_handle_nightmare_xfer(session); + kz_tweaks_handle_replaces_id(session); + kz_tweaks_handle_loopback(session); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_state_handler_table_t kz_tweaks_state_handlers = { + /*.on_init */ kz_tweaks_on_init, + /*.on_routing */ NULL, + /*.on_execute */ NULL, + /*.on_hangup */ NULL, + /*.on_exchange_media */ NULL, + /*.on_soft_execute */ NULL, + /*.on_consume_media */ NULL, + /*.on_hibernate */ NULL, + /*.on_reset */ NULL, + /*.on_park */ NULL, + /*.on_reporting */ NULL +}; + + +static void kz_tweaks_register_state_handlers() +{ + switch_core_add_state_handler(&kz_tweaks_state_handlers); +} + +static void kz_tweaks_unregister_state_handlers() +{ + switch_core_remove_state_handler(&kz_tweaks_state_handlers); +} + +static void kz_tweaks_bind_events() +{ + if (switch_event_bind("kz_tweaks", SWITCH_EVENT_CHANNEL_BRIDGE, SWITCH_EVENT_SUBCLASS_ANY, kz_tweaks_channel_bridge_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind to channel_bridge event!\n"); + } + if (switch_event_bind("kz_tweaks", SWITCH_EVENT_CUSTOM, "sofia::replaced", kz_tweaks_channel_replaced_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind to channel_bridge event!\n"); + } + if (switch_event_bind("kz_tweaks", SWITCH_EVENT_CUSTOM, "sofia::intercepted", kz_tweaks_channel_intercepted_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind to channel_bridge event!\n"); + } + if (switch_event_bind("kz_tweaks", SWITCH_EVENT_CUSTOM, "sofia::transferor", kz_tweaks_channel_transferor_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind to channel_bridge event!\n"); + } + if (switch_event_bind("kz_tweaks", SWITCH_EVENT_CUSTOM, "sofia::transferee", kz_tweaks_channel_transferee_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind to channel_bridge event!\n"); + } +} + +static void kz_tweaks_unbind_events() +{ + switch_event_unbind_callback(kz_tweaks_channel_bridge_event_handler); + switch_event_unbind_callback(kz_tweaks_channel_replaced_event_handler); + switch_event_unbind_callback(kz_tweaks_channel_intercepted_event_handler); + switch_event_unbind_callback(kz_tweaks_channel_transferor_event_handler); + switch_event_unbind_callback(kz_tweaks_channel_transferee_event_handler); +} + +void kz_tweaks_start() +{ + kz_tweaks_register_state_handlers(); + kz_tweaks_bind_events(); +} + +void kz_tweaks_stop() +{ + kz_tweaks_unbind_events(); + kz_tweaks_unregister_state_handlers(); +} + +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4: + */ + + diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_utils.c b/src/mod/event_handlers/mod_kazoo/kazoo_utils.c index 024e98b858..c793b3d566 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_utils.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_utils.c @@ -34,664 +34,99 @@ */ #include "mod_kazoo.h" -/* Stolen from code added to ei in R12B-5. - * Since not everyone has this version yet; - * provide our own version. - * */ +char *kazoo_expand_header(switch_memory_pool_t *pool, switch_event_t *event, char *val) +{ + char *expanded; + char *dup = NULL; -#define put8(s,n) do { \ - (s)[0] = (char)((n) & 0xff); \ - (s) += 1; \ - } while (0) + expanded = switch_event_expand_headers(event, val); + dup = switch_core_strdup(pool, expanded); -#define put32be(s,n) do { \ - (s)[0] = ((n) >> 24) & 0xff; \ - (s)[1] = ((n) >> 16) & 0xff; \ - (s)[2] = ((n) >> 8) & 0xff; \ - (s)[3] = (n) & 0xff; \ - (s) += 4; \ - } while (0) + if (expanded != val) { + free(expanded); + } -#ifdef EI_DEBUG -static void ei_x_print_reg_msg(ei_x_buff *buf, char *dest, int send) { - char *mbuf = NULL; - int i = 1; - - ei_s_print_term(&mbuf, buf->buff, &i); - - if (send) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Encoded term %s to '%s'\n", mbuf, dest); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Decoded term %s for '%s'\n", mbuf, dest); - } - - free(mbuf); + return dup; } -static void ei_x_print_msg(ei_x_buff *buf, erlang_pid *pid, int send) { - char *pbuf = NULL; - int i = 0; - ei_x_buff pidbuf; - - ei_x_new(&pidbuf); - ei_x_encode_pid(&pidbuf, pid); - - ei_s_print_term(&pbuf, pidbuf.buff, &i); - - ei_x_print_reg_msg(buf, pbuf, send); - free(pbuf); -} -#endif - -void ei_encode_switch_event_headers(ei_x_buff *ebuf, switch_event_t *event) { - ei_encode_switch_event_headers_2(ebuf, event, 1); -} - -void ei_encode_switch_event_headers_2(ei_x_buff *ebuf, switch_event_t *event, int encode) { - switch_event_header_t *hp; - char *uuid = switch_event_get_header(event, "unique-id"); - int i; - - for (i = 0, hp = event->headers; hp; hp = hp->next, i++); - - if (event->body) - i++; - - ei_x_encode_list_header(ebuf, i + 1); - - if (uuid) { - char *unique_id = switch_event_get_header(event, "unique-id"); - ei_x_encode_binary(ebuf, unique_id, strlen(unique_id)); - } else { - ei_x_encode_atom(ebuf, "undefined"); - } - - for (hp = event->headers; hp; hp = hp->next) { - ei_x_encode_tuple_header(ebuf, 2); - ei_x_encode_binary(ebuf, hp->name, strlen(hp->name)); - if(encode) - switch_url_decode(hp->value); - ei_x_encode_binary(ebuf, hp->value, strlen(hp->value)); - } - - if (event->body) { - ei_x_encode_tuple_header(ebuf, 2); - ei_x_encode_binary(ebuf, "body", strlen("body")); - ei_x_encode_binary(ebuf, event->body, strlen(event->body)); - } - - ei_x_encode_empty_list(ebuf); -} - -void close_socket(switch_socket_t ** sock) { - if (*sock) { - switch_socket_shutdown(*sock, SWITCH_SHUTDOWN_READWRITE); - switch_socket_close(*sock); - *sock = NULL; +char* switch_event_get_first_of(switch_event_t *event, const char *list[]) +{ + switch_event_header_t *header = NULL; + int i = 0; + while(list[i] != NULL) { + if((header = switch_event_get_header_ptr(event, list[i])) != NULL) + break; + i++; + } + if(header != NULL) { + return header->value; + } else { + return "nodomain"; } } -void close_socketfd(int *sockfd) { - if (*sockfd) { - shutdown(*sockfd, SHUT_RDWR); - close(*sockfd); +SWITCH_DECLARE(switch_status_t) switch_event_add_variable_name_printf(switch_event_t *event, switch_stack_t stack, const char *val, const char *fmt, ...) +{ + int ret = 0; + char *varname; + va_list ap; + switch_status_t status = SWITCH_STATUS_SUCCESS; + + switch_assert(event != NULL); + + + va_start(ap, fmt); + ret = switch_vasprintf(&varname, fmt, ap); + va_end(ap); + + if (ret == -1) { + return SWITCH_STATUS_MEMERR; } + + status = switch_event_add_header_string(event, stack, varname, val); + + free(varname); + + return status; } -switch_socket_t *create_socket_with_port(switch_memory_pool_t *pool, switch_port_t port) { - switch_sockaddr_t *sa; - switch_socket_t *socket; - - if(switch_sockaddr_info_get(&sa, kazoo_globals.ip, SWITCH_UNSPEC, port, 0, pool)) { - return NULL; - } - - if (switch_socket_create(&socket, switch_sockaddr_get_family(sa), SOCK_STREAM, SWITCH_PROTO_TCP, pool)) { - return NULL; - } - - if (switch_socket_opt_set(socket, SWITCH_SO_REUSEADDR, 1)) { - return NULL; - } - - if (switch_socket_bind(socket, sa)) { - return NULL; - } - - if (switch_socket_listen(socket, 5)){ - return NULL; - } - - switch_getnameinfo(&kazoo_globals.hostname, sa, 0); - - // if (kazoo_globals.nat_map && switch_nat_get_type()) { - // switch_nat_add_mapping(port, SWITCH_NAT_TCP, NULL, SWITCH_FALSE); - // } - - return socket; +SWITCH_DECLARE(switch_xml_t) kz_xml_child(switch_xml_t xml, const char *name) +{ + xml = (xml) ? xml->child : NULL; + while (xml && strcasecmp(name, xml->name)) + xml = xml->sibling; + return xml; } -switch_socket_t *create_socket(switch_memory_pool_t *pool) { - return create_socket_with_port(pool, 0); +void kz_xml_process(switch_xml_t cfg) +{ + switch_xml_t xml_process; + for (xml_process = kz_xml_child(cfg, "X-PRE-PROCESS"); xml_process; xml_process = xml_process->next) { + const char *cmd = switch_xml_attr(xml_process, "cmd"); + const char *data = switch_xml_attr(xml_process, "data"); + if(cmd != NULL && !strcasecmp(cmd, "set") && data) { + char *name = (char *) data; + char *val = strchr(name, '='); -} + if (val) { + char *ve = val++; + while (*val && *val == ' ') { + val++; + } + *ve-- = '\0'; + while (*ve && *ve == ' ') { + *ve-- = '\0'; + } + } -switch_status_t create_ei_cnode(const char *ip_addr, const char *name, struct ei_cnode_s *ei_cnode) { - char hostname[EI_MAXHOSTNAMELEN + 1] = ""; - char nodename[MAXNODELEN + 1]; - char cnodename[EI_MAXALIVELEN + 1]; - //EI_MAX_COOKIE_SIZE+1 - char *atsign; - - /* copy the erlang interface nodename into something we can modify */ - strncpy(cnodename, name, EI_MAXALIVELEN); - - if ((atsign = strchr(cnodename, '@'))) { - /* we got a qualified node name, don't guess the host/domain */ - snprintf(nodename, MAXNODELEN + 1, "%s", kazoo_globals.ei_nodename); - /* truncate the alivename at the @ */ - *atsign = '\0'; - } else { - if (zstr(kazoo_globals.hostname) || !strncasecmp(kazoo_globals.ip, "0.0.0.0", 7) || !strncasecmp(kazoo_globals.ip, "::", 2)) { - memcpy(hostname, switch_core_get_hostname(), EI_MAXHOSTNAMELEN); - } else { - memcpy(hostname, kazoo_globals.hostname, EI_MAXHOSTNAMELEN); - } - - snprintf(nodename, MAXNODELEN + 1, "%s@%s", kazoo_globals.ei_nodename, hostname); - } - - if (kazoo_globals.ei_shortname) { - char *off; - if ((off = strchr(nodename, '.'))) { - *off = '\0'; + if (name && val) { + switch_core_set_variable(name, val); + } } } - /* init the ec stuff */ - if (ei_connect_xinit(ei_cnode, hostname, cnodename, nodename, (Erl_IpAddr) ip_addr, kazoo_globals.ei_cookie, 0) < 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to initialize the erlang interface connection structure\n"); - return SWITCH_STATUS_FALSE; - } - - return SWITCH_STATUS_SUCCESS; } -switch_status_t ei_compare_pids(const erlang_pid *pid1, const erlang_pid *pid2) { - if ((!strcmp(pid1->node, pid2->node)) - && pid1->creation == pid2->creation - && pid1->num == pid2->num - && pid1->serial == pid2->serial) { - return SWITCH_STATUS_SUCCESS; - } else { - return SWITCH_STATUS_FALSE; - } -} - -void ei_link(ei_node_t *ei_node, erlang_pid * from, erlang_pid * to) { - char msgbuf[2048]; - char *s; - int index = 0; - - index = 5; /* max sizes: */ - ei_encode_version(msgbuf, &index); /* 1 */ - ei_encode_tuple_header(msgbuf, &index, 3); - ei_encode_long(msgbuf, &index, ERL_LINK); - ei_encode_pid(msgbuf, &index, from); /* 268 */ - ei_encode_pid(msgbuf, &index, to); /* 268 */ - - /* 5 byte header missing */ - s = msgbuf; - put32be(s, index - 4); /* 4 */ - put8(s, ERL_PASS_THROUGH); /* 1 */ - /* sum: 542 */ - - if (write(ei_node->nodefd, msgbuf, index) == -1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to link to process on %s\n", ei_node->peer_nodename); - } -} - -void ei_encode_switch_event(ei_x_buff *ebuf, switch_event_t *event) { - ei_x_encode_tuple_header(ebuf, 2); - ei_x_encode_atom(ebuf, "event"); - ei_encode_switch_event_headers(ebuf, event); -} - -int ei_helper_send(ei_node_t *ei_node, erlang_pid *to, ei_x_buff *buf) { - int ret = 0; - - if (ei_node->nodefd) { -#ifdef EI_DEBUG - ei_x_print_msg(buf, to, 1); -#endif - ret = ei_send(ei_node->nodefd, to, buf->buff, buf->index); - } - - return ret; -} - -int ei_decode_atom_safe(char *buf, int *index, char *dst) { - int type, size; - - ei_get_type(buf, index, &type, &size); - - if (type != ERL_ATOM_EXT) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed atom\n", type, size); - return -1; - } else if (size > MAXATOMLEN) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Requested decoding of atom with size %d into a buffer of size %d\n", size, MAXATOMLEN); - return -1; - } else { - return ei_decode_atom(buf, index, dst); - } -} - -int ei_decode_string_or_binary(char *buf, int *index, char **dst) { - int type, size, res; - long len; - - ei_get_type(buf, index, &type, &size); - - if (type != ERL_STRING_EXT && type != ERL_BINARY_EXT && type != ERL_NIL_EXT) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed binary or string\n", type, size); - return -1; - } - - *dst = malloc(size + 1); - - if (type == ERL_NIL_EXT) { - res = 0; - **dst = '\0'; - } else if (type == ERL_BINARY_EXT) { - res = ei_decode_binary(buf, index, *dst, &len); - (*dst)[len] = '\0'; - } else { - res = ei_decode_string(buf, index, *dst); - } - - return res; -} - -int ei_decode_string_or_binary_limited(char *buf, int *index, int maxsize, char *dst) { - int type, size, res; - long len; - - ei_get_type(buf, index, &type, &size); - - if (type != ERL_STRING_EXT && type != ERL_BINARY_EXT && type != ERL_NIL_EXT) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed binary or string\n", type, size); - return -1; - } - - if (size > maxsize) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Requested decoding of %s with size %d into a buffer of size %d\n", - type == ERL_BINARY_EXT ? "binary" : "string", size, maxsize); - return -1; - } - - if (type == ERL_NIL_EXT) { - res = 0; - *dst = '\0'; - } else if (type == ERL_BINARY_EXT) { - res = ei_decode_binary(buf, index, dst, &len); - dst[len] = '\0'; /* binaries aren't null terminated */ - } else { - res = ei_decode_string(buf, index, dst); - } - - return res; -} - -switch_hash_t *create_default_filter() { - switch_hash_t *filter; - - switch_core_hash_init(&filter); - - switch_core_hash_insert(filter, "Acquired-UUID", "1"); - switch_core_hash_insert(filter, "action", "1"); - switch_core_hash_insert(filter, "Action", "1"); - switch_core_hash_insert(filter, "alt_event_type", "1"); - switch_core_hash_insert(filter, "Answer-State", "1"); - switch_core_hash_insert(filter, "Application", "1"); - switch_core_hash_insert(filter, "Application-Data", "1"); - switch_core_hash_insert(filter, "Application-Name", "1"); - switch_core_hash_insert(filter, "Application-Response", "1"); - switch_core_hash_insert(filter, "att_xfer_replaced_by", "1"); - switch_core_hash_insert(filter, "Auth-Method", "1"); - switch_core_hash_insert(filter, "Auth-Realm", "1"); - switch_core_hash_insert(filter, "Auth-User", "1"); - switch_core_hash_insert(filter, "Bridge-A-Unique-ID", "1"); - switch_core_hash_insert(filter, "Bridge-B-Unique-ID", "1"); - switch_core_hash_insert(filter, "Call-Direction", "1"); - switch_core_hash_insert(filter, "Caller-Callee-ID-Name", "1"); - switch_core_hash_insert(filter, "Caller-Callee-ID-Number", "1"); - switch_core_hash_insert(filter, "Caller-Caller-ID-Name", "1"); - switch_core_hash_insert(filter, "Caller-Caller-ID-Number", "1"); - switch_core_hash_insert(filter, "Caller-Screen-Bit", "1"); - switch_core_hash_insert(filter, "Caller-Privacy-Hide-Name", "1"); - switch_core_hash_insert(filter, "Caller-Privacy-Hide-Number", "1"); - switch_core_hash_insert(filter, "Caller-Context", "1"); - switch_core_hash_insert(filter, "Caller-Controls", "1"); - switch_core_hash_insert(filter, "Caller-Destination-Number", "1"); - switch_core_hash_insert(filter, "Caller-Dialplan", "1"); - switch_core_hash_insert(filter, "Caller-Network-Addr", "1"); - switch_core_hash_insert(filter, "Caller-Unique-ID", "1"); - switch_core_hash_insert(filter, "Call-ID", "1"); - switch_core_hash_insert(filter, "Channel-Call-State", "1"); - switch_core_hash_insert(filter, "Channel-Call-UUID", "1"); - switch_core_hash_insert(filter, "Channel-Presence-ID", "1"); - switch_core_hash_insert(filter, "Channel-State", "1"); - switch_core_hash_insert(filter, "Chat-Permissions", "1"); - switch_core_hash_insert(filter, "Conference-Name", "1"); - switch_core_hash_insert(filter, "Conference-Profile-Name", "1"); - switch_core_hash_insert(filter, "Conference-Unique-ID", "1"); - switch_core_hash_insert(filter, "contact", "1"); - switch_core_hash_insert(filter, "Detected-Tone", "1"); - switch_core_hash_insert(filter, "dialog_state", "1"); - switch_core_hash_insert(filter, "direction", "1"); - switch_core_hash_insert(filter, "Distributed-From", "1"); - switch_core_hash_insert(filter, "DTMF-Digit", "1"); - switch_core_hash_insert(filter, "DTMF-Duration", "1"); - switch_core_hash_insert(filter, "Event-Date-Timestamp", "1"); - switch_core_hash_insert(filter, "Event-Name", "1"); - switch_core_hash_insert(filter, "Event-Subclass", "1"); - switch_core_hash_insert(filter, "expires", "1"); - switch_core_hash_insert(filter, "Expires", "1"); - switch_core_hash_insert(filter, "Ext-SIP-IP", "1"); - switch_core_hash_insert(filter, "File", "1"); - switch_core_hash_insert(filter, "FreeSWITCH-Hostname", "1"); - switch_core_hash_insert(filter, "from", "1"); - switch_core_hash_insert(filter, "Hunt-Destination-Number", "1"); - switch_core_hash_insert(filter, "ip", "1"); - switch_core_hash_insert(filter, "Message-Account", "1"); - switch_core_hash_insert(filter, "metadata", "1"); - switch_core_hash_insert(filter, "old_node_channel_uuid", "1"); - switch_core_hash_insert(filter, "Other-Leg-Callee-ID-Name", "1"); - switch_core_hash_insert(filter, "Other-Leg-Callee-ID-Number", "1"); - switch_core_hash_insert(filter, "Other-Leg-Caller-ID-Name", "1"); - switch_core_hash_insert(filter, "Other-Leg-Caller-ID-Number", "1"); - switch_core_hash_insert(filter, "Other-Leg-Destination-Number", "1"); - switch_core_hash_insert(filter, "Other-Leg-Direction", "1"); - switch_core_hash_insert(filter, "Other-Leg-Unique-ID", "1"); - switch_core_hash_insert(filter, "Other-Leg-Channel-Name", "1"); - switch_core_hash_insert(filter, "Participant-Type", "1"); - switch_core_hash_insert(filter, "Path", "1"); - switch_core_hash_insert(filter, "profile_name", "1"); - switch_core_hash_insert(filter, "Profiles", "1"); - switch_core_hash_insert(filter, "proto-specific-event-name", "1"); - switch_core_hash_insert(filter, "Raw-Application-Data", "1"); - switch_core_hash_insert(filter, "realm", "1"); - switch_core_hash_insert(filter, "Resigning-UUID", "1"); - switch_core_hash_insert(filter, "set", "1"); - switch_core_hash_insert(filter, "sip_auto_answer", "1"); - switch_core_hash_insert(filter, "sip_auth_method", "1"); - switch_core_hash_insert(filter, "sip_from_host", "1"); - switch_core_hash_insert(filter, "sip_from_user", "1"); - switch_core_hash_insert(filter, "sip_to_host", "1"); - switch_core_hash_insert(filter, "sip_to_user", "1"); - switch_core_hash_insert(filter, "sub-call-id", "1"); - switch_core_hash_insert(filter, "technology", "1"); - switch_core_hash_insert(filter, "to", "1"); - switch_core_hash_insert(filter, "Unique-ID", "1"); - switch_core_hash_insert(filter, "URL", "1"); - switch_core_hash_insert(filter, "username", "1"); - switch_core_hash_insert(filter, "variable_channel_is_moving", "1"); - switch_core_hash_insert(filter, "variable_collected_digits", "1"); - switch_core_hash_insert(filter, "variable_current_application", "1"); - switch_core_hash_insert(filter, "variable_current_application_data", "1"); - switch_core_hash_insert(filter, "variable_domain_name", "1"); - switch_core_hash_insert(filter, "variable_effective_caller_id_name", "1"); - switch_core_hash_insert(filter, "variable_effective_caller_id_number", "1"); - switch_core_hash_insert(filter, "variable_holding_uuid", "1"); - switch_core_hash_insert(filter, "variable_hold_music", "1"); - switch_core_hash_insert(filter, "variable_media_group_id", "1"); - switch_core_hash_insert(filter, "variable_originate_disposition", "1"); - switch_core_hash_insert(filter, "variable_origination_uuid", "1"); - switch_core_hash_insert(filter, "variable_playback_terminator_used", "1"); - switch_core_hash_insert(filter, "variable_presence_id", "1"); - switch_core_hash_insert(filter, "variable_record_ms", "1"); - switch_core_hash_insert(filter, "variable_recovered", "1"); - switch_core_hash_insert(filter, "variable_silence_hits_exhausted", "1"); - switch_core_hash_insert(filter, "variable_sip_auth_realm", "1"); - switch_core_hash_insert(filter, "variable_sip_from_host", "1"); - switch_core_hash_insert(filter, "variable_sip_from_user", "1"); - switch_core_hash_insert(filter, "variable_sip_from_tag", "1"); - switch_core_hash_insert(filter, "variable_sip_h_X-AUTH-IP", "1"); - switch_core_hash_insert(filter, "variable_sip_received_ip", "1"); - switch_core_hash_insert(filter, "variable_sip_to_host", "1"); - switch_core_hash_insert(filter, "variable_sip_to_user", "1"); - switch_core_hash_insert(filter, "variable_sip_to_tag", "1"); - switch_core_hash_insert(filter, "variable_sofia_profile_name", "1"); - switch_core_hash_insert(filter, "variable_transfer_history", "1"); - switch_core_hash_insert(filter, "variable_user_name", "1"); - switch_core_hash_insert(filter, "variable_endpoint_disposition", "1"); - switch_core_hash_insert(filter, "variable_originate_disposition", "1"); - switch_core_hash_insert(filter, "variable_bridge_hangup_cause", "1"); - switch_core_hash_insert(filter, "variable_hangup_cause", "1"); - switch_core_hash_insert(filter, "variable_last_bridge_proto_specific_hangup_cause", "1"); - switch_core_hash_insert(filter, "variable_proto_specific_hangup_cause", "1"); - switch_core_hash_insert(filter, "VM-Call-ID", "1"); - switch_core_hash_insert(filter, "VM-sub-call-id", "1"); - switch_core_hash_insert(filter, "whistle_application_name", "1"); - switch_core_hash_insert(filter, "whistle_application_response", "1"); - switch_core_hash_insert(filter, "whistle_event_name", "1"); - switch_core_hash_insert(filter, "kazoo_application_name", "1"); - switch_core_hash_insert(filter, "kazoo_application_response", "1"); - switch_core_hash_insert(filter, "kazoo_event_name", "1"); - switch_core_hash_insert(filter, "sip_auto_answer_notify", "1"); - switch_core_hash_insert(filter, "eavesdrop_group", "1"); - switch_core_hash_insert(filter, "origination_caller_id_name", "1"); - switch_core_hash_insert(filter, "origination_caller_id_number", "1"); - switch_core_hash_insert(filter, "origination_callee_id_name", "1"); - switch_core_hash_insert(filter, "origination_callee_id_number", "1"); - switch_core_hash_insert(filter, "sip_auth_username", "1"); - switch_core_hash_insert(filter, "sip_auth_password", "1"); - switch_core_hash_insert(filter, "effective_caller_id_name", "1"); - switch_core_hash_insert(filter, "effective_caller_id_number", "1"); - switch_core_hash_insert(filter, "effective_callee_id_name", "1"); - switch_core_hash_insert(filter, "effective_callee_id_number", "1"); - switch_core_hash_insert(filter, "variable_destination_number", "1"); - switch_core_hash_insert(filter, "variable_effective_callee_id_name", "1"); - switch_core_hash_insert(filter, "variable_effective_callee_id_number", "1"); - switch_core_hash_insert(filter, "variable_record_silence_hits", "1"); - switch_core_hash_insert(filter, "variable_refer_uuid", "1"); - switch_core_hash_insert(filter, "variable_sip_call_id", "1"); - switch_core_hash_insert(filter, "variable_sip_h_Referred-By", "1"); - switch_core_hash_insert(filter, "variable_sip_h_X-AUTH-PORT", "1"); - switch_core_hash_insert(filter, "variable_sip_loopback_req_uri", "1"); - switch_core_hash_insert(filter, "variable_sip_received_port", "1"); - switch_core_hash_insert(filter, "variable_sip_refer_to", "1"); - switch_core_hash_insert(filter, "variable_sip_req_host", "1"); - switch_core_hash_insert(filter, "variable_sip_req_uri", "1"); - switch_core_hash_insert(filter, "variable_transfer_source", "1"); - switch_core_hash_insert(filter, "variable_uuid", "1"); - - /* Registration headers */ - switch_core_hash_insert(filter, "call-id", "1"); - switch_core_hash_insert(filter, "profile-name", "1"); - switch_core_hash_insert(filter, "from-user", "1"); - switch_core_hash_insert(filter, "from-host", "1"); - switch_core_hash_insert(filter, "presence-hosts", "1"); - switch_core_hash_insert(filter, "contact", "1"); - switch_core_hash_insert(filter, "rpid", "1"); - switch_core_hash_insert(filter, "status", "1"); - switch_core_hash_insert(filter, "expires", "1"); - switch_core_hash_insert(filter, "to-user", "1"); - switch_core_hash_insert(filter, "to-host", "1"); - switch_core_hash_insert(filter, "network-ip", "1"); - switch_core_hash_insert(filter, "network-port", "1"); - switch_core_hash_insert(filter, "username", "1"); - switch_core_hash_insert(filter, "realm", "1"); - switch_core_hash_insert(filter, "user-agent", "1"); - - switch_core_hash_insert(filter, "Hangup-Cause", "1"); - switch_core_hash_insert(filter, "Unique-ID", "1"); - switch_core_hash_insert(filter, "variable_switch_r_sdp", "1"); - switch_core_hash_insert(filter, "variable_rtp_local_sdp_str", "1"); - switch_core_hash_insert(filter, "variable_sip_to_uri", "1"); - switch_core_hash_insert(filter, "variable_sip_from_uri", "1"); - switch_core_hash_insert(filter, "variable_sip_user_agent", "1"); - switch_core_hash_insert(filter, "variable_duration", "1"); - switch_core_hash_insert(filter, "variable_billsec", "1"); - switch_core_hash_insert(filter, "variable_billmsec", "1"); - switch_core_hash_insert(filter, "variable_progresssec", "1"); - switch_core_hash_insert(filter, "variable_progress_uepoch", "1"); - switch_core_hash_insert(filter, "variable_progress_media_uepoch", "1"); - switch_core_hash_insert(filter, "variable_start_uepoch", "1"); - switch_core_hash_insert(filter, "variable_digits_dialed", "1"); - switch_core_hash_insert(filter, "Member-ID", "1"); - switch_core_hash_insert(filter, "Floor", "1"); - switch_core_hash_insert(filter, "Video", "1"); - switch_core_hash_insert(filter, "Hear", "1"); - switch_core_hash_insert(filter, "Speak", "1"); - switch_core_hash_insert(filter, "Talking", "1"); - switch_core_hash_insert(filter, "Current-Energy", "1"); - switch_core_hash_insert(filter, "Energy-Level", "1"); - switch_core_hash_insert(filter, "Mute-Detect", "1"); - - /* RTMP headers */ - switch_core_hash_insert(filter, "RTMP-Session-ID", "1"); - switch_core_hash_insert(filter, "RTMP-Profile", "1"); - switch_core_hash_insert(filter, "RTMP-Flash-Version", "1"); - switch_core_hash_insert(filter, "RTMP-SWF-URL", "1"); - switch_core_hash_insert(filter, "RTMP-TC-URL", "1"); - switch_core_hash_insert(filter, "RTMP-Page-URL", "1"); - switch_core_hash_insert(filter, "User", "1"); - switch_core_hash_insert(filter, "Domain", "1"); - - /* Fax headers */ - switch_core_hash_insert(filter, "variable_fax_bad_rows", "1"); - switch_core_hash_insert(filter, "variable_fax_document_total_pages", "1"); - switch_core_hash_insert(filter, "variable_fax_document_transferred_pages", "1"); - switch_core_hash_insert(filter, "variable_fax_ecm_used", "1"); - switch_core_hash_insert(filter, "variable_fax_result_code", "1"); - switch_core_hash_insert(filter, "variable_fax_result_text", "1"); - switch_core_hash_insert(filter, "variable_fax_success", "1"); - switch_core_hash_insert(filter, "variable_fax_transfer_rate", "1"); - switch_core_hash_insert(filter, "variable_fax_local_station_id", "1"); - switch_core_hash_insert(filter, "variable_fax_remote_station_id", "1"); - switch_core_hash_insert(filter, "variable_fax_remote_country", "1"); - switch_core_hash_insert(filter, "variable_fax_remote_vendor", "1"); - switch_core_hash_insert(filter, "variable_fax_remote_model", "1"); - switch_core_hash_insert(filter, "variable_fax_image_resolution", "1"); - switch_core_hash_insert(filter, "variable_fax_file_image_resolution", "1"); - switch_core_hash_insert(filter, "variable_fax_image_size", "1"); - switch_core_hash_insert(filter, "variable_fax_image_pixel_size", "1"); - switch_core_hash_insert(filter, "variable_fax_file_image_pixel_size", "1"); - switch_core_hash_insert(filter, "variable_fax_longest_bad_row_run", "1"); - switch_core_hash_insert(filter, "variable_fax_encoding", "1"); - switch_core_hash_insert(filter, "variable_fax_encoding_name", "1"); - switch_core_hash_insert(filter, "variable_fax_header", "1"); - switch_core_hash_insert(filter, "variable_fax_ident", "1"); - switch_core_hash_insert(filter, "variable_fax_timezone", "1"); - switch_core_hash_insert(filter, "variable_fax_doc_id", "1"); - switch_core_hash_insert(filter, "variable_fax_doc_database", "1"); - switch_core_hash_insert(filter, "variable_has_t38", "1"); - - /* Secure headers */ - switch_core_hash_insert(filter, "variable_sdp_secure_savp_only", "1"); - switch_core_hash_insert(filter, "variable_rtp_has_crypto", "1"); - switch_core_hash_insert(filter, "variable_rtp_secure_media", "1"); - switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed", "1"); - switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed_audio", "1"); - switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed_video", "1"); - switch_core_hash_insert(filter, "variable_zrtp_secure_media", "1"); - switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed", "1"); - switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed_audio", "1"); - switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed_video", "1"); - switch_core_hash_insert(filter, "sdp_secure_savp_only", "1"); - switch_core_hash_insert(filter, "rtp_has_crypto", "1"); - switch_core_hash_insert(filter, "rtp_secure_media", "1"); - switch_core_hash_insert(filter, "rtp_secure_media_confirmed", "1"); - switch_core_hash_insert(filter, "rtp_secure_media_confirmed_audio", "1"); - switch_core_hash_insert(filter, "rtp_secure_media_confirmed_video", "1"); - switch_core_hash_insert(filter, "zrtp_secure_media", "1"); - switch_core_hash_insert(filter, "zrtp_secure_media_confirmed", "1"); - switch_core_hash_insert(filter, "zrtp_secure_media_confirmed_audio", "1"); - switch_core_hash_insert(filter, "zrtp_secure_media_confirmed_video", "1"); - - /* Device Redirect headers */ - switch_core_hash_insert(filter, "variable_last_bridge_hangup_cause", "1"); - switch_core_hash_insert(filter, "variable_sip_redirected_by", "1"); - switch_core_hash_insert(filter, "intercepted_by", "1"); - switch_core_hash_insert(filter, "variable_bridge_uuid", "1"); - switch_core_hash_insert(filter, "Record-File-Path", "1"); - - /* Loopback headers */ - switch_core_hash_insert(filter, "variable_loopback_bowout_on_execute", "1"); - switch_core_hash_insert(filter, "variable_loopback_bowout", "1"); - switch_core_hash_insert(filter, "variable_other_loopback_leg_uuid", "1"); - switch_core_hash_insert(filter, "variable_loopback_leg", "1"); - switch_core_hash_insert(filter, "variable_is_loopback", "1"); - - // SMS - switch_core_hash_insert(filter, "Message-ID", "1"); - switch_core_hash_insert(filter, "Delivery-Failure", "1"); - switch_core_hash_insert(filter, "Delivery-Result-Code", "1"); - - return filter; -} - -static void *SWITCH_THREAD_FUNC fetch_config_filters_exec(switch_thread_t *thread, void *obj) -{ - char *cf = "kazoo.conf"; - switch_xml_t cfg, xml, child, param; - switch_event_t *params; - switch_memory_pool_t *pool = (switch_memory_pool_t *)obj; - - switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Action", "request-filter"); - - if (!(xml = switch_xml_open_cfg(cf, &cfg, params))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf); - } else if ((child = switch_xml_child(cfg, "event-filter"))) { - switch_hash_t *filter; - switch_hash_t *old_filter; - - switch_core_hash_init(&filter); - for (param = switch_xml_child(child, "header"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - switch_core_hash_insert(filter, var, "1"); - } - - old_filter = kazoo_globals.event_filter; - kazoo_globals.config_filters_fetched = 1; - kazoo_globals.event_filter = filter; - if (old_filter) { - switch_core_hash_destroy(&old_filter); - } - - switch_xml_free(xml); - } - - if (params) switch_event_destroy(¶ms); - switch_core_destroy_memory_pool(&pool); - - return NULL; -} - -void fetch_config_filters() { - switch_memory_pool_t *pool; - switch_thread_t *thread; - switch_threadattr_t *thd_attr = NULL; - switch_uuid_t uuid; - - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "fetching kazoo filters\n"); - - switch_core_new_memory_pool(&pool); - - switch_threadattr_create(&thd_attr, pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - - switch_uuid_get(&uuid); - switch_thread_create(&thread, thd_attr, fetch_config_filters_exec, pool, pool); - -} - - - /* For Emacs: * Local Variables: * mode:c diff --git a/src/mod/event_handlers/mod_kazoo/mod_kazoo.c b/src/mod/event_handlers/mod_kazoo/mod_kazoo.c index b666920d3f..5b255738ff 100644 --- a/src/mod/event_handlers/mod_kazoo/mod_kazoo.c +++ b/src/mod/event_handlers/mod_kazoo/mod_kazoo.c @@ -32,608 +32,12 @@ */ #include "mod_kazoo.h" -#define KAZOO_DESC "kazoo information" -#define KAZOO_SYNTAX " []" +globals_t kazoo_globals = {0}; + -globals_t kazoo_globals; -SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load); -SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown); -SWITCH_MODULE_RUNTIME_FUNCTION(mod_kazoo_runtime); SWITCH_MODULE_DEFINITION(mod_kazoo, mod_kazoo_load, mod_kazoo_shutdown, mod_kazoo_runtime); -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_pref_ip, kazoo_globals.ip); -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_pref_ei_cookie, kazoo_globals.ei_cookie); -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_pref_ei_nodename, kazoo_globals.ei_nodename); -SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_pref_kazoo_var_prefix, kazoo_globals.kazoo_var_prefix); - -static switch_status_t api_erlang_status(switch_stream_handle_t *stream) { - switch_sockaddr_t *sa; - uint16_t port; - char ipbuf[48]; - const char *ip_addr; - ei_node_t *ei_node; - - switch_socket_addr_get(&sa, SWITCH_FALSE, kazoo_globals.acceptor); - - port = switch_sockaddr_get_port(sa); - ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); - - stream->write_function(stream, "Running %s\n", VERSION); - stream->write_function(stream, "Listening for new Erlang connections on %s:%u with cookie %s\n", ip_addr, port, kazoo_globals.ei_cookie); - stream->write_function(stream, "Registered as Erlang node %s, visible as %s\n", kazoo_globals.ei_cnode.thisnodename, kazoo_globals.ei_cnode.thisalivename); - - if (kazoo_globals.ei_compat_rel) { - stream->write_function(stream, "Using Erlang compatibility mode: %d\n", kazoo_globals.ei_compat_rel); - } - - switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); - ei_node = kazoo_globals.ei_nodes; - if (!ei_node) { - stream->write_function(stream, "No erlang nodes connected\n"); - } else { - stream->write_function(stream, "Connected to:\n"); - while(ei_node != NULL) { - unsigned int year, day, hour, min, sec, delta; - - delta = (switch_micro_time_now() - ei_node->created_time) / 1000000; - sec = delta % 60; - min = delta / 60 % 60; - hour = delta / 3600 % 24; - day = delta / 86400 % 7; - year = delta / 31556926 % 12; - stream->write_function(stream, " %s (%s:%d) up %d years, %d days, %d hours, %d minutes, %d seconds\n" - ,ei_node->peer_nodename, ei_node->remote_ip, ei_node->remote_port, year, day, hour, min, sec); - ei_node = ei_node->next; - } - } - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t api_erlang_event_filter(switch_stream_handle_t *stream) { - switch_hash_index_t *hi = NULL; - int column = 0; - - for (hi = (switch_hash_index_t *)switch_core_hash_first_iter(kazoo_globals.event_filter, hi); hi; hi = switch_core_hash_next(&hi)) { - const void *key; - void *val; - switch_core_hash_this(hi, &key, NULL, &val); - stream->write_function(stream, "%-50s", (char *)key); - if (++column > 2) { - stream->write_function(stream, "\n"); - column = 0; - } - } - - if (++column > 2) { - stream->write_function(stream, "\n"); - column = 0; - } - - stream->write_function(stream, "%-50s", kazoo_globals.kazoo_var_prefix); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t api_erlang_nodes_list(switch_stream_handle_t *stream) { - ei_node_t *ei_node; - - switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); - ei_node = kazoo_globals.ei_nodes; - while(ei_node != NULL) { - stream->write_function(stream, "%s (%s)\n", ei_node->peer_nodename, ei_node->remote_ip); - ei_node = ei_node->next; - } - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t api_erlang_nodes_count(switch_stream_handle_t *stream) { - ei_node_t *ei_node; - int count = 0; - - switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); - ei_node = kazoo_globals.ei_nodes; - while(ei_node != NULL) { - count++; - ei_node = ei_node->next; - } - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - - stream->write_function(stream, "%d\n", count); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t api_complete_erlang_node(const char *line, const char *cursor, switch_console_callback_match_t **matches) { - switch_console_callback_match_t *my_matches = NULL; - switch_status_t status = SWITCH_STATUS_FALSE; - ei_node_t *ei_node; - - switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); - ei_node = kazoo_globals.ei_nodes; - while(ei_node != NULL) { - switch_console_push_match(&my_matches, ei_node->peer_nodename); - ei_node = ei_node->next; - } - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - - if (my_matches) { - *matches = my_matches; - status = SWITCH_STATUS_SUCCESS; - } - - return status; -} - -static switch_status_t handle_node_api_event_stream(ei_event_stream_t *event_stream, switch_stream_handle_t *stream) { - ei_event_binding_t *binding; - int column = 0; - - switch_mutex_lock(event_stream->socket_mutex); - if (event_stream->connected == SWITCH_FALSE) { - switch_sockaddr_t *sa; - uint16_t port; - char ipbuf[48] = {0}; - const char *ip_addr; - - switch_socket_addr_get(&sa, SWITCH_TRUE, event_stream->acceptor); - port = switch_sockaddr_get_port(sa); - ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); - - if (zstr(ip_addr)) { - ip_addr = kazoo_globals.ip; - } - - stream->write_function(stream, "%s:%d -> disconnected\n" - ,ip_addr, port); - } else { - stream->write_function(stream, "%s:%d -> %s:%d\n" - ,event_stream->local_ip, event_stream->local_port - ,event_stream->remote_ip, event_stream->remote_port); - } - - binding = event_stream->bindings; - while(binding != NULL) { - if (binding->type == SWITCH_EVENT_CUSTOM) { - stream->write_function(stream, "CUSTOM %-43s", binding->subclass_name); - } else { - stream->write_function(stream, "%-50s", switch_event_name(binding->type)); - } - - if (++column > 2) { - stream->write_function(stream, "\n"); - column = 0; - } - - binding = binding->next; - } - switch_mutex_unlock(event_stream->socket_mutex); - - if (!column) { - stream->write_function(stream, "\n"); - } else { - stream->write_function(stream, "\n\n"); - } - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t handle_node_api_event_streams(ei_node_t *ei_node, switch_stream_handle_t *stream) { - ei_event_stream_t *event_stream; - - switch_mutex_lock(ei_node->event_streams_mutex); - event_stream = ei_node->event_streams; - while(event_stream != NULL) { - handle_node_api_event_stream(event_stream, stream); - event_stream = event_stream->next; - } - switch_mutex_unlock(ei_node->event_streams_mutex); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t handle_node_api_command(ei_node_t *ei_node, switch_stream_handle_t *stream, uint32_t command) { - unsigned int year, day, hour, min, sec, delta; - - switch (command) { - case API_COMMAND_DISCONNECT: - stream->write_function(stream, "Disconnecting erlang node %s at managers request\n", ei_node->peer_nodename); - switch_clear_flag(ei_node, LFLAG_RUNNING); - break; - case API_COMMAND_REMOTE_IP: - delta = (switch_micro_time_now() - ei_node->created_time) / 1000000; - sec = delta % 60; - min = delta / 60 % 60; - hour = delta / 3600 % 24; - day = delta / 86400 % 7; - year = delta / 31556926 % 12; - - stream->write_function(stream, "Uptime %d years, %d days, %d hours, %d minutes, %d seconds\n", year, day, hour, min, sec); - stream->write_function(stream, "Local Address %s:%d\n", ei_node->local_ip, ei_node->local_port); - stream->write_function(stream, "Remote Address %s:%d\n", ei_node->remote_ip, ei_node->remote_port); - break; - case API_COMMAND_STREAMS: - handle_node_api_event_streams(ei_node, stream); - break; - case API_COMMAND_BINDINGS: - handle_api_command_streams(ei_node, stream); - break; - default: - break; - } - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t api_erlang_node_command(switch_stream_handle_t *stream, const char *nodename, uint32_t command) { - ei_node_t *ei_node; - - switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); - ei_node = kazoo_globals.ei_nodes; - while(ei_node != NULL) { - int length = strlen(ei_node->peer_nodename); - - if (!strncmp(ei_node->peer_nodename, nodename, length)) { - handle_node_api_command(ei_node, stream, command); - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - return SWITCH_STATUS_SUCCESS; - } - - ei_node = ei_node->next; - } - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - - return SWITCH_STATUS_NOTFOUND; -} - -static int read_cookie_from_file(char *filename) { - int fd; - char cookie[MAXATOMLEN + 1]; - char *end; - struct stat buf; - ssize_t res; - - if (!stat(filename, &buf)) { - if ((buf.st_mode & S_IRWXG) || (buf.st_mode & S_IRWXO)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s must only be accessible by owner only.\n", filename); - return 2; - } - if (buf.st_size > MAXATOMLEN) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s contains a cookie larger than the maximum atom size of %d.\n", filename, MAXATOMLEN); - return 2; - } - fd = open(filename, O_RDONLY); - if (fd < 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to open cookie file %s : %d.\n", filename, errno); - return 2; - } - - if ((res = read(fd, cookie, MAXATOMLEN)) < 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to read cookie file %s : %d.\n", filename, errno); - } - - cookie[MAXATOMLEN] = '\0'; - - /* replace any end of line characters with a null */ - if ((end = strchr(cookie, '\n'))) { - *end = '\0'; - } - - if ((end = strchr(cookie, '\r'))) { - *end = '\0'; - } - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set cookie from file %s: %s\n", filename, cookie); - - set_pref_ei_cookie(cookie); - return 0; - } else { - /* don't error here, because we might be blindly trying to read $HOME/.erlang.cookie, and that can fail silently */ - return 1; - } -} - -static switch_status_t config(void) { - char *cf = "kazoo.conf"; - switch_xml_t cfg, xml, child, param; - kazoo_globals.send_all_headers = 0; - kazoo_globals.send_all_private_headers = 1; - kazoo_globals.connection_timeout = 500; - kazoo_globals.receive_timeout = 200; - kazoo_globals.receive_msg_preallocate = 2000; - kazoo_globals.event_stream_preallocate = 4000; - kazoo_globals.send_msg_batch = 10; - kazoo_globals.event_stream_framing = 2; - kazoo_globals.port = 0; - kazoo_globals.io_fault_tolerance = 10; - - if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf); - return SWITCH_STATUS_FALSE; - } else { - if ((child = switch_xml_child(cfg, "settings"))) { - for (param = switch_xml_child(child, "param"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - char *val = (char *) switch_xml_attr_soft(param, "value"); - - if (!strcmp(var, "listen-ip")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set bind ip address: %s\n", val); - set_pref_ip(val); - } else if (!strcmp(var, "listen-port")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set bind port: %s\n", val); - kazoo_globals.port = atoi(val); - } else if (!strcmp(var, "cookie")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set cookie: %s\n", val); - set_pref_ei_cookie(val); - } else if (!strcmp(var, "cookie-file")) { - if (read_cookie_from_file(val) == 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to read cookie from %s\n", val); - } - } else if (!strcmp(var, "nodename")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set node name: %s\n", val); - set_pref_ei_nodename(val); - } else if (!strcmp(var, "shortname")) { - kazoo_globals.ei_shortname = switch_true(val); - } else if (!strcmp(var, "kazoo-var-prefix")) { - set_pref_kazoo_var_prefix(val); - } else if (!strcmp(var, "compat-rel")) { - if (atoi(val) >= 7) - kazoo_globals.ei_compat_rel = atoi(val); - else - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid compatibility release '%s' specified\n", val); - } else if (!strcmp(var, "nat-map")) { - kazoo_globals.nat_map = switch_true(val); - } else if (!strcmp(var, "send-all-headers")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-all-headers: %s\n", val); - kazoo_globals.send_all_headers = switch_true(val); - } else if (!strcmp(var, "send-all-private-headers")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-all-private-headers: %s\n", val); - kazoo_globals.send_all_private_headers = switch_true(val); - } else if (!strcmp(var, "connection-timeout")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set connection-timeout: %s\n", val); - kazoo_globals.connection_timeout = atoi(val); - } else if (!strcmp(var, "receive-timeout")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set receive-timeout: %s\n", val); - kazoo_globals.receive_timeout = atoi(val); - } else if (!strcmp(var, "receive-msg-preallocate")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set receive-msg-preallocate: %s\n", val); - kazoo_globals.receive_msg_preallocate = atoi(val); - } else if (!strcmp(var, "event-stream-preallocate")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set event-stream-preallocate: %s\n", val); - kazoo_globals.event_stream_preallocate = atoi(val); - } else if (!strcmp(var, "send-msg-batch-size")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-msg-batch-size: %s\n", val); - kazoo_globals.send_msg_batch = atoi(val); - } else if (!strcmp(var, "event-stream-framing")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set event-stream-framing: %s\n", val); - kazoo_globals.event_stream_framing = atoi(val); - } else if (!strcmp(var, "io-fault-tolerance")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set io-fault-tolerance: %s\n", val); - kazoo_globals.io_fault_tolerance = atoi(val); - } - } - } - - if ((child = switch_xml_child(cfg, "event-filter"))) { - switch_hash_t *filter; - - switch_core_hash_init(&filter); - for (param = switch_xml_child(child, "header"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - switch_core_hash_insert(filter, var, "1"); - } - - kazoo_globals.event_filter = filter; - } - - switch_xml_free(xml); - } - - if (kazoo_globals.receive_msg_preallocate < 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid receive message preallocate value, disabled\n"); - kazoo_globals.receive_msg_preallocate = 0; - } - - if (kazoo_globals.event_stream_preallocate < 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid event stream preallocate value, disabled\n"); - kazoo_globals.event_stream_preallocate = 0; - } - - if (kazoo_globals.send_msg_batch < 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid send message batch size, reverting to default\n"); - kazoo_globals.send_msg_batch = 10; - } - - if (kazoo_globals.io_fault_tolerance < 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid I/O fault tolerance, reverting to default\n"); - kazoo_globals.io_fault_tolerance = 10; - } - - if (!kazoo_globals.event_filter) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Event filter not found in configuration, using default\n"); - kazoo_globals.event_filter = create_default_filter(); - } - - if (kazoo_globals.event_stream_framing < 1 || kazoo_globals.event_stream_framing > 4) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid event stream framing value, using default\n"); - kazoo_globals.event_stream_framing = 2; - } - - if (zstr(kazoo_globals.kazoo_var_prefix)) { - set_pref_kazoo_var_prefix("variable_ecallmgr*"); - kazoo_globals.var_prefix_length = 17; //ignore the * - } else { - /* we could use the global pool but then we would have to conditionally - * free the pointer if it was not drawn from the XML */ - char *buf; - int size = switch_snprintf(NULL, 0, "variable_%s*", kazoo_globals.kazoo_var_prefix) + 1; - - switch_malloc(buf, size); - switch_snprintf(buf, size, "variable_%s*", kazoo_globals.kazoo_var_prefix); - switch_safe_free(kazoo_globals.kazoo_var_prefix); - kazoo_globals.kazoo_var_prefix = buf; - kazoo_globals.var_prefix_length = size - 2; //ignore the * - } - - if (!kazoo_globals.num_worker_threads) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Number of worker threads not found in configuration, using default\n"); - kazoo_globals.num_worker_threads = 10; - } - - if (zstr(kazoo_globals.ip)) { - set_pref_ip("0.0.0.0"); - } - - if (zstr(kazoo_globals.ei_cookie)) { - int res; - char *home_dir = getenv("HOME"); - char path_buf[1024]; - - if (!zstr(home_dir)) { - /* $HOME/.erlang.cookie */ - switch_snprintf(path_buf, sizeof (path_buf), "%s%s%s", home_dir, SWITCH_PATH_SEPARATOR, ".erlang.cookie"); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Checking for cookie at path: %s\n", path_buf); - - res = read_cookie_from_file(path_buf); - if (res) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No cookie or valid cookie file specified, using default cookie\n"); - set_pref_ei_cookie("ClueCon"); - } - } - } - - if (!kazoo_globals.ei_nodename) { - set_pref_ei_nodename("freeswitch"); - } - - if (!kazoo_globals.nat_map) { - kazoo_globals.nat_map = 0; - } - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t create_acceptor() { - switch_sockaddr_t *sa; - uint16_t port; - char ipbuf[48]; - const char *ip_addr; - - /* if the config has specified an erlang release compatibility then pass that along to the erlang interface */ - if (kazoo_globals.ei_compat_rel) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Compatability with OTP R%d requested\n", kazoo_globals.ei_compat_rel); - ei_set_compat_rel(kazoo_globals.ei_compat_rel); - } - - if (!(kazoo_globals.acceptor = create_socket_with_port(kazoo_globals.pool, kazoo_globals.port))) { - return SWITCH_STATUS_SOCKERR; - } - - switch_socket_addr_get(&sa, SWITCH_FALSE, kazoo_globals.acceptor); - - port = switch_sockaddr_get_port(sa); - ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Erlang connection acceptor listening on %s:%u\n", ip_addr, port); - - /* try to initialize the erlang interface */ - if (create_ei_cnode(ip_addr, kazoo_globals.ei_nodename, &kazoo_globals.ei_cnode) != SWITCH_STATUS_SUCCESS) { - return SWITCH_STATUS_SOCKERR; - } - - /* tell the erlang port manager where we can be reached. this returns a file descriptor pointing to epmd or -1 */ - if ((kazoo_globals.epmdfd = ei_publish(&kazoo_globals.ei_cnode, port)) == -1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, - "Failed to publish port to epmd. Try starting it yourself or run an erl shell with the -sname or -name option.\n"); - return SWITCH_STATUS_SOCKERR; - } - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connected to epmd and published erlang cnode name %s at port %d\n", kazoo_globals.ei_cnode.thisnodename, port); - - return SWITCH_STATUS_SUCCESS; -} - -SWITCH_STANDARD_API(exec_api_cmd) -{ - char *argv[1024] = { 0 }; - int unknown_command = 1, argc = 0; - char *mycmd = NULL; - - const char *usage_string = "USAGE:\n" - "--------------------------------------------------------------------------------------------------------------------\n" - "erlang status - provides an overview of the current status\n" - "erlang event_filter - lists the event headers that will be sent to Erlang nodes\n" - "erlang nodes list - lists connected Erlang nodes (usefull for monitoring tools)\n" - "erlang nodes count - provides a count of connected Erlang nodes (usefull for monitoring tools)\n" - "erlang node disconnect - disconnects an Erlang node\n" - "erlang node connection - Shows the connection info\n" - "erlang node event_streams - lists the event streams for an Erlang node\n" - "erlang node fetch_bindings - lists the XML fetch bindings for an Erlang node\n" - "---------------------------------------------------------------------------------------------------------------------\n"; - - if (zstr(cmd)) { - stream->write_function(stream, "%s", usage_string); - return SWITCH_STATUS_SUCCESS; - } - - if (!(mycmd = strdup(cmd))) { - return SWITCH_STATUS_MEMERR; - } - - if (!(argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { - stream->write_function(stream, "%s", usage_string); - switch_safe_free(mycmd); - return SWITCH_STATUS_SUCCESS; - } - - if (zstr(argv[0])) { - stream->write_function(stream, "%s", usage_string); - switch_safe_free(mycmd); - return SWITCH_STATUS_SUCCESS; - } - - if (!strncmp(argv[0], "status", 6)) { - unknown_command = 0; - api_erlang_status(stream); - } else if (!strncmp(argv[0], "event_filter", 6)) { - unknown_command = 0; - api_erlang_event_filter(stream); - } else if (!strncmp(argv[0], "nodes", 6) && !zstr(argv[1])) { - if (!strncmp(argv[1], "list", 6)) { - unknown_command = 0; - api_erlang_nodes_list(stream); - } else if (!strncmp(argv[1], "count", 6)) { - unknown_command = 0; - api_erlang_nodes_count(stream); - } - } else if (!strncmp(argv[0], "node", 6) && !zstr(argv[1]) && !zstr(argv[2])) { - if (!strncmp(argv[2], "disconnect", 6)) { - unknown_command = 0; - api_erlang_node_command(stream, argv[1], API_COMMAND_DISCONNECT); - } else if (!strncmp(argv[2], "connection", 2)) { - unknown_command = 0; - api_erlang_node_command(stream, argv[1], API_COMMAND_REMOTE_IP); - } else if (!strncmp(argv[2], "event_streams", 6)) { - unknown_command = 0; - api_erlang_node_command(stream, argv[1], API_COMMAND_STREAMS); - } else if (!strncmp(argv[2], "fetch_bindings", 6)) { - unknown_command = 0; - api_erlang_node_command(stream, argv[1], API_COMMAND_BINDINGS); - } - } - - if (unknown_command) { - stream->write_function(stream, "%s", usage_string); - } - - switch_safe_free(mycmd); - return SWITCH_STATUS_SUCCESS; -} - SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load) { switch_api_interface_t *api_interface = NULL; switch_application_interface_t *app_interface = NULL; @@ -643,34 +47,17 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load) { kazoo_globals.pool = pool; kazoo_globals.ei_nodes = NULL; - if(config() != SWITCH_STATUS_SUCCESS) { + // ensure epmd is running + + if(kazoo_load_config() != SWITCH_STATUS_SUCCESS) { // TODO: what would we need to clean up here? switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Improper configuration!\n"); return SWITCH_STATUS_TERM; } - if(create_acceptor() != SWITCH_STATUS_SUCCESS) { - // TODO: what would we need to clean up here - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to create erlang connection acceptor!\n"); - close_socket(&kazoo_globals.acceptor); - return SWITCH_STATUS_TERM; - } - /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); - /* create an api for cli debug commands */ - SWITCH_ADD_API(api_interface, "erlang", KAZOO_DESC, exec_api_cmd, KAZOO_SYNTAX); - switch_console_set_complete("add erlang status"); - switch_console_set_complete("add erlang event_filter"); - switch_console_set_complete("add erlang nodes list"); - switch_console_set_complete("add erlang nodes count"); - switch_console_set_complete("add erlang node ::erlang::node disconnect"); - switch_console_set_complete("add erlang node ::erlang::node connection"); - switch_console_set_complete("add erlang node ::erlang::node event_streams"); - switch_console_set_complete("add erlang node ::erlang::node fetch_bindings"); - switch_console_add_complete_func("::erlang::node", api_complete_erlang_node); - switch_thread_rwlock_create(&kazoo_globals.ei_nodes_lock, pool); switch_set_flag(&kazoo_globals, LFLAG_RUNNING); @@ -678,12 +65,18 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load) { /* create all XML fetch agents */ bind_fetch_agents(); + /* create an api for cli debug commands */ + add_cli_api(module_interface, api_interface); + /* add our modified commands */ add_kz_commands(module_interface, api_interface); /* add our modified dptools */ add_kz_dptools(module_interface, app_interface); + /* add tweaks */ + kz_tweaks_start(); + /* indicate that the module should continue to be loaded */ return SWITCH_STATUS_SUCCESS; } @@ -691,8 +84,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load) { SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown) { int sanity = 0; - switch_console_set_complete("del erlang"); - switch_console_del_complete_func("::erlang::node"); + + remove_cli_api(); + + kz_tweaks_stop(); /* stop taking new requests and start shuting down the threads */ switch_clear_flag(&kazoo_globals, LFLAG_RUNNING); @@ -710,6 +105,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown) { switch_core_hash_destroy(&kazoo_globals.event_filter); } + kazoo_destroy_config(); + switch_thread_rwlock_wrlock(kazoo_globals.ei_nodes_lock); switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); switch_thread_rwlock_destroy(kazoo_globals.ei_nodes_lock); @@ -722,9 +119,9 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown) { unbind_fetch_agents(); /* Close the port we reserved for uPnP/Switch behind firewall, if necessary */ - // if (kazoo_globals.nat_map && switch_nat_get_type()) { - // switch_nat_del_mapping(kazoo_globals.port, SWITCH_NAT_TCP); - // } + if (kazoo_globals.nat_map && switch_nat_get_type()) { + switch_nat_del_mapping(kazoo_globals.port, SWITCH_NAT_TCP); + } /* clean up our allocated preferences */ switch_safe_free(kazoo_globals.ip); @@ -735,50 +132,6 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown) { return SWITCH_STATUS_SUCCESS; } -SWITCH_MODULE_RUNTIME_FUNCTION(mod_kazoo_runtime) { - switch_os_socket_t os_socket; - - switch_atomic_inc(&kazoo_globals.threads); - - switch_os_sock_get(&os_socket, kazoo_globals.acceptor); - - while (switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { - int nodefd; - ErlConnect conn; - - /* zero out errno because ei_accept doesn't differentiate between a */ - /* failed authentication or a socket failure, or a client version */ - /* mismatch or a godzilla attack (and a godzilla attack is highly likely) */ - errno = 0; - - /* wait here for an erlang node to connect, timming out to check if our module is still running every now-and-again */ - if ((nodefd = ei_accept_tmo(&kazoo_globals.ei_cnode, (int) os_socket, &conn, kazoo_globals.connection_timeout)) == ERL_ERROR) { - if (erl_errno == ETIMEDOUT) { - continue; - } else if (errno) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Erlang connection acceptor socket error %d %d\n", erl_errno, errno); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, - "Erlang node connection failed - ensure your cookie matches '%s' and you are using a good nodename\n", kazoo_globals.ei_cookie); - } - continue; - } - - if (!switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { - break; - } - - /* NEW ERLANG NODE CONNECTION! Hello friend! */ - new_kazoo_node(nodefd, &conn); - } - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Erlang connection acceptor shut down\n"); - - switch_atomic_dec(&kazoo_globals.threads); - - return SWITCH_STATUS_TERM; -} - /* For Emacs: * Local Variables: diff --git a/src/mod/event_handlers/mod_kazoo/mod_kazoo.h b/src/mod/event_handlers/mod_kazoo/mod_kazoo.h index 9de7db6ea0..165e9ff1ce 100644 --- a/src/mod/event_handlers/mod_kazoo/mod_kazoo.h +++ b/src/mod/event_handlers/mod_kazoo/mod_kazoo.h @@ -1,167 +1,32 @@ #include #include +#include #include #include #include #include #include +#include #define MAX_ACL 100 #define CMD_BUFLEN 1024 * 1000 #define MAX_QUEUE_LEN 25000 #define MAX_MISSED 500 #define MAX_PID_CHARS 255 -#define VERSION "mod_kazoo v1.4.0-1" -#define API_COMMAND_DISCONNECT 0 -#define API_COMMAND_REMOTE_IP 1 -#define API_COMMAND_STREAMS 2 -#define API_COMMAND_BINDINGS 3 + +#include "kazoo_ei.h" +#include "kazoo_message.h" typedef enum { LFLAG_RUNNING = (1 << 0) } event_flag_t; -struct ei_send_msg_s { - ei_x_buff buf; - erlang_pid pid; -}; -typedef struct ei_send_msg_s ei_send_msg_t; -struct ei_received_msg_s { - ei_x_buff buf; - erlang_msg msg; -}; -typedef struct ei_received_msg_s ei_received_msg_t; -struct ei_event_binding_s { - char id[SWITCH_UUID_FORMATTED_LENGTH + 1]; - switch_event_node_t *node; - switch_event_types_t type; - const char *subclass_name; - struct ei_event_binding_s *next; -}; -typedef struct ei_event_binding_s ei_event_binding_t; -struct ei_event_stream_s { - switch_memory_pool_t *pool; - ei_event_binding_t *bindings; - switch_queue_t *queue; - switch_socket_t *acceptor; - switch_pollset_t *pollset; - switch_pollfd_t *pollfd; - switch_socket_t *socket; - switch_mutex_t *socket_mutex; - switch_bool_t connected; - char remote_ip[48]; - uint16_t remote_port; - char local_ip[48]; - uint16_t local_port; - erlang_pid pid; - uint32_t flags; - struct ei_event_stream_s *next; -}; -typedef struct ei_event_stream_s ei_event_stream_t; -struct ei_node_s { - int nodefd; - switch_atomic_t pending_bgapi; - switch_atomic_t receive_handlers; - switch_memory_pool_t *pool; - ei_event_stream_t *event_streams; - switch_mutex_t *event_streams_mutex; - switch_queue_t *send_msgs; - switch_queue_t *received_msgs; - char *peer_nodename; - switch_time_t created_time; - switch_socket_t *socket; - char remote_ip[48]; - uint16_t remote_port; - char local_ip[48]; - uint16_t local_port; - uint32_t flags; - struct ei_node_s *next; -}; -typedef struct ei_node_s ei_node_t; -struct globals_s { - switch_memory_pool_t *pool; - switch_atomic_t threads; - switch_socket_t *acceptor; - struct ei_cnode_s ei_cnode; - switch_thread_rwlock_t *ei_nodes_lock; - ei_node_t *ei_nodes; - switch_xml_binding_t *config_fetch_binding; - switch_xml_binding_t *directory_fetch_binding; - switch_xml_binding_t *dialplan_fetch_binding; - switch_xml_binding_t *chatplan_fetch_binding; - switch_xml_binding_t *channels_fetch_binding; - switch_hash_t *event_filter; - int epmdfd; - int num_worker_threads; - switch_bool_t nat_map; - switch_bool_t ei_shortname; - int ei_compat_rel; - char *ip; - char *hostname; - char *ei_cookie; - char *ei_nodename; - char *kazoo_var_prefix; - int var_prefix_length; - uint32_t flags; - int send_all_headers; - int send_all_private_headers; - int connection_timeout; - int receive_timeout; - int receive_msg_preallocate; - int event_stream_preallocate; - int send_msg_batch; - short event_stream_framing; - switch_port_t port; - int config_filters_fetched; - int io_fault_tolerance; -}; -typedef struct globals_s globals_t; -extern globals_t kazoo_globals; - -/* kazoo_node.c */ -switch_status_t new_kazoo_node(int nodefd, ErlConnect *conn); - -/* kazoo_event_stream.c */ -ei_event_stream_t *find_event_stream(ei_event_stream_t *event_streams, const erlang_pid *from); -ei_event_stream_t *new_event_stream(ei_event_stream_t **event_streams, const erlang_pid *from); -switch_status_t remove_event_stream(ei_event_stream_t **event_streams, const erlang_pid *from); -switch_status_t remove_event_streams(ei_event_stream_t **event_streams); -unsigned long get_stream_port(const ei_event_stream_t *event_stream); -switch_status_t add_event_binding(ei_event_stream_t *event_stream, const switch_event_types_t event_type, const char *subclass_name); -switch_status_t remove_event_binding(ei_event_stream_t *event_stream, const switch_event_types_t event_type, const char *subclass_name); -switch_status_t remove_event_bindings(ei_event_stream_t *event_stream); - -/* kazoo_fetch_agent.c */ -switch_status_t bind_fetch_agents(); -switch_status_t unbind_fetch_agents(); -switch_status_t remove_xml_clients(ei_node_t *ei_node); -switch_status_t add_fetch_handler(ei_node_t *ei_node, erlang_pid *from, switch_xml_binding_t *binding); -switch_status_t remove_fetch_handlers(ei_node_t *ei_node, erlang_pid *from); -switch_status_t fetch_reply(char *uuid_str, char *xml_str, switch_xml_binding_t *binding); -switch_status_t handle_api_command_streams(ei_node_t *ei_node, switch_stream_handle_t *stream); - -/* kazoo_utils.c */ -void close_socket(switch_socket_t **sock); -void close_socketfd(int *sockfd); -switch_socket_t *create_socket_with_port(switch_memory_pool_t *pool, switch_port_t port); -switch_socket_t *create_socket(switch_memory_pool_t *pool); -switch_status_t create_ei_cnode(const char *ip_addr, const char *name, struct ei_cnode_s *ei_cnode); -switch_status_t ei_compare_pids(const erlang_pid *pid1, const erlang_pid *pid2); -void ei_encode_switch_event_headers(ei_x_buff *ebuf, switch_event_t *event); -void ei_encode_switch_event_headers_2(ei_x_buff *ebuf, switch_event_t *event, int decode); -void ei_link(ei_node_t *ei_node, erlang_pid * from, erlang_pid * to); -void ei_encode_switch_event(ei_x_buff * ebuf, switch_event_t *event); -int ei_helper_send(ei_node_t *ei_node, erlang_pid* to, ei_x_buff *buf); -int ei_decode_atom_safe(char *buf, int *index, char *dst); -int ei_decode_string_or_binary_limited(char *buf, int *index, int maxsize, char *dst); -int ei_decode_string_or_binary(char *buf, int *index, char **dst); -switch_hash_t *create_default_filter(); /* kazoo_commands.c */ void add_kz_commands(switch_loadable_module_interface_t **module_interface, switch_api_interface_t *api_interface); @@ -169,9 +34,23 @@ void add_kz_commands(switch_loadable_module_interface_t **module_interface, swit /* kazoo_dptools.c */ void add_kz_dptools(switch_loadable_module_interface_t **module_interface, switch_application_interface_t *app_interface); -#define _ei_x_encode_string(buf, string) { ei_x_encode_binary(buf, string, strlen(string)); } +/* kazoo_api.c */ +void add_cli_api(switch_loadable_module_interface_t **module_interface, switch_api_interface_t *api_interface); +void remove_cli_api(); + +/* kazoo_utils.c */ +char *kazoo_expand_header(switch_memory_pool_t *pool, switch_event_t *event, char *val); +char* switch_event_get_first_of(switch_event_t *event, const char *list[]); +SWITCH_DECLARE(switch_status_t) switch_event_add_variable_name_printf(switch_event_t *event, switch_stack_t stack, const char *val, const char *fmt, ...); +void kz_xml_process(switch_xml_t cfg); + +/* kazoo_tweaks.c */ +void kz_tweaks_start(); +void kz_tweaks_stop(); + +SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown); -void fetch_config_filters(); /* For Emacs: * Local Variables: From 233481c32efadb1782684dcf45c59809eb3fe157 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 24 Aug 2017 22:52:11 +0300 Subject: [PATCH 019/264] FS-10611: [mod_commands] Add domain_data command to retrieve domain information --- .../applications/mod_commands/mod_commands.c | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index e592b3fabc..ea1b5161cf 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -1216,6 +1216,76 @@ SWITCH_STANDARD_API(in_group_function) return SWITCH_STATUS_SUCCESS; } +SWITCH_STANDARD_API(domain_data_function) +{ + switch_xml_t x_domain = NULL, xml_root = NULL, x_param, x_params; + int argc; + char *mydata = NULL, *argv[3], *key = NULL, *type = NULL, *domain, *dup_domain = NULL; + char delim = ' '; + const char *container = "params", *elem = "param"; + const char *result = NULL; + switch_event_t *params = NULL; + + if (zstr(cmd) || !(mydata = strdup(cmd))) { + goto end; + } + + if ((argc = switch_separate_string(mydata, delim, argv, (sizeof(argv) / sizeof(argv[0])))) < 3) { + goto end; + } + + domain = argv[0]; + type = argv[1]; + key = argv[2]; + + if (!domain) { + if ((dup_domain = switch_core_get_domain(SWITCH_TRUE))) { + domain = dup_domain; + } else { + domain = "cluecon.com"; + } + } + + switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "domain", domain); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "type", type); + + if (key && type && switch_xml_locate_domain(domain, params, &xml_root, &x_domain) == SWITCH_STATUS_SUCCESS) { + if (!strcmp(type, "attr")) { + const char *attr = switch_xml_attr_soft(x_domain, key); + result = attr; + goto end; + } + + if (!strcmp(type, "var")) { + container = "variables"; + elem = "variable"; + } + + if ((x_params = switch_xml_child(x_domain, container))) { + for (x_param = switch_xml_child(x_params, elem); x_param; x_param = x_param->next) { + const char *var = switch_xml_attr(x_param, "name"); + const char *val = switch_xml_attr(x_param, "value"); + + if (var && val && !strcasecmp(var, key)) { + result = val; + } + } + } + } + +end: + if (result) { + stream->write_function(stream, "%s", result); + } + + switch_safe_free(mydata); + switch_safe_free(dup_domain); + switch_event_destroy(¶ms); + + return SWITCH_STATUS_SUCCESS; +} + SWITCH_STANDARD_API(user_data_function) { switch_xml_t x_user = NULL, x_param, x_params; @@ -7264,6 +7334,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load) SWITCH_ADD_API(commands_api_interface, "console_complete_xml", "", console_complete_xml_function, ""); SWITCH_ADD_API(commands_api_interface, "create_uuid", "Create a uuid", uuid_function, UUID_SYNTAX); SWITCH_ADD_API(commands_api_interface, "db_cache", "Manage db cache", db_cache_function, "status"); + SWITCH_ADD_API(commands_api_interface, "domain_data", "Find domain data", domain_data_function, " [var|param|attr] "); SWITCH_ADD_API(commands_api_interface, "domain_exists", "Check if a domain exists", domain_exists_function, ""); SWITCH_ADD_API(commands_api_interface, "echo", "Echo", echo_function, ""); SWITCH_ADD_API(commands_api_interface, "event_channel_broadcast", "Broadcast", event_channel_broadcast_api_function, " "); From 6b1dccc3b269efd77461ead3f2ab6f9be7042163 Mon Sep 17 00:00:00 2001 From: Steve Underwood Date: Mon, 22 Jan 2018 15:19:38 +0000 Subject: [PATCH 020/264] Tweaks and feature additions to some of the spandsp tests. --- libs/spandsp/tests/Makefile.am | 4 +- libs/spandsp/tests/bell_mf_rx_tests.c | 123 ++++++++++++++++------ libs/spandsp/tests/dummy_modems_tests.c | 2 +- libs/spandsp/tests/pseudo_terminals.c | 2 +- libs/spandsp/tests/r2_mf_rx_tests.c | 132 ++++++++++++++++++------ libs/spandsp/tests/t4_tests.c | 34 ++++-- 6 files changed, 226 insertions(+), 71 deletions(-) diff --git a/libs/spandsp/tests/Makefile.am b/libs/spandsp/tests/Makefile.am index 55d84e4d99..4713d611d0 100644 --- a/libs/spandsp/tests/Makefile.am +++ b/libs/spandsp/tests/Makefile.am @@ -175,7 +175,7 @@ awgn_tests_SOURCES = awgn_tests.c awgn_tests_LDADD = $(LIBDIR) -lspandsp bell_mf_rx_tests_SOURCES = bell_mf_rx_tests.c -bell_mf_rx_tests_LDADD = $(LIBDIR) -lspandsp +bell_mf_rx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp bell_mf_tx_tests_SOURCES = bell_mf_tx_tests.c bell_mf_tx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp @@ -301,7 +301,7 @@ queue_tests_SOURCES = queue_tests.c queue_tests_LDADD = $(LIBDIR) -lspandsp r2_mf_rx_tests_SOURCES = r2_mf_rx_tests.c -r2_mf_rx_tests_LDADD = $(LIBDIR) -lspandsp +r2_mf_rx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp r2_mf_tx_tests_SOURCES = r2_mf_tx_tests.c r2_mf_tx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp diff --git a/libs/spandsp/tests/bell_mf_rx_tests.c b/libs/spandsp/tests/bell_mf_rx_tests.c index 31fbd4068a..3160c6d765 100644 --- a/libs/spandsp/tests/bell_mf_rx_tests.c +++ b/libs/spandsp/tests/bell_mf_rx_tests.c @@ -45,12 +45,14 @@ a fair test of performance in a real PSTN channel. #include #include #include +#include #include #include #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #include "spandsp.h" +#include "spandsp-sim.h" /* Basic Bell MF specs: * @@ -75,6 +77,8 @@ a fair test of performance in a real PSTN channel. #define MF_PAUSE (68*8) #define MF_CYCLE (MF_DURATION + MF_PAUSE) +#define SAMPLES_PER_CHUNK 160 + /*! MF tone descriptor for tests. */ @@ -115,6 +119,10 @@ static char bell_mf_tone_codes[] = "1234567890CA*B#"; bool callback_ok; int callback_roll; +codec_munge_state_t *munge = NULL; + +char *decode_test_file = NULL; + static void my_mf_gen_init(float low_fudge, int low_level, float high_fudge, @@ -164,19 +172,6 @@ static int my_mf_generate(int16_t amp[], const char *digits) } /*- End of function --------------------------------------------------------*/ -static void codec_munge(int16_t amp[], int len) -{ - int i; - uint8_t alaw; - - for (i = 0; i < len; i++) - { - alaw = linear_to_alaw (amp[i]); - amp[i] = alaw_to_linear (alaw); - } -} -/*- End of function --------------------------------------------------------*/ - #define ALL_POSSIBLE_DIGITS "1234567890CA*B#" static void digit_delivery(void *data, const char *digits, int len) @@ -212,9 +207,8 @@ static void digit_delivery(void *data, const char *digits, int len) static int16_t amp[1000000]; -int main(int argc, char *argv[]) +static int test_tone_set(void) { - int duration; int i; int j; int len; @@ -227,11 +221,9 @@ int main(int argc, char *argv[]) int nminus; float rrb; float rcfo; - time_t now; bell_mf_rx_state_t *mf_state; awgn_state_t noise_source; - time(&now); mf_state = bell_mf_rx_init(NULL, NULL, NULL); /* Test 1: Mitel's test 1 isn't really a test. Its a calibration step, @@ -253,7 +245,7 @@ int main(int argc, char *argv[]) for (i = 0; i < 10; i++) { len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); bell_mf_rx(mf_state, amp, len); actual = bell_mf_rx_get(mf_state, buf, 128); if (actual != 1 || buf[0] != digit[0]) @@ -306,7 +298,7 @@ int main(int argc, char *argv[]) { my_mf_gen_init((float) i/1000.0, -17, 0.0, -17, 68, 68); len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); bell_mf_rx(mf_state, amp, len); nplus += bell_mf_rx_get(mf_state, buf, 128); } @@ -314,7 +306,7 @@ int main(int argc, char *argv[]) { my_mf_gen_init((float) i/1000.0, -17, 0.0, -17, 68, 68); len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); bell_mf_rx(mf_state, amp, len); nminus += bell_mf_rx_get(mf_state, buf, 128); } @@ -337,7 +329,7 @@ int main(int argc, char *argv[]) { my_mf_gen_init(0.0, -17, (float) i/1000.0, -17, 68, 68); len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); bell_mf_rx(mf_state, amp, len); nplus += bell_mf_rx_get(mf_state, buf, 128); } @@ -345,7 +337,7 @@ int main(int argc, char *argv[]) { my_mf_gen_init(0.0, -17, (float) i/1000.0, -17, 68, 68); len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); bell_mf_rx(mf_state, amp, len); nminus += bell_mf_rx_get(mf_state, buf, 128); } @@ -382,7 +374,7 @@ int main(int argc, char *argv[]) my_mf_gen_init(0.0, -5, 0.0, i/10, 68, 68); len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); bell_mf_rx(mf_state, amp, len); nplus += bell_mf_rx_get(mf_state, buf, 128); } @@ -397,7 +389,7 @@ int main(int argc, char *argv[]) my_mf_gen_init(0.0, i/10, 0.0, -5, 68, 68); len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); bell_mf_rx(mf_state, amp, len); nminus += bell_mf_rx_get(mf_state, buf, 128); } @@ -423,7 +415,7 @@ int main(int argc, char *argv[]) for (j = 0; j < 100; j++) { len = my_mf_generate(amp, ALL_POSSIBLE_DIGITS); - codec_munge(amp, len); + codec_munge(munge, amp, len); bell_mf_rx(mf_state, amp, len); if (bell_mf_rx_get(mf_state, buf, 128) != 15) break; @@ -464,7 +456,7 @@ int main(int argc, char *argv[]) for (j = 0; j < 500; j++) { len = my_mf_generate(amp, ALL_POSSIBLE_DIGITS); - codec_munge(amp, len); + codec_munge(munge, amp, len); bell_mf_rx(mf_state, amp, len); if (bell_mf_rx_get(mf_state, buf, 128) != 15) break; @@ -496,7 +488,7 @@ int main(int argc, char *argv[]) len = my_mf_generate(amp, ALL_POSSIBLE_DIGITS); for (sample = 0; sample < len; sample++) amp[sample] = sat_add16(amp[sample], awgn(&noise_source)); - codec_munge(amp, len); + codec_munge(munge, amp, len); bell_mf_rx(mf_state, amp, len); if (bell_mf_rx_get(mf_state, buf, 128) != 15) break; @@ -543,9 +535,82 @@ int main(int argc, char *argv[]) } bell_mf_rx_free(mf_state); printf(" Passed\n"); + return 0; +} +/*- End of function --------------------------------------------------------*/ - duration = time (NULL) - now; - printf("Tests passed in %ds\n", duration); +static void digit_delivery_decode(void *data, const char *digits, int len) +{ + int i; + + if (data != (void *) 0x12345678) + { + return; + } + for (i = 0; i < len; i++) + { + printf("Digit '%c'\n", digits[i]); + } +} +/*- End of function --------------------------------------------------------*/ + +static void decode_test(const char *test_file) +{ + int16_t amp[SAMPLES_PER_CHUNK]; + SNDFILE *inhandle; + bell_mf_rx_state_t *mf_state; + int samples; + + mf_state = bell_mf_rx_init(NULL, digit_delivery_decode, (void *) 0x12345678); + + /* We will decode the audio from a file. */ + if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) + { + fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file); + exit(2); + } + + while ((samples = sf_readf_short(inhandle, amp, SAMPLES_PER_CHUNK)) > 0) + { + codec_munge(munge, amp, samples); + bell_mf_rx(mf_state, amp, samples); + } +} +/*- End of function --------------------------------------------------------*/ + +int main(int argc, char *argv[]) +{ + time_t now; + time_t duration; + decode_test_file = NULL; + int opt; + + while ((opt = getopt(argc, argv, "d:")) != -1) + { + switch (opt) + { + case 'd': + decode_test_file = optarg; + break; + default: + //usage(); + exit(2); + break; + } + } + munge = codec_munge_init(MUNGE_CODEC_ULAW, 0); + if (decode_test_file) + { + decode_test(decode_test_file); + } + else + { + now = time(NULL); + test_tone_set(); + duration = time (NULL) - now; + printf("Tests passed in %lds\n", duration); + } + codec_munge_free(munge); return 0; } /*- End of function --------------------------------------------------------*/ diff --git a/libs/spandsp/tests/dummy_modems_tests.c b/libs/spandsp/tests/dummy_modems_tests.c index e72a3f8716..45d559aab6 100644 --- a/libs/spandsp/tests/dummy_modems_tests.c +++ b/libs/spandsp/tests/dummy_modems_tests.c @@ -150,7 +150,7 @@ static void terminal_callback(void *user_data, const uint8_t msg[], int len) printf("0x%x ", msg[i]); } printf("\n"); - at_interpreter(&s->at_state, msg, len); + at_interpreter(&s->at_state, (const char *) msg, len); } /*- End of function --------------------------------------------------------*/ diff --git a/libs/spandsp/tests/pseudo_terminals.c b/libs/spandsp/tests/pseudo_terminals.c index f651bbc847..16ae2d74e1 100644 --- a/libs/spandsp/tests/pseudo_terminals.c +++ b/libs/spandsp/tests/pseudo_terminals.c @@ -110,7 +110,7 @@ int pseudo_terminal_create(modem_t *modem) modem->stty = ttyname(modem->slave); #else #if defined(WIN32) - modem->slot = 4 + next_id++; /* need work here we start at COM4 for now*/ + modem->slot = 4 + next_id++; /* Need work here. We start at COM4 for now */ snprintf(modem->devlink, sizeof(modem->devlink), "COM%d", modem->slot); modem->master = CreateFile(modem->devlink, diff --git a/libs/spandsp/tests/r2_mf_rx_tests.c b/libs/spandsp/tests/r2_mf_rx_tests.c index da244336c5..3355677144 100644 --- a/libs/spandsp/tests/r2_mf_rx_tests.c +++ b/libs/spandsp/tests/r2_mf_rx_tests.c @@ -45,12 +45,14 @@ a fair test of performance in a real PSTN channel. #include #include #include +#include #include #include #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #include "spandsp.h" +#include "spandsp-sim.h" /* R2 tone generation specs. * Power: -11.5dBm +- 1dB @@ -80,6 +82,8 @@ a fair test of performance in a real PSTN channel. #define MF_PAUSE (68*8) #define MF_CYCLE (MF_DURATION + MF_PAUSE) +#define SAMPLES_PER_CHUNK 160 + /*! MF tone generator descriptor for tests. */ @@ -140,6 +144,10 @@ static char r2_mf_tone_codes[] = "1234567890BCDEF"; int callback_ok; int callback_roll; +codec_munge_state_t *munge = NULL; + +char *decode_test_file = NULL; + static void my_mf_gen_init(float low_fudge, int low_level, float high_fudge, @@ -187,19 +195,6 @@ static int my_mf_generate(int16_t amp[], char digit) } /*- End of function --------------------------------------------------------*/ -static void codec_munge(int16_t amp[], int len) -{ - int i; - uint8_t alaw; - - for (i = 0; i < len; i++) - { - alaw = linear_to_alaw (amp[i]); - amp[i] = alaw_to_linear (alaw); - } -} -/*- End of function --------------------------------------------------------*/ - static void digit_delivery(void *data, int digit, int level, int delay) { char ch; @@ -263,7 +258,7 @@ static int test_a_tone_set(int fwd) for (i = 0; i < 10; i++) { len = my_mf_generate(amp, digit); - codec_munge (amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); actual = r2_mf_rx_get(mf_state); if (actual != digit) @@ -315,7 +310,7 @@ static int test_a_tone_set(int fwd) { my_mf_gen_init((float) i/1000.0, -17, 0.0, -17, 68, fwd); len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); if (r2_mf_rx_get(mf_state) == digit) nplus++; @@ -324,7 +319,7 @@ static int test_a_tone_set(int fwd) { my_mf_gen_init((float) i/1000.0, -17, 0.0, -17, 68, fwd); len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); if (r2_mf_rx_get(mf_state) == digit) nminus++; @@ -348,7 +343,7 @@ static int test_a_tone_set(int fwd) { my_mf_gen_init(0.0, -17, (float) i/1000.0, -17, 68, fwd); len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); if (r2_mf_rx_get(mf_state) == digit) nplus++; @@ -357,7 +352,7 @@ static int test_a_tone_set(int fwd) { my_mf_gen_init(0.0, -17, (float) i/1000.0, -17, 68, fwd); len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); if (r2_mf_rx_get(mf_state) == digit) nminus++; @@ -394,7 +389,7 @@ static int test_a_tone_set(int fwd) my_mf_gen_init(0.0, -5, 0.0, i/10, 68, fwd); len = my_mf_generate(amp, digit); - codec_munge (amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); if (r2_mf_rx_get(mf_state) == digit) nplus++; @@ -410,7 +405,7 @@ static int test_a_tone_set(int fwd) my_mf_gen_init(0.0, i/10, 0.0, -5, 68, fwd); len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); if (r2_mf_rx_get(mf_state) == digit) nminus++; @@ -440,7 +435,7 @@ static int test_a_tone_set(int fwd) for (j = 0; j < 100; j++) { len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); if (r2_mf_rx_get(mf_state) != digit) break; @@ -483,7 +478,7 @@ static int test_a_tone_set(int fwd) for (j = 0; j < 500; j++) { len = my_mf_generate(amp, digit); - codec_munge(amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); if (r2_mf_rx_get(mf_state) != digit) break; @@ -520,7 +515,7 @@ static int test_a_tone_set(int fwd) len = my_mf_generate(amp, digit); for (sample = 0; sample < len; sample++) amp[sample] = sat_add16(amp[sample], awgn(noise_source)); - codec_munge(amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); if (r2_mf_rx_get(mf_state) != digit) break; @@ -553,13 +548,13 @@ static int test_a_tone_set(int fwd) len = my_mf_generate(amp, digit); for (sample = 0; sample < len; sample++) amp[sample] = sat_add16(amp[sample], awgn(noise_source)); - codec_munge(amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); len = 160; memset(amp, '\0', len*sizeof(int16_t)); for (sample = 0; sample < len; sample++) amp[sample] = sat_add16(amp[sample], awgn(noise_source)); - codec_munge(amp, len); + codec_munge(munge, amp, len); r2_mf_rx(mf_state, amp, len); } awgn_free(noise_source); @@ -581,18 +576,91 @@ static int test_a_tone_set(int fwd) } /*- End of function --------------------------------------------------------*/ +static void digit_delivery_fwd(void *data, int digit, int level, int delay) +{ + if (data != (void *) 0x12345678) + { + callback_ok = false; + return; + } + printf("FWD '%c' %d %d\n", (digit == 0) ? '-' : digit, level, delay); +} +/*- End of function --------------------------------------------------------*/ + +static void digit_delivery_bwd(void *data, int digit, int level, int delay) +{ + if (data != (void *) 0x12345678) + { + callback_ok = false; + return; + } + printf("BWD '%c' %d %d\n", (digit == 0) ? '-' : digit, level, delay); +} +/*- End of function --------------------------------------------------------*/ + +static void decode_test(const char *test_file) +{ + int16_t amp[SAMPLES_PER_CHUNK]; + SNDFILE *inhandle; + r2_mf_rx_state_t *mf_fwd_state; + r2_mf_rx_state_t *mf_bwd_state; + int samples; + + mf_fwd_state = r2_mf_rx_init(NULL, true, digit_delivery_fwd, (void *) 0x12345678); + mf_bwd_state = r2_mf_rx_init(NULL, false, digit_delivery_bwd, (void *) 0x12345678); + + /* We will decode the audio from a file. */ + if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) + { + fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file); + exit(2); + } + + while ((samples = sf_readf_short(inhandle, amp, SAMPLES_PER_CHUNK)) > 0) + { + codec_munge(munge, amp, samples); + r2_mf_rx(mf_fwd_state, amp, samples); + r2_mf_rx(mf_bwd_state, amp, samples); + } +} +/*- End of function --------------------------------------------------------*/ + int main(int argc, char *argv[]) { time_t now; time_t duration; + decode_test_file = NULL; + int opt; - now = time(NULL); - printf("R2 forward tones\n"); - test_a_tone_set(true); - printf("R2 backward tones\n"); - test_a_tone_set(false); - duration = time(NULL) - now; - printf("Tests passed in %lds\n", duration); + while ((opt = getopt(argc, argv, "d:")) != -1) + { + switch (opt) + { + case 'd': + decode_test_file = optarg; + break; + default: + //usage(); + exit(2); + break; + } + } + munge = codec_munge_init(MUNGE_CODEC_ALAW, 0); + if (decode_test_file) + { + decode_test(decode_test_file); + } + else + { + now = time(NULL); + printf("R2 forward tones\n"); + test_a_tone_set(true); + printf("R2 backward tones\n"); + test_a_tone_set(false); + duration = time(NULL) - now; + printf("Tests passed in %lds\n", duration); + } + codec_munge_free(munge); return 0; } /*- End of function --------------------------------------------------------*/ diff --git a/libs/spandsp/tests/t4_tests.c b/libs/spandsp/tests/t4_tests.c index 4599e0c449..f8e1cfe367 100644 --- a/libs/spandsp/tests/t4_tests.c +++ b/libs/spandsp/tests/t4_tests.c @@ -210,6 +210,8 @@ int main(int argc, char *argv[]) int end_marks; int res; int compression; + int x_resolution; + int y_resolution; int compression_step; int min_row_bits; int block_size; @@ -224,6 +226,7 @@ int main(int argc, char *argv[]) int i; int bit_error_rate; int tests_failed; + int match_pos; bool restart_pages; bool add_page_headers; bool overlay_page_headers; @@ -236,6 +239,8 @@ int main(int argc, char *argv[]) tests_failed = 0; compression = -1; compression_step = 0; + x_resolution = -1; + y_resolution = -1; add_page_headers = false; overlay_page_headers = false; restart_pages = false; @@ -248,7 +253,7 @@ int main(int argc, char *argv[]) block_size = 1; bit_error_rate = 0; dump_as_xxx = false; - while ((opt = getopt(argc, argv, "b:c:d:ehHri:m:t:x")) != -1) + while ((opt = getopt(argc, argv, "b:c:d:ehHrR:i:m:t:x")) != -1) { switch (opt) { @@ -328,6 +333,20 @@ int main(int argc, char *argv[]) case 'r': restart_pages = true; break; + case 'R': + if (strcmp(optarg, "standard") == 0) + { + y_resolution = T4_Y_RESOLUTION_STANDARD; + } + else if (strcmp(optarg, "fine") == 0) + { + y_resolution = T4_Y_RESOLUTION_FINE; + } + else if (strcmp(optarg, "superfine") == 0) + { + y_resolution = T4_Y_RESOLUTION_SUPERFINE; + } + break; case 'i': in_file_name = optarg; break; @@ -352,6 +371,10 @@ int main(int argc, char *argv[]) { if (compression < 0) compression = T4_COMPRESSION_T4_1D; + if (x_resolution < 0) + x_resolution = T4_X_RESOLUTION_R8; + if (y_resolution < 0) + y_resolution = T4_Y_RESOLUTION_STANDARD; /* Receive end puts TIFF to a new file. We assume the receive width here. */ if ((receive_state = t4_rx_init(NULL, OUT_FILE_NAME, T4_COMPRESSION_T4_2D)) == NULL) { @@ -360,9 +383,8 @@ int main(int argc, char *argv[]) } span_log_set_level(t4_rx_get_logging_state(receive_state), SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); t4_rx_set_rx_encoding(receive_state, compression); - t4_rx_set_x_resolution(receive_state, T4_X_RESOLUTION_R8); - //t4_rx_set_y_resolution(receive_state, T4_Y_RESOLUTION_FINE); - t4_rx_set_y_resolution(receive_state, T4_Y_RESOLUTION_STANDARD); + t4_rx_set_x_resolution(receive_state, x_resolution); + t4_rx_set_y_resolution(receive_state, y_resolution); t4_rx_set_image_width(receive_state, XSIZE); t4_rx_start_page(receive_state); @@ -392,7 +414,7 @@ int main(int argc, char *argv[]) } end_of_page = t4_rx_put(receive_state, block, i); } - else if (sscanf(buf, "%*d:%*d:%*d.%*d T.38 Rx %d: IFP %x %x", &pkt_no, (unsigned int *) &bit, (unsigned int *) &bit) == 3) + else if (sscanf(buf, "%*d:%*d:%*d.%*d T.38 Rx %d: IFP %x %x %x %x %x %n", &pkt_no, (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit, &match_pos) == 6) { /* Useful for breaking up T.38 non-ECM logs */ if (pkt_no != last_pkt_no + 1) @@ -400,7 +422,7 @@ int main(int argc, char *argv[]) last_pkt_no = pkt_no; for (i = 0; i < 256; i++) { - if (sscanf(&buf[47 + 3*i], "%x", (unsigned int *) &bit) != 1) + if (sscanf(&buf[match_pos + 3*i], "%x", (unsigned int *) &bit) != 1) break; block[i] = bit_reverse8(bit); } From b185cc6e2471bd83e560f9c75a5828537848418e Mon Sep 17 00:00:00 2001 From: "Mathieu Bodjikian (MacBook-Pro-de-Mathieu.local)" Date: Wed, 24 Jan 2018 20:46:39 +0100 Subject: [PATCH 021/264] FS-10299: [mod_callcenter] Add an option to disable global database lock on mod_callcenter --- .../mod_callcenter/mod_callcenter.c | 69 ++++++++++++------- 1 file changed, 45 insertions(+), 24 deletions(-) diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index 71aa69179b..2a3ba25b35 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -429,6 +429,7 @@ static struct { switch_bool_t reserve_agents; switch_bool_t truncate_tiers; switch_bool_t truncate_agents; + switch_bool_t global_database_lock; int32_t threads; int32_t running; switch_mutex_t *mutex; @@ -605,10 +606,12 @@ char *cc_execute_sql2str(cc_queue_t *queue, switch_mutex_t *mutex, char *sql, ch switch_cache_db_handle_t *dbh = NULL; - if (mutex) { - switch_mutex_lock(mutex); - } else { - switch_mutex_lock(globals.mutex); + if (globals.global_database_lock) { + if (mutex) { + switch_mutex_lock(mutex); + } else { + switch_mutex_lock(globals.mutex); + } } if (!(dbh = cc_get_db_handle())) { @@ -621,10 +624,12 @@ char *cc_execute_sql2str(cc_queue_t *queue, switch_mutex_t *mutex, char *sql, ch end: switch_cache_db_release_db_handle(&dbh); - if (mutex) { - switch_mutex_unlock(mutex); - } else { - switch_mutex_unlock(globals.mutex); + if (globals.global_database_lock) { + if (mutex) { + switch_mutex_unlock(mutex); + } else { + switch_mutex_unlock(globals.mutex); + } } return ret; @@ -635,10 +640,12 @@ static switch_status_t cc_execute_sql(cc_queue_t *queue, char *sql, switch_mutex switch_cache_db_handle_t *dbh = NULL; switch_status_t status = SWITCH_STATUS_FALSE; - if (mutex) { - switch_mutex_lock(mutex); - } else { - switch_mutex_lock(globals.mutex); + if (globals.global_database_lock) { + if (mutex) { + switch_mutex_lock(mutex); + } else { + switch_mutex_lock(globals.mutex); + } } if (!(dbh = cc_get_db_handle())) { @@ -652,10 +659,12 @@ end: switch_cache_db_release_db_handle(&dbh); - if (mutex) { - switch_mutex_unlock(mutex); - } else { - switch_mutex_unlock(globals.mutex); + if (globals.global_database_lock) { + if (mutex) { + switch_mutex_unlock(mutex); + } else { + switch_mutex_unlock(globals.mutex); + } } return status; @@ -667,10 +676,12 @@ static switch_bool_t cc_execute_sql_callback(cc_queue_t *queue, switch_mutex_t * char *errmsg = NULL; switch_cache_db_handle_t *dbh = NULL; - if (mutex) { - switch_mutex_lock(mutex); - } else { - switch_mutex_lock(globals.mutex); + if (globals.global_database_lock) { + if (mutex) { + switch_mutex_lock(mutex); + } else { + switch_mutex_lock(globals.mutex); + } } if (!(dbh = cc_get_db_handle())) { @@ -689,10 +700,12 @@ end: switch_cache_db_release_db_handle(&dbh); - if (mutex) { - switch_mutex_unlock(mutex); - } else { - switch_mutex_unlock(globals.mutex); + if (globals.global_database_lock) { + if (mutex) { + switch_mutex_unlock(mutex); + } else { + switch_mutex_unlock(globals.mutex); + } } return ret; @@ -1461,6 +1474,7 @@ static switch_status_t load_config(void) switch_mutex_lock(globals.mutex); globals.core_uuid = switch_core_get_uuid(); + globals.global_database_lock = SWITCH_TRUE; if ((settings = switch_xml_child(cfg, "settings"))) { for (param = switch_xml_child(settings, "param"); param; param = param->next) { char *var = (char *) switch_xml_attr_soft(param, "name"); @@ -1478,6 +1492,8 @@ static switch_status_t load_config(void) globals.truncate_tiers = switch_true(val); } else if (!strcasecmp(var, "truncate-agents-on-load")) { globals.truncate_agents = switch_true(val); + } else if (!strcasecmp(var, "global-database-lock")) { + globals.global_database_lock = switch_true(val); } } } @@ -1489,6 +1505,11 @@ static switch_status_t load_config(void) } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Reserving Agents before offering calls.\n"); } + + if (!globals.global_database_lock) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Disabling global database lock\n"); + } + /* Initialize database */ if (!(dbh = cc_get_db_handle())) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot open DB!\n"); From 19e543ba3db94d8115f11b078935a2f762706850 Mon Sep 17 00:00:00 2001 From: Italo Rossi Date: Thu, 25 Jan 2018 10:49:53 -0300 Subject: [PATCH 022/264] FS-10521 FS-10612 [mod_callcenter] Member exit reason set to EXIT_WITH_KEY when it should be TIMEOUT and only set EXIT_WITH_KEY if the key pressed is set at cc_exit_keys --- src/mod/applications/mod_callcenter/mod_callcenter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index 71aa69179b..e3d9194129 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -3102,11 +3102,12 @@ SWITCH_STANDARD_APP(callcenter_function) if (moh_valid && moh_expanded) { switch_status_t status = switch_ivr_play_file(member_session, NULL, moh_expanded, &args); + switch_bool_t exiting_with_key = ht.exit_keys && *(ht.exit_keys) && !zstr(&ht.dtmf) && strchr(ht.exit_keys, ht.dtmf); if (status == SWITCH_STATUS_FALSE /* Invalid Recording */ && SWITCH_READ_ACCEPTABLE(status)) { /* Sadly, there doesn't seem to be a return to switch_ivr_play_file that tell you the file wasn't found. FALSE also mean that the channel got switch to BRAKE state, so we check for read acceptable */ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session), SWITCH_LOG_WARNING, "Couldn't play file '%s', continuing wait with no audio\n", cur_moh); moh_valid = SWITCH_FALSE; - } else if (status == SWITCH_STATUS_BREAK) { + } else if ((status == SWITCH_STATUS_BREAK) && exiting_with_key) { char buf[2] = { ht.dtmf, 0 }; switch_channel_set_variable(member_channel, "cc_exit_key", buf); h->member_cancel_reason = CC_MEMBER_CANCEL_REASON_EXIT_WITH_KEY; @@ -3115,7 +3116,9 @@ SWITCH_STANDARD_APP(callcenter_function) break; } } else { - if ((switch_ivr_collect_digits_callback(member_session, &args, 0, 0)) == SWITCH_STATUS_BREAK) { + switch_status_t status = switch_ivr_collect_digits_callback(member_session, &args, 0, 0); + switch_bool_t exiting_with_key = ht.exit_keys && *(ht.exit_keys) && !zstr(&ht.dtmf) && strchr(ht.exit_keys, ht.dtmf); + if ((status == SWITCH_STATUS_BREAK) && exiting_with_key) { char buf[2] = { ht.dtmf, 0 }; switch_channel_set_variable(member_channel, "cc_exit_key", buf); h->member_cancel_reason = CC_MEMBER_CANCEL_REASON_EXIT_WITH_KEY; From be0c10d2e4715a42440665338993e047c960320e Mon Sep 17 00:00:00 2001 From: areski Date: Thu, 25 Jan 2018 16:40:58 +0100 Subject: [PATCH 023/264] [fix](verto_communicator) add grunt-cli dependency to packages.json --- html5/verto/verto_communicator/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/html5/verto/verto_communicator/package.json b/html5/verto/verto_communicator/package.json index de23baa785..28b4d9536a 100644 --- a/html5/verto/verto_communicator/package.json +++ b/html5/verto/verto_communicator/package.json @@ -8,6 +8,7 @@ "browser-sync": "^2.8.2", "connect-logger": "0.0.1", "grunt": "^0.4.5", + "grunt-cli": "^1.2.0", "grunt-browser-sync": "^2.1.2", "grunt-concurrent": "^1.0.0", "grunt-contrib-clean": "^0.6.0", From 87bb7cb5fb6f9fc2ef288b5c3560a85366acead4 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 25 Jan 2018 15:51:44 -0600 Subject: [PATCH 024/264] Revert "FS-10820 [mod_kazoo] eventstream configuration" This reverts commit bb4499ec24bd7a5cadb90eab1b1a05515d38eaa2. This commit breaks the build. Please correct and re-submit --- src/mod/event_handlers/mod_kazoo/Makefile.am | 14 +- .../event_handlers/mod_kazoo/kazoo.conf.xml | 953 ----------------- src/mod/event_handlers/mod_kazoo/kazoo_api.c | 396 ------- .../event_handlers/mod_kazoo/kazoo_commands.c | 21 +- .../event_handlers/mod_kazoo/kazoo_config.c | 535 ---------- .../event_handlers/mod_kazoo/kazoo_config.h | 62 -- .../event_handlers/mod_kazoo/kazoo_dptools.c | 199 +--- src/mod/event_handlers/mod_kazoo/kazoo_ei.h | 262 ----- .../mod_kazoo/kazoo_ei_config.c | 543 ---------- .../event_handlers/mod_kazoo/kazoo_ei_utils.c | 996 ------------------ .../mod_kazoo/kazoo_event_stream.c | 235 ++--- .../mod_kazoo/kazoo_fetch_agent.c | 180 +--- .../event_handlers/mod_kazoo/kazoo_fields.h | 195 ---- .../event_handlers/mod_kazoo/kazoo_message.c | 458 -------- .../event_handlers/mod_kazoo/kazoo_message.h | 65 -- src/mod/event_handlers/mod_kazoo/kazoo_node.c | 221 +--- .../event_handlers/mod_kazoo/kazoo_tweaks.c | 502 --------- .../event_handlers/mod_kazoo/kazoo_utils.c | 701 ++++++++++-- src/mod/event_handlers/mod_kazoo/mod_kazoo.c | 687 +++++++++++- src/mod/event_handlers/mod_kazoo/mod_kazoo.h | 163 ++- 20 files changed, 1670 insertions(+), 5718 deletions(-) delete mode 100644 src/mod/event_handlers/mod_kazoo/kazoo.conf.xml delete mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_api.c delete mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_config.c delete mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_config.h delete mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_ei.h delete mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c delete mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c delete mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_fields.h delete mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_message.c delete mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_message.h delete mode 100644 src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c diff --git a/src/mod/event_handlers/mod_kazoo/Makefile.am b/src/mod/event_handlers/mod_kazoo/Makefile.am index ed2eec7b9c..53fd7112e1 100644 --- a/src/mod/event_handlers/mod_kazoo/Makefile.am +++ b/src/mod/event_handlers/mod_kazoo/Makefile.am @@ -4,23 +4,11 @@ MODNAME=mod_kazoo if HAVE_ERLANG mod_LTLIBRARIES = mod_kazoo.la -mod_kazoo_la_SOURCES = mod_kazoo.c kazoo_utils.c kazoo_dptools.c kazoo_tweaks.c -mod_kazoo_la_SOURCES += kazoo_api.c kazoo_commands.c kazoo_config.c -mod_kazoo_la_SOURCES += kazoo_message.c -mod_kazoo_la_SOURCES += kazoo_ei_config.c kazoo_ei_utils.c kazoo_event_stream.c -mod_kazoo_la_SOURCES += kazoo_fetch_agent.c kazoo_node.c - +mod_kazoo_la_SOURCES = mod_kazoo.c kazoo_utils.c kazoo_node.c kazoo_event_stream.c kazoo_fetch_agent.c kazoo_commands.c kazoo_dptools.c mod_kazoo_la_CFLAGS = $(AM_CFLAGS) @ERLANG_CFLAGS@ -D_REENTRANT mod_kazoo_la_LIBADD = $(switch_builddir)/libfreeswitch.la mod_kazoo_la_LDFLAGS = -avoid-version -module -no-undefined -shared @ERLANG_LDFLAGS@ -mod_kazoo.la: kazoo_definitions.h $(mod_kazoo_la_OBJECTS) $(mod_kazoo_la_DEPENDENCIES) $(EXTRA_mod_kazoo_la_DEPENDENCIES) - $(AM_V_CCLD)$(mod_kazoo_la_LINK) $(am_mod_kazoo_la_rpath) $(mod_kazoo_la_OBJECTS) $(mod_kazoo_la_LIBADD) $(LIBS) - - -kazoo_definitions.h: - xxd -i kazoo.conf.xml > kazoo_definitions.h - else install: error all: error diff --git a/src/mod/event_handlers/mod_kazoo/kazoo.conf.xml b/src/mod/event_handlers/mod_kazoo/kazoo.conf.xml deleted file mode 100644 index 7a5fdb4c7b..0000000000 --- a/src/mod/event_handlers/mod_kazoo/kazoo.conf.xml +++ /dev/null @@ -1,953 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_api.c b/src/mod/event_handlers/mod_kazoo/kazoo_api.c deleted file mode 100644 index 09d3d05419..0000000000 --- a/src/mod/event_handlers/mod_kazoo/kazoo_api.c +++ /dev/null @@ -1,396 +0,0 @@ -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2012, Anthony Minessale II - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * - * The Initial Developer of the Original Code is - * Anthony Minessale II - * Portions created by the Initial Developer are Copyright (C) - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Karl Anderson - * Darren Schreiber - * - * - * mod_kazoo.c -- Socket Controlled Event Handler - * - */ -#include "mod_kazoo.h" - -#define KAZOO_DESC "kazoo information" -#define KAZOO_SYNTAX " []" - -#define API_COMMAND_DISCONNECT 0 -#define API_COMMAND_REMOTE_IP 1 -#define API_COMMAND_STREAMS 2 -#define API_COMMAND_BINDINGS 3 - - -static switch_status_t api_erlang_status(switch_stream_handle_t *stream) { - switch_sockaddr_t *sa; - uint16_t port; - char ipbuf[48]; - const char *ip_addr; - ei_node_t *ei_node; - - switch_socket_addr_get(&sa, SWITCH_FALSE, kazoo_globals.acceptor); - - port = switch_sockaddr_get_port(sa); - ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); - - stream->write_function(stream, "Running %s\n", VERSION); - stream->write_function(stream, "Listening for new Erlang connections on %s:%u with cookie %s\n", ip_addr, port, kazoo_globals.ei_cookie); - stream->write_function(stream, "Registered as Erlang node %s, visible as %s\n", kazoo_globals.ei_cnode.thisnodename, kazoo_globals.ei_cnode.thisalivename); - - if (kazoo_globals.ei_compat_rel) { - stream->write_function(stream, "Using Erlang compatibility mode: %d\n", kazoo_globals.ei_compat_rel); - } - - switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); - ei_node = kazoo_globals.ei_nodes; - if (!ei_node) { - stream->write_function(stream, "No erlang nodes connected\n"); - } else { - stream->write_function(stream, "Connected to:\n"); - while(ei_node != NULL) { - unsigned int year, day, hour, min, sec, delta; - - delta = (switch_micro_time_now() - ei_node->created_time) / 1000000; - sec = delta % 60; - min = delta / 60 % 60; - hour = delta / 3600 % 24; - day = delta / 86400 % 7; - year = delta / 31556926 % 12; - stream->write_function(stream, " %s (%s:%d) up %d years, %d days, %d hours, %d minutes, %d seconds\n" - ,ei_node->peer_nodename, ei_node->remote_ip, ei_node->remote_port, year, day, hour, min, sec); - ei_node = ei_node->next; - } - } - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t api_erlang_event_filter(switch_stream_handle_t *stream) { - switch_hash_index_t *hi = NULL; - int column = 0; - - for (hi = (switch_hash_index_t *)switch_core_hash_first_iter(kazoo_globals.event_filter, hi); hi; hi = switch_core_hash_next(&hi)) { - const void *key; - void *val; - switch_core_hash_this(hi, &key, NULL, &val); - stream->write_function(stream, "%-50s", (char *)key); - if (++column > 2) { - stream->write_function(stream, "\n"); - column = 0; - } - } - - if (++column > 2) { - stream->write_function(stream, "\n"); - column = 0; - } - - stream->write_function(stream, "%-50s", kazoo_globals.kazoo_var_prefix); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t api_erlang_nodes_list(switch_stream_handle_t *stream) { - ei_node_t *ei_node; - - switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); - ei_node = kazoo_globals.ei_nodes; - while(ei_node != NULL) { - stream->write_function(stream, "%s (%s)\n", ei_node->peer_nodename, ei_node->remote_ip); - ei_node = ei_node->next; - } - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t api_erlang_nodes_count(switch_stream_handle_t *stream) { - ei_node_t *ei_node; - int count = 0; - - switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); - ei_node = kazoo_globals.ei_nodes; - while(ei_node != NULL) { - count++; - ei_node = ei_node->next; - } - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - - stream->write_function(stream, "%d\n", count); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t api_complete_erlang_node(const char *line, const char *cursor, switch_console_callback_match_t **matches) { - switch_console_callback_match_t *my_matches = NULL; - switch_status_t status = SWITCH_STATUS_FALSE; - ei_node_t *ei_node; - - switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); - ei_node = kazoo_globals.ei_nodes; - while(ei_node != NULL) { - switch_console_push_match(&my_matches, ei_node->peer_nodename); - ei_node = ei_node->next; - } - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - - if (my_matches) { - *matches = my_matches; - status = SWITCH_STATUS_SUCCESS; - } - - return status; -} - -static switch_status_t handle_node_api_event_stream(ei_event_stream_t *event_stream, switch_stream_handle_t *stream) { - ei_event_binding_t *binding; - int column = 0; - - switch_mutex_lock(event_stream->socket_mutex); - if (event_stream->connected == SWITCH_FALSE) { - switch_sockaddr_t *sa; - uint16_t port; - char ipbuf[48] = {0}; - const char *ip_addr; - - switch_socket_addr_get(&sa, SWITCH_TRUE, event_stream->acceptor); - port = switch_sockaddr_get_port(sa); - ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); - - if (zstr(ip_addr)) { - ip_addr = kazoo_globals.ip; - } - - stream->write_function(stream, "%s:%d -> disconnected\n" - ,ip_addr, port); - } else { - stream->write_function(stream, "%s:%d -> %s:%d\n" - ,event_stream->local_ip, event_stream->local_port - ,event_stream->remote_ip, event_stream->remote_port); - } - - binding = event_stream->bindings; - while(binding != NULL) { - if (binding->type == SWITCH_EVENT_CUSTOM) { - stream->write_function(stream, "CUSTOM %-43s", binding->subclass_name); - } else { - stream->write_function(stream, "%-50s", switch_event_name(binding->type)); - } - - if (++column > 2) { - stream->write_function(stream, "\n"); - column = 0; - } - - binding = binding->next; - } - switch_mutex_unlock(event_stream->socket_mutex); - - if (!column) { - stream->write_function(stream, "\n"); - } else { - stream->write_function(stream, "\n\n"); - } - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t handle_node_api_event_streams(ei_node_t *ei_node, switch_stream_handle_t *stream) { - ei_event_stream_t *event_stream; - - switch_mutex_lock(ei_node->event_streams_mutex); - event_stream = ei_node->event_streams; - while(event_stream != NULL) { - handle_node_api_event_stream(event_stream, stream); - event_stream = event_stream->next; - } - switch_mutex_unlock(ei_node->event_streams_mutex); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t handle_node_api_command(ei_node_t *ei_node, switch_stream_handle_t *stream, uint32_t command) { - unsigned int year, day, hour, min, sec, delta; - - switch (command) { - case API_COMMAND_DISCONNECT: - stream->write_function(stream, "Disconnecting erlang node %s at managers request\n", ei_node->peer_nodename); - switch_clear_flag(ei_node, LFLAG_RUNNING); - break; - case API_COMMAND_REMOTE_IP: - delta = (switch_micro_time_now() - ei_node->created_time) / 1000000; - sec = delta % 60; - min = delta / 60 % 60; - hour = delta / 3600 % 24; - day = delta / 86400 % 7; - year = delta / 31556926 % 12; - - stream->write_function(stream, "Uptime %d years, %d days, %d hours, %d minutes, %d seconds\n", year, day, hour, min, sec); - stream->write_function(stream, "Local Address %s:%d\n", ei_node->local_ip, ei_node->local_port); - stream->write_function(stream, "Remote Address %s:%d\n", ei_node->remote_ip, ei_node->remote_port); - break; - case API_COMMAND_STREAMS: - handle_node_api_event_streams(ei_node, stream); - break; - case API_COMMAND_BINDINGS: - handle_api_command_streams(ei_node, stream); - break; - default: - break; - } - - return SWITCH_STATUS_SUCCESS; -} - -static switch_status_t api_erlang_node_command(switch_stream_handle_t *stream, const char *nodename, uint32_t command) { - ei_node_t *ei_node; - - switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); - ei_node = kazoo_globals.ei_nodes; - while(ei_node != NULL) { - int length = strlen(ei_node->peer_nodename); - - if (!strncmp(ei_node->peer_nodename, nodename, length)) { - handle_node_api_command(ei_node, stream, command); - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - return SWITCH_STATUS_SUCCESS; - } - - ei_node = ei_node->next; - } - switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); - - return SWITCH_STATUS_NOTFOUND; -} - -SWITCH_STANDARD_API(exec_api_cmd) -{ - char *argv[1024] = { 0 }; - int unknown_command = 1, argc = 0; - char *mycmd = NULL; - - const char *usage_string = "USAGE:\n" - "--------------------------------------------------------------------------------------------------------------------\n" - "erlang status - provides an overview of the current status\n" - "erlang event_filter - lists the event headers that will be sent to Erlang nodes\n" - "erlang nodes list - lists connected Erlang nodes (usefull for monitoring tools)\n" - "erlang nodes count - provides a count of connected Erlang nodes (usefull for monitoring tools)\n" - "erlang node disconnect - disconnects an Erlang node\n" - "erlang node connection - Shows the connection info\n" - "erlang node event_streams - lists the event streams for an Erlang node\n" - "erlang node fetch_bindings - lists the XML fetch bindings for an Erlang node\n" - "---------------------------------------------------------------------------------------------------------------------\n"; - - if (zstr(cmd)) { - stream->write_function(stream, "%s", usage_string); - return SWITCH_STATUS_SUCCESS; - } - - if (!(mycmd = strdup(cmd))) { - return SWITCH_STATUS_MEMERR; - } - - if (!(argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { - stream->write_function(stream, "%s", usage_string); - switch_safe_free(mycmd); - return SWITCH_STATUS_SUCCESS; - } - - if (zstr(argv[0])) { - stream->write_function(stream, "%s", usage_string); - switch_safe_free(mycmd); - return SWITCH_STATUS_SUCCESS; - } - - if (!strncmp(argv[0], "status", 6)) { - unknown_command = 0; - api_erlang_status(stream); - } else if (!strncmp(argv[0], "event_filter", 6)) { - unknown_command = 0; - api_erlang_event_filter(stream); - } else if (!strncmp(argv[0], "nodes", 6) && !zstr(argv[1])) { - if (!strncmp(argv[1], "list", 6)) { - unknown_command = 0; - api_erlang_nodes_list(stream); - } else if (!strncmp(argv[1], "count", 6)) { - unknown_command = 0; - api_erlang_nodes_count(stream); - } - } else if (!strncmp(argv[0], "node", 6) && !zstr(argv[1]) && !zstr(argv[2])) { - if (!strncmp(argv[2], "disconnect", 6)) { - unknown_command = 0; - api_erlang_node_command(stream, argv[1], API_COMMAND_DISCONNECT); - } else if (!strncmp(argv[2], "connection", 2)) { - unknown_command = 0; - api_erlang_node_command(stream, argv[1], API_COMMAND_REMOTE_IP); - } else if (!strncmp(argv[2], "event_streams", 6)) { - unknown_command = 0; - api_erlang_node_command(stream, argv[1], API_COMMAND_STREAMS); - } else if (!strncmp(argv[2], "fetch_bindings", 6)) { - unknown_command = 0; - api_erlang_node_command(stream, argv[1], API_COMMAND_BINDINGS); - } - } - - if (unknown_command) { - stream->write_function(stream, "%s", usage_string); - } - - switch_safe_free(mycmd); - return SWITCH_STATUS_SUCCESS; -} - -void add_cli_api(switch_loadable_module_interface_t **module_interface, switch_api_interface_t *api_interface) -{ - SWITCH_ADD_API(api_interface, "erlang", KAZOO_DESC, exec_api_cmd, KAZOO_SYNTAX); - switch_console_set_complete("add erlang status"); - switch_console_set_complete("add erlang event_filter"); - switch_console_set_complete("add erlang nodes list"); - switch_console_set_complete("add erlang nodes count"); - switch_console_set_complete("add erlang node ::erlang::node disconnect"); - switch_console_set_complete("add erlang node ::erlang::node connection"); - switch_console_set_complete("add erlang node ::erlang::node event_streams"); - switch_console_set_complete("add erlang node ::erlang::node fetch_bindings"); - switch_console_add_complete_func("::erlang::node", api_complete_erlang_node); - -} - -void remove_cli_api() -{ - switch_console_set_complete("del erlang"); - switch_console_del_complete_func("::erlang::node"); - -} - - -/* For Emacs: - * Local Variables: - * mode:c - * indent-tabs-mode:t - * tab-width:4 - * c-basic-offset:4 - * End: - * For VIM: - * vim:set softtabstop=4 shiftwidth=4 tabstop=4: - */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_commands.c b/src/mod/event_handlers/mod_kazoo/kazoo_commands.c index 5002558398..2494bb9495 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_commands.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_commands.c @@ -31,7 +31,6 @@ * */ #include "mod_kazoo.h" -#include #include #define UUID_SET_DESC "Set a variable" @@ -159,11 +158,6 @@ SWITCH_STANDARD_API(uuid_setvar_multi_function) { return SWITCH_STATUS_SUCCESS; } -static size_t body_callback(char *buffer, size_t size, size_t nitems, void *userdata) -{ - return size * nitems; -} - static size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata) { switch_event_t* event = (switch_event_t*)userdata; @@ -188,7 +182,6 @@ SWITCH_STANDARD_API(kz_http_put) switch_event_t *params = NULL; char *url = NULL; char *filename = NULL; - int delete = 0; switch_curl_slist_t *headers = NULL; /* optional linked-list of HTTP headers */ char *ext; /* file extension, used for MIME type identification */ @@ -286,8 +279,6 @@ SWITCH_STANDARD_API(kz_http_put) switch_curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-http-cache/1.0"); switch_curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, stream->param_event); switch_curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, header_callback); - switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, body_callback); - switch_curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0L); switch_curl_easy_perform(curl_handle); switch_curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &httpRes); @@ -295,24 +286,22 @@ SWITCH_STANDARD_API(kz_http_put) if (httpRes == 200 || httpRes == 201 || httpRes == 202 || httpRes == 204) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s saved to %s\n", filename, url); - switch_event_add_header(stream->param_event, SWITCH_STACK_BOTTOM, "API-Output", "%s saved to %s", filename, url); - stream->write_function(stream, "+OK %s saved to %s", filename, url); - delete = 1; + switch_event_add_header(stream->param_event, SWITCH_STACK_BOTTOM, "API-Output", "%s saved to %s\n", filename, url); + stream->write_function(stream, "+OK\n"); } else { error = switch_mprintf("Received HTTP error %ld trying to save %s to %s", httpRes, filename, url); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s\n", error); switch_event_add_header(stream->param_event, SWITCH_STACK_BOTTOM, "API-Error", "%s", error); switch_event_add_header(stream->param_event, SWITCH_STACK_BOTTOM, "API-HTTP-Error", "%ld", httpRes); - stream->write_function(stream, "-ERR %s", error); + stream->write_function(stream, "-ERR "); + stream->write_function(stream, error); + stream->write_function(stream, "\n"); status = SWITCH_STATUS_GENERR; } done: if (file_to_put) { fclose(file_to_put); - if(delete && kazoo_globals.delete_file_after_put) { - remove(filename); - } } if (headers) { diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_config.c b/src/mod/event_handlers/mod_kazoo/kazoo_config.c deleted file mode 100644 index f953bfc391..0000000000 --- a/src/mod/event_handlers/mod_kazoo/kazoo_config.c +++ /dev/null @@ -1,535 +0,0 @@ -/* -* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* Copyright (C) 2005-2012, Anthony Minessale II -* -* Version: MPL 1.1 -* -* The contents of this file are subject to the Mozilla Public License Version -* 1.1 (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* http://www.mozilla.org/MPL/ -* -* Software distributed under the License is distributed on an "AS IS" basis, -* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -* for the specific language governing rights and limitations under the -* License. -* -* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* -* The Initial Developer of the Original Code is -* Anthony Minessale II -* Portions created by the Initial Developer are Copyright (C) -* the Initial Developer. All Rights Reserved. -* -* Based on mod_skel by -* Anthony Minessale II -* -* Contributor(s): -* -* Daniel Bryars -* Tim Brown -* Anthony Minessale II -* William King -* Mike Jerris -* -* kazoo.c -- Sends FreeSWITCH events to an AMQP broker -* -*/ - -#include "mod_kazoo.h" - -static const char *LOG_LEVEL_NAMES[] = { - "SWITCH_LOG_DEBUG10", - "SWITCH_LOG_DEBUG9", - "SWITCH_LOG_DEBUG8", - "SWITCH_LOG_DEBUG7", - "SWITCH_LOG_DEBUG6", - "SWITCH_LOG_DEBUG5", - "SWITCH_LOG_DEBUG4", - "SWITCH_LOG_DEBUG3", - "SWITCH_LOG_DEBUG2", - "SWITCH_LOG_DEBUG1", - "SWITCH_LOG_DEBUG", - "SWITCH_LOG_INFO", - "SWITCH_LOG_NOTICE", - "SWITCH_LOG_WARNING", - "SWITCH_LOG_ERROR", - "SWITCH_LOG_CRIT", - "SWITCH_LOG_ALERT", - "SWITCH_LOG_CONSOLE", - "SWITCH_LOG_INVALID", - "SWITCH_LOG_UNINIT", - NULL -}; - -static const switch_log_level_t LOG_LEVEL_VALUES[] = { - SWITCH_LOG_DEBUG10, - SWITCH_LOG_DEBUG9, - SWITCH_LOG_DEBUG8, - SWITCH_LOG_DEBUG7, - SWITCH_LOG_DEBUG6, - SWITCH_LOG_DEBUG5, - SWITCH_LOG_DEBUG4, - SWITCH_LOG_DEBUG3, - SWITCH_LOG_DEBUG2, - SWITCH_LOG_DEBUG1, - SWITCH_LOG_DEBUG, - SWITCH_LOG_INFO, - SWITCH_LOG_NOTICE, - SWITCH_LOG_WARNING, - SWITCH_LOG_ERROR, - SWITCH_LOG_CRIT, - SWITCH_LOG_ALERT, - SWITCH_LOG_CONSOLE, - SWITCH_LOG_INVALID, - SWITCH_LOG_UNINIT -}; - -switch_log_level_t log_str2level(const char *str) -{ - int x = 0; - switch_log_level_t level = SWITCH_LOG_INVALID; - - if (switch_is_number(str)) { - x = atoi(str); - - if (x > SWITCH_LOG_INVALID) { - return SWITCH_LOG_INVALID - 1; - } else if (x < 0) { - return 0; - } else { - return x; - } - } - - - for (x = 0;; x++) { - if (!LOG_LEVEL_NAMES[x]) { - break; - } - - if (!strcasecmp(LOG_LEVEL_NAMES[x], str)) { - level = LOG_LEVEL_VALUES[x]; //(switch_log_level_t) x; - break; - } - } - - return level; -} - -switch_status_t kazoo_config_loglevels(switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_loglevels_ptr *ptr) -{ - switch_xml_t xml_level, xml_logging; - kazoo_loglevels_ptr loglevels = (kazoo_loglevels_ptr) switch_core_alloc(pool, sizeof(kazoo_loglevels_t)); - - loglevels->failed_log_level = SWITCH_LOG_ALERT; - loglevels->filtered_event_log_level = SWITCH_LOG_DEBUG1; - loglevels->filtered_field_log_level = SWITCH_LOG_DEBUG1; - loglevels->info_log_level = SWITCH_LOG_INFO; - loglevels->warn_log_level = SWITCH_LOG_WARNING; - loglevels->success_log_level = SWITCH_LOG_DEBUG; - loglevels->time_log_level = SWITCH_LOG_DEBUG1; - - if ((xml_logging = switch_xml_child(cfg, "logging")) != NULL) { - for (xml_level = switch_xml_child(xml_logging, "log"); xml_level; xml_level = xml_level->next) { - char *var = (char *) switch_xml_attr_soft(xml_level, "name"); - char *val = (char *) switch_xml_attr_soft(xml_level, "value"); - - if (!var) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "logging param missing 'name' attribute\n"); - continue; - } - - if (!val) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "logging param[%s] missing 'value' attribute\n", var); - continue; - } - - if (!strncmp(var, "success", 7)) { - loglevels->success_log_level = log_str2level(val); - } else if (!strncmp(var, "failed", 6)) { - loglevels->failed_log_level = log_str2level(val); - } else if (!strncmp(var, "info", 4)) { - loglevels->info_log_level = log_str2level(val); - } else if (!strncmp(var, "warn", 4)) { - loglevels->warn_log_level = log_str2level(val); - } else if (!strncmp(var, "time", 4)) { - loglevels->time_log_level = log_str2level(val); - } else if (!strncmp(var, "filtered-event", 14)) { - loglevels->filtered_event_log_level = log_str2level(val); - } else if (!strncmp(var, "filtered-field", 14)) { - loglevels->filtered_field_log_level = log_str2level(val); - } - } /* xml_level for loop */ - } - - *ptr = loglevels; - return SWITCH_STATUS_SUCCESS; - -} - -switch_status_t kazoo_config_filters(switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_filter_ptr *ptr) -{ - switch_xml_t filters, filter; -// char *routing_key = NULL; - kazoo_filter_ptr root = NULL, prv = NULL, cur = NULL; - - - if ((filters = switch_xml_child(cfg, "filters")) != NULL) { - for (filter = switch_xml_child(filters, "filter"); filter; filter = filter->next) { - const char *var = switch_xml_attr(filter, "name"); - const char *val = switch_xml_attr(filter, "value"); - const char *type = switch_xml_attr(filter, "type"); - const char *compare = switch_xml_attr(filter, "compare"); - cur = (kazoo_filter_ptr) switch_core_alloc(pool, sizeof(kazoo_filter)); - memset(cur, 0, sizeof(kazoo_filter)); - if(prv == NULL) { - root = prv = cur; - } else { - prv->next = cur; - prv = cur; - } - cur->type = FILTER_EXCLUDE; - cur->compare = FILTER_COMPARE_VALUE; - - if(var) - cur->name = switch_core_strdup(pool, var); - - if(val) - cur->value = switch_core_strdup(pool, val); - - if(type) { - if (!strncmp(type, "exclude", 7)) { - cur->type = FILTER_EXCLUDE; - } else if (!strncmp(type, "include", 7)) { - cur->type = FILTER_INCLUDE; - } - } - - if(compare) { - if (!strncmp(compare, "value", 7)) { - cur->compare = FILTER_COMPARE_VALUE; - } else if (!strncmp(compare, "prefix", 6)) { - cur->compare = FILTER_COMPARE_PREFIX; - } else if (!strncmp(compare, "list", 4)) { - cur->compare = FILTER_COMPARE_LIST; - } else if (!strncmp(compare, "exists", 6)) { - cur->compare = FILTER_COMPARE_EXISTS; - } else if (!strncmp(compare, "regex", 5)) { - cur->compare = FILTER_COMPARE_REGEX; - } - } - - if(cur->value == NULL) - cur->compare = FILTER_COMPARE_EXISTS; - - if(cur->compare == FILTER_COMPARE_LIST) { - cur->list.size = switch_separate_string(cur->value, '|', cur->list.value, MAX_LIST_FIELDS); - } - - } - - } - - *ptr = root; - - return SWITCH_STATUS_SUCCESS; - -} - -switch_status_t kazoo_config_field(kazoo_config_ptr definitions, switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_field_ptr *ptr) -{ - const char *var = switch_xml_attr(cfg, "name"); - const char *val = switch_xml_attr(cfg, "value"); - const char *as = switch_xml_attr(cfg, "as"); - const char *type = switch_xml_attr(cfg, "type"); - const char *exclude_prefix = switch_xml_attr(cfg, "exclude-prefix"); - const char *serialize_as = switch_xml_attr(cfg, "serialize-as"); - kazoo_field_ptr cur = (kazoo_field_ptr) switch_core_alloc(pool, sizeof(kazoo_field)); - cur->in_type = FIELD_NONE; - cur->out_type = JSON_NONE; - - if(var) - cur->name = switch_core_strdup(pool, var); - - if(val) - cur->value = switch_core_strdup(pool, val); - - if(as) - cur->as = switch_core_strdup(pool, as); - - if(type) { - if (!strncmp(type, "copy", 4)) { - cur->in_type = FIELD_COPY; - } else if (!strncmp(type, "static", 6)) { - cur->in_type = FIELD_STATIC; - } else if (!strncmp(type, "first-of", 8)) { - cur->in_type = FIELD_FIRST_OF; - } else if (!strncmp(type, "expand", 6)) { - cur->in_type = FIELD_EXPAND; - } else if (!strncmp(type, "prefix", 10)) { - cur->in_type = FIELD_PREFIX; - } else if (!strncmp(type, "group", 5)) { - cur->in_type = FIELD_GROUP; - } else if (!strncmp(type, "reference", 9)) { - cur->in_type = FIELD_REFERENCE; - } - } - - if(serialize_as) { - if (!strncmp(serialize_as, "string", 5)) { - cur->out_type = JSON_STRING; - } else if (!strncmp(serialize_as, "number", 6)) { - cur->out_type = JSON_NUMBER; - } else if (!strncmp(serialize_as, "boolean", 7)) { - cur->out_type = JSON_BOOLEAN; - } else if (!strncmp(serialize_as, "object", 6)) { - cur->out_type = JSON_OBJECT; - } else if (!strncmp(serialize_as, "raw", 6)) { - cur->out_type = JSON_RAW; - } - } - - if(exclude_prefix) - cur->exclude_prefix = switch_true(exclude_prefix); - - kazoo_config_filters(pool, cfg, &cur->filter); - kazoo_config_fields(definitions, pool, cfg, &cur->children); - - if(cur->children != NULL - && (cur->in_type == FIELD_STATIC) - && (cur->out_type == JSON_NONE) - ) { - cur->out_type = JSON_OBJECT; - } - if(cur->in_type == FIELD_NONE) { - cur->in_type = FIELD_COPY; - } - - if(cur->out_type == JSON_NONE) { - cur->out_type = JSON_STRING; - } - - if(cur->in_type == FIELD_FIRST_OF) { - cur->list.size = switch_separate_string(cur->value, '|', cur->list.value, MAX_LIST_FIELDS); - } - - if(cur->in_type == FIELD_REFERENCE) { - cur->ref = (kazoo_definition_ptr)switch_core_hash_find(definitions->hash, cur->name); - if(cur->ref == NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "referenced field %s not found\n", cur->name); - } - } - - *ptr = cur; - - return SWITCH_STATUS_SUCCESS; - -} - -switch_status_t kazoo_config_fields_loop(kazoo_config_ptr definitions, switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_field_ptr *ptr) -{ - switch_xml_t field; - kazoo_field_ptr root = NULL, prv = NULL; - - - for (field = switch_xml_child(cfg, "field"); field; field = field->next) { - kazoo_field_ptr cur = NULL; - kazoo_config_field(definitions, pool, field, &cur); - if(root == NULL) { - root = prv = cur; - } else { - prv->next = cur; - prv = cur; - } - } - - *ptr = root; - - return SWITCH_STATUS_SUCCESS; - -} - -switch_status_t kazoo_config_fields(kazoo_config_ptr definitions, switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_fields_ptr *ptr) -{ - switch_xml_t fields; -// char *routing_key = NULL; - kazoo_fields_ptr root = NULL; - - - if ((fields = switch_xml_child(cfg, "fields")) != NULL) { - const char *verbose = switch_xml_attr(fields, "verbose"); - root = (kazoo_fields_ptr) switch_core_alloc(pool, sizeof(kazoo_fields)); - root->verbose = SWITCH_TRUE; - if(verbose) { - root->verbose = switch_true(verbose); - } - - kazoo_config_fields_loop(definitions, pool, fields, &root->head); - - } - - *ptr = root; - - return SWITCH_STATUS_SUCCESS; - -} - -kazoo_config_ptr kazoo_config_event_handlers(kazoo_config_ptr definitions, switch_xml_t cfg) -{ - switch_xml_t xml_profiles = NULL, xml_profile = NULL; - kazoo_config_ptr profiles = NULL; - switch_memory_pool_t *pool = NULL; - - if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "error creating memory pool for producers\n"); - return NULL; - } - - profiles = switch_core_alloc(pool, sizeof(kazoo_config)); - profiles->pool = pool; - switch_core_hash_init(&profiles->hash); - - if ((xml_profiles = switch_xml_child(cfg, "event-handlers"))) { - if ((xml_profile = switch_xml_child(xml_profiles, "profile"))) { - for (; xml_profile; xml_profile = xml_profile->next) { - const char *name = switch_xml_attr(xml_profile, "name"); - if(name == NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "missing attr name\n" ); - continue; - } - kazoo_config_event_handler(definitions, profiles, xml_profile, NULL); - } - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Unable to locate a event-handler profile for kazoo\n" ); - } - } else { - destroy_config(&profiles); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unable to locate event-handlers section for kazoo\n" ); - } - - return profiles; - -} - -kazoo_config_ptr kazoo_config_fetch_handlers(kazoo_config_ptr definitions, switch_xml_t cfg) -{ - switch_xml_t xml_profiles = NULL, xml_profile = NULL; - kazoo_config_ptr profiles = NULL; - switch_memory_pool_t *pool = NULL; - - if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "error creating memory pool for producers\n"); - return NULL; - } - - profiles = switch_core_alloc(pool, sizeof(kazoo_config)); - profiles->pool = pool; - switch_core_hash_init(&profiles->hash); - - if ((xml_profiles = switch_xml_child(cfg, "fetch-handlers"))) { - if ((xml_profile = switch_xml_child(xml_profiles, "profile"))) { - for (; xml_profile; xml_profile = xml_profile->next) { - const char *name = switch_xml_attr(xml_profile, "name"); - if(name == NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "missing attr name\n" ); - continue; - } - kazoo_config_fetch_handler(definitions, profiles, xml_profile, NULL); - } - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Unable to locate a fetch-handler profile for kazoo\n" ); - } - } else { - destroy_config(&profiles); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unable to locate fetch-handlers section for kazoo\n" ); - } - - return profiles; - -} - - -switch_status_t kazoo_config_definition(kazoo_config_ptr root, switch_xml_t cfg) -{ - kazoo_definition_ptr definition = NULL; - char *name = (char *) switch_xml_attr_soft(cfg, "name"); - - if (zstr(name)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to load kazoo profile. Check definition missing name attr\n"); - return SWITCH_STATUS_GENERR; - } - - definition = switch_core_alloc(root->pool, sizeof(kazoo_definition)); - definition->name = switch_core_strdup(root->pool, name); - - kazoo_config_filters(root->pool, cfg, &definition->filter); - kazoo_config_fields_loop(root, root->pool, cfg, &definition->head); - - if ( switch_core_hash_insert(root->hash, name, (void *) definition) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to insert new definition [%s] into kazoo definitions hash\n", name); - return SWITCH_STATUS_GENERR; - } - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Definition[%s] Successfully configured\n", definition->name); - return SWITCH_STATUS_SUCCESS; -} - -kazoo_config_ptr kazoo_config_definitions(switch_xml_t cfg) -{ - switch_xml_t xml_definitions = NULL, xml_definition = NULL; - kazoo_config_ptr definitions = NULL; - switch_memory_pool_t *pool = NULL; - - if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "error creating memory pool for definitions\n"); - return NULL; - } - - definitions = switch_core_alloc(pool, sizeof(kazoo_config)); - definitions->pool = pool; - switch_core_hash_init(&definitions->hash); - - if ((xml_definitions = switch_xml_child(cfg, "definitions"))) { - if ((xml_definition = switch_xml_child(xml_definitions, "definition"))) { - for (; xml_definition; xml_definition = xml_definition->next) { - kazoo_config_definition(definitions, xml_definition); - } - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "no definitions for kazoo\n" ); - } - } else { - destroy_config(&definitions); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "no definitions section for kazoo\n" ); - } - - return definitions; -} - -void destroy_config(kazoo_config_ptr *ptr) -{ - kazoo_config_ptr config = NULL; - switch_memory_pool_t *pool; - - if (!ptr || !*ptr) { - return; - } - config = *ptr; - pool = config->pool; - - switch_core_hash_destroy(&(config->hash)); - switch_core_destroy_memory_pool(&pool); - - *ptr = NULL; -} - -/* For Emacs: - * Local Variables: - * mode:c - * indent-tabs-mode:t - * tab-width:4 - * c-basic-offset:4 - * End: - * For VIM: - * vim:set softtabstop=4 shiftwidth=4 tabstop=4 - */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_config.h b/src/mod/event_handlers/mod_kazoo/kazoo_config.h deleted file mode 100644 index cb6c92ba59..0000000000 --- a/src/mod/event_handlers/mod_kazoo/kazoo_config.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* Copyright (C) 2005-2012, Anthony Minessale II -* -* Version: MPL 1.1 -* -* The contents of this file are subject to the Mozilla Public License Version -* 1.1 (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* http://www.mozilla.org/MPL/ -* -* Software distributed under the License is distributed on an "AS IS" basis, -* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -* for the specific language governing rights and limitations under the -* License. -* -* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* -* The Initial Developer of the Original Code is -* Anthony Minessale II -* Portions created by the Initial Developer are Copyright (C) -* the Initial Developer. All Rights Reserved. -* -* Based on mod_skel by -* Anthony Minessale II -* -* Contributor(s): -* -* Daniel Bryars -* Tim Brown -* Anthony Minessale II -* William King -* Mike Jerris -* -* kazoo.c -- Sends FreeSWITCH events to an AMQP broker -* -*/ - -#ifndef KAZOO_CONFIG_H -#define KAZOO_CONFIG_H - -#include - - -struct kazoo_config_t { - switch_hash_t *hash; - switch_memory_pool_t *pool; -}; - -switch_status_t kazoo_config_loglevels(switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_loglevels_ptr *ptr); -switch_status_t kazoo_config_filters(switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_filter_ptr *ptr); -switch_status_t kazoo_config_fields(kazoo_config_ptr definitions, switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_fields_ptr *ptr); - -switch_status_t kazoo_config_event_handler(kazoo_config_ptr definitions, kazoo_config_ptr root, switch_xml_t cfg, kazoo_event_profile_ptr *ptr); -switch_status_t kazoo_config_fetch_handler(kazoo_config_ptr definitions, kazoo_config_ptr root, switch_xml_t cfg, kazoo_fetch_profile_ptr *ptr); -kazoo_config_ptr kazoo_config_event_handlers(kazoo_config_ptr definitions, switch_xml_t cfg); -kazoo_config_ptr kazoo_config_fetch_handlers(kazoo_config_ptr definitions, switch_xml_t cfg); -kazoo_config_ptr kazoo_config_definitions(switch_xml_t cfg); -void destroy_config(kazoo_config_ptr *ptr); - -#endif /* KAZOO_CONFIG_H */ - diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c b/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c index bf90626564..0ea4cf6f2c 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_dptools.c @@ -52,14 +52,6 @@ #define EXPORT_LONG_DESC "Export many channel variables for the channel calling the application" #define EXPORT_SYNTAX "[^^]= =" -#define PREFIX_UNSET_SHORT_DESC "clear variables by prefix" -#define PREFIX_UNSET_LONG_DESC "clears the channel variables that start with prefix supplied" -#define PREFIX_UNSET_SYNTAX "" - -#define UUID_MULTISET_SHORT_DESC "Set many channel variables" -#define UUID_MULTISET_LONG_DESC "Set many channel variables for a specific channel" -#define UUID_MULTISET_SYNTAX " [^^]= =" - static void base_set (switch_core_session_t *session, const char *data, switch_stack_t stack) { char *var, *val = NULL; @@ -107,22 +99,6 @@ static void base_set (switch_core_session_t *session, const char *data, switch_s } } -static int kz_is_exported(switch_core_session_t *session, char *varname) -{ - char *array[256] = {0}; - int i, argc; - switch_channel_t *channel = switch_core_session_get_channel(session); - const char *exports = switch_channel_get_variable(channel, SWITCH_EXPORT_VARS_VARIABLE); - char *arg = switch_core_session_strdup(session, exports); - argc = switch_split(arg, ',', array); - for(i=0; i < argc; i++) { - if(!strcasecmp(array[i], varname)) - return 1; - } - - return 0; -} - static void base_export (switch_core_session_t *session, const char *data, switch_stack_t stack) { char *var, *val = NULL; @@ -145,52 +121,20 @@ static void base_export (switch_core_session_t *session, const char *data, switc } } - if(!kz_is_exported(session, var)) { - if (val) { - expanded = switch_channel_expand_variables(channel, val); - } + if (val) { + expanded = switch_channel_expand_variables(channel, val); + } - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s EXPORT [%s]=[%s]\n", switch_channel_get_name(channel), var, - expanded ? expanded : "UNDEF"); - switch_channel_export_variable_var_check(channel, var, expanded, SWITCH_EXPORT_VARS_VARIABLE, SWITCH_FALSE); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s EXPORT [%s]=[%s]\n", switch_channel_get_name(channel), var, + expanded ? expanded : "UNDEF"); + switch_channel_export_variable_var_check(channel, var, expanded, SWITCH_EXPORT_VARS_VARIABLE, SWITCH_FALSE); - if (expanded && expanded != val) { - switch_safe_free(expanded); - } - } else { - switch_channel_set_variable(channel, var, val); + if (expanded && expanded != val) { + switch_safe_free(expanded); } } } -SWITCH_STANDARD_APP(prefix_unset_function) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_event_header_t *ei = NULL; - switch_event_t *clear; - char *arg = (char *) data; - - if(switch_event_create(&clear, SWITCH_EVENT_CLONE) != SWITCH_STATUS_SUCCESS) { - return; - } - - for (ei = switch_channel_variable_first(channel); ei; ei = ei->next) { - const char *name = ei->name; - char *value = ei->value; - if (!strncasecmp(name, arg, strlen(arg))) { - switch_event_add_header_string(clear, SWITCH_STACK_BOTTOM, name, value); - } - } - - switch_channel_variable_last(channel); - for (ei = clear->headers; ei; ei = ei->next) { - char *varname = ei->name; - switch_channel_set_variable(channel, varname, NULL); - } - - switch_event_destroy(&clear); -} - SWITCH_STANDARD_APP(multiset_function) { char delim = ' '; char *arg = (char *) data; @@ -201,79 +145,25 @@ SWITCH_STANDARD_APP(multiset_function) { delim = *arg++; } - if(delim != '\0') { + if (arg) { switch_channel_t *channel = switch_core_session_get_channel(session); - if (arg) { - char *array[256] = {0}; - int i, argc; + char *array[256] = {0}; + int i, argc; - arg = switch_core_session_strdup(session, arg); - argc = switch_split(arg, delim, array); + arg = switch_core_session_strdup(session, arg); + argc = switch_split(arg, delim, array); - for(i = 0; i < argc; i++) { - base_set(session, array[i], SWITCH_STACK_BOTTOM); - } + for(i = 0; i < argc; i++) { + base_set(session, array[i], SWITCH_STACK_BOTTOM); } + if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { switch_channel_event_set_data(channel, event); switch_event_fire(&event); } + } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "multiset with empty args\n"); - } -} - -SWITCH_STANDARD_APP(uuid_multiset_function) { - - char delim = ' '; - char *arg0 = (char *) data; - char *arg = strchr(arg0, ' '); - switch_event_t *event; - - - if(arg == NULL) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "uuid_multiset with invalid args\n"); - return; - } - *arg = '\0'; - arg++; - - if(zstr(arg0)) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "uuid_multiset with invalid uuid\n"); - return; - } - - - if (!zstr(arg) && *arg == '^' && *(arg+1) == '^') { - arg += 2; - delim = *arg++; - } - - if(delim != '\0') { - switch_core_session_t *uuid_session = NULL; - if ((uuid_session = switch_core_session_force_locate(arg0)) != NULL) { - switch_channel_t *uuid_channel = switch_core_session_get_channel(uuid_session); - if (arg) { - char *array[256] = {0}; - int i, argc; - - arg = switch_core_session_strdup(session, arg); - argc = switch_split(arg, delim, array); - - for(i = 0; i < argc; i++) { - base_set(uuid_session, array[i], SWITCH_STACK_BOTTOM); - } - } - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { - switch_channel_event_set_data(uuid_channel, event); - switch_event_fire(&event); - } - switch_core_session_rwunlock(uuid_session); - } else { - base_set(session, data, SWITCH_STACK_BOTTOM); - } - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "multiset with empty args\n"); + base_set(session, data, SWITCH_STACK_BOTTOM); } } @@ -315,23 +205,19 @@ SWITCH_STANDARD_APP(multiunset_function) { delim = *arg++; } - if(delim != '\0') { - if (arg) { - char *array[256] = {0}; - int i, argc; + if (arg) { + char *array[256] = {0}; + int i, argc; - arg = switch_core_session_strdup(session, arg); - argc = switch_split(arg, delim, array); + arg = switch_core_session_strdup(session, arg); + argc = switch_split(arg, delim, array); - for(i = 0; i < argc; i++) { - switch_channel_set_variable(switch_core_session_get_channel(session), array[i], NULL); - } - - } else { - switch_channel_set_variable(switch_core_session_get_channel(session), arg, NULL); + for(i = 0; i < argc; i++) { + switch_channel_set_variable(switch_core_session_get_channel(session), array[i], NULL); } + } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "multiunset with empty args\n"); + switch_channel_set_variable(switch_core_session_get_channel(session), arg, NULL); } } @@ -344,22 +230,18 @@ SWITCH_STANDARD_APP(export_function) { delim = *arg++; } - if(delim != '\0') { - if (arg) { - char *array[256] = {0}; - int i, argc; + if (arg) { + char *array[256] = {0}; + int i, argc; - arg = switch_core_session_strdup(session, arg); - argc = switch_split(arg, delim, array); + arg = switch_core_session_strdup(session, arg); + argc = switch_split(arg, delim, array); - for(i = 0; i < argc; i++) { - base_export(session, array[i], SWITCH_STACK_BOTTOM); - } - } else { - base_export(session, data, SWITCH_STACK_BOTTOM); - } + for(i = 0; i < argc; i++) { + base_export(session, array[i], SWITCH_STACK_BOTTOM); + } } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "export with empty args\n"); + base_export(session, data, SWITCH_STACK_BOTTOM); } } @@ -372,11 +254,6 @@ void add_kz_dptools(switch_loadable_module_interface_t **module_interface, switc SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); SWITCH_ADD_APP(app_interface, "kz_multiunset", MULTISET_SHORT_DESC, MULTISET_LONG_DESC, multiunset_function, MULTIUNSET_SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); - SWITCH_ADD_APP(app_interface, "kz_export", EXPORT_SHORT_DESC, EXPORT_LONG_DESC, export_function, EXPORT_SYNTAX, - SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); - SWITCH_ADD_APP(app_interface, "kz_prefix_unset", PREFIX_UNSET_SHORT_DESC, PREFIX_UNSET_LONG_DESC, prefix_unset_function, PREFIX_UNSET_SYNTAX, - SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); - SWITCH_ADD_APP(app_interface, "kz_uuid_multiset", UUID_MULTISET_SHORT_DESC, UUID_MULTISET_LONG_DESC, uuid_multiset_function, UUID_MULTISET_SYNTAX, - SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); - + SWITCH_ADD_APP(app_interface, "kz_export", EXPORT_SHORT_DESC, EXPORT_LONG_DESC, export_function, EXPORT_SYNTAX, + SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC); } diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_ei.h b/src/mod/event_handlers/mod_kazoo/kazoo_ei.h deleted file mode 100644 index c317b617be..0000000000 --- a/src/mod/event_handlers/mod_kazoo/kazoo_ei.h +++ /dev/null @@ -1,262 +0,0 @@ -#ifndef KAZOO_EI_H -#define KAZOO_EI_H - -#include -#include - -#define MODNAME "mod_kazoo" -#define BUNDLE "community" -#define RELEASE "v1.5.0-1" -#define VERSION "mod_kazoo v1.5.0-1 community" - -typedef enum {KAZOO_FETCH_PROFILE, KAZOO_EVENT_PROFILE} kazoo_profile_type; - -typedef enum {ERLANG_TUPLE, ERLANG_MAP} kazoo_json_term; - -typedef struct ei_xml_agent_s ei_xml_agent_t; -typedef ei_xml_agent_t *ei_xml_agent_ptr; - -typedef struct kazoo_event kazoo_event_t; -typedef kazoo_event_t *kazoo_event_ptr; - -typedef struct kazoo_event_profile kazoo_event_profile_t; -typedef kazoo_event_profile_t *kazoo_event_profile_ptr; - -typedef struct kazoo_fetch_profile kazoo_fetch_profile_t; -typedef kazoo_fetch_profile_t *kazoo_fetch_profile_ptr; - -typedef struct kazoo_config_t kazoo_config; -typedef kazoo_config *kazoo_config_ptr; - -#include "kazoo_fields.h" -#include "kazoo_config.h" - -struct ei_send_msg_s { - ei_x_buff buf; - erlang_pid pid; -}; -typedef struct ei_send_msg_s ei_send_msg_t; - -struct ei_received_msg_s { - ei_x_buff buf; - erlang_msg msg; -}; -typedef struct ei_received_msg_s ei_received_msg_t; - - -typedef struct ei_event_stream_s ei_event_stream_t; -typedef struct ei_node_s ei_node_t; - -struct ei_event_binding_s { - char id[SWITCH_UUID_FORMATTED_LENGTH + 1]; - switch_event_node_t *node; - switch_event_types_t type; - const char *subclass_name; - ei_event_stream_t* stream; - kazoo_event_ptr event; - - struct ei_event_binding_s *next; -}; -typedef struct ei_event_binding_s ei_event_binding_t; - -struct ei_event_stream_s { - switch_memory_pool_t *pool; - ei_event_binding_t *bindings; - switch_queue_t *queue; - switch_socket_t *acceptor; - switch_pollset_t *pollset; - switch_pollfd_t *pollfd; - switch_socket_t *socket; - switch_mutex_t *socket_mutex; - switch_bool_t connected; - char remote_ip[48]; - uint16_t remote_port; - char local_ip[48]; - uint16_t local_port; - erlang_pid pid; - uint32_t flags; - ei_node_t *node; - struct ei_event_stream_s *next; -}; - -struct ei_node_s { - int nodefd; - switch_atomic_t pending_bgapi; - switch_atomic_t receive_handlers; - switch_memory_pool_t *pool; - ei_event_stream_t *event_streams; - switch_mutex_t *event_streams_mutex; - switch_queue_t *send_msgs; - switch_queue_t *received_msgs; - char *peer_nodename; - switch_time_t created_time; - switch_socket_t *socket; - char remote_ip[48]; - uint16_t remote_port; - char local_ip[48]; - uint16_t local_port; - uint32_t flags; - int legacy; - struct ei_node_s *next; -}; - - -struct xml_fetch_reply_s { - char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; - char *xml_str; - struct xml_fetch_reply_s *next; -}; -typedef struct xml_fetch_reply_s xml_fetch_reply_t; - -struct fetch_handler_s { - erlang_pid pid; - struct fetch_handler_s *next; -}; -typedef struct fetch_handler_s fetch_handler_t; - -struct ei_xml_client_s { - ei_node_t *ei_node; - fetch_handler_t *fetch_handlers; - struct ei_xml_client_s *next; -}; -typedef struct ei_xml_client_s ei_xml_client_t; - -struct ei_xml_agent_s { - switch_memory_pool_t *pool; - switch_xml_section_t section; - switch_thread_rwlock_t *lock; - ei_xml_client_t *clients; - switch_mutex_t *current_client_mutex; - ei_xml_client_t *current_client; - switch_mutex_t *replies_mutex; - switch_thread_cond_t *new_reply; - xml_fetch_reply_t *replies; - kazoo_fetch_profile_ptr profile; - -}; - -struct globals_s { - switch_memory_pool_t *pool; - switch_atomic_t threads; - switch_socket_t *acceptor; - struct ei_cnode_s ei_cnode; - switch_thread_rwlock_t *ei_nodes_lock; - ei_node_t *ei_nodes; - - switch_xml_binding_t *config_fetch_binding; - switch_xml_binding_t *directory_fetch_binding; - switch_xml_binding_t *dialplan_fetch_binding; - switch_xml_binding_t *channels_fetch_binding; - switch_xml_binding_t *languages_fetch_binding; - switch_xml_binding_t *chatplan_fetch_binding; - - switch_hash_t *event_filter; - int epmdfd; - int num_worker_threads; - switch_bool_t nat_map; - switch_bool_t ei_shortname; - int ei_compat_rel; - char *ip; - char *hostname; - char *ei_cookie; - char *ei_nodename; - char *kazoo_var_prefix; - int var_prefix_length; - uint32_t flags; - int send_all_headers; - int send_all_private_headers; - int connection_timeout; - int receive_timeout; - int receive_msg_preallocate; - int event_stream_preallocate; - int send_msg_batch; - short event_stream_framing; - switch_port_t port; - int config_fetched; - int io_fault_tolerance; - kazoo_event_profile_ptr events; - kazoo_config_ptr definitions; - kazoo_config_ptr event_handlers; - kazoo_config_ptr fetch_handlers; - kazoo_json_term json_encoding; - - int delete_file_after_put; - int enable_legacy; - -}; -typedef struct globals_s globals_t; -extern globals_t kazoo_globals; - -/* kazoo_event_stream.c */ -ei_event_stream_t *find_event_stream(ei_event_stream_t *event_streams, const erlang_pid *from); - -//ei_event_stream_t *new_event_stream(ei_event_stream_t **event_streams, const erlang_pid *from); -ei_event_stream_t *new_event_stream(ei_node_t *ei_node, const erlang_pid *from); - - -switch_status_t remove_event_stream(ei_event_stream_t **event_streams, const erlang_pid *from); -switch_status_t remove_event_streams(ei_event_stream_t **event_streams); -unsigned long get_stream_port(const ei_event_stream_t *event_stream); -switch_status_t add_event_binding(ei_event_stream_t *event_stream, const char *event_name); -//switch_status_t add_event_binding(ei_event_stream_t *event_stream, const switch_event_types_t event_type, const char *subclass_name); -switch_status_t remove_event_binding(ei_event_stream_t *event_stream, const switch_event_types_t event_type, const char *subclass_name); -switch_status_t remove_event_bindings(ei_event_stream_t *event_stream); - -/* kazoo_node.c */ -switch_status_t new_kazoo_node(int nodefd, ErlConnect *conn); - -/* kazoo_ei_utils.c */ -void close_socket(switch_socket_t **sock); -void close_socketfd(int *sockfd); -switch_socket_t *create_socket_with_port(switch_memory_pool_t *pool, switch_port_t port); -switch_socket_t *create_socket(switch_memory_pool_t *pool); -switch_status_t create_ei_cnode(const char *ip_addr, const char *name, struct ei_cnode_s *ei_cnode); -switch_status_t ei_compare_pids(const erlang_pid *pid1, const erlang_pid *pid2); -void ei_encode_switch_event_headers(ei_x_buff *ebuf, switch_event_t *event); -void ei_encode_switch_event_headers_2(ei_x_buff *ebuf, switch_event_t *event, int decode); -void ei_encode_json(ei_x_buff *ebuf, cJSON *JObj); -void ei_link(ei_node_t *ei_node, erlang_pid * from, erlang_pid * to); -void ei_encode_switch_event(ei_x_buff * ebuf, switch_event_t *event); -int ei_helper_send(ei_node_t *ei_node, erlang_pid* to, ei_x_buff *buf); -int ei_decode_atom_safe(char *buf, int *index, char *dst); -int ei_decode_string_or_binary_limited(char *buf, int *index, int maxsize, char *dst); -int ei_decode_string_or_binary(char *buf, int *index, char **dst); -switch_status_t create_acceptor(); -switch_hash_t *create_default_filter(); - -void fetch_config(); - -switch_status_t kazoo_load_config(); -void kazoo_destroy_config(); - - -#define _ei_x_encode_string(buf, string) { ei_x_encode_binary(buf, string, strlen(string)); } - -/* kazoo_fetch_agent.c */ -switch_status_t bind_fetch_agents(); -switch_status_t unbind_fetch_agents(); -switch_status_t remove_xml_clients(ei_node_t *ei_node); -switch_status_t add_fetch_handler(ei_node_t *ei_node, erlang_pid *from, switch_xml_binding_t *binding); -switch_status_t remove_fetch_handlers(ei_node_t *ei_node, erlang_pid *from); -switch_status_t fetch_reply(char *uuid_str, char *xml_str, switch_xml_binding_t *binding); -switch_status_t handle_api_command_streams(ei_node_t *ei_node, switch_stream_handle_t *stream); - -void bind_event_profiles(kazoo_event_ptr event); -void rebind_fetch_profiles(kazoo_config_ptr fetch_handlers); -switch_status_t kazoo_config_handlers(switch_xml_t cfg); - -/* runtime */ -SWITCH_MODULE_RUNTIME_FUNCTION(mod_kazoo_runtime); - -#endif /* KAZOO_EI_H */ - -/* For Emacs: - * Local Variables: - * mode:c - * indent-tabs-mode:t - * tab-width:4 - * c-basic-offset:4 - * End: - * For VIM: - * vim:set softtabstop=4 shiftwidth=4 tabstop=4: - */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c b/src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c deleted file mode 100644 index 7eb93af5d8..0000000000 --- a/src/mod/event_handlers/mod_kazoo/kazoo_ei_config.c +++ /dev/null @@ -1,543 +0,0 @@ -/* -* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* Copyright (C) 2005-2012, Anthony Minessale II -* -* Version: MPL 1.1 -* -* The contents of this file are subject to the Mozilla Public License Version -* 1.1 (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* http://www.mozilla.org/MPL/ -* -* Software distributed under the License is distributed on an "AS IS" basis, -* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -* for the specific language governing rights and limitations under the -* License. -* -* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* -* The Initial Developer of the Original Code is -* Anthony Minessale II -* Portions created by the Initial Developer are Copyright (C) -* the Initial Developer. All Rights Reserved. -* -* Based on mod_skel by -* Anthony Minessale II -* -* Contributor(s): -* -* Daniel Bryars -* Tim Brown -* Anthony Minessale II -* William King -* Mike Jerris -* -* kazoo.c -- Sends FreeSWITCH events to an AMQP broker -* -*/ - -#include "mod_kazoo.h" -#include "kazoo_definitions.h" - -#define KAZOO_DECLARE_GLOBAL_STRING_FUNC(fname, vname) static void __attribute__((__unused__)) fname(const char *string) { if (!string) return;\ - if (vname) {free(vname); vname = NULL;}vname = strdup(string);} static void fname(const char *string) - -KAZOO_DECLARE_GLOBAL_STRING_FUNC(set_pref_ip, kazoo_globals.ip); -KAZOO_DECLARE_GLOBAL_STRING_FUNC(set_pref_ei_cookie, kazoo_globals.ei_cookie); -KAZOO_DECLARE_GLOBAL_STRING_FUNC(set_pref_ei_nodename, kazoo_globals.ei_nodename); -KAZOO_DECLARE_GLOBAL_STRING_FUNC(set_pref_kazoo_var_prefix, kazoo_globals.kazoo_var_prefix); - -static int read_cookie_from_file(char *filename) { - int fd; - char cookie[MAXATOMLEN + 1]; - char *end; - struct stat buf; - ssize_t res; - - if (!stat(filename, &buf)) { - if ((buf.st_mode & S_IRWXG) || (buf.st_mode & S_IRWXO)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s must only be accessible by owner only.\n", filename); - return 2; - } - if (buf.st_size > MAXATOMLEN) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s contains a cookie larger than the maximum atom size of %d.\n", filename, MAXATOMLEN); - return 2; - } - fd = open(filename, O_RDONLY); - if (fd < 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to open cookie file %s : %d.\n", filename, errno); - return 2; - } - - if ((res = read(fd, cookie, MAXATOMLEN)) < 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to read cookie file %s : %d.\n", filename, errno); - } - - cookie[MAXATOMLEN] = '\0'; - - /* replace any end of line characters with a null */ - if ((end = strchr(cookie, '\n'))) { - *end = '\0'; - } - - if ((end = strchr(cookie, '\r'))) { - *end = '\0'; - } - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set cookie from file %s: %s\n", filename, cookie); - - set_pref_ei_cookie(cookie); - return 0; - } else { - /* don't error here, because we might be blindly trying to read $HOME/.erlang.cookie, and that can fail silently */ - return 1; - } -} - - -switch_status_t kazoo_ei_config(switch_xml_t cfg) { - switch_xml_t child, param; - kazoo_globals.send_all_headers = 0; - kazoo_globals.send_all_private_headers = 1; - kazoo_globals.connection_timeout = 500; - kazoo_globals.receive_timeout = 200; - kazoo_globals.receive_msg_preallocate = 2000; - kazoo_globals.event_stream_preallocate = 4000; - kazoo_globals.send_msg_batch = 10; - kazoo_globals.event_stream_framing = 2; - kazoo_globals.port = 0; - kazoo_globals.io_fault_tolerance = 10; - kazoo_globals.json_encoding = ERLANG_TUPLE; - kazoo_globals.enable_legacy = SWITCH_TRUE; - kazoo_globals.delete_file_after_put = SWITCH_TRUE; - - if ((child = switch_xml_child(cfg, "settings"))) { - for (param = switch_xml_child(child, "param"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - char *val = (char *) switch_xml_attr_soft(param, "value"); - - if (!strcmp(var, "listen-ip")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set bind ip address: %s\n", val); - set_pref_ip(val); - } else if (!strcmp(var, "listen-port")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set bind port: %s\n", val); - kazoo_globals.port = atoi(val); - } else if (!strcmp(var, "cookie")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set cookie: %s\n", val); - set_pref_ei_cookie(val); - } else if (!strcmp(var, "cookie-file")) { - if (read_cookie_from_file(val) == 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to read cookie from %s\n", val); - } - } else if (!strcmp(var, "nodename")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set node name: %s\n", val); - set_pref_ei_nodename(val); - } else if (!strcmp(var, "shortname")) { - kazoo_globals.ei_shortname = switch_true(val); - } else if (!strcmp(var, "kazoo-var-prefix")) { - set_pref_kazoo_var_prefix(val); - } else if (!strcmp(var, "compat-rel")) { - if (atoi(val) >= 7) - kazoo_globals.ei_compat_rel = atoi(val); - else - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid compatibility release '%s' specified\n", val); - } else if (!strcmp(var, "nat-map")) { - kazoo_globals.nat_map = switch_true(val); - } else if (!strcmp(var, "send-all-headers")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-all-headers: %s\n", val); - kazoo_globals.send_all_headers = switch_true(val); - } else if (!strcmp(var, "send-all-private-headers")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-all-private-headers: %s\n", val); - kazoo_globals.send_all_private_headers = switch_true(val); - } else if (!strcmp(var, "connection-timeout")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set connection-timeout: %s\n", val); - kazoo_globals.connection_timeout = atoi(val); - } else if (!strcmp(var, "receive-timeout")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set receive-timeout: %s\n", val); - kazoo_globals.receive_timeout = atoi(val); - } else if (!strcmp(var, "receive-msg-preallocate")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set receive-msg-preallocate: %s\n", val); - kazoo_globals.receive_msg_preallocate = atoi(val); - } else if (!strcmp(var, "event-stream-preallocate")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set event-stream-preallocate: %s\n", val); - kazoo_globals.event_stream_preallocate = atoi(val); - } else if (!strcmp(var, "send-msg-batch-size")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-msg-batch-size: %s\n", val); - kazoo_globals.send_msg_batch = atoi(val); - } else if (!strcmp(var, "event-stream-framing")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set event-stream-framing: %s\n", val); - kazoo_globals.event_stream_framing = atoi(val); - } else if (!strcmp(var, "io-fault-tolerance")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set io-fault-tolerance: %s\n", val); - kazoo_globals.io_fault_tolerance = atoi(val); - } else if (!strcmp(var, "num-worker-threads")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set num-worker-threads: %s\n", val); - kazoo_globals.num_worker_threads = atoi(val); - } else if (!strcmp(var, "json-term-encoding")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set json-term-encoding: %s\n", val); - if(!strcmp(val, "map")) { - kazoo_globals.json_encoding = ERLANG_MAP; - } - } else if (!strcmp(var, "enable-legacy")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set enable-legacy: %s\n", val); - kazoo_globals.enable_legacy = switch_true(val); - } else if (!strcmp(var, "delete-file-after-put")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set delete-file-after-put: %s\n", val); - kazoo_globals.delete_file_after_put = switch_true(val); - } - } - } - - if ((child = switch_xml_child(cfg, "event-filter"))) { - switch_hash_t *filter; - - switch_core_hash_init(&filter); - for (param = switch_xml_child(child, "header"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - switch_core_hash_insert(filter, var, "1"); - } - kazoo_globals.event_filter = filter; - } - - if (kazoo_globals.receive_msg_preallocate < 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid receive message preallocate value, disabled\n"); - kazoo_globals.receive_msg_preallocate = 0; - } - - if (kazoo_globals.event_stream_preallocate < 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid event stream preallocate value, disabled\n"); - kazoo_globals.event_stream_preallocate = 0; - } - - if (kazoo_globals.send_msg_batch < 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid send message batch size, reverting to default\n"); - kazoo_globals.send_msg_batch = 10; - } - - if (kazoo_globals.io_fault_tolerance < 1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid I/O fault tolerance, reverting to default\n"); - kazoo_globals.io_fault_tolerance = 10; - } - - if (!kazoo_globals.event_filter) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Event filter not found in configuration, using default\n"); - kazoo_globals.event_filter = create_default_filter(); - } - - if (kazoo_globals.event_stream_framing < 1 || kazoo_globals.event_stream_framing > 4) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid event stream framing value, using default\n"); - kazoo_globals.event_stream_framing = 2; - } - - if (zstr(kazoo_globals.kazoo_var_prefix)) { - set_pref_kazoo_var_prefix("variable_ecallmgr*"); - kazoo_globals.var_prefix_length = 17; //ignore the * - } else { - /* we could use the global pool but then we would have to conditionally - * free the pointer if it was not drawn from the XML */ - char *buf; - int size = switch_snprintf(NULL, 0, "variable_%s*", kazoo_globals.kazoo_var_prefix) + 1; - - switch_malloc(buf, size); - switch_snprintf(buf, size, "variable_%s*", kazoo_globals.kazoo_var_prefix); - switch_safe_free(kazoo_globals.kazoo_var_prefix); - kazoo_globals.kazoo_var_prefix = buf; - kazoo_globals.var_prefix_length = size - 2; //ignore the * - } - - if (!kazoo_globals.num_worker_threads) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Number of worker threads not found in configuration, using default\n"); - kazoo_globals.num_worker_threads = 10; - } - - if (zstr(kazoo_globals.ip)) { - set_pref_ip("0.0.0.0"); - } - - if (zstr(kazoo_globals.ei_cookie)) { - int res; - char *home_dir = getenv("HOME"); - char path_buf[1024]; - - if (!zstr(home_dir)) { - /* $HOME/.erlang.cookie */ - switch_snprintf(path_buf, sizeof (path_buf), "%s%s%s", home_dir, SWITCH_PATH_SEPARATOR, ".erlang.cookie"); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Checking for cookie at path: %s\n", path_buf); - - res = read_cookie_from_file(path_buf); - if (res) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No cookie or valid cookie file specified, using default cookie\n"); - set_pref_ei_cookie("ClueCon"); - } - } - } - - if (!kazoo_globals.ei_nodename) { - set_pref_ei_nodename("freeswitch"); - } - - if (!kazoo_globals.nat_map) { - kazoo_globals.nat_map = 0; - } - - return SWITCH_STATUS_SUCCESS; -} - -switch_status_t kazoo_config_handlers(switch_xml_t cfg) -{ - switch_xml_t def; - char* xml = NULL; - kazoo_config_ptr definitions, fetch_handlers, event_handlers; - kazoo_event_profile_ptr events; - - xml = strndup((char*)kazoo_conf_xml, kazoo_conf_xml_len); - def = switch_xml_parse_str_dup(xml); - - kz_xml_process(def); - kz_xml_process(cfg); - - definitions = kazoo_config_definitions(cfg); - if(definitions == NULL) { - definitions = kazoo_config_definitions(def); - } - - fetch_handlers = kazoo_config_fetch_handlers(definitions, cfg); - if(fetch_handlers == NULL) { - fetch_handlers = kazoo_config_fetch_handlers(definitions, def); - } - - event_handlers = kazoo_config_event_handlers(definitions, cfg); - if(event_handlers == NULL) { - event_handlers = kazoo_config_event_handlers(definitions, def); - } - - if(event_handlers != NULL) { - events = (kazoo_event_profile_ptr) switch_core_hash_find(event_handlers->hash, "default"); - } - - if(events == NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to get default handler for events\n"); - destroy_config(&event_handlers); - destroy_config(&fetch_handlers); - destroy_config(&definitions); - switch_xml_free(def); - switch_safe_free(xml); - return SWITCH_STATUS_GENERR; - } - - bind_event_profiles(events->events); - kazoo_globals.events = events; - - destroy_config(&kazoo_globals.event_handlers); - kazoo_globals.event_handlers = event_handlers; - - rebind_fetch_profiles(fetch_handlers); - destroy_config(&kazoo_globals.fetch_handlers); - kazoo_globals.fetch_handlers = fetch_handlers; - - destroy_config(&kazoo_globals.definitions); - kazoo_globals.definitions = definitions; - - - switch_xml_free(def); - switch_safe_free(xml); - - return SWITCH_STATUS_SUCCESS; -} - -switch_status_t kazoo_load_config() -{ - char *cf = "kazoo.conf"; - switch_xml_t cfg, xml; - if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf); - return SWITCH_STATUS_FALSE; - } else { - kazoo_ei_config(cfg); - kazoo_config_handlers(cfg); - switch_xml_free(xml); - } - - return SWITCH_STATUS_SUCCESS; -} - -void kazoo_destroy_config() -{ - destroy_config(&kazoo_globals.event_handlers); - destroy_config(&kazoo_globals.fetch_handlers); - destroy_config(&kazoo_globals.definitions); -} - -switch_status_t kazoo_config_events(kazoo_config_ptr definitions, switch_memory_pool_t *pool, switch_xml_t cfg, kazoo_event_profile_ptr profile) -{ - switch_xml_t events, event; - kazoo_event_ptr prv = NULL, cur = NULL; - - - if ((events = switch_xml_child(cfg, "events")) != NULL) { - for (event = switch_xml_child(events, "event"); event; event = event->next) { - const char *var = switch_xml_attr(event, "name"); - cur = (kazoo_event_ptr) switch_core_alloc(pool, sizeof(kazoo_event_t)); - memset(cur, 0, sizeof(kazoo_event_t)); - if(prv == NULL) { - profile->events = prv = cur; - } else { - prv->next = cur; - prv = cur; - } - cur->profile = profile; - cur->name = switch_core_strdup(pool, var); - kazoo_config_filters(pool, event, &cur->filter); - kazoo_config_fields(definitions, pool, event, &cur->fields); - - } - - } - - return SWITCH_STATUS_SUCCESS; - -} - - -switch_status_t kazoo_config_fetch_handler(kazoo_config_ptr definitions, kazoo_config_ptr root, switch_xml_t cfg, kazoo_fetch_profile_ptr *ptr) -{ - kazoo_fetch_profile_ptr profile = NULL; - switch_xml_t params, param; - switch_xml_section_t fetch_section; - int fetch_timeout = 2000000; - switch_memory_pool_t *pool = NULL; - - char *name = (char *) switch_xml_attr_soft(cfg, "name"); - if (zstr(name)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "missing name in profile\n"); - return SWITCH_STATUS_GENERR; - } - - if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error allocation pool for new profile : %s\n", name); - return SWITCH_STATUS_GENERR; - } - - profile = switch_core_alloc(pool, sizeof(kazoo_fetch_profile_t)); - profile->pool = pool; - profile->root = root; - profile->name = switch_core_strdup(profile->pool, name); - - fetch_section = switch_xml_parse_section_string(name); - - if ((params = switch_xml_child(cfg, "params")) != NULL) { - for (param = switch_xml_child(params, "param"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - char *val = (char *) switch_xml_attr_soft(param, "value"); - - if (!var) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Profile[%s] param missing 'name' attribute\n", name); - continue; - } - - if (!val) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Profile[%s] param[%s] missing 'value' attribute\n", name, var); - continue; - } - - if (!strncmp(var, "fetch-timeout", 13)) { - fetch_timeout = atoi(val); - } else if (!strncmp(var, "fetch-section", 13)) { - fetch_section = switch_xml_parse_section_string(val); - } - } - } - - if (fetch_section == SWITCH_XML_SECTION_RESULT) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Fetch Profile[%s] invalid fetch-section: %s\n", name, switch_xml_toxml(cfg, SWITCH_FALSE)); - goto err; - } - - - profile->fetch_timeout = fetch_timeout; - profile->section = fetch_section; - kazoo_config_fields(definitions, pool, cfg, &profile->fields); - kazoo_config_loglevels(pool, cfg, &profile->logging); - - if(root) { - if ( switch_core_hash_insert(root->hash, name, (void *) profile) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed to insert new fetch profile [%s] into kazoo profile hash\n", name); - goto err; - } - } - - if(ptr) - *ptr = profile; - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "fetch handler profile %s successfully configured\n", name); - return SWITCH_STATUS_SUCCESS; - - err: - /* Cleanup */ - if(pool) { - switch_core_destroy_memory_pool(&pool); - } - return SWITCH_STATUS_GENERR; - -} - -switch_status_t kazoo_config_event_handler(kazoo_config_ptr definitions, kazoo_config_ptr root, switch_xml_t cfg, kazoo_event_profile_ptr *ptr) -{ - kazoo_event_profile_ptr profile = NULL; - switch_memory_pool_t *pool = NULL; - - char *name = (char *) switch_xml_attr_soft(cfg, "name"); - if (zstr(name)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "missing name in profile\n"); - return SWITCH_STATUS_GENERR; - } - - if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error allocation pool for new profile : %s\n", name); - return SWITCH_STATUS_GENERR; - } - - profile = switch_core_alloc(pool, sizeof(kazoo_event_profile_t)); - profile->pool = pool; - profile->root = root; - profile->name = switch_core_strdup(profile->pool, name); - - kazoo_config_filters(pool, cfg, &profile->filter); - kazoo_config_fields(definitions, pool, cfg, &profile->fields); - kazoo_config_events(definitions, pool, cfg, profile); - kazoo_config_loglevels(pool, cfg, &profile->logging); - - if(root) { - if ( switch_core_hash_insert(root->hash, name, (void *) profile) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to insert new profile [%s] into kazoo profile hash\n", name); - goto err; - } - } - - if(ptr) - *ptr = profile; - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "event handler profile %s successfully configured\n", name); - return SWITCH_STATUS_SUCCESS; - - err: - /* Cleanup */ - if(pool) { - switch_core_destroy_memory_pool(&pool); - } - return SWITCH_STATUS_GENERR; - -} - - - -/* For Emacs: - * Local Variables: - * mode:c - * indent-tabs-mode:t - * tab-width:4 - * c-basic-offset:4 - * End: - * For VIM: - * vim:set softtabstop=4 shiftwidth=4 tabstop=4 - */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c b/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c deleted file mode 100644 index 96381f9b24..0000000000 --- a/src/mod/event_handlers/mod_kazoo/kazoo_ei_utils.c +++ /dev/null @@ -1,996 +0,0 @@ -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2012, Anthony Minessale II - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * - * The Initial Developer of the Original Code is - * Anthony Minessale II - * Portions created by the Initial Developer are Copyright (C) - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Anthony Minessale II - * Andrew Thompson - * Rob Charlton - * Karl Anderson - * - * Original from mod_erlang_event. - * ei_helpers.c -- helper functions for ei - * - */ -#include "mod_kazoo.h" - -/* Stolen from code added to ei in R12B-5. - * Since not everyone has this version yet; - * provide our own version. - * */ - -#define put8(s,n) do { \ - (s)[0] = (char)((n) & 0xff); \ - (s) += 1; \ - } while (0) - -#define put32be(s,n) do { \ - (s)[0] = ((n) >> 24) & 0xff; \ - (s)[1] = ((n) >> 16) & 0xff; \ - (s)[2] = ((n) >> 8) & 0xff; \ - (s)[3] = (n) & 0xff; \ - (s) += 4; \ - } while (0) - -#ifdef EI_DEBUG -static void ei_x_print_reg_msg(ei_x_buff *buf, char *dest, int send) { - char *mbuf = NULL; - int i = 1; - - ei_s_print_term(&mbuf, buf->buff, &i); - - if (send) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Encoded term %s to '%s'\n", mbuf, dest); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Decoded term %s for '%s'\n", mbuf, dest); - } - - free(mbuf); -} - -static void ei_x_print_msg(ei_x_buff *buf, erlang_pid *pid, int send) { - char *pbuf = NULL; - int i = 0; - ei_x_buff pidbuf; - - ei_x_new(&pidbuf); - ei_x_encode_pid(&pidbuf, pid); - - ei_s_print_term(&pbuf, pidbuf.buff, &i); - - ei_x_print_reg_msg(buf, pbuf, send); - free(pbuf); -} -#endif - -void ei_encode_switch_event_headers(ei_x_buff *ebuf, switch_event_t *event) { - ei_encode_switch_event_headers_2(ebuf, event, 1); -} - -void ei_encode_switch_event_headers_2(ei_x_buff *ebuf, switch_event_t *event, int encode) { - switch_event_header_t *hp; - char *uuid = switch_event_get_header(event, "unique-id"); - int i; - - for (i = 0, hp = event->headers; hp; hp = hp->next, i++); - - if (event->body) - i++; - - ei_x_encode_list_header(ebuf, i + 1); - - if (uuid) { - char *unique_id = switch_event_get_header(event, "unique-id"); - ei_x_encode_binary(ebuf, unique_id, strlen(unique_id)); - } else { - ei_x_encode_atom(ebuf, "undefined"); - } - - for (hp = event->headers; hp; hp = hp->next) { - ei_x_encode_tuple_header(ebuf, 2); - ei_x_encode_binary(ebuf, hp->name, strlen(hp->name)); - if(encode) - switch_url_decode(hp->value); - ei_x_encode_binary(ebuf, hp->value, strlen(hp->value)); - } - - if (event->body) { - ei_x_encode_tuple_header(ebuf, 2); - ei_x_encode_binary(ebuf, "body", strlen("body")); - ei_x_encode_binary(ebuf, event->body, strlen(event->body)); - } - - ei_x_encode_empty_list(ebuf); -} - -int ei_json_child_count(cJSON *JObj) -{ - int mask = cJSON_False - | cJSON_True - | cJSON_NULL - | cJSON_Number - | cJSON_String - | cJSON_Array - | cJSON_Object - | cJSON_Raw; - - cJSON *item = JObj->child; - int i = 0; - while(item) { - if(item->type & mask) - i++; - item = item->next; - } - return i; - -} - -void ei_encode_json_array(ei_x_buff *ebuf, cJSON *JObj) { - cJSON *item; - int count = ei_json_child_count(JObj); - - ei_x_encode_list_header(ebuf, count); - if(count == 0) - return; - - item = JObj->child; - while(item) { - switch(item->type) { - case cJSON_String: - ei_x_encode_binary(ebuf, item->valuestring, strlen(item->valuestring)); - break; - - case cJSON_Number: - ei_x_encode_double(ebuf, item->valuedouble); - break; - - case cJSON_True: - ei_x_encode_boolean(ebuf, 1); - break; - - case cJSON_False: - ei_x_encode_boolean(ebuf, 0); - break; - - case cJSON_Object: - ei_encode_json(ebuf, item); - break; - - case cJSON_Array: - ei_encode_json_array(ebuf, item); - break; - - case cJSON_Raw: - { - cJSON *Decoded = cJSON_Parse(item->valuestring); - if(!Decoded) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR DECODING RAW JSON %s\n", item->valuestring); - ei_x_encode_tuple_header(ebuf, 0); - } else { - ei_encode_json(ebuf, Decoded); - cJSON_Delete(Decoded); - } - break; - } - - case cJSON_NULL: - ei_x_encode_atom(ebuf, "null"); - break; - - default: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NOT ENCODED %i\n", item->type); - break; - - } - item = item->next; - } - - ei_x_encode_empty_list(ebuf); - -} - -void ei_encode_json(ei_x_buff *ebuf, cJSON *JObj) { - cJSON *item; - int count = ei_json_child_count(JObj); - - if(kazoo_globals.json_encoding == ERLANG_TUPLE) { - ei_x_encode_tuple_header(ebuf, 1); - ei_x_encode_list_header(ebuf, count); - } else { - ei_x_encode_map_header(ebuf, count); - } - - if(count == 0) - return; - - item = JObj->child; - while(item) { - if(kazoo_globals.json_encoding == ERLANG_TUPLE) { - ei_x_encode_tuple_header(ebuf, 2); - } - ei_x_encode_binary(ebuf, item->string, strlen(item->string)); - - switch(item->type) { - case cJSON_String: - ei_x_encode_binary(ebuf, item->valuestring, strlen(item->valuestring)); - break; - - case cJSON_Number: - if ((fabs(((double)item->valueint) - item->valuedouble) <= DBL_EPSILON) - && (item->valuedouble <= INT_MAX) - && (item->valuedouble >= INT_MIN)) { - ei_x_encode_longlong(ebuf, item->valueint); - } else { - ei_x_encode_double(ebuf, item->valuedouble); - } - break; - - case cJSON_True: - ei_x_encode_boolean(ebuf, 1); - break; - - case cJSON_False: - ei_x_encode_boolean(ebuf, 0); - break; - - case cJSON_Object: - ei_encode_json(ebuf, item); - break; - - case cJSON_Array: - ei_encode_json_array(ebuf, item); - break; - - case cJSON_Raw: - { - cJSON *Decoded = cJSON_Parse(item->valuestring); - if(!Decoded) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR DECODING RAW JSON %s\n", item->valuestring); - ei_x_encode_tuple_header(ebuf, 0); - } else { - ei_encode_json(ebuf, Decoded); - cJSON_Delete(Decoded); - } - break; - } - - case cJSON_NULL: - ei_x_encode_atom(ebuf, "null"); - break; - - default: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NOT ENCODED %i\n", item->type); - break; - - } - item = item->next; - } - - if(kazoo_globals.json_encoding == ERLANG_TUPLE) { - ei_x_encode_empty_list(ebuf); - } - -} - -void close_socket(switch_socket_t ** sock) { - if (*sock) { - switch_socket_shutdown(*sock, SWITCH_SHUTDOWN_READWRITE); - switch_socket_close(*sock); - *sock = NULL; - } -} - -void close_socketfd(int *sockfd) { - if (*sockfd) { - shutdown(*sockfd, SHUT_RDWR); - close(*sockfd); - } -} - -switch_socket_t *create_socket_with_port(switch_memory_pool_t *pool, switch_port_t port) { - switch_sockaddr_t *sa; - switch_socket_t *socket; - - if(switch_sockaddr_info_get(&sa, kazoo_globals.ip, SWITCH_UNSPEC, port, 0, pool)) { - return NULL; - } - - if (switch_socket_create(&socket, switch_sockaddr_get_family(sa), SOCK_STREAM, SWITCH_PROTO_TCP, pool)) { - return NULL; - } - - if (switch_socket_opt_set(socket, SWITCH_SO_REUSEADDR, 1)) { - return NULL; - } - - if (switch_socket_bind(socket, sa)) { - return NULL; - } - - if (switch_socket_listen(socket, 5)){ - return NULL; - } - - switch_getnameinfo(&kazoo_globals.hostname, sa, 0); - - if (kazoo_globals.nat_map && switch_nat_get_type()) { - switch_nat_add_mapping(port, SWITCH_NAT_TCP, NULL, SWITCH_FALSE); - } - - return socket; -} - -switch_socket_t *create_socket(switch_memory_pool_t *pool) { - return create_socket_with_port(pool, 0); - -} - -switch_status_t create_ei_cnode(const char *ip_addr, const char *name, struct ei_cnode_s *ei_cnode) { - char hostname[EI_MAXHOSTNAMELEN + 1] = ""; - char nodename[MAXNODELEN + 1]; - char cnodename[EI_MAXALIVELEN + 1]; - //EI_MAX_COOKIE_SIZE+1 - char *atsign; - - /* copy the erlang interface nodename into something we can modify */ - strncpy(cnodename, name, EI_MAXALIVELEN); - - if ((atsign = strchr(cnodename, '@'))) { - /* we got a qualified node name, don't guess the host/domain */ - snprintf(nodename, MAXNODELEN + 1, "%s", kazoo_globals.ei_nodename); - /* truncate the alivename at the @ */ - *atsign = '\0'; - } else { - if (zstr(kazoo_globals.hostname) || !strncasecmp(kazoo_globals.ip, "0.0.0.0", 7) || !strncasecmp(kazoo_globals.ip, "::", 2)) { - memcpy(hostname, switch_core_get_hostname(), EI_MAXHOSTNAMELEN); - } else { - memcpy(hostname, kazoo_globals.hostname, EI_MAXHOSTNAMELEN); - } - - snprintf(nodename, MAXNODELEN + 1, "%s@%s", kazoo_globals.ei_nodename, hostname); - } - - if (kazoo_globals.ei_shortname) { - char *off; - if ((off = strchr(nodename, '.'))) { - *off = '\0'; - } - } - - /* init the ec stuff */ - if (ei_connect_xinit(ei_cnode, hostname, cnodename, nodename, (Erl_IpAddr) ip_addr, kazoo_globals.ei_cookie, 0) < 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to initialize the erlang interface connection structure\n"); - return SWITCH_STATUS_FALSE; - } - - return SWITCH_STATUS_SUCCESS; -} - -switch_status_t ei_compare_pids(const erlang_pid *pid1, const erlang_pid *pid2) { - if ((!strcmp(pid1->node, pid2->node)) - && pid1->creation == pid2->creation - && pid1->num == pid2->num - && pid1->serial == pid2->serial) { - return SWITCH_STATUS_SUCCESS; - } else { - return SWITCH_STATUS_FALSE; - } -} - -void ei_link(ei_node_t *ei_node, erlang_pid * from, erlang_pid * to) { - char msgbuf[2048]; - char *s; - int index = 0; - - index = 5; /* max sizes: */ - ei_encode_version(msgbuf, &index); /* 1 */ - ei_encode_tuple_header(msgbuf, &index, 3); - ei_encode_long(msgbuf, &index, ERL_LINK); - ei_encode_pid(msgbuf, &index, from); /* 268 */ - ei_encode_pid(msgbuf, &index, to); /* 268 */ - - /* 5 byte header missing */ - s = msgbuf; - put32be(s, index - 4); /* 4 */ - put8(s, ERL_PASS_THROUGH); /* 1 */ - /* sum: 542 */ - - if (write(ei_node->nodefd, msgbuf, index) == -1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to link to process on %s\n", ei_node->peer_nodename); - } -} - -void ei_encode_switch_event(ei_x_buff *ebuf, switch_event_t *event) { - ei_x_encode_tuple_header(ebuf, 2); - ei_x_encode_atom(ebuf, "event"); - ei_encode_switch_event_headers(ebuf, event); -} - -int ei_helper_send(ei_node_t *ei_node, erlang_pid *to, ei_x_buff *buf) { - int ret = 0; - - if (ei_node->nodefd) { -#ifdef EI_DEBUG - ei_x_print_msg(buf, to, 1); -#endif - ret = ei_send(ei_node->nodefd, to, buf->buff, buf->index); - } - - return ret; -} - -int ei_decode_atom_safe(char *buf, int *index, char *dst) { - int type, size; - - ei_get_type(buf, index, &type, &size); - - if (type != ERL_ATOM_EXT) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed atom\n", type, size); - return -1; - } else if (size > MAXATOMLEN) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Requested decoding of atom with size %d into a buffer of size %d\n", size, MAXATOMLEN); - return -1; - } else { - return ei_decode_atom(buf, index, dst); - } -} - -int ei_decode_string_or_binary(char *buf, int *index, char **dst) { - int type, size, res; - long len; - - ei_get_type(buf, index, &type, &size); - - if (type != ERL_STRING_EXT && type != ERL_BINARY_EXT && type != ERL_NIL_EXT) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed binary or string\n", type, size); - return -1; - } - - *dst = malloc(size + 1); - - if (type == ERL_NIL_EXT) { - res = 0; - **dst = '\0'; - } else if (type == ERL_BINARY_EXT) { - res = ei_decode_binary(buf, index, *dst, &len); - (*dst)[len] = '\0'; - } else { - res = ei_decode_string(buf, index, *dst); - } - - return res; -} - -int ei_decode_string_or_binary_limited(char *buf, int *index, int maxsize, char *dst) { - int type, size, res; - long len; - - ei_get_type(buf, index, &type, &size); - - if (type != ERL_STRING_EXT && type != ERL_BINARY_EXT && type != ERL_NIL_EXT) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed binary or string\n", type, size); - return -1; - } - - if (size > maxsize) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Requested decoding of %s with size %d into a buffer of size %d\n", - type == ERL_BINARY_EXT ? "binary" : "string", size, maxsize); - return -1; - } - - if (type == ERL_NIL_EXT) { - res = 0; - *dst = '\0'; - } else if (type == ERL_BINARY_EXT) { - res = ei_decode_binary(buf, index, dst, &len); - dst[len] = '\0'; /* binaries aren't null terminated */ - } else { - res = ei_decode_string(buf, index, dst); - } - - return res; -} - - -switch_status_t create_acceptor() { - switch_sockaddr_t *sa; - uint16_t port; - char ipbuf[48]; - const char *ip_addr; - - /* if the config has specified an erlang release compatibility then pass that along to the erlang interface */ - if (kazoo_globals.ei_compat_rel) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Compatability with OTP R%d requested\n", kazoo_globals.ei_compat_rel); - ei_set_compat_rel(kazoo_globals.ei_compat_rel); - } - - if (!(kazoo_globals.acceptor = create_socket_with_port(kazoo_globals.pool, kazoo_globals.port))) { - return SWITCH_STATUS_SOCKERR; - } - - switch_socket_addr_get(&sa, SWITCH_FALSE, kazoo_globals.acceptor); - - port = switch_sockaddr_get_port(sa); - ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Erlang connection acceptor listening on %s:%u\n", ip_addr, port); - - /* try to initialize the erlang interface */ - if (create_ei_cnode(ip_addr, kazoo_globals.ei_nodename, &kazoo_globals.ei_cnode) != SWITCH_STATUS_SUCCESS) { - return SWITCH_STATUS_SOCKERR; - } - - /* tell the erlang port manager where we can be reached. this returns a file descriptor pointing to epmd or -1 */ - if ((kazoo_globals.epmdfd = ei_publish(&kazoo_globals.ei_cnode, port)) == -1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to publish port to epmd, trying to start epmd via system()\n"); - if (system("epmd -daemon")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, - "Failed to start epmd manually! Is epmd in $PATH? If not, start it yourself or run an erl shell with -sname or -name\n"); - return SWITCH_STATUS_SOCKERR; - } - switch_yield(100000); - if ((kazoo_globals.epmdfd = ei_publish(&kazoo_globals.ei_cnode, port)) == -1) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to publish port to epmd AGAIN\n"); - return SWITCH_STATUS_SOCKERR; - } - } - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connected to epmd and published erlang cnode name %s at port %d\n", kazoo_globals.ei_cnode.thisnodename, port); - - return SWITCH_STATUS_SUCCESS; -} - -switch_hash_t *create_default_filter() { - switch_hash_t *filter; - - switch_core_hash_init(&filter); - - switch_core_hash_insert(filter, "Acquired-UUID", "1"); - switch_core_hash_insert(filter, "action", "1"); - switch_core_hash_insert(filter, "Action", "1"); - switch_core_hash_insert(filter, "alt_event_type", "1"); - switch_core_hash_insert(filter, "Answer-State", "1"); - switch_core_hash_insert(filter, "Application", "1"); - switch_core_hash_insert(filter, "Application-Data", "1"); - switch_core_hash_insert(filter, "Application-Name", "1"); - switch_core_hash_insert(filter, "Application-Response", "1"); - switch_core_hash_insert(filter, "att_xfer_replaced_by", "1"); - switch_core_hash_insert(filter, "Auth-Method", "1"); - switch_core_hash_insert(filter, "Auth-Realm", "1"); - switch_core_hash_insert(filter, "Auth-User", "1"); - switch_core_hash_insert(filter, "Bridge-A-Unique-ID", "1"); - switch_core_hash_insert(filter, "Bridge-B-Unique-ID", "1"); - switch_core_hash_insert(filter, "Call-Direction", "1"); - switch_core_hash_insert(filter, "Caller-Callee-ID-Name", "1"); - switch_core_hash_insert(filter, "Caller-Callee-ID-Number", "1"); - switch_core_hash_insert(filter, "Caller-Caller-ID-Name", "1"); - switch_core_hash_insert(filter, "Caller-Caller-ID-Number", "1"); - switch_core_hash_insert(filter, "Caller-Screen-Bit", "1"); - switch_core_hash_insert(filter, "Caller-Privacy-Hide-Name", "1"); - switch_core_hash_insert(filter, "Caller-Privacy-Hide-Number", "1"); - switch_core_hash_insert(filter, "Caller-Context", "1"); - switch_core_hash_insert(filter, "Caller-Controls", "1"); - switch_core_hash_insert(filter, "Caller-Destination-Number", "1"); - switch_core_hash_insert(filter, "Caller-Dialplan", "1"); - switch_core_hash_insert(filter, "Caller-Network-Addr", "1"); - switch_core_hash_insert(filter, "Caller-Unique-ID", "1"); - switch_core_hash_insert(filter, "Call-ID", "1"); - switch_core_hash_insert(filter, "Channel-Call-State", "1"); - switch_core_hash_insert(filter, "Channel-Call-UUID", "1"); - switch_core_hash_insert(filter, "Channel-Presence-ID", "1"); - switch_core_hash_insert(filter, "Channel-State", "1"); - switch_core_hash_insert(filter, "Chat-Permissions", "1"); - switch_core_hash_insert(filter, "Conference-Name", "1"); - switch_core_hash_insert(filter, "Conference-Profile-Name", "1"); - switch_core_hash_insert(filter, "Conference-Unique-ID", "1"); - switch_core_hash_insert(filter, "contact", "1"); - switch_core_hash_insert(filter, "Detected-Tone", "1"); - switch_core_hash_insert(filter, "dialog_state", "1"); - switch_core_hash_insert(filter, "direction", "1"); - switch_core_hash_insert(filter, "Distributed-From", "1"); - switch_core_hash_insert(filter, "DTMF-Digit", "1"); - switch_core_hash_insert(filter, "DTMF-Duration", "1"); - switch_core_hash_insert(filter, "Event-Date-Timestamp", "1"); - switch_core_hash_insert(filter, "Event-Name", "1"); - switch_core_hash_insert(filter, "Event-Subclass", "1"); - switch_core_hash_insert(filter, "expires", "1"); - switch_core_hash_insert(filter, "Expires", "1"); - switch_core_hash_insert(filter, "Ext-SIP-IP", "1"); - switch_core_hash_insert(filter, "File", "1"); - switch_core_hash_insert(filter, "FreeSWITCH-Hostname", "1"); - switch_core_hash_insert(filter, "from", "1"); - switch_core_hash_insert(filter, "Hunt-Destination-Number", "1"); - switch_core_hash_insert(filter, "ip", "1"); - switch_core_hash_insert(filter, "Message-Account", "1"); - switch_core_hash_insert(filter, "metadata", "1"); - switch_core_hash_insert(filter, "old_node_channel_uuid", "1"); - switch_core_hash_insert(filter, "Other-Leg-Callee-ID-Name", "1"); - switch_core_hash_insert(filter, "Other-Leg-Callee-ID-Number", "1"); - switch_core_hash_insert(filter, "Other-Leg-Caller-ID-Name", "1"); - switch_core_hash_insert(filter, "Other-Leg-Caller-ID-Number", "1"); - switch_core_hash_insert(filter, "Other-Leg-Destination-Number", "1"); - switch_core_hash_insert(filter, "Other-Leg-Direction", "1"); - switch_core_hash_insert(filter, "Other-Leg-Unique-ID", "1"); - switch_core_hash_insert(filter, "Other-Leg-Channel-Name", "1"); - switch_core_hash_insert(filter, "Participant-Type", "1"); - switch_core_hash_insert(filter, "Path", "1"); - switch_core_hash_insert(filter, "profile_name", "1"); - switch_core_hash_insert(filter, "Profiles", "1"); - switch_core_hash_insert(filter, "proto-specific-event-name", "1"); - switch_core_hash_insert(filter, "Raw-Application-Data", "1"); - switch_core_hash_insert(filter, "realm", "1"); - switch_core_hash_insert(filter, "Resigning-UUID", "1"); - switch_core_hash_insert(filter, "set", "1"); - switch_core_hash_insert(filter, "sip_auto_answer", "1"); - switch_core_hash_insert(filter, "sip_auth_method", "1"); - switch_core_hash_insert(filter, "sip_from_host", "1"); - switch_core_hash_insert(filter, "sip_from_user", "1"); - switch_core_hash_insert(filter, "sip_to_host", "1"); - switch_core_hash_insert(filter, "sip_to_user", "1"); - switch_core_hash_insert(filter, "sub-call-id", "1"); - switch_core_hash_insert(filter, "technology", "1"); - switch_core_hash_insert(filter, "to", "1"); - switch_core_hash_insert(filter, "Unique-ID", "1"); - switch_core_hash_insert(filter, "URL", "1"); - switch_core_hash_insert(filter, "username", "1"); - switch_core_hash_insert(filter, "variable_channel_is_moving", "1"); - switch_core_hash_insert(filter, "variable_collected_digits", "1"); - switch_core_hash_insert(filter, "variable_current_application", "1"); - switch_core_hash_insert(filter, "variable_current_application_data", "1"); - switch_core_hash_insert(filter, "variable_domain_name", "1"); - switch_core_hash_insert(filter, "variable_effective_caller_id_name", "1"); - switch_core_hash_insert(filter, "variable_effective_caller_id_number", "1"); - switch_core_hash_insert(filter, "variable_holding_uuid", "1"); - switch_core_hash_insert(filter, "variable_hold_music", "1"); - switch_core_hash_insert(filter, "variable_media_group_id", "1"); - switch_core_hash_insert(filter, "variable_originate_disposition", "1"); - switch_core_hash_insert(filter, "variable_origination_uuid", "1"); - switch_core_hash_insert(filter, "variable_playback_terminator_used", "1"); - switch_core_hash_insert(filter, "variable_presence_id", "1"); - switch_core_hash_insert(filter, "variable_record_ms", "1"); - switch_core_hash_insert(filter, "variable_recovered", "1"); - switch_core_hash_insert(filter, "variable_silence_hits_exhausted", "1"); - switch_core_hash_insert(filter, "variable_sip_auth_realm", "1"); - switch_core_hash_insert(filter, "variable_sip_from_host", "1"); - switch_core_hash_insert(filter, "variable_sip_from_user", "1"); - switch_core_hash_insert(filter, "variable_sip_from_tag", "1"); - switch_core_hash_insert(filter, "variable_sip_h_X-AUTH-IP", "1"); - switch_core_hash_insert(filter, "variable_sip_received_ip", "1"); - switch_core_hash_insert(filter, "variable_sip_to_host", "1"); - switch_core_hash_insert(filter, "variable_sip_to_user", "1"); - switch_core_hash_insert(filter, "variable_sip_to_tag", "1"); - switch_core_hash_insert(filter, "variable_sofia_profile_name", "1"); - switch_core_hash_insert(filter, "variable_transfer_history", "1"); - switch_core_hash_insert(filter, "variable_user_name", "1"); - switch_core_hash_insert(filter, "variable_endpoint_disposition", "1"); - switch_core_hash_insert(filter, "variable_originate_disposition", "1"); - switch_core_hash_insert(filter, "variable_bridge_hangup_cause", "1"); - switch_core_hash_insert(filter, "variable_hangup_cause", "1"); - switch_core_hash_insert(filter, "variable_last_bridge_proto_specific_hangup_cause", "1"); - switch_core_hash_insert(filter, "variable_proto_specific_hangup_cause", "1"); - switch_core_hash_insert(filter, "VM-Call-ID", "1"); - switch_core_hash_insert(filter, "VM-sub-call-id", "1"); - switch_core_hash_insert(filter, "whistle_application_name", "1"); - switch_core_hash_insert(filter, "whistle_application_response", "1"); - switch_core_hash_insert(filter, "whistle_event_name", "1"); - switch_core_hash_insert(filter, "kazoo_application_name", "1"); - switch_core_hash_insert(filter, "kazoo_application_response", "1"); - switch_core_hash_insert(filter, "kazoo_event_name", "1"); - switch_core_hash_insert(filter, "sip_auto_answer_notify", "1"); - switch_core_hash_insert(filter, "eavesdrop_group", "1"); - switch_core_hash_insert(filter, "origination_caller_id_name", "1"); - switch_core_hash_insert(filter, "origination_caller_id_number", "1"); - switch_core_hash_insert(filter, "origination_callee_id_name", "1"); - switch_core_hash_insert(filter, "origination_callee_id_number", "1"); - switch_core_hash_insert(filter, "sip_auth_username", "1"); - switch_core_hash_insert(filter, "sip_auth_password", "1"); - switch_core_hash_insert(filter, "effective_caller_id_name", "1"); - switch_core_hash_insert(filter, "effective_caller_id_number", "1"); - switch_core_hash_insert(filter, "effective_callee_id_name", "1"); - switch_core_hash_insert(filter, "effective_callee_id_number", "1"); - switch_core_hash_insert(filter, "variable_destination_number", "1"); - switch_core_hash_insert(filter, "variable_effective_callee_id_name", "1"); - switch_core_hash_insert(filter, "variable_effective_callee_id_number", "1"); - switch_core_hash_insert(filter, "variable_record_silence_hits", "1"); - switch_core_hash_insert(filter, "variable_refer_uuid", "1"); - switch_core_hash_insert(filter, "variable_sip_call_id", "1"); - switch_core_hash_insert(filter, "variable_sip_h_Referred-By", "1"); - switch_core_hash_insert(filter, "variable_sip_h_X-AUTH-PORT", "1"); - switch_core_hash_insert(filter, "variable_sip_loopback_req_uri", "1"); - switch_core_hash_insert(filter, "variable_sip_received_port", "1"); - switch_core_hash_insert(filter, "variable_sip_refer_to", "1"); - switch_core_hash_insert(filter, "variable_sip_req_host", "1"); - switch_core_hash_insert(filter, "variable_sip_req_uri", "1"); - switch_core_hash_insert(filter, "variable_transfer_source", "1"); - switch_core_hash_insert(filter, "variable_uuid", "1"); - - /* Registration headers */ - switch_core_hash_insert(filter, "call-id", "1"); - switch_core_hash_insert(filter, "profile-name", "1"); - switch_core_hash_insert(filter, "from-user", "1"); - switch_core_hash_insert(filter, "from-host", "1"); - switch_core_hash_insert(filter, "presence-hosts", "1"); - switch_core_hash_insert(filter, "contact", "1"); - switch_core_hash_insert(filter, "rpid", "1"); - switch_core_hash_insert(filter, "status", "1"); - switch_core_hash_insert(filter, "expires", "1"); - switch_core_hash_insert(filter, "to-user", "1"); - switch_core_hash_insert(filter, "to-host", "1"); - switch_core_hash_insert(filter, "network-ip", "1"); - switch_core_hash_insert(filter, "network-port", "1"); - switch_core_hash_insert(filter, "username", "1"); - switch_core_hash_insert(filter, "realm", "1"); - switch_core_hash_insert(filter, "user-agent", "1"); - - switch_core_hash_insert(filter, "Hangup-Cause", "1"); - switch_core_hash_insert(filter, "Unique-ID", "1"); - switch_core_hash_insert(filter, "variable_switch_r_sdp", "1"); - switch_core_hash_insert(filter, "variable_rtp_local_sdp_str", "1"); - switch_core_hash_insert(filter, "variable_sip_to_uri", "1"); - switch_core_hash_insert(filter, "variable_sip_from_uri", "1"); - switch_core_hash_insert(filter, "variable_sip_user_agent", "1"); - switch_core_hash_insert(filter, "variable_duration", "1"); - switch_core_hash_insert(filter, "variable_billsec", "1"); - switch_core_hash_insert(filter, "variable_billmsec", "1"); - switch_core_hash_insert(filter, "variable_progresssec", "1"); - switch_core_hash_insert(filter, "variable_progress_uepoch", "1"); - switch_core_hash_insert(filter, "variable_progress_media_uepoch", "1"); - switch_core_hash_insert(filter, "variable_start_uepoch", "1"); - switch_core_hash_insert(filter, "variable_digits_dialed", "1"); - switch_core_hash_insert(filter, "Member-ID", "1"); - switch_core_hash_insert(filter, "Floor", "1"); - switch_core_hash_insert(filter, "Video", "1"); - switch_core_hash_insert(filter, "Hear", "1"); - switch_core_hash_insert(filter, "Speak", "1"); - switch_core_hash_insert(filter, "Talking", "1"); - switch_core_hash_insert(filter, "Current-Energy", "1"); - switch_core_hash_insert(filter, "Energy-Level", "1"); - switch_core_hash_insert(filter, "Mute-Detect", "1"); - - /* RTMP headers */ - switch_core_hash_insert(filter, "RTMP-Session-ID", "1"); - switch_core_hash_insert(filter, "RTMP-Profile", "1"); - switch_core_hash_insert(filter, "RTMP-Flash-Version", "1"); - switch_core_hash_insert(filter, "RTMP-SWF-URL", "1"); - switch_core_hash_insert(filter, "RTMP-TC-URL", "1"); - switch_core_hash_insert(filter, "RTMP-Page-URL", "1"); - switch_core_hash_insert(filter, "User", "1"); - switch_core_hash_insert(filter, "Domain", "1"); - - /* Fax headers */ - switch_core_hash_insert(filter, "variable_fax_bad_rows", "1"); - switch_core_hash_insert(filter, "variable_fax_document_total_pages", "1"); - switch_core_hash_insert(filter, "variable_fax_document_transferred_pages", "1"); - switch_core_hash_insert(filter, "variable_fax_ecm_used", "1"); - switch_core_hash_insert(filter, "variable_fax_result_code", "1"); - switch_core_hash_insert(filter, "variable_fax_result_text", "1"); - switch_core_hash_insert(filter, "variable_fax_success", "1"); - switch_core_hash_insert(filter, "variable_fax_transfer_rate", "1"); - switch_core_hash_insert(filter, "variable_fax_local_station_id", "1"); - switch_core_hash_insert(filter, "variable_fax_remote_station_id", "1"); - switch_core_hash_insert(filter, "variable_fax_remote_country", "1"); - switch_core_hash_insert(filter, "variable_fax_remote_vendor", "1"); - switch_core_hash_insert(filter, "variable_fax_remote_model", "1"); - switch_core_hash_insert(filter, "variable_fax_image_resolution", "1"); - switch_core_hash_insert(filter, "variable_fax_file_image_resolution", "1"); - switch_core_hash_insert(filter, "variable_fax_image_size", "1"); - switch_core_hash_insert(filter, "variable_fax_image_pixel_size", "1"); - switch_core_hash_insert(filter, "variable_fax_file_image_pixel_size", "1"); - switch_core_hash_insert(filter, "variable_fax_longest_bad_row_run", "1"); - switch_core_hash_insert(filter, "variable_fax_encoding", "1"); - switch_core_hash_insert(filter, "variable_fax_encoding_name", "1"); - switch_core_hash_insert(filter, "variable_fax_header", "1"); - switch_core_hash_insert(filter, "variable_fax_ident", "1"); - switch_core_hash_insert(filter, "variable_fax_timezone", "1"); - switch_core_hash_insert(filter, "variable_fax_doc_id", "1"); - switch_core_hash_insert(filter, "variable_fax_doc_database", "1"); - switch_core_hash_insert(filter, "variable_has_t38", "1"); - - /* Secure headers */ - switch_core_hash_insert(filter, "variable_sdp_secure_savp_only", "1"); - switch_core_hash_insert(filter, "variable_rtp_has_crypto", "1"); - switch_core_hash_insert(filter, "variable_rtp_secure_media", "1"); - switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed", "1"); - switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed_audio", "1"); - switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed_video", "1"); - switch_core_hash_insert(filter, "variable_zrtp_secure_media", "1"); - switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed", "1"); - switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed_audio", "1"); - switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed_video", "1"); - switch_core_hash_insert(filter, "sdp_secure_savp_only", "1"); - switch_core_hash_insert(filter, "rtp_has_crypto", "1"); - switch_core_hash_insert(filter, "rtp_secure_media", "1"); - switch_core_hash_insert(filter, "rtp_secure_media_confirmed", "1"); - switch_core_hash_insert(filter, "rtp_secure_media_confirmed_audio", "1"); - switch_core_hash_insert(filter, "rtp_secure_media_confirmed_video", "1"); - switch_core_hash_insert(filter, "zrtp_secure_media", "1"); - switch_core_hash_insert(filter, "zrtp_secure_media_confirmed", "1"); - switch_core_hash_insert(filter, "zrtp_secure_media_confirmed_audio", "1"); - switch_core_hash_insert(filter, "zrtp_secure_media_confirmed_video", "1"); - - /* Device Redirect headers */ - switch_core_hash_insert(filter, "variable_last_bridge_hangup_cause", "1"); - switch_core_hash_insert(filter, "variable_sip_redirected_by", "1"); - switch_core_hash_insert(filter, "intercepted_by", "1"); - switch_core_hash_insert(filter, "variable_bridge_uuid", "1"); - switch_core_hash_insert(filter, "Record-File-Path", "1"); - - /* Loopback headers */ - switch_core_hash_insert(filter, "variable_loopback_bowout_on_execute", "1"); - switch_core_hash_insert(filter, "variable_loopback_bowout", "1"); - switch_core_hash_insert(filter, "variable_other_loopback_leg_uuid", "1"); - switch_core_hash_insert(filter, "variable_loopback_leg", "1"); - switch_core_hash_insert(filter, "variable_is_loopback", "1"); - - // SMS - switch_core_hash_insert(filter, "Message-ID", "1"); - switch_core_hash_insert(filter, "Delivery-Failure", "1"); - switch_core_hash_insert(filter, "Delivery-Result-Code", "1"); - - return filter; -} - -static void fetch_config_filters(switch_memory_pool_t *pool) -{ - char *cf = "kazoo.conf"; - switch_xml_t cfg, xml, child, param; - switch_event_t *params; - - switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Action", "request-filter"); - - if (!(xml = switch_xml_open_cfg(cf, &cfg, params))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf); - } else if ((child = switch_xml_child(cfg, "event-filter"))) { - switch_hash_t *filter; - switch_hash_t *old_filter; - - switch_core_hash_init(&filter); - for (param = switch_xml_child(child, "header"); param; param = param->next) { - char *var = (char *) switch_xml_attr_soft(param, "name"); - switch_core_hash_insert(filter, var, "1"); - } - - old_filter = kazoo_globals.event_filter; - kazoo_globals.event_filter = filter; - if (old_filter) { - switch_core_hash_destroy(&old_filter); - } - - kazoo_globals.config_fetched = 1; - switch_xml_free(xml); - } - -} - -static void fetch_config_handlers(switch_memory_pool_t *pool) -{ - char *cf = "kazoo.conf"; - switch_xml_t cfg, xml; - switch_event_t *params; - - switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Action", "request-handlers"); - - if (!(xml = switch_xml_open_cfg(cf, &cfg, params))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf); - } else { - kazoo_config_handlers(cfg); - kazoo_globals.config_fetched = 1; - switch_xml_free(xml); - } - -} - -static void *SWITCH_THREAD_FUNC fetch_config_exec(switch_thread_t *thread, void *obj) -{ - switch_memory_pool_t *pool = (switch_memory_pool_t *)obj; - fetch_config_filters(pool); - fetch_config_handlers(pool); - - kazoo_globals.config_fetched = 1; - - return NULL; -} - -void fetch_config() { - switch_memory_pool_t *pool; - switch_thread_t *thread; - switch_threadattr_t *thd_attr = NULL; - switch_uuid_t uuid; - - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "fetching kazoo config\n"); - - switch_core_new_memory_pool(&pool); - - switch_threadattr_create(&thd_attr, pool); - switch_threadattr_detach_set(thd_attr, 1); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - - switch_uuid_get(&uuid); - switch_thread_create(&thread, thd_attr, fetch_config_exec, pool, pool); - -} - - -SWITCH_MODULE_RUNTIME_FUNCTION(mod_kazoo_runtime) { - switch_os_socket_t os_socket; - - if(create_acceptor() != SWITCH_STATUS_SUCCESS) { - // TODO: what would we need to clean up here - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to create erlang connection acceptor!\n"); - close_socket(&kazoo_globals.acceptor); - return SWITCH_STATUS_TERM; - } - - switch_atomic_inc(&kazoo_globals.threads); - switch_os_sock_get(&os_socket, kazoo_globals.acceptor); - - while (switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { - int nodefd; - ErlConnect conn; - - /* zero out errno because ei_accept doesn't differentiate between a */ - /* failed authentication or a socket failure, or a client version */ - /* mismatch or a godzilla attack (and a godzilla attack is highly likely) */ - errno = 0; - - /* wait here for an erlang node to connect, timming out to check if our module is still running every now-and-again */ - if ((nodefd = ei_accept_tmo(&kazoo_globals.ei_cnode, (int) os_socket, &conn, kazoo_globals.connection_timeout)) == ERL_ERROR) { - if (erl_errno == ETIMEDOUT) { - continue; - } else if (errno) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Erlang connection acceptor socket error %d %d\n", erl_errno, errno); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, - "Erlang node connection failed - ensure your cookie matches '%s' and you are using a good nodename\n", kazoo_globals.ei_cookie); - } - continue; - } - - if (!switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { - break; - } - - /* NEW ERLANG NODE CONNECTION! Hello friend! */ - new_kazoo_node(nodefd, &conn); - } - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Erlang connection acceptor shut down\n"); - - switch_atomic_dec(&kazoo_globals.threads); - - return SWITCH_STATUS_TERM; -} - -/* For Emacs: - * Local Variables: - * mode:c - * indent-tabs-mode:t - * tab-width:4 - * c-basic-offset:4 - * End: - * For VIM: - * vim:set softtabstop=4 shiftwidth=4 tabstop=4: - */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_event_stream.c b/src/mod/event_handlers/mod_kazoo/kazoo_event_stream.c index b52b6d4b81..3ca0e3acc7 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_event_stream.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_event_stream.c @@ -48,8 +48,7 @@ static char *my_dup(const char *s) { static const char* private_headers[] = {"variable_sip_h_", "sip_h_", "P-", "X-"}; static int is_private_header(const char *name) { - int i; - for(i=0; i < 4; i++) { + for(int i=0; i < 4; i++) { if(!strncmp(name, private_headers[i], strlen(private_headers[i]))) { return 1; } @@ -103,105 +102,51 @@ static switch_status_t kazoo_event_dup(switch_event_t **clone, switch_event_t *e return SWITCH_STATUS_SUCCESS; } -static int encode_event_old(switch_event_t *event, ei_x_buff *ebuf) { - switch_event_t *clone = NULL; - - if (kazoo_event_dup(&clone, event, kazoo_globals.event_filter) != SWITCH_STATUS_SUCCESS) { - return 0; - } - - ei_encode_switch_event(ebuf, clone); - - switch_event_destroy(&clone); - - return 1; -} - -static int encode_event_new(switch_event_t *event, ei_x_buff *ebuf) { - kazoo_message_ptr msg = NULL; - ei_event_binding_t *event_binding = (ei_event_binding_t *) event->bind_user_data; - - msg = kazoo_message_create_event(event, event_binding->event, kazoo_globals.events); - - if(msg == NULL) { - return 0; - } - - ei_x_encode_tuple_header(ebuf, 2); - ei_x_encode_atom(ebuf, "event"); - ei_encode_json(ebuf, msg->JObj); - - kazoo_message_destroy(&msg); - - return 1; -} - -/* - * event_handler is duplicated when there are 2+ nodes connected - * with the same bindings - * we should maintain a list of event_streams in event_binding struct - * and build a ref count in the message - * - */ static void event_handler(switch_event_t *event) { - ei_event_binding_t *event_binding = (ei_event_binding_t *) event->bind_user_data; - ei_event_stream_t *event_stream = event_binding->stream; - ei_x_buff *ebuf = NULL; - int res = 0; + switch_event_t *clone = NULL; + ei_event_stream_t *event_stream = (ei_event_stream_t *) event->bind_user_data; /* if mod_kazoo or the event stream isn't running dont push a new event */ if (!switch_test_flag(event_stream, LFLAG_RUNNING) || !switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { return; } - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Switch-Nodename", kazoo_globals.ei_cnode.thisnodename); + if (event->event_id == SWITCH_EVENT_CUSTOM) { + ei_event_binding_t *event_binding = event_stream->bindings; + unsigned short int found = 0; - switch_malloc(ebuf, sizeof(*ebuf)); - if(ebuf == NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate erlang buffer for mod_kazoo message\n"); - return; - } - memset(ebuf, 0, sizeof(*ebuf)); - - if(kazoo_globals.event_stream_preallocate > 0) { - ebuf->buff = malloc(kazoo_globals.event_stream_preallocate); - ebuf->buffsz = kazoo_globals.event_stream_preallocate; - ebuf->index = 0; - if(ebuf->buff == NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not pre-allocate memory for mod_kazoo message\n"); - switch_safe_free(ebuf); + if (!event->subclass_name) { + return; + } + + while(event_binding != NULL) { + if (event_binding->type == SWITCH_EVENT_CUSTOM) { + if(event_binding->subclass_name + && !strcmp(event->subclass_name, event_binding->subclass_name)) { + found = 1; + break; + } + } + event_binding = event_binding->next; + } + + if (!found) { return; } - ei_x_encode_version(ebuf); - } else { - ei_x_new_with_version(ebuf); } - - if(event_stream->node->legacy) { - res = encode_event_old(event, ebuf); - } else { - res = encode_event_new(event, ebuf); - } - - if(!res) { - ei_x_free(ebuf); - switch_safe_free(ebuf); - return; - } - - if (kazoo_globals.event_stream_preallocate > 0 && ebuf->buffsz > kazoo_globals.event_stream_preallocate) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "increased event stream buffer size to %d\n", ebuf->buffsz); - } - - if (switch_queue_trypush(event_stream->queue, ebuf) != SWITCH_STATUS_SUCCESS) { + /* try to clone the event and push it to the event stream thread */ + /* TODO: someday maybe the filter comes from the event_stream (set during init only) + * and is per-binding so we only send headers that a process requests */ + if (kazoo_event_dup(&clone, event, kazoo_globals.event_filter) == SWITCH_STATUS_SUCCESS) { + if (switch_queue_trypush(event_stream->queue, clone) != SWITCH_STATUS_SUCCESS) { /* if we couldn't place the cloned event into the listeners */ /* event queue make sure we destroy it, real good like */ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error placing the event in the listeners queue\n"); - ei_x_free(ebuf); - switch_safe_free(ebuf); + switch_event_destroy(&clone); + } + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory error: Have a good trip? See you next fall!\n"); } - } static void *SWITCH_THREAD_FUNC event_stream_loop(switch_thread_t *thread, void *obj) { @@ -233,8 +178,7 @@ static void *SWITCH_THREAD_FUNC event_stream_loop(switch_thread_t *thread, void /* check if a new connection is pending */ if (switch_pollset_poll(event_stream->pollset, 0, &numfds, &fds) == SWITCH_STATUS_SUCCESS) { - int32_t i; - for (i = 0; i < numfds; i++) { + for (int32_t i = 0; i < numfds; i++) { switch_socket_t *newsocket; /* accept the new client connection */ @@ -273,25 +217,46 @@ static void *SWITCH_THREAD_FUNC event_stream_loop(switch_thread_t *thread, void } /* if there was an event waiting in our queue send it to the client */ - if (switch_queue_pop_timeout(event_stream->queue, &pop, 200000) == SWITCH_STATUS_SUCCESS) { - ei_x_buff *ebuf = (ei_x_buff *) pop; + if (switch_queue_pop_timeout(event_stream->queue, &pop, 500000) == SWITCH_STATUS_SUCCESS) { + switch_event_t *event = (switch_event_t *) pop; if (event_stream->socket) { + ei_x_buff ebuf; char byte; short i = event_stream_framing; switch_size_t size = 1; + if(kazoo_globals.event_stream_preallocate > 0) { + ebuf.buff = malloc(kazoo_globals.event_stream_preallocate); + ebuf.buffsz = kazoo_globals.event_stream_preallocate; + ebuf.index = 0; + if(ebuf.buff == NULL) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not pre-allocate memory for mod_kazoo message\n"); + break; + } + ei_x_encode_version(&ebuf); + } else { + ei_x_new_with_version(&ebuf); + } + + ei_encode_switch_event(&ebuf, event); + + if (kazoo_globals.event_stream_preallocate > 0 && ebuf.buffsz > kazoo_globals.event_stream_preallocate) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "increased event stream buffer size to %d\n", ebuf.buffsz); + } + while (i) { - byte = ebuf->index >> (8 * --i); + byte = ebuf.index >> (8 * --i); switch_socket_send(event_stream->socket, &byte, &size); } - size = (switch_size_t)ebuf->index; - switch_socket_send(event_stream->socket, ebuf->buff, &size); + size = (switch_size_t)ebuf.index; + switch_socket_send(event_stream->socket, ebuf.buff, &size); + + ei_x_free(&ebuf); } - ei_x_free(ebuf); - switch_safe_free(ebuf); + switch_event_destroy(&event); } } @@ -332,12 +297,11 @@ static void *SWITCH_THREAD_FUNC event_stream_loop(switch_thread_t *thread, void return NULL; } -ei_event_stream_t *new_event_stream(ei_node_t *ei_node, const erlang_pid *from) { +ei_event_stream_t *new_event_stream(ei_event_stream_t **event_streams, const erlang_pid *from) { switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; switch_memory_pool_t *pool = NULL; ei_event_stream_t *event_stream; - ei_event_stream_t **event_streams = &ei_node->event_streams; /* create memory pool for this event stream */ if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { @@ -356,7 +320,6 @@ ei_event_stream_t *new_event_stream(ei_node_t *ei_node, const erlang_pid *from) event_stream->bindings = NULL; event_stream->pool = pool; event_stream->connected = SWITCH_FALSE; - event_stream->node = ei_node; memcpy(&event_stream->pid, from, sizeof(erlang_pid)); switch_queue_create(&event_stream->queue, MAX_QUEUE_LEN, pool); @@ -480,68 +443,17 @@ switch_status_t remove_event_streams(ei_event_stream_t **event_streams) { return SWITCH_STATUS_SUCCESS; } -void bind_event_profile(ei_event_binding_t *event_binding, kazoo_event_ptr event) -{ - switch_event_types_t event_type; - while(event != NULL) { - if (switch_name_event(event->name, &event_type) != SWITCH_STATUS_SUCCESS) { - event_type = SWITCH_EVENT_CUSTOM; - } - if(event_binding->type != SWITCH_EVENT_CUSTOM - && event_binding->type == event_type) { - break; - } - if (event_binding->type == SWITCH_EVENT_CUSTOM - && event_binding->type == event_type - && !strcasecmp(event_binding->subclass_name, event->name)) { - break; - } - event = event->next; - } - event_binding->event = event; - if(event == NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "EVENT BINDING ERROR %s - %s\n",switch_event_name(event_binding->type), event_binding->subclass_name); - } -} - -void bind_event_profiles(kazoo_event_ptr event) -{ - ei_node_t *ei_node = kazoo_globals.ei_nodes; - while(ei_node) { - ei_event_stream_t *event_streams = ei_node->event_streams; - while(event_streams) { - ei_event_binding_t *bindings = event_streams->bindings; - while(bindings) { - bind_event_profile(bindings, event); - bindings = bindings->next; - } - event_streams = event_streams->next; - } - ei_node = ei_node->next; - } -} - -switch_status_t add_event_binding(ei_event_stream_t *event_stream, const char *event_name) { +switch_status_t add_event_binding(ei_event_stream_t *event_stream, const switch_event_types_t event_type, const char *subclass_name) { ei_event_binding_t *event_binding = event_stream->bindings; - switch_event_types_t event_type; - - if(!strcasecmp(event_name, "CUSTOM")) { - return SWITCH_STATUS_SUCCESS; - } - - if (switch_name_event(event_name, &event_type) != SWITCH_STATUS_SUCCESS) { - event_type = SWITCH_EVENT_CUSTOM; - } /* check if the event binding already exists, ignore if so */ while(event_binding != NULL) { if (event_binding->type == SWITCH_EVENT_CUSTOM) { - if(event_type == SWITCH_EVENT_CUSTOM - && event_name - && event_binding->subclass_name - && !strcasecmp(event_name, event_binding->subclass_name)) { - return SWITCH_STATUS_SUCCESS; - } + if(subclass_name + && event_binding->subclass_name + && !strcmp(subclass_name, event_binding->subclass_name)) { + return SWITCH_STATUS_SUCCESS; + } } else if (event_binding->type == event_type) { return SWITCH_STATUS_SUCCESS; } @@ -555,21 +467,18 @@ switch_status_t add_event_binding(ei_event_stream_t *event_stream, const char *e } /* prepare the event binding struct */ - event_binding->stream = event_stream; event_binding->type = event_type; - if(event_binding->type == SWITCH_EVENT_CUSTOM) { - event_binding->subclass_name = switch_core_strdup(event_stream->pool, event_name); + if (!subclass_name || zstr(subclass_name)) { + event_binding->subclass_name = NULL; } else { - event_binding->subclass_name = SWITCH_EVENT_SUBCLASS_ANY; + /* TODO: free strdup? */ + event_binding->subclass_name = strdup(subclass_name); } event_binding->next = NULL; - bind_event_profile(event_binding, kazoo_globals.events->events); - - /* bind to the event with a unique ID and capture the event_node pointer */ switch_uuid_str(event_binding->id, sizeof(event_binding->id)); - if (switch_event_bind_removable(event_binding->id, event_type, event_binding->subclass_name, event_handler, event_binding, &event_binding->node) != SWITCH_STATUS_SUCCESS) { + if (switch_event_bind_removable(event_binding->id, event_type, subclass_name, event_handler, event_stream, &event_binding->node) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to bind to event %s %s!\n" ,switch_event_name(event_binding->type), event_binding->subclass_name ? event_binding->subclass_name : ""); return SWITCH_STATUS_GENERR; diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_fetch_agent.c b/src/mod/event_handlers/mod_kazoo/kazoo_fetch_agent.c index 0e4e842f2c..006ffe32f0 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_fetch_agent.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_fetch_agent.c @@ -32,9 +32,38 @@ */ #include "mod_kazoo.h" +struct xml_fetch_reply_s { + char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; + char *xml_str; + struct xml_fetch_reply_s *next; +}; +typedef struct xml_fetch_reply_s xml_fetch_reply_t; +struct fetch_handler_s { + erlang_pid pid; + struct fetch_handler_s *next; +}; +typedef struct fetch_handler_s fetch_handler_t; +struct ei_xml_client_s { + ei_node_t *ei_node; + fetch_handler_t *fetch_handlers; + struct ei_xml_client_s *next; +}; +typedef struct ei_xml_client_s ei_xml_client_t; +struct ei_xml_agent_s { + switch_memory_pool_t *pool; + switch_xml_section_t section; + switch_thread_rwlock_t *lock; + ei_xml_client_t *clients; + switch_mutex_t *current_client_mutex; + ei_xml_client_t *current_client; + switch_mutex_t *replies_mutex; + switch_thread_cond_t *new_reply; + xml_fetch_reply_t *replies; +}; +typedef struct ei_xml_agent_s ei_xml_agent_t; static char *xml_section_to_string(switch_xml_section_t section) { switch(section) { @@ -48,8 +77,6 @@ static char *xml_section_to_string(switch_xml_section_t section) { return "chatplan"; case SWITCH_XML_SECTION_CHANNELS: return "channels"; - case SWITCH_XML_SECTION_LANGUAGES: - return "languages"; default: return "unknown"; } @@ -106,11 +133,6 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con ei_xml_client_t *client; fetch_handler_t *fetch_handler; xml_fetch_reply_t reply, *pending, *prev = NULL; - switch_event_t *event = params; - kazoo_fetch_profile_ptr profile = agent->profile; - const char *fetch_call_id; - ei_send_msg_t *send_msg = NULL; - int sent = 0; now = switch_micro_time_now(); @@ -142,60 +164,12 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con return xml; } - if(event == NULL) { - if (switch_event_create(&event, SWITCH_EVENT_GENERAL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error creating event for fetch handler\n"); - return xml; - } - } - /* prepare the reply collector */ switch_uuid_get(&uuid); switch_uuid_format(reply.uuid_str, &uuid); reply.next = NULL; reply.xml_str = NULL; - if((fetch_call_id = switch_event_get_header(event, "Fetch-Call-UUID")) != NULL) { - switch_core_session_t *session = NULL; - if((session = switch_core_session_force_locate(fetch_call_id)) != NULL) { - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_channel_event_set_data(channel, event); - switch_core_session_rwunlock(session); - } - } - - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Fetch-UUID", reply.uuid_str); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Fetch-Section", section); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Fetch-Tag", tag_name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Fetch-Key-Name", key_name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Fetch-Key-Value", key_value); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Fetch-Timeout", "%u", profile->fetch_timeout); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Fetch-Timestamp-Micro", "%ld", (uint64_t)now); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Kazoo-Version", VERSION); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Kazoo-Bundle", BUNDLE); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Kazoo-Release", RELEASE); - - switch_malloc(send_msg, sizeof(*send_msg)); - - if(client->ei_node->legacy) { - ei_x_new_with_version(&send_msg->buf); - ei_x_encode_tuple_header(&send_msg->buf, 7); - ei_x_encode_atom(&send_msg->buf, "fetch"); - ei_x_encode_atom(&send_msg->buf, section); - _ei_x_encode_string(&send_msg->buf, tag_name ? tag_name : "undefined"); - _ei_x_encode_string(&send_msg->buf, key_name ? key_name : "undefined"); - _ei_x_encode_string(&send_msg->buf, key_value ? key_value : "undefined"); - _ei_x_encode_string(&send_msg->buf, reply.uuid_str); - ei_encode_switch_event_headers(&send_msg->buf, event); - } else { - kazoo_message_ptr msg = kazoo_message_create_fetch(event, profile); - ei_x_new_with_version(&send_msg->buf); - ei_x_encode_tuple_header(&send_msg->buf, 2); - ei_x_encode_atom(&send_msg->buf, "fetch"); - ei_encode_json(&send_msg->buf, msg->JObj); - kazoo_message_destroy(&msg); - } - /* add our reply placeholder to the replies list */ switch_mutex_lock(agent->replies_mutex); if (!agent->replies) { @@ -207,8 +181,28 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con switch_mutex_unlock(agent->replies_mutex); fetch_handler = client->fetch_handlers; - while (fetch_handler != NULL && sent == 0) { + while (fetch_handler != NULL) { + ei_send_msg_t *send_msg; + + switch_malloc(send_msg, sizeof(*send_msg)); memcpy(&send_msg->pid, &fetch_handler->pid, sizeof(erlang_pid)); + + ei_x_new_with_version(&send_msg->buf); + + ei_x_encode_tuple_header(&send_msg->buf, 7); + ei_x_encode_atom(&send_msg->buf, "fetch"); + ei_x_encode_atom(&send_msg->buf, section); + _ei_x_encode_string(&send_msg->buf, tag_name ? tag_name : "undefined"); + _ei_x_encode_string(&send_msg->buf, key_name ? key_name : "undefined"); + _ei_x_encode_string(&send_msg->buf, key_value ? key_value : "undefined"); + _ei_x_encode_string(&send_msg->buf, reply.uuid_str); + + if (params) { + ei_encode_switch_event_headers(&send_msg->buf, params); + } else { + ei_x_encode_empty_list(&send_msg->buf); + } + if (switch_queue_trypush(client->ei_node->send_msgs, send_msg) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to send %s XML request to %s <%d.%d.%d>\n" ,section @@ -216,6 +210,8 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con ,fetch_handler->pid.creation ,fetch_handler->pid.num ,fetch_handler->pid.serial); + ei_x_free(&send_msg->buf); + switch_safe_free(send_msg); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending %s XML request (%s) to %s <%d.%d.%d>\n" ,section @@ -224,19 +220,11 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con ,fetch_handler->pid.creation ,fetch_handler->pid.num ,fetch_handler->pid.serial); - sent = 1; } + fetch_handler = fetch_handler->next; } - if(!sent) { - ei_x_free(&send_msg->buf); - switch_safe_free(send_msg); - } - - if(params == NULL) - switch_event_destroy(&event); - /* wait for a reply (if there isnt already one...amazingly improbable but lets not take shortcuts */ switch_mutex_lock(agent->replies_mutex); @@ -304,42 +292,6 @@ static switch_xml_t fetch_handler(const char *section, const char *tag_name, con return xml; } -void bind_fetch_profile(ei_xml_agent_t *agent, kazoo_config_ptr fetch_handlers) -{ - switch_hash_index_t *hi; - kazoo_fetch_profile_ptr val = NULL, ptr = NULL; - - for (hi = switch_core_hash_first(fetch_handlers->hash); hi; hi = switch_core_hash_next(&hi)) { - switch_core_hash_this(hi, NULL, NULL, (void**) &val); - if (val && val->section == agent->section) { - ptr = val; - break; - } - } - agent->profile = ptr; -} - -void rebind_fetch_profiles(kazoo_config_ptr fetch_handlers) -{ - if(kazoo_globals.config_fetch_binding != NULL) - bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.config_fetch_binding), fetch_handlers); - - if(kazoo_globals.directory_fetch_binding != NULL) - bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.directory_fetch_binding), fetch_handlers); - - if(kazoo_globals.dialplan_fetch_binding != NULL) - bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.dialplan_fetch_binding), fetch_handlers); - - if(kazoo_globals.channels_fetch_binding != NULL) - bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.channels_fetch_binding), fetch_handlers); - - if(kazoo_globals.languages_fetch_binding != NULL) - bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.languages_fetch_binding), fetch_handlers); - - if(kazoo_globals.chatplan_fetch_binding != NULL) - bind_fetch_profile((ei_xml_agent_t *) switch_xml_get_binding_user_data(kazoo_globals.chatplan_fetch_binding), fetch_handlers); -} - static switch_status_t bind_fetch_agent(switch_xml_section_t section, switch_xml_binding_t **binding) { switch_memory_pool_t *pool = NULL; ei_xml_agent_t *agent; @@ -374,8 +326,6 @@ static switch_status_t bind_fetch_agent(switch_xml_section_t section, switch_xml switch_thread_cond_create(&agent->new_reply, pool); agent->replies = NULL; - bind_fetch_profile(agent, kazoo_globals.fetch_handlers); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Bound to %s XML requests\n" ,xml_section_to_string(section)); @@ -386,9 +336,6 @@ static switch_status_t unbind_fetch_agent(switch_xml_binding_t **binding) { ei_xml_agent_t *agent; ei_xml_client_t *client; - if(*binding == NULL) - return SWITCH_STATUS_GENERR; - /* get a pointer to our user_data */ agent = (ei_xml_agent_t *)switch_xml_get_binding_user_data(*binding); @@ -452,9 +399,6 @@ static switch_status_t remove_xml_client(ei_node_t *ei_node, switch_xml_binding_ ei_xml_client_t *client, *prev = NULL; int found = 0; - if(binding == NULL) - return SWITCH_STATUS_GENERR; - agent = (ei_xml_agent_t *)switch_xml_get_binding_user_data(binding); /* write-lock the agent */ @@ -631,9 +575,8 @@ switch_status_t bind_fetch_agents() { bind_fetch_agent(SWITCH_XML_SECTION_CONFIG, &kazoo_globals.config_fetch_binding); bind_fetch_agent(SWITCH_XML_SECTION_DIRECTORY, &kazoo_globals.directory_fetch_binding); bind_fetch_agent(SWITCH_XML_SECTION_DIALPLAN, &kazoo_globals.dialplan_fetch_binding); - bind_fetch_agent(SWITCH_XML_SECTION_CHANNELS, &kazoo_globals.channels_fetch_binding); - bind_fetch_agent(SWITCH_XML_SECTION_LANGUAGES, &kazoo_globals.languages_fetch_binding); bind_fetch_agent(SWITCH_XML_SECTION_CHATPLAN, &kazoo_globals.chatplan_fetch_binding); + bind_fetch_agent(SWITCH_XML_SECTION_CHANNELS, &kazoo_globals.channels_fetch_binding); return SWITCH_STATUS_SUCCESS; } @@ -642,9 +585,8 @@ switch_status_t unbind_fetch_agents() { unbind_fetch_agent(&kazoo_globals.config_fetch_binding); unbind_fetch_agent(&kazoo_globals.directory_fetch_binding); unbind_fetch_agent(&kazoo_globals.dialplan_fetch_binding); - unbind_fetch_agent(&kazoo_globals.channels_fetch_binding); - unbind_fetch_agent(&kazoo_globals.languages_fetch_binding); unbind_fetch_agent(&kazoo_globals.chatplan_fetch_binding); + unbind_fetch_agent(&kazoo_globals.channels_fetch_binding); return SWITCH_STATUS_SUCCESS; } @@ -653,9 +595,8 @@ switch_status_t remove_xml_clients(ei_node_t *ei_node) { remove_xml_client(ei_node, kazoo_globals.config_fetch_binding); remove_xml_client(ei_node, kazoo_globals.directory_fetch_binding); remove_xml_client(ei_node, kazoo_globals.dialplan_fetch_binding); - remove_xml_client(ei_node, kazoo_globals.channels_fetch_binding); - remove_xml_client(ei_node, kazoo_globals.languages_fetch_binding); remove_xml_client(ei_node, kazoo_globals.chatplan_fetch_binding); + remove_xml_client(ei_node, kazoo_globals.channels_fetch_binding); return SWITCH_STATUS_SUCCESS; } @@ -665,9 +606,6 @@ switch_status_t add_fetch_handler(ei_node_t *ei_node, erlang_pid *from, switch_x ei_xml_client_t *client; fetch_handler_t *fetch_handler; - if(binding == NULL) - return SWITCH_STATUS_GENERR; - agent = (ei_xml_agent_t *)switch_xml_get_binding_user_data(binding); /* write-lock the agent */ @@ -715,9 +653,8 @@ switch_status_t remove_fetch_handlers(ei_node_t *ei_node, erlang_pid *from) { remove_fetch_handler(ei_node, from, kazoo_globals.config_fetch_binding); remove_fetch_handler(ei_node, from, kazoo_globals.directory_fetch_binding); remove_fetch_handler(ei_node, from, kazoo_globals.dialplan_fetch_binding); - remove_fetch_handler(ei_node, from, kazoo_globals.channels_fetch_binding); - remove_fetch_handler(ei_node, from, kazoo_globals.languages_fetch_binding); remove_fetch_handler(ei_node, from, kazoo_globals.chatplan_fetch_binding); + remove_fetch_handler(ei_node, from, kazoo_globals.channels_fetch_binding); return SWITCH_STATUS_SUCCESS; } @@ -752,9 +689,8 @@ switch_status_t handle_api_command_streams(ei_node_t *ei_node, switch_stream_han handle_api_command_stream(ei_node, stream, kazoo_globals.config_fetch_binding); handle_api_command_stream(ei_node, stream, kazoo_globals.directory_fetch_binding); handle_api_command_stream(ei_node, stream, kazoo_globals.dialplan_fetch_binding); - handle_api_command_stream(ei_node, stream, kazoo_globals.channels_fetch_binding); - handle_api_command_stream(ei_node, stream, kazoo_globals.languages_fetch_binding); handle_api_command_stream(ei_node, stream, kazoo_globals.chatplan_fetch_binding); + handle_api_command_stream(ei_node, stream, kazoo_globals.channels_fetch_binding); return SWITCH_STATUS_SUCCESS; } diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_fields.h b/src/mod/event_handlers/mod_kazoo/kazoo_fields.h deleted file mode 100644 index 95aab4e917..0000000000 --- a/src/mod/event_handlers/mod_kazoo/kazoo_fields.h +++ /dev/null @@ -1,195 +0,0 @@ -/* -* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* Copyright (C) 2005-2012, Anthony Minessale II -* -* Version: MPL 1.1 -* -* The contents of this file are subject to the Mozilla Public License Version -* 1.1 (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* http://www.mozilla.org/MPL/ -* -* Software distributed under the License is distributed on an "AS IS" basis, -* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -* for the specific language governing rights and limitations under the -* License. -* -* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* -* The Initial Developer of the Original Code is -* Anthony Minessale II -* Portions created by the Initial Developer are Copyright (C) -* the Initial Developer. All Rights Reserved. -* -* Based on mod_skel by -* Anthony Minessale II -* -* Contributor(s): -* -* Daniel Bryars -* Tim Brown -* Anthony Minessale II -* William King -* Mike Jerris -* -* kazoo.c -- Sends FreeSWITCH events to an AMQP broker -* -*/ - -#ifndef KAZOO_FIELDS_H -#define KAZOO_FIELDS_H - -#include - -#define MAX_LIST_FIELDS 25 - -typedef struct kazoo_log_levels kazoo_loglevels_t; -typedef kazoo_loglevels_t *kazoo_loglevels_ptr; - -struct kazoo_log_levels -{ - switch_log_level_t success_log_level; - switch_log_level_t failed_log_level; - switch_log_level_t warn_log_level; - switch_log_level_t info_log_level; - switch_log_level_t time_log_level; - switch_log_level_t filtered_event_log_level; - switch_log_level_t filtered_field_log_level; - -}; - -typedef struct kazoo_logging kazoo_logging_t; -typedef kazoo_logging_t *kazoo_logging_ptr; - -struct kazoo_logging -{ - kazoo_loglevels_ptr levels; - const char *profile_name; - const char *event_name; -}; - -typedef struct kazoo_list_s { - char *value[MAX_LIST_FIELDS]; - int size; -} kazoo_list_t; - -typedef enum { - FILTER_COMPARE_REGEX, - FILTER_COMPARE_LIST, - FILTER_COMPARE_VALUE, - FILTER_COMPARE_PREFIX, - FILTER_COMPARE_EXISTS -} kazoo_filter_compare_type; - -typedef enum { - FILTER_EXCLUDE, - FILTER_INCLUDE, - FILTER_ENSURE -} kazoo_filter_type; - -typedef struct kazoo_filter_t { - kazoo_filter_type type; - kazoo_filter_compare_type compare; - char* name; - char* value; - kazoo_list_t list; - struct kazoo_filter_t* next; -} kazoo_filter, *kazoo_filter_ptr; - - -typedef enum { - JSON_NONE, - JSON_STRING, - JSON_NUMBER, - JSON_BOOLEAN, - JSON_OBJECT, - JSON_RAW -} kazoo_json_field_type; - -typedef enum { - FIELD_NONE, - FIELD_COPY, - FIELD_STATIC, - FIELD_FIRST_OF, - FIELD_EXPAND, - FIELD_PREFIX, - FIELD_OBJECT, - FIELD_GROUP, - FIELD_REFERENCE, - -} kazoo_field_type; - -typedef struct kazoo_field_t kazoo_field; -typedef kazoo_field *kazoo_field_ptr; - -typedef struct kazoo_fields_t kazoo_fields; -typedef kazoo_fields *kazoo_fields_ptr; - -typedef struct kazoo_definition_t kazoo_definition; -typedef kazoo_definition *kazoo_definition_ptr; - -struct kazoo_field_t { - char* name; - char* value; - char* as; - kazoo_list_t list; - switch_bool_t exclude_prefix; - kazoo_field_type in_type; - kazoo_json_field_type out_type; - kazoo_filter_ptr filter; - - kazoo_definition_ptr ref; - kazoo_field_ptr next; - kazoo_fields_ptr children; -}; - -struct kazoo_fields_t { - kazoo_field_ptr head; - int verbose; -}; - - -struct kazoo_definition_t { - char* name; - kazoo_field_ptr head; - kazoo_filter_ptr filter; -}; - -struct kazoo_event { - kazoo_event_profile_ptr profile; - char *name; - kazoo_fields_ptr fields; - kazoo_filter_ptr filter; - - kazoo_event_t* next; -}; - -struct kazoo_event_profile { - char *name; - kazoo_config_ptr root; - switch_bool_t running; - switch_memory_pool_t *pool; - kazoo_filter_ptr filter; - kazoo_fields_ptr fields; - kazoo_event_ptr events; - - kazoo_loglevels_ptr logging; -}; - -struct kazoo_fetch_profile { - char *name; - kazoo_config_ptr root; - switch_bool_t running; - switch_memory_pool_t *pool; - kazoo_fields_ptr fields; - int fetch_timeout; - switch_mutex_t *fetch_reply_mutex; - switch_hash_t *fetch_reply_hash; - switch_xml_binding_t *fetch_binding; - switch_xml_section_t section; - - kazoo_loglevels_ptr logging; -}; - -#endif /* KAZOO_FIELDS_H */ - diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_message.c b/src/mod/event_handlers/mod_kazoo/kazoo_message.c deleted file mode 100644 index c95a254062..0000000000 --- a/src/mod/event_handlers/mod_kazoo/kazoo_message.c +++ /dev/null @@ -1,458 +0,0 @@ -/* -* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* Copyright (C) 2005-2012, Anthony Minessale II -* -* Version: MPL 1.1 -* -* The contents of this file are subject to the Mozilla Public License Version -* 1.1 (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* http://www.mozilla.org/MPL/ -* -* Software distributed under the License is distributed on an "AS IS" basis, -* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -* for the specific language governing rights and limitations under the -* License. -* -* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* -* The Initial Developer of the Original Code is -* Anthony Minessale II -* Portions created by the Initial Developer are Copyright (C) -* the Initial Developer. All Rights Reserved. -* -* Based on mod_skel by -* Anthony Minessale II -* -* Contributor(s): -* -* Daniel Bryars -* Tim Brown -* Anthony Minessale II -* William King -* Mike Jerris -* -* kazoo.c -- Sends FreeSWITCH events to an AMQP broker -* -*/ - -#include "mod_kazoo.h" - -/* deletes then add */ -void kazoo_cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) -{ - cJSON_DeleteItemFromObject(object, string); - cJSON_AddItemToObject(object, string, item); -} - -static int inline filter_compare(switch_event_t* evt, kazoo_filter_ptr filter) -{ - switch_event_header_t *header; - int hasValue = 0, /*size, */n; - char *value; - - switch(filter->compare) { - - case FILTER_COMPARE_EXISTS: - hasValue = switch_event_get_header(evt, filter->name) != NULL ? 1 : 0; - break; - - case FILTER_COMPARE_VALUE: - value = switch_event_get_header_nil(evt, filter->name); - hasValue = !strcmp(value, filter->value); - break; - - case FILTER_COMPARE_PREFIX: - for (header = evt->headers; header; header = header->next) { - if(!strncmp(header->name, filter->value, strlen(filter->value))) { - hasValue = 1; - break; - } - } - break; - - case FILTER_COMPARE_LIST: - value = switch_event_get_header(evt, filter->name); - if(value) { - for(n = 0; n < filter->list.size; n++) { - if(!strncmp(value, filter->list.value[n], strlen(filter->list.value[n]))) { - hasValue = 1; - break; - } - } - } - break; - - case FILTER_COMPARE_REGEX: - break; - - default: - break; - } - - return hasValue; -} - -static kazoo_filter_ptr inline filter_event(switch_event_t* evt, kazoo_filter_ptr filter) -{ - while(filter) { - int hasValue = filter_compare(evt, filter); - if(filter->type == FILTER_EXCLUDE) { - if(hasValue) - break; - } else if(filter->type == FILTER_INCLUDE) { - if(!hasValue) - break; - } - filter = filter->next; - } - return filter; -} - -static void kazoo_event_init_json_fields(switch_event_t *event, cJSON *json) -{ - switch_event_header_t *hp; - for (hp = event->headers; hp; hp = hp->next) { - if (hp->idx) { - cJSON *a = cJSON_CreateArray(); - int i; - - for(i = 0; i < hp->idx; i++) { - cJSON_AddItemToArray(a, cJSON_CreateString(hp->array[i])); - } - - cJSON_AddItemToObject(json, hp->name, a); - - } else { - cJSON_AddItemToObject(json, hp->name, cJSON_CreateString(hp->value)); - } - } -} - -static switch_status_t kazoo_event_init_json(kazoo_fields_ptr fields1, kazoo_fields_ptr fields2, switch_event_t* evt, cJSON** clone) -{ - switch_status_t status; - if( (fields2 && fields2->verbose) - || (fields1 && fields1->verbose) - || ( (!fields2) && (!fields1)) ) { - status = switch_event_serialize_json_obj(evt, clone); - } else { - status = SWITCH_STATUS_SUCCESS; - *clone = cJSON_CreateObject(); - if((*clone) == NULL) { - status = SWITCH_STATUS_GENERR; - } - } - return status; -} - -static cJSON * kazoo_event_json_value(kazoo_json_field_type type, const char *value) { - cJSON *item = NULL; - switch(type) { - case JSON_STRING: - item = cJSON_CreateString(value); - break; - - case JSON_NUMBER: - item = cJSON_CreateNumber(strtod(value, NULL)); - break; - - case JSON_BOOLEAN: - item = cJSON_CreateBool(switch_true(value)); - break; - - case JSON_OBJECT: - item = cJSON_CreateObject(); - break; - - case JSON_RAW: - item = cJSON_CreateRaw(value); - break; - - default: - break; - }; - - return item; -} - -static cJSON * kazoo_event_add_json_value(cJSON *dst, kazoo_field_ptr field, const char *as, const char *value) { - cJSON *item = NULL; - if(value || field->out_type == JSON_OBJECT) { - if((item = kazoo_event_json_value(field->out_type, value)) != NULL) { - kazoo_cJSON_AddItemToObject(dst, as, item); - } - } - return item; -} - -#define MAX_FIRST_OF 25 - -char * first_of(switch_event_t *src, char * in) -{ - switch_event_header_t *header; - char *y1, *y2, *y3 = NULL; - char *value[MAX_FIRST_OF]; - int n, size; - - y1 = strdup(in); - if((y2 = (char *) switch_stristr("first-of", y1)) != NULL) { - char tmp[2048] = ""; - y3 = switch_find_end_paren((const char *)y2 + 8, '(', ')'); - *++y3='\0'; - *y2 = '\0'; - size = switch_separate_string(y2 + 9, '|', value, MAX_FIRST_OF); - for(n=0; n < size; n++) { - header = switch_event_get_header_ptr(src, value[n]); - if(header) { - switch_snprintf(tmp, sizeof(tmp), "%s%s%s", y1, header->name, y3); - free(y1); - y2 = strdup(tmp); - y3 = first_of(src, y2); - if(y2 == y3) { - return y2; - } else { - return y3; - } - } - } - } - free(y1); - return in; - -} - -cJSON * kazoo_event_add_field_to_json(cJSON *dst, switch_event_t *src, kazoo_field_ptr field) -{ - switch_event_header_t *header; - char *expanded, *firstOf; - uint i, n; - cJSON *item = NULL; - - switch(field->in_type) { - case FIELD_COPY: - if((header = switch_event_get_header_ptr(src, field->name)) != NULL) { - if (header->idx) { - item = cJSON_CreateArray(); - for(i = 0; i < header->idx; i++) { - cJSON_AddItemToArray(item, kazoo_event_json_value(field->out_type, header->array[i])); - } - kazoo_cJSON_AddItemToObject(dst, field->as ? field->as : field->name, item); - } else { - item = kazoo_event_add_json_value(dst, field, field->as ? field->as : field->name, header->value); - } - } - break; - - case FIELD_EXPAND: - firstOf = first_of(src, field->value); - expanded = switch_event_expand_headers(src, firstOf); - if(expanded != NULL && !zstr(expanded)) { - item = kazoo_event_add_json_value(dst, field, field->as ? field->as : field->name, expanded); - } - if(expanded != firstOf) { - free(expanded); - } - if(firstOf != field->value) { - free(firstOf); - } - break; - - case FIELD_FIRST_OF: - for(n = 0; n < field->list.size; n++) { - if(*field->list.value[n] == '#') { - item = kazoo_event_add_json_value(dst, field, field->as ? field->as : field->name, ++field->list.value[n]); - break; - } else { - header = switch_event_get_header_ptr(src, field->list.value[n]); - if(header) { - if (header->idx) { - item = cJSON_CreateArray(); - for(i = 0; i < header->idx; i++) { - cJSON_AddItemToArray(item, kazoo_event_json_value(field->out_type, header->array[i])); - } - kazoo_cJSON_AddItemToObject(dst, field->as ? field->as : field->name, item); - } else { - item = kazoo_event_add_json_value(dst, field, field->as ? field->as : field->name, header->value); - } - break; - } - } - } - break; - - case FIELD_PREFIX: - for (header = src->headers; header; header = header->next) { - if(!strncmp(header->name, field->name, strlen(field->name))) { - if (header->idx) { - cJSON *array = cJSON_CreateArray(); - for(i = 0; i < header->idx; i++) { - cJSON_AddItemToArray(array, kazoo_event_json_value(field->out_type, header->array[i])); - } - kazoo_cJSON_AddItemToObject(dst, field->exclude_prefix ? header->name+strlen(field->name) : header->name, array); - } else { - kazoo_event_add_json_value(dst, field, field->exclude_prefix ? header->name+strlen(field->name) : header->name, header->value); - } - } - } - break; - - case FIELD_STATIC: - item = kazoo_event_add_json_value(dst, field, field->name, field->value); - break; - - case FIELD_GROUP: - item = dst; - break; - - default: - break; - } - - return item; -} - -static switch_status_t kazoo_event_add_fields_to_json(kazoo_logging_ptr logging, cJSON *dst, switch_event_t *src, kazoo_field_ptr field) { - - kazoo_filter_ptr filter; - cJSON *item = NULL; - while(field) { - if(field->in_type == FIELD_REFERENCE) { - if(field->ref) { - if((filter = filter_event(src, field->ref->filter)) != NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, logging->levels->filtered_field_log_level, "profile[%s] event %s, referenced field %s filtered by settings %s : %s\n", logging->profile_name, logging->event_name, field->ref->name, filter->name, filter->value); - } else { - kazoo_event_add_fields_to_json(logging, dst, src, field->ref->head); - } - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "profile[%s] event %s, referenced field %s not found\n", logging->profile_name, logging->event_name, field->name); - } - } else { - if((filter = filter_event(src, field->filter)) != NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, logging->levels->filtered_field_log_level, "profile[%s] event %s, field %s filtered by settings %s : %s\n", logging->profile_name, logging->event_name, field->name, filter->name, filter->value); - } else { - item = kazoo_event_add_field_to_json(dst, src, field); - if(field->children && item != NULL) { - if(field->children->verbose && field->out_type == JSON_OBJECT) { - kazoo_event_init_json_fields(src, item); - } - kazoo_event_add_fields_to_json(logging, field->out_type == JSON_OBJECT ? item : dst, src, field->children->head); - } - } - } - - field = field->next; - } - - return SWITCH_STATUS_SUCCESS; -} - - -kazoo_message_ptr kazoo_message_create_event(switch_event_t* evt, kazoo_event_ptr event, kazoo_event_profile_ptr profile) -{ - kazoo_message_ptr message; - cJSON *JObj = NULL; - kazoo_filter_ptr filtered; - kazoo_logging_t logging; - - logging.levels = profile->logging; - logging.event_name = switch_event_get_header_nil(evt, "Event-Name"); - logging.profile_name = profile->name; - - switch_event_add_header(evt, SWITCH_STACK_BOTTOM, "Switch-Nodename", "%s@%s", "freeswitch", switch_event_get_header(evt, "FreeSWITCH-Hostname")); - - - message = malloc(sizeof(kazoo_message_t)); - if(message == NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error allocating memory for serializing event to json\n"); - return NULL; - } - memset(message, 0, sizeof(kazoo_message_t)); - - if(profile->filter) { - // filtering - if((filtered = filter_event(evt, profile->filter)) != NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, logging.levels->filtered_event_log_level, "profile[%s] event %s filtered by profile settings %s : %s\n", logging.profile_name, logging.event_name, filtered->name, filtered->value); - kazoo_message_destroy(&message); - return NULL; - } - } - - if(event && event->filter) { - if((filtered = filter_event(evt, event->filter)) != NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, logging.levels->filtered_event_log_level, "profile[%s] event %s filtered by event settings %s : %s\n", logging.profile_name, logging.event_name, filtered->name, filtered->value); - kazoo_message_destroy(&message); - return NULL; - } - } - - kazoo_event_init_json(profile->fields, event ? event->fields : NULL, evt, &JObj); - - if(profile->fields) - kazoo_event_add_fields_to_json(&logging, JObj, evt, profile->fields->head); - - if(event && event->fields) - kazoo_event_add_fields_to_json(&logging, JObj, evt, event->fields->head); - - message->JObj = JObj; - - - return message; - - -} - -kazoo_message_ptr kazoo_message_create_fetch(switch_event_t* evt, kazoo_fetch_profile_ptr profile) -{ - kazoo_message_ptr message; - cJSON *JObj = NULL; - kazoo_logging_t logging; - - logging.levels = profile->logging; - logging.event_name = switch_event_get_header_nil(evt, "Event-Name"); - logging.profile_name = profile->name; - - switch_event_add_header(evt, SWITCH_STACK_BOTTOM, "Switch-Nodename", "%s@%s", "freeswitch", switch_event_get_header(evt, "FreeSWITCH-Hostname")); - - message = malloc(sizeof(kazoo_message_t)); - if(message == NULL) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error allocating memory for serializing event to json\n"); - return NULL; - } - memset(message, 0, sizeof(kazoo_message_t)); - - - kazoo_event_init_json(profile->fields, NULL, evt, &JObj); - - if(profile->fields) - kazoo_event_add_fields_to_json(&logging, JObj, evt, profile->fields->head); - - message->JObj = JObj; - - - return message; - - -} - - -void kazoo_message_destroy(kazoo_message_ptr *msg) -{ - if (!msg || !*msg) return; - if((*msg)->JObj != NULL) - cJSON_Delete((*msg)->JObj); - switch_safe_free(*msg); - -} - - -/* For Emacs: - * Local Variables: - * mode:c - * indent-tabs-mode:t - * tab-width:4 - * c-basic-offset:4 - * End: - * For VIM: - * vim:set softtabstop=4 shiftwidth=4 tabstop=4 - */ diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_message.h b/src/mod/event_handlers/mod_kazoo/kazoo_message.h deleted file mode 100644 index 0674c71f0b..0000000000 --- a/src/mod/event_handlers/mod_kazoo/kazoo_message.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* Copyright (C) 2005-2012, Anthony Minessale II -* -* Version: MPL 1.1 -* -* The contents of this file are subject to the Mozilla Public License Version -* 1.1 (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* http://www.mozilla.org/MPL/ -* -* Software distributed under the License is distributed on an "AS IS" basis, -* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -* for the specific language governing rights and limitations under the -* License. -* -* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application -* -* The Initial Developer of the Original Code is -* Anthony Minessale II -* Portions created by the Initial Developer are Copyright (C) -* the Initial Developer. All Rights Reserved. -* -* Based on mod_skel by -* Anthony Minessale II -* -* Contributor(s): -* -* Daniel Bryars -* Tim Brown -* Anthony Minessale II -* William King -* Mike Jerris -* -* kazoo.c -- Sends FreeSWITCH events to an AMQP broker -* -*/ - -#ifndef KAZOO_MESSAGE_H -#define KAZOO_MESSAGE_H - -#include - -typedef struct { - uint64_t timestamp; - uint64_t start; - uint64_t filter; - uint64_t serialize; - uint64_t print; - uint64_t rk; -} kazoo_message_times_t, *kazoo_message_times_ptr; - -typedef struct { - cJSON *JObj; -} kazoo_message_t, *kazoo_message_ptr; - - -kazoo_message_ptr kazoo_message_create_event(switch_event_t* evt, kazoo_event_ptr event, kazoo_event_profile_ptr profile); -kazoo_message_ptr kazoo_message_create_fetch(switch_event_t* evt, kazoo_fetch_profile_ptr profile); - -void kazoo_message_destroy(kazoo_message_ptr *msg); - - -#endif /* KAZOO_MESSAGE_H */ - diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_node.c b/src/mod/event_handlers/mod_kazoo/kazoo_node.c index 3ec739e74b..17da6dc582 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_node.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_node.c @@ -53,8 +53,6 @@ static char *REQUEST_ATOMS[] = { "nixevent", "sendevent", "sendmsg", - "commands", - "command", "bind", "getpid", "version", @@ -64,8 +62,7 @@ static char *REQUEST_ATOMS[] = { "fetch_reply", "config", "bgapi4", - "api4", - "no_legacy" + "api4" }; typedef enum { @@ -75,8 +72,6 @@ typedef enum { REQUEST_NIXEVENT, REQUEST_SENDEVENT, REQUEST_SENDMSG, - REQUEST_COMMANDS, - REQUEST_COMMAND, REQUEST_BIND, REQUEST_GETPID, REQUEST_VERSION, @@ -87,13 +82,11 @@ typedef enum { REQUEST_CONFIG, REQUEST_BGAPI4, REQUEST_API4, - REQUEST_NO_LEGACY, REQUEST_MAX } request_atoms_t; static switch_status_t find_request(char *atom, int *request) { - int i; - for (i = 0; i < REQUEST_MAX; i++) { + for (int i = 0; i < REQUEST_MAX; i++) { if(!strncmp(atom, REQUEST_ATOMS[i], MAXATOMLEN)) { *request = i; return SWITCH_STATUS_SUCCESS; @@ -274,7 +267,7 @@ static switch_status_t api_exec_stream(char *cmd, char *arg, switch_stream_handl } } else if (!stream->data || !strlen(stream->data)) { *reply = switch_mprintf("%s: Command returned no output", cmd); - status = SWITCH_STATUS_SUCCESS; + status = SWITCH_STATUS_FALSE; } else { *reply = strdup(stream->data); status = SWITCH_STATUS_SUCCESS; @@ -419,10 +412,11 @@ static void log_sendmsg_request(char *uuid, switch_event_t *event) switch_ssize_t hlen = -1; unsigned long CMD_EXECUTE = switch_hashfunc_default("execute", &hlen); unsigned long CMD_XFEREXT = switch_hashfunc_default("xferext", &hlen); + // unsigned long CMD_HANGUP = switch_hashfunc_default("hangup", &hlen); + // unsigned long CMD_NOMEDIA = switch_hashfunc_default("nomedia", &hlen); + // unsigned long CMD_UNICAST = switch_hashfunc_default("unicast", &hlen); if (zstr(cmd)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "log|%s|invalid \n", uuid); - DUMP_EVENT(event); return; } @@ -459,7 +453,6 @@ static void log_sendmsg_request(char *uuid, switch_event_t *event) static switch_status_t build_event(switch_event_t *event, ei_x_buff * buf) { int propslist_length, arity; - int n=0; if(!event) { return SWITCH_STATUS_FALSE; @@ -469,7 +462,7 @@ static switch_status_t build_event(switch_event_t *event, ei_x_buff * buf) { return SWITCH_STATUS_FALSE; } - while (!ei_decode_tuple_header(buf->buff, &buf->index, &arity) && n < propslist_length) { + while (!ei_decode_tuple_header(buf->buff, &buf->index, &arity)) { char key[1024]; char *value; @@ -489,21 +482,9 @@ static switch_status_t build_event(switch_event_t *event, ei_x_buff * buf) { switch_safe_free(event->body); event->body = value; } else { - if(!strcasecmp(key, "Call-ID")) { - switch_core_session_t *session = NULL; - if(!zstr(value)) { - if ((session = switch_core_session_force_locate(value)) != NULL) { - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_channel_event_set_data(channel, event); - switch_core_session_rwunlock(session); - } - } - } switch_event_add_header_string(event, SWITCH_STACK_BOTTOM | SWITCH_STACK_NODUP, key, value); } - n++; } - ei_skip_term(buf->buff, &buf->index); return SWITCH_STATUS_SUCCESS; } @@ -544,16 +525,6 @@ static switch_status_t erlang_response_ok(ei_x_buff *rbuf) { return SWITCH_STATUS_SUCCESS; } -static switch_status_t erlang_response_ok_uuid(ei_x_buff *rbuf, const char * uuid) { - if (rbuf) { - ei_x_encode_tuple_header(rbuf, 2); - ei_x_encode_atom(rbuf, "ok"); - ei_x_encode_binary(rbuf, uuid, strlen(uuid)); - } - - return SWITCH_STATUS_SUCCESS; -} - static switch_status_t handle_request_noevents(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { ei_event_stream_t *event_stream; @@ -583,7 +554,6 @@ static switch_status_t handle_request_nixevent(ei_node_t *ei_node, erlang_pid *p switch_event_types_t event_type; ei_event_stream_t *event_stream; int custom = 0, length = 0; - int i; if (ei_decode_list_header(buf->buff, &buf->index, &length) || length == 0) { @@ -596,7 +566,7 @@ static switch_status_t handle_request_nixevent(ei_node_t *ei_node, erlang_pid *p return erlang_response_ok(rbuf); } - for (i = 1; i <= length; i++) { + for (int i = 1; i <= length; i++) { if (ei_decode_atom_safe(buf->buff, &buf->index, event_name)) { switch_mutex_unlock(ei_node->event_streams_mutex); return erlang_response_badarg(rbuf); @@ -606,22 +576,16 @@ static switch_status_t handle_request_nixevent(ei_node_t *ei_node, erlang_pid *p remove_event_binding(event_stream, SWITCH_EVENT_CUSTOM, event_name); } else if (switch_name_event(event_name, &event_type) == SWITCH_STATUS_SUCCESS) { switch (event_type) { - case SWITCH_EVENT_CUSTOM: custom++; break; - case SWITCH_EVENT_ALL: - { - switch_event_types_t type; - for (type = 0; type < SWITCH_EVENT_ALL; type++) { + for (switch_event_types_t type = 0; type < SWITCH_EVENT_ALL; type++) { if(type != SWITCH_EVENT_CUSTOM) { remove_event_binding(event_stream, type, NULL); } } break; - } - default: remove_event_binding(event_stream, event_type, NULL); } @@ -668,82 +632,6 @@ static switch_status_t handle_request_sendevent(ei_node_t *ei_node, erlang_pid * return erlang_response_badarg(rbuf); } -static switch_status_t handle_request_command(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { - switch_core_session_t *session; - switch_event_t *event = NULL; - char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; - switch_uuid_t cmd_uuid; - char cmd_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; - - if (ei_decode_string_or_binary_limited(buf->buff, &buf->index, sizeof(uuid_str), uuid_str)) { - return erlang_response_badarg(rbuf); - } - - switch_uuid_get(&cmd_uuid); - switch_uuid_format(cmd_uuid_str, &cmd_uuid); - - switch_event_create(&event, SWITCH_EVENT_COMMAND); - if (build_event(event, buf) != SWITCH_STATUS_SUCCESS) { - return erlang_response_badarg(rbuf); - } - - log_sendmsg_request(uuid_str, event); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-uuid", cmd_uuid_str); - - if (zstr_buf(uuid_str) || !(session = switch_core_session_locate(uuid_str))) { - return erlang_response_baduuid(rbuf); - } - switch_core_session_queue_private_event(session, &event, SWITCH_FALSE); - switch_core_session_rwunlock(session); - - return erlang_response_ok_uuid(rbuf, cmd_uuid_str); -} - -static switch_status_t handle_request_commands(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { - switch_core_session_t *session; - char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; - int propslist_length, n; - switch_uuid_t cmd_uuid; - char cmd_uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; - - if (ei_decode_string_or_binary_limited(buf->buff, &buf->index, sizeof(uuid_str), uuid_str)) { - return erlang_response_badarg(rbuf); - } - - if (zstr_buf(uuid_str) || !(session = switch_core_session_locate(uuid_str))) { - return erlang_response_baduuid(rbuf); - } - - switch_uuid_get(&cmd_uuid); - switch_uuid_format(cmd_uuid_str, &cmd_uuid); - - if (ei_decode_list_header(buf->buff, &buf->index, &propslist_length)) { - switch_core_session_rwunlock(session); - return SWITCH_STATUS_FALSE; - } - - for(n = 0; n < propslist_length; n++) { - switch_event_t *event = NULL; - switch_event_create(&event, SWITCH_EVENT_COMMAND); - if (build_event(event, buf) != SWITCH_STATUS_SUCCESS) { - switch_core_session_rwunlock(session); - return erlang_response_badarg(rbuf); - } - log_sendmsg_request(uuid_str, event); - if(n == (propslist_length - 1)) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-uuid", cmd_uuid_str); - } else { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-uuid", "null"); - } - switch_core_session_queue_private_event(session, &event, SWITCH_FALSE); - } - - switch_core_session_rwunlock(session); - - return erlang_response_ok_uuid(rbuf, cmd_uuid_str); - -} - static switch_status_t handle_request_sendmsg(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { switch_core_session_t *session; switch_event_t *event = NULL; @@ -771,8 +659,8 @@ static switch_status_t handle_request_sendmsg(ei_node_t *ei_node, erlang_pid *pi static switch_status_t handle_request_config(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { - fetch_config(); - return erlang_response_ok(rbuf); + fetch_config_filters(); + return erlang_response_ok(rbuf); } static switch_status_t handle_request_bind(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { @@ -787,8 +675,8 @@ static switch_status_t handle_request_bind(ei_node_t *ei_node, erlang_pid *pid, switch(section) { case SWITCH_XML_SECTION_CONFIG: add_fetch_handler(ei_node, pid, kazoo_globals.config_fetch_binding); - if(!kazoo_globals.config_fetched) - fetch_config(); + if(!kazoo_globals.config_filters_fetched) + fetch_config_filters(); break; case SWITCH_XML_SECTION_DIRECTORY: add_fetch_handler(ei_node, pid, kazoo_globals.directory_fetch_binding); @@ -796,15 +684,12 @@ static switch_status_t handle_request_bind(ei_node_t *ei_node, erlang_pid *pid, case SWITCH_XML_SECTION_DIALPLAN: add_fetch_handler(ei_node, pid, kazoo_globals.dialplan_fetch_binding); break; - case SWITCH_XML_SECTION_CHANNELS: - add_fetch_handler(ei_node, pid, kazoo_globals.channels_fetch_binding); - break; - case SWITCH_XML_SECTION_LANGUAGES: - add_fetch_handler(ei_node, pid, kazoo_globals.languages_fetch_binding); - break; case SWITCH_XML_SECTION_CHATPLAN: add_fetch_handler(ei_node, pid, kazoo_globals.chatplan_fetch_binding); break; + case SWITCH_XML_SECTION_CHANNELS: + add_fetch_handler(ei_node, pid, kazoo_globals.channels_fetch_binding); + break; default: return erlang_response_badarg(rbuf); } @@ -971,19 +856,11 @@ static switch_status_t handle_request_api(ei_node_t *ei_node, erlang_pid *pid, e return SWITCH_STATUS_SUCCESS; } -static switch_status_t handle_request_no_legacy(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) -{ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "nolegacy: %s\n", ei_node->peer_nodename); - ei_node->legacy = SWITCH_FALSE; - - return erlang_response_ok(rbuf); -} - static switch_status_t handle_request_event(ei_node_t *ei_node, erlang_pid *pid, ei_x_buff *buf, ei_x_buff *rbuf) { char event_name[MAXATOMLEN + 1]; + switch_event_types_t event_type; ei_event_stream_t *event_stream; - int length = 0; - int i; + int custom = 0, length = 0; if (ei_decode_list_header(buf->buff, &buf->index, &length) || !length) { return erlang_response_badarg(rbuf); @@ -991,18 +868,38 @@ static switch_status_t handle_request_event(ei_node_t *ei_node, erlang_pid *pid, switch_mutex_lock(ei_node->event_streams_mutex); if (!(event_stream = find_event_stream(ei_node->event_streams, pid))) { - event_stream = new_event_stream(ei_node, pid); + event_stream = new_event_stream(&ei_node->event_streams, pid); /* ensure we are notified if the requesting processes dies so we can clean up */ ei_link(ei_node, ei_self(&kazoo_globals.ei_cnode), pid); } - for (i = 1; i <= length; i++) { - + for (int i = 1; i <= length; i++) { if (ei_decode_atom_safe(buf->buff, &buf->index, event_name)) { switch_mutex_unlock(ei_node->event_streams_mutex); return erlang_response_badarg(rbuf); } - add_event_binding(event_stream, event_name); + + if (custom) { + add_event_binding(event_stream, SWITCH_EVENT_CUSTOM, event_name); + } else if (switch_name_event(event_name, &event_type) == SWITCH_STATUS_SUCCESS) { + switch (event_type) { + case SWITCH_EVENT_CUSTOM: + custom++; + break; + case SWITCH_EVENT_ALL: + for (switch_event_types_t type = 0; type < SWITCH_EVENT_ALL; type++) { + if(type != SWITCH_EVENT_CUSTOM) { + add_event_binding(event_stream, type, NULL); + } + } + break; + default: + add_event_binding(event_stream, event_type, NULL); + } + } else { + switch_mutex_unlock(ei_node->event_streams_mutex); + return erlang_response_badarg(rbuf); + } } switch_mutex_unlock(ei_node->event_streams_mutex); @@ -1058,24 +955,21 @@ static switch_status_t handle_request_fetch_reply(ei_node_t *ei_node, erlang_pid case SWITCH_XML_SECTION_DIALPLAN: result = fetch_reply(uuid_str, xml_str, kazoo_globals.dialplan_fetch_binding); break; - case SWITCH_XML_SECTION_CHANNELS: - result = fetch_reply(uuid_str, xml_str, kazoo_globals.channels_fetch_binding); - break; - case SWITCH_XML_SECTION_LANGUAGES: - result = fetch_reply(uuid_str, xml_str, kazoo_globals.languages_fetch_binding); - break; case SWITCH_XML_SECTION_CHATPLAN: result = fetch_reply(uuid_str, xml_str, kazoo_globals.chatplan_fetch_binding); break; + case SWITCH_XML_SECTION_CHANNELS: + result = fetch_reply(uuid_str, xml_str, kazoo_globals.channels_fetch_binding); + break; default: - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received fetch reply for an unknown configuration section: %s\n", section_str); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Recieved fetch reply for an unknown configuration section: %s\n", section_str); return erlang_response_badarg(rbuf); } if (result == SWITCH_STATUS_SUCCESS) { return erlang_response_ok(rbuf); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received fetch reply for an unknown/expired UUID: %s\n", uuid_str); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Recieved fetch reply for an unknown/expired UUID: %s\n", uuid_str); return erlang_response_baduuid(rbuf); } } @@ -1116,10 +1010,6 @@ static switch_status_t handle_kazoo_request(ei_node_t *ei_node, erlang_pid *pid, return handle_request_sendevent(ei_node, pid, buf, rbuf); case REQUEST_SENDMSG: return handle_request_sendmsg(ei_node, pid, buf, rbuf); - case REQUEST_COMMAND: - return handle_request_command(ei_node, pid, buf, rbuf); - case REQUEST_COMMANDS: - return handle_request_commands(ei_node, pid, buf, rbuf); case REQUEST_BIND: return handle_request_bind(ei_node, pid, buf, rbuf); case REQUEST_GETPID: @@ -1134,14 +1024,12 @@ static switch_status_t handle_kazoo_request(ei_node_t *ei_node, erlang_pid *pid, return handle_request_event(ei_node, pid, buf, rbuf); case REQUEST_FETCH_REPLY: return handle_request_fetch_reply(ei_node, pid, buf, rbuf); - case REQUEST_CONFIG: - return handle_request_config(ei_node, pid, buf, rbuf); - case REQUEST_BGAPI4: - return handle_request_bgapi4(ei_node, pid, buf, rbuf); + case REQUEST_CONFIG: + return handle_request_config(ei_node, pid, buf, rbuf); + case REQUEST_BGAPI4: + return handle_request_bgapi4(ei_node, pid, buf, rbuf); case REQUEST_API4: return handle_request_api4(ei_node, pid, buf, rbuf); - case REQUEST_NO_LEGACY: - return handle_request_no_legacy(ei_node, pid, buf, rbuf); default: return erlang_response_notimplemented(rbuf); } @@ -1326,7 +1214,7 @@ static switch_status_t handle_erl_send(ei_node_t *ei_node, erlang_msg *msg, ei_x } else if (!strncmp(msg->toname, "mod_kazoo", MAXATOMLEN)) { return handle_mod_kazoo_request(ei_node, msg, buf); } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received erlang message to unknown process \"%s\" (ensure you are using Kazoo v2.14+).\n", msg->toname); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Recieved erlang message to unknown process \"%s\" (ensure you are using Kazoo v2.14+).\n", msg->toname); return SWITCH_STATUS_GENERR; } } @@ -1374,7 +1262,7 @@ static void *SWITCH_THREAD_FUNC receive_handler(switch_thread_t *thread, void *o while (switch_test_flag(ei_node, LFLAG_RUNNING) && switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { void *pop; - if (switch_queue_pop_timeout(ei_node->received_msgs, &pop, 100000) == SWITCH_STATUS_SUCCESS) { + if (switch_queue_pop_timeout(ei_node->received_msgs, &pop, 500000) == SWITCH_STATUS_SUCCESS) { ei_received_msg_t *received_msg = (ei_received_msg_t *) pop; handle_erl_msg(ei_node, &received_msg->msg, &received_msg->buf); ei_x_free(&received_msg->buf); @@ -1425,7 +1313,7 @@ static void *SWITCH_THREAD_FUNC handle_node(switch_thread_t *thread, void *obj) } while (++send_msg_count <= kazoo_globals.send_msg_batch - && switch_queue_pop_timeout(ei_node->send_msgs, &pop, 20000) == SWITCH_STATUS_SUCCESS) { + && switch_queue_trypop(ei_node->send_msgs, &pop) == SWITCH_STATUS_SUCCESS) { ei_send_msg_t *send_msg = (ei_send_msg_t *) pop; ei_helper_send(ei_node, &send_msg->pid, &send_msg->buf); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sent erlang message to %s <%d.%d.%d>\n" @@ -1543,7 +1431,6 @@ switch_status_t new_kazoo_node(int nodefd, ErlConnect *conn) { ei_node->nodefd = nodefd; ei_node->peer_nodename = switch_core_strdup(ei_node->pool, conn->nodename); ei_node->created_time = switch_micro_time_now(); - ei_node->legacy = kazoo_globals.enable_legacy; /* store the IP and node name we are talking with */ switch_os_sock_put(&ei_node->socket, (switch_os_socket_t *)&nodefd, pool); diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c b/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c deleted file mode 100644 index 2aefb5ab98..0000000000 --- a/src/mod/event_handlers/mod_kazoo/kazoo_tweaks.c +++ /dev/null @@ -1,502 +0,0 @@ -/* - * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2005-2012, Anthony Minessale II - * - * Version: MPL 1.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * - * The Initial Developer of the Original Code is - * Anthony Minessale II - * Portions created by the Initial Developer are Copyright (C) - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Luis Azedo - * - * mod_hacks.c -- hacks with state handlers - * - */ -#include "mod_kazoo.h" - -static const char *bridge_variables[] = { - "Call-Control-Queue", - "Call-Control-PID", - "ecallmgr_Call-Interaction-ID", - "ecallmgr_Ecallmgr-Node", - NULL -}; - -static switch_status_t kz_tweaks_signal_bridge_on_hangup(switch_core_session_t *session) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_event_t *my_event; - - const char *peer_uuid = switch_channel_get_variable(channel, "Bridge-B-Unique-ID"); - - if (switch_event_create(&my_event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); - switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", peer_uuid); - switch_channel_event_set_data(channel, my_event); - switch_event_fire(&my_event); - } - - return SWITCH_STATUS_SUCCESS; -} - -static const switch_state_handler_table_t kz_tweaks_signal_bridge_state_handlers = { - /*.on_init */ NULL, - /*.on_routing */ NULL, - /*.on_execute */ NULL, - /*.on_hangup */ kz_tweaks_signal_bridge_on_hangup, - /*.on_exchange_media */ NULL, - /*.on_soft_execute */ NULL, - /*.on_consume_media */ NULL, - /*.on_hibernate */ NULL -}; - -static void kz_tweaks_handle_bridge_variables(switch_event_t *event) -{ - switch_core_session_t *a_session = NULL, *b_session = NULL; - const char *a_leg = switch_event_get_header(event, "Bridge-A-Unique-ID"); - const char *b_leg = switch_event_get_header(event, "Bridge-B-Unique-ID"); - int i; - - if (a_leg && (a_session = switch_core_session_force_locate(a_leg)) != NULL) { - switch_channel_t *a_channel = switch_core_session_get_channel(a_session); - if(switch_channel_get_variable_dup(a_channel, bridge_variables[0], SWITCH_FALSE, -1) == NULL) { - if(b_leg && (b_session = switch_core_session_force_locate(b_leg)) != NULL) { - switch_channel_t *b_channel = switch_core_session_get_channel(b_session); - for(i = 0; bridge_variables[i] != NULL; i++) { - const char *val = switch_channel_get_variable_dup(b_channel, bridge_variables[i], SWITCH_TRUE, -1); - switch_channel_set_variable(a_channel, bridge_variables[i], val); - switch_safe_strdup(val); - } - switch_core_session_rwunlock(b_session); - } - } else { - if(b_leg && (b_session = switch_core_session_force_locate(b_leg)) != NULL) { - switch_channel_t *b_channel = switch_core_session_get_channel(b_session); - if(switch_channel_get_variable_dup(b_channel, bridge_variables[0], SWITCH_FALSE, -1) == NULL) { - for(i = 0; bridge_variables[i] != NULL; i++) { - const char *val = switch_channel_get_variable_dup(b_channel, bridge_variables[i], SWITCH_TRUE, -1); - switch_channel_set_variable(b_channel, bridge_variables[i], val); - switch_safe_strdup(val); - } - } - switch_core_session_rwunlock(b_session); - } - } - switch_core_session_rwunlock(a_session); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NOT FOUND : %s\n", a_leg); - } - -} - -static void kz_tweaks_handle_bridge_replaces(switch_event_t *event) -{ - switch_event_t *my_event; - - const char *replaced_call_id = switch_event_get_header(event, "variable_sip_replaces_call_id"); - const char *a_leg_call_id = switch_event_get_header(event, "variable_sip_replaces_a-leg"); - const char *peer_uuid = switch_event_get_header(event, "Unique-ID"); - int processed = 0; - - if(a_leg_call_id && replaced_call_id) { - const char *call_id = switch_event_get_header(event, "Bridge-B-Unique-ID"); - switch_core_session_t *session = NULL; - if ((session = switch_core_session_force_locate(peer_uuid)) != NULL) { - switch_channel_t *channel = switch_core_session_get_channel(session); - processed = switch_true(switch_channel_get_variable_dup(channel, "Bridge-Event-Processed", SWITCH_FALSE, -1)); - switch_channel_set_variable(channel, "Bridge-Event-Processed", "true"); - switch_core_session_rwunlock(session); - } - - if ((processed) && call_id && (session = switch_core_session_force_locate(call_id)) != NULL) { - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_channel_set_variable(channel, "Bridge-Event-Processed", "true"); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "creating channel_bridge event A - %s , B - %s\n", switch_core_session_get_uuid(session), peer_uuid); - if (switch_event_create(&my_event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) { - switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-A-Unique-ID", switch_core_session_get_uuid(session)); - switch_event_add_header_string(my_event, SWITCH_STACK_BOTTOM, "Bridge-B-Unique-ID", peer_uuid); - switch_channel_event_set_data(channel, my_event); - switch_event_fire(&my_event); - } - switch_channel_set_variable(channel, "Bridge-B-Unique-ID", peer_uuid); - switch_channel_add_state_handler(channel, &kz_tweaks_signal_bridge_state_handlers); - switch_core_session_rwunlock(session); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NOT FOUND : %s\n", call_id); - } - - } - -} - -static void kz_tweaks_channel_bridge_event_handler(switch_event_t *event) -{ - kz_tweaks_handle_bridge_replaces(event); - kz_tweaks_handle_bridge_variables(event); -} - -// TRANSFERS - -static void kz_tweaks_channel_replaced_event_handler(switch_event_t *event) -{ - const char *uuid = switch_event_get_header(event, "Unique-ID"); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "REPLACED : %s\n", uuid); -} - -static void kz_tweaks_channel_intercepted_event_handler(switch_event_t *event) -{ - const char *uuid = switch_event_get_header(event, "Unique-ID"); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "INTERCEPTED : %s\n", uuid); -} - -static void kz_tweaks_channel_transferor_event_handler(switch_event_t *event) -{ - switch_core_session_t *uuid_session = NULL; - const char *uuid = switch_event_get_header(event, "Unique-ID"); - const char *call_id = switch_event_get_header(event, "att_xfer_destination_peer_uuid"); - const char *peer_uuid = switch_event_get_header(event, "att_xfer_destination_call_id"); - - const char *file = switch_event_get_header(event, "Event-Calling-File"); - const char *func = switch_event_get_header(event, "Event-Calling-Function"); - const char *line = switch_event_get_header(event, "Event-Calling-Line-Number"); - - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TRANSFEROR : %s , %s , %s, %s , %s , %s \n", uuid, call_id, peer_uuid, file, func, line); - if ((uuid_session = switch_core_session_force_locate(uuid)) != NULL) { - switch_channel_t *uuid_channel = switch_core_session_get_channel(uuid_session); - const char* interaction_id = switch_channel_get_variable_dup(uuid_channel, "ecallmgr_Call-Interaction-ID", SWITCH_TRUE, -1); - // set to uuid & peer_uuid - if(interaction_id != NULL) { - switch_core_session_t *session = NULL; - if(call_id && (session = switch_core_session_force_locate(call_id)) != NULL) { - switch_channel_t *channel = switch_core_session_get_channel(session); - const char* prv_interaction_id = switch_channel_get_variable_dup(channel, "ecallmgr_Call-Interaction-ID", SWITCH_TRUE, -1); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "LOCATING UUID PRV : %s : %s\n", prv_interaction_id, interaction_id); - switch_channel_set_variable(channel, "ecallmgr_Call-Interaction-ID", interaction_id); - switch_core_session_rwunlock(session); - switch_safe_strdup(prv_interaction_id); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TRANSFEROR NO UUID SESSION: %s , %s , %s \n", uuid, call_id, peer_uuid); - } - if(peer_uuid && (session = switch_core_session_force_locate(peer_uuid)) != NULL) { - switch_channel_t *channel = switch_core_session_get_channel(session); - const char* prv_interaction_id = switch_channel_get_variable_dup(channel, "ecallmgr_Call-Interaction-ID", SWITCH_TRUE, -1); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "LOCATING PEER UUID PRV : %s : %s\n", prv_interaction_id, interaction_id); - switch_channel_set_variable(channel, "ecallmgr_Call-Interaction-ID", interaction_id); - switch_core_session_rwunlock(session); - switch_safe_strdup(prv_interaction_id); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TRANSFEROR NO PEER SESSION: %s , %s , %s \n", uuid, call_id, peer_uuid); - } - switch_safe_strdup(interaction_id); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TRANSFEROR ID = NULL : %s , %s , %s \n", uuid, call_id, peer_uuid); - } - switch_core_session_rwunlock(uuid_session); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SESSION NOT FOUND : %s\n", call_id); - } -} - -static void kz_tweaks_channel_transferee_event_handler(switch_event_t *event) -{ - const char *uuid = switch_event_get_header(event, "Unique-ID"); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "TRANSFEREE : %s\n", uuid); -} - -// END TRANSFERS - - -static switch_status_t kz_tweaks_handle_loopback(switch_core_session_t *session) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - const char * loopback_leg = NULL; - const char * loopback_aleg = NULL; - switch_event_t *event = NULL; - switch_event_header_t *header = NULL; - switch_event_t *to_add = NULL; - switch_event_t *to_remove = NULL; - switch_caller_profile_t *caller; - int n = 0; - - caller = switch_channel_get_caller_profile(channel); - if(strncmp(caller->source, "mod_loopback", 12)) - return SWITCH_STATUS_SUCCESS; - - if((loopback_leg = switch_channel_get_variable(channel, "loopback_leg")) == NULL) - return SWITCH_STATUS_SUCCESS; - - if(strncmp(loopback_leg, "B", 1)) - return SWITCH_STATUS_SUCCESS; - - switch_channel_get_variables(channel, &event); - switch_event_create_plain(&to_add, SWITCH_EVENT_CHANNEL_DATA); - switch_event_create_plain(&to_remove, SWITCH_EVENT_CHANNEL_DATA); - - for(header = event->headers; header; header = header->next) { - if(!strncmp(header->name, "Export-Loopback-", 16)) { - switch_event_add_variable_name_printf(to_add, SWITCH_STACK_BOTTOM, header->value, "%s", header->name+16); - switch_channel_set_variable(channel, header->name, NULL); - n++; - } else if(!strncmp(header->name, "ecallmgr_", 9)) { - switch_event_add_header_string(to_remove, SWITCH_STACK_BOTTOM, header->name, header->value); - } - } - if(n) { - for(header = to_remove->headers; header; header = header->next) { - switch_channel_set_variable(channel, header->name, NULL); - } - for(header = to_add->headers; header; header = header->next) { - switch_channel_set_variable(channel, header->name, header->value); - } - - // cleanup leg A - loopback_aleg = switch_channel_get_variable(channel, "other_loopback_leg_uuid"); - if(loopback_aleg != NULL) { - switch_core_session_t *a_session = NULL; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "found loopback a-leg uuid - %s\n", loopback_aleg); - if ((a_session = switch_core_session_locate(loopback_aleg))) { - switch_channel_t *a_channel = switch_core_session_get_channel(a_session); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "found loopback session a - %s\n", loopback_aleg); - switch_channel_del_variable_prefix(a_channel, "Export-Loopback-"); - switch_core_session_rwunlock(a_session); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Couldn't locate loopback session a - %s\n", loopback_aleg); - } - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Couldn't find loopback a-leg uuid!\n"); - } - } - - switch_event_destroy(&event); - switch_event_destroy(&to_add); - switch_event_destroy(&to_remove); - - return SWITCH_STATUS_SUCCESS; - -} - -static void kz_tweaks_handle_caller_id(switch_core_session_t *session) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - const char *acl_token = switch_channel_get_variable(channel, "acl_token"); - if(acl_token) { - switch_ivr_set_user(session, acl_token); - } -} - -static switch_status_t kz_tweaks_handle_auth_token(switch_core_session_t *session) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_event_t *event; - const char *token = switch_channel_get_variable(channel, "sip_h_X-FS-Auth-Token"); - if(token) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Authenticating user for nightmare xfer %s\n", token); - if (switch_ivr_set_user(session, token) == SWITCH_STATUS_SUCCESS) { - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { - switch_channel_event_set_data(channel, event); - switch_event_fire(&event); - } - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Authenticated user from nightmare xfer %s\n", token); - } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Error Authenticating user for nightmare xfer %s\n", token); - } - } - - return SWITCH_STATUS_SUCCESS; - -} - -static switch_status_t kz_tweaks_handle_nightmare_xfer(switch_core_session_t *session) -{ - switch_core_session_t *replace_session = NULL; - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_event_t *event; - const char *replaced_call_id = switch_channel_get_variable(channel, "sip_replaces_call_id"); - const char *core_uuid = switch_channel_get_variable(channel, "sip_h_X-FS-From-Core-UUID"); - const char *partner_uuid = switch_channel_get_variable(channel, "sip_h_X-FS-Refer-Partner-UUID"); - const char *interaction_id = switch_channel_get_variable(channel, "sip_h_X-FS-Call-Interaction-ID"); - if(core_uuid && partner_uuid && replaced_call_id && interaction_id) { - switch_channel_set_variable(channel, "ecallmgr_Call-Interaction-ID", interaction_id); - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { - switch_channel_event_set_data(channel, event); - switch_event_fire(&event); - } - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "checking nightmare xfer tweak for %s\n", switch_channel_get_uuid(channel)); - if ((replace_session = switch_core_session_locate(replaced_call_id))) { - switch_channel_t *replaced_call_channel = switch_core_session_get_channel(replace_session); - switch_channel_set_variable(replaced_call_channel, "ecallmgr_Call-Interaction-ID", interaction_id); - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { - switch_channel_event_set_data(replaced_call_channel, event); - switch_event_fire(&event); - } - switch_core_session_rwunlock(replace_session); - } - if ((replace_session = switch_core_session_locate(partner_uuid))) { - switch_channel_t *replaced_call_channel = switch_core_session_get_channel(replace_session); - switch_channel_set_variable(replaced_call_channel, "ecallmgr_Call-Interaction-ID", interaction_id); - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { - switch_channel_event_set_data(replaced_call_channel, event); - switch_event_fire(&event); - } - switch_core_session_rwunlock(replace_session); - } - } - - return SWITCH_STATUS_SUCCESS; - -} - -static switch_status_t kz_tweaks_handle_replaces_id(switch_core_session_t *session) -{ - switch_core_session_t *replace_call_session = NULL; - switch_event_t *event; - switch_channel_t *channel = switch_core_session_get_channel(session); - const char *replaced_call_id = switch_channel_get_variable(channel, "sip_replaces_call_id"); - const char *core_uuid = switch_channel_get_variable(channel, "sip_h_X-FS-From-Core-UUID"); - if((!core_uuid) && replaced_call_id) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "checking replaces header tweak for %s\n", replaced_call_id); - if ((replace_call_session = switch_core_session_locate(replaced_call_id))) { - switch_channel_t *replaced_call_channel = switch_core_session_get_channel(replace_call_session); - int i; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "setting bridge variables from %s to %s\n", replaced_call_id, switch_channel_get_uuid(channel)); - for(i = 0; bridge_variables[i] != NULL; i++) { - const char *val = switch_channel_get_variable_dup(replaced_call_channel, bridge_variables[i], SWITCH_TRUE, -1); - switch_channel_set_variable(channel, bridge_variables[i], val); - switch_safe_strdup(val); - } - if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_DATA) == SWITCH_STATUS_SUCCESS) { - switch_channel_event_set_data(channel, event); - switch_event_fire(&event); - } - switch_core_session_rwunlock(replace_call_session); - } - } - - return SWITCH_STATUS_SUCCESS; - -} - - -static switch_status_t kz_tweaks_handle_switch_uri(switch_core_session_t *session) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - const char *profile_url = switch_channel_get_variable(channel, "sofia_profile_url"); - if(profile_url) { - int n = strcspn(profile_url, "@"); - switch_channel_set_variable(channel, "Switch-URL", profile_url); - switch_channel_set_variable_printf(channel, "Switch-URI", "sip:%s", n > 0 ? profile_url + n + 1 : profile_url); - } - - return SWITCH_STATUS_SUCCESS; - -} - - -static switch_status_t kz_tweaks_on_init(switch_core_session_t *session) -{ - switch_channel_t *channel = switch_core_session_get_channel(session); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "checking tweaks for %s\n", switch_channel_get_uuid(channel)); - kz_tweaks_handle_switch_uri(session); - kz_tweaks_handle_caller_id(session); - kz_tweaks_handle_auth_token(session); - kz_tweaks_handle_nightmare_xfer(session); - kz_tweaks_handle_replaces_id(session); - kz_tweaks_handle_loopback(session); - - return SWITCH_STATUS_SUCCESS; -} - -static switch_state_handler_table_t kz_tweaks_state_handlers = { - /*.on_init */ kz_tweaks_on_init, - /*.on_routing */ NULL, - /*.on_execute */ NULL, - /*.on_hangup */ NULL, - /*.on_exchange_media */ NULL, - /*.on_soft_execute */ NULL, - /*.on_consume_media */ NULL, - /*.on_hibernate */ NULL, - /*.on_reset */ NULL, - /*.on_park */ NULL, - /*.on_reporting */ NULL -}; - - -static void kz_tweaks_register_state_handlers() -{ - switch_core_add_state_handler(&kz_tweaks_state_handlers); -} - -static void kz_tweaks_unregister_state_handlers() -{ - switch_core_remove_state_handler(&kz_tweaks_state_handlers); -} - -static void kz_tweaks_bind_events() -{ - if (switch_event_bind("kz_tweaks", SWITCH_EVENT_CHANNEL_BRIDGE, SWITCH_EVENT_SUBCLASS_ANY, kz_tweaks_channel_bridge_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind to channel_bridge event!\n"); - } - if (switch_event_bind("kz_tweaks", SWITCH_EVENT_CUSTOM, "sofia::replaced", kz_tweaks_channel_replaced_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind to channel_bridge event!\n"); - } - if (switch_event_bind("kz_tweaks", SWITCH_EVENT_CUSTOM, "sofia::intercepted", kz_tweaks_channel_intercepted_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind to channel_bridge event!\n"); - } - if (switch_event_bind("kz_tweaks", SWITCH_EVENT_CUSTOM, "sofia::transferor", kz_tweaks_channel_transferor_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind to channel_bridge event!\n"); - } - if (switch_event_bind("kz_tweaks", SWITCH_EVENT_CUSTOM, "sofia::transferee", kz_tweaks_channel_transferee_event_handler, NULL) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind to channel_bridge event!\n"); - } -} - -static void kz_tweaks_unbind_events() -{ - switch_event_unbind_callback(kz_tweaks_channel_bridge_event_handler); - switch_event_unbind_callback(kz_tweaks_channel_replaced_event_handler); - switch_event_unbind_callback(kz_tweaks_channel_intercepted_event_handler); - switch_event_unbind_callback(kz_tweaks_channel_transferor_event_handler); - switch_event_unbind_callback(kz_tweaks_channel_transferee_event_handler); -} - -void kz_tweaks_start() -{ - kz_tweaks_register_state_handlers(); - kz_tweaks_bind_events(); -} - -void kz_tweaks_stop() -{ - kz_tweaks_unbind_events(); - kz_tweaks_unregister_state_handlers(); -} - -/* For Emacs: - * Local Variables: - * mode:c - * indent-tabs-mode:t - * tab-width:4 - * c-basic-offset:4 - * End: - * For VIM: - * vim:set softtabstop=4 shiftwidth=4 tabstop=4: - */ - - diff --git a/src/mod/event_handlers/mod_kazoo/kazoo_utils.c b/src/mod/event_handlers/mod_kazoo/kazoo_utils.c index c793b3d566..024e98b858 100644 --- a/src/mod/event_handlers/mod_kazoo/kazoo_utils.c +++ b/src/mod/event_handlers/mod_kazoo/kazoo_utils.c @@ -34,99 +34,664 @@ */ #include "mod_kazoo.h" -char *kazoo_expand_header(switch_memory_pool_t *pool, switch_event_t *event, char *val) -{ - char *expanded; - char *dup = NULL; +/* Stolen from code added to ei in R12B-5. + * Since not everyone has this version yet; + * provide our own version. + * */ - expanded = switch_event_expand_headers(event, val); - dup = switch_core_strdup(pool, expanded); +#define put8(s,n) do { \ + (s)[0] = (char)((n) & 0xff); \ + (s) += 1; \ + } while (0) - if (expanded != val) { - free(expanded); - } +#define put32be(s,n) do { \ + (s)[0] = ((n) >> 24) & 0xff; \ + (s)[1] = ((n) >> 16) & 0xff; \ + (s)[2] = ((n) >> 8) & 0xff; \ + (s)[3] = (n) & 0xff; \ + (s) += 4; \ + } while (0) - return dup; +#ifdef EI_DEBUG +static void ei_x_print_reg_msg(ei_x_buff *buf, char *dest, int send) { + char *mbuf = NULL; + int i = 1; + + ei_s_print_term(&mbuf, buf->buff, &i); + + if (send) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Encoded term %s to '%s'\n", mbuf, dest); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Decoded term %s for '%s'\n", mbuf, dest); + } + + free(mbuf); } -char* switch_event_get_first_of(switch_event_t *event, const char *list[]) -{ - switch_event_header_t *header = NULL; - int i = 0; - while(list[i] != NULL) { - if((header = switch_event_get_header_ptr(event, list[i])) != NULL) - break; - i++; - } - if(header != NULL) { - return header->value; - } else { - return "nodomain"; +static void ei_x_print_msg(ei_x_buff *buf, erlang_pid *pid, int send) { + char *pbuf = NULL; + int i = 0; + ei_x_buff pidbuf; + + ei_x_new(&pidbuf); + ei_x_encode_pid(&pidbuf, pid); + + ei_s_print_term(&pbuf, pidbuf.buff, &i); + + ei_x_print_reg_msg(buf, pbuf, send); + free(pbuf); +} +#endif + +void ei_encode_switch_event_headers(ei_x_buff *ebuf, switch_event_t *event) { + ei_encode_switch_event_headers_2(ebuf, event, 1); +} + +void ei_encode_switch_event_headers_2(ei_x_buff *ebuf, switch_event_t *event, int encode) { + switch_event_header_t *hp; + char *uuid = switch_event_get_header(event, "unique-id"); + int i; + + for (i = 0, hp = event->headers; hp; hp = hp->next, i++); + + if (event->body) + i++; + + ei_x_encode_list_header(ebuf, i + 1); + + if (uuid) { + char *unique_id = switch_event_get_header(event, "unique-id"); + ei_x_encode_binary(ebuf, unique_id, strlen(unique_id)); + } else { + ei_x_encode_atom(ebuf, "undefined"); + } + + for (hp = event->headers; hp; hp = hp->next) { + ei_x_encode_tuple_header(ebuf, 2); + ei_x_encode_binary(ebuf, hp->name, strlen(hp->name)); + if(encode) + switch_url_decode(hp->value); + ei_x_encode_binary(ebuf, hp->value, strlen(hp->value)); + } + + if (event->body) { + ei_x_encode_tuple_header(ebuf, 2); + ei_x_encode_binary(ebuf, "body", strlen("body")); + ei_x_encode_binary(ebuf, event->body, strlen(event->body)); + } + + ei_x_encode_empty_list(ebuf); +} + +void close_socket(switch_socket_t ** sock) { + if (*sock) { + switch_socket_shutdown(*sock, SWITCH_SHUTDOWN_READWRITE); + switch_socket_close(*sock); + *sock = NULL; } } -SWITCH_DECLARE(switch_status_t) switch_event_add_variable_name_printf(switch_event_t *event, switch_stack_t stack, const char *val, const char *fmt, ...) -{ - int ret = 0; - char *varname; - va_list ap; - switch_status_t status = SWITCH_STATUS_SUCCESS; +void close_socketfd(int *sockfd) { + if (*sockfd) { + shutdown(*sockfd, SHUT_RDWR); + close(*sockfd); + } +} - switch_assert(event != NULL); +switch_socket_t *create_socket_with_port(switch_memory_pool_t *pool, switch_port_t port) { + switch_sockaddr_t *sa; + switch_socket_t *socket; - - va_start(ap, fmt); - ret = switch_vasprintf(&varname, fmt, ap); - va_end(ap); - - if (ret == -1) { - return SWITCH_STATUS_MEMERR; + if(switch_sockaddr_info_get(&sa, kazoo_globals.ip, SWITCH_UNSPEC, port, 0, pool)) { + return NULL; } - status = switch_event_add_header_string(event, stack, varname, val); + if (switch_socket_create(&socket, switch_sockaddr_get_family(sa), SOCK_STREAM, SWITCH_PROTO_TCP, pool)) { + return NULL; + } - free(varname); + if (switch_socket_opt_set(socket, SWITCH_SO_REUSEADDR, 1)) { + return NULL; + } - return status; + if (switch_socket_bind(socket, sa)) { + return NULL; + } + + if (switch_socket_listen(socket, 5)){ + return NULL; + } + + switch_getnameinfo(&kazoo_globals.hostname, sa, 0); + + // if (kazoo_globals.nat_map && switch_nat_get_type()) { + // switch_nat_add_mapping(port, SWITCH_NAT_TCP, NULL, SWITCH_FALSE); + // } + + return socket; } -SWITCH_DECLARE(switch_xml_t) kz_xml_child(switch_xml_t xml, const char *name) -{ - xml = (xml) ? xml->child : NULL; - while (xml && strcasecmp(name, xml->name)) - xml = xml->sibling; - return xml; +switch_socket_t *create_socket(switch_memory_pool_t *pool) { + return create_socket_with_port(pool, 0); + } -void kz_xml_process(switch_xml_t cfg) -{ - switch_xml_t xml_process; - for (xml_process = kz_xml_child(cfg, "X-PRE-PROCESS"); xml_process; xml_process = xml_process->next) { - const char *cmd = switch_xml_attr(xml_process, "cmd"); - const char *data = switch_xml_attr(xml_process, "data"); - if(cmd != NULL && !strcasecmp(cmd, "set") && data) { - char *name = (char *) data; - char *val = strchr(name, '='); +switch_status_t create_ei_cnode(const char *ip_addr, const char *name, struct ei_cnode_s *ei_cnode) { + char hostname[EI_MAXHOSTNAMELEN + 1] = ""; + char nodename[MAXNODELEN + 1]; + char cnodename[EI_MAXALIVELEN + 1]; + //EI_MAX_COOKIE_SIZE+1 + char *atsign; - if (val) { - char *ve = val++; - while (*val && *val == ' ') { - val++; - } - *ve-- = '\0'; - while (*ve && *ve == ' ') { - *ve-- = '\0'; - } - } + /* copy the erlang interface nodename into something we can modify */ + strncpy(cnodename, name, EI_MAXALIVELEN); - if (name && val) { - switch_core_set_variable(name, val); - } + if ((atsign = strchr(cnodename, '@'))) { + /* we got a qualified node name, don't guess the host/domain */ + snprintf(nodename, MAXNODELEN + 1, "%s", kazoo_globals.ei_nodename); + /* truncate the alivename at the @ */ + *atsign = '\0'; + } else { + if (zstr(kazoo_globals.hostname) || !strncasecmp(kazoo_globals.ip, "0.0.0.0", 7) || !strncasecmp(kazoo_globals.ip, "::", 2)) { + memcpy(hostname, switch_core_get_hostname(), EI_MAXHOSTNAMELEN); + } else { + memcpy(hostname, kazoo_globals.hostname, EI_MAXHOSTNAMELEN); + } + + snprintf(nodename, MAXNODELEN + 1, "%s@%s", kazoo_globals.ei_nodename, hostname); + } + + if (kazoo_globals.ei_shortname) { + char *off; + if ((off = strchr(nodename, '.'))) { + *off = '\0'; } } + /* init the ec stuff */ + if (ei_connect_xinit(ei_cnode, hostname, cnodename, nodename, (Erl_IpAddr) ip_addr, kazoo_globals.ei_cookie, 0) < 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to initialize the erlang interface connection structure\n"); + return SWITCH_STATUS_FALSE; + } + + return SWITCH_STATUS_SUCCESS; } +switch_status_t ei_compare_pids(const erlang_pid *pid1, const erlang_pid *pid2) { + if ((!strcmp(pid1->node, pid2->node)) + && pid1->creation == pid2->creation + && pid1->num == pid2->num + && pid1->serial == pid2->serial) { + return SWITCH_STATUS_SUCCESS; + } else { + return SWITCH_STATUS_FALSE; + } +} + +void ei_link(ei_node_t *ei_node, erlang_pid * from, erlang_pid * to) { + char msgbuf[2048]; + char *s; + int index = 0; + + index = 5; /* max sizes: */ + ei_encode_version(msgbuf, &index); /* 1 */ + ei_encode_tuple_header(msgbuf, &index, 3); + ei_encode_long(msgbuf, &index, ERL_LINK); + ei_encode_pid(msgbuf, &index, from); /* 268 */ + ei_encode_pid(msgbuf, &index, to); /* 268 */ + + /* 5 byte header missing */ + s = msgbuf; + put32be(s, index - 4); /* 4 */ + put8(s, ERL_PASS_THROUGH); /* 1 */ + /* sum: 542 */ + + if (write(ei_node->nodefd, msgbuf, index) == -1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to link to process on %s\n", ei_node->peer_nodename); + } +} + +void ei_encode_switch_event(ei_x_buff *ebuf, switch_event_t *event) { + ei_x_encode_tuple_header(ebuf, 2); + ei_x_encode_atom(ebuf, "event"); + ei_encode_switch_event_headers(ebuf, event); +} + +int ei_helper_send(ei_node_t *ei_node, erlang_pid *to, ei_x_buff *buf) { + int ret = 0; + + if (ei_node->nodefd) { +#ifdef EI_DEBUG + ei_x_print_msg(buf, to, 1); +#endif + ret = ei_send(ei_node->nodefd, to, buf->buff, buf->index); + } + + return ret; +} + +int ei_decode_atom_safe(char *buf, int *index, char *dst) { + int type, size; + + ei_get_type(buf, index, &type, &size); + + if (type != ERL_ATOM_EXT) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed atom\n", type, size); + return -1; + } else if (size > MAXATOMLEN) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Requested decoding of atom with size %d into a buffer of size %d\n", size, MAXATOMLEN); + return -1; + } else { + return ei_decode_atom(buf, index, dst); + } +} + +int ei_decode_string_or_binary(char *buf, int *index, char **dst) { + int type, size, res; + long len; + + ei_get_type(buf, index, &type, &size); + + if (type != ERL_STRING_EXT && type != ERL_BINARY_EXT && type != ERL_NIL_EXT) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed binary or string\n", type, size); + return -1; + } + + *dst = malloc(size + 1); + + if (type == ERL_NIL_EXT) { + res = 0; + **dst = '\0'; + } else if (type == ERL_BINARY_EXT) { + res = ei_decode_binary(buf, index, *dst, &len); + (*dst)[len] = '\0'; + } else { + res = ei_decode_string(buf, index, *dst); + } + + return res; +} + +int ei_decode_string_or_binary_limited(char *buf, int *index, int maxsize, char *dst) { + int type, size, res; + long len; + + ei_get_type(buf, index, &type, &size); + + if (type != ERL_STRING_EXT && type != ERL_BINARY_EXT && type != ERL_NIL_EXT) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unexpected erlang term type %d (size %d), needed binary or string\n", type, size); + return -1; + } + + if (size > maxsize) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Requested decoding of %s with size %d into a buffer of size %d\n", + type == ERL_BINARY_EXT ? "binary" : "string", size, maxsize); + return -1; + } + + if (type == ERL_NIL_EXT) { + res = 0; + *dst = '\0'; + } else if (type == ERL_BINARY_EXT) { + res = ei_decode_binary(buf, index, dst, &len); + dst[len] = '\0'; /* binaries aren't null terminated */ + } else { + res = ei_decode_string(buf, index, dst); + } + + return res; +} + +switch_hash_t *create_default_filter() { + switch_hash_t *filter; + + switch_core_hash_init(&filter); + + switch_core_hash_insert(filter, "Acquired-UUID", "1"); + switch_core_hash_insert(filter, "action", "1"); + switch_core_hash_insert(filter, "Action", "1"); + switch_core_hash_insert(filter, "alt_event_type", "1"); + switch_core_hash_insert(filter, "Answer-State", "1"); + switch_core_hash_insert(filter, "Application", "1"); + switch_core_hash_insert(filter, "Application-Data", "1"); + switch_core_hash_insert(filter, "Application-Name", "1"); + switch_core_hash_insert(filter, "Application-Response", "1"); + switch_core_hash_insert(filter, "att_xfer_replaced_by", "1"); + switch_core_hash_insert(filter, "Auth-Method", "1"); + switch_core_hash_insert(filter, "Auth-Realm", "1"); + switch_core_hash_insert(filter, "Auth-User", "1"); + switch_core_hash_insert(filter, "Bridge-A-Unique-ID", "1"); + switch_core_hash_insert(filter, "Bridge-B-Unique-ID", "1"); + switch_core_hash_insert(filter, "Call-Direction", "1"); + switch_core_hash_insert(filter, "Caller-Callee-ID-Name", "1"); + switch_core_hash_insert(filter, "Caller-Callee-ID-Number", "1"); + switch_core_hash_insert(filter, "Caller-Caller-ID-Name", "1"); + switch_core_hash_insert(filter, "Caller-Caller-ID-Number", "1"); + switch_core_hash_insert(filter, "Caller-Screen-Bit", "1"); + switch_core_hash_insert(filter, "Caller-Privacy-Hide-Name", "1"); + switch_core_hash_insert(filter, "Caller-Privacy-Hide-Number", "1"); + switch_core_hash_insert(filter, "Caller-Context", "1"); + switch_core_hash_insert(filter, "Caller-Controls", "1"); + switch_core_hash_insert(filter, "Caller-Destination-Number", "1"); + switch_core_hash_insert(filter, "Caller-Dialplan", "1"); + switch_core_hash_insert(filter, "Caller-Network-Addr", "1"); + switch_core_hash_insert(filter, "Caller-Unique-ID", "1"); + switch_core_hash_insert(filter, "Call-ID", "1"); + switch_core_hash_insert(filter, "Channel-Call-State", "1"); + switch_core_hash_insert(filter, "Channel-Call-UUID", "1"); + switch_core_hash_insert(filter, "Channel-Presence-ID", "1"); + switch_core_hash_insert(filter, "Channel-State", "1"); + switch_core_hash_insert(filter, "Chat-Permissions", "1"); + switch_core_hash_insert(filter, "Conference-Name", "1"); + switch_core_hash_insert(filter, "Conference-Profile-Name", "1"); + switch_core_hash_insert(filter, "Conference-Unique-ID", "1"); + switch_core_hash_insert(filter, "contact", "1"); + switch_core_hash_insert(filter, "Detected-Tone", "1"); + switch_core_hash_insert(filter, "dialog_state", "1"); + switch_core_hash_insert(filter, "direction", "1"); + switch_core_hash_insert(filter, "Distributed-From", "1"); + switch_core_hash_insert(filter, "DTMF-Digit", "1"); + switch_core_hash_insert(filter, "DTMF-Duration", "1"); + switch_core_hash_insert(filter, "Event-Date-Timestamp", "1"); + switch_core_hash_insert(filter, "Event-Name", "1"); + switch_core_hash_insert(filter, "Event-Subclass", "1"); + switch_core_hash_insert(filter, "expires", "1"); + switch_core_hash_insert(filter, "Expires", "1"); + switch_core_hash_insert(filter, "Ext-SIP-IP", "1"); + switch_core_hash_insert(filter, "File", "1"); + switch_core_hash_insert(filter, "FreeSWITCH-Hostname", "1"); + switch_core_hash_insert(filter, "from", "1"); + switch_core_hash_insert(filter, "Hunt-Destination-Number", "1"); + switch_core_hash_insert(filter, "ip", "1"); + switch_core_hash_insert(filter, "Message-Account", "1"); + switch_core_hash_insert(filter, "metadata", "1"); + switch_core_hash_insert(filter, "old_node_channel_uuid", "1"); + switch_core_hash_insert(filter, "Other-Leg-Callee-ID-Name", "1"); + switch_core_hash_insert(filter, "Other-Leg-Callee-ID-Number", "1"); + switch_core_hash_insert(filter, "Other-Leg-Caller-ID-Name", "1"); + switch_core_hash_insert(filter, "Other-Leg-Caller-ID-Number", "1"); + switch_core_hash_insert(filter, "Other-Leg-Destination-Number", "1"); + switch_core_hash_insert(filter, "Other-Leg-Direction", "1"); + switch_core_hash_insert(filter, "Other-Leg-Unique-ID", "1"); + switch_core_hash_insert(filter, "Other-Leg-Channel-Name", "1"); + switch_core_hash_insert(filter, "Participant-Type", "1"); + switch_core_hash_insert(filter, "Path", "1"); + switch_core_hash_insert(filter, "profile_name", "1"); + switch_core_hash_insert(filter, "Profiles", "1"); + switch_core_hash_insert(filter, "proto-specific-event-name", "1"); + switch_core_hash_insert(filter, "Raw-Application-Data", "1"); + switch_core_hash_insert(filter, "realm", "1"); + switch_core_hash_insert(filter, "Resigning-UUID", "1"); + switch_core_hash_insert(filter, "set", "1"); + switch_core_hash_insert(filter, "sip_auto_answer", "1"); + switch_core_hash_insert(filter, "sip_auth_method", "1"); + switch_core_hash_insert(filter, "sip_from_host", "1"); + switch_core_hash_insert(filter, "sip_from_user", "1"); + switch_core_hash_insert(filter, "sip_to_host", "1"); + switch_core_hash_insert(filter, "sip_to_user", "1"); + switch_core_hash_insert(filter, "sub-call-id", "1"); + switch_core_hash_insert(filter, "technology", "1"); + switch_core_hash_insert(filter, "to", "1"); + switch_core_hash_insert(filter, "Unique-ID", "1"); + switch_core_hash_insert(filter, "URL", "1"); + switch_core_hash_insert(filter, "username", "1"); + switch_core_hash_insert(filter, "variable_channel_is_moving", "1"); + switch_core_hash_insert(filter, "variable_collected_digits", "1"); + switch_core_hash_insert(filter, "variable_current_application", "1"); + switch_core_hash_insert(filter, "variable_current_application_data", "1"); + switch_core_hash_insert(filter, "variable_domain_name", "1"); + switch_core_hash_insert(filter, "variable_effective_caller_id_name", "1"); + switch_core_hash_insert(filter, "variable_effective_caller_id_number", "1"); + switch_core_hash_insert(filter, "variable_holding_uuid", "1"); + switch_core_hash_insert(filter, "variable_hold_music", "1"); + switch_core_hash_insert(filter, "variable_media_group_id", "1"); + switch_core_hash_insert(filter, "variable_originate_disposition", "1"); + switch_core_hash_insert(filter, "variable_origination_uuid", "1"); + switch_core_hash_insert(filter, "variable_playback_terminator_used", "1"); + switch_core_hash_insert(filter, "variable_presence_id", "1"); + switch_core_hash_insert(filter, "variable_record_ms", "1"); + switch_core_hash_insert(filter, "variable_recovered", "1"); + switch_core_hash_insert(filter, "variable_silence_hits_exhausted", "1"); + switch_core_hash_insert(filter, "variable_sip_auth_realm", "1"); + switch_core_hash_insert(filter, "variable_sip_from_host", "1"); + switch_core_hash_insert(filter, "variable_sip_from_user", "1"); + switch_core_hash_insert(filter, "variable_sip_from_tag", "1"); + switch_core_hash_insert(filter, "variable_sip_h_X-AUTH-IP", "1"); + switch_core_hash_insert(filter, "variable_sip_received_ip", "1"); + switch_core_hash_insert(filter, "variable_sip_to_host", "1"); + switch_core_hash_insert(filter, "variable_sip_to_user", "1"); + switch_core_hash_insert(filter, "variable_sip_to_tag", "1"); + switch_core_hash_insert(filter, "variable_sofia_profile_name", "1"); + switch_core_hash_insert(filter, "variable_transfer_history", "1"); + switch_core_hash_insert(filter, "variable_user_name", "1"); + switch_core_hash_insert(filter, "variable_endpoint_disposition", "1"); + switch_core_hash_insert(filter, "variable_originate_disposition", "1"); + switch_core_hash_insert(filter, "variable_bridge_hangup_cause", "1"); + switch_core_hash_insert(filter, "variable_hangup_cause", "1"); + switch_core_hash_insert(filter, "variable_last_bridge_proto_specific_hangup_cause", "1"); + switch_core_hash_insert(filter, "variable_proto_specific_hangup_cause", "1"); + switch_core_hash_insert(filter, "VM-Call-ID", "1"); + switch_core_hash_insert(filter, "VM-sub-call-id", "1"); + switch_core_hash_insert(filter, "whistle_application_name", "1"); + switch_core_hash_insert(filter, "whistle_application_response", "1"); + switch_core_hash_insert(filter, "whistle_event_name", "1"); + switch_core_hash_insert(filter, "kazoo_application_name", "1"); + switch_core_hash_insert(filter, "kazoo_application_response", "1"); + switch_core_hash_insert(filter, "kazoo_event_name", "1"); + switch_core_hash_insert(filter, "sip_auto_answer_notify", "1"); + switch_core_hash_insert(filter, "eavesdrop_group", "1"); + switch_core_hash_insert(filter, "origination_caller_id_name", "1"); + switch_core_hash_insert(filter, "origination_caller_id_number", "1"); + switch_core_hash_insert(filter, "origination_callee_id_name", "1"); + switch_core_hash_insert(filter, "origination_callee_id_number", "1"); + switch_core_hash_insert(filter, "sip_auth_username", "1"); + switch_core_hash_insert(filter, "sip_auth_password", "1"); + switch_core_hash_insert(filter, "effective_caller_id_name", "1"); + switch_core_hash_insert(filter, "effective_caller_id_number", "1"); + switch_core_hash_insert(filter, "effective_callee_id_name", "1"); + switch_core_hash_insert(filter, "effective_callee_id_number", "1"); + switch_core_hash_insert(filter, "variable_destination_number", "1"); + switch_core_hash_insert(filter, "variable_effective_callee_id_name", "1"); + switch_core_hash_insert(filter, "variable_effective_callee_id_number", "1"); + switch_core_hash_insert(filter, "variable_record_silence_hits", "1"); + switch_core_hash_insert(filter, "variable_refer_uuid", "1"); + switch_core_hash_insert(filter, "variable_sip_call_id", "1"); + switch_core_hash_insert(filter, "variable_sip_h_Referred-By", "1"); + switch_core_hash_insert(filter, "variable_sip_h_X-AUTH-PORT", "1"); + switch_core_hash_insert(filter, "variable_sip_loopback_req_uri", "1"); + switch_core_hash_insert(filter, "variable_sip_received_port", "1"); + switch_core_hash_insert(filter, "variable_sip_refer_to", "1"); + switch_core_hash_insert(filter, "variable_sip_req_host", "1"); + switch_core_hash_insert(filter, "variable_sip_req_uri", "1"); + switch_core_hash_insert(filter, "variable_transfer_source", "1"); + switch_core_hash_insert(filter, "variable_uuid", "1"); + + /* Registration headers */ + switch_core_hash_insert(filter, "call-id", "1"); + switch_core_hash_insert(filter, "profile-name", "1"); + switch_core_hash_insert(filter, "from-user", "1"); + switch_core_hash_insert(filter, "from-host", "1"); + switch_core_hash_insert(filter, "presence-hosts", "1"); + switch_core_hash_insert(filter, "contact", "1"); + switch_core_hash_insert(filter, "rpid", "1"); + switch_core_hash_insert(filter, "status", "1"); + switch_core_hash_insert(filter, "expires", "1"); + switch_core_hash_insert(filter, "to-user", "1"); + switch_core_hash_insert(filter, "to-host", "1"); + switch_core_hash_insert(filter, "network-ip", "1"); + switch_core_hash_insert(filter, "network-port", "1"); + switch_core_hash_insert(filter, "username", "1"); + switch_core_hash_insert(filter, "realm", "1"); + switch_core_hash_insert(filter, "user-agent", "1"); + + switch_core_hash_insert(filter, "Hangup-Cause", "1"); + switch_core_hash_insert(filter, "Unique-ID", "1"); + switch_core_hash_insert(filter, "variable_switch_r_sdp", "1"); + switch_core_hash_insert(filter, "variable_rtp_local_sdp_str", "1"); + switch_core_hash_insert(filter, "variable_sip_to_uri", "1"); + switch_core_hash_insert(filter, "variable_sip_from_uri", "1"); + switch_core_hash_insert(filter, "variable_sip_user_agent", "1"); + switch_core_hash_insert(filter, "variable_duration", "1"); + switch_core_hash_insert(filter, "variable_billsec", "1"); + switch_core_hash_insert(filter, "variable_billmsec", "1"); + switch_core_hash_insert(filter, "variable_progresssec", "1"); + switch_core_hash_insert(filter, "variable_progress_uepoch", "1"); + switch_core_hash_insert(filter, "variable_progress_media_uepoch", "1"); + switch_core_hash_insert(filter, "variable_start_uepoch", "1"); + switch_core_hash_insert(filter, "variable_digits_dialed", "1"); + switch_core_hash_insert(filter, "Member-ID", "1"); + switch_core_hash_insert(filter, "Floor", "1"); + switch_core_hash_insert(filter, "Video", "1"); + switch_core_hash_insert(filter, "Hear", "1"); + switch_core_hash_insert(filter, "Speak", "1"); + switch_core_hash_insert(filter, "Talking", "1"); + switch_core_hash_insert(filter, "Current-Energy", "1"); + switch_core_hash_insert(filter, "Energy-Level", "1"); + switch_core_hash_insert(filter, "Mute-Detect", "1"); + + /* RTMP headers */ + switch_core_hash_insert(filter, "RTMP-Session-ID", "1"); + switch_core_hash_insert(filter, "RTMP-Profile", "1"); + switch_core_hash_insert(filter, "RTMP-Flash-Version", "1"); + switch_core_hash_insert(filter, "RTMP-SWF-URL", "1"); + switch_core_hash_insert(filter, "RTMP-TC-URL", "1"); + switch_core_hash_insert(filter, "RTMP-Page-URL", "1"); + switch_core_hash_insert(filter, "User", "1"); + switch_core_hash_insert(filter, "Domain", "1"); + + /* Fax headers */ + switch_core_hash_insert(filter, "variable_fax_bad_rows", "1"); + switch_core_hash_insert(filter, "variable_fax_document_total_pages", "1"); + switch_core_hash_insert(filter, "variable_fax_document_transferred_pages", "1"); + switch_core_hash_insert(filter, "variable_fax_ecm_used", "1"); + switch_core_hash_insert(filter, "variable_fax_result_code", "1"); + switch_core_hash_insert(filter, "variable_fax_result_text", "1"); + switch_core_hash_insert(filter, "variable_fax_success", "1"); + switch_core_hash_insert(filter, "variable_fax_transfer_rate", "1"); + switch_core_hash_insert(filter, "variable_fax_local_station_id", "1"); + switch_core_hash_insert(filter, "variable_fax_remote_station_id", "1"); + switch_core_hash_insert(filter, "variable_fax_remote_country", "1"); + switch_core_hash_insert(filter, "variable_fax_remote_vendor", "1"); + switch_core_hash_insert(filter, "variable_fax_remote_model", "1"); + switch_core_hash_insert(filter, "variable_fax_image_resolution", "1"); + switch_core_hash_insert(filter, "variable_fax_file_image_resolution", "1"); + switch_core_hash_insert(filter, "variable_fax_image_size", "1"); + switch_core_hash_insert(filter, "variable_fax_image_pixel_size", "1"); + switch_core_hash_insert(filter, "variable_fax_file_image_pixel_size", "1"); + switch_core_hash_insert(filter, "variable_fax_longest_bad_row_run", "1"); + switch_core_hash_insert(filter, "variable_fax_encoding", "1"); + switch_core_hash_insert(filter, "variable_fax_encoding_name", "1"); + switch_core_hash_insert(filter, "variable_fax_header", "1"); + switch_core_hash_insert(filter, "variable_fax_ident", "1"); + switch_core_hash_insert(filter, "variable_fax_timezone", "1"); + switch_core_hash_insert(filter, "variable_fax_doc_id", "1"); + switch_core_hash_insert(filter, "variable_fax_doc_database", "1"); + switch_core_hash_insert(filter, "variable_has_t38", "1"); + + /* Secure headers */ + switch_core_hash_insert(filter, "variable_sdp_secure_savp_only", "1"); + switch_core_hash_insert(filter, "variable_rtp_has_crypto", "1"); + switch_core_hash_insert(filter, "variable_rtp_secure_media", "1"); + switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed", "1"); + switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed_audio", "1"); + switch_core_hash_insert(filter, "variable_rtp_secure_media_confirmed_video", "1"); + switch_core_hash_insert(filter, "variable_zrtp_secure_media", "1"); + switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed", "1"); + switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed_audio", "1"); + switch_core_hash_insert(filter, "variable_zrtp_secure_media_confirmed_video", "1"); + switch_core_hash_insert(filter, "sdp_secure_savp_only", "1"); + switch_core_hash_insert(filter, "rtp_has_crypto", "1"); + switch_core_hash_insert(filter, "rtp_secure_media", "1"); + switch_core_hash_insert(filter, "rtp_secure_media_confirmed", "1"); + switch_core_hash_insert(filter, "rtp_secure_media_confirmed_audio", "1"); + switch_core_hash_insert(filter, "rtp_secure_media_confirmed_video", "1"); + switch_core_hash_insert(filter, "zrtp_secure_media", "1"); + switch_core_hash_insert(filter, "zrtp_secure_media_confirmed", "1"); + switch_core_hash_insert(filter, "zrtp_secure_media_confirmed_audio", "1"); + switch_core_hash_insert(filter, "zrtp_secure_media_confirmed_video", "1"); + + /* Device Redirect headers */ + switch_core_hash_insert(filter, "variable_last_bridge_hangup_cause", "1"); + switch_core_hash_insert(filter, "variable_sip_redirected_by", "1"); + switch_core_hash_insert(filter, "intercepted_by", "1"); + switch_core_hash_insert(filter, "variable_bridge_uuid", "1"); + switch_core_hash_insert(filter, "Record-File-Path", "1"); + + /* Loopback headers */ + switch_core_hash_insert(filter, "variable_loopback_bowout_on_execute", "1"); + switch_core_hash_insert(filter, "variable_loopback_bowout", "1"); + switch_core_hash_insert(filter, "variable_other_loopback_leg_uuid", "1"); + switch_core_hash_insert(filter, "variable_loopback_leg", "1"); + switch_core_hash_insert(filter, "variable_is_loopback", "1"); + + // SMS + switch_core_hash_insert(filter, "Message-ID", "1"); + switch_core_hash_insert(filter, "Delivery-Failure", "1"); + switch_core_hash_insert(filter, "Delivery-Result-Code", "1"); + + return filter; +} + +static void *SWITCH_THREAD_FUNC fetch_config_filters_exec(switch_thread_t *thread, void *obj) +{ + char *cf = "kazoo.conf"; + switch_xml_t cfg, xml, child, param; + switch_event_t *params; + switch_memory_pool_t *pool = (switch_memory_pool_t *)obj; + + switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Action", "request-filter"); + + if (!(xml = switch_xml_open_cfg(cf, &cfg, params))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf); + } else if ((child = switch_xml_child(cfg, "event-filter"))) { + switch_hash_t *filter; + switch_hash_t *old_filter; + + switch_core_hash_init(&filter); + for (param = switch_xml_child(child, "header"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + switch_core_hash_insert(filter, var, "1"); + } + + old_filter = kazoo_globals.event_filter; + kazoo_globals.config_filters_fetched = 1; + kazoo_globals.event_filter = filter; + if (old_filter) { + switch_core_hash_destroy(&old_filter); + } + + switch_xml_free(xml); + } + + if (params) switch_event_destroy(¶ms); + switch_core_destroy_memory_pool(&pool); + + return NULL; +} + +void fetch_config_filters() { + switch_memory_pool_t *pool; + switch_thread_t *thread; + switch_threadattr_t *thd_attr = NULL; + switch_uuid_t uuid; + + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "fetching kazoo filters\n"); + + switch_core_new_memory_pool(&pool); + + switch_threadattr_create(&thd_attr, pool); + switch_threadattr_detach_set(thd_attr, 1); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + + switch_uuid_get(&uuid); + switch_thread_create(&thread, thd_attr, fetch_config_filters_exec, pool, pool); + +} + + + /* For Emacs: * Local Variables: * mode:c diff --git a/src/mod/event_handlers/mod_kazoo/mod_kazoo.c b/src/mod/event_handlers/mod_kazoo/mod_kazoo.c index 5b255738ff..b666920d3f 100644 --- a/src/mod/event_handlers/mod_kazoo/mod_kazoo.c +++ b/src/mod/event_handlers/mod_kazoo/mod_kazoo.c @@ -32,12 +32,608 @@ */ #include "mod_kazoo.h" -globals_t kazoo_globals = {0}; - +#define KAZOO_DESC "kazoo information" +#define KAZOO_SYNTAX " []" +globals_t kazoo_globals; +SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown); +SWITCH_MODULE_RUNTIME_FUNCTION(mod_kazoo_runtime); SWITCH_MODULE_DEFINITION(mod_kazoo, mod_kazoo_load, mod_kazoo_shutdown, mod_kazoo_runtime); +SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_pref_ip, kazoo_globals.ip); +SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_pref_ei_cookie, kazoo_globals.ei_cookie); +SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_pref_ei_nodename, kazoo_globals.ei_nodename); +SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_pref_kazoo_var_prefix, kazoo_globals.kazoo_var_prefix); + +static switch_status_t api_erlang_status(switch_stream_handle_t *stream) { + switch_sockaddr_t *sa; + uint16_t port; + char ipbuf[48]; + const char *ip_addr; + ei_node_t *ei_node; + + switch_socket_addr_get(&sa, SWITCH_FALSE, kazoo_globals.acceptor); + + port = switch_sockaddr_get_port(sa); + ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); + + stream->write_function(stream, "Running %s\n", VERSION); + stream->write_function(stream, "Listening for new Erlang connections on %s:%u with cookie %s\n", ip_addr, port, kazoo_globals.ei_cookie); + stream->write_function(stream, "Registered as Erlang node %s, visible as %s\n", kazoo_globals.ei_cnode.thisnodename, kazoo_globals.ei_cnode.thisalivename); + + if (kazoo_globals.ei_compat_rel) { + stream->write_function(stream, "Using Erlang compatibility mode: %d\n", kazoo_globals.ei_compat_rel); + } + + switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); + ei_node = kazoo_globals.ei_nodes; + if (!ei_node) { + stream->write_function(stream, "No erlang nodes connected\n"); + } else { + stream->write_function(stream, "Connected to:\n"); + while(ei_node != NULL) { + unsigned int year, day, hour, min, sec, delta; + + delta = (switch_micro_time_now() - ei_node->created_time) / 1000000; + sec = delta % 60; + min = delta / 60 % 60; + hour = delta / 3600 % 24; + day = delta / 86400 % 7; + year = delta / 31556926 % 12; + stream->write_function(stream, " %s (%s:%d) up %d years, %d days, %d hours, %d minutes, %d seconds\n" + ,ei_node->peer_nodename, ei_node->remote_ip, ei_node->remote_port, year, day, hour, min, sec); + ei_node = ei_node->next; + } + } + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t api_erlang_event_filter(switch_stream_handle_t *stream) { + switch_hash_index_t *hi = NULL; + int column = 0; + + for (hi = (switch_hash_index_t *)switch_core_hash_first_iter(kazoo_globals.event_filter, hi); hi; hi = switch_core_hash_next(&hi)) { + const void *key; + void *val; + switch_core_hash_this(hi, &key, NULL, &val); + stream->write_function(stream, "%-50s", (char *)key); + if (++column > 2) { + stream->write_function(stream, "\n"); + column = 0; + } + } + + if (++column > 2) { + stream->write_function(stream, "\n"); + column = 0; + } + + stream->write_function(stream, "%-50s", kazoo_globals.kazoo_var_prefix); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t api_erlang_nodes_list(switch_stream_handle_t *stream) { + ei_node_t *ei_node; + + switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); + ei_node = kazoo_globals.ei_nodes; + while(ei_node != NULL) { + stream->write_function(stream, "%s (%s)\n", ei_node->peer_nodename, ei_node->remote_ip); + ei_node = ei_node->next; + } + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t api_erlang_nodes_count(switch_stream_handle_t *stream) { + ei_node_t *ei_node; + int count = 0; + + switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); + ei_node = kazoo_globals.ei_nodes; + while(ei_node != NULL) { + count++; + ei_node = ei_node->next; + } + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + + stream->write_function(stream, "%d\n", count); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t api_complete_erlang_node(const char *line, const char *cursor, switch_console_callback_match_t **matches) { + switch_console_callback_match_t *my_matches = NULL; + switch_status_t status = SWITCH_STATUS_FALSE; + ei_node_t *ei_node; + + switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); + ei_node = kazoo_globals.ei_nodes; + while(ei_node != NULL) { + switch_console_push_match(&my_matches, ei_node->peer_nodename); + ei_node = ei_node->next; + } + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + + if (my_matches) { + *matches = my_matches; + status = SWITCH_STATUS_SUCCESS; + } + + return status; +} + +static switch_status_t handle_node_api_event_stream(ei_event_stream_t *event_stream, switch_stream_handle_t *stream) { + ei_event_binding_t *binding; + int column = 0; + + switch_mutex_lock(event_stream->socket_mutex); + if (event_stream->connected == SWITCH_FALSE) { + switch_sockaddr_t *sa; + uint16_t port; + char ipbuf[48] = {0}; + const char *ip_addr; + + switch_socket_addr_get(&sa, SWITCH_TRUE, event_stream->acceptor); + port = switch_sockaddr_get_port(sa); + ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); + + if (zstr(ip_addr)) { + ip_addr = kazoo_globals.ip; + } + + stream->write_function(stream, "%s:%d -> disconnected\n" + ,ip_addr, port); + } else { + stream->write_function(stream, "%s:%d -> %s:%d\n" + ,event_stream->local_ip, event_stream->local_port + ,event_stream->remote_ip, event_stream->remote_port); + } + + binding = event_stream->bindings; + while(binding != NULL) { + if (binding->type == SWITCH_EVENT_CUSTOM) { + stream->write_function(stream, "CUSTOM %-43s", binding->subclass_name); + } else { + stream->write_function(stream, "%-50s", switch_event_name(binding->type)); + } + + if (++column > 2) { + stream->write_function(stream, "\n"); + column = 0; + } + + binding = binding->next; + } + switch_mutex_unlock(event_stream->socket_mutex); + + if (!column) { + stream->write_function(stream, "\n"); + } else { + stream->write_function(stream, "\n\n"); + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t handle_node_api_event_streams(ei_node_t *ei_node, switch_stream_handle_t *stream) { + ei_event_stream_t *event_stream; + + switch_mutex_lock(ei_node->event_streams_mutex); + event_stream = ei_node->event_streams; + while(event_stream != NULL) { + handle_node_api_event_stream(event_stream, stream); + event_stream = event_stream->next; + } + switch_mutex_unlock(ei_node->event_streams_mutex); + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t handle_node_api_command(ei_node_t *ei_node, switch_stream_handle_t *stream, uint32_t command) { + unsigned int year, day, hour, min, sec, delta; + + switch (command) { + case API_COMMAND_DISCONNECT: + stream->write_function(stream, "Disconnecting erlang node %s at managers request\n", ei_node->peer_nodename); + switch_clear_flag(ei_node, LFLAG_RUNNING); + break; + case API_COMMAND_REMOTE_IP: + delta = (switch_micro_time_now() - ei_node->created_time) / 1000000; + sec = delta % 60; + min = delta / 60 % 60; + hour = delta / 3600 % 24; + day = delta / 86400 % 7; + year = delta / 31556926 % 12; + + stream->write_function(stream, "Uptime %d years, %d days, %d hours, %d minutes, %d seconds\n", year, day, hour, min, sec); + stream->write_function(stream, "Local Address %s:%d\n", ei_node->local_ip, ei_node->local_port); + stream->write_function(stream, "Remote Address %s:%d\n", ei_node->remote_ip, ei_node->remote_port); + break; + case API_COMMAND_STREAMS: + handle_node_api_event_streams(ei_node, stream); + break; + case API_COMMAND_BINDINGS: + handle_api_command_streams(ei_node, stream); + break; + default: + break; + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t api_erlang_node_command(switch_stream_handle_t *stream, const char *nodename, uint32_t command) { + ei_node_t *ei_node; + + switch_thread_rwlock_rdlock(kazoo_globals.ei_nodes_lock); + ei_node = kazoo_globals.ei_nodes; + while(ei_node != NULL) { + int length = strlen(ei_node->peer_nodename); + + if (!strncmp(ei_node->peer_nodename, nodename, length)) { + handle_node_api_command(ei_node, stream, command); + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + return SWITCH_STATUS_SUCCESS; + } + + ei_node = ei_node->next; + } + switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); + + return SWITCH_STATUS_NOTFOUND; +} + +static int read_cookie_from_file(char *filename) { + int fd; + char cookie[MAXATOMLEN + 1]; + char *end; + struct stat buf; + ssize_t res; + + if (!stat(filename, &buf)) { + if ((buf.st_mode & S_IRWXG) || (buf.st_mode & S_IRWXO)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s must only be accessible by owner only.\n", filename); + return 2; + } + if (buf.st_size > MAXATOMLEN) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s contains a cookie larger than the maximum atom size of %d.\n", filename, MAXATOMLEN); + return 2; + } + fd = open(filename, O_RDONLY); + if (fd < 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to open cookie file %s : %d.\n", filename, errno); + return 2; + } + + if ((res = read(fd, cookie, MAXATOMLEN)) < 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to read cookie file %s : %d.\n", filename, errno); + } + + cookie[MAXATOMLEN] = '\0'; + + /* replace any end of line characters with a null */ + if ((end = strchr(cookie, '\n'))) { + *end = '\0'; + } + + if ((end = strchr(cookie, '\r'))) { + *end = '\0'; + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set cookie from file %s: %s\n", filename, cookie); + + set_pref_ei_cookie(cookie); + return 0; + } else { + /* don't error here, because we might be blindly trying to read $HOME/.erlang.cookie, and that can fail silently */ + return 1; + } +} + +static switch_status_t config(void) { + char *cf = "kazoo.conf"; + switch_xml_t cfg, xml, child, param; + kazoo_globals.send_all_headers = 0; + kazoo_globals.send_all_private_headers = 1; + kazoo_globals.connection_timeout = 500; + kazoo_globals.receive_timeout = 200; + kazoo_globals.receive_msg_preallocate = 2000; + kazoo_globals.event_stream_preallocate = 4000; + kazoo_globals.send_msg_batch = 10; + kazoo_globals.event_stream_framing = 2; + kazoo_globals.port = 0; + kazoo_globals.io_fault_tolerance = 10; + + if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open configuration file %s\n", cf); + return SWITCH_STATUS_FALSE; + } else { + if ((child = switch_xml_child(cfg, "settings"))) { + for (param = switch_xml_child(child, "param"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + char *val = (char *) switch_xml_attr_soft(param, "value"); + + if (!strcmp(var, "listen-ip")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set bind ip address: %s\n", val); + set_pref_ip(val); + } else if (!strcmp(var, "listen-port")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set bind port: %s\n", val); + kazoo_globals.port = atoi(val); + } else if (!strcmp(var, "cookie")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set cookie: %s\n", val); + set_pref_ei_cookie(val); + } else if (!strcmp(var, "cookie-file")) { + if (read_cookie_from_file(val) == 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to read cookie from %s\n", val); + } + } else if (!strcmp(var, "nodename")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set node name: %s\n", val); + set_pref_ei_nodename(val); + } else if (!strcmp(var, "shortname")) { + kazoo_globals.ei_shortname = switch_true(val); + } else if (!strcmp(var, "kazoo-var-prefix")) { + set_pref_kazoo_var_prefix(val); + } else if (!strcmp(var, "compat-rel")) { + if (atoi(val) >= 7) + kazoo_globals.ei_compat_rel = atoi(val); + else + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid compatibility release '%s' specified\n", val); + } else if (!strcmp(var, "nat-map")) { + kazoo_globals.nat_map = switch_true(val); + } else if (!strcmp(var, "send-all-headers")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-all-headers: %s\n", val); + kazoo_globals.send_all_headers = switch_true(val); + } else if (!strcmp(var, "send-all-private-headers")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-all-private-headers: %s\n", val); + kazoo_globals.send_all_private_headers = switch_true(val); + } else if (!strcmp(var, "connection-timeout")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set connection-timeout: %s\n", val); + kazoo_globals.connection_timeout = atoi(val); + } else if (!strcmp(var, "receive-timeout")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set receive-timeout: %s\n", val); + kazoo_globals.receive_timeout = atoi(val); + } else if (!strcmp(var, "receive-msg-preallocate")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set receive-msg-preallocate: %s\n", val); + kazoo_globals.receive_msg_preallocate = atoi(val); + } else if (!strcmp(var, "event-stream-preallocate")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set event-stream-preallocate: %s\n", val); + kazoo_globals.event_stream_preallocate = atoi(val); + } else if (!strcmp(var, "send-msg-batch-size")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set send-msg-batch-size: %s\n", val); + kazoo_globals.send_msg_batch = atoi(val); + } else if (!strcmp(var, "event-stream-framing")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set event-stream-framing: %s\n", val); + kazoo_globals.event_stream_framing = atoi(val); + } else if (!strcmp(var, "io-fault-tolerance")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Set io-fault-tolerance: %s\n", val); + kazoo_globals.io_fault_tolerance = atoi(val); + } + } + } + + if ((child = switch_xml_child(cfg, "event-filter"))) { + switch_hash_t *filter; + + switch_core_hash_init(&filter); + for (param = switch_xml_child(child, "header"); param; param = param->next) { + char *var = (char *) switch_xml_attr_soft(param, "name"); + switch_core_hash_insert(filter, var, "1"); + } + + kazoo_globals.event_filter = filter; + } + + switch_xml_free(xml); + } + + if (kazoo_globals.receive_msg_preallocate < 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid receive message preallocate value, disabled\n"); + kazoo_globals.receive_msg_preallocate = 0; + } + + if (kazoo_globals.event_stream_preallocate < 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid event stream preallocate value, disabled\n"); + kazoo_globals.event_stream_preallocate = 0; + } + + if (kazoo_globals.send_msg_batch < 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid send message batch size, reverting to default\n"); + kazoo_globals.send_msg_batch = 10; + } + + if (kazoo_globals.io_fault_tolerance < 1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid I/O fault tolerance, reverting to default\n"); + kazoo_globals.io_fault_tolerance = 10; + } + + if (!kazoo_globals.event_filter) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Event filter not found in configuration, using default\n"); + kazoo_globals.event_filter = create_default_filter(); + } + + if (kazoo_globals.event_stream_framing < 1 || kazoo_globals.event_stream_framing > 4) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid event stream framing value, using default\n"); + kazoo_globals.event_stream_framing = 2; + } + + if (zstr(kazoo_globals.kazoo_var_prefix)) { + set_pref_kazoo_var_prefix("variable_ecallmgr*"); + kazoo_globals.var_prefix_length = 17; //ignore the * + } else { + /* we could use the global pool but then we would have to conditionally + * free the pointer if it was not drawn from the XML */ + char *buf; + int size = switch_snprintf(NULL, 0, "variable_%s*", kazoo_globals.kazoo_var_prefix) + 1; + + switch_malloc(buf, size); + switch_snprintf(buf, size, "variable_%s*", kazoo_globals.kazoo_var_prefix); + switch_safe_free(kazoo_globals.kazoo_var_prefix); + kazoo_globals.kazoo_var_prefix = buf; + kazoo_globals.var_prefix_length = size - 2; //ignore the * + } + + if (!kazoo_globals.num_worker_threads) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Number of worker threads not found in configuration, using default\n"); + kazoo_globals.num_worker_threads = 10; + } + + if (zstr(kazoo_globals.ip)) { + set_pref_ip("0.0.0.0"); + } + + if (zstr(kazoo_globals.ei_cookie)) { + int res; + char *home_dir = getenv("HOME"); + char path_buf[1024]; + + if (!zstr(home_dir)) { + /* $HOME/.erlang.cookie */ + switch_snprintf(path_buf, sizeof (path_buf), "%s%s%s", home_dir, SWITCH_PATH_SEPARATOR, ".erlang.cookie"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Checking for cookie at path: %s\n", path_buf); + + res = read_cookie_from_file(path_buf); + if (res) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No cookie or valid cookie file specified, using default cookie\n"); + set_pref_ei_cookie("ClueCon"); + } + } + } + + if (!kazoo_globals.ei_nodename) { + set_pref_ei_nodename("freeswitch"); + } + + if (!kazoo_globals.nat_map) { + kazoo_globals.nat_map = 0; + } + + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t create_acceptor() { + switch_sockaddr_t *sa; + uint16_t port; + char ipbuf[48]; + const char *ip_addr; + + /* if the config has specified an erlang release compatibility then pass that along to the erlang interface */ + if (kazoo_globals.ei_compat_rel) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Compatability with OTP R%d requested\n", kazoo_globals.ei_compat_rel); + ei_set_compat_rel(kazoo_globals.ei_compat_rel); + } + + if (!(kazoo_globals.acceptor = create_socket_with_port(kazoo_globals.pool, kazoo_globals.port))) { + return SWITCH_STATUS_SOCKERR; + } + + switch_socket_addr_get(&sa, SWITCH_FALSE, kazoo_globals.acceptor); + + port = switch_sockaddr_get_port(sa); + ip_addr = switch_get_addr(ipbuf, sizeof (ipbuf), sa); + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Erlang connection acceptor listening on %s:%u\n", ip_addr, port); + + /* try to initialize the erlang interface */ + if (create_ei_cnode(ip_addr, kazoo_globals.ei_nodename, &kazoo_globals.ei_cnode) != SWITCH_STATUS_SUCCESS) { + return SWITCH_STATUS_SOCKERR; + } + + /* tell the erlang port manager where we can be reached. this returns a file descriptor pointing to epmd or -1 */ + if ((kazoo_globals.epmdfd = ei_publish(&kazoo_globals.ei_cnode, port)) == -1) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, + "Failed to publish port to epmd. Try starting it yourself or run an erl shell with the -sname or -name option.\n"); + return SWITCH_STATUS_SOCKERR; + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connected to epmd and published erlang cnode name %s at port %d\n", kazoo_globals.ei_cnode.thisnodename, port); + + return SWITCH_STATUS_SUCCESS; +} + +SWITCH_STANDARD_API(exec_api_cmd) +{ + char *argv[1024] = { 0 }; + int unknown_command = 1, argc = 0; + char *mycmd = NULL; + + const char *usage_string = "USAGE:\n" + "--------------------------------------------------------------------------------------------------------------------\n" + "erlang status - provides an overview of the current status\n" + "erlang event_filter - lists the event headers that will be sent to Erlang nodes\n" + "erlang nodes list - lists connected Erlang nodes (usefull for monitoring tools)\n" + "erlang nodes count - provides a count of connected Erlang nodes (usefull for monitoring tools)\n" + "erlang node disconnect - disconnects an Erlang node\n" + "erlang node connection - Shows the connection info\n" + "erlang node event_streams - lists the event streams for an Erlang node\n" + "erlang node fetch_bindings - lists the XML fetch bindings for an Erlang node\n" + "---------------------------------------------------------------------------------------------------------------------\n"; + + if (zstr(cmd)) { + stream->write_function(stream, "%s", usage_string); + return SWITCH_STATUS_SUCCESS; + } + + if (!(mycmd = strdup(cmd))) { + return SWITCH_STATUS_MEMERR; + } + + if (!(argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { + stream->write_function(stream, "%s", usage_string); + switch_safe_free(mycmd); + return SWITCH_STATUS_SUCCESS; + } + + if (zstr(argv[0])) { + stream->write_function(stream, "%s", usage_string); + switch_safe_free(mycmd); + return SWITCH_STATUS_SUCCESS; + } + + if (!strncmp(argv[0], "status", 6)) { + unknown_command = 0; + api_erlang_status(stream); + } else if (!strncmp(argv[0], "event_filter", 6)) { + unknown_command = 0; + api_erlang_event_filter(stream); + } else if (!strncmp(argv[0], "nodes", 6) && !zstr(argv[1])) { + if (!strncmp(argv[1], "list", 6)) { + unknown_command = 0; + api_erlang_nodes_list(stream); + } else if (!strncmp(argv[1], "count", 6)) { + unknown_command = 0; + api_erlang_nodes_count(stream); + } + } else if (!strncmp(argv[0], "node", 6) && !zstr(argv[1]) && !zstr(argv[2])) { + if (!strncmp(argv[2], "disconnect", 6)) { + unknown_command = 0; + api_erlang_node_command(stream, argv[1], API_COMMAND_DISCONNECT); + } else if (!strncmp(argv[2], "connection", 2)) { + unknown_command = 0; + api_erlang_node_command(stream, argv[1], API_COMMAND_REMOTE_IP); + } else if (!strncmp(argv[2], "event_streams", 6)) { + unknown_command = 0; + api_erlang_node_command(stream, argv[1], API_COMMAND_STREAMS); + } else if (!strncmp(argv[2], "fetch_bindings", 6)) { + unknown_command = 0; + api_erlang_node_command(stream, argv[1], API_COMMAND_BINDINGS); + } + } + + if (unknown_command) { + stream->write_function(stream, "%s", usage_string); + } + + switch_safe_free(mycmd); + return SWITCH_STATUS_SUCCESS; +} + SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load) { switch_api_interface_t *api_interface = NULL; switch_application_interface_t *app_interface = NULL; @@ -47,17 +643,34 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load) { kazoo_globals.pool = pool; kazoo_globals.ei_nodes = NULL; - // ensure epmd is running - - if(kazoo_load_config() != SWITCH_STATUS_SUCCESS) { + if(config() != SWITCH_STATUS_SUCCESS) { // TODO: what would we need to clean up here? switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Improper configuration!\n"); return SWITCH_STATUS_TERM; } + if(create_acceptor() != SWITCH_STATUS_SUCCESS) { + // TODO: what would we need to clean up here + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to create erlang connection acceptor!\n"); + close_socket(&kazoo_globals.acceptor); + return SWITCH_STATUS_TERM; + } + /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); + /* create an api for cli debug commands */ + SWITCH_ADD_API(api_interface, "erlang", KAZOO_DESC, exec_api_cmd, KAZOO_SYNTAX); + switch_console_set_complete("add erlang status"); + switch_console_set_complete("add erlang event_filter"); + switch_console_set_complete("add erlang nodes list"); + switch_console_set_complete("add erlang nodes count"); + switch_console_set_complete("add erlang node ::erlang::node disconnect"); + switch_console_set_complete("add erlang node ::erlang::node connection"); + switch_console_set_complete("add erlang node ::erlang::node event_streams"); + switch_console_set_complete("add erlang node ::erlang::node fetch_bindings"); + switch_console_add_complete_func("::erlang::node", api_complete_erlang_node); + switch_thread_rwlock_create(&kazoo_globals.ei_nodes_lock, pool); switch_set_flag(&kazoo_globals, LFLAG_RUNNING); @@ -65,18 +678,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load) { /* create all XML fetch agents */ bind_fetch_agents(); - /* create an api for cli debug commands */ - add_cli_api(module_interface, api_interface); - /* add our modified commands */ add_kz_commands(module_interface, api_interface); /* add our modified dptools */ add_kz_dptools(module_interface, app_interface); - /* add tweaks */ - kz_tweaks_start(); - /* indicate that the module should continue to be loaded */ return SWITCH_STATUS_SUCCESS; } @@ -84,10 +691,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load) { SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown) { int sanity = 0; - - remove_cli_api(); - - kz_tweaks_stop(); + switch_console_set_complete("del erlang"); + switch_console_del_complete_func("::erlang::node"); /* stop taking new requests and start shuting down the threads */ switch_clear_flag(&kazoo_globals, LFLAG_RUNNING); @@ -105,8 +710,6 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown) { switch_core_hash_destroy(&kazoo_globals.event_filter); } - kazoo_destroy_config(); - switch_thread_rwlock_wrlock(kazoo_globals.ei_nodes_lock); switch_thread_rwlock_unlock(kazoo_globals.ei_nodes_lock); switch_thread_rwlock_destroy(kazoo_globals.ei_nodes_lock); @@ -119,9 +722,9 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown) { unbind_fetch_agents(); /* Close the port we reserved for uPnP/Switch behind firewall, if necessary */ - if (kazoo_globals.nat_map && switch_nat_get_type()) { - switch_nat_del_mapping(kazoo_globals.port, SWITCH_NAT_TCP); - } + // if (kazoo_globals.nat_map && switch_nat_get_type()) { + // switch_nat_del_mapping(kazoo_globals.port, SWITCH_NAT_TCP); + // } /* clean up our allocated preferences */ switch_safe_free(kazoo_globals.ip); @@ -132,6 +735,50 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown) { return SWITCH_STATUS_SUCCESS; } +SWITCH_MODULE_RUNTIME_FUNCTION(mod_kazoo_runtime) { + switch_os_socket_t os_socket; + + switch_atomic_inc(&kazoo_globals.threads); + + switch_os_sock_get(&os_socket, kazoo_globals.acceptor); + + while (switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { + int nodefd; + ErlConnect conn; + + /* zero out errno because ei_accept doesn't differentiate between a */ + /* failed authentication or a socket failure, or a client version */ + /* mismatch or a godzilla attack (and a godzilla attack is highly likely) */ + errno = 0; + + /* wait here for an erlang node to connect, timming out to check if our module is still running every now-and-again */ + if ((nodefd = ei_accept_tmo(&kazoo_globals.ei_cnode, (int) os_socket, &conn, kazoo_globals.connection_timeout)) == ERL_ERROR) { + if (erl_errno == ETIMEDOUT) { + continue; + } else if (errno) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Erlang connection acceptor socket error %d %d\n", erl_errno, errno); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, + "Erlang node connection failed - ensure your cookie matches '%s' and you are using a good nodename\n", kazoo_globals.ei_cookie); + } + continue; + } + + if (!switch_test_flag(&kazoo_globals, LFLAG_RUNNING)) { + break; + } + + /* NEW ERLANG NODE CONNECTION! Hello friend! */ + new_kazoo_node(nodefd, &conn); + } + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Erlang connection acceptor shut down\n"); + + switch_atomic_dec(&kazoo_globals.threads); + + return SWITCH_STATUS_TERM; +} + /* For Emacs: * Local Variables: diff --git a/src/mod/event_handlers/mod_kazoo/mod_kazoo.h b/src/mod/event_handlers/mod_kazoo/mod_kazoo.h index 165e9ff1ce..9de7db6ea0 100644 --- a/src/mod/event_handlers/mod_kazoo/mod_kazoo.h +++ b/src/mod/event_handlers/mod_kazoo/mod_kazoo.h @@ -1,32 +1,167 @@ #include #include -#include #include #include #include #include #include -#include #define MAX_ACL 100 #define CMD_BUFLEN 1024 * 1000 #define MAX_QUEUE_LEN 25000 #define MAX_MISSED 500 #define MAX_PID_CHARS 255 +#define VERSION "mod_kazoo v1.4.0-1" - -#include "kazoo_ei.h" -#include "kazoo_message.h" +#define API_COMMAND_DISCONNECT 0 +#define API_COMMAND_REMOTE_IP 1 +#define API_COMMAND_STREAMS 2 +#define API_COMMAND_BINDINGS 3 typedef enum { LFLAG_RUNNING = (1 << 0) } event_flag_t; +struct ei_send_msg_s { + ei_x_buff buf; + erlang_pid pid; +}; +typedef struct ei_send_msg_s ei_send_msg_t; +struct ei_received_msg_s { + ei_x_buff buf; + erlang_msg msg; +}; +typedef struct ei_received_msg_s ei_received_msg_t; +struct ei_event_binding_s { + char id[SWITCH_UUID_FORMATTED_LENGTH + 1]; + switch_event_node_t *node; + switch_event_types_t type; + const char *subclass_name; + struct ei_event_binding_s *next; +}; +typedef struct ei_event_binding_s ei_event_binding_t; +struct ei_event_stream_s { + switch_memory_pool_t *pool; + ei_event_binding_t *bindings; + switch_queue_t *queue; + switch_socket_t *acceptor; + switch_pollset_t *pollset; + switch_pollfd_t *pollfd; + switch_socket_t *socket; + switch_mutex_t *socket_mutex; + switch_bool_t connected; + char remote_ip[48]; + uint16_t remote_port; + char local_ip[48]; + uint16_t local_port; + erlang_pid pid; + uint32_t flags; + struct ei_event_stream_s *next; +}; +typedef struct ei_event_stream_s ei_event_stream_t; +struct ei_node_s { + int nodefd; + switch_atomic_t pending_bgapi; + switch_atomic_t receive_handlers; + switch_memory_pool_t *pool; + ei_event_stream_t *event_streams; + switch_mutex_t *event_streams_mutex; + switch_queue_t *send_msgs; + switch_queue_t *received_msgs; + char *peer_nodename; + switch_time_t created_time; + switch_socket_t *socket; + char remote_ip[48]; + uint16_t remote_port; + char local_ip[48]; + uint16_t local_port; + uint32_t flags; + struct ei_node_s *next; +}; +typedef struct ei_node_s ei_node_t; +struct globals_s { + switch_memory_pool_t *pool; + switch_atomic_t threads; + switch_socket_t *acceptor; + struct ei_cnode_s ei_cnode; + switch_thread_rwlock_t *ei_nodes_lock; + ei_node_t *ei_nodes; + switch_xml_binding_t *config_fetch_binding; + switch_xml_binding_t *directory_fetch_binding; + switch_xml_binding_t *dialplan_fetch_binding; + switch_xml_binding_t *chatplan_fetch_binding; + switch_xml_binding_t *channels_fetch_binding; + switch_hash_t *event_filter; + int epmdfd; + int num_worker_threads; + switch_bool_t nat_map; + switch_bool_t ei_shortname; + int ei_compat_rel; + char *ip; + char *hostname; + char *ei_cookie; + char *ei_nodename; + char *kazoo_var_prefix; + int var_prefix_length; + uint32_t flags; + int send_all_headers; + int send_all_private_headers; + int connection_timeout; + int receive_timeout; + int receive_msg_preallocate; + int event_stream_preallocate; + int send_msg_batch; + short event_stream_framing; + switch_port_t port; + int config_filters_fetched; + int io_fault_tolerance; +}; +typedef struct globals_s globals_t; +extern globals_t kazoo_globals; + +/* kazoo_node.c */ +switch_status_t new_kazoo_node(int nodefd, ErlConnect *conn); + +/* kazoo_event_stream.c */ +ei_event_stream_t *find_event_stream(ei_event_stream_t *event_streams, const erlang_pid *from); +ei_event_stream_t *new_event_stream(ei_event_stream_t **event_streams, const erlang_pid *from); +switch_status_t remove_event_stream(ei_event_stream_t **event_streams, const erlang_pid *from); +switch_status_t remove_event_streams(ei_event_stream_t **event_streams); +unsigned long get_stream_port(const ei_event_stream_t *event_stream); +switch_status_t add_event_binding(ei_event_stream_t *event_stream, const switch_event_types_t event_type, const char *subclass_name); +switch_status_t remove_event_binding(ei_event_stream_t *event_stream, const switch_event_types_t event_type, const char *subclass_name); +switch_status_t remove_event_bindings(ei_event_stream_t *event_stream); + +/* kazoo_fetch_agent.c */ +switch_status_t bind_fetch_agents(); +switch_status_t unbind_fetch_agents(); +switch_status_t remove_xml_clients(ei_node_t *ei_node); +switch_status_t add_fetch_handler(ei_node_t *ei_node, erlang_pid *from, switch_xml_binding_t *binding); +switch_status_t remove_fetch_handlers(ei_node_t *ei_node, erlang_pid *from); +switch_status_t fetch_reply(char *uuid_str, char *xml_str, switch_xml_binding_t *binding); +switch_status_t handle_api_command_streams(ei_node_t *ei_node, switch_stream_handle_t *stream); + +/* kazoo_utils.c */ +void close_socket(switch_socket_t **sock); +void close_socketfd(int *sockfd); +switch_socket_t *create_socket_with_port(switch_memory_pool_t *pool, switch_port_t port); +switch_socket_t *create_socket(switch_memory_pool_t *pool); +switch_status_t create_ei_cnode(const char *ip_addr, const char *name, struct ei_cnode_s *ei_cnode); +switch_status_t ei_compare_pids(const erlang_pid *pid1, const erlang_pid *pid2); +void ei_encode_switch_event_headers(ei_x_buff *ebuf, switch_event_t *event); +void ei_encode_switch_event_headers_2(ei_x_buff *ebuf, switch_event_t *event, int decode); +void ei_link(ei_node_t *ei_node, erlang_pid * from, erlang_pid * to); +void ei_encode_switch_event(ei_x_buff * ebuf, switch_event_t *event); +int ei_helper_send(ei_node_t *ei_node, erlang_pid* to, ei_x_buff *buf); +int ei_decode_atom_safe(char *buf, int *index, char *dst); +int ei_decode_string_or_binary_limited(char *buf, int *index, int maxsize, char *dst); +int ei_decode_string_or_binary(char *buf, int *index, char **dst); +switch_hash_t *create_default_filter(); /* kazoo_commands.c */ void add_kz_commands(switch_loadable_module_interface_t **module_interface, switch_api_interface_t *api_interface); @@ -34,23 +169,9 @@ void add_kz_commands(switch_loadable_module_interface_t **module_interface, swit /* kazoo_dptools.c */ void add_kz_dptools(switch_loadable_module_interface_t **module_interface, switch_application_interface_t *app_interface); -/* kazoo_api.c */ -void add_cli_api(switch_loadable_module_interface_t **module_interface, switch_api_interface_t *api_interface); -void remove_cli_api(); - -/* kazoo_utils.c */ -char *kazoo_expand_header(switch_memory_pool_t *pool, switch_event_t *event, char *val); -char* switch_event_get_first_of(switch_event_t *event, const char *list[]); -SWITCH_DECLARE(switch_status_t) switch_event_add_variable_name_printf(switch_event_t *event, switch_stack_t stack, const char *val, const char *fmt, ...); -void kz_xml_process(switch_xml_t cfg); - -/* kazoo_tweaks.c */ -void kz_tweaks_start(); -void kz_tweaks_stop(); - -SWITCH_MODULE_LOAD_FUNCTION(mod_kazoo_load); -SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_kazoo_shutdown); +#define _ei_x_encode_string(buf, string) { ei_x_encode_binary(buf, string, strlen(string)); } +void fetch_config_filters(); /* For Emacs: * Local Variables: From 3d9365edbb7bab59a6b047930329e33013d2eb5a Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Sun, 28 Jan 2018 10:18:58 -0500 Subject: [PATCH 025/264] FS-10496: [mod_v8] Fixing regression from FS-10496 when no settings exist in v8.conf. --- src/mod/languages/mod_v8/mod_v8.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/mod/languages/mod_v8/mod_v8.cpp b/src/mod/languages/mod_v8/mod_v8.cpp index 2a295283dd..636b93e5ac 100644 --- a/src/mod/languages/mod_v8/mod_v8.cpp +++ b/src/mod/languages/mod_v8/mod_v8.cpp @@ -358,12 +358,6 @@ static void load_configuration(void) } } -#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5 - if (zstr(globals.script_caching)) { - globals.script_caching = switch_core_strdup(globals.pool, "disabled"); - } -#endif - for (hook = switch_xml_child(settings, "hook"); hook; hook = hook->next) { char *event = (char *)switch_xml_attr_soft(hook, "event"); char *subclass = (char *)switch_xml_attr_soft(hook, "subclass"); @@ -533,7 +527,7 @@ void LoadScript(MaybeLocal *v8_script, Isolate *isolate, const char Do not cache if the caching is disabled Do not cache inline scripts */ - if (!strcasecmp(globals.script_caching, "disabled") || !strcasecmp(globals.script_caching, "false") || !strcasecmp(globals.script_caching, "no") || !strcasecmp(script_file, "inline") || zstr(script_file)) { + if (!switch_true(globals.script_caching) || !strcasecmp(script_file, "inline") || zstr(script_file)) { options = ScriptCompiler::kNoCompileOptions; perf_log("Javascript caching is disabled.\n", script_file); } else { @@ -1212,6 +1206,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_v8_load) globals.v8platform = NULL; globals.cache_expires_seconds = 0; globals.performance_monitor = false; + globals.script_caching = switch_core_strdup(globals.pool, "disabled"); + JSMain::Initialize(&globals.v8platform); switch_core_hash_init(&globals.compiled_script_hash); From 159c4ce95d1314bde9f747b0a0857c46fbf25a4f Mon Sep 17 00:00:00 2001 From: Stephane Alnet Date: Fri, 2 Feb 2018 10:19:03 +0100 Subject: [PATCH 026/264] FS-6816 [mod_sofia] Set empty callee id if `_undef_` In some scenarios (e.g. MetaSwitch interop) the `display` field of callee-id should be left empty instead of being overwritten with the number. As is done in other places, we allow for `_undef_` to mean "leave the field empty". --- src/mod/endpoints/mod_sofia/sofia.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index fc8a8acfa7..54f3e6802a 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1173,6 +1173,10 @@ void sofia_send_callee_id(switch_core_session_t *session, const char *name, cons if (zstr(number)) { name = number = "UNKNOWN"; } + + if (!zstr(name) && !strcmp(name,"_undef_")) { + name = ""; + } } else { if (zstr(name)) { name = caller_profile->callee_id_name; @@ -1189,6 +1193,10 @@ void sofia_send_callee_id(switch_core_session_t *session, const char *name, cons if (zstr(number)) { number = caller_profile->destination_number; } + + if (!zstr(name) && !strcmp(name,"_undef_")) { + name = ""; + } } if ((uuid = switch_channel_get_partner_uuid(channel)) && (session_b = switch_core_session_locate(uuid))) { From eded5965a4b26572aa254bab63771440934494bd Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sat, 3 Feb 2018 19:00:03 +0100 Subject: [PATCH 027/264] FS-10939 mod_cdr_mongodb: fix format truncation warnings with gcc 7 gcc 7 complains about possible format truncation: mod_cdr_mongodb.c: In function 'my_on_reporting': mod_cdr_mongodb.c:242:45: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 4 [-Werror=format-truncation=] snprintf(idx_buffer, sizeof(idx_buffer), "%d", callflow_idx); The char * idx_buffer has a size of 4 Bytes, and according to gcc's calculation it is possible that up to 11 Bytes might be copied into it via int bson_idx. This commit adds an extra 8 Bytes to char * idx_buffer, which silences the warnings. Signed-off-by: Sebastian Kemper --- src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c b/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c index cdd9d3390d..c253b48b63 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c +++ b/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c @@ -141,7 +141,7 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) bson cdr; int is_b; int bson_idx, callflow_idx; - char idx_buffer[4]; + char idx_buffer[12]; char *tmp; if (globals.shutdown) { From 1284fbb027ded086e73ee064c0f7f39c0186e18d Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 12 Jul 2017 19:01:06 +0300 Subject: [PATCH 028/264] FS-10493: [mod_callcenter] Replace core uuid with cc_instance_id taken from callcenter.conf.xml --- .../autoload_configs/callcenter.conf.xml | 1 + .../conf/autoload_configs/callcenter.conf.xml | 1 + .../mod_callcenter/mod_callcenter.c | 41 +++++++++++-------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/conf/vanilla/autoload_configs/callcenter.conf.xml b/conf/vanilla/autoload_configs/callcenter.conf.xml index 733f300c85..a0cd6f0d5d 100644 --- a/conf/vanilla/autoload_configs/callcenter.conf.xml +++ b/conf/vanilla/autoload_configs/callcenter.conf.xml @@ -2,6 +2,7 @@ + diff --git a/src/mod/applications/mod_callcenter/conf/autoload_configs/callcenter.conf.xml b/src/mod/applications/mod_callcenter/conf/autoload_configs/callcenter.conf.xml index 326a33fe9b..4596e3b9d6 100644 --- a/src/mod/applications/mod_callcenter/conf/autoload_configs/callcenter.conf.xml +++ b/src/mod/applications/mod_callcenter/conf/autoload_configs/callcenter.conf.xml @@ -3,6 +3,7 @@ +
diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index 0e677f5575..2ac47a11d2 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -425,7 +425,7 @@ static struct { int debug; char *odbc_dsn; char *dbname; - char *core_uuid; + char *cc_instance_id; switch_bool_t reserve_agents; switch_bool_t truncate_tiers; switch_bool_t truncate_agents; @@ -1473,7 +1473,6 @@ static switch_status_t load_config(void) } switch_mutex_lock(globals.mutex); - globals.core_uuid = switch_core_get_uuid(); globals.global_database_lock = SWITCH_TRUE; if ((settings = switch_xml_child(cfg, "settings"))) { for (param = switch_xml_child(settings, "param"); param; param = param->next) { @@ -1494,12 +1493,17 @@ static switch_status_t load_config(void) globals.truncate_agents = switch_true(val); } else if (!strcasecmp(var, "global-database-lock")) { globals.global_database_lock = switch_true(val); + } else if (!strcasecmp(var, "cc-instance-id")) { + globals.cc_instance_id = strdup(val); } } } - if (!globals.dbname) { + if (zstr(globals.dbname)) { globals.dbname = strdup(CC_SQLITE_DB_NAME); } + if (zstr(globals.cc_instance_id)) { + globals.cc_instance_id = strdup("single_box"); + } if (!globals.reserve_agents) { globals.reserve_agents = SWITCH_FALSE; } else { @@ -1532,7 +1536,7 @@ static switch_status_t load_config(void) "update tiers set state = 'Ready' where agent IN (select name from agents where system = 'single_box');" "update members set state = '%q', session_uuid = '' where system = '%q';" "update agents set external_calls_count = 0 where system = 'single_box';", - cc_member_state2str(CC_MEMBER_STATE_ABANDONED), globals.core_uuid); + cc_member_state2str(CC_MEMBER_STATE_ABANDONED), globals.cc_instance_id); cc_execute_sql(NULL, sql, NULL); switch_safe_free(sql); @@ -1638,7 +1642,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa bridged = 0; sql = switch_mprintf("UPDATE members SET state = '%q', session_uuid = '', abandoned_epoch = '%" SWITCH_TIME_T_FMT "' WHERE uuid = '%q' AND system = '%q' AND state != '%q'", - cc_member_state2str(CC_MEMBER_STATE_ABANDONED), local_epoch_time_now(NULL), h->member_uuid, globals.core_uuid, cc_member_state2str(CC_MEMBER_STATE_ABANDONED)); + cc_member_state2str(CC_MEMBER_STATE_ABANDONED), local_epoch_time_now(NULL), h->member_uuid, globals.cc_instance_id, cc_member_state2str(CC_MEMBER_STATE_ABANDONED)); cc_execute_sql(NULL, sql, NULL); switch_safe_free(sql); @@ -1841,7 +1845,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa sql = switch_mprintf("UPDATE members SET serving_agent = '%q', serving_system = 'single_box', state = '%q'" " WHERE state = '%q' AND uuid = '%q' AND system = '%q' AND serving_agent = '%q'", h->agent_name, cc_member_state2str(CC_MEMBER_STATE_TRYING), - cc_member_state2str(CC_MEMBER_STATE_TRYING), h->member_uuid, globals.core_uuid, h->queue_strategy); + cc_member_state2str(CC_MEMBER_STATE_TRYING), h->member_uuid, globals.cc_instance_id, h->queue_strategy); cc_execute_sql(NULL, sql, NULL); switch_safe_free(sql); @@ -1849,7 +1853,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa /* Check if we won the race to get the member to our selected agent (Used for Multi system purposes) */ sql = switch_mprintf("SELECT count(*) FROM members" " WHERE serving_agent = '%q' AND serving_system = 'single_box' AND uuid = '%q' AND system = '%q'", - h->agent_name, h->member_uuid, globals.core_uuid); + h->agent_name, h->member_uuid, globals.cc_instance_id); cc_execute_sql2str(NULL, NULL, sql, res, sizeof(res)); switch_safe_free(sql); @@ -1933,7 +1937,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa } else if (!bridged && !switch_channel_up(agent_channel)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session), SWITCH_LOG_DEBUG, "Failed to bridge, agent %s has no session\n", h->agent_name); /* Put back member on Waiting state, previous Trying */ - sql = switch_mprintf("UPDATE members SET state = 'Waiting' WHERE uuid = '%q' AND system = '%q'", h->member_uuid, globals.core_uuid); + sql = switch_mprintf("UPDATE members SET state = 'Waiting' WHERE uuid = '%q' AND system = '%q'", h->member_uuid, globals.cc_instance_id); cc_execute_sql(NULL, sql, NULL); switch_safe_free(sql); } else { @@ -2009,7 +2013,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa switch_safe_free(sql); /* Remove the member entry from the db (Could become optional to support latter processing) */ - sql = switch_mprintf("DELETE FROM members WHERE uuid = '%q' AND system = '%q'", h->member_uuid, globals.core_uuid); + sql = switch_mprintf("DELETE FROM members WHERE uuid = '%q' AND system = '%q'", h->member_uuid, globals.cc_instance_id); cc_execute_sql(NULL, sql, NULL); switch_safe_free(sql); @@ -2051,7 +2055,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa " WHERE serving_agent = '%q' AND serving_system = '%q' AND uuid = '%q' AND system = '%q'", cc_member_state2str(CC_MEMBER_STATE_TRYING), /* Only switch to Waiting from Trying (state may be set to Abandoned in callcenter_function()) */ cc_member_state2str(CC_MEMBER_STATE_WAITING), - h->agent_name, h->agent_system, h->member_uuid, globals.core_uuid); + h->agent_name, h->agent_system, h->member_uuid, globals.cc_instance_id); cc_execute_sql(NULL, sql, NULL); switch_safe_free(sql); bridged = 0; @@ -2288,7 +2292,7 @@ static int agents_callback(void *pArg, int argc, char **argv, char **columnNames if (!strcasecmp(cbt->strategy,"ring-all") || !strcasecmp(cbt->strategy,"ring-progressively")) { /* Check if member is a ring-all mode */ - sql = switch_mprintf("SELECT count(*) FROM members WHERE serving_agent = '%q' AND uuid = '%q' AND system = '%q'", cbt->strategy, cbt->member_uuid, globals.core_uuid); + sql = switch_mprintf("SELECT count(*) FROM members WHERE serving_agent = '%q' AND uuid = '%q' AND system = '%q'", cbt->strategy, cbt->member_uuid, globals.cc_instance_id); cc_execute_sql2str(NULL, NULL, sql, res, sizeof(res)); switch_safe_free(sql); @@ -2297,13 +2301,13 @@ static int agents_callback(void *pArg, int argc, char **argv, char **columnNames sql = switch_mprintf("UPDATE members SET serving_agent = '%q', serving_system = '%q', state = '%q'" " WHERE state = '%q' AND uuid = '%q' AND system = '%q'", agent_name, agent_system, cc_member_state2str(CC_MEMBER_STATE_TRYING), - cc_member_state2str(CC_MEMBER_STATE_WAITING), cbt->member_uuid, globals.core_uuid); + cc_member_state2str(CC_MEMBER_STATE_WAITING), cbt->member_uuid, globals.cc_instance_id); cc_execute_sql(NULL, sql, NULL); switch_safe_free(sql); /* Check if we won the race to get the member to our selected agent (Used for Multi system purposes) */ sql = switch_mprintf("SELECT count(*) FROM members WHERE serving_agent = '%q' AND serving_system = '%q' AND uuid = '%q' AND system = '%q'", - agent_name, agent_system, cbt->member_uuid, globals.core_uuid); + agent_name, agent_system, cbt->member_uuid, globals.cc_instance_id); cc_execute_sql2str(NULL, NULL, sql, res, sizeof(res)); switch_safe_free(sql); } @@ -2700,7 +2704,7 @@ void *SWITCH_THREAD_FUNC cc_agent_dispatch_thread_run(switch_thread_t *thread, v sql = switch_mprintf("SELECT queue,uuid,session_uuid,cid_number,cid_name,joined_epoch,(%" SWITCH_TIME_T_FMT "-joined_epoch)+base_score+skill_score AS score, state, abandoned_epoch, serving_agent, system FROM members" " WHERE (state = '%q' OR state = '%q' OR (serving_agent = 'ring-all' AND state = '%q') OR (serving_agent = 'ring-progressively' AND state = '%q')) AND system = '%q' ORDER BY score DESC", local_epoch_time_now(NULL), - cc_member_state2str(CC_MEMBER_STATE_WAITING), cc_member_state2str(CC_MEMBER_STATE_ABANDONED), cc_member_state2str(CC_MEMBER_STATE_TRYING), cc_member_state2str(CC_MEMBER_STATE_TRYING), globals.core_uuid); + cc_member_state2str(CC_MEMBER_STATE_WAITING), cc_member_state2str(CC_MEMBER_STATE_ABANDONED), cc_member_state2str(CC_MEMBER_STATE_TRYING), cc_member_state2str(CC_MEMBER_STATE_TRYING), globals.cc_instance_id); cc_execute_sql_callback(NULL /* queue */, NULL /* mutex */, sql, members_callback, NULL /* Call back variables */); switch_safe_free(sql); @@ -3005,7 +3009,7 @@ SWITCH_STANDARD_APP(callcenter_function) /* Update abandoned member */ sql = switch_mprintf("UPDATE members SET session_uuid = '%q', state = '%q', rejoined_epoch = '%" SWITCH_TIME_T_FMT "', system = '%q' WHERE uuid = '%q' AND state = '%q'", - member_session_uuid, cc_member_state2str(CC_MEMBER_STATE_WAITING), local_epoch_time_now(NULL), globals.core_uuid, member_uuid, cc_member_state2str(CC_MEMBER_STATE_ABANDONED)); + member_session_uuid, cc_member_state2str(CC_MEMBER_STATE_WAITING), local_epoch_time_now(NULL), globals.cc_instance_id, member_uuid, cc_member_state2str(CC_MEMBER_STATE_ABANDONED)); cc_execute_sql(queue, sql, NULL); switch_safe_free(sql); @@ -3053,7 +3057,7 @@ SWITCH_STANDARD_APP(callcenter_function) " (queue,system,uuid,session_uuid,system_epoch,joined_epoch,base_score,skill_score,cid_number,cid_name,serving_agent,serving_system,state)" " VALUES('%q','%q','%q','%q','%q','%" SWITCH_TIME_T_FMT "','%d','%d','%q','%q','%q','','%q')", queue_name, - globals.core_uuid, + globals.cc_instance_id, member_uuid, member_session_uuid, start_epoch, @@ -3174,7 +3178,7 @@ SWITCH_STANDARD_APP(callcenter_function) /* Update member state */ sql = switch_mprintf("UPDATE members SET state = '%q', session_uuid = '', abandoned_epoch = '%" SWITCH_TIME_T_FMT "' WHERE uuid = '%q' AND system = '%q'", - cc_member_state2str(CC_MEMBER_STATE_ABANDONED), local_epoch_time_now(NULL), member_uuid, globals.core_uuid); + cc_member_state2str(CC_MEMBER_STATE_ABANDONED), local_epoch_time_now(NULL), member_uuid, globals.cc_instance_id); cc_execute_sql(NULL, sql, NULL); switch_safe_free(sql); @@ -3216,7 +3220,7 @@ SWITCH_STANDARD_APP(callcenter_function) /* Update member state */ sql = switch_mprintf("UPDATE members SET state = '%q', bridge_epoch = '%" SWITCH_TIME_T_FMT "' WHERE uuid = '%q' AND system = '%q'", - cc_member_state2str(CC_MEMBER_STATE_ANSWERED), local_epoch_time_now(NULL), member_uuid, globals.core_uuid); + cc_member_state2str(CC_MEMBER_STATE_ANSWERED), local_epoch_time_now(NULL), member_uuid, globals.cc_instance_id); cc_execute_sql(NULL, sql, NULL); switch_safe_free(sql); @@ -4267,6 +4271,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_callcenter_shutdown) switch_safe_free(globals.odbc_dsn); switch_safe_free(globals.dbname); + switch_safe_free(globals.cc_instance_id); switch_mutex_unlock(globals.mutex); return SWITCH_STATUS_SUCCESS; From f37f41ccb2126ad9f32bb1214bf58aaef9518b00 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sat, 17 Feb 2018 15:34:33 +0300 Subject: [PATCH 029/264] FS-9753: [mod_sofia] Fix crash when accessing the WSS interface via regular HTTPS --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/tport/tport.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 5b7da58dcf..0b779c7ab1 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Mon Jun 26 14:53:11 CDT 2017 +Wed Feb 21 13:55:11 CDT 2018 diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport.c index 29e5cb0399..286de1a91e 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport.c @@ -1059,7 +1059,9 @@ int tport_register_secondary(tport_t *self, su_wakeup_f wakeup, int events) self->tp_index = i; self->tp_events = events; - tprb_append(&self->tp_pri->pri_open, self); + /* Can't be added to list of opened if already closed */ + if (!tport_is_closed(self)) + tprb_append(&self->tp_pri->pri_open, self); return 0; } @@ -2627,7 +2629,9 @@ int tport_accept(tport_primary_t *pri, int events) SU_CANONIZE_SOCKADDR(su); - if (/* Name this transport */ + if (/* Prevent being marked as connected if already closed */ + !tport_is_closed(self) && + /* Name this transport */ tport_setname(self, pri->pri_protoname, ai, NULL) != -1 /* Register this secondary */ && From ead0122a16dea5f7b47d0a1bfa5deab6e3f157dd Mon Sep 17 00:00:00 2001 From: s3rj1k Date: Thu, 22 Feb 2018 22:13:46 +0200 Subject: [PATCH 030/264] fix FS-9298 --- debian/freeswitch.dirs | 1 + debian/freeswitch.install | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 debian/freeswitch.dirs diff --git a/debian/freeswitch.dirs b/debian/freeswitch.dirs new file mode 100644 index 0000000000..f0e2fca44b --- /dev/null +++ b/debian/freeswitch.dirs @@ -0,0 +1 @@ +usr/share/freeswitch/fonts \ No newline at end of file diff --git a/debian/freeswitch.install b/debian/freeswitch.install index 415f082dd9..1e3d17622a 100644 --- a/debian/freeswitch.install +++ b/debian/freeswitch.install @@ -1 +1,3 @@ /usr/bin +fonts/FreeMono.ttf /usr/share/freeswitch/fonts/FreeMono.ttf +fonts/FreeSans.ttf /usr/share/freeswitch/fonts/FreeSans.ttf \ No newline at end of file From ab97ad0b5f3093e94377ae568aeeba0ccea5813d Mon Sep 17 00:00:00 2001 From: Bruno Dias Date: Wed, 7 Mar 2018 21:21:33 -0300 Subject: [PATCH 031/264] FS-10777 [mod_erlang_event] #resolve --- src/mod/event_handlers/mod_erlang_event/ei_helpers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mod/event_handlers/mod_erlang_event/ei_helpers.c b/src/mod/event_handlers/mod_erlang_event/ei_helpers.c index 7d23815585..cf3a6aca31 100644 --- a/src/mod/event_handlers/mod_erlang_event/ei_helpers.c +++ b/src/mod/event_handlers/mod_erlang_event/ei_helpers.c @@ -64,6 +64,7 @@ void ei_link(listener_t *listener, erlang_pid * from, erlang_pid * to) char msgbuf[2048]; char *s; int index = 0; + int status = SWITCH_STATUS_SUCCESS; switch_socket_t *sock = NULL; switch_os_sock_put(&sock, &listener->sockdes, listener->pool); @@ -81,7 +82,8 @@ void ei_link(listener_t *listener, erlang_pid * from, erlang_pid * to) /* sum: 542 */ switch_mutex_lock(listener->sock_mutex); - if (switch_socket_send(sock, msgbuf, (switch_size_t *) &index)) { + status = switch_socket_send(sock, msgbuf, (switch_size_t *) &index); + if (status != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to link to process on %s\n", listener->peer_nodename); } switch_mutex_unlock(listener->sock_mutex); From 930e7f3b0e6088c7dbf7a27dcb9d6381d87055b4 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 29 Mar 2018 11:17:44 -0400 Subject: [PATCH 032/264] FS-11061: [core] fix build with newer pcre --- src/switch_regex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_regex.c b/src/switch_regex.c index 911796a4b7..5a82e21752 100644 --- a/src/switch_regex.c +++ b/src/switch_regex.c @@ -37,7 +37,7 @@ SWITCH_DECLARE(switch_regex_t *) switch_regex_compile(const char *pattern, int options, const char **errorptr, int *erroroffset, const unsigned char *tables) { - return pcre_compile(pattern, options, errorptr, erroroffset, tables); + return (switch_regex_t *)pcre_compile(pattern, options, errorptr, erroroffset, tables); } From 74f47cb0eddf42bcf37c5b8fef225f95f51cabc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hunyadv=C3=A1ri=20P=C3=A9ter?= Date: Tue, 20 Mar 2018 12:46:54 +0100 Subject: [PATCH 033/264] FS-11046: [mod_dptools] Better logging for rename_function --- src/mod/applications/mod_dptools/mod_dptools.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 184b73e393..812e56a3f1 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -657,10 +657,15 @@ SWITCH_STANDARD_APP(rename_function) if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data)) && switch_split(lbuf, ' ', argv) == 2) { - switch_file_rename(argv[0], argv[1], switch_core_session_get_pool(session)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s RENAME: %s %s\n", switch_channel_get_name(switch_core_session_get_channel(session)), argv[0], argv[1]); + if (switch_file_rename(argv[0], argv[1], switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Can't rename %s to %s\n", + switch_channel_get_name(switch_core_session_get_channel(session)), argv[0], argv[1]); + } + } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", RENAME_SYNTAX); } From bec68edb16b795bed0dbdd95a09999eb4850d82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hunyadv=C3=A1ri=20P=C3=A9ter?= Date: Tue, 3 Apr 2018 10:42:04 +0200 Subject: [PATCH 034/264] FS-8893: [mod_sofia] Add variables to sofia::register/unregister events --- src/mod/endpoints/mod_sofia/sofia_reg.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 4dd30ddb67..847411ab5a 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -1571,6 +1571,7 @@ uint8_t sofia_reg_handle_register_token(nua_t *nua, sofia_profile_t *profile, nu switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "username", username); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "realm", realm); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "user-agent", agent); + switch (auth_res) { case AUTH_OK: switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "auth-result", "SUCCESS"); @@ -2022,6 +2023,9 @@ uint8_t sofia_reg_handle_register_token(nua_t *nua, sofia_profile_t *profile, nu if (update_registration) { switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "update-reg", "true"); } + if (v_event && *v_event) { + switch_event_merge(s_event, *v_event); + } switch_event_fire(&s_event); } @@ -2166,6 +2170,11 @@ uint8_t sofia_reg_handle_register_token(nua_t *nua, sofia_profile_t *profile, nu switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "network-port", network_port_c); switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "user-agent", agent); switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "expires", "%ld", (long) exptime); + + if (v_event && *v_event) { + switch_event_merge(s_event, *v_event); + } + } } } From 72c625dfb95a2778bd985396552d3f62b142c7c9 Mon Sep 17 00:00:00 2001 From: Alexey Sibyakin Date: Tue, 3 Apr 2018 22:09:37 +0900 Subject: [PATCH 035/264] FS-10119 [mod_h323] Patch from issue --- src/mod/endpoints/mod_h323/mod_h323.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_h323/mod_h323.cpp b/src/mod/endpoints/mod_h323/mod_h323.cpp index 8816252aea..3581f0e0b7 100644 --- a/src/mod/endpoints/mod_h323/mod_h323.cpp +++ b/src/mod/endpoints/mod_h323/mod_h323.cpp @@ -39,6 +39,8 @@ //#define DEBUG_RTP_PACKETS #include "mod_h323.h" +static struct mod_h323_globals mod_h323_globals = { 0 }; + SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, mod_h323_globals.codec_string); SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_context, mod_h323_globals.context); SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, mod_h323_globals.dialplan); @@ -47,7 +49,6 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_rtp_timer_name, mod_h323_globals.rt #define CF_NEED_FLUSH (1 << 1) -static struct mod_h323_globals mod_h323_globals = { 0 }; static switch_call_cause_t create_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event, switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session, From 18f11c7c6d2569ed23df118f14acab2be783601b Mon Sep 17 00:00:00 2001 From: Sergio Filipe Date: Wed, 4 Apr 2018 11:50:14 +0000 Subject: [PATCH 036/264] FS-11088: Fixing verto status api Checking if profile server_socket is valid to decide if is running or not --- src/mod/endpoints/mod_verto/mod_verto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 7a8b6e23b1..811ae0de87 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -5024,10 +5024,10 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t switch_mutex_lock(verto_globals.mutex); for(profile = verto_globals.profile_head; profile; profile = profile->next) { - for (i = 0; i < profile->i; i++) { + for (i = 0; i < profile->i; i++) { char *tmpurl = switch_mprintf(strchr(profile->ip[i].local_ip, ':') ? "%s:[%s]:%d" : "%s:%s:%d", (profile->ip[i].secure == 1) ? "wss" : "ws", profile->ip[i].local_ip, profile->ip[i].local_port); - stream->write_function(stream, "%25s\t%s\t %40s\t%s\n", profile->name, "profile", tmpurl, (profile->running) ? "RUNNING" : "DOWN"); + stream->write_function(stream, "%25s\t%s\t %40s\t%s\n", profile->name, "profile", tmpurl, (profile->server_socket[i] != ws_sock_invalid) ? "RUNNING" : "DOWN"); switch_safe_free(tmpurl); } cp++; From c4772b5bf03153ad59bbb6cd02cb49cfd4933bd3 Mon Sep 17 00:00:00 2001 From: lazedo Date: Mon, 9 Apr 2018 01:10:40 +0100 Subject: [PATCH 037/264] FS-11099 [mod_conference] provide profile name when requesting for caller-controls --- src/mod/applications/mod_conference/conference_member.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index b9dc9888cd..c29aa41098 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -73,6 +73,7 @@ void conference_member_bind_controls(conference_member_t *member, const char *co switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Conf-Name", member->conference->name); + switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Conf-Profile", member->conference->profile_name); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Action", "request-controls"); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "Controls", controls); From 320f7d6b8cf469e44fcb5f3ad85ed085eab1b09a Mon Sep 17 00:00:00 2001 From: lazedo Date: Mon, 9 Apr 2018 01:13:58 +0100 Subject: [PATCH 038/264] FS-11100 [mod_conference] export variables for conference_outcall_bg --- src/mod/applications/mod_conference/conference_loop.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_conference/conference_loop.c b/src/mod/applications/mod_conference/conference_loop.c index 6f162d247f..301f09d090 100644 --- a/src/mod/applications/mod_conference/conference_loop.c +++ b/src/mod/applications/mod_conference/conference_loop.c @@ -1332,6 +1332,10 @@ void conference_loop_output(conference_member_t *member) int to = 60; int wait_sec = 2; int loops = 0; + switch_event_t *var_event; + + switch_event_create(&var_event, SWITCH_EVENT_CHANNEL_DATA); + switch_channel_process_export(channel, NULL, var_event, "conference_auto_outcall_export_vars"); if (ann && !switch_channel_test_app_flag_key("conference_silent", channel, CONF_SILENT_REQ)) { member->conference->special_announce = switch_core_strdup(member->conference->pool, ann); @@ -1363,9 +1367,11 @@ void conference_loop_output(conference_member_t *member) } for (x = 0; x < argc; x++) { char *dial_str = switch_mprintf("%s%s", switch_str_nil(prefix), argv[x]); + switch_event_t *event = NULL; + switch_event_dup(&event, var_event); switch_assert(dial_str); conference_outcall_bg(member->conference, NULL, NULL, dial_str, to, switch_str_nil(flags), cid_name, cid_num, NULL, - profile, &member->conference->cancel_cause, NULL); + profile, &member->conference->cancel_cause, &event); switch_safe_free(dial_str); } switch_safe_free(cpstr); From b43442a2f27d04c729a9c1d4a3d45fab447c27f2 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Tue, 10 Apr 2018 18:19:06 -0500 Subject: [PATCH 039/264] FS-11104: [Build] check for libldns-fs.pc first when detecting libldns to allow for custom package --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index f65b59997d..b8df6d1759 100644 --- a/configure.ac +++ b/configure.ac @@ -1320,6 +1320,8 @@ PKG_CHECK_MODULES([YAML], [yaml-0.1 >= 0.1.4],[ PKG_CHECK_MODULES([PORTAUDIO], [portaudio-2.0 >= 19],[ AM_CONDITIONAL([HAVE_PORTAUDIO],[true])],[ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PORTAUDIO],[false])]) +PKG_CHECK_MODULES([LDNS], [libldns-fs >= 1.6.6],[ + AM_CONDITIONAL([HAVE_LDNS],[true])],[ PKG_CHECK_MODULES([LDNS], [libldns >= 1.6.6],[ AM_CONDITIONAL([HAVE_LDNS],[true])],[ AC_CHECK_LIB([ldns], [ldns_str2rdf_a], [LDNS_LIBS=-lldns]) @@ -1329,7 +1331,7 @@ PKG_CHECK_MODULES([LDNS], [libldns >= 1.6.6],[ else AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_LDNS],[false]) fi],[ - AM_CONDITIONAL([HAVE_LDNS],[true])])]) + AM_CONDITIONAL([HAVE_LDNS],[true])])])]) PKG_CHECK_MODULES([SNDFILE], [sndfile >= 1.0.20],[ AM_CONDITIONAL([HAVE_SNDFILE],[true])],[ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SNDFILE],[false])]) From 6d1eabc7a12fd85636607ce53865c776f8cfc19d Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Thu, 12 Apr 2018 19:14:17 -0400 Subject: [PATCH 040/264] FS-11108: [mod_commands] Fix segfault with list_users command --- src/mod/applications/mod_commands/mod_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 064978ad8c..1ea0b59a21 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -414,7 +414,7 @@ void output_flattened_dial_string(char *data, switch_stream_handle_t *stream) SWITCH_STANDARD_API(list_users_function) { int argc; - char *pdata, *argv[9]; + char *pdata = NULL, *argv[9]; int32_t arg = 0; switch_xml_t xml_root, x_domains, x_domain_tag; switch_xml_t gts, gt, uts, ut; @@ -422,7 +422,7 @@ SWITCH_STANDARD_API(list_users_function) char *tag_name = NULL, *key_name = NULL, *key_value = NULL; char *_domain = NULL; - if ((pdata = strdup(cmd))) { + if (!zstr(cmd) && (pdata = strdup(cmd))) { argc = switch_separate_string(pdata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); if (argc >= 9) { From a0ae014dc130c97bac7d057ceabe84bcfb03fe7b Mon Sep 17 00:00:00 2001 From: antonio Date: Fri, 13 Apr 2018 18:41:37 +0200 Subject: [PATCH 041/264] FS-10775 #resolve segfault switch_frame_buffer_push --- src/switch_core_media.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 62d90e490f..64f203f52a 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -1756,6 +1756,8 @@ SWITCH_DECLARE(void) switch_media_handle_destroy(switch_core_session_t *session) switch_core_session_unset_write_codec(session); switch_core_media_deactivate_rtp(session); + if (a_engine->write_fb) switch_frame_buffer_destroy(&a_engine->write_fb); + if (smh->msrp_session) switch_msrp_session_destroy(&smh->msrp_session); } @@ -6760,7 +6762,6 @@ static void *SWITCH_THREAD_FUNC audio_write_thread(switch_thread_t *thread, void mh->up = 0; switch_mutex_unlock(smh->control_mutex); - switch_frame_buffer_destroy(&a_engine->write_fb); switch_core_timer_destroy(&timer); switch_core_session_rwunlock(session); From 80cd1fa42205c71cbdc1f31811a3e9cba595db8f Mon Sep 17 00:00:00 2001 From: Piotr Gregor Date: Wed, 18 Apr 2018 17:45:44 +0100 Subject: [PATCH 042/264] FS-11120 Handle invalid configs for avmd This makes sure avmd session uses default values for global settings if configuration parameters are invalid or missing. Also add more printing for avmd. Avmd will now report media bug direction READ_REPLACE/WRITE_REPLACE it has been started on, and each frame it is processing if debug==1. This also fixes confusing log on session stopped reported in FS-10732. --- src/mod/applications/mod_avmd/mod_avmd.c | 354 ++++++++++++------ .../mod_avmd/scripts/avmd_test.pl | 0 2 files changed, 237 insertions(+), 117 deletions(-) mode change 100644 => 100755 src/mod/applications/mod_avmd/scripts/avmd_test.pl diff --git a/src/mod/applications/mod_avmd/mod_avmd.c b/src/mod/applications/mod_avmd/mod_avmd.c index a4960d914a..828cf1fced 100644 --- a/src/mod/applications/mod_avmd/mod_avmd.c +++ b/src/mod/applications/mod_avmd/mod_avmd.c @@ -112,6 +112,10 @@ #define AVMD_PARAMS_APP_START_MIN 0u #define AVMD_PARAMS_APP_START_MAX 20u +#define AVMD_READ_REPLACE 0 +#define AVMD_WRITE_REPLACE 1 + + /* don't forget to update avmd_events_str table if you modify this */ enum avmd_event { @@ -243,7 +247,7 @@ static struct avmd_globals size_t session_n; } avmd_globals; -static void avmd_process(avmd_session_t *session, switch_frame_t *frame); +static void avmd_process(avmd_session_t *session, switch_frame_t *frame, uint8_t direction); static switch_bool_t avmd_callback(switch_media_bug_t * bug, void *user_data, switch_abc_type_t type); static switch_status_t avmd_register_all_events(void); @@ -282,41 +286,53 @@ static uint8_t avmd_detection_in_progress(avmd_session_t *s); static switch_status_t avmd_launch_threads(avmd_session_t *s) { - uint8_t idx; - struct avmd_detector *d; - switch_threadattr_t *thd_attr = NULL; + uint8_t idx; + struct avmd_detector *d; + switch_threadattr_t *thd_attr = NULL; - idx = 0; - while (idx < s->settings.detectors_n) { - d = &s->detectors[idx]; - d->flag_processing_done = 1; - d->flag_should_exit = 0; - d->result = AVMD_DETECT_NONE; - d->lagged = 0; - d->lag = 0; - switch_threadattr_create(&thd_attr, avmd_globals.pool); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - if (switch_thread_create(&d->thread, thd_attr, avmd_detector_func, d, switch_core_session_get_pool(s->session)) != SWITCH_STATUS_SUCCESS) { - return SWITCH_STATUS_FALSE; - } - ++idx; - } - idx = 0; - while (idx < s->settings.detectors_lagged_n) { - d = &s->detectors[s->settings.detectors_n + idx]; - d->flag_processing_done = 1; - d->flag_should_exit = 0; - d->result = AVMD_DETECT_NONE; - d->lagged = 1; - d->lag = idx + 1; - switch_threadattr_create(&thd_attr, avmd_globals.pool); - switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - if (switch_thread_create(&d->thread, thd_attr, avmd_detector_func, d, switch_core_session_get_pool(s->session)) != SWITCH_STATUS_SUCCESS) { - return SWITCH_STATUS_FALSE; - } - ++idx; - } - return SWITCH_STATUS_SUCCESS; + idx = 0; + while (idx < s->settings.detectors_n) { + d = &s->detectors[idx]; + d->flag_processing_done = 1; + d->flag_should_exit = 0; + d->result = AVMD_DETECT_NONE; + d->lagged = 0; + d->lag = 0; + switch_threadattr_create(&thd_attr, avmd_globals.pool); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + if (switch_thread_create(&d->thread, thd_attr, avmd_detector_func, d, switch_core_session_get_pool(s->session)) != SWITCH_STATUS_SUCCESS) { + return SWITCH_STATUS_FALSE; + } + + if (s->settings.debug) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "AVMD: started thread idx=%u\n", idx); + } + + ++idx; + } + + idx = 0; + while (idx < s->settings.detectors_lagged_n) { + d = &s->detectors[s->settings.detectors_n + idx]; + d->flag_processing_done = 1; + d->flag_should_exit = 0; + d->result = AVMD_DETECT_NONE; + d->lagged = 1; + d->lag = idx + 1; + switch_threadattr_create(&thd_attr, avmd_globals.pool); + switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); + if (switch_thread_create(&d->thread, thd_attr, avmd_detector_func, d, switch_core_session_get_pool(s->session)) != SWITCH_STATUS_SUCCESS) { + return SWITCH_STATUS_FALSE; + } + + if (s->settings.debug) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "AVMD: started lagged thread idx=%u\n", s->settings.detectors_n + idx); + } + + ++idx; + } + + return SWITCH_STATUS_SUCCESS; } static void avmd_join_threads(avmd_session_t *s) { @@ -618,12 +634,12 @@ static switch_bool_t avmd_callback(switch_media_bug_t * bug, void *user_data, sw case SWITCH_ABC_TYPE_READ_REPLACE: frame = switch_core_media_bug_get_read_replace_frame(bug); - avmd_process(avmd_session, frame); + avmd_process(avmd_session, frame, AVMD_READ_REPLACE); break; case SWITCH_ABC_TYPE_WRITE_REPLACE: frame = switch_core_media_bug_get_write_replace_frame(bug); - avmd_process(avmd_session, frame); + avmd_process(avmd_session, frame, AVMD_WRITE_REPLACE); break; case SWITCH_ABC_TYPE_CLOSE: @@ -761,7 +777,6 @@ static void avmd_fire_event(enum avmd_event type, switch_core_session_t *fs_s, d case AVMD_EVENT_SESSION_STOP: switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Beep-Status", beep_status == BEEP_DETECTED ? "DETECTED" : "NOTDETECTED"); if (info == 0) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(fs_s), SWITCH_LOG_ERROR, "Error, avmd session object not found in media bug!\n"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Stop-status", "ERROR (AVMD SESSION OBJECT NOT FOUND IN MEDIA BUG)"); } total_time = stop_time - start_time; @@ -821,10 +836,10 @@ static void avmd_set_xml_default_configuration(switch_mutex_t *mutex) { avmd_globals.settings.report_status = 1; avmd_globals.settings.fast_math = 0; avmd_globals.settings.require_continuous_streak = 1; - avmd_globals.settings.sample_n_continuous_streak = 5; + avmd_globals.settings.sample_n_continuous_streak = 3; avmd_globals.settings.sample_n_to_skip = 0; avmd_globals.settings.require_continuous_streak_amp = 1; - avmd_globals.settings.sample_n_continuous_streak_amp = 5; + avmd_globals.settings.sample_n_continuous_streak_amp = 3; avmd_globals.settings.simplified_estimation = 1; avmd_globals.settings.inbound_channnel = 0; avmd_globals.settings.outbound_channnel = 1; @@ -868,90 +883,180 @@ static void avmd_set_xml_outbound_configuration(switch_mutex_t *mutex) { } static switch_status_t avmd_load_xml_configuration(switch_mutex_t *mutex) { - switch_xml_t xml = NULL, x_lists = NULL, x_list = NULL, cfg = NULL; - switch_status_t status = SWITCH_STATUS_FALSE; + switch_xml_t xml = NULL, x_lists = NULL, x_list = NULL, cfg = NULL; + uint8_t bad_debug = 1, bad_report = 1, bad_fast = 1, bad_req_cont = 1, bad_sample_n_cont = 1, + bad_sample_n_to_skip = 1, bad_req_cont_amp = 1, bad_sample_n_cont_amp = 1, bad_simpl = 1, + bad_inbound = 1, bad_outbound = 1, bad_mode = 1, bad_detectors = 1, bad_lagged = 1, bad = 0; - if (mutex != NULL) { - switch_mutex_lock(mutex); - } + if (mutex != NULL) { + switch_mutex_lock(mutex); + } - if ((xml = switch_xml_open_cfg("avmd.conf", &cfg, NULL)) == NULL) { - status = SWITCH_STATUS_TERM; - } else { - status = SWITCH_STATUS_SUCCESS; + if ((xml = switch_xml_open_cfg("avmd.conf", &cfg, NULL)) != NULL) { - if ((x_lists = switch_xml_child(cfg, "settings"))) { - for (x_list = switch_xml_child(x_lists, "param"); x_list; x_list = x_list->next) { - const char *name = switch_xml_attr(x_list, "name"); - const char *value = switch_xml_attr(x_list, "value"); + if ((x_lists = switch_xml_child(cfg, "settings"))) { + for (x_list = switch_xml_child(x_lists, "param"); x_list; x_list = x_list->next) { + const char *name = switch_xml_attr(x_list, "name"); + const char *value = switch_xml_attr(x_list, "value"); - if (zstr(name)) { - continue; - } - if (zstr(value)) { - continue; - } + if (zstr(name)) { + continue; + } + if (zstr(value)) { + continue; + } - if (!strcmp(name, "debug")) { - avmd_globals.settings.debug = switch_true(value) ? 1 : 0; - } else if (!strcmp(name, "report_status")) { - avmd_globals.settings.report_status = switch_true(value) ? 1 : 0; - } else if (!strcmp(name, "fast_math")) { - avmd_globals.settings.fast_math = switch_true(value) ? 1 : 0; - } else if (!strcmp(name, "require_continuous_streak")) { - avmd_globals.settings.require_continuous_streak = switch_true(value) ? 1 : 0; - } else if (!strcmp(name, "sample_n_continuous_streak")) { - if(avmd_parse_u16_user_input(value, &avmd_globals.settings.sample_n_continuous_streak, 0, UINT16_MAX) == -1) { - status = SWITCH_STATUS_TERM; - goto done; - } - } else if (!strcmp(name, "sample_n_to_skip")) { - if(avmd_parse_u16_user_input(value, &avmd_globals.settings.sample_n_to_skip, 0, UINT16_MAX) == -1) { - status = SWITCH_STATUS_TERM; - goto done; - } - } else if (!strcmp(name, "require_continuous_streak_amp")) { - avmd_globals.settings.require_continuous_streak_amp = switch_true(value) ? 1 : 0; - } else if (!strcmp(name, "sample_n_continuous_streak_amp")) { - if(avmd_parse_u16_user_input(value, &avmd_globals.settings.sample_n_continuous_streak_amp, 0, UINT16_MAX) == -1) { - status = SWITCH_STATUS_TERM; - goto done; - } - } else if (!strcmp(name, "simplified_estimation")) { - avmd_globals.settings.simplified_estimation = switch_true(value) ? 1 : 0; - } else if (!strcmp(name, "inbound_channel")) { - avmd_globals.settings.inbound_channnel = switch_true(value) ? 1 : 0; - } else if (!strcmp(name, "outbound_channel")) { - avmd_globals.settings.outbound_channnel = switch_true(value) ? 1 : 0; - } else if (!strcmp(name, "detection_mode")) { - if(avmd_parse_u8_user_input(value, (uint8_t*)&avmd_globals.settings.mode, 0, 2) == -1) { - status = SWITCH_STATUS_TERM; - goto done; - } - } else if (!strcmp(name, "detectors_n")) { - if(avmd_parse_u8_user_input(value, &avmd_globals.settings.detectors_n, 0, UINT8_MAX) == -1) { - status = SWITCH_STATUS_TERM; - goto done; - } - } else if (!strcmp(name, "detectors_lagged_n")) { - if(avmd_parse_u8_user_input(value, &avmd_globals.settings.detectors_lagged_n, 0, UINT8_MAX) == -1) { - status = SWITCH_STATUS_TERM; - goto done; - } - } - } - } + if (!strcmp(name, "debug")) { + avmd_globals.settings.debug = switch_true(value) ? 1 : 0; + bad_debug = 0; + } else if (!strcmp(name, "report_status")) { + avmd_globals.settings.report_status = switch_true(value) ? 1 : 0; + bad_report = 0; + } else if (!strcmp(name, "fast_math")) { + avmd_globals.settings.fast_math = switch_true(value) ? 1 : 0; + bad_fast = 0; + } else if (!strcmp(name, "require_continuous_streak")) { + avmd_globals.settings.require_continuous_streak = switch_true(value) ? 1 : 0; + bad_req_cont = 0; + } else if (!strcmp(name, "sample_n_continuous_streak")) { + if(!avmd_parse_u16_user_input(value, &avmd_globals.settings.sample_n_continuous_streak, 0, UINT16_MAX)) { + bad_sample_n_cont = 0; + } + } else if (!strcmp(name, "sample_n_to_skip")) { + if(!avmd_parse_u16_user_input(value, &avmd_globals.settings.sample_n_to_skip, 0, UINT16_MAX)) { + bad_sample_n_to_skip = 0; + } + } else if (!strcmp(name, "require_continuous_streak_amp")) { + avmd_globals.settings.require_continuous_streak_amp = switch_true(value) ? 1 : 0; + bad_req_cont_amp = 0; + } else if (!strcmp(name, "sample_n_continuous_streak_amp")) { + if(!avmd_parse_u16_user_input(value, &avmd_globals.settings.sample_n_continuous_streak_amp, 0, UINT16_MAX)) { + bad_sample_n_cont_amp = 0; + } + } else if (!strcmp(name, "simplified_estimation")) { + avmd_globals.settings.simplified_estimation = switch_true(value) ? 1 : 0; + bad_simpl = 0; + } else if (!strcmp(name, "inbound_channel")) { + avmd_globals.settings.inbound_channnel = switch_true(value) ? 1 : 0; + bad_inbound = 0; + } else if (!strcmp(name, "outbound_channel")) { + avmd_globals.settings.outbound_channnel = switch_true(value) ? 1 : 0; + bad_outbound = 0; + } else if (!strcmp(name, "detection_mode")) { + if(!avmd_parse_u8_user_input(value, (uint8_t*)&avmd_globals.settings.mode, 0, 2)) { + bad_mode = 0; + } + } else if (!strcmp(name, "detectors_n")) { + if(!avmd_parse_u8_user_input(value, &avmd_globals.settings.detectors_n, 0, UINT8_MAX)) { + bad_detectors = 0; + } + } else if (!strcmp(name, "detectors_lagged_n")) { + if(!avmd_parse_u8_user_input(value, &avmd_globals.settings.detectors_lagged_n, 0, UINT8_MAX)) { + bad_lagged = 0; + } + } + } // for + } // if list -done: + switch_xml_free(xml); + } // if open OK - switch_xml_free(xml); - } + if (bad_debug) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'debug' missing or invalid - using default\n"); + avmd_globals.settings.debug = 0; + } - if (mutex != NULL) { - switch_mutex_unlock(mutex); - } + if (bad_report) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'report_status' missing or invalid - using default\n"); + avmd_globals.settings.report_status = 1; + } - return status; + if (bad_fast) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'fast_math' missing or invalid - using default\n"); + avmd_globals.settings.fast_math = 0; + } + + if (bad_req_cont) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'require_continuous_streak' missing or invalid - using default\n"); + avmd_globals.settings.require_continuous_streak = 1; + } + + if (bad_sample_n_cont) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'sample_n_continuous_streak' missing or invalid - using default\n"); + avmd_globals.settings.sample_n_continuous_streak = 3; + } + + if (bad_sample_n_to_skip) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'sample_n_to_skip' missing or invalid - using default\n"); + avmd_globals.settings.sample_n_to_skip = 0; + } + + if (bad_req_cont_amp) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'require_continuous_streak_amp' missing or invalid - using default\n"); + avmd_globals.settings.require_continuous_streak_amp = 1; + } + + if (bad_sample_n_cont_amp) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'sample_n_continuous_streak_amp' missing or invalid - using default\n"); + avmd_globals.settings.sample_n_continuous_streak_amp = 3; + } + + if (bad_simpl) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'simplified_estimation' missing or invalid - using default\n"); + avmd_globals.settings.simplified_estimation = 1; + } + + if (bad_inbound) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'inbound_channel' missing or invalid - using default\n"); + avmd_globals.settings.inbound_channnel = 0; + } + + if (bad_outbound) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'outbound_channel' missing or invalid - using default\n"); + avmd_globals.settings.outbound_channnel = 1; + } + + if (bad_mode) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'detection_mode' missing or invalid - using default\n"); + avmd_globals.settings.mode = AVMD_DETECT_BOTH; + } + + if (bad_detectors) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'detectors_n' missing or invalid - using default\n"); + avmd_globals.settings.detectors_n = 36; + } + + if (bad_lagged) { + bad = 1; + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AVMD config parameter 'detectors_lagged_n' missing or invalid - using default\n"); + avmd_globals.settings.detectors_lagged_n = 1; + } + + /** + * Hint. + */ + if (bad) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Type 'avmd show' to display default settings. Type 'avmd ' + TAB for autocompletion.\n"); + } + + if (mutex != NULL) { + switch_mutex_unlock(mutex); + } + + return SWITCH_STATUS_SUCCESS; } static switch_status_t avmd_load_xml_inbound_configuration(switch_mutex_t *mutex) { @@ -1297,6 +1402,7 @@ SWITCH_STANDARD_APP(avmd_start_app) { switch_channel_t *channel = NULL; avmd_session_t *avmd_session = NULL; switch_core_media_flag_t flags = 0; + const char *direction = "NO DIRECTION"; if (session == NULL) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "BUGGG. FreeSWITCH session is NULL! Please report to developers\n"); @@ -1366,15 +1472,23 @@ SWITCH_STANDARD_APP(avmd_start_app) { } if ((SWITCH_CALL_DIRECTION_OUTBOUND == switch_channel_direction(channel)) && (avmd_session->settings.outbound_channnel == 1)) { flags |= SMBF_READ_REPLACE; + direction = "READ_REPLACE"; } if ((SWITCH_CALL_DIRECTION_INBOUND == switch_channel_direction(channel)) && (avmd_session->settings.inbound_channnel == 1)) { flags |= SMBF_WRITE_REPLACE; + if (!strcmp(direction, "READ_REPLACE")) { + direction = "READ_REPLACE | WRITE_REPLACE"; + } else { + direction = "WRITE_REPLACE"; + } } + if (flags == 0) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Can't set direction for channel [%s]\n", switch_channel_get_name(channel)); status = SWITCH_STATUS_FALSE; goto end_unlock; } + if ((SWITCH_CALL_DIRECTION_OUTBOUND == switch_channel_direction(channel)) && (avmd_session->settings.outbound_channnel == 1)) { if (switch_channel_test_flag(channel, CF_MEDIA_SET) == 0) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Channel [%s] has no codec assigned yet. Please try again\n", switch_channel_get_name(channel)); @@ -1404,7 +1518,7 @@ SWITCH_STANDARD_APP(avmd_start_app) { switch_channel_set_private(channel, "_avmd_", bug); /* Set the avmd tag to detect an existing avmd media bug */ avmd_fire_event(AVMD_EVENT_SESSION_START, session, 0, 0, 0, 0, 0, 0, 0, 0, avmd_session->start_time, 0, 0, 0, 0); if (avmd_session->settings.report_status == 1) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Avmd on channel [%s] started!\n", switch_channel_get_name(channel)); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Avmd on channel [%s] started! direction=%s\n", switch_channel_get_name(channel), direction); } end_unlock: @@ -1927,11 +2041,12 @@ avmd_detection_result(avmd_session_t *s) { * @param session An avmd session. * @param frame An audio frame. */ -static void avmd_process(avmd_session_t *s, switch_frame_t *frame) { +static void avmd_process(avmd_session_t *s, switch_frame_t *frame, uint8_t direction) { circ_buffer_t *b; uint8_t idx; struct avmd_detector *d; + b = &s->b; switch_mutex_lock(s->mutex_detectors_done); @@ -1948,6 +2063,11 @@ static void avmd_process(avmd_session_t *s, switch_frame_t *frame) { s->frame_n_to_skip--; return; } + + if (s->settings.debug) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(s->session), SWITCH_LOG_INFO, "AVMD: processing frame [%zu], direction=%s\n", s->frame_n, direction == AVMD_READ_REPLACE ? "READ" : "WRITE"); + } + if (s->detection_start_time == 0) { s->detection_start_time = switch_micro_time_now(); /* start detection timer */ } diff --git a/src/mod/applications/mod_avmd/scripts/avmd_test.pl b/src/mod/applications/mod_avmd/scripts/avmd_test.pl old mode 100644 new mode 100755 From ba7b003bc276e64ec197e992e74a13fedc8fadc5 Mon Sep 17 00:00:00 2001 From: Italo Rossi Date: Sat, 21 Apr 2018 18:11:12 -0300 Subject: [PATCH 043/264] FS-11044 - [verto_communicator] Fix error when muting/unmuting without cam and/or mic. --- html5/verto/js/src/jquery.FSRTC.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js index ed8a5500d8..f07188bedb 100644 --- a/html5/verto/js/src/jquery.FSRTC.js +++ b/html5/verto/js/src/jquery.FSRTC.js @@ -341,6 +341,9 @@ $.FSRTC.prototype.setMute = function(what) { var self = this; + if (!self.localStream) { + return false; + } var audioTracks = self.localStream.getAudioTracks(); for (var i = 0, len = audioTracks.length; i < len; i++ ) { @@ -370,6 +373,9 @@ $.FSRTC.prototype.setVideoMute = function(what) { var self = this; + if (!self.localStream) { + return false; + } var videoTracks = self.localStream.getVideoTracks(); for (var i = 0, len = videoTracks.length; i < len; i++ ) { From 8f10ae54a18a19fc6ed938e4f662bd218ba54b5e Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 26 Apr 2018 09:09:41 -0500 Subject: [PATCH 044/264] FS-11139: [mod_commands] add tab completion for uuid_pause command --- src/mod/applications/mod_commands/mod_commands.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 1ea0b59a21..1f00ed7195 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -7606,6 +7606,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load) switch_console_set_complete("add uuid_audio ::console::list_uuid stop"); switch_console_set_complete("add uuid_break ::console::list_uuid all"); switch_console_set_complete("add uuid_break ::console::list_uuid both"); + switch_console_set_complete("add uuid_pause ::console::list_uuid on"); + switch_console_set_complete("add uuid_pause ::console::list_uuid off"); switch_console_set_complete("add uuid_bridge ::console::list_uuid ::console::list_uuid"); switch_console_set_complete("add uuid_broadcast ::console::list_uuid"); switch_console_set_complete("add uuid_buglist ::console::list_uuid"); From bdfc02f22793ee3fb2d02edaa970c34807fc1c3b Mon Sep 17 00:00:00 2001 From: Bob McCarthy Date: Wed, 2 May 2018 14:06:01 -0600 Subject: [PATCH 045/264] FS-10808 [mod_sofia] Fix memory leak in SLA --- src/mod/endpoints/mod_sofia/sofia_presence.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index bba5d38f3f..ef3a4cfaad 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -3634,6 +3634,8 @@ static int sync_sla(sofia_profile_t *profile, const char *to_user, const char *t sofia_glue_execute_sql_callback(profile, profile->dbh_mutex, sql, broadsoft_sla_notify_callback, sh); switch_safe_free(sql); total = sh->total; + switch_core_hash_destroy(&sh->hash); + sh = NULL; switch_core_destroy_memory_pool(&pool); From 3c7db639fd8def3c735fa9e8a8353b49189d1080 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Wed, 16 May 2018 17:12:08 -0400 Subject: [PATCH 046/264] FS-11168: [core] fix compile error on gentoo from typo in assert statement --- src/switch_core_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_video.c b/src/switch_core_video.c index 100ed0f4ba..ca9ff3863d 100644 --- a/src/switch_core_video.c +++ b/src/switch_core_video.c @@ -218,7 +218,7 @@ SWITCH_DECLARE(switch_image_t *)switch_img_alloc(switch_image_t *img, r = (switch_image_t *)vpx_img_alloc((vpx_image_t *)img, (vpx_img_fmt_t)fmt, d_w, d_h, align); switch_assert(r); switch_assert(r->d_w == d_w); - switch_assert(r->d_h = d_h); + switch_assert(r->d_h == d_h); return r; #else From 9fc898daac765f0d3e0ed79bf8b404bd78029558 Mon Sep 17 00:00:00 2001 From: Muteesa Fred Date: Thu, 14 Jun 2018 19:38:05 +0000 Subject: [PATCH 047/264] FI-393 [fs_cli banner] this commit changes the text on the fs_cli banner --- cluecon.tmpl | 38 +++++++++++++++--------------------- cluecon2.tmpl | 41 +++++++++++++++------------------------ libs/esl/src/include/cc.h | 2 +- src/include/cc.h | 2 +- 4 files changed, 34 insertions(+), 49 deletions(-) diff --git a/cluecon.tmpl b/cluecon.tmpl index f6624beb24..28c4d51d56 100644 --- a/cluecon.tmpl +++ b/cluecon.tmpl @@ -1,26 +1,20 @@ .=======================================================================================================. -| ____ _ ____ | -| / ___| |_ _ ___ / ___|___ _ __ | -| | | | | | | |/ _ \ | / _ \| '_ \ | -| | |___| | |_| | __/ |__| (_) | | | | | -| \____|_|\__,_|\___|\____\___/|_| |_| | +| _ _ ____ _ ____ | +| / \ _ __ _ __ _ _ __ _| | / ___| |_ _ ___ / ___|___ _ __ | +| / _ \ | '_ \| '_ \| | | |/ _` | | | | | | | | |/ _ \ | / _ \| '_ \ | +| / ___ \| | | | | | | |_| | (_| | | | |___| | |_| | __/ |__| (_) | | | | | +| /_/ \_\_| |_|_| |_|\__,_|\__,_|_| \____|_|\__,_|\___|\____\___/|_| |_| | | | -| _____ _ _ ____ __ | -| |_ _|__| | ___ _ __ | |__ ___ _ __ _ _ / ___|___ _ __ / _| ___ _ __ ___ _ __ ___ ___ | -| | |/ _ \ |/ _ \ '_ \| '_ \ / _ \| '_ \| | | | | | / _ \| '_ \| |_ / _ \ '__/ _ \ '_ \ / __/ _ \ | -| | | __/ | __/ |_) | | | | (_) | | | | |_| | | |__| (_) | | | | _| __/ | | __/ | | | (_| __/ | -| |_|\___|_|\___| .__/|_| |_|\___/|_| |_|\__, | \____\___/|_| |_|_| \___|_| \___|_| |_|\___\___| | -| |_| |___/ | -| _____ _ _ | -| | ____|_ _____ _ __ _ _ / \ _ _ __ _ _ _ ___| |_ | -| | _| \ \ / / _ \ '__| | | | / _ \| | | |/ _` | | | / __| __| | -| | |___ \ V / __/ | | |_| | / ___ \ |_| | (_| | |_| \__ \ |_ | -| |_____| \_/ \___|_| \__, | /_/ \_\__,_|\__, |\__,_|___/\__| | -| |___/ |___/ | -| ____ _ ____ | -| __ ____ ____ __ / ___| |_ _ ___ / ___|___ _ __ ___ ___ _ __ ___ | -| \ \ /\ / /\ \ /\ / /\ \ /\ / / | | | | | | |/ _ \ | / _ \| '_ \ / __/ _ \| '_ ` _ \ | -| \ V V / \ V V / \ V V / _ | |___| | |_| | __/ |__| (_) | | | | _ | (_| (_) | | | | | | | -| \_/\_/ \_/\_/ \_/\_/ (_) \____|_|\__,_|\___|\____\___/|_| |_| (_) \___\___/|_| |_| |_| | +| ____ _____ ____ ____ __ | +| | _ \_ _/ ___| / ___|___ _ __ / _| ___ _ __ ___ _ __ ___ ___ | +| | |_) || || | | | / _ \| '_ \| |_ / _ \ '__/ _ \ '_ \ / __/ _ \ | +| | _ < | || |___ | |__| (_) | | | | _| __/ | | __/ | | | (_| __/ | +| |_| \_\|_| \____| \____\___/|_| |_|_| \___|_| \___|_| |_|\___\___| | +| | +| ____ _ ____ | +| / ___| |_ _ ___ / ___|___ _ __ ___ ___ _ __ ___ | +| | | | | | | |/ _ \ | / _ \| '_ \ / __/ _ \| '_ ` _ \ | +| | |___| | |_| | __/ |__| (_) | | | | _ | (_| (_) | | | | | | | +| \____|_|\__,_|\___|\____\___/|_| |_| (_) \___\___/|_| |_| |_| | | | .=======================================================================================================. diff --git a/cluecon2.tmpl b/cluecon2.tmpl index e0f2309ca3..28c4d51d56 100644 --- a/cluecon2.tmpl +++ b/cluecon2.tmpl @@ -1,29 +1,20 @@ - .=======================================================================================================. -| ____ _ ____ | -| / ___| |_ _ ___ / ___|___ _ __ | -| | | | | | | |/ _ \ | / _ \| '_ \ | -| | |___| | |_| | __/ |__| (_) | | | | | -| \____|_|\__,_|\___|\____\___/|_| |_| | +| _ _ ____ _ ____ | +| / \ _ __ _ __ _ _ __ _| | / ___| |_ _ ___ / ___|___ _ __ | +| / _ \ | '_ \| '_ \| | | |/ _` | | | | | | | | |/ _ \ | / _ \| '_ \ | +| / ___ \| | | | | | | |_| | (_| | | | |___| | |_| | __/ |__| (_) | | | | | +| /_/ \_\_| |_|_| |_|\__,_|\__,_|_| \____|_|\__,_|\___|\____\___/|_| |_| | | | -| _____ _ _ ____ __ | -| |_ _|__| | ___ _ __ | |__ ___ _ __ _ _ / ___|___ _ __ / _| ___ _ __ ___ _ __ ___ ___ | -| | |/ _ \ |/ _ \ '_ \| '_ \ / _ \| '_ \| | | | | | / _ \| '_ \| |_ / _ \ '__/ _ \ '_ \ / __/ _ \ | -| | | __/ | __/ |_) | | | | (_) | | | | |_| | | |__| (_) | | | | _| __/ | | __/ | | | (_| __/ | -| |_|\___|_|\___| .__/|_| |_|\___/|_| |_|\__, | \____\___/|_| |_|_| \___|_| \___|_| |_|\___\___| | -| |_| |___/ | -| _____ _ _ | -| | ____|_ _____ _ __ _ _ / \ _ _ __ _ _ _ ___| |_ | -| | _| \ \ / / _ \ '__| | | | / _ \| | | |/ _` | | | / __| __| | -| | |___ \ V / __/ | | |_| | / ___ \ |_| | (_| | |_| \__ \ |_ | -| |_____| \_/ \___|_| \__, | /_/ \_\__,_|\__, |\__,_|___/\__| | -| |___/ |___/ | -| ____ _ ____ | -| __ ____ ____ __ / ___| |_ _ ___ / ___|___ _ __ ___ ___ _ __ ___ | -| \ \ /\ / /\ \ /\ / /\ \ /\ / / | | | | | | |/ _ \ | / _ \| '_ \ / __/ _ \| '_ ` _ \ | -| \ V V / \ V V / \ V V / _ | |___| | |_| | __/ |__| (_) | | | | _ | (_| (_) | | | | | | | -| \_/\_/ \_/\_/ \_/\_/ (_) \____|_|\__,_|\___|\____\___/|_| |_| (_) \___\___/|_| |_| |_| | +| ____ _____ ____ ____ __ | +| | _ \_ _/ ___| / ___|___ _ __ / _| ___ _ __ ___ _ __ ___ ___ | +| | |_) || || | | | / _ \| '_ \| |_ / _ \ '__/ _ \ '_ \ / __/ _ \ | +| | _ < | || |___ | |__| (_) | | | | _| __/ | | __/ | | | (_| __/ | +| |_| \_\|_| \____| \____\___/|_| |_|_| \___|_| \___|_| |_|\___\___| | +| | +| ____ _ ____ | +| / ___| |_ _ ___ / ___|___ _ __ ___ ___ _ __ ___ | +| | | | | | | |/ _ \ | / _ \| '_ \ / __/ _ \| '_ ` _ \ | +| | |___| | |_| | __/ |__| (_) | | | | _ | (_| (_) | | | | | | | +| \____|_|\__,_|\___|\____\___/|_| |_| (_) \___\___/|_| |_| |_| | | | .=======================================================================================================. - - diff --git a/libs/esl/src/include/cc.h b/libs/esl/src/include/cc.h index d2635f3b1c..e92d2cd6e9 100644 --- a/libs/esl/src/include/cc.h +++ b/libs/esl/src/include/cc.h @@ -1,4 +1,4 @@ -const char *cc = ".=======================================================================================================.\n| ____ _ ____ |\n| / ___| |_ _ ___ / ___|___ _ __ |\n| | | | | | | |/ _ \\ | / _ \\| '_ \\ |\n| | |___| | |_| | __/ |__| (_) | | | | |\n| \\____|_|\\__,_|\\___|\\____\\___/|_| |_| |\n| |\n| _____ _ _ ____ __ |\n| |_ _|__| | ___ _ __ | |__ ___ _ __ _ _ / ___|___ _ __ / _| ___ _ __ ___ _ __ ___ ___ |\n| | |/ _ \\ |/ _ \\ '_ \\| '_ \\ / _ \\| '_ \\| | | | | | / _ \\| '_ \\| |_ / _ \\ '__/ _ \\ '_ \\ / __/ _ \\ |\n| | | __/ | __/ |_) | | | | (_) | | | | |_| | | |__| (_) | | | | _| __/ | | __/ | | | (_| __/ |\n| |_|\\___|_|\\___| .__/|_| |_|\\___/|_| |_|\\__, | \\____\\___/|_| |_|_| \\___|_| \\___|_| |_|\\___\\___| |\n| |_| |___/ |\n| _____ _ _ |\n| | ____|_ _____ _ __ _ _ / \\ _ _ __ _ _ _ ___| |_ |\n| | _| \\ \\ / / _ \\ '__| | | | / _ \\| | | |/ _` | | | / __| __| |\n| | |___ \\ V / __/ | | |_| | / ___ \\ |_| | (_| | |_| \\__ \\ |_ |\n| |_____| \\_/ \\___|_| \\__, | /_/ \\_\\__,_|\\__, |\\__,_|___/\\__| |\n| |___/ |___/ |\n| ____ _ ____ |\n| __ ____ ____ __ / ___| |_ _ ___ / ___|___ _ __ ___ ___ _ __ ___ |\n| \\ \\ /\\ / /\\ \\ /\\ / /\\ \\ /\\ / / | | | | | | |/ _ \\ | / _ \\| '_ \\ / __/ _ \\| '_ ` _ \\ |\n| \\ V V / \\ V V / \\ V V / _ | |___| | |_| | __/ |__| (_) | | | | _ | (_| (_) | | | | | | |\n| \\_/\\_/ \\_/\\_/ \\_/\\_/ (_) \\____|_|\\__,_|\\___|\\____\\___/|_| |_| (_) \\___\\___/|_| |_| |_| |\n| |\n.=======================================================================================================.\n"; +const char *cc = ".=======================================================================================================.\n| _ _ ____ _ ____ |\n| / \\ _ __ _ __ _ _ __ _| | / ___| |_ _ ___ / ___|___ _ __ |\n| / _ \\ | '_ \\| '_ \\| | | |/ _` | | | | | | | | |/ _ \\ | / _ \\| '_ \\ |\n| / ___ \\| | | | | | | |_| | (_| | | | |___| | |_| | __/ |__| (_) | | | | |\n| /_/ \\_\\_| |_|_| |_|\\__,_|\\__,_|_| \\____|_|\\__,_|\\___|\\____\\___/|_| |_| |\n| |\n| ____ _____ ____ ____ __ |\n| | _ \\_ _/ ___| / ___|___ _ __ / _| ___ _ __ ___ _ __ ___ ___ |\n| | |_) || || | | | / _ \\| '_ \\| |_ / _ \\ '__/ _ \\ '_ \\ / __/ _ \\ |\n| | _ < | || |___ | |__| (_) | | | | _| __/ | | __/ | | | (_| __/ |\n| |_| \\_\\|_| \\____| \\____\\___/|_| |_|_| \\___|_| \\___|_| |_|\\___\\___| |\n| |\n| ____ _ ____ |\n| / ___| |_ _ ___ / ___|___ _ __ ___ ___ _ __ ___ |\n| | | | | | | |/ _ \\ | / _ \\| '_ \\ / __/ _ \\| '_ ` _ \\ |\n| | |___| | |_| | __/ |__| (_) | | | | _ | (_| (_) | | | | | | |\n| \\____|_|\\__,_|\\___|\\____\\___/|_| |_| (_) \\___\\___/|_| |_| |_| |\n| |\n.=======================================================================================================.\n"; const char *cc_s = ".===============================================================.\n| _ |\n| ___| |_ _ ___ ___ ___ _ __ ___ ___ _ __ ___ |\n| / __| | | | |/ _ \\/ __/ _ \\| '_ \\ / __/ _ \\| '_ ` _ \\ |\n| | (__| | |_| | __/ (_| (_) | | | | _ | (_| (_) | | | | | | |\n| \\___|_|\\__,_|\\___|\\___\\___/|_| |_| (_) \\___\\___/|_| |_| |_| |\n| |\n.===============================================================.\n"; diff --git a/src/include/cc.h b/src/include/cc.h index d2635f3b1c..e92d2cd6e9 100644 --- a/src/include/cc.h +++ b/src/include/cc.h @@ -1,4 +1,4 @@ -const char *cc = ".=======================================================================================================.\n| ____ _ ____ |\n| / ___| |_ _ ___ / ___|___ _ __ |\n| | | | | | | |/ _ \\ | / _ \\| '_ \\ |\n| | |___| | |_| | __/ |__| (_) | | | | |\n| \\____|_|\\__,_|\\___|\\____\\___/|_| |_| |\n| |\n| _____ _ _ ____ __ |\n| |_ _|__| | ___ _ __ | |__ ___ _ __ _ _ / ___|___ _ __ / _| ___ _ __ ___ _ __ ___ ___ |\n| | |/ _ \\ |/ _ \\ '_ \\| '_ \\ / _ \\| '_ \\| | | | | | / _ \\| '_ \\| |_ / _ \\ '__/ _ \\ '_ \\ / __/ _ \\ |\n| | | __/ | __/ |_) | | | | (_) | | | | |_| | | |__| (_) | | | | _| __/ | | __/ | | | (_| __/ |\n| |_|\\___|_|\\___| .__/|_| |_|\\___/|_| |_|\\__, | \\____\\___/|_| |_|_| \\___|_| \\___|_| |_|\\___\\___| |\n| |_| |___/ |\n| _____ _ _ |\n| | ____|_ _____ _ __ _ _ / \\ _ _ __ _ _ _ ___| |_ |\n| | _| \\ \\ / / _ \\ '__| | | | / _ \\| | | |/ _` | | | / __| __| |\n| | |___ \\ V / __/ | | |_| | / ___ \\ |_| | (_| | |_| \\__ \\ |_ |\n| |_____| \\_/ \\___|_| \\__, | /_/ \\_\\__,_|\\__, |\\__,_|___/\\__| |\n| |___/ |___/ |\n| ____ _ ____ |\n| __ ____ ____ __ / ___| |_ _ ___ / ___|___ _ __ ___ ___ _ __ ___ |\n| \\ \\ /\\ / /\\ \\ /\\ / /\\ \\ /\\ / / | | | | | | |/ _ \\ | / _ \\| '_ \\ / __/ _ \\| '_ ` _ \\ |\n| \\ V V / \\ V V / \\ V V / _ | |___| | |_| | __/ |__| (_) | | | | _ | (_| (_) | | | | | | |\n| \\_/\\_/ \\_/\\_/ \\_/\\_/ (_) \\____|_|\\__,_|\\___|\\____\\___/|_| |_| (_) \\___\\___/|_| |_| |_| |\n| |\n.=======================================================================================================.\n"; +const char *cc = ".=======================================================================================================.\n| _ _ ____ _ ____ |\n| / \\ _ __ _ __ _ _ __ _| | / ___| |_ _ ___ / ___|___ _ __ |\n| / _ \\ | '_ \\| '_ \\| | | |/ _` | | | | | | | | |/ _ \\ | / _ \\| '_ \\ |\n| / ___ \\| | | | | | | |_| | (_| | | | |___| | |_| | __/ |__| (_) | | | | |\n| /_/ \\_\\_| |_|_| |_|\\__,_|\\__,_|_| \\____|_|\\__,_|\\___|\\____\\___/|_| |_| |\n| |\n| ____ _____ ____ ____ __ |\n| | _ \\_ _/ ___| / ___|___ _ __ / _| ___ _ __ ___ _ __ ___ ___ |\n| | |_) || || | | | / _ \\| '_ \\| |_ / _ \\ '__/ _ \\ '_ \\ / __/ _ \\ |\n| | _ < | || |___ | |__| (_) | | | | _| __/ | | __/ | | | (_| __/ |\n| |_| \\_\\|_| \\____| \\____\\___/|_| |_|_| \\___|_| \\___|_| |_|\\___\\___| |\n| |\n| ____ _ ____ |\n| / ___| |_ _ ___ / ___|___ _ __ ___ ___ _ __ ___ |\n| | | | | | | |/ _ \\ | / _ \\| '_ \\ / __/ _ \\| '_ ` _ \\ |\n| | |___| | |_| | __/ |__| (_) | | | | _ | (_| (_) | | | | | | |\n| \\____|_|\\__,_|\\___|\\____\\___/|_| |_| (_) \\___\\___/|_| |_| |_| |\n| |\n.=======================================================================================================.\n"; const char *cc_s = ".===============================================================.\n| _ |\n| ___| |_ _ ___ ___ ___ _ __ ___ ___ _ __ ___ |\n| / __| | | | |/ _ \\/ __/ _ \\| '_ \\ / __/ _ \\| '_ ` _ \\ |\n| | (__| | |_| | __/ (_| (_) | | | | _ | (_| (_) | | | | | | |\n| \\___|_|\\__,_|\\___|\\___\\___/|_| |_| (_) \\___\\___/|_| |_| |_| |\n| |\n.===============================================================.\n"; From d6adc30781a3e594ba38909b9b2cff8cfbf9c846 Mon Sep 17 00:00:00 2001 From: Serj Date: Tue, 19 Jun 2018 16:23:21 +0000 Subject: [PATCH 048/264] FS-11198: [Debian] install fonts to the correct location --- debian/freeswitch.install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/freeswitch.install b/debian/freeswitch.install index 1e3d17622a..b58e589b8f 100644 --- a/debian/freeswitch.install +++ b/debian/freeswitch.install @@ -1,3 +1,3 @@ /usr/bin -fonts/FreeMono.ttf /usr/share/freeswitch/fonts/FreeMono.ttf -fonts/FreeSans.ttf /usr/share/freeswitch/fonts/FreeSans.ttf \ No newline at end of file +fonts/FreeMono.ttf /usr/share/freeswitch/fonts/ +fonts/FreeSans.ttf /usr/share/freeswitch/fonts/ \ No newline at end of file From 68e256597ad7993d1786aedeb6680dc752c1dd88 Mon Sep 17 00:00:00 2001 From: netoguimaraes Date: Thu, 28 Jun 2018 17:40:34 -0300 Subject: [PATCH 049/264] FS-11211 - [verto_communicator]: Adding turnServer and socketFallbackUrl options. --- html5/verto/js/src/jquery.FSRTC.js | 14 +++++++++----- html5/verto/js/src/jquery.jsonrpcclient.js | 4 ++++ html5/verto/js/src/jquery.verto.js | 11 +++++++---- .../verto_communicator/src/config.json.sample | 8 +++++++- .../src/vertoService/services/configService.js | 8 ++++++++ .../src/vertoService/services/vertoService.js | 4 ++++ 6 files changed, 39 insertions(+), 10 deletions(-) diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js index f07188bedb..05501193b7 100644 --- a/html5/verto/js/src/jquery.FSRTC.js +++ b/html5/verto/js/src/jquery.FSRTC.js @@ -430,7 +430,8 @@ offerSDP: { type: "offer", sdp: self.remoteSDP - } + }, + turnServer: self.options.turnServer }); onStreamSuccess(self, stream); @@ -625,6 +626,7 @@ }, constraints: self.constraints, iceServers: self.options.iceServers, + turnServer: self.options.turnServer }); onStreamSuccess(self, stream); @@ -674,13 +676,15 @@ function FSRTCPeerConnection(options) { var gathering = false, done = false; var config = {}; - var default_ice = { - urls: ['stun:stun.l.google.com:19302'] - }; + var default_ice = [{ urls: ['stun:stun.l.google.com:19302'] }]; + + if (self.options.turnServer) { + default_ice.push(self.options.turnServer) + } if (options.iceServers) { if (typeof(options.iceServers) === "boolean") { - config.iceServers = [default_ice]; + config.iceServers = default_ice; } else { config.iceServers = options.iceServers; } diff --git a/html5/verto/js/src/jquery.jsonrpcclient.js b/html5/verto/js/src/jquery.jsonrpcclient.js index 702998cc58..7f5a68753a 100644 --- a/html5/verto/js/src/jquery.jsonrpcclient.js +++ b/html5/verto/js/src/jquery.jsonrpcclient.js @@ -322,6 +322,10 @@ self.options.onWSClose(self); } + if (self.ws_cnt > 10) { + self.options.socketUrl = self.options.socketFallbackUrl; + } + console.error("Websocket Lost " + self.ws_cnt + " sleep: " + self.ws_sleep + "msec"); self.to = setTimeout(function() { diff --git a/html5/verto/js/src/jquery.verto.js b/html5/verto/js/src/jquery.verto.js index 20befd92d6..50fda9149a 100644 --- a/html5/verto/js/src/jquery.verto.js +++ b/html5/verto/js/src/jquery.verto.js @@ -110,6 +110,8 @@ login: verto.options.login, passwd: verto.options.passwd, socketUrl: verto.options.socketUrl, + socketFallbackUrl: verto.options.socketFallbackUrl, + turnServer: verto.options.turnServer, loginParams: verto.options.loginParams, userVariables: verto.options.userVariables, sessid: verto.sessid, @@ -2076,10 +2078,11 @@ videoParams: dialog.params.videoParams, audioParams: verto.options.audioParams, iceServers: verto.options.iceServers, - screenShare: dialog.screenShare, - useCamera: dialog.useCamera, - useMic: dialog.useMic, - useSpeak: dialog.useSpeak + screenShare: dialog.screenShare, + useCamera: dialog.useCamera, + useMic: dialog.useMic, + useSpeak: dialog.useSpeak, + turnServer: verto.options.turnServer }); dialog.rtc.verto = dialog.verto; diff --git a/html5/verto/verto_communicator/src/config.json.sample b/html5/verto/verto_communicator/src/config.json.sample index a905c6161d..ae044c8e1c 100644 --- a/html5/verto/verto_communicator/src/config.json.sample +++ b/html5/verto/verto_communicator/src/config.json.sample @@ -9,5 +9,11 @@ "autologin": "true", "autocall": "3500", "googlelogin": "true", - "wsURL": "wss://gamma.tollfreegateway.com/wss2" + "wsURL": "wss://gamma.tollfreegateway.com/wss2", + "socketFallbackUrl": "wss://gamma.tollfreegateway.com/wss2", + "turnServer": { + "urls": "turn:someturnserver.com:443?transport=tcp", + "credential": "1234", + "username": "username" + } } diff --git a/html5/verto/verto_communicator/src/vertoService/services/configService.js b/html5/verto/verto_communicator/src/vertoService/services/configService.js index 9fd789e81f..05b0b2cbe8 100644 --- a/html5/verto/verto_communicator/src/vertoService/services/configService.js +++ b/html5/verto/verto_communicator/src/vertoService/services/configService.js @@ -41,6 +41,14 @@ vertoService.service('config', ['$rootScope', '$http', '$location', 'storage', ' verto.data.googleclientid = data.googleclientid; } + if (data.wsFallbackURL) { + verto.data.wsFallbackURL = data.wsFallbackURL; + } + + if (data.turnServer) { + verto.data.turnServer = data.turnServer; + } + angular.extend(verto.data, data); /** diff --git a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js index 808aba539c..b885f47154 100644 --- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js +++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js @@ -175,6 +175,8 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora password: $cookieStore.get('verto_demo_passwd') || "1234", hostname: window.location.hostname, wsURL: ("wss://" + window.location.hostname + ":8082"), + socketFallbackUrl: null, + turnServer: null, resCheckEnded: false }; @@ -733,6 +735,8 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora login: data.login + '@' + data.hostname, passwd: data.password, socketUrl: data.wsURL, + socketFallbackUrl: data.socketFallbackUrl, + turnServer: data.turnServer, tag: "webcam", ringFile: "sounds/bell_ring2.wav", audioParams: { From 49b8cc3a3ef5d41090a6b697009fa190d2cc7ad8 Mon Sep 17 00:00:00 2001 From: netoguimaraes Date: Wed, 11 Jul 2018 15:49:02 -0300 Subject: [PATCH 050/264] FS-11227 - [verto_communicator]: stops localVideoStream tracks properly --- html5/verto/js/src/jquery.FSRTC.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js index 05501193b7..f4f79f0c86 100644 --- a/html5/verto/js/src/jquery.FSRTC.js +++ b/html5/verto/js/src/jquery.FSRTC.js @@ -507,7 +507,7 @@ }, localVideo: obj.options.localVideo, - onsuccess: function(e) {self.options.localVideoStream = e; console.log("local video ready");}, + onsuccess: function(e) {obj.options.localVideoStream = e; console.log("local video ready");}, onerror: function(e) {console.error("local video error!");} }); } From fc6661ccb31bff245465a29ab0cc89db6d8c2fa2 Mon Sep 17 00:00:00 2001 From: netoguimaraes Date: Fri, 13 Jul 2018 14:59:57 -0300 Subject: [PATCH 051/264] FS-11229 - [verto_communicator]: deprecating use of URL.createObjectURL --- html5/verto/js/src/jquery.FSRTC.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js index f4f79f0c86..46d8d5582c 100644 --- a/html5/verto/js/src/jquery.FSRTC.js +++ b/html5/verto/js/src/jquery.FSRTC.js @@ -232,8 +232,6 @@ FSRTCattachMediaStream = function(element, stream) { if (typeof element.srcObject !== 'undefined') { element.srcObject = stream; - } else if (typeof element.src !== 'undefined') { - element.src = URL.createObjectURL(stream); } else { console.error('Error attaching stream to element.'); } @@ -960,7 +958,7 @@ function streaming(stream) { if (options.localVideo) { - options.localVideo['src'] = window.URL.createObjectURL(stream); + options.localVideo['srcObject'] = stream; options.localVideo.style.display = 'block'; } From 9e3da931e519c2dbba2f86762756b1f26f8318d8 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Fri, 13 Jul 2018 15:13:24 -0400 Subject: [PATCH 052/264] FS-11230: [core] Fix bad rtp timestamps triggered by cng/missed packet detection --- src/switch_rtp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index afbd01a24e..a0efee7cf5 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -8166,7 +8166,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, #ifdef DEBUG_TS_ROLLOVER switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "WRITE TS LAST:%u THIS:%u DELTA:%u\n", rtp_session->last_write_ts, this_ts, ts_delta); #endif - if (!switch_rtp_ready(rtp_session) || rtp_session->sending_dtmf) { + if (ts_delta == 0 || !switch_rtp_ready(rtp_session) || rtp_session->sending_dtmf) { send = 0; } } @@ -8684,6 +8684,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra data = frame->data; len = frame->datalen; ts = rtp_session->flags[SWITCH_RTP_FLAG_RAW_WRITE] ? (uint32_t) frame->timestamp : 0; + if (!ts) ts = rtp_session->last_write_ts + rtp_session->samples_per_interval; } /* From b1a3c704b7e7c90a2ac3a3aa34ad85a9c55869b5 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Fri, 13 Jul 2018 15:18:35 -0400 Subject: [PATCH 053/264] FS-11230: [core] Fix bad rtp timestamps triggered by cng/missed packet detection --- src/switch_core_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_io.c b/src/switch_core_io.c index 0ccb215f26..7560465187 100644 --- a/src/switch_core_io.c +++ b/src/switch_core_io.c @@ -417,7 +417,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi switch_set_flag(session, SSF_WARN_TRANSCODE); } - if (read_frame->codec || is_cng) { + if (read_frame->codec || (is_cng && session->plc)) { session->raw_read_frame.datalen = session->raw_read_frame.buflen; if (is_cng) { From 15227e01f27d87ec0657452412d1398373f6899c Mon Sep 17 00:00:00 2001 From: Marcell Guilherme Costa da Silva Date: Wed, 18 Jul 2018 17:58:16 -0300 Subject: [PATCH 054/264] FS-11236 [verto_communicator] call useCamera property on video constraints --- html5/verto/js/src/jquery.FSRTC.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js index 46d8d5582c..39073ecbab 100644 --- a/html5/verto/js/src/jquery.FSRTC.js +++ b/html5/verto/js/src/jquery.FSRTC.js @@ -448,10 +448,7 @@ getUserMedia({ constraints: { audio: false, - video: { - //mandatory: self.options.videoParams, - //optional: [] - }, + video: { deviceId: params.useCamera }, }, localVideo: self.options.localVideo, onsuccess: function(e) {self.options.localVideoStream = e; console.log("local video ready");}, @@ -501,8 +498,7 @@ getUserMedia({ constraints: { audio: false, - video: obj.options.videoParams - + video: { deviceId: obj.options.useCamera }, }, localVideo: obj.options.localVideo, onsuccess: function(e) {obj.options.localVideoStream = e; console.log("local video ready");}, From ee1418a5cab7568b7d61c7c844f7b1fcf075fcc3 Mon Sep 17 00:00:00 2001 From: Marcell Guilherme Costa da Silva Date: Thu, 19 Jul 2018 15:21:51 -0300 Subject: [PATCH 055/264] FS-11262 [verto_communicator] prevent vertojs from stop retrying socket connection by undefined socketfallbackurl --- html5/verto/js/src/jquery.jsonrpcclient.js | 4 ++-- html5/verto/js/src/jquery.verto.js | 2 +- html5/verto/verto_communicator/src/config.json.sample | 2 +- .../src/vertoService/services/vertoService.js | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/html5/verto/js/src/jquery.jsonrpcclient.js b/html5/verto/js/src/jquery.jsonrpcclient.js index 7f5a68753a..5beb85fc50 100644 --- a/html5/verto/js/src/jquery.jsonrpcclient.js +++ b/html5/verto/js/src/jquery.jsonrpcclient.js @@ -322,8 +322,8 @@ self.options.onWSClose(self); } - if (self.ws_cnt > 10) { - self.options.socketUrl = self.options.socketFallbackUrl; + if (self.ws_cnt > 10 && self.options.wsFallbackURL) { + self.options.socketUrl = self.options.wsFallbackURL; } console.error("Websocket Lost " + self.ws_cnt + " sleep: " + self.ws_sleep + "msec"); diff --git a/html5/verto/js/src/jquery.verto.js b/html5/verto/js/src/jquery.verto.js index 50fda9149a..c913ca4140 100644 --- a/html5/verto/js/src/jquery.verto.js +++ b/html5/verto/js/src/jquery.verto.js @@ -110,7 +110,7 @@ login: verto.options.login, passwd: verto.options.passwd, socketUrl: verto.options.socketUrl, - socketFallbackUrl: verto.options.socketFallbackUrl, + wsFallbackURL: verto.options.wsFallbackURL, turnServer: verto.options.turnServer, loginParams: verto.options.loginParams, userVariables: verto.options.userVariables, diff --git a/html5/verto/verto_communicator/src/config.json.sample b/html5/verto/verto_communicator/src/config.json.sample index ae044c8e1c..a4a4bafad2 100644 --- a/html5/verto/verto_communicator/src/config.json.sample +++ b/html5/verto/verto_communicator/src/config.json.sample @@ -10,7 +10,7 @@ "autocall": "3500", "googlelogin": "true", "wsURL": "wss://gamma.tollfreegateway.com/wss2", - "socketFallbackUrl": "wss://gamma.tollfreegateway.com/wss2", + "wsFallbackURL": "wss://gamma.tollfreegateway.com/wss2", "turnServer": { "urls": "turn:someturnserver.com:443?transport=tcp", "credential": "1234", diff --git a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js index b885f47154..348412a261 100644 --- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js +++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js @@ -175,7 +175,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora password: $cookieStore.get('verto_demo_passwd') || "1234", hostname: window.location.hostname, wsURL: ("wss://" + window.location.hostname + ":8082"), - socketFallbackUrl: null, + wsFallbackURL: null, turnServer: null, resCheckEnded: false }; @@ -735,7 +735,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora login: data.login + '@' + data.hostname, passwd: data.password, socketUrl: data.wsURL, - socketFallbackUrl: data.socketFallbackUrl, + wsFallbackURL: data.wsFallbackURL, turnServer: data.turnServer, tag: "webcam", ringFile: "sounds/bell_ring2.wav", From 1064bb043c9eee801437621d0e146bdffbe7fe53 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 13 Nov 2017 13:32:23 -0600 Subject: [PATCH 056/264] FS-10784: [freeswitch-core] Make Users lists compatible with all forms of xml #resolve --- src/switch_xml.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/switch_xml.c b/src/switch_xml.c index 4ef0e9ec6c..1dc8166eca 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -1853,6 +1853,12 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(const char *use } } } + } else { + if ((users = switch_xml_child(domain, "users"))) { + status = find_user_in_tag(users, NULL, user_name, "id", NULL, user); + } else { + status = find_user_in_tag(domain, NULL, user_name, "id", NULL, user); + } } return status; @@ -2145,7 +2151,11 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *key, } if (status != SWITCH_STATUS_SUCCESS) { - status = find_user_in_tag(*domain, ip, user_name, key, params, user); + if ((users = switch_xml_child(*domain, "users"))) { + status = find_user_in_tag(users, ip, user_name, key, params, user); + } else { + status = find_user_in_tag(*domain, ip, user_name, key, params, user); + } } end: From c5e662c9bcb3a583f0fc9b2e91396911337a83da Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 13 Nov 2017 13:49:23 -0600 Subject: [PATCH 057/264] FS-10762: [freeswitch-core] Websocket logic error --- libs/sofia-sip/.update | 2 +- .../libsofia-sip-ua/tport/tport_type_ws.c | 16 +++++++++++++--- libs/sofia-sip/libsofia-sip-ua/tport/ws.c | 10 ++++++---- src/mod/endpoints/mod_verto/ws.c | 10 ++++++---- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 0b779c7ab1..7465198045 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Wed Feb 21 13:55:11 CDT 2018 +Mon Nov 13 13:48:40 CST 2017 diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c index 3ce3b4a005..de0cda565f 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c @@ -314,16 +314,26 @@ ssize_t tport_send_stream_ws(tport_t const *self, msg_t *msg, if (nerror == -1) { int err = su_errno(); if (su_is_blocking(err)) - break; + break; SU_DEBUG_3(("ws_write: %s\n", strerror(err))); return -1; } } if (wstp->wstp_buflen) { + ssize_t wrote = 0; + *(wstp->wstp_buffer + wstp->wstp_buflen) = '\0'; - ws_write_frame(&wstp->ws, WSOC_TEXT, wstp->wstp_buffer, wstp->wstp_buflen); - size = wstp->wstp_buflen; + wrote = ws_write_frame(&wstp->ws, WSOC_TEXT, wstp->wstp_buffer, wstp->wstp_buflen); + + if (wrote < 0) { + int err = su_errno(); + SU_DEBUG_3(("ws_write_frame: %s\n", strerror(err))); + size = wrote; + + } else { + size = wstp->wstp_buflen; + } } return size; diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c index 3dc776f530..32fee259b4 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c @@ -448,8 +448,10 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) ssl_err = 0; } - } while (--sanity > 0 && wsh->block && wrote < bytes); + } while (--sanity > 0 && wrote < bytes); + if (!sanity) ssl_err = 56; + if (ssl_err) { r = ssl_err * -1; } @@ -469,9 +471,9 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) if (wsh->block) { if (sanity < WS_WRITE_SANITY * 3 / 4) { - ms = 60; + ms = 50; } else if (sanity < WS_WRITE_SANITY / 2) { - ms = 10; + ms = 25; } } ms_sleep(ms); @@ -483,7 +485,7 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) } } - } while (--sanity > 0 && wsh->block && wrote < bytes); + } while (--sanity > 0 && wrote < bytes); //if (r<0) { //printf("wRITE FAIL: %s\n", strerror(errno)); diff --git a/src/mod/endpoints/mod_verto/ws.c b/src/mod/endpoints/mod_verto/ws.c index 3dc776f530..32fee259b4 100644 --- a/src/mod/endpoints/mod_verto/ws.c +++ b/src/mod/endpoints/mod_verto/ws.c @@ -448,8 +448,10 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) ssl_err = 0; } - } while (--sanity > 0 && wsh->block && wrote < bytes); + } while (--sanity > 0 && wrote < bytes); + if (!sanity) ssl_err = 56; + if (ssl_err) { r = ssl_err * -1; } @@ -469,9 +471,9 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) if (wsh->block) { if (sanity < WS_WRITE_SANITY * 3 / 4) { - ms = 60; + ms = 50; } else if (sanity < WS_WRITE_SANITY / 2) { - ms = 10; + ms = 25; } } ms_sleep(ms); @@ -483,7 +485,7 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) } } - } while (--sanity > 0 && wsh->block && wrote < bytes); + } while (--sanity > 0 && wrote < bytes); //if (r<0) { //printf("wRITE FAIL: %s\n", strerror(errno)); From 34f0ab58c13c92340202704594bee34976b18a18 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 14 Nov 2017 12:28:25 -0600 Subject: [PATCH 058/264] FS-10762: [freeswitch-core] Websocket logic error #resolve --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/tport/ws.c | 4 +++- src/mod/endpoints/mod_verto/ws.c | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 7465198045..0fbb6a3b65 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Mon Nov 13 13:48:40 CST 2017 +Tue Nov 14 12:28:03 CST 2017 diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c index 32fee259b4..834fa3c139 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c @@ -442,7 +442,9 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) } if (r == -1) { - if ((ssl_err = SSL_get_error(wsh->ssl, r)) != SSL_ERROR_WANT_WRITE) { + ssl_err = SSL_get_error(wsh->ssl, r); + + if (ssl_err != SSL_ERROR_WANT_WRITE && ssl_err != SSL_ERROR_WANT_READ) { break; } ssl_err = 0; diff --git a/src/mod/endpoints/mod_verto/ws.c b/src/mod/endpoints/mod_verto/ws.c index 32fee259b4..834fa3c139 100644 --- a/src/mod/endpoints/mod_verto/ws.c +++ b/src/mod/endpoints/mod_verto/ws.c @@ -442,7 +442,9 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) } if (r == -1) { - if ((ssl_err = SSL_get_error(wsh->ssl, r)) != SSL_ERROR_WANT_WRITE) { + ssl_err = SSL_get_error(wsh->ssl, r); + + if (ssl_err != SSL_ERROR_WANT_WRITE && ssl_err != SSL_ERROR_WANT_READ) { break; } ssl_err = 0; From 180d427cd664010950e8ac42b95a8d3f129ce28f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 20 Nov 2017 15:23:54 -0600 Subject: [PATCH 059/264] FS-8761: [freeswitch-core] Memory leak in FreeSWITCH --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 0fbb6a3b65..19cb5aa03f 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Tue Nov 14 12:28:03 CST 2017 +Mon Nov 20 15:06:28 CST 2017 diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c index de0cda565f..7e1dc76456 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport_type_ws.c @@ -635,8 +635,6 @@ int tport_ws_next_timer(tport_t *self, SU_DEBUG_7(("%s(%p): %s to " TPN_FORMAT "%s\n", __func__, (void *)self, (punt == 2 ? "Timeout establishing SSL" : "Error establishing SSL"), TPN_ARGS(self->tp_name), "")); - - return -1; } From 1fdd58f533c9b7f4e6ffb93ed3ab0e494908719d Mon Sep 17 00:00:00 2001 From: Piotr Gregor Date: Fri, 10 Nov 2017 21:30:47 +0000 Subject: [PATCH 060/264] FS-10778: Add support for MKI to SRTP MKI support for SRTP has been tested on calls to/from Telnyx's Skype for Business from/to local extension registered to FS and between Skype for Business clients connected to FreeSWITCH. SfB -> FreeSWITCH -> User 1004 SRTP RTP with MKI SfB <- FreeSWITCH <- User 1004 SRTP RTP SfB <-> FreeSWITCH <-> SfB SRTP/MKI SRTP/MKI Channel variable "rtp_secure_media_mki" was added to drive offering of MKI on outbound SRTP from FS. How to use rtp_secure_media_mki Set rtp_secure_media_mki=true to offer MKI for outgoing SRTP (if SRTP is used) in inbound call. Export rtp_secure_media=true to offer MKI for outgoing SRTP (if SRTP is used) on outbound call. ... or set it in the codec string for bridged calls EXAMPLES 1. Set example 57 58 59 60 61 62 63 64 Description: SRTP will be used on outbound leg in incoming call due to rtp_secure_media=true set and MKI will be offered in SDP. SRTP will not be used on a bridged call to extension 1004. 2. Export example 75 76 77 78 79 80 81 Description: SRTP on inbound call has been set to optional therefore MKI will be used on outbound SRTP in this call if SRTP is used at all. SRTP will be used on a bridged call due to rtp_secure_media=true set in codec string and MKI will be used in offering SDP. 3. Bridging between Skype for Business clients: set 97 98 99 100 101 98 99 100 101 102 103 104 Result: 2017-11-27 18:51:29.017689 [NOTICE] switch_ivr_originate.c:527 Ring Ready sofia/external/+12404373728@telnyxlab.com! 2017-11-27 18:51:35.097729 [INFO] switch_rtp.c:4079 Activating audio Secure RTP SEND (with MKI) 2017-11-27 18:51:35.097729 [INFO] switch_rtp.c:4057 Activating audio Secure RTP RECV (with MKI) 2017-11-27 18:51:35.097729 [NOTICE] sofia.c:8419 Channel [sofia/external/%2B12404373253@169.55.36.24:5060] has been answered 2017-11-27 18:51:37.797706 [INFO] switch_rtp.c:4079 Activating audio Secure RTP SEND (with MKI) 2017-11-27 18:51:37.797706 [INFO] switch_rtp.c:4057 Activating audio Secure RTP RECV (with MKI) Description: Connecting Skype For Business client to Skype for Business client. Send SRTP with MKI in both outbound streams: - for inbound call: MKI was offered in incoming call and enabled for outbound leg with "set" - for outbound call: MKI was enabled with "export" 5. Other examples Setup to use SRTP with MKI only on the inbound SRTP on incoming call from Telnyx SfB Tested dialing 0012404373253 from SfB to FS, leg SfB <-> FS uses SRTP with MKI on inbound SRTP only 57 58 59 61 62 63 64 Result: 2017-11-23 20:44:35.406026 [INFO] mod_dialplan_xml.c:637 Processing Test02 <+12404373728>->0012404373253 in context public 2017-11-23 20:44:38.566022 [INFO] switch_rtp.c:4107 Activating audio Secure RTP SEND 2017-11-23 20:44:38.566022 [INFO] switch_rtp.c:4085 Activating audio Secure RTP RECV (with MKI) Setup to send and receive SRTP with MKI on incoming call from Telnyx SfB Tested dialing 0012404373253 from SfB to FS, leg SfB <-> FS uses SRTP with MKI in both directions 57 58 59 60 61 62 63 64 Result: 2017-11-23 20:42:06.026034 [INFO] mod_dialplan_xml.c:637 Processing Test02 <+12404373728>->0012404373253 in context public 2017-11-23 20:42:09.526034 [INFO] switch_rtp.c:4107 Activating audio Secure RTP SEND (with MKI) 2017-11-23 20:42:09.526034 [INFO] switch_rtp.c:4085 Activating audio Secure RTP RECV (with MKI) Setup to offer MKI on outbound call to extension 1001 (X-Lite -> FS -> linphone) Tested dialing 0012404373253 from user 1004, leg FS <-> 1001 uses SRTP with MKI 782 783 784 785 786 797 798 799 Result: 2017-11-23 20:23:26.266034 [INFO] mod_dialplan_xml.c:637 Processing 1000 windows <1000>->0012404373253 in context default 2017-11-23 20:23:26.366035 [INFO] switch_rtp.c:4107 Activating audio Secure RTP SEND (with MKI) 2017-11-23 20:23:26.366035 [INFO] switch_rtp.c:4085 Activating audio Secure RTP RECV SfB sometimes offers crypto with LIFETIME but no MKI index, e.g.: a=crypto:5 AES_CM_128_HMAC_SHA1_80 inline:9OtFWi17H9E8ywlm0iazemjAqXu2RhJ3DZyo+VLJ|2^31 Defaulting to no-mki SRTP in case key material doesn't contain MKI index. --- src/include/switch_rtp.h | 11 +- src/include/switch_types.h | 58 +++++ src/include/switch_utils.h | 2 +- src/switch_core_media.c | 466 ++++++++++++++++++++++++++++++------- src/switch_rtp.c | 224 ++++++++++++++---- src/switch_utils.c | 5 +- 6 files changed, 626 insertions(+), 140 deletions(-) diff --git a/src/include/switch_rtp.h b/src/include/switch_rtp.h index 4080ecd03a..2d5c00a0d1 100644 --- a/src/include/switch_rtp.h +++ b/src/include/switch_rtp.h @@ -44,7 +44,6 @@ SWITCH_BEGIN_EXTERN_C #define SWITCH_RTP_MAX_BUF_LEN 16384 #define SWITCH_RTCP_MAX_BUF_LEN 16384 #define SWITCH_RTP_MAX_BUF_LEN_WORDS 4094 /* (max / 4) - 2 */ -#define SWITCH_RTP_MAX_CRYPTO_LEN 64 //#define SWITCH_RTP_KEY_LEN 30 //#define SWITCH_RTP_CRYPTO_KEY_32 "AES_CM_128_HMAC_SHA1_32" #define SWITCH_RTP_CRYPTO_KEY_80 "AES_CM_128_HMAC_SHA1_80" @@ -67,14 +66,16 @@ typedef enum { typedef struct switch_srtp_crypto_suite_s { char *name; switch_rtp_crypto_key_type_t type; - int keylen; + int keysalt_len; + int salt_len; } switch_srtp_crypto_suite_t; +extern switch_srtp_crypto_suite_t SUITES[CRYPTO_INVALID]; struct switch_rtp_crypto_key { uint32_t index; switch_rtp_crypto_key_type_t type; - unsigned char key[SWITCH_RTP_MAX_CRYPTO_LEN]; + unsigned char keysalt[SWITCH_RTP_MAX_CRYPTO_LEN]; switch_size_t keylen; struct switch_rtp_crypto_key *next; }; @@ -170,9 +171,7 @@ typedef enum { /* FMT Values for PSFB Payload Types http://www.iana.org/assignme -SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_session, - switch_rtp_crypto_direction_t direction, - uint32_t index, switch_rtp_crypto_key_type_t type, unsigned char *key, switch_size_t keylen); +SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_session, switch_rtp_crypto_direction_t direction, uint32_t index, switch_secure_settings_t *ssec); ///\defgroup rtp RTP (RealTime Transport Protocol) ///\ingroup core1 diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 652836b17c..e479e30bbd 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -779,6 +779,8 @@ typedef enum { SWITCH_RTP_FLAG_TEXT, SWITCH_RTP_FLAG_OLD_FIR, SWITCH_RTP_FLAG_PASSTHRU, + SWITCH_RTP_FLAG_SECURE_SEND_MKI, + SWITCH_RTP_FLAG_SECURE_RECV_MKI, SWITCH_RTP_FLAG_INVALID } switch_rtp_flag_t; @@ -2566,6 +2568,12 @@ typedef enum { CRYPTO_INVALID } switch_rtp_crypto_key_type_t; +/* Keep in sync with CRYPTO_KEY_PARAM_METHOD table. */ +typedef enum { + CRYPTO_KEY_PARAM_METHOD_INLINE, /* identified by "inline" chars in SRTP key parameter */ + CRYPTO_KEY_PARAM_METHOD_INVALID +} switch_rtp_crypto_key_param_method_type_t; + typedef struct payload_map_s { switch_media_type_t type; switch_sdp_type_t sdp_type; @@ -2709,6 +2717,56 @@ typedef struct switch_mm_s { char *auth_password; } switch_mm_t; +#define SWITCH_RTP_MAX_CRYPTO_LEN 64 + +/* If MKI is used, then one or more key-materials are present in the section of the crypto attribute. + * This struct describes the single MKI entry (key-material) within section of crypto attribute. + * Key-material follows the format: + * "inline:" ["|" lifetime] ["|" MKI ":" length] + * which translates to + * "inline: KEYSALT|MKI_ID:MKI_SZ" or "inline: KEYSALT|LIFETIME|MKI_ID:MKI_SZ" */ +typedef struct switch_crypto_key_material_s { + switch_rtp_crypto_key_param_method_type_t method; + unsigned char raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]; /* Key-salt. Master key appended with salt. Sizes determined by crypto suite. */ + char *crypto_key; /* Complete key material string ("method:keysalt[|lifetime]|mki"). */ + uint64_t lifetime; /* OPTIONAL. The lifetime value MAY be written as a non-zero, positive decimal integer or as a power of 2. Must be less than max lifetime of RTP and RTCP packets in given crypto suite. */ + unsigned int mki_id; /* OPTIONAL. */ + unsigned int mki_size; /* OPTIONAL. Byte length of the master key field in the RTP packet. */ + struct switch_crypto_key_material_s *next; /* NULL if this is the last master key in crypto attribute set. */ +} switch_crypto_key_material_t; + +typedef struct secure_settings_s { + int crypto_tag; + unsigned char local_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]; + unsigned char remote_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]; + switch_rtp_crypto_key_type_t crypto_type; + char *local_crypto_key; + char *remote_crypto_key; + + /* + * MKI support (as per rfc4568). + * Normally single crypto attribute contains one key-material in a section, e.g. "inline: KEYSALT" or "inline: KEYSALT|2^LIFETIME_BITS". + * But if MKI is used, then one or more key-materials are present in the section of the crypto attribute. Each key-material follows the format: + * + * "inline:" ["|" lifetime] ["|" MKI ":" length] + * + * "inline: KEYSALT|MKI_ID:MKI_SZ" + * or + * "inline: KEYSALT|2^LIFETIME_BITS|MKI_ID:MKI_SZ" + * + * This points to singly linked list of key-material descriptions if there is more than one key-material present in this crypto attribute (this key is inserted as the head of the list in that case), or to NULL otherwise. + */ + struct switch_crypto_key_material_s *local_key_material_next; /* NULL if MKI not used for crypto set on outbound SRTP. */ + unsigned long local_key_material_n; /* number of key_materials in the linked list for outbound SRTP */ + struct switch_crypto_key_material_s *remote_key_material_next; /* NULL if MKI not used for crypto set on inbound SRTP. */ + unsigned long remote_key_material_n; /* number of key_materials in the linked list for inbound SRTP */ +} switch_secure_settings_t; + +/* Default MKI index used for packets send from FS. We always use first key if multiple master keys are present in the crypto attribute. */ +#define SWITCH_CRYPTO_MKI_INDEX 0 + +/* max number of MKI in a single crypto line supported */ +#define SWITCH_CRYPTO_MKI_MAX 20 SWITCH_END_EXTERN_C #endif diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 5a57525577..2bf3de880e 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -391,7 +391,7 @@ static inline int switch_string_has_escaped_data(const char *in) #endif SWITCH_DECLARE(switch_status_t) switch_b64_encode(unsigned char *in, switch_size_t ilen, unsigned char *out, switch_size_t olen); -SWITCH_DECLARE(switch_size_t) switch_b64_decode(char *in, char *out, switch_size_t olen); +SWITCH_DECLARE(switch_size_t) switch_b64_decode(const char *in, char *out, switch_size_t olen); SWITCH_DECLARE(char *) switch_amp_encode(char *s, char *buf, switch_size_t len); diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 64f203f52a..6ba0f6cf53 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -64,16 +64,6 @@ typedef enum { SMF_VB_PAUSED = (1 << 3) } smh_flag_t; - -typedef struct secure_settings_s { - int crypto_tag; - unsigned char local_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]; - unsigned char remote_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]; - switch_rtp_crypto_key_type_t crypto_type; - char *local_crypto_key; - char *remote_crypto_key; -} switch_secure_settings_t; - typedef struct core_video_globals_s { int cpu_count; int cur_cpu; @@ -282,16 +272,16 @@ struct switch_media_handle_s { }; -static switch_srtp_crypto_suite_t SUITES[CRYPTO_INVALID] = { - { "AEAD_AES_256_GCM_8", AEAD_AES_256_GCM_8, 44}, - { "AEAD_AES_128_GCM_8", AEAD_AES_128_GCM_8, 28}, - { "AES_CM_256_HMAC_SHA1_80", AES_CM_256_HMAC_SHA1_80, 46}, - { "AES_CM_192_HMAC_SHA1_80", AES_CM_192_HMAC_SHA1_80, 38}, - { "AES_CM_128_HMAC_SHA1_80", AES_CM_128_HMAC_SHA1_80, 30}, - { "AES_CM_256_HMAC_SHA1_32", AES_CM_256_HMAC_SHA1_32, 46}, - { "AES_CM_192_HMAC_SHA1_32", AES_CM_192_HMAC_SHA1_32, 38}, - { "AES_CM_128_HMAC_SHA1_32", AES_CM_128_HMAC_SHA1_32, 30}, - { "AES_CM_128_NULL_AUTH", AES_CM_128_NULL_AUTH, 30} +switch_srtp_crypto_suite_t SUITES[CRYPTO_INVALID] = { + { "AEAD_AES_256_GCM_8", AEAD_AES_256_GCM_8, 44, 12}, + { "AEAD_AES_128_GCM_8", AEAD_AES_128_GCM_8, 28, 12}, + { "AES_CM_256_HMAC_SHA1_80", AES_CM_256_HMAC_SHA1_80, 46, 14}, + { "AES_CM_192_HMAC_SHA1_80", AES_CM_192_HMAC_SHA1_80, 38, 14}, + { "AES_CM_128_HMAC_SHA1_80", AES_CM_128_HMAC_SHA1_80, 30, 14}, + { "AES_CM_256_HMAC_SHA1_32", AES_CM_256_HMAC_SHA1_32, 46, 14}, + { "AES_CM_192_HMAC_SHA1_32", AES_CM_192_HMAC_SHA1_32, 38, 14}, + { "AES_CM_128_HMAC_SHA1_32", AES_CM_128_HMAC_SHA1_32, 30, 14}, + { "AES_CM_128_NULL_AUTH", AES_CM_128_NULL_AUTH, 30, 14} }; SWITCH_DECLARE(switch_rtp_crypto_key_type_t) switch_core_media_crypto_str2type(const char *str) @@ -315,12 +305,16 @@ SWITCH_DECLARE(const char *) switch_core_media_crypto_type2str(switch_rtp_crypto } -SWITCH_DECLARE(int) switch_core_media_crypto_keylen(switch_rtp_crypto_key_type_t type) +SWITCH_DECLARE(int) switch_core_media_crypto_keysalt_len(switch_rtp_crypto_key_type_t type) { switch_assert(type < CRYPTO_INVALID); - return SUITES[type].keylen; + return SUITES[type].keysalt_len; } +static const char* CRYPTO_KEY_PARAM_METHOD[CRYPTO_KEY_PARAM_METHOD_INVALID] = { + [CRYPTO_KEY_PARAM_METHOD_INLINE] = "inline", +}; + static inline switch_media_flow_t sdp_media_flow(unsigned in) { switch(in) { @@ -1161,16 +1155,14 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh return SWITCH_STATUS_SUCCESS; } - - //#define SAME_KEY #ifdef SAME_KEY if (switch_channel_test_flag(channel, CF_AVPF) && type == SWITCH_MEDIA_TYPE_VIDEO) { if (direction == SWITCH_RTP_CRYPTO_SEND) { - memcpy(engine->ssec[ctype].local_raw_key, smh->engines[SWITCH_MEDIA_TYPE_AUDIO].ssec.local_raw_key, SUITES[ctype].keylen); + memcpy(engine->ssec[ctype].local_raw_key, smh->engines[SWITCH_MEDIA_TYPE_AUDIO].ssec.local_raw_key, SUITES[ctype].keysalt_len); key = engine->ssec[ctype].local_raw_key; } else { - memcpy(engine->ssec[ctype].remote_raw_key, smh->engines[SWITCH_MEDIA_TYPE_AUDIO].ssec.remote_raw_key, SUITES[ctype].keylen); + memcpy(engine->ssec[ctype].remote_raw_key, smh->engines[SWITCH_MEDIA_TYPE_AUDIO].ssec.remote_raw_key, SUITES[ctype].keysalt_len); key = engine->ssec[ctype].remote_raw_key; } } else { @@ -1181,12 +1173,12 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh key = engine->ssec[ctype].remote_raw_key; } - switch_rtp_get_random(key, SUITES[ctype].keylen); + switch_rtp_get_random(key, SUITES[ctype].keysalt_len); #ifdef SAME_KEY } #endif - switch_b64_encode(key, SUITES[ctype].keylen, b64_key, sizeof(b64_key)); + switch_b64_encode(key, SUITES[ctype].keysalt_len, b64_key, sizeof(b64_key)); if (!switch_channel_var_true(channel, "rtp_pad_srtp_keys")) { p = strrchr((char *) b64_key, '='); @@ -1197,7 +1189,12 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh if (index == SWITCH_NO_CRYPTO_TAG) index = ctype + 1; - engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s", index, SUITES[ctype].name, b64_key); + if (switch_channel_get_variable(channel, "rtp_secure_media_mki")) { + engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s|2^31|1:1", index, SUITES[ctype].name, b64_key); + } else { + engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s", index, SUITES[ctype].name, b64_key); + } + switch_channel_set_variable_name_printf(smh->session->channel, engine->ssec[ctype].local_crypto_key, "rtp_last_%s_local_crypto_key", type2str(type)); switch_channel_set_flag(smh->session->channel, CF_SECURE); @@ -1216,17 +1213,180 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh } +#define CRYPTO_KEY_MATERIAL_LIFETIME_MKI_ERR 0x0u +#define CRYPTO_KEY_MATERIAL_MKI 0x1u +#define CRYPTO_KEY_MATERIAL_LIFETIME 0x2u +#define RAW_BITS_PER_64_ENCODED_CHAR 6 +/* Return uint32_t which contains all the info about the field found: + * XXXXXXXa | YYYYYYYY | YYYYYYYY | ZZZZZZZZ + * where: + * a - CRYPTO_KEY_MATERIAL_LIFETIME if LIFETIME, CRYPTO_KEY_MATERIAL_MKI if MKI + * YYYYYYYY and ZZZZZZZZ - depend on 'a': + * if a is LIFETIME then YYYYYYYY is decimal Base, ZZZZZZZZ is decimal Exponent + * if a is MKI, then YYYYYYYY is decimal MKI_ID, ZZZZZZZZ is decimal MKI_SIZE + */ +static uint32_t parse_lifetime_mki(const char **p, const char *end) +{ + const char *field_begin; + const char *field_end; + const char *sep, *space; + uint32_t res = 0; -switch_status_t switch_core_media_add_crypto(switch_secure_settings_t *ssec, const char *key_str, switch_rtp_crypto_direction_t direction) + uint32_t val = 0; + int i; + + switch_assert(*p != NULL); + switch_assert(end != NULL); + + field_begin = strchr(*p, '|'); + + if (field_begin && (field_begin + 1 < end)) { + space = strchr(field_begin, ' '); + field_end = strchr(field_begin + 2, '|'); + + if (!field_end) { + field_end = end; + } + + if (space) { + if ((field_end == NULL) || (space < field_end)) { + field_end = space; + } + } + + if (field_end) { + /* Closing '|' found. */ + sep = strchr(field_begin, ':'); /* The lifetime field never includes a colon, whereas the third field always does. (RFC 4568) */ + if (sep && (sep + 1 < field_end) && isdigit(*(sep + 1))) { + res |= (CRYPTO_KEY_MATERIAL_MKI << 24); + + for (i = 1, *p = sep - 1; *p != field_begin; --(*p), i *= 10) { + val += ((**p) - '0') * i; + } + + res |= ((val << 8) & 0x00ffff00); /* MKI_ID */ + + val = 0; + for (i = 1, *p = field_end - 1; *p != sep; --(*p), i *= 10) { + val += ((**p) - '0') * i; + } + res |= (val & 0x000000ff); /* MKI_SIZE */ + } else if (isdigit(*(field_begin + 1)) && (field_begin + 2) && (*(field_begin + 2) == '^') && (field_begin + 3) && isdigit(*(field_begin + 3))) { + res |= (CRYPTO_KEY_MATERIAL_LIFETIME << 24); + val = ((uint32_t) (*(field_begin + 1) - '0')) << 8; + res |= val; /* LIFETIME base. */ + + val = 0; + for (i = 1, *p = field_end - 1; *p != (field_begin + 2); --(*p), i *= 10) { + val += ((**p) - '0') * i; + } + + res |= (val & 0x000000ff); /* LIFETIME exponent. */ + } + } + + *p = field_end; + } + + return res; +} + +static switch_crypto_key_material_t* switch_core_media_crypto_append_key_material( + switch_core_session_t *session, + switch_crypto_key_material_t *tail, + switch_rtp_crypto_key_param_method_type_t method, + unsigned char raw_key[SWITCH_RTP_MAX_CRYPTO_LEN], + int raw_key_len, + const char *key_material, + int key_material_len, + uint64_t lifetime, + unsigned int mki_id, + unsigned int mki_size) +{ + struct switch_crypto_key_material_s *new_key_material; + + new_key_material = switch_core_session_alloc(session, (sizeof(*new_key_material))); + if (new_key_material == NULL) { + return NULL; + } + + new_key_material->method = method; + memcpy(new_key_material->raw_key, raw_key, raw_key_len); + new_key_material->crypto_key = switch_core_session_strdup(session, key_material); + new_key_material->lifetime = lifetime; + new_key_material->mki_id = mki_id; + new_key_material->mki_size = mki_size; + + new_key_material->next = tail; + + return new_key_material; +} + +/* + * Skip all space and return pointer to the '\0' terminator of the char string candidate to be a key-material + * or pointer to first ' ' in the candidate string. + */ +static const char* switch_core_media_crypto_find_key_material_candidate_end(const char *p) +{ + const char *end; + + switch_assert(p != NULL); + + if (p) { + end = strchr(p, ' '); /* find the end of the continuous string of characters in the candidate string */ + if (end == NULL) + end = p + strlen(p); + } + + return end; +} + +switch_status_t switch_core_media_add_crypto(switch_core_session_t *session, switch_secure_settings_t *ssec, switch_rtp_crypto_direction_t direction) { unsigned char key[SWITCH_RTP_MAX_CRYPTO_LEN]; switch_rtp_crypto_key_type_t type; - char *p; + + const char *p, *delimit; + const char *key_material_begin; + const char *key_material_end; /* begin and end of the current key material candidate */ + int method_len; + int keysalt_len; + + const char *opts; + uint32_t opt_field; /* LIFETIME or MKI */ + switch_rtp_crypto_key_param_method_type_t method = CRYPTO_KEY_PARAM_METHOD_INLINE; + uint64_t lifetime = 0; + uint16_t lifetime_base = 0; + uint16_t lifetime_exp = 0; + uint16_t mki_id = 0; + uint16_t mki_size = 0; + switch_crypto_key_material_t *key_material = NULL; + unsigned long *key_material_n = NULL; + + bool multiple_keys = false; + + const char *key_param; - p = strchr(key_str, ' '); + if (direction == SWITCH_RTP_CRYPTO_SEND || direction == SWITCH_RTP_CRYPTO_SEND_RTCP) { + key_param = ssec->local_crypto_key; + key_material = ssec->local_key_material_next; + key_material_n = &ssec->local_key_material_n; + } else { + key_param = ssec->remote_crypto_key; + key_material = ssec->remote_key_material_next; + key_material_n = &ssec->remote_key_material_n; + } + + if (zstr(key_param)) { + goto no_crypto_found; + } + + *key_material_n = 0; + + p = strchr(key_param, ' '); if (p && *p && *(p + 1)) { p++; @@ -1234,36 +1394,192 @@ switch_status_t switch_core_media_add_crypto(switch_secure_settings_t *ssec, con type = switch_core_media_crypto_str2type(p); if (type == CRYPTO_INVALID) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error near [%s]\n", p); - goto bad; + goto bad_crypto; } - p = strchr(p, ' '); - if (p && *p && *(p + 1)) { - p++; - if (strncasecmp(p, "inline:", 7)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error near [%s]\n", p); - goto bad; - } - - p += 7; - switch_b64_decode(p, (char *) key, sizeof(key)); - - if (direction == SWITCH_RTP_CRYPTO_SEND) { - memcpy(ssec->local_raw_key, key, SUITES[type].keylen); - } else { - memcpy(ssec->remote_raw_key, key, SUITES[type].keylen); - } - return SWITCH_STATUS_SUCCESS; + p = strchr(p, ' '); /* skip the crypto suite description */ + if (p == NULL) { + goto bad_crypto; } + do { + if (*key_material_n == SWITCH_CRYPTO_MKI_MAX) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Skipping excess of MKIs due to max number of suppoerted MKIs %d exceeded\n", SWITCH_CRYPTO_MKI_MAX); + break; + } + + p = switch_strip_spaces((char*) p, 0); + if (p) { + key_material_begin = p; + key_material_end = switch_core_media_crypto_find_key_material_candidate_end(p); + + /* Parsing the key material candidate within [begin, end). */ + + if ((delimit = strchr(p, ':')) == NULL) { + goto bad_error_parsing_near; + } + + method_len = delimit - p; + + if (strncasecmp(p, CRYPTO_KEY_PARAM_METHOD[CRYPTO_KEY_PARAM_METHOD_INLINE], method_len)) { + goto bad_key_param_method; + } + + method = CRYPTO_KEY_PARAM_METHOD_INLINE; + + /* Valid key-material found. Save as default key in secure_settings_s. */ + + p = delimit + 1; /* skip ':' */ + if (!(p && *p && *(p + 1))) { + goto bad_keysalt; + } + + /* Check if '|' is present in currently considered key-material. */ + if ((opts = strchr(p, '|')) && (opts < key_material_end)) { + keysalt_len = opts - p; + } else { + keysalt_len = key_material_end - p; + } + + if (keysalt_len > sizeof(key)) { + goto bad_keysalt_len; + } + + switch_b64_decode(p, (char *) key, keysalt_len); + + if (!multiple_keys) { /* First key becomes default (used in case no MKI is found). */ + if (direction == SWITCH_RTP_CRYPTO_SEND) { + memcpy(ssec->local_raw_key, key, SUITES[type].keysalt_len); + } else { + memcpy(ssec->remote_raw_key, key, SUITES[type].keysalt_len); + } + multiple_keys = true; + } + + p += keysalt_len; + + if (p < key_material_end) { /* Parse LIFETIME or MKI. */ + + if (opts) { /* if opts != NULL then opts points to first '|' in current key-material cadidate */ + + lifetime = 0; + mki_id = 0; + mki_size = 0; + + for (int i = 0; i < 2 && (*opts == '|'); ++i) { + + opt_field = parse_lifetime_mki(&opts, key_material_end); + + switch ((opt_field >> 24) & 0x3) { + + case CRYPTO_KEY_MATERIAL_LIFETIME: + + lifetime_base = ((opt_field & 0x00ffff00) >> 8) & 0xffff; + lifetime_exp = (opt_field & 0x000000ff) & 0xffff; + lifetime = pow(lifetime_base, lifetime_exp); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "LIFETIME found in %s, base %u exp %u\n", p, lifetime_base, lifetime_exp); + break; + + case CRYPTO_KEY_MATERIAL_MKI: + + mki_id = ((opt_field & 0x00ffff00) >> 8) & 0xffff; + mki_size = (opt_field & 0x000000ff) & 0xffff; + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "MKI found in %s, id %u size %u\n", p, mki_id, mki_size); + break; + + default: + goto bad_key_lifetime_or_mki; + } + } + + if (mki_id == 0 && lifetime == 0) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Bad MKI found in %s, (parsed as: id %u size %u lifetime base %u exp %u\n", p, mki_id, mki_size, lifetime_base, lifetime_exp); + return SWITCH_STATUS_FALSE; + } else if (mki_id == 0 || lifetime == 0) { + if (mki_id == 0) { + if (key_material) + goto bad_key_no_mki_index; + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Skipping MKI due to empty index\n"); + } else { + if (mki_size == 0) + goto bad_key_no_mki_size; + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Skipping MKI due to empty lifetime\n"); + } + continue; + } + } + + if (key_material) { + if (mki_id == 0) { + goto bad_key_no_mki_index; + } + + if (mki_size != key_material->mki_size) { + goto bad_key_mki_size; + } + } + + key_material = switch_core_media_crypto_append_key_material(session, key_material, method, (unsigned char*) key, + SUITES[type].keysalt_len, (char*) key_material_begin, key_material_end - key_material_begin, lifetime, mki_id, mki_size); + *key_material_n = *key_material_n + 1; + } + } + } while ((p = switch_strip_spaces((char*) key_material_end, 0)) && (*p != '\0')); + + if (direction == SWITCH_RTP_CRYPTO_SEND || direction == SWITCH_RTP_CRYPTO_SEND_RTCP) { + ssec->local_key_material_next = key_material; + } else { + ssec->remote_key_material_next = key_material; + } + + return SWITCH_STATUS_SUCCESS; } - bad: - - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error!\n"); +no_crypto_found: + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error! No crypto to parse\n"); return SWITCH_STATUS_FALSE; +bad_error_parsing_near: + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! Parsing near %s\n", p); + return SWITCH_STATUS_FALSE; + +bad_crypto: + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! SRTP: Invalid format of crypto attribute %s\n", key_param); + return SWITCH_STATUS_FALSE; + +bad_keysalt: + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! SRTP: Invalid keysalt in the crypto attribute %s\n", key_param); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! Parsing near %s\n", p); + return SWITCH_STATUS_FALSE; + +bad_keysalt_len: + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! SRTP: Invalid keysalt length in the crypto attribute %s\n", key_param); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! Parsing near %s\n", p); + return SWITCH_STATUS_FALSE; + +bad_key_lifetime_or_mki: + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! SRTP: Invalid key param MKI or LIFETIME in the crypto attribute %s\n", key_param); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! Parsing near %s\n", p); + return SWITCH_STATUS_FALSE; + +bad_key_no_mki_index: + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Crypto invalid: multiple keys in a single crypto MUST all have MKI indices, %s\n", key_param); + return SWITCH_STATUS_FALSE; + +bad_key_no_mki_size: + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Crypto invalid: MKI index with no MKI size in %s\n", key_param); + return SWITCH_STATUS_FALSE; + +bad_key_mki_size: + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Crypto invalid: MKI sizes differ in %s\n", key_param); + return SWITCH_STATUS_FALSE; + +bad_key_param_method: + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! SRTP: Invalid key param method type in %s\n", key_param); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error! Parsing near %s\n", p); + return SWITCH_STATUS_FALSE; } SWITCH_DECLARE(void) switch_core_media_set_rtp_session(switch_core_session_t *session, switch_media_type_t type, switch_rtp_t *rtp_session) @@ -1342,19 +1658,16 @@ static void switch_core_session_apply_crypto(switch_core_session_t *session, swi } if (engine->ssec[engine->crypto_type].remote_crypto_key && switch_channel_test_flag(session->channel, CF_SECURE)) { - switch_core_media_add_crypto(&engine->ssec[engine->crypto_type], engine->ssec[engine->crypto_type].remote_crypto_key, SWITCH_RTP_CRYPTO_RECV); + + if (switch_channel_get_variable(session->channel, "rtp_secure_media_mki")) + switch_core_media_add_crypto(session, &engine->ssec[engine->crypto_type], SWITCH_RTP_CRYPTO_SEND); + + switch_core_media_add_crypto(session, &engine->ssec[engine->crypto_type], SWITCH_RTP_CRYPTO_RECV); - switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_SEND, 1, - engine->ssec[engine->crypto_type].crypto_type, - engine->ssec[engine->crypto_type].local_raw_key, - SUITES[engine->ssec[engine->crypto_type].crypto_type].keylen); + switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_SEND, 1, &engine->ssec[engine->crypto_type]); - switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_RECV, - engine->ssec[engine->crypto_type].crypto_tag, - engine->ssec[engine->crypto_type].crypto_type, - engine->ssec[engine->crypto_type].remote_raw_key, - SUITES[engine->ssec[engine->crypto_type].crypto_type].keylen); + switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_RECV, engine->ssec[engine->crypto_type].crypto_tag, &engine->ssec[engine->crypto_type]); switch_channel_set_variable(session->channel, varname, "true"); @@ -1476,7 +1789,7 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio for (i = 0; smh->crypto_suite_order[i] != CRYPTO_INVALID; i++) { switch_rtp_crypto_key_type_t j = SUITES[smh->crypto_suite_order[i]].type; - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,"looking for crypto suite [%s] in [%s]\n", SUITES[j].name, crypto); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "looking for crypto suite [%s] in [%s]\n", SUITES[j].name, crypto); if (switch_stristr(SUITES[j].name, crypto)) { ctype = SUITES[j].type; @@ -1504,8 +1817,7 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio switch_channel_set_variable(session->channel, varname, vval); switch_core_media_build_crypto(session->media_handle, type, crypto_tag, ctype, SWITCH_RTP_CRYPTO_SEND, 1); - switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_SEND, atoi(crypto), engine->ssec[engine->crypto_type].crypto_type, - engine->ssec[engine->crypto_type].local_raw_key, SUITES[ctype].keylen); + switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_SEND, atoi(crypto), &engine->ssec[engine->crypto_type]); } if (a && b && !strncasecmp(a, b, 23)) { @@ -1532,9 +1844,8 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio if (switch_rtp_ready(engine->rtp_session) && switch_channel_test_flag(session->channel, CF_SECURE)) { - switch_core_media_add_crypto(&engine->ssec[engine->crypto_type], engine->ssec[engine->crypto_type].remote_crypto_key, SWITCH_RTP_CRYPTO_RECV); - switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_RECV, engine->ssec[engine->crypto_type].crypto_tag, - engine->ssec[engine->crypto_type].crypto_type, engine->ssec[engine->crypto_type].remote_raw_key, SUITES[engine->ssec[engine->crypto_type].crypto_type].keylen); + switch_core_media_add_crypto(session, &engine->ssec[engine->crypto_type], SWITCH_RTP_CRYPTO_RECV); + switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_RECV, engine->ssec[engine->crypto_type].crypto_tag, &engine->ssec[engine->crypto_type]); } got_crypto++; @@ -13415,20 +13726,13 @@ SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *s int idx = atoi(tmp); a_engine->ssec[a_engine->crypto_type].local_crypto_key = switch_core_session_strdup(session, tmp); - switch_core_media_add_crypto(&a_engine->ssec[a_engine->crypto_type], a_engine->ssec[a_engine->crypto_type].local_crypto_key, SWITCH_RTP_CRYPTO_SEND); - switch_core_media_add_crypto(&a_engine->ssec[a_engine->crypto_type], a_engine->ssec[a_engine->crypto_type].remote_crypto_key, SWITCH_RTP_CRYPTO_RECV); + switch_core_media_add_crypto(session, &a_engine->ssec[a_engine->crypto_type],SWITCH_RTP_CRYPTO_SEND); + switch_core_media_add_crypto(session, &a_engine->ssec[a_engine->crypto_type],SWITCH_RTP_CRYPTO_RECV); switch_channel_set_flag(smh->session->channel, CF_SECURE); - switch_rtp_add_crypto_key(a_engine->rtp_session, SWITCH_RTP_CRYPTO_SEND, idx, - a_engine->crypto_type, - a_engine->ssec[a_engine->crypto_type].local_raw_key, - SUITES[a_engine->crypto_type].keylen); + switch_rtp_add_crypto_key(a_engine->rtp_session, SWITCH_RTP_CRYPTO_SEND, idx, &a_engine->ssec[a_engine->crypto_type]); - switch_rtp_add_crypto_key(a_engine->rtp_session, SWITCH_RTP_CRYPTO_RECV, - a_engine->ssec[a_engine->crypto_type].crypto_tag, - a_engine->crypto_type, - a_engine->ssec[a_engine->crypto_type].remote_raw_key, - SUITES[a_engine->crypto_type].keylen); + switch_rtp_add_crypto_key(a_engine->rtp_session, SWITCH_RTP_CRYPTO_RECV, a_engine->ssec[a_engine->crypto_type].crypto_tag, &a_engine->ssec[a_engine->crypto_type]); } diff --git a/src/switch_rtp.c b/src/switch_rtp.c index a0efee7cf5..aed9aecdcc 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -2320,8 +2320,14 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session) #ifdef ENABLE_SRTP if (rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND]) { + int stat = 0; int sbytes = (int) rtcp_bytes; - int stat = srtp_protect_rtcp(rtp_session->send_ctx[rtp_session->srtp_idx_rtcp], &rtp_session->rtcp_send_msg.header, &sbytes); + + if (!rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI]) { + stat = srtp_protect_rtcp(rtp_session->send_ctx[rtp_session->srtp_idx_rtcp], &rtp_session->rtcp_send_msg.header, &sbytes); + } else { + stat = srtp_protect_rtcp_mki(rtp_session->send_ctx[rtp_session->srtp_idx_rtcp], &rtp_session->rtcp_send_msg.header, &sbytes, 1, SWITCH_CRYPTO_MKI_INDEX); + } if (stat) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Error: SRTP RTCP protection failed with code %d\n", stat); @@ -3067,18 +3073,27 @@ static const char *dtls_state_names(dtls_state_t s) return dtls_state_names_t[s]; } - #define dtls_set_state(_dtls, _state) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_INFO, "Changing %s DTLS state from %s to %s\n", rtp_type(rtp_session), dtls_state_names(_dtls->state), dtls_state_names(_state)); _dtls->new_state = 1; _dtls->last_state = _dtls->state; _dtls->state = _state -#define cr_keylen 16 -#define cr_saltlen 14 -#define cr_kslen 30 - static int dtls_state_setup(switch_rtp_t *rtp_session, switch_dtls_t *dtls) { X509 *cert; + switch_secure_settings_t ssec; /* Used just to wrap over params in a call to switch_rtp_add_crypto_key. */ int r = 0; + const switch_size_t cr_kslen = SUITES[AES_CM_128_HMAC_SHA1_80].keysalt_len; + const switch_size_t cr_saltlen = SUITES[AES_CM_128_HMAC_SHA1_80].salt_len; + const switch_size_t cr_keylen = cr_kslen - cr_saltlen; + + uint8_t raw_key_data[cr_kslen * 2]; + unsigned char local_key_buf[cr_kslen]; + unsigned char remote_key_buf[cr_kslen]; + + memset(&ssec, 0, sizeof(ssec)); + memset(&raw_key_data, 0, cr_kslen * 2 * sizeof(uint8_t)); + memset(&local_key_buf, 0, cr_kslen * sizeof(unsigned char)); + memset(&remote_key_buf, 0, cr_kslen * sizeof(unsigned char)); + if ((dtls->type & DTLS_TYPE_SERVER)) { r = 1; } else if ((cert = SSL_get_peer_certificate(dtls->ssl))) { @@ -3092,9 +3107,7 @@ static int dtls_state_setup(switch_rtp_t *rtp_session, switch_dtls_t *dtls) dtls_set_state(dtls, DS_FAIL); return -1; } else { - uint8_t raw_key_data[cr_kslen*2] = { 0 }; unsigned char *local_key, *remote_key, *local_salt, *remote_salt; - unsigned char local_key_buf[cr_kslen] = {0}, remote_key_buf[cr_kslen] = {0}; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_INFO, "%s Fingerprint Verified.\n", rtp_type(rtp_session)); @@ -3121,18 +3134,20 @@ static int dtls_state_setup(switch_rtp_t *rtp_session, switch_dtls_t *dtls) local_salt = remote_salt + cr_saltlen; } - memcpy(local_key_buf, local_key, cr_keylen); - memcpy(local_key_buf + cr_keylen, local_salt, cr_saltlen); + memcpy(&ssec.local_raw_key, local_key, cr_keylen); + memcpy(&ssec.local_raw_key + cr_keylen, local_salt, cr_saltlen); - memcpy(remote_key_buf, remote_key, cr_keylen); - memcpy(remote_key_buf + cr_keylen, remote_salt, cr_saltlen); + memcpy(&ssec.remote_raw_key, remote_key, cr_keylen); + memcpy(&ssec.remote_raw_key + cr_keylen, remote_salt, cr_saltlen); + + ssec.crypto_type = AES_CM_128_HMAC_SHA1_80; if (dtls == rtp_session->rtcp_dtls && rtp_session->rtcp_dtls != rtp_session->dtls) { - switch_rtp_add_crypto_key(rtp_session, SWITCH_RTP_CRYPTO_SEND_RTCP, 0, AES_CM_128_HMAC_SHA1_80, local_key_buf, cr_kslen); - switch_rtp_add_crypto_key(rtp_session, SWITCH_RTP_CRYPTO_RECV_RTCP, 0, AES_CM_128_HMAC_SHA1_80, remote_key_buf, cr_kslen); + switch_rtp_add_crypto_key(rtp_session, SWITCH_RTP_CRYPTO_SEND_RTCP, 0, &ssec); + switch_rtp_add_crypto_key(rtp_session, SWITCH_RTP_CRYPTO_RECV_RTCP, 0, &ssec); } else { - switch_rtp_add_crypto_key(rtp_session, SWITCH_RTP_CRYPTO_SEND, 0, AES_CM_128_HMAC_SHA1_80, local_key_buf, cr_kslen); - switch_rtp_add_crypto_key(rtp_session, SWITCH_RTP_CRYPTO_RECV, 0, AES_CM_128_HMAC_SHA1_80, remote_key_buf, cr_kslen); + switch_rtp_add_crypto_key(rtp_session, SWITCH_RTP_CRYPTO_SEND, 0, &ssec); + switch_rtp_add_crypto_key(rtp_session, SWITCH_RTP_CRYPTO_RECV, 0, &ssec); } } @@ -3814,15 +3829,13 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_dtls(switch_rtp_t *rtp_session, d } - -SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_session, - switch_rtp_crypto_direction_t direction, - uint32_t index, switch_rtp_crypto_key_type_t type, unsigned char *key, switch_size_t keylen) +SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_session, switch_rtp_crypto_direction_t direction, uint32_t index, switch_secure_settings_t *ssec) { #ifndef ENABLE_SRTP switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_CRIT, "SRTP NOT SUPPORTED IN THIS BUILD!\n"); return SWITCH_STATUS_FALSE; #else + switch_rtp_crypto_key_t *crypto_key; srtp_policy_t *policy; srtp_err_status_t stat; @@ -3833,12 +3846,43 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess int idx = 0; const char *var; unsigned char b64_key[512] = ""; + + unsigned char *keysalt = NULL; + switch_size_t keysalt_len = 0; + + switch_crypto_key_material_t *key_material = NULL; + unsigned long *key_material_n = NULL; + srtp_master_key_t **mkis = NULL; + srtp_master_key_t *mki = NULL; + int mki_idx = 0; - if (direction >= SWITCH_RTP_CRYPTO_MAX || keylen > SWITCH_RTP_MAX_CRYPTO_LEN) { + keysalt_len = SUITES[ssec->crypto_type].keysalt_len; + + if (direction >= SWITCH_RTP_CRYPTO_MAX || keysalt_len > SWITCH_RTP_MAX_CRYPTO_LEN) { return SWITCH_STATUS_FALSE; } - switch_b64_encode(key, keylen, b64_key, sizeof(b64_key)); + if (direction == SWITCH_RTP_CRYPTO_RECV_RTCP) { + direction = SWITCH_RTP_CRYPTO_RECV; + rtp_session->srtp_idx_rtcp = idx = 1; + } else if (direction == SWITCH_RTP_CRYPTO_SEND_RTCP) { + direction = SWITCH_RTP_CRYPTO_SEND; + rtp_session->srtp_idx_rtcp = idx = 1; + } + + if (direction == SWITCH_RTP_CRYPTO_RECV) { + policy = &rtp_session->recv_policy[idx]; + keysalt = ssec->remote_raw_key; + key_material = ssec->remote_key_material_next; + key_material_n = &ssec->remote_key_material_n; + } else { + policy = &rtp_session->send_policy[idx]; + keysalt = ssec->local_raw_key; + key_material = ssec->local_key_material_next; + key_material_n = &ssec->local_key_material_n; + } + + switch_b64_encode(keysalt, keysalt_len, b64_key, sizeof(b64_key)); if (switch_true(switch_core_get_variable("rtp_retain_crypto_keys"))) { switch(direction) { @@ -3861,23 +3905,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess crypto_key = switch_core_alloc(rtp_session->pool, sizeof(*crypto_key)); - if (direction == SWITCH_RTP_CRYPTO_RECV_RTCP) { - direction = SWITCH_RTP_CRYPTO_RECV; - rtp_session->srtp_idx_rtcp = idx = 1; - } else if (direction == SWITCH_RTP_CRYPTO_SEND_RTCP) { - direction = SWITCH_RTP_CRYPTO_SEND; - rtp_session->srtp_idx_rtcp = idx = 1; - } - - if (direction == SWITCH_RTP_CRYPTO_RECV) { - policy = &rtp_session->recv_policy[idx]; - } else { - policy = &rtp_session->send_policy[idx]; - } - - crypto_key->type = type; + crypto_key->type = ssec->crypto_type; crypto_key->index = index; - memcpy(crypto_key->key, key, keylen); + memcpy(crypto_key->keysalt, keysalt, keysalt_len); crypto_key->next = rtp_session->crypto_keys[direction]; rtp_session->crypto_keys[direction] = crypto_key; @@ -3947,7 +3977,68 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess break; } - policy->key = (uint8_t *) crypto_key->key; + /* Setup the policy with MKI if they are used. Number of key materials must be positive to use MKI. */ + if (key_material && (*key_material_n > 0)) { + + if (direction == SWITCH_RTP_CRYPTO_RECV) { + rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_MKI] = 1; + } else { + rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI] = 1; + } + + /* key must be NULL for libsrtp to work correctly with MKI. */ + policy->key = NULL; + + /* Allocate array for MKIs. */ + mkis = switch_core_alloc(rtp_session->pool, *key_material_n * sizeof(srtp_master_key_t*)); + if (!mkis) { + return SWITCH_STATUS_FALSE; + } + + /* Build array of MKIs. */ + mki_idx = 0; + + while (key_material && (mki_idx < *key_material_n)) { + + if (key_material->mki_size < 1) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "MKI bad key size at MKI %d\n", mki_idx); + return SWITCH_STATUS_FALSE; + } + + mki = switch_core_alloc(rtp_session->pool, sizeof(srtp_master_key_t)); + if (!mki) { + return SWITCH_STATUS_FALSE; + } + + /* Setup MKI. */ + mki->mki_id = switch_core_alloc(rtp_session->pool, sizeof(key_material->mki_size)); + if (!mki->mki_id) { + return SWITCH_STATUS_FALSE; + } + + mki->key = switch_core_alloc(rtp_session->pool, keysalt_len); + if (!mki->key) { + return SWITCH_STATUS_FALSE; + } + + memcpy(mki->mki_id, &key_material->mki_id, key_material->mki_size); + mki->mki_size = key_material->mki_size; + memcpy(mki->key, key_material->raw_key, keysalt_len); + + mkis[mki_idx] = mki; + + key_material = key_material->next; + ++mki_idx; + } + + /* And pass the array of MKIs to libsrtp. */ + policy->keys = mkis; + policy->num_master_keys = mki_idx; + + } else { + policy->key = (uint8_t *) crypto_key->keysalt; + } + policy->next = NULL; policy->window_size = 1024; @@ -3968,8 +4059,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess } if (status == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_INFO, "Activating %s Secure %s RECV\n", - rtp_type(rtp_session), idx ? "RTCP" : "RTP"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_INFO, "Activating %s Secure %s RECV%s\n", + rtp_type(rtp_session), idx ? "RTCP" : "RTP", rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_MKI] ? " (with MKI)" : ""); rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV] = 1; } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Error allocating srtp [%d]\n", stat); @@ -3990,8 +4081,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess } if (status == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_INFO, "Activating %s Secure %s SEND\n", - rtp_type(rtp_session), idx ? "RTCP" : "RTP"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_INFO, "Activating %s Secure %s SEND%s\n", + rtp_type(rtp_session), idx ? "RTCP" : "RTP", rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI] ? " (with MKI)" : ""); rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND] = 1; } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Error allocating SRTP [%d]\n", stat); @@ -5779,8 +5870,13 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t int sbytes = (int) *bytes; srtp_err_status_t stat = 0; + if (!rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_MKI]) { + stat = srtp_unprotect_rtcp(rtp_session->recv_ctx[rtp_session->srtp_idx_rtcp], &rtp_session->rtcp_recv_msg_p->header, &sbytes); + } else { + stat = srtp_unprotect_rtcp_mki(rtp_session->recv_ctx[rtp_session->srtp_idx_rtcp], &rtp_session->rtcp_recv_msg_p->header, &sbytes, 1); + } - if ((stat = srtp_unprotect_rtcp(rtp_session->recv_ctx[rtp_session->srtp_idx_rtcp], &rtp_session->rtcp_recv_msg_p->header, &sbytes))) { + if (stat) { //++rtp_session->srtp_errs[rtp_session->srtp_idx_rtp]++; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "RTCP UNPROTECT ERR\n"); } else { @@ -5974,7 +6070,14 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t } if (!(*flags & SFF_PLC) && rtp_session->recv_ctx[rtp_session->srtp_idx_rtp]) { - stat = srtp_unprotect(rtp_session->recv_ctx[rtp_session->srtp_idx_rtp], &rtp_session->recv_msg.header, &sbytes); + stat = 0; + + if (!rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_MKI]) { + stat = srtp_unprotect(rtp_session->recv_ctx[rtp_session->srtp_idx_rtp], &rtp_session->recv_msg.header, &sbytes); + } else { + stat = srtp_unprotect_mki(rtp_session->recv_ctx[rtp_session->srtp_idx_rtp], &rtp_session->recv_msg.header, &sbytes, 1); + } + if (rtp_session->flags[SWITCH_RTP_FLAG_NACK] && stat == srtp_err_status_replay_fail) { /* false alarm nack */ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG1, "REPLAY ERR, FALSE NACK\n"); @@ -6742,7 +6845,13 @@ static switch_status_t read_rtcp_packet(switch_rtp_t *rtp_session, switch_size_t srtp_err_status_t stat = 0; - if ((stat = srtp_unprotect_rtcp(rtp_session->recv_ctx[rtp_session->srtp_idx_rtcp], &rtp_session->rtcp_recv_msg_p->header, &sbytes))) { + if (!rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_MKI]) { + stat = srtp_unprotect_rtcp(rtp_session->recv_ctx[rtp_session->srtp_idx_rtcp], &rtp_session->rtcp_recv_msg_p->header, &sbytes); + } else { + stat = srtp_unprotect_rtcp_mki(rtp_session->recv_ctx[rtp_session->srtp_idx_rtcp], &rtp_session->rtcp_recv_msg_p->header, &sbytes, 1); + } + + if (stat) { //++rtp_session->srtp_errs[rtp_session->srtp_idx_rtp]++; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "RTCP UNPROTECT ERR\n"); } else { @@ -7191,8 +7300,15 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ #ifdef ENABLE_SRTP if (switch_rtp_test_flag(other_rtp_session, SWITCH_RTP_FLAG_SECURE_SEND)) { + int stat = 0; int sbytes = (int) rtcp_bytes; - int stat = srtp_protect_rtcp(other_rtp_session->send_ctx[rtp_session->srtp_idx_rtcp], &other_rtp_session->rtcp_send_msg.header, &sbytes); + + if (!other_rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI]) { + stat = srtp_protect_rtcp(other_rtp_session->send_ctx[rtp_session->srtp_idx_rtcp], &other_rtp_session->rtcp_send_msg.header, &sbytes); + } else { + stat = srtp_protect_rtcp_mki(other_rtp_session->send_ctx[other_rtp_session->srtp_idx_rtcp], &other_rtp_session->rtcp_send_msg.header, &sbytes, 1, SWITCH_CRYPTO_MKI_INDEX); + } + if (stat) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Error: SRTP RTCP protection failed with code %d\n", stat); } @@ -8234,8 +8350,11 @@ static int rtp_common_write(switch_rtp_t *rtp_session, } } - - stat = srtp_protect(rtp_session->send_ctx[rtp_session->srtp_idx_rtp], &send_msg->header, &sbytes); + if (!rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI]) { + stat = srtp_protect(rtp_session->send_ctx[rtp_session->srtp_idx_rtp], &send_msg->header, &sbytes); + } else { + stat = srtp_protect_mki(rtp_session->send_ctx[rtp_session->srtp_idx_rtp], &send_msg->header, &sbytes, 1, SWITCH_CRYPTO_MKI_INDEX); + } if (stat) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, @@ -8820,7 +8939,12 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_write_raw(switch_rtp_t *rtp_session, } } - stat = srtp_protect(rtp_session->send_ctx[rtp_session->srtp_idx_rtp], &rtp_session->write_msg.header, &sbytes); + if (!rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI]) { + stat = srtp_protect(rtp_session->send_ctx[rtp_session->srtp_idx_rtp], &rtp_session->write_msg.header, &sbytes); + } else { + stat = srtp_protect_mki(rtp_session->send_ctx[rtp_session->srtp_idx_rtp], &rtp_session->write_msg.header, &sbytes, 1, SWITCH_CRYPTO_MKI_INDEX); + } + if (stat) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Error: SRTP protection failed with code %d\n", stat); } diff --git a/src/switch_utils.c b/src/switch_utils.c index a32a9396b2..0b480fcbea 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -955,12 +955,13 @@ SWITCH_DECLARE(switch_status_t) switch_b64_encode(unsigned char *in, switch_size return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_size_t) switch_b64_decode(char *in, char *out, switch_size_t olen) +SWITCH_DECLARE(switch_size_t) switch_b64_decode(const char *in, char *out, switch_size_t olen) { char l64[256]; int b = 0, c, l = 0, i; - char *ip, *op = out; + const char *ip; + char *op = out; size_t ol = 0; for (i = 0; i < 256; i++) { From 477f3bc549bf67acc5b3647044b2fa47768e3c9b Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Fri, 1 Dec 2017 15:10:50 -0600 Subject: [PATCH 061/264] FS-10778: fix MKI compile error --- src/switch_core_media.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 6ba0f6cf53..032ce46cbd 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -1350,7 +1350,7 @@ switch_status_t switch_core_media_add_crypto(switch_core_session_t *session, swi const char *p, *delimit; const char *key_material_begin; - const char *key_material_end; /* begin and end of the current key material candidate */ + const char *key_material_end = NULL; /* begin and end of the current key material candidate */ int method_len; int keysalt_len; From b0106ac17fcb8bd515dacbd04ffe433f158371b4 Mon Sep 17 00:00:00 2001 From: Piotr Date: Mon, 4 Dec 2017 15:22:43 +0000 Subject: [PATCH 062/264] FS-10778: Fix compilation and refactor code Prefer break over indent. if (!p) { break; } // the code... over if (p) { // the // code // ... } --- src/switch_core_media.c | 300 ++++++++++++++++++++-------------------- 1 file changed, 153 insertions(+), 147 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 032ce46cbd..83af54f9cc 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -1388,155 +1388,161 @@ switch_status_t switch_core_media_add_crypto(switch_core_session_t *session, swi p = strchr(key_param, ' '); - if (p && *p && *(p + 1)) { - p++; - - type = switch_core_media_crypto_str2type(p); - - if (type == CRYPTO_INVALID) { - goto bad_crypto; - } - - p = strchr(p, ' '); /* skip the crypto suite description */ - if (p == NULL) { - goto bad_crypto; - } - - do { - if (*key_material_n == SWITCH_CRYPTO_MKI_MAX) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Skipping excess of MKIs due to max number of suppoerted MKIs %d exceeded\n", SWITCH_CRYPTO_MKI_MAX); - break; - } - - p = switch_strip_spaces((char*) p, 0); - if (p) { - key_material_begin = p; - key_material_end = switch_core_media_crypto_find_key_material_candidate_end(p); - - /* Parsing the key material candidate within [begin, end). */ - - if ((delimit = strchr(p, ':')) == NULL) { - goto bad_error_parsing_near; - } - - method_len = delimit - p; - - if (strncasecmp(p, CRYPTO_KEY_PARAM_METHOD[CRYPTO_KEY_PARAM_METHOD_INLINE], method_len)) { - goto bad_key_param_method; - } - - method = CRYPTO_KEY_PARAM_METHOD_INLINE; - - /* Valid key-material found. Save as default key in secure_settings_s. */ - - p = delimit + 1; /* skip ':' */ - if (!(p && *p && *(p + 1))) { - goto bad_keysalt; - } - - /* Check if '|' is present in currently considered key-material. */ - if ((opts = strchr(p, '|')) && (opts < key_material_end)) { - keysalt_len = opts - p; - } else { - keysalt_len = key_material_end - p; - } - - if (keysalt_len > sizeof(key)) { - goto bad_keysalt_len; - } - - switch_b64_decode(p, (char *) key, keysalt_len); - - if (!multiple_keys) { /* First key becomes default (used in case no MKI is found). */ - if (direction == SWITCH_RTP_CRYPTO_SEND) { - memcpy(ssec->local_raw_key, key, SUITES[type].keysalt_len); - } else { - memcpy(ssec->remote_raw_key, key, SUITES[type].keysalt_len); - } - multiple_keys = true; - } - - p += keysalt_len; - - if (p < key_material_end) { /* Parse LIFETIME or MKI. */ - - if (opts) { /* if opts != NULL then opts points to first '|' in current key-material cadidate */ - - lifetime = 0; - mki_id = 0; - mki_size = 0; - - for (int i = 0; i < 2 && (*opts == '|'); ++i) { - - opt_field = parse_lifetime_mki(&opts, key_material_end); - - switch ((opt_field >> 24) & 0x3) { - - case CRYPTO_KEY_MATERIAL_LIFETIME: - - lifetime_base = ((opt_field & 0x00ffff00) >> 8) & 0xffff; - lifetime_exp = (opt_field & 0x000000ff) & 0xffff; - lifetime = pow(lifetime_base, lifetime_exp); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "LIFETIME found in %s, base %u exp %u\n", p, lifetime_base, lifetime_exp); - break; - - case CRYPTO_KEY_MATERIAL_MKI: - - mki_id = ((opt_field & 0x00ffff00) >> 8) & 0xffff; - mki_size = (opt_field & 0x000000ff) & 0xffff; - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "MKI found in %s, id %u size %u\n", p, mki_id, mki_size); - break; - - default: - goto bad_key_lifetime_or_mki; - } - } - - if (mki_id == 0 && lifetime == 0) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Bad MKI found in %s, (parsed as: id %u size %u lifetime base %u exp %u\n", p, mki_id, mki_size, lifetime_base, lifetime_exp); - return SWITCH_STATUS_FALSE; - } else if (mki_id == 0 || lifetime == 0) { - if (mki_id == 0) { - if (key_material) - goto bad_key_no_mki_index; - - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Skipping MKI due to empty index\n"); - } else { - if (mki_size == 0) - goto bad_key_no_mki_size; - - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Skipping MKI due to empty lifetime\n"); - } - continue; - } - } - - if (key_material) { - if (mki_id == 0) { - goto bad_key_no_mki_index; - } - - if (mki_size != key_material->mki_size) { - goto bad_key_mki_size; - } - } - - key_material = switch_core_media_crypto_append_key_material(session, key_material, method, (unsigned char*) key, - SUITES[type].keysalt_len, (char*) key_material_begin, key_material_end - key_material_begin, lifetime, mki_id, mki_size); - *key_material_n = *key_material_n + 1; - } - } - } while ((p = switch_strip_spaces((char*) key_material_end, 0)) && (*p != '\0')); - - if (direction == SWITCH_RTP_CRYPTO_SEND || direction == SWITCH_RTP_CRYPTO_SEND_RTCP) { - ssec->local_key_material_next = key_material; - } else { - ssec->remote_key_material_next = key_material; - } - - return SWITCH_STATUS_SUCCESS; + if (!(p && *p && *(p + 1))) { + goto no_crypto_found; } + p++; + + type = switch_core_media_crypto_str2type(p); + + if (type == CRYPTO_INVALID) { + goto bad_crypto; + } + + p = strchr(p, ' '); /* skip the crypto suite description */ + if (p == NULL) { + goto bad_crypto; + } + + do { + if (*key_material_n == SWITCH_CRYPTO_MKI_MAX) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Skipping excess of MKIs due to max number of suppoerted MKIs %d exceeded\n", SWITCH_CRYPTO_MKI_MAX); + break; + } + + p = switch_strip_spaces((char*) p, 0); + if (!p) { + break; + } + + key_material_begin = p; + key_material_end = switch_core_media_crypto_find_key_material_candidate_end(p); + + /* Parsing the key material candidate within [begin, end). */ + + if ((delimit = strchr(p, ':')) == NULL) { + goto bad_error_parsing_near; + } + + method_len = delimit - p; + + if (strncasecmp(p, CRYPTO_KEY_PARAM_METHOD[CRYPTO_KEY_PARAM_METHOD_INLINE], method_len)) { + goto bad_key_param_method; + } + + method = CRYPTO_KEY_PARAM_METHOD_INLINE; + + /* Valid key-material found. Save as default key in secure_settings_s. */ + + p = delimit + 1; /* skip ':' */ + if (!(p && *p && *(p + 1))) { + goto bad_keysalt; + } + + /* Check if '|' is present in currently considered key-material. */ + if ((opts = strchr(p, '|')) && (opts < key_material_end)) { + keysalt_len = opts - p; + } else { + keysalt_len = key_material_end - p; + } + + if (keysalt_len > sizeof(key)) { + goto bad_keysalt_len; + } + + switch_b64_decode(p, (char *) key, keysalt_len); + + if (!multiple_keys) { /* First key becomes default (used in case no MKI is found). */ + if (direction == SWITCH_RTP_CRYPTO_SEND) { + memcpy(ssec->local_raw_key, key, SUITES[type].keysalt_len); + } else { + memcpy(ssec->remote_raw_key, key, SUITES[type].keysalt_len); + } + multiple_keys = true; + } + + p += keysalt_len; + + if (!(p < key_material_end)) { + continue; + } + + if (opts) { /* if opts != NULL then opts points to first '|' in current key-material cadidate, parse it as LIFETIME or MKI */ + + lifetime = 0; + mki_id = 0; + mki_size = 0; + + for (int i = 0; i < 2 && (*opts == '|'); ++i) { + + opt_field = parse_lifetime_mki(&opts, key_material_end); + + switch ((opt_field >> 24) & 0x3) { + + case CRYPTO_KEY_MATERIAL_LIFETIME: + + lifetime_base = ((opt_field & 0x00ffff00) >> 8) & 0xffff; + lifetime_exp = (opt_field & 0x000000ff) & 0xffff; + lifetime = pow(lifetime_base, lifetime_exp); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "LIFETIME found in %s, base %u exp %u\n", p, lifetime_base, lifetime_exp); + break; + + case CRYPTO_KEY_MATERIAL_MKI: + + mki_id = ((opt_field & 0x00ffff00) >> 8) & 0xffff; + mki_size = (opt_field & 0x000000ff) & 0xffff; + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "MKI found in %s, id %u size %u\n", p, mki_id, mki_size); + break; + + default: + goto bad_key_lifetime_or_mki; + } + } + + if (mki_id == 0 && lifetime == 0) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Bad MKI found in %s, (parsed as: id %u size %u lifetime base %u exp %u\n", p, mki_id, mki_size, lifetime_base, lifetime_exp); + return SWITCH_STATUS_FALSE; + } else if (mki_id == 0 || lifetime == 0) { + if (mki_id == 0) { + if (key_material) + goto bad_key_no_mki_index; + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Skipping MKI due to empty index\n"); + } else { + if (mki_size == 0) + goto bad_key_no_mki_size; + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Skipping MKI due to empty lifetime\n"); + } + continue; + } + } + + if (key_material) { + if (mki_id == 0) { + goto bad_key_no_mki_index; + } + + if (mki_size != key_material->mki_size) { + goto bad_key_mki_size; + } + } + + key_material = switch_core_media_crypto_append_key_material(session, key_material, method, (unsigned char*) key, + SUITES[type].keysalt_len, (char*) key_material_begin, key_material_end - key_material_begin, lifetime, mki_id, mki_size); + *key_material_n = *key_material_n + 1; + } while ((p = switch_strip_spaces((char*) key_material_end, 0)) && (*p != '\0')); + + if (direction == SWITCH_RTP_CRYPTO_SEND || direction == SWITCH_RTP_CRYPTO_SEND_RTCP) { + ssec->local_key_material_next = key_material; + } else { + ssec->remote_key_material_next = key_material; + } + + return SWITCH_STATUS_SUCCESS; + + no_crypto_found: switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error! No crypto to parse\n"); return SWITCH_STATUS_FALSE; From 67b56343a2912eb118c2be9b84c44c0306e1730b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 4 Dec 2017 13:29:59 -0600 Subject: [PATCH 063/264] FS-10823: [mod_sofia] curly brackets on SDP header causes FS to crash #resolve --- src/mod/endpoints/mod_sofia/mod_sofia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 439aed2718..72acad91d1 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -856,7 +856,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) switch_core_media_prepare_codecs(tech_pvt->session, SWITCH_TRUE); - if (sofia_media_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { + if (zstr(r_sdp) || sofia_media_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR"); //switch_mutex_lock(tech_pvt->sofia_mutex); //nua_respond(tech_pvt->nh, SIP_488_NOT_ACCEPTABLE, TAG_END()); From a17993a22eb98b92d2464decb8713a10953ff506 Mon Sep 17 00:00:00 2001 From: Piotr Date: Tue, 5 Dec 2017 15:34:52 +0000 Subject: [PATCH 064/264] FS-10778: Evaluate rtp_secure_media_mki variable with switch_channel_var_true Previously rtp_secure_media_mki channel variable was checked only for existence, now it is checked if it's defined and evaluates to true with switch_channel_var_true(). --- src/switch_core_media.c | 4 ++-- src/switch_rtp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 83af54f9cc..12e8ae812e 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -1189,7 +1189,7 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh if (index == SWITCH_NO_CRYPTO_TAG) index = ctype + 1; - if (switch_channel_get_variable(channel, "rtp_secure_media_mki")) { + if (switch_channel_var_true(channel, "rtp_secure_media_mki")) { engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s|2^31|1:1", index, SUITES[ctype].name, b64_key); } else { engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s", index, SUITES[ctype].name, b64_key); @@ -1665,7 +1665,7 @@ static void switch_core_session_apply_crypto(switch_core_session_t *session, swi if (engine->ssec[engine->crypto_type].remote_crypto_key && switch_channel_test_flag(session->channel, CF_SECURE)) { - if (switch_channel_get_variable(session->channel, "rtp_secure_media_mki")) + if (switch_channel_var_true(session->channel, "rtp_secure_media_mki")) switch_core_media_add_crypto(session, &engine->ssec[engine->crypto_type], SWITCH_RTP_CRYPTO_SEND); switch_core_media_add_crypto(session, &engine->ssec[engine->crypto_type], SWITCH_RTP_CRYPTO_RECV); diff --git a/src/switch_rtp.c b/src/switch_rtp.c index aed9aecdcc..801a3e9053 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -3981,9 +3981,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess if (key_material && (*key_material_n > 0)) { if (direction == SWITCH_RTP_CRYPTO_RECV) { - rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_MKI] = 1; + rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_MKI] = 1; /* tell the rest of the environment MKI is used */ } else { - rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI] = 1; + rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI] = 1; /* tell the rest of the environment MKI is used */ } /* key must be NULL for libsrtp to work correctly with MKI. */ From 63f3531cdd4048e2d0d90ce22f8a28290963cb32 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 13 Dec 2017 16:23:27 -0600 Subject: [PATCH 065/264] FS-10843: [freeswitch-core] Tweak RTP write timing #resolve --- src/switch_rtp.c | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 801a3e9053..1e86eae83c 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -377,6 +377,7 @@ struct switch_rtp { switch_rtp_invalid_handler_t invalid_handler; void *private_data; uint32_t ts; + //uint32_t last_clock_ts; uint32_t last_write_ts; uint32_t last_read_ts; uint32_t last_cng_ts; @@ -1518,16 +1519,8 @@ static uint8_t get_next_write_ts(switch_rtp_t *rtp_session, uint32_t timestamp) if (timestamp) { rtp_session->ts = (uint32_t) timestamp; changed++; - /* Send marker bit if timestamp is lower/same as before (resetted/new timer) */ - if (abs((int32_t)(rtp_session->ts - rtp_session->last_write_ts)) > rtp_session->samples_per_interval - && !(rtp_session->rtp_bugs & RTP_BUG_NEVER_SEND_MARKER)) { - m++; - } } else if (switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { - switch_core_timer_sync(&rtp_session->write_timer); - if (rtp_session->last_write_ts == rtp_session->write_timer.samplecount) { - switch_core_timer_step(&rtp_session->write_timer); - } + switch_core_timer_next(&rtp_session->write_timer); rtp_session->ts = rtp_session->write_timer.samplecount; changed++; } @@ -1535,6 +1528,12 @@ static uint8_t get_next_write_ts(switch_rtp_t *rtp_session, uint32_t timestamp) if (!changed) { rtp_session->ts = rtp_session->last_write_ts + rtp_session->samples_per_interval; + } else { + /* Send marker bit if timestamp is lower/same as before (resetted/new timer) */ + if (abs((int32_t)(rtp_session->ts - rtp_session->last_write_ts)) > rtp_session->samples_per_interval + && !(rtp_session->rtp_bugs & RTP_BUG_NEVER_SEND_MARKER)) { + m++; + } } return m; @@ -2020,10 +2019,6 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session) int rate = 0, nack_ttl = 0; uint32_t cur_nack[MAX_NACK] = { 0 }; - if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) { - switch_core_timer_sync(&rtp_session->write_timer); - } - if (!rtp_session->flags[SWITCH_RTP_FLAG_UDPTL] && rtp_session->flags[SWITCH_RTP_FLAG_AUTO_CNG] && rtp_session->send_msg.header.ts && @@ -4154,7 +4149,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_change_interval(switch_rtp_t *rtp_ses switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG, "RE-Starting timer [%s] %d bytes per %dms\n", rtp_session->timer_name, samples_per_interval, ms_per_packet / 1000); - switch_core_timer_init(&rtp_session->write_timer, rtp_session->timer_name, ms_per_packet / 1000, samples_per_interval, rtp_session->pool); + switch_core_timer_init(&rtp_session->write_timer, rtp_session->timer_name, (ms_per_packet / 1000), samples_per_interval, rtp_session->pool); } else { memset(&rtp_session->timer, 0, sizeof(rtp_session->timer)); @@ -4279,7 +4274,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session if (switch_core_timer_init(&rtp_session->timer, timer_name, ms_per_packet / 1000, samples_per_interval, pool) == SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG, "Starting timer [%s] %d bytes per %dms\n", timer_name, samples_per_interval, ms_per_packet / 1000); - switch_core_timer_init(&rtp_session->write_timer, timer_name, ms_per_packet / 1000, samples_per_interval, pool); + switch_core_timer_init(&rtp_session->write_timer, timer_name, (ms_per_packet / 1000), samples_per_interval, pool); #ifdef DEBUG_TS_ROLLOVER rtp_session->timer.tick = TS_ROLLOVER_START / samples_per_interval; #endif @@ -5261,7 +5256,7 @@ static void do_2833(switch_rtp_t *rtp_session) if (!rtp_session->last_write_ts) { if (rtp_session->timer.timer_interface) { - switch_core_timer_sync(&rtp_session->write_timer); + //switch_core_timer_sync(&rtp_session->write_timer); rtp_session->last_write_ts = rtp_session->write_timer.samplecount; } else { rtp_session->last_write_ts = rtp_session->samples_per_interval; @@ -5312,7 +5307,7 @@ static void do_2833(switch_rtp_t *rtp_session) rtp_session->need_mark = 1; if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) { - switch_core_timer_sync(&rtp_session->write_timer); + //switch_core_timer_sync(&rtp_session->write_timer); rtp_session->last_write_samplecount = rtp_session->write_timer.samplecount; } @@ -5330,7 +5325,7 @@ static void do_2833(switch_rtp_t *rtp_session) void *pop; if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) { - switch_core_timer_sync(&rtp_session->write_timer); + //switch_core_timer_sync(&rtp_session->write_timer); if (rtp_session->write_timer.samplecount < rtp_session->next_write_samplecount) { return; } @@ -8002,7 +7997,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, WRITE_INC(rtp_session); if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) { - switch_core_timer_sync(&rtp_session->write_timer); + //switch_core_timer_sync(&rtp_session->write_timer); } if (send_msg) { @@ -8056,7 +8051,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, } if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) { - switch_core_timer_sync(&rtp_session->write_timer); + //switch_core_timer_sync(&rtp_session->write_timer); } if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER] && @@ -8502,7 +8497,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session, } if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) { - switch_core_timer_sync(&rtp_session->write_timer); + //switch_core_timer_sync(&rtp_session->write_timer); rtp_session->last_write_samplecount = rtp_session->write_timer.samplecount; } From 03d8aa4e9a72191638bc4850209c1b80bfb43960 Mon Sep 17 00:00:00 2001 From: Piotr Gregor Date: Wed, 20 Dec 2017 18:31:50 +0000 Subject: [PATCH 066/264] FS-10853: Fix failed build for mod_dingaling Fixes build but must be tested at runtime. --- src/include/switch_core_media.h | 4 ++- .../endpoints/mod_dingaling/mod_dingaling.c | 25 +++++++++---------- src/switch_core_media.c | 8 +++++- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/include/switch_core_media.h b/src/include/switch_core_media.h index cf9b321655..1c73c2367a 100644 --- a/src/include/switch_core_media.h +++ b/src/include/switch_core_media.h @@ -210,6 +210,7 @@ SWITCH_DECLARE(void) switch_core_media_set_rtp_session(switch_core_session_t *se SWITCH_DECLARE(const char *)switch_core_media_get_codec_string(switch_core_session_t *session); SWITCH_DECLARE(void) switch_core_media_parse_rtp_bugs(switch_rtp_bug_flag_t *flag_pole, const char *str); +SWITCH_DECLARE(switch_status_t) switch_core_media_add_crypto(switch_core_session_t *session, switch_secure_settings_t *ssec, switch_rtp_crypto_direction_t direction); SWITCH_DECLARE(switch_t38_options_t *) switch_core_media_extract_t38_options(switch_core_session_t *session, const char *r_sdp); SWITCH_DECLARE(void) switch_core_media_pass_zrtp_hash(switch_core_session_t *session); SWITCH_DECLARE(const char *) switch_core_media_get_zrtp_hash(switch_core_session_t *session, switch_media_type_t type, switch_bool_t local); @@ -309,7 +310,8 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se SWITCH_DECLARE(switch_status_t) switch_core_media_check_autoadj(switch_core_session_t *session); SWITCH_DECLARE(switch_rtp_crypto_key_type_t) switch_core_media_crypto_str2type(const char *str); SWITCH_DECLARE(const char *) switch_core_media_crypto_type2str(switch_rtp_crypto_key_type_t type); -SWITCH_DECLARE(int) switch_core_media_crypto_keylen(switch_rtp_crypto_key_type_t type); +SWITCH_DECLARE(int) switch_core_media_crypto_keysalt_len(switch_rtp_crypto_key_type_t type); +SWITCH_DECLARE(int) switch_core_media_crypto_salt_len(switch_rtp_crypto_key_type_t type); SWITCH_DECLARE(char *) switch_core_media_filter_sdp(const char *sdp, const char *cmd, const char *arg); SWITCH_DECLARE(char *) switch_core_media_process_sdp_filter(const char *sdp, const char *cmd_buf, switch_core_session_t *session); diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index 898b21345f..2717190355 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -255,7 +255,6 @@ struct rfc2833_digit { int duration; }; - SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan); SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, globals.codec_string); SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_rates_string, globals.codec_rates_string); @@ -1102,35 +1101,35 @@ static switch_status_t mdl_add_crypto(struct private_object *tech_pvt, static void try_secure(struct private_object *tech_pvt, ldl_transport_type_t ttype) { + switch_secure_settings_t ssec; /* Used just to wrap over params in a call to switch_rtp_add_crypto_key. */ if (!switch_test_flag(tech_pvt, TFLAG_SECURE)) { return; } + memset(&ssec, 0, sizeof(ssec)); if (tech_pvt->transports[ttype].crypto_recv_type) { tech_pvt->transports[ttype].crypto_type = tech_pvt->transports[ttype].crypto_recv_type; } - if (tech_pvt->transports[ttype].crypto_type) { - switch_rtp_add_crypto_key(tech_pvt->transports[ttype].rtp_session, - SWITCH_RTP_CRYPTO_SEND, 1, tech_pvt->transports[ttype].crypto_type, - tech_pvt->transports[ttype].local_raw_key, SWITCH_RTP_KEY_LEN); + memcpy(ssec.local_raw_key, tech_pvt->transports[ttype].local_raw_key, switch_core_media_crypto_keysalt_len(tech_pvt->transports[ttype].crypto_type)); + ssec.local_crypto_key = switch_core_session_strdup(tech_pvt->session, tech_pvt->transports[ttype].local_crypto_key); + switch_core_media_add_crypto(tech_pvt->session, &ssec, SWITCH_RTP_CRYPTO_SEND); + switch_rtp_add_crypto_key(tech_pvt->transports[ttype].rtp_session, SWITCH_RTP_CRYPTO_SEND_RTCP, tech_pvt->transports[ttype].crypto_type, &ssec); - switch_rtp_add_crypto_key(tech_pvt->transports[ttype].rtp_session, - SWITCH_RTP_CRYPTO_RECV, tech_pvt->transports[ttype].crypto_tag, - tech_pvt->transports[ttype].crypto_type, - tech_pvt->transports[ttype].remote_raw_key, SWITCH_RTP_KEY_LEN); + memcpy(ssec.remote_raw_key, tech_pvt->transports[ttype].remote_raw_key, switch_core_media_crypto_keysalt_len(tech_pvt->transports[ttype].crypto_type)); + ssec.remote_crypto_key = switch_core_session_strdup(tech_pvt->session, tech_pvt->transports[ttype].local_crypto_key); + switch_core_media_add_crypto(tech_pvt->session, &ssec, SWITCH_RTP_CRYPTO_RECV); + switch_rtp_add_crypto_key(tech_pvt->transports[ttype].rtp_session, SWITCH_RTP_CRYPTO_RECV, tech_pvt->transports[ttype].crypto_type, &ssec); switch_channel_set_variable(tech_pvt->channel, "jingle_secure_audio_confirmed", "true"); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_NOTICE, - "%s %s crypto confirmed\n", ldl_transport_type_str(ttype), switch_core_session_get_name(tech_pvt->session)); - - } - + "%s %s crypto confirmed\n", ldl_transport_type_str(ttype), switch_core_session_get_name(tech_pvt->session)); + } } diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 12e8ae812e..0c546221a3 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -311,6 +311,12 @@ SWITCH_DECLARE(int) switch_core_media_crypto_keysalt_len(switch_rtp_crypto_key_t return SUITES[type].keysalt_len; } +SWITCH_DECLARE(int) switch_core_media_crypto_salt_len(switch_rtp_crypto_key_type_t type) +{ + switch_assert(type < CRYPTO_INVALID); + return SUITES[type].salt_len; +} + static const char* CRYPTO_KEY_PARAM_METHOD[CRYPTO_KEY_PARAM_METHOD_INVALID] = { [CRYPTO_KEY_PARAM_METHOD_INLINE] = "inline", }; @@ -1343,7 +1349,7 @@ static const char* switch_core_media_crypto_find_key_material_candidate_end(cons return end; } -switch_status_t switch_core_media_add_crypto(switch_core_session_t *session, switch_secure_settings_t *ssec, switch_rtp_crypto_direction_t direction) +SWITCH_DECLARE(switch_status_t) switch_core_media_add_crypto(switch_core_session_t *session, switch_secure_settings_t *ssec, switch_rtp_crypto_direction_t direction) { unsigned char key[SWITCH_RTP_MAX_CRYPTO_LEN]; switch_rtp_crypto_key_type_t type; From 177823f9c342cfb6e2bfafd41a4bdf2f1f461d57 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Wed, 27 Dec 2017 16:21:30 -0600 Subject: [PATCH 067/264] swigall --- .../languages/mod_managed/freeswitch_wrap.cxx | 660 +++++++++++++++++- src/mod/languages/mod_managed/managed/swig.cs | 551 ++++++++++++++- 2 files changed, 1149 insertions(+), 62 deletions(-) diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index 08f24ac8a0..a6f6d29b3a 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -900,6 +900,16 @@ SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_DEFAULT_DTMF_DURATION_get() { } +SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_DEFAULT_TIMEOUT_get() { + int jresult ; + int result; + + result = (int)(60); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_MIN_DTMF_DURATION_get() { int jresult ; int result; @@ -7726,6 +7736,482 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_mm_t(void * jarg1) { } +SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_MAX_CRYPTO_LEN_get() { + int jresult ; + int result; + + result = (int)(64); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_crypto_key_material_t_method_set(void * jarg1, int jarg2) { + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + switch_rtp_crypto_key_param_method_type_t arg2 ; + + arg1 = (switch_crypto_key_material_s *)jarg1; + arg2 = (switch_rtp_crypto_key_param_method_type_t)jarg2; + if (arg1) (arg1)->method = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_crypto_key_material_t_method_get(void * jarg1) { + int jresult ; + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + switch_rtp_crypto_key_param_method_type_t result; + + arg1 = (switch_crypto_key_material_s *)jarg1; + result = (switch_rtp_crypto_key_param_method_type_t) ((arg1)->method); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_crypto_key_material_t_raw_key_set(void * jarg1, void * jarg2) { + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + unsigned char *arg2 ; + + arg1 = (switch_crypto_key_material_s *)jarg1; + arg2 = (unsigned char *)jarg2; + { + size_t ii; + unsigned char *b = (unsigned char *) arg1->raw_key; + for (ii = 0; ii < (size_t)64; ii++) b[ii] = *((unsigned char *) arg2 + ii); + } +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_crypto_key_material_t_raw_key_get(void * jarg1) { + void * jresult ; + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + unsigned char *result = 0 ; + + arg1 = (switch_crypto_key_material_s *)jarg1; + result = (unsigned char *)(unsigned char *) ((arg1)->raw_key); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_crypto_key_material_t_crypto_key_set(void * jarg1, char * jarg2) { + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_crypto_key_material_s *)jarg1; + arg2 = (char *)jarg2; + { + delete [] arg1->crypto_key; + if (arg2) { + arg1->crypto_key = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->crypto_key, (const char *)arg2); + } else { + arg1->crypto_key = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_crypto_key_material_t_crypto_key_get(void * jarg1) { + char * jresult ; + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + char *result = 0 ; + + arg1 = (switch_crypto_key_material_s *)jarg1; + result = (char *) ((arg1)->crypto_key); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_crypto_key_material_t_lifetime_set(void * jarg1, unsigned long long jarg2) { + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + uint64_t arg2 ; + + arg1 = (switch_crypto_key_material_s *)jarg1; + arg2 = (uint64_t)jarg2; + if (arg1) (arg1)->lifetime = arg2; +} + + +SWIGEXPORT unsigned long long SWIGSTDCALL CSharp_switch_crypto_key_material_t_lifetime_get(void * jarg1) { + unsigned long long jresult ; + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + uint64_t result; + + arg1 = (switch_crypto_key_material_s *)jarg1; + result = (uint64_t) ((arg1)->lifetime); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_crypto_key_material_t_mki_id_set(void * jarg1, unsigned int jarg2) { + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + unsigned int arg2 ; + + arg1 = (switch_crypto_key_material_s *)jarg1; + arg2 = (unsigned int)jarg2; + if (arg1) (arg1)->mki_id = arg2; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_switch_crypto_key_material_t_mki_id_get(void * jarg1) { + unsigned int jresult ; + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + unsigned int result; + + arg1 = (switch_crypto_key_material_s *)jarg1; + result = (unsigned int) ((arg1)->mki_id); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_crypto_key_material_t_mki_size_set(void * jarg1, unsigned int jarg2) { + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + unsigned int arg2 ; + + arg1 = (switch_crypto_key_material_s *)jarg1; + arg2 = (unsigned int)jarg2; + if (arg1) (arg1)->mki_size = arg2; +} + + +SWIGEXPORT unsigned int SWIGSTDCALL CSharp_switch_crypto_key_material_t_mki_size_get(void * jarg1) { + unsigned int jresult ; + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + unsigned int result; + + arg1 = (switch_crypto_key_material_s *)jarg1; + result = (unsigned int) ((arg1)->mki_size); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_crypto_key_material_t_next_set(void * jarg1, void * jarg2) { + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + switch_crypto_key_material_s *arg2 = (switch_crypto_key_material_s *) 0 ; + + arg1 = (switch_crypto_key_material_s *)jarg1; + arg2 = (switch_crypto_key_material_s *)jarg2; + if (arg1) (arg1)->next = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_crypto_key_material_t_next_get(void * jarg1) { + void * jresult ; + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + switch_crypto_key_material_s *result = 0 ; + + arg1 = (switch_crypto_key_material_s *)jarg1; + result = (switch_crypto_key_material_s *) ((arg1)->next); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_crypto_key_material_t() { + void * jresult ; + switch_crypto_key_material_s *result = 0 ; + + result = (switch_crypto_key_material_s *)new switch_crypto_key_material_s(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_crypto_key_material_t(void * jarg1) { + switch_crypto_key_material_s *arg1 = (switch_crypto_key_material_s *) 0 ; + + arg1 = (switch_crypto_key_material_s *)jarg1; + delete arg1; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_secure_settings_t_crypto_tag_set(void * jarg1, int jarg2) { + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + int arg2 ; + + arg1 = (secure_settings_s *)jarg1; + arg2 = (int)jarg2; + if (arg1) (arg1)->crypto_tag = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_secure_settings_t_crypto_tag_get(void * jarg1) { + int jresult ; + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + int result; + + arg1 = (secure_settings_s *)jarg1; + result = (int) ((arg1)->crypto_tag); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_secure_settings_t_local_raw_key_set(void * jarg1, void * jarg2) { + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + unsigned char *arg2 ; + + arg1 = (secure_settings_s *)jarg1; + arg2 = (unsigned char *)jarg2; + { + size_t ii; + unsigned char *b = (unsigned char *) arg1->local_raw_key; + for (ii = 0; ii < (size_t)64; ii++) b[ii] = *((unsigned char *) arg2 + ii); + } +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_secure_settings_t_local_raw_key_get(void * jarg1) { + void * jresult ; + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + unsigned char *result = 0 ; + + arg1 = (secure_settings_s *)jarg1; + result = (unsigned char *)(unsigned char *) ((arg1)->local_raw_key); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_secure_settings_t_remote_raw_key_set(void * jarg1, void * jarg2) { + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + unsigned char *arg2 ; + + arg1 = (secure_settings_s *)jarg1; + arg2 = (unsigned char *)jarg2; + { + size_t ii; + unsigned char *b = (unsigned char *) arg1->remote_raw_key; + for (ii = 0; ii < (size_t)64; ii++) b[ii] = *((unsigned char *) arg2 + ii); + } +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_secure_settings_t_remote_raw_key_get(void * jarg1) { + void * jresult ; + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + unsigned char *result = 0 ; + + arg1 = (secure_settings_s *)jarg1; + result = (unsigned char *)(unsigned char *) ((arg1)->remote_raw_key); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_secure_settings_t_crypto_type_set(void * jarg1, int jarg2) { + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + switch_rtp_crypto_key_type_t arg2 ; + + arg1 = (secure_settings_s *)jarg1; + arg2 = (switch_rtp_crypto_key_type_t)jarg2; + if (arg1) (arg1)->crypto_type = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_secure_settings_t_crypto_type_get(void * jarg1) { + int jresult ; + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + switch_rtp_crypto_key_type_t result; + + arg1 = (secure_settings_s *)jarg1; + result = (switch_rtp_crypto_key_type_t) ((arg1)->crypto_type); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_secure_settings_t_local_crypto_key_set(void * jarg1, char * jarg2) { + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (secure_settings_s *)jarg1; + arg2 = (char *)jarg2; + { + delete [] arg1->local_crypto_key; + if (arg2) { + arg1->local_crypto_key = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->local_crypto_key, (const char *)arg2); + } else { + arg1->local_crypto_key = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_secure_settings_t_local_crypto_key_get(void * jarg1) { + char * jresult ; + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + char *result = 0 ; + + arg1 = (secure_settings_s *)jarg1; + result = (char *) ((arg1)->local_crypto_key); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_secure_settings_t_remote_crypto_key_set(void * jarg1, char * jarg2) { + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (secure_settings_s *)jarg1; + arg2 = (char *)jarg2; + { + delete [] arg1->remote_crypto_key; + if (arg2) { + arg1->remote_crypto_key = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->remote_crypto_key, (const char *)arg2); + } else { + arg1->remote_crypto_key = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_secure_settings_t_remote_crypto_key_get(void * jarg1) { + char * jresult ; + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + char *result = 0 ; + + arg1 = (secure_settings_s *)jarg1; + result = (char *) ((arg1)->remote_crypto_key); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_secure_settings_t_local_key_material_next_set(void * jarg1, void * jarg2) { + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + switch_crypto_key_material_s *arg2 = (switch_crypto_key_material_s *) 0 ; + + arg1 = (secure_settings_s *)jarg1; + arg2 = (switch_crypto_key_material_s *)jarg2; + if (arg1) (arg1)->local_key_material_next = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_secure_settings_t_local_key_material_next_get(void * jarg1) { + void * jresult ; + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + switch_crypto_key_material_s *result = 0 ; + + arg1 = (secure_settings_s *)jarg1; + result = (switch_crypto_key_material_s *) ((arg1)->local_key_material_next); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_secure_settings_t_local_key_material_n_set(void * jarg1, unsigned long jarg2) { + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + unsigned long arg2 ; + + arg1 = (secure_settings_s *)jarg1; + arg2 = (unsigned long)jarg2; + if (arg1) (arg1)->local_key_material_n = arg2; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_secure_settings_t_local_key_material_n_get(void * jarg1) { + unsigned long jresult ; + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + unsigned long result; + + arg1 = (secure_settings_s *)jarg1; + result = (unsigned long) ((arg1)->local_key_material_n); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_secure_settings_t_remote_key_material_next_set(void * jarg1, void * jarg2) { + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + switch_crypto_key_material_s *arg2 = (switch_crypto_key_material_s *) 0 ; + + arg1 = (secure_settings_s *)jarg1; + arg2 = (switch_crypto_key_material_s *)jarg2; + if (arg1) (arg1)->remote_key_material_next = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_secure_settings_t_remote_key_material_next_get(void * jarg1) { + void * jresult ; + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + switch_crypto_key_material_s *result = 0 ; + + arg1 = (secure_settings_s *)jarg1; + result = (switch_crypto_key_material_s *) ((arg1)->remote_key_material_next); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_secure_settings_t_remote_key_material_n_set(void * jarg1, unsigned long jarg2) { + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + unsigned long arg2 ; + + arg1 = (secure_settings_s *)jarg1; + arg2 = (unsigned long)jarg2; + if (arg1) (arg1)->remote_key_material_n = arg2; +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_secure_settings_t_remote_key_material_n_get(void * jarg1) { + unsigned long jresult ; + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + unsigned long result; + + arg1 = (secure_settings_s *)jarg1; + result = (unsigned long) ((arg1)->remote_key_material_n); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_secure_settings_t() { + void * jresult ; + secure_settings_s *result = 0 ; + + result = (secure_settings_s *)new secure_settings_s(); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_secure_settings_t(void * jarg1) { + secure_settings_s *arg1 = (secure_settings_s *) 0 ; + + arg1 = (secure_settings_s *)jarg1; + delete arg1; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_CRYPTO_MKI_INDEX_get() { + int jresult ; + int result; + + result = (int)(0); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_CRYPTO_MKI_MAX_get() { + int jresult ; + int result; + + result = (int)(20); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_db_close(void * jarg1) { int jresult ; switch_core_db_t *arg1 = (switch_core_db_t *) 0 ; @@ -17403,13 +17889,21 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_cert_verify(void * jarg1) { } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_request_video_refresh(void * jarg1) { +SWIGEXPORT int SWIGSTDCALL CSharp__switch_core_session_request_video_refresh(void * jarg1, int jarg2, char * jarg3, char * jarg4, int jarg5) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + int arg2 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + int arg5 ; switch_status_t result; arg1 = (switch_core_session_t *)jarg1; - result = (switch_status_t)switch_core_session_request_video_refresh(arg1); + arg2 = (int)jarg2; + arg3 = (char *)jarg3; + arg4 = (char *)jarg4; + arg5 = (int)jarg5; + result = (switch_status_t)_switch_core_session_request_video_refresh(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); jresult = result; return jresult; } @@ -19274,7 +19768,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_b64_decode(char * jarg1, char * jarg return 0; } arg3 = *argp3; - result = switch_b64_decode(arg1,arg2,arg3); + result = switch_b64_decode((char const *)arg1,arg2,arg3); jresult = new switch_size_t((const switch_size_t &)result); return jresult; } @@ -27478,6 +27972,56 @@ SWIGEXPORT long long SWIGSTDCALL CSharp_switch_file_handle_vpos_get(void * jarg1 } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_file_handle_muxbuf_set(void * jarg1, void * jarg2) { + switch_file_handle *arg1 = (switch_file_handle *) 0 ; + void *arg2 = (void *) 0 ; + + arg1 = (switch_file_handle *)jarg1; + arg2 = (void *)jarg2; + if (arg1) (arg1)->muxbuf = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_file_handle_muxbuf_get(void * jarg1) { + void * jresult ; + switch_file_handle *arg1 = (switch_file_handle *) 0 ; + void *result = 0 ; + + arg1 = (switch_file_handle *)jarg1; + result = (void *) ((arg1)->muxbuf); + jresult = (void *)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_file_handle_muxlen_set(void * jarg1, void * jarg2) { + switch_file_handle *arg1 = (switch_file_handle *) 0 ; + switch_size_t arg2 ; + switch_size_t *argp2 ; + + arg1 = (switch_file_handle *)jarg1; + argp2 = (switch_size_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->muxlen = arg2; +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_file_handle_muxlen_get(void * jarg1) { + void * jresult ; + switch_file_handle *arg1 = (switch_file_handle *) 0 ; + switch_size_t result; + + arg1 = (switch_file_handle *)jarg1; + result = ((arg1)->muxlen); + jresult = new switch_size_t((const switch_size_t &)result); + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_file_handle() { void * jresult ; switch_file_handle *result = 0 ; @@ -35345,6 +35889,28 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_channel_get_partner_uuid(void * jarg } +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_channel_get_partner_uuid_copy(void * jarg1, char * jarg2, void * jarg3) { + char * jresult ; + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + char *arg2 = (char *) 0 ; + switch_size_t arg3 ; + switch_size_t *argp3 ; + char *result = 0 ; + + arg1 = (switch_channel_t *)jarg1; + arg2 = (char *)jarg2; + argp3 = (switch_size_t *)jarg3; + if (!argp3) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); + return 0; + } + arg3 = *argp3; + result = (char *)switch_channel_get_partner_uuid_copy(arg1,arg2,arg3); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_switch_channel_get_hold_record(void * jarg1) { void * jresult ; switch_channel_t *arg1 = (switch_channel_t *) 0 ; @@ -41172,16 +41738,6 @@ SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_MAX_BUF_LEN_WORDS_get() { } -SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_MAX_CRYPTO_LEN_get() { - int jresult ; - int result; - - result = (int)(64); - jresult = result; - return jresult; -} - - SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_RTP_CRYPTO_KEY_80_get() { char * jresult ; char *result = 0 ; @@ -41365,23 +41921,45 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_type_get(void * jar } -SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_keylen_set(void * jarg1, int jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_keysalt_len_set(void * jarg1, int jarg2) { switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ; int arg2 ; arg1 = (switch_srtp_crypto_suite_s *)jarg1; arg2 = (int)jarg2; - if (arg1) (arg1)->keylen = arg2; + if (arg1) (arg1)->keysalt_len = arg2; } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_keylen_get(void * jarg1) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_keysalt_len_get(void * jarg1) { int jresult ; switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ; int result; arg1 = (switch_srtp_crypto_suite_s *)jarg1; - result = (int) ((arg1)->keylen); + result = (int) ((arg1)->keysalt_len); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_salt_len_set(void * jarg1, int jarg2) { + switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ; + int arg2 ; + + arg1 = (switch_srtp_crypto_suite_s *)jarg1; + arg2 = (int)jarg2; + if (arg1) (arg1)->salt_len = arg2; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_salt_len_get(void * jarg1) { + int jresult ; + switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ; + int result; + + arg1 = (switch_srtp_crypto_suite_s *)jarg1; + result = (int) ((arg1)->salt_len); jresult = result; return jresult; } @@ -41405,6 +41983,28 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_srtp_crypto_suite_t(void * jarg } +SWIGEXPORT void SWIGSTDCALL CSharp_SUITES_set(void * jarg1) { + switch_srtp_crypto_suite_t *arg1 ; + + arg1 = (switch_srtp_crypto_suite_t *)jarg1; + { + size_t ii; + switch_srtp_crypto_suite_t *b = (switch_srtp_crypto_suite_t *) SUITES; + for (ii = 0; ii < (size_t)CRYPTO_INVALID; ii++) b[ii] = *((switch_srtp_crypto_suite_t *) arg1 + ii); + } +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_SUITES_get() { + void * jresult ; + switch_srtp_crypto_suite_t *result = 0 ; + + result = (switch_srtp_crypto_suite_t *)(switch_srtp_crypto_suite_t *)SUITES; + jresult = result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_crypto_key_index_set(void * jarg1, unsigned long jarg2) { switch_rtp_crypto_key *arg1 = (switch_rtp_crypto_key *) 0 ; uint32_t arg2 ; @@ -41449,7 +42049,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_crypto_key_type_get(void * jarg1) { } -SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_crypto_key_key_set(void * jarg1, void * jarg2) { +SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_crypto_key_keysalt_set(void * jarg1, void * jarg2) { switch_rtp_crypto_key *arg1 = (switch_rtp_crypto_key *) 0 ; unsigned char *arg2 ; @@ -41457,19 +42057,19 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_crypto_key_key_set(void * jarg1, v arg2 = (unsigned char *)jarg2; { size_t ii; - unsigned char *b = (unsigned char *) arg1->key; + unsigned char *b = (unsigned char *) arg1->keysalt; for (ii = 0; ii < (size_t)64; ii++) b[ii] = *((unsigned char *) arg2 + ii); } } -SWIGEXPORT void * SWIGSTDCALL CSharp_switch_rtp_crypto_key_key_get(void * jarg1) { +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_rtp_crypto_key_keysalt_get(void * jarg1) { void * jresult ; switch_rtp_crypto_key *arg1 = (switch_rtp_crypto_key *) 0 ; unsigned char *result = 0 ; arg1 = (switch_rtp_crypto_key *)jarg1; - result = (unsigned char *)(unsigned char *) ((arg1)->key); + result = (unsigned char *)(unsigned char *) ((arg1)->keysalt); jresult = result; return jresult; } @@ -42079,29 +42679,19 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_ice_t(void * jarg1) { } -SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_add_crypto_key(void * jarg1, int jarg2, unsigned long jarg3, int jarg4, void * jarg5, void * jarg6) { +SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_add_crypto_key(void * jarg1, int jarg2, unsigned long jarg3, void * jarg4) { int jresult ; switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; switch_rtp_crypto_direction_t arg2 ; uint32_t arg3 ; - switch_rtp_crypto_key_type_t arg4 ; - unsigned char *arg5 = (unsigned char *) 0 ; - switch_size_t arg6 ; - switch_size_t *argp6 ; + switch_secure_settings_t *arg4 = (switch_secure_settings_t *) 0 ; switch_status_t result; arg1 = (switch_rtp_t *)jarg1; arg2 = (switch_rtp_crypto_direction_t)jarg2; arg3 = (uint32_t)jarg3; - arg4 = (switch_rtp_crypto_key_type_t)jarg4; - arg5 = (unsigned char *)jarg5; - argp6 = (switch_size_t *)jarg6; - if (!argp6) { - SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0); - return 0; - } - arg6 = *argp6; - result = (switch_status_t)switch_rtp_add_crypto_key(arg1,arg2,arg3,arg4,arg5,arg6); + arg4 = (switch_secure_settings_t *)jarg4; + result = (switch_status_t)switch_rtp_add_crypto_key(arg1,arg2,arg3,arg4); jresult = result; return jresult; } diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index fdc5ae318e..940ebaba19 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -3435,8 +3435,8 @@ else return ret; } - public static switch_status_t switch_core_session_request_video_refresh(SWIGTYPE_p_switch_core_session session) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_request_video_refresh(SWIGTYPE_p_switch_core_session.getCPtr(session)); + public static switch_status_t _switch_core_session_request_video_refresh(SWIGTYPE_p_switch_core_session session, int force, string file, string func, int line) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE._switch_core_session_request_video_refresh(SWIGTYPE_p_switch_core_session.getCPtr(session), force, file, func, line); return ret; } @@ -5242,6 +5242,12 @@ else return ret; } + public static string switch_channel_get_partner_uuid_copy(SWIGTYPE_p_switch_channel channel, string buf, SWIGTYPE_p_switch_size_t blen) { + string ret = freeswitchPINVOKE.switch_channel_get_partner_uuid_copy(SWIGTYPE_p_switch_channel.getCPtr(channel), buf, SWIGTYPE_p_switch_size_t.getCPtr(blen)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + public static switch_hold_record_t switch_channel_get_hold_record(SWIGTYPE_p_switch_channel channel) { IntPtr cPtr = freeswitchPINVOKE.switch_channel_get_hold_record(SWIGTYPE_p_switch_channel.getCPtr(channel)); switch_hold_record_t ret = (cPtr == IntPtr.Zero) ? null : new switch_hold_record_t(cPtr, false); @@ -6642,9 +6648,19 @@ else return ret; } - public static switch_status_t switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp rtp_session, switch_rtp_crypto_direction_t direction, uint index, switch_rtp_crypto_key_type_t type, SWIGTYPE_p_unsigned_char key, SWIGTYPE_p_switch_size_t keylen) { - switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), (int)direction, index, (int)type, SWIGTYPE_p_unsigned_char.getCPtr(key), SWIGTYPE_p_switch_size_t.getCPtr(keylen)); - if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + public static switch_srtp_crypto_suite_t SUITES { + set { + freeswitchPINVOKE.SUITES_set(switch_srtp_crypto_suite_t.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.SUITES_get(); + switch_srtp_crypto_suite_t ret = (cPtr == IntPtr.Zero) ? null : new switch_srtp_crypto_suite_t(cPtr, false); + return ret; + } + } + + public static switch_status_t switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp rtp_session, switch_rtp_crypto_direction_t direction, uint index, switch_secure_settings_t ssec) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), (int)direction, index, switch_secure_settings_t.getCPtr(ssec)); return ret; } @@ -7722,6 +7738,7 @@ else public static readonly string SWITCH_DEFAULT_CLID_NAME = freeswitchPINVOKE.SWITCH_DEFAULT_CLID_NAME_get(); public static readonly string SWITCH_DEFAULT_CLID_NUMBER = freeswitchPINVOKE.SWITCH_DEFAULT_CLID_NUMBER_get(); public static readonly int SWITCH_DEFAULT_DTMF_DURATION = freeswitchPINVOKE.SWITCH_DEFAULT_DTMF_DURATION_get(); + public static readonly int SWITCH_DEFAULT_TIMEOUT = freeswitchPINVOKE.SWITCH_DEFAULT_TIMEOUT_get(); public static readonly int SWITCH_MIN_DTMF_DURATION = freeswitchPINVOKE.SWITCH_MIN_DTMF_DURATION_get(); public static readonly int SWITCH_MAX_DTMF_DURATION = freeswitchPINVOKE.SWITCH_MAX_DTMF_DURATION_get(); public static readonly string SWITCH_PATH_SEPARATOR = freeswitchPINVOKE.SWITCH_PATH_SEPARATOR_get(); @@ -7857,6 +7874,9 @@ else public static readonly int DMACHINE_MAX_DIGIT_LEN = freeswitchPINVOKE.DMACHINE_MAX_DIGIT_LEN_get(); public static readonly int MAX_ARG_RECURSION = freeswitchPINVOKE.MAX_ARG_RECURSION_get(); public static readonly int SWITCH_API_VERSION = freeswitchPINVOKE.SWITCH_API_VERSION_get(); + public static readonly int SWITCH_RTP_MAX_CRYPTO_LEN = freeswitchPINVOKE.SWITCH_RTP_MAX_CRYPTO_LEN_get(); + public static readonly int SWITCH_CRYPTO_MKI_INDEX = freeswitchPINVOKE.SWITCH_CRYPTO_MKI_INDEX_get(); + public static readonly int SWITCH_CRYPTO_MKI_MAX = freeswitchPINVOKE.SWITCH_CRYPTO_MKI_MAX_get(); public static readonly int SWITCH_CORE_DB_OK = freeswitchPINVOKE.SWITCH_CORE_DB_OK_get(); public static readonly int SWITCH_CORE_DB_ERROR = freeswitchPINVOKE.SWITCH_CORE_DB_ERROR_get(); public static readonly int SWITCH_CORE_DB_INTERNAL = freeswitchPINVOKE.SWITCH_CORE_DB_INTERNAL_get(); @@ -7903,7 +7923,6 @@ else public static readonly int SWITCH_RTP_MAX_BUF_LEN = freeswitchPINVOKE.SWITCH_RTP_MAX_BUF_LEN_get(); public static readonly int SWITCH_RTCP_MAX_BUF_LEN = freeswitchPINVOKE.SWITCH_RTCP_MAX_BUF_LEN_get(); public static readonly int SWITCH_RTP_MAX_BUF_LEN_WORDS = freeswitchPINVOKE.SWITCH_RTP_MAX_BUF_LEN_WORDS_get(); - public static readonly int SWITCH_RTP_MAX_CRYPTO_LEN = freeswitchPINVOKE.SWITCH_RTP_MAX_CRYPTO_LEN_get(); public static readonly string SWITCH_RTP_CRYPTO_KEY_80 = freeswitchPINVOKE.SWITCH_RTP_CRYPTO_KEY_80_get(); public static readonly int MAX_CAND = freeswitchPINVOKE.MAX_CAND_get(); public static readonly int SWITCH_XML_BUFSIZE = freeswitchPINVOKE.SWITCH_XML_BUFSIZE_get(); @@ -8279,6 +8298,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_DEFAULT_DTMF_DURATION_get")] public static extern int SWITCH_DEFAULT_DTMF_DURATION_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_DEFAULT_TIMEOUT_get")] + public static extern int SWITCH_DEFAULT_TIMEOUT_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_MIN_DTMF_DURATION_get")] public static extern int SWITCH_MIN_DTMF_DURATION_get(); @@ -10100,6 +10122,129 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_mm_t")] public static extern void delete_switch_mm_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_MAX_CRYPTO_LEN_get")] + public static extern int SWITCH_RTP_MAX_CRYPTO_LEN_get(); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_method_set")] + public static extern void switch_crypto_key_material_t_method_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_method_get")] + public static extern int switch_crypto_key_material_t_method_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_raw_key_set")] + public static extern void switch_crypto_key_material_t_raw_key_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_raw_key_get")] + public static extern IntPtr switch_crypto_key_material_t_raw_key_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_crypto_key_set")] + public static extern void switch_crypto_key_material_t_crypto_key_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_crypto_key_get")] + public static extern string switch_crypto_key_material_t_crypto_key_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_lifetime_set")] + public static extern void switch_crypto_key_material_t_lifetime_set(HandleRef jarg1, ulong jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_lifetime_get")] + public static extern ulong switch_crypto_key_material_t_lifetime_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_mki_id_set")] + public static extern void switch_crypto_key_material_t_mki_id_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_mki_id_get")] + public static extern uint switch_crypto_key_material_t_mki_id_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_mki_size_set")] + public static extern void switch_crypto_key_material_t_mki_size_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_mki_size_get")] + public static extern uint switch_crypto_key_material_t_mki_size_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_next_set")] + public static extern void switch_crypto_key_material_t_next_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_crypto_key_material_t_next_get")] + public static extern IntPtr switch_crypto_key_material_t_next_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_crypto_key_material_t")] + public static extern IntPtr new_switch_crypto_key_material_t(); + + [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_crypto_key_material_t")] + public static extern void delete_switch_crypto_key_material_t(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_crypto_tag_set")] + public static extern void switch_secure_settings_t_crypto_tag_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_crypto_tag_get")] + public static extern int switch_secure_settings_t_crypto_tag_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_local_raw_key_set")] + public static extern void switch_secure_settings_t_local_raw_key_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_local_raw_key_get")] + public static extern IntPtr switch_secure_settings_t_local_raw_key_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_remote_raw_key_set")] + public static extern void switch_secure_settings_t_remote_raw_key_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_remote_raw_key_get")] + public static extern IntPtr switch_secure_settings_t_remote_raw_key_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_crypto_type_set")] + public static extern void switch_secure_settings_t_crypto_type_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_crypto_type_get")] + public static extern int switch_secure_settings_t_crypto_type_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_local_crypto_key_set")] + public static extern void switch_secure_settings_t_local_crypto_key_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_local_crypto_key_get")] + public static extern string switch_secure_settings_t_local_crypto_key_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_remote_crypto_key_set")] + public static extern void switch_secure_settings_t_remote_crypto_key_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_remote_crypto_key_get")] + public static extern string switch_secure_settings_t_remote_crypto_key_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_local_key_material_next_set")] + public static extern void switch_secure_settings_t_local_key_material_next_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_local_key_material_next_get")] + public static extern IntPtr switch_secure_settings_t_local_key_material_next_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_local_key_material_n_set")] + public static extern void switch_secure_settings_t_local_key_material_n_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_local_key_material_n_get")] + public static extern uint switch_secure_settings_t_local_key_material_n_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_remote_key_material_next_set")] + public static extern void switch_secure_settings_t_remote_key_material_next_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_remote_key_material_next_get")] + public static extern IntPtr switch_secure_settings_t_remote_key_material_next_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_remote_key_material_n_set")] + public static extern void switch_secure_settings_t_remote_key_material_n_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_secure_settings_t_remote_key_material_n_get")] + public static extern uint switch_secure_settings_t_remote_key_material_n_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_secure_settings_t")] + public static extern IntPtr new_switch_secure_settings_t(); + + [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_secure_settings_t")] + public static extern void delete_switch_secure_settings_t(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CRYPTO_MKI_INDEX_get")] + public static extern int SWITCH_CRYPTO_MKI_INDEX_get(); + + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CRYPTO_MKI_MAX_get")] + public static extern int SWITCH_CRYPTO_MKI_MAX_get(); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_db_close")] public static extern int switch_core_db_close(HandleRef jarg1); @@ -12383,8 +12528,8 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_cert_verify")] public static extern int switch_core_cert_verify(HandleRef jarg1); - [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_request_video_refresh")] - public static extern int switch_core_session_request_video_refresh(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp__switch_core_session_request_video_refresh")] + public static extern int _switch_core_session_request_video_refresh(HandleRef jarg1, int jarg2, string jarg3, string jarg4, int jarg5); [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_send_and_request_video_refresh")] public static extern int switch_core_session_send_and_request_video_refresh(HandleRef jarg1); @@ -14810,6 +14955,18 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_vpos_get")] public static extern long switch_file_handle_vpos_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_muxbuf_set")] + public static extern void switch_file_handle_muxbuf_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_muxbuf_get")] + public static extern IntPtr switch_file_handle_muxbuf_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_muxlen_set")] + public static extern void switch_file_handle_muxlen_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_muxlen_get")] + public static extern IntPtr switch_file_handle_muxlen_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_file_handle")] public static extern IntPtr new_switch_file_handle(); @@ -16805,6 +16962,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_partner_uuid")] public static extern string switch_channel_get_partner_uuid(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_partner_uuid_copy")] + public static extern string switch_channel_get_partner_uuid_copy(HandleRef jarg1, string jarg2, HandleRef jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_hold_record")] public static extern IntPtr switch_channel_get_hold_record(HandleRef jarg1); @@ -18023,9 +18183,6 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_MAX_BUF_LEN_WORDS_get")] public static extern int SWITCH_RTP_MAX_BUF_LEN_WORDS_get(); - [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_MAX_CRYPTO_LEN_get")] - public static extern int SWITCH_RTP_MAX_CRYPTO_LEN_get(); - [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_CRYPTO_KEY_80_get")] public static extern string SWITCH_RTP_CRYPTO_KEY_80_get(); @@ -18071,11 +18228,17 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_type_get")] public static extern int switch_srtp_crypto_suite_t_type_get(HandleRef jarg1); - [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_keylen_set")] - public static extern void switch_srtp_crypto_suite_t_keylen_set(HandleRef jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_keysalt_len_set")] + public static extern void switch_srtp_crypto_suite_t_keysalt_len_set(HandleRef jarg1, int jarg2); - [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_keylen_get")] - public static extern int switch_srtp_crypto_suite_t_keylen_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_keysalt_len_get")] + public static extern int switch_srtp_crypto_suite_t_keysalt_len_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_salt_len_set")] + public static extern void switch_srtp_crypto_suite_t_salt_len_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_salt_len_get")] + public static extern int switch_srtp_crypto_suite_t_salt_len_get(HandleRef jarg1); [DllImport("mod_managed", EntryPoint="CSharp_new_switch_srtp_crypto_suite_t")] public static extern IntPtr new_switch_srtp_crypto_suite_t(); @@ -18083,6 +18246,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_srtp_crypto_suite_t")] public static extern void delete_switch_srtp_crypto_suite_t(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_SUITES_set")] + public static extern void SUITES_set(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_SUITES_get")] + public static extern IntPtr SUITES_get(); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_crypto_key_index_set")] public static extern void switch_rtp_crypto_key_index_set(HandleRef jarg1, uint jarg2); @@ -18095,11 +18264,11 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_crypto_key_type_get")] public static extern int switch_rtp_crypto_key_type_get(HandleRef jarg1); - [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_crypto_key_key_set")] - public static extern void switch_rtp_crypto_key_key_set(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_crypto_key_keysalt_set")] + public static extern void switch_rtp_crypto_key_keysalt_set(HandleRef jarg1, HandleRef jarg2); - [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_crypto_key_key_get")] - public static extern IntPtr switch_rtp_crypto_key_key_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_crypto_key_keysalt_get")] + public static extern IntPtr switch_rtp_crypto_key_keysalt_get(HandleRef jarg1); [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_crypto_key_keylen_set")] public static extern void switch_rtp_crypto_key_keylen_set(HandleRef jarg1, HandleRef jarg2); @@ -18243,7 +18412,7 @@ class freeswitchPINVOKE { public static extern void delete_ice_t(HandleRef jarg1); [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_add_crypto_key")] - public static extern int switch_rtp_add_crypto_key(HandleRef jarg1, int jarg2, uint jarg3, int jarg4, HandleRef jarg5, HandleRef jarg6); + public static extern int switch_rtp_add_crypto_key(HandleRef jarg1, int jarg2, uint jarg3, HandleRef jarg4); [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_get_random")] public static extern void switch_rtp_get_random(HandleRef jarg1, uint jarg2); @@ -30144,6 +30313,7 @@ public enum switch_channel_flag_t { CF_INTERCEPT, CF_INTERCEPTED, CF_VIDEO_REFRESH_REQ, + CF_MANUAL_VID_REFRESH, CF_SERVICE_AUDIO, CF_SERVICE_VIDEO, CF_ZRTP_PASSTHRU_REQ, @@ -32638,6 +32808,127 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class switch_crypto_key_material_t : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal switch_crypto_key_material_t(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(switch_crypto_key_material_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~switch_crypto_key_material_t() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_switch_crypto_key_material_t(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + GC.SuppressFinalize(this); + } + } + + public switch_rtp_crypto_key_param_method_type_t method { + set { + freeswitchPINVOKE.switch_crypto_key_material_t_method_set(swigCPtr, (int)value); + } + get { + switch_rtp_crypto_key_param_method_type_t ret = (switch_rtp_crypto_key_param_method_type_t)freeswitchPINVOKE.switch_crypto_key_material_t_method_get(swigCPtr); + return ret; + } + } + + public SWIGTYPE_p_unsigned_char raw_key { + set { + freeswitchPINVOKE.switch_crypto_key_material_t_raw_key_set(swigCPtr, SWIGTYPE_p_unsigned_char.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_crypto_key_material_t_raw_key_get(swigCPtr); + SWIGTYPE_p_unsigned_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); + return ret; + } + } + + public string crypto_key { + set { + freeswitchPINVOKE.switch_crypto_key_material_t_crypto_key_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_crypto_key_material_t_crypto_key_get(swigCPtr); + return ret; + } + } + + public ulong lifetime { + set { + freeswitchPINVOKE.switch_crypto_key_material_t_lifetime_set(swigCPtr, value); + } + get { + ulong ret = freeswitchPINVOKE.switch_crypto_key_material_t_lifetime_get(swigCPtr); + return ret; + } + } + + public uint mki_id { + set { + freeswitchPINVOKE.switch_crypto_key_material_t_mki_id_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_crypto_key_material_t_mki_id_get(swigCPtr); + return ret; + } + } + + public uint mki_size { + set { + freeswitchPINVOKE.switch_crypto_key_material_t_mki_size_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_crypto_key_material_t_mki_size_get(swigCPtr); + return ret; + } + } + + public switch_crypto_key_material_t next { + set { + freeswitchPINVOKE.switch_crypto_key_material_t_next_set(swigCPtr, switch_crypto_key_material_t.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_crypto_key_material_t_next_get(swigCPtr); + switch_crypto_key_material_t ret = (cPtr == IntPtr.Zero) ? null : new switch_crypto_key_material_t(cPtr, false); + return ret; + } + } + + public switch_crypto_key_material_t() : this(freeswitchPINVOKE.new_switch_crypto_key_material_t(), true) { + } + +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.12 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class switch_device_node_t : IDisposable { private HandleRef swigCPtr; protected bool swigCMemOwn; @@ -34846,7 +35137,9 @@ namespace FreeSWITCH.Native { public enum switch_file_command_t { SCFC_FLUSH_AUDIO, - SCFC_PAUSE_READ + SCFC_PAUSE_READ, + SCFC_PAUSE_WRITE, + SCFC_RESUME_WRITE } } @@ -35452,6 +35745,29 @@ public class switch_file_handle : IDisposable { } } + public SWIGTYPE_p_void muxbuf { + set { + freeswitchPINVOKE.switch_file_handle_muxbuf_set(swigCPtr, SWIGTYPE_p_void.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_file_handle_muxbuf_get(swigCPtr); + SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false); + return ret; + } + } + + public SWIGTYPE_p_switch_size_t muxlen { + set { + freeswitchPINVOKE.switch_file_handle_muxlen_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_file_handle_muxlen_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + public switch_file_handle() : this(freeswitchPINVOKE.new_switch_file_handle(), true) { } @@ -40401,12 +40717,12 @@ public class switch_rtp_crypto_key : IDisposable { } } - public SWIGTYPE_p_unsigned_char key { + public SWIGTYPE_p_unsigned_char keysalt { set { - freeswitchPINVOKE.switch_rtp_crypto_key_key_set(swigCPtr, SWIGTYPE_p_unsigned_char.getCPtr(value)); + freeswitchPINVOKE.switch_rtp_crypto_key_keysalt_set(swigCPtr, SWIGTYPE_p_unsigned_char.getCPtr(value)); } get { - IntPtr cPtr = freeswitchPINVOKE.switch_rtp_crypto_key_key_get(swigCPtr); + IntPtr cPtr = freeswitchPINVOKE.switch_rtp_crypto_key_keysalt_get(swigCPtr); SWIGTYPE_p_unsigned_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); return ret; } @@ -40451,6 +40767,22 @@ public class switch_rtp_crypto_key : IDisposable { namespace FreeSWITCH.Native { +public enum switch_rtp_crypto_key_param_method_type_t { + CRYPTO_KEY_PARAM_METHOD_INLINE, + CRYPTO_KEY_PARAM_METHOD_INVALID +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.12 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + public enum switch_rtp_crypto_key_type_t { AEAD_AES_256_GCM_8, AEAD_AES_128_GCM_8, @@ -40525,6 +40857,8 @@ public enum switch_rtp_flag_t { SWITCH_RTP_FLAG_TEXT, SWITCH_RTP_FLAG_OLD_FIR, SWITCH_RTP_FLAG_PASSTHRU, + SWITCH_RTP_FLAG_SECURE_SEND_MKI, + SWITCH_RTP_FLAG_SECURE_RECV_MKI, SWITCH_RTP_FLAG_INVALID } @@ -41811,6 +42145,159 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class switch_secure_settings_t : IDisposable { + private HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal switch_secure_settings_t(IntPtr cPtr, bool cMemoryOwn) { + swigCMemOwn = cMemoryOwn; + swigCPtr = new HandleRef(this, cPtr); + } + + internal static HandleRef getCPtr(switch_secure_settings_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + ~switch_secure_settings_t() { + Dispose(); + } + + public virtual void Dispose() { + lock(this) { + if (swigCPtr.Handle != IntPtr.Zero) { + if (swigCMemOwn) { + swigCMemOwn = false; + freeswitchPINVOKE.delete_switch_secure_settings_t(swigCPtr); + } + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + GC.SuppressFinalize(this); + } + } + + public int crypto_tag { + set { + freeswitchPINVOKE.switch_secure_settings_t_crypto_tag_set(swigCPtr, value); + } + get { + int ret = freeswitchPINVOKE.switch_secure_settings_t_crypto_tag_get(swigCPtr); + return ret; + } + } + + public SWIGTYPE_p_unsigned_char local_raw_key { + set { + freeswitchPINVOKE.switch_secure_settings_t_local_raw_key_set(swigCPtr, SWIGTYPE_p_unsigned_char.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_secure_settings_t_local_raw_key_get(swigCPtr); + SWIGTYPE_p_unsigned_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); + return ret; + } + } + + public SWIGTYPE_p_unsigned_char remote_raw_key { + set { + freeswitchPINVOKE.switch_secure_settings_t_remote_raw_key_set(swigCPtr, SWIGTYPE_p_unsigned_char.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_secure_settings_t_remote_raw_key_get(swigCPtr); + SWIGTYPE_p_unsigned_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); + return ret; + } + } + + public switch_rtp_crypto_key_type_t crypto_type { + set { + freeswitchPINVOKE.switch_secure_settings_t_crypto_type_set(swigCPtr, (int)value); + } + get { + switch_rtp_crypto_key_type_t ret = (switch_rtp_crypto_key_type_t)freeswitchPINVOKE.switch_secure_settings_t_crypto_type_get(swigCPtr); + return ret; + } + } + + public string local_crypto_key { + set { + freeswitchPINVOKE.switch_secure_settings_t_local_crypto_key_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_secure_settings_t_local_crypto_key_get(swigCPtr); + return ret; + } + } + + public string remote_crypto_key { + set { + freeswitchPINVOKE.switch_secure_settings_t_remote_crypto_key_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_secure_settings_t_remote_crypto_key_get(swigCPtr); + return ret; + } + } + + public switch_crypto_key_material_t local_key_material_next { + set { + freeswitchPINVOKE.switch_secure_settings_t_local_key_material_next_set(swigCPtr, switch_crypto_key_material_t.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_secure_settings_t_local_key_material_next_get(swigCPtr); + switch_crypto_key_material_t ret = (cPtr == IntPtr.Zero) ? null : new switch_crypto_key_material_t(cPtr, false); + return ret; + } + } + + public uint local_key_material_n { + set { + freeswitchPINVOKE.switch_secure_settings_t_local_key_material_n_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_secure_settings_t_local_key_material_n_get(swigCPtr); + return ret; + } + } + + public switch_crypto_key_material_t remote_key_material_next { + set { + freeswitchPINVOKE.switch_secure_settings_t_remote_key_material_next_set(swigCPtr, switch_crypto_key_material_t.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_secure_settings_t_remote_key_material_next_get(swigCPtr); + switch_crypto_key_material_t ret = (cPtr == IntPtr.Zero) ? null : new switch_crypto_key_material_t(cPtr, false); + return ret; + } + } + + public uint remote_key_material_n { + set { + freeswitchPINVOKE.switch_secure_settings_t_remote_key_material_n_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_secure_settings_t_remote_key_material_n_get(swigCPtr); + return ret; + } + } + + public switch_secure_settings_t() : this(freeswitchPINVOKE.new_switch_secure_settings_t(), true) { + } + +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.12 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class switch_serial_event_header_t : IDisposable { private HandleRef swigCPtr; protected bool swigCMemOwn; @@ -42676,12 +43163,22 @@ public class switch_srtp_crypto_suite_t : IDisposable { } } - public int keylen { + public int keysalt_len { set { - freeswitchPINVOKE.switch_srtp_crypto_suite_t_keylen_set(swigCPtr, value); + freeswitchPINVOKE.switch_srtp_crypto_suite_t_keysalt_len_set(swigCPtr, value); } get { - int ret = freeswitchPINVOKE.switch_srtp_crypto_suite_t_keylen_get(swigCPtr); + int ret = freeswitchPINVOKE.switch_srtp_crypto_suite_t_keysalt_len_get(swigCPtr); + return ret; + } + } + + public int salt_len { + set { + freeswitchPINVOKE.switch_srtp_crypto_suite_t_salt_len_set(swigCPtr, value); + } + get { + int ret = freeswitchPINVOKE.switch_srtp_crypto_suite_t_salt_len_get(swigCPtr); return ret; } } From 333516c471a9eb87ea127ab916d3ee9bfd5a8946 Mon Sep 17 00:00:00 2001 From: Piotr Gregor Date: Tue, 2 Jan 2018 20:09:44 +0000 Subject: [PATCH 068/264] FS-10778: Fix for MKI regression introduced in FS-10778 --- src/switch_rtp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 1e86eae83c..a343d8ed06 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -3129,11 +3129,11 @@ static int dtls_state_setup(switch_rtp_t *rtp_session, switch_dtls_t *dtls) local_salt = remote_salt + cr_saltlen; } - memcpy(&ssec.local_raw_key, local_key, cr_keylen); - memcpy(&ssec.local_raw_key + cr_keylen, local_salt, cr_saltlen); + memcpy(ssec.local_raw_key, local_key, cr_keylen); + memcpy(ssec.local_raw_key + cr_keylen, local_salt, cr_saltlen); - memcpy(&ssec.remote_raw_key, remote_key, cr_keylen); - memcpy(&ssec.remote_raw_key + cr_keylen, remote_salt, cr_saltlen); + memcpy(ssec.remote_raw_key, remote_key, cr_keylen); + memcpy(ssec.remote_raw_key + cr_keylen, remote_salt, cr_saltlen); ssec.crypto_type = AES_CM_128_HMAC_SHA1_80; From d395223fa2b435605ee1aa9a3b8fd7b7ff44b574 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 30 Oct 2017 22:10:59 -0500 Subject: [PATCH 069/264] FS-10762: [freeswitch-core] Websocket logic error #resolve --- libs/sofia-sip/libsofia-sip-ua/tport/ws.c | 12 +++++++++--- src/mod/endpoints/mod_verto/ws.c | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c index 834fa3c139..73a6f4e1c5 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c @@ -25,7 +25,7 @@ #define WS_NOBLOCK 0 #define WS_INIT_SANITY 5000 -#define WS_WRITE_SANITY 2000 +#define WS_WRITE_SANITY 200 #define SHA1_HASH_SIZE 20 static struct ws_globals_s ws_globals; @@ -424,6 +424,11 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) do { r = SSL_write(wsh->ssl, (void *)((unsigned char *)data + wrote), bytes - wrote); + if (r == 0) { + ssl_err = 42; + break; + } + if (r > 0) { wrote += r; } @@ -433,9 +438,9 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) if (wsh->block) { if (sanity < WS_WRITE_SANITY * 3 / 4) { - ms = 60; + ms = 50; } else if (sanity < WS_WRITE_SANITY / 2) { - ms = 10; + ms = 25; } } ms_sleep(ms); @@ -456,6 +461,7 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) if (ssl_err) { r = ssl_err * -1; + wsh->down = 1; } return r; diff --git a/src/mod/endpoints/mod_verto/ws.c b/src/mod/endpoints/mod_verto/ws.c index 834fa3c139..73a6f4e1c5 100644 --- a/src/mod/endpoints/mod_verto/ws.c +++ b/src/mod/endpoints/mod_verto/ws.c @@ -25,7 +25,7 @@ #define WS_NOBLOCK 0 #define WS_INIT_SANITY 5000 -#define WS_WRITE_SANITY 2000 +#define WS_WRITE_SANITY 200 #define SHA1_HASH_SIZE 20 static struct ws_globals_s ws_globals; @@ -424,6 +424,11 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) do { r = SSL_write(wsh->ssl, (void *)((unsigned char *)data + wrote), bytes - wrote); + if (r == 0) { + ssl_err = 42; + break; + } + if (r > 0) { wrote += r; } @@ -433,9 +438,9 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) if (wsh->block) { if (sanity < WS_WRITE_SANITY * 3 / 4) { - ms = 60; + ms = 50; } else if (sanity < WS_WRITE_SANITY / 2) { - ms = 10; + ms = 25; } } ms_sleep(ms); @@ -456,6 +461,7 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) if (ssl_err) { r = ssl_err * -1; + wsh->down = 1; } return r; From 5a6f4679cd8c7a1fb0e9b31afac1affe32cd6b3a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 2 Nov 2017 14:50:02 -0500 Subject: [PATCH 070/264] FS-10770: [freeswitch-core] Make nack buffer bigger by default --- src/switch_rtp.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index a343d8ed06..2ef030feab 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -423,6 +423,7 @@ struct switch_rtp { switch_payload_t recv_te; switch_payload_t cng_pt; switch_mutex_t *flag_mutex; + switch_mutex_t *nack_mutex; switch_mutex_t *read_mutex; switch_mutex_t *write_mutex; switch_mutex_t *ice_mutex; @@ -4210,6 +4211,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session rtp_session->session = session; switch_mutex_init(&rtp_session->flag_mutex, SWITCH_MUTEX_NESTED, pool); + switch_mutex_init(&rtp_session->nack_mutex, SWITCH_MUTEX_NESTED, pool); switch_mutex_init(&rtp_session->read_mutex, SWITCH_MUTEX_NESTED, pool); switch_mutex_init(&rtp_session->write_mutex, SWITCH_MUTEX_NESTED, pool); switch_mutex_init(&rtp_session->ice_mutex, SWITCH_MUTEX_NESTED, pool); @@ -6475,7 +6477,12 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t for (i = 0; i < ntohs(extp->header.length) - 2; i++) { - handle_nack(rtp_session, *nack); + //handle_nack(rtp_session, *nack); + switch_mutex_lock(rtp_session->nack_mutex); + if (rtp_session->nack_idx < MAX_NACKS) { + rtp_session->nack_buf[rtp_session->nack_idx++] = *nack; + } + switch_mutex_unlock(rtp_session->nack_mutex); nack++; } @@ -8603,6 +8610,17 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra return 0; } + switch_mutex_lock(rtp_session->nack_mutex); + if (rtp_session->nack_idx) { + int i = 0; + + for(i = 0; i < rtp_session->nack_idx; i++) { + handle_nack(rtp_session, rtp_session->nack_buf[i]); + } + rtp_session->nack_idx = 0; + } + switch_mutex_unlock(rtp_session->nack_mutex); + //if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) { // rtp_session->flags[SWITCH_RTP_FLAG_DEBUG_RTP_READ]++; // rtp_session->flags[SWITCH_RTP_FLAG_DEBUG_RTP_WRITE]++; From 247ac09792fa8ba1df28fe207dc71c58bb99fadb Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 7 Nov 2017 12:14:52 -0600 Subject: [PATCH 071/264] FS-10770: [freeswitch-core] Make nack buffer bigger by default --- src/switch_rtp.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 2ef030feab..10e8387d21 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -423,7 +423,6 @@ struct switch_rtp { switch_payload_t recv_te; switch_payload_t cng_pt; switch_mutex_t *flag_mutex; - switch_mutex_t *nack_mutex; switch_mutex_t *read_mutex; switch_mutex_t *write_mutex; switch_mutex_t *ice_mutex; @@ -4211,7 +4210,6 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session rtp_session->session = session; switch_mutex_init(&rtp_session->flag_mutex, SWITCH_MUTEX_NESTED, pool); - switch_mutex_init(&rtp_session->nack_mutex, SWITCH_MUTEX_NESTED, pool); switch_mutex_init(&rtp_session->read_mutex, SWITCH_MUTEX_NESTED, pool); switch_mutex_init(&rtp_session->write_mutex, SWITCH_MUTEX_NESTED, pool); switch_mutex_init(&rtp_session->ice_mutex, SWITCH_MUTEX_NESTED, pool); @@ -6477,13 +6475,7 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t for (i = 0; i < ntohs(extp->header.length) - 2; i++) { - //handle_nack(rtp_session, *nack); - switch_mutex_lock(rtp_session->nack_mutex); - if (rtp_session->nack_idx < MAX_NACKS) { - rtp_session->nack_buf[rtp_session->nack_idx++] = *nack; - } - switch_mutex_unlock(rtp_session->nack_mutex); - nack++; + handle_nack(rtp_session, *nack); } //switch_core_media_gen_key_frame(rtp_session->session); @@ -8610,17 +8602,6 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra return 0; } - switch_mutex_lock(rtp_session->nack_mutex); - if (rtp_session->nack_idx) { - int i = 0; - - for(i = 0; i < rtp_session->nack_idx; i++) { - handle_nack(rtp_session, rtp_session->nack_buf[i]); - } - rtp_session->nack_idx = 0; - } - switch_mutex_unlock(rtp_session->nack_mutex); - //if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) { // rtp_session->flags[SWITCH_RTP_FLAG_DEBUG_RTP_READ]++; // rtp_session->flags[SWITCH_RTP_FLAG_DEBUG_RTP_WRITE]++; From f3d8a3b07a10f9de344e50081ebdb3c1a31fec4d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 13 Nov 2017 13:49:23 -0600 Subject: [PATCH 072/264] FS-10762: [freeswitch-core] Websocket logic error --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/tport/ws.c | 1 - src/mod/endpoints/mod_verto/ws.c | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 19cb5aa03f..057976b4c1 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Mon Nov 20 15:06:28 CST 2017 +Mon Jan 15 01:36:14 EST 2018 diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c index 73a6f4e1c5..ced491d829 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/ws.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/ws.c @@ -461,7 +461,6 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) if (ssl_err) { r = ssl_err * -1; - wsh->down = 1; } return r; diff --git a/src/mod/endpoints/mod_verto/ws.c b/src/mod/endpoints/mod_verto/ws.c index 73a6f4e1c5..ced491d829 100644 --- a/src/mod/endpoints/mod_verto/ws.c +++ b/src/mod/endpoints/mod_verto/ws.c @@ -461,7 +461,6 @@ ssize_t ws_raw_write(wsh_t *wsh, void *data, size_t bytes) if (ssl_err) { r = ssl_err * -1; - wsh->down = 1; } return r; From 2d5e52a01256b1b8e5ad1913b7283d427d60a36b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 14 Nov 2017 12:28:25 -0600 Subject: [PATCH 073/264] FS-10762: [freeswitch-core] Websocket logic error #resolve --- libs/sofia-sip/.update | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 057976b4c1..4b6b39e5d0 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1,5 @@ +<<<<<<< HEAD Mon Jan 15 01:36:14 EST 2018 +======= +Tue Nov 14 12:28:03 CST 2017 +>>>>>>> 96a8ad2378... FS-10762: [freeswitch-core] Websocket logic error #resolve From bcd5753d1738ae343369a01322f324e9c04ae999 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sun, 19 Nov 2017 22:34:24 -0600 Subject: [PATCH 074/264] FS-10799: [mod_commands] Add toupper and tolower api funcs #resolve --- .../applications/mod_commands/mod_commands.c | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 1f00ed7195..5b8e1a1cc9 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -1758,6 +1758,52 @@ SWITCH_STANDARD_API(url_encode_function) } +SWITCH_STANDARD_API(toupper_function) +{ + char *reply = ""; + char *data = NULL; + + if (!zstr(cmd)) { + int i; + + data = strdup(cmd); + for(i = 0; i < strlen(data); i++) { + data[i] = toupper(data[i]); + } + + reply = data; + } + + stream->write_function(stream, "%s", reply); + + switch_safe_free(data); + return SWITCH_STATUS_SUCCESS; + +} + +SWITCH_STANDARD_API(tolower_function) +{ + char *reply = ""; + char *data = NULL; + + if (!zstr(cmd)) { + int i; + + data = strdup(cmd); + for(i = 0; i < strlen(data); i++) { + data[i] = tolower(data[i]); + } + + reply = data; + } + + stream->write_function(stream, "%s", reply); + + switch_safe_free(data); + return SWITCH_STATUS_SUCCESS; + +} + SWITCH_STANDARD_API(user_exists_function) { return _find_user(cmd, session, stream, SWITCH_TRUE); @@ -7418,6 +7464,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load) SWITCH_ADD_API(commands_api_interface, "reg_url", "", reg_url_function, "@"); SWITCH_ADD_API(commands_api_interface, "url_decode", "Url decode a string", url_decode_function, ""); SWITCH_ADD_API(commands_api_interface, "url_encode", "Url encode a string", url_encode_function, ""); + SWITCH_ADD_API(commands_api_interface, "toupper", "Upper Case a string", toupper_function, ""); + SWITCH_ADD_API(commands_api_interface, "tolower", "Lower Case a string", tolower_function, ""); SWITCH_ADD_API(commands_api_interface, "user_data", "Find user data", user_data_function, "@ [var|param|attr] "); SWITCH_ADD_API(commands_api_interface, "uuid_early_ok", "stop ignoring early media", uuid_early_ok_function, ""); SWITCH_ADD_API(commands_api_interface, "user_exists", "Find a user", user_exists_function, " "); From 892181bbc22c211e99bf76fd26b77e28a9c98121 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 20 Nov 2017 15:23:54 -0600 Subject: [PATCH 075/264] FS-8761: [freeswitch-core] Memory leak in FreeSWITCH --- libs/sofia-sip/.update | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 4b6b39e5d0..1bb35370c6 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1,5 +1 @@ -<<<<<<< HEAD -Mon Jan 15 01:36:14 EST 2018 -======= -Tue Nov 14 12:28:03 CST 2017 ->>>>>>> 96a8ad2378... FS-10762: [freeswitch-core] Websocket logic error #resolve +Mon Jan 15 01:37:50 EST 2018 From 2e1f8283632ab09e40fc067ffea08acc21c8f289 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 21 Nov 2017 17:18:04 -0600 Subject: [PATCH 076/264] remove hack for chrome we don't need anymore --- src/switch_rtp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 10e8387d21..3c75988bc4 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -6493,9 +6493,9 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t double rtt_now = 0; int rtt_increase = 0, packet_loss_increase=0; - if (msg->header.type == _RTCP_PT_SR && rtp_session->ice.ice_user) { - rtp_session->send_rr = 1; - } + //if (msg->header.type == _RTCP_PT_SR && rtp_session->ice.ice_user) { + // rtp_session->send_rr = 1; + //} now = switch_micro_time_now(); /* number of microseconds since 00:00:00 january 1, 1970 UTC */ sec = (uint32_t)(now/1000000); /* converted to second (NTP most significant bits) */ From 2b5b9341e7e0ed1f8c7e7abbeec7de7d96ef4d36 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 21 Nov 2017 17:21:21 -0600 Subject: [PATCH 077/264] FS-10802: [mod_conference] Convert conference floor to id based #resolve --- .../mod_conference/conference_api.c | 29 ++++---- .../mod_conference/conference_loop.c | 18 ++--- .../mod_conference/conference_member.c | 69 ++++++++++++------- .../mod_conference/conference_video.c | 2 +- .../mod_conference/mod_conference.c | 18 ++--- .../mod_conference/mod_conference.h | 7 +- 6 files changed, 84 insertions(+), 59 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index 034763dd00..c8fa1eca6c 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -321,7 +321,7 @@ switch_status_t conference_api_sub_mute(conference_member_t *member, switch_stre if (!(data) || !strstr((char *) data, "quiet")) { conference_utils_member_set_flag(member, MFLAG_INDICATE_MUTE); } - member->score_iir = 0; + conference_member_set_score_iir(member, 0); if (stream != NULL) { stream->write_function(stream, "+OK mute %u\n", member->id); @@ -2046,26 +2046,22 @@ switch_status_t conference_api_sub_floor(conference_member_t *member, switch_str if (member == NULL) return SWITCH_STATUS_GENERR; - switch_mutex_lock(member->conference->mutex); - - if (member->conference->floor_holder == member) { - conference_member_set_floor_holder(member->conference, NULL); + if (member->conference->floor_holder == member->id) { + conference_member_set_floor_holder(member->conference, NULL, 0); if (stream != NULL) { stream->write_function(stream, "+OK floor none\n"); } - } else if (member->conference->floor_holder == NULL) { - conference_member_set_floor_holder(member->conference, member); + } else if (member->conference->floor_holder == 0) { + conference_member_set_floor_holder(member->conference, member, 0); if (stream != NULL) { stream->write_function(stream, "+OK floor %u\n", member->id); } } else { if (stream != NULL) { - stream->write_function(stream, "-ERR floor is held by %u\n", member->conference->floor_holder->id); + stream->write_function(stream, "-ERR floor is held by %u\n", member->conference->floor_holder); } } - switch_mutex_unlock(member->conference->mutex); - return SWITCH_STATUS_SUCCESS; } @@ -2356,8 +2352,6 @@ switch_status_t conference_api_sub_vid_floor(conference_member_t *member, switch return SWITCH_STATUS_FALSE; } - switch_mutex_lock(member->conference->mutex); - if (data && switch_stristr("force", (char *) data)) { force = 1; } @@ -2365,7 +2359,7 @@ switch_status_t conference_api_sub_vid_floor(conference_member_t *member, switch if (member->conference->video_floor_holder == member->id && conference_utils_test_flag(member->conference, CFLAG_VID_FLOOR_LOCK)) { conference_utils_clear_flag(member->conference, CFLAG_VID_FLOOR_LOCK); - conference_member_set_floor_holder(member->conference, member); + conference_member_set_floor_holder(member->conference, member, 0); if (stream == NULL) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "conference %s OK video floor auto\n", member->conference->name); } else { @@ -2392,8 +2386,6 @@ switch_status_t conference_api_sub_vid_floor(conference_member_t *member, switch } } - switch_mutex_unlock(member->conference->mutex); - return SWITCH_STATUS_SUCCESS; } @@ -2911,7 +2903,12 @@ void _conference_api_sub_relate_clear_member_relationship(conference_obj_t *conf if (conference_utils_member_test_flag(other_member, MFLAG_RECEIVING_VIDEO)) { conference_utils_member_clear_flag(other_member, MFLAG_RECEIVING_VIDEO); if (conference->floor_holder) { - switch_core_session_request_video_refresh(conference->floor_holder->session); + conference_member_t *omember = NULL; + + if ((omember = conference_member_get(member->conference, conference->floor_holder))) { + switch_core_session_request_video_refresh(omember->session); + switch_thread_rwlock_unlock(omember->rwlock); + } } } switch_thread_rwlock_unlock(other_member->rwlock); diff --git a/src/mod/applications/mod_conference/conference_loop.c b/src/mod/applications/mod_conference/conference_loop.c index 301f09d090..5c6947252b 100644 --- a/src/mod/applications/mod_conference/conference_loop.c +++ b/src/mod/applications/mod_conference/conference_loop.c @@ -910,9 +910,8 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob } conference_utils_member_clear_flag_locked(member, MFLAG_TALKING); conference_member_update_status_field(member); - member->score_iir = 0; + conference_member_set_score_iir(member, 0); member->floor_packets = 0; - stop_talking_handler(member); } } @@ -926,7 +925,8 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob uint32_t energy = 0, i = 0, samples = 0, j = 0; int16_t *data; int gate_check = 0; - + int score_iir = 0; + data = read_frame->data; member->score = 0; @@ -953,11 +953,13 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob switch_agc_feed(member->agc, (int16_t *)read_frame->data, (read_frame->datalen / 2) * member->conference->channels, 1); } - member->score_iir = (int) (((1.0 - SCORE_DECAY) * (float) member->score) + (SCORE_DECAY * (float) member->score_iir)); + score_iir = (int) (((1.0 - SCORE_DECAY) * (float) member->score) + (SCORE_DECAY * (float) member->score_iir)); - if (member->score_iir > SCORE_MAX_IIR) { - member->score_iir = SCORE_MAX_IIR; + if (score_iir > SCORE_MAX_IIR) { + score_iir = SCORE_MAX_IIR; } + + conference_member_set_score_iir(member, score_iir); if (member->auto_energy_level && !conference_utils_member_test_flag(member, MFLAG_TALKING)) { if (++member->auto_energy_track >= (1000 / member->conference->interval * member->conference->auto_energy_sec)) { @@ -1091,7 +1093,7 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob hangover_hits--; } - if (member == member->conference->floor_holder) { + if (member->id == member->conference->floor_holder) { member->floor_packets++; } @@ -1164,7 +1166,7 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob member->last_score = member->score; - if (member == member->conference->floor_holder) { + if (member->id == member->conference->floor_holder) { if (member->id != member->conference->video_floor_holder && (member->floor_packets > member->conference->video_floor_packets || member->energy_level == 0)) { conference_video_set_floor_holder(member->conference, member, SWITCH_FALSE); diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index c29aa41098..f971134119 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -137,7 +137,7 @@ void conference_member_update_status_field(conference_member_t *member) str = "MUTE"; } else if (switch_channel_test_flag(member->channel, CF_HOLD)) { str = "HOLD"; - } else if (member == member->conference->floor_holder) { + } else if (member->id == member->conference->floor_holder) { if (conference_utils_member_test_flag(member, MFLAG_TALKING)) { str = "TALKING (FLOOR)"; } else { @@ -169,7 +169,7 @@ void conference_member_update_status_field(conference_member_t *member) cJSON_AddItemToObject(audio, "deaf", cJSON_CreateBool(!conference_utils_member_test_flag(member, MFLAG_CAN_HEAR))); cJSON_AddItemToObject(audio, "onHold", cJSON_CreateBool(switch_channel_test_flag(member->channel, CF_HOLD))); cJSON_AddItemToObject(audio, "talking", cJSON_CreateBool(conference_utils_member_test_flag(member, MFLAG_TALKING))); - cJSON_AddItemToObject(audio, "floor", cJSON_CreateBool(member == member->conference->floor_holder)); + cJSON_AddItemToObject(audio, "floor", cJSON_CreateBool(member->id == member->conference->floor_holder)); cJSON_AddItemToObject(audio, "energyScore", cJSON_CreateNumber(member->score)); cJSON_AddItemToObject(json, "audio", audio); @@ -237,7 +237,7 @@ switch_status_t conference_member_add_event_data(conference_member_t *member, sw if (member->conference) { status = conference_event_add_data(member->conference, event); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Floor", "%s", (member == member->conference->floor_holder) ? "true" : "false" ); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Floor", "%s", (member->id == member->conference->floor_holder) ? "true" : "false" ); } if (member->session) { @@ -629,6 +629,14 @@ conference_relationship_t *conference_member_add_relationship(conference_member_ return rel; } +void conference_member_set_score_iir(conference_member_t *member, uint32_t score) +{ + member->score_iir = score; + if (member->id == member->conference->floor_holder) { + member->conference->floor_holder_score_iir = score; + } +} + /* Remove a custom relationship from a member */ switch_status_t conference_member_del_relationship(conference_member_t *member, uint32_t id) { @@ -703,7 +711,7 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m member->max_energy_level = conference->max_energy_level; member->max_energy_hit_trigger = conference->max_energy_hit_trigger; member->burst_mute_count = conference->burst_mute_count;; - member->score_iir = 0; + conference_member_set_score_iir(member, 0); member->verbose_events = conference->verbose_events; member->video_layer_id = -1; member->layer_timeout = DEFAULT_LAYER_TIMEOUT; @@ -1049,43 +1057,53 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m return status; } -void conference_member_set_floor_holder(conference_obj_t *conference, conference_member_t *member) +void conference_member_set_floor_holder(conference_obj_t *conference, conference_member_t *member, uint32_t id) { switch_event_t *event; - conference_member_t *old_member = NULL; - int old_id = 0; + int old_member = 0; + uint32_t old_id = 0; + conference_member_t *lmember = NULL; + conference->floor_holder_score_iir = 0; + if (conference->floor_holder) { - if (conference->floor_holder == member) { - return; + if ((member && conference->floor_holder == member->id) || (id && conference->floor_holder == id)) { + goto end; } else { old_member = conference->floor_holder; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Dropping floor %s\n", - switch_channel_get_name(old_member->channel)); - + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Dropping floor %d\n", old_member); } } - switch_mutex_lock(conference->mutex); + if (!member && id) { + member = lmember = conference_member_get(conference, id); + } + + if (member) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Adding floor %s\n", switch_channel_get_name(member->channel)); - conference->floor_holder = member; + conference->floor_holder = member->id; + conference_member_set_score_iir(member, 0); conference_member_update_status_field(member); } else { - conference->floor_holder = NULL; + conference->floor_holder = 0; } if (old_member) { - old_id = old_member->id; - conference_member_update_status_field(old_member); - old_member->floor_packets = 0; + conference_member_t *omember = NULL; + + if ((omember = conference_member_get(conference, old_member))) { + old_id = old_member; + conference_member_update_status_field(omember); + omember->floor_packets = 0; + switch_thread_rwlock_unlock(omember->rwlock); + } } conference_utils_set_flag(conference, CFLAG_FLOOR_CHANGE); - switch_mutex_unlock(conference->mutex); if (test_eflag(conference, EFLAG_FLOOR_CHANGE)) { switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT); @@ -1098,8 +1116,8 @@ void conference_member_set_floor_holder(conference_obj_t *conference, conference } if (conference->floor_holder) { - conference_member_add_event_data(conference->floor_holder, event); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "%d", conference->floor_holder->id); + conference_member_add_event_data(member, event); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-ID", "%d", conference->floor_holder); } else { switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "New-ID", "none"); } @@ -1107,6 +1125,11 @@ void conference_member_set_floor_holder(conference_obj_t *conference, conference switch_event_fire(&event); } + end: + + if (lmember) { + switch_thread_rwlock_unlock(lmember->rwlock); + } } /* Gain exclusive access and remove the member from the list */ @@ -1224,8 +1247,8 @@ switch_status_t conference_member_del(conference_obj_t *conference, conference_m switch_core_speech_close(&member->lsh, &flags); } - if (member == member->conference->floor_holder) { - conference_member_set_floor_holder(member->conference, NULL); + if (member->id == member->conference->floor_holder) { + conference_member_set_floor_holder(member->conference, NULL, 0); } if (member->id == member->conference->video_floor_holder) { diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 9479152ec8..97ae8d1d6e 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -4481,7 +4481,7 @@ void conference_video_find_floor(conference_member_t *member, switch_bool_t ente continue; } - if (conference->floor_holder && imember == conference->floor_holder) { + if (conference->floor_holder && imember->id == conference->floor_holder) { conference_video_set_floor_holder(conference, imember, 0); continue; } diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 0ac4c255d1..95fdfc03ac 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -117,7 +117,7 @@ void conference_list(conference_obj_t *conference, switch_stream_handle_t *strea count++; } - if (member == member->conference->floor_holder) { + if (member->id == member->conference->floor_holder) { stream->write_function(stream, "%s%s", count ? "|" : "", "floor"); count++; } @@ -242,7 +242,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob switch_size_t file_data_len = samples * 2 * conference->channels; int has_file_data = 0, members_with_video = 0, members_with_avatar = 0, members_seeing_video = 0; int nomoh = 0; - conference_member_t *floor_holder; + uint32_t floor_holder; switch_status_t moh_status = SWITCH_STATUS_SUCCESS; /* Sync the conference to a single timing source */ @@ -301,10 +301,12 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob if (conference_utils_member_test_flag(imember, MFLAG_RUNNING) && imember->session) { switch_channel_t *channel = switch_core_session_get_channel(imember->session); switch_media_flow_t video_media_flow; - - if ((!floor_holder || (imember->score_iir > SCORE_IIR_SPEAKING_MAX && (floor_holder->score_iir < SCORE_IIR_SPEAKING_MIN)))) {// && + + if ((!floor_holder || (imember->id != conference->floor_holder && imember->score_iir > SCORE_IIR_SPEAKING_MAX && (conference->floor_holder_score_iir < SCORE_IIR_SPEAKING_MIN)))) {// && //(!conference_utils_test_flag(conference, CFLAG_VID_FLOOR) || switch_channel_test_flag(channel, CF_VIDEO))) { - floor_holder = imember; + + conference_member_set_floor_holder(conference, imember, 0); + floor_holder = imember->id; } video_media_flow = switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO); @@ -364,7 +366,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob conference->members_with_avatar = members_with_avatar; if (floor_holder != conference->floor_holder) { - conference_member_set_floor_holder(conference, floor_holder); + conference_member_set_floor_holder(conference, NULL, floor_holder); } if (conference->moh_wait > 0) { @@ -1271,7 +1273,7 @@ void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, i switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_VIDEO_BRIDGE) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "has_floor", count++); - switch_xml_set_txt_d(x_tag, (member == member->conference->floor_holder) ? "true" : "false"); + switch_xml_set_txt_d(x_tag, (member->id == member->conference->floor_holder) ? "true" : "false"); x_tag = switch_xml_add_child_d(x_flags, "is_moderator", count++); switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); @@ -1376,7 +1378,7 @@ void conference_jlist(conference_obj_t *conference, cJSON *json_conferences) ADDBOOL(json_conference_member_flags, "talking", conference_utils_member_test_flag(member, MFLAG_TALKING)); ADDBOOL(json_conference_member_flags, "has_video", switch_channel_test_flag(switch_core_session_get_channel(member->session), CF_VIDEO)); ADDBOOL(json_conference_member_flags, "video_bridge", conference_utils_member_test_flag(member, MFLAG_VIDEO_BRIDGE)); - ADDBOOL(json_conference_member_flags, "has_floor", member == member->conference->floor_holder); + ADDBOOL(json_conference_member_flags, "has_floor", member->id == member->conference->floor_holder); ADDBOOL(json_conference_member_flags, "is_moderator", conference_utils_member_test_flag(member, MFLAG_MOD)); ADDBOOL(json_conference_member_flags, "end_conference", conference_utils_member_test_flag(member, MFLAG_ENDCONF)); } diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h index c7ae4bf3cc..ff15c7329e 100644 --- a/src/mod/applications/mod_conference/mod_conference.h +++ b/src/mod/applications/mod_conference/mod_conference.h @@ -673,7 +673,7 @@ typedef struct conference_obj { uint32_t channels; switch_mutex_t *mutex; conference_member_t *members; - conference_member_t *floor_holder; + uint32_t floor_holder; uint32_t video_floor_holder; uint32_t last_video_floor_holder; switch_mutex_t *member_mutex; @@ -754,6 +754,7 @@ typedef struct conference_obj { int scale_h264_canvas_fps_divisor; char *scale_h264_canvas_bandwidth; uint32_t moh_wait; + uint32_t floor_holder_score_iir; } conference_obj_t; /* Relationship with another member */ @@ -1025,7 +1026,7 @@ al_handle_t *conference_al_create(switch_memory_pool_t *pool); switch_status_t conference_member_parse_position(conference_member_t *member, const char *data); video_layout_t *conference_video_find_best_layout(conference_obj_t *conference, layout_group_t *lg, uint32_t count, uint32_t file_count); void conference_list_count_only(conference_obj_t *conference, switch_stream_handle_t *stream); -void conference_member_set_floor_holder(conference_obj_t *conference, conference_member_t *member); +void conference_member_set_floor_holder(conference_obj_t *conference, conference_member_t *member, uint32_t id); void conference_utils_member_clear_flag(conference_member_t *member, member_flag_t flag); void conference_utils_member_clear_flag_locked(conference_member_t *member, member_flag_t flag); switch_status_t conference_video_attach_video_layer(conference_member_t *member, mcu_canvas_t *canvas, int idx); @@ -1084,7 +1085,7 @@ void conference_member_check_channels(switch_frame_t *frame, conference_member_t void conference_fnode_toggle_pause(conference_file_node_t *fnode, switch_stream_handle_t *stream); void conference_fnode_check_status(conference_file_node_t *fnode, switch_stream_handle_t *stream); - +void conference_member_set_score_iir(conference_member_t *member, uint32_t score); // static conference_relationship_t *conference_member_get_relationship(conference_member_t *member, conference_member_t *other_member); // static void conference_list(conference_obj_t *conference, switch_stream_handle_t *stream, char *delim); From b8744e4c6d27b667f719c768bb30a07bc7830ca5 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 21 Nov 2017 18:40:59 -0600 Subject: [PATCH 078/264] FS-10803: [mod_conference] Add support for alternate video layout config per conference profile #resolve --- .../mod_conference/conference_api.c | 12 +++++++++--- .../mod_conference/conference_member.c | 3 +-- .../mod_conference/conference_video.c | 14 ++++++++++++-- .../mod_conference/mod_conference.c | 18 +++++++++++++++++- .../mod_conference/mod_conference.h | 2 ++ 5 files changed, 41 insertions(+), 8 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index c8fa1eca6c..1f8d586e64 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -2269,7 +2269,8 @@ switch_status_t conference_api_sub_vid_res_id(conference_member_t *member, switc switch_status_t conference_api_sub_vid_role_id(conference_member_t *member, switch_stream_handle_t *stream, void *data) { char *text = (char *) data; - + int force = 0; + if (member == NULL) return SWITCH_STATUS_GENERR; @@ -2281,8 +2282,13 @@ switch_status_t conference_api_sub_vid_role_id(conference_member_t *member, swit stream->write_function(stream, "-ERR conference is not in mixing mode\n"); return SWITCH_STATUS_SUCCESS; } - - if (zstr(text) || !strcasecmp(text, "clear") || (member->video_role_id && !strcasecmp(text, member->video_role_id))) { + + if (!zstr(text) && *text == '=') { + text++; + force = 1; + } + + if (zstr(text) || !strcasecmp(text, "clear") || (!force && member->video_role_id && !strcasecmp(text, member->video_role_id))) { member->video_role_id = NULL; stream->write_function(stream, "+OK role_id cleared\n"); } else { diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index f971134119..e55b068416 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -1065,7 +1065,7 @@ void conference_member_set_floor_holder(conference_obj_t *conference, conference conference_member_t *lmember = NULL; conference->floor_holder_score_iir = 0; - + if (conference->floor_holder) { if ((member && conference->floor_holder == member->id) || (id && conference->floor_holder == id)) { goto end; @@ -1079,7 +1079,6 @@ void conference_member_set_floor_holder(conference_obj_t *conference, conference member = lmember = conference_member_get(conference, id); } - if (member) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Adding floor %s\n", switch_channel_get_name(member->channel)); diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 97ae8d1d6e..6fa1c7dc7c 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -85,8 +85,8 @@ void conference_video_parse_layouts(conference_obj_t *conference, int WIDTH, int switch_assert(params); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "conference_name", conference->name); - if (!(cxml = switch_xml_open_cfg("conference_layouts.conf", &cfg, params))) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", "conference_layouts.conf"); + if (!(cxml = switch_xml_open_cfg(conference->video_layout_conf, &cfg, params))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", conference->video_layout_conf); goto done; } @@ -272,6 +272,9 @@ void conference_video_parse_layouts(conference_obj_t *conference, int WIDTH, int vlayout->layers++; } + if (!conference->default_layout_name) { + conference->default_layout_name = switch_core_strdup(conference->pool, name); + } switch_core_hash_insert(conference->layout_hash, name, vlayout); if (!COMPLETE_INIT) { @@ -4526,10 +4529,17 @@ void conference_video_set_floor_holder(conference_obj_t *conference, conference_ } if (member && member->video_reservation_id) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Setting floor not allowed on a member with a res id\n"); /* no video floor when a reservation id is set */ return; } + if (member && member->video_role_id) { + /* no video floor when a role id is set */ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Setting floor not allowed on a member with a role id\n"); + return; + } + if ((!force && conference_utils_test_flag(conference, CFLAG_VID_FLOOR_LOCK))) { return; } diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 95fdfc03ac..eadf6c22a9 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -306,7 +306,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob //(!conference_utils_test_flag(conference, CFLAG_VID_FLOOR) || switch_channel_test_flag(channel, CF_VIDEO))) { conference_member_set_floor_holder(conference, imember, 0); - floor_holder = imember->id; + floor_holder = conference->floor_holder; } video_media_flow = switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO); @@ -2642,6 +2642,7 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co char *perpetual_sound = NULL; char *moh_sound = NULL; char *outcall_templ = NULL; + char *video_layout_conf = NULL; char *video_layout_name = NULL; char *video_layout_group = NULL; char *video_canvas_size = NULL; @@ -2825,6 +2826,8 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co outcall_templ = val; } else if (!strcasecmp(var, "video-layout-name") && !zstr(val)) { video_layout_name = val; + } else if (!strcasecmp(var, "video-layout-conf") && !zstr(val)) { + video_layout_conf = val; } else if (!strcasecmp(var, "video-canvas-count") && !zstr(val)) { video_canvas_count = atoi(val); } else if (!strcasecmp(var, "video-super-canvas-label-layers") && !zstr(val)) { @@ -3064,6 +3067,10 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co /* Set defaults and various paramaters */ + if (zstr(video_layout_conf)) { + video_layout_conf = "conference_layouts.conf"; + } + /* Timer module to use */ if (zstr(timer_name)) { timer_name = "soft"; @@ -3110,6 +3117,7 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co conference->tts_voice = switch_core_strdup(conference->pool, tts_voice); } + conference->video_layout_conf = switch_core_strdup(conference->pool, video_layout_conf); conference->comfort_noise_level = comfort_noise_level; conference->pin_retries = pin_retries; conference->caller_id_name = switch_core_strdup(conference->pool, caller_id_name); @@ -3242,6 +3250,14 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co conference->video_layout_group = switch_core_strdup(conference->pool, video_layout_group); } + if (!conference_video_get_layout(conference, video_layout_name, video_layout_group)) { + conference->video_layout_name = conference->video_layout_group = video_layout_group = video_layout_name = NULL; + if (conference_video_get_layout(conference, conference->default_layout_name, NULL)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Defaulting to layout %s\n", conference->default_layout_name); + video_layout_name = conference->video_layout_name = conference->default_layout_name; + } + } + if (!conference_video_get_layout(conference, video_layout_name, video_layout_group)) { conference->video_layout_name = conference->video_layout_group = video_layout_group = video_layout_name = NULL; conference->conference_video_mode = CONF_VIDEO_MODE_TRANSCODE; diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h index ff15c7329e..5f83db4db2 100644 --- a/src/mod/applications/mod_conference/mod_conference.h +++ b/src/mod/applications/mod_conference/mod_conference.h @@ -628,6 +628,7 @@ typedef struct conference_obj { int auto_record_canvas; char *record_filename; char *outcall_templ; + char *video_layout_conf; char *video_layout_name; char *video_layout_group; char *video_canvas_bgcolor; @@ -755,6 +756,7 @@ typedef struct conference_obj { char *scale_h264_canvas_bandwidth; uint32_t moh_wait; uint32_t floor_holder_score_iir; + char *default_layout_name; } conference_obj_t; /* Relationship with another member */ From 376cc03f58694fd042addeebe2bd9ff7f86bad7a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 22 Nov 2017 14:21:50 -0600 Subject: [PATCH 079/264] FS-10803: [mod_conference] Add support for alternate video layout config per conference profile --- src/mod/applications/mod_conference/conference_video.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 6fa1c7dc7c..1f3eaed838 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -4534,12 +4534,6 @@ void conference_video_set_floor_holder(conference_obj_t *conference, conference_ return; } - if (member && member->video_role_id) { - /* no video floor when a role id is set */ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Setting floor not allowed on a member with a role id\n"); - return; - } - if ((!force && conference_utils_test_flag(conference, CFLAG_VID_FLOOR_LOCK))) { return; } From 86ae01462a79dc5d481671b6bc97cb1ead1e9cfc Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 27 Nov 2017 12:56:51 -0600 Subject: [PATCH 080/264] FS-10802: [mod_conference] Convert conference floor to id based --- .../mod_conference/conference_api.c | 16 +++++++++++ .../mod_conference/conference_member.c | 15 +++++++---- .../mod_conference/conference_video.c | 27 ++++++++++++++----- .../mod_conference/mod_conference.c | 7 +++-- .../mod_conference/mod_conference.h | 1 + 5 files changed, 53 insertions(+), 13 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index 1f8d586e64..d0d8b5ebc6 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -2046,6 +2046,14 @@ switch_status_t conference_api_sub_floor(conference_member_t *member, switch_str if (member == NULL) return SWITCH_STATUS_GENERR; + if (conference_utils_member_test_flag(member, MFLAG_DED_VID_LAYER)) { + if (stream != NULL) { + stream->write_function(stream, "-ERR cannot set floor on a member in an active video role\n"); + } + + return SWITCH_STATUS_SUCCESS; + } + if (member->conference->floor_holder == member->id) { conference_member_set_floor_holder(member->conference, NULL, 0); if (stream != NULL) { @@ -2358,6 +2366,14 @@ switch_status_t conference_api_sub_vid_floor(conference_member_t *member, switch return SWITCH_STATUS_FALSE; } + if (conference_utils_member_test_flag(member, MFLAG_DED_VID_LAYER)) { + if (stream != NULL) { + stream->write_function(stream, "-ERR cannot set floor on a member in an active video role\n"); + } + + return SWITCH_STATUS_SUCCESS; + } + if (data && switch_stristr("force", (char *) data)) { force = 1; } diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index e55b068416..5121ee3168 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -1064,8 +1064,17 @@ void conference_member_set_floor_holder(conference_obj_t *conference, conference uint32_t old_id = 0; conference_member_t *lmember = NULL; - conference->floor_holder_score_iir = 0; + if (!member && id) { + member = lmember = conference_member_get(conference, id); + } + + if (member && conference_utils_member_test_flag(member, MFLAG_DED_VID_LAYER)) { + return; + } + + conference->floor_holder_score_iir = 0; + if (conference->floor_holder) { if ((member && conference->floor_holder == member->id) || (id && conference->floor_holder == id)) { goto end; @@ -1074,10 +1083,6 @@ void conference_member_set_floor_holder(conference_obj_t *conference, conference switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Dropping floor %d\n", old_member); } } - - if (!member && id) { - member = lmember = conference_member_get(conference, id); - } if (member) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Adding floor %s\n", diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 1f3eaed838..b4a9c8d42c 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -1080,6 +1080,8 @@ void conference_video_detach_video_layer(conference_member_t *member) conference_video_set_canvas_bgimg(canvas, NULL); } + conference_utils_member_clear_flag(member, MFLAG_DED_VID_LAYER); + end: switch_mutex_unlock(canvas->mutex); @@ -1336,18 +1338,27 @@ switch_status_t conference_video_attach_video_layer(conference_member_t *member, if (conference_utils_test_flag(member->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS) && !conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) { + conference_utils_member_clear_flag(member, MFLAG_DED_VID_LAYER); return SWITCH_STATUS_FALSE; } if (!switch_channel_test_flag(channel, CF_VIDEO_READY) && !member->avatar_png_img) { + conference_utils_member_clear_flag(member, MFLAG_DED_VID_LAYER); return SWITCH_STATUS_FALSE; } if ((switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY || switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) && !member->avatar_png_img) { + conference_utils_member_clear_flag(member, MFLAG_DED_VID_LAYER); return SWITCH_STATUS_FALSE; } + if (conference_utils_member_test_flag(member, MFLAG_DED_VID_LAYER)) { + if (member->id == member->conference->floor_holder) { + conference_member_set_floor_holder(member->conference, NULL, 0); + } + } + switch_mutex_lock(canvas->mutex); layer = &canvas->layers[idx]; @@ -2540,6 +2551,7 @@ switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_ca if (xlayer->geometry.res_id) { if (member->video_reservation_id && !strcmp(xlayer->geometry.res_id, member->video_reservation_id)) { layer = xlayer; + conference_utils_member_set_flag(member, MFLAG_DED_VID_LAYER); conference_video_attach_video_layer(member, canvas, i); break; } @@ -2571,7 +2583,7 @@ switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_ca !xlayer->fnode && !xlayer->geometry.fileonly && !xlayer->geometry.res_id && !xlayer->geometry.flooronly) { switch_status_t lstatus = conference_video_attach_video_layer(member, canvas, i); - if (lstatus == SWITCH_STATUS_SUCCESS || lstatus == SWITCH_STATUS_BREAK) { + if (lstatus == SWITCH_STATUS_SUCCESS || lstatus == SWITCH_STATUS_BREAK) { layer = xlayer; break; } @@ -3322,6 +3334,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr mcu_layer_t *xlayer = &canvas->layers[i]; if (!zstr(imember->video_role_id) && !zstr(xlayer->geometry.role_id) && !strcmp(xlayer->geometry.role_id, imember->video_role_id)) { + conference_utils_member_set_flag(imember, MFLAG_DED_VID_LAYER); conference_video_attach_video_layer(imember, canvas, i); } } @@ -4468,6 +4481,10 @@ void conference_video_find_floor(conference_member_t *member, switch_bool_t ente switch_mutex_lock(conference->member_mutex); for (imember = conference->members; imember; imember = imember->next) { + if (conference_utils_member_test_flag(imember, MFLAG_DED_VID_LAYER)) { + continue; + } + if (!(imember->session)) { continue; } @@ -4528,12 +4545,10 @@ void conference_video_set_floor_holder(conference_obj_t *conference, conference_ return; } - if (member && member->video_reservation_id) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Setting floor not allowed on a member with a res id\n"); - /* no video floor when a reservation id is set */ - return; + if (member && conference_utils_member_test_flag(member, MFLAG_DED_VID_LAYER)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Setting floor not allowed on a member in a dedicated layer\n"); } - + if ((!force && conference_utils_test_flag(conference, CFLAG_VID_FLOOR_LOCK))) { return; } diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index eadf6c22a9..7ca2215e62 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -305,8 +305,11 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob if ((!floor_holder || (imember->id != conference->floor_holder && imember->score_iir > SCORE_IIR_SPEAKING_MAX && (conference->floor_holder_score_iir < SCORE_IIR_SPEAKING_MIN)))) {// && //(!conference_utils_test_flag(conference, CFLAG_VID_FLOOR) || switch_channel_test_flag(channel, CF_VIDEO))) { - conference_member_set_floor_holder(conference, imember, 0); - floor_holder = conference->floor_holder; + + if (!conference_utils_member_test_flag(imember, MFLAG_DED_VID_LAYER)) { + conference_member_set_floor_holder(conference, imember, 0); + floor_holder = conference->floor_holder; + } } video_media_flow = switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO); diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h index 5f83db4db2..45c09d52dc 100644 --- a/src/mod/applications/mod_conference/mod_conference.h +++ b/src/mod/applications/mod_conference/mod_conference.h @@ -218,6 +218,7 @@ typedef enum { MFLAG_TALK_DATA_EVENTS, MFLAG_NO_VIDEO_BLANKS, MFLAG_VIDEO_JOIN, + MFLAG_DED_VID_LAYER, /////////////////////////// MFLAG_MAX } member_flag_t; From 6bd169abc20c35b9557b0dc4ebecb54732fe829c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 27 Nov 2017 18:07:22 -0600 Subject: [PATCH 081/264] FS-10802: [mod_conference] Convert conference floor to id based --- src/mod/applications/mod_conference/conference_video.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index b4a9c8d42c..93bb35a9d4 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -1031,6 +1031,8 @@ void conference_video_detach_video_layer(conference_member_t *member) if (member->canvas_id < 0) return; + conference_utils_member_clear_flag(member, MFLAG_DED_VID_LAYER); + if (!(canvas = conference_video_get_canvas_locked(member))) { return; } @@ -1080,8 +1082,6 @@ void conference_video_detach_video_layer(conference_member_t *member) conference_video_set_canvas_bgimg(canvas, NULL); } - conference_utils_member_clear_flag(member, MFLAG_DED_VID_LAYER); - end: switch_mutex_unlock(canvas->mutex); @@ -1545,9 +1545,11 @@ void conference_video_init_canvas_layers(conference_obj_t *conference, mcu_canva mcu_layer_t *layer = &canvas->layers[i]; if (layer->member) { - //conference_video_detach_video_layer(layer->member); conference_video_clear_managed_kps(layer->member); layer->member->video_layer_id = -1; + + conference_video_detach_video_layer(layer->member); + layer->member = NULL; } layer->member_id = 0; From 2c66f126d74f3f1d83b1838b9007a5116050c331 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 27 Nov 2017 18:08:14 -0600 Subject: [PATCH 082/264] FS-10769: [mod_av,mod_conference] Lipsync issues in conference recording --- src/mod/applications/mod_av/avformat.c | 44 +++++++++++++------ .../mod_conference/conference_video.c | 5 ++- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index 2e97a264d2..644261699f 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -130,6 +130,8 @@ struct av_file_context { switch_file_handle_t *handle; int16_t *mux_buf; switch_size_t mux_buf_len; + + switch_time_t last_vid_write; }; typedef struct av_file_context av_file_context_t; @@ -1845,8 +1847,8 @@ static switch_status_t av_file_write(switch_file_handle_t *handle, void *data, s // uint32_t size = 0; uint32_t bytes; int inuse; - int sample_start; - + int sample_start = 0; + if (!switch_test_flag(handle, SWITCH_FILE_FLAG_WRITE)) { return SWITCH_STATUS_FALSE; } @@ -1901,12 +1903,38 @@ GCC_DIAG_ON(deprecated-declarations) } } + + if (context->video_timer.interval) { + int delta; + switch_core_timer_sync(&context->video_timer); + + delta = context->video_timer.samplecount - context->last_vid_write; + + if (delta >= 60) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Video timer sync: %ld/%d %ld\n", context->audio_st[0].next_pts, context->video_timer.samplecount, context->audio_st[0].next_pts- context->video_timer.samplecount); + sample_start = context->video_timer.samplecount * (handle->samplerate / 1000); + } + + context->last_vid_write = context->video_timer.samplecount; + } + + + if (sample_start) { + int j = 0; + + for (j = 0; j < 2; j++) { + if (context->audio_st[j].active) { + context->audio_st[j].next_pts = sample_start; + } + } + } + while ((inuse = switch_buffer_inuse(context->audio_buffer)) >= bytes) { AVPacket pkt[2] = { {0} }; int got_packet[2] = {0}; int j = 0, ret = -1, audio_stream_count = 1; AVFrame *use_frame = NULL; - + av_init_packet(&pkt[0]); av_init_packet(&pkt[1]); @@ -1936,16 +1964,6 @@ GCC_DIAG_ON(deprecated-declarations) switch_buffer_read(context->audio_buffer, context->audio_st[0].frame->data[0], bytes); } - /* Sync all audio stream timestamps to video timer */ - if (context->video_timer.interval) { - switch_core_timer_sync(&context->video_timer); - sample_start = context->video_timer.samplecount * (handle->samplerate / 1000); - - for (j = 0; j < audio_stream_count; j++) { - context->audio_st[j].next_pts = sample_start; - } - } - for (j = 0; j < audio_stream_count; j++) { av_frame_make_writable(context->audio_st[j].frame); diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 93bb35a9d4..547e88c326 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3071,7 +3071,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr canvas->video_count = last_video_count = video_count; switch_mutex_unlock(conference->member_mutex); - switch_core_timer_next(&canvas->timer); + if (canvas->playing_video_file) { + switch_core_timer_next(&canvas->timer); + } now = switch_micro_time_now(); @@ -3841,6 +3843,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr } } + switch_core_timer_next(&canvas->timer); wait_for_canvas(canvas); for (i = 0; i < canvas->total_layers; i++) { From 57daad7af89c556254618fab144c015f0c5cdfa8 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 28 Nov 2017 14:14:15 -0600 Subject: [PATCH 083/264] FS-10802: [mod_conference] Convert conference floor to id based --- src/mod/applications/mod_conference/conference_video.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 547e88c326..50da2bc350 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -1353,6 +1353,10 @@ switch_status_t conference_video_attach_video_layer(conference_member_t *member, return SWITCH_STATUS_FALSE; } + if (!zstr(member->video_role_id) && !zstr(layer->geometry.role_id) && !strcmp(layer->geometry.role_id, member->video_role_id)) { + conference_utils_member_set_flag(member, MFLAG_DED_VID_LAYER); + } + if (conference_utils_member_test_flag(member, MFLAG_DED_VID_LAYER)) { if (member->id == member->conference->floor_holder) { conference_member_set_floor_holder(member->conference, NULL, 0); From 0d40025e09aa6bd3261de3ce34b6a36e0116e28f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 28 Nov 2017 17:44:27 -0600 Subject: [PATCH 084/264] FS-10891: [mod_conference] Refactor mux video to be smoother #resolve --- .../applications/mod_conference/conference_video.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 50da2bc350..d94847d098 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -2625,11 +2625,15 @@ void conference_video_pop_next_image(conference_member_t *member, switch_image_t switch_image_t *img = *imgP; int size = 0; void *pop; - + int half; //if (member->avatar_png_img && switch_channel_test_flag(member->channel, CF_VIDEO_READY) && conference_utils_member_test_flag(member, MFLAG_ACK_VIDEO)) { // switch_img_free(&member->avatar_png_img); //} + if ((half = switch_queue_size(member->video_queue) / 2) < 1) { + half = 1; + } + if (switch_channel_test_flag(member->channel, CF_VIDEO_READY)) { do { pop = NULL; @@ -2641,7 +2645,7 @@ void conference_video_pop_next_image(conference_member_t *member, switch_image_t break; } size = switch_queue_size(member->video_queue); - } while(size > 0); + } while(size > half); if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && member->video_layer_id > -1 && @@ -3849,7 +3853,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr switch_core_timer_next(&canvas->timer); wait_for_canvas(canvas); - + for (i = 0; i < canvas->total_layers; i++) { mcu_layer_t *layer = &canvas->layers[i]; @@ -4809,7 +4813,7 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session, if (frame->img && (((member->video_layer_id > -1) && canvas_id > -1) || member->canvas) && conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && - switch_queue_size(member->video_queue) < 2 && //member->conference->video_fps.fps * 2 && + switch_queue_size(member->video_queue) < member->conference->video_fps.fps && !member->conference->canvases[canvas_id]->playing_video_file) { if (conference_utils_member_test_flag(member, MFLAG_FLIP_VIDEO) || conference_utils_member_test_flag(member, MFLAG_ROTATE_VIDEO)) { From 105a291bb7602c5cfb8fcef574920b821027b12f Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 29 Nov 2017 14:27:00 -0600 Subject: [PATCH 085/264] FS-10892: [mod_av] Lip Sync Improvements #resolve --- src/mod/applications/mod_av/avformat.c | 18 ++++++++++++++---- .../mod_conference/conference_record.c | 4 ++-- .../mod_conference/conference_video.c | 12 ++++++------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index 644261699f..04101629c4 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -132,6 +132,7 @@ struct av_file_context { switch_size_t mux_buf_len; switch_time_t last_vid_write; + int audio_timer; }; typedef struct av_file_context av_file_context_t; @@ -1585,11 +1586,17 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa context->seek_ts = -1; context->offset = DFT_RECORD_OFFSET; context->handle = handle; - + context->audio_timer = 1; + if (handle->params) { if ((tmp = switch_event_get_header(handle->params, "av_video_offset"))) { context->offset = atoi(tmp); } + if ((tmp = switch_event_get_header(handle->params, "video_time_audio"))) { + if (tmp && switch_false(tmp)) { + context->audio_timer = 0; + } + } } switch_mutex_init(&context->mutex, SWITCH_MUTEX_NESTED, handle->memory_pool); @@ -1910,9 +1917,12 @@ GCC_DIAG_ON(deprecated-declarations) delta = context->video_timer.samplecount - context->last_vid_write; - if (delta >= 60) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Video timer sync: %ld/%d %ld\n", context->audio_st[0].next_pts, context->video_timer.samplecount, context->audio_st[0].next_pts- context->video_timer.samplecount); - sample_start = context->video_timer.samplecount * (handle->samplerate / 1000); + if (context->audio_timer || delta >= 60) { + uint32_t new_pts = context->video_timer.samplecount * (handle->samplerate / 1000); + if (!context->audio_timer) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Delta of %d detected. Video timer sync: %ld/%d %ld\n", delta, context->audio_st[0].next_pts, context->video_timer.samplecount, new_pts - context->audio_st[0].next_pts); + } + sample_start = new_pts; } context->last_vid_write = context->video_timer.samplecount; diff --git a/src/mod/applications/mod_conference/conference_record.c b/src/mod/applications/mod_conference/conference_record.c index 784101fb7f..e54c8fcb96 100644 --- a/src/mod/applications/mod_conference/conference_record.c +++ b/src/mod/applications/mod_conference/conference_record.c @@ -233,7 +233,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v flags |= SWITCH_FILE_FLAG_VIDEO; if (canvas) { - rec->path = switch_core_sprintf(rec->pool, "{channels=%d,samplerate=%d,vw=%d,vh=%d,fps=%0.2f}%s", + rec->path = switch_core_sprintf(rec->pool, "{video_time_audio=false,channels=%d,samplerate=%d,vw=%d,vh=%d,fps=%0.2f}%s", conference->channels, conference->rate, canvas->width, @@ -241,7 +241,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v conference->video_fps.fps, orig_path); } else { - rec->path = switch_core_sprintf(rec->pool, "{channels=%d,samplerate=%d,vw=%d,vh=%d,fps=%0.2f}%s", + rec->path = switch_core_sprintf(rec->pool, "{video_time_audio=false,channels=%d,samplerate=%d,vw=%d,vh=%d,fps=%0.2f}%s", conference->channels, conference->rate, conference->canvas_width, diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index d94847d098..19732ffbc5 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -1353,6 +1353,12 @@ switch_status_t conference_video_attach_video_layer(conference_member_t *member, return SWITCH_STATUS_FALSE; } + switch_mutex_lock(canvas->mutex); + + layer = &canvas->layers[idx]; + + layer->tagged = 0; + if (!zstr(member->video_role_id) && !zstr(layer->geometry.role_id) && !strcmp(layer->geometry.role_id, member->video_role_id)) { conference_utils_member_set_flag(member, MFLAG_DED_VID_LAYER); } @@ -1363,12 +1369,6 @@ switch_status_t conference_video_attach_video_layer(conference_member_t *member, } } - switch_mutex_lock(canvas->mutex); - - layer = &canvas->layers[idx]; - - layer->tagged = 0; - if (layer->fnode || layer->geometry.fileonly) { switch_goto_status(SWITCH_STATUS_FALSE, end); } From 2e449917b2c4ad2c9859eb47f56bb827027183e4 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Wed, 29 Nov 2017 13:11:13 +0800 Subject: [PATCH 086/264] fix split slice --- src/mod/applications/mod_av/avcodec.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mod/applications/mod_av/avcodec.c b/src/mod/applications/mod_av/avcodec.c index 9c320d1123..cb19d7dca8 100644 --- a/src/mod/applications/mod_av/avcodec.c +++ b/src/mod/applications/mod_av/avcodec.c @@ -761,7 +761,7 @@ static switch_status_t consume_h264_bitstream(h264_codec_context_t *context, swi frame->datalen = nalu->len; context->nalu_current_index++; - if (nalu_type == 6 || nalu_type == 7 || nalu_type == 8 || context->nalus[context->nalu_current_index].len) { + if (context->nalus[context->nalu_current_index].len) { frame->m = 0; return SWITCH_STATUS_MORE_DATA; } @@ -780,10 +780,15 @@ static switch_status_t consume_h264_bitstream(h264_codec_context_t *context, swi memcpy(p+2, nalu->eat, left); nalu->eat += left; frame->datalen = left + 2; - frame->m = 1; context->nalu_current_index++; - if (pkt->size > 0) av_packet_unref(pkt); - return SWITCH_STATUS_SUCCESS; + + if (!context->nalus[context->nalu_current_index].len) { + if (pkt->size > 0) av_packet_unref(pkt); + frame->m = 1; + return SWITCH_STATUS_SUCCESS; + } + + return SWITCH_STATUS_MORE_DATA; } p[0] = nri | 28; // FU-A @@ -792,6 +797,7 @@ static switch_status_t consume_h264_bitstream(h264_codec_context_t *context, swi memcpy(p+2, nalu->eat, SLICE_SIZE - 2); nalu->eat += (SLICE_SIZE - 2); frame->datalen = SLICE_SIZE; + frame->m = 0; return SWITCH_STATUS_MORE_DATA; } @@ -1238,7 +1244,10 @@ GCC_DIAG_ON(deprecated-declarations) context->nalus[i].start = p; context->nalus[i].eat = p; } - if (i >= MAX_NALUS - 2) break; + if (i >= MAX_NALUS - 2) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "TOO MANY SLICES!\n"); + break; + } } context->nalus[i].len = p - context->nalus[i].start; From 683f59f38d26336b7e85baab3791511a6a29bfae Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 30 Nov 2017 16:16:31 -0600 Subject: [PATCH 087/264] FS-10821: [mod_conference] fix arg parser in file vol command in conference #resolve --- src/mod/applications/mod_conference/conference_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index d0d8b5ebc6..74ad5fdb32 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -3551,7 +3551,7 @@ switch_status_t conference_api_sub_file_vol(conference_obj_t *conference, switch int vol = 0; int ok = 0; - if (argc < 2) { + if (argc < 3) { stream->write_function(stream, "-ERR missing args\n"); return SWITCH_STATUS_GENERR; } From 8fabf32f8f076a137a4123e99c9d95e6e72592a8 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 6 Dec 2017 23:20:39 -0600 Subject: [PATCH 088/264] FS-10890: [mod_av] Wrongly calculated delta_tmp for end of video file recording #resolve --- src/mod/applications/mod_av/avformat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index 04101629c4..31a416d7e1 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -848,7 +848,7 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void * uint64_t delta_tmp; switch_core_timer_sync(context->eh.video_timer); - delta_tmp = context->eh.video_timer->samplecount - context->eh.last_ts; + delta_tmp = (context->eh.video_timer->samplecount * 90) - context->eh.last_ts; if (delta_tmp != 0) { delta_sum += delta_tmp; From a83990a5aa4f3ebed4b4f35dc074009b16af535a Mon Sep 17 00:00:00 2001 From: Seven Du Date: Sun, 10 Dec 2017 10:56:48 +0800 Subject: [PATCH 089/264] tweak av and ensure first image write at pts = 0 to avoid a black screen --- src/include/switch_module_interfaces.h | 1 + src/mod/applications/mod_av/avcodec.c | 4 ++- src/mod/applications/mod_av/avformat.c | 44 ++++++++++++++------------ 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/src/include/switch_module_interfaces.h b/src/include/switch_module_interfaces.h index da6d6be91e..067660253f 100644 --- a/src/include/switch_module_interfaces.h +++ b/src/include/switch_module_interfaces.h @@ -621,6 +621,7 @@ struct switch_video_codec_settings { int32_t width; int32_t height; uint8_t try_hardware_encoder; + uint8_t fps; }; union switch_codec_settings { diff --git a/src/mod/applications/mod_av/avcodec.c b/src/mod/applications/mod_av/avcodec.c index cb19d7dca8..5994e48aba 100644 --- a/src/mod/applications/mod_av/avcodec.c +++ b/src/mod/applications/mod_av/avcodec.c @@ -890,7 +890,9 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt if (context->codec_settings.video.bandwidth) { context->bandwidth = context->codec_settings.video.bandwidth; } else { - context->bandwidth = switch_calc_bitrate(context->codec_settings.video.width, context->codec_settings.video.height, 1, 15); + double fps = context->codec_settings.video.fps > 0 ? context->codec_settings.video.fps : 15.0; + + context->bandwidth = switch_calc_bitrate(context->codec_settings.video.width, context->codec_settings.video.height, 1, fps); } sane = switch_calc_bitrate(1920, 1080, 3, 60); diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index 31a416d7e1..aab7d50a40 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -470,7 +470,7 @@ GCC_DIAG_ON(deprecated-declarations) mst->st->time_base.num = 1; c->time_base.den = 90000; c->time_base.num = 1; - c->gop_size = 25; /* emit one intra frame every x frames at mmst */ + c->gop_size = fps * 10; /* emit one intra frame every 10 frames at most */ c->pix_fmt = AV_PIX_FMT_YUV420P; //c->thread_count = threads; c->rc_initial_buffer_occupancy = buffer_bytes * 8; @@ -523,25 +523,19 @@ GCC_DIAG_ON(deprecated-declarations) } } - if (mm) { - if (mm->vb) { - c->bit_rate = mm->vb * 1024; - } - if (mm->keyint) { - c->gop_size = mm->keyint; - } - } + + switch_assert(mm); if (mm->cbr) { c->rc_min_rate = c->bit_rate; c->rc_max_rate = c->bit_rate; c->rc_buffer_size = c->bit_rate; c->qcompress = 0; - c->gop_size = mm->fps * 2; - c->keyint_min = mm->fps * 2; + c->gop_size = fps * 2; + c->keyint_min = fps * 2; } else { - c->gop_size = 250; // g=250 - c->keyint_min = 25; // keyint_min=25 + c->gop_size = fps * 10; + c->keyint_min = fps; c->i_quant_factor = 0.71; // i_qfactor=0.71 c->qcompress = 0.6; // qcomp=0.6 c->qmin = 10; // qmin=10 @@ -550,17 +544,23 @@ GCC_DIAG_ON(deprecated-declarations) av_opt_set_int(c->priv_data, "crf", 18, 0); } + if (mm->vb) { + c->bit_rate = mm->vb * 1024; + } + + if (mm->keyint) { + c->gop_size = mm->keyint; + } if (codec_id == AV_CODEC_ID_VP8) { av_set_options_string(c, "quality=realtime", "=", ":"); } - av_opt_set_int(c->priv_data, "slice-max-size", SWITCH_DEFAULT_VIDEO_SIZE, 0); + // av_opt_set_int(c->priv_data, "slice-max-size", SWITCH_DEFAULT_VIDEO_SIZE, 0); c->colorspace = AVCOL_SPC_RGB; c->color_range = AVCOL_RANGE_JPEG; - break; default: break; @@ -750,6 +750,7 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void * int d_w = context->eh.video_st->width, d_h = context->eh.video_st->height; int size = 0, skip = 0, skip_freq = 0, skip_count = 0, skip_total = 0, skip_total_count = 0; uint64_t delta_avg = 0, delta_sum = 0, delta_i = 0, delta = 0; + int first = 1; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "video thread start\n"); switch_assert(context->eh.video_queue); @@ -828,7 +829,9 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void * fill_avframe(context->eh.video_st->frame, img); - if (context->eh.finalize) { + if (first) { + first = 0; // pts = 0; + } else if (context->eh.finalize) { if (delta_i && !delta_avg) { delta_avg = (int)(double)(delta_sum / delta_i); delta_i = 1; @@ -849,17 +852,16 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void * switch_core_timer_sync(context->eh.video_timer); delta_tmp = (context->eh.video_timer->samplecount * 90) - context->eh.last_ts; - + if (delta_tmp != 0) { delta_sum += delta_tmp; delta_i++; - + if (delta_i == UINT64_MAX) { delta_i = 1; delta_sum = delta_avg; } - - + if ((delta_i % 10) == 0) { delta_avg = (int)(double)(delta_sum / delta_i); } @@ -1920,7 +1922,7 @@ GCC_DIAG_ON(deprecated-declarations) if (context->audio_timer || delta >= 60) { uint32_t new_pts = context->video_timer.samplecount * (handle->samplerate / 1000); if (!context->audio_timer) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Delta of %d detected. Video timer sync: %ld/%d %ld\n", delta, context->audio_st[0].next_pts, context->video_timer.samplecount, new_pts - context->audio_st[0].next_pts); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Delta of %d detected. Video timer sync: %" SWITCH_UINT64_T_FMT "/%d %" SWITCH_UINT64_T_FMT "\n", delta, context->audio_st[0].next_pts, context->video_timer.samplecount, new_pts - context->audio_st[0].next_pts); } sample_start = new_pts; } From 31d9584f5958da78680c475055fceb9ea7998360 Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 14 Dec 2017 10:07:10 -0600 Subject: [PATCH 090/264] FS-10840: [mod_sofia] max-registrations-per-extension parameter is not multi-tennant --- src/mod/endpoints/mod_sofia/sofia_reg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 847411ab5a..842e6c3bf7 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -3074,7 +3074,8 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, call_id = sip->sip_call_id->i_id; switch_assert(call_id); - sql = switch_mprintf("select count(sip_user) from sip_registrations where sip_user='%q' AND call_id <> '%q'", username, call_id); + sql = switch_mprintf("select count(sip_user) from sip_registrations where sip_user='%q' AND call_id <> '%q' AND sip_host='%q'", + username, call_id, domain_name); switch_assert(sql != NULL); sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_regcount_callback, &count); free(sql); From 586d3349a71c52e92f92fbeb8951ee1fd0728a20 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 14 Dec 2017 12:46:00 -0600 Subject: [PATCH 091/264] FS-10243: [mod_conference] Add conference variables --- .../mod_conference/conference_api.c | 66 ++++++++++++++----- 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index 74ad5fdb32..f81b1a1063 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -1415,8 +1415,11 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s int x = 0, id = -1; char *group = NULL; char *array[4] = {0}; - int sdiv = 0, fdiv = 0; - + float sdiv = 0; + int fdiv = 0; + int force_w = 0, force_h = 0; + + if (!conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { stream->write_function(stream, "-ERR Bandwidth control not available.\n"); return SWITCH_STATUS_SUCCESS; @@ -1430,9 +1433,25 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s switch_split(argv[2], ':', array); if (array[1]) { - sdiv = atoi(array[1]); - if (sdiv < 2 || sdiv > 8) { - sdiv = 0; + if (*array[1] == '=') { + char *p = array[1]; + + force_w = atoi((p+1)); + if ((p = strchr(p+1, 'x'))) { + p++; + if (*p) { + force_h = atoi(p); + } + } + + if (!(force_w > 100 && force_w < 1920 && force_h > 100 && force_h < 1080)) { + force_w = force_h = 0; + } + } else { + sdiv = atof(array[1]); + if (sdiv < 1.5 || sdiv > 8.0) { + sdiv = 0; + } } } @@ -1476,28 +1495,39 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s int j; for (j = 0; j < canvas->write_codecs_count; j++) { + int w = canvas->width, h = canvas->height; + if ((zstr(group) || !strcmp(group, switch_str_nil(canvas->write_codecs[j]->video_codec_group)))) { switch_core_codec_control(&canvas->write_codecs[j]->codec, SCC_VIDEO_BANDWIDTH, SCCT_INT, &video_write_bandwidth, SCCT_NONE, NULL, NULL, NULL); - stream->write_function(stream, "+OK Set Bandwidth for canvas %d index %d group[%s] to %d\n", i + 1, j, - switch_str_nil(canvas->write_codecs[j]->video_codec_group), video_write_bandwidth); if (fdiv) { canvas->write_codecs[j]->fps_divisor = fdiv; } - - if (sdiv) { - int w = 0, h = 0; - w = canvas->width; - h = canvas->width; - - w /= sdiv; - h /= sdiv; - - switch_img_free(&canvas->write_codecs[j]->scaled_img); - canvas->write_codecs[j]->scaled_img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, w, h, 16); + if (force_w && force_h) { + w = force_w; + h = force_h; + } else if (sdiv) { + w = (int)((float) w / sdiv); + h = (int)((float) h / sdiv); } + + if (w && h) { + switch_img_free(&canvas->write_codecs[j]->scaled_img); + if (w != canvas->img->d_w || h != canvas->img->d_h) { + canvas->write_codecs[j]->scaled_img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, w, h, 16); + } + } + + if (!sdiv && w) { + sdiv = (float)canvas->img->d_w / w; + } + + + stream->write_function(stream, "+OK Set Bandwidth for canvas %d index %d group[%s] to %d sdiv %.2f %dx%d fdiv %d\n", i + 1, j, + switch_str_nil(canvas->write_codecs[j]->video_codec_group), video_write_bandwidth, sdiv, w,h, fdiv); + x++; } From 2e66aceb141c90a403cde97292971e6bca58f365 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 20 Dec 2017 12:46:57 -0600 Subject: [PATCH 092/264] FS-10854: [mod_conference] Canvas FG Image not refreshed before writing to video recordings #resolve --- src/mod/applications/mod_conference/conference_video.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 19732ffbc5..e66a6dd689 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3978,14 +3978,14 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr wait_for_canvas(canvas); } - if (canvas->recording) { - conference_video_check_recording(conference, canvas, &write_frame); - } - if (canvas->fgimg) { conference_video_set_canvas_fgimg(canvas, NULL); } + if (canvas->recording) { + conference_video_check_recording(conference, canvas, &write_frame); + } + if (conference->canvas_count > 1) { switch_image_t *img_copy = NULL; From afde4b63bb0f1ccd9957573f2367a59d8357cc42 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 27 Dec 2017 15:43:13 -0600 Subject: [PATCH 093/264] FS-10860: [core] Distorted music when playing it as local stream into a conference as hold music #resolve --- src/switch_core_file.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/switch_core_file.c b/src/switch_core_file.c index f7cfd7b1c3..9916c40f8b 100644 --- a/src/switch_core_file.c +++ b/src/switch_core_file.c @@ -57,7 +57,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file, } fh->samples_in = 0; - + fh->samplerate = 0; + fh->native_rate = 0; + fh->channels = 0; + fh->real_channels = 0; + if (!fh->samplerate) { if (!(fh->samplerate = rate)) { fh->samplerate = 8000; @@ -867,7 +871,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh) fh->samples_in = 0; fh->max_samples = 0; - + if (fh->buffer) { switch_buffer_destroy(&fh->buffer); } From 1a2d406e86ae5a0b714f1962dc7bfc5a09583956 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 29 Dec 2017 16:04:44 -0600 Subject: [PATCH 094/264] FS-10862: [freeswitch-core] Updates on webrtc to keep up with browsers #resolve --- html5/verto/js/src/jquery.FSRTC.js | 2 + html5/verto/js/src/vendor/adapter-latest.js | 3785 ++++++++++------- .../video_demo-live_canvas/js/verto-min.js | 317 +- html5/verto/video_demo/js/verto-min.js | 317 +- 4 files changed, 2589 insertions(+), 1832 deletions(-) diff --git a/html5/verto/js/src/jquery.FSRTC.js b/html5/verto/js/src/jquery.FSRTC.js index 39073ecbab..c2ea803d0b 100644 --- a/html5/verto/js/src/jquery.FSRTC.js +++ b/html5/verto/js/src/jquery.FSRTC.js @@ -684,6 +684,8 @@ } } + config.bundlePolicy = "max-compat"; + var peer = new window.RTCPeerConnection(config); openOffererChannel(); diff --git a/html5/verto/js/src/vendor/adapter-latest.js b/html5/verto/js/src/vendor/adapter-latest.js index 5b32e894af..46242f30c6 100644 --- a/html5/verto/js/src/vendor/adapter-latest.js +++ b/html5/verto/js/src/vendor/adapter-latest.js @@ -1,4 +1,1564 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.adapter = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 14393 && + url.indexOf('?transport=udp') === -1; + }); + + delete server.url; + server.urls = isString ? urls[0] : urls; + return !!urls.length; + } + return false; + }); +} + +// Determines the intersection of local and remote capabilities. +function getCommonCapabilities(localCapabilities, remoteCapabilities) { + var commonCapabilities = { + codecs: [], + headerExtensions: [], + fecMechanisms: [] + }; + + var findCodecByPayloadType = function(pt, codecs) { + pt = parseInt(pt, 10); + for (var i = 0; i < codecs.length; i++) { + if (codecs[i].payloadType === pt || + codecs[i].preferredPayloadType === pt) { + return codecs[i]; + } + } + }; + + var rtxCapabilityMatches = function(lRtx, rRtx, lCodecs, rCodecs) { + var lCodec = findCodecByPayloadType(lRtx.parameters.apt, lCodecs); + var rCodec = findCodecByPayloadType(rRtx.parameters.apt, rCodecs); + return lCodec && rCodec && + lCodec.name.toLowerCase() === rCodec.name.toLowerCase(); + }; + + localCapabilities.codecs.forEach(function(lCodec) { + for (var i = 0; i < remoteCapabilities.codecs.length; i++) { + var rCodec = remoteCapabilities.codecs[i]; + if (lCodec.name.toLowerCase() === rCodec.name.toLowerCase() && + lCodec.clockRate === rCodec.clockRate) { + if (lCodec.name.toLowerCase() === 'rtx' && + lCodec.parameters && rCodec.parameters.apt) { + // for RTX we need to find the local rtx that has a apt + // which points to the same local codec as the remote one. + if (!rtxCapabilityMatches(lCodec, rCodec, + localCapabilities.codecs, remoteCapabilities.codecs)) { + continue; + } + } + rCodec = JSON.parse(JSON.stringify(rCodec)); // deepcopy + // number of channels is the highest common number of channels + rCodec.numChannels = Math.min(lCodec.numChannels, + rCodec.numChannels); + // push rCodec so we reply with offerer payload type + commonCapabilities.codecs.push(rCodec); + + // determine common feedback mechanisms + rCodec.rtcpFeedback = rCodec.rtcpFeedback.filter(function(fb) { + for (var j = 0; j < lCodec.rtcpFeedback.length; j++) { + if (lCodec.rtcpFeedback[j].type === fb.type && + lCodec.rtcpFeedback[j].parameter === fb.parameter) { + return true; + } + } + return false; + }); + // FIXME: also need to determine .parameters + // see https://github.com/openpeer/ortc/issues/569 + break; + } + } + }); + + localCapabilities.headerExtensions.forEach(function(lHeaderExtension) { + for (var i = 0; i < remoteCapabilities.headerExtensions.length; + i++) { + var rHeaderExtension = remoteCapabilities.headerExtensions[i]; + if (lHeaderExtension.uri === rHeaderExtension.uri) { + commonCapabilities.headerExtensions.push(rHeaderExtension); + break; + } + } + }); + + // FIXME: fecMechanisms + return commonCapabilities; +} + +// is action=setLocalDescription with type allowed in signalingState +function isActionAllowedInSignalingState(action, type, signalingState) { + return { + offer: { + setLocalDescription: ['stable', 'have-local-offer'], + setRemoteDescription: ['stable', 'have-remote-offer'] + }, + answer: { + setLocalDescription: ['have-remote-offer', 'have-local-pranswer'], + setRemoteDescription: ['have-local-offer', 'have-remote-pranswer'] + } + }[type][action].indexOf(signalingState) !== -1; +} + +function maybeAddCandidate(iceTransport, candidate) { + // Edge's internal representation adds some fields therefore + // not all fieldѕ are taken into account. + var alreadyAdded = iceTransport.getRemoteCandidates() + .find(function(remoteCandidate) { + return candidate.foundation === remoteCandidate.foundation && + candidate.ip === remoteCandidate.ip && + candidate.port === remoteCandidate.port && + candidate.priority === remoteCandidate.priority && + candidate.protocol === remoteCandidate.protocol && + candidate.type === remoteCandidate.type; + }); + if (!alreadyAdded) { + iceTransport.addRemoteCandidate(candidate); + } + return !alreadyAdded; +} + +module.exports = function(window, edgeVersion) { + var RTCPeerConnection = function(config) { + var self = this; + + var _eventTarget = document.createDocumentFragment(); + ['addEventListener', 'removeEventListener', 'dispatchEvent'] + .forEach(function(method) { + self[method] = _eventTarget[method].bind(_eventTarget); + }); + + this.onicecandidate = null; + this.onaddstream = null; + this.ontrack = null; + this.onremovestream = null; + this.onsignalingstatechange = null; + this.oniceconnectionstatechange = null; + this.onicegatheringstatechange = null; + this.onnegotiationneeded = null; + this.ondatachannel = null; + this.canTrickleIceCandidates = null; + + this.needNegotiation = false; + + this.localStreams = []; + this.remoteStreams = []; + + this.localDescription = null; + this.remoteDescription = null; + + this.signalingState = 'stable'; + this.iceConnectionState = 'new'; + this.iceGatheringState = 'new'; + + config = JSON.parse(JSON.stringify(config || {})); + + this.usingBundle = config.bundlePolicy === 'max-bundle'; + if (config.rtcpMuxPolicy === 'negotiate') { + var e = new Error('rtcpMuxPolicy \'negotiate\' is not supported'); + e.name = 'NotSupportedError'; + throw(e); + } else if (!config.rtcpMuxPolicy) { + config.rtcpMuxPolicy = 'require'; + } + + switch (config.iceTransportPolicy) { + case 'all': + case 'relay': + break; + default: + config.iceTransportPolicy = 'all'; + break; + } + + switch (config.bundlePolicy) { + case 'balanced': + case 'max-compat': + case 'max-bundle': + break; + default: + config.bundlePolicy = 'balanced'; + break; + } + + config.iceServers = filterIceServers(config.iceServers || [], edgeVersion); + + this._iceGatherers = []; + if (config.iceCandidatePoolSize) { + for (var i = config.iceCandidatePoolSize; i > 0; i--) { + this._iceGatherers = new window.RTCIceGatherer({ + iceServers: config.iceServers, + gatherPolicy: config.iceTransportPolicy + }); + } + } else { + config.iceCandidatePoolSize = 0; + } + + this._config = config; + + // per-track iceGathers, iceTransports, dtlsTransports, rtpSenders, ... + // everything that is needed to describe a SDP m-line. + this.transceivers = []; + + this._sdpSessionId = SDPUtils.generateSessionId(); + this._sdpSessionVersion = 0; + + this._dtlsRole = undefined; // role for a=setup to use in answers. + }; + + RTCPeerConnection.prototype._emitGatheringStateChange = function() { + var event = new Event('icegatheringstatechange'); + this.dispatchEvent(event); + if (typeof this.onicegatheringstatechange === 'function') { + this.onicegatheringstatechange(event); + } + }; + + RTCPeerConnection.prototype.getConfiguration = function() { + return this._config; + }; + + RTCPeerConnection.prototype.getLocalStreams = function() { + return this.localStreams; + }; + + RTCPeerConnection.prototype.getRemoteStreams = function() { + return this.remoteStreams; + }; + + // internal helper to create a transceiver object. + // (whih is not yet the same as the WebRTC 1.0 transceiver) + RTCPeerConnection.prototype._createTransceiver = function(kind) { + var hasBundleTransport = this.transceivers.length > 0; + var transceiver = { + track: null, + iceGatherer: null, + iceTransport: null, + dtlsTransport: null, + localCapabilities: null, + remoteCapabilities: null, + rtpSender: null, + rtpReceiver: null, + kind: kind, + mid: null, + sendEncodingParameters: null, + recvEncodingParameters: null, + stream: null, + wantReceive: true + }; + if (this.usingBundle && hasBundleTransport) { + transceiver.iceTransport = this.transceivers[0].iceTransport; + transceiver.dtlsTransport = this.transceivers[0].dtlsTransport; + } else { + var transports = this._createIceAndDtlsTransports(); + transceiver.iceTransport = transports.iceTransport; + transceiver.dtlsTransport = transports.dtlsTransport; + } + this.transceivers.push(transceiver); + return transceiver; + }; + + RTCPeerConnection.prototype.addTrack = function(track, stream) { + var transceiver; + for (var i = 0; i < this.transceivers.length; i++) { + if (!this.transceivers[i].track && + this.transceivers[i].kind === track.kind) { + transceiver = this.transceivers[i]; + } + } + if (!transceiver) { + transceiver = this._createTransceiver(track.kind); + } + + this._maybeFireNegotiationNeeded(); + + if (this.localStreams.indexOf(stream) === -1) { + this.localStreams.push(stream); + } + + transceiver.track = track; + transceiver.stream = stream; + transceiver.rtpSender = new window.RTCRtpSender(track, + transceiver.dtlsTransport); + return transceiver.rtpSender; + }; + + RTCPeerConnection.prototype.addStream = function(stream) { + var self = this; + if (edgeVersion >= 15025) { + stream.getTracks().forEach(function(track) { + self.addTrack(track, stream); + }); + } else { + // Clone is necessary for local demos mostly, attaching directly + // to two different senders does not work (build 10547). + // Fixed in 15025 (or earlier) + var clonedStream = stream.clone(); + stream.getTracks().forEach(function(track, idx) { + var clonedTrack = clonedStream.getTracks()[idx]; + track.addEventListener('enabled', function(event) { + clonedTrack.enabled = event.enabled; + }); + }); + clonedStream.getTracks().forEach(function(track) { + self.addTrack(track, clonedStream); + }); + } + }; + + RTCPeerConnection.prototype.removeStream = function(stream) { + var idx = this.localStreams.indexOf(stream); + if (idx > -1) { + this.localStreams.splice(idx, 1); + this._maybeFireNegotiationNeeded(); + } + }; + + RTCPeerConnection.prototype.getSenders = function() { + return this.transceivers.filter(function(transceiver) { + return !!transceiver.rtpSender; + }) + .map(function(transceiver) { + return transceiver.rtpSender; + }); + }; + + RTCPeerConnection.prototype.getReceivers = function() { + return this.transceivers.filter(function(transceiver) { + return !!transceiver.rtpReceiver; + }) + .map(function(transceiver) { + return transceiver.rtpReceiver; + }); + }; + + + RTCPeerConnection.prototype._createIceGatherer = function(sdpMLineIndex, + usingBundle) { + var self = this; + if (usingBundle && sdpMLineIndex > 0) { + return this.transceivers[0].iceGatherer; + } else if (this._iceGatherers.length) { + return this._iceGatherers.shift(); + } + var iceGatherer = new window.RTCIceGatherer({ + iceServers: this._config.iceServers, + gatherPolicy: this._config.iceTransportPolicy + }); + Object.defineProperty(iceGatherer, 'state', + {value: 'new', writable: true} + ); + + this.transceivers[sdpMLineIndex].candidates = []; + this.transceivers[sdpMLineIndex].bufferCandidates = function(event) { + var end = !event.candidate || Object.keys(event.candidate).length === 0; + // polyfill since RTCIceGatherer.state is not implemented in + // Edge 10547 yet. + iceGatherer.state = end ? 'completed' : 'gathering'; + if (self.transceivers[sdpMLineIndex].candidates !== null) { + self.transceivers[sdpMLineIndex].candidates.push(event.candidate); + } + }; + iceGatherer.addEventListener('localcandidate', + this.transceivers[sdpMLineIndex].bufferCandidates); + return iceGatherer; + }; + + // start gathering from an RTCIceGatherer. + RTCPeerConnection.prototype._gather = function(mid, sdpMLineIndex) { + var self = this; + var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer; + if (iceGatherer.onlocalcandidate) { + return; + } + var candidates = this.transceivers[sdpMLineIndex].candidates; + this.transceivers[sdpMLineIndex].candidates = null; + iceGatherer.removeEventListener('localcandidate', + this.transceivers[sdpMLineIndex].bufferCandidates); + iceGatherer.onlocalcandidate = function(evt) { + if (self.usingBundle && sdpMLineIndex > 0) { + // if we know that we use bundle we can drop candidates with + // ѕdpMLineIndex > 0. If we don't do this then our state gets + // confused since we dispose the extra ice gatherer. + return; + } + var event = new Event('icecandidate'); + event.candidate = {sdpMid: mid, sdpMLineIndex: sdpMLineIndex}; + + var cand = evt.candidate; + // Edge emits an empty object for RTCIceCandidateComplete‥ + var end = !cand || Object.keys(cand).length === 0; + if (end) { + // polyfill since RTCIceGatherer.state is not implemented in + // Edge 10547 yet. + if (iceGatherer.state === 'new' || iceGatherer.state === 'gathering') { + iceGatherer.state = 'completed'; + } + } else { + if (iceGatherer.state === 'new') { + iceGatherer.state = 'gathering'; + } + // RTCIceCandidate doesn't have a component, needs to be added + cand.component = 1; + event.candidate.candidate = SDPUtils.writeCandidate(cand); + } + + // update local description. + var sections = SDPUtils.splitSections(self.localDescription.sdp); + if (!end) { + sections[event.candidate.sdpMLineIndex + 1] += + 'a=' + event.candidate.candidate + '\r\n'; + } else { + sections[event.candidate.sdpMLineIndex + 1] += + 'a=end-of-candidates\r\n'; + } + self.localDescription.sdp = sections.join(''); + var complete = self.transceivers.every(function(transceiver) { + return transceiver.iceGatherer && + transceiver.iceGatherer.state === 'completed'; + }); + + if (self.iceGatheringState !== 'gathering') { + self.iceGatheringState = 'gathering'; + self._emitGatheringStateChange(); + } + + // Emit candidate. Also emit null candidate when all gatherers are + // complete. + if (!end) { + self.dispatchEvent(event); + if (typeof self.onicecandidate === 'function') { + self.onicecandidate(event); + } + } + if (complete) { + self.dispatchEvent(new Event('icecandidate')); + if (typeof self.onicecandidate === 'function') { + self.onicecandidate(new Event('icecandidate')); + } + self.iceGatheringState = 'complete'; + self._emitGatheringStateChange(); + } + }; + + // emit already gathered candidates. + window.setTimeout(function() { + candidates.forEach(function(candidate) { + var e = new Event('RTCIceGatherEvent'); + e.candidate = candidate; + iceGatherer.onlocalcandidate(e); + }); + }, 0); + }; + + // Create ICE transport and DTLS transport. + RTCPeerConnection.prototype._createIceAndDtlsTransports = function() { + var self = this; + var iceTransport = new window.RTCIceTransport(null); + iceTransport.onicestatechange = function() { + self._updateConnectionState(); + }; + + var dtlsTransport = new window.RTCDtlsTransport(iceTransport); + dtlsTransport.ondtlsstatechange = function() { + self._updateConnectionState(); + }; + dtlsTransport.onerror = function() { + // onerror does not set state to failed by itself. + Object.defineProperty(dtlsTransport, 'state', + {value: 'failed', writable: true}); + self._updateConnectionState(); + }; + + return { + iceTransport: iceTransport, + dtlsTransport: dtlsTransport + }; + }; + + // Destroy ICE gatherer, ICE transport and DTLS transport. + // Without triggering the callbacks. + RTCPeerConnection.prototype._disposeIceAndDtlsTransports = function( + sdpMLineIndex) { + var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer; + if (iceGatherer) { + delete iceGatherer.onlocalcandidate; + delete this.transceivers[sdpMLineIndex].iceGatherer; + } + var iceTransport = this.transceivers[sdpMLineIndex].iceTransport; + if (iceTransport) { + delete iceTransport.onicestatechange; + delete this.transceivers[sdpMLineIndex].iceTransport; + } + var dtlsTransport = this.transceivers[sdpMLineIndex].dtlsTransport; + if (dtlsTransport) { + delete dtlsTransport.ondtlsstatechange; + delete dtlsTransport.onerror; + delete this.transceivers[sdpMLineIndex].dtlsTransport; + } + }; + + // Start the RTP Sender and Receiver for a transceiver. + RTCPeerConnection.prototype._transceive = function(transceiver, + send, recv) { + var params = getCommonCapabilities(transceiver.localCapabilities, + transceiver.remoteCapabilities); + if (send && transceiver.rtpSender) { + params.encodings = transceiver.sendEncodingParameters; + params.rtcp = { + cname: SDPUtils.localCName, + compound: transceiver.rtcpParameters.compound + }; + if (transceiver.recvEncodingParameters.length) { + params.rtcp.ssrc = transceiver.recvEncodingParameters[0].ssrc; + } + transceiver.rtpSender.send(params); + } + if (recv && transceiver.rtpReceiver && params.codecs.length > 0) { + // remove RTX field in Edge 14942 + if (transceiver.kind === 'video' + && transceiver.recvEncodingParameters + && edgeVersion < 15019) { + transceiver.recvEncodingParameters.forEach(function(p) { + delete p.rtx; + }); + } + params.encodings = transceiver.recvEncodingParameters; + params.rtcp = { + cname: transceiver.rtcpParameters.cname, + compound: transceiver.rtcpParameters.compound + }; + if (transceiver.sendEncodingParameters.length) { + params.rtcp.ssrc = transceiver.sendEncodingParameters[0].ssrc; + } + transceiver.rtpReceiver.receive(params); + } + }; + + RTCPeerConnection.prototype.setLocalDescription = function(description) { + var self = this; + var args = arguments; + + if (!isActionAllowedInSignalingState('setLocalDescription', + description.type, this.signalingState)) { + return new Promise(function(resolve, reject) { + var e = new Error('Can not set local ' + description.type + + ' in state ' + self.signalingState); + e.name = 'InvalidStateError'; + if (args.length > 2 && typeof args[2] === 'function') { + args[2].apply(null, [e]); + } + reject(e); + }); + } + + var sections; + var sessionpart; + if (description.type === 'offer') { + // VERY limited support for SDP munging. Limited to: + // * changing the order of codecs + sections = SDPUtils.splitSections(description.sdp); + sessionpart = sections.shift(); + sections.forEach(function(mediaSection, sdpMLineIndex) { + var caps = SDPUtils.parseRtpParameters(mediaSection); + self.transceivers[sdpMLineIndex].localCapabilities = caps; + }); + + this.transceivers.forEach(function(transceiver, sdpMLineIndex) { + self._gather(transceiver.mid, sdpMLineIndex); + }); + } else if (description.type === 'answer') { + sections = SDPUtils.splitSections(self.remoteDescription.sdp); + sessionpart = sections.shift(); + var isIceLite = SDPUtils.matchPrefix(sessionpart, + 'a=ice-lite').length > 0; + sections.forEach(function(mediaSection, sdpMLineIndex) { + var transceiver = self.transceivers[sdpMLineIndex]; + var iceGatherer = transceiver.iceGatherer; + var iceTransport = transceiver.iceTransport; + var dtlsTransport = transceiver.dtlsTransport; + var localCapabilities = transceiver.localCapabilities; + var remoteCapabilities = transceiver.remoteCapabilities; + + // treat bundle-only as not-rejected. + var rejected = SDPUtils.isRejected(mediaSection) && + !SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 1; + + if (!rejected && !transceiver.isDatachannel) { + var remoteIceParameters = SDPUtils.getIceParameters( + mediaSection, sessionpart); + var remoteDtlsParameters = SDPUtils.getDtlsParameters( + mediaSection, sessionpart); + if (isIceLite) { + remoteDtlsParameters.role = 'server'; + } + + if (!self.usingBundle || sdpMLineIndex === 0) { + self._gather(transceiver.mid, sdpMLineIndex); + if (iceTransport.state === 'new') { + iceTransport.start(iceGatherer, remoteIceParameters, + isIceLite ? 'controlling' : 'controlled'); + } + if (dtlsTransport.state === 'new') { + dtlsTransport.start(remoteDtlsParameters); + } + } + + // Calculate intersection of capabilities. + var params = getCommonCapabilities(localCapabilities, + remoteCapabilities); + + // Start the RTCRtpSender. The RTCRtpReceiver for this + // transceiver has already been started in setRemoteDescription. + self._transceive(transceiver, + params.codecs.length > 0, + false); + } + }); + } + + this.localDescription = { + type: description.type, + sdp: description.sdp + }; + switch (description.type) { + case 'offer': + this._updateSignalingState('have-local-offer'); + break; + case 'answer': + this._updateSignalingState('stable'); + break; + default: + throw new TypeError('unsupported type "' + description.type + + '"'); + } + + // If a success callback was provided, emit ICE candidates after it + // has been executed. Otherwise, emit callback after the Promise is + // resolved. + var cb = arguments.length > 1 && typeof arguments[1] === 'function' && + arguments[1]; + return new Promise(function(resolve) { + if (cb) { + cb.apply(null); + } + resolve(); + }); + }; + + RTCPeerConnection.prototype.setRemoteDescription = function(description) { + var self = this; + var args = arguments; + + if (!isActionAllowedInSignalingState('setRemoteDescription', + description.type, this.signalingState)) { + return new Promise(function(resolve, reject) { + var e = new Error('Can not set remote ' + description.type + + ' in state ' + self.signalingState); + e.name = 'InvalidStateError'; + if (args.length > 2 && typeof args[2] === 'function') { + args[2].apply(null, [e]); + } + reject(e); + }); + } + + var streams = {}; + this.remoteStreams.forEach(function(stream) { + streams[stream.id] = stream; + }); + var receiverList = []; + var sections = SDPUtils.splitSections(description.sdp); + var sessionpart = sections.shift(); + var isIceLite = SDPUtils.matchPrefix(sessionpart, + 'a=ice-lite').length > 0; + var usingBundle = SDPUtils.matchPrefix(sessionpart, + 'a=group:BUNDLE ').length > 0; + this.usingBundle = usingBundle; + var iceOptions = SDPUtils.matchPrefix(sessionpart, + 'a=ice-options:')[0]; + if (iceOptions) { + this.canTrickleIceCandidates = iceOptions.substr(14).split(' ') + .indexOf('trickle') >= 0; + } else { + this.canTrickleIceCandidates = false; + } + + sections.forEach(function(mediaSection, sdpMLineIndex) { + var lines = SDPUtils.splitLines(mediaSection); + var kind = SDPUtils.getKind(mediaSection); + // treat bundle-only as not-rejected. + var rejected = SDPUtils.isRejected(mediaSection) && + !SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 1; + var protocol = lines[0].substr(2).split(' ')[2]; + + var direction = SDPUtils.getDirection(mediaSection, sessionpart); + var remoteMsid = SDPUtils.parseMsid(mediaSection); + + var mid = SDPUtils.getMid(mediaSection) || SDPUtils.generateIdentifier(); + + // Reject datachannels which are not implemented yet. + if (kind === 'application' && protocol === 'DTLS/SCTP') { + self.transceivers[sdpMLineIndex] = { + mid: mid, + isDatachannel: true + }; + return; + } + + var transceiver; + var iceGatherer; + var iceTransport; + var dtlsTransport; + var rtpReceiver; + var sendEncodingParameters; + var recvEncodingParameters; + var localCapabilities; + + var track; + // FIXME: ensure the mediaSection has rtcp-mux set. + var remoteCapabilities = SDPUtils.parseRtpParameters(mediaSection); + var remoteIceParameters; + var remoteDtlsParameters; + if (!rejected) { + remoteIceParameters = SDPUtils.getIceParameters(mediaSection, + sessionpart); + remoteDtlsParameters = SDPUtils.getDtlsParameters(mediaSection, + sessionpart); + remoteDtlsParameters.role = 'client'; + } + recvEncodingParameters = + SDPUtils.parseRtpEncodingParameters(mediaSection); + + var rtcpParameters = SDPUtils.parseRtcpParameters(mediaSection); + + var isComplete = SDPUtils.matchPrefix(mediaSection, + 'a=end-of-candidates', sessionpart).length > 0; + var cands = SDPUtils.matchPrefix(mediaSection, 'a=candidate:') + .map(function(cand) { + return SDPUtils.parseCandidate(cand); + }) + .filter(function(cand) { + return cand.component === 1; + }); + + // Check if we can use BUNDLE and dispose transports. + if ((description.type === 'offer' || description.type === 'answer') && + !rejected && usingBundle && sdpMLineIndex > 0 && + self.transceivers[sdpMLineIndex]) { + self._disposeIceAndDtlsTransports(sdpMLineIndex); + self.transceivers[sdpMLineIndex].iceGatherer = + self.transceivers[0].iceGatherer; + self.transceivers[sdpMLineIndex].iceTransport = + self.transceivers[0].iceTransport; + self.transceivers[sdpMLineIndex].dtlsTransport = + self.transceivers[0].dtlsTransport; + if (self.transceivers[sdpMLineIndex].rtpSender) { + self.transceivers[sdpMLineIndex].rtpSender.setTransport( + self.transceivers[0].dtlsTransport); + } + if (self.transceivers[sdpMLineIndex].rtpReceiver) { + self.transceivers[sdpMLineIndex].rtpReceiver.setTransport( + self.transceivers[0].dtlsTransport); + } + } + if (description.type === 'offer' && !rejected) { + transceiver = self.transceivers[sdpMLineIndex] || + self._createTransceiver(kind); + transceiver.mid = mid; + + if (!transceiver.iceGatherer) { + transceiver.iceGatherer = self._createIceGatherer(sdpMLineIndex, + usingBundle); + } + + if (cands.length && transceiver.iceTransport.state === 'new') { + if (isComplete && (!usingBundle || sdpMLineIndex === 0)) { + transceiver.iceTransport.setRemoteCandidates(cands); + } else { + cands.forEach(function(candidate) { + maybeAddCandidate(transceiver.iceTransport, candidate); + }); + } + } + + localCapabilities = window.RTCRtpReceiver.getCapabilities(kind); + + // filter RTX until additional stuff needed for RTX is implemented + // in adapter.js + if (edgeVersion < 15019) { + localCapabilities.codecs = localCapabilities.codecs.filter( + function(codec) { + return codec.name !== 'rtx'; + }); + } + + sendEncodingParameters = transceiver.sendEncodingParameters || [{ + ssrc: (2 * sdpMLineIndex + 2) * 1001 + }]; + + var isNewTrack = false; + if (direction === 'sendrecv' || direction === 'sendonly') { + isNewTrack = !transceiver.rtpReceiver; + rtpReceiver = transceiver.rtpReceiver || + new window.RTCRtpReceiver(transceiver.dtlsTransport, kind); + + if (isNewTrack) { + var stream; + track = rtpReceiver.track; + // FIXME: does not work with Plan B. + if (remoteMsid) { + if (!streams[remoteMsid.stream]) { + streams[remoteMsid.stream] = new window.MediaStream(); + Object.defineProperty(streams[remoteMsid.stream], 'id', { + get: function() { + return remoteMsid.stream; + } + }); + } + Object.defineProperty(track, 'id', { + get: function() { + return remoteMsid.track; + } + }); + stream = streams[remoteMsid.stream]; + } else { + if (!streams.default) { + streams.default = new window.MediaStream(); + } + stream = streams.default; + } + stream.addTrack(track); + receiverList.push([track, rtpReceiver, stream]); + } + } + + transceiver.localCapabilities = localCapabilities; + transceiver.remoteCapabilities = remoteCapabilities; + transceiver.rtpReceiver = rtpReceiver; + transceiver.rtcpParameters = rtcpParameters; + transceiver.sendEncodingParameters = sendEncodingParameters; + transceiver.recvEncodingParameters = recvEncodingParameters; + + // Start the RTCRtpReceiver now. The RTPSender is started in + // setLocalDescription. + self._transceive(self.transceivers[sdpMLineIndex], + false, + isNewTrack); + } else if (description.type === 'answer' && !rejected) { + transceiver = self.transceivers[sdpMLineIndex]; + iceGatherer = transceiver.iceGatherer; + iceTransport = transceiver.iceTransport; + dtlsTransport = transceiver.dtlsTransport; + rtpReceiver = transceiver.rtpReceiver; + sendEncodingParameters = transceiver.sendEncodingParameters; + localCapabilities = transceiver.localCapabilities; + + self.transceivers[sdpMLineIndex].recvEncodingParameters = + recvEncodingParameters; + self.transceivers[sdpMLineIndex].remoteCapabilities = + remoteCapabilities; + self.transceivers[sdpMLineIndex].rtcpParameters = rtcpParameters; + + if (cands.length && iceTransport.state === 'new') { + if ((isIceLite || isComplete) && + (!usingBundle || sdpMLineIndex === 0)) { + iceTransport.setRemoteCandidates(cands); + } else { + cands.forEach(function(candidate) { + maybeAddCandidate(transceiver.iceTransport, candidate); + }); + } + } + + if (!usingBundle || sdpMLineIndex === 0) { + if (iceTransport.state === 'new') { + iceTransport.start(iceGatherer, remoteIceParameters, + 'controlling'); + } + if (dtlsTransport.state === 'new') { + dtlsTransport.start(remoteDtlsParameters); + } + } + + self._transceive(transceiver, + direction === 'sendrecv' || direction === 'recvonly', + direction === 'sendrecv' || direction === 'sendonly'); + + if (rtpReceiver && + (direction === 'sendrecv' || direction === 'sendonly')) { + track = rtpReceiver.track; + if (remoteMsid) { + if (!streams[remoteMsid.stream]) { + streams[remoteMsid.stream] = new window.MediaStream(); + } + streams[remoteMsid.stream].addTrack(track); + receiverList.push([track, rtpReceiver, streams[remoteMsid.stream]]); + } else { + if (!streams.default) { + streams.default = new window.MediaStream(); + } + streams.default.addTrack(track); + receiverList.push([track, rtpReceiver, streams.default]); + } + } else { + // FIXME: actually the receiver should be created later. + delete transceiver.rtpReceiver; + } + } + }); + + if (this._dtlsRole === undefined) { + this._dtlsRole = description.type === 'offer' ? 'active' : 'passive'; + } + + this.remoteDescription = { + type: description.type, + sdp: description.sdp + }; + switch (description.type) { + case 'offer': + this._updateSignalingState('have-remote-offer'); + break; + case 'answer': + this._updateSignalingState('stable'); + break; + default: + throw new TypeError('unsupported type "' + description.type + + '"'); + } + Object.keys(streams).forEach(function(sid) { + var stream = streams[sid]; + if (stream.getTracks().length) { + if (self.remoteStreams.indexOf(stream) === -1) { + self.remoteStreams.push(stream); + var event = new Event('addstream'); + event.stream = stream; + window.setTimeout(function() { + self.dispatchEvent(event); + if (typeof self.onaddstream === 'function') { + self.onaddstream(event); + } + }); + } + + receiverList.forEach(function(item) { + var track = item[0]; + var receiver = item[1]; + if (stream.id !== item[2].id) { + return; + } + var trackEvent = new Event('track'); + trackEvent.track = track; + trackEvent.receiver = receiver; + trackEvent.transceiver = {receiver: receiver}; + trackEvent.streams = [stream]; + window.setTimeout(function() { + self.dispatchEvent(trackEvent); + if (typeof self.ontrack === 'function') { + self.ontrack(trackEvent); + } + }); + }); + } + }); + + // check whether addIceCandidate({}) was called within four seconds after + // setRemoteDescription. + window.setTimeout(function() { + if (!(self && self.transceivers)) { + return; + } + self.transceivers.forEach(function(transceiver) { + if (transceiver.iceTransport && + transceiver.iceTransport.state === 'new' && + transceiver.iceTransport.getRemoteCandidates().length > 0) { + console.warn('Timeout for addRemoteCandidate. Consider sending ' + + 'an end-of-candidates notification'); + transceiver.iceTransport.addRemoteCandidate({}); + } + }); + }, 4000); + + return new Promise(function(resolve) { + if (args.length > 1 && typeof args[1] === 'function') { + args[1].apply(null); + } + resolve(); + }); + }; + + RTCPeerConnection.prototype.close = function() { + this.transceivers.forEach(function(transceiver) { + /* not yet + if (transceiver.iceGatherer) { + transceiver.iceGatherer.close(); + } + */ + if (transceiver.iceTransport) { + transceiver.iceTransport.stop(); + } + if (transceiver.dtlsTransport) { + transceiver.dtlsTransport.stop(); + } + if (transceiver.rtpSender) { + transceiver.rtpSender.stop(); + } + if (transceiver.rtpReceiver) { + transceiver.rtpReceiver.stop(); + } + }); + // FIXME: clean up tracks, local streams, remote streams, etc + this._updateSignalingState('closed'); + }; + + // Update the signaling state. + RTCPeerConnection.prototype._updateSignalingState = function(newState) { + this.signalingState = newState; + var event = new Event('signalingstatechange'); + this.dispatchEvent(event); + if (typeof this.onsignalingstatechange === 'function') { + this.onsignalingstatechange(event); + } + }; + + // Determine whether to fire the negotiationneeded event. + RTCPeerConnection.prototype._maybeFireNegotiationNeeded = function() { + var self = this; + if (this.signalingState !== 'stable' || this.needNegotiation === true) { + return; + } + this.needNegotiation = true; + window.setTimeout(function() { + if (self.needNegotiation === false) { + return; + } + self.needNegotiation = false; + var event = new Event('negotiationneeded'); + self.dispatchEvent(event); + if (typeof self.onnegotiationneeded === 'function') { + self.onnegotiationneeded(event); + } + }, 0); + }; + + // Update the connection state. + RTCPeerConnection.prototype._updateConnectionState = function() { + var newState; + var states = { + 'new': 0, + closed: 0, + connecting: 0, + checking: 0, + connected: 0, + completed: 0, + disconnected: 0, + failed: 0 + }; + this.transceivers.forEach(function(transceiver) { + states[transceiver.iceTransport.state]++; + states[transceiver.dtlsTransport.state]++; + }); + // ICETransport.completed and connected are the same for this purpose. + states.connected += states.completed; + + newState = 'new'; + if (states.failed > 0) { + newState = 'failed'; + } else if (states.connecting > 0 || states.checking > 0) { + newState = 'connecting'; + } else if (states.disconnected > 0) { + newState = 'disconnected'; + } else if (states.new > 0) { + newState = 'new'; + } else if (states.connected > 0 || states.completed > 0) { + newState = 'connected'; + } + + if (newState !== this.iceConnectionState) { + this.iceConnectionState = newState; + var event = new Event('iceconnectionstatechange'); + this.dispatchEvent(event); + if (typeof this.oniceconnectionstatechange === 'function') { + this.oniceconnectionstatechange(event); + } + } + }; + + RTCPeerConnection.prototype.createOffer = function() { + var self = this; + var args = arguments; + + var offerOptions; + if (arguments.length === 1 && typeof arguments[0] !== 'function') { + offerOptions = arguments[0]; + } else if (arguments.length === 3) { + offerOptions = arguments[2]; + } + + var numAudioTracks = this.transceivers.filter(function(t) { + return t.kind === 'audio'; + }).length; + var numVideoTracks = this.transceivers.filter(function(t) { + return t.kind === 'video'; + }).length; + + // Determine number of audio and video tracks we need to send/recv. + if (offerOptions) { + // Reject Chrome legacy constraints. + if (offerOptions.mandatory || offerOptions.optional) { + throw new TypeError( + 'Legacy mandatory/optional constraints not supported.'); + } + if (offerOptions.offerToReceiveAudio !== undefined) { + if (offerOptions.offerToReceiveAudio === true) { + numAudioTracks = 1; + } else if (offerOptions.offerToReceiveAudio === false) { + numAudioTracks = 0; + } else { + numAudioTracks = offerOptions.offerToReceiveAudio; + } + } + if (offerOptions.offerToReceiveVideo !== undefined) { + if (offerOptions.offerToReceiveVideo === true) { + numVideoTracks = 1; + } else if (offerOptions.offerToReceiveVideo === false) { + numVideoTracks = 0; + } else { + numVideoTracks = offerOptions.offerToReceiveVideo; + } + } + } + + this.transceivers.forEach(function(transceiver) { + if (transceiver.kind === 'audio') { + numAudioTracks--; + if (numAudioTracks < 0) { + transceiver.wantReceive = false; + } + } else if (transceiver.kind === 'video') { + numVideoTracks--; + if (numVideoTracks < 0) { + transceiver.wantReceive = false; + } + } + }); + + // Create M-lines for recvonly streams. + while (numAudioTracks > 0 || numVideoTracks > 0) { + if (numAudioTracks > 0) { + this._createTransceiver('audio'); + numAudioTracks--; + } + if (numVideoTracks > 0) { + this._createTransceiver('video'); + numVideoTracks--; + } + } + + var sdp = SDPUtils.writeSessionBoilerplate(this._sdpSessionId, + this._sdpSessionVersion++); + this.transceivers.forEach(function(transceiver, sdpMLineIndex) { + // For each track, create an ice gatherer, ice transport, + // dtls transport, potentially rtpsender and rtpreceiver. + var track = transceiver.track; + var kind = transceiver.kind; + var mid = SDPUtils.generateIdentifier(); + transceiver.mid = mid; + + if (!transceiver.iceGatherer) { + transceiver.iceGatherer = self._createIceGatherer(sdpMLineIndex, + self.usingBundle); + } + + var localCapabilities = window.RTCRtpSender.getCapabilities(kind); + // filter RTX until additional stuff needed for RTX is implemented + // in adapter.js + if (edgeVersion < 15019) { + localCapabilities.codecs = localCapabilities.codecs.filter( + function(codec) { + return codec.name !== 'rtx'; + }); + } + localCapabilities.codecs.forEach(function(codec) { + // work around https://bugs.chromium.org/p/webrtc/issues/detail?id=6552 + // by adding level-asymmetry-allowed=1 + if (codec.name === 'H264' && + codec.parameters['level-asymmetry-allowed'] === undefined) { + codec.parameters['level-asymmetry-allowed'] = '1'; + } + }); + + // generate an ssrc now, to be used later in rtpSender.send + var sendEncodingParameters = transceiver.sendEncodingParameters || [{ + ssrc: (2 * sdpMLineIndex + 1) * 1001 + }]; + if (track) { + // add RTX + if (edgeVersion >= 15019 && kind === 'video' && + !sendEncodingParameters[0].rtx) { + sendEncodingParameters[0].rtx = { + ssrc: sendEncodingParameters[0].ssrc + 1 + }; + } + } + + if (transceiver.wantReceive) { + transceiver.rtpReceiver = new window.RTCRtpReceiver( + transceiver.dtlsTransport, kind); + } + + transceiver.localCapabilities = localCapabilities; + transceiver.sendEncodingParameters = sendEncodingParameters; + }); + + // always offer BUNDLE and dispose on return if not supported. + if (this._config.bundlePolicy !== 'max-compat') { + sdp += 'a=group:BUNDLE ' + this.transceivers.map(function(t) { + return t.mid; + }).join(' ') + '\r\n'; + } + sdp += 'a=ice-options:trickle\r\n'; + + this.transceivers.forEach(function(transceiver, sdpMLineIndex) { + sdp += writeMediaSection(transceiver, transceiver.localCapabilities, + 'offer', transceiver.stream, self._dtlsRole); + sdp += 'a=rtcp-rsize\r\n'; + + if (transceiver.iceGatherer && self.iceGatheringState !== 'new' && + (sdpMLineIndex === 0 || !self.usingBundle)) { + transceiver.iceGatherer.getLocalCandidates().forEach(function(cand) { + cand.component = 1; + sdp += 'a=' + SDPUtils.writeCandidate(cand) + '\r\n'; + }); + + if (transceiver.iceGatherer.state === 'completed') { + sdp += 'a=end-of-candidates\r\n'; + } + } + }); + + var desc = new window.RTCSessionDescription({ + type: 'offer', + sdp: sdp + }); + return new Promise(function(resolve) { + if (args.length > 0 && typeof args[0] === 'function') { + args[0].apply(null, [desc]); + resolve(); + return; + } + resolve(desc); + }); + }; + + RTCPeerConnection.prototype.createAnswer = function() { + var self = this; + var args = arguments; + + var sdp = SDPUtils.writeSessionBoilerplate(this._sdpSessionId, + this._sdpSessionVersion++); + if (this.usingBundle) { + sdp += 'a=group:BUNDLE ' + this.transceivers.map(function(t) { + return t.mid; + }).join(' ') + '\r\n'; + } + var mediaSectionsInOffer = SDPUtils.splitSections( + this.remoteDescription.sdp).length - 1; + this.transceivers.forEach(function(transceiver, sdpMLineIndex) { + if (sdpMLineIndex + 1 > mediaSectionsInOffer) { + return; + } + if (transceiver.isDatachannel) { + sdp += 'm=application 0 DTLS/SCTP 5000\r\n' + + 'c=IN IP4 0.0.0.0\r\n' + + 'a=mid:' + transceiver.mid + '\r\n'; + return; + } + + // FIXME: look at direction. + if (transceiver.stream) { + var localTrack; + if (transceiver.kind === 'audio') { + localTrack = transceiver.stream.getAudioTracks()[0]; + } else if (transceiver.kind === 'video') { + localTrack = transceiver.stream.getVideoTracks()[0]; + } + if (localTrack) { + // add RTX + if (edgeVersion >= 15019 && transceiver.kind === 'video' && + !transceiver.sendEncodingParameters[0].rtx) { + transceiver.sendEncodingParameters[0].rtx = { + ssrc: transceiver.sendEncodingParameters[0].ssrc + 1 + }; + } + } + } + + // Calculate intersection of capabilities. + var commonCapabilities = getCommonCapabilities( + transceiver.localCapabilities, + transceiver.remoteCapabilities); + + var hasRtx = commonCapabilities.codecs.filter(function(c) { + return c.name.toLowerCase() === 'rtx'; + }).length; + if (!hasRtx && transceiver.sendEncodingParameters[0].rtx) { + delete transceiver.sendEncodingParameters[0].rtx; + } + + sdp += writeMediaSection(transceiver, commonCapabilities, + 'answer', transceiver.stream, self._dtlsRole); + if (transceiver.rtcpParameters && + transceiver.rtcpParameters.reducedSize) { + sdp += 'a=rtcp-rsize\r\n'; + } + }); + + var desc = new window.RTCSessionDescription({ + type: 'answer', + sdp: sdp + }); + return new Promise(function(resolve) { + if (args.length > 0 && typeof args[0] === 'function') { + args[0].apply(null, [desc]); + resolve(); + return; + } + resolve(desc); + }); + }; + + RTCPeerConnection.prototype.addIceCandidate = function(candidate) { + var err; + var sections; + if (!candidate || candidate.candidate === '') { + for (var j = 0; j < this.transceivers.length; j++) { + if (this.transceivers[j].isDatachannel) { + continue; + } + this.transceivers[j].iceTransport.addRemoteCandidate({}); + sections = SDPUtils.splitSections(this.remoteDescription.sdp); + sections[j + 1] += 'a=end-of-candidates\r\n'; + this.remoteDescription.sdp = sections.join(''); + if (this.usingBundle) { + break; + } + } + } else if (!(candidate.sdpMLineIndex !== undefined || candidate.sdpMid)) { + throw new TypeError('sdpMLineIndex or sdpMid required'); + } else if (!this.remoteDescription) { + err = new Error('Can not add ICE candidate without ' + + 'a remote description'); + err.name = 'InvalidStateError'; + } else { + var sdpMLineIndex = candidate.sdpMLineIndex; + if (candidate.sdpMid) { + for (var i = 0; i < this.transceivers.length; i++) { + if (this.transceivers[i].mid === candidate.sdpMid) { + sdpMLineIndex = i; + break; + } + } + } + var transceiver = this.transceivers[sdpMLineIndex]; + if (transceiver) { + if (transceiver.isDatachannel) { + return Promise.resolve(); + } + var cand = Object.keys(candidate.candidate).length > 0 ? + SDPUtils.parseCandidate(candidate.candidate) : {}; + // Ignore Chrome's invalid candidates since Edge does not like them. + if (cand.protocol === 'tcp' && (cand.port === 0 || cand.port === 9)) { + return Promise.resolve(); + } + // Ignore RTCP candidates, we assume RTCP-MUX. + if (cand.component && cand.component !== 1) { + return Promise.resolve(); + } + // when using bundle, avoid adding candidates to the wrong + // ice transport. And avoid adding candidates added in the SDP. + if (sdpMLineIndex === 0 || (sdpMLineIndex > 0 && + transceiver.iceTransport !== this.transceivers[0].iceTransport)) { + if (!maybeAddCandidate(transceiver.iceTransport, cand)) { + err = new Error('Can not add ICE candidate'); + err.name = 'OperationError'; + } + } + + if (!err) { + // update the remoteDescription. + var candidateString = candidate.candidate.trim(); + if (candidateString.indexOf('a=') === 0) { + candidateString = candidateString.substr(2); + } + sections = SDPUtils.splitSections(this.remoteDescription.sdp); + sections[sdpMLineIndex + 1] += 'a=' + + (cand.type ? candidateString : 'end-of-candidates') + + '\r\n'; + this.remoteDescription.sdp = sections.join(''); + } + } else { + err = new Error('Can not add ICE candidate'); + err.name = 'OperationError'; + } + } + var args = arguments; + return new Promise(function(resolve, reject) { + if (err) { + if (args.length > 2 && typeof args[2] === 'function') { + args[2].apply(null, [err]); + } + reject(err); + } else { + if (args.length > 1 && typeof args[1] === 'function') { + args[1].apply(null); + } + resolve(); + } + }); + }; + + RTCPeerConnection.prototype.getStats = function() { + var promises = []; + this.transceivers.forEach(function(transceiver) { + ['rtpSender', 'rtpReceiver', 'iceGatherer', 'iceTransport', + 'dtlsTransport'].forEach(function(method) { + if (transceiver[method]) { + promises.push(transceiver[method].getStats()); + } + }); + }); + var cb = arguments.length > 1 && typeof arguments[1] === 'function' && + arguments[1]; + var fixStatsType = function(stat) { + return { + inboundrtp: 'inbound-rtp', + outboundrtp: 'outbound-rtp', + candidatepair: 'candidate-pair', + localcandidate: 'local-candidate', + remotecandidate: 'remote-candidate' + }[stat.type] || stat.type; + }; + return new Promise(function(resolve) { + // shim getStats with maplike support + var results = new Map(); + Promise.all(promises).then(function(res) { + res.forEach(function(result) { + Object.keys(result).forEach(function(id) { + result[id].type = fixStatsType(result[id]); + results.set(id, result[id]); + }); + }); + if (cb) { + cb.apply(null, results); + } + resolve(results); + }); + }); + }; + return RTCPeerConnection; +}; + +},{"sdp":2}],2:[function(require,module,exports){ /* eslint-env node */ 'use strict'; @@ -69,6 +1629,10 @@ SDPUtils.parseCandidate = function(line) { case 'tcptype': candidate.tcpType = parts[i + 1]; break; + case 'ufrag': + candidate.ufrag = parts[i + 1]; // for backward compability. + candidate.usernameFragment = parts[i + 1]; + break; default: // extension handling, in particular ufrag candidate[parts[i]] = parts[i + 1]; break; @@ -529,8 +2093,10 @@ SDPUtils.generateSessionId = function() { // Write boilder plate for start of SDP // sessId argument is optional - if not supplied it will // be generated randomly -SDPUtils.writeSessionBoilerplate = function(sessId) { +// sessVersion is optional and defaults to 2 +SDPUtils.writeSessionBoilerplate = function(sessId, sessVer) { var sessionId; + var version = sessVer !== undefined ? sessVer : 2; if (sessId) { sessionId = sessId; } else { @@ -538,7 +2104,7 @@ SDPUtils.writeSessionBoilerplate = function(sessId) { } // FIXME: sess-id should be an NTP timestamp. return 'v=0\r\n' + - 'o=thisisadapterortc ' + sessionId + ' 2 IN IP4 127.0.0.1\r\n' + + 'o=thisisadapterortc ' + sessionId + ' ' + version + ' IN IP4 127.0.0.1\r\n' + 's=-\r\n' + 't=0 0\r\n'; }; @@ -628,10 +2194,23 @@ SDPUtils.isRejected = function(mediaSection) { return mediaSection.split(' ', 2)[1] === '0'; }; -// Expose public methods. -module.exports = SDPUtils; +SDPUtils.parseMLine = function(mediaSection) { + var lines = SDPUtils.splitLines(mediaSection); + var mline = lines[0].split(' '); + return { + kind: mline[0].substr(2), + port: parseInt(mline[1], 10), + protocol: mline[2], + fmt: mline.slice(3).join(' ') + }; +}; -},{}],2:[function(require,module,exports){ +// Expose public methods. +if (typeof module === 'object') { + module.exports = SDPUtils; +} + +},{}],3:[function(require,module,exports){ (function (global){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. @@ -648,7 +2227,7 @@ var adapterFactory = require('./adapter_factory.js'); module.exports = adapterFactory({window: global.window}); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./adapter_factory.js":3}],3:[function(require,module,exports){ +},{"./adapter_factory.js":4}],4:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -660,12 +2239,25 @@ module.exports = adapterFactory({window: global.window}); 'use strict'; +var utils = require('./utils'); // Shimming starts here. -module.exports = function(dependencies) { +module.exports = function(dependencies, opts) { var window = dependencies && dependencies.window; + var options = { + shimChrome: true, + shimFirefox: true, + shimEdge: true, + shimSafari: true, + }; + + for (var key in opts) { + if (hasOwnProperty.call(opts, key)) { + options[key] = opts[key]; + } + } + // Utils. - var utils = require('./utils'); var logging = utils.log; var browserDetails = utils.detectBrowser(window); @@ -688,70 +2280,85 @@ module.exports = function(dependencies) { var edgeShim = require('./edge/edge_shim') || null; var firefoxShim = require('./firefox/firefox_shim') || null; var safariShim = require('./safari/safari_shim') || null; + var commonShim = require('./common_shim') || null; // Shim browser if found. switch (browserDetails.browser) { case 'chrome': - if (!chromeShim || !chromeShim.shimPeerConnection) { + if (!chromeShim || !chromeShim.shimPeerConnection || + !options.shimChrome) { logging('Chrome shim is not included in this adapter release.'); return adapter; } logging('adapter.js shimming chrome.'); // Export to the adapter global object visible in the browser. adapter.browserShim = chromeShim; + commonShim.shimCreateObjectURL(window); chromeShim.shimGetUserMedia(window); chromeShim.shimMediaStream(window); - utils.shimCreateObjectURL(window); chromeShim.shimSourceObject(window); chromeShim.shimPeerConnection(window); chromeShim.shimOnTrack(window); + chromeShim.shimAddTrackRemoveTrack(window); chromeShim.shimGetSendersWithDtmf(window); + + commonShim.shimRTCIceCandidate(window); break; case 'firefox': - if (!firefoxShim || !firefoxShim.shimPeerConnection) { + if (!firefoxShim || !firefoxShim.shimPeerConnection || + !options.shimFirefox) { logging('Firefox shim is not included in this adapter release.'); return adapter; } logging('adapter.js shimming firefox.'); // Export to the adapter global object visible in the browser. adapter.browserShim = firefoxShim; + commonShim.shimCreateObjectURL(window); firefoxShim.shimGetUserMedia(window); - utils.shimCreateObjectURL(window); firefoxShim.shimSourceObject(window); firefoxShim.shimPeerConnection(window); firefoxShim.shimOnTrack(window); + firefoxShim.shimRemoveStream(window); + + commonShim.shimRTCIceCandidate(window); break; case 'edge': - if (!edgeShim || !edgeShim.shimPeerConnection) { + if (!edgeShim || !edgeShim.shimPeerConnection || !options.shimEdge) { logging('MS edge shim is not included in this adapter release.'); return adapter; } logging('adapter.js shimming edge.'); // Export to the adapter global object visible in the browser. adapter.browserShim = edgeShim; + commonShim.shimCreateObjectURL(window); edgeShim.shimGetUserMedia(window); - utils.shimCreateObjectURL(window); edgeShim.shimPeerConnection(window); edgeShim.shimReplaceTrack(window); + + // the edge shim implements the full RTCIceCandidate object. break; case 'safari': - if (!safariShim) { + if (!safariShim || !options.shimSafari) { logging('Safari shim is not included in this adapter release.'); return adapter; } logging('adapter.js shimming safari.'); // Export to the adapter global object visible in the browser. adapter.browserShim = safariShim; - // shim window.URL.createObjectURL Safari (technical preview) - utils.shimCreateObjectURL(window); + commonShim.shimCreateObjectURL(window); + safariShim.shimRTCIceServerUrls(window); safariShim.shimCallbacksAPI(window); safariShim.shimLocalStreamsAPI(window); safariShim.shimRemoteStreamsAPI(window); + safariShim.shimTrackEventTransceiver(window); safariShim.shimGetUserMedia(window); + safariShim.shimCreateOfferLegacy(window); + + commonShim.shimRTCIceCandidate(window); break; default: logging('Unsupported browser!'); @@ -761,7 +2368,7 @@ module.exports = function(dependencies) { return adapter; }; -},{"./chrome/chrome_shim":4,"./edge/edge_shim":6,"./firefox/firefox_shim":9,"./safari/safari_shim":11,"./utils":12}],4:[function(require,module,exports){ +},{"./chrome/chrome_shim":5,"./common_shim":7,"./edge/edge_shim":8,"./firefox/firefox_shim":10,"./safari/safari_shim":12,"./utils":13}],5:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. @@ -788,20 +2395,25 @@ var chromeShim = { return this._ontrack; }, set: function(f) { - var self = this; if (this._ontrack) { this.removeEventListener('track', this._ontrack); - this.removeEventListener('addstream', this._ontrackpoly); } this.addEventListener('track', this._ontrack = f); - this.addEventListener('addstream', this._ontrackpoly = function(e) { + } + }); + var origSetRemoteDescription = + window.RTCPeerConnection.prototype.setRemoteDescription; + window.RTCPeerConnection.prototype.setRemoteDescription = function() { + var pc = this; + if (!pc._ontrackpoly) { + pc._ontrackpoly = function(e) { // onaddstream does not fire when a track is added to an existing // stream. But stream.onaddtrack is implemented so we use that. e.stream.addEventListener('addtrack', function(te) { var receiver; if (window.RTCPeerConnection.prototype.getReceivers) { - receiver = self.getReceivers().find(function(r) { - return r.track.id === te.track.id; + receiver = pc.getReceivers().find(function(r) { + return r.track && r.track.id === te.track.id; }); } else { receiver = {track: te.track}; @@ -810,14 +2422,15 @@ var chromeShim = { var event = new Event('track'); event.track = te.track; event.receiver = receiver; + event.transceiver = {receiver: receiver}; event.streams = [e.stream]; - self.dispatchEvent(event); + pc.dispatchEvent(event); }); e.stream.getTracks().forEach(function(track) { var receiver; if (window.RTCPeerConnection.prototype.getReceivers) { - receiver = self.getReceivers().find(function(r) { - return r.track.id === track.id; + receiver = pc.getReceivers().find(function(r) { + return r.track && r.track.id === track.id; }); } else { receiver = {track: track}; @@ -825,109 +2438,83 @@ var chromeShim = { var event = new Event('track'); event.track = track; event.receiver = receiver; + event.transceiver = {receiver: receiver}; event.streams = [e.stream]; - this.dispatchEvent(event); - }.bind(this)); - }.bind(this)); + pc.dispatchEvent(event); + }); + }; + pc.addEventListener('addstream', pc._ontrackpoly); } - }); + return origSetRemoteDescription.apply(pc, arguments); + }; } }, shimGetSendersWithDtmf: function(window) { + // Overrides addTrack/removeTrack, depends on shimAddTrackRemoveTrack. if (typeof window === 'object' && window.RTCPeerConnection && !('getSenders' in window.RTCPeerConnection.prototype) && 'createDTMFSender' in window.RTCPeerConnection.prototype) { - window.RTCPeerConnection.prototype.getSenders = function() { - return this._senders || []; + var shimSenderWithDtmf = function(pc, track) { + return { + track: track, + get dtmf() { + if (this._dtmf === undefined) { + if (track.kind === 'audio') { + this._dtmf = pc.createDTMFSender(track); + } else { + this._dtmf = null; + } + } + return this._dtmf; + }, + _pc: pc + }; }; - var origAddStream = window.RTCPeerConnection.prototype.addStream; - var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; - if (!window.RTCPeerConnection.prototype.addTrack) { + // augment addTrack when getSenders is not available. + if (!window.RTCPeerConnection.prototype.getSenders) { + window.RTCPeerConnection.prototype.getSenders = function() { + this._senders = this._senders || []; + return this._senders.slice(); // return a copy of the internal state. + }; + var origAddTrack = window.RTCPeerConnection.prototype.addTrack; window.RTCPeerConnection.prototype.addTrack = function(track, stream) { var pc = this; - if (pc.signalingState === 'closed') { - throw new DOMException( - 'The RTCPeerConnection\'s signalingState is \'closed\'.', - 'InvalidStateError'); + var sender = origAddTrack.apply(pc, arguments); + if (!sender) { + sender = shimSenderWithDtmf(pc, track); + pc._senders.push(sender); } - var streams = [].slice.call(arguments, 1); - if (streams.length !== 1 || - !streams[0].getTracks().find(function(t) { - return t === track; - })) { - // this is not fully correct but all we can manage without - // [[associated MediaStreams]] internal slot. - throw new DOMException( - 'The adapter.js addTrack polyfill only supports a single ' + - ' stream which is associated with the specified track.', - 'NotSupportedError'); - } - - pc._senders = pc._senders || []; - var alreadyExists = pc._senders.find(function(t) { - return t.track === track; - }); - if (alreadyExists) { - throw new DOMException('Track already exists.', - 'InvalidAccessError'); - } - - pc._streams = pc._streams || {}; - var oldStream = pc._streams[stream.id]; - if (oldStream) { - oldStream.addTrack(track); - pc.removeStream(oldStream); - pc.addStream(oldStream); - } else { - var newStream = new window.MediaStream([track]); - pc._streams[stream.id] = newStream; - pc.addStream(newStream); - } - - var sender = { - track: track, - get dtmf() { - if (this._dtmf === undefined) { - if (track.kind === 'audio') { - this._dtmf = pc.createDTMFSender(track); - } else { - this._dtmf = null; - } - } - return this._dtmf; - } - }; - pc._senders.push(sender); return sender; }; + + var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack; + window.RTCPeerConnection.prototype.removeTrack = function(sender) { + var pc = this; + origRemoveTrack.apply(pc, arguments); + var idx = pc._senders.indexOf(sender); + if (idx !== -1) { + pc._senders.splice(idx, 1); + } + }; } + var origAddStream = window.RTCPeerConnection.prototype.addStream; window.RTCPeerConnection.prototype.addStream = function(stream) { var pc = this; pc._senders = pc._senders || []; origAddStream.apply(pc, [stream]); stream.getTracks().forEach(function(track) { - pc._senders.push({ - track: track, - get dtmf() { - if (this._dtmf === undefined) { - if (track.kind === 'audio') { - this._dtmf = pc.createDTMFSender(track); - } else { - this._dtmf = null; - } - } - return this._dtmf; - } - }); + pc._senders.push(shimSenderWithDtmf(pc, track)); }); }; + var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; window.RTCPeerConnection.prototype.removeStream = function(stream) { var pc = this; pc._senders = pc._senders || []; origRemoveStream.apply(pc, [stream]); + stream.getTracks().forEach(function(track) { var sender = pc._senders.find(function(s) { return s.track === track; @@ -962,7 +2549,7 @@ var chromeShim = { } } return this._dtmf; - }, + } }); } }, @@ -1011,6 +2598,245 @@ var chromeShim = { } }, + shimAddTrackRemoveTrack: function(window) { + var browserDetails = utils.detectBrowser(window); + // shim addTrack and removeTrack. + if (window.RTCPeerConnection.prototype.addTrack && + browserDetails.version >= 64) { + return; + } + + // also shim pc.getLocalStreams when addTrack is shimmed + // to return the original streams. + var origGetLocalStreams = window.RTCPeerConnection.prototype + .getLocalStreams; + window.RTCPeerConnection.prototype.getLocalStreams = function() { + var self = this; + var nativeStreams = origGetLocalStreams.apply(this); + self._reverseStreams = self._reverseStreams || {}; + return nativeStreams.map(function(stream) { + return self._reverseStreams[stream.id]; + }); + }; + + var origAddStream = window.RTCPeerConnection.prototype.addStream; + window.RTCPeerConnection.prototype.addStream = function(stream) { + var pc = this; + pc._streams = pc._streams || {}; + pc._reverseStreams = pc._reverseStreams || {}; + + stream.getTracks().forEach(function(track) { + var alreadyExists = pc.getSenders().find(function(s) { + return s.track === track; + }); + if (alreadyExists) { + throw new DOMException('Track already exists.', + 'InvalidAccessError'); + } + }); + // Add identity mapping for consistency with addTrack. + // Unless this is being used with a stream from addTrack. + if (!pc._reverseStreams[stream.id]) { + var newStream = new window.MediaStream(stream.getTracks()); + pc._streams[stream.id] = newStream; + pc._reverseStreams[newStream.id] = stream; + stream = newStream; + } + origAddStream.apply(pc, [stream]); + }; + + var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; + window.RTCPeerConnection.prototype.removeStream = function(stream) { + var pc = this; + pc._streams = pc._streams || {}; + pc._reverseStreams = pc._reverseStreams || {}; + + origRemoveStream.apply(pc, [(pc._streams[stream.id] || stream)]); + delete pc._reverseStreams[(pc._streams[stream.id] ? + pc._streams[stream.id].id : stream.id)]; + delete pc._streams[stream.id]; + }; + + window.RTCPeerConnection.prototype.addTrack = function(track, stream) { + var pc = this; + if (pc.signalingState === 'closed') { + throw new DOMException( + 'The RTCPeerConnection\'s signalingState is \'closed\'.', + 'InvalidStateError'); + } + var streams = [].slice.call(arguments, 1); + if (streams.length !== 1 || + !streams[0].getTracks().find(function(t) { + return t === track; + })) { + // this is not fully correct but all we can manage without + // [[associated MediaStreams]] internal slot. + throw new DOMException( + 'The adapter.js addTrack polyfill only supports a single ' + + ' stream which is associated with the specified track.', + 'NotSupportedError'); + } + + var alreadyExists = pc.getSenders().find(function(s) { + return s.track === track; + }); + if (alreadyExists) { + throw new DOMException('Track already exists.', + 'InvalidAccessError'); + } + + pc._streams = pc._streams || {}; + pc._reverseStreams = pc._reverseStreams || {}; + var oldStream = pc._streams[stream.id]; + if (oldStream) { + // this is using odd Chrome behaviour, use with caution: + // https://bugs.chromium.org/p/webrtc/issues/detail?id=7815 + // Note: we rely on the high-level addTrack/dtmf shim to + // create the sender with a dtmf sender. + oldStream.addTrack(track); + + // Trigger ONN async. + Promise.resolve().then(function() { + pc.dispatchEvent(new Event('negotiationneeded')); + }); + } else { + var newStream = new window.MediaStream([track]); + pc._streams[stream.id] = newStream; + pc._reverseStreams[newStream.id] = stream; + pc.addStream(newStream); + } + return pc.getSenders().find(function(s) { + return s.track === track; + }); + }; + + // replace the internal stream id with the external one and + // vice versa. + function replaceInternalStreamId(pc, description) { + var sdp = description.sdp; + Object.keys(pc._reverseStreams || []).forEach(function(internalId) { + var externalStream = pc._reverseStreams[internalId]; + var internalStream = pc._streams[externalStream.id]; + sdp = sdp.replace(new RegExp(internalStream.id, 'g'), + externalStream.id); + }); + return new RTCSessionDescription({ + type: description.type, + sdp: sdp + }); + } + function replaceExternalStreamId(pc, description) { + var sdp = description.sdp; + Object.keys(pc._reverseStreams || []).forEach(function(internalId) { + var externalStream = pc._reverseStreams[internalId]; + var internalStream = pc._streams[externalStream.id]; + sdp = sdp.replace(new RegExp(externalStream.id, 'g'), + internalStream.id); + }); + return new RTCSessionDescription({ + type: description.type, + sdp: sdp + }); + } + ['createOffer', 'createAnswer'].forEach(function(method) { + var nativeMethod = window.RTCPeerConnection.prototype[method]; + window.RTCPeerConnection.prototype[method] = function() { + var pc = this; + var args = arguments; + var isLegacyCall = arguments.length && + typeof arguments[0] === 'function'; + if (isLegacyCall) { + return nativeMethod.apply(pc, [ + function(description) { + var desc = replaceInternalStreamId(pc, description); + args[0].apply(null, [desc]); + }, + function(err) { + if (args[1]) { + args[1].apply(null, err); + } + }, arguments[2] + ]); + } + return nativeMethod.apply(pc, arguments) + .then(function(description) { + return replaceInternalStreamId(pc, description); + }); + }; + }); + + var origSetLocalDescription = + window.RTCPeerConnection.prototype.setLocalDescription; + window.RTCPeerConnection.prototype.setLocalDescription = function() { + var pc = this; + if (!arguments.length || !arguments[0].type) { + return origSetLocalDescription.apply(pc, arguments); + } + arguments[0] = replaceExternalStreamId(pc, arguments[0]); + return origSetLocalDescription.apply(pc, arguments); + }; + + // TODO: mangle getStats: https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamstats-streamidentifier + + var origLocalDescription = Object.getOwnPropertyDescriptor( + window.RTCPeerConnection.prototype, 'localDescription'); + Object.defineProperty(window.RTCPeerConnection.prototype, + 'localDescription', { + get: function() { + var pc = this; + var description = origLocalDescription.get.apply(this); + if (description.type === '') { + return description; + } + return replaceInternalStreamId(pc, description); + } + }); + + window.RTCPeerConnection.prototype.removeTrack = function(sender) { + var pc = this; + if (pc.signalingState === 'closed') { + throw new DOMException( + 'The RTCPeerConnection\'s signalingState is \'closed\'.', + 'InvalidStateError'); + } + // We can not yet check for sender instanceof RTCRtpSender + // since we shim RTPSender. So we check if sender._pc is set. + if (!sender._pc) { + throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack ' + + 'does not implement interface RTCRtpSender.', 'TypeError'); + } + var isLocal = sender._pc === pc; + if (!isLocal) { + throw new DOMException('Sender was not created by this connection.', + 'InvalidAccessError'); + } + + // Search for the native stream the senders track belongs to. + pc._streams = pc._streams || {}; + var stream; + Object.keys(pc._streams).forEach(function(streamid) { + var hasTrack = pc._streams[streamid].getTracks().find(function(track) { + return sender.track === track; + }); + if (hasTrack) { + stream = pc._streams[streamid]; + } + }); + + if (stream) { + if (stream.getTracks().length === 1) { + // if this is the last track of the stream, remove the stream. This + // takes care of any shimmed _senders. + pc.removeStream(pc._reverseStreams[stream.id]); + } else { + // relying on the same odd chrome behaviour as above. + stream.removeTrack(sender.track); + } + pc.dispatchEvent(new Event('negotiationneeded')); + } + }; + }, + shimPeerConnection: function(window) { var browserDetails = utils.detectBrowser(window); @@ -1047,7 +2873,7 @@ var chromeShim = { var server = pcConfig.iceServers[i]; if (!server.hasOwnProperty('urls') && server.hasOwnProperty('url')) { - console.warn('RTCIceServer.url is deprecated! Use urls instead.'); + utils.deprecated('RTCIceServer.url', 'RTCIceServer.urls'); server = JSON.parse(JSON.stringify(server)); server.urls = server.url; newIceServers.push(server); @@ -1210,13 +3036,14 @@ var chromeShim = { module.exports = { shimMediaStream: chromeShim.shimMediaStream, shimOnTrack: chromeShim.shimOnTrack, + shimAddTrackRemoveTrack: chromeShim.shimAddTrackRemoveTrack, shimGetSendersWithDtmf: chromeShim.shimGetSendersWithDtmf, shimSourceObject: chromeShim.shimSourceObject, shimPeerConnection: chromeShim.shimPeerConnection, shimGetUserMedia: require('./getusermedia') }; -},{"../utils.js":12,"./getusermedia":5}],5:[function(require,module,exports){ +},{"../utils.js":13,"./getusermedia":6}],6:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -1286,6 +3113,9 @@ module.exports = function(window) { }; var shimConstraints_ = function(constraints, func) { + if (browserDetails.version >= 61) { + return func(constraints); + } constraints = JSON.parse(JSON.stringify(constraints)); if (constraints && typeof constraints.audio === 'object') { var remap = function(obj, a, b) { @@ -1303,7 +3133,7 @@ module.exports = function(window) { // Shim facingMode for mobile & surface pro. var face = constraints.video.facingMode; face = face && ((typeof face === 'object') ? face : {ideal: face}); - var getSupportedFacingModeLies = browserDetails.version < 61; + var getSupportedFacingModeLies = browserDetails.version < 66; if ((face && (face.exact === 'user' || face.exact === 'environment' || face.ideal === 'user' || face.ideal === 'environment')) && @@ -1370,7 +3200,9 @@ module.exports = function(window) { var getUserMedia_ = function(constraints, onSuccess, onError) { shimConstraints_(constraints, function(c) { navigator.webkitGetUserMedia(c, onSuccess, function(e) { - onError(shimError_(e)); + if (onError) { + onError(shimError_(e)); + } }); }); }; @@ -1453,7 +3285,175 @@ module.exports = function(window) { } }; -},{"../utils.js":12}],6:[function(require,module,exports){ +},{"../utils.js":13}],7:[function(require,module,exports){ +/* + * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ +'use strict'; + +var SDPUtils = require('sdp'); +var utils = require('./utils'); + +// Wraps the peerconnection event eventNameToWrap in a function +// which returns the modified event object. +function wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) { + if (!window.RTCPeerConnection) { + return; + } + var proto = window.RTCPeerConnection.prototype; + var nativeAddEventListener = proto.addEventListener; + proto.addEventListener = function(nativeEventName, cb) { + if (nativeEventName !== eventNameToWrap) { + return nativeAddEventListener.apply(this, arguments); + } + var wrappedCallback = function(e) { + cb(wrapper(e)); + }; + this._eventMap = this._eventMap || {}; + this._eventMap[cb] = wrappedCallback; + return nativeAddEventListener.apply(this, [nativeEventName, + wrappedCallback]); + }; + + var nativeRemoveEventListener = proto.removeEventListener; + proto.removeEventListener = function(nativeEventName, cb) { + if (nativeEventName !== eventNameToWrap || !this._eventMap + || !this._eventMap[cb]) { + return nativeRemoveEventListener.apply(this, arguments); + } + var unwrappedCb = this._eventMap[cb]; + delete this._eventMap[cb]; + return nativeRemoveEventListener.apply(this, [nativeEventName, + unwrappedCb]); + }; + + Object.defineProperty(proto, 'on' + eventNameToWrap, { + get: function() { + return this['_on' + eventNameToWrap]; + }, + set: function(cb) { + if (this['_on' + eventNameToWrap]) { + this.removeEventListener(eventNameToWrap, + this['_on' + eventNameToWrap]); + delete this['_on' + eventNameToWrap]; + } + if (cb) { + this.addEventListener(eventNameToWrap, + this['_on' + eventNameToWrap] = cb); + } + } + }); +} + +module.exports = { + shimRTCIceCandidate: function(window) { + // foundation is arbitrarily chosen as an indicator for full support for + // https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface + if (window.RTCIceCandidate && 'foundation' in + window.RTCIceCandidate.prototype) { + return; + } + + var NativeRTCIceCandidate = window.RTCIceCandidate; + window.RTCIceCandidate = function(args) { + // Remove the a= which shouldn't be part of the candidate string. + if (typeof args === 'object' && args.candidate && + args.candidate.indexOf('a=') === 0) { + args = JSON.parse(JSON.stringify(args)); + args.candidate = args.candidate.substr(2); + } + + // Augment the native candidate with the parsed fields. + var nativeCandidate = new NativeRTCIceCandidate(args); + var parsedCandidate = SDPUtils.parseCandidate(args.candidate); + var augmentedCandidate = Object.assign(nativeCandidate, + parsedCandidate); + + // Add a serializer that does not serialize the extra attributes. + augmentedCandidate.toJSON = function() { + return { + candidate: augmentedCandidate.candidate, + sdpMid: augmentedCandidate.sdpMid, + sdpMLineIndex: augmentedCandidate.sdpMLineIndex, + usernameFragment: augmentedCandidate.usernameFragment, + }; + }; + return augmentedCandidate; + }; + + // Hook up the augmented candidate in onicecandidate and + // addEventListener('icecandidate', ...) + wrapPeerConnectionEvent(window, 'icecandidate', function(e) { + if (e.candidate) { + Object.defineProperty(e, 'candidate', { + value: new window.RTCIceCandidate(e.candidate), + writable: 'false' + }); + } + return e; + }); + }, + + // shimCreateObjectURL must be called before shimSourceObject to avoid loop. + + shimCreateObjectURL: function(window) { + var URL = window && window.URL; + + if (!(typeof window === 'object' && window.HTMLMediaElement && + 'srcObject' in window.HTMLMediaElement.prototype && + URL.createObjectURL && URL.revokeObjectURL)) { + // Only shim CreateObjectURL using srcObject if srcObject exists. + return undefined; + } + + var nativeCreateObjectURL = URL.createObjectURL.bind(URL); + var nativeRevokeObjectURL = URL.revokeObjectURL.bind(URL); + var streams = new Map(), newId = 0; + + URL.createObjectURL = function(stream) { + if ('getTracks' in stream) { + var url = 'polyblob:' + (++newId); + streams.set(url, stream); + utils.deprecated('URL.createObjectURL(stream)', + 'elem.srcObject = stream'); + return url; + } + return nativeCreateObjectURL(stream); + }; + URL.revokeObjectURL = function(url) { + nativeRevokeObjectURL(url); + streams.delete(url); + }; + + var dsc = Object.getOwnPropertyDescriptor(window.HTMLMediaElement.prototype, + 'src'); + Object.defineProperty(window.HTMLMediaElement.prototype, 'src', { + get: function() { + return dsc.get.apply(this); + }, + set: function(url) { + this.srcObject = streams.get(url) || null; + return dsc.set.apply(this, [url]); + } + }); + + var nativeSetAttribute = window.HTMLMediaElement.prototype.setAttribute; + window.HTMLMediaElement.prototype.setAttribute = function() { + if (arguments.length === 2 && + ('' + arguments[0]).toLowerCase() === 'src') { + this.srcObject = streams.get(arguments[1]) || null; + } + return nativeSetAttribute.apply(this, arguments); + }; + } +}; + +},{"./utils":13,"sdp":2}],8:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -1465,7 +3465,7 @@ module.exports = function(window) { 'use strict'; var utils = require('../utils'); -var shimRTCPeerConnection = require('./rtcpeerconnection_shim'); +var shimRTCPeerConnection = require('rtcpeerconnection-shim'); module.exports = { shimGetUserMedia: require('./getusermedia'), @@ -1504,6 +3504,24 @@ module.exports = { }); } } + + // ORTC defines the DTMF sender a bit different. + // https://github.com/w3c/ortc/issues/714 + if (window.RTCRtpSender && !('dtmf' in window.RTCRtpSender.prototype)) { + Object.defineProperty(window.RTCRtpSender.prototype, 'dtmf', { + get: function() { + if (this._dtmf === undefined) { + if (this.track.kind === 'audio') { + this._dtmf = new window.RTCDtmfSender(this); + } else if (this.track.kind === 'video') { + this._dtmf = null; + } + } + return this._dtmf; + } + }); + } + window.RTCPeerConnection = shimRTCPeerConnection(window, browserDetails.version); }, @@ -1517,7 +3535,7 @@ module.exports = { } }; -},{"../utils":12,"./getusermedia":7,"./rtcpeerconnection_shim":8}],7:[function(require,module,exports){ +},{"../utils":13,"./getusermedia":9,"rtcpeerconnection-shim":1}],9:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -1553,1397 +3571,7 @@ module.exports = function(window) { }; }; -},{}],8:[function(require,module,exports){ -/* - * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. - */ - /* eslint-env node */ -'use strict'; - -var SDPUtils = require('sdp'); - -// sort tracks such that they follow an a-v-a-v... -// pattern. -function sortTracks(tracks) { - var audioTracks = tracks.filter(function(track) { - return track.kind === 'audio'; - }); - var videoTracks = tracks.filter(function(track) { - return track.kind === 'video'; - }); - tracks = []; - while (audioTracks.length || videoTracks.length) { - if (audioTracks.length) { - tracks.push(audioTracks.shift()); - } - if (videoTracks.length) { - tracks.push(videoTracks.shift()); - } - } - return tracks; -} - -// Edge does not like -// 1) stun: -// 2) turn: that does not have all of turn:host:port?transport=udp -// 3) turn: with ipv6 addresses -// 4) turn: occurring muliple times -function filterIceServers(iceServers, edgeVersion) { - var hasTurn = false; - iceServers = JSON.parse(JSON.stringify(iceServers)); - return iceServers.filter(function(server) { - if (server && (server.urls || server.url)) { - var urls = server.urls || server.url; - if (server.url && !server.urls) { - console.warn('RTCIceServer.url is deprecated! Use urls instead.'); - } - var isString = typeof urls === 'string'; - if (isString) { - urls = [urls]; - } - urls = urls.filter(function(url) { - var validTurn = url.indexOf('turn:') === 0 && - url.indexOf('transport=udp') !== -1 && - url.indexOf('turn:[') === -1 && - !hasTurn; - - if (validTurn) { - hasTurn = true; - return true; - } - return url.indexOf('stun:') === 0 && edgeVersion >= 14393; - }); - - delete server.url; - server.urls = isString ? urls[0] : urls; - return !!urls.length; - } - return false; - }); -} - -// Determines the intersection of local and remote capabilities. -function getCommonCapabilities(localCapabilities, remoteCapabilities) { - var commonCapabilities = { - codecs: [], - headerExtensions: [], - fecMechanisms: [] - }; - - var findCodecByPayloadType = function(pt, codecs) { - pt = parseInt(pt, 10); - for (var i = 0; i < codecs.length; i++) { - if (codecs[i].payloadType === pt || - codecs[i].preferredPayloadType === pt) { - return codecs[i]; - } - } - }; - - var rtxCapabilityMatches = function(lRtx, rRtx, lCodecs, rCodecs) { - var lCodec = findCodecByPayloadType(lRtx.parameters.apt, lCodecs); - var rCodec = findCodecByPayloadType(rRtx.parameters.apt, rCodecs); - return lCodec && rCodec && - lCodec.name.toLowerCase() === rCodec.name.toLowerCase(); - }; - - localCapabilities.codecs.forEach(function(lCodec) { - for (var i = 0; i < remoteCapabilities.codecs.length; i++) { - var rCodec = remoteCapabilities.codecs[i]; - if (lCodec.name.toLowerCase() === rCodec.name.toLowerCase() && - lCodec.clockRate === rCodec.clockRate) { - if (lCodec.name.toLowerCase() === 'rtx' && - lCodec.parameters && rCodec.parameters.apt) { - // for RTX we need to find the local rtx that has a apt - // which points to the same local codec as the remote one. - if (!rtxCapabilityMatches(lCodec, rCodec, - localCapabilities.codecs, remoteCapabilities.codecs)) { - continue; - } - } - rCodec = JSON.parse(JSON.stringify(rCodec)); // deepcopy - // number of channels is the highest common number of channels - rCodec.numChannels = Math.min(lCodec.numChannels, - rCodec.numChannels); - // push rCodec so we reply with offerer payload type - commonCapabilities.codecs.push(rCodec); - - // determine common feedback mechanisms - rCodec.rtcpFeedback = rCodec.rtcpFeedback.filter(function(fb) { - for (var j = 0; j < lCodec.rtcpFeedback.length; j++) { - if (lCodec.rtcpFeedback[j].type === fb.type && - lCodec.rtcpFeedback[j].parameter === fb.parameter) { - return true; - } - } - return false; - }); - // FIXME: also need to determine .parameters - // see https://github.com/openpeer/ortc/issues/569 - break; - } - } - }); - - localCapabilities.headerExtensions.forEach(function(lHeaderExtension) { - for (var i = 0; i < remoteCapabilities.headerExtensions.length; - i++) { - var rHeaderExtension = remoteCapabilities.headerExtensions[i]; - if (lHeaderExtension.uri === rHeaderExtension.uri) { - commonCapabilities.headerExtensions.push(rHeaderExtension); - break; - } - } - }); - - // FIXME: fecMechanisms - return commonCapabilities; -} - -// is action=setLocalDescription with type allowed in signalingState -function isActionAllowedInSignalingState(action, type, signalingState) { - return { - offer: { - setLocalDescription: ['stable', 'have-local-offer'], - setRemoteDescription: ['stable', 'have-remote-offer'] - }, - answer: { - setLocalDescription: ['have-remote-offer', 'have-local-pranswer'], - setRemoteDescription: ['have-local-offer', 'have-remote-pranswer'] - } - }[type][action].indexOf(signalingState) !== -1; -} - -module.exports = function(window, edgeVersion) { - var RTCPeerConnection = function(config) { - var self = this; - - var _eventTarget = document.createDocumentFragment(); - ['addEventListener', 'removeEventListener', 'dispatchEvent'] - .forEach(function(method) { - self[method] = _eventTarget[method].bind(_eventTarget); - }); - - this.needNegotiation = false; - - this.onicecandidate = null; - this.onaddstream = null; - this.ontrack = null; - this.onremovestream = null; - this.onsignalingstatechange = null; - this.oniceconnectionstatechange = null; - this.onicegatheringstatechange = null; - this.onnegotiationneeded = null; - this.ondatachannel = null; - this.canTrickleIceCandidates = null; - - this.localStreams = []; - this.remoteStreams = []; - this.getLocalStreams = function() { - return self.localStreams; - }; - this.getRemoteStreams = function() { - return self.remoteStreams; - }; - - this.localDescription = new window.RTCSessionDescription({ - type: '', - sdp: '' - }); - this.remoteDescription = new window.RTCSessionDescription({ - type: '', - sdp: '' - }); - this.signalingState = 'stable'; - this.iceConnectionState = 'new'; - this.iceGatheringState = 'new'; - - this.iceOptions = { - gatherPolicy: 'all', - iceServers: [] - }; - if (config && config.iceTransportPolicy) { - switch (config.iceTransportPolicy) { - case 'all': - case 'relay': - this.iceOptions.gatherPolicy = config.iceTransportPolicy; - break; - default: - // don't set iceTransportPolicy. - break; - } - } - this.usingBundle = config && config.bundlePolicy === 'max-bundle'; - - if (config && config.iceServers) { - this.iceOptions.iceServers = filterIceServers(config.iceServers, - edgeVersion); - } - this._config = config || {}; - - // per-track iceGathers, iceTransports, dtlsTransports, rtpSenders, ... - // everything that is needed to describe a SDP m-line. - this.transceivers = []; - - // since the iceGatherer is currently created in createOffer but we - // must not emit candidates until after setLocalDescription we buffer - // them in this array. - this._localIceCandidatesBuffer = []; - - this._sdpSessionId = SDPUtils.generateSessionId(); - }; - - RTCPeerConnection.prototype._emitGatheringStateChange = function() { - var event = new Event('icegatheringstatechange'); - this.dispatchEvent(event); - if (this.onicegatheringstatechange !== null) { - this.onicegatheringstatechange(event); - } - }; - - RTCPeerConnection.prototype._emitBufferedCandidates = function() { - var self = this; - var sections = SDPUtils.splitSections(self.localDescription.sdp); - // FIXME: need to apply ice candidates in a way which is async but - // in-order - this._localIceCandidatesBuffer.forEach(function(event) { - var end = !event.candidate || Object.keys(event.candidate).length === 0; - if (end) { - for (var j = 1; j < sections.length; j++) { - if (sections[j].indexOf('\r\na=end-of-candidates\r\n') === -1) { - sections[j] += 'a=end-of-candidates\r\n'; - } - } - } else { - sections[event.candidate.sdpMLineIndex + 1] += - 'a=' + event.candidate.candidate + '\r\n'; - } - self.localDescription.sdp = sections.join(''); - self.dispatchEvent(event); - if (self.onicecandidate !== null) { - self.onicecandidate(event); - } - if (!event.candidate && self.iceGatheringState !== 'complete') { - var complete = self.transceivers.every(function(transceiver) { - return transceiver.iceGatherer && - transceiver.iceGatherer.state === 'completed'; - }); - if (complete && self.iceGatheringStateChange !== 'complete') { - self.iceGatheringState = 'complete'; - self._emitGatheringStateChange(); - } - } - }); - this._localIceCandidatesBuffer = []; - }; - - RTCPeerConnection.prototype.getConfiguration = function() { - return this._config; - }; - - // internal helper to create a transceiver object. - // (whih is not yet the same as the WebRTC 1.0 transceiver) - RTCPeerConnection.prototype._createTransceiver = function(kind) { - var hasBundleTransport = this.transceivers.length > 0; - var transceiver = { - track: null, - iceGatherer: null, - iceTransport: null, - dtlsTransport: null, - localCapabilities: null, - remoteCapabilities: null, - rtpSender: null, - rtpReceiver: null, - kind: kind, - mid: null, - sendEncodingParameters: null, - recvEncodingParameters: null, - stream: null, - wantReceive: true - }; - if (this.usingBundle && hasBundleTransport) { - transceiver.iceTransport = this.transceivers[0].iceTransport; - transceiver.dtlsTransport = this.transceivers[0].dtlsTransport; - } else { - var transports = this._createIceAndDtlsTransports(); - transceiver.iceTransport = transports.iceTransport; - transceiver.dtlsTransport = transports.dtlsTransport; - } - this.transceivers.push(transceiver); - return transceiver; - }; - - RTCPeerConnection.prototype.addTrack = function(track, stream) { - var transceiver; - for (var i = 0; i < this.transceivers.length; i++) { - if (!this.transceivers[i].track && - this.transceivers[i].kind === track.kind) { - transceiver = this.transceivers[i]; - } - } - if (!transceiver) { - transceiver = this._createTransceiver(track.kind); - } - - transceiver.track = track; - transceiver.stream = stream; - transceiver.rtpSender = new window.RTCRtpSender(track, - transceiver.dtlsTransport); - - this._maybeFireNegotiationNeeded(); - return transceiver.rtpSender; - }; - - RTCPeerConnection.prototype.addStream = function(stream) { - var self = this; - if (edgeVersion >= 15025) { - this.localStreams.push(stream); - stream.getTracks().forEach(function(track) { - self.addTrack(track, stream); - }); - } else { - // Clone is necessary for local demos mostly, attaching directly - // to two different senders does not work (build 10547). - // Fixed in 15025 (or earlier) - var clonedStream = stream.clone(); - stream.getTracks().forEach(function(track, idx) { - var clonedTrack = clonedStream.getTracks()[idx]; - track.addEventListener('enabled', function(event) { - clonedTrack.enabled = event.enabled; - }); - }); - clonedStream.getTracks().forEach(function(track) { - self.addTrack(track, clonedStream); - }); - this.localStreams.push(clonedStream); - } - this._maybeFireNegotiationNeeded(); - }; - - RTCPeerConnection.prototype.removeStream = function(stream) { - var idx = this.localStreams.indexOf(stream); - if (idx > -1) { - this.localStreams.splice(idx, 1); - this._maybeFireNegotiationNeeded(); - } - }; - - RTCPeerConnection.prototype.getSenders = function() { - return this.transceivers.filter(function(transceiver) { - return !!transceiver.rtpSender; - }) - .map(function(transceiver) { - return transceiver.rtpSender; - }); - }; - - RTCPeerConnection.prototype.getReceivers = function() { - return this.transceivers.filter(function(transceiver) { - return !!transceiver.rtpReceiver; - }) - .map(function(transceiver) { - return transceiver.rtpReceiver; - }); - }; - - // Create ICE gatherer and hook it up. - RTCPeerConnection.prototype._createIceGatherer = function(mid, - sdpMLineIndex) { - var self = this; - var iceGatherer = new window.RTCIceGatherer(self.iceOptions); - iceGatherer.onlocalcandidate = function(evt) { - var event = new Event('icecandidate'); - event.candidate = {sdpMid: mid, sdpMLineIndex: sdpMLineIndex}; - - var cand = evt.candidate; - var end = !cand || Object.keys(cand).length === 0; - // Edge emits an empty object for RTCIceCandidateComplete‥ - if (end) { - // polyfill since RTCIceGatherer.state is not implemented in - // Edge 10547 yet. - if (iceGatherer.state === undefined) { - iceGatherer.state = 'completed'; - } - } else { - // RTCIceCandidate doesn't have a component, needs to be added - cand.component = 1; - event.candidate.candidate = SDPUtils.writeCandidate(cand); - } - - // update local description. - var sections = SDPUtils.splitSections(self.localDescription.sdp); - if (!end) { - sections[event.candidate.sdpMLineIndex + 1] += - 'a=' + event.candidate.candidate + '\r\n'; - } else { - sections[event.candidate.sdpMLineIndex + 1] += - 'a=end-of-candidates\r\n'; - } - self.localDescription.sdp = sections.join(''); - var transceivers = self._pendingOffer ? self._pendingOffer : - self.transceivers; - var complete = transceivers.every(function(transceiver) { - return transceiver.iceGatherer && - transceiver.iceGatherer.state === 'completed'; - }); - - // Emit candidate if localDescription is set. - // Also emits null candidate when all gatherers are complete. - switch (self.iceGatheringState) { - case 'new': - if (!end) { - self._localIceCandidatesBuffer.push(event); - } - if (end && complete) { - self._localIceCandidatesBuffer.push( - new Event('icecandidate')); - } - break; - case 'gathering': - self._emitBufferedCandidates(); - if (!end) { - self.dispatchEvent(event); - if (self.onicecandidate !== null) { - self.onicecandidate(event); - } - } - if (complete) { - self.dispatchEvent(new Event('icecandidate')); - if (self.onicecandidate !== null) { - self.onicecandidate(new Event('icecandidate')); - } - self.iceGatheringState = 'complete'; - self._emitGatheringStateChange(); - } - break; - case 'complete': - // should not happen... currently! - break; - default: // no-op. - break; - } - }; - return iceGatherer; - }; - - // Create ICE transport and DTLS transport. - RTCPeerConnection.prototype._createIceAndDtlsTransports = function() { - var self = this; - var iceTransport = new window.RTCIceTransport(null); - iceTransport.onicestatechange = function() { - self._updateConnectionState(); - }; - - var dtlsTransport = new window.RTCDtlsTransport(iceTransport); - dtlsTransport.ondtlsstatechange = function() { - self._updateConnectionState(); - }; - dtlsTransport.onerror = function() { - // onerror does not set state to failed by itself. - Object.defineProperty(dtlsTransport, 'state', - {value: 'failed', writable: true}); - self._updateConnectionState(); - }; - - return { - iceTransport: iceTransport, - dtlsTransport: dtlsTransport - }; - }; - - // Destroy ICE gatherer, ICE transport and DTLS transport. - // Without triggering the callbacks. - RTCPeerConnection.prototype._disposeIceAndDtlsTransports = function( - sdpMLineIndex) { - var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer; - if (iceGatherer) { - delete iceGatherer.onlocalcandidate; - delete this.transceivers[sdpMLineIndex].iceGatherer; - } - var iceTransport = this.transceivers[sdpMLineIndex].iceTransport; - if (iceTransport) { - delete iceTransport.onicestatechange; - delete this.transceivers[sdpMLineIndex].iceTransport; - } - var dtlsTransport = this.transceivers[sdpMLineIndex].dtlsTransport; - if (dtlsTransport) { - delete dtlsTransport.ondtlssttatechange; - delete dtlsTransport.onerror; - delete this.transceivers[sdpMLineIndex].dtlsTransport; - } - }; - - // Start the RTP Sender and Receiver for a transceiver. - RTCPeerConnection.prototype._transceive = function(transceiver, - send, recv) { - var params = getCommonCapabilities(transceiver.localCapabilities, - transceiver.remoteCapabilities); - if (send && transceiver.rtpSender) { - params.encodings = transceiver.sendEncodingParameters; - params.rtcp = { - cname: SDPUtils.localCName, - compound: transceiver.rtcpParameters.compound - }; - if (transceiver.recvEncodingParameters.length) { - params.rtcp.ssrc = transceiver.recvEncodingParameters[0].ssrc; - } - transceiver.rtpSender.send(params); - } - if (recv && transceiver.rtpReceiver) { - // remove RTX field in Edge 14942 - if (transceiver.kind === 'video' - && transceiver.recvEncodingParameters - && edgeVersion < 15019) { - transceiver.recvEncodingParameters.forEach(function(p) { - delete p.rtx; - }); - } - params.encodings = transceiver.recvEncodingParameters; - params.rtcp = { - cname: transceiver.rtcpParameters.cname, - compound: transceiver.rtcpParameters.compound - }; - if (transceiver.sendEncodingParameters.length) { - params.rtcp.ssrc = transceiver.sendEncodingParameters[0].ssrc; - } - transceiver.rtpReceiver.receive(params); - } - }; - - RTCPeerConnection.prototype.setLocalDescription = function(description) { - var self = this; - - if (!isActionAllowedInSignalingState('setLocalDescription', - description.type, this.signalingState)) { - var e = new Error('Can not set local ' + description.type + - ' in state ' + this.signalingState); - e.name = 'InvalidStateError'; - if (arguments.length > 2 && typeof arguments[2] === 'function') { - window.setTimeout(arguments[2], 0, e); - } - return Promise.reject(e); - } - - var sections; - var sessionpart; - if (description.type === 'offer') { - // FIXME: What was the purpose of this empty if statement? - // if (!this._pendingOffer) { - // } else { - if (this._pendingOffer) { - // VERY limited support for SDP munging. Limited to: - // * changing the order of codecs - sections = SDPUtils.splitSections(description.sdp); - sessionpart = sections.shift(); - sections.forEach(function(mediaSection, sdpMLineIndex) { - var caps = SDPUtils.parseRtpParameters(mediaSection); - self._pendingOffer[sdpMLineIndex].localCapabilities = caps; - }); - this.transceivers = this._pendingOffer; - delete this._pendingOffer; - } - } else if (description.type === 'answer') { - sections = SDPUtils.splitSections(self.remoteDescription.sdp); - sessionpart = sections.shift(); - var isIceLite = SDPUtils.matchPrefix(sessionpart, - 'a=ice-lite').length > 0; - sections.forEach(function(mediaSection, sdpMLineIndex) { - var transceiver = self.transceivers[sdpMLineIndex]; - var iceGatherer = transceiver.iceGatherer; - var iceTransport = transceiver.iceTransport; - var dtlsTransport = transceiver.dtlsTransport; - var localCapabilities = transceiver.localCapabilities; - var remoteCapabilities = transceiver.remoteCapabilities; - - var rejected = SDPUtils.isRejected(mediaSection); - - if (!rejected && !transceiver.isDatachannel) { - var remoteIceParameters = SDPUtils.getIceParameters( - mediaSection, sessionpart); - var remoteDtlsParameters = SDPUtils.getDtlsParameters( - mediaSection, sessionpart); - if (isIceLite) { - remoteDtlsParameters.role = 'server'; - } - - if (!self.usingBundle || sdpMLineIndex === 0) { - iceTransport.start(iceGatherer, remoteIceParameters, - isIceLite ? 'controlling' : 'controlled'); - dtlsTransport.start(remoteDtlsParameters); - } - - // Calculate intersection of capabilities. - var params = getCommonCapabilities(localCapabilities, - remoteCapabilities); - - // Start the RTCRtpSender. The RTCRtpReceiver for this - // transceiver has already been started in setRemoteDescription. - self._transceive(transceiver, - params.codecs.length > 0, - false); - } - }); - } - - this.localDescription = { - type: description.type, - sdp: description.sdp - }; - switch (description.type) { - case 'offer': - this._updateSignalingState('have-local-offer'); - break; - case 'answer': - this._updateSignalingState('stable'); - break; - default: - throw new TypeError('unsupported type "' + description.type + - '"'); - } - - // If a success callback was provided, emit ICE candidates after it - // has been executed. Otherwise, emit callback after the Promise is - // resolved. - var hasCallback = arguments.length > 1 && - typeof arguments[1] === 'function'; - if (hasCallback) { - var cb = arguments[1]; - window.setTimeout(function() { - cb(); - if (self.iceGatheringState === 'new') { - self.iceGatheringState = 'gathering'; - self._emitGatheringStateChange(); - } - self._emitBufferedCandidates(); - }, 0); - } - var p = Promise.resolve(); - p.then(function() { - if (!hasCallback) { - if (self.iceGatheringState === 'new') { - self.iceGatheringState = 'gathering'; - self._emitGatheringStateChange(); - } - // Usually candidates will be emitted earlier. - window.setTimeout(self._emitBufferedCandidates.bind(self), 500); - } - }); - return p; - }; - - RTCPeerConnection.prototype.setRemoteDescription = function(description) { - var self = this; - - if (!isActionAllowedInSignalingState('setRemoteDescription', - description.type, this.signalingState)) { - var e = new Error('Can not set remote ' + description.type + - ' in state ' + this.signalingState); - e.name = 'InvalidStateError'; - if (arguments.length > 2 && typeof arguments[2] === 'function') { - window.setTimeout(arguments[2], 0, e); - } - return Promise.reject(e); - } - - var streams = {}; - var receiverList = []; - var sections = SDPUtils.splitSections(description.sdp); - var sessionpart = sections.shift(); - var isIceLite = SDPUtils.matchPrefix(sessionpart, - 'a=ice-lite').length > 0; - var usingBundle = SDPUtils.matchPrefix(sessionpart, - 'a=group:BUNDLE ').length > 0; - this.usingBundle = usingBundle; - var iceOptions = SDPUtils.matchPrefix(sessionpart, - 'a=ice-options:')[0]; - if (iceOptions) { - this.canTrickleIceCandidates = iceOptions.substr(14).split(' ') - .indexOf('trickle') >= 0; - } else { - this.canTrickleIceCandidates = false; - } - - sections.forEach(function(mediaSection, sdpMLineIndex) { - var lines = SDPUtils.splitLines(mediaSection); - var kind = SDPUtils.getKind(mediaSection); - var rejected = SDPUtils.isRejected(mediaSection); - var protocol = lines[0].substr(2).split(' ')[2]; - - var direction = SDPUtils.getDirection(mediaSection, sessionpart); - var remoteMsid = SDPUtils.parseMsid(mediaSection); - - var mid = SDPUtils.getMid(mediaSection) || SDPUtils.generateIdentifier(); - - // Reject datachannels which are not implemented yet. - if (kind === 'application' && protocol === 'DTLS/SCTP') { - self.transceivers[sdpMLineIndex] = { - mid: mid, - isDatachannel: true - }; - return; - } - - var transceiver; - var iceGatherer; - var iceTransport; - var dtlsTransport; - var rtpReceiver; - var sendEncodingParameters; - var recvEncodingParameters; - var localCapabilities; - - var track; - // FIXME: ensure the mediaSection has rtcp-mux set. - var remoteCapabilities = SDPUtils.parseRtpParameters(mediaSection); - var remoteIceParameters; - var remoteDtlsParameters; - if (!rejected) { - remoteIceParameters = SDPUtils.getIceParameters(mediaSection, - sessionpart); - remoteDtlsParameters = SDPUtils.getDtlsParameters(mediaSection, - sessionpart); - remoteDtlsParameters.role = 'client'; - } - recvEncodingParameters = - SDPUtils.parseRtpEncodingParameters(mediaSection); - - var rtcpParameters = SDPUtils.parseRtcpParameters(mediaSection); - - var isComplete = SDPUtils.matchPrefix(mediaSection, - 'a=end-of-candidates', sessionpart).length > 0; - var cands = SDPUtils.matchPrefix(mediaSection, 'a=candidate:') - .map(function(cand) { - return SDPUtils.parseCandidate(cand); - }) - .filter(function(cand) { - return cand.component === '1' || cand.component === 1; - }); - - // Check if we can use BUNDLE and dispose transports. - if ((description.type === 'offer' || description.type === 'answer') && - !rejected && usingBundle && sdpMLineIndex > 0 && - self.transceivers[sdpMLineIndex]) { - self._disposeIceAndDtlsTransports(sdpMLineIndex); - self.transceivers[sdpMLineIndex].iceGatherer = - self.transceivers[0].iceGatherer; - self.transceivers[sdpMLineIndex].iceTransport = - self.transceivers[0].iceTransport; - self.transceivers[sdpMLineIndex].dtlsTransport = - self.transceivers[0].dtlsTransport; - if (self.transceivers[sdpMLineIndex].rtpSender) { - self.transceivers[sdpMLineIndex].rtpSender.setTransport( - self.transceivers[0].dtlsTransport); - } - if (self.transceivers[sdpMLineIndex].rtpReceiver) { - self.transceivers[sdpMLineIndex].rtpReceiver.setTransport( - self.transceivers[0].dtlsTransport); - } - } - if (description.type === 'offer' && !rejected) { - transceiver = self.transceivers[sdpMLineIndex] || - self._createTransceiver(kind); - transceiver.mid = mid; - - if (!transceiver.iceGatherer) { - transceiver.iceGatherer = usingBundle && sdpMLineIndex > 0 ? - self.transceivers[0].iceGatherer : - self._createIceGatherer(mid, sdpMLineIndex); - } - - if (isComplete && (!usingBundle || sdpMLineIndex === 0)) { - transceiver.iceTransport.setRemoteCandidates(cands); - } - - localCapabilities = window.RTCRtpReceiver.getCapabilities(kind); - - // filter RTX until additional stuff needed for RTX is implemented - // in adapter.js - if (edgeVersion < 15019) { - localCapabilities.codecs = localCapabilities.codecs.filter( - function(codec) { - return codec.name !== 'rtx'; - }); - } - - sendEncodingParameters = [{ - ssrc: (2 * sdpMLineIndex + 2) * 1001 - }]; - - if (direction === 'sendrecv' || direction === 'sendonly') { - rtpReceiver = new window.RTCRtpReceiver(transceiver.dtlsTransport, - kind); - - track = rtpReceiver.track; - // FIXME: does not work with Plan B. - if (remoteMsid) { - if (!streams[remoteMsid.stream]) { - streams[remoteMsid.stream] = new window.MediaStream(); - Object.defineProperty(streams[remoteMsid.stream], 'id', { - get: function() { - return remoteMsid.stream; - } - }); - } - Object.defineProperty(track, 'id', { - get: function() { - return remoteMsid.track; - } - }); - streams[remoteMsid.stream].addTrack(track); - receiverList.push([track, rtpReceiver, - streams[remoteMsid.stream]]); - } else { - if (!streams.default) { - streams.default = new window.MediaStream(); - } - streams.default.addTrack(track); - receiverList.push([track, rtpReceiver, streams.default]); - } - } - - transceiver.localCapabilities = localCapabilities; - transceiver.remoteCapabilities = remoteCapabilities; - transceiver.rtpReceiver = rtpReceiver; - transceiver.rtcpParameters = rtcpParameters; - transceiver.sendEncodingParameters = sendEncodingParameters; - transceiver.recvEncodingParameters = recvEncodingParameters; - - // Start the RTCRtpReceiver now. The RTPSender is started in - // setLocalDescription. - self._transceive(self.transceivers[sdpMLineIndex], - false, - direction === 'sendrecv' || direction === 'sendonly'); - } else if (description.type === 'answer' && !rejected) { - transceiver = self.transceivers[sdpMLineIndex]; - iceGatherer = transceiver.iceGatherer; - iceTransport = transceiver.iceTransport; - dtlsTransport = transceiver.dtlsTransport; - rtpReceiver = transceiver.rtpReceiver; - sendEncodingParameters = transceiver.sendEncodingParameters; - localCapabilities = transceiver.localCapabilities; - - self.transceivers[sdpMLineIndex].recvEncodingParameters = - recvEncodingParameters; - self.transceivers[sdpMLineIndex].remoteCapabilities = - remoteCapabilities; - self.transceivers[sdpMLineIndex].rtcpParameters = rtcpParameters; - - if ((isIceLite || isComplete) && cands.length) { - iceTransport.setRemoteCandidates(cands); - } - if (!usingBundle || sdpMLineIndex === 0) { - iceTransport.start(iceGatherer, remoteIceParameters, - 'controlling'); - dtlsTransport.start(remoteDtlsParameters); - } - - self._transceive(transceiver, - direction === 'sendrecv' || direction === 'recvonly', - direction === 'sendrecv' || direction === 'sendonly'); - - if (rtpReceiver && - (direction === 'sendrecv' || direction === 'sendonly')) { - track = rtpReceiver.track; - if (remoteMsid) { - if (!streams[remoteMsid.stream]) { - streams[remoteMsid.stream] = new window.MediaStream(); - } - streams[remoteMsid.stream].addTrack(track); - receiverList.push([track, rtpReceiver, streams[remoteMsid.stream]]); - } else { - if (!streams.default) { - streams.default = new window.MediaStream(); - } - streams.default.addTrack(track); - receiverList.push([track, rtpReceiver, streams.default]); - } - } else { - // FIXME: actually the receiver should be created later. - delete transceiver.rtpReceiver; - } - } - }); - - this.remoteDescription = { - type: description.type, - sdp: description.sdp - }; - switch (description.type) { - case 'offer': - this._updateSignalingState('have-remote-offer'); - break; - case 'answer': - this._updateSignalingState('stable'); - break; - default: - throw new TypeError('unsupported type "' + description.type + - '"'); - } - Object.keys(streams).forEach(function(sid) { - var stream = streams[sid]; - if (stream.getTracks().length) { - self.remoteStreams.push(stream); - var event = new Event('addstream'); - event.stream = stream; - self.dispatchEvent(event); - if (self.onaddstream !== null) { - window.setTimeout(function() { - self.onaddstream(event); - }, 0); - } - - receiverList.forEach(function(item) { - var track = item[0]; - var receiver = item[1]; - if (stream.id !== item[2].id) { - return; - } - var trackEvent = new Event('track'); - trackEvent.track = track; - trackEvent.receiver = receiver; - trackEvent.streams = [stream]; - self.dispatchEvent(trackEvent); - if (self.ontrack !== null) { - window.setTimeout(function() { - self.ontrack(trackEvent); - }, 0); - } - }); - } - }); - - // check whether addIceCandidate({}) was called within four seconds after - // setRemoteDescription. - window.setTimeout(function() { - if (!(self && self.transceivers)) { - return; - } - self.transceivers.forEach(function(transceiver) { - if (transceiver.iceTransport && - transceiver.iceTransport.state === 'new' && - transceiver.iceTransport.getRemoteCandidates().length > 0) { - console.warn('Timeout for addRemoteCandidate. Consider sending ' + - 'an end-of-candidates notification'); - transceiver.iceTransport.addRemoteCandidate({}); - } - }); - }, 4000); - - if (arguments.length > 1 && typeof arguments[1] === 'function') { - window.setTimeout(arguments[1], 0); - } - return Promise.resolve(); - }; - - RTCPeerConnection.prototype.close = function() { - this.transceivers.forEach(function(transceiver) { - /* not yet - if (transceiver.iceGatherer) { - transceiver.iceGatherer.close(); - } - */ - if (transceiver.iceTransport) { - transceiver.iceTransport.stop(); - } - if (transceiver.dtlsTransport) { - transceiver.dtlsTransport.stop(); - } - if (transceiver.rtpSender) { - transceiver.rtpSender.stop(); - } - if (transceiver.rtpReceiver) { - transceiver.rtpReceiver.stop(); - } - }); - // FIXME: clean up tracks, local streams, remote streams, etc - this._updateSignalingState('closed'); - }; - - // Update the signaling state. - RTCPeerConnection.prototype._updateSignalingState = function(newState) { - this.signalingState = newState; - var event = new Event('signalingstatechange'); - this.dispatchEvent(event); - if (this.onsignalingstatechange !== null) { - this.onsignalingstatechange(event); - } - }; - - // Determine whether to fire the negotiationneeded event. - RTCPeerConnection.prototype._maybeFireNegotiationNeeded = function() { - var self = this; - if (this.signalingState !== 'stable' || this.needNegotiation === true) { - return; - } - this.needNegotiation = true; - window.setTimeout(function() { - if (self.needNegotiation === false) { - return; - } - self.needNegotiation = false; - var event = new Event('negotiationneeded'); - self.dispatchEvent(event); - if (self.onnegotiationneeded !== null) { - self.onnegotiationneeded(event); - } - }, 0); - }; - - // Update the connection state. - RTCPeerConnection.prototype._updateConnectionState = function() { - var self = this; - var newState; - var states = { - 'new': 0, - closed: 0, - connecting: 0, - checking: 0, - connected: 0, - completed: 0, - disconnected: 0, - failed: 0 - }; - this.transceivers.forEach(function(transceiver) { - states[transceiver.iceTransport.state]++; - states[transceiver.dtlsTransport.state]++; - }); - // ICETransport.completed and connected are the same for this purpose. - states.connected += states.completed; - - newState = 'new'; - if (states.failed > 0) { - newState = 'failed'; - } else if (states.connecting > 0 || states.checking > 0) { - newState = 'connecting'; - } else if (states.disconnected > 0) { - newState = 'disconnected'; - } else if (states.new > 0) { - newState = 'new'; - } else if (states.connected > 0 || states.completed > 0) { - newState = 'connected'; - } - - if (newState !== self.iceConnectionState) { - self.iceConnectionState = newState; - var event = new Event('iceconnectionstatechange'); - this.dispatchEvent(event); - if (this.oniceconnectionstatechange !== null) { - this.oniceconnectionstatechange(event); - } - } - }; - - RTCPeerConnection.prototype.createOffer = function() { - var self = this; - if (this._pendingOffer) { - throw new Error('createOffer called while there is a pending offer.'); - } - var offerOptions; - if (arguments.length === 1 && typeof arguments[0] !== 'function') { - offerOptions = arguments[0]; - } else if (arguments.length === 3) { - offerOptions = arguments[2]; - } - - var numAudioTracks = this.transceivers.filter(function(t) { - return t.kind === 'audio'; - }).length; - var numVideoTracks = this.transceivers.filter(function(t) { - return t.kind === 'video'; - }).length; - - // Determine number of audio and video tracks we need to send/recv. - if (offerOptions) { - // Reject Chrome legacy constraints. - if (offerOptions.mandatory || offerOptions.optional) { - throw new TypeError( - 'Legacy mandatory/optional constraints not supported.'); - } - if (offerOptions.offerToReceiveAudio !== undefined) { - if (offerOptions.offerToReceiveAudio === true) { - numAudioTracks = 1; - } else if (offerOptions.offerToReceiveAudio === false) { - numAudioTracks = 0; - } else { - numAudioTracks = offerOptions.offerToReceiveAudio; - } - } - if (offerOptions.offerToReceiveVideo !== undefined) { - if (offerOptions.offerToReceiveVideo === true) { - numVideoTracks = 1; - } else if (offerOptions.offerToReceiveVideo === false) { - numVideoTracks = 0; - } else { - numVideoTracks = offerOptions.offerToReceiveVideo; - } - } - } - - this.transceivers.forEach(function(transceiver) { - if (transceiver.kind === 'audio') { - numAudioTracks--; - if (numAudioTracks < 0) { - transceiver.wantReceive = false; - } - } else if (transceiver.kind === 'video') { - numVideoTracks--; - if (numVideoTracks < 0) { - transceiver.wantReceive = false; - } - } - }); - - // Create M-lines for recvonly streams. - while (numAudioTracks > 0 || numVideoTracks > 0) { - if (numAudioTracks > 0) { - this._createTransceiver('audio'); - numAudioTracks--; - } - if (numVideoTracks > 0) { - this._createTransceiver('video'); - numVideoTracks--; - } - } - // reorder tracks - var transceivers = sortTracks(this.transceivers); - - var sdp = SDPUtils.writeSessionBoilerplate(this._sdpSessionId); - transceivers.forEach(function(transceiver, sdpMLineIndex) { - // For each track, create an ice gatherer, ice transport, - // dtls transport, potentially rtpsender and rtpreceiver. - var track = transceiver.track; - var kind = transceiver.kind; - var mid = SDPUtils.generateIdentifier(); - transceiver.mid = mid; - - if (!transceiver.iceGatherer) { - transceiver.iceGatherer = self.usingBundle && sdpMLineIndex > 0 ? - transceivers[0].iceGatherer : - self._createIceGatherer(mid, sdpMLineIndex); - } - - var localCapabilities = window.RTCRtpSender.getCapabilities(kind); - // filter RTX until additional stuff needed for RTX is implemented - // in adapter.js - if (edgeVersion < 15019) { - localCapabilities.codecs = localCapabilities.codecs.filter( - function(codec) { - return codec.name !== 'rtx'; - }); - } - localCapabilities.codecs.forEach(function(codec) { - // work around https://bugs.chromium.org/p/webrtc/issues/detail?id=6552 - // by adding level-asymmetry-allowed=1 - if (codec.name === 'H264' && - codec.parameters['level-asymmetry-allowed'] === undefined) { - codec.parameters['level-asymmetry-allowed'] = '1'; - } - }); - - // generate an ssrc now, to be used later in rtpSender.send - var sendEncodingParameters = [{ - ssrc: (2 * sdpMLineIndex + 1) * 1001 - }]; - if (track) { - // add RTX - if (edgeVersion >= 15019 && kind === 'video') { - sendEncodingParameters[0].rtx = { - ssrc: (2 * sdpMLineIndex + 1) * 1001 + 1 - }; - } - } - - if (transceiver.wantReceive) { - transceiver.rtpReceiver = new window.RTCRtpReceiver( - transceiver.dtlsTransport, - kind - ); - } - - transceiver.localCapabilities = localCapabilities; - transceiver.sendEncodingParameters = sendEncodingParameters; - }); - - // always offer BUNDLE and dispose on return if not supported. - if (this._config.bundlePolicy !== 'max-compat') { - sdp += 'a=group:BUNDLE ' + transceivers.map(function(t) { - return t.mid; - }).join(' ') + '\r\n'; - } - sdp += 'a=ice-options:trickle\r\n'; - - transceivers.forEach(function(transceiver, sdpMLineIndex) { - sdp += SDPUtils.writeMediaSection(transceiver, - transceiver.localCapabilities, 'offer', transceiver.stream); - sdp += 'a=rtcp-rsize\r\n'; - }); - - this._pendingOffer = transceivers; - var desc = new window.RTCSessionDescription({ - type: 'offer', - sdp: sdp - }); - if (arguments.length && typeof arguments[0] === 'function') { - window.setTimeout(arguments[0], 0, desc); - } - return Promise.resolve(desc); - }; - - RTCPeerConnection.prototype.createAnswer = function() { - var sdp = SDPUtils.writeSessionBoilerplate(this._sdpSessionId); - if (this.usingBundle) { - sdp += 'a=group:BUNDLE ' + this.transceivers.map(function(t) { - return t.mid; - }).join(' ') + '\r\n'; - } - this.transceivers.forEach(function(transceiver, sdpMLineIndex) { - if (transceiver.isDatachannel) { - sdp += 'm=application 0 DTLS/SCTP 5000\r\n' + - 'c=IN IP4 0.0.0.0\r\n' + - 'a=mid:' + transceiver.mid + '\r\n'; - return; - } - - // FIXME: look at direction. - if (transceiver.stream) { - var localTrack; - if (transceiver.kind === 'audio') { - localTrack = transceiver.stream.getAudioTracks()[0]; - } else if (transceiver.kind === 'video') { - localTrack = transceiver.stream.getVideoTracks()[0]; - } - if (localTrack) { - // add RTX - if (edgeVersion >= 15019 && transceiver.kind === 'video') { - transceiver.sendEncodingParameters[0].rtx = { - ssrc: (2 * sdpMLineIndex + 2) * 1001 + 1 - }; - } - } - } - - // Calculate intersection of capabilities. - var commonCapabilities = getCommonCapabilities( - transceiver.localCapabilities, - transceiver.remoteCapabilities); - - var hasRtx = commonCapabilities.codecs.filter(function(c) { - return c.name.toLowerCase() === 'rtx'; - }).length; - if (!hasRtx && transceiver.sendEncodingParameters[0].rtx) { - delete transceiver.sendEncodingParameters[0].rtx; - } - - sdp += SDPUtils.writeMediaSection(transceiver, commonCapabilities, - 'answer', transceiver.stream); - if (transceiver.rtcpParameters && - transceiver.rtcpParameters.reducedSize) { - sdp += 'a=rtcp-rsize\r\n'; - } - }); - - var desc = new window.RTCSessionDescription({ - type: 'answer', - sdp: sdp - }); - if (arguments.length && typeof arguments[0] === 'function') { - window.setTimeout(arguments[0], 0, desc); - } - return Promise.resolve(desc); - }; - - RTCPeerConnection.prototype.addIceCandidate = function(candidate) { - if (!candidate) { - for (var j = 0; j < this.transceivers.length; j++) { - this.transceivers[j].iceTransport.addRemoteCandidate({}); - if (this.usingBundle) { - return Promise.resolve(); - } - } - } else { - var mLineIndex = candidate.sdpMLineIndex; - if (candidate.sdpMid) { - for (var i = 0; i < this.transceivers.length; i++) { - if (this.transceivers[i].mid === candidate.sdpMid) { - mLineIndex = i; - break; - } - } - } - var transceiver = this.transceivers[mLineIndex]; - if (transceiver) { - var cand = Object.keys(candidate.candidate).length > 0 ? - SDPUtils.parseCandidate(candidate.candidate) : {}; - // Ignore Chrome's invalid candidates since Edge does not like them. - if (cand.protocol === 'tcp' && (cand.port === 0 || cand.port === 9)) { - return Promise.resolve(); - } - // Ignore RTCP candidates, we assume RTCP-MUX. - if (cand.component && - !(cand.component === '1' || cand.component === 1)) { - return Promise.resolve(); - } - transceiver.iceTransport.addRemoteCandidate(cand); - - // update the remoteDescription. - var sections = SDPUtils.splitSections(this.remoteDescription.sdp); - sections[mLineIndex + 1] += (cand.type ? candidate.candidate.trim() - : 'a=end-of-candidates') + '\r\n'; - this.remoteDescription.sdp = sections.join(''); - } - } - if (arguments.length > 1 && typeof arguments[1] === 'function') { - window.setTimeout(arguments[1], 0); - } - return Promise.resolve(); - }; - - RTCPeerConnection.prototype.getStats = function() { - var promises = []; - this.transceivers.forEach(function(transceiver) { - ['rtpSender', 'rtpReceiver', 'iceGatherer', 'iceTransport', - 'dtlsTransport'].forEach(function(method) { - if (transceiver[method]) { - promises.push(transceiver[method].getStats()); - } - }); - }); - var cb = arguments.length > 1 && typeof arguments[1] === 'function' && - arguments[1]; - var fixStatsType = function(stat) { - return { - inboundrtp: 'inbound-rtp', - outboundrtp: 'outbound-rtp', - candidatepair: 'candidate-pair', - localcandidate: 'local-candidate', - remotecandidate: 'remote-candidate' - }[stat.type] || stat.type; - }; - return new Promise(function(resolve) { - // shim getStats with maplike support - var results = new Map(); - Promise.all(promises).then(function(res) { - res.forEach(function(result) { - Object.keys(result).forEach(function(id) { - result[id].type = fixStatsType(result[id]); - results.set(id, result[id]); - }); - }); - if (cb) { - window.setTimeout(cb, 0, results); - } - resolve(results); - }); - }); - }; - return RTCPeerConnection; -}; - -},{"sdp":1}],9:[function(require,module,exports){ +},{}],10:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -2975,6 +3603,7 @@ var firefoxShim = { var event = new Event('track'); event.track = track; event.receiver = {track: track}; + event.transceiver = {receiver: event.receiver}; event.streams = [e.stream]; this.dispatchEvent(event); }.bind(this)); @@ -2982,6 +3611,15 @@ var firefoxShim = { } }); } + if (typeof window === 'object' && window.RTCTrackEvent && + ('receiver' in window.RTCTrackEvent.prototype) && + !('transceiver' in window.RTCTrackEvent.prototype)) { + Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', { + get: function() { + return {receiver: this.receiver}; + } + }); + } }, shimSourceObject: function(window) { @@ -3132,6 +3770,22 @@ var firefoxShim = { }) .then(onSucc, onErr); }; + }, + + shimRemoveStream: function(window) { + if (!window.RTCPeerConnection || + 'removeStream' in window.RTCPeerConnection.prototype) { + return; + } + window.RTCPeerConnection.prototype.removeStream = function(stream) { + var pc = this; + utils.deprecated('removeStream', 'removeTrack'); + this.getSenders().forEach(function(sender) { + if (sender.track && stream.getTracks().indexOf(sender.track) !== -1) { + pc.removeTrack(sender); + } + }); + }; } }; @@ -3140,10 +3794,11 @@ module.exports = { shimOnTrack: firefoxShim.shimOnTrack, shimSourceObject: firefoxShim.shimSourceObject, shimPeerConnection: firefoxShim.shimPeerConnection, + shimRemoveStream: firefoxShim.shimRemoveStream, shimGetUserMedia: require('./getusermedia') }; -},{"../utils":12,"./getusermedia":10}],10:[function(require,module,exports){ +},{"../utils":13,"./getusermedia":11}],11:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -3348,13 +4003,13 @@ module.exports = function(window) { return getUserMedia_(constraints, onSuccess, onError); } // Replace Firefox 44+'s deprecation warning with unprefixed version. - console.warn('navigator.getUserMedia has been replaced by ' + - 'navigator.mediaDevices.getUserMedia'); + utils.deprecated('navigator.getUserMedia', + 'navigator.mediaDevices.getUserMedia'); navigator.mediaDevices.getUserMedia(constraints).then(onSuccess, onError); }; }; -},{"../utils":12}],11:[function(require,module,exports){ +},{"../utils":13}],12:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -3427,7 +4082,7 @@ var safariShim = { this._localStreams.push(stream); } } - _addTrack.call(this, track, stream); + return _addTrack.call(this, track, stream); }; } if (!('removeStream' in window.RTCPeerConnection.prototype)) { @@ -3588,11 +4243,66 @@ var safariShim = { }; window.RTCPeerConnection.prototype = OrigPeerConnection.prototype; // wrap static methods. Currently just generateCertificate. - Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', { - get: function() { - return OrigPeerConnection.generateCertificate; + if ('generateCertificate' in window.RTCPeerConnection) { + Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', { + get: function() { + return OrigPeerConnection.generateCertificate; + } + }); + } + }, + shimTrackEventTransceiver: function(window) { + // Add event.transceiver member over deprecated event.receiver + if (typeof window === 'object' && window.RTCPeerConnection && + ('receiver' in window.RTCTrackEvent.prototype) && + // can't check 'transceiver' in window.RTCTrackEvent.prototype, as it is + // defined for some reason even when window.RTCTransceiver is not. + !window.RTCTransceiver) { + Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', { + get: function() { + return {receiver: this.receiver}; + } + }); + } + }, + + shimCreateOfferLegacy: function(window) { + var origCreateOffer = window.RTCPeerConnection.prototype.createOffer; + window.RTCPeerConnection.prototype.createOffer = function(offerOptions) { + var pc = this; + if (offerOptions) { + var audioTransceiver = pc.getTransceivers().find(function(transceiver) { + return transceiver.sender.track && + transceiver.sender.track.kind === 'audio'; + }); + if (offerOptions.offerToReceiveAudio === false && audioTransceiver) { + if (audioTransceiver.direction === 'sendrecv') { + audioTransceiver.setDirection('sendonly'); + } else if (audioTransceiver.direction === 'recvonly') { + audioTransceiver.setDirection('inactive'); + } + } else if (offerOptions.offerToReceiveAudio === true && + !audioTransceiver) { + pc.addTransceiver('audio'); + } + + var videoTransceiver = pc.getTransceivers().find(function(transceiver) { + return transceiver.sender.track && + transceiver.sender.track.kind === 'video'; + }); + if (offerOptions.offerToReceiveVideo === false && videoTransceiver) { + if (videoTransceiver.direction === 'sendrecv') { + videoTransceiver.setDirection('sendonly'); + } else if (videoTransceiver.direction === 'recvonly') { + videoTransceiver.setDirection('inactive'); + } + } else if (offerOptions.offerToReceiveVideo === true && + !videoTransceiver) { + pc.addTransceiver('video'); + } } - }); + return origCreateOffer.apply(pc, arguments); + }; } }; @@ -3602,12 +4312,14 @@ module.exports = { shimLocalStreamsAPI: safariShim.shimLocalStreamsAPI, shimRemoteStreamsAPI: safariShim.shimRemoteStreamsAPI, shimGetUserMedia: safariShim.shimGetUserMedia, - shimRTCIceServerUrls: safariShim.shimRTCIceServerUrls + shimRTCIceServerUrls: safariShim.shimRTCIceServerUrls, + shimTrackEventTransceiver: safariShim.shimTrackEventTransceiver, + shimCreateOfferLegacy: safariShim.shimCreateOfferLegacy // TODO // shimPeerConnection: safariShim.shimPeerConnection }; -},{"../utils":12}],12:[function(require,module,exports){ +},{"../utils":13}],13:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * @@ -3742,57 +4454,6 @@ var utils = { return result; }, - // shimCreateObjectURL must be called before shimSourceObject to avoid loop. - - shimCreateObjectURL: function(window) { - var URL = window && window.URL; - - if (!(typeof window === 'object' && window.HTMLMediaElement && - 'srcObject' in window.HTMLMediaElement.prototype)) { - // Only shim CreateObjectURL using srcObject if srcObject exists. - return undefined; - } - - var nativeCreateObjectURL = URL.createObjectURL.bind(URL); - var nativeRevokeObjectURL = URL.revokeObjectURL.bind(URL); - var streams = new Map(), newId = 0; - - URL.createObjectURL = function(stream) { - if ('getTracks' in stream) { - var url = 'polyblob:' + (++newId); - streams.set(url, stream); - utils.deprecated('URL.createObjectURL(stream)', - 'elem.srcObject = stream'); - return url; - } - return nativeCreateObjectURL(stream); - }; - URL.revokeObjectURL = function(url) { - nativeRevokeObjectURL(url); - streams.delete(url); - }; - - var dsc = Object.getOwnPropertyDescriptor(window.HTMLMediaElement.prototype, - 'src'); - Object.defineProperty(window.HTMLMediaElement.prototype, 'src', { - get: function() { - return dsc.get.apply(this); - }, - set: function(url) { - this.srcObject = streams.get(url) || null; - return dsc.set.apply(this, [url]); - } - }); - - var nativeSetAttribute = window.HTMLMediaElement.prototype.setAttribute; - window.HTMLMediaElement.prototype.setAttribute = function() { - if (arguments.length === 2 && - ('' + arguments[0]).toLowerCase() === 'src') { - this.srcObject = streams.get(arguments[1]) || null; - } - return nativeSetAttribute.apply(this, arguments); - }; - } }; // Export. @@ -3806,5 +4467,5 @@ module.exports = { detectBrowser: utils.detectBrowser.bind(utils) }; -},{}]},{},[2])(2) +},{}]},{},[3])(3) }); \ No newline at end of file diff --git a/html5/verto/video_demo-live_canvas/js/verto-min.js b/html5/verto/video_demo-live_canvas/js/verto-min.js index c93b8aca64..fdf5432fa5 100644 --- a/html5/verto/video_demo-live_canvas/js/verto-min.js +++ b/html5/verto/video_demo-live_canvas/js/verto-min.js @@ -56,7 +56,7 @@ function onSuccess(stream){self.localStream=stream;if(screen){self.constraints.o self.peer=FSRTCPeerConnection({type:self.type,attachStream:self.localStream,onICE:function(candidate){return onICE(self,candidate);},onICEComplete:function(){return onICEComplete(self);},onRemoteStream:screen?function(stream){}:function(stream){return onRemoteStream(self,stream);},onOfferSDP:function(sdp){return onOfferSDP(self,sdp);},onICESDP:function(sdp){return onICESDP(self,sdp);},onChannelError:function(e){return onChannelError(self,e);},constraints:self.constraints,iceServers:self.options.iceServers,});onStreamSuccess(self,stream);} function onError(e){onStreamError(self,e);} var mediaParams=getMediaParams(self);console.log("Audio constraints",mediaParams.audio);console.log("Video constraints",mediaParams.video);if(mediaParams.audio||mediaParams.video){getUserMedia({constraints:{audio:mediaParams.audio,video:mediaParams.video},video:mediaParams.useVideo,onsuccess:onSuccess,onerror:onError});}else{onSuccess(null);}};function FSRTCPeerConnection(options){var gathering=false,done=false;var config={};var default_ice={urls:['stun:stun.l.google.com:19302']};if(options.iceServers){if(typeof(options.iceServers)==="boolean"){config.iceServers=[default_ice];}else{config.iceServers=options.iceServers;}} -var peer=new window.RTCPeerConnection(config);openOffererChannel();var x=0;function ice_handler(){done=true;gathering=null;if(options.onICEComplete){options.onICEComplete();} +config.bundlePolicy="max-compat";var peer=new window.RTCPeerConnection(config);openOffererChannel();var x=0;function ice_handler(){done=true;gathering=null;if(options.onICEComplete){options.onICEComplete();} if(options.type=="offer"){options.onICESDP(peer.localDescription);}else{if(!x&&options.onICESDP){options.onICESDP(peer.localDescription);}}} peer.onicecandidate=function(event){if(done){return;} if(!gathering){gathering=setTimeout(ice_handler,1000);} @@ -163,6 +163,7 @@ if(sendChannels.length){verto.sendMethod("verto.unsubscribe",{eventChannel:sendC verto.sendMethod("verto.broadcast",msg);};$.verto.prototype.purge=function(callID){var verto=this;var x=0;var i;for(i in verto.dialogs){if(!x){console.log("purging dialogs");} x++;verto.dialogs[i].setState($.verto.enum.state.purge);} for(i in verto.eventSUBS){if(verto.eventSUBS[i]){console.log("purging subscription: "+i);delete verto.eventSUBS[i];}}};$.verto.prototype.hangup=function(callID){var verto=this;if(callID){var dialog=verto.dialogs[callID];if(dialog){dialog.hangup();}}else{for(var i in verto.dialogs){verto.dialogs[i].hangup();}}};$.verto.prototype.newCall=function(args,callbacks){var verto=this;if(!verto.rpcClient.socketReady()){console.error("Not Connected...");return;} +if(args["useCamera"]){verto.options.deviceParams["useCamera"]=args["useCamera"];} var dialog=new $.verto.dialog($.verto.enum.direction.outbound,this,args);dialog.invite();if(callbacks){dialog.callbacks=callbacks;} return dialog;};$.verto.prototype.handleMessage=function(data){var verto=this;if(!(data&&data.method)){console.error("Invalid Data",data);return;} if(data.params.callID){var dialog=verto.dialogs[data.params.callID];if(data.method==="verto.attach"&&dialog){delete dialog.verto.dialogs[dialog.callID];dialog.rtc.stop();dialog=null;} @@ -306,8 +307,120 @@ navigator.getUserMedia({audio:(has_audio>0?true:false),video:(has_video>0?true:f navigator.mediaDevices.enumerateDevices().then(checkTypes).catch(handleError);};$.verto.refreshDevices=function(runtime){checkDevices(runtime);} $.verto.init=function(obj,runtime){if(!obj){obj={};} if(!obj.skipPermCheck&&!obj.skipDeviceCheck){$.FSRTC.checkPerms(function(status){checkDevices(runtime);},true,true);}else if(obj.skipPermCheck&&!obj.skipDeviceCheck){checkDevices(runtime);}else if(!obj.skipPermCheck&&obj.skipDeviceCheck){$.FSRTC.checkPerms(function(status){runtime(status);},true,true);}else{runtime(null);}} -$.verto.genUUID=function(){return generateGUID();}})(jQuery);(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.adapter=f()}})(function(){var define,module,exports;return(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0?'m='+part:part).trim()+'\r\n';});};SDPUtils.matchPrefix=function(blob,prefix){return SDPUtils.splitLines(blob).filter(function(line){return line.indexOf(prefix)===0;});};SDPUtils.parseCandidate=function(line){var parts;if(line.indexOf('a=candidate:')===0){parts=line.substring(12).split(' ');}else{parts=line.substring(10).split(' ');} -var candidate={foundation:parts[0],component:parseInt(parts[1],10),protocol:parts[2].toLowerCase(),priority:parseInt(parts[3],10),ip:parts[4],port:parseInt(parts[5],10),type:parts[7]};for(var i=8;i=14393&&url.indexOf('?transport=udp')===-1;});delete server.url;server.urls=isString?urls[0]:urls;return!!urls.length;} +return false;});} +function getCommonCapabilities(localCapabilities,remoteCapabilities){var commonCapabilities={codecs:[],headerExtensions:[],fecMechanisms:[]};var findCodecByPayloadType=function(pt,codecs){pt=parseInt(pt,10);for(var i=0;i0;i--){this._iceGatherers=new window.RTCIceGatherer({iceServers:config.iceServers,gatherPolicy:config.iceTransportPolicy});}}else{config.iceCandidatePoolSize=0;} +this._config=config;this.transceivers=[];this._sdpSessionId=SDPUtils.generateSessionId();this._sdpSessionVersion=0;this._dtlsRole=undefined;};RTCPeerConnection.prototype._emitGatheringStateChange=function(){var event=new Event('icegatheringstatechange');this.dispatchEvent(event);if(typeof this.onicegatheringstatechange==='function'){this.onicegatheringstatechange(event);}};RTCPeerConnection.prototype.getConfiguration=function(){return this._config;};RTCPeerConnection.prototype.getLocalStreams=function(){return this.localStreams;};RTCPeerConnection.prototype.getRemoteStreams=function(){return this.remoteStreams;};RTCPeerConnection.prototype._createTransceiver=function(kind){var hasBundleTransport=this.transceivers.length>0;var transceiver={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:kind,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,wantReceive:true};if(this.usingBundle&&hasBundleTransport){transceiver.iceTransport=this.transceivers[0].iceTransport;transceiver.dtlsTransport=this.transceivers[0].dtlsTransport;}else{var transports=this._createIceAndDtlsTransports();transceiver.iceTransport=transports.iceTransport;transceiver.dtlsTransport=transports.dtlsTransport;} +this.transceivers.push(transceiver);return transceiver;};RTCPeerConnection.prototype.addTrack=function(track,stream){var transceiver;for(var i=0;i=15025){stream.getTracks().forEach(function(track){self.addTrack(track,stream);});}else{var clonedStream=stream.clone();stream.getTracks().forEach(function(track,idx){var clonedTrack=clonedStream.getTracks()[idx];track.addEventListener('enabled',function(event){clonedTrack.enabled=event.enabled;});});clonedStream.getTracks().forEach(function(track){self.addTrack(track,clonedStream);});}};RTCPeerConnection.prototype.removeStream=function(stream){var idx=this.localStreams.indexOf(stream);if(idx>-1){this.localStreams.splice(idx,1);this._maybeFireNegotiationNeeded();}};RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpSender;}).map(function(transceiver){return transceiver.rtpSender;});};RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpReceiver;}).map(function(transceiver){return transceiver.rtpReceiver;});};RTCPeerConnection.prototype._createIceGatherer=function(sdpMLineIndex,usingBundle){var self=this;if(usingBundle&&sdpMLineIndex>0){return this.transceivers[0].iceGatherer;}else if(this._iceGatherers.length){return this._iceGatherers.shift();} +var iceGatherer=new window.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});Object.defineProperty(iceGatherer,'state',{value:'new',writable:true});this.transceivers[sdpMLineIndex].candidates=[];this.transceivers[sdpMLineIndex].bufferCandidates=function(event){var end=!event.candidate||Object.keys(event.candidate).length===0;iceGatherer.state=end?'completed':'gathering';if(self.transceivers[sdpMLineIndex].candidates!==null){self.transceivers[sdpMLineIndex].candidates.push(event.candidate);}};iceGatherer.addEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);return iceGatherer;};RTCPeerConnection.prototype._gather=function(mid,sdpMLineIndex){var self=this;var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer.onlocalcandidate){return;} +var candidates=this.transceivers[sdpMLineIndex].candidates;this.transceivers[sdpMLineIndex].candidates=null;iceGatherer.removeEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);iceGatherer.onlocalcandidate=function(evt){if(self.usingBundle&&sdpMLineIndex>0){return;} +var event=new Event('icecandidate');event.candidate={sdpMid:mid,sdpMLineIndex:sdpMLineIndex};var cand=evt.candidate;var end=!cand||Object.keys(cand).length===0;if(end){if(iceGatherer.state==='new'||iceGatherer.state==='gathering'){iceGatherer.state='completed';}}else{if(iceGatherer.state==='new'){iceGatherer.state='gathering';} +cand.component=1;event.candidate.candidate=SDPUtils.writeCandidate(cand);} +var sections=SDPUtils.splitSections(self.localDescription.sdp);if(!end){sections[event.candidate.sdpMLineIndex+1]+='a='+event.candidate.candidate+'\r\n';}else{sections[event.candidate.sdpMLineIndex+1]+='a=end-of-candidates\r\n';} +self.localDescription.sdp=sections.join('');var complete=self.transceivers.every(function(transceiver){return transceiver.iceGatherer&&transceiver.iceGatherer.state==='completed';});if(self.iceGatheringState!=='gathering'){self.iceGatheringState='gathering';self._emitGatheringStateChange();} +if(!end){self.dispatchEvent(event);if(typeof self.onicecandidate==='function'){self.onicecandidate(event);}} +if(complete){self.dispatchEvent(new Event('icecandidate'));if(typeof self.onicecandidate==='function'){self.onicecandidate(new Event('icecandidate'));} +self.iceGatheringState='complete';self._emitGatheringStateChange();}};window.setTimeout(function(){candidates.forEach(function(candidate){var e=new Event('RTCIceGatherEvent');e.candidate=candidate;iceGatherer.onlocalcandidate(e);});},0);};RTCPeerConnection.prototype._createIceAndDtlsTransports=function(){var self=this;var iceTransport=new window.RTCIceTransport(null);iceTransport.onicestatechange=function(){self._updateConnectionState();};var dtlsTransport=new window.RTCDtlsTransport(iceTransport);dtlsTransport.ondtlsstatechange=function(){self._updateConnectionState();};dtlsTransport.onerror=function(){Object.defineProperty(dtlsTransport,'state',{value:'failed',writable:true});self._updateConnectionState();};return{iceTransport:iceTransport,dtlsTransport:dtlsTransport};};RTCPeerConnection.prototype._disposeIceAndDtlsTransports=function(sdpMLineIndex){var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer){delete iceGatherer.onlocalcandidate;delete this.transceivers[sdpMLineIndex].iceGatherer;} +var iceTransport=this.transceivers[sdpMLineIndex].iceTransport;if(iceTransport){delete iceTransport.onicestatechange;delete this.transceivers[sdpMLineIndex].iceTransport;} +var dtlsTransport=this.transceivers[sdpMLineIndex].dtlsTransport;if(dtlsTransport){delete dtlsTransport.ondtlsstatechange;delete dtlsTransport.onerror;delete this.transceivers[sdpMLineIndex].dtlsTransport;}};RTCPeerConnection.prototype._transceive=function(transceiver,send,recv){var params=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);if(send&&transceiver.rtpSender){params.encodings=transceiver.sendEncodingParameters;params.rtcp={cname:SDPUtils.localCName,compound:transceiver.rtcpParameters.compound};if(transceiver.recvEncodingParameters.length){params.rtcp.ssrc=transceiver.recvEncodingParameters[0].ssrc;} +transceiver.rtpSender.send(params);} +if(recv&&transceiver.rtpReceiver&¶ms.codecs.length>0){if(transceiver.kind==='video'&&transceiver.recvEncodingParameters&&edgeVersion<15019){transceiver.recvEncodingParameters.forEach(function(p){delete p.rtx;});} +params.encodings=transceiver.recvEncodingParameters;params.rtcp={cname:transceiver.rtcpParameters.cname,compound:transceiver.rtcpParameters.compound};if(transceiver.sendEncodingParameters.length){params.rtcp.ssrc=transceiver.sendEncodingParameters[0].ssrc;} +transceiver.rtpReceiver.receive(params);}};RTCPeerConnection.prototype.setLocalDescription=function(description){var self=this;var args=arguments;if(!isActionAllowedInSignalingState('setLocalDescription',description.type,this.signalingState)){return new Promise(function(resolve,reject){var e=new Error('Can not set local '+description.type+' in state '+self.signalingState);e.name='InvalidStateError';if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[e]);} +reject(e);});} +var sections;var sessionpart;if(description.type==='offer'){sections=SDPUtils.splitSections(description.sdp);sessionpart=sections.shift();sections.forEach(function(mediaSection,sdpMLineIndex){var caps=SDPUtils.parseRtpParameters(mediaSection);self.transceivers[sdpMLineIndex].localCapabilities=caps;});this.transceivers.forEach(function(transceiver,sdpMLineIndex){self._gather(transceiver.mid,sdpMLineIndex);});}else if(description.type==='answer'){sections=SDPUtils.splitSections(self.remoteDescription.sdp);sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;sections.forEach(function(mediaSection,sdpMLineIndex){var transceiver=self.transceivers[sdpMLineIndex];var iceGatherer=transceiver.iceGatherer;var iceTransport=transceiver.iceTransport;var dtlsTransport=transceiver.dtlsTransport;var localCapabilities=transceiver.localCapabilities;var remoteCapabilities=transceiver.remoteCapabilities;var rejected=SDPUtils.isRejected(mediaSection)&&!SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===1;if(!rejected&&!transceiver.isDatachannel){var remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);var remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);if(isIceLite){remoteDtlsParameters.role='server';} +if(!self.usingBundle||sdpMLineIndex===0){self._gather(transceiver.mid,sdpMLineIndex);if(iceTransport.state==='new'){iceTransport.start(iceGatherer,remoteIceParameters,isIceLite?'controlling':'controlled');} +if(dtlsTransport.state==='new'){dtlsTransport.start(remoteDtlsParameters);}} +var params=getCommonCapabilities(localCapabilities,remoteCapabilities);self._transceive(transceiver,params.codecs.length>0,false);}});} +this.localDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-local-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} +var cb=arguments.length>1&&typeof arguments[1]==='function'&&arguments[1];return new Promise(function(resolve){if(cb){cb.apply(null);} +resolve();});};RTCPeerConnection.prototype.setRemoteDescription=function(description){var self=this;var args=arguments;if(!isActionAllowedInSignalingState('setRemoteDescription',description.type,this.signalingState)){return new Promise(function(resolve,reject){var e=new Error('Can not set remote '+description.type+' in state '+self.signalingState);e.name='InvalidStateError';if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[e]);} +reject(e);});} +var streams={};this.remoteStreams.forEach(function(stream){streams[stream.id]=stream;});var receiverList=[];var sections=SDPUtils.splitSections(description.sdp);var sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;var usingBundle=SDPUtils.matchPrefix(sessionpart,'a=group:BUNDLE ').length>0;this.usingBundle=usingBundle;var iceOptions=SDPUtils.matchPrefix(sessionpart,'a=ice-options:')[0];if(iceOptions){this.canTrickleIceCandidates=iceOptions.substr(14).split(' ').indexOf('trickle')>=0;}else{this.canTrickleIceCandidates=false;} +sections.forEach(function(mediaSection,sdpMLineIndex){var lines=SDPUtils.splitLines(mediaSection);var kind=SDPUtils.getKind(mediaSection);var rejected=SDPUtils.isRejected(mediaSection)&&!SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===1;var protocol=lines[0].substr(2).split(' ')[2];var direction=SDPUtils.getDirection(mediaSection,sessionpart);var remoteMsid=SDPUtils.parseMsid(mediaSection);var mid=SDPUtils.getMid(mediaSection)||SDPUtils.generateIdentifier();if(kind==='application'&&protocol==='DTLS/SCTP'){self.transceivers[sdpMLineIndex]={mid:mid,isDatachannel:true};return;} +var transceiver;var iceGatherer;var iceTransport;var dtlsTransport;var rtpReceiver;var sendEncodingParameters;var recvEncodingParameters;var localCapabilities;var track;var remoteCapabilities=SDPUtils.parseRtpParameters(mediaSection);var remoteIceParameters;var remoteDtlsParameters;if(!rejected){remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);remoteDtlsParameters.role='client';} +recvEncodingParameters=SDPUtils.parseRtpEncodingParameters(mediaSection);var rtcpParameters=SDPUtils.parseRtcpParameters(mediaSection);var isComplete=SDPUtils.matchPrefix(mediaSection,'a=end-of-candidates',sessionpart).length>0;var cands=SDPUtils.matchPrefix(mediaSection,'a=candidate:').map(function(cand){return SDPUtils.parseCandidate(cand);}).filter(function(cand){return cand.component===1;});if((description.type==='offer'||description.type==='answer')&&!rejected&&usingBundle&&sdpMLineIndex>0&&self.transceivers[sdpMLineIndex]){self._disposeIceAndDtlsTransports(sdpMLineIndex);self.transceivers[sdpMLineIndex].iceGatherer=self.transceivers[0].iceGatherer;self.transceivers[sdpMLineIndex].iceTransport=self.transceivers[0].iceTransport;self.transceivers[sdpMLineIndex].dtlsTransport=self.transceivers[0].dtlsTransport;if(self.transceivers[sdpMLineIndex].rtpSender){self.transceivers[sdpMLineIndex].rtpSender.setTransport(self.transceivers[0].dtlsTransport);} +if(self.transceivers[sdpMLineIndex].rtpReceiver){self.transceivers[sdpMLineIndex].rtpReceiver.setTransport(self.transceivers[0].dtlsTransport);}} +if(description.type==='offer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex]||self._createTransceiver(kind);transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=self._createIceGatherer(sdpMLineIndex,usingBundle);} +if(cands.length&&transceiver.iceTransport.state==='new'){if(isComplete&&(!usingBundle||sdpMLineIndex===0)){transceiver.iceTransport.setRemoteCandidates(cands);}else{cands.forEach(function(candidate){maybeAddCandidate(transceiver.iceTransport,candidate);});}} +localCapabilities=window.RTCRtpReceiver.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} +sendEncodingParameters=transceiver.sendEncodingParameters||[{ssrc:(2*sdpMLineIndex+2)*1001}];var isNewTrack=false;if(direction==='sendrecv'||direction==='sendonly'){isNewTrack=!transceiver.rtpReceiver;rtpReceiver=transceiver.rtpReceiver||new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);if(isNewTrack){var stream;track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();Object.defineProperty(streams[remoteMsid.stream],'id',{get:function(){return remoteMsid.stream;}});} +Object.defineProperty(track,'id',{get:function(){return remoteMsid.track;}});stream=streams[remoteMsid.stream];}else{if(!streams.default){streams.default=new window.MediaStream();} +stream=streams.default;} +stream.addTrack(track);receiverList.push([track,rtpReceiver,stream]);}} +transceiver.localCapabilities=localCapabilities;transceiver.remoteCapabilities=remoteCapabilities;transceiver.rtpReceiver=rtpReceiver;transceiver.rtcpParameters=rtcpParameters;transceiver.sendEncodingParameters=sendEncodingParameters;transceiver.recvEncodingParameters=recvEncodingParameters;self._transceive(self.transceivers[sdpMLineIndex],false,isNewTrack);}else if(description.type==='answer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex];iceGatherer=transceiver.iceGatherer;iceTransport=transceiver.iceTransport;dtlsTransport=transceiver.dtlsTransport;rtpReceiver=transceiver.rtpReceiver;sendEncodingParameters=transceiver.sendEncodingParameters;localCapabilities=transceiver.localCapabilities;self.transceivers[sdpMLineIndex].recvEncodingParameters=recvEncodingParameters;self.transceivers[sdpMLineIndex].remoteCapabilities=remoteCapabilities;self.transceivers[sdpMLineIndex].rtcpParameters=rtcpParameters;if(cands.length&&iceTransport.state==='new'){if((isIceLite||isComplete)&&(!usingBundle||sdpMLineIndex===0)){iceTransport.setRemoteCandidates(cands);}else{cands.forEach(function(candidate){maybeAddCandidate(transceiver.iceTransport,candidate);});}} +if(!usingBundle||sdpMLineIndex===0){if(iceTransport.state==='new'){iceTransport.start(iceGatherer,remoteIceParameters,'controlling');} +if(dtlsTransport.state==='new'){dtlsTransport.start(remoteDtlsParameters);}} +self._transceive(transceiver,direction==='sendrecv'||direction==='recvonly',direction==='sendrecv'||direction==='sendonly');if(rtpReceiver&&(direction==='sendrecv'||direction==='sendonly')){track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();} +streams[remoteMsid.stream].addTrack(track);receiverList.push([track,rtpReceiver,streams[remoteMsid.stream]]);}else{if(!streams.default){streams.default=new window.MediaStream();} +streams.default.addTrack(track);receiverList.push([track,rtpReceiver,streams.default]);}}else{delete transceiver.rtpReceiver;}}});if(this._dtlsRole===undefined){this._dtlsRole=description.type==='offer'?'active':'passive';} +this.remoteDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-remote-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} +Object.keys(streams).forEach(function(sid){var stream=streams[sid];if(stream.getTracks().length){if(self.remoteStreams.indexOf(stream)===-1){self.remoteStreams.push(stream);var event=new Event('addstream');event.stream=stream;window.setTimeout(function(){self.dispatchEvent(event);if(typeof self.onaddstream==='function'){self.onaddstream(event);}});} +receiverList.forEach(function(item){var track=item[0];var receiver=item[1];if(stream.id!==item[2].id){return;} +var trackEvent=new Event('track');trackEvent.track=track;trackEvent.receiver=receiver;trackEvent.transceiver={receiver:receiver};trackEvent.streams=[stream];window.setTimeout(function(){self.dispatchEvent(trackEvent);if(typeof self.ontrack==='function'){self.ontrack(trackEvent);}});});}});window.setTimeout(function(){if(!(self&&self.transceivers)){return;} +self.transceivers.forEach(function(transceiver){if(transceiver.iceTransport&&transceiver.iceTransport.state==='new'&&transceiver.iceTransport.getRemoteCandidates().length>0){console.warn('Timeout for addRemoteCandidate. Consider sending '+'an end-of-candidates notification');transceiver.iceTransport.addRemoteCandidate({});}});},4000);return new Promise(function(resolve){if(args.length>1&&typeof args[1]==='function'){args[1].apply(null);} +resolve();});};RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(transceiver){if(transceiver.iceTransport){transceiver.iceTransport.stop();} +if(transceiver.dtlsTransport){transceiver.dtlsTransport.stop();} +if(transceiver.rtpSender){transceiver.rtpSender.stop();} +if(transceiver.rtpReceiver){transceiver.rtpReceiver.stop();}});this._updateSignalingState('closed');};RTCPeerConnection.prototype._updateSignalingState=function(newState){this.signalingState=newState;var event=new Event('signalingstatechange');this.dispatchEvent(event);if(typeof this.onsignalingstatechange==='function'){this.onsignalingstatechange(event);}};RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var self=this;if(this.signalingState!=='stable'||this.needNegotiation===true){return;} +this.needNegotiation=true;window.setTimeout(function(){if(self.needNegotiation===false){return;} +self.needNegotiation=false;var event=new Event('negotiationneeded');self.dispatchEvent(event);if(typeof self.onnegotiationneeded==='function'){self.onnegotiationneeded(event);}},0);};RTCPeerConnection.prototype._updateConnectionState=function(){var newState;var states={'new':0,closed:0,connecting:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};this.transceivers.forEach(function(transceiver){states[transceiver.iceTransport.state]++;states[transceiver.dtlsTransport.state]++;});states.connected+=states.completed;newState='new';if(states.failed>0){newState='failed';}else if(states.connecting>0||states.checking>0){newState='connecting';}else if(states.disconnected>0){newState='disconnected';}else if(states.new>0){newState='new';}else if(states.connected>0||states.completed>0){newState='connected';} +if(newState!==this.iceConnectionState){this.iceConnectionState=newState;var event=new Event('iceconnectionstatechange');this.dispatchEvent(event);if(typeof this.oniceconnectionstatechange==='function'){this.oniceconnectionstatechange(event);}}};RTCPeerConnection.prototype.createOffer=function(){var self=this;var args=arguments;var offerOptions;if(arguments.length===1&&typeof arguments[0]!=='function'){offerOptions=arguments[0];}else if(arguments.length===3){offerOptions=arguments[2];} +var numAudioTracks=this.transceivers.filter(function(t){return t.kind==='audio';}).length;var numVideoTracks=this.transceivers.filter(function(t){return t.kind==='video';}).length;if(offerOptions){if(offerOptions.mandatory||offerOptions.optional){throw new TypeError('Legacy mandatory/optional constraints not supported.');} +if(offerOptions.offerToReceiveAudio!==undefined){if(offerOptions.offerToReceiveAudio===true){numAudioTracks=1;}else if(offerOptions.offerToReceiveAudio===false){numAudioTracks=0;}else{numAudioTracks=offerOptions.offerToReceiveAudio;}} +if(offerOptions.offerToReceiveVideo!==undefined){if(offerOptions.offerToReceiveVideo===true){numVideoTracks=1;}else if(offerOptions.offerToReceiveVideo===false){numVideoTracks=0;}else{numVideoTracks=offerOptions.offerToReceiveVideo;}}} +this.transceivers.forEach(function(transceiver){if(transceiver.kind==='audio'){numAudioTracks--;if(numAudioTracks<0){transceiver.wantReceive=false;}}else if(transceiver.kind==='video'){numVideoTracks--;if(numVideoTracks<0){transceiver.wantReceive=false;}}});while(numAudioTracks>0||numVideoTracks>0){if(numAudioTracks>0){this._createTransceiver('audio');numAudioTracks--;} +if(numVideoTracks>0){this._createTransceiver('video');numVideoTracks--;}} +var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);this.transceivers.forEach(function(transceiver,sdpMLineIndex){var track=transceiver.track;var kind=transceiver.kind;var mid=SDPUtils.generateIdentifier();transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=self._createIceGatherer(sdpMLineIndex,self.usingBundle);} +var localCapabilities=window.RTCRtpSender.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} +localCapabilities.codecs.forEach(function(codec){if(codec.name==='H264'&&codec.parameters['level-asymmetry-allowed']===undefined){codec.parameters['level-asymmetry-allowed']='1';}});var sendEncodingParameters=transceiver.sendEncodingParameters||[{ssrc:(2*sdpMLineIndex+1)*1001}];if(track){if(edgeVersion>=15019&&kind==='video'&&!sendEncodingParameters[0].rtx){sendEncodingParameters[0].rtx={ssrc:sendEncodingParameters[0].ssrc+1};}} +if(transceiver.wantReceive){transceiver.rtpReceiver=new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);} +transceiver.localCapabilities=localCapabilities;transceiver.sendEncodingParameters=sendEncodingParameters;});if(this._config.bundlePolicy!=='max-compat'){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} +sdp+='a=ice-options:trickle\r\n';this.transceivers.forEach(function(transceiver,sdpMLineIndex){sdp+=writeMediaSection(transceiver,transceiver.localCapabilities,'offer',transceiver.stream,self._dtlsRole);sdp+='a=rtcp-rsize\r\n';if(transceiver.iceGatherer&&self.iceGatheringState!=='new'&&(sdpMLineIndex===0||!self.usingBundle)){transceiver.iceGatherer.getLocalCandidates().forEach(function(cand){cand.component=1;sdp+='a='+SDPUtils.writeCandidate(cand)+'\r\n';});if(transceiver.iceGatherer.state==='completed'){sdp+='a=end-of-candidates\r\n';}}});var desc=new window.RTCSessionDescription({type:'offer',sdp:sdp});return new Promise(function(resolve){if(args.length>0&&typeof args[0]==='function'){args[0].apply(null,[desc]);resolve();return;} +resolve(desc);});};RTCPeerConnection.prototype.createAnswer=function(){var self=this;var args=arguments;var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);if(this.usingBundle){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} +var mediaSectionsInOffer=SDPUtils.splitSections(this.remoteDescription.sdp).length-1;this.transceivers.forEach(function(transceiver,sdpMLineIndex){if(sdpMLineIndex+1>mediaSectionsInOffer){return;} +if(transceiver.isDatachannel){sdp+='m=application 0 DTLS/SCTP 5000\r\n'+'c=IN IP4 0.0.0.0\r\n'+'a=mid:'+transceiver.mid+'\r\n';return;} +if(transceiver.stream){var localTrack;if(transceiver.kind==='audio'){localTrack=transceiver.stream.getAudioTracks()[0];}else if(transceiver.kind==='video'){localTrack=transceiver.stream.getVideoTracks()[0];} +if(localTrack){if(edgeVersion>=15019&&transceiver.kind==='video'&&!transceiver.sendEncodingParameters[0].rtx){transceiver.sendEncodingParameters[0].rtx={ssrc:transceiver.sendEncodingParameters[0].ssrc+1};}}} +var commonCapabilities=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);var hasRtx=commonCapabilities.codecs.filter(function(c){return c.name.toLowerCase()==='rtx';}).length;if(!hasRtx&&transceiver.sendEncodingParameters[0].rtx){delete transceiver.sendEncodingParameters[0].rtx;} +sdp+=writeMediaSection(transceiver,commonCapabilities,'answer',transceiver.stream,self._dtlsRole);if(transceiver.rtcpParameters&&transceiver.rtcpParameters.reducedSize){sdp+='a=rtcp-rsize\r\n';}});var desc=new window.RTCSessionDescription({type:'answer',sdp:sdp});return new Promise(function(resolve){if(args.length>0&&typeof args[0]==='function'){args[0].apply(null,[desc]);resolve();return;} +resolve(desc);});};RTCPeerConnection.prototype.addIceCandidate=function(candidate){var err;var sections;if(!candidate||candidate.candidate===''){for(var j=0;j0?SDPUtils.parseCandidate(candidate.candidate):{};if(cand.protocol==='tcp'&&(cand.port===0||cand.port===9)){return Promise.resolve();} +if(cand.component&&cand.component!==1){return Promise.resolve();} +if(sdpMLineIndex===0||(sdpMLineIndex>0&&transceiver.iceTransport!==this.transceivers[0].iceTransport)){if(!maybeAddCandidate(transceiver.iceTransport,cand)){err=new Error('Can not add ICE candidate');err.name='OperationError';}} +if(!err){var candidateString=candidate.candidate.trim();if(candidateString.indexOf('a=')===0){candidateString=candidateString.substr(2);} +sections=SDPUtils.splitSections(this.remoteDescription.sdp);sections[sdpMLineIndex+1]+='a='+ +(cand.type?candidateString:'end-of-candidates') ++'\r\n';this.remoteDescription.sdp=sections.join('');}}else{err=new Error('Can not add ICE candidate');err.name='OperationError';}} +var args=arguments;return new Promise(function(resolve,reject){if(err){if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[err]);} +reject(err);}else{if(args.length>1&&typeof args[1]==='function'){args[1].apply(null);} +resolve();}});};RTCPeerConnection.prototype.getStats=function(){var promises=[];this.transceivers.forEach(function(transceiver){['rtpSender','rtpReceiver','iceGatherer','iceTransport','dtlsTransport'].forEach(function(method){if(transceiver[method]){promises.push(transceiver[method].getStats());}});});var cb=arguments.length>1&&typeof arguments[1]==='function'&&arguments[1];var fixStatsType=function(stat){return{inboundrtp:'inbound-rtp',outboundrtp:'outbound-rtp',candidatepair:'candidate-pair',localcandidate:'local-candidate',remotecandidate:'remote-candidate'}[stat.type]||stat.type;};return new Promise(function(resolve){var results=new Map();Promise.all(promises).then(function(res){res.forEach(function(result){Object.keys(result).forEach(function(id){result[id].type=fixStatsType(result[id]);results.set(id,result[id]);});});if(cb){cb.apply(null,results);} +resolve(results);});});};return RTCPeerConnection;};},{"sdp":2}],2:[function(require,module,exports){'use strict';var SDPUtils={};SDPUtils.generateIdentifier=function(){return Math.random().toString(36).substr(2,10);};SDPUtils.localCName=SDPUtils.generateIdentifier();SDPUtils.splitLines=function(blob){return blob.trim().split('\n').map(function(line){return line.trim();});};SDPUtils.splitSections=function(blob){var parts=blob.split('\nm=');return parts.map(function(part,index){return(index>0?'m='+part:part).trim()+'\r\n';});};SDPUtils.matchPrefix=function(blob,prefix){return SDPUtils.splitLines(blob).filter(function(line){return line.indexOf(prefix)===0;});};SDPUtils.parseCandidate=function(line){var parts;if(line.indexOf('a=candidate:')===0){parts=line.substring(12).split(' ');}else{parts=line.substring(10).split(' ');} +var candidate={foundation:parts[0],component:parseInt(parts[1],10),protocol:parts[2].toLowerCase(),priority:parseInt(parts[3],10),ip:parts[4],port:parseInt(parts[5],10),type:parts[7]};for(var i=8;i0;rtcpParameters.compound=rsize.length===0;var mux=SDPUtils.matchPrefix(mediaSection,'a=rtcp-mux');rtcpParameters.mux=mux.length>0;return rtcpParameters;};SDPUtils.parseMsid=function(mediaSection){var parts;var spec=SDPUtils.matchPrefix(mediaSection,'a=msid:');if(spec.length===1){parts=spec[0].substr(7).split(' ');return{stream:parts[0],track:parts[1]};} -var planB=SDPUtils.matchPrefix(mediaSection,'a=ssrc:').map(function(line){return SDPUtils.parseSsrcMedia(line);}).filter(function(parts){return parts.attribute==='msid';});if(planB.length>0){parts=planB[0].value.split(' ');return{stream:parts[0],track:parts[1]};}};SDPUtils.generateSessionId=function(){return Math.random().toString().substr(2,21);};SDPUtils.writeSessionBoilerplate=function(sessId){var sessionId;if(sessId){sessionId=sessId;}else{sessionId=SDPUtils.generateSessionId();} -return'v=0\r\n'+'o=thisisadapterortc '+sessionId+' 2 IN IP4 127.0.0.1\r\n'+'s=-\r\n'+'t=0 0\r\n';};SDPUtils.writeMediaSection=function(transceiver,caps,type,stream){var sdp=SDPUtils.writeRtpDescription(transceiver.kind,caps);sdp+=SDPUtils.writeIceParameters(transceiver.iceGatherer.getLocalParameters());sdp+=SDPUtils.writeDtlsParameters(transceiver.dtlsTransport.getLocalParameters(),type==='offer'?'actpass':'active');sdp+='a=mid:'+transceiver.mid+'\r\n';if(transceiver.direction){sdp+='a='+transceiver.direction+'\r\n';}else if(transceiver.rtpSender&&transceiver.rtpReceiver){sdp+='a=sendrecv\r\n';}else if(transceiver.rtpSender){sdp+='a=sendonly\r\n';}else if(transceiver.rtpReceiver){sdp+='a=recvonly\r\n';}else{sdp+='a=inactive\r\n';} +var planB=SDPUtils.matchPrefix(mediaSection,'a=ssrc:').map(function(line){return SDPUtils.parseSsrcMedia(line);}).filter(function(parts){return parts.attribute==='msid';});if(planB.length>0){parts=planB[0].value.split(' ');return{stream:parts[0],track:parts[1]};}};SDPUtils.generateSessionId=function(){return Math.random().toString().substr(2,21);};SDPUtils.writeSessionBoilerplate=function(sessId,sessVer){var sessionId;var version=sessVer!==undefined?sessVer:2;if(sessId){sessionId=sessId;}else{sessionId=SDPUtils.generateSessionId();} +return'v=0\r\n'+'o=thisisadapterortc '+sessionId+' '+version+' IN IP4 127.0.0.1\r\n'+'s=-\r\n'+'t=0 0\r\n';};SDPUtils.writeMediaSection=function(transceiver,caps,type,stream){var sdp=SDPUtils.writeRtpDescription(transceiver.kind,caps);sdp+=SDPUtils.writeIceParameters(transceiver.iceGatherer.getLocalParameters());sdp+=SDPUtils.writeDtlsParameters(transceiver.dtlsTransport.getLocalParameters(),type==='offer'?'actpass':'active');sdp+='a=mid:'+transceiver.mid+'\r\n';if(transceiver.direction){sdp+='a='+transceiver.direction+'\r\n';}else if(transceiver.rtpSender&&transceiver.rtpReceiver){sdp+='a=sendrecv\r\n';}else if(transceiver.rtpSender){sdp+='a=sendonly\r\n';}else if(transceiver.rtpReceiver){sdp+='a=recvonly\r\n';}else{sdp+='a=inactive\r\n';} if(transceiver.rtpSender){var msid='msid:'+stream.id+' '+ transceiver.rtpSender.track.id+'\r\n';sdp+='a='+msid;sdp+='a=ssrc:'+transceiver.sendEncodingParameters[0].ssrc+' '+msid;if(transceiver.sendEncodingParameters[0].rtx){sdp+='a=ssrc:'+transceiver.sendEncodingParameters[0].rtx.ssrc+' '+msid;sdp+='a=ssrc-group:FID '+ transceiver.sendEncodingParameters[0].ssrc+' '+ @@ -342,29 +455,42 @@ transceiver.sendEncodingParameters[0].rtx.ssrc+'\r\n';}} sdp+='a=ssrc:'+transceiver.sendEncodingParameters[0].ssrc+' cname:'+SDPUtils.localCName+'\r\n';if(transceiver.rtpSender&&transceiver.sendEncodingParameters[0].rtx){sdp+='a=ssrc:'+transceiver.sendEncodingParameters[0].rtx.ssrc+' cname:'+SDPUtils.localCName+'\r\n';} return sdp;};SDPUtils.getDirection=function(mediaSection,sessionpart){var lines=SDPUtils.splitLines(mediaSection);for(var i=0;i=64){return;} +var origGetLocalStreams=window.RTCPeerConnection.prototype.getLocalStreams;window.RTCPeerConnection.prototype.getLocalStreams=function(){var self=this;var nativeStreams=origGetLocalStreams.apply(this);self._reverseStreams=self._reverseStreams||{};return nativeStreams.map(function(stream){return self._reverseStreams[stream.id];});};var origAddStream=window.RTCPeerConnection.prototype.addStream;window.RTCPeerConnection.prototype.addStream=function(stream){var pc=this;pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};stream.getTracks().forEach(function(track){var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');}});if(!pc._reverseStreams[stream.id]){var newStream=new window.MediaStream(stream.getTracks());pc._streams[stream.id]=newStream;pc._reverseStreams[newStream.id]=stream;stream=newStream;} +origAddStream.apply(pc,[stream]);};var origRemoveStream=window.RTCPeerConnection.prototype.removeStream;window.RTCPeerConnection.prototype.removeStream=function(stream){var pc=this;pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};origRemoveStream.apply(pc,[(pc._streams[stream.id]||stream)]);delete pc._reverseStreams[(pc._streams[stream.id]?pc._streams[stream.id].id:stream.id)];delete pc._streams[stream.id];};window.RTCPeerConnection.prototype.addTrack=function(track,stream){var pc=this;if(pc.signalingState==='closed'){throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.','InvalidStateError');} +var streams=[].slice.call(arguments,1);if(streams.length!==1||!streams[0].getTracks().find(function(t){return t===track;})){throw new DOMException('The adapter.js addTrack polyfill only supports a single '+' stream which is associated with the specified track.','NotSupportedError');} +var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');} +pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};var oldStream=pc._streams[stream.id];if(oldStream){oldStream.addTrack(track);Promise.resolve().then(function(){pc.dispatchEvent(new Event('negotiationneeded'));});}else{var newStream=new window.MediaStream([track]);pc._streams[stream.id]=newStream;pc._reverseStreams[newStream.id]=stream;pc.addStream(newStream);} +return pc.getSenders().find(function(s){return s.track===track;});};function replaceInternalStreamId(pc,description){var sdp=description.sdp;Object.keys(pc._reverseStreams||[]).forEach(function(internalId){var externalStream=pc._reverseStreams[internalId];var internalStream=pc._streams[externalStream.id];sdp=sdp.replace(new RegExp(internalStream.id,'g'),externalStream.id);});return new RTCSessionDescription({type:description.type,sdp:sdp});} +function replaceExternalStreamId(pc,description){var sdp=description.sdp;Object.keys(pc._reverseStreams||[]).forEach(function(internalId){var externalStream=pc._reverseStreams[internalId];var internalStream=pc._streams[externalStream.id];sdp=sdp.replace(new RegExp(externalStream.id,'g'),internalStream.id);});return new RTCSessionDescription({type:description.type,sdp:sdp});} +['createOffer','createAnswer'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){var pc=this;var args=arguments;var isLegacyCall=arguments.length&&typeof arguments[0]==='function';if(isLegacyCall){return nativeMethod.apply(pc,[function(description){var desc=replaceInternalStreamId(pc,description);args[0].apply(null,[desc]);},function(err){if(args[1]){args[1].apply(null,err);}},arguments[2]]);} +return nativeMethod.apply(pc,arguments).then(function(description){return replaceInternalStreamId(pc,description);});};});var origSetLocalDescription=window.RTCPeerConnection.prototype.setLocalDescription;window.RTCPeerConnection.prototype.setLocalDescription=function(){var pc=this;if(!arguments.length||!arguments[0].type){return origSetLocalDescription.apply(pc,arguments);} +arguments[0]=replaceExternalStreamId(pc,arguments[0]);return origSetLocalDescription.apply(pc,arguments);};var origLocalDescription=Object.getOwnPropertyDescriptor(window.RTCPeerConnection.prototype,'localDescription');Object.defineProperty(window.RTCPeerConnection.prototype,'localDescription',{get:function(){var pc=this;var description=origLocalDescription.get.apply(this);if(description.type===''){return description;} +return replaceInternalStreamId(pc,description);}});window.RTCPeerConnection.prototype.removeTrack=function(sender){var pc=this;if(pc.signalingState==='closed'){throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.','InvalidStateError');} +if(!sender._pc){throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack '+'does not implement interface RTCRtpSender.','TypeError');} +var isLocal=sender._pc===pc;if(!isLocal){throw new DOMException('Sender was not created by this connection.','InvalidAccessError');} +pc._streams=pc._streams||{};var stream;Object.keys(pc._streams).forEach(function(streamid){var hasTrack=pc._streams[streamid].getTracks().find(function(track){return sender.track===track;});if(hasTrack){stream=pc._streams[streamid];}});if(stream){if(stream.getTracks().length===1){pc.removeStream(pc._reverseStreams[stream.id]);}else{stream.removeTrack(sender.track);} +pc.dispatchEvent(new Event('negotiationneeded'));}};},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(!window.RTCPeerConnection){window.RTCPeerConnection=function(pcConfig,pcConstraints){logging('PeerConnection');if(pcConfig&&pcConfig.iceTransportPolicy){pcConfig.iceTransports=pcConfig.iceTransportPolicy;} +return new window.webkitRTCPeerConnection(pcConfig,pcConstraints);};window.RTCPeerConnection.prototype=window.webkitRTCPeerConnection.prototype;if(window.webkitRTCPeerConnection.generateCertificate){Object.defineProperty(window.RTCPeerConnection,'generateCertificate',{get:function(){return window.webkitRTCPeerConnection.generateCertificate;}});}}else{var OrigPeerConnection=window.RTCPeerConnection;window.RTCPeerConnection=function(pcConfig,pcConstraints){if(pcConfig&&pcConfig.iceServers){var newIceServers=[];for(var i=0;i0&&typeof selector==='function'){return origGetStats.apply(this,arguments);} @@ -376,123 +502,44 @@ if(browserDetails.version<52){['createOffer','createAnswer'].forEach(function(me return nativeMethod.apply(this,arguments);};});} ['setLocalDescription','setRemoteDescription','addIceCandidate'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){arguments[0]=new((method==='addIceCandidate')?window.RTCIceCandidate:window.RTCSessionDescription)(arguments[0]);return nativeMethod.apply(this,arguments);};});var nativeAddIceCandidate=window.RTCPeerConnection.prototype.addIceCandidate;window.RTCPeerConnection.prototype.addIceCandidate=function(){if(!arguments[0]){if(arguments[1]){arguments[1].apply(null);} return Promise.resolve();} -return nativeAddIceCandidate.apply(this,arguments);};}};module.exports={shimMediaStream:chromeShim.shimMediaStream,shimOnTrack:chromeShim.shimOnTrack,shimGetSendersWithDtmf:chromeShim.shimGetSendersWithDtmf,shimSourceObject:chromeShim.shimSourceObject,shimPeerConnection:chromeShim.shimPeerConnection,shimGetUserMedia:require('./getusermedia')};},{"../utils.js":12,"./getusermedia":5}],5:[function(require,module,exports){'use strict';var utils=require('../utils.js');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var constraintsToChrome_=function(c){if(typeof c!=='object'||c.mandatory||c.optional){return c;} +return nativeAddIceCandidate.apply(this,arguments);};}};module.exports={shimMediaStream:chromeShim.shimMediaStream,shimOnTrack:chromeShim.shimOnTrack,shimAddTrackRemoveTrack:chromeShim.shimAddTrackRemoveTrack,shimGetSendersWithDtmf:chromeShim.shimGetSendersWithDtmf,shimSourceObject:chromeShim.shimSourceObject,shimPeerConnection:chromeShim.shimPeerConnection,shimGetUserMedia:require('./getusermedia')};},{"../utils.js":13,"./getusermedia":6}],6:[function(require,module,exports){'use strict';var utils=require('../utils.js');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var constraintsToChrome_=function(c){if(typeof c!=='object'||c.mandatory||c.optional){return c;} var cc={};Object.keys(c).forEach(function(key){if(key==='require'||key==='advanced'||key==='mediaSource'){return;} var r=(typeof c[key]==='object')?c[key]:{ideal:c[key]};if(r.exact!==undefined&&typeof r.exact==='number'){r.min=r.max=r.exact;} var oldname_=function(prefix,name){if(prefix){return prefix+name.charAt(0).toUpperCase()+name.slice(1);} return(name==='deviceId')?'sourceId':name;};if(r.ideal!==undefined){cc.optional=cc.optional||[];var oc={};if(typeof r.ideal==='number'){oc[oldname_('min',key)]=r.ideal;cc.optional.push(oc);oc={};oc[oldname_('max',key)]=r.ideal;cc.optional.push(oc);}else{oc[oldname_('',key)]=r.ideal;cc.optional.push(oc);}} if(r.exact!==undefined&&typeof r.exact!=='number'){cc.mandatory=cc.mandatory||{};cc.mandatory[oldname_('',key)]=r.exact;}else{['min','max'].forEach(function(mix){if(r[mix]!==undefined){cc.mandatory=cc.mandatory||{};cc.mandatory[oldname_(mix,key)]=r[mix];}});}});if(c.advanced){cc.optional=(cc.optional||[]).concat(c.advanced);} -return cc;};var shimConstraints_=function(constraints,func){constraints=JSON.parse(JSON.stringify(constraints));if(constraints&&typeof constraints.audio==='object'){var remap=function(obj,a,b){if(a in obj&&!(b in obj)){obj[b]=obj[a];delete obj[a];}};constraints=JSON.parse(JSON.stringify(constraints));remap(constraints.audio,'autoGainControl','googAutoGainControl');remap(constraints.audio,'noiseSuppression','googNoiseSuppression');constraints.audio=constraintsToChrome_(constraints.audio);} -if(constraints&&typeof constraints.video==='object'){var face=constraints.video.facingMode;face=face&&((typeof face==='object')?face:{ideal:face});var getSupportedFacingModeLies=browserDetails.version<61;if((face&&(face.exact==='user'||face.exact==='environment'||face.ideal==='user'||face.ideal==='environment'))&&!(navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().facingMode&&!getSupportedFacingModeLies)){delete constraints.video.facingMode;var matches;if(face.exact==='environment'||face.ideal==='environment'){matches=['back','rear'];}else if(face.exact==='user'||face.ideal==='user'){matches=['front'];} +return cc;};var shimConstraints_=function(constraints,func){if(browserDetails.version>=61){return func(constraints);} +constraints=JSON.parse(JSON.stringify(constraints));if(constraints&&typeof constraints.audio==='object'){var remap=function(obj,a,b){if(a in obj&&!(b in obj)){obj[b]=obj[a];delete obj[a];}};constraints=JSON.parse(JSON.stringify(constraints));remap(constraints.audio,'autoGainControl','googAutoGainControl');remap(constraints.audio,'noiseSuppression','googNoiseSuppression');constraints.audio=constraintsToChrome_(constraints.audio);} +if(constraints&&typeof constraints.video==='object'){var face=constraints.video.facingMode;face=face&&((typeof face==='object')?face:{ideal:face});var getSupportedFacingModeLies=browserDetails.version<66;if((face&&(face.exact==='user'||face.exact==='environment'||face.ideal==='user'||face.ideal==='environment'))&&!(navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().facingMode&&!getSupportedFacingModeLies)){delete constraints.video.facingMode;var matches;if(face.exact==='environment'||face.ideal==='environment'){matches=['back','rear'];}else if(face.exact==='user'||face.ideal==='user'){matches=['front'];} if(matches){return navigator.mediaDevices.enumerateDevices().then(function(devices){devices=devices.filter(function(d){return d.kind==='videoinput';});var dev=devices.find(function(d){return matches.some(function(match){return d.label.toLowerCase().indexOf(match)!==-1;});});if(!dev&&devices.length&&matches.indexOf('back')!==-1){dev=devices[devices.length-1];} if(dev){constraints.video.deviceId=face.exact?{exact:dev.deviceId}:{ideal:dev.deviceId};} constraints.video=constraintsToChrome_(constraints.video);logging('chrome: '+JSON.stringify(constraints));return func(constraints);});}} constraints.video=constraintsToChrome_(constraints.video);} -logging('chrome: '+JSON.stringify(constraints));return func(constraints);};var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError',InvalidStateError:'NotReadableError',DevicesNotFoundError:'NotFoundError',ConstraintNotSatisfiedError:'OverconstrainedError',TrackStartError:'NotReadableError',MediaDeviceFailedDueToShutdown:'NotReadableError',MediaDeviceKillSwitchOn:'NotReadableError'}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&': ')+this.message;}};};var getUserMedia_=function(constraints,onSuccess,onError){shimConstraints_(constraints,function(c){navigator.webkitGetUserMedia(c,onSuccess,function(e){onError(shimError_(e));});});};navigator.getUserMedia=getUserMedia_;var getUserMediaPromise_=function(constraints){return new Promise(function(resolve,reject){navigator.getUserMedia(constraints,resolve,reject);});};if(!navigator.mediaDevices){navigator.mediaDevices={getUserMedia:getUserMediaPromise_,enumerateDevices:function(){return new Promise(function(resolve){var kinds={audio:'audioinput',video:'videoinput'};return window.MediaStreamTrack.getSources(function(devices){resolve(devices.map(function(device){return{label:device.label,kind:kinds[device.kind],deviceId:device.id,groupId:''};}));});});},getSupportedConstraints:function(){return{deviceId:true,echoCancellation:true,facingMode:true,frameRate:true,height:true,width:true};}};} +logging('chrome: '+JSON.stringify(constraints));return func(constraints);};var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError',InvalidStateError:'NotReadableError',DevicesNotFoundError:'NotFoundError',ConstraintNotSatisfiedError:'OverconstrainedError',TrackStartError:'NotReadableError',MediaDeviceFailedDueToShutdown:'NotReadableError',MediaDeviceKillSwitchOn:'NotReadableError'}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&': ')+this.message;}};};var getUserMedia_=function(constraints,onSuccess,onError){shimConstraints_(constraints,function(c){navigator.webkitGetUserMedia(c,onSuccess,function(e){if(onError){onError(shimError_(e));}});});};navigator.getUserMedia=getUserMedia_;var getUserMediaPromise_=function(constraints){return new Promise(function(resolve,reject){navigator.getUserMedia(constraints,resolve,reject);});};if(!navigator.mediaDevices){navigator.mediaDevices={getUserMedia:getUserMediaPromise_,enumerateDevices:function(){return new Promise(function(resolve){var kinds={audio:'audioinput',video:'videoinput'};return window.MediaStreamTrack.getSources(function(devices){resolve(devices.map(function(device){return{label:device.label,kind:kinds[device.kind],deviceId:device.id,groupId:''};}));});});},getSupportedConstraints:function(){return{deviceId:true,echoCancellation:true,facingMode:true,frameRate:true,height:true,width:true};}};} if(!navigator.mediaDevices.getUserMedia){navigator.mediaDevices.getUserMedia=function(constraints){return getUserMediaPromise_(constraints);};}else{var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(cs){return shimConstraints_(cs,function(c){return origGetUserMedia(c).then(function(stream){if(c.audio&&!stream.getAudioTracks().length||c.video&&!stream.getVideoTracks().length){stream.getTracks().forEach(function(track){track.stop();});throw new DOMException('','NotFoundError');} return stream;},function(e){return Promise.reject(shimError_(e));});});};} if(typeof navigator.mediaDevices.addEventListener==='undefined'){navigator.mediaDevices.addEventListener=function(){logging('Dummy mediaDevices.addEventListener called.');};} -if(typeof navigator.mediaDevices.removeEventListener==='undefined'){navigator.mediaDevices.removeEventListener=function(){logging('Dummy mediaDevices.removeEventListener called.');};}};},{"../utils.js":12}],6:[function(require,module,exports){'use strict';var utils=require('../utils');var shimRTCPeerConnection=require('./rtcpeerconnection_shim');module.exports={shimGetUserMedia:require('./getusermedia'),shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(window.RTCIceGatherer){if(!window.RTCIceCandidate){window.RTCIceCandidate=function(args){return args;};} +if(typeof navigator.mediaDevices.removeEventListener==='undefined'){navigator.mediaDevices.removeEventListener=function(){logging('Dummy mediaDevices.removeEventListener called.');};}};},{"../utils.js":13}],7:[function(require,module,exports){'use strict';var SDPUtils=require('sdp');var utils=require('./utils');function wrapPeerConnectionEvent(window,eventNameToWrap,wrapper){if(!window.RTCPeerConnection){return;} +var proto=window.RTCPeerConnection.prototype;var nativeAddEventListener=proto.addEventListener;proto.addEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap){return nativeAddEventListener.apply(this,arguments);} +var wrappedCallback=function(e){cb(wrapper(e));};this._eventMap=this._eventMap||{};this._eventMap[cb]=wrappedCallback;return nativeAddEventListener.apply(this,[nativeEventName,wrappedCallback]);};var nativeRemoveEventListener=proto.removeEventListener;proto.removeEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap||!this._eventMap||!this._eventMap[cb]){return nativeRemoveEventListener.apply(this,arguments);} +var unwrappedCb=this._eventMap[cb];delete this._eventMap[cb];return nativeRemoveEventListener.apply(this,[nativeEventName,unwrappedCb]);};Object.defineProperty(proto,'on'+eventNameToWrap,{get:function(){return this['_on'+eventNameToWrap];},set:function(cb){if(this['_on'+eventNameToWrap]){this.removeEventListener(eventNameToWrap,this['_on'+eventNameToWrap]);delete this['_on'+eventNameToWrap];} +if(cb){this.addEventListener(eventNameToWrap,this['_on'+eventNameToWrap]=cb);}}});} +module.exports={shimRTCIceCandidate:function(window){if(window.RTCIceCandidate&&'foundation'in +window.RTCIceCandidate.prototype){return;} +var NativeRTCIceCandidate=window.RTCIceCandidate;window.RTCIceCandidate=function(args){if(typeof args==='object'&&args.candidate&&args.candidate.indexOf('a=')===0){args=JSON.parse(JSON.stringify(args));args.candidate=args.candidate.substr(2);} +var nativeCandidate=new NativeRTCIceCandidate(args);var parsedCandidate=SDPUtils.parseCandidate(args.candidate);var augmentedCandidate=Object.assign(nativeCandidate,parsedCandidate);augmentedCandidate.toJSON=function(){return{candidate:augmentedCandidate.candidate,sdpMid:augmentedCandidate.sdpMid,sdpMLineIndex:augmentedCandidate.sdpMLineIndex,usernameFragment:augmentedCandidate.usernameFragment,};};return augmentedCandidate;};wrapPeerConnectionEvent(window,'icecandidate',function(e){if(e.candidate){Object.defineProperty(e,'candidate',{value:new window.RTCIceCandidate(e.candidate),writable:'false'});} +return e;});},shimCreateObjectURL:function(window){var URL=window&&window.URL;if(!(typeof window==='object'&&window.HTMLMediaElement&&'srcObject'in window.HTMLMediaElement.prototype&&URL.createObjectURL&&URL.revokeObjectURL)){return undefined;} +var nativeCreateObjectURL=URL.createObjectURL.bind(URL);var nativeRevokeObjectURL=URL.revokeObjectURL.bind(URL);var streams=new Map(),newId=0;URL.createObjectURL=function(stream){if('getTracks'in stream){var url='polyblob:'+(++newId);streams.set(url,stream);utils.deprecated('URL.createObjectURL(stream)','elem.srcObject = stream');return url;} +return nativeCreateObjectURL(stream);};URL.revokeObjectURL=function(url){nativeRevokeObjectURL(url);streams.delete(url);};var dsc=Object.getOwnPropertyDescriptor(window.HTMLMediaElement.prototype,'src');Object.defineProperty(window.HTMLMediaElement.prototype,'src',{get:function(){return dsc.get.apply(this);},set:function(url){this.srcObject=streams.get(url)||null;return dsc.set.apply(this,[url]);}});var nativeSetAttribute=window.HTMLMediaElement.prototype.setAttribute;window.HTMLMediaElement.prototype.setAttribute=function(){if(arguments.length===2&&(''+arguments[0]).toLowerCase()==='src'){this.srcObject=streams.get(arguments[1])||null;} +return nativeSetAttribute.apply(this,arguments);};}};},{"./utils":13,"sdp":2}],8:[function(require,module,exports){'use strict';var utils=require('../utils');var shimRTCPeerConnection=require('rtcpeerconnection-shim');module.exports={shimGetUserMedia:require('./getusermedia'),shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(window.RTCIceGatherer){if(!window.RTCIceCandidate){window.RTCIceCandidate=function(args){return args;};} if(!window.RTCSessionDescription){window.RTCSessionDescription=function(args){return args;};} if(browserDetails.version<15025){var origMSTEnabled=Object.getOwnPropertyDescriptor(window.MediaStreamTrack.prototype,'enabled');Object.defineProperty(window.MediaStreamTrack.prototype,'enabled',{set:function(value){origMSTEnabled.set.call(this,value);var ev=new Event('enabled');ev.enabled=value;this.dispatchEvent(ev);}});}} -window.RTCPeerConnection=shimRTCPeerConnection(window,browserDetails.version);},shimReplaceTrack:function(window){if(window.RTCRtpSender&&!('replaceTrack'in window.RTCRtpSender.prototype)){window.RTCRtpSender.prototype.replaceTrack=window.RTCRtpSender.prototype.setTrack;}}};},{"../utils":12,"./getusermedia":7,"./rtcpeerconnection_shim":8}],7:[function(require,module,exports){'use strict';module.exports=function(window){var navigator=window&&window.navigator;var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError'}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name;}};};var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(c){return origGetUserMedia(c).catch(function(e){return Promise.reject(shimError_(e));});};};},{}],8:[function(require,module,exports){'use strict';var SDPUtils=require('sdp');function sortTracks(tracks){var audioTracks=tracks.filter(function(track){return track.kind==='audio';});var videoTracks=tracks.filter(function(track){return track.kind==='video';});tracks=[];while(audioTracks.length||videoTracks.length){if(audioTracks.length){tracks.push(audioTracks.shift());} -if(videoTracks.length){tracks.push(videoTracks.shift());}} -return tracks;} -function filterIceServers(iceServers,edgeVersion){var hasTurn=false;iceServers=JSON.parse(JSON.stringify(iceServers));return iceServers.filter(function(server){if(server&&(server.urls||server.url)){var urls=server.urls||server.url;if(server.url&&!server.urls){console.warn('RTCIceServer.url is deprecated! Use urls instead.');} -var isString=typeof urls==='string';if(isString){urls=[urls];} -urls=urls.filter(function(url){var validTurn=url.indexOf('turn:')===0&&url.indexOf('transport=udp')!==-1&&url.indexOf('turn:[')===-1&&!hasTurn;if(validTurn){hasTurn=true;return true;} -return url.indexOf('stun:')===0&&edgeVersion>=14393;});delete server.url;server.urls=isString?urls[0]:urls;return!!urls.length;} -return false;});} -function getCommonCapabilities(localCapabilities,remoteCapabilities){var commonCapabilities={codecs:[],headerExtensions:[],fecMechanisms:[]};var findCodecByPayloadType=function(pt,codecs){pt=parseInt(pt,10);for(var i=0;i0;var transceiver={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:kind,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,wantReceive:true};if(this.usingBundle&&hasBundleTransport){transceiver.iceTransport=this.transceivers[0].iceTransport;transceiver.dtlsTransport=this.transceivers[0].dtlsTransport;}else{var transports=this._createIceAndDtlsTransports();transceiver.iceTransport=transports.iceTransport;transceiver.dtlsTransport=transports.dtlsTransport;} -this.transceivers.push(transceiver);return transceiver;};RTCPeerConnection.prototype.addTrack=function(track,stream){var transceiver;for(var i=0;i=15025){this.localStreams.push(stream);stream.getTracks().forEach(function(track){self.addTrack(track,stream);});}else{var clonedStream=stream.clone();stream.getTracks().forEach(function(track,idx){var clonedTrack=clonedStream.getTracks()[idx];track.addEventListener('enabled',function(event){clonedTrack.enabled=event.enabled;});});clonedStream.getTracks().forEach(function(track){self.addTrack(track,clonedStream);});this.localStreams.push(clonedStream);} -this._maybeFireNegotiationNeeded();};RTCPeerConnection.prototype.removeStream=function(stream){var idx=this.localStreams.indexOf(stream);if(idx>-1){this.localStreams.splice(idx,1);this._maybeFireNegotiationNeeded();}};RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpSender;}).map(function(transceiver){return transceiver.rtpSender;});};RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpReceiver;}).map(function(transceiver){return transceiver.rtpReceiver;});};RTCPeerConnection.prototype._createIceGatherer=function(mid,sdpMLineIndex){var self=this;var iceGatherer=new window.RTCIceGatherer(self.iceOptions);iceGatherer.onlocalcandidate=function(evt){var event=new Event('icecandidate');event.candidate={sdpMid:mid,sdpMLineIndex:sdpMLineIndex};var cand=evt.candidate;var end=!cand||Object.keys(cand).length===0;if(end){if(iceGatherer.state===undefined){iceGatherer.state='completed';}}else{cand.component=1;event.candidate.candidate=SDPUtils.writeCandidate(cand);} -var sections=SDPUtils.splitSections(self.localDescription.sdp);if(!end){sections[event.candidate.sdpMLineIndex+1]+='a='+event.candidate.candidate+'\r\n';}else{sections[event.candidate.sdpMLineIndex+1]+='a=end-of-candidates\r\n';} -self.localDescription.sdp=sections.join('');var transceivers=self._pendingOffer?self._pendingOffer:self.transceivers;var complete=transceivers.every(function(transceiver){return transceiver.iceGatherer&&transceiver.iceGatherer.state==='completed';});switch(self.iceGatheringState){case'new':if(!end){self._localIceCandidatesBuffer.push(event);} -if(end&&complete){self._localIceCandidatesBuffer.push(new Event('icecandidate'));} -break;case'gathering':self._emitBufferedCandidates();if(!end){self.dispatchEvent(event);if(self.onicecandidate!==null){self.onicecandidate(event);}} -if(complete){self.dispatchEvent(new Event('icecandidate'));if(self.onicecandidate!==null){self.onicecandidate(new Event('icecandidate'));} -self.iceGatheringState='complete';self._emitGatheringStateChange();} -break;case'complete':break;default:break;}};return iceGatherer;};RTCPeerConnection.prototype._createIceAndDtlsTransports=function(){var self=this;var iceTransport=new window.RTCIceTransport(null);iceTransport.onicestatechange=function(){self._updateConnectionState();};var dtlsTransport=new window.RTCDtlsTransport(iceTransport);dtlsTransport.ondtlsstatechange=function(){self._updateConnectionState();};dtlsTransport.onerror=function(){Object.defineProperty(dtlsTransport,'state',{value:'failed',writable:true});self._updateConnectionState();};return{iceTransport:iceTransport,dtlsTransport:dtlsTransport};};RTCPeerConnection.prototype._disposeIceAndDtlsTransports=function(sdpMLineIndex){var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer){delete iceGatherer.onlocalcandidate;delete this.transceivers[sdpMLineIndex].iceGatherer;} -var iceTransport=this.transceivers[sdpMLineIndex].iceTransport;if(iceTransport){delete iceTransport.onicestatechange;delete this.transceivers[sdpMLineIndex].iceTransport;} -var dtlsTransport=this.transceivers[sdpMLineIndex].dtlsTransport;if(dtlsTransport){delete dtlsTransport.ondtlssttatechange;delete dtlsTransport.onerror;delete this.transceivers[sdpMLineIndex].dtlsTransport;}};RTCPeerConnection.prototype._transceive=function(transceiver,send,recv){var params=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);if(send&&transceiver.rtpSender){params.encodings=transceiver.sendEncodingParameters;params.rtcp={cname:SDPUtils.localCName,compound:transceiver.rtcpParameters.compound};if(transceiver.recvEncodingParameters.length){params.rtcp.ssrc=transceiver.recvEncodingParameters[0].ssrc;} -transceiver.rtpSender.send(params);} -if(recv&&transceiver.rtpReceiver){if(transceiver.kind==='video'&&transceiver.recvEncodingParameters&&edgeVersion<15019){transceiver.recvEncodingParameters.forEach(function(p){delete p.rtx;});} -params.encodings=transceiver.recvEncodingParameters;params.rtcp={cname:transceiver.rtcpParameters.cname,compound:transceiver.rtcpParameters.compound};if(transceiver.sendEncodingParameters.length){params.rtcp.ssrc=transceiver.sendEncodingParameters[0].ssrc;} -transceiver.rtpReceiver.receive(params);}};RTCPeerConnection.prototype.setLocalDescription=function(description){var self=this;if(!isActionAllowedInSignalingState('setLocalDescription',description.type,this.signalingState)){var e=new Error('Can not set local '+description.type+' in state '+this.signalingState);e.name='InvalidStateError';if(arguments.length>2&&typeof arguments[2]==='function'){window.setTimeout(arguments[2],0,e);} -return Promise.reject(e);} -var sections;var sessionpart;if(description.type==='offer'){if(this._pendingOffer){sections=SDPUtils.splitSections(description.sdp);sessionpart=sections.shift();sections.forEach(function(mediaSection,sdpMLineIndex){var caps=SDPUtils.parseRtpParameters(mediaSection);self._pendingOffer[sdpMLineIndex].localCapabilities=caps;});this.transceivers=this._pendingOffer;delete this._pendingOffer;}}else if(description.type==='answer'){sections=SDPUtils.splitSections(self.remoteDescription.sdp);sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;sections.forEach(function(mediaSection,sdpMLineIndex){var transceiver=self.transceivers[sdpMLineIndex];var iceGatherer=transceiver.iceGatherer;var iceTransport=transceiver.iceTransport;var dtlsTransport=transceiver.dtlsTransport;var localCapabilities=transceiver.localCapabilities;var remoteCapabilities=transceiver.remoteCapabilities;var rejected=SDPUtils.isRejected(mediaSection);if(!rejected&&!transceiver.isDatachannel){var remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);var remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);if(isIceLite){remoteDtlsParameters.role='server';} -if(!self.usingBundle||sdpMLineIndex===0){iceTransport.start(iceGatherer,remoteIceParameters,isIceLite?'controlling':'controlled');dtlsTransport.start(remoteDtlsParameters);} -var params=getCommonCapabilities(localCapabilities,remoteCapabilities);self._transceive(transceiver,params.codecs.length>0,false);}});} -this.localDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-local-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} -var hasCallback=arguments.length>1&&typeof arguments[1]==='function';if(hasCallback){var cb=arguments[1];window.setTimeout(function(){cb();if(self.iceGatheringState==='new'){self.iceGatheringState='gathering';self._emitGatheringStateChange();} -self._emitBufferedCandidates();},0);} -var p=Promise.resolve();p.then(function(){if(!hasCallback){if(self.iceGatheringState==='new'){self.iceGatheringState='gathering';self._emitGatheringStateChange();} -window.setTimeout(self._emitBufferedCandidates.bind(self),500);}});return p;};RTCPeerConnection.prototype.setRemoteDescription=function(description){var self=this;if(!isActionAllowedInSignalingState('setRemoteDescription',description.type,this.signalingState)){var e=new Error('Can not set remote '+description.type+' in state '+this.signalingState);e.name='InvalidStateError';if(arguments.length>2&&typeof arguments[2]==='function'){window.setTimeout(arguments[2],0,e);} -return Promise.reject(e);} -var streams={};var receiverList=[];var sections=SDPUtils.splitSections(description.sdp);var sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;var usingBundle=SDPUtils.matchPrefix(sessionpart,'a=group:BUNDLE ').length>0;this.usingBundle=usingBundle;var iceOptions=SDPUtils.matchPrefix(sessionpart,'a=ice-options:')[0];if(iceOptions){this.canTrickleIceCandidates=iceOptions.substr(14).split(' ').indexOf('trickle')>=0;}else{this.canTrickleIceCandidates=false;} -sections.forEach(function(mediaSection,sdpMLineIndex){var lines=SDPUtils.splitLines(mediaSection);var kind=SDPUtils.getKind(mediaSection);var rejected=SDPUtils.isRejected(mediaSection);var protocol=lines[0].substr(2).split(' ')[2];var direction=SDPUtils.getDirection(mediaSection,sessionpart);var remoteMsid=SDPUtils.parseMsid(mediaSection);var mid=SDPUtils.getMid(mediaSection)||SDPUtils.generateIdentifier();if(kind==='application'&&protocol==='DTLS/SCTP'){self.transceivers[sdpMLineIndex]={mid:mid,isDatachannel:true};return;} -var transceiver;var iceGatherer;var iceTransport;var dtlsTransport;var rtpReceiver;var sendEncodingParameters;var recvEncodingParameters;var localCapabilities;var track;var remoteCapabilities=SDPUtils.parseRtpParameters(mediaSection);var remoteIceParameters;var remoteDtlsParameters;if(!rejected){remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);remoteDtlsParameters.role='client';} -recvEncodingParameters=SDPUtils.parseRtpEncodingParameters(mediaSection);var rtcpParameters=SDPUtils.parseRtcpParameters(mediaSection);var isComplete=SDPUtils.matchPrefix(mediaSection,'a=end-of-candidates',sessionpart).length>0;var cands=SDPUtils.matchPrefix(mediaSection,'a=candidate:').map(function(cand){return SDPUtils.parseCandidate(cand);}).filter(function(cand){return cand.component==='1'||cand.component===1;});if((description.type==='offer'||description.type==='answer')&&!rejected&&usingBundle&&sdpMLineIndex>0&&self.transceivers[sdpMLineIndex]){self._disposeIceAndDtlsTransports(sdpMLineIndex);self.transceivers[sdpMLineIndex].iceGatherer=self.transceivers[0].iceGatherer;self.transceivers[sdpMLineIndex].iceTransport=self.transceivers[0].iceTransport;self.transceivers[sdpMLineIndex].dtlsTransport=self.transceivers[0].dtlsTransport;if(self.transceivers[sdpMLineIndex].rtpSender){self.transceivers[sdpMLineIndex].rtpSender.setTransport(self.transceivers[0].dtlsTransport);} -if(self.transceivers[sdpMLineIndex].rtpReceiver){self.transceivers[sdpMLineIndex].rtpReceiver.setTransport(self.transceivers[0].dtlsTransport);}} -if(description.type==='offer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex]||self._createTransceiver(kind);transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=usingBundle&&sdpMLineIndex>0?self.transceivers[0].iceGatherer:self._createIceGatherer(mid,sdpMLineIndex);} -if(isComplete&&(!usingBundle||sdpMLineIndex===0)){transceiver.iceTransport.setRemoteCandidates(cands);} -localCapabilities=window.RTCRtpReceiver.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} -sendEncodingParameters=[{ssrc:(2*sdpMLineIndex+2)*1001}];if(direction==='sendrecv'||direction==='sendonly'){rtpReceiver=new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();Object.defineProperty(streams[remoteMsid.stream],'id',{get:function(){return remoteMsid.stream;}});} -Object.defineProperty(track,'id',{get:function(){return remoteMsid.track;}});streams[remoteMsid.stream].addTrack(track);receiverList.push([track,rtpReceiver,streams[remoteMsid.stream]]);}else{if(!streams.default){streams.default=new window.MediaStream();} -streams.default.addTrack(track);receiverList.push([track,rtpReceiver,streams.default]);}} -transceiver.localCapabilities=localCapabilities;transceiver.remoteCapabilities=remoteCapabilities;transceiver.rtpReceiver=rtpReceiver;transceiver.rtcpParameters=rtcpParameters;transceiver.sendEncodingParameters=sendEncodingParameters;transceiver.recvEncodingParameters=recvEncodingParameters;self._transceive(self.transceivers[sdpMLineIndex],false,direction==='sendrecv'||direction==='sendonly');}else if(description.type==='answer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex];iceGatherer=transceiver.iceGatherer;iceTransport=transceiver.iceTransport;dtlsTransport=transceiver.dtlsTransport;rtpReceiver=transceiver.rtpReceiver;sendEncodingParameters=transceiver.sendEncodingParameters;localCapabilities=transceiver.localCapabilities;self.transceivers[sdpMLineIndex].recvEncodingParameters=recvEncodingParameters;self.transceivers[sdpMLineIndex].remoteCapabilities=remoteCapabilities;self.transceivers[sdpMLineIndex].rtcpParameters=rtcpParameters;if((isIceLite||isComplete)&&cands.length){iceTransport.setRemoteCandidates(cands);} -if(!usingBundle||sdpMLineIndex===0){iceTransport.start(iceGatherer,remoteIceParameters,'controlling');dtlsTransport.start(remoteDtlsParameters);} -self._transceive(transceiver,direction==='sendrecv'||direction==='recvonly',direction==='sendrecv'||direction==='sendonly');if(rtpReceiver&&(direction==='sendrecv'||direction==='sendonly')){track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();} -streams[remoteMsid.stream].addTrack(track);receiverList.push([track,rtpReceiver,streams[remoteMsid.stream]]);}else{if(!streams.default){streams.default=new window.MediaStream();} -streams.default.addTrack(track);receiverList.push([track,rtpReceiver,streams.default]);}}else{delete transceiver.rtpReceiver;}}});this.remoteDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-remote-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} -Object.keys(streams).forEach(function(sid){var stream=streams[sid];if(stream.getTracks().length){self.remoteStreams.push(stream);var event=new Event('addstream');event.stream=stream;self.dispatchEvent(event);if(self.onaddstream!==null){window.setTimeout(function(){self.onaddstream(event);},0);} -receiverList.forEach(function(item){var track=item[0];var receiver=item[1];if(stream.id!==item[2].id){return;} -var trackEvent=new Event('track');trackEvent.track=track;trackEvent.receiver=receiver;trackEvent.streams=[stream];self.dispatchEvent(trackEvent);if(self.ontrack!==null){window.setTimeout(function(){self.ontrack(trackEvent);},0);}});}});window.setTimeout(function(){if(!(self&&self.transceivers)){return;} -self.transceivers.forEach(function(transceiver){if(transceiver.iceTransport&&transceiver.iceTransport.state==='new'&&transceiver.iceTransport.getRemoteCandidates().length>0){console.warn('Timeout for addRemoteCandidate. Consider sending '+'an end-of-candidates notification');transceiver.iceTransport.addRemoteCandidate({});}});},4000);if(arguments.length>1&&typeof arguments[1]==='function'){window.setTimeout(arguments[1],0);} -return Promise.resolve();};RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(transceiver){if(transceiver.iceTransport){transceiver.iceTransport.stop();} -if(transceiver.dtlsTransport){transceiver.dtlsTransport.stop();} -if(transceiver.rtpSender){transceiver.rtpSender.stop();} -if(transceiver.rtpReceiver){transceiver.rtpReceiver.stop();}});this._updateSignalingState('closed');};RTCPeerConnection.prototype._updateSignalingState=function(newState){this.signalingState=newState;var event=new Event('signalingstatechange');this.dispatchEvent(event);if(this.onsignalingstatechange!==null){this.onsignalingstatechange(event);}};RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var self=this;if(this.signalingState!=='stable'||this.needNegotiation===true){return;} -this.needNegotiation=true;window.setTimeout(function(){if(self.needNegotiation===false){return;} -self.needNegotiation=false;var event=new Event('negotiationneeded');self.dispatchEvent(event);if(self.onnegotiationneeded!==null){self.onnegotiationneeded(event);}},0);};RTCPeerConnection.prototype._updateConnectionState=function(){var self=this;var newState;var states={'new':0,closed:0,connecting:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};this.transceivers.forEach(function(transceiver){states[transceiver.iceTransport.state]++;states[transceiver.dtlsTransport.state]++;});states.connected+=states.completed;newState='new';if(states.failed>0){newState='failed';}else if(states.connecting>0||states.checking>0){newState='connecting';}else if(states.disconnected>0){newState='disconnected';}else if(states.new>0){newState='new';}else if(states.connected>0||states.completed>0){newState='connected';} -if(newState!==self.iceConnectionState){self.iceConnectionState=newState;var event=new Event('iceconnectionstatechange');this.dispatchEvent(event);if(this.oniceconnectionstatechange!==null){this.oniceconnectionstatechange(event);}}};RTCPeerConnection.prototype.createOffer=function(){var self=this;if(this._pendingOffer){throw new Error('createOffer called while there is a pending offer.');} -var offerOptions;if(arguments.length===1&&typeof arguments[0]!=='function'){offerOptions=arguments[0];}else if(arguments.length===3){offerOptions=arguments[2];} -var numAudioTracks=this.transceivers.filter(function(t){return t.kind==='audio';}).length;var numVideoTracks=this.transceivers.filter(function(t){return t.kind==='video';}).length;if(offerOptions){if(offerOptions.mandatory||offerOptions.optional){throw new TypeError('Legacy mandatory/optional constraints not supported.');} -if(offerOptions.offerToReceiveAudio!==undefined){if(offerOptions.offerToReceiveAudio===true){numAudioTracks=1;}else if(offerOptions.offerToReceiveAudio===false){numAudioTracks=0;}else{numAudioTracks=offerOptions.offerToReceiveAudio;}} -if(offerOptions.offerToReceiveVideo!==undefined){if(offerOptions.offerToReceiveVideo===true){numVideoTracks=1;}else if(offerOptions.offerToReceiveVideo===false){numVideoTracks=0;}else{numVideoTracks=offerOptions.offerToReceiveVideo;}}} -this.transceivers.forEach(function(transceiver){if(transceiver.kind==='audio'){numAudioTracks--;if(numAudioTracks<0){transceiver.wantReceive=false;}}else if(transceiver.kind==='video'){numVideoTracks--;if(numVideoTracks<0){transceiver.wantReceive=false;}}});while(numAudioTracks>0||numVideoTracks>0){if(numAudioTracks>0){this._createTransceiver('audio');numAudioTracks--;} -if(numVideoTracks>0){this._createTransceiver('video');numVideoTracks--;}} -var transceivers=sortTracks(this.transceivers);var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId);transceivers.forEach(function(transceiver,sdpMLineIndex){var track=transceiver.track;var kind=transceiver.kind;var mid=SDPUtils.generateIdentifier();transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=self.usingBundle&&sdpMLineIndex>0?transceivers[0].iceGatherer:self._createIceGatherer(mid,sdpMLineIndex);} -var localCapabilities=window.RTCRtpSender.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} -localCapabilities.codecs.forEach(function(codec){if(codec.name==='H264'&&codec.parameters['level-asymmetry-allowed']===undefined){codec.parameters['level-asymmetry-allowed']='1';}});var sendEncodingParameters=[{ssrc:(2*sdpMLineIndex+1)*1001}];if(track){if(edgeVersion>=15019&&kind==='video'){sendEncodingParameters[0].rtx={ssrc:(2*sdpMLineIndex+1)*1001+1};}} -if(transceiver.wantReceive){transceiver.rtpReceiver=new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);} -transceiver.localCapabilities=localCapabilities;transceiver.sendEncodingParameters=sendEncodingParameters;});if(this._config.bundlePolicy!=='max-compat'){sdp+='a=group:BUNDLE '+transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} -sdp+='a=ice-options:trickle\r\n';transceivers.forEach(function(transceiver,sdpMLineIndex){sdp+=SDPUtils.writeMediaSection(transceiver,transceiver.localCapabilities,'offer',transceiver.stream);sdp+='a=rtcp-rsize\r\n';});this._pendingOffer=transceivers;var desc=new window.RTCSessionDescription({type:'offer',sdp:sdp});if(arguments.length&&typeof arguments[0]==='function'){window.setTimeout(arguments[0],0,desc);} -return Promise.resolve(desc);};RTCPeerConnection.prototype.createAnswer=function(){var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId);if(this.usingBundle){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} -this.transceivers.forEach(function(transceiver,sdpMLineIndex){if(transceiver.isDatachannel){sdp+='m=application 0 DTLS/SCTP 5000\r\n'+'c=IN IP4 0.0.0.0\r\n'+'a=mid:'+transceiver.mid+'\r\n';return;} -if(transceiver.stream){var localTrack;if(transceiver.kind==='audio'){localTrack=transceiver.stream.getAudioTracks()[0];}else if(transceiver.kind==='video'){localTrack=transceiver.stream.getVideoTracks()[0];} -if(localTrack){if(edgeVersion>=15019&&transceiver.kind==='video'){transceiver.sendEncodingParameters[0].rtx={ssrc:(2*sdpMLineIndex+2)*1001+1};}}} -var commonCapabilities=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);var hasRtx=commonCapabilities.codecs.filter(function(c){return c.name.toLowerCase()==='rtx';}).length;if(!hasRtx&&transceiver.sendEncodingParameters[0].rtx){delete transceiver.sendEncodingParameters[0].rtx;} -sdp+=SDPUtils.writeMediaSection(transceiver,commonCapabilities,'answer',transceiver.stream);if(transceiver.rtcpParameters&&transceiver.rtcpParameters.reducedSize){sdp+='a=rtcp-rsize\r\n';}});var desc=new window.RTCSessionDescription({type:'answer',sdp:sdp});if(arguments.length&&typeof arguments[0]==='function'){window.setTimeout(arguments[0],0,desc);} -return Promise.resolve(desc);};RTCPeerConnection.prototype.addIceCandidate=function(candidate){if(!candidate){for(var j=0;j0?SDPUtils.parseCandidate(candidate.candidate):{};if(cand.protocol==='tcp'&&(cand.port===0||cand.port===9)){return Promise.resolve();} -if(cand.component&&!(cand.component==='1'||cand.component===1)){return Promise.resolve();} -transceiver.iceTransport.addRemoteCandidate(cand);var sections=SDPUtils.splitSections(this.remoteDescription.sdp);sections[mLineIndex+1]+=(cand.type?candidate.candidate.trim():'a=end-of-candidates')+'\r\n';this.remoteDescription.sdp=sections.join('');}} -if(arguments.length>1&&typeof arguments[1]==='function'){window.setTimeout(arguments[1],0);} -return Promise.resolve();};RTCPeerConnection.prototype.getStats=function(){var promises=[];this.transceivers.forEach(function(transceiver){['rtpSender','rtpReceiver','iceGatherer','iceTransport','dtlsTransport'].forEach(function(method){if(transceiver[method]){promises.push(transceiver[method].getStats());}});});var cb=arguments.length>1&&typeof arguments[1]==='function'&&arguments[1];var fixStatsType=function(stat){return{inboundrtp:'inbound-rtp',outboundrtp:'outbound-rtp',candidatepair:'candidate-pair',localcandidate:'local-candidate',remotecandidate:'remote-candidate'}[stat.type]||stat.type;};return new Promise(function(resolve){var results=new Map();Promise.all(promises).then(function(res){res.forEach(function(result){Object.keys(result).forEach(function(id){result[id].type=fixStatsType(result[id]);results.set(id,result[id]);});});if(cb){window.setTimeout(cb,0,results);} -resolve(results);});});};return RTCPeerConnection;};},{"sdp":1}],9:[function(require,module,exports){'use strict';var utils=require('../utils');var firefoxShim={shimOnTrack:function(window){if(typeof window==='object'&&window.RTCPeerConnection&&!('ontrack'in +if(window.RTCRtpSender&&!('dtmf'in window.RTCRtpSender.prototype)){Object.defineProperty(window.RTCRtpSender.prototype,'dtmf',{get:function(){if(this._dtmf===undefined){if(this.track.kind==='audio'){this._dtmf=new window.RTCDtmfSender(this);}else if(this.track.kind==='video'){this._dtmf=null;}} +return this._dtmf;}});} +window.RTCPeerConnection=shimRTCPeerConnection(window,browserDetails.version);},shimReplaceTrack:function(window){if(window.RTCRtpSender&&!('replaceTrack'in window.RTCRtpSender.prototype)){window.RTCRtpSender.prototype.replaceTrack=window.RTCRtpSender.prototype.setTrack;}}};},{"../utils":13,"./getusermedia":9,"rtcpeerconnection-shim":1}],9:[function(require,module,exports){'use strict';module.exports=function(window){var navigator=window&&window.navigator;var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError'}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name;}};};var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(c){return origGetUserMedia(c).catch(function(e){return Promise.reject(shimError_(e));});};};},{}],10:[function(require,module,exports){'use strict';var utils=require('../utils');var firefoxShim={shimOnTrack:function(window){if(typeof window==='object'&&window.RTCPeerConnection&&!('ontrack'in window.RTCPeerConnection.prototype)){Object.defineProperty(window.RTCPeerConnection.prototype,'ontrack',{get:function(){return this._ontrack;},set:function(f){if(this._ontrack){this.removeEventListener('track',this._ontrack);this.removeEventListener('addstream',this._ontrackpoly);} -this.addEventListener('track',this._ontrack=f);this.addEventListener('addstream',this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(track){var event=new Event('track');event.track=track;event.receiver={track:track};event.streams=[e.stream];this.dispatchEvent(event);}.bind(this));}.bind(this));}});}},shimSourceObject:function(window){if(typeof window==='object'){if(window.HTMLMediaElement&&!('srcObject'in window.HTMLMediaElement.prototype)){Object.defineProperty(window.HTMLMediaElement.prototype,'srcObject',{get:function(){return this.mozSrcObject;},set:function(stream){this.mozSrcObject=stream;}});}}},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(typeof window!=='object'||!(window.RTCPeerConnection||window.mozRTCPeerConnection)){return;} +this.addEventListener('track',this._ontrack=f);this.addEventListener('addstream',this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(track){var event=new Event('track');event.track=track;event.receiver={track:track};event.transceiver={receiver:event.receiver};event.streams=[e.stream];this.dispatchEvent(event);}.bind(this));}.bind(this));}});} +if(typeof window==='object'&&window.RTCTrackEvent&&('receiver'in window.RTCTrackEvent.prototype)&&!('transceiver'in window.RTCTrackEvent.prototype)){Object.defineProperty(window.RTCTrackEvent.prototype,'transceiver',{get:function(){return{receiver:this.receiver};}});}},shimSourceObject:function(window){if(typeof window==='object'){if(window.HTMLMediaElement&&!('srcObject'in window.HTMLMediaElement.prototype)){Object.defineProperty(window.HTMLMediaElement.prototype,'srcObject',{get:function(){return this.mozSrcObject;},set:function(stream){this.mozSrcObject=stream;}});}}},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(typeof window!=='object'||!(window.RTCPeerConnection||window.mozRTCPeerConnection)){return;} if(!window.RTCPeerConnection){window.RTCPeerConnection=function(pcConfig,pcConstraints){if(browserDetails.version<38){if(pcConfig&&pcConfig.iceServers){var newIceServers=[];for(var i=0;i=pos&&parseInt(match[pos],10);},detectBrowser:function(window){var navigator=window&&window.navigator;var result={};result.browser=null;result.version=null;if(typeof window==='undefined'||!window.navigator){result.browser='Not a browser.';return result;} if(navigator.mozGetUserMedia){result.browser='firefox';result.version=this.extractVersion(navigator.userAgent,/Firefox\/(\d+)\./,1);}else if(navigator.webkitGetUserMedia){if(window.webkitRTCPeerConnection){result.browser='chrome';result.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/(\d+)\./,2);}else{if(navigator.userAgent.match(/Version\/(\d+).(\d+)/)){result.browser='safari';result.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1);}else{result.browser='Unsupported webkit-based browser '+'with GUM support but no WebRTC support.';return result;}}}else if(navigator.mediaDevices&&navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)){result.browser='edge';result.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2);}else if(navigator.mediaDevices&&navigator.userAgent.match(/AppleWebKit\/(\d+)\./)){result.browser='safari';result.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1);}else{result.browser='Not a supported browser.';return result;} -return result;},shimCreateObjectURL:function(window){var URL=window&&window.URL;if(!(typeof window==='object'&&window.HTMLMediaElement&&'srcObject'in window.HTMLMediaElement.prototype)){return undefined;} -var nativeCreateObjectURL=URL.createObjectURL.bind(URL);var nativeRevokeObjectURL=URL.revokeObjectURL.bind(URL);var streams=new Map(),newId=0;URL.createObjectURL=function(stream){if('getTracks'in stream){var url='polyblob:'+(++newId);streams.set(url,stream);utils.deprecated('URL.createObjectURL(stream)','elem.srcObject = stream');return url;} -return nativeCreateObjectURL(stream);};URL.revokeObjectURL=function(url){nativeRevokeObjectURL(url);streams.delete(url);};var dsc=Object.getOwnPropertyDescriptor(window.HTMLMediaElement.prototype,'src');Object.defineProperty(window.HTMLMediaElement.prototype,'src',{get:function(){return dsc.get.apply(this);},set:function(url){this.srcObject=streams.get(url)||null;return dsc.set.apply(this,[url]);}});var nativeSetAttribute=window.HTMLMediaElement.prototype.setAttribute;window.HTMLMediaElement.prototype.setAttribute=function(){if(arguments.length===2&&(''+arguments[0]).toLowerCase()==='src'){this.srcObject=streams.get(arguments[1])||null;} -return nativeSetAttribute.apply(this,arguments);};}};module.exports={log:utils.log,deprecated:utils.deprecated,disableLog:utils.disableLog,disableWarnings:utils.disableWarnings,extractVersion:utils.extractVersion,shimCreateObjectURL:utils.shimCreateObjectURL,detectBrowser:utils.detectBrowser.bind(utils)};},{}]},{},[2])(2)}); \ No newline at end of file +return result;},};module.exports={log:utils.log,deprecated:utils.deprecated,disableLog:utils.disableLog,disableWarnings:utils.disableWarnings,extractVersion:utils.extractVersion,shimCreateObjectURL:utils.shimCreateObjectURL,detectBrowser:utils.detectBrowser.bind(utils)};},{}]},{},[3])(3)}); \ No newline at end of file diff --git a/html5/verto/video_demo/js/verto-min.js b/html5/verto/video_demo/js/verto-min.js index c93b8aca64..fdf5432fa5 100644 --- a/html5/verto/video_demo/js/verto-min.js +++ b/html5/verto/video_demo/js/verto-min.js @@ -56,7 +56,7 @@ function onSuccess(stream){self.localStream=stream;if(screen){self.constraints.o self.peer=FSRTCPeerConnection({type:self.type,attachStream:self.localStream,onICE:function(candidate){return onICE(self,candidate);},onICEComplete:function(){return onICEComplete(self);},onRemoteStream:screen?function(stream){}:function(stream){return onRemoteStream(self,stream);},onOfferSDP:function(sdp){return onOfferSDP(self,sdp);},onICESDP:function(sdp){return onICESDP(self,sdp);},onChannelError:function(e){return onChannelError(self,e);},constraints:self.constraints,iceServers:self.options.iceServers,});onStreamSuccess(self,stream);} function onError(e){onStreamError(self,e);} var mediaParams=getMediaParams(self);console.log("Audio constraints",mediaParams.audio);console.log("Video constraints",mediaParams.video);if(mediaParams.audio||mediaParams.video){getUserMedia({constraints:{audio:mediaParams.audio,video:mediaParams.video},video:mediaParams.useVideo,onsuccess:onSuccess,onerror:onError});}else{onSuccess(null);}};function FSRTCPeerConnection(options){var gathering=false,done=false;var config={};var default_ice={urls:['stun:stun.l.google.com:19302']};if(options.iceServers){if(typeof(options.iceServers)==="boolean"){config.iceServers=[default_ice];}else{config.iceServers=options.iceServers;}} -var peer=new window.RTCPeerConnection(config);openOffererChannel();var x=0;function ice_handler(){done=true;gathering=null;if(options.onICEComplete){options.onICEComplete();} +config.bundlePolicy="max-compat";var peer=new window.RTCPeerConnection(config);openOffererChannel();var x=0;function ice_handler(){done=true;gathering=null;if(options.onICEComplete){options.onICEComplete();} if(options.type=="offer"){options.onICESDP(peer.localDescription);}else{if(!x&&options.onICESDP){options.onICESDP(peer.localDescription);}}} peer.onicecandidate=function(event){if(done){return;} if(!gathering){gathering=setTimeout(ice_handler,1000);} @@ -163,6 +163,7 @@ if(sendChannels.length){verto.sendMethod("verto.unsubscribe",{eventChannel:sendC verto.sendMethod("verto.broadcast",msg);};$.verto.prototype.purge=function(callID){var verto=this;var x=0;var i;for(i in verto.dialogs){if(!x){console.log("purging dialogs");} x++;verto.dialogs[i].setState($.verto.enum.state.purge);} for(i in verto.eventSUBS){if(verto.eventSUBS[i]){console.log("purging subscription: "+i);delete verto.eventSUBS[i];}}};$.verto.prototype.hangup=function(callID){var verto=this;if(callID){var dialog=verto.dialogs[callID];if(dialog){dialog.hangup();}}else{for(var i in verto.dialogs){verto.dialogs[i].hangup();}}};$.verto.prototype.newCall=function(args,callbacks){var verto=this;if(!verto.rpcClient.socketReady()){console.error("Not Connected...");return;} +if(args["useCamera"]){verto.options.deviceParams["useCamera"]=args["useCamera"];} var dialog=new $.verto.dialog($.verto.enum.direction.outbound,this,args);dialog.invite();if(callbacks){dialog.callbacks=callbacks;} return dialog;};$.verto.prototype.handleMessage=function(data){var verto=this;if(!(data&&data.method)){console.error("Invalid Data",data);return;} if(data.params.callID){var dialog=verto.dialogs[data.params.callID];if(data.method==="verto.attach"&&dialog){delete dialog.verto.dialogs[dialog.callID];dialog.rtc.stop();dialog=null;} @@ -306,8 +307,120 @@ navigator.getUserMedia({audio:(has_audio>0?true:false),video:(has_video>0?true:f navigator.mediaDevices.enumerateDevices().then(checkTypes).catch(handleError);};$.verto.refreshDevices=function(runtime){checkDevices(runtime);} $.verto.init=function(obj,runtime){if(!obj){obj={};} if(!obj.skipPermCheck&&!obj.skipDeviceCheck){$.FSRTC.checkPerms(function(status){checkDevices(runtime);},true,true);}else if(obj.skipPermCheck&&!obj.skipDeviceCheck){checkDevices(runtime);}else if(!obj.skipPermCheck&&obj.skipDeviceCheck){$.FSRTC.checkPerms(function(status){runtime(status);},true,true);}else{runtime(null);}} -$.verto.genUUID=function(){return generateGUID();}})(jQuery);(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.adapter=f()}})(function(){var define,module,exports;return(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0?'m='+part:part).trim()+'\r\n';});};SDPUtils.matchPrefix=function(blob,prefix){return SDPUtils.splitLines(blob).filter(function(line){return line.indexOf(prefix)===0;});};SDPUtils.parseCandidate=function(line){var parts;if(line.indexOf('a=candidate:')===0){parts=line.substring(12).split(' ');}else{parts=line.substring(10).split(' ');} -var candidate={foundation:parts[0],component:parseInt(parts[1],10),protocol:parts[2].toLowerCase(),priority:parseInt(parts[3],10),ip:parts[4],port:parseInt(parts[5],10),type:parts[7]};for(var i=8;i=14393&&url.indexOf('?transport=udp')===-1;});delete server.url;server.urls=isString?urls[0]:urls;return!!urls.length;} +return false;});} +function getCommonCapabilities(localCapabilities,remoteCapabilities){var commonCapabilities={codecs:[],headerExtensions:[],fecMechanisms:[]};var findCodecByPayloadType=function(pt,codecs){pt=parseInt(pt,10);for(var i=0;i0;i--){this._iceGatherers=new window.RTCIceGatherer({iceServers:config.iceServers,gatherPolicy:config.iceTransportPolicy});}}else{config.iceCandidatePoolSize=0;} +this._config=config;this.transceivers=[];this._sdpSessionId=SDPUtils.generateSessionId();this._sdpSessionVersion=0;this._dtlsRole=undefined;};RTCPeerConnection.prototype._emitGatheringStateChange=function(){var event=new Event('icegatheringstatechange');this.dispatchEvent(event);if(typeof this.onicegatheringstatechange==='function'){this.onicegatheringstatechange(event);}};RTCPeerConnection.prototype.getConfiguration=function(){return this._config;};RTCPeerConnection.prototype.getLocalStreams=function(){return this.localStreams;};RTCPeerConnection.prototype.getRemoteStreams=function(){return this.remoteStreams;};RTCPeerConnection.prototype._createTransceiver=function(kind){var hasBundleTransport=this.transceivers.length>0;var transceiver={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:kind,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,wantReceive:true};if(this.usingBundle&&hasBundleTransport){transceiver.iceTransport=this.transceivers[0].iceTransport;transceiver.dtlsTransport=this.transceivers[0].dtlsTransport;}else{var transports=this._createIceAndDtlsTransports();transceiver.iceTransport=transports.iceTransport;transceiver.dtlsTransport=transports.dtlsTransport;} +this.transceivers.push(transceiver);return transceiver;};RTCPeerConnection.prototype.addTrack=function(track,stream){var transceiver;for(var i=0;i=15025){stream.getTracks().forEach(function(track){self.addTrack(track,stream);});}else{var clonedStream=stream.clone();stream.getTracks().forEach(function(track,idx){var clonedTrack=clonedStream.getTracks()[idx];track.addEventListener('enabled',function(event){clonedTrack.enabled=event.enabled;});});clonedStream.getTracks().forEach(function(track){self.addTrack(track,clonedStream);});}};RTCPeerConnection.prototype.removeStream=function(stream){var idx=this.localStreams.indexOf(stream);if(idx>-1){this.localStreams.splice(idx,1);this._maybeFireNegotiationNeeded();}};RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpSender;}).map(function(transceiver){return transceiver.rtpSender;});};RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpReceiver;}).map(function(transceiver){return transceiver.rtpReceiver;});};RTCPeerConnection.prototype._createIceGatherer=function(sdpMLineIndex,usingBundle){var self=this;if(usingBundle&&sdpMLineIndex>0){return this.transceivers[0].iceGatherer;}else if(this._iceGatherers.length){return this._iceGatherers.shift();} +var iceGatherer=new window.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});Object.defineProperty(iceGatherer,'state',{value:'new',writable:true});this.transceivers[sdpMLineIndex].candidates=[];this.transceivers[sdpMLineIndex].bufferCandidates=function(event){var end=!event.candidate||Object.keys(event.candidate).length===0;iceGatherer.state=end?'completed':'gathering';if(self.transceivers[sdpMLineIndex].candidates!==null){self.transceivers[sdpMLineIndex].candidates.push(event.candidate);}};iceGatherer.addEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);return iceGatherer;};RTCPeerConnection.prototype._gather=function(mid,sdpMLineIndex){var self=this;var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer.onlocalcandidate){return;} +var candidates=this.transceivers[sdpMLineIndex].candidates;this.transceivers[sdpMLineIndex].candidates=null;iceGatherer.removeEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);iceGatherer.onlocalcandidate=function(evt){if(self.usingBundle&&sdpMLineIndex>0){return;} +var event=new Event('icecandidate');event.candidate={sdpMid:mid,sdpMLineIndex:sdpMLineIndex};var cand=evt.candidate;var end=!cand||Object.keys(cand).length===0;if(end){if(iceGatherer.state==='new'||iceGatherer.state==='gathering'){iceGatherer.state='completed';}}else{if(iceGatherer.state==='new'){iceGatherer.state='gathering';} +cand.component=1;event.candidate.candidate=SDPUtils.writeCandidate(cand);} +var sections=SDPUtils.splitSections(self.localDescription.sdp);if(!end){sections[event.candidate.sdpMLineIndex+1]+='a='+event.candidate.candidate+'\r\n';}else{sections[event.candidate.sdpMLineIndex+1]+='a=end-of-candidates\r\n';} +self.localDescription.sdp=sections.join('');var complete=self.transceivers.every(function(transceiver){return transceiver.iceGatherer&&transceiver.iceGatherer.state==='completed';});if(self.iceGatheringState!=='gathering'){self.iceGatheringState='gathering';self._emitGatheringStateChange();} +if(!end){self.dispatchEvent(event);if(typeof self.onicecandidate==='function'){self.onicecandidate(event);}} +if(complete){self.dispatchEvent(new Event('icecandidate'));if(typeof self.onicecandidate==='function'){self.onicecandidate(new Event('icecandidate'));} +self.iceGatheringState='complete';self._emitGatheringStateChange();}};window.setTimeout(function(){candidates.forEach(function(candidate){var e=new Event('RTCIceGatherEvent');e.candidate=candidate;iceGatherer.onlocalcandidate(e);});},0);};RTCPeerConnection.prototype._createIceAndDtlsTransports=function(){var self=this;var iceTransport=new window.RTCIceTransport(null);iceTransport.onicestatechange=function(){self._updateConnectionState();};var dtlsTransport=new window.RTCDtlsTransport(iceTransport);dtlsTransport.ondtlsstatechange=function(){self._updateConnectionState();};dtlsTransport.onerror=function(){Object.defineProperty(dtlsTransport,'state',{value:'failed',writable:true});self._updateConnectionState();};return{iceTransport:iceTransport,dtlsTransport:dtlsTransport};};RTCPeerConnection.prototype._disposeIceAndDtlsTransports=function(sdpMLineIndex){var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer){delete iceGatherer.onlocalcandidate;delete this.transceivers[sdpMLineIndex].iceGatherer;} +var iceTransport=this.transceivers[sdpMLineIndex].iceTransport;if(iceTransport){delete iceTransport.onicestatechange;delete this.transceivers[sdpMLineIndex].iceTransport;} +var dtlsTransport=this.transceivers[sdpMLineIndex].dtlsTransport;if(dtlsTransport){delete dtlsTransport.ondtlsstatechange;delete dtlsTransport.onerror;delete this.transceivers[sdpMLineIndex].dtlsTransport;}};RTCPeerConnection.prototype._transceive=function(transceiver,send,recv){var params=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);if(send&&transceiver.rtpSender){params.encodings=transceiver.sendEncodingParameters;params.rtcp={cname:SDPUtils.localCName,compound:transceiver.rtcpParameters.compound};if(transceiver.recvEncodingParameters.length){params.rtcp.ssrc=transceiver.recvEncodingParameters[0].ssrc;} +transceiver.rtpSender.send(params);} +if(recv&&transceiver.rtpReceiver&¶ms.codecs.length>0){if(transceiver.kind==='video'&&transceiver.recvEncodingParameters&&edgeVersion<15019){transceiver.recvEncodingParameters.forEach(function(p){delete p.rtx;});} +params.encodings=transceiver.recvEncodingParameters;params.rtcp={cname:transceiver.rtcpParameters.cname,compound:transceiver.rtcpParameters.compound};if(transceiver.sendEncodingParameters.length){params.rtcp.ssrc=transceiver.sendEncodingParameters[0].ssrc;} +transceiver.rtpReceiver.receive(params);}};RTCPeerConnection.prototype.setLocalDescription=function(description){var self=this;var args=arguments;if(!isActionAllowedInSignalingState('setLocalDescription',description.type,this.signalingState)){return new Promise(function(resolve,reject){var e=new Error('Can not set local '+description.type+' in state '+self.signalingState);e.name='InvalidStateError';if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[e]);} +reject(e);});} +var sections;var sessionpart;if(description.type==='offer'){sections=SDPUtils.splitSections(description.sdp);sessionpart=sections.shift();sections.forEach(function(mediaSection,sdpMLineIndex){var caps=SDPUtils.parseRtpParameters(mediaSection);self.transceivers[sdpMLineIndex].localCapabilities=caps;});this.transceivers.forEach(function(transceiver,sdpMLineIndex){self._gather(transceiver.mid,sdpMLineIndex);});}else if(description.type==='answer'){sections=SDPUtils.splitSections(self.remoteDescription.sdp);sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;sections.forEach(function(mediaSection,sdpMLineIndex){var transceiver=self.transceivers[sdpMLineIndex];var iceGatherer=transceiver.iceGatherer;var iceTransport=transceiver.iceTransport;var dtlsTransport=transceiver.dtlsTransport;var localCapabilities=transceiver.localCapabilities;var remoteCapabilities=transceiver.remoteCapabilities;var rejected=SDPUtils.isRejected(mediaSection)&&!SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===1;if(!rejected&&!transceiver.isDatachannel){var remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);var remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);if(isIceLite){remoteDtlsParameters.role='server';} +if(!self.usingBundle||sdpMLineIndex===0){self._gather(transceiver.mid,sdpMLineIndex);if(iceTransport.state==='new'){iceTransport.start(iceGatherer,remoteIceParameters,isIceLite?'controlling':'controlled');} +if(dtlsTransport.state==='new'){dtlsTransport.start(remoteDtlsParameters);}} +var params=getCommonCapabilities(localCapabilities,remoteCapabilities);self._transceive(transceiver,params.codecs.length>0,false);}});} +this.localDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-local-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} +var cb=arguments.length>1&&typeof arguments[1]==='function'&&arguments[1];return new Promise(function(resolve){if(cb){cb.apply(null);} +resolve();});};RTCPeerConnection.prototype.setRemoteDescription=function(description){var self=this;var args=arguments;if(!isActionAllowedInSignalingState('setRemoteDescription',description.type,this.signalingState)){return new Promise(function(resolve,reject){var e=new Error('Can not set remote '+description.type+' in state '+self.signalingState);e.name='InvalidStateError';if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[e]);} +reject(e);});} +var streams={};this.remoteStreams.forEach(function(stream){streams[stream.id]=stream;});var receiverList=[];var sections=SDPUtils.splitSections(description.sdp);var sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;var usingBundle=SDPUtils.matchPrefix(sessionpart,'a=group:BUNDLE ').length>0;this.usingBundle=usingBundle;var iceOptions=SDPUtils.matchPrefix(sessionpart,'a=ice-options:')[0];if(iceOptions){this.canTrickleIceCandidates=iceOptions.substr(14).split(' ').indexOf('trickle')>=0;}else{this.canTrickleIceCandidates=false;} +sections.forEach(function(mediaSection,sdpMLineIndex){var lines=SDPUtils.splitLines(mediaSection);var kind=SDPUtils.getKind(mediaSection);var rejected=SDPUtils.isRejected(mediaSection)&&!SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===1;var protocol=lines[0].substr(2).split(' ')[2];var direction=SDPUtils.getDirection(mediaSection,sessionpart);var remoteMsid=SDPUtils.parseMsid(mediaSection);var mid=SDPUtils.getMid(mediaSection)||SDPUtils.generateIdentifier();if(kind==='application'&&protocol==='DTLS/SCTP'){self.transceivers[sdpMLineIndex]={mid:mid,isDatachannel:true};return;} +var transceiver;var iceGatherer;var iceTransport;var dtlsTransport;var rtpReceiver;var sendEncodingParameters;var recvEncodingParameters;var localCapabilities;var track;var remoteCapabilities=SDPUtils.parseRtpParameters(mediaSection);var remoteIceParameters;var remoteDtlsParameters;if(!rejected){remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);remoteDtlsParameters.role='client';} +recvEncodingParameters=SDPUtils.parseRtpEncodingParameters(mediaSection);var rtcpParameters=SDPUtils.parseRtcpParameters(mediaSection);var isComplete=SDPUtils.matchPrefix(mediaSection,'a=end-of-candidates',sessionpart).length>0;var cands=SDPUtils.matchPrefix(mediaSection,'a=candidate:').map(function(cand){return SDPUtils.parseCandidate(cand);}).filter(function(cand){return cand.component===1;});if((description.type==='offer'||description.type==='answer')&&!rejected&&usingBundle&&sdpMLineIndex>0&&self.transceivers[sdpMLineIndex]){self._disposeIceAndDtlsTransports(sdpMLineIndex);self.transceivers[sdpMLineIndex].iceGatherer=self.transceivers[0].iceGatherer;self.transceivers[sdpMLineIndex].iceTransport=self.transceivers[0].iceTransport;self.transceivers[sdpMLineIndex].dtlsTransport=self.transceivers[0].dtlsTransport;if(self.transceivers[sdpMLineIndex].rtpSender){self.transceivers[sdpMLineIndex].rtpSender.setTransport(self.transceivers[0].dtlsTransport);} +if(self.transceivers[sdpMLineIndex].rtpReceiver){self.transceivers[sdpMLineIndex].rtpReceiver.setTransport(self.transceivers[0].dtlsTransport);}} +if(description.type==='offer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex]||self._createTransceiver(kind);transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=self._createIceGatherer(sdpMLineIndex,usingBundle);} +if(cands.length&&transceiver.iceTransport.state==='new'){if(isComplete&&(!usingBundle||sdpMLineIndex===0)){transceiver.iceTransport.setRemoteCandidates(cands);}else{cands.forEach(function(candidate){maybeAddCandidate(transceiver.iceTransport,candidate);});}} +localCapabilities=window.RTCRtpReceiver.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} +sendEncodingParameters=transceiver.sendEncodingParameters||[{ssrc:(2*sdpMLineIndex+2)*1001}];var isNewTrack=false;if(direction==='sendrecv'||direction==='sendonly'){isNewTrack=!transceiver.rtpReceiver;rtpReceiver=transceiver.rtpReceiver||new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);if(isNewTrack){var stream;track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();Object.defineProperty(streams[remoteMsid.stream],'id',{get:function(){return remoteMsid.stream;}});} +Object.defineProperty(track,'id',{get:function(){return remoteMsid.track;}});stream=streams[remoteMsid.stream];}else{if(!streams.default){streams.default=new window.MediaStream();} +stream=streams.default;} +stream.addTrack(track);receiverList.push([track,rtpReceiver,stream]);}} +transceiver.localCapabilities=localCapabilities;transceiver.remoteCapabilities=remoteCapabilities;transceiver.rtpReceiver=rtpReceiver;transceiver.rtcpParameters=rtcpParameters;transceiver.sendEncodingParameters=sendEncodingParameters;transceiver.recvEncodingParameters=recvEncodingParameters;self._transceive(self.transceivers[sdpMLineIndex],false,isNewTrack);}else if(description.type==='answer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex];iceGatherer=transceiver.iceGatherer;iceTransport=transceiver.iceTransport;dtlsTransport=transceiver.dtlsTransport;rtpReceiver=transceiver.rtpReceiver;sendEncodingParameters=transceiver.sendEncodingParameters;localCapabilities=transceiver.localCapabilities;self.transceivers[sdpMLineIndex].recvEncodingParameters=recvEncodingParameters;self.transceivers[sdpMLineIndex].remoteCapabilities=remoteCapabilities;self.transceivers[sdpMLineIndex].rtcpParameters=rtcpParameters;if(cands.length&&iceTransport.state==='new'){if((isIceLite||isComplete)&&(!usingBundle||sdpMLineIndex===0)){iceTransport.setRemoteCandidates(cands);}else{cands.forEach(function(candidate){maybeAddCandidate(transceiver.iceTransport,candidate);});}} +if(!usingBundle||sdpMLineIndex===0){if(iceTransport.state==='new'){iceTransport.start(iceGatherer,remoteIceParameters,'controlling');} +if(dtlsTransport.state==='new'){dtlsTransport.start(remoteDtlsParameters);}} +self._transceive(transceiver,direction==='sendrecv'||direction==='recvonly',direction==='sendrecv'||direction==='sendonly');if(rtpReceiver&&(direction==='sendrecv'||direction==='sendonly')){track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();} +streams[remoteMsid.stream].addTrack(track);receiverList.push([track,rtpReceiver,streams[remoteMsid.stream]]);}else{if(!streams.default){streams.default=new window.MediaStream();} +streams.default.addTrack(track);receiverList.push([track,rtpReceiver,streams.default]);}}else{delete transceiver.rtpReceiver;}}});if(this._dtlsRole===undefined){this._dtlsRole=description.type==='offer'?'active':'passive';} +this.remoteDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-remote-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} +Object.keys(streams).forEach(function(sid){var stream=streams[sid];if(stream.getTracks().length){if(self.remoteStreams.indexOf(stream)===-1){self.remoteStreams.push(stream);var event=new Event('addstream');event.stream=stream;window.setTimeout(function(){self.dispatchEvent(event);if(typeof self.onaddstream==='function'){self.onaddstream(event);}});} +receiverList.forEach(function(item){var track=item[0];var receiver=item[1];if(stream.id!==item[2].id){return;} +var trackEvent=new Event('track');trackEvent.track=track;trackEvent.receiver=receiver;trackEvent.transceiver={receiver:receiver};trackEvent.streams=[stream];window.setTimeout(function(){self.dispatchEvent(trackEvent);if(typeof self.ontrack==='function'){self.ontrack(trackEvent);}});});}});window.setTimeout(function(){if(!(self&&self.transceivers)){return;} +self.transceivers.forEach(function(transceiver){if(transceiver.iceTransport&&transceiver.iceTransport.state==='new'&&transceiver.iceTransport.getRemoteCandidates().length>0){console.warn('Timeout for addRemoteCandidate. Consider sending '+'an end-of-candidates notification');transceiver.iceTransport.addRemoteCandidate({});}});},4000);return new Promise(function(resolve){if(args.length>1&&typeof args[1]==='function'){args[1].apply(null);} +resolve();});};RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(transceiver){if(transceiver.iceTransport){transceiver.iceTransport.stop();} +if(transceiver.dtlsTransport){transceiver.dtlsTransport.stop();} +if(transceiver.rtpSender){transceiver.rtpSender.stop();} +if(transceiver.rtpReceiver){transceiver.rtpReceiver.stop();}});this._updateSignalingState('closed');};RTCPeerConnection.prototype._updateSignalingState=function(newState){this.signalingState=newState;var event=new Event('signalingstatechange');this.dispatchEvent(event);if(typeof this.onsignalingstatechange==='function'){this.onsignalingstatechange(event);}};RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var self=this;if(this.signalingState!=='stable'||this.needNegotiation===true){return;} +this.needNegotiation=true;window.setTimeout(function(){if(self.needNegotiation===false){return;} +self.needNegotiation=false;var event=new Event('negotiationneeded');self.dispatchEvent(event);if(typeof self.onnegotiationneeded==='function'){self.onnegotiationneeded(event);}},0);};RTCPeerConnection.prototype._updateConnectionState=function(){var newState;var states={'new':0,closed:0,connecting:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};this.transceivers.forEach(function(transceiver){states[transceiver.iceTransport.state]++;states[transceiver.dtlsTransport.state]++;});states.connected+=states.completed;newState='new';if(states.failed>0){newState='failed';}else if(states.connecting>0||states.checking>0){newState='connecting';}else if(states.disconnected>0){newState='disconnected';}else if(states.new>0){newState='new';}else if(states.connected>0||states.completed>0){newState='connected';} +if(newState!==this.iceConnectionState){this.iceConnectionState=newState;var event=new Event('iceconnectionstatechange');this.dispatchEvent(event);if(typeof this.oniceconnectionstatechange==='function'){this.oniceconnectionstatechange(event);}}};RTCPeerConnection.prototype.createOffer=function(){var self=this;var args=arguments;var offerOptions;if(arguments.length===1&&typeof arguments[0]!=='function'){offerOptions=arguments[0];}else if(arguments.length===3){offerOptions=arguments[2];} +var numAudioTracks=this.transceivers.filter(function(t){return t.kind==='audio';}).length;var numVideoTracks=this.transceivers.filter(function(t){return t.kind==='video';}).length;if(offerOptions){if(offerOptions.mandatory||offerOptions.optional){throw new TypeError('Legacy mandatory/optional constraints not supported.');} +if(offerOptions.offerToReceiveAudio!==undefined){if(offerOptions.offerToReceiveAudio===true){numAudioTracks=1;}else if(offerOptions.offerToReceiveAudio===false){numAudioTracks=0;}else{numAudioTracks=offerOptions.offerToReceiveAudio;}} +if(offerOptions.offerToReceiveVideo!==undefined){if(offerOptions.offerToReceiveVideo===true){numVideoTracks=1;}else if(offerOptions.offerToReceiveVideo===false){numVideoTracks=0;}else{numVideoTracks=offerOptions.offerToReceiveVideo;}}} +this.transceivers.forEach(function(transceiver){if(transceiver.kind==='audio'){numAudioTracks--;if(numAudioTracks<0){transceiver.wantReceive=false;}}else if(transceiver.kind==='video'){numVideoTracks--;if(numVideoTracks<0){transceiver.wantReceive=false;}}});while(numAudioTracks>0||numVideoTracks>0){if(numAudioTracks>0){this._createTransceiver('audio');numAudioTracks--;} +if(numVideoTracks>0){this._createTransceiver('video');numVideoTracks--;}} +var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);this.transceivers.forEach(function(transceiver,sdpMLineIndex){var track=transceiver.track;var kind=transceiver.kind;var mid=SDPUtils.generateIdentifier();transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=self._createIceGatherer(sdpMLineIndex,self.usingBundle);} +var localCapabilities=window.RTCRtpSender.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} +localCapabilities.codecs.forEach(function(codec){if(codec.name==='H264'&&codec.parameters['level-asymmetry-allowed']===undefined){codec.parameters['level-asymmetry-allowed']='1';}});var sendEncodingParameters=transceiver.sendEncodingParameters||[{ssrc:(2*sdpMLineIndex+1)*1001}];if(track){if(edgeVersion>=15019&&kind==='video'&&!sendEncodingParameters[0].rtx){sendEncodingParameters[0].rtx={ssrc:sendEncodingParameters[0].ssrc+1};}} +if(transceiver.wantReceive){transceiver.rtpReceiver=new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);} +transceiver.localCapabilities=localCapabilities;transceiver.sendEncodingParameters=sendEncodingParameters;});if(this._config.bundlePolicy!=='max-compat'){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} +sdp+='a=ice-options:trickle\r\n';this.transceivers.forEach(function(transceiver,sdpMLineIndex){sdp+=writeMediaSection(transceiver,transceiver.localCapabilities,'offer',transceiver.stream,self._dtlsRole);sdp+='a=rtcp-rsize\r\n';if(transceiver.iceGatherer&&self.iceGatheringState!=='new'&&(sdpMLineIndex===0||!self.usingBundle)){transceiver.iceGatherer.getLocalCandidates().forEach(function(cand){cand.component=1;sdp+='a='+SDPUtils.writeCandidate(cand)+'\r\n';});if(transceiver.iceGatherer.state==='completed'){sdp+='a=end-of-candidates\r\n';}}});var desc=new window.RTCSessionDescription({type:'offer',sdp:sdp});return new Promise(function(resolve){if(args.length>0&&typeof args[0]==='function'){args[0].apply(null,[desc]);resolve();return;} +resolve(desc);});};RTCPeerConnection.prototype.createAnswer=function(){var self=this;var args=arguments;var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);if(this.usingBundle){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} +var mediaSectionsInOffer=SDPUtils.splitSections(this.remoteDescription.sdp).length-1;this.transceivers.forEach(function(transceiver,sdpMLineIndex){if(sdpMLineIndex+1>mediaSectionsInOffer){return;} +if(transceiver.isDatachannel){sdp+='m=application 0 DTLS/SCTP 5000\r\n'+'c=IN IP4 0.0.0.0\r\n'+'a=mid:'+transceiver.mid+'\r\n';return;} +if(transceiver.stream){var localTrack;if(transceiver.kind==='audio'){localTrack=transceiver.stream.getAudioTracks()[0];}else if(transceiver.kind==='video'){localTrack=transceiver.stream.getVideoTracks()[0];} +if(localTrack){if(edgeVersion>=15019&&transceiver.kind==='video'&&!transceiver.sendEncodingParameters[0].rtx){transceiver.sendEncodingParameters[0].rtx={ssrc:transceiver.sendEncodingParameters[0].ssrc+1};}}} +var commonCapabilities=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);var hasRtx=commonCapabilities.codecs.filter(function(c){return c.name.toLowerCase()==='rtx';}).length;if(!hasRtx&&transceiver.sendEncodingParameters[0].rtx){delete transceiver.sendEncodingParameters[0].rtx;} +sdp+=writeMediaSection(transceiver,commonCapabilities,'answer',transceiver.stream,self._dtlsRole);if(transceiver.rtcpParameters&&transceiver.rtcpParameters.reducedSize){sdp+='a=rtcp-rsize\r\n';}});var desc=new window.RTCSessionDescription({type:'answer',sdp:sdp});return new Promise(function(resolve){if(args.length>0&&typeof args[0]==='function'){args[0].apply(null,[desc]);resolve();return;} +resolve(desc);});};RTCPeerConnection.prototype.addIceCandidate=function(candidate){var err;var sections;if(!candidate||candidate.candidate===''){for(var j=0;j0?SDPUtils.parseCandidate(candidate.candidate):{};if(cand.protocol==='tcp'&&(cand.port===0||cand.port===9)){return Promise.resolve();} +if(cand.component&&cand.component!==1){return Promise.resolve();} +if(sdpMLineIndex===0||(sdpMLineIndex>0&&transceiver.iceTransport!==this.transceivers[0].iceTransport)){if(!maybeAddCandidate(transceiver.iceTransport,cand)){err=new Error('Can not add ICE candidate');err.name='OperationError';}} +if(!err){var candidateString=candidate.candidate.trim();if(candidateString.indexOf('a=')===0){candidateString=candidateString.substr(2);} +sections=SDPUtils.splitSections(this.remoteDescription.sdp);sections[sdpMLineIndex+1]+='a='+ +(cand.type?candidateString:'end-of-candidates') ++'\r\n';this.remoteDescription.sdp=sections.join('');}}else{err=new Error('Can not add ICE candidate');err.name='OperationError';}} +var args=arguments;return new Promise(function(resolve,reject){if(err){if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[err]);} +reject(err);}else{if(args.length>1&&typeof args[1]==='function'){args[1].apply(null);} +resolve();}});};RTCPeerConnection.prototype.getStats=function(){var promises=[];this.transceivers.forEach(function(transceiver){['rtpSender','rtpReceiver','iceGatherer','iceTransport','dtlsTransport'].forEach(function(method){if(transceiver[method]){promises.push(transceiver[method].getStats());}});});var cb=arguments.length>1&&typeof arguments[1]==='function'&&arguments[1];var fixStatsType=function(stat){return{inboundrtp:'inbound-rtp',outboundrtp:'outbound-rtp',candidatepair:'candidate-pair',localcandidate:'local-candidate',remotecandidate:'remote-candidate'}[stat.type]||stat.type;};return new Promise(function(resolve){var results=new Map();Promise.all(promises).then(function(res){res.forEach(function(result){Object.keys(result).forEach(function(id){result[id].type=fixStatsType(result[id]);results.set(id,result[id]);});});if(cb){cb.apply(null,results);} +resolve(results);});});};return RTCPeerConnection;};},{"sdp":2}],2:[function(require,module,exports){'use strict';var SDPUtils={};SDPUtils.generateIdentifier=function(){return Math.random().toString(36).substr(2,10);};SDPUtils.localCName=SDPUtils.generateIdentifier();SDPUtils.splitLines=function(blob){return blob.trim().split('\n').map(function(line){return line.trim();});};SDPUtils.splitSections=function(blob){var parts=blob.split('\nm=');return parts.map(function(part,index){return(index>0?'m='+part:part).trim()+'\r\n';});};SDPUtils.matchPrefix=function(blob,prefix){return SDPUtils.splitLines(blob).filter(function(line){return line.indexOf(prefix)===0;});};SDPUtils.parseCandidate=function(line){var parts;if(line.indexOf('a=candidate:')===0){parts=line.substring(12).split(' ');}else{parts=line.substring(10).split(' ');} +var candidate={foundation:parts[0],component:parseInt(parts[1],10),protocol:parts[2].toLowerCase(),priority:parseInt(parts[3],10),ip:parts[4],port:parseInt(parts[5],10),type:parts[7]};for(var i=8;i0;rtcpParameters.compound=rsize.length===0;var mux=SDPUtils.matchPrefix(mediaSection,'a=rtcp-mux');rtcpParameters.mux=mux.length>0;return rtcpParameters;};SDPUtils.parseMsid=function(mediaSection){var parts;var spec=SDPUtils.matchPrefix(mediaSection,'a=msid:');if(spec.length===1){parts=spec[0].substr(7).split(' ');return{stream:parts[0],track:parts[1]};} -var planB=SDPUtils.matchPrefix(mediaSection,'a=ssrc:').map(function(line){return SDPUtils.parseSsrcMedia(line);}).filter(function(parts){return parts.attribute==='msid';});if(planB.length>0){parts=planB[0].value.split(' ');return{stream:parts[0],track:parts[1]};}};SDPUtils.generateSessionId=function(){return Math.random().toString().substr(2,21);};SDPUtils.writeSessionBoilerplate=function(sessId){var sessionId;if(sessId){sessionId=sessId;}else{sessionId=SDPUtils.generateSessionId();} -return'v=0\r\n'+'o=thisisadapterortc '+sessionId+' 2 IN IP4 127.0.0.1\r\n'+'s=-\r\n'+'t=0 0\r\n';};SDPUtils.writeMediaSection=function(transceiver,caps,type,stream){var sdp=SDPUtils.writeRtpDescription(transceiver.kind,caps);sdp+=SDPUtils.writeIceParameters(transceiver.iceGatherer.getLocalParameters());sdp+=SDPUtils.writeDtlsParameters(transceiver.dtlsTransport.getLocalParameters(),type==='offer'?'actpass':'active');sdp+='a=mid:'+transceiver.mid+'\r\n';if(transceiver.direction){sdp+='a='+transceiver.direction+'\r\n';}else if(transceiver.rtpSender&&transceiver.rtpReceiver){sdp+='a=sendrecv\r\n';}else if(transceiver.rtpSender){sdp+='a=sendonly\r\n';}else if(transceiver.rtpReceiver){sdp+='a=recvonly\r\n';}else{sdp+='a=inactive\r\n';} +var planB=SDPUtils.matchPrefix(mediaSection,'a=ssrc:').map(function(line){return SDPUtils.parseSsrcMedia(line);}).filter(function(parts){return parts.attribute==='msid';});if(planB.length>0){parts=planB[0].value.split(' ');return{stream:parts[0],track:parts[1]};}};SDPUtils.generateSessionId=function(){return Math.random().toString().substr(2,21);};SDPUtils.writeSessionBoilerplate=function(sessId,sessVer){var sessionId;var version=sessVer!==undefined?sessVer:2;if(sessId){sessionId=sessId;}else{sessionId=SDPUtils.generateSessionId();} +return'v=0\r\n'+'o=thisisadapterortc '+sessionId+' '+version+' IN IP4 127.0.0.1\r\n'+'s=-\r\n'+'t=0 0\r\n';};SDPUtils.writeMediaSection=function(transceiver,caps,type,stream){var sdp=SDPUtils.writeRtpDescription(transceiver.kind,caps);sdp+=SDPUtils.writeIceParameters(transceiver.iceGatherer.getLocalParameters());sdp+=SDPUtils.writeDtlsParameters(transceiver.dtlsTransport.getLocalParameters(),type==='offer'?'actpass':'active');sdp+='a=mid:'+transceiver.mid+'\r\n';if(transceiver.direction){sdp+='a='+transceiver.direction+'\r\n';}else if(transceiver.rtpSender&&transceiver.rtpReceiver){sdp+='a=sendrecv\r\n';}else if(transceiver.rtpSender){sdp+='a=sendonly\r\n';}else if(transceiver.rtpReceiver){sdp+='a=recvonly\r\n';}else{sdp+='a=inactive\r\n';} if(transceiver.rtpSender){var msid='msid:'+stream.id+' '+ transceiver.rtpSender.track.id+'\r\n';sdp+='a='+msid;sdp+='a=ssrc:'+transceiver.sendEncodingParameters[0].ssrc+' '+msid;if(transceiver.sendEncodingParameters[0].rtx){sdp+='a=ssrc:'+transceiver.sendEncodingParameters[0].rtx.ssrc+' '+msid;sdp+='a=ssrc-group:FID '+ transceiver.sendEncodingParameters[0].ssrc+' '+ @@ -342,29 +455,42 @@ transceiver.sendEncodingParameters[0].rtx.ssrc+'\r\n';}} sdp+='a=ssrc:'+transceiver.sendEncodingParameters[0].ssrc+' cname:'+SDPUtils.localCName+'\r\n';if(transceiver.rtpSender&&transceiver.sendEncodingParameters[0].rtx){sdp+='a=ssrc:'+transceiver.sendEncodingParameters[0].rtx.ssrc+' cname:'+SDPUtils.localCName+'\r\n';} return sdp;};SDPUtils.getDirection=function(mediaSection,sessionpart){var lines=SDPUtils.splitLines(mediaSection);for(var i=0;i=64){return;} +var origGetLocalStreams=window.RTCPeerConnection.prototype.getLocalStreams;window.RTCPeerConnection.prototype.getLocalStreams=function(){var self=this;var nativeStreams=origGetLocalStreams.apply(this);self._reverseStreams=self._reverseStreams||{};return nativeStreams.map(function(stream){return self._reverseStreams[stream.id];});};var origAddStream=window.RTCPeerConnection.prototype.addStream;window.RTCPeerConnection.prototype.addStream=function(stream){var pc=this;pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};stream.getTracks().forEach(function(track){var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');}});if(!pc._reverseStreams[stream.id]){var newStream=new window.MediaStream(stream.getTracks());pc._streams[stream.id]=newStream;pc._reverseStreams[newStream.id]=stream;stream=newStream;} +origAddStream.apply(pc,[stream]);};var origRemoveStream=window.RTCPeerConnection.prototype.removeStream;window.RTCPeerConnection.prototype.removeStream=function(stream){var pc=this;pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};origRemoveStream.apply(pc,[(pc._streams[stream.id]||stream)]);delete pc._reverseStreams[(pc._streams[stream.id]?pc._streams[stream.id].id:stream.id)];delete pc._streams[stream.id];};window.RTCPeerConnection.prototype.addTrack=function(track,stream){var pc=this;if(pc.signalingState==='closed'){throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.','InvalidStateError');} +var streams=[].slice.call(arguments,1);if(streams.length!==1||!streams[0].getTracks().find(function(t){return t===track;})){throw new DOMException('The adapter.js addTrack polyfill only supports a single '+' stream which is associated with the specified track.','NotSupportedError');} +var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');} +pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};var oldStream=pc._streams[stream.id];if(oldStream){oldStream.addTrack(track);Promise.resolve().then(function(){pc.dispatchEvent(new Event('negotiationneeded'));});}else{var newStream=new window.MediaStream([track]);pc._streams[stream.id]=newStream;pc._reverseStreams[newStream.id]=stream;pc.addStream(newStream);} +return pc.getSenders().find(function(s){return s.track===track;});};function replaceInternalStreamId(pc,description){var sdp=description.sdp;Object.keys(pc._reverseStreams||[]).forEach(function(internalId){var externalStream=pc._reverseStreams[internalId];var internalStream=pc._streams[externalStream.id];sdp=sdp.replace(new RegExp(internalStream.id,'g'),externalStream.id);});return new RTCSessionDescription({type:description.type,sdp:sdp});} +function replaceExternalStreamId(pc,description){var sdp=description.sdp;Object.keys(pc._reverseStreams||[]).forEach(function(internalId){var externalStream=pc._reverseStreams[internalId];var internalStream=pc._streams[externalStream.id];sdp=sdp.replace(new RegExp(externalStream.id,'g'),internalStream.id);});return new RTCSessionDescription({type:description.type,sdp:sdp});} +['createOffer','createAnswer'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){var pc=this;var args=arguments;var isLegacyCall=arguments.length&&typeof arguments[0]==='function';if(isLegacyCall){return nativeMethod.apply(pc,[function(description){var desc=replaceInternalStreamId(pc,description);args[0].apply(null,[desc]);},function(err){if(args[1]){args[1].apply(null,err);}},arguments[2]]);} +return nativeMethod.apply(pc,arguments).then(function(description){return replaceInternalStreamId(pc,description);});};});var origSetLocalDescription=window.RTCPeerConnection.prototype.setLocalDescription;window.RTCPeerConnection.prototype.setLocalDescription=function(){var pc=this;if(!arguments.length||!arguments[0].type){return origSetLocalDescription.apply(pc,arguments);} +arguments[0]=replaceExternalStreamId(pc,arguments[0]);return origSetLocalDescription.apply(pc,arguments);};var origLocalDescription=Object.getOwnPropertyDescriptor(window.RTCPeerConnection.prototype,'localDescription');Object.defineProperty(window.RTCPeerConnection.prototype,'localDescription',{get:function(){var pc=this;var description=origLocalDescription.get.apply(this);if(description.type===''){return description;} +return replaceInternalStreamId(pc,description);}});window.RTCPeerConnection.prototype.removeTrack=function(sender){var pc=this;if(pc.signalingState==='closed'){throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.','InvalidStateError');} +if(!sender._pc){throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack '+'does not implement interface RTCRtpSender.','TypeError');} +var isLocal=sender._pc===pc;if(!isLocal){throw new DOMException('Sender was not created by this connection.','InvalidAccessError');} +pc._streams=pc._streams||{};var stream;Object.keys(pc._streams).forEach(function(streamid){var hasTrack=pc._streams[streamid].getTracks().find(function(track){return sender.track===track;});if(hasTrack){stream=pc._streams[streamid];}});if(stream){if(stream.getTracks().length===1){pc.removeStream(pc._reverseStreams[stream.id]);}else{stream.removeTrack(sender.track);} +pc.dispatchEvent(new Event('negotiationneeded'));}};},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(!window.RTCPeerConnection){window.RTCPeerConnection=function(pcConfig,pcConstraints){logging('PeerConnection');if(pcConfig&&pcConfig.iceTransportPolicy){pcConfig.iceTransports=pcConfig.iceTransportPolicy;} +return new window.webkitRTCPeerConnection(pcConfig,pcConstraints);};window.RTCPeerConnection.prototype=window.webkitRTCPeerConnection.prototype;if(window.webkitRTCPeerConnection.generateCertificate){Object.defineProperty(window.RTCPeerConnection,'generateCertificate',{get:function(){return window.webkitRTCPeerConnection.generateCertificate;}});}}else{var OrigPeerConnection=window.RTCPeerConnection;window.RTCPeerConnection=function(pcConfig,pcConstraints){if(pcConfig&&pcConfig.iceServers){var newIceServers=[];for(var i=0;i0&&typeof selector==='function'){return origGetStats.apply(this,arguments);} @@ -376,123 +502,44 @@ if(browserDetails.version<52){['createOffer','createAnswer'].forEach(function(me return nativeMethod.apply(this,arguments);};});} ['setLocalDescription','setRemoteDescription','addIceCandidate'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){arguments[0]=new((method==='addIceCandidate')?window.RTCIceCandidate:window.RTCSessionDescription)(arguments[0]);return nativeMethod.apply(this,arguments);};});var nativeAddIceCandidate=window.RTCPeerConnection.prototype.addIceCandidate;window.RTCPeerConnection.prototype.addIceCandidate=function(){if(!arguments[0]){if(arguments[1]){arguments[1].apply(null);} return Promise.resolve();} -return nativeAddIceCandidate.apply(this,arguments);};}};module.exports={shimMediaStream:chromeShim.shimMediaStream,shimOnTrack:chromeShim.shimOnTrack,shimGetSendersWithDtmf:chromeShim.shimGetSendersWithDtmf,shimSourceObject:chromeShim.shimSourceObject,shimPeerConnection:chromeShim.shimPeerConnection,shimGetUserMedia:require('./getusermedia')};},{"../utils.js":12,"./getusermedia":5}],5:[function(require,module,exports){'use strict';var utils=require('../utils.js');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var constraintsToChrome_=function(c){if(typeof c!=='object'||c.mandatory||c.optional){return c;} +return nativeAddIceCandidate.apply(this,arguments);};}};module.exports={shimMediaStream:chromeShim.shimMediaStream,shimOnTrack:chromeShim.shimOnTrack,shimAddTrackRemoveTrack:chromeShim.shimAddTrackRemoveTrack,shimGetSendersWithDtmf:chromeShim.shimGetSendersWithDtmf,shimSourceObject:chromeShim.shimSourceObject,shimPeerConnection:chromeShim.shimPeerConnection,shimGetUserMedia:require('./getusermedia')};},{"../utils.js":13,"./getusermedia":6}],6:[function(require,module,exports){'use strict';var utils=require('../utils.js');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var constraintsToChrome_=function(c){if(typeof c!=='object'||c.mandatory||c.optional){return c;} var cc={};Object.keys(c).forEach(function(key){if(key==='require'||key==='advanced'||key==='mediaSource'){return;} var r=(typeof c[key]==='object')?c[key]:{ideal:c[key]};if(r.exact!==undefined&&typeof r.exact==='number'){r.min=r.max=r.exact;} var oldname_=function(prefix,name){if(prefix){return prefix+name.charAt(0).toUpperCase()+name.slice(1);} return(name==='deviceId')?'sourceId':name;};if(r.ideal!==undefined){cc.optional=cc.optional||[];var oc={};if(typeof r.ideal==='number'){oc[oldname_('min',key)]=r.ideal;cc.optional.push(oc);oc={};oc[oldname_('max',key)]=r.ideal;cc.optional.push(oc);}else{oc[oldname_('',key)]=r.ideal;cc.optional.push(oc);}} if(r.exact!==undefined&&typeof r.exact!=='number'){cc.mandatory=cc.mandatory||{};cc.mandatory[oldname_('',key)]=r.exact;}else{['min','max'].forEach(function(mix){if(r[mix]!==undefined){cc.mandatory=cc.mandatory||{};cc.mandatory[oldname_(mix,key)]=r[mix];}});}});if(c.advanced){cc.optional=(cc.optional||[]).concat(c.advanced);} -return cc;};var shimConstraints_=function(constraints,func){constraints=JSON.parse(JSON.stringify(constraints));if(constraints&&typeof constraints.audio==='object'){var remap=function(obj,a,b){if(a in obj&&!(b in obj)){obj[b]=obj[a];delete obj[a];}};constraints=JSON.parse(JSON.stringify(constraints));remap(constraints.audio,'autoGainControl','googAutoGainControl');remap(constraints.audio,'noiseSuppression','googNoiseSuppression');constraints.audio=constraintsToChrome_(constraints.audio);} -if(constraints&&typeof constraints.video==='object'){var face=constraints.video.facingMode;face=face&&((typeof face==='object')?face:{ideal:face});var getSupportedFacingModeLies=browserDetails.version<61;if((face&&(face.exact==='user'||face.exact==='environment'||face.ideal==='user'||face.ideal==='environment'))&&!(navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().facingMode&&!getSupportedFacingModeLies)){delete constraints.video.facingMode;var matches;if(face.exact==='environment'||face.ideal==='environment'){matches=['back','rear'];}else if(face.exact==='user'||face.ideal==='user'){matches=['front'];} +return cc;};var shimConstraints_=function(constraints,func){if(browserDetails.version>=61){return func(constraints);} +constraints=JSON.parse(JSON.stringify(constraints));if(constraints&&typeof constraints.audio==='object'){var remap=function(obj,a,b){if(a in obj&&!(b in obj)){obj[b]=obj[a];delete obj[a];}};constraints=JSON.parse(JSON.stringify(constraints));remap(constraints.audio,'autoGainControl','googAutoGainControl');remap(constraints.audio,'noiseSuppression','googNoiseSuppression');constraints.audio=constraintsToChrome_(constraints.audio);} +if(constraints&&typeof constraints.video==='object'){var face=constraints.video.facingMode;face=face&&((typeof face==='object')?face:{ideal:face});var getSupportedFacingModeLies=browserDetails.version<66;if((face&&(face.exact==='user'||face.exact==='environment'||face.ideal==='user'||face.ideal==='environment'))&&!(navigator.mediaDevices.getSupportedConstraints&&navigator.mediaDevices.getSupportedConstraints().facingMode&&!getSupportedFacingModeLies)){delete constraints.video.facingMode;var matches;if(face.exact==='environment'||face.ideal==='environment'){matches=['back','rear'];}else if(face.exact==='user'||face.ideal==='user'){matches=['front'];} if(matches){return navigator.mediaDevices.enumerateDevices().then(function(devices){devices=devices.filter(function(d){return d.kind==='videoinput';});var dev=devices.find(function(d){return matches.some(function(match){return d.label.toLowerCase().indexOf(match)!==-1;});});if(!dev&&devices.length&&matches.indexOf('back')!==-1){dev=devices[devices.length-1];} if(dev){constraints.video.deviceId=face.exact?{exact:dev.deviceId}:{ideal:dev.deviceId};} constraints.video=constraintsToChrome_(constraints.video);logging('chrome: '+JSON.stringify(constraints));return func(constraints);});}} constraints.video=constraintsToChrome_(constraints.video);} -logging('chrome: '+JSON.stringify(constraints));return func(constraints);};var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError',InvalidStateError:'NotReadableError',DevicesNotFoundError:'NotFoundError',ConstraintNotSatisfiedError:'OverconstrainedError',TrackStartError:'NotReadableError',MediaDeviceFailedDueToShutdown:'NotReadableError',MediaDeviceKillSwitchOn:'NotReadableError'}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&': ')+this.message;}};};var getUserMedia_=function(constraints,onSuccess,onError){shimConstraints_(constraints,function(c){navigator.webkitGetUserMedia(c,onSuccess,function(e){onError(shimError_(e));});});};navigator.getUserMedia=getUserMedia_;var getUserMediaPromise_=function(constraints){return new Promise(function(resolve,reject){navigator.getUserMedia(constraints,resolve,reject);});};if(!navigator.mediaDevices){navigator.mediaDevices={getUserMedia:getUserMediaPromise_,enumerateDevices:function(){return new Promise(function(resolve){var kinds={audio:'audioinput',video:'videoinput'};return window.MediaStreamTrack.getSources(function(devices){resolve(devices.map(function(device){return{label:device.label,kind:kinds[device.kind],deviceId:device.id,groupId:''};}));});});},getSupportedConstraints:function(){return{deviceId:true,echoCancellation:true,facingMode:true,frameRate:true,height:true,width:true};}};} +logging('chrome: '+JSON.stringify(constraints));return func(constraints);};var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError',InvalidStateError:'NotReadableError',DevicesNotFoundError:'NotFoundError',ConstraintNotSatisfiedError:'OverconstrainedError',TrackStartError:'NotReadableError',MediaDeviceFailedDueToShutdown:'NotReadableError',MediaDeviceKillSwitchOn:'NotReadableError'}[e.name]||e.name,message:e.message,constraint:e.constraintName,toString:function(){return this.name+(this.message&&': ')+this.message;}};};var getUserMedia_=function(constraints,onSuccess,onError){shimConstraints_(constraints,function(c){navigator.webkitGetUserMedia(c,onSuccess,function(e){if(onError){onError(shimError_(e));}});});};navigator.getUserMedia=getUserMedia_;var getUserMediaPromise_=function(constraints){return new Promise(function(resolve,reject){navigator.getUserMedia(constraints,resolve,reject);});};if(!navigator.mediaDevices){navigator.mediaDevices={getUserMedia:getUserMediaPromise_,enumerateDevices:function(){return new Promise(function(resolve){var kinds={audio:'audioinput',video:'videoinput'};return window.MediaStreamTrack.getSources(function(devices){resolve(devices.map(function(device){return{label:device.label,kind:kinds[device.kind],deviceId:device.id,groupId:''};}));});});},getSupportedConstraints:function(){return{deviceId:true,echoCancellation:true,facingMode:true,frameRate:true,height:true,width:true};}};} if(!navigator.mediaDevices.getUserMedia){navigator.mediaDevices.getUserMedia=function(constraints){return getUserMediaPromise_(constraints);};}else{var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(cs){return shimConstraints_(cs,function(c){return origGetUserMedia(c).then(function(stream){if(c.audio&&!stream.getAudioTracks().length||c.video&&!stream.getVideoTracks().length){stream.getTracks().forEach(function(track){track.stop();});throw new DOMException('','NotFoundError');} return stream;},function(e){return Promise.reject(shimError_(e));});});};} if(typeof navigator.mediaDevices.addEventListener==='undefined'){navigator.mediaDevices.addEventListener=function(){logging('Dummy mediaDevices.addEventListener called.');};} -if(typeof navigator.mediaDevices.removeEventListener==='undefined'){navigator.mediaDevices.removeEventListener=function(){logging('Dummy mediaDevices.removeEventListener called.');};}};},{"../utils.js":12}],6:[function(require,module,exports){'use strict';var utils=require('../utils');var shimRTCPeerConnection=require('./rtcpeerconnection_shim');module.exports={shimGetUserMedia:require('./getusermedia'),shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(window.RTCIceGatherer){if(!window.RTCIceCandidate){window.RTCIceCandidate=function(args){return args;};} +if(typeof navigator.mediaDevices.removeEventListener==='undefined'){navigator.mediaDevices.removeEventListener=function(){logging('Dummy mediaDevices.removeEventListener called.');};}};},{"../utils.js":13}],7:[function(require,module,exports){'use strict';var SDPUtils=require('sdp');var utils=require('./utils');function wrapPeerConnectionEvent(window,eventNameToWrap,wrapper){if(!window.RTCPeerConnection){return;} +var proto=window.RTCPeerConnection.prototype;var nativeAddEventListener=proto.addEventListener;proto.addEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap){return nativeAddEventListener.apply(this,arguments);} +var wrappedCallback=function(e){cb(wrapper(e));};this._eventMap=this._eventMap||{};this._eventMap[cb]=wrappedCallback;return nativeAddEventListener.apply(this,[nativeEventName,wrappedCallback]);};var nativeRemoveEventListener=proto.removeEventListener;proto.removeEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap||!this._eventMap||!this._eventMap[cb]){return nativeRemoveEventListener.apply(this,arguments);} +var unwrappedCb=this._eventMap[cb];delete this._eventMap[cb];return nativeRemoveEventListener.apply(this,[nativeEventName,unwrappedCb]);};Object.defineProperty(proto,'on'+eventNameToWrap,{get:function(){return this['_on'+eventNameToWrap];},set:function(cb){if(this['_on'+eventNameToWrap]){this.removeEventListener(eventNameToWrap,this['_on'+eventNameToWrap]);delete this['_on'+eventNameToWrap];} +if(cb){this.addEventListener(eventNameToWrap,this['_on'+eventNameToWrap]=cb);}}});} +module.exports={shimRTCIceCandidate:function(window){if(window.RTCIceCandidate&&'foundation'in +window.RTCIceCandidate.prototype){return;} +var NativeRTCIceCandidate=window.RTCIceCandidate;window.RTCIceCandidate=function(args){if(typeof args==='object'&&args.candidate&&args.candidate.indexOf('a=')===0){args=JSON.parse(JSON.stringify(args));args.candidate=args.candidate.substr(2);} +var nativeCandidate=new NativeRTCIceCandidate(args);var parsedCandidate=SDPUtils.parseCandidate(args.candidate);var augmentedCandidate=Object.assign(nativeCandidate,parsedCandidate);augmentedCandidate.toJSON=function(){return{candidate:augmentedCandidate.candidate,sdpMid:augmentedCandidate.sdpMid,sdpMLineIndex:augmentedCandidate.sdpMLineIndex,usernameFragment:augmentedCandidate.usernameFragment,};};return augmentedCandidate;};wrapPeerConnectionEvent(window,'icecandidate',function(e){if(e.candidate){Object.defineProperty(e,'candidate',{value:new window.RTCIceCandidate(e.candidate),writable:'false'});} +return e;});},shimCreateObjectURL:function(window){var URL=window&&window.URL;if(!(typeof window==='object'&&window.HTMLMediaElement&&'srcObject'in window.HTMLMediaElement.prototype&&URL.createObjectURL&&URL.revokeObjectURL)){return undefined;} +var nativeCreateObjectURL=URL.createObjectURL.bind(URL);var nativeRevokeObjectURL=URL.revokeObjectURL.bind(URL);var streams=new Map(),newId=0;URL.createObjectURL=function(stream){if('getTracks'in stream){var url='polyblob:'+(++newId);streams.set(url,stream);utils.deprecated('URL.createObjectURL(stream)','elem.srcObject = stream');return url;} +return nativeCreateObjectURL(stream);};URL.revokeObjectURL=function(url){nativeRevokeObjectURL(url);streams.delete(url);};var dsc=Object.getOwnPropertyDescriptor(window.HTMLMediaElement.prototype,'src');Object.defineProperty(window.HTMLMediaElement.prototype,'src',{get:function(){return dsc.get.apply(this);},set:function(url){this.srcObject=streams.get(url)||null;return dsc.set.apply(this,[url]);}});var nativeSetAttribute=window.HTMLMediaElement.prototype.setAttribute;window.HTMLMediaElement.prototype.setAttribute=function(){if(arguments.length===2&&(''+arguments[0]).toLowerCase()==='src'){this.srcObject=streams.get(arguments[1])||null;} +return nativeSetAttribute.apply(this,arguments);};}};},{"./utils":13,"sdp":2}],8:[function(require,module,exports){'use strict';var utils=require('../utils');var shimRTCPeerConnection=require('rtcpeerconnection-shim');module.exports={shimGetUserMedia:require('./getusermedia'),shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(window.RTCIceGatherer){if(!window.RTCIceCandidate){window.RTCIceCandidate=function(args){return args;};} if(!window.RTCSessionDescription){window.RTCSessionDescription=function(args){return args;};} if(browserDetails.version<15025){var origMSTEnabled=Object.getOwnPropertyDescriptor(window.MediaStreamTrack.prototype,'enabled');Object.defineProperty(window.MediaStreamTrack.prototype,'enabled',{set:function(value){origMSTEnabled.set.call(this,value);var ev=new Event('enabled');ev.enabled=value;this.dispatchEvent(ev);}});}} -window.RTCPeerConnection=shimRTCPeerConnection(window,browserDetails.version);},shimReplaceTrack:function(window){if(window.RTCRtpSender&&!('replaceTrack'in window.RTCRtpSender.prototype)){window.RTCRtpSender.prototype.replaceTrack=window.RTCRtpSender.prototype.setTrack;}}};},{"../utils":12,"./getusermedia":7,"./rtcpeerconnection_shim":8}],7:[function(require,module,exports){'use strict';module.exports=function(window){var navigator=window&&window.navigator;var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError'}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name;}};};var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(c){return origGetUserMedia(c).catch(function(e){return Promise.reject(shimError_(e));});};};},{}],8:[function(require,module,exports){'use strict';var SDPUtils=require('sdp');function sortTracks(tracks){var audioTracks=tracks.filter(function(track){return track.kind==='audio';});var videoTracks=tracks.filter(function(track){return track.kind==='video';});tracks=[];while(audioTracks.length||videoTracks.length){if(audioTracks.length){tracks.push(audioTracks.shift());} -if(videoTracks.length){tracks.push(videoTracks.shift());}} -return tracks;} -function filterIceServers(iceServers,edgeVersion){var hasTurn=false;iceServers=JSON.parse(JSON.stringify(iceServers));return iceServers.filter(function(server){if(server&&(server.urls||server.url)){var urls=server.urls||server.url;if(server.url&&!server.urls){console.warn('RTCIceServer.url is deprecated! Use urls instead.');} -var isString=typeof urls==='string';if(isString){urls=[urls];} -urls=urls.filter(function(url){var validTurn=url.indexOf('turn:')===0&&url.indexOf('transport=udp')!==-1&&url.indexOf('turn:[')===-1&&!hasTurn;if(validTurn){hasTurn=true;return true;} -return url.indexOf('stun:')===0&&edgeVersion>=14393;});delete server.url;server.urls=isString?urls[0]:urls;return!!urls.length;} -return false;});} -function getCommonCapabilities(localCapabilities,remoteCapabilities){var commonCapabilities={codecs:[],headerExtensions:[],fecMechanisms:[]};var findCodecByPayloadType=function(pt,codecs){pt=parseInt(pt,10);for(var i=0;i0;var transceiver={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:kind,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,wantReceive:true};if(this.usingBundle&&hasBundleTransport){transceiver.iceTransport=this.transceivers[0].iceTransport;transceiver.dtlsTransport=this.transceivers[0].dtlsTransport;}else{var transports=this._createIceAndDtlsTransports();transceiver.iceTransport=transports.iceTransport;transceiver.dtlsTransport=transports.dtlsTransport;} -this.transceivers.push(transceiver);return transceiver;};RTCPeerConnection.prototype.addTrack=function(track,stream){var transceiver;for(var i=0;i=15025){this.localStreams.push(stream);stream.getTracks().forEach(function(track){self.addTrack(track,stream);});}else{var clonedStream=stream.clone();stream.getTracks().forEach(function(track,idx){var clonedTrack=clonedStream.getTracks()[idx];track.addEventListener('enabled',function(event){clonedTrack.enabled=event.enabled;});});clonedStream.getTracks().forEach(function(track){self.addTrack(track,clonedStream);});this.localStreams.push(clonedStream);} -this._maybeFireNegotiationNeeded();};RTCPeerConnection.prototype.removeStream=function(stream){var idx=this.localStreams.indexOf(stream);if(idx>-1){this.localStreams.splice(idx,1);this._maybeFireNegotiationNeeded();}};RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpSender;}).map(function(transceiver){return transceiver.rtpSender;});};RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpReceiver;}).map(function(transceiver){return transceiver.rtpReceiver;});};RTCPeerConnection.prototype._createIceGatherer=function(mid,sdpMLineIndex){var self=this;var iceGatherer=new window.RTCIceGatherer(self.iceOptions);iceGatherer.onlocalcandidate=function(evt){var event=new Event('icecandidate');event.candidate={sdpMid:mid,sdpMLineIndex:sdpMLineIndex};var cand=evt.candidate;var end=!cand||Object.keys(cand).length===0;if(end){if(iceGatherer.state===undefined){iceGatherer.state='completed';}}else{cand.component=1;event.candidate.candidate=SDPUtils.writeCandidate(cand);} -var sections=SDPUtils.splitSections(self.localDescription.sdp);if(!end){sections[event.candidate.sdpMLineIndex+1]+='a='+event.candidate.candidate+'\r\n';}else{sections[event.candidate.sdpMLineIndex+1]+='a=end-of-candidates\r\n';} -self.localDescription.sdp=sections.join('');var transceivers=self._pendingOffer?self._pendingOffer:self.transceivers;var complete=transceivers.every(function(transceiver){return transceiver.iceGatherer&&transceiver.iceGatherer.state==='completed';});switch(self.iceGatheringState){case'new':if(!end){self._localIceCandidatesBuffer.push(event);} -if(end&&complete){self._localIceCandidatesBuffer.push(new Event('icecandidate'));} -break;case'gathering':self._emitBufferedCandidates();if(!end){self.dispatchEvent(event);if(self.onicecandidate!==null){self.onicecandidate(event);}} -if(complete){self.dispatchEvent(new Event('icecandidate'));if(self.onicecandidate!==null){self.onicecandidate(new Event('icecandidate'));} -self.iceGatheringState='complete';self._emitGatheringStateChange();} -break;case'complete':break;default:break;}};return iceGatherer;};RTCPeerConnection.prototype._createIceAndDtlsTransports=function(){var self=this;var iceTransport=new window.RTCIceTransport(null);iceTransport.onicestatechange=function(){self._updateConnectionState();};var dtlsTransport=new window.RTCDtlsTransport(iceTransport);dtlsTransport.ondtlsstatechange=function(){self._updateConnectionState();};dtlsTransport.onerror=function(){Object.defineProperty(dtlsTransport,'state',{value:'failed',writable:true});self._updateConnectionState();};return{iceTransport:iceTransport,dtlsTransport:dtlsTransport};};RTCPeerConnection.prototype._disposeIceAndDtlsTransports=function(sdpMLineIndex){var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer){delete iceGatherer.onlocalcandidate;delete this.transceivers[sdpMLineIndex].iceGatherer;} -var iceTransport=this.transceivers[sdpMLineIndex].iceTransport;if(iceTransport){delete iceTransport.onicestatechange;delete this.transceivers[sdpMLineIndex].iceTransport;} -var dtlsTransport=this.transceivers[sdpMLineIndex].dtlsTransport;if(dtlsTransport){delete dtlsTransport.ondtlssttatechange;delete dtlsTransport.onerror;delete this.transceivers[sdpMLineIndex].dtlsTransport;}};RTCPeerConnection.prototype._transceive=function(transceiver,send,recv){var params=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);if(send&&transceiver.rtpSender){params.encodings=transceiver.sendEncodingParameters;params.rtcp={cname:SDPUtils.localCName,compound:transceiver.rtcpParameters.compound};if(transceiver.recvEncodingParameters.length){params.rtcp.ssrc=transceiver.recvEncodingParameters[0].ssrc;} -transceiver.rtpSender.send(params);} -if(recv&&transceiver.rtpReceiver){if(transceiver.kind==='video'&&transceiver.recvEncodingParameters&&edgeVersion<15019){transceiver.recvEncodingParameters.forEach(function(p){delete p.rtx;});} -params.encodings=transceiver.recvEncodingParameters;params.rtcp={cname:transceiver.rtcpParameters.cname,compound:transceiver.rtcpParameters.compound};if(transceiver.sendEncodingParameters.length){params.rtcp.ssrc=transceiver.sendEncodingParameters[0].ssrc;} -transceiver.rtpReceiver.receive(params);}};RTCPeerConnection.prototype.setLocalDescription=function(description){var self=this;if(!isActionAllowedInSignalingState('setLocalDescription',description.type,this.signalingState)){var e=new Error('Can not set local '+description.type+' in state '+this.signalingState);e.name='InvalidStateError';if(arguments.length>2&&typeof arguments[2]==='function'){window.setTimeout(arguments[2],0,e);} -return Promise.reject(e);} -var sections;var sessionpart;if(description.type==='offer'){if(this._pendingOffer){sections=SDPUtils.splitSections(description.sdp);sessionpart=sections.shift();sections.forEach(function(mediaSection,sdpMLineIndex){var caps=SDPUtils.parseRtpParameters(mediaSection);self._pendingOffer[sdpMLineIndex].localCapabilities=caps;});this.transceivers=this._pendingOffer;delete this._pendingOffer;}}else if(description.type==='answer'){sections=SDPUtils.splitSections(self.remoteDescription.sdp);sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;sections.forEach(function(mediaSection,sdpMLineIndex){var transceiver=self.transceivers[sdpMLineIndex];var iceGatherer=transceiver.iceGatherer;var iceTransport=transceiver.iceTransport;var dtlsTransport=transceiver.dtlsTransport;var localCapabilities=transceiver.localCapabilities;var remoteCapabilities=transceiver.remoteCapabilities;var rejected=SDPUtils.isRejected(mediaSection);if(!rejected&&!transceiver.isDatachannel){var remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);var remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);if(isIceLite){remoteDtlsParameters.role='server';} -if(!self.usingBundle||sdpMLineIndex===0){iceTransport.start(iceGatherer,remoteIceParameters,isIceLite?'controlling':'controlled');dtlsTransport.start(remoteDtlsParameters);} -var params=getCommonCapabilities(localCapabilities,remoteCapabilities);self._transceive(transceiver,params.codecs.length>0,false);}});} -this.localDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-local-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} -var hasCallback=arguments.length>1&&typeof arguments[1]==='function';if(hasCallback){var cb=arguments[1];window.setTimeout(function(){cb();if(self.iceGatheringState==='new'){self.iceGatheringState='gathering';self._emitGatheringStateChange();} -self._emitBufferedCandidates();},0);} -var p=Promise.resolve();p.then(function(){if(!hasCallback){if(self.iceGatheringState==='new'){self.iceGatheringState='gathering';self._emitGatheringStateChange();} -window.setTimeout(self._emitBufferedCandidates.bind(self),500);}});return p;};RTCPeerConnection.prototype.setRemoteDescription=function(description){var self=this;if(!isActionAllowedInSignalingState('setRemoteDescription',description.type,this.signalingState)){var e=new Error('Can not set remote '+description.type+' in state '+this.signalingState);e.name='InvalidStateError';if(arguments.length>2&&typeof arguments[2]==='function'){window.setTimeout(arguments[2],0,e);} -return Promise.reject(e);} -var streams={};var receiverList=[];var sections=SDPUtils.splitSections(description.sdp);var sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;var usingBundle=SDPUtils.matchPrefix(sessionpart,'a=group:BUNDLE ').length>0;this.usingBundle=usingBundle;var iceOptions=SDPUtils.matchPrefix(sessionpart,'a=ice-options:')[0];if(iceOptions){this.canTrickleIceCandidates=iceOptions.substr(14).split(' ').indexOf('trickle')>=0;}else{this.canTrickleIceCandidates=false;} -sections.forEach(function(mediaSection,sdpMLineIndex){var lines=SDPUtils.splitLines(mediaSection);var kind=SDPUtils.getKind(mediaSection);var rejected=SDPUtils.isRejected(mediaSection);var protocol=lines[0].substr(2).split(' ')[2];var direction=SDPUtils.getDirection(mediaSection,sessionpart);var remoteMsid=SDPUtils.parseMsid(mediaSection);var mid=SDPUtils.getMid(mediaSection)||SDPUtils.generateIdentifier();if(kind==='application'&&protocol==='DTLS/SCTP'){self.transceivers[sdpMLineIndex]={mid:mid,isDatachannel:true};return;} -var transceiver;var iceGatherer;var iceTransport;var dtlsTransport;var rtpReceiver;var sendEncodingParameters;var recvEncodingParameters;var localCapabilities;var track;var remoteCapabilities=SDPUtils.parseRtpParameters(mediaSection);var remoteIceParameters;var remoteDtlsParameters;if(!rejected){remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);remoteDtlsParameters.role='client';} -recvEncodingParameters=SDPUtils.parseRtpEncodingParameters(mediaSection);var rtcpParameters=SDPUtils.parseRtcpParameters(mediaSection);var isComplete=SDPUtils.matchPrefix(mediaSection,'a=end-of-candidates',sessionpart).length>0;var cands=SDPUtils.matchPrefix(mediaSection,'a=candidate:').map(function(cand){return SDPUtils.parseCandidate(cand);}).filter(function(cand){return cand.component==='1'||cand.component===1;});if((description.type==='offer'||description.type==='answer')&&!rejected&&usingBundle&&sdpMLineIndex>0&&self.transceivers[sdpMLineIndex]){self._disposeIceAndDtlsTransports(sdpMLineIndex);self.transceivers[sdpMLineIndex].iceGatherer=self.transceivers[0].iceGatherer;self.transceivers[sdpMLineIndex].iceTransport=self.transceivers[0].iceTransport;self.transceivers[sdpMLineIndex].dtlsTransport=self.transceivers[0].dtlsTransport;if(self.transceivers[sdpMLineIndex].rtpSender){self.transceivers[sdpMLineIndex].rtpSender.setTransport(self.transceivers[0].dtlsTransport);} -if(self.transceivers[sdpMLineIndex].rtpReceiver){self.transceivers[sdpMLineIndex].rtpReceiver.setTransport(self.transceivers[0].dtlsTransport);}} -if(description.type==='offer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex]||self._createTransceiver(kind);transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=usingBundle&&sdpMLineIndex>0?self.transceivers[0].iceGatherer:self._createIceGatherer(mid,sdpMLineIndex);} -if(isComplete&&(!usingBundle||sdpMLineIndex===0)){transceiver.iceTransport.setRemoteCandidates(cands);} -localCapabilities=window.RTCRtpReceiver.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} -sendEncodingParameters=[{ssrc:(2*sdpMLineIndex+2)*1001}];if(direction==='sendrecv'||direction==='sendonly'){rtpReceiver=new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();Object.defineProperty(streams[remoteMsid.stream],'id',{get:function(){return remoteMsid.stream;}});} -Object.defineProperty(track,'id',{get:function(){return remoteMsid.track;}});streams[remoteMsid.stream].addTrack(track);receiverList.push([track,rtpReceiver,streams[remoteMsid.stream]]);}else{if(!streams.default){streams.default=new window.MediaStream();} -streams.default.addTrack(track);receiverList.push([track,rtpReceiver,streams.default]);}} -transceiver.localCapabilities=localCapabilities;transceiver.remoteCapabilities=remoteCapabilities;transceiver.rtpReceiver=rtpReceiver;transceiver.rtcpParameters=rtcpParameters;transceiver.sendEncodingParameters=sendEncodingParameters;transceiver.recvEncodingParameters=recvEncodingParameters;self._transceive(self.transceivers[sdpMLineIndex],false,direction==='sendrecv'||direction==='sendonly');}else if(description.type==='answer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex];iceGatherer=transceiver.iceGatherer;iceTransport=transceiver.iceTransport;dtlsTransport=transceiver.dtlsTransport;rtpReceiver=transceiver.rtpReceiver;sendEncodingParameters=transceiver.sendEncodingParameters;localCapabilities=transceiver.localCapabilities;self.transceivers[sdpMLineIndex].recvEncodingParameters=recvEncodingParameters;self.transceivers[sdpMLineIndex].remoteCapabilities=remoteCapabilities;self.transceivers[sdpMLineIndex].rtcpParameters=rtcpParameters;if((isIceLite||isComplete)&&cands.length){iceTransport.setRemoteCandidates(cands);} -if(!usingBundle||sdpMLineIndex===0){iceTransport.start(iceGatherer,remoteIceParameters,'controlling');dtlsTransport.start(remoteDtlsParameters);} -self._transceive(transceiver,direction==='sendrecv'||direction==='recvonly',direction==='sendrecv'||direction==='sendonly');if(rtpReceiver&&(direction==='sendrecv'||direction==='sendonly')){track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();} -streams[remoteMsid.stream].addTrack(track);receiverList.push([track,rtpReceiver,streams[remoteMsid.stream]]);}else{if(!streams.default){streams.default=new window.MediaStream();} -streams.default.addTrack(track);receiverList.push([track,rtpReceiver,streams.default]);}}else{delete transceiver.rtpReceiver;}}});this.remoteDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-remote-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} -Object.keys(streams).forEach(function(sid){var stream=streams[sid];if(stream.getTracks().length){self.remoteStreams.push(stream);var event=new Event('addstream');event.stream=stream;self.dispatchEvent(event);if(self.onaddstream!==null){window.setTimeout(function(){self.onaddstream(event);},0);} -receiverList.forEach(function(item){var track=item[0];var receiver=item[1];if(stream.id!==item[2].id){return;} -var trackEvent=new Event('track');trackEvent.track=track;trackEvent.receiver=receiver;trackEvent.streams=[stream];self.dispatchEvent(trackEvent);if(self.ontrack!==null){window.setTimeout(function(){self.ontrack(trackEvent);},0);}});}});window.setTimeout(function(){if(!(self&&self.transceivers)){return;} -self.transceivers.forEach(function(transceiver){if(transceiver.iceTransport&&transceiver.iceTransport.state==='new'&&transceiver.iceTransport.getRemoteCandidates().length>0){console.warn('Timeout for addRemoteCandidate. Consider sending '+'an end-of-candidates notification');transceiver.iceTransport.addRemoteCandidate({});}});},4000);if(arguments.length>1&&typeof arguments[1]==='function'){window.setTimeout(arguments[1],0);} -return Promise.resolve();};RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(transceiver){if(transceiver.iceTransport){transceiver.iceTransport.stop();} -if(transceiver.dtlsTransport){transceiver.dtlsTransport.stop();} -if(transceiver.rtpSender){transceiver.rtpSender.stop();} -if(transceiver.rtpReceiver){transceiver.rtpReceiver.stop();}});this._updateSignalingState('closed');};RTCPeerConnection.prototype._updateSignalingState=function(newState){this.signalingState=newState;var event=new Event('signalingstatechange');this.dispatchEvent(event);if(this.onsignalingstatechange!==null){this.onsignalingstatechange(event);}};RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var self=this;if(this.signalingState!=='stable'||this.needNegotiation===true){return;} -this.needNegotiation=true;window.setTimeout(function(){if(self.needNegotiation===false){return;} -self.needNegotiation=false;var event=new Event('negotiationneeded');self.dispatchEvent(event);if(self.onnegotiationneeded!==null){self.onnegotiationneeded(event);}},0);};RTCPeerConnection.prototype._updateConnectionState=function(){var self=this;var newState;var states={'new':0,closed:0,connecting:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};this.transceivers.forEach(function(transceiver){states[transceiver.iceTransport.state]++;states[transceiver.dtlsTransport.state]++;});states.connected+=states.completed;newState='new';if(states.failed>0){newState='failed';}else if(states.connecting>0||states.checking>0){newState='connecting';}else if(states.disconnected>0){newState='disconnected';}else if(states.new>0){newState='new';}else if(states.connected>0||states.completed>0){newState='connected';} -if(newState!==self.iceConnectionState){self.iceConnectionState=newState;var event=new Event('iceconnectionstatechange');this.dispatchEvent(event);if(this.oniceconnectionstatechange!==null){this.oniceconnectionstatechange(event);}}};RTCPeerConnection.prototype.createOffer=function(){var self=this;if(this._pendingOffer){throw new Error('createOffer called while there is a pending offer.');} -var offerOptions;if(arguments.length===1&&typeof arguments[0]!=='function'){offerOptions=arguments[0];}else if(arguments.length===3){offerOptions=arguments[2];} -var numAudioTracks=this.transceivers.filter(function(t){return t.kind==='audio';}).length;var numVideoTracks=this.transceivers.filter(function(t){return t.kind==='video';}).length;if(offerOptions){if(offerOptions.mandatory||offerOptions.optional){throw new TypeError('Legacy mandatory/optional constraints not supported.');} -if(offerOptions.offerToReceiveAudio!==undefined){if(offerOptions.offerToReceiveAudio===true){numAudioTracks=1;}else if(offerOptions.offerToReceiveAudio===false){numAudioTracks=0;}else{numAudioTracks=offerOptions.offerToReceiveAudio;}} -if(offerOptions.offerToReceiveVideo!==undefined){if(offerOptions.offerToReceiveVideo===true){numVideoTracks=1;}else if(offerOptions.offerToReceiveVideo===false){numVideoTracks=0;}else{numVideoTracks=offerOptions.offerToReceiveVideo;}}} -this.transceivers.forEach(function(transceiver){if(transceiver.kind==='audio'){numAudioTracks--;if(numAudioTracks<0){transceiver.wantReceive=false;}}else if(transceiver.kind==='video'){numVideoTracks--;if(numVideoTracks<0){transceiver.wantReceive=false;}}});while(numAudioTracks>0||numVideoTracks>0){if(numAudioTracks>0){this._createTransceiver('audio');numAudioTracks--;} -if(numVideoTracks>0){this._createTransceiver('video');numVideoTracks--;}} -var transceivers=sortTracks(this.transceivers);var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId);transceivers.forEach(function(transceiver,sdpMLineIndex){var track=transceiver.track;var kind=transceiver.kind;var mid=SDPUtils.generateIdentifier();transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=self.usingBundle&&sdpMLineIndex>0?transceivers[0].iceGatherer:self._createIceGatherer(mid,sdpMLineIndex);} -var localCapabilities=window.RTCRtpSender.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} -localCapabilities.codecs.forEach(function(codec){if(codec.name==='H264'&&codec.parameters['level-asymmetry-allowed']===undefined){codec.parameters['level-asymmetry-allowed']='1';}});var sendEncodingParameters=[{ssrc:(2*sdpMLineIndex+1)*1001}];if(track){if(edgeVersion>=15019&&kind==='video'){sendEncodingParameters[0].rtx={ssrc:(2*sdpMLineIndex+1)*1001+1};}} -if(transceiver.wantReceive){transceiver.rtpReceiver=new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);} -transceiver.localCapabilities=localCapabilities;transceiver.sendEncodingParameters=sendEncodingParameters;});if(this._config.bundlePolicy!=='max-compat'){sdp+='a=group:BUNDLE '+transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} -sdp+='a=ice-options:trickle\r\n';transceivers.forEach(function(transceiver,sdpMLineIndex){sdp+=SDPUtils.writeMediaSection(transceiver,transceiver.localCapabilities,'offer',transceiver.stream);sdp+='a=rtcp-rsize\r\n';});this._pendingOffer=transceivers;var desc=new window.RTCSessionDescription({type:'offer',sdp:sdp});if(arguments.length&&typeof arguments[0]==='function'){window.setTimeout(arguments[0],0,desc);} -return Promise.resolve(desc);};RTCPeerConnection.prototype.createAnswer=function(){var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId);if(this.usingBundle){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} -this.transceivers.forEach(function(transceiver,sdpMLineIndex){if(transceiver.isDatachannel){sdp+='m=application 0 DTLS/SCTP 5000\r\n'+'c=IN IP4 0.0.0.0\r\n'+'a=mid:'+transceiver.mid+'\r\n';return;} -if(transceiver.stream){var localTrack;if(transceiver.kind==='audio'){localTrack=transceiver.stream.getAudioTracks()[0];}else if(transceiver.kind==='video'){localTrack=transceiver.stream.getVideoTracks()[0];} -if(localTrack){if(edgeVersion>=15019&&transceiver.kind==='video'){transceiver.sendEncodingParameters[0].rtx={ssrc:(2*sdpMLineIndex+2)*1001+1};}}} -var commonCapabilities=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);var hasRtx=commonCapabilities.codecs.filter(function(c){return c.name.toLowerCase()==='rtx';}).length;if(!hasRtx&&transceiver.sendEncodingParameters[0].rtx){delete transceiver.sendEncodingParameters[0].rtx;} -sdp+=SDPUtils.writeMediaSection(transceiver,commonCapabilities,'answer',transceiver.stream);if(transceiver.rtcpParameters&&transceiver.rtcpParameters.reducedSize){sdp+='a=rtcp-rsize\r\n';}});var desc=new window.RTCSessionDescription({type:'answer',sdp:sdp});if(arguments.length&&typeof arguments[0]==='function'){window.setTimeout(arguments[0],0,desc);} -return Promise.resolve(desc);};RTCPeerConnection.prototype.addIceCandidate=function(candidate){if(!candidate){for(var j=0;j0?SDPUtils.parseCandidate(candidate.candidate):{};if(cand.protocol==='tcp'&&(cand.port===0||cand.port===9)){return Promise.resolve();} -if(cand.component&&!(cand.component==='1'||cand.component===1)){return Promise.resolve();} -transceiver.iceTransport.addRemoteCandidate(cand);var sections=SDPUtils.splitSections(this.remoteDescription.sdp);sections[mLineIndex+1]+=(cand.type?candidate.candidate.trim():'a=end-of-candidates')+'\r\n';this.remoteDescription.sdp=sections.join('');}} -if(arguments.length>1&&typeof arguments[1]==='function'){window.setTimeout(arguments[1],0);} -return Promise.resolve();};RTCPeerConnection.prototype.getStats=function(){var promises=[];this.transceivers.forEach(function(transceiver){['rtpSender','rtpReceiver','iceGatherer','iceTransport','dtlsTransport'].forEach(function(method){if(transceiver[method]){promises.push(transceiver[method].getStats());}});});var cb=arguments.length>1&&typeof arguments[1]==='function'&&arguments[1];var fixStatsType=function(stat){return{inboundrtp:'inbound-rtp',outboundrtp:'outbound-rtp',candidatepair:'candidate-pair',localcandidate:'local-candidate',remotecandidate:'remote-candidate'}[stat.type]||stat.type;};return new Promise(function(resolve){var results=new Map();Promise.all(promises).then(function(res){res.forEach(function(result){Object.keys(result).forEach(function(id){result[id].type=fixStatsType(result[id]);results.set(id,result[id]);});});if(cb){window.setTimeout(cb,0,results);} -resolve(results);});});};return RTCPeerConnection;};},{"sdp":1}],9:[function(require,module,exports){'use strict';var utils=require('../utils');var firefoxShim={shimOnTrack:function(window){if(typeof window==='object'&&window.RTCPeerConnection&&!('ontrack'in +if(window.RTCRtpSender&&!('dtmf'in window.RTCRtpSender.prototype)){Object.defineProperty(window.RTCRtpSender.prototype,'dtmf',{get:function(){if(this._dtmf===undefined){if(this.track.kind==='audio'){this._dtmf=new window.RTCDtmfSender(this);}else if(this.track.kind==='video'){this._dtmf=null;}} +return this._dtmf;}});} +window.RTCPeerConnection=shimRTCPeerConnection(window,browserDetails.version);},shimReplaceTrack:function(window){if(window.RTCRtpSender&&!('replaceTrack'in window.RTCRtpSender.prototype)){window.RTCRtpSender.prototype.replaceTrack=window.RTCRtpSender.prototype.setTrack;}}};},{"../utils":13,"./getusermedia":9,"rtcpeerconnection-shim":1}],9:[function(require,module,exports){'use strict';module.exports=function(window){var navigator=window&&window.navigator;var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError'}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name;}};};var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(c){return origGetUserMedia(c).catch(function(e){return Promise.reject(shimError_(e));});};};},{}],10:[function(require,module,exports){'use strict';var utils=require('../utils');var firefoxShim={shimOnTrack:function(window){if(typeof window==='object'&&window.RTCPeerConnection&&!('ontrack'in window.RTCPeerConnection.prototype)){Object.defineProperty(window.RTCPeerConnection.prototype,'ontrack',{get:function(){return this._ontrack;},set:function(f){if(this._ontrack){this.removeEventListener('track',this._ontrack);this.removeEventListener('addstream',this._ontrackpoly);} -this.addEventListener('track',this._ontrack=f);this.addEventListener('addstream',this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(track){var event=new Event('track');event.track=track;event.receiver={track:track};event.streams=[e.stream];this.dispatchEvent(event);}.bind(this));}.bind(this));}});}},shimSourceObject:function(window){if(typeof window==='object'){if(window.HTMLMediaElement&&!('srcObject'in window.HTMLMediaElement.prototype)){Object.defineProperty(window.HTMLMediaElement.prototype,'srcObject',{get:function(){return this.mozSrcObject;},set:function(stream){this.mozSrcObject=stream;}});}}},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(typeof window!=='object'||!(window.RTCPeerConnection||window.mozRTCPeerConnection)){return;} +this.addEventListener('track',this._ontrack=f);this.addEventListener('addstream',this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(track){var event=new Event('track');event.track=track;event.receiver={track:track};event.transceiver={receiver:event.receiver};event.streams=[e.stream];this.dispatchEvent(event);}.bind(this));}.bind(this));}});} +if(typeof window==='object'&&window.RTCTrackEvent&&('receiver'in window.RTCTrackEvent.prototype)&&!('transceiver'in window.RTCTrackEvent.prototype)){Object.defineProperty(window.RTCTrackEvent.prototype,'transceiver',{get:function(){return{receiver:this.receiver};}});}},shimSourceObject:function(window){if(typeof window==='object'){if(window.HTMLMediaElement&&!('srcObject'in window.HTMLMediaElement.prototype)){Object.defineProperty(window.HTMLMediaElement.prototype,'srcObject',{get:function(){return this.mozSrcObject;},set:function(stream){this.mozSrcObject=stream;}});}}},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(typeof window!=='object'||!(window.RTCPeerConnection||window.mozRTCPeerConnection)){return;} if(!window.RTCPeerConnection){window.RTCPeerConnection=function(pcConfig,pcConstraints){if(browserDetails.version<38){if(pcConfig&&pcConfig.iceServers){var newIceServers=[];for(var i=0;i=pos&&parseInt(match[pos],10);},detectBrowser:function(window){var navigator=window&&window.navigator;var result={};result.browser=null;result.version=null;if(typeof window==='undefined'||!window.navigator){result.browser='Not a browser.';return result;} if(navigator.mozGetUserMedia){result.browser='firefox';result.version=this.extractVersion(navigator.userAgent,/Firefox\/(\d+)\./,1);}else if(navigator.webkitGetUserMedia){if(window.webkitRTCPeerConnection){result.browser='chrome';result.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/(\d+)\./,2);}else{if(navigator.userAgent.match(/Version\/(\d+).(\d+)/)){result.browser='safari';result.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1);}else{result.browser='Unsupported webkit-based browser '+'with GUM support but no WebRTC support.';return result;}}}else if(navigator.mediaDevices&&navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)){result.browser='edge';result.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2);}else if(navigator.mediaDevices&&navigator.userAgent.match(/AppleWebKit\/(\d+)\./)){result.browser='safari';result.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1);}else{result.browser='Not a supported browser.';return result;} -return result;},shimCreateObjectURL:function(window){var URL=window&&window.URL;if(!(typeof window==='object'&&window.HTMLMediaElement&&'srcObject'in window.HTMLMediaElement.prototype)){return undefined;} -var nativeCreateObjectURL=URL.createObjectURL.bind(URL);var nativeRevokeObjectURL=URL.revokeObjectURL.bind(URL);var streams=new Map(),newId=0;URL.createObjectURL=function(stream){if('getTracks'in stream){var url='polyblob:'+(++newId);streams.set(url,stream);utils.deprecated('URL.createObjectURL(stream)','elem.srcObject = stream');return url;} -return nativeCreateObjectURL(stream);};URL.revokeObjectURL=function(url){nativeRevokeObjectURL(url);streams.delete(url);};var dsc=Object.getOwnPropertyDescriptor(window.HTMLMediaElement.prototype,'src');Object.defineProperty(window.HTMLMediaElement.prototype,'src',{get:function(){return dsc.get.apply(this);},set:function(url){this.srcObject=streams.get(url)||null;return dsc.set.apply(this,[url]);}});var nativeSetAttribute=window.HTMLMediaElement.prototype.setAttribute;window.HTMLMediaElement.prototype.setAttribute=function(){if(arguments.length===2&&(''+arguments[0]).toLowerCase()==='src'){this.srcObject=streams.get(arguments[1])||null;} -return nativeSetAttribute.apply(this,arguments);};}};module.exports={log:utils.log,deprecated:utils.deprecated,disableLog:utils.disableLog,disableWarnings:utils.disableWarnings,extractVersion:utils.extractVersion,shimCreateObjectURL:utils.shimCreateObjectURL,detectBrowser:utils.detectBrowser.bind(utils)};},{}]},{},[2])(2)}); \ No newline at end of file +return result;},};module.exports={log:utils.log,deprecated:utils.deprecated,disableLog:utils.disableLog,disableWarnings:utils.disableWarnings,extractVersion:utils.extractVersion,shimCreateObjectURL:utils.shimCreateObjectURL,detectBrowser:utils.detectBrowser.bind(utils)};},{}]},{},[3])(3)}); \ No newline at end of file From 291da1132215950e63f024c6beb1a5b9d8318782 Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 2 Jan 2018 18:37:23 -0600 Subject: [PATCH 095/264] FS-10867: [freeswitch-core] Prevent stack smash when queing multiple sound files without event-lock #resolve --- src/include/switch_core.h | 2 ++ src/switch_core_session.c | 8 ++++++++ src/switch_ivr.c | 10 ++++++++++ 3 files changed, 20 insertions(+) diff --git a/src/include/switch_core.h b/src/include/switch_core.h index a07ea36a1e..d597c601a3 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -1117,6 +1117,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_get_app_flags(const char *ap */ #define switch_core_session_execute_application(_a, _b, _c) switch_core_session_execute_application_get_flags(_a, _b, _c, NULL) +SWITCH_DECLARE(uint32_t) switch_core_session_stack_count(switch_core_session_t *session, int x); + /*! \brief Run a dialplan and execute an extension \param session the current session diff --git a/src/switch_core_session.c b/src/switch_core_session.c index b57e239f92..dec61f3917 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -2895,6 +2895,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t * return SWITCH_STATUS_SUCCESS; } +SWITCH_DECLARE(uint32_t) switch_core_session_stack_count(switch_core_session_t *session, int x) +{ + if (x > 0) session->stack_count++; + else if (x < 0) session->stack_count--; + + return session->stack_count; +} + SWITCH_DECLARE(switch_status_t) switch_core_session_execute_exten(switch_core_session_t *session, const char *exten, const char *dialplan, const char *context) { diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 770c3bb81f..462ed56b22 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -898,6 +898,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_ int x = 0; switch_channel_t *channel; + if (switch_core_session_stack_count(session, 0) > SWITCH_MAX_STACKS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error %s too many stacked extensions\n", + switch_core_session_get_name(session)); + return SWITCH_STATUS_FALSE; + } + + switch_core_session_stack_count(session, 1); + switch_ivr_parse_all_messages(session); channel = switch_core_session_get_channel(session); @@ -914,6 +922,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_ x++; } + switch_core_session_stack_count(session, -1); + return SWITCH_STATUS_SUCCESS; } From 243f9f33b62529b612cd21b34438a26689e860ef Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 2 Jan 2018 18:38:45 -0600 Subject: [PATCH 096/264] FS-10749: [mod_amqp] Crash on unload after mod_amqp reloaded with command + incorrect command behavior #resolve --- .../mod_amqp/mod_amqp_command.c | 8 +++--- .../mod_amqp/mod_amqp_producer.c | 7 ++++-- .../event_handlers/mod_amqp/mod_amqp_utils.c | 25 +++++++++++++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_command.c b/src/mod/event_handlers/mod_amqp/mod_amqp_command.c index 851f52c46f..dba6d20eb0 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_command.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_command.c @@ -298,13 +298,13 @@ void * SWITCH_THREAD_FUNC mod_amqp_command_thread(switch_thread_t *thread, void amqp_empty_table); #endif - if (mod_amqp_log_if_amqp_error(amqp_get_rpc_reply(profile->conn_active->state), "Checking for command exchange")) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Profile[%s] failed to create missing command exchange", profile->name); + if (mod_amqp_log_if_amqp_error(amqp_get_rpc_reply(profile->conn_active->state), "Checking for command exchange\n")) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Profile[%s] failed to create missing command exchange\n", profile->name); continue; } /* Ensure we have a queue */ - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Creating command queue"); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Creating command queue\n"); recv_queue = amqp_queue_declare(profile->conn_active->state, // state 1, // channel profile->queue ? amqp_cstring_bytes(profile->queue) : amqp_empty_bytes, // queue name @@ -312,7 +312,7 @@ void * SWITCH_THREAD_FUNC mod_amqp_command_thread(switch_thread_t *thread, void 0, 1, // exclusive, auto-delete amqp_empty_table); // args - if (mod_amqp_log_if_amqp_error(amqp_get_rpc_reply(profile->conn_active->state), "Declaring queue")) { + if (mod_amqp_log_if_amqp_error(amqp_get_rpc_reply(profile->conn_active->state), "Declaring queue\n")) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Profile[%s] failed to connect with code(%d), sleeping for %dms\n", profile->name, status, profile->reconnect_interval_ms); switch_sleep(profile->reconnect_interval_ms * 1000); diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c b/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c index 0c3bc4e22e..940578b7cd 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c @@ -249,6 +249,7 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg) } else if (!strncmp(var, "content-type", 12)) { content_type = switch_core_strdup(profile->pool, val); } else if (!strncmp(var, "format_fields", 13)) { + char *tmp; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "amqp format fields : %s\n", val); if ((format_fields_size = mod_amqp_count_chars(val, ',')) >= MAX_ROUTING_KEY_FORMAT_FIELDS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "You can have only %d routing fields in the routing key.\n", @@ -257,9 +258,11 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg) } /* increment size because the count returned the number of separators, not number of fields */ + tmp = strdup(val); format_fields_size++; - switch_separate_string(val, ',', format_fields, MAX_ROUTING_KEY_FORMAT_FIELDS); + switch_separate_string(tmp, ',', format_fields, MAX_ROUTING_KEY_FORMAT_FIELDS); format_fields[format_fields_size] = NULL; + free(tmp); } else if (!strncmp(var, "event_filter", 12)) { /* Parse new events */ profile->event_subscriptions = switch_separate_string(val, ',', argv, (sizeof(argv) / sizeof(argv[0]))); @@ -343,7 +346,7 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg) amqp_empty_table); #endif - if (mod_amqp_log_if_amqp_error(amqp_get_rpc_reply(profile->conn_active->state), "Declaring exchange")) { + if (mod_amqp_log_if_amqp_error(amqp_get_rpc_reply(profile->conn_active->state), "Declaring exchange\n")) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile[%s] failed to create exchange\n", profile->name); goto err; } diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c b/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c index bd0289ca8f..9f0ed3ffd0 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c @@ -97,6 +97,31 @@ switch_status_t mod_amqp_do_config(switch_bool_t reload) return SWITCH_STATUS_FALSE; } + if (reload) { + switch_hash_index_t *hi; + mod_amqp_producer_profile_t *producer; + mod_amqp_command_profile_t *command; + mod_amqp_logging_profile_t *logging; + + switch_event_unbind_callback(mod_amqp_producer_event_handler); + + while ((hi = switch_core_hash_first(mod_amqp_globals.producer_hash))) { + switch_core_hash_this(hi, NULL, NULL, (void **)&producer); + mod_amqp_producer_destroy(&producer); + } + while ((hi = switch_core_hash_first(mod_amqp_globals.command_hash))) { + switch_core_hash_this(hi, NULL, NULL, (void **)&command); + mod_amqp_command_destroy(&command); + } + + switch_log_unbind_logger(mod_amqp_logging_recv); + + while ((hi = switch_core_hash_first(mod_amqp_globals.logging_hash))) { + switch_core_hash_this(hi, NULL, NULL, (void **)&logging); + mod_amqp_logging_destroy(&logging); + } + } + if ((profiles = switch_xml_child(cfg, "producers"))) { if ((profile = switch_xml_child(profiles, "profile"))) { for (; profile; profile = profile->next) { From fe05bacb848ddd6365d0c4e02026610cab182504 Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 2 Jan 2018 18:40:08 -0600 Subject: [PATCH 097/264] FS-10865: [mod_conference] conference transfer event reports incorrect info in New-Conference-Name #resolve --- src/mod/applications/mod_conference/conference_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index f81b1a1063..d8341361b2 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -3356,7 +3356,7 @@ switch_status_t conference_api_sub_transfer(conference_obj_t *conference, switch switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { conference_member_add_event_data(member, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Old-Conference-Name", conference->name); - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "New-Conference-Name", argv[3]); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "New-Conference-Name", argv[2]); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "transfer"); switch_event_fire(&event); } From 16a31c4be5465a17d44918e42f32ae917742a2b0 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 4 Jan 2018 22:12:57 -0600 Subject: [PATCH 098/264] FS-10871: [mod_conference] Zoomed layouts do not auto-center in mod_conference #resolve --- src/mod/applications/mod_conference/conference_video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index e66a6dd689..2fab1a01a3 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -743,7 +743,7 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, } else { crop_x = use_geometry->x; } - } else if (screen_aspect > img_aspect) { + } else if (screen_aspect < img_aspect) { crop_x = img->d_w / 4; } @@ -753,7 +753,7 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, } else { crop_y = use_geometry->y; } - } else if (screen_aspect < img_aspect) { + } else if (screen_aspect > img_aspect) { crop_y = img->d_h / 4; } From 6387cc1ffdaa4909ed159b79c3c1d6df2d1fb020 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 10 Jan 2018 14:51:02 -0600 Subject: [PATCH 099/264] FS-10883: [mod_conference] Conference member can get stuck read locked #resolve --- src/mod/applications/mod_conference/conference_member.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 5121ee3168..274f274c52 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -1070,7 +1070,7 @@ void conference_member_set_floor_holder(conference_obj_t *conference, conference } if (member && conference_utils_member_test_flag(member, MFLAG_DED_VID_LAYER)) { - return; + goto end; } conference->floor_holder_score_iir = 0; From 1745a36c9855b6323905576cdd828bcc50d51081 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 11 Jan 2018 15:02:39 -0600 Subject: [PATCH 100/264] FS-10893: [mod_conference] Add more banner text params #resolve --- .../mod_conference/conference_video.c | 60 ++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 2fab1a01a3..c1bd8ff425 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -1168,19 +1168,75 @@ void conference_member_set_logo(conference_member_t *member, const char *path) if (params && (var = switch_event_get_header(params, "text"))) { switch_image_t *img = NULL; const char *tmp; - int x = 0, y = 0; + int x = 0, y = 0, center = 0, center_off = 0; + if ((tmp = switch_event_get_header(params, "center_offset"))) { + center_off = atoi(tmp); + if (center_off < 0) { + center_off = 0; + } + } + if ((tmp = switch_event_get_header(params, "text_x"))) { - x = atoi(tmp); + if (!strcasecmp(tmp, "center")) { + center = 1; + } else { + x = atoi(tmp); + if (x < 0) x = 0; + } } if ((tmp = switch_event_get_header(params, "text_y"))) { y = atoi(tmp); + if (y < 0) y = 0; } img = switch_img_write_text_img(member->video_logo->d_w, member->video_logo->d_h, SWITCH_FALSE, var); switch_img_fit(&img, member->video_logo->d_w, member->video_logo->d_h, SWITCH_FIT_NECESSARY); switch_img_attenuate(member->video_logo); + + if (center) { + x = center_off + ((member->video_logo->d_w - center_off - img->d_w) / 2); + } + + switch_img_patch(member->video_logo, img, x, y); + switch_img_free(&img); + } + + if (params && (var = switch_event_get_header(params, "alt_text"))) { + switch_image_t *img = NULL; + const char *tmp; + int x = 0, y = 0, center = 0, center_off = 0; + + if ((tmp = switch_event_get_header(params, "alt_center_offset"))) { + center_off = atoi(tmp); + if (center_off < 0) { + center_off = 0; + } + } + + if ((tmp = switch_event_get_header(params, "alt_text_x"))) { + if (!strcasecmp(tmp, "center")) { + center = 1; + } else { + x = atoi(tmp); + if (x < 0) x = 0; + } + } + + if ((tmp = switch_event_get_header(params, "alt_text_y"))) { + y = atoi(tmp); + if (y < 0) y = 0; + } + + img = switch_img_write_text_img(member->video_logo->d_w, member->video_logo->d_h, SWITCH_FALSE, var); + switch_img_fit(&img, member->video_logo->d_w, member->video_logo->d_h, SWITCH_FIT_NECESSARY); + switch_img_attenuate(member->video_logo); + + if (center) { + x = center_off + ((member->video_logo->d_w - center_off - img->d_w) / 2); + } + switch_img_patch(member->video_logo, img, x, y); switch_img_free(&img); } From 4b39b164cf19f44ddd55749825f2d6b6ff6f9651 Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 11 Jan 2018 18:44:22 -0600 Subject: [PATCH 101/264] FS-10894: [Packaging-Debian] Update maintiner --- debian/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh index 01fb82530d..bc8ea077c2 100755 --- a/debian/bootstrap.sh +++ b/debian/bootstrap.sh @@ -301,7 +301,7 @@ print_source_control () { Source: freeswitch Section: comm Priority: optional -Maintainer: Travis Cross +Maintainer: FreeSWITCH Solutions, LLC Build-Depends: # for debian ${debhelper_dep}, From cfd7761e9f77a42b24349d93215e3b25a0ae01df Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 12 Jan 2018 00:37:35 -0600 Subject: [PATCH 102/264] FS-10896: [freeswitch-core] Parse error on originate syntax with nested square brackets #resolve --- src/switch_ivr_originate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 3794ba73b4..872ed4ff57 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -2628,7 +2628,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess p = pipe_names[r]; while (p && *p) { - if (*p == '[') { + if (!end && *p == '[') { end = switch_find_end_paren(p, '[', ']'); if (*(p+1) == '^' && *(p + 2) == '^') { alt = 1; @@ -2652,7 +2652,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess } if (p == end) { - end = switch_strchr_strict(p, '[', " "); + end = NULL; } p++; From d9002f19a72d776930747280a592f1c044e8de36 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 12 Jan 2018 00:40:50 -0600 Subject: [PATCH 103/264] FS-10897: [mod_verto] Possible crash in verto during error condition #resolve --- src/mod/endpoints/mod_verto/mod_verto.c | 69 +++++++++++++++++-------- src/mod/endpoints/mod_verto/mod_verto.h | 3 +- 2 files changed, 50 insertions(+), 22 deletions(-) diff --git a/src/mod/endpoints/mod_verto/mod_verto.c b/src/mod/endpoints/mod_verto/mod_verto.c index 2eced48548..cc11c3d209 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.c +++ b/src/mod/endpoints/mod_verto/mod_verto.c @@ -2118,6 +2118,7 @@ static void track_pvt(verto_pvt_t *tech_pvt) switch_thread_rwlock_wrlock(verto_globals.tech_rwlock); tech_pvt->next = verto_globals.tech_head; verto_globals.tech_head = tech_pvt; + switch_set_flag(tech_pvt, TFLAG_TRACKED); switch_thread_rwlock_unlock(verto_globals.tech_rwlock); } @@ -2125,26 +2126,31 @@ static void untrack_pvt(verto_pvt_t *tech_pvt) { verto_pvt_t *p, *last = NULL; int wake = 0; - + switch_thread_rwlock_wrlock(verto_globals.tech_rwlock); + if (tech_pvt->detach_time) { verto_globals.detached--; tech_pvt->detach_time = 0; wake = 1; } - for(p = verto_globals.tech_head; p; p = p->next) { - if (p == tech_pvt) { - if (last) { - last->next = p->next; - } else { - verto_globals.tech_head = p->next; + if (switch_test_flag(tech_pvt, TFLAG_TRACKED)) { + switch_clear_flag(tech_pvt, TFLAG_TRACKED); + for(p = verto_globals.tech_head; p; p = p->next) { + if (p == tech_pvt) { + if (last) { + last->next = p->next; + } else { + verto_globals.tech_head = p->next; + } + break; } - break; - } - last = p; + last = p; + } } + switch_thread_rwlock_unlock(verto_globals.tech_rwlock); if (wake) attach_wake(); @@ -2187,7 +2193,7 @@ static switch_status_t verto_on_hangup(switch_core_session_t *session) return SWITCH_STATUS_SUCCESS; } -static void verto_set_media_options(verto_pvt_t *tech_pvt, verto_profile_t *profile); +static switch_status_t verto_set_media_options(verto_pvt_t *tech_pvt, verto_profile_t *profile); static switch_status_t verto_connect(switch_core_session_t *session, const char *method) { @@ -2230,7 +2236,11 @@ static switch_status_t verto_connect(switch_core_session_t *session, const char switch_channel_set_variable(tech_pvt->channel, "media_webrtc", "true"); switch_core_session_set_ice(tech_pvt->session); - verto_set_media_options(tech_pvt, jsock->profile); + if (verto_set_media_options(tech_pvt, jsock->profile) != SWITCH_STATUS_SUCCESS) { + status = SWITCH_STATUS_FALSE; + switch_thread_rwlock_unlock(jsock->rwlock); + return status; + } switch_channel_set_variable(tech_pvt->channel, "verto_profile_name", jsock->profile->name); @@ -2241,7 +2251,6 @@ static switch_status_t verto_connect(switch_core_session_t *session, const char if ((status = switch_core_media_choose_ports(tech_pvt->session, SWITCH_TRUE, SWITCH_TRUE)) != SWITCH_STATUS_SUCCESS) { //if ((status = switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0)) != SWITCH_STATUS_SUCCESS) { - switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); switch_thread_rwlock_unlock(jsock->rwlock); return status; } @@ -2346,7 +2355,7 @@ static switch_status_t verto_on_init(switch_core_session_t *session) switch_channel_set_flag(tech_pvt->channel, CF_VIDEO_BREAK); switch_core_session_kill_channel(tech_pvt->session, SWITCH_SIG_BREAK); - return status; + goto end; } if (switch_channel_direction(tech_pvt->channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { @@ -2357,6 +2366,12 @@ static switch_status_t verto_on_init(switch_core_session_t *session) } } + end: + + if (status == SWITCH_STATUS_SUCCESS) { + track_pvt(tech_pvt); + } + return status; } @@ -2380,10 +2395,12 @@ static switch_state_handler_table_t verto_state_handlers = { -static void verto_set_media_options(verto_pvt_t *tech_pvt, verto_profile_t *profile) +static switch_status_t verto_set_media_options(verto_pvt_t *tech_pvt, verto_profile_t *profile) { uint32_t i; + + switch_mutex_lock(profile->mutex); if (!zstr(profile->rtpip[profile->rtpip_cur])) { tech_pvt->mparams->rtpip4 = switch_core_session_strdup(tech_pvt->session, profile->rtpip[profile->rtpip_cur++]); tech_pvt->mparams->rtpip = tech_pvt->mparams->rtpip4; @@ -2403,11 +2420,13 @@ static void verto_set_media_options(verto_pvt_t *tech_pvt, verto_profile_t *prof profile->rtpip_cur6 = 0; } } + switch_mutex_unlock(profile->mutex); if (zstr(tech_pvt->mparams->rtpip)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "%s has no media ip, check your configuration\n", switch_channel_get_name(tech_pvt->channel)); - switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL); + //switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL); + return SWITCH_STATUS_FALSE; } tech_pvt->mparams->extrtpip = tech_pvt->mparams->extsipip = profile->extrtpip; @@ -2459,6 +2478,8 @@ static void verto_set_media_options(verto_pvt_t *tech_pvt, verto_profile_t *prof if (profile->enable_text && !tech_pvt->text_read_buffer) { set_text_funcs(tech_pvt->session); } + + return SWITCH_STATUS_SUCCESS; } static switch_status_t verto_media(switch_core_session_t *session) @@ -2638,13 +2659,16 @@ static int verto_recover_callback(switch_core_session_t *session) if ((tech_pvt->smh = switch_core_session_get_media_handle(session))) { tech_pvt->mparams = switch_core_media_get_mparams(tech_pvt->smh); - verto_set_media_options(tech_pvt, profile); + if (verto_set_media_options(tech_pvt, profile) != SWITCH_STATUS_SUCCESS) { + UNPROTECT_INTERFACE(verto_endpoint_interface); + return 0; + } } switch_channel_add_state_handler(channel, &verto_state_handlers); switch_core_event_hook_add_receive_message(session, messagehook); - track_pvt(tech_pvt); + //track_pvt(tech_pvt); //switch_channel_clear_flag(tech_pvt->channel, CF_ANSWERED); //switch_channel_clear_flag(tech_pvt->channel, CF_EARLY_MEDIA); @@ -3612,7 +3636,10 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock if ((tech_pvt->smh = switch_core_session_get_media_handle(session))) { tech_pvt->mparams = switch_core_media_get_mparams(tech_pvt->smh); - verto_set_media_options(tech_pvt, jsock->profile); + if (verto_set_media_options(tech_pvt, jsock->profile) != SWITCH_STATUS_SUCCESS) { + cJSON_AddItemToObject(obj, "message", cJSON_CreateString("Cannot set media options")); + err = 1; goto cleanup; + } } else { cJSON_AddItemToObject(obj, "message", cJSON_CreateString("Cannot create media handle")); err = 1; goto cleanup; @@ -3767,7 +3794,7 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock switch_channel_add_state_handler(channel, &verto_state_handlers); switch_core_event_hook_add_receive_message(session, messagehook); switch_channel_set_state(channel, CS_INIT); - track_pvt(tech_pvt); + //track_pvt(tech_pvt); switch_core_session_thread_launch(session); cleanup: @@ -5522,7 +5549,7 @@ static switch_call_cause_t verto_outgoing_channel(switch_core_session_t *session switch_channel_add_state_handler(channel, &verto_state_handlers); switch_core_event_hook_add_receive_message(*new_session, messagehook); switch_channel_set_state(channel, CS_INIT); - track_pvt(tech_pvt); + //track_pvt(tech_pvt); } end: diff --git a/src/mod/endpoints/mod_verto/mod_verto.h b/src/mod/endpoints/mod_verto/mod_verto.h index 532cb1740b..675813f0e7 100644 --- a/src/mod/endpoints/mod_verto/mod_verto.h +++ b/src/mod/endpoints/mod_verto/mod_verto.h @@ -169,7 +169,8 @@ typedef struct ips { typedef enum { TFLAG_SENT_MEDIA = (1 << 0), - TFLAG_ATTACH_REQ = (1 << 1) + TFLAG_ATTACH_REQ = (1 << 1), + TFLAG_TRACKED = (1 << 2) } tflag_t; typedef struct verto_pvt_s { From 352cc3526d5db2e4b78b40747bd51dc9c7ef4a46 Mon Sep 17 00:00:00 2001 From: Brian West Date: Sat, 13 Jan 2018 15:46:39 -0600 Subject: [PATCH 104/264] FS-10903: [mod_sofia,mod_valet_parking] Fix Issue with subscriptions and Valet Parking #resolve --- .../mod_valet_parking/mod_valet_parking.c | 15 +++++++++++++++ src/mod/endpoints/mod_sofia/sofia_presence.c | 1 + 2 files changed, 16 insertions(+) diff --git a/src/mod/applications/mod_valet_parking/mod_valet_parking.c b/src/mod/applications/mod_valet_parking/mod_valet_parking.c index bcfe76d655..4bd9ac6e3d 100644 --- a/src/mod/applications/mod_valet_parking/mod_valet_parking.c +++ b/src/mod/applications/mod_valet_parking/mod_valet_parking.c @@ -786,6 +786,7 @@ static void pres_event_handler(switch_event_t *event) char *dup_to = NULL, *lot_name, *dup_lot_name = NULL, *domain_name; valet_lot_t *lot; int found = 0; + const char *call_id; if (!to || strncasecmp(to, "park+", 5) || !strchr(to, '@')) { return; @@ -801,6 +802,8 @@ static void pres_event_handler(switch_event_t *event) *domain_name++ = '\0'; } + call_id = switch_event_get_header(event, "sub-call-id"); + dup_lot_name = switch_mprintf("%q@%q", lot_name, domain_name); if ((lot = valet_find_lot(lot_name, SWITCH_FALSE)) || (dup_lot_name && (lot = valet_find_lot(dup_lot_name, SWITCH_FALSE)))) { @@ -821,6 +824,9 @@ static void pres_event_handler(switch_event_t *event) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_ROUTING"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "confirmed"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "presence-call-direction", "inbound"); + if (call_id) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-id", call_id); + } switch_event_fire(&event); } found++; @@ -838,6 +844,9 @@ static void pres_event_handler(switch_event_t *event) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "terminated"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "presence-call-direction", "inbound"); + if (call_id) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-id", call_id); + } switch_event_fire(&event); } } @@ -883,6 +892,9 @@ static void pres_event_handler(switch_event_t *event) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_ROUTING"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "confirmed"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "presence-call-direction", token->bridged == 0 ? "outbound" : "inbound"); + if (call_id) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-id", call_id); + } switch_event_fire(&event); } } @@ -908,6 +920,9 @@ static void pres_event_handler(switch_event_t *event) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "terminated"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "presence-call-direction", "inbound"); + if (call_id) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-id", call_id); + } switch_event_fire(&event); } diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index ef3a4cfaad..104a3ef4cb 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -4366,6 +4366,7 @@ void sofia_presence_handle_sip_i_subscribe(int status, switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "event_type", "presence"); switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog"); switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str); + switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "sub-call-id", call_id); switch_event_fire(&sevent); } From 433c2b6b89fb0da657edd600687ff5d40e9d4636 Mon Sep 17 00:00:00 2001 From: Brian West Date: Sat, 13 Jan 2018 15:56:10 -0600 Subject: [PATCH 105/264] FS-10899: [core] 3pcc-mode=proxy is proxying SDP in the 200OK with late offer invites #resolve --- src/mod/endpoints/mod_sofia/mod_sofia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 72acad91d1..2f437572bf 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -766,7 +766,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) switch_channel_set_flag(channel, CF_3PCC); } - if (b_sdp && !switch_channel_var_true(channel, "3pcc_always_gen_sdp")) { + if (b_sdp && is_proxy && !switch_channel_var_true(channel, "3pcc_always_gen_sdp")) { switch_core_media_set_local_sdp(session, b_sdp, SWITCH_TRUE); } else { switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0); From 4fc7ee77204069f0eb8bfd40508de5fb3b1ce9b9 Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 16 Jan 2018 09:01:13 -0600 Subject: [PATCH 106/264] FS-10908: [mod_amqp] AMQP routing key (format_fields) formation broke and invalid reads reported by valgrind #resolve --- .../mod_amqp/mod_amqp_producer.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c b/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c index 940578b7cd..305b366ddb 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_producer.c @@ -249,23 +249,22 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg) } else if (!strncmp(var, "content-type", 12)) { content_type = switch_core_strdup(profile->pool, val); } else if (!strncmp(var, "format_fields", 13)) { - char *tmp; - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "amqp format fields : %s\n", val); - if ((format_fields_size = mod_amqp_count_chars(val, ',')) >= MAX_ROUTING_KEY_FORMAT_FIELDS) { + char *tmp = switch_core_strdup(profile->pool, val); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "amqp format fields : %s\n", tmp); + if ((format_fields_size = mod_amqp_count_chars(tmp, ',')) >= MAX_ROUTING_KEY_FORMAT_FIELDS) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "You can have only %d routing fields in the routing key.\n", MAX_ROUTING_KEY_FORMAT_FIELDS); goto err; } /* increment size because the count returned the number of separators, not number of fields */ - tmp = strdup(val); format_fields_size++; switch_separate_string(tmp, ',', format_fields, MAX_ROUTING_KEY_FORMAT_FIELDS); format_fields[format_fields_size] = NULL; - free(tmp); } else if (!strncmp(var, "event_filter", 12)) { + char *tmp = switch_core_strdup(profile->pool, val); /* Parse new events */ - profile->event_subscriptions = switch_separate_string(val, ',', argv, (sizeof(argv) / sizeof(argv[0]))); + profile->event_subscriptions = switch_separate_string(tmp, ',', argv, (sizeof(argv) / sizeof(argv[0]))); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Found %d subscriptions\n", profile->event_subscriptions); @@ -274,6 +273,7 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "The switch event %s was not recognised.\n", argv[arg]); } } + } } /* params for loop */ } @@ -290,10 +290,12 @@ switch_status_t mod_amqp_producer_create(char *name, switch_xml_t cfg) for(i = 0; i < format_fields_size; i++) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "amqp routing key %d : %s\n", i, format_fields[i]); if(profile->enable_fallback_format_fields) { - profile->format_fields[i].size = switch_separate_string(format_fields[i], '|', profile->format_fields[i].name, MAX_ROUTING_KEY_FORMAT_FALLBACK_FIELDS); + profile->format_fields[i].size = switch_separate_string(format_fields[i], '|', + profile->format_fields[i].name, MAX_ROUTING_KEY_FORMAT_FALLBACK_FIELDS); if(profile->format_fields[i].size > 1) { for(arg = 0; arg < profile->format_fields[i].size; arg++) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "amqp routing key %d : sub key %d : %s\n", i, arg, profile->format_fields[i].name[arg]); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, + "amqp routing key %d : sub key %d : %s\n", i, arg, profile->format_fields[i].name[arg]); } } } else { From 228af00acbea52649e1fea04c927f55ff3b3c516 Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 16 Jan 2018 12:41:50 -0600 Subject: [PATCH 107/264] FS-10904: [core] DTMF only works from one phone during shared call (SCA) #resolve --- src/switch_rtp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 3c75988bc4..44c4b041c4 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -5238,8 +5238,8 @@ static void set_dtmf_delay(switch_rtp_t *rtp_session, uint32_t ms, uint32_t max_ rtp_session->queue_delay = upsamp; if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) { - rtp_session->max_next_write_samplecount = rtp_session->write_timer.samplecount + max_upsamp; - rtp_session->next_write_samplecount = rtp_session->write_timer.samplecount + upsamp; + rtp_session->max_next_write_samplecount = rtp_session->timer.samplecount + max_upsamp; + rtp_session->next_write_samplecount = rtp_session->timer.samplecount + upsamp; rtp_session->last_write_ts += upsamp; } @@ -5326,7 +5326,7 @@ static void do_2833(switch_rtp_t *rtp_session) if (rtp_session->flags[SWITCH_RTP_FLAG_USE_TIMER]) { //switch_core_timer_sync(&rtp_session->write_timer); - if (rtp_session->write_timer.samplecount < rtp_session->next_write_samplecount) { + if (rtp_session->timer.samplecount < rtp_session->next_write_samplecount) { return; } From adb813e089e00c9abdca1641c97e89d0ffef8d45 Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 22 Jan 2018 15:50:39 -0600 Subject: [PATCH 108/264] FS-10880: [mod_sofia] SIP INFO DTMF method not working on b-leg #resolve --- src/mod/endpoints/mod_sofia/mod_sofia.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index 2f437572bf..a6afe36f97 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -1256,6 +1256,8 @@ static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const swi tech_pvt = (private_object_t *) switch_core_session_get_private(session); switch_assert(tech_pvt != NULL); + switch_core_media_check_dtmf_type(session); + dtmf_type = tech_pvt->mparams.dtmf_type; /* We only can send INFO when we have no media */ From 94a094c5efedc698345ba6159827d5862d9d8cbe Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Mon, 29 Jan 2018 13:39:41 -0600 Subject: [PATCH 109/264] FS-10926: [mod_sofia] fix crash from malformed as-feature-event subscribe messae with malformed xml --- src/mod/endpoints/mod_sofia/sofia_presence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 104a3ef4cb..d04fb02533 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -4253,7 +4253,7 @@ void sofia_presence_handle_sip_i_subscribe(int status, switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "device", device->txt); } - if (!strcmp(xml->name, "SetDoNotDisturb")) { + if (xml->name && !strcmp(xml->name, "SetDoNotDisturb")) { switch_xml_t action = NULL; switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Feature-Action", "SetDoNotDisturb"); @@ -4263,7 +4263,7 @@ void sofia_presence_handle_sip_i_subscribe(int status, } } - if (!strcmp(xml->name, "SetForwarding")) { + if (xml->name && !strcmp(xml->name, "SetForwarding")) { switch_xml_t cfwd_type, cfwd_enable, cfwd_target; switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Feature-Action", "SetCallForward"); From 027ae795169e6f8d2019603932f77593b85dc91c Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 1 Feb 2018 21:32:14 -0600 Subject: [PATCH 110/264] FS-10913: [mod_sofia] ignore_early_media=ring_ready not transitioning #resolve --- src/mod/endpoints/mod_sofia/sofia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 54f3e6802a..b50857b9d6 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -7300,7 +7300,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Remote SDP:\n%s\n", r_sdp); tech_pvt->mparams.remote_sdp_str = switch_core_session_strdup(session, r_sdp); - + switch_channel_mark_pre_answered(channel); //if ((sofia_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION) || switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND)) { // switch_core_media_set_sdp_codec_string(session, r_sdp, status < 200 ? SDP_TYPE_REQUEST : SDP_TYPE_RESPONSE); //} From a14dcfef3d4520b8c2d92b3a22832a86da4ae153 Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 6 Feb 2018 14:25:29 -0600 Subject: [PATCH 111/264] FS-10913: [mod_sofia] ignore_early_media=ring_ready not transitioning #resolve --- src/mod/endpoints/mod_sofia/sofia.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index b50857b9d6..181e40485b 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -7300,7 +7300,9 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Remote SDP:\n%s\n", r_sdp); tech_pvt->mparams.remote_sdp_str = switch_core_session_strdup(session, r_sdp); - switch_channel_mark_pre_answered(channel); + if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND) { + switch_channel_mark_pre_answered(channel); + } //if ((sofia_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION) || switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND)) { // switch_core_media_set_sdp_codec_string(session, r_sdp, status < 200 ? SDP_TYPE_REQUEST : SDP_TYPE_RESPONSE); //} From dd907633718561c09f00740316b50144fd7c0b62 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sat, 17 Feb 2018 15:34:33 +0300 Subject: [PATCH 112/264] FS-9753: [mod_sofia] Fix crash when accessing the WSS interface via regular HTTPS Conflicts: libs/sofia-sip/.update --- libs/sofia-sip/.update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 1bb35370c6..e94c5432f4 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Mon Jan 15 01:37:50 EST 2018 +Wed Feb 21 15:29:04 CST 2018 From 00714357576b0775c7d8d39d500c9dff20368093 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 14 Mar 2018 13:40:08 -0500 Subject: [PATCH 113/264] FS-11031: [mod_conference] refresh and keyframes sent too often in multi-canvas mode #resolve --- .../mod_conference/conference_video.c | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index c1bd8ff425..a324cb504f 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -2667,10 +2667,25 @@ switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_ca void conference_video_next_canvas(conference_member_t *imember) { - if (imember->canvas_id == (int)imember->conference->canvas_count - 1) { - imember->canvas_id = 0; - } else { - imember->canvas_id++; + int x = 0, y = 0; + + if (imember->conference->canvas_count < 2) { + return; + } + + y = imember->canvas_id; + + for (x = 0; x < imember->conference->canvas_count; x++) { + if (y == (int)imember->conference->canvas_count - 1) { + y = 0; + } else { + y++; + } + + if (imember->conference->canvases[y]->video_count < imember->conference->canvases[y]->total_layers) { + imember->canvas_id = y; + break; + } } imember->layer_timeout = DEFAULT_LAYER_TIMEOUT; From 422f348240eee2a384404b6c9f42b8e394c13bda Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 15 Mar 2018 12:43:02 -0500 Subject: [PATCH 114/264] FS-11036: [mod_rtmp] No audio on rtmp clients #resolve --- src/mod/endpoints/mod_rtmp/mod_rtmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/endpoints/mod_rtmp/mod_rtmp.c b/src/mod/endpoints/mod_rtmp/mod_rtmp.c index 76d4ea563d..5a01436d22 100644 --- a/src/mod/endpoints/mod_rtmp/mod_rtmp.c +++ b/src/mod/endpoints/mod_rtmp/mod_rtmp.c @@ -176,6 +176,8 @@ switch_status_t rtmp_tech_init(rtmp_private_t *tech_pvt, rtmp_session_t *rsessio on_rtmp_tech_init(session, tech_pvt); } + switch_channel_set_flag(tech_pvt->channel, CF_AUDIO); + switch_core_session_set_private(session, tech_pvt); // switch_core_session_start_video_thread(session); From 4876cb76a7559822657f411fdda0a862fc312cfa Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Fri, 9 Mar 2018 17:25:34 -0800 Subject: [PATCH 115/264] FS-11037: [mod_lua] reduce logging levels --- src/mod/languages/mod_lua/freeswitch_lua.cpp | 4 ++-- src/mod/languages/mod_lua/mod_lua.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mod/languages/mod_lua/freeswitch_lua.cpp b/src/mod/languages/mod_lua/freeswitch_lua.cpp index 43d00865cf..2225cae07c 100644 --- a/src/mod/languages/mod_lua/freeswitch_lua.cpp +++ b/src/mod/languages/mod_lua/freeswitch_lua.cpp @@ -369,7 +369,7 @@ Dbh::Dbh(char *dsn, char *user, char *pass) } if (!zstr(dsn) && switch_cache_db_get_db_handle_dsn(&dbh, dsn) == SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "DBH handle %p Connected.\n", (void *) dbh); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "DBH handle %p Connected.\n", (void *) dbh); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Connection failed. DBH NOT Connected.\n"); } @@ -398,7 +398,7 @@ char *Dbh::last_error() bool Dbh::release() { if (dbh) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "DBH handle %p released.\n", (void *) dbh); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "DBH handle %p released.\n", (void *) dbh); switch_cache_db_release_db_handle(&dbh); return true; } diff --git a/src/mod/languages/mod_lua/mod_lua.cpp b/src/mod/languages/mod_lua/mod_lua.cpp index b28d16f715..47d14c6d48 100644 --- a/src/mod/languages/mod_lua/mod_lua.cpp +++ b/src/mod/languages/mod_lua/mod_lua.cpp @@ -459,7 +459,7 @@ static void lua_event_handler(switch_event_t *event) } mod_lua_conjure_event(L, event, "event", 1); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "lua event hook: execute '%s'\n", (char *)script); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "lua event hook: execute '%s'\n", (char *)script); lua_parse_and_execute(L, (char *)script, NULL); lua_uninit(L); From 76795ac2e21b382ea7049e0f2d4f2f76c12e7c1d Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 15 Mar 2018 17:06:25 -0400 Subject: [PATCH 116/264] FS-10853: Fix unitialzed var --- src/switch_core_media.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 0c546221a3..9ae99dc78e 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -1336,7 +1336,7 @@ static switch_crypto_key_material_t* switch_core_media_crypto_append_key_materia */ static const char* switch_core_media_crypto_find_key_material_candidate_end(const char *p) { - const char *end; + const char *end = NULL; switch_assert(p != NULL); From b496635a8c25691d296658de2d6a70f7334f9ade Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 15 Mar 2018 17:28:16 -0400 Subject: [PATCH 117/264] FS-11038: [mod_sofia] fix crash in gwlist api command --- src/mod/endpoints/mod_sofia/sofia_glue.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 3db4ba6012..c01b27d1f4 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -1693,7 +1693,6 @@ void sofia_glue_del_every_gateway(sofia_profile_t *profile) void sofia_glue_gateway_list(sofia_profile_t *profile, switch_stream_handle_t *stream, int up) { sofia_gateway_t *gp = NULL; - char *r = (char *) stream->data; switch_mutex_lock(mod_sofia_globals.hash_mutex); for (gp = profile->gateways; gp; gp = gp->next) { @@ -1704,10 +1703,6 @@ void sofia_glue_gateway_list(sofia_profile_t *profile, switch_stream_handle_t *s } } - if (r) { - end_of(r) = '\0'; - } - switch_mutex_unlock(mod_sofia_globals.hash_mutex); } From 7f1d6385253a7a3a0b0e90a15d6d3e506001e6f1 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Tue, 20 Mar 2018 10:32:52 -0400 Subject: [PATCH 118/264] FS-11047: [Debian] re-enable mod_v8 package build --- debian/bootstrap.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh index bc8ea077c2..c12a8ce777 100755 --- a/debian/bootstrap.sh +++ b/debian/bootstrap.sh @@ -57,7 +57,6 @@ avoid_mods=( endpoints/mod_unicall event_handlers/mod_smpp formats/mod_webm - languages/mod_v8 sdk/autotools xml_int/mod_xml_ldap xml_int/mod_xml_radius From 3a502eaf6e0e1ad18751181a27ff14c00b40a3ae Mon Sep 17 00:00:00 2001 From: Piotr Gregor Date: Wed, 21 Mar 2018 16:58:01 +0000 Subject: [PATCH 119/264] FS-11052: Allow alias for crypto suites For outgoing calls send AES crypto in offer using corrected names for keys of length 192 and 256, i.e. names containing _192_CM_ and _256_CM_ instead of _CM_192_ and CM_256_. For incoming calls accept both naming conventions, decaying to same entry in SUITES. --- src/include/switch_rtp.h | 1 + src/switch_core_media.c | 54 ++++++++++++++++++++++------------------ 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/include/switch_rtp.h b/src/include/switch_rtp.h index 2d5c00a0d1..bed82a5b21 100644 --- a/src/include/switch_rtp.h +++ b/src/include/switch_rtp.h @@ -65,6 +65,7 @@ typedef enum { typedef struct switch_srtp_crypto_suite_s { char *name; + const char *alias; switch_rtp_crypto_key_type_t type; int keysalt_len; int salt_len; diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 9ae99dc78e..221ff03b84 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -273,15 +273,15 @@ struct switch_media_handle_s { }; switch_srtp_crypto_suite_t SUITES[CRYPTO_INVALID] = { - { "AEAD_AES_256_GCM_8", AEAD_AES_256_GCM_8, 44, 12}, - { "AEAD_AES_128_GCM_8", AEAD_AES_128_GCM_8, 28, 12}, - { "AES_CM_256_HMAC_SHA1_80", AES_CM_256_HMAC_SHA1_80, 46, 14}, - { "AES_CM_192_HMAC_SHA1_80", AES_CM_192_HMAC_SHA1_80, 38, 14}, - { "AES_CM_128_HMAC_SHA1_80", AES_CM_128_HMAC_SHA1_80, 30, 14}, - { "AES_CM_256_HMAC_SHA1_32", AES_CM_256_HMAC_SHA1_32, 46, 14}, - { "AES_CM_192_HMAC_SHA1_32", AES_CM_192_HMAC_SHA1_32, 38, 14}, - { "AES_CM_128_HMAC_SHA1_32", AES_CM_128_HMAC_SHA1_32, 30, 14}, - { "AES_CM_128_NULL_AUTH", AES_CM_128_NULL_AUTH, 30, 14} + { "AEAD_AES_256_GCM_8", "", AEAD_AES_256_GCM_8, 44, 12}, + { "AEAD_AES_128_GCM_8", "", AEAD_AES_128_GCM_8, 28, 12}, + { "AES_256_CM_HMAC_SHA1_80", "AES_CM_256_HMAC_SHA1_80", AES_CM_256_HMAC_SHA1_80, 46, 14}, + { "AES_192_CM_HMAC_SHA1_80", "AES_CM_192_HMAC_SHA1_80", AES_CM_192_HMAC_SHA1_80, 38, 14}, + { "AES_CM_128_HMAC_SHA1_80", "", AES_CM_128_HMAC_SHA1_80, 30, 14}, + { "AES_256_CM_HMAC_SHA1_32", "AES_CM_256_HMAC_SHA1_32", AES_CM_256_HMAC_SHA1_32, 46, 14}, + { "AES_192_CM_HMAC_SHA1_32", "AES_CM_192_HMAC_SHA1_32", AES_CM_192_HMAC_SHA1_32, 38, 14}, + { "AES_CM_128_HMAC_SHA1_32", "", AES_CM_128_HMAC_SHA1_32, 30, 14}, + { "AES_CM_128_NULL_AUTH", "", AES_CM_128_NULL_AUTH, 30, 14} }; SWITCH_DECLARE(switch_rtp_crypto_key_type_t) switch_core_media_crypto_str2type(const char *str) @@ -289,7 +289,7 @@ SWITCH_DECLARE(switch_rtp_crypto_key_type_t) switch_core_media_crypto_str2type(c int i; for (i = 0; i < CRYPTO_INVALID; i++) { - if (!strncasecmp(str, SUITES[i].name, strlen(SUITES[i].name))) { + if (!strncasecmp(str, SUITES[i].name, strlen(SUITES[i].name)) || (SUITES[i].alias && !strncasecmp(str, SUITES[i].alias, strlen(SUITES[i].alias)))) { return SUITES[i].type; } } @@ -1140,10 +1140,12 @@ SWITCH_DECLARE(void) switch_core_media_parse_rtp_bugs(switch_rtp_bug_flag_t *fla } } - +/** + * If @use_alias != 0 then send crypto with alias name instead of name. + */ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh, switch_media_type_t type, - int index, switch_rtp_crypto_key_type_t ctype, switch_rtp_crypto_direction_t direction, int force) + int index, switch_rtp_crypto_key_type_t ctype, switch_rtp_crypto_direction_t direction, int force, int use_alias) { unsigned char b64_key[512] = ""; unsigned char *key; @@ -1196,9 +1198,9 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh if (index == SWITCH_NO_CRYPTO_TAG) index = ctype + 1; if (switch_channel_var_true(channel, "rtp_secure_media_mki")) { - engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s|2^31|1:1", index, SUITES[ctype].name, b64_key); + engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s|2^31|1:1", index, (use_alias ? SUITES[ctype].alias : SUITES[ctype].name), b64_key); } else { - engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s", index, SUITES[ctype].name, b64_key); + engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s", index, (use_alias ? SUITES[ctype].alias : SUITES[ctype].name), b64_key); } switch_channel_set_variable_name_printf(smh->session->channel, engine->ssec[ctype].local_crypto_key, "rtp_last_%s_local_crypto_key", type2str(type)); @@ -1218,7 +1220,6 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh return SWITCH_STATUS_SUCCESS; } - #define CRYPTO_KEY_MATERIAL_LIFETIME_MKI_ERR 0x0u #define CRYPTO_KEY_MATERIAL_MKI 0x1u #define CRYPTO_KEY_MATERIAL_LIFETIME 0x2u @@ -1771,8 +1772,6 @@ static void switch_core_session_parse_crypto_prefs(switch_core_session_t *sessio } } - - SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_session_t *session, const char *varname, switch_media_type_t type, const char *crypto, int crypto_tag, switch_sdp_type_t sdp_type) @@ -1781,6 +1780,7 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio int i = 0; int ctype = 0; const char *vval = NULL; + int use_alias = 0; switch_rtp_engine_t *engine; switch_media_handle_t *smh; @@ -1801,15 +1801,21 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio for (i = 0; smh->crypto_suite_order[i] != CRYPTO_INVALID; i++) { switch_rtp_crypto_key_type_t j = SUITES[smh->crypto_suite_order[i]].type; - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "looking for crypto suite [%s] in [%s]\n", SUITES[j].name, crypto); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "looking for crypto suite [%s]alias=[%s] in [%s]\n", SUITES[j].name, SUITES[j].alias, crypto); - if (switch_stristr(SUITES[j].name, crypto)) { + if (switch_stristr(SUITES[j].alias, crypto)) { + use_alias = 1; + } + + if (use_alias || switch_stristr(SUITES[j].name, crypto)) { ctype = SUITES[j].type; vval = SUITES[j].name; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Found suite %s\n", vval); switch_channel_set_variable(session->channel, "rtp_secure_media_negotiated", vval); break; } + + use_alias = 0; } if (engine->ssec[engine->crypto_type].remote_crypto_key && switch_rtp_ready(engine->rtp_session)) { @@ -1828,7 +1834,7 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio } switch_channel_set_variable(session->channel, varname, vval); - switch_core_media_build_crypto(session->media_handle, type, crypto_tag, ctype, SWITCH_RTP_CRYPTO_SEND, 1); + switch_core_media_build_crypto(session->media_handle, type, crypto_tag, ctype, SWITCH_RTP_CRYPTO_SEND, 1, use_alias); switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_SEND, atoi(crypto), &engine->ssec[engine->crypto_type]); } @@ -1893,7 +1899,7 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio switch_channel_set_flag(smh->session->channel, CF_SECURE); if (zstr(engine->ssec[engine->crypto_type].local_crypto_key)) { - switch_core_media_build_crypto(session->media_handle, type, crypto_tag, ctype, SWITCH_RTP_CRYPTO_SEND, 1); + switch_core_media_build_crypto(session->media_handle, type, crypto_tag, ctype, SWITCH_RTP_CRYPTO_SEND, 1, use_alias); } } @@ -1929,13 +1935,13 @@ SWITCH_DECLARE(void) switch_core_session_check_outgoing_crypto(switch_core_sessi for (i = 0; smh->crypto_suite_order[i] != CRYPTO_INVALID; i++) { switch_core_media_build_crypto(session->media_handle, - SWITCH_MEDIA_TYPE_AUDIO, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0); + SWITCH_MEDIA_TYPE_AUDIO, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0, 0); switch_core_media_build_crypto(session->media_handle, - SWITCH_MEDIA_TYPE_VIDEO, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0); + SWITCH_MEDIA_TYPE_VIDEO, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0, 0); switch_core_media_build_crypto(session->media_handle, - SWITCH_MEDIA_TYPE_TEXT, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0); + SWITCH_MEDIA_TYPE_TEXT, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0, 0); } } From 94038f3c125f1605cf7fd0cec00005648020f4db Mon Sep 17 00:00:00 2001 From: Sergey Khripchenko Date: Wed, 28 Feb 2018 08:27:30 -0800 Subject: [PATCH 120/264] FS-11056: [core] fix RTCP lost calculation RTCP/Receiver Report/lost field is a _signed_ 24bit integer and it could be negative (in case of UDP duplication) + any negatives now threated as huge uint32_t + set this field properly on __BIG_ENDIAN + correctly read this value in received RTCP on all arches --- src/include/switch_rtcp_frame.h | 2 +- src/switch_rtp.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/include/switch_rtcp_frame.h b/src/include/switch_rtcp_frame.h index 9e5af76226..965599b623 100644 --- a/src/include/switch_rtcp_frame.h +++ b/src/include/switch_rtcp_frame.h @@ -45,7 +45,7 @@ SWITCH_BEGIN_EXTERN_C struct switch_rtcp_report_block_frame { uint32_t ssrc; /* The SSRC identifier of the source to which the information in this reception report block pertains. */ uint8_t fraction; /* The fraction of RTP data packets from source SSRC_n lost since the previous SR or RR packet was sent */ - uint32_t lost; /* The total number of RTP data packets from source SSRC_n that have been lost since the beginning of reception */ + int32_t lost; /* The total number of RTP data packets from source SSRC_n that have been lost since the beginning of reception. could be negative. */ uint32_t highest_sequence_number_received; uint32_t jitter; /* An estimate of the statistical variance of the RTP data packet interarrival time, measured in timestamp units and expressed as an unsigned integer. */ uint32_t lsr; /* The middle 32 bits out of 64 in the NTP timestamp */ diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 44c4b041c4..3e637da509 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1820,9 +1820,11 @@ static void rtcp_generate_report_block(switch_rtp_t *rtp_session, struct switch_ } else { rtcp_report_block->fraction = 0; } -#if SWITCH_BYTE_ORDER != __BIG_ENDIAN +#if SWITCH_BYTE_ORDER == __BIG_ENDIAN + rtcp_report_block->lost = stats->cum_lost; +#else /* Reversing byte order for 24bits */ - rtcp_report_block->lost = (((stats->cum_lost&0x0000FF)<<16) | ((stats->cum_lost&0x00FF00)) | ((stats->cum_lost&0xFF0000)>>16)); + rtcp_report_block->lost = htonl(stats->cum_lost) >> 8; #endif #ifdef DEBUG_RTCP @@ -6568,7 +6570,12 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t rtp_session->rtcp_frame.reports[i].ssrc = ntohl(report->ssrc); rtp_session->rtcp_frame.reports[i].fraction = (uint8_t)report->fraction; - rtp_session->rtcp_frame.reports[i].lost = ntohl(report->lost); +#if SWITCH_BYTE_ORDER == __BIG_ENDIAN + rtp_session->rtcp_frame.reports[i].lost = report->lost; // signed 24bit will extended signess to int32_t automatically +#else + rtp_session->rtcp_frame.reports[i].lost = ntohl(report->lost)>>8; // signed 24bit casted to uint32_t need >>8 after ntohl()... + rtp_session->rtcp_frame.reports[i].lost = rtp_session->rtcp_frame.reports[i].lost | ((rtp_session->rtcp_frame.reports[i].lost & 0x00800000) ? 0xff000000 : 0x00000000); // ...and signess compensation +#endif rtp_session->rtcp_frame.reports[i].highest_sequence_number_received = ntohl(report->highest_sequence_number_received); rtp_session->rtcp_frame.reports[i].jitter = ntohl(report->jitter); rtp_session->rtcp_frame.reports[i].lsr = ntohl(report->lsr); From 230e2ba348117d9baaa4697c2a2a77ee605b9766 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 23 Mar 2018 15:46:24 -0500 Subject: [PATCH 121/264] FS-11057: [mod_conference] CPU race on personal canvas #resolve --- src/mod/applications/mod_conference/conference_video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index a324cb504f..c9f3d36d44 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3698,7 +3698,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr } } - + switch_core_timer_next(&canvas->timer); + for (omember = conference->members; omember; omember = omember->next) { mcu_layer_t *layer = NULL; switch_image_t *use_img = NULL; From 835063f9d0cb5d826d9307f112fa9d03c51d9330 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Fri, 23 Mar 2018 15:52:47 -0500 Subject: [PATCH 122/264] Revert "FS-11047: [Debian] re-enable mod_v8 package build" This reverts commit c093b2d33dbc625439ea96988edb0b6ae00a84e8. --- debian/bootstrap.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh index c12a8ce777..bc8ea077c2 100755 --- a/debian/bootstrap.sh +++ b/debian/bootstrap.sh @@ -57,6 +57,7 @@ avoid_mods=( endpoints/mod_unicall event_handlers/mod_smpp formats/mod_webm + languages/mod_v8 sdk/autotools xml_int/mod_xml_ldap xml_int/mod_xml_radius From 8e362825de13e2f81018654012a5f5146526cd8f Mon Sep 17 00:00:00 2001 From: ifox Date: Fri, 9 Mar 2018 17:25:34 -0800 Subject: [PATCH 123/264] FS-11058: [core] Add RTT to RECV_RTCP_MESSAGE Add the RTT field to the RECV_RTCP_MESSAGE event emission which allows external listeners to compute MOS RTCP from the event. --- src/switch_core_media.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 221ff03b84..d574b05c9a 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -3047,6 +3047,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session snprintf(header, sizeof(header), "Source%u-DLSR", i); snprintf(value, sizeof(value), "%u", rtcp_frame.reports[i].dlsr); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header, value); + snprintf(header, sizeof(header), "Rtt%u-Avg", i); + snprintf(value, sizeof(value), "%f", rtcp_frame.reports[i].rtt_avg); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header, value); } switch_event_fire(&event); From 5272bbc83d0261685baf1c4509fcf3880fa94055 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 23 Mar 2018 18:00:32 -0500 Subject: [PATCH 124/264] FS-11057: [mod_conference] CPU race on personal canvas #resolve --- .../mod_conference/conference_video.c | 16 ++++++---------- src/switch_core_media.c | 2 ++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index c9f3d36d44..7259fdb60f 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -2696,15 +2696,11 @@ void conference_video_pop_next_image(conference_member_t *member, switch_image_t switch_image_t *img = *imgP; int size = 0; void *pop; - int half; //if (member->avatar_png_img && switch_channel_test_flag(member->channel, CF_VIDEO_READY) && conference_utils_member_test_flag(member, MFLAG_ACK_VIDEO)) { // switch_img_free(&member->avatar_png_img); //} - if ((half = switch_queue_size(member->video_queue) / 2) < 1) { - half = 1; - } - + if (switch_channel_test_flag(member->channel, CF_VIDEO_READY)) { do { pop = NULL; @@ -2716,7 +2712,7 @@ void conference_video_pop_next_image(conference_member_t *member, switch_image_t break; } size = switch_queue_size(member->video_queue); - } while(size > half); + } while(size > 1); if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && member->video_layer_id > -1 && @@ -3547,12 +3543,14 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr layout_group_t *lg = NULL; video_layout_t *vlayout = NULL; conference_member_t *omember; - + if (video_key_freq && (now - last_key_time) > video_key_freq) { send_keyframe = SWITCH_TRUE; last_key_time = now; } + switch_core_timer_next(&canvas->timer); + switch_mutex_lock(conference->member_mutex); for (imember = conference->members; imember; imember = imember->next) { @@ -3697,9 +3695,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr switch_thread_rwlock_unlock(omember->rwlock); } } - - switch_core_timer_next(&canvas->timer); - + for (omember = conference->members; omember; omember = omember->next) { mcu_layer_t *layer = NULL; switch_image_t *use_img = NULL; diff --git a/src/switch_core_media.c b/src/switch_core_media.c index d574b05c9a..84405c4e80 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -12383,6 +12383,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se case SWITCH_MESSAGE_INDICATE_HARD_MUTE: if (a_engine->rtp_session) { + a_engine->last_seq = 0; + if (session->bugs && msg->numeric_arg) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s has a media bug, hard mute not allowed.\n", switch_channel_get_name(session->channel)); From f5090ae96ba2424478f446880e8d61e0de2406e0 Mon Sep 17 00:00:00 2001 From: Piotr Gregor Date: Tue, 27 Mar 2018 12:18:00 +0100 Subject: [PATCH 125/264] FS-11063 Use compile time constants in dtls_state_setup --- src/switch_rtp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 3e637da509..74e147c8c2 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -3072,16 +3072,16 @@ static const char *dtls_state_names(dtls_state_t s) #define dtls_set_state(_dtls, _state) switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_INFO, "Changing %s DTLS state from %s to %s\n", rtp_type(rtp_session), dtls_state_names(_dtls->state), dtls_state_names(_state)); _dtls->new_state = 1; _dtls->last_state = _dtls->state; _dtls->state = _state +#define cr_keylen 16 +#define cr_saltlen 14 +#define cr_kslen 30 + static int dtls_state_setup(switch_rtp_t *rtp_session, switch_dtls_t *dtls) { X509 *cert; switch_secure_settings_t ssec; /* Used just to wrap over params in a call to switch_rtp_add_crypto_key. */ int r = 0; - const switch_size_t cr_kslen = SUITES[AES_CM_128_HMAC_SHA1_80].keysalt_len; - const switch_size_t cr_saltlen = SUITES[AES_CM_128_HMAC_SHA1_80].salt_len; - const switch_size_t cr_keylen = cr_kslen - cr_saltlen; - uint8_t raw_key_data[cr_kslen * 2]; unsigned char local_key_buf[cr_kslen]; unsigned char remote_key_buf[cr_kslen]; From e58ff3392f0447cc973ab412026275447b44588e Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Tue, 27 Mar 2018 12:20:08 -0500 Subject: [PATCH 126/264] FS-10853: remove extern that is no longer needed --- src/include/switch_rtp.h | 2 -- src/switch_rtp.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/include/switch_rtp.h b/src/include/switch_rtp.h index bed82a5b21..41e8637683 100644 --- a/src/include/switch_rtp.h +++ b/src/include/switch_rtp.h @@ -71,8 +71,6 @@ typedef struct switch_srtp_crypto_suite_s { int salt_len; } switch_srtp_crypto_suite_t; -extern switch_srtp_crypto_suite_t SUITES[CRYPTO_INVALID]; - struct switch_rtp_crypto_key { uint32_t index; switch_rtp_crypto_key_type_t type; diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 74e147c8c2..a45a0a66c5 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -3853,7 +3853,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess srtp_master_key_t *mki = NULL; int mki_idx = 0; - keysalt_len = SUITES[ssec->crypto_type].keysalt_len; + keysalt_len = switch_core_media_crypto_keysalt_len(ssec->crypto_type); if (direction >= SWITCH_RTP_CRYPTO_MAX || keysalt_len > SWITCH_RTP_MAX_CRYPTO_LEN) { return SWITCH_STATUS_FALSE; From 634c92de7d9895a17d4a785754f08ec0638c63b4 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Tue, 27 Mar 2018 12:21:57 -0500 Subject: [PATCH 127/264] swigall --- .../languages/mod_managed/freeswitch_wrap.cxx | 58 ++++++++++++------- src/mod/languages/mod_managed/managed/swig.cs | 41 +++++++------ 2 files changed, 60 insertions(+), 39 deletions(-) diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index a6f6d29b3a..449dc0b525 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -13644,6 +13644,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_get_app_flags(char * jarg1 } +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_core_session_stack_count(void * jarg1, int jarg2) { + unsigned long jresult ; + switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; + int arg2 ; + uint32_t result; + + arg1 = (switch_core_session_t *)jarg1; + arg2 = (int)jarg2; + result = (uint32_t)switch_core_session_stack_count(arg1,arg2); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_execute_exten(void * jarg1, char * jarg2, char * jarg3, char * jarg4) { int jresult ; switch_core_session_t *arg1 = (switch_core_session_t *) 0 ; @@ -31134,6 +31148,28 @@ SWIGEXPORT unsigned char SWIGSTDCALL CSharp_switch_video_codec_settings_try_hard } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_video_codec_settings_fps_set(void * jarg1, unsigned char jarg2) { + switch_video_codec_settings *arg1 = (switch_video_codec_settings *) 0 ; + uint8_t arg2 ; + + arg1 = (switch_video_codec_settings *)jarg1; + arg2 = (uint8_t)jarg2; + if (arg1) (arg1)->fps = arg2; +} + + +SWIGEXPORT unsigned char SWIGSTDCALL CSharp_switch_video_codec_settings_fps_get(void * jarg1) { + unsigned char jresult ; + switch_video_codec_settings *arg1 = (switch_video_codec_settings *) 0 ; + uint8_t result; + + arg1 = (switch_video_codec_settings *)jarg1; + result = (uint8_t) ((arg1)->fps); + jresult = result; + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_video_codec_settings() { void * jresult ; switch_video_codec_settings *result = 0 ; @@ -41983,28 +42019,6 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_srtp_crypto_suite_t(void * jarg } -SWIGEXPORT void SWIGSTDCALL CSharp_SUITES_set(void * jarg1) { - switch_srtp_crypto_suite_t *arg1 ; - - arg1 = (switch_srtp_crypto_suite_t *)jarg1; - { - size_t ii; - switch_srtp_crypto_suite_t *b = (switch_srtp_crypto_suite_t *) SUITES; - for (ii = 0; ii < (size_t)CRYPTO_INVALID; ii++) b[ii] = *((switch_srtp_crypto_suite_t *) arg1 + ii); - } -} - - -SWIGEXPORT void * SWIGSTDCALL CSharp_SUITES_get() { - void * jresult ; - switch_srtp_crypto_suite_t *result = 0 ; - - result = (switch_srtp_crypto_suite_t *)(switch_srtp_crypto_suite_t *)SUITES; - jresult = result; - return jresult; -} - - SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_crypto_key_index_set(void * jarg1, unsigned long jarg2) { switch_rtp_crypto_key *arg1 = (switch_rtp_crypto_key *) 0 ; uint32_t arg2 ; diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index 940ebaba19..3fbcd3b37f 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -2021,6 +2021,11 @@ else return ret; } + public static uint switch_core_session_stack_count(SWIGTYPE_p_switch_core_session session, int x) { + uint ret = freeswitchPINVOKE.switch_core_session_stack_count(SWIGTYPE_p_switch_core_session.getCPtr(session), x); + return ret; + } + public static switch_status_t switch_core_session_execute_exten(SWIGTYPE_p_switch_core_session session, string exten, string dialplan, string context) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_execute_exten(SWIGTYPE_p_switch_core_session.getCPtr(session), exten, dialplan, context); return ret; @@ -6648,17 +6653,6 @@ else return ret; } - public static switch_srtp_crypto_suite_t SUITES { - set { - freeswitchPINVOKE.SUITES_set(switch_srtp_crypto_suite_t.getCPtr(value)); - } - get { - IntPtr cPtr = freeswitchPINVOKE.SUITES_get(); - switch_srtp_crypto_suite_t ret = (cPtr == IntPtr.Zero) ? null : new switch_srtp_crypto_suite_t(cPtr, false); - return ret; - } - } - public static switch_status_t switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp rtp_session, switch_rtp_crypto_direction_t direction, uint index, switch_secure_settings_t ssec) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), (int)direction, index, switch_secure_settings_t.getCPtr(ssec)); return ret; @@ -11571,6 +11565,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_app_flags")] public static extern int switch_core_session_get_app_flags(string jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_stack_count")] + public static extern uint switch_core_session_stack_count(HandleRef jarg1, int jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_execute_exten")] public static extern int switch_core_session_execute_exten(HandleRef jarg1, string jarg2, string jarg3, string jarg4); @@ -15795,6 +15792,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_video_codec_settings_try_hardware_encoder_get")] public static extern byte switch_video_codec_settings_try_hardware_encoder_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_video_codec_settings_fps_set")] + public static extern void switch_video_codec_settings_fps_set(HandleRef jarg1, byte jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_video_codec_settings_fps_get")] + public static extern byte switch_video_codec_settings_fps_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_video_codec_settings")] public static extern IntPtr new_switch_video_codec_settings(); @@ -18246,12 +18249,6 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_srtp_crypto_suite_t")] public static extern void delete_switch_srtp_crypto_suite_t(HandleRef jarg1); - [DllImport("mod_managed", EntryPoint="CSharp_SUITES_set")] - public static extern void SUITES_set(HandleRef jarg1); - - [DllImport("mod_managed", EntryPoint="CSharp_SUITES_get")] - public static extern IntPtr SUITES_get(); - [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_crypto_key_index_set")] public static extern void switch_rtp_crypto_key_index_set(HandleRef jarg1, uint jarg2); @@ -44727,6 +44724,16 @@ public class switch_video_codec_settings : IDisposable { } } + public byte fps { + set { + freeswitchPINVOKE.switch_video_codec_settings_fps_set(swigCPtr, value); + } + get { + byte ret = freeswitchPINVOKE.switch_video_codec_settings_fps_get(swigCPtr); + return ret; + } + } + public switch_video_codec_settings() : this(freeswitchPINVOKE.new_switch_video_codec_settings(), true) { } From af29a31c7fb8d7bcd39b3458e748e0e6ba540f5e Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Tue, 27 Mar 2018 21:02:41 +0300 Subject: [PATCH 128/264] FS-11020: [Build-System] On Windows: Add missing modules to the msi installer, fix mod_gsmopen build, remove mod_skyopen, disable libav and libx264, cleanup. --- Freeswitch.2015.sln | 51 +++++------ .../asr_tts/mod_flite/mod_flite.2015.vcxproj | 4 - .../mod_pocketsphinx.2015.vcxproj | 12 --- .../mod_gsmopen/mod_gsmopen.2015.vcxproj | 22 +---- w32/Setup/Setup.2015.wixproj | 88 +++++++++++++++++-- 5 files changed, 103 insertions(+), 74 deletions(-) diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index 53df084d54..580be3cd79 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -410,8 +410,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "libs\s EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skel", "src\mod\applications\mod_skel\mod_skel.2015.vcxproj", "{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skypopen", "src\mod\endpoints\mod_skypopen\mod_skypopen.2015.vcxproj", "{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 32khz music", "libs\win32\Download 32khz music.2015.vcxproj", "{1F0A8A77-E661-418F-BB92-82172AE43803}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 8khz music", "libs\win32\Download 8khz music.2015.vcxproj", "{4F5C9D55-98EF-4256-8311-32D7BD360406}" @@ -751,6 +749,7 @@ Global {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.All|x64.ActiveCfg = Release MS-LDAP|x64 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.All|x64.Build.0 = Release MS-LDAP|x64 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.ActiveCfg = Debug MS-LDAP|Win32 + {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.Build.0 = Debug MS-LDAP|Win32 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|x64.ActiveCfg = Debug MS-LDAP|x64 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|x64.Build.0 = Debug MS-LDAP|x64 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.ActiveCfg = Release MS-LDAP|Win32 @@ -794,6 +793,7 @@ Global {9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.All|x64.ActiveCfg = Release|x64 {9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.All|x64.Build.0 = Release|x64 {9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|Win32.ActiveCfg = Debug|Win32 + {9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|Win32.Build.0 = Debug|Win32 {9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|x64.ActiveCfg = Debug|x64 {9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|x64.Build.0 = Debug|x64 {9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Release|Win32.ActiveCfg = Release|Win32 @@ -818,6 +818,7 @@ Global {D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|x64.ActiveCfg = Release|x64 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|x64.Build.0 = Release|x64 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.ActiveCfg = Debug|Win32 + {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.Build.0 = Debug|Win32 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.ActiveCfg = Debug|x64 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.Build.0 = Debug|x64 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.ActiveCfg = Release|Win32 @@ -828,6 +829,7 @@ Global {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.All|x64.ActiveCfg = Release|x64 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.All|x64.Build.0 = Release|x64 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.ActiveCfg = Debug|Win32 + {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.Build.0 = Debug|Win32 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|x64.ActiveCfg = Debug|x64 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|x64.Build.0 = Debug|x64 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.ActiveCfg = Release|Win32 @@ -871,6 +873,7 @@ Global {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.All|x64.ActiveCfg = Release|x64 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.All|x64.Build.0 = Release|x64 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.ActiveCfg = Debug|Win32 + {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.Build.0 = Debug|Win32 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|x64.ActiveCfg = Debug|x64 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|x64.Build.0 = Debug|x64 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.ActiveCfg = Release|Win32 @@ -1080,6 +1083,7 @@ Global {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x64.ActiveCfg = Release|x64 {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x64.Build.0 = Release|x64 {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|Win32.ActiveCfg = Debug|Win32 + {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|Win32.Build.0 = Debug|Win32 {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|x64.ActiveCfg = Debug|x64 {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|x64.Build.0 = Debug|x64 {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|Win32.ActiveCfg = Release|Win32 @@ -1306,6 +1310,7 @@ Global {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.All|x64.ActiveCfg = Release|x64 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.All|x64.Build.0 = Release|x64 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.ActiveCfg = Debug|Win32 + {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.Build.0 = Debug|Win32 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|x64.ActiveCfg = Debug|x64 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|x64.Build.0 = Debug|x64 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Win32.ActiveCfg = Release|Win32 @@ -1349,6 +1354,7 @@ Global {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.All|x64.ActiveCfg = Release|x64 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.All|x64.Build.0 = Release|x64 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Win32.ActiveCfg = Debug|Win32 + {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Win32.Build.0 = Debug|Win32 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|x64.ActiveCfg = Debug|x64 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|x64.Build.0 = Debug|x64 {E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Win32.ActiveCfg = Release|Win32 @@ -1428,6 +1434,7 @@ Global {2286DA73-9FC5-45BC-A508-85994C3317AB}.All|x64.ActiveCfg = Release|x64 {2286DA73-9FC5-45BC-A508-85994C3317AB}.All|x64.Build.0 = Release|x64 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Win32.ActiveCfg = Debug|Win32 + {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Win32.Build.0 = Debug|Win32 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|x64.ActiveCfg = Debug|x64 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|x64.Build.0 = Debug|x64 {2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Win32.ActiveCfg = Release|Win32 @@ -1501,6 +1508,7 @@ Global {66444AEE-554C-11DD-A9F0-8C5D56D89593}.All|x64.ActiveCfg = Release Static|x64 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.All|x64.Build.0 = Release Static|x64 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Win32.ActiveCfg = Debug|Win32 + {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Win32.Build.0 = Debug|Win32 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|x64.ActiveCfg = Debug|x64 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|x64.Build.0 = Debug|x64 {66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Win32.ActiveCfg = Release|Win32 @@ -1625,6 +1633,7 @@ Global {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.All|x64.ActiveCfg = Release_Mono|x64 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.All|x64.Build.0 = Release_Mono|x64 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Win32.ActiveCfg = Debug_CLR|Win32 + {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Win32.Build.0 = Debug_CLR|Win32 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|x64.ActiveCfg = Debug_CLR|x64 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|x64.Build.0 = Debug_CLR|x64 {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|Win32.ActiveCfg = Release_CLR|Win32 @@ -1679,6 +1688,7 @@ Global {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.All|x64.ActiveCfg = Release|x64 {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.All|x64.Build.0 = Release|x64 {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.ActiveCfg = Debug|Win32 + {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.Build.0 = Debug|Win32 {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|x64.ActiveCfg = Debug|x64 {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|x64.Build.0 = Debug|x64 {14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.ActiveCfg = Release|Win32 @@ -1744,6 +1754,7 @@ Global {1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.All|x64.ActiveCfg = Release|x64 {1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.All|x64.Build.0 = Release|x64 {1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|Win32.ActiveCfg = Debug|Win32 + {1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|Win32.Build.0 = Debug|Win32 {1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|x64.ActiveCfg = Debug|x64 {1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|x64.Build.0 = Debug|x64 {1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Release|Win32.ActiveCfg = Release|Win32 @@ -1826,6 +1837,7 @@ Global {48414740-C693-4968-9846-EE058020C64F}.All|Win32.ActiveCfg = Release|Win32 {48414740-C693-4968-9846-EE058020C64F}.All|x64.ActiveCfg = Release|Win32 {48414740-C693-4968-9846-EE058020C64F}.Debug|Win32.ActiveCfg = Debug|Win32 + {48414740-C693-4968-9846-EE058020C64F}.Debug|Win32.Build.0 = Debug|Win32 {48414740-C693-4968-9846-EE058020C64F}.Debug|x64.ActiveCfg = Debug|x64 {48414740-C693-4968-9846-EE058020C64F}.Debug|x64.Build.0 = Debug|x64 {48414740-C693-4968-9846-EE058020C64F}.Release|Win32.ActiveCfg = Release|Win32 @@ -1861,16 +1873,6 @@ Global {11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.Debug|x64.ActiveCfg = Debug|x64 {11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.Release|Win32.ActiveCfg = Release|Win32 {11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.Release|x64.ActiveCfg = Release|x64 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.All|Win32.ActiveCfg = Release|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.All|Win32.Build.0 = Release|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.All|x64.ActiveCfg = Release|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|Win32.ActiveCfg = Debug|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|x64.ActiveCfg = Debug|x64 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Debug|x64.Build.0 = Debug|x64 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|Win32.ActiveCfg = Release|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|Win32.Build.0 = Release|Win32 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|x64.ActiveCfg = Release|x64 - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|x64.Build.0 = Release|x64 {1F0A8A77-E661-418F-BB92-82172AE43803}.All|Win32.ActiveCfg = Release|Win32 {1F0A8A77-E661-418F-BB92-82172AE43803}.All|x64.ActiveCfg = Release|Win32 {1F0A8A77-E661-418F-BB92-82172AE43803}.Debug|Win32.ActiveCfg = Debug|Win32 @@ -1927,6 +1929,7 @@ Global {3C977801-FE88-48F2-83D3-FA2EBFF6688E}.All|x64.ActiveCfg = Release|x64 {3C977801-FE88-48F2-83D3-FA2EBFF6688E}.All|x64.Build.0 = Release|x64 {3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|Win32.Build.0 = Debug|Win32 {3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|x64.ActiveCfg = Debug|x64 {3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|x64.Build.0 = Debug|x64 {3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Release|Win32.ActiveCfg = Release|Win32 @@ -2315,6 +2318,7 @@ Global {50AAC2CE-BFC9-4912-87CC-C6381850D735}.All|x64.ActiveCfg = Release|x64 {50AAC2CE-BFC9-4912-87CC-C6381850D735}.All|x64.Build.0 = Release|x64 {50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|Win32.ActiveCfg = Debug|Win32 + {50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|Win32.Build.0 = Debug|Win32 {50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|x64.ActiveCfg = Debug|x64 {50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|x64.Build.0 = Debug|x64 {50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|Win32.ActiveCfg = Release|Win32 @@ -2371,18 +2375,22 @@ Global {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.ActiveCfg = Debug|Win32 {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.Build.0 = Debug|Win32 {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x64.ActiveCfg = Debug|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x64.Build.0 = Debug|x64 {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.ActiveCfg = Release|Win32 {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.Build.0 = Release|Win32 {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x64.ActiveCfg = Release|x64 + {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x64.Build.0 = Release|x64 {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|Win32.ActiveCfg = Release|x64 {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64.ActiveCfg = Release|x64 {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64.Build.0 = Release|x64 {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|Win32.ActiveCfg = Debug|Win32 {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|Win32.Build.0 = Debug|Win32 {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x64.ActiveCfg = Debug|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x64.Build.0 = Debug|x64 {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|Win32.ActiveCfg = Release|Win32 {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|Win32.Build.0 = Release|Win32 {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x64.ActiveCfg = Release|x64 + {74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x64.Build.0 = Release|x64 {C13CC324-0032-4492-9A30-310A6BD64FF5}.All|Win32.ActiveCfg = Release|Win32 {C13CC324-0032-4492-9A30-310A6BD64FF5}.All|Win32.Build.0 = Release|Win32 {C13CC324-0032-4492-9A30-310A6BD64FF5}.All|x64.ActiveCfg = Release|Win32 @@ -2398,6 +2406,7 @@ Global {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.All|x64.ActiveCfg = Release|x64 {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.All|x64.Build.0 = Release|x64 {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|Win32.ActiveCfg = Debug|Win32 + {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|Win32.Build.0 = Debug|Win32 {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|x64.ActiveCfg = Debug|x64 {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|x64.Build.0 = Debug|x64 {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Release|Win32.ActiveCfg = Release|Win32 @@ -2718,6 +2727,7 @@ Global {5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.All|x64.ActiveCfg = Release|x64 {5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.All|x64.Build.0 = Release|x64 {5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|Win32.ActiveCfg = Debug|Win32 + {5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|Win32.Build.0 = Debug|Win32 {5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|x64.ActiveCfg = Debug|x64 {5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|x64.Build.0 = Debug|x64 {5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Release|Win32.ActiveCfg = Release|Win32 @@ -2837,25 +2847,17 @@ Global {77C9E0A2-177D-4BD6-9EFD-75A56F886325}.All|x64.ActiveCfg = Release|Win32 {77C9E0A2-177D-4BD6-9EFD-75A56F886325}.All|x64.Build.0 = Release|Win32 {77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Debug|Win32.ActiveCfg = Debug|Win32 - {77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Debug|Win32.Build.0 = Debug|Win32 {77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Debug|x64.ActiveCfg = Debug|Win32 - {77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Debug|x64.Build.0 = Debug|Win32 {77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Release|Win32.ActiveCfg = Release|Win32 - {77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Release|Win32.Build.0 = Release|Win32 {77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Release|x64.ActiveCfg = Release|Win32 - {77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Release|x64.Build.0 = Release|Win32 {841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|Win32.ActiveCfg = Release|Win32 {841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|Win32.Build.0 = Release|Win32 {841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|x64.ActiveCfg = Release|x64 {841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|x64.Build.0 = Release|x64 {841C345F-FCC7-4F64-8F54-0281CEABEB01}.Debug|Win32.ActiveCfg = Debug|Win32 - {841C345F-FCC7-4F64-8F54-0281CEABEB01}.Debug|Win32.Build.0 = Debug|Win32 {841C345F-FCC7-4F64-8F54-0281CEABEB01}.Debug|x64.ActiveCfg = Debug|x64 - {841C345F-FCC7-4F64-8F54-0281CEABEB01}.Debug|x64.Build.0 = Debug|x64 {841C345F-FCC7-4F64-8F54-0281CEABEB01}.Release|Win32.ActiveCfg = Release|Win32 - {841C345F-FCC7-4F64-8F54-0281CEABEB01}.Release|Win32.Build.0 = Release|Win32 {841C345F-FCC7-4F64-8F54-0281CEABEB01}.Release|x64.ActiveCfg = Release|x64 - {841C345F-FCC7-4F64-8F54-0281CEABEB01}.Release|x64.Build.0 = Release|x64 {7AEE504B-23B6-4B05-829E-7CD34855F146}.All|Win32.ActiveCfg = Release|Win32 {7AEE504B-23B6-4B05-829E-7CD34855F146}.All|Win32.Build.0 = Release|Win32 {7AEE504B-23B6-4B05-829E-7CD34855F146}.All|x64.ActiveCfg = Release|x64 @@ -2869,25 +2871,17 @@ Global {20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|x64.ActiveCfg = Release|x64 {20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|x64.Build.0 = Release|x64 {20179127-853B-4FE9-B7C0-9E817E6A3A72}.Debug|Win32.ActiveCfg = Debug|Win32 - {20179127-853B-4FE9-B7C0-9E817E6A3A72}.Debug|Win32.Build.0 = Debug|Win32 {20179127-853B-4FE9-B7C0-9E817E6A3A72}.Debug|x64.ActiveCfg = Debug|x64 - {20179127-853B-4FE9-B7C0-9E817E6A3A72}.Debug|x64.Build.0 = Debug|x64 {20179127-853B-4FE9-B7C0-9E817E6A3A72}.Release|Win32.ActiveCfg = Release|Win32 - {20179127-853B-4FE9-B7C0-9E817E6A3A72}.Release|Win32.Build.0 = Release|Win32 {20179127-853B-4FE9-B7C0-9E817E6A3A72}.Release|x64.ActiveCfg = Release|x64 - {20179127-853B-4FE9-B7C0-9E817E6A3A72}.Release|x64.Build.0 = Release|x64 {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|Win32.ActiveCfg = Release|Win32 {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|Win32.Build.0 = Release|Win32 {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|x64.ActiveCfg = Release|Win32 {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|x64.Build.0 = Release|Win32 {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Debug|Win32.ActiveCfg = Debug|Win32 - {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Debug|Win32.Build.0 = Debug|Win32 {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Debug|x64.ActiveCfg = Debug|Win32 - {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Debug|x64.Build.0 = Debug|Win32 {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Release|Win32.ActiveCfg = Release|Win32 - {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Release|Win32.Build.0 = Release|Win32 {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Release|x64.ActiveCfg = Release|Win32 - {6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Release|x64.Build.0 = Release|Win32 {583D8CEA-4171-4493-9025-B63265F408D8}.All|Win32.ActiveCfg = Release|Win32 {583D8CEA-4171-4493-9025-B63265F408D8}.All|Win32.Build.0 = Release|Win32 {583D8CEA-4171-4493-9025-B63265F408D8}.All|x64.ActiveCfg = Release|Win32 @@ -3152,7 +3146,6 @@ Global {DEE932AB-5911-4700-9EEB-8C7090A0A330} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {329A6FA0-0FCC-4435-A950-E670AEFA9838} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {11C9BC3D-45E9-46E3-BE84-B8CEE4685E39} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} - {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {1F0A8A77-E661-418F-BB92-82172AE43803} = {C120A020-773F-4EA3-923F-B67AF28B750D} {4F5C9D55-98EF-4256-8311-32D7BD360406} = {C120A020-773F-4EA3-923F-B67AF28B750D} {E10571C4-E7F4-4608-B5F2-B22E7EB95400} = {C120A020-773F-4EA3-923F-B67AF28B750D} diff --git a/src/mod/asr_tts/mod_flite/mod_flite.2015.vcxproj b/src/mod/asr_tts/mod_flite/mod_flite.2015.vcxproj index 37e1323968..4d3c6bd29e 100644 --- a/src/mod/asr_tts/mod_flite/mod_flite.2015.vcxproj +++ b/src/mod/asr_tts/mod_flite/mod_flite.2015.vcxproj @@ -260,10 +260,6 @@ - - {d5d2bf72-29fe-4982-a9fa-82fdd086db1b} - false - {0ad1177e-1fd8-4643-9391-431467a11084} diff --git a/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj b/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj index 8454cff8a7..26151933f6 100644 --- a/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj +++ b/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj @@ -191,18 +191,6 @@ - - {af8163ee-fa76-4904-a11d-7d70a1b5ba2e} - false - - - {4f92b672-dadb-4047-8d6a-4bb3796733fd} - false - - - {2dee4895-1134-439c-b688-52203e57d878} - false - {94001a0e-a837-445c-8004-f918f10d0226} false diff --git a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2015.vcxproj b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2015.vcxproj index 17695c05ae..7cc2e15b53 100644 --- a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2015.vcxproj +++ b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2015.vcxproj @@ -70,27 +70,7 @@ <_ProjectFileVersion>10.0.40219.1 - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - false - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - NativeMinimumRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - false + false diff --git a/w32/Setup/Setup.2015.wixproj b/w32/Setup/Setup.2015.wixproj index 3c3261171f..1d12c3f92a 100644 --- a/w32/Setup/Setup.2015.wixproj +++ b/w32/Setup/Setup.2015.wixproj @@ -249,6 +249,30 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_redis + {886b5e9d-f2c2-4af2-98c8-ef98c4c770e6} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + + + mod_rss + {b69247fa-ecd6-40ed-8e44-5ca6c3baf9a4} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + + + mod_sms + {2469b306-b027-4ff2-8815-c9c1ea2cae79} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_snom {2a3d00c6-588d-4e86-81ac-9ef5ede86e03} @@ -265,6 +289,22 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_spy + {a61d7cb4-75a5-4a55-8ca1-be5af615d921} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + + + mod_valet_parking + {432db165-1eb2-4781-a9c0-71e62610b20a} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_vmd {14e4a972-9cfb-436d-b0a5-4943f3f80d47} @@ -297,6 +337,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_unimrcp + {d07c378a-f5f7-438f-adf3-4ac4fb1883cd} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_amr {8deb383c-4091-4f42-a56f-c9e46d552d79} @@ -313,6 +361,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_codec2 + {cb4e68a1-8d19-4b5e-87b9-97a895e1ba17} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_g723_1 {fea1eef7-876f-48de-88bf-c0e3e606d758} @@ -361,6 +417,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_silk + {afa983d6-4569-4f88-ba94-555ed00fd9a8} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_siren {0b6c905b-142e-4999-b39d-92ff7951e921} @@ -409,6 +473,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_gsmopen + {74b120ff-6935-4dfe-a142-cdb6bea99c90} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_loopback {b3f424ec-3d8f-417c-b244-3919d5e1a577} @@ -417,6 +489,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_PortAudio + {5fd31a25-5d83-4794-8bee-904dad84ce71} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_rtc {3884add2-91d0-4cd6-86d3-d5fb2d4aab9e} @@ -441,14 +521,6 @@ Binaries;Content;Satellites INSTALLFOLDER - - mod_skypopen - {c6e78a4c-db1e-47f4-9b63-4dc27d86343f} - True - True - Binaries;Content;Satellites - INSTALLFOLDER - mod_sofia {0df3abd0-ddc0-4265-b778-07c66780979b} From 73d616a318ec80041e30a248013d28a38efc3d97 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Tue, 27 Mar 2018 22:19:37 +0300 Subject: [PATCH 129/264] FS-10989: [core] Fix CUSTOM_HASH hash table race in switch_event logic causing crashes during bind to events. --- src/switch_event.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/switch_event.c b/src/switch_event.c index c38b1194c1..278589f7d1 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -93,6 +93,7 @@ static uint8_t EVENT_DISPATCH_QUEUE_RUNNING[MAX_DISPATCH_VAL] = { 0 }; static switch_queue_t *EVENT_DISPATCH_QUEUE = NULL; static switch_queue_t *EVENT_CHANNEL_DISPATCH_QUEUE = NULL; static switch_mutex_t *EVENT_QUEUE_MUTEX = NULL; +static switch_mutex_t *CUSTOM_HASH_MUTEX = NULL; static switch_hash_t *CUSTOM_HASH = NULL; static int THREAD_COUNT = 0; static int DISPATCH_THREAD_COUNT = 0; @@ -449,6 +450,8 @@ SWITCH_DECLARE(switch_status_t) switch_event_free_subclass_detailed(const char * switch_event_subclass_t *subclass; switch_status_t status = SWITCH_STATUS_FALSE; + switch_mutex_lock(CUSTOM_HASH_MUTEX); + switch_assert(RUNTIME_POOL != NULL); switch_assert(CUSTOM_HASH != NULL); @@ -468,13 +471,18 @@ SWITCH_DECLARE(switch_status_t) switch_event_free_subclass_detailed(const char * } } + switch_mutex_unlock(CUSTOM_HASH_MUTEX); + return status; } SWITCH_DECLARE(switch_status_t) switch_event_reserve_subclass_detailed(const char *owner, const char *subclass_name) { + switch_status_t status = SWITCH_STATUS_SUCCESS; switch_event_subclass_t *subclass; + switch_mutex_lock(CUSTOM_HASH_MUTEX); + switch_assert(RUNTIME_POOL != NULL); switch_assert(CUSTOM_HASH != NULL); @@ -482,9 +490,9 @@ SWITCH_DECLARE(switch_status_t) switch_event_reserve_subclass_detailed(const cha /* a listener reserved it for us, now we can lock it so nobody else can have it */ if (subclass->bind) { subclass->bind = 0; - return SWITCH_STATUS_SUCCESS; + switch_goto_status(SWITCH_STATUS_SUCCESS, end); } - return SWITCH_STATUS_INUSE; + switch_goto_status(SWITCH_STATUS_INUSE, end); } switch_zmalloc(subclass, sizeof(*subclass)); @@ -494,7 +502,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_reserve_subclass_detailed(const cha switch_core_hash_insert(CUSTOM_HASH, subclass->name, subclass); - return SWITCH_STATUS_SUCCESS; +end: + + switch_mutex_unlock(CUSTOM_HASH_MUTEX); + + return status; } SWITCH_DECLARE(void) switch_core_memory_reclaim_events(void) @@ -677,6 +689,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_init(switch_memory_pool_t *pool) switch_mutex_init(&BLOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL); switch_mutex_init(&POOL_LOCK, SWITCH_MUTEX_NESTED, RUNTIME_POOL); switch_mutex_init(&EVENT_QUEUE_MUTEX, SWITCH_MUTEX_NESTED, RUNTIME_POOL); + switch_mutex_init(&CUSTOM_HASH_MUTEX, SWITCH_MUTEX_NESTED, RUNTIME_POOL); switch_core_hash_init(&CUSTOM_HASH); if (switch_core_test_flag(SCF_MINIMAL)) { @@ -2003,12 +2016,16 @@ SWITCH_DECLARE(switch_status_t) switch_event_get_custom_events(switch_console_ca void *val; int x = 0; + switch_mutex_lock(CUSTOM_HASH_MUTEX); + for (hi = switch_core_hash_first(CUSTOM_HASH); hi; hi = switch_core_hash_next(&hi)) { switch_core_hash_this(hi, &var, NULL, &val); switch_console_push_match(matches, (const char *) var); x++; } + switch_mutex_unlock(CUSTOM_HASH_MUTEX); + return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; } @@ -2026,11 +2043,16 @@ SWITCH_DECLARE(switch_status_t) switch_event_bind_removable(const char *id, swit } if (subclass_name) { + switch_mutex_lock(CUSTOM_HASH_MUTEX); + if (!(subclass = switch_core_hash_find(CUSTOM_HASH, subclass_name))) { switch_event_reserve_subclass_detailed(id, subclass_name); subclass = switch_core_hash_find(CUSTOM_HASH, subclass_name); subclass->bind = 1; } + + switch_mutex_unlock(CUSTOM_HASH_MUTEX); + if (!subclass) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not reserve subclass. '%s'\n", subclass_name); return SWITCH_STATUS_FALSE; From 24ef5b2762a93b09701f652859dcd0e6dd5fa165 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 28 Mar 2018 00:03:28 +0300 Subject: [PATCH 130/264] FS-11065: [Build-System, mod_v8] Update libv8 to 6.1.298 on windows, speedup windows build by moving libv8 to pre-compiled binaries. --- Freeswitch.2015.sln | 14 -- libs/.gitignore | 1 + libs/win32/v8/build-v8.bat | 127 --------------- libs/win32/v8/libv8.2015.vcxproj | 144 ------------------ src/mod/languages/mod_v8/mod_v8.2015.vcxproj | 4 - .../languages/mod_v8/mod_v8_skel.2015.vcxproj | 4 - w32/v8-version.props | 2 +- w32/v8.props | 39 +++-- 8 files changed, 26 insertions(+), 309 deletions(-) delete mode 100644 libs/win32/v8/build-v8.bat delete mode 100644 libs/win32/v8/libv8.2015.vcxproj diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index 580be3cd79..64ec54f3d0 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -562,8 +562,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcbt", "libs\win32\libcbt EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_cielab_luts", "libs\spandsp\src\msvc\make_cielab_luts.2015.vcxproj", "{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libv8", "libs\win32\v8\libv8.2015.vcxproj", "{AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download OPUS", "libs\win32\Download OPUS.2015.vcxproj", "{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "opus", "opus", "{ED2CA8B5-8E91-4296-A120-02BB0B674652}" @@ -2535,17 +2533,6 @@ Global {85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Release|Win32.Build.0 = All|Win32 {85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Release|x64.ActiveCfg = All|Win32 {85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Release|x64.Build.0 = All|Win32 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}.All|Win32.ActiveCfg = Debug|x64 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}.All|x64.ActiveCfg = Debug|x64 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}.All|x64.Build.0 = Debug|x64 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}.Debug|Win32.ActiveCfg = Debug|Win32 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}.Debug|Win32.Build.0 = Debug|Win32 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}.Debug|x64.ActiveCfg = Debug|x64 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}.Debug|x64.Build.0 = Debug|x64 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}.Release|Win32.ActiveCfg = Release|Win32 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}.Release|Win32.Build.0 = Release|Win32 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}.Release|x64.ActiveCfg = Release|x64 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2}.Release|x64.Build.0 = Release|x64 {092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.All|Win32.ActiveCfg = Release|Win32 {092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.All|Win32.Build.0 = Release|Win32 {092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.All|x64.ActiveCfg = Release|Win32 @@ -3208,7 +3195,6 @@ Global {2386B892-35F5-46CF-A0F0-10394D2FBF9B} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {85F0CF8C-C7AB-48F6-BA19-CC94CF87F981} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {092124C9-09ED-43C7-BD6D-4AE5D6B3C547} = {C120A020-773F-4EA3-923F-B67AF28B750D} {ED2CA8B5-8E91-4296-A120-02BB0B674652} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {FD60942F-72D6-4CA1-8B57-EA1D1B95A89E} = {ED2CA8B5-8E91-4296-A120-02BB0B674652} diff --git a/libs/.gitignore b/libs/.gitignore index a567a23673..8862900d89 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -794,6 +794,7 @@ opal /zeromq-*/ /jpeg-8d/ /v8-*/ +/v8-*.zip # build products we should remove !/apr-util/xml/expat/conftools/config.guess diff --git a/libs/win32/v8/build-v8.bat b/libs/win32/v8/build-v8.bat deleted file mode 100644 index 24268ba1b8..0000000000 --- a/libs/win32/v8/build-v8.bat +++ /dev/null @@ -1,127 +0,0 @@ -@ECHO OFF - -REM First argument is the target architecture -REM Second argument is "Debug" or "Release" mode -REM Third argument is the V8 root directory path -REM Fourth argument is the version of Visual Studio (optional) - -IF "%1" == "" GOTO Fail -IF "%2" == "" GOTO Fail -IF "%3" == "" GOTO Fail - -REM Go into the V8 lib directory -cd "%3" - -REM Check the last build info, so we know if we're supposed to build again or not -SET /P LAST_BUILD_INFO= last_build - -exit /b 0 - -:Fail -REM Delete the last_build info if this build failed! -@del /Q last_build -exit /b 1 diff --git a/libs/win32/v8/libv8.2015.vcxproj b/libs/win32/v8/libv8.2015.vcxproj deleted file mode 100644 index 7d9848badd..0000000000 --- a/libs/win32/v8/libv8.2015.vcxproj +++ /dev/null @@ -1,144 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - libv8 - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2} - libv8 - Win32Proj - 8.1 - - - - Utility - NotSet - v140 - false - - - Utility - NotSet - v140 - false - - - Utility - NotSet - v140 - false - - - Utility - NotSet - v140 - false - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(PlatformName)\V8\$(Configuration)\ - $(PlatformName)\V8\$(Configuration)\ - $(PlatformName)\V8\$(Configuration)\ - $(PlatformName)\V8\$(Configuration)\ - - - - $(IntDir)BuildLog $(ProjectName).htm - - - - - - - - - X64 - - - $(IntDir)BuildLog $(ProjectName).htm - - - - - - - - - $(IntDir)BuildLog $(ProjectName).htm - - - - - - - - - X64 - - - $(IntDir)BuildLog $(ProjectName).htm - - - - - - - - - Document - Building Google V8 - $(ProjectDir)build-v8.bat x86 Release "$(ProjectDir)..\..\v8-$(V8Version)" - - $(ProjectDir)..\..\v8-$(V8Version);%(Outputs) - Building Google V8 - $(ProjectDir)build-v8.bat x86 Debug "$(ProjectDir)..\..\v8-$(V8Version)" - - $(ProjectDir)..\..\v8-$(V8Version);%(Outputs) - Building Google V8 - $(ProjectDir)build-v8.bat x64 Release "$(ProjectDir)..\..\v8-$(V8Version)" - - $(ProjectDir)..\..\v8-$(V8Version);%(Outputs) - Building Google V8 - $(ProjectDir)build-v8.bat x64 Debug "$(ProjectDir)..\..\v8-$(V8Version)" - - $(ProjectDir)..\..\v8-$(V8Version);%(Outputs) - - - - - - \ No newline at end of file diff --git a/src/mod/languages/mod_v8/mod_v8.2015.vcxproj b/src/mod/languages/mod_v8/mod_v8.2015.vcxproj index dfdf26e0ec..df75233dc6 100644 --- a/src/mod/languages/mod_v8/mod_v8.2015.vcxproj +++ b/src/mod/languages/mod_v8/mod_v8.2015.vcxproj @@ -210,10 +210,6 @@ {89385c74-5860-4174-9caf-a39e7c48909c} - - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2} - false - {87ee9da4-de1e-4448-8324-183c98dca588} false diff --git a/src/mod/languages/mod_v8/mod_v8_skel.2015.vcxproj b/src/mod/languages/mod_v8/mod_v8_skel.2015.vcxproj index fe03185da7..855c6b69d0 100644 --- a/src/mod/languages/mod_v8/mod_v8_skel.2015.vcxproj +++ b/src/mod/languages/mod_v8/mod_v8_skel.2015.vcxproj @@ -185,10 +185,6 @@ - - {AB03E82B-48B1-4374-B32A-A1AF83DDC6C2} - false - {87ee9da4-de1e-4448-8324-183c98dca588} false diff --git a/w32/v8-version.props b/w32/v8-version.props index a0b442cd5b..f31874859d 100644 --- a/w32/v8-version.props +++ b/w32/v8-version.props @@ -4,7 +4,7 @@ - 5.6.326 + 6.1.298 true diff --git a/w32/v8.props b/w32/v8.props index 58449a57c1..c041e5b5f7 100644 --- a/w32/v8.props +++ b/w32/v8.props @@ -1,7 +1,6 @@  - @@ -30,25 +29,35 @@ extractto: Folder to extract an archive to --> - + + + + - - - + + + + + + + @@ -58,8 +67,8 @@ %(PreprocessorDefinitions) - $(SolutionDir)libs\v8-$(V8Version)\build\$(Configuration)\lib;%(AdditionalLibraryDirectories) - icui18n.lib;icuuc.lib;v8.lib;v8_libplatform.lib;%(AdditionalDependencies) + $(SolutionDir)libs\v8-$(V8Version)\binaries\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + v8.dll.lib;v8_libbase.dll.lib;v8_libplatform.dll.lib;%(AdditionalDependencies) From 1396f5c5fecb8c06db84aaf347ecbe1072dc08f5 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 28 Mar 2018 01:15:15 +0300 Subject: [PATCH 131/264] FS-11066: [Build-System] Make WIX project be able to produce snapshots with proper msi naming on windows. --- w32/Setup/GitInfo/GitInfo.cache.pp | 17 + w32/Setup/GitInfo/GitInfo.cs.pp | 98 +++ w32/Setup/GitInfo/GitInfo.targets | 953 +++++++++++++++++++++++++++++ w32/Setup/GitInfo/GitInfo.vb.pp | 91 +++ w32/Setup/GitInfo/wslpath.cmd | 26 + w32/Setup/GitInfo/wslrun.cmd | 11 + w32/Setup/Setup.2015.wixproj | 22 +- 7 files changed, 1215 insertions(+), 3 deletions(-) create mode 100644 w32/Setup/GitInfo/GitInfo.cache.pp create mode 100644 w32/Setup/GitInfo/GitInfo.cs.pp create mode 100644 w32/Setup/GitInfo/GitInfo.targets create mode 100644 w32/Setup/GitInfo/GitInfo.vb.pp create mode 100644 w32/Setup/GitInfo/wslpath.cmd create mode 100644 w32/Setup/GitInfo/wslrun.cmd diff --git a/w32/Setup/GitInfo/GitInfo.cache.pp b/w32/Setup/GitInfo/GitInfo.cache.pp new file mode 100644 index 0000000000..3f188321df --- /dev/null +++ b/w32/Setup/GitInfo/GitInfo.cache.pp @@ -0,0 +1,17 @@ +GitBranch=$GitBranch$; +GitCommit=$GitCommit$; +GitSha=$GitSha$; +GitBaseVersion=$GitBaseVersion$; +GitBaseVersionSource=$GitBaseVersionSource$; +GitBaseVersionMajor=$GitBaseVersionMajor$; +GitBaseVersionMinor=$GitBaseVersionMinor$; +GitBaseVersionPatch=$GitBaseVersionPatch$; +GitCommits=$GitCommits$; +GitTag=$GitTag$; +GitBaseTag=$GitBaseTag$; +GitSemVerMajor=$GitSemVerMajor$; +GitSemVerMinor=$GitSemVerMinor$; +GitSemVerPatch=$GitSemVerPatch$; +GitSemVerLabel=$GitSemVerLabel$; +GitSemVerDashLabel=$GitSemVerDashLabel$; +GitSemVerSource=$GitSemVerSource$ \ No newline at end of file diff --git a/w32/Setup/GitInfo/GitInfo.cs.pp b/w32/Setup/GitInfo/GitInfo.cs.pp new file mode 100644 index 0000000000..b8d0a57896 --- /dev/null +++ b/w32/Setup/GitInfo/GitInfo.cs.pp @@ -0,0 +1,98 @@ +// +#define $NamespaceDefine$ +#define $MetadataDefine$ +#pragma warning disable 0436 + +#if ADDMETADATA +[assembly: System.Reflection.AssemblyMetadata("GitInfo.IsDirty", RootNamespace.ThisAssembly.Git.IsDirtyString)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.Branch", RootNamespace.ThisAssembly.Git.Branch)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.Commit", RootNamespace.ThisAssembly.Git.Commit)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.Sha", RootNamespace.ThisAssembly.Git.Sha)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.BaseVersion.Major", RootNamespace.ThisAssembly.Git.BaseVersion.Major)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.BaseVersion.Minor", RootNamespace.ThisAssembly.Git.BaseVersion.Minor)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.BaseVersion.Patch", RootNamespace.ThisAssembly.Git.BaseVersion.Patch)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.Commits", RootNamespace.ThisAssembly.Git.Commits)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.Tag", RootNamespace.ThisAssembly.Git.Tag)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.BaseTag", RootNamespace.ThisAssembly.Git.BaseTag)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.Major", RootNamespace.ThisAssembly.Git.SemVer.Major)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.Minor", RootNamespace.ThisAssembly.Git.SemVer.Minor)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.Patch", RootNamespace.ThisAssembly.Git.SemVer.Patch)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.Label", RootNamespace.ThisAssembly.Git.SemVer.Label)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.DashLabel", RootNamespace.ThisAssembly.Git.SemVer.DashLabel)] +[assembly: System.Reflection.AssemblyMetadata("GitInfo.SemVer.Source", RootNamespace.ThisAssembly.Git.SemVer.Source)] +#endif + +#if LOCALNAMESPACE +namespace _RootNamespace_ +{ +#endif + /// Provides access to the current assembly information. + partial class ThisAssembly + { + /// Provides access to the git information for the current assembly. + public partial class Git + { + /// IsDirty: $GitIsDirty$ + public const bool IsDirty = $GitIsDirty$; + + /// IsDirtyString: $GitIsDirty$ + public const string IsDirtyString = "$GitIsDirty$"; + + /// Branch: $GitBranch$ + public const string Branch = "$GitBranch$"; + + /// Commit: $GitCommit$ + public const string Commit = "$GitCommit$"; + + /// Sha: $GitSha$ + public const string Sha = "$GitSha$"; + + /// Commits on top of base version: $GitCommits$ + public const string Commits = "$GitCommits$"; + + /// Tag: $GitTag$ + public const string Tag = "$GitTag$"; + + /// Base tag: $GitBaseTag$ + public const string BaseTag = "$GitBaseTag$"; + + /// Provides access to the base version information used to determine the . + public partial class BaseVersion + { + /// Major: $GitBaseVersionMajor$ + public const string Major = "$GitBaseVersionMajor$"; + + /// Minor: $GitBaseVersionMinor$ + public const string Minor = "$GitBaseVersionMinor$"; + + /// Patch: $GitBaseVersionPatch$ + public const string Patch = "$GitBaseVersionPatch$"; + } + + /// Provides access to SemVer information for the current assembly. + public partial class SemVer + { + /// Major: $GitSemVerMajor$ + public const string Major = "$GitSemVerMajor$"; + + /// Minor: $GitSemVerMinor$ + public const string Minor = "$GitSemVerMinor$"; + + /// Patch: $GitSemVerPatch$ + public const string Patch = "$GitSemVerPatch$"; + + /// Label: $GitSemVerLabel$ + public const string Label = "$GitSemVerLabel$"; + + /// Label with dash prefix: $GitSemVerDashLabel$ + public const string DashLabel = "$GitSemVerDashLabel$"; + + /// Source: $GitSemVerSource$ + public const string Source = "$GitSemVerSource$"; + } + } + } +#if LOCALNAMESPACE +} +#endif +#pragma warning restore 0436 diff --git a/w32/Setup/GitInfo/GitInfo.targets b/w32/Setup/GitInfo/GitInfo.targets new file mode 100644 index 0000000000..7c587c62d6 --- /dev/null +++ b/w32/Setup/GitInfo/GitInfo.targets @@ -0,0 +1,953 @@ + + + + + + + GitInfo.txt + + $(MSBuildProjectDirectory) + + $([MSBuild]::GetDirectoryNameOfFileAbove($(GitInfoBaseDir), $(GitVersionFile)))\$(GitVersionFile) + + master + 0000000 + 0.1.0 + + $(IntermediateOutputPath)ThisAssembly.GitInfo.g$(DefaultLanguageSourceExtension) + false + true + low + ADDMETADATA + NOMETADATA + + + 0 + MSBuild + + false + $(GitSkipCache) + $(GitSkipCache) + + 2.5.0 + + + + + + GitInfo; + GitVersion; + GitThisAssembly; + GitInfoReport; + $(CoreCompileDependsOn) + + + <_GitBaseVersionExpr Condition="'$(_GitBaseVersionExpr)' == ''">^v?(?<MAJOR>\d+)\.(?<MINOR>\d+)\.(?<PATCH>\d+)(?:\-(?<LABEL>[\dA-Za-z\-\.]+))?$|^(?<LABEL>[\dA-Za-z\-\.]+)\-v?(?<MAJOR>\d+)\.(?<MINOR>\d+)\.(?<PATCH>\d+)$ + + <_GitInfoFile>$(IntermediateOutputPath)GitInfo.cache + + + + + + + + + SetGitExe; + _EnsureGit; + _GitRoot; + _GitInputs; + _GitClearCache; + _GitReadCache; + _GitBranch; + _GitCommit; + _GitPopulateInfo; + + + + + <_ShortShaFormat>%%h + <_LongShaFormat>%%H + + + <_ShortShaFormat>%h + <_LongShaFormat>%H + + + + + + + + + + + + + <_GitCurrentVersion>$([System.Text.RegularExpressions.Regex]::Match("$(_GitOutput)", "\d+\.\d+\.\d+").Value) + + + + + + + + + + + + + + $(_GitOutput.Trim()) + + + + + + + + + + $(_GitOutput.Trim()) + + + + + $([System.IO.Path]::Combine('$(GitRoot)', '.git')) + <_IsGitFile>$([System.IO.File]::Exists('$(GitDir)')) + + + + + + + + + <_IsGitWorkTree>$(_GitIsWorkTree.Trim()) + + + + + + + + + + + + + + + $(_GitCommonDir.Trim()) + + + + <_GitFileContents>$([System.IO.File]::ReadAllText('$(GitDir)')) + $([System.String]::new('$(_GitFileContents)').Substring(7).Trim()) + $([System.IO.Path]::Combine('$(GitRoot)', '$(GitDir)')) + $([System.IO.Path]::GetFullPath('$(GitDir)')) + + + $(GitDir)$([System.IO.Path]::DirectorySeparatorChar) + + + + + + + + + + + + + + <_GitInput Include="$(GitDir)HEAD" /> + <_GitInput Include="$(GitVersionFile)" Condition="Exists('$(GitVersionFile)')" /> + + + + + + + + + + + + + + + + + + + + + + <_GitCachedInfo>$([System.IO.File]::ReadAllText('$(_GitInfoFile)')) + + + + + + + + %(GitInfo.GitBranch) + %(GitInfo.GitCommit) + %(GitInfo.GitSha) + %(GitInfo.GitBaseVersion) + %(GitInfo.GitBaseVersionSource) + %(GitInfo.GitBaseVersionMajor) + %(GitInfo.GitBaseVersionMinor) + %(GitInfo.GitBaseVersionPatch) + %(GitInfo.GitCommits) + %(GitInfo.GitTag) + %(GitInfo.GitBaseTag) + %(GitInfo.GitSemVerMajor) + %(GitInfo.GitSemVerMinor) + %(GitInfo.GitSemVerPatch) + %(GitInfo.GitSemVerLabel) + %(GitInfo.GitSemVerDashLabel) + %(GitInfo.GitSemVerSource) + + + + + + + <_GitHead>$([System.IO.Path]::Combine($(GitDir), 'HEAD')) + <_GitHead>$([System.IO.Path]::GetFullPath($(_GitHead))) + <_GitHead>$([System.IO.File]::ReadAllText('$(_GitHead)')) + $([System.Text.RegularExpressions.Regex]::Match($(_GitHead), '(?<=refs/heads/).+$')) + $(GitBranch.Trim()) + + + + + + + + + $(GitDefaultBranch) + + + + + + + + + + + + + $(GitDefaultCommit) + + + + + + + + + $(GitDefaultCommit) + + + + + + + + $(GitRoot) + $(GitBranch) + $(GitCommit) + $(GitSha) + + + + + + + GitInfo; + _GitBaseVersionBranch; + _GitBaseVersionTagExists; + _GitBaseVersionTag; + _GitBaseVersionFile; + _GitBaseVersionFallback; + _GitValidateBaseVersion; + _GitPopulateVersionInfo; + _GitWriteCache + + + + + + + + + $([System.IO.File]::ReadAllText('$(GitVersionFile)')) + $(GitBaseVersion.Trim()) + + $([System.Text.RegularExpressions.Regex]::IsMatch($(GitBaseVersion), $(_GitBaseVersionExpr))) + + $(IsValidGitBaseVersion.Trim()) + + + + + + <_GitVersionFile>$(GitVersionFile) + $(GitVersionFile) + File + + + + + + + + + + + + + + + + + + + 0 + <_GitLastBump>$(_GitLastBump.Trim()) + <_GitCommitsRelativeTo>$(GitCommitsRelativeTo) + + <_GitCommitsRelativeTo Condition="'$(_GitCommitsRelativeTo)' == '' And '$([System.IO.Path]::GetDirectoryName($(GitVersionFile)))' != ''">"$([System.IO.Path]::GetDirectoryName("$(GitVersionFile)"))" + + <_GitCommitsRelativeTo Condition="'$(_GitCommitsRelativeTo)' == ''">. + + + + + + + + + + + + + + + + + + + + $([System.Text.RegularExpressions.Regex]::IsMatch($(GitBranch), $(_GitBaseVersionExpr))) + + $(IsValidGitBaseVersion.Trim()) + + + + + + $(GitBranch) + GitBranch + Branch + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + $([System.Text.RegularExpressions.Regex]::IsMatch($(GitBaseTag), $(_GitBaseVersionExpr))) + + $(IsValidGitBaseVersion.Trim()) + + $(GitBaseTag) + + + + + + GitBaseTag + Tag + 0 + + + + + + + + + + + + + + + + 0 + + + + + + + + + $([System.Text.RegularExpressions.Regex]::IsMatch($(GitDefaultVersion), $(_GitBaseVersionExpr))) + + $(IsValidGitDefaultVersion.Trim()) + 0 + + + + + + + + + + + + $(GitDefaultVersion) + Default + + + + + + + + + + + + $([System.Text.RegularExpressions.Regex]::IsMatch($(GitBaseVersion), $(_GitBaseVersionExpr))) + + $(IsValidGitBaseVersion.Trim()) + + + + + + + + + + + $(GitBaseVersion.TrimStart('v')) + $(GitBaseVersion.TrimStart('V')) + $([System.Text.RegularExpressions.Regex]::Match($(GitBaseVersion), $(_GitBaseVersionExpr)).Groups['MAJOR'].Value) + $([System.Text.RegularExpressions.Regex]::Match($(GitBaseVersion), $(_GitBaseVersionExpr)).Groups['MINOR'].Value) + $([System.Text.RegularExpressions.Regex]::Match($(GitBaseVersion), $(_GitBaseVersionExpr)).Groups['PATCH'].Value) + $(GitBaseVersionMajor) + $(GitBaseVersionMinor) + $([MSBuild]::Add('$(GitBaseVersionPatch)', '$(GitCommits)')) + $([System.Text.RegularExpressions.Regex]::Match($(GitBaseVersion), $(_GitBaseVersionExpr)).Groups['LABEL'].Value) + -$(GitSemVerLabel) + + + + + <_GitInfo Include="@(GitInfo -> Distinct())"> + $(GitBaseVersion) + $(GitBaseVersionSource) + $(GitBaseVersionMajor) + $(GitBaseVersionMinor) + $(GitBaseVersionPatch) + $(GitCommits) + $(GitTag) + $(GitBaseTag) + $(GitSemVerMajor) + $(GitSemVerMinor) + $(GitSemVerPatch) + $(GitSemVerLabel) + $(GitSemVerDashLabel) + $(GitSemVerSource) + + + + + + + + + + + <_GitInfoContent>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)GitInfo.cache.pp')) + + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBranch$', '$(GitBranch)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitCommits$', '$(GitCommits)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitCommit$', '$(GitCommit)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSha$', '$(GitSha)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseVersion$', '$(GitBaseVersion)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseVersionSource$', '$(GitBaseVersionSource)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseVersionMajor$', '$(GitBaseVersionMajor)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseVersionMinor$', '$(GitBaseVersionMinor)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseVersionPatch$', '$(GitBaseVersionPatch)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitTag$', '$(GitTag)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitBaseTag$', '$(GitBaseTag)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerMajor$', '$(GitSemVerMajor)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerMinor$', '$(GitSemVerMinor)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerPatch$', '$(GitSemVerPatch)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerLabel$', '$(GitSemVerLabel)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerDashLabel$', '$(GitSemVerDashLabel)')) + <_GitInfoContent>$(_GitInfoContent.Replace('$GitSemVerSource$', '$(GitSemVerSource)')) + + + + <_GitInfoFileDir>$([System.IO.Path]::GetDirectoryName('$(_GitInfoFile)')) + + + + + + + + + + + + + + + GitInfo; + GitVersion; + _GitInputs; + _GitGenerateThisAssembly + + + + + + + + + + <_GeneratedCodeFiles Include="$(GitInfoThisAssemblyFile)" /> + + + + + + + + <_ThisAssemblyContent>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)GitInfo$(DefaultLanguageSourceExtension).pp')) + + + <_ThisAssemblyContent Condition="'$(ThisAssemblyNamespace)' != ''">$(_ThisAssemblyContent.Replace('$NamespaceDefine$', 'LOCALNAMESPACE')) + <_ThisAssemblyContent Condition="'$(ThisAssemblyNamespace)' == ''">$(_ThisAssemblyContent.Replace('$NamespaceDefine$', 'GLOBALNAMESPACE')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$MetadataDefine$', '$(GitThisAssemblyMetadataDefine)')) + + <_ThisAssemblyContent Condition="'$(ThisAssemblyNamespace)' != ''">$(_ThisAssemblyContent.Replace('RootNamespace.', '$(ThisAssemblyNamespace).')) + <_ThisAssemblyContent Condition="'$(ThisAssemblyNamespace)' == ''">$(_ThisAssemblyContent.Replace('RootNamespace.', '')) + + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('_RootNamespace_', '$(ThisAssemblyNamespace)')) + + + <_ThisAssemblyContent Condition="'$(Language)' == 'C#' And '$(GitRoot)' == ''">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'false')) + <_ThisAssemblyContent Condition="'$(Language)' == 'C#' And '$(GitIsDirty)' == '1'">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'true')) + <_ThisAssemblyContent Condition="'$(Language)' == 'C#' And '$(GitIsDirty)' == '0'">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'false')) + + <_ThisAssemblyContent Condition="'$(Language)' == 'VB' And '$(GitRoot)' == ''">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'False')) + <_ThisAssemblyContent Condition="'$(Language)' == 'VB' And '$(GitIsDirty)' == '1'">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'True')) + <_ThisAssemblyContent Condition="'$(Language)' == 'VB' And '$(GitIsDirty)' == '0'">$(_ThisAssemblyContent.Replace('$GitIsDirty$', 'False')) + + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBranch$', '$(GitBranch)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitCommits$', '$(GitCommits)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitCommit$', '$(GitCommit)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSha$', '$(GitSha)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseVersion$', '$(GitBaseVersion)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseVersionSource$', '$(GitBaseVersionSource)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseVersionMajor$', '$(GitBaseVersionMajor)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseVersionMinor$', '$(GitBaseVersionMinor)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseVersionPatch$', '$(GitBaseVersionPatch)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitTag$', '$(GitTag)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitBaseTag$', '$(GitBaseTag)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerMajor$', '$(GitSemVerMajor)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerMinor$', '$(GitSemVerMinor)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerPatch$', '$(GitSemVerPatch)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerLabel$', '$(GitSemVerLabel)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerDashLabel$', '$(GitSemVerDashLabel)')) + <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('$GitSemVerSource$', '$(GitSemVerSource)')) + + + + $([System.IO.Path]::GetDirectoryName('$(GitInfoThisAssemblyFile)')) + + + + + + + + + + git + + + + + + + + + git + + + + + "C:\Program Files\Git\bin\git.exe" + "C:\Program Files (x86)\Git\bin\git.exe" + C:\msysgit\bin\git.exe + + + + + + + + $(MSBuildThisFileDirectory)wslrun.cmd git + $(MSBuildThisFileDirectory)wslpath.cmd + + + + + C:\cygwin\bin\git.exe + C:\cygwin64\bin\git.exe + + + + + C:\cygwin\bin\cygpath.exe + C:\cygwin64\bin\cygpath.exe + + + + + true + + diff --git a/w32/Setup/GitInfo/GitInfo.vb.pp b/w32/Setup/GitInfo/GitInfo.vb.pp new file mode 100644 index 0000000000..cf45487b29 --- /dev/null +++ b/w32/Setup/GitInfo/GitInfo.vb.pp @@ -0,0 +1,91 @@ +' +#Const $NamespaceDefine$ = 1 +#Const $MetadataDefine$ = 1 + +#If ADDMETADATA + + + + + + + + + + + + + + + + +#End If + +#If LOCALNAMESPACE +Namespace Global._RootNamespace_ +#Else +Namespace Global +#End If + ''' Provides access to the git information for the current assembly. + Partial Class ThisAssembly + ''' Provides access to the git information for the current assembly. + Partial Public Class Git + ''' IsDirty: $GitIsDirty$ + Public Const IsDirty As Boolean = $GitIsDirty$ + + ''' IsDirtyString: $GitIsDirty$ + Public Const IsDirtyString As String = "$GitIsDirty$" + + ''' Branch: $GitBranch$ + Public Const Branch As String = "$GitBranch$" + + ''' Commit: $GitCommit$ + Public Const Commit As String = "$GitCommit$" + + ''' Commit: $GitSha$ + Public Const Sha As String = "$GitSha$" + + ''' Commits on top of base version: $GitCommits$ + Public Const Commits As String = "$GitCommits$" + + ''' Tag: $GitTag$ + Public Const Tag As String = "$GitTag$" + + ''' Base tag: $GitBaseTag$ + Public Const BaseTag As String = "$GitBaseTag$" + + ''' Provides access to the base version information used to determine the . + Partial Public Class BaseVersion + ''' Major: $GitBaseVersionMajor$ + Public Const Major As String = "$GitBaseVersionMajor$" + + ''' Minor $GitBaseVersionMinor$ + Public Const Minor As String = "$GitBaseVersionMinor$" + + ''' Patch $GitBaseVersionPatch$ + Public Const Patch As String = "$GitBaseVersionPatch$" + End Class + + ''' Provides access to SemVer information for the current assembly. + Partial Public Class SemVer + ''' Major: $GitSemVerMajor$ + Public Const Major As String = "$GitSemVerMajor$" + + ''' Minor: $GitSemVerMinor$ + Public Const Minor As String = "$GitSemVerMinor$" + + ''' Patch: $GitSemVerPatch$ + Public Const Patch As String = "$GitSemVerPatch$" + + ''' Label: $GitSemVerLabel$ + Public Const Label As String = "$GitSemVerLabel$" + + ''' Label with dash prefix: $GitSemVerDashLabel$ + Public Const DashLabel As String = "$GitSemVerDashLabel$" + + ''' Label with dash prefix: $GitSemVerSource$ + Public Const Source As String = "$GitSemVerVerSource$" + End Class + End Class + End Class +End Namespace diff --git a/w32/Setup/GitInfo/wslpath.cmd b/w32/Setup/GitInfo/wslpath.cmd new file mode 100644 index 0000000000..cc971cee9c --- /dev/null +++ b/w32/Setup/GitInfo/wslpath.cmd @@ -0,0 +1,26 @@ +@echo off +setlocal EnableExtensions EnableDelayedExpansion +REM Usage: wslpath.cmd -w +REM Converts a path from the Linux /mnt/c/... format into Windows format. + +REM Usage: wslpath.cmd -u +REM Converts a path from Windows to Linux format. + +REM Both usages require `wslrun.cmd` in the same directory as this file. + +if exist %0\..\wslrun.cmd set WSLRUN="%0\..\wslrun.cmd" +if exist %CD%\%0\..\wslrun.cmd set WSLRUN="%CD%\%0\..\wslrun.cmd" + +if "%1" == "-w" goto :towindows +if "%1" == "-u" shift /1 + +REM Convert path to Linux +if exist "%1\*" (pushd %1) else (pushd %~dp1) +if ERRORLEVEL 1 goto :eof +%WSLRUN% pwd +popd +goto :eof + +:towindows +REM Convert path to Windows +%WSLRUN% cd "'%2'" ^&^& cmd.exe /c cd diff --git a/w32/Setup/GitInfo/wslrun.cmd b/w32/Setup/GitInfo/wslrun.cmd new file mode 100644 index 0000000000..87cbf87c56 --- /dev/null +++ b/w32/Setup/GitInfo/wslrun.cmd @@ -0,0 +1,11 @@ +@echo off +REM Usage: wslrun.cmd +REM Runs the given command in the Windows Subsystem for Linux bash shell. + +REM Locate bash.exe +REM 32/64 bits causes issues here because it actually redirects the System32 dir +set BASH=bash.exe +if exist C:\Windows\System32\bash.exe set BASH=C:\Windows\System32\bash.exe +if exist C:\Windows\Sysnative\bash.exe set BASH=C:\Windows\Sysnative\bash.exe + +%BASH% -c "%*" diff --git a/w32/Setup/Setup.2015.wixproj b/w32/Setup/Setup.2015.wixproj index 1d12c3f92a..92931d3f7d 100644 --- a/w32/Setup/Setup.2015.wixproj +++ b/w32/Setup/Setup.2015.wixproj @@ -1,5 +1,11 @@  - + + + true + + + + {47213370-b933-487d-9f45-bca26d7e2b6f} 2.0 @@ -780,7 +786,13 @@ - + + + + + + + @@ -789,7 +801,7 @@ - + @@ -798,6 +810,10 @@ Other similar extension points exist, see Wix.targets. --> + + + + From 52ac19c3381d6292e8a83d263a913ddee28f7961 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 28 Mar 2018 12:25:49 +0300 Subject: [PATCH 132/264] FS-11067: [Build-System] Improve windows build speed moving openssl to pre-compiled binaries. --- Freeswitch.2015.sln | 68 - libs/.gitignore | 1 + libs/win32/Download OPENSSL.2015.vcxproj | 70 - libs/win32/Sound_Files/32khz.2015.vcxproj | 2 +- .../win32/Sound_Files/32khzmusic.2015.vcxproj | 2 +- libs/win32/openssl/include/openssl/aes.h | 149 - libs/win32/openssl/include/openssl/applink.c | 129 - libs/win32/openssl/include/openssl/asn1.h | 1419 ------ libs/win32/openssl/include/openssl/asn1_mac.h | 579 --- libs/win32/openssl/include/openssl/asn1t.h | 973 ---- libs/win32/openssl/include/openssl/bio.h | 883 ---- libs/win32/openssl/include/openssl/blowfish.h | 130 - libs/win32/openssl/include/openssl/bn.h | 951 ---- libs/win32/openssl/include/openssl/buffer.h | 125 - libs/win32/openssl/include/openssl/camellia.h | 132 - libs/win32/openssl/include/openssl/cast.h | 107 - libs/win32/openssl/include/openssl/cmac.h | 82 - libs/win32/openssl/include/openssl/cms.h | 555 --- libs/win32/openssl/include/openssl/comp.h | 83 - libs/win32/openssl/include/openssl/conf.h | 267 -- libs/win32/openssl/include/openssl/conf_api.h | 89 - libs/win32/openssl/include/openssl/crypto.h | 661 --- libs/win32/openssl/include/openssl/des.h | 257 - libs/win32/openssl/include/openssl/des_old.h | 497 -- libs/win32/openssl/include/openssl/dh.h | 393 -- libs/win32/openssl/include/openssl/dsa.h | 332 -- libs/win32/openssl/include/openssl/dso.h | 451 -- libs/win32/openssl/include/openssl/dtls1.h | 272 -- libs/win32/openssl/include/openssl/e_os2.h | 328 -- libs/win32/openssl/include/openssl/ebcdic.h | 26 - libs/win32/openssl/include/openssl/ec.h | 1282 ----- libs/win32/openssl/include/openssl/ecdh.h | 134 - libs/win32/openssl/include/openssl/ecdsa.h | 335 -- libs/win32/openssl/include/openssl/engine.h | 960 ---- libs/win32/openssl/include/openssl/err.h | 389 -- libs/win32/openssl/include/openssl/evp.h | 1536 ------ libs/win32/openssl/include/openssl/hmac.h | 109 - libs/win32/openssl/include/openssl/idea.h | 105 - libs/win32/openssl/include/openssl/krb5_asn.h | 240 - libs/win32/openssl/include/openssl/kssl.h | 197 - libs/win32/openssl/include/openssl/lhash.h | 240 - libs/win32/openssl/include/openssl/md4.h | 119 - libs/win32/openssl/include/openssl/md5.h | 119 - libs/win32/openssl/include/openssl/mdc2.h | 94 - libs/win32/openssl/include/openssl/modes.h | 163 - libs/win32/openssl/include/openssl/obj_mac.h | 4194 ----------------- libs/win32/openssl/include/openssl/objects.h | 1143 ----- libs/win32/openssl/include/openssl/ocsp.h | 637 --- libs/win32/openssl/include/openssl/opensslv.h | 97 - libs/win32/openssl/include/openssl/ossl_typ.h | 213 - libs/win32/openssl/include/openssl/pem.h | 617 --- libs/win32/openssl/include/openssl/pem2.h | 70 - libs/win32/openssl/include/openssl/pkcs12.h | 342 -- libs/win32/openssl/include/openssl/pkcs7.h | 481 -- libs/win32/openssl/include/openssl/pqueue.h | 99 - libs/win32/openssl/include/openssl/rand.h | 150 - libs/win32/openssl/include/openssl/rc2.h | 103 - libs/win32/openssl/include/openssl/rc4.h | 88 - libs/win32/openssl/include/openssl/ripemd.h | 105 - libs/win32/openssl/include/openssl/rsa.h | 664 --- .../win32/openssl/include/openssl/safestack.h | 2672 ----------- libs/win32/openssl/include/openssl/seed.h | 149 - libs/win32/openssl/include/openssl/sha.h | 214 - libs/win32/openssl/include/openssl/srp.h | 179 - libs/win32/openssl/include/openssl/srtp.h | 147 - libs/win32/openssl/include/openssl/ssl.h | 3163 ------------- libs/win32/openssl/include/openssl/ssl2.h | 265 -- libs/win32/openssl/include/openssl/ssl23.h | 84 - libs/win32/openssl/include/openssl/ssl3.h | 774 --- libs/win32/openssl/include/openssl/stack.h | 107 - libs/win32/openssl/include/openssl/symhacks.h | 516 -- libs/win32/openssl/include/openssl/tls1.h | 810 ---- libs/win32/openssl/include/openssl/ts.h | 865 ---- libs/win32/openssl/include/openssl/txt_db.h | 112 - libs/win32/openssl/include/openssl/ui.h | 415 -- .../win32/openssl/include/openssl/ui_compat.h | 88 - libs/win32/openssl/include/openssl/whrlpool.h | 41 - libs/win32/openssl/include/openssl/x509.h | 1330 ------ libs/win32/openssl/include/openssl/x509_vfy.h | 652 --- libs/win32/openssl/include/openssl/x509v3.h | 1055 ----- libs/win32/openssl/include_x64/buildinf.h | 7 - .../openssl/include_x64/openssl/opensslconf.h | 272 -- libs/win32/openssl/include_x86/buildinf.h | 7 - .../openssl/include_x86/openssl/opensslconf.h | 272 -- .../openssl/libeay32.2010.vcxproj.filters | 2183 --------- libs/win32/openssl/libeay32.2015.vcxproj | 884 ---- libs/win32/openssl/libeay32.def | 3689 --------------- .../openssl/openssl.2010.vcxproj.filters | 182 - libs/win32/openssl/openssl.2015.vcxproj | 271 -- .../openssl/ssleay32.2010.vcxproj.filters | 176 - libs/win32/openssl/ssleay32.2015.vcxproj | 264 -- libs/win32/openssl/ssleay32.def | 328 -- .../mod_unimrcp/mod_unimrcp.2015.vcxproj | 2 +- w32/openssl.props | 70 +- 94 files changed, 64 insertions(+), 47219 deletions(-) delete mode 100644 libs/win32/Download OPENSSL.2015.vcxproj delete mode 100644 libs/win32/openssl/include/openssl/aes.h delete mode 100644 libs/win32/openssl/include/openssl/applink.c delete mode 100644 libs/win32/openssl/include/openssl/asn1.h delete mode 100644 libs/win32/openssl/include/openssl/asn1_mac.h delete mode 100644 libs/win32/openssl/include/openssl/asn1t.h delete mode 100644 libs/win32/openssl/include/openssl/bio.h delete mode 100644 libs/win32/openssl/include/openssl/blowfish.h delete mode 100644 libs/win32/openssl/include/openssl/bn.h delete mode 100644 libs/win32/openssl/include/openssl/buffer.h delete mode 100644 libs/win32/openssl/include/openssl/camellia.h delete mode 100644 libs/win32/openssl/include/openssl/cast.h delete mode 100644 libs/win32/openssl/include/openssl/cmac.h delete mode 100644 libs/win32/openssl/include/openssl/cms.h delete mode 100644 libs/win32/openssl/include/openssl/comp.h delete mode 100644 libs/win32/openssl/include/openssl/conf.h delete mode 100644 libs/win32/openssl/include/openssl/conf_api.h delete mode 100644 libs/win32/openssl/include/openssl/crypto.h delete mode 100644 libs/win32/openssl/include/openssl/des.h delete mode 100644 libs/win32/openssl/include/openssl/des_old.h delete mode 100644 libs/win32/openssl/include/openssl/dh.h delete mode 100644 libs/win32/openssl/include/openssl/dsa.h delete mode 100644 libs/win32/openssl/include/openssl/dso.h delete mode 100644 libs/win32/openssl/include/openssl/dtls1.h delete mode 100644 libs/win32/openssl/include/openssl/e_os2.h delete mode 100644 libs/win32/openssl/include/openssl/ebcdic.h delete mode 100644 libs/win32/openssl/include/openssl/ec.h delete mode 100644 libs/win32/openssl/include/openssl/ecdh.h delete mode 100644 libs/win32/openssl/include/openssl/ecdsa.h delete mode 100644 libs/win32/openssl/include/openssl/engine.h delete mode 100644 libs/win32/openssl/include/openssl/err.h delete mode 100644 libs/win32/openssl/include/openssl/evp.h delete mode 100644 libs/win32/openssl/include/openssl/hmac.h delete mode 100644 libs/win32/openssl/include/openssl/idea.h delete mode 100644 libs/win32/openssl/include/openssl/krb5_asn.h delete mode 100644 libs/win32/openssl/include/openssl/kssl.h delete mode 100644 libs/win32/openssl/include/openssl/lhash.h delete mode 100644 libs/win32/openssl/include/openssl/md4.h delete mode 100644 libs/win32/openssl/include/openssl/md5.h delete mode 100644 libs/win32/openssl/include/openssl/mdc2.h delete mode 100644 libs/win32/openssl/include/openssl/modes.h delete mode 100644 libs/win32/openssl/include/openssl/obj_mac.h delete mode 100644 libs/win32/openssl/include/openssl/objects.h delete mode 100644 libs/win32/openssl/include/openssl/ocsp.h delete mode 100644 libs/win32/openssl/include/openssl/opensslv.h delete mode 100644 libs/win32/openssl/include/openssl/ossl_typ.h delete mode 100644 libs/win32/openssl/include/openssl/pem.h delete mode 100644 libs/win32/openssl/include/openssl/pem2.h delete mode 100644 libs/win32/openssl/include/openssl/pkcs12.h delete mode 100644 libs/win32/openssl/include/openssl/pkcs7.h delete mode 100644 libs/win32/openssl/include/openssl/pqueue.h delete mode 100644 libs/win32/openssl/include/openssl/rand.h delete mode 100644 libs/win32/openssl/include/openssl/rc2.h delete mode 100644 libs/win32/openssl/include/openssl/rc4.h delete mode 100644 libs/win32/openssl/include/openssl/ripemd.h delete mode 100644 libs/win32/openssl/include/openssl/rsa.h delete mode 100644 libs/win32/openssl/include/openssl/safestack.h delete mode 100644 libs/win32/openssl/include/openssl/seed.h delete mode 100644 libs/win32/openssl/include/openssl/sha.h delete mode 100644 libs/win32/openssl/include/openssl/srp.h delete mode 100644 libs/win32/openssl/include/openssl/srtp.h delete mode 100644 libs/win32/openssl/include/openssl/ssl.h delete mode 100644 libs/win32/openssl/include/openssl/ssl2.h delete mode 100644 libs/win32/openssl/include/openssl/ssl23.h delete mode 100644 libs/win32/openssl/include/openssl/ssl3.h delete mode 100644 libs/win32/openssl/include/openssl/stack.h delete mode 100644 libs/win32/openssl/include/openssl/symhacks.h delete mode 100644 libs/win32/openssl/include/openssl/tls1.h delete mode 100644 libs/win32/openssl/include/openssl/ts.h delete mode 100644 libs/win32/openssl/include/openssl/txt_db.h delete mode 100644 libs/win32/openssl/include/openssl/ui.h delete mode 100644 libs/win32/openssl/include/openssl/ui_compat.h delete mode 100644 libs/win32/openssl/include/openssl/whrlpool.h delete mode 100644 libs/win32/openssl/include/openssl/x509.h delete mode 100644 libs/win32/openssl/include/openssl/x509_vfy.h delete mode 100644 libs/win32/openssl/include/openssl/x509v3.h delete mode 100644 libs/win32/openssl/include_x64/buildinf.h delete mode 100644 libs/win32/openssl/include_x64/openssl/opensslconf.h delete mode 100644 libs/win32/openssl/include_x86/buildinf.h delete mode 100644 libs/win32/openssl/include_x86/openssl/opensslconf.h delete mode 100644 libs/win32/openssl/libeay32.2010.vcxproj.filters delete mode 100644 libs/win32/openssl/libeay32.2015.vcxproj delete mode 100644 libs/win32/openssl/libeay32.def delete mode 100644 libs/win32/openssl/openssl.2010.vcxproj.filters delete mode 100644 libs/win32/openssl/openssl.2015.vcxproj delete mode 100644 libs/win32/openssl/ssleay32.2010.vcxproj.filters delete mode 100644 libs/win32/openssl/ssleay32.2015.vcxproj delete mode 100644 libs/win32/openssl/ssleay32.def diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index 64ec54f3d0..269f87731d 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -239,9 +239,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsndfile", "libs\win32\libsndfile\libsndfile.2015.vcxproj", "{3D0370CA-BED2-4657-A475-32375CBCB6E4}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curllib", "libs\win32\curl\curllib.2015.vcxproj", "{87EE9DA4-DE1E-4448-8324-183C98DCA588}" - ProjectSection(ProjectDependencies) = postProject - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79} = {25BD39B1-C8BF-4676-A738-9CABD9C6BC79} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "libs\win32\apr-util\xml.2015.vcxproj", "{155844C3-EC5F-407F-97A4-A2DDADED9B2F}" EndProject @@ -400,9 +397,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skinny", "src\mod\endpoints\mod_skinny\mod_skinny.2015.vcxproj", "{CC1DD008-9406-448D-A0AD-33C3186CFADB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rtmp", "src\mod\endpoints\mod_rtmp\mod_rtmp.2015.vcxproj", "{48414740-C693-4968-9846-EE058020C64F}" - ProjectSection(ProjectDependencies) = postProject - {B4B62169-5AD4-4559-8707-3D933AC5DB39} = {B4B62169-5AD4-4559-8707-3D933AC5DB39} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "libs\spandsp\src\msvc\make_at_dictionary.2015.vcxproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}" EndProject @@ -473,19 +467,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spandsp", "src\mod\appl EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_hash", "src\mod\applications\mod_hash\mod_hash.2015.vcxproj", "{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "openssl", "openssl", "{E4D29906-8B73-4F8A-B5F4-CA8BFA648F5A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libeay32", "libs\win32\openssl\libeay32.2015.vcxproj", "{D331904D-A00A-4694-A5A3-FCFF64AB5DBE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ssleay32", "libs\win32\openssl\ssleay32.2015.vcxproj", "{B4B62169-5AD4-4559-8707-3D933AC5DB39}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openssl", "libs\win32\openssl\openssl.2015.vcxproj", "{25BD39B1-C8BF-4676-A738-9CABD9C6BC79}" - ProjectSection(ProjectDependencies) = postProject - {D578E676-7EC8-4548-BD8B-845C635F14AD} = {D578E676-7EC8-4548-BD8B-845C635F14AD} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download OPENSSL", "libs\win32\Download OPENSSL.2015.vcxproj", "{D578E676-7EC8-4548-BD8B-845C635F14AD}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsofia_sip_ua_static", "libs\win32\sofia\libsofia_sip_ua_static.2015.vcxproj", "{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_directory", "src\mod\applications\mod_directory\mod_directory.2015.vcxproj", "{B889A18E-70A7-44B5-B2C9-47798D4F43B3}" @@ -2183,50 +2164,6 @@ Global {2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Release|Win32.Build.0 = Release|Win32 {2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Release|x64.ActiveCfg = Release|x64 {2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Release|x64.Build.0 = Release|x64 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.All|Win32.ActiveCfg = Release|x64 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.All|x64.ActiveCfg = Release|x64 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.All|x64.Build.0 = Release|x64 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Debug|Win32.ActiveCfg = Debug|Win32 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Debug|Win32.Build.0 = Debug|Win32 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Debug|x64.ActiveCfg = Debug|x64 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Debug|x64.Build.0 = Debug|x64 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Release|Win32.ActiveCfg = Release|Win32 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Release|Win32.Build.0 = Release|Win32 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Release|x64.ActiveCfg = Release|x64 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE}.Release|x64.Build.0 = Release|x64 - {B4B62169-5AD4-4559-8707-3D933AC5DB39}.All|Win32.ActiveCfg = Release|x64 - {B4B62169-5AD4-4559-8707-3D933AC5DB39}.All|x64.ActiveCfg = Release|x64 - {B4B62169-5AD4-4559-8707-3D933AC5DB39}.All|x64.Build.0 = Release|x64 - {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Debug|Win32.ActiveCfg = Debug|Win32 - {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Debug|Win32.Build.0 = Debug|Win32 - {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Debug|x64.ActiveCfg = Debug|x64 - {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Debug|x64.Build.0 = Debug|x64 - {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Release|Win32.ActiveCfg = Release|Win32 - {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Release|Win32.Build.0 = Release|Win32 - {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Release|x64.ActiveCfg = Release|x64 - {B4B62169-5AD4-4559-8707-3D933AC5DB39}.Release|x64.Build.0 = Release|x64 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.All|Win32.ActiveCfg = Release|x64 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.All|x64.ActiveCfg = Release|x64 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.All|x64.Build.0 = Release|x64 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Debug|Win32.ActiveCfg = Debug|Win32 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Debug|Win32.Build.0 = Debug|Win32 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Debug|x64.ActiveCfg = Debug|x64 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Debug|x64.Build.0 = Debug|x64 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Release|Win32.ActiveCfg = Release|Win32 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Release|Win32.Build.0 = Release|Win32 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Release|x64.ActiveCfg = Release|x64 - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79}.Release|x64.Build.0 = Release|x64 - {D578E676-7EC8-4548-BD8B-845C635F14AD}.All|Win32.ActiveCfg = Release|Win32 - {D578E676-7EC8-4548-BD8B-845C635F14AD}.All|Win32.Build.0 = Release|Win32 - {D578E676-7EC8-4548-BD8B-845C635F14AD}.All|x64.ActiveCfg = Release|Win32 - {D578E676-7EC8-4548-BD8B-845C635F14AD}.Debug|Win32.ActiveCfg = Debug|Win32 - {D578E676-7EC8-4548-BD8B-845C635F14AD}.Debug|Win32.Build.0 = Debug|Win32 - {D578E676-7EC8-4548-BD8B-845C635F14AD}.Debug|x64.ActiveCfg = Debug|Win32 - {D578E676-7EC8-4548-BD8B-845C635F14AD}.Debug|x64.Build.0 = Debug|Win32 - {D578E676-7EC8-4548-BD8B-845C635F14AD}.Release|Win32.ActiveCfg = Release|Win32 - {D578E676-7EC8-4548-BD8B-845C635F14AD}.Release|Win32.Build.0 = Release|Win32 - {D578E676-7EC8-4548-BD8B-845C635F14AD}.Release|x64.ActiveCfg = Release|Win32 - {D578E676-7EC8-4548-BD8B-845C635F14AD}.Release|x64.Build.0 = Release|Win32 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|Win32.ActiveCfg = Release|x64 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|x64.ActiveCfg = Release|x64 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|x64.Build.0 = Release|x64 @@ -3162,11 +3099,6 @@ Global {990BAA76-89D3-4E38-8479-C7B28784EFC8} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {1E21AFE0-6FDB-41D2-942D-863607C24B91} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {2E250296-0C08-4342-9C8A-BCBDD0E7DF65} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} - {E4D29906-8B73-4F8A-B5F4-CA8BFA648F5A} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE} = {E4D29906-8B73-4F8A-B5F4-CA8BFA648F5A} - {B4B62169-5AD4-4559-8707-3D933AC5DB39} = {E4D29906-8B73-4F8A-B5F4-CA8BFA648F5A} - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79} = {E4D29906-8B73-4F8A-B5F4-CA8BFA648F5A} - {D578E676-7EC8-4548-BD8B-845C635F14AD} = {C120A020-773F-4EA3-923F-B67AF28B750D} {70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {B889A18E-70A7-44B5-B2C9-47798D4F43B3} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} {05C9FB27-480E-4D53-B3B7-7338E2514666} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} diff --git a/libs/.gitignore b/libs/.gitignore index 8862900d89..450b313e42 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -328,6 +328,7 @@ opal /libmpg123/ /openldap-*/ /openssl-*/ +/openssl-* /opus-*/ /pocketsphinx-*/ /pthreads-w32-2-7-0-release/ diff --git a/libs/win32/Download OPENSSL.2015.vcxproj b/libs/win32/Download OPENSSL.2015.vcxproj deleted file mode 100644 index 68d2615fa4..0000000000 --- a/libs/win32/Download OPENSSL.2015.vcxproj +++ /dev/null @@ -1,70 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - Download OPENSSL - {D578E676-7EC8-4548-BD8B-845C635F14AD} - Download OPENSSL - Win32Proj - - - - Utility - MultiByte - true - v140 - - - Utility - MultiByte - v140 - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(PlatformName)\OPENSSL\$(Configuration)\ - $(PlatformName)\OPENSSL\$(Configuration)\ - - - - $(IntDir)BuildLog $(ProjectName).htm - - - - - Document - Downloading OPENSSL - if not exist "$(ProjectDir)..\openssl-$(OpenSSLVersion)" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/openssl-$(OpenSSLVersion).tar.gz "$(ProjectDir).." - - $(ProjectDir)..\openssl-$(OpenSSLVersion);%(Outputs) - Downloading OPENSSL - if not exist "$(ProjectDir)..\openssl-$(OpenSSLVersion)" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/openssl-$(OpenSSLVersion).tar.gz "$(ProjectDir).." - - $(ProjectDir)..\openssl-$(OpenSSLVersion);%(Outputs) - - - - - - \ No newline at end of file diff --git a/libs/win32/Sound_Files/32khz.2015.vcxproj b/libs/win32/Sound_Files/32khz.2015.vcxproj index 76c6af364f..d926eda33c 100644 --- a/libs/win32/Sound_Files/32khz.2015.vcxproj +++ b/libs/win32/Sound_Files/32khz.2015.vcxproj @@ -147,7 +147,7 @@ xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\32000\*.*" "$(OutDir)sou
- + {6e49f6c2-adda-4bfb-81fe-ab9af51b455f} false diff --git a/libs/win32/Sound_Files/32khzmusic.2015.vcxproj b/libs/win32/Sound_Files/32khzmusic.2015.vcxproj index 755d84d9b2..29edffc562 100644 --- a/libs/win32/Sound_Files/32khzmusic.2015.vcxproj +++ b/libs/win32/Sound_Files/32khzmusic.2015.vcxproj @@ -103,7 +103,7 @@ - + {1f0a8a77-e661-418f-bb92-82172ae43803} false diff --git a/libs/win32/openssl/include/openssl/aes.h b/libs/win32/openssl/include/openssl/aes.h deleted file mode 100644 index faa66c4914..0000000000 --- a/libs/win32/openssl/include/openssl/aes.h +++ /dev/null @@ -1,149 +0,0 @@ -/* crypto/aes/aes.h */ -/* ==================================================================== - * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - */ - -#ifndef HEADER_AES_H -# define HEADER_AES_H - -# include - -# ifdef OPENSSL_NO_AES -# error AES is disabled. -# endif - -# include - -# define AES_ENCRYPT 1 -# define AES_DECRYPT 0 - -/* - * Because array size can't be a const in C, the following two are macros. - * Both sizes are in bytes. - */ -# define AES_MAXNR 14 -# define AES_BLOCK_SIZE 16 - -#ifdef __cplusplus -extern "C" { -#endif - -/* This should be a hidden type, but EVP requires that the size be known */ -struct aes_key_st { -# ifdef AES_LONG - unsigned long rd_key[4 * (AES_MAXNR + 1)]; -# else - unsigned int rd_key[4 * (AES_MAXNR + 1)]; -# endif - int rounds; -}; -typedef struct aes_key_st AES_KEY; - -const char *AES_options(void); - -int AES_set_encrypt_key(const unsigned char *userKey, const int bits, - AES_KEY *key); -int AES_set_decrypt_key(const unsigned char *userKey, const int bits, - AES_KEY *key); - -int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, - AES_KEY *key); -int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, - AES_KEY *key); - -void AES_encrypt(const unsigned char *in, unsigned char *out, - const AES_KEY *key); -void AES_decrypt(const unsigned char *in, unsigned char *out, - const AES_KEY *key); - -void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, - const AES_KEY *key, const int enc); -void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const AES_KEY *key, - unsigned char *ivec, const int enc); -void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const AES_KEY *key, - unsigned char *ivec, int *num, const int enc); -void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const AES_KEY *key, - unsigned char *ivec, int *num, const int enc); -void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const AES_KEY *key, - unsigned char *ivec, int *num, const int enc); -void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const AES_KEY *key, - unsigned char *ivec, int *num); -void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const AES_KEY *key, - unsigned char ivec[AES_BLOCK_SIZE], - unsigned char ecount_buf[AES_BLOCK_SIZE], - unsigned int *num); -/* NB: the IV is _two_ blocks long */ -void AES_ige_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const AES_KEY *key, - unsigned char *ivec, const int enc); -/* NB: the IV is _four_ blocks long */ -void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const AES_KEY *key, - const AES_KEY *key2, const unsigned char *ivec, - const int enc); - -int AES_wrap_key(AES_KEY *key, const unsigned char *iv, - unsigned char *out, - const unsigned char *in, unsigned int inlen); -int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, - unsigned char *out, - const unsigned char *in, unsigned int inlen); - - -#ifdef __cplusplus -} -#endif - -#endif /* !HEADER_AES_H */ diff --git a/libs/win32/openssl/include/openssl/applink.c b/libs/win32/openssl/include/openssl/applink.c deleted file mode 100644 index 2831b39e9a..0000000000 --- a/libs/win32/openssl/include/openssl/applink.c +++ /dev/null @@ -1,129 +0,0 @@ -#define APPLINK_STDIN 1 -#define APPLINK_STDOUT 2 -#define APPLINK_STDERR 3 -#define APPLINK_FPRINTF 4 -#define APPLINK_FGETS 5 -#define APPLINK_FREAD 6 -#define APPLINK_FWRITE 7 -#define APPLINK_FSETMOD 8 -#define APPLINK_FEOF 9 -#define APPLINK_FCLOSE 10 /* should not be used */ - -#define APPLINK_FOPEN 11 /* solely for completeness */ -#define APPLINK_FSEEK 12 -#define APPLINK_FTELL 13 -#define APPLINK_FFLUSH 14 -#define APPLINK_FERROR 15 -#define APPLINK_CLEARERR 16 -#define APPLINK_FILENO 17 /* to be used with below */ - -#define APPLINK_OPEN 18 /* formally can't be used, as flags can vary */ -#define APPLINK_READ 19 -#define APPLINK_WRITE 20 -#define APPLINK_LSEEK 21 -#define APPLINK_CLOSE 22 -#define APPLINK_MAX 22 /* always same as last macro */ - -#ifndef APPMACROS_ONLY -# include -# include -# include - -static void *app_stdin(void) -{ - return stdin; -} - -static void *app_stdout(void) -{ - return stdout; -} - -static void *app_stderr(void) -{ - return stderr; -} - -static int app_feof(FILE *fp) -{ - return feof(fp); -} - -static int app_ferror(FILE *fp) -{ - return ferror(fp); -} - -static void app_clearerr(FILE *fp) -{ - clearerr(fp); -} - -static int app_fileno(FILE *fp) -{ - return _fileno(fp); -} - -static int app_fsetmod(FILE *fp, char mod) -{ - return _setmode(_fileno(fp), mod == 'b' ? _O_BINARY : _O_TEXT); -} - -#ifdef __cplusplus -extern "C" { -#endif - -__declspec(dllexport) -void ** -# if defined(__BORLANDC__) -/* - * __stdcall appears to be the only way to get the name - * decoration right with Borland C. Otherwise it works - * purely incidentally, as we pass no parameters. - */ - __stdcall -# else - __cdecl -# endif -OPENSSL_Applink(void) -{ - static int once = 1; - static void *OPENSSL_ApplinkTable[APPLINK_MAX + 1] = - { (void *)APPLINK_MAX }; - - if (once) { - OPENSSL_ApplinkTable[APPLINK_STDIN] = app_stdin; - OPENSSL_ApplinkTable[APPLINK_STDOUT] = app_stdout; - OPENSSL_ApplinkTable[APPLINK_STDERR] = app_stderr; - OPENSSL_ApplinkTable[APPLINK_FPRINTF] = fprintf; - OPENSSL_ApplinkTable[APPLINK_FGETS] = fgets; - OPENSSL_ApplinkTable[APPLINK_FREAD] = fread; - OPENSSL_ApplinkTable[APPLINK_FWRITE] = fwrite; - OPENSSL_ApplinkTable[APPLINK_FSETMOD] = app_fsetmod; - OPENSSL_ApplinkTable[APPLINK_FEOF] = app_feof; - OPENSSL_ApplinkTable[APPLINK_FCLOSE] = fclose; - - OPENSSL_ApplinkTable[APPLINK_FOPEN] = fopen; - OPENSSL_ApplinkTable[APPLINK_FSEEK] = fseek; - OPENSSL_ApplinkTable[APPLINK_FTELL] = ftell; - OPENSSL_ApplinkTable[APPLINK_FFLUSH] = fflush; - OPENSSL_ApplinkTable[APPLINK_FERROR] = app_ferror; - OPENSSL_ApplinkTable[APPLINK_CLEARERR] = app_clearerr; - OPENSSL_ApplinkTable[APPLINK_FILENO] = app_fileno; - - OPENSSL_ApplinkTable[APPLINK_OPEN] = _open; - OPENSSL_ApplinkTable[APPLINK_READ] = _read; - OPENSSL_ApplinkTable[APPLINK_WRITE] = _write; - OPENSSL_ApplinkTable[APPLINK_LSEEK] = _lseek; - OPENSSL_ApplinkTable[APPLINK_CLOSE] = _close; - - once = 0; - } - - return OPENSSL_ApplinkTable; -} - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/asn1.h b/libs/win32/openssl/include/openssl/asn1.h deleted file mode 100644 index 68e791fcdb..0000000000 --- a/libs/win32/openssl/include/openssl/asn1.h +++ /dev/null @@ -1,1419 +0,0 @@ -/* crypto/asn1/asn1.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_ASN1_H -# define HEADER_ASN1_H - -# include -# include -# ifndef OPENSSL_NO_BIO -# include -# endif -# include -# include - -# include - -# include -# ifndef OPENSSL_NO_DEPRECATED -# include -# endif - -# ifdef OPENSSL_BUILD_SHLIBCRYPTO -# undef OPENSSL_EXTERN -# define OPENSSL_EXTERN OPENSSL_EXPORT -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -# define V_ASN1_UNIVERSAL 0x00 -# define V_ASN1_APPLICATION 0x40 -# define V_ASN1_CONTEXT_SPECIFIC 0x80 -# define V_ASN1_PRIVATE 0xc0 - -# define V_ASN1_CONSTRUCTED 0x20 -# define V_ASN1_PRIMITIVE_TAG 0x1f -# define V_ASN1_PRIMATIVE_TAG 0x1f - -# define V_ASN1_APP_CHOOSE -2/* let the recipient choose */ -# define V_ASN1_OTHER -3/* used in ASN1_TYPE */ -# define V_ASN1_ANY -4/* used in ASN1 template code */ - -# define V_ASN1_NEG 0x100/* negative flag */ - -# define V_ASN1_UNDEF -1 -# define V_ASN1_EOC 0 -# define V_ASN1_BOOLEAN 1 /**/ -# define V_ASN1_INTEGER 2 -# define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG) -# define V_ASN1_BIT_STRING 3 -# define V_ASN1_OCTET_STRING 4 -# define V_ASN1_NULL 5 -# define V_ASN1_OBJECT 6 -# define V_ASN1_OBJECT_DESCRIPTOR 7 -# define V_ASN1_EXTERNAL 8 -# define V_ASN1_REAL 9 -# define V_ASN1_ENUMERATED 10 -# define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG) -# define V_ASN1_UTF8STRING 12 -# define V_ASN1_SEQUENCE 16 -# define V_ASN1_SET 17 -# define V_ASN1_NUMERICSTRING 18 /**/ -# define V_ASN1_PRINTABLESTRING 19 -# define V_ASN1_T61STRING 20 -# define V_ASN1_TELETEXSTRING 20/* alias */ -# define V_ASN1_VIDEOTEXSTRING 21 /**/ -# define V_ASN1_IA5STRING 22 -# define V_ASN1_UTCTIME 23 -# define V_ASN1_GENERALIZEDTIME 24 /**/ -# define V_ASN1_GRAPHICSTRING 25 /**/ -# define V_ASN1_ISO64STRING 26 /**/ -# define V_ASN1_VISIBLESTRING 26/* alias */ -# define V_ASN1_GENERALSTRING 27 /**/ -# define V_ASN1_UNIVERSALSTRING 28 /**/ -# define V_ASN1_BMPSTRING 30 -/* For use with d2i_ASN1_type_bytes() */ -# define B_ASN1_NUMERICSTRING 0x0001 -# define B_ASN1_PRINTABLESTRING 0x0002 -# define B_ASN1_T61STRING 0x0004 -# define B_ASN1_TELETEXSTRING 0x0004 -# define B_ASN1_VIDEOTEXSTRING 0x0008 -# define B_ASN1_IA5STRING 0x0010 -# define B_ASN1_GRAPHICSTRING 0x0020 -# define B_ASN1_ISO64STRING 0x0040 -# define B_ASN1_VISIBLESTRING 0x0040 -# define B_ASN1_GENERALSTRING 0x0080 -# define B_ASN1_UNIVERSALSTRING 0x0100 -# define B_ASN1_OCTET_STRING 0x0200 -# define B_ASN1_BIT_STRING 0x0400 -# define B_ASN1_BMPSTRING 0x0800 -# define B_ASN1_UNKNOWN 0x1000 -# define B_ASN1_UTF8STRING 0x2000 -# define B_ASN1_UTCTIME 0x4000 -# define B_ASN1_GENERALIZEDTIME 0x8000 -# define B_ASN1_SEQUENCE 0x10000 -/* For use with ASN1_mbstring_copy() */ -# define MBSTRING_FLAG 0x1000 -# define MBSTRING_UTF8 (MBSTRING_FLAG) -# define MBSTRING_ASC (MBSTRING_FLAG|1) -# define MBSTRING_BMP (MBSTRING_FLAG|2) -# define MBSTRING_UNIV (MBSTRING_FLAG|4) -# define SMIME_OLDMIME 0x400 -# define SMIME_CRLFEOL 0x800 -# define SMIME_STREAM 0x1000 - struct X509_algor_st; -DECLARE_STACK_OF(X509_ALGOR) - -# define DECLARE_ASN1_SET_OF(type)/* filled in by mkstack.pl */ -# define IMPLEMENT_ASN1_SET_OF(type)/* nothing, no longer needed */ - -/* - * We MUST make sure that, except for constness, asn1_ctx_st and - * asn1_const_ctx are exactly the same. Fortunately, as soon as the old ASN1 - * parsing macros are gone, we can throw this away as well... - */ -typedef struct asn1_ctx_st { - unsigned char *p; /* work char pointer */ - int eos; /* end of sequence read for indefinite - * encoding */ - int error; /* error code to use when returning an error */ - int inf; /* constructed if 0x20, indefinite is 0x21 */ - int tag; /* tag from last 'get object' */ - int xclass; /* class from last 'get object' */ - long slen; /* length of last 'get object' */ - unsigned char *max; /* largest value of p allowed */ - unsigned char *q; /* temporary variable */ - unsigned char **pp; /* variable */ - int line; /* used in error processing */ -} ASN1_CTX; - -typedef struct asn1_const_ctx_st { - const unsigned char *p; /* work char pointer */ - int eos; /* end of sequence read for indefinite - * encoding */ - int error; /* error code to use when returning an error */ - int inf; /* constructed if 0x20, indefinite is 0x21 */ - int tag; /* tag from last 'get object' */ - int xclass; /* class from last 'get object' */ - long slen; /* length of last 'get object' */ - const unsigned char *max; /* largest value of p allowed */ - const unsigned char *q; /* temporary variable */ - const unsigned char **pp; /* variable */ - int line; /* used in error processing */ -} ASN1_const_CTX; - -/* - * These are used internally in the ASN1_OBJECT to keep track of whether the - * names and data need to be free()ed - */ -# define ASN1_OBJECT_FLAG_DYNAMIC 0x01/* internal use */ -# define ASN1_OBJECT_FLAG_CRITICAL 0x02/* critical x509v3 object id */ -# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */ -# define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08/* internal use */ -struct asn1_object_st { - const char *sn, *ln; - int nid; - int length; - const unsigned char *data; /* data remains const after init */ - int flags; /* Should we free this one */ -}; - -# define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */ -/* - * This indicates that the ASN1_STRING is not a real value but just a place - * holder for the location where indefinite length constructed data should be - * inserted in the memory buffer - */ -# define ASN1_STRING_FLAG_NDEF 0x010 - -/* - * This flag is used by the CMS code to indicate that a string is not - * complete and is a place holder for content when it had all been accessed. - * The flag will be reset when content has been written to it. - */ - -# define ASN1_STRING_FLAG_CONT 0x020 -/* - * This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING - * type. - */ -# define ASN1_STRING_FLAG_MSTRING 0x040 -/* This is the base type that holds just about everything :-) */ -struct asn1_string_st { - int length; - int type; - unsigned char *data; - /* - * The value of the following field depends on the type being held. It - * is mostly being used for BIT_STRING so if the input data has a - * non-zero 'unused bits' value, it will be handled correctly - */ - long flags; -}; - -/* - * ASN1_ENCODING structure: this is used to save the received encoding of an - * ASN1 type. This is useful to get round problems with invalid encodings - * which can break signatures. - */ - -typedef struct ASN1_ENCODING_st { - unsigned char *enc; /* DER encoding */ - long len; /* Length of encoding */ - int modified; /* set to 1 if 'enc' is invalid */ -} ASN1_ENCODING; - -/* Used with ASN1 LONG type: if a long is set to this it is omitted */ -# define ASN1_LONG_UNDEF 0x7fffffffL - -# define STABLE_FLAGS_MALLOC 0x01 -# define STABLE_NO_MASK 0x02 -# define DIRSTRING_TYPE \ - (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING) -# define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING) - -typedef struct asn1_string_table_st { - int nid; - long minsize; - long maxsize; - unsigned long mask; - unsigned long flags; -} ASN1_STRING_TABLE; - -DECLARE_STACK_OF(ASN1_STRING_TABLE) - -/* size limits: this stuff is taken straight from RFC2459 */ - -# define ub_name 32768 -# define ub_common_name 64 -# define ub_locality_name 128 -# define ub_state_name 128 -# define ub_organization_name 64 -# define ub_organization_unit_name 64 -# define ub_title 64 -# define ub_email_address 128 - -/* - * Declarations for template structures: for full definitions see asn1t.h - */ -typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE; -typedef struct ASN1_TLC_st ASN1_TLC; -/* This is just an opaque pointer */ -typedef struct ASN1_VALUE_st ASN1_VALUE; - -/* Declare ASN1 functions: the implement macro in in asn1t.h */ - -# define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type) - -# define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \ - DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type) - -# define DECLARE_ASN1_FUNCTIONS_name(type, name) \ - DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ - DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) - -# define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \ - DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ - DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) - -# define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ - type *d2i_##name(type **a, const unsigned char **in, long len); \ - int i2d_##name(type *a, unsigned char **out); \ - DECLARE_ASN1_ITEM(itname) - -# define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ - type *d2i_##name(type **a, const unsigned char **in, long len); \ - int i2d_##name(const type *a, unsigned char **out); \ - DECLARE_ASN1_ITEM(name) - -# define DECLARE_ASN1_NDEF_FUNCTION(name) \ - int i2d_##name##_NDEF(name *a, unsigned char **out); - -# define DECLARE_ASN1_FUNCTIONS_const(name) \ - DECLARE_ASN1_ALLOC_FUNCTIONS(name) \ - DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name) - -# define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ - type *name##_new(void); \ - void name##_free(type *a); - -# define DECLARE_ASN1_PRINT_FUNCTION(stname) \ - DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname) - -# define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \ - int fname##_print_ctx(BIO *out, stname *x, int indent, \ - const ASN1_PCTX *pctx); - -# define D2I_OF(type) type *(*)(type **,const unsigned char **,long) -# define I2D_OF(type) int (*)(type *,unsigned char **) -# define I2D_OF_const(type) int (*)(const type *,unsigned char **) - -# define CHECKED_D2I_OF(type, d2i) \ - ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0))) -# define CHECKED_I2D_OF(type, i2d) \ - ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0))) -# define CHECKED_NEW_OF(type, xnew) \ - ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0))) -# define CHECKED_PTR_OF(type, p) \ - ((void*) (1 ? p : (type*)0)) -# define CHECKED_PPTR_OF(type, p) \ - ((void**) (1 ? p : (type**)0)) - -# define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long) -# define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **) -# define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type) - -TYPEDEF_D2I2D_OF(void); - -/*- - * The following macros and typedefs allow an ASN1_ITEM - * to be embedded in a structure and referenced. Since - * the ASN1_ITEM pointers need to be globally accessible - * (possibly from shared libraries) they may exist in - * different forms. On platforms that support it the - * ASN1_ITEM structure itself will be globally exported. - * Other platforms will export a function that returns - * an ASN1_ITEM pointer. - * - * To handle both cases transparently the macros below - * should be used instead of hard coding an ASN1_ITEM - * pointer in a structure. - * - * The structure will look like this: - * - * typedef struct SOMETHING_st { - * ... - * ASN1_ITEM_EXP *iptr; - * ... - * } SOMETHING; - * - * It would be initialised as e.g.: - * - * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...}; - * - * and the actual pointer extracted with: - * - * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr); - * - * Finally an ASN1_ITEM pointer can be extracted from an - * appropriate reference with: ASN1_ITEM_rptr(X509). This - * would be used when a function takes an ASN1_ITEM * argument. - * - */ - -# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION - -/* ASN1_ITEM pointer exported type */ -typedef const ASN1_ITEM ASN1_ITEM_EXP; - -/* Macro to obtain ASN1_ITEM pointer from exported type */ -# define ASN1_ITEM_ptr(iptr) (iptr) - -/* Macro to include ASN1_ITEM pointer from base type */ -# define ASN1_ITEM_ref(iptr) (&(iptr##_it)) - -# define ASN1_ITEM_rptr(ref) (&(ref##_it)) - -# define DECLARE_ASN1_ITEM(name) \ - OPENSSL_EXTERN const ASN1_ITEM name##_it; - -# else - -/* - * Platforms that can't easily handle shared global variables are declared as - * functions returning ASN1_ITEM pointers. - */ - -/* ASN1_ITEM pointer exported type */ -typedef const ASN1_ITEM *ASN1_ITEM_EXP (void); - -/* Macro to obtain ASN1_ITEM pointer from exported type */ -# define ASN1_ITEM_ptr(iptr) (iptr()) - -/* Macro to include ASN1_ITEM pointer from base type */ -# define ASN1_ITEM_ref(iptr) (iptr##_it) - -# define ASN1_ITEM_rptr(ref) (ref##_it()) - -# define DECLARE_ASN1_ITEM(name) \ - const ASN1_ITEM * name##_it(void); - -# endif - -/* Parameters used by ASN1_STRING_print_ex() */ - -/* - * These determine which characters to escape: RFC2253 special characters, - * control characters and MSB set characters - */ - -# define ASN1_STRFLGS_ESC_2253 1 -# define ASN1_STRFLGS_ESC_CTRL 2 -# define ASN1_STRFLGS_ESC_MSB 4 - -/* - * This flag determines how we do escaping: normally RC2253 backslash only, - * set this to use backslash and quote. - */ - -# define ASN1_STRFLGS_ESC_QUOTE 8 - -/* These three flags are internal use only. */ - -/* Character is a valid PrintableString character */ -# define CHARTYPE_PRINTABLESTRING 0x10 -/* Character needs escaping if it is the first character */ -# define CHARTYPE_FIRST_ESC_2253 0x20 -/* Character needs escaping if it is the last character */ -# define CHARTYPE_LAST_ESC_2253 0x40 - -/* - * NB the internal flags are safely reused below by flags handled at the top - * level. - */ - -/* - * If this is set we convert all character strings to UTF8 first - */ - -# define ASN1_STRFLGS_UTF8_CONVERT 0x10 - -/* - * If this is set we don't attempt to interpret content: just assume all - * strings are 1 byte per character. This will produce some pretty odd - * looking output! - */ - -# define ASN1_STRFLGS_IGNORE_TYPE 0x20 - -/* If this is set we include the string type in the output */ -# define ASN1_STRFLGS_SHOW_TYPE 0x40 - -/* - * This determines which strings to display and which to 'dump' (hex dump of - * content octets or DER encoding). We can only dump non character strings or - * everything. If we don't dump 'unknown' they are interpreted as character - * strings with 1 octet per character and are subject to the usual escaping - * options. - */ - -# define ASN1_STRFLGS_DUMP_ALL 0x80 -# define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 - -/* - * These determine what 'dumping' does, we can dump the content octets or the - * DER encoding: both use the RFC2253 #XXXXX notation. - */ - -# define ASN1_STRFLGS_DUMP_DER 0x200 - -/* - * All the string flags consistent with RFC2253, escaping control characters - * isn't essential in RFC2253 but it is advisable anyway. - */ - -# define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \ - ASN1_STRFLGS_ESC_CTRL | \ - ASN1_STRFLGS_ESC_MSB | \ - ASN1_STRFLGS_UTF8_CONVERT | \ - ASN1_STRFLGS_DUMP_UNKNOWN | \ - ASN1_STRFLGS_DUMP_DER) - -DECLARE_STACK_OF(ASN1_INTEGER) -DECLARE_ASN1_SET_OF(ASN1_INTEGER) - -DECLARE_STACK_OF(ASN1_GENERALSTRING) - -typedef struct asn1_type_st { - int type; - union { - char *ptr; - ASN1_BOOLEAN boolean; - ASN1_STRING *asn1_string; - ASN1_OBJECT *object; - ASN1_INTEGER *integer; - ASN1_ENUMERATED *enumerated; - ASN1_BIT_STRING *bit_string; - ASN1_OCTET_STRING *octet_string; - ASN1_PRINTABLESTRING *printablestring; - ASN1_T61STRING *t61string; - ASN1_IA5STRING *ia5string; - ASN1_GENERALSTRING *generalstring; - ASN1_BMPSTRING *bmpstring; - ASN1_UNIVERSALSTRING *universalstring; - ASN1_UTCTIME *utctime; - ASN1_GENERALIZEDTIME *generalizedtime; - ASN1_VISIBLESTRING *visiblestring; - ASN1_UTF8STRING *utf8string; - /* - * set and sequence are left complete and still contain the set or - * sequence bytes - */ - ASN1_STRING *set; - ASN1_STRING *sequence; - ASN1_VALUE *asn1_value; - } value; -} ASN1_TYPE; - -DECLARE_STACK_OF(ASN1_TYPE) -DECLARE_ASN1_SET_OF(ASN1_TYPE) - -typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; - -DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) -DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY) - -typedef struct NETSCAPE_X509_st { - ASN1_OCTET_STRING *header; - X509 *cert; -} NETSCAPE_X509; - -/* This is used to contain a list of bit names */ -typedef struct BIT_STRING_BITNAME_st { - int bitnum; - const char *lname; - const char *sname; -} BIT_STRING_BITNAME; - -# define M_ASN1_STRING_length(x) ((x)->length) -# define M_ASN1_STRING_length_set(x, n) ((x)->length = (n)) -# define M_ASN1_STRING_type(x) ((x)->type) -# define M_ASN1_STRING_data(x) ((x)->data) - -/* Macros for string operations */ -# define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\ - ASN1_STRING_type_new(V_ASN1_BIT_STRING) -# define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) -# define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\ - (const ASN1_STRING *)a,(const ASN1_STRING *)b) -# define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c) - -# define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\ - ASN1_STRING_type_new(V_ASN1_INTEGER) -# define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) -# define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\ - (const ASN1_STRING *)a,(const ASN1_STRING *)b) - -# define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\ - ASN1_STRING_type_new(V_ASN1_ENUMERATED) -# define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) -# define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\ - (const ASN1_STRING *)a,(const ASN1_STRING *)b) - -# define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\ - ASN1_STRING_type_new(V_ASN1_OCTET_STRING) -# define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) -# define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\ - (const ASN1_STRING *)a,(const ASN1_STRING *)b) -# define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c) -# define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b) -# define M_i2d_ASN1_OCTET_STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\ - V_ASN1_UNIVERSAL) - -# define B_ASN1_TIME \ - B_ASN1_UTCTIME | \ - B_ASN1_GENERALIZEDTIME - -# define B_ASN1_PRINTABLE \ - B_ASN1_NUMERICSTRING| \ - B_ASN1_PRINTABLESTRING| \ - B_ASN1_T61STRING| \ - B_ASN1_IA5STRING| \ - B_ASN1_BIT_STRING| \ - B_ASN1_UNIVERSALSTRING|\ - B_ASN1_BMPSTRING|\ - B_ASN1_UTF8STRING|\ - B_ASN1_SEQUENCE|\ - B_ASN1_UNKNOWN - -# define B_ASN1_DIRECTORYSTRING \ - B_ASN1_PRINTABLESTRING| \ - B_ASN1_TELETEXSTRING|\ - B_ASN1_BMPSTRING|\ - B_ASN1_UNIVERSALSTRING|\ - B_ASN1_UTF8STRING - -# define B_ASN1_DISPLAYTEXT \ - B_ASN1_IA5STRING| \ - B_ASN1_VISIBLESTRING| \ - B_ASN1_BMPSTRING|\ - B_ASN1_UTF8STRING - -# define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING) -# define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ - pp,a->type,V_ASN1_UNIVERSAL) -# define M_d2i_ASN1_PRINTABLE(a,pp,l) \ - d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ - B_ASN1_PRINTABLE) - -# define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) -# define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ - pp,a->type,V_ASN1_UNIVERSAL) -# define M_d2i_DIRECTORYSTRING(a,pp,l) \ - d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ - B_ASN1_DIRECTORYSTRING) - -# define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) -# define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ - pp,a->type,V_ASN1_UNIVERSAL) -# define M_d2i_DISPLAYTEXT(a,pp,l) \ - d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ - B_ASN1_DISPLAYTEXT) - -# define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\ - ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) -# define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_i2d_ASN1_PRINTABLESTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\ - V_ASN1_UNIVERSAL) -# define M_d2i_ASN1_PRINTABLESTRING(a,pp,l) \ - (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING) - -# define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\ - ASN1_STRING_type_new(V_ASN1_T61STRING) -# define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_i2d_ASN1_T61STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\ - V_ASN1_UNIVERSAL) -# define M_d2i_ASN1_T61STRING(a,pp,l) \ - (ASN1_T61STRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING) - -# define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\ - ASN1_STRING_type_new(V_ASN1_IA5STRING) -# define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_ASN1_IA5STRING_dup(a) \ - (ASN1_IA5STRING *)ASN1_STRING_dup((const ASN1_STRING *)a) -# define M_i2d_ASN1_IA5STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\ - V_ASN1_UNIVERSAL) -# define M_d2i_ASN1_IA5STRING(a,pp,l) \ - (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\ - B_ASN1_IA5STRING) - -# define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\ - ASN1_STRING_type_new(V_ASN1_UTCTIME) -# define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) - -# define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\ - ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME) -# define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\ - (const ASN1_STRING *)a) - -# define M_ASN1_TIME_new() (ASN1_TIME *)\ - ASN1_STRING_type_new(V_ASN1_UTCTIME) -# define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_ASN1_TIME_dup(a) (ASN1_TIME *)\ - ASN1_STRING_dup((const ASN1_STRING *)a) - -# define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\ - ASN1_STRING_type_new(V_ASN1_GENERALSTRING) -# define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_i2d_ASN1_GENERALSTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\ - V_ASN1_UNIVERSAL) -# define M_d2i_ASN1_GENERALSTRING(a,pp,l) \ - (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING) - -# define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\ - ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING) -# define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\ - V_ASN1_UNIVERSAL) -# define M_d2i_ASN1_UNIVERSALSTRING(a,pp,l) \ - (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING) - -# define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\ - ASN1_STRING_type_new(V_ASN1_BMPSTRING) -# define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_i2d_ASN1_BMPSTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\ - V_ASN1_UNIVERSAL) -# define M_d2i_ASN1_BMPSTRING(a,pp,l) \ - (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING) - -# define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\ - ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) -# define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_i2d_ASN1_VISIBLESTRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\ - V_ASN1_UNIVERSAL) -# define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \ - (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING) - -# define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\ - ASN1_STRING_type_new(V_ASN1_UTF8STRING) -# define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) -# define M_i2d_ASN1_UTF8STRING(a,pp) \ - i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\ - V_ASN1_UNIVERSAL) -# define M_d2i_ASN1_UTF8STRING(a,pp,l) \ - (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\ - ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING) - - /* for the is_set parameter to i2d_ASN1_SET */ -# define IS_SEQUENCE 0 -# define IS_SET 1 - -DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) - -int ASN1_TYPE_get(ASN1_TYPE *a); -void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); -int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); -int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); - -ASN1_OBJECT *ASN1_OBJECT_new(void); -void ASN1_OBJECT_free(ASN1_OBJECT *a); -int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp); -ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, - long length); -ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, - long length); - -DECLARE_ASN1_ITEM(ASN1_OBJECT) - -DECLARE_STACK_OF(ASN1_OBJECT) -DECLARE_ASN1_SET_OF(ASN1_OBJECT) - -ASN1_STRING *ASN1_STRING_new(void); -void ASN1_STRING_free(ASN1_STRING *a); -void ASN1_STRING_clear_free(ASN1_STRING *a); -int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str); -ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a); -ASN1_STRING *ASN1_STRING_type_new(int type); -int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b); - /* - * Since this is used to store all sorts of things, via macros, for now, - * make its data void * - */ -int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); -void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); -int ASN1_STRING_length(const ASN1_STRING *x); -void ASN1_STRING_length_set(ASN1_STRING *x, int n); -int ASN1_STRING_type(ASN1_STRING *x); -unsigned char *ASN1_STRING_data(ASN1_STRING *x); - -DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) -int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp); -ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, - const unsigned char **pp, long length); -int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length); -int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); -int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); -int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, - unsigned char *flags, int flags_len); - -# ifndef OPENSSL_NO_BIO -int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, - BIT_STRING_BITNAME *tbl, int indent); -# endif -int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl); -int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, - BIT_STRING_BITNAME *tbl); - -int i2d_ASN1_BOOLEAN(int a, unsigned char **pp); -int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length); - -DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) -int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp); -ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, - long length); -ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, - long length); -ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x); -int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); - -DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) - -int ASN1_UTCTIME_check(const ASN1_UTCTIME *a); -ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); -ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, - int offset_day, long offset_sec); -int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); -int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); -# if 0 -time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s); -# endif - -int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a); -ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, - time_t t); -ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, - time_t t, int offset_day, - long offset_sec); -int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); -int ASN1_TIME_diff(int *pday, int *psec, - const ASN1_TIME *from, const ASN1_TIME *to); - -DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) -ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a); -int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, - const ASN1_OCTET_STRING *b); -int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, - int len); - -DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) -DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) -DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) -DECLARE_ASN1_FUNCTIONS(ASN1_NULL) -DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) - -int UTF8_getc(const unsigned char *str, int len, unsigned long *val); -int UTF8_putc(unsigned char *str, int len, unsigned long value); - -DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) - -DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) -DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) -DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) -DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) -DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) -DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) -DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME) -DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME) -DECLARE_ASN1_FUNCTIONS(ASN1_TIME) - -DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) - -ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); -ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, - int offset_day, long offset_sec); -int ASN1_TIME_check(ASN1_TIME *t); -ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME - **out); -int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); - -int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, - i2d_of_void *i2d, int ex_tag, int ex_class, int is_set); -STACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a, - const unsigned char **pp, - long length, d2i_of_void *d2i, - void (*free_func) (OPENSSL_BLOCK), - int ex_tag, int ex_class); - -# ifndef OPENSSL_NO_BIO -int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); -int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size); -int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); -int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size); -int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a); -int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size); -int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); -# endif -int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a); - -int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); -ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, - const char *sn, const char *ln); - -int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); -long ASN1_INTEGER_get(const ASN1_INTEGER *a); -ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); -BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); - -int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); -long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a); -ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); -BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn); - -/* General */ -/* given a string, return the correct type, max is the maximum length */ -int ASN1_PRINTABLE_type(const unsigned char *s, int max); - -int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); -ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, - long length, int Ptag, int Pclass); -unsigned long ASN1_tag2bit(int tag); -/* type is one or more of the B_ASN1_ values. */ -ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp, - long length, int type); - -/* PARSING */ -int asn1_Finish(ASN1_CTX *c); -int asn1_const_Finish(ASN1_const_CTX *c); - -/* SPECIALS */ -int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, - int *pclass, long omax); -int ASN1_check_infinite_end(unsigned char **p, long len); -int ASN1_const_check_infinite_end(const unsigned char **p, long len); -void ASN1_put_object(unsigned char **pp, int constructed, int length, - int tag, int xclass); -int ASN1_put_eoc(unsigned char **pp); -int ASN1_object_size(int constructed, int length, int tag); - -/* Used to implement other functions */ -void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x); - -# define ASN1_dup_of(type,i2d,d2i,x) \ - ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ - CHECKED_D2I_OF(type, d2i), \ - CHECKED_PTR_OF(type, x))) - -# define ASN1_dup_of_const(type,i2d,d2i,x) \ - ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \ - CHECKED_D2I_OF(type, d2i), \ - CHECKED_PTR_OF(const type, x))) - -void *ASN1_item_dup(const ASN1_ITEM *it, void *x); - -/* ASN1 alloc/free macros for when a type is only used internally */ - -# define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) -# define M_ASN1_free_of(x, type) \ - ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) - -# ifndef OPENSSL_NO_FP_API -void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x); - -# define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ - ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ - CHECKED_D2I_OF(type, d2i), \ - in, \ - CHECKED_PPTR_OF(type, x))) - -void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); -int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x); - -# define ASN1_i2d_fp_of(type,i2d,out,x) \ - (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ - out, \ - CHECKED_PTR_OF(type, x))) - -# define ASN1_i2d_fp_of_const(type,i2d,out,x) \ - (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \ - out, \ - CHECKED_PTR_OF(const type, x))) - -int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); -int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); -# endif - -int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); - -# ifndef OPENSSL_NO_BIO -void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x); - -# define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ - ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ - CHECKED_D2I_OF(type, d2i), \ - in, \ - CHECKED_PPTR_OF(type, x))) - -void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); -int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x); - -# define ASN1_i2d_bio_of(type,i2d,out,x) \ - (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ - out, \ - CHECKED_PTR_OF(type, x))) - -# define ASN1_i2d_bio_of_const(type,i2d,out,x) \ - (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ - out, \ - CHECKED_PTR_OF(const type, x))) - -int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x); -int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a); -int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); -int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a); -int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); -int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); -int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, - unsigned char *buf, int off); -int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent); -int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, - int dump); -# endif -const char *ASN1_tag2str(int tag); - -/* Used to load and write netscape format cert */ - -DECLARE_ASN1_FUNCTIONS(NETSCAPE_X509) - -int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); - -int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len); -int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len); -int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, - unsigned char *data, int len); -int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, - unsigned char *data, int max_len); - -STACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len, - d2i_of_void *d2i, - void (*free_func) (OPENSSL_BLOCK)); -unsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d, - unsigned char **buf, int *len); -void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i); -void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); -ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, - ASN1_OCTET_STRING **oct); - -# define ASN1_pack_string_of(type,obj,i2d,oct) \ - (ASN1_pack_string(CHECKED_PTR_OF(type, obj), \ - CHECKED_I2D_OF(type, i2d), \ - oct)) - -ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, - ASN1_OCTET_STRING **oct); - -void ASN1_STRING_set_default_mask(unsigned long mask); -int ASN1_STRING_set_default_mask_asc(const char *p); -unsigned long ASN1_STRING_get_default_mask(void); -int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, - int inform, unsigned long mask); -int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, - int inform, unsigned long mask, - long minsize, long maxsize); - -ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, - const unsigned char *in, int inlen, - int inform, int nid); -ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); -int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); -void ASN1_STRING_TABLE_cleanup(void); - -/* ASN1 template functions */ - -/* Old API compatible functions */ -ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); -void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); -ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, - long len, const ASN1_ITEM *it); -int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); -int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, - const ASN1_ITEM *it); - -void ASN1_add_oid_module(void); - -ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); -ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); - -/* ASN1 Print flags */ - -/* Indicate missing OPTIONAL fields */ -# define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001 -/* Mark start and end of SEQUENCE */ -# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002 -/* Mark start and end of SEQUENCE/SET OF */ -# define ASN1_PCTX_FLAGS_SHOW_SSOF 0x004 -/* Show the ASN1 type of primitives */ -# define ASN1_PCTX_FLAGS_SHOW_TYPE 0x008 -/* Don't show ASN1 type of ANY */ -# define ASN1_PCTX_FLAGS_NO_ANY_TYPE 0x010 -/* Don't show ASN1 type of MSTRINGs */ -# define ASN1_PCTX_FLAGS_NO_MSTRING_TYPE 0x020 -/* Don't show field names in SEQUENCE */ -# define ASN1_PCTX_FLAGS_NO_FIELD_NAME 0x040 -/* Show structure names of each SEQUENCE field */ -# define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME 0x080 -/* Don't show structure name even at top level */ -# define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100 - -int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent, - const ASN1_ITEM *it, const ASN1_PCTX *pctx); -ASN1_PCTX *ASN1_PCTX_new(void); -void ASN1_PCTX_free(ASN1_PCTX *p); -unsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p); -void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_nm_flags(ASN1_PCTX *p); -void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_cert_flags(ASN1_PCTX *p); -void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_oid_flags(ASN1_PCTX *p); -void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_str_flags(ASN1_PCTX *p); -void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags); - -BIO_METHOD *BIO_f_asn1(void); - -BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it); - -int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, - const ASN1_ITEM *it); -int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, - const char *hdr, const ASN1_ITEM *it); -int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, - int ctype_nid, int econt_nid, - STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it); -ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); -int SMIME_crlf_copy(BIO *in, BIO *out, int flags); -int SMIME_text(BIO *in, BIO *out); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_ASN1_strings(void); - -/* Error codes for the ASN1 functions. */ - -/* Function codes. */ -# define ASN1_F_A2D_ASN1_OBJECT 100 -# define ASN1_F_A2I_ASN1_ENUMERATED 101 -# define ASN1_F_A2I_ASN1_INTEGER 102 -# define ASN1_F_A2I_ASN1_STRING 103 -# define ASN1_F_APPEND_EXP 176 -# define ASN1_F_ASN1_BIT_STRING_SET_BIT 183 -# define ASN1_F_ASN1_CB 177 -# define ASN1_F_ASN1_CHECK_TLEN 104 -# define ASN1_F_ASN1_COLLATE_PRIMITIVE 105 -# define ASN1_F_ASN1_COLLECT 106 -# define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108 -# define ASN1_F_ASN1_D2I_FP 109 -# define ASN1_F_ASN1_D2I_READ_BIO 107 -# define ASN1_F_ASN1_DIGEST 184 -# define ASN1_F_ASN1_DO_ADB 110 -# define ASN1_F_ASN1_DUP 111 -# define ASN1_F_ASN1_ENUMERATED_SET 112 -# define ASN1_F_ASN1_ENUMERATED_TO_BN 113 -# define ASN1_F_ASN1_EX_C2I 204 -# define ASN1_F_ASN1_FIND_END 190 -# define ASN1_F_ASN1_GENERALIZEDTIME_ADJ 216 -# define ASN1_F_ASN1_GENERALIZEDTIME_SET 185 -# define ASN1_F_ASN1_GENERATE_V3 178 -# define ASN1_F_ASN1_GET_OBJECT 114 -# define ASN1_F_ASN1_HEADER_NEW 115 -# define ASN1_F_ASN1_I2D_BIO 116 -# define ASN1_F_ASN1_I2D_FP 117 -# define ASN1_F_ASN1_INTEGER_SET 118 -# define ASN1_F_ASN1_INTEGER_TO_BN 119 -# define ASN1_F_ASN1_ITEM_D2I_FP 206 -# define ASN1_F_ASN1_ITEM_DUP 191 -# define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121 -# define ASN1_F_ASN1_ITEM_EX_D2I 120 -# define ASN1_F_ASN1_ITEM_I2D_BIO 192 -# define ASN1_F_ASN1_ITEM_I2D_FP 193 -# define ASN1_F_ASN1_ITEM_PACK 198 -# define ASN1_F_ASN1_ITEM_SIGN 195 -# define ASN1_F_ASN1_ITEM_SIGN_CTX 220 -# define ASN1_F_ASN1_ITEM_UNPACK 199 -# define ASN1_F_ASN1_ITEM_VERIFY 197 -# define ASN1_F_ASN1_MBSTRING_NCOPY 122 -# define ASN1_F_ASN1_OBJECT_NEW 123 -# define ASN1_F_ASN1_OUTPUT_DATA 214 -# define ASN1_F_ASN1_PACK_STRING 124 -# define ASN1_F_ASN1_PCTX_NEW 205 -# define ASN1_F_ASN1_PKCS5_PBE_SET 125 -# define ASN1_F_ASN1_SEQ_PACK 126 -# define ASN1_F_ASN1_SEQ_UNPACK 127 -# define ASN1_F_ASN1_SIGN 128 -# define ASN1_F_ASN1_STR2TYPE 179 -# define ASN1_F_ASN1_STRING_SET 186 -# define ASN1_F_ASN1_STRING_TABLE_ADD 129 -# define ASN1_F_ASN1_STRING_TYPE_NEW 130 -# define ASN1_F_ASN1_TEMPLATE_EX_D2I 132 -# define ASN1_F_ASN1_TEMPLATE_NEW 133 -# define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131 -# define ASN1_F_ASN1_TIME_ADJ 217 -# define ASN1_F_ASN1_TIME_SET 175 -# define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134 -# define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135 -# define ASN1_F_ASN1_UNPACK_STRING 136 -# define ASN1_F_ASN1_UTCTIME_ADJ 218 -# define ASN1_F_ASN1_UTCTIME_SET 187 -# define ASN1_F_ASN1_VERIFY 137 -# define ASN1_F_B64_READ_ASN1 209 -# define ASN1_F_B64_WRITE_ASN1 210 -# define ASN1_F_BIO_NEW_NDEF 208 -# define ASN1_F_BITSTR_CB 180 -# define ASN1_F_BN_TO_ASN1_ENUMERATED 138 -# define ASN1_F_BN_TO_ASN1_INTEGER 139 -# define ASN1_F_C2I_ASN1_BIT_STRING 189 -# define ASN1_F_C2I_ASN1_INTEGER 194 -# define ASN1_F_C2I_ASN1_OBJECT 196 -# define ASN1_F_COLLECT_DATA 140 -# define ASN1_F_D2I_ASN1_BIT_STRING 141 -# define ASN1_F_D2I_ASN1_BOOLEAN 142 -# define ASN1_F_D2I_ASN1_BYTES 143 -# define ASN1_F_D2I_ASN1_GENERALIZEDTIME 144 -# define ASN1_F_D2I_ASN1_HEADER 145 -# define ASN1_F_D2I_ASN1_INTEGER 146 -# define ASN1_F_D2I_ASN1_OBJECT 147 -# define ASN1_F_D2I_ASN1_SET 148 -# define ASN1_F_D2I_ASN1_TYPE_BYTES 149 -# define ASN1_F_D2I_ASN1_UINTEGER 150 -# define ASN1_F_D2I_ASN1_UTCTIME 151 -# define ASN1_F_D2I_AUTOPRIVATEKEY 207 -# define ASN1_F_D2I_NETSCAPE_RSA 152 -# define ASN1_F_D2I_NETSCAPE_RSA_2 153 -# define ASN1_F_D2I_PRIVATEKEY 154 -# define ASN1_F_D2I_PUBLICKEY 155 -# define ASN1_F_D2I_RSA_NET 200 -# define ASN1_F_D2I_RSA_NET_2 201 -# define ASN1_F_D2I_X509 156 -# define ASN1_F_D2I_X509_CINF 157 -# define ASN1_F_D2I_X509_PKEY 159 -# define ASN1_F_I2D_ASN1_BIO_STREAM 211 -# define ASN1_F_I2D_ASN1_SET 188 -# define ASN1_F_I2D_ASN1_TIME 160 -# define ASN1_F_I2D_DSA_PUBKEY 161 -# define ASN1_F_I2D_EC_PUBKEY 181 -# define ASN1_F_I2D_PRIVATEKEY 163 -# define ASN1_F_I2D_PUBLICKEY 164 -# define ASN1_F_I2D_RSA_NET 162 -# define ASN1_F_I2D_RSA_PUBKEY 165 -# define ASN1_F_LONG_C2I 166 -# define ASN1_F_OID_MODULE_INIT 174 -# define ASN1_F_PARSE_TAGGING 182 -# define ASN1_F_PKCS5_PBE2_SET_IV 167 -# define ASN1_F_PKCS5_PBE_SET 202 -# define ASN1_F_PKCS5_PBE_SET0_ALGOR 215 -# define ASN1_F_PKCS5_PBKDF2_SET 219 -# define ASN1_F_SMIME_READ_ASN1 212 -# define ASN1_F_SMIME_TEXT 213 -# define ASN1_F_X509_CINF_NEW 168 -# define ASN1_F_X509_CRL_ADD0_REVOKED 169 -# define ASN1_F_X509_INFO_NEW 170 -# define ASN1_F_X509_NAME_ENCODE 203 -# define ASN1_F_X509_NAME_EX_D2I 158 -# define ASN1_F_X509_NAME_EX_NEW 171 -# define ASN1_F_X509_NEW 172 -# define ASN1_F_X509_PKEY_NEW 173 - -/* Reason codes. */ -# define ASN1_R_ADDING_OBJECT 171 -# define ASN1_R_ASN1_PARSE_ERROR 203 -# define ASN1_R_ASN1_SIG_PARSE_ERROR 204 -# define ASN1_R_AUX_ERROR 100 -# define ASN1_R_BAD_CLASS 101 -# define ASN1_R_BAD_OBJECT_HEADER 102 -# define ASN1_R_BAD_PASSWORD_READ 103 -# define ASN1_R_BAD_TAG 104 -# define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 214 -# define ASN1_R_BN_LIB 105 -# define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106 -# define ASN1_R_BUFFER_TOO_SMALL 107 -# define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108 -# define ASN1_R_CONTEXT_NOT_INITIALISED 217 -# define ASN1_R_DATA_IS_WRONG 109 -# define ASN1_R_DECODE_ERROR 110 -# define ASN1_R_DECODING_ERROR 111 -# define ASN1_R_DEPTH_EXCEEDED 174 -# define ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED 198 -# define ASN1_R_ENCODE_ERROR 112 -# define ASN1_R_ERROR_GETTING_TIME 173 -# define ASN1_R_ERROR_LOADING_SECTION 172 -# define ASN1_R_ERROR_PARSING_SET_ELEMENT 113 -# define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114 -# define ASN1_R_EXPECTING_AN_INTEGER 115 -# define ASN1_R_EXPECTING_AN_OBJECT 116 -# define ASN1_R_EXPECTING_A_BOOLEAN 117 -# define ASN1_R_EXPECTING_A_TIME 118 -# define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119 -# define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120 -# define ASN1_R_FIELD_MISSING 121 -# define ASN1_R_FIRST_NUM_TOO_LARGE 122 -# define ASN1_R_HEADER_TOO_LONG 123 -# define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175 -# define ASN1_R_ILLEGAL_BOOLEAN 176 -# define ASN1_R_ILLEGAL_CHARACTERS 124 -# define ASN1_R_ILLEGAL_FORMAT 177 -# define ASN1_R_ILLEGAL_HEX 178 -# define ASN1_R_ILLEGAL_IMPLICIT_TAG 179 -# define ASN1_R_ILLEGAL_INTEGER 180 -# define ASN1_R_ILLEGAL_NESTED_TAGGING 181 -# define ASN1_R_ILLEGAL_NULL 125 -# define ASN1_R_ILLEGAL_NULL_VALUE 182 -# define ASN1_R_ILLEGAL_OBJECT 183 -# define ASN1_R_ILLEGAL_OPTIONAL_ANY 126 -# define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170 -# define ASN1_R_ILLEGAL_TAGGED_ANY 127 -# define ASN1_R_ILLEGAL_TIME_VALUE 184 -# define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185 -# define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128 -# define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 220 -# define ASN1_R_INVALID_BMPSTRING_LENGTH 129 -# define ASN1_R_INVALID_DIGIT 130 -# define ASN1_R_INVALID_MIME_TYPE 205 -# define ASN1_R_INVALID_MODIFIER 186 -# define ASN1_R_INVALID_NUMBER 187 -# define ASN1_R_INVALID_OBJECT_ENCODING 216 -# define ASN1_R_INVALID_SEPARATOR 131 -# define ASN1_R_INVALID_TIME_FORMAT 132 -# define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133 -# define ASN1_R_INVALID_UTF8STRING 134 -# define ASN1_R_IV_TOO_LARGE 135 -# define ASN1_R_LENGTH_ERROR 136 -# define ASN1_R_LIST_ERROR 188 -# define ASN1_R_MIME_NO_CONTENT_TYPE 206 -# define ASN1_R_MIME_PARSE_ERROR 207 -# define ASN1_R_MIME_SIG_PARSE_ERROR 208 -# define ASN1_R_MISSING_EOC 137 -# define ASN1_R_MISSING_SECOND_NUMBER 138 -# define ASN1_R_MISSING_VALUE 189 -# define ASN1_R_MSTRING_NOT_UNIVERSAL 139 -# define ASN1_R_MSTRING_WRONG_TAG 140 -# define ASN1_R_NESTED_ASN1_STRING 197 -# define ASN1_R_NON_HEX_CHARACTERS 141 -# define ASN1_R_NOT_ASCII_FORMAT 190 -# define ASN1_R_NOT_ENOUGH_DATA 142 -# define ASN1_R_NO_CONTENT_TYPE 209 -# define ASN1_R_NO_DEFAULT_DIGEST 201 -# define ASN1_R_NO_MATCHING_CHOICE_TYPE 143 -# define ASN1_R_NO_MULTIPART_BODY_FAILURE 210 -# define ASN1_R_NO_MULTIPART_BOUNDARY 211 -# define ASN1_R_NO_SIG_CONTENT_TYPE 212 -# define ASN1_R_NULL_IS_WRONG_LENGTH 144 -# define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191 -# define ASN1_R_ODD_NUMBER_OF_CHARS 145 -# define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146 -# define ASN1_R_SECOND_NUMBER_TOO_LARGE 147 -# define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148 -# define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149 -# define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192 -# define ASN1_R_SHORT_LINE 150 -# define ASN1_R_SIG_INVALID_MIME_TYPE 213 -# define ASN1_R_STREAMING_NOT_SUPPORTED 202 -# define ASN1_R_STRING_TOO_LONG 151 -# define ASN1_R_STRING_TOO_SHORT 152 -# define ASN1_R_TAG_VALUE_TOO_HIGH 153 -# define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154 -# define ASN1_R_TIME_NOT_ASCII_FORMAT 193 -# define ASN1_R_TOO_LONG 155 -# define ASN1_R_TYPE_NOT_CONSTRUCTED 156 -# define ASN1_R_TYPE_NOT_PRIMITIVE 218 -# define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157 -# define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158 -# define ASN1_R_UNEXPECTED_EOC 159 -# define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 215 -# define ASN1_R_UNKNOWN_FORMAT 160 -# define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161 -# define ASN1_R_UNKNOWN_OBJECT_TYPE 162 -# define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163 -# define ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM 199 -# define ASN1_R_UNKNOWN_TAG 194 -# define ASN1_R_UNKOWN_FORMAT 195 -# define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164 -# define ASN1_R_UNSUPPORTED_CIPHER 165 -# define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166 -# define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167 -# define ASN1_R_UNSUPPORTED_TYPE 196 -# define ASN1_R_WRONG_PUBLIC_KEY_TYPE 200 -# define ASN1_R_WRONG_TAG 168 -# define ASN1_R_WRONG_TYPE 169 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/asn1_mac.h b/libs/win32/openssl/include/openssl/asn1_mac.h deleted file mode 100644 index abc6dc35ca..0000000000 --- a/libs/win32/openssl/include/openssl/asn1_mac.h +++ /dev/null @@ -1,579 +0,0 @@ -/* crypto/asn1/asn1_mac.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_ASN1_MAC_H -# define HEADER_ASN1_MAC_H - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# ifndef ASN1_MAC_ERR_LIB -# define ASN1_MAC_ERR_LIB ERR_LIB_ASN1 -# endif - -# define ASN1_MAC_H_err(f,r,line) \ - ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line)) - -# define M_ASN1_D2I_vars(a,type,func) \ - ASN1_const_CTX c; \ - type ret=NULL; \ - \ - c.pp=(const unsigned char **)pp; \ - c.q= *(const unsigned char **)pp; \ - c.error=ERR_R_NESTED_ASN1_ERROR; \ - if ((a == NULL) || ((*a) == NULL)) \ - { if ((ret=(type)func()) == NULL) \ - { c.line=__LINE__; goto err; } } \ - else ret=(*a); - -# define M_ASN1_D2I_Init() \ - c.p= *(const unsigned char **)pp; \ - c.max=(length == 0)?0:(c.p+length); - -# define M_ASN1_D2I_Finish_2(a) \ - if (!asn1_const_Finish(&c)) \ - { c.line=__LINE__; goto err; } \ - *(const unsigned char **)pp=c.p; \ - if (a != NULL) (*a)=ret; \ - return(ret); - -# define M_ASN1_D2I_Finish(a,func,e) \ - M_ASN1_D2I_Finish_2(a); \ -err:\ - ASN1_MAC_H_err((e),c.error,c.line); \ - asn1_add_error(*(const unsigned char **)pp,(int)(c.q- *pp)); \ - if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \ - return(NULL) - -# define M_ASN1_D2I_start_sequence() \ - if (!asn1_GetSequence(&c,&length)) \ - { c.line=__LINE__; goto err; } -/* Begin reading ASN1 without a surrounding sequence */ -# define M_ASN1_D2I_begin() \ - c.slen = length; - -/* End reading ASN1 with no check on length */ -# define M_ASN1_D2I_Finish_nolen(a, func, e) \ - *pp=c.p; \ - if (a != NULL) (*a)=ret; \ - return(ret); \ -err:\ - ASN1_MAC_H_err((e),c.error,c.line); \ - asn1_add_error(*pp,(int)(c.q- *pp)); \ - if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \ - return(NULL) - -# define M_ASN1_D2I_end_sequence() \ - (((c.inf&1) == 0)?(c.slen <= 0): \ - (c.eos=ASN1_const_check_infinite_end(&c.p,c.slen))) - -/* Don't use this with d2i_ASN1_BOOLEAN() */ -# define M_ASN1_D2I_get(b, func) \ - c.q=c.p; \ - if (func(&(b),&c.p,c.slen) == NULL) \ - {c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -/* Don't use this with d2i_ASN1_BOOLEAN() */ -# define M_ASN1_D2I_get_x(type,b,func) \ - c.q=c.p; \ - if (((D2I_OF(type))func)(&(b),&c.p,c.slen) == NULL) \ - {c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -/* use this instead () */ -# define M_ASN1_D2I_get_int(b,func) \ - c.q=c.p; \ - if (func(&(b),&c.p,c.slen) < 0) \ - {c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -# define M_ASN1_D2I_get_opt(b,func,type) \ - if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \ - == (V_ASN1_UNIVERSAL|(type)))) \ - { \ - M_ASN1_D2I_get(b,func); \ - } - -# define M_ASN1_D2I_get_int_opt(b,func,type) \ - if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \ - == (V_ASN1_UNIVERSAL|(type)))) \ - { \ - M_ASN1_D2I_get_int(b,func); \ - } - -# define M_ASN1_D2I_get_imp(b,func, type) \ - M_ASN1_next=(_tmp& V_ASN1_CONSTRUCTED)|type; \ - c.q=c.p; \ - if (func(&(b),&c.p,c.slen) == NULL) \ - {c.line=__LINE__; M_ASN1_next_prev = _tmp; goto err; } \ - c.slen-=(c.p-c.q);\ - M_ASN1_next_prev=_tmp; - -# define M_ASN1_D2I_get_IMP_opt(b,func,tag,type) \ - if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) == \ - (V_ASN1_CONTEXT_SPECIFIC|(tag)))) \ - { \ - unsigned char _tmp = M_ASN1_next; \ - M_ASN1_D2I_get_imp(b,func, type);\ - } - -# define M_ASN1_D2I_get_set(r,func,free_func) \ - M_ASN1_D2I_get_imp_set(r,func,free_func, \ - V_ASN1_SET,V_ASN1_UNIVERSAL); - -# define M_ASN1_D2I_get_set_type(type,r,func,free_func) \ - M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \ - V_ASN1_SET,V_ASN1_UNIVERSAL); - -# define M_ASN1_D2I_get_set_opt(r,func,free_func) \ - if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ - V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ - { M_ASN1_D2I_get_set(r,func,free_func); } - -# define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \ - if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ - V_ASN1_CONSTRUCTED|V_ASN1_SET)))\ - { M_ASN1_D2I_get_set_type(type,r,func,free_func); } - -# define M_ASN1_I2D_len_SET_opt(a,f) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - M_ASN1_I2D_len_SET(a,f); - -# define M_ASN1_I2D_put_SET_opt(a,f) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - M_ASN1_I2D_put_SET(a,f); - -# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - M_ASN1_I2D_put_SEQUENCE(a,f); - -# define M_ASN1_I2D_put_SEQUENCE_opt_type(type,a,f) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - M_ASN1_I2D_put_SEQUENCE_type(type,a,f); - -# define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \ - if ((c.slen != 0) && \ - (M_ASN1_next == \ - (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\ - { \ - M_ASN1_D2I_get_imp_set(b,func,free_func,\ - tag,V_ASN1_CONTEXT_SPECIFIC); \ - } - -# define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \ - if ((c.slen != 0) && \ - (M_ASN1_next == \ - (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\ - { \ - M_ASN1_D2I_get_imp_set_type(type,b,func,free_func,\ - tag,V_ASN1_CONTEXT_SPECIFIC); \ - } - -# define M_ASN1_D2I_get_seq(r,func,free_func) \ - M_ASN1_D2I_get_imp_set(r,func,free_func,\ - V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); - -# define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \ - M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ - V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL) - -# define M_ASN1_D2I_get_seq_opt(r,func,free_func) \ - if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ - V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ - { M_ASN1_D2I_get_seq(r,func,free_func); } - -# define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \ - if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \ - V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\ - { M_ASN1_D2I_get_seq_type(type,r,func,free_func); } - -# define M_ASN1_D2I_get_IMP_set(r,func,free_func,x) \ - M_ASN1_D2I_get_imp_set(r,func,free_func,\ - x,V_ASN1_CONTEXT_SPECIFIC); - -# define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \ - M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\ - x,V_ASN1_CONTEXT_SPECIFIC); - -# define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \ - c.q=c.p; \ - if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\ - (void (*)())free_func,a,b) == NULL) \ - { c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -# define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \ - c.q=c.p; \ - if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\ - free_func,a,b) == NULL) \ - { c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -# define M_ASN1_D2I_get_set_strings(r,func,a,b) \ - c.q=c.p; \ - if (d2i_ASN1_STRING_SET(&(r),&c.p,c.slen,a,b) == NULL) \ - { c.line=__LINE__; goto err; } \ - c.slen-=(c.p-c.q); - -# define M_ASN1_D2I_get_EXP_opt(r,func,tag) \ - if ((c.slen != 0L) && (M_ASN1_next == \ - (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ - { \ - int Tinf,Ttag,Tclass; \ - long Tlen; \ - \ - c.q=c.p; \ - Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \ - if (Tinf & 0x80) \ - { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \ - c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) \ - Tlen = c.slen - (c.p - c.q) - 2; \ - if (func(&(r),&c.p,Tlen) == NULL) \ - { c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ - Tlen = c.slen - (c.p - c.q); \ - if(!ASN1_const_check_infinite_end(&c.p, Tlen)) \ - { c.error=ERR_R_MISSING_ASN1_EOS; \ - c.line=__LINE__; goto err; } \ - }\ - c.slen-=(c.p-c.q); \ - } - -# define M_ASN1_D2I_get_EXP_set_opt(r,func,free_func,tag,b) \ - if ((c.slen != 0) && (M_ASN1_next == \ - (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ - { \ - int Tinf,Ttag,Tclass; \ - long Tlen; \ - \ - c.q=c.p; \ - Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \ - if (Tinf & 0x80) \ - { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \ - c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) \ - Tlen = c.slen - (c.p - c.q) - 2; \ - if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \ - (void (*)())free_func, \ - b,V_ASN1_UNIVERSAL) == NULL) \ - { c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ - Tlen = c.slen - (c.p - c.q); \ - if(!ASN1_check_infinite_end(&c.p, Tlen)) \ - { c.error=ERR_R_MISSING_ASN1_EOS; \ - c.line=__LINE__; goto err; } \ - }\ - c.slen-=(c.p-c.q); \ - } - -# define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \ - if ((c.slen != 0) && (M_ASN1_next == \ - (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \ - { \ - int Tinf,Ttag,Tclass; \ - long Tlen; \ - \ - c.q=c.p; \ - Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \ - if (Tinf & 0x80) \ - { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \ - c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) \ - Tlen = c.slen - (c.p - c.q) - 2; \ - if (d2i_ASN1_SET_OF_##type(&(r),&c.p,Tlen,func, \ - free_func,b,V_ASN1_UNIVERSAL) == NULL) \ - { c.line=__LINE__; goto err; } \ - if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \ - Tlen = c.slen - (c.p - c.q); \ - if(!ASN1_check_infinite_end(&c.p, Tlen)) \ - { c.error=ERR_R_MISSING_ASN1_EOS; \ - c.line=__LINE__; goto err; } \ - }\ - c.slen-=(c.p-c.q); \ - } - -/* New macros */ -# define M_ASN1_New_Malloc(ret,type) \ - if ((ret=(type *)OPENSSL_malloc(sizeof(type))) == NULL) \ - { c.line=__LINE__; goto err2; } - -# define M_ASN1_New(arg,func) \ - if (((arg)=func()) == NULL) return(NULL) - -# define M_ASN1_New_Error(a) \ -/*- err: ASN1_MAC_H_err((a),ERR_R_NESTED_ASN1_ERROR,c.line); \ - return(NULL);*/ \ - err2: ASN1_MAC_H_err((a),ERR_R_MALLOC_FAILURE,c.line); \ - return(NULL) - -/* - * BIG UGLY WARNING! This is so damn ugly I wanna puke. Unfortunately, some - * macros that use ASN1_const_CTX still insist on writing in the input - * stream. ARGH! ARGH! ARGH! Let's get rid of this macro package. Please? -- - * Richard Levitte - */ -# define M_ASN1_next (*((unsigned char *)(c.p))) -# define M_ASN1_next_prev (*((unsigned char *)(c.q))) - -/*************************************************/ - -# define M_ASN1_I2D_vars(a) int r=0,ret=0; \ - unsigned char *p; \ - if (a == NULL) return(0) - -/* Length Macros */ -# define M_ASN1_I2D_len(a,f) ret+=f(a,NULL) -# define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f) - -# define M_ASN1_I2D_len_SET(a,f) \ - ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); - -# define M_ASN1_I2D_len_SET_type(type,a,f) \ - ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \ - V_ASN1_UNIVERSAL,IS_SET); - -# define M_ASN1_I2D_len_SEQUENCE(a,f) \ - ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ - IS_SEQUENCE); - -# define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \ - ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \ - V_ASN1_UNIVERSAL,IS_SEQUENCE) - -# define M_ASN1_I2D_len_SEQUENCE_opt(a,f) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - M_ASN1_I2D_len_SEQUENCE(a,f); - -# define M_ASN1_I2D_len_SEQUENCE_opt_type(type,a,f) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - M_ASN1_I2D_len_SEQUENCE_type(type,a,f); - -# define M_ASN1_I2D_len_IMP_SET(a,f,x) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET); - -# define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \ - ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ - V_ASN1_CONTEXT_SPECIFIC,IS_SET); - -# define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SET); - -# define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ - V_ASN1_CONTEXT_SPECIFIC,IS_SET); - -# define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); - -# define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); - -# define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ - V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); - -# define M_ASN1_I2D_len_EXP_opt(a,f,mtag,v) \ - if (a != NULL)\ - { \ - v=f(a,NULL); \ - ret+=ASN1_object_size(1,v,mtag); \ - } - -# define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_num(a) != 0))\ - { \ - v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ - ret+=ASN1_object_size(1,v,mtag); \ - } - -# define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_num(a) != 0))\ - { \ - v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \ - IS_SEQUENCE); \ - ret+=ASN1_object_size(1,v,mtag); \ - } - -# define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_##type##_num(a) != 0))\ - { \ - v=i2d_ASN1_SET_OF_##type(a,NULL,f,tag, \ - V_ASN1_UNIVERSAL, \ - IS_SEQUENCE); \ - ret+=ASN1_object_size(1,v,mtag); \ - } - -/* Put Macros */ -# define M_ASN1_I2D_put(a,f) f(a,&p) - -# define M_ASN1_I2D_put_IMP_opt(a,f,t) \ - if (a != NULL) \ - { \ - unsigned char *q=p; \ - f(a,&p); \ - *q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\ - } - -# define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\ - V_ASN1_UNIVERSAL,IS_SET) -# define M_ASN1_I2D_put_SET_type(type,a,f) \ - i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET) -# define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ - V_ASN1_CONTEXT_SPECIFIC,IS_SET) -# define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \ - i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET) -# define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ - V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE) - -# define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\ - V_ASN1_UNIVERSAL,IS_SEQUENCE) - -# define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \ - i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ - IS_SEQUENCE) - -# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - M_ASN1_I2D_put_SEQUENCE(a,f); - -# define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SET); } - -# define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ - V_ASN1_CONTEXT_SPECIFIC, \ - IS_SET); } - -# define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); } - -# define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - { i2d_ASN1_SET_OF_##type(a,&p,f,x, \ - V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); } - -# define M_ASN1_I2D_put_EXP_opt(a,f,tag,v) \ - if (a != NULL) \ - { \ - ASN1_put_object(&p,1,v,tag,V_ASN1_CONTEXT_SPECIFIC); \ - f(a,&p); \ - } - -# define M_ASN1_I2D_put_EXP_SET_opt(a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - { \ - ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ - i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ - } - -# define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_num(a) != 0)) \ - { \ - ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ - i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \ - } - -# define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ - if ((a != NULL) && (sk_##type##_num(a) != 0)) \ - { \ - ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ - i2d_ASN1_SET_OF_##type(a,&p,f,tag,V_ASN1_UNIVERSAL, \ - IS_SEQUENCE); \ - } - -# define M_ASN1_I2D_seq_total() \ - r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \ - if (pp == NULL) return(r); \ - p= *pp; \ - ASN1_put_object(&p,1,ret,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL) - -# define M_ASN1_I2D_INF_seq_start(tag,ctx) \ - *(p++)=(V_ASN1_CONSTRUCTED|(tag)|(ctx)); \ - *(p++)=0x80 - -# define M_ASN1_I2D_INF_seq_end() *(p++)=0x00; *(p++)=0x00 - -# define M_ASN1_I2D_finish() *pp=p; \ - return(r); - -int asn1_GetSequence(ASN1_const_CTX *c, long *length); -void asn1_add_error(const unsigned char *address, int offset); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/asn1t.h b/libs/win32/openssl/include/openssl/asn1t.h deleted file mode 100644 index 99bc0eecf3..0000000000 --- a/libs/win32/openssl/include/openssl/asn1t.h +++ /dev/null @@ -1,973 +0,0 @@ -/* asn1t.h */ -/* - * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project - * 2000. - */ -/* ==================================================================== - * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -#ifndef HEADER_ASN1T_H -# define HEADER_ASN1T_H - -# include -# include -# include - -# ifdef OPENSSL_BUILD_SHLIBCRYPTO -# undef OPENSSL_EXTERN -# define OPENSSL_EXTERN OPENSSL_EXPORT -# endif - -/* ASN1 template defines, structures and functions */ - -#ifdef __cplusplus -extern "C" { -#endif - -# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION - -/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */ -# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr)) - -/* Macros for start and end of ASN1_ITEM definition */ - -# define ASN1_ITEM_start(itname) \ - OPENSSL_GLOBAL const ASN1_ITEM itname##_it = { - -# define ASN1_ITEM_end(itname) \ - }; - -# else - -/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */ -# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr())) - -/* Macros for start and end of ASN1_ITEM definition */ - -# define ASN1_ITEM_start(itname) \ - const ASN1_ITEM * itname##_it(void) \ - { \ - static const ASN1_ITEM local_it = { - -# define ASN1_ITEM_end(itname) \ - }; \ - return &local_it; \ - } - -# endif - -/* Macros to aid ASN1 template writing */ - -# define ASN1_ITEM_TEMPLATE(tname) \ - static const ASN1_TEMPLATE tname##_item_tt - -# define ASN1_ITEM_TEMPLATE_END(tname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_PRIMITIVE,\ - -1,\ - &tname##_item_tt,\ - 0,\ - NULL,\ - 0,\ - #tname \ - ASN1_ITEM_end(tname) - -/* This is a ASN1 type which just embeds a template */ - -/*- - * This pair helps declare a SEQUENCE. We can do: - * - * ASN1_SEQUENCE(stname) = { - * ... SEQUENCE components ... - * } ASN1_SEQUENCE_END(stname) - * - * This will produce an ASN1_ITEM called stname_it - * for a structure called stname. - * - * If you want the same structure but a different - * name then use: - * - * ASN1_SEQUENCE(itname) = { - * ... SEQUENCE components ... - * } ASN1_SEQUENCE_END_name(stname, itname) - * - * This will create an item called itname_it using - * a structure called stname. - */ - -# define ASN1_SEQUENCE(tname) \ - static const ASN1_TEMPLATE tname##_seq_tt[] - -# define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname) - -# define ASN1_SEQUENCE_END_name(stname, tname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_SEQUENCE,\ - V_ASN1_SEQUENCE,\ - tname##_seq_tt,\ - sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ - NULL,\ - sizeof(stname),\ - #stname \ - ASN1_ITEM_end(tname) - -# define ASN1_NDEF_SEQUENCE(tname) \ - ASN1_SEQUENCE(tname) - -# define ASN1_NDEF_SEQUENCE_cb(tname, cb) \ - ASN1_SEQUENCE_cb(tname, cb) - -# define ASN1_SEQUENCE_cb(tname, cb) \ - static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ - ASN1_SEQUENCE(tname) - -# define ASN1_BROKEN_SEQUENCE(tname) \ - static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \ - ASN1_SEQUENCE(tname) - -# define ASN1_SEQUENCE_ref(tname, cb, lck) \ - static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \ - ASN1_SEQUENCE(tname) - -# define ASN1_SEQUENCE_enc(tname, enc, cb) \ - static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \ - ASN1_SEQUENCE(tname) - -# define ASN1_NDEF_SEQUENCE_END(tname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_NDEF_SEQUENCE,\ - V_ASN1_SEQUENCE,\ - tname##_seq_tt,\ - sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ - NULL,\ - sizeof(tname),\ - #tname \ - ASN1_ITEM_end(tname) - -# define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname) - -# define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) - -# define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) - -# define ASN1_SEQUENCE_END_ref(stname, tname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_SEQUENCE,\ - V_ASN1_SEQUENCE,\ - tname##_seq_tt,\ - sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ - &tname##_aux,\ - sizeof(stname),\ - #stname \ - ASN1_ITEM_end(tname) - -# define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_NDEF_SEQUENCE,\ - V_ASN1_SEQUENCE,\ - tname##_seq_tt,\ - sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ - &tname##_aux,\ - sizeof(stname),\ - #stname \ - ASN1_ITEM_end(tname) - -/*- - * This pair helps declare a CHOICE type. We can do: - * - * ASN1_CHOICE(chname) = { - * ... CHOICE options ... - * ASN1_CHOICE_END(chname) - * - * This will produce an ASN1_ITEM called chname_it - * for a structure called chname. The structure - * definition must look like this: - * typedef struct { - * int type; - * union { - * ASN1_SOMETHING *opt1; - * ASN1_SOMEOTHER *opt2; - * } value; - * } chname; - * - * the name of the selector must be 'type'. - * to use an alternative selector name use the - * ASN1_CHOICE_END_selector() version. - */ - -# define ASN1_CHOICE(tname) \ - static const ASN1_TEMPLATE tname##_ch_tt[] - -# define ASN1_CHOICE_cb(tname, cb) \ - static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ - ASN1_CHOICE(tname) - -# define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname) - -# define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type) - -# define ASN1_CHOICE_END_selector(stname, tname, selname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_CHOICE,\ - offsetof(stname,selname) ,\ - tname##_ch_tt,\ - sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ - NULL,\ - sizeof(stname),\ - #stname \ - ASN1_ITEM_end(tname) - -# define ASN1_CHOICE_END_cb(stname, tname, selname) \ - ;\ - ASN1_ITEM_start(tname) \ - ASN1_ITYPE_CHOICE,\ - offsetof(stname,selname) ,\ - tname##_ch_tt,\ - sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ - &tname##_aux,\ - sizeof(stname),\ - #stname \ - ASN1_ITEM_end(tname) - -/* This helps with the template wrapper form of ASN1_ITEM */ - -# define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \ - (flags), (tag), 0,\ - #name, ASN1_ITEM_ref(type) } - -/* These help with SEQUENCE or CHOICE components */ - -/* used to declare other types */ - -# define ASN1_EX_TYPE(flags, tag, stname, field, type) { \ - (flags), (tag), offsetof(stname, field),\ - #field, ASN1_ITEM_ref(type) } - -/* used when the structure is combined with the parent */ - -# define ASN1_EX_COMBINE(flags, tag, type) { \ - (flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) } - -/* implicit and explicit helper macros */ - -# define ASN1_IMP_EX(stname, field, type, tag, ex) \ - ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type) - -# define ASN1_EXP_EX(stname, field, type, tag, ex) \ - ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type) - -/* Any defined by macros: the field used is in the table itself */ - -# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION -# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } -# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } -# else -# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb } -# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb } -# endif -/* Plain simple type */ -# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type) - -/* OPTIONAL simple type */ -# define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) - -/* IMPLICIT tagged simple type */ -# define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) - -/* IMPLICIT tagged OPTIONAL simple type */ -# define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) - -/* Same as above but EXPLICIT */ - -# define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) -# define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) - -/* SEQUENCE OF type */ -# define ASN1_SEQUENCE_OF(stname, field, type) \ - ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type) - -/* OPTIONAL SEQUENCE OF */ -# define ASN1_SEQUENCE_OF_OPT(stname, field, type) \ - ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) - -/* Same as above but for SET OF */ - -# define ASN1_SET_OF(stname, field, type) \ - ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type) - -# define ASN1_SET_OF_OPT(stname, field, type) \ - ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) - -/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */ - -# define ASN1_IMP_SET_OF(stname, field, type, tag) \ - ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) - -# define ASN1_EXP_SET_OF(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) - -# define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \ - ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) - -# define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) - -# define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \ - ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) - -# define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \ - ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) - -# define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) - -# define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) - -/* EXPLICIT using indefinite length constructed form */ -# define ASN1_NDEF_EXP(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF) - -/* EXPLICIT OPTIONAL using indefinite length constructed form */ -# define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \ - ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF) - -/* Macros for the ASN1_ADB structure */ - -# define ASN1_ADB(name) \ - static const ASN1_ADB_TABLE name##_adbtbl[] - -# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION - -# define ASN1_ADB_END(name, flags, field, app_table, def, none) \ - ;\ - static const ASN1_ADB name##_adb = {\ - flags,\ - offsetof(name, field),\ - app_table,\ - name##_adbtbl,\ - sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ - def,\ - none\ - } - -# else - -# define ASN1_ADB_END(name, flags, field, app_table, def, none) \ - ;\ - static const ASN1_ITEM *name##_adb(void) \ - { \ - static const ASN1_ADB internal_adb = \ - {\ - flags,\ - offsetof(name, field),\ - app_table,\ - name##_adbtbl,\ - sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ - def,\ - none\ - }; \ - return (const ASN1_ITEM *) &internal_adb; \ - } \ - void dummy_function(void) - -# endif - -# define ADB_ENTRY(val, template) {val, template} - -# define ASN1_ADB_TEMPLATE(name) \ - static const ASN1_TEMPLATE name##_tt - -/* - * This is the ASN1 template structure that defines a wrapper round the - * actual type. It determines the actual position of the field in the value - * structure, various flags such as OPTIONAL and the field name. - */ - -struct ASN1_TEMPLATE_st { - unsigned long flags; /* Various flags */ - long tag; /* tag, not used if no tagging */ - unsigned long offset; /* Offset of this field in structure */ -# ifndef NO_ASN1_FIELD_NAMES - const char *field_name; /* Field name */ -# endif - ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */ -}; - -/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */ - -# define ASN1_TEMPLATE_item(t) (t->item_ptr) -# define ASN1_TEMPLATE_adb(t) (t->item_ptr) - -typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE; -typedef struct ASN1_ADB_st ASN1_ADB; - -struct ASN1_ADB_st { - unsigned long flags; /* Various flags */ - unsigned long offset; /* Offset of selector field */ - STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */ - const ASN1_ADB_TABLE *tbl; /* Table of possible types */ - long tblcount; /* Number of entries in tbl */ - const ASN1_TEMPLATE *default_tt; /* Type to use if no match */ - const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */ -}; - -struct ASN1_ADB_TABLE_st { - long value; /* NID for an object or value for an int */ - const ASN1_TEMPLATE tt; /* item for this value */ -}; - -/* template flags */ - -/* Field is optional */ -# define ASN1_TFLG_OPTIONAL (0x1) - -/* Field is a SET OF */ -# define ASN1_TFLG_SET_OF (0x1 << 1) - -/* Field is a SEQUENCE OF */ -# define ASN1_TFLG_SEQUENCE_OF (0x2 << 1) - -/* - * Special case: this refers to a SET OF that will be sorted into DER order - * when encoded *and* the corresponding STACK will be modified to match the - * new order. - */ -# define ASN1_TFLG_SET_ORDER (0x3 << 1) - -/* Mask for SET OF or SEQUENCE OF */ -# define ASN1_TFLG_SK_MASK (0x3 << 1) - -/* - * These flags mean the tag should be taken from the tag field. If EXPLICIT - * then the underlying type is used for the inner tag. - */ - -/* IMPLICIT tagging */ -# define ASN1_TFLG_IMPTAG (0x1 << 3) - -/* EXPLICIT tagging, inner tag from underlying type */ -# define ASN1_TFLG_EXPTAG (0x2 << 3) - -# define ASN1_TFLG_TAG_MASK (0x3 << 3) - -/* context specific IMPLICIT */ -# define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT - -/* context specific EXPLICIT */ -# define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT - -/* - * If tagging is in force these determine the type of tag to use. Otherwise - * the tag is determined by the underlying type. These values reflect the - * actual octet format. - */ - -/* Universal tag */ -# define ASN1_TFLG_UNIVERSAL (0x0<<6) -/* Application tag */ -# define ASN1_TFLG_APPLICATION (0x1<<6) -/* Context specific tag */ -# define ASN1_TFLG_CONTEXT (0x2<<6) -/* Private tag */ -# define ASN1_TFLG_PRIVATE (0x3<<6) - -# define ASN1_TFLG_TAG_CLASS (0x3<<6) - -/* - * These are for ANY DEFINED BY type. In this case the 'item' field points to - * an ASN1_ADB structure which contains a table of values to decode the - * relevant type - */ - -# define ASN1_TFLG_ADB_MASK (0x3<<8) - -# define ASN1_TFLG_ADB_OID (0x1<<8) - -# define ASN1_TFLG_ADB_INT (0x1<<9) - -/* - * This flag means a parent structure is passed instead of the field: this is - * useful is a SEQUENCE is being combined with a CHOICE for example. Since - * this means the structure and item name will differ we need to use the - * ASN1_CHOICE_END_name() macro for example. - */ - -# define ASN1_TFLG_COMBINE (0x1<<10) - -/* - * This flag when present in a SEQUENCE OF, SET OF or EXPLICIT causes - * indefinite length constructed encoding to be used if required. - */ - -# define ASN1_TFLG_NDEF (0x1<<11) - -/* This is the actual ASN1 item itself */ - -struct ASN1_ITEM_st { - char itype; /* The item type, primitive, SEQUENCE, CHOICE - * or extern */ - long utype; /* underlying type */ - const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains - * the contents */ - long tcount; /* Number of templates if SEQUENCE or CHOICE */ - const void *funcs; /* functions that handle this type */ - long size; /* Structure size (usually) */ -# ifndef NO_ASN1_FIELD_NAMES - const char *sname; /* Structure name */ -# endif -}; - -/*- - * These are values for the itype field and - * determine how the type is interpreted. - * - * For PRIMITIVE types the underlying type - * determines the behaviour if items is NULL. - * - * Otherwise templates must contain a single - * template and the type is treated in the - * same way as the type specified in the template. - * - * For SEQUENCE types the templates field points - * to the members, the size field is the - * structure size. - * - * For CHOICE types the templates field points - * to each possible member (typically a union) - * and the 'size' field is the offset of the - * selector. - * - * The 'funcs' field is used for application - * specific functions. - * - * For COMPAT types the funcs field gives a - * set of functions that handle this type, this - * supports the old d2i, i2d convention. - * - * The EXTERN type uses a new style d2i/i2d. - * The new style should be used where possible - * because it avoids things like the d2i IMPLICIT - * hack. - * - * MSTRING is a multiple string type, it is used - * for a CHOICE of character strings where the - * actual strings all occupy an ASN1_STRING - * structure. In this case the 'utype' field - * has a special meaning, it is used as a mask - * of acceptable types using the B_ASN1 constants. - * - * NDEF_SEQUENCE is the same as SEQUENCE except - * that it will use indefinite length constructed - * encoding if requested. - * - */ - -# define ASN1_ITYPE_PRIMITIVE 0x0 - -# define ASN1_ITYPE_SEQUENCE 0x1 - -# define ASN1_ITYPE_CHOICE 0x2 - -# define ASN1_ITYPE_COMPAT 0x3 - -# define ASN1_ITYPE_EXTERN 0x4 - -# define ASN1_ITYPE_MSTRING 0x5 - -# define ASN1_ITYPE_NDEF_SEQUENCE 0x6 - -/* - * Cache for ASN1 tag and length, so we don't keep re-reading it for things - * like CHOICE - */ - -struct ASN1_TLC_st { - char valid; /* Values below are valid */ - int ret; /* return value */ - long plen; /* length */ - int ptag; /* class value */ - int pclass; /* class value */ - int hdrlen; /* header length */ -}; - -/* Typedefs for ASN1 function pointers */ - -typedef ASN1_VALUE *ASN1_new_func(void); -typedef void ASN1_free_func(ASN1_VALUE *a); -typedef ASN1_VALUE *ASN1_d2i_func(ASN1_VALUE **a, const unsigned char **in, - long length); -typedef int ASN1_i2d_func(ASN1_VALUE *a, unsigned char **in); - -typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, - const ASN1_ITEM *it, int tag, int aclass, char opt, - ASN1_TLC *ctx); - -typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out, - const ASN1_ITEM *it, int tag, int aclass); -typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it); -typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it); - -typedef int ASN1_ex_print_func(BIO *out, ASN1_VALUE **pval, - int indent, const char *fname, - const ASN1_PCTX *pctx); - -typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont, - int *putype, const ASN1_ITEM *it); -typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont, - int len, int utype, char *free_cont, - const ASN1_ITEM *it); -typedef int ASN1_primitive_print(BIO *out, ASN1_VALUE **pval, - const ASN1_ITEM *it, int indent, - const ASN1_PCTX *pctx); - -typedef struct ASN1_COMPAT_FUNCS_st { - ASN1_new_func *asn1_new; - ASN1_free_func *asn1_free; - ASN1_d2i_func *asn1_d2i; - ASN1_i2d_func *asn1_i2d; -} ASN1_COMPAT_FUNCS; - -typedef struct ASN1_EXTERN_FUNCS_st { - void *app_data; - ASN1_ex_new_func *asn1_ex_new; - ASN1_ex_free_func *asn1_ex_free; - ASN1_ex_free_func *asn1_ex_clear; - ASN1_ex_d2i *asn1_ex_d2i; - ASN1_ex_i2d *asn1_ex_i2d; - ASN1_ex_print_func *asn1_ex_print; -} ASN1_EXTERN_FUNCS; - -typedef struct ASN1_PRIMITIVE_FUNCS_st { - void *app_data; - unsigned long flags; - ASN1_ex_new_func *prim_new; - ASN1_ex_free_func *prim_free; - ASN1_ex_free_func *prim_clear; - ASN1_primitive_c2i *prim_c2i; - ASN1_primitive_i2c *prim_i2c; - ASN1_primitive_print *prim_print; -} ASN1_PRIMITIVE_FUNCS; - -/* - * This is the ASN1_AUX structure: it handles various miscellaneous - * requirements. For example the use of reference counts and an informational - * callback. The "informational callback" is called at various points during - * the ASN1 encoding and decoding. It can be used to provide minor - * customisation of the structures used. This is most useful where the - * supplied routines *almost* do the right thing but need some extra help at - * a few points. If the callback returns zero then it is assumed a fatal - * error has occurred and the main operation should be abandoned. If major - * changes in the default behaviour are required then an external type is - * more appropriate. - */ - -typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it, - void *exarg); - -typedef struct ASN1_AUX_st { - void *app_data; - int flags; - int ref_offset; /* Offset of reference value */ - int ref_lock; /* Lock type to use */ - ASN1_aux_cb *asn1_cb; - int enc_offset; /* Offset of ASN1_ENCODING structure */ -} ASN1_AUX; - -/* For print related callbacks exarg points to this structure */ -typedef struct ASN1_PRINT_ARG_st { - BIO *out; - int indent; - const ASN1_PCTX *pctx; -} ASN1_PRINT_ARG; - -/* For streaming related callbacks exarg points to this structure */ -typedef struct ASN1_STREAM_ARG_st { - /* BIO to stream through */ - BIO *out; - /* BIO with filters appended */ - BIO *ndef_bio; - /* Streaming I/O boundary */ - unsigned char **boundary; -} ASN1_STREAM_ARG; - -/* Flags in ASN1_AUX */ - -/* Use a reference count */ -# define ASN1_AFLG_REFCOUNT 1 -/* Save the encoding of structure (useful for signatures) */ -# define ASN1_AFLG_ENCODING 2 -/* The Sequence length is invalid */ -# define ASN1_AFLG_BROKEN 4 - -/* operation values for asn1_cb */ - -# define ASN1_OP_NEW_PRE 0 -# define ASN1_OP_NEW_POST 1 -# define ASN1_OP_FREE_PRE 2 -# define ASN1_OP_FREE_POST 3 -# define ASN1_OP_D2I_PRE 4 -# define ASN1_OP_D2I_POST 5 -# define ASN1_OP_I2D_PRE 6 -# define ASN1_OP_I2D_POST 7 -# define ASN1_OP_PRINT_PRE 8 -# define ASN1_OP_PRINT_POST 9 -# define ASN1_OP_STREAM_PRE 10 -# define ASN1_OP_STREAM_POST 11 -# define ASN1_OP_DETACHED_PRE 12 -# define ASN1_OP_DETACHED_POST 13 - -/* Macro to implement a primitive type */ -# define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0) -# define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \ - ASN1_ITEM_start(itname) \ - ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \ - ASN1_ITEM_end(itname) - -/* Macro to implement a multi string type */ -# define IMPLEMENT_ASN1_MSTRING(itname, mask) \ - ASN1_ITEM_start(itname) \ - ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \ - ASN1_ITEM_end(itname) - -/* Macro to implement an ASN1_ITEM in terms of old style funcs */ - -# define IMPLEMENT_COMPAT_ASN1(sname) IMPLEMENT_COMPAT_ASN1_type(sname, V_ASN1_SEQUENCE) - -# define IMPLEMENT_COMPAT_ASN1_type(sname, tag) \ - static const ASN1_COMPAT_FUNCS sname##_ff = { \ - (ASN1_new_func *)sname##_new, \ - (ASN1_free_func *)sname##_free, \ - (ASN1_d2i_func *)d2i_##sname, \ - (ASN1_i2d_func *)i2d_##sname, \ - }; \ - ASN1_ITEM_start(sname) \ - ASN1_ITYPE_COMPAT, \ - tag, \ - NULL, \ - 0, \ - &sname##_ff, \ - 0, \ - #sname \ - ASN1_ITEM_end(sname) - -# define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \ - ASN1_ITEM_start(sname) \ - ASN1_ITYPE_EXTERN, \ - tag, \ - NULL, \ - 0, \ - &fptrs, \ - 0, \ - #sname \ - ASN1_ITEM_end(sname) - -/* Macro to implement standard functions in terms of ASN1_ITEM structures */ - -# define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname) - -# define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname) - -# define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \ - IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname) - -# define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \ - IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname) - -# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \ - IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname) - -# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \ - pre stname *fname##_new(void) \ - { \ - return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ - } \ - pre void fname##_free(stname *a) \ - { \ - ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ - } - -# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \ - stname *fname##_new(void) \ - { \ - return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ - } \ - void fname##_free(stname *a) \ - { \ - ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ - } - -# define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \ - IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ - IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) - -# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ - stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ - { \ - return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ - } \ - int i2d_##fname(stname *a, unsigned char **out) \ - { \ - return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ - } - -# define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \ - int i2d_##stname##_NDEF(stname *a, unsigned char **out) \ - { \ - return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\ - } - -/* - * This includes evil casts to remove const: they will go away when full ASN1 - * constification is done. - */ -# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ - stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ - { \ - return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ - } \ - int i2d_##fname(const stname *a, unsigned char **out) \ - { \ - return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ - } - -# define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \ - stname * stname##_dup(stname *x) \ - { \ - return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \ - } - -# define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \ - IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname) - -# define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \ - int fname##_print_ctx(BIO *out, stname *x, int indent, \ - const ASN1_PCTX *pctx) \ - { \ - return ASN1_item_print(out, (ASN1_VALUE *)x, indent, \ - ASN1_ITEM_rptr(itname), pctx); \ - } - -# define IMPLEMENT_ASN1_FUNCTIONS_const(name) \ - IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name) - -# define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \ - IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ - IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) - -/* external definitions for primitive types */ - -DECLARE_ASN1_ITEM(ASN1_BOOLEAN) -DECLARE_ASN1_ITEM(ASN1_TBOOLEAN) -DECLARE_ASN1_ITEM(ASN1_FBOOLEAN) -DECLARE_ASN1_ITEM(ASN1_SEQUENCE) -DECLARE_ASN1_ITEM(CBIGNUM) -DECLARE_ASN1_ITEM(BIGNUM) -DECLARE_ASN1_ITEM(LONG) -DECLARE_ASN1_ITEM(ZLONG) - -DECLARE_STACK_OF(ASN1_VALUE) - -/* Functions used internally by the ASN1 code */ - -int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it); -void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it); -int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); -int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it); - -void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); -int ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, - const ASN1_TEMPLATE *tt); -int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, - const ASN1_ITEM *it, int tag, int aclass, char opt, - ASN1_TLC *ctx); - -int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, - const ASN1_ITEM *it, int tag, int aclass); -int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, - const ASN1_TEMPLATE *tt); -void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it); - -int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, - const ASN1_ITEM *it); -int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, - int utype, char *free_cont, const ASN1_ITEM *it); - -int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it); -int asn1_set_choice_selector(ASN1_VALUE **pval, int value, - const ASN1_ITEM *it); - -ASN1_VALUE **asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); - -const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, - int nullerr); - -int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it); - -void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it); -void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it); -int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, - const ASN1_ITEM *it); -int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, - const ASN1_ITEM *it); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/bio.h b/libs/win32/openssl/include/openssl/bio.h deleted file mode 100644 index 8f2438cdad..0000000000 --- a/libs/win32/openssl/include/openssl/bio.h +++ /dev/null @@ -1,883 +0,0 @@ -/* crypto/bio/bio.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_BIO_H -# define HEADER_BIO_H - -# include - -# ifndef OPENSSL_NO_FP_API -# include -# endif -# include - -# include - -# ifndef OPENSSL_NO_SCTP -# ifndef OPENSSL_SYS_VMS -# include -# else -# include -# endif -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* These are the 'types' of BIOs */ -# define BIO_TYPE_NONE 0 -# define BIO_TYPE_MEM (1|0x0400) -# define BIO_TYPE_FILE (2|0x0400) - -# define BIO_TYPE_FD (4|0x0400|0x0100) -# define BIO_TYPE_SOCKET (5|0x0400|0x0100) -# define BIO_TYPE_NULL (6|0x0400) -# define BIO_TYPE_SSL (7|0x0200) -# define BIO_TYPE_MD (8|0x0200)/* passive filter */ -# define BIO_TYPE_BUFFER (9|0x0200)/* filter */ -# define BIO_TYPE_CIPHER (10|0x0200)/* filter */ -# define BIO_TYPE_BASE64 (11|0x0200)/* filter */ -# define BIO_TYPE_CONNECT (12|0x0400|0x0100)/* socket - connect */ -# define BIO_TYPE_ACCEPT (13|0x0400|0x0100)/* socket for accept */ -# define BIO_TYPE_PROXY_CLIENT (14|0x0200)/* client proxy BIO */ -# define BIO_TYPE_PROXY_SERVER (15|0x0200)/* server proxy BIO */ -# define BIO_TYPE_NBIO_TEST (16|0x0200)/* server proxy BIO */ -# define BIO_TYPE_NULL_FILTER (17|0x0200) -# define BIO_TYPE_BER (18|0x0200)/* BER -> bin filter */ -# define BIO_TYPE_BIO (19|0x0400)/* (half a) BIO pair */ -# define BIO_TYPE_LINEBUFFER (20|0x0200)/* filter */ -# define BIO_TYPE_DGRAM (21|0x0400|0x0100) -# ifndef OPENSSL_NO_SCTP -# define BIO_TYPE_DGRAM_SCTP (24|0x0400|0x0100) -# endif -# define BIO_TYPE_ASN1 (22|0x0200)/* filter */ -# define BIO_TYPE_COMP (23|0x0200)/* filter */ - -# define BIO_TYPE_DESCRIPTOR 0x0100/* socket, fd, connect or accept */ -# define BIO_TYPE_FILTER 0x0200 -# define BIO_TYPE_SOURCE_SINK 0x0400 - -/* - * BIO_FILENAME_READ|BIO_CLOSE to open or close on free. - * BIO_set_fp(in,stdin,BIO_NOCLOSE); - */ -# define BIO_NOCLOSE 0x00 -# define BIO_CLOSE 0x01 - -/* - * These are used in the following macros and are passed to BIO_ctrl() - */ -# define BIO_CTRL_RESET 1/* opt - rewind/zero etc */ -# define BIO_CTRL_EOF 2/* opt - are we at the eof */ -# define BIO_CTRL_INFO 3/* opt - extra tit-bits */ -# define BIO_CTRL_SET 4/* man - set the 'IO' type */ -# define BIO_CTRL_GET 5/* man - get the 'IO' type */ -# define BIO_CTRL_PUSH 6/* opt - internal, used to signify change */ -# define BIO_CTRL_POP 7/* opt - internal, used to signify change */ -# define BIO_CTRL_GET_CLOSE 8/* man - set the 'close' on free */ -# define BIO_CTRL_SET_CLOSE 9/* man - set the 'close' on free */ -# define BIO_CTRL_PENDING 10/* opt - is their more data buffered */ -# define BIO_CTRL_FLUSH 11/* opt - 'flush' buffered output */ -# define BIO_CTRL_DUP 12/* man - extra stuff for 'duped' BIO */ -# define BIO_CTRL_WPENDING 13/* opt - number of bytes still to write */ -/* callback is int cb(BIO *bio,state,ret); */ -# define BIO_CTRL_SET_CALLBACK 14/* opt - set callback function */ -# define BIO_CTRL_GET_CALLBACK 15/* opt - set callback function */ - -# define BIO_CTRL_SET_FILENAME 30/* BIO_s_file special */ - -/* dgram BIO stuff */ -# define BIO_CTRL_DGRAM_CONNECT 31/* BIO dgram special */ -# define BIO_CTRL_DGRAM_SET_CONNECTED 32/* allow for an externally connected - * socket to be passed in */ -# define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33/* setsockopt, essentially */ -# define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34/* getsockopt, essentially */ -# define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35/* setsockopt, essentially */ -# define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36/* getsockopt, essentially */ - -# define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37/* flag whether the last */ -# define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38/* I/O operation tiemd out */ - -/* #ifdef IP_MTU_DISCOVER */ -# define BIO_CTRL_DGRAM_MTU_DISCOVER 39/* set DF bit on egress packets */ -/* #endif */ - -# define BIO_CTRL_DGRAM_QUERY_MTU 40/* as kernel for current MTU */ -# define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47 -# define BIO_CTRL_DGRAM_GET_MTU 41/* get cached value for MTU */ -# define BIO_CTRL_DGRAM_SET_MTU 42/* set cached value for MTU. - * want to use this if asking - * the kernel fails */ - -# define BIO_CTRL_DGRAM_MTU_EXCEEDED 43/* check whether the MTU was - * exceed in the previous write - * operation */ - -# define BIO_CTRL_DGRAM_GET_PEER 46 -# define BIO_CTRL_DGRAM_SET_PEER 44/* Destination for the data */ - -# define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45/* Next DTLS handshake timeout - * to adjust socket timeouts */ -# define BIO_CTRL_DGRAM_SET_DONT_FRAG 48 - -# define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49 - -# ifndef OPENSSL_NO_SCTP -/* SCTP stuff */ -# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 -# define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51 -# define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52 -# define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53 -# define BIO_CTRL_DGRAM_SCTP_GET_SNDINFO 60 -# define BIO_CTRL_DGRAM_SCTP_SET_SNDINFO 61 -# define BIO_CTRL_DGRAM_SCTP_GET_RCVINFO 62 -# define BIO_CTRL_DGRAM_SCTP_SET_RCVINFO 63 -# define BIO_CTRL_DGRAM_SCTP_GET_PRINFO 64 -# define BIO_CTRL_DGRAM_SCTP_SET_PRINFO 65 -# define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70 -# endif - -/* modifiers */ -# define BIO_FP_READ 0x02 -# define BIO_FP_WRITE 0x04 -# define BIO_FP_APPEND 0x08 -# define BIO_FP_TEXT 0x10 - -# define BIO_FLAGS_READ 0x01 -# define BIO_FLAGS_WRITE 0x02 -# define BIO_FLAGS_IO_SPECIAL 0x04 -# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL) -# define BIO_FLAGS_SHOULD_RETRY 0x08 -# ifndef BIO_FLAGS_UPLINK -/* - * "UPLINK" flag denotes file descriptors provided by application. It - * defaults to 0, as most platforms don't require UPLINK interface. - */ -# define BIO_FLAGS_UPLINK 0 -# endif - -/* Used in BIO_gethostbyname() */ -# define BIO_GHBN_CTRL_HITS 1 -# define BIO_GHBN_CTRL_MISSES 2 -# define BIO_GHBN_CTRL_CACHE_SIZE 3 -# define BIO_GHBN_CTRL_GET_ENTRY 4 -# define BIO_GHBN_CTRL_FLUSH 5 - -/* Mostly used in the SSL BIO */ -/*- - * Not used anymore - * #define BIO_FLAGS_PROTOCOL_DELAYED_READ 0x10 - * #define BIO_FLAGS_PROTOCOL_DELAYED_WRITE 0x20 - * #define BIO_FLAGS_PROTOCOL_STARTUP 0x40 - */ - -# define BIO_FLAGS_BASE64_NO_NL 0x100 - -/* - * This is used with memory BIOs: it means we shouldn't free up or change the - * data in any way. - */ -# define BIO_FLAGS_MEM_RDONLY 0x200 - -typedef struct bio_st BIO; - -void BIO_set_flags(BIO *b, int flags); -int BIO_test_flags(const BIO *b, int flags); -void BIO_clear_flags(BIO *b, int flags); - -# define BIO_get_flags(b) BIO_test_flags(b, ~(0x0)) -# define BIO_set_retry_special(b) \ - BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY)) -# define BIO_set_retry_read(b) \ - BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY)) -# define BIO_set_retry_write(b) \ - BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY)) - -/* These are normally used internally in BIOs */ -# define BIO_clear_retry_flags(b) \ - BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) -# define BIO_get_retry_flags(b) \ - BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) - -/* These should be used by the application to tell why we should retry */ -# define BIO_should_read(a) BIO_test_flags(a, BIO_FLAGS_READ) -# define BIO_should_write(a) BIO_test_flags(a, BIO_FLAGS_WRITE) -# define BIO_should_io_special(a) BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL) -# define BIO_retry_type(a) BIO_test_flags(a, BIO_FLAGS_RWS) -# define BIO_should_retry(a) BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY) - -/* - * The next three are used in conjunction with the BIO_should_io_special() - * condition. After this returns true, BIO *BIO_get_retry_BIO(BIO *bio, int - * *reason); will walk the BIO stack and return the 'reason' for the special - * and the offending BIO. Given a BIO, BIO_get_retry_reason(bio) will return - * the code. - */ -/* - * Returned from the SSL bio when the certificate retrieval code had an error - */ -# define BIO_RR_SSL_X509_LOOKUP 0x01 -/* Returned from the connect BIO when a connect would have blocked */ -# define BIO_RR_CONNECT 0x02 -/* Returned from the accept BIO when an accept would have blocked */ -# define BIO_RR_ACCEPT 0x03 - -/* These are passed by the BIO callback */ -# define BIO_CB_FREE 0x01 -# define BIO_CB_READ 0x02 -# define BIO_CB_WRITE 0x03 -# define BIO_CB_PUTS 0x04 -# define BIO_CB_GETS 0x05 -# define BIO_CB_CTRL 0x06 - -/* - * The callback is called before and after the underling operation, The - * BIO_CB_RETURN flag indicates if it is after the call - */ -# define BIO_CB_RETURN 0x80 -# define BIO_CB_return(a) ((a)|BIO_CB_RETURN) -# define BIO_cb_pre(a) (!((a)&BIO_CB_RETURN)) -# define BIO_cb_post(a) ((a)&BIO_CB_RETURN) - -long (*BIO_get_callback(const BIO *b)) (struct bio_st *, int, const char *, - int, long, long); -void BIO_set_callback(BIO *b, - long (*callback) (struct bio_st *, int, const char *, - int, long, long)); -char *BIO_get_callback_arg(const BIO *b); -void BIO_set_callback_arg(BIO *b, char *arg); - -const char *BIO_method_name(const BIO *b); -int BIO_method_type(const BIO *b); - -typedef void bio_info_cb (struct bio_st *, int, const char *, int, long, - long); - -typedef struct bio_method_st { - int type; - const char *name; - int (*bwrite) (BIO *, const char *, int); - int (*bread) (BIO *, char *, int); - int (*bputs) (BIO *, const char *); - int (*bgets) (BIO *, char *, int); - long (*ctrl) (BIO *, int, long, void *); - int (*create) (BIO *); - int (*destroy) (BIO *); - long (*callback_ctrl) (BIO *, int, bio_info_cb *); -} BIO_METHOD; - -struct bio_st { - BIO_METHOD *method; - /* bio, mode, argp, argi, argl, ret */ - long (*callback) (struct bio_st *, int, const char *, int, long, long); - char *cb_arg; /* first argument for the callback */ - int init; - int shutdown; - int flags; /* extra storage */ - int retry_reason; - int num; - void *ptr; - struct bio_st *next_bio; /* used by filter BIOs */ - struct bio_st *prev_bio; /* used by filter BIOs */ - int references; - unsigned long num_read; - unsigned long num_write; - CRYPTO_EX_DATA ex_data; -}; - -DECLARE_STACK_OF(BIO) - -typedef struct bio_f_buffer_ctx_struct { - /*- - * Buffers are setup like this: - * - * <---------------------- size -----------------------> - * +---------------------------------------------------+ - * | consumed | remaining | free space | - * +---------------------------------------------------+ - * <-- off --><------- len -------> - */ - /*- BIO *bio; *//* - * this is now in the BIO struct - */ - int ibuf_size; /* how big is the input buffer */ - int obuf_size; /* how big is the output buffer */ - char *ibuf; /* the char array */ - int ibuf_len; /* how many bytes are in it */ - int ibuf_off; /* write/read offset */ - char *obuf; /* the char array */ - int obuf_len; /* how many bytes are in it */ - int obuf_off; /* write/read offset */ -} BIO_F_BUFFER_CTX; - -/* Prefix and suffix callback in ASN1 BIO */ -typedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen, - void *parg); - -# ifndef OPENSSL_NO_SCTP -/* SCTP parameter structs */ -struct bio_dgram_sctp_sndinfo { - uint16_t snd_sid; - uint16_t snd_flags; - uint32_t snd_ppid; - uint32_t snd_context; -}; - -struct bio_dgram_sctp_rcvinfo { - uint16_t rcv_sid; - uint16_t rcv_ssn; - uint16_t rcv_flags; - uint32_t rcv_ppid; - uint32_t rcv_tsn; - uint32_t rcv_cumtsn; - uint32_t rcv_context; -}; - -struct bio_dgram_sctp_prinfo { - uint16_t pr_policy; - uint32_t pr_value; -}; -# endif - -/* connect BIO stuff */ -# define BIO_CONN_S_BEFORE 1 -# define BIO_CONN_S_GET_IP 2 -# define BIO_CONN_S_GET_PORT 3 -# define BIO_CONN_S_CREATE_SOCKET 4 -# define BIO_CONN_S_CONNECT 5 -# define BIO_CONN_S_OK 6 -# define BIO_CONN_S_BLOCKED_CONNECT 7 -# define BIO_CONN_S_NBIO 8 -/* - * #define BIO_CONN_get_param_hostname BIO_ctrl - */ - -# define BIO_C_SET_CONNECT 100 -# define BIO_C_DO_STATE_MACHINE 101 -# define BIO_C_SET_NBIO 102 -# define BIO_C_SET_PROXY_PARAM 103 -# define BIO_C_SET_FD 104 -# define BIO_C_GET_FD 105 -# define BIO_C_SET_FILE_PTR 106 -# define BIO_C_GET_FILE_PTR 107 -# define BIO_C_SET_FILENAME 108 -# define BIO_C_SET_SSL 109 -# define BIO_C_GET_SSL 110 -# define BIO_C_SET_MD 111 -# define BIO_C_GET_MD 112 -# define BIO_C_GET_CIPHER_STATUS 113 -# define BIO_C_SET_BUF_MEM 114 -# define BIO_C_GET_BUF_MEM_PTR 115 -# define BIO_C_GET_BUFF_NUM_LINES 116 -# define BIO_C_SET_BUFF_SIZE 117 -# define BIO_C_SET_ACCEPT 118 -# define BIO_C_SSL_MODE 119 -# define BIO_C_GET_MD_CTX 120 -# define BIO_C_GET_PROXY_PARAM 121 -# define BIO_C_SET_BUFF_READ_DATA 122/* data to read first */ -# define BIO_C_GET_CONNECT 123 -# define BIO_C_GET_ACCEPT 124 -# define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 -# define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 -# define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 -# define BIO_C_FILE_SEEK 128 -# define BIO_C_GET_CIPHER_CTX 129 -# define BIO_C_SET_BUF_MEM_EOF_RETURN 130/* return end of input - * value */ -# define BIO_C_SET_BIND_MODE 131 -# define BIO_C_GET_BIND_MODE 132 -# define BIO_C_FILE_TELL 133 -# define BIO_C_GET_SOCKS 134 -# define BIO_C_SET_SOCKS 135 - -# define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */ -# define BIO_C_GET_WRITE_BUF_SIZE 137 -# define BIO_C_MAKE_BIO_PAIR 138 -# define BIO_C_DESTROY_BIO_PAIR 139 -# define BIO_C_GET_WRITE_GUARANTEE 140 -# define BIO_C_GET_READ_REQUEST 141 -# define BIO_C_SHUTDOWN_WR 142 -# define BIO_C_NREAD0 143 -# define BIO_C_NREAD 144 -# define BIO_C_NWRITE0 145 -# define BIO_C_NWRITE 146 -# define BIO_C_RESET_READ_REQUEST 147 -# define BIO_C_SET_MD_CTX 148 - -# define BIO_C_SET_PREFIX 149 -# define BIO_C_GET_PREFIX 150 -# define BIO_C_SET_SUFFIX 151 -# define BIO_C_GET_SUFFIX 152 - -# define BIO_C_SET_EX_ARG 153 -# define BIO_C_GET_EX_ARG 154 - -# define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg) -# define BIO_get_app_data(s) BIO_get_ex_data(s,0) - -/* BIO_s_connect() and BIO_s_socks4a_connect() */ -# define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name) -# define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port) -# define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip) -# define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port) -# define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) -# define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) -# define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2) -# define BIO_get_conn_int_port(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL) - -# define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) - -/* BIO_s_accept() */ -# define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name) -# define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0) -/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ -# define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?(void *)"a":NULL) -# define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio) - -# define BIO_BIND_NORMAL 0 -# define BIO_BIND_REUSEADDR_IF_UNUSED 1 -# define BIO_BIND_REUSEADDR 2 -# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL) -# define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL) - -/* BIO_s_accept() and BIO_s_connect() */ -# define BIO_do_connect(b) BIO_do_handshake(b) -# define BIO_do_accept(b) BIO_do_handshake(b) -# define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) - -/* BIO_s_proxy_client() */ -# define BIO_set_url(b,url) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char *)(url)) -# define BIO_set_proxies(b,p) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char *)(p)) -/* BIO_set_nbio(b,n) */ -# define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s)) -/* BIO *BIO_get_filter_bio(BIO *bio); */ -# define BIO_set_proxy_cb(b,cb) BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)())) -# define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk) -# define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool) - -# define BIO_get_proxy_header(b,skp) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,(char *)skp) -# define BIO_get_proxies(b,pxy_p) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,(char *)(pxy_p)) -# define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url)) -# define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL) - -/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */ -# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd) -# define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c) - -/* BIO_s_file() */ -# define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp) -# define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp) - -/* BIO_s_fd() and BIO_s_file() */ -# define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL) -# define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL) - -/* - * name is cast to lose const, but might be better to route through a - * function so we can do it safely - */ -# ifdef CONST_STRICT -/* - * If you are wondering why this isn't defined, its because CONST_STRICT is - * purely a compile-time kludge to allow const to be checked. - */ -int BIO_read_filename(BIO *b, const char *name); -# else -# define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ - BIO_CLOSE|BIO_FP_READ,(char *)name) -# endif -# define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ - BIO_CLOSE|BIO_FP_WRITE,name) -# define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ - BIO_CLOSE|BIO_FP_APPEND,name) -# define BIO_rw_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ - BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name) - -/* - * WARNING WARNING, this ups the reference count on the read bio of the SSL - * structure. This is because the ssl read BIO is now pointed to by the - * next_bio field in the bio. So when you free the BIO, make sure you are - * doing a BIO_free_all() to catch the underlying BIO. - */ -# define BIO_set_ssl(b,ssl,c) BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl) -# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp) -# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL) -# define BIO_set_ssl_renegotiate_bytes(b,num) \ - BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL) -# define BIO_get_num_renegotiates(b) \ - BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL) -# define BIO_set_ssl_renegotiate_timeout(b,seconds) \ - BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL) - -/* defined in evp.h */ -/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */ - -# define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp) -# define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm) -# define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp) -# define BIO_set_mem_eof_return(b,v) \ - BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL) - -/* For the BIO_f_buffer() type */ -# define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL) -# define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL) -# define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0) -# define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1) -# define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf) - -/* Don't use the next one unless you know what you are doing :-) */ -# define BIO_dup_state(b,ret) BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret)) - -# define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL) -# define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL) -# define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL) -# define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL) -# define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL) -# define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL) -/* ...pending macros have inappropriate return type */ -size_t BIO_ctrl_pending(BIO *b); -size_t BIO_ctrl_wpending(BIO *b); -# define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL) -# define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \ - cbp) -# define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb) - -/* For the BIO_f_buffer() type */ -# define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL) - -/* For BIO_s_bio() */ -# define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL) -# define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL) -# define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2) -# define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL) -# define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL) -/* macros with inappropriate type -- but ...pending macros use int too: */ -# define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL) -# define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL) -size_t BIO_ctrl_get_write_guarantee(BIO *b); -size_t BIO_ctrl_get_read_request(BIO *b); -int BIO_ctrl_reset_read_request(BIO *b); - -/* ctrl macros for dgram */ -# define BIO_ctrl_dgram_connect(b,peer) \ - (int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)peer) -# define BIO_ctrl_set_connected(b, state, peer) \ - (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, (char *)peer) -# define BIO_dgram_recv_timedout(b) \ - (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL) -# define BIO_dgram_send_timedout(b) \ - (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL) -# define BIO_dgram_get_peer(b,peer) \ - (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)peer) -# define BIO_dgram_set_peer(b,peer) \ - (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer) -# define BIO_dgram_get_mtu_overhead(b) \ - (unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL) - -/* These two aren't currently implemented */ -/* int BIO_get_ex_num(BIO *bio); */ -/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */ -int BIO_set_ex_data(BIO *bio, int idx, void *data); -void *BIO_get_ex_data(BIO *bio, int idx); -int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -unsigned long BIO_number_read(BIO *bio); -unsigned long BIO_number_written(BIO *bio); - -/* For BIO_f_asn1() */ -int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix, - asn1_ps_func *prefix_free); -int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix, - asn1_ps_func **pprefix_free); -int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix, - asn1_ps_func *suffix_free); -int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix, - asn1_ps_func **psuffix_free); - -# ifndef OPENSSL_NO_FP_API -BIO_METHOD *BIO_s_file(void); -BIO *BIO_new_file(const char *filename, const char *mode); -BIO *BIO_new_fp(FILE *stream, int close_flag); -# define BIO_s_file_internal BIO_s_file -# endif -BIO *BIO_new(BIO_METHOD *type); -int BIO_set(BIO *a, BIO_METHOD *type); -int BIO_free(BIO *a); -void BIO_vfree(BIO *a); -int BIO_read(BIO *b, void *data, int len); -int BIO_gets(BIO *bp, char *buf, int size); -int BIO_write(BIO *b, const void *data, int len); -int BIO_puts(BIO *bp, const char *buf); -int BIO_indent(BIO *b, int indent, int max); -long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg); -long BIO_callback_ctrl(BIO *b, int cmd, - void (*fp) (struct bio_st *, int, const char *, int, - long, long)); -char *BIO_ptr_ctrl(BIO *bp, int cmd, long larg); -long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg); -BIO *BIO_push(BIO *b, BIO *append); -BIO *BIO_pop(BIO *b); -void BIO_free_all(BIO *a); -BIO *BIO_find_type(BIO *b, int bio_type); -BIO *BIO_next(BIO *b); -BIO *BIO_get_retry_BIO(BIO *bio, int *reason); -int BIO_get_retry_reason(BIO *bio); -BIO *BIO_dup_chain(BIO *in); - -int BIO_nread0(BIO *bio, char **buf); -int BIO_nread(BIO *bio, char **buf, int num); -int BIO_nwrite0(BIO *bio, char **buf); -int BIO_nwrite(BIO *bio, char **buf, int num); - -long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, - long argl, long ret); - -BIO_METHOD *BIO_s_mem(void); -BIO *BIO_new_mem_buf(const void *buf, int len); -BIO_METHOD *BIO_s_socket(void); -BIO_METHOD *BIO_s_connect(void); -BIO_METHOD *BIO_s_accept(void); -BIO_METHOD *BIO_s_fd(void); -# ifndef OPENSSL_SYS_OS2 -BIO_METHOD *BIO_s_log(void); -# endif -BIO_METHOD *BIO_s_bio(void); -BIO_METHOD *BIO_s_null(void); -BIO_METHOD *BIO_f_null(void); -BIO_METHOD *BIO_f_buffer(void); -# ifdef OPENSSL_SYS_VMS -BIO_METHOD *BIO_f_linebuffer(void); -# endif -BIO_METHOD *BIO_f_nbio_test(void); -# ifndef OPENSSL_NO_DGRAM -BIO_METHOD *BIO_s_datagram(void); -# ifndef OPENSSL_NO_SCTP -BIO_METHOD *BIO_s_datagram_sctp(void); -# endif -# endif - -/* BIO_METHOD *BIO_f_ber(void); */ - -int BIO_sock_should_retry(int i); -int BIO_sock_non_fatal_error(int error); -int BIO_dgram_non_fatal_error(int error); - -int BIO_fd_should_retry(int i); -int BIO_fd_non_fatal_error(int error); -int BIO_dump_cb(int (*cb) (const void *data, size_t len, void *u), - void *u, const char *s, int len); -int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u), - void *u, const char *s, int len, int indent); -int BIO_dump(BIO *b, const char *bytes, int len); -int BIO_dump_indent(BIO *b, const char *bytes, int len, int indent); -# ifndef OPENSSL_NO_FP_API -int BIO_dump_fp(FILE *fp, const char *s, int len); -int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent); -# endif -int BIO_hex_string(BIO *out, int indent, int width, unsigned char *data, - int datalen); - -struct hostent *BIO_gethostbyname(const char *name); -/*- - * We might want a thread-safe interface too: - * struct hostent *BIO_gethostbyname_r(const char *name, - * struct hostent *result, void *buffer, size_t buflen); - * or something similar (caller allocates a struct hostent, - * pointed to by "result", and additional buffer space for the various - * substructures; if the buffer does not suffice, NULL is returned - * and an appropriate error code is set). - */ -int BIO_sock_error(int sock); -int BIO_socket_ioctl(int fd, long type, void *arg); -int BIO_socket_nbio(int fd, int mode); -int BIO_get_port(const char *str, unsigned short *port_ptr); -int BIO_get_host_ip(const char *str, unsigned char *ip); -int BIO_get_accept_socket(char *host_port, int mode); -int BIO_accept(int sock, char **ip_port); -int BIO_sock_init(void); -void BIO_sock_cleanup(void); -int BIO_set_tcp_ndelay(int sock, int turn_on); - -BIO *BIO_new_socket(int sock, int close_flag); -BIO *BIO_new_dgram(int fd, int close_flag); -# ifndef OPENSSL_NO_SCTP -BIO *BIO_new_dgram_sctp(int fd, int close_flag); -int BIO_dgram_is_sctp(BIO *bio); -int BIO_dgram_sctp_notification_cb(BIO *b, - void (*handle_notifications) (BIO *bio, - void - *context, - void *buf), - void *context); -int BIO_dgram_sctp_wait_for_dry(BIO *b); -int BIO_dgram_sctp_msg_waiting(BIO *b); -# endif -BIO *BIO_new_fd(int fd, int close_flag); -BIO *BIO_new_connect(const char *host_port); -BIO *BIO_new_accept(const char *host_port); - -int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, - BIO **bio2, size_t writebuf2); -/* - * If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. - * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default - * value. - */ - -void BIO_copy_next_retry(BIO *b); - -/* - * long BIO_ghbn_ctrl(int cmd,int iarg,char *parg); - */ - -# ifdef __GNUC__ -# define __bio_h__attr__ __attribute__ -# else -# define __bio_h__attr__(x) -# endif -int BIO_printf(BIO *bio, const char *format, ...) -__bio_h__attr__((__format__(__printf__, 2, 3))); -int BIO_vprintf(BIO *bio, const char *format, va_list args) -__bio_h__attr__((__format__(__printf__, 2, 0))); -int BIO_snprintf(char *buf, size_t n, const char *format, ...) -__bio_h__attr__((__format__(__printf__, 3, 4))); -int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) -__bio_h__attr__((__format__(__printf__, 3, 0))); -# undef __bio_h__attr__ - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_BIO_strings(void); - -/* Error codes for the BIO functions. */ - -/* Function codes. */ -# define BIO_F_ACPT_STATE 100 -# define BIO_F_BIO_ACCEPT 101 -# define BIO_F_BIO_BER_GET_HEADER 102 -# define BIO_F_BIO_CALLBACK_CTRL 131 -# define BIO_F_BIO_CTRL 103 -# define BIO_F_BIO_GETHOSTBYNAME 120 -# define BIO_F_BIO_GETS 104 -# define BIO_F_BIO_GET_ACCEPT_SOCKET 105 -# define BIO_F_BIO_GET_HOST_IP 106 -# define BIO_F_BIO_GET_PORT 107 -# define BIO_F_BIO_MAKE_PAIR 121 -# define BIO_F_BIO_NEW 108 -# define BIO_F_BIO_NEW_FILE 109 -# define BIO_F_BIO_NEW_MEM_BUF 126 -# define BIO_F_BIO_NREAD 123 -# define BIO_F_BIO_NREAD0 124 -# define BIO_F_BIO_NWRITE 125 -# define BIO_F_BIO_NWRITE0 122 -# define BIO_F_BIO_PUTS 110 -# define BIO_F_BIO_READ 111 -# define BIO_F_BIO_SOCK_INIT 112 -# define BIO_F_BIO_WRITE 113 -# define BIO_F_BUFFER_CTRL 114 -# define BIO_F_CONN_CTRL 127 -# define BIO_F_CONN_STATE 115 -# define BIO_F_DGRAM_SCTP_READ 132 -# define BIO_F_DGRAM_SCTP_WRITE 133 -# define BIO_F_FILE_CTRL 116 -# define BIO_F_FILE_READ 130 -# define BIO_F_LINEBUFFER_CTRL 129 -# define BIO_F_MEM_READ 128 -# define BIO_F_MEM_WRITE 117 -# define BIO_F_SSL_NEW 118 -# define BIO_F_WSASTARTUP 119 - -/* Reason codes. */ -# define BIO_R_ACCEPT_ERROR 100 -# define BIO_R_BAD_FOPEN_MODE 101 -# define BIO_R_BAD_HOSTNAME_LOOKUP 102 -# define BIO_R_BROKEN_PIPE 124 -# define BIO_R_CONNECT_ERROR 103 -# define BIO_R_EOF_ON_MEMORY_BIO 127 -# define BIO_R_ERROR_SETTING_NBIO 104 -# define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105 -# define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106 -# define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107 -# define BIO_R_INVALID_ARGUMENT 125 -# define BIO_R_INVALID_IP_ADDRESS 108 -# define BIO_R_IN_USE 123 -# define BIO_R_KEEPALIVE 109 -# define BIO_R_NBIO_CONNECT_ERROR 110 -# define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111 -# define BIO_R_NO_HOSTNAME_SPECIFIED 112 -# define BIO_R_NO_PORT_DEFINED 113 -# define BIO_R_NO_PORT_SPECIFIED 114 -# define BIO_R_NO_SUCH_FILE 128 -# define BIO_R_NULL_PARAMETER 115 -# define BIO_R_TAG_MISMATCH 116 -# define BIO_R_UNABLE_TO_BIND_SOCKET 117 -# define BIO_R_UNABLE_TO_CREATE_SOCKET 118 -# define BIO_R_UNABLE_TO_LISTEN_SOCKET 119 -# define BIO_R_UNINITIALIZED 120 -# define BIO_R_UNSUPPORTED_METHOD 121 -# define BIO_R_WRITE_TO_READ_ONLY_BIO 126 -# define BIO_R_WSASTARTUP 122 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/blowfish.h b/libs/win32/openssl/include/openssl/blowfish.h deleted file mode 100644 index 832930272c..0000000000 --- a/libs/win32/openssl/include/openssl/blowfish.h +++ /dev/null @@ -1,130 +0,0 @@ -/* crypto/bf/blowfish.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_BLOWFISH_H -# define HEADER_BLOWFISH_H - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# ifdef OPENSSL_NO_BF -# error BF is disabled. -# endif - -# define BF_ENCRYPT 1 -# define BF_DECRYPT 0 - -/*- - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! BF_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! BF_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -# if defined(__LP32__) -# define BF_LONG unsigned long -# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -# define BF_LONG unsigned long -# define BF_LONG_LOG2 3 -/* - * _CRAY note. I could declare short, but I have no idea what impact - * does it have on performance on none-T3E machines. I could declare - * int, but at least on C90 sizeof(int) can be chosen at compile time. - * So I've chosen long... - * - */ -# else -# define BF_LONG unsigned int -# endif - -# define BF_ROUNDS 16 -# define BF_BLOCK 8 - -typedef struct bf_key_st { - BF_LONG P[BF_ROUNDS + 2]; - BF_LONG S[4 * 256]; -} BF_KEY; - -# ifdef OPENSSL_FIPS -void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data); -# endif -void BF_set_key(BF_KEY *key, int len, const unsigned char *data); - -void BF_encrypt(BF_LONG *data, const BF_KEY *key); -void BF_decrypt(BF_LONG *data, const BF_KEY *key); - -void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, - const BF_KEY *key, int enc); -void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, - const BF_KEY *schedule, unsigned char *ivec, int enc); -void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, const BF_KEY *schedule, - unsigned char *ivec, int *num, int enc); -void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, const BF_KEY *schedule, - unsigned char *ivec, int *num); -const char *BF_options(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/bn.h b/libs/win32/openssl/include/openssl/bn.h deleted file mode 100644 index 633d1b1f60..0000000000 --- a/libs/win32/openssl/include/openssl/bn.h +++ /dev/null @@ -1,951 +0,0 @@ -/* crypto/bn/bn.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the Eric Young open source - * license provided above. - * - * The binary polynomial arithmetic software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. - * - */ - -#ifndef HEADER_BN_H -# define HEADER_BN_H - -# include -# include -# ifndef OPENSSL_NO_FP_API -# include /* FILE */ -# endif -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * These preprocessor symbols control various aspects of the bignum headers - * and library code. They're not defined by any "normal" configuration, as - * they are intended for development and testing purposes. NB: defining all - * three can be useful for debugging application code as well as openssl - * itself. BN_DEBUG - turn on various debugging alterations to the bignum - * code BN_DEBUG_RAND - uses random poisoning of unused words to trip up - * mismanagement of bignum internals. You must also define BN_DEBUG. - */ -/* #define BN_DEBUG */ -/* #define BN_DEBUG_RAND */ - -# ifndef OPENSSL_SMALL_FOOTPRINT -# define BN_MUL_COMBA -# define BN_SQR_COMBA -# define BN_RECURSION -# endif - -/* - * This next option uses the C libraries (2 word)/(1 word) function. If it is - * not defined, I use my C version (which is slower). The reason for this - * flag is that when the particular C compiler library routine is used, and - * the library is linked with a different compiler, the library is missing. - * This mostly happens when the library is built with gcc and then linked - * using normal cc. This would be a common occurrence because gcc normally - * produces code that is 2 times faster than system compilers for the big - * number stuff. For machines with only one compiler (or shared libraries), - * this should be on. Again this in only really a problem on machines using - * "long long's", are 32bit, and are not using my assembler code. - */ -# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || \ - defined(OPENSSL_SYS_WIN32) || defined(linux) -# ifndef BN_DIV2W -# define BN_DIV2W -# endif -# endif - -/* - * assuming long is 64bit - this is the DEC Alpha unsigned long long is only - * 64 bits :-(, don't define BN_LLONG for the DEC Alpha - */ -# ifdef SIXTY_FOUR_BIT_LONG -# define BN_ULLONG unsigned long long -# define BN_ULONG unsigned long -# define BN_LONG long -# define BN_BITS 128 -# define BN_BYTES 8 -# define BN_BITS2 64 -# define BN_BITS4 32 -# define BN_MASK (0xffffffffffffffffffffffffffffffffLL) -# define BN_MASK2 (0xffffffffffffffffL) -# define BN_MASK2l (0xffffffffL) -# define BN_MASK2h (0xffffffff00000000L) -# define BN_MASK2h1 (0xffffffff80000000L) -# define BN_TBIT (0x8000000000000000L) -# define BN_DEC_CONV (10000000000000000000UL) -# define BN_DEC_FMT1 "%lu" -# define BN_DEC_FMT2 "%019lu" -# define BN_DEC_NUM 19 -# define BN_HEX_FMT1 "%lX" -# define BN_HEX_FMT2 "%016lX" -# endif - -/* - * This is where the long long data type is 64 bits, but long is 32. For - * machines where there are 64bit registers, this is the mode to use. IRIX, - * on R4000 and above should use this mode, along with the relevant assembler - * code :-). Do NOT define BN_LLONG. - */ -# ifdef SIXTY_FOUR_BIT -# undef BN_LLONG -# undef BN_ULLONG -# define BN_ULONG unsigned long long -# define BN_LONG long long -# define BN_BITS 128 -# define BN_BYTES 8 -# define BN_BITS2 64 -# define BN_BITS4 32 -# define BN_MASK2 (0xffffffffffffffffLL) -# define BN_MASK2l (0xffffffffL) -# define BN_MASK2h (0xffffffff00000000LL) -# define BN_MASK2h1 (0xffffffff80000000LL) -# define BN_TBIT (0x8000000000000000LL) -# define BN_DEC_CONV (10000000000000000000ULL) -# define BN_DEC_FMT1 "%llu" -# define BN_DEC_FMT2 "%019llu" -# define BN_DEC_NUM 19 -# define BN_HEX_FMT1 "%llX" -# define BN_HEX_FMT2 "%016llX" -# endif - -# ifdef THIRTY_TWO_BIT -# ifdef BN_LLONG -# if defined(_WIN32) && !defined(__GNUC__) -# define BN_ULLONG unsigned __int64 -# define BN_MASK (0xffffffffffffffffI64) -# else -# define BN_ULLONG unsigned long long -# define BN_MASK (0xffffffffffffffffLL) -# endif -# endif -# define BN_ULONG unsigned int -# define BN_LONG int -# define BN_BITS 64 -# define BN_BYTES 4 -# define BN_BITS2 32 -# define BN_BITS4 16 -# define BN_MASK2 (0xffffffffL) -# define BN_MASK2l (0xffff) -# define BN_MASK2h1 (0xffff8000L) -# define BN_MASK2h (0xffff0000L) -# define BN_TBIT (0x80000000L) -# define BN_DEC_CONV (1000000000L) -# define BN_DEC_FMT1 "%u" -# define BN_DEC_FMT2 "%09u" -# define BN_DEC_NUM 9 -# define BN_HEX_FMT1 "%X" -# define BN_HEX_FMT2 "%08X" -# endif - -# define BN_DEFAULT_BITS 1280 - -# define BN_FLG_MALLOCED 0x01 -# define BN_FLG_STATIC_DATA 0x02 - -/* - * avoid leaking exponent information through timing, - * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime, - * BN_div() will call BN_div_no_branch, - * BN_mod_inverse() will call BN_mod_inverse_no_branch. - */ -# define BN_FLG_CONSTTIME 0x04 - -# ifdef OPENSSL_NO_DEPRECATED -/* deprecated name for the flag */ -# define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME -/* - * avoid leaking exponent information through timings - * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime) - */ -# endif - -# ifndef OPENSSL_NO_DEPRECATED -# define BN_FLG_FREE 0x8000 - /* used for debuging */ -# endif -# define BN_set_flags(b,n) ((b)->flags|=(n)) -# define BN_get_flags(b,n) ((b)->flags&(n)) - -/* - * get a clone of a BIGNUM with changed flags, for *temporary* use only (the - * two BIGNUMs cannot not be used in parallel!) - */ -# define BN_with_flags(dest,b,n) ((dest)->d=(b)->d, \ - (dest)->top=(b)->top, \ - (dest)->dmax=(b)->dmax, \ - (dest)->neg=(b)->neg, \ - (dest)->flags=(((dest)->flags & BN_FLG_MALLOCED) \ - | ((b)->flags & ~BN_FLG_MALLOCED) \ - | BN_FLG_STATIC_DATA \ - | (n))) - -/* Already declared in ossl_typ.h */ -# if 0 -typedef struct bignum_st BIGNUM; -/* Used for temp variables (declaration hidden in bn_lcl.h) */ -typedef struct bignum_ctx BN_CTX; -typedef struct bn_blinding_st BN_BLINDING; -typedef struct bn_mont_ctx_st BN_MONT_CTX; -typedef struct bn_recp_ctx_st BN_RECP_CTX; -typedef struct bn_gencb_st BN_GENCB; -# endif - -struct bignum_st { - BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit - * chunks. */ - int top; /* Index of last used d +1. */ - /* The next are internal book keeping for bn_expand. */ - int dmax; /* Size of the d array. */ - int neg; /* one if the number is negative */ - int flags; -}; - -/* Used for montgomery multiplication */ -struct bn_mont_ctx_st { - int ri; /* number of bits in R */ - BIGNUM RR; /* used to convert to montgomery form */ - BIGNUM N; /* The modulus */ - BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1 (Ni is only - * stored for bignum algorithm) */ - BN_ULONG n0[2]; /* least significant word(s) of Ni; (type - * changed with 0.9.9, was "BN_ULONG n0;" - * before) */ - int flags; -}; - -/* - * Used for reciprocal division/mod functions It cannot be shared between - * threads - */ -struct bn_recp_ctx_st { - BIGNUM N; /* the divisor */ - BIGNUM Nr; /* the reciprocal */ - int num_bits; - int shift; - int flags; -}; - -/* Used for slow "generation" functions. */ -struct bn_gencb_st { - unsigned int ver; /* To handle binary (in)compatibility */ - void *arg; /* callback-specific data */ - union { - /* if(ver==1) - handles old style callbacks */ - void (*cb_1) (int, int, void *); - /* if(ver==2) - new callback style */ - int (*cb_2) (int, int, BN_GENCB *); - } cb; -}; -/* Wrapper function to make using BN_GENCB easier, */ -int BN_GENCB_call(BN_GENCB *cb, int a, int b); -/* Macro to populate a BN_GENCB structure with an "old"-style callback */ -# define BN_GENCB_set_old(gencb, callback, cb_arg) { \ - BN_GENCB *tmp_gencb = (gencb); \ - tmp_gencb->ver = 1; \ - tmp_gencb->arg = (cb_arg); \ - tmp_gencb->cb.cb_1 = (callback); } -/* Macro to populate a BN_GENCB structure with a "new"-style callback */ -# define BN_GENCB_set(gencb, callback, cb_arg) { \ - BN_GENCB *tmp_gencb = (gencb); \ - tmp_gencb->ver = 2; \ - tmp_gencb->arg = (cb_arg); \ - tmp_gencb->cb.cb_2 = (callback); } - -# define BN_prime_checks 0 /* default: select number of iterations based - * on the size of the number */ - -/* - * number of Miller-Rabin iterations for an error rate of less than 2^-80 for - * random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook of - * Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996]; - * original paper: Damgaard, Landrock, Pomerance: Average case error - * estimates for the strong probable prime test. -- Math. Comp. 61 (1993) - * 177-194) - */ -# define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \ - (b) >= 850 ? 3 : \ - (b) >= 650 ? 4 : \ - (b) >= 550 ? 5 : \ - (b) >= 450 ? 6 : \ - (b) >= 400 ? 7 : \ - (b) >= 350 ? 8 : \ - (b) >= 300 ? 9 : \ - (b) >= 250 ? 12 : \ - (b) >= 200 ? 15 : \ - (b) >= 150 ? 18 : \ - /* b >= 100 */ 27) - -# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) - -/* Note that BN_abs_is_word didn't work reliably for w == 0 until 0.9.8 */ -# define BN_abs_is_word(a,w) ((((a)->top == 1) && ((a)->d[0] == (BN_ULONG)(w))) || \ - (((w) == 0) && ((a)->top == 0))) -# define BN_is_zero(a) ((a)->top == 0) -# define BN_is_one(a) (BN_abs_is_word((a),1) && !(a)->neg) -# define BN_is_word(a,w) (BN_abs_is_word((a),(w)) && (!(w) || !(a)->neg)) -# define BN_is_odd(a) (((a)->top > 0) && ((a)->d[0] & 1)) - -# define BN_one(a) (BN_set_word((a),1)) -# define BN_zero_ex(a) \ - do { \ - BIGNUM *_tmp_bn = (a); \ - _tmp_bn->top = 0; \ - _tmp_bn->neg = 0; \ - } while(0) -# ifdef OPENSSL_NO_DEPRECATED -# define BN_zero(a) BN_zero_ex(a) -# else -# define BN_zero(a) (BN_set_word((a),0)) -# endif - -const BIGNUM *BN_value_one(void); -char *BN_options(void); -BN_CTX *BN_CTX_new(void); -# ifndef OPENSSL_NO_DEPRECATED -void BN_CTX_init(BN_CTX *c); -# endif -void BN_CTX_free(BN_CTX *c); -void BN_CTX_start(BN_CTX *ctx); -BIGNUM *BN_CTX_get(BN_CTX *ctx); -void BN_CTX_end(BN_CTX *ctx); -int BN_rand(BIGNUM *rnd, int bits, int top, int bottom); -int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom); -int BN_rand_range(BIGNUM *rnd, const BIGNUM *range); -int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); -int BN_num_bits(const BIGNUM *a); -int BN_num_bits_word(BN_ULONG); -BIGNUM *BN_new(void); -void BN_init(BIGNUM *); -void BN_clear_free(BIGNUM *a); -BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b); -void BN_swap(BIGNUM *a, BIGNUM *b); -BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret); -int BN_bn2bin(const BIGNUM *a, unsigned char *to); -BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret); -int BN_bn2mpi(const BIGNUM *a, unsigned char *to); -int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); -int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); -int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); -int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); -int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); -int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); -/** BN_set_negative sets sign of a BIGNUM - * \param b pointer to the BIGNUM object - * \param n 0 if the BIGNUM b should be positive and a value != 0 otherwise - */ -void BN_set_negative(BIGNUM *b, int n); -/** BN_is_negative returns 1 if the BIGNUM is negative - * \param a pointer to the BIGNUM object - * \return 1 if a < 0 and 0 otherwise - */ -# define BN_is_negative(a) ((a)->neg != 0) - -int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, - BN_CTX *ctx); -# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) -int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); -int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, - BN_CTX *ctx); -int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *m); -int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, - BN_CTX *ctx); -int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *m); -int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, - BN_CTX *ctx); -int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); -int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); -int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m); -int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, - BN_CTX *ctx); -int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m); - -BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w); -BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w); -int BN_mul_word(BIGNUM *a, BN_ULONG w); -int BN_add_word(BIGNUM *a, BN_ULONG w); -int BN_sub_word(BIGNUM *a, BN_ULONG w); -int BN_set_word(BIGNUM *a, BN_ULONG w); -BN_ULONG BN_get_word(const BIGNUM *a); - -int BN_cmp(const BIGNUM *a, const BIGNUM *b); -void BN_free(BIGNUM *a); -int BN_is_bit_set(const BIGNUM *a, int n); -int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); -int BN_lshift1(BIGNUM *r, const BIGNUM *a); -int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); - -int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx); -int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); -int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, - BN_MONT_CTX *in_mont); -int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); -int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1, - const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m, - BN_CTX *ctx, BN_MONT_CTX *m_ctx); -int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx); - -int BN_mask_bits(BIGNUM *a, int n); -# ifndef OPENSSL_NO_FP_API -int BN_print_fp(FILE *fp, const BIGNUM *a); -# endif -# ifdef HEADER_BIO_H -int BN_print(BIO *fp, const BIGNUM *a); -# else -int BN_print(void *fp, const BIGNUM *a); -# endif -int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx); -int BN_rshift(BIGNUM *r, const BIGNUM *a, int n); -int BN_rshift1(BIGNUM *r, const BIGNUM *a); -void BN_clear(BIGNUM *a); -BIGNUM *BN_dup(const BIGNUM *a); -int BN_ucmp(const BIGNUM *a, const BIGNUM *b); -int BN_set_bit(BIGNUM *a, int n); -int BN_clear_bit(BIGNUM *a, int n); -char *BN_bn2hex(const BIGNUM *a); -char *BN_bn2dec(const BIGNUM *a); -int BN_hex2bn(BIGNUM **a, const char *str); -int BN_dec2bn(BIGNUM **a, const char *str); -int BN_asc2bn(BIGNUM **a, const char *str); -int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); -int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); /* returns - * -2 for - * error */ -BIGNUM *BN_mod_inverse(BIGNUM *ret, - const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); -BIGNUM *BN_mod_sqrt(BIGNUM *ret, - const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); - -void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords); - -/* Deprecated versions */ -# ifndef OPENSSL_NO_DEPRECATED -BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe, - const BIGNUM *add, const BIGNUM *rem, - void (*callback) (int, int, void *), void *cb_arg); -int BN_is_prime(const BIGNUM *p, int nchecks, - void (*callback) (int, int, void *), - BN_CTX *ctx, void *cb_arg); -int BN_is_prime_fasttest(const BIGNUM *p, int nchecks, - void (*callback) (int, int, void *), BN_CTX *ctx, - void *cb_arg, int do_trial_division); -# endif /* !defined(OPENSSL_NO_DEPRECATED) */ - -/* Newer versions */ -int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, - const BIGNUM *rem, BN_GENCB *cb); -int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb); -int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, - int do_trial_division, BN_GENCB *cb); - -int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx); - -int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, - const BIGNUM *Xp, const BIGNUM *Xp1, - const BIGNUM *Xp2, const BIGNUM *e, BN_CTX *ctx, - BN_GENCB *cb); -int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1, - BIGNUM *Xp2, const BIGNUM *Xp, const BIGNUM *e, - BN_CTX *ctx, BN_GENCB *cb); - -BN_MONT_CTX *BN_MONT_CTX_new(void); -void BN_MONT_CTX_init(BN_MONT_CTX *ctx); -int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - BN_MONT_CTX *mont, BN_CTX *ctx); -# define BN_to_montgomery(r,a,mont,ctx) BN_mod_mul_montgomery(\ - (r),(a),&((mont)->RR),(mont),(ctx)) -int BN_from_montgomery(BIGNUM *r, const BIGNUM *a, - BN_MONT_CTX *mont, BN_CTX *ctx); -void BN_MONT_CTX_free(BN_MONT_CTX *mont); -int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx); -BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from); -BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, - const BIGNUM *mod, BN_CTX *ctx); - -/* BN_BLINDING flags */ -# define BN_BLINDING_NO_UPDATE 0x00000001 -# define BN_BLINDING_NO_RECREATE 0x00000002 - -BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod); -void BN_BLINDING_free(BN_BLINDING *b); -int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx); -int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); -int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); -int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *); -int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, - BN_CTX *); -# ifndef OPENSSL_NO_DEPRECATED -unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *); -void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long); -# endif -CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *); -unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); -void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); -BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, - const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, - int (*bn_mod_exp) (BIGNUM *r, - const BIGNUM *a, - const BIGNUM *p, - const BIGNUM *m, - BN_CTX *ctx, - BN_MONT_CTX *m_ctx), - BN_MONT_CTX *m_ctx); - -# ifndef OPENSSL_NO_DEPRECATED -void BN_set_params(int mul, int high, int low, int mont); -int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */ -# endif - -void BN_RECP_CTX_init(BN_RECP_CTX *recp); -BN_RECP_CTX *BN_RECP_CTX_new(void); -void BN_RECP_CTX_free(BN_RECP_CTX *recp); -int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx); -int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, - BN_RECP_CTX *recp, BN_CTX *ctx); -int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx); -int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, - BN_RECP_CTX *recp, BN_CTX *ctx); - -# ifndef OPENSSL_NO_EC2M - -/* - * Functions for arithmetic over binary polynomials represented by BIGNUMs. - * The BIGNUM::neg property of BIGNUMs representing binary polynomials is - * ignored. Note that input arguments are not const so that their bit arrays - * can be expanded to the appropriate size if needed. - */ - -/* - * r = a + b - */ -int BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); -# define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b) -/* - * r=a mod p - */ -int BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p); -/* r = (a * b) mod p */ -int BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *p, BN_CTX *ctx); -/* r = (a * a) mod p */ -int BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); -/* r = (1 / b) mod p */ -int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, BN_CTX *ctx); -/* r = (a / b) mod p */ -int BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *p, BN_CTX *ctx); -/* r = (a ^ b) mod p */ -int BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *p, BN_CTX *ctx); -/* r = sqrt(a) mod p */ -int BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx); -/* r^2 + r = a mod p */ -int BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx); -# define BN_GF2m_cmp(a, b) BN_ucmp((a), (b)) -/*- - * Some functions allow for representation of the irreducible polynomials - * as an unsigned int[], say p. The irreducible f(t) is then of the form: - * t^p[0] + t^p[1] + ... + t^p[k] - * where m = p[0] > p[1] > ... > p[k] = 0. - */ -/* r = a mod p */ -int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]); -/* r = (a * b) mod p */ -int BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const int p[], BN_CTX *ctx); -/* r = (a * a) mod p */ -int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], - BN_CTX *ctx); -/* r = (1 / b) mod p */ -int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const int p[], - BN_CTX *ctx); -/* r = (a / b) mod p */ -int BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const int p[], BN_CTX *ctx); -/* r = (a ^ b) mod p */ -int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const int p[], BN_CTX *ctx); -/* r = sqrt(a) mod p */ -int BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a, - const int p[], BN_CTX *ctx); -/* r^2 + r = a mod p */ -int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a, - const int p[], BN_CTX *ctx); -int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max); -int BN_GF2m_arr2poly(const int p[], BIGNUM *a); - -# endif - -/* - * faster mod functions for the 'NIST primes' 0 <= a < p^2 - */ -int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); -int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); -int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); -int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); -int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); - -const BIGNUM *BN_get0_nist_prime_192(void); -const BIGNUM *BN_get0_nist_prime_224(void); -const BIGNUM *BN_get0_nist_prime_256(void); -const BIGNUM *BN_get0_nist_prime_384(void); -const BIGNUM *BN_get0_nist_prime_521(void); - -/* library internal functions */ - -# define bn_expand(a,bits) \ - ( \ - bits > (INT_MAX - BN_BITS2 + 1) ? \ - NULL \ - : \ - (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax) ? \ - (a) \ - : \ - bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2) \ - ) - -# define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words))) -BIGNUM *bn_expand2(BIGNUM *a, int words); -# ifndef OPENSSL_NO_DEPRECATED -BIGNUM *bn_dup_expand(const BIGNUM *a, int words); /* unused */ -# endif - -/*- - * Bignum consistency macros - * There is one "API" macro, bn_fix_top(), for stripping leading zeroes from - * bignum data after direct manipulations on the data. There is also an - * "internal" macro, bn_check_top(), for verifying that there are no leading - * zeroes. Unfortunately, some auditing is required due to the fact that - * bn_fix_top() has become an overabused duct-tape because bignum data is - * occasionally passed around in an inconsistent state. So the following - * changes have been made to sort this out; - * - bn_fix_top()s implementation has been moved to bn_correct_top() - * - if BN_DEBUG isn't defined, bn_fix_top() maps to bn_correct_top(), and - * bn_check_top() is as before. - * - if BN_DEBUG *is* defined; - * - bn_check_top() tries to pollute unused words even if the bignum 'top' is - * consistent. (ed: only if BN_DEBUG_RAND is defined) - * - bn_fix_top() maps to bn_check_top() rather than "fixing" anything. - * The idea is to have debug builds flag up inconsistent bignums when they - * occur. If that occurs in a bn_fix_top(), we examine the code in question; if - * the use of bn_fix_top() was appropriate (ie. it follows directly after code - * that manipulates the bignum) it is converted to bn_correct_top(), and if it - * was not appropriate, we convert it permanently to bn_check_top() and track - * down the cause of the bug. Eventually, no internal code should be using the - * bn_fix_top() macro. External applications and libraries should try this with - * their own code too, both in terms of building against the openssl headers - * with BN_DEBUG defined *and* linking with a version of OpenSSL built with it - * defined. This not only improves external code, it provides more test - * coverage for openssl's own code. - */ - -# ifdef BN_DEBUG - -/* We only need assert() when debugging */ -# include - -# ifdef BN_DEBUG_RAND -/* To avoid "make update" cvs wars due to BN_DEBUG, use some tricks */ -# ifndef RAND_pseudo_bytes -int RAND_pseudo_bytes(unsigned char *buf, int num); -# define BN_DEBUG_TRIX -# endif -# define bn_pollute(a) \ - do { \ - const BIGNUM *_bnum1 = (a); \ - if(_bnum1->top < _bnum1->dmax) { \ - unsigned char _tmp_char; \ - /* We cast away const without the compiler knowing, any \ - * *genuinely* constant variables that aren't mutable \ - * wouldn't be constructed with top!=dmax. */ \ - BN_ULONG *_not_const; \ - memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \ - /* Debug only - safe to ignore error return */ \ - RAND_pseudo_bytes(&_tmp_char, 1); \ - memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \ - (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \ - } \ - } while(0) -# ifdef BN_DEBUG_TRIX -# undef RAND_pseudo_bytes -# endif -# else -# define bn_pollute(a) -# endif -# define bn_check_top(a) \ - do { \ - const BIGNUM *_bnum2 = (a); \ - if (_bnum2 != NULL) { \ - assert((_bnum2->top == 0) || \ - (_bnum2->d[_bnum2->top - 1] != 0)); \ - bn_pollute(_bnum2); \ - } \ - } while(0) - -# define bn_fix_top(a) bn_check_top(a) - -# define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2) -# define bn_wcheck_size(bn, words) \ - do { \ - const BIGNUM *_bnum2 = (bn); \ - assert((words) <= (_bnum2)->dmax && (words) >= (_bnum2)->top); \ - /* avoid unused variable warning with NDEBUG */ \ - (void)(_bnum2); \ - } while(0) - -# else /* !BN_DEBUG */ - -# define bn_pollute(a) -# define bn_check_top(a) -# define bn_fix_top(a) bn_correct_top(a) -# define bn_check_size(bn, bits) -# define bn_wcheck_size(bn, words) - -# endif - -# define bn_correct_top(a) \ - { \ - BN_ULONG *ftl; \ - int tmp_top = (a)->top; \ - if (tmp_top > 0) \ - { \ - for (ftl= &((a)->d[tmp_top-1]); tmp_top > 0; tmp_top--) \ - if (*(ftl--)) break; \ - (a)->top = tmp_top; \ - } \ - if ((a)->top == 0) \ - (a)->neg = 0; \ - bn_pollute(a); \ - } - -BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, - BN_ULONG w); -BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w); -void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, int num); -BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d); -BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, - int num); -BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, - int num); - -/* Primes from RFC 2409 */ -BIGNUM *get_rfc2409_prime_768(BIGNUM *bn); -BIGNUM *get_rfc2409_prime_1024(BIGNUM *bn); - -/* Primes from RFC 3526 */ -BIGNUM *get_rfc3526_prime_1536(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_2048(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_3072(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_4096(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_6144(BIGNUM *bn); -BIGNUM *get_rfc3526_prime_8192(BIGNUM *bn); - -int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_BN_strings(void); - -/* Error codes for the BN functions. */ - -/* Function codes. */ -# define BN_F_BNRAND 127 -# define BN_F_BN_BLINDING_CONVERT_EX 100 -# define BN_F_BN_BLINDING_CREATE_PARAM 128 -# define BN_F_BN_BLINDING_INVERT_EX 101 -# define BN_F_BN_BLINDING_NEW 102 -# define BN_F_BN_BLINDING_UPDATE 103 -# define BN_F_BN_BN2DEC 104 -# define BN_F_BN_BN2HEX 105 -# define BN_F_BN_CTX_GET 116 -# define BN_F_BN_CTX_NEW 106 -# define BN_F_BN_CTX_START 129 -# define BN_F_BN_DIV 107 -# define BN_F_BN_DIV_NO_BRANCH 138 -# define BN_F_BN_DIV_RECP 130 -# define BN_F_BN_EXP 123 -# define BN_F_BN_EXPAND2 108 -# define BN_F_BN_EXPAND_INTERNAL 120 -# define BN_F_BN_GF2M_MOD 131 -# define BN_F_BN_GF2M_MOD_EXP 132 -# define BN_F_BN_GF2M_MOD_MUL 133 -# define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134 -# define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135 -# define BN_F_BN_GF2M_MOD_SQR 136 -# define BN_F_BN_GF2M_MOD_SQRT 137 -# define BN_F_BN_LSHIFT 145 -# define BN_F_BN_MOD_EXP2_MONT 118 -# define BN_F_BN_MOD_EXP_MONT 109 -# define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124 -# define BN_F_BN_MOD_EXP_MONT_WORD 117 -# define BN_F_BN_MOD_EXP_RECP 125 -# define BN_F_BN_MOD_EXP_SIMPLE 126 -# define BN_F_BN_MOD_INVERSE 110 -# define BN_F_BN_MOD_INVERSE_NO_BRANCH 139 -# define BN_F_BN_MOD_LSHIFT_QUICK 119 -# define BN_F_BN_MOD_MUL_RECIPROCAL 111 -# define BN_F_BN_MOD_SQRT 121 -# define BN_F_BN_MPI2BN 112 -# define BN_F_BN_NEW 113 -# define BN_F_BN_RAND 114 -# define BN_F_BN_RAND_RANGE 122 -# define BN_F_BN_RSHIFT 146 -# define BN_F_BN_USUB 115 - -/* Reason codes. */ -# define BN_R_ARG2_LT_ARG3 100 -# define BN_R_BAD_RECIPROCAL 101 -# define BN_R_BIGNUM_TOO_LONG 114 -# define BN_R_BITS_TOO_SMALL 118 -# define BN_R_CALLED_WITH_EVEN_MODULUS 102 -# define BN_R_DIV_BY_ZERO 103 -# define BN_R_ENCODING_ERROR 104 -# define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105 -# define BN_R_INPUT_NOT_REDUCED 110 -# define BN_R_INVALID_LENGTH 106 -# define BN_R_INVALID_RANGE 115 -# define BN_R_INVALID_SHIFT 119 -# define BN_R_NOT_A_SQUARE 111 -# define BN_R_NOT_INITIALIZED 107 -# define BN_R_NO_INVERSE 108 -# define BN_R_NO_SOLUTION 116 -# define BN_R_P_IS_NOT_PRIME 112 -# define BN_R_TOO_MANY_ITERATIONS 113 -# define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/buffer.h b/libs/win32/openssl/include/openssl/buffer.h deleted file mode 100644 index efd240a5f9..0000000000 --- a/libs/win32/openssl/include/openssl/buffer.h +++ /dev/null @@ -1,125 +0,0 @@ -/* crypto/buffer/buffer.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_BUFFER_H -# define HEADER_BUFFER_H - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# include - -# if !defined(NO_SYS_TYPES_H) -# include -# endif - -/* Already declared in ossl_typ.h */ -/* typedef struct buf_mem_st BUF_MEM; */ - -struct buf_mem_st { - size_t length; /* current number of bytes */ - char *data; - size_t max; /* size of buffer */ -}; - -BUF_MEM *BUF_MEM_new(void); -void BUF_MEM_free(BUF_MEM *a); -int BUF_MEM_grow(BUF_MEM *str, size_t len); -int BUF_MEM_grow_clean(BUF_MEM *str, size_t len); -size_t BUF_strnlen(const char *str, size_t maxlen); -char *BUF_strdup(const char *str); - -/* - * Like strndup, but in addition, explicitly guarantees to never read past the - * first |siz| bytes of |str|. - */ -char *BUF_strndup(const char *str, size_t siz); - -void *BUF_memdup(const void *data, size_t siz); -void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); - -/* safe string functions */ -size_t BUF_strlcpy(char *dst, const char *src, size_t siz); -size_t BUF_strlcat(char *dst, const char *src, size_t siz); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_BUF_strings(void); - -/* Error codes for the BUF functions. */ - -/* Function codes. */ -# define BUF_F_BUF_MEMDUP 103 -# define BUF_F_BUF_MEM_GROW 100 -# define BUF_F_BUF_MEM_GROW_CLEAN 105 -# define BUF_F_BUF_MEM_NEW 101 -# define BUF_F_BUF_STRDUP 102 -# define BUF_F_BUF_STRNDUP 104 - -/* Reason codes. */ - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/camellia.h b/libs/win32/openssl/include/openssl/camellia.h deleted file mode 100644 index 45e8d25b1d..0000000000 --- a/libs/win32/openssl/include/openssl/camellia.h +++ /dev/null @@ -1,132 +0,0 @@ -/* crypto/camellia/camellia.h */ -/* ==================================================================== - * Copyright (c) 2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - */ - -#ifndef HEADER_CAMELLIA_H -# define HEADER_CAMELLIA_H - -# include - -# ifdef OPENSSL_NO_CAMELLIA -# error CAMELLIA is disabled. -# endif - -# include - -# define CAMELLIA_ENCRYPT 1 -# define CAMELLIA_DECRYPT 0 - -/* - * Because array size can't be a const in C, the following two are macros. - * Both sizes are in bytes. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* This should be a hidden type, but EVP requires that the size be known */ - -# define CAMELLIA_BLOCK_SIZE 16 -# define CAMELLIA_TABLE_BYTE_LEN 272 -# define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4) - -typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match - * with WORD */ - -struct camellia_key_st { - union { - double d; /* ensures 64-bit align */ - KEY_TABLE_TYPE rd_key; - } u; - int grand_rounds; -}; -typedef struct camellia_key_st CAMELLIA_KEY; - -# ifdef OPENSSL_FIPS -int private_Camellia_set_key(const unsigned char *userKey, const int bits, - CAMELLIA_KEY *key); -# endif -int Camellia_set_key(const unsigned char *userKey, const int bits, - CAMELLIA_KEY *key); - -void Camellia_encrypt(const unsigned char *in, unsigned char *out, - const CAMELLIA_KEY *key); -void Camellia_decrypt(const unsigned char *in, unsigned char *out, - const CAMELLIA_KEY *key); - -void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out, - const CAMELLIA_KEY *key, const int enc); -void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const CAMELLIA_KEY *key, - unsigned char *ivec, const int enc); -void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const CAMELLIA_KEY *key, - unsigned char *ivec, int *num, const int enc); -void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const CAMELLIA_KEY *key, - unsigned char *ivec, int *num, const int enc); -void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const CAMELLIA_KEY *key, - unsigned char *ivec, int *num, const int enc); -void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const CAMELLIA_KEY *key, - unsigned char *ivec, int *num); -void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const CAMELLIA_KEY *key, - unsigned char ivec[CAMELLIA_BLOCK_SIZE], - unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE], - unsigned int *num); - -#ifdef __cplusplus -} -#endif - -#endif /* !HEADER_Camellia_H */ diff --git a/libs/win32/openssl/include/openssl/cast.h b/libs/win32/openssl/include/openssl/cast.h deleted file mode 100644 index 0003ec9c7c..0000000000 --- a/libs/win32/openssl/include/openssl/cast.h +++ /dev/null @@ -1,107 +0,0 @@ -/* crypto/cast/cast.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_CAST_H -# define HEADER_CAST_H - -#ifdef __cplusplus -extern "C" { -#endif - -# include - -# ifdef OPENSSL_NO_CAST -# error CAST is disabled. -# endif - -# define CAST_ENCRYPT 1 -# define CAST_DECRYPT 0 - -# define CAST_LONG unsigned int - -# define CAST_BLOCK 8 -# define CAST_KEY_LENGTH 16 - -typedef struct cast_key_st { - CAST_LONG data[32]; - int short_key; /* Use reduced rounds for short key */ -} CAST_KEY; - -# ifdef OPENSSL_FIPS -void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); -# endif -void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); -void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, - const CAST_KEY *key, int enc); -void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); -void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); -void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, - long length, const CAST_KEY *ks, unsigned char *iv, - int enc); -void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, const CAST_KEY *schedule, - unsigned char *ivec, int *num, int enc); -void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, const CAST_KEY *schedule, - unsigned char *ivec, int *num); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/cmac.h b/libs/win32/openssl/include/openssl/cmac.h deleted file mode 100644 index 175be8348a..0000000000 --- a/libs/win32/openssl/include/openssl/cmac.h +++ /dev/null @@ -1,82 +0,0 @@ -/* crypto/cmac/cmac.h */ -/* - * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL - * project. - */ -/* ==================================================================== - * Copyright (c) 2010 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -#ifndef HEADER_CMAC_H -# define HEADER_CMAC_H - -#ifdef __cplusplus -extern "C" { -#endif - -# include - -/* Opaque */ -typedef struct CMAC_CTX_st CMAC_CTX; - -CMAC_CTX *CMAC_CTX_new(void); -void CMAC_CTX_cleanup(CMAC_CTX *ctx); -void CMAC_CTX_free(CMAC_CTX *ctx); -EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); -int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); - -int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, - const EVP_CIPHER *cipher, ENGINE *impl); -int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); -int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); -int CMAC_resume(CMAC_CTX *ctx); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/cms.h b/libs/win32/openssl/include/openssl/cms.h deleted file mode 100644 index e6c7f964bf..0000000000 --- a/libs/win32/openssl/include/openssl/cms.h +++ /dev/null @@ -1,555 +0,0 @@ -/* crypto/cms/cms.h */ -/* - * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL - * project. - */ -/* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -#ifndef HEADER_CMS_H -# define HEADER_CMS_H - -# include - -# ifdef OPENSSL_NO_CMS -# error CMS is disabled. -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct CMS_ContentInfo_st CMS_ContentInfo; -typedef struct CMS_SignerInfo_st CMS_SignerInfo; -typedef struct CMS_CertificateChoices CMS_CertificateChoices; -typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice; -typedef struct CMS_RecipientInfo_st CMS_RecipientInfo; -typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest; -typedef struct CMS_Receipt_st CMS_Receipt; -typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey; -typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute; - -DECLARE_STACK_OF(CMS_SignerInfo) -DECLARE_STACK_OF(GENERAL_NAMES) -DECLARE_STACK_OF(CMS_RecipientEncryptedKey) -DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo) -DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest) -DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo) - -# define CMS_SIGNERINFO_ISSUER_SERIAL 0 -# define CMS_SIGNERINFO_KEYIDENTIFIER 1 - -# define CMS_RECIPINFO_NONE -1 -# define CMS_RECIPINFO_TRANS 0 -# define CMS_RECIPINFO_AGREE 1 -# define CMS_RECIPINFO_KEK 2 -# define CMS_RECIPINFO_PASS 3 -# define CMS_RECIPINFO_OTHER 4 - -/* S/MIME related flags */ - -# define CMS_TEXT 0x1 -# define CMS_NOCERTS 0x2 -# define CMS_NO_CONTENT_VERIFY 0x4 -# define CMS_NO_ATTR_VERIFY 0x8 -# define CMS_NOSIGS \ - (CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY) -# define CMS_NOINTERN 0x10 -# define CMS_NO_SIGNER_CERT_VERIFY 0x20 -# define CMS_NOVERIFY 0x20 -# define CMS_DETACHED 0x40 -# define CMS_BINARY 0x80 -# define CMS_NOATTR 0x100 -# define CMS_NOSMIMECAP 0x200 -# define CMS_NOOLDMIMETYPE 0x400 -# define CMS_CRLFEOL 0x800 -# define CMS_STREAM 0x1000 -# define CMS_NOCRL 0x2000 -# define CMS_PARTIAL 0x4000 -# define CMS_REUSE_DIGEST 0x8000 -# define CMS_USE_KEYID 0x10000 -# define CMS_DEBUG_DECRYPT 0x20000 -# define CMS_KEY_PARAM 0x40000 - -const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms); - -BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont); -int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio); - -ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms); -int CMS_is_detached(CMS_ContentInfo *cms); -int CMS_set_detached(CMS_ContentInfo *cms, int detached); - -# ifdef HEADER_PEM_H -DECLARE_PEM_rw_const(CMS, CMS_ContentInfo) -# endif -int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms); -CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms); -int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms); - -BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms); -int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags); -int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, - int flags); -CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont); -int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags); - -int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, - unsigned int flags); - -CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, - STACK_OF(X509) *certs, BIO *data, - unsigned int flags); - -CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, - X509 *signcert, EVP_PKEY *pkey, - STACK_OF(X509) *certs, unsigned int flags); - -int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags); -CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags); - -int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out, - unsigned int flags); -CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md, - unsigned int flags); - -int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms, - const unsigned char *key, size_t keylen, - BIO *dcont, BIO *out, unsigned int flags); - -CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher, - const unsigned char *key, - size_t keylen, unsigned int flags); - -int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph, - const unsigned char *key, size_t keylen); - -int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, - X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags); - -int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms, - STACK_OF(X509) *certs, - X509_STORE *store, unsigned int flags); - -STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); - -CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in, - const EVP_CIPHER *cipher, unsigned int flags); - -int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert, - BIO *dcont, BIO *out, unsigned int flags); - -int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert); -int CMS_decrypt_set1_key(CMS_ContentInfo *cms, - unsigned char *key, size_t keylen, - unsigned char *id, size_t idlen); -int CMS_decrypt_set1_password(CMS_ContentInfo *cms, - unsigned char *pass, ossl_ssize_t passlen); - -STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); -int CMS_RecipientInfo_type(CMS_RecipientInfo *ri); -EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri); -CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher); -CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, - X509 *recip, unsigned int flags); -int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey); -int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert); -int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri, - EVP_PKEY **pk, X509 **recip, - X509_ALGOR **palg); -int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri, - ASN1_OCTET_STRING **keyid, - X509_NAME **issuer, - ASN1_INTEGER **sno); - -CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, - unsigned char *key, size_t keylen, - unsigned char *id, size_t idlen, - ASN1_GENERALIZEDTIME *date, - ASN1_OBJECT *otherTypeId, - ASN1_TYPE *otherType); - -int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, - X509_ALGOR **palg, - ASN1_OCTET_STRING **pid, - ASN1_GENERALIZEDTIME **pdate, - ASN1_OBJECT **potherid, - ASN1_TYPE **pothertype); - -int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri, - unsigned char *key, size_t keylen); - -int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri, - const unsigned char *id, size_t idlen); - -int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri, - unsigned char *pass, - ossl_ssize_t passlen); - -CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms, - int iter, int wrap_nid, - int pbe_nid, - unsigned char *pass, - ossl_ssize_t passlen, - const EVP_CIPHER *kekciph); - -int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); -int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); - -int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, - unsigned int flags); -CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags); - -int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid); -const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms); - -CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms); -int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert); -int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert); -STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); - -CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms); -int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl); -int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl); -STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); - -int CMS_SignedData_init(CMS_ContentInfo *cms); -CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, - X509 *signer, EVP_PKEY *pk, const EVP_MD *md, - unsigned int flags); -EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si); -EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si); -STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); - -void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer); -int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, - ASN1_OCTET_STRING **keyid, - X509_NAME **issuer, ASN1_INTEGER **sno); -int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert); -int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs, - unsigned int flags); -void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, - X509 **signer, X509_ALGOR **pdig, - X509_ALGOR **psig); -ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si); -int CMS_SignerInfo_sign(CMS_SignerInfo *si); -int CMS_SignerInfo_verify(CMS_SignerInfo *si); -int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain); - -int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs); -int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs, - int algnid, int keysize); -int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap); - -int CMS_signed_get_attr_count(const CMS_SignerInfo *si); -int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, - int lastpos); -int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj, - int lastpos); -X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc); -X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc); -int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); -int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si, - const ASN1_OBJECT *obj, int type, - const void *bytes, int len); -int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si, - int nid, int type, - const void *bytes, int len); -int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si, - const char *attrname, int type, - const void *bytes, int len); -void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid, - int lastpos, int type); - -int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si); -int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid, - int lastpos); -int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj, - int lastpos); -X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc); -X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc); -int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); -int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si, - const ASN1_OBJECT *obj, int type, - const void *bytes, int len); -int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si, - int nid, int type, - const void *bytes, int len); -int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si, - const char *attrname, int type, - const void *bytes, int len); -void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid, - int lastpos, int type); - -# ifdef HEADER_X509V3_H - -int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr); -CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen, - int allorfirst, - STACK_OF(GENERAL_NAMES) - *receiptList, STACK_OF(GENERAL_NAMES) - *receiptsTo); -int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr); -void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, - ASN1_STRING **pcid, - int *pallorfirst, - STACK_OF(GENERAL_NAMES) **plist, - STACK_OF(GENERAL_NAMES) **prto); -# endif -int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri, - X509_ALGOR **palg, - ASN1_OCTET_STRING **pukm); -STACK_OF(CMS_RecipientEncryptedKey) -*CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri); - -int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri, - X509_ALGOR **pubalg, - ASN1_BIT_STRING **pubkey, - ASN1_OCTET_STRING **keyid, - X509_NAME **issuer, - ASN1_INTEGER **sno); - -int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert); - -int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek, - ASN1_OCTET_STRING **keyid, - ASN1_GENERALIZEDTIME **tm, - CMS_OtherKeyAttribute **other, - X509_NAME **issuer, ASN1_INTEGER **sno); -int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek, - X509 *cert); -int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk); -EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri); -int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms, - CMS_RecipientInfo *ri, - CMS_RecipientEncryptedKey *rek); - -int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg, - ASN1_OCTET_STRING *ukm, int keylen); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_CMS_strings(void); - -/* Error codes for the CMS functions. */ - -/* Function codes. */ -# define CMS_F_CHECK_CONTENT 99 -# define CMS_F_CMS_ADD0_CERT 164 -# define CMS_F_CMS_ADD0_RECIPIENT_KEY 100 -# define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 165 -# define CMS_F_CMS_ADD1_RECEIPTREQUEST 158 -# define CMS_F_CMS_ADD1_RECIPIENT_CERT 101 -# define CMS_F_CMS_ADD1_SIGNER 102 -# define CMS_F_CMS_ADD1_SIGNINGTIME 103 -# define CMS_F_CMS_COMPRESS 104 -# define CMS_F_CMS_COMPRESSEDDATA_CREATE 105 -# define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO 106 -# define CMS_F_CMS_COPY_CONTENT 107 -# define CMS_F_CMS_COPY_MESSAGEDIGEST 108 -# define CMS_F_CMS_DATA 109 -# define CMS_F_CMS_DATAFINAL 110 -# define CMS_F_CMS_DATAINIT 111 -# define CMS_F_CMS_DECRYPT 112 -# define CMS_F_CMS_DECRYPT_SET1_KEY 113 -# define CMS_F_CMS_DECRYPT_SET1_PASSWORD 166 -# define CMS_F_CMS_DECRYPT_SET1_PKEY 114 -# define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 115 -# define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 116 -# define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 117 -# define CMS_F_CMS_DIGEST_VERIFY 118 -# define CMS_F_CMS_ENCODE_RECEIPT 161 -# define CMS_F_CMS_ENCRYPT 119 -# define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 120 -# define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 121 -# define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 122 -# define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 123 -# define CMS_F_CMS_ENVELOPEDDATA_CREATE 124 -# define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 125 -# define CMS_F_CMS_ENVELOPED_DATA_INIT 126 -# define CMS_F_CMS_ENV_ASN1_CTRL 171 -# define CMS_F_CMS_FINAL 127 -# define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 128 -# define CMS_F_CMS_GET0_CONTENT 129 -# define CMS_F_CMS_GET0_ECONTENT_TYPE 130 -# define CMS_F_CMS_GET0_ENVELOPED 131 -# define CMS_F_CMS_GET0_REVOCATION_CHOICES 132 -# define CMS_F_CMS_GET0_SIGNED 133 -# define CMS_F_CMS_MSGSIGDIGEST_ADD1 162 -# define CMS_F_CMS_RECEIPTREQUEST_CREATE0 159 -# define CMS_F_CMS_RECEIPT_VERIFY 160 -# define CMS_F_CMS_RECIPIENTINFO_DECRYPT 134 -# define CMS_F_CMS_RECIPIENTINFO_ENCRYPT 169 -# define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT 178 -# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG 175 -# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID 173 -# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS 172 -# define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP 174 -# define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 135 -# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 136 -# define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 137 -# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP 138 -# define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP 139 -# define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT 140 -# define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 141 -# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 142 -# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 143 -# define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT 167 -# define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 144 -# define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 168 -# define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 145 -# define CMS_F_CMS_SD_ASN1_CTRL 170 -# define CMS_F_CMS_SET1_IAS 176 -# define CMS_F_CMS_SET1_KEYID 177 -# define CMS_F_CMS_SET1_SIGNERIDENTIFIER 146 -# define CMS_F_CMS_SET_DETACHED 147 -# define CMS_F_CMS_SIGN 148 -# define CMS_F_CMS_SIGNED_DATA_INIT 149 -# define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN 150 -# define CMS_F_CMS_SIGNERINFO_SIGN 151 -# define CMS_F_CMS_SIGNERINFO_VERIFY 152 -# define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 153 -# define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 154 -# define CMS_F_CMS_SIGN_RECEIPT 163 -# define CMS_F_CMS_STREAM 155 -# define CMS_F_CMS_UNCOMPRESS 156 -# define CMS_F_CMS_VERIFY 157 - -/* Reason codes. */ -# define CMS_R_ADD_SIGNER_ERROR 99 -# define CMS_R_CERTIFICATE_ALREADY_PRESENT 175 -# define CMS_R_CERTIFICATE_HAS_NO_KEYID 160 -# define CMS_R_CERTIFICATE_VERIFY_ERROR 100 -# define CMS_R_CIPHER_INITIALISATION_ERROR 101 -# define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102 -# define CMS_R_CMS_DATAFINAL_ERROR 103 -# define CMS_R_CMS_LIB 104 -# define CMS_R_CONTENTIDENTIFIER_MISMATCH 170 -# define CMS_R_CONTENT_NOT_FOUND 105 -# define CMS_R_CONTENT_TYPE_MISMATCH 171 -# define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106 -# define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107 -# define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108 -# define CMS_R_CONTENT_VERIFY_ERROR 109 -# define CMS_R_CTRL_ERROR 110 -# define CMS_R_CTRL_FAILURE 111 -# define CMS_R_DECRYPT_ERROR 112 -# define CMS_R_DIGEST_ERROR 161 -# define CMS_R_ERROR_GETTING_PUBLIC_KEY 113 -# define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114 -# define CMS_R_ERROR_SETTING_KEY 115 -# define CMS_R_ERROR_SETTING_RECIPIENTINFO 116 -# define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117 -# define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176 -# define CMS_R_INVALID_KEY_LENGTH 118 -# define CMS_R_MD_BIO_INIT_ERROR 119 -# define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120 -# define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121 -# define CMS_R_MSGSIGDIGEST_ERROR 172 -# define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162 -# define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163 -# define CMS_R_NEED_ONE_SIGNER 164 -# define CMS_R_NOT_A_SIGNED_RECEIPT 165 -# define CMS_R_NOT_ENCRYPTED_DATA 122 -# define CMS_R_NOT_KEK 123 -# define CMS_R_NOT_KEY_AGREEMENT 181 -# define CMS_R_NOT_KEY_TRANSPORT 124 -# define CMS_R_NOT_PWRI 177 -# define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125 -# define CMS_R_NO_CIPHER 126 -# define CMS_R_NO_CONTENT 127 -# define CMS_R_NO_CONTENT_TYPE 173 -# define CMS_R_NO_DEFAULT_DIGEST 128 -# define CMS_R_NO_DIGEST_SET 129 -# define CMS_R_NO_KEY 130 -# define CMS_R_NO_KEY_OR_CERT 174 -# define CMS_R_NO_MATCHING_DIGEST 131 -# define CMS_R_NO_MATCHING_RECIPIENT 132 -# define CMS_R_NO_MATCHING_SIGNATURE 166 -# define CMS_R_NO_MSGSIGDIGEST 167 -# define CMS_R_NO_PASSWORD 178 -# define CMS_R_NO_PRIVATE_KEY 133 -# define CMS_R_NO_PUBLIC_KEY 134 -# define CMS_R_NO_RECEIPT_REQUEST 168 -# define CMS_R_NO_SIGNERS 135 -# define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136 -# define CMS_R_RECEIPT_DECODE_ERROR 169 -# define CMS_R_RECIPIENT_ERROR 137 -# define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138 -# define CMS_R_SIGNFINAL_ERROR 139 -# define CMS_R_SMIME_TEXT_ERROR 140 -# define CMS_R_STORE_INIT_ERROR 141 -# define CMS_R_TYPE_NOT_COMPRESSED_DATA 142 -# define CMS_R_TYPE_NOT_DATA 143 -# define CMS_R_TYPE_NOT_DIGESTED_DATA 144 -# define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145 -# define CMS_R_TYPE_NOT_ENVELOPED_DATA 146 -# define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147 -# define CMS_R_UNKNOWN_CIPHER 148 -# define CMS_R_UNKNOWN_DIGEST_ALGORIHM 149 -# define CMS_R_UNKNOWN_ID 150 -# define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151 -# define CMS_R_UNSUPPORTED_CONTENT_TYPE 152 -# define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153 -# define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179 -# define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154 -# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE 155 -# define CMS_R_UNSUPPORTED_TYPE 156 -# define CMS_R_UNWRAP_ERROR 157 -# define CMS_R_UNWRAP_FAILURE 180 -# define CMS_R_VERIFICATION_FAILURE 158 -# define CMS_R_WRAP_ERROR 159 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/comp.h b/libs/win32/openssl/include/openssl/comp.h deleted file mode 100644 index df599ba331..0000000000 --- a/libs/win32/openssl/include/openssl/comp.h +++ /dev/null @@ -1,83 +0,0 @@ - -#ifndef HEADER_COMP_H -# define HEADER_COMP_H - -# include - -# ifdef OPENSSL_NO_COMP -# error COMP is disabled. -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct comp_ctx_st COMP_CTX; - -struct comp_method_st { - int type; /* NID for compression library */ - const char *name; /* A text string to identify the library */ - int (*init) (COMP_CTX *ctx); - void (*finish) (COMP_CTX *ctx); - int (*compress) (COMP_CTX *ctx, - unsigned char *out, unsigned int olen, - unsigned char *in, unsigned int ilen); - int (*expand) (COMP_CTX *ctx, - unsigned char *out, unsigned int olen, - unsigned char *in, unsigned int ilen); - /* - * The following two do NOTHING, but are kept for backward compatibility - */ - long (*ctrl) (void); - long (*callback_ctrl) (void); -}; - -struct comp_ctx_st { - COMP_METHOD *meth; - unsigned long compress_in; - unsigned long compress_out; - unsigned long expand_in; - unsigned long expand_out; - CRYPTO_EX_DATA ex_data; -}; - -COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); -void COMP_CTX_free(COMP_CTX *ctx); -int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, - unsigned char *in, int ilen); -int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, - unsigned char *in, int ilen); -COMP_METHOD *COMP_rle(void); -COMP_METHOD *COMP_zlib(void); -void COMP_zlib_cleanup(void); - -# ifdef HEADER_BIO_H -# ifdef ZLIB -BIO_METHOD *BIO_f_zlib(void); -# endif -# endif - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_COMP_strings(void); - -/* Error codes for the COMP functions. */ - -/* Function codes. */ -# define COMP_F_BIO_ZLIB_FLUSH 99 -# define COMP_F_BIO_ZLIB_NEW 100 -# define COMP_F_BIO_ZLIB_READ 101 -# define COMP_F_BIO_ZLIB_WRITE 102 - -/* Reason codes. */ -# define COMP_R_ZLIB_DEFLATE_ERROR 99 -# define COMP_R_ZLIB_INFLATE_ERROR 100 -# define COMP_R_ZLIB_NOT_SUPPORTED 101 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/conf.h b/libs/win32/openssl/include/openssl/conf.h deleted file mode 100644 index 8d926d5d82..0000000000 --- a/libs/win32/openssl/include/openssl/conf.h +++ /dev/null @@ -1,267 +0,0 @@ -/* crypto/conf/conf.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_CONF_H -# define HEADER_CONF_H - -# include -# include -# include -# include -# include - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - char *section; - char *name; - char *value; -} CONF_VALUE; - -DECLARE_STACK_OF(CONF_VALUE) -DECLARE_LHASH_OF(CONF_VALUE); - -struct conf_st; -struct conf_method_st; -typedef struct conf_method_st CONF_METHOD; - -struct conf_method_st { - const char *name; - CONF *(*create) (CONF_METHOD *meth); - int (*init) (CONF *conf); - int (*destroy) (CONF *conf); - int (*destroy_data) (CONF *conf); - int (*load_bio) (CONF *conf, BIO *bp, long *eline); - int (*dump) (const CONF *conf, BIO *bp); - int (*is_number) (const CONF *conf, char c); - int (*to_int) (const CONF *conf, char c); - int (*load) (CONF *conf, const char *name, long *eline); -}; - -/* Module definitions */ - -typedef struct conf_imodule_st CONF_IMODULE; -typedef struct conf_module_st CONF_MODULE; - -DECLARE_STACK_OF(CONF_MODULE) -DECLARE_STACK_OF(CONF_IMODULE) - -/* DSO module function typedefs */ -typedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf); -typedef void conf_finish_func (CONF_IMODULE *md); - -# define CONF_MFLAGS_IGNORE_ERRORS 0x1 -# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2 -# define CONF_MFLAGS_SILENT 0x4 -# define CONF_MFLAGS_NO_DSO 0x8 -# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10 -# define CONF_MFLAGS_DEFAULT_SECTION 0x20 - -int CONF_set_default_method(CONF_METHOD *meth); -void CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash); -LHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, - long *eline); -# ifndef OPENSSL_NO_FP_API -LHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, - long *eline); -# endif -LHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, - long *eline); -STACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf, - const char *section); -char *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, - const char *name); -long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, - const char *name); -void CONF_free(LHASH_OF(CONF_VALUE) *conf); -int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out); -int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out); - -void OPENSSL_config(const char *config_name); -void OPENSSL_no_config(void); - -/* - * New conf code. The semantics are different from the functions above. If - * that wasn't the case, the above functions would have been replaced - */ - -struct conf_st { - CONF_METHOD *meth; - void *meth_data; - LHASH_OF(CONF_VALUE) *data; -}; - -CONF *NCONF_new(CONF_METHOD *meth); -CONF_METHOD *NCONF_default(void); -CONF_METHOD *NCONF_WIN32(void); -# if 0 /* Just to give you an idea of what I have in - * mind */ -CONF_METHOD *NCONF_XML(void); -# endif -void NCONF_free(CONF *conf); -void NCONF_free_data(CONF *conf); - -int NCONF_load(CONF *conf, const char *file, long *eline); -# ifndef OPENSSL_NO_FP_API -int NCONF_load_fp(CONF *conf, FILE *fp, long *eline); -# endif -int NCONF_load_bio(CONF *conf, BIO *bp, long *eline); -STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, - const char *section); -char *NCONF_get_string(const CONF *conf, const char *group, const char *name); -int NCONF_get_number_e(const CONF *conf, const char *group, const char *name, - long *result); -int NCONF_dump_fp(const CONF *conf, FILE *out); -int NCONF_dump_bio(const CONF *conf, BIO *out); - -# if 0 /* The following function has no error - * checking, and should therefore be avoided */ -long NCONF_get_number(CONF *conf, char *group, char *name); -# else -# define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r) -# endif - -/* Module functions */ - -int CONF_modules_load(const CONF *cnf, const char *appname, - unsigned long flags); -int CONF_modules_load_file(const char *filename, const char *appname, - unsigned long flags); -void CONF_modules_unload(int all); -void CONF_modules_finish(void); -void CONF_modules_free(void); -int CONF_module_add(const char *name, conf_init_func *ifunc, - conf_finish_func *ffunc); - -const char *CONF_imodule_get_name(const CONF_IMODULE *md); -const char *CONF_imodule_get_value(const CONF_IMODULE *md); -void *CONF_imodule_get_usr_data(const CONF_IMODULE *md); -void CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data); -CONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md); -unsigned long CONF_imodule_get_flags(const CONF_IMODULE *md); -void CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags); -void *CONF_module_get_usr_data(CONF_MODULE *pmod); -void CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data); - -char *CONF_get1_default_config_file(void); - -int CONF_parse_list(const char *list, int sep, int nospc, - int (*list_cb) (const char *elem, int len, void *usr), - void *arg); - -void OPENSSL_load_builtin_modules(void); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_CONF_strings(void); - -/* Error codes for the CONF functions. */ - -/* Function codes. */ -# define CONF_F_CONF_DUMP_FP 104 -# define CONF_F_CONF_LOAD 100 -# define CONF_F_CONF_LOAD_BIO 102 -# define CONF_F_CONF_LOAD_FP 103 -# define CONF_F_CONF_MODULES_LOAD 116 -# define CONF_F_CONF_PARSE_LIST 119 -# define CONF_F_DEF_LOAD 120 -# define CONF_F_DEF_LOAD_BIO 121 -# define CONF_F_MODULE_INIT 115 -# define CONF_F_MODULE_LOAD_DSO 117 -# define CONF_F_MODULE_RUN 118 -# define CONF_F_NCONF_DUMP_BIO 105 -# define CONF_F_NCONF_DUMP_FP 106 -# define CONF_F_NCONF_GET_NUMBER 107 -# define CONF_F_NCONF_GET_NUMBER_E 112 -# define CONF_F_NCONF_GET_SECTION 108 -# define CONF_F_NCONF_GET_STRING 109 -# define CONF_F_NCONF_LOAD 113 -# define CONF_F_NCONF_LOAD_BIO 110 -# define CONF_F_NCONF_LOAD_FP 114 -# define CONF_F_NCONF_NEW 111 -# define CONF_F_STR_COPY 101 - -/* Reason codes. */ -# define CONF_R_ERROR_LOADING_DSO 110 -# define CONF_R_LIST_CANNOT_BE_NULL 115 -# define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 -# define CONF_R_MISSING_EQUAL_SIGN 101 -# define CONF_R_MISSING_FINISH_FUNCTION 111 -# define CONF_R_MISSING_INIT_FUNCTION 112 -# define CONF_R_MODULE_INITIALIZATION_ERROR 109 -# define CONF_R_NO_CLOSE_BRACE 102 -# define CONF_R_NO_CONF 105 -# define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106 -# define CONF_R_NO_SECTION 107 -# define CONF_R_NO_SUCH_FILE 114 -# define CONF_R_NO_VALUE 108 -# define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 -# define CONF_R_UNKNOWN_MODULE_NAME 113 -# define CONF_R_VARIABLE_HAS_NO_VALUE 104 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/conf_api.h b/libs/win32/openssl/include/openssl/conf_api.h deleted file mode 100644 index e478f7df4b..0000000000 --- a/libs/win32/openssl/include/openssl/conf_api.h +++ /dev/null @@ -1,89 +0,0 @@ -/* conf_api.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_CONF_API_H -# define HEADER_CONF_API_H - -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Up until OpenSSL 0.9.5a, this was new_section */ -CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); -/* Up until OpenSSL 0.9.5a, this was get_section */ -CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); -/* Up until OpenSSL 0.9.5a, this was CONF_get_section */ -STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, - const char *section); - -int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); -char *_CONF_get_string(const CONF *conf, const char *section, - const char *name); -long _CONF_get_number(const CONF *conf, const char *section, - const char *name); - -int _CONF_new_data(CONF *conf); -void _CONF_free_data(CONF *conf); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/crypto.h b/libs/win32/openssl/include/openssl/crypto.h deleted file mode 100644 index 6c644ce12a..0000000000 --- a/libs/win32/openssl/include/openssl/crypto.h +++ /dev/null @@ -1,661 +0,0 @@ -/* crypto/crypto.h */ -/* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECDH support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ - -#ifndef HEADER_CRYPTO_H -# define HEADER_CRYPTO_H - -# include - -# include - -# ifndef OPENSSL_NO_FP_API -# include -# endif - -# include -# include -# include -# include - -# ifdef CHARSET_EBCDIC -# include -# endif - -/* - * Resolve problems on some operating systems with symbol names that clash - * one way or another - */ -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Backward compatibility to SSLeay */ -/* - * This is more to be used to check the correct DLL is being used in the MS - * world. - */ -# define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER -# define SSLEAY_VERSION 0 -/* #define SSLEAY_OPTIONS 1 no longer supported */ -# define SSLEAY_CFLAGS 2 -# define SSLEAY_BUILT_ON 3 -# define SSLEAY_PLATFORM 4 -# define SSLEAY_DIR 5 - -/* Already declared in ossl_typ.h */ -# if 0 -typedef struct crypto_ex_data_st CRYPTO_EX_DATA; -/* Called when a new object is created */ -typedef int CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad, - int idx, long argl, void *argp); -/* Called when an object is free()ed */ -typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad, - int idx, long argl, void *argp); -/* Called when we need to dup an object */ -typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, - void *from_d, int idx, long argl, void *argp); -# endif - -/* A generic structure to pass assorted data in a expandable way */ -typedef struct openssl_item_st { - int code; - void *value; /* Not used for flag attributes */ - size_t value_size; /* Max size of value for output, length for - * input */ - size_t *value_length; /* Returned length of value for output */ -} OPENSSL_ITEM; - -/* - * When changing the CRYPTO_LOCK_* list, be sure to maintin the text lock - * names in cryptlib.c - */ - -# define CRYPTO_LOCK_ERR 1 -# define CRYPTO_LOCK_EX_DATA 2 -# define CRYPTO_LOCK_X509 3 -# define CRYPTO_LOCK_X509_INFO 4 -# define CRYPTO_LOCK_X509_PKEY 5 -# define CRYPTO_LOCK_X509_CRL 6 -# define CRYPTO_LOCK_X509_REQ 7 -# define CRYPTO_LOCK_DSA 8 -# define CRYPTO_LOCK_RSA 9 -# define CRYPTO_LOCK_EVP_PKEY 10 -# define CRYPTO_LOCK_X509_STORE 11 -# define CRYPTO_LOCK_SSL_CTX 12 -# define CRYPTO_LOCK_SSL_CERT 13 -# define CRYPTO_LOCK_SSL_SESSION 14 -# define CRYPTO_LOCK_SSL_SESS_CERT 15 -# define CRYPTO_LOCK_SSL 16 -# define CRYPTO_LOCK_SSL_METHOD 17 -# define CRYPTO_LOCK_RAND 18 -# define CRYPTO_LOCK_RAND2 19 -# define CRYPTO_LOCK_MALLOC 20 -# define CRYPTO_LOCK_BIO 21 -# define CRYPTO_LOCK_GETHOSTBYNAME 22 -# define CRYPTO_LOCK_GETSERVBYNAME 23 -# define CRYPTO_LOCK_READDIR 24 -# define CRYPTO_LOCK_RSA_BLINDING 25 -# define CRYPTO_LOCK_DH 26 -# define CRYPTO_LOCK_MALLOC2 27 -# define CRYPTO_LOCK_DSO 28 -# define CRYPTO_LOCK_DYNLOCK 29 -# define CRYPTO_LOCK_ENGINE 30 -# define CRYPTO_LOCK_UI 31 -# define CRYPTO_LOCK_ECDSA 32 -# define CRYPTO_LOCK_EC 33 -# define CRYPTO_LOCK_ECDH 34 -# define CRYPTO_LOCK_BN 35 -# define CRYPTO_LOCK_EC_PRE_COMP 36 -# define CRYPTO_LOCK_STORE 37 -# define CRYPTO_LOCK_COMP 38 -# define CRYPTO_LOCK_FIPS 39 -# define CRYPTO_LOCK_FIPS2 40 -# define CRYPTO_NUM_LOCKS 41 - -# define CRYPTO_LOCK 1 -# define CRYPTO_UNLOCK 2 -# define CRYPTO_READ 4 -# define CRYPTO_WRITE 8 - -# ifndef OPENSSL_NO_LOCKING -# ifndef CRYPTO_w_lock -# define CRYPTO_w_lock(type) \ - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) -# define CRYPTO_w_unlock(type) \ - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) -# define CRYPTO_r_lock(type) \ - CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__) -# define CRYPTO_r_unlock(type) \ - CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__) -# define CRYPTO_add(addr,amount,type) \ - CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) -# endif -# else -# define CRYPTO_w_lock(a) -# define CRYPTO_w_unlock(a) -# define CRYPTO_r_lock(a) -# define CRYPTO_r_unlock(a) -# define CRYPTO_add(a,b,c) ((*(a))+=(b)) -# endif - -/* - * Some applications as well as some parts of OpenSSL need to allocate and - * deallocate locks in a dynamic fashion. The following typedef makes this - * possible in a type-safe manner. - */ -/* struct CRYPTO_dynlock_value has to be defined by the application. */ -typedef struct { - int references; - struct CRYPTO_dynlock_value *data; -} CRYPTO_dynlock; - -/* - * The following can be used to detect memory leaks in the SSLeay library. It - * used, it turns on malloc checking - */ - -# define CRYPTO_MEM_CHECK_OFF 0x0/* an enume */ -# define CRYPTO_MEM_CHECK_ON 0x1/* a bit */ -# define CRYPTO_MEM_CHECK_ENABLE 0x2/* a bit */ -# define CRYPTO_MEM_CHECK_DISABLE 0x3/* an enume */ - -/* - * The following are bit values to turn on or off options connected to the - * malloc checking functionality - */ - -/* Adds time to the memory checking information */ -# define V_CRYPTO_MDEBUG_TIME 0x1/* a bit */ -/* Adds thread number to the memory checking information */ -# define V_CRYPTO_MDEBUG_THREAD 0x2/* a bit */ - -# define V_CRYPTO_MDEBUG_ALL (V_CRYPTO_MDEBUG_TIME | V_CRYPTO_MDEBUG_THREAD) - -/* predec of the BIO type */ -typedef struct bio_st BIO_dummy; - -struct crypto_ex_data_st { - STACK_OF(void) *sk; - /* gcc is screwing up this data structure :-( */ - int dummy; -}; -DECLARE_STACK_OF(void) - -/* - * This stuff is basically class callback functions The current classes are - * SSL_CTX, SSL, SSL_SESSION, and a few more - */ - -typedef struct crypto_ex_data_func_st { - long argl; /* Arbitary long */ - void *argp; /* Arbitary void * */ - CRYPTO_EX_new *new_func; - CRYPTO_EX_free *free_func; - CRYPTO_EX_dup *dup_func; -} CRYPTO_EX_DATA_FUNCS; - -DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS) - -/* - * Per class, we have a STACK of CRYPTO_EX_DATA_FUNCS for each CRYPTO_EX_DATA - * entry. - */ - -# define CRYPTO_EX_INDEX_BIO 0 -# define CRYPTO_EX_INDEX_SSL 1 -# define CRYPTO_EX_INDEX_SSL_CTX 2 -# define CRYPTO_EX_INDEX_SSL_SESSION 3 -# define CRYPTO_EX_INDEX_X509_STORE 4 -# define CRYPTO_EX_INDEX_X509_STORE_CTX 5 -# define CRYPTO_EX_INDEX_RSA 6 -# define CRYPTO_EX_INDEX_DSA 7 -# define CRYPTO_EX_INDEX_DH 8 -# define CRYPTO_EX_INDEX_ENGINE 9 -# define CRYPTO_EX_INDEX_X509 10 -# define CRYPTO_EX_INDEX_UI 11 -# define CRYPTO_EX_INDEX_ECDSA 12 -# define CRYPTO_EX_INDEX_ECDH 13 -# define CRYPTO_EX_INDEX_COMP 14 -# define CRYPTO_EX_INDEX_STORE 15 - -/* - * Dynamically assigned indexes start from this value (don't use directly, - * use via CRYPTO_ex_data_new_class). - */ -# define CRYPTO_EX_INDEX_USER 100 - -/* - * This is the default callbacks, but we can have others as well: this is - * needed in Win32 where the application malloc and the library malloc may - * not be the same. - */ -# define CRYPTO_malloc_init() CRYPTO_set_mem_functions(\ - malloc, realloc, free) - -# if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD -# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */ -# define CRYPTO_MDEBUG -# endif -# endif - -/* - * Set standard debugging functions (not done by default unless CRYPTO_MDEBUG - * is defined) - */ -# define CRYPTO_malloc_debug_init() do {\ - CRYPTO_set_mem_debug_functions(\ - CRYPTO_dbg_malloc,\ - CRYPTO_dbg_realloc,\ - CRYPTO_dbg_free,\ - CRYPTO_dbg_set_options,\ - CRYPTO_dbg_get_options);\ - } while(0) - -int CRYPTO_mem_ctrl(int mode); -int CRYPTO_is_mem_check_on(void); - -/* for applications */ -# define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON) -# define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF) - -/* for library-internal use */ -# define MemCheck_on() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE) -# define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE) -# define is_MemCheck_on() CRYPTO_is_mem_check_on() - -# define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__) -# define OPENSSL_strdup(str) CRYPTO_strdup((str),__FILE__,__LINE__) -# define OPENSSL_realloc(addr,num) \ - CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__) -# define OPENSSL_realloc_clean(addr,old_num,num) \ - CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__) -# define OPENSSL_remalloc(addr,num) \ - CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__) -# define OPENSSL_freeFunc CRYPTO_free -# define OPENSSL_free(addr) CRYPTO_free(addr) - -# define OPENSSL_malloc_locked(num) \ - CRYPTO_malloc_locked((int)num,__FILE__,__LINE__) -# define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr) - -const char *SSLeay_version(int type); -unsigned long SSLeay(void); - -int OPENSSL_issetugid(void); - -/* An opaque type representing an implementation of "ex_data" support */ -typedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL; -/* Return an opaque pointer to the current "ex_data" implementation */ -const CRYPTO_EX_DATA_IMPL *CRYPTO_get_ex_data_implementation(void); -/* Sets the "ex_data" implementation to be used (if it's not too late) */ -int CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i); -/* Get a new "ex_data" class, and return the corresponding "class_index" */ -int CRYPTO_ex_data_new_class(void); -/* Within a given class, get/register a new index */ -int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, - CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, - CRYPTO_EX_free *free_func); -/* - * Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a - * given class (invokes whatever per-class callbacks are applicable) - */ -int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); -int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, - CRYPTO_EX_DATA *from); -void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad); -/* - * Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular - * index (relative to the class type involved) - */ -int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val); -void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx); -/* - * This function cleans up all "ex_data" state. It mustn't be called under - * potential race-conditions. - */ -void CRYPTO_cleanup_all_ex_data(void); - -int CRYPTO_get_new_lockid(char *name); - -int CRYPTO_num_locks(void); /* return CRYPTO_NUM_LOCKS (shared libs!) */ -void CRYPTO_lock(int mode, int type, const char *file, int line); -void CRYPTO_set_locking_callback(void (*func) (int mode, int type, - const char *file, int line)); -void (*CRYPTO_get_locking_callback(void)) (int mode, int type, - const char *file, int line); -void CRYPTO_set_add_lock_callback(int (*func) - (int *num, int mount, int type, - const char *file, int line)); -int (*CRYPTO_get_add_lock_callback(void)) (int *num, int mount, int type, - const char *file, int line); - -/* Don't use this structure directly. */ -typedef struct crypto_threadid_st { - void *ptr; - unsigned long val; -} CRYPTO_THREADID; -/* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ -void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val); -void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr); -int CRYPTO_THREADID_set_callback(void (*threadid_func) (CRYPTO_THREADID *)); -void (*CRYPTO_THREADID_get_callback(void)) (CRYPTO_THREADID *); -void CRYPTO_THREADID_current(CRYPTO_THREADID *id); -int CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b); -void CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src); -unsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id); -# ifndef OPENSSL_NO_DEPRECATED -void CRYPTO_set_id_callback(unsigned long (*func) (void)); -unsigned long (*CRYPTO_get_id_callback(void)) (void); -unsigned long CRYPTO_thread_id(void); -# endif - -const char *CRYPTO_get_lock_name(int type); -int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, - int line); - -int CRYPTO_get_new_dynlockid(void); -void CRYPTO_destroy_dynlockid(int i); -struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i); -void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value - *(*dyn_create_function) (const char - *file, - int line)); -void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function) - (int mode, - struct CRYPTO_dynlock_value *l, - const char *file, int line)); -void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function) - (struct CRYPTO_dynlock_value *l, - const char *file, int line)); -struct CRYPTO_dynlock_value -*(*CRYPTO_get_dynlock_create_callback(void)) (const char *file, int line); -void (*CRYPTO_get_dynlock_lock_callback(void)) (int mode, - struct CRYPTO_dynlock_value - *l, const char *file, - int line); -void (*CRYPTO_get_dynlock_destroy_callback(void)) (struct CRYPTO_dynlock_value - *l, const char *file, - int line); - -/* - * CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- call - * the latter last if you need different functions - */ -int CRYPTO_set_mem_functions(void *(*m) (size_t), void *(*r) (void *, size_t), - void (*f) (void *)); -int CRYPTO_set_locked_mem_functions(void *(*m) (size_t), - void (*free_func) (void *)); -int CRYPTO_set_mem_ex_functions(void *(*m) (size_t, const char *, int), - void *(*r) (void *, size_t, const char *, - int), void (*f) (void *)); -int CRYPTO_set_locked_mem_ex_functions(void *(*m) (size_t, const char *, int), - void (*free_func) (void *)); -int CRYPTO_set_mem_debug_functions(void (*m) - (void *, int, const char *, int, int), - void (*r) (void *, void *, int, - const char *, int, int), - void (*f) (void *, int), void (*so) (long), - long (*go) (void)); -void CRYPTO_get_mem_functions(void *(**m) (size_t), - void *(**r) (void *, size_t), - void (**f) (void *)); -void CRYPTO_get_locked_mem_functions(void *(**m) (size_t), - void (**f) (void *)); -void CRYPTO_get_mem_ex_functions(void *(**m) (size_t, const char *, int), - void *(**r) (void *, size_t, const char *, - int), void (**f) (void *)); -void CRYPTO_get_locked_mem_ex_functions(void - *(**m) (size_t, const char *, int), - void (**f) (void *)); -void CRYPTO_get_mem_debug_functions(void (**m) - (void *, int, const char *, int, int), - void (**r) (void *, void *, int, - const char *, int, int), - void (**f) (void *, int), - void (**so) (long), long (**go) (void)); - -void *CRYPTO_malloc_locked(int num, const char *file, int line); -void CRYPTO_free_locked(void *ptr); -void *CRYPTO_malloc(int num, const char *file, int line); -char *CRYPTO_strdup(const char *str, const char *file, int line); -void CRYPTO_free(void *ptr); -void *CRYPTO_realloc(void *addr, int num, const char *file, int line); -void *CRYPTO_realloc_clean(void *addr, int old_num, int num, const char *file, - int line); -void *CRYPTO_remalloc(void *addr, int num, const char *file, int line); - -void OPENSSL_cleanse(void *ptr, size_t len); - -void CRYPTO_set_mem_debug_options(long bits); -long CRYPTO_get_mem_debug_options(void); - -# define CRYPTO_push_info(info) \ - CRYPTO_push_info_(info, __FILE__, __LINE__); -int CRYPTO_push_info_(const char *info, const char *file, int line); -int CRYPTO_pop_info(void); -int CRYPTO_remove_all_info(void); - -/* - * Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro; - * used as default in CRYPTO_MDEBUG compilations): - */ -/*- - * The last argument has the following significance: - * - * 0: called before the actual memory allocation has taken place - * 1: called after the actual memory allocation has taken place - */ -void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line, - int before_p); -void CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, const char *file, - int line, int before_p); -void CRYPTO_dbg_free(void *addr, int before_p); -/*- - * Tell the debugging code about options. By default, the following values - * apply: - * - * 0: Clear all options. - * V_CRYPTO_MDEBUG_TIME (1): Set the "Show Time" option. - * V_CRYPTO_MDEBUG_THREAD (2): Set the "Show Thread Number" option. - * V_CRYPTO_MDEBUG_ALL (3): 1 + 2 - */ -void CRYPTO_dbg_set_options(long bits); -long CRYPTO_dbg_get_options(void); - -# ifndef OPENSSL_NO_FP_API -void CRYPTO_mem_leaks_fp(FILE *); -# endif -void CRYPTO_mem_leaks(struct bio_st *bio); -/* unsigned long order, char *file, int line, int num_bytes, char *addr */ -typedef void *CRYPTO_MEM_LEAK_CB (unsigned long, const char *, int, int, - void *); -void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb); - -/* die if we have to */ -void OpenSSLDie(const char *file, int line, const char *assertion); -# define OPENSSL_assert(e) (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1)) - -unsigned long *OPENSSL_ia32cap_loc(void); -# define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc())) -int OPENSSL_isservice(void); - -int FIPS_mode(void); -int FIPS_mode_set(int r); - -void OPENSSL_init(void); - -# define fips_md_init(alg) fips_md_init_ctx(alg, alg) - -# ifdef OPENSSL_FIPS -# define fips_md_init_ctx(alg, cx) \ - int alg##_Init(cx##_CTX *c) \ - { \ - if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \ - "Low level API call to digest " #alg " forbidden in FIPS mode!"); \ - return private_##alg##_Init(c); \ - } \ - int private_##alg##_Init(cx##_CTX *c) - -# define fips_cipher_abort(alg) \ - if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \ - "Low level API call to cipher " #alg " forbidden in FIPS mode!") - -# else -# define fips_md_init_ctx(alg, cx) \ - int alg##_Init(cx##_CTX *c) -# define fips_cipher_abort(alg) while(0) -# endif - -/* - * CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal. - * It takes an amount of time dependent on |len|, but independent of the - * contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements - * into a defined order as the return value when a != b is undefined, other - * than to be non-zero. - */ -int CRYPTO_memcmp(const volatile void *a, const volatile void *b, size_t len); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_CRYPTO_strings(void); - -/* Error codes for the CRYPTO functions. */ - -/* Function codes. */ -# define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100 -# define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID 103 -# define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101 -# define CRYPTO_F_CRYPTO_SET_EX_DATA 102 -# define CRYPTO_F_DEF_ADD_INDEX 104 -# define CRYPTO_F_DEF_GET_CLASS 105 -# define CRYPTO_F_FIPS_MODE_SET 109 -# define CRYPTO_F_INT_DUP_EX_DATA 106 -# define CRYPTO_F_INT_FREE_EX_DATA 107 -# define CRYPTO_F_INT_NEW_EX_DATA 108 - -/* Reason codes. */ -# define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101 -# define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/des.h b/libs/win32/openssl/include/openssl/des.h deleted file mode 100644 index 1b40144e1b..0000000000 --- a/libs/win32/openssl/include/openssl/des.h +++ /dev/null @@ -1,257 +0,0 @@ -/* crypto/des/des.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_NEW_DES_H -# define HEADER_NEW_DES_H - -# include /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG - * (via openssl/opensslconf.h */ - -# ifdef OPENSSL_NO_DES -# error DES is disabled. -# endif - -# ifdef OPENSSL_BUILD_SHLIBCRYPTO -# undef OPENSSL_EXTERN -# define OPENSSL_EXTERN OPENSSL_EXPORT -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef unsigned char DES_cblock[8]; -typedef /* const */ unsigned char const_DES_cblock[8]; -/* - * With "const", gcc 2.8.1 on Solaris thinks that DES_cblock * and - * const_DES_cblock * are incompatible pointer types. - */ - -typedef struct DES_ks { - union { - DES_cblock cblock; - /* - * make sure things are correct size on machines with 8 byte longs - */ - DES_LONG deslong[2]; - } ks[16]; -} DES_key_schedule; - -# ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT -# ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT -# define OPENSSL_ENABLE_OLD_DES_SUPPORT -# endif -# endif - -# ifdef OPENSSL_ENABLE_OLD_DES_SUPPORT -# include -# endif - -# define DES_KEY_SZ (sizeof(DES_cblock)) -# define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) - -# define DES_ENCRYPT 1 -# define DES_DECRYPT 0 - -# define DES_CBC_MODE 0 -# define DES_PCBC_MODE 1 - -# define DES_ecb2_encrypt(i,o,k1,k2,e) \ - DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) - -# define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ - DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) - -# define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ - DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) - -# define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ - DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) - -OPENSSL_DECLARE_GLOBAL(int, DES_check_key); /* defaults to false */ -# define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key) -OPENSSL_DECLARE_GLOBAL(int, DES_rw_mode); /* defaults to DES_PCBC_MODE */ -# define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode) - -const char *DES_options(void); -void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output, - DES_key_schedule *ks1, DES_key_schedule *ks2, - DES_key_schedule *ks3, int enc); -DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output, - long length, DES_key_schedule *schedule, - const_DES_cblock *ivec); -/* DES_cbc_encrypt does not update the IV! Use DES_ncbc_encrypt instead. */ -void DES_cbc_encrypt(const unsigned char *input, unsigned char *output, - long length, DES_key_schedule *schedule, - DES_cblock *ivec, int enc); -void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output, - long length, DES_key_schedule *schedule, - DES_cblock *ivec, int enc); -void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output, - long length, DES_key_schedule *schedule, - DES_cblock *ivec, const_DES_cblock *inw, - const_DES_cblock *outw, int enc); -void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, - long length, DES_key_schedule *schedule, - DES_cblock *ivec, int enc); -void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output, - DES_key_schedule *ks, int enc); - -/* - * This is the DES encryption function that gets called by just about every - * other DES routine in the library. You should not use this function except - * to implement 'modes' of DES. I say this because the functions that call - * this routine do the conversion from 'char *' to long, and this needs to be - * done to make sure 'non-aligned' memory access do not occur. The - * characters are loaded 'little endian'. Data is a pointer to 2 unsigned - * long's and ks is the DES_key_schedule to use. enc, is non zero specifies - * encryption, zero if decryption. - */ -void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc); - -/* - * This functions is the same as DES_encrypt1() except that the DES initial - * permutation (IP) and final permutation (FP) have been left out. As for - * DES_encrypt1(), you should not use this function. It is used by the - * routines in the library that implement triple DES. IP() DES_encrypt2() - * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1() - * DES_encrypt1() DES_encrypt1() except faster :-). - */ -void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc); - -void DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_key_schedule *ks3); -void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_key_schedule *ks3); -void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, - long length, - DES_key_schedule *ks1, DES_key_schedule *ks2, - DES_key_schedule *ks3, DES_cblock *ivec, int enc); -void DES_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out, - long length, - DES_key_schedule *ks1, DES_key_schedule *ks2, - DES_key_schedule *ks3, - DES_cblock *ivec1, DES_cblock *ivec2, int enc); -void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_key_schedule *ks3, - DES_cblock *ivec, int *num, int enc); -void DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out, - int numbits, long length, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_key_schedule *ks3, - DES_cblock *ivec, int enc); -void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_key_schedule *ks3, - DES_cblock *ivec, int *num); -# if 0 -void DES_xwhite_in2out(const_DES_cblock *DES_key, const_DES_cblock *in_white, - DES_cblock *out_white); -# endif - -int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched, - DES_cblock *iv); -int DES_enc_write(int fd, const void *buf, int len, DES_key_schedule *sched, - DES_cblock *iv); -char *DES_fcrypt(const char *buf, const char *salt, char *ret); -char *DES_crypt(const char *buf, const char *salt); -void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits, - long length, DES_key_schedule *schedule, - DES_cblock *ivec); -void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output, - long length, DES_key_schedule *schedule, - DES_cblock *ivec, int enc); -DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[], - long length, int out_count, DES_cblock *seed); -int DES_random_key(DES_cblock *ret); -void DES_set_odd_parity(DES_cblock *key); -int DES_check_key_parity(const_DES_cblock *key); -int DES_is_weak_key(const_DES_cblock *key); -/* - * DES_set_key (= set_key = DES_key_sched = key_sched) calls - * DES_set_key_checked if global variable DES_check_key is set, - * DES_set_key_unchecked otherwise. - */ -int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule); -int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule); -int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule); -void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule); -# ifdef OPENSSL_FIPS -void private_DES_set_key_unchecked(const_DES_cblock *key, - DES_key_schedule *schedule); -# endif -void DES_string_to_key(const char *str, DES_cblock *key); -void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2); -void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, DES_key_schedule *schedule, - DES_cblock *ivec, int *num, int enc); -void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, DES_key_schedule *schedule, - DES_cblock *ivec, int *num); - -int DES_read_password(DES_cblock *key, const char *prompt, int verify); -int DES_read_2passwords(DES_cblock *key1, DES_cblock *key2, - const char *prompt, int verify); - -# define DES_fixup_key_parity DES_set_odd_parity - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/des_old.h b/libs/win32/openssl/include/openssl/des_old.h deleted file mode 100644 index ee7607a241..0000000000 --- a/libs/win32/openssl/include/openssl/des_old.h +++ /dev/null @@ -1,497 +0,0 @@ -/* crypto/des/des_old.h */ - -/*- - * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING - * - * The function names in here are deprecated and are only present to - * provide an interface compatible with openssl 0.9.6 and older as - * well as libdes. OpenSSL now provides functions where "des_" has - * been replaced with "DES_" in the names, to make it possible to - * make incompatible changes that are needed for C type security and - * other stuff. - * - * This include files has two compatibility modes: - * - * - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API - * that is compatible with libdes and SSLeay. - * - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an - * API that is compatible with OpenSSL 0.9.5x to 0.9.6x. - * - * Note that these modes break earlier snapshots of OpenSSL, where - * libdes compatibility was the only available mode or (later on) the - * prefered compatibility mode. However, after much consideration - * (and more or less violent discussions with external parties), it - * was concluded that OpenSSL should be compatible with earlier versions - * of itself before anything else. Also, in all honesty, libdes is - * an old beast that shouldn't really be used any more. - * - * Please consider starting to use the DES_ functions rather than the - * des_ ones. The des_ functions will disappear completely before - * OpenSSL 1.0! - * - * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING - */ - -/* - * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project - * 2001. - */ -/* ==================================================================== - * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_DES_H -# define HEADER_DES_H - -# include /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */ - -# ifdef OPENSSL_NO_DES -# error DES is disabled. -# endif - -# ifndef HEADER_NEW_DES_H -# error You must include des.h, not des_old.h directly. -# endif - -# ifdef _KERBEROS_DES_H -# error replaces . -# endif - -# include - -# ifdef OPENSSL_BUILD_SHLIBCRYPTO -# undef OPENSSL_EXTERN -# define OPENSSL_EXTERN OPENSSL_EXPORT -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -# ifdef _ -# undef _ -# endif - -typedef unsigned char _ossl_old_des_cblock[8]; -typedef struct _ossl_old_des_ks_struct { - union { - _ossl_old_des_cblock _; - /* - * make sure things are correct size on machines with 8 byte longs - */ - DES_LONG pad[2]; - } ks; -} _ossl_old_des_key_schedule[16]; - -# ifndef OPENSSL_DES_LIBDES_COMPATIBILITY -# define des_cblock DES_cblock -# define const_des_cblock const_DES_cblock -# define des_key_schedule DES_key_schedule -# define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ - DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e)) -# define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ - DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e)) -# define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\ - DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e)) -# define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ - DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e)) -# define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ - DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n)) -# define des_options()\ - DES_options() -# define des_cbc_cksum(i,o,l,k,iv)\ - DES_cbc_cksum((i),(o),(l),&(k),(iv)) -# define des_cbc_encrypt(i,o,l,k,iv,e)\ - DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e)) -# define des_ncbc_encrypt(i,o,l,k,iv,e)\ - DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e)) -# define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ - DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e)) -# define des_cfb_encrypt(i,o,n,l,k,iv,e)\ - DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e)) -# define des_ecb_encrypt(i,o,k,e)\ - DES_ecb_encrypt((i),(o),&(k),(e)) -# define des_encrypt1(d,k,e)\ - DES_encrypt1((d),&(k),(e)) -# define des_encrypt2(d,k,e)\ - DES_encrypt2((d),&(k),(e)) -# define des_encrypt3(d,k1,k2,k3)\ - DES_encrypt3((d),&(k1),&(k2),&(k3)) -# define des_decrypt3(d,k1,k2,k3)\ - DES_decrypt3((d),&(k1),&(k2),&(k3)) -# define des_xwhite_in2out(k,i,o)\ - DES_xwhite_in2out((k),(i),(o)) -# define des_enc_read(f,b,l,k,iv)\ - DES_enc_read((f),(b),(l),&(k),(iv)) -# define des_enc_write(f,b,l,k,iv)\ - DES_enc_write((f),(b),(l),&(k),(iv)) -# define des_fcrypt(b,s,r)\ - DES_fcrypt((b),(s),(r)) -# if 0 -# define des_crypt(b,s)\ - DES_crypt((b),(s)) -# if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__) -# define crypt(b,s)\ - DES_crypt((b),(s)) -# endif -# endif -# define des_ofb_encrypt(i,o,n,l,k,iv)\ - DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv)) -# define des_pcbc_encrypt(i,o,l,k,iv,e)\ - DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e)) -# define des_quad_cksum(i,o,l,c,s)\ - DES_quad_cksum((i),(o),(l),(c),(s)) -# define des_random_seed(k)\ - _ossl_096_des_random_seed((k)) -# define des_random_key(r)\ - DES_random_key((r)) -# define des_read_password(k,p,v) \ - DES_read_password((k),(p),(v)) -# define des_read_2passwords(k1,k2,p,v) \ - DES_read_2passwords((k1),(k2),(p),(v)) -# define des_set_odd_parity(k)\ - DES_set_odd_parity((k)) -# define des_check_key_parity(k)\ - DES_check_key_parity((k)) -# define des_is_weak_key(k)\ - DES_is_weak_key((k)) -# define des_set_key(k,ks)\ - DES_set_key((k),&(ks)) -# define des_key_sched(k,ks)\ - DES_key_sched((k),&(ks)) -# define des_set_key_checked(k,ks)\ - DES_set_key_checked((k),&(ks)) -# define des_set_key_unchecked(k,ks)\ - DES_set_key_unchecked((k),&(ks)) -# define des_string_to_key(s,k)\ - DES_string_to_key((s),(k)) -# define des_string_to_2keys(s,k1,k2)\ - DES_string_to_2keys((s),(k1),(k2)) -# define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ - DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e)) -# define des_ofb64_encrypt(i,o,l,ks,iv,n)\ - DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n)) - -# define des_ecb2_encrypt(i,o,k1,k2,e) \ - des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) - -# define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ - des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) - -# define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ - des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) - -# define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ - des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) - -# define des_check_key DES_check_key -# define des_rw_mode DES_rw_mode -# else /* libdes compatibility */ -/* - * Map all symbol names to _ossl_old_des_* form, so we avoid all clashes with - * libdes - */ -# define des_cblock _ossl_old_des_cblock -# define des_key_schedule _ossl_old_des_key_schedule -# define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ - _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e)) -# define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ - _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e)) -# define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ - _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e)) -# define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ - _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n)) -# define des_options()\ - _ossl_old_des_options() -# define des_cbc_cksum(i,o,l,k,iv)\ - _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv)) -# define des_cbc_encrypt(i,o,l,k,iv,e)\ - _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e)) -# define des_ncbc_encrypt(i,o,l,k,iv,e)\ - _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e)) -# define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\ - _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e)) -# define des_cfb_encrypt(i,o,n,l,k,iv,e)\ - _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e)) -# define des_ecb_encrypt(i,o,k,e)\ - _ossl_old_des_ecb_encrypt((i),(o),(k),(e)) -# define des_encrypt(d,k,e)\ - _ossl_old_des_encrypt((d),(k),(e)) -# define des_encrypt2(d,k,e)\ - _ossl_old_des_encrypt2((d),(k),(e)) -# define des_encrypt3(d,k1,k2,k3)\ - _ossl_old_des_encrypt3((d),(k1),(k2),(k3)) -# define des_decrypt3(d,k1,k2,k3)\ - _ossl_old_des_decrypt3((d),(k1),(k2),(k3)) -# define des_xwhite_in2out(k,i,o)\ - _ossl_old_des_xwhite_in2out((k),(i),(o)) -# define des_enc_read(f,b,l,k,iv)\ - _ossl_old_des_enc_read((f),(b),(l),(k),(iv)) -# define des_enc_write(f,b,l,k,iv)\ - _ossl_old_des_enc_write((f),(b),(l),(k),(iv)) -# define des_fcrypt(b,s,r)\ - _ossl_old_des_fcrypt((b),(s),(r)) -# define des_crypt(b,s)\ - _ossl_old_des_crypt((b),(s)) -# if 0 -# define crypt(b,s)\ - _ossl_old_crypt((b),(s)) -# endif -# define des_ofb_encrypt(i,o,n,l,k,iv)\ - _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv)) -# define des_pcbc_encrypt(i,o,l,k,iv,e)\ - _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e)) -# define des_quad_cksum(i,o,l,c,s)\ - _ossl_old_des_quad_cksum((i),(o),(l),(c),(s)) -# define des_random_seed(k)\ - _ossl_old_des_random_seed((k)) -# define des_random_key(r)\ - _ossl_old_des_random_key((r)) -# define des_read_password(k,p,v) \ - _ossl_old_des_read_password((k),(p),(v)) -# define des_read_2passwords(k1,k2,p,v) \ - _ossl_old_des_read_2passwords((k1),(k2),(p),(v)) -# define des_set_odd_parity(k)\ - _ossl_old_des_set_odd_parity((k)) -# define des_is_weak_key(k)\ - _ossl_old_des_is_weak_key((k)) -# define des_set_key(k,ks)\ - _ossl_old_des_set_key((k),(ks)) -# define des_key_sched(k,ks)\ - _ossl_old_des_key_sched((k),(ks)) -# define des_string_to_key(s,k)\ - _ossl_old_des_string_to_key((s),(k)) -# define des_string_to_2keys(s,k1,k2)\ - _ossl_old_des_string_to_2keys((s),(k1),(k2)) -# define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\ - _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e)) -# define des_ofb64_encrypt(i,o,l,ks,iv,n)\ - _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n)) - -# define des_ecb2_encrypt(i,o,k1,k2,e) \ - des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e)) - -# define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \ - des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e)) - -# define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \ - des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e)) - -# define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ - des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) - -# define des_check_key DES_check_key -# define des_rw_mode DES_rw_mode -# endif - -const char *_ossl_old_des_options(void); -void _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input, - _ossl_old_des_cblock *output, - _ossl_old_des_key_schedule ks1, - _ossl_old_des_key_schedule ks2, - _ossl_old_des_key_schedule ks3, int enc); -DES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input, - _ossl_old_des_cblock *output, long length, - _ossl_old_des_key_schedule schedule, - _ossl_old_des_cblock *ivec); -void _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input, - _ossl_old_des_cblock *output, long length, - _ossl_old_des_key_schedule schedule, - _ossl_old_des_cblock *ivec, int enc); -void _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input, - _ossl_old_des_cblock *output, long length, - _ossl_old_des_key_schedule schedule, - _ossl_old_des_cblock *ivec, int enc); -void _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input, - _ossl_old_des_cblock *output, long length, - _ossl_old_des_key_schedule schedule, - _ossl_old_des_cblock *ivec, - _ossl_old_des_cblock *inw, - _ossl_old_des_cblock *outw, int enc); -void _ossl_old_des_cfb_encrypt(unsigned char *in, unsigned char *out, - int numbits, long length, - _ossl_old_des_key_schedule schedule, - _ossl_old_des_cblock *ivec, int enc); -void _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input, - _ossl_old_des_cblock *output, - _ossl_old_des_key_schedule ks, int enc); -void _ossl_old_des_encrypt(DES_LONG *data, _ossl_old_des_key_schedule ks, - int enc); -void _ossl_old_des_encrypt2(DES_LONG *data, _ossl_old_des_key_schedule ks, - int enc); -void _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, - _ossl_old_des_key_schedule ks2, - _ossl_old_des_key_schedule ks3); -void _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1, - _ossl_old_des_key_schedule ks2, - _ossl_old_des_key_schedule ks3); -void _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input, - _ossl_old_des_cblock *output, long length, - _ossl_old_des_key_schedule ks1, - _ossl_old_des_key_schedule ks2, - _ossl_old_des_key_schedule ks3, - _ossl_old_des_cblock *ivec, int enc); -void _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out, - long length, - _ossl_old_des_key_schedule ks1, - _ossl_old_des_key_schedule ks2, - _ossl_old_des_key_schedule ks3, - _ossl_old_des_cblock *ivec, int *num, - int enc); -void _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out, - long length, - _ossl_old_des_key_schedule ks1, - _ossl_old_des_key_schedule ks2, - _ossl_old_des_key_schedule ks3, - _ossl_old_des_cblock *ivec, int *num); -# if 0 -void _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key), - _ossl_old_des_cblock (*in_white), - _ossl_old_des_cblock (*out_white)); -# endif - -int _ossl_old_des_enc_read(int fd, char *buf, int len, - _ossl_old_des_key_schedule sched, - _ossl_old_des_cblock *iv); -int _ossl_old_des_enc_write(int fd, char *buf, int len, - _ossl_old_des_key_schedule sched, - _ossl_old_des_cblock *iv); -char *_ossl_old_des_fcrypt(const char *buf, const char *salt, char *ret); -char *_ossl_old_des_crypt(const char *buf, const char *salt); -# if !defined(PERL5) && !defined(NeXT) -char *_ossl_old_crypt(const char *buf, const char *salt); -# endif -void _ossl_old_des_ofb_encrypt(unsigned char *in, unsigned char *out, - int numbits, long length, - _ossl_old_des_key_schedule schedule, - _ossl_old_des_cblock *ivec); -void _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input, - _ossl_old_des_cblock *output, long length, - _ossl_old_des_key_schedule schedule, - _ossl_old_des_cblock *ivec, int enc); -DES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input, - _ossl_old_des_cblock *output, long length, - int out_count, _ossl_old_des_cblock *seed); -void _ossl_old_des_random_seed(_ossl_old_des_cblock key); -void _ossl_old_des_random_key(_ossl_old_des_cblock ret); -int _ossl_old_des_read_password(_ossl_old_des_cblock *key, const char *prompt, - int verify); -int _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1, - _ossl_old_des_cblock *key2, - const char *prompt, int verify); -void _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key); -int _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key); -int _ossl_old_des_set_key(_ossl_old_des_cblock *key, - _ossl_old_des_key_schedule schedule); -int _ossl_old_des_key_sched(_ossl_old_des_cblock *key, - _ossl_old_des_key_schedule schedule); -void _ossl_old_des_string_to_key(char *str, _ossl_old_des_cblock *key); -void _ossl_old_des_string_to_2keys(char *str, _ossl_old_des_cblock *key1, - _ossl_old_des_cblock *key2); -void _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out, - long length, - _ossl_old_des_key_schedule schedule, - _ossl_old_des_cblock *ivec, int *num, - int enc); -void _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out, - long length, - _ossl_old_des_key_schedule schedule, - _ossl_old_des_cblock *ivec, int *num); - -void _ossl_096_des_random_seed(des_cblock *key); - -/* - * The following definitions provide compatibility with the MIT Kerberos - * library. The _ossl_old_des_key_schedule structure is not binary - * compatible. - */ - -# define _KERBEROS_DES_H - -# define KRBDES_ENCRYPT DES_ENCRYPT -# define KRBDES_DECRYPT DES_DECRYPT - -# ifdef KERBEROS -# define ENCRYPT DES_ENCRYPT -# define DECRYPT DES_DECRYPT -# endif - -# ifndef NCOMPAT -# define C_Block des_cblock -# define Key_schedule des_key_schedule -# define KEY_SZ DES_KEY_SZ -# define string_to_key des_string_to_key -# define read_pw_string des_read_pw_string -# define random_key des_random_key -# define pcbc_encrypt des_pcbc_encrypt -# define set_key des_set_key -# define key_sched des_key_sched -# define ecb_encrypt des_ecb_encrypt -# define cbc_encrypt des_cbc_encrypt -# define ncbc_encrypt des_ncbc_encrypt -# define xcbc_encrypt des_xcbc_encrypt -# define cbc_cksum des_cbc_cksum -# define quad_cksum des_quad_cksum -# define check_parity des_check_key_parity -# endif - -# define des_fixup_key_parity DES_fixup_key_parity - -#ifdef __cplusplus -} -#endif - -/* for DES_read_pw_string et al */ -# include - -#endif diff --git a/libs/win32/openssl/include/openssl/dh.h b/libs/win32/openssl/include/openssl/dh.h deleted file mode 100644 index a5bd9016aa..0000000000 --- a/libs/win32/openssl/include/openssl/dh.h +++ /dev/null @@ -1,393 +0,0 @@ -/* crypto/dh/dh.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_DH_H -# define HEADER_DH_H - -# include - -# ifdef OPENSSL_NO_DH -# error DH is disabled. -# endif - -# ifndef OPENSSL_NO_BIO -# include -# endif -# include -# ifndef OPENSSL_NO_DEPRECATED -# include -# endif - -# ifndef OPENSSL_DH_MAX_MODULUS_BITS -# define OPENSSL_DH_MAX_MODULUS_BITS 10000 -# endif - -# define DH_FLAG_CACHE_MONT_P 0x01 - -/* - * new with 0.9.7h; the built-in DH - * implementation now uses constant time - * modular exponentiation for secret exponents - * by default. This flag causes the - * faster variable sliding window method to - * be used for all exponents. - */ -# define DH_FLAG_NO_EXP_CONSTTIME 0x02 - -/* - * If this flag is set the DH method is FIPS compliant and can be used in - * FIPS mode. This is set in the validated module method. If an application - * sets this flag in its own methods it is its reposibility to ensure the - * result is compliant. - */ - -# define DH_FLAG_FIPS_METHOD 0x0400 - -/* - * If this flag is set the operations normally disabled in FIPS mode are - * permitted it is then the applications responsibility to ensure that the - * usage is compliant. - */ - -# define DH_FLAG_NON_FIPS_ALLOW 0x0400 - -#ifdef __cplusplus -extern "C" { -#endif - -/* Already defined in ossl_typ.h */ -/* typedef struct dh_st DH; */ -/* typedef struct dh_method DH_METHOD; */ - -struct dh_method { - const char *name; - /* Methods here */ - int (*generate_key) (DH *dh); - int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh); - /* Can be null */ - int (*bn_mod_exp) (const DH *dh, BIGNUM *r, const BIGNUM *a, - const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, - BN_MONT_CTX *m_ctx); - int (*init) (DH *dh); - int (*finish) (DH *dh); - int flags; - char *app_data; - /* If this is non-NULL, it will be used to generate parameters */ - int (*generate_params) (DH *dh, int prime_len, int generator, - BN_GENCB *cb); -}; - -struct dh_st { - /* - * This first argument is used to pick up errors when a DH is passed - * instead of a EVP_PKEY - */ - int pad; - int version; - BIGNUM *p; - BIGNUM *g; - long length; /* optional */ - BIGNUM *pub_key; /* g^x % p */ - BIGNUM *priv_key; /* x */ - int flags; - BN_MONT_CTX *method_mont_p; - /* Place holders if we want to do X9.42 DH */ - BIGNUM *q; - BIGNUM *j; - unsigned char *seed; - int seedlen; - BIGNUM *counter; - int references; - CRYPTO_EX_DATA ex_data; - const DH_METHOD *meth; - ENGINE *engine; -}; - -# define DH_GENERATOR_2 2 -/* #define DH_GENERATOR_3 3 */ -# define DH_GENERATOR_5 5 - -/* DH_check error codes */ -# define DH_CHECK_P_NOT_PRIME 0x01 -# define DH_CHECK_P_NOT_SAFE_PRIME 0x02 -# define DH_UNABLE_TO_CHECK_GENERATOR 0x04 -# define DH_NOT_SUITABLE_GENERATOR 0x08 -# define DH_CHECK_Q_NOT_PRIME 0x10 -# define DH_CHECK_INVALID_Q_VALUE 0x20 -# define DH_CHECK_INVALID_J_VALUE 0x40 - -/* DH_check_pub_key error codes */ -# define DH_CHECK_PUBKEY_TOO_SMALL 0x01 -# define DH_CHECK_PUBKEY_TOO_LARGE 0x02 -# define DH_CHECK_PUBKEY_INVALID 0x04 - -/* - * primes p where (p-1)/2 is prime too are called "safe"; we define this for - * backward compatibility: - */ -# define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME - -# define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ - (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) -# define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ - (unsigned char *)(x)) -# define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) -# define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) - -DH *DHparams_dup(DH *); - -const DH_METHOD *DH_OpenSSL(void); - -void DH_set_default_method(const DH_METHOD *meth); -const DH_METHOD *DH_get_default_method(void); -int DH_set_method(DH *dh, const DH_METHOD *meth); -DH *DH_new_method(ENGINE *engine); - -DH *DH_new(void); -void DH_free(DH *dh); -int DH_up_ref(DH *dh); -int DH_size(const DH *dh); -int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int DH_set_ex_data(DH *d, int idx, void *arg); -void *DH_get_ex_data(DH *d, int idx); - -/* Deprecated version */ -# ifndef OPENSSL_NO_DEPRECATED -DH *DH_generate_parameters(int prime_len, int generator, - void (*callback) (int, int, void *), void *cb_arg); -# endif /* !defined(OPENSSL_NO_DEPRECATED) */ - -/* New version */ -int DH_generate_parameters_ex(DH *dh, int prime_len, int generator, - BN_GENCB *cb); - -int DH_check(const DH *dh, int *codes); -int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes); -int DH_generate_key(DH *dh); -int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh); -int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh); -DH *d2i_DHparams(DH **a, const unsigned char **pp, long length); -int i2d_DHparams(const DH *a, unsigned char **pp); -DH *d2i_DHxparams(DH **a, const unsigned char **pp, long length); -int i2d_DHxparams(const DH *a, unsigned char **pp); -# ifndef OPENSSL_NO_FP_API -int DHparams_print_fp(FILE *fp, const DH *x); -# endif -# ifndef OPENSSL_NO_BIO -int DHparams_print(BIO *bp, const DH *x); -# else -int DHparams_print(char *bp, const DH *x); -# endif - -/* RFC 5114 parameters */ -DH *DH_get_1024_160(void); -DH *DH_get_2048_224(void); -DH *DH_get_2048_256(void); - -/* RFC2631 KDF */ -int DH_KDF_X9_42(unsigned char *out, size_t outlen, - const unsigned char *Z, size_t Zlen, - ASN1_OBJECT *key_oid, - const unsigned char *ukm, size_t ukmlen, const EVP_MD *md); - -# define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ - EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL) - -# define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ - EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL) - -# define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ - EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL) - -# define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \ - EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL) - -# define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \ - EVP_PKEY_CTRL_DH_RFC5114, gen, NULL) - -# define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \ - EVP_PKEY_CTRL_DH_RFC5114, gen, NULL) - -# define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL) - -# define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL) - -# define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)oid) - -# define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)poid) - -# define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)md) - -# define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)pmd) - -# define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL) - -# define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)plen) - -# define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)p) - -# define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)p) - -# define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1) -# define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2) -# define EVP_PKEY_CTRL_DH_RFC5114 (EVP_PKEY_ALG_CTRL + 3) -# define EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN (EVP_PKEY_ALG_CTRL + 4) -# define EVP_PKEY_CTRL_DH_PARAMGEN_TYPE (EVP_PKEY_ALG_CTRL + 5) -# define EVP_PKEY_CTRL_DH_KDF_TYPE (EVP_PKEY_ALG_CTRL + 6) -# define EVP_PKEY_CTRL_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 7) -# define EVP_PKEY_CTRL_GET_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 8) -# define EVP_PKEY_CTRL_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 9) -# define EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 10) -# define EVP_PKEY_CTRL_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 11) -# define EVP_PKEY_CTRL_GET_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 12) -# define EVP_PKEY_CTRL_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 13) -# define EVP_PKEY_CTRL_GET_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 14) - -/* KDF types */ -# define EVP_PKEY_DH_KDF_NONE 1 -# define EVP_PKEY_DH_KDF_X9_42 2 - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_DH_strings(void); - -/* Error codes for the DH functions. */ - -/* Function codes. */ -# define DH_F_COMPUTE_KEY 102 -# define DH_F_DHPARAMS_PRINT_FP 101 -# define DH_F_DH_BUILTIN_GENPARAMS 106 -# define DH_F_DH_CMS_DECRYPT 117 -# define DH_F_DH_CMS_SET_PEERKEY 118 -# define DH_F_DH_CMS_SET_SHARED_INFO 119 -# define DH_F_DH_COMPUTE_KEY 114 -# define DH_F_DH_GENERATE_KEY 115 -# define DH_F_DH_GENERATE_PARAMETERS_EX 116 -# define DH_F_DH_NEW_METHOD 105 -# define DH_F_DH_PARAM_DECODE 107 -# define DH_F_DH_PRIV_DECODE 110 -# define DH_F_DH_PRIV_ENCODE 111 -# define DH_F_DH_PUB_DECODE 108 -# define DH_F_DH_PUB_ENCODE 109 -# define DH_F_DO_DH_PRINT 100 -# define DH_F_GENERATE_KEY 103 -# define DH_F_GENERATE_PARAMETERS 104 -# define DH_F_PKEY_DH_DERIVE 112 -# define DH_F_PKEY_DH_KEYGEN 113 - -/* Reason codes. */ -# define DH_R_BAD_GENERATOR 101 -# define DH_R_BN_DECODE_ERROR 109 -# define DH_R_BN_ERROR 106 -# define DH_R_DECODE_ERROR 104 -# define DH_R_INVALID_PUBKEY 102 -# define DH_R_KDF_PARAMETER_ERROR 112 -# define DH_R_KEYS_NOT_SET 108 -# define DH_R_KEY_SIZE_TOO_SMALL 110 -# define DH_R_MODULUS_TOO_LARGE 103 -# define DH_R_NON_FIPS_METHOD 111 -# define DH_R_NO_PARAMETERS_SET 107 -# define DH_R_NO_PRIVATE_VALUE 100 -# define DH_R_PARAMETER_ENCODING_ERROR 105 -# define DH_R_PEER_KEY_ERROR 113 -# define DH_R_SHARED_INFO_ERROR 114 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/dsa.h b/libs/win32/openssl/include/openssl/dsa.h deleted file mode 100644 index 545358fd02..0000000000 --- a/libs/win32/openssl/include/openssl/dsa.h +++ /dev/null @@ -1,332 +0,0 @@ -/* crypto/dsa/dsa.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -/* - * The DSS routines are based on patches supplied by - * Steven Schoch . He basically did the - * work and I have just tweaked them a little to fit into my - * stylistic vision for SSLeay :-) */ - -#ifndef HEADER_DSA_H -# define HEADER_DSA_H - -# include - -# ifdef OPENSSL_NO_DSA -# error DSA is disabled. -# endif - -# ifndef OPENSSL_NO_BIO -# include -# endif -# include -# include - -# ifndef OPENSSL_NO_DEPRECATED -# include -# ifndef OPENSSL_NO_DH -# include -# endif -# endif - -# ifndef OPENSSL_DSA_MAX_MODULUS_BITS -# define OPENSSL_DSA_MAX_MODULUS_BITS 10000 -# endif - -# define DSA_FLAG_CACHE_MONT_P 0x01 -/* - * new with 0.9.7h; the built-in DSA implementation now uses constant time - * modular exponentiation for secret exponents by default. This flag causes - * the faster variable sliding window method to be used for all exponents. - */ -# define DSA_FLAG_NO_EXP_CONSTTIME 0x02 - -/* - * If this flag is set the DSA method is FIPS compliant and can be used in - * FIPS mode. This is set in the validated module method. If an application - * sets this flag in its own methods it is its reposibility to ensure the - * result is compliant. - */ - -# define DSA_FLAG_FIPS_METHOD 0x0400 - -/* - * If this flag is set the operations normally disabled in FIPS mode are - * permitted it is then the applications responsibility to ensure that the - * usage is compliant. - */ - -# define DSA_FLAG_NON_FIPS_ALLOW 0x0400 - -#ifdef __cplusplus -extern "C" { -#endif - -/* Already defined in ossl_typ.h */ -/* typedef struct dsa_st DSA; */ -/* typedef struct dsa_method DSA_METHOD; */ - -typedef struct DSA_SIG_st { - BIGNUM *r; - BIGNUM *s; -} DSA_SIG; - -struct dsa_method { - const char *name; - DSA_SIG *(*dsa_do_sign) (const unsigned char *dgst, int dlen, DSA *dsa); - int (*dsa_sign_setup) (DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, - BIGNUM **rp); - int (*dsa_do_verify) (const unsigned char *dgst, int dgst_len, - DSA_SIG *sig, DSA *dsa); - int (*dsa_mod_exp) (DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, - BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, - BN_MONT_CTX *in_mont); - /* Can be null */ - int (*bn_mod_exp) (DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); - int (*init) (DSA *dsa); - int (*finish) (DSA *dsa); - int flags; - char *app_data; - /* If this is non-NULL, it is used to generate DSA parameters */ - int (*dsa_paramgen) (DSA *dsa, int bits, - const unsigned char *seed, int seed_len, - int *counter_ret, unsigned long *h_ret, - BN_GENCB *cb); - /* If this is non-NULL, it is used to generate DSA keys */ - int (*dsa_keygen) (DSA *dsa); -}; - -struct dsa_st { - /* - * This first variable is used to pick up errors where a DSA is passed - * instead of of a EVP_PKEY - */ - int pad; - long version; - int write_params; - BIGNUM *p; - BIGNUM *q; /* == 20 */ - BIGNUM *g; - BIGNUM *pub_key; /* y public key */ - BIGNUM *priv_key; /* x private key */ - BIGNUM *kinv; /* Signing pre-calc */ - BIGNUM *r; /* Signing pre-calc */ - int flags; - /* Normally used to cache montgomery values */ - BN_MONT_CTX *method_mont_p; - int references; - CRYPTO_EX_DATA ex_data; - const DSA_METHOD *meth; - /* functional reference if 'meth' is ENGINE-provided */ - ENGINE *engine; -}; - -# define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \ - (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x)) -# define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \ - (unsigned char *)(x)) -# define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x) -# define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x) - -DSA *DSAparams_dup(DSA *x); -DSA_SIG *DSA_SIG_new(void); -void DSA_SIG_free(DSA_SIG *a); -int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp); -DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length); - -DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); -int DSA_do_verify(const unsigned char *dgst, int dgst_len, - DSA_SIG *sig, DSA *dsa); - -const DSA_METHOD *DSA_OpenSSL(void); - -void DSA_set_default_method(const DSA_METHOD *); -const DSA_METHOD *DSA_get_default_method(void); -int DSA_set_method(DSA *dsa, const DSA_METHOD *); - -DSA *DSA_new(void); -DSA *DSA_new_method(ENGINE *engine); -void DSA_free(DSA *r); -/* "up" the DSA object's reference count */ -int DSA_up_ref(DSA *r); -int DSA_size(const DSA *); - /* next 4 return -1 on error */ -int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp); -int DSA_sign(int type, const unsigned char *dgst, int dlen, - unsigned char *sig, unsigned int *siglen, DSA *dsa); -int DSA_verify(int type, const unsigned char *dgst, int dgst_len, - const unsigned char *sigbuf, int siglen, DSA *dsa); -int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int DSA_set_ex_data(DSA *d, int idx, void *arg); -void *DSA_get_ex_data(DSA *d, int idx); - -DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); -DSA *d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length); -DSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length); - -/* Deprecated version */ -# ifndef OPENSSL_NO_DEPRECATED -DSA *DSA_generate_parameters(int bits, - unsigned char *seed, int seed_len, - int *counter_ret, unsigned long *h_ret, void - (*callback) (int, int, void *), void *cb_arg); -# endif /* !defined(OPENSSL_NO_DEPRECATED) */ - -/* New version */ -int DSA_generate_parameters_ex(DSA *dsa, int bits, - const unsigned char *seed, int seed_len, - int *counter_ret, unsigned long *h_ret, - BN_GENCB *cb); - -int DSA_generate_key(DSA *a); -int i2d_DSAPublicKey(const DSA *a, unsigned char **pp); -int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp); -int i2d_DSAparams(const DSA *a, unsigned char **pp); - -# ifndef OPENSSL_NO_BIO -int DSAparams_print(BIO *bp, const DSA *x); -int DSA_print(BIO *bp, const DSA *x, int off); -# endif -# ifndef OPENSSL_NO_FP_API -int DSAparams_print_fp(FILE *fp, const DSA *x); -int DSA_print_fp(FILE *bp, const DSA *x, int off); -# endif - -# define DSS_prime_checks 50 -/* - * Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of - * Rabin-Miller - */ -# define DSA_is_prime(n, callback, cb_arg) \ - BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) - -# ifndef OPENSSL_NO_DH -/* - * Convert DSA structure (key or just parameters) into DH structure (be - * careful to avoid small subgroup attacks when using this!) - */ -DH *DSA_dup_DH(const DSA *r); -# endif - -# define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \ - EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL) - -# define EVP_PKEY_CTRL_DSA_PARAMGEN_BITS (EVP_PKEY_ALG_CTRL + 1) -# define EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS (EVP_PKEY_ALG_CTRL + 2) -# define EVP_PKEY_CTRL_DSA_PARAMGEN_MD (EVP_PKEY_ALG_CTRL + 3) - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_DSA_strings(void); - -/* Error codes for the DSA functions. */ - -/* Function codes. */ -# define DSA_F_D2I_DSA_SIG 110 -# define DSA_F_DO_DSA_PRINT 104 -# define DSA_F_DSAPARAMS_PRINT 100 -# define DSA_F_DSAPARAMS_PRINT_FP 101 -# define DSA_F_DSA_BUILTIN_PARAMGEN2 126 -# define DSA_F_DSA_DO_SIGN 112 -# define DSA_F_DSA_DO_VERIFY 113 -# define DSA_F_DSA_GENERATE_KEY 124 -# define DSA_F_DSA_GENERATE_PARAMETERS_EX 123 -# define DSA_F_DSA_NEW_METHOD 103 -# define DSA_F_DSA_PARAM_DECODE 119 -# define DSA_F_DSA_PRINT_FP 105 -# define DSA_F_DSA_PRIV_DECODE 115 -# define DSA_F_DSA_PRIV_ENCODE 116 -# define DSA_F_DSA_PUB_DECODE 117 -# define DSA_F_DSA_PUB_ENCODE 118 -# define DSA_F_DSA_SIGN 106 -# define DSA_F_DSA_SIGN_SETUP 107 -# define DSA_F_DSA_SIG_NEW 109 -# define DSA_F_DSA_SIG_PRINT 125 -# define DSA_F_DSA_VERIFY 108 -# define DSA_F_I2D_DSA_SIG 111 -# define DSA_F_OLD_DSA_PRIV_DECODE 122 -# define DSA_F_PKEY_DSA_CTRL 120 -# define DSA_F_PKEY_DSA_KEYGEN 121 -# define DSA_F_SIG_CB 114 - -/* Reason codes. */ -# define DSA_R_BAD_Q_VALUE 102 -# define DSA_R_BN_DECODE_ERROR 108 -# define DSA_R_BN_ERROR 109 -# define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100 -# define DSA_R_DECODE_ERROR 104 -# define DSA_R_INVALID_DIGEST_TYPE 106 -# define DSA_R_INVALID_PARAMETERS 112 -# define DSA_R_MISSING_PARAMETERS 101 -# define DSA_R_MODULUS_TOO_LARGE 103 -# define DSA_R_NEED_NEW_SETUP_VALUES 110 -# define DSA_R_NON_FIPS_DSA_METHOD 111 -# define DSA_R_NO_PARAMETERS_SET 107 -# define DSA_R_PARAMETER_ENCODING_ERROR 105 -# define DSA_R_Q_NOT_PRIME 113 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/dso.h b/libs/win32/openssl/include/openssl/dso.h deleted file mode 100644 index c9013f5cea..0000000000 --- a/libs/win32/openssl/include/openssl/dso.h +++ /dev/null @@ -1,451 +0,0 @@ -/* dso.h */ -/* - * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project - * 2000. - */ -/* ==================================================================== - * Copyright (c) 2000 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_DSO_H -# define HEADER_DSO_H - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* These values are used as commands to DSO_ctrl() */ -# define DSO_CTRL_GET_FLAGS 1 -# define DSO_CTRL_SET_FLAGS 2 -# define DSO_CTRL_OR_FLAGS 3 - -/* - * By default, DSO_load() will translate the provided filename into a form - * typical for the platform (more specifically the DSO_METHOD) using the - * dso_name_converter function of the method. Eg. win32 will transform "blah" - * into "blah.dll", and dlfcn will transform it into "libblah.so". The - * behaviour can be overriden by setting the name_converter callback in the - * DSO object (using DSO_set_name_converter()). This callback could even - * utilise the DSO_METHOD's converter too if it only wants to override - * behaviour for one or two possible DSO methods. However, the following flag - * can be set in a DSO to prevent *any* native name-translation at all - eg. - * if the caller has prompted the user for a path to a driver library so the - * filename should be interpreted as-is. - */ -# define DSO_FLAG_NO_NAME_TRANSLATION 0x01 -/* - * An extra flag to give if only the extension should be added as - * translation. This is obviously only of importance on Unix and other - * operating systems where the translation also may prefix the name with - * something, like 'lib', and ignored everywhere else. This flag is also - * ignored if DSO_FLAG_NO_NAME_TRANSLATION is used at the same time. - */ -# define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY 0x02 - -/* - * The following flag controls the translation of symbol names to upper case. - * This is currently only being implemented for OpenVMS. - */ -# define DSO_FLAG_UPCASE_SYMBOL 0x10 - -/* - * This flag loads the library with public symbols. Meaning: The exported - * symbols of this library are public to all libraries loaded after this - * library. At the moment only implemented in unix. - */ -# define DSO_FLAG_GLOBAL_SYMBOLS 0x20 - -typedef void (*DSO_FUNC_TYPE) (void); - -typedef struct dso_st DSO; - -/* - * The function prototype used for method functions (or caller-provided - * callbacks) that transform filenames. They are passed a DSO structure - * pointer (or NULL if they are to be used independantly of a DSO object) and - * a filename to transform. They should either return NULL (if there is an - * error condition) or a newly allocated string containing the transformed - * form that the caller will need to free with OPENSSL_free() when done. - */ -typedef char *(*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *); -/* - * The function prototype used for method functions (or caller-provided - * callbacks) that merge two file specifications. They are passed a DSO - * structure pointer (or NULL if they are to be used independantly of a DSO - * object) and two file specifications to merge. They should either return - * NULL (if there is an error condition) or a newly allocated string - * containing the result of merging that the caller will need to free with - * OPENSSL_free() when done. Here, merging means that bits and pieces are - * taken from each of the file specifications and added together in whatever - * fashion that is sensible for the DSO method in question. The only rule - * that really applies is that if the two specification contain pieces of the - * same type, the copy from the first string takes priority. One could see - * it as the first specification is the one given by the user and the second - * being a bunch of defaults to add on if they're missing in the first. - */ -typedef char *(*DSO_MERGER_FUNC)(DSO *, const char *, const char *); - -typedef struct dso_meth_st { - const char *name; - /* - * Loads a shared library, NB: new DSO_METHODs must ensure that a - * successful load populates the loaded_filename field, and likewise a - * successful unload OPENSSL_frees and NULLs it out. - */ - int (*dso_load) (DSO *dso); - /* Unloads a shared library */ - int (*dso_unload) (DSO *dso); - /* Binds a variable */ - void *(*dso_bind_var) (DSO *dso, const char *symname); - /* - * Binds a function - assumes a return type of DSO_FUNC_TYPE. This should - * be cast to the real function prototype by the caller. Platforms that - * don't have compatible representations for different prototypes (this - * is possible within ANSI C) are highly unlikely to have shared - * libraries at all, let alone a DSO_METHOD implemented for them. - */ - DSO_FUNC_TYPE (*dso_bind_func) (DSO *dso, const char *symname); -/* I don't think this would actually be used in any circumstances. */ -# if 0 - /* Unbinds a variable */ - int (*dso_unbind_var) (DSO *dso, char *symname, void *symptr); - /* Unbinds a function */ - int (*dso_unbind_func) (DSO *dso, char *symname, DSO_FUNC_TYPE symptr); -# endif - /* - * The generic (yuck) "ctrl()" function. NB: Negative return values - * (rather than zero) indicate errors. - */ - long (*dso_ctrl) (DSO *dso, int cmd, long larg, void *parg); - /* - * The default DSO_METHOD-specific function for converting filenames to a - * canonical native form. - */ - DSO_NAME_CONVERTER_FUNC dso_name_converter; - /* - * The default DSO_METHOD-specific function for converting filenames to a - * canonical native form. - */ - DSO_MERGER_FUNC dso_merger; - /* [De]Initialisation handlers. */ - int (*init) (DSO *dso); - int (*finish) (DSO *dso); - /* Return pathname of the module containing location */ - int (*pathbyaddr) (void *addr, char *path, int sz); - /* Perform global symbol lookup, i.e. among *all* modules */ - void *(*globallookup) (const char *symname); -} DSO_METHOD; - -/**********************************************************************/ -/* The low-level handle type used to refer to a loaded shared library */ - -struct dso_st { - DSO_METHOD *meth; - /* - * Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS doesn't use - * anything but will need to cache the filename for use in the dso_bind - * handler. All in all, let each method control its own destiny. - * "Handles" and such go in a STACK. - */ - STACK_OF(void) *meth_data; - int references; - int flags; - /* - * For use by applications etc ... use this for your bits'n'pieces, don't - * touch meth_data! - */ - CRYPTO_EX_DATA ex_data; - /* - * If this callback function pointer is set to non-NULL, then it will be - * used in DSO_load() in place of meth->dso_name_converter. NB: This - * should normally set using DSO_set_name_converter(). - */ - DSO_NAME_CONVERTER_FUNC name_converter; - /* - * If this callback function pointer is set to non-NULL, then it will be - * used in DSO_load() in place of meth->dso_merger. NB: This should - * normally set using DSO_set_merger(). - */ - DSO_MERGER_FUNC merger; - /* - * This is populated with (a copy of) the platform-independant filename - * used for this DSO. - */ - char *filename; - /* - * This is populated with (a copy of) the translated filename by which - * the DSO was actually loaded. It is NULL iff the DSO is not currently - * loaded. NB: This is here because the filename translation process may - * involve a callback being invoked more than once not only to convert to - * a platform-specific form, but also to try different filenames in the - * process of trying to perform a load. As such, this variable can be - * used to indicate (a) whether this DSO structure corresponds to a - * loaded library or not, and (b) the filename with which it was actually - * loaded. - */ - char *loaded_filename; -}; - -DSO *DSO_new(void); -DSO *DSO_new_method(DSO_METHOD *method); -int DSO_free(DSO *dso); -int DSO_flags(DSO *dso); -int DSO_up_ref(DSO *dso); -long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg); - -/* - * This function sets the DSO's name_converter callback. If it is non-NULL, - * then it will be used instead of the associated DSO_METHOD's function. If - * oldcb is non-NULL then it is set to the function pointer value being - * replaced. Return value is non-zero for success. - */ -int DSO_set_name_converter(DSO *dso, DSO_NAME_CONVERTER_FUNC cb, - DSO_NAME_CONVERTER_FUNC *oldcb); -/* - * These functions can be used to get/set the platform-independant filename - * used for a DSO. NB: set will fail if the DSO is already loaded. - */ -const char *DSO_get_filename(DSO *dso); -int DSO_set_filename(DSO *dso, const char *filename); -/* - * This function will invoke the DSO's name_converter callback to translate a - * filename, or if the callback isn't set it will instead use the DSO_METHOD's - * converter. If "filename" is NULL, the "filename" in the DSO itself will be - * used. If the DSO_FLAG_NO_NAME_TRANSLATION flag is set, then the filename is - * simply duplicated. NB: This function is usually called from within a - * DSO_METHOD during the processing of a DSO_load() call, and is exposed so - * that caller-created DSO_METHODs can do the same thing. A non-NULL return - * value will need to be OPENSSL_free()'d. - */ -char *DSO_convert_filename(DSO *dso, const char *filename); -/* - * This function will invoke the DSO's merger callback to merge two file - * specifications, or if the callback isn't set it will instead use the - * DSO_METHOD's merger. A non-NULL return value will need to be - * OPENSSL_free()'d. - */ -char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2); -/* - * If the DSO is currently loaded, this returns the filename that it was - * loaded under, otherwise it returns NULL. So it is also useful as a test as - * to whether the DSO is currently loaded. NB: This will not necessarily - * return the same value as DSO_convert_filename(dso, dso->filename), because - * the DSO_METHOD's load function may have tried a variety of filenames (with - * and/or without the aid of the converters) before settling on the one it - * actually loaded. - */ -const char *DSO_get_loaded_filename(DSO *dso); - -void DSO_set_default_method(DSO_METHOD *meth); -DSO_METHOD *DSO_get_default_method(void); -DSO_METHOD *DSO_get_method(DSO *dso); -DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth); - -/* - * The all-singing all-dancing load function, you normally pass NULL for the - * first and third parameters. Use DSO_up and DSO_free for subsequent - * reference count handling. Any flags passed in will be set in the - * constructed DSO after its init() function but before the load operation. - * If 'dso' is non-NULL, 'flags' is ignored. - */ -DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags); - -/* This function binds to a variable inside a shared library. */ -void *DSO_bind_var(DSO *dso, const char *symname); - -/* This function binds to a function inside a shared library. */ -DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname); - -/* - * This method is the default, but will beg, borrow, or steal whatever method - * should be the default on any particular platform (including - * DSO_METH_null() if necessary). - */ -DSO_METHOD *DSO_METHOD_openssl(void); - -/* - * This method is defined for all platforms - if a platform has no DSO - * support then this will be the only method! - */ -DSO_METHOD *DSO_METHOD_null(void); - -/* - * If DSO_DLFCN is defined, the standard dlfcn.h-style functions (dlopen, - * dlclose, dlsym, etc) will be used and incorporated into this method. If - * not, this method will return NULL. - */ -DSO_METHOD *DSO_METHOD_dlfcn(void); - -/* - * If DSO_DL is defined, the standard dl.h-style functions (shl_load, - * shl_unload, shl_findsym, etc) will be used and incorporated into this - * method. If not, this method will return NULL. - */ -DSO_METHOD *DSO_METHOD_dl(void); - -/* If WIN32 is defined, use DLLs. If not, return NULL. */ -DSO_METHOD *DSO_METHOD_win32(void); - -/* If VMS is defined, use shared images. If not, return NULL. */ -DSO_METHOD *DSO_METHOD_vms(void); - -/* - * This function writes null-terminated pathname of DSO module containing - * 'addr' into 'sz' large caller-provided 'path' and returns the number of - * characters [including trailing zero] written to it. If 'sz' is 0 or - * negative, 'path' is ignored and required amount of charachers [including - * trailing zero] to accomodate pathname is returned. If 'addr' is NULL, then - * pathname of cryptolib itself is returned. Negative or zero return value - * denotes error. - */ -int DSO_pathbyaddr(void *addr, char *path, int sz); - -/* - * This function should be used with caution! It looks up symbols in *all* - * loaded modules and if module gets unloaded by somebody else attempt to - * dereference the pointer is doomed to have fatal consequences. Primary - * usage for this function is to probe *core* system functionality, e.g. - * check if getnameinfo(3) is available at run-time without bothering about - * OS-specific details such as libc.so.versioning or where does it actually - * reside: in libc itself or libsocket. - */ -void *DSO_global_lookup(const char *name); - -/* If BeOS is defined, use shared images. If not, return NULL. */ -DSO_METHOD *DSO_METHOD_beos(void); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_DSO_strings(void); - -/* Error codes for the DSO functions. */ - -/* Function codes. */ -# define DSO_F_BEOS_BIND_FUNC 144 -# define DSO_F_BEOS_BIND_VAR 145 -# define DSO_F_BEOS_LOAD 146 -# define DSO_F_BEOS_NAME_CONVERTER 147 -# define DSO_F_BEOS_UNLOAD 148 -# define DSO_F_DLFCN_BIND_FUNC 100 -# define DSO_F_DLFCN_BIND_VAR 101 -# define DSO_F_DLFCN_LOAD 102 -# define DSO_F_DLFCN_MERGER 130 -# define DSO_F_DLFCN_NAME_CONVERTER 123 -# define DSO_F_DLFCN_UNLOAD 103 -# define DSO_F_DL_BIND_FUNC 104 -# define DSO_F_DL_BIND_VAR 105 -# define DSO_F_DL_LOAD 106 -# define DSO_F_DL_MERGER 131 -# define DSO_F_DL_NAME_CONVERTER 124 -# define DSO_F_DL_UNLOAD 107 -# define DSO_F_DSO_BIND_FUNC 108 -# define DSO_F_DSO_BIND_VAR 109 -# define DSO_F_DSO_CONVERT_FILENAME 126 -# define DSO_F_DSO_CTRL 110 -# define DSO_F_DSO_FREE 111 -# define DSO_F_DSO_GET_FILENAME 127 -# define DSO_F_DSO_GET_LOADED_FILENAME 128 -# define DSO_F_DSO_GLOBAL_LOOKUP 139 -# define DSO_F_DSO_LOAD 112 -# define DSO_F_DSO_MERGE 132 -# define DSO_F_DSO_NEW_METHOD 113 -# define DSO_F_DSO_PATHBYADDR 140 -# define DSO_F_DSO_SET_FILENAME 129 -# define DSO_F_DSO_SET_NAME_CONVERTER 122 -# define DSO_F_DSO_UP_REF 114 -# define DSO_F_GLOBAL_LOOKUP_FUNC 138 -# define DSO_F_PATHBYADDR 137 -# define DSO_F_VMS_BIND_SYM 115 -# define DSO_F_VMS_LOAD 116 -# define DSO_F_VMS_MERGER 133 -# define DSO_F_VMS_UNLOAD 117 -# define DSO_F_WIN32_BIND_FUNC 118 -# define DSO_F_WIN32_BIND_VAR 119 -# define DSO_F_WIN32_GLOBALLOOKUP 142 -# define DSO_F_WIN32_GLOBALLOOKUP_FUNC 143 -# define DSO_F_WIN32_JOINER 135 -# define DSO_F_WIN32_LOAD 120 -# define DSO_F_WIN32_MERGER 134 -# define DSO_F_WIN32_NAME_CONVERTER 125 -# define DSO_F_WIN32_PATHBYADDR 141 -# define DSO_F_WIN32_SPLITTER 136 -# define DSO_F_WIN32_UNLOAD 121 - -/* Reason codes. */ -# define DSO_R_CTRL_FAILED 100 -# define DSO_R_DSO_ALREADY_LOADED 110 -# define DSO_R_EMPTY_FILE_STRUCTURE 113 -# define DSO_R_FAILURE 114 -# define DSO_R_FILENAME_TOO_BIG 101 -# define DSO_R_FINISH_FAILED 102 -# define DSO_R_INCORRECT_FILE_SYNTAX 115 -# define DSO_R_LOAD_FAILED 103 -# define DSO_R_NAME_TRANSLATION_FAILED 109 -# define DSO_R_NO_FILENAME 111 -# define DSO_R_NO_FILE_SPECIFICATION 116 -# define DSO_R_NULL_HANDLE 104 -# define DSO_R_SET_FILENAME_FAILED 112 -# define DSO_R_STACK_ERROR 105 -# define DSO_R_SYM_FAILURE 106 -# define DSO_R_UNLOAD_FAILED 107 -# define DSO_R_UNSUPPORTED 108 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/dtls1.h b/libs/win32/openssl/include/openssl/dtls1.h deleted file mode 100644 index 30bbcf278a..0000000000 --- a/libs/win32/openssl/include/openssl/dtls1.h +++ /dev/null @@ -1,272 +0,0 @@ -/* ssl/dtls1.h */ -/* - * DTLS implementation written by Nagendra Modadugu - * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. - */ -/* ==================================================================== - * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_DTLS1_H -# define HEADER_DTLS1_H - -# include -# include -# ifdef OPENSSL_SYS_VMS -# include -# include -# endif -# ifdef OPENSSL_SYS_WIN32 -/* Needed for struct timeval */ -# include -# elif defined(OPENSSL_SYS_NETWARE) && !defined(_WINSOCK2API_) -# include -# else -# if defined(OPENSSL_SYS_VXWORKS) -# include -# else -# include -# endif -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -# define DTLS1_VERSION 0xFEFF -# define DTLS1_2_VERSION 0xFEFD -# define DTLS_MAX_VERSION DTLS1_2_VERSION -# define DTLS1_VERSION_MAJOR 0xFE - -# define DTLS1_BAD_VER 0x0100 - -/* Special value for method supporting multiple versions */ -# define DTLS_ANY_VERSION 0x1FFFF - -# if 0 -/* this alert description is not specified anywhere... */ -# define DTLS1_AD_MISSING_HANDSHAKE_MESSAGE 110 -# endif - -/* lengths of messages */ -# define DTLS1_COOKIE_LENGTH 256 - -# define DTLS1_RT_HEADER_LENGTH 13 - -# define DTLS1_HM_HEADER_LENGTH 12 - -# define DTLS1_HM_BAD_FRAGMENT -2 -# define DTLS1_HM_FRAGMENT_RETRY -3 - -# define DTLS1_CCS_HEADER_LENGTH 1 - -# ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE -# define DTLS1_AL_HEADER_LENGTH 7 -# else -# define DTLS1_AL_HEADER_LENGTH 2 -# endif - -# ifndef OPENSSL_NO_SSL_INTERN - -# ifndef OPENSSL_NO_SCTP -# define DTLS1_SCTP_AUTH_LABEL "EXPORTER_DTLS_OVER_SCTP" -# endif - -/* Max MTU overhead we know about so far is 40 for IPv6 + 8 for UDP */ -# define DTLS1_MAX_MTU_OVERHEAD 48 - -typedef struct dtls1_bitmap_st { - unsigned long map; /* track 32 packets on 32-bit systems and 64 - * - on 64-bit systems */ - unsigned char max_seq_num[8]; /* max record number seen so far, 64-bit - * value in big-endian encoding */ -} DTLS1_BITMAP; - -struct dtls1_retransmit_state { - EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */ - EVP_MD_CTX *write_hash; /* used for mac generation */ -# ifndef OPENSSL_NO_COMP - COMP_CTX *compress; /* compression */ -# else - char *compress; -# endif - SSL_SESSION *session; - unsigned short epoch; -}; - -struct hm_header_st { - unsigned char type; - unsigned long msg_len; - unsigned short seq; - unsigned long frag_off; - unsigned long frag_len; - unsigned int is_ccs; - struct dtls1_retransmit_state saved_retransmit_state; -}; - -struct ccs_header_st { - unsigned char type; - unsigned short seq; -}; - -struct dtls1_timeout_st { - /* Number of read timeouts so far */ - unsigned int read_timeouts; - /* Number of write timeouts so far */ - unsigned int write_timeouts; - /* Number of alerts received so far */ - unsigned int num_alerts; -}; - -typedef struct record_pqueue_st { - unsigned short epoch; - pqueue q; -} record_pqueue; - -typedef struct hm_fragment_st { - struct hm_header_st msg_header; - unsigned char *fragment; - unsigned char *reassembly; -} hm_fragment; - -typedef struct dtls1_state_st { - unsigned int send_cookie; - unsigned char cookie[DTLS1_COOKIE_LENGTH]; - unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH]; - unsigned int cookie_len; - /* - * The current data and handshake epoch. This is initially - * undefined, and starts at zero once the initial handshake is - * completed - */ - unsigned short r_epoch; - unsigned short w_epoch; - /* records being received in the current epoch */ - DTLS1_BITMAP bitmap; - /* renegotiation starts a new set of sequence numbers */ - DTLS1_BITMAP next_bitmap; - /* handshake message numbers */ - unsigned short handshake_write_seq; - unsigned short next_handshake_write_seq; - unsigned short handshake_read_seq; - /* save last sequence number for retransmissions */ - unsigned char last_write_sequence[8]; - /* Received handshake records (processed and unprocessed) */ - record_pqueue unprocessed_rcds; - record_pqueue processed_rcds; - /* Buffered handshake messages */ - pqueue buffered_messages; - /* Buffered (sent) handshake records */ - pqueue sent_messages; - /* - * Buffered application records. Only for records between CCS and - * Finished to prevent either protocol violation or unnecessary message - * loss. - */ - record_pqueue buffered_app_data; - /* Is set when listening for new connections with dtls1_listen() */ - unsigned int listen; - unsigned int link_mtu; /* max on-the-wire DTLS packet size */ - unsigned int mtu; /* max DTLS packet size */ - struct hm_header_st w_msg_hdr; - struct hm_header_st r_msg_hdr; - struct dtls1_timeout_st timeout; - /* - * Indicates when the last handshake msg or heartbeat sent will timeout - */ - struct timeval next_timeout; - /* Timeout duration */ - unsigned short timeout_duration; - /* - * storage for Alert/Handshake protocol data received but not yet - * processed by ssl3_read_bytes: - */ - unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH]; - unsigned int alert_fragment_len; - unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH]; - unsigned int handshake_fragment_len; - unsigned int retransmitting; - /* - * Set when the handshake is ready to process peer's ChangeCipherSpec message. - * Cleared after the message has been processed. - */ - unsigned int change_cipher_spec_ok; -# ifndef OPENSSL_NO_SCTP - /* used when SSL_ST_XX_FLUSH is entered */ - int next_state; - int shutdown_received; -# endif -} DTLS1_STATE; - -typedef struct dtls1_record_data_st { - unsigned char *packet; - unsigned int packet_length; - SSL3_BUFFER rbuf; - SSL3_RECORD rrec; -# ifndef OPENSSL_NO_SCTP - struct bio_dgram_sctp_rcvinfo recordinfo; -# endif -} DTLS1_RECORD_DATA; - -# endif - -/* Timeout multipliers (timeout slice is defined in apps/timeouts.h */ -# define DTLS1_TMO_READ_COUNT 2 -# define DTLS1_TMO_WRITE_COUNT 2 - -# define DTLS1_TMO_ALERT_COUNT 12 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/e_os2.h b/libs/win32/openssl/include/openssl/e_os2.h deleted file mode 100644 index 7be9989ac3..0000000000 --- a/libs/win32/openssl/include/openssl/e_os2.h +++ /dev/null @@ -1,328 +0,0 @@ -/* e_os2.h */ -/* ==================================================================== - * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#include - -#ifndef HEADER_E_OS2_H -# define HEADER_E_OS2_H - -#ifdef __cplusplus -extern "C" { -#endif - -/****************************************************************************** - * Detect operating systems. This probably needs completing. - * The result is that at least one OPENSSL_SYS_os macro should be defined. - * However, if none is defined, Unix is assumed. - **/ - -# define OPENSSL_SYS_UNIX - -/* ---------------------- Macintosh, before MacOS X ----------------------- */ -# if defined(__MWERKS__) && defined(macintosh) || defined(OPENSSL_SYSNAME_MAC) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_MACINTOSH_CLASSIC -# endif - -/* ---------------------- NetWare ----------------------------------------- */ -# if defined(NETWARE) || defined(OPENSSL_SYSNAME_NETWARE) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_NETWARE -# endif - -/* --------------------- Microsoft operating systems ---------------------- */ - -/* - * Note that MSDOS actually denotes 32-bit environments running on top of - * MS-DOS, such as DJGPP one. - */ -# if defined(OPENSSL_SYSNAME_MSDOS) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_MSDOS -# endif - -/* - * For 32 bit environment, there seems to be the CygWin environment and then - * all the others that try to do the same thing Microsoft does... - */ -# if defined(OPENSSL_SYSNAME_UWIN) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WIN32_UWIN -# else -# if defined(__CYGWIN__) || defined(OPENSSL_SYSNAME_CYGWIN) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WIN32_CYGWIN -# else -# if defined(_WIN32) || defined(OPENSSL_SYSNAME_WIN32) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WIN32 -# endif -# if defined(_WIN64) || defined(OPENSSL_SYSNAME_WIN64) -# undef OPENSSL_SYS_UNIX -# if !defined(OPENSSL_SYS_WIN64) -# define OPENSSL_SYS_WIN64 -# endif -# endif -# if defined(OPENSSL_SYSNAME_WINNT) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WINNT -# endif -# if defined(OPENSSL_SYSNAME_WINCE) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WINCE -# endif -# endif -# endif - -/* Anything that tries to look like Microsoft is "Windows" */ -# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_WINDOWS -# ifndef OPENSSL_SYS_MSDOS -# define OPENSSL_SYS_MSDOS -# endif -# endif - -/* - * DLL settings. This part is a bit tough, because it's up to the - * application implementor how he or she will link the application, so it - * requires some macro to be used. - */ -# ifdef OPENSSL_SYS_WINDOWS -# ifndef OPENSSL_OPT_WINDLL -# if defined(_WINDLL) /* This is used when building OpenSSL to - * indicate that DLL linkage should be used */ -# define OPENSSL_OPT_WINDLL -# endif -# endif -# endif - -/* ------------------------------- OpenVMS -------------------------------- */ -# if defined(__VMS) || defined(VMS) || defined(OPENSSL_SYSNAME_VMS) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_VMS -# if defined(__DECC) -# define OPENSSL_SYS_VMS_DECC -# elif defined(__DECCXX) -# define OPENSSL_SYS_VMS_DECC -# define OPENSSL_SYS_VMS_DECCXX -# else -# define OPENSSL_SYS_VMS_NODECC -# endif -# endif - -/* -------------------------------- OS/2 ---------------------------------- */ -# if defined(__EMX__) || defined(__OS2__) -# undef OPENSSL_SYS_UNIX -# define OPENSSL_SYS_OS2 -# endif - -/* -------------------------------- Unix ---------------------------------- */ -# ifdef OPENSSL_SYS_UNIX -# if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX) -# define OPENSSL_SYS_LINUX -# endif -# ifdef OPENSSL_SYSNAME_MPE -# define OPENSSL_SYS_MPE -# endif -# ifdef OPENSSL_SYSNAME_SNI -# define OPENSSL_SYS_SNI -# endif -# ifdef OPENSSL_SYSNAME_ULTRASPARC -# define OPENSSL_SYS_ULTRASPARC -# endif -# ifdef OPENSSL_SYSNAME_NEWS4 -# define OPENSSL_SYS_NEWS4 -# endif -# ifdef OPENSSL_SYSNAME_MACOSX -# define OPENSSL_SYS_MACOSX -# endif -# ifdef OPENSSL_SYSNAME_MACOSX_RHAPSODY -# define OPENSSL_SYS_MACOSX_RHAPSODY -# define OPENSSL_SYS_MACOSX -# endif -# ifdef OPENSSL_SYSNAME_SUNOS -# define OPENSSL_SYS_SUNOS -# endif -# if defined(_CRAY) || defined(OPENSSL_SYSNAME_CRAY) -# define OPENSSL_SYS_CRAY -# endif -# if defined(_AIX) || defined(OPENSSL_SYSNAME_AIX) -# define OPENSSL_SYS_AIX -# endif -# endif - -/* -------------------------------- VOS ----------------------------------- */ -# if defined(__VOS__) || defined(OPENSSL_SYSNAME_VOS) -# define OPENSSL_SYS_VOS -# ifdef __HPPA__ -# define OPENSSL_SYS_VOS_HPPA -# endif -# ifdef __IA32__ -# define OPENSSL_SYS_VOS_IA32 -# endif -# endif - -/* ------------------------------ VxWorks --------------------------------- */ -# ifdef OPENSSL_SYSNAME_VXWORKS -# define OPENSSL_SYS_VXWORKS -# endif - -/* -------------------------------- BeOS ---------------------------------- */ -# if defined(__BEOS__) -# define OPENSSL_SYS_BEOS -# include -# if defined(BONE_VERSION) -# define OPENSSL_SYS_BEOS_BONE -# else -# define OPENSSL_SYS_BEOS_R5 -# endif -# endif - -/** - * That's it for OS-specific stuff - *****************************************************************************/ - -/* Specials for I/O an exit */ -# ifdef OPENSSL_SYS_MSDOS -# define OPENSSL_UNISTD_IO -# define OPENSSL_DECLARE_EXIT extern void exit(int); -# else -# define OPENSSL_UNISTD_IO OPENSSL_UNISTD -# define OPENSSL_DECLARE_EXIT /* declared in unistd.h */ -# endif - -/*- - * Definitions of OPENSSL_GLOBAL and OPENSSL_EXTERN, to define and declare - * certain global symbols that, with some compilers under VMS, have to be - * defined and declared explicitely with globaldef and globalref. - * Definitions of OPENSSL_EXPORT and OPENSSL_IMPORT, to define and declare - * DLL exports and imports for compilers under Win32. These are a little - * more complicated to use. Basically, for any library that exports some - * global variables, the following code must be present in the header file - * that declares them, before OPENSSL_EXTERN is used: - * - * #ifdef SOME_BUILD_FLAG_MACRO - * # undef OPENSSL_EXTERN - * # define OPENSSL_EXTERN OPENSSL_EXPORT - * #endif - * - * The default is to have OPENSSL_EXPORT, OPENSSL_IMPORT and OPENSSL_GLOBAL - * have some generally sensible values, and for OPENSSL_EXTERN to have the - * value OPENSSL_IMPORT. - */ - -# if defined(OPENSSL_SYS_VMS_NODECC) -# define OPENSSL_EXPORT globalref -# define OPENSSL_IMPORT globalref -# define OPENSSL_GLOBAL globaldef -# elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL) -# define OPENSSL_EXPORT extern __declspec(dllexport) -# define OPENSSL_IMPORT extern __declspec(dllimport) -# define OPENSSL_GLOBAL -# else -# define OPENSSL_EXPORT extern -# define OPENSSL_IMPORT extern -# define OPENSSL_GLOBAL -# endif -# define OPENSSL_EXTERN OPENSSL_IMPORT - -/*- - * Macros to allow global variables to be reached through function calls when - * required (if a shared library version requires it, for example. - * The way it's done allows definitions like this: - * - * // in foobar.c - * OPENSSL_IMPLEMENT_GLOBAL(int,foobar,0) - * // in foobar.h - * OPENSSL_DECLARE_GLOBAL(int,foobar); - * #define foobar OPENSSL_GLOBAL_REF(foobar) - */ -# ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION -# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) \ - type *_shadow_##name(void) \ - { static type _hide_##name=value; return &_hide_##name; } -# define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void) -# define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name())) -# else -# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) OPENSSL_GLOBAL type _shadow_##name=value; -# define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name -# define OPENSSL_GLOBAL_REF(name) _shadow_##name -# endif - -# if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && macintosh==1 && !defined(MAC_OS_GUSI_SOURCE) -# define ossl_ssize_t long -# endif - -# ifdef OPENSSL_SYS_MSDOS -# define ossl_ssize_t long -# endif - -# if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS) -# define ssize_t int -# endif - -# if defined(__ultrix) && !defined(ssize_t) -# define ossl_ssize_t int -# endif - -# ifndef ossl_ssize_t -# define ossl_ssize_t ssize_t -# endif - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/ebcdic.h b/libs/win32/openssl/include/openssl/ebcdic.h deleted file mode 100644 index 4cbdfeb7ae..0000000000 --- a/libs/win32/openssl/include/openssl/ebcdic.h +++ /dev/null @@ -1,26 +0,0 @@ -/* crypto/ebcdic.h */ - -#ifndef HEADER_EBCDIC_H -# define HEADER_EBCDIC_H - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Avoid name clashes with other applications */ -# define os_toascii _openssl_os_toascii -# define os_toebcdic _openssl_os_toebcdic -# define ebcdic2ascii _openssl_ebcdic2ascii -# define ascii2ebcdic _openssl_ascii2ebcdic - -extern const unsigned char os_toascii[256]; -extern const unsigned char os_toebcdic[256]; -void *ebcdic2ascii(void *dest, const void *srce, size_t count); -void *ascii2ebcdic(void *dest, const void *srce, size_t count); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/ec.h b/libs/win32/openssl/include/openssl/ec.h deleted file mode 100644 index 81e6faf6c5..0000000000 --- a/libs/win32/openssl/include/openssl/ec.h +++ /dev/null @@ -1,1282 +0,0 @@ -/* crypto/ec/ec.h */ -/* - * Originally written by Bodo Moeller for the OpenSSL project. - */ -/** - * \file crypto/ec/ec.h Include file for the OpenSSL EC functions - * \author Originally written by Bodo Moeller for the OpenSSL project - */ -/* ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * The elliptic curve binary polynomial software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories. - * - */ - -#ifndef HEADER_EC_H -# define HEADER_EC_H - -# include - -# ifdef OPENSSL_NO_EC -# error EC is disabled. -# endif - -# include -# include -# ifndef OPENSSL_NO_DEPRECATED -# include -# endif - -# ifdef __cplusplus -extern "C" { -# elif defined(__SUNPRO_C) -# if __SUNPRO_C >= 0x520 -# pragma error_messages (off,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE) -# endif -# endif - -# ifndef OPENSSL_ECC_MAX_FIELD_BITS -# define OPENSSL_ECC_MAX_FIELD_BITS 661 -# endif - -/** Enum for the point conversion form as defined in X9.62 (ECDSA) - * for the encoding of a elliptic curve point (x,y) */ -typedef enum { - /** the point is encoded as z||x, where the octet z specifies - * which solution of the quadratic equation y is */ - POINT_CONVERSION_COMPRESSED = 2, - /** the point is encoded as z||x||y, where z is the octet 0x04 */ - POINT_CONVERSION_UNCOMPRESSED = 4, - /** the point is encoded as z||x||y, where the octet z specifies - * which solution of the quadratic equation y is */ - POINT_CONVERSION_HYBRID = 6 -} point_conversion_form_t; - -typedef struct ec_method_st EC_METHOD; - -typedef struct ec_group_st - /*- - EC_METHOD *meth; - -- field definition - -- curve coefficients - -- optional generator with associated information (order, cofactor) - -- optional extra data (precomputed table for fast computation of multiples of generator) - -- ASN1 stuff - */ - EC_GROUP; - -typedef struct ec_point_st EC_POINT; - -/********************************************************************/ -/* EC_METHODs for curves over GF(p) */ -/********************************************************************/ - -/** Returns the basic GFp ec methods which provides the basis for the - * optimized methods. - * \return EC_METHOD object - */ -const EC_METHOD *EC_GFp_simple_method(void); - -/** Returns GFp methods using montgomery multiplication. - * \return EC_METHOD object - */ -const EC_METHOD *EC_GFp_mont_method(void); - -/** Returns GFp methods using optimized methods for NIST recommended curves - * \return EC_METHOD object - */ -const EC_METHOD *EC_GFp_nist_method(void); - -# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 -/** Returns 64-bit optimized methods for nistp224 - * \return EC_METHOD object - */ -const EC_METHOD *EC_GFp_nistp224_method(void); - -/** Returns 64-bit optimized methods for nistp256 - * \return EC_METHOD object - */ -const EC_METHOD *EC_GFp_nistp256_method(void); - -/** Returns 64-bit optimized methods for nistp521 - * \return EC_METHOD object - */ -const EC_METHOD *EC_GFp_nistp521_method(void); -# endif - -# ifndef OPENSSL_NO_EC2M -/********************************************************************/ -/* EC_METHOD for curves over GF(2^m) */ -/********************************************************************/ - -/** Returns the basic GF2m ec method - * \return EC_METHOD object - */ -const EC_METHOD *EC_GF2m_simple_method(void); - -# endif - -/********************************************************************/ -/* EC_GROUP functions */ -/********************************************************************/ - -/** Creates a new EC_GROUP object - * \param meth EC_METHOD to use - * \return newly created EC_GROUP object or NULL in case of an error. - */ -EC_GROUP *EC_GROUP_new(const EC_METHOD *meth); - -/** Frees a EC_GROUP object - * \param group EC_GROUP object to be freed. - */ -void EC_GROUP_free(EC_GROUP *group); - -/** Clears and frees a EC_GROUP object - * \param group EC_GROUP object to be cleared and freed. - */ -void EC_GROUP_clear_free(EC_GROUP *group); - -/** Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD. - * \param dst destination EC_GROUP object - * \param src source EC_GROUP object - * \return 1 on success and 0 if an error occurred. - */ -int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src); - -/** Creates a new EC_GROUP object and copies the copies the content - * form src to the newly created EC_KEY object - * \param src source EC_GROUP object - * \return newly created EC_GROUP object or NULL in case of an error. - */ -EC_GROUP *EC_GROUP_dup(const EC_GROUP *src); - -/** Returns the EC_METHOD of the EC_GROUP object. - * \param group EC_GROUP object - * \return EC_METHOD used in this EC_GROUP object. - */ -const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group); - -/** Returns the field type of the EC_METHOD. - * \param meth EC_METHOD object - * \return NID of the underlying field type OID. - */ -int EC_METHOD_get_field_type(const EC_METHOD *meth); - -/** Sets the generator and it's order/cofactor of a EC_GROUP object. - * \param group EC_GROUP object - * \param generator EC_POINT object with the generator. - * \param order the order of the group generated by the generator. - * \param cofactor the index of the sub-group generated by the generator - * in the group of all points on the elliptic curve. - * \return 1 on success and 0 if an error occured - */ -int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, - const BIGNUM *order, const BIGNUM *cofactor); - -/** Returns the generator of a EC_GROUP object. - * \param group EC_GROUP object - * \return the currently used generator (possibly NULL). - */ -const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group); - -/** Returns the montgomery data for order(Generator) - * \param group EC_GROUP object - * \return the currently used generator (possibly NULL). -*/ -BN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group); - -/** Gets the order of a EC_GROUP - * \param group EC_GROUP object - * \param order BIGNUM to which the order is copied - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx); - -/** Gets the cofactor of a EC_GROUP - * \param group EC_GROUP object - * \param cofactor BIGNUM to which the cofactor is copied - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, - BN_CTX *ctx); - -/** Sets the name of a EC_GROUP object - * \param group EC_GROUP object - * \param nid NID of the curve name OID - */ -void EC_GROUP_set_curve_name(EC_GROUP *group, int nid); - -/** Returns the curve name of a EC_GROUP object - * \param group EC_GROUP object - * \return NID of the curve name OID or 0 if not set. - */ -int EC_GROUP_get_curve_name(const EC_GROUP *group); - -void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag); -int EC_GROUP_get_asn1_flag(const EC_GROUP *group); - -void EC_GROUP_set_point_conversion_form(EC_GROUP *group, - point_conversion_form_t form); -point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *); - -unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x); -size_t EC_GROUP_get_seed_len(const EC_GROUP *); -size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len); - -/** Sets the parameter of a ec over GFp defined by y^2 = x^3 + a*x + b - * \param group EC_GROUP object - * \param p BIGNUM with the prime number - * \param a BIGNUM with parameter a of the equation - * \param b BIGNUM with parameter b of the equation - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, - const BIGNUM *b, BN_CTX *ctx); - -/** Gets the parameter of the ec over GFp defined by y^2 = x^3 + a*x + b - * \param group EC_GROUP object - * \param p BIGNUM for the prime number - * \param a BIGNUM for parameter a of the equation - * \param b BIGNUM for parameter b of the equation - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, - BIGNUM *b, BN_CTX *ctx); - -# ifndef OPENSSL_NO_EC2M -/** Sets the parameter of a ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b - * \param group EC_GROUP object - * \param p BIGNUM with the polynomial defining the underlying field - * \param a BIGNUM with parameter a of the equation - * \param b BIGNUM with parameter b of the equation - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, - const BIGNUM *b, BN_CTX *ctx); - -/** Gets the parameter of the ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b - * \param group EC_GROUP object - * \param p BIGNUM for the polynomial defining the underlying field - * \param a BIGNUM for parameter a of the equation - * \param b BIGNUM for parameter b of the equation - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, - BIGNUM *b, BN_CTX *ctx); -# endif -/** Returns the number of bits needed to represent a field element - * \param group EC_GROUP object - * \return number of bits needed to represent a field element - */ -int EC_GROUP_get_degree(const EC_GROUP *group); - -/** Checks whether the parameter in the EC_GROUP define a valid ec group - * \param group EC_GROUP object - * \param ctx BN_CTX object (optional) - * \return 1 if group is a valid ec group and 0 otherwise - */ -int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx); - -/** Checks whether the discriminant of the elliptic curve is zero or not - * \param group EC_GROUP object - * \param ctx BN_CTX object (optional) - * \return 1 if the discriminant is not zero and 0 otherwise - */ -int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx); - -/** Compares two EC_GROUP objects - * \param a first EC_GROUP object - * \param b second EC_GROUP object - * \param ctx BN_CTX object (optional) - * \return 0 if both groups are equal and 1 otherwise - */ -int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx); - -/* - * EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() after - * choosing an appropriate EC_METHOD - */ - -/** Creates a new EC_GROUP object with the specified parameters defined - * over GFp (defined by the equation y^2 = x^3 + a*x + b) - * \param p BIGNUM with the prime number - * \param a BIGNUM with the parameter a of the equation - * \param b BIGNUM with the parameter b of the equation - * \param ctx BN_CTX object (optional) - * \return newly created EC_GROUP object with the specified parameters - */ -EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, - const BIGNUM *b, BN_CTX *ctx); -# ifndef OPENSSL_NO_EC2M -/** Creates a new EC_GROUP object with the specified parameters defined - * over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b) - * \param p BIGNUM with the polynomial defining the underlying field - * \param a BIGNUM with the parameter a of the equation - * \param b BIGNUM with the parameter b of the equation - * \param ctx BN_CTX object (optional) - * \return newly created EC_GROUP object with the specified parameters - */ -EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, - const BIGNUM *b, BN_CTX *ctx); -# endif -/** Creates a EC_GROUP object with a curve specified by a NID - * \param nid NID of the OID of the curve name - * \return newly created EC_GROUP object with specified curve or NULL - * if an error occurred - */ -EC_GROUP *EC_GROUP_new_by_curve_name(int nid); - -/********************************************************************/ -/* handling of internal curves */ -/********************************************************************/ - -typedef struct { - int nid; - const char *comment; -} EC_builtin_curve; - -/* - * EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number of all - * available curves or zero if a error occurred. In case r ist not zero - * nitems EC_builtin_curve structures are filled with the data of the first - * nitems internal groups - */ -size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems); - -const char *EC_curve_nid2nist(int nid); -int EC_curve_nist2nid(const char *name); - -/********************************************************************/ -/* EC_POINT functions */ -/********************************************************************/ - -/** Creates a new EC_POINT object for the specified EC_GROUP - * \param group EC_GROUP the underlying EC_GROUP object - * \return newly created EC_POINT object or NULL if an error occurred - */ -EC_POINT *EC_POINT_new(const EC_GROUP *group); - -/** Frees a EC_POINT object - * \param point EC_POINT object to be freed - */ -void EC_POINT_free(EC_POINT *point); - -/** Clears and frees a EC_POINT object - * \param point EC_POINT object to be cleared and freed - */ -void EC_POINT_clear_free(EC_POINT *point); - -/** Copies EC_POINT object - * \param dst destination EC_POINT object - * \param src source EC_POINT object - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src); - -/** Creates a new EC_POINT object and copies the content of the supplied - * EC_POINT - * \param src source EC_POINT object - * \param group underlying the EC_GROUP object - * \return newly created EC_POINT object or NULL if an error occurred - */ -EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group); - -/** Returns the EC_METHOD used in EC_POINT object - * \param point EC_POINT object - * \return the EC_METHOD used - */ -const EC_METHOD *EC_POINT_method_of(const EC_POINT *point); - -/** Sets a point to infinity (neutral element) - * \param group underlying EC_GROUP object - * \param point EC_POINT to set to infinity - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point); - -/** Sets the jacobian projective coordinates of a EC_POINT over GFp - * \param group underlying EC_GROUP object - * \param p EC_POINT object - * \param x BIGNUM with the x-coordinate - * \param y BIGNUM with the y-coordinate - * \param z BIGNUM with the z-coordinate - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, - EC_POINT *p, const BIGNUM *x, - const BIGNUM *y, const BIGNUM *z, - BN_CTX *ctx); - -/** Gets the jacobian projective coordinates of a EC_POINT over GFp - * \param group underlying EC_GROUP object - * \param p EC_POINT object - * \param x BIGNUM for the x-coordinate - * \param y BIGNUM for the y-coordinate - * \param z BIGNUM for the z-coordinate - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, - const EC_POINT *p, BIGNUM *x, - BIGNUM *y, BIGNUM *z, - BN_CTX *ctx); - -/** Sets the affine coordinates of a EC_POINT over GFp - * \param group underlying EC_GROUP object - * \param p EC_POINT object - * \param x BIGNUM with the x-coordinate - * \param y BIGNUM with the y-coordinate - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, - const BIGNUM *x, const BIGNUM *y, - BN_CTX *ctx); - -/** Gets the affine coordinates of a EC_POINT over GFp - * \param group underlying EC_GROUP object - * \param p EC_POINT object - * \param x BIGNUM for the x-coordinate - * \param y BIGNUM for the y-coordinate - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, - const EC_POINT *p, BIGNUM *x, - BIGNUM *y, BN_CTX *ctx); - -/** Sets the x9.62 compressed coordinates of a EC_POINT over GFp - * \param group underlying EC_GROUP object - * \param p EC_POINT object - * \param x BIGNUM with x-coordinate - * \param y_bit integer with the y-Bit (either 0 or 1) - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, - EC_POINT *p, const BIGNUM *x, - int y_bit, BN_CTX *ctx); -# ifndef OPENSSL_NO_EC2M -/** Sets the affine coordinates of a EC_POINT over GF2m - * \param group underlying EC_GROUP object - * \param p EC_POINT object - * \param x BIGNUM with the x-coordinate - * \param y BIGNUM with the y-coordinate - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, - const BIGNUM *x, const BIGNUM *y, - BN_CTX *ctx); - -/** Gets the affine coordinates of a EC_POINT over GF2m - * \param group underlying EC_GROUP object - * \param p EC_POINT object - * \param x BIGNUM for the x-coordinate - * \param y BIGNUM for the y-coordinate - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, - const EC_POINT *p, BIGNUM *x, - BIGNUM *y, BN_CTX *ctx); - -/** Sets the x9.62 compressed coordinates of a EC_POINT over GF2m - * \param group underlying EC_GROUP object - * \param p EC_POINT object - * \param x BIGNUM with x-coordinate - * \param y_bit integer with the y-Bit (either 0 or 1) - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, - EC_POINT *p, const BIGNUM *x, - int y_bit, BN_CTX *ctx); -# endif -/** Encodes a EC_POINT object to a octet string - * \param group underlying EC_GROUP object - * \param p EC_POINT object - * \param form point conversion form - * \param buf memory buffer for the result. If NULL the function returns - * required buffer size. - * \param len length of the memory buffer - * \param ctx BN_CTX object (optional) - * \return the length of the encoded octet string or 0 if an error occurred - */ -size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p, - point_conversion_form_t form, - unsigned char *buf, size_t len, BN_CTX *ctx); - -/** Decodes a EC_POINT from a octet string - * \param group underlying EC_GROUP object - * \param p EC_POINT object - * \param buf memory buffer with the encoded ec point - * \param len length of the encoded ec point - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, - const unsigned char *buf, size_t len, BN_CTX *ctx); - -/* other interfaces to point2oct/oct2point: */ -BIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *, - point_conversion_form_t form, BIGNUM *, BN_CTX *); -EC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *, - EC_POINT *, BN_CTX *); -char *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *, - point_conversion_form_t form, BN_CTX *); -EC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *, - EC_POINT *, BN_CTX *); - -/********************************************************************/ -/* functions for doing EC_POINT arithmetic */ -/********************************************************************/ - -/** Computes the sum of two EC_POINT - * \param group underlying EC_GROUP object - * \param r EC_POINT object for the result (r = a + b) - * \param a EC_POINT object with the first summand - * \param b EC_POINT object with the second summand - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, - const EC_POINT *b, BN_CTX *ctx); - -/** Computes the double of a EC_POINT - * \param group underlying EC_GROUP object - * \param r EC_POINT object for the result (r = 2 * a) - * \param a EC_POINT object - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, - BN_CTX *ctx); - -/** Computes the inverse of a EC_POINT - * \param group underlying EC_GROUP object - * \param a EC_POINT object to be inverted (it's used for the result as well) - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx); - -/** Checks whether the point is the neutral element of the group - * \param group the underlying EC_GROUP object - * \param p EC_POINT object - * \return 1 if the point is the neutral element and 0 otherwise - */ -int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p); - -/** Checks whether the point is on the curve - * \param group underlying EC_GROUP object - * \param point EC_POINT object to check - * \param ctx BN_CTX object (optional) - * \return 1 if point if on the curve and 0 otherwise - */ -int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, - BN_CTX *ctx); - -/** Compares two EC_POINTs - * \param group underlying EC_GROUP object - * \param a first EC_POINT object - * \param b second EC_POINT object - * \param ctx BN_CTX object (optional) - * \return 0 if both points are equal and a value != 0 otherwise - */ -int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, - BN_CTX *ctx); - -int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx); -int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, - EC_POINT *points[], BN_CTX *ctx); - -/** Computes r = generator * n sum_{i=0}^{num-1} p[i] * m[i] - * \param group underlying EC_GROUP object - * \param r EC_POINT object for the result - * \param n BIGNUM with the multiplier for the group generator (optional) - * \param num number futher summands - * \param p array of size num of EC_POINT objects - * \param m array of size num of BIGNUM objects - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, - size_t num, const EC_POINT *p[], const BIGNUM *m[], - BN_CTX *ctx); - -/** Computes r = generator * n + q * m - * \param group underlying EC_GROUP object - * \param r EC_POINT object for the result - * \param n BIGNUM with the multiplier for the group generator (optional) - * \param q EC_POINT object with the first factor of the second summand - * \param m BIGNUM with the second factor of the second summand - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, - const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx); - -/** Stores multiples of generator for faster point multiplication - * \param group EC_GROUP object - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occured - */ -int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx); - -/** Reports whether a precomputation has been done - * \param group EC_GROUP object - * \return 1 if a pre-computation has been done and 0 otherwise - */ -int EC_GROUP_have_precompute_mult(const EC_GROUP *group); - -/********************************************************************/ -/* ASN1 stuff */ -/********************************************************************/ - -/* - * EC_GROUP_get_basis_type() returns the NID of the basis type used to - * represent the field elements - */ -int EC_GROUP_get_basis_type(const EC_GROUP *); -# ifndef OPENSSL_NO_EC2M -int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k); -int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1, - unsigned int *k2, unsigned int *k3); -# endif - -# define OPENSSL_EC_NAMED_CURVE 0x001 - -typedef struct ecpk_parameters_st ECPKPARAMETERS; - -EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len); -int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out); - -# define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x) -# define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x) -# define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \ - (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x)) -# define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \ - (unsigned char *)(x)) - -# ifndef OPENSSL_NO_BIO -int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off); -# endif -# ifndef OPENSSL_NO_FP_API -int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off); -# endif - -/********************************************************************/ -/* EC_KEY functions */ -/********************************************************************/ - -typedef struct ec_key_st EC_KEY; - -/* some values for the encoding_flag */ -# define EC_PKEY_NO_PARAMETERS 0x001 -# define EC_PKEY_NO_PUBKEY 0x002 - -/* some values for the flags field */ -# define EC_FLAG_NON_FIPS_ALLOW 0x1 -# define EC_FLAG_FIPS_CHECKED 0x2 - -/** Creates a new EC_KEY object. - * \return EC_KEY object or NULL if an error occurred. - */ -EC_KEY *EC_KEY_new(void); - -int EC_KEY_get_flags(const EC_KEY *key); - -void EC_KEY_set_flags(EC_KEY *key, int flags); - -void EC_KEY_clear_flags(EC_KEY *key, int flags); - -/** Creates a new EC_KEY object using a named curve as underlying - * EC_GROUP object. - * \param nid NID of the named curve. - * \return EC_KEY object or NULL if an error occurred. - */ -EC_KEY *EC_KEY_new_by_curve_name(int nid); - -/** Frees a EC_KEY object. - * \param key EC_KEY object to be freed. - */ -void EC_KEY_free(EC_KEY *key); - -/** Copies a EC_KEY object. - * \param dst destination EC_KEY object - * \param src src EC_KEY object - * \return dst or NULL if an error occurred. - */ -EC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src); - -/** Creates a new EC_KEY object and copies the content from src to it. - * \param src the source EC_KEY object - * \return newly created EC_KEY object or NULL if an error occurred. - */ -EC_KEY *EC_KEY_dup(const EC_KEY *src); - -/** Increases the internal reference count of a EC_KEY object. - * \param key EC_KEY object - * \return 1 on success and 0 if an error occurred. - */ -int EC_KEY_up_ref(EC_KEY *key); - -/** Returns the EC_GROUP object of a EC_KEY object - * \param key EC_KEY object - * \return the EC_GROUP object (possibly NULL). - */ -const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key); - -/** Sets the EC_GROUP of a EC_KEY object. - * \param key EC_KEY object - * \param group EC_GROUP to use in the EC_KEY object (note: the EC_KEY - * object will use an own copy of the EC_GROUP). - * \return 1 on success and 0 if an error occurred. - */ -int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group); - -/** Returns the private key of a EC_KEY object. - * \param key EC_KEY object - * \return a BIGNUM with the private key (possibly NULL). - */ -const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key); - -/** Sets the private key of a EC_KEY object. - * \param key EC_KEY object - * \param prv BIGNUM with the private key (note: the EC_KEY object - * will use an own copy of the BIGNUM). - * \return 1 on success and 0 if an error occurred. - */ -int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv); - -/** Returns the public key of a EC_KEY object. - * \param key the EC_KEY object - * \return a EC_POINT object with the public key (possibly NULL) - */ -const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key); - -/** Sets the public key of a EC_KEY object. - * \param key EC_KEY object - * \param pub EC_POINT object with the public key (note: the EC_KEY object - * will use an own copy of the EC_POINT object). - * \return 1 on success and 0 if an error occurred. - */ -int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub); - -unsigned EC_KEY_get_enc_flags(const EC_KEY *key); -void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags); -point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key); -void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform); -/* functions to set/get method specific data */ -void *EC_KEY_get_key_method_data(EC_KEY *key, - void *(*dup_func) (void *), - void (*free_func) (void *), - void (*clear_free_func) (void *)); -/** Sets the key method data of an EC_KEY object, if none has yet been set. - * \param key EC_KEY object - * \param data opaque data to install. - * \param dup_func a function that duplicates |data|. - * \param free_func a function that frees |data|. - * \param clear_free_func a function that wipes and frees |data|. - * \return the previously set data pointer, or NULL if |data| was inserted. - */ -void *EC_KEY_insert_key_method_data(EC_KEY *key, void *data, - void *(*dup_func) (void *), - void (*free_func) (void *), - void (*clear_free_func) (void *)); -/* wrapper functions for the underlying EC_GROUP object */ -void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag); - -/** Creates a table of pre-computed multiples of the generator to - * accelerate further EC_KEY operations. - * \param key EC_KEY object - * \param ctx BN_CTX object (optional) - * \return 1 on success and 0 if an error occurred. - */ -int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx); - -/** Creates a new ec private (and optional a new public) key. - * \param key EC_KEY object - * \return 1 on success and 0 if an error occurred. - */ -int EC_KEY_generate_key(EC_KEY *key); - -/** Verifies that a private and/or public key is valid. - * \param key the EC_KEY object - * \return 1 on success and 0 otherwise. - */ -int EC_KEY_check_key(const EC_KEY *key); - -/** Sets a public key from affine coordindates performing - * neccessary NIST PKV tests. - * \param key the EC_KEY object - * \param x public key x coordinate - * \param y public key y coordinate - * \return 1 on success and 0 otherwise. - */ -int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, - BIGNUM *y); - -/********************************************************************/ -/* de- and encoding functions for SEC1 ECPrivateKey */ -/********************************************************************/ - -/** Decodes a private key from a memory buffer. - * \param key a pointer to a EC_KEY object which should be used (or NULL) - * \param in pointer to memory with the DER encoded private key - * \param len length of the DER encoded private key - * \return the decoded private key or NULL if an error occurred. - */ -EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len); - -/** Encodes a private key object and stores the result in a buffer. - * \param key the EC_KEY object to encode - * \param out the buffer for the result (if NULL the function returns number - * of bytes needed). - * \return 1 on success and 0 if an error occurred. - */ -int i2d_ECPrivateKey(EC_KEY *key, unsigned char **out); - -/********************************************************************/ -/* de- and encoding functions for EC parameters */ -/********************************************************************/ - -/** Decodes ec parameter from a memory buffer. - * \param key a pointer to a EC_KEY object which should be used (or NULL) - * \param in pointer to memory with the DER encoded ec parameters - * \param len length of the DER encoded ec parameters - * \return a EC_KEY object with the decoded parameters or NULL if an error - * occurred. - */ -EC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len); - -/** Encodes ec parameter and stores the result in a buffer. - * \param key the EC_KEY object with ec paramters to encode - * \param out the buffer for the result (if NULL the function returns number - * of bytes needed). - * \return 1 on success and 0 if an error occurred. - */ -int i2d_ECParameters(EC_KEY *key, unsigned char **out); - -/********************************************************************/ -/* de- and encoding functions for EC public key */ -/* (octet string, not DER -- hence 'o2i' and 'i2o') */ -/********************************************************************/ - -/** Decodes a ec public key from a octet string. - * \param key a pointer to a EC_KEY object which should be used - * \param in memory buffer with the encoded public key - * \param len length of the encoded public key - * \return EC_KEY object with decoded public key or NULL if an error - * occurred. - */ -EC_KEY *o2i_ECPublicKey(EC_KEY **key, const unsigned char **in, long len); - -/** Encodes a ec public key in an octet string. - * \param key the EC_KEY object with the public key - * \param out the buffer for the result (if NULL the function returns number - * of bytes needed). - * \return 1 on success and 0 if an error occurred - */ -int i2o_ECPublicKey(EC_KEY *key, unsigned char **out); - -# ifndef OPENSSL_NO_BIO -/** Prints out the ec parameters on human readable form. - * \param bp BIO object to which the information is printed - * \param key EC_KEY object - * \return 1 on success and 0 if an error occurred - */ -int ECParameters_print(BIO *bp, const EC_KEY *key); - -/** Prints out the contents of a EC_KEY object - * \param bp BIO object to which the information is printed - * \param key EC_KEY object - * \param off line offset - * \return 1 on success and 0 if an error occurred - */ -int EC_KEY_print(BIO *bp, const EC_KEY *key, int off); - -# endif -# ifndef OPENSSL_NO_FP_API -/** Prints out the ec parameters on human readable form. - * \param fp file descriptor to which the information is printed - * \param key EC_KEY object - * \return 1 on success and 0 if an error occurred - */ -int ECParameters_print_fp(FILE *fp, const EC_KEY *key); - -/** Prints out the contents of a EC_KEY object - * \param fp file descriptor to which the information is printed - * \param key EC_KEY object - * \param off line offset - * \return 1 on success and 0 if an error occurred - */ -int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off); - -# endif - -# define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x) - -# ifndef __cplusplus -# if defined(__SUNPRO_C) -# if __SUNPRO_C >= 0x520 -# pragma error_messages (default,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE) -# endif -# endif -# endif - -# define EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \ - EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL) - -# define EVP_PKEY_CTX_set_ec_param_enc(ctx, flag) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \ - EVP_PKEY_CTRL_EC_PARAM_ENC, flag, NULL) - -# define EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, flag) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_EC_ECDH_COFACTOR, flag, NULL) - -# define EVP_PKEY_CTX_get_ecdh_cofactor_mode(ctx) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_EC_ECDH_COFACTOR, -2, NULL) - -# define EVP_PKEY_CTX_set_ecdh_kdf_type(ctx, kdf) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_EC_KDF_TYPE, kdf, NULL) - -# define EVP_PKEY_CTX_get_ecdh_kdf_type(ctx) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_EC_KDF_TYPE, -2, NULL) - -# define EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_EC_KDF_MD, 0, (void *)md) - -# define EVP_PKEY_CTX_get_ecdh_kdf_md(ctx, pmd) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_GET_EC_KDF_MD, 0, (void *)pmd) - -# define EVP_PKEY_CTX_set_ecdh_kdf_outlen(ctx, len) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_EC_KDF_OUTLEN, len, NULL) - -# define EVP_PKEY_CTX_get_ecdh_kdf_outlen(ctx, plen) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN, 0, (void *)plen) - -# define EVP_PKEY_CTX_set0_ecdh_kdf_ukm(ctx, p, plen) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_EC_KDF_UKM, plen, (void *)p) - -# define EVP_PKEY_CTX_get0_ecdh_kdf_ukm(ctx, p) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \ - EVP_PKEY_OP_DERIVE, \ - EVP_PKEY_CTRL_GET_EC_KDF_UKM, 0, (void *)p) - -# define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 1) -# define EVP_PKEY_CTRL_EC_PARAM_ENC (EVP_PKEY_ALG_CTRL + 2) -# define EVP_PKEY_CTRL_EC_ECDH_COFACTOR (EVP_PKEY_ALG_CTRL + 3) -# define EVP_PKEY_CTRL_EC_KDF_TYPE (EVP_PKEY_ALG_CTRL + 4) -# define EVP_PKEY_CTRL_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 5) -# define EVP_PKEY_CTRL_GET_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 6) -# define EVP_PKEY_CTRL_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 7) -# define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 8) -# define EVP_PKEY_CTRL_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 9) -# define EVP_PKEY_CTRL_GET_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 10) -/* KDF types */ -# define EVP_PKEY_ECDH_KDF_NONE 1 -# define EVP_PKEY_ECDH_KDF_X9_62 2 - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_EC_strings(void); - -/* Error codes for the EC functions. */ - -/* Function codes. */ -# define EC_F_BN_TO_FELEM 224 -# define EC_F_COMPUTE_WNAF 143 -# define EC_F_D2I_ECPARAMETERS 144 -# define EC_F_D2I_ECPKPARAMETERS 145 -# define EC_F_D2I_ECPRIVATEKEY 146 -# define EC_F_DO_EC_KEY_PRINT 221 -# define EC_F_ECDH_CMS_DECRYPT 238 -# define EC_F_ECDH_CMS_SET_SHARED_INFO 239 -# define EC_F_ECKEY_PARAM2TYPE 223 -# define EC_F_ECKEY_PARAM_DECODE 212 -# define EC_F_ECKEY_PRIV_DECODE 213 -# define EC_F_ECKEY_PRIV_ENCODE 214 -# define EC_F_ECKEY_PUB_DECODE 215 -# define EC_F_ECKEY_PUB_ENCODE 216 -# define EC_F_ECKEY_TYPE2PARAM 220 -# define EC_F_ECPARAMETERS_PRINT 147 -# define EC_F_ECPARAMETERS_PRINT_FP 148 -# define EC_F_ECPKPARAMETERS_PRINT 149 -# define EC_F_ECPKPARAMETERS_PRINT_FP 150 -# define EC_F_ECP_NISTZ256_GET_AFFINE 240 -# define EC_F_ECP_NISTZ256_MULT_PRECOMPUTE 243 -# define EC_F_ECP_NISTZ256_POINTS_MUL 241 -# define EC_F_ECP_NISTZ256_PRE_COMP_NEW 244 -# define EC_F_ECP_NISTZ256_SET_WORDS 245 -# define EC_F_ECP_NISTZ256_WINDOWED_MUL 242 -# define EC_F_ECP_NIST_MOD_192 203 -# define EC_F_ECP_NIST_MOD_224 204 -# define EC_F_ECP_NIST_MOD_256 205 -# define EC_F_ECP_NIST_MOD_521 206 -# define EC_F_EC_ASN1_GROUP2CURVE 153 -# define EC_F_EC_ASN1_GROUP2FIELDID 154 -# define EC_F_EC_ASN1_GROUP2PARAMETERS 155 -# define EC_F_EC_ASN1_GROUP2PKPARAMETERS 156 -# define EC_F_EC_ASN1_PARAMETERS2GROUP 157 -# define EC_F_EC_ASN1_PKPARAMETERS2GROUP 158 -# define EC_F_EC_EX_DATA_SET_DATA 211 -# define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208 -# define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159 -# define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195 -# define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160 -# define EC_F_EC_GF2M_SIMPLE_POINT2OCT 161 -# define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 162 -# define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 163 -# define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164 -# define EC_F_EC_GFP_MONT_FIELD_DECODE 133 -# define EC_F_EC_GFP_MONT_FIELD_ENCODE 134 -# define EC_F_EC_GFP_MONT_FIELD_MUL 131 -# define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209 -# define EC_F_EC_GFP_MONT_FIELD_SQR 132 -# define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189 -# define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135 -# define EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE 225 -# define EC_F_EC_GFP_NISTP224_POINTS_MUL 228 -# define EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES 226 -# define EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE 230 -# define EC_F_EC_GFP_NISTP256_POINTS_MUL 231 -# define EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES 232 -# define EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE 233 -# define EC_F_EC_GFP_NISTP521_POINTS_MUL 234 -# define EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES 235 -# define EC_F_EC_GFP_NIST_FIELD_MUL 200 -# define EC_F_EC_GFP_NIST_FIELD_SQR 201 -# define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 -# define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165 -# define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166 -# define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100 -# define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR 101 -# define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102 -# define EC_F_EC_GFP_SIMPLE_OCT2POINT 103 -# define EC_F_EC_GFP_SIMPLE_POINT2OCT 104 -# define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE 137 -# define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES 167 -# define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105 -# define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES 168 -# define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128 -# define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES 169 -# define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129 -# define EC_F_EC_GROUP_CHECK 170 -# define EC_F_EC_GROUP_CHECK_DISCRIMINANT 171 -# define EC_F_EC_GROUP_COPY 106 -# define EC_F_EC_GROUP_GET0_GENERATOR 139 -# define EC_F_EC_GROUP_GET_COFACTOR 140 -# define EC_F_EC_GROUP_GET_CURVE_GF2M 172 -# define EC_F_EC_GROUP_GET_CURVE_GFP 130 -# define EC_F_EC_GROUP_GET_DEGREE 173 -# define EC_F_EC_GROUP_GET_ORDER 141 -# define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS 193 -# define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS 194 -# define EC_F_EC_GROUP_NEW 108 -# define EC_F_EC_GROUP_NEW_BY_CURVE_NAME 174 -# define EC_F_EC_GROUP_NEW_FROM_DATA 175 -# define EC_F_EC_GROUP_PRECOMPUTE_MULT 142 -# define EC_F_EC_GROUP_SET_CURVE_GF2M 176 -# define EC_F_EC_GROUP_SET_CURVE_GFP 109 -# define EC_F_EC_GROUP_SET_EXTRA_DATA 110 -# define EC_F_EC_GROUP_SET_GENERATOR 111 -# define EC_F_EC_KEY_CHECK_KEY 177 -# define EC_F_EC_KEY_COPY 178 -# define EC_F_EC_KEY_GENERATE_KEY 179 -# define EC_F_EC_KEY_NEW 182 -# define EC_F_EC_KEY_PRINT 180 -# define EC_F_EC_KEY_PRINT_FP 181 -# define EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES 229 -# define EC_F_EC_POINTS_MAKE_AFFINE 136 -# define EC_F_EC_POINT_ADD 112 -# define EC_F_EC_POINT_CMP 113 -# define EC_F_EC_POINT_COPY 114 -# define EC_F_EC_POINT_DBL 115 -# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183 -# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116 -# define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117 -# define EC_F_EC_POINT_INVERT 210 -# define EC_F_EC_POINT_IS_AT_INFINITY 118 -# define EC_F_EC_POINT_IS_ON_CURVE 119 -# define EC_F_EC_POINT_MAKE_AFFINE 120 -# define EC_F_EC_POINT_MUL 184 -# define EC_F_EC_POINT_NEW 121 -# define EC_F_EC_POINT_OCT2POINT 122 -# define EC_F_EC_POINT_POINT2OCT 123 -# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M 185 -# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP 124 -# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M 186 -# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP 125 -# define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 126 -# define EC_F_EC_POINT_SET_TO_INFINITY 127 -# define EC_F_EC_PRE_COMP_DUP 207 -# define EC_F_EC_PRE_COMP_NEW 196 -# define EC_F_EC_WNAF_MUL 187 -# define EC_F_EC_WNAF_PRECOMPUTE_MULT 188 -# define EC_F_I2D_ECPARAMETERS 190 -# define EC_F_I2D_ECPKPARAMETERS 191 -# define EC_F_I2D_ECPRIVATEKEY 192 -# define EC_F_I2O_ECPUBLICKEY 151 -# define EC_F_NISTP224_PRE_COMP_NEW 227 -# define EC_F_NISTP256_PRE_COMP_NEW 236 -# define EC_F_NISTP521_PRE_COMP_NEW 237 -# define EC_F_O2I_ECPUBLICKEY 152 -# define EC_F_OLD_EC_PRIV_DECODE 222 -# define EC_F_PKEY_EC_CTRL 197 -# define EC_F_PKEY_EC_CTRL_STR 198 -# define EC_F_PKEY_EC_DERIVE 217 -# define EC_F_PKEY_EC_KEYGEN 199 -# define EC_F_PKEY_EC_PARAMGEN 219 -# define EC_F_PKEY_EC_SIGN 218 - -/* Reason codes. */ -# define EC_R_ASN1_ERROR 115 -# define EC_R_ASN1_UNKNOWN_FIELD 116 -# define EC_R_BIGNUM_OUT_OF_RANGE 144 -# define EC_R_BUFFER_TOO_SMALL 100 -# define EC_R_COORDINATES_OUT_OF_RANGE 146 -# define EC_R_D2I_ECPKPARAMETERS_FAILURE 117 -# define EC_R_DECODE_ERROR 142 -# define EC_R_DISCRIMINANT_IS_ZERO 118 -# define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119 -# define EC_R_FIELD_TOO_LARGE 143 -# define EC_R_GF2M_NOT_SUPPORTED 147 -# define EC_R_GROUP2PKPARAMETERS_FAILURE 120 -# define EC_R_I2D_ECPKPARAMETERS_FAILURE 121 -# define EC_R_INCOMPATIBLE_OBJECTS 101 -# define EC_R_INVALID_ARGUMENT 112 -# define EC_R_INVALID_COMPRESSED_POINT 110 -# define EC_R_INVALID_COMPRESSION_BIT 109 -# define EC_R_INVALID_CURVE 141 -# define EC_R_INVALID_DIGEST 151 -# define EC_R_INVALID_DIGEST_TYPE 138 -# define EC_R_INVALID_ENCODING 102 -# define EC_R_INVALID_FIELD 103 -# define EC_R_INVALID_FORM 104 -# define EC_R_INVALID_GROUP_ORDER 122 -# define EC_R_INVALID_PENTANOMIAL_BASIS 132 -# define EC_R_INVALID_PRIVATE_KEY 123 -# define EC_R_INVALID_TRINOMIAL_BASIS 137 -# define EC_R_KDF_PARAMETER_ERROR 148 -# define EC_R_KEYS_NOT_SET 140 -# define EC_R_MISSING_PARAMETERS 124 -# define EC_R_MISSING_PRIVATE_KEY 125 -# define EC_R_NOT_A_NIST_PRIME 135 -# define EC_R_NOT_A_SUPPORTED_NIST_PRIME 136 -# define EC_R_NOT_IMPLEMENTED 126 -# define EC_R_NOT_INITIALIZED 111 -# define EC_R_NO_FIELD_MOD 133 -# define EC_R_NO_PARAMETERS_SET 139 -# define EC_R_PASSED_NULL_PARAMETER 134 -# define EC_R_PEER_KEY_ERROR 149 -# define EC_R_PKPARAMETERS2GROUP_FAILURE 127 -# define EC_R_POINT_AT_INFINITY 106 -# define EC_R_POINT_IS_NOT_ON_CURVE 107 -# define EC_R_SHARED_INFO_ERROR 150 -# define EC_R_SLOT_FULL 108 -# define EC_R_UNDEFINED_GENERATOR 113 -# define EC_R_UNDEFINED_ORDER 128 -# define EC_R_UNKNOWN_GROUP 129 -# define EC_R_UNKNOWN_ORDER 114 -# define EC_R_UNSUPPORTED_FIELD 131 -# define EC_R_WRONG_CURVE_PARAMETERS 145 -# define EC_R_WRONG_ORDER 130 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/ecdh.h b/libs/win32/openssl/include/openssl/ecdh.h deleted file mode 100644 index 25348b30fe..0000000000 --- a/libs/win32/openssl/include/openssl/ecdh.h +++ /dev/null @@ -1,134 +0,0 @@ -/* crypto/ecdh/ecdh.h */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * The Elliptic Curve Public-Key Crypto Library (ECC Code) included - * herein is developed by SUN MICROSYSTEMS, INC., and is contributed - * to the OpenSSL project. - * - * The ECC Code is licensed pursuant to the OpenSSL open source - * license provided below. - * - * The ECDH software is originally written by Douglas Stebila of - * Sun Microsystems Laboratories. - * - */ -/* ==================================================================== - * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -#ifndef HEADER_ECDH_H -# define HEADER_ECDH_H - -# include - -# ifdef OPENSSL_NO_ECDH -# error ECDH is disabled. -# endif - -# include -# include -# ifndef OPENSSL_NO_DEPRECATED -# include -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -# define EC_FLAG_COFACTOR_ECDH 0x1000 - -const ECDH_METHOD *ECDH_OpenSSL(void); - -void ECDH_set_default_method(const ECDH_METHOD *); -const ECDH_METHOD *ECDH_get_default_method(void); -int ECDH_set_method(EC_KEY *, const ECDH_METHOD *); - -int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, - EC_KEY *ecdh, void *(*KDF) (const void *in, size_t inlen, - void *out, size_t *outlen)); - -int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new - *new_func, CRYPTO_EX_dup *dup_func, - CRYPTO_EX_free *free_func); -int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg); -void *ECDH_get_ex_data(EC_KEY *d, int idx); - -int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, - const unsigned char *Z, size_t Zlen, - const unsigned char *sinfo, size_t sinfolen, - const EVP_MD *md); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_ECDH_strings(void); - -/* Error codes for the ECDH functions. */ - -/* Function codes. */ -# define ECDH_F_ECDH_CHECK 102 -# define ECDH_F_ECDH_COMPUTE_KEY 100 -# define ECDH_F_ECDH_DATA_NEW_METHOD 101 - -/* Reason codes. */ -# define ECDH_R_KDF_FAILED 102 -# define ECDH_R_NON_FIPS_METHOD 103 -# define ECDH_R_NO_PRIVATE_VALUE 100 -# define ECDH_R_POINT_ARITHMETIC_FAILURE 101 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/ecdsa.h b/libs/win32/openssl/include/openssl/ecdsa.h deleted file mode 100644 index a6f0930f82..0000000000 --- a/libs/win32/openssl/include/openssl/ecdsa.h +++ /dev/null @@ -1,335 +0,0 @@ -/* crypto/ecdsa/ecdsa.h */ -/** - * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions - * \author Written by Nils Larsch for the OpenSSL project - */ -/* ==================================================================== - * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -#ifndef HEADER_ECDSA_H -# define HEADER_ECDSA_H - -# include - -# ifdef OPENSSL_NO_ECDSA -# error ECDSA is disabled. -# endif - -# include -# include -# ifndef OPENSSL_NO_DEPRECATED -# include -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ECDSA_SIG_st { - BIGNUM *r; - BIGNUM *s; -} ECDSA_SIG; - -/** Allocates and initialize a ECDSA_SIG structure - * \return pointer to a ECDSA_SIG structure or NULL if an error occurred - */ -ECDSA_SIG *ECDSA_SIG_new(void); - -/** frees a ECDSA_SIG structure - * \param sig pointer to the ECDSA_SIG structure - */ -void ECDSA_SIG_free(ECDSA_SIG *sig); - -/** DER encode content of ECDSA_SIG object (note: this function modifies *pp - * (*pp += length of the DER encoded signature)). - * \param sig pointer to the ECDSA_SIG object - * \param pp pointer to a unsigned char pointer for the output or NULL - * \return the length of the DER encoded ECDSA_SIG object or 0 - */ -int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp); - -/** Decodes a DER encoded ECDSA signature (note: this function changes *pp - * (*pp += len)). - * \param sig pointer to ECDSA_SIG pointer (may be NULL) - * \param pp memory buffer with the DER encoded signature - * \param len length of the buffer - * \return pointer to the decoded ECDSA_SIG structure (or NULL) - */ -ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len); - -/** Computes the ECDSA signature of the given hash value using - * the supplied private key and returns the created signature. - * \param dgst pointer to the hash value - * \param dgst_len length of the hash value - * \param eckey EC_KEY object containing a private EC key - * \return pointer to a ECDSA_SIG structure or NULL if an error occurred - */ -ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dgst_len, - EC_KEY *eckey); - -/** Computes ECDSA signature of a given hash value using the supplied - * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). - * \param dgst pointer to the hash value to sign - * \param dgstlen length of the hash value - * \param kinv BIGNUM with a pre-computed inverse k (optional) - * \param rp BIGNUM with a pre-computed rp value (optioanl), - * see ECDSA_sign_setup - * \param eckey EC_KEY object containing a private EC key - * \return pointer to a ECDSA_SIG structure or NULL if an error occurred - */ -ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen, - const BIGNUM *kinv, const BIGNUM *rp, - EC_KEY *eckey); - -/** Verifies that the supplied signature is a valid ECDSA - * signature of the supplied hash value using the supplied public key. - * \param dgst pointer to the hash value - * \param dgst_len length of the hash value - * \param sig ECDSA_SIG structure - * \param eckey EC_KEY object containing a public EC key - * \return 1 if the signature is valid, 0 if the signature is invalid - * and -1 on error - */ -int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, - const ECDSA_SIG *sig, EC_KEY *eckey); - -const ECDSA_METHOD *ECDSA_OpenSSL(void); - -/** Sets the default ECDSA method - * \param meth new default ECDSA_METHOD - */ -void ECDSA_set_default_method(const ECDSA_METHOD *meth); - -/** Returns the default ECDSA method - * \return pointer to ECDSA_METHOD structure containing the default method - */ -const ECDSA_METHOD *ECDSA_get_default_method(void); - -/** Sets method to be used for the ECDSA operations - * \param eckey EC_KEY object - * \param meth new method - * \return 1 on success and 0 otherwise - */ -int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth); - -/** Returns the maximum length of the DER encoded signature - * \param eckey EC_KEY object - * \return numbers of bytes required for the DER encoded signature - */ -int ECDSA_size(const EC_KEY *eckey); - -/** Precompute parts of the signing operation - * \param eckey EC_KEY object containing a private EC key - * \param ctx BN_CTX object (optional) - * \param kinv BIGNUM pointer for the inverse of k - * \param rp BIGNUM pointer for x coordinate of k * generator - * \return 1 on success and 0 otherwise - */ -int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, BIGNUM **rp); - -/** Computes ECDSA signature of a given hash value using the supplied - * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). - * \param type this parameter is ignored - * \param dgst pointer to the hash value to sign - * \param dgstlen length of the hash value - * \param sig memory for the DER encoded created signature - * \param siglen pointer to the length of the returned signature - * \param eckey EC_KEY object containing a private EC key - * \return 1 on success and 0 otherwise - */ -int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen, - unsigned char *sig, unsigned int *siglen, EC_KEY *eckey); - -/** Computes ECDSA signature of a given hash value using the supplied - * private key (note: sig must point to ECDSA_size(eckey) bytes of memory). - * \param type this parameter is ignored - * \param dgst pointer to the hash value to sign - * \param dgstlen length of the hash value - * \param sig buffer to hold the DER encoded signature - * \param siglen pointer to the length of the returned signature - * \param kinv BIGNUM with a pre-computed inverse k (optional) - * \param rp BIGNUM with a pre-computed rp value (optioanl), - * see ECDSA_sign_setup - * \param eckey EC_KEY object containing a private EC key - * \return 1 on success and 0 otherwise - */ -int ECDSA_sign_ex(int type, const unsigned char *dgst, int dgstlen, - unsigned char *sig, unsigned int *siglen, - const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey); - -/** Verifies that the given signature is valid ECDSA signature - * of the supplied hash value using the specified public key. - * \param type this parameter is ignored - * \param dgst pointer to the hash value - * \param dgstlen length of the hash value - * \param sig pointer to the DER encoded signature - * \param siglen length of the DER encoded signature - * \param eckey EC_KEY object containing a public EC key - * \return 1 if the signature is valid, 0 if the signature is invalid - * and -1 on error - */ -int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen, - const unsigned char *sig, int siglen, EC_KEY *eckey); - -/* the standard ex_data functions */ -int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new - *new_func, CRYPTO_EX_dup *dup_func, - CRYPTO_EX_free *free_func); -int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg); -void *ECDSA_get_ex_data(EC_KEY *d, int idx); - -/** Allocates and initialize a ECDSA_METHOD structure - * \param ecdsa_method pointer to ECDSA_METHOD to copy. (May be NULL) - * \return pointer to a ECDSA_METHOD structure or NULL if an error occurred - */ - -ECDSA_METHOD *ECDSA_METHOD_new(const ECDSA_METHOD *ecdsa_method); - -/** frees a ECDSA_METHOD structure - * \param ecdsa_method pointer to the ECDSA_METHOD structure - */ -void ECDSA_METHOD_free(ECDSA_METHOD *ecdsa_method); - -/** Sets application specific data in the ECDSA_METHOD - * \param ecdsa_method pointer to existing ECDSA_METHOD - * \param app application specific data to set - */ - -void ECDSA_METHOD_set_app_data(ECDSA_METHOD *ecdsa_method, void *app); - -/** Returns application specific data from a ECDSA_METHOD structure - * \param ecdsa_method pointer to ECDSA_METHOD structure - * \return pointer to application specific data. - */ - -void *ECDSA_METHOD_get_app_data(ECDSA_METHOD *ecdsa_method); - -/** Set the ECDSA_do_sign function in the ECDSA_METHOD - * \param ecdsa_method pointer to existing ECDSA_METHOD - * \param ecdsa_do_sign a funtion of type ECDSA_do_sign - */ - -void ECDSA_METHOD_set_sign(ECDSA_METHOD *ecdsa_method, - ECDSA_SIG *(*ecdsa_do_sign) (const unsigned char - *dgst, int dgst_len, - const BIGNUM *inv, - const BIGNUM *rp, - EC_KEY *eckey)); - -/** Set the ECDSA_sign_setup function in the ECDSA_METHOD - * \param ecdsa_method pointer to existing ECDSA_METHOD - * \param ecdsa_sign_setup a funtion of type ECDSA_sign_setup - */ - -void ECDSA_METHOD_set_sign_setup(ECDSA_METHOD *ecdsa_method, - int (*ecdsa_sign_setup) (EC_KEY *eckey, - BN_CTX *ctx, - BIGNUM **kinv, - BIGNUM **r)); - -/** Set the ECDSA_do_verify function in the ECDSA_METHOD - * \param ecdsa_method pointer to existing ECDSA_METHOD - * \param ecdsa_do_verify a funtion of type ECDSA_do_verify - */ - -void ECDSA_METHOD_set_verify(ECDSA_METHOD *ecdsa_method, - int (*ecdsa_do_verify) (const unsigned char - *dgst, int dgst_len, - const ECDSA_SIG *sig, - EC_KEY *eckey)); - -void ECDSA_METHOD_set_flags(ECDSA_METHOD *ecdsa_method, int flags); - -/** Set the flags field in the ECDSA_METHOD - * \param ecdsa_method pointer to existing ECDSA_METHOD - * \param flags flags value to set - */ - -void ECDSA_METHOD_set_name(ECDSA_METHOD *ecdsa_method, char *name); - -/** Set the name field in the ECDSA_METHOD - * \param ecdsa_method pointer to existing ECDSA_METHOD - * \param name name to set - */ - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_ECDSA_strings(void); - -/* Error codes for the ECDSA functions. */ - -/* Function codes. */ -# define ECDSA_F_ECDSA_CHECK 104 -# define ECDSA_F_ECDSA_DATA_NEW_METHOD 100 -# define ECDSA_F_ECDSA_DO_SIGN 101 -# define ECDSA_F_ECDSA_DO_VERIFY 102 -# define ECDSA_F_ECDSA_METHOD_NEW 105 -# define ECDSA_F_ECDSA_SIGN_SETUP 103 - -/* Reason codes. */ -# define ECDSA_R_BAD_SIGNATURE 100 -# define ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 101 -# define ECDSA_R_ERR_EC_LIB 102 -# define ECDSA_R_MISSING_PARAMETERS 103 -# define ECDSA_R_NEED_NEW_SETUP_VALUES 106 -# define ECDSA_R_NON_FIPS_METHOD 107 -# define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED 104 -# define ECDSA_R_SIGNATURE_MALLOC_FAILED 105 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/engine.h b/libs/win32/openssl/include/openssl/engine.h deleted file mode 100644 index bd7b591447..0000000000 --- a/libs/win32/openssl/include/openssl/engine.h +++ /dev/null @@ -1,960 +0,0 @@ -/* openssl/engine.h */ -/* - * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project - * 2000. - */ -/* ==================================================================== - * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECDH support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ - -#ifndef HEADER_ENGINE_H -# define HEADER_ENGINE_H - -# include - -# ifdef OPENSSL_NO_ENGINE -# error ENGINE is disabled. -# endif - -# ifndef OPENSSL_NO_DEPRECATED -# include -# ifndef OPENSSL_NO_RSA -# include -# endif -# ifndef OPENSSL_NO_DSA -# include -# endif -# ifndef OPENSSL_NO_DH -# include -# endif -# ifndef OPENSSL_NO_ECDH -# include -# endif -# ifndef OPENSSL_NO_ECDSA -# include -# endif -# include -# include -# include -# endif - -# include -# include - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * These flags are used to control combinations of algorithm (methods) by - * bitwise "OR"ing. - */ -# define ENGINE_METHOD_RSA (unsigned int)0x0001 -# define ENGINE_METHOD_DSA (unsigned int)0x0002 -# define ENGINE_METHOD_DH (unsigned int)0x0004 -# define ENGINE_METHOD_RAND (unsigned int)0x0008 -# define ENGINE_METHOD_ECDH (unsigned int)0x0010 -# define ENGINE_METHOD_ECDSA (unsigned int)0x0020 -# define ENGINE_METHOD_CIPHERS (unsigned int)0x0040 -# define ENGINE_METHOD_DIGESTS (unsigned int)0x0080 -# define ENGINE_METHOD_STORE (unsigned int)0x0100 -# define ENGINE_METHOD_PKEY_METHS (unsigned int)0x0200 -# define ENGINE_METHOD_PKEY_ASN1_METHS (unsigned int)0x0400 -/* Obvious all-or-nothing cases. */ -# define ENGINE_METHOD_ALL (unsigned int)0xFFFF -# define ENGINE_METHOD_NONE (unsigned int)0x0000 - -/* - * This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used - * internally to control registration of ENGINE implementations, and can be - * set by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to - * initialise registered ENGINEs if they are not already initialised. - */ -# define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001 - -/* ENGINE flags that can be set by ENGINE_set_flags(). */ -/* Not used */ -/* #define ENGINE_FLAGS_MALLOCED 0x0001 */ - -/* - * This flag is for ENGINEs that wish to handle the various 'CMD'-related - * control commands on their own. Without this flag, ENGINE_ctrl() handles - * these control commands on behalf of the ENGINE using their "cmd_defns" - * data. - */ -# define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002 - -/* - * This flag is for ENGINEs who return new duplicate structures when found - * via "ENGINE_by_id()". When an ENGINE must store state (eg. if - * ENGINE_ctrl() commands are called in sequence as part of some stateful - * process like key-generation setup and execution), it can set this flag - - * then each attempt to obtain the ENGINE will result in it being copied into - * a new structure. Normally, ENGINEs don't declare this flag so - * ENGINE_by_id() just increments the existing ENGINE's structural reference - * count. - */ -# define ENGINE_FLAGS_BY_ID_COPY (int)0x0004 - -/* - * This flag if for an ENGINE that does not want its methods registered as - * part of ENGINE_register_all_complete() for example if the methods are not - * usable as default methods. - */ - -# define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008 - -/* - * ENGINEs can support their own command types, and these flags are used in - * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input - * each command expects. Currently only numeric and string input is - * supported. If a control command supports none of the _NUMERIC, _STRING, or - * _NO_INPUT options, then it is regarded as an "internal" control command - - * and not for use in config setting situations. As such, they're not - * available to the ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl() - * access. Changes to this list of 'command types' should be reflected - * carefully in ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string(). - */ - -/* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */ -# define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001 -/* - * accepts string input (cast from 'void*' to 'const char *', 4th parameter - * to ENGINE_ctrl) - */ -# define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002 -/* - * Indicates that the control command takes *no* input. Ie. the control - * command is unparameterised. - */ -# define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004 -/* - * Indicates that the control command is internal. This control command won't - * be shown in any output, and is only usable through the ENGINE_ctrl_cmd() - * function. - */ -# define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008 - -/* - * NB: These 3 control commands are deprecated and should not be used. - * ENGINEs relying on these commands should compile conditional support for - * compatibility (eg. if these symbols are defined) but should also migrate - * the same functionality to their own ENGINE-specific control functions that - * can be "discovered" by calling applications. The fact these control - * commands wouldn't be "executable" (ie. usable by text-based config) - * doesn't change the fact that application code can find and use them - * without requiring per-ENGINE hacking. - */ - -/* - * These flags are used to tell the ctrl function what should be done. All - * command numbers are shared between all engines, even if some don't make - * sense to some engines. In such a case, they do nothing but return the - * error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED. - */ -# define ENGINE_CTRL_SET_LOGSTREAM 1 -# define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2 -# define ENGINE_CTRL_HUP 3/* Close and reinitialise - * any handles/connections - * etc. */ -# define ENGINE_CTRL_SET_USER_INTERFACE 4/* Alternative to callback */ -# define ENGINE_CTRL_SET_CALLBACK_DATA 5/* User-specific data, used - * when calling the password - * callback and the user - * interface */ -# define ENGINE_CTRL_LOAD_CONFIGURATION 6/* Load a configuration, - * given a string that - * represents a file name - * or so */ -# define ENGINE_CTRL_LOAD_SECTION 7/* Load data from a given - * section in the already - * loaded configuration */ - -/* - * These control commands allow an application to deal with an arbitrary - * engine in a dynamic way. Warn: Negative return values indicate errors FOR - * THESE COMMANDS because zero is used to indicate 'end-of-list'. Other - * commands, including ENGINE-specific command types, return zero for an - * error. An ENGINE can choose to implement these ctrl functions, and can - * internally manage things however it chooses - it does so by setting the - * ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise - * the ENGINE_ctrl() code handles this on the ENGINE's behalf using the - * cmd_defns data (set using ENGINE_set_cmd_defns()). This means an ENGINE's - * ctrl() handler need only implement its own commands - the above "meta" - * commands will be taken care of. - */ - -/* - * Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not", - * then all the remaining control commands will return failure, so it is - * worth checking this first if the caller is trying to "discover" the - * engine's capabilities and doesn't want errors generated unnecessarily. - */ -# define ENGINE_CTRL_HAS_CTRL_FUNCTION 10 -/* - * Returns a positive command number for the first command supported by the - * engine. Returns zero if no ctrl commands are supported. - */ -# define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11 -/* - * The 'long' argument specifies a command implemented by the engine, and the - * return value is the next command supported, or zero if there are no more. - */ -# define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12 -/* - * The 'void*' argument is a command name (cast from 'const char *'), and the - * return value is the command that corresponds to it. - */ -# define ENGINE_CTRL_GET_CMD_FROM_NAME 13 -/* - * The next two allow a command to be converted into its corresponding string - * form. In each case, the 'long' argument supplies the command. In the - * NAME_LEN case, the return value is the length of the command name (not - * counting a trailing EOL). In the NAME case, the 'void*' argument must be a - * string buffer large enough, and it will be populated with the name of the - * command (WITH a trailing EOL). - */ -# define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14 -# define ENGINE_CTRL_GET_NAME_FROM_CMD 15 -/* The next two are similar but give a "short description" of a command. */ -# define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16 -# define ENGINE_CTRL_GET_DESC_FROM_CMD 17 -/* - * With this command, the return value is the OR'd combination of - * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given - * engine-specific ctrl command expects. - */ -# define ENGINE_CTRL_GET_CMD_FLAGS 18 - -/* - * ENGINE implementations should start the numbering of their own control - * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc). - */ -# define ENGINE_CMD_BASE 200 - -/* - * NB: These 2 nCipher "chil" control commands are deprecated, and their - * functionality is now available through ENGINE-specific control commands - * (exposed through the above-mentioned 'CMD'-handling). Code using these 2 - * commands should be migrated to the more general command handling before - * these are removed. - */ - -/* Flags specific to the nCipher "chil" engine */ -# define ENGINE_CTRL_CHIL_SET_FORKCHECK 100 - /* - * Depending on the value of the (long)i argument, this sets or - * unsets the SimpleForkCheck flag in the CHIL API to enable or - * disable checking and workarounds for applications that fork(). - */ -# define ENGINE_CTRL_CHIL_NO_LOCKING 101 - /* - * This prevents the initialisation function from providing mutex - * callbacks to the nCipher library. - */ - -/* - * If an ENGINE supports its own specific control commands and wishes the - * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on - * its behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN - * entries to ENGINE_set_cmd_defns(). It should also implement a ctrl() - * handler that supports the stated commands (ie. the "cmd_num" entries as - * described by the array). NB: The array must be ordered in increasing order - * of cmd_num. "null-terminated" means that the last ENGINE_CMD_DEFN element - * has cmd_num set to zero and/or cmd_name set to NULL. - */ -typedef struct ENGINE_CMD_DEFN_st { - unsigned int cmd_num; /* The command number */ - const char *cmd_name; /* The command name itself */ - const char *cmd_desc; /* A short description of the command */ - unsigned int cmd_flags; /* The input the command expects */ -} ENGINE_CMD_DEFN; - -/* Generic function pointer */ -typedef int (*ENGINE_GEN_FUNC_PTR) (void); -/* Generic function pointer taking no arguments */ -typedef int (*ENGINE_GEN_INT_FUNC_PTR) (ENGINE *); -/* Specific control function pointer */ -typedef int (*ENGINE_CTRL_FUNC_PTR) (ENGINE *, int, long, void *, - void (*f) (void)); -/* Generic load_key function pointer */ -typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *, - UI_METHOD *ui_method, - void *callback_data); -typedef int (*ENGINE_SSL_CLIENT_CERT_PTR) (ENGINE *, SSL *ssl, - STACK_OF(X509_NAME) *ca_dn, - X509 **pcert, EVP_PKEY **pkey, - STACK_OF(X509) **pother, - UI_METHOD *ui_method, - void *callback_data); -/*- - * These callback types are for an ENGINE's handler for cipher and digest logic. - * These handlers have these prototypes; - * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid); - * int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid); - * Looking at how to implement these handlers in the case of cipher support, if - * the framework wants the EVP_CIPHER for 'nid', it will call; - * foo(e, &p_evp_cipher, NULL, nid); (return zero for failure) - * If the framework wants a list of supported 'nid's, it will call; - * foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error) - */ -/* - * Returns to a pointer to the array of supported cipher 'nid's. If the - * second parameter is non-NULL it is set to the size of the returned array. - */ -typedef int (*ENGINE_CIPHERS_PTR) (ENGINE *, const EVP_CIPHER **, - const int **, int); -typedef int (*ENGINE_DIGESTS_PTR) (ENGINE *, const EVP_MD **, const int **, - int); -typedef int (*ENGINE_PKEY_METHS_PTR) (ENGINE *, EVP_PKEY_METHOD **, - const int **, int); -typedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **, - const int **, int); -/* - * STRUCTURE functions ... all of these functions deal with pointers to - * ENGINE structures where the pointers have a "structural reference". This - * means that their reference is to allowed access to the structure but it - * does not imply that the structure is functional. To simply increment or - * decrement the structural reference count, use ENGINE_by_id and - * ENGINE_free. NB: This is not required when iterating using ENGINE_get_next - * as it will automatically decrement the structural reference count of the - * "current" ENGINE and increment the structural reference count of the - * ENGINE it returns (unless it is NULL). - */ - -/* Get the first/last "ENGINE" type available. */ -ENGINE *ENGINE_get_first(void); -ENGINE *ENGINE_get_last(void); -/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */ -ENGINE *ENGINE_get_next(ENGINE *e); -ENGINE *ENGINE_get_prev(ENGINE *e); -/* Add another "ENGINE" type into the array. */ -int ENGINE_add(ENGINE *e); -/* Remove an existing "ENGINE" type from the array. */ -int ENGINE_remove(ENGINE *e); -/* Retrieve an engine from the list by its unique "id" value. */ -ENGINE *ENGINE_by_id(const char *id); -/* Add all the built-in engines. */ -void ENGINE_load_openssl(void); -void ENGINE_load_dynamic(void); -# ifndef OPENSSL_NO_STATIC_ENGINE -void ENGINE_load_4758cca(void); -void ENGINE_load_aep(void); -void ENGINE_load_atalla(void); -void ENGINE_load_chil(void); -void ENGINE_load_cswift(void); -void ENGINE_load_nuron(void); -void ENGINE_load_sureware(void); -void ENGINE_load_ubsec(void); -void ENGINE_load_padlock(void); -void ENGINE_load_capi(void); -# ifndef OPENSSL_NO_GMP -void ENGINE_load_gmp(void); -# endif -# ifndef OPENSSL_NO_GOST -void ENGINE_load_gost(void); -# endif -# endif -void ENGINE_load_cryptodev(void); -void ENGINE_load_rdrand(void); -void ENGINE_load_builtin_engines(void); - -/* - * Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation - * "registry" handling. - */ -unsigned int ENGINE_get_table_flags(void); -void ENGINE_set_table_flags(unsigned int flags); - -/*- Manage registration of ENGINEs per "table". For each type, there are 3 - * functions; - * ENGINE_register_***(e) - registers the implementation from 'e' (if it has one) - * ENGINE_unregister_***(e) - unregister the implementation from 'e' - * ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list - * Cleanup is automatically registered from each table when required, so - * ENGINE_cleanup() will reverse any "register" operations. - */ - -int ENGINE_register_RSA(ENGINE *e); -void ENGINE_unregister_RSA(ENGINE *e); -void ENGINE_register_all_RSA(void); - -int ENGINE_register_DSA(ENGINE *e); -void ENGINE_unregister_DSA(ENGINE *e); -void ENGINE_register_all_DSA(void); - -int ENGINE_register_ECDH(ENGINE *e); -void ENGINE_unregister_ECDH(ENGINE *e); -void ENGINE_register_all_ECDH(void); - -int ENGINE_register_ECDSA(ENGINE *e); -void ENGINE_unregister_ECDSA(ENGINE *e); -void ENGINE_register_all_ECDSA(void); - -int ENGINE_register_DH(ENGINE *e); -void ENGINE_unregister_DH(ENGINE *e); -void ENGINE_register_all_DH(void); - -int ENGINE_register_RAND(ENGINE *e); -void ENGINE_unregister_RAND(ENGINE *e); -void ENGINE_register_all_RAND(void); - -int ENGINE_register_STORE(ENGINE *e); -void ENGINE_unregister_STORE(ENGINE *e); -void ENGINE_register_all_STORE(void); - -int ENGINE_register_ciphers(ENGINE *e); -void ENGINE_unregister_ciphers(ENGINE *e); -void ENGINE_register_all_ciphers(void); - -int ENGINE_register_digests(ENGINE *e); -void ENGINE_unregister_digests(ENGINE *e); -void ENGINE_register_all_digests(void); - -int ENGINE_register_pkey_meths(ENGINE *e); -void ENGINE_unregister_pkey_meths(ENGINE *e); -void ENGINE_register_all_pkey_meths(void); - -int ENGINE_register_pkey_asn1_meths(ENGINE *e); -void ENGINE_unregister_pkey_asn1_meths(ENGINE *e); -void ENGINE_register_all_pkey_asn1_meths(void); - -/* - * These functions register all support from the above categories. Note, use - * of these functions can result in static linkage of code your application - * may not need. If you only need a subset of functionality, consider using - * more selective initialisation. - */ -int ENGINE_register_complete(ENGINE *e); -int ENGINE_register_all_complete(void); - -/* - * Send parametrised control commands to the engine. The possibilities to - * send down an integer, a pointer to data or a function pointer are - * provided. Any of the parameters may or may not be NULL, depending on the - * command number. In actuality, this function only requires a structural - * (rather than functional) reference to an engine, but many control commands - * may require the engine be functional. The caller should be aware of trying - * commands that require an operational ENGINE, and only use functional - * references in such situations. - */ -int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void)); - -/* - * This function tests if an ENGINE-specific command is usable as a - * "setting". Eg. in an application's config file that gets processed through - * ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to - * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl(). - */ -int ENGINE_cmd_is_executable(ENGINE *e, int cmd); - -/* - * This function works like ENGINE_ctrl() with the exception of taking a - * command name instead of a command number, and can handle optional - * commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation - * on how to use the cmd_name and cmd_optional. - */ -int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name, - long i, void *p, void (*f) (void), int cmd_optional); - -/* - * This function passes a command-name and argument to an ENGINE. The - * cmd_name is converted to a command number and the control command is - * called using 'arg' as an argument (unless the ENGINE doesn't support such - * a command, in which case no control command is called). The command is - * checked for input flags, and if necessary the argument will be converted - * to a numeric value. If cmd_optional is non-zero, then if the ENGINE - * doesn't support the given cmd_name the return value will be success - * anyway. This function is intended for applications to use so that users - * (or config files) can supply engine-specific config data to the ENGINE at - * run-time to control behaviour of specific engines. As such, it shouldn't - * be used for calling ENGINE_ctrl() functions that return data, deal with - * binary data, or that are otherwise supposed to be used directly through - * ENGINE_ctrl() in application code. Any "return" data from an ENGINE_ctrl() - * operation in this function will be lost - the return value is interpreted - * as failure if the return value is zero, success otherwise, and this - * function returns a boolean value as a result. In other words, vendors of - * 'ENGINE'-enabled devices should write ENGINE implementations with - * parameterisations that work in this scheme, so that compliant ENGINE-based - * applications can work consistently with the same configuration for the - * same ENGINE-enabled devices, across applications. - */ -int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg, - int cmd_optional); - -/* - * These functions are useful for manufacturing new ENGINE structures. They - * don't address reference counting at all - one uses them to populate an - * ENGINE structure with personalised implementations of things prior to - * using it directly or adding it to the builtin ENGINE list in OpenSSL. - * These are also here so that the ENGINE structure doesn't have to be - * exposed and break binary compatibility! - */ -ENGINE *ENGINE_new(void); -int ENGINE_free(ENGINE *e); -int ENGINE_up_ref(ENGINE *e); -int ENGINE_set_id(ENGINE *e, const char *id); -int ENGINE_set_name(ENGINE *e, const char *name); -int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth); -int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth); -int ENGINE_set_ECDH(ENGINE *e, const ECDH_METHOD *ecdh_meth); -int ENGINE_set_ECDSA(ENGINE *e, const ECDSA_METHOD *ecdsa_meth); -int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth); -int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth); -int ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_meth); -int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f); -int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f); -int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f); -int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f); -int ENGINE_set_load_privkey_function(ENGINE *e, - ENGINE_LOAD_KEY_PTR loadpriv_f); -int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f); -int ENGINE_set_load_ssl_client_cert_function(ENGINE *e, - ENGINE_SSL_CLIENT_CERT_PTR - loadssl_f); -int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f); -int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f); -int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f); -int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f); -int ENGINE_set_flags(ENGINE *e, int flags); -int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns); -/* These functions allow control over any per-structure ENGINE data. */ -int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, - CRYPTO_EX_free *free_func); -int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg); -void *ENGINE_get_ex_data(const ENGINE *e, int idx); - -/* - * This function cleans up anything that needs it. Eg. the ENGINE_add() - * function automatically ensures the list cleanup function is registered to - * be called from ENGINE_cleanup(). Similarly, all ENGINE_register_*** - * functions ensure ENGINE_cleanup() will clean up after them. - */ -void ENGINE_cleanup(void); - -/* - * These return values from within the ENGINE structure. These can be useful - * with functional references as well as structural references - it depends - * which you obtained. Using the result for functional purposes if you only - * obtained a structural reference may be problematic! - */ -const char *ENGINE_get_id(const ENGINE *e); -const char *ENGINE_get_name(const ENGINE *e); -const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e); -const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e); -const ECDH_METHOD *ENGINE_get_ECDH(const ENGINE *e); -const ECDSA_METHOD *ENGINE_get_ECDSA(const ENGINE *e); -const DH_METHOD *ENGINE_get_DH(const ENGINE *e); -const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e); -const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e); -ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e); -ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e); -ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e); -ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e); -ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e); -ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e); -ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE - *e); -ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e); -ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e); -ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e); -ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e); -const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid); -const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid); -const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid); -const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid); -const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e, - const char *str, - int len); -const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe, - const char *str, - int len); -const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e); -int ENGINE_get_flags(const ENGINE *e); - -/* - * FUNCTIONAL functions. These functions deal with ENGINE structures that - * have (or will) be initialised for use. Broadly speaking, the structural - * functions are useful for iterating the list of available engine types, - * creating new engine types, and other "list" operations. These functions - * actually deal with ENGINEs that are to be used. As such these functions - * can fail (if applicable) when particular engines are unavailable - eg. if - * a hardware accelerator is not attached or not functioning correctly. Each - * ENGINE has 2 reference counts; structural and functional. Every time a - * functional reference is obtained or released, a corresponding structural - * reference is automatically obtained or released too. - */ - -/* - * Initialise a engine type for use (or up its reference count if it's - * already in use). This will fail if the engine is not currently operational - * and cannot initialise. - */ -int ENGINE_init(ENGINE *e); -/* - * Free a functional reference to a engine type. This does not require a - * corresponding call to ENGINE_free as it also releases a structural - * reference. - */ -int ENGINE_finish(ENGINE *e); - -/* - * The following functions handle keys that are stored in some secondary - * location, handled by the engine. The storage may be on a card or - * whatever. - */ -EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, - UI_METHOD *ui_method, void *callback_data); -EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, - UI_METHOD *ui_method, void *callback_data); -int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, - STACK_OF(X509_NAME) *ca_dn, X509 **pcert, - EVP_PKEY **ppkey, STACK_OF(X509) **pother, - UI_METHOD *ui_method, void *callback_data); - -/* - * This returns a pointer for the current ENGINE structure that is (by - * default) performing any RSA operations. The value returned is an - * incremented reference, so it should be free'd (ENGINE_finish) before it is - * discarded. - */ -ENGINE *ENGINE_get_default_RSA(void); -/* Same for the other "methods" */ -ENGINE *ENGINE_get_default_DSA(void); -ENGINE *ENGINE_get_default_ECDH(void); -ENGINE *ENGINE_get_default_ECDSA(void); -ENGINE *ENGINE_get_default_DH(void); -ENGINE *ENGINE_get_default_RAND(void); -/* - * These functions can be used to get a functional reference to perform - * ciphering or digesting corresponding to "nid". - */ -ENGINE *ENGINE_get_cipher_engine(int nid); -ENGINE *ENGINE_get_digest_engine(int nid); -ENGINE *ENGINE_get_pkey_meth_engine(int nid); -ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid); - -/* - * This sets a new default ENGINE structure for performing RSA operations. If - * the result is non-zero (success) then the ENGINE structure will have had - * its reference count up'd so the caller should still free their own - * reference 'e'. - */ -int ENGINE_set_default_RSA(ENGINE *e); -int ENGINE_set_default_string(ENGINE *e, const char *def_list); -/* Same for the other "methods" */ -int ENGINE_set_default_DSA(ENGINE *e); -int ENGINE_set_default_ECDH(ENGINE *e); -int ENGINE_set_default_ECDSA(ENGINE *e); -int ENGINE_set_default_DH(ENGINE *e); -int ENGINE_set_default_RAND(ENGINE *e); -int ENGINE_set_default_ciphers(ENGINE *e); -int ENGINE_set_default_digests(ENGINE *e); -int ENGINE_set_default_pkey_meths(ENGINE *e); -int ENGINE_set_default_pkey_asn1_meths(ENGINE *e); - -/* - * The combination "set" - the flags are bitwise "OR"d from the - * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()" - * function, this function can result in unnecessary static linkage. If your - * application requires only specific functionality, consider using more - * selective functions. - */ -int ENGINE_set_default(ENGINE *e, unsigned int flags); - -void ENGINE_add_conf_module(void); - -/* Deprecated functions ... */ -/* int ENGINE_clear_defaults(void); */ - -/**************************/ -/* DYNAMIC ENGINE SUPPORT */ -/**************************/ - -/* Binary/behaviour compatibility levels */ -# define OSSL_DYNAMIC_VERSION (unsigned long)0x00020000 -/* - * Binary versions older than this are too old for us (whether we're a loader - * or a loadee) - */ -# define OSSL_DYNAMIC_OLDEST (unsigned long)0x00020000 - -/* - * When compiling an ENGINE entirely as an external shared library, loadable - * by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns' - * structure type provides the calling application's (or library's) error - * functionality and memory management function pointers to the loaded - * library. These should be used/set in the loaded library code so that the - * loading application's 'state' will be used/changed in all operations. The - * 'static_state' pointer allows the loaded library to know if it shares the - * same static data as the calling application (or library), and thus whether - * these callbacks need to be set or not. - */ -typedef void *(*dyn_MEM_malloc_cb) (size_t); -typedef void *(*dyn_MEM_realloc_cb) (void *, size_t); -typedef void (*dyn_MEM_free_cb) (void *); -typedef struct st_dynamic_MEM_fns { - dyn_MEM_malloc_cb malloc_cb; - dyn_MEM_realloc_cb realloc_cb; - dyn_MEM_free_cb free_cb; -} dynamic_MEM_fns; -/* - * FIXME: Perhaps the memory and locking code (crypto.h) should declare and - * use these types so we (and any other dependant code) can simplify a bit?? - */ -typedef void (*dyn_lock_locking_cb) (int, int, const char *, int); -typedef int (*dyn_lock_add_lock_cb) (int *, int, int, const char *, int); -typedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb) (const char *, - int); -typedef void (*dyn_dynlock_lock_cb) (int, struct CRYPTO_dynlock_value *, - const char *, int); -typedef void (*dyn_dynlock_destroy_cb) (struct CRYPTO_dynlock_value *, - const char *, int); -typedef struct st_dynamic_LOCK_fns { - dyn_lock_locking_cb lock_locking_cb; - dyn_lock_add_lock_cb lock_add_lock_cb; - dyn_dynlock_create_cb dynlock_create_cb; - dyn_dynlock_lock_cb dynlock_lock_cb; - dyn_dynlock_destroy_cb dynlock_destroy_cb; -} dynamic_LOCK_fns; -/* The top-level structure */ -typedef struct st_dynamic_fns { - void *static_state; - const ERR_FNS *err_fns; - const CRYPTO_EX_DATA_IMPL *ex_data_fns; - dynamic_MEM_fns mem_fns; - dynamic_LOCK_fns lock_fns; -} dynamic_fns; - -/* - * The version checking function should be of this prototype. NB: The - * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading - * code. If this function returns zero, it indicates a (potential) version - * incompatibility and the loaded library doesn't believe it can proceed. - * Otherwise, the returned value is the (latest) version supported by the - * loading library. The loader may still decide that the loaded code's - * version is unsatisfactory and could veto the load. The function is - * expected to be implemented with the symbol name "v_check", and a default - * implementation can be fully instantiated with - * IMPLEMENT_DYNAMIC_CHECK_FN(). - */ -typedef unsigned long (*dynamic_v_check_fn) (unsigned long ossl_version); -# define IMPLEMENT_DYNAMIC_CHECK_FN() \ - OPENSSL_EXPORT unsigned long v_check(unsigned long v); \ - OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \ - if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \ - return 0; } - -/* - * This function is passed the ENGINE structure to initialise with its own - * function and command settings. It should not adjust the structural or - * functional reference counts. If this function returns zero, (a) the load - * will be aborted, (b) the previous ENGINE state will be memcpy'd back onto - * the structure, and (c) the shared library will be unloaded. So - * implementations should do their own internal cleanup in failure - * circumstances otherwise they could leak. The 'id' parameter, if non-NULL, - * represents the ENGINE id that the loader is looking for. If this is NULL, - * the shared library can choose to return failure or to initialise a - * 'default' ENGINE. If non-NULL, the shared library must initialise only an - * ENGINE matching the passed 'id'. The function is expected to be - * implemented with the symbol name "bind_engine". A standard implementation - * can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where the parameter - * 'fn' is a callback function that populates the ENGINE structure and - * returns an int value (zero for failure). 'fn' should have prototype; - * [static] int fn(ENGINE *e, const char *id); - */ -typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id, - const dynamic_fns *fns); -# define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ - OPENSSL_EXPORT \ - int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \ - OPENSSL_EXPORT \ - int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ - if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ - if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ - fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \ - return 0; \ - CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \ - CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \ - CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \ - CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \ - CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \ - if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \ - return 0; \ - if(!ERR_set_implementation(fns->err_fns)) return 0; \ - skip_cbs: \ - if(!fn(e,id)) return 0; \ - return 1; } - -/* - * If the loading application (or library) and the loaded ENGINE library - * share the same static data (eg. they're both dynamically linked to the - * same libcrypto.so) we need a way to avoid trying to set system callbacks - - * this would fail, and for the same reason that it's unnecessary to try. If - * the loaded ENGINE has (or gets from through the loader) its own copy of - * the libcrypto static data, we will need to set the callbacks. The easiest - * way to detect this is to have a function that returns a pointer to some - * static data and let the loading application and loaded ENGINE compare - * their respective values. - */ -void *ENGINE_get_static_state(void); - -# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV) -void ENGINE_setup_bsd_cryptodev(void); -# endif - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_ENGINE_strings(void); - -/* Error codes for the ENGINE functions. */ - -/* Function codes. */ -# define ENGINE_F_DYNAMIC_CTRL 180 -# define ENGINE_F_DYNAMIC_GET_DATA_CTX 181 -# define ENGINE_F_DYNAMIC_LOAD 182 -# define ENGINE_F_DYNAMIC_SET_DATA_CTX 183 -# define ENGINE_F_ENGINE_ADD 105 -# define ENGINE_F_ENGINE_BY_ID 106 -# define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 170 -# define ENGINE_F_ENGINE_CTRL 142 -# define ENGINE_F_ENGINE_CTRL_CMD 178 -# define ENGINE_F_ENGINE_CTRL_CMD_STRING 171 -# define ENGINE_F_ENGINE_FINISH 107 -# define ENGINE_F_ENGINE_FREE_UTIL 108 -# define ENGINE_F_ENGINE_GET_CIPHER 185 -# define ENGINE_F_ENGINE_GET_DEFAULT_TYPE 177 -# define ENGINE_F_ENGINE_GET_DIGEST 186 -# define ENGINE_F_ENGINE_GET_NEXT 115 -# define ENGINE_F_ENGINE_GET_PKEY_ASN1_METH 193 -# define ENGINE_F_ENGINE_GET_PKEY_METH 192 -# define ENGINE_F_ENGINE_GET_PREV 116 -# define ENGINE_F_ENGINE_INIT 119 -# define ENGINE_F_ENGINE_LIST_ADD 120 -# define ENGINE_F_ENGINE_LIST_REMOVE 121 -# define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150 -# define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151 -# define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT 194 -# define ENGINE_F_ENGINE_NEW 122 -# define ENGINE_F_ENGINE_REMOVE 123 -# define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189 -# define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126 -# define ENGINE_F_ENGINE_SET_ID 129 -# define ENGINE_F_ENGINE_SET_NAME 130 -# define ENGINE_F_ENGINE_TABLE_REGISTER 184 -# define ENGINE_F_ENGINE_UNLOAD_KEY 152 -# define ENGINE_F_ENGINE_UNLOCKED_FINISH 191 -# define ENGINE_F_ENGINE_UP_REF 190 -# define ENGINE_F_INT_CTRL_HELPER 172 -# define ENGINE_F_INT_ENGINE_CONFIGURE 188 -# define ENGINE_F_INT_ENGINE_MODULE_INIT 187 -# define ENGINE_F_LOG_MESSAGE 141 - -/* Reason codes. */ -# define ENGINE_R_ALREADY_LOADED 100 -# define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133 -# define ENGINE_R_CMD_NOT_EXECUTABLE 134 -# define ENGINE_R_COMMAND_TAKES_INPUT 135 -# define ENGINE_R_COMMAND_TAKES_NO_INPUT 136 -# define ENGINE_R_CONFLICTING_ENGINE_ID 103 -# define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119 -# define ENGINE_R_DH_NOT_IMPLEMENTED 139 -# define ENGINE_R_DSA_NOT_IMPLEMENTED 140 -# define ENGINE_R_DSO_FAILURE 104 -# define ENGINE_R_DSO_NOT_FOUND 132 -# define ENGINE_R_ENGINES_SECTION_ERROR 148 -# define ENGINE_R_ENGINE_CONFIGURATION_ERROR 102 -# define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105 -# define ENGINE_R_ENGINE_SECTION_ERROR 149 -# define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128 -# define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129 -# define ENGINE_R_FINISH_FAILED 106 -# define ENGINE_R_GET_HANDLE_FAILED 107 -# define ENGINE_R_ID_OR_NAME_MISSING 108 -# define ENGINE_R_INIT_FAILED 109 -# define ENGINE_R_INTERNAL_LIST_ERROR 110 -# define ENGINE_R_INVALID_ARGUMENT 143 -# define ENGINE_R_INVALID_CMD_NAME 137 -# define ENGINE_R_INVALID_CMD_NUMBER 138 -# define ENGINE_R_INVALID_INIT_VALUE 151 -# define ENGINE_R_INVALID_STRING 150 -# define ENGINE_R_NOT_INITIALISED 117 -# define ENGINE_R_NOT_LOADED 112 -# define ENGINE_R_NO_CONTROL_FUNCTION 120 -# define ENGINE_R_NO_INDEX 144 -# define ENGINE_R_NO_LOAD_FUNCTION 125 -# define ENGINE_R_NO_REFERENCE 130 -# define ENGINE_R_NO_SUCH_ENGINE 116 -# define ENGINE_R_NO_UNLOAD_FUNCTION 126 -# define ENGINE_R_PROVIDE_PARAMETERS 113 -# define ENGINE_R_RSA_NOT_IMPLEMENTED 141 -# define ENGINE_R_UNIMPLEMENTED_CIPHER 146 -# define ENGINE_R_UNIMPLEMENTED_DIGEST 147 -# define ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD 101 -# define ENGINE_R_VERSION_INCOMPATIBILITY 145 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/err.h b/libs/win32/openssl/include/openssl/err.h deleted file mode 100644 index 585aa8ba3d..0000000000 --- a/libs/win32/openssl/include/openssl/err.h +++ /dev/null @@ -1,389 +0,0 @@ -/* crypto/err/err.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_ERR_H -# define HEADER_ERR_H - -# include - -# ifndef OPENSSL_NO_FP_API -# include -# include -# endif - -# include -# ifndef OPENSSL_NO_BIO -# include -# endif -# ifndef OPENSSL_NO_LHASH -# include -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -# ifndef OPENSSL_NO_ERR -# define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,d,e) -# else -# define ERR_PUT_error(a,b,c,d,e) ERR_put_error(a,b,c,NULL,0) -# endif - -# include - -# define ERR_TXT_MALLOCED 0x01 -# define ERR_TXT_STRING 0x02 - -# define ERR_FLAG_MARK 0x01 - -# define ERR_NUM_ERRORS 16 -typedef struct err_state_st { - CRYPTO_THREADID tid; - int err_flags[ERR_NUM_ERRORS]; - unsigned long err_buffer[ERR_NUM_ERRORS]; - char *err_data[ERR_NUM_ERRORS]; - int err_data_flags[ERR_NUM_ERRORS]; - const char *err_file[ERR_NUM_ERRORS]; - int err_line[ERR_NUM_ERRORS]; - int top, bottom; -} ERR_STATE; - -/* library */ -# define ERR_LIB_NONE 1 -# define ERR_LIB_SYS 2 -# define ERR_LIB_BN 3 -# define ERR_LIB_RSA 4 -# define ERR_LIB_DH 5 -# define ERR_LIB_EVP 6 -# define ERR_LIB_BUF 7 -# define ERR_LIB_OBJ 8 -# define ERR_LIB_PEM 9 -# define ERR_LIB_DSA 10 -# define ERR_LIB_X509 11 -/* #define ERR_LIB_METH 12 */ -# define ERR_LIB_ASN1 13 -# define ERR_LIB_CONF 14 -# define ERR_LIB_CRYPTO 15 -# define ERR_LIB_EC 16 -# define ERR_LIB_SSL 20 -/* #define ERR_LIB_SSL23 21 */ -/* #define ERR_LIB_SSL2 22 */ -/* #define ERR_LIB_SSL3 23 */ -/* #define ERR_LIB_RSAREF 30 */ -/* #define ERR_LIB_PROXY 31 */ -# define ERR_LIB_BIO 32 -# define ERR_LIB_PKCS7 33 -# define ERR_LIB_X509V3 34 -# define ERR_LIB_PKCS12 35 -# define ERR_LIB_RAND 36 -# define ERR_LIB_DSO 37 -# define ERR_LIB_ENGINE 38 -# define ERR_LIB_OCSP 39 -# define ERR_LIB_UI 40 -# define ERR_LIB_COMP 41 -# define ERR_LIB_ECDSA 42 -# define ERR_LIB_ECDH 43 -# define ERR_LIB_STORE 44 -# define ERR_LIB_FIPS 45 -# define ERR_LIB_CMS 46 -# define ERR_LIB_TS 47 -# define ERR_LIB_HMAC 48 -# define ERR_LIB_JPAKE 49 - -# define ERR_LIB_USER 128 - -# define SYSerr(f,r) ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__) -# define BNerr(f,r) ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__) -# define RSAerr(f,r) ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__) -# define DHerr(f,r) ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__) -# define EVPerr(f,r) ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__) -# define BUFerr(f,r) ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__) -# define OBJerr(f,r) ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__) -# define PEMerr(f,r) ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__) -# define DSAerr(f,r) ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__) -# define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__) -# define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__) -# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__) -# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__) -# define ECerr(f,r) ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__) -# define SSLerr(f,r) ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__) -# define BIOerr(f,r) ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__) -# define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__) -# define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__) -# define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__) -# define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__) -# define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__) -# define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__) -# define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__) -# define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__) -# define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__) -# define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__) -# define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__) -# define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__) -# define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__) -# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__) -# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),__FILE__,__LINE__) -# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),__FILE__,__LINE__) -# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__) - -/* - * Borland C seems too stupid to be able to shift and do longs in the - * pre-processor :-( - */ -# define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)*0x1000000)| \ - ((((unsigned long)f)&0xfffL)*0x1000)| \ - ((((unsigned long)r)&0xfffL))) -# define ERR_GET_LIB(l) (int)((((unsigned long)l)>>24L)&0xffL) -# define ERR_GET_FUNC(l) (int)((((unsigned long)l)>>12L)&0xfffL) -# define ERR_GET_REASON(l) (int)((l)&0xfffL) -# define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL) - -/* OS functions */ -# define SYS_F_FOPEN 1 -# define SYS_F_CONNECT 2 -# define SYS_F_GETSERVBYNAME 3 -# define SYS_F_SOCKET 4 -# define SYS_F_IOCTLSOCKET 5 -# define SYS_F_BIND 6 -# define SYS_F_LISTEN 7 -# define SYS_F_ACCEPT 8 -# define SYS_F_WSASTARTUP 9/* Winsock stuff */ -# define SYS_F_OPENDIR 10 -# define SYS_F_FREAD 11 - -/* reasons */ -# define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */ -# define ERR_R_BN_LIB ERR_LIB_BN/* 3 */ -# define ERR_R_RSA_LIB ERR_LIB_RSA/* 4 */ -# define ERR_R_DH_LIB ERR_LIB_DH/* 5 */ -# define ERR_R_EVP_LIB ERR_LIB_EVP/* 6 */ -# define ERR_R_BUF_LIB ERR_LIB_BUF/* 7 */ -# define ERR_R_OBJ_LIB ERR_LIB_OBJ/* 8 */ -# define ERR_R_PEM_LIB ERR_LIB_PEM/* 9 */ -# define ERR_R_DSA_LIB ERR_LIB_DSA/* 10 */ -# define ERR_R_X509_LIB ERR_LIB_X509/* 11 */ -# define ERR_R_ASN1_LIB ERR_LIB_ASN1/* 13 */ -# define ERR_R_CONF_LIB ERR_LIB_CONF/* 14 */ -# define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO/* 15 */ -# define ERR_R_EC_LIB ERR_LIB_EC/* 16 */ -# define ERR_R_SSL_LIB ERR_LIB_SSL/* 20 */ -# define ERR_R_BIO_LIB ERR_LIB_BIO/* 32 */ -# define ERR_R_PKCS7_LIB ERR_LIB_PKCS7/* 33 */ -# define ERR_R_X509V3_LIB ERR_LIB_X509V3/* 34 */ -# define ERR_R_PKCS12_LIB ERR_LIB_PKCS12/* 35 */ -# define ERR_R_RAND_LIB ERR_LIB_RAND/* 36 */ -# define ERR_R_DSO_LIB ERR_LIB_DSO/* 37 */ -# define ERR_R_ENGINE_LIB ERR_LIB_ENGINE/* 38 */ -# define ERR_R_OCSP_LIB ERR_LIB_OCSP/* 39 */ -# define ERR_R_UI_LIB ERR_LIB_UI/* 40 */ -# define ERR_R_COMP_LIB ERR_LIB_COMP/* 41 */ -# define ERR_R_ECDSA_LIB ERR_LIB_ECDSA/* 42 */ -# define ERR_R_ECDH_LIB ERR_LIB_ECDH/* 43 */ -# define ERR_R_STORE_LIB ERR_LIB_STORE/* 44 */ -# define ERR_R_TS_LIB ERR_LIB_TS/* 45 */ - -# define ERR_R_NESTED_ASN1_ERROR 58 -# define ERR_R_BAD_ASN1_OBJECT_HEADER 59 -# define ERR_R_BAD_GET_ASN1_OBJECT_CALL 60 -# define ERR_R_EXPECTING_AN_ASN1_SEQUENCE 61 -# define ERR_R_ASN1_LENGTH_MISMATCH 62 -# define ERR_R_MISSING_ASN1_EOS 63 - -/* fatal error */ -# define ERR_R_FATAL 64 -# define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL) -# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL) -# define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL) -# define ERR_R_INTERNAL_ERROR (4|ERR_R_FATAL) -# define ERR_R_DISABLED (5|ERR_R_FATAL) - -/* - * 99 is the maximum possible ERR_R_... code, higher values are reserved for - * the individual libraries - */ - -typedef struct ERR_string_data_st { - unsigned long error; - const char *string; -} ERR_STRING_DATA; - -void ERR_put_error(int lib, int func, int reason, const char *file, int line); -void ERR_set_error_data(char *data, int flags); - -unsigned long ERR_get_error(void); -unsigned long ERR_get_error_line(const char **file, int *line); -unsigned long ERR_get_error_line_data(const char **file, int *line, - const char **data, int *flags); -unsigned long ERR_peek_error(void); -unsigned long ERR_peek_error_line(const char **file, int *line); -unsigned long ERR_peek_error_line_data(const char **file, int *line, - const char **data, int *flags); -unsigned long ERR_peek_last_error(void); -unsigned long ERR_peek_last_error_line(const char **file, int *line); -unsigned long ERR_peek_last_error_line_data(const char **file, int *line, - const char **data, int *flags); -void ERR_clear_error(void); -char *ERR_error_string(unsigned long e, char *buf); -void ERR_error_string_n(unsigned long e, char *buf, size_t len); -const char *ERR_lib_error_string(unsigned long e); -const char *ERR_func_error_string(unsigned long e); -const char *ERR_reason_error_string(unsigned long e); -void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u), - void *u); -# ifndef OPENSSL_NO_FP_API -void ERR_print_errors_fp(FILE *fp); -# endif -# ifndef OPENSSL_NO_BIO -void ERR_print_errors(BIO *bp); -# endif -void ERR_add_error_data(int num, ...); -void ERR_add_error_vdata(int num, va_list args); -void ERR_load_strings(int lib, ERR_STRING_DATA str[]); -void ERR_unload_strings(int lib, ERR_STRING_DATA str[]); -void ERR_load_ERR_strings(void); -void ERR_load_crypto_strings(void); -void ERR_free_strings(void); - -void ERR_remove_thread_state(const CRYPTO_THREADID *tid); -# ifndef OPENSSL_NO_DEPRECATED -void ERR_remove_state(unsigned long pid); /* if zero we look it up */ -# endif -ERR_STATE *ERR_get_state(void); - -# ifndef OPENSSL_NO_LHASH -LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void); -LHASH_OF(ERR_STATE) *ERR_get_err_state_table(void); -void ERR_release_err_state_table(LHASH_OF(ERR_STATE) **hash); -# endif - -int ERR_get_next_error_library(void); - -int ERR_set_mark(void); -int ERR_pop_to_mark(void); - -/* Already defined in ossl_typ.h */ -/* typedef struct st_ERR_FNS ERR_FNS; */ -/* - * An application can use this function and provide the return value to - * loaded modules that should use the application's ERR state/functionality - */ -const ERR_FNS *ERR_get_implementation(void); -/* - * A loaded module should call this function prior to any ERR operations - * using the application's "ERR_FNS". - */ -int ERR_set_implementation(const ERR_FNS *fns); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/evp.h b/libs/win32/openssl/include/openssl/evp.h deleted file mode 100644 index d258ef870a..0000000000 --- a/libs/win32/openssl/include/openssl/evp.h +++ /dev/null @@ -1,1536 +0,0 @@ -/* crypto/evp/evp.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_ENVELOPE_H -# define HEADER_ENVELOPE_H - -# ifdef OPENSSL_ALGORITHM_DEFINES -# include -# else -# define OPENSSL_ALGORITHM_DEFINES -# include -# undef OPENSSL_ALGORITHM_DEFINES -# endif - -# include - -# include - -# ifndef OPENSSL_NO_BIO -# include -# endif - -/*- -#define EVP_RC2_KEY_SIZE 16 -#define EVP_RC4_KEY_SIZE 16 -#define EVP_BLOWFISH_KEY_SIZE 16 -#define EVP_CAST5_KEY_SIZE 16 -#define EVP_RC5_32_12_16_KEY_SIZE 16 -*/ -# define EVP_MAX_MD_SIZE 64/* longest known is SHA512 */ -# define EVP_MAX_KEY_LENGTH 64 -# define EVP_MAX_IV_LENGTH 16 -# define EVP_MAX_BLOCK_LENGTH 32 - -# define PKCS5_SALT_LEN 8 -/* Default PKCS#5 iteration count */ -# define PKCS5_DEFAULT_ITER 2048 - -# include - -# define EVP_PK_RSA 0x0001 -# define EVP_PK_DSA 0x0002 -# define EVP_PK_DH 0x0004 -# define EVP_PK_EC 0x0008 -# define EVP_PKT_SIGN 0x0010 -# define EVP_PKT_ENC 0x0020 -# define EVP_PKT_EXCH 0x0040 -# define EVP_PKS_RSA 0x0100 -# define EVP_PKS_DSA 0x0200 -# define EVP_PKS_EC 0x0400 - -# define EVP_PKEY_NONE NID_undef -# define EVP_PKEY_RSA NID_rsaEncryption -# define EVP_PKEY_RSA2 NID_rsa -# define EVP_PKEY_DSA NID_dsa -# define EVP_PKEY_DSA1 NID_dsa_2 -# define EVP_PKEY_DSA2 NID_dsaWithSHA -# define EVP_PKEY_DSA3 NID_dsaWithSHA1 -# define EVP_PKEY_DSA4 NID_dsaWithSHA1_2 -# define EVP_PKEY_DH NID_dhKeyAgreement -# define EVP_PKEY_DHX NID_dhpublicnumber -# define EVP_PKEY_EC NID_X9_62_id_ecPublicKey -# define EVP_PKEY_HMAC NID_hmac -# define EVP_PKEY_CMAC NID_cmac - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Type needs to be a bit field Sub-type needs to be for variations on the - * method, as in, can it do arbitrary encryption.... - */ -struct evp_pkey_st { - int type; - int save_type; - int references; - const EVP_PKEY_ASN1_METHOD *ameth; - ENGINE *engine; - union { - char *ptr; -# ifndef OPENSSL_NO_RSA - struct rsa_st *rsa; /* RSA */ -# endif -# ifndef OPENSSL_NO_DSA - struct dsa_st *dsa; /* DSA */ -# endif -# ifndef OPENSSL_NO_DH - struct dh_st *dh; /* DH */ -# endif -# ifndef OPENSSL_NO_EC - struct ec_key_st *ec; /* ECC */ -# endif - } pkey; - int save_parameters; - STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ -} /* EVP_PKEY */ ; - -# define EVP_PKEY_MO_SIGN 0x0001 -# define EVP_PKEY_MO_VERIFY 0x0002 -# define EVP_PKEY_MO_ENCRYPT 0x0004 -# define EVP_PKEY_MO_DECRYPT 0x0008 - -# ifndef EVP_MD -struct env_md_st { - int type; - int pkey_type; - int md_size; - unsigned long flags; - int (*init) (EVP_MD_CTX *ctx); - int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count); - int (*final) (EVP_MD_CTX *ctx, unsigned char *md); - int (*copy) (EVP_MD_CTX *to, const EVP_MD_CTX *from); - int (*cleanup) (EVP_MD_CTX *ctx); - /* FIXME: prototype these some day */ - int (*sign) (int type, const unsigned char *m, unsigned int m_length, - unsigned char *sigret, unsigned int *siglen, void *key); - int (*verify) (int type, const unsigned char *m, unsigned int m_length, - const unsigned char *sigbuf, unsigned int siglen, - void *key); - int required_pkey_type[5]; /* EVP_PKEY_xxx */ - int block_size; - int ctx_size; /* how big does the ctx->md_data need to be */ - /* control function */ - int (*md_ctrl) (EVP_MD_CTX *ctx, int cmd, int p1, void *p2); -} /* EVP_MD */ ; - -typedef int evp_sign_method(int type, const unsigned char *m, - unsigned int m_length, unsigned char *sigret, - unsigned int *siglen, void *key); -typedef int evp_verify_method(int type, const unsigned char *m, - unsigned int m_length, - const unsigned char *sigbuf, - unsigned int siglen, void *key); - -/* digest can only handle a single block */ -# define EVP_MD_FLAG_ONESHOT 0x0001 - -/* - * digest is a "clone" digest used - * which is a copy of an existing - * one for a specific public key type. - * EVP_dss1() etc - */ -# define EVP_MD_FLAG_PKEY_DIGEST 0x0002 - -/* Digest uses EVP_PKEY_METHOD for signing instead of MD specific signing */ - -# define EVP_MD_FLAG_PKEY_METHOD_SIGNATURE 0x0004 - -/* DigestAlgorithmIdentifier flags... */ - -# define EVP_MD_FLAG_DIGALGID_MASK 0x0018 - -/* NULL or absent parameter accepted. Use NULL */ - -# define EVP_MD_FLAG_DIGALGID_NULL 0x0000 - -/* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */ - -# define EVP_MD_FLAG_DIGALGID_ABSENT 0x0008 - -/* Custom handling via ctrl */ - -# define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018 - -/* Note if suitable for use in FIPS mode */ -# define EVP_MD_FLAG_FIPS 0x0400 - -/* Digest ctrls */ - -# define EVP_MD_CTRL_DIGALGID 0x1 -# define EVP_MD_CTRL_MICALG 0x2 - -/* Minimum Algorithm specific ctrl value */ - -# define EVP_MD_CTRL_ALG_CTRL 0x1000 - -# define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} - -# ifndef OPENSSL_NO_DSA -# define EVP_PKEY_DSA_method (evp_sign_method *)DSA_sign, \ - (evp_verify_method *)DSA_verify, \ - {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \ - EVP_PKEY_DSA4,0} -# else -# define EVP_PKEY_DSA_method EVP_PKEY_NULL_method -# endif - -# ifndef OPENSSL_NO_ECDSA -# define EVP_PKEY_ECDSA_method (evp_sign_method *)ECDSA_sign, \ - (evp_verify_method *)ECDSA_verify, \ - {EVP_PKEY_EC,0,0,0} -# else -# define EVP_PKEY_ECDSA_method EVP_PKEY_NULL_method -# endif - -# ifndef OPENSSL_NO_RSA -# define EVP_PKEY_RSA_method (evp_sign_method *)RSA_sign, \ - (evp_verify_method *)RSA_verify, \ - {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} -# define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \ - (evp_sign_method *)RSA_sign_ASN1_OCTET_STRING, \ - (evp_verify_method *)RSA_verify_ASN1_OCTET_STRING, \ - {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} -# else -# define EVP_PKEY_RSA_method EVP_PKEY_NULL_method -# define EVP_PKEY_RSA_ASN1_OCTET_STRING_method EVP_PKEY_NULL_method -# endif - -# endif /* !EVP_MD */ - -struct env_md_ctx_st { - const EVP_MD *digest; - ENGINE *engine; /* functional reference if 'digest' is - * ENGINE-provided */ - unsigned long flags; - void *md_data; - /* Public key context for sign/verify */ - EVP_PKEY_CTX *pctx; - /* Update function: usually copied from EVP_MD */ - int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count); -} /* EVP_MD_CTX */ ; - -/* values for EVP_MD_CTX flags */ - -# define EVP_MD_CTX_FLAG_ONESHOT 0x0001/* digest update will be - * called once only */ -# define EVP_MD_CTX_FLAG_CLEANED 0x0002/* context has already been - * cleaned */ -# define EVP_MD_CTX_FLAG_REUSE 0x0004/* Don't free up ctx->md_data - * in EVP_MD_CTX_cleanup */ -/* - * FIPS and pad options are ignored in 1.0.0, definitions are here so we - * don't accidentally reuse the values for other purposes. - */ - -# define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008/* Allow use of non FIPS - * digest in FIPS mode */ - -/* - * The following PAD options are also currently ignored in 1.0.0, digest - * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*() - * instead. - */ -# define EVP_MD_CTX_FLAG_PAD_MASK 0xF0/* RSA mode to use */ -# define EVP_MD_CTX_FLAG_PAD_PKCS1 0x00/* PKCS#1 v1.5 mode */ -# define EVP_MD_CTX_FLAG_PAD_X931 0x10/* X9.31 mode */ -# define EVP_MD_CTX_FLAG_PAD_PSS 0x20/* PSS mode */ - -# define EVP_MD_CTX_FLAG_NO_INIT 0x0100/* Don't initialize md_data */ - -struct evp_cipher_st { - int nid; - int block_size; - /* Default value for variable length ciphers */ - int key_len; - int iv_len; - /* Various flags */ - unsigned long flags; - /* init key */ - int (*init) (EVP_CIPHER_CTX *ctx, const unsigned char *key, - const unsigned char *iv, int enc); - /* encrypt/decrypt data */ - int (*do_cipher) (EVP_CIPHER_CTX *ctx, unsigned char *out, - const unsigned char *in, size_t inl); - /* cleanup ctx */ - int (*cleanup) (EVP_CIPHER_CTX *); - /* how big ctx->cipher_data needs to be */ - int ctx_size; - /* Populate a ASN1_TYPE with parameters */ - int (*set_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *); - /* Get parameters from a ASN1_TYPE */ - int (*get_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *); - /* Miscellaneous operations */ - int (*ctrl) (EVP_CIPHER_CTX *, int type, int arg, void *ptr); - /* Application data */ - void *app_data; -} /* EVP_CIPHER */ ; - -/* Values for cipher flags */ - -/* Modes for ciphers */ - -# define EVP_CIPH_STREAM_CIPHER 0x0 -# define EVP_CIPH_ECB_MODE 0x1 -# define EVP_CIPH_CBC_MODE 0x2 -# define EVP_CIPH_CFB_MODE 0x3 -# define EVP_CIPH_OFB_MODE 0x4 -# define EVP_CIPH_CTR_MODE 0x5 -# define EVP_CIPH_GCM_MODE 0x6 -# define EVP_CIPH_CCM_MODE 0x7 -# define EVP_CIPH_XTS_MODE 0x10001 -# define EVP_CIPH_WRAP_MODE 0x10002 -# define EVP_CIPH_MODE 0xF0007 -/* Set if variable length cipher */ -# define EVP_CIPH_VARIABLE_LENGTH 0x8 -/* Set if the iv handling should be done by the cipher itself */ -# define EVP_CIPH_CUSTOM_IV 0x10 -/* Set if the cipher's init() function should be called if key is NULL */ -# define EVP_CIPH_ALWAYS_CALL_INIT 0x20 -/* Call ctrl() to init cipher parameters */ -# define EVP_CIPH_CTRL_INIT 0x40 -/* Don't use standard key length function */ -# define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 -/* Don't use standard block padding */ -# define EVP_CIPH_NO_PADDING 0x100 -/* cipher handles random key generation */ -# define EVP_CIPH_RAND_KEY 0x200 -/* cipher has its own additional copying logic */ -# define EVP_CIPH_CUSTOM_COPY 0x400 -/* Allow use default ASN1 get/set iv */ -# define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000 -/* Buffer length in bits not bytes: CFB1 mode only */ -# define EVP_CIPH_FLAG_LENGTH_BITS 0x2000 -/* Note if suitable for use in FIPS mode */ -# define EVP_CIPH_FLAG_FIPS 0x4000 -/* Allow non FIPS cipher in FIPS mode */ -# define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x8000 -/* - * Cipher handles any and all padding logic as well as finalisation. - */ -# define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000 -# define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 -# define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000 - -/* - * Cipher context flag to indicate we can handle wrap mode: if allowed in - * older applications it could overflow buffers. - */ - -# define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1 - -/* ctrl() values */ - -# define EVP_CTRL_INIT 0x0 -# define EVP_CTRL_SET_KEY_LENGTH 0x1 -# define EVP_CTRL_GET_RC2_KEY_BITS 0x2 -# define EVP_CTRL_SET_RC2_KEY_BITS 0x3 -# define EVP_CTRL_GET_RC5_ROUNDS 0x4 -# define EVP_CTRL_SET_RC5_ROUNDS 0x5 -# define EVP_CTRL_RAND_KEY 0x6 -# define EVP_CTRL_PBE_PRF_NID 0x7 -# define EVP_CTRL_COPY 0x8 -# define EVP_CTRL_GCM_SET_IVLEN 0x9 -# define EVP_CTRL_GCM_GET_TAG 0x10 -# define EVP_CTRL_GCM_SET_TAG 0x11 -# define EVP_CTRL_GCM_SET_IV_FIXED 0x12 -# define EVP_CTRL_GCM_IV_GEN 0x13 -# define EVP_CTRL_CCM_SET_IVLEN EVP_CTRL_GCM_SET_IVLEN -# define EVP_CTRL_CCM_GET_TAG EVP_CTRL_GCM_GET_TAG -# define EVP_CTRL_CCM_SET_TAG EVP_CTRL_GCM_SET_TAG -# define EVP_CTRL_CCM_SET_L 0x14 -# define EVP_CTRL_CCM_SET_MSGLEN 0x15 -/* - * AEAD cipher deduces payload length and returns number of bytes required to - * store MAC and eventual padding. Subsequent call to EVP_Cipher even - * appends/verifies MAC. - */ -# define EVP_CTRL_AEAD_TLS1_AAD 0x16 -/* Used by composite AEAD ciphers, no-op in GCM, CCM... */ -# define EVP_CTRL_AEAD_SET_MAC_KEY 0x17 -/* Set the GCM invocation field, decrypt only */ -# define EVP_CTRL_GCM_SET_IV_INV 0x18 - -# define EVP_CTRL_TLS1_1_MULTIBLOCK_AAD 0x19 -# define EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT 0x1a -# define EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT 0x1b -# define EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE 0x1c - -/* RFC 5246 defines additional data to be 13 bytes in length */ -# define EVP_AEAD_TLS1_AAD_LEN 13 - -typedef struct { - unsigned char *out; - const unsigned char *inp; - size_t len; - unsigned int interleave; -} EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM; - -/* GCM TLS constants */ -/* Length of fixed part of IV derived from PRF */ -# define EVP_GCM_TLS_FIXED_IV_LEN 4 -/* Length of explicit part of IV part of TLS records */ -# define EVP_GCM_TLS_EXPLICIT_IV_LEN 8 -/* Length of tag for TLS */ -# define EVP_GCM_TLS_TAG_LEN 16 - -typedef struct evp_cipher_info_st { - const EVP_CIPHER *cipher; - unsigned char iv[EVP_MAX_IV_LENGTH]; -} EVP_CIPHER_INFO; - -struct evp_cipher_ctx_st { - const EVP_CIPHER *cipher; - ENGINE *engine; /* functional reference if 'cipher' is - * ENGINE-provided */ - int encrypt; /* encrypt or decrypt */ - int buf_len; /* number we have left */ - unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ - unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ - unsigned char buf[EVP_MAX_BLOCK_LENGTH]; /* saved partial block */ - int num; /* used by cfb/ofb/ctr mode */ - void *app_data; /* application stuff */ - int key_len; /* May change for variable length cipher */ - unsigned long flags; /* Various flags */ - void *cipher_data; /* per EVP data */ - int final_used; - int block_mask; - unsigned char final[EVP_MAX_BLOCK_LENGTH]; /* possible final block */ -} /* EVP_CIPHER_CTX */ ; - -typedef struct evp_Encode_Ctx_st { - /* number saved in a partial encode/decode */ - int num; - /* - * The length is either the output line length (in input bytes) or the - * shortest input line length that is ok. Once decoding begins, the - * length is adjusted up each time a longer line is decoded - */ - int length; - /* data to encode */ - unsigned char enc_data[80]; - /* number read on current line */ - int line_num; - int expect_nl; -} EVP_ENCODE_CTX; - -/* Password based encryption function */ -typedef int (EVP_PBE_KEYGEN) (EVP_CIPHER_CTX *ctx, const char *pass, - int passlen, ASN1_TYPE *param, - const EVP_CIPHER *cipher, const EVP_MD *md, - int en_de); - -# ifndef OPENSSL_NO_RSA -# define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ - (char *)(rsa)) -# endif - -# ifndef OPENSSL_NO_DSA -# define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ - (char *)(dsa)) -# endif - -# ifndef OPENSSL_NO_DH -# define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\ - (char *)(dh)) -# endif - -# ifndef OPENSSL_NO_EC -# define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC,\ - (char *)(eckey)) -# endif - -/* Add some extra combinations */ -# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) -# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) -# define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) -# define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a)) - -int EVP_MD_type(const EVP_MD *md); -# define EVP_MD_nid(e) EVP_MD_type(e) -# define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) -int EVP_MD_pkey_type(const EVP_MD *md); -int EVP_MD_size(const EVP_MD *md); -int EVP_MD_block_size(const EVP_MD *md); -unsigned long EVP_MD_flags(const EVP_MD *md); - -const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); -# define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) -# define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) -# define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) - -int EVP_CIPHER_nid(const EVP_CIPHER *cipher); -# define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) -int EVP_CIPHER_block_size(const EVP_CIPHER *cipher); -int EVP_CIPHER_key_length(const EVP_CIPHER *cipher); -int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher); -unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher); -# define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) - -const EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); -int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); -int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); -int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); -int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx); -int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in); -void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx); -void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data); -# define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) -unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx); -# define EVP_CIPHER_CTX_mode(e) (EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE) - -# define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) -# define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) - -# define EVP_SignInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) -# define EVP_SignInit(a,b) EVP_DigestInit(a,b) -# define EVP_SignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) -# define EVP_VerifyInit_ex(a,b,c) EVP_DigestInit_ex(a,b,c) -# define EVP_VerifyInit(a,b) EVP_DigestInit(a,b) -# define EVP_VerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) -# define EVP_OpenUpdate(a,b,c,d,e) EVP_DecryptUpdate(a,b,c,d,e) -# define EVP_SealUpdate(a,b,c,d,e) EVP_EncryptUpdate(a,b,c,d,e) -# define EVP_DigestSignUpdate(a,b,c) EVP_DigestUpdate(a,b,c) -# define EVP_DigestVerifyUpdate(a,b,c) EVP_DigestUpdate(a,b,c) - -# ifdef CONST_STRICT -void BIO_set_md(BIO *, const EVP_MD *md); -# else -# define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md) -# endif -# define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp) -# define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp) -# define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp) -# define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) -# define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp) - -int EVP_Cipher(EVP_CIPHER_CTX *c, - unsigned char *out, const unsigned char *in, unsigned int inl); - -# define EVP_add_cipher_alias(n,alias) \ - OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n)) -# define EVP_add_digest_alias(n,alias) \ - OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n)) -# define EVP_delete_cipher_alias(alias) \ - OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS); -# define EVP_delete_digest_alias(alias) \ - OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS); - -void EVP_MD_CTX_init(EVP_MD_CTX *ctx); -int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); -EVP_MD_CTX *EVP_MD_CTX_create(void); -void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); -int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); -void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags); -void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags); -int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags); -int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); -int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt); -int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s); -int EVP_Digest(const void *data, size_t count, - unsigned char *md, unsigned int *size, const EVP_MD *type, - ENGINE *impl); - -int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in); -int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); -int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s); - -int EVP_read_pw_string(char *buf, int length, const char *prompt, int verify); -int EVP_read_pw_string_min(char *buf, int minlen, int maxlen, - const char *prompt, int verify); -void EVP_set_pw_prompt(const char *prompt); -char *EVP_get_pw_prompt(void); - -int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, - const unsigned char *salt, const unsigned char *data, - int datal, int count, unsigned char *key, - unsigned char *iv); - -void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags); -void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags); -int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags); - -int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, - const unsigned char *key, const unsigned char *iv); -int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, - ENGINE *impl, const unsigned char *key, - const unsigned char *iv); -int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, - const unsigned char *in, int inl); -int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); -int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); - -int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, - const unsigned char *key, const unsigned char *iv); -int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, - ENGINE *impl, const unsigned char *key, - const unsigned char *iv); -int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, - const unsigned char *in, int inl); -int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); -int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); - -int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, - const unsigned char *key, const unsigned char *iv, - int enc); -int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, - ENGINE *impl, const unsigned char *key, - const unsigned char *iv, int enc); -int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, - const unsigned char *in, int inl); -int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); -int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); - -int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s, - EVP_PKEY *pkey); - -int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, - unsigned int siglen, EVP_PKEY *pkey); - -int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, - const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); -int EVP_DigestSignFinal(EVP_MD_CTX *ctx, - unsigned char *sigret, size_t *siglen); - -int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, - const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); -int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, - const unsigned char *sig, size_t siglen); - -int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, - const unsigned char *ek, int ekl, const unsigned char *iv, - EVP_PKEY *priv); -int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); - -int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, - unsigned char **ek, int *ekl, unsigned char *iv, - EVP_PKEY **pubk, int npubk); -int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); - -void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); -void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, - const unsigned char *in, int inl); -void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); -int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); - -void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); -int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, - const unsigned char *in, int inl); -int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned - char *out, int *outl); -int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); - -void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); -int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); -EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); -void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a); -int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); -int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); -int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); -int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key); - -# ifndef OPENSSL_NO_BIO -BIO_METHOD *BIO_f_md(void); -BIO_METHOD *BIO_f_base64(void); -BIO_METHOD *BIO_f_cipher(void); -BIO_METHOD *BIO_f_reliable(void); -void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, - const unsigned char *i, int enc); -# endif - -const EVP_MD *EVP_md_null(void); -# ifndef OPENSSL_NO_MD2 -const EVP_MD *EVP_md2(void); -# endif -# ifndef OPENSSL_NO_MD4 -const EVP_MD *EVP_md4(void); -# endif -# ifndef OPENSSL_NO_MD5 -const EVP_MD *EVP_md5(void); -# endif -# ifndef OPENSSL_NO_SHA -const EVP_MD *EVP_sha(void); -const EVP_MD *EVP_sha1(void); -const EVP_MD *EVP_dss(void); -const EVP_MD *EVP_dss1(void); -const EVP_MD *EVP_ecdsa(void); -# endif -# ifndef OPENSSL_NO_SHA256 -const EVP_MD *EVP_sha224(void); -const EVP_MD *EVP_sha256(void); -# endif -# ifndef OPENSSL_NO_SHA512 -const EVP_MD *EVP_sha384(void); -const EVP_MD *EVP_sha512(void); -# endif -# ifndef OPENSSL_NO_MDC2 -const EVP_MD *EVP_mdc2(void); -# endif -# ifndef OPENSSL_NO_RIPEMD -const EVP_MD *EVP_ripemd160(void); -# endif -# ifndef OPENSSL_NO_WHIRLPOOL -const EVP_MD *EVP_whirlpool(void); -# endif -const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ -# ifndef OPENSSL_NO_DES -const EVP_CIPHER *EVP_des_ecb(void); -const EVP_CIPHER *EVP_des_ede(void); -const EVP_CIPHER *EVP_des_ede3(void); -const EVP_CIPHER *EVP_des_ede_ecb(void); -const EVP_CIPHER *EVP_des_ede3_ecb(void); -const EVP_CIPHER *EVP_des_cfb64(void); -# define EVP_des_cfb EVP_des_cfb64 -const EVP_CIPHER *EVP_des_cfb1(void); -const EVP_CIPHER *EVP_des_cfb8(void); -const EVP_CIPHER *EVP_des_ede_cfb64(void); -# define EVP_des_ede_cfb EVP_des_ede_cfb64 -# if 0 -const EVP_CIPHER *EVP_des_ede_cfb1(void); -const EVP_CIPHER *EVP_des_ede_cfb8(void); -# endif -const EVP_CIPHER *EVP_des_ede3_cfb64(void); -# define EVP_des_ede3_cfb EVP_des_ede3_cfb64 -const EVP_CIPHER *EVP_des_ede3_cfb1(void); -const EVP_CIPHER *EVP_des_ede3_cfb8(void); -const EVP_CIPHER *EVP_des_ofb(void); -const EVP_CIPHER *EVP_des_ede_ofb(void); -const EVP_CIPHER *EVP_des_ede3_ofb(void); -const EVP_CIPHER *EVP_des_cbc(void); -const EVP_CIPHER *EVP_des_ede_cbc(void); -const EVP_CIPHER *EVP_des_ede3_cbc(void); -const EVP_CIPHER *EVP_desx_cbc(void); -const EVP_CIPHER *EVP_des_ede3_wrap(void); -/* - * This should now be supported through the dev_crypto ENGINE. But also, why - * are rc4 and md5 declarations made here inside a "NO_DES" precompiler - * branch? - */ -# if 0 -# ifdef OPENSSL_OPENBSD_DEV_CRYPTO -const EVP_CIPHER *EVP_dev_crypto_des_ede3_cbc(void); -const EVP_CIPHER *EVP_dev_crypto_rc4(void); -const EVP_MD *EVP_dev_crypto_md5(void); -# endif -# endif -# endif -# ifndef OPENSSL_NO_RC4 -const EVP_CIPHER *EVP_rc4(void); -const EVP_CIPHER *EVP_rc4_40(void); -# ifndef OPENSSL_NO_MD5 -const EVP_CIPHER *EVP_rc4_hmac_md5(void); -# endif -# endif -# ifndef OPENSSL_NO_IDEA -const EVP_CIPHER *EVP_idea_ecb(void); -const EVP_CIPHER *EVP_idea_cfb64(void); -# define EVP_idea_cfb EVP_idea_cfb64 -const EVP_CIPHER *EVP_idea_ofb(void); -const EVP_CIPHER *EVP_idea_cbc(void); -# endif -# ifndef OPENSSL_NO_RC2 -const EVP_CIPHER *EVP_rc2_ecb(void); -const EVP_CIPHER *EVP_rc2_cbc(void); -const EVP_CIPHER *EVP_rc2_40_cbc(void); -const EVP_CIPHER *EVP_rc2_64_cbc(void); -const EVP_CIPHER *EVP_rc2_cfb64(void); -# define EVP_rc2_cfb EVP_rc2_cfb64 -const EVP_CIPHER *EVP_rc2_ofb(void); -# endif -# ifndef OPENSSL_NO_BF -const EVP_CIPHER *EVP_bf_ecb(void); -const EVP_CIPHER *EVP_bf_cbc(void); -const EVP_CIPHER *EVP_bf_cfb64(void); -# define EVP_bf_cfb EVP_bf_cfb64 -const EVP_CIPHER *EVP_bf_ofb(void); -# endif -# ifndef OPENSSL_NO_CAST -const EVP_CIPHER *EVP_cast5_ecb(void); -const EVP_CIPHER *EVP_cast5_cbc(void); -const EVP_CIPHER *EVP_cast5_cfb64(void); -# define EVP_cast5_cfb EVP_cast5_cfb64 -const EVP_CIPHER *EVP_cast5_ofb(void); -# endif -# ifndef OPENSSL_NO_RC5 -const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); -const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); -const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void); -# define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 -const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); -# endif -# ifndef OPENSSL_NO_AES -const EVP_CIPHER *EVP_aes_128_ecb(void); -const EVP_CIPHER *EVP_aes_128_cbc(void); -const EVP_CIPHER *EVP_aes_128_cfb1(void); -const EVP_CIPHER *EVP_aes_128_cfb8(void); -const EVP_CIPHER *EVP_aes_128_cfb128(void); -# define EVP_aes_128_cfb EVP_aes_128_cfb128 -const EVP_CIPHER *EVP_aes_128_ofb(void); -const EVP_CIPHER *EVP_aes_128_ctr(void); -const EVP_CIPHER *EVP_aes_128_ccm(void); -const EVP_CIPHER *EVP_aes_128_gcm(void); -const EVP_CIPHER *EVP_aes_128_xts(void); -const EVP_CIPHER *EVP_aes_128_wrap(void); -const EVP_CIPHER *EVP_aes_192_ecb(void); -const EVP_CIPHER *EVP_aes_192_cbc(void); -const EVP_CIPHER *EVP_aes_192_cfb1(void); -const EVP_CIPHER *EVP_aes_192_cfb8(void); -const EVP_CIPHER *EVP_aes_192_cfb128(void); -# define EVP_aes_192_cfb EVP_aes_192_cfb128 -const EVP_CIPHER *EVP_aes_192_ofb(void); -const EVP_CIPHER *EVP_aes_192_ctr(void); -const EVP_CIPHER *EVP_aes_192_ccm(void); -const EVP_CIPHER *EVP_aes_192_gcm(void); -const EVP_CIPHER *EVP_aes_192_wrap(void); -const EVP_CIPHER *EVP_aes_256_ecb(void); -const EVP_CIPHER *EVP_aes_256_cbc(void); -const EVP_CIPHER *EVP_aes_256_cfb1(void); -const EVP_CIPHER *EVP_aes_256_cfb8(void); -const EVP_CIPHER *EVP_aes_256_cfb128(void); -# define EVP_aes_256_cfb EVP_aes_256_cfb128 -const EVP_CIPHER *EVP_aes_256_ofb(void); -const EVP_CIPHER *EVP_aes_256_ctr(void); -const EVP_CIPHER *EVP_aes_256_ccm(void); -const EVP_CIPHER *EVP_aes_256_gcm(void); -const EVP_CIPHER *EVP_aes_256_xts(void); -const EVP_CIPHER *EVP_aes_256_wrap(void); -# if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) -const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void); -const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void); -# endif -# ifndef OPENSSL_NO_SHA256 -const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha256(void); -const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void); -# endif -# endif -# ifndef OPENSSL_NO_CAMELLIA -const EVP_CIPHER *EVP_camellia_128_ecb(void); -const EVP_CIPHER *EVP_camellia_128_cbc(void); -const EVP_CIPHER *EVP_camellia_128_cfb1(void); -const EVP_CIPHER *EVP_camellia_128_cfb8(void); -const EVP_CIPHER *EVP_camellia_128_cfb128(void); -# define EVP_camellia_128_cfb EVP_camellia_128_cfb128 -const EVP_CIPHER *EVP_camellia_128_ofb(void); -const EVP_CIPHER *EVP_camellia_192_ecb(void); -const EVP_CIPHER *EVP_camellia_192_cbc(void); -const EVP_CIPHER *EVP_camellia_192_cfb1(void); -const EVP_CIPHER *EVP_camellia_192_cfb8(void); -const EVP_CIPHER *EVP_camellia_192_cfb128(void); -# define EVP_camellia_192_cfb EVP_camellia_192_cfb128 -const EVP_CIPHER *EVP_camellia_192_ofb(void); -const EVP_CIPHER *EVP_camellia_256_ecb(void); -const EVP_CIPHER *EVP_camellia_256_cbc(void); -const EVP_CIPHER *EVP_camellia_256_cfb1(void); -const EVP_CIPHER *EVP_camellia_256_cfb8(void); -const EVP_CIPHER *EVP_camellia_256_cfb128(void); -# define EVP_camellia_256_cfb EVP_camellia_256_cfb128 -const EVP_CIPHER *EVP_camellia_256_ofb(void); -# endif - -# ifndef OPENSSL_NO_SEED -const EVP_CIPHER *EVP_seed_ecb(void); -const EVP_CIPHER *EVP_seed_cbc(void); -const EVP_CIPHER *EVP_seed_cfb128(void); -# define EVP_seed_cfb EVP_seed_cfb128 -const EVP_CIPHER *EVP_seed_ofb(void); -# endif - -void OPENSSL_add_all_algorithms_noconf(void); -void OPENSSL_add_all_algorithms_conf(void); - -# ifdef OPENSSL_LOAD_CONF -# define OpenSSL_add_all_algorithms() \ - OPENSSL_add_all_algorithms_conf() -# else -# define OpenSSL_add_all_algorithms() \ - OPENSSL_add_all_algorithms_noconf() -# endif - -void OpenSSL_add_all_ciphers(void); -void OpenSSL_add_all_digests(void); -# define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms() -# define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers() -# define SSLeay_add_all_digests() OpenSSL_add_all_digests() - -int EVP_add_cipher(const EVP_CIPHER *cipher); -int EVP_add_digest(const EVP_MD *digest); - -const EVP_CIPHER *EVP_get_cipherbyname(const char *name); -const EVP_MD *EVP_get_digestbyname(const char *name); -void EVP_cleanup(void); - -void EVP_CIPHER_do_all(void (*fn) (const EVP_CIPHER *ciph, - const char *from, const char *to, void *x), - void *arg); -void EVP_CIPHER_do_all_sorted(void (*fn) - (const EVP_CIPHER *ciph, const char *from, - const char *to, void *x), void *arg); - -void EVP_MD_do_all(void (*fn) (const EVP_MD *ciph, - const char *from, const char *to, void *x), - void *arg); -void EVP_MD_do_all_sorted(void (*fn) - (const EVP_MD *ciph, const char *from, - const char *to, void *x), void *arg); - -int EVP_PKEY_decrypt_old(unsigned char *dec_key, - const unsigned char *enc_key, int enc_key_len, - EVP_PKEY *private_key); -int EVP_PKEY_encrypt_old(unsigned char *enc_key, - const unsigned char *key, int key_len, - EVP_PKEY *pub_key); -int EVP_PKEY_type(int type); -int EVP_PKEY_id(const EVP_PKEY *pkey); -int EVP_PKEY_base_id(const EVP_PKEY *pkey); -int EVP_PKEY_bits(EVP_PKEY *pkey); -int EVP_PKEY_size(EVP_PKEY *pkey); -int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); -int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); -int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); -void *EVP_PKEY_get0(EVP_PKEY *pkey); - -# ifndef OPENSSL_NO_RSA -struct rsa_st; -int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, struct rsa_st *key); -struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); -# endif -# ifndef OPENSSL_NO_DSA -struct dsa_st; -int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, struct dsa_st *key); -struct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); -# endif -# ifndef OPENSSL_NO_DH -struct dh_st; -int EVP_PKEY_set1_DH(EVP_PKEY *pkey, struct dh_st *key); -struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey); -# endif -# ifndef OPENSSL_NO_EC -struct ec_key_st; -int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key); -struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); -# endif - -EVP_PKEY *EVP_PKEY_new(void); -void EVP_PKEY_free(EVP_PKEY *pkey); - -EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, - long length); -int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp); - -EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, - long length); -EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, - long length); -int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp); - -int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from); -int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey); -int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode); -int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b); - -int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b); - -int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, - int indent, ASN1_PCTX *pctx); -int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, - int indent, ASN1_PCTX *pctx); -int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, - int indent, ASN1_PCTX *pctx); - -int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid); - -int EVP_CIPHER_type(const EVP_CIPHER *ctx); - -/* calls methods */ -int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); -int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); - -/* These are used by EVP_CIPHER methods */ -int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); -int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type); - -/* PKCS5 password based encryption */ -int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, - ASN1_TYPE *param, const EVP_CIPHER *cipher, - const EVP_MD *md, int en_de); -int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, - const unsigned char *salt, int saltlen, int iter, - int keylen, unsigned char *out); -int PKCS5_PBKDF2_HMAC(const char *pass, int passlen, - const unsigned char *salt, int saltlen, int iter, - const EVP_MD *digest, int keylen, unsigned char *out); -int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, - ASN1_TYPE *param, const EVP_CIPHER *cipher, - const EVP_MD *md, int en_de); - -void PKCS5_PBE_add(void); - -int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen, - ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de); - -/* PBE type */ - -/* Can appear as the outermost AlgorithmIdentifier */ -# define EVP_PBE_TYPE_OUTER 0x0 -/* Is an PRF type OID */ -# define EVP_PBE_TYPE_PRF 0x1 - -int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, - int md_nid, EVP_PBE_KEYGEN *keygen); -int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, - EVP_PBE_KEYGEN *keygen); -int EVP_PBE_find(int type, int pbe_nid, int *pcnid, int *pmnid, - EVP_PBE_KEYGEN **pkeygen); -void EVP_PBE_cleanup(void); - -# define ASN1_PKEY_ALIAS 0x1 -# define ASN1_PKEY_DYNAMIC 0x2 -# define ASN1_PKEY_SIGPARAM_NULL 0x4 - -# define ASN1_PKEY_CTRL_PKCS7_SIGN 0x1 -# define ASN1_PKEY_CTRL_PKCS7_ENCRYPT 0x2 -# define ASN1_PKEY_CTRL_DEFAULT_MD_NID 0x3 -# define ASN1_PKEY_CTRL_CMS_SIGN 0x5 -# define ASN1_PKEY_CTRL_CMS_ENVELOPE 0x7 -# define ASN1_PKEY_CTRL_CMS_RI_TYPE 0x8 - -int EVP_PKEY_asn1_get_count(void); -const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx); -const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type); -const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe, - const char *str, int len); -int EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth); -int EVP_PKEY_asn1_add_alias(int to, int from); -int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id, - int *ppkey_flags, const char **pinfo, - const char **ppem_str, - const EVP_PKEY_ASN1_METHOD *ameth); - -const EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(EVP_PKEY *pkey); -EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags, - const char *pem_str, - const char *info); -void EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, - const EVP_PKEY_ASN1_METHOD *src); -void EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth); -void EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth, - int (*pub_decode) (EVP_PKEY *pk, - X509_PUBKEY *pub), - int (*pub_encode) (X509_PUBKEY *pub, - const EVP_PKEY *pk), - int (*pub_cmp) (const EVP_PKEY *a, - const EVP_PKEY *b), - int (*pub_print) (BIO *out, - const EVP_PKEY *pkey, - int indent, ASN1_PCTX *pctx), - int (*pkey_size) (const EVP_PKEY *pk), - int (*pkey_bits) (const EVP_PKEY *pk)); -void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, - int (*priv_decode) (EVP_PKEY *pk, - PKCS8_PRIV_KEY_INFO - *p8inf), - int (*priv_encode) (PKCS8_PRIV_KEY_INFO *p8, - const EVP_PKEY *pk), - int (*priv_print) (BIO *out, - const EVP_PKEY *pkey, - int indent, - ASN1_PCTX *pctx)); -void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth, - int (*param_decode) (EVP_PKEY *pkey, - const unsigned char **pder, - int derlen), - int (*param_encode) (const EVP_PKEY *pkey, - unsigned char **pder), - int (*param_missing) (const EVP_PKEY *pk), - int (*param_copy) (EVP_PKEY *to, - const EVP_PKEY *from), - int (*param_cmp) (const EVP_PKEY *a, - const EVP_PKEY *b), - int (*param_print) (BIO *out, - const EVP_PKEY *pkey, - int indent, - ASN1_PCTX *pctx)); - -void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, - void (*pkey_free) (EVP_PKEY *pkey)); -void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, - int (*pkey_ctrl) (EVP_PKEY *pkey, int op, - long arg1, void *arg2)); -void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth, - int (*item_verify) (EVP_MD_CTX *ctx, - const ASN1_ITEM *it, - void *asn, - X509_ALGOR *a, - ASN1_BIT_STRING *sig, - EVP_PKEY *pkey), - int (*item_sign) (EVP_MD_CTX *ctx, - const ASN1_ITEM *it, - void *asn, - X509_ALGOR *alg1, - X509_ALGOR *alg2, - ASN1_BIT_STRING *sig)); - -# define EVP_PKEY_OP_UNDEFINED 0 -# define EVP_PKEY_OP_PARAMGEN (1<<1) -# define EVP_PKEY_OP_KEYGEN (1<<2) -# define EVP_PKEY_OP_SIGN (1<<3) -# define EVP_PKEY_OP_VERIFY (1<<4) -# define EVP_PKEY_OP_VERIFYRECOVER (1<<5) -# define EVP_PKEY_OP_SIGNCTX (1<<6) -# define EVP_PKEY_OP_VERIFYCTX (1<<7) -# define EVP_PKEY_OP_ENCRYPT (1<<8) -# define EVP_PKEY_OP_DECRYPT (1<<9) -# define EVP_PKEY_OP_DERIVE (1<<10) - -# define EVP_PKEY_OP_TYPE_SIG \ - (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER \ - | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX) - -# define EVP_PKEY_OP_TYPE_CRYPT \ - (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT) - -# define EVP_PKEY_OP_TYPE_NOGEN \ - (EVP_PKEY_OP_SIG | EVP_PKEY_OP_CRYPT | EVP_PKEY_OP_DERIVE) - -# define EVP_PKEY_OP_TYPE_GEN \ - (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN) - -# define EVP_PKEY_CTX_set_signature_md(ctx, md) \ - EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \ - EVP_PKEY_CTRL_MD, 0, (void *)md) - -# define EVP_PKEY_CTX_get_signature_md(ctx, pmd) \ - EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \ - EVP_PKEY_CTRL_GET_MD, 0, (void *)pmd) - -# define EVP_PKEY_CTRL_MD 1 -# define EVP_PKEY_CTRL_PEER_KEY 2 - -# define EVP_PKEY_CTRL_PKCS7_ENCRYPT 3 -# define EVP_PKEY_CTRL_PKCS7_DECRYPT 4 - -# define EVP_PKEY_CTRL_PKCS7_SIGN 5 - -# define EVP_PKEY_CTRL_SET_MAC_KEY 6 - -# define EVP_PKEY_CTRL_DIGESTINIT 7 - -/* Used by GOST key encryption in TLS */ -# define EVP_PKEY_CTRL_SET_IV 8 - -# define EVP_PKEY_CTRL_CMS_ENCRYPT 9 -# define EVP_PKEY_CTRL_CMS_DECRYPT 10 -# define EVP_PKEY_CTRL_CMS_SIGN 11 - -# define EVP_PKEY_CTRL_CIPHER 12 - -# define EVP_PKEY_CTRL_GET_MD 13 - -# define EVP_PKEY_ALG_CTRL 0x1000 - -# define EVP_PKEY_FLAG_AUTOARGLEN 2 -/* - * Method handles all operations: don't assume any digest related defaults. - */ -# define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4 - -const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type); -EVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags); -void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags, - const EVP_PKEY_METHOD *meth); -void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src); -void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth); -int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth); - -EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e); -EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e); -EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx); -void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx); - -int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, - int cmd, int p1, void *p2); -int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, - const char *value); - -int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx); -void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen); - -EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, - const unsigned char *key, int keylen); - -void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data); -void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx); -EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx); - -EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx); - -void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data); -void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx); - -int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx); -int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, - unsigned char *sig, size_t *siglen, - const unsigned char *tbs, size_t tbslen); -int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx); -int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, - const unsigned char *sig, size_t siglen, - const unsigned char *tbs, size_t tbslen); -int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx); -int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, - unsigned char *rout, size_t *routlen, - const unsigned char *sig, size_t siglen); -int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx); -int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, - unsigned char *out, size_t *outlen, - const unsigned char *in, size_t inlen); -int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx); -int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, - unsigned char *out, size_t *outlen, - const unsigned char *in, size_t inlen); - -int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx); -int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer); -int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen); - -typedef int EVP_PKEY_gen_cb (EVP_PKEY_CTX *ctx); - -int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx); -int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); -int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx); -int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); - -void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb); -EVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx); - -int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx); - -void EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth, - int (*init) (EVP_PKEY_CTX *ctx)); - -void EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth, - int (*copy) (EVP_PKEY_CTX *dst, - EVP_PKEY_CTX *src)); - -void EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth, - void (*cleanup) (EVP_PKEY_CTX *ctx)); - -void EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth, - int (*paramgen_init) (EVP_PKEY_CTX *ctx), - int (*paramgen) (EVP_PKEY_CTX *ctx, - EVP_PKEY *pkey)); - -void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth, - int (*keygen_init) (EVP_PKEY_CTX *ctx), - int (*keygen) (EVP_PKEY_CTX *ctx, - EVP_PKEY *pkey)); - -void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth, - int (*sign_init) (EVP_PKEY_CTX *ctx), - int (*sign) (EVP_PKEY_CTX *ctx, - unsigned char *sig, size_t *siglen, - const unsigned char *tbs, - size_t tbslen)); - -void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth, - int (*verify_init) (EVP_PKEY_CTX *ctx), - int (*verify) (EVP_PKEY_CTX *ctx, - const unsigned char *sig, - size_t siglen, - const unsigned char *tbs, - size_t tbslen)); - -void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth, - int (*verify_recover_init) (EVP_PKEY_CTX - *ctx), - int (*verify_recover) (EVP_PKEY_CTX - *ctx, - unsigned char - *sig, - size_t *siglen, - const unsigned - char *tbs, - size_t tbslen)); - -void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth, - int (*signctx_init) (EVP_PKEY_CTX *ctx, - EVP_MD_CTX *mctx), - int (*signctx) (EVP_PKEY_CTX *ctx, - unsigned char *sig, - size_t *siglen, - EVP_MD_CTX *mctx)); - -void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth, - int (*verifyctx_init) (EVP_PKEY_CTX *ctx, - EVP_MD_CTX *mctx), - int (*verifyctx) (EVP_PKEY_CTX *ctx, - const unsigned char *sig, - int siglen, - EVP_MD_CTX *mctx)); - -void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth, - int (*encrypt_init) (EVP_PKEY_CTX *ctx), - int (*encryptfn) (EVP_PKEY_CTX *ctx, - unsigned char *out, - size_t *outlen, - const unsigned char *in, - size_t inlen)); - -void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth, - int (*decrypt_init) (EVP_PKEY_CTX *ctx), - int (*decrypt) (EVP_PKEY_CTX *ctx, - unsigned char *out, - size_t *outlen, - const unsigned char *in, - size_t inlen)); - -void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth, - int (*derive_init) (EVP_PKEY_CTX *ctx), - int (*derive) (EVP_PKEY_CTX *ctx, - unsigned char *key, - size_t *keylen)); - -void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, - int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1, - void *p2), - int (*ctrl_str) (EVP_PKEY_CTX *ctx, - const char *type, - const char *value)); - -void EVP_add_alg_module(void); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ - -void ERR_load_EVP_strings(void); - -/* Error codes for the EVP functions. */ - -/* Function codes. */ -# define EVP_F_AESNI_INIT_KEY 165 -# define EVP_F_AESNI_XTS_CIPHER 176 -# define EVP_F_AES_INIT_KEY 133 -# define EVP_F_AES_T4_INIT_KEY 178 -# define EVP_F_AES_XTS 172 -# define EVP_F_AES_XTS_CIPHER 175 -# define EVP_F_ALG_MODULE_INIT 177 -# define EVP_F_CAMELLIA_INIT_KEY 159 -# define EVP_F_CMAC_INIT 173 -# define EVP_F_CMLL_T4_INIT_KEY 179 -# define EVP_F_D2I_PKEY 100 -# define EVP_F_DO_SIGVER_INIT 161 -# define EVP_F_DSAPKEY2PKCS8 134 -# define EVP_F_DSA_PKEY2PKCS8 135 -# define EVP_F_ECDSA_PKEY2PKCS8 129 -# define EVP_F_ECKEY_PKEY2PKCS8 132 -# define EVP_F_EVP_CIPHERINIT_EX 123 -# define EVP_F_EVP_CIPHER_CTX_COPY 163 -# define EVP_F_EVP_CIPHER_CTX_CTRL 124 -# define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 -# define EVP_F_EVP_DECRYPTFINAL_EX 101 -# define EVP_F_EVP_DIGESTINIT_EX 128 -# define EVP_F_EVP_ENCRYPTFINAL_EX 127 -# define EVP_F_EVP_MD_CTX_COPY_EX 110 -# define EVP_F_EVP_MD_SIZE 162 -# define EVP_F_EVP_OPENINIT 102 -# define EVP_F_EVP_PBE_ALG_ADD 115 -# define EVP_F_EVP_PBE_ALG_ADD_TYPE 160 -# define EVP_F_EVP_PBE_CIPHERINIT 116 -# define EVP_F_EVP_PKCS82PKEY 111 -# define EVP_F_EVP_PKCS82PKEY_BROKEN 136 -# define EVP_F_EVP_PKEY2PKCS8_BROKEN 113 -# define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 -# define EVP_F_EVP_PKEY_CTX_CTRL 137 -# define EVP_F_EVP_PKEY_CTX_CTRL_STR 150 -# define EVP_F_EVP_PKEY_CTX_DUP 156 -# define EVP_F_EVP_PKEY_DECRYPT 104 -# define EVP_F_EVP_PKEY_DECRYPT_INIT 138 -# define EVP_F_EVP_PKEY_DECRYPT_OLD 151 -# define EVP_F_EVP_PKEY_DERIVE 153 -# define EVP_F_EVP_PKEY_DERIVE_INIT 154 -# define EVP_F_EVP_PKEY_DERIVE_SET_PEER 155 -# define EVP_F_EVP_PKEY_ENCRYPT 105 -# define EVP_F_EVP_PKEY_ENCRYPT_INIT 139 -# define EVP_F_EVP_PKEY_ENCRYPT_OLD 152 -# define EVP_F_EVP_PKEY_GET1_DH 119 -# define EVP_F_EVP_PKEY_GET1_DSA 120 -# define EVP_F_EVP_PKEY_GET1_ECDSA 130 -# define EVP_F_EVP_PKEY_GET1_EC_KEY 131 -# define EVP_F_EVP_PKEY_GET1_RSA 121 -# define EVP_F_EVP_PKEY_KEYGEN 146 -# define EVP_F_EVP_PKEY_KEYGEN_INIT 147 -# define EVP_F_EVP_PKEY_NEW 106 -# define EVP_F_EVP_PKEY_PARAMGEN 148 -# define EVP_F_EVP_PKEY_PARAMGEN_INIT 149 -# define EVP_F_EVP_PKEY_SIGN 140 -# define EVP_F_EVP_PKEY_SIGN_INIT 141 -# define EVP_F_EVP_PKEY_VERIFY 142 -# define EVP_F_EVP_PKEY_VERIFY_INIT 143 -# define EVP_F_EVP_PKEY_VERIFY_RECOVER 144 -# define EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT 145 -# define EVP_F_EVP_RIJNDAEL 126 -# define EVP_F_EVP_SIGNFINAL 107 -# define EVP_F_EVP_VERIFYFINAL 108 -# define EVP_F_FIPS_CIPHERINIT 166 -# define EVP_F_FIPS_CIPHER_CTX_COPY 170 -# define EVP_F_FIPS_CIPHER_CTX_CTRL 167 -# define EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH 171 -# define EVP_F_FIPS_DIGESTINIT 168 -# define EVP_F_FIPS_MD_CTX_COPY 169 -# define EVP_F_HMAC_INIT_EX 174 -# define EVP_F_INT_CTX_NEW 157 -# define EVP_F_PKCS5_PBE_KEYIVGEN 117 -# define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118 -# define EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN 164 -# define EVP_F_PKCS8_SET_BROKEN 112 -# define EVP_F_PKEY_SET_TYPE 158 -# define EVP_F_RC2_MAGIC_TO_METH 109 -# define EVP_F_RC5_CTRL 125 - -/* Reason codes. */ -# define EVP_R_AES_IV_SETUP_FAILED 162 -# define EVP_R_AES_KEY_SETUP_FAILED 143 -# define EVP_R_ASN1_LIB 140 -# define EVP_R_BAD_BLOCK_LENGTH 136 -# define EVP_R_BAD_DECRYPT 100 -# define EVP_R_BAD_KEY_LENGTH 137 -# define EVP_R_BN_DECODE_ERROR 112 -# define EVP_R_BN_PUBKEY_ERROR 113 -# define EVP_R_BUFFER_TOO_SMALL 155 -# define EVP_R_CAMELLIA_KEY_SETUP_FAILED 157 -# define EVP_R_CIPHER_PARAMETER_ERROR 122 -# define EVP_R_COMMAND_NOT_SUPPORTED 147 -# define EVP_R_CTRL_NOT_IMPLEMENTED 132 -# define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133 -# define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138 -# define EVP_R_DECODE_ERROR 114 -# define EVP_R_DIFFERENT_KEY_TYPES 101 -# define EVP_R_DIFFERENT_PARAMETERS 153 -# define EVP_R_DISABLED_FOR_FIPS 163 -# define EVP_R_ENCODE_ERROR 115 -# define EVP_R_ERROR_LOADING_SECTION 165 -# define EVP_R_ERROR_SETTING_FIPS_MODE 166 -# define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 -# define EVP_R_EXPECTING_AN_RSA_KEY 127 -# define EVP_R_EXPECTING_A_DH_KEY 128 -# define EVP_R_EXPECTING_A_DSA_KEY 129 -# define EVP_R_EXPECTING_A_ECDSA_KEY 141 -# define EVP_R_EXPECTING_A_EC_KEY 142 -# define EVP_R_FIPS_MODE_NOT_SUPPORTED 167 -# define EVP_R_INITIALIZATION_ERROR 134 -# define EVP_R_INPUT_NOT_INITIALIZED 111 -# define EVP_R_INVALID_DIGEST 152 -# define EVP_R_INVALID_FIPS_MODE 168 -# define EVP_R_INVALID_KEY 171 -# define EVP_R_INVALID_KEY_LENGTH 130 -# define EVP_R_INVALID_OPERATION 148 -# define EVP_R_IV_TOO_LARGE 102 -# define EVP_R_KEYGEN_FAILURE 120 -# define EVP_R_MESSAGE_DIGEST_IS_NULL 159 -# define EVP_R_METHOD_NOT_SUPPORTED 144 -# define EVP_R_MISSING_PARAMETERS 103 -# define EVP_R_NO_CIPHER_SET 131 -# define EVP_R_NO_DEFAULT_DIGEST 158 -# define EVP_R_NO_DIGEST_SET 139 -# define EVP_R_NO_DSA_PARAMETERS 116 -# define EVP_R_NO_KEY_SET 154 -# define EVP_R_NO_OPERATION_SET 149 -# define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 -# define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 -# define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150 -# define EVP_R_OPERATON_NOT_INITIALIZED 151 -# define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117 -# define EVP_R_PRIVATE_KEY_DECODE_ERROR 145 -# define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146 -# define EVP_R_PUBLIC_KEY_NOT_RSA 106 -# define EVP_R_TOO_LARGE 164 -# define EVP_R_UNKNOWN_CIPHER 160 -# define EVP_R_UNKNOWN_DIGEST 161 -# define EVP_R_UNKNOWN_OPTION 169 -# define EVP_R_UNKNOWN_PBE_ALGORITHM 121 -# define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135 -# define EVP_R_UNSUPPORTED_ALGORITHM 156 -# define EVP_R_UNSUPPORTED_CIPHER 107 -# define EVP_R_UNSUPPORTED_KEYLENGTH 123 -# define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 -# define EVP_R_UNSUPPORTED_KEY_SIZE 108 -# define EVP_R_UNSUPPORTED_PRF 125 -# define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 -# define EVP_R_UNSUPPORTED_SALT_TYPE 126 -# define EVP_R_WRAP_MODE_NOT_ALLOWED 170 -# define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109 -# define EVP_R_WRONG_PUBLIC_KEY_TYPE 110 - -# ifdef __cplusplus -} -# endif -#endif diff --git a/libs/win32/openssl/include/openssl/hmac.h b/libs/win32/openssl/include/openssl/hmac.h deleted file mode 100644 index b8b55cda7d..0000000000 --- a/libs/win32/openssl/include/openssl/hmac.h +++ /dev/null @@ -1,109 +0,0 @@ -/* crypto/hmac/hmac.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -#ifndef HEADER_HMAC_H -# define HEADER_HMAC_H - -# include - -# ifdef OPENSSL_NO_HMAC -# error HMAC is disabled. -# endif - -# include - -# define HMAC_MAX_MD_CBLOCK 128/* largest known is SHA512 */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct hmac_ctx_st { - const EVP_MD *md; - EVP_MD_CTX md_ctx; - EVP_MD_CTX i_ctx; - EVP_MD_CTX o_ctx; - unsigned int key_length; - unsigned char key[HMAC_MAX_MD_CBLOCK]; -} HMAC_CTX; - -# define HMAC_size(e) (EVP_MD_size((e)->md)) - -void HMAC_CTX_init(HMAC_CTX *ctx); -void HMAC_CTX_cleanup(HMAC_CTX *ctx); - -/* deprecated */ -# define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) - -/* deprecated */ -int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md); -int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, - const EVP_MD *md, ENGINE *impl); -int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); -int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); -unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, - const unsigned char *d, size_t n, unsigned char *md, - unsigned int *md_len); -int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); - -void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/idea.h b/libs/win32/openssl/include/openssl/idea.h deleted file mode 100644 index 6075984039..0000000000 --- a/libs/win32/openssl/include/openssl/idea.h +++ /dev/null @@ -1,105 +0,0 @@ -/* crypto/idea/idea.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_IDEA_H -# define HEADER_IDEA_H - -# include /* IDEA_INT, OPENSSL_NO_IDEA */ - -# ifdef OPENSSL_NO_IDEA -# error IDEA is disabled. -# endif - -# define IDEA_ENCRYPT 1 -# define IDEA_DECRYPT 0 - -# define IDEA_BLOCK 8 -# define IDEA_KEY_LENGTH 16 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct idea_key_st { - IDEA_INT data[9][6]; -} IDEA_KEY_SCHEDULE; - -const char *idea_options(void); -void idea_ecb_encrypt(const unsigned char *in, unsigned char *out, - IDEA_KEY_SCHEDULE *ks); -# ifdef OPENSSL_FIPS -void private_idea_set_encrypt_key(const unsigned char *key, - IDEA_KEY_SCHEDULE *ks); -# endif -void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); -void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); -void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, - long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, - int enc); -void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, - int *num, int enc); -void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, - int *num); -void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/krb5_asn.h b/libs/win32/openssl/include/openssl/krb5_asn.h deleted file mode 100644 index 9cf5a26dd8..0000000000 --- a/libs/win32/openssl/include/openssl/krb5_asn.h +++ /dev/null @@ -1,240 +0,0 @@ -/* krb5_asn.h */ -/* - * Written by Vern Staats for the OpenSSL project, ** - * using ocsp/{*.h,*asn*.c} as a starting point - */ - -/* ==================================================================== - * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_KRB5_ASN_H -# define HEADER_KRB5_ASN_H - -/* - * #include - */ -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * ASN.1 from Kerberos RFC 1510 - */ - -/*- EncryptedData ::= SEQUENCE { - * etype[0] INTEGER, -- EncryptionType - * kvno[1] INTEGER OPTIONAL, - * cipher[2] OCTET STRING -- ciphertext - * } - */ -typedef struct krb5_encdata_st { - ASN1_INTEGER *etype; - ASN1_INTEGER *kvno; - ASN1_OCTET_STRING *cipher; -} KRB5_ENCDATA; - -DECLARE_STACK_OF(KRB5_ENCDATA) - -/*- PrincipalName ::= SEQUENCE { - * name-type[0] INTEGER, - * name-string[1] SEQUENCE OF GeneralString - * } - */ -typedef struct krb5_princname_st { - ASN1_INTEGER *nametype; - STACK_OF(ASN1_GENERALSTRING) *namestring; -} KRB5_PRINCNAME; - -DECLARE_STACK_OF(KRB5_PRINCNAME) - -/*- Ticket ::= [APPLICATION 1] SEQUENCE { - * tkt-vno[0] INTEGER, - * realm[1] Realm, - * sname[2] PrincipalName, - * enc-part[3] EncryptedData - * } - */ -typedef struct krb5_tktbody_st { - ASN1_INTEGER *tktvno; - ASN1_GENERALSTRING *realm; - KRB5_PRINCNAME *sname; - KRB5_ENCDATA *encdata; -} KRB5_TKTBODY; - -typedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET; -DECLARE_STACK_OF(KRB5_TKTBODY) - -/*- AP-REQ ::= [APPLICATION 14] SEQUENCE { - * pvno[0] INTEGER, - * msg-type[1] INTEGER, - * ap-options[2] APOptions, - * ticket[3] Ticket, - * authenticator[4] EncryptedData - * } - * - * APOptions ::= BIT STRING { - * reserved(0), use-session-key(1), mutual-required(2) } - */ -typedef struct krb5_ap_req_st { - ASN1_INTEGER *pvno; - ASN1_INTEGER *msgtype; - ASN1_BIT_STRING *apoptions; - KRB5_TICKET *ticket; - KRB5_ENCDATA *authenticator; -} KRB5_APREQBODY; - -typedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ; -DECLARE_STACK_OF(KRB5_APREQBODY) - -/* Authenticator Stuff */ - -/*- Checksum ::= SEQUENCE { - * cksumtype[0] INTEGER, - * checksum[1] OCTET STRING - * } - */ -typedef struct krb5_checksum_st { - ASN1_INTEGER *ctype; - ASN1_OCTET_STRING *checksum; -} KRB5_CHECKSUM; - -DECLARE_STACK_OF(KRB5_CHECKSUM) - -/*- EncryptionKey ::= SEQUENCE { - * keytype[0] INTEGER, - * keyvalue[1] OCTET STRING - * } - */ -typedef struct krb5_encryptionkey_st { - ASN1_INTEGER *ktype; - ASN1_OCTET_STRING *keyvalue; -} KRB5_ENCKEY; - -DECLARE_STACK_OF(KRB5_ENCKEY) - -/*- AuthorizationData ::= SEQUENCE OF SEQUENCE { - * ad-type[0] INTEGER, - * ad-data[1] OCTET STRING - * } - */ -typedef struct krb5_authorization_st { - ASN1_INTEGER *adtype; - ASN1_OCTET_STRING *addata; -} KRB5_AUTHDATA; - -DECLARE_STACK_OF(KRB5_AUTHDATA) - -/*- -- Unencrypted authenticator - * Authenticator ::= [APPLICATION 2] SEQUENCE { - * authenticator-vno[0] INTEGER, - * crealm[1] Realm, - * cname[2] PrincipalName, - * cksum[3] Checksum OPTIONAL, - * cusec[4] INTEGER, - * ctime[5] KerberosTime, - * subkey[6] EncryptionKey OPTIONAL, - * seq-number[7] INTEGER OPTIONAL, - * authorization-data[8] AuthorizationData OPTIONAL - * } - */ -typedef struct krb5_authenticator_st { - ASN1_INTEGER *avno; - ASN1_GENERALSTRING *crealm; - KRB5_PRINCNAME *cname; - KRB5_CHECKSUM *cksum; - ASN1_INTEGER *cusec; - ASN1_GENERALIZEDTIME *ctime; - KRB5_ENCKEY *subkey; - ASN1_INTEGER *seqnum; - KRB5_AUTHDATA *authorization; -} KRB5_AUTHENTBODY; - -typedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT; -DECLARE_STACK_OF(KRB5_AUTHENTBODY) - -/*- DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) = - * type *name##_new(void); - * void name##_free(type *a); - * DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) = - * DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) = - * type *d2i_##name(type **a, const unsigned char **in, long len); - * int i2d_##name(type *a, unsigned char **out); - * DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it - */ - -DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA) -DECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME) -DECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY) -DECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY) -DECLARE_ASN1_FUNCTIONS(KRB5_TICKET) -DECLARE_ASN1_FUNCTIONS(KRB5_APREQ) - -DECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM) -DECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY) -DECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA) -DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY) -DECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT) - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/kssl.h b/libs/win32/openssl/include/openssl/kssl.h deleted file mode 100644 index ae8a51f472..0000000000 --- a/libs/win32/openssl/include/openssl/kssl.h +++ /dev/null @@ -1,197 +0,0 @@ -/* ssl/kssl.h */ -/* - * Written by Vern Staats for the OpenSSL project - * 2000. project 2000. - */ -/* ==================================================================== - * Copyright (c) 2000 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -/* - ** 19990701 VRS Started. - */ - -#ifndef KSSL_H -# define KSSL_H - -# include - -# ifndef OPENSSL_NO_KRB5 - -# include -# include -# include -# ifdef OPENSSL_SYS_WIN32 -/* - * These can sometimes get redefined indirectly by krb5 header files after - * they get undefed in ossl_typ.h - */ -# undef X509_NAME -# undef X509_EXTENSIONS -# undef OCSP_REQUEST -# undef OCSP_RESPONSE -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Depending on which KRB5 implementation used, some types from - * the other may be missing. Resolve that here and now - */ -# ifdef KRB5_HEIMDAL -typedef unsigned char krb5_octet; -# define FAR -# else - -# ifndef FAR -# define FAR -# endif - -# endif - -/*- - * Uncomment this to debug kssl problems or - * to trace usage of the Kerberos session key - * - * #define KSSL_DEBUG - */ - -# ifndef KRB5SVC -# define KRB5SVC "host" -# endif - -# ifndef KRB5KEYTAB -# define KRB5KEYTAB "/etc/krb5.keytab" -# endif - -# ifndef KRB5SENDAUTH -# define KRB5SENDAUTH 1 -# endif - -# ifndef KRB5CHECKAUTH -# define KRB5CHECKAUTH 1 -# endif - -# ifndef KSSL_CLOCKSKEW -# define KSSL_CLOCKSKEW 300; -# endif - -# define KSSL_ERR_MAX 255 -typedef struct kssl_err_st { - int reason; - char text[KSSL_ERR_MAX + 1]; -} KSSL_ERR; - -/*- Context for passing - * (1) Kerberos session key to SSL, and - * (2) Config data between application and SSL lib - */ -typedef struct kssl_ctx_st { - /* used by: disposition: */ - char *service_name; /* C,S default ok (kssl) */ - char *service_host; /* C input, REQUIRED */ - char *client_princ; /* S output from krb5 ticket */ - char *keytab_file; /* S NULL (/etc/krb5.keytab) */ - char *cred_cache; /* C NULL (default) */ - krb5_enctype enctype; - int length; - krb5_octet FAR *key; -} KSSL_CTX; - -# define KSSL_CLIENT 1 -# define KSSL_SERVER 2 -# define KSSL_SERVICE 3 -# define KSSL_KEYTAB 4 - -# define KSSL_CTX_OK 0 -# define KSSL_CTX_ERR 1 -# define KSSL_NOMEM 2 - -/* Public (for use by applications that use OpenSSL with Kerberos 5 support */ -krb5_error_code kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text); -KSSL_CTX *kssl_ctx_new(void); -KSSL_CTX *kssl_ctx_free(KSSL_CTX *kssl_ctx); -void kssl_ctx_show(KSSL_CTX *kssl_ctx); -krb5_error_code kssl_ctx_setprinc(KSSL_CTX *kssl_ctx, int which, - krb5_data *realm, krb5_data *entity, - int nentities); -krb5_error_code kssl_cget_tkt(KSSL_CTX *kssl_ctx, krb5_data **enc_tktp, - krb5_data *authenp, KSSL_ERR *kssl_err); -krb5_error_code kssl_sget_tkt(KSSL_CTX *kssl_ctx, krb5_data *indata, - krb5_ticket_times *ttimes, KSSL_ERR *kssl_err); -krb5_error_code kssl_ctx_setkey(KSSL_CTX *kssl_ctx, krb5_keyblock *session); -void kssl_err_set(KSSL_ERR *kssl_err, int reason, char *text); -void kssl_krb5_free_data_contents(krb5_context context, krb5_data *data); -krb5_error_code kssl_build_principal_2(krb5_context context, - krb5_principal *princ, int rlen, - const char *realm, int slen, - const char *svc, int hlen, - const char *host); -krb5_error_code kssl_validate_times(krb5_timestamp atime, - krb5_ticket_times *ttimes); -krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp, - krb5_timestamp *atimep, - KSSL_ERR *kssl_err); -unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn); - -void SSL_set0_kssl_ctx(SSL *s, KSSL_CTX *kctx); -KSSL_CTX *SSL_get0_kssl_ctx(SSL *s); -char *kssl_ctx_get0_client_princ(KSSL_CTX *kctx); - -#ifdef __cplusplus -} -#endif -# endif /* OPENSSL_NO_KRB5 */ -#endif /* KSSL_H */ diff --git a/libs/win32/openssl/include/openssl/lhash.h b/libs/win32/openssl/include/openssl/lhash.h deleted file mode 100644 index b6c328bffb..0000000000 --- a/libs/win32/openssl/include/openssl/lhash.h +++ /dev/null @@ -1,240 +0,0 @@ -/* crypto/lhash/lhash.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -/* - * Header for dynamic hash table routines Author - Eric Young - */ - -#ifndef HEADER_LHASH_H -# define HEADER_LHASH_H - -# include -# ifndef OPENSSL_NO_FP_API -# include -# endif - -# ifndef OPENSSL_NO_BIO -# include -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct lhash_node_st { - void *data; - struct lhash_node_st *next; -# ifndef OPENSSL_NO_HASH_COMP - unsigned long hash; -# endif -} LHASH_NODE; - -typedef int (*LHASH_COMP_FN_TYPE) (const void *, const void *); -typedef unsigned long (*LHASH_HASH_FN_TYPE) (const void *); -typedef void (*LHASH_DOALL_FN_TYPE) (void *); -typedef void (*LHASH_DOALL_ARG_FN_TYPE) (void *, void *); - -/* - * Macros for declaring and implementing type-safe wrappers for LHASH - * callbacks. This way, callbacks can be provided to LHASH structures without - * function pointer casting and the macro-defined callbacks provide - * per-variable casting before deferring to the underlying type-specific - * callbacks. NB: It is possible to place a "static" in front of both the - * DECLARE and IMPLEMENT macros if the functions are strictly internal. - */ - -/* First: "hash" functions */ -# define DECLARE_LHASH_HASH_FN(name, o_type) \ - unsigned long name##_LHASH_HASH(const void *); -# define IMPLEMENT_LHASH_HASH_FN(name, o_type) \ - unsigned long name##_LHASH_HASH(const void *arg) { \ - const o_type *a = arg; \ - return name##_hash(a); } -# define LHASH_HASH_FN(name) name##_LHASH_HASH - -/* Second: "compare" functions */ -# define DECLARE_LHASH_COMP_FN(name, o_type) \ - int name##_LHASH_COMP(const void *, const void *); -# define IMPLEMENT_LHASH_COMP_FN(name, o_type) \ - int name##_LHASH_COMP(const void *arg1, const void *arg2) { \ - const o_type *a = arg1; \ - const o_type *b = arg2; \ - return name##_cmp(a,b); } -# define LHASH_COMP_FN(name) name##_LHASH_COMP - -/* Third: "doall" functions */ -# define DECLARE_LHASH_DOALL_FN(name, o_type) \ - void name##_LHASH_DOALL(void *); -# define IMPLEMENT_LHASH_DOALL_FN(name, o_type) \ - void name##_LHASH_DOALL(void *arg) { \ - o_type *a = arg; \ - name##_doall(a); } -# define LHASH_DOALL_FN(name) name##_LHASH_DOALL - -/* Fourth: "doall_arg" functions */ -# define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \ - void name##_LHASH_DOALL_ARG(void *, void *); -# define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \ - void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \ - o_type *a = arg1; \ - a_type *b = arg2; \ - name##_doall_arg(a, b); } -# define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG - -typedef struct lhash_st { - LHASH_NODE **b; - LHASH_COMP_FN_TYPE comp; - LHASH_HASH_FN_TYPE hash; - unsigned int num_nodes; - unsigned int num_alloc_nodes; - unsigned int p; - unsigned int pmax; - unsigned long up_load; /* load times 256 */ - unsigned long down_load; /* load times 256 */ - unsigned long num_items; - unsigned long num_expands; - unsigned long num_expand_reallocs; - unsigned long num_contracts; - unsigned long num_contract_reallocs; - unsigned long num_hash_calls; - unsigned long num_comp_calls; - unsigned long num_insert; - unsigned long num_replace; - unsigned long num_delete; - unsigned long num_no_delete; - unsigned long num_retrieve; - unsigned long num_retrieve_miss; - unsigned long num_hash_comps; - int error; -} _LHASH; /* Do not use _LHASH directly, use LHASH_OF - * and friends */ - -# define LH_LOAD_MULT 256 - -/* - * Indicates a malloc() error in the last call, this is only bad in - * lh_insert(). - */ -# define lh_error(lh) ((lh)->error) - -_LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c); -void lh_free(_LHASH *lh); -void *lh_insert(_LHASH *lh, void *data); -void *lh_delete(_LHASH *lh, const void *data); -void *lh_retrieve(_LHASH *lh, const void *data); -void lh_doall(_LHASH *lh, LHASH_DOALL_FN_TYPE func); -void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg); -unsigned long lh_strhash(const char *c); -unsigned long lh_num_items(const _LHASH *lh); - -# ifndef OPENSSL_NO_FP_API -void lh_stats(const _LHASH *lh, FILE *out); -void lh_node_stats(const _LHASH *lh, FILE *out); -void lh_node_usage_stats(const _LHASH *lh, FILE *out); -# endif - -# ifndef OPENSSL_NO_BIO -void lh_stats_bio(const _LHASH *lh, BIO *out); -void lh_node_stats_bio(const _LHASH *lh, BIO *out); -void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out); -# endif - -/* Type checking... */ - -# define LHASH_OF(type) struct lhash_st_##type - -# define DECLARE_LHASH_OF(type) LHASH_OF(type) { int dummy; } - -# define CHECKED_LHASH_OF(type,lh) \ - ((_LHASH *)CHECKED_PTR_OF(LHASH_OF(type),lh)) - -/* Define wrapper functions. */ -# define LHM_lh_new(type, name) \ - ((LHASH_OF(type) *)lh_new(LHASH_HASH_FN(name), LHASH_COMP_FN(name))) -# define LHM_lh_error(type, lh) \ - lh_error(CHECKED_LHASH_OF(type,lh)) -# define LHM_lh_insert(type, lh, inst) \ - ((type *)lh_insert(CHECKED_LHASH_OF(type, lh), \ - CHECKED_PTR_OF(type, inst))) -# define LHM_lh_retrieve(type, lh, inst) \ - ((type *)lh_retrieve(CHECKED_LHASH_OF(type, lh), \ - CHECKED_PTR_OF(type, inst))) -# define LHM_lh_delete(type, lh, inst) \ - ((type *)lh_delete(CHECKED_LHASH_OF(type, lh), \ - CHECKED_PTR_OF(type, inst))) -# define LHM_lh_doall(type, lh,fn) lh_doall(CHECKED_LHASH_OF(type, lh), fn) -# define LHM_lh_doall_arg(type, lh, fn, arg_type, arg) \ - lh_doall_arg(CHECKED_LHASH_OF(type, lh), fn, CHECKED_PTR_OF(arg_type, arg)) -# define LHM_lh_num_items(type, lh) lh_num_items(CHECKED_LHASH_OF(type, lh)) -# define LHM_lh_down_load(type, lh) (CHECKED_LHASH_OF(type, lh)->down_load) -# define LHM_lh_node_stats_bio(type, lh, out) \ - lh_node_stats_bio(CHECKED_LHASH_OF(type, lh), out) -# define LHM_lh_node_usage_stats_bio(type, lh, out) \ - lh_node_usage_stats_bio(CHECKED_LHASH_OF(type, lh), out) -# define LHM_lh_stats_bio(type, lh, out) \ - lh_stats_bio(CHECKED_LHASH_OF(type, lh), out) -# define LHM_lh_free(type, lh) lh_free(CHECKED_LHASH_OF(type, lh)) - -DECLARE_LHASH_OF(OPENSSL_STRING); -DECLARE_LHASH_OF(OPENSSL_CSTRING); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/md4.h b/libs/win32/openssl/include/openssl/md4.h deleted file mode 100644 index 11fd71295b..0000000000 --- a/libs/win32/openssl/include/openssl/md4.h +++ /dev/null @@ -1,119 +0,0 @@ -/* crypto/md4/md4.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_MD4_H -# define HEADER_MD4_H - -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# ifdef OPENSSL_NO_MD4 -# error MD4 is disabled. -# endif - -/*- - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! MD4_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -# if defined(__LP32__) -# define MD4_LONG unsigned long -# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -# define MD4_LONG unsigned long -# define MD4_LONG_LOG2 3 -/* - * _CRAY note. I could declare short, but I have no idea what impact - * does it have on performance on none-T3E machines. I could declare - * int, but at least on C90 sizeof(int) can be chosen at compile time. - * So I've chosen long... - * - */ -# else -# define MD4_LONG unsigned int -# endif - -# define MD4_CBLOCK 64 -# define MD4_LBLOCK (MD4_CBLOCK/4) -# define MD4_DIGEST_LENGTH 16 - -typedef struct MD4state_st { - MD4_LONG A, B, C, D; - MD4_LONG Nl, Nh; - MD4_LONG data[MD4_LBLOCK]; - unsigned int num; -} MD4_CTX; - -# ifdef OPENSSL_FIPS -int private_MD4_Init(MD4_CTX *c); -# endif -int MD4_Init(MD4_CTX *c); -int MD4_Update(MD4_CTX *c, const void *data, size_t len); -int MD4_Final(unsigned char *md, MD4_CTX *c); -unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); -void MD4_Transform(MD4_CTX *c, const unsigned char *b); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/md5.h b/libs/win32/openssl/include/openssl/md5.h deleted file mode 100644 index 2659038abd..0000000000 --- a/libs/win32/openssl/include/openssl/md5.h +++ /dev/null @@ -1,119 +0,0 @@ -/* crypto/md5/md5.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_MD5_H -# define HEADER_MD5_H - -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# ifdef OPENSSL_NO_MD5 -# error MD5 is disabled. -# endif - -/* - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! MD5_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -# if defined(__LP32__) -# define MD5_LONG unsigned long -# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -# define MD5_LONG unsigned long -# define MD5_LONG_LOG2 3 -/* - * _CRAY note. I could declare short, but I have no idea what impact - * does it have on performance on none-T3E machines. I could declare - * int, but at least on C90 sizeof(int) can be chosen at compile time. - * So I've chosen long... - * - */ -# else -# define MD5_LONG unsigned int -# endif - -# define MD5_CBLOCK 64 -# define MD5_LBLOCK (MD5_CBLOCK/4) -# define MD5_DIGEST_LENGTH 16 - -typedef struct MD5state_st { - MD5_LONG A, B, C, D; - MD5_LONG Nl, Nh; - MD5_LONG data[MD5_LBLOCK]; - unsigned int num; -} MD5_CTX; - -# ifdef OPENSSL_FIPS -int private_MD5_Init(MD5_CTX *c); -# endif -int MD5_Init(MD5_CTX *c); -int MD5_Update(MD5_CTX *c, const void *data, size_t len); -int MD5_Final(unsigned char *md, MD5_CTX *c); -unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); -void MD5_Transform(MD5_CTX *c, const unsigned char *b); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/mdc2.h b/libs/win32/openssl/include/openssl/mdc2.h deleted file mode 100644 index 7efe53bc29..0000000000 --- a/libs/win32/openssl/include/openssl/mdc2.h +++ /dev/null @@ -1,94 +0,0 @@ -/* crypto/mdc2/mdc2.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_MDC2_H -# define HEADER_MDC2_H - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# ifdef OPENSSL_NO_MDC2 -# error MDC2 is disabled. -# endif - -# define MDC2_BLOCK 8 -# define MDC2_DIGEST_LENGTH 16 - -typedef struct mdc2_ctx_st { - unsigned int num; - unsigned char data[MDC2_BLOCK]; - DES_cblock h, hh; - int pad_type; /* either 1 or 2, default 1 */ -} MDC2_CTX; - -# ifdef OPENSSL_FIPS -int private_MDC2_Init(MDC2_CTX *c); -# endif -int MDC2_Init(MDC2_CTX *c); -int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); -int MDC2_Final(unsigned char *md, MDC2_CTX *c); -unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/modes.h b/libs/win32/openssl/include/openssl/modes.h deleted file mode 100644 index fd488499a0..0000000000 --- a/libs/win32/openssl/include/openssl/modes.h +++ /dev/null @@ -1,163 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. - * - * Rights for redistribution and usage in source and binary - * forms are granted according to the OpenSSL license. - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif -typedef void (*block128_f) (const unsigned char in[16], - unsigned char out[16], const void *key); - -typedef void (*cbc128_f) (const unsigned char *in, unsigned char *out, - size_t len, const void *key, - unsigned char ivec[16], int enc); - -typedef void (*ctr128_f) (const unsigned char *in, unsigned char *out, - size_t blocks, const void *key, - const unsigned char ivec[16]); - -typedef void (*ccm128_f) (const unsigned char *in, unsigned char *out, - size_t blocks, const void *key, - const unsigned char ivec[16], - unsigned char cmac[16]); - -void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out, - size_t len, const void *key, - unsigned char ivec[16], block128_f block); -void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out, - size_t len, const void *key, - unsigned char ivec[16], block128_f block); - -void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out, - size_t len, const void *key, - unsigned char ivec[16], - unsigned char ecount_buf[16], unsigned int *num, - block128_f block); - -void CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out, - size_t len, const void *key, - unsigned char ivec[16], - unsigned char ecount_buf[16], - unsigned int *num, ctr128_f ctr); - -void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out, - size_t len, const void *key, - unsigned char ivec[16], int *num, - block128_f block); - -void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out, - size_t len, const void *key, - unsigned char ivec[16], int *num, - int enc, block128_f block); -void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const void *key, - unsigned char ivec[16], int *num, - int enc, block128_f block); -void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out, - size_t bits, const void *key, - unsigned char ivec[16], int *num, - int enc, block128_f block); - -size_t CRYPTO_cts128_encrypt_block(const unsigned char *in, - unsigned char *out, size_t len, - const void *key, unsigned char ivec[16], - block128_f block); -size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out, - size_t len, const void *key, - unsigned char ivec[16], cbc128_f cbc); -size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, - unsigned char *out, size_t len, - const void *key, unsigned char ivec[16], - block128_f block); -size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out, - size_t len, const void *key, - unsigned char ivec[16], cbc128_f cbc); - -size_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in, - unsigned char *out, size_t len, - const void *key, - unsigned char ivec[16], - block128_f block); -size_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out, - size_t len, const void *key, - unsigned char ivec[16], cbc128_f cbc); -size_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in, - unsigned char *out, size_t len, - const void *key, - unsigned char ivec[16], - block128_f block); -size_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out, - size_t len, const void *key, - unsigned char ivec[16], cbc128_f cbc); - -typedef struct gcm128_context GCM128_CONTEXT; - -GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block); -void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block); -void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv, - size_t len); -int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad, - size_t len); -int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, - const unsigned char *in, unsigned char *out, - size_t len); -int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, - const unsigned char *in, unsigned char *out, - size_t len); -int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, - const unsigned char *in, unsigned char *out, - size_t len, ctr128_f stream); -int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, - const unsigned char *in, unsigned char *out, - size_t len, ctr128_f stream); -int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag, - size_t len); -void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len); -void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx); - -typedef struct ccm128_context CCM128_CONTEXT; - -void CRYPTO_ccm128_init(CCM128_CONTEXT *ctx, - unsigned int M, unsigned int L, void *key, - block128_f block); -int CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce, - size_t nlen, size_t mlen); -void CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, const unsigned char *aad, - size_t alen); -int CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, const unsigned char *inp, - unsigned char *out, size_t len); -int CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, const unsigned char *inp, - unsigned char *out, size_t len); -int CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp, - unsigned char *out, size_t len, - ccm128_f stream); -int CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp, - unsigned char *out, size_t len, - ccm128_f stream); -size_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len); - -typedef struct xts128_context XTS128_CONTEXT; - -int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx, - const unsigned char iv[16], - const unsigned char *inp, unsigned char *out, - size_t len, int enc); - -size_t CRYPTO_128_wrap(void *key, const unsigned char *iv, - unsigned char *out, - const unsigned char *in, size_t inlen, - block128_f block); - -size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv, - unsigned char *out, - const unsigned char *in, size_t inlen, - block128_f block); - -#ifdef __cplusplus -} -#endif diff --git a/libs/win32/openssl/include/openssl/obj_mac.h b/libs/win32/openssl/include/openssl/obj_mac.h deleted file mode 100644 index 779c309b86..0000000000 --- a/libs/win32/openssl/include/openssl/obj_mac.h +++ /dev/null @@ -1,4194 +0,0 @@ -/* crypto/objects/obj_mac.h */ - -/* - * THIS FILE IS GENERATED FROM objects.txt by objects.pl via the following - * command: perl objects.pl objects.txt obj_mac.num obj_mac.h - */ - -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#define SN_undef "UNDEF" -#define LN_undef "undefined" -#define NID_undef 0 -#define OBJ_undef 0L - -#define SN_itu_t "ITU-T" -#define LN_itu_t "itu-t" -#define NID_itu_t 645 -#define OBJ_itu_t 0L - -#define NID_ccitt 404 -#define OBJ_ccitt OBJ_itu_t - -#define SN_iso "ISO" -#define LN_iso "iso" -#define NID_iso 181 -#define OBJ_iso 1L - -#define SN_joint_iso_itu_t "JOINT-ISO-ITU-T" -#define LN_joint_iso_itu_t "joint-iso-itu-t" -#define NID_joint_iso_itu_t 646 -#define OBJ_joint_iso_itu_t 2L - -#define NID_joint_iso_ccitt 393 -#define OBJ_joint_iso_ccitt OBJ_joint_iso_itu_t - -#define SN_member_body "member-body" -#define LN_member_body "ISO Member Body" -#define NID_member_body 182 -#define OBJ_member_body OBJ_iso,2L - -#define SN_identified_organization "identified-organization" -#define NID_identified_organization 676 -#define OBJ_identified_organization OBJ_iso,3L - -#define SN_hmac_md5 "HMAC-MD5" -#define LN_hmac_md5 "hmac-md5" -#define NID_hmac_md5 780 -#define OBJ_hmac_md5 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,1L - -#define SN_hmac_sha1 "HMAC-SHA1" -#define LN_hmac_sha1 "hmac-sha1" -#define NID_hmac_sha1 781 -#define OBJ_hmac_sha1 OBJ_identified_organization,6L,1L,5L,5L,8L,1L,2L - -#define SN_certicom_arc "certicom-arc" -#define NID_certicom_arc 677 -#define OBJ_certicom_arc OBJ_identified_organization,132L - -#define SN_international_organizations "international-organizations" -#define LN_international_organizations "International Organizations" -#define NID_international_organizations 647 -#define OBJ_international_organizations OBJ_joint_iso_itu_t,23L - -#define SN_wap "wap" -#define NID_wap 678 -#define OBJ_wap OBJ_international_organizations,43L - -#define SN_wap_wsg "wap-wsg" -#define NID_wap_wsg 679 -#define OBJ_wap_wsg OBJ_wap,1L - -#define SN_selected_attribute_types "selected-attribute-types" -#define LN_selected_attribute_types "Selected Attribute Types" -#define NID_selected_attribute_types 394 -#define OBJ_selected_attribute_types OBJ_joint_iso_itu_t,5L,1L,5L - -#define SN_clearance "clearance" -#define NID_clearance 395 -#define OBJ_clearance OBJ_selected_attribute_types,55L - -#define SN_ISO_US "ISO-US" -#define LN_ISO_US "ISO US Member Body" -#define NID_ISO_US 183 -#define OBJ_ISO_US OBJ_member_body,840L - -#define SN_X9_57 "X9-57" -#define LN_X9_57 "X9.57" -#define NID_X9_57 184 -#define OBJ_X9_57 OBJ_ISO_US,10040L - -#define SN_X9cm "X9cm" -#define LN_X9cm "X9.57 CM ?" -#define NID_X9cm 185 -#define OBJ_X9cm OBJ_X9_57,4L - -#define SN_dsa "DSA" -#define LN_dsa "dsaEncryption" -#define NID_dsa 116 -#define OBJ_dsa OBJ_X9cm,1L - -#define SN_dsaWithSHA1 "DSA-SHA1" -#define LN_dsaWithSHA1 "dsaWithSHA1" -#define NID_dsaWithSHA1 113 -#define OBJ_dsaWithSHA1 OBJ_X9cm,3L - -#define SN_ansi_X9_62 "ansi-X9-62" -#define LN_ansi_X9_62 "ANSI X9.62" -#define NID_ansi_X9_62 405 -#define OBJ_ansi_X9_62 OBJ_ISO_US,10045L - -#define OBJ_X9_62_id_fieldType OBJ_ansi_X9_62,1L - -#define SN_X9_62_prime_field "prime-field" -#define NID_X9_62_prime_field 406 -#define OBJ_X9_62_prime_field OBJ_X9_62_id_fieldType,1L - -#define SN_X9_62_characteristic_two_field "characteristic-two-field" -#define NID_X9_62_characteristic_two_field 407 -#define OBJ_X9_62_characteristic_two_field OBJ_X9_62_id_fieldType,2L - -#define SN_X9_62_id_characteristic_two_basis "id-characteristic-two-basis" -#define NID_X9_62_id_characteristic_two_basis 680 -#define OBJ_X9_62_id_characteristic_two_basis OBJ_X9_62_characteristic_two_field,3L - -#define SN_X9_62_onBasis "onBasis" -#define NID_X9_62_onBasis 681 -#define OBJ_X9_62_onBasis OBJ_X9_62_id_characteristic_two_basis,1L - -#define SN_X9_62_tpBasis "tpBasis" -#define NID_X9_62_tpBasis 682 -#define OBJ_X9_62_tpBasis OBJ_X9_62_id_characteristic_two_basis,2L - -#define SN_X9_62_ppBasis "ppBasis" -#define NID_X9_62_ppBasis 683 -#define OBJ_X9_62_ppBasis OBJ_X9_62_id_characteristic_two_basis,3L - -#define OBJ_X9_62_id_publicKeyType OBJ_ansi_X9_62,2L - -#define SN_X9_62_id_ecPublicKey "id-ecPublicKey" -#define NID_X9_62_id_ecPublicKey 408 -#define OBJ_X9_62_id_ecPublicKey OBJ_X9_62_id_publicKeyType,1L - -#define OBJ_X9_62_ellipticCurve OBJ_ansi_X9_62,3L - -#define OBJ_X9_62_c_TwoCurve OBJ_X9_62_ellipticCurve,0L - -#define SN_X9_62_c2pnb163v1 "c2pnb163v1" -#define NID_X9_62_c2pnb163v1 684 -#define OBJ_X9_62_c2pnb163v1 OBJ_X9_62_c_TwoCurve,1L - -#define SN_X9_62_c2pnb163v2 "c2pnb163v2" -#define NID_X9_62_c2pnb163v2 685 -#define OBJ_X9_62_c2pnb163v2 OBJ_X9_62_c_TwoCurve,2L - -#define SN_X9_62_c2pnb163v3 "c2pnb163v3" -#define NID_X9_62_c2pnb163v3 686 -#define OBJ_X9_62_c2pnb163v3 OBJ_X9_62_c_TwoCurve,3L - -#define SN_X9_62_c2pnb176v1 "c2pnb176v1" -#define NID_X9_62_c2pnb176v1 687 -#define OBJ_X9_62_c2pnb176v1 OBJ_X9_62_c_TwoCurve,4L - -#define SN_X9_62_c2tnb191v1 "c2tnb191v1" -#define NID_X9_62_c2tnb191v1 688 -#define OBJ_X9_62_c2tnb191v1 OBJ_X9_62_c_TwoCurve,5L - -#define SN_X9_62_c2tnb191v2 "c2tnb191v2" -#define NID_X9_62_c2tnb191v2 689 -#define OBJ_X9_62_c2tnb191v2 OBJ_X9_62_c_TwoCurve,6L - -#define SN_X9_62_c2tnb191v3 "c2tnb191v3" -#define NID_X9_62_c2tnb191v3 690 -#define OBJ_X9_62_c2tnb191v3 OBJ_X9_62_c_TwoCurve,7L - -#define SN_X9_62_c2onb191v4 "c2onb191v4" -#define NID_X9_62_c2onb191v4 691 -#define OBJ_X9_62_c2onb191v4 OBJ_X9_62_c_TwoCurve,8L - -#define SN_X9_62_c2onb191v5 "c2onb191v5" -#define NID_X9_62_c2onb191v5 692 -#define OBJ_X9_62_c2onb191v5 OBJ_X9_62_c_TwoCurve,9L - -#define SN_X9_62_c2pnb208w1 "c2pnb208w1" -#define NID_X9_62_c2pnb208w1 693 -#define OBJ_X9_62_c2pnb208w1 OBJ_X9_62_c_TwoCurve,10L - -#define SN_X9_62_c2tnb239v1 "c2tnb239v1" -#define NID_X9_62_c2tnb239v1 694 -#define OBJ_X9_62_c2tnb239v1 OBJ_X9_62_c_TwoCurve,11L - -#define SN_X9_62_c2tnb239v2 "c2tnb239v2" -#define NID_X9_62_c2tnb239v2 695 -#define OBJ_X9_62_c2tnb239v2 OBJ_X9_62_c_TwoCurve,12L - -#define SN_X9_62_c2tnb239v3 "c2tnb239v3" -#define NID_X9_62_c2tnb239v3 696 -#define OBJ_X9_62_c2tnb239v3 OBJ_X9_62_c_TwoCurve,13L - -#define SN_X9_62_c2onb239v4 "c2onb239v4" -#define NID_X9_62_c2onb239v4 697 -#define OBJ_X9_62_c2onb239v4 OBJ_X9_62_c_TwoCurve,14L - -#define SN_X9_62_c2onb239v5 "c2onb239v5" -#define NID_X9_62_c2onb239v5 698 -#define OBJ_X9_62_c2onb239v5 OBJ_X9_62_c_TwoCurve,15L - -#define SN_X9_62_c2pnb272w1 "c2pnb272w1" -#define NID_X9_62_c2pnb272w1 699 -#define OBJ_X9_62_c2pnb272w1 OBJ_X9_62_c_TwoCurve,16L - -#define SN_X9_62_c2pnb304w1 "c2pnb304w1" -#define NID_X9_62_c2pnb304w1 700 -#define OBJ_X9_62_c2pnb304w1 OBJ_X9_62_c_TwoCurve,17L - -#define SN_X9_62_c2tnb359v1 "c2tnb359v1" -#define NID_X9_62_c2tnb359v1 701 -#define OBJ_X9_62_c2tnb359v1 OBJ_X9_62_c_TwoCurve,18L - -#define SN_X9_62_c2pnb368w1 "c2pnb368w1" -#define NID_X9_62_c2pnb368w1 702 -#define OBJ_X9_62_c2pnb368w1 OBJ_X9_62_c_TwoCurve,19L - -#define SN_X9_62_c2tnb431r1 "c2tnb431r1" -#define NID_X9_62_c2tnb431r1 703 -#define OBJ_X9_62_c2tnb431r1 OBJ_X9_62_c_TwoCurve,20L - -#define OBJ_X9_62_primeCurve OBJ_X9_62_ellipticCurve,1L - -#define SN_X9_62_prime192v1 "prime192v1" -#define NID_X9_62_prime192v1 409 -#define OBJ_X9_62_prime192v1 OBJ_X9_62_primeCurve,1L - -#define SN_X9_62_prime192v2 "prime192v2" -#define NID_X9_62_prime192v2 410 -#define OBJ_X9_62_prime192v2 OBJ_X9_62_primeCurve,2L - -#define SN_X9_62_prime192v3 "prime192v3" -#define NID_X9_62_prime192v3 411 -#define OBJ_X9_62_prime192v3 OBJ_X9_62_primeCurve,3L - -#define SN_X9_62_prime239v1 "prime239v1" -#define NID_X9_62_prime239v1 412 -#define OBJ_X9_62_prime239v1 OBJ_X9_62_primeCurve,4L - -#define SN_X9_62_prime239v2 "prime239v2" -#define NID_X9_62_prime239v2 413 -#define OBJ_X9_62_prime239v2 OBJ_X9_62_primeCurve,5L - -#define SN_X9_62_prime239v3 "prime239v3" -#define NID_X9_62_prime239v3 414 -#define OBJ_X9_62_prime239v3 OBJ_X9_62_primeCurve,6L - -#define SN_X9_62_prime256v1 "prime256v1" -#define NID_X9_62_prime256v1 415 -#define OBJ_X9_62_prime256v1 OBJ_X9_62_primeCurve,7L - -#define OBJ_X9_62_id_ecSigType OBJ_ansi_X9_62,4L - -#define SN_ecdsa_with_SHA1 "ecdsa-with-SHA1" -#define NID_ecdsa_with_SHA1 416 -#define OBJ_ecdsa_with_SHA1 OBJ_X9_62_id_ecSigType,1L - -#define SN_ecdsa_with_Recommended "ecdsa-with-Recommended" -#define NID_ecdsa_with_Recommended 791 -#define OBJ_ecdsa_with_Recommended OBJ_X9_62_id_ecSigType,2L - -#define SN_ecdsa_with_Specified "ecdsa-with-Specified" -#define NID_ecdsa_with_Specified 792 -#define OBJ_ecdsa_with_Specified OBJ_X9_62_id_ecSigType,3L - -#define SN_ecdsa_with_SHA224 "ecdsa-with-SHA224" -#define NID_ecdsa_with_SHA224 793 -#define OBJ_ecdsa_with_SHA224 OBJ_ecdsa_with_Specified,1L - -#define SN_ecdsa_with_SHA256 "ecdsa-with-SHA256" -#define NID_ecdsa_with_SHA256 794 -#define OBJ_ecdsa_with_SHA256 OBJ_ecdsa_with_Specified,2L - -#define SN_ecdsa_with_SHA384 "ecdsa-with-SHA384" -#define NID_ecdsa_with_SHA384 795 -#define OBJ_ecdsa_with_SHA384 OBJ_ecdsa_with_Specified,3L - -#define SN_ecdsa_with_SHA512 "ecdsa-with-SHA512" -#define NID_ecdsa_with_SHA512 796 -#define OBJ_ecdsa_with_SHA512 OBJ_ecdsa_with_Specified,4L - -#define OBJ_secg_ellipticCurve OBJ_certicom_arc,0L - -#define SN_secp112r1 "secp112r1" -#define NID_secp112r1 704 -#define OBJ_secp112r1 OBJ_secg_ellipticCurve,6L - -#define SN_secp112r2 "secp112r2" -#define NID_secp112r2 705 -#define OBJ_secp112r2 OBJ_secg_ellipticCurve,7L - -#define SN_secp128r1 "secp128r1" -#define NID_secp128r1 706 -#define OBJ_secp128r1 OBJ_secg_ellipticCurve,28L - -#define SN_secp128r2 "secp128r2" -#define NID_secp128r2 707 -#define OBJ_secp128r2 OBJ_secg_ellipticCurve,29L - -#define SN_secp160k1 "secp160k1" -#define NID_secp160k1 708 -#define OBJ_secp160k1 OBJ_secg_ellipticCurve,9L - -#define SN_secp160r1 "secp160r1" -#define NID_secp160r1 709 -#define OBJ_secp160r1 OBJ_secg_ellipticCurve,8L - -#define SN_secp160r2 "secp160r2" -#define NID_secp160r2 710 -#define OBJ_secp160r2 OBJ_secg_ellipticCurve,30L - -#define SN_secp192k1 "secp192k1" -#define NID_secp192k1 711 -#define OBJ_secp192k1 OBJ_secg_ellipticCurve,31L - -#define SN_secp224k1 "secp224k1" -#define NID_secp224k1 712 -#define OBJ_secp224k1 OBJ_secg_ellipticCurve,32L - -#define SN_secp224r1 "secp224r1" -#define NID_secp224r1 713 -#define OBJ_secp224r1 OBJ_secg_ellipticCurve,33L - -#define SN_secp256k1 "secp256k1" -#define NID_secp256k1 714 -#define OBJ_secp256k1 OBJ_secg_ellipticCurve,10L - -#define SN_secp384r1 "secp384r1" -#define NID_secp384r1 715 -#define OBJ_secp384r1 OBJ_secg_ellipticCurve,34L - -#define SN_secp521r1 "secp521r1" -#define NID_secp521r1 716 -#define OBJ_secp521r1 OBJ_secg_ellipticCurve,35L - -#define SN_sect113r1 "sect113r1" -#define NID_sect113r1 717 -#define OBJ_sect113r1 OBJ_secg_ellipticCurve,4L - -#define SN_sect113r2 "sect113r2" -#define NID_sect113r2 718 -#define OBJ_sect113r2 OBJ_secg_ellipticCurve,5L - -#define SN_sect131r1 "sect131r1" -#define NID_sect131r1 719 -#define OBJ_sect131r1 OBJ_secg_ellipticCurve,22L - -#define SN_sect131r2 "sect131r2" -#define NID_sect131r2 720 -#define OBJ_sect131r2 OBJ_secg_ellipticCurve,23L - -#define SN_sect163k1 "sect163k1" -#define NID_sect163k1 721 -#define OBJ_sect163k1 OBJ_secg_ellipticCurve,1L - -#define SN_sect163r1 "sect163r1" -#define NID_sect163r1 722 -#define OBJ_sect163r1 OBJ_secg_ellipticCurve,2L - -#define SN_sect163r2 "sect163r2" -#define NID_sect163r2 723 -#define OBJ_sect163r2 OBJ_secg_ellipticCurve,15L - -#define SN_sect193r1 "sect193r1" -#define NID_sect193r1 724 -#define OBJ_sect193r1 OBJ_secg_ellipticCurve,24L - -#define SN_sect193r2 "sect193r2" -#define NID_sect193r2 725 -#define OBJ_sect193r2 OBJ_secg_ellipticCurve,25L - -#define SN_sect233k1 "sect233k1" -#define NID_sect233k1 726 -#define OBJ_sect233k1 OBJ_secg_ellipticCurve,26L - -#define SN_sect233r1 "sect233r1" -#define NID_sect233r1 727 -#define OBJ_sect233r1 OBJ_secg_ellipticCurve,27L - -#define SN_sect239k1 "sect239k1" -#define NID_sect239k1 728 -#define OBJ_sect239k1 OBJ_secg_ellipticCurve,3L - -#define SN_sect283k1 "sect283k1" -#define NID_sect283k1 729 -#define OBJ_sect283k1 OBJ_secg_ellipticCurve,16L - -#define SN_sect283r1 "sect283r1" -#define NID_sect283r1 730 -#define OBJ_sect283r1 OBJ_secg_ellipticCurve,17L - -#define SN_sect409k1 "sect409k1" -#define NID_sect409k1 731 -#define OBJ_sect409k1 OBJ_secg_ellipticCurve,36L - -#define SN_sect409r1 "sect409r1" -#define NID_sect409r1 732 -#define OBJ_sect409r1 OBJ_secg_ellipticCurve,37L - -#define SN_sect571k1 "sect571k1" -#define NID_sect571k1 733 -#define OBJ_sect571k1 OBJ_secg_ellipticCurve,38L - -#define SN_sect571r1 "sect571r1" -#define NID_sect571r1 734 -#define OBJ_sect571r1 OBJ_secg_ellipticCurve,39L - -#define OBJ_wap_wsg_idm_ecid OBJ_wap_wsg,4L - -#define SN_wap_wsg_idm_ecid_wtls1 "wap-wsg-idm-ecid-wtls1" -#define NID_wap_wsg_idm_ecid_wtls1 735 -#define OBJ_wap_wsg_idm_ecid_wtls1 OBJ_wap_wsg_idm_ecid,1L - -#define SN_wap_wsg_idm_ecid_wtls3 "wap-wsg-idm-ecid-wtls3" -#define NID_wap_wsg_idm_ecid_wtls3 736 -#define OBJ_wap_wsg_idm_ecid_wtls3 OBJ_wap_wsg_idm_ecid,3L - -#define SN_wap_wsg_idm_ecid_wtls4 "wap-wsg-idm-ecid-wtls4" -#define NID_wap_wsg_idm_ecid_wtls4 737 -#define OBJ_wap_wsg_idm_ecid_wtls4 OBJ_wap_wsg_idm_ecid,4L - -#define SN_wap_wsg_idm_ecid_wtls5 "wap-wsg-idm-ecid-wtls5" -#define NID_wap_wsg_idm_ecid_wtls5 738 -#define OBJ_wap_wsg_idm_ecid_wtls5 OBJ_wap_wsg_idm_ecid,5L - -#define SN_wap_wsg_idm_ecid_wtls6 "wap-wsg-idm-ecid-wtls6" -#define NID_wap_wsg_idm_ecid_wtls6 739 -#define OBJ_wap_wsg_idm_ecid_wtls6 OBJ_wap_wsg_idm_ecid,6L - -#define SN_wap_wsg_idm_ecid_wtls7 "wap-wsg-idm-ecid-wtls7" -#define NID_wap_wsg_idm_ecid_wtls7 740 -#define OBJ_wap_wsg_idm_ecid_wtls7 OBJ_wap_wsg_idm_ecid,7L - -#define SN_wap_wsg_idm_ecid_wtls8 "wap-wsg-idm-ecid-wtls8" -#define NID_wap_wsg_idm_ecid_wtls8 741 -#define OBJ_wap_wsg_idm_ecid_wtls8 OBJ_wap_wsg_idm_ecid,8L - -#define SN_wap_wsg_idm_ecid_wtls9 "wap-wsg-idm-ecid-wtls9" -#define NID_wap_wsg_idm_ecid_wtls9 742 -#define OBJ_wap_wsg_idm_ecid_wtls9 OBJ_wap_wsg_idm_ecid,9L - -#define SN_wap_wsg_idm_ecid_wtls10 "wap-wsg-idm-ecid-wtls10" -#define NID_wap_wsg_idm_ecid_wtls10 743 -#define OBJ_wap_wsg_idm_ecid_wtls10 OBJ_wap_wsg_idm_ecid,10L - -#define SN_wap_wsg_idm_ecid_wtls11 "wap-wsg-idm-ecid-wtls11" -#define NID_wap_wsg_idm_ecid_wtls11 744 -#define OBJ_wap_wsg_idm_ecid_wtls11 OBJ_wap_wsg_idm_ecid,11L - -#define SN_wap_wsg_idm_ecid_wtls12 "wap-wsg-idm-ecid-wtls12" -#define NID_wap_wsg_idm_ecid_wtls12 745 -#define OBJ_wap_wsg_idm_ecid_wtls12 OBJ_wap_wsg_idm_ecid,12L - -#define SN_cast5_cbc "CAST5-CBC" -#define LN_cast5_cbc "cast5-cbc" -#define NID_cast5_cbc 108 -#define OBJ_cast5_cbc OBJ_ISO_US,113533L,7L,66L,10L - -#define SN_cast5_ecb "CAST5-ECB" -#define LN_cast5_ecb "cast5-ecb" -#define NID_cast5_ecb 109 - -#define SN_cast5_cfb64 "CAST5-CFB" -#define LN_cast5_cfb64 "cast5-cfb" -#define NID_cast5_cfb64 110 - -#define SN_cast5_ofb64 "CAST5-OFB" -#define LN_cast5_ofb64 "cast5-ofb" -#define NID_cast5_ofb64 111 - -#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC" -#define NID_pbeWithMD5AndCast5_CBC 112 -#define OBJ_pbeWithMD5AndCast5_CBC OBJ_ISO_US,113533L,7L,66L,12L - -#define SN_id_PasswordBasedMAC "id-PasswordBasedMAC" -#define LN_id_PasswordBasedMAC "password based MAC" -#define NID_id_PasswordBasedMAC 782 -#define OBJ_id_PasswordBasedMAC OBJ_ISO_US,113533L,7L,66L,13L - -#define SN_id_DHBasedMac "id-DHBasedMac" -#define LN_id_DHBasedMac "Diffie-Hellman based MAC" -#define NID_id_DHBasedMac 783 -#define OBJ_id_DHBasedMac OBJ_ISO_US,113533L,7L,66L,30L - -#define SN_rsadsi "rsadsi" -#define LN_rsadsi "RSA Data Security, Inc." -#define NID_rsadsi 1 -#define OBJ_rsadsi OBJ_ISO_US,113549L - -#define SN_pkcs "pkcs" -#define LN_pkcs "RSA Data Security, Inc. PKCS" -#define NID_pkcs 2 -#define OBJ_pkcs OBJ_rsadsi,1L - -#define SN_pkcs1 "pkcs1" -#define NID_pkcs1 186 -#define OBJ_pkcs1 OBJ_pkcs,1L - -#define LN_rsaEncryption "rsaEncryption" -#define NID_rsaEncryption 6 -#define OBJ_rsaEncryption OBJ_pkcs1,1L - -#define SN_md2WithRSAEncryption "RSA-MD2" -#define LN_md2WithRSAEncryption "md2WithRSAEncryption" -#define NID_md2WithRSAEncryption 7 -#define OBJ_md2WithRSAEncryption OBJ_pkcs1,2L - -#define SN_md4WithRSAEncryption "RSA-MD4" -#define LN_md4WithRSAEncryption "md4WithRSAEncryption" -#define NID_md4WithRSAEncryption 396 -#define OBJ_md4WithRSAEncryption OBJ_pkcs1,3L - -#define SN_md5WithRSAEncryption "RSA-MD5" -#define LN_md5WithRSAEncryption "md5WithRSAEncryption" -#define NID_md5WithRSAEncryption 8 -#define OBJ_md5WithRSAEncryption OBJ_pkcs1,4L - -#define SN_sha1WithRSAEncryption "RSA-SHA1" -#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption" -#define NID_sha1WithRSAEncryption 65 -#define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L - -#define SN_rsaesOaep "RSAES-OAEP" -#define LN_rsaesOaep "rsaesOaep" -#define NID_rsaesOaep 919 -#define OBJ_rsaesOaep OBJ_pkcs1,7L - -#define SN_mgf1 "MGF1" -#define LN_mgf1 "mgf1" -#define NID_mgf1 911 -#define OBJ_mgf1 OBJ_pkcs1,8L - -#define SN_pSpecified "PSPECIFIED" -#define LN_pSpecified "pSpecified" -#define NID_pSpecified 935 -#define OBJ_pSpecified OBJ_pkcs1,9L - -#define SN_rsassaPss "RSASSA-PSS" -#define LN_rsassaPss "rsassaPss" -#define NID_rsassaPss 912 -#define OBJ_rsassaPss OBJ_pkcs1,10L - -#define SN_sha256WithRSAEncryption "RSA-SHA256" -#define LN_sha256WithRSAEncryption "sha256WithRSAEncryption" -#define NID_sha256WithRSAEncryption 668 -#define OBJ_sha256WithRSAEncryption OBJ_pkcs1,11L - -#define SN_sha384WithRSAEncryption "RSA-SHA384" -#define LN_sha384WithRSAEncryption "sha384WithRSAEncryption" -#define NID_sha384WithRSAEncryption 669 -#define OBJ_sha384WithRSAEncryption OBJ_pkcs1,12L - -#define SN_sha512WithRSAEncryption "RSA-SHA512" -#define LN_sha512WithRSAEncryption "sha512WithRSAEncryption" -#define NID_sha512WithRSAEncryption 670 -#define OBJ_sha512WithRSAEncryption OBJ_pkcs1,13L - -#define SN_sha224WithRSAEncryption "RSA-SHA224" -#define LN_sha224WithRSAEncryption "sha224WithRSAEncryption" -#define NID_sha224WithRSAEncryption 671 -#define OBJ_sha224WithRSAEncryption OBJ_pkcs1,14L - -#define SN_pkcs3 "pkcs3" -#define NID_pkcs3 27 -#define OBJ_pkcs3 OBJ_pkcs,3L - -#define LN_dhKeyAgreement "dhKeyAgreement" -#define NID_dhKeyAgreement 28 -#define OBJ_dhKeyAgreement OBJ_pkcs3,1L - -#define SN_pkcs5 "pkcs5" -#define NID_pkcs5 187 -#define OBJ_pkcs5 OBJ_pkcs,5L - -#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES" -#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC" -#define NID_pbeWithMD2AndDES_CBC 9 -#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs5,1L - -#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES" -#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC" -#define NID_pbeWithMD5AndDES_CBC 10 -#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs5,3L - -#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64" -#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC" -#define NID_pbeWithMD2AndRC2_CBC 168 -#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs5,4L - -#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64" -#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC" -#define NID_pbeWithMD5AndRC2_CBC 169 -#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs5,6L - -#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES" -#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC" -#define NID_pbeWithSHA1AndDES_CBC 170 -#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs5,10L - -#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64" -#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC" -#define NID_pbeWithSHA1AndRC2_CBC 68 -#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs5,11L - -#define LN_id_pbkdf2 "PBKDF2" -#define NID_id_pbkdf2 69 -#define OBJ_id_pbkdf2 OBJ_pkcs5,12L - -#define LN_pbes2 "PBES2" -#define NID_pbes2 161 -#define OBJ_pbes2 OBJ_pkcs5,13L - -#define LN_pbmac1 "PBMAC1" -#define NID_pbmac1 162 -#define OBJ_pbmac1 OBJ_pkcs5,14L - -#define SN_pkcs7 "pkcs7" -#define NID_pkcs7 20 -#define OBJ_pkcs7 OBJ_pkcs,7L - -#define LN_pkcs7_data "pkcs7-data" -#define NID_pkcs7_data 21 -#define OBJ_pkcs7_data OBJ_pkcs7,1L - -#define LN_pkcs7_signed "pkcs7-signedData" -#define NID_pkcs7_signed 22 -#define OBJ_pkcs7_signed OBJ_pkcs7,2L - -#define LN_pkcs7_enveloped "pkcs7-envelopedData" -#define NID_pkcs7_enveloped 23 -#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L - -#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData" -#define NID_pkcs7_signedAndEnveloped 24 -#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L - -#define LN_pkcs7_digest "pkcs7-digestData" -#define NID_pkcs7_digest 25 -#define OBJ_pkcs7_digest OBJ_pkcs7,5L - -#define LN_pkcs7_encrypted "pkcs7-encryptedData" -#define NID_pkcs7_encrypted 26 -#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L - -#define SN_pkcs9 "pkcs9" -#define NID_pkcs9 47 -#define OBJ_pkcs9 OBJ_pkcs,9L - -#define LN_pkcs9_emailAddress "emailAddress" -#define NID_pkcs9_emailAddress 48 -#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L - -#define LN_pkcs9_unstructuredName "unstructuredName" -#define NID_pkcs9_unstructuredName 49 -#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L - -#define LN_pkcs9_contentType "contentType" -#define NID_pkcs9_contentType 50 -#define OBJ_pkcs9_contentType OBJ_pkcs9,3L - -#define LN_pkcs9_messageDigest "messageDigest" -#define NID_pkcs9_messageDigest 51 -#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L - -#define LN_pkcs9_signingTime "signingTime" -#define NID_pkcs9_signingTime 52 -#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L - -#define LN_pkcs9_countersignature "countersignature" -#define NID_pkcs9_countersignature 53 -#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L - -#define LN_pkcs9_challengePassword "challengePassword" -#define NID_pkcs9_challengePassword 54 -#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L - -#define LN_pkcs9_unstructuredAddress "unstructuredAddress" -#define NID_pkcs9_unstructuredAddress 55 -#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L - -#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes" -#define NID_pkcs9_extCertAttributes 56 -#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L - -#define SN_ext_req "extReq" -#define LN_ext_req "Extension Request" -#define NID_ext_req 172 -#define OBJ_ext_req OBJ_pkcs9,14L - -#define SN_SMIMECapabilities "SMIME-CAPS" -#define LN_SMIMECapabilities "S/MIME Capabilities" -#define NID_SMIMECapabilities 167 -#define OBJ_SMIMECapabilities OBJ_pkcs9,15L - -#define SN_SMIME "SMIME" -#define LN_SMIME "S/MIME" -#define NID_SMIME 188 -#define OBJ_SMIME OBJ_pkcs9,16L - -#define SN_id_smime_mod "id-smime-mod" -#define NID_id_smime_mod 189 -#define OBJ_id_smime_mod OBJ_SMIME,0L - -#define SN_id_smime_ct "id-smime-ct" -#define NID_id_smime_ct 190 -#define OBJ_id_smime_ct OBJ_SMIME,1L - -#define SN_id_smime_aa "id-smime-aa" -#define NID_id_smime_aa 191 -#define OBJ_id_smime_aa OBJ_SMIME,2L - -#define SN_id_smime_alg "id-smime-alg" -#define NID_id_smime_alg 192 -#define OBJ_id_smime_alg OBJ_SMIME,3L - -#define SN_id_smime_cd "id-smime-cd" -#define NID_id_smime_cd 193 -#define OBJ_id_smime_cd OBJ_SMIME,4L - -#define SN_id_smime_spq "id-smime-spq" -#define NID_id_smime_spq 194 -#define OBJ_id_smime_spq OBJ_SMIME,5L - -#define SN_id_smime_cti "id-smime-cti" -#define NID_id_smime_cti 195 -#define OBJ_id_smime_cti OBJ_SMIME,6L - -#define SN_id_smime_mod_cms "id-smime-mod-cms" -#define NID_id_smime_mod_cms 196 -#define OBJ_id_smime_mod_cms OBJ_id_smime_mod,1L - -#define SN_id_smime_mod_ess "id-smime-mod-ess" -#define NID_id_smime_mod_ess 197 -#define OBJ_id_smime_mod_ess OBJ_id_smime_mod,2L - -#define SN_id_smime_mod_oid "id-smime-mod-oid" -#define NID_id_smime_mod_oid 198 -#define OBJ_id_smime_mod_oid OBJ_id_smime_mod,3L - -#define SN_id_smime_mod_msg_v3 "id-smime-mod-msg-v3" -#define NID_id_smime_mod_msg_v3 199 -#define OBJ_id_smime_mod_msg_v3 OBJ_id_smime_mod,4L - -#define SN_id_smime_mod_ets_eSignature_88 "id-smime-mod-ets-eSignature-88" -#define NID_id_smime_mod_ets_eSignature_88 200 -#define OBJ_id_smime_mod_ets_eSignature_88 OBJ_id_smime_mod,5L - -#define SN_id_smime_mod_ets_eSignature_97 "id-smime-mod-ets-eSignature-97" -#define NID_id_smime_mod_ets_eSignature_97 201 -#define OBJ_id_smime_mod_ets_eSignature_97 OBJ_id_smime_mod,6L - -#define SN_id_smime_mod_ets_eSigPolicy_88 "id-smime-mod-ets-eSigPolicy-88" -#define NID_id_smime_mod_ets_eSigPolicy_88 202 -#define OBJ_id_smime_mod_ets_eSigPolicy_88 OBJ_id_smime_mod,7L - -#define SN_id_smime_mod_ets_eSigPolicy_97 "id-smime-mod-ets-eSigPolicy-97" -#define NID_id_smime_mod_ets_eSigPolicy_97 203 -#define OBJ_id_smime_mod_ets_eSigPolicy_97 OBJ_id_smime_mod,8L - -#define SN_id_smime_ct_receipt "id-smime-ct-receipt" -#define NID_id_smime_ct_receipt 204 -#define OBJ_id_smime_ct_receipt OBJ_id_smime_ct,1L - -#define SN_id_smime_ct_authData "id-smime-ct-authData" -#define NID_id_smime_ct_authData 205 -#define OBJ_id_smime_ct_authData OBJ_id_smime_ct,2L - -#define SN_id_smime_ct_publishCert "id-smime-ct-publishCert" -#define NID_id_smime_ct_publishCert 206 -#define OBJ_id_smime_ct_publishCert OBJ_id_smime_ct,3L - -#define SN_id_smime_ct_TSTInfo "id-smime-ct-TSTInfo" -#define NID_id_smime_ct_TSTInfo 207 -#define OBJ_id_smime_ct_TSTInfo OBJ_id_smime_ct,4L - -#define SN_id_smime_ct_TDTInfo "id-smime-ct-TDTInfo" -#define NID_id_smime_ct_TDTInfo 208 -#define OBJ_id_smime_ct_TDTInfo OBJ_id_smime_ct,5L - -#define SN_id_smime_ct_contentInfo "id-smime-ct-contentInfo" -#define NID_id_smime_ct_contentInfo 209 -#define OBJ_id_smime_ct_contentInfo OBJ_id_smime_ct,6L - -#define SN_id_smime_ct_DVCSRequestData "id-smime-ct-DVCSRequestData" -#define NID_id_smime_ct_DVCSRequestData 210 -#define OBJ_id_smime_ct_DVCSRequestData OBJ_id_smime_ct,7L - -#define SN_id_smime_ct_DVCSResponseData "id-smime-ct-DVCSResponseData" -#define NID_id_smime_ct_DVCSResponseData 211 -#define OBJ_id_smime_ct_DVCSResponseData OBJ_id_smime_ct,8L - -#define SN_id_smime_ct_compressedData "id-smime-ct-compressedData" -#define NID_id_smime_ct_compressedData 786 -#define OBJ_id_smime_ct_compressedData OBJ_id_smime_ct,9L - -#define SN_id_ct_asciiTextWithCRLF "id-ct-asciiTextWithCRLF" -#define NID_id_ct_asciiTextWithCRLF 787 -#define OBJ_id_ct_asciiTextWithCRLF OBJ_id_smime_ct,27L - -#define SN_id_smime_aa_receiptRequest "id-smime-aa-receiptRequest" -#define NID_id_smime_aa_receiptRequest 212 -#define OBJ_id_smime_aa_receiptRequest OBJ_id_smime_aa,1L - -#define SN_id_smime_aa_securityLabel "id-smime-aa-securityLabel" -#define NID_id_smime_aa_securityLabel 213 -#define OBJ_id_smime_aa_securityLabel OBJ_id_smime_aa,2L - -#define SN_id_smime_aa_mlExpandHistory "id-smime-aa-mlExpandHistory" -#define NID_id_smime_aa_mlExpandHistory 214 -#define OBJ_id_smime_aa_mlExpandHistory OBJ_id_smime_aa,3L - -#define SN_id_smime_aa_contentHint "id-smime-aa-contentHint" -#define NID_id_smime_aa_contentHint 215 -#define OBJ_id_smime_aa_contentHint OBJ_id_smime_aa,4L - -#define SN_id_smime_aa_msgSigDigest "id-smime-aa-msgSigDigest" -#define NID_id_smime_aa_msgSigDigest 216 -#define OBJ_id_smime_aa_msgSigDigest OBJ_id_smime_aa,5L - -#define SN_id_smime_aa_encapContentType "id-smime-aa-encapContentType" -#define NID_id_smime_aa_encapContentType 217 -#define OBJ_id_smime_aa_encapContentType OBJ_id_smime_aa,6L - -#define SN_id_smime_aa_contentIdentifier "id-smime-aa-contentIdentifier" -#define NID_id_smime_aa_contentIdentifier 218 -#define OBJ_id_smime_aa_contentIdentifier OBJ_id_smime_aa,7L - -#define SN_id_smime_aa_macValue "id-smime-aa-macValue" -#define NID_id_smime_aa_macValue 219 -#define OBJ_id_smime_aa_macValue OBJ_id_smime_aa,8L - -#define SN_id_smime_aa_equivalentLabels "id-smime-aa-equivalentLabels" -#define NID_id_smime_aa_equivalentLabels 220 -#define OBJ_id_smime_aa_equivalentLabels OBJ_id_smime_aa,9L - -#define SN_id_smime_aa_contentReference "id-smime-aa-contentReference" -#define NID_id_smime_aa_contentReference 221 -#define OBJ_id_smime_aa_contentReference OBJ_id_smime_aa,10L - -#define SN_id_smime_aa_encrypKeyPref "id-smime-aa-encrypKeyPref" -#define NID_id_smime_aa_encrypKeyPref 222 -#define OBJ_id_smime_aa_encrypKeyPref OBJ_id_smime_aa,11L - -#define SN_id_smime_aa_signingCertificate "id-smime-aa-signingCertificate" -#define NID_id_smime_aa_signingCertificate 223 -#define OBJ_id_smime_aa_signingCertificate OBJ_id_smime_aa,12L - -#define SN_id_smime_aa_smimeEncryptCerts "id-smime-aa-smimeEncryptCerts" -#define NID_id_smime_aa_smimeEncryptCerts 224 -#define OBJ_id_smime_aa_smimeEncryptCerts OBJ_id_smime_aa,13L - -#define SN_id_smime_aa_timeStampToken "id-smime-aa-timeStampToken" -#define NID_id_smime_aa_timeStampToken 225 -#define OBJ_id_smime_aa_timeStampToken OBJ_id_smime_aa,14L - -#define SN_id_smime_aa_ets_sigPolicyId "id-smime-aa-ets-sigPolicyId" -#define NID_id_smime_aa_ets_sigPolicyId 226 -#define OBJ_id_smime_aa_ets_sigPolicyId OBJ_id_smime_aa,15L - -#define SN_id_smime_aa_ets_commitmentType "id-smime-aa-ets-commitmentType" -#define NID_id_smime_aa_ets_commitmentType 227 -#define OBJ_id_smime_aa_ets_commitmentType OBJ_id_smime_aa,16L - -#define SN_id_smime_aa_ets_signerLocation "id-smime-aa-ets-signerLocation" -#define NID_id_smime_aa_ets_signerLocation 228 -#define OBJ_id_smime_aa_ets_signerLocation OBJ_id_smime_aa,17L - -#define SN_id_smime_aa_ets_signerAttr "id-smime-aa-ets-signerAttr" -#define NID_id_smime_aa_ets_signerAttr 229 -#define OBJ_id_smime_aa_ets_signerAttr OBJ_id_smime_aa,18L - -#define SN_id_smime_aa_ets_otherSigCert "id-smime-aa-ets-otherSigCert" -#define NID_id_smime_aa_ets_otherSigCert 230 -#define OBJ_id_smime_aa_ets_otherSigCert OBJ_id_smime_aa,19L - -#define SN_id_smime_aa_ets_contentTimestamp "id-smime-aa-ets-contentTimestamp" -#define NID_id_smime_aa_ets_contentTimestamp 231 -#define OBJ_id_smime_aa_ets_contentTimestamp OBJ_id_smime_aa,20L - -#define SN_id_smime_aa_ets_CertificateRefs "id-smime-aa-ets-CertificateRefs" -#define NID_id_smime_aa_ets_CertificateRefs 232 -#define OBJ_id_smime_aa_ets_CertificateRefs OBJ_id_smime_aa,21L - -#define SN_id_smime_aa_ets_RevocationRefs "id-smime-aa-ets-RevocationRefs" -#define NID_id_smime_aa_ets_RevocationRefs 233 -#define OBJ_id_smime_aa_ets_RevocationRefs OBJ_id_smime_aa,22L - -#define SN_id_smime_aa_ets_certValues "id-smime-aa-ets-certValues" -#define NID_id_smime_aa_ets_certValues 234 -#define OBJ_id_smime_aa_ets_certValues OBJ_id_smime_aa,23L - -#define SN_id_smime_aa_ets_revocationValues "id-smime-aa-ets-revocationValues" -#define NID_id_smime_aa_ets_revocationValues 235 -#define OBJ_id_smime_aa_ets_revocationValues OBJ_id_smime_aa,24L - -#define SN_id_smime_aa_ets_escTimeStamp "id-smime-aa-ets-escTimeStamp" -#define NID_id_smime_aa_ets_escTimeStamp 236 -#define OBJ_id_smime_aa_ets_escTimeStamp OBJ_id_smime_aa,25L - -#define SN_id_smime_aa_ets_certCRLTimestamp "id-smime-aa-ets-certCRLTimestamp" -#define NID_id_smime_aa_ets_certCRLTimestamp 237 -#define OBJ_id_smime_aa_ets_certCRLTimestamp OBJ_id_smime_aa,26L - -#define SN_id_smime_aa_ets_archiveTimeStamp "id-smime-aa-ets-archiveTimeStamp" -#define NID_id_smime_aa_ets_archiveTimeStamp 238 -#define OBJ_id_smime_aa_ets_archiveTimeStamp OBJ_id_smime_aa,27L - -#define SN_id_smime_aa_signatureType "id-smime-aa-signatureType" -#define NID_id_smime_aa_signatureType 239 -#define OBJ_id_smime_aa_signatureType OBJ_id_smime_aa,28L - -#define SN_id_smime_aa_dvcs_dvc "id-smime-aa-dvcs-dvc" -#define NID_id_smime_aa_dvcs_dvc 240 -#define OBJ_id_smime_aa_dvcs_dvc OBJ_id_smime_aa,29L - -#define SN_id_smime_alg_ESDHwith3DES "id-smime-alg-ESDHwith3DES" -#define NID_id_smime_alg_ESDHwith3DES 241 -#define OBJ_id_smime_alg_ESDHwith3DES OBJ_id_smime_alg,1L - -#define SN_id_smime_alg_ESDHwithRC2 "id-smime-alg-ESDHwithRC2" -#define NID_id_smime_alg_ESDHwithRC2 242 -#define OBJ_id_smime_alg_ESDHwithRC2 OBJ_id_smime_alg,2L - -#define SN_id_smime_alg_3DESwrap "id-smime-alg-3DESwrap" -#define NID_id_smime_alg_3DESwrap 243 -#define OBJ_id_smime_alg_3DESwrap OBJ_id_smime_alg,3L - -#define SN_id_smime_alg_RC2wrap "id-smime-alg-RC2wrap" -#define NID_id_smime_alg_RC2wrap 244 -#define OBJ_id_smime_alg_RC2wrap OBJ_id_smime_alg,4L - -#define SN_id_smime_alg_ESDH "id-smime-alg-ESDH" -#define NID_id_smime_alg_ESDH 245 -#define OBJ_id_smime_alg_ESDH OBJ_id_smime_alg,5L - -#define SN_id_smime_alg_CMS3DESwrap "id-smime-alg-CMS3DESwrap" -#define NID_id_smime_alg_CMS3DESwrap 246 -#define OBJ_id_smime_alg_CMS3DESwrap OBJ_id_smime_alg,6L - -#define SN_id_smime_alg_CMSRC2wrap "id-smime-alg-CMSRC2wrap" -#define NID_id_smime_alg_CMSRC2wrap 247 -#define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L - -#define SN_id_alg_PWRI_KEK "id-alg-PWRI-KEK" -#define NID_id_alg_PWRI_KEK 893 -#define OBJ_id_alg_PWRI_KEK OBJ_id_smime_alg,9L - -#define SN_id_smime_cd_ldap "id-smime-cd-ldap" -#define NID_id_smime_cd_ldap 248 -#define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L - -#define SN_id_smime_spq_ets_sqt_uri "id-smime-spq-ets-sqt-uri" -#define NID_id_smime_spq_ets_sqt_uri 249 -#define OBJ_id_smime_spq_ets_sqt_uri OBJ_id_smime_spq,1L - -#define SN_id_smime_spq_ets_sqt_unotice "id-smime-spq-ets-sqt-unotice" -#define NID_id_smime_spq_ets_sqt_unotice 250 -#define OBJ_id_smime_spq_ets_sqt_unotice OBJ_id_smime_spq,2L - -#define SN_id_smime_cti_ets_proofOfOrigin "id-smime-cti-ets-proofOfOrigin" -#define NID_id_smime_cti_ets_proofOfOrigin 251 -#define OBJ_id_smime_cti_ets_proofOfOrigin OBJ_id_smime_cti,1L - -#define SN_id_smime_cti_ets_proofOfReceipt "id-smime-cti-ets-proofOfReceipt" -#define NID_id_smime_cti_ets_proofOfReceipt 252 -#define OBJ_id_smime_cti_ets_proofOfReceipt OBJ_id_smime_cti,2L - -#define SN_id_smime_cti_ets_proofOfDelivery "id-smime-cti-ets-proofOfDelivery" -#define NID_id_smime_cti_ets_proofOfDelivery 253 -#define OBJ_id_smime_cti_ets_proofOfDelivery OBJ_id_smime_cti,3L - -#define SN_id_smime_cti_ets_proofOfSender "id-smime-cti-ets-proofOfSender" -#define NID_id_smime_cti_ets_proofOfSender 254 -#define OBJ_id_smime_cti_ets_proofOfSender OBJ_id_smime_cti,4L - -#define SN_id_smime_cti_ets_proofOfApproval "id-smime-cti-ets-proofOfApproval" -#define NID_id_smime_cti_ets_proofOfApproval 255 -#define OBJ_id_smime_cti_ets_proofOfApproval OBJ_id_smime_cti,5L - -#define SN_id_smime_cti_ets_proofOfCreation "id-smime-cti-ets-proofOfCreation" -#define NID_id_smime_cti_ets_proofOfCreation 256 -#define OBJ_id_smime_cti_ets_proofOfCreation OBJ_id_smime_cti,6L - -#define LN_friendlyName "friendlyName" -#define NID_friendlyName 156 -#define OBJ_friendlyName OBJ_pkcs9,20L - -#define LN_localKeyID "localKeyID" -#define NID_localKeyID 157 -#define OBJ_localKeyID OBJ_pkcs9,21L - -#define SN_ms_csp_name "CSPName" -#define LN_ms_csp_name "Microsoft CSP Name" -#define NID_ms_csp_name 417 -#define OBJ_ms_csp_name 1L,3L,6L,1L,4L,1L,311L,17L,1L - -#define SN_LocalKeySet "LocalKeySet" -#define LN_LocalKeySet "Microsoft Local Key set" -#define NID_LocalKeySet 856 -#define OBJ_LocalKeySet 1L,3L,6L,1L,4L,1L,311L,17L,2L - -#define OBJ_certTypes OBJ_pkcs9,22L - -#define LN_x509Certificate "x509Certificate" -#define NID_x509Certificate 158 -#define OBJ_x509Certificate OBJ_certTypes,1L - -#define LN_sdsiCertificate "sdsiCertificate" -#define NID_sdsiCertificate 159 -#define OBJ_sdsiCertificate OBJ_certTypes,2L - -#define OBJ_crlTypes OBJ_pkcs9,23L - -#define LN_x509Crl "x509Crl" -#define NID_x509Crl 160 -#define OBJ_x509Crl OBJ_crlTypes,1L - -#define OBJ_pkcs12 OBJ_pkcs,12L - -#define OBJ_pkcs12_pbeids OBJ_pkcs12,1L - -#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128" -#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4" -#define NID_pbe_WithSHA1And128BitRC4 144 -#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids,1L - -#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40" -#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4" -#define NID_pbe_WithSHA1And40BitRC4 145 -#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids,2L - -#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES" -#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC" -#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146 -#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids,3L - -#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES" -#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC" -#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147 -#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids,4L - -#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128" -#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC" -#define NID_pbe_WithSHA1And128BitRC2_CBC 148 -#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids,5L - -#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40" -#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC" -#define NID_pbe_WithSHA1And40BitRC2_CBC 149 -#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids,6L - -#define OBJ_pkcs12_Version1 OBJ_pkcs12,10L - -#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1,1L - -#define LN_keyBag "keyBag" -#define NID_keyBag 150 -#define OBJ_keyBag OBJ_pkcs12_BagIds,1L - -#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag" -#define NID_pkcs8ShroudedKeyBag 151 -#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds,2L - -#define LN_certBag "certBag" -#define NID_certBag 152 -#define OBJ_certBag OBJ_pkcs12_BagIds,3L - -#define LN_crlBag "crlBag" -#define NID_crlBag 153 -#define OBJ_crlBag OBJ_pkcs12_BagIds,4L - -#define LN_secretBag "secretBag" -#define NID_secretBag 154 -#define OBJ_secretBag OBJ_pkcs12_BagIds,5L - -#define LN_safeContentsBag "safeContentsBag" -#define NID_safeContentsBag 155 -#define OBJ_safeContentsBag OBJ_pkcs12_BagIds,6L - -#define SN_md2 "MD2" -#define LN_md2 "md2" -#define NID_md2 3 -#define OBJ_md2 OBJ_rsadsi,2L,2L - -#define SN_md4 "MD4" -#define LN_md4 "md4" -#define NID_md4 257 -#define OBJ_md4 OBJ_rsadsi,2L,4L - -#define SN_md5 "MD5" -#define LN_md5 "md5" -#define NID_md5 4 -#define OBJ_md5 OBJ_rsadsi,2L,5L - -#define SN_md5_sha1 "MD5-SHA1" -#define LN_md5_sha1 "md5-sha1" -#define NID_md5_sha1 114 - -#define LN_hmacWithMD5 "hmacWithMD5" -#define NID_hmacWithMD5 797 -#define OBJ_hmacWithMD5 OBJ_rsadsi,2L,6L - -#define LN_hmacWithSHA1 "hmacWithSHA1" -#define NID_hmacWithSHA1 163 -#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L - -#define LN_hmacWithSHA224 "hmacWithSHA224" -#define NID_hmacWithSHA224 798 -#define OBJ_hmacWithSHA224 OBJ_rsadsi,2L,8L - -#define LN_hmacWithSHA256 "hmacWithSHA256" -#define NID_hmacWithSHA256 799 -#define OBJ_hmacWithSHA256 OBJ_rsadsi,2L,9L - -#define LN_hmacWithSHA384 "hmacWithSHA384" -#define NID_hmacWithSHA384 800 -#define OBJ_hmacWithSHA384 OBJ_rsadsi,2L,10L - -#define LN_hmacWithSHA512 "hmacWithSHA512" -#define NID_hmacWithSHA512 801 -#define OBJ_hmacWithSHA512 OBJ_rsadsi,2L,11L - -#define SN_rc2_cbc "RC2-CBC" -#define LN_rc2_cbc "rc2-cbc" -#define NID_rc2_cbc 37 -#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L - -#define SN_rc2_ecb "RC2-ECB" -#define LN_rc2_ecb "rc2-ecb" -#define NID_rc2_ecb 38 - -#define SN_rc2_cfb64 "RC2-CFB" -#define LN_rc2_cfb64 "rc2-cfb" -#define NID_rc2_cfb64 39 - -#define SN_rc2_ofb64 "RC2-OFB" -#define LN_rc2_ofb64 "rc2-ofb" -#define NID_rc2_ofb64 40 - -#define SN_rc2_40_cbc "RC2-40-CBC" -#define LN_rc2_40_cbc "rc2-40-cbc" -#define NID_rc2_40_cbc 98 - -#define SN_rc2_64_cbc "RC2-64-CBC" -#define LN_rc2_64_cbc "rc2-64-cbc" -#define NID_rc2_64_cbc 166 - -#define SN_rc4 "RC4" -#define LN_rc4 "rc4" -#define NID_rc4 5 -#define OBJ_rc4 OBJ_rsadsi,3L,4L - -#define SN_rc4_40 "RC4-40" -#define LN_rc4_40 "rc4-40" -#define NID_rc4_40 97 - -#define SN_des_ede3_cbc "DES-EDE3-CBC" -#define LN_des_ede3_cbc "des-ede3-cbc" -#define NID_des_ede3_cbc 44 -#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L - -#define SN_rc5_cbc "RC5-CBC" -#define LN_rc5_cbc "rc5-cbc" -#define NID_rc5_cbc 120 -#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L - -#define SN_rc5_ecb "RC5-ECB" -#define LN_rc5_ecb "rc5-ecb" -#define NID_rc5_ecb 121 - -#define SN_rc5_cfb64 "RC5-CFB" -#define LN_rc5_cfb64 "rc5-cfb" -#define NID_rc5_cfb64 122 - -#define SN_rc5_ofb64 "RC5-OFB" -#define LN_rc5_ofb64 "rc5-ofb" -#define NID_rc5_ofb64 123 - -#define SN_ms_ext_req "msExtReq" -#define LN_ms_ext_req "Microsoft Extension Request" -#define NID_ms_ext_req 171 -#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L - -#define SN_ms_code_ind "msCodeInd" -#define LN_ms_code_ind "Microsoft Individual Code Signing" -#define NID_ms_code_ind 134 -#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L - -#define SN_ms_code_com "msCodeCom" -#define LN_ms_code_com "Microsoft Commercial Code Signing" -#define NID_ms_code_com 135 -#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L - -#define SN_ms_ctl_sign "msCTLSign" -#define LN_ms_ctl_sign "Microsoft Trust List Signing" -#define NID_ms_ctl_sign 136 -#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L - -#define SN_ms_sgc "msSGC" -#define LN_ms_sgc "Microsoft Server Gated Crypto" -#define NID_ms_sgc 137 -#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L - -#define SN_ms_efs "msEFS" -#define LN_ms_efs "Microsoft Encrypted File System" -#define NID_ms_efs 138 -#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L - -#define SN_ms_smartcard_login "msSmartcardLogin" -#define LN_ms_smartcard_login "Microsoft Smartcardlogin" -#define NID_ms_smartcard_login 648 -#define OBJ_ms_smartcard_login 1L,3L,6L,1L,4L,1L,311L,20L,2L,2L - -#define SN_ms_upn "msUPN" -#define LN_ms_upn "Microsoft Universal Principal Name" -#define NID_ms_upn 649 -#define OBJ_ms_upn 1L,3L,6L,1L,4L,1L,311L,20L,2L,3L - -#define SN_idea_cbc "IDEA-CBC" -#define LN_idea_cbc "idea-cbc" -#define NID_idea_cbc 34 -#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L - -#define SN_idea_ecb "IDEA-ECB" -#define LN_idea_ecb "idea-ecb" -#define NID_idea_ecb 36 - -#define SN_idea_cfb64 "IDEA-CFB" -#define LN_idea_cfb64 "idea-cfb" -#define NID_idea_cfb64 35 - -#define SN_idea_ofb64 "IDEA-OFB" -#define LN_idea_ofb64 "idea-ofb" -#define NID_idea_ofb64 46 - -#define SN_bf_cbc "BF-CBC" -#define LN_bf_cbc "bf-cbc" -#define NID_bf_cbc 91 -#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L - -#define SN_bf_ecb "BF-ECB" -#define LN_bf_ecb "bf-ecb" -#define NID_bf_ecb 92 - -#define SN_bf_cfb64 "BF-CFB" -#define LN_bf_cfb64 "bf-cfb" -#define NID_bf_cfb64 93 - -#define SN_bf_ofb64 "BF-OFB" -#define LN_bf_ofb64 "bf-ofb" -#define NID_bf_ofb64 94 - -#define SN_id_pkix "PKIX" -#define NID_id_pkix 127 -#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L - -#define SN_id_pkix_mod "id-pkix-mod" -#define NID_id_pkix_mod 258 -#define OBJ_id_pkix_mod OBJ_id_pkix,0L - -#define SN_id_pe "id-pe" -#define NID_id_pe 175 -#define OBJ_id_pe OBJ_id_pkix,1L - -#define SN_id_qt "id-qt" -#define NID_id_qt 259 -#define OBJ_id_qt OBJ_id_pkix,2L - -#define SN_id_kp "id-kp" -#define NID_id_kp 128 -#define OBJ_id_kp OBJ_id_pkix,3L - -#define SN_id_it "id-it" -#define NID_id_it 260 -#define OBJ_id_it OBJ_id_pkix,4L - -#define SN_id_pkip "id-pkip" -#define NID_id_pkip 261 -#define OBJ_id_pkip OBJ_id_pkix,5L - -#define SN_id_alg "id-alg" -#define NID_id_alg 262 -#define OBJ_id_alg OBJ_id_pkix,6L - -#define SN_id_cmc "id-cmc" -#define NID_id_cmc 263 -#define OBJ_id_cmc OBJ_id_pkix,7L - -#define SN_id_on "id-on" -#define NID_id_on 264 -#define OBJ_id_on OBJ_id_pkix,8L - -#define SN_id_pda "id-pda" -#define NID_id_pda 265 -#define OBJ_id_pda OBJ_id_pkix,9L - -#define SN_id_aca "id-aca" -#define NID_id_aca 266 -#define OBJ_id_aca OBJ_id_pkix,10L - -#define SN_id_qcs "id-qcs" -#define NID_id_qcs 267 -#define OBJ_id_qcs OBJ_id_pkix,11L - -#define SN_id_cct "id-cct" -#define NID_id_cct 268 -#define OBJ_id_cct OBJ_id_pkix,12L - -#define SN_id_ppl "id-ppl" -#define NID_id_ppl 662 -#define OBJ_id_ppl OBJ_id_pkix,21L - -#define SN_id_ad "id-ad" -#define NID_id_ad 176 -#define OBJ_id_ad OBJ_id_pkix,48L - -#define SN_id_pkix1_explicit_88 "id-pkix1-explicit-88" -#define NID_id_pkix1_explicit_88 269 -#define OBJ_id_pkix1_explicit_88 OBJ_id_pkix_mod,1L - -#define SN_id_pkix1_implicit_88 "id-pkix1-implicit-88" -#define NID_id_pkix1_implicit_88 270 -#define OBJ_id_pkix1_implicit_88 OBJ_id_pkix_mod,2L - -#define SN_id_pkix1_explicit_93 "id-pkix1-explicit-93" -#define NID_id_pkix1_explicit_93 271 -#define OBJ_id_pkix1_explicit_93 OBJ_id_pkix_mod,3L - -#define SN_id_pkix1_implicit_93 "id-pkix1-implicit-93" -#define NID_id_pkix1_implicit_93 272 -#define OBJ_id_pkix1_implicit_93 OBJ_id_pkix_mod,4L - -#define SN_id_mod_crmf "id-mod-crmf" -#define NID_id_mod_crmf 273 -#define OBJ_id_mod_crmf OBJ_id_pkix_mod,5L - -#define SN_id_mod_cmc "id-mod-cmc" -#define NID_id_mod_cmc 274 -#define OBJ_id_mod_cmc OBJ_id_pkix_mod,6L - -#define SN_id_mod_kea_profile_88 "id-mod-kea-profile-88" -#define NID_id_mod_kea_profile_88 275 -#define OBJ_id_mod_kea_profile_88 OBJ_id_pkix_mod,7L - -#define SN_id_mod_kea_profile_93 "id-mod-kea-profile-93" -#define NID_id_mod_kea_profile_93 276 -#define OBJ_id_mod_kea_profile_93 OBJ_id_pkix_mod,8L - -#define SN_id_mod_cmp "id-mod-cmp" -#define NID_id_mod_cmp 277 -#define OBJ_id_mod_cmp OBJ_id_pkix_mod,9L - -#define SN_id_mod_qualified_cert_88 "id-mod-qualified-cert-88" -#define NID_id_mod_qualified_cert_88 278 -#define OBJ_id_mod_qualified_cert_88 OBJ_id_pkix_mod,10L - -#define SN_id_mod_qualified_cert_93 "id-mod-qualified-cert-93" -#define NID_id_mod_qualified_cert_93 279 -#define OBJ_id_mod_qualified_cert_93 OBJ_id_pkix_mod,11L - -#define SN_id_mod_attribute_cert "id-mod-attribute-cert" -#define NID_id_mod_attribute_cert 280 -#define OBJ_id_mod_attribute_cert OBJ_id_pkix_mod,12L - -#define SN_id_mod_timestamp_protocol "id-mod-timestamp-protocol" -#define NID_id_mod_timestamp_protocol 281 -#define OBJ_id_mod_timestamp_protocol OBJ_id_pkix_mod,13L - -#define SN_id_mod_ocsp "id-mod-ocsp" -#define NID_id_mod_ocsp 282 -#define OBJ_id_mod_ocsp OBJ_id_pkix_mod,14L - -#define SN_id_mod_dvcs "id-mod-dvcs" -#define NID_id_mod_dvcs 283 -#define OBJ_id_mod_dvcs OBJ_id_pkix_mod,15L - -#define SN_id_mod_cmp2000 "id-mod-cmp2000" -#define NID_id_mod_cmp2000 284 -#define OBJ_id_mod_cmp2000 OBJ_id_pkix_mod,16L - -#define SN_info_access "authorityInfoAccess" -#define LN_info_access "Authority Information Access" -#define NID_info_access 177 -#define OBJ_info_access OBJ_id_pe,1L - -#define SN_biometricInfo "biometricInfo" -#define LN_biometricInfo "Biometric Info" -#define NID_biometricInfo 285 -#define OBJ_biometricInfo OBJ_id_pe,2L - -#define SN_qcStatements "qcStatements" -#define NID_qcStatements 286 -#define OBJ_qcStatements OBJ_id_pe,3L - -#define SN_ac_auditEntity "ac-auditEntity" -#define NID_ac_auditEntity 287 -#define OBJ_ac_auditEntity OBJ_id_pe,4L - -#define SN_ac_targeting "ac-targeting" -#define NID_ac_targeting 288 -#define OBJ_ac_targeting OBJ_id_pe,5L - -#define SN_aaControls "aaControls" -#define NID_aaControls 289 -#define OBJ_aaControls OBJ_id_pe,6L - -#define SN_sbgp_ipAddrBlock "sbgp-ipAddrBlock" -#define NID_sbgp_ipAddrBlock 290 -#define OBJ_sbgp_ipAddrBlock OBJ_id_pe,7L - -#define SN_sbgp_autonomousSysNum "sbgp-autonomousSysNum" -#define NID_sbgp_autonomousSysNum 291 -#define OBJ_sbgp_autonomousSysNum OBJ_id_pe,8L - -#define SN_sbgp_routerIdentifier "sbgp-routerIdentifier" -#define NID_sbgp_routerIdentifier 292 -#define OBJ_sbgp_routerIdentifier OBJ_id_pe,9L - -#define SN_ac_proxying "ac-proxying" -#define NID_ac_proxying 397 -#define OBJ_ac_proxying OBJ_id_pe,10L - -#define SN_sinfo_access "subjectInfoAccess" -#define LN_sinfo_access "Subject Information Access" -#define NID_sinfo_access 398 -#define OBJ_sinfo_access OBJ_id_pe,11L - -#define SN_proxyCertInfo "proxyCertInfo" -#define LN_proxyCertInfo "Proxy Certificate Information" -#define NID_proxyCertInfo 663 -#define OBJ_proxyCertInfo OBJ_id_pe,14L - -#define SN_id_qt_cps "id-qt-cps" -#define LN_id_qt_cps "Policy Qualifier CPS" -#define NID_id_qt_cps 164 -#define OBJ_id_qt_cps OBJ_id_qt,1L - -#define SN_id_qt_unotice "id-qt-unotice" -#define LN_id_qt_unotice "Policy Qualifier User Notice" -#define NID_id_qt_unotice 165 -#define OBJ_id_qt_unotice OBJ_id_qt,2L - -#define SN_textNotice "textNotice" -#define NID_textNotice 293 -#define OBJ_textNotice OBJ_id_qt,3L - -#define SN_server_auth "serverAuth" -#define LN_server_auth "TLS Web Server Authentication" -#define NID_server_auth 129 -#define OBJ_server_auth OBJ_id_kp,1L - -#define SN_client_auth "clientAuth" -#define LN_client_auth "TLS Web Client Authentication" -#define NID_client_auth 130 -#define OBJ_client_auth OBJ_id_kp,2L - -#define SN_code_sign "codeSigning" -#define LN_code_sign "Code Signing" -#define NID_code_sign 131 -#define OBJ_code_sign OBJ_id_kp,3L - -#define SN_email_protect "emailProtection" -#define LN_email_protect "E-mail Protection" -#define NID_email_protect 132 -#define OBJ_email_protect OBJ_id_kp,4L - -#define SN_ipsecEndSystem "ipsecEndSystem" -#define LN_ipsecEndSystem "IPSec End System" -#define NID_ipsecEndSystem 294 -#define OBJ_ipsecEndSystem OBJ_id_kp,5L - -#define SN_ipsecTunnel "ipsecTunnel" -#define LN_ipsecTunnel "IPSec Tunnel" -#define NID_ipsecTunnel 295 -#define OBJ_ipsecTunnel OBJ_id_kp,6L - -#define SN_ipsecUser "ipsecUser" -#define LN_ipsecUser "IPSec User" -#define NID_ipsecUser 296 -#define OBJ_ipsecUser OBJ_id_kp,7L - -#define SN_time_stamp "timeStamping" -#define LN_time_stamp "Time Stamping" -#define NID_time_stamp 133 -#define OBJ_time_stamp OBJ_id_kp,8L - -#define SN_OCSP_sign "OCSPSigning" -#define LN_OCSP_sign "OCSP Signing" -#define NID_OCSP_sign 180 -#define OBJ_OCSP_sign OBJ_id_kp,9L - -#define SN_dvcs "DVCS" -#define LN_dvcs "dvcs" -#define NID_dvcs 297 -#define OBJ_dvcs OBJ_id_kp,10L - -#define SN_id_it_caProtEncCert "id-it-caProtEncCert" -#define NID_id_it_caProtEncCert 298 -#define OBJ_id_it_caProtEncCert OBJ_id_it,1L - -#define SN_id_it_signKeyPairTypes "id-it-signKeyPairTypes" -#define NID_id_it_signKeyPairTypes 299 -#define OBJ_id_it_signKeyPairTypes OBJ_id_it,2L - -#define SN_id_it_encKeyPairTypes "id-it-encKeyPairTypes" -#define NID_id_it_encKeyPairTypes 300 -#define OBJ_id_it_encKeyPairTypes OBJ_id_it,3L - -#define SN_id_it_preferredSymmAlg "id-it-preferredSymmAlg" -#define NID_id_it_preferredSymmAlg 301 -#define OBJ_id_it_preferredSymmAlg OBJ_id_it,4L - -#define SN_id_it_caKeyUpdateInfo "id-it-caKeyUpdateInfo" -#define NID_id_it_caKeyUpdateInfo 302 -#define OBJ_id_it_caKeyUpdateInfo OBJ_id_it,5L - -#define SN_id_it_currentCRL "id-it-currentCRL" -#define NID_id_it_currentCRL 303 -#define OBJ_id_it_currentCRL OBJ_id_it,6L - -#define SN_id_it_unsupportedOIDs "id-it-unsupportedOIDs" -#define NID_id_it_unsupportedOIDs 304 -#define OBJ_id_it_unsupportedOIDs OBJ_id_it,7L - -#define SN_id_it_subscriptionRequest "id-it-subscriptionRequest" -#define NID_id_it_subscriptionRequest 305 -#define OBJ_id_it_subscriptionRequest OBJ_id_it,8L - -#define SN_id_it_subscriptionResponse "id-it-subscriptionResponse" -#define NID_id_it_subscriptionResponse 306 -#define OBJ_id_it_subscriptionResponse OBJ_id_it,9L - -#define SN_id_it_keyPairParamReq "id-it-keyPairParamReq" -#define NID_id_it_keyPairParamReq 307 -#define OBJ_id_it_keyPairParamReq OBJ_id_it,10L - -#define SN_id_it_keyPairParamRep "id-it-keyPairParamRep" -#define NID_id_it_keyPairParamRep 308 -#define OBJ_id_it_keyPairParamRep OBJ_id_it,11L - -#define SN_id_it_revPassphrase "id-it-revPassphrase" -#define NID_id_it_revPassphrase 309 -#define OBJ_id_it_revPassphrase OBJ_id_it,12L - -#define SN_id_it_implicitConfirm "id-it-implicitConfirm" -#define NID_id_it_implicitConfirm 310 -#define OBJ_id_it_implicitConfirm OBJ_id_it,13L - -#define SN_id_it_confirmWaitTime "id-it-confirmWaitTime" -#define NID_id_it_confirmWaitTime 311 -#define OBJ_id_it_confirmWaitTime OBJ_id_it,14L - -#define SN_id_it_origPKIMessage "id-it-origPKIMessage" -#define NID_id_it_origPKIMessage 312 -#define OBJ_id_it_origPKIMessage OBJ_id_it,15L - -#define SN_id_it_suppLangTags "id-it-suppLangTags" -#define NID_id_it_suppLangTags 784 -#define OBJ_id_it_suppLangTags OBJ_id_it,16L - -#define SN_id_regCtrl "id-regCtrl" -#define NID_id_regCtrl 313 -#define OBJ_id_regCtrl OBJ_id_pkip,1L - -#define SN_id_regInfo "id-regInfo" -#define NID_id_regInfo 314 -#define OBJ_id_regInfo OBJ_id_pkip,2L - -#define SN_id_regCtrl_regToken "id-regCtrl-regToken" -#define NID_id_regCtrl_regToken 315 -#define OBJ_id_regCtrl_regToken OBJ_id_regCtrl,1L - -#define SN_id_regCtrl_authenticator "id-regCtrl-authenticator" -#define NID_id_regCtrl_authenticator 316 -#define OBJ_id_regCtrl_authenticator OBJ_id_regCtrl,2L - -#define SN_id_regCtrl_pkiPublicationInfo "id-regCtrl-pkiPublicationInfo" -#define NID_id_regCtrl_pkiPublicationInfo 317 -#define OBJ_id_regCtrl_pkiPublicationInfo OBJ_id_regCtrl,3L - -#define SN_id_regCtrl_pkiArchiveOptions "id-regCtrl-pkiArchiveOptions" -#define NID_id_regCtrl_pkiArchiveOptions 318 -#define OBJ_id_regCtrl_pkiArchiveOptions OBJ_id_regCtrl,4L - -#define SN_id_regCtrl_oldCertID "id-regCtrl-oldCertID" -#define NID_id_regCtrl_oldCertID 319 -#define OBJ_id_regCtrl_oldCertID OBJ_id_regCtrl,5L - -#define SN_id_regCtrl_protocolEncrKey "id-regCtrl-protocolEncrKey" -#define NID_id_regCtrl_protocolEncrKey 320 -#define OBJ_id_regCtrl_protocolEncrKey OBJ_id_regCtrl,6L - -#define SN_id_regInfo_utf8Pairs "id-regInfo-utf8Pairs" -#define NID_id_regInfo_utf8Pairs 321 -#define OBJ_id_regInfo_utf8Pairs OBJ_id_regInfo,1L - -#define SN_id_regInfo_certReq "id-regInfo-certReq" -#define NID_id_regInfo_certReq 322 -#define OBJ_id_regInfo_certReq OBJ_id_regInfo,2L - -#define SN_id_alg_des40 "id-alg-des40" -#define NID_id_alg_des40 323 -#define OBJ_id_alg_des40 OBJ_id_alg,1L - -#define SN_id_alg_noSignature "id-alg-noSignature" -#define NID_id_alg_noSignature 324 -#define OBJ_id_alg_noSignature OBJ_id_alg,2L - -#define SN_id_alg_dh_sig_hmac_sha1 "id-alg-dh-sig-hmac-sha1" -#define NID_id_alg_dh_sig_hmac_sha1 325 -#define OBJ_id_alg_dh_sig_hmac_sha1 OBJ_id_alg,3L - -#define SN_id_alg_dh_pop "id-alg-dh-pop" -#define NID_id_alg_dh_pop 326 -#define OBJ_id_alg_dh_pop OBJ_id_alg,4L - -#define SN_id_cmc_statusInfo "id-cmc-statusInfo" -#define NID_id_cmc_statusInfo 327 -#define OBJ_id_cmc_statusInfo OBJ_id_cmc,1L - -#define SN_id_cmc_identification "id-cmc-identification" -#define NID_id_cmc_identification 328 -#define OBJ_id_cmc_identification OBJ_id_cmc,2L - -#define SN_id_cmc_identityProof "id-cmc-identityProof" -#define NID_id_cmc_identityProof 329 -#define OBJ_id_cmc_identityProof OBJ_id_cmc,3L - -#define SN_id_cmc_dataReturn "id-cmc-dataReturn" -#define NID_id_cmc_dataReturn 330 -#define OBJ_id_cmc_dataReturn OBJ_id_cmc,4L - -#define SN_id_cmc_transactionId "id-cmc-transactionId" -#define NID_id_cmc_transactionId 331 -#define OBJ_id_cmc_transactionId OBJ_id_cmc,5L - -#define SN_id_cmc_senderNonce "id-cmc-senderNonce" -#define NID_id_cmc_senderNonce 332 -#define OBJ_id_cmc_senderNonce OBJ_id_cmc,6L - -#define SN_id_cmc_recipientNonce "id-cmc-recipientNonce" -#define NID_id_cmc_recipientNonce 333 -#define OBJ_id_cmc_recipientNonce OBJ_id_cmc,7L - -#define SN_id_cmc_addExtensions "id-cmc-addExtensions" -#define NID_id_cmc_addExtensions 334 -#define OBJ_id_cmc_addExtensions OBJ_id_cmc,8L - -#define SN_id_cmc_encryptedPOP "id-cmc-encryptedPOP" -#define NID_id_cmc_encryptedPOP 335 -#define OBJ_id_cmc_encryptedPOP OBJ_id_cmc,9L - -#define SN_id_cmc_decryptedPOP "id-cmc-decryptedPOP" -#define NID_id_cmc_decryptedPOP 336 -#define OBJ_id_cmc_decryptedPOP OBJ_id_cmc,10L - -#define SN_id_cmc_lraPOPWitness "id-cmc-lraPOPWitness" -#define NID_id_cmc_lraPOPWitness 337 -#define OBJ_id_cmc_lraPOPWitness OBJ_id_cmc,11L - -#define SN_id_cmc_getCert "id-cmc-getCert" -#define NID_id_cmc_getCert 338 -#define OBJ_id_cmc_getCert OBJ_id_cmc,15L - -#define SN_id_cmc_getCRL "id-cmc-getCRL" -#define NID_id_cmc_getCRL 339 -#define OBJ_id_cmc_getCRL OBJ_id_cmc,16L - -#define SN_id_cmc_revokeRequest "id-cmc-revokeRequest" -#define NID_id_cmc_revokeRequest 340 -#define OBJ_id_cmc_revokeRequest OBJ_id_cmc,17L - -#define SN_id_cmc_regInfo "id-cmc-regInfo" -#define NID_id_cmc_regInfo 341 -#define OBJ_id_cmc_regInfo OBJ_id_cmc,18L - -#define SN_id_cmc_responseInfo "id-cmc-responseInfo" -#define NID_id_cmc_responseInfo 342 -#define OBJ_id_cmc_responseInfo OBJ_id_cmc,19L - -#define SN_id_cmc_queryPending "id-cmc-queryPending" -#define NID_id_cmc_queryPending 343 -#define OBJ_id_cmc_queryPending OBJ_id_cmc,21L - -#define SN_id_cmc_popLinkRandom "id-cmc-popLinkRandom" -#define NID_id_cmc_popLinkRandom 344 -#define OBJ_id_cmc_popLinkRandom OBJ_id_cmc,22L - -#define SN_id_cmc_popLinkWitness "id-cmc-popLinkWitness" -#define NID_id_cmc_popLinkWitness 345 -#define OBJ_id_cmc_popLinkWitness OBJ_id_cmc,23L - -#define SN_id_cmc_confirmCertAcceptance "id-cmc-confirmCertAcceptance" -#define NID_id_cmc_confirmCertAcceptance 346 -#define OBJ_id_cmc_confirmCertAcceptance OBJ_id_cmc,24L - -#define SN_id_on_personalData "id-on-personalData" -#define NID_id_on_personalData 347 -#define OBJ_id_on_personalData OBJ_id_on,1L - -#define SN_id_on_permanentIdentifier "id-on-permanentIdentifier" -#define LN_id_on_permanentIdentifier "Permanent Identifier" -#define NID_id_on_permanentIdentifier 858 -#define OBJ_id_on_permanentIdentifier OBJ_id_on,3L - -#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth" -#define NID_id_pda_dateOfBirth 348 -#define OBJ_id_pda_dateOfBirth OBJ_id_pda,1L - -#define SN_id_pda_placeOfBirth "id-pda-placeOfBirth" -#define NID_id_pda_placeOfBirth 349 -#define OBJ_id_pda_placeOfBirth OBJ_id_pda,2L - -#define SN_id_pda_gender "id-pda-gender" -#define NID_id_pda_gender 351 -#define OBJ_id_pda_gender OBJ_id_pda,3L - -#define SN_id_pda_countryOfCitizenship "id-pda-countryOfCitizenship" -#define NID_id_pda_countryOfCitizenship 352 -#define OBJ_id_pda_countryOfCitizenship OBJ_id_pda,4L - -#define SN_id_pda_countryOfResidence "id-pda-countryOfResidence" -#define NID_id_pda_countryOfResidence 353 -#define OBJ_id_pda_countryOfResidence OBJ_id_pda,5L - -#define SN_id_aca_authenticationInfo "id-aca-authenticationInfo" -#define NID_id_aca_authenticationInfo 354 -#define OBJ_id_aca_authenticationInfo OBJ_id_aca,1L - -#define SN_id_aca_accessIdentity "id-aca-accessIdentity" -#define NID_id_aca_accessIdentity 355 -#define OBJ_id_aca_accessIdentity OBJ_id_aca,2L - -#define SN_id_aca_chargingIdentity "id-aca-chargingIdentity" -#define NID_id_aca_chargingIdentity 356 -#define OBJ_id_aca_chargingIdentity OBJ_id_aca,3L - -#define SN_id_aca_group "id-aca-group" -#define NID_id_aca_group 357 -#define OBJ_id_aca_group OBJ_id_aca,4L - -#define SN_id_aca_role "id-aca-role" -#define NID_id_aca_role 358 -#define OBJ_id_aca_role OBJ_id_aca,5L - -#define SN_id_aca_encAttrs "id-aca-encAttrs" -#define NID_id_aca_encAttrs 399 -#define OBJ_id_aca_encAttrs OBJ_id_aca,6L - -#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1" -#define NID_id_qcs_pkixQCSyntax_v1 359 -#define OBJ_id_qcs_pkixQCSyntax_v1 OBJ_id_qcs,1L - -#define SN_id_cct_crs "id-cct-crs" -#define NID_id_cct_crs 360 -#define OBJ_id_cct_crs OBJ_id_cct,1L - -#define SN_id_cct_PKIData "id-cct-PKIData" -#define NID_id_cct_PKIData 361 -#define OBJ_id_cct_PKIData OBJ_id_cct,2L - -#define SN_id_cct_PKIResponse "id-cct-PKIResponse" -#define NID_id_cct_PKIResponse 362 -#define OBJ_id_cct_PKIResponse OBJ_id_cct,3L - -#define SN_id_ppl_anyLanguage "id-ppl-anyLanguage" -#define LN_id_ppl_anyLanguage "Any language" -#define NID_id_ppl_anyLanguage 664 -#define OBJ_id_ppl_anyLanguage OBJ_id_ppl,0L - -#define SN_id_ppl_inheritAll "id-ppl-inheritAll" -#define LN_id_ppl_inheritAll "Inherit all" -#define NID_id_ppl_inheritAll 665 -#define OBJ_id_ppl_inheritAll OBJ_id_ppl,1L - -#define SN_Independent "id-ppl-independent" -#define LN_Independent "Independent" -#define NID_Independent 667 -#define OBJ_Independent OBJ_id_ppl,2L - -#define SN_ad_OCSP "OCSP" -#define LN_ad_OCSP "OCSP" -#define NID_ad_OCSP 178 -#define OBJ_ad_OCSP OBJ_id_ad,1L - -#define SN_ad_ca_issuers "caIssuers" -#define LN_ad_ca_issuers "CA Issuers" -#define NID_ad_ca_issuers 179 -#define OBJ_ad_ca_issuers OBJ_id_ad,2L - -#define SN_ad_timeStamping "ad_timestamping" -#define LN_ad_timeStamping "AD Time Stamping" -#define NID_ad_timeStamping 363 -#define OBJ_ad_timeStamping OBJ_id_ad,3L - -#define SN_ad_dvcs "AD_DVCS" -#define LN_ad_dvcs "ad dvcs" -#define NID_ad_dvcs 364 -#define OBJ_ad_dvcs OBJ_id_ad,4L - -#define SN_caRepository "caRepository" -#define LN_caRepository "CA Repository" -#define NID_caRepository 785 -#define OBJ_caRepository OBJ_id_ad,5L - -#define OBJ_id_pkix_OCSP OBJ_ad_OCSP - -#define SN_id_pkix_OCSP_basic "basicOCSPResponse" -#define LN_id_pkix_OCSP_basic "Basic OCSP Response" -#define NID_id_pkix_OCSP_basic 365 -#define OBJ_id_pkix_OCSP_basic OBJ_id_pkix_OCSP,1L - -#define SN_id_pkix_OCSP_Nonce "Nonce" -#define LN_id_pkix_OCSP_Nonce "OCSP Nonce" -#define NID_id_pkix_OCSP_Nonce 366 -#define OBJ_id_pkix_OCSP_Nonce OBJ_id_pkix_OCSP,2L - -#define SN_id_pkix_OCSP_CrlID "CrlID" -#define LN_id_pkix_OCSP_CrlID "OCSP CRL ID" -#define NID_id_pkix_OCSP_CrlID 367 -#define OBJ_id_pkix_OCSP_CrlID OBJ_id_pkix_OCSP,3L - -#define SN_id_pkix_OCSP_acceptableResponses "acceptableResponses" -#define LN_id_pkix_OCSP_acceptableResponses "Acceptable OCSP Responses" -#define NID_id_pkix_OCSP_acceptableResponses 368 -#define OBJ_id_pkix_OCSP_acceptableResponses OBJ_id_pkix_OCSP,4L - -#define SN_id_pkix_OCSP_noCheck "noCheck" -#define LN_id_pkix_OCSP_noCheck "OCSP No Check" -#define NID_id_pkix_OCSP_noCheck 369 -#define OBJ_id_pkix_OCSP_noCheck OBJ_id_pkix_OCSP,5L - -#define SN_id_pkix_OCSP_archiveCutoff "archiveCutoff" -#define LN_id_pkix_OCSP_archiveCutoff "OCSP Archive Cutoff" -#define NID_id_pkix_OCSP_archiveCutoff 370 -#define OBJ_id_pkix_OCSP_archiveCutoff OBJ_id_pkix_OCSP,6L - -#define SN_id_pkix_OCSP_serviceLocator "serviceLocator" -#define LN_id_pkix_OCSP_serviceLocator "OCSP Service Locator" -#define NID_id_pkix_OCSP_serviceLocator 371 -#define OBJ_id_pkix_OCSP_serviceLocator OBJ_id_pkix_OCSP,7L - -#define SN_id_pkix_OCSP_extendedStatus "extendedStatus" -#define LN_id_pkix_OCSP_extendedStatus "Extended OCSP Status" -#define NID_id_pkix_OCSP_extendedStatus 372 -#define OBJ_id_pkix_OCSP_extendedStatus OBJ_id_pkix_OCSP,8L - -#define SN_id_pkix_OCSP_valid "valid" -#define NID_id_pkix_OCSP_valid 373 -#define OBJ_id_pkix_OCSP_valid OBJ_id_pkix_OCSP,9L - -#define SN_id_pkix_OCSP_path "path" -#define NID_id_pkix_OCSP_path 374 -#define OBJ_id_pkix_OCSP_path OBJ_id_pkix_OCSP,10L - -#define SN_id_pkix_OCSP_trustRoot "trustRoot" -#define LN_id_pkix_OCSP_trustRoot "Trust Root" -#define NID_id_pkix_OCSP_trustRoot 375 -#define OBJ_id_pkix_OCSP_trustRoot OBJ_id_pkix_OCSP,11L - -#define SN_algorithm "algorithm" -#define LN_algorithm "algorithm" -#define NID_algorithm 376 -#define OBJ_algorithm 1L,3L,14L,3L,2L - -#define SN_md5WithRSA "RSA-NP-MD5" -#define LN_md5WithRSA "md5WithRSA" -#define NID_md5WithRSA 104 -#define OBJ_md5WithRSA OBJ_algorithm,3L - -#define SN_des_ecb "DES-ECB" -#define LN_des_ecb "des-ecb" -#define NID_des_ecb 29 -#define OBJ_des_ecb OBJ_algorithm,6L - -#define SN_des_cbc "DES-CBC" -#define LN_des_cbc "des-cbc" -#define NID_des_cbc 31 -#define OBJ_des_cbc OBJ_algorithm,7L - -#define SN_des_ofb64 "DES-OFB" -#define LN_des_ofb64 "des-ofb" -#define NID_des_ofb64 45 -#define OBJ_des_ofb64 OBJ_algorithm,8L - -#define SN_des_cfb64 "DES-CFB" -#define LN_des_cfb64 "des-cfb" -#define NID_des_cfb64 30 -#define OBJ_des_cfb64 OBJ_algorithm,9L - -#define SN_rsaSignature "rsaSignature" -#define NID_rsaSignature 377 -#define OBJ_rsaSignature OBJ_algorithm,11L - -#define SN_dsa_2 "DSA-old" -#define LN_dsa_2 "dsaEncryption-old" -#define NID_dsa_2 67 -#define OBJ_dsa_2 OBJ_algorithm,12L - -#define SN_dsaWithSHA "DSA-SHA" -#define LN_dsaWithSHA "dsaWithSHA" -#define NID_dsaWithSHA 66 -#define OBJ_dsaWithSHA OBJ_algorithm,13L - -#define SN_shaWithRSAEncryption "RSA-SHA" -#define LN_shaWithRSAEncryption "shaWithRSAEncryption" -#define NID_shaWithRSAEncryption 42 -#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L - -#define SN_des_ede_ecb "DES-EDE" -#define LN_des_ede_ecb "des-ede" -#define NID_des_ede_ecb 32 -#define OBJ_des_ede_ecb OBJ_algorithm,17L - -#define SN_des_ede3_ecb "DES-EDE3" -#define LN_des_ede3_ecb "des-ede3" -#define NID_des_ede3_ecb 33 - -#define SN_des_ede_cbc "DES-EDE-CBC" -#define LN_des_ede_cbc "des-ede-cbc" -#define NID_des_ede_cbc 43 - -#define SN_des_ede_cfb64 "DES-EDE-CFB" -#define LN_des_ede_cfb64 "des-ede-cfb" -#define NID_des_ede_cfb64 60 - -#define SN_des_ede3_cfb64 "DES-EDE3-CFB" -#define LN_des_ede3_cfb64 "des-ede3-cfb" -#define NID_des_ede3_cfb64 61 - -#define SN_des_ede_ofb64 "DES-EDE-OFB" -#define LN_des_ede_ofb64 "des-ede-ofb" -#define NID_des_ede_ofb64 62 - -#define SN_des_ede3_ofb64 "DES-EDE3-OFB" -#define LN_des_ede3_ofb64 "des-ede3-ofb" -#define NID_des_ede3_ofb64 63 - -#define SN_desx_cbc "DESX-CBC" -#define LN_desx_cbc "desx-cbc" -#define NID_desx_cbc 80 - -#define SN_sha "SHA" -#define LN_sha "sha" -#define NID_sha 41 -#define OBJ_sha OBJ_algorithm,18L - -#define SN_sha1 "SHA1" -#define LN_sha1 "sha1" -#define NID_sha1 64 -#define OBJ_sha1 OBJ_algorithm,26L - -#define SN_dsaWithSHA1_2 "DSA-SHA1-old" -#define LN_dsaWithSHA1_2 "dsaWithSHA1-old" -#define NID_dsaWithSHA1_2 70 -#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L - -#define SN_sha1WithRSA "RSA-SHA1-2" -#define LN_sha1WithRSA "sha1WithRSA" -#define NID_sha1WithRSA 115 -#define OBJ_sha1WithRSA OBJ_algorithm,29L - -#define SN_ripemd160 "RIPEMD160" -#define LN_ripemd160 "ripemd160" -#define NID_ripemd160 117 -#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L - -#define SN_ripemd160WithRSA "RSA-RIPEMD160" -#define LN_ripemd160WithRSA "ripemd160WithRSA" -#define NID_ripemd160WithRSA 119 -#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L - -#define SN_sxnet "SXNetID" -#define LN_sxnet "Strong Extranet ID" -#define NID_sxnet 143 -#define OBJ_sxnet 1L,3L,101L,1L,4L,1L - -#define SN_X500 "X500" -#define LN_X500 "directory services (X.500)" -#define NID_X500 11 -#define OBJ_X500 2L,5L - -#define SN_X509 "X509" -#define NID_X509 12 -#define OBJ_X509 OBJ_X500,4L - -#define SN_commonName "CN" -#define LN_commonName "commonName" -#define NID_commonName 13 -#define OBJ_commonName OBJ_X509,3L - -#define SN_surname "SN" -#define LN_surname "surname" -#define NID_surname 100 -#define OBJ_surname OBJ_X509,4L - -#define LN_serialNumber "serialNumber" -#define NID_serialNumber 105 -#define OBJ_serialNumber OBJ_X509,5L - -#define SN_countryName "C" -#define LN_countryName "countryName" -#define NID_countryName 14 -#define OBJ_countryName OBJ_X509,6L - -#define SN_localityName "L" -#define LN_localityName "localityName" -#define NID_localityName 15 -#define OBJ_localityName OBJ_X509,7L - -#define SN_stateOrProvinceName "ST" -#define LN_stateOrProvinceName "stateOrProvinceName" -#define NID_stateOrProvinceName 16 -#define OBJ_stateOrProvinceName OBJ_X509,8L - -#define SN_streetAddress "street" -#define LN_streetAddress "streetAddress" -#define NID_streetAddress 660 -#define OBJ_streetAddress OBJ_X509,9L - -#define SN_organizationName "O" -#define LN_organizationName "organizationName" -#define NID_organizationName 17 -#define OBJ_organizationName OBJ_X509,10L - -#define SN_organizationalUnitName "OU" -#define LN_organizationalUnitName "organizationalUnitName" -#define NID_organizationalUnitName 18 -#define OBJ_organizationalUnitName OBJ_X509,11L - -#define SN_title "title" -#define LN_title "title" -#define NID_title 106 -#define OBJ_title OBJ_X509,12L - -#define LN_description "description" -#define NID_description 107 -#define OBJ_description OBJ_X509,13L - -#define LN_searchGuide "searchGuide" -#define NID_searchGuide 859 -#define OBJ_searchGuide OBJ_X509,14L - -#define LN_businessCategory "businessCategory" -#define NID_businessCategory 860 -#define OBJ_businessCategory OBJ_X509,15L - -#define LN_postalAddress "postalAddress" -#define NID_postalAddress 861 -#define OBJ_postalAddress OBJ_X509,16L - -#define LN_postalCode "postalCode" -#define NID_postalCode 661 -#define OBJ_postalCode OBJ_X509,17L - -#define LN_postOfficeBox "postOfficeBox" -#define NID_postOfficeBox 862 -#define OBJ_postOfficeBox OBJ_X509,18L - -#define LN_physicalDeliveryOfficeName "physicalDeliveryOfficeName" -#define NID_physicalDeliveryOfficeName 863 -#define OBJ_physicalDeliveryOfficeName OBJ_X509,19L - -#define LN_telephoneNumber "telephoneNumber" -#define NID_telephoneNumber 864 -#define OBJ_telephoneNumber OBJ_X509,20L - -#define LN_telexNumber "telexNumber" -#define NID_telexNumber 865 -#define OBJ_telexNumber OBJ_X509,21L - -#define LN_teletexTerminalIdentifier "teletexTerminalIdentifier" -#define NID_teletexTerminalIdentifier 866 -#define OBJ_teletexTerminalIdentifier OBJ_X509,22L - -#define LN_facsimileTelephoneNumber "facsimileTelephoneNumber" -#define NID_facsimileTelephoneNumber 867 -#define OBJ_facsimileTelephoneNumber OBJ_X509,23L - -#define LN_x121Address "x121Address" -#define NID_x121Address 868 -#define OBJ_x121Address OBJ_X509,24L - -#define LN_internationaliSDNNumber "internationaliSDNNumber" -#define NID_internationaliSDNNumber 869 -#define OBJ_internationaliSDNNumber OBJ_X509,25L - -#define LN_registeredAddress "registeredAddress" -#define NID_registeredAddress 870 -#define OBJ_registeredAddress OBJ_X509,26L - -#define LN_destinationIndicator "destinationIndicator" -#define NID_destinationIndicator 871 -#define OBJ_destinationIndicator OBJ_X509,27L - -#define LN_preferredDeliveryMethod "preferredDeliveryMethod" -#define NID_preferredDeliveryMethod 872 -#define OBJ_preferredDeliveryMethod OBJ_X509,28L - -#define LN_presentationAddress "presentationAddress" -#define NID_presentationAddress 873 -#define OBJ_presentationAddress OBJ_X509,29L - -#define LN_supportedApplicationContext "supportedApplicationContext" -#define NID_supportedApplicationContext 874 -#define OBJ_supportedApplicationContext OBJ_X509,30L - -#define SN_member "member" -#define NID_member 875 -#define OBJ_member OBJ_X509,31L - -#define SN_owner "owner" -#define NID_owner 876 -#define OBJ_owner OBJ_X509,32L - -#define LN_roleOccupant "roleOccupant" -#define NID_roleOccupant 877 -#define OBJ_roleOccupant OBJ_X509,33L - -#define SN_seeAlso "seeAlso" -#define NID_seeAlso 878 -#define OBJ_seeAlso OBJ_X509,34L - -#define LN_userPassword "userPassword" -#define NID_userPassword 879 -#define OBJ_userPassword OBJ_X509,35L - -#define LN_userCertificate "userCertificate" -#define NID_userCertificate 880 -#define OBJ_userCertificate OBJ_X509,36L - -#define LN_cACertificate "cACertificate" -#define NID_cACertificate 881 -#define OBJ_cACertificate OBJ_X509,37L - -#define LN_authorityRevocationList "authorityRevocationList" -#define NID_authorityRevocationList 882 -#define OBJ_authorityRevocationList OBJ_X509,38L - -#define LN_certificateRevocationList "certificateRevocationList" -#define NID_certificateRevocationList 883 -#define OBJ_certificateRevocationList OBJ_X509,39L - -#define LN_crossCertificatePair "crossCertificatePair" -#define NID_crossCertificatePair 884 -#define OBJ_crossCertificatePair OBJ_X509,40L - -#define SN_name "name" -#define LN_name "name" -#define NID_name 173 -#define OBJ_name OBJ_X509,41L - -#define SN_givenName "GN" -#define LN_givenName "givenName" -#define NID_givenName 99 -#define OBJ_givenName OBJ_X509,42L - -#define SN_initials "initials" -#define LN_initials "initials" -#define NID_initials 101 -#define OBJ_initials OBJ_X509,43L - -#define LN_generationQualifier "generationQualifier" -#define NID_generationQualifier 509 -#define OBJ_generationQualifier OBJ_X509,44L - -#define LN_x500UniqueIdentifier "x500UniqueIdentifier" -#define NID_x500UniqueIdentifier 503 -#define OBJ_x500UniqueIdentifier OBJ_X509,45L - -#define SN_dnQualifier "dnQualifier" -#define LN_dnQualifier "dnQualifier" -#define NID_dnQualifier 174 -#define OBJ_dnQualifier OBJ_X509,46L - -#define LN_enhancedSearchGuide "enhancedSearchGuide" -#define NID_enhancedSearchGuide 885 -#define OBJ_enhancedSearchGuide OBJ_X509,47L - -#define LN_protocolInformation "protocolInformation" -#define NID_protocolInformation 886 -#define OBJ_protocolInformation OBJ_X509,48L - -#define LN_distinguishedName "distinguishedName" -#define NID_distinguishedName 887 -#define OBJ_distinguishedName OBJ_X509,49L - -#define LN_uniqueMember "uniqueMember" -#define NID_uniqueMember 888 -#define OBJ_uniqueMember OBJ_X509,50L - -#define LN_houseIdentifier "houseIdentifier" -#define NID_houseIdentifier 889 -#define OBJ_houseIdentifier OBJ_X509,51L - -#define LN_supportedAlgorithms "supportedAlgorithms" -#define NID_supportedAlgorithms 890 -#define OBJ_supportedAlgorithms OBJ_X509,52L - -#define LN_deltaRevocationList "deltaRevocationList" -#define NID_deltaRevocationList 891 -#define OBJ_deltaRevocationList OBJ_X509,53L - -#define SN_dmdName "dmdName" -#define NID_dmdName 892 -#define OBJ_dmdName OBJ_X509,54L - -#define LN_pseudonym "pseudonym" -#define NID_pseudonym 510 -#define OBJ_pseudonym OBJ_X509,65L - -#define SN_role "role" -#define LN_role "role" -#define NID_role 400 -#define OBJ_role OBJ_X509,72L - -#define SN_X500algorithms "X500algorithms" -#define LN_X500algorithms "directory services - algorithms" -#define NID_X500algorithms 378 -#define OBJ_X500algorithms OBJ_X500,8L - -#define SN_rsa "RSA" -#define LN_rsa "rsa" -#define NID_rsa 19 -#define OBJ_rsa OBJ_X500algorithms,1L,1L - -#define SN_mdc2WithRSA "RSA-MDC2" -#define LN_mdc2WithRSA "mdc2WithRSA" -#define NID_mdc2WithRSA 96 -#define OBJ_mdc2WithRSA OBJ_X500algorithms,3L,100L - -#define SN_mdc2 "MDC2" -#define LN_mdc2 "mdc2" -#define NID_mdc2 95 -#define OBJ_mdc2 OBJ_X500algorithms,3L,101L - -#define SN_id_ce "id-ce" -#define NID_id_ce 81 -#define OBJ_id_ce OBJ_X500,29L - -#define SN_subject_directory_attributes "subjectDirectoryAttributes" -#define LN_subject_directory_attributes "X509v3 Subject Directory Attributes" -#define NID_subject_directory_attributes 769 -#define OBJ_subject_directory_attributes OBJ_id_ce,9L - -#define SN_subject_key_identifier "subjectKeyIdentifier" -#define LN_subject_key_identifier "X509v3 Subject Key Identifier" -#define NID_subject_key_identifier 82 -#define OBJ_subject_key_identifier OBJ_id_ce,14L - -#define SN_key_usage "keyUsage" -#define LN_key_usage "X509v3 Key Usage" -#define NID_key_usage 83 -#define OBJ_key_usage OBJ_id_ce,15L - -#define SN_private_key_usage_period "privateKeyUsagePeriod" -#define LN_private_key_usage_period "X509v3 Private Key Usage Period" -#define NID_private_key_usage_period 84 -#define OBJ_private_key_usage_period OBJ_id_ce,16L - -#define SN_subject_alt_name "subjectAltName" -#define LN_subject_alt_name "X509v3 Subject Alternative Name" -#define NID_subject_alt_name 85 -#define OBJ_subject_alt_name OBJ_id_ce,17L - -#define SN_issuer_alt_name "issuerAltName" -#define LN_issuer_alt_name "X509v3 Issuer Alternative Name" -#define NID_issuer_alt_name 86 -#define OBJ_issuer_alt_name OBJ_id_ce,18L - -#define SN_basic_constraints "basicConstraints" -#define LN_basic_constraints "X509v3 Basic Constraints" -#define NID_basic_constraints 87 -#define OBJ_basic_constraints OBJ_id_ce,19L - -#define SN_crl_number "crlNumber" -#define LN_crl_number "X509v3 CRL Number" -#define NID_crl_number 88 -#define OBJ_crl_number OBJ_id_ce,20L - -#define SN_crl_reason "CRLReason" -#define LN_crl_reason "X509v3 CRL Reason Code" -#define NID_crl_reason 141 -#define OBJ_crl_reason OBJ_id_ce,21L - -#define SN_invalidity_date "invalidityDate" -#define LN_invalidity_date "Invalidity Date" -#define NID_invalidity_date 142 -#define OBJ_invalidity_date OBJ_id_ce,24L - -#define SN_delta_crl "deltaCRL" -#define LN_delta_crl "X509v3 Delta CRL Indicator" -#define NID_delta_crl 140 -#define OBJ_delta_crl OBJ_id_ce,27L - -#define SN_issuing_distribution_point "issuingDistributionPoint" -#define LN_issuing_distribution_point "X509v3 Issuing Distrubution Point" -#define NID_issuing_distribution_point 770 -#define OBJ_issuing_distribution_point OBJ_id_ce,28L - -#define SN_certificate_issuer "certificateIssuer" -#define LN_certificate_issuer "X509v3 Certificate Issuer" -#define NID_certificate_issuer 771 -#define OBJ_certificate_issuer OBJ_id_ce,29L - -#define SN_name_constraints "nameConstraints" -#define LN_name_constraints "X509v3 Name Constraints" -#define NID_name_constraints 666 -#define OBJ_name_constraints OBJ_id_ce,30L - -#define SN_crl_distribution_points "crlDistributionPoints" -#define LN_crl_distribution_points "X509v3 CRL Distribution Points" -#define NID_crl_distribution_points 103 -#define OBJ_crl_distribution_points OBJ_id_ce,31L - -#define SN_certificate_policies "certificatePolicies" -#define LN_certificate_policies "X509v3 Certificate Policies" -#define NID_certificate_policies 89 -#define OBJ_certificate_policies OBJ_id_ce,32L - -#define SN_any_policy "anyPolicy" -#define LN_any_policy "X509v3 Any Policy" -#define NID_any_policy 746 -#define OBJ_any_policy OBJ_certificate_policies,0L - -#define SN_policy_mappings "policyMappings" -#define LN_policy_mappings "X509v3 Policy Mappings" -#define NID_policy_mappings 747 -#define OBJ_policy_mappings OBJ_id_ce,33L - -#define SN_authority_key_identifier "authorityKeyIdentifier" -#define LN_authority_key_identifier "X509v3 Authority Key Identifier" -#define NID_authority_key_identifier 90 -#define OBJ_authority_key_identifier OBJ_id_ce,35L - -#define SN_policy_constraints "policyConstraints" -#define LN_policy_constraints "X509v3 Policy Constraints" -#define NID_policy_constraints 401 -#define OBJ_policy_constraints OBJ_id_ce,36L - -#define SN_ext_key_usage "extendedKeyUsage" -#define LN_ext_key_usage "X509v3 Extended Key Usage" -#define NID_ext_key_usage 126 -#define OBJ_ext_key_usage OBJ_id_ce,37L - -#define SN_freshest_crl "freshestCRL" -#define LN_freshest_crl "X509v3 Freshest CRL" -#define NID_freshest_crl 857 -#define OBJ_freshest_crl OBJ_id_ce,46L - -#define SN_inhibit_any_policy "inhibitAnyPolicy" -#define LN_inhibit_any_policy "X509v3 Inhibit Any Policy" -#define NID_inhibit_any_policy 748 -#define OBJ_inhibit_any_policy OBJ_id_ce,54L - -#define SN_target_information "targetInformation" -#define LN_target_information "X509v3 AC Targeting" -#define NID_target_information 402 -#define OBJ_target_information OBJ_id_ce,55L - -#define SN_no_rev_avail "noRevAvail" -#define LN_no_rev_avail "X509v3 No Revocation Available" -#define NID_no_rev_avail 403 -#define OBJ_no_rev_avail OBJ_id_ce,56L - -#define SN_anyExtendedKeyUsage "anyExtendedKeyUsage" -#define LN_anyExtendedKeyUsage "Any Extended Key Usage" -#define NID_anyExtendedKeyUsage 910 -#define OBJ_anyExtendedKeyUsage OBJ_ext_key_usage,0L - -#define SN_netscape "Netscape" -#define LN_netscape "Netscape Communications Corp." -#define NID_netscape 57 -#define OBJ_netscape 2L,16L,840L,1L,113730L - -#define SN_netscape_cert_extension "nsCertExt" -#define LN_netscape_cert_extension "Netscape Certificate Extension" -#define NID_netscape_cert_extension 58 -#define OBJ_netscape_cert_extension OBJ_netscape,1L - -#define SN_netscape_data_type "nsDataType" -#define LN_netscape_data_type "Netscape Data Type" -#define NID_netscape_data_type 59 -#define OBJ_netscape_data_type OBJ_netscape,2L - -#define SN_netscape_cert_type "nsCertType" -#define LN_netscape_cert_type "Netscape Cert Type" -#define NID_netscape_cert_type 71 -#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L - -#define SN_netscape_base_url "nsBaseUrl" -#define LN_netscape_base_url "Netscape Base Url" -#define NID_netscape_base_url 72 -#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L - -#define SN_netscape_revocation_url "nsRevocationUrl" -#define LN_netscape_revocation_url "Netscape Revocation Url" -#define NID_netscape_revocation_url 73 -#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L - -#define SN_netscape_ca_revocation_url "nsCaRevocationUrl" -#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url" -#define NID_netscape_ca_revocation_url 74 -#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L - -#define SN_netscape_renewal_url "nsRenewalUrl" -#define LN_netscape_renewal_url "Netscape Renewal Url" -#define NID_netscape_renewal_url 75 -#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L - -#define SN_netscape_ca_policy_url "nsCaPolicyUrl" -#define LN_netscape_ca_policy_url "Netscape CA Policy Url" -#define NID_netscape_ca_policy_url 76 -#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L - -#define SN_netscape_ssl_server_name "nsSslServerName" -#define LN_netscape_ssl_server_name "Netscape SSL Server Name" -#define NID_netscape_ssl_server_name 77 -#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L - -#define SN_netscape_comment "nsComment" -#define LN_netscape_comment "Netscape Comment" -#define NID_netscape_comment 78 -#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L - -#define SN_netscape_cert_sequence "nsCertSequence" -#define LN_netscape_cert_sequence "Netscape Certificate Sequence" -#define NID_netscape_cert_sequence 79 -#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L - -#define SN_ns_sgc "nsSGC" -#define LN_ns_sgc "Netscape Server Gated Crypto" -#define NID_ns_sgc 139 -#define OBJ_ns_sgc OBJ_netscape,4L,1L - -#define SN_org "ORG" -#define LN_org "org" -#define NID_org 379 -#define OBJ_org OBJ_iso,3L - -#define SN_dod "DOD" -#define LN_dod "dod" -#define NID_dod 380 -#define OBJ_dod OBJ_org,6L - -#define SN_iana "IANA" -#define LN_iana "iana" -#define NID_iana 381 -#define OBJ_iana OBJ_dod,1L - -#define OBJ_internet OBJ_iana - -#define SN_Directory "directory" -#define LN_Directory "Directory" -#define NID_Directory 382 -#define OBJ_Directory OBJ_internet,1L - -#define SN_Management "mgmt" -#define LN_Management "Management" -#define NID_Management 383 -#define OBJ_Management OBJ_internet,2L - -#define SN_Experimental "experimental" -#define LN_Experimental "Experimental" -#define NID_Experimental 384 -#define OBJ_Experimental OBJ_internet,3L - -#define SN_Private "private" -#define LN_Private "Private" -#define NID_Private 385 -#define OBJ_Private OBJ_internet,4L - -#define SN_Security "security" -#define LN_Security "Security" -#define NID_Security 386 -#define OBJ_Security OBJ_internet,5L - -#define SN_SNMPv2 "snmpv2" -#define LN_SNMPv2 "SNMPv2" -#define NID_SNMPv2 387 -#define OBJ_SNMPv2 OBJ_internet,6L - -#define LN_Mail "Mail" -#define NID_Mail 388 -#define OBJ_Mail OBJ_internet,7L - -#define SN_Enterprises "enterprises" -#define LN_Enterprises "Enterprises" -#define NID_Enterprises 389 -#define OBJ_Enterprises OBJ_Private,1L - -#define SN_dcObject "dcobject" -#define LN_dcObject "dcObject" -#define NID_dcObject 390 -#define OBJ_dcObject OBJ_Enterprises,1466L,344L - -#define SN_mime_mhs "mime-mhs" -#define LN_mime_mhs "MIME MHS" -#define NID_mime_mhs 504 -#define OBJ_mime_mhs OBJ_Mail,1L - -#define SN_mime_mhs_headings "mime-mhs-headings" -#define LN_mime_mhs_headings "mime-mhs-headings" -#define NID_mime_mhs_headings 505 -#define OBJ_mime_mhs_headings OBJ_mime_mhs,1L - -#define SN_mime_mhs_bodies "mime-mhs-bodies" -#define LN_mime_mhs_bodies "mime-mhs-bodies" -#define NID_mime_mhs_bodies 506 -#define OBJ_mime_mhs_bodies OBJ_mime_mhs,2L - -#define SN_id_hex_partial_message "id-hex-partial-message" -#define LN_id_hex_partial_message "id-hex-partial-message" -#define NID_id_hex_partial_message 507 -#define OBJ_id_hex_partial_message OBJ_mime_mhs_headings,1L - -#define SN_id_hex_multipart_message "id-hex-multipart-message" -#define LN_id_hex_multipart_message "id-hex-multipart-message" -#define NID_id_hex_multipart_message 508 -#define OBJ_id_hex_multipart_message OBJ_mime_mhs_headings,2L - -#define SN_rle_compression "RLE" -#define LN_rle_compression "run length compression" -#define NID_rle_compression 124 -#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L - -#define SN_zlib_compression "ZLIB" -#define LN_zlib_compression "zlib compression" -#define NID_zlib_compression 125 -#define OBJ_zlib_compression OBJ_id_smime_alg,8L - -#define OBJ_csor 2L,16L,840L,1L,101L,3L - -#define OBJ_nistAlgorithms OBJ_csor,4L - -#define OBJ_aes OBJ_nistAlgorithms,1L - -#define SN_aes_128_ecb "AES-128-ECB" -#define LN_aes_128_ecb "aes-128-ecb" -#define NID_aes_128_ecb 418 -#define OBJ_aes_128_ecb OBJ_aes,1L - -#define SN_aes_128_cbc "AES-128-CBC" -#define LN_aes_128_cbc "aes-128-cbc" -#define NID_aes_128_cbc 419 -#define OBJ_aes_128_cbc OBJ_aes,2L - -#define SN_aes_128_ofb128 "AES-128-OFB" -#define LN_aes_128_ofb128 "aes-128-ofb" -#define NID_aes_128_ofb128 420 -#define OBJ_aes_128_ofb128 OBJ_aes,3L - -#define SN_aes_128_cfb128 "AES-128-CFB" -#define LN_aes_128_cfb128 "aes-128-cfb" -#define NID_aes_128_cfb128 421 -#define OBJ_aes_128_cfb128 OBJ_aes,4L - -#define SN_id_aes128_wrap "id-aes128-wrap" -#define NID_id_aes128_wrap 788 -#define OBJ_id_aes128_wrap OBJ_aes,5L - -#define SN_aes_128_gcm "id-aes128-GCM" -#define LN_aes_128_gcm "aes-128-gcm" -#define NID_aes_128_gcm 895 -#define OBJ_aes_128_gcm OBJ_aes,6L - -#define SN_aes_128_ccm "id-aes128-CCM" -#define LN_aes_128_ccm "aes-128-ccm" -#define NID_aes_128_ccm 896 -#define OBJ_aes_128_ccm OBJ_aes,7L - -#define SN_id_aes128_wrap_pad "id-aes128-wrap-pad" -#define NID_id_aes128_wrap_pad 897 -#define OBJ_id_aes128_wrap_pad OBJ_aes,8L - -#define SN_aes_192_ecb "AES-192-ECB" -#define LN_aes_192_ecb "aes-192-ecb" -#define NID_aes_192_ecb 422 -#define OBJ_aes_192_ecb OBJ_aes,21L - -#define SN_aes_192_cbc "AES-192-CBC" -#define LN_aes_192_cbc "aes-192-cbc" -#define NID_aes_192_cbc 423 -#define OBJ_aes_192_cbc OBJ_aes,22L - -#define SN_aes_192_ofb128 "AES-192-OFB" -#define LN_aes_192_ofb128 "aes-192-ofb" -#define NID_aes_192_ofb128 424 -#define OBJ_aes_192_ofb128 OBJ_aes,23L - -#define SN_aes_192_cfb128 "AES-192-CFB" -#define LN_aes_192_cfb128 "aes-192-cfb" -#define NID_aes_192_cfb128 425 -#define OBJ_aes_192_cfb128 OBJ_aes,24L - -#define SN_id_aes192_wrap "id-aes192-wrap" -#define NID_id_aes192_wrap 789 -#define OBJ_id_aes192_wrap OBJ_aes,25L - -#define SN_aes_192_gcm "id-aes192-GCM" -#define LN_aes_192_gcm "aes-192-gcm" -#define NID_aes_192_gcm 898 -#define OBJ_aes_192_gcm OBJ_aes,26L - -#define SN_aes_192_ccm "id-aes192-CCM" -#define LN_aes_192_ccm "aes-192-ccm" -#define NID_aes_192_ccm 899 -#define OBJ_aes_192_ccm OBJ_aes,27L - -#define SN_id_aes192_wrap_pad "id-aes192-wrap-pad" -#define NID_id_aes192_wrap_pad 900 -#define OBJ_id_aes192_wrap_pad OBJ_aes,28L - -#define SN_aes_256_ecb "AES-256-ECB" -#define LN_aes_256_ecb "aes-256-ecb" -#define NID_aes_256_ecb 426 -#define OBJ_aes_256_ecb OBJ_aes,41L - -#define SN_aes_256_cbc "AES-256-CBC" -#define LN_aes_256_cbc "aes-256-cbc" -#define NID_aes_256_cbc 427 -#define OBJ_aes_256_cbc OBJ_aes,42L - -#define SN_aes_256_ofb128 "AES-256-OFB" -#define LN_aes_256_ofb128 "aes-256-ofb" -#define NID_aes_256_ofb128 428 -#define OBJ_aes_256_ofb128 OBJ_aes,43L - -#define SN_aes_256_cfb128 "AES-256-CFB" -#define LN_aes_256_cfb128 "aes-256-cfb" -#define NID_aes_256_cfb128 429 -#define OBJ_aes_256_cfb128 OBJ_aes,44L - -#define SN_id_aes256_wrap "id-aes256-wrap" -#define NID_id_aes256_wrap 790 -#define OBJ_id_aes256_wrap OBJ_aes,45L - -#define SN_aes_256_gcm "id-aes256-GCM" -#define LN_aes_256_gcm "aes-256-gcm" -#define NID_aes_256_gcm 901 -#define OBJ_aes_256_gcm OBJ_aes,46L - -#define SN_aes_256_ccm "id-aes256-CCM" -#define LN_aes_256_ccm "aes-256-ccm" -#define NID_aes_256_ccm 902 -#define OBJ_aes_256_ccm OBJ_aes,47L - -#define SN_id_aes256_wrap_pad "id-aes256-wrap-pad" -#define NID_id_aes256_wrap_pad 903 -#define OBJ_id_aes256_wrap_pad OBJ_aes,48L - -#define SN_aes_128_cfb1 "AES-128-CFB1" -#define LN_aes_128_cfb1 "aes-128-cfb1" -#define NID_aes_128_cfb1 650 - -#define SN_aes_192_cfb1 "AES-192-CFB1" -#define LN_aes_192_cfb1 "aes-192-cfb1" -#define NID_aes_192_cfb1 651 - -#define SN_aes_256_cfb1 "AES-256-CFB1" -#define LN_aes_256_cfb1 "aes-256-cfb1" -#define NID_aes_256_cfb1 652 - -#define SN_aes_128_cfb8 "AES-128-CFB8" -#define LN_aes_128_cfb8 "aes-128-cfb8" -#define NID_aes_128_cfb8 653 - -#define SN_aes_192_cfb8 "AES-192-CFB8" -#define LN_aes_192_cfb8 "aes-192-cfb8" -#define NID_aes_192_cfb8 654 - -#define SN_aes_256_cfb8 "AES-256-CFB8" -#define LN_aes_256_cfb8 "aes-256-cfb8" -#define NID_aes_256_cfb8 655 - -#define SN_aes_128_ctr "AES-128-CTR" -#define LN_aes_128_ctr "aes-128-ctr" -#define NID_aes_128_ctr 904 - -#define SN_aes_192_ctr "AES-192-CTR" -#define LN_aes_192_ctr "aes-192-ctr" -#define NID_aes_192_ctr 905 - -#define SN_aes_256_ctr "AES-256-CTR" -#define LN_aes_256_ctr "aes-256-ctr" -#define NID_aes_256_ctr 906 - -#define SN_aes_128_xts "AES-128-XTS" -#define LN_aes_128_xts "aes-128-xts" -#define NID_aes_128_xts 913 - -#define SN_aes_256_xts "AES-256-XTS" -#define LN_aes_256_xts "aes-256-xts" -#define NID_aes_256_xts 914 - -#define SN_des_cfb1 "DES-CFB1" -#define LN_des_cfb1 "des-cfb1" -#define NID_des_cfb1 656 - -#define SN_des_cfb8 "DES-CFB8" -#define LN_des_cfb8 "des-cfb8" -#define NID_des_cfb8 657 - -#define SN_des_ede3_cfb1 "DES-EDE3-CFB1" -#define LN_des_ede3_cfb1 "des-ede3-cfb1" -#define NID_des_ede3_cfb1 658 - -#define SN_des_ede3_cfb8 "DES-EDE3-CFB8" -#define LN_des_ede3_cfb8 "des-ede3-cfb8" -#define NID_des_ede3_cfb8 659 - -#define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L - -#define SN_sha256 "SHA256" -#define LN_sha256 "sha256" -#define NID_sha256 672 -#define OBJ_sha256 OBJ_nist_hashalgs,1L - -#define SN_sha384 "SHA384" -#define LN_sha384 "sha384" -#define NID_sha384 673 -#define OBJ_sha384 OBJ_nist_hashalgs,2L - -#define SN_sha512 "SHA512" -#define LN_sha512 "sha512" -#define NID_sha512 674 -#define OBJ_sha512 OBJ_nist_hashalgs,3L - -#define SN_sha224 "SHA224" -#define LN_sha224 "sha224" -#define NID_sha224 675 -#define OBJ_sha224 OBJ_nist_hashalgs,4L - -#define OBJ_dsa_with_sha2 OBJ_nistAlgorithms,3L - -#define SN_dsa_with_SHA224 "dsa_with_SHA224" -#define NID_dsa_with_SHA224 802 -#define OBJ_dsa_with_SHA224 OBJ_dsa_with_sha2,1L - -#define SN_dsa_with_SHA256 "dsa_with_SHA256" -#define NID_dsa_with_SHA256 803 -#define OBJ_dsa_with_SHA256 OBJ_dsa_with_sha2,2L - -#define SN_hold_instruction_code "holdInstructionCode" -#define LN_hold_instruction_code "Hold Instruction Code" -#define NID_hold_instruction_code 430 -#define OBJ_hold_instruction_code OBJ_id_ce,23L - -#define OBJ_holdInstruction OBJ_X9_57,2L - -#define SN_hold_instruction_none "holdInstructionNone" -#define LN_hold_instruction_none "Hold Instruction None" -#define NID_hold_instruction_none 431 -#define OBJ_hold_instruction_none OBJ_holdInstruction,1L - -#define SN_hold_instruction_call_issuer "holdInstructionCallIssuer" -#define LN_hold_instruction_call_issuer "Hold Instruction Call Issuer" -#define NID_hold_instruction_call_issuer 432 -#define OBJ_hold_instruction_call_issuer OBJ_holdInstruction,2L - -#define SN_hold_instruction_reject "holdInstructionReject" -#define LN_hold_instruction_reject "Hold Instruction Reject" -#define NID_hold_instruction_reject 433 -#define OBJ_hold_instruction_reject OBJ_holdInstruction,3L - -#define SN_data "data" -#define NID_data 434 -#define OBJ_data OBJ_itu_t,9L - -#define SN_pss "pss" -#define NID_pss 435 -#define OBJ_pss OBJ_data,2342L - -#define SN_ucl "ucl" -#define NID_ucl 436 -#define OBJ_ucl OBJ_pss,19200300L - -#define SN_pilot "pilot" -#define NID_pilot 437 -#define OBJ_pilot OBJ_ucl,100L - -#define LN_pilotAttributeType "pilotAttributeType" -#define NID_pilotAttributeType 438 -#define OBJ_pilotAttributeType OBJ_pilot,1L - -#define LN_pilotAttributeSyntax "pilotAttributeSyntax" -#define NID_pilotAttributeSyntax 439 -#define OBJ_pilotAttributeSyntax OBJ_pilot,3L - -#define LN_pilotObjectClass "pilotObjectClass" -#define NID_pilotObjectClass 440 -#define OBJ_pilotObjectClass OBJ_pilot,4L - -#define LN_pilotGroups "pilotGroups" -#define NID_pilotGroups 441 -#define OBJ_pilotGroups OBJ_pilot,10L - -#define LN_iA5StringSyntax "iA5StringSyntax" -#define NID_iA5StringSyntax 442 -#define OBJ_iA5StringSyntax OBJ_pilotAttributeSyntax,4L - -#define LN_caseIgnoreIA5StringSyntax "caseIgnoreIA5StringSyntax" -#define NID_caseIgnoreIA5StringSyntax 443 -#define OBJ_caseIgnoreIA5StringSyntax OBJ_pilotAttributeSyntax,5L - -#define LN_pilotObject "pilotObject" -#define NID_pilotObject 444 -#define OBJ_pilotObject OBJ_pilotObjectClass,3L - -#define LN_pilotPerson "pilotPerson" -#define NID_pilotPerson 445 -#define OBJ_pilotPerson OBJ_pilotObjectClass,4L - -#define SN_account "account" -#define NID_account 446 -#define OBJ_account OBJ_pilotObjectClass,5L - -#define SN_document "document" -#define NID_document 447 -#define OBJ_document OBJ_pilotObjectClass,6L - -#define SN_room "room" -#define NID_room 448 -#define OBJ_room OBJ_pilotObjectClass,7L - -#define LN_documentSeries "documentSeries" -#define NID_documentSeries 449 -#define OBJ_documentSeries OBJ_pilotObjectClass,9L - -#define SN_Domain "domain" -#define LN_Domain "Domain" -#define NID_Domain 392 -#define OBJ_Domain OBJ_pilotObjectClass,13L - -#define LN_rFC822localPart "rFC822localPart" -#define NID_rFC822localPart 450 -#define OBJ_rFC822localPart OBJ_pilotObjectClass,14L - -#define LN_dNSDomain "dNSDomain" -#define NID_dNSDomain 451 -#define OBJ_dNSDomain OBJ_pilotObjectClass,15L - -#define LN_domainRelatedObject "domainRelatedObject" -#define NID_domainRelatedObject 452 -#define OBJ_domainRelatedObject OBJ_pilotObjectClass,17L - -#define LN_friendlyCountry "friendlyCountry" -#define NID_friendlyCountry 453 -#define OBJ_friendlyCountry OBJ_pilotObjectClass,18L - -#define LN_simpleSecurityObject "simpleSecurityObject" -#define NID_simpleSecurityObject 454 -#define OBJ_simpleSecurityObject OBJ_pilotObjectClass,19L - -#define LN_pilotOrganization "pilotOrganization" -#define NID_pilotOrganization 455 -#define OBJ_pilotOrganization OBJ_pilotObjectClass,20L - -#define LN_pilotDSA "pilotDSA" -#define NID_pilotDSA 456 -#define OBJ_pilotDSA OBJ_pilotObjectClass,21L - -#define LN_qualityLabelledData "qualityLabelledData" -#define NID_qualityLabelledData 457 -#define OBJ_qualityLabelledData OBJ_pilotObjectClass,22L - -#define SN_userId "UID" -#define LN_userId "userId" -#define NID_userId 458 -#define OBJ_userId OBJ_pilotAttributeType,1L - -#define LN_textEncodedORAddress "textEncodedORAddress" -#define NID_textEncodedORAddress 459 -#define OBJ_textEncodedORAddress OBJ_pilotAttributeType,2L - -#define SN_rfc822Mailbox "mail" -#define LN_rfc822Mailbox "rfc822Mailbox" -#define NID_rfc822Mailbox 460 -#define OBJ_rfc822Mailbox OBJ_pilotAttributeType,3L - -#define SN_info "info" -#define NID_info 461 -#define OBJ_info OBJ_pilotAttributeType,4L - -#define LN_favouriteDrink "favouriteDrink" -#define NID_favouriteDrink 462 -#define OBJ_favouriteDrink OBJ_pilotAttributeType,5L - -#define LN_roomNumber "roomNumber" -#define NID_roomNumber 463 -#define OBJ_roomNumber OBJ_pilotAttributeType,6L - -#define SN_photo "photo" -#define NID_photo 464 -#define OBJ_photo OBJ_pilotAttributeType,7L - -#define LN_userClass "userClass" -#define NID_userClass 465 -#define OBJ_userClass OBJ_pilotAttributeType,8L - -#define SN_host "host" -#define NID_host 466 -#define OBJ_host OBJ_pilotAttributeType,9L - -#define SN_manager "manager" -#define NID_manager 467 -#define OBJ_manager OBJ_pilotAttributeType,10L - -#define LN_documentIdentifier "documentIdentifier" -#define NID_documentIdentifier 468 -#define OBJ_documentIdentifier OBJ_pilotAttributeType,11L - -#define LN_documentTitle "documentTitle" -#define NID_documentTitle 469 -#define OBJ_documentTitle OBJ_pilotAttributeType,12L - -#define LN_documentVersion "documentVersion" -#define NID_documentVersion 470 -#define OBJ_documentVersion OBJ_pilotAttributeType,13L - -#define LN_documentAuthor "documentAuthor" -#define NID_documentAuthor 471 -#define OBJ_documentAuthor OBJ_pilotAttributeType,14L - -#define LN_documentLocation "documentLocation" -#define NID_documentLocation 472 -#define OBJ_documentLocation OBJ_pilotAttributeType,15L - -#define LN_homeTelephoneNumber "homeTelephoneNumber" -#define NID_homeTelephoneNumber 473 -#define OBJ_homeTelephoneNumber OBJ_pilotAttributeType,20L - -#define SN_secretary "secretary" -#define NID_secretary 474 -#define OBJ_secretary OBJ_pilotAttributeType,21L - -#define LN_otherMailbox "otherMailbox" -#define NID_otherMailbox 475 -#define OBJ_otherMailbox OBJ_pilotAttributeType,22L - -#define LN_lastModifiedTime "lastModifiedTime" -#define NID_lastModifiedTime 476 -#define OBJ_lastModifiedTime OBJ_pilotAttributeType,23L - -#define LN_lastModifiedBy "lastModifiedBy" -#define NID_lastModifiedBy 477 -#define OBJ_lastModifiedBy OBJ_pilotAttributeType,24L - -#define SN_domainComponent "DC" -#define LN_domainComponent "domainComponent" -#define NID_domainComponent 391 -#define OBJ_domainComponent OBJ_pilotAttributeType,25L - -#define LN_aRecord "aRecord" -#define NID_aRecord 478 -#define OBJ_aRecord OBJ_pilotAttributeType,26L - -#define LN_pilotAttributeType27 "pilotAttributeType27" -#define NID_pilotAttributeType27 479 -#define OBJ_pilotAttributeType27 OBJ_pilotAttributeType,27L - -#define LN_mXRecord "mXRecord" -#define NID_mXRecord 480 -#define OBJ_mXRecord OBJ_pilotAttributeType,28L - -#define LN_nSRecord "nSRecord" -#define NID_nSRecord 481 -#define OBJ_nSRecord OBJ_pilotAttributeType,29L - -#define LN_sOARecord "sOARecord" -#define NID_sOARecord 482 -#define OBJ_sOARecord OBJ_pilotAttributeType,30L - -#define LN_cNAMERecord "cNAMERecord" -#define NID_cNAMERecord 483 -#define OBJ_cNAMERecord OBJ_pilotAttributeType,31L - -#define LN_associatedDomain "associatedDomain" -#define NID_associatedDomain 484 -#define OBJ_associatedDomain OBJ_pilotAttributeType,37L - -#define LN_associatedName "associatedName" -#define NID_associatedName 485 -#define OBJ_associatedName OBJ_pilotAttributeType,38L - -#define LN_homePostalAddress "homePostalAddress" -#define NID_homePostalAddress 486 -#define OBJ_homePostalAddress OBJ_pilotAttributeType,39L - -#define LN_personalTitle "personalTitle" -#define NID_personalTitle 487 -#define OBJ_personalTitle OBJ_pilotAttributeType,40L - -#define LN_mobileTelephoneNumber "mobileTelephoneNumber" -#define NID_mobileTelephoneNumber 488 -#define OBJ_mobileTelephoneNumber OBJ_pilotAttributeType,41L - -#define LN_pagerTelephoneNumber "pagerTelephoneNumber" -#define NID_pagerTelephoneNumber 489 -#define OBJ_pagerTelephoneNumber OBJ_pilotAttributeType,42L - -#define LN_friendlyCountryName "friendlyCountryName" -#define NID_friendlyCountryName 490 -#define OBJ_friendlyCountryName OBJ_pilotAttributeType,43L - -#define LN_organizationalStatus "organizationalStatus" -#define NID_organizationalStatus 491 -#define OBJ_organizationalStatus OBJ_pilotAttributeType,45L - -#define LN_janetMailbox "janetMailbox" -#define NID_janetMailbox 492 -#define OBJ_janetMailbox OBJ_pilotAttributeType,46L - -#define LN_mailPreferenceOption "mailPreferenceOption" -#define NID_mailPreferenceOption 493 -#define OBJ_mailPreferenceOption OBJ_pilotAttributeType,47L - -#define LN_buildingName "buildingName" -#define NID_buildingName 494 -#define OBJ_buildingName OBJ_pilotAttributeType,48L - -#define LN_dSAQuality "dSAQuality" -#define NID_dSAQuality 495 -#define OBJ_dSAQuality OBJ_pilotAttributeType,49L - -#define LN_singleLevelQuality "singleLevelQuality" -#define NID_singleLevelQuality 496 -#define OBJ_singleLevelQuality OBJ_pilotAttributeType,50L - -#define LN_subtreeMinimumQuality "subtreeMinimumQuality" -#define NID_subtreeMinimumQuality 497 -#define OBJ_subtreeMinimumQuality OBJ_pilotAttributeType,51L - -#define LN_subtreeMaximumQuality "subtreeMaximumQuality" -#define NID_subtreeMaximumQuality 498 -#define OBJ_subtreeMaximumQuality OBJ_pilotAttributeType,52L - -#define LN_personalSignature "personalSignature" -#define NID_personalSignature 499 -#define OBJ_personalSignature OBJ_pilotAttributeType,53L - -#define LN_dITRedirect "dITRedirect" -#define NID_dITRedirect 500 -#define OBJ_dITRedirect OBJ_pilotAttributeType,54L - -#define SN_audio "audio" -#define NID_audio 501 -#define OBJ_audio OBJ_pilotAttributeType,55L - -#define LN_documentPublisher "documentPublisher" -#define NID_documentPublisher 502 -#define OBJ_documentPublisher OBJ_pilotAttributeType,56L - -#define SN_id_set "id-set" -#define LN_id_set "Secure Electronic Transactions" -#define NID_id_set 512 -#define OBJ_id_set OBJ_international_organizations,42L - -#define SN_set_ctype "set-ctype" -#define LN_set_ctype "content types" -#define NID_set_ctype 513 -#define OBJ_set_ctype OBJ_id_set,0L - -#define SN_set_msgExt "set-msgExt" -#define LN_set_msgExt "message extensions" -#define NID_set_msgExt 514 -#define OBJ_set_msgExt OBJ_id_set,1L - -#define SN_set_attr "set-attr" -#define NID_set_attr 515 -#define OBJ_set_attr OBJ_id_set,3L - -#define SN_set_policy "set-policy" -#define NID_set_policy 516 -#define OBJ_set_policy OBJ_id_set,5L - -#define SN_set_certExt "set-certExt" -#define LN_set_certExt "certificate extensions" -#define NID_set_certExt 517 -#define OBJ_set_certExt OBJ_id_set,7L - -#define SN_set_brand "set-brand" -#define NID_set_brand 518 -#define OBJ_set_brand OBJ_id_set,8L - -#define SN_setct_PANData "setct-PANData" -#define NID_setct_PANData 519 -#define OBJ_setct_PANData OBJ_set_ctype,0L - -#define SN_setct_PANToken "setct-PANToken" -#define NID_setct_PANToken 520 -#define OBJ_setct_PANToken OBJ_set_ctype,1L - -#define SN_setct_PANOnly "setct-PANOnly" -#define NID_setct_PANOnly 521 -#define OBJ_setct_PANOnly OBJ_set_ctype,2L - -#define SN_setct_OIData "setct-OIData" -#define NID_setct_OIData 522 -#define OBJ_setct_OIData OBJ_set_ctype,3L - -#define SN_setct_PI "setct-PI" -#define NID_setct_PI 523 -#define OBJ_setct_PI OBJ_set_ctype,4L - -#define SN_setct_PIData "setct-PIData" -#define NID_setct_PIData 524 -#define OBJ_setct_PIData OBJ_set_ctype,5L - -#define SN_setct_PIDataUnsigned "setct-PIDataUnsigned" -#define NID_setct_PIDataUnsigned 525 -#define OBJ_setct_PIDataUnsigned OBJ_set_ctype,6L - -#define SN_setct_HODInput "setct-HODInput" -#define NID_setct_HODInput 526 -#define OBJ_setct_HODInput OBJ_set_ctype,7L - -#define SN_setct_AuthResBaggage "setct-AuthResBaggage" -#define NID_setct_AuthResBaggage 527 -#define OBJ_setct_AuthResBaggage OBJ_set_ctype,8L - -#define SN_setct_AuthRevReqBaggage "setct-AuthRevReqBaggage" -#define NID_setct_AuthRevReqBaggage 528 -#define OBJ_setct_AuthRevReqBaggage OBJ_set_ctype,9L - -#define SN_setct_AuthRevResBaggage "setct-AuthRevResBaggage" -#define NID_setct_AuthRevResBaggage 529 -#define OBJ_setct_AuthRevResBaggage OBJ_set_ctype,10L - -#define SN_setct_CapTokenSeq "setct-CapTokenSeq" -#define NID_setct_CapTokenSeq 530 -#define OBJ_setct_CapTokenSeq OBJ_set_ctype,11L - -#define SN_setct_PInitResData "setct-PInitResData" -#define NID_setct_PInitResData 531 -#define OBJ_setct_PInitResData OBJ_set_ctype,12L - -#define SN_setct_PI_TBS "setct-PI-TBS" -#define NID_setct_PI_TBS 532 -#define OBJ_setct_PI_TBS OBJ_set_ctype,13L - -#define SN_setct_PResData "setct-PResData" -#define NID_setct_PResData 533 -#define OBJ_setct_PResData OBJ_set_ctype,14L - -#define SN_setct_AuthReqTBS "setct-AuthReqTBS" -#define NID_setct_AuthReqTBS 534 -#define OBJ_setct_AuthReqTBS OBJ_set_ctype,16L - -#define SN_setct_AuthResTBS "setct-AuthResTBS" -#define NID_setct_AuthResTBS 535 -#define OBJ_setct_AuthResTBS OBJ_set_ctype,17L - -#define SN_setct_AuthResTBSX "setct-AuthResTBSX" -#define NID_setct_AuthResTBSX 536 -#define OBJ_setct_AuthResTBSX OBJ_set_ctype,18L - -#define SN_setct_AuthTokenTBS "setct-AuthTokenTBS" -#define NID_setct_AuthTokenTBS 537 -#define OBJ_setct_AuthTokenTBS OBJ_set_ctype,19L - -#define SN_setct_CapTokenData "setct-CapTokenData" -#define NID_setct_CapTokenData 538 -#define OBJ_setct_CapTokenData OBJ_set_ctype,20L - -#define SN_setct_CapTokenTBS "setct-CapTokenTBS" -#define NID_setct_CapTokenTBS 539 -#define OBJ_setct_CapTokenTBS OBJ_set_ctype,21L - -#define SN_setct_AcqCardCodeMsg "setct-AcqCardCodeMsg" -#define NID_setct_AcqCardCodeMsg 540 -#define OBJ_setct_AcqCardCodeMsg OBJ_set_ctype,22L - -#define SN_setct_AuthRevReqTBS "setct-AuthRevReqTBS" -#define NID_setct_AuthRevReqTBS 541 -#define OBJ_setct_AuthRevReqTBS OBJ_set_ctype,23L - -#define SN_setct_AuthRevResData "setct-AuthRevResData" -#define NID_setct_AuthRevResData 542 -#define OBJ_setct_AuthRevResData OBJ_set_ctype,24L - -#define SN_setct_AuthRevResTBS "setct-AuthRevResTBS" -#define NID_setct_AuthRevResTBS 543 -#define OBJ_setct_AuthRevResTBS OBJ_set_ctype,25L - -#define SN_setct_CapReqTBS "setct-CapReqTBS" -#define NID_setct_CapReqTBS 544 -#define OBJ_setct_CapReqTBS OBJ_set_ctype,26L - -#define SN_setct_CapReqTBSX "setct-CapReqTBSX" -#define NID_setct_CapReqTBSX 545 -#define OBJ_setct_CapReqTBSX OBJ_set_ctype,27L - -#define SN_setct_CapResData "setct-CapResData" -#define NID_setct_CapResData 546 -#define OBJ_setct_CapResData OBJ_set_ctype,28L - -#define SN_setct_CapRevReqTBS "setct-CapRevReqTBS" -#define NID_setct_CapRevReqTBS 547 -#define OBJ_setct_CapRevReqTBS OBJ_set_ctype,29L - -#define SN_setct_CapRevReqTBSX "setct-CapRevReqTBSX" -#define NID_setct_CapRevReqTBSX 548 -#define OBJ_setct_CapRevReqTBSX OBJ_set_ctype,30L - -#define SN_setct_CapRevResData "setct-CapRevResData" -#define NID_setct_CapRevResData 549 -#define OBJ_setct_CapRevResData OBJ_set_ctype,31L - -#define SN_setct_CredReqTBS "setct-CredReqTBS" -#define NID_setct_CredReqTBS 550 -#define OBJ_setct_CredReqTBS OBJ_set_ctype,32L - -#define SN_setct_CredReqTBSX "setct-CredReqTBSX" -#define NID_setct_CredReqTBSX 551 -#define OBJ_setct_CredReqTBSX OBJ_set_ctype,33L - -#define SN_setct_CredResData "setct-CredResData" -#define NID_setct_CredResData 552 -#define OBJ_setct_CredResData OBJ_set_ctype,34L - -#define SN_setct_CredRevReqTBS "setct-CredRevReqTBS" -#define NID_setct_CredRevReqTBS 553 -#define OBJ_setct_CredRevReqTBS OBJ_set_ctype,35L - -#define SN_setct_CredRevReqTBSX "setct-CredRevReqTBSX" -#define NID_setct_CredRevReqTBSX 554 -#define OBJ_setct_CredRevReqTBSX OBJ_set_ctype,36L - -#define SN_setct_CredRevResData "setct-CredRevResData" -#define NID_setct_CredRevResData 555 -#define OBJ_setct_CredRevResData OBJ_set_ctype,37L - -#define SN_setct_PCertReqData "setct-PCertReqData" -#define NID_setct_PCertReqData 556 -#define OBJ_setct_PCertReqData OBJ_set_ctype,38L - -#define SN_setct_PCertResTBS "setct-PCertResTBS" -#define NID_setct_PCertResTBS 557 -#define OBJ_setct_PCertResTBS OBJ_set_ctype,39L - -#define SN_setct_BatchAdminReqData "setct-BatchAdminReqData" -#define NID_setct_BatchAdminReqData 558 -#define OBJ_setct_BatchAdminReqData OBJ_set_ctype,40L - -#define SN_setct_BatchAdminResData "setct-BatchAdminResData" -#define NID_setct_BatchAdminResData 559 -#define OBJ_setct_BatchAdminResData OBJ_set_ctype,41L - -#define SN_setct_CardCInitResTBS "setct-CardCInitResTBS" -#define NID_setct_CardCInitResTBS 560 -#define OBJ_setct_CardCInitResTBS OBJ_set_ctype,42L - -#define SN_setct_MeAqCInitResTBS "setct-MeAqCInitResTBS" -#define NID_setct_MeAqCInitResTBS 561 -#define OBJ_setct_MeAqCInitResTBS OBJ_set_ctype,43L - -#define SN_setct_RegFormResTBS "setct-RegFormResTBS" -#define NID_setct_RegFormResTBS 562 -#define OBJ_setct_RegFormResTBS OBJ_set_ctype,44L - -#define SN_setct_CertReqData "setct-CertReqData" -#define NID_setct_CertReqData 563 -#define OBJ_setct_CertReqData OBJ_set_ctype,45L - -#define SN_setct_CertReqTBS "setct-CertReqTBS" -#define NID_setct_CertReqTBS 564 -#define OBJ_setct_CertReqTBS OBJ_set_ctype,46L - -#define SN_setct_CertResData "setct-CertResData" -#define NID_setct_CertResData 565 -#define OBJ_setct_CertResData OBJ_set_ctype,47L - -#define SN_setct_CertInqReqTBS "setct-CertInqReqTBS" -#define NID_setct_CertInqReqTBS 566 -#define OBJ_setct_CertInqReqTBS OBJ_set_ctype,48L - -#define SN_setct_ErrorTBS "setct-ErrorTBS" -#define NID_setct_ErrorTBS 567 -#define OBJ_setct_ErrorTBS OBJ_set_ctype,49L - -#define SN_setct_PIDualSignedTBE "setct-PIDualSignedTBE" -#define NID_setct_PIDualSignedTBE 568 -#define OBJ_setct_PIDualSignedTBE OBJ_set_ctype,50L - -#define SN_setct_PIUnsignedTBE "setct-PIUnsignedTBE" -#define NID_setct_PIUnsignedTBE 569 -#define OBJ_setct_PIUnsignedTBE OBJ_set_ctype,51L - -#define SN_setct_AuthReqTBE "setct-AuthReqTBE" -#define NID_setct_AuthReqTBE 570 -#define OBJ_setct_AuthReqTBE OBJ_set_ctype,52L - -#define SN_setct_AuthResTBE "setct-AuthResTBE" -#define NID_setct_AuthResTBE 571 -#define OBJ_setct_AuthResTBE OBJ_set_ctype,53L - -#define SN_setct_AuthResTBEX "setct-AuthResTBEX" -#define NID_setct_AuthResTBEX 572 -#define OBJ_setct_AuthResTBEX OBJ_set_ctype,54L - -#define SN_setct_AuthTokenTBE "setct-AuthTokenTBE" -#define NID_setct_AuthTokenTBE 573 -#define OBJ_setct_AuthTokenTBE OBJ_set_ctype,55L - -#define SN_setct_CapTokenTBE "setct-CapTokenTBE" -#define NID_setct_CapTokenTBE 574 -#define OBJ_setct_CapTokenTBE OBJ_set_ctype,56L - -#define SN_setct_CapTokenTBEX "setct-CapTokenTBEX" -#define NID_setct_CapTokenTBEX 575 -#define OBJ_setct_CapTokenTBEX OBJ_set_ctype,57L - -#define SN_setct_AcqCardCodeMsgTBE "setct-AcqCardCodeMsgTBE" -#define NID_setct_AcqCardCodeMsgTBE 576 -#define OBJ_setct_AcqCardCodeMsgTBE OBJ_set_ctype,58L - -#define SN_setct_AuthRevReqTBE "setct-AuthRevReqTBE" -#define NID_setct_AuthRevReqTBE 577 -#define OBJ_setct_AuthRevReqTBE OBJ_set_ctype,59L - -#define SN_setct_AuthRevResTBE "setct-AuthRevResTBE" -#define NID_setct_AuthRevResTBE 578 -#define OBJ_setct_AuthRevResTBE OBJ_set_ctype,60L - -#define SN_setct_AuthRevResTBEB "setct-AuthRevResTBEB" -#define NID_setct_AuthRevResTBEB 579 -#define OBJ_setct_AuthRevResTBEB OBJ_set_ctype,61L - -#define SN_setct_CapReqTBE "setct-CapReqTBE" -#define NID_setct_CapReqTBE 580 -#define OBJ_setct_CapReqTBE OBJ_set_ctype,62L - -#define SN_setct_CapReqTBEX "setct-CapReqTBEX" -#define NID_setct_CapReqTBEX 581 -#define OBJ_setct_CapReqTBEX OBJ_set_ctype,63L - -#define SN_setct_CapResTBE "setct-CapResTBE" -#define NID_setct_CapResTBE 582 -#define OBJ_setct_CapResTBE OBJ_set_ctype,64L - -#define SN_setct_CapRevReqTBE "setct-CapRevReqTBE" -#define NID_setct_CapRevReqTBE 583 -#define OBJ_setct_CapRevReqTBE OBJ_set_ctype,65L - -#define SN_setct_CapRevReqTBEX "setct-CapRevReqTBEX" -#define NID_setct_CapRevReqTBEX 584 -#define OBJ_setct_CapRevReqTBEX OBJ_set_ctype,66L - -#define SN_setct_CapRevResTBE "setct-CapRevResTBE" -#define NID_setct_CapRevResTBE 585 -#define OBJ_setct_CapRevResTBE OBJ_set_ctype,67L - -#define SN_setct_CredReqTBE "setct-CredReqTBE" -#define NID_setct_CredReqTBE 586 -#define OBJ_setct_CredReqTBE OBJ_set_ctype,68L - -#define SN_setct_CredReqTBEX "setct-CredReqTBEX" -#define NID_setct_CredReqTBEX 587 -#define OBJ_setct_CredReqTBEX OBJ_set_ctype,69L - -#define SN_setct_CredResTBE "setct-CredResTBE" -#define NID_setct_CredResTBE 588 -#define OBJ_setct_CredResTBE OBJ_set_ctype,70L - -#define SN_setct_CredRevReqTBE "setct-CredRevReqTBE" -#define NID_setct_CredRevReqTBE 589 -#define OBJ_setct_CredRevReqTBE OBJ_set_ctype,71L - -#define SN_setct_CredRevReqTBEX "setct-CredRevReqTBEX" -#define NID_setct_CredRevReqTBEX 590 -#define OBJ_setct_CredRevReqTBEX OBJ_set_ctype,72L - -#define SN_setct_CredRevResTBE "setct-CredRevResTBE" -#define NID_setct_CredRevResTBE 591 -#define OBJ_setct_CredRevResTBE OBJ_set_ctype,73L - -#define SN_setct_BatchAdminReqTBE "setct-BatchAdminReqTBE" -#define NID_setct_BatchAdminReqTBE 592 -#define OBJ_setct_BatchAdminReqTBE OBJ_set_ctype,74L - -#define SN_setct_BatchAdminResTBE "setct-BatchAdminResTBE" -#define NID_setct_BatchAdminResTBE 593 -#define OBJ_setct_BatchAdminResTBE OBJ_set_ctype,75L - -#define SN_setct_RegFormReqTBE "setct-RegFormReqTBE" -#define NID_setct_RegFormReqTBE 594 -#define OBJ_setct_RegFormReqTBE OBJ_set_ctype,76L - -#define SN_setct_CertReqTBE "setct-CertReqTBE" -#define NID_setct_CertReqTBE 595 -#define OBJ_setct_CertReqTBE OBJ_set_ctype,77L - -#define SN_setct_CertReqTBEX "setct-CertReqTBEX" -#define NID_setct_CertReqTBEX 596 -#define OBJ_setct_CertReqTBEX OBJ_set_ctype,78L - -#define SN_setct_CertResTBE "setct-CertResTBE" -#define NID_setct_CertResTBE 597 -#define OBJ_setct_CertResTBE OBJ_set_ctype,79L - -#define SN_setct_CRLNotificationTBS "setct-CRLNotificationTBS" -#define NID_setct_CRLNotificationTBS 598 -#define OBJ_setct_CRLNotificationTBS OBJ_set_ctype,80L - -#define SN_setct_CRLNotificationResTBS "setct-CRLNotificationResTBS" -#define NID_setct_CRLNotificationResTBS 599 -#define OBJ_setct_CRLNotificationResTBS OBJ_set_ctype,81L - -#define SN_setct_BCIDistributionTBS "setct-BCIDistributionTBS" -#define NID_setct_BCIDistributionTBS 600 -#define OBJ_setct_BCIDistributionTBS OBJ_set_ctype,82L - -#define SN_setext_genCrypt "setext-genCrypt" -#define LN_setext_genCrypt "generic cryptogram" -#define NID_setext_genCrypt 601 -#define OBJ_setext_genCrypt OBJ_set_msgExt,1L - -#define SN_setext_miAuth "setext-miAuth" -#define LN_setext_miAuth "merchant initiated auth" -#define NID_setext_miAuth 602 -#define OBJ_setext_miAuth OBJ_set_msgExt,3L - -#define SN_setext_pinSecure "setext-pinSecure" -#define NID_setext_pinSecure 603 -#define OBJ_setext_pinSecure OBJ_set_msgExt,4L - -#define SN_setext_pinAny "setext-pinAny" -#define NID_setext_pinAny 604 -#define OBJ_setext_pinAny OBJ_set_msgExt,5L - -#define SN_setext_track2 "setext-track2" -#define NID_setext_track2 605 -#define OBJ_setext_track2 OBJ_set_msgExt,7L - -#define SN_setext_cv "setext-cv" -#define LN_setext_cv "additional verification" -#define NID_setext_cv 606 -#define OBJ_setext_cv OBJ_set_msgExt,8L - -#define SN_set_policy_root "set-policy-root" -#define NID_set_policy_root 607 -#define OBJ_set_policy_root OBJ_set_policy,0L - -#define SN_setCext_hashedRoot "setCext-hashedRoot" -#define NID_setCext_hashedRoot 608 -#define OBJ_setCext_hashedRoot OBJ_set_certExt,0L - -#define SN_setCext_certType "setCext-certType" -#define NID_setCext_certType 609 -#define OBJ_setCext_certType OBJ_set_certExt,1L - -#define SN_setCext_merchData "setCext-merchData" -#define NID_setCext_merchData 610 -#define OBJ_setCext_merchData OBJ_set_certExt,2L - -#define SN_setCext_cCertRequired "setCext-cCertRequired" -#define NID_setCext_cCertRequired 611 -#define OBJ_setCext_cCertRequired OBJ_set_certExt,3L - -#define SN_setCext_tunneling "setCext-tunneling" -#define NID_setCext_tunneling 612 -#define OBJ_setCext_tunneling OBJ_set_certExt,4L - -#define SN_setCext_setExt "setCext-setExt" -#define NID_setCext_setExt 613 -#define OBJ_setCext_setExt OBJ_set_certExt,5L - -#define SN_setCext_setQualf "setCext-setQualf" -#define NID_setCext_setQualf 614 -#define OBJ_setCext_setQualf OBJ_set_certExt,6L - -#define SN_setCext_PGWYcapabilities "setCext-PGWYcapabilities" -#define NID_setCext_PGWYcapabilities 615 -#define OBJ_setCext_PGWYcapabilities OBJ_set_certExt,7L - -#define SN_setCext_TokenIdentifier "setCext-TokenIdentifier" -#define NID_setCext_TokenIdentifier 616 -#define OBJ_setCext_TokenIdentifier OBJ_set_certExt,8L - -#define SN_setCext_Track2Data "setCext-Track2Data" -#define NID_setCext_Track2Data 617 -#define OBJ_setCext_Track2Data OBJ_set_certExt,9L - -#define SN_setCext_TokenType "setCext-TokenType" -#define NID_setCext_TokenType 618 -#define OBJ_setCext_TokenType OBJ_set_certExt,10L - -#define SN_setCext_IssuerCapabilities "setCext-IssuerCapabilities" -#define NID_setCext_IssuerCapabilities 619 -#define OBJ_setCext_IssuerCapabilities OBJ_set_certExt,11L - -#define SN_setAttr_Cert "setAttr-Cert" -#define NID_setAttr_Cert 620 -#define OBJ_setAttr_Cert OBJ_set_attr,0L - -#define SN_setAttr_PGWYcap "setAttr-PGWYcap" -#define LN_setAttr_PGWYcap "payment gateway capabilities" -#define NID_setAttr_PGWYcap 621 -#define OBJ_setAttr_PGWYcap OBJ_set_attr,1L - -#define SN_setAttr_TokenType "setAttr-TokenType" -#define NID_setAttr_TokenType 622 -#define OBJ_setAttr_TokenType OBJ_set_attr,2L - -#define SN_setAttr_IssCap "setAttr-IssCap" -#define LN_setAttr_IssCap "issuer capabilities" -#define NID_setAttr_IssCap 623 -#define OBJ_setAttr_IssCap OBJ_set_attr,3L - -#define SN_set_rootKeyThumb "set-rootKeyThumb" -#define NID_set_rootKeyThumb 624 -#define OBJ_set_rootKeyThumb OBJ_setAttr_Cert,0L - -#define SN_set_addPolicy "set-addPolicy" -#define NID_set_addPolicy 625 -#define OBJ_set_addPolicy OBJ_setAttr_Cert,1L - -#define SN_setAttr_Token_EMV "setAttr-Token-EMV" -#define NID_setAttr_Token_EMV 626 -#define OBJ_setAttr_Token_EMV OBJ_setAttr_TokenType,1L - -#define SN_setAttr_Token_B0Prime "setAttr-Token-B0Prime" -#define NID_setAttr_Token_B0Prime 627 -#define OBJ_setAttr_Token_B0Prime OBJ_setAttr_TokenType,2L - -#define SN_setAttr_IssCap_CVM "setAttr-IssCap-CVM" -#define NID_setAttr_IssCap_CVM 628 -#define OBJ_setAttr_IssCap_CVM OBJ_setAttr_IssCap,3L - -#define SN_setAttr_IssCap_T2 "setAttr-IssCap-T2" -#define NID_setAttr_IssCap_T2 629 -#define OBJ_setAttr_IssCap_T2 OBJ_setAttr_IssCap,4L - -#define SN_setAttr_IssCap_Sig "setAttr-IssCap-Sig" -#define NID_setAttr_IssCap_Sig 630 -#define OBJ_setAttr_IssCap_Sig OBJ_setAttr_IssCap,5L - -#define SN_setAttr_GenCryptgrm "setAttr-GenCryptgrm" -#define LN_setAttr_GenCryptgrm "generate cryptogram" -#define NID_setAttr_GenCryptgrm 631 -#define OBJ_setAttr_GenCryptgrm OBJ_setAttr_IssCap_CVM,1L - -#define SN_setAttr_T2Enc "setAttr-T2Enc" -#define LN_setAttr_T2Enc "encrypted track 2" -#define NID_setAttr_T2Enc 632 -#define OBJ_setAttr_T2Enc OBJ_setAttr_IssCap_T2,1L - -#define SN_setAttr_T2cleartxt "setAttr-T2cleartxt" -#define LN_setAttr_T2cleartxt "cleartext track 2" -#define NID_setAttr_T2cleartxt 633 -#define OBJ_setAttr_T2cleartxt OBJ_setAttr_IssCap_T2,2L - -#define SN_setAttr_TokICCsig "setAttr-TokICCsig" -#define LN_setAttr_TokICCsig "ICC or token signature" -#define NID_setAttr_TokICCsig 634 -#define OBJ_setAttr_TokICCsig OBJ_setAttr_IssCap_Sig,1L - -#define SN_setAttr_SecDevSig "setAttr-SecDevSig" -#define LN_setAttr_SecDevSig "secure device signature" -#define NID_setAttr_SecDevSig 635 -#define OBJ_setAttr_SecDevSig OBJ_setAttr_IssCap_Sig,2L - -#define SN_set_brand_IATA_ATA "set-brand-IATA-ATA" -#define NID_set_brand_IATA_ATA 636 -#define OBJ_set_brand_IATA_ATA OBJ_set_brand,1L - -#define SN_set_brand_Diners "set-brand-Diners" -#define NID_set_brand_Diners 637 -#define OBJ_set_brand_Diners OBJ_set_brand,30L - -#define SN_set_brand_AmericanExpress "set-brand-AmericanExpress" -#define NID_set_brand_AmericanExpress 638 -#define OBJ_set_brand_AmericanExpress OBJ_set_brand,34L - -#define SN_set_brand_JCB "set-brand-JCB" -#define NID_set_brand_JCB 639 -#define OBJ_set_brand_JCB OBJ_set_brand,35L - -#define SN_set_brand_Visa "set-brand-Visa" -#define NID_set_brand_Visa 640 -#define OBJ_set_brand_Visa OBJ_set_brand,4L - -#define SN_set_brand_MasterCard "set-brand-MasterCard" -#define NID_set_brand_MasterCard 641 -#define OBJ_set_brand_MasterCard OBJ_set_brand,5L - -#define SN_set_brand_Novus "set-brand-Novus" -#define NID_set_brand_Novus 642 -#define OBJ_set_brand_Novus OBJ_set_brand,6011L - -#define SN_des_cdmf "DES-CDMF" -#define LN_des_cdmf "des-cdmf" -#define NID_des_cdmf 643 -#define OBJ_des_cdmf OBJ_rsadsi,3L,10L - -#define SN_rsaOAEPEncryptionSET "rsaOAEPEncryptionSET" -#define NID_rsaOAEPEncryptionSET 644 -#define OBJ_rsaOAEPEncryptionSET OBJ_rsadsi,1L,1L,6L - -#define SN_ipsec3 "Oakley-EC2N-3" -#define LN_ipsec3 "ipsec3" -#define NID_ipsec3 749 - -#define SN_ipsec4 "Oakley-EC2N-4" -#define LN_ipsec4 "ipsec4" -#define NID_ipsec4 750 - -#define SN_whirlpool "whirlpool" -#define NID_whirlpool 804 -#define OBJ_whirlpool OBJ_iso,0L,10118L,3L,0L,55L - -#define SN_cryptopro "cryptopro" -#define NID_cryptopro 805 -#define OBJ_cryptopro OBJ_member_body,643L,2L,2L - -#define SN_cryptocom "cryptocom" -#define NID_cryptocom 806 -#define OBJ_cryptocom OBJ_member_body,643L,2L,9L - -#define SN_id_GostR3411_94_with_GostR3410_2001 "id-GostR3411-94-with-GostR3410-2001" -#define LN_id_GostR3411_94_with_GostR3410_2001 "GOST R 34.11-94 with GOST R 34.10-2001" -#define NID_id_GostR3411_94_with_GostR3410_2001 807 -#define OBJ_id_GostR3411_94_with_GostR3410_2001 OBJ_cryptopro,3L - -#define SN_id_GostR3411_94_with_GostR3410_94 "id-GostR3411-94-with-GostR3410-94" -#define LN_id_GostR3411_94_with_GostR3410_94 "GOST R 34.11-94 with GOST R 34.10-94" -#define NID_id_GostR3411_94_with_GostR3410_94 808 -#define OBJ_id_GostR3411_94_with_GostR3410_94 OBJ_cryptopro,4L - -#define SN_id_GostR3411_94 "md_gost94" -#define LN_id_GostR3411_94 "GOST R 34.11-94" -#define NID_id_GostR3411_94 809 -#define OBJ_id_GostR3411_94 OBJ_cryptopro,9L - -#define SN_id_HMACGostR3411_94 "id-HMACGostR3411-94" -#define LN_id_HMACGostR3411_94 "HMAC GOST 34.11-94" -#define NID_id_HMACGostR3411_94 810 -#define OBJ_id_HMACGostR3411_94 OBJ_cryptopro,10L - -#define SN_id_GostR3410_2001 "gost2001" -#define LN_id_GostR3410_2001 "GOST R 34.10-2001" -#define NID_id_GostR3410_2001 811 -#define OBJ_id_GostR3410_2001 OBJ_cryptopro,19L - -#define SN_id_GostR3410_94 "gost94" -#define LN_id_GostR3410_94 "GOST R 34.10-94" -#define NID_id_GostR3410_94 812 -#define OBJ_id_GostR3410_94 OBJ_cryptopro,20L - -#define SN_id_Gost28147_89 "gost89" -#define LN_id_Gost28147_89 "GOST 28147-89" -#define NID_id_Gost28147_89 813 -#define OBJ_id_Gost28147_89 OBJ_cryptopro,21L - -#define SN_gost89_cnt "gost89-cnt" -#define NID_gost89_cnt 814 - -#define SN_id_Gost28147_89_MAC "gost-mac" -#define LN_id_Gost28147_89_MAC "GOST 28147-89 MAC" -#define NID_id_Gost28147_89_MAC 815 -#define OBJ_id_Gost28147_89_MAC OBJ_cryptopro,22L - -#define SN_id_GostR3411_94_prf "prf-gostr3411-94" -#define LN_id_GostR3411_94_prf "GOST R 34.11-94 PRF" -#define NID_id_GostR3411_94_prf 816 -#define OBJ_id_GostR3411_94_prf OBJ_cryptopro,23L - -#define SN_id_GostR3410_2001DH "id-GostR3410-2001DH" -#define LN_id_GostR3410_2001DH "GOST R 34.10-2001 DH" -#define NID_id_GostR3410_2001DH 817 -#define OBJ_id_GostR3410_2001DH OBJ_cryptopro,98L - -#define SN_id_GostR3410_94DH "id-GostR3410-94DH" -#define LN_id_GostR3410_94DH "GOST R 34.10-94 DH" -#define NID_id_GostR3410_94DH 818 -#define OBJ_id_GostR3410_94DH OBJ_cryptopro,99L - -#define SN_id_Gost28147_89_CryptoPro_KeyMeshing "id-Gost28147-89-CryptoPro-KeyMeshing" -#define NID_id_Gost28147_89_CryptoPro_KeyMeshing 819 -#define OBJ_id_Gost28147_89_CryptoPro_KeyMeshing OBJ_cryptopro,14L,1L - -#define SN_id_Gost28147_89_None_KeyMeshing "id-Gost28147-89-None-KeyMeshing" -#define NID_id_Gost28147_89_None_KeyMeshing 820 -#define OBJ_id_Gost28147_89_None_KeyMeshing OBJ_cryptopro,14L,0L - -#define SN_id_GostR3411_94_TestParamSet "id-GostR3411-94-TestParamSet" -#define NID_id_GostR3411_94_TestParamSet 821 -#define OBJ_id_GostR3411_94_TestParamSet OBJ_cryptopro,30L,0L - -#define SN_id_GostR3411_94_CryptoProParamSet "id-GostR3411-94-CryptoProParamSet" -#define NID_id_GostR3411_94_CryptoProParamSet 822 -#define OBJ_id_GostR3411_94_CryptoProParamSet OBJ_cryptopro,30L,1L - -#define SN_id_Gost28147_89_TestParamSet "id-Gost28147-89-TestParamSet" -#define NID_id_Gost28147_89_TestParamSet 823 -#define OBJ_id_Gost28147_89_TestParamSet OBJ_cryptopro,31L,0L - -#define SN_id_Gost28147_89_CryptoPro_A_ParamSet "id-Gost28147-89-CryptoPro-A-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_A_ParamSet 824 -#define OBJ_id_Gost28147_89_CryptoPro_A_ParamSet OBJ_cryptopro,31L,1L - -#define SN_id_Gost28147_89_CryptoPro_B_ParamSet "id-Gost28147-89-CryptoPro-B-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_B_ParamSet 825 -#define OBJ_id_Gost28147_89_CryptoPro_B_ParamSet OBJ_cryptopro,31L,2L - -#define SN_id_Gost28147_89_CryptoPro_C_ParamSet "id-Gost28147-89-CryptoPro-C-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_C_ParamSet 826 -#define OBJ_id_Gost28147_89_CryptoPro_C_ParamSet OBJ_cryptopro,31L,3L - -#define SN_id_Gost28147_89_CryptoPro_D_ParamSet "id-Gost28147-89-CryptoPro-D-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_D_ParamSet 827 -#define OBJ_id_Gost28147_89_CryptoPro_D_ParamSet OBJ_cryptopro,31L,4L - -#define SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 828 -#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet OBJ_cryptopro,31L,5L - -#define SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 829 -#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet OBJ_cryptopro,31L,6L - -#define SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" -#define NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 830 -#define OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet OBJ_cryptopro,31L,7L - -#define SN_id_GostR3410_94_TestParamSet "id-GostR3410-94-TestParamSet" -#define NID_id_GostR3410_94_TestParamSet 831 -#define OBJ_id_GostR3410_94_TestParamSet OBJ_cryptopro,32L,0L - -#define SN_id_GostR3410_94_CryptoPro_A_ParamSet "id-GostR3410-94-CryptoPro-A-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_A_ParamSet 832 -#define OBJ_id_GostR3410_94_CryptoPro_A_ParamSet OBJ_cryptopro,32L,2L - -#define SN_id_GostR3410_94_CryptoPro_B_ParamSet "id-GostR3410-94-CryptoPro-B-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_B_ParamSet 833 -#define OBJ_id_GostR3410_94_CryptoPro_B_ParamSet OBJ_cryptopro,32L,3L - -#define SN_id_GostR3410_94_CryptoPro_C_ParamSet "id-GostR3410-94-CryptoPro-C-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_C_ParamSet 834 -#define OBJ_id_GostR3410_94_CryptoPro_C_ParamSet OBJ_cryptopro,32L,4L - -#define SN_id_GostR3410_94_CryptoPro_D_ParamSet "id-GostR3410-94-CryptoPro-D-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_D_ParamSet 835 -#define OBJ_id_GostR3410_94_CryptoPro_D_ParamSet OBJ_cryptopro,32L,5L - -#define SN_id_GostR3410_94_CryptoPro_XchA_ParamSet "id-GostR3410-94-CryptoPro-XchA-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_XchA_ParamSet 836 -#define OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet OBJ_cryptopro,33L,1L - -#define SN_id_GostR3410_94_CryptoPro_XchB_ParamSet "id-GostR3410-94-CryptoPro-XchB-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_XchB_ParamSet 837 -#define OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet OBJ_cryptopro,33L,2L - -#define SN_id_GostR3410_94_CryptoPro_XchC_ParamSet "id-GostR3410-94-CryptoPro-XchC-ParamSet" -#define NID_id_GostR3410_94_CryptoPro_XchC_ParamSet 838 -#define OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet OBJ_cryptopro,33L,3L - -#define SN_id_GostR3410_2001_TestParamSet "id-GostR3410-2001-TestParamSet" -#define NID_id_GostR3410_2001_TestParamSet 839 -#define OBJ_id_GostR3410_2001_TestParamSet OBJ_cryptopro,35L,0L - -#define SN_id_GostR3410_2001_CryptoPro_A_ParamSet "id-GostR3410-2001-CryptoPro-A-ParamSet" -#define NID_id_GostR3410_2001_CryptoPro_A_ParamSet 840 -#define OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet OBJ_cryptopro,35L,1L - -#define SN_id_GostR3410_2001_CryptoPro_B_ParamSet "id-GostR3410-2001-CryptoPro-B-ParamSet" -#define NID_id_GostR3410_2001_CryptoPro_B_ParamSet 841 -#define OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet OBJ_cryptopro,35L,2L - -#define SN_id_GostR3410_2001_CryptoPro_C_ParamSet "id-GostR3410-2001-CryptoPro-C-ParamSet" -#define NID_id_GostR3410_2001_CryptoPro_C_ParamSet 842 -#define OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet OBJ_cryptopro,35L,3L - -#define SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet "id-GostR3410-2001-CryptoPro-XchA-ParamSet" -#define NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet 843 -#define OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet OBJ_cryptopro,36L,0L - -#define SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet "id-GostR3410-2001-CryptoPro-XchB-ParamSet" -#define NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet 844 -#define OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet OBJ_cryptopro,36L,1L - -#define SN_id_GostR3410_94_a "id-GostR3410-94-a" -#define NID_id_GostR3410_94_a 845 -#define OBJ_id_GostR3410_94_a OBJ_id_GostR3410_94,1L - -#define SN_id_GostR3410_94_aBis "id-GostR3410-94-aBis" -#define NID_id_GostR3410_94_aBis 846 -#define OBJ_id_GostR3410_94_aBis OBJ_id_GostR3410_94,2L - -#define SN_id_GostR3410_94_b "id-GostR3410-94-b" -#define NID_id_GostR3410_94_b 847 -#define OBJ_id_GostR3410_94_b OBJ_id_GostR3410_94,3L - -#define SN_id_GostR3410_94_bBis "id-GostR3410-94-bBis" -#define NID_id_GostR3410_94_bBis 848 -#define OBJ_id_GostR3410_94_bBis OBJ_id_GostR3410_94,4L - -#define SN_id_Gost28147_89_cc "id-Gost28147-89-cc" -#define LN_id_Gost28147_89_cc "GOST 28147-89 Cryptocom ParamSet" -#define NID_id_Gost28147_89_cc 849 -#define OBJ_id_Gost28147_89_cc OBJ_cryptocom,1L,6L,1L - -#define SN_id_GostR3410_94_cc "gost94cc" -#define LN_id_GostR3410_94_cc "GOST 34.10-94 Cryptocom" -#define NID_id_GostR3410_94_cc 850 -#define OBJ_id_GostR3410_94_cc OBJ_cryptocom,1L,5L,3L - -#define SN_id_GostR3410_2001_cc "gost2001cc" -#define LN_id_GostR3410_2001_cc "GOST 34.10-2001 Cryptocom" -#define NID_id_GostR3410_2001_cc 851 -#define OBJ_id_GostR3410_2001_cc OBJ_cryptocom,1L,5L,4L - -#define SN_id_GostR3411_94_with_GostR3410_94_cc "id-GostR3411-94-with-GostR3410-94-cc" -#define LN_id_GostR3411_94_with_GostR3410_94_cc "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom" -#define NID_id_GostR3411_94_with_GostR3410_94_cc 852 -#define OBJ_id_GostR3411_94_with_GostR3410_94_cc OBJ_cryptocom,1L,3L,3L - -#define SN_id_GostR3411_94_with_GostR3410_2001_cc "id-GostR3411-94-with-GostR3410-2001-cc" -#define LN_id_GostR3411_94_with_GostR3410_2001_cc "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom" -#define NID_id_GostR3411_94_with_GostR3410_2001_cc 853 -#define OBJ_id_GostR3411_94_with_GostR3410_2001_cc OBJ_cryptocom,1L,3L,4L - -#define SN_id_GostR3410_2001_ParamSet_cc "id-GostR3410-2001-ParamSet-cc" -#define LN_id_GostR3410_2001_ParamSet_cc "GOST R 3410-2001 Parameter Set Cryptocom" -#define NID_id_GostR3410_2001_ParamSet_cc 854 -#define OBJ_id_GostR3410_2001_ParamSet_cc OBJ_cryptocom,1L,8L,1L - -#define SN_camellia_128_cbc "CAMELLIA-128-CBC" -#define LN_camellia_128_cbc "camellia-128-cbc" -#define NID_camellia_128_cbc 751 -#define OBJ_camellia_128_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,2L - -#define SN_camellia_192_cbc "CAMELLIA-192-CBC" -#define LN_camellia_192_cbc "camellia-192-cbc" -#define NID_camellia_192_cbc 752 -#define OBJ_camellia_192_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,3L - -#define SN_camellia_256_cbc "CAMELLIA-256-CBC" -#define LN_camellia_256_cbc "camellia-256-cbc" -#define NID_camellia_256_cbc 753 -#define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L - -#define SN_id_camellia128_wrap "id-camellia128-wrap" -#define NID_id_camellia128_wrap 907 -#define OBJ_id_camellia128_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,2L - -#define SN_id_camellia192_wrap "id-camellia192-wrap" -#define NID_id_camellia192_wrap 908 -#define OBJ_id_camellia192_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,3L - -#define SN_id_camellia256_wrap "id-camellia256-wrap" -#define NID_id_camellia256_wrap 909 -#define OBJ_id_camellia256_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,4L - -#define OBJ_ntt_ds 0L,3L,4401L,5L - -#define OBJ_camellia OBJ_ntt_ds,3L,1L,9L - -#define SN_camellia_128_ecb "CAMELLIA-128-ECB" -#define LN_camellia_128_ecb "camellia-128-ecb" -#define NID_camellia_128_ecb 754 -#define OBJ_camellia_128_ecb OBJ_camellia,1L - -#define SN_camellia_128_ofb128 "CAMELLIA-128-OFB" -#define LN_camellia_128_ofb128 "camellia-128-ofb" -#define NID_camellia_128_ofb128 766 -#define OBJ_camellia_128_ofb128 OBJ_camellia,3L - -#define SN_camellia_128_cfb128 "CAMELLIA-128-CFB" -#define LN_camellia_128_cfb128 "camellia-128-cfb" -#define NID_camellia_128_cfb128 757 -#define OBJ_camellia_128_cfb128 OBJ_camellia,4L - -#define SN_camellia_192_ecb "CAMELLIA-192-ECB" -#define LN_camellia_192_ecb "camellia-192-ecb" -#define NID_camellia_192_ecb 755 -#define OBJ_camellia_192_ecb OBJ_camellia,21L - -#define SN_camellia_192_ofb128 "CAMELLIA-192-OFB" -#define LN_camellia_192_ofb128 "camellia-192-ofb" -#define NID_camellia_192_ofb128 767 -#define OBJ_camellia_192_ofb128 OBJ_camellia,23L - -#define SN_camellia_192_cfb128 "CAMELLIA-192-CFB" -#define LN_camellia_192_cfb128 "camellia-192-cfb" -#define NID_camellia_192_cfb128 758 -#define OBJ_camellia_192_cfb128 OBJ_camellia,24L - -#define SN_camellia_256_ecb "CAMELLIA-256-ECB" -#define LN_camellia_256_ecb "camellia-256-ecb" -#define NID_camellia_256_ecb 756 -#define OBJ_camellia_256_ecb OBJ_camellia,41L - -#define SN_camellia_256_ofb128 "CAMELLIA-256-OFB" -#define LN_camellia_256_ofb128 "camellia-256-ofb" -#define NID_camellia_256_ofb128 768 -#define OBJ_camellia_256_ofb128 OBJ_camellia,43L - -#define SN_camellia_256_cfb128 "CAMELLIA-256-CFB" -#define LN_camellia_256_cfb128 "camellia-256-cfb" -#define NID_camellia_256_cfb128 759 -#define OBJ_camellia_256_cfb128 OBJ_camellia,44L - -#define SN_camellia_128_cfb1 "CAMELLIA-128-CFB1" -#define LN_camellia_128_cfb1 "camellia-128-cfb1" -#define NID_camellia_128_cfb1 760 - -#define SN_camellia_192_cfb1 "CAMELLIA-192-CFB1" -#define LN_camellia_192_cfb1 "camellia-192-cfb1" -#define NID_camellia_192_cfb1 761 - -#define SN_camellia_256_cfb1 "CAMELLIA-256-CFB1" -#define LN_camellia_256_cfb1 "camellia-256-cfb1" -#define NID_camellia_256_cfb1 762 - -#define SN_camellia_128_cfb8 "CAMELLIA-128-CFB8" -#define LN_camellia_128_cfb8 "camellia-128-cfb8" -#define NID_camellia_128_cfb8 763 - -#define SN_camellia_192_cfb8 "CAMELLIA-192-CFB8" -#define LN_camellia_192_cfb8 "camellia-192-cfb8" -#define NID_camellia_192_cfb8 764 - -#define SN_camellia_256_cfb8 "CAMELLIA-256-CFB8" -#define LN_camellia_256_cfb8 "camellia-256-cfb8" -#define NID_camellia_256_cfb8 765 - -#define SN_kisa "KISA" -#define LN_kisa "kisa" -#define NID_kisa 773 -#define OBJ_kisa OBJ_member_body,410L,200004L - -#define SN_seed_ecb "SEED-ECB" -#define LN_seed_ecb "seed-ecb" -#define NID_seed_ecb 776 -#define OBJ_seed_ecb OBJ_kisa,1L,3L - -#define SN_seed_cbc "SEED-CBC" -#define LN_seed_cbc "seed-cbc" -#define NID_seed_cbc 777 -#define OBJ_seed_cbc OBJ_kisa,1L,4L - -#define SN_seed_cfb128 "SEED-CFB" -#define LN_seed_cfb128 "seed-cfb" -#define NID_seed_cfb128 779 -#define OBJ_seed_cfb128 OBJ_kisa,1L,5L - -#define SN_seed_ofb128 "SEED-OFB" -#define LN_seed_ofb128 "seed-ofb" -#define NID_seed_ofb128 778 -#define OBJ_seed_ofb128 OBJ_kisa,1L,6L - -#define SN_hmac "HMAC" -#define LN_hmac "hmac" -#define NID_hmac 855 - -#define SN_cmac "CMAC" -#define LN_cmac "cmac" -#define NID_cmac 894 - -#define SN_rc4_hmac_md5 "RC4-HMAC-MD5" -#define LN_rc4_hmac_md5 "rc4-hmac-md5" -#define NID_rc4_hmac_md5 915 - -#define SN_aes_128_cbc_hmac_sha1 "AES-128-CBC-HMAC-SHA1" -#define LN_aes_128_cbc_hmac_sha1 "aes-128-cbc-hmac-sha1" -#define NID_aes_128_cbc_hmac_sha1 916 - -#define SN_aes_192_cbc_hmac_sha1 "AES-192-CBC-HMAC-SHA1" -#define LN_aes_192_cbc_hmac_sha1 "aes-192-cbc-hmac-sha1" -#define NID_aes_192_cbc_hmac_sha1 917 - -#define SN_aes_256_cbc_hmac_sha1 "AES-256-CBC-HMAC-SHA1" -#define LN_aes_256_cbc_hmac_sha1 "aes-256-cbc-hmac-sha1" -#define NID_aes_256_cbc_hmac_sha1 918 - -#define SN_aes_128_cbc_hmac_sha256 "AES-128-CBC-HMAC-SHA256" -#define LN_aes_128_cbc_hmac_sha256 "aes-128-cbc-hmac-sha256" -#define NID_aes_128_cbc_hmac_sha256 948 - -#define SN_aes_192_cbc_hmac_sha256 "AES-192-CBC-HMAC-SHA256" -#define LN_aes_192_cbc_hmac_sha256 "aes-192-cbc-hmac-sha256" -#define NID_aes_192_cbc_hmac_sha256 949 - -#define SN_aes_256_cbc_hmac_sha256 "AES-256-CBC-HMAC-SHA256" -#define LN_aes_256_cbc_hmac_sha256 "aes-256-cbc-hmac-sha256" -#define NID_aes_256_cbc_hmac_sha256 950 - -#define SN_dhpublicnumber "dhpublicnumber" -#define LN_dhpublicnumber "X9.42 DH" -#define NID_dhpublicnumber 920 -#define OBJ_dhpublicnumber OBJ_ISO_US,10046L,2L,1L - -#define SN_brainpoolP160r1 "brainpoolP160r1" -#define NID_brainpoolP160r1 921 -#define OBJ_brainpoolP160r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,1L - -#define SN_brainpoolP160t1 "brainpoolP160t1" -#define NID_brainpoolP160t1 922 -#define OBJ_brainpoolP160t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,2L - -#define SN_brainpoolP192r1 "brainpoolP192r1" -#define NID_brainpoolP192r1 923 -#define OBJ_brainpoolP192r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,3L - -#define SN_brainpoolP192t1 "brainpoolP192t1" -#define NID_brainpoolP192t1 924 -#define OBJ_brainpoolP192t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,4L - -#define SN_brainpoolP224r1 "brainpoolP224r1" -#define NID_brainpoolP224r1 925 -#define OBJ_brainpoolP224r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,5L - -#define SN_brainpoolP224t1 "brainpoolP224t1" -#define NID_brainpoolP224t1 926 -#define OBJ_brainpoolP224t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,6L - -#define SN_brainpoolP256r1 "brainpoolP256r1" -#define NID_brainpoolP256r1 927 -#define OBJ_brainpoolP256r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,7L - -#define SN_brainpoolP256t1 "brainpoolP256t1" -#define NID_brainpoolP256t1 928 -#define OBJ_brainpoolP256t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,8L - -#define SN_brainpoolP320r1 "brainpoolP320r1" -#define NID_brainpoolP320r1 929 -#define OBJ_brainpoolP320r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,9L - -#define SN_brainpoolP320t1 "brainpoolP320t1" -#define NID_brainpoolP320t1 930 -#define OBJ_brainpoolP320t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,10L - -#define SN_brainpoolP384r1 "brainpoolP384r1" -#define NID_brainpoolP384r1 931 -#define OBJ_brainpoolP384r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,11L - -#define SN_brainpoolP384t1 "brainpoolP384t1" -#define NID_brainpoolP384t1 932 -#define OBJ_brainpoolP384t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,12L - -#define SN_brainpoolP512r1 "brainpoolP512r1" -#define NID_brainpoolP512r1 933 -#define OBJ_brainpoolP512r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,13L - -#define SN_brainpoolP512t1 "brainpoolP512t1" -#define NID_brainpoolP512t1 934 -#define OBJ_brainpoolP512t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,14L - -#define OBJ_x9_63_scheme 1L,3L,133L,16L,840L,63L,0L - -#define OBJ_secg_scheme OBJ_certicom_arc,1L - -#define SN_dhSinglePass_stdDH_sha1kdf_scheme "dhSinglePass-stdDH-sha1kdf-scheme" -#define NID_dhSinglePass_stdDH_sha1kdf_scheme 936 -#define OBJ_dhSinglePass_stdDH_sha1kdf_scheme OBJ_x9_63_scheme,2L - -#define SN_dhSinglePass_stdDH_sha224kdf_scheme "dhSinglePass-stdDH-sha224kdf-scheme" -#define NID_dhSinglePass_stdDH_sha224kdf_scheme 937 -#define OBJ_dhSinglePass_stdDH_sha224kdf_scheme OBJ_secg_scheme,11L,0L - -#define SN_dhSinglePass_stdDH_sha256kdf_scheme "dhSinglePass-stdDH-sha256kdf-scheme" -#define NID_dhSinglePass_stdDH_sha256kdf_scheme 938 -#define OBJ_dhSinglePass_stdDH_sha256kdf_scheme OBJ_secg_scheme,11L,1L - -#define SN_dhSinglePass_stdDH_sha384kdf_scheme "dhSinglePass-stdDH-sha384kdf-scheme" -#define NID_dhSinglePass_stdDH_sha384kdf_scheme 939 -#define OBJ_dhSinglePass_stdDH_sha384kdf_scheme OBJ_secg_scheme,11L,2L - -#define SN_dhSinglePass_stdDH_sha512kdf_scheme "dhSinglePass-stdDH-sha512kdf-scheme" -#define NID_dhSinglePass_stdDH_sha512kdf_scheme 940 -#define OBJ_dhSinglePass_stdDH_sha512kdf_scheme OBJ_secg_scheme,11L,3L - -#define SN_dhSinglePass_cofactorDH_sha1kdf_scheme "dhSinglePass-cofactorDH-sha1kdf-scheme" -#define NID_dhSinglePass_cofactorDH_sha1kdf_scheme 941 -#define OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme OBJ_x9_63_scheme,3L - -#define SN_dhSinglePass_cofactorDH_sha224kdf_scheme "dhSinglePass-cofactorDH-sha224kdf-scheme" -#define NID_dhSinglePass_cofactorDH_sha224kdf_scheme 942 -#define OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme OBJ_secg_scheme,14L,0L - -#define SN_dhSinglePass_cofactorDH_sha256kdf_scheme "dhSinglePass-cofactorDH-sha256kdf-scheme" -#define NID_dhSinglePass_cofactorDH_sha256kdf_scheme 943 -#define OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme OBJ_secg_scheme,14L,1L - -#define SN_dhSinglePass_cofactorDH_sha384kdf_scheme "dhSinglePass-cofactorDH-sha384kdf-scheme" -#define NID_dhSinglePass_cofactorDH_sha384kdf_scheme 944 -#define OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme OBJ_secg_scheme,14L,2L - -#define SN_dhSinglePass_cofactorDH_sha512kdf_scheme "dhSinglePass-cofactorDH-sha512kdf-scheme" -#define NID_dhSinglePass_cofactorDH_sha512kdf_scheme 945 -#define OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme OBJ_secg_scheme,14L,3L - -#define SN_dh_std_kdf "dh-std-kdf" -#define NID_dh_std_kdf 946 - -#define SN_dh_cofactor_kdf "dh-cofactor-kdf" -#define NID_dh_cofactor_kdf 947 - -#define SN_ct_precert_scts "ct_precert_scts" -#define LN_ct_precert_scts "CT Precertificate SCTs" -#define NID_ct_precert_scts 951 -#define OBJ_ct_precert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,2L - -#define SN_ct_precert_poison "ct_precert_poison" -#define LN_ct_precert_poison "CT Precertificate Poison" -#define NID_ct_precert_poison 952 -#define OBJ_ct_precert_poison 1L,3L,6L,1L,4L,1L,11129L,2L,4L,3L - -#define SN_ct_precert_signer "ct_precert_signer" -#define LN_ct_precert_signer "CT Precertificate Signer" -#define NID_ct_precert_signer 953 -#define OBJ_ct_precert_signer 1L,3L,6L,1L,4L,1L,11129L,2L,4L,4L - -#define SN_ct_cert_scts "ct_cert_scts" -#define LN_ct_cert_scts "CT Certificate SCTs" -#define NID_ct_cert_scts 954 -#define OBJ_ct_cert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,5L - -#define SN_jurisdictionLocalityName "jurisdictionL" -#define LN_jurisdictionLocalityName "jurisdictionLocalityName" -#define NID_jurisdictionLocalityName 955 -#define OBJ_jurisdictionLocalityName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,1L - -#define SN_jurisdictionStateOrProvinceName "jurisdictionST" -#define LN_jurisdictionStateOrProvinceName "jurisdictionStateOrProvinceName" -#define NID_jurisdictionStateOrProvinceName 956 -#define OBJ_jurisdictionStateOrProvinceName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,2L - -#define SN_jurisdictionCountryName "jurisdictionC" -#define LN_jurisdictionCountryName "jurisdictionCountryName" -#define NID_jurisdictionCountryName 957 -#define OBJ_jurisdictionCountryName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,3L diff --git a/libs/win32/openssl/include/openssl/objects.h b/libs/win32/openssl/include/openssl/objects.h deleted file mode 100644 index b8dafa89ce..0000000000 --- a/libs/win32/openssl/include/openssl/objects.h +++ /dev/null @@ -1,1143 +0,0 @@ -/* crypto/objects/objects.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_OBJECTS_H -# define HEADER_OBJECTS_H - -# define USE_OBJ_MAC - -# ifdef USE_OBJ_MAC -# include -# else -# define SN_undef "UNDEF" -# define LN_undef "undefined" -# define NID_undef 0 -# define OBJ_undef 0L - -# define SN_Algorithm "Algorithm" -# define LN_algorithm "algorithm" -# define NID_algorithm 38 -# define OBJ_algorithm 1L,3L,14L,3L,2L - -# define LN_rsadsi "rsadsi" -# define NID_rsadsi 1 -# define OBJ_rsadsi 1L,2L,840L,113549L - -# define LN_pkcs "pkcs" -# define NID_pkcs 2 -# define OBJ_pkcs OBJ_rsadsi,1L - -# define SN_md2 "MD2" -# define LN_md2 "md2" -# define NID_md2 3 -# define OBJ_md2 OBJ_rsadsi,2L,2L - -# define SN_md5 "MD5" -# define LN_md5 "md5" -# define NID_md5 4 -# define OBJ_md5 OBJ_rsadsi,2L,5L - -# define SN_rc4 "RC4" -# define LN_rc4 "rc4" -# define NID_rc4 5 -# define OBJ_rc4 OBJ_rsadsi,3L,4L - -# define LN_rsaEncryption "rsaEncryption" -# define NID_rsaEncryption 6 -# define OBJ_rsaEncryption OBJ_pkcs,1L,1L - -# define SN_md2WithRSAEncryption "RSA-MD2" -# define LN_md2WithRSAEncryption "md2WithRSAEncryption" -# define NID_md2WithRSAEncryption 7 -# define OBJ_md2WithRSAEncryption OBJ_pkcs,1L,2L - -# define SN_md5WithRSAEncryption "RSA-MD5" -# define LN_md5WithRSAEncryption "md5WithRSAEncryption" -# define NID_md5WithRSAEncryption 8 -# define OBJ_md5WithRSAEncryption OBJ_pkcs,1L,4L - -# define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES" -# define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC" -# define NID_pbeWithMD2AndDES_CBC 9 -# define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs,5L,1L - -# define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES" -# define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC" -# define NID_pbeWithMD5AndDES_CBC 10 -# define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs,5L,3L - -# define LN_X500 "X500" -# define NID_X500 11 -# define OBJ_X500 2L,5L - -# define LN_X509 "X509" -# define NID_X509 12 -# define OBJ_X509 OBJ_X500,4L - -# define SN_commonName "CN" -# define LN_commonName "commonName" -# define NID_commonName 13 -# define OBJ_commonName OBJ_X509,3L - -# define SN_countryName "C" -# define LN_countryName "countryName" -# define NID_countryName 14 -# define OBJ_countryName OBJ_X509,6L - -# define SN_localityName "L" -# define LN_localityName "localityName" -# define NID_localityName 15 -# define OBJ_localityName OBJ_X509,7L - -/* Postal Address? PA */ - -/* should be "ST" (rfc1327) but MS uses 'S' */ -# define SN_stateOrProvinceName "ST" -# define LN_stateOrProvinceName "stateOrProvinceName" -# define NID_stateOrProvinceName 16 -# define OBJ_stateOrProvinceName OBJ_X509,8L - -# define SN_organizationName "O" -# define LN_organizationName "organizationName" -# define NID_organizationName 17 -# define OBJ_organizationName OBJ_X509,10L - -# define SN_organizationalUnitName "OU" -# define LN_organizationalUnitName "organizationalUnitName" -# define NID_organizationalUnitName 18 -# define OBJ_organizationalUnitName OBJ_X509,11L - -# define SN_rsa "RSA" -# define LN_rsa "rsa" -# define NID_rsa 19 -# define OBJ_rsa OBJ_X500,8L,1L,1L - -# define LN_pkcs7 "pkcs7" -# define NID_pkcs7 20 -# define OBJ_pkcs7 OBJ_pkcs,7L - -# define LN_pkcs7_data "pkcs7-data" -# define NID_pkcs7_data 21 -# define OBJ_pkcs7_data OBJ_pkcs7,1L - -# define LN_pkcs7_signed "pkcs7-signedData" -# define NID_pkcs7_signed 22 -# define OBJ_pkcs7_signed OBJ_pkcs7,2L - -# define LN_pkcs7_enveloped "pkcs7-envelopedData" -# define NID_pkcs7_enveloped 23 -# define OBJ_pkcs7_enveloped OBJ_pkcs7,3L - -# define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData" -# define NID_pkcs7_signedAndEnveloped 24 -# define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L - -# define LN_pkcs7_digest "pkcs7-digestData" -# define NID_pkcs7_digest 25 -# define OBJ_pkcs7_digest OBJ_pkcs7,5L - -# define LN_pkcs7_encrypted "pkcs7-encryptedData" -# define NID_pkcs7_encrypted 26 -# define OBJ_pkcs7_encrypted OBJ_pkcs7,6L - -# define LN_pkcs3 "pkcs3" -# define NID_pkcs3 27 -# define OBJ_pkcs3 OBJ_pkcs,3L - -# define LN_dhKeyAgreement "dhKeyAgreement" -# define NID_dhKeyAgreement 28 -# define OBJ_dhKeyAgreement OBJ_pkcs3,1L - -# define SN_des_ecb "DES-ECB" -# define LN_des_ecb "des-ecb" -# define NID_des_ecb 29 -# define OBJ_des_ecb OBJ_algorithm,6L - -# define SN_des_cfb64 "DES-CFB" -# define LN_des_cfb64 "des-cfb" -# define NID_des_cfb64 30 -/* IV + num */ -# define OBJ_des_cfb64 OBJ_algorithm,9L - -# define SN_des_cbc "DES-CBC" -# define LN_des_cbc "des-cbc" -# define NID_des_cbc 31 -/* IV */ -# define OBJ_des_cbc OBJ_algorithm,7L - -# define SN_des_ede "DES-EDE" -# define LN_des_ede "des-ede" -# define NID_des_ede 32 -/* ?? */ -# define OBJ_des_ede OBJ_algorithm,17L - -# define SN_des_ede3 "DES-EDE3" -# define LN_des_ede3 "des-ede3" -# define NID_des_ede3 33 - -# define SN_idea_cbc "IDEA-CBC" -# define LN_idea_cbc "idea-cbc" -# define NID_idea_cbc 34 -# define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L - -# define SN_idea_cfb64 "IDEA-CFB" -# define LN_idea_cfb64 "idea-cfb" -# define NID_idea_cfb64 35 - -# define SN_idea_ecb "IDEA-ECB" -# define LN_idea_ecb "idea-ecb" -# define NID_idea_ecb 36 - -# define SN_rc2_cbc "RC2-CBC" -# define LN_rc2_cbc "rc2-cbc" -# define NID_rc2_cbc 37 -# define OBJ_rc2_cbc OBJ_rsadsi,3L,2L - -# define SN_rc2_ecb "RC2-ECB" -# define LN_rc2_ecb "rc2-ecb" -# define NID_rc2_ecb 38 - -# define SN_rc2_cfb64 "RC2-CFB" -# define LN_rc2_cfb64 "rc2-cfb" -# define NID_rc2_cfb64 39 - -# define SN_rc2_ofb64 "RC2-OFB" -# define LN_rc2_ofb64 "rc2-ofb" -# define NID_rc2_ofb64 40 - -# define SN_sha "SHA" -# define LN_sha "sha" -# define NID_sha 41 -# define OBJ_sha OBJ_algorithm,18L - -# define SN_shaWithRSAEncryption "RSA-SHA" -# define LN_shaWithRSAEncryption "shaWithRSAEncryption" -# define NID_shaWithRSAEncryption 42 -# define OBJ_shaWithRSAEncryption OBJ_algorithm,15L - -# define SN_des_ede_cbc "DES-EDE-CBC" -# define LN_des_ede_cbc "des-ede-cbc" -# define NID_des_ede_cbc 43 - -# define SN_des_ede3_cbc "DES-EDE3-CBC" -# define LN_des_ede3_cbc "des-ede3-cbc" -# define NID_des_ede3_cbc 44 -# define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L - -# define SN_des_ofb64 "DES-OFB" -# define LN_des_ofb64 "des-ofb" -# define NID_des_ofb64 45 -# define OBJ_des_ofb64 OBJ_algorithm,8L - -# define SN_idea_ofb64 "IDEA-OFB" -# define LN_idea_ofb64 "idea-ofb" -# define NID_idea_ofb64 46 - -# define LN_pkcs9 "pkcs9" -# define NID_pkcs9 47 -# define OBJ_pkcs9 OBJ_pkcs,9L - -# define SN_pkcs9_emailAddress "Email" -# define LN_pkcs9_emailAddress "emailAddress" -# define NID_pkcs9_emailAddress 48 -# define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L - -# define LN_pkcs9_unstructuredName "unstructuredName" -# define NID_pkcs9_unstructuredName 49 -# define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L - -# define LN_pkcs9_contentType "contentType" -# define NID_pkcs9_contentType 50 -# define OBJ_pkcs9_contentType OBJ_pkcs9,3L - -# define LN_pkcs9_messageDigest "messageDigest" -# define NID_pkcs9_messageDigest 51 -# define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L - -# define LN_pkcs9_signingTime "signingTime" -# define NID_pkcs9_signingTime 52 -# define OBJ_pkcs9_signingTime OBJ_pkcs9,5L - -# define LN_pkcs9_countersignature "countersignature" -# define NID_pkcs9_countersignature 53 -# define OBJ_pkcs9_countersignature OBJ_pkcs9,6L - -# define LN_pkcs9_challengePassword "challengePassword" -# define NID_pkcs9_challengePassword 54 -# define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L - -# define LN_pkcs9_unstructuredAddress "unstructuredAddress" -# define NID_pkcs9_unstructuredAddress 55 -# define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L - -# define LN_pkcs9_extCertAttributes "extendedCertificateAttributes" -# define NID_pkcs9_extCertAttributes 56 -# define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L - -# define SN_netscape "Netscape" -# define LN_netscape "Netscape Communications Corp." -# define NID_netscape 57 -# define OBJ_netscape 2L,16L,840L,1L,113730L - -# define SN_netscape_cert_extension "nsCertExt" -# define LN_netscape_cert_extension "Netscape Certificate Extension" -# define NID_netscape_cert_extension 58 -# define OBJ_netscape_cert_extension OBJ_netscape,1L - -# define SN_netscape_data_type "nsDataType" -# define LN_netscape_data_type "Netscape Data Type" -# define NID_netscape_data_type 59 -# define OBJ_netscape_data_type OBJ_netscape,2L - -# define SN_des_ede_cfb64 "DES-EDE-CFB" -# define LN_des_ede_cfb64 "des-ede-cfb" -# define NID_des_ede_cfb64 60 - -# define SN_des_ede3_cfb64 "DES-EDE3-CFB" -# define LN_des_ede3_cfb64 "des-ede3-cfb" -# define NID_des_ede3_cfb64 61 - -# define SN_des_ede_ofb64 "DES-EDE-OFB" -# define LN_des_ede_ofb64 "des-ede-ofb" -# define NID_des_ede_ofb64 62 - -# define SN_des_ede3_ofb64 "DES-EDE3-OFB" -# define LN_des_ede3_ofb64 "des-ede3-ofb" -# define NID_des_ede3_ofb64 63 - -/* I'm not sure about the object ID */ -# define SN_sha1 "SHA1" -# define LN_sha1 "sha1" -# define NID_sha1 64 -# define OBJ_sha1 OBJ_algorithm,26L -/* 28 Jun 1996 - eay */ -/* #define OBJ_sha1 1L,3L,14L,2L,26L,05L <- wrong */ - -# define SN_sha1WithRSAEncryption "RSA-SHA1" -# define LN_sha1WithRSAEncryption "sha1WithRSAEncryption" -# define NID_sha1WithRSAEncryption 65 -# define OBJ_sha1WithRSAEncryption OBJ_pkcs,1L,5L - -# define SN_dsaWithSHA "DSA-SHA" -# define LN_dsaWithSHA "dsaWithSHA" -# define NID_dsaWithSHA 66 -# define OBJ_dsaWithSHA OBJ_algorithm,13L - -# define SN_dsa_2 "DSA-old" -# define LN_dsa_2 "dsaEncryption-old" -# define NID_dsa_2 67 -# define OBJ_dsa_2 OBJ_algorithm,12L - -/* proposed by microsoft to RSA */ -# define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64" -# define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC" -# define NID_pbeWithSHA1AndRC2_CBC 68 -# define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs,5L,11L - -/* - * proposed by microsoft to RSA as pbeWithSHA1AndRC4: it is now defined - * explicitly in PKCS#5 v2.0 as id-PBKDF2 which is something completely - * different. - */ -# define LN_id_pbkdf2 "PBKDF2" -# define NID_id_pbkdf2 69 -# define OBJ_id_pbkdf2 OBJ_pkcs,5L,12L - -# define SN_dsaWithSHA1_2 "DSA-SHA1-old" -# define LN_dsaWithSHA1_2 "dsaWithSHA1-old" -# define NID_dsaWithSHA1_2 70 -/* Got this one from 'sdn706r20.pdf' which is actually an NSA document :-) */ -# define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L - -# define SN_netscape_cert_type "nsCertType" -# define LN_netscape_cert_type "Netscape Cert Type" -# define NID_netscape_cert_type 71 -# define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L - -# define SN_netscape_base_url "nsBaseUrl" -# define LN_netscape_base_url "Netscape Base Url" -# define NID_netscape_base_url 72 -# define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L - -# define SN_netscape_revocation_url "nsRevocationUrl" -# define LN_netscape_revocation_url "Netscape Revocation Url" -# define NID_netscape_revocation_url 73 -# define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L - -# define SN_netscape_ca_revocation_url "nsCaRevocationUrl" -# define LN_netscape_ca_revocation_url "Netscape CA Revocation Url" -# define NID_netscape_ca_revocation_url 74 -# define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L - -# define SN_netscape_renewal_url "nsRenewalUrl" -# define LN_netscape_renewal_url "Netscape Renewal Url" -# define NID_netscape_renewal_url 75 -# define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L - -# define SN_netscape_ca_policy_url "nsCaPolicyUrl" -# define LN_netscape_ca_policy_url "Netscape CA Policy Url" -# define NID_netscape_ca_policy_url 76 -# define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L - -# define SN_netscape_ssl_server_name "nsSslServerName" -# define LN_netscape_ssl_server_name "Netscape SSL Server Name" -# define NID_netscape_ssl_server_name 77 -# define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L - -# define SN_netscape_comment "nsComment" -# define LN_netscape_comment "Netscape Comment" -# define NID_netscape_comment 78 -# define OBJ_netscape_comment OBJ_netscape_cert_extension,13L - -# define SN_netscape_cert_sequence "nsCertSequence" -# define LN_netscape_cert_sequence "Netscape Certificate Sequence" -# define NID_netscape_cert_sequence 79 -# define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L - -# define SN_desx_cbc "DESX-CBC" -# define LN_desx_cbc "desx-cbc" -# define NID_desx_cbc 80 - -# define SN_id_ce "id-ce" -# define NID_id_ce 81 -# define OBJ_id_ce 2L,5L,29L - -# define SN_subject_key_identifier "subjectKeyIdentifier" -# define LN_subject_key_identifier "X509v3 Subject Key Identifier" -# define NID_subject_key_identifier 82 -# define OBJ_subject_key_identifier OBJ_id_ce,14L - -# define SN_key_usage "keyUsage" -# define LN_key_usage "X509v3 Key Usage" -# define NID_key_usage 83 -# define OBJ_key_usage OBJ_id_ce,15L - -# define SN_private_key_usage_period "privateKeyUsagePeriod" -# define LN_private_key_usage_period "X509v3 Private Key Usage Period" -# define NID_private_key_usage_period 84 -# define OBJ_private_key_usage_period OBJ_id_ce,16L - -# define SN_subject_alt_name "subjectAltName" -# define LN_subject_alt_name "X509v3 Subject Alternative Name" -# define NID_subject_alt_name 85 -# define OBJ_subject_alt_name OBJ_id_ce,17L - -# define SN_issuer_alt_name "issuerAltName" -# define LN_issuer_alt_name "X509v3 Issuer Alternative Name" -# define NID_issuer_alt_name 86 -# define OBJ_issuer_alt_name OBJ_id_ce,18L - -# define SN_basic_constraints "basicConstraints" -# define LN_basic_constraints "X509v3 Basic Constraints" -# define NID_basic_constraints 87 -# define OBJ_basic_constraints OBJ_id_ce,19L - -# define SN_crl_number "crlNumber" -# define LN_crl_number "X509v3 CRL Number" -# define NID_crl_number 88 -# define OBJ_crl_number OBJ_id_ce,20L - -# define SN_certificate_policies "certificatePolicies" -# define LN_certificate_policies "X509v3 Certificate Policies" -# define NID_certificate_policies 89 -# define OBJ_certificate_policies OBJ_id_ce,32L - -# define SN_authority_key_identifier "authorityKeyIdentifier" -# define LN_authority_key_identifier "X509v3 Authority Key Identifier" -# define NID_authority_key_identifier 90 -# define OBJ_authority_key_identifier OBJ_id_ce,35L - -# define SN_bf_cbc "BF-CBC" -# define LN_bf_cbc "bf-cbc" -# define NID_bf_cbc 91 -# define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L - -# define SN_bf_ecb "BF-ECB" -# define LN_bf_ecb "bf-ecb" -# define NID_bf_ecb 92 - -# define SN_bf_cfb64 "BF-CFB" -# define LN_bf_cfb64 "bf-cfb" -# define NID_bf_cfb64 93 - -# define SN_bf_ofb64 "BF-OFB" -# define LN_bf_ofb64 "bf-ofb" -# define NID_bf_ofb64 94 - -# define SN_mdc2 "MDC2" -# define LN_mdc2 "mdc2" -# define NID_mdc2 95 -# define OBJ_mdc2 2L,5L,8L,3L,101L -/* An alternative? 1L,3L,14L,3L,2L,19L */ - -# define SN_mdc2WithRSA "RSA-MDC2" -# define LN_mdc2WithRSA "mdc2withRSA" -# define NID_mdc2WithRSA 96 -# define OBJ_mdc2WithRSA 2L,5L,8L,3L,100L - -# define SN_rc4_40 "RC4-40" -# define LN_rc4_40 "rc4-40" -# define NID_rc4_40 97 - -# define SN_rc2_40_cbc "RC2-40-CBC" -# define LN_rc2_40_cbc "rc2-40-cbc" -# define NID_rc2_40_cbc 98 - -# define SN_givenName "G" -# define LN_givenName "givenName" -# define NID_givenName 99 -# define OBJ_givenName OBJ_X509,42L - -# define SN_surname "S" -# define LN_surname "surname" -# define NID_surname 100 -# define OBJ_surname OBJ_X509,4L - -# define SN_initials "I" -# define LN_initials "initials" -# define NID_initials 101 -# define OBJ_initials OBJ_X509,43L - -# define SN_uniqueIdentifier "UID" -# define LN_uniqueIdentifier "uniqueIdentifier" -# define NID_uniqueIdentifier 102 -# define OBJ_uniqueIdentifier OBJ_X509,45L - -# define SN_crl_distribution_points "crlDistributionPoints" -# define LN_crl_distribution_points "X509v3 CRL Distribution Points" -# define NID_crl_distribution_points 103 -# define OBJ_crl_distribution_points OBJ_id_ce,31L - -# define SN_md5WithRSA "RSA-NP-MD5" -# define LN_md5WithRSA "md5WithRSA" -# define NID_md5WithRSA 104 -# define OBJ_md5WithRSA OBJ_algorithm,3L - -# define SN_serialNumber "SN" -# define LN_serialNumber "serialNumber" -# define NID_serialNumber 105 -# define OBJ_serialNumber OBJ_X509,5L - -# define SN_title "T" -# define LN_title "title" -# define NID_title 106 -# define OBJ_title OBJ_X509,12L - -# define SN_description "D" -# define LN_description "description" -# define NID_description 107 -# define OBJ_description OBJ_X509,13L - -/* CAST5 is CAST-128, I'm just sticking with the documentation */ -# define SN_cast5_cbc "CAST5-CBC" -# define LN_cast5_cbc "cast5-cbc" -# define NID_cast5_cbc 108 -# define OBJ_cast5_cbc 1L,2L,840L,113533L,7L,66L,10L - -# define SN_cast5_ecb "CAST5-ECB" -# define LN_cast5_ecb "cast5-ecb" -# define NID_cast5_ecb 109 - -# define SN_cast5_cfb64 "CAST5-CFB" -# define LN_cast5_cfb64 "cast5-cfb" -# define NID_cast5_cfb64 110 - -# define SN_cast5_ofb64 "CAST5-OFB" -# define LN_cast5_ofb64 "cast5-ofb" -# define NID_cast5_ofb64 111 - -# define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC" -# define NID_pbeWithMD5AndCast5_CBC 112 -# define OBJ_pbeWithMD5AndCast5_CBC 1L,2L,840L,113533L,7L,66L,12L - -/*- - * This is one sun will soon be using :-( - * id-dsa-with-sha1 ID ::= { - * iso(1) member-body(2) us(840) x9-57 (10040) x9cm(4) 3 } - */ -# define SN_dsaWithSHA1 "DSA-SHA1" -# define LN_dsaWithSHA1 "dsaWithSHA1" -# define NID_dsaWithSHA1 113 -# define OBJ_dsaWithSHA1 1L,2L,840L,10040L,4L,3L - -# define NID_md5_sha1 114 -# define SN_md5_sha1 "MD5-SHA1" -# define LN_md5_sha1 "md5-sha1" - -# define SN_sha1WithRSA "RSA-SHA1-2" -# define LN_sha1WithRSA "sha1WithRSA" -# define NID_sha1WithRSA 115 -# define OBJ_sha1WithRSA OBJ_algorithm,29L - -# define SN_dsa "DSA" -# define LN_dsa "dsaEncryption" -# define NID_dsa 116 -# define OBJ_dsa 1L,2L,840L,10040L,4L,1L - -# define SN_ripemd160 "RIPEMD160" -# define LN_ripemd160 "ripemd160" -# define NID_ripemd160 117 -# define OBJ_ripemd160 1L,3L,36L,3L,2L,1L - -/* - * The name should actually be rsaSignatureWithripemd160, but I'm going to - * continue using the convention I'm using with the other ciphers - */ -# define SN_ripemd160WithRSA "RSA-RIPEMD160" -# define LN_ripemd160WithRSA "ripemd160WithRSA" -# define NID_ripemd160WithRSA 119 -# define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L - -/*- - * Taken from rfc2040 - * RC5_CBC_Parameters ::= SEQUENCE { - * version INTEGER (v1_0(16)), - * rounds INTEGER (8..127), - * blockSizeInBits INTEGER (64, 128), - * iv OCTET STRING OPTIONAL - * } - */ -# define SN_rc5_cbc "RC5-CBC" -# define LN_rc5_cbc "rc5-cbc" -# define NID_rc5_cbc 120 -# define OBJ_rc5_cbc OBJ_rsadsi,3L,8L - -# define SN_rc5_ecb "RC5-ECB" -# define LN_rc5_ecb "rc5-ecb" -# define NID_rc5_ecb 121 - -# define SN_rc5_cfb64 "RC5-CFB" -# define LN_rc5_cfb64 "rc5-cfb" -# define NID_rc5_cfb64 122 - -# define SN_rc5_ofb64 "RC5-OFB" -# define LN_rc5_ofb64 "rc5-ofb" -# define NID_rc5_ofb64 123 - -# define SN_rle_compression "RLE" -# define LN_rle_compression "run length compression" -# define NID_rle_compression 124 -# define OBJ_rle_compression 1L,1L,1L,1L,666L,1L - -# define SN_zlib_compression "ZLIB" -# define LN_zlib_compression "zlib compression" -# define NID_zlib_compression 125 -# define OBJ_zlib_compression 1L,1L,1L,1L,666L,2L - -# define SN_ext_key_usage "extendedKeyUsage" -# define LN_ext_key_usage "X509v3 Extended Key Usage" -# define NID_ext_key_usage 126 -# define OBJ_ext_key_usage OBJ_id_ce,37 - -# define SN_id_pkix "PKIX" -# define NID_id_pkix 127 -# define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L - -# define SN_id_kp "id-kp" -# define NID_id_kp 128 -# define OBJ_id_kp OBJ_id_pkix,3L - -/* PKIX extended key usage OIDs */ - -# define SN_server_auth "serverAuth" -# define LN_server_auth "TLS Web Server Authentication" -# define NID_server_auth 129 -# define OBJ_server_auth OBJ_id_kp,1L - -# define SN_client_auth "clientAuth" -# define LN_client_auth "TLS Web Client Authentication" -# define NID_client_auth 130 -# define OBJ_client_auth OBJ_id_kp,2L - -# define SN_code_sign "codeSigning" -# define LN_code_sign "Code Signing" -# define NID_code_sign 131 -# define OBJ_code_sign OBJ_id_kp,3L - -# define SN_email_protect "emailProtection" -# define LN_email_protect "E-mail Protection" -# define NID_email_protect 132 -# define OBJ_email_protect OBJ_id_kp,4L - -# define SN_time_stamp "timeStamping" -# define LN_time_stamp "Time Stamping" -# define NID_time_stamp 133 -# define OBJ_time_stamp OBJ_id_kp,8L - -/* Additional extended key usage OIDs: Microsoft */ - -# define SN_ms_code_ind "msCodeInd" -# define LN_ms_code_ind "Microsoft Individual Code Signing" -# define NID_ms_code_ind 134 -# define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L - -# define SN_ms_code_com "msCodeCom" -# define LN_ms_code_com "Microsoft Commercial Code Signing" -# define NID_ms_code_com 135 -# define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L - -# define SN_ms_ctl_sign "msCTLSign" -# define LN_ms_ctl_sign "Microsoft Trust List Signing" -# define NID_ms_ctl_sign 136 -# define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L - -# define SN_ms_sgc "msSGC" -# define LN_ms_sgc "Microsoft Server Gated Crypto" -# define NID_ms_sgc 137 -# define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L - -# define SN_ms_efs "msEFS" -# define LN_ms_efs "Microsoft Encrypted File System" -# define NID_ms_efs 138 -# define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L - -/* Additional usage: Netscape */ - -# define SN_ns_sgc "nsSGC" -# define LN_ns_sgc "Netscape Server Gated Crypto" -# define NID_ns_sgc 139 -# define OBJ_ns_sgc OBJ_netscape,4L,1L - -# define SN_delta_crl "deltaCRL" -# define LN_delta_crl "X509v3 Delta CRL Indicator" -# define NID_delta_crl 140 -# define OBJ_delta_crl OBJ_id_ce,27L - -# define SN_crl_reason "CRLReason" -# define LN_crl_reason "CRL Reason Code" -# define NID_crl_reason 141 -# define OBJ_crl_reason OBJ_id_ce,21L - -# define SN_invalidity_date "invalidityDate" -# define LN_invalidity_date "Invalidity Date" -# define NID_invalidity_date 142 -# define OBJ_invalidity_date OBJ_id_ce,24L - -# define SN_sxnet "SXNetID" -# define LN_sxnet "Strong Extranet ID" -# define NID_sxnet 143 -# define OBJ_sxnet 1L,3L,101L,1L,4L,1L - -/* PKCS12 and related OBJECT IDENTIFIERS */ - -# define OBJ_pkcs12 OBJ_pkcs,12L -# define OBJ_pkcs12_pbeids OBJ_pkcs12, 1 - -# define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128" -# define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4" -# define NID_pbe_WithSHA1And128BitRC4 144 -# define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids, 1L - -# define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40" -# define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4" -# define NID_pbe_WithSHA1And40BitRC4 145 -# define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids, 2L - -# define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES" -# define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC" -# define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146 -# define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 3L - -# define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES" -# define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC" -# define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147 -# define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids, 4L - -# define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128" -# define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC" -# define NID_pbe_WithSHA1And128BitRC2_CBC 148 -# define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids, 5L - -# define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40" -# define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC" -# define NID_pbe_WithSHA1And40BitRC2_CBC 149 -# define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids, 6L - -# define OBJ_pkcs12_Version1 OBJ_pkcs12, 10L - -# define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1, 1L - -# define LN_keyBag "keyBag" -# define NID_keyBag 150 -# define OBJ_keyBag OBJ_pkcs12_BagIds, 1L - -# define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag" -# define NID_pkcs8ShroudedKeyBag 151 -# define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds, 2L - -# define LN_certBag "certBag" -# define NID_certBag 152 -# define OBJ_certBag OBJ_pkcs12_BagIds, 3L - -# define LN_crlBag "crlBag" -# define NID_crlBag 153 -# define OBJ_crlBag OBJ_pkcs12_BagIds, 4L - -# define LN_secretBag "secretBag" -# define NID_secretBag 154 -# define OBJ_secretBag OBJ_pkcs12_BagIds, 5L - -# define LN_safeContentsBag "safeContentsBag" -# define NID_safeContentsBag 155 -# define OBJ_safeContentsBag OBJ_pkcs12_BagIds, 6L - -# define LN_friendlyName "friendlyName" -# define NID_friendlyName 156 -# define OBJ_friendlyName OBJ_pkcs9, 20L - -# define LN_localKeyID "localKeyID" -# define NID_localKeyID 157 -# define OBJ_localKeyID OBJ_pkcs9, 21L - -# define OBJ_certTypes OBJ_pkcs9, 22L - -# define LN_x509Certificate "x509Certificate" -# define NID_x509Certificate 158 -# define OBJ_x509Certificate OBJ_certTypes, 1L - -# define LN_sdsiCertificate "sdsiCertificate" -# define NID_sdsiCertificate 159 -# define OBJ_sdsiCertificate OBJ_certTypes, 2L - -# define OBJ_crlTypes OBJ_pkcs9, 23L - -# define LN_x509Crl "x509Crl" -# define NID_x509Crl 160 -# define OBJ_x509Crl OBJ_crlTypes, 1L - -/* PKCS#5 v2 OIDs */ - -# define LN_pbes2 "PBES2" -# define NID_pbes2 161 -# define OBJ_pbes2 OBJ_pkcs,5L,13L - -# define LN_pbmac1 "PBMAC1" -# define NID_pbmac1 162 -# define OBJ_pbmac1 OBJ_pkcs,5L,14L - -# define LN_hmacWithSHA1 "hmacWithSHA1" -# define NID_hmacWithSHA1 163 -# define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L - -/* Policy Qualifier Ids */ - -# define LN_id_qt_cps "Policy Qualifier CPS" -# define SN_id_qt_cps "id-qt-cps" -# define NID_id_qt_cps 164 -# define OBJ_id_qt_cps OBJ_id_pkix,2L,1L - -# define LN_id_qt_unotice "Policy Qualifier User Notice" -# define SN_id_qt_unotice "id-qt-unotice" -# define NID_id_qt_unotice 165 -# define OBJ_id_qt_unotice OBJ_id_pkix,2L,2L - -# define SN_rc2_64_cbc "RC2-64-CBC" -# define LN_rc2_64_cbc "rc2-64-cbc" -# define NID_rc2_64_cbc 166 - -# define SN_SMIMECapabilities "SMIME-CAPS" -# define LN_SMIMECapabilities "S/MIME Capabilities" -# define NID_SMIMECapabilities 167 -# define OBJ_SMIMECapabilities OBJ_pkcs9,15L - -# define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64" -# define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC" -# define NID_pbeWithMD2AndRC2_CBC 168 -# define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs,5L,4L - -# define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64" -# define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC" -# define NID_pbeWithMD5AndRC2_CBC 169 -# define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs,5L,6L - -# define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES" -# define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC" -# define NID_pbeWithSHA1AndDES_CBC 170 -# define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs,5L,10L - -/* Extension request OIDs */ - -# define LN_ms_ext_req "Microsoft Extension Request" -# define SN_ms_ext_req "msExtReq" -# define NID_ms_ext_req 171 -# define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L - -# define LN_ext_req "Extension Request" -# define SN_ext_req "extReq" -# define NID_ext_req 172 -# define OBJ_ext_req OBJ_pkcs9,14L - -# define SN_name "name" -# define LN_name "name" -# define NID_name 173 -# define OBJ_name OBJ_X509,41L - -# define SN_dnQualifier "dnQualifier" -# define LN_dnQualifier "dnQualifier" -# define NID_dnQualifier 174 -# define OBJ_dnQualifier OBJ_X509,46L - -# define SN_id_pe "id-pe" -# define NID_id_pe 175 -# define OBJ_id_pe OBJ_id_pkix,1L - -# define SN_id_ad "id-ad" -# define NID_id_ad 176 -# define OBJ_id_ad OBJ_id_pkix,48L - -# define SN_info_access "authorityInfoAccess" -# define LN_info_access "Authority Information Access" -# define NID_info_access 177 -# define OBJ_info_access OBJ_id_pe,1L - -# define SN_ad_OCSP "OCSP" -# define LN_ad_OCSP "OCSP" -# define NID_ad_OCSP 178 -# define OBJ_ad_OCSP OBJ_id_ad,1L - -# define SN_ad_ca_issuers "caIssuers" -# define LN_ad_ca_issuers "CA Issuers" -# define NID_ad_ca_issuers 179 -# define OBJ_ad_ca_issuers OBJ_id_ad,2L - -# define SN_OCSP_sign "OCSPSigning" -# define LN_OCSP_sign "OCSP Signing" -# define NID_OCSP_sign 180 -# define OBJ_OCSP_sign OBJ_id_kp,9L -# endif /* USE_OBJ_MAC */ - -# include -# include - -# define OBJ_NAME_TYPE_UNDEF 0x00 -# define OBJ_NAME_TYPE_MD_METH 0x01 -# define OBJ_NAME_TYPE_CIPHER_METH 0x02 -# define OBJ_NAME_TYPE_PKEY_METH 0x03 -# define OBJ_NAME_TYPE_COMP_METH 0x04 -# define OBJ_NAME_TYPE_NUM 0x05 - -# define OBJ_NAME_ALIAS 0x8000 - -# define OBJ_BSEARCH_VALUE_ON_NOMATCH 0x01 -# define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH 0x02 - - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct obj_name_st { - int type; - int alias; - const char *name; - const char *data; -} OBJ_NAME; - -# define OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c) - -int OBJ_NAME_init(void); -int OBJ_NAME_new_index(unsigned long (*hash_func) (const char *), - int (*cmp_func) (const char *, const char *), - void (*free_func) (const char *, int, const char *)); -const char *OBJ_NAME_get(const char *name, int type); -int OBJ_NAME_add(const char *name, int type, const char *data); -int OBJ_NAME_remove(const char *name, int type); -void OBJ_NAME_cleanup(int type); /* -1 for everything */ -void OBJ_NAME_do_all(int type, void (*fn) (const OBJ_NAME *, void *arg), - void *arg); -void OBJ_NAME_do_all_sorted(int type, - void (*fn) (const OBJ_NAME *, void *arg), - void *arg); - -ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o); -ASN1_OBJECT *OBJ_nid2obj(int n); -const char *OBJ_nid2ln(int n); -const char *OBJ_nid2sn(int n); -int OBJ_obj2nid(const ASN1_OBJECT *o); -ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name); -int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name); -int OBJ_txt2nid(const char *s); -int OBJ_ln2nid(const char *s); -int OBJ_sn2nid(const char *s); -int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b); -const void *OBJ_bsearch_(const void *key, const void *base, int num, int size, - int (*cmp) (const void *, const void *)); -const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, - int size, - int (*cmp) (const void *, const void *), - int flags); - -# define _DECLARE_OBJ_BSEARCH_CMP_FN(scope, type1, type2, nm) \ - static int nm##_cmp_BSEARCH_CMP_FN(const void *, const void *); \ - static int nm##_cmp(type1 const *, type2 const *); \ - scope type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) - -# define DECLARE_OBJ_BSEARCH_CMP_FN(type1, type2, cmp) \ - _DECLARE_OBJ_BSEARCH_CMP_FN(static, type1, type2, cmp) -# define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \ - type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) - -/*- - * Unsolved problem: if a type is actually a pointer type, like - * nid_triple is, then its impossible to get a const where you need - * it. Consider: - * - * typedef int nid_triple[3]; - * const void *a_; - * const nid_triple const *a = a_; - * - * The assignement discards a const because what you really want is: - * - * const int const * const *a = a_; - * - * But if you do that, you lose the fact that a is an array of 3 ints, - * which breaks comparison functions. - * - * Thus we end up having to cast, sadly, or unpack the - * declarations. Or, as I finally did in this case, delcare nid_triple - * to be a struct, which it should have been in the first place. - * - * Ben, August 2008. - * - * Also, strictly speaking not all types need be const, but handling - * the non-constness means a lot of complication, and in practice - * comparison routines do always not touch their arguments. - */ - -# define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm) \ - static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \ - { \ - type1 const *a = a_; \ - type2 const *b = b_; \ - return nm##_cmp(a,b); \ - } \ - static type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \ - { \ - return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \ - nm##_cmp_BSEARCH_CMP_FN); \ - } \ - extern void dummy_prototype(void) - -# define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm) \ - static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) \ - { \ - type1 const *a = a_; \ - type2 const *b = b_; \ - return nm##_cmp(a,b); \ - } \ - type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \ - { \ - return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \ - nm##_cmp_BSEARCH_CMP_FN); \ - } \ - extern void dummy_prototype(void) - -# define OBJ_bsearch(type1,key,type2,base,num,cmp) \ - ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \ - num,sizeof(type2), \ - ((void)CHECKED_PTR_OF(type1,cmp##_type_1), \ - (void)CHECKED_PTR_OF(type2,cmp##_type_2), \ - cmp##_BSEARCH_CMP_FN))) - -# define OBJ_bsearch_ex(type1,key,type2,base,num,cmp,flags) \ - ((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \ - num,sizeof(type2), \ - ((void)CHECKED_PTR_OF(type1,cmp##_type_1), \ - (void)type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \ - cmp##_BSEARCH_CMP_FN)),flags) - -int OBJ_new_nid(int num); -int OBJ_add_object(const ASN1_OBJECT *obj); -int OBJ_create(const char *oid, const char *sn, const char *ln); -void OBJ_cleanup(void); -int OBJ_create_objects(BIO *in); - -int OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid); -int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid); -int OBJ_add_sigid(int signid, int dig_id, int pkey_id); -void OBJ_sigid_free(void); - -extern int obj_cleanup_defer; -void check_defer(int nid); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_OBJ_strings(void); - -/* Error codes for the OBJ functions. */ - -/* Function codes. */ -# define OBJ_F_OBJ_ADD_OBJECT 105 -# define OBJ_F_OBJ_CREATE 100 -# define OBJ_F_OBJ_DUP 101 -# define OBJ_F_OBJ_NAME_NEW_INDEX 106 -# define OBJ_F_OBJ_NID2LN 102 -# define OBJ_F_OBJ_NID2OBJ 103 -# define OBJ_F_OBJ_NID2SN 104 - -/* Reason codes. */ -# define OBJ_R_MALLOC_FAILURE 100 -# define OBJ_R_UNKNOWN_NID 101 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/ocsp.h b/libs/win32/openssl/include/openssl/ocsp.h deleted file mode 100644 index ca2ee76dce..0000000000 --- a/libs/win32/openssl/include/openssl/ocsp.h +++ /dev/null @@ -1,637 +0,0 @@ -/* ocsp.h */ -/* - * Written by Tom Titchener for the OpenSSL - * project. - */ - -/* - * History: This file was transfered to Richard Levitte from CertCo by Kathy - * Weinhold in mid-spring 2000 to be included in OpenSSL or released as a - * patch kit. - */ - -/* ==================================================================== - * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_OCSP_H -# define HEADER_OCSP_H - -# include -# include -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Various flags and values */ - -# define OCSP_DEFAULT_NONCE_LENGTH 16 - -# define OCSP_NOCERTS 0x1 -# define OCSP_NOINTERN 0x2 -# define OCSP_NOSIGS 0x4 -# define OCSP_NOCHAIN 0x8 -# define OCSP_NOVERIFY 0x10 -# define OCSP_NOEXPLICIT 0x20 -# define OCSP_NOCASIGN 0x40 -# define OCSP_NODELEGATED 0x80 -# define OCSP_NOCHECKS 0x100 -# define OCSP_TRUSTOTHER 0x200 -# define OCSP_RESPID_KEY 0x400 -# define OCSP_NOTIME 0x800 - -/*- CertID ::= SEQUENCE { - * hashAlgorithm AlgorithmIdentifier, - * issuerNameHash OCTET STRING, -- Hash of Issuer's DN - * issuerKeyHash OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields) - * serialNumber CertificateSerialNumber } - */ -typedef struct ocsp_cert_id_st { - X509_ALGOR *hashAlgorithm; - ASN1_OCTET_STRING *issuerNameHash; - ASN1_OCTET_STRING *issuerKeyHash; - ASN1_INTEGER *serialNumber; -} OCSP_CERTID; - -DECLARE_STACK_OF(OCSP_CERTID) - -/*- Request ::= SEQUENCE { - * reqCert CertID, - * singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL } - */ -typedef struct ocsp_one_request_st { - OCSP_CERTID *reqCert; - STACK_OF(X509_EXTENSION) *singleRequestExtensions; -} OCSP_ONEREQ; - -DECLARE_STACK_OF(OCSP_ONEREQ) -DECLARE_ASN1_SET_OF(OCSP_ONEREQ) - -/*- TBSRequest ::= SEQUENCE { - * version [0] EXPLICIT Version DEFAULT v1, - * requestorName [1] EXPLICIT GeneralName OPTIONAL, - * requestList SEQUENCE OF Request, - * requestExtensions [2] EXPLICIT Extensions OPTIONAL } - */ -typedef struct ocsp_req_info_st { - ASN1_INTEGER *version; - GENERAL_NAME *requestorName; - STACK_OF(OCSP_ONEREQ) *requestList; - STACK_OF(X509_EXTENSION) *requestExtensions; -} OCSP_REQINFO; - -/*- Signature ::= SEQUENCE { - * signatureAlgorithm AlgorithmIdentifier, - * signature BIT STRING, - * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } - */ -typedef struct ocsp_signature_st { - X509_ALGOR *signatureAlgorithm; - ASN1_BIT_STRING *signature; - STACK_OF(X509) *certs; -} OCSP_SIGNATURE; - -/*- OCSPRequest ::= SEQUENCE { - * tbsRequest TBSRequest, - * optionalSignature [0] EXPLICIT Signature OPTIONAL } - */ -typedef struct ocsp_request_st { - OCSP_REQINFO *tbsRequest; - OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */ -} OCSP_REQUEST; - -/*- OCSPResponseStatus ::= ENUMERATED { - * successful (0), --Response has valid confirmations - * malformedRequest (1), --Illegal confirmation request - * internalError (2), --Internal error in issuer - * tryLater (3), --Try again later - * --(4) is not used - * sigRequired (5), --Must sign the request - * unauthorized (6) --Request unauthorized - * } - */ -# define OCSP_RESPONSE_STATUS_SUCCESSFUL 0 -# define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST 1 -# define OCSP_RESPONSE_STATUS_INTERNALERROR 2 -# define OCSP_RESPONSE_STATUS_TRYLATER 3 -# define OCSP_RESPONSE_STATUS_SIGREQUIRED 5 -# define OCSP_RESPONSE_STATUS_UNAUTHORIZED 6 - -/*- ResponseBytes ::= SEQUENCE { - * responseType OBJECT IDENTIFIER, - * response OCTET STRING } - */ -typedef struct ocsp_resp_bytes_st { - ASN1_OBJECT *responseType; - ASN1_OCTET_STRING *response; -} OCSP_RESPBYTES; - -/*- OCSPResponse ::= SEQUENCE { - * responseStatus OCSPResponseStatus, - * responseBytes [0] EXPLICIT ResponseBytes OPTIONAL } - */ -struct ocsp_response_st { - ASN1_ENUMERATED *responseStatus; - OCSP_RESPBYTES *responseBytes; -}; - -/*- ResponderID ::= CHOICE { - * byName [1] Name, - * byKey [2] KeyHash } - */ -# define V_OCSP_RESPID_NAME 0 -# define V_OCSP_RESPID_KEY 1 -struct ocsp_responder_id_st { - int type; - union { - X509_NAME *byName; - ASN1_OCTET_STRING *byKey; - } value; -}; - -DECLARE_STACK_OF(OCSP_RESPID) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) - -/*- KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key - * --(excluding the tag and length fields) - */ - -/*- RevokedInfo ::= SEQUENCE { - * revocationTime GeneralizedTime, - * revocationReason [0] EXPLICIT CRLReason OPTIONAL } - */ -typedef struct ocsp_revoked_info_st { - ASN1_GENERALIZEDTIME *revocationTime; - ASN1_ENUMERATED *revocationReason; -} OCSP_REVOKEDINFO; - -/*- CertStatus ::= CHOICE { - * good [0] IMPLICIT NULL, - * revoked [1] IMPLICIT RevokedInfo, - * unknown [2] IMPLICIT UnknownInfo } - */ -# define V_OCSP_CERTSTATUS_GOOD 0 -# define V_OCSP_CERTSTATUS_REVOKED 1 -# define V_OCSP_CERTSTATUS_UNKNOWN 2 -typedef struct ocsp_cert_status_st { - int type; - union { - ASN1_NULL *good; - OCSP_REVOKEDINFO *revoked; - ASN1_NULL *unknown; - } value; -} OCSP_CERTSTATUS; - -/*- SingleResponse ::= SEQUENCE { - * certID CertID, - * certStatus CertStatus, - * thisUpdate GeneralizedTime, - * nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL, - * singleExtensions [1] EXPLICIT Extensions OPTIONAL } - */ -typedef struct ocsp_single_response_st { - OCSP_CERTID *certId; - OCSP_CERTSTATUS *certStatus; - ASN1_GENERALIZEDTIME *thisUpdate; - ASN1_GENERALIZEDTIME *nextUpdate; - STACK_OF(X509_EXTENSION) *singleExtensions; -} OCSP_SINGLERESP; - -DECLARE_STACK_OF(OCSP_SINGLERESP) -DECLARE_ASN1_SET_OF(OCSP_SINGLERESP) - -/*- ResponseData ::= SEQUENCE { - * version [0] EXPLICIT Version DEFAULT v1, - * responderID ResponderID, - * producedAt GeneralizedTime, - * responses SEQUENCE OF SingleResponse, - * responseExtensions [1] EXPLICIT Extensions OPTIONAL } - */ -typedef struct ocsp_response_data_st { - ASN1_INTEGER *version; - OCSP_RESPID *responderId; - ASN1_GENERALIZEDTIME *producedAt; - STACK_OF(OCSP_SINGLERESP) *responses; - STACK_OF(X509_EXTENSION) *responseExtensions; -} OCSP_RESPDATA; - -/*- BasicOCSPResponse ::= SEQUENCE { - * tbsResponseData ResponseData, - * signatureAlgorithm AlgorithmIdentifier, - * signature BIT STRING, - * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL } - */ - /* - * Note 1: The value for "signature" is specified in the OCSP rfc2560 as - * follows: "The value for the signature SHALL be computed on the hash of - * the DER encoding ResponseData." This means that you must hash the - * DER-encoded tbsResponseData, and then run it through a crypto-signing - * function, which will (at least w/RSA) do a hash-'n'-private-encrypt - * operation. This seems a bit odd, but that's the spec. Also note that - * the data structures do not leave anywhere to independently specify the - * algorithm used for the initial hash. So, we look at the - * signature-specification algorithm, and try to do something intelligent. - * -- Kathy Weinhold, CertCo - */ - /* - * Note 2: It seems that the mentioned passage from RFC 2560 (section - * 4.2.1) is open for interpretation. I've done tests against another - * responder, and found that it doesn't do the double hashing that the RFC - * seems to say one should. Therefore, all relevant functions take a flag - * saying which variant should be used. -- Richard Levitte, OpenSSL team - * and CeloCom - */ -typedef struct ocsp_basic_response_st { - OCSP_RESPDATA *tbsResponseData; - X509_ALGOR *signatureAlgorithm; - ASN1_BIT_STRING *signature; - STACK_OF(X509) *certs; -} OCSP_BASICRESP; - -/*- - * CRLReason ::= ENUMERATED { - * unspecified (0), - * keyCompromise (1), - * cACompromise (2), - * affiliationChanged (3), - * superseded (4), - * cessationOfOperation (5), - * certificateHold (6), - * removeFromCRL (8) } - */ -# define OCSP_REVOKED_STATUS_NOSTATUS -1 -# define OCSP_REVOKED_STATUS_UNSPECIFIED 0 -# define OCSP_REVOKED_STATUS_KEYCOMPROMISE 1 -# define OCSP_REVOKED_STATUS_CACOMPROMISE 2 -# define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED 3 -# define OCSP_REVOKED_STATUS_SUPERSEDED 4 -# define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION 5 -# define OCSP_REVOKED_STATUS_CERTIFICATEHOLD 6 -# define OCSP_REVOKED_STATUS_REMOVEFROMCRL 8 - -/*- - * CrlID ::= SEQUENCE { - * crlUrl [0] EXPLICIT IA5String OPTIONAL, - * crlNum [1] EXPLICIT INTEGER OPTIONAL, - * crlTime [2] EXPLICIT GeneralizedTime OPTIONAL } - */ -typedef struct ocsp_crl_id_st { - ASN1_IA5STRING *crlUrl; - ASN1_INTEGER *crlNum; - ASN1_GENERALIZEDTIME *crlTime; -} OCSP_CRLID; - -/*- - * ServiceLocator ::= SEQUENCE { - * issuer Name, - * locator AuthorityInfoAccessSyntax OPTIONAL } - */ -typedef struct ocsp_service_locator_st { - X509_NAME *issuer; - STACK_OF(ACCESS_DESCRIPTION) *locator; -} OCSP_SERVICELOC; - -# define PEM_STRING_OCSP_REQUEST "OCSP REQUEST" -# define PEM_STRING_OCSP_RESPONSE "OCSP RESPONSE" - -# define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p) - -# define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p) - -# define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \ - (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL) - -# define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\ - (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL) - -# define PEM_write_bio_OCSP_REQUEST(bp,o) \ - PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\ - bp,(char *)o, NULL,NULL,0,NULL,NULL) - -# define PEM_write_bio_OCSP_RESPONSE(bp,o) \ - PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\ - bp,(char *)o, NULL,NULL,0,NULL,NULL) - -# define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o) - -# define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o) - -# define OCSP_REQUEST_sign(o,pkey,md) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\ - o->optionalSignature->signatureAlgorithm,NULL,\ - o->optionalSignature->signature,o->tbsRequest,pkey,md) - -# define OCSP_BASICRESP_sign(o,pkey,md,d) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\ - o->signature,o->tbsResponseData,pkey,md) - -# define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\ - a->optionalSignature->signatureAlgorithm,\ - a->optionalSignature->signature,a->tbsRequest,r) - -# define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\ - a->signatureAlgorithm,a->signature,a->tbsResponseData,r) - -# define ASN1_BIT_STRING_digest(data,type,md,len) \ - ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len) - -# define OCSP_CERTSTATUS_dup(cs)\ - (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\ - (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs)) - -OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id); - -OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req); -OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req, - int maxline); -int OCSP_REQ_CTX_nbio(OCSP_REQ_CTX *rctx); -int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx); -OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline); -void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx); -void OCSP_set_max_response_length(OCSP_REQ_CTX *rctx, unsigned long len); -int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, - ASN1_VALUE *val); -int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval, - const ASN1_ITEM *it); -BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx); -int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, - ASN1_VALUE *val); -int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path); -int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req); -int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, - const char *name, const char *value); - -OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer); - -OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, - X509_NAME *issuerName, - ASN1_BIT_STRING *issuerKey, - ASN1_INTEGER *serialNumber); - -OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid); - -int OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len); -int OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len); -int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs); -int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req); - -int OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm); -int OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert); - -int OCSP_request_sign(OCSP_REQUEST *req, - X509 *signer, - EVP_PKEY *key, - const EVP_MD *dgst, - STACK_OF(X509) *certs, unsigned long flags); - -int OCSP_response_status(OCSP_RESPONSE *resp); -OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); - -int OCSP_resp_count(OCSP_BASICRESP *bs); -OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); -int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last); -int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason, - ASN1_GENERALIZEDTIME **revtime, - ASN1_GENERALIZEDTIME **thisupd, - ASN1_GENERALIZEDTIME **nextupd); -int OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status, - int *reason, - ASN1_GENERALIZEDTIME **revtime, - ASN1_GENERALIZEDTIME **thisupd, - ASN1_GENERALIZEDTIME **nextupd); -int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd, - ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec); - -int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs, - X509_STORE *store, unsigned long flags); - -int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath, - int *pssl); - -int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b); -int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b); - -int OCSP_request_onereq_count(OCSP_REQUEST *req); -OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i); -OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one); -int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd, - ASN1_OCTET_STRING **pikeyHash, - ASN1_INTEGER **pserial, OCSP_CERTID *cid); -int OCSP_request_is_signed(OCSP_REQUEST *req); -OCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs); -OCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp, - OCSP_CERTID *cid, - int status, int reason, - ASN1_TIME *revtime, - ASN1_TIME *thisupd, - ASN1_TIME *nextupd); -int OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert); -int OCSP_basic_sign(OCSP_BASICRESP *brsp, - X509 *signer, EVP_PKEY *key, const EVP_MD *dgst, - STACK_OF(X509) *certs, unsigned long flags); - -X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim); - -X509_EXTENSION *OCSP_accept_responses_new(char **oids); - -X509_EXTENSION *OCSP_archive_cutoff_new(char *tim); - -X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME *issuer, char **urls); - -int OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x); -int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos); -int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, - int lastpos); -int OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos); -X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc); -X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc); -void *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit, - int *idx); -int OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit, - unsigned long flags); -int OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc); - -int OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x); -int OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos); -int OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos); -int OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos); -X509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc); -X509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc); -void *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx); -int OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit, - unsigned long flags); -int OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc); - -int OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x); -int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos); -int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, - int lastpos); -int OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit, - int lastpos); -X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc); -X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc); -void *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit, - int *idx); -int OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value, - int crit, unsigned long flags); -int OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc); - -int OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x); -int OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos); -int OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj, - int lastpos); -int OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit, - int lastpos); -X509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc); -X509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc); -void *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit, - int *idx); -int OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value, - int crit, unsigned long flags); -int OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc); - -DECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP) -DECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS) -DECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO) -DECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES) -DECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ) -DECLARE_ASN1_FUNCTIONS(OCSP_CERTID) -DECLARE_ASN1_FUNCTIONS(OCSP_REQUEST) -DECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE) -DECLARE_ASN1_FUNCTIONS(OCSP_REQINFO) -DECLARE_ASN1_FUNCTIONS(OCSP_CRLID) -DECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC) - -const char *OCSP_response_status_str(long s); -const char *OCSP_cert_status_str(long s); -const char *OCSP_crl_reason_str(long s); - -int OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags); -int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags); - -int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs, - X509_STORE *st, unsigned long flags); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_OCSP_strings(void); - -/* Error codes for the OCSP functions. */ - -/* Function codes. */ -# define OCSP_F_ASN1_STRING_ENCODE 100 -# define OCSP_F_D2I_OCSP_NONCE 102 -# define OCSP_F_OCSP_BASIC_ADD1_STATUS 103 -# define OCSP_F_OCSP_BASIC_SIGN 104 -# define OCSP_F_OCSP_BASIC_VERIFY 105 -# define OCSP_F_OCSP_CERT_ID_NEW 101 -# define OCSP_F_OCSP_CHECK_DELEGATED 106 -# define OCSP_F_OCSP_CHECK_IDS 107 -# define OCSP_F_OCSP_CHECK_ISSUER 108 -# define OCSP_F_OCSP_CHECK_VALIDITY 115 -# define OCSP_F_OCSP_MATCH_ISSUERID 109 -# define OCSP_F_OCSP_PARSE_URL 114 -# define OCSP_F_OCSP_REQUEST_SIGN 110 -# define OCSP_F_OCSP_REQUEST_VERIFY 116 -# define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111 -# define OCSP_F_OCSP_SENDREQ_BIO 112 -# define OCSP_F_OCSP_SENDREQ_NBIO 117 -# define OCSP_F_PARSE_HTTP_LINE1 118 -# define OCSP_F_REQUEST_VERIFY 113 - -/* Reason codes. */ -# define OCSP_R_BAD_DATA 100 -# define OCSP_R_CERTIFICATE_VERIFY_ERROR 101 -# define OCSP_R_DIGEST_ERR 102 -# define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122 -# define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123 -# define OCSP_R_ERROR_PARSING_URL 121 -# define OCSP_R_MISSING_OCSPSIGNING_USAGE 103 -# define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124 -# define OCSP_R_NOT_BASIC_RESPONSE 104 -# define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105 -# define OCSP_R_NO_CONTENT 106 -# define OCSP_R_NO_PUBLIC_KEY 107 -# define OCSP_R_NO_RESPONSE_DATA 108 -# define OCSP_R_NO_REVOKED_TIME 109 -# define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110 -# define OCSP_R_REQUEST_NOT_SIGNED 128 -# define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111 -# define OCSP_R_ROOT_CA_NOT_TRUSTED 112 -# define OCSP_R_SERVER_READ_ERROR 113 -# define OCSP_R_SERVER_RESPONSE_ERROR 114 -# define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115 -# define OCSP_R_SERVER_WRITE_ERROR 116 -# define OCSP_R_SIGNATURE_FAILURE 117 -# define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118 -# define OCSP_R_STATUS_EXPIRED 125 -# define OCSP_R_STATUS_NOT_YET_VALID 126 -# define OCSP_R_STATUS_TOO_OLD 127 -# define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119 -# define OCSP_R_UNKNOWN_NID 120 -# define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/opensslv.h b/libs/win32/openssl/include/openssl/opensslv.h deleted file mode 100644 index 645dd0793f..0000000000 --- a/libs/win32/openssl/include/openssl/opensslv.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef HEADER_OPENSSLV_H -# define HEADER_OPENSSLV_H - -#ifdef __cplusplus -extern "C" { -#endif - -/*- - * Numeric release version identifier: - * MNNFFPPS: major minor fix patch status - * The status nibble has one of the values 0 for development, 1 to e for betas - * 1 to 14, and f for release. The patch level is exactly that. - * For example: - * 0.9.3-dev 0x00903000 - * 0.9.3-beta1 0x00903001 - * 0.9.3-beta2-dev 0x00903002 - * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) - * 0.9.3 0x0090300f - * 0.9.3a 0x0090301f - * 0.9.4 0x0090400f - * 1.2.3z 0x102031af - * - * For continuity reasons (because 0.9.5 is already out, and is coded - * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level - * part is slightly different, by setting the highest bit. This means - * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start - * with 0x0090600S... - * - * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) - * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for - * major minor fix final patch/beta) - */ -# define OPENSSL_VERSION_NUMBER 0x100020bfL -# ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2k-fips 26 Jan 2017" -# else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2k 26 Jan 2017" -# endif -# define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT - -/*- - * The macros below are to be used for shared library (.so, .dll, ...) - * versioning. That kind of versioning works a bit differently between - * operating systems. The most usual scheme is to set a major and a minor - * number, and have the runtime loader check that the major number is equal - * to what it was at application link time, while the minor number has to - * be greater or equal to what it was at application link time. With this - * scheme, the version number is usually part of the file name, like this: - * - * libcrypto.so.0.9 - * - * Some unixen also make a softlink with the major verson number only: - * - * libcrypto.so.0 - * - * On Tru64 and IRIX 6.x it works a little bit differently. There, the - * shared library version is stored in the file, and is actually a series - * of versions, separated by colons. The rightmost version present in the - * library when linking an application is stored in the application to be - * matched at run time. When the application is run, a check is done to - * see if the library version stored in the application matches any of the - * versions in the version string of the library itself. - * This version string can be constructed in any way, depending on what - * kind of matching is desired. However, to implement the same scheme as - * the one used in the other unixen, all compatible versions, from lowest - * to highest, should be part of the string. Consecutive builds would - * give the following versions strings: - * - * 3.0 - * 3.0:3.1 - * 3.0:3.1:3.2 - * 4.0 - * 4.0:4.1 - * - * Notice how version 4 is completely incompatible with version, and - * therefore give the breach you can see. - * - * There may be other schemes as well that I haven't yet discovered. - * - * So, here's the way it works here: first of all, the library version - * number doesn't need at all to match the overall OpenSSL version. - * However, it's nice and more understandable if it actually does. - * The current library version is stored in the macro SHLIB_VERSION_NUMBER, - * which is just a piece of text in the format "M.m.e" (Major, minor, edit). - * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, - * we need to keep a history of version numbers, which is done in the - * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and - * should only keep the versions that are binary compatible with the current. - */ -# define SHLIB_VERSION_HISTORY "" -# define SHLIB_VERSION_NUMBER "1.0.0" - - -#ifdef __cplusplus -} -#endif -#endif /* HEADER_OPENSSLV_H */ diff --git a/libs/win32/openssl/include/openssl/ossl_typ.h b/libs/win32/openssl/include/openssl/ossl_typ.h deleted file mode 100644 index 364d26238e..0000000000 --- a/libs/win32/openssl/include/openssl/ossl_typ.h +++ /dev/null @@ -1,213 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_OPENSSL_TYPES_H -# define HEADER_OPENSSL_TYPES_H - -#ifdef __cplusplus -extern "C" { -#endif - -# include - -# ifdef NO_ASN1_TYPEDEFS -# define ASN1_INTEGER ASN1_STRING -# define ASN1_ENUMERATED ASN1_STRING -# define ASN1_BIT_STRING ASN1_STRING -# define ASN1_OCTET_STRING ASN1_STRING -# define ASN1_PRINTABLESTRING ASN1_STRING -# define ASN1_T61STRING ASN1_STRING -# define ASN1_IA5STRING ASN1_STRING -# define ASN1_UTCTIME ASN1_STRING -# define ASN1_GENERALIZEDTIME ASN1_STRING -# define ASN1_TIME ASN1_STRING -# define ASN1_GENERALSTRING ASN1_STRING -# define ASN1_UNIVERSALSTRING ASN1_STRING -# define ASN1_BMPSTRING ASN1_STRING -# define ASN1_VISIBLESTRING ASN1_STRING -# define ASN1_UTF8STRING ASN1_STRING -# define ASN1_BOOLEAN int -# define ASN1_NULL int -# else -typedef struct asn1_string_st ASN1_INTEGER; -typedef struct asn1_string_st ASN1_ENUMERATED; -typedef struct asn1_string_st ASN1_BIT_STRING; -typedef struct asn1_string_st ASN1_OCTET_STRING; -typedef struct asn1_string_st ASN1_PRINTABLESTRING; -typedef struct asn1_string_st ASN1_T61STRING; -typedef struct asn1_string_st ASN1_IA5STRING; -typedef struct asn1_string_st ASN1_GENERALSTRING; -typedef struct asn1_string_st ASN1_UNIVERSALSTRING; -typedef struct asn1_string_st ASN1_BMPSTRING; -typedef struct asn1_string_st ASN1_UTCTIME; -typedef struct asn1_string_st ASN1_TIME; -typedef struct asn1_string_st ASN1_GENERALIZEDTIME; -typedef struct asn1_string_st ASN1_VISIBLESTRING; -typedef struct asn1_string_st ASN1_UTF8STRING; -typedef struct asn1_string_st ASN1_STRING; -typedef int ASN1_BOOLEAN; -typedef int ASN1_NULL; -# endif - -typedef struct asn1_object_st ASN1_OBJECT; - -typedef struct ASN1_ITEM_st ASN1_ITEM; -typedef struct asn1_pctx_st ASN1_PCTX; - -# ifdef OPENSSL_SYS_WIN32 -# undef X509_NAME -# undef X509_EXTENSIONS -# undef X509_CERT_PAIR -# undef PKCS7_ISSUER_AND_SERIAL -# undef OCSP_REQUEST -# undef OCSP_RESPONSE -# endif - -# ifdef BIGNUM -# undef BIGNUM -# endif -typedef struct bignum_st BIGNUM; -typedef struct bignum_ctx BN_CTX; -typedef struct bn_blinding_st BN_BLINDING; -typedef struct bn_mont_ctx_st BN_MONT_CTX; -typedef struct bn_recp_ctx_st BN_RECP_CTX; -typedef struct bn_gencb_st BN_GENCB; - -typedef struct buf_mem_st BUF_MEM; - -typedef struct evp_cipher_st EVP_CIPHER; -typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; -typedef struct env_md_st EVP_MD; -typedef struct env_md_ctx_st EVP_MD_CTX; -typedef struct evp_pkey_st EVP_PKEY; - -typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD; - -typedef struct evp_pkey_method_st EVP_PKEY_METHOD; -typedef struct evp_pkey_ctx_st EVP_PKEY_CTX; - -typedef struct dh_st DH; -typedef struct dh_method DH_METHOD; - -typedef struct dsa_st DSA; -typedef struct dsa_method DSA_METHOD; - -typedef struct rsa_st RSA; -typedef struct rsa_meth_st RSA_METHOD; - -typedef struct rand_meth_st RAND_METHOD; - -typedef struct ecdh_method ECDH_METHOD; -typedef struct ecdsa_method ECDSA_METHOD; - -typedef struct x509_st X509; -typedef struct X509_algor_st X509_ALGOR; -typedef struct X509_crl_st X509_CRL; -typedef struct x509_crl_method_st X509_CRL_METHOD; -typedef struct x509_revoked_st X509_REVOKED; -typedef struct X509_name_st X509_NAME; -typedef struct X509_pubkey_st X509_PUBKEY; -typedef struct x509_store_st X509_STORE; -typedef struct x509_store_ctx_st X509_STORE_CTX; - -typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO; - -typedef struct v3_ext_ctx X509V3_CTX; -typedef struct conf_st CONF; - -typedef struct store_st STORE; -typedef struct store_method_st STORE_METHOD; - -typedef struct ui_st UI; -typedef struct ui_method_st UI_METHOD; - -typedef struct st_ERR_FNS ERR_FNS; - -typedef struct engine_st ENGINE; -typedef struct ssl_st SSL; -typedef struct ssl_ctx_st SSL_CTX; - -typedef struct comp_method_st COMP_METHOD; - -typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; -typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; -typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; -typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE; - -typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID; -typedef struct DIST_POINT_st DIST_POINT; -typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT; -typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS; - - /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */ -# define DECLARE_PKCS12_STACK_OF(type)/* Nothing */ -# define IMPLEMENT_PKCS12_STACK_OF(type)/* Nothing */ - -typedef struct crypto_ex_data_st CRYPTO_EX_DATA; -/* Callback types for crypto.h */ -typedef int CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad, - int idx, long argl, void *argp); -typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad, - int idx, long argl, void *argp); -typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, - void *from_d, int idx, long argl, void *argp); - -typedef struct ocsp_req_ctx_st OCSP_REQ_CTX; -typedef struct ocsp_response_st OCSP_RESPONSE; -typedef struct ocsp_responder_id_st OCSP_RESPID; - -#ifdef __cplusplus -} -#endif -#endif /* def HEADER_OPENSSL_TYPES_H */ diff --git a/libs/win32/openssl/include/openssl/pem.h b/libs/win32/openssl/include/openssl/pem.h deleted file mode 100644 index aac72fb21e..0000000000 --- a/libs/win32/openssl/include/openssl/pem.h +++ /dev/null @@ -1,617 +0,0 @@ -/* crypto/pem/pem.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_PEM_H -# define HEADER_PEM_H - -# include -# ifndef OPENSSL_NO_BIO -# include -# endif -# ifndef OPENSSL_NO_STACK -# include -# endif -# include -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# define PEM_BUFSIZE 1024 - -# define PEM_OBJ_UNDEF 0 -# define PEM_OBJ_X509 1 -# define PEM_OBJ_X509_REQ 2 -# define PEM_OBJ_CRL 3 -# define PEM_OBJ_SSL_SESSION 4 -# define PEM_OBJ_PRIV_KEY 10 -# define PEM_OBJ_PRIV_RSA 11 -# define PEM_OBJ_PRIV_DSA 12 -# define PEM_OBJ_PRIV_DH 13 -# define PEM_OBJ_PUB_RSA 14 -# define PEM_OBJ_PUB_DSA 15 -# define PEM_OBJ_PUB_DH 16 -# define PEM_OBJ_DHPARAMS 17 -# define PEM_OBJ_DSAPARAMS 18 -# define PEM_OBJ_PRIV_RSA_PUBLIC 19 -# define PEM_OBJ_PRIV_ECDSA 20 -# define PEM_OBJ_PUB_ECDSA 21 -# define PEM_OBJ_ECPARAMETERS 22 - -# define PEM_ERROR 30 -# define PEM_DEK_DES_CBC 40 -# define PEM_DEK_IDEA_CBC 45 -# define PEM_DEK_DES_EDE 50 -# define PEM_DEK_DES_ECB 60 -# define PEM_DEK_RSA 70 -# define PEM_DEK_RSA_MD2 80 -# define PEM_DEK_RSA_MD5 90 - -# define PEM_MD_MD2 NID_md2 -# define PEM_MD_MD5 NID_md5 -# define PEM_MD_SHA NID_sha -# define PEM_MD_MD2_RSA NID_md2WithRSAEncryption -# define PEM_MD_MD5_RSA NID_md5WithRSAEncryption -# define PEM_MD_SHA_RSA NID_sha1WithRSAEncryption - -# define PEM_STRING_X509_OLD "X509 CERTIFICATE" -# define PEM_STRING_X509 "CERTIFICATE" -# define PEM_STRING_X509_PAIR "CERTIFICATE PAIR" -# define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" -# define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" -# define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" -# define PEM_STRING_X509_CRL "X509 CRL" -# define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY" -# define PEM_STRING_PUBLIC "PUBLIC KEY" -# define PEM_STRING_RSA "RSA PRIVATE KEY" -# define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY" -# define PEM_STRING_DSA "DSA PRIVATE KEY" -# define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY" -# define PEM_STRING_PKCS7 "PKCS7" -# define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" -# define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" -# define PEM_STRING_PKCS8INF "PRIVATE KEY" -# define PEM_STRING_DHPARAMS "DH PARAMETERS" -# define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS" -# define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" -# define PEM_STRING_DSAPARAMS "DSA PARAMETERS" -# define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" -# define PEM_STRING_ECPARAMETERS "EC PARAMETERS" -# define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" -# define PEM_STRING_PARAMETERS "PARAMETERS" -# define PEM_STRING_CMS "CMS" - - /* - * Note that this structure is initialised by PEM_SealInit and cleaned up - * by PEM_SealFinal (at least for now) - */ -typedef struct PEM_Encode_Seal_st { - EVP_ENCODE_CTX encode; - EVP_MD_CTX md; - EVP_CIPHER_CTX cipher; -} PEM_ENCODE_SEAL_CTX; - -/* enc_type is one off */ -# define PEM_TYPE_ENCRYPTED 10 -# define PEM_TYPE_MIC_ONLY 20 -# define PEM_TYPE_MIC_CLEAR 30 -# define PEM_TYPE_CLEAR 40 - -typedef struct pem_recip_st { - char *name; - X509_NAME *dn; - int cipher; - int key_enc; - /* char iv[8]; unused and wrong size */ -} PEM_USER; - -typedef struct pem_ctx_st { - int type; /* what type of object */ - struct { - int version; - int mode; - } proc_type; - - char *domain; - - struct { - int cipher; - /*- - unused, and wrong size - unsigned char iv[8]; */ - } DEK_info; - - PEM_USER *originator; - - int num_recipient; - PEM_USER **recipient; -/*- - XXX(ben): don#t think this is used! - STACK *x509_chain; / * certificate chain */ - EVP_MD *md; /* signature type */ - - int md_enc; /* is the md encrypted or not? */ - int md_len; /* length of md_data */ - char *md_data; /* message digest, could be pkey encrypted */ - - EVP_CIPHER *dec; /* date encryption cipher */ - int key_len; /* key length */ - unsigned char *key; /* key */ - /*- - unused, and wrong size - unsigned char iv[8]; */ - - int data_enc; /* is the data encrypted */ - int data_len; - unsigned char *data; -} PEM_CTX; - -/* - * These macros make the PEM_read/PEM_write functions easier to maintain and - * write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or - * IMPLEMENT_PEM_rw_cb(...) - */ - -# ifdef OPENSSL_NO_FP_API - -# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/ -# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ -# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ -# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ -# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ -# else - -# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ -type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\ -{ \ -return PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str,fp,(void **)x,cb,u); \ -} - -# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ -int PEM_write_##name(FILE *fp, type *x) \ -{ \ -return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL); \ -} - -# define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ -int PEM_write_##name(FILE *fp, const type *x) \ -{ \ -return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(void *)x,NULL,NULL,0,NULL,NULL); \ -} - -# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ -int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, \ - void *u) \ - { \ - return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \ - } - -# define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ -int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, \ - void *u) \ - { \ - return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \ - } - -# endif - -# define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ -type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\ -{ \ -return PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \ -} - -# define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ -int PEM_write_bio_##name(BIO *bp, type *x) \ -{ \ -return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL); \ -} - -# define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ -int PEM_write_bio_##name(BIO *bp, const type *x) \ -{ \ -return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,NULL,NULL,0,NULL,NULL); \ -} - -# define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ -int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ - { \ - return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u); \ - } - -# define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ -int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ - { \ - return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,enc,kstr,klen,cb,u); \ - } - -# define IMPLEMENT_PEM_write(name, type, str, asn1) \ - IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_write_fp(name, type, str, asn1) - -# define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) - -# define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) - -# define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) - -# define IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_read_fp(name, type, str, asn1) - -# define IMPLEMENT_PEM_rw(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write(name, type, str, asn1) - -# define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write_const(name, type, str, asn1) - -# define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb(name, type, str, asn1) - -/* These are the same except they are for the declarations */ - -# if defined(OPENSSL_NO_FP_API) - -# define DECLARE_PEM_read_fp(name, type) /**/ -# define DECLARE_PEM_write_fp(name, type) /**/ -# define DECLARE_PEM_write_cb_fp(name, type) /**/ -# else - -# define DECLARE_PEM_read_fp(name, type) \ - type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); - -# define DECLARE_PEM_write_fp(name, type) \ - int PEM_write_##name(FILE *fp, type *x); - -# define DECLARE_PEM_write_fp_const(name, type) \ - int PEM_write_##name(FILE *fp, const type *x); - -# define DECLARE_PEM_write_cb_fp(name, type) \ - int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u); - -# endif - -# ifndef OPENSSL_NO_BIO -# define DECLARE_PEM_read_bio(name, type) \ - type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); - -# define DECLARE_PEM_write_bio(name, type) \ - int PEM_write_bio_##name(BIO *bp, type *x); - -# define DECLARE_PEM_write_bio_const(name, type) \ - int PEM_write_bio_##name(BIO *bp, const type *x); - -# define DECLARE_PEM_write_cb_bio(name, type) \ - int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u); - -# else - -# define DECLARE_PEM_read_bio(name, type) /**/ -# define DECLARE_PEM_write_bio(name, type) /**/ -# define DECLARE_PEM_write_bio_const(name, type) /**/ -# define DECLARE_PEM_write_cb_bio(name, type) /**/ -# endif -# define DECLARE_PEM_write(name, type) \ - DECLARE_PEM_write_bio(name, type) \ - DECLARE_PEM_write_fp(name, type) -# define DECLARE_PEM_write_const(name, type) \ - DECLARE_PEM_write_bio_const(name, type) \ - DECLARE_PEM_write_fp_const(name, type) -# define DECLARE_PEM_write_cb(name, type) \ - DECLARE_PEM_write_cb_bio(name, type) \ - DECLARE_PEM_write_cb_fp(name, type) -# define DECLARE_PEM_read(name, type) \ - DECLARE_PEM_read_bio(name, type) \ - DECLARE_PEM_read_fp(name, type) -# define DECLARE_PEM_rw(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write(name, type) -# define DECLARE_PEM_rw_const(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write_const(name, type) -# define DECLARE_PEM_rw_cb(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write_cb(name, type) -# if 1 -/* "userdata": new with OpenSSL 0.9.4 */ -typedef int pem_password_cb (char *buf, int size, int rwflag, void *userdata); -# else -/* OpenSSL 0.9.3, 0.9.3a */ -typedef int pem_password_cb (char *buf, int size, int rwflag); -# endif - -int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); -int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len, - pem_password_cb *callback, void *u); - -# ifndef OPENSSL_NO_BIO -int PEM_read_bio(BIO *bp, char **name, char **header, - unsigned char **data, long *len); -int PEM_write_bio(BIO *bp, const char *name, const char *hdr, - const unsigned char *data, long len); -int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, - const char *name, BIO *bp, pem_password_cb *cb, - void *u); -void *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x, - pem_password_cb *cb, void *u); -int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x, - const EVP_CIPHER *enc, unsigned char *kstr, int klen, - pem_password_cb *cb, void *u); - -STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, - pem_password_cb *cb, void *u); -int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, - unsigned char *kstr, int klen, - pem_password_cb *cd, void *u); -# endif - -int PEM_read(FILE *fp, char **name, char **header, - unsigned char **data, long *len); -int PEM_write(FILE *fp, const char *name, const char *hdr, - const unsigned char *data, long len); -void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, - pem_password_cb *cb, void *u); -int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp, - void *x, const EVP_CIPHER *enc, unsigned char *kstr, - int klen, pem_password_cb *callback, void *u); -STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, - pem_password_cb *cb, void *u); - -int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, - EVP_MD *md_type, unsigned char **ek, int *ekl, - unsigned char *iv, EVP_PKEY **pubk, int npubk); -void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, - unsigned char *in, int inl); -int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl, - unsigned char *out, int *outl, EVP_PKEY *priv); - -void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type); -void PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt); -int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, - unsigned int *siglen, EVP_PKEY *pkey); - -int PEM_def_callback(char *buf, int num, int w, void *key); -void PEM_proc_type(char *buf, int type); -void PEM_dek_info(char *buf, const char *type, int len, char *str); - -# include - -DECLARE_PEM_rw(X509, X509) -DECLARE_PEM_rw(X509_AUX, X509) -DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR) -DECLARE_PEM_rw(X509_REQ, X509_REQ) -DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) -DECLARE_PEM_rw(X509_CRL, X509_CRL) -DECLARE_PEM_rw(PKCS7, PKCS7) -DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE) -DECLARE_PEM_rw(PKCS8, X509_SIG) -DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) -# ifndef OPENSSL_NO_RSA -DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) -DECLARE_PEM_rw_const(RSAPublicKey, RSA) -DECLARE_PEM_rw(RSA_PUBKEY, RSA) -# endif -# ifndef OPENSSL_NO_DSA -DECLARE_PEM_rw_cb(DSAPrivateKey, DSA) -DECLARE_PEM_rw(DSA_PUBKEY, DSA) -DECLARE_PEM_rw_const(DSAparams, DSA) -# endif -# ifndef OPENSSL_NO_EC -DECLARE_PEM_rw_const(ECPKParameters, EC_GROUP) -DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY) -DECLARE_PEM_rw(EC_PUBKEY, EC_KEY) -# endif -# ifndef OPENSSL_NO_DH -DECLARE_PEM_rw_const(DHparams, DH) -DECLARE_PEM_write_const(DHxparams, DH) -# endif -DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY) -DECLARE_PEM_rw(PUBKEY, EVP_PKEY) - -int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, - char *kstr, int klen, - pem_password_cb *cb, void *u); -int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *, - char *, int, pem_password_cb *, void *); -int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, - char *kstr, int klen, - pem_password_cb *cb, void *u); -int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, - char *kstr, int klen, - pem_password_cb *cb, void *u); -EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, - void *u); - -int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, - char *kstr, int klen, - pem_password_cb *cb, void *u); -int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, - char *kstr, int klen, - pem_password_cb *cb, void *u); -int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, - char *kstr, int klen, - pem_password_cb *cb, void *u); - -EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, - void *u); - -int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, - char *kstr, int klen, pem_password_cb *cd, - void *u); - -EVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x); -int PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x); - -EVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length); -EVP_PKEY *b2i_PublicKey(const unsigned char **in, long length); -EVP_PKEY *b2i_PrivateKey_bio(BIO *in); -EVP_PKEY *b2i_PublicKey_bio(BIO *in); -int i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk); -int i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk); -# ifndef OPENSSL_NO_RC4 -EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u); -int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, - pem_password_cb *cb, void *u); -# endif - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ - -void ERR_load_PEM_strings(void); - -/* Error codes for the PEM functions. */ - -/* Function codes. */ -# define PEM_F_B2I_DSS 127 -# define PEM_F_B2I_PVK_BIO 128 -# define PEM_F_B2I_RSA 129 -# define PEM_F_CHECK_BITLEN_DSA 130 -# define PEM_F_CHECK_BITLEN_RSA 131 -# define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120 -# define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121 -# define PEM_F_DO_B2I 132 -# define PEM_F_DO_B2I_BIO 133 -# define PEM_F_DO_BLOB_HEADER 134 -# define PEM_F_DO_PK8PKEY 126 -# define PEM_F_DO_PK8PKEY_FP 125 -# define PEM_F_DO_PVK_BODY 135 -# define PEM_F_DO_PVK_HEADER 136 -# define PEM_F_I2B_PVK 137 -# define PEM_F_I2B_PVK_BIO 138 -# define PEM_F_LOAD_IV 101 -# define PEM_F_PEM_ASN1_READ 102 -# define PEM_F_PEM_ASN1_READ_BIO 103 -# define PEM_F_PEM_ASN1_WRITE 104 -# define PEM_F_PEM_ASN1_WRITE_BIO 105 -# define PEM_F_PEM_DEF_CALLBACK 100 -# define PEM_F_PEM_DO_HEADER 106 -# define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY 118 -# define PEM_F_PEM_GET_EVP_CIPHER_INFO 107 -# define PEM_F_PEM_PK8PKEY 119 -# define PEM_F_PEM_READ 108 -# define PEM_F_PEM_READ_BIO 109 -# define PEM_F_PEM_READ_BIO_DHPARAMS 141 -# define PEM_F_PEM_READ_BIO_PARAMETERS 140 -# define PEM_F_PEM_READ_BIO_PRIVATEKEY 123 -# define PEM_F_PEM_READ_DHPARAMS 142 -# define PEM_F_PEM_READ_PRIVATEKEY 124 -# define PEM_F_PEM_SEALFINAL 110 -# define PEM_F_PEM_SEALINIT 111 -# define PEM_F_PEM_SIGNFINAL 112 -# define PEM_F_PEM_WRITE 113 -# define PEM_F_PEM_WRITE_BIO 114 -# define PEM_F_PEM_WRITE_PRIVATEKEY 139 -# define PEM_F_PEM_X509_INFO_READ 115 -# define PEM_F_PEM_X509_INFO_READ_BIO 116 -# define PEM_F_PEM_X509_INFO_WRITE_BIO 117 - -/* Reason codes. */ -# define PEM_R_BAD_BASE64_DECODE 100 -# define PEM_R_BAD_DECRYPT 101 -# define PEM_R_BAD_END_LINE 102 -# define PEM_R_BAD_IV_CHARS 103 -# define PEM_R_BAD_MAGIC_NUMBER 116 -# define PEM_R_BAD_PASSWORD_READ 104 -# define PEM_R_BAD_VERSION_NUMBER 117 -# define PEM_R_BIO_WRITE_FAILURE 118 -# define PEM_R_CIPHER_IS_NULL 127 -# define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115 -# define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119 -# define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120 -# define PEM_R_HEADER_TOO_LONG 128 -# define PEM_R_INCONSISTENT_HEADER 121 -# define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122 -# define PEM_R_KEYBLOB_TOO_SHORT 123 -# define PEM_R_NOT_DEK_INFO 105 -# define PEM_R_NOT_ENCRYPTED 106 -# define PEM_R_NOT_PROC_TYPE 107 -# define PEM_R_NO_START_LINE 108 -# define PEM_R_PROBLEMS_GETTING_PASSWORD 109 -# define PEM_R_PUBLIC_KEY_NO_RSA 110 -# define PEM_R_PVK_DATA_TOO_SHORT 124 -# define PEM_R_PVK_TOO_SHORT 125 -# define PEM_R_READ_KEY 111 -# define PEM_R_SHORT_HEADER 112 -# define PEM_R_UNSUPPORTED_CIPHER 113 -# define PEM_R_UNSUPPORTED_ENCRYPTION 114 -# define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126 - -# ifdef __cplusplus -} -# endif -#endif diff --git a/libs/win32/openssl/include/openssl/pem2.h b/libs/win32/openssl/include/openssl/pem2.h deleted file mode 100644 index 84897d5ec3..0000000000 --- a/libs/win32/openssl/include/openssl/pem2.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -/* - * This header only exists to break a circular dependency between pem and err - * Ben 30 Jan 1999. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef HEADER_PEM_H -void ERR_load_PEM_strings(void); -#endif - -#ifdef __cplusplus -} -#endif diff --git a/libs/win32/openssl/include/openssl/pkcs12.h b/libs/win32/openssl/include/openssl/pkcs12.h deleted file mode 100644 index 21f1f62b36..0000000000 --- a/libs/win32/openssl/include/openssl/pkcs12.h +++ /dev/null @@ -1,342 +0,0 @@ -/* pkcs12.h */ -/* - * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project - * 1999. - */ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_PKCS12_H -# define HEADER_PKCS12_H - -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# define PKCS12_KEY_ID 1 -# define PKCS12_IV_ID 2 -# define PKCS12_MAC_ID 3 - -/* Default iteration count */ -# ifndef PKCS12_DEFAULT_ITER -# define PKCS12_DEFAULT_ITER PKCS5_DEFAULT_ITER -# endif - -# define PKCS12_MAC_KEY_LENGTH 20 - -# define PKCS12_SALT_LEN 8 - -/* Uncomment out next line for unicode password and names, otherwise ASCII */ - -/* - * #define PBE_UNICODE - */ - -# ifdef PBE_UNICODE -# define PKCS12_key_gen PKCS12_key_gen_uni -# define PKCS12_add_friendlyname PKCS12_add_friendlyname_uni -# else -# define PKCS12_key_gen PKCS12_key_gen_asc -# define PKCS12_add_friendlyname PKCS12_add_friendlyname_asc -# endif - -/* MS key usage constants */ - -# define KEY_EX 0x10 -# define KEY_SIG 0x80 - -typedef struct { - X509_SIG *dinfo; - ASN1_OCTET_STRING *salt; - ASN1_INTEGER *iter; /* defaults to 1 */ -} PKCS12_MAC_DATA; - -typedef struct { - ASN1_INTEGER *version; - PKCS12_MAC_DATA *mac; - PKCS7 *authsafes; -} PKCS12; - -typedef struct { - ASN1_OBJECT *type; - union { - struct pkcs12_bag_st *bag; /* secret, crl and certbag */ - struct pkcs8_priv_key_info_st *keybag; /* keybag */ - X509_SIG *shkeybag; /* shrouded key bag */ - STACK_OF(PKCS12_SAFEBAG) *safes; - ASN1_TYPE *other; - } value; - STACK_OF(X509_ATTRIBUTE) *attrib; -} PKCS12_SAFEBAG; - -DECLARE_STACK_OF(PKCS12_SAFEBAG) -DECLARE_ASN1_SET_OF(PKCS12_SAFEBAG) -DECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG) - -typedef struct pkcs12_bag_st { - ASN1_OBJECT *type; - union { - ASN1_OCTET_STRING *x509cert; - ASN1_OCTET_STRING *x509crl; - ASN1_OCTET_STRING *octet; - ASN1_IA5STRING *sdsicert; - ASN1_TYPE *other; /* Secret or other bag */ - } value; -} PKCS12_BAGS; - -# define PKCS12_ERROR 0 -# define PKCS12_OK 1 - -/* Compatibility macros */ - -# define M_PKCS12_x5092certbag PKCS12_x5092certbag -# define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag - -# define M_PKCS12_certbag2x509 PKCS12_certbag2x509 -# define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl - -# define M_PKCS12_unpack_p7data PKCS12_unpack_p7data -# define M_PKCS12_pack_authsafes PKCS12_pack_authsafes -# define M_PKCS12_unpack_authsafes PKCS12_unpack_authsafes -# define M_PKCS12_unpack_p7encdata PKCS12_unpack_p7encdata - -# define M_PKCS12_decrypt_skey PKCS12_decrypt_skey -# define M_PKCS8_decrypt PKCS8_decrypt - -# define M_PKCS12_bag_type(bg) OBJ_obj2nid((bg)->type) -# define M_PKCS12_cert_bag_type(bg) OBJ_obj2nid((bg)->value.bag->type) -# define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type - -# define PKCS12_get_attr(bag, attr_nid) \ - PKCS12_get_attr_gen(bag->attrib, attr_nid) - -# define PKCS8_get_attr(p8, attr_nid) \ - PKCS12_get_attr_gen(p8->attributes, attr_nid) - -# define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0) - -PKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509); -PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl); -X509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag); -X509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag); - -PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, - int nid1, int nid2); -PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8); -PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass, - int passlen); -PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag, - const char *pass, int passlen); -X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, - const char *pass, int passlen, unsigned char *salt, - int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8); -PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass, - int passlen, unsigned char *salt, - int saltlen, int iter, - PKCS8_PRIV_KEY_INFO *p8); -PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk); -STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7); -PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, - unsigned char *salt, int saltlen, int iter, - STACK_OF(PKCS12_SAFEBAG) *bags); -STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, - int passlen); - -int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes); -STACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12); - -int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, - int namelen); -int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, - int namelen); -int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, - int namelen); -int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag, - const unsigned char *name, int namelen); -int PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage); -ASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid); -char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag); -unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, - int passlen, unsigned char *in, int inlen, - unsigned char **data, int *datalen, - int en_de); -void *PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it, - const char *pass, int passlen, - ASN1_OCTET_STRING *oct, int zbuf); -ASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor, - const ASN1_ITEM *it, - const char *pass, int passlen, - void *obj, int zbuf); -PKCS12 *PKCS12_init(int mode); -int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt, - int saltlen, int id, int iter, int n, - unsigned char *out, const EVP_MD *md_type); -int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, - int saltlen, int id, int iter, int n, - unsigned char *out, const EVP_MD *md_type); -int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, - ASN1_TYPE *param, const EVP_CIPHER *cipher, - const EVP_MD *md_type, int en_de); -int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen, - unsigned char *mac, unsigned int *maclen); -int PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen); -int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen, - unsigned char *salt, int saltlen, int iter, - const EVP_MD *md_type); -int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, - int saltlen, const EVP_MD *md_type); -unsigned char *OPENSSL_asc2uni(const char *asc, int asclen, - unsigned char **uni, int *unilen); -char *OPENSSL_uni2asc(unsigned char *uni, int unilen); - -DECLARE_ASN1_FUNCTIONS(PKCS12) -DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA) -DECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG) -DECLARE_ASN1_FUNCTIONS(PKCS12_BAGS) - -DECLARE_ASN1_ITEM(PKCS12_SAFEBAGS) -DECLARE_ASN1_ITEM(PKCS12_AUTHSAFES) - -void PKCS12_PBE_add(void); -int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, - STACK_OF(X509) **ca); -PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, - STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, - int mac_iter, int keytype); - -PKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert); -PKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags, - EVP_PKEY *key, int key_usage, int iter, - int key_nid, char *pass); -int PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags, - int safe_nid, int iter, char *pass); -PKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid); - -int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12); -int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12); -PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12); -PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12); -int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_PKCS12_strings(void); - -/* Error codes for the PKCS12 functions. */ - -/* Function codes. */ -# define PKCS12_F_PARSE_BAG 129 -# define PKCS12_F_PARSE_BAGS 103 -# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME 100 -# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC 127 -# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI 102 -# define PKCS12_F_PKCS12_ADD_LOCALKEYID 104 -# define PKCS12_F_PKCS12_CREATE 105 -# define PKCS12_F_PKCS12_GEN_MAC 107 -# define PKCS12_F_PKCS12_INIT 109 -# define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106 -# define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108 -# define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117 -# define PKCS12_F_PKCS12_KEY_GEN_ASC 110 -# define PKCS12_F_PKCS12_KEY_GEN_UNI 111 -# define PKCS12_F_PKCS12_MAKE_KEYBAG 112 -# define PKCS12_F_PKCS12_MAKE_SHKEYBAG 113 -# define PKCS12_F_PKCS12_NEWPASS 128 -# define PKCS12_F_PKCS12_PACK_P7DATA 114 -# define PKCS12_F_PKCS12_PACK_P7ENCDATA 115 -# define PKCS12_F_PKCS12_PARSE 118 -# define PKCS12_F_PKCS12_PBE_CRYPT 119 -# define PKCS12_F_PKCS12_PBE_KEYIVGEN 120 -# define PKCS12_F_PKCS12_SETUP_MAC 122 -# define PKCS12_F_PKCS12_SET_MAC 123 -# define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130 -# define PKCS12_F_PKCS12_UNPACK_P7DATA 131 -# define PKCS12_F_PKCS12_VERIFY_MAC 126 -# define PKCS12_F_PKCS8_ADD_KEYUSAGE 124 -# define PKCS12_F_PKCS8_ENCRYPT 125 - -/* Reason codes. */ -# define PKCS12_R_CANT_PACK_STRUCTURE 100 -# define PKCS12_R_CONTENT_TYPE_NOT_DATA 121 -# define PKCS12_R_DECODE_ERROR 101 -# define PKCS12_R_ENCODE_ERROR 102 -# define PKCS12_R_ENCRYPT_ERROR 103 -# define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120 -# define PKCS12_R_INVALID_NULL_ARGUMENT 104 -# define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105 -# define PKCS12_R_IV_GEN_ERROR 106 -# define PKCS12_R_KEY_GEN_ERROR 107 -# define PKCS12_R_MAC_ABSENT 108 -# define PKCS12_R_MAC_GENERATION_ERROR 109 -# define PKCS12_R_MAC_SETUP_ERROR 110 -# define PKCS12_R_MAC_STRING_SET_ERROR 111 -# define PKCS12_R_MAC_VERIFY_ERROR 112 -# define PKCS12_R_MAC_VERIFY_FAILURE 113 -# define PKCS12_R_PARSE_ERROR 114 -# define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115 -# define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116 -# define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117 -# define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118 -# define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/pkcs7.h b/libs/win32/openssl/include/openssl/pkcs7.h deleted file mode 100644 index b51b3863eb..0000000000 --- a/libs/win32/openssl/include/openssl/pkcs7.h +++ /dev/null @@ -1,481 +0,0 @@ -/* crypto/pkcs7/pkcs7.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_PKCS7_H -# define HEADER_PKCS7_H - -# include -# include -# include - -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# ifdef OPENSSL_SYS_WIN32 -/* Under Win32 thes are defined in wincrypt.h */ -# undef PKCS7_ISSUER_AND_SERIAL -# undef PKCS7_SIGNER_INFO -# endif - -/*- -Encryption_ID DES-CBC -Digest_ID MD5 -Digest_Encryption_ID rsaEncryption -Key_Encryption_ID rsaEncryption -*/ - -typedef struct pkcs7_issuer_and_serial_st { - X509_NAME *issuer; - ASN1_INTEGER *serial; -} PKCS7_ISSUER_AND_SERIAL; - -typedef struct pkcs7_signer_info_st { - ASN1_INTEGER *version; /* version 1 */ - PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; - X509_ALGOR *digest_alg; - STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */ - X509_ALGOR *digest_enc_alg; - ASN1_OCTET_STRING *enc_digest; - STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */ - /* The private key to sign with */ - EVP_PKEY *pkey; -} PKCS7_SIGNER_INFO; - -DECLARE_STACK_OF(PKCS7_SIGNER_INFO) -DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) - -typedef struct pkcs7_recip_info_st { - ASN1_INTEGER *version; /* version 0 */ - PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; - X509_ALGOR *key_enc_algor; - ASN1_OCTET_STRING *enc_key; - X509 *cert; /* get the pub-key from this */ -} PKCS7_RECIP_INFO; - -DECLARE_STACK_OF(PKCS7_RECIP_INFO) -DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) - -typedef struct pkcs7_signed_st { - ASN1_INTEGER *version; /* version 1 */ - STACK_OF(X509_ALGOR) *md_algs; /* md used */ - STACK_OF(X509) *cert; /* [ 0 ] */ - STACK_OF(X509_CRL) *crl; /* [ 1 ] */ - STACK_OF(PKCS7_SIGNER_INFO) *signer_info; - struct pkcs7_st *contents; -} PKCS7_SIGNED; -/* - * The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about - * merging the two - */ - -typedef struct pkcs7_enc_content_st { - ASN1_OBJECT *content_type; - X509_ALGOR *algorithm; - ASN1_OCTET_STRING *enc_data; /* [ 0 ] */ - const EVP_CIPHER *cipher; -} PKCS7_ENC_CONTENT; - -typedef struct pkcs7_enveloped_st { - ASN1_INTEGER *version; /* version 0 */ - STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; - PKCS7_ENC_CONTENT *enc_data; -} PKCS7_ENVELOPE; - -typedef struct pkcs7_signedandenveloped_st { - ASN1_INTEGER *version; /* version 1 */ - STACK_OF(X509_ALGOR) *md_algs; /* md used */ - STACK_OF(X509) *cert; /* [ 0 ] */ - STACK_OF(X509_CRL) *crl; /* [ 1 ] */ - STACK_OF(PKCS7_SIGNER_INFO) *signer_info; - PKCS7_ENC_CONTENT *enc_data; - STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; -} PKCS7_SIGN_ENVELOPE; - -typedef struct pkcs7_digest_st { - ASN1_INTEGER *version; /* version 0 */ - X509_ALGOR *md; /* md used */ - struct pkcs7_st *contents; - ASN1_OCTET_STRING *digest; -} PKCS7_DIGEST; - -typedef struct pkcs7_encrypted_st { - ASN1_INTEGER *version; /* version 0 */ - PKCS7_ENC_CONTENT *enc_data; -} PKCS7_ENCRYPT; - -typedef struct pkcs7_st { - /* - * The following is non NULL if it contains ASN1 encoding of this - * structure - */ - unsigned char *asn1; - long length; -# define PKCS7_S_HEADER 0 -# define PKCS7_S_BODY 1 -# define PKCS7_S_TAIL 2 - int state; /* used during processing */ - int detached; - ASN1_OBJECT *type; - /* content as defined by the type */ - /* - * all encryption/message digests are applied to the 'contents', leaving - * out the 'type' field. - */ - union { - char *ptr; - /* NID_pkcs7_data */ - ASN1_OCTET_STRING *data; - /* NID_pkcs7_signed */ - PKCS7_SIGNED *sign; - /* NID_pkcs7_enveloped */ - PKCS7_ENVELOPE *enveloped; - /* NID_pkcs7_signedAndEnveloped */ - PKCS7_SIGN_ENVELOPE *signed_and_enveloped; - /* NID_pkcs7_digest */ - PKCS7_DIGEST *digest; - /* NID_pkcs7_encrypted */ - PKCS7_ENCRYPT *encrypted; - /* Anything else */ - ASN1_TYPE *other; - } d; -} PKCS7; - -DECLARE_STACK_OF(PKCS7) -DECLARE_ASN1_SET_OF(PKCS7) -DECLARE_PKCS12_STACK_OF(PKCS7) - -# define PKCS7_OP_SET_DETACHED_SIGNATURE 1 -# define PKCS7_OP_GET_DETACHED_SIGNATURE 2 - -# define PKCS7_get_signed_attributes(si) ((si)->auth_attr) -# define PKCS7_get_attributes(si) ((si)->unauth_attr) - -# define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed) -# define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted) -# define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped) -# define PKCS7_type_is_signedAndEnveloped(a) \ - (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped) -# define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data) -# define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest) - -# define PKCS7_set_detached(p,v) \ - PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL) -# define PKCS7_get_detached(p) \ - PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL) - -# define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7)) - -/* S/MIME related flags */ - -# define PKCS7_TEXT 0x1 -# define PKCS7_NOCERTS 0x2 -# define PKCS7_NOSIGS 0x4 -# define PKCS7_NOCHAIN 0x8 -# define PKCS7_NOINTERN 0x10 -# define PKCS7_NOVERIFY 0x20 -# define PKCS7_DETACHED 0x40 -# define PKCS7_BINARY 0x80 -# define PKCS7_NOATTR 0x100 -# define PKCS7_NOSMIMECAP 0x200 -# define PKCS7_NOOLDMIMETYPE 0x400 -# define PKCS7_CRLFEOL 0x800 -# define PKCS7_STREAM 0x1000 -# define PKCS7_NOCRL 0x2000 -# define PKCS7_PARTIAL 0x4000 -# define PKCS7_REUSE_DIGEST 0x8000 - -/* Flags: for compatibility with older code */ - -# define SMIME_TEXT PKCS7_TEXT -# define SMIME_NOCERTS PKCS7_NOCERTS -# define SMIME_NOSIGS PKCS7_NOSIGS -# define SMIME_NOCHAIN PKCS7_NOCHAIN -# define SMIME_NOINTERN PKCS7_NOINTERN -# define SMIME_NOVERIFY PKCS7_NOVERIFY -# define SMIME_DETACHED PKCS7_DETACHED -# define SMIME_BINARY PKCS7_BINARY -# define SMIME_NOATTR PKCS7_NOATTR - -DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) - -int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data, - const EVP_MD *type, unsigned char *md, - unsigned int *len); -# ifndef OPENSSL_NO_FP_API -PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7); -int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7); -# endif -PKCS7 *PKCS7_dup(PKCS7 *p7); -PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7); -int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7); -int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); -int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); - -DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO) -DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO) -DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED) -DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT) -DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE) -DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE) -DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST) -DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT) -DECLARE_ASN1_FUNCTIONS(PKCS7) - -DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN) -DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY) - -DECLARE_ASN1_NDEF_FUNCTION(PKCS7) -DECLARE_ASN1_PRINT_FUNCTION(PKCS7) - -long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg); - -int PKCS7_set_type(PKCS7 *p7, int type); -int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); -int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); -int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, - const EVP_MD *dgst); -int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si); -int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); -int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); -int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); -int PKCS7_content_new(PKCS7 *p7, int nid); -int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, - BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si); -int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, - X509 *x509); - -BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); -int PKCS7_dataFinal(PKCS7 *p7, BIO *bio); -BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert); - -PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, - EVP_PKEY *pkey, const EVP_MD *dgst); -X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); -int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); -STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); - -PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); -void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk, - X509_ALGOR **pdig, X509_ALGOR **psig); -void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc); -int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); -int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); -int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher); -int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7); - -PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); -ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); -int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type, - void *data); -int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, - void *value); -ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); -ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); -int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, - STACK_OF(X509_ATTRIBUTE) *sk); -int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si, - STACK_OF(X509_ATTRIBUTE) *sk); - -PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, - BIO *data, int flags); - -PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, - X509 *signcert, EVP_PKEY *pkey, - const EVP_MD *md, int flags); - -int PKCS7_final(PKCS7 *p7, BIO *data, int flags); -int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, - BIO *indata, BIO *out, int flags); -STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, - int flags); -PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, - int flags); -int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, - int flags); - -int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, - STACK_OF(X509_ALGOR) *cap); -STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); -int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); - -int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid); -int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t); -int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si, - const unsigned char *md, int mdlen); - -int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); -PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); - -BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_PKCS7_strings(void); - -/* Error codes for the PKCS7 functions. */ - -/* Function codes. */ -# define PKCS7_F_B64_READ_PKCS7 120 -# define PKCS7_F_B64_WRITE_PKCS7 121 -# define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB 136 -# define PKCS7_F_I2D_PKCS7_BIO_STREAM 140 -# define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME 135 -# define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118 -# define PKCS7_F_PKCS7_ADD_CERTIFICATE 100 -# define PKCS7_F_PKCS7_ADD_CRL 101 -# define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102 -# define PKCS7_F_PKCS7_ADD_SIGNATURE 131 -# define PKCS7_F_PKCS7_ADD_SIGNER 103 -# define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125 -# define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST 138 -# define PKCS7_F_PKCS7_CTRL 104 -# define PKCS7_F_PKCS7_DATADECODE 112 -# define PKCS7_F_PKCS7_DATAFINAL 128 -# define PKCS7_F_PKCS7_DATAINIT 105 -# define PKCS7_F_PKCS7_DATASIGN 106 -# define PKCS7_F_PKCS7_DATAVERIFY 107 -# define PKCS7_F_PKCS7_DECRYPT 114 -# define PKCS7_F_PKCS7_DECRYPT_RINFO 133 -# define PKCS7_F_PKCS7_ENCODE_RINFO 132 -# define PKCS7_F_PKCS7_ENCRYPT 115 -# define PKCS7_F_PKCS7_FINAL 134 -# define PKCS7_F_PKCS7_FIND_DIGEST 127 -# define PKCS7_F_PKCS7_GET0_SIGNERS 124 -# define PKCS7_F_PKCS7_RECIP_INFO_SET 130 -# define PKCS7_F_PKCS7_SET_CIPHER 108 -# define PKCS7_F_PKCS7_SET_CONTENT 109 -# define PKCS7_F_PKCS7_SET_DIGEST 126 -# define PKCS7_F_PKCS7_SET_TYPE 110 -# define PKCS7_F_PKCS7_SIGN 116 -# define PKCS7_F_PKCS7_SIGNATUREVERIFY 113 -# define PKCS7_F_PKCS7_SIGNER_INFO_SET 129 -# define PKCS7_F_PKCS7_SIGNER_INFO_SIGN 139 -# define PKCS7_F_PKCS7_SIGN_ADD_SIGNER 137 -# define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119 -# define PKCS7_F_PKCS7_VERIFY 117 -# define PKCS7_F_SMIME_READ_PKCS7 122 -# define PKCS7_F_SMIME_TEXT 123 - -/* Reason codes. */ -# define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117 -# define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144 -# define PKCS7_R_CIPHER_NOT_INITIALIZED 116 -# define PKCS7_R_CONTENT_AND_DATA_PRESENT 118 -# define PKCS7_R_CTRL_ERROR 152 -# define PKCS7_R_DECODE_ERROR 130 -# define PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH 100 -# define PKCS7_R_DECRYPT_ERROR 119 -# define PKCS7_R_DIGEST_FAILURE 101 -# define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149 -# define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150 -# define PKCS7_R_ERROR_ADDING_RECIPIENT 120 -# define PKCS7_R_ERROR_SETTING_CIPHER 121 -# define PKCS7_R_INVALID_MIME_TYPE 131 -# define PKCS7_R_INVALID_NULL_POINTER 143 -# define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155 -# define PKCS7_R_MIME_NO_CONTENT_TYPE 132 -# define PKCS7_R_MIME_PARSE_ERROR 133 -# define PKCS7_R_MIME_SIG_PARSE_ERROR 134 -# define PKCS7_R_MISSING_CERIPEND_INFO 103 -# define PKCS7_R_NO_CONTENT 122 -# define PKCS7_R_NO_CONTENT_TYPE 135 -# define PKCS7_R_NO_DEFAULT_DIGEST 151 -# define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154 -# define PKCS7_R_NO_MULTIPART_BODY_FAILURE 136 -# define PKCS7_R_NO_MULTIPART_BOUNDARY 137 -# define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115 -# define PKCS7_R_NO_RECIPIENT_MATCHES_KEY 146 -# define PKCS7_R_NO_SIGNATURES_ON_DATA 123 -# define PKCS7_R_NO_SIGNERS 142 -# define PKCS7_R_NO_SIG_CONTENT_TYPE 138 -# define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104 -# define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124 -# define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153 -# define PKCS7_R_PKCS7_DATAFINAL 126 -# define PKCS7_R_PKCS7_DATAFINAL_ERROR 125 -# define PKCS7_R_PKCS7_DATASIGN 145 -# define PKCS7_R_PKCS7_PARSE_ERROR 139 -# define PKCS7_R_PKCS7_SIG_PARSE_ERROR 140 -# define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127 -# define PKCS7_R_SIGNATURE_FAILURE 105 -# define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128 -# define PKCS7_R_SIGNING_CTRL_FAILURE 147 -# define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148 -# define PKCS7_R_SIG_INVALID_MIME_TYPE 141 -# define PKCS7_R_SMIME_TEXT_ERROR 129 -# define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106 -# define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107 -# define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108 -# define PKCS7_R_UNKNOWN_DIGEST_TYPE 109 -# define PKCS7_R_UNKNOWN_OPERATION 110 -# define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111 -# define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112 -# define PKCS7_R_WRONG_CONTENT_TYPE 113 -# define PKCS7_R_WRONG_PKCS7_TYPE 114 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/pqueue.h b/libs/win32/openssl/include/openssl/pqueue.h deleted file mode 100644 index d40d9c7d85..0000000000 --- a/libs/win32/openssl/include/openssl/pqueue.h +++ /dev/null @@ -1,99 +0,0 @@ -/* crypto/pqueue/pqueue.h */ -/* - * DTLS implementation written by Nagendra Modadugu - * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. - */ -/* ==================================================================== - * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_PQUEUE_H -# define HEADER_PQUEUE_H - -# include -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif -typedef struct _pqueue *pqueue; - -typedef struct _pitem { - unsigned char priority[8]; /* 64-bit value in big-endian encoding */ - void *data; - struct _pitem *next; -} pitem; - -typedef struct _pitem *piterator; - -pitem *pitem_new(unsigned char *prio64be, void *data); -void pitem_free(pitem *item); - -pqueue pqueue_new(void); -void pqueue_free(pqueue pq); - -pitem *pqueue_insert(pqueue pq, pitem *item); -pitem *pqueue_peek(pqueue pq); -pitem *pqueue_pop(pqueue pq); -pitem *pqueue_find(pqueue pq, unsigned char *prio64be); -pitem *pqueue_iterator(pqueue pq); -pitem *pqueue_next(piterator *iter); - -void pqueue_print(pqueue pq); -int pqueue_size(pqueue pq); - -#ifdef __cplusplus -} -#endif -#endif /* ! HEADER_PQUEUE_H */ diff --git a/libs/win32/openssl/include/openssl/rand.h b/libs/win32/openssl/include/openssl/rand.h deleted file mode 100644 index 2553afda20..0000000000 --- a/libs/win32/openssl/include/openssl/rand.h +++ /dev/null @@ -1,150 +0,0 @@ -/* crypto/rand/rand.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_RAND_H -# define HEADER_RAND_H - -# include -# include -# include - -# if defined(OPENSSL_SYS_WINDOWS) -# include -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -# if defined(OPENSSL_FIPS) -# define FIPS_RAND_SIZE_T size_t -# endif - -/* Already defined in ossl_typ.h */ -/* typedef struct rand_meth_st RAND_METHOD; */ - -struct rand_meth_st { - void (*seed) (const void *buf, int num); - int (*bytes) (unsigned char *buf, int num); - void (*cleanup) (void); - void (*add) (const void *buf, int num, double entropy); - int (*pseudorand) (unsigned char *buf, int num); - int (*status) (void); -}; - -# ifdef BN_DEBUG -extern int rand_predictable; -# endif - -int RAND_set_rand_method(const RAND_METHOD *meth); -const RAND_METHOD *RAND_get_rand_method(void); -# ifndef OPENSSL_NO_ENGINE -int RAND_set_rand_engine(ENGINE *engine); -# endif -RAND_METHOD *RAND_SSLeay(void); -void RAND_cleanup(void); -int RAND_bytes(unsigned char *buf, int num); -int RAND_pseudo_bytes(unsigned char *buf, int num); -void RAND_seed(const void *buf, int num); -void RAND_add(const void *buf, int num, double entropy); -int RAND_load_file(const char *file, long max_bytes); -int RAND_write_file(const char *file); -const char *RAND_file_name(char *file, size_t num); -int RAND_status(void); -int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); -int RAND_egd(const char *path); -int RAND_egd_bytes(const char *path, int bytes); -int RAND_poll(void); - -# if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) - -void RAND_screen(void); -int RAND_event(UINT, WPARAM, LPARAM); - -# endif - -# ifdef OPENSSL_FIPS -void RAND_set_fips_drbg_type(int type, int flags); -int RAND_init_fips(void); -# endif - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_RAND_strings(void); - -/* Error codes for the RAND functions. */ - -/* Function codes. */ -# define RAND_F_RAND_GET_RAND_METHOD 101 -# define RAND_F_RAND_INIT_FIPS 102 -# define RAND_F_SSLEAY_RAND_BYTES 100 - -/* Reason codes. */ -# define RAND_R_DUAL_EC_DRBG_DISABLED 104 -# define RAND_R_ERROR_INITIALISING_DRBG 102 -# define RAND_R_ERROR_INSTANTIATING_DRBG 103 -# define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101 -# define RAND_R_PRNG_NOT_SEEDED 100 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/rc2.h b/libs/win32/openssl/include/openssl/rc2.h deleted file mode 100644 index 29d02d7322..0000000000 --- a/libs/win32/openssl/include/openssl/rc2.h +++ /dev/null @@ -1,103 +0,0 @@ -/* crypto/rc2/rc2.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_RC2_H -# define HEADER_RC2_H - -# include /* OPENSSL_NO_RC2, RC2_INT */ -# ifdef OPENSSL_NO_RC2 -# error RC2 is disabled. -# endif - -# define RC2_ENCRYPT 1 -# define RC2_DECRYPT 0 - -# define RC2_BLOCK 8 -# define RC2_KEY_LENGTH 16 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct rc2_key_st { - RC2_INT data[64]; -} RC2_KEY; - -# ifdef OPENSSL_FIPS -void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, - int bits); -# endif -void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits); -void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out, - RC2_KEY *key, int enc); -void RC2_encrypt(unsigned long *data, RC2_KEY *key); -void RC2_decrypt(unsigned long *data, RC2_KEY *key); -void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, - RC2_KEY *ks, unsigned char *iv, int enc); -void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, RC2_KEY *schedule, unsigned char *ivec, - int *num, int enc); -void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, RC2_KEY *schedule, unsigned char *ivec, - int *num); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/rc4.h b/libs/win32/openssl/include/openssl/rc4.h deleted file mode 100644 index 39162b1648..0000000000 --- a/libs/win32/openssl/include/openssl/rc4.h +++ /dev/null @@ -1,88 +0,0 @@ -/* crypto/rc4/rc4.h */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_RC4_H -# define HEADER_RC4_H - -# include /* OPENSSL_NO_RC4, RC4_INT */ -# ifdef OPENSSL_NO_RC4 -# error RC4 is disabled. -# endif - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct rc4_key_st { - RC4_INT x, y; - RC4_INT data[256]; -} RC4_KEY; - -const char *RC4_options(void); -void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); -void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); -void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, - unsigned char *outdata); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/ripemd.h b/libs/win32/openssl/include/openssl/ripemd.h deleted file mode 100644 index b88ef25e72..0000000000 --- a/libs/win32/openssl/include/openssl/ripemd.h +++ /dev/null @@ -1,105 +0,0 @@ -/* crypto/ripemd/ripemd.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_RIPEMD_H -# define HEADER_RIPEMD_H - -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# ifdef OPENSSL_NO_RIPEMD -# error RIPEMD is disabled. -# endif - -# if defined(__LP32__) -# define RIPEMD160_LONG unsigned long -# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -# define RIPEMD160_LONG unsigned long -# define RIPEMD160_LONG_LOG2 3 -# else -# define RIPEMD160_LONG unsigned int -# endif - -# define RIPEMD160_CBLOCK 64 -# define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) -# define RIPEMD160_DIGEST_LENGTH 20 - -typedef struct RIPEMD160state_st { - RIPEMD160_LONG A, B, C, D, E; - RIPEMD160_LONG Nl, Nh; - RIPEMD160_LONG data[RIPEMD160_LBLOCK]; - unsigned int num; -} RIPEMD160_CTX; - -# ifdef OPENSSL_FIPS -int private_RIPEMD160_Init(RIPEMD160_CTX *c); -# endif -int RIPEMD160_Init(RIPEMD160_CTX *c); -int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); -int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); -unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md); -void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/rsa.h b/libs/win32/openssl/include/openssl/rsa.h deleted file mode 100644 index d2ee37406e..0000000000 --- a/libs/win32/openssl/include/openssl/rsa.h +++ /dev/null @@ -1,664 +0,0 @@ -/* crypto/rsa/rsa.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_RSA_H -# define HEADER_RSA_H - -# include - -# ifndef OPENSSL_NO_BIO -# include -# endif -# include -# include -# ifndef OPENSSL_NO_DEPRECATED -# include -# endif - -# ifdef OPENSSL_NO_RSA -# error RSA is disabled. -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Declared already in ossl_typ.h */ -/* typedef struct rsa_st RSA; */ -/* typedef struct rsa_meth_st RSA_METHOD; */ - -struct rsa_meth_st { - const char *name; - int (*rsa_pub_enc) (int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); - int (*rsa_pub_dec) (int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); - int (*rsa_priv_enc) (int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); - int (*rsa_priv_dec) (int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); - /* Can be null */ - int (*rsa_mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx); - /* Can be null */ - int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); - /* called at new */ - int (*init) (RSA *rsa); - /* called at free */ - int (*finish) (RSA *rsa); - /* RSA_METHOD_FLAG_* things */ - int flags; - /* may be needed! */ - char *app_data; - /* - * New sign and verify functions: some libraries don't allow arbitrary - * data to be signed/verified: this allows them to be used. Note: for - * this to work the RSA_public_decrypt() and RSA_private_encrypt() should - * *NOT* be used RSA_sign(), RSA_verify() should be used instead. Note: - * for backwards compatibility this functionality is only enabled if the - * RSA_FLAG_SIGN_VER option is set in 'flags'. - */ - int (*rsa_sign) (int type, - const unsigned char *m, unsigned int m_length, - unsigned char *sigret, unsigned int *siglen, - const RSA *rsa); - int (*rsa_verify) (int dtype, const unsigned char *m, - unsigned int m_length, const unsigned char *sigbuf, - unsigned int siglen, const RSA *rsa); - /* - * If this callback is NULL, the builtin software RSA key-gen will be - * used. This is for behavioural compatibility whilst the code gets - * rewired, but one day it would be nice to assume there are no such - * things as "builtin software" implementations. - */ - int (*rsa_keygen) (RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); -}; - -struct rsa_st { - /* - * The first parameter is used to pickup errors where this is passed - * instead of aEVP_PKEY, it is set to 0 - */ - int pad; - long version; - const RSA_METHOD *meth; - /* functional reference if 'meth' is ENGINE-provided */ - ENGINE *engine; - BIGNUM *n; - BIGNUM *e; - BIGNUM *d; - BIGNUM *p; - BIGNUM *q; - BIGNUM *dmp1; - BIGNUM *dmq1; - BIGNUM *iqmp; - /* be careful using this if the RSA structure is shared */ - CRYPTO_EX_DATA ex_data; - int references; - int flags; - /* Used to cache montgomery values */ - BN_MONT_CTX *_method_mod_n; - BN_MONT_CTX *_method_mod_p; - BN_MONT_CTX *_method_mod_q; - /* - * all BIGNUM values are actually in the following data, if it is not - * NULL - */ - char *bignum_data; - BN_BLINDING *blinding; - BN_BLINDING *mt_blinding; -}; - -# ifndef OPENSSL_RSA_MAX_MODULUS_BITS -# define OPENSSL_RSA_MAX_MODULUS_BITS 16384 -# endif - -# ifndef OPENSSL_RSA_SMALL_MODULUS_BITS -# define OPENSSL_RSA_SMALL_MODULUS_BITS 3072 -# endif -# ifndef OPENSSL_RSA_MAX_PUBEXP_BITS - -/* exponent limit enforced for "large" modulus only */ -# define OPENSSL_RSA_MAX_PUBEXP_BITS 64 -# endif - -# define RSA_3 0x3L -# define RSA_F4 0x10001L - -# define RSA_METHOD_FLAG_NO_CHECK 0x0001/* don't check pub/private - * match */ - -# define RSA_FLAG_CACHE_PUBLIC 0x0002 -# define RSA_FLAG_CACHE_PRIVATE 0x0004 -# define RSA_FLAG_BLINDING 0x0008 -# define RSA_FLAG_THREAD_SAFE 0x0010 -/* - * This flag means the private key operations will be handled by rsa_mod_exp - * and that they do not depend on the private key components being present: - * for example a key stored in external hardware. Without this flag - * bn_mod_exp gets called when private key components are absent. - */ -# define RSA_FLAG_EXT_PKEY 0x0020 - -/* - * This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify - * functions. - */ -# define RSA_FLAG_SIGN_VER 0x0040 - -/* - * new with 0.9.6j and 0.9.7b; the built-in - * RSA implementation now uses blinding by - * default (ignoring RSA_FLAG_BLINDING), - * but other engines might not need it - */ -# define RSA_FLAG_NO_BLINDING 0x0080 -/* - * new with 0.9.8f; the built-in RSA - * implementation now uses constant time - * operations by default in private key operations, - * e.g., constant time modular exponentiation, - * modular inverse without leaking branches, - * division without leaking branches. This - * flag disables these constant time - * operations and results in faster RSA - * private key operations. - */ -# define RSA_FLAG_NO_CONSTTIME 0x0100 -# ifdef OPENSSL_USE_DEPRECATED -/* deprecated name for the flag*/ -/* - * new with 0.9.7h; the built-in RSA - * implementation now uses constant time - * modular exponentiation for secret exponents - * by default. This flag causes the - * faster variable sliding window method to - * be used for all exponents. - */ -# define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME -# endif - -# define EVP_PKEY_CTX_set_rsa_padding(ctx, pad) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, \ - pad, NULL) - -# define EVP_PKEY_CTX_get_rsa_padding(ctx, ppad) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, \ - EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad) - -# define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ - (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ - EVP_PKEY_CTRL_RSA_PSS_SALTLEN, \ - len, NULL) - -# define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx, plen) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ - (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ - EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, \ - 0, plen) - -# define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ - EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL) - -# define EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, pubexp) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ - EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp) - -# define EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ - EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \ - EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)md) - -# define EVP_PKEY_CTX_set_rsa_oaep_md(ctx, md) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ - EVP_PKEY_CTRL_RSA_OAEP_MD, 0, (void *)md) - -# define EVP_PKEY_CTX_get_rsa_mgf1_md(ctx, pmd) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ - EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \ - EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)pmd) - -# define EVP_PKEY_CTX_get_rsa_oaep_md(ctx, pmd) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ - EVP_PKEY_CTRL_GET_RSA_OAEP_MD, 0, (void *)pmd) - -# define EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, l, llen) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ - EVP_PKEY_CTRL_RSA_OAEP_LABEL, llen, (void *)l) - -# define EVP_PKEY_CTX_get0_rsa_oaep_label(ctx, l) \ - EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT, \ - EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, 0, (void *)l) - -# define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) -# define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2) - -# define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3) -# define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4) -# define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5) - -# define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6) -# define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7) -# define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8) - -# define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 9) -# define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 10) - -# define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 11) -# define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12) - -# define RSA_PKCS1_PADDING 1 -# define RSA_SSLV23_PADDING 2 -# define RSA_NO_PADDING 3 -# define RSA_PKCS1_OAEP_PADDING 4 -# define RSA_X931_PADDING 5 -/* EVP_PKEY_ only */ -# define RSA_PKCS1_PSS_PADDING 6 - -# define RSA_PKCS1_PADDING_SIZE 11 - -# define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg) -# define RSA_get_app_data(s) RSA_get_ex_data(s,0) - -RSA *RSA_new(void); -RSA *RSA_new_method(ENGINE *engine); -int RSA_size(const RSA *rsa); - -/* Deprecated version */ -# ifndef OPENSSL_NO_DEPRECATED -RSA *RSA_generate_key(int bits, unsigned long e, void - (*callback) (int, int, void *), void *cb_arg); -# endif /* !defined(OPENSSL_NO_DEPRECATED) */ - -/* New version */ -int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); - -int RSA_check_key(const RSA *); - /* next 4 return -1 on error */ -int RSA_public_encrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); -int RSA_private_encrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); -int RSA_public_decrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); -int RSA_private_decrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); -void RSA_free(RSA *r); -/* "up" the RSA object's reference count */ -int RSA_up_ref(RSA *r); - -int RSA_flags(const RSA *r); - -void RSA_set_default_method(const RSA_METHOD *meth); -const RSA_METHOD *RSA_get_default_method(void); -const RSA_METHOD *RSA_get_method(const RSA *rsa); -int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); - -/* This function needs the memory locking malloc callbacks to be installed */ -int RSA_memory_lock(RSA *r); - -/* these are the actual SSLeay RSA functions */ -const RSA_METHOD *RSA_PKCS1_SSLeay(void); - -const RSA_METHOD *RSA_null_method(void); - -DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) -DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) - -typedef struct rsa_pss_params_st { - X509_ALGOR *hashAlgorithm; - X509_ALGOR *maskGenAlgorithm; - ASN1_INTEGER *saltLength; - ASN1_INTEGER *trailerField; -} RSA_PSS_PARAMS; - -DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) - -typedef struct rsa_oaep_params_st { - X509_ALGOR *hashFunc; - X509_ALGOR *maskGenFunc; - X509_ALGOR *pSourceFunc; -} RSA_OAEP_PARAMS; - -DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS) - -# ifndef OPENSSL_NO_FP_API -int RSA_print_fp(FILE *fp, const RSA *r, int offset); -# endif - -# ifndef OPENSSL_NO_BIO -int RSA_print(BIO *bp, const RSA *r, int offset); -# endif - -# ifndef OPENSSL_NO_RC4 -int i2d_RSA_NET(const RSA *a, unsigned char **pp, - int (*cb) (char *buf, int len, const char *prompt, - int verify), int sgckey); -RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, - int (*cb) (char *buf, int len, const char *prompt, - int verify), int sgckey); - -int i2d_Netscape_RSA(const RSA *a, unsigned char **pp, - int (*cb) (char *buf, int len, const char *prompt, - int verify)); -RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, - int (*cb) (char *buf, int len, const char *prompt, - int verify)); -# endif - -/* - * The following 2 functions sign and verify a X509_SIG ASN1 object inside - * PKCS#1 padded RSA encryption - */ -int RSA_sign(int type, const unsigned char *m, unsigned int m_length, - unsigned char *sigret, unsigned int *siglen, RSA *rsa); -int RSA_verify(int type, const unsigned char *m, unsigned int m_length, - const unsigned char *sigbuf, unsigned int siglen, RSA *rsa); - -/* - * The following 2 function sign and verify a ASN1_OCTET_STRING object inside - * PKCS#1 padded RSA encryption - */ -int RSA_sign_ASN1_OCTET_STRING(int type, - const unsigned char *m, unsigned int m_length, - unsigned char *sigret, unsigned int *siglen, - RSA *rsa); -int RSA_verify_ASN1_OCTET_STRING(int type, const unsigned char *m, - unsigned int m_length, unsigned char *sigbuf, - unsigned int siglen, RSA *rsa); - -int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); -void RSA_blinding_off(RSA *rsa); -BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx); - -int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, - const unsigned char *f, int fl); -int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen, - const unsigned char *f, int fl, - int rsa_len); -int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen, - const unsigned char *f, int fl); -int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, - const unsigned char *f, int fl, - int rsa_len); -int PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed, - long seedlen, const EVP_MD *dgst); -int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, - const unsigned char *f, int fl, - const unsigned char *p, int pl); -int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, - const unsigned char *f, int fl, int rsa_len, - const unsigned char *p, int pl); -int RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen, - const unsigned char *from, int flen, - const unsigned char *param, int plen, - const EVP_MD *md, const EVP_MD *mgf1md); -int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen, - const unsigned char *from, int flen, - int num, const unsigned char *param, - int plen, const EVP_MD *md, - const EVP_MD *mgf1md); -int RSA_padding_add_SSLv23(unsigned char *to, int tlen, - const unsigned char *f, int fl); -int RSA_padding_check_SSLv23(unsigned char *to, int tlen, - const unsigned char *f, int fl, int rsa_len); -int RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *f, - int fl); -int RSA_padding_check_none(unsigned char *to, int tlen, - const unsigned char *f, int fl, int rsa_len); -int RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *f, - int fl); -int RSA_padding_check_X931(unsigned char *to, int tlen, - const unsigned char *f, int fl, int rsa_len); -int RSA_X931_hash_id(int nid); - -int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash, - const EVP_MD *Hash, const unsigned char *EM, - int sLen); -int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM, - const unsigned char *mHash, const EVP_MD *Hash, - int sLen); - -int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash, - const EVP_MD *Hash, const EVP_MD *mgf1Hash, - const unsigned char *EM, int sLen); - -int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, - const unsigned char *mHash, - const EVP_MD *Hash, const EVP_MD *mgf1Hash, - int sLen); - -int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int RSA_set_ex_data(RSA *r, int idx, void *arg); -void *RSA_get_ex_data(const RSA *r, int idx); - -RSA *RSAPublicKey_dup(RSA *rsa); -RSA *RSAPrivateKey_dup(RSA *rsa); - -/* - * If this flag is set the RSA method is FIPS compliant and can be used in - * FIPS mode. This is set in the validated module method. If an application - * sets this flag in its own methods it is its responsibility to ensure the - * result is compliant. - */ - -# define RSA_FLAG_FIPS_METHOD 0x0400 - -/* - * If this flag is set the operations normally disabled in FIPS mode are - * permitted it is then the applications responsibility to ensure that the - * usage is compliant. - */ - -# define RSA_FLAG_NON_FIPS_ALLOW 0x0400 -/* - * Application has decided PRNG is good enough to generate a key: don't - * check. - */ -# define RSA_FLAG_CHECKED 0x0800 - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_RSA_strings(void); - -/* Error codes for the RSA functions. */ - -/* Function codes. */ -# define RSA_F_CHECK_PADDING_MD 140 -# define RSA_F_DO_RSA_PRINT 146 -# define RSA_F_INT_RSA_VERIFY 145 -# define RSA_F_MEMORY_LOCK 100 -# define RSA_F_OLD_RSA_PRIV_DECODE 147 -# define RSA_F_PKEY_RSA_CTRL 143 -# define RSA_F_PKEY_RSA_CTRL_STR 144 -# define RSA_F_PKEY_RSA_SIGN 142 -# define RSA_F_PKEY_RSA_VERIFY 154 -# define RSA_F_PKEY_RSA_VERIFYRECOVER 141 -# define RSA_F_RSA_ALGOR_TO_MD 157 -# define RSA_F_RSA_BUILTIN_KEYGEN 129 -# define RSA_F_RSA_CHECK_KEY 123 -# define RSA_F_RSA_CMS_DECRYPT 158 -# define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101 -# define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102 -# define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103 -# define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104 -# define RSA_F_RSA_GENERATE_KEY 105 -# define RSA_F_RSA_GENERATE_KEY_EX 155 -# define RSA_F_RSA_ITEM_VERIFY 156 -# define RSA_F_RSA_MEMORY_LOCK 130 -# define RSA_F_RSA_MGF1_TO_MD 159 -# define RSA_F_RSA_NEW_METHOD 106 -# define RSA_F_RSA_NULL 124 -# define RSA_F_RSA_NULL_MOD_EXP 131 -# define RSA_F_RSA_NULL_PRIVATE_DECRYPT 132 -# define RSA_F_RSA_NULL_PRIVATE_ENCRYPT 133 -# define RSA_F_RSA_NULL_PUBLIC_DECRYPT 134 -# define RSA_F_RSA_NULL_PUBLIC_ENCRYPT 135 -# define RSA_F_RSA_PADDING_ADD_NONE 107 -# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 -# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP_MGF1 160 -# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125 -# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 148 -# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 -# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 -# define RSA_F_RSA_PADDING_ADD_SSLV23 110 -# define RSA_F_RSA_PADDING_ADD_X931 127 -# define RSA_F_RSA_PADDING_CHECK_NONE 111 -# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122 -# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1 161 -# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112 -# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113 -# define RSA_F_RSA_PADDING_CHECK_SSLV23 114 -# define RSA_F_RSA_PADDING_CHECK_X931 128 -# define RSA_F_RSA_PRINT 115 -# define RSA_F_RSA_PRINT_FP 116 -# define RSA_F_RSA_PRIVATE_DECRYPT 150 -# define RSA_F_RSA_PRIVATE_ENCRYPT 151 -# define RSA_F_RSA_PRIV_DECODE 137 -# define RSA_F_RSA_PRIV_ENCODE 138 -# define RSA_F_RSA_PSS_TO_CTX 162 -# define RSA_F_RSA_PUBLIC_DECRYPT 152 -# define RSA_F_RSA_PUBLIC_ENCRYPT 153 -# define RSA_F_RSA_PUB_DECODE 139 -# define RSA_F_RSA_SETUP_BLINDING 136 -# define RSA_F_RSA_SIGN 117 -# define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118 -# define RSA_F_RSA_VERIFY 119 -# define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 -# define RSA_F_RSA_VERIFY_PKCS1_PSS 126 -# define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 149 - -/* Reason codes. */ -# define RSA_R_ALGORITHM_MISMATCH 100 -# define RSA_R_BAD_E_VALUE 101 -# define RSA_R_BAD_FIXED_HEADER_DECRYPT 102 -# define RSA_R_BAD_PAD_BYTE_COUNT 103 -# define RSA_R_BAD_SIGNATURE 104 -# define RSA_R_BLOCK_TYPE_IS_NOT_01 106 -# define RSA_R_BLOCK_TYPE_IS_NOT_02 107 -# define RSA_R_DATA_GREATER_THAN_MOD_LEN 108 -# define RSA_R_DATA_TOO_LARGE 109 -# define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110 -# define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132 -# define RSA_R_DATA_TOO_SMALL 111 -# define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122 -# define RSA_R_DIGEST_DOES_NOT_MATCH 166 -# define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112 -# define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124 -# define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125 -# define RSA_R_D_E_NOT_CONGRUENT_TO_1 123 -# define RSA_R_FIRST_OCTET_INVALID 133 -# define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 144 -# define RSA_R_INVALID_DIGEST 160 -# define RSA_R_INVALID_DIGEST_LENGTH 143 -# define RSA_R_INVALID_HEADER 137 -# define RSA_R_INVALID_KEYBITS 145 -# define RSA_R_INVALID_LABEL 161 -# define RSA_R_INVALID_MESSAGE_LENGTH 131 -# define RSA_R_INVALID_MGF1_MD 156 -# define RSA_R_INVALID_OAEP_PARAMETERS 162 -# define RSA_R_INVALID_PADDING 138 -# define RSA_R_INVALID_PADDING_MODE 141 -# define RSA_R_INVALID_PSS_PARAMETERS 149 -# define RSA_R_INVALID_PSS_SALTLEN 146 -# define RSA_R_INVALID_SALT_LENGTH 150 -# define RSA_R_INVALID_TRAILER 139 -# define RSA_R_INVALID_X931_DIGEST 142 -# define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 -# define RSA_R_KEY_SIZE_TOO_SMALL 120 -# define RSA_R_LAST_OCTET_INVALID 134 -# define RSA_R_MODULUS_TOO_LARGE 105 -# define RSA_R_NON_FIPS_RSA_METHOD 157 -# define RSA_R_NO_PUBLIC_EXPONENT 140 -# define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 -# define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 -# define RSA_R_OAEP_DECODING_ERROR 121 -# define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 158 -# define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148 -# define RSA_R_PADDING_CHECK_FAILED 114 -# define RSA_R_PKCS_DECODING_ERROR 159 -# define RSA_R_P_NOT_PRIME 128 -# define RSA_R_Q_NOT_PRIME 129 -# define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130 -# define RSA_R_SLEN_CHECK_FAILED 136 -# define RSA_R_SLEN_RECOVERY_FAILED 135 -# define RSA_R_SSLV3_ROLLBACK_ATTACK 115 -# define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 -# define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 -# define RSA_R_UNKNOWN_DIGEST 163 -# define RSA_R_UNKNOWN_MASK_DIGEST 151 -# define RSA_R_UNKNOWN_PADDING_TYPE 118 -# define RSA_R_UNKNOWN_PSS_DIGEST 152 -# define RSA_R_UNSUPPORTED_ENCRYPTION_TYPE 164 -# define RSA_R_UNSUPPORTED_LABEL_SOURCE 165 -# define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153 -# define RSA_R_UNSUPPORTED_MASK_PARAMETER 154 -# define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155 -# define RSA_R_VALUE_MISSING 147 -# define RSA_R_WRONG_SIGNATURE_LENGTH 119 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/safestack.h b/libs/win32/openssl/include/openssl/safestack.h deleted file mode 100644 index 1d4f87eab3..0000000000 --- a/libs/win32/openssl/include/openssl/safestack.h +++ /dev/null @@ -1,2672 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_SAFESTACK_H -# define HEADER_SAFESTACK_H - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# ifndef CHECKED_PTR_OF -# define CHECKED_PTR_OF(type, p) \ - ((void*) (1 ? p : (type*)0)) -# endif - -/* - * In C++ we get problems because an explicit cast is needed from (void *) we - * use CHECKED_STACK_OF to ensure the correct type is passed in the macros - * below. - */ - -# define CHECKED_STACK_OF(type, p) \ - ((_STACK*) (1 ? p : (STACK_OF(type)*)0)) - -# define CHECKED_SK_COPY_FUNC(type, p) \ - ((void *(*)(void *)) ((1 ? p : (type *(*)(const type *))0))) - -# define CHECKED_SK_FREE_FUNC(type, p) \ - ((void (*)(void *)) ((1 ? p : (void (*)(type *))0))) - -# define CHECKED_SK_CMP_FUNC(type, p) \ - ((int (*)(const void *, const void *)) \ - ((1 ? p : (int (*)(const type * const *, const type * const *))0))) - -# define STACK_OF(type) struct stack_st_##type -# define PREDECLARE_STACK_OF(type) STACK_OF(type); - -# define DECLARE_STACK_OF(type) \ -STACK_OF(type) \ - { \ - _STACK stack; \ - }; -# define DECLARE_SPECIAL_STACK_OF(type, type2) \ -STACK_OF(type) \ - { \ - _STACK stack; \ - }; - -/* nada (obsolete in new safestack approach)*/ -# define IMPLEMENT_STACK_OF(type) - -/*- - * Strings are special: normally an lhash entry will point to a single - * (somewhat) mutable object. In the case of strings: - * - * a) Instead of a single char, there is an array of chars, NUL-terminated. - * b) The string may have be immutable. - * - * So, they need their own declarations. Especially important for - * type-checking tools, such as Deputy. - * - * In practice, however, it appears to be hard to have a const - * string. For now, I'm settling for dealing with the fact it is a - * string at all. - */ -typedef char *OPENSSL_STRING; - -typedef const char *OPENSSL_CSTRING; - -/* - * Confusingly, LHASH_OF(STRING) deals with char ** throughout, but - * STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned - * above, instead of a single char each entry is a NUL-terminated array of - * chars. So, we have to implement STRING specially for STACK_OF. This is - * dealt with in the autogenerated macros below. - */ - -DECLARE_SPECIAL_STACK_OF(OPENSSL_STRING, char) - -/* - * Similarly, we sometimes use a block of characters, NOT nul-terminated. - * These should also be distinguished from "normal" stacks. - */ -typedef void *OPENSSL_BLOCK; -DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) - -/* - * SKM_sk_... stack macros are internal to safestack.h: never use them - * directly, use sk__... instead - */ -# define SKM_sk_new(type, cmp) \ - ((STACK_OF(type) *)sk_new(CHECKED_SK_CMP_FUNC(type, cmp))) -# define SKM_sk_new_null(type) \ - ((STACK_OF(type) *)sk_new_null()) -# define SKM_sk_free(type, st) \ - sk_free(CHECKED_STACK_OF(type, st)) -# define SKM_sk_num(type, st) \ - sk_num(CHECKED_STACK_OF(type, st)) -# define SKM_sk_value(type, st,i) \ - ((type *)sk_value(CHECKED_STACK_OF(type, st), i)) -# define SKM_sk_set(type, st,i,val) \ - sk_set(CHECKED_STACK_OF(type, st), i, CHECKED_PTR_OF(type, val)) -# define SKM_sk_zero(type, st) \ - sk_zero(CHECKED_STACK_OF(type, st)) -# define SKM_sk_push(type, st, val) \ - sk_push(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val)) -# define SKM_sk_unshift(type, st, val) \ - sk_unshift(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val)) -# define SKM_sk_find(type, st, val) \ - sk_find(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val)) -# define SKM_sk_find_ex(type, st, val) \ - sk_find_ex(CHECKED_STACK_OF(type, st), \ - CHECKED_PTR_OF(type, val)) -# define SKM_sk_delete(type, st, i) \ - (type *)sk_delete(CHECKED_STACK_OF(type, st), i) -# define SKM_sk_delete_ptr(type, st, ptr) \ - (type *)sk_delete_ptr(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, ptr)) -# define SKM_sk_insert(type, st,val, i) \ - sk_insert(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val), i) -# define SKM_sk_set_cmp_func(type, st, cmp) \ - ((int (*)(const type * const *,const type * const *)) \ - sk_set_cmp_func(CHECKED_STACK_OF(type, st), CHECKED_SK_CMP_FUNC(type, cmp))) -# define SKM_sk_dup(type, st) \ - (STACK_OF(type) *)sk_dup(CHECKED_STACK_OF(type, st)) -# define SKM_sk_pop_free(type, st, free_func) \ - sk_pop_free(CHECKED_STACK_OF(type, st), CHECKED_SK_FREE_FUNC(type, free_func)) -# define SKM_sk_deep_copy(type, st, copy_func, free_func) \ - (STACK_OF(type) *)sk_deep_copy(CHECKED_STACK_OF(type, st), CHECKED_SK_COPY_FUNC(type, copy_func), CHECKED_SK_FREE_FUNC(type, free_func)) -# define SKM_sk_shift(type, st) \ - (type *)sk_shift(CHECKED_STACK_OF(type, st)) -# define SKM_sk_pop(type, st) \ - (type *)sk_pop(CHECKED_STACK_OF(type, st)) -# define SKM_sk_sort(type, st) \ - sk_sort(CHECKED_STACK_OF(type, st)) -# define SKM_sk_is_sorted(type, st) \ - sk_is_sorted(CHECKED_STACK_OF(type, st)) -# define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - (STACK_OF(type) *)d2i_ASN1_SET( \ - (STACK_OF(OPENSSL_BLOCK) **)CHECKED_PTR_OF(STACK_OF(type)*, st), \ - pp, length, \ - CHECKED_D2I_OF(type, d2i_func), \ - CHECKED_SK_FREE_FUNC(type, free_func), \ - ex_tag, ex_class) -# define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \ - i2d_ASN1_SET((STACK_OF(OPENSSL_BLOCK) *)CHECKED_STACK_OF(type, st), pp, \ - CHECKED_I2D_OF(type, i2d_func), \ - ex_tag, ex_class, is_set) -# define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \ - ASN1_seq_pack(CHECKED_PTR_OF(STACK_OF(type), st), \ - CHECKED_I2D_OF(type, i2d_func), buf, len) -# define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \ - (STACK_OF(type) *)ASN1_seq_unpack(buf, len, CHECKED_D2I_OF(type, d2i_func), CHECKED_SK_FREE_FUNC(type, free_func)) -# define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \ - (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \ - CHECKED_D2I_OF(type, d2i_func), \ - CHECKED_SK_FREE_FUNC(type, free_func), \ - pass, passlen, oct, seq) -/* - * This block of defines is updated by util/mkstack.pl, please do not touch! - */ -# define sk_ACCESS_DESCRIPTION_new(cmp) SKM_sk_new(ACCESS_DESCRIPTION, (cmp)) -# define sk_ACCESS_DESCRIPTION_new_null() SKM_sk_new_null(ACCESS_DESCRIPTION) -# define sk_ACCESS_DESCRIPTION_free(st) SKM_sk_free(ACCESS_DESCRIPTION, (st)) -# define sk_ACCESS_DESCRIPTION_num(st) SKM_sk_num(ACCESS_DESCRIPTION, (st)) -# define sk_ACCESS_DESCRIPTION_value(st, i) SKM_sk_value(ACCESS_DESCRIPTION, (st), (i)) -# define sk_ACCESS_DESCRIPTION_set(st, i, val) SKM_sk_set(ACCESS_DESCRIPTION, (st), (i), (val)) -# define sk_ACCESS_DESCRIPTION_zero(st) SKM_sk_zero(ACCESS_DESCRIPTION, (st)) -# define sk_ACCESS_DESCRIPTION_push(st, val) SKM_sk_push(ACCESS_DESCRIPTION, (st), (val)) -# define sk_ACCESS_DESCRIPTION_unshift(st, val) SKM_sk_unshift(ACCESS_DESCRIPTION, (st), (val)) -# define sk_ACCESS_DESCRIPTION_find(st, val) SKM_sk_find(ACCESS_DESCRIPTION, (st), (val)) -# define sk_ACCESS_DESCRIPTION_find_ex(st, val) SKM_sk_find_ex(ACCESS_DESCRIPTION, (st), (val)) -# define sk_ACCESS_DESCRIPTION_delete(st, i) SKM_sk_delete(ACCESS_DESCRIPTION, (st), (i)) -# define sk_ACCESS_DESCRIPTION_delete_ptr(st, ptr) SKM_sk_delete_ptr(ACCESS_DESCRIPTION, (st), (ptr)) -# define sk_ACCESS_DESCRIPTION_insert(st, val, i) SKM_sk_insert(ACCESS_DESCRIPTION, (st), (val), (i)) -# define sk_ACCESS_DESCRIPTION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ACCESS_DESCRIPTION, (st), (cmp)) -# define sk_ACCESS_DESCRIPTION_dup(st) SKM_sk_dup(ACCESS_DESCRIPTION, st) -# define sk_ACCESS_DESCRIPTION_pop_free(st, free_func) SKM_sk_pop_free(ACCESS_DESCRIPTION, (st), (free_func)) -# define sk_ACCESS_DESCRIPTION_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ACCESS_DESCRIPTION, (st), (copy_func), (free_func)) -# define sk_ACCESS_DESCRIPTION_shift(st) SKM_sk_shift(ACCESS_DESCRIPTION, (st)) -# define sk_ACCESS_DESCRIPTION_pop(st) SKM_sk_pop(ACCESS_DESCRIPTION, (st)) -# define sk_ACCESS_DESCRIPTION_sort(st) SKM_sk_sort(ACCESS_DESCRIPTION, (st)) -# define sk_ACCESS_DESCRIPTION_is_sorted(st) SKM_sk_is_sorted(ACCESS_DESCRIPTION, (st)) -# define sk_ASIdOrRange_new(cmp) SKM_sk_new(ASIdOrRange, (cmp)) -# define sk_ASIdOrRange_new_null() SKM_sk_new_null(ASIdOrRange) -# define sk_ASIdOrRange_free(st) SKM_sk_free(ASIdOrRange, (st)) -# define sk_ASIdOrRange_num(st) SKM_sk_num(ASIdOrRange, (st)) -# define sk_ASIdOrRange_value(st, i) SKM_sk_value(ASIdOrRange, (st), (i)) -# define sk_ASIdOrRange_set(st, i, val) SKM_sk_set(ASIdOrRange, (st), (i), (val)) -# define sk_ASIdOrRange_zero(st) SKM_sk_zero(ASIdOrRange, (st)) -# define sk_ASIdOrRange_push(st, val) SKM_sk_push(ASIdOrRange, (st), (val)) -# define sk_ASIdOrRange_unshift(st, val) SKM_sk_unshift(ASIdOrRange, (st), (val)) -# define sk_ASIdOrRange_find(st, val) SKM_sk_find(ASIdOrRange, (st), (val)) -# define sk_ASIdOrRange_find_ex(st, val) SKM_sk_find_ex(ASIdOrRange, (st), (val)) -# define sk_ASIdOrRange_delete(st, i) SKM_sk_delete(ASIdOrRange, (st), (i)) -# define sk_ASIdOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASIdOrRange, (st), (ptr)) -# define sk_ASIdOrRange_insert(st, val, i) SKM_sk_insert(ASIdOrRange, (st), (val), (i)) -# define sk_ASIdOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASIdOrRange, (st), (cmp)) -# define sk_ASIdOrRange_dup(st) SKM_sk_dup(ASIdOrRange, st) -# define sk_ASIdOrRange_pop_free(st, free_func) SKM_sk_pop_free(ASIdOrRange, (st), (free_func)) -# define sk_ASIdOrRange_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASIdOrRange, (st), (copy_func), (free_func)) -# define sk_ASIdOrRange_shift(st) SKM_sk_shift(ASIdOrRange, (st)) -# define sk_ASIdOrRange_pop(st) SKM_sk_pop(ASIdOrRange, (st)) -# define sk_ASIdOrRange_sort(st) SKM_sk_sort(ASIdOrRange, (st)) -# define sk_ASIdOrRange_is_sorted(st) SKM_sk_is_sorted(ASIdOrRange, (st)) -# define sk_ASN1_GENERALSTRING_new(cmp) SKM_sk_new(ASN1_GENERALSTRING, (cmp)) -# define sk_ASN1_GENERALSTRING_new_null() SKM_sk_new_null(ASN1_GENERALSTRING) -# define sk_ASN1_GENERALSTRING_free(st) SKM_sk_free(ASN1_GENERALSTRING, (st)) -# define sk_ASN1_GENERALSTRING_num(st) SKM_sk_num(ASN1_GENERALSTRING, (st)) -# define sk_ASN1_GENERALSTRING_value(st, i) SKM_sk_value(ASN1_GENERALSTRING, (st), (i)) -# define sk_ASN1_GENERALSTRING_set(st, i, val) SKM_sk_set(ASN1_GENERALSTRING, (st), (i), (val)) -# define sk_ASN1_GENERALSTRING_zero(st) SKM_sk_zero(ASN1_GENERALSTRING, (st)) -# define sk_ASN1_GENERALSTRING_push(st, val) SKM_sk_push(ASN1_GENERALSTRING, (st), (val)) -# define sk_ASN1_GENERALSTRING_unshift(st, val) SKM_sk_unshift(ASN1_GENERALSTRING, (st), (val)) -# define sk_ASN1_GENERALSTRING_find(st, val) SKM_sk_find(ASN1_GENERALSTRING, (st), (val)) -# define sk_ASN1_GENERALSTRING_find_ex(st, val) SKM_sk_find_ex(ASN1_GENERALSTRING, (st), (val)) -# define sk_ASN1_GENERALSTRING_delete(st, i) SKM_sk_delete(ASN1_GENERALSTRING, (st), (i)) -# define sk_ASN1_GENERALSTRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_GENERALSTRING, (st), (ptr)) -# define sk_ASN1_GENERALSTRING_insert(st, val, i) SKM_sk_insert(ASN1_GENERALSTRING, (st), (val), (i)) -# define sk_ASN1_GENERALSTRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_GENERALSTRING, (st), (cmp)) -# define sk_ASN1_GENERALSTRING_dup(st) SKM_sk_dup(ASN1_GENERALSTRING, st) -# define sk_ASN1_GENERALSTRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_GENERALSTRING, (st), (free_func)) -# define sk_ASN1_GENERALSTRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_GENERALSTRING, (st), (copy_func), (free_func)) -# define sk_ASN1_GENERALSTRING_shift(st) SKM_sk_shift(ASN1_GENERALSTRING, (st)) -# define sk_ASN1_GENERALSTRING_pop(st) SKM_sk_pop(ASN1_GENERALSTRING, (st)) -# define sk_ASN1_GENERALSTRING_sort(st) SKM_sk_sort(ASN1_GENERALSTRING, (st)) -# define sk_ASN1_GENERALSTRING_is_sorted(st) SKM_sk_is_sorted(ASN1_GENERALSTRING, (st)) -# define sk_ASN1_INTEGER_new(cmp) SKM_sk_new(ASN1_INTEGER, (cmp)) -# define sk_ASN1_INTEGER_new_null() SKM_sk_new_null(ASN1_INTEGER) -# define sk_ASN1_INTEGER_free(st) SKM_sk_free(ASN1_INTEGER, (st)) -# define sk_ASN1_INTEGER_num(st) SKM_sk_num(ASN1_INTEGER, (st)) -# define sk_ASN1_INTEGER_value(st, i) SKM_sk_value(ASN1_INTEGER, (st), (i)) -# define sk_ASN1_INTEGER_set(st, i, val) SKM_sk_set(ASN1_INTEGER, (st), (i), (val)) -# define sk_ASN1_INTEGER_zero(st) SKM_sk_zero(ASN1_INTEGER, (st)) -# define sk_ASN1_INTEGER_push(st, val) SKM_sk_push(ASN1_INTEGER, (st), (val)) -# define sk_ASN1_INTEGER_unshift(st, val) SKM_sk_unshift(ASN1_INTEGER, (st), (val)) -# define sk_ASN1_INTEGER_find(st, val) SKM_sk_find(ASN1_INTEGER, (st), (val)) -# define sk_ASN1_INTEGER_find_ex(st, val) SKM_sk_find_ex(ASN1_INTEGER, (st), (val)) -# define sk_ASN1_INTEGER_delete(st, i) SKM_sk_delete(ASN1_INTEGER, (st), (i)) -# define sk_ASN1_INTEGER_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_INTEGER, (st), (ptr)) -# define sk_ASN1_INTEGER_insert(st, val, i) SKM_sk_insert(ASN1_INTEGER, (st), (val), (i)) -# define sk_ASN1_INTEGER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_INTEGER, (st), (cmp)) -# define sk_ASN1_INTEGER_dup(st) SKM_sk_dup(ASN1_INTEGER, st) -# define sk_ASN1_INTEGER_pop_free(st, free_func) SKM_sk_pop_free(ASN1_INTEGER, (st), (free_func)) -# define sk_ASN1_INTEGER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_INTEGER, (st), (copy_func), (free_func)) -# define sk_ASN1_INTEGER_shift(st) SKM_sk_shift(ASN1_INTEGER, (st)) -# define sk_ASN1_INTEGER_pop(st) SKM_sk_pop(ASN1_INTEGER, (st)) -# define sk_ASN1_INTEGER_sort(st) SKM_sk_sort(ASN1_INTEGER, (st)) -# define sk_ASN1_INTEGER_is_sorted(st) SKM_sk_is_sorted(ASN1_INTEGER, (st)) -# define sk_ASN1_OBJECT_new(cmp) SKM_sk_new(ASN1_OBJECT, (cmp)) -# define sk_ASN1_OBJECT_new_null() SKM_sk_new_null(ASN1_OBJECT) -# define sk_ASN1_OBJECT_free(st) SKM_sk_free(ASN1_OBJECT, (st)) -# define sk_ASN1_OBJECT_num(st) SKM_sk_num(ASN1_OBJECT, (st)) -# define sk_ASN1_OBJECT_value(st, i) SKM_sk_value(ASN1_OBJECT, (st), (i)) -# define sk_ASN1_OBJECT_set(st, i, val) SKM_sk_set(ASN1_OBJECT, (st), (i), (val)) -# define sk_ASN1_OBJECT_zero(st) SKM_sk_zero(ASN1_OBJECT, (st)) -# define sk_ASN1_OBJECT_push(st, val) SKM_sk_push(ASN1_OBJECT, (st), (val)) -# define sk_ASN1_OBJECT_unshift(st, val) SKM_sk_unshift(ASN1_OBJECT, (st), (val)) -# define sk_ASN1_OBJECT_find(st, val) SKM_sk_find(ASN1_OBJECT, (st), (val)) -# define sk_ASN1_OBJECT_find_ex(st, val) SKM_sk_find_ex(ASN1_OBJECT, (st), (val)) -# define sk_ASN1_OBJECT_delete(st, i) SKM_sk_delete(ASN1_OBJECT, (st), (i)) -# define sk_ASN1_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_OBJECT, (st), (ptr)) -# define sk_ASN1_OBJECT_insert(st, val, i) SKM_sk_insert(ASN1_OBJECT, (st), (val), (i)) -# define sk_ASN1_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_OBJECT, (st), (cmp)) -# define sk_ASN1_OBJECT_dup(st) SKM_sk_dup(ASN1_OBJECT, st) -# define sk_ASN1_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(ASN1_OBJECT, (st), (free_func)) -# define sk_ASN1_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_OBJECT, (st), (copy_func), (free_func)) -# define sk_ASN1_OBJECT_shift(st) SKM_sk_shift(ASN1_OBJECT, (st)) -# define sk_ASN1_OBJECT_pop(st) SKM_sk_pop(ASN1_OBJECT, (st)) -# define sk_ASN1_OBJECT_sort(st) SKM_sk_sort(ASN1_OBJECT, (st)) -# define sk_ASN1_OBJECT_is_sorted(st) SKM_sk_is_sorted(ASN1_OBJECT, (st)) -# define sk_ASN1_STRING_TABLE_new(cmp) SKM_sk_new(ASN1_STRING_TABLE, (cmp)) -# define sk_ASN1_STRING_TABLE_new_null() SKM_sk_new_null(ASN1_STRING_TABLE) -# define sk_ASN1_STRING_TABLE_free(st) SKM_sk_free(ASN1_STRING_TABLE, (st)) -# define sk_ASN1_STRING_TABLE_num(st) SKM_sk_num(ASN1_STRING_TABLE, (st)) -# define sk_ASN1_STRING_TABLE_value(st, i) SKM_sk_value(ASN1_STRING_TABLE, (st), (i)) -# define sk_ASN1_STRING_TABLE_set(st, i, val) SKM_sk_set(ASN1_STRING_TABLE, (st), (i), (val)) -# define sk_ASN1_STRING_TABLE_zero(st) SKM_sk_zero(ASN1_STRING_TABLE, (st)) -# define sk_ASN1_STRING_TABLE_push(st, val) SKM_sk_push(ASN1_STRING_TABLE, (st), (val)) -# define sk_ASN1_STRING_TABLE_unshift(st, val) SKM_sk_unshift(ASN1_STRING_TABLE, (st), (val)) -# define sk_ASN1_STRING_TABLE_find(st, val) SKM_sk_find(ASN1_STRING_TABLE, (st), (val)) -# define sk_ASN1_STRING_TABLE_find_ex(st, val) SKM_sk_find_ex(ASN1_STRING_TABLE, (st), (val)) -# define sk_ASN1_STRING_TABLE_delete(st, i) SKM_sk_delete(ASN1_STRING_TABLE, (st), (i)) -# define sk_ASN1_STRING_TABLE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_STRING_TABLE, (st), (ptr)) -# define sk_ASN1_STRING_TABLE_insert(st, val, i) SKM_sk_insert(ASN1_STRING_TABLE, (st), (val), (i)) -# define sk_ASN1_STRING_TABLE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_STRING_TABLE, (st), (cmp)) -# define sk_ASN1_STRING_TABLE_dup(st) SKM_sk_dup(ASN1_STRING_TABLE, st) -# define sk_ASN1_STRING_TABLE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_STRING_TABLE, (st), (free_func)) -# define sk_ASN1_STRING_TABLE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_STRING_TABLE, (st), (copy_func), (free_func)) -# define sk_ASN1_STRING_TABLE_shift(st) SKM_sk_shift(ASN1_STRING_TABLE, (st)) -# define sk_ASN1_STRING_TABLE_pop(st) SKM_sk_pop(ASN1_STRING_TABLE, (st)) -# define sk_ASN1_STRING_TABLE_sort(st) SKM_sk_sort(ASN1_STRING_TABLE, (st)) -# define sk_ASN1_STRING_TABLE_is_sorted(st) SKM_sk_is_sorted(ASN1_STRING_TABLE, (st)) -# define sk_ASN1_TYPE_new(cmp) SKM_sk_new(ASN1_TYPE, (cmp)) -# define sk_ASN1_TYPE_new_null() SKM_sk_new_null(ASN1_TYPE) -# define sk_ASN1_TYPE_free(st) SKM_sk_free(ASN1_TYPE, (st)) -# define sk_ASN1_TYPE_num(st) SKM_sk_num(ASN1_TYPE, (st)) -# define sk_ASN1_TYPE_value(st, i) SKM_sk_value(ASN1_TYPE, (st), (i)) -# define sk_ASN1_TYPE_set(st, i, val) SKM_sk_set(ASN1_TYPE, (st), (i), (val)) -# define sk_ASN1_TYPE_zero(st) SKM_sk_zero(ASN1_TYPE, (st)) -# define sk_ASN1_TYPE_push(st, val) SKM_sk_push(ASN1_TYPE, (st), (val)) -# define sk_ASN1_TYPE_unshift(st, val) SKM_sk_unshift(ASN1_TYPE, (st), (val)) -# define sk_ASN1_TYPE_find(st, val) SKM_sk_find(ASN1_TYPE, (st), (val)) -# define sk_ASN1_TYPE_find_ex(st, val) SKM_sk_find_ex(ASN1_TYPE, (st), (val)) -# define sk_ASN1_TYPE_delete(st, i) SKM_sk_delete(ASN1_TYPE, (st), (i)) -# define sk_ASN1_TYPE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_TYPE, (st), (ptr)) -# define sk_ASN1_TYPE_insert(st, val, i) SKM_sk_insert(ASN1_TYPE, (st), (val), (i)) -# define sk_ASN1_TYPE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_TYPE, (st), (cmp)) -# define sk_ASN1_TYPE_dup(st) SKM_sk_dup(ASN1_TYPE, st) -# define sk_ASN1_TYPE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_TYPE, (st), (free_func)) -# define sk_ASN1_TYPE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_TYPE, (st), (copy_func), (free_func)) -# define sk_ASN1_TYPE_shift(st) SKM_sk_shift(ASN1_TYPE, (st)) -# define sk_ASN1_TYPE_pop(st) SKM_sk_pop(ASN1_TYPE, (st)) -# define sk_ASN1_TYPE_sort(st) SKM_sk_sort(ASN1_TYPE, (st)) -# define sk_ASN1_TYPE_is_sorted(st) SKM_sk_is_sorted(ASN1_TYPE, (st)) -# define sk_ASN1_UTF8STRING_new(cmp) SKM_sk_new(ASN1_UTF8STRING, (cmp)) -# define sk_ASN1_UTF8STRING_new_null() SKM_sk_new_null(ASN1_UTF8STRING) -# define sk_ASN1_UTF8STRING_free(st) SKM_sk_free(ASN1_UTF8STRING, (st)) -# define sk_ASN1_UTF8STRING_num(st) SKM_sk_num(ASN1_UTF8STRING, (st)) -# define sk_ASN1_UTF8STRING_value(st, i) SKM_sk_value(ASN1_UTF8STRING, (st), (i)) -# define sk_ASN1_UTF8STRING_set(st, i, val) SKM_sk_set(ASN1_UTF8STRING, (st), (i), (val)) -# define sk_ASN1_UTF8STRING_zero(st) SKM_sk_zero(ASN1_UTF8STRING, (st)) -# define sk_ASN1_UTF8STRING_push(st, val) SKM_sk_push(ASN1_UTF8STRING, (st), (val)) -# define sk_ASN1_UTF8STRING_unshift(st, val) SKM_sk_unshift(ASN1_UTF8STRING, (st), (val)) -# define sk_ASN1_UTF8STRING_find(st, val) SKM_sk_find(ASN1_UTF8STRING, (st), (val)) -# define sk_ASN1_UTF8STRING_find_ex(st, val) SKM_sk_find_ex(ASN1_UTF8STRING, (st), (val)) -# define sk_ASN1_UTF8STRING_delete(st, i) SKM_sk_delete(ASN1_UTF8STRING, (st), (i)) -# define sk_ASN1_UTF8STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_UTF8STRING, (st), (ptr)) -# define sk_ASN1_UTF8STRING_insert(st, val, i) SKM_sk_insert(ASN1_UTF8STRING, (st), (val), (i)) -# define sk_ASN1_UTF8STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_UTF8STRING, (st), (cmp)) -# define sk_ASN1_UTF8STRING_dup(st) SKM_sk_dup(ASN1_UTF8STRING, st) -# define sk_ASN1_UTF8STRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_UTF8STRING, (st), (free_func)) -# define sk_ASN1_UTF8STRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_UTF8STRING, (st), (copy_func), (free_func)) -# define sk_ASN1_UTF8STRING_shift(st) SKM_sk_shift(ASN1_UTF8STRING, (st)) -# define sk_ASN1_UTF8STRING_pop(st) SKM_sk_pop(ASN1_UTF8STRING, (st)) -# define sk_ASN1_UTF8STRING_sort(st) SKM_sk_sort(ASN1_UTF8STRING, (st)) -# define sk_ASN1_UTF8STRING_is_sorted(st) SKM_sk_is_sorted(ASN1_UTF8STRING, (st)) -# define sk_ASN1_VALUE_new(cmp) SKM_sk_new(ASN1_VALUE, (cmp)) -# define sk_ASN1_VALUE_new_null() SKM_sk_new_null(ASN1_VALUE) -# define sk_ASN1_VALUE_free(st) SKM_sk_free(ASN1_VALUE, (st)) -# define sk_ASN1_VALUE_num(st) SKM_sk_num(ASN1_VALUE, (st)) -# define sk_ASN1_VALUE_value(st, i) SKM_sk_value(ASN1_VALUE, (st), (i)) -# define sk_ASN1_VALUE_set(st, i, val) SKM_sk_set(ASN1_VALUE, (st), (i), (val)) -# define sk_ASN1_VALUE_zero(st) SKM_sk_zero(ASN1_VALUE, (st)) -# define sk_ASN1_VALUE_push(st, val) SKM_sk_push(ASN1_VALUE, (st), (val)) -# define sk_ASN1_VALUE_unshift(st, val) SKM_sk_unshift(ASN1_VALUE, (st), (val)) -# define sk_ASN1_VALUE_find(st, val) SKM_sk_find(ASN1_VALUE, (st), (val)) -# define sk_ASN1_VALUE_find_ex(st, val) SKM_sk_find_ex(ASN1_VALUE, (st), (val)) -# define sk_ASN1_VALUE_delete(st, i) SKM_sk_delete(ASN1_VALUE, (st), (i)) -# define sk_ASN1_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_VALUE, (st), (ptr)) -# define sk_ASN1_VALUE_insert(st, val, i) SKM_sk_insert(ASN1_VALUE, (st), (val), (i)) -# define sk_ASN1_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_VALUE, (st), (cmp)) -# define sk_ASN1_VALUE_dup(st) SKM_sk_dup(ASN1_VALUE, st) -# define sk_ASN1_VALUE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_VALUE, (st), (free_func)) -# define sk_ASN1_VALUE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_VALUE, (st), (copy_func), (free_func)) -# define sk_ASN1_VALUE_shift(st) SKM_sk_shift(ASN1_VALUE, (st)) -# define sk_ASN1_VALUE_pop(st) SKM_sk_pop(ASN1_VALUE, (st)) -# define sk_ASN1_VALUE_sort(st) SKM_sk_sort(ASN1_VALUE, (st)) -# define sk_ASN1_VALUE_is_sorted(st) SKM_sk_is_sorted(ASN1_VALUE, (st)) -# define sk_BIO_new(cmp) SKM_sk_new(BIO, (cmp)) -# define sk_BIO_new_null() SKM_sk_new_null(BIO) -# define sk_BIO_free(st) SKM_sk_free(BIO, (st)) -# define sk_BIO_num(st) SKM_sk_num(BIO, (st)) -# define sk_BIO_value(st, i) SKM_sk_value(BIO, (st), (i)) -# define sk_BIO_set(st, i, val) SKM_sk_set(BIO, (st), (i), (val)) -# define sk_BIO_zero(st) SKM_sk_zero(BIO, (st)) -# define sk_BIO_push(st, val) SKM_sk_push(BIO, (st), (val)) -# define sk_BIO_unshift(st, val) SKM_sk_unshift(BIO, (st), (val)) -# define sk_BIO_find(st, val) SKM_sk_find(BIO, (st), (val)) -# define sk_BIO_find_ex(st, val) SKM_sk_find_ex(BIO, (st), (val)) -# define sk_BIO_delete(st, i) SKM_sk_delete(BIO, (st), (i)) -# define sk_BIO_delete_ptr(st, ptr) SKM_sk_delete_ptr(BIO, (st), (ptr)) -# define sk_BIO_insert(st, val, i) SKM_sk_insert(BIO, (st), (val), (i)) -# define sk_BIO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BIO, (st), (cmp)) -# define sk_BIO_dup(st) SKM_sk_dup(BIO, st) -# define sk_BIO_pop_free(st, free_func) SKM_sk_pop_free(BIO, (st), (free_func)) -# define sk_BIO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BIO, (st), (copy_func), (free_func)) -# define sk_BIO_shift(st) SKM_sk_shift(BIO, (st)) -# define sk_BIO_pop(st) SKM_sk_pop(BIO, (st)) -# define sk_BIO_sort(st) SKM_sk_sort(BIO, (st)) -# define sk_BIO_is_sorted(st) SKM_sk_is_sorted(BIO, (st)) -# define sk_BY_DIR_ENTRY_new(cmp) SKM_sk_new(BY_DIR_ENTRY, (cmp)) -# define sk_BY_DIR_ENTRY_new_null() SKM_sk_new_null(BY_DIR_ENTRY) -# define sk_BY_DIR_ENTRY_free(st) SKM_sk_free(BY_DIR_ENTRY, (st)) -# define sk_BY_DIR_ENTRY_num(st) SKM_sk_num(BY_DIR_ENTRY, (st)) -# define sk_BY_DIR_ENTRY_value(st, i) SKM_sk_value(BY_DIR_ENTRY, (st), (i)) -# define sk_BY_DIR_ENTRY_set(st, i, val) SKM_sk_set(BY_DIR_ENTRY, (st), (i), (val)) -# define sk_BY_DIR_ENTRY_zero(st) SKM_sk_zero(BY_DIR_ENTRY, (st)) -# define sk_BY_DIR_ENTRY_push(st, val) SKM_sk_push(BY_DIR_ENTRY, (st), (val)) -# define sk_BY_DIR_ENTRY_unshift(st, val) SKM_sk_unshift(BY_DIR_ENTRY, (st), (val)) -# define sk_BY_DIR_ENTRY_find(st, val) SKM_sk_find(BY_DIR_ENTRY, (st), (val)) -# define sk_BY_DIR_ENTRY_find_ex(st, val) SKM_sk_find_ex(BY_DIR_ENTRY, (st), (val)) -# define sk_BY_DIR_ENTRY_delete(st, i) SKM_sk_delete(BY_DIR_ENTRY, (st), (i)) -# define sk_BY_DIR_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(BY_DIR_ENTRY, (st), (ptr)) -# define sk_BY_DIR_ENTRY_insert(st, val, i) SKM_sk_insert(BY_DIR_ENTRY, (st), (val), (i)) -# define sk_BY_DIR_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BY_DIR_ENTRY, (st), (cmp)) -# define sk_BY_DIR_ENTRY_dup(st) SKM_sk_dup(BY_DIR_ENTRY, st) -# define sk_BY_DIR_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(BY_DIR_ENTRY, (st), (free_func)) -# define sk_BY_DIR_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BY_DIR_ENTRY, (st), (copy_func), (free_func)) -# define sk_BY_DIR_ENTRY_shift(st) SKM_sk_shift(BY_DIR_ENTRY, (st)) -# define sk_BY_DIR_ENTRY_pop(st) SKM_sk_pop(BY_DIR_ENTRY, (st)) -# define sk_BY_DIR_ENTRY_sort(st) SKM_sk_sort(BY_DIR_ENTRY, (st)) -# define sk_BY_DIR_ENTRY_is_sorted(st) SKM_sk_is_sorted(BY_DIR_ENTRY, (st)) -# define sk_BY_DIR_HASH_new(cmp) SKM_sk_new(BY_DIR_HASH, (cmp)) -# define sk_BY_DIR_HASH_new_null() SKM_sk_new_null(BY_DIR_HASH) -# define sk_BY_DIR_HASH_free(st) SKM_sk_free(BY_DIR_HASH, (st)) -# define sk_BY_DIR_HASH_num(st) SKM_sk_num(BY_DIR_HASH, (st)) -# define sk_BY_DIR_HASH_value(st, i) SKM_sk_value(BY_DIR_HASH, (st), (i)) -# define sk_BY_DIR_HASH_set(st, i, val) SKM_sk_set(BY_DIR_HASH, (st), (i), (val)) -# define sk_BY_DIR_HASH_zero(st) SKM_sk_zero(BY_DIR_HASH, (st)) -# define sk_BY_DIR_HASH_push(st, val) SKM_sk_push(BY_DIR_HASH, (st), (val)) -# define sk_BY_DIR_HASH_unshift(st, val) SKM_sk_unshift(BY_DIR_HASH, (st), (val)) -# define sk_BY_DIR_HASH_find(st, val) SKM_sk_find(BY_DIR_HASH, (st), (val)) -# define sk_BY_DIR_HASH_find_ex(st, val) SKM_sk_find_ex(BY_DIR_HASH, (st), (val)) -# define sk_BY_DIR_HASH_delete(st, i) SKM_sk_delete(BY_DIR_HASH, (st), (i)) -# define sk_BY_DIR_HASH_delete_ptr(st, ptr) SKM_sk_delete_ptr(BY_DIR_HASH, (st), (ptr)) -# define sk_BY_DIR_HASH_insert(st, val, i) SKM_sk_insert(BY_DIR_HASH, (st), (val), (i)) -# define sk_BY_DIR_HASH_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BY_DIR_HASH, (st), (cmp)) -# define sk_BY_DIR_HASH_dup(st) SKM_sk_dup(BY_DIR_HASH, st) -# define sk_BY_DIR_HASH_pop_free(st, free_func) SKM_sk_pop_free(BY_DIR_HASH, (st), (free_func)) -# define sk_BY_DIR_HASH_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BY_DIR_HASH, (st), (copy_func), (free_func)) -# define sk_BY_DIR_HASH_shift(st) SKM_sk_shift(BY_DIR_HASH, (st)) -# define sk_BY_DIR_HASH_pop(st) SKM_sk_pop(BY_DIR_HASH, (st)) -# define sk_BY_DIR_HASH_sort(st) SKM_sk_sort(BY_DIR_HASH, (st)) -# define sk_BY_DIR_HASH_is_sorted(st) SKM_sk_is_sorted(BY_DIR_HASH, (st)) -# define sk_CMS_CertificateChoices_new(cmp) SKM_sk_new(CMS_CertificateChoices, (cmp)) -# define sk_CMS_CertificateChoices_new_null() SKM_sk_new_null(CMS_CertificateChoices) -# define sk_CMS_CertificateChoices_free(st) SKM_sk_free(CMS_CertificateChoices, (st)) -# define sk_CMS_CertificateChoices_num(st) SKM_sk_num(CMS_CertificateChoices, (st)) -# define sk_CMS_CertificateChoices_value(st, i) SKM_sk_value(CMS_CertificateChoices, (st), (i)) -# define sk_CMS_CertificateChoices_set(st, i, val) SKM_sk_set(CMS_CertificateChoices, (st), (i), (val)) -# define sk_CMS_CertificateChoices_zero(st) SKM_sk_zero(CMS_CertificateChoices, (st)) -# define sk_CMS_CertificateChoices_push(st, val) SKM_sk_push(CMS_CertificateChoices, (st), (val)) -# define sk_CMS_CertificateChoices_unshift(st, val) SKM_sk_unshift(CMS_CertificateChoices, (st), (val)) -# define sk_CMS_CertificateChoices_find(st, val) SKM_sk_find(CMS_CertificateChoices, (st), (val)) -# define sk_CMS_CertificateChoices_find_ex(st, val) SKM_sk_find_ex(CMS_CertificateChoices, (st), (val)) -# define sk_CMS_CertificateChoices_delete(st, i) SKM_sk_delete(CMS_CertificateChoices, (st), (i)) -# define sk_CMS_CertificateChoices_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_CertificateChoices, (st), (ptr)) -# define sk_CMS_CertificateChoices_insert(st, val, i) SKM_sk_insert(CMS_CertificateChoices, (st), (val), (i)) -# define sk_CMS_CertificateChoices_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_CertificateChoices, (st), (cmp)) -# define sk_CMS_CertificateChoices_dup(st) SKM_sk_dup(CMS_CertificateChoices, st) -# define sk_CMS_CertificateChoices_pop_free(st, free_func) SKM_sk_pop_free(CMS_CertificateChoices, (st), (free_func)) -# define sk_CMS_CertificateChoices_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_CertificateChoices, (st), (copy_func), (free_func)) -# define sk_CMS_CertificateChoices_shift(st) SKM_sk_shift(CMS_CertificateChoices, (st)) -# define sk_CMS_CertificateChoices_pop(st) SKM_sk_pop(CMS_CertificateChoices, (st)) -# define sk_CMS_CertificateChoices_sort(st) SKM_sk_sort(CMS_CertificateChoices, (st)) -# define sk_CMS_CertificateChoices_is_sorted(st) SKM_sk_is_sorted(CMS_CertificateChoices, (st)) -# define sk_CMS_RecipientEncryptedKey_new(cmp) SKM_sk_new(CMS_RecipientEncryptedKey, (cmp)) -# define sk_CMS_RecipientEncryptedKey_new_null() SKM_sk_new_null(CMS_RecipientEncryptedKey) -# define sk_CMS_RecipientEncryptedKey_free(st) SKM_sk_free(CMS_RecipientEncryptedKey, (st)) -# define sk_CMS_RecipientEncryptedKey_num(st) SKM_sk_num(CMS_RecipientEncryptedKey, (st)) -# define sk_CMS_RecipientEncryptedKey_value(st, i) SKM_sk_value(CMS_RecipientEncryptedKey, (st), (i)) -# define sk_CMS_RecipientEncryptedKey_set(st, i, val) SKM_sk_set(CMS_RecipientEncryptedKey, (st), (i), (val)) -# define sk_CMS_RecipientEncryptedKey_zero(st) SKM_sk_zero(CMS_RecipientEncryptedKey, (st)) -# define sk_CMS_RecipientEncryptedKey_push(st, val) SKM_sk_push(CMS_RecipientEncryptedKey, (st), (val)) -# define sk_CMS_RecipientEncryptedKey_unshift(st, val) SKM_sk_unshift(CMS_RecipientEncryptedKey, (st), (val)) -# define sk_CMS_RecipientEncryptedKey_find(st, val) SKM_sk_find(CMS_RecipientEncryptedKey, (st), (val)) -# define sk_CMS_RecipientEncryptedKey_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientEncryptedKey, (st), (val)) -# define sk_CMS_RecipientEncryptedKey_delete(st, i) SKM_sk_delete(CMS_RecipientEncryptedKey, (st), (i)) -# define sk_CMS_RecipientEncryptedKey_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientEncryptedKey, (st), (ptr)) -# define sk_CMS_RecipientEncryptedKey_insert(st, val, i) SKM_sk_insert(CMS_RecipientEncryptedKey, (st), (val), (i)) -# define sk_CMS_RecipientEncryptedKey_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientEncryptedKey, (st), (cmp)) -# define sk_CMS_RecipientEncryptedKey_dup(st) SKM_sk_dup(CMS_RecipientEncryptedKey, st) -# define sk_CMS_RecipientEncryptedKey_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientEncryptedKey, (st), (free_func)) -# define sk_CMS_RecipientEncryptedKey_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RecipientEncryptedKey, (st), (copy_func), (free_func)) -# define sk_CMS_RecipientEncryptedKey_shift(st) SKM_sk_shift(CMS_RecipientEncryptedKey, (st)) -# define sk_CMS_RecipientEncryptedKey_pop(st) SKM_sk_pop(CMS_RecipientEncryptedKey, (st)) -# define sk_CMS_RecipientEncryptedKey_sort(st) SKM_sk_sort(CMS_RecipientEncryptedKey, (st)) -# define sk_CMS_RecipientEncryptedKey_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientEncryptedKey, (st)) -# define sk_CMS_RecipientInfo_new(cmp) SKM_sk_new(CMS_RecipientInfo, (cmp)) -# define sk_CMS_RecipientInfo_new_null() SKM_sk_new_null(CMS_RecipientInfo) -# define sk_CMS_RecipientInfo_free(st) SKM_sk_free(CMS_RecipientInfo, (st)) -# define sk_CMS_RecipientInfo_num(st) SKM_sk_num(CMS_RecipientInfo, (st)) -# define sk_CMS_RecipientInfo_value(st, i) SKM_sk_value(CMS_RecipientInfo, (st), (i)) -# define sk_CMS_RecipientInfo_set(st, i, val) SKM_sk_set(CMS_RecipientInfo, (st), (i), (val)) -# define sk_CMS_RecipientInfo_zero(st) SKM_sk_zero(CMS_RecipientInfo, (st)) -# define sk_CMS_RecipientInfo_push(st, val) SKM_sk_push(CMS_RecipientInfo, (st), (val)) -# define sk_CMS_RecipientInfo_unshift(st, val) SKM_sk_unshift(CMS_RecipientInfo, (st), (val)) -# define sk_CMS_RecipientInfo_find(st, val) SKM_sk_find(CMS_RecipientInfo, (st), (val)) -# define sk_CMS_RecipientInfo_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientInfo, (st), (val)) -# define sk_CMS_RecipientInfo_delete(st, i) SKM_sk_delete(CMS_RecipientInfo, (st), (i)) -# define sk_CMS_RecipientInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientInfo, (st), (ptr)) -# define sk_CMS_RecipientInfo_insert(st, val, i) SKM_sk_insert(CMS_RecipientInfo, (st), (val), (i)) -# define sk_CMS_RecipientInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientInfo, (st), (cmp)) -# define sk_CMS_RecipientInfo_dup(st) SKM_sk_dup(CMS_RecipientInfo, st) -# define sk_CMS_RecipientInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientInfo, (st), (free_func)) -# define sk_CMS_RecipientInfo_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RecipientInfo, (st), (copy_func), (free_func)) -# define sk_CMS_RecipientInfo_shift(st) SKM_sk_shift(CMS_RecipientInfo, (st)) -# define sk_CMS_RecipientInfo_pop(st) SKM_sk_pop(CMS_RecipientInfo, (st)) -# define sk_CMS_RecipientInfo_sort(st) SKM_sk_sort(CMS_RecipientInfo, (st)) -# define sk_CMS_RecipientInfo_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientInfo, (st)) -# define sk_CMS_RevocationInfoChoice_new(cmp) SKM_sk_new(CMS_RevocationInfoChoice, (cmp)) -# define sk_CMS_RevocationInfoChoice_new_null() SKM_sk_new_null(CMS_RevocationInfoChoice) -# define sk_CMS_RevocationInfoChoice_free(st) SKM_sk_free(CMS_RevocationInfoChoice, (st)) -# define sk_CMS_RevocationInfoChoice_num(st) SKM_sk_num(CMS_RevocationInfoChoice, (st)) -# define sk_CMS_RevocationInfoChoice_value(st, i) SKM_sk_value(CMS_RevocationInfoChoice, (st), (i)) -# define sk_CMS_RevocationInfoChoice_set(st, i, val) SKM_sk_set(CMS_RevocationInfoChoice, (st), (i), (val)) -# define sk_CMS_RevocationInfoChoice_zero(st) SKM_sk_zero(CMS_RevocationInfoChoice, (st)) -# define sk_CMS_RevocationInfoChoice_push(st, val) SKM_sk_push(CMS_RevocationInfoChoice, (st), (val)) -# define sk_CMS_RevocationInfoChoice_unshift(st, val) SKM_sk_unshift(CMS_RevocationInfoChoice, (st), (val)) -# define sk_CMS_RevocationInfoChoice_find(st, val) SKM_sk_find(CMS_RevocationInfoChoice, (st), (val)) -# define sk_CMS_RevocationInfoChoice_find_ex(st, val) SKM_sk_find_ex(CMS_RevocationInfoChoice, (st), (val)) -# define sk_CMS_RevocationInfoChoice_delete(st, i) SKM_sk_delete(CMS_RevocationInfoChoice, (st), (i)) -# define sk_CMS_RevocationInfoChoice_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RevocationInfoChoice, (st), (ptr)) -# define sk_CMS_RevocationInfoChoice_insert(st, val, i) SKM_sk_insert(CMS_RevocationInfoChoice, (st), (val), (i)) -# define sk_CMS_RevocationInfoChoice_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RevocationInfoChoice, (st), (cmp)) -# define sk_CMS_RevocationInfoChoice_dup(st) SKM_sk_dup(CMS_RevocationInfoChoice, st) -# define sk_CMS_RevocationInfoChoice_pop_free(st, free_func) SKM_sk_pop_free(CMS_RevocationInfoChoice, (st), (free_func)) -# define sk_CMS_RevocationInfoChoice_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RevocationInfoChoice, (st), (copy_func), (free_func)) -# define sk_CMS_RevocationInfoChoice_shift(st) SKM_sk_shift(CMS_RevocationInfoChoice, (st)) -# define sk_CMS_RevocationInfoChoice_pop(st) SKM_sk_pop(CMS_RevocationInfoChoice, (st)) -# define sk_CMS_RevocationInfoChoice_sort(st) SKM_sk_sort(CMS_RevocationInfoChoice, (st)) -# define sk_CMS_RevocationInfoChoice_is_sorted(st) SKM_sk_is_sorted(CMS_RevocationInfoChoice, (st)) -# define sk_CMS_SignerInfo_new(cmp) SKM_sk_new(CMS_SignerInfo, (cmp)) -# define sk_CMS_SignerInfo_new_null() SKM_sk_new_null(CMS_SignerInfo) -# define sk_CMS_SignerInfo_free(st) SKM_sk_free(CMS_SignerInfo, (st)) -# define sk_CMS_SignerInfo_num(st) SKM_sk_num(CMS_SignerInfo, (st)) -# define sk_CMS_SignerInfo_value(st, i) SKM_sk_value(CMS_SignerInfo, (st), (i)) -# define sk_CMS_SignerInfo_set(st, i, val) SKM_sk_set(CMS_SignerInfo, (st), (i), (val)) -# define sk_CMS_SignerInfo_zero(st) SKM_sk_zero(CMS_SignerInfo, (st)) -# define sk_CMS_SignerInfo_push(st, val) SKM_sk_push(CMS_SignerInfo, (st), (val)) -# define sk_CMS_SignerInfo_unshift(st, val) SKM_sk_unshift(CMS_SignerInfo, (st), (val)) -# define sk_CMS_SignerInfo_find(st, val) SKM_sk_find(CMS_SignerInfo, (st), (val)) -# define sk_CMS_SignerInfo_find_ex(st, val) SKM_sk_find_ex(CMS_SignerInfo, (st), (val)) -# define sk_CMS_SignerInfo_delete(st, i) SKM_sk_delete(CMS_SignerInfo, (st), (i)) -# define sk_CMS_SignerInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_SignerInfo, (st), (ptr)) -# define sk_CMS_SignerInfo_insert(st, val, i) SKM_sk_insert(CMS_SignerInfo, (st), (val), (i)) -# define sk_CMS_SignerInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_SignerInfo, (st), (cmp)) -# define sk_CMS_SignerInfo_dup(st) SKM_sk_dup(CMS_SignerInfo, st) -# define sk_CMS_SignerInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_SignerInfo, (st), (free_func)) -# define sk_CMS_SignerInfo_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_SignerInfo, (st), (copy_func), (free_func)) -# define sk_CMS_SignerInfo_shift(st) SKM_sk_shift(CMS_SignerInfo, (st)) -# define sk_CMS_SignerInfo_pop(st) SKM_sk_pop(CMS_SignerInfo, (st)) -# define sk_CMS_SignerInfo_sort(st) SKM_sk_sort(CMS_SignerInfo, (st)) -# define sk_CMS_SignerInfo_is_sorted(st) SKM_sk_is_sorted(CMS_SignerInfo, (st)) -# define sk_CONF_IMODULE_new(cmp) SKM_sk_new(CONF_IMODULE, (cmp)) -# define sk_CONF_IMODULE_new_null() SKM_sk_new_null(CONF_IMODULE) -# define sk_CONF_IMODULE_free(st) SKM_sk_free(CONF_IMODULE, (st)) -# define sk_CONF_IMODULE_num(st) SKM_sk_num(CONF_IMODULE, (st)) -# define sk_CONF_IMODULE_value(st, i) SKM_sk_value(CONF_IMODULE, (st), (i)) -# define sk_CONF_IMODULE_set(st, i, val) SKM_sk_set(CONF_IMODULE, (st), (i), (val)) -# define sk_CONF_IMODULE_zero(st) SKM_sk_zero(CONF_IMODULE, (st)) -# define sk_CONF_IMODULE_push(st, val) SKM_sk_push(CONF_IMODULE, (st), (val)) -# define sk_CONF_IMODULE_unshift(st, val) SKM_sk_unshift(CONF_IMODULE, (st), (val)) -# define sk_CONF_IMODULE_find(st, val) SKM_sk_find(CONF_IMODULE, (st), (val)) -# define sk_CONF_IMODULE_find_ex(st, val) SKM_sk_find_ex(CONF_IMODULE, (st), (val)) -# define sk_CONF_IMODULE_delete(st, i) SKM_sk_delete(CONF_IMODULE, (st), (i)) -# define sk_CONF_IMODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_IMODULE, (st), (ptr)) -# define sk_CONF_IMODULE_insert(st, val, i) SKM_sk_insert(CONF_IMODULE, (st), (val), (i)) -# define sk_CONF_IMODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_IMODULE, (st), (cmp)) -# define sk_CONF_IMODULE_dup(st) SKM_sk_dup(CONF_IMODULE, st) -# define sk_CONF_IMODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_IMODULE, (st), (free_func)) -# define sk_CONF_IMODULE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_IMODULE, (st), (copy_func), (free_func)) -# define sk_CONF_IMODULE_shift(st) SKM_sk_shift(CONF_IMODULE, (st)) -# define sk_CONF_IMODULE_pop(st) SKM_sk_pop(CONF_IMODULE, (st)) -# define sk_CONF_IMODULE_sort(st) SKM_sk_sort(CONF_IMODULE, (st)) -# define sk_CONF_IMODULE_is_sorted(st) SKM_sk_is_sorted(CONF_IMODULE, (st)) -# define sk_CONF_MODULE_new(cmp) SKM_sk_new(CONF_MODULE, (cmp)) -# define sk_CONF_MODULE_new_null() SKM_sk_new_null(CONF_MODULE) -# define sk_CONF_MODULE_free(st) SKM_sk_free(CONF_MODULE, (st)) -# define sk_CONF_MODULE_num(st) SKM_sk_num(CONF_MODULE, (st)) -# define sk_CONF_MODULE_value(st, i) SKM_sk_value(CONF_MODULE, (st), (i)) -# define sk_CONF_MODULE_set(st, i, val) SKM_sk_set(CONF_MODULE, (st), (i), (val)) -# define sk_CONF_MODULE_zero(st) SKM_sk_zero(CONF_MODULE, (st)) -# define sk_CONF_MODULE_push(st, val) SKM_sk_push(CONF_MODULE, (st), (val)) -# define sk_CONF_MODULE_unshift(st, val) SKM_sk_unshift(CONF_MODULE, (st), (val)) -# define sk_CONF_MODULE_find(st, val) SKM_sk_find(CONF_MODULE, (st), (val)) -# define sk_CONF_MODULE_find_ex(st, val) SKM_sk_find_ex(CONF_MODULE, (st), (val)) -# define sk_CONF_MODULE_delete(st, i) SKM_sk_delete(CONF_MODULE, (st), (i)) -# define sk_CONF_MODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_MODULE, (st), (ptr)) -# define sk_CONF_MODULE_insert(st, val, i) SKM_sk_insert(CONF_MODULE, (st), (val), (i)) -# define sk_CONF_MODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_MODULE, (st), (cmp)) -# define sk_CONF_MODULE_dup(st) SKM_sk_dup(CONF_MODULE, st) -# define sk_CONF_MODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_MODULE, (st), (free_func)) -# define sk_CONF_MODULE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_MODULE, (st), (copy_func), (free_func)) -# define sk_CONF_MODULE_shift(st) SKM_sk_shift(CONF_MODULE, (st)) -# define sk_CONF_MODULE_pop(st) SKM_sk_pop(CONF_MODULE, (st)) -# define sk_CONF_MODULE_sort(st) SKM_sk_sort(CONF_MODULE, (st)) -# define sk_CONF_MODULE_is_sorted(st) SKM_sk_is_sorted(CONF_MODULE, (st)) -# define sk_CONF_VALUE_new(cmp) SKM_sk_new(CONF_VALUE, (cmp)) -# define sk_CONF_VALUE_new_null() SKM_sk_new_null(CONF_VALUE) -# define sk_CONF_VALUE_free(st) SKM_sk_free(CONF_VALUE, (st)) -# define sk_CONF_VALUE_num(st) SKM_sk_num(CONF_VALUE, (st)) -# define sk_CONF_VALUE_value(st, i) SKM_sk_value(CONF_VALUE, (st), (i)) -# define sk_CONF_VALUE_set(st, i, val) SKM_sk_set(CONF_VALUE, (st), (i), (val)) -# define sk_CONF_VALUE_zero(st) SKM_sk_zero(CONF_VALUE, (st)) -# define sk_CONF_VALUE_push(st, val) SKM_sk_push(CONF_VALUE, (st), (val)) -# define sk_CONF_VALUE_unshift(st, val) SKM_sk_unshift(CONF_VALUE, (st), (val)) -# define sk_CONF_VALUE_find(st, val) SKM_sk_find(CONF_VALUE, (st), (val)) -# define sk_CONF_VALUE_find_ex(st, val) SKM_sk_find_ex(CONF_VALUE, (st), (val)) -# define sk_CONF_VALUE_delete(st, i) SKM_sk_delete(CONF_VALUE, (st), (i)) -# define sk_CONF_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_VALUE, (st), (ptr)) -# define sk_CONF_VALUE_insert(st, val, i) SKM_sk_insert(CONF_VALUE, (st), (val), (i)) -# define sk_CONF_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_VALUE, (st), (cmp)) -# define sk_CONF_VALUE_dup(st) SKM_sk_dup(CONF_VALUE, st) -# define sk_CONF_VALUE_pop_free(st, free_func) SKM_sk_pop_free(CONF_VALUE, (st), (free_func)) -# define sk_CONF_VALUE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_VALUE, (st), (copy_func), (free_func)) -# define sk_CONF_VALUE_shift(st) SKM_sk_shift(CONF_VALUE, (st)) -# define sk_CONF_VALUE_pop(st) SKM_sk_pop(CONF_VALUE, (st)) -# define sk_CONF_VALUE_sort(st) SKM_sk_sort(CONF_VALUE, (st)) -# define sk_CONF_VALUE_is_sorted(st) SKM_sk_is_sorted(CONF_VALUE, (st)) -# define sk_CRYPTO_EX_DATA_FUNCS_new(cmp) SKM_sk_new(CRYPTO_EX_DATA_FUNCS, (cmp)) -# define sk_CRYPTO_EX_DATA_FUNCS_new_null() SKM_sk_new_null(CRYPTO_EX_DATA_FUNCS) -# define sk_CRYPTO_EX_DATA_FUNCS_free(st) SKM_sk_free(CRYPTO_EX_DATA_FUNCS, (st)) -# define sk_CRYPTO_EX_DATA_FUNCS_num(st) SKM_sk_num(CRYPTO_EX_DATA_FUNCS, (st)) -# define sk_CRYPTO_EX_DATA_FUNCS_value(st, i) SKM_sk_value(CRYPTO_EX_DATA_FUNCS, (st), (i)) -# define sk_CRYPTO_EX_DATA_FUNCS_set(st, i, val) SKM_sk_set(CRYPTO_EX_DATA_FUNCS, (st), (i), (val)) -# define sk_CRYPTO_EX_DATA_FUNCS_zero(st) SKM_sk_zero(CRYPTO_EX_DATA_FUNCS, (st)) -# define sk_CRYPTO_EX_DATA_FUNCS_push(st, val) SKM_sk_push(CRYPTO_EX_DATA_FUNCS, (st), (val)) -# define sk_CRYPTO_EX_DATA_FUNCS_unshift(st, val) SKM_sk_unshift(CRYPTO_EX_DATA_FUNCS, (st), (val)) -# define sk_CRYPTO_EX_DATA_FUNCS_find(st, val) SKM_sk_find(CRYPTO_EX_DATA_FUNCS, (st), (val)) -# define sk_CRYPTO_EX_DATA_FUNCS_find_ex(st, val) SKM_sk_find_ex(CRYPTO_EX_DATA_FUNCS, (st), (val)) -# define sk_CRYPTO_EX_DATA_FUNCS_delete(st, i) SKM_sk_delete(CRYPTO_EX_DATA_FUNCS, (st), (i)) -# define sk_CRYPTO_EX_DATA_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_EX_DATA_FUNCS, (st), (ptr)) -# define sk_CRYPTO_EX_DATA_FUNCS_insert(st, val, i) SKM_sk_insert(CRYPTO_EX_DATA_FUNCS, (st), (val), (i)) -# define sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_EX_DATA_FUNCS, (st), (cmp)) -# define sk_CRYPTO_EX_DATA_FUNCS_dup(st) SKM_sk_dup(CRYPTO_EX_DATA_FUNCS, st) -# define sk_CRYPTO_EX_DATA_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_EX_DATA_FUNCS, (st), (free_func)) -# define sk_CRYPTO_EX_DATA_FUNCS_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CRYPTO_EX_DATA_FUNCS, (st), (copy_func), (free_func)) -# define sk_CRYPTO_EX_DATA_FUNCS_shift(st) SKM_sk_shift(CRYPTO_EX_DATA_FUNCS, (st)) -# define sk_CRYPTO_EX_DATA_FUNCS_pop(st) SKM_sk_pop(CRYPTO_EX_DATA_FUNCS, (st)) -# define sk_CRYPTO_EX_DATA_FUNCS_sort(st) SKM_sk_sort(CRYPTO_EX_DATA_FUNCS, (st)) -# define sk_CRYPTO_EX_DATA_FUNCS_is_sorted(st) SKM_sk_is_sorted(CRYPTO_EX_DATA_FUNCS, (st)) -# define sk_CRYPTO_dynlock_new(cmp) SKM_sk_new(CRYPTO_dynlock, (cmp)) -# define sk_CRYPTO_dynlock_new_null() SKM_sk_new_null(CRYPTO_dynlock) -# define sk_CRYPTO_dynlock_free(st) SKM_sk_free(CRYPTO_dynlock, (st)) -# define sk_CRYPTO_dynlock_num(st) SKM_sk_num(CRYPTO_dynlock, (st)) -# define sk_CRYPTO_dynlock_value(st, i) SKM_sk_value(CRYPTO_dynlock, (st), (i)) -# define sk_CRYPTO_dynlock_set(st, i, val) SKM_sk_set(CRYPTO_dynlock, (st), (i), (val)) -# define sk_CRYPTO_dynlock_zero(st) SKM_sk_zero(CRYPTO_dynlock, (st)) -# define sk_CRYPTO_dynlock_push(st, val) SKM_sk_push(CRYPTO_dynlock, (st), (val)) -# define sk_CRYPTO_dynlock_unshift(st, val) SKM_sk_unshift(CRYPTO_dynlock, (st), (val)) -# define sk_CRYPTO_dynlock_find(st, val) SKM_sk_find(CRYPTO_dynlock, (st), (val)) -# define sk_CRYPTO_dynlock_find_ex(st, val) SKM_sk_find_ex(CRYPTO_dynlock, (st), (val)) -# define sk_CRYPTO_dynlock_delete(st, i) SKM_sk_delete(CRYPTO_dynlock, (st), (i)) -# define sk_CRYPTO_dynlock_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_dynlock, (st), (ptr)) -# define sk_CRYPTO_dynlock_insert(st, val, i) SKM_sk_insert(CRYPTO_dynlock, (st), (val), (i)) -# define sk_CRYPTO_dynlock_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_dynlock, (st), (cmp)) -# define sk_CRYPTO_dynlock_dup(st) SKM_sk_dup(CRYPTO_dynlock, st) -# define sk_CRYPTO_dynlock_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_dynlock, (st), (free_func)) -# define sk_CRYPTO_dynlock_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CRYPTO_dynlock, (st), (copy_func), (free_func)) -# define sk_CRYPTO_dynlock_shift(st) SKM_sk_shift(CRYPTO_dynlock, (st)) -# define sk_CRYPTO_dynlock_pop(st) SKM_sk_pop(CRYPTO_dynlock, (st)) -# define sk_CRYPTO_dynlock_sort(st) SKM_sk_sort(CRYPTO_dynlock, (st)) -# define sk_CRYPTO_dynlock_is_sorted(st) SKM_sk_is_sorted(CRYPTO_dynlock, (st)) -# define sk_DIST_POINT_new(cmp) SKM_sk_new(DIST_POINT, (cmp)) -# define sk_DIST_POINT_new_null() SKM_sk_new_null(DIST_POINT) -# define sk_DIST_POINT_free(st) SKM_sk_free(DIST_POINT, (st)) -# define sk_DIST_POINT_num(st) SKM_sk_num(DIST_POINT, (st)) -# define sk_DIST_POINT_value(st, i) SKM_sk_value(DIST_POINT, (st), (i)) -# define sk_DIST_POINT_set(st, i, val) SKM_sk_set(DIST_POINT, (st), (i), (val)) -# define sk_DIST_POINT_zero(st) SKM_sk_zero(DIST_POINT, (st)) -# define sk_DIST_POINT_push(st, val) SKM_sk_push(DIST_POINT, (st), (val)) -# define sk_DIST_POINT_unshift(st, val) SKM_sk_unshift(DIST_POINT, (st), (val)) -# define sk_DIST_POINT_find(st, val) SKM_sk_find(DIST_POINT, (st), (val)) -# define sk_DIST_POINT_find_ex(st, val) SKM_sk_find_ex(DIST_POINT, (st), (val)) -# define sk_DIST_POINT_delete(st, i) SKM_sk_delete(DIST_POINT, (st), (i)) -# define sk_DIST_POINT_delete_ptr(st, ptr) SKM_sk_delete_ptr(DIST_POINT, (st), (ptr)) -# define sk_DIST_POINT_insert(st, val, i) SKM_sk_insert(DIST_POINT, (st), (val), (i)) -# define sk_DIST_POINT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(DIST_POINT, (st), (cmp)) -# define sk_DIST_POINT_dup(st) SKM_sk_dup(DIST_POINT, st) -# define sk_DIST_POINT_pop_free(st, free_func) SKM_sk_pop_free(DIST_POINT, (st), (free_func)) -# define sk_DIST_POINT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(DIST_POINT, (st), (copy_func), (free_func)) -# define sk_DIST_POINT_shift(st) SKM_sk_shift(DIST_POINT, (st)) -# define sk_DIST_POINT_pop(st) SKM_sk_pop(DIST_POINT, (st)) -# define sk_DIST_POINT_sort(st) SKM_sk_sort(DIST_POINT, (st)) -# define sk_DIST_POINT_is_sorted(st) SKM_sk_is_sorted(DIST_POINT, (st)) -# define sk_ENGINE_new(cmp) SKM_sk_new(ENGINE, (cmp)) -# define sk_ENGINE_new_null() SKM_sk_new_null(ENGINE) -# define sk_ENGINE_free(st) SKM_sk_free(ENGINE, (st)) -# define sk_ENGINE_num(st) SKM_sk_num(ENGINE, (st)) -# define sk_ENGINE_value(st, i) SKM_sk_value(ENGINE, (st), (i)) -# define sk_ENGINE_set(st, i, val) SKM_sk_set(ENGINE, (st), (i), (val)) -# define sk_ENGINE_zero(st) SKM_sk_zero(ENGINE, (st)) -# define sk_ENGINE_push(st, val) SKM_sk_push(ENGINE, (st), (val)) -# define sk_ENGINE_unshift(st, val) SKM_sk_unshift(ENGINE, (st), (val)) -# define sk_ENGINE_find(st, val) SKM_sk_find(ENGINE, (st), (val)) -# define sk_ENGINE_find_ex(st, val) SKM_sk_find_ex(ENGINE, (st), (val)) -# define sk_ENGINE_delete(st, i) SKM_sk_delete(ENGINE, (st), (i)) -# define sk_ENGINE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE, (st), (ptr)) -# define sk_ENGINE_insert(st, val, i) SKM_sk_insert(ENGINE, (st), (val), (i)) -# define sk_ENGINE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE, (st), (cmp)) -# define sk_ENGINE_dup(st) SKM_sk_dup(ENGINE, st) -# define sk_ENGINE_pop_free(st, free_func) SKM_sk_pop_free(ENGINE, (st), (free_func)) -# define sk_ENGINE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ENGINE, (st), (copy_func), (free_func)) -# define sk_ENGINE_shift(st) SKM_sk_shift(ENGINE, (st)) -# define sk_ENGINE_pop(st) SKM_sk_pop(ENGINE, (st)) -# define sk_ENGINE_sort(st) SKM_sk_sort(ENGINE, (st)) -# define sk_ENGINE_is_sorted(st) SKM_sk_is_sorted(ENGINE, (st)) -# define sk_ENGINE_CLEANUP_ITEM_new(cmp) SKM_sk_new(ENGINE_CLEANUP_ITEM, (cmp)) -# define sk_ENGINE_CLEANUP_ITEM_new_null() SKM_sk_new_null(ENGINE_CLEANUP_ITEM) -# define sk_ENGINE_CLEANUP_ITEM_free(st) SKM_sk_free(ENGINE_CLEANUP_ITEM, (st)) -# define sk_ENGINE_CLEANUP_ITEM_num(st) SKM_sk_num(ENGINE_CLEANUP_ITEM, (st)) -# define sk_ENGINE_CLEANUP_ITEM_value(st, i) SKM_sk_value(ENGINE_CLEANUP_ITEM, (st), (i)) -# define sk_ENGINE_CLEANUP_ITEM_set(st, i, val) SKM_sk_set(ENGINE_CLEANUP_ITEM, (st), (i), (val)) -# define sk_ENGINE_CLEANUP_ITEM_zero(st) SKM_sk_zero(ENGINE_CLEANUP_ITEM, (st)) -# define sk_ENGINE_CLEANUP_ITEM_push(st, val) SKM_sk_push(ENGINE_CLEANUP_ITEM, (st), (val)) -# define sk_ENGINE_CLEANUP_ITEM_unshift(st, val) SKM_sk_unshift(ENGINE_CLEANUP_ITEM, (st), (val)) -# define sk_ENGINE_CLEANUP_ITEM_find(st, val) SKM_sk_find(ENGINE_CLEANUP_ITEM, (st), (val)) -# define sk_ENGINE_CLEANUP_ITEM_find_ex(st, val) SKM_sk_find_ex(ENGINE_CLEANUP_ITEM, (st), (val)) -# define sk_ENGINE_CLEANUP_ITEM_delete(st, i) SKM_sk_delete(ENGINE_CLEANUP_ITEM, (st), (i)) -# define sk_ENGINE_CLEANUP_ITEM_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE_CLEANUP_ITEM, (st), (ptr)) -# define sk_ENGINE_CLEANUP_ITEM_insert(st, val, i) SKM_sk_insert(ENGINE_CLEANUP_ITEM, (st), (val), (i)) -# define sk_ENGINE_CLEANUP_ITEM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE_CLEANUP_ITEM, (st), (cmp)) -# define sk_ENGINE_CLEANUP_ITEM_dup(st) SKM_sk_dup(ENGINE_CLEANUP_ITEM, st) -# define sk_ENGINE_CLEANUP_ITEM_pop_free(st, free_func) SKM_sk_pop_free(ENGINE_CLEANUP_ITEM, (st), (free_func)) -# define sk_ENGINE_CLEANUP_ITEM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ENGINE_CLEANUP_ITEM, (st), (copy_func), (free_func)) -# define sk_ENGINE_CLEANUP_ITEM_shift(st) SKM_sk_shift(ENGINE_CLEANUP_ITEM, (st)) -# define sk_ENGINE_CLEANUP_ITEM_pop(st) SKM_sk_pop(ENGINE_CLEANUP_ITEM, (st)) -# define sk_ENGINE_CLEANUP_ITEM_sort(st) SKM_sk_sort(ENGINE_CLEANUP_ITEM, (st)) -# define sk_ENGINE_CLEANUP_ITEM_is_sorted(st) SKM_sk_is_sorted(ENGINE_CLEANUP_ITEM, (st)) -# define sk_ESS_CERT_ID_new(cmp) SKM_sk_new(ESS_CERT_ID, (cmp)) -# define sk_ESS_CERT_ID_new_null() SKM_sk_new_null(ESS_CERT_ID) -# define sk_ESS_CERT_ID_free(st) SKM_sk_free(ESS_CERT_ID, (st)) -# define sk_ESS_CERT_ID_num(st) SKM_sk_num(ESS_CERT_ID, (st)) -# define sk_ESS_CERT_ID_value(st, i) SKM_sk_value(ESS_CERT_ID, (st), (i)) -# define sk_ESS_CERT_ID_set(st, i, val) SKM_sk_set(ESS_CERT_ID, (st), (i), (val)) -# define sk_ESS_CERT_ID_zero(st) SKM_sk_zero(ESS_CERT_ID, (st)) -# define sk_ESS_CERT_ID_push(st, val) SKM_sk_push(ESS_CERT_ID, (st), (val)) -# define sk_ESS_CERT_ID_unshift(st, val) SKM_sk_unshift(ESS_CERT_ID, (st), (val)) -# define sk_ESS_CERT_ID_find(st, val) SKM_sk_find(ESS_CERT_ID, (st), (val)) -# define sk_ESS_CERT_ID_find_ex(st, val) SKM_sk_find_ex(ESS_CERT_ID, (st), (val)) -# define sk_ESS_CERT_ID_delete(st, i) SKM_sk_delete(ESS_CERT_ID, (st), (i)) -# define sk_ESS_CERT_ID_delete_ptr(st, ptr) SKM_sk_delete_ptr(ESS_CERT_ID, (st), (ptr)) -# define sk_ESS_CERT_ID_insert(st, val, i) SKM_sk_insert(ESS_CERT_ID, (st), (val), (i)) -# define sk_ESS_CERT_ID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ESS_CERT_ID, (st), (cmp)) -# define sk_ESS_CERT_ID_dup(st) SKM_sk_dup(ESS_CERT_ID, st) -# define sk_ESS_CERT_ID_pop_free(st, free_func) SKM_sk_pop_free(ESS_CERT_ID, (st), (free_func)) -# define sk_ESS_CERT_ID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ESS_CERT_ID, (st), (copy_func), (free_func)) -# define sk_ESS_CERT_ID_shift(st) SKM_sk_shift(ESS_CERT_ID, (st)) -# define sk_ESS_CERT_ID_pop(st) SKM_sk_pop(ESS_CERT_ID, (st)) -# define sk_ESS_CERT_ID_sort(st) SKM_sk_sort(ESS_CERT_ID, (st)) -# define sk_ESS_CERT_ID_is_sorted(st) SKM_sk_is_sorted(ESS_CERT_ID, (st)) -# define sk_EVP_MD_new(cmp) SKM_sk_new(EVP_MD, (cmp)) -# define sk_EVP_MD_new_null() SKM_sk_new_null(EVP_MD) -# define sk_EVP_MD_free(st) SKM_sk_free(EVP_MD, (st)) -# define sk_EVP_MD_num(st) SKM_sk_num(EVP_MD, (st)) -# define sk_EVP_MD_value(st, i) SKM_sk_value(EVP_MD, (st), (i)) -# define sk_EVP_MD_set(st, i, val) SKM_sk_set(EVP_MD, (st), (i), (val)) -# define sk_EVP_MD_zero(st) SKM_sk_zero(EVP_MD, (st)) -# define sk_EVP_MD_push(st, val) SKM_sk_push(EVP_MD, (st), (val)) -# define sk_EVP_MD_unshift(st, val) SKM_sk_unshift(EVP_MD, (st), (val)) -# define sk_EVP_MD_find(st, val) SKM_sk_find(EVP_MD, (st), (val)) -# define sk_EVP_MD_find_ex(st, val) SKM_sk_find_ex(EVP_MD, (st), (val)) -# define sk_EVP_MD_delete(st, i) SKM_sk_delete(EVP_MD, (st), (i)) -# define sk_EVP_MD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_MD, (st), (ptr)) -# define sk_EVP_MD_insert(st, val, i) SKM_sk_insert(EVP_MD, (st), (val), (i)) -# define sk_EVP_MD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_MD, (st), (cmp)) -# define sk_EVP_MD_dup(st) SKM_sk_dup(EVP_MD, st) -# define sk_EVP_MD_pop_free(st, free_func) SKM_sk_pop_free(EVP_MD, (st), (free_func)) -# define sk_EVP_MD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_MD, (st), (copy_func), (free_func)) -# define sk_EVP_MD_shift(st) SKM_sk_shift(EVP_MD, (st)) -# define sk_EVP_MD_pop(st) SKM_sk_pop(EVP_MD, (st)) -# define sk_EVP_MD_sort(st) SKM_sk_sort(EVP_MD, (st)) -# define sk_EVP_MD_is_sorted(st) SKM_sk_is_sorted(EVP_MD, (st)) -# define sk_EVP_PBE_CTL_new(cmp) SKM_sk_new(EVP_PBE_CTL, (cmp)) -# define sk_EVP_PBE_CTL_new_null() SKM_sk_new_null(EVP_PBE_CTL) -# define sk_EVP_PBE_CTL_free(st) SKM_sk_free(EVP_PBE_CTL, (st)) -# define sk_EVP_PBE_CTL_num(st) SKM_sk_num(EVP_PBE_CTL, (st)) -# define sk_EVP_PBE_CTL_value(st, i) SKM_sk_value(EVP_PBE_CTL, (st), (i)) -# define sk_EVP_PBE_CTL_set(st, i, val) SKM_sk_set(EVP_PBE_CTL, (st), (i), (val)) -# define sk_EVP_PBE_CTL_zero(st) SKM_sk_zero(EVP_PBE_CTL, (st)) -# define sk_EVP_PBE_CTL_push(st, val) SKM_sk_push(EVP_PBE_CTL, (st), (val)) -# define sk_EVP_PBE_CTL_unshift(st, val) SKM_sk_unshift(EVP_PBE_CTL, (st), (val)) -# define sk_EVP_PBE_CTL_find(st, val) SKM_sk_find(EVP_PBE_CTL, (st), (val)) -# define sk_EVP_PBE_CTL_find_ex(st, val) SKM_sk_find_ex(EVP_PBE_CTL, (st), (val)) -# define sk_EVP_PBE_CTL_delete(st, i) SKM_sk_delete(EVP_PBE_CTL, (st), (i)) -# define sk_EVP_PBE_CTL_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PBE_CTL, (st), (ptr)) -# define sk_EVP_PBE_CTL_insert(st, val, i) SKM_sk_insert(EVP_PBE_CTL, (st), (val), (i)) -# define sk_EVP_PBE_CTL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PBE_CTL, (st), (cmp)) -# define sk_EVP_PBE_CTL_dup(st) SKM_sk_dup(EVP_PBE_CTL, st) -# define sk_EVP_PBE_CTL_pop_free(st, free_func) SKM_sk_pop_free(EVP_PBE_CTL, (st), (free_func)) -# define sk_EVP_PBE_CTL_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PBE_CTL, (st), (copy_func), (free_func)) -# define sk_EVP_PBE_CTL_shift(st) SKM_sk_shift(EVP_PBE_CTL, (st)) -# define sk_EVP_PBE_CTL_pop(st) SKM_sk_pop(EVP_PBE_CTL, (st)) -# define sk_EVP_PBE_CTL_sort(st) SKM_sk_sort(EVP_PBE_CTL, (st)) -# define sk_EVP_PBE_CTL_is_sorted(st) SKM_sk_is_sorted(EVP_PBE_CTL, (st)) -# define sk_EVP_PKEY_ASN1_METHOD_new(cmp) SKM_sk_new(EVP_PKEY_ASN1_METHOD, (cmp)) -# define sk_EVP_PKEY_ASN1_METHOD_new_null() SKM_sk_new_null(EVP_PKEY_ASN1_METHOD) -# define sk_EVP_PKEY_ASN1_METHOD_free(st) SKM_sk_free(EVP_PKEY_ASN1_METHOD, (st)) -# define sk_EVP_PKEY_ASN1_METHOD_num(st) SKM_sk_num(EVP_PKEY_ASN1_METHOD, (st)) -# define sk_EVP_PKEY_ASN1_METHOD_value(st, i) SKM_sk_value(EVP_PKEY_ASN1_METHOD, (st), (i)) -# define sk_EVP_PKEY_ASN1_METHOD_set(st, i, val) SKM_sk_set(EVP_PKEY_ASN1_METHOD, (st), (i), (val)) -# define sk_EVP_PKEY_ASN1_METHOD_zero(st) SKM_sk_zero(EVP_PKEY_ASN1_METHOD, (st)) -# define sk_EVP_PKEY_ASN1_METHOD_push(st, val) SKM_sk_push(EVP_PKEY_ASN1_METHOD, (st), (val)) -# define sk_EVP_PKEY_ASN1_METHOD_unshift(st, val) SKM_sk_unshift(EVP_PKEY_ASN1_METHOD, (st), (val)) -# define sk_EVP_PKEY_ASN1_METHOD_find(st, val) SKM_sk_find(EVP_PKEY_ASN1_METHOD, (st), (val)) -# define sk_EVP_PKEY_ASN1_METHOD_find_ex(st, val) SKM_sk_find_ex(EVP_PKEY_ASN1_METHOD, (st), (val)) -# define sk_EVP_PKEY_ASN1_METHOD_delete(st, i) SKM_sk_delete(EVP_PKEY_ASN1_METHOD, (st), (i)) -# define sk_EVP_PKEY_ASN1_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PKEY_ASN1_METHOD, (st), (ptr)) -# define sk_EVP_PKEY_ASN1_METHOD_insert(st, val, i) SKM_sk_insert(EVP_PKEY_ASN1_METHOD, (st), (val), (i)) -# define sk_EVP_PKEY_ASN1_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PKEY_ASN1_METHOD, (st), (cmp)) -# define sk_EVP_PKEY_ASN1_METHOD_dup(st) SKM_sk_dup(EVP_PKEY_ASN1_METHOD, st) -# define sk_EVP_PKEY_ASN1_METHOD_pop_free(st, free_func) SKM_sk_pop_free(EVP_PKEY_ASN1_METHOD, (st), (free_func)) -# define sk_EVP_PKEY_ASN1_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PKEY_ASN1_METHOD, (st), (copy_func), (free_func)) -# define sk_EVP_PKEY_ASN1_METHOD_shift(st) SKM_sk_shift(EVP_PKEY_ASN1_METHOD, (st)) -# define sk_EVP_PKEY_ASN1_METHOD_pop(st) SKM_sk_pop(EVP_PKEY_ASN1_METHOD, (st)) -# define sk_EVP_PKEY_ASN1_METHOD_sort(st) SKM_sk_sort(EVP_PKEY_ASN1_METHOD, (st)) -# define sk_EVP_PKEY_ASN1_METHOD_is_sorted(st) SKM_sk_is_sorted(EVP_PKEY_ASN1_METHOD, (st)) -# define sk_EVP_PKEY_METHOD_new(cmp) SKM_sk_new(EVP_PKEY_METHOD, (cmp)) -# define sk_EVP_PKEY_METHOD_new_null() SKM_sk_new_null(EVP_PKEY_METHOD) -# define sk_EVP_PKEY_METHOD_free(st) SKM_sk_free(EVP_PKEY_METHOD, (st)) -# define sk_EVP_PKEY_METHOD_num(st) SKM_sk_num(EVP_PKEY_METHOD, (st)) -# define sk_EVP_PKEY_METHOD_value(st, i) SKM_sk_value(EVP_PKEY_METHOD, (st), (i)) -# define sk_EVP_PKEY_METHOD_set(st, i, val) SKM_sk_set(EVP_PKEY_METHOD, (st), (i), (val)) -# define sk_EVP_PKEY_METHOD_zero(st) SKM_sk_zero(EVP_PKEY_METHOD, (st)) -# define sk_EVP_PKEY_METHOD_push(st, val) SKM_sk_push(EVP_PKEY_METHOD, (st), (val)) -# define sk_EVP_PKEY_METHOD_unshift(st, val) SKM_sk_unshift(EVP_PKEY_METHOD, (st), (val)) -# define sk_EVP_PKEY_METHOD_find(st, val) SKM_sk_find(EVP_PKEY_METHOD, (st), (val)) -# define sk_EVP_PKEY_METHOD_find_ex(st, val) SKM_sk_find_ex(EVP_PKEY_METHOD, (st), (val)) -# define sk_EVP_PKEY_METHOD_delete(st, i) SKM_sk_delete(EVP_PKEY_METHOD, (st), (i)) -# define sk_EVP_PKEY_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PKEY_METHOD, (st), (ptr)) -# define sk_EVP_PKEY_METHOD_insert(st, val, i) SKM_sk_insert(EVP_PKEY_METHOD, (st), (val), (i)) -# define sk_EVP_PKEY_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PKEY_METHOD, (st), (cmp)) -# define sk_EVP_PKEY_METHOD_dup(st) SKM_sk_dup(EVP_PKEY_METHOD, st) -# define sk_EVP_PKEY_METHOD_pop_free(st, free_func) SKM_sk_pop_free(EVP_PKEY_METHOD, (st), (free_func)) -# define sk_EVP_PKEY_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PKEY_METHOD, (st), (copy_func), (free_func)) -# define sk_EVP_PKEY_METHOD_shift(st) SKM_sk_shift(EVP_PKEY_METHOD, (st)) -# define sk_EVP_PKEY_METHOD_pop(st) SKM_sk_pop(EVP_PKEY_METHOD, (st)) -# define sk_EVP_PKEY_METHOD_sort(st) SKM_sk_sort(EVP_PKEY_METHOD, (st)) -# define sk_EVP_PKEY_METHOD_is_sorted(st) SKM_sk_is_sorted(EVP_PKEY_METHOD, (st)) -# define sk_GENERAL_NAME_new(cmp) SKM_sk_new(GENERAL_NAME, (cmp)) -# define sk_GENERAL_NAME_new_null() SKM_sk_new_null(GENERAL_NAME) -# define sk_GENERAL_NAME_free(st) SKM_sk_free(GENERAL_NAME, (st)) -# define sk_GENERAL_NAME_num(st) SKM_sk_num(GENERAL_NAME, (st)) -# define sk_GENERAL_NAME_value(st, i) SKM_sk_value(GENERAL_NAME, (st), (i)) -# define sk_GENERAL_NAME_set(st, i, val) SKM_sk_set(GENERAL_NAME, (st), (i), (val)) -# define sk_GENERAL_NAME_zero(st) SKM_sk_zero(GENERAL_NAME, (st)) -# define sk_GENERAL_NAME_push(st, val) SKM_sk_push(GENERAL_NAME, (st), (val)) -# define sk_GENERAL_NAME_unshift(st, val) SKM_sk_unshift(GENERAL_NAME, (st), (val)) -# define sk_GENERAL_NAME_find(st, val) SKM_sk_find(GENERAL_NAME, (st), (val)) -# define sk_GENERAL_NAME_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAME, (st), (val)) -# define sk_GENERAL_NAME_delete(st, i) SKM_sk_delete(GENERAL_NAME, (st), (i)) -# define sk_GENERAL_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAME, (st), (ptr)) -# define sk_GENERAL_NAME_insert(st, val, i) SKM_sk_insert(GENERAL_NAME, (st), (val), (i)) -# define sk_GENERAL_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAME, (st), (cmp)) -# define sk_GENERAL_NAME_dup(st) SKM_sk_dup(GENERAL_NAME, st) -# define sk_GENERAL_NAME_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAME, (st), (free_func)) -# define sk_GENERAL_NAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_NAME, (st), (copy_func), (free_func)) -# define sk_GENERAL_NAME_shift(st) SKM_sk_shift(GENERAL_NAME, (st)) -# define sk_GENERAL_NAME_pop(st) SKM_sk_pop(GENERAL_NAME, (st)) -# define sk_GENERAL_NAME_sort(st) SKM_sk_sort(GENERAL_NAME, (st)) -# define sk_GENERAL_NAME_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAME, (st)) -# define sk_GENERAL_NAMES_new(cmp) SKM_sk_new(GENERAL_NAMES, (cmp)) -# define sk_GENERAL_NAMES_new_null() SKM_sk_new_null(GENERAL_NAMES) -# define sk_GENERAL_NAMES_free(st) SKM_sk_free(GENERAL_NAMES, (st)) -# define sk_GENERAL_NAMES_num(st) SKM_sk_num(GENERAL_NAMES, (st)) -# define sk_GENERAL_NAMES_value(st, i) SKM_sk_value(GENERAL_NAMES, (st), (i)) -# define sk_GENERAL_NAMES_set(st, i, val) SKM_sk_set(GENERAL_NAMES, (st), (i), (val)) -# define sk_GENERAL_NAMES_zero(st) SKM_sk_zero(GENERAL_NAMES, (st)) -# define sk_GENERAL_NAMES_push(st, val) SKM_sk_push(GENERAL_NAMES, (st), (val)) -# define sk_GENERAL_NAMES_unshift(st, val) SKM_sk_unshift(GENERAL_NAMES, (st), (val)) -# define sk_GENERAL_NAMES_find(st, val) SKM_sk_find(GENERAL_NAMES, (st), (val)) -# define sk_GENERAL_NAMES_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAMES, (st), (val)) -# define sk_GENERAL_NAMES_delete(st, i) SKM_sk_delete(GENERAL_NAMES, (st), (i)) -# define sk_GENERAL_NAMES_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAMES, (st), (ptr)) -# define sk_GENERAL_NAMES_insert(st, val, i) SKM_sk_insert(GENERAL_NAMES, (st), (val), (i)) -# define sk_GENERAL_NAMES_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAMES, (st), (cmp)) -# define sk_GENERAL_NAMES_dup(st) SKM_sk_dup(GENERAL_NAMES, st) -# define sk_GENERAL_NAMES_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAMES, (st), (free_func)) -# define sk_GENERAL_NAMES_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_NAMES, (st), (copy_func), (free_func)) -# define sk_GENERAL_NAMES_shift(st) SKM_sk_shift(GENERAL_NAMES, (st)) -# define sk_GENERAL_NAMES_pop(st) SKM_sk_pop(GENERAL_NAMES, (st)) -# define sk_GENERAL_NAMES_sort(st) SKM_sk_sort(GENERAL_NAMES, (st)) -# define sk_GENERAL_NAMES_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAMES, (st)) -# define sk_GENERAL_SUBTREE_new(cmp) SKM_sk_new(GENERAL_SUBTREE, (cmp)) -# define sk_GENERAL_SUBTREE_new_null() SKM_sk_new_null(GENERAL_SUBTREE) -# define sk_GENERAL_SUBTREE_free(st) SKM_sk_free(GENERAL_SUBTREE, (st)) -# define sk_GENERAL_SUBTREE_num(st) SKM_sk_num(GENERAL_SUBTREE, (st)) -# define sk_GENERAL_SUBTREE_value(st, i) SKM_sk_value(GENERAL_SUBTREE, (st), (i)) -# define sk_GENERAL_SUBTREE_set(st, i, val) SKM_sk_set(GENERAL_SUBTREE, (st), (i), (val)) -# define sk_GENERAL_SUBTREE_zero(st) SKM_sk_zero(GENERAL_SUBTREE, (st)) -# define sk_GENERAL_SUBTREE_push(st, val) SKM_sk_push(GENERAL_SUBTREE, (st), (val)) -# define sk_GENERAL_SUBTREE_unshift(st, val) SKM_sk_unshift(GENERAL_SUBTREE, (st), (val)) -# define sk_GENERAL_SUBTREE_find(st, val) SKM_sk_find(GENERAL_SUBTREE, (st), (val)) -# define sk_GENERAL_SUBTREE_find_ex(st, val) SKM_sk_find_ex(GENERAL_SUBTREE, (st), (val)) -# define sk_GENERAL_SUBTREE_delete(st, i) SKM_sk_delete(GENERAL_SUBTREE, (st), (i)) -# define sk_GENERAL_SUBTREE_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_SUBTREE, (st), (ptr)) -# define sk_GENERAL_SUBTREE_insert(st, val, i) SKM_sk_insert(GENERAL_SUBTREE, (st), (val), (i)) -# define sk_GENERAL_SUBTREE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_SUBTREE, (st), (cmp)) -# define sk_GENERAL_SUBTREE_dup(st) SKM_sk_dup(GENERAL_SUBTREE, st) -# define sk_GENERAL_SUBTREE_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_SUBTREE, (st), (free_func)) -# define sk_GENERAL_SUBTREE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_SUBTREE, (st), (copy_func), (free_func)) -# define sk_GENERAL_SUBTREE_shift(st) SKM_sk_shift(GENERAL_SUBTREE, (st)) -# define sk_GENERAL_SUBTREE_pop(st) SKM_sk_pop(GENERAL_SUBTREE, (st)) -# define sk_GENERAL_SUBTREE_sort(st) SKM_sk_sort(GENERAL_SUBTREE, (st)) -# define sk_GENERAL_SUBTREE_is_sorted(st) SKM_sk_is_sorted(GENERAL_SUBTREE, (st)) -# define sk_IPAddressFamily_new(cmp) SKM_sk_new(IPAddressFamily, (cmp)) -# define sk_IPAddressFamily_new_null() SKM_sk_new_null(IPAddressFamily) -# define sk_IPAddressFamily_free(st) SKM_sk_free(IPAddressFamily, (st)) -# define sk_IPAddressFamily_num(st) SKM_sk_num(IPAddressFamily, (st)) -# define sk_IPAddressFamily_value(st, i) SKM_sk_value(IPAddressFamily, (st), (i)) -# define sk_IPAddressFamily_set(st, i, val) SKM_sk_set(IPAddressFamily, (st), (i), (val)) -# define sk_IPAddressFamily_zero(st) SKM_sk_zero(IPAddressFamily, (st)) -# define sk_IPAddressFamily_push(st, val) SKM_sk_push(IPAddressFamily, (st), (val)) -# define sk_IPAddressFamily_unshift(st, val) SKM_sk_unshift(IPAddressFamily, (st), (val)) -# define sk_IPAddressFamily_find(st, val) SKM_sk_find(IPAddressFamily, (st), (val)) -# define sk_IPAddressFamily_find_ex(st, val) SKM_sk_find_ex(IPAddressFamily, (st), (val)) -# define sk_IPAddressFamily_delete(st, i) SKM_sk_delete(IPAddressFamily, (st), (i)) -# define sk_IPAddressFamily_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressFamily, (st), (ptr)) -# define sk_IPAddressFamily_insert(st, val, i) SKM_sk_insert(IPAddressFamily, (st), (val), (i)) -# define sk_IPAddressFamily_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressFamily, (st), (cmp)) -# define sk_IPAddressFamily_dup(st) SKM_sk_dup(IPAddressFamily, st) -# define sk_IPAddressFamily_pop_free(st, free_func) SKM_sk_pop_free(IPAddressFamily, (st), (free_func)) -# define sk_IPAddressFamily_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(IPAddressFamily, (st), (copy_func), (free_func)) -# define sk_IPAddressFamily_shift(st) SKM_sk_shift(IPAddressFamily, (st)) -# define sk_IPAddressFamily_pop(st) SKM_sk_pop(IPAddressFamily, (st)) -# define sk_IPAddressFamily_sort(st) SKM_sk_sort(IPAddressFamily, (st)) -# define sk_IPAddressFamily_is_sorted(st) SKM_sk_is_sorted(IPAddressFamily, (st)) -# define sk_IPAddressOrRange_new(cmp) SKM_sk_new(IPAddressOrRange, (cmp)) -# define sk_IPAddressOrRange_new_null() SKM_sk_new_null(IPAddressOrRange) -# define sk_IPAddressOrRange_free(st) SKM_sk_free(IPAddressOrRange, (st)) -# define sk_IPAddressOrRange_num(st) SKM_sk_num(IPAddressOrRange, (st)) -# define sk_IPAddressOrRange_value(st, i) SKM_sk_value(IPAddressOrRange, (st), (i)) -# define sk_IPAddressOrRange_set(st, i, val) SKM_sk_set(IPAddressOrRange, (st), (i), (val)) -# define sk_IPAddressOrRange_zero(st) SKM_sk_zero(IPAddressOrRange, (st)) -# define sk_IPAddressOrRange_push(st, val) SKM_sk_push(IPAddressOrRange, (st), (val)) -# define sk_IPAddressOrRange_unshift(st, val) SKM_sk_unshift(IPAddressOrRange, (st), (val)) -# define sk_IPAddressOrRange_find(st, val) SKM_sk_find(IPAddressOrRange, (st), (val)) -# define sk_IPAddressOrRange_find_ex(st, val) SKM_sk_find_ex(IPAddressOrRange, (st), (val)) -# define sk_IPAddressOrRange_delete(st, i) SKM_sk_delete(IPAddressOrRange, (st), (i)) -# define sk_IPAddressOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressOrRange, (st), (ptr)) -# define sk_IPAddressOrRange_insert(st, val, i) SKM_sk_insert(IPAddressOrRange, (st), (val), (i)) -# define sk_IPAddressOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressOrRange, (st), (cmp)) -# define sk_IPAddressOrRange_dup(st) SKM_sk_dup(IPAddressOrRange, st) -# define sk_IPAddressOrRange_pop_free(st, free_func) SKM_sk_pop_free(IPAddressOrRange, (st), (free_func)) -# define sk_IPAddressOrRange_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(IPAddressOrRange, (st), (copy_func), (free_func)) -# define sk_IPAddressOrRange_shift(st) SKM_sk_shift(IPAddressOrRange, (st)) -# define sk_IPAddressOrRange_pop(st) SKM_sk_pop(IPAddressOrRange, (st)) -# define sk_IPAddressOrRange_sort(st) SKM_sk_sort(IPAddressOrRange, (st)) -# define sk_IPAddressOrRange_is_sorted(st) SKM_sk_is_sorted(IPAddressOrRange, (st)) -# define sk_KRB5_APREQBODY_new(cmp) SKM_sk_new(KRB5_APREQBODY, (cmp)) -# define sk_KRB5_APREQBODY_new_null() SKM_sk_new_null(KRB5_APREQBODY) -# define sk_KRB5_APREQBODY_free(st) SKM_sk_free(KRB5_APREQBODY, (st)) -# define sk_KRB5_APREQBODY_num(st) SKM_sk_num(KRB5_APREQBODY, (st)) -# define sk_KRB5_APREQBODY_value(st, i) SKM_sk_value(KRB5_APREQBODY, (st), (i)) -# define sk_KRB5_APREQBODY_set(st, i, val) SKM_sk_set(KRB5_APREQBODY, (st), (i), (val)) -# define sk_KRB5_APREQBODY_zero(st) SKM_sk_zero(KRB5_APREQBODY, (st)) -# define sk_KRB5_APREQBODY_push(st, val) SKM_sk_push(KRB5_APREQBODY, (st), (val)) -# define sk_KRB5_APREQBODY_unshift(st, val) SKM_sk_unshift(KRB5_APREQBODY, (st), (val)) -# define sk_KRB5_APREQBODY_find(st, val) SKM_sk_find(KRB5_APREQBODY, (st), (val)) -# define sk_KRB5_APREQBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_APREQBODY, (st), (val)) -# define sk_KRB5_APREQBODY_delete(st, i) SKM_sk_delete(KRB5_APREQBODY, (st), (i)) -# define sk_KRB5_APREQBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_APREQBODY, (st), (ptr)) -# define sk_KRB5_APREQBODY_insert(st, val, i) SKM_sk_insert(KRB5_APREQBODY, (st), (val), (i)) -# define sk_KRB5_APREQBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_APREQBODY, (st), (cmp)) -# define sk_KRB5_APREQBODY_dup(st) SKM_sk_dup(KRB5_APREQBODY, st) -# define sk_KRB5_APREQBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_APREQBODY, (st), (free_func)) -# define sk_KRB5_APREQBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_APREQBODY, (st), (copy_func), (free_func)) -# define sk_KRB5_APREQBODY_shift(st) SKM_sk_shift(KRB5_APREQBODY, (st)) -# define sk_KRB5_APREQBODY_pop(st) SKM_sk_pop(KRB5_APREQBODY, (st)) -# define sk_KRB5_APREQBODY_sort(st) SKM_sk_sort(KRB5_APREQBODY, (st)) -# define sk_KRB5_APREQBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_APREQBODY, (st)) -# define sk_KRB5_AUTHDATA_new(cmp) SKM_sk_new(KRB5_AUTHDATA, (cmp)) -# define sk_KRB5_AUTHDATA_new_null() SKM_sk_new_null(KRB5_AUTHDATA) -# define sk_KRB5_AUTHDATA_free(st) SKM_sk_free(KRB5_AUTHDATA, (st)) -# define sk_KRB5_AUTHDATA_num(st) SKM_sk_num(KRB5_AUTHDATA, (st)) -# define sk_KRB5_AUTHDATA_value(st, i) SKM_sk_value(KRB5_AUTHDATA, (st), (i)) -# define sk_KRB5_AUTHDATA_set(st, i, val) SKM_sk_set(KRB5_AUTHDATA, (st), (i), (val)) -# define sk_KRB5_AUTHDATA_zero(st) SKM_sk_zero(KRB5_AUTHDATA, (st)) -# define sk_KRB5_AUTHDATA_push(st, val) SKM_sk_push(KRB5_AUTHDATA, (st), (val)) -# define sk_KRB5_AUTHDATA_unshift(st, val) SKM_sk_unshift(KRB5_AUTHDATA, (st), (val)) -# define sk_KRB5_AUTHDATA_find(st, val) SKM_sk_find(KRB5_AUTHDATA, (st), (val)) -# define sk_KRB5_AUTHDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHDATA, (st), (val)) -# define sk_KRB5_AUTHDATA_delete(st, i) SKM_sk_delete(KRB5_AUTHDATA, (st), (i)) -# define sk_KRB5_AUTHDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHDATA, (st), (ptr)) -# define sk_KRB5_AUTHDATA_insert(st, val, i) SKM_sk_insert(KRB5_AUTHDATA, (st), (val), (i)) -# define sk_KRB5_AUTHDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHDATA, (st), (cmp)) -# define sk_KRB5_AUTHDATA_dup(st) SKM_sk_dup(KRB5_AUTHDATA, st) -# define sk_KRB5_AUTHDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHDATA, (st), (free_func)) -# define sk_KRB5_AUTHDATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_AUTHDATA, (st), (copy_func), (free_func)) -# define sk_KRB5_AUTHDATA_shift(st) SKM_sk_shift(KRB5_AUTHDATA, (st)) -# define sk_KRB5_AUTHDATA_pop(st) SKM_sk_pop(KRB5_AUTHDATA, (st)) -# define sk_KRB5_AUTHDATA_sort(st) SKM_sk_sort(KRB5_AUTHDATA, (st)) -# define sk_KRB5_AUTHDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHDATA, (st)) -# define sk_KRB5_AUTHENTBODY_new(cmp) SKM_sk_new(KRB5_AUTHENTBODY, (cmp)) -# define sk_KRB5_AUTHENTBODY_new_null() SKM_sk_new_null(KRB5_AUTHENTBODY) -# define sk_KRB5_AUTHENTBODY_free(st) SKM_sk_free(KRB5_AUTHENTBODY, (st)) -# define sk_KRB5_AUTHENTBODY_num(st) SKM_sk_num(KRB5_AUTHENTBODY, (st)) -# define sk_KRB5_AUTHENTBODY_value(st, i) SKM_sk_value(KRB5_AUTHENTBODY, (st), (i)) -# define sk_KRB5_AUTHENTBODY_set(st, i, val) SKM_sk_set(KRB5_AUTHENTBODY, (st), (i), (val)) -# define sk_KRB5_AUTHENTBODY_zero(st) SKM_sk_zero(KRB5_AUTHENTBODY, (st)) -# define sk_KRB5_AUTHENTBODY_push(st, val) SKM_sk_push(KRB5_AUTHENTBODY, (st), (val)) -# define sk_KRB5_AUTHENTBODY_unshift(st, val) SKM_sk_unshift(KRB5_AUTHENTBODY, (st), (val)) -# define sk_KRB5_AUTHENTBODY_find(st, val) SKM_sk_find(KRB5_AUTHENTBODY, (st), (val)) -# define sk_KRB5_AUTHENTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHENTBODY, (st), (val)) -# define sk_KRB5_AUTHENTBODY_delete(st, i) SKM_sk_delete(KRB5_AUTHENTBODY, (st), (i)) -# define sk_KRB5_AUTHENTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHENTBODY, (st), (ptr)) -# define sk_KRB5_AUTHENTBODY_insert(st, val, i) SKM_sk_insert(KRB5_AUTHENTBODY, (st), (val), (i)) -# define sk_KRB5_AUTHENTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHENTBODY, (st), (cmp)) -# define sk_KRB5_AUTHENTBODY_dup(st) SKM_sk_dup(KRB5_AUTHENTBODY, st) -# define sk_KRB5_AUTHENTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHENTBODY, (st), (free_func)) -# define sk_KRB5_AUTHENTBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_AUTHENTBODY, (st), (copy_func), (free_func)) -# define sk_KRB5_AUTHENTBODY_shift(st) SKM_sk_shift(KRB5_AUTHENTBODY, (st)) -# define sk_KRB5_AUTHENTBODY_pop(st) SKM_sk_pop(KRB5_AUTHENTBODY, (st)) -# define sk_KRB5_AUTHENTBODY_sort(st) SKM_sk_sort(KRB5_AUTHENTBODY, (st)) -# define sk_KRB5_AUTHENTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHENTBODY, (st)) -# define sk_KRB5_CHECKSUM_new(cmp) SKM_sk_new(KRB5_CHECKSUM, (cmp)) -# define sk_KRB5_CHECKSUM_new_null() SKM_sk_new_null(KRB5_CHECKSUM) -# define sk_KRB5_CHECKSUM_free(st) SKM_sk_free(KRB5_CHECKSUM, (st)) -# define sk_KRB5_CHECKSUM_num(st) SKM_sk_num(KRB5_CHECKSUM, (st)) -# define sk_KRB5_CHECKSUM_value(st, i) SKM_sk_value(KRB5_CHECKSUM, (st), (i)) -# define sk_KRB5_CHECKSUM_set(st, i, val) SKM_sk_set(KRB5_CHECKSUM, (st), (i), (val)) -# define sk_KRB5_CHECKSUM_zero(st) SKM_sk_zero(KRB5_CHECKSUM, (st)) -# define sk_KRB5_CHECKSUM_push(st, val) SKM_sk_push(KRB5_CHECKSUM, (st), (val)) -# define sk_KRB5_CHECKSUM_unshift(st, val) SKM_sk_unshift(KRB5_CHECKSUM, (st), (val)) -# define sk_KRB5_CHECKSUM_find(st, val) SKM_sk_find(KRB5_CHECKSUM, (st), (val)) -# define sk_KRB5_CHECKSUM_find_ex(st, val) SKM_sk_find_ex(KRB5_CHECKSUM, (st), (val)) -# define sk_KRB5_CHECKSUM_delete(st, i) SKM_sk_delete(KRB5_CHECKSUM, (st), (i)) -# define sk_KRB5_CHECKSUM_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_CHECKSUM, (st), (ptr)) -# define sk_KRB5_CHECKSUM_insert(st, val, i) SKM_sk_insert(KRB5_CHECKSUM, (st), (val), (i)) -# define sk_KRB5_CHECKSUM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_CHECKSUM, (st), (cmp)) -# define sk_KRB5_CHECKSUM_dup(st) SKM_sk_dup(KRB5_CHECKSUM, st) -# define sk_KRB5_CHECKSUM_pop_free(st, free_func) SKM_sk_pop_free(KRB5_CHECKSUM, (st), (free_func)) -# define sk_KRB5_CHECKSUM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_CHECKSUM, (st), (copy_func), (free_func)) -# define sk_KRB5_CHECKSUM_shift(st) SKM_sk_shift(KRB5_CHECKSUM, (st)) -# define sk_KRB5_CHECKSUM_pop(st) SKM_sk_pop(KRB5_CHECKSUM, (st)) -# define sk_KRB5_CHECKSUM_sort(st) SKM_sk_sort(KRB5_CHECKSUM, (st)) -# define sk_KRB5_CHECKSUM_is_sorted(st) SKM_sk_is_sorted(KRB5_CHECKSUM, (st)) -# define sk_KRB5_ENCDATA_new(cmp) SKM_sk_new(KRB5_ENCDATA, (cmp)) -# define sk_KRB5_ENCDATA_new_null() SKM_sk_new_null(KRB5_ENCDATA) -# define sk_KRB5_ENCDATA_free(st) SKM_sk_free(KRB5_ENCDATA, (st)) -# define sk_KRB5_ENCDATA_num(st) SKM_sk_num(KRB5_ENCDATA, (st)) -# define sk_KRB5_ENCDATA_value(st, i) SKM_sk_value(KRB5_ENCDATA, (st), (i)) -# define sk_KRB5_ENCDATA_set(st, i, val) SKM_sk_set(KRB5_ENCDATA, (st), (i), (val)) -# define sk_KRB5_ENCDATA_zero(st) SKM_sk_zero(KRB5_ENCDATA, (st)) -# define sk_KRB5_ENCDATA_push(st, val) SKM_sk_push(KRB5_ENCDATA, (st), (val)) -# define sk_KRB5_ENCDATA_unshift(st, val) SKM_sk_unshift(KRB5_ENCDATA, (st), (val)) -# define sk_KRB5_ENCDATA_find(st, val) SKM_sk_find(KRB5_ENCDATA, (st), (val)) -# define sk_KRB5_ENCDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCDATA, (st), (val)) -# define sk_KRB5_ENCDATA_delete(st, i) SKM_sk_delete(KRB5_ENCDATA, (st), (i)) -# define sk_KRB5_ENCDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCDATA, (st), (ptr)) -# define sk_KRB5_ENCDATA_insert(st, val, i) SKM_sk_insert(KRB5_ENCDATA, (st), (val), (i)) -# define sk_KRB5_ENCDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCDATA, (st), (cmp)) -# define sk_KRB5_ENCDATA_dup(st) SKM_sk_dup(KRB5_ENCDATA, st) -# define sk_KRB5_ENCDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCDATA, (st), (free_func)) -# define sk_KRB5_ENCDATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_ENCDATA, (st), (copy_func), (free_func)) -# define sk_KRB5_ENCDATA_shift(st) SKM_sk_shift(KRB5_ENCDATA, (st)) -# define sk_KRB5_ENCDATA_pop(st) SKM_sk_pop(KRB5_ENCDATA, (st)) -# define sk_KRB5_ENCDATA_sort(st) SKM_sk_sort(KRB5_ENCDATA, (st)) -# define sk_KRB5_ENCDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCDATA, (st)) -# define sk_KRB5_ENCKEY_new(cmp) SKM_sk_new(KRB5_ENCKEY, (cmp)) -# define sk_KRB5_ENCKEY_new_null() SKM_sk_new_null(KRB5_ENCKEY) -# define sk_KRB5_ENCKEY_free(st) SKM_sk_free(KRB5_ENCKEY, (st)) -# define sk_KRB5_ENCKEY_num(st) SKM_sk_num(KRB5_ENCKEY, (st)) -# define sk_KRB5_ENCKEY_value(st, i) SKM_sk_value(KRB5_ENCKEY, (st), (i)) -# define sk_KRB5_ENCKEY_set(st, i, val) SKM_sk_set(KRB5_ENCKEY, (st), (i), (val)) -# define sk_KRB5_ENCKEY_zero(st) SKM_sk_zero(KRB5_ENCKEY, (st)) -# define sk_KRB5_ENCKEY_push(st, val) SKM_sk_push(KRB5_ENCKEY, (st), (val)) -# define sk_KRB5_ENCKEY_unshift(st, val) SKM_sk_unshift(KRB5_ENCKEY, (st), (val)) -# define sk_KRB5_ENCKEY_find(st, val) SKM_sk_find(KRB5_ENCKEY, (st), (val)) -# define sk_KRB5_ENCKEY_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCKEY, (st), (val)) -# define sk_KRB5_ENCKEY_delete(st, i) SKM_sk_delete(KRB5_ENCKEY, (st), (i)) -# define sk_KRB5_ENCKEY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCKEY, (st), (ptr)) -# define sk_KRB5_ENCKEY_insert(st, val, i) SKM_sk_insert(KRB5_ENCKEY, (st), (val), (i)) -# define sk_KRB5_ENCKEY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCKEY, (st), (cmp)) -# define sk_KRB5_ENCKEY_dup(st) SKM_sk_dup(KRB5_ENCKEY, st) -# define sk_KRB5_ENCKEY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCKEY, (st), (free_func)) -# define sk_KRB5_ENCKEY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_ENCKEY, (st), (copy_func), (free_func)) -# define sk_KRB5_ENCKEY_shift(st) SKM_sk_shift(KRB5_ENCKEY, (st)) -# define sk_KRB5_ENCKEY_pop(st) SKM_sk_pop(KRB5_ENCKEY, (st)) -# define sk_KRB5_ENCKEY_sort(st) SKM_sk_sort(KRB5_ENCKEY, (st)) -# define sk_KRB5_ENCKEY_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCKEY, (st)) -# define sk_KRB5_PRINCNAME_new(cmp) SKM_sk_new(KRB5_PRINCNAME, (cmp)) -# define sk_KRB5_PRINCNAME_new_null() SKM_sk_new_null(KRB5_PRINCNAME) -# define sk_KRB5_PRINCNAME_free(st) SKM_sk_free(KRB5_PRINCNAME, (st)) -# define sk_KRB5_PRINCNAME_num(st) SKM_sk_num(KRB5_PRINCNAME, (st)) -# define sk_KRB5_PRINCNAME_value(st, i) SKM_sk_value(KRB5_PRINCNAME, (st), (i)) -# define sk_KRB5_PRINCNAME_set(st, i, val) SKM_sk_set(KRB5_PRINCNAME, (st), (i), (val)) -# define sk_KRB5_PRINCNAME_zero(st) SKM_sk_zero(KRB5_PRINCNAME, (st)) -# define sk_KRB5_PRINCNAME_push(st, val) SKM_sk_push(KRB5_PRINCNAME, (st), (val)) -# define sk_KRB5_PRINCNAME_unshift(st, val) SKM_sk_unshift(KRB5_PRINCNAME, (st), (val)) -# define sk_KRB5_PRINCNAME_find(st, val) SKM_sk_find(KRB5_PRINCNAME, (st), (val)) -# define sk_KRB5_PRINCNAME_find_ex(st, val) SKM_sk_find_ex(KRB5_PRINCNAME, (st), (val)) -# define sk_KRB5_PRINCNAME_delete(st, i) SKM_sk_delete(KRB5_PRINCNAME, (st), (i)) -# define sk_KRB5_PRINCNAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_PRINCNAME, (st), (ptr)) -# define sk_KRB5_PRINCNAME_insert(st, val, i) SKM_sk_insert(KRB5_PRINCNAME, (st), (val), (i)) -# define sk_KRB5_PRINCNAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_PRINCNAME, (st), (cmp)) -# define sk_KRB5_PRINCNAME_dup(st) SKM_sk_dup(KRB5_PRINCNAME, st) -# define sk_KRB5_PRINCNAME_pop_free(st, free_func) SKM_sk_pop_free(KRB5_PRINCNAME, (st), (free_func)) -# define sk_KRB5_PRINCNAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_PRINCNAME, (st), (copy_func), (free_func)) -# define sk_KRB5_PRINCNAME_shift(st) SKM_sk_shift(KRB5_PRINCNAME, (st)) -# define sk_KRB5_PRINCNAME_pop(st) SKM_sk_pop(KRB5_PRINCNAME, (st)) -# define sk_KRB5_PRINCNAME_sort(st) SKM_sk_sort(KRB5_PRINCNAME, (st)) -# define sk_KRB5_PRINCNAME_is_sorted(st) SKM_sk_is_sorted(KRB5_PRINCNAME, (st)) -# define sk_KRB5_TKTBODY_new(cmp) SKM_sk_new(KRB5_TKTBODY, (cmp)) -# define sk_KRB5_TKTBODY_new_null() SKM_sk_new_null(KRB5_TKTBODY) -# define sk_KRB5_TKTBODY_free(st) SKM_sk_free(KRB5_TKTBODY, (st)) -# define sk_KRB5_TKTBODY_num(st) SKM_sk_num(KRB5_TKTBODY, (st)) -# define sk_KRB5_TKTBODY_value(st, i) SKM_sk_value(KRB5_TKTBODY, (st), (i)) -# define sk_KRB5_TKTBODY_set(st, i, val) SKM_sk_set(KRB5_TKTBODY, (st), (i), (val)) -# define sk_KRB5_TKTBODY_zero(st) SKM_sk_zero(KRB5_TKTBODY, (st)) -# define sk_KRB5_TKTBODY_push(st, val) SKM_sk_push(KRB5_TKTBODY, (st), (val)) -# define sk_KRB5_TKTBODY_unshift(st, val) SKM_sk_unshift(KRB5_TKTBODY, (st), (val)) -# define sk_KRB5_TKTBODY_find(st, val) SKM_sk_find(KRB5_TKTBODY, (st), (val)) -# define sk_KRB5_TKTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_TKTBODY, (st), (val)) -# define sk_KRB5_TKTBODY_delete(st, i) SKM_sk_delete(KRB5_TKTBODY, (st), (i)) -# define sk_KRB5_TKTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_TKTBODY, (st), (ptr)) -# define sk_KRB5_TKTBODY_insert(st, val, i) SKM_sk_insert(KRB5_TKTBODY, (st), (val), (i)) -# define sk_KRB5_TKTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_TKTBODY, (st), (cmp)) -# define sk_KRB5_TKTBODY_dup(st) SKM_sk_dup(KRB5_TKTBODY, st) -# define sk_KRB5_TKTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_TKTBODY, (st), (free_func)) -# define sk_KRB5_TKTBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_TKTBODY, (st), (copy_func), (free_func)) -# define sk_KRB5_TKTBODY_shift(st) SKM_sk_shift(KRB5_TKTBODY, (st)) -# define sk_KRB5_TKTBODY_pop(st) SKM_sk_pop(KRB5_TKTBODY, (st)) -# define sk_KRB5_TKTBODY_sort(st) SKM_sk_sort(KRB5_TKTBODY, (st)) -# define sk_KRB5_TKTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_TKTBODY, (st)) -# define sk_MEM_OBJECT_DATA_new(cmp) SKM_sk_new(MEM_OBJECT_DATA, (cmp)) -# define sk_MEM_OBJECT_DATA_new_null() SKM_sk_new_null(MEM_OBJECT_DATA) -# define sk_MEM_OBJECT_DATA_free(st) SKM_sk_free(MEM_OBJECT_DATA, (st)) -# define sk_MEM_OBJECT_DATA_num(st) SKM_sk_num(MEM_OBJECT_DATA, (st)) -# define sk_MEM_OBJECT_DATA_value(st, i) SKM_sk_value(MEM_OBJECT_DATA, (st), (i)) -# define sk_MEM_OBJECT_DATA_set(st, i, val) SKM_sk_set(MEM_OBJECT_DATA, (st), (i), (val)) -# define sk_MEM_OBJECT_DATA_zero(st) SKM_sk_zero(MEM_OBJECT_DATA, (st)) -# define sk_MEM_OBJECT_DATA_push(st, val) SKM_sk_push(MEM_OBJECT_DATA, (st), (val)) -# define sk_MEM_OBJECT_DATA_unshift(st, val) SKM_sk_unshift(MEM_OBJECT_DATA, (st), (val)) -# define sk_MEM_OBJECT_DATA_find(st, val) SKM_sk_find(MEM_OBJECT_DATA, (st), (val)) -# define sk_MEM_OBJECT_DATA_find_ex(st, val) SKM_sk_find_ex(MEM_OBJECT_DATA, (st), (val)) -# define sk_MEM_OBJECT_DATA_delete(st, i) SKM_sk_delete(MEM_OBJECT_DATA, (st), (i)) -# define sk_MEM_OBJECT_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(MEM_OBJECT_DATA, (st), (ptr)) -# define sk_MEM_OBJECT_DATA_insert(st, val, i) SKM_sk_insert(MEM_OBJECT_DATA, (st), (val), (i)) -# define sk_MEM_OBJECT_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MEM_OBJECT_DATA, (st), (cmp)) -# define sk_MEM_OBJECT_DATA_dup(st) SKM_sk_dup(MEM_OBJECT_DATA, st) -# define sk_MEM_OBJECT_DATA_pop_free(st, free_func) SKM_sk_pop_free(MEM_OBJECT_DATA, (st), (free_func)) -# define sk_MEM_OBJECT_DATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MEM_OBJECT_DATA, (st), (copy_func), (free_func)) -# define sk_MEM_OBJECT_DATA_shift(st) SKM_sk_shift(MEM_OBJECT_DATA, (st)) -# define sk_MEM_OBJECT_DATA_pop(st) SKM_sk_pop(MEM_OBJECT_DATA, (st)) -# define sk_MEM_OBJECT_DATA_sort(st) SKM_sk_sort(MEM_OBJECT_DATA, (st)) -# define sk_MEM_OBJECT_DATA_is_sorted(st) SKM_sk_is_sorted(MEM_OBJECT_DATA, (st)) -# define sk_MIME_HEADER_new(cmp) SKM_sk_new(MIME_HEADER, (cmp)) -# define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER) -# define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st)) -# define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st)) -# define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i)) -# define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val)) -# define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st)) -# define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val)) -# define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val)) -# define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val)) -# define sk_MIME_HEADER_find_ex(st, val) SKM_sk_find_ex(MIME_HEADER, (st), (val)) -# define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i)) -# define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr)) -# define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i)) -# define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp)) -# define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st) -# define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func)) -# define sk_MIME_HEADER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MIME_HEADER, (st), (copy_func), (free_func)) -# define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st)) -# define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st)) -# define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st)) -# define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st)) -# define sk_MIME_PARAM_new(cmp) SKM_sk_new(MIME_PARAM, (cmp)) -# define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM) -# define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st)) -# define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st)) -# define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i)) -# define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val)) -# define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st)) -# define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val)) -# define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val)) -# define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val)) -# define sk_MIME_PARAM_find_ex(st, val) SKM_sk_find_ex(MIME_PARAM, (st), (val)) -# define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i)) -# define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr)) -# define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i)) -# define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp)) -# define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st) -# define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func)) -# define sk_MIME_PARAM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MIME_PARAM, (st), (copy_func), (free_func)) -# define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st)) -# define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st)) -# define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st)) -# define sk_MIME_PARAM_is_sorted(st) SKM_sk_is_sorted(MIME_PARAM, (st)) -# define sk_NAME_FUNCS_new(cmp) SKM_sk_new(NAME_FUNCS, (cmp)) -# define sk_NAME_FUNCS_new_null() SKM_sk_new_null(NAME_FUNCS) -# define sk_NAME_FUNCS_free(st) SKM_sk_free(NAME_FUNCS, (st)) -# define sk_NAME_FUNCS_num(st) SKM_sk_num(NAME_FUNCS, (st)) -# define sk_NAME_FUNCS_value(st, i) SKM_sk_value(NAME_FUNCS, (st), (i)) -# define sk_NAME_FUNCS_set(st, i, val) SKM_sk_set(NAME_FUNCS, (st), (i), (val)) -# define sk_NAME_FUNCS_zero(st) SKM_sk_zero(NAME_FUNCS, (st)) -# define sk_NAME_FUNCS_push(st, val) SKM_sk_push(NAME_FUNCS, (st), (val)) -# define sk_NAME_FUNCS_unshift(st, val) SKM_sk_unshift(NAME_FUNCS, (st), (val)) -# define sk_NAME_FUNCS_find(st, val) SKM_sk_find(NAME_FUNCS, (st), (val)) -# define sk_NAME_FUNCS_find_ex(st, val) SKM_sk_find_ex(NAME_FUNCS, (st), (val)) -# define sk_NAME_FUNCS_delete(st, i) SKM_sk_delete(NAME_FUNCS, (st), (i)) -# define sk_NAME_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(NAME_FUNCS, (st), (ptr)) -# define sk_NAME_FUNCS_insert(st, val, i) SKM_sk_insert(NAME_FUNCS, (st), (val), (i)) -# define sk_NAME_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(NAME_FUNCS, (st), (cmp)) -# define sk_NAME_FUNCS_dup(st) SKM_sk_dup(NAME_FUNCS, st) -# define sk_NAME_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(NAME_FUNCS, (st), (free_func)) -# define sk_NAME_FUNCS_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(NAME_FUNCS, (st), (copy_func), (free_func)) -# define sk_NAME_FUNCS_shift(st) SKM_sk_shift(NAME_FUNCS, (st)) -# define sk_NAME_FUNCS_pop(st) SKM_sk_pop(NAME_FUNCS, (st)) -# define sk_NAME_FUNCS_sort(st) SKM_sk_sort(NAME_FUNCS, (st)) -# define sk_NAME_FUNCS_is_sorted(st) SKM_sk_is_sorted(NAME_FUNCS, (st)) -# define sk_OCSP_CERTID_new(cmp) SKM_sk_new(OCSP_CERTID, (cmp)) -# define sk_OCSP_CERTID_new_null() SKM_sk_new_null(OCSP_CERTID) -# define sk_OCSP_CERTID_free(st) SKM_sk_free(OCSP_CERTID, (st)) -# define sk_OCSP_CERTID_num(st) SKM_sk_num(OCSP_CERTID, (st)) -# define sk_OCSP_CERTID_value(st, i) SKM_sk_value(OCSP_CERTID, (st), (i)) -# define sk_OCSP_CERTID_set(st, i, val) SKM_sk_set(OCSP_CERTID, (st), (i), (val)) -# define sk_OCSP_CERTID_zero(st) SKM_sk_zero(OCSP_CERTID, (st)) -# define sk_OCSP_CERTID_push(st, val) SKM_sk_push(OCSP_CERTID, (st), (val)) -# define sk_OCSP_CERTID_unshift(st, val) SKM_sk_unshift(OCSP_CERTID, (st), (val)) -# define sk_OCSP_CERTID_find(st, val) SKM_sk_find(OCSP_CERTID, (st), (val)) -# define sk_OCSP_CERTID_find_ex(st, val) SKM_sk_find_ex(OCSP_CERTID, (st), (val)) -# define sk_OCSP_CERTID_delete(st, i) SKM_sk_delete(OCSP_CERTID, (st), (i)) -# define sk_OCSP_CERTID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_CERTID, (st), (ptr)) -# define sk_OCSP_CERTID_insert(st, val, i) SKM_sk_insert(OCSP_CERTID, (st), (val), (i)) -# define sk_OCSP_CERTID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_CERTID, (st), (cmp)) -# define sk_OCSP_CERTID_dup(st) SKM_sk_dup(OCSP_CERTID, st) -# define sk_OCSP_CERTID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_CERTID, (st), (free_func)) -# define sk_OCSP_CERTID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_CERTID, (st), (copy_func), (free_func)) -# define sk_OCSP_CERTID_shift(st) SKM_sk_shift(OCSP_CERTID, (st)) -# define sk_OCSP_CERTID_pop(st) SKM_sk_pop(OCSP_CERTID, (st)) -# define sk_OCSP_CERTID_sort(st) SKM_sk_sort(OCSP_CERTID, (st)) -# define sk_OCSP_CERTID_is_sorted(st) SKM_sk_is_sorted(OCSP_CERTID, (st)) -# define sk_OCSP_ONEREQ_new(cmp) SKM_sk_new(OCSP_ONEREQ, (cmp)) -# define sk_OCSP_ONEREQ_new_null() SKM_sk_new_null(OCSP_ONEREQ) -# define sk_OCSP_ONEREQ_free(st) SKM_sk_free(OCSP_ONEREQ, (st)) -# define sk_OCSP_ONEREQ_num(st) SKM_sk_num(OCSP_ONEREQ, (st)) -# define sk_OCSP_ONEREQ_value(st, i) SKM_sk_value(OCSP_ONEREQ, (st), (i)) -# define sk_OCSP_ONEREQ_set(st, i, val) SKM_sk_set(OCSP_ONEREQ, (st), (i), (val)) -# define sk_OCSP_ONEREQ_zero(st) SKM_sk_zero(OCSP_ONEREQ, (st)) -# define sk_OCSP_ONEREQ_push(st, val) SKM_sk_push(OCSP_ONEREQ, (st), (val)) -# define sk_OCSP_ONEREQ_unshift(st, val) SKM_sk_unshift(OCSP_ONEREQ, (st), (val)) -# define sk_OCSP_ONEREQ_find(st, val) SKM_sk_find(OCSP_ONEREQ, (st), (val)) -# define sk_OCSP_ONEREQ_find_ex(st, val) SKM_sk_find_ex(OCSP_ONEREQ, (st), (val)) -# define sk_OCSP_ONEREQ_delete(st, i) SKM_sk_delete(OCSP_ONEREQ, (st), (i)) -# define sk_OCSP_ONEREQ_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_ONEREQ, (st), (ptr)) -# define sk_OCSP_ONEREQ_insert(st, val, i) SKM_sk_insert(OCSP_ONEREQ, (st), (val), (i)) -# define sk_OCSP_ONEREQ_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_ONEREQ, (st), (cmp)) -# define sk_OCSP_ONEREQ_dup(st) SKM_sk_dup(OCSP_ONEREQ, st) -# define sk_OCSP_ONEREQ_pop_free(st, free_func) SKM_sk_pop_free(OCSP_ONEREQ, (st), (free_func)) -# define sk_OCSP_ONEREQ_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_ONEREQ, (st), (copy_func), (free_func)) -# define sk_OCSP_ONEREQ_shift(st) SKM_sk_shift(OCSP_ONEREQ, (st)) -# define sk_OCSP_ONEREQ_pop(st) SKM_sk_pop(OCSP_ONEREQ, (st)) -# define sk_OCSP_ONEREQ_sort(st) SKM_sk_sort(OCSP_ONEREQ, (st)) -# define sk_OCSP_ONEREQ_is_sorted(st) SKM_sk_is_sorted(OCSP_ONEREQ, (st)) -# define sk_OCSP_RESPID_new(cmp) SKM_sk_new(OCSP_RESPID, (cmp)) -# define sk_OCSP_RESPID_new_null() SKM_sk_new_null(OCSP_RESPID) -# define sk_OCSP_RESPID_free(st) SKM_sk_free(OCSP_RESPID, (st)) -# define sk_OCSP_RESPID_num(st) SKM_sk_num(OCSP_RESPID, (st)) -# define sk_OCSP_RESPID_value(st, i) SKM_sk_value(OCSP_RESPID, (st), (i)) -# define sk_OCSP_RESPID_set(st, i, val) SKM_sk_set(OCSP_RESPID, (st), (i), (val)) -# define sk_OCSP_RESPID_zero(st) SKM_sk_zero(OCSP_RESPID, (st)) -# define sk_OCSP_RESPID_push(st, val) SKM_sk_push(OCSP_RESPID, (st), (val)) -# define sk_OCSP_RESPID_unshift(st, val) SKM_sk_unshift(OCSP_RESPID, (st), (val)) -# define sk_OCSP_RESPID_find(st, val) SKM_sk_find(OCSP_RESPID, (st), (val)) -# define sk_OCSP_RESPID_find_ex(st, val) SKM_sk_find_ex(OCSP_RESPID, (st), (val)) -# define sk_OCSP_RESPID_delete(st, i) SKM_sk_delete(OCSP_RESPID, (st), (i)) -# define sk_OCSP_RESPID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_RESPID, (st), (ptr)) -# define sk_OCSP_RESPID_insert(st, val, i) SKM_sk_insert(OCSP_RESPID, (st), (val), (i)) -# define sk_OCSP_RESPID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_RESPID, (st), (cmp)) -# define sk_OCSP_RESPID_dup(st) SKM_sk_dup(OCSP_RESPID, st) -# define sk_OCSP_RESPID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_RESPID, (st), (free_func)) -# define sk_OCSP_RESPID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_RESPID, (st), (copy_func), (free_func)) -# define sk_OCSP_RESPID_shift(st) SKM_sk_shift(OCSP_RESPID, (st)) -# define sk_OCSP_RESPID_pop(st) SKM_sk_pop(OCSP_RESPID, (st)) -# define sk_OCSP_RESPID_sort(st) SKM_sk_sort(OCSP_RESPID, (st)) -# define sk_OCSP_RESPID_is_sorted(st) SKM_sk_is_sorted(OCSP_RESPID, (st)) -# define sk_OCSP_SINGLERESP_new(cmp) SKM_sk_new(OCSP_SINGLERESP, (cmp)) -# define sk_OCSP_SINGLERESP_new_null() SKM_sk_new_null(OCSP_SINGLERESP) -# define sk_OCSP_SINGLERESP_free(st) SKM_sk_free(OCSP_SINGLERESP, (st)) -# define sk_OCSP_SINGLERESP_num(st) SKM_sk_num(OCSP_SINGLERESP, (st)) -# define sk_OCSP_SINGLERESP_value(st, i) SKM_sk_value(OCSP_SINGLERESP, (st), (i)) -# define sk_OCSP_SINGLERESP_set(st, i, val) SKM_sk_set(OCSP_SINGLERESP, (st), (i), (val)) -# define sk_OCSP_SINGLERESP_zero(st) SKM_sk_zero(OCSP_SINGLERESP, (st)) -# define sk_OCSP_SINGLERESP_push(st, val) SKM_sk_push(OCSP_SINGLERESP, (st), (val)) -# define sk_OCSP_SINGLERESP_unshift(st, val) SKM_sk_unshift(OCSP_SINGLERESP, (st), (val)) -# define sk_OCSP_SINGLERESP_find(st, val) SKM_sk_find(OCSP_SINGLERESP, (st), (val)) -# define sk_OCSP_SINGLERESP_find_ex(st, val) SKM_sk_find_ex(OCSP_SINGLERESP, (st), (val)) -# define sk_OCSP_SINGLERESP_delete(st, i) SKM_sk_delete(OCSP_SINGLERESP, (st), (i)) -# define sk_OCSP_SINGLERESP_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_SINGLERESP, (st), (ptr)) -# define sk_OCSP_SINGLERESP_insert(st, val, i) SKM_sk_insert(OCSP_SINGLERESP, (st), (val), (i)) -# define sk_OCSP_SINGLERESP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_SINGLERESP, (st), (cmp)) -# define sk_OCSP_SINGLERESP_dup(st) SKM_sk_dup(OCSP_SINGLERESP, st) -# define sk_OCSP_SINGLERESP_pop_free(st, free_func) SKM_sk_pop_free(OCSP_SINGLERESP, (st), (free_func)) -# define sk_OCSP_SINGLERESP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_SINGLERESP, (st), (copy_func), (free_func)) -# define sk_OCSP_SINGLERESP_shift(st) SKM_sk_shift(OCSP_SINGLERESP, (st)) -# define sk_OCSP_SINGLERESP_pop(st) SKM_sk_pop(OCSP_SINGLERESP, (st)) -# define sk_OCSP_SINGLERESP_sort(st) SKM_sk_sort(OCSP_SINGLERESP, (st)) -# define sk_OCSP_SINGLERESP_is_sorted(st) SKM_sk_is_sorted(OCSP_SINGLERESP, (st)) -# define sk_PKCS12_SAFEBAG_new(cmp) SKM_sk_new(PKCS12_SAFEBAG, (cmp)) -# define sk_PKCS12_SAFEBAG_new_null() SKM_sk_new_null(PKCS12_SAFEBAG) -# define sk_PKCS12_SAFEBAG_free(st) SKM_sk_free(PKCS12_SAFEBAG, (st)) -# define sk_PKCS12_SAFEBAG_num(st) SKM_sk_num(PKCS12_SAFEBAG, (st)) -# define sk_PKCS12_SAFEBAG_value(st, i) SKM_sk_value(PKCS12_SAFEBAG, (st), (i)) -# define sk_PKCS12_SAFEBAG_set(st, i, val) SKM_sk_set(PKCS12_SAFEBAG, (st), (i), (val)) -# define sk_PKCS12_SAFEBAG_zero(st) SKM_sk_zero(PKCS12_SAFEBAG, (st)) -# define sk_PKCS12_SAFEBAG_push(st, val) SKM_sk_push(PKCS12_SAFEBAG, (st), (val)) -# define sk_PKCS12_SAFEBAG_unshift(st, val) SKM_sk_unshift(PKCS12_SAFEBAG, (st), (val)) -# define sk_PKCS12_SAFEBAG_find(st, val) SKM_sk_find(PKCS12_SAFEBAG, (st), (val)) -# define sk_PKCS12_SAFEBAG_find_ex(st, val) SKM_sk_find_ex(PKCS12_SAFEBAG, (st), (val)) -# define sk_PKCS12_SAFEBAG_delete(st, i) SKM_sk_delete(PKCS12_SAFEBAG, (st), (i)) -# define sk_PKCS12_SAFEBAG_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS12_SAFEBAG, (st), (ptr)) -# define sk_PKCS12_SAFEBAG_insert(st, val, i) SKM_sk_insert(PKCS12_SAFEBAG, (st), (val), (i)) -# define sk_PKCS12_SAFEBAG_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS12_SAFEBAG, (st), (cmp)) -# define sk_PKCS12_SAFEBAG_dup(st) SKM_sk_dup(PKCS12_SAFEBAG, st) -# define sk_PKCS12_SAFEBAG_pop_free(st, free_func) SKM_sk_pop_free(PKCS12_SAFEBAG, (st), (free_func)) -# define sk_PKCS12_SAFEBAG_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS12_SAFEBAG, (st), (copy_func), (free_func)) -# define sk_PKCS12_SAFEBAG_shift(st) SKM_sk_shift(PKCS12_SAFEBAG, (st)) -# define sk_PKCS12_SAFEBAG_pop(st) SKM_sk_pop(PKCS12_SAFEBAG, (st)) -# define sk_PKCS12_SAFEBAG_sort(st) SKM_sk_sort(PKCS12_SAFEBAG, (st)) -# define sk_PKCS12_SAFEBAG_is_sorted(st) SKM_sk_is_sorted(PKCS12_SAFEBAG, (st)) -# define sk_PKCS7_new(cmp) SKM_sk_new(PKCS7, (cmp)) -# define sk_PKCS7_new_null() SKM_sk_new_null(PKCS7) -# define sk_PKCS7_free(st) SKM_sk_free(PKCS7, (st)) -# define sk_PKCS7_num(st) SKM_sk_num(PKCS7, (st)) -# define sk_PKCS7_value(st, i) SKM_sk_value(PKCS7, (st), (i)) -# define sk_PKCS7_set(st, i, val) SKM_sk_set(PKCS7, (st), (i), (val)) -# define sk_PKCS7_zero(st) SKM_sk_zero(PKCS7, (st)) -# define sk_PKCS7_push(st, val) SKM_sk_push(PKCS7, (st), (val)) -# define sk_PKCS7_unshift(st, val) SKM_sk_unshift(PKCS7, (st), (val)) -# define sk_PKCS7_find(st, val) SKM_sk_find(PKCS7, (st), (val)) -# define sk_PKCS7_find_ex(st, val) SKM_sk_find_ex(PKCS7, (st), (val)) -# define sk_PKCS7_delete(st, i) SKM_sk_delete(PKCS7, (st), (i)) -# define sk_PKCS7_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7, (st), (ptr)) -# define sk_PKCS7_insert(st, val, i) SKM_sk_insert(PKCS7, (st), (val), (i)) -# define sk_PKCS7_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7, (st), (cmp)) -# define sk_PKCS7_dup(st) SKM_sk_dup(PKCS7, st) -# define sk_PKCS7_pop_free(st, free_func) SKM_sk_pop_free(PKCS7, (st), (free_func)) -# define sk_PKCS7_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7, (st), (copy_func), (free_func)) -# define sk_PKCS7_shift(st) SKM_sk_shift(PKCS7, (st)) -# define sk_PKCS7_pop(st) SKM_sk_pop(PKCS7, (st)) -# define sk_PKCS7_sort(st) SKM_sk_sort(PKCS7, (st)) -# define sk_PKCS7_is_sorted(st) SKM_sk_is_sorted(PKCS7, (st)) -# define sk_PKCS7_RECIP_INFO_new(cmp) SKM_sk_new(PKCS7_RECIP_INFO, (cmp)) -# define sk_PKCS7_RECIP_INFO_new_null() SKM_sk_new_null(PKCS7_RECIP_INFO) -# define sk_PKCS7_RECIP_INFO_free(st) SKM_sk_free(PKCS7_RECIP_INFO, (st)) -# define sk_PKCS7_RECIP_INFO_num(st) SKM_sk_num(PKCS7_RECIP_INFO, (st)) -# define sk_PKCS7_RECIP_INFO_value(st, i) SKM_sk_value(PKCS7_RECIP_INFO, (st), (i)) -# define sk_PKCS7_RECIP_INFO_set(st, i, val) SKM_sk_set(PKCS7_RECIP_INFO, (st), (i), (val)) -# define sk_PKCS7_RECIP_INFO_zero(st) SKM_sk_zero(PKCS7_RECIP_INFO, (st)) -# define sk_PKCS7_RECIP_INFO_push(st, val) SKM_sk_push(PKCS7_RECIP_INFO, (st), (val)) -# define sk_PKCS7_RECIP_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_RECIP_INFO, (st), (val)) -# define sk_PKCS7_RECIP_INFO_find(st, val) SKM_sk_find(PKCS7_RECIP_INFO, (st), (val)) -# define sk_PKCS7_RECIP_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_RECIP_INFO, (st), (val)) -# define sk_PKCS7_RECIP_INFO_delete(st, i) SKM_sk_delete(PKCS7_RECIP_INFO, (st), (i)) -# define sk_PKCS7_RECIP_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_RECIP_INFO, (st), (ptr)) -# define sk_PKCS7_RECIP_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_RECIP_INFO, (st), (val), (i)) -# define sk_PKCS7_RECIP_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_RECIP_INFO, (st), (cmp)) -# define sk_PKCS7_RECIP_INFO_dup(st) SKM_sk_dup(PKCS7_RECIP_INFO, st) -# define sk_PKCS7_RECIP_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_RECIP_INFO, (st), (free_func)) -# define sk_PKCS7_RECIP_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7_RECIP_INFO, (st), (copy_func), (free_func)) -# define sk_PKCS7_RECIP_INFO_shift(st) SKM_sk_shift(PKCS7_RECIP_INFO, (st)) -# define sk_PKCS7_RECIP_INFO_pop(st) SKM_sk_pop(PKCS7_RECIP_INFO, (st)) -# define sk_PKCS7_RECIP_INFO_sort(st) SKM_sk_sort(PKCS7_RECIP_INFO, (st)) -# define sk_PKCS7_RECIP_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_RECIP_INFO, (st)) -# define sk_PKCS7_SIGNER_INFO_new(cmp) SKM_sk_new(PKCS7_SIGNER_INFO, (cmp)) -# define sk_PKCS7_SIGNER_INFO_new_null() SKM_sk_new_null(PKCS7_SIGNER_INFO) -# define sk_PKCS7_SIGNER_INFO_free(st) SKM_sk_free(PKCS7_SIGNER_INFO, (st)) -# define sk_PKCS7_SIGNER_INFO_num(st) SKM_sk_num(PKCS7_SIGNER_INFO, (st)) -# define sk_PKCS7_SIGNER_INFO_value(st, i) SKM_sk_value(PKCS7_SIGNER_INFO, (st), (i)) -# define sk_PKCS7_SIGNER_INFO_set(st, i, val) SKM_sk_set(PKCS7_SIGNER_INFO, (st), (i), (val)) -# define sk_PKCS7_SIGNER_INFO_zero(st) SKM_sk_zero(PKCS7_SIGNER_INFO, (st)) -# define sk_PKCS7_SIGNER_INFO_push(st, val) SKM_sk_push(PKCS7_SIGNER_INFO, (st), (val)) -# define sk_PKCS7_SIGNER_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_SIGNER_INFO, (st), (val)) -# define sk_PKCS7_SIGNER_INFO_find(st, val) SKM_sk_find(PKCS7_SIGNER_INFO, (st), (val)) -# define sk_PKCS7_SIGNER_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_SIGNER_INFO, (st), (val)) -# define sk_PKCS7_SIGNER_INFO_delete(st, i) SKM_sk_delete(PKCS7_SIGNER_INFO, (st), (i)) -# define sk_PKCS7_SIGNER_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_SIGNER_INFO, (st), (ptr)) -# define sk_PKCS7_SIGNER_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_SIGNER_INFO, (st), (val), (i)) -# define sk_PKCS7_SIGNER_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_SIGNER_INFO, (st), (cmp)) -# define sk_PKCS7_SIGNER_INFO_dup(st) SKM_sk_dup(PKCS7_SIGNER_INFO, st) -# define sk_PKCS7_SIGNER_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_SIGNER_INFO, (st), (free_func)) -# define sk_PKCS7_SIGNER_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7_SIGNER_INFO, (st), (copy_func), (free_func)) -# define sk_PKCS7_SIGNER_INFO_shift(st) SKM_sk_shift(PKCS7_SIGNER_INFO, (st)) -# define sk_PKCS7_SIGNER_INFO_pop(st) SKM_sk_pop(PKCS7_SIGNER_INFO, (st)) -# define sk_PKCS7_SIGNER_INFO_sort(st) SKM_sk_sort(PKCS7_SIGNER_INFO, (st)) -# define sk_PKCS7_SIGNER_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_SIGNER_INFO, (st)) -# define sk_POLICYINFO_new(cmp) SKM_sk_new(POLICYINFO, (cmp)) -# define sk_POLICYINFO_new_null() SKM_sk_new_null(POLICYINFO) -# define sk_POLICYINFO_free(st) SKM_sk_free(POLICYINFO, (st)) -# define sk_POLICYINFO_num(st) SKM_sk_num(POLICYINFO, (st)) -# define sk_POLICYINFO_value(st, i) SKM_sk_value(POLICYINFO, (st), (i)) -# define sk_POLICYINFO_set(st, i, val) SKM_sk_set(POLICYINFO, (st), (i), (val)) -# define sk_POLICYINFO_zero(st) SKM_sk_zero(POLICYINFO, (st)) -# define sk_POLICYINFO_push(st, val) SKM_sk_push(POLICYINFO, (st), (val)) -# define sk_POLICYINFO_unshift(st, val) SKM_sk_unshift(POLICYINFO, (st), (val)) -# define sk_POLICYINFO_find(st, val) SKM_sk_find(POLICYINFO, (st), (val)) -# define sk_POLICYINFO_find_ex(st, val) SKM_sk_find_ex(POLICYINFO, (st), (val)) -# define sk_POLICYINFO_delete(st, i) SKM_sk_delete(POLICYINFO, (st), (i)) -# define sk_POLICYINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYINFO, (st), (ptr)) -# define sk_POLICYINFO_insert(st, val, i) SKM_sk_insert(POLICYINFO, (st), (val), (i)) -# define sk_POLICYINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYINFO, (st), (cmp)) -# define sk_POLICYINFO_dup(st) SKM_sk_dup(POLICYINFO, st) -# define sk_POLICYINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYINFO, (st), (free_func)) -# define sk_POLICYINFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICYINFO, (st), (copy_func), (free_func)) -# define sk_POLICYINFO_shift(st) SKM_sk_shift(POLICYINFO, (st)) -# define sk_POLICYINFO_pop(st) SKM_sk_pop(POLICYINFO, (st)) -# define sk_POLICYINFO_sort(st) SKM_sk_sort(POLICYINFO, (st)) -# define sk_POLICYINFO_is_sorted(st) SKM_sk_is_sorted(POLICYINFO, (st)) -# define sk_POLICYQUALINFO_new(cmp) SKM_sk_new(POLICYQUALINFO, (cmp)) -# define sk_POLICYQUALINFO_new_null() SKM_sk_new_null(POLICYQUALINFO) -# define sk_POLICYQUALINFO_free(st) SKM_sk_free(POLICYQUALINFO, (st)) -# define sk_POLICYQUALINFO_num(st) SKM_sk_num(POLICYQUALINFO, (st)) -# define sk_POLICYQUALINFO_value(st, i) SKM_sk_value(POLICYQUALINFO, (st), (i)) -# define sk_POLICYQUALINFO_set(st, i, val) SKM_sk_set(POLICYQUALINFO, (st), (i), (val)) -# define sk_POLICYQUALINFO_zero(st) SKM_sk_zero(POLICYQUALINFO, (st)) -# define sk_POLICYQUALINFO_push(st, val) SKM_sk_push(POLICYQUALINFO, (st), (val)) -# define sk_POLICYQUALINFO_unshift(st, val) SKM_sk_unshift(POLICYQUALINFO, (st), (val)) -# define sk_POLICYQUALINFO_find(st, val) SKM_sk_find(POLICYQUALINFO, (st), (val)) -# define sk_POLICYQUALINFO_find_ex(st, val) SKM_sk_find_ex(POLICYQUALINFO, (st), (val)) -# define sk_POLICYQUALINFO_delete(st, i) SKM_sk_delete(POLICYQUALINFO, (st), (i)) -# define sk_POLICYQUALINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYQUALINFO, (st), (ptr)) -# define sk_POLICYQUALINFO_insert(st, val, i) SKM_sk_insert(POLICYQUALINFO, (st), (val), (i)) -# define sk_POLICYQUALINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYQUALINFO, (st), (cmp)) -# define sk_POLICYQUALINFO_dup(st) SKM_sk_dup(POLICYQUALINFO, st) -# define sk_POLICYQUALINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYQUALINFO, (st), (free_func)) -# define sk_POLICYQUALINFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICYQUALINFO, (st), (copy_func), (free_func)) -# define sk_POLICYQUALINFO_shift(st) SKM_sk_shift(POLICYQUALINFO, (st)) -# define sk_POLICYQUALINFO_pop(st) SKM_sk_pop(POLICYQUALINFO, (st)) -# define sk_POLICYQUALINFO_sort(st) SKM_sk_sort(POLICYQUALINFO, (st)) -# define sk_POLICYQUALINFO_is_sorted(st) SKM_sk_is_sorted(POLICYQUALINFO, (st)) -# define sk_POLICY_MAPPING_new(cmp) SKM_sk_new(POLICY_MAPPING, (cmp)) -# define sk_POLICY_MAPPING_new_null() SKM_sk_new_null(POLICY_MAPPING) -# define sk_POLICY_MAPPING_free(st) SKM_sk_free(POLICY_MAPPING, (st)) -# define sk_POLICY_MAPPING_num(st) SKM_sk_num(POLICY_MAPPING, (st)) -# define sk_POLICY_MAPPING_value(st, i) SKM_sk_value(POLICY_MAPPING, (st), (i)) -# define sk_POLICY_MAPPING_set(st, i, val) SKM_sk_set(POLICY_MAPPING, (st), (i), (val)) -# define sk_POLICY_MAPPING_zero(st) SKM_sk_zero(POLICY_MAPPING, (st)) -# define sk_POLICY_MAPPING_push(st, val) SKM_sk_push(POLICY_MAPPING, (st), (val)) -# define sk_POLICY_MAPPING_unshift(st, val) SKM_sk_unshift(POLICY_MAPPING, (st), (val)) -# define sk_POLICY_MAPPING_find(st, val) SKM_sk_find(POLICY_MAPPING, (st), (val)) -# define sk_POLICY_MAPPING_find_ex(st, val) SKM_sk_find_ex(POLICY_MAPPING, (st), (val)) -# define sk_POLICY_MAPPING_delete(st, i) SKM_sk_delete(POLICY_MAPPING, (st), (i)) -# define sk_POLICY_MAPPING_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICY_MAPPING, (st), (ptr)) -# define sk_POLICY_MAPPING_insert(st, val, i) SKM_sk_insert(POLICY_MAPPING, (st), (val), (i)) -# define sk_POLICY_MAPPING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICY_MAPPING, (st), (cmp)) -# define sk_POLICY_MAPPING_dup(st) SKM_sk_dup(POLICY_MAPPING, st) -# define sk_POLICY_MAPPING_pop_free(st, free_func) SKM_sk_pop_free(POLICY_MAPPING, (st), (free_func)) -# define sk_POLICY_MAPPING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICY_MAPPING, (st), (copy_func), (free_func)) -# define sk_POLICY_MAPPING_shift(st) SKM_sk_shift(POLICY_MAPPING, (st)) -# define sk_POLICY_MAPPING_pop(st) SKM_sk_pop(POLICY_MAPPING, (st)) -# define sk_POLICY_MAPPING_sort(st) SKM_sk_sort(POLICY_MAPPING, (st)) -# define sk_POLICY_MAPPING_is_sorted(st) SKM_sk_is_sorted(POLICY_MAPPING, (st)) -# define sk_SCT_new(cmp) SKM_sk_new(SCT, (cmp)) -# define sk_SCT_new_null() SKM_sk_new_null(SCT) -# define sk_SCT_free(st) SKM_sk_free(SCT, (st)) -# define sk_SCT_num(st) SKM_sk_num(SCT, (st)) -# define sk_SCT_value(st, i) SKM_sk_value(SCT, (st), (i)) -# define sk_SCT_set(st, i, val) SKM_sk_set(SCT, (st), (i), (val)) -# define sk_SCT_zero(st) SKM_sk_zero(SCT, (st)) -# define sk_SCT_push(st, val) SKM_sk_push(SCT, (st), (val)) -# define sk_SCT_unshift(st, val) SKM_sk_unshift(SCT, (st), (val)) -# define sk_SCT_find(st, val) SKM_sk_find(SCT, (st), (val)) -# define sk_SCT_find_ex(st, val) SKM_sk_find_ex(SCT, (st), (val)) -# define sk_SCT_delete(st, i) SKM_sk_delete(SCT, (st), (i)) -# define sk_SCT_delete_ptr(st, ptr) SKM_sk_delete_ptr(SCT, (st), (ptr)) -# define sk_SCT_insert(st, val, i) SKM_sk_insert(SCT, (st), (val), (i)) -# define sk_SCT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SCT, (st), (cmp)) -# define sk_SCT_dup(st) SKM_sk_dup(SCT, st) -# define sk_SCT_pop_free(st, free_func) SKM_sk_pop_free(SCT, (st), (free_func)) -# define sk_SCT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SCT, (st), (copy_func), (free_func)) -# define sk_SCT_shift(st) SKM_sk_shift(SCT, (st)) -# define sk_SCT_pop(st) SKM_sk_pop(SCT, (st)) -# define sk_SCT_sort(st) SKM_sk_sort(SCT, (st)) -# define sk_SCT_is_sorted(st) SKM_sk_is_sorted(SCT, (st)) -# define sk_SRP_gN_new(cmp) SKM_sk_new(SRP_gN, (cmp)) -# define sk_SRP_gN_new_null() SKM_sk_new_null(SRP_gN) -# define sk_SRP_gN_free(st) SKM_sk_free(SRP_gN, (st)) -# define sk_SRP_gN_num(st) SKM_sk_num(SRP_gN, (st)) -# define sk_SRP_gN_value(st, i) SKM_sk_value(SRP_gN, (st), (i)) -# define sk_SRP_gN_set(st, i, val) SKM_sk_set(SRP_gN, (st), (i), (val)) -# define sk_SRP_gN_zero(st) SKM_sk_zero(SRP_gN, (st)) -# define sk_SRP_gN_push(st, val) SKM_sk_push(SRP_gN, (st), (val)) -# define sk_SRP_gN_unshift(st, val) SKM_sk_unshift(SRP_gN, (st), (val)) -# define sk_SRP_gN_find(st, val) SKM_sk_find(SRP_gN, (st), (val)) -# define sk_SRP_gN_find_ex(st, val) SKM_sk_find_ex(SRP_gN, (st), (val)) -# define sk_SRP_gN_delete(st, i) SKM_sk_delete(SRP_gN, (st), (i)) -# define sk_SRP_gN_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN, (st), (ptr)) -# define sk_SRP_gN_insert(st, val, i) SKM_sk_insert(SRP_gN, (st), (val), (i)) -# define sk_SRP_gN_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN, (st), (cmp)) -# define sk_SRP_gN_dup(st) SKM_sk_dup(SRP_gN, st) -# define sk_SRP_gN_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN, (st), (free_func)) -# define sk_SRP_gN_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_gN, (st), (copy_func), (free_func)) -# define sk_SRP_gN_shift(st) SKM_sk_shift(SRP_gN, (st)) -# define sk_SRP_gN_pop(st) SKM_sk_pop(SRP_gN, (st)) -# define sk_SRP_gN_sort(st) SKM_sk_sort(SRP_gN, (st)) -# define sk_SRP_gN_is_sorted(st) SKM_sk_is_sorted(SRP_gN, (st)) -# define sk_SRP_gN_cache_new(cmp) SKM_sk_new(SRP_gN_cache, (cmp)) -# define sk_SRP_gN_cache_new_null() SKM_sk_new_null(SRP_gN_cache) -# define sk_SRP_gN_cache_free(st) SKM_sk_free(SRP_gN_cache, (st)) -# define sk_SRP_gN_cache_num(st) SKM_sk_num(SRP_gN_cache, (st)) -# define sk_SRP_gN_cache_value(st, i) SKM_sk_value(SRP_gN_cache, (st), (i)) -# define sk_SRP_gN_cache_set(st, i, val) SKM_sk_set(SRP_gN_cache, (st), (i), (val)) -# define sk_SRP_gN_cache_zero(st) SKM_sk_zero(SRP_gN_cache, (st)) -# define sk_SRP_gN_cache_push(st, val) SKM_sk_push(SRP_gN_cache, (st), (val)) -# define sk_SRP_gN_cache_unshift(st, val) SKM_sk_unshift(SRP_gN_cache, (st), (val)) -# define sk_SRP_gN_cache_find(st, val) SKM_sk_find(SRP_gN_cache, (st), (val)) -# define sk_SRP_gN_cache_find_ex(st, val) SKM_sk_find_ex(SRP_gN_cache, (st), (val)) -# define sk_SRP_gN_cache_delete(st, i) SKM_sk_delete(SRP_gN_cache, (st), (i)) -# define sk_SRP_gN_cache_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN_cache, (st), (ptr)) -# define sk_SRP_gN_cache_insert(st, val, i) SKM_sk_insert(SRP_gN_cache, (st), (val), (i)) -# define sk_SRP_gN_cache_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN_cache, (st), (cmp)) -# define sk_SRP_gN_cache_dup(st) SKM_sk_dup(SRP_gN_cache, st) -# define sk_SRP_gN_cache_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN_cache, (st), (free_func)) -# define sk_SRP_gN_cache_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_gN_cache, (st), (copy_func), (free_func)) -# define sk_SRP_gN_cache_shift(st) SKM_sk_shift(SRP_gN_cache, (st)) -# define sk_SRP_gN_cache_pop(st) SKM_sk_pop(SRP_gN_cache, (st)) -# define sk_SRP_gN_cache_sort(st) SKM_sk_sort(SRP_gN_cache, (st)) -# define sk_SRP_gN_cache_is_sorted(st) SKM_sk_is_sorted(SRP_gN_cache, (st)) -# define sk_SRP_user_pwd_new(cmp) SKM_sk_new(SRP_user_pwd, (cmp)) -# define sk_SRP_user_pwd_new_null() SKM_sk_new_null(SRP_user_pwd) -# define sk_SRP_user_pwd_free(st) SKM_sk_free(SRP_user_pwd, (st)) -# define sk_SRP_user_pwd_num(st) SKM_sk_num(SRP_user_pwd, (st)) -# define sk_SRP_user_pwd_value(st, i) SKM_sk_value(SRP_user_pwd, (st), (i)) -# define sk_SRP_user_pwd_set(st, i, val) SKM_sk_set(SRP_user_pwd, (st), (i), (val)) -# define sk_SRP_user_pwd_zero(st) SKM_sk_zero(SRP_user_pwd, (st)) -# define sk_SRP_user_pwd_push(st, val) SKM_sk_push(SRP_user_pwd, (st), (val)) -# define sk_SRP_user_pwd_unshift(st, val) SKM_sk_unshift(SRP_user_pwd, (st), (val)) -# define sk_SRP_user_pwd_find(st, val) SKM_sk_find(SRP_user_pwd, (st), (val)) -# define sk_SRP_user_pwd_find_ex(st, val) SKM_sk_find_ex(SRP_user_pwd, (st), (val)) -# define sk_SRP_user_pwd_delete(st, i) SKM_sk_delete(SRP_user_pwd, (st), (i)) -# define sk_SRP_user_pwd_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_user_pwd, (st), (ptr)) -# define sk_SRP_user_pwd_insert(st, val, i) SKM_sk_insert(SRP_user_pwd, (st), (val), (i)) -# define sk_SRP_user_pwd_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_user_pwd, (st), (cmp)) -# define sk_SRP_user_pwd_dup(st) SKM_sk_dup(SRP_user_pwd, st) -# define sk_SRP_user_pwd_pop_free(st, free_func) SKM_sk_pop_free(SRP_user_pwd, (st), (free_func)) -# define sk_SRP_user_pwd_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_user_pwd, (st), (copy_func), (free_func)) -# define sk_SRP_user_pwd_shift(st) SKM_sk_shift(SRP_user_pwd, (st)) -# define sk_SRP_user_pwd_pop(st) SKM_sk_pop(SRP_user_pwd, (st)) -# define sk_SRP_user_pwd_sort(st) SKM_sk_sort(SRP_user_pwd, (st)) -# define sk_SRP_user_pwd_is_sorted(st) SKM_sk_is_sorted(SRP_user_pwd, (st)) -# define sk_SRTP_PROTECTION_PROFILE_new(cmp) SKM_sk_new(SRTP_PROTECTION_PROFILE, (cmp)) -# define sk_SRTP_PROTECTION_PROFILE_new_null() SKM_sk_new_null(SRTP_PROTECTION_PROFILE) -# define sk_SRTP_PROTECTION_PROFILE_free(st) SKM_sk_free(SRTP_PROTECTION_PROFILE, (st)) -# define sk_SRTP_PROTECTION_PROFILE_num(st) SKM_sk_num(SRTP_PROTECTION_PROFILE, (st)) -# define sk_SRTP_PROTECTION_PROFILE_value(st, i) SKM_sk_value(SRTP_PROTECTION_PROFILE, (st), (i)) -# define sk_SRTP_PROTECTION_PROFILE_set(st, i, val) SKM_sk_set(SRTP_PROTECTION_PROFILE, (st), (i), (val)) -# define sk_SRTP_PROTECTION_PROFILE_zero(st) SKM_sk_zero(SRTP_PROTECTION_PROFILE, (st)) -# define sk_SRTP_PROTECTION_PROFILE_push(st, val) SKM_sk_push(SRTP_PROTECTION_PROFILE, (st), (val)) -# define sk_SRTP_PROTECTION_PROFILE_unshift(st, val) SKM_sk_unshift(SRTP_PROTECTION_PROFILE, (st), (val)) -# define sk_SRTP_PROTECTION_PROFILE_find(st, val) SKM_sk_find(SRTP_PROTECTION_PROFILE, (st), (val)) -# define sk_SRTP_PROTECTION_PROFILE_find_ex(st, val) SKM_sk_find_ex(SRTP_PROTECTION_PROFILE, (st), (val)) -# define sk_SRTP_PROTECTION_PROFILE_delete(st, i) SKM_sk_delete(SRTP_PROTECTION_PROFILE, (st), (i)) -# define sk_SRTP_PROTECTION_PROFILE_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRTP_PROTECTION_PROFILE, (st), (ptr)) -# define sk_SRTP_PROTECTION_PROFILE_insert(st, val, i) SKM_sk_insert(SRTP_PROTECTION_PROFILE, (st), (val), (i)) -# define sk_SRTP_PROTECTION_PROFILE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRTP_PROTECTION_PROFILE, (st), (cmp)) -# define sk_SRTP_PROTECTION_PROFILE_dup(st) SKM_sk_dup(SRTP_PROTECTION_PROFILE, st) -# define sk_SRTP_PROTECTION_PROFILE_pop_free(st, free_func) SKM_sk_pop_free(SRTP_PROTECTION_PROFILE, (st), (free_func)) -# define sk_SRTP_PROTECTION_PROFILE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRTP_PROTECTION_PROFILE, (st), (copy_func), (free_func)) -# define sk_SRTP_PROTECTION_PROFILE_shift(st) SKM_sk_shift(SRTP_PROTECTION_PROFILE, (st)) -# define sk_SRTP_PROTECTION_PROFILE_pop(st) SKM_sk_pop(SRTP_PROTECTION_PROFILE, (st)) -# define sk_SRTP_PROTECTION_PROFILE_sort(st) SKM_sk_sort(SRTP_PROTECTION_PROFILE, (st)) -# define sk_SRTP_PROTECTION_PROFILE_is_sorted(st) SKM_sk_is_sorted(SRTP_PROTECTION_PROFILE, (st)) -# define sk_SSL_CIPHER_new(cmp) SKM_sk_new(SSL_CIPHER, (cmp)) -# define sk_SSL_CIPHER_new_null() SKM_sk_new_null(SSL_CIPHER) -# define sk_SSL_CIPHER_free(st) SKM_sk_free(SSL_CIPHER, (st)) -# define sk_SSL_CIPHER_num(st) SKM_sk_num(SSL_CIPHER, (st)) -# define sk_SSL_CIPHER_value(st, i) SKM_sk_value(SSL_CIPHER, (st), (i)) -# define sk_SSL_CIPHER_set(st, i, val) SKM_sk_set(SSL_CIPHER, (st), (i), (val)) -# define sk_SSL_CIPHER_zero(st) SKM_sk_zero(SSL_CIPHER, (st)) -# define sk_SSL_CIPHER_push(st, val) SKM_sk_push(SSL_CIPHER, (st), (val)) -# define sk_SSL_CIPHER_unshift(st, val) SKM_sk_unshift(SSL_CIPHER, (st), (val)) -# define sk_SSL_CIPHER_find(st, val) SKM_sk_find(SSL_CIPHER, (st), (val)) -# define sk_SSL_CIPHER_find_ex(st, val) SKM_sk_find_ex(SSL_CIPHER, (st), (val)) -# define sk_SSL_CIPHER_delete(st, i) SKM_sk_delete(SSL_CIPHER, (st), (i)) -# define sk_SSL_CIPHER_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_CIPHER, (st), (ptr)) -# define sk_SSL_CIPHER_insert(st, val, i) SKM_sk_insert(SSL_CIPHER, (st), (val), (i)) -# define sk_SSL_CIPHER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_CIPHER, (st), (cmp)) -# define sk_SSL_CIPHER_dup(st) SKM_sk_dup(SSL_CIPHER, st) -# define sk_SSL_CIPHER_pop_free(st, free_func) SKM_sk_pop_free(SSL_CIPHER, (st), (free_func)) -# define sk_SSL_CIPHER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SSL_CIPHER, (st), (copy_func), (free_func)) -# define sk_SSL_CIPHER_shift(st) SKM_sk_shift(SSL_CIPHER, (st)) -# define sk_SSL_CIPHER_pop(st) SKM_sk_pop(SSL_CIPHER, (st)) -# define sk_SSL_CIPHER_sort(st) SKM_sk_sort(SSL_CIPHER, (st)) -# define sk_SSL_CIPHER_is_sorted(st) SKM_sk_is_sorted(SSL_CIPHER, (st)) -# define sk_SSL_COMP_new(cmp) SKM_sk_new(SSL_COMP, (cmp)) -# define sk_SSL_COMP_new_null() SKM_sk_new_null(SSL_COMP) -# define sk_SSL_COMP_free(st) SKM_sk_free(SSL_COMP, (st)) -# define sk_SSL_COMP_num(st) SKM_sk_num(SSL_COMP, (st)) -# define sk_SSL_COMP_value(st, i) SKM_sk_value(SSL_COMP, (st), (i)) -# define sk_SSL_COMP_set(st, i, val) SKM_sk_set(SSL_COMP, (st), (i), (val)) -# define sk_SSL_COMP_zero(st) SKM_sk_zero(SSL_COMP, (st)) -# define sk_SSL_COMP_push(st, val) SKM_sk_push(SSL_COMP, (st), (val)) -# define sk_SSL_COMP_unshift(st, val) SKM_sk_unshift(SSL_COMP, (st), (val)) -# define sk_SSL_COMP_find(st, val) SKM_sk_find(SSL_COMP, (st), (val)) -# define sk_SSL_COMP_find_ex(st, val) SKM_sk_find_ex(SSL_COMP, (st), (val)) -# define sk_SSL_COMP_delete(st, i) SKM_sk_delete(SSL_COMP, (st), (i)) -# define sk_SSL_COMP_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_COMP, (st), (ptr)) -# define sk_SSL_COMP_insert(st, val, i) SKM_sk_insert(SSL_COMP, (st), (val), (i)) -# define sk_SSL_COMP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_COMP, (st), (cmp)) -# define sk_SSL_COMP_dup(st) SKM_sk_dup(SSL_COMP, st) -# define sk_SSL_COMP_pop_free(st, free_func) SKM_sk_pop_free(SSL_COMP, (st), (free_func)) -# define sk_SSL_COMP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SSL_COMP, (st), (copy_func), (free_func)) -# define sk_SSL_COMP_shift(st) SKM_sk_shift(SSL_COMP, (st)) -# define sk_SSL_COMP_pop(st) SKM_sk_pop(SSL_COMP, (st)) -# define sk_SSL_COMP_sort(st) SKM_sk_sort(SSL_COMP, (st)) -# define sk_SSL_COMP_is_sorted(st) SKM_sk_is_sorted(SSL_COMP, (st)) -# define sk_STACK_OF_X509_NAME_ENTRY_new(cmp) SKM_sk_new(STACK_OF_X509_NAME_ENTRY, (cmp)) -# define sk_STACK_OF_X509_NAME_ENTRY_new_null() SKM_sk_new_null(STACK_OF_X509_NAME_ENTRY) -# define sk_STACK_OF_X509_NAME_ENTRY_free(st) SKM_sk_free(STACK_OF_X509_NAME_ENTRY, (st)) -# define sk_STACK_OF_X509_NAME_ENTRY_num(st) SKM_sk_num(STACK_OF_X509_NAME_ENTRY, (st)) -# define sk_STACK_OF_X509_NAME_ENTRY_value(st, i) SKM_sk_value(STACK_OF_X509_NAME_ENTRY, (st), (i)) -# define sk_STACK_OF_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(STACK_OF_X509_NAME_ENTRY, (st), (i), (val)) -# define sk_STACK_OF_X509_NAME_ENTRY_zero(st) SKM_sk_zero(STACK_OF_X509_NAME_ENTRY, (st)) -# define sk_STACK_OF_X509_NAME_ENTRY_push(st, val) SKM_sk_push(STACK_OF_X509_NAME_ENTRY, (st), (val)) -# define sk_STACK_OF_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(STACK_OF_X509_NAME_ENTRY, (st), (val)) -# define sk_STACK_OF_X509_NAME_ENTRY_find(st, val) SKM_sk_find(STACK_OF_X509_NAME_ENTRY, (st), (val)) -# define sk_STACK_OF_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(STACK_OF_X509_NAME_ENTRY, (st), (val)) -# define sk_STACK_OF_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(STACK_OF_X509_NAME_ENTRY, (st), (i)) -# define sk_STACK_OF_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(STACK_OF_X509_NAME_ENTRY, (st), (ptr)) -# define sk_STACK_OF_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(STACK_OF_X509_NAME_ENTRY, (st), (val), (i)) -# define sk_STACK_OF_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STACK_OF_X509_NAME_ENTRY, (st), (cmp)) -# define sk_STACK_OF_X509_NAME_ENTRY_dup(st) SKM_sk_dup(STACK_OF_X509_NAME_ENTRY, st) -# define sk_STACK_OF_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(STACK_OF_X509_NAME_ENTRY, (st), (free_func)) -# define sk_STACK_OF_X509_NAME_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STACK_OF_X509_NAME_ENTRY, (st), (copy_func), (free_func)) -# define sk_STACK_OF_X509_NAME_ENTRY_shift(st) SKM_sk_shift(STACK_OF_X509_NAME_ENTRY, (st)) -# define sk_STACK_OF_X509_NAME_ENTRY_pop(st) SKM_sk_pop(STACK_OF_X509_NAME_ENTRY, (st)) -# define sk_STACK_OF_X509_NAME_ENTRY_sort(st) SKM_sk_sort(STACK_OF_X509_NAME_ENTRY, (st)) -# define sk_STACK_OF_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(STACK_OF_X509_NAME_ENTRY, (st)) -# define sk_STORE_ATTR_INFO_new(cmp) SKM_sk_new(STORE_ATTR_INFO, (cmp)) -# define sk_STORE_ATTR_INFO_new_null() SKM_sk_new_null(STORE_ATTR_INFO) -# define sk_STORE_ATTR_INFO_free(st) SKM_sk_free(STORE_ATTR_INFO, (st)) -# define sk_STORE_ATTR_INFO_num(st) SKM_sk_num(STORE_ATTR_INFO, (st)) -# define sk_STORE_ATTR_INFO_value(st, i) SKM_sk_value(STORE_ATTR_INFO, (st), (i)) -# define sk_STORE_ATTR_INFO_set(st, i, val) SKM_sk_set(STORE_ATTR_INFO, (st), (i), (val)) -# define sk_STORE_ATTR_INFO_zero(st) SKM_sk_zero(STORE_ATTR_INFO, (st)) -# define sk_STORE_ATTR_INFO_push(st, val) SKM_sk_push(STORE_ATTR_INFO, (st), (val)) -# define sk_STORE_ATTR_INFO_unshift(st, val) SKM_sk_unshift(STORE_ATTR_INFO, (st), (val)) -# define sk_STORE_ATTR_INFO_find(st, val) SKM_sk_find(STORE_ATTR_INFO, (st), (val)) -# define sk_STORE_ATTR_INFO_find_ex(st, val) SKM_sk_find_ex(STORE_ATTR_INFO, (st), (val)) -# define sk_STORE_ATTR_INFO_delete(st, i) SKM_sk_delete(STORE_ATTR_INFO, (st), (i)) -# define sk_STORE_ATTR_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_ATTR_INFO, (st), (ptr)) -# define sk_STORE_ATTR_INFO_insert(st, val, i) SKM_sk_insert(STORE_ATTR_INFO, (st), (val), (i)) -# define sk_STORE_ATTR_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_ATTR_INFO, (st), (cmp)) -# define sk_STORE_ATTR_INFO_dup(st) SKM_sk_dup(STORE_ATTR_INFO, st) -# define sk_STORE_ATTR_INFO_pop_free(st, free_func) SKM_sk_pop_free(STORE_ATTR_INFO, (st), (free_func)) -# define sk_STORE_ATTR_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STORE_ATTR_INFO, (st), (copy_func), (free_func)) -# define sk_STORE_ATTR_INFO_shift(st) SKM_sk_shift(STORE_ATTR_INFO, (st)) -# define sk_STORE_ATTR_INFO_pop(st) SKM_sk_pop(STORE_ATTR_INFO, (st)) -# define sk_STORE_ATTR_INFO_sort(st) SKM_sk_sort(STORE_ATTR_INFO, (st)) -# define sk_STORE_ATTR_INFO_is_sorted(st) SKM_sk_is_sorted(STORE_ATTR_INFO, (st)) -# define sk_STORE_OBJECT_new(cmp) SKM_sk_new(STORE_OBJECT, (cmp)) -# define sk_STORE_OBJECT_new_null() SKM_sk_new_null(STORE_OBJECT) -# define sk_STORE_OBJECT_free(st) SKM_sk_free(STORE_OBJECT, (st)) -# define sk_STORE_OBJECT_num(st) SKM_sk_num(STORE_OBJECT, (st)) -# define sk_STORE_OBJECT_value(st, i) SKM_sk_value(STORE_OBJECT, (st), (i)) -# define sk_STORE_OBJECT_set(st, i, val) SKM_sk_set(STORE_OBJECT, (st), (i), (val)) -# define sk_STORE_OBJECT_zero(st) SKM_sk_zero(STORE_OBJECT, (st)) -# define sk_STORE_OBJECT_push(st, val) SKM_sk_push(STORE_OBJECT, (st), (val)) -# define sk_STORE_OBJECT_unshift(st, val) SKM_sk_unshift(STORE_OBJECT, (st), (val)) -# define sk_STORE_OBJECT_find(st, val) SKM_sk_find(STORE_OBJECT, (st), (val)) -# define sk_STORE_OBJECT_find_ex(st, val) SKM_sk_find_ex(STORE_OBJECT, (st), (val)) -# define sk_STORE_OBJECT_delete(st, i) SKM_sk_delete(STORE_OBJECT, (st), (i)) -# define sk_STORE_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_OBJECT, (st), (ptr)) -# define sk_STORE_OBJECT_insert(st, val, i) SKM_sk_insert(STORE_OBJECT, (st), (val), (i)) -# define sk_STORE_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_OBJECT, (st), (cmp)) -# define sk_STORE_OBJECT_dup(st) SKM_sk_dup(STORE_OBJECT, st) -# define sk_STORE_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(STORE_OBJECT, (st), (free_func)) -# define sk_STORE_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STORE_OBJECT, (st), (copy_func), (free_func)) -# define sk_STORE_OBJECT_shift(st) SKM_sk_shift(STORE_OBJECT, (st)) -# define sk_STORE_OBJECT_pop(st) SKM_sk_pop(STORE_OBJECT, (st)) -# define sk_STORE_OBJECT_sort(st) SKM_sk_sort(STORE_OBJECT, (st)) -# define sk_STORE_OBJECT_is_sorted(st) SKM_sk_is_sorted(STORE_OBJECT, (st)) -# define sk_SXNETID_new(cmp) SKM_sk_new(SXNETID, (cmp)) -# define sk_SXNETID_new_null() SKM_sk_new_null(SXNETID) -# define sk_SXNETID_free(st) SKM_sk_free(SXNETID, (st)) -# define sk_SXNETID_num(st) SKM_sk_num(SXNETID, (st)) -# define sk_SXNETID_value(st, i) SKM_sk_value(SXNETID, (st), (i)) -# define sk_SXNETID_set(st, i, val) SKM_sk_set(SXNETID, (st), (i), (val)) -# define sk_SXNETID_zero(st) SKM_sk_zero(SXNETID, (st)) -# define sk_SXNETID_push(st, val) SKM_sk_push(SXNETID, (st), (val)) -# define sk_SXNETID_unshift(st, val) SKM_sk_unshift(SXNETID, (st), (val)) -# define sk_SXNETID_find(st, val) SKM_sk_find(SXNETID, (st), (val)) -# define sk_SXNETID_find_ex(st, val) SKM_sk_find_ex(SXNETID, (st), (val)) -# define sk_SXNETID_delete(st, i) SKM_sk_delete(SXNETID, (st), (i)) -# define sk_SXNETID_delete_ptr(st, ptr) SKM_sk_delete_ptr(SXNETID, (st), (ptr)) -# define sk_SXNETID_insert(st, val, i) SKM_sk_insert(SXNETID, (st), (val), (i)) -# define sk_SXNETID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SXNETID, (st), (cmp)) -# define sk_SXNETID_dup(st) SKM_sk_dup(SXNETID, st) -# define sk_SXNETID_pop_free(st, free_func) SKM_sk_pop_free(SXNETID, (st), (free_func)) -# define sk_SXNETID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SXNETID, (st), (copy_func), (free_func)) -# define sk_SXNETID_shift(st) SKM_sk_shift(SXNETID, (st)) -# define sk_SXNETID_pop(st) SKM_sk_pop(SXNETID, (st)) -# define sk_SXNETID_sort(st) SKM_sk_sort(SXNETID, (st)) -# define sk_SXNETID_is_sorted(st) SKM_sk_is_sorted(SXNETID, (st)) -# define sk_UI_STRING_new(cmp) SKM_sk_new(UI_STRING, (cmp)) -# define sk_UI_STRING_new_null() SKM_sk_new_null(UI_STRING) -# define sk_UI_STRING_free(st) SKM_sk_free(UI_STRING, (st)) -# define sk_UI_STRING_num(st) SKM_sk_num(UI_STRING, (st)) -# define sk_UI_STRING_value(st, i) SKM_sk_value(UI_STRING, (st), (i)) -# define sk_UI_STRING_set(st, i, val) SKM_sk_set(UI_STRING, (st), (i), (val)) -# define sk_UI_STRING_zero(st) SKM_sk_zero(UI_STRING, (st)) -# define sk_UI_STRING_push(st, val) SKM_sk_push(UI_STRING, (st), (val)) -# define sk_UI_STRING_unshift(st, val) SKM_sk_unshift(UI_STRING, (st), (val)) -# define sk_UI_STRING_find(st, val) SKM_sk_find(UI_STRING, (st), (val)) -# define sk_UI_STRING_find_ex(st, val) SKM_sk_find_ex(UI_STRING, (st), (val)) -# define sk_UI_STRING_delete(st, i) SKM_sk_delete(UI_STRING, (st), (i)) -# define sk_UI_STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(UI_STRING, (st), (ptr)) -# define sk_UI_STRING_insert(st, val, i) SKM_sk_insert(UI_STRING, (st), (val), (i)) -# define sk_UI_STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(UI_STRING, (st), (cmp)) -# define sk_UI_STRING_dup(st) SKM_sk_dup(UI_STRING, st) -# define sk_UI_STRING_pop_free(st, free_func) SKM_sk_pop_free(UI_STRING, (st), (free_func)) -# define sk_UI_STRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(UI_STRING, (st), (copy_func), (free_func)) -# define sk_UI_STRING_shift(st) SKM_sk_shift(UI_STRING, (st)) -# define sk_UI_STRING_pop(st) SKM_sk_pop(UI_STRING, (st)) -# define sk_UI_STRING_sort(st) SKM_sk_sort(UI_STRING, (st)) -# define sk_UI_STRING_is_sorted(st) SKM_sk_is_sorted(UI_STRING, (st)) -# define sk_X509_new(cmp) SKM_sk_new(X509, (cmp)) -# define sk_X509_new_null() SKM_sk_new_null(X509) -# define sk_X509_free(st) SKM_sk_free(X509, (st)) -# define sk_X509_num(st) SKM_sk_num(X509, (st)) -# define sk_X509_value(st, i) SKM_sk_value(X509, (st), (i)) -# define sk_X509_set(st, i, val) SKM_sk_set(X509, (st), (i), (val)) -# define sk_X509_zero(st) SKM_sk_zero(X509, (st)) -# define sk_X509_push(st, val) SKM_sk_push(X509, (st), (val)) -# define sk_X509_unshift(st, val) SKM_sk_unshift(X509, (st), (val)) -# define sk_X509_find(st, val) SKM_sk_find(X509, (st), (val)) -# define sk_X509_find_ex(st, val) SKM_sk_find_ex(X509, (st), (val)) -# define sk_X509_delete(st, i) SKM_sk_delete(X509, (st), (i)) -# define sk_X509_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509, (st), (ptr)) -# define sk_X509_insert(st, val, i) SKM_sk_insert(X509, (st), (val), (i)) -# define sk_X509_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509, (st), (cmp)) -# define sk_X509_dup(st) SKM_sk_dup(X509, st) -# define sk_X509_pop_free(st, free_func) SKM_sk_pop_free(X509, (st), (free_func)) -# define sk_X509_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509, (st), (copy_func), (free_func)) -# define sk_X509_shift(st) SKM_sk_shift(X509, (st)) -# define sk_X509_pop(st) SKM_sk_pop(X509, (st)) -# define sk_X509_sort(st) SKM_sk_sort(X509, (st)) -# define sk_X509_is_sorted(st) SKM_sk_is_sorted(X509, (st)) -# define sk_X509V3_EXT_METHOD_new(cmp) SKM_sk_new(X509V3_EXT_METHOD, (cmp)) -# define sk_X509V3_EXT_METHOD_new_null() SKM_sk_new_null(X509V3_EXT_METHOD) -# define sk_X509V3_EXT_METHOD_free(st) SKM_sk_free(X509V3_EXT_METHOD, (st)) -# define sk_X509V3_EXT_METHOD_num(st) SKM_sk_num(X509V3_EXT_METHOD, (st)) -# define sk_X509V3_EXT_METHOD_value(st, i) SKM_sk_value(X509V3_EXT_METHOD, (st), (i)) -# define sk_X509V3_EXT_METHOD_set(st, i, val) SKM_sk_set(X509V3_EXT_METHOD, (st), (i), (val)) -# define sk_X509V3_EXT_METHOD_zero(st) SKM_sk_zero(X509V3_EXT_METHOD, (st)) -# define sk_X509V3_EXT_METHOD_push(st, val) SKM_sk_push(X509V3_EXT_METHOD, (st), (val)) -# define sk_X509V3_EXT_METHOD_unshift(st, val) SKM_sk_unshift(X509V3_EXT_METHOD, (st), (val)) -# define sk_X509V3_EXT_METHOD_find(st, val) SKM_sk_find(X509V3_EXT_METHOD, (st), (val)) -# define sk_X509V3_EXT_METHOD_find_ex(st, val) SKM_sk_find_ex(X509V3_EXT_METHOD, (st), (val)) -# define sk_X509V3_EXT_METHOD_delete(st, i) SKM_sk_delete(X509V3_EXT_METHOD, (st), (i)) -# define sk_X509V3_EXT_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509V3_EXT_METHOD, (st), (ptr)) -# define sk_X509V3_EXT_METHOD_insert(st, val, i) SKM_sk_insert(X509V3_EXT_METHOD, (st), (val), (i)) -# define sk_X509V3_EXT_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509V3_EXT_METHOD, (st), (cmp)) -# define sk_X509V3_EXT_METHOD_dup(st) SKM_sk_dup(X509V3_EXT_METHOD, st) -# define sk_X509V3_EXT_METHOD_pop_free(st, free_func) SKM_sk_pop_free(X509V3_EXT_METHOD, (st), (free_func)) -# define sk_X509V3_EXT_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509V3_EXT_METHOD, (st), (copy_func), (free_func)) -# define sk_X509V3_EXT_METHOD_shift(st) SKM_sk_shift(X509V3_EXT_METHOD, (st)) -# define sk_X509V3_EXT_METHOD_pop(st) SKM_sk_pop(X509V3_EXT_METHOD, (st)) -# define sk_X509V3_EXT_METHOD_sort(st) SKM_sk_sort(X509V3_EXT_METHOD, (st)) -# define sk_X509V3_EXT_METHOD_is_sorted(st) SKM_sk_is_sorted(X509V3_EXT_METHOD, (st)) -# define sk_X509_ALGOR_new(cmp) SKM_sk_new(X509_ALGOR, (cmp)) -# define sk_X509_ALGOR_new_null() SKM_sk_new_null(X509_ALGOR) -# define sk_X509_ALGOR_free(st) SKM_sk_free(X509_ALGOR, (st)) -# define sk_X509_ALGOR_num(st) SKM_sk_num(X509_ALGOR, (st)) -# define sk_X509_ALGOR_value(st, i) SKM_sk_value(X509_ALGOR, (st), (i)) -# define sk_X509_ALGOR_set(st, i, val) SKM_sk_set(X509_ALGOR, (st), (i), (val)) -# define sk_X509_ALGOR_zero(st) SKM_sk_zero(X509_ALGOR, (st)) -# define sk_X509_ALGOR_push(st, val) SKM_sk_push(X509_ALGOR, (st), (val)) -# define sk_X509_ALGOR_unshift(st, val) SKM_sk_unshift(X509_ALGOR, (st), (val)) -# define sk_X509_ALGOR_find(st, val) SKM_sk_find(X509_ALGOR, (st), (val)) -# define sk_X509_ALGOR_find_ex(st, val) SKM_sk_find_ex(X509_ALGOR, (st), (val)) -# define sk_X509_ALGOR_delete(st, i) SKM_sk_delete(X509_ALGOR, (st), (i)) -# define sk_X509_ALGOR_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ALGOR, (st), (ptr)) -# define sk_X509_ALGOR_insert(st, val, i) SKM_sk_insert(X509_ALGOR, (st), (val), (i)) -# define sk_X509_ALGOR_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ALGOR, (st), (cmp)) -# define sk_X509_ALGOR_dup(st) SKM_sk_dup(X509_ALGOR, st) -# define sk_X509_ALGOR_pop_free(st, free_func) SKM_sk_pop_free(X509_ALGOR, (st), (free_func)) -# define sk_X509_ALGOR_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_ALGOR, (st), (copy_func), (free_func)) -# define sk_X509_ALGOR_shift(st) SKM_sk_shift(X509_ALGOR, (st)) -# define sk_X509_ALGOR_pop(st) SKM_sk_pop(X509_ALGOR, (st)) -# define sk_X509_ALGOR_sort(st) SKM_sk_sort(X509_ALGOR, (st)) -# define sk_X509_ALGOR_is_sorted(st) SKM_sk_is_sorted(X509_ALGOR, (st)) -# define sk_X509_ATTRIBUTE_new(cmp) SKM_sk_new(X509_ATTRIBUTE, (cmp)) -# define sk_X509_ATTRIBUTE_new_null() SKM_sk_new_null(X509_ATTRIBUTE) -# define sk_X509_ATTRIBUTE_free(st) SKM_sk_free(X509_ATTRIBUTE, (st)) -# define sk_X509_ATTRIBUTE_num(st) SKM_sk_num(X509_ATTRIBUTE, (st)) -# define sk_X509_ATTRIBUTE_value(st, i) SKM_sk_value(X509_ATTRIBUTE, (st), (i)) -# define sk_X509_ATTRIBUTE_set(st, i, val) SKM_sk_set(X509_ATTRIBUTE, (st), (i), (val)) -# define sk_X509_ATTRIBUTE_zero(st) SKM_sk_zero(X509_ATTRIBUTE, (st)) -# define sk_X509_ATTRIBUTE_push(st, val) SKM_sk_push(X509_ATTRIBUTE, (st), (val)) -# define sk_X509_ATTRIBUTE_unshift(st, val) SKM_sk_unshift(X509_ATTRIBUTE, (st), (val)) -# define sk_X509_ATTRIBUTE_find(st, val) SKM_sk_find(X509_ATTRIBUTE, (st), (val)) -# define sk_X509_ATTRIBUTE_find_ex(st, val) SKM_sk_find_ex(X509_ATTRIBUTE, (st), (val)) -# define sk_X509_ATTRIBUTE_delete(st, i) SKM_sk_delete(X509_ATTRIBUTE, (st), (i)) -# define sk_X509_ATTRIBUTE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ATTRIBUTE, (st), (ptr)) -# define sk_X509_ATTRIBUTE_insert(st, val, i) SKM_sk_insert(X509_ATTRIBUTE, (st), (val), (i)) -# define sk_X509_ATTRIBUTE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ATTRIBUTE, (st), (cmp)) -# define sk_X509_ATTRIBUTE_dup(st) SKM_sk_dup(X509_ATTRIBUTE, st) -# define sk_X509_ATTRIBUTE_pop_free(st, free_func) SKM_sk_pop_free(X509_ATTRIBUTE, (st), (free_func)) -# define sk_X509_ATTRIBUTE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_ATTRIBUTE, (st), (copy_func), (free_func)) -# define sk_X509_ATTRIBUTE_shift(st) SKM_sk_shift(X509_ATTRIBUTE, (st)) -# define sk_X509_ATTRIBUTE_pop(st) SKM_sk_pop(X509_ATTRIBUTE, (st)) -# define sk_X509_ATTRIBUTE_sort(st) SKM_sk_sort(X509_ATTRIBUTE, (st)) -# define sk_X509_ATTRIBUTE_is_sorted(st) SKM_sk_is_sorted(X509_ATTRIBUTE, (st)) -# define sk_X509_CRL_new(cmp) SKM_sk_new(X509_CRL, (cmp)) -# define sk_X509_CRL_new_null() SKM_sk_new_null(X509_CRL) -# define sk_X509_CRL_free(st) SKM_sk_free(X509_CRL, (st)) -# define sk_X509_CRL_num(st) SKM_sk_num(X509_CRL, (st)) -# define sk_X509_CRL_value(st, i) SKM_sk_value(X509_CRL, (st), (i)) -# define sk_X509_CRL_set(st, i, val) SKM_sk_set(X509_CRL, (st), (i), (val)) -# define sk_X509_CRL_zero(st) SKM_sk_zero(X509_CRL, (st)) -# define sk_X509_CRL_push(st, val) SKM_sk_push(X509_CRL, (st), (val)) -# define sk_X509_CRL_unshift(st, val) SKM_sk_unshift(X509_CRL, (st), (val)) -# define sk_X509_CRL_find(st, val) SKM_sk_find(X509_CRL, (st), (val)) -# define sk_X509_CRL_find_ex(st, val) SKM_sk_find_ex(X509_CRL, (st), (val)) -# define sk_X509_CRL_delete(st, i) SKM_sk_delete(X509_CRL, (st), (i)) -# define sk_X509_CRL_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_CRL, (st), (ptr)) -# define sk_X509_CRL_insert(st, val, i) SKM_sk_insert(X509_CRL, (st), (val), (i)) -# define sk_X509_CRL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_CRL, (st), (cmp)) -# define sk_X509_CRL_dup(st) SKM_sk_dup(X509_CRL, st) -# define sk_X509_CRL_pop_free(st, free_func) SKM_sk_pop_free(X509_CRL, (st), (free_func)) -# define sk_X509_CRL_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_CRL, (st), (copy_func), (free_func)) -# define sk_X509_CRL_shift(st) SKM_sk_shift(X509_CRL, (st)) -# define sk_X509_CRL_pop(st) SKM_sk_pop(X509_CRL, (st)) -# define sk_X509_CRL_sort(st) SKM_sk_sort(X509_CRL, (st)) -# define sk_X509_CRL_is_sorted(st) SKM_sk_is_sorted(X509_CRL, (st)) -# define sk_X509_EXTENSION_new(cmp) SKM_sk_new(X509_EXTENSION, (cmp)) -# define sk_X509_EXTENSION_new_null() SKM_sk_new_null(X509_EXTENSION) -# define sk_X509_EXTENSION_free(st) SKM_sk_free(X509_EXTENSION, (st)) -# define sk_X509_EXTENSION_num(st) SKM_sk_num(X509_EXTENSION, (st)) -# define sk_X509_EXTENSION_value(st, i) SKM_sk_value(X509_EXTENSION, (st), (i)) -# define sk_X509_EXTENSION_set(st, i, val) SKM_sk_set(X509_EXTENSION, (st), (i), (val)) -# define sk_X509_EXTENSION_zero(st) SKM_sk_zero(X509_EXTENSION, (st)) -# define sk_X509_EXTENSION_push(st, val) SKM_sk_push(X509_EXTENSION, (st), (val)) -# define sk_X509_EXTENSION_unshift(st, val) SKM_sk_unshift(X509_EXTENSION, (st), (val)) -# define sk_X509_EXTENSION_find(st, val) SKM_sk_find(X509_EXTENSION, (st), (val)) -# define sk_X509_EXTENSION_find_ex(st, val) SKM_sk_find_ex(X509_EXTENSION, (st), (val)) -# define sk_X509_EXTENSION_delete(st, i) SKM_sk_delete(X509_EXTENSION, (st), (i)) -# define sk_X509_EXTENSION_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_EXTENSION, (st), (ptr)) -# define sk_X509_EXTENSION_insert(st, val, i) SKM_sk_insert(X509_EXTENSION, (st), (val), (i)) -# define sk_X509_EXTENSION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_EXTENSION, (st), (cmp)) -# define sk_X509_EXTENSION_dup(st) SKM_sk_dup(X509_EXTENSION, st) -# define sk_X509_EXTENSION_pop_free(st, free_func) SKM_sk_pop_free(X509_EXTENSION, (st), (free_func)) -# define sk_X509_EXTENSION_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_EXTENSION, (st), (copy_func), (free_func)) -# define sk_X509_EXTENSION_shift(st) SKM_sk_shift(X509_EXTENSION, (st)) -# define sk_X509_EXTENSION_pop(st) SKM_sk_pop(X509_EXTENSION, (st)) -# define sk_X509_EXTENSION_sort(st) SKM_sk_sort(X509_EXTENSION, (st)) -# define sk_X509_EXTENSION_is_sorted(st) SKM_sk_is_sorted(X509_EXTENSION, (st)) -# define sk_X509_INFO_new(cmp) SKM_sk_new(X509_INFO, (cmp)) -# define sk_X509_INFO_new_null() SKM_sk_new_null(X509_INFO) -# define sk_X509_INFO_free(st) SKM_sk_free(X509_INFO, (st)) -# define sk_X509_INFO_num(st) SKM_sk_num(X509_INFO, (st)) -# define sk_X509_INFO_value(st, i) SKM_sk_value(X509_INFO, (st), (i)) -# define sk_X509_INFO_set(st, i, val) SKM_sk_set(X509_INFO, (st), (i), (val)) -# define sk_X509_INFO_zero(st) SKM_sk_zero(X509_INFO, (st)) -# define sk_X509_INFO_push(st, val) SKM_sk_push(X509_INFO, (st), (val)) -# define sk_X509_INFO_unshift(st, val) SKM_sk_unshift(X509_INFO, (st), (val)) -# define sk_X509_INFO_find(st, val) SKM_sk_find(X509_INFO, (st), (val)) -# define sk_X509_INFO_find_ex(st, val) SKM_sk_find_ex(X509_INFO, (st), (val)) -# define sk_X509_INFO_delete(st, i) SKM_sk_delete(X509_INFO, (st), (i)) -# define sk_X509_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_INFO, (st), (ptr)) -# define sk_X509_INFO_insert(st, val, i) SKM_sk_insert(X509_INFO, (st), (val), (i)) -# define sk_X509_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_INFO, (st), (cmp)) -# define sk_X509_INFO_dup(st) SKM_sk_dup(X509_INFO, st) -# define sk_X509_INFO_pop_free(st, free_func) SKM_sk_pop_free(X509_INFO, (st), (free_func)) -# define sk_X509_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_INFO, (st), (copy_func), (free_func)) -# define sk_X509_INFO_shift(st) SKM_sk_shift(X509_INFO, (st)) -# define sk_X509_INFO_pop(st) SKM_sk_pop(X509_INFO, (st)) -# define sk_X509_INFO_sort(st) SKM_sk_sort(X509_INFO, (st)) -# define sk_X509_INFO_is_sorted(st) SKM_sk_is_sorted(X509_INFO, (st)) -# define sk_X509_LOOKUP_new(cmp) SKM_sk_new(X509_LOOKUP, (cmp)) -# define sk_X509_LOOKUP_new_null() SKM_sk_new_null(X509_LOOKUP) -# define sk_X509_LOOKUP_free(st) SKM_sk_free(X509_LOOKUP, (st)) -# define sk_X509_LOOKUP_num(st) SKM_sk_num(X509_LOOKUP, (st)) -# define sk_X509_LOOKUP_value(st, i) SKM_sk_value(X509_LOOKUP, (st), (i)) -# define sk_X509_LOOKUP_set(st, i, val) SKM_sk_set(X509_LOOKUP, (st), (i), (val)) -# define sk_X509_LOOKUP_zero(st) SKM_sk_zero(X509_LOOKUP, (st)) -# define sk_X509_LOOKUP_push(st, val) SKM_sk_push(X509_LOOKUP, (st), (val)) -# define sk_X509_LOOKUP_unshift(st, val) SKM_sk_unshift(X509_LOOKUP, (st), (val)) -# define sk_X509_LOOKUP_find(st, val) SKM_sk_find(X509_LOOKUP, (st), (val)) -# define sk_X509_LOOKUP_find_ex(st, val) SKM_sk_find_ex(X509_LOOKUP, (st), (val)) -# define sk_X509_LOOKUP_delete(st, i) SKM_sk_delete(X509_LOOKUP, (st), (i)) -# define sk_X509_LOOKUP_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_LOOKUP, (st), (ptr)) -# define sk_X509_LOOKUP_insert(st, val, i) SKM_sk_insert(X509_LOOKUP, (st), (val), (i)) -# define sk_X509_LOOKUP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_LOOKUP, (st), (cmp)) -# define sk_X509_LOOKUP_dup(st) SKM_sk_dup(X509_LOOKUP, st) -# define sk_X509_LOOKUP_pop_free(st, free_func) SKM_sk_pop_free(X509_LOOKUP, (st), (free_func)) -# define sk_X509_LOOKUP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_LOOKUP, (st), (copy_func), (free_func)) -# define sk_X509_LOOKUP_shift(st) SKM_sk_shift(X509_LOOKUP, (st)) -# define sk_X509_LOOKUP_pop(st) SKM_sk_pop(X509_LOOKUP, (st)) -# define sk_X509_LOOKUP_sort(st) SKM_sk_sort(X509_LOOKUP, (st)) -# define sk_X509_LOOKUP_is_sorted(st) SKM_sk_is_sorted(X509_LOOKUP, (st)) -# define sk_X509_NAME_new(cmp) SKM_sk_new(X509_NAME, (cmp)) -# define sk_X509_NAME_new_null() SKM_sk_new_null(X509_NAME) -# define sk_X509_NAME_free(st) SKM_sk_free(X509_NAME, (st)) -# define sk_X509_NAME_num(st) SKM_sk_num(X509_NAME, (st)) -# define sk_X509_NAME_value(st, i) SKM_sk_value(X509_NAME, (st), (i)) -# define sk_X509_NAME_set(st, i, val) SKM_sk_set(X509_NAME, (st), (i), (val)) -# define sk_X509_NAME_zero(st) SKM_sk_zero(X509_NAME, (st)) -# define sk_X509_NAME_push(st, val) SKM_sk_push(X509_NAME, (st), (val)) -# define sk_X509_NAME_unshift(st, val) SKM_sk_unshift(X509_NAME, (st), (val)) -# define sk_X509_NAME_find(st, val) SKM_sk_find(X509_NAME, (st), (val)) -# define sk_X509_NAME_find_ex(st, val) SKM_sk_find_ex(X509_NAME, (st), (val)) -# define sk_X509_NAME_delete(st, i) SKM_sk_delete(X509_NAME, (st), (i)) -# define sk_X509_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME, (st), (ptr)) -# define sk_X509_NAME_insert(st, val, i) SKM_sk_insert(X509_NAME, (st), (val), (i)) -# define sk_X509_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME, (st), (cmp)) -# define sk_X509_NAME_dup(st) SKM_sk_dup(X509_NAME, st) -# define sk_X509_NAME_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME, (st), (free_func)) -# define sk_X509_NAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_NAME, (st), (copy_func), (free_func)) -# define sk_X509_NAME_shift(st) SKM_sk_shift(X509_NAME, (st)) -# define sk_X509_NAME_pop(st) SKM_sk_pop(X509_NAME, (st)) -# define sk_X509_NAME_sort(st) SKM_sk_sort(X509_NAME, (st)) -# define sk_X509_NAME_is_sorted(st) SKM_sk_is_sorted(X509_NAME, (st)) -# define sk_X509_NAME_ENTRY_new(cmp) SKM_sk_new(X509_NAME_ENTRY, (cmp)) -# define sk_X509_NAME_ENTRY_new_null() SKM_sk_new_null(X509_NAME_ENTRY) -# define sk_X509_NAME_ENTRY_free(st) SKM_sk_free(X509_NAME_ENTRY, (st)) -# define sk_X509_NAME_ENTRY_num(st) SKM_sk_num(X509_NAME_ENTRY, (st)) -# define sk_X509_NAME_ENTRY_value(st, i) SKM_sk_value(X509_NAME_ENTRY, (st), (i)) -# define sk_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(X509_NAME_ENTRY, (st), (i), (val)) -# define sk_X509_NAME_ENTRY_zero(st) SKM_sk_zero(X509_NAME_ENTRY, (st)) -# define sk_X509_NAME_ENTRY_push(st, val) SKM_sk_push(X509_NAME_ENTRY, (st), (val)) -# define sk_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(X509_NAME_ENTRY, (st), (val)) -# define sk_X509_NAME_ENTRY_find(st, val) SKM_sk_find(X509_NAME_ENTRY, (st), (val)) -# define sk_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(X509_NAME_ENTRY, (st), (val)) -# define sk_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(X509_NAME_ENTRY, (st), (i)) -# define sk_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME_ENTRY, (st), (ptr)) -# define sk_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(X509_NAME_ENTRY, (st), (val), (i)) -# define sk_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME_ENTRY, (st), (cmp)) -# define sk_X509_NAME_ENTRY_dup(st) SKM_sk_dup(X509_NAME_ENTRY, st) -# define sk_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME_ENTRY, (st), (free_func)) -# define sk_X509_NAME_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_NAME_ENTRY, (st), (copy_func), (free_func)) -# define sk_X509_NAME_ENTRY_shift(st) SKM_sk_shift(X509_NAME_ENTRY, (st)) -# define sk_X509_NAME_ENTRY_pop(st) SKM_sk_pop(X509_NAME_ENTRY, (st)) -# define sk_X509_NAME_ENTRY_sort(st) SKM_sk_sort(X509_NAME_ENTRY, (st)) -# define sk_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(X509_NAME_ENTRY, (st)) -# define sk_X509_OBJECT_new(cmp) SKM_sk_new(X509_OBJECT, (cmp)) -# define sk_X509_OBJECT_new_null() SKM_sk_new_null(X509_OBJECT) -# define sk_X509_OBJECT_free(st) SKM_sk_free(X509_OBJECT, (st)) -# define sk_X509_OBJECT_num(st) SKM_sk_num(X509_OBJECT, (st)) -# define sk_X509_OBJECT_value(st, i) SKM_sk_value(X509_OBJECT, (st), (i)) -# define sk_X509_OBJECT_set(st, i, val) SKM_sk_set(X509_OBJECT, (st), (i), (val)) -# define sk_X509_OBJECT_zero(st) SKM_sk_zero(X509_OBJECT, (st)) -# define sk_X509_OBJECT_push(st, val) SKM_sk_push(X509_OBJECT, (st), (val)) -# define sk_X509_OBJECT_unshift(st, val) SKM_sk_unshift(X509_OBJECT, (st), (val)) -# define sk_X509_OBJECT_find(st, val) SKM_sk_find(X509_OBJECT, (st), (val)) -# define sk_X509_OBJECT_find_ex(st, val) SKM_sk_find_ex(X509_OBJECT, (st), (val)) -# define sk_X509_OBJECT_delete(st, i) SKM_sk_delete(X509_OBJECT, (st), (i)) -# define sk_X509_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_OBJECT, (st), (ptr)) -# define sk_X509_OBJECT_insert(st, val, i) SKM_sk_insert(X509_OBJECT, (st), (val), (i)) -# define sk_X509_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_OBJECT, (st), (cmp)) -# define sk_X509_OBJECT_dup(st) SKM_sk_dup(X509_OBJECT, st) -# define sk_X509_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(X509_OBJECT, (st), (free_func)) -# define sk_X509_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_OBJECT, (st), (copy_func), (free_func)) -# define sk_X509_OBJECT_shift(st) SKM_sk_shift(X509_OBJECT, (st)) -# define sk_X509_OBJECT_pop(st) SKM_sk_pop(X509_OBJECT, (st)) -# define sk_X509_OBJECT_sort(st) SKM_sk_sort(X509_OBJECT, (st)) -# define sk_X509_OBJECT_is_sorted(st) SKM_sk_is_sorted(X509_OBJECT, (st)) -# define sk_X509_POLICY_DATA_new(cmp) SKM_sk_new(X509_POLICY_DATA, (cmp)) -# define sk_X509_POLICY_DATA_new_null() SKM_sk_new_null(X509_POLICY_DATA) -# define sk_X509_POLICY_DATA_free(st) SKM_sk_free(X509_POLICY_DATA, (st)) -# define sk_X509_POLICY_DATA_num(st) SKM_sk_num(X509_POLICY_DATA, (st)) -# define sk_X509_POLICY_DATA_value(st, i) SKM_sk_value(X509_POLICY_DATA, (st), (i)) -# define sk_X509_POLICY_DATA_set(st, i, val) SKM_sk_set(X509_POLICY_DATA, (st), (i), (val)) -# define sk_X509_POLICY_DATA_zero(st) SKM_sk_zero(X509_POLICY_DATA, (st)) -# define sk_X509_POLICY_DATA_push(st, val) SKM_sk_push(X509_POLICY_DATA, (st), (val)) -# define sk_X509_POLICY_DATA_unshift(st, val) SKM_sk_unshift(X509_POLICY_DATA, (st), (val)) -# define sk_X509_POLICY_DATA_find(st, val) SKM_sk_find(X509_POLICY_DATA, (st), (val)) -# define sk_X509_POLICY_DATA_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_DATA, (st), (val)) -# define sk_X509_POLICY_DATA_delete(st, i) SKM_sk_delete(X509_POLICY_DATA, (st), (i)) -# define sk_X509_POLICY_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_DATA, (st), (ptr)) -# define sk_X509_POLICY_DATA_insert(st, val, i) SKM_sk_insert(X509_POLICY_DATA, (st), (val), (i)) -# define sk_X509_POLICY_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_DATA, (st), (cmp)) -# define sk_X509_POLICY_DATA_dup(st) SKM_sk_dup(X509_POLICY_DATA, st) -# define sk_X509_POLICY_DATA_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_DATA, (st), (free_func)) -# define sk_X509_POLICY_DATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_POLICY_DATA, (st), (copy_func), (free_func)) -# define sk_X509_POLICY_DATA_shift(st) SKM_sk_shift(X509_POLICY_DATA, (st)) -# define sk_X509_POLICY_DATA_pop(st) SKM_sk_pop(X509_POLICY_DATA, (st)) -# define sk_X509_POLICY_DATA_sort(st) SKM_sk_sort(X509_POLICY_DATA, (st)) -# define sk_X509_POLICY_DATA_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_DATA, (st)) -# define sk_X509_POLICY_NODE_new(cmp) SKM_sk_new(X509_POLICY_NODE, (cmp)) -# define sk_X509_POLICY_NODE_new_null() SKM_sk_new_null(X509_POLICY_NODE) -# define sk_X509_POLICY_NODE_free(st) SKM_sk_free(X509_POLICY_NODE, (st)) -# define sk_X509_POLICY_NODE_num(st) SKM_sk_num(X509_POLICY_NODE, (st)) -# define sk_X509_POLICY_NODE_value(st, i) SKM_sk_value(X509_POLICY_NODE, (st), (i)) -# define sk_X509_POLICY_NODE_set(st, i, val) SKM_sk_set(X509_POLICY_NODE, (st), (i), (val)) -# define sk_X509_POLICY_NODE_zero(st) SKM_sk_zero(X509_POLICY_NODE, (st)) -# define sk_X509_POLICY_NODE_push(st, val) SKM_sk_push(X509_POLICY_NODE, (st), (val)) -# define sk_X509_POLICY_NODE_unshift(st, val) SKM_sk_unshift(X509_POLICY_NODE, (st), (val)) -# define sk_X509_POLICY_NODE_find(st, val) SKM_sk_find(X509_POLICY_NODE, (st), (val)) -# define sk_X509_POLICY_NODE_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_NODE, (st), (val)) -# define sk_X509_POLICY_NODE_delete(st, i) SKM_sk_delete(X509_POLICY_NODE, (st), (i)) -# define sk_X509_POLICY_NODE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_NODE, (st), (ptr)) -# define sk_X509_POLICY_NODE_insert(st, val, i) SKM_sk_insert(X509_POLICY_NODE, (st), (val), (i)) -# define sk_X509_POLICY_NODE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_NODE, (st), (cmp)) -# define sk_X509_POLICY_NODE_dup(st) SKM_sk_dup(X509_POLICY_NODE, st) -# define sk_X509_POLICY_NODE_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_NODE, (st), (free_func)) -# define sk_X509_POLICY_NODE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_POLICY_NODE, (st), (copy_func), (free_func)) -# define sk_X509_POLICY_NODE_shift(st) SKM_sk_shift(X509_POLICY_NODE, (st)) -# define sk_X509_POLICY_NODE_pop(st) SKM_sk_pop(X509_POLICY_NODE, (st)) -# define sk_X509_POLICY_NODE_sort(st) SKM_sk_sort(X509_POLICY_NODE, (st)) -# define sk_X509_POLICY_NODE_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_NODE, (st)) -# define sk_X509_PURPOSE_new(cmp) SKM_sk_new(X509_PURPOSE, (cmp)) -# define sk_X509_PURPOSE_new_null() SKM_sk_new_null(X509_PURPOSE) -# define sk_X509_PURPOSE_free(st) SKM_sk_free(X509_PURPOSE, (st)) -# define sk_X509_PURPOSE_num(st) SKM_sk_num(X509_PURPOSE, (st)) -# define sk_X509_PURPOSE_value(st, i) SKM_sk_value(X509_PURPOSE, (st), (i)) -# define sk_X509_PURPOSE_set(st, i, val) SKM_sk_set(X509_PURPOSE, (st), (i), (val)) -# define sk_X509_PURPOSE_zero(st) SKM_sk_zero(X509_PURPOSE, (st)) -# define sk_X509_PURPOSE_push(st, val) SKM_sk_push(X509_PURPOSE, (st), (val)) -# define sk_X509_PURPOSE_unshift(st, val) SKM_sk_unshift(X509_PURPOSE, (st), (val)) -# define sk_X509_PURPOSE_find(st, val) SKM_sk_find(X509_PURPOSE, (st), (val)) -# define sk_X509_PURPOSE_find_ex(st, val) SKM_sk_find_ex(X509_PURPOSE, (st), (val)) -# define sk_X509_PURPOSE_delete(st, i) SKM_sk_delete(X509_PURPOSE, (st), (i)) -# define sk_X509_PURPOSE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_PURPOSE, (st), (ptr)) -# define sk_X509_PURPOSE_insert(st, val, i) SKM_sk_insert(X509_PURPOSE, (st), (val), (i)) -# define sk_X509_PURPOSE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_PURPOSE, (st), (cmp)) -# define sk_X509_PURPOSE_dup(st) SKM_sk_dup(X509_PURPOSE, st) -# define sk_X509_PURPOSE_pop_free(st, free_func) SKM_sk_pop_free(X509_PURPOSE, (st), (free_func)) -# define sk_X509_PURPOSE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_PURPOSE, (st), (copy_func), (free_func)) -# define sk_X509_PURPOSE_shift(st) SKM_sk_shift(X509_PURPOSE, (st)) -# define sk_X509_PURPOSE_pop(st) SKM_sk_pop(X509_PURPOSE, (st)) -# define sk_X509_PURPOSE_sort(st) SKM_sk_sort(X509_PURPOSE, (st)) -# define sk_X509_PURPOSE_is_sorted(st) SKM_sk_is_sorted(X509_PURPOSE, (st)) -# define sk_X509_REVOKED_new(cmp) SKM_sk_new(X509_REVOKED, (cmp)) -# define sk_X509_REVOKED_new_null() SKM_sk_new_null(X509_REVOKED) -# define sk_X509_REVOKED_free(st) SKM_sk_free(X509_REVOKED, (st)) -# define sk_X509_REVOKED_num(st) SKM_sk_num(X509_REVOKED, (st)) -# define sk_X509_REVOKED_value(st, i) SKM_sk_value(X509_REVOKED, (st), (i)) -# define sk_X509_REVOKED_set(st, i, val) SKM_sk_set(X509_REVOKED, (st), (i), (val)) -# define sk_X509_REVOKED_zero(st) SKM_sk_zero(X509_REVOKED, (st)) -# define sk_X509_REVOKED_push(st, val) SKM_sk_push(X509_REVOKED, (st), (val)) -# define sk_X509_REVOKED_unshift(st, val) SKM_sk_unshift(X509_REVOKED, (st), (val)) -# define sk_X509_REVOKED_find(st, val) SKM_sk_find(X509_REVOKED, (st), (val)) -# define sk_X509_REVOKED_find_ex(st, val) SKM_sk_find_ex(X509_REVOKED, (st), (val)) -# define sk_X509_REVOKED_delete(st, i) SKM_sk_delete(X509_REVOKED, (st), (i)) -# define sk_X509_REVOKED_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_REVOKED, (st), (ptr)) -# define sk_X509_REVOKED_insert(st, val, i) SKM_sk_insert(X509_REVOKED, (st), (val), (i)) -# define sk_X509_REVOKED_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_REVOKED, (st), (cmp)) -# define sk_X509_REVOKED_dup(st) SKM_sk_dup(X509_REVOKED, st) -# define sk_X509_REVOKED_pop_free(st, free_func) SKM_sk_pop_free(X509_REVOKED, (st), (free_func)) -# define sk_X509_REVOKED_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_REVOKED, (st), (copy_func), (free_func)) -# define sk_X509_REVOKED_shift(st) SKM_sk_shift(X509_REVOKED, (st)) -# define sk_X509_REVOKED_pop(st) SKM_sk_pop(X509_REVOKED, (st)) -# define sk_X509_REVOKED_sort(st) SKM_sk_sort(X509_REVOKED, (st)) -# define sk_X509_REVOKED_is_sorted(st) SKM_sk_is_sorted(X509_REVOKED, (st)) -# define sk_X509_TRUST_new(cmp) SKM_sk_new(X509_TRUST, (cmp)) -# define sk_X509_TRUST_new_null() SKM_sk_new_null(X509_TRUST) -# define sk_X509_TRUST_free(st) SKM_sk_free(X509_TRUST, (st)) -# define sk_X509_TRUST_num(st) SKM_sk_num(X509_TRUST, (st)) -# define sk_X509_TRUST_value(st, i) SKM_sk_value(X509_TRUST, (st), (i)) -# define sk_X509_TRUST_set(st, i, val) SKM_sk_set(X509_TRUST, (st), (i), (val)) -# define sk_X509_TRUST_zero(st) SKM_sk_zero(X509_TRUST, (st)) -# define sk_X509_TRUST_push(st, val) SKM_sk_push(X509_TRUST, (st), (val)) -# define sk_X509_TRUST_unshift(st, val) SKM_sk_unshift(X509_TRUST, (st), (val)) -# define sk_X509_TRUST_find(st, val) SKM_sk_find(X509_TRUST, (st), (val)) -# define sk_X509_TRUST_find_ex(st, val) SKM_sk_find_ex(X509_TRUST, (st), (val)) -# define sk_X509_TRUST_delete(st, i) SKM_sk_delete(X509_TRUST, (st), (i)) -# define sk_X509_TRUST_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_TRUST, (st), (ptr)) -# define sk_X509_TRUST_insert(st, val, i) SKM_sk_insert(X509_TRUST, (st), (val), (i)) -# define sk_X509_TRUST_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_TRUST, (st), (cmp)) -# define sk_X509_TRUST_dup(st) SKM_sk_dup(X509_TRUST, st) -# define sk_X509_TRUST_pop_free(st, free_func) SKM_sk_pop_free(X509_TRUST, (st), (free_func)) -# define sk_X509_TRUST_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_TRUST, (st), (copy_func), (free_func)) -# define sk_X509_TRUST_shift(st) SKM_sk_shift(X509_TRUST, (st)) -# define sk_X509_TRUST_pop(st) SKM_sk_pop(X509_TRUST, (st)) -# define sk_X509_TRUST_sort(st) SKM_sk_sort(X509_TRUST, (st)) -# define sk_X509_TRUST_is_sorted(st) SKM_sk_is_sorted(X509_TRUST, (st)) -# define sk_X509_VERIFY_PARAM_new(cmp) SKM_sk_new(X509_VERIFY_PARAM, (cmp)) -# define sk_X509_VERIFY_PARAM_new_null() SKM_sk_new_null(X509_VERIFY_PARAM) -# define sk_X509_VERIFY_PARAM_free(st) SKM_sk_free(X509_VERIFY_PARAM, (st)) -# define sk_X509_VERIFY_PARAM_num(st) SKM_sk_num(X509_VERIFY_PARAM, (st)) -# define sk_X509_VERIFY_PARAM_value(st, i) SKM_sk_value(X509_VERIFY_PARAM, (st), (i)) -# define sk_X509_VERIFY_PARAM_set(st, i, val) SKM_sk_set(X509_VERIFY_PARAM, (st), (i), (val)) -# define sk_X509_VERIFY_PARAM_zero(st) SKM_sk_zero(X509_VERIFY_PARAM, (st)) -# define sk_X509_VERIFY_PARAM_push(st, val) SKM_sk_push(X509_VERIFY_PARAM, (st), (val)) -# define sk_X509_VERIFY_PARAM_unshift(st, val) SKM_sk_unshift(X509_VERIFY_PARAM, (st), (val)) -# define sk_X509_VERIFY_PARAM_find(st, val) SKM_sk_find(X509_VERIFY_PARAM, (st), (val)) -# define sk_X509_VERIFY_PARAM_find_ex(st, val) SKM_sk_find_ex(X509_VERIFY_PARAM, (st), (val)) -# define sk_X509_VERIFY_PARAM_delete(st, i) SKM_sk_delete(X509_VERIFY_PARAM, (st), (i)) -# define sk_X509_VERIFY_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_VERIFY_PARAM, (st), (ptr)) -# define sk_X509_VERIFY_PARAM_insert(st, val, i) SKM_sk_insert(X509_VERIFY_PARAM, (st), (val), (i)) -# define sk_X509_VERIFY_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_VERIFY_PARAM, (st), (cmp)) -# define sk_X509_VERIFY_PARAM_dup(st) SKM_sk_dup(X509_VERIFY_PARAM, st) -# define sk_X509_VERIFY_PARAM_pop_free(st, free_func) SKM_sk_pop_free(X509_VERIFY_PARAM, (st), (free_func)) -# define sk_X509_VERIFY_PARAM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_VERIFY_PARAM, (st), (copy_func), (free_func)) -# define sk_X509_VERIFY_PARAM_shift(st) SKM_sk_shift(X509_VERIFY_PARAM, (st)) -# define sk_X509_VERIFY_PARAM_pop(st) SKM_sk_pop(X509_VERIFY_PARAM, (st)) -# define sk_X509_VERIFY_PARAM_sort(st) SKM_sk_sort(X509_VERIFY_PARAM, (st)) -# define sk_X509_VERIFY_PARAM_is_sorted(st) SKM_sk_is_sorted(X509_VERIFY_PARAM, (st)) -# define sk_nid_triple_new(cmp) SKM_sk_new(nid_triple, (cmp)) -# define sk_nid_triple_new_null() SKM_sk_new_null(nid_triple) -# define sk_nid_triple_free(st) SKM_sk_free(nid_triple, (st)) -# define sk_nid_triple_num(st) SKM_sk_num(nid_triple, (st)) -# define sk_nid_triple_value(st, i) SKM_sk_value(nid_triple, (st), (i)) -# define sk_nid_triple_set(st, i, val) SKM_sk_set(nid_triple, (st), (i), (val)) -# define sk_nid_triple_zero(st) SKM_sk_zero(nid_triple, (st)) -# define sk_nid_triple_push(st, val) SKM_sk_push(nid_triple, (st), (val)) -# define sk_nid_triple_unshift(st, val) SKM_sk_unshift(nid_triple, (st), (val)) -# define sk_nid_triple_find(st, val) SKM_sk_find(nid_triple, (st), (val)) -# define sk_nid_triple_find_ex(st, val) SKM_sk_find_ex(nid_triple, (st), (val)) -# define sk_nid_triple_delete(st, i) SKM_sk_delete(nid_triple, (st), (i)) -# define sk_nid_triple_delete_ptr(st, ptr) SKM_sk_delete_ptr(nid_triple, (st), (ptr)) -# define sk_nid_triple_insert(st, val, i) SKM_sk_insert(nid_triple, (st), (val), (i)) -# define sk_nid_triple_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(nid_triple, (st), (cmp)) -# define sk_nid_triple_dup(st) SKM_sk_dup(nid_triple, st) -# define sk_nid_triple_pop_free(st, free_func) SKM_sk_pop_free(nid_triple, (st), (free_func)) -# define sk_nid_triple_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(nid_triple, (st), (copy_func), (free_func)) -# define sk_nid_triple_shift(st) SKM_sk_shift(nid_triple, (st)) -# define sk_nid_triple_pop(st) SKM_sk_pop(nid_triple, (st)) -# define sk_nid_triple_sort(st) SKM_sk_sort(nid_triple, (st)) -# define sk_nid_triple_is_sorted(st) SKM_sk_is_sorted(nid_triple, (st)) -# define sk_void_new(cmp) SKM_sk_new(void, (cmp)) -# define sk_void_new_null() SKM_sk_new_null(void) -# define sk_void_free(st) SKM_sk_free(void, (st)) -# define sk_void_num(st) SKM_sk_num(void, (st)) -# define sk_void_value(st, i) SKM_sk_value(void, (st), (i)) -# define sk_void_set(st, i, val) SKM_sk_set(void, (st), (i), (val)) -# define sk_void_zero(st) SKM_sk_zero(void, (st)) -# define sk_void_push(st, val) SKM_sk_push(void, (st), (val)) -# define sk_void_unshift(st, val) SKM_sk_unshift(void, (st), (val)) -# define sk_void_find(st, val) SKM_sk_find(void, (st), (val)) -# define sk_void_find_ex(st, val) SKM_sk_find_ex(void, (st), (val)) -# define sk_void_delete(st, i) SKM_sk_delete(void, (st), (i)) -# define sk_void_delete_ptr(st, ptr) SKM_sk_delete_ptr(void, (st), (ptr)) -# define sk_void_insert(st, val, i) SKM_sk_insert(void, (st), (val), (i)) -# define sk_void_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(void, (st), (cmp)) -# define sk_void_dup(st) SKM_sk_dup(void, st) -# define sk_void_pop_free(st, free_func) SKM_sk_pop_free(void, (st), (free_func)) -# define sk_void_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(void, (st), (copy_func), (free_func)) -# define sk_void_shift(st) SKM_sk_shift(void, (st)) -# define sk_void_pop(st) SKM_sk_pop(void, (st)) -# define sk_void_sort(st) SKM_sk_sort(void, (st)) -# define sk_void_is_sorted(st) SKM_sk_is_sorted(void, (st)) -# define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp))) -# define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null()) -# define sk_OPENSSL_STRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val)) -# define sk_OPENSSL_STRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val)) -# define sk_OPENSSL_STRING_value(st, i) ((OPENSSL_STRING)sk_value(CHECKED_STACK_OF(OPENSSL_STRING, st), i)) -# define sk_OPENSSL_STRING_num(st) SKM_sk_num(OPENSSL_STRING, st) -# define sk_OPENSSL_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_FREE_FUNC(char, free_func)) -# define sk_OPENSSL_STRING_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_STRING) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_COPY_FUNC(char, copy_func), CHECKED_SK_FREE_FUNC(char, free_func))) -# define sk_OPENSSL_STRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val), i) -# define sk_OPENSSL_STRING_free(st) SKM_sk_free(OPENSSL_STRING, st) -# define sk_OPENSSL_STRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_STRING, st), i, CHECKED_PTR_OF(char, val)) -# define sk_OPENSSL_STRING_zero(st) SKM_sk_zero(OPENSSL_STRING, (st)) -# define sk_OPENSSL_STRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val)) -# define sk_OPENSSL_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_CONST_PTR_OF(char, val)) -# define sk_OPENSSL_STRING_delete(st, i) SKM_sk_delete(OPENSSL_STRING, (st), (i)) -# define sk_OPENSSL_STRING_delete_ptr(st, ptr) (OPENSSL_STRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, ptr)) -# define sk_OPENSSL_STRING_set_cmp_func(st, cmp) \ - ((int (*)(const char * const *,const char * const *)) \ - sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_CMP_FUNC(char, cmp))) -# define sk_OPENSSL_STRING_dup(st) SKM_sk_dup(OPENSSL_STRING, st) -# define sk_OPENSSL_STRING_shift(st) SKM_sk_shift(OPENSSL_STRING, (st)) -# define sk_OPENSSL_STRING_pop(st) (char *)sk_pop(CHECKED_STACK_OF(OPENSSL_STRING, st)) -# define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st)) -# define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st)) -# define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp))) -# define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null()) -# define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) -# define sk_OPENSSL_BLOCK_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) -# define sk_OPENSSL_BLOCK_value(st, i) ((OPENSSL_BLOCK)sk_value(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i)) -# define sk_OPENSSL_BLOCK_num(st) SKM_sk_num(OPENSSL_BLOCK, st) -# define sk_OPENSSL_BLOCK_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_FREE_FUNC(void, free_func)) -# define sk_OPENSSL_BLOCK_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_BLOCK) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_COPY_FUNC(void, copy_func), CHECKED_SK_FREE_FUNC(void, free_func))) -# define sk_OPENSSL_BLOCK_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val), i) -# define sk_OPENSSL_BLOCK_free(st) SKM_sk_free(OPENSSL_BLOCK, st) -# define sk_OPENSSL_BLOCK_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i, CHECKED_PTR_OF(void, val)) -# define sk_OPENSSL_BLOCK_zero(st) SKM_sk_zero(OPENSSL_BLOCK, (st)) -# define sk_OPENSSL_BLOCK_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) -# define sk_OPENSSL_BLOCK_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_CONST_PTR_OF(void, val)) -# define sk_OPENSSL_BLOCK_delete(st, i) SKM_sk_delete(OPENSSL_BLOCK, (st), (i)) -# define sk_OPENSSL_BLOCK_delete_ptr(st, ptr) (OPENSSL_BLOCK *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, ptr)) -# define sk_OPENSSL_BLOCK_set_cmp_func(st, cmp) \ - ((int (*)(const void * const *,const void * const *)) \ - sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_CMP_FUNC(void, cmp))) -# define sk_OPENSSL_BLOCK_dup(st) SKM_sk_dup(OPENSSL_BLOCK, st) -# define sk_OPENSSL_BLOCK_shift(st) SKM_sk_shift(OPENSSL_BLOCK, (st)) -# define sk_OPENSSL_BLOCK_pop(st) (void *)sk_pop(CHECKED_STACK_OF(OPENSSL_BLOCK, st)) -# define sk_OPENSSL_BLOCK_sort(st) SKM_sk_sort(OPENSSL_BLOCK, (st)) -# define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st)) -# define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) -# define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null()) -# define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) -# define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) -# define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i)) -# define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st) -# define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_FREE_FUNC(OPENSSL_STRING, free_func)) -# define sk_OPENSSL_PSTRING_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_PSTRING) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_COPY_FUNC(OPENSSL_STRING, copy_func), CHECKED_SK_FREE_FUNC(OPENSSL_STRING, free_func))) -# define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val), i) -# define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st) -# define sk_OPENSSL_PSTRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i, CHECKED_PTR_OF(OPENSSL_STRING, val)) -# define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st)) -# define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) -# define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val)) -# define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i)) -# define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, ptr)) -# define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \ - ((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \ - sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) -# define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st) -# define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st)) -# define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop(CHECKED_STACK_OF(OPENSSL_PSTRING, st)) -# define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st)) -# define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st)) -# define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_ACCESS_DESCRIPTION(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_ACCESS_DESCRIPTION(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_ASN1_INTEGER(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_ASN1_INTEGER(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_ASN1_OBJECT(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_ASN1_OBJECT(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_ASN1_TYPE(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_ASN1_TYPE(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ASN1_UTF8STRING, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ASN1_UTF8STRING, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_ASN1_UTF8STRING(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ASN1_UTF8STRING, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_ASN1_UTF8STRING(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ASN1_UTF8STRING, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_DIST_POINT(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_DIST_POINT(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_ESS_CERT_ID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(ESS_CERT_ID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_ESS_CERT_ID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(ESS_CERT_ID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_ESS_CERT_ID(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(ESS_CERT_ID, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_ESS_CERT_ID(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(ESS_CERT_ID, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_EVP_MD(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(EVP_MD, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_EVP_MD(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(EVP_MD, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_EVP_MD(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(EVP_MD, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_EVP_MD(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(EVP_MD, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_GENERAL_NAME(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_GENERAL_NAME(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_OCSP_ONEREQ(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(OCSP_ONEREQ, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_OCSP_ONEREQ(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(OCSP_ONEREQ, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_OCSP_SINGLERESP(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(OCSP_SINGLERESP, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_OCSP_SINGLERESP(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(OCSP_SINGLERESP, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_PKCS12_SAFEBAG(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_PKCS12_SAFEBAG(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_PKCS7(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_PKCS7(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_PKCS7_RECIP_INFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_PKCS7_RECIP_INFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_PKCS7_SIGNER_INFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_PKCS7_SIGNER_INFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_POLICYINFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_POLICYINFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_POLICYQUALINFO(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_POLICYQUALINFO(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_SXNETID(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_SXNETID(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_X509(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_X509(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_X509_ALGOR(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_X509_ALGOR(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_X509_ATTRIBUTE(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_X509_ATTRIBUTE(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_X509_CRL(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_X509_CRL(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_X509_EXTENSION(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_X509_EXTENSION(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_X509_NAME_ENTRY(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_X509_NAME_ENTRY(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func)) -# define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -# define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -# define ASN1_seq_pack_X509_REVOKED(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len)) -# define ASN1_seq_unpack_X509_REVOKED(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func)) -# define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \ - SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) -# define PKCS12_decrypt_d2i_PKCS7(algor, d2i_func, free_func, pass, passlen, oct, seq) \ - SKM_PKCS12_decrypt_d2i(PKCS7, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq)) -# define lh_ADDED_OBJ_new() LHM_lh_new(ADDED_OBJ,added_obj) -# define lh_ADDED_OBJ_insert(lh,inst) LHM_lh_insert(ADDED_OBJ,lh,inst) -# define lh_ADDED_OBJ_retrieve(lh,inst) LHM_lh_retrieve(ADDED_OBJ,lh,inst) -# define lh_ADDED_OBJ_delete(lh,inst) LHM_lh_delete(ADDED_OBJ,lh,inst) -# define lh_ADDED_OBJ_doall(lh,fn) LHM_lh_doall(ADDED_OBJ,lh,fn) -# define lh_ADDED_OBJ_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(ADDED_OBJ,lh,fn,arg_type,arg) -# define lh_ADDED_OBJ_error(lh) LHM_lh_error(ADDED_OBJ,lh) -# define lh_ADDED_OBJ_num_items(lh) LHM_lh_num_items(ADDED_OBJ,lh) -# define lh_ADDED_OBJ_down_load(lh) LHM_lh_down_load(ADDED_OBJ,lh) -# define lh_ADDED_OBJ_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(ADDED_OBJ,lh,out) -# define lh_ADDED_OBJ_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(ADDED_OBJ,lh,out) -# define lh_ADDED_OBJ_stats_bio(lh,out) \ - LHM_lh_stats_bio(ADDED_OBJ,lh,out) -# define lh_ADDED_OBJ_free(lh) LHM_lh_free(ADDED_OBJ,lh) -# define lh_APP_INFO_new() LHM_lh_new(APP_INFO,app_info) -# define lh_APP_INFO_insert(lh,inst) LHM_lh_insert(APP_INFO,lh,inst) -# define lh_APP_INFO_retrieve(lh,inst) LHM_lh_retrieve(APP_INFO,lh,inst) -# define lh_APP_INFO_delete(lh,inst) LHM_lh_delete(APP_INFO,lh,inst) -# define lh_APP_INFO_doall(lh,fn) LHM_lh_doall(APP_INFO,lh,fn) -# define lh_APP_INFO_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(APP_INFO,lh,fn,arg_type,arg) -# define lh_APP_INFO_error(lh) LHM_lh_error(APP_INFO,lh) -# define lh_APP_INFO_num_items(lh) LHM_lh_num_items(APP_INFO,lh) -# define lh_APP_INFO_down_load(lh) LHM_lh_down_load(APP_INFO,lh) -# define lh_APP_INFO_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(APP_INFO,lh,out) -# define lh_APP_INFO_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(APP_INFO,lh,out) -# define lh_APP_INFO_stats_bio(lh,out) \ - LHM_lh_stats_bio(APP_INFO,lh,out) -# define lh_APP_INFO_free(lh) LHM_lh_free(APP_INFO,lh) -# define lh_CONF_VALUE_new() LHM_lh_new(CONF_VALUE,conf_value) -# define lh_CONF_VALUE_insert(lh,inst) LHM_lh_insert(CONF_VALUE,lh,inst) -# define lh_CONF_VALUE_retrieve(lh,inst) LHM_lh_retrieve(CONF_VALUE,lh,inst) -# define lh_CONF_VALUE_delete(lh,inst) LHM_lh_delete(CONF_VALUE,lh,inst) -# define lh_CONF_VALUE_doall(lh,fn) LHM_lh_doall(CONF_VALUE,lh,fn) -# define lh_CONF_VALUE_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(CONF_VALUE,lh,fn,arg_type,arg) -# define lh_CONF_VALUE_error(lh) LHM_lh_error(CONF_VALUE,lh) -# define lh_CONF_VALUE_num_items(lh) LHM_lh_num_items(CONF_VALUE,lh) -# define lh_CONF_VALUE_down_load(lh) LHM_lh_down_load(CONF_VALUE,lh) -# define lh_CONF_VALUE_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(CONF_VALUE,lh,out) -# define lh_CONF_VALUE_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(CONF_VALUE,lh,out) -# define lh_CONF_VALUE_stats_bio(lh,out) \ - LHM_lh_stats_bio(CONF_VALUE,lh,out) -# define lh_CONF_VALUE_free(lh) LHM_lh_free(CONF_VALUE,lh) -# define lh_ENGINE_PILE_new() LHM_lh_new(ENGINE_PILE,engine_pile) -# define lh_ENGINE_PILE_insert(lh,inst) LHM_lh_insert(ENGINE_PILE,lh,inst) -# define lh_ENGINE_PILE_retrieve(lh,inst) LHM_lh_retrieve(ENGINE_PILE,lh,inst) -# define lh_ENGINE_PILE_delete(lh,inst) LHM_lh_delete(ENGINE_PILE,lh,inst) -# define lh_ENGINE_PILE_doall(lh,fn) LHM_lh_doall(ENGINE_PILE,lh,fn) -# define lh_ENGINE_PILE_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(ENGINE_PILE,lh,fn,arg_type,arg) -# define lh_ENGINE_PILE_error(lh) LHM_lh_error(ENGINE_PILE,lh) -# define lh_ENGINE_PILE_num_items(lh) LHM_lh_num_items(ENGINE_PILE,lh) -# define lh_ENGINE_PILE_down_load(lh) LHM_lh_down_load(ENGINE_PILE,lh) -# define lh_ENGINE_PILE_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(ENGINE_PILE,lh,out) -# define lh_ENGINE_PILE_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(ENGINE_PILE,lh,out) -# define lh_ENGINE_PILE_stats_bio(lh,out) \ - LHM_lh_stats_bio(ENGINE_PILE,lh,out) -# define lh_ENGINE_PILE_free(lh) LHM_lh_free(ENGINE_PILE,lh) -# define lh_ERR_STATE_new() LHM_lh_new(ERR_STATE,err_state) -# define lh_ERR_STATE_insert(lh,inst) LHM_lh_insert(ERR_STATE,lh,inst) -# define lh_ERR_STATE_retrieve(lh,inst) LHM_lh_retrieve(ERR_STATE,lh,inst) -# define lh_ERR_STATE_delete(lh,inst) LHM_lh_delete(ERR_STATE,lh,inst) -# define lh_ERR_STATE_doall(lh,fn) LHM_lh_doall(ERR_STATE,lh,fn) -# define lh_ERR_STATE_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(ERR_STATE,lh,fn,arg_type,arg) -# define lh_ERR_STATE_error(lh) LHM_lh_error(ERR_STATE,lh) -# define lh_ERR_STATE_num_items(lh) LHM_lh_num_items(ERR_STATE,lh) -# define lh_ERR_STATE_down_load(lh) LHM_lh_down_load(ERR_STATE,lh) -# define lh_ERR_STATE_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(ERR_STATE,lh,out) -# define lh_ERR_STATE_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(ERR_STATE,lh,out) -# define lh_ERR_STATE_stats_bio(lh,out) \ - LHM_lh_stats_bio(ERR_STATE,lh,out) -# define lh_ERR_STATE_free(lh) LHM_lh_free(ERR_STATE,lh) -# define lh_ERR_STRING_DATA_new() LHM_lh_new(ERR_STRING_DATA,err_string_data) -# define lh_ERR_STRING_DATA_insert(lh,inst) LHM_lh_insert(ERR_STRING_DATA,lh,inst) -# define lh_ERR_STRING_DATA_retrieve(lh,inst) LHM_lh_retrieve(ERR_STRING_DATA,lh,inst) -# define lh_ERR_STRING_DATA_delete(lh,inst) LHM_lh_delete(ERR_STRING_DATA,lh,inst) -# define lh_ERR_STRING_DATA_doall(lh,fn) LHM_lh_doall(ERR_STRING_DATA,lh,fn) -# define lh_ERR_STRING_DATA_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(ERR_STRING_DATA,lh,fn,arg_type,arg) -# define lh_ERR_STRING_DATA_error(lh) LHM_lh_error(ERR_STRING_DATA,lh) -# define lh_ERR_STRING_DATA_num_items(lh) LHM_lh_num_items(ERR_STRING_DATA,lh) -# define lh_ERR_STRING_DATA_down_load(lh) LHM_lh_down_load(ERR_STRING_DATA,lh) -# define lh_ERR_STRING_DATA_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(ERR_STRING_DATA,lh,out) -# define lh_ERR_STRING_DATA_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(ERR_STRING_DATA,lh,out) -# define lh_ERR_STRING_DATA_stats_bio(lh,out) \ - LHM_lh_stats_bio(ERR_STRING_DATA,lh,out) -# define lh_ERR_STRING_DATA_free(lh) LHM_lh_free(ERR_STRING_DATA,lh) -# define lh_EX_CLASS_ITEM_new() LHM_lh_new(EX_CLASS_ITEM,ex_class_item) -# define lh_EX_CLASS_ITEM_insert(lh,inst) LHM_lh_insert(EX_CLASS_ITEM,lh,inst) -# define lh_EX_CLASS_ITEM_retrieve(lh,inst) LHM_lh_retrieve(EX_CLASS_ITEM,lh,inst) -# define lh_EX_CLASS_ITEM_delete(lh,inst) LHM_lh_delete(EX_CLASS_ITEM,lh,inst) -# define lh_EX_CLASS_ITEM_doall(lh,fn) LHM_lh_doall(EX_CLASS_ITEM,lh,fn) -# define lh_EX_CLASS_ITEM_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(EX_CLASS_ITEM,lh,fn,arg_type,arg) -# define lh_EX_CLASS_ITEM_error(lh) LHM_lh_error(EX_CLASS_ITEM,lh) -# define lh_EX_CLASS_ITEM_num_items(lh) LHM_lh_num_items(EX_CLASS_ITEM,lh) -# define lh_EX_CLASS_ITEM_down_load(lh) LHM_lh_down_load(EX_CLASS_ITEM,lh) -# define lh_EX_CLASS_ITEM_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(EX_CLASS_ITEM,lh,out) -# define lh_EX_CLASS_ITEM_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(EX_CLASS_ITEM,lh,out) -# define lh_EX_CLASS_ITEM_stats_bio(lh,out) \ - LHM_lh_stats_bio(EX_CLASS_ITEM,lh,out) -# define lh_EX_CLASS_ITEM_free(lh) LHM_lh_free(EX_CLASS_ITEM,lh) -# define lh_FUNCTION_new() LHM_lh_new(FUNCTION,function) -# define lh_FUNCTION_insert(lh,inst) LHM_lh_insert(FUNCTION,lh,inst) -# define lh_FUNCTION_retrieve(lh,inst) LHM_lh_retrieve(FUNCTION,lh,inst) -# define lh_FUNCTION_delete(lh,inst) LHM_lh_delete(FUNCTION,lh,inst) -# define lh_FUNCTION_doall(lh,fn) LHM_lh_doall(FUNCTION,lh,fn) -# define lh_FUNCTION_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(FUNCTION,lh,fn,arg_type,arg) -# define lh_FUNCTION_error(lh) LHM_lh_error(FUNCTION,lh) -# define lh_FUNCTION_num_items(lh) LHM_lh_num_items(FUNCTION,lh) -# define lh_FUNCTION_down_load(lh) LHM_lh_down_load(FUNCTION,lh) -# define lh_FUNCTION_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(FUNCTION,lh,out) -# define lh_FUNCTION_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(FUNCTION,lh,out) -# define lh_FUNCTION_stats_bio(lh,out) \ - LHM_lh_stats_bio(FUNCTION,lh,out) -# define lh_FUNCTION_free(lh) LHM_lh_free(FUNCTION,lh) -# define lh_MEM_new() LHM_lh_new(MEM,mem) -# define lh_MEM_insert(lh,inst) LHM_lh_insert(MEM,lh,inst) -# define lh_MEM_retrieve(lh,inst) LHM_lh_retrieve(MEM,lh,inst) -# define lh_MEM_delete(lh,inst) LHM_lh_delete(MEM,lh,inst) -# define lh_MEM_doall(lh,fn) LHM_lh_doall(MEM,lh,fn) -# define lh_MEM_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(MEM,lh,fn,arg_type,arg) -# define lh_MEM_error(lh) LHM_lh_error(MEM,lh) -# define lh_MEM_num_items(lh) LHM_lh_num_items(MEM,lh) -# define lh_MEM_down_load(lh) LHM_lh_down_load(MEM,lh) -# define lh_MEM_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(MEM,lh,out) -# define lh_MEM_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(MEM,lh,out) -# define lh_MEM_stats_bio(lh,out) \ - LHM_lh_stats_bio(MEM,lh,out) -# define lh_MEM_free(lh) LHM_lh_free(MEM,lh) -# define lh_OBJ_NAME_new() LHM_lh_new(OBJ_NAME,obj_name) -# define lh_OBJ_NAME_insert(lh,inst) LHM_lh_insert(OBJ_NAME,lh,inst) -# define lh_OBJ_NAME_retrieve(lh,inst) LHM_lh_retrieve(OBJ_NAME,lh,inst) -# define lh_OBJ_NAME_delete(lh,inst) LHM_lh_delete(OBJ_NAME,lh,inst) -# define lh_OBJ_NAME_doall(lh,fn) LHM_lh_doall(OBJ_NAME,lh,fn) -# define lh_OBJ_NAME_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(OBJ_NAME,lh,fn,arg_type,arg) -# define lh_OBJ_NAME_error(lh) LHM_lh_error(OBJ_NAME,lh) -# define lh_OBJ_NAME_num_items(lh) LHM_lh_num_items(OBJ_NAME,lh) -# define lh_OBJ_NAME_down_load(lh) LHM_lh_down_load(OBJ_NAME,lh) -# define lh_OBJ_NAME_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(OBJ_NAME,lh,out) -# define lh_OBJ_NAME_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(OBJ_NAME,lh,out) -# define lh_OBJ_NAME_stats_bio(lh,out) \ - LHM_lh_stats_bio(OBJ_NAME,lh,out) -# define lh_OBJ_NAME_free(lh) LHM_lh_free(OBJ_NAME,lh) -# define lh_OPENSSL_CSTRING_new() LHM_lh_new(OPENSSL_CSTRING,openssl_cstring) -# define lh_OPENSSL_CSTRING_insert(lh,inst) LHM_lh_insert(OPENSSL_CSTRING,lh,inst) -# define lh_OPENSSL_CSTRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_CSTRING,lh,inst) -# define lh_OPENSSL_CSTRING_delete(lh,inst) LHM_lh_delete(OPENSSL_CSTRING,lh,inst) -# define lh_OPENSSL_CSTRING_doall(lh,fn) LHM_lh_doall(OPENSSL_CSTRING,lh,fn) -# define lh_OPENSSL_CSTRING_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(OPENSSL_CSTRING,lh,fn,arg_type,arg) -# define lh_OPENSSL_CSTRING_error(lh) LHM_lh_error(OPENSSL_CSTRING,lh) -# define lh_OPENSSL_CSTRING_num_items(lh) LHM_lh_num_items(OPENSSL_CSTRING,lh) -# define lh_OPENSSL_CSTRING_down_load(lh) LHM_lh_down_load(OPENSSL_CSTRING,lh) -# define lh_OPENSSL_CSTRING_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(OPENSSL_CSTRING,lh,out) -# define lh_OPENSSL_CSTRING_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(OPENSSL_CSTRING,lh,out) -# define lh_OPENSSL_CSTRING_stats_bio(lh,out) \ - LHM_lh_stats_bio(OPENSSL_CSTRING,lh,out) -# define lh_OPENSSL_CSTRING_free(lh) LHM_lh_free(OPENSSL_CSTRING,lh) -# define lh_OPENSSL_STRING_new() LHM_lh_new(OPENSSL_STRING,openssl_string) -# define lh_OPENSSL_STRING_insert(lh,inst) LHM_lh_insert(OPENSSL_STRING,lh,inst) -# define lh_OPENSSL_STRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_STRING,lh,inst) -# define lh_OPENSSL_STRING_delete(lh,inst) LHM_lh_delete(OPENSSL_STRING,lh,inst) -# define lh_OPENSSL_STRING_doall(lh,fn) LHM_lh_doall(OPENSSL_STRING,lh,fn) -# define lh_OPENSSL_STRING_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(OPENSSL_STRING,lh,fn,arg_type,arg) -# define lh_OPENSSL_STRING_error(lh) LHM_lh_error(OPENSSL_STRING,lh) -# define lh_OPENSSL_STRING_num_items(lh) LHM_lh_num_items(OPENSSL_STRING,lh) -# define lh_OPENSSL_STRING_down_load(lh) LHM_lh_down_load(OPENSSL_STRING,lh) -# define lh_OPENSSL_STRING_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(OPENSSL_STRING,lh,out) -# define lh_OPENSSL_STRING_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(OPENSSL_STRING,lh,out) -# define lh_OPENSSL_STRING_stats_bio(lh,out) \ - LHM_lh_stats_bio(OPENSSL_STRING,lh,out) -# define lh_OPENSSL_STRING_free(lh) LHM_lh_free(OPENSSL_STRING,lh) -# define lh_SSL_SESSION_new() LHM_lh_new(SSL_SESSION,ssl_session) -# define lh_SSL_SESSION_insert(lh,inst) LHM_lh_insert(SSL_SESSION,lh,inst) -# define lh_SSL_SESSION_retrieve(lh,inst) LHM_lh_retrieve(SSL_SESSION,lh,inst) -# define lh_SSL_SESSION_delete(lh,inst) LHM_lh_delete(SSL_SESSION,lh,inst) -# define lh_SSL_SESSION_doall(lh,fn) LHM_lh_doall(SSL_SESSION,lh,fn) -# define lh_SSL_SESSION_doall_arg(lh,fn,arg_type,arg) \ - LHM_lh_doall_arg(SSL_SESSION,lh,fn,arg_type,arg) -# define lh_SSL_SESSION_error(lh) LHM_lh_error(SSL_SESSION,lh) -# define lh_SSL_SESSION_num_items(lh) LHM_lh_num_items(SSL_SESSION,lh) -# define lh_SSL_SESSION_down_load(lh) LHM_lh_down_load(SSL_SESSION,lh) -# define lh_SSL_SESSION_node_stats_bio(lh,out) \ - LHM_lh_node_stats_bio(SSL_SESSION,lh,out) -# define lh_SSL_SESSION_node_usage_stats_bio(lh,out) \ - LHM_lh_node_usage_stats_bio(SSL_SESSION,lh,out) -# define lh_SSL_SESSION_stats_bio(lh,out) \ - LHM_lh_stats_bio(SSL_SESSION,lh,out) -# define lh_SSL_SESSION_free(lh) LHM_lh_free(SSL_SESSION,lh) -#ifdef __cplusplus -} -#endif -#endif /* !defined HEADER_SAFESTACK_H */ diff --git a/libs/win32/openssl/include/openssl/seed.h b/libs/win32/openssl/include/openssl/seed.h deleted file mode 100644 index 8cbf0d9281..0000000000 --- a/libs/win32/openssl/include/openssl/seed.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Neither the name of author nor the names of its contributors may - * be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ -/* ==================================================================== - * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_SEED_H -# define HEADER_SEED_H - -# include -# include -# include - -# ifdef OPENSSL_NO_SEED -# error SEED is disabled. -# endif - -/* look whether we need 'long' to get 32 bits */ -# ifdef AES_LONG -# ifndef SEED_LONG -# define SEED_LONG 1 -# endif -# endif - -# if !defined(NO_SYS_TYPES_H) -# include -# endif - -# define SEED_BLOCK_SIZE 16 -# define SEED_KEY_LENGTH 16 - - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct seed_key_st { -# ifdef SEED_LONG - unsigned long data[32]; -# else - unsigned int data[32]; -# endif -} SEED_KEY_SCHEDULE; - -# ifdef OPENSSL_FIPS -void private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], - SEED_KEY_SCHEDULE *ks); -# endif -void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], - SEED_KEY_SCHEDULE *ks); - -void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], - unsigned char d[SEED_BLOCK_SIZE], - const SEED_KEY_SCHEDULE *ks); -void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE], - unsigned char d[SEED_BLOCK_SIZE], - const SEED_KEY_SCHEDULE *ks); - -void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out, - const SEED_KEY_SCHEDULE *ks, int enc); -void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len, - const SEED_KEY_SCHEDULE *ks, - unsigned char ivec[SEED_BLOCK_SIZE], int enc); -void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out, - size_t len, const SEED_KEY_SCHEDULE *ks, - unsigned char ivec[SEED_BLOCK_SIZE], int *num, - int enc); -void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, - size_t len, const SEED_KEY_SCHEDULE *ks, - unsigned char ivec[SEED_BLOCK_SIZE], int *num); - -#ifdef __cplusplus -} -#endif - -#endif /* HEADER_SEED_H */ diff --git a/libs/win32/openssl/include/openssl/sha.h b/libs/win32/openssl/include/openssl/sha.h deleted file mode 100644 index e5169e4fee..0000000000 --- a/libs/win32/openssl/include/openssl/sha.h +++ /dev/null @@ -1,214 +0,0 @@ -/* crypto/sha/sha.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_SHA_H -# define HEADER_SHA_H - -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1)) -# error SHA is disabled. -# endif - -# if defined(OPENSSL_FIPS) -# define FIPS_SHA_SIZE_T size_t -# endif - -/*- - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then ! - * ! SHA_LONG_LOG2 has to be defined along. ! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - */ - -# if defined(__LP32__) -# define SHA_LONG unsigned long -# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) -# define SHA_LONG unsigned long -# define SHA_LONG_LOG2 3 -# else -# define SHA_LONG unsigned int -# endif - -# define SHA_LBLOCK 16 -# define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a - * contiguous array of 32 bit wide - * big-endian values. */ -# define SHA_LAST_BLOCK (SHA_CBLOCK-8) -# define SHA_DIGEST_LENGTH 20 - -typedef struct SHAstate_st { - SHA_LONG h0, h1, h2, h3, h4; - SHA_LONG Nl, Nh; - SHA_LONG data[SHA_LBLOCK]; - unsigned int num; -} SHA_CTX; - -# ifndef OPENSSL_NO_SHA0 -# ifdef OPENSSL_FIPS -int private_SHA_Init(SHA_CTX *c); -# endif -int SHA_Init(SHA_CTX *c); -int SHA_Update(SHA_CTX *c, const void *data, size_t len); -int SHA_Final(unsigned char *md, SHA_CTX *c); -unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md); -void SHA_Transform(SHA_CTX *c, const unsigned char *data); -# endif -# ifndef OPENSSL_NO_SHA1 -# ifdef OPENSSL_FIPS -int private_SHA1_Init(SHA_CTX *c); -# endif -int SHA1_Init(SHA_CTX *c); -int SHA1_Update(SHA_CTX *c, const void *data, size_t len); -int SHA1_Final(unsigned char *md, SHA_CTX *c); -unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); -void SHA1_Transform(SHA_CTX *c, const unsigned char *data); -# endif - -# define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a - * contiguous array of 32 bit wide - * big-endian values. */ -# define SHA224_DIGEST_LENGTH 28 -# define SHA256_DIGEST_LENGTH 32 - -typedef struct SHA256state_st { - SHA_LONG h[8]; - SHA_LONG Nl, Nh; - SHA_LONG data[SHA_LBLOCK]; - unsigned int num, md_len; -} SHA256_CTX; - -# ifndef OPENSSL_NO_SHA256 -# ifdef OPENSSL_FIPS -int private_SHA224_Init(SHA256_CTX *c); -int private_SHA256_Init(SHA256_CTX *c); -# endif -int SHA224_Init(SHA256_CTX *c); -int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); -int SHA224_Final(unsigned char *md, SHA256_CTX *c); -unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md); -int SHA256_Init(SHA256_CTX *c); -int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); -int SHA256_Final(unsigned char *md, SHA256_CTX *c); -unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md); -void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); -# endif - -# define SHA384_DIGEST_LENGTH 48 -# define SHA512_DIGEST_LENGTH 64 - -# ifndef OPENSSL_NO_SHA512 -/* - * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 - * being exactly 64-bit wide. See Implementation Notes in sha512.c - * for further details. - */ -/* - * SHA-512 treats input data as a - * contiguous array of 64 bit - * wide big-endian values. - */ -# define SHA512_CBLOCK (SHA_LBLOCK*8) -# if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) -# define SHA_LONG64 unsigned __int64 -# define U64(C) C##UI64 -# elif defined(__arch64__) -# define SHA_LONG64 unsigned long -# define U64(C) C##UL -# else -# define SHA_LONG64 unsigned long long -# define U64(C) C##ULL -# endif - -typedef struct SHA512state_st { - SHA_LONG64 h[8]; - SHA_LONG64 Nl, Nh; - union { - SHA_LONG64 d[SHA_LBLOCK]; - unsigned char p[SHA512_CBLOCK]; - } u; - unsigned int num, md_len; -} SHA512_CTX; -# endif - -# ifndef OPENSSL_NO_SHA512 -# ifdef OPENSSL_FIPS -int private_SHA384_Init(SHA512_CTX *c); -int private_SHA512_Init(SHA512_CTX *c); -# endif -int SHA384_Init(SHA512_CTX *c); -int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); -int SHA384_Final(unsigned char *md, SHA512_CTX *c); -unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md); -int SHA512_Init(SHA512_CTX *c); -int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); -int SHA512_Final(unsigned char *md, SHA512_CTX *c); -unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md); -void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); -# endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/srp.h b/libs/win32/openssl/include/openssl/srp.h deleted file mode 100644 index 028892a1ff..0000000000 --- a/libs/win32/openssl/include/openssl/srp.h +++ /dev/null @@ -1,179 +0,0 @@ -/* crypto/srp/srp.h */ -/* - * Written by Christophe Renou (christophe.renou@edelweb.fr) with the - * precious help of Peter Sylvester (peter.sylvester@edelweb.fr) for the - * EdelKey project and contributed to the OpenSSL project 2004. - */ -/* ==================================================================== - * Copyright (c) 2004 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -#ifndef __SRP_H__ -# define __SRP_H__ - -# ifndef OPENSSL_NO_SRP - -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# include -# include -# include - -typedef struct SRP_gN_cache_st { - char *b64_bn; - BIGNUM *bn; -} SRP_gN_cache; - - -DECLARE_STACK_OF(SRP_gN_cache) - -typedef struct SRP_user_pwd_st { - /* Owned by us. */ - char *id; - BIGNUM *s; - BIGNUM *v; - /* Not owned by us. */ - const BIGNUM *g; - const BIGNUM *N; - /* Owned by us. */ - char *info; -} SRP_user_pwd; - -DECLARE_STACK_OF(SRP_user_pwd) - -void SRP_user_pwd_free(SRP_user_pwd *user_pwd); - -typedef struct SRP_VBASE_st { - STACK_OF(SRP_user_pwd) *users_pwd; - STACK_OF(SRP_gN_cache) *gN_cache; -/* to simulate a user */ - char *seed_key; - BIGNUM *default_g; - BIGNUM *default_N; -} SRP_VBASE; - -/* - * Structure interne pour retenir les couples N et g - */ -typedef struct SRP_gN_st { - char *id; - BIGNUM *g; - BIGNUM *N; -} SRP_gN; - -DECLARE_STACK_OF(SRP_gN) - -SRP_VBASE *SRP_VBASE_new(char *seed_key); -int SRP_VBASE_free(SRP_VBASE *vb); -int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file); - -/* This method ignores the configured seed and fails for an unknown user. */ -SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username); -/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/ -SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username); - -char *SRP_create_verifier(const char *user, const char *pass, char **salt, - char **verifier, const char *N, const char *g); -int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, - BIGNUM **verifier, BIGNUM *N, BIGNUM *g); - -# define SRP_NO_ERROR 0 -# define SRP_ERR_VBASE_INCOMPLETE_FILE 1 -# define SRP_ERR_VBASE_BN_LIB 2 -# define SRP_ERR_OPEN_FILE 3 -# define SRP_ERR_MEMORY 4 - -# define DB_srptype 0 -# define DB_srpverifier 1 -# define DB_srpsalt 2 -# define DB_srpid 3 -# define DB_srpgN 4 -# define DB_srpinfo 5 -# undef DB_NUMBER -# define DB_NUMBER 6 - -# define DB_SRP_INDEX 'I' -# define DB_SRP_VALID 'V' -# define DB_SRP_REVOKED 'R' -# define DB_SRP_MODIF 'v' - -/* see srp.c */ -char *SRP_check_known_gN_param(BIGNUM *g, BIGNUM *N); -SRP_gN *SRP_get_default_gN(const char *id); - -/* server side .... */ -BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b, - BIGNUM *N); -BIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v); -int SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N); -BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N); - -/* client side .... */ -BIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass); -BIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g); -BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x, - BIGNUM *a, BIGNUM *u); -int SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N); - -# define SRP_MINIMAL_N 1024 - -#ifdef __cplusplus -} -#endif - -# endif -#endif diff --git a/libs/win32/openssl/include/openssl/srtp.h b/libs/win32/openssl/include/openssl/srtp.h deleted file mode 100644 index 2279c32b89..0000000000 --- a/libs/win32/openssl/include/openssl/srtp.h +++ /dev/null @@ -1,147 +0,0 @@ -/* ssl/srtp.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* - * DTLS code by Eric Rescorla - * - * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc. - */ - -#ifndef HEADER_D1_SRTP_H -# define HEADER_D1_SRTP_H - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# define SRTP_AES128_CM_SHA1_80 0x0001 -# define SRTP_AES128_CM_SHA1_32 0x0002 -# define SRTP_AES128_F8_SHA1_80 0x0003 -# define SRTP_AES128_F8_SHA1_32 0x0004 -# define SRTP_NULL_SHA1_80 0x0005 -# define SRTP_NULL_SHA1_32 0x0006 - -# ifndef OPENSSL_NO_SRTP - -int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); -int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles); - -STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); -SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); - -# endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/ssl.h b/libs/win32/openssl/include/openssl/ssl.h deleted file mode 100644 index 90aeb0ce4e..0000000000 --- a/libs/win32/openssl/include/openssl/ssl.h +++ /dev/null @@ -1,3163 +0,0 @@ -/* ssl/ssl.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECC cipher suite support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ -/* ==================================================================== - * Copyright 2005 Nokia. All rights reserved. - * - * The portions of the attached software ("Contribution") is developed by - * Nokia Corporation and is licensed pursuant to the OpenSSL open source - * license. - * - * The Contribution, originally written by Mika Kousa and Pasi Eronen of - * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites - * support (see RFC 4279) to OpenSSL. - * - * No patent licenses or other rights except those expressly stated in - * the OpenSSL open source license shall be deemed granted or received - * expressly, by implication, estoppel, or otherwise. - * - * No assurances are provided by Nokia that the Contribution does not - * infringe the patent or other intellectual property rights of any third - * party or that the license provides you with all the necessary rights - * to make use of the Contribution. - * - * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN - * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA - * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY - * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR - * OTHERWISE. - */ - -#ifndef HEADER_SSL_H -# define HEADER_SSL_H - -# include - -# ifndef OPENSSL_NO_COMP -# include -# endif -# ifndef OPENSSL_NO_BIO -# include -# endif -# ifndef OPENSSL_NO_DEPRECATED -# ifndef OPENSSL_NO_X509 -# include -# endif -# include -# include -# include -# endif -# include -# include - -# include -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* SSLeay version number for ASN.1 encoding of the session information */ -/*- - * Version 0 - initial version - * Version 1 - added the optional peer certificate - */ -# define SSL_SESSION_ASN1_VERSION 0x0001 - -/* text strings for the ciphers */ -# define SSL_TXT_NULL_WITH_MD5 SSL2_TXT_NULL_WITH_MD5 -# define SSL_TXT_RC4_128_WITH_MD5 SSL2_TXT_RC4_128_WITH_MD5 -# define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 -# define SSL_TXT_RC2_128_CBC_WITH_MD5 SSL2_TXT_RC2_128_CBC_WITH_MD5 -# define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 -# define SSL_TXT_IDEA_128_CBC_WITH_MD5 SSL2_TXT_IDEA_128_CBC_WITH_MD5 -# define SSL_TXT_DES_64_CBC_WITH_MD5 SSL2_TXT_DES_64_CBC_WITH_MD5 -# define SSL_TXT_DES_64_CBC_WITH_SHA SSL2_TXT_DES_64_CBC_WITH_SHA -# define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 -# define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA - -/* - * VRS Additional Kerberos5 entries - */ -# define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA -# define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA -# define SSL_TXT_KRB5_RC4_128_SHA SSL3_TXT_KRB5_RC4_128_SHA -# define SSL_TXT_KRB5_IDEA_128_CBC_SHA SSL3_TXT_KRB5_IDEA_128_CBC_SHA -# define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5 -# define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5 -# define SSL_TXT_KRB5_RC4_128_MD5 SSL3_TXT_KRB5_RC4_128_MD5 -# define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5 - -# define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA -# define SSL_TXT_KRB5_RC2_40_CBC_SHA SSL3_TXT_KRB5_RC2_40_CBC_SHA -# define SSL_TXT_KRB5_RC4_40_SHA SSL3_TXT_KRB5_RC4_40_SHA -# define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5 -# define SSL_TXT_KRB5_RC2_40_CBC_MD5 SSL3_TXT_KRB5_RC2_40_CBC_MD5 -# define SSL_TXT_KRB5_RC4_40_MD5 SSL3_TXT_KRB5_RC4_40_MD5 - -# define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA -# define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5 -# define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA -# define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5 -# define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA -# define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5 -# define SSL_MAX_KRB5_PRINCIPAL_LENGTH 256 - -# define SSL_MAX_SSL_SESSION_ID_LENGTH 32 -# define SSL_MAX_SID_CTX_LENGTH 32 - -# define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512/8) -# define SSL_MAX_KEY_ARG_LENGTH 8 -# define SSL_MAX_MASTER_KEY_LENGTH 48 - -/* These are used to specify which ciphers to use and not to use */ - -# define SSL_TXT_EXP40 "EXPORT40" -# define SSL_TXT_EXP56 "EXPORT56" -# define SSL_TXT_LOW "LOW" -# define SSL_TXT_MEDIUM "MEDIUM" -# define SSL_TXT_HIGH "HIGH" -# define SSL_TXT_FIPS "FIPS" - -# define SSL_TXT_kFZA "kFZA"/* unused! */ -# define SSL_TXT_aFZA "aFZA"/* unused! */ -# define SSL_TXT_eFZA "eFZA"/* unused! */ -# define SSL_TXT_FZA "FZA"/* unused! */ - -# define SSL_TXT_aNULL "aNULL" -# define SSL_TXT_eNULL "eNULL" -# define SSL_TXT_NULL "NULL" - -# define SSL_TXT_kRSA "kRSA" -# define SSL_TXT_kDHr "kDHr" -# define SSL_TXT_kDHd "kDHd" -# define SSL_TXT_kDH "kDH" -# define SSL_TXT_kEDH "kEDH" -# define SSL_TXT_kDHE "kDHE"/* alias for kEDH */ -# define SSL_TXT_kKRB5 "kKRB5" -# define SSL_TXT_kECDHr "kECDHr" -# define SSL_TXT_kECDHe "kECDHe" -# define SSL_TXT_kECDH "kECDH" -# define SSL_TXT_kEECDH "kEECDH" -# define SSL_TXT_kECDHE "kECDHE"/* alias for kEECDH */ -# define SSL_TXT_kPSK "kPSK" -# define SSL_TXT_kGOST "kGOST" -# define SSL_TXT_kSRP "kSRP" - -# define SSL_TXT_aRSA "aRSA" -# define SSL_TXT_aDSS "aDSS" -# define SSL_TXT_aDH "aDH" -# define SSL_TXT_aECDH "aECDH" -# define SSL_TXT_aKRB5 "aKRB5" -# define SSL_TXT_aECDSA "aECDSA" -# define SSL_TXT_aPSK "aPSK" -# define SSL_TXT_aGOST94 "aGOST94" -# define SSL_TXT_aGOST01 "aGOST01" -# define SSL_TXT_aGOST "aGOST" -# define SSL_TXT_aSRP "aSRP" - -# define SSL_TXT_DSS "DSS" -# define SSL_TXT_DH "DH" -# define SSL_TXT_EDH "EDH"/* same as "kEDH:-ADH" */ -# define SSL_TXT_DHE "DHE"/* alias for EDH */ -# define SSL_TXT_ADH "ADH" -# define SSL_TXT_RSA "RSA" -# define SSL_TXT_ECDH "ECDH" -# define SSL_TXT_EECDH "EECDH"/* same as "kEECDH:-AECDH" */ -# define SSL_TXT_ECDHE "ECDHE"/* alias for ECDHE" */ -# define SSL_TXT_AECDH "AECDH" -# define SSL_TXT_ECDSA "ECDSA" -# define SSL_TXT_KRB5 "KRB5" -# define SSL_TXT_PSK "PSK" -# define SSL_TXT_SRP "SRP" - -# define SSL_TXT_DES "DES" -# define SSL_TXT_3DES "3DES" -# define SSL_TXT_RC4 "RC4" -# define SSL_TXT_RC2 "RC2" -# define SSL_TXT_IDEA "IDEA" -# define SSL_TXT_SEED "SEED" -# define SSL_TXT_AES128 "AES128" -# define SSL_TXT_AES256 "AES256" -# define SSL_TXT_AES "AES" -# define SSL_TXT_AES_GCM "AESGCM" -# define SSL_TXT_CAMELLIA128 "CAMELLIA128" -# define SSL_TXT_CAMELLIA256 "CAMELLIA256" -# define SSL_TXT_CAMELLIA "CAMELLIA" - -# define SSL_TXT_MD5 "MD5" -# define SSL_TXT_SHA1 "SHA1" -# define SSL_TXT_SHA "SHA"/* same as "SHA1" */ -# define SSL_TXT_GOST94 "GOST94" -# define SSL_TXT_GOST89MAC "GOST89MAC" -# define SSL_TXT_SHA256 "SHA256" -# define SSL_TXT_SHA384 "SHA384" - -# define SSL_TXT_SSLV2 "SSLv2" -# define SSL_TXT_SSLV3 "SSLv3" -# define SSL_TXT_TLSV1 "TLSv1" -# define SSL_TXT_TLSV1_1 "TLSv1.1" -# define SSL_TXT_TLSV1_2 "TLSv1.2" - -# define SSL_TXT_EXP "EXP" -# define SSL_TXT_EXPORT "EXPORT" - -# define SSL_TXT_ALL "ALL" - -/*- - * COMPLEMENTOF* definitions. These identifiers are used to (de-select) - * ciphers normally not being used. - * Example: "RC4" will activate all ciphers using RC4 including ciphers - * without authentication, which would normally disabled by DEFAULT (due - * the "!ADH" being part of default). Therefore "RC4:!COMPLEMENTOFDEFAULT" - * will make sure that it is also disabled in the specific selection. - * COMPLEMENTOF* identifiers are portable between version, as adjustments - * to the default cipher setup will also be included here. - * - * COMPLEMENTOFDEFAULT does not experience the same special treatment that - * DEFAULT gets, as only selection is being done and no sorting as needed - * for DEFAULT. - */ -# define SSL_TXT_CMPALL "COMPLEMENTOFALL" -# define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT" - -/* - * The following cipher list is used by default. It also is substituted when - * an application-defined cipher list string starts with 'DEFAULT'. - */ -# define SSL_DEFAULT_CIPHER_LIST "ALL:!EXPORT:!LOW:!aNULL:!eNULL:!SSLv2" -/* - * As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always - * starts with a reasonable order, and all we have to do for DEFAULT is - * throwing out anonymous and unencrypted ciphersuites! (The latter are not - * actually enabled by ALL, but "ALL:RSA" would enable some of them.) - */ - -/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */ -# define SSL_SENT_SHUTDOWN 1 -# define SSL_RECEIVED_SHUTDOWN 2 - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -# if (defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_MD5)) && !defined(OPENSSL_NO_SSL2) -# define OPENSSL_NO_SSL2 -# endif - -# define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1 -# define SSL_FILETYPE_PEM X509_FILETYPE_PEM - -/* - * This is needed to stop compilers complaining about the 'struct ssl_st *' - * function parameters used to prototype callbacks in SSL_CTX. - */ -typedef struct ssl_st *ssl_crock_st; -typedef struct tls_session_ticket_ext_st TLS_SESSION_TICKET_EXT; -typedef struct ssl_method_st SSL_METHOD; -typedef struct ssl_cipher_st SSL_CIPHER; -typedef struct ssl_session_st SSL_SESSION; -typedef struct tls_sigalgs_st TLS_SIGALGS; -typedef struct ssl_conf_ctx_st SSL_CONF_CTX; - -DECLARE_STACK_OF(SSL_CIPHER) - -/* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/ -typedef struct srtp_protection_profile_st { - const char *name; - unsigned long id; -} SRTP_PROTECTION_PROFILE; - -DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE) - -typedef int (*tls_session_ticket_ext_cb_fn) (SSL *s, - const unsigned char *data, - int len, void *arg); -typedef int (*tls_session_secret_cb_fn) (SSL *s, void *secret, - int *secret_len, - STACK_OF(SSL_CIPHER) *peer_ciphers, - SSL_CIPHER **cipher, void *arg); - -# ifndef OPENSSL_NO_TLSEXT - -/* Typedefs for handling custom extensions */ - -typedef int (*custom_ext_add_cb) (SSL *s, unsigned int ext_type, - const unsigned char **out, - size_t *outlen, int *al, void *add_arg); - -typedef void (*custom_ext_free_cb) (SSL *s, unsigned int ext_type, - const unsigned char *out, void *add_arg); - -typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, - const unsigned char *in, - size_t inlen, int *al, void *parse_arg); - -# endif - -# ifndef OPENSSL_NO_SSL_INTERN - -/* used to hold info on the particular ciphers used */ -struct ssl_cipher_st { - int valid; - const char *name; /* text name */ - unsigned long id; /* id, 4 bytes, first is version */ - /* - * changed in 0.9.9: these four used to be portions of a single value - * 'algorithms' - */ - unsigned long algorithm_mkey; /* key exchange algorithm */ - unsigned long algorithm_auth; /* server authentication */ - unsigned long algorithm_enc; /* symmetric encryption */ - unsigned long algorithm_mac; /* symmetric authentication */ - unsigned long algorithm_ssl; /* (major) protocol version */ - unsigned long algo_strength; /* strength and export flags */ - unsigned long algorithm2; /* Extra flags */ - int strength_bits; /* Number of bits really used */ - int alg_bits; /* Number of bits for algorithm */ -}; - -/* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */ -struct ssl_method_st { - int version; - int (*ssl_new) (SSL *s); - void (*ssl_clear) (SSL *s); - void (*ssl_free) (SSL *s); - int (*ssl_accept) (SSL *s); - int (*ssl_connect) (SSL *s); - int (*ssl_read) (SSL *s, void *buf, int len); - int (*ssl_peek) (SSL *s, void *buf, int len); - int (*ssl_write) (SSL *s, const void *buf, int len); - int (*ssl_shutdown) (SSL *s); - int (*ssl_renegotiate) (SSL *s); - int (*ssl_renegotiate_check) (SSL *s); - long (*ssl_get_message) (SSL *s, int st1, int stn, int mt, long - max, int *ok); - int (*ssl_read_bytes) (SSL *s, int type, unsigned char *buf, int len, - int peek); - int (*ssl_write_bytes) (SSL *s, int type, const void *buf_, int len); - int (*ssl_dispatch_alert) (SSL *s); - long (*ssl_ctrl) (SSL *s, int cmd, long larg, void *parg); - long (*ssl_ctx_ctrl) (SSL_CTX *ctx, int cmd, long larg, void *parg); - const SSL_CIPHER *(*get_cipher_by_char) (const unsigned char *ptr); - int (*put_cipher_by_char) (const SSL_CIPHER *cipher, unsigned char *ptr); - int (*ssl_pending) (const SSL *s); - int (*num_ciphers) (void); - const SSL_CIPHER *(*get_cipher) (unsigned ncipher); - const struct ssl_method_st *(*get_ssl_method) (int version); - long (*get_timeout) (void); - struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */ - int (*ssl_version) (void); - long (*ssl_callback_ctrl) (SSL *s, int cb_id, void (*fp) (void)); - long (*ssl_ctx_callback_ctrl) (SSL_CTX *s, int cb_id, void (*fp) (void)); -}; - -/*- - * Lets make this into an ASN.1 type structure as follows - * SSL_SESSION_ID ::= SEQUENCE { - * version INTEGER, -- structure version number - * SSLversion INTEGER, -- SSL version number - * Cipher OCTET STRING, -- the 3 byte cipher ID - * Session_ID OCTET STRING, -- the Session ID - * Master_key OCTET STRING, -- the master key - * KRB5_principal OCTET STRING -- optional Kerberos principal - * Key_Arg [ 0 ] IMPLICIT OCTET STRING, -- the optional Key argument - * Time [ 1 ] EXPLICIT INTEGER, -- optional Start Time - * Timeout [ 2 ] EXPLICIT INTEGER, -- optional Timeout ins seconds - * Peer [ 3 ] EXPLICIT X509, -- optional Peer Certificate - * Session_ID_context [ 4 ] EXPLICIT OCTET STRING, -- the Session ID context - * Verify_result [ 5 ] EXPLICIT INTEGER, -- X509_V_... code for `Peer' - * HostName [ 6 ] EXPLICIT OCTET STRING, -- optional HostName from servername TLS extension - * PSK_identity_hint [ 7 ] EXPLICIT OCTET STRING, -- optional PSK identity hint - * PSK_identity [ 8 ] EXPLICIT OCTET STRING, -- optional PSK identity - * Ticket_lifetime_hint [9] EXPLICIT INTEGER, -- server's lifetime hint for session ticket - * Ticket [10] EXPLICIT OCTET STRING, -- session ticket (clients only) - * Compression_meth [11] EXPLICIT OCTET STRING, -- optional compression method - * SRP_username [ 12 ] EXPLICIT OCTET STRING -- optional SRP username - * } - * Look in ssl/ssl_asn1.c for more details - * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-). - */ -struct ssl_session_st { - int ssl_version; /* what ssl version session info is being - * kept in here? */ - /* only really used in SSLv2 */ - unsigned int key_arg_length; - unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH]; - int master_key_length; - unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH]; - /* session_id - valid? */ - unsigned int session_id_length; - unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH]; - /* - * this is used to determine whether the session is being reused in the - * appropriate context. It is up to the application to set this, via - * SSL_new - */ - unsigned int sid_ctx_length; - unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; -# ifndef OPENSSL_NO_KRB5 - unsigned int krb5_client_princ_len; - unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH]; -# endif /* OPENSSL_NO_KRB5 */ -# ifndef OPENSSL_NO_PSK - char *psk_identity_hint; - char *psk_identity; -# endif - /* - * Used to indicate that session resumption is not allowed. Applications - * can also set this bit for a new session via not_resumable_session_cb - * to disable session caching and tickets. - */ - int not_resumable; - /* The cert is the certificate used to establish this connection */ - struct sess_cert_st /* SESS_CERT */ *sess_cert; - /* - * This is the cert for the other end. On clients, it will be the same as - * sess_cert->peer_key->x509 (the latter is not enough as sess_cert is - * not retained in the external representation of sessions, see - * ssl_asn1.c). - */ - X509 *peer; - /* - * when app_verify_callback accepts a session where the peer's - * certificate is not ok, we must remember the error for session reuse: - */ - long verify_result; /* only for servers */ - int references; - long timeout; - long time; - unsigned int compress_meth; /* Need to lookup the method */ - const SSL_CIPHER *cipher; - unsigned long cipher_id; /* when ASN.1 loaded, this needs to be used - * to load the 'cipher' structure */ - STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */ - CRYPTO_EX_DATA ex_data; /* application specific data */ - /* - * These are used to make removal of session-ids more efficient and to - * implement a maximum cache size. - */ - struct ssl_session_st *prev, *next; -# ifndef OPENSSL_NO_TLSEXT - char *tlsext_hostname; -# ifndef OPENSSL_NO_EC - size_t tlsext_ecpointformatlist_length; - unsigned char *tlsext_ecpointformatlist; /* peer's list */ - size_t tlsext_ellipticcurvelist_length; - unsigned char *tlsext_ellipticcurvelist; /* peer's list */ -# endif /* OPENSSL_NO_EC */ - /* RFC4507 info */ - unsigned char *tlsext_tick; /* Session ticket */ - size_t tlsext_ticklen; /* Session ticket length */ - long tlsext_tick_lifetime_hint; /* Session lifetime hint in seconds */ -# endif -# ifndef OPENSSL_NO_SRP - char *srp_username; -# endif -}; - -# endif - -# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x00000001L -# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x00000002L -/* Allow initial connection to servers that don't support RI */ -# define SSL_OP_LEGACY_SERVER_CONNECT 0x00000004L -# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x00000008L -# define SSL_OP_TLSEXT_PADDING 0x00000010L -# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x00000020L -# define SSL_OP_SAFARI_ECDHE_ECDSA_BUG 0x00000040L -# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x00000080L -# define SSL_OP_TLS_D5_BUG 0x00000100L -# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x00000200L - -/* Hasn't done anything since OpenSSL 0.9.7h, retained for compatibility */ -# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 -/* Refers to ancient SSLREF and SSLv2, retained for compatibility */ -# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 - -/* - * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added in - * OpenSSL 0.9.6d. Usually (depending on the application protocol) the - * workaround is not needed. Unfortunately some broken SSL/TLS - * implementations cannot handle it at all, which is why we include it in - * SSL_OP_ALL. - */ -/* added in 0.9.6e */ -# define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800L - -/* - * SSL_OP_ALL: various bug workarounds that should be rather harmless. This - * used to be 0x000FFFFFL before 0.9.7. - */ -# define SSL_OP_ALL 0x80000BFFL - -/* DTLS options */ -# define SSL_OP_NO_QUERY_MTU 0x00001000L -/* Turn on Cookie Exchange (on relevant for servers) */ -# define SSL_OP_COOKIE_EXCHANGE 0x00002000L -/* Don't use RFC4507 ticket extension */ -# define SSL_OP_NO_TICKET 0x00004000L -/* Use Cisco's "speshul" version of DTLS_BAD_VER (as client) */ -# define SSL_OP_CISCO_ANYCONNECT 0x00008000L - -/* As server, disallow session resumption on renegotiation */ -# define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0x00010000L -/* Don't use compression even if supported */ -# define SSL_OP_NO_COMPRESSION 0x00020000L -/* Permit unsafe legacy renegotiation */ -# define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000L -/* If set, always create a new key when using tmp_ecdh parameters */ -# define SSL_OP_SINGLE_ECDH_USE 0x00080000L -/* Does nothing: retained for compatibility */ -# define SSL_OP_SINGLE_DH_USE 0x00100000L -/* Does nothing: retained for compatibiity */ -# define SSL_OP_EPHEMERAL_RSA 0x0 -/* - * Set on servers to choose the cipher according to the server's preferences - */ -# define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L -/* - * If set, a server will allow a client to issue a SSLv3.0 version number as - * latest version supported in the premaster secret, even when TLSv1.0 - * (version 3.1) was announced in the client hello. Normally this is - * forbidden to prevent version rollback attacks. - */ -# define SSL_OP_TLS_ROLLBACK_BUG 0x00800000L - -# define SSL_OP_NO_SSLv2 0x01000000L -# define SSL_OP_NO_SSLv3 0x02000000L -# define SSL_OP_NO_TLSv1 0x04000000L -# define SSL_OP_NO_TLSv1_2 0x08000000L -# define SSL_OP_NO_TLSv1_1 0x10000000L - -# define SSL_OP_NO_DTLSv1 0x04000000L -# define SSL_OP_NO_DTLSv1_2 0x08000000L - -# define SSL_OP_NO_SSL_MASK (SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|\ - SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1_2) - -/* - * These next two were never actually used for anything since SSLeay zap so - * we have some more flags. - */ -/* - * The next flag deliberately changes the ciphertest, this is a check for the - * PKCS#1 attack - */ -# define SSL_OP_PKCS1_CHECK_1 0x0 -# define SSL_OP_PKCS1_CHECK_2 0x0 - -# define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L -# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L -/* - * Make server add server-hello extension from early version of cryptopro - * draft, when GOST ciphersuite is negotiated. Required for interoperability - * with CryptoPro CSP 3.x - */ -# define SSL_OP_CRYPTOPRO_TLSEXT_BUG 0x80000000L - -/* - * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success - * when just a single record has been written): - */ -# define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L -/* - * Make it possible to retry SSL_write() with changed buffer location (buffer - * contents must stay the same!); this is not the default to avoid the - * misconception that non-blocking SSL_write() behaves like non-blocking - * write(): - */ -# define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L -/* - * Never bother the application with retries if the transport is blocking: - */ -# define SSL_MODE_AUTO_RETRY 0x00000004L -/* Don't attempt to automatically build certificate chain */ -# define SSL_MODE_NO_AUTO_CHAIN 0x00000008L -/* - * Save RAM by releasing read and write buffers when they're empty. (SSL3 and - * TLS only.) "Released" buffers are put onto a free-list in the context or - * just freed (depending on the context's setting for freelist_max_len). - */ -# define SSL_MODE_RELEASE_BUFFERS 0x00000010L -/* - * Send the current time in the Random fields of the ClientHello and - * ServerHello records for compatibility with hypothetical implementations - * that require it. - */ -# define SSL_MODE_SEND_CLIENTHELLO_TIME 0x00000020L -# define SSL_MODE_SEND_SERVERHELLO_TIME 0x00000040L -/* - * Send TLS_FALLBACK_SCSV in the ClientHello. To be set only by applications - * that reconnect with a downgraded protocol version; see - * draft-ietf-tls-downgrade-scsv-00 for details. DO NOT ENABLE THIS if your - * application attempts a normal handshake. Only use this in explicit - * fallback retries, following the guidance in - * draft-ietf-tls-downgrade-scsv-00. - */ -# define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080L - -/* Cert related flags */ -/* - * Many implementations ignore some aspects of the TLS standards such as - * enforcing certifcate chain algorithms. When this is set we enforce them. - */ -# define SSL_CERT_FLAG_TLS_STRICT 0x00000001L - -/* Suite B modes, takes same values as certificate verify flags */ -# define SSL_CERT_FLAG_SUITEB_128_LOS_ONLY 0x10000 -/* Suite B 192 bit only mode */ -# define SSL_CERT_FLAG_SUITEB_192_LOS 0x20000 -/* Suite B 128 bit mode allowing 192 bit algorithms */ -# define SSL_CERT_FLAG_SUITEB_128_LOS 0x30000 - -/* Perform all sorts of protocol violations for testing purposes */ -# define SSL_CERT_FLAG_BROKEN_PROTOCOL 0x10000000 - -/* Flags for building certificate chains */ -/* Treat any existing certificates as untrusted CAs */ -# define SSL_BUILD_CHAIN_FLAG_UNTRUSTED 0x1 -/* Don't include root CA in chain */ -# define SSL_BUILD_CHAIN_FLAG_NO_ROOT 0x2 -/* Just check certificates already there */ -# define SSL_BUILD_CHAIN_FLAG_CHECK 0x4 -/* Ignore verification errors */ -# define SSL_BUILD_CHAIN_FLAG_IGNORE_ERROR 0x8 -/* Clear verification errors from queue */ -# define SSL_BUILD_CHAIN_FLAG_CLEAR_ERROR 0x10 - -/* Flags returned by SSL_check_chain */ -/* Certificate can be used with this session */ -# define CERT_PKEY_VALID 0x1 -/* Certificate can also be used for signing */ -# define CERT_PKEY_SIGN 0x2 -/* EE certificate signing algorithm OK */ -# define CERT_PKEY_EE_SIGNATURE 0x10 -/* CA signature algorithms OK */ -# define CERT_PKEY_CA_SIGNATURE 0x20 -/* EE certificate parameters OK */ -# define CERT_PKEY_EE_PARAM 0x40 -/* CA certificate parameters OK */ -# define CERT_PKEY_CA_PARAM 0x80 -/* Signing explicitly allowed as opposed to SHA1 fallback */ -# define CERT_PKEY_EXPLICIT_SIGN 0x100 -/* Client CA issuer names match (always set for server cert) */ -# define CERT_PKEY_ISSUER_NAME 0x200 -/* Cert type matches client types (always set for server cert) */ -# define CERT_PKEY_CERT_TYPE 0x400 -/* Cert chain suitable to Suite B */ -# define CERT_PKEY_SUITEB 0x800 - -# define SSL_CONF_FLAG_CMDLINE 0x1 -# define SSL_CONF_FLAG_FILE 0x2 -# define SSL_CONF_FLAG_CLIENT 0x4 -# define SSL_CONF_FLAG_SERVER 0x8 -# define SSL_CONF_FLAG_SHOW_ERRORS 0x10 -# define SSL_CONF_FLAG_CERTIFICATE 0x20 -/* Configuration value types */ -# define SSL_CONF_TYPE_UNKNOWN 0x0 -# define SSL_CONF_TYPE_STRING 0x1 -# define SSL_CONF_TYPE_FILE 0x2 -# define SSL_CONF_TYPE_DIR 0x3 - -/* - * Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, they - * cannot be used to clear bits. - */ - -# define SSL_CTX_set_options(ctx,op) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL) -# define SSL_CTX_clear_options(ctx,op) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_OPTIONS,(op),NULL) -# define SSL_CTX_get_options(ctx) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL) -# define SSL_set_options(ssl,op) \ - SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL) -# define SSL_clear_options(ssl,op) \ - SSL_ctrl((ssl),SSL_CTRL_CLEAR_OPTIONS,(op),NULL) -# define SSL_get_options(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_OPTIONS,0,NULL) - -# define SSL_CTX_set_mode(ctx,op) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL) -# define SSL_CTX_clear_mode(ctx,op) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL) -# define SSL_CTX_get_mode(ctx) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL) -# define SSL_clear_mode(ssl,op) \ - SSL_ctrl((ssl),SSL_CTRL_CLEAR_MODE,(op),NULL) -# define SSL_set_mode(ssl,op) \ - SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL) -# define SSL_get_mode(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL) -# define SSL_set_mtu(ssl, mtu) \ - SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL) -# define DTLS_set_link_mtu(ssl, mtu) \ - SSL_ctrl((ssl),DTLS_CTRL_SET_LINK_MTU,(mtu),NULL) -# define DTLS_get_link_min_mtu(ssl) \ - SSL_ctrl((ssl),DTLS_CTRL_GET_LINK_MIN_MTU,0,NULL) - -# define SSL_get_secure_renegotiation_support(ssl) \ - SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL) - -# ifndef OPENSSL_NO_HEARTBEATS -# define SSL_heartbeat(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_TLS_EXT_SEND_HEARTBEAT,0,NULL) -# endif - -# define SSL_CTX_set_cert_flags(ctx,op) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_CERT_FLAGS,(op),NULL) -# define SSL_set_cert_flags(s,op) \ - SSL_ctrl((s),SSL_CTRL_CERT_FLAGS,(op),NULL) -# define SSL_CTX_clear_cert_flags(ctx,op) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL) -# define SSL_clear_cert_flags(s,op) \ - SSL_ctrl((s),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL) - -void SSL_CTX_set_msg_callback(SSL_CTX *ctx, - void (*cb) (int write_p, int version, - int content_type, const void *buf, - size_t len, SSL *ssl, void *arg)); -void SSL_set_msg_callback(SSL *ssl, - void (*cb) (int write_p, int version, - int content_type, const void *buf, - size_t len, SSL *ssl, void *arg)); -# define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) -# define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) - -# ifndef OPENSSL_NO_SRP - -# ifndef OPENSSL_NO_SSL_INTERN - -typedef struct srp_ctx_st { - /* param for all the callbacks */ - void *SRP_cb_arg; - /* set client Hello login callback */ - int (*TLS_ext_srp_username_callback) (SSL *, int *, void *); - /* set SRP N/g param callback for verification */ - int (*SRP_verify_param_callback) (SSL *, void *); - /* set SRP client passwd callback */ - char *(*SRP_give_srp_client_pwd_callback) (SSL *, void *); - char *login; - BIGNUM *N, *g, *s, *B, *A; - BIGNUM *a, *b, *v; - char *info; - int strength; - unsigned long srp_Mask; -} SRP_CTX; - -# endif - -/* see tls_srp.c */ -int SSL_SRP_CTX_init(SSL *s); -int SSL_CTX_SRP_CTX_init(SSL_CTX *ctx); -int SSL_SRP_CTX_free(SSL *ctx); -int SSL_CTX_SRP_CTX_free(SSL_CTX *ctx); -int SSL_srp_server_param_with_username(SSL *s, int *ad); -int SRP_generate_server_master_secret(SSL *s, unsigned char *master_key); -int SRP_Calc_A_param(SSL *s); -int SRP_generate_client_master_secret(SSL *s, unsigned char *master_key); - -# endif - -# if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32) -# define SSL_MAX_CERT_LIST_DEFAULT 1024*30 - /* 30k max cert list :-) */ -# else -# define SSL_MAX_CERT_LIST_DEFAULT 1024*100 - /* 100k max cert list :-) */ -# endif - -# define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20) - -/* - * This callback type is used inside SSL_CTX, SSL, and in the functions that - * set them. It is used to override the generation of SSL/TLS session IDs in - * a server. Return value should be zero on an error, non-zero to proceed. - * Also, callbacks should themselves check if the id they generate is unique - * otherwise the SSL handshake will fail with an error - callbacks can do - * this using the 'ssl' value they're passed by; - * SSL_has_matching_session_id(ssl, id, *id_len) The length value passed in - * is set at the maximum size the session ID can be. In SSLv2 this is 16 - * bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback can alter this - * length to be less if desired, but under SSLv2 session IDs are supposed to - * be fixed at 16 bytes so the id will be padded after the callback returns - * in this case. It is also an error for the callback to set the size to - * zero. - */ -typedef int (*GEN_SESSION_CB) (const SSL *ssl, unsigned char *id, - unsigned int *id_len); - -typedef struct ssl_comp_st SSL_COMP; - -# ifndef OPENSSL_NO_SSL_INTERN - -struct ssl_comp_st { - int id; - const char *name; -# ifndef OPENSSL_NO_COMP - COMP_METHOD *method; -# else - char *method; -# endif -}; - -DECLARE_STACK_OF(SSL_COMP) -DECLARE_LHASH_OF(SSL_SESSION); - -struct ssl_ctx_st { - const SSL_METHOD *method; - STACK_OF(SSL_CIPHER) *cipher_list; - /* same as above but sorted for lookup */ - STACK_OF(SSL_CIPHER) *cipher_list_by_id; - struct x509_store_st /* X509_STORE */ *cert_store; - LHASH_OF(SSL_SESSION) *sessions; - /* - * Most session-ids that will be cached, default is - * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. - */ - unsigned long session_cache_size; - struct ssl_session_st *session_cache_head; - struct ssl_session_st *session_cache_tail; - /* - * This can have one of 2 values, ored together, SSL_SESS_CACHE_CLIENT, - * SSL_SESS_CACHE_SERVER, Default is SSL_SESSION_CACHE_SERVER, which - * means only SSL_accept which cache SSL_SESSIONS. - */ - int session_cache_mode; - /* - * If timeout is not 0, it is the default timeout value set when - * SSL_new() is called. This has been put in to make life easier to set - * things up - */ - long session_timeout; - /* - * If this callback is not null, it will be called each time a session id - * is added to the cache. If this function returns 1, it means that the - * callback will do a SSL_SESSION_free() when it has finished using it. - * Otherwise, on 0, it means the callback has finished with it. If - * remove_session_cb is not null, it will be called when a session-id is - * removed from the cache. After the call, OpenSSL will - * SSL_SESSION_free() it. - */ - int (*new_session_cb) (struct ssl_st *ssl, SSL_SESSION *sess); - void (*remove_session_cb) (struct ssl_ctx_st *ctx, SSL_SESSION *sess); - SSL_SESSION *(*get_session_cb) (struct ssl_st *ssl, - unsigned char *data, int len, int *copy); - struct { - int sess_connect; /* SSL new conn - started */ - int sess_connect_renegotiate; /* SSL reneg - requested */ - int sess_connect_good; /* SSL new conne/reneg - finished */ - int sess_accept; /* SSL new accept - started */ - int sess_accept_renegotiate; /* SSL reneg - requested */ - int sess_accept_good; /* SSL accept/reneg - finished */ - int sess_miss; /* session lookup misses */ - int sess_timeout; /* reuse attempt on timeouted session */ - int sess_cache_full; /* session removed due to full cache */ - int sess_hit; /* session reuse actually done */ - int sess_cb_hit; /* session-id that was not in the cache was - * passed back via the callback. This - * indicates that the application is - * supplying session-id's from other - * processes - spooky :-) */ - } stats; - - int references; - - /* if defined, these override the X509_verify_cert() calls */ - int (*app_verify_callback) (X509_STORE_CTX *, void *); - void *app_verify_arg; - /* - * before OpenSSL 0.9.7, 'app_verify_arg' was ignored - * ('app_verify_callback' was called with just one argument) - */ - - /* Default password callback. */ - pem_password_cb *default_passwd_callback; - - /* Default password callback user data. */ - void *default_passwd_callback_userdata; - - /* get client cert callback */ - int (*client_cert_cb) (SSL *ssl, X509 **x509, EVP_PKEY **pkey); - - /* cookie generate callback */ - int (*app_gen_cookie_cb) (SSL *ssl, unsigned char *cookie, - unsigned int *cookie_len); - - /* verify cookie callback */ - int (*app_verify_cookie_cb) (SSL *ssl, unsigned char *cookie, - unsigned int cookie_len); - - CRYPTO_EX_DATA ex_data; - - const EVP_MD *rsa_md5; /* For SSLv2 - name is 'ssl2-md5' */ - const EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */ - const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */ - - STACK_OF(X509) *extra_certs; - STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */ - - /* Default values used when no per-SSL value is defined follow */ - - /* used if SSL's info_callback is NULL */ - void (*info_callback) (const SSL *ssl, int type, int val); - - /* what we put in client cert requests */ - STACK_OF(X509_NAME) *client_CA; - - /* - * Default values to use in SSL structures follow (these are copied by - * SSL_new) - */ - - unsigned long options; - unsigned long mode; - long max_cert_list; - - struct cert_st /* CERT */ *cert; - int read_ahead; - - /* callback that allows applications to peek at protocol messages */ - void (*msg_callback) (int write_p, int version, int content_type, - const void *buf, size_t len, SSL *ssl, void *arg); - void *msg_callback_arg; - - int verify_mode; - unsigned int sid_ctx_length; - unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; - /* called 'verify_callback' in the SSL */ - int (*default_verify_callback) (int ok, X509_STORE_CTX *ctx); - - /* Default generate session ID callback. */ - GEN_SESSION_CB generate_session_id; - - X509_VERIFY_PARAM *param; - -# if 0 - int purpose; /* Purpose setting */ - int trust; /* Trust setting */ -# endif - - int quiet_shutdown; - - /* - * Maximum amount of data to send in one fragment. actual record size can - * be more than this due to padding and MAC overheads. - */ - unsigned int max_send_fragment; - -# ifndef OPENSSL_NO_ENGINE - /* - * Engine to pass requests for client certs to - */ - ENGINE *client_cert_engine; -# endif - -# ifndef OPENSSL_NO_TLSEXT - /* TLS extensions servername callback */ - int (*tlsext_servername_callback) (SSL *, int *, void *); - void *tlsext_servername_arg; - /* RFC 4507 session ticket keys */ - unsigned char tlsext_tick_key_name[16]; - unsigned char tlsext_tick_hmac_key[16]; - unsigned char tlsext_tick_aes_key[16]; - /* Callback to support customisation of ticket key setting */ - int (*tlsext_ticket_key_cb) (SSL *ssl, - unsigned char *name, unsigned char *iv, - EVP_CIPHER_CTX *ectx, - HMAC_CTX *hctx, int enc); - - /* certificate status request info */ - /* Callback for status request */ - int (*tlsext_status_cb) (SSL *ssl, void *arg); - void *tlsext_status_arg; - - /* draft-rescorla-tls-opaque-prf-input-00.txt information */ - int (*tlsext_opaque_prf_input_callback) (SSL *, void *peerinput, - size_t len, void *arg); - void *tlsext_opaque_prf_input_callback_arg; -# endif - -# ifndef OPENSSL_NO_PSK - char *psk_identity_hint; - unsigned int (*psk_client_callback) (SSL *ssl, const char *hint, - char *identity, - unsigned int max_identity_len, - unsigned char *psk, - unsigned int max_psk_len); - unsigned int (*psk_server_callback) (SSL *ssl, const char *identity, - unsigned char *psk, - unsigned int max_psk_len); -# endif - -# ifndef OPENSSL_NO_BUF_FREELISTS -# define SSL_MAX_BUF_FREELIST_LEN_DEFAULT 32 - unsigned int freelist_max_len; - struct ssl3_buf_freelist_st *wbuf_freelist; - struct ssl3_buf_freelist_st *rbuf_freelist; -# endif -# ifndef OPENSSL_NO_SRP - SRP_CTX srp_ctx; /* ctx for SRP authentication */ -# endif - -# ifndef OPENSSL_NO_TLSEXT - -# ifndef OPENSSL_NO_NEXTPROTONEG - /* Next protocol negotiation information */ - /* (for experimental NPN extension). */ - - /* - * For a server, this contains a callback function by which the set of - * advertised protocols can be provided. - */ - int (*next_protos_advertised_cb) (SSL *s, const unsigned char **buf, - unsigned int *len, void *arg); - void *next_protos_advertised_cb_arg; - /* - * For a client, this contains a callback function that selects the next - * protocol from the list provided by the server. - */ - int (*next_proto_select_cb) (SSL *s, unsigned char **out, - unsigned char *outlen, - const unsigned char *in, - unsigned int inlen, void *arg); - void *next_proto_select_cb_arg; -# endif - /* SRTP profiles we are willing to do from RFC 5764 */ - STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles; - - /* - * ALPN information (we are in the process of transitioning from NPN to - * ALPN.) - */ - - /*- - * For a server, this contains a callback function that allows the - * server to select the protocol for the connection. - * out: on successful return, this must point to the raw protocol - * name (without the length prefix). - * outlen: on successful return, this contains the length of |*out|. - * in: points to the client's list of supported protocols in - * wire-format. - * inlen: the length of |in|. - */ - int (*alpn_select_cb) (SSL *s, - const unsigned char **out, - unsigned char *outlen, - const unsigned char *in, - unsigned int inlen, void *arg); - void *alpn_select_cb_arg; - - /* - * For a client, this contains the list of supported protocols in wire - * format. - */ - unsigned char *alpn_client_proto_list; - unsigned alpn_client_proto_list_len; - -# ifndef OPENSSL_NO_EC - /* EC extension values inherited by SSL structure */ - size_t tlsext_ecpointformatlist_length; - unsigned char *tlsext_ecpointformatlist; - size_t tlsext_ellipticcurvelist_length; - unsigned char *tlsext_ellipticcurvelist; -# endif /* OPENSSL_NO_EC */ -# endif -}; - -# endif - -# define SSL_SESS_CACHE_OFF 0x0000 -# define SSL_SESS_CACHE_CLIENT 0x0001 -# define SSL_SESS_CACHE_SERVER 0x0002 -# define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER) -# define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080 -/* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */ -# define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100 -# define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200 -# define SSL_SESS_CACHE_NO_INTERNAL \ - (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE) - -LHASH_OF(SSL_SESSION) *SSL_CTX_sessions(SSL_CTX *ctx); -# define SSL_CTX_sess_number(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL) -# define SSL_CTX_sess_connect(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL) -# define SSL_CTX_sess_connect_good(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL) -# define SSL_CTX_sess_connect_renegotiate(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL) -# define SSL_CTX_sess_accept(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL) -# define SSL_CTX_sess_accept_renegotiate(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL) -# define SSL_CTX_sess_accept_good(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL) -# define SSL_CTX_sess_hits(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL) -# define SSL_CTX_sess_cb_hits(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL) -# define SSL_CTX_sess_misses(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL) -# define SSL_CTX_sess_timeouts(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL) -# define SSL_CTX_sess_cache_full(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL) - -void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx, - int (*new_session_cb) (struct ssl_st *ssl, - SSL_SESSION *sess)); -int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx)) (struct ssl_st *ssl, - SSL_SESSION *sess); -void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx, - void (*remove_session_cb) (struct ssl_ctx_st - *ctx, - SSL_SESSION - *sess)); -void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx)) (struct ssl_ctx_st *ctx, - SSL_SESSION *sess); -void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, - SSL_SESSION *(*get_session_cb) (struct ssl_st - *ssl, - unsigned char - *data, int len, - int *copy)); -SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx)) (struct ssl_st *ssl, - unsigned char *Data, - int len, int *copy); -void SSL_CTX_set_info_callback(SSL_CTX *ctx, - void (*cb) (const SSL *ssl, int type, - int val)); -void (*SSL_CTX_get_info_callback(SSL_CTX *ctx)) (const SSL *ssl, int type, - int val); -void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, - int (*client_cert_cb) (SSL *ssl, X509 **x509, - EVP_PKEY **pkey)); -int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx)) (SSL *ssl, X509 **x509, - EVP_PKEY **pkey); -# ifndef OPENSSL_NO_ENGINE -int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e); -# endif -void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, - int (*app_gen_cookie_cb) (SSL *ssl, - unsigned char - *cookie, - unsigned int - *cookie_len)); -void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, - int (*app_verify_cookie_cb) (SSL *ssl, - unsigned char - *cookie, - unsigned int - cookie_len)); -# ifndef OPENSSL_NO_NEXTPROTONEG -void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s, - int (*cb) (SSL *ssl, - const unsigned char - **out, - unsigned int *outlen, - void *arg), void *arg); -void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s, - int (*cb) (SSL *ssl, - unsigned char **out, - unsigned char *outlen, - const unsigned char *in, - unsigned int inlen, - void *arg), void *arg); -void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data, - unsigned *len); -# endif - -# ifndef OPENSSL_NO_TLSEXT -int SSL_select_next_proto(unsigned char **out, unsigned char *outlen, - const unsigned char *in, unsigned int inlen, - const unsigned char *client, - unsigned int client_len); -# endif - -# define OPENSSL_NPN_UNSUPPORTED 0 -# define OPENSSL_NPN_NEGOTIATED 1 -# define OPENSSL_NPN_NO_OVERLAP 2 - -int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos, - unsigned protos_len); -int SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos, - unsigned protos_len); -void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, - int (*cb) (SSL *ssl, - const unsigned char **out, - unsigned char *outlen, - const unsigned char *in, - unsigned int inlen, - void *arg), void *arg); -void SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data, - unsigned *len); - -# ifndef OPENSSL_NO_PSK -/* - * the maximum length of the buffer given to callbacks containing the - * resulting identity/psk - */ -# define PSK_MAX_IDENTITY_LEN 128 -# define PSK_MAX_PSK_LEN 256 -void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx, - unsigned int (*psk_client_callback) (SSL - *ssl, - const - char - *hint, - char - *identity, - unsigned - int - max_identity_len, - unsigned - char - *psk, - unsigned - int - max_psk_len)); -void SSL_set_psk_client_callback(SSL *ssl, - unsigned int (*psk_client_callback) (SSL - *ssl, - const - char - *hint, - char - *identity, - unsigned - int - max_identity_len, - unsigned - char - *psk, - unsigned - int - max_psk_len)); -void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, - unsigned int (*psk_server_callback) (SSL - *ssl, - const - char - *identity, - unsigned - char - *psk, - unsigned - int - max_psk_len)); -void SSL_set_psk_server_callback(SSL *ssl, - unsigned int (*psk_server_callback) (SSL - *ssl, - const - char - *identity, - unsigned - char - *psk, - unsigned - int - max_psk_len)); -int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint); -int SSL_use_psk_identity_hint(SSL *s, const char *identity_hint); -const char *SSL_get_psk_identity_hint(const SSL *s); -const char *SSL_get_psk_identity(const SSL *s); -# endif - -# ifndef OPENSSL_NO_TLSEXT -/* Register callbacks to handle custom TLS Extensions for client or server. */ - -int SSL_CTX_add_client_custom_ext(SSL_CTX *ctx, unsigned int ext_type, - custom_ext_add_cb add_cb, - custom_ext_free_cb free_cb, - void *add_arg, - custom_ext_parse_cb parse_cb, - void *parse_arg); - -int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned int ext_type, - custom_ext_add_cb add_cb, - custom_ext_free_cb free_cb, - void *add_arg, - custom_ext_parse_cb parse_cb, - void *parse_arg); - -int SSL_extension_supported(unsigned int ext_type); - -# endif - -# define SSL_NOTHING 1 -# define SSL_WRITING 2 -# define SSL_READING 3 -# define SSL_X509_LOOKUP 4 - -/* These will only be used when doing non-blocking IO */ -# define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING) -# define SSL_want_read(s) (SSL_want(s) == SSL_READING) -# define SSL_want_write(s) (SSL_want(s) == SSL_WRITING) -# define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP) - -# define SSL_MAC_FLAG_READ_MAC_STREAM 1 -# define SSL_MAC_FLAG_WRITE_MAC_STREAM 2 - -# ifndef OPENSSL_NO_SSL_INTERN - -struct ssl_st { - /* - * protocol version (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, - * DTLS1_VERSION) - */ - int version; - /* SSL_ST_CONNECT or SSL_ST_ACCEPT */ - int type; - /* SSLv3 */ - const SSL_METHOD *method; - /* - * There are 2 BIO's even though they are normally both the same. This - * is so data can be read and written to different handlers - */ -# ifndef OPENSSL_NO_BIO - /* used by SSL_read */ - BIO *rbio; - /* used by SSL_write */ - BIO *wbio; - /* used during session-id reuse to concatenate messages */ - BIO *bbio; -# else - /* used by SSL_read */ - char *rbio; - /* used by SSL_write */ - char *wbio; - char *bbio; -# endif - /* - * This holds a variable that indicates what we were doing when a 0 or -1 - * is returned. This is needed for non-blocking IO so we know what - * request needs re-doing when in SSL_accept or SSL_connect - */ - int rwstate; - /* true when we are actually in SSL_accept() or SSL_connect() */ - int in_handshake; - int (*handshake_func) (SSL *); - /* - * Imagine that here's a boolean member "init" that is switched as soon - * as SSL_set_{accept/connect}_state is called for the first time, so - * that "state" and "handshake_func" are properly initialized. But as - * handshake_func is == 0 until then, we use this test instead of an - * "init" member. - */ - /* are we the server side? - mostly used by SSL_clear */ - int server; - /* - * Generate a new session or reuse an old one. - * NB: For servers, the 'new' session may actually be a previously - * cached session or even the previous session unless - * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set - */ - int new_session; - /* don't send shutdown packets */ - int quiet_shutdown; - /* we have shut things down, 0x01 sent, 0x02 for received */ - int shutdown; - /* where we are */ - int state; - /* where we are when reading */ - int rstate; - BUF_MEM *init_buf; /* buffer used during init */ - void *init_msg; /* pointer to handshake message body, set by - * ssl3_get_message() */ - int init_num; /* amount read/written */ - int init_off; /* amount read/written */ - /* used internally to point at a raw packet */ - unsigned char *packet; - unsigned int packet_length; - struct ssl2_state_st *s2; /* SSLv2 variables */ - struct ssl3_state_st *s3; /* SSLv3 variables */ - struct dtls1_state_st *d1; /* DTLSv1 variables */ - int read_ahead; /* Read as many input bytes as possible (for - * non-blocking reads) */ - /* callback that allows applications to peek at protocol messages */ - void (*msg_callback) (int write_p, int version, int content_type, - const void *buf, size_t len, SSL *ssl, void *arg); - void *msg_callback_arg; - int hit; /* reusing a previous session */ - X509_VERIFY_PARAM *param; -# if 0 - int purpose; /* Purpose setting */ - int trust; /* Trust setting */ -# endif - /* crypto */ - STACK_OF(SSL_CIPHER) *cipher_list; - STACK_OF(SSL_CIPHER) *cipher_list_by_id; - /* - * These are the ones being used, the ones in SSL_SESSION are the ones to - * be 'copied' into these ones - */ - int mac_flags; - EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */ - EVP_MD_CTX *read_hash; /* used for mac generation */ -# ifndef OPENSSL_NO_COMP - COMP_CTX *expand; /* uncompress */ -# else - char *expand; -# endif - EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */ - EVP_MD_CTX *write_hash; /* used for mac generation */ -# ifndef OPENSSL_NO_COMP - COMP_CTX *compress; /* compression */ -# else - char *compress; -# endif - /* session info */ - /* client cert? */ - /* This is used to hold the server certificate used */ - struct cert_st /* CERT */ *cert; - /* - * the session_id_context is used to ensure sessions are only reused in - * the appropriate context - */ - unsigned int sid_ctx_length; - unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; - /* This can also be in the session once a session is established */ - SSL_SESSION *session; - /* Default generate session ID callback. */ - GEN_SESSION_CB generate_session_id; - /* Used in SSL2 and SSL3 */ - /* - * 0 don't care about verify failure. - * 1 fail if verify fails - */ - int verify_mode; - /* fail if callback returns 0 */ - int (*verify_callback) (int ok, X509_STORE_CTX *ctx); - /* optional informational callback */ - void (*info_callback) (const SSL *ssl, int type, int val); - /* error bytes to be written */ - int error; - /* actual code */ - int error_code; -# ifndef OPENSSL_NO_KRB5 - /* Kerberos 5 context */ - KSSL_CTX *kssl_ctx; -# endif /* OPENSSL_NO_KRB5 */ -# ifndef OPENSSL_NO_PSK - unsigned int (*psk_client_callback) (SSL *ssl, const char *hint, - char *identity, - unsigned int max_identity_len, - unsigned char *psk, - unsigned int max_psk_len); - unsigned int (*psk_server_callback) (SSL *ssl, const char *identity, - unsigned char *psk, - unsigned int max_psk_len); -# endif - SSL_CTX *ctx; - /* - * set this flag to 1 and a sleep(1) is put into all SSL_read() and - * SSL_write() calls, good for nbio debuging :-) - */ - int debug; - /* extra application data */ - long verify_result; - CRYPTO_EX_DATA ex_data; - /* for server side, keep the list of CA_dn we can use */ - STACK_OF(X509_NAME) *client_CA; - int references; - /* protocol behaviour */ - unsigned long options; - /* API behaviour */ - unsigned long mode; - long max_cert_list; - int first_packet; - /* what was passed, used for SSLv3/TLS rollback check */ - int client_version; - unsigned int max_send_fragment; -# ifndef OPENSSL_NO_TLSEXT - /* TLS extension debug callback */ - void (*tlsext_debug_cb) (SSL *s, int client_server, int type, - unsigned char *data, int len, void *arg); - void *tlsext_debug_arg; - char *tlsext_hostname; - /*- - * no further mod of servername - * 0 : call the servername extension callback. - * 1 : prepare 2, allow last ack just after in server callback. - * 2 : don't call servername callback, no ack in server hello - */ - int servername_done; - /* certificate status request info */ - /* Status type or -1 if no status type */ - int tlsext_status_type; - /* Expect OCSP CertificateStatus message */ - int tlsext_status_expected; - /* OCSP status request only */ - STACK_OF(OCSP_RESPID) *tlsext_ocsp_ids; - X509_EXTENSIONS *tlsext_ocsp_exts; - /* OCSP response received or to be sent */ - unsigned char *tlsext_ocsp_resp; - int tlsext_ocsp_resplen; - /* RFC4507 session ticket expected to be received or sent */ - int tlsext_ticket_expected; -# ifndef OPENSSL_NO_EC - size_t tlsext_ecpointformatlist_length; - /* our list */ - unsigned char *tlsext_ecpointformatlist; - size_t tlsext_ellipticcurvelist_length; - /* our list */ - unsigned char *tlsext_ellipticcurvelist; -# endif /* OPENSSL_NO_EC */ - /* - * draft-rescorla-tls-opaque-prf-input-00.txt information to be used for - * handshakes - */ - void *tlsext_opaque_prf_input; - size_t tlsext_opaque_prf_input_len; - /* TLS Session Ticket extension override */ - TLS_SESSION_TICKET_EXT *tlsext_session_ticket; - /* TLS Session Ticket extension callback */ - tls_session_ticket_ext_cb_fn tls_session_ticket_ext_cb; - void *tls_session_ticket_ext_cb_arg; - /* TLS pre-shared secret session resumption */ - tls_session_secret_cb_fn tls_session_secret_cb; - void *tls_session_secret_cb_arg; - SSL_CTX *initial_ctx; /* initial ctx, used to store sessions */ -# ifndef OPENSSL_NO_NEXTPROTONEG - /* - * Next protocol negotiation. For the client, this is the protocol that - * we sent in NextProtocol and is set when handling ServerHello - * extensions. For a server, this is the client's selected_protocol from - * NextProtocol and is set when handling the NextProtocol message, before - * the Finished message. - */ - unsigned char *next_proto_negotiated; - unsigned char next_proto_negotiated_len; -# endif -# define session_ctx initial_ctx - /* What we'll do */ - STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles; - /* What's been chosen */ - SRTP_PROTECTION_PROFILE *srtp_profile; - /*- - * Is use of the Heartbeat extension negotiated? - * 0: disabled - * 1: enabled - * 2: enabled, but not allowed to send Requests - */ - unsigned int tlsext_heartbeat; - /* Indicates if a HeartbeatRequest is in flight */ - unsigned int tlsext_hb_pending; - /* HeartbeatRequest sequence number */ - unsigned int tlsext_hb_seq; -# else -# define session_ctx ctx -# endif /* OPENSSL_NO_TLSEXT */ - /*- - * 1 if we are renegotiating. - * 2 if we are a server and are inside a handshake - * (i.e. not just sending a HelloRequest) - */ - int renegotiate; -# ifndef OPENSSL_NO_SRP - /* ctx for SRP authentication */ - SRP_CTX srp_ctx; -# endif -# ifndef OPENSSL_NO_TLSEXT - /* - * For a client, this contains the list of supported protocols in wire - * format. - */ - unsigned char *alpn_client_proto_list; - unsigned alpn_client_proto_list_len; -# endif /* OPENSSL_NO_TLSEXT */ -}; - -# endif - -#ifdef __cplusplus -} -#endif - -# include -# include -# include /* This is mostly sslv3 with a few tweaks */ -# include /* Datagram TLS */ -# include -# include /* Support for the use_srtp extension */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* compatibility */ -# define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg)) -# define SSL_get_app_data(s) (SSL_get_ex_data(s,0)) -# define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0,(char *)a)) -# define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0)) -# define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0)) -# define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0,(char *)arg)) - -/* - * The following are the possible values for ssl->state are are used to - * indicate where we are up to in the SSL connection establishment. The - * macros that follow are about the only things you should need to use and - * even then, only when using non-blocking IO. It can also be useful to work - * out where you were when the connection failed - */ - -# define SSL_ST_CONNECT 0x1000 -# define SSL_ST_ACCEPT 0x2000 -# define SSL_ST_MASK 0x0FFF -# define SSL_ST_INIT (SSL_ST_CONNECT|SSL_ST_ACCEPT) -# define SSL_ST_BEFORE 0x4000 -# define SSL_ST_OK 0x03 -# define SSL_ST_RENEGOTIATE (0x04|SSL_ST_INIT) -# define SSL_ST_ERR 0x05 - -# define SSL_CB_LOOP 0x01 -# define SSL_CB_EXIT 0x02 -# define SSL_CB_READ 0x04 -# define SSL_CB_WRITE 0x08 -# define SSL_CB_ALERT 0x4000/* used in callback */ -# define SSL_CB_READ_ALERT (SSL_CB_ALERT|SSL_CB_READ) -# define SSL_CB_WRITE_ALERT (SSL_CB_ALERT|SSL_CB_WRITE) -# define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT|SSL_CB_LOOP) -# define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT|SSL_CB_EXIT) -# define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT|SSL_CB_LOOP) -# define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT|SSL_CB_EXIT) -# define SSL_CB_HANDSHAKE_START 0x10 -# define SSL_CB_HANDSHAKE_DONE 0x20 - -/* Is the SSL_connection established? */ -# define SSL_get_state(a) SSL_state(a) -# define SSL_is_init_finished(a) (SSL_state(a) == SSL_ST_OK) -# define SSL_in_init(a) (SSL_state(a)&SSL_ST_INIT) -# define SSL_in_before(a) (SSL_state(a)&SSL_ST_BEFORE) -# define SSL_in_connect_init(a) (SSL_state(a)&SSL_ST_CONNECT) -# define SSL_in_accept_init(a) (SSL_state(a)&SSL_ST_ACCEPT) - -/* - * The following 2 states are kept in ssl->rstate when reads fail, you should - * not need these - */ -# define SSL_ST_READ_HEADER 0xF0 -# define SSL_ST_READ_BODY 0xF1 -# define SSL_ST_READ_DONE 0xF2 - -/*- - * Obtain latest Finished message - * -- that we sent (SSL_get_finished) - * -- that we expected from peer (SSL_get_peer_finished). - * Returns length (0 == no Finished so far), copies up to 'count' bytes. - */ -size_t SSL_get_finished(const SSL *s, void *buf, size_t count); -size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); - -/* - * use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options are - * 'ored' with SSL_VERIFY_PEER if they are desired - */ -# define SSL_VERIFY_NONE 0x00 -# define SSL_VERIFY_PEER 0x01 -# define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 -# define SSL_VERIFY_CLIENT_ONCE 0x04 - -# define OpenSSL_add_ssl_algorithms() SSL_library_init() -# define SSLeay_add_ssl_algorithms() SSL_library_init() - -/* this is for backward compatibility */ -# if 0 /* NEW_SSLEAY */ -# define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c) -# define SSL_set_pref_cipher(c,n) SSL_set_cipher_list(c,n) -# define SSL_add_session(a,b) SSL_CTX_add_session((a),(b)) -# define SSL_remove_session(a,b) SSL_CTX_remove_session((a),(b)) -# define SSL_flush_sessions(a,b) SSL_CTX_flush_sessions((a),(b)) -# endif -/* More backward compatibility */ -# define SSL_get_cipher(s) \ - SSL_CIPHER_get_name(SSL_get_current_cipher(s)) -# define SSL_get_cipher_bits(s,np) \ - SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np) -# define SSL_get_cipher_version(s) \ - SSL_CIPHER_get_version(SSL_get_current_cipher(s)) -# define SSL_get_cipher_name(s) \ - SSL_CIPHER_get_name(SSL_get_current_cipher(s)) -# define SSL_get_time(a) SSL_SESSION_get_time(a) -# define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b)) -# define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) -# define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b)) - -# define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id) -# define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id) - -DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) -# define SSL_AD_REASON_OFFSET 1000/* offset to get SSL_R_... value - * from SSL_AD_... */ -/* These alert types are for SSLv3 and TLSv1 */ -# define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY -/* fatal */ -# define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE -/* fatal */ -# define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC -# define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED -# define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW -/* fatal */ -# define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE -/* fatal */ -# define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE -/* Not for TLS */ -# define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE -# define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE -# define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE -# define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED -# define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED -# define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN -/* fatal */ -# define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER -/* fatal */ -# define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA -/* fatal */ -# define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED -/* fatal */ -# define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR -# define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR -/* fatal */ -# define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION -/* fatal */ -# define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION -/* fatal */ -# define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY -/* fatal */ -# define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR -# define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED -# define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION -# define SSL_AD_UNSUPPORTED_EXTENSION TLS1_AD_UNSUPPORTED_EXTENSION -# define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE -# define SSL_AD_UNRECOGNIZED_NAME TLS1_AD_UNRECOGNIZED_NAME -# define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE -# define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE -/* fatal */ -# define SSL_AD_UNKNOWN_PSK_IDENTITY TLS1_AD_UNKNOWN_PSK_IDENTITY -/* fatal */ -# define SSL_AD_INAPPROPRIATE_FALLBACK TLS1_AD_INAPPROPRIATE_FALLBACK -# define SSL_ERROR_NONE 0 -# define SSL_ERROR_SSL 1 -# define SSL_ERROR_WANT_READ 2 -# define SSL_ERROR_WANT_WRITE 3 -# define SSL_ERROR_WANT_X509_LOOKUP 4 -# define SSL_ERROR_SYSCALL 5/* look at error stack/return - * value/errno */ -# define SSL_ERROR_ZERO_RETURN 6 -# define SSL_ERROR_WANT_CONNECT 7 -# define SSL_ERROR_WANT_ACCEPT 8 -# define SSL_CTRL_NEED_TMP_RSA 1 -# define SSL_CTRL_SET_TMP_RSA 2 -# define SSL_CTRL_SET_TMP_DH 3 -# define SSL_CTRL_SET_TMP_ECDH 4 -# define SSL_CTRL_SET_TMP_RSA_CB 5 -# define SSL_CTRL_SET_TMP_DH_CB 6 -# define SSL_CTRL_SET_TMP_ECDH_CB 7 -# define SSL_CTRL_GET_SESSION_REUSED 8 -# define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9 -# define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10 -# define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11 -# define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12 -# define SSL_CTRL_GET_FLAGS 13 -# define SSL_CTRL_EXTRA_CHAIN_CERT 14 -# define SSL_CTRL_SET_MSG_CALLBACK 15 -# define SSL_CTRL_SET_MSG_CALLBACK_ARG 16 -/* only applies to datagram connections */ -# define SSL_CTRL_SET_MTU 17 -/* Stats */ -# define SSL_CTRL_SESS_NUMBER 20 -# define SSL_CTRL_SESS_CONNECT 21 -# define SSL_CTRL_SESS_CONNECT_GOOD 22 -# define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23 -# define SSL_CTRL_SESS_ACCEPT 24 -# define SSL_CTRL_SESS_ACCEPT_GOOD 25 -# define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26 -# define SSL_CTRL_SESS_HIT 27 -# define SSL_CTRL_SESS_CB_HIT 28 -# define SSL_CTRL_SESS_MISSES 29 -# define SSL_CTRL_SESS_TIMEOUTS 30 -# define SSL_CTRL_SESS_CACHE_FULL 31 -# define SSL_CTRL_OPTIONS 32 -# define SSL_CTRL_MODE 33 -# define SSL_CTRL_GET_READ_AHEAD 40 -# define SSL_CTRL_SET_READ_AHEAD 41 -# define SSL_CTRL_SET_SESS_CACHE_SIZE 42 -# define SSL_CTRL_GET_SESS_CACHE_SIZE 43 -# define SSL_CTRL_SET_SESS_CACHE_MODE 44 -# define SSL_CTRL_GET_SESS_CACHE_MODE 45 -# define SSL_CTRL_GET_MAX_CERT_LIST 50 -# define SSL_CTRL_SET_MAX_CERT_LIST 51 -# define SSL_CTRL_SET_MAX_SEND_FRAGMENT 52 -/* see tls1.h for macros based on these */ -# ifndef OPENSSL_NO_TLSEXT -# define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB 53 -# define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG 54 -# define SSL_CTRL_SET_TLSEXT_HOSTNAME 55 -# define SSL_CTRL_SET_TLSEXT_DEBUG_CB 56 -# define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57 -# define SSL_CTRL_GET_TLSEXT_TICKET_KEYS 58 -# define SSL_CTRL_SET_TLSEXT_TICKET_KEYS 59 -# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT 60 -# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB 61 -# define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG 62 -# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63 -# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64 -# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65 -# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66 -# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS 67 -# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS 68 -# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69 -# define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70 -# define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71 -# define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72 -# define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB 75 -# define SSL_CTRL_SET_SRP_VERIFY_PARAM_CB 76 -# define SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB 77 -# define SSL_CTRL_SET_SRP_ARG 78 -# define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME 79 -# define SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH 80 -# define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD 81 -# ifndef OPENSSL_NO_HEARTBEATS -# define SSL_CTRL_TLS_EXT_SEND_HEARTBEAT 85 -# define SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING 86 -# define SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS 87 -# endif -# endif /* OPENSSL_NO_TLSEXT */ -# define DTLS_CTRL_GET_TIMEOUT 73 -# define DTLS_CTRL_HANDLE_TIMEOUT 74 -# define DTLS_CTRL_LISTEN 75 -# define SSL_CTRL_GET_RI_SUPPORT 76 -# define SSL_CTRL_CLEAR_OPTIONS 77 -# define SSL_CTRL_CLEAR_MODE 78 -# define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82 -# define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83 -# define SSL_CTRL_CHAIN 88 -# define SSL_CTRL_CHAIN_CERT 89 -# define SSL_CTRL_GET_CURVES 90 -# define SSL_CTRL_SET_CURVES 91 -# define SSL_CTRL_SET_CURVES_LIST 92 -# define SSL_CTRL_GET_SHARED_CURVE 93 -# define SSL_CTRL_SET_ECDH_AUTO 94 -# define SSL_CTRL_SET_SIGALGS 97 -# define SSL_CTRL_SET_SIGALGS_LIST 98 -# define SSL_CTRL_CERT_FLAGS 99 -# define SSL_CTRL_CLEAR_CERT_FLAGS 100 -# define SSL_CTRL_SET_CLIENT_SIGALGS 101 -# define SSL_CTRL_SET_CLIENT_SIGALGS_LIST 102 -# define SSL_CTRL_GET_CLIENT_CERT_TYPES 103 -# define SSL_CTRL_SET_CLIENT_CERT_TYPES 104 -# define SSL_CTRL_BUILD_CERT_CHAIN 105 -# define SSL_CTRL_SET_VERIFY_CERT_STORE 106 -# define SSL_CTRL_SET_CHAIN_CERT_STORE 107 -# define SSL_CTRL_GET_PEER_SIGNATURE_NID 108 -# define SSL_CTRL_GET_SERVER_TMP_KEY 109 -# define SSL_CTRL_GET_RAW_CIPHERLIST 110 -# define SSL_CTRL_GET_EC_POINT_FORMATS 111 -# define SSL_CTRL_GET_CHAIN_CERTS 115 -# define SSL_CTRL_SELECT_CURRENT_CERT 116 -# define SSL_CTRL_SET_CURRENT_CERT 117 -# define SSL_CTRL_CHECK_PROTO_VERSION 119 -# define DTLS_CTRL_SET_LINK_MTU 120 -# define DTLS_CTRL_GET_LINK_MIN_MTU 121 -# define SSL_CERT_SET_FIRST 1 -# define SSL_CERT_SET_NEXT 2 -# define SSL_CERT_SET_SERVER 3 -# define DTLSv1_get_timeout(ssl, arg) \ - SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg) -# define DTLSv1_handle_timeout(ssl) \ - SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, NULL) -# define DTLSv1_listen(ssl, peer) \ - SSL_ctrl(ssl,DTLS_CTRL_LISTEN,0, (void *)peer) -# define SSL_session_reused(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL) -# define SSL_num_renegotiations(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL) -# define SSL_clear_num_renegotiations(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL) -# define SSL_total_renegotiations(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL) -# define SSL_CTX_need_tmp_RSA(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL) -# define SSL_CTX_set_tmp_rsa(ctx,rsa) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa) -# define SSL_CTX_set_tmp_dh(ctx,dh) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh) -# define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh) -# define SSL_need_tmp_RSA(ssl) \ - SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL) -# define SSL_set_tmp_rsa(ssl,rsa) \ - SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa) -# define SSL_set_tmp_dh(ssl,dh) \ - SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh) -# define SSL_set_tmp_ecdh(ssl,ecdh) \ - SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh) -# define SSL_CTX_add_extra_chain_cert(ctx,x509) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509) -# define SSL_CTX_get_extra_chain_certs(ctx,px509) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,0,px509) -# define SSL_CTX_get_extra_chain_certs_only(ctx,px509) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,1,px509) -# define SSL_CTX_clear_extra_chain_certs(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS,0,NULL) -# define SSL_CTX_set0_chain(ctx,sk) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)sk) -# define SSL_CTX_set1_chain(ctx,sk) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,1,(char *)sk) -# define SSL_CTX_add0_chain_cert(ctx,x509) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,(char *)x509) -# define SSL_CTX_add1_chain_cert(ctx,x509) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)x509) -# define SSL_CTX_get0_chain_certs(ctx,px509) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509) -# define SSL_CTX_clear_chain_certs(ctx) \ - SSL_CTX_set0_chain(ctx,NULL) -# define SSL_CTX_build_cert_chain(ctx, flags) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL) -# define SSL_CTX_select_current_cert(ctx,x509) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)x509) -# define SSL_CTX_set_current_cert(ctx, op) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURRENT_CERT, op, NULL) -# define SSL_CTX_set0_verify_cert_store(ctx,st) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)st) -# define SSL_CTX_set1_verify_cert_store(ctx,st) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)st) -# define SSL_CTX_set0_chain_cert_store(ctx,st) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)st) -# define SSL_CTX_set1_chain_cert_store(ctx,st) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)st) -# define SSL_set0_chain(ctx,sk) \ - SSL_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)sk) -# define SSL_set1_chain(ctx,sk) \ - SSL_ctrl(ctx,SSL_CTRL_CHAIN,1,(char *)sk) -# define SSL_add0_chain_cert(ctx,x509) \ - SSL_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,(char *)x509) -# define SSL_add1_chain_cert(ctx,x509) \ - SSL_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)x509) -# define SSL_get0_chain_certs(ctx,px509) \ - SSL_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509) -# define SSL_clear_chain_certs(ctx) \ - SSL_set0_chain(ctx,NULL) -# define SSL_build_cert_chain(s, flags) \ - SSL_ctrl(s,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL) -# define SSL_select_current_cert(ctx,x509) \ - SSL_ctrl(ctx,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)x509) -# define SSL_set_current_cert(ctx,op) \ - SSL_ctrl(ctx,SSL_CTRL_SET_CURRENT_CERT, op, NULL) -# define SSL_set0_verify_cert_store(s,st) \ - SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)st) -# define SSL_set1_verify_cert_store(s,st) \ - SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)st) -# define SSL_set0_chain_cert_store(s,st) \ - SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)st) -# define SSL_set1_chain_cert_store(s,st) \ - SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)st) -# define SSL_get1_curves(ctx, s) \ - SSL_ctrl(ctx,SSL_CTRL_GET_CURVES,0,(char *)s) -# define SSL_CTX_set1_curves(ctx, clist, clistlen) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURVES,clistlen,(char *)clist) -# define SSL_CTX_set1_curves_list(ctx, s) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURVES_LIST,0,(char *)s) -# define SSL_set1_curves(ctx, clist, clistlen) \ - SSL_ctrl(ctx,SSL_CTRL_SET_CURVES,clistlen,(char *)clist) -# define SSL_set1_curves_list(ctx, s) \ - SSL_ctrl(ctx,SSL_CTRL_SET_CURVES_LIST,0,(char *)s) -# define SSL_get_shared_curve(s, n) \ - SSL_ctrl(s,SSL_CTRL_GET_SHARED_CURVE,n,NULL) -# define SSL_CTX_set_ecdh_auto(ctx, onoff) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_ECDH_AUTO,onoff,NULL) -# define SSL_set_ecdh_auto(s, onoff) \ - SSL_ctrl(s,SSL_CTRL_SET_ECDH_AUTO,onoff,NULL) -# define SSL_CTX_set1_sigalgs(ctx, slist, slistlen) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist) -# define SSL_CTX_set1_sigalgs_list(ctx, s) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) -# define SSL_set1_sigalgs(ctx, slist, slistlen) \ - SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist) -# define SSL_set1_sigalgs_list(ctx, s) \ - SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) -# define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,slistlen,(int *)slist) -# define SSL_CTX_set1_client_sigalgs_list(ctx, s) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)s) -# define SSL_set1_client_sigalgs(ctx, slist, slistlen) \ - SSL_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,clistlen,(int *)slist) -# define SSL_set1_client_sigalgs_list(ctx, s) \ - SSL_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)s) -# define SSL_get0_certificate_types(s, clist) \ - SSL_ctrl(s, SSL_CTRL_GET_CLIENT_CERT_TYPES, 0, (char *)clist) -# define SSL_CTX_set1_client_certificate_types(ctx, clist, clistlen) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen,(char *)clist) -# define SSL_set1_client_certificate_types(s, clist, clistlen) \ - SSL_ctrl(s,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen,(char *)clist) -# define SSL_get_peer_signature_nid(s, pn) \ - SSL_ctrl(s,SSL_CTRL_GET_PEER_SIGNATURE_NID,0,pn) -# define SSL_get_server_tmp_key(s, pk) \ - SSL_ctrl(s,SSL_CTRL_GET_SERVER_TMP_KEY,0,pk) -# define SSL_get0_raw_cipherlist(s, plst) \ - SSL_ctrl(s,SSL_CTRL_GET_RAW_CIPHERLIST,0,(char *)plst) -# define SSL_get0_ec_point_formats(s, plst) \ - SSL_ctrl(s,SSL_CTRL_GET_EC_POINT_FORMATS,0,(char *)plst) -# ifndef OPENSSL_NO_BIO -BIO_METHOD *BIO_f_ssl(void); -BIO *BIO_new_ssl(SSL_CTX *ctx, int client); -BIO *BIO_new_ssl_connect(SSL_CTX *ctx); -BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx); -int BIO_ssl_copy_session_id(BIO *to, BIO *from); -void BIO_ssl_shutdown(BIO *ssl_bio); - -# endif - -int SSL_CTX_set_cipher_list(SSL_CTX *, const char *str); -SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth); -void SSL_CTX_free(SSL_CTX *); -long SSL_CTX_set_timeout(SSL_CTX *ctx, long t); -long SSL_CTX_get_timeout(const SSL_CTX *ctx); -X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *); -void SSL_CTX_set_cert_store(SSL_CTX *, X509_STORE *); -int SSL_want(const SSL *s); -int SSL_clear(SSL *s); - -void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm); - -const SSL_CIPHER *SSL_get_current_cipher(const SSL *s); -int SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits); -char *SSL_CIPHER_get_version(const SSL_CIPHER *c); -const char *SSL_CIPHER_get_name(const SSL_CIPHER *c); -unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c); - -int SSL_get_fd(const SSL *s); -int SSL_get_rfd(const SSL *s); -int SSL_get_wfd(const SSL *s); -const char *SSL_get_cipher_list(const SSL *s, int n); -char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len); -int SSL_get_read_ahead(const SSL *s); -int SSL_pending(const SSL *s); -# ifndef OPENSSL_NO_SOCK -int SSL_set_fd(SSL *s, int fd); -int SSL_set_rfd(SSL *s, int fd); -int SSL_set_wfd(SSL *s, int fd); -# endif -# ifndef OPENSSL_NO_BIO -void SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio); -BIO *SSL_get_rbio(const SSL *s); -BIO *SSL_get_wbio(const SSL *s); -# endif -int SSL_set_cipher_list(SSL *s, const char *str); -void SSL_set_read_ahead(SSL *s, int yes); -int SSL_get_verify_mode(const SSL *s); -int SSL_get_verify_depth(const SSL *s); -int (*SSL_get_verify_callback(const SSL *s)) (int, X509_STORE_CTX *); -void SSL_set_verify(SSL *s, int mode, - int (*callback) (int ok, X509_STORE_CTX *ctx)); -void SSL_set_verify_depth(SSL *s, int depth); -void SSL_set_cert_cb(SSL *s, int (*cb) (SSL *ssl, void *arg), void *arg); -# ifndef OPENSSL_NO_RSA -int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa); -# endif -int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len); -int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey); -int SSL_use_PrivateKey_ASN1(int pk, SSL *ssl, const unsigned char *d, - long len); -int SSL_use_certificate(SSL *ssl, X509 *x); -int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len); - -# ifndef OPENSSL_NO_TLSEXT -/* Set serverinfo data for the current active cert. */ -int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo, - size_t serverinfo_length); -# ifndef OPENSSL_NO_STDIO -int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file); -# endif /* NO_STDIO */ - -# endif - -# ifndef OPENSSL_NO_STDIO -int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type); -int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type); -int SSL_use_certificate_file(SSL *ssl, const char *file, int type); -int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type); -int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type); -int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type); -/* PEM type */ -int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); -STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); -int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, - const char *file); -# ifndef OPENSSL_SYS_VMS -/* XXXXX: Better scheme needed! [was: #ifndef MAC_OS_pre_X] */ -# ifndef OPENSSL_SYS_MACINTOSH_CLASSIC -int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, - const char *dir); -# endif -# endif - -# endif - -void SSL_load_error_strings(void); -const char *SSL_state_string(const SSL *s); -const char *SSL_rstate_string(const SSL *s); -const char *SSL_state_string_long(const SSL *s); -const char *SSL_rstate_string_long(const SSL *s); -long SSL_SESSION_get_time(const SSL_SESSION *s); -long SSL_SESSION_set_time(SSL_SESSION *s, long t); -long SSL_SESSION_get_timeout(const SSL_SESSION *s); -long SSL_SESSION_set_timeout(SSL_SESSION *s, long t); -void SSL_copy_session_id(SSL *to, const SSL *from); -X509 *SSL_SESSION_get0_peer(SSL_SESSION *s); -int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx, - unsigned int sid_ctx_len); - -SSL_SESSION *SSL_SESSION_new(void); -const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, - unsigned int *len); -unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s); -# ifndef OPENSSL_NO_FP_API -int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *ses); -# endif -# ifndef OPENSSL_NO_BIO -int SSL_SESSION_print(BIO *fp, const SSL_SESSION *ses); -# endif -void SSL_SESSION_free(SSL_SESSION *ses); -int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); -int SSL_set_session(SSL *to, SSL_SESSION *session); -int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); -int SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *c); -int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB); -int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB); -int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id, - unsigned int id_len); -SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, - long length); - -# ifdef HEADER_X509_H -X509 *SSL_get_peer_certificate(const SSL *s); -# endif - -STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s); - -int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); -int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); -int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int, - X509_STORE_CTX *); -void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, - int (*callback) (int, X509_STORE_CTX *)); -void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); -void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, - int (*cb) (X509_STORE_CTX *, void *), - void *arg); -void SSL_CTX_set_cert_cb(SSL_CTX *c, int (*cb) (SSL *ssl, void *arg), - void *arg); -# ifndef OPENSSL_NO_RSA -int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); -# endif -int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, - long len); -int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); -int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx, - const unsigned char *d, long len); -int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); -int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, - const unsigned char *d); - -void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb); -void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u); - -int SSL_CTX_check_private_key(const SSL_CTX *ctx); -int SSL_check_private_key(const SSL *ctx); - -int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx, - unsigned int sid_ctx_len); - -SSL *SSL_new(SSL_CTX *ctx); -int SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx, - unsigned int sid_ctx_len); - -int SSL_CTX_set_purpose(SSL_CTX *s, int purpose); -int SSL_set_purpose(SSL *s, int purpose); -int SSL_CTX_set_trust(SSL_CTX *s, int trust); -int SSL_set_trust(SSL *s, int trust); - -int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm); -int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm); - -X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx); -X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl); - -# ifndef OPENSSL_NO_SRP -int SSL_CTX_set_srp_username(SSL_CTX *ctx, char *name); -int SSL_CTX_set_srp_password(SSL_CTX *ctx, char *password); -int SSL_CTX_set_srp_strength(SSL_CTX *ctx, int strength); -int SSL_CTX_set_srp_client_pwd_callback(SSL_CTX *ctx, - char *(*cb) (SSL *, void *)); -int SSL_CTX_set_srp_verify_param_callback(SSL_CTX *ctx, - int (*cb) (SSL *, void *)); -int SSL_CTX_set_srp_username_callback(SSL_CTX *ctx, - int (*cb) (SSL *, int *, void *)); -int SSL_CTX_set_srp_cb_arg(SSL_CTX *ctx, void *arg); - -int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g, - BIGNUM *sa, BIGNUM *v, char *info); -int SSL_set_srp_server_param_pw(SSL *s, const char *user, const char *pass, - const char *grp); - -BIGNUM *SSL_get_srp_g(SSL *s); -BIGNUM *SSL_get_srp_N(SSL *s); - -char *SSL_get_srp_username(SSL *s); -char *SSL_get_srp_userinfo(SSL *s); -# endif - -void SSL_certs_clear(SSL *s); -void SSL_free(SSL *ssl); -int SSL_accept(SSL *ssl); -int SSL_connect(SSL *ssl); -int SSL_read(SSL *ssl, void *buf, int num); -int SSL_peek(SSL *ssl, void *buf, int num); -int SSL_write(SSL *ssl, const void *buf, int num); -long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg); -long SSL_callback_ctrl(SSL *, int, void (*)(void)); -long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg); -long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void)); - -int SSL_get_error(const SSL *s, int ret_code); -const char *SSL_get_version(const SSL *s); - -/* This sets the 'default' SSL version that SSL_new() will create */ -int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth); - -# ifndef OPENSSL_NO_SSL2_METHOD -const SSL_METHOD *SSLv2_method(void); /* SSLv2 */ -const SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */ -const SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */ -# endif - -# ifndef OPENSSL_NO_SSL3_METHOD -const SSL_METHOD *SSLv3_method(void); /* SSLv3 */ -const SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */ -const SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */ -# endif - -const SSL_METHOD *SSLv23_method(void); /* Negotiate highest available SSL/TLS - * version */ -const SSL_METHOD *SSLv23_server_method(void); /* Negotiate highest available - * SSL/TLS version */ -const SSL_METHOD *SSLv23_client_method(void); /* Negotiate highest available - * SSL/TLS version */ - -const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */ -const SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */ -const SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */ - -const SSL_METHOD *TLSv1_1_method(void); /* TLSv1.1 */ -const SSL_METHOD *TLSv1_1_server_method(void); /* TLSv1.1 */ -const SSL_METHOD *TLSv1_1_client_method(void); /* TLSv1.1 */ - -const SSL_METHOD *TLSv1_2_method(void); /* TLSv1.2 */ -const SSL_METHOD *TLSv1_2_server_method(void); /* TLSv1.2 */ -const SSL_METHOD *TLSv1_2_client_method(void); /* TLSv1.2 */ - -const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */ -const SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */ -const SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */ - -const SSL_METHOD *DTLSv1_2_method(void); /* DTLSv1.2 */ -const SSL_METHOD *DTLSv1_2_server_method(void); /* DTLSv1.2 */ -const SSL_METHOD *DTLSv1_2_client_method(void); /* DTLSv1.2 */ - -const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */ -const SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */ -const SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */ - -STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s); - -int SSL_do_handshake(SSL *s); -int SSL_renegotiate(SSL *s); -int SSL_renegotiate_abbreviated(SSL *s); -int SSL_renegotiate_pending(SSL *s); -int SSL_shutdown(SSL *s); - -const SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx); -const SSL_METHOD *SSL_get_ssl_method(SSL *s); -int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method); -const char *SSL_alert_type_string_long(int value); -const char *SSL_alert_type_string(int value); -const char *SSL_alert_desc_string_long(int value); -const char *SSL_alert_desc_string(int value); - -void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list); -void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list); -STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s); -STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s); -int SSL_add_client_CA(SSL *ssl, X509 *x); -int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x); - -void SSL_set_connect_state(SSL *s); -void SSL_set_accept_state(SSL *s); - -long SSL_get_default_timeout(const SSL *s); - -int SSL_library_init(void); - -char *SSL_CIPHER_description(const SSL_CIPHER *, char *buf, int size); -STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk); - -SSL *SSL_dup(SSL *ssl); - -X509 *SSL_get_certificate(const SSL *ssl); -/* - * EVP_PKEY - */ struct evp_pkey_st *SSL_get_privatekey(const SSL *ssl); - -X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx); -EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx); - -void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode); -int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); -void SSL_set_quiet_shutdown(SSL *ssl, int mode); -int SSL_get_quiet_shutdown(const SSL *ssl); -void SSL_set_shutdown(SSL *ssl, int mode); -int SSL_get_shutdown(const SSL *ssl); -int SSL_version(const SSL *ssl); -int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); -int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, - const char *CApath); -# define SSL_get0_session SSL_get_session/* just peek at pointer */ -SSL_SESSION *SSL_get_session(const SSL *ssl); -SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */ -SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); -SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx); -void SSL_set_info_callback(SSL *ssl, - void (*cb) (const SSL *ssl, int type, int val)); -void (*SSL_get_info_callback(const SSL *ssl)) (const SSL *ssl, int type, - int val); -int SSL_state(const SSL *ssl); -void SSL_set_state(SSL *ssl, int state); - -void SSL_set_verify_result(SSL *ssl, long v); -long SSL_get_verify_result(const SSL *ssl); - -int SSL_set_ex_data(SSL *ssl, int idx, void *data); -void *SSL_get_ex_data(const SSL *ssl, int idx); -int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); - -int SSL_SESSION_set_ex_data(SSL_SESSION *ss, int idx, void *data); -void *SSL_SESSION_get_ex_data(const SSL_SESSION *ss, int idx); -int SSL_SESSION_get_ex_new_index(long argl, void *argp, - CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, - CRYPTO_EX_free *free_func); - -int SSL_CTX_set_ex_data(SSL_CTX *ssl, int idx, void *data); -void *SSL_CTX_get_ex_data(const SSL_CTX *ssl, int idx); -int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, - CRYPTO_EX_free *free_func); - -int SSL_get_ex_data_X509_STORE_CTX_idx(void); - -# define SSL_CTX_sess_set_cache_size(ctx,t) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL) -# define SSL_CTX_sess_get_cache_size(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL) -# define SSL_CTX_set_session_cache_mode(ctx,m) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL) -# define SSL_CTX_get_session_cache_mode(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL) - -# define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx) -# define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m) -# define SSL_CTX_get_read_ahead(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL) -# define SSL_CTX_set_read_ahead(ctx,m) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL) -# define SSL_CTX_get_max_cert_list(ctx) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) -# define SSL_CTX_set_max_cert_list(ctx,m) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) -# define SSL_get_max_cert_list(ssl) \ - SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) -# define SSL_set_max_cert_list(ssl,m) \ - SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) - -# define SSL_CTX_set_max_send_fragment(ctx,m) \ - SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) -# define SSL_set_max_send_fragment(ssl,m) \ - SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL) - - /* NB: the keylength is only applicable when is_export is true */ -# ifndef OPENSSL_NO_RSA -void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, - RSA *(*cb) (SSL *ssl, int is_export, - int keylength)); - -void SSL_set_tmp_rsa_callback(SSL *ssl, - RSA *(*cb) (SSL *ssl, int is_export, - int keylength)); -# endif -# ifndef OPENSSL_NO_DH -void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, - DH *(*dh) (SSL *ssl, int is_export, - int keylength)); -void SSL_set_tmp_dh_callback(SSL *ssl, - DH *(*dh) (SSL *ssl, int is_export, - int keylength)); -# endif -# ifndef OPENSSL_NO_ECDH -void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx, - EC_KEY *(*ecdh) (SSL *ssl, int is_export, - int keylength)); -void SSL_set_tmp_ecdh_callback(SSL *ssl, - EC_KEY *(*ecdh) (SSL *ssl, int is_export, - int keylength)); -# endif - -const COMP_METHOD *SSL_get_current_compression(SSL *s); -const COMP_METHOD *SSL_get_current_expansion(SSL *s); -const char *SSL_COMP_get_name(const COMP_METHOD *comp); -STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); -STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) - *meths); -void SSL_COMP_free_compression_methods(void); -int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm); - -const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr); - -/* TLS extensions functions */ -int SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len); - -int SSL_set_session_ticket_ext_cb(SSL *s, tls_session_ticket_ext_cb_fn cb, - void *arg); - -/* Pre-shared secret session resumption functions */ -int SSL_set_session_secret_cb(SSL *s, - tls_session_secret_cb_fn tls_session_secret_cb, - void *arg); - -void SSL_set_debug(SSL *s, int debug); -int SSL_cache_hit(SSL *s); -int SSL_is_server(SSL *s); - -SSL_CONF_CTX *SSL_CONF_CTX_new(void); -int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx); -void SSL_CONF_CTX_free(SSL_CONF_CTX *cctx); -unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags); -unsigned int SSL_CONF_CTX_clear_flags(SSL_CONF_CTX *cctx, unsigned int flags); -int SSL_CONF_CTX_set1_prefix(SSL_CONF_CTX *cctx, const char *pre); - -void SSL_CONF_CTX_set_ssl(SSL_CONF_CTX *cctx, SSL *ssl); -void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx); - -int SSL_CONF_cmd(SSL_CONF_CTX *cctx, const char *cmd, const char *value); -int SSL_CONF_cmd_argv(SSL_CONF_CTX *cctx, int *pargc, char ***pargv); -int SSL_CONF_cmd_value_type(SSL_CONF_CTX *cctx, const char *cmd); - -# ifndef OPENSSL_NO_SSL_TRACE -void SSL_trace(int write_p, int version, int content_type, - const void *buf, size_t len, SSL *ssl, void *arg); -const char *SSL_CIPHER_standard_name(const SSL_CIPHER *c); -# endif - -# ifndef OPENSSL_NO_UNIT_TEST -const struct openssl_ssl_test_functions *SSL_test_functions(void); -# endif - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_SSL_strings(void); - -/* Error codes for the SSL functions. */ - -/* Function codes. */ -# define SSL_F_CHECK_SUITEB_CIPHER_LIST 331 -# define SSL_F_CLIENT_CERTIFICATE 100 -# define SSL_F_CLIENT_FINISHED 167 -# define SSL_F_CLIENT_HELLO 101 -# define SSL_F_CLIENT_MASTER_KEY 102 -# define SSL_F_D2I_SSL_SESSION 103 -# define SSL_F_DO_DTLS1_WRITE 245 -# define SSL_F_DO_SSL3_WRITE 104 -# define SSL_F_DTLS1_ACCEPT 246 -# define SSL_F_DTLS1_ADD_CERT_TO_BUF 295 -# define SSL_F_DTLS1_BUFFER_RECORD 247 -# define SSL_F_DTLS1_CHECK_TIMEOUT_NUM 316 -# define SSL_F_DTLS1_CLIENT_HELLO 248 -# define SSL_F_DTLS1_CONNECT 249 -# define SSL_F_DTLS1_ENC 250 -# define SSL_F_DTLS1_GET_HELLO_VERIFY 251 -# define SSL_F_DTLS1_GET_MESSAGE 252 -# define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 253 -# define SSL_F_DTLS1_GET_RECORD 254 -# define SSL_F_DTLS1_HANDLE_TIMEOUT 297 -# define SSL_F_DTLS1_HEARTBEAT 305 -# define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255 -# define SSL_F_DTLS1_PREPROCESS_FRAGMENT 288 -# define SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS 424 -# define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256 -# define SSL_F_DTLS1_PROCESS_RECORD 257 -# define SSL_F_DTLS1_READ_BYTES 258 -# define SSL_F_DTLS1_READ_FAILED 259 -# define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST 260 -# define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE 261 -# define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE 262 -# define SSL_F_DTLS1_SEND_CLIENT_VERIFY 263 -# define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST 264 -# define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE 265 -# define SSL_F_DTLS1_SEND_SERVER_HELLO 266 -# define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE 267 -# define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 268 -# define SSL_F_GET_CLIENT_FINISHED 105 -# define SSL_F_GET_CLIENT_HELLO 106 -# define SSL_F_GET_CLIENT_MASTER_KEY 107 -# define SSL_F_GET_SERVER_FINISHED 108 -# define SSL_F_GET_SERVER_HELLO 109 -# define SSL_F_GET_SERVER_STATIC_DH_KEY 340 -# define SSL_F_GET_SERVER_VERIFY 110 -# define SSL_F_I2D_SSL_SESSION 111 -# define SSL_F_READ_N 112 -# define SSL_F_REQUEST_CERTIFICATE 113 -# define SSL_F_SERVER_FINISH 239 -# define SSL_F_SERVER_HELLO 114 -# define SSL_F_SERVER_VERIFY 240 -# define SSL_F_SSL23_ACCEPT 115 -# define SSL_F_SSL23_CLIENT_HELLO 116 -# define SSL_F_SSL23_CONNECT 117 -# define SSL_F_SSL23_GET_CLIENT_HELLO 118 -# define SSL_F_SSL23_GET_SERVER_HELLO 119 -# define SSL_F_SSL23_PEEK 237 -# define SSL_F_SSL23_READ 120 -# define SSL_F_SSL23_WRITE 121 -# define SSL_F_SSL2_ACCEPT 122 -# define SSL_F_SSL2_CONNECT 123 -# define SSL_F_SSL2_ENC_INIT 124 -# define SSL_F_SSL2_GENERATE_KEY_MATERIAL 241 -# define SSL_F_SSL2_PEEK 234 -# define SSL_F_SSL2_READ 125 -# define SSL_F_SSL2_READ_INTERNAL 236 -# define SSL_F_SSL2_SET_CERTIFICATE 126 -# define SSL_F_SSL2_WRITE 127 -# define SSL_F_SSL3_ACCEPT 128 -# define SSL_F_SSL3_ADD_CERT_TO_BUF 296 -# define SSL_F_SSL3_CALLBACK_CTRL 233 -# define SSL_F_SSL3_CHANGE_CIPHER_STATE 129 -# define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130 -# define SSL_F_SSL3_CHECK_CLIENT_HELLO 304 -# define SSL_F_SSL3_CHECK_FINISHED 339 -# define SSL_F_SSL3_CLIENT_HELLO 131 -# define SSL_F_SSL3_CONNECT 132 -# define SSL_F_SSL3_CTRL 213 -# define SSL_F_SSL3_CTX_CTRL 133 -# define SSL_F_SSL3_DIGEST_CACHED_RECORDS 293 -# define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 292 -# define SSL_F_SSL3_ENC 134 -# define SSL_F_SSL3_GENERATE_KEY_BLOCK 238 -# define SSL_F_SSL3_GENERATE_MASTER_SECRET 388 -# define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135 -# define SSL_F_SSL3_GET_CERT_STATUS 289 -# define SSL_F_SSL3_GET_CERT_VERIFY 136 -# define SSL_F_SSL3_GET_CLIENT_CERTIFICATE 137 -# define SSL_F_SSL3_GET_CLIENT_HELLO 138 -# define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE 139 -# define SSL_F_SSL3_GET_FINISHED 140 -# define SSL_F_SSL3_GET_KEY_EXCHANGE 141 -# define SSL_F_SSL3_GET_MESSAGE 142 -# define SSL_F_SSL3_GET_NEW_SESSION_TICKET 283 -# define SSL_F_SSL3_GET_NEXT_PROTO 306 -# define SSL_F_SSL3_GET_RECORD 143 -# define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144 -# define SSL_F_SSL3_GET_SERVER_DONE 145 -# define SSL_F_SSL3_GET_SERVER_HELLO 146 -# define SSL_F_SSL3_HANDSHAKE_MAC 285 -# define SSL_F_SSL3_NEW_SESSION_TICKET 287 -# define SSL_F_SSL3_OUTPUT_CERT_CHAIN 147 -# define SSL_F_SSL3_PEEK 235 -# define SSL_F_SSL3_READ_BYTES 148 -# define SSL_F_SSL3_READ_N 149 -# define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST 150 -# define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE 151 -# define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE 152 -# define SSL_F_SSL3_SEND_CLIENT_VERIFY 153 -# define SSL_F_SSL3_SEND_SERVER_CERTIFICATE 154 -# define SSL_F_SSL3_SEND_SERVER_HELLO 242 -# define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE 155 -# define SSL_F_SSL3_SETUP_KEY_BLOCK 157 -# define SSL_F_SSL3_SETUP_READ_BUFFER 156 -# define SSL_F_SSL3_SETUP_WRITE_BUFFER 291 -# define SSL_F_SSL3_WRITE_BYTES 158 -# define SSL_F_SSL3_WRITE_PENDING 159 -# define SSL_F_SSL_ADD_CERT_CHAIN 318 -# define SSL_F_SSL_ADD_CERT_TO_BUF 319 -# define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT 298 -# define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 277 -# define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT 307 -# define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215 -# define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216 -# define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT 299 -# define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 278 -# define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT 308 -# define SSL_F_SSL_BAD_METHOD 160 -# define SSL_F_SSL_BUILD_CERT_CHAIN 332 -# define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161 -# define SSL_F_SSL_CERT_DUP 221 -# define SSL_F_SSL_CERT_INST 222 -# define SSL_F_SSL_CERT_INSTANTIATE 214 -# define SSL_F_SSL_CERT_NEW 162 -# define SSL_F_SSL_CHECK_PRIVATE_KEY 163 -# define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT 280 -# define SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG 279 -# define SSL_F_SSL_CIPHER_PROCESS_RULESTR 230 -# define SSL_F_SSL_CIPHER_STRENGTH_SORT 231 -# define SSL_F_SSL_CLEAR 164 -# define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 165 -# define SSL_F_SSL_CONF_CMD 334 -# define SSL_F_SSL_CREATE_CIPHER_LIST 166 -# define SSL_F_SSL_CTRL 232 -# define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168 -# define SSL_F_SSL_CTX_MAKE_PROFILES 309 -# define SSL_F_SSL_CTX_NEW 169 -# define SSL_F_SSL_CTX_SET_CIPHER_LIST 269 -# define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 290 -# define SSL_F_SSL_CTX_SET_PURPOSE 226 -# define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 219 -# define SSL_F_SSL_CTX_SET_SSL_VERSION 170 -# define SSL_F_SSL_CTX_SET_TRUST 229 -# define SSL_F_SSL_CTX_USE_CERTIFICATE 171 -# define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172 -# define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE 220 -# define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173 -# define SSL_F_SSL_CTX_USE_PRIVATEKEY 174 -# define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175 -# define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 176 -# define SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT 272 -# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 177 -# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 178 -# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 179 -# define SSL_F_SSL_CTX_USE_SERVERINFO 336 -# define SSL_F_SSL_CTX_USE_SERVERINFO_FILE 337 -# define SSL_F_SSL_DO_HANDSHAKE 180 -# define SSL_F_SSL_GET_NEW_SESSION 181 -# define SSL_F_SSL_GET_PREV_SESSION 217 -# define SSL_F_SSL_GET_SERVER_CERT_INDEX 322 -# define SSL_F_SSL_GET_SERVER_SEND_CERT 182 -# define SSL_F_SSL_GET_SERVER_SEND_PKEY 317 -# define SSL_F_SSL_GET_SIGN_PKEY 183 -# define SSL_F_SSL_INIT_WBIO_BUFFER 184 -# define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185 -# define SSL_F_SSL_NEW 186 -# define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 300 -# define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 302 -# define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT 310 -# define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 301 -# define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 303 -# define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311 -# define SSL_F_SSL_PEEK 270 -# define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT 281 -# define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT 282 -# define SSL_F_SSL_READ 223 -# define SSL_F_SSL_RSA_PRIVATE_DECRYPT 187 -# define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188 -# define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 320 -# define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 321 -# define SSL_F_SSL_SESSION_DUP 348 -# define SSL_F_SSL_SESSION_NEW 189 -# define SSL_F_SSL_SESSION_PRINT_FP 190 -# define SSL_F_SSL_SESSION_SET1_ID_CONTEXT 312 -# define SSL_F_SSL_SESS_CERT_NEW 225 -# define SSL_F_SSL_SET_CERT 191 -# define SSL_F_SSL_SET_CIPHER_LIST 271 -# define SSL_F_SSL_SET_FD 192 -# define SSL_F_SSL_SET_PKEY 193 -# define SSL_F_SSL_SET_PURPOSE 227 -# define SSL_F_SSL_SET_RFD 194 -# define SSL_F_SSL_SET_SESSION 195 -# define SSL_F_SSL_SET_SESSION_ID_CONTEXT 218 -# define SSL_F_SSL_SET_SESSION_TICKET_EXT 294 -# define SSL_F_SSL_SET_TRUST 228 -# define SSL_F_SSL_SET_WFD 196 -# define SSL_F_SSL_SHUTDOWN 224 -# define SSL_F_SSL_SRP_CTX_INIT 313 -# define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243 -# define SSL_F_SSL_UNDEFINED_FUNCTION 197 -# define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244 -# define SSL_F_SSL_USE_CERTIFICATE 198 -# define SSL_F_SSL_USE_CERTIFICATE_ASN1 199 -# define SSL_F_SSL_USE_CERTIFICATE_FILE 200 -# define SSL_F_SSL_USE_PRIVATEKEY 201 -# define SSL_F_SSL_USE_PRIVATEKEY_ASN1 202 -# define SSL_F_SSL_USE_PRIVATEKEY_FILE 203 -# define SSL_F_SSL_USE_PSK_IDENTITY_HINT 273 -# define SSL_F_SSL_USE_RSAPRIVATEKEY 204 -# define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 205 -# define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 206 -# define SSL_F_SSL_VERIFY_CERT_CHAIN 207 -# define SSL_F_SSL_WRITE 208 -# define SSL_F_TLS12_CHECK_PEER_SIGALG 333 -# define SSL_F_TLS1_CERT_VERIFY_MAC 286 -# define SSL_F_TLS1_CHANGE_CIPHER_STATE 209 -# define SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT 274 -# define SSL_F_TLS1_ENC 210 -# define SSL_F_TLS1_EXPORT_KEYING_MATERIAL 314 -# define SSL_F_TLS1_GET_CURVELIST 338 -# define SSL_F_TLS1_HEARTBEAT 315 -# define SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT 275 -# define SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT 276 -# define SSL_F_TLS1_PRF 284 -# define SSL_F_TLS1_SETUP_KEY_BLOCK 211 -# define SSL_F_TLS1_SET_SERVER_SIGALGS 335 -# define SSL_F_WRITE_PENDING 212 - -/* Reason codes. */ -# define SSL_R_APP_DATA_IN_HANDSHAKE 100 -# define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272 -# define SSL_R_BAD_ALERT_RECORD 101 -# define SSL_R_BAD_AUTHENTICATION_TYPE 102 -# define SSL_R_BAD_CHANGE_CIPHER_SPEC 103 -# define SSL_R_BAD_CHECKSUM 104 -# define SSL_R_BAD_DATA 390 -# define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 -# define SSL_R_BAD_DECOMPRESSION 107 -# define SSL_R_BAD_DH_G_LENGTH 108 -# define SSL_R_BAD_DH_G_VALUE 375 -# define SSL_R_BAD_DH_PUB_KEY_LENGTH 109 -# define SSL_R_BAD_DH_PUB_KEY_VALUE 393 -# define SSL_R_BAD_DH_P_LENGTH 110 -# define SSL_R_BAD_DH_P_VALUE 395 -# define SSL_R_BAD_DIGEST_LENGTH 111 -# define SSL_R_BAD_DSA_SIGNATURE 112 -# define SSL_R_BAD_ECC_CERT 304 -# define SSL_R_BAD_ECDSA_SIGNATURE 305 -# define SSL_R_BAD_ECPOINT 306 -# define SSL_R_BAD_HANDSHAKE_LENGTH 332 -# define SSL_R_BAD_HELLO_REQUEST 105 -# define SSL_R_BAD_LENGTH 271 -# define SSL_R_BAD_MAC_DECODE 113 -# define SSL_R_BAD_MAC_LENGTH 333 -# define SSL_R_BAD_MESSAGE_TYPE 114 -# define SSL_R_BAD_PACKET_LENGTH 115 -# define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116 -# define SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH 316 -# define SSL_R_BAD_RESPONSE_ARGUMENT 117 -# define SSL_R_BAD_RSA_DECRYPT 118 -# define SSL_R_BAD_RSA_ENCRYPT 119 -# define SSL_R_BAD_RSA_E_LENGTH 120 -# define SSL_R_BAD_RSA_MODULUS_LENGTH 121 -# define SSL_R_BAD_RSA_SIGNATURE 122 -# define SSL_R_BAD_SIGNATURE 123 -# define SSL_R_BAD_SRP_A_LENGTH 347 -# define SSL_R_BAD_SRP_B_LENGTH 348 -# define SSL_R_BAD_SRP_G_LENGTH 349 -# define SSL_R_BAD_SRP_N_LENGTH 350 -# define SSL_R_BAD_SRP_PARAMETERS 371 -# define SSL_R_BAD_SRP_S_LENGTH 351 -# define SSL_R_BAD_SRTP_MKI_VALUE 352 -# define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353 -# define SSL_R_BAD_SSL_FILETYPE 124 -# define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125 -# define SSL_R_BAD_STATE 126 -# define SSL_R_BAD_VALUE 384 -# define SSL_R_BAD_WRITE_RETRY 127 -# define SSL_R_BIO_NOT_SET 128 -# define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129 -# define SSL_R_BN_LIB 130 -# define SSL_R_CA_DN_LENGTH_MISMATCH 131 -# define SSL_R_CA_DN_TOO_LONG 132 -# define SSL_R_CCS_RECEIVED_EARLY 133 -# define SSL_R_CERTIFICATE_VERIFY_FAILED 134 -# define SSL_R_CERT_CB_ERROR 377 -# define SSL_R_CERT_LENGTH_MISMATCH 135 -# define SSL_R_CHALLENGE_IS_DIFFERENT 136 -# define SSL_R_CIPHER_CODE_WRONG_LENGTH 137 -# define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 138 -# define SSL_R_CIPHER_TABLE_SRC_ERROR 139 -# define SSL_R_CLIENTHELLO_TLSEXT 226 -# define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140 -# define SSL_R_COMPRESSION_DISABLED 343 -# define SSL_R_COMPRESSION_FAILURE 141 -# define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 307 -# define SSL_R_COMPRESSION_LIBRARY_ERROR 142 -# define SSL_R_CONNECTION_ID_IS_DIFFERENT 143 -# define SSL_R_CONNECTION_TYPE_NOT_SET 144 -# define SSL_R_COOKIE_MISMATCH 308 -# define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145 -# define SSL_R_DATA_LENGTH_TOO_LONG 146 -# define SSL_R_DECRYPTION_FAILED 147 -# define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 281 -# define SSL_R_DH_KEY_TOO_SMALL 372 -# define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148 -# define SSL_R_DIGEST_CHECK_FAILED 149 -# define SSL_R_DTLS_MESSAGE_TOO_BIG 334 -# define SSL_R_DUPLICATE_COMPRESSION_ID 309 -# define SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT 317 -# define SSL_R_ECC_CERT_NOT_FOR_SIGNING 318 -# define SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE 322 -# define SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE 323 -# define SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE 374 -# define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 310 -# define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354 -# define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 -# define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 282 -# define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 -# define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 -# define SSL_R_EXTRA_DATA_IN_MESSAGE 153 -# define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154 -# define SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS 355 -# define SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION 356 -# define SSL_R_HTTPS_PROXY_REQUEST 155 -# define SSL_R_HTTP_REQUEST 156 -# define SSL_R_ILLEGAL_PADDING 283 -# define SSL_R_ILLEGAL_SUITEB_DIGEST 380 -# define SSL_R_INAPPROPRIATE_FALLBACK 373 -# define SSL_R_INCONSISTENT_COMPRESSION 340 -# define SSL_R_INVALID_CHALLENGE_LENGTH 158 -# define SSL_R_INVALID_COMMAND 280 -# define SSL_R_INVALID_COMPRESSION_ALGORITHM 341 -# define SSL_R_INVALID_NULL_CMD_NAME 385 -# define SSL_R_INVALID_PURPOSE 278 -# define SSL_R_INVALID_SERVERINFO_DATA 388 -# define SSL_R_INVALID_SRP_USERNAME 357 -# define SSL_R_INVALID_STATUS_RESPONSE 328 -# define SSL_R_INVALID_TICKET_KEYS_LENGTH 325 -# define SSL_R_INVALID_TRUST 279 -# define SSL_R_KEY_ARG_TOO_LONG 284 -# define SSL_R_KRB5 285 -# define SSL_R_KRB5_C_CC_PRINC 286 -# define SSL_R_KRB5_C_GET_CRED 287 -# define SSL_R_KRB5_C_INIT 288 -# define SSL_R_KRB5_C_MK_REQ 289 -# define SSL_R_KRB5_S_BAD_TICKET 290 -# define SSL_R_KRB5_S_INIT 291 -# define SSL_R_KRB5_S_RD_REQ 292 -# define SSL_R_KRB5_S_TKT_EXPIRED 293 -# define SSL_R_KRB5_S_TKT_NYV 294 -# define SSL_R_KRB5_S_TKT_SKEW 295 -# define SSL_R_LENGTH_MISMATCH 159 -# define SSL_R_LENGTH_TOO_SHORT 160 -# define SSL_R_LIBRARY_BUG 274 -# define SSL_R_LIBRARY_HAS_NO_CIPHERS 161 -# define SSL_R_MESSAGE_TOO_LONG 296 -# define SSL_R_MISSING_DH_DSA_CERT 162 -# define SSL_R_MISSING_DH_KEY 163 -# define SSL_R_MISSING_DH_RSA_CERT 164 -# define SSL_R_MISSING_DSA_SIGNING_CERT 165 -# define SSL_R_MISSING_ECDH_CERT 382 -# define SSL_R_MISSING_ECDSA_SIGNING_CERT 381 -# define SSL_R_MISSING_EXPORT_TMP_DH_KEY 166 -# define SSL_R_MISSING_EXPORT_TMP_RSA_KEY 167 -# define SSL_R_MISSING_RSA_CERTIFICATE 168 -# define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169 -# define SSL_R_MISSING_RSA_SIGNING_CERT 170 -# define SSL_R_MISSING_SRP_PARAM 358 -# define SSL_R_MISSING_TMP_DH_KEY 171 -# define SSL_R_MISSING_TMP_ECDH_KEY 311 -# define SSL_R_MISSING_TMP_RSA_KEY 172 -# define SSL_R_MISSING_TMP_RSA_PKEY 173 -# define SSL_R_MISSING_VERIFY_MESSAGE 174 -# define SSL_R_MULTIPLE_SGC_RESTARTS 346 -# define SSL_R_NON_SSLV2_INITIAL_PACKET 175 -# define SSL_R_NO_CERTIFICATES_RETURNED 176 -# define SSL_R_NO_CERTIFICATE_ASSIGNED 177 -# define SSL_R_NO_CERTIFICATE_RETURNED 178 -# define SSL_R_NO_CERTIFICATE_SET 179 -# define SSL_R_NO_CERTIFICATE_SPECIFIED 180 -# define SSL_R_NO_CIPHERS_AVAILABLE 181 -# define SSL_R_NO_CIPHERS_PASSED 182 -# define SSL_R_NO_CIPHERS_SPECIFIED 183 -# define SSL_R_NO_CIPHER_LIST 184 -# define SSL_R_NO_CIPHER_MATCH 185 -# define SSL_R_NO_CLIENT_CERT_METHOD 331 -# define SSL_R_NO_CLIENT_CERT_RECEIVED 186 -# define SSL_R_NO_COMPRESSION_SPECIFIED 187 -# define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER 330 -# define SSL_R_NO_METHOD_SPECIFIED 188 -# define SSL_R_NO_PEM_EXTENSIONS 389 -# define SSL_R_NO_PRIVATEKEY 189 -# define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190 -# define SSL_R_NO_PROTOCOLS_AVAILABLE 191 -# define SSL_R_NO_PUBLICKEY 192 -# define SSL_R_NO_RENEGOTIATION 339 -# define SSL_R_NO_REQUIRED_DIGEST 324 -# define SSL_R_NO_SHARED_CIPHER 193 -# define SSL_R_NO_SHARED_SIGATURE_ALGORITHMS 376 -# define SSL_R_NO_SRTP_PROFILES 359 -# define SSL_R_NO_VERIFY_CALLBACK 194 -# define SSL_R_NULL_SSL_CTX 195 -# define SSL_R_NULL_SSL_METHOD_PASSED 196 -# define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197 -# define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344 -# define SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE 387 -# define SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE 379 -# define SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE 297 -# define SSL_R_OPAQUE_PRF_INPUT_TOO_LONG 327 -# define SSL_R_PACKET_LENGTH_TOO_LONG 198 -# define SSL_R_PARSE_TLSEXT 227 -# define SSL_R_PATH_TOO_LONG 270 -# define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199 -# define SSL_R_PEER_ERROR 200 -# define SSL_R_PEER_ERROR_CERTIFICATE 201 -# define SSL_R_PEER_ERROR_NO_CERTIFICATE 202 -# define SSL_R_PEER_ERROR_NO_CIPHER 203 -# define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 204 -# define SSL_R_PEM_NAME_BAD_PREFIX 391 -# define SSL_R_PEM_NAME_TOO_SHORT 392 -# define SSL_R_PRE_MAC_LENGTH_TOO_LONG 205 -# define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS 206 -# define SSL_R_PROTOCOL_IS_SHUTDOWN 207 -# define SSL_R_PSK_IDENTITY_NOT_FOUND 223 -# define SSL_R_PSK_NO_CLIENT_CB 224 -# define SSL_R_PSK_NO_SERVER_CB 225 -# define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208 -# define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209 -# define SSL_R_PUBLIC_KEY_NOT_RSA 210 -# define SSL_R_READ_BIO_NOT_SET 211 -# define SSL_R_READ_TIMEOUT_EXPIRED 312 -# define SSL_R_READ_WRONG_PACKET_TYPE 212 -# define SSL_R_RECORD_LENGTH_MISMATCH 213 -# define SSL_R_RECORD_TOO_LARGE 214 -# define SSL_R_RECORD_TOO_SMALL 298 -# define SSL_R_RENEGOTIATE_EXT_TOO_LONG 335 -# define SSL_R_RENEGOTIATION_ENCODING_ERR 336 -# define SSL_R_RENEGOTIATION_MISMATCH 337 -# define SSL_R_REQUIRED_CIPHER_MISSING 215 -# define SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING 342 -# define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216 -# define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217 -# define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218 -# define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING 345 -# define SSL_R_SERVERHELLO_TLSEXT 275 -# define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 -# define SSL_R_SHORT_READ 219 -# define SSL_R_SHUTDOWN_WHILE_IN_INIT 407 -# define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360 -# define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 -# define SSL_R_SRP_A_CALC 361 -# define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362 -# define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363 -# define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364 -# define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221 -# define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299 -# define SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT 321 -# define SSL_R_SSL3_EXT_INVALID_SERVERNAME 319 -# define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE 320 -# define SSL_R_SSL3_SESSION_ID_TOO_LONG 300 -# define SSL_R_SSL3_SESSION_ID_TOO_SHORT 222 -# define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 -# define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 -# define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 -# define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 -# define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 -# define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 -# define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 -# define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 -# define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 -# define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 -# define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 -# define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228 -# define SSL_R_SSL_HANDSHAKE_FAILURE 229 -# define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230 -# define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 301 -# define SSL_R_SSL_SESSION_ID_CONFLICT 302 -# define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273 -# define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 303 -# define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 231 -# define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 -# define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 -# define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 -# define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051 -# define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060 -# define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086 -# define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071 -# define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080 -# define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100 -# define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070 -# define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022 -# define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048 -# define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090 -# define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114 -# define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113 -# define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111 -# define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112 -# define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110 -# define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232 -# define SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT 365 -# define SSL_R_TLS_HEARTBEAT_PENDING 366 -# define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367 -# define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157 -# define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233 -# define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234 -# define SSL_R_TOO_MANY_WARN_ALERTS 409 -# define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235 -# define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236 -# define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 313 -# define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY 237 -# define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS 238 -# define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 314 -# define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239 -# define SSL_R_UNABLE_TO_FIND_SSL_METHOD 240 -# define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES 241 -# define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242 -# define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243 -# define SSL_R_UNEXPECTED_MESSAGE 244 -# define SSL_R_UNEXPECTED_RECORD 245 -# define SSL_R_UNINITIALIZED 276 -# define SSL_R_UNKNOWN_ALERT_TYPE 246 -# define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247 -# define SSL_R_UNKNOWN_CIPHER_RETURNED 248 -# define SSL_R_UNKNOWN_CIPHER_TYPE 249 -# define SSL_R_UNKNOWN_CMD_NAME 386 -# define SSL_R_UNKNOWN_DIGEST 368 -# define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250 -# define SSL_R_UNKNOWN_PKEY_TYPE 251 -# define SSL_R_UNKNOWN_PROTOCOL 252 -# define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 253 -# define SSL_R_UNKNOWN_SSL_VERSION 254 -# define SSL_R_UNKNOWN_STATE 255 -# define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED 338 -# define SSL_R_UNSUPPORTED_CIPHER 256 -# define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257 -# define SSL_R_UNSUPPORTED_DIGEST_TYPE 326 -# define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 315 -# define SSL_R_UNSUPPORTED_PROTOCOL 258 -# define SSL_R_UNSUPPORTED_SSL_VERSION 259 -# define SSL_R_UNSUPPORTED_STATUS_TYPE 329 -# define SSL_R_USE_SRTP_NOT_NEGOTIATED 369 -# define SSL_R_WRITE_BIO_NOT_SET 260 -# define SSL_R_WRONG_CERTIFICATE_TYPE 383 -# define SSL_R_WRONG_CIPHER_RETURNED 261 -# define SSL_R_WRONG_CURVE 378 -# define SSL_R_WRONG_MESSAGE_TYPE 262 -# define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263 -# define SSL_R_WRONG_SIGNATURE_LENGTH 264 -# define SSL_R_WRONG_SIGNATURE_SIZE 265 -# define SSL_R_WRONG_SIGNATURE_TYPE 370 -# define SSL_R_WRONG_SSL_VERSION 266 -# define SSL_R_WRONG_VERSION_NUMBER 267 -# define SSL_R_X509_LIB 268 -# define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/ssl2.h b/libs/win32/openssl/include/openssl/ssl2.h deleted file mode 100644 index 03c7dd8cac..0000000000 --- a/libs/win32/openssl/include/openssl/ssl2.h +++ /dev/null @@ -1,265 +0,0 @@ -/* ssl/ssl2.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_SSL2_H -# define HEADER_SSL2_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Protocol Version Codes */ -# define SSL2_VERSION 0x0002 -# define SSL2_VERSION_MAJOR 0x00 -# define SSL2_VERSION_MINOR 0x02 -/* #define SSL2_CLIENT_VERSION 0x0002 */ -/* #define SSL2_SERVER_VERSION 0x0002 */ - -/* Protocol Message Codes */ -# define SSL2_MT_ERROR 0 -# define SSL2_MT_CLIENT_HELLO 1 -# define SSL2_MT_CLIENT_MASTER_KEY 2 -# define SSL2_MT_CLIENT_FINISHED 3 -# define SSL2_MT_SERVER_HELLO 4 -# define SSL2_MT_SERVER_VERIFY 5 -# define SSL2_MT_SERVER_FINISHED 6 -# define SSL2_MT_REQUEST_CERTIFICATE 7 -# define SSL2_MT_CLIENT_CERTIFICATE 8 - -/* Error Message Codes */ -# define SSL2_PE_UNDEFINED_ERROR 0x0000 -# define SSL2_PE_NO_CIPHER 0x0001 -# define SSL2_PE_NO_CERTIFICATE 0x0002 -# define SSL2_PE_BAD_CERTIFICATE 0x0004 -# define SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE 0x0006 - -/* Cipher Kind Values */ -# define SSL2_CK_NULL_WITH_MD5 0x02000000/* v3 */ -# define SSL2_CK_RC4_128_WITH_MD5 0x02010080 -# define SSL2_CK_RC4_128_EXPORT40_WITH_MD5 0x02020080 -# define SSL2_CK_RC2_128_CBC_WITH_MD5 0x02030080 -# define SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 0x02040080 -# define SSL2_CK_IDEA_128_CBC_WITH_MD5 0x02050080 -# define SSL2_CK_DES_64_CBC_WITH_MD5 0x02060040 -# define SSL2_CK_DES_64_CBC_WITH_SHA 0x02060140/* v3 */ -# define SSL2_CK_DES_192_EDE3_CBC_WITH_MD5 0x020700c0 -# define SSL2_CK_DES_192_EDE3_CBC_WITH_SHA 0x020701c0/* v3 */ -# define SSL2_CK_RC4_64_WITH_MD5 0x02080080/* MS hack */ - -# define SSL2_CK_DES_64_CFB64_WITH_MD5_1 0x02ff0800/* SSLeay */ -# define SSL2_CK_NULL 0x02ff0810/* SSLeay */ - -# define SSL2_TXT_DES_64_CFB64_WITH_MD5_1 "DES-CFB-M1" -# define SSL2_TXT_NULL_WITH_MD5 "NULL-MD5" -# define SSL2_TXT_RC4_128_WITH_MD5 "RC4-MD5" -# define SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 "EXP-RC4-MD5" -# define SSL2_TXT_RC2_128_CBC_WITH_MD5 "RC2-CBC-MD5" -# define SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 "EXP-RC2-CBC-MD5" -# define SSL2_TXT_IDEA_128_CBC_WITH_MD5 "IDEA-CBC-MD5" -# define SSL2_TXT_DES_64_CBC_WITH_MD5 "DES-CBC-MD5" -# define SSL2_TXT_DES_64_CBC_WITH_SHA "DES-CBC-SHA" -# define SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 "DES-CBC3-MD5" -# define SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA "DES-CBC3-SHA" -# define SSL2_TXT_RC4_64_WITH_MD5 "RC4-64-MD5" - -# define SSL2_TXT_NULL "NULL" - -/* Flags for the SSL_CIPHER.algorithm2 field */ -# define SSL2_CF_5_BYTE_ENC 0x01 -# define SSL2_CF_8_BYTE_ENC 0x02 - -/* Certificate Type Codes */ -# define SSL2_CT_X509_CERTIFICATE 0x01 - -/* Authentication Type Code */ -# define SSL2_AT_MD5_WITH_RSA_ENCRYPTION 0x01 - -# define SSL2_MAX_SSL_SESSION_ID_LENGTH 32 - -/* Upper/Lower Bounds */ -# define SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS 256 -# ifdef OPENSSL_SYS_MPE -# define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 29998u -# else -# define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER 32767u - /* 2^15-1 */ -# endif -# define SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER 16383/* 2^14-1 */ - -# define SSL2_CHALLENGE_LENGTH 16 -/* - * #define SSL2_CHALLENGE_LENGTH 32 - */ -# define SSL2_MIN_CHALLENGE_LENGTH 16 -# define SSL2_MAX_CHALLENGE_LENGTH 32 -# define SSL2_CONNECTION_ID_LENGTH 16 -# define SSL2_MAX_CONNECTION_ID_LENGTH 16 -# define SSL2_SSL_SESSION_ID_LENGTH 16 -# define SSL2_MAX_CERT_CHALLENGE_LENGTH 32 -# define SSL2_MIN_CERT_CHALLENGE_LENGTH 16 -# define SSL2_MAX_KEY_MATERIAL_LENGTH 24 - -# ifndef HEADER_SSL_LOCL_H -# define CERT char -# endif - -# ifndef OPENSSL_NO_SSL_INTERN - -typedef struct ssl2_state_st { - int three_byte_header; - int clear_text; /* clear text */ - int escape; /* not used in SSLv2 */ - int ssl2_rollback; /* used if SSLv23 rolled back to SSLv2 */ - /* - * non-blocking io info, used to make sure the same args were passwd - */ - unsigned int wnum; /* number of bytes sent so far */ - int wpend_tot; - const unsigned char *wpend_buf; - int wpend_off; /* offset to data to write */ - int wpend_len; /* number of bytes passwd to write */ - int wpend_ret; /* number of bytes to return to caller */ - /* buffer raw data */ - int rbuf_left; - int rbuf_offs; - unsigned char *rbuf; - unsigned char *wbuf; - unsigned char *write_ptr; /* used to point to the start due to 2/3 byte - * header. */ - unsigned int padding; - unsigned int rlength; /* passed to ssl2_enc */ - int ract_data_length; /* Set when things are encrypted. */ - unsigned int wlength; /* passed to ssl2_enc */ - int wact_data_length; /* Set when things are decrypted. */ - unsigned char *ract_data; - unsigned char *wact_data; - unsigned char *mac_data; - unsigned char *read_key; - unsigned char *write_key; - /* Stuff specifically to do with this SSL session */ - unsigned int challenge_length; - unsigned char challenge[SSL2_MAX_CHALLENGE_LENGTH]; - unsigned int conn_id_length; - unsigned char conn_id[SSL2_MAX_CONNECTION_ID_LENGTH]; - unsigned int key_material_length; - unsigned char key_material[SSL2_MAX_KEY_MATERIAL_LENGTH * 2]; - unsigned long read_sequence; - unsigned long write_sequence; - struct { - unsigned int conn_id_length; - unsigned int cert_type; - unsigned int cert_length; - unsigned int csl; - unsigned int clear; - unsigned int enc; - unsigned char ccl[SSL2_MAX_CERT_CHALLENGE_LENGTH]; - unsigned int cipher_spec_length; - unsigned int session_id_length; - unsigned int clen; - unsigned int rlen; - } tmp; -} SSL2_STATE; - -# endif - -/* SSLv2 */ -/* client */ -# define SSL2_ST_SEND_CLIENT_HELLO_A (0x10|SSL_ST_CONNECT) -# define SSL2_ST_SEND_CLIENT_HELLO_B (0x11|SSL_ST_CONNECT) -# define SSL2_ST_GET_SERVER_HELLO_A (0x20|SSL_ST_CONNECT) -# define SSL2_ST_GET_SERVER_HELLO_B (0x21|SSL_ST_CONNECT) -# define SSL2_ST_SEND_CLIENT_MASTER_KEY_A (0x30|SSL_ST_CONNECT) -# define SSL2_ST_SEND_CLIENT_MASTER_KEY_B (0x31|SSL_ST_CONNECT) -# define SSL2_ST_SEND_CLIENT_FINISHED_A (0x40|SSL_ST_CONNECT) -# define SSL2_ST_SEND_CLIENT_FINISHED_B (0x41|SSL_ST_CONNECT) -# define SSL2_ST_SEND_CLIENT_CERTIFICATE_A (0x50|SSL_ST_CONNECT) -# define SSL2_ST_SEND_CLIENT_CERTIFICATE_B (0x51|SSL_ST_CONNECT) -# define SSL2_ST_SEND_CLIENT_CERTIFICATE_C (0x52|SSL_ST_CONNECT) -# define SSL2_ST_SEND_CLIENT_CERTIFICATE_D (0x53|SSL_ST_CONNECT) -# define SSL2_ST_GET_SERVER_VERIFY_A (0x60|SSL_ST_CONNECT) -# define SSL2_ST_GET_SERVER_VERIFY_B (0x61|SSL_ST_CONNECT) -# define SSL2_ST_GET_SERVER_FINISHED_A (0x70|SSL_ST_CONNECT) -# define SSL2_ST_GET_SERVER_FINISHED_B (0x71|SSL_ST_CONNECT) -# define SSL2_ST_CLIENT_START_ENCRYPTION (0x80|SSL_ST_CONNECT) -# define SSL2_ST_X509_GET_CLIENT_CERTIFICATE (0x90|SSL_ST_CONNECT) -/* server */ -# define SSL2_ST_GET_CLIENT_HELLO_A (0x10|SSL_ST_ACCEPT) -# define SSL2_ST_GET_CLIENT_HELLO_B (0x11|SSL_ST_ACCEPT) -# define SSL2_ST_GET_CLIENT_HELLO_C (0x12|SSL_ST_ACCEPT) -# define SSL2_ST_SEND_SERVER_HELLO_A (0x20|SSL_ST_ACCEPT) -# define SSL2_ST_SEND_SERVER_HELLO_B (0x21|SSL_ST_ACCEPT) -# define SSL2_ST_GET_CLIENT_MASTER_KEY_A (0x30|SSL_ST_ACCEPT) -# define SSL2_ST_GET_CLIENT_MASTER_KEY_B (0x31|SSL_ST_ACCEPT) -# define SSL2_ST_SEND_SERVER_VERIFY_A (0x40|SSL_ST_ACCEPT) -# define SSL2_ST_SEND_SERVER_VERIFY_B (0x41|SSL_ST_ACCEPT) -# define SSL2_ST_SEND_SERVER_VERIFY_C (0x42|SSL_ST_ACCEPT) -# define SSL2_ST_GET_CLIENT_FINISHED_A (0x50|SSL_ST_ACCEPT) -# define SSL2_ST_GET_CLIENT_FINISHED_B (0x51|SSL_ST_ACCEPT) -# define SSL2_ST_SEND_SERVER_FINISHED_A (0x60|SSL_ST_ACCEPT) -# define SSL2_ST_SEND_SERVER_FINISHED_B (0x61|SSL_ST_ACCEPT) -# define SSL2_ST_SEND_REQUEST_CERTIFICATE_A (0x70|SSL_ST_ACCEPT) -# define SSL2_ST_SEND_REQUEST_CERTIFICATE_B (0x71|SSL_ST_ACCEPT) -# define SSL2_ST_SEND_REQUEST_CERTIFICATE_C (0x72|SSL_ST_ACCEPT) -# define SSL2_ST_SEND_REQUEST_CERTIFICATE_D (0x73|SSL_ST_ACCEPT) -# define SSL2_ST_SERVER_START_ENCRYPTION (0x80|SSL_ST_ACCEPT) -# define SSL2_ST_X509_GET_SERVER_CERTIFICATE (0x90|SSL_ST_ACCEPT) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/ssl23.h b/libs/win32/openssl/include/openssl/ssl23.h deleted file mode 100644 index 9de4685af9..0000000000 --- a/libs/win32/openssl/include/openssl/ssl23.h +++ /dev/null @@ -1,84 +0,0 @@ -/* ssl/ssl23.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_SSL23_H -# define HEADER_SSL23_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * client - */ -/* write to server */ -# define SSL23_ST_CW_CLNT_HELLO_A (0x210|SSL_ST_CONNECT) -# define SSL23_ST_CW_CLNT_HELLO_B (0x211|SSL_ST_CONNECT) -/* read from server */ -# define SSL23_ST_CR_SRVR_HELLO_A (0x220|SSL_ST_CONNECT) -# define SSL23_ST_CR_SRVR_HELLO_B (0x221|SSL_ST_CONNECT) - -/* server */ -/* read from client */ -# define SSL23_ST_SR_CLNT_HELLO_A (0x210|SSL_ST_ACCEPT) -# define SSL23_ST_SR_CLNT_HELLO_B (0x211|SSL_ST_ACCEPT) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/ssl3.h b/libs/win32/openssl/include/openssl/ssl3.h deleted file mode 100644 index e681d50a9e..0000000000 --- a/libs/win32/openssl/include/openssl/ssl3.h +++ /dev/null @@ -1,774 +0,0 @@ -/* ssl/ssl3.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECC cipher suite support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ - -#ifndef HEADER_SSL3_H -# define HEADER_SSL3_H - -# ifndef OPENSSL_NO_COMP -# include -# endif -# include -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Signalling cipher suite value from RFC 5746 - * (TLS_EMPTY_RENEGOTIATION_INFO_SCSV) - */ -# define SSL3_CK_SCSV 0x030000FF - -/* - * Signalling cipher suite value from draft-ietf-tls-downgrade-scsv-00 - * (TLS_FALLBACK_SCSV) - */ -# define SSL3_CK_FALLBACK_SCSV 0x03005600 - -# define SSL3_CK_RSA_NULL_MD5 0x03000001 -# define SSL3_CK_RSA_NULL_SHA 0x03000002 -# define SSL3_CK_RSA_RC4_40_MD5 0x03000003 -# define SSL3_CK_RSA_RC4_128_MD5 0x03000004 -# define SSL3_CK_RSA_RC4_128_SHA 0x03000005 -# define SSL3_CK_RSA_RC2_40_MD5 0x03000006 -# define SSL3_CK_RSA_IDEA_128_SHA 0x03000007 -# define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008 -# define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009 -# define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A - -# define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B -# define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C -# define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D -# define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E -# define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F -# define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010 - -# define SSL3_CK_EDH_DSS_DES_40_CBC_SHA 0x03000011 -# define SSL3_CK_DHE_DSS_DES_40_CBC_SHA SSL3_CK_EDH_DSS_DES_40_CBC_SHA -# define SSL3_CK_EDH_DSS_DES_64_CBC_SHA 0x03000012 -# define SSL3_CK_DHE_DSS_DES_64_CBC_SHA SSL3_CK_EDH_DSS_DES_64_CBC_SHA -# define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA 0x03000013 -# define SSL3_CK_DHE_DSS_DES_192_CBC3_SHA SSL3_CK_EDH_DSS_DES_192_CBC3_SHA -# define SSL3_CK_EDH_RSA_DES_40_CBC_SHA 0x03000014 -# define SSL3_CK_DHE_RSA_DES_40_CBC_SHA SSL3_CK_EDH_RSA_DES_40_CBC_SHA -# define SSL3_CK_EDH_RSA_DES_64_CBC_SHA 0x03000015 -# define SSL3_CK_DHE_RSA_DES_64_CBC_SHA SSL3_CK_EDH_RSA_DES_64_CBC_SHA -# define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA 0x03000016 -# define SSL3_CK_DHE_RSA_DES_192_CBC3_SHA SSL3_CK_EDH_RSA_DES_192_CBC3_SHA - -# define SSL3_CK_ADH_RC4_40_MD5 0x03000017 -# define SSL3_CK_ADH_RC4_128_MD5 0x03000018 -# define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019 -# define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A -# define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B - -# if 0 -# define SSL3_CK_FZA_DMS_NULL_SHA 0x0300001C -# define SSL3_CK_FZA_DMS_FZA_SHA 0x0300001D -# if 0 /* Because it clashes with KRB5, is never - * used any more, and is safe to remove - * according to David Hopwood - * of the - * ietf-tls list */ -# define SSL3_CK_FZA_DMS_RC4_SHA 0x0300001E -# endif -# endif - -/* - * VRS Additional Kerberos5 entries - */ -# define SSL3_CK_KRB5_DES_64_CBC_SHA 0x0300001E -# define SSL3_CK_KRB5_DES_192_CBC3_SHA 0x0300001F -# define SSL3_CK_KRB5_RC4_128_SHA 0x03000020 -# define SSL3_CK_KRB5_IDEA_128_CBC_SHA 0x03000021 -# define SSL3_CK_KRB5_DES_64_CBC_MD5 0x03000022 -# define SSL3_CK_KRB5_DES_192_CBC3_MD5 0x03000023 -# define SSL3_CK_KRB5_RC4_128_MD5 0x03000024 -# define SSL3_CK_KRB5_IDEA_128_CBC_MD5 0x03000025 - -# define SSL3_CK_KRB5_DES_40_CBC_SHA 0x03000026 -# define SSL3_CK_KRB5_RC2_40_CBC_SHA 0x03000027 -# define SSL3_CK_KRB5_RC4_40_SHA 0x03000028 -# define SSL3_CK_KRB5_DES_40_CBC_MD5 0x03000029 -# define SSL3_CK_KRB5_RC2_40_CBC_MD5 0x0300002A -# define SSL3_CK_KRB5_RC4_40_MD5 0x0300002B - -# define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5" -# define SSL3_TXT_RSA_NULL_SHA "NULL-SHA" -# define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5" -# define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5" -# define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA" -# define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5" -# define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA" -# define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA" -# define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA" -# define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA" - -# define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA" -# define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA" -# define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA" -# define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA" -# define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA" -# define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA" - -# define SSL3_TXT_DHE_DSS_DES_40_CBC_SHA "EXP-DHE-DSS-DES-CBC-SHA" -# define SSL3_TXT_DHE_DSS_DES_64_CBC_SHA "DHE-DSS-DES-CBC-SHA" -# define SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA "DHE-DSS-DES-CBC3-SHA" -# define SSL3_TXT_DHE_RSA_DES_40_CBC_SHA "EXP-DHE-RSA-DES-CBC-SHA" -# define SSL3_TXT_DHE_RSA_DES_64_CBC_SHA "DHE-RSA-DES-CBC-SHA" -# define SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA "DHE-RSA-DES-CBC3-SHA" - -/* - * This next block of six "EDH" labels is for backward compatibility with - * older versions of OpenSSL. New code should use the six "DHE" labels above - * instead: - */ -# define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA" -# define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA" -# define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA" -# define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA" -# define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA" -# define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA" - -# define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5" -# define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5" -# define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA" -# define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA" -# define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA" - -# if 0 -# define SSL3_TXT_FZA_DMS_NULL_SHA "FZA-NULL-SHA" -# define SSL3_TXT_FZA_DMS_FZA_SHA "FZA-FZA-CBC-SHA" -# define SSL3_TXT_FZA_DMS_RC4_SHA "FZA-RC4-SHA" -# endif - -# define SSL3_TXT_KRB5_DES_64_CBC_SHA "KRB5-DES-CBC-SHA" -# define SSL3_TXT_KRB5_DES_192_CBC3_SHA "KRB5-DES-CBC3-SHA" -# define SSL3_TXT_KRB5_RC4_128_SHA "KRB5-RC4-SHA" -# define SSL3_TXT_KRB5_IDEA_128_CBC_SHA "KRB5-IDEA-CBC-SHA" -# define SSL3_TXT_KRB5_DES_64_CBC_MD5 "KRB5-DES-CBC-MD5" -# define SSL3_TXT_KRB5_DES_192_CBC3_MD5 "KRB5-DES-CBC3-MD5" -# define SSL3_TXT_KRB5_RC4_128_MD5 "KRB5-RC4-MD5" -# define SSL3_TXT_KRB5_IDEA_128_CBC_MD5 "KRB5-IDEA-CBC-MD5" - -# define SSL3_TXT_KRB5_DES_40_CBC_SHA "EXP-KRB5-DES-CBC-SHA" -# define SSL3_TXT_KRB5_RC2_40_CBC_SHA "EXP-KRB5-RC2-CBC-SHA" -# define SSL3_TXT_KRB5_RC4_40_SHA "EXP-KRB5-RC4-SHA" -# define SSL3_TXT_KRB5_DES_40_CBC_MD5 "EXP-KRB5-DES-CBC-MD5" -# define SSL3_TXT_KRB5_RC2_40_CBC_MD5 "EXP-KRB5-RC2-CBC-MD5" -# define SSL3_TXT_KRB5_RC4_40_MD5 "EXP-KRB5-RC4-MD5" - -# define SSL3_SSL_SESSION_ID_LENGTH 32 -# define SSL3_MAX_SSL_SESSION_ID_LENGTH 32 - -# define SSL3_MASTER_SECRET_SIZE 48 -# define SSL3_RANDOM_SIZE 32 -# define SSL3_SESSION_ID_SIZE 32 -# define SSL3_RT_HEADER_LENGTH 5 - -# define SSL3_HM_HEADER_LENGTH 4 - -# ifndef SSL3_ALIGN_PAYLOAD - /* - * Some will argue that this increases memory footprint, but it's not - * actually true. Point is that malloc has to return at least 64-bit aligned - * pointers, meaning that allocating 5 bytes wastes 3 bytes in either case. - * Suggested pre-gaping simply moves these wasted bytes from the end of - * allocated region to its front, but makes data payload aligned, which - * improves performance:-) - */ -# define SSL3_ALIGN_PAYLOAD 8 -# else -# if (SSL3_ALIGN_PAYLOAD&(SSL3_ALIGN_PAYLOAD-1))!=0 -# error "insane SSL3_ALIGN_PAYLOAD" -# undef SSL3_ALIGN_PAYLOAD -# endif -# endif - -/* - * This is the maximum MAC (digest) size used by the SSL library. Currently - * maximum of 20 is used by SHA1, but we reserve for future extension for - * 512-bit hashes. - */ - -# define SSL3_RT_MAX_MD_SIZE 64 - -/* - * Maximum block size used in all ciphersuites. Currently 16 for AES. - */ - -# define SSL_RT_MAX_CIPHER_BLOCK_SIZE 16 - -# define SSL3_RT_MAX_EXTRA (16384) - -/* Maximum plaintext length: defined by SSL/TLS standards */ -# define SSL3_RT_MAX_PLAIN_LENGTH 16384 -/* Maximum compression overhead: defined by SSL/TLS standards */ -# define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024 - -/* - * The standards give a maximum encryption overhead of 1024 bytes. In - * practice the value is lower than this. The overhead is the maximum number - * of padding bytes (256) plus the mac size. - */ -# define SSL3_RT_MAX_ENCRYPTED_OVERHEAD (256 + SSL3_RT_MAX_MD_SIZE) - -/* - * OpenSSL currently only uses a padding length of at most one block so the - * send overhead is smaller. - */ - -# define SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD \ - (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE) - -/* If compression isn't used don't include the compression overhead */ - -# ifdef OPENSSL_NO_COMP -# define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH -# else -# define SSL3_RT_MAX_COMPRESSED_LENGTH \ - (SSL3_RT_MAX_PLAIN_LENGTH+SSL3_RT_MAX_COMPRESSED_OVERHEAD) -# endif -# define SSL3_RT_MAX_ENCRYPTED_LENGTH \ - (SSL3_RT_MAX_ENCRYPTED_OVERHEAD+SSL3_RT_MAX_COMPRESSED_LENGTH) -# define SSL3_RT_MAX_PACKET_SIZE \ - (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH) - -# define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54" -# define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52" - -# define SSL3_VERSION 0x0300 -# define SSL3_VERSION_MAJOR 0x03 -# define SSL3_VERSION_MINOR 0x00 - -# define SSL3_RT_CHANGE_CIPHER_SPEC 20 -# define SSL3_RT_ALERT 21 -# define SSL3_RT_HANDSHAKE 22 -# define SSL3_RT_APPLICATION_DATA 23 -# define TLS1_RT_HEARTBEAT 24 - -/* Pseudo content types to indicate additional parameters */ -# define TLS1_RT_CRYPTO 0x1000 -# define TLS1_RT_CRYPTO_PREMASTER (TLS1_RT_CRYPTO | 0x1) -# define TLS1_RT_CRYPTO_CLIENT_RANDOM (TLS1_RT_CRYPTO | 0x2) -# define TLS1_RT_CRYPTO_SERVER_RANDOM (TLS1_RT_CRYPTO | 0x3) -# define TLS1_RT_CRYPTO_MASTER (TLS1_RT_CRYPTO | 0x4) - -# define TLS1_RT_CRYPTO_READ 0x0000 -# define TLS1_RT_CRYPTO_WRITE 0x0100 -# define TLS1_RT_CRYPTO_MAC (TLS1_RT_CRYPTO | 0x5) -# define TLS1_RT_CRYPTO_KEY (TLS1_RT_CRYPTO | 0x6) -# define TLS1_RT_CRYPTO_IV (TLS1_RT_CRYPTO | 0x7) -# define TLS1_RT_CRYPTO_FIXED_IV (TLS1_RT_CRYPTO | 0x8) - -/* Pseudo content type for SSL/TLS header info */ -# define SSL3_RT_HEADER 0x100 - -# define SSL3_AL_WARNING 1 -# define SSL3_AL_FATAL 2 - -# define SSL3_AD_CLOSE_NOTIFY 0 -# define SSL3_AD_UNEXPECTED_MESSAGE 10/* fatal */ -# define SSL3_AD_BAD_RECORD_MAC 20/* fatal */ -# define SSL3_AD_DECOMPRESSION_FAILURE 30/* fatal */ -# define SSL3_AD_HANDSHAKE_FAILURE 40/* fatal */ -# define SSL3_AD_NO_CERTIFICATE 41 -# define SSL3_AD_BAD_CERTIFICATE 42 -# define SSL3_AD_UNSUPPORTED_CERTIFICATE 43 -# define SSL3_AD_CERTIFICATE_REVOKED 44 -# define SSL3_AD_CERTIFICATE_EXPIRED 45 -# define SSL3_AD_CERTIFICATE_UNKNOWN 46 -# define SSL3_AD_ILLEGAL_PARAMETER 47/* fatal */ - -# define TLS1_HB_REQUEST 1 -# define TLS1_HB_RESPONSE 2 - -# ifndef OPENSSL_NO_SSL_INTERN - -typedef struct ssl3_record_st { - /* type of record */ - /* - * r - */ int type; - /* How many bytes available */ - /* - * rw - */ unsigned int length; - /* read/write offset into 'buf' */ - /* - * r - */ unsigned int off; - /* pointer to the record data */ - /* - * rw - */ unsigned char *data; - /* where the decode bytes are */ - /* - * rw - */ unsigned char *input; - /* only used with decompression - malloc()ed */ - /* - * r - */ unsigned char *comp; - /* epoch number, needed by DTLS1 */ - /* - * r - */ unsigned long epoch; - /* sequence number, needed by DTLS1 */ - /* - * r - */ unsigned char seq_num[8]; -} SSL3_RECORD; - -typedef struct ssl3_buffer_st { - /* at least SSL3_RT_MAX_PACKET_SIZE bytes, see ssl3_setup_buffers() */ - unsigned char *buf; - /* buffer size */ - size_t len; - /* where to 'copy from' */ - int offset; - /* how many bytes left */ - int left; -} SSL3_BUFFER; - -# endif - -# define SSL3_CT_RSA_SIGN 1 -# define SSL3_CT_DSS_SIGN 2 -# define SSL3_CT_RSA_FIXED_DH 3 -# define SSL3_CT_DSS_FIXED_DH 4 -# define SSL3_CT_RSA_EPHEMERAL_DH 5 -# define SSL3_CT_DSS_EPHEMERAL_DH 6 -# define SSL3_CT_FORTEZZA_DMS 20 -/* - * SSL3_CT_NUMBER is used to size arrays and it must be large enough to - * contain all of the cert types defined either for SSLv3 and TLSv1. - */ -# define SSL3_CT_NUMBER 9 - -# define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 -# define SSL3_FLAGS_DELAY_CLIENT_FINISHED 0x0002 -# define SSL3_FLAGS_POP_BUFFER 0x0004 -# define TLS1_FLAGS_TLS_PADDING_BUG 0x0008 -# define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 -# define TLS1_FLAGS_KEEP_HANDSHAKE 0x0020 -/* - * Set when the handshake is ready to process peer's ChangeCipherSpec message. - * Cleared after the message has been processed. - */ -# define SSL3_FLAGS_CCS_OK 0x0080 - -/* SSL3_FLAGS_SGC_RESTART_DONE is no longer used */ -# define SSL3_FLAGS_SGC_RESTART_DONE 0x0040 - -# ifndef OPENSSL_NO_SSL_INTERN - -typedef struct ssl3_state_st { - long flags; - int delay_buf_pop_ret; - unsigned char read_sequence[8]; - int read_mac_secret_size; - unsigned char read_mac_secret[EVP_MAX_MD_SIZE]; - unsigned char write_sequence[8]; - int write_mac_secret_size; - unsigned char write_mac_secret[EVP_MAX_MD_SIZE]; - unsigned char server_random[SSL3_RANDOM_SIZE]; - unsigned char client_random[SSL3_RANDOM_SIZE]; - /* flags for countermeasure against known-IV weakness */ - int need_empty_fragments; - int empty_fragment_done; - /* The value of 'extra' when the buffers were initialized */ - int init_extra; - SSL3_BUFFER rbuf; /* read IO goes into here */ - SSL3_BUFFER wbuf; /* write IO goes into here */ - SSL3_RECORD rrec; /* each decoded record goes in here */ - SSL3_RECORD wrec; /* goes out from here */ - /* - * storage for Alert/Handshake protocol data received but not yet - * processed by ssl3_read_bytes: - */ - unsigned char alert_fragment[2]; - unsigned int alert_fragment_len; - unsigned char handshake_fragment[4]; - unsigned int handshake_fragment_len; - /* partial write - check the numbers match */ - unsigned int wnum; /* number of bytes sent so far */ - int wpend_tot; /* number bytes written */ - int wpend_type; - int wpend_ret; /* number of bytes submitted */ - const unsigned char *wpend_buf; - /* used during startup, digest all incoming/outgoing packets */ - BIO *handshake_buffer; - /* - * When set of handshake digests is determined, buffer is hashed and - * freed and MD_CTX-es for all required digests are stored in this array - */ - EVP_MD_CTX **handshake_dgst; - /* - * Set whenever an expected ChangeCipherSpec message is processed. - * Unset when the peer's Finished message is received. - * Unexpected ChangeCipherSpec messages trigger a fatal alert. - */ - int change_cipher_spec; - int warn_alert; - int fatal_alert; - /* - * we allow one fatal and one warning alert to be outstanding, send close - * alert via the warning alert - */ - int alert_dispatch; - unsigned char send_alert[2]; - /* - * This flag is set when we should renegotiate ASAP, basically when there - * is no more data in the read or write buffers - */ - int renegotiate; - int total_renegotiations; - int num_renegotiations; - int in_read_app_data; - /* - * Opaque PRF input as used for the current handshake. These fields are - * used only if TLSEXT_TYPE_opaque_prf_input is defined (otherwise, they - * are merely present to improve binary compatibility) - */ - void *client_opaque_prf_input; - size_t client_opaque_prf_input_len; - void *server_opaque_prf_input; - size_t server_opaque_prf_input_len; - struct { - /* actually only needs to be 16+20 */ - unsigned char cert_verify_md[EVP_MAX_MD_SIZE * 2]; - /* actually only need to be 16+20 for SSLv3 and 12 for TLS */ - unsigned char finish_md[EVP_MAX_MD_SIZE * 2]; - int finish_md_len; - unsigned char peer_finish_md[EVP_MAX_MD_SIZE * 2]; - int peer_finish_md_len; - unsigned long message_size; - int message_type; - /* used to hold the new cipher we are going to use */ - const SSL_CIPHER *new_cipher; -# ifndef OPENSSL_NO_DH - DH *dh; -# endif -# ifndef OPENSSL_NO_ECDH - EC_KEY *ecdh; /* holds short lived ECDH key */ -# endif - /* used when SSL_ST_FLUSH_DATA is entered */ - int next_state; - int reuse_message; - /* used for certificate requests */ - int cert_req; - int ctype_num; - char ctype[SSL3_CT_NUMBER]; - STACK_OF(X509_NAME) *ca_names; - int use_rsa_tmp; - int key_block_length; - unsigned char *key_block; - const EVP_CIPHER *new_sym_enc; - const EVP_MD *new_hash; - int new_mac_pkey_type; - int new_mac_secret_size; -# ifndef OPENSSL_NO_COMP - const SSL_COMP *new_compression; -# else - char *new_compression; -# endif - int cert_request; - } tmp; - - /* Connection binding to prevent renegotiation attacks */ - unsigned char previous_client_finished[EVP_MAX_MD_SIZE]; - unsigned char previous_client_finished_len; - unsigned char previous_server_finished[EVP_MAX_MD_SIZE]; - unsigned char previous_server_finished_len; - int send_connection_binding; /* TODOEKR */ - -# ifndef OPENSSL_NO_NEXTPROTONEG - /* - * Set if we saw the Next Protocol Negotiation extension from our peer. - */ - int next_proto_neg_seen; -# endif - -# ifndef OPENSSL_NO_TLSEXT -# ifndef OPENSSL_NO_EC - /* - * This is set to true if we believe that this is a version of Safari - * running on OS X 10.6 or newer. We wish to know this because Safari on - * 10.8 .. 10.8.3 has broken ECDHE-ECDSA support. - */ - char is_probably_safari; -# endif /* !OPENSSL_NO_EC */ - - /* - * ALPN information (we are in the process of transitioning from NPN to - * ALPN.) - */ - - /* - * In a server these point to the selected ALPN protocol after the - * ClientHello has been processed. In a client these contain the protocol - * that the server selected once the ServerHello has been processed. - */ - unsigned char *alpn_selected; - unsigned alpn_selected_len; -# endif /* OPENSSL_NO_TLSEXT */ -} SSL3_STATE; - -# endif - -/* SSLv3 */ -/* - * client - */ -/* extra state */ -# define SSL3_ST_CW_FLUSH (0x100|SSL_ST_CONNECT) -# ifndef OPENSSL_NO_SCTP -# define DTLS1_SCTP_ST_CW_WRITE_SOCK (0x310|SSL_ST_CONNECT) -# define DTLS1_SCTP_ST_CR_READ_SOCK (0x320|SSL_ST_CONNECT) -# endif -/* write to server */ -# define SSL3_ST_CW_CLNT_HELLO_A (0x110|SSL_ST_CONNECT) -# define SSL3_ST_CW_CLNT_HELLO_B (0x111|SSL_ST_CONNECT) -/* read from server */ -# define SSL3_ST_CR_SRVR_HELLO_A (0x120|SSL_ST_CONNECT) -# define SSL3_ST_CR_SRVR_HELLO_B (0x121|SSL_ST_CONNECT) -# define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A (0x126|SSL_ST_CONNECT) -# define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B (0x127|SSL_ST_CONNECT) -# define SSL3_ST_CR_CERT_A (0x130|SSL_ST_CONNECT) -# define SSL3_ST_CR_CERT_B (0x131|SSL_ST_CONNECT) -# define SSL3_ST_CR_KEY_EXCH_A (0x140|SSL_ST_CONNECT) -# define SSL3_ST_CR_KEY_EXCH_B (0x141|SSL_ST_CONNECT) -# define SSL3_ST_CR_CERT_REQ_A (0x150|SSL_ST_CONNECT) -# define SSL3_ST_CR_CERT_REQ_B (0x151|SSL_ST_CONNECT) -# define SSL3_ST_CR_SRVR_DONE_A (0x160|SSL_ST_CONNECT) -# define SSL3_ST_CR_SRVR_DONE_B (0x161|SSL_ST_CONNECT) -/* write to server */ -# define SSL3_ST_CW_CERT_A (0x170|SSL_ST_CONNECT) -# define SSL3_ST_CW_CERT_B (0x171|SSL_ST_CONNECT) -# define SSL3_ST_CW_CERT_C (0x172|SSL_ST_CONNECT) -# define SSL3_ST_CW_CERT_D (0x173|SSL_ST_CONNECT) -# define SSL3_ST_CW_KEY_EXCH_A (0x180|SSL_ST_CONNECT) -# define SSL3_ST_CW_KEY_EXCH_B (0x181|SSL_ST_CONNECT) -# define SSL3_ST_CW_CERT_VRFY_A (0x190|SSL_ST_CONNECT) -# define SSL3_ST_CW_CERT_VRFY_B (0x191|SSL_ST_CONNECT) -# define SSL3_ST_CW_CHANGE_A (0x1A0|SSL_ST_CONNECT) -# define SSL3_ST_CW_CHANGE_B (0x1A1|SSL_ST_CONNECT) -# ifndef OPENSSL_NO_NEXTPROTONEG -# define SSL3_ST_CW_NEXT_PROTO_A (0x200|SSL_ST_CONNECT) -# define SSL3_ST_CW_NEXT_PROTO_B (0x201|SSL_ST_CONNECT) -# endif -# define SSL3_ST_CW_FINISHED_A (0x1B0|SSL_ST_CONNECT) -# define SSL3_ST_CW_FINISHED_B (0x1B1|SSL_ST_CONNECT) -/* read from server */ -# define SSL3_ST_CR_CHANGE_A (0x1C0|SSL_ST_CONNECT) -# define SSL3_ST_CR_CHANGE_B (0x1C1|SSL_ST_CONNECT) -# define SSL3_ST_CR_FINISHED_A (0x1D0|SSL_ST_CONNECT) -# define SSL3_ST_CR_FINISHED_B (0x1D1|SSL_ST_CONNECT) -# define SSL3_ST_CR_SESSION_TICKET_A (0x1E0|SSL_ST_CONNECT) -# define SSL3_ST_CR_SESSION_TICKET_B (0x1E1|SSL_ST_CONNECT) -# define SSL3_ST_CR_CERT_STATUS_A (0x1F0|SSL_ST_CONNECT) -# define SSL3_ST_CR_CERT_STATUS_B (0x1F1|SSL_ST_CONNECT) - -/* server */ -/* extra state */ -# define SSL3_ST_SW_FLUSH (0x100|SSL_ST_ACCEPT) -# ifndef OPENSSL_NO_SCTP -# define DTLS1_SCTP_ST_SW_WRITE_SOCK (0x310|SSL_ST_ACCEPT) -# define DTLS1_SCTP_ST_SR_READ_SOCK (0x320|SSL_ST_ACCEPT) -# endif -/* read from client */ -/* Do not change the number values, they do matter */ -# define SSL3_ST_SR_CLNT_HELLO_A (0x110|SSL_ST_ACCEPT) -# define SSL3_ST_SR_CLNT_HELLO_B (0x111|SSL_ST_ACCEPT) -# define SSL3_ST_SR_CLNT_HELLO_C (0x112|SSL_ST_ACCEPT) -# define SSL3_ST_SR_CLNT_HELLO_D (0x115|SSL_ST_ACCEPT) -/* write to client */ -# define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A (0x113|SSL_ST_ACCEPT) -# define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B (0x114|SSL_ST_ACCEPT) -# define SSL3_ST_SW_HELLO_REQ_A (0x120|SSL_ST_ACCEPT) -# define SSL3_ST_SW_HELLO_REQ_B (0x121|SSL_ST_ACCEPT) -# define SSL3_ST_SW_HELLO_REQ_C (0x122|SSL_ST_ACCEPT) -# define SSL3_ST_SW_SRVR_HELLO_A (0x130|SSL_ST_ACCEPT) -# define SSL3_ST_SW_SRVR_HELLO_B (0x131|SSL_ST_ACCEPT) -# define SSL3_ST_SW_CERT_A (0x140|SSL_ST_ACCEPT) -# define SSL3_ST_SW_CERT_B (0x141|SSL_ST_ACCEPT) -# define SSL3_ST_SW_KEY_EXCH_A (0x150|SSL_ST_ACCEPT) -# define SSL3_ST_SW_KEY_EXCH_B (0x151|SSL_ST_ACCEPT) -# define SSL3_ST_SW_CERT_REQ_A (0x160|SSL_ST_ACCEPT) -# define SSL3_ST_SW_CERT_REQ_B (0x161|SSL_ST_ACCEPT) -# define SSL3_ST_SW_SRVR_DONE_A (0x170|SSL_ST_ACCEPT) -# define SSL3_ST_SW_SRVR_DONE_B (0x171|SSL_ST_ACCEPT) -/* read from client */ -# define SSL3_ST_SR_CERT_A (0x180|SSL_ST_ACCEPT) -# define SSL3_ST_SR_CERT_B (0x181|SSL_ST_ACCEPT) -# define SSL3_ST_SR_KEY_EXCH_A (0x190|SSL_ST_ACCEPT) -# define SSL3_ST_SR_KEY_EXCH_B (0x191|SSL_ST_ACCEPT) -# define SSL3_ST_SR_CERT_VRFY_A (0x1A0|SSL_ST_ACCEPT) -# define SSL3_ST_SR_CERT_VRFY_B (0x1A1|SSL_ST_ACCEPT) -# define SSL3_ST_SR_CHANGE_A (0x1B0|SSL_ST_ACCEPT) -# define SSL3_ST_SR_CHANGE_B (0x1B1|SSL_ST_ACCEPT) -# ifndef OPENSSL_NO_NEXTPROTONEG -# define SSL3_ST_SR_NEXT_PROTO_A (0x210|SSL_ST_ACCEPT) -# define SSL3_ST_SR_NEXT_PROTO_B (0x211|SSL_ST_ACCEPT) -# endif -# define SSL3_ST_SR_FINISHED_A (0x1C0|SSL_ST_ACCEPT) -# define SSL3_ST_SR_FINISHED_B (0x1C1|SSL_ST_ACCEPT) -/* write to client */ -# define SSL3_ST_SW_CHANGE_A (0x1D0|SSL_ST_ACCEPT) -# define SSL3_ST_SW_CHANGE_B (0x1D1|SSL_ST_ACCEPT) -# define SSL3_ST_SW_FINISHED_A (0x1E0|SSL_ST_ACCEPT) -# define SSL3_ST_SW_FINISHED_B (0x1E1|SSL_ST_ACCEPT) -# define SSL3_ST_SW_SESSION_TICKET_A (0x1F0|SSL_ST_ACCEPT) -# define SSL3_ST_SW_SESSION_TICKET_B (0x1F1|SSL_ST_ACCEPT) -# define SSL3_ST_SW_CERT_STATUS_A (0x200|SSL_ST_ACCEPT) -# define SSL3_ST_SW_CERT_STATUS_B (0x201|SSL_ST_ACCEPT) - -# define SSL3_MT_HELLO_REQUEST 0 -# define SSL3_MT_CLIENT_HELLO 1 -# define SSL3_MT_SERVER_HELLO 2 -# define SSL3_MT_NEWSESSION_TICKET 4 -# define SSL3_MT_CERTIFICATE 11 -# define SSL3_MT_SERVER_KEY_EXCHANGE 12 -# define SSL3_MT_CERTIFICATE_REQUEST 13 -# define SSL3_MT_SERVER_DONE 14 -# define SSL3_MT_CERTIFICATE_VERIFY 15 -# define SSL3_MT_CLIENT_KEY_EXCHANGE 16 -# define SSL3_MT_FINISHED 20 -# define SSL3_MT_CERTIFICATE_STATUS 22 -# ifndef OPENSSL_NO_NEXTPROTONEG -# define SSL3_MT_NEXT_PROTO 67 -# endif -# define DTLS1_MT_HELLO_VERIFY_REQUEST 3 - -# define SSL3_MT_CCS 1 - -/* These are used when changing over to a new cipher */ -# define SSL3_CC_READ 0x01 -# define SSL3_CC_WRITE 0x02 -# define SSL3_CC_CLIENT 0x10 -# define SSL3_CC_SERVER 0x20 -# define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT|SSL3_CC_WRITE) -# define SSL3_CHANGE_CIPHER_SERVER_READ (SSL3_CC_SERVER|SSL3_CC_READ) -# define SSL3_CHANGE_CIPHER_CLIENT_READ (SSL3_CC_CLIENT|SSL3_CC_READ) -# define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER|SSL3_CC_WRITE) - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/stack.h b/libs/win32/openssl/include/openssl/stack.h deleted file mode 100644 index eb07216659..0000000000 --- a/libs/win32/openssl/include/openssl/stack.h +++ /dev/null @@ -1,107 +0,0 @@ -/* crypto/stack/stack.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_STACK_H -# define HEADER_STACK_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct stack_st { - int num; - char **data; - int sorted; - int num_alloc; - int (*comp) (const void *, const void *); -} _STACK; /* Use STACK_OF(...) instead */ - -# define M_sk_num(sk) ((sk) ? (sk)->num:-1) -# define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) - -int sk_num(const _STACK *); -void *sk_value(const _STACK *, int); - -void *sk_set(_STACK *, int, void *); - -_STACK *sk_new(int (*cmp) (const void *, const void *)); -_STACK *sk_new_null(void); -void sk_free(_STACK *); -void sk_pop_free(_STACK *st, void (*func) (void *)); -_STACK *sk_deep_copy(_STACK *, void *(*)(void *), void (*)(void *)); -int sk_insert(_STACK *sk, void *data, int where); -void *sk_delete(_STACK *st, int loc); -void *sk_delete_ptr(_STACK *st, void *p); -int sk_find(_STACK *st, void *data); -int sk_find_ex(_STACK *st, void *data); -int sk_push(_STACK *st, void *data); -int sk_unshift(_STACK *st, void *data); -void *sk_shift(_STACK *st); -void *sk_pop(_STACK *st); -void sk_zero(_STACK *st); -int (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *))) - (const void *, const void *); -_STACK *sk_dup(_STACK *st); -void sk_sort(_STACK *st); -int sk_is_sorted(const _STACK *st); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/symhacks.h b/libs/win32/openssl/include/openssl/symhacks.h deleted file mode 100644 index 239fa4fb1b..0000000000 --- a/libs/win32/openssl/include/openssl/symhacks.h +++ /dev/null @@ -1,516 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_SYMHACKS_H -# define HEADER_SYMHACKS_H - -# include - -/* - * Hacks to solve the problem with linkers incapable of handling very long - * symbol names. In the case of VMS, the limit is 31 characters on VMS for - * VAX. - */ -/* - * Note that this affects util/libeay.num and util/ssleay.num... you may - * change those manually, but that's not recommended, as those files are - * controlled centrally and updated on Unix, and the central definition may - * disagree with yours, which in turn may come with shareable library - * incompatibilities. - */ -# ifdef OPENSSL_SYS_VMS - -/* Hack a long name in crypto/ex_data.c */ -# undef CRYPTO_get_ex_data_implementation -# define CRYPTO_get_ex_data_implementation CRYPTO_get_ex_data_impl -# undef CRYPTO_set_ex_data_implementation -# define CRYPTO_set_ex_data_implementation CRYPTO_set_ex_data_impl - -/* Hack a long name in crypto/asn1/a_mbstr.c */ -# undef ASN1_STRING_set_default_mask_asc -# define ASN1_STRING_set_default_mask_asc ASN1_STRING_set_def_mask_asc - -# if 0 /* No longer needed, since safestack macro - * magic does the job */ -/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) */ -# undef i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO -# define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO i2d_ASN1_SET_OF_PKCS7_SIGINF -# undef d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO -# define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO d2i_ASN1_SET_OF_PKCS7_SIGINF -# endif - -# if 0 /* No longer needed, since safestack macro - * magic does the job */ -/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) */ -# undef i2d_ASN1_SET_OF_PKCS7_RECIP_INFO -# define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO i2d_ASN1_SET_OF_PKCS7_RECINF -# undef d2i_ASN1_SET_OF_PKCS7_RECIP_INFO -# define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO d2i_ASN1_SET_OF_PKCS7_RECINF -# endif - -# if 0 /* No longer needed, since safestack macro - * magic does the job */ -/* Hack the names created with DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) */ -# undef i2d_ASN1_SET_OF_ACCESS_DESCRIPTION -# define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION i2d_ASN1_SET_OF_ACC_DESC -# undef d2i_ASN1_SET_OF_ACCESS_DESCRIPTION -# define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION d2i_ASN1_SET_OF_ACC_DESC -# endif - -/* Hack the names created with DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE) */ -# undef PEM_read_NETSCAPE_CERT_SEQUENCE -# define PEM_read_NETSCAPE_CERT_SEQUENCE PEM_read_NS_CERT_SEQ -# undef PEM_write_NETSCAPE_CERT_SEQUENCE -# define PEM_write_NETSCAPE_CERT_SEQUENCE PEM_write_NS_CERT_SEQ -# undef PEM_read_bio_NETSCAPE_CERT_SEQUENCE -# define PEM_read_bio_NETSCAPE_CERT_SEQUENCE PEM_read_bio_NS_CERT_SEQ -# undef PEM_write_bio_NETSCAPE_CERT_SEQUENCE -# define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NS_CERT_SEQ -# undef PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE -# define PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE PEM_write_cb_bio_NS_CERT_SEQ - -/* Hack the names created with DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO) */ -# undef PEM_read_PKCS8_PRIV_KEY_INFO -# define PEM_read_PKCS8_PRIV_KEY_INFO PEM_read_P8_PRIV_KEY_INFO -# undef PEM_write_PKCS8_PRIV_KEY_INFO -# define PEM_write_PKCS8_PRIV_KEY_INFO PEM_write_P8_PRIV_KEY_INFO -# undef PEM_read_bio_PKCS8_PRIV_KEY_INFO -# define PEM_read_bio_PKCS8_PRIV_KEY_INFO PEM_read_bio_P8_PRIV_KEY_INFO -# undef PEM_write_bio_PKCS8_PRIV_KEY_INFO -# define PEM_write_bio_PKCS8_PRIV_KEY_INFO PEM_write_bio_P8_PRIV_KEY_INFO -# undef PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO -# define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO PEM_wrt_cb_bio_P8_PRIV_KEY_INFO - -/* Hack other PEM names */ -# undef PEM_write_bio_PKCS8PrivateKey_nid -# define PEM_write_bio_PKCS8PrivateKey_nid PEM_write_bio_PKCS8PrivKey_nid - -/* Hack some long X509 names */ -# undef X509_REVOKED_get_ext_by_critical -# define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic -# undef X509_policy_tree_get0_user_policies -# define X509_policy_tree_get0_user_policies X509_pcy_tree_get0_usr_policies -# undef X509_policy_node_get0_qualifiers -# define X509_policy_node_get0_qualifiers X509_pcy_node_get0_qualifiers -# undef X509_STORE_CTX_get_explicit_policy -# define X509_STORE_CTX_get_explicit_policy X509_STORE_CTX_get_expl_policy -# undef X509_STORE_CTX_get0_current_issuer -# define X509_STORE_CTX_get0_current_issuer X509_STORE_CTX_get0_cur_issuer - -/* Hack some long CRYPTO names */ -# undef CRYPTO_set_dynlock_destroy_callback -# define CRYPTO_set_dynlock_destroy_callback CRYPTO_set_dynlock_destroy_cb -# undef CRYPTO_set_dynlock_create_callback -# define CRYPTO_set_dynlock_create_callback CRYPTO_set_dynlock_create_cb -# undef CRYPTO_set_dynlock_lock_callback -# define CRYPTO_set_dynlock_lock_callback CRYPTO_set_dynlock_lock_cb -# undef CRYPTO_get_dynlock_lock_callback -# define CRYPTO_get_dynlock_lock_callback CRYPTO_get_dynlock_lock_cb -# undef CRYPTO_get_dynlock_destroy_callback -# define CRYPTO_get_dynlock_destroy_callback CRYPTO_get_dynlock_destroy_cb -# undef CRYPTO_get_dynlock_create_callback -# define CRYPTO_get_dynlock_create_callback CRYPTO_get_dynlock_create_cb -# undef CRYPTO_set_locked_mem_ex_functions -# define CRYPTO_set_locked_mem_ex_functions CRYPTO_set_locked_mem_ex_funcs -# undef CRYPTO_get_locked_mem_ex_functions -# define CRYPTO_get_locked_mem_ex_functions CRYPTO_get_locked_mem_ex_funcs - -/* Hack some long SSL/TLS names */ -# undef SSL_CTX_set_default_verify_paths -# define SSL_CTX_set_default_verify_paths SSL_CTX_set_def_verify_paths -# undef SSL_get_ex_data_X509_STORE_CTX_idx -# define SSL_get_ex_data_X509_STORE_CTX_idx SSL_get_ex_d_X509_STORE_CTX_idx -# undef SSL_add_file_cert_subjects_to_stack -# define SSL_add_file_cert_subjects_to_stack SSL_add_file_cert_subjs_to_stk -# undef SSL_add_dir_cert_subjects_to_stack -# define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_subjs_to_stk -# undef SSL_CTX_use_certificate_chain_file -# define SSL_CTX_use_certificate_chain_file SSL_CTX_use_cert_chain_file -# undef SSL_CTX_set_cert_verify_callback -# define SSL_CTX_set_cert_verify_callback SSL_CTX_set_cert_verify_cb -# undef SSL_CTX_set_default_passwd_cb_userdata -# define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud -# undef SSL_COMP_get_compression_methods -# define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods -# undef SSL_COMP_set0_compression_methods -# define SSL_COMP_set0_compression_methods SSL_COMP_set0_compress_methods -# undef SSL_COMP_free_compression_methods -# define SSL_COMP_free_compression_methods SSL_COMP_free_compress_methods -# undef ssl_add_clienthello_renegotiate_ext -# define ssl_add_clienthello_renegotiate_ext ssl_add_clienthello_reneg_ext -# undef ssl_add_serverhello_renegotiate_ext -# define ssl_add_serverhello_renegotiate_ext ssl_add_serverhello_reneg_ext -# undef ssl_parse_clienthello_renegotiate_ext -# define ssl_parse_clienthello_renegotiate_ext ssl_parse_clienthello_reneg_ext -# undef ssl_parse_serverhello_renegotiate_ext -# define ssl_parse_serverhello_renegotiate_ext ssl_parse_serverhello_reneg_ext -# undef SSL_srp_server_param_with_username -# define SSL_srp_server_param_with_username SSL_srp_server_param_with_un -# undef SSL_CTX_set_srp_client_pwd_callback -# define SSL_CTX_set_srp_client_pwd_callback SSL_CTX_set_srp_client_pwd_cb -# undef SSL_CTX_set_srp_verify_param_callback -# define SSL_CTX_set_srp_verify_param_callback SSL_CTX_set_srp_vfy_param_cb -# undef SSL_CTX_set_srp_username_callback -# define SSL_CTX_set_srp_username_callback SSL_CTX_set_srp_un_cb -# undef ssl_add_clienthello_use_srtp_ext -# define ssl_add_clienthello_use_srtp_ext ssl_add_clihello_use_srtp_ext -# undef ssl_add_serverhello_use_srtp_ext -# define ssl_add_serverhello_use_srtp_ext ssl_add_serhello_use_srtp_ext -# undef ssl_parse_clienthello_use_srtp_ext -# define ssl_parse_clienthello_use_srtp_ext ssl_parse_clihello_use_srtp_ext -# undef ssl_parse_serverhello_use_srtp_ext -# define ssl_parse_serverhello_use_srtp_ext ssl_parse_serhello_use_srtp_ext -# undef SSL_CTX_set_next_protos_advertised_cb -# define SSL_CTX_set_next_protos_advertised_cb SSL_CTX_set_next_protos_adv_cb -# undef SSL_CTX_set_next_proto_select_cb -# define SSL_CTX_set_next_proto_select_cb SSL_CTX_set_next_proto_sel_cb - -# undef tls1_send_server_supplemental_data -# define tls1_send_server_supplemental_data tls1_send_server_suppl_data -# undef tls1_send_client_supplemental_data -# define tls1_send_client_supplemental_data tls1_send_client_suppl_data -# undef tls1_get_server_supplemental_data -# define tls1_get_server_supplemental_data tls1_get_server_suppl_data -# undef tls1_get_client_supplemental_data -# define tls1_get_client_supplemental_data tls1_get_client_suppl_data - -# undef ssl3_cbc_record_digest_supported -# define ssl3_cbc_record_digest_supported ssl3_cbc_record_digest_support -# undef ssl_check_clienthello_tlsext_late -# define ssl_check_clienthello_tlsext_late ssl_check_clihello_tlsext_late -# undef ssl_check_clienthello_tlsext_early -# define ssl_check_clienthello_tlsext_early ssl_check_clihello_tlsext_early - -/* Hack some RSA long names */ -# undef RSA_padding_check_PKCS1_OAEP_mgf1 -# define RSA_padding_check_PKCS1_OAEP_mgf1 RSA_pad_check_PKCS1_OAEP_mgf1 - -/* Hack some ENGINE long names */ -# undef ENGINE_get_default_BN_mod_exp_crt -# define ENGINE_get_default_BN_mod_exp_crt ENGINE_get_def_BN_mod_exp_crt -# undef ENGINE_set_default_BN_mod_exp_crt -# define ENGINE_set_default_BN_mod_exp_crt ENGINE_set_def_BN_mod_exp_crt -# undef ENGINE_set_load_privkey_function -# define ENGINE_set_load_privkey_function ENGINE_set_load_privkey_fn -# undef ENGINE_get_load_privkey_function -# define ENGINE_get_load_privkey_function ENGINE_get_load_privkey_fn -# undef ENGINE_unregister_pkey_asn1_meths -# define ENGINE_unregister_pkey_asn1_meths ENGINE_unreg_pkey_asn1_meths -# undef ENGINE_register_all_pkey_asn1_meths -# define ENGINE_register_all_pkey_asn1_meths ENGINE_reg_all_pkey_asn1_meths -# undef ENGINE_set_default_pkey_asn1_meths -# define ENGINE_set_default_pkey_asn1_meths ENGINE_set_def_pkey_asn1_meths -# undef ENGINE_get_pkey_asn1_meth_engine -# define ENGINE_get_pkey_asn1_meth_engine ENGINE_get_pkey_asn1_meth_eng -# undef ENGINE_set_load_ssl_client_cert_function -# define ENGINE_set_load_ssl_client_cert_function \ - ENGINE_set_ld_ssl_clnt_cert_fn -# undef ENGINE_get_ssl_client_cert_function -# define ENGINE_get_ssl_client_cert_function ENGINE_get_ssl_client_cert_fn - -/* Hack some long OCSP names */ -# undef OCSP_REQUEST_get_ext_by_critical -# define OCSP_REQUEST_get_ext_by_critical OCSP_REQUEST_get_ext_by_crit -# undef OCSP_BASICRESP_get_ext_by_critical -# define OCSP_BASICRESP_get_ext_by_critical OCSP_BASICRESP_get_ext_by_crit -# undef OCSP_SINGLERESP_get_ext_by_critical -# define OCSP_SINGLERESP_get_ext_by_critical OCSP_SINGLERESP_get_ext_by_crit - -/* Hack some long DES names */ -# undef _ossl_old_des_ede3_cfb64_encrypt -# define _ossl_old_des_ede3_cfb64_encrypt _ossl_odes_ede3_cfb64_encrypt -# undef _ossl_old_des_ede3_ofb64_encrypt -# define _ossl_old_des_ede3_ofb64_encrypt _ossl_odes_ede3_ofb64_encrypt - -/* Hack some long EVP names */ -# undef OPENSSL_add_all_algorithms_noconf -# define OPENSSL_add_all_algorithms_noconf OPENSSL_add_all_algo_noconf -# undef OPENSSL_add_all_algorithms_conf -# define OPENSSL_add_all_algorithms_conf OPENSSL_add_all_algo_conf -# undef EVP_PKEY_meth_set_verify_recover -# define EVP_PKEY_meth_set_verify_recover EVP_PKEY_meth_set_vrfy_recover - -/* Hack some long EC names */ -# undef EC_GROUP_set_point_conversion_form -# define EC_GROUP_set_point_conversion_form EC_GROUP_set_point_conv_form -# undef EC_GROUP_get_point_conversion_form -# define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form -# undef EC_GROUP_clear_free_all_extra_data -# define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data -# undef EC_KEY_set_public_key_affine_coordinates -# define EC_KEY_set_public_key_affine_coordinates \ - EC_KEY_set_pub_key_aff_coords -# undef EC_POINT_set_Jprojective_coordinates_GFp -# define EC_POINT_set_Jprojective_coordinates_GFp \ - EC_POINT_set_Jproj_coords_GFp -# undef EC_POINT_get_Jprojective_coordinates_GFp -# define EC_POINT_get_Jprojective_coordinates_GFp \ - EC_POINT_get_Jproj_coords_GFp -# undef EC_POINT_set_affine_coordinates_GFp -# define EC_POINT_set_affine_coordinates_GFp EC_POINT_set_affine_coords_GFp -# undef EC_POINT_get_affine_coordinates_GFp -# define EC_POINT_get_affine_coordinates_GFp EC_POINT_get_affine_coords_GFp -# undef EC_POINT_set_compressed_coordinates_GFp -# define EC_POINT_set_compressed_coordinates_GFp EC_POINT_set_compr_coords_GFp -# undef EC_POINT_set_affine_coordinates_GF2m -# define EC_POINT_set_affine_coordinates_GF2m EC_POINT_set_affine_coords_GF2m -# undef EC_POINT_get_affine_coordinates_GF2m -# define EC_POINT_get_affine_coordinates_GF2m EC_POINT_get_affine_coords_GF2m -# undef EC_POINT_set_compressed_coordinates_GF2m -# define EC_POINT_set_compressed_coordinates_GF2m \ - EC_POINT_set_compr_coords_GF2m -# undef ec_GF2m_simple_group_clear_finish -# define ec_GF2m_simple_group_clear_finish ec_GF2m_simple_grp_clr_finish -# undef ec_GF2m_simple_group_check_discriminant -# define ec_GF2m_simple_group_check_discriminant ec_GF2m_simple_grp_chk_discrim -# undef ec_GF2m_simple_point_clear_finish -# define ec_GF2m_simple_point_clear_finish ec_GF2m_simple_pt_clr_finish -# undef ec_GF2m_simple_point_set_to_infinity -# define ec_GF2m_simple_point_set_to_infinity ec_GF2m_simple_pt_set_to_inf -# undef ec_GF2m_simple_points_make_affine -# define ec_GF2m_simple_points_make_affine ec_GF2m_simple_pts_make_affine -# undef ec_GF2m_simple_point_set_affine_coordinates -# define ec_GF2m_simple_point_set_affine_coordinates \ - ec_GF2m_smp_pt_set_af_coords -# undef ec_GF2m_simple_point_get_affine_coordinates -# define ec_GF2m_simple_point_get_affine_coordinates \ - ec_GF2m_smp_pt_get_af_coords -# undef ec_GF2m_simple_set_compressed_coordinates -# define ec_GF2m_simple_set_compressed_coordinates \ - ec_GF2m_smp_set_compr_coords -# undef ec_GFp_simple_group_set_curve_GFp -# define ec_GFp_simple_group_set_curve_GFp ec_GFp_simple_grp_set_curve_GFp -# undef ec_GFp_simple_group_get_curve_GFp -# define ec_GFp_simple_group_get_curve_GFp ec_GFp_simple_grp_get_curve_GFp -# undef ec_GFp_simple_group_clear_finish -# define ec_GFp_simple_group_clear_finish ec_GFp_simple_grp_clear_finish -# undef ec_GFp_simple_group_set_generator -# define ec_GFp_simple_group_set_generator ec_GFp_simple_grp_set_generator -# undef ec_GFp_simple_group_get0_generator -# define ec_GFp_simple_group_get0_generator ec_GFp_simple_grp_gt0_generator -# undef ec_GFp_simple_group_get_cofactor -# define ec_GFp_simple_group_get_cofactor ec_GFp_simple_grp_get_cofactor -# undef ec_GFp_simple_point_clear_finish -# define ec_GFp_simple_point_clear_finish ec_GFp_simple_pt_clear_finish -# undef ec_GFp_simple_point_set_to_infinity -# define ec_GFp_simple_point_set_to_infinity ec_GFp_simple_pt_set_to_inf -# undef ec_GFp_simple_points_make_affine -# define ec_GFp_simple_points_make_affine ec_GFp_simple_pts_make_affine -# undef ec_GFp_simple_set_Jprojective_coordinates_GFp -# define ec_GFp_simple_set_Jprojective_coordinates_GFp \ - ec_GFp_smp_set_Jproj_coords_GFp -# undef ec_GFp_simple_get_Jprojective_coordinates_GFp -# define ec_GFp_simple_get_Jprojective_coordinates_GFp \ - ec_GFp_smp_get_Jproj_coords_GFp -# undef ec_GFp_simple_point_set_affine_coordinates_GFp -# define ec_GFp_simple_point_set_affine_coordinates_GFp \ - ec_GFp_smp_pt_set_af_coords_GFp -# undef ec_GFp_simple_point_get_affine_coordinates_GFp -# define ec_GFp_simple_point_get_affine_coordinates_GFp \ - ec_GFp_smp_pt_get_af_coords_GFp -# undef ec_GFp_simple_set_compressed_coordinates_GFp -# define ec_GFp_simple_set_compressed_coordinates_GFp \ - ec_GFp_smp_set_compr_coords_GFp -# undef ec_GFp_simple_point_set_affine_coordinates -# define ec_GFp_simple_point_set_affine_coordinates \ - ec_GFp_smp_pt_set_af_coords -# undef ec_GFp_simple_point_get_affine_coordinates -# define ec_GFp_simple_point_get_affine_coordinates \ - ec_GFp_smp_pt_get_af_coords -# undef ec_GFp_simple_set_compressed_coordinates -# define ec_GFp_simple_set_compressed_coordinates \ - ec_GFp_smp_set_compr_coords -# undef ec_GFp_simple_group_check_discriminant -# define ec_GFp_simple_group_check_discriminant ec_GFp_simple_grp_chk_discrim - -/* Hack som long STORE names */ -# undef STORE_method_set_initialise_function -# define STORE_method_set_initialise_function STORE_meth_set_initialise_fn -# undef STORE_method_set_cleanup_function -# define STORE_method_set_cleanup_function STORE_meth_set_cleanup_fn -# undef STORE_method_set_generate_function -# define STORE_method_set_generate_function STORE_meth_set_generate_fn -# undef STORE_method_set_modify_function -# define STORE_method_set_modify_function STORE_meth_set_modify_fn -# undef STORE_method_set_revoke_function -# define STORE_method_set_revoke_function STORE_meth_set_revoke_fn -# undef STORE_method_set_delete_function -# define STORE_method_set_delete_function STORE_meth_set_delete_fn -# undef STORE_method_set_list_start_function -# define STORE_method_set_list_start_function STORE_meth_set_list_start_fn -# undef STORE_method_set_list_next_function -# define STORE_method_set_list_next_function STORE_meth_set_list_next_fn -# undef STORE_method_set_list_end_function -# define STORE_method_set_list_end_function STORE_meth_set_list_end_fn -# undef STORE_method_set_update_store_function -# define STORE_method_set_update_store_function STORE_meth_set_update_store_fn -# undef STORE_method_set_lock_store_function -# define STORE_method_set_lock_store_function STORE_meth_set_lock_store_fn -# undef STORE_method_set_unlock_store_function -# define STORE_method_set_unlock_store_function STORE_meth_set_unlock_store_fn -# undef STORE_method_get_initialise_function -# define STORE_method_get_initialise_function STORE_meth_get_initialise_fn -# undef STORE_method_get_cleanup_function -# define STORE_method_get_cleanup_function STORE_meth_get_cleanup_fn -# undef STORE_method_get_generate_function -# define STORE_method_get_generate_function STORE_meth_get_generate_fn -# undef STORE_method_get_modify_function -# define STORE_method_get_modify_function STORE_meth_get_modify_fn -# undef STORE_method_get_revoke_function -# define STORE_method_get_revoke_function STORE_meth_get_revoke_fn -# undef STORE_method_get_delete_function -# define STORE_method_get_delete_function STORE_meth_get_delete_fn -# undef STORE_method_get_list_start_function -# define STORE_method_get_list_start_function STORE_meth_get_list_start_fn -# undef STORE_method_get_list_next_function -# define STORE_method_get_list_next_function STORE_meth_get_list_next_fn -# undef STORE_method_get_list_end_function -# define STORE_method_get_list_end_function STORE_meth_get_list_end_fn -# undef STORE_method_get_update_store_function -# define STORE_method_get_update_store_function STORE_meth_get_update_store_fn -# undef STORE_method_get_lock_store_function -# define STORE_method_get_lock_store_function STORE_meth_get_lock_store_fn -# undef STORE_method_get_unlock_store_function -# define STORE_method_get_unlock_store_function STORE_meth_get_unlock_store_fn - -/* Hack some long TS names */ -# undef TS_RESP_CTX_set_status_info_cond -# define TS_RESP_CTX_set_status_info_cond TS_RESP_CTX_set_stat_info_cond -# undef TS_RESP_CTX_set_clock_precision_digits -# define TS_RESP_CTX_set_clock_precision_digits TS_RESP_CTX_set_clk_prec_digits -# undef TS_CONF_set_clock_precision_digits -# define TS_CONF_set_clock_precision_digits TS_CONF_set_clk_prec_digits - -/* Hack some long CMS names */ -# undef CMS_RecipientInfo_ktri_get0_algs -# define CMS_RecipientInfo_ktri_get0_algs CMS_RecipInfo_ktri_get0_algs -# undef CMS_RecipientInfo_ktri_get0_signer_id -# define CMS_RecipientInfo_ktri_get0_signer_id CMS_RecipInfo_ktri_get0_sigr_id -# undef CMS_OtherRevocationInfoFormat_it -# define CMS_OtherRevocationInfoFormat_it CMS_OtherRevocInfoFormat_it -# undef CMS_KeyAgreeRecipientIdentifier_it -# define CMS_KeyAgreeRecipientIdentifier_it CMS_KeyAgreeRecipIdentifier_it -# undef CMS_OriginatorIdentifierOrKey_it -# define CMS_OriginatorIdentifierOrKey_it CMS_OriginatorIdOrKey_it -# undef cms_SignerIdentifier_get0_signer_id -# define cms_SignerIdentifier_get0_signer_id cms_SignerId_get0_signer_id -# undef CMS_RecipientInfo_kari_get0_orig_id -# define CMS_RecipientInfo_kari_get0_orig_id CMS_RecipInfo_kari_get0_orig_id -# undef CMS_RecipientInfo_kari_get0_reks -# define CMS_RecipientInfo_kari_get0_reks CMS_RecipInfo_kari_get0_reks -# undef CMS_RecipientEncryptedKey_cert_cmp -# define CMS_RecipientEncryptedKey_cert_cmp CMS_RecipEncryptedKey_cert_cmp -# undef CMS_RecipientInfo_kari_set0_pkey -# define CMS_RecipientInfo_kari_set0_pkey CMS_RecipInfo_kari_set0_pkey -# undef CMS_RecipientEncryptedKey_get0_id -# define CMS_RecipientEncryptedKey_get0_id CMS_RecipEncryptedKey_get0_id -# undef CMS_RecipientInfo_kari_orig_id_cmp -# define CMS_RecipientInfo_kari_orig_id_cmp CMS_RecipInfo_kari_orig_id_cmp - -/* Hack some long DTLS1 names */ -# undef dtls1_retransmit_buffered_messages -# define dtls1_retransmit_buffered_messages dtls1_retransmit_buffered_msgs - -/* Hack some long SRP names */ -# undef SRP_generate_server_master_secret -# define SRP_generate_server_master_secret SRP_gen_server_master_secret -# undef SRP_generate_client_master_secret -# define SRP_generate_client_master_secret SRP_gen_client_master_secret - -/* Hack some long UI names */ -# undef UI_method_get_prompt_constructor -# define UI_method_get_prompt_constructor UI_method_get_prompt_constructr -# undef UI_method_set_prompt_constructor -# define UI_method_set_prompt_constructor UI_method_set_prompt_constructr - -# endif /* defined OPENSSL_SYS_VMS */ - -/* Case insensitive linking causes problems.... */ -# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2) -# undef ERR_load_CRYPTO_strings -# define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings -# undef OCSP_crlID_new -# define OCSP_crlID_new OCSP_crlID2_new - -# undef d2i_ECPARAMETERS -# define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS -# undef i2d_ECPARAMETERS -# define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS -# undef d2i_ECPKPARAMETERS -# define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS -# undef i2d_ECPKPARAMETERS -# define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS - -/* - * These functions do not seem to exist! However, I'm paranoid... Original - * command in x509v3.h: These functions are being redefined in another - * directory, and clash when the linker is case-insensitive, so let's hide - * them a little, by giving them an extra 'o' at the beginning of the name... - */ -# undef X509v3_cleanup_extensions -# define X509v3_cleanup_extensions oX509v3_cleanup_extensions -# undef X509v3_add_extension -# define X509v3_add_extension oX509v3_add_extension -# undef X509v3_add_netscape_extensions -# define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions -# undef X509v3_add_standard_extensions -# define X509v3_add_standard_extensions oX509v3_add_standard_extensions - -/* This one clashes with CMS_data_create */ -# undef cms_Data_create -# define cms_Data_create priv_cms_Data_create - -# endif - -#endif /* ! defined HEADER_VMS_IDHACKS_H */ diff --git a/libs/win32/openssl/include/openssl/tls1.h b/libs/win32/openssl/include/openssl/tls1.h deleted file mode 100644 index 7e237d0631..0000000000 --- a/libs/win32/openssl/include/openssl/tls1.h +++ /dev/null @@ -1,810 +0,0 @@ -/* ssl/tls1.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * ECC cipher suite support in OpenSSL originally written by - * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories. - * - */ -/* ==================================================================== - * Copyright 2005 Nokia. All rights reserved. - * - * The portions of the attached software ("Contribution") is developed by - * Nokia Corporation and is licensed pursuant to the OpenSSL open source - * license. - * - * The Contribution, originally written by Mika Kousa and Pasi Eronen of - * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites - * support (see RFC 4279) to OpenSSL. - * - * No patent licenses or other rights except those expressly stated in - * the OpenSSL open source license shall be deemed granted or received - * expressly, by implication, estoppel, or otherwise. - * - * No assurances are provided by Nokia that the Contribution does not - * infringe the patent or other intellectual property rights of any third - * party or that the license provides you with all the necessary rights - * to make use of the Contribution. - * - * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN - * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA - * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY - * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR - * OTHERWISE. - */ - -#ifndef HEADER_TLS1_H -# define HEADER_TLS1_H - -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0 - -# define TLS1_VERSION 0x0301 -# define TLS1_1_VERSION 0x0302 -# define TLS1_2_VERSION 0x0303 -# define TLS_MAX_VERSION TLS1_2_VERSION - -# define TLS1_VERSION_MAJOR 0x03 -# define TLS1_VERSION_MINOR 0x01 - -# define TLS1_1_VERSION_MAJOR 0x03 -# define TLS1_1_VERSION_MINOR 0x02 - -# define TLS1_2_VERSION_MAJOR 0x03 -# define TLS1_2_VERSION_MINOR 0x03 - -# define TLS1_get_version(s) \ - ((s->version >> 8) == TLS1_VERSION_MAJOR ? s->version : 0) - -# define TLS1_get_client_version(s) \ - ((s->client_version >> 8) == TLS1_VERSION_MAJOR ? s->client_version : 0) - -# define TLS1_AD_DECRYPTION_FAILED 21 -# define TLS1_AD_RECORD_OVERFLOW 22 -# define TLS1_AD_UNKNOWN_CA 48/* fatal */ -# define TLS1_AD_ACCESS_DENIED 49/* fatal */ -# define TLS1_AD_DECODE_ERROR 50/* fatal */ -# define TLS1_AD_DECRYPT_ERROR 51 -# define TLS1_AD_EXPORT_RESTRICTION 60/* fatal */ -# define TLS1_AD_PROTOCOL_VERSION 70/* fatal */ -# define TLS1_AD_INSUFFICIENT_SECURITY 71/* fatal */ -# define TLS1_AD_INTERNAL_ERROR 80/* fatal */ -# define TLS1_AD_INAPPROPRIATE_FALLBACK 86/* fatal */ -# define TLS1_AD_USER_CANCELLED 90 -# define TLS1_AD_NO_RENEGOTIATION 100 -/* codes 110-114 are from RFC3546 */ -# define TLS1_AD_UNSUPPORTED_EXTENSION 110 -# define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111 -# define TLS1_AD_UNRECOGNIZED_NAME 112 -# define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113 -# define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114 -# define TLS1_AD_UNKNOWN_PSK_IDENTITY 115/* fatal */ - -/* ExtensionType values from RFC3546 / RFC4366 / RFC6066 */ -# define TLSEXT_TYPE_server_name 0 -# define TLSEXT_TYPE_max_fragment_length 1 -# define TLSEXT_TYPE_client_certificate_url 2 -# define TLSEXT_TYPE_trusted_ca_keys 3 -# define TLSEXT_TYPE_truncated_hmac 4 -# define TLSEXT_TYPE_status_request 5 -/* ExtensionType values from RFC4681 */ -# define TLSEXT_TYPE_user_mapping 6 -/* ExtensionType values from RFC5878 */ -# define TLSEXT_TYPE_client_authz 7 -# define TLSEXT_TYPE_server_authz 8 -/* ExtensionType values from RFC6091 */ -# define TLSEXT_TYPE_cert_type 9 - -/* ExtensionType values from RFC4492 */ -# define TLSEXT_TYPE_elliptic_curves 10 -# define TLSEXT_TYPE_ec_point_formats 11 - -/* ExtensionType value from RFC5054 */ -# define TLSEXT_TYPE_srp 12 - -/* ExtensionType values from RFC5246 */ -# define TLSEXT_TYPE_signature_algorithms 13 - -/* ExtensionType value from RFC5764 */ -# define TLSEXT_TYPE_use_srtp 14 - -/* ExtensionType value from RFC5620 */ -# define TLSEXT_TYPE_heartbeat 15 - -/* ExtensionType value from RFC7301 */ -# define TLSEXT_TYPE_application_layer_protocol_negotiation 16 - -/* - * ExtensionType value for TLS padding extension. - * http://tools.ietf.org/html/draft-agl-tls-padding - */ -# define TLSEXT_TYPE_padding 21 - -/* ExtensionType value from RFC4507 */ -# define TLSEXT_TYPE_session_ticket 35 - -/* ExtensionType value from draft-rescorla-tls-opaque-prf-input-00.txt */ -# if 0 -/* - * will have to be provided externally for now , - * i.e. build with -DTLSEXT_TYPE_opaque_prf_input=38183 - * using whatever extension number you'd like to try - */ -# define TLSEXT_TYPE_opaque_prf_input ?? -# endif - -/* Temporary extension type */ -# define TLSEXT_TYPE_renegotiate 0xff01 - -# ifndef OPENSSL_NO_NEXTPROTONEG -/* This is not an IANA defined extension number */ -# define TLSEXT_TYPE_next_proto_neg 13172 -# endif - -/* NameType value from RFC3546 */ -# define TLSEXT_NAMETYPE_host_name 0 -/* status request value from RFC3546 */ -# define TLSEXT_STATUSTYPE_ocsp 1 - -/* ECPointFormat values from RFC4492 */ -# define TLSEXT_ECPOINTFORMAT_first 0 -# define TLSEXT_ECPOINTFORMAT_uncompressed 0 -# define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime 1 -# define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2 -# define TLSEXT_ECPOINTFORMAT_last 2 - -/* Signature and hash algorithms from RFC5246 */ -# define TLSEXT_signature_anonymous 0 -# define TLSEXT_signature_rsa 1 -# define TLSEXT_signature_dsa 2 -# define TLSEXT_signature_ecdsa 3 - -/* Total number of different signature algorithms */ -# define TLSEXT_signature_num 4 - -# define TLSEXT_hash_none 0 -# define TLSEXT_hash_md5 1 -# define TLSEXT_hash_sha1 2 -# define TLSEXT_hash_sha224 3 -# define TLSEXT_hash_sha256 4 -# define TLSEXT_hash_sha384 5 -# define TLSEXT_hash_sha512 6 - -/* Total number of different digest algorithms */ - -# define TLSEXT_hash_num 7 - -/* Flag set for unrecognised algorithms */ -# define TLSEXT_nid_unknown 0x1000000 - -/* ECC curves */ - -# define TLSEXT_curve_P_256 23 -# define TLSEXT_curve_P_384 24 - -# ifndef OPENSSL_NO_TLSEXT - -# define TLSEXT_MAXLEN_host_name 255 - -const char *SSL_get_servername(const SSL *s, const int type); -int SSL_get_servername_type(const SSL *s); -/* - * SSL_export_keying_material exports a value derived from the master secret, - * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and - * optional context. (Since a zero length context is allowed, the |use_context| - * flag controls whether a context is included.) It returns 1 on success and - * zero otherwise. - */ -int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, - const char *label, size_t llen, - const unsigned char *p, size_t plen, - int use_context); - -int SSL_get_sigalgs(SSL *s, int idx, - int *psign, int *phash, int *psignandhash, - unsigned char *rsig, unsigned char *rhash); - -int SSL_get_shared_sigalgs(SSL *s, int idx, - int *psign, int *phash, int *psignandhash, - unsigned char *rsig, unsigned char *rhash); - -int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain); - -# define SSL_set_tlsext_host_name(s,name) \ -SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name) - -# define SSL_set_tlsext_debug_callback(ssl, cb) \ -SSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,(void (*)(void))cb) - -# define SSL_set_tlsext_debug_arg(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0, (void *)arg) - -# define SSL_set_tlsext_status_type(ssl, type) \ -SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type, NULL) - -# define SSL_get_tlsext_status_exts(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg) - -# define SSL_set_tlsext_status_exts(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg) - -# define SSL_get_tlsext_status_ids(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg) - -# define SSL_set_tlsext_status_ids(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg) - -# define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \ -SSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0, (void *)arg) - -# define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \ -SSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen, (void *)arg) - -# define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \ -SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,(void (*)(void))cb) - -# define SSL_TLSEXT_ERR_OK 0 -# define SSL_TLSEXT_ERR_ALERT_WARNING 1 -# define SSL_TLSEXT_ERR_ALERT_FATAL 2 -# define SSL_TLSEXT_ERR_NOACK 3 - -# define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \ -SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0, (void *)arg) - -# define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_GET_TLSEXT_TICKET_KEYS,(keylen),(keys)) -# define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \ - SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLSEXT_TICKET_KEYS,(keylen),(keys)) - -# define SSL_CTX_set_tlsext_status_cb(ssl, cb) \ -SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) - -# define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) - -# define SSL_set_tlsext_opaque_prf_input(s, src, len) \ -SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT, len, src) -# define SSL_CTX_set_tlsext_opaque_prf_input_callback(ctx, cb) \ -SSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB, (void (*)(void))cb) -# define SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(ctx, arg) \ -SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG, 0, arg) - -# define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ -SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) - -# ifndef OPENSSL_NO_HEARTBEATS -# define SSL_TLSEXT_HB_ENABLED 0x01 -# define SSL_TLSEXT_HB_DONT_SEND_REQUESTS 0x02 -# define SSL_TLSEXT_HB_DONT_RECV_REQUESTS 0x04 - -# define SSL_get_tlsext_heartbeat_pending(ssl) \ - SSL_ctrl((ssl),SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING,0,NULL) -# define SSL_set_tlsext_heartbeat_no_requests(ssl, arg) \ - SSL_ctrl((ssl),SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS,arg,NULL) -# endif -# endif - -/* PSK ciphersuites from 4279 */ -# define TLS1_CK_PSK_WITH_RC4_128_SHA 0x0300008A -# define TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA 0x0300008B -# define TLS1_CK_PSK_WITH_AES_128_CBC_SHA 0x0300008C -# define TLS1_CK_PSK_WITH_AES_256_CBC_SHA 0x0300008D - -/* - * Additional TLS ciphersuites from expired Internet Draft - * draft-ietf-tls-56-bit-ciphersuites-01.txt (available if - * TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES is defined, see s3_lib.c). We - * actually treat them like SSL 3.0 ciphers, which we probably shouldn't. - * Note that the first two are actually not in the IDs. - */ -# define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 0x03000060/* not in - * ID */ -# define TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 0x03000061/* not in - * ID */ -# define TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA 0x03000062 -# define TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x03000063 -# define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA 0x03000064 -# define TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA 0x03000065 -# define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066 - -/* AES ciphersuites from RFC3268 */ -# define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F -# define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030 -# define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031 -# define TLS1_CK_DHE_DSS_WITH_AES_128_SHA 0x03000032 -# define TLS1_CK_DHE_RSA_WITH_AES_128_SHA 0x03000033 -# define TLS1_CK_ADH_WITH_AES_128_SHA 0x03000034 - -# define TLS1_CK_RSA_WITH_AES_256_SHA 0x03000035 -# define TLS1_CK_DH_DSS_WITH_AES_256_SHA 0x03000036 -# define TLS1_CK_DH_RSA_WITH_AES_256_SHA 0x03000037 -# define TLS1_CK_DHE_DSS_WITH_AES_256_SHA 0x03000038 -# define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039 -# define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A - -/* TLS v1.2 ciphersuites */ -# define TLS1_CK_RSA_WITH_NULL_SHA256 0x0300003B -# define TLS1_CK_RSA_WITH_AES_128_SHA256 0x0300003C -# define TLS1_CK_RSA_WITH_AES_256_SHA256 0x0300003D -# define TLS1_CK_DH_DSS_WITH_AES_128_SHA256 0x0300003E -# define TLS1_CK_DH_RSA_WITH_AES_128_SHA256 0x0300003F -# define TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 0x03000040 - -/* Camellia ciphersuites from RFC4132 */ -# define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041 -# define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042 -# define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000043 -# define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000044 -# define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045 -# define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046 - -/* TLS v1.2 ciphersuites */ -# define TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 0x03000067 -# define TLS1_CK_DH_DSS_WITH_AES_256_SHA256 0x03000068 -# define TLS1_CK_DH_RSA_WITH_AES_256_SHA256 0x03000069 -# define TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 0x0300006A -# define TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 0x0300006B -# define TLS1_CK_ADH_WITH_AES_128_SHA256 0x0300006C -# define TLS1_CK_ADH_WITH_AES_256_SHA256 0x0300006D - -/* Camellia ciphersuites from RFC4132 */ -# define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084 -# define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085 -# define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086 -# define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000087 -# define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000088 -# define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA 0x03000089 - -/* SEED ciphersuites from RFC4162 */ -# define TLS1_CK_RSA_WITH_SEED_SHA 0x03000096 -# define TLS1_CK_DH_DSS_WITH_SEED_SHA 0x03000097 -# define TLS1_CK_DH_RSA_WITH_SEED_SHA 0x03000098 -# define TLS1_CK_DHE_DSS_WITH_SEED_SHA 0x03000099 -# define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A -# define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B - -/* TLS v1.2 GCM ciphersuites from RFC5288 */ -# define TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 0x0300009C -# define TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 0x0300009D -# define TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 0x0300009E -# define TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 0x0300009F -# define TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 0x030000A0 -# define TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 0x030000A1 -# define TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 0x030000A2 -# define TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 0x030000A3 -# define TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 0x030000A4 -# define TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 0x030000A5 -# define TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 0x030000A6 -# define TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 0x030000A7 - -/* - * ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in - * draft 13 - */ -# define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001 -# define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002 -# define TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C003 -# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0x0300C004 -# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0x0300C005 - -# define TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA 0x0300C006 -# define TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA 0x0300C007 -# define TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C008 -# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0x0300C009 -# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0x0300C00A - -# define TLS1_CK_ECDH_RSA_WITH_NULL_SHA 0x0300C00B -# define TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA 0x0300C00C -# define TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA 0x0300C00D -# define TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA 0x0300C00E -# define TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA 0x0300C00F - -# define TLS1_CK_ECDHE_RSA_WITH_NULL_SHA 0x0300C010 -# define TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA 0x0300C011 -# define TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA 0x0300C012 -# define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA 0x0300C013 -# define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA 0x0300C014 - -# define TLS1_CK_ECDH_anon_WITH_NULL_SHA 0x0300C015 -# define TLS1_CK_ECDH_anon_WITH_RC4_128_SHA 0x0300C016 -# define TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA 0x0300C017 -# define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA 0x0300C018 -# define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA 0x0300C019 - -/* SRP ciphersuites from RFC 5054 */ -# define TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA 0x0300C01A -# define TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA 0x0300C01B -# define TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA 0x0300C01C -# define TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA 0x0300C01D -# define TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA 0x0300C01E -# define TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA 0x0300C01F -# define TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA 0x0300C020 -# define TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA 0x0300C021 -# define TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA 0x0300C022 - -/* ECDH HMAC based ciphersuites from RFC5289 */ - -# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 0x0300C023 -# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 0x0300C024 -# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 0x0300C025 -# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 0x0300C026 -# define TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 0x0300C027 -# define TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 0x0300C028 -# define TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 0x0300C029 -# define TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 0x0300C02A - -/* ECDH GCM based ciphersuites from RFC5289 */ -# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02B -# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02C -# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02D -# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02E -# define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0x0300C02F -# define TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0x0300C030 -# define TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 0x0300C031 -# define TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 0x0300C032 - -/* - * XXX * Backward compatibility alert: + * Older versions of OpenSSL gave - * some DHE ciphers names with "EDH" + * instead of "DHE". Going forward, we - * should be using DHE + * everywhere, though we may indefinitely maintain - * aliases for users + * or configurations that used "EDH" + - */ -# define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 "EXP1024-RC4-MD5" -# define TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 "EXP1024-RC2-CBC-MD5" -# define TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DES-CBC-SHA" -# define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DHE-DSS-DES-CBC-SHA" -# define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA "EXP1024-RC4-SHA" -# define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA "EXP1024-DHE-DSS-RC4-SHA" -# define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA "DHE-DSS-RC4-SHA" - -/* AES ciphersuites from RFC3268 */ -# define TLS1_TXT_RSA_WITH_AES_128_SHA "AES128-SHA" -# define TLS1_TXT_DH_DSS_WITH_AES_128_SHA "DH-DSS-AES128-SHA" -# define TLS1_TXT_DH_RSA_WITH_AES_128_SHA "DH-RSA-AES128-SHA" -# define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA "DHE-DSS-AES128-SHA" -# define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA "DHE-RSA-AES128-SHA" -# define TLS1_TXT_ADH_WITH_AES_128_SHA "ADH-AES128-SHA" - -# define TLS1_TXT_RSA_WITH_AES_256_SHA "AES256-SHA" -# define TLS1_TXT_DH_DSS_WITH_AES_256_SHA "DH-DSS-AES256-SHA" -# define TLS1_TXT_DH_RSA_WITH_AES_256_SHA "DH-RSA-AES256-SHA" -# define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA "DHE-DSS-AES256-SHA" -# define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA" -# define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA" - -/* ECC ciphersuites from RFC4492 */ -# define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA" -# define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA" -# define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA" -# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA "ECDH-ECDSA-AES128-SHA" -# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA "ECDH-ECDSA-AES256-SHA" - -# define TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA "ECDHE-ECDSA-NULL-SHA" -# define TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA "ECDHE-ECDSA-RC4-SHA" -# define TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA "ECDHE-ECDSA-DES-CBC3-SHA" -# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA "ECDHE-ECDSA-AES128-SHA" -# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA "ECDHE-ECDSA-AES256-SHA" - -# define TLS1_TXT_ECDH_RSA_WITH_NULL_SHA "ECDH-RSA-NULL-SHA" -# define TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA "ECDH-RSA-RC4-SHA" -# define TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA "ECDH-RSA-DES-CBC3-SHA" -# define TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA "ECDH-RSA-AES128-SHA" -# define TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA "ECDH-RSA-AES256-SHA" - -# define TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA "ECDHE-RSA-NULL-SHA" -# define TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA "ECDHE-RSA-RC4-SHA" -# define TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA "ECDHE-RSA-DES-CBC3-SHA" -# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA "ECDHE-RSA-AES128-SHA" -# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA "ECDHE-RSA-AES256-SHA" - -# define TLS1_TXT_ECDH_anon_WITH_NULL_SHA "AECDH-NULL-SHA" -# define TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA "AECDH-RC4-SHA" -# define TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA "AECDH-DES-CBC3-SHA" -# define TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA "AECDH-AES128-SHA" -# define TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA "AECDH-AES256-SHA" - -/* PSK ciphersuites from RFC 4279 */ -# define TLS1_TXT_PSK_WITH_RC4_128_SHA "PSK-RC4-SHA" -# define TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA "PSK-3DES-EDE-CBC-SHA" -# define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA "PSK-AES128-CBC-SHA" -# define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA "PSK-AES256-CBC-SHA" - -/* SRP ciphersuite from RFC 5054 */ -# define TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA "SRP-3DES-EDE-CBC-SHA" -# define TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA "SRP-RSA-3DES-EDE-CBC-SHA" -# define TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA "SRP-DSS-3DES-EDE-CBC-SHA" -# define TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA "SRP-AES-128-CBC-SHA" -# define TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA "SRP-RSA-AES-128-CBC-SHA" -# define TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA "SRP-DSS-AES-128-CBC-SHA" -# define TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA "SRP-AES-256-CBC-SHA" -# define TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA "SRP-RSA-AES-256-CBC-SHA" -# define TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA "SRP-DSS-AES-256-CBC-SHA" - -/* Camellia ciphersuites from RFC4132 */ -# define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA" -# define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA" -# define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA "DH-RSA-CAMELLIA128-SHA" -# define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA "DHE-DSS-CAMELLIA128-SHA" -# define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA "DHE-RSA-CAMELLIA128-SHA" -# define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA "ADH-CAMELLIA128-SHA" - -# define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA "CAMELLIA256-SHA" -# define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA "DH-DSS-CAMELLIA256-SHA" -# define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA "DH-RSA-CAMELLIA256-SHA" -# define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA "DHE-DSS-CAMELLIA256-SHA" -# define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA "DHE-RSA-CAMELLIA256-SHA" -# define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA "ADH-CAMELLIA256-SHA" - -/* SEED ciphersuites from RFC4162 */ -# define TLS1_TXT_RSA_WITH_SEED_SHA "SEED-SHA" -# define TLS1_TXT_DH_DSS_WITH_SEED_SHA "DH-DSS-SEED-SHA" -# define TLS1_TXT_DH_RSA_WITH_SEED_SHA "DH-RSA-SEED-SHA" -# define TLS1_TXT_DHE_DSS_WITH_SEED_SHA "DHE-DSS-SEED-SHA" -# define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA" -# define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA" - -/* TLS v1.2 ciphersuites */ -# define TLS1_TXT_RSA_WITH_NULL_SHA256 "NULL-SHA256" -# define TLS1_TXT_RSA_WITH_AES_128_SHA256 "AES128-SHA256" -# define TLS1_TXT_RSA_WITH_AES_256_SHA256 "AES256-SHA256" -# define TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 "DH-DSS-AES128-SHA256" -# define TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 "DH-RSA-AES128-SHA256" -# define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 "DHE-DSS-AES128-SHA256" -# define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 "DHE-RSA-AES128-SHA256" -# define TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 "DH-DSS-AES256-SHA256" -# define TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 "DH-RSA-AES256-SHA256" -# define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 "DHE-DSS-AES256-SHA256" -# define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 "DHE-RSA-AES256-SHA256" -# define TLS1_TXT_ADH_WITH_AES_128_SHA256 "ADH-AES128-SHA256" -# define TLS1_TXT_ADH_WITH_AES_256_SHA256 "ADH-AES256-SHA256" - -/* TLS v1.2 GCM ciphersuites from RFC5288 */ -# define TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 "AES128-GCM-SHA256" -# define TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 "AES256-GCM-SHA384" -# define TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 "DHE-RSA-AES128-GCM-SHA256" -# define TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 "DHE-RSA-AES256-GCM-SHA384" -# define TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 "DH-RSA-AES128-GCM-SHA256" -# define TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 "DH-RSA-AES256-GCM-SHA384" -# define TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 "DHE-DSS-AES128-GCM-SHA256" -# define TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 "DHE-DSS-AES256-GCM-SHA384" -# define TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 "DH-DSS-AES128-GCM-SHA256" -# define TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 "DH-DSS-AES256-GCM-SHA384" -# define TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 "ADH-AES128-GCM-SHA256" -# define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 "ADH-AES256-GCM-SHA384" - -/* ECDH HMAC based ciphersuites from RFC5289 */ - -# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 "ECDHE-ECDSA-AES128-SHA256" -# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 "ECDHE-ECDSA-AES256-SHA384" -# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 "ECDH-ECDSA-AES128-SHA256" -# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 "ECDH-ECDSA-AES256-SHA384" -# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 "ECDHE-RSA-AES128-SHA256" -# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 "ECDHE-RSA-AES256-SHA384" -# define TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 "ECDH-RSA-AES128-SHA256" -# define TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 "ECDH-RSA-AES256-SHA384" - -/* ECDH GCM based ciphersuites from RFC5289 */ -# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 "ECDHE-ECDSA-AES128-GCM-SHA256" -# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 "ECDHE-ECDSA-AES256-GCM-SHA384" -# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 "ECDH-ECDSA-AES128-GCM-SHA256" -# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 "ECDH-ECDSA-AES256-GCM-SHA384" -# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 "ECDHE-RSA-AES128-GCM-SHA256" -# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 "ECDHE-RSA-AES256-GCM-SHA384" -# define TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 "ECDH-RSA-AES128-GCM-SHA256" -# define TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 "ECDH-RSA-AES256-GCM-SHA384" - -# define TLS_CT_RSA_SIGN 1 -# define TLS_CT_DSS_SIGN 2 -# define TLS_CT_RSA_FIXED_DH 3 -# define TLS_CT_DSS_FIXED_DH 4 -# define TLS_CT_ECDSA_SIGN 64 -# define TLS_CT_RSA_FIXED_ECDH 65 -# define TLS_CT_ECDSA_FIXED_ECDH 66 -# define TLS_CT_GOST94_SIGN 21 -# define TLS_CT_GOST01_SIGN 22 -/* - * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see - * comment there) - */ -# define TLS_CT_NUMBER 9 - -# define TLS1_FINISH_MAC_LENGTH 12 - -# define TLS_MD_MAX_CONST_SIZE 20 -# define TLS_MD_CLIENT_FINISH_CONST "client finished" -# define TLS_MD_CLIENT_FINISH_CONST_SIZE 15 -# define TLS_MD_SERVER_FINISH_CONST "server finished" -# define TLS_MD_SERVER_FINISH_CONST_SIZE 15 -# define TLS_MD_SERVER_WRITE_KEY_CONST "server write key" -# define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16 -# define TLS_MD_KEY_EXPANSION_CONST "key expansion" -# define TLS_MD_KEY_EXPANSION_CONST_SIZE 13 -# define TLS_MD_CLIENT_WRITE_KEY_CONST "client write key" -# define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE 16 -# define TLS_MD_SERVER_WRITE_KEY_CONST "server write key" -# define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE 16 -# define TLS_MD_IV_BLOCK_CONST "IV block" -# define TLS_MD_IV_BLOCK_CONST_SIZE 8 -# define TLS_MD_MASTER_SECRET_CONST "master secret" -# define TLS_MD_MASTER_SECRET_CONST_SIZE 13 - -# ifdef CHARSET_EBCDIC -# undef TLS_MD_CLIENT_FINISH_CONST -/* - * client finished - */ -# define TLS_MD_CLIENT_FINISH_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x66\x69\x6e\x69\x73\x68\x65\x64" - -# undef TLS_MD_SERVER_FINISH_CONST -/* - * server finished - */ -# define TLS_MD_SERVER_FINISH_CONST "\x73\x65\x72\x76\x65\x72\x20\x66\x69\x6e\x69\x73\x68\x65\x64" - -# undef TLS_MD_SERVER_WRITE_KEY_CONST -/* - * server write key - */ -# define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" - -# undef TLS_MD_KEY_EXPANSION_CONST -/* - * key expansion - */ -# define TLS_MD_KEY_EXPANSION_CONST "\x6b\x65\x79\x20\x65\x78\x70\x61\x6e\x73\x69\x6f\x6e" - -# undef TLS_MD_CLIENT_WRITE_KEY_CONST -/* - * client write key - */ -# define TLS_MD_CLIENT_WRITE_KEY_CONST "\x63\x6c\x69\x65\x6e\x74\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" - -# undef TLS_MD_SERVER_WRITE_KEY_CONST -/* - * server write key - */ -# define TLS_MD_SERVER_WRITE_KEY_CONST "\x73\x65\x72\x76\x65\x72\x20\x77\x72\x69\x74\x65\x20\x6b\x65\x79" - -# undef TLS_MD_IV_BLOCK_CONST -/* - * IV block - */ -# define TLS_MD_IV_BLOCK_CONST "\x49\x56\x20\x62\x6c\x6f\x63\x6b" - -# undef TLS_MD_MASTER_SECRET_CONST -/* - * master secret - */ -# define TLS_MD_MASTER_SECRET_CONST "\x6d\x61\x73\x74\x65\x72\x20\x73\x65\x63\x72\x65\x74" -# endif - -/* TLS Session Ticket extension struct */ -struct tls_session_ticket_ext_st { - unsigned short length; - void *data; -}; - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/ts.h b/libs/win32/openssl/include/openssl/ts.h deleted file mode 100644 index 2daa1b2fb5..0000000000 --- a/libs/win32/openssl/include/openssl/ts.h +++ /dev/null @@ -1,865 +0,0 @@ -/* crypto/ts/ts.h */ -/* - * Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL project - * 2002, 2003, 2004. - */ -/* ==================================================================== - * Copyright (c) 2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_TS_H -# define HEADER_TS_H - -# include -# include -# ifndef OPENSSL_NO_BUFFER -# include -# endif -# ifndef OPENSSL_NO_EVP -# include -# endif -# ifndef OPENSSL_NO_BIO -# include -# endif -# include -# include -# include - -# ifndef OPENSSL_NO_RSA -# include -# endif - -# ifndef OPENSSL_NO_DSA -# include -# endif - -# ifndef OPENSSL_NO_DH -# include -# endif - -#ifdef __cplusplus -extern "C" { -#endif - -# ifdef WIN32 -/* Under Win32 this is defined in wincrypt.h */ -# undef X509_NAME -# endif - -# include -# include - -/*- -MessageImprint ::= SEQUENCE { - hashAlgorithm AlgorithmIdentifier, - hashedMessage OCTET STRING } -*/ - -typedef struct TS_msg_imprint_st { - X509_ALGOR *hash_algo; - ASN1_OCTET_STRING *hashed_msg; -} TS_MSG_IMPRINT; - -/*- -TimeStampReq ::= SEQUENCE { - version INTEGER { v1(1) }, - messageImprint MessageImprint, - --a hash algorithm OID and the hash value of the data to be - --time-stamped - reqPolicy TSAPolicyId OPTIONAL, - nonce INTEGER OPTIONAL, - certReq BOOLEAN DEFAULT FALSE, - extensions [0] IMPLICIT Extensions OPTIONAL } -*/ - -typedef struct TS_req_st { - ASN1_INTEGER *version; - TS_MSG_IMPRINT *msg_imprint; - ASN1_OBJECT *policy_id; /* OPTIONAL */ - ASN1_INTEGER *nonce; /* OPTIONAL */ - ASN1_BOOLEAN cert_req; /* DEFAULT FALSE */ - STACK_OF(X509_EXTENSION) *extensions; /* [0] OPTIONAL */ -} TS_REQ; - -/*- -Accuracy ::= SEQUENCE { - seconds INTEGER OPTIONAL, - millis [0] INTEGER (1..999) OPTIONAL, - micros [1] INTEGER (1..999) OPTIONAL } -*/ - -typedef struct TS_accuracy_st { - ASN1_INTEGER *seconds; - ASN1_INTEGER *millis; - ASN1_INTEGER *micros; -} TS_ACCURACY; - -/*- -TSTInfo ::= SEQUENCE { - version INTEGER { v1(1) }, - policy TSAPolicyId, - messageImprint MessageImprint, - -- MUST have the same value as the similar field in - -- TimeStampReq - serialNumber INTEGER, - -- Time-Stamping users MUST be ready to accommodate integers - -- up to 160 bits. - genTime GeneralizedTime, - accuracy Accuracy OPTIONAL, - ordering BOOLEAN DEFAULT FALSE, - nonce INTEGER OPTIONAL, - -- MUST be present if the similar field was present - -- in TimeStampReq. In that case it MUST have the same value. - tsa [0] GeneralName OPTIONAL, - extensions [1] IMPLICIT Extensions OPTIONAL } -*/ - -typedef struct TS_tst_info_st { - ASN1_INTEGER *version; - ASN1_OBJECT *policy_id; - TS_MSG_IMPRINT *msg_imprint; - ASN1_INTEGER *serial; - ASN1_GENERALIZEDTIME *time; - TS_ACCURACY *accuracy; - ASN1_BOOLEAN ordering; - ASN1_INTEGER *nonce; - GENERAL_NAME *tsa; - STACK_OF(X509_EXTENSION) *extensions; -} TS_TST_INFO; - -/*- -PKIStatusInfo ::= SEQUENCE { - status PKIStatus, - statusString PKIFreeText OPTIONAL, - failInfo PKIFailureInfo OPTIONAL } - -From RFC 1510 - section 3.1.1: -PKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String - -- text encoded as UTF-8 String (note: each UTF8String SHOULD - -- include an RFC 1766 language tag to indicate the language - -- of the contained text) -*/ - -/* Possible values for status. See ts_resp_print.c && ts_resp_verify.c. */ - -# define TS_STATUS_GRANTED 0 -# define TS_STATUS_GRANTED_WITH_MODS 1 -# define TS_STATUS_REJECTION 2 -# define TS_STATUS_WAITING 3 -# define TS_STATUS_REVOCATION_WARNING 4 -# define TS_STATUS_REVOCATION_NOTIFICATION 5 - -/* - * Possible values for failure_info. See ts_resp_print.c && ts_resp_verify.c - */ - -# define TS_INFO_BAD_ALG 0 -# define TS_INFO_BAD_REQUEST 2 -# define TS_INFO_BAD_DATA_FORMAT 5 -# define TS_INFO_TIME_NOT_AVAILABLE 14 -# define TS_INFO_UNACCEPTED_POLICY 15 -# define TS_INFO_UNACCEPTED_EXTENSION 16 -# define TS_INFO_ADD_INFO_NOT_AVAILABLE 17 -# define TS_INFO_SYSTEM_FAILURE 25 - -typedef struct TS_status_info_st { - ASN1_INTEGER *status; - STACK_OF(ASN1_UTF8STRING) *text; - ASN1_BIT_STRING *failure_info; -} TS_STATUS_INFO; - -DECLARE_STACK_OF(ASN1_UTF8STRING) -DECLARE_ASN1_SET_OF(ASN1_UTF8STRING) - -/*- -TimeStampResp ::= SEQUENCE { - status PKIStatusInfo, - timeStampToken TimeStampToken OPTIONAL } -*/ - -typedef struct TS_resp_st { - TS_STATUS_INFO *status_info; - PKCS7 *token; - TS_TST_INFO *tst_info; -} TS_RESP; - -/* The structure below would belong to the ESS component. */ - -/*- -IssuerSerial ::= SEQUENCE { - issuer GeneralNames, - serialNumber CertificateSerialNumber - } -*/ - -typedef struct ESS_issuer_serial { - STACK_OF(GENERAL_NAME) *issuer; - ASN1_INTEGER *serial; -} ESS_ISSUER_SERIAL; - -/*- -ESSCertID ::= SEQUENCE { - certHash Hash, - issuerSerial IssuerSerial OPTIONAL -} -*/ - -typedef struct ESS_cert_id { - ASN1_OCTET_STRING *hash; /* Always SHA-1 digest. */ - ESS_ISSUER_SERIAL *issuer_serial; -} ESS_CERT_ID; - -DECLARE_STACK_OF(ESS_CERT_ID) -DECLARE_ASN1_SET_OF(ESS_CERT_ID) - -/*- -SigningCertificate ::= SEQUENCE { - certs SEQUENCE OF ESSCertID, - policies SEQUENCE OF PolicyInformation OPTIONAL -} -*/ - -typedef struct ESS_signing_cert { - STACK_OF(ESS_CERT_ID) *cert_ids; - STACK_OF(POLICYINFO) *policy_info; -} ESS_SIGNING_CERT; - -TS_REQ *TS_REQ_new(void); -void TS_REQ_free(TS_REQ *a); -int i2d_TS_REQ(const TS_REQ *a, unsigned char **pp); -TS_REQ *d2i_TS_REQ(TS_REQ **a, const unsigned char **pp, long length); - -TS_REQ *TS_REQ_dup(TS_REQ *a); - -TS_REQ *d2i_TS_REQ_fp(FILE *fp, TS_REQ **a); -int i2d_TS_REQ_fp(FILE *fp, TS_REQ *a); -TS_REQ *d2i_TS_REQ_bio(BIO *fp, TS_REQ **a); -int i2d_TS_REQ_bio(BIO *fp, TS_REQ *a); - -TS_MSG_IMPRINT *TS_MSG_IMPRINT_new(void); -void TS_MSG_IMPRINT_free(TS_MSG_IMPRINT *a); -int i2d_TS_MSG_IMPRINT(const TS_MSG_IMPRINT *a, unsigned char **pp); -TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT(TS_MSG_IMPRINT **a, - const unsigned char **pp, long length); - -TS_MSG_IMPRINT *TS_MSG_IMPRINT_dup(TS_MSG_IMPRINT *a); - -TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT **a); -int i2d_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT *a); -TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT **a); -int i2d_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT *a); - -TS_RESP *TS_RESP_new(void); -void TS_RESP_free(TS_RESP *a); -int i2d_TS_RESP(const TS_RESP *a, unsigned char **pp); -TS_RESP *d2i_TS_RESP(TS_RESP **a, const unsigned char **pp, long length); -TS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token); -TS_RESP *TS_RESP_dup(TS_RESP *a); - -TS_RESP *d2i_TS_RESP_fp(FILE *fp, TS_RESP **a); -int i2d_TS_RESP_fp(FILE *fp, TS_RESP *a); -TS_RESP *d2i_TS_RESP_bio(BIO *fp, TS_RESP **a); -int i2d_TS_RESP_bio(BIO *fp, TS_RESP *a); - -TS_STATUS_INFO *TS_STATUS_INFO_new(void); -void TS_STATUS_INFO_free(TS_STATUS_INFO *a); -int i2d_TS_STATUS_INFO(const TS_STATUS_INFO *a, unsigned char **pp); -TS_STATUS_INFO *d2i_TS_STATUS_INFO(TS_STATUS_INFO **a, - const unsigned char **pp, long length); -TS_STATUS_INFO *TS_STATUS_INFO_dup(TS_STATUS_INFO *a); - -TS_TST_INFO *TS_TST_INFO_new(void); -void TS_TST_INFO_free(TS_TST_INFO *a); -int i2d_TS_TST_INFO(const TS_TST_INFO *a, unsigned char **pp); -TS_TST_INFO *d2i_TS_TST_INFO(TS_TST_INFO **a, const unsigned char **pp, - long length); -TS_TST_INFO *TS_TST_INFO_dup(TS_TST_INFO *a); - -TS_TST_INFO *d2i_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO **a); -int i2d_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO *a); -TS_TST_INFO *d2i_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO **a); -int i2d_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO *a); - -TS_ACCURACY *TS_ACCURACY_new(void); -void TS_ACCURACY_free(TS_ACCURACY *a); -int i2d_TS_ACCURACY(const TS_ACCURACY *a, unsigned char **pp); -TS_ACCURACY *d2i_TS_ACCURACY(TS_ACCURACY **a, const unsigned char **pp, - long length); -TS_ACCURACY *TS_ACCURACY_dup(TS_ACCURACY *a); - -ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_new(void); -void ESS_ISSUER_SERIAL_free(ESS_ISSUER_SERIAL *a); -int i2d_ESS_ISSUER_SERIAL(const ESS_ISSUER_SERIAL *a, unsigned char **pp); -ESS_ISSUER_SERIAL *d2i_ESS_ISSUER_SERIAL(ESS_ISSUER_SERIAL **a, - const unsigned char **pp, - long length); -ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_dup(ESS_ISSUER_SERIAL *a); - -ESS_CERT_ID *ESS_CERT_ID_new(void); -void ESS_CERT_ID_free(ESS_CERT_ID *a); -int i2d_ESS_CERT_ID(const ESS_CERT_ID *a, unsigned char **pp); -ESS_CERT_ID *d2i_ESS_CERT_ID(ESS_CERT_ID **a, const unsigned char **pp, - long length); -ESS_CERT_ID *ESS_CERT_ID_dup(ESS_CERT_ID *a); - -ESS_SIGNING_CERT *ESS_SIGNING_CERT_new(void); -void ESS_SIGNING_CERT_free(ESS_SIGNING_CERT *a); -int i2d_ESS_SIGNING_CERT(const ESS_SIGNING_CERT *a, unsigned char **pp); -ESS_SIGNING_CERT *d2i_ESS_SIGNING_CERT(ESS_SIGNING_CERT **a, - const unsigned char **pp, long length); -ESS_SIGNING_CERT *ESS_SIGNING_CERT_dup(ESS_SIGNING_CERT *a); - -void ERR_load_TS_strings(void); - -int TS_REQ_set_version(TS_REQ *a, long version); -long TS_REQ_get_version(const TS_REQ *a); - -int TS_REQ_set_msg_imprint(TS_REQ *a, TS_MSG_IMPRINT *msg_imprint); -TS_MSG_IMPRINT *TS_REQ_get_msg_imprint(TS_REQ *a); - -int TS_MSG_IMPRINT_set_algo(TS_MSG_IMPRINT *a, X509_ALGOR *alg); -X509_ALGOR *TS_MSG_IMPRINT_get_algo(TS_MSG_IMPRINT *a); - -int TS_MSG_IMPRINT_set_msg(TS_MSG_IMPRINT *a, unsigned char *d, int len); -ASN1_OCTET_STRING *TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a); - -int TS_REQ_set_policy_id(TS_REQ *a, ASN1_OBJECT *policy); -ASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a); - -int TS_REQ_set_nonce(TS_REQ *a, const ASN1_INTEGER *nonce); -const ASN1_INTEGER *TS_REQ_get_nonce(const TS_REQ *a); - -int TS_REQ_set_cert_req(TS_REQ *a, int cert_req); -int TS_REQ_get_cert_req(const TS_REQ *a); - -STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a); -void TS_REQ_ext_free(TS_REQ *a); -int TS_REQ_get_ext_count(TS_REQ *a); -int TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos); -int TS_REQ_get_ext_by_OBJ(TS_REQ *a, ASN1_OBJECT *obj, int lastpos); -int TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos); -X509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc); -X509_EXTENSION *TS_REQ_delete_ext(TS_REQ *a, int loc); -int TS_REQ_add_ext(TS_REQ *a, X509_EXTENSION *ex, int loc); -void *TS_REQ_get_ext_d2i(TS_REQ *a, int nid, int *crit, int *idx); - -/* Function declarations for TS_REQ defined in ts/ts_req_print.c */ - -int TS_REQ_print_bio(BIO *bio, TS_REQ *a); - -/* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */ - -int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *info); -TS_STATUS_INFO *TS_RESP_get_status_info(TS_RESP *a); - -/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */ -void TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info); -PKCS7 *TS_RESP_get_token(TS_RESP *a); -TS_TST_INFO *TS_RESP_get_tst_info(TS_RESP *a); - -int TS_TST_INFO_set_version(TS_TST_INFO *a, long version); -long TS_TST_INFO_get_version(const TS_TST_INFO *a); - -int TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy_id); -ASN1_OBJECT *TS_TST_INFO_get_policy_id(TS_TST_INFO *a); - -int TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint); -TS_MSG_IMPRINT *TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a); - -int TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial); -const ASN1_INTEGER *TS_TST_INFO_get_serial(const TS_TST_INFO *a); - -int TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime); -const ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(const TS_TST_INFO *a); - -int TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy); -TS_ACCURACY *TS_TST_INFO_get_accuracy(TS_TST_INFO *a); - -int TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds); -const ASN1_INTEGER *TS_ACCURACY_get_seconds(const TS_ACCURACY *a); - -int TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis); -const ASN1_INTEGER *TS_ACCURACY_get_millis(const TS_ACCURACY *a); - -int TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros); -const ASN1_INTEGER *TS_ACCURACY_get_micros(const TS_ACCURACY *a); - -int TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering); -int TS_TST_INFO_get_ordering(const TS_TST_INFO *a); - -int TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce); -const ASN1_INTEGER *TS_TST_INFO_get_nonce(const TS_TST_INFO *a); - -int TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa); -GENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a); - -STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a); -void TS_TST_INFO_ext_free(TS_TST_INFO *a); -int TS_TST_INFO_get_ext_count(TS_TST_INFO *a); -int TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos); -int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, ASN1_OBJECT *obj, int lastpos); -int TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos); -X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc); -X509_EXTENSION *TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc); -int TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc); -void *TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx); - -/* - * Declarations related to response generation, defined in ts/ts_resp_sign.c. - */ - -/* Optional flags for response generation. */ - -/* Don't include the TSA name in response. */ -# define TS_TSA_NAME 0x01 - -/* Set ordering to true in response. */ -# define TS_ORDERING 0x02 - -/* - * Include the signer certificate and the other specified certificates in - * the ESS signing certificate attribute beside the PKCS7 signed data. - * Only the signer certificates is included by default. - */ -# define TS_ESS_CERT_ID_CHAIN 0x04 - -/* Forward declaration. */ -struct TS_resp_ctx; - -/* This must return a unique number less than 160 bits long. */ -typedef ASN1_INTEGER *(*TS_serial_cb) (struct TS_resp_ctx *, void *); - -/* - * This must return the seconds and microseconds since Jan 1, 1970 in the sec - * and usec variables allocated by the caller. Return non-zero for success - * and zero for failure. - */ -typedef int (*TS_time_cb) (struct TS_resp_ctx *, void *, long *sec, - long *usec); - -/* - * This must process the given extension. It can modify the TS_TST_INFO - * object of the context. Return values: !0 (processed), 0 (error, it must - * set the status info/failure info of the response). - */ -typedef int (*TS_extension_cb) (struct TS_resp_ctx *, X509_EXTENSION *, - void *); - -typedef struct TS_resp_ctx { - X509 *signer_cert; - EVP_PKEY *signer_key; - STACK_OF(X509) *certs; /* Certs to include in signed data. */ - STACK_OF(ASN1_OBJECT) *policies; /* Acceptable policies. */ - ASN1_OBJECT *default_policy; /* It may appear in policies, too. */ - STACK_OF(EVP_MD) *mds; /* Acceptable message digests. */ - ASN1_INTEGER *seconds; /* accuracy, 0 means not specified. */ - ASN1_INTEGER *millis; /* accuracy, 0 means not specified. */ - ASN1_INTEGER *micros; /* accuracy, 0 means not specified. */ - unsigned clock_precision_digits; /* fraction of seconds in time stamp - * token. */ - unsigned flags; /* Optional info, see values above. */ - /* Callback functions. */ - TS_serial_cb serial_cb; - void *serial_cb_data; /* User data for serial_cb. */ - TS_time_cb time_cb; - void *time_cb_data; /* User data for time_cb. */ - TS_extension_cb extension_cb; - void *extension_cb_data; /* User data for extension_cb. */ - /* These members are used only while creating the response. */ - TS_REQ *request; - TS_RESP *response; - TS_TST_INFO *tst_info; -} TS_RESP_CTX; - -DECLARE_STACK_OF(EVP_MD) -DECLARE_ASN1_SET_OF(EVP_MD) - -/* Creates a response context that can be used for generating responses. */ -TS_RESP_CTX *TS_RESP_CTX_new(void); -void TS_RESP_CTX_free(TS_RESP_CTX *ctx); - -/* This parameter must be set. */ -int TS_RESP_CTX_set_signer_cert(TS_RESP_CTX *ctx, X509 *signer); - -/* This parameter must be set. */ -int TS_RESP_CTX_set_signer_key(TS_RESP_CTX *ctx, EVP_PKEY *key); - -/* This parameter must be set. */ -int TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *def_policy); - -/* No additional certs are included in the response by default. */ -int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs); - -/* - * Adds a new acceptable policy, only the default policy is accepted by - * default. - */ -int TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *policy); - -/* - * Adds a new acceptable message digest. Note that no message digests are - * accepted by default. The md argument is shared with the caller. - */ -int TS_RESP_CTX_add_md(TS_RESP_CTX *ctx, const EVP_MD *md); - -/* Accuracy is not included by default. */ -int TS_RESP_CTX_set_accuracy(TS_RESP_CTX *ctx, - int secs, int millis, int micros); - -/* - * Clock precision digits, i.e. the number of decimal digits: '0' means sec, - * '3' msec, '6' usec, and so on. Default is 0. - */ -int TS_RESP_CTX_set_clock_precision_digits(TS_RESP_CTX *ctx, - unsigned clock_precision_digits); -/* At most we accept usec precision. */ -# define TS_MAX_CLOCK_PRECISION_DIGITS 6 - -/* Maximum status message length */ -# define TS_MAX_STATUS_LENGTH (1024 * 1024) - -/* No flags are set by default. */ -void TS_RESP_CTX_add_flags(TS_RESP_CTX *ctx, int flags); - -/* Default callback always returns a constant. */ -void TS_RESP_CTX_set_serial_cb(TS_RESP_CTX *ctx, TS_serial_cb cb, void *data); - -/* Default callback uses the gettimeofday() and gmtime() system calls. */ -void TS_RESP_CTX_set_time_cb(TS_RESP_CTX *ctx, TS_time_cb cb, void *data); - -/* - * Default callback rejects all extensions. The extension callback is called - * when the TS_TST_INFO object is already set up and not signed yet. - */ -/* FIXME: extension handling is not tested yet. */ -void TS_RESP_CTX_set_extension_cb(TS_RESP_CTX *ctx, - TS_extension_cb cb, void *data); - -/* The following methods can be used in the callbacks. */ -int TS_RESP_CTX_set_status_info(TS_RESP_CTX *ctx, - int status, const char *text); - -/* Sets the status info only if it is still TS_STATUS_GRANTED. */ -int TS_RESP_CTX_set_status_info_cond(TS_RESP_CTX *ctx, - int status, const char *text); - -int TS_RESP_CTX_add_failure_info(TS_RESP_CTX *ctx, int failure); - -/* The get methods below can be used in the extension callback. */ -TS_REQ *TS_RESP_CTX_get_request(TS_RESP_CTX *ctx); - -TS_TST_INFO *TS_RESP_CTX_get_tst_info(TS_RESP_CTX *ctx); - -/* - * Creates the signed TS_TST_INFO and puts it in TS_RESP. - * In case of errors it sets the status info properly. - * Returns NULL only in case of memory allocation/fatal error. - */ -TS_RESP *TS_RESP_create_response(TS_RESP_CTX *ctx, BIO *req_bio); - -/* - * Declarations related to response verification, - * they are defined in ts/ts_resp_verify.c. - */ - -int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs, - X509_STORE *store, X509 **signer_out); - -/* Context structure for the generic verify method. */ - -/* Verify the signer's certificate and the signature of the response. */ -# define TS_VFY_SIGNATURE (1u << 0) -/* Verify the version number of the response. */ -# define TS_VFY_VERSION (1u << 1) -/* Verify if the policy supplied by the user matches the policy of the TSA. */ -# define TS_VFY_POLICY (1u << 2) -/* - * Verify the message imprint provided by the user. This flag should not be - * specified with TS_VFY_DATA. - */ -# define TS_VFY_IMPRINT (1u << 3) -/* - * Verify the message imprint computed by the verify method from the user - * provided data and the MD algorithm of the response. This flag should not - * be specified with TS_VFY_IMPRINT. - */ -# define TS_VFY_DATA (1u << 4) -/* Verify the nonce value. */ -# define TS_VFY_NONCE (1u << 5) -/* Verify if the TSA name field matches the signer certificate. */ -# define TS_VFY_SIGNER (1u << 6) -/* Verify if the TSA name field equals to the user provided name. */ -# define TS_VFY_TSA_NAME (1u << 7) - -/* You can use the following convenience constants. */ -# define TS_VFY_ALL_IMPRINT (TS_VFY_SIGNATURE \ - | TS_VFY_VERSION \ - | TS_VFY_POLICY \ - | TS_VFY_IMPRINT \ - | TS_VFY_NONCE \ - | TS_VFY_SIGNER \ - | TS_VFY_TSA_NAME) -# define TS_VFY_ALL_DATA (TS_VFY_SIGNATURE \ - | TS_VFY_VERSION \ - | TS_VFY_POLICY \ - | TS_VFY_DATA \ - | TS_VFY_NONCE \ - | TS_VFY_SIGNER \ - | TS_VFY_TSA_NAME) - -typedef struct TS_verify_ctx { - /* Set this to the union of TS_VFY_... flags you want to carry out. */ - unsigned flags; - /* Must be set only with TS_VFY_SIGNATURE. certs is optional. */ - X509_STORE *store; - STACK_OF(X509) *certs; - /* Must be set only with TS_VFY_POLICY. */ - ASN1_OBJECT *policy; - /* - * Must be set only with TS_VFY_IMPRINT. If md_alg is NULL, the - * algorithm from the response is used. - */ - X509_ALGOR *md_alg; - unsigned char *imprint; - unsigned imprint_len; - /* Must be set only with TS_VFY_DATA. */ - BIO *data; - /* Must be set only with TS_VFY_TSA_NAME. */ - ASN1_INTEGER *nonce; - /* Must be set only with TS_VFY_TSA_NAME. */ - GENERAL_NAME *tsa_name; -} TS_VERIFY_CTX; - -int TS_RESP_verify_response(TS_VERIFY_CTX *ctx, TS_RESP *response); -int TS_RESP_verify_token(TS_VERIFY_CTX *ctx, PKCS7 *token); - -/* - * Declarations related to response verification context, - * they are defined in ts/ts_verify_ctx.c. - */ - -/* Set all fields to zero. */ -TS_VERIFY_CTX *TS_VERIFY_CTX_new(void); -void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx); -void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx); -void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx); - -/*- - * If ctx is NULL, it allocates and returns a new object, otherwise - * it returns ctx. It initialises all the members as follows: - * flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE) - * certs = NULL - * store = NULL - * policy = policy from the request or NULL if absent (in this case - * TS_VFY_POLICY is cleared from flags as well) - * md_alg = MD algorithm from request - * imprint, imprint_len = imprint from request - * data = NULL - * nonce, nonce_len = nonce from the request or NULL if absent (in this case - * TS_VFY_NONCE is cleared from flags as well) - * tsa_name = NULL - * Important: after calling this method TS_VFY_SIGNATURE should be added! - */ -TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx); - -/* Function declarations for TS_RESP defined in ts/ts_resp_print.c */ - -int TS_RESP_print_bio(BIO *bio, TS_RESP *a); -int TS_STATUS_INFO_print_bio(BIO *bio, TS_STATUS_INFO *a); -int TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a); - -/* Common utility functions defined in ts/ts_lib.c */ - -int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num); -int TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj); -int TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions); -int TS_X509_ALGOR_print_bio(BIO *bio, const X509_ALGOR *alg); -int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *msg); - -/* - * Function declarations for handling configuration options, defined in - * ts/ts_conf.c - */ - -X509 *TS_CONF_load_cert(const char *file); -STACK_OF(X509) *TS_CONF_load_certs(const char *file); -EVP_PKEY *TS_CONF_load_key(const char *file, const char *pass); -const char *TS_CONF_get_tsa_section(CONF *conf, const char *section); -int TS_CONF_set_serial(CONF *conf, const char *section, TS_serial_cb cb, - TS_RESP_CTX *ctx); -int TS_CONF_set_crypto_device(CONF *conf, const char *section, - const char *device); -int TS_CONF_set_default_engine(const char *name); -int TS_CONF_set_signer_cert(CONF *conf, const char *section, - const char *cert, TS_RESP_CTX *ctx); -int TS_CONF_set_certs(CONF *conf, const char *section, const char *certs, - TS_RESP_CTX *ctx); -int TS_CONF_set_signer_key(CONF *conf, const char *section, - const char *key, const char *pass, - TS_RESP_CTX *ctx); -int TS_CONF_set_def_policy(CONF *conf, const char *section, - const char *policy, TS_RESP_CTX *ctx); -int TS_CONF_set_policies(CONF *conf, const char *section, TS_RESP_CTX *ctx); -int TS_CONF_set_digests(CONF *conf, const char *section, TS_RESP_CTX *ctx); -int TS_CONF_set_accuracy(CONF *conf, const char *section, TS_RESP_CTX *ctx); -int TS_CONF_set_clock_precision_digits(CONF *conf, const char *section, - TS_RESP_CTX *ctx); -int TS_CONF_set_ordering(CONF *conf, const char *section, TS_RESP_CTX *ctx); -int TS_CONF_set_tsa_name(CONF *conf, const char *section, TS_RESP_CTX *ctx); -int TS_CONF_set_ess_cert_id_chain(CONF *conf, const char *section, - TS_RESP_CTX *ctx); - -/* -------------------------------------------------- */ -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_TS_strings(void); - -/* Error codes for the TS functions. */ - -/* Function codes. */ -# define TS_F_D2I_TS_RESP 147 -# define TS_F_DEF_SERIAL_CB 110 -# define TS_F_DEF_TIME_CB 111 -# define TS_F_ESS_ADD_SIGNING_CERT 112 -# define TS_F_ESS_CERT_ID_NEW_INIT 113 -# define TS_F_ESS_SIGNING_CERT_NEW_INIT 114 -# define TS_F_INT_TS_RESP_VERIFY_TOKEN 149 -# define TS_F_PKCS7_TO_TS_TST_INFO 148 -# define TS_F_TS_ACCURACY_SET_MICROS 115 -# define TS_F_TS_ACCURACY_SET_MILLIS 116 -# define TS_F_TS_ACCURACY_SET_SECONDS 117 -# define TS_F_TS_CHECK_IMPRINTS 100 -# define TS_F_TS_CHECK_NONCES 101 -# define TS_F_TS_CHECK_POLICY 102 -# define TS_F_TS_CHECK_SIGNING_CERTS 103 -# define TS_F_TS_CHECK_STATUS_INFO 104 -# define TS_F_TS_COMPUTE_IMPRINT 145 -# define TS_F_TS_CONF_SET_DEFAULT_ENGINE 146 -# define TS_F_TS_GET_STATUS_TEXT 105 -# define TS_F_TS_MSG_IMPRINT_SET_ALGO 118 -# define TS_F_TS_REQ_SET_MSG_IMPRINT 119 -# define TS_F_TS_REQ_SET_NONCE 120 -# define TS_F_TS_REQ_SET_POLICY_ID 121 -# define TS_F_TS_RESP_CREATE_RESPONSE 122 -# define TS_F_TS_RESP_CREATE_TST_INFO 123 -# define TS_F_TS_RESP_CTX_ADD_FAILURE_INFO 124 -# define TS_F_TS_RESP_CTX_ADD_MD 125 -# define TS_F_TS_RESP_CTX_ADD_POLICY 126 -# define TS_F_TS_RESP_CTX_NEW 127 -# define TS_F_TS_RESP_CTX_SET_ACCURACY 128 -# define TS_F_TS_RESP_CTX_SET_CERTS 129 -# define TS_F_TS_RESP_CTX_SET_DEF_POLICY 130 -# define TS_F_TS_RESP_CTX_SET_SIGNER_CERT 131 -# define TS_F_TS_RESP_CTX_SET_STATUS_INFO 132 -# define TS_F_TS_RESP_GET_POLICY 133 -# define TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION 134 -# define TS_F_TS_RESP_SET_STATUS_INFO 135 -# define TS_F_TS_RESP_SET_TST_INFO 150 -# define TS_F_TS_RESP_SIGN 136 -# define TS_F_TS_RESP_VERIFY_SIGNATURE 106 -# define TS_F_TS_RESP_VERIFY_TOKEN 107 -# define TS_F_TS_TST_INFO_SET_ACCURACY 137 -# define TS_F_TS_TST_INFO_SET_MSG_IMPRINT 138 -# define TS_F_TS_TST_INFO_SET_NONCE 139 -# define TS_F_TS_TST_INFO_SET_POLICY_ID 140 -# define TS_F_TS_TST_INFO_SET_SERIAL 141 -# define TS_F_TS_TST_INFO_SET_TIME 142 -# define TS_F_TS_TST_INFO_SET_TSA 143 -# define TS_F_TS_VERIFY 108 -# define TS_F_TS_VERIFY_CERT 109 -# define TS_F_TS_VERIFY_CTX_NEW 144 - -/* Reason codes. */ -# define TS_R_BAD_PKCS7_TYPE 132 -# define TS_R_BAD_TYPE 133 -# define TS_R_CERTIFICATE_VERIFY_ERROR 100 -# define TS_R_COULD_NOT_SET_ENGINE 127 -# define TS_R_COULD_NOT_SET_TIME 115 -# define TS_R_D2I_TS_RESP_INT_FAILED 128 -# define TS_R_DETACHED_CONTENT 134 -# define TS_R_ESS_ADD_SIGNING_CERT_ERROR 116 -# define TS_R_ESS_SIGNING_CERTIFICATE_ERROR 101 -# define TS_R_INVALID_NULL_POINTER 102 -# define TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE 117 -# define TS_R_MESSAGE_IMPRINT_MISMATCH 103 -# define TS_R_NONCE_MISMATCH 104 -# define TS_R_NONCE_NOT_RETURNED 105 -# define TS_R_NO_CONTENT 106 -# define TS_R_NO_TIME_STAMP_TOKEN 107 -# define TS_R_PKCS7_ADD_SIGNATURE_ERROR 118 -# define TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR 119 -# define TS_R_PKCS7_TO_TS_TST_INFO_FAILED 129 -# define TS_R_POLICY_MISMATCH 108 -# define TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 120 -# define TS_R_RESPONSE_SETUP_ERROR 121 -# define TS_R_SIGNATURE_FAILURE 109 -# define TS_R_THERE_MUST_BE_ONE_SIGNER 110 -# define TS_R_TIME_SYSCALL_ERROR 122 -# define TS_R_TOKEN_NOT_PRESENT 130 -# define TS_R_TOKEN_PRESENT 131 -# define TS_R_TSA_NAME_MISMATCH 111 -# define TS_R_TSA_UNTRUSTED 112 -# define TS_R_TST_INFO_SETUP_ERROR 123 -# define TS_R_TS_DATASIGN 124 -# define TS_R_UNACCEPTABLE_POLICY 125 -# define TS_R_UNSUPPORTED_MD_ALGORITHM 126 -# define TS_R_UNSUPPORTED_VERSION 113 -# define TS_R_WRONG_CONTENT_TYPE 114 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/txt_db.h b/libs/win32/openssl/include/openssl/txt_db.h deleted file mode 100644 index 98e23a2003..0000000000 --- a/libs/win32/openssl/include/openssl/txt_db.h +++ /dev/null @@ -1,112 +0,0 @@ -/* crypto/txt_db/txt_db.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_TXT_DB_H -# define HEADER_TXT_DB_H - -# include -# ifndef OPENSSL_NO_BIO -# include -# endif -# include -# include - -# define DB_ERROR_OK 0 -# define DB_ERROR_MALLOC 1 -# define DB_ERROR_INDEX_CLASH 2 -# define DB_ERROR_INDEX_OUT_OF_RANGE 3 -# define DB_ERROR_NO_INDEX 4 -# define DB_ERROR_INSERT_INDEX_CLASH 5 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef OPENSSL_STRING *OPENSSL_PSTRING; -DECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) - -typedef struct txt_db_st { - int num_fields; - STACK_OF(OPENSSL_PSTRING) *data; - LHASH_OF(OPENSSL_STRING) **index; - int (**qual) (OPENSSL_STRING *); - long error; - long arg1; - long arg2; - OPENSSL_STRING *arg_row; -} TXT_DB; - -# ifndef OPENSSL_NO_BIO -TXT_DB *TXT_DB_read(BIO *in, int num); -long TXT_DB_write(BIO *out, TXT_DB *db); -# else -TXT_DB *TXT_DB_read(char *in, int num); -long TXT_DB_write(char *out, TXT_DB *db); -# endif -int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *), - LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp); -void TXT_DB_free(TXT_DB *db); -OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, - OPENSSL_STRING *value); -int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/ui.h b/libs/win32/openssl/include/openssl/ui.h deleted file mode 100644 index 0dc16330b8..0000000000 --- a/libs/win32/openssl/include/openssl/ui.h +++ /dev/null @@ -1,415 +0,0 @@ -/* crypto/ui/ui.h */ -/* - * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project - * 2001. - */ -/* ==================================================================== - * Copyright (c) 2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_UI_H -# define HEADER_UI_H - -# ifndef OPENSSL_NO_DEPRECATED -# include -# endif -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Declared already in ossl_typ.h */ -/* typedef struct ui_st UI; */ -/* typedef struct ui_method_st UI_METHOD; */ - -/* - * All the following functions return -1 or NULL on error and in some cases - * (UI_process()) -2 if interrupted or in some other way cancelled. When - * everything is fine, they return 0, a positive value or a non-NULL pointer, - * all depending on their purpose. - */ - -/* Creators and destructor. */ -UI *UI_new(void); -UI *UI_new_method(const UI_METHOD *method); -void UI_free(UI *ui); - -/*- - The following functions are used to add strings to be printed and prompt - strings to prompt for data. The names are UI_{add,dup}__string - and UI_{add,dup}_input_boolean. - - UI_{add,dup}__string have the following meanings: - add add a text or prompt string. The pointers given to these - functions are used verbatim, no copying is done. - dup make a copy of the text or prompt string, then add the copy - to the collection of strings in the user interface. - - The function is a name for the functionality that the given - string shall be used for. It can be one of: - input use the string as data prompt. - verify use the string as verification prompt. This - is used to verify a previous input. - info use the string for informational output. - error use the string for error output. - Honestly, there's currently no difference between info and error for the - moment. - - UI_{add,dup}_input_boolean have the same semantics for "add" and "dup", - and are typically used when one wants to prompt for a yes/no response. - - All of the functions in this group take a UI and a prompt string. - The string input and verify addition functions also take a flag argument, - a buffer for the result to end up with, a minimum input size and a maximum - input size (the result buffer MUST be large enough to be able to contain - the maximum number of characters). Additionally, the verify addition - functions takes another buffer to compare the result against. - The boolean input functions take an action description string (which should - be safe to ignore if the expected user action is obvious, for example with - a dialog box with an OK button and a Cancel button), a string of acceptable - characters to mean OK and to mean Cancel. The two last strings are checked - to make sure they don't have common characters. Additionally, the same - flag argument as for the string input is taken, as well as a result buffer. - The result buffer is required to be at least one byte long. Depending on - the answer, the first character from the OK or the Cancel character strings - will be stored in the first byte of the result buffer. No NUL will be - added, so the result is *not* a string. - - On success, the all return an index of the added information. That index - is usefull when retrieving results with UI_get0_result(). */ -int UI_add_input_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize); -int UI_dup_input_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize); -int UI_add_verify_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize, - const char *test_buf); -int UI_dup_verify_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize, - const char *test_buf); -int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, - const char *ok_chars, const char *cancel_chars, - int flags, char *result_buf); -int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, - const char *ok_chars, const char *cancel_chars, - int flags, char *result_buf); -int UI_add_info_string(UI *ui, const char *text); -int UI_dup_info_string(UI *ui, const char *text); -int UI_add_error_string(UI *ui, const char *text); -int UI_dup_error_string(UI *ui, const char *text); - -/* These are the possible flags. They can be or'ed together. */ -/* Use to have echoing of input */ -# define UI_INPUT_FLAG_ECHO 0x01 -/* - * Use a default password. Where that password is found is completely up to - * the application, it might for example be in the user data set with - * UI_add_user_data(). It is not recommended to have more than one input in - * each UI being marked with this flag, or the application might get - * confused. - */ -# define UI_INPUT_FLAG_DEFAULT_PWD 0x02 - -/*- - * The user of these routines may want to define flags of their own. The core - * UI won't look at those, but will pass them on to the method routines. They - * must use higher bits so they don't get confused with the UI bits above. - * UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use. A good - * example of use is this: - * - * #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE) - * -*/ -# define UI_INPUT_FLAG_USER_BASE 16 - -/*- - * The following function helps construct a prompt. object_desc is a - * textual short description of the object, for example "pass phrase", - * and object_name is the name of the object (might be a card name or - * a file name. - * The returned string shall always be allocated on the heap with - * OPENSSL_malloc(), and need to be free'd with OPENSSL_free(). - * - * If the ui_method doesn't contain a pointer to a user-defined prompt - * constructor, a default string is built, looking like this: - * - * "Enter {object_desc} for {object_name}:" - * - * So, if object_desc has the value "pass phrase" and object_name has - * the value "foo.key", the resulting string is: - * - * "Enter pass phrase for foo.key:" -*/ -char *UI_construct_prompt(UI *ui_method, - const char *object_desc, const char *object_name); - -/* - * The following function is used to store a pointer to user-specific data. - * Any previous such pointer will be returned and replaced. - * - * For callback purposes, this function makes a lot more sense than using - * ex_data, since the latter requires that different parts of OpenSSL or - * applications share the same ex_data index. - * - * Note that the UI_OpenSSL() method completely ignores the user data. Other - * methods may not, however. - */ -void *UI_add_user_data(UI *ui, void *user_data); -/* We need a user data retrieving function as well. */ -void *UI_get0_user_data(UI *ui); - -/* Return the result associated with a prompt given with the index i. */ -const char *UI_get0_result(UI *ui, int i); - -/* When all strings have been added, process the whole thing. */ -int UI_process(UI *ui); - -/* - * Give a user interface parametrised control commands. This can be used to - * send down an integer, a data pointer or a function pointer, as well as be - * used to get information from a UI. - */ -int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f) (void)); - -/* The commands */ -/* - * Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the - * OpenSSL error stack before printing any info or added error messages and - * before any prompting. - */ -# define UI_CTRL_PRINT_ERRORS 1 -/* - * Check if a UI_process() is possible to do again with the same instance of - * a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0 - * if not. - */ -# define UI_CTRL_IS_REDOABLE 2 - -/* Some methods may use extra data */ -# define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg) -# define UI_get_app_data(s) UI_get_ex_data(s,0) -int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int UI_set_ex_data(UI *r, int idx, void *arg); -void *UI_get_ex_data(UI *r, int idx); - -/* Use specific methods instead of the built-in one */ -void UI_set_default_method(const UI_METHOD *meth); -const UI_METHOD *UI_get_default_method(void); -const UI_METHOD *UI_get_method(UI *ui); -const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth); - -/* The method with all the built-in thingies */ -UI_METHOD *UI_OpenSSL(void); - -/* ---------- For method writers ---------- */ -/*- - A method contains a number of functions that implement the low level - of the User Interface. The functions are: - - an opener This function starts a session, maybe by opening - a channel to a tty, or by opening a window. - a writer This function is called to write a given string, - maybe to the tty, maybe as a field label in a - window. - a flusher This function is called to flush everything that - has been output so far. It can be used to actually - display a dialog box after it has been built. - a reader This function is called to read a given prompt, - maybe from the tty, maybe from a field in a - window. Note that it's called wth all string - structures, not only the prompt ones, so it must - check such things itself. - a closer This function closes the session, maybe by closing - the channel to the tty, or closing the window. - - All these functions are expected to return: - - 0 on error. - 1 on success. - -1 on out-of-band events, for example if some prompting has - been canceled (by pressing Ctrl-C, for example). This is - only checked when returned by the flusher or the reader. - - The way this is used, the opener is first called, then the writer for all - strings, then the flusher, then the reader for all strings and finally the - closer. Note that if you want to prompt from a terminal or other command - line interface, the best is to have the reader also write the prompts - instead of having the writer do it. If you want to prompt from a dialog - box, the writer can be used to build up the contents of the box, and the - flusher to actually display the box and run the event loop until all data - has been given, after which the reader only grabs the given data and puts - them back into the UI strings. - - All method functions take a UI as argument. Additionally, the writer and - the reader take a UI_STRING. -*/ - -/* - * The UI_STRING type is the data structure that contains all the needed info - * about a string or a prompt, including test data for a verification prompt. - */ -typedef struct ui_string_st UI_STRING; -DECLARE_STACK_OF(UI_STRING) - -/* - * The different types of strings that are currently supported. This is only - * needed by method authors. - */ -enum UI_string_types { - UIT_NONE = 0, - UIT_PROMPT, /* Prompt for a string */ - UIT_VERIFY, /* Prompt for a string and verify */ - UIT_BOOLEAN, /* Prompt for a yes/no response */ - UIT_INFO, /* Send info to the user */ - UIT_ERROR /* Send an error message to the user */ -}; - -/* Create and manipulate methods */ -UI_METHOD *UI_create_method(char *name); -void UI_destroy_method(UI_METHOD *ui_method); -int UI_method_set_opener(UI_METHOD *method, int (*opener) (UI *ui)); -int UI_method_set_writer(UI_METHOD *method, - int (*writer) (UI *ui, UI_STRING *uis)); -int UI_method_set_flusher(UI_METHOD *method, int (*flusher) (UI *ui)); -int UI_method_set_reader(UI_METHOD *method, - int (*reader) (UI *ui, UI_STRING *uis)); -int UI_method_set_closer(UI_METHOD *method, int (*closer) (UI *ui)); -int UI_method_set_prompt_constructor(UI_METHOD *method, - char *(*prompt_constructor) (UI *ui, - const char - *object_desc, - const char - *object_name)); -int (*UI_method_get_opener(UI_METHOD *method)) (UI *); -int (*UI_method_get_writer(UI_METHOD *method)) (UI *, UI_STRING *); -int (*UI_method_get_flusher(UI_METHOD *method)) (UI *); -int (*UI_method_get_reader(UI_METHOD *method)) (UI *, UI_STRING *); -int (*UI_method_get_closer(UI_METHOD *method)) (UI *); -char *(*UI_method_get_prompt_constructor(UI_METHOD *method)) (UI *, - const char *, - const char *); - -/* - * The following functions are helpers for method writers to access relevant - * data from a UI_STRING. - */ - -/* Return type of the UI_STRING */ -enum UI_string_types UI_get_string_type(UI_STRING *uis); -/* Return input flags of the UI_STRING */ -int UI_get_input_flags(UI_STRING *uis); -/* Return the actual string to output (the prompt, info or error) */ -const char *UI_get0_output_string(UI_STRING *uis); -/* - * Return the optional action string to output (the boolean promtp - * instruction) - */ -const char *UI_get0_action_string(UI_STRING *uis); -/* Return the result of a prompt */ -const char *UI_get0_result_string(UI_STRING *uis); -/* - * Return the string to test the result against. Only useful with verifies. - */ -const char *UI_get0_test_string(UI_STRING *uis); -/* Return the required minimum size of the result */ -int UI_get_result_minsize(UI_STRING *uis); -/* Return the required maximum size of the result */ -int UI_get_result_maxsize(UI_STRING *uis); -/* Set the result of a UI_STRING. */ -int UI_set_result(UI *ui, UI_STRING *uis, const char *result); - -/* A couple of popular utility functions */ -int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt, - int verify); -int UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt, - int verify); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_UI_strings(void); - -/* Error codes for the UI functions. */ - -/* Function codes. */ -# define UI_F_GENERAL_ALLOCATE_BOOLEAN 108 -# define UI_F_GENERAL_ALLOCATE_PROMPT 109 -# define UI_F_GENERAL_ALLOCATE_STRING 100 -# define UI_F_UI_CTRL 111 -# define UI_F_UI_DUP_ERROR_STRING 101 -# define UI_F_UI_DUP_INFO_STRING 102 -# define UI_F_UI_DUP_INPUT_BOOLEAN 110 -# define UI_F_UI_DUP_INPUT_STRING 103 -# define UI_F_UI_DUP_VERIFY_STRING 106 -# define UI_F_UI_GET0_RESULT 107 -# define UI_F_UI_NEW_METHOD 104 -# define UI_F_UI_SET_RESULT 105 - -/* Reason codes. */ -# define UI_R_COMMON_OK_AND_CANCEL_CHARACTERS 104 -# define UI_R_INDEX_TOO_LARGE 102 -# define UI_R_INDEX_TOO_SMALL 103 -# define UI_R_NO_RESULT_BUFFER 105 -# define UI_R_RESULT_TOO_LARGE 100 -# define UI_R_RESULT_TOO_SMALL 101 -# define UI_R_UNKNOWN_CONTROL_COMMAND 106 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/ui_compat.h b/libs/win32/openssl/include/openssl/ui_compat.h deleted file mode 100644 index bf541542c0..0000000000 --- a/libs/win32/openssl/include/openssl/ui_compat.h +++ /dev/null @@ -1,88 +0,0 @@ -/* crypto/ui/ui.h */ -/* - * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project - * 2001. - */ -/* ==================================================================== - * Copyright (c) 2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - -#ifndef HEADER_UI_COMPAT_H -# define HEADER_UI_COMPAT_H - -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The following functions were previously part of the DES section, and are - * provided here for backward compatibility reasons. - */ - -# define des_read_pw_string(b,l,p,v) \ - _ossl_old_des_read_pw_string((b),(l),(p),(v)) -# define des_read_pw(b,bf,s,p,v) \ - _ossl_old_des_read_pw((b),(bf),(s),(p),(v)) - -int _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt, - int verify); -int _ossl_old_des_read_pw(char *buf, char *buff, int size, const char *prompt, - int verify); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/whrlpool.h b/libs/win32/openssl/include/openssl/whrlpool.h deleted file mode 100644 index 73c749da81..0000000000 --- a/libs/win32/openssl/include/openssl/whrlpool.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef HEADER_WHRLPOOL_H -# define HEADER_WHRLPOOL_H - -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# define WHIRLPOOL_DIGEST_LENGTH (512/8) -# define WHIRLPOOL_BBLOCK 512 -# define WHIRLPOOL_COUNTER (256/8) - -typedef struct { - union { - unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; - /* double q is here to ensure 64-bit alignment */ - double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)]; - } H; - unsigned char data[WHIRLPOOL_BBLOCK / 8]; - unsigned int bitoff; - size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)]; -} WHIRLPOOL_CTX; - -# ifndef OPENSSL_NO_WHIRLPOOL -# ifdef OPENSSL_FIPS -int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); -# endif -int WHIRLPOOL_Init(WHIRLPOOL_CTX *c); -int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes); -void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits); -int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c); -unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md); -# endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libs/win32/openssl/include/openssl/x509.h b/libs/win32/openssl/include/openssl/x509.h deleted file mode 100644 index 6fa28ebada..0000000000 --- a/libs/win32/openssl/include/openssl/x509.h +++ /dev/null @@ -1,1330 +0,0 @@ -/* crypto/x509/x509.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECDH support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ - -#ifndef HEADER_X509_H -# define HEADER_X509_H - -# include -# include -# ifndef OPENSSL_NO_BUFFER -# include -# endif -# ifndef OPENSSL_NO_EVP -# include -# endif -# ifndef OPENSSL_NO_BIO -# include -# endif -# include -# include -# include - -# ifndef OPENSSL_NO_EC -# include -# endif - -# ifndef OPENSSL_NO_ECDSA -# include -# endif - -# ifndef OPENSSL_NO_ECDH -# include -# endif - -# ifndef OPENSSL_NO_DEPRECATED -# ifndef OPENSSL_NO_RSA -# include -# endif -# ifndef OPENSSL_NO_DSA -# include -# endif -# ifndef OPENSSL_NO_DH -# include -# endif -# endif - -# ifndef OPENSSL_NO_SHA -# include -# endif -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# ifdef OPENSSL_SYS_WIN32 -/* Under Win32 these are defined in wincrypt.h */ -# undef X509_NAME -# undef X509_CERT_PAIR -# undef X509_EXTENSIONS -# endif - -# define X509_FILETYPE_PEM 1 -# define X509_FILETYPE_ASN1 2 -# define X509_FILETYPE_DEFAULT 3 - -# define X509v3_KU_DIGITAL_SIGNATURE 0x0080 -# define X509v3_KU_NON_REPUDIATION 0x0040 -# define X509v3_KU_KEY_ENCIPHERMENT 0x0020 -# define X509v3_KU_DATA_ENCIPHERMENT 0x0010 -# define X509v3_KU_KEY_AGREEMENT 0x0008 -# define X509v3_KU_KEY_CERT_SIGN 0x0004 -# define X509v3_KU_CRL_SIGN 0x0002 -# define X509v3_KU_ENCIPHER_ONLY 0x0001 -# define X509v3_KU_DECIPHER_ONLY 0x8000 -# define X509v3_KU_UNDEF 0xffff - -typedef struct X509_objects_st { - int nid; - int (*a2i) (void); - int (*i2a) (void); -} X509_OBJECTS; - -struct X509_algor_st { - ASN1_OBJECT *algorithm; - ASN1_TYPE *parameter; -} /* X509_ALGOR */ ; - -DECLARE_ASN1_SET_OF(X509_ALGOR) - -typedef STACK_OF(X509_ALGOR) X509_ALGORS; - -typedef struct X509_val_st { - ASN1_TIME *notBefore; - ASN1_TIME *notAfter; -} X509_VAL; - -struct X509_pubkey_st { - X509_ALGOR *algor; - ASN1_BIT_STRING *public_key; - EVP_PKEY *pkey; -}; - -typedef struct X509_sig_st { - X509_ALGOR *algor; - ASN1_OCTET_STRING *digest; -} X509_SIG; - -typedef struct X509_name_entry_st { - ASN1_OBJECT *object; - ASN1_STRING *value; - int set; - int size; /* temp variable */ -} X509_NAME_ENTRY; - -DECLARE_STACK_OF(X509_NAME_ENTRY) -DECLARE_ASN1_SET_OF(X509_NAME_ENTRY) - -/* we always keep X509_NAMEs in 2 forms. */ -struct X509_name_st { - STACK_OF(X509_NAME_ENTRY) *entries; - int modified; /* true if 'bytes' needs to be built */ -# ifndef OPENSSL_NO_BUFFER - BUF_MEM *bytes; -# else - char *bytes; -# endif -/* unsigned long hash; Keep the hash around for lookups */ - unsigned char *canon_enc; - int canon_enclen; -} /* X509_NAME */ ; - -DECLARE_STACK_OF(X509_NAME) - -# define X509_EX_V_NETSCAPE_HACK 0x8000 -# define X509_EX_V_INIT 0x0001 -typedef struct X509_extension_st { - ASN1_OBJECT *object; - ASN1_BOOLEAN critical; - ASN1_OCTET_STRING *value; -} X509_EXTENSION; - -typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS; - -DECLARE_STACK_OF(X509_EXTENSION) -DECLARE_ASN1_SET_OF(X509_EXTENSION) - -/* a sequence of these are used */ -typedef struct x509_attributes_st { - ASN1_OBJECT *object; - int single; /* 0 for a set, 1 for a single item (which is - * wrong) */ - union { - char *ptr; - /* - * 0 - */ STACK_OF(ASN1_TYPE) *set; - /* - * 1 - */ ASN1_TYPE *single; - } value; -} X509_ATTRIBUTE; - -DECLARE_STACK_OF(X509_ATTRIBUTE) -DECLARE_ASN1_SET_OF(X509_ATTRIBUTE) - -typedef struct X509_req_info_st { - ASN1_ENCODING enc; - ASN1_INTEGER *version; - X509_NAME *subject; - X509_PUBKEY *pubkey; - /* d=2 hl=2 l= 0 cons: cont: 00 */ - STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ -} X509_REQ_INFO; - -typedef struct X509_req_st { - X509_REQ_INFO *req_info; - X509_ALGOR *sig_alg; - ASN1_BIT_STRING *signature; - int references; -} X509_REQ; - -typedef struct x509_cinf_st { - ASN1_INTEGER *version; /* [ 0 ] default of v1 */ - ASN1_INTEGER *serialNumber; - X509_ALGOR *signature; - X509_NAME *issuer; - X509_VAL *validity; - X509_NAME *subject; - X509_PUBKEY *key; - ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */ - ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */ - STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */ - ASN1_ENCODING enc; -} X509_CINF; - -/* - * This stuff is certificate "auxiliary info" it contains details which are - * useful in certificate stores and databases. When used this is tagged onto - * the end of the certificate itself - */ - -typedef struct x509_cert_aux_st { - STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */ - STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */ - ASN1_UTF8STRING *alias; /* "friendly name" */ - ASN1_OCTET_STRING *keyid; /* key id of private key */ - STACK_OF(X509_ALGOR) *other; /* other unspecified info */ -} X509_CERT_AUX; - -struct x509_st { - X509_CINF *cert_info; - X509_ALGOR *sig_alg; - ASN1_BIT_STRING *signature; - int valid; - int references; - char *name; - CRYPTO_EX_DATA ex_data; - /* These contain copies of various extension values */ - long ex_pathlen; - long ex_pcpathlen; - unsigned long ex_flags; - unsigned long ex_kusage; - unsigned long ex_xkusage; - unsigned long ex_nscert; - ASN1_OCTET_STRING *skid; - AUTHORITY_KEYID *akid; - X509_POLICY_CACHE *policy_cache; - STACK_OF(DIST_POINT) *crldp; - STACK_OF(GENERAL_NAME) *altname; - NAME_CONSTRAINTS *nc; -# ifndef OPENSSL_NO_RFC3779 - STACK_OF(IPAddressFamily) *rfc3779_addr; - struct ASIdentifiers_st *rfc3779_asid; -# endif -# ifndef OPENSSL_NO_SHA - unsigned char sha1_hash[SHA_DIGEST_LENGTH]; -# endif - X509_CERT_AUX *aux; -} /* X509 */ ; - -DECLARE_STACK_OF(X509) -DECLARE_ASN1_SET_OF(X509) - -/* This is used for a table of trust checking functions */ - -typedef struct x509_trust_st { - int trust; - int flags; - int (*check_trust) (struct x509_trust_st *, X509 *, int); - char *name; - int arg1; - void *arg2; -} X509_TRUST; - -DECLARE_STACK_OF(X509_TRUST) - -typedef struct x509_cert_pair_st { - X509 *forward; - X509 *reverse; -} X509_CERT_PAIR; - -/* standard trust ids */ - -# define X509_TRUST_DEFAULT -1/* Only valid in purpose settings */ - -# define X509_TRUST_COMPAT 1 -# define X509_TRUST_SSL_CLIENT 2 -# define X509_TRUST_SSL_SERVER 3 -# define X509_TRUST_EMAIL 4 -# define X509_TRUST_OBJECT_SIGN 5 -# define X509_TRUST_OCSP_SIGN 6 -# define X509_TRUST_OCSP_REQUEST 7 -# define X509_TRUST_TSA 8 - -/* Keep these up to date! */ -# define X509_TRUST_MIN 1 -# define X509_TRUST_MAX 8 - -/* trust_flags values */ -# define X509_TRUST_DYNAMIC 1 -# define X509_TRUST_DYNAMIC_NAME 2 - -/* check_trust return codes */ - -# define X509_TRUST_TRUSTED 1 -# define X509_TRUST_REJECTED 2 -# define X509_TRUST_UNTRUSTED 3 - -/* Flags for X509_print_ex() */ - -# define X509_FLAG_COMPAT 0 -# define X509_FLAG_NO_HEADER 1L -# define X509_FLAG_NO_VERSION (1L << 1) -# define X509_FLAG_NO_SERIAL (1L << 2) -# define X509_FLAG_NO_SIGNAME (1L << 3) -# define X509_FLAG_NO_ISSUER (1L << 4) -# define X509_FLAG_NO_VALIDITY (1L << 5) -# define X509_FLAG_NO_SUBJECT (1L << 6) -# define X509_FLAG_NO_PUBKEY (1L << 7) -# define X509_FLAG_NO_EXTENSIONS (1L << 8) -# define X509_FLAG_NO_SIGDUMP (1L << 9) -# define X509_FLAG_NO_AUX (1L << 10) -# define X509_FLAG_NO_ATTRIBUTES (1L << 11) -# define X509_FLAG_NO_IDS (1L << 12) - -/* Flags specific to X509_NAME_print_ex() */ - -/* The field separator information */ - -# define XN_FLAG_SEP_MASK (0xf << 16) - -# define XN_FLAG_COMPAT 0/* Traditional SSLeay: use old - * X509_NAME_print */ -# define XN_FLAG_SEP_COMMA_PLUS (1 << 16)/* RFC2253 ,+ */ -# define XN_FLAG_SEP_CPLUS_SPC (2 << 16)/* ,+ spaced: more readable */ -# define XN_FLAG_SEP_SPLUS_SPC (3 << 16)/* ;+ spaced */ -# define XN_FLAG_SEP_MULTILINE (4 << 16)/* One line per field */ - -# define XN_FLAG_DN_REV (1 << 20)/* Reverse DN order */ - -/* How the field name is shown */ - -# define XN_FLAG_FN_MASK (0x3 << 21) - -# define XN_FLAG_FN_SN 0/* Object short name */ -# define XN_FLAG_FN_LN (1 << 21)/* Object long name */ -# define XN_FLAG_FN_OID (2 << 21)/* Always use OIDs */ -# define XN_FLAG_FN_NONE (3 << 21)/* No field names */ - -# define XN_FLAG_SPC_EQ (1 << 23)/* Put spaces round '=' */ - -/* - * This determines if we dump fields we don't recognise: RFC2253 requires - * this. - */ - -# define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24) - -# define XN_FLAG_FN_ALIGN (1 << 25)/* Align field names to 20 - * characters */ - -/* Complete set of RFC2253 flags */ - -# define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \ - XN_FLAG_SEP_COMMA_PLUS | \ - XN_FLAG_DN_REV | \ - XN_FLAG_FN_SN | \ - XN_FLAG_DUMP_UNKNOWN_FIELDS) - -/* readable oneline form */ - -# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \ - ASN1_STRFLGS_ESC_QUOTE | \ - XN_FLAG_SEP_CPLUS_SPC | \ - XN_FLAG_SPC_EQ | \ - XN_FLAG_FN_SN) - -/* readable multiline form */ - -# define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \ - ASN1_STRFLGS_ESC_MSB | \ - XN_FLAG_SEP_MULTILINE | \ - XN_FLAG_SPC_EQ | \ - XN_FLAG_FN_LN | \ - XN_FLAG_FN_ALIGN) - -struct x509_revoked_st { - ASN1_INTEGER *serialNumber; - ASN1_TIME *revocationDate; - STACK_OF(X509_EXTENSION) /* optional */ *extensions; - /* Set up if indirect CRL */ - STACK_OF(GENERAL_NAME) *issuer; - /* Revocation reason */ - int reason; - int sequence; /* load sequence */ -}; - -DECLARE_STACK_OF(X509_REVOKED) -DECLARE_ASN1_SET_OF(X509_REVOKED) - -typedef struct X509_crl_info_st { - ASN1_INTEGER *version; - X509_ALGOR *sig_alg; - X509_NAME *issuer; - ASN1_TIME *lastUpdate; - ASN1_TIME *nextUpdate; - STACK_OF(X509_REVOKED) *revoked; - STACK_OF(X509_EXTENSION) /* [0] */ *extensions; - ASN1_ENCODING enc; -} X509_CRL_INFO; - -struct X509_crl_st { - /* actual signature */ - X509_CRL_INFO *crl; - X509_ALGOR *sig_alg; - ASN1_BIT_STRING *signature; - int references; - int flags; - /* Copies of various extensions */ - AUTHORITY_KEYID *akid; - ISSUING_DIST_POINT *idp; - /* Convenient breakdown of IDP */ - int idp_flags; - int idp_reasons; - /* CRL and base CRL numbers for delta processing */ - ASN1_INTEGER *crl_number; - ASN1_INTEGER *base_crl_number; -# ifndef OPENSSL_NO_SHA - unsigned char sha1_hash[SHA_DIGEST_LENGTH]; -# endif - STACK_OF(GENERAL_NAMES) *issuers; - const X509_CRL_METHOD *meth; - void *meth_data; -} /* X509_CRL */ ; - -DECLARE_STACK_OF(X509_CRL) -DECLARE_ASN1_SET_OF(X509_CRL) - -typedef struct private_key_st { - int version; - /* The PKCS#8 data types */ - X509_ALGOR *enc_algor; - ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */ - /* When decrypted, the following will not be NULL */ - EVP_PKEY *dec_pkey; - /* used to encrypt and decrypt */ - int key_length; - char *key_data; - int key_free; /* true if we should auto free key_data */ - /* expanded version of 'enc_algor' */ - EVP_CIPHER_INFO cipher; - int references; -} X509_PKEY; - -# ifndef OPENSSL_NO_EVP -typedef struct X509_info_st { - X509 *x509; - X509_CRL *crl; - X509_PKEY *x_pkey; - EVP_CIPHER_INFO enc_cipher; - int enc_len; - char *enc_data; - int references; -} X509_INFO; - -DECLARE_STACK_OF(X509_INFO) -# endif - -/* - * The next 2 structures and their 8 routines were sent to me by Pat Richard - * and are used to manipulate Netscapes spki structures - - * useful if you are writing a CA web page - */ -typedef struct Netscape_spkac_st { - X509_PUBKEY *pubkey; - ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */ -} NETSCAPE_SPKAC; - -typedef struct Netscape_spki_st { - NETSCAPE_SPKAC *spkac; /* signed public key and challenge */ - X509_ALGOR *sig_algor; - ASN1_BIT_STRING *signature; -} NETSCAPE_SPKI; - -/* Netscape certificate sequence structure */ -typedef struct Netscape_certificate_sequence { - ASN1_OBJECT *type; - STACK_OF(X509) *certs; -} NETSCAPE_CERT_SEQUENCE; - -/*- Unused (and iv length is wrong) -typedef struct CBCParameter_st - { - unsigned char iv[8]; - } CBC_PARAM; -*/ - -/* Password based encryption structure */ - -typedef struct PBEPARAM_st { - ASN1_OCTET_STRING *salt; - ASN1_INTEGER *iter; -} PBEPARAM; - -/* Password based encryption V2 structures */ - -typedef struct PBE2PARAM_st { - X509_ALGOR *keyfunc; - X509_ALGOR *encryption; -} PBE2PARAM; - -typedef struct PBKDF2PARAM_st { -/* Usually OCTET STRING but could be anything */ - ASN1_TYPE *salt; - ASN1_INTEGER *iter; - ASN1_INTEGER *keylength; - X509_ALGOR *prf; -} PBKDF2PARAM; - -/* PKCS#8 private key info structure */ - -struct pkcs8_priv_key_info_st { - /* Flag for various broken formats */ - int broken; -# define PKCS8_OK 0 -# define PKCS8_NO_OCTET 1 -# define PKCS8_EMBEDDED_PARAM 2 -# define PKCS8_NS_DB 3 -# define PKCS8_NEG_PRIVKEY 4 - ASN1_INTEGER *version; - X509_ALGOR *pkeyalg; - /* Should be OCTET STRING but some are broken */ - ASN1_TYPE *pkey; - STACK_OF(X509_ATTRIBUTE) *attributes; -}; - -#ifdef __cplusplus -} -#endif - -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# define X509_EXT_PACK_UNKNOWN 1 -# define X509_EXT_PACK_STRING 2 - -# define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version) -/* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */ -# define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore) -# define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter) -# define X509_extract_key(x) X509_get_pubkey(x)/*****/ -# define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version) -# define X509_REQ_get_subject_name(x) ((x)->req_info->subject) -# define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a) -# define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) -# define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) - -# define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version) -# define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate) -# define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate) -# define X509_CRL_get_issuer(x) ((x)->crl->issuer) -# define X509_CRL_get_REVOKED(x) ((x)->crl->revoked) - -void X509_CRL_set_default_method(const X509_CRL_METHOD *meth); -X509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init) (X509_CRL *crl), - int (*crl_free) (X509_CRL *crl), - int (*crl_lookup) (X509_CRL *crl, - X509_REVOKED **ret, - ASN1_INTEGER *ser, - X509_NAME *issuer), - int (*crl_verify) (X509_CRL *crl, - EVP_PKEY *pk)); -void X509_CRL_METHOD_free(X509_CRL_METHOD *m); - -void X509_CRL_set_meth_data(X509_CRL *crl, void *dat); -void *X509_CRL_get_meth_data(X509_CRL *crl); - -/* - * This one is only used so that a binary form can output, as in - * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) - */ -# define X509_get_X509_PUBKEY(x) ((x)->cert_info->key) - -const char *X509_verify_cert_error_string(long n); - -# ifndef OPENSSL_NO_EVP -int X509_verify(X509 *a, EVP_PKEY *r); - -int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); -int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); -int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); - -NETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(const char *str, int len); -char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x); -EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x); -int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); - -int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); - -int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent); -int X509_signature_print(BIO *bp, X509_ALGOR *alg, ASN1_STRING *sig); - -int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); -int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx); -int X509_http_nbio(OCSP_REQ_CTX *rctx, X509 **pcert); -int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); -int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx); -int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); -int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx); -int X509_CRL_http_nbio(OCSP_REQ_CTX *rctx, X509_CRL **pcrl); -int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); - -int X509_pubkey_digest(const X509 *data, const EVP_MD *type, - unsigned char *md, unsigned int *len); -int X509_digest(const X509 *data, const EVP_MD *type, - unsigned char *md, unsigned int *len); -int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, - unsigned char *md, unsigned int *len); -int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, - unsigned char *md, unsigned int *len); -int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, - unsigned char *md, unsigned int *len); -# endif - -# ifndef OPENSSL_NO_FP_API -X509 *d2i_X509_fp(FILE *fp, X509 **x509); -int i2d_X509_fp(FILE *fp, X509 *x509); -X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl); -int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl); -X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req); -int i2d_X509_REQ_fp(FILE *fp, X509_REQ *req); -# ifndef OPENSSL_NO_RSA -RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa); -int i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa); -RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa); -int i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa); -RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa); -int i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa); -# endif -# ifndef OPENSSL_NO_DSA -DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); -int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); -DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); -int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); -# endif -# ifndef OPENSSL_NO_EC -EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey); -int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey); -EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey); -int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey); -# endif -X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8); -int i2d_PKCS8_fp(FILE *fp, X509_SIG *p8); -PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, - PKCS8_PRIV_KEY_INFO **p8inf); -int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf); -int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key); -int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); -EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); -int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); -EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); -# endif - -# ifndef OPENSSL_NO_BIO -X509 *d2i_X509_bio(BIO *bp, X509 **x509); -int i2d_X509_bio(BIO *bp, X509 *x509); -X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl); -int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl); -X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req); -int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req); -# ifndef OPENSSL_NO_RSA -RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa); -int i2d_RSAPrivateKey_bio(BIO *bp, RSA *rsa); -RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa); -int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa); -RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa); -int i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa); -# endif -# ifndef OPENSSL_NO_DSA -DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); -int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa); -DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); -int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa); -# endif -# ifndef OPENSSL_NO_EC -EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey); -int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *eckey); -EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey); -int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey); -# endif -X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8); -int i2d_PKCS8_bio(BIO *bp, X509_SIG *p8); -PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, - PKCS8_PRIV_KEY_INFO **p8inf); -int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, PKCS8_PRIV_KEY_INFO *p8inf); -int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key); -int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey); -EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); -int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey); -EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); -# endif - -X509 *X509_dup(X509 *x509); -X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa); -X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex); -X509_CRL *X509_CRL_dup(X509_CRL *crl); -X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev); -X509_REQ *X509_REQ_dup(X509_REQ *req); -X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); -int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, - void *pval); -void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval, - X509_ALGOR *algor); -void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md); -int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b); - -X509_NAME *X509_NAME_dup(X509_NAME *xn); -X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); - -int X509_cmp_time(const ASN1_TIME *s, time_t *t); -int X509_cmp_current_time(const ASN1_TIME *s); -ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *t); -ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s, - int offset_day, long offset_sec, time_t *t); -ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj); - -const char *X509_get_default_cert_area(void); -const char *X509_get_default_cert_dir(void); -const char *X509_get_default_cert_file(void); -const char *X509_get_default_cert_dir_env(void); -const char *X509_get_default_cert_file_env(void); -const char *X509_get_default_private_dir(void); - -X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); -X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey); - -DECLARE_ASN1_FUNCTIONS(X509_ALGOR) -DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS) -DECLARE_ASN1_FUNCTIONS(X509_VAL) - -DECLARE_ASN1_FUNCTIONS(X509_PUBKEY) - -int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); -EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key); -int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain); -int i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp); -EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length); -# ifndef OPENSSL_NO_RSA -int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp); -RSA *d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp, long length); -# endif -# ifndef OPENSSL_NO_DSA -int i2d_DSA_PUBKEY(DSA *a, unsigned char **pp); -DSA *d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp, long length); -# endif -# ifndef OPENSSL_NO_EC -int i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp); -EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, long length); -# endif - -DECLARE_ASN1_FUNCTIONS(X509_SIG) -DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO) -DECLARE_ASN1_FUNCTIONS(X509_REQ) - -DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE) -X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); - -DECLARE_ASN1_FUNCTIONS(X509_EXTENSION) -DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) - -DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY) - -DECLARE_ASN1_FUNCTIONS(X509_NAME) - -int X509_NAME_set(X509_NAME **xn, X509_NAME *name); - -DECLARE_ASN1_FUNCTIONS(X509_CINF) - -DECLARE_ASN1_FUNCTIONS(X509) -DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) - -DECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR) - -int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); -int X509_set_ex_data(X509 *r, int idx, void *arg); -void *X509_get_ex_data(X509 *r, int idx); -int i2d_X509_AUX(X509 *a, unsigned char **pp); -X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length); - -int i2d_re_X509_tbs(X509 *x, unsigned char **pp); - -void X509_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg, - const X509 *x); -int X509_get_signature_nid(const X509 *x); - -int X509_alias_set1(X509 *x, unsigned char *name, int len); -int X509_keyid_set1(X509 *x, unsigned char *id, int len); -unsigned char *X509_alias_get0(X509 *x, int *len); -unsigned char *X509_keyid_get0(X509 *x, int *len); -int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *, - int); -int X509_TRUST_set(int *t, int trust); -int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); -int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj); -void X509_trust_clear(X509 *x); -void X509_reject_clear(X509 *x); - -DECLARE_ASN1_FUNCTIONS(X509_REVOKED) -DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO) -DECLARE_ASN1_FUNCTIONS(X509_CRL) - -int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev); -int X509_CRL_get0_by_serial(X509_CRL *crl, - X509_REVOKED **ret, ASN1_INTEGER *serial); -int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x); - -X509_PKEY *X509_PKEY_new(void); -void X509_PKEY_free(X509_PKEY *a); -int i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp); -X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, - long length); - -DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) -DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) -DECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) - -# ifndef OPENSSL_NO_EVP -X509_INFO *X509_INFO_new(void); -void X509_INFO_free(X509_INFO *a); -char *X509_NAME_oneline(X509_NAME *a, char *buf, int size); - -int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1, - ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey); - -int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, - unsigned char *md, unsigned int *len); - -int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, - X509_ALGOR *algor2, ASN1_BIT_STRING *signature, - char *data, EVP_PKEY *pkey, const EVP_MD *type); - -int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *data, - unsigned char *md, unsigned int *len); - -int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1, - ASN1_BIT_STRING *signature, void *data, EVP_PKEY *pkey); - -int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, - X509_ALGOR *algor2, ASN1_BIT_STRING *signature, void *data, - EVP_PKEY *pkey, const EVP_MD *type); -int ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, - X509_ALGOR *algor2, ASN1_BIT_STRING *signature, - void *asn, EVP_MD_CTX *ctx); -# endif - -int X509_set_version(X509 *x, long version); -int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); -ASN1_INTEGER *X509_get_serialNumber(X509 *x); -int X509_set_issuer_name(X509 *x, X509_NAME *name); -X509_NAME *X509_get_issuer_name(X509 *a); -int X509_set_subject_name(X509 *x, X509_NAME *name); -X509_NAME *X509_get_subject_name(X509 *a); -int X509_set_notBefore(X509 *x, const ASN1_TIME *tm); -int X509_set_notAfter(X509 *x, const ASN1_TIME *tm); -int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); -EVP_PKEY *X509_get_pubkey(X509 *x); -ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x); -int X509_certificate_type(X509 *x, EVP_PKEY *pubkey /* optional */ ); - -int X509_REQ_set_version(X509_REQ *x, long version); -int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name); -int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); -EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req); -int X509_REQ_extension_nid(int nid); -int *X509_REQ_get_extension_nids(void); -void X509_REQ_set_extension_nids(int *nids); -STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); -int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, - int nid); -int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); -int X509_REQ_get_attr_count(const X509_REQ *req); -int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos); -int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, - int lastpos); -X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); -X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); -int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); -int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, - const ASN1_OBJECT *obj, int type, - const unsigned char *bytes, int len); -int X509_REQ_add1_attr_by_NID(X509_REQ *req, - int nid, int type, - const unsigned char *bytes, int len); -int X509_REQ_add1_attr_by_txt(X509_REQ *req, - const char *attrname, int type, - const unsigned char *bytes, int len); - -int X509_CRL_set_version(X509_CRL *x, long version); -int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name); -int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm); -int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); -int X509_CRL_sort(X509_CRL *crl); - -int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); -int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm); - -X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer, - EVP_PKEY *skey, const EVP_MD *md, unsigned int flags); - -int X509_REQ_check_private_key(X509_REQ *x509, EVP_PKEY *pkey); - -int X509_check_private_key(X509 *x509, EVP_PKEY *pkey); -int X509_chain_check_suiteb(int *perror_depth, - X509 *x, STACK_OF(X509) *chain, - unsigned long flags); -int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags); -STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain); - -int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b); -unsigned long X509_issuer_and_serial_hash(X509 *a); - -int X509_issuer_name_cmp(const X509 *a, const X509 *b); -unsigned long X509_issuer_name_hash(X509 *a); - -int X509_subject_name_cmp(const X509 *a, const X509 *b); -unsigned long X509_subject_name_hash(X509 *x); - -# ifndef OPENSSL_NO_MD5 -unsigned long X509_issuer_name_hash_old(X509 *a); -unsigned long X509_subject_name_hash_old(X509 *x); -# endif - -int X509_cmp(const X509 *a, const X509 *b); -int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); -unsigned long X509_NAME_hash(X509_NAME *x); -unsigned long X509_NAME_hash_old(X509_NAME *x); - -int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); -int X509_CRL_match(const X509_CRL *a, const X509_CRL *b); -# ifndef OPENSSL_NO_FP_API -int X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag, - unsigned long cflag); -int X509_print_fp(FILE *bp, X509 *x); -int X509_CRL_print_fp(FILE *bp, X509_CRL *x); -int X509_REQ_print_fp(FILE *bp, X509_REQ *req); -int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, - unsigned long flags); -# endif - -# ifndef OPENSSL_NO_BIO -int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); -int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, - unsigned long flags); -int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag, - unsigned long cflag); -int X509_print(BIO *bp, X509 *x); -int X509_ocspid_print(BIO *bp, X509 *x); -int X509_CERT_AUX_print(BIO *bp, X509_CERT_AUX *x, int indent); -int X509_CRL_print(BIO *bp, X509_CRL *x); -int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, - unsigned long cflag); -int X509_REQ_print(BIO *bp, X509_REQ *req); -# endif - -int X509_NAME_entry_count(X509_NAME *name); -int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len); -int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, - char *buf, int len); - -/* - * NOTE: you should be passsing -1, not 0 as lastpos. The functions that use - * lastpos, search after that position on. - */ -int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos); -int X509_NAME_get_index_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, - int lastpos); -X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); -X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); -int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, - int loc, int set); -int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, - unsigned char *bytes, int len, int loc, - int set); -int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, - unsigned char *bytes, int len, int loc, - int set); -X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, - const char *field, int type, - const unsigned char *bytes, - int len); -X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, - int type, unsigned char *bytes, - int len); -int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, - const unsigned char *bytes, int len, int loc, - int set); -X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, - ASN1_OBJECT *obj, int type, - const unsigned char *bytes, - int len); -int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj); -int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, - const unsigned char *bytes, int len); -ASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); -ASN1_STRING *X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); - -int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); -int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, - int nid, int lastpos); -int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, - ASN1_OBJECT *obj, int lastpos); -int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, - int crit, int lastpos); -X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc); -X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); -STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, - X509_EXTENSION *ex, int loc); - -int X509_get_ext_count(X509 *x); -int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); -int X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos); -int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); -X509_EXTENSION *X509_get_ext(X509 *x, int loc); -X509_EXTENSION *X509_delete_ext(X509 *x, int loc); -int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); -void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); -int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, - unsigned long flags); - -int X509_CRL_get_ext_count(X509_CRL *x); -int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); -int X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos); -int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos); -X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); -X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); -int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); -void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); -int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, - unsigned long flags); - -int X509_REVOKED_get_ext_count(X509_REVOKED *x); -int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); -int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x, ASN1_OBJECT *obj, - int lastpos); -int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos); -X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); -X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); -int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); -void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); -int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, - unsigned long flags); - -X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, - int nid, int crit, - ASN1_OCTET_STRING *data); -X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, - ASN1_OBJECT *obj, int crit, - ASN1_OCTET_STRING *data); -int X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj); -int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit); -int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data); -ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex); -ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); -int X509_EXTENSION_get_critical(X509_EXTENSION *ex); - -int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); -int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, - int lastpos); -int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, - ASN1_OBJECT *obj, int lastpos); -X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); -X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); -STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, - X509_ATTRIBUTE *attr); -STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) - **x, const ASN1_OBJECT *obj, - int type, - const unsigned char *bytes, - int len); -STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) - **x, int nid, int type, - const unsigned char *bytes, - int len); -STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) - **x, const char *attrname, - int type, - const unsigned char *bytes, - int len); -void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, ASN1_OBJECT *obj, - int lastpos, int type); -X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, - int atrtype, const void *data, - int len); -X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, - const ASN1_OBJECT *obj, - int atrtype, const void *data, - int len); -X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, - const char *atrname, int type, - const unsigned char *bytes, - int len); -int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj); -int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, - const void *data, int len); -void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype, - void *data); -int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr); -ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr); -ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx); - -int EVP_PKEY_get_attr_count(const EVP_PKEY *key); -int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos); -int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj, - int lastpos); -X509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc); -X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc); -int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr); -int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key, - const ASN1_OBJECT *obj, int type, - const unsigned char *bytes, int len); -int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key, - int nid, int type, - const unsigned char *bytes, int len); -int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key, - const char *attrname, int type, - const unsigned char *bytes, int len); - -int X509_verify_cert(X509_STORE_CTX *ctx); - -/* lookup a cert from a X509 STACK */ -X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, X509_NAME *name, - ASN1_INTEGER *serial); -X509 *X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name); - -DECLARE_ASN1_FUNCTIONS(PBEPARAM) -DECLARE_ASN1_FUNCTIONS(PBE2PARAM) -DECLARE_ASN1_FUNCTIONS(PBKDF2PARAM) - -int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter, - const unsigned char *salt, int saltlen); - -X509_ALGOR *PKCS5_pbe_set(int alg, int iter, - const unsigned char *salt, int saltlen); -X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, - unsigned char *salt, int saltlen); -X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, - unsigned char *salt, int saltlen, - unsigned char *aiv, int prf_nid); - -X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, - int prf_nid, int keylen); - -/* PKCS#8 utilities */ - -DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) - -EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8); -PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); -PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken); -PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken); - -int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, - int version, int ptype, void *pval, - unsigned char *penc, int penclen); -int PKCS8_pkey_get0(ASN1_OBJECT **ppkalg, - const unsigned char **pk, int *ppklen, - X509_ALGOR **pa, PKCS8_PRIV_KEY_INFO *p8); - -int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj, - int ptype, void *pval, - unsigned char *penc, int penclen); -int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, - const unsigned char **pk, int *ppklen, - X509_ALGOR **pa, X509_PUBKEY *pub); - -int X509_check_trust(X509 *x, int id, int flags); -int X509_TRUST_get_count(void); -X509_TRUST *X509_TRUST_get0(int idx); -int X509_TRUST_get_by_id(int id); -int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int), - char *name, int arg1, void *arg2); -void X509_TRUST_cleanup(void); -int X509_TRUST_get_flags(X509_TRUST *xp); -char *X509_TRUST_get0_name(X509_TRUST *xp); -int X509_TRUST_get_trust(X509_TRUST *xp); - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ - -void ERR_load_X509_strings(void); - -/* Error codes for the X509 functions. */ - -/* Function codes. */ -# define X509_F_ADD_CERT_DIR 100 -# define X509_F_BY_FILE_CTRL 101 -# define X509_F_CHECK_NAME_CONSTRAINTS 106 -# define X509_F_CHECK_POLICY 145 -# define X509_F_DIR_CTRL 102 -# define X509_F_GET_CERT_BY_SUBJECT 103 -# define X509_F_NETSCAPE_SPKI_B64_DECODE 129 -# define X509_F_NETSCAPE_SPKI_B64_ENCODE 130 -# define X509_F_X509AT_ADD1_ATTR 135 -# define X509_F_X509V3_ADD_EXT 104 -# define X509_F_X509_ATTRIBUTE_CREATE_BY_NID 136 -# define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ 137 -# define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT 140 -# define X509_F_X509_ATTRIBUTE_GET0_DATA 139 -# define X509_F_X509_ATTRIBUTE_SET1_DATA 138 -# define X509_F_X509_CHECK_PRIVATE_KEY 128 -# define X509_F_X509_CRL_DIFF 105 -# define X509_F_X509_CRL_PRINT_FP 147 -# define X509_F_X509_EXTENSION_CREATE_BY_NID 108 -# define X509_F_X509_EXTENSION_CREATE_BY_OBJ 109 -# define X509_F_X509_GET_PUBKEY_PARAMETERS 110 -# define X509_F_X509_LOAD_CERT_CRL_FILE 132 -# define X509_F_X509_LOAD_CERT_FILE 111 -# define X509_F_X509_LOAD_CRL_FILE 112 -# define X509_F_X509_NAME_ADD_ENTRY 113 -# define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 -# define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 -# define X509_F_X509_NAME_ENTRY_SET_OBJECT 115 -# define X509_F_X509_NAME_ONELINE 116 -# define X509_F_X509_NAME_PRINT 117 -# define X509_F_X509_PRINT_EX_FP 118 -# define X509_F_X509_PUBKEY_GET 119 -# define X509_F_X509_PUBKEY_SET 120 -# define X509_F_X509_REQ_CHECK_PRIVATE_KEY 144 -# define X509_F_X509_REQ_PRINT_EX 121 -# define X509_F_X509_REQ_PRINT_FP 122 -# define X509_F_X509_REQ_TO_X509 123 -# define X509_F_X509_STORE_ADD_CERT 124 -# define X509_F_X509_STORE_ADD_CRL 125 -# define X509_F_X509_STORE_CTX_GET1_ISSUER 146 -# define X509_F_X509_STORE_CTX_INIT 143 -# define X509_F_X509_STORE_CTX_NEW 142 -# define X509_F_X509_STORE_CTX_PURPOSE_INHERIT 134 -# define X509_F_X509_TO_X509_REQ 126 -# define X509_F_X509_TRUST_ADD 133 -# define X509_F_X509_TRUST_SET 141 -# define X509_F_X509_VERIFY_CERT 127 - -/* Reason codes. */ -# define X509_R_AKID_MISMATCH 110 -# define X509_R_BAD_X509_FILETYPE 100 -# define X509_R_BASE64_DECODE_ERROR 118 -# define X509_R_CANT_CHECK_DH_KEY 114 -# define X509_R_CERT_ALREADY_IN_HASH_TABLE 101 -# define X509_R_CRL_ALREADY_DELTA 127 -# define X509_R_CRL_VERIFY_FAILURE 131 -# define X509_R_ERR_ASN1_LIB 102 -# define X509_R_IDP_MISMATCH 128 -# define X509_R_INVALID_DIRECTORY 113 -# define X509_R_INVALID_FIELD_NAME 119 -# define X509_R_INVALID_TRUST 123 -# define X509_R_ISSUER_MISMATCH 129 -# define X509_R_KEY_TYPE_MISMATCH 115 -# define X509_R_KEY_VALUES_MISMATCH 116 -# define X509_R_LOADING_CERT_DIR 103 -# define X509_R_LOADING_DEFAULTS 104 -# define X509_R_METHOD_NOT_SUPPORTED 124 -# define X509_R_NAME_TOO_LONG 134 -# define X509_R_NEWER_CRL_NOT_NEWER 132 -# define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 -# define X509_R_NO_CRL_NUMBER 130 -# define X509_R_PUBLIC_KEY_DECODE_ERROR 125 -# define X509_R_PUBLIC_KEY_ENCODE_ERROR 126 -# define X509_R_SHOULD_RETRY 106 -# define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN 107 -# define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY 108 -# define X509_R_UNKNOWN_KEY_TYPE 117 -# define X509_R_UNKNOWN_NID 109 -# define X509_R_UNKNOWN_PURPOSE_ID 121 -# define X509_R_UNKNOWN_TRUST_ID 120 -# define X509_R_UNSUPPORTED_ALGORITHM 111 -# define X509_R_WRONG_LOOKUP_TYPE 112 -# define X509_R_WRONG_TYPE 122 - -# ifdef __cplusplus -} -# endif -#endif diff --git a/libs/win32/openssl/include/openssl/x509_vfy.h b/libs/win32/openssl/include/openssl/x509_vfy.h deleted file mode 100644 index 50626826e0..0000000000 --- a/libs/win32/openssl/include/openssl/x509_vfy.h +++ /dev/null @@ -1,652 +0,0 @@ -/* crypto/x509/x509_vfy.h */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#ifndef HEADER_X509_H -# include -/* - * openssl/x509.h ends up #include-ing this file at about the only - * appropriate moment. - */ -#endif - -#ifndef HEADER_X509_VFY_H -# define HEADER_X509_VFY_H - -# include -# ifndef OPENSSL_NO_LHASH -# include -# endif -# include -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# if 0 -/* Outer object */ -typedef struct x509_hash_dir_st { - int num_dirs; - char **dirs; - int *dirs_type; - int num_dirs_alloced; -} X509_HASH_DIR_CTX; -# endif - -typedef struct x509_file_st { - int num_paths; /* number of paths to files or directories */ - int num_alloced; - char **paths; /* the list of paths or directories */ - int *path_type; -} X509_CERT_FILE_CTX; - -/*******************************/ -/*- -SSL_CTX -> X509_STORE - -> X509_LOOKUP - ->X509_LOOKUP_METHOD - -> X509_LOOKUP - ->X509_LOOKUP_METHOD - -SSL -> X509_STORE_CTX - ->X509_STORE - -The X509_STORE holds the tables etc for verification stuff. -A X509_STORE_CTX is used while validating a single certificate. -The X509_STORE has X509_LOOKUPs for looking up certs. -The X509_STORE then calls a function to actually verify the -certificate chain. -*/ - -# define X509_LU_RETRY -1 -# define X509_LU_FAIL 0 -# define X509_LU_X509 1 -# define X509_LU_CRL 2 -# define X509_LU_PKEY 3 - -typedef struct x509_object_st { - /* one of the above types */ - int type; - union { - char *ptr; - X509 *x509; - X509_CRL *crl; - EVP_PKEY *pkey; - } data; -} X509_OBJECT; - -typedef struct x509_lookup_st X509_LOOKUP; - -DECLARE_STACK_OF(X509_LOOKUP) -DECLARE_STACK_OF(X509_OBJECT) - -/* This is a static that defines the function interface */ -typedef struct x509_lookup_method_st { - const char *name; - int (*new_item) (X509_LOOKUP *ctx); - void (*free) (X509_LOOKUP *ctx); - int (*init) (X509_LOOKUP *ctx); - int (*shutdown) (X509_LOOKUP *ctx); - int (*ctrl) (X509_LOOKUP *ctx, int cmd, const char *argc, long argl, - char **ret); - int (*get_by_subject) (X509_LOOKUP *ctx, int type, X509_NAME *name, - X509_OBJECT *ret); - int (*get_by_issuer_serial) (X509_LOOKUP *ctx, int type, X509_NAME *name, - ASN1_INTEGER *serial, X509_OBJECT *ret); - int (*get_by_fingerprint) (X509_LOOKUP *ctx, int type, - unsigned char *bytes, int len, - X509_OBJECT *ret); - int (*get_by_alias) (X509_LOOKUP *ctx, int type, char *str, int len, - X509_OBJECT *ret); -} X509_LOOKUP_METHOD; - -typedef struct X509_VERIFY_PARAM_ID_st X509_VERIFY_PARAM_ID; - -/* - * This structure hold all parameters associated with a verify operation by - * including an X509_VERIFY_PARAM structure in related structures the - * parameters used can be customized - */ - -typedef struct X509_VERIFY_PARAM_st { - char *name; - time_t check_time; /* Time to use */ - unsigned long inh_flags; /* Inheritance flags */ - unsigned long flags; /* Various verify flags */ - int purpose; /* purpose to check untrusted certificates */ - int trust; /* trust setting to check */ - int depth; /* Verify depth */ - STACK_OF(ASN1_OBJECT) *policies; /* Permissible policies */ - X509_VERIFY_PARAM_ID *id; /* opaque ID data */ -} X509_VERIFY_PARAM; - -DECLARE_STACK_OF(X509_VERIFY_PARAM) - -/* - * This is used to hold everything. It is used for all certificate - * validation. Once we have a certificate chain, the 'verify' function is - * then called to actually check the cert chain. - */ -struct x509_store_st { - /* The following is a cache of trusted certs */ - int cache; /* if true, stash any hits */ - STACK_OF(X509_OBJECT) *objs; /* Cache of all objects */ - /* These are external lookup methods */ - STACK_OF(X509_LOOKUP) *get_cert_methods; - X509_VERIFY_PARAM *param; - /* Callbacks for various operations */ - /* called to verify a certificate */ - int (*verify) (X509_STORE_CTX *ctx); - /* error callback */ - int (*verify_cb) (int ok, X509_STORE_CTX *ctx); - /* get issuers cert from ctx */ - int (*get_issuer) (X509 **issuer, X509_STORE_CTX *ctx, X509 *x); - /* check issued */ - int (*check_issued) (X509_STORE_CTX *ctx, X509 *x, X509 *issuer); - /* Check revocation status of chain */ - int (*check_revocation) (X509_STORE_CTX *ctx); - /* retrieve CRL */ - int (*get_crl) (X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); - /* Check CRL validity */ - int (*check_crl) (X509_STORE_CTX *ctx, X509_CRL *crl); - /* Check certificate against CRL */ - int (*cert_crl) (X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); - STACK_OF(X509) *(*lookup_certs) (X509_STORE_CTX *ctx, X509_NAME *nm); - STACK_OF(X509_CRL) *(*lookup_crls) (X509_STORE_CTX *ctx, X509_NAME *nm); - int (*cleanup) (X509_STORE_CTX *ctx); - CRYPTO_EX_DATA ex_data; - int references; -} /* X509_STORE */ ; - -int X509_STORE_set_depth(X509_STORE *store, int depth); - -# define X509_STORE_set_verify_cb_func(ctx,func) ((ctx)->verify_cb=(func)) -# define X509_STORE_set_verify_func(ctx,func) ((ctx)->verify=(func)) - -/* This is the functions plus an instance of the local variables. */ -struct x509_lookup_st { - int init; /* have we been started */ - int skip; /* don't use us. */ - X509_LOOKUP_METHOD *method; /* the functions */ - char *method_data; /* method data */ - X509_STORE *store_ctx; /* who owns us */ -} /* X509_LOOKUP */ ; - -/* - * This is a used when verifying cert chains. Since the gathering of the - * cert chain can take some time (and have to be 'retried', this needs to be - * kept and passed around. - */ -struct x509_store_ctx_st { /* X509_STORE_CTX */ - X509_STORE *ctx; - /* used when looking up certs */ - int current_method; - /* The following are set by the caller */ - /* The cert to check */ - X509 *cert; - /* chain of X509s - untrusted - passed in */ - STACK_OF(X509) *untrusted; - /* set of CRLs passed in */ - STACK_OF(X509_CRL) *crls; - X509_VERIFY_PARAM *param; - /* Other info for use with get_issuer() */ - void *other_ctx; - /* Callbacks for various operations */ - /* called to verify a certificate */ - int (*verify) (X509_STORE_CTX *ctx); - /* error callback */ - int (*verify_cb) (int ok, X509_STORE_CTX *ctx); - /* get issuers cert from ctx */ - int (*get_issuer) (X509 **issuer, X509_STORE_CTX *ctx, X509 *x); - /* check issued */ - int (*check_issued) (X509_STORE_CTX *ctx, X509 *x, X509 *issuer); - /* Check revocation status of chain */ - int (*check_revocation) (X509_STORE_CTX *ctx); - /* retrieve CRL */ - int (*get_crl) (X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); - /* Check CRL validity */ - int (*check_crl) (X509_STORE_CTX *ctx, X509_CRL *crl); - /* Check certificate against CRL */ - int (*cert_crl) (X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); - int (*check_policy) (X509_STORE_CTX *ctx); - STACK_OF(X509) *(*lookup_certs) (X509_STORE_CTX *ctx, X509_NAME *nm); - STACK_OF(X509_CRL) *(*lookup_crls) (X509_STORE_CTX *ctx, X509_NAME *nm); - int (*cleanup) (X509_STORE_CTX *ctx); - /* The following is built up */ - /* if 0, rebuild chain */ - int valid; - /* index of last untrusted cert */ - int last_untrusted; - /* chain of X509s - built up and trusted */ - STACK_OF(X509) *chain; - /* Valid policy tree */ - X509_POLICY_TREE *tree; - /* Require explicit policy value */ - int explicit_policy; - /* When something goes wrong, this is why */ - int error_depth; - int error; - X509 *current_cert; - /* cert currently being tested as valid issuer */ - X509 *current_issuer; - /* current CRL */ - X509_CRL *current_crl; - /* score of current CRL */ - int current_crl_score; - /* Reason mask */ - unsigned int current_reasons; - /* For CRL path validation: parent context */ - X509_STORE_CTX *parent; - CRYPTO_EX_DATA ex_data; -} /* X509_STORE_CTX */ ; - -void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); - -# define X509_STORE_CTX_set_app_data(ctx,data) \ - X509_STORE_CTX_set_ex_data(ctx,0,data) -# define X509_STORE_CTX_get_app_data(ctx) \ - X509_STORE_CTX_get_ex_data(ctx,0) - -# define X509_L_FILE_LOAD 1 -# define X509_L_ADD_DIR 2 - -# define X509_LOOKUP_load_file(x,name,type) \ - X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL) - -# define X509_LOOKUP_add_dir(x,name,type) \ - X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL) - -# define X509_V_OK 0 -# define X509_V_ERR_UNSPECIFIED 1 - -# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 -# define X509_V_ERR_UNABLE_TO_GET_CRL 3 -# define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4 -# define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5 -# define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6 -# define X509_V_ERR_CERT_SIGNATURE_FAILURE 7 -# define X509_V_ERR_CRL_SIGNATURE_FAILURE 8 -# define X509_V_ERR_CERT_NOT_YET_VALID 9 -# define X509_V_ERR_CERT_HAS_EXPIRED 10 -# define X509_V_ERR_CRL_NOT_YET_VALID 11 -# define X509_V_ERR_CRL_HAS_EXPIRED 12 -# define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13 -# define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14 -# define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15 -# define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16 -# define X509_V_ERR_OUT_OF_MEM 17 -# define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18 -# define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19 -# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20 -# define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21 -# define X509_V_ERR_CERT_CHAIN_TOO_LONG 22 -# define X509_V_ERR_CERT_REVOKED 23 -# define X509_V_ERR_INVALID_CA 24 -# define X509_V_ERR_PATH_LENGTH_EXCEEDED 25 -# define X509_V_ERR_INVALID_PURPOSE 26 -# define X509_V_ERR_CERT_UNTRUSTED 27 -# define X509_V_ERR_CERT_REJECTED 28 -/* These are 'informational' when looking for issuer cert */ -# define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29 -# define X509_V_ERR_AKID_SKID_MISMATCH 30 -# define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31 -# define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32 - -# define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33 -# define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34 -# define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35 -# define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36 -# define X509_V_ERR_INVALID_NON_CA 37 -# define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38 -# define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39 -# define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40 - -# define X509_V_ERR_INVALID_EXTENSION 41 -# define X509_V_ERR_INVALID_POLICY_EXTENSION 42 -# define X509_V_ERR_NO_EXPLICIT_POLICY 43 -# define X509_V_ERR_DIFFERENT_CRL_SCOPE 44 -# define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45 - -# define X509_V_ERR_UNNESTED_RESOURCE 46 - -# define X509_V_ERR_PERMITTED_VIOLATION 47 -# define X509_V_ERR_EXCLUDED_VIOLATION 48 -# define X509_V_ERR_SUBTREE_MINMAX 49 -# define X509_V_ERR_APPLICATION_VERIFICATION 50 -# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51 -# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52 -# define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53 -# define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54 - -/* Suite B mode algorithm violation */ -# define X509_V_ERR_SUITE_B_INVALID_VERSION 56 -# define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57 -# define X509_V_ERR_SUITE_B_INVALID_CURVE 58 -# define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59 -# define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60 -# define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61 - -/* Host, email and IP check errors */ -# define X509_V_ERR_HOSTNAME_MISMATCH 62 -# define X509_V_ERR_EMAIL_MISMATCH 63 -# define X509_V_ERR_IP_ADDRESS_MISMATCH 64 - -/* Caller error */ -# define X509_V_ERR_INVALID_CALL 65 -/* Issuer lookup error */ -# define X509_V_ERR_STORE_LOOKUP 66 - -# define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 67 - -/* Certificate verify flags */ - -/* Send issuer+subject checks to verify_cb */ -# define X509_V_FLAG_CB_ISSUER_CHECK 0x1 -/* Use check time instead of current time */ -# define X509_V_FLAG_USE_CHECK_TIME 0x2 -/* Lookup CRLs */ -# define X509_V_FLAG_CRL_CHECK 0x4 -/* Lookup CRLs for whole chain */ -# define X509_V_FLAG_CRL_CHECK_ALL 0x8 -/* Ignore unhandled critical extensions */ -# define X509_V_FLAG_IGNORE_CRITICAL 0x10 -/* Disable workarounds for broken certificates */ -# define X509_V_FLAG_X509_STRICT 0x20 -/* Enable proxy certificate validation */ -# define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40 -/* Enable policy checking */ -# define X509_V_FLAG_POLICY_CHECK 0x80 -/* Policy variable require-explicit-policy */ -# define X509_V_FLAG_EXPLICIT_POLICY 0x100 -/* Policy variable inhibit-any-policy */ -# define X509_V_FLAG_INHIBIT_ANY 0x200 -/* Policy variable inhibit-policy-mapping */ -# define X509_V_FLAG_INHIBIT_MAP 0x400 -/* Notify callback that policy is OK */ -# define X509_V_FLAG_NOTIFY_POLICY 0x800 -/* Extended CRL features such as indirect CRLs, alternate CRL signing keys */ -# define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000 -/* Delta CRL support */ -# define X509_V_FLAG_USE_DELTAS 0x2000 -/* Check selfsigned CA signature */ -# define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000 -/* Use trusted store first */ -# define X509_V_FLAG_TRUSTED_FIRST 0x8000 -/* Suite B 128 bit only mode: not normally used */ -# define X509_V_FLAG_SUITEB_128_LOS_ONLY 0x10000 -/* Suite B 192 bit only mode */ -# define X509_V_FLAG_SUITEB_192_LOS 0x20000 -/* Suite B 128 bit mode allowing 192 bit algorithms */ -# define X509_V_FLAG_SUITEB_128_LOS 0x30000 - -/* Allow partial chains if at least one certificate is in trusted store */ -# define X509_V_FLAG_PARTIAL_CHAIN 0x80000 -/* - * If the initial chain is not trusted, do not attempt to build an alternative - * chain. Alternate chain checking was introduced in 1.0.2b. Setting this flag - * will force the behaviour to match that of previous versions. - */ -# define X509_V_FLAG_NO_ALT_CHAINS 0x100000 - -# define X509_VP_FLAG_DEFAULT 0x1 -# define X509_VP_FLAG_OVERWRITE 0x2 -# define X509_VP_FLAG_RESET_FLAGS 0x4 -# define X509_VP_FLAG_LOCKED 0x8 -# define X509_VP_FLAG_ONCE 0x10 - -/* Internal use: mask of policy related options */ -# define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \ - | X509_V_FLAG_EXPLICIT_POLICY \ - | X509_V_FLAG_INHIBIT_ANY \ - | X509_V_FLAG_INHIBIT_MAP) - -int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type, - X509_NAME *name); -X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, - int type, X509_NAME *name); -X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, - X509_OBJECT *x); -void X509_OBJECT_up_ref_count(X509_OBJECT *a); -void X509_OBJECT_free_contents(X509_OBJECT *a); -X509_STORE *X509_STORE_new(void); -void X509_STORE_free(X509_STORE *v); - -STACK_OF(X509) *X509_STORE_get1_certs(X509_STORE_CTX *st, X509_NAME *nm); -STACK_OF(X509_CRL) *X509_STORE_get1_crls(X509_STORE_CTX *st, X509_NAME *nm); -int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags); -int X509_STORE_set_purpose(X509_STORE *ctx, int purpose); -int X509_STORE_set_trust(X509_STORE *ctx, int trust); -int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm); - -void X509_STORE_set_verify_cb(X509_STORE *ctx, - int (*verify_cb) (int, X509_STORE_CTX *)); - -void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx, - STACK_OF(X509_CRL) *(*cb) (X509_STORE_CTX - *ctx, - X509_NAME *nm)); - -X509_STORE_CTX *X509_STORE_CTX_new(void); - -int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); - -void X509_STORE_CTX_free(X509_STORE_CTX *ctx); -int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, - X509 *x509, STACK_OF(X509) *chain); -void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); -void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); - -X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx); - -X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); - -X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); -X509_LOOKUP_METHOD *X509_LOOKUP_file(void); - -int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); -int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); - -int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name, - X509_OBJECT *ret); - -int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, - long argl, char **ret); - -# ifndef OPENSSL_NO_STDIO -int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type); -int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type); -int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type); -# endif - -X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method); -void X509_LOOKUP_free(X509_LOOKUP *ctx); -int X509_LOOKUP_init(X509_LOOKUP *ctx); -int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, - X509_OBJECT *ret); -int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, - ASN1_INTEGER *serial, X509_OBJECT *ret); -int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, - unsigned char *bytes, int len, - X509_OBJECT *ret); -int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len, - X509_OBJECT *ret); -int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); - -# ifndef OPENSSL_NO_STDIO -int X509_STORE_load_locations(X509_STORE *ctx, - const char *file, const char *dir); -int X509_STORE_set_default_paths(X509_STORE *ctx); -# endif - -int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, - CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, - CRYPTO_EX_free *free_func); -int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data); -void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx, int idx); -int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx); -void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s); -int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx); -X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx); -X509 *X509_STORE_CTX_get0_current_issuer(X509_STORE_CTX *ctx); -X509_CRL *X509_STORE_CTX_get0_current_crl(X509_STORE_CTX *ctx); -X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx); -STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx); -STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx); -void X509_STORE_CTX_set_cert(X509_STORE_CTX *c, X509 *x); -void X509_STORE_CTX_set_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk); -void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c, STACK_OF(X509_CRL) *sk); -int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose); -int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust); -int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, - int purpose, int trust); -void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags); -void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, - time_t t); -void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, - int (*verify_cb) (int, X509_STORE_CTX *)); - -X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx); -int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx); - -X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx); -void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param); -int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name); - -/* X509_VERIFY_PARAM functions */ - -X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void); -void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param); -int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to, - const X509_VERIFY_PARAM *from); -int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, - const X509_VERIFY_PARAM *from); -int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name); -int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, - unsigned long flags); -int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param, - unsigned long flags); -unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param); -int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); -int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); -void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); -void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); -int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, - ASN1_OBJECT *policy); -int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, - STACK_OF(ASN1_OBJECT) *policies); - -int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, - const char *name, size_t namelen); -int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, - const char *name, size_t namelen); -void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, - unsigned int flags); -char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *); -int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, - const char *email, size_t emaillen); -int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param, - const unsigned char *ip, size_t iplen); -int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, - const char *ipasc); - -int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param); -const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param); - -int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param); -int X509_VERIFY_PARAM_get_count(void); -const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id); -const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name); -void X509_VERIFY_PARAM_table_cleanup(void); - -int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, - STACK_OF(X509) *certs, - STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags); - -void X509_policy_tree_free(X509_POLICY_TREE *tree); - -int X509_policy_tree_level_count(const X509_POLICY_TREE *tree); -X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree, - int i); - -STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const - X509_POLICY_TREE - *tree); - -STACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const - X509_POLICY_TREE - *tree); - -int X509_policy_level_node_count(X509_POLICY_LEVEL *level); - -X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level, - int i); - -const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node); - -STACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const - X509_POLICY_NODE - *node); -const X509_POLICY_NODE *X509_policy_node_get0_parent(const X509_POLICY_NODE - *node); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include/openssl/x509v3.h b/libs/win32/openssl/include/openssl/x509v3.h deleted file mode 100644 index f5c61560aa..0000000000 --- a/libs/win32/openssl/include/openssl/x509v3.h +++ /dev/null @@ -1,1055 +0,0 @@ -/* x509v3.h */ -/* - * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project - * 1999. - */ -/* ==================================================================== - * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -#ifndef HEADER_X509V3_H -# define HEADER_X509V3_H - -# include -# include -# include - -#ifdef __cplusplus -extern "C" { -#endif - -# ifdef OPENSSL_SYS_WIN32 -/* Under Win32 these are defined in wincrypt.h */ -# undef X509_NAME -# undef X509_CERT_PAIR -# undef X509_EXTENSIONS -# endif - -/* Forward reference */ -struct v3_ext_method; -struct v3_ext_ctx; - -/* Useful typedefs */ - -typedef void *(*X509V3_EXT_NEW)(void); -typedef void (*X509V3_EXT_FREE) (void *); -typedef void *(*X509V3_EXT_D2I)(void *, const unsigned char **, long); -typedef int (*X509V3_EXT_I2D) (void *, unsigned char **); -typedef STACK_OF(CONF_VALUE) * - (*X509V3_EXT_I2V) (const struct v3_ext_method *method, void *ext, - STACK_OF(CONF_VALUE) *extlist); -typedef void *(*X509V3_EXT_V2I)(const struct v3_ext_method *method, - struct v3_ext_ctx *ctx, - STACK_OF(CONF_VALUE) *values); -typedef char *(*X509V3_EXT_I2S)(const struct v3_ext_method *method, - void *ext); -typedef void *(*X509V3_EXT_S2I)(const struct v3_ext_method *method, - struct v3_ext_ctx *ctx, const char *str); -typedef int (*X509V3_EXT_I2R) (const struct v3_ext_method *method, void *ext, - BIO *out, int indent); -typedef void *(*X509V3_EXT_R2I)(const struct v3_ext_method *method, - struct v3_ext_ctx *ctx, const char *str); - -/* V3 extension structure */ - -struct v3_ext_method { - int ext_nid; - int ext_flags; -/* If this is set the following four fields are ignored */ - ASN1_ITEM_EXP *it; -/* Old style ASN1 calls */ - X509V3_EXT_NEW ext_new; - X509V3_EXT_FREE ext_free; - X509V3_EXT_D2I d2i; - X509V3_EXT_I2D i2d; -/* The following pair is used for string extensions */ - X509V3_EXT_I2S i2s; - X509V3_EXT_S2I s2i; -/* The following pair is used for multi-valued extensions */ - X509V3_EXT_I2V i2v; - X509V3_EXT_V2I v2i; -/* The following are used for raw extensions */ - X509V3_EXT_I2R i2r; - X509V3_EXT_R2I r2i; - void *usr_data; /* Any extension specific data */ -}; - -typedef struct X509V3_CONF_METHOD_st { - char *(*get_string) (void *db, char *section, char *value); - STACK_OF(CONF_VALUE) *(*get_section) (void *db, char *section); - void (*free_string) (void *db, char *string); - void (*free_section) (void *db, STACK_OF(CONF_VALUE) *section); -} X509V3_CONF_METHOD; - -/* Context specific info */ -struct v3_ext_ctx { -# define CTX_TEST 0x1 - int flags; - X509 *issuer_cert; - X509 *subject_cert; - X509_REQ *subject_req; - X509_CRL *crl; - X509V3_CONF_METHOD *db_meth; - void *db; -/* Maybe more here */ -}; - -typedef struct v3_ext_method X509V3_EXT_METHOD; - -DECLARE_STACK_OF(X509V3_EXT_METHOD) - -/* ext_flags values */ -# define X509V3_EXT_DYNAMIC 0x1 -# define X509V3_EXT_CTX_DEP 0x2 -# define X509V3_EXT_MULTILINE 0x4 - -typedef BIT_STRING_BITNAME ENUMERATED_NAMES; - -typedef struct BASIC_CONSTRAINTS_st { - int ca; - ASN1_INTEGER *pathlen; -} BASIC_CONSTRAINTS; - -typedef struct PKEY_USAGE_PERIOD_st { - ASN1_GENERALIZEDTIME *notBefore; - ASN1_GENERALIZEDTIME *notAfter; -} PKEY_USAGE_PERIOD; - -typedef struct otherName_st { - ASN1_OBJECT *type_id; - ASN1_TYPE *value; -} OTHERNAME; - -typedef struct EDIPartyName_st { - ASN1_STRING *nameAssigner; - ASN1_STRING *partyName; -} EDIPARTYNAME; - -typedef struct GENERAL_NAME_st { -# define GEN_OTHERNAME 0 -# define GEN_EMAIL 1 -# define GEN_DNS 2 -# define GEN_X400 3 -# define GEN_DIRNAME 4 -# define GEN_EDIPARTY 5 -# define GEN_URI 6 -# define GEN_IPADD 7 -# define GEN_RID 8 - int type; - union { - char *ptr; - OTHERNAME *otherName; /* otherName */ - ASN1_IA5STRING *rfc822Name; - ASN1_IA5STRING *dNSName; - ASN1_TYPE *x400Address; - X509_NAME *directoryName; - EDIPARTYNAME *ediPartyName; - ASN1_IA5STRING *uniformResourceIdentifier; - ASN1_OCTET_STRING *iPAddress; - ASN1_OBJECT *registeredID; - /* Old names */ - ASN1_OCTET_STRING *ip; /* iPAddress */ - X509_NAME *dirn; /* dirn */ - ASN1_IA5STRING *ia5; /* rfc822Name, dNSName, - * uniformResourceIdentifier */ - ASN1_OBJECT *rid; /* registeredID */ - ASN1_TYPE *other; /* x400Address */ - } d; -} GENERAL_NAME; - -typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES; - -typedef struct ACCESS_DESCRIPTION_st { - ASN1_OBJECT *method; - GENERAL_NAME *location; -} ACCESS_DESCRIPTION; - -typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS; - -typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE; - -DECLARE_STACK_OF(GENERAL_NAME) -DECLARE_ASN1_SET_OF(GENERAL_NAME) - -DECLARE_STACK_OF(ACCESS_DESCRIPTION) -DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) - -typedef struct DIST_POINT_NAME_st { - int type; - union { - GENERAL_NAMES *fullname; - STACK_OF(X509_NAME_ENTRY) *relativename; - } name; -/* If relativename then this contains the full distribution point name */ - X509_NAME *dpname; -} DIST_POINT_NAME; -/* All existing reasons */ -# define CRLDP_ALL_REASONS 0x807f - -# define CRL_REASON_NONE -1 -# define CRL_REASON_UNSPECIFIED 0 -# define CRL_REASON_KEY_COMPROMISE 1 -# define CRL_REASON_CA_COMPROMISE 2 -# define CRL_REASON_AFFILIATION_CHANGED 3 -# define CRL_REASON_SUPERSEDED 4 -# define CRL_REASON_CESSATION_OF_OPERATION 5 -# define CRL_REASON_CERTIFICATE_HOLD 6 -# define CRL_REASON_REMOVE_FROM_CRL 8 -# define CRL_REASON_PRIVILEGE_WITHDRAWN 9 -# define CRL_REASON_AA_COMPROMISE 10 - -struct DIST_POINT_st { - DIST_POINT_NAME *distpoint; - ASN1_BIT_STRING *reasons; - GENERAL_NAMES *CRLissuer; - int dp_reasons; -}; - -typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; - -DECLARE_STACK_OF(DIST_POINT) -DECLARE_ASN1_SET_OF(DIST_POINT) - -struct AUTHORITY_KEYID_st { - ASN1_OCTET_STRING *keyid; - GENERAL_NAMES *issuer; - ASN1_INTEGER *serial; -}; - -/* Strong extranet structures */ - -typedef struct SXNET_ID_st { - ASN1_INTEGER *zone; - ASN1_OCTET_STRING *user; -} SXNETID; - -DECLARE_STACK_OF(SXNETID) -DECLARE_ASN1_SET_OF(SXNETID) - -typedef struct SXNET_st { - ASN1_INTEGER *version; - STACK_OF(SXNETID) *ids; -} SXNET; - -typedef struct NOTICEREF_st { - ASN1_STRING *organization; - STACK_OF(ASN1_INTEGER) *noticenos; -} NOTICEREF; - -typedef struct USERNOTICE_st { - NOTICEREF *noticeref; - ASN1_STRING *exptext; -} USERNOTICE; - -typedef struct POLICYQUALINFO_st { - ASN1_OBJECT *pqualid; - union { - ASN1_IA5STRING *cpsuri; - USERNOTICE *usernotice; - ASN1_TYPE *other; - } d; -} POLICYQUALINFO; - -DECLARE_STACK_OF(POLICYQUALINFO) -DECLARE_ASN1_SET_OF(POLICYQUALINFO) - -typedef struct POLICYINFO_st { - ASN1_OBJECT *policyid; - STACK_OF(POLICYQUALINFO) *qualifiers; -} POLICYINFO; - -typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES; - -DECLARE_STACK_OF(POLICYINFO) -DECLARE_ASN1_SET_OF(POLICYINFO) - -typedef struct POLICY_MAPPING_st { - ASN1_OBJECT *issuerDomainPolicy; - ASN1_OBJECT *subjectDomainPolicy; -} POLICY_MAPPING; - -DECLARE_STACK_OF(POLICY_MAPPING) - -typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS; - -typedef struct GENERAL_SUBTREE_st { - GENERAL_NAME *base; - ASN1_INTEGER *minimum; - ASN1_INTEGER *maximum; -} GENERAL_SUBTREE; - -DECLARE_STACK_OF(GENERAL_SUBTREE) - -struct NAME_CONSTRAINTS_st { - STACK_OF(GENERAL_SUBTREE) *permittedSubtrees; - STACK_OF(GENERAL_SUBTREE) *excludedSubtrees; -}; - -typedef struct POLICY_CONSTRAINTS_st { - ASN1_INTEGER *requireExplicitPolicy; - ASN1_INTEGER *inhibitPolicyMapping; -} POLICY_CONSTRAINTS; - -/* Proxy certificate structures, see RFC 3820 */ -typedef struct PROXY_POLICY_st { - ASN1_OBJECT *policyLanguage; - ASN1_OCTET_STRING *policy; -} PROXY_POLICY; - -typedef struct PROXY_CERT_INFO_EXTENSION_st { - ASN1_INTEGER *pcPathLengthConstraint; - PROXY_POLICY *proxyPolicy; -} PROXY_CERT_INFO_EXTENSION; - -DECLARE_ASN1_FUNCTIONS(PROXY_POLICY) -DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION) - -struct ISSUING_DIST_POINT_st { - DIST_POINT_NAME *distpoint; - int onlyuser; - int onlyCA; - ASN1_BIT_STRING *onlysomereasons; - int indirectCRL; - int onlyattr; -}; - -/* Values in idp_flags field */ -/* IDP present */ -# define IDP_PRESENT 0x1 -/* IDP values inconsistent */ -# define IDP_INVALID 0x2 -/* onlyuser true */ -# define IDP_ONLYUSER 0x4 -/* onlyCA true */ -# define IDP_ONLYCA 0x8 -/* onlyattr true */ -# define IDP_ONLYATTR 0x10 -/* indirectCRL true */ -# define IDP_INDIRECT 0x20 -/* onlysomereasons present */ -# define IDP_REASONS 0x40 - -# define X509V3_conf_err(val) ERR_add_error_data(6, "section:", val->section, \ -",name:", val->name, ",value:", val->value); - -# define X509V3_set_ctx_test(ctx) \ - X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST) -# define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL; - -# define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \ - 0,0,0,0, \ - 0,0, \ - (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \ - (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \ - NULL, NULL, \ - table} - -# define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \ - 0,0,0,0, \ - (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \ - (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \ - 0,0,0,0, \ - NULL} - -# define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - -/* X509_PURPOSE stuff */ - -# define EXFLAG_BCONS 0x1 -# define EXFLAG_KUSAGE 0x2 -# define EXFLAG_XKUSAGE 0x4 -# define EXFLAG_NSCERT 0x8 - -# define EXFLAG_CA 0x10 -/* Really self issued not necessarily self signed */ -# define EXFLAG_SI 0x20 -# define EXFLAG_V1 0x40 -# define EXFLAG_INVALID 0x80 -# define EXFLAG_SET 0x100 -# define EXFLAG_CRITICAL 0x200 -# define EXFLAG_PROXY 0x400 - -# define EXFLAG_INVALID_POLICY 0x800 -# define EXFLAG_FRESHEST 0x1000 -/* Self signed */ -# define EXFLAG_SS 0x2000 - -# define KU_DIGITAL_SIGNATURE 0x0080 -# define KU_NON_REPUDIATION 0x0040 -# define KU_KEY_ENCIPHERMENT 0x0020 -# define KU_DATA_ENCIPHERMENT 0x0010 -# define KU_KEY_AGREEMENT 0x0008 -# define KU_KEY_CERT_SIGN 0x0004 -# define KU_CRL_SIGN 0x0002 -# define KU_ENCIPHER_ONLY 0x0001 -# define KU_DECIPHER_ONLY 0x8000 - -# define NS_SSL_CLIENT 0x80 -# define NS_SSL_SERVER 0x40 -# define NS_SMIME 0x20 -# define NS_OBJSIGN 0x10 -# define NS_SSL_CA 0x04 -# define NS_SMIME_CA 0x02 -# define NS_OBJSIGN_CA 0x01 -# define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA) - -# define XKU_SSL_SERVER 0x1 -# define XKU_SSL_CLIENT 0x2 -# define XKU_SMIME 0x4 -# define XKU_CODE_SIGN 0x8 -# define XKU_SGC 0x10 -# define XKU_OCSP_SIGN 0x20 -# define XKU_TIMESTAMP 0x40 -# define XKU_DVCS 0x80 -# define XKU_ANYEKU 0x100 - -# define X509_PURPOSE_DYNAMIC 0x1 -# define X509_PURPOSE_DYNAMIC_NAME 0x2 - -typedef struct x509_purpose_st { - int purpose; - int trust; /* Default trust ID */ - int flags; - int (*check_purpose) (const struct x509_purpose_st *, const X509 *, int); - char *name; - char *sname; - void *usr_data; -} X509_PURPOSE; - -# define X509_PURPOSE_SSL_CLIENT 1 -# define X509_PURPOSE_SSL_SERVER 2 -# define X509_PURPOSE_NS_SSL_SERVER 3 -# define X509_PURPOSE_SMIME_SIGN 4 -# define X509_PURPOSE_SMIME_ENCRYPT 5 -# define X509_PURPOSE_CRL_SIGN 6 -# define X509_PURPOSE_ANY 7 -# define X509_PURPOSE_OCSP_HELPER 8 -# define X509_PURPOSE_TIMESTAMP_SIGN 9 - -# define X509_PURPOSE_MIN 1 -# define X509_PURPOSE_MAX 9 - -/* Flags for X509V3_EXT_print() */ - -# define X509V3_EXT_UNKNOWN_MASK (0xfL << 16) -/* Return error for unknown extensions */ -# define X509V3_EXT_DEFAULT 0 -/* Print error for unknown extensions */ -# define X509V3_EXT_ERROR_UNKNOWN (1L << 16) -/* ASN1 parse unknown extensions */ -# define X509V3_EXT_PARSE_UNKNOWN (2L << 16) -/* BIO_dump unknown extensions */ -# define X509V3_EXT_DUMP_UNKNOWN (3L << 16) - -/* Flags for X509V3_add1_i2d */ - -# define X509V3_ADD_OP_MASK 0xfL -# define X509V3_ADD_DEFAULT 0L -# define X509V3_ADD_APPEND 1L -# define X509V3_ADD_REPLACE 2L -# define X509V3_ADD_REPLACE_EXISTING 3L -# define X509V3_ADD_KEEP_EXISTING 4L -# define X509V3_ADD_DELETE 5L -# define X509V3_ADD_SILENT 0x10 - -DECLARE_STACK_OF(X509_PURPOSE) - -DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS) - -DECLARE_ASN1_FUNCTIONS(SXNET) -DECLARE_ASN1_FUNCTIONS(SXNETID) - -int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen); -int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, - int userlen); -int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, - int userlen); - -ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone); -ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone); -ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone); - -DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID) - -DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) - -DECLARE_ASN1_FUNCTIONS(GENERAL_NAME) -GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a); -int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b); - -ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, - X509V3_CTX *ctx, - STACK_OF(CONF_VALUE) *nval); -STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, - ASN1_BIT_STRING *bits, - STACK_OF(CONF_VALUE) *extlist); - -STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, - GENERAL_NAME *gen, - STACK_OF(CONF_VALUE) *ret); -int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen); - -DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES) - -STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, - GENERAL_NAMES *gen, - STACK_OF(CONF_VALUE) *extlist); -GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, - X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); - -DECLARE_ASN1_FUNCTIONS(OTHERNAME) -DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) -int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b); -void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value); -void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype); -int GENERAL_NAME_set0_othername(GENERAL_NAME *gen, - ASN1_OBJECT *oid, ASN1_TYPE *value); -int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen, - ASN1_OBJECT **poid, ASN1_TYPE **pvalue); - -char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, - ASN1_OCTET_STRING *ia5); -ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, - X509V3_CTX *ctx, char *str); - -DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) -int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION *a); - -DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) -DECLARE_ASN1_FUNCTIONS(POLICYINFO) -DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO) -DECLARE_ASN1_FUNCTIONS(USERNOTICE) -DECLARE_ASN1_FUNCTIONS(NOTICEREF) - -DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) -DECLARE_ASN1_FUNCTIONS(DIST_POINT) -DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) -DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT) - -int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname); - -int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc); - -DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) -DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) - -DECLARE_ASN1_ITEM(POLICY_MAPPING) -DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING) -DECLARE_ASN1_ITEM(POLICY_MAPPINGS) - -DECLARE_ASN1_ITEM(GENERAL_SUBTREE) -DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE) - -DECLARE_ASN1_ITEM(NAME_CONSTRAINTS) -DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) - -DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) -DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) - -GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, - const X509V3_EXT_METHOD *method, - X509V3_CTX *ctx, int gen_type, char *value, - int is_nc); - -# ifdef HEADER_CONF_H -GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, - X509V3_CTX *ctx, CONF_VALUE *cnf); -GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, - const X509V3_EXT_METHOD *method, - X509V3_CTX *ctx, CONF_VALUE *cnf, - int is_nc); -void X509V3_conf_free(CONF_VALUE *val); - -X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, - char *value); -X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, - char *value); -int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, - STACK_OF(X509_EXTENSION) **sk); -int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, - X509 *cert); -int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, - X509_REQ *req); -int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, - X509_CRL *crl); - -X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, - X509V3_CTX *ctx, int ext_nid, - char *value); -X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *name, char *value); -int X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *section, X509 *cert); -int X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *section, X509_REQ *req); -int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *section, X509_CRL *crl); - -int X509V3_add_value_bool_nf(char *name, int asn1_bool, - STACK_OF(CONF_VALUE) **extlist); -int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); -int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint); -void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf); -void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash); -# endif - -char *X509V3_get_string(X509V3_CTX *ctx, char *name, char *section); -STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, char *section); -void X509V3_string_free(X509V3_CTX *ctx, char *str); -void X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section); -void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject, - X509_REQ *req, X509_CRL *crl, int flags); - -int X509V3_add_value(const char *name, const char *value, - STACK_OF(CONF_VALUE) **extlist); -int X509V3_add_value_uchar(const char *name, const unsigned char *value, - STACK_OF(CONF_VALUE) **extlist); -int X509V3_add_value_bool(const char *name, int asn1_bool, - STACK_OF(CONF_VALUE) **extlist); -int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, - STACK_OF(CONF_VALUE) **extlist); -char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint); -ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value); -char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); -char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, - ASN1_ENUMERATED *aint); -int X509V3_EXT_add(X509V3_EXT_METHOD *ext); -int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist); -int X509V3_EXT_add_alias(int nid_to, int nid_from); -void X509V3_EXT_cleanup(void); - -const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext); -const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); -int X509V3_add_standard_extensions(void); -STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line); -void *X509V3_EXT_d2i(X509_EXTENSION *ext); -void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, - int *idx); -int X509V3_EXT_free(int nid, void *ext_data); - -X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); -int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, - int crit, unsigned long flags); - -char *hex_to_string(const unsigned char *buffer, long len); -unsigned char *string_to_hex(const char *str, long *len); -int name_cmp(const char *name, const char *cmp); - -void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, - int ml); -int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, - int indent); -int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent); - -int X509V3_extensions_print(BIO *out, char *title, - STACK_OF(X509_EXTENSION) *exts, - unsigned long flag, int indent); - -int X509_check_ca(X509 *x); -int X509_check_purpose(X509 *x, int id, int ca); -int X509_supported_extension(X509_EXTENSION *ex); -int X509_PURPOSE_set(int *p, int purpose); -int X509_check_issued(X509 *issuer, X509 *subject); -int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); -int X509_PURPOSE_get_count(void); -X509_PURPOSE *X509_PURPOSE_get0(int idx); -int X509_PURPOSE_get_by_sname(char *sname); -int X509_PURPOSE_get_by_id(int id); -int X509_PURPOSE_add(int id, int trust, int flags, - int (*ck) (const X509_PURPOSE *, const X509 *, int), - char *name, char *sname, void *arg); -char *X509_PURPOSE_get0_name(X509_PURPOSE *xp); -char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp); -int X509_PURPOSE_get_trust(X509_PURPOSE *xp); -void X509_PURPOSE_cleanup(void); -int X509_PURPOSE_get_id(X509_PURPOSE *); - -STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x); -STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x); -void X509_email_free(STACK_OF(OPENSSL_STRING) *sk); -STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); -/* Flags for X509_check_* functions */ - -/* - * Always check subject name for host match even if subject alt names present - */ -# define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0x1 -/* Disable wildcard matching for dnsName fields and common name. */ -# define X509_CHECK_FLAG_NO_WILDCARDS 0x2 -/* Wildcards must not match a partial label. */ -# define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0x4 -/* Allow (non-partial) wildcards to match multiple labels. */ -# define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8 -/* Constraint verifier subdomain patterns to match a single labels. */ -# define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10 -/* - * Match reference identifiers starting with "." to any sub-domain. - * This is a non-public flag, turned on implicitly when the subject - * reference identity is a DNS name. - */ -# define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000 - -int X509_check_host(X509 *x, const char *chk, size_t chklen, - unsigned int flags, char **peername); -int X509_check_email(X509 *x, const char *chk, size_t chklen, - unsigned int flags); -int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen, - unsigned int flags); -int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags); - -ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc); -ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc); -int a2i_ipadd(unsigned char *ipout, const char *ipasc); -int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk, - unsigned long chtype); - -void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent); -DECLARE_STACK_OF(X509_POLICY_NODE) - -# ifndef OPENSSL_NO_RFC3779 - -typedef struct ASRange_st { - ASN1_INTEGER *min, *max; -} ASRange; - -# define ASIdOrRange_id 0 -# define ASIdOrRange_range 1 - -typedef struct ASIdOrRange_st { - int type; - union { - ASN1_INTEGER *id; - ASRange *range; - } u; -} ASIdOrRange; - -typedef STACK_OF(ASIdOrRange) ASIdOrRanges; -DECLARE_STACK_OF(ASIdOrRange) - -# define ASIdentifierChoice_inherit 0 -# define ASIdentifierChoice_asIdsOrRanges 1 - -typedef struct ASIdentifierChoice_st { - int type; - union { - ASN1_NULL *inherit; - ASIdOrRanges *asIdsOrRanges; - } u; -} ASIdentifierChoice; - -typedef struct ASIdentifiers_st { - ASIdentifierChoice *asnum, *rdi; -} ASIdentifiers; - -DECLARE_ASN1_FUNCTIONS(ASRange) -DECLARE_ASN1_FUNCTIONS(ASIdOrRange) -DECLARE_ASN1_FUNCTIONS(ASIdentifierChoice) -DECLARE_ASN1_FUNCTIONS(ASIdentifiers) - -typedef struct IPAddressRange_st { - ASN1_BIT_STRING *min, *max; -} IPAddressRange; - -# define IPAddressOrRange_addressPrefix 0 -# define IPAddressOrRange_addressRange 1 - -typedef struct IPAddressOrRange_st { - int type; - union { - ASN1_BIT_STRING *addressPrefix; - IPAddressRange *addressRange; - } u; -} IPAddressOrRange; - -typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges; -DECLARE_STACK_OF(IPAddressOrRange) - -# define IPAddressChoice_inherit 0 -# define IPAddressChoice_addressesOrRanges 1 - -typedef struct IPAddressChoice_st { - int type; - union { - ASN1_NULL *inherit; - IPAddressOrRanges *addressesOrRanges; - } u; -} IPAddressChoice; - -typedef struct IPAddressFamily_st { - ASN1_OCTET_STRING *addressFamily; - IPAddressChoice *ipAddressChoice; -} IPAddressFamily; - -typedef STACK_OF(IPAddressFamily) IPAddrBlocks; -DECLARE_STACK_OF(IPAddressFamily) - -DECLARE_ASN1_FUNCTIONS(IPAddressRange) -DECLARE_ASN1_FUNCTIONS(IPAddressOrRange) -DECLARE_ASN1_FUNCTIONS(IPAddressChoice) -DECLARE_ASN1_FUNCTIONS(IPAddressFamily) - -/* - * API tag for elements of the ASIdentifer SEQUENCE. - */ -# define V3_ASID_ASNUM 0 -# define V3_ASID_RDI 1 - -/* - * AFI values, assigned by IANA. It'd be nice to make the AFI - * handling code totally generic, but there are too many little things - * that would need to be defined for other address families for it to - * be worth the trouble. - */ -# define IANA_AFI_IPV4 1 -# define IANA_AFI_IPV6 2 - -/* - * Utilities to construct and extract values from RFC3779 extensions, - * since some of the encodings (particularly for IP address prefixes - * and ranges) are a bit tedious to work with directly. - */ -int v3_asid_add_inherit(ASIdentifiers *asid, int which); -int v3_asid_add_id_or_range(ASIdentifiers *asid, int which, - ASN1_INTEGER *min, ASN1_INTEGER *max); -int v3_addr_add_inherit(IPAddrBlocks *addr, - const unsigned afi, const unsigned *safi); -int v3_addr_add_prefix(IPAddrBlocks *addr, - const unsigned afi, const unsigned *safi, - unsigned char *a, const int prefixlen); -int v3_addr_add_range(IPAddrBlocks *addr, - const unsigned afi, const unsigned *safi, - unsigned char *min, unsigned char *max); -unsigned v3_addr_get_afi(const IPAddressFamily *f); -int v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi, - unsigned char *min, unsigned char *max, - const int length); - -/* - * Canonical forms. - */ -int v3_asid_is_canonical(ASIdentifiers *asid); -int v3_addr_is_canonical(IPAddrBlocks *addr); -int v3_asid_canonize(ASIdentifiers *asid); -int v3_addr_canonize(IPAddrBlocks *addr); - -/* - * Tests for inheritance and containment. - */ -int v3_asid_inherits(ASIdentifiers *asid); -int v3_addr_inherits(IPAddrBlocks *addr); -int v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b); -int v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b); - -/* - * Check whether RFC 3779 extensions nest properly in chains. - */ -int v3_asid_validate_path(X509_STORE_CTX *); -int v3_addr_validate_path(X509_STORE_CTX *); -int v3_asid_validate_resource_set(STACK_OF(X509) *chain, - ASIdentifiers *ext, int allow_inheritance); -int v3_addr_validate_resource_set(STACK_OF(X509) *chain, - IPAddrBlocks *ext, int allow_inheritance); - -# endif /* OPENSSL_NO_RFC3779 */ - -/* BEGIN ERROR CODES */ -/* - * The following lines are auto generated by the script mkerr.pl. Any changes - * made after this point may be overwritten when the script is next run. - */ -void ERR_load_X509V3_strings(void); - -/* Error codes for the X509V3 functions. */ - -/* Function codes. */ -# define X509V3_F_A2I_GENERAL_NAME 164 -# define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 161 -# define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 162 -# define X509V3_F_COPY_EMAIL 122 -# define X509V3_F_COPY_ISSUER 123 -# define X509V3_F_DO_DIRNAME 144 -# define X509V3_F_DO_EXT_CONF 124 -# define X509V3_F_DO_EXT_I2D 135 -# define X509V3_F_DO_EXT_NCONF 151 -# define X509V3_F_DO_I2V_NAME_CONSTRAINTS 148 -# define X509V3_F_GNAMES_FROM_SECTNAME 156 -# define X509V3_F_HEX_TO_STRING 111 -# define X509V3_F_I2S_ASN1_ENUMERATED 121 -# define X509V3_F_I2S_ASN1_IA5STRING 149 -# define X509V3_F_I2S_ASN1_INTEGER 120 -# define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 138 -# define X509V3_F_NOTICE_SECTION 132 -# define X509V3_F_NREF_NOS 133 -# define X509V3_F_POLICY_SECTION 131 -# define X509V3_F_PROCESS_PCI_VALUE 150 -# define X509V3_F_R2I_CERTPOL 130 -# define X509V3_F_R2I_PCI 155 -# define X509V3_F_S2I_ASN1_IA5STRING 100 -# define X509V3_F_S2I_ASN1_INTEGER 108 -# define X509V3_F_S2I_ASN1_OCTET_STRING 112 -# define X509V3_F_S2I_ASN1_SKEY_ID 114 -# define X509V3_F_S2I_SKEY_ID 115 -# define X509V3_F_SET_DIST_POINT_NAME 158 -# define X509V3_F_STRING_TO_HEX 113 -# define X509V3_F_SXNET_ADD_ID_ASC 125 -# define X509V3_F_SXNET_ADD_ID_INTEGER 126 -# define X509V3_F_SXNET_ADD_ID_ULONG 127 -# define X509V3_F_SXNET_GET_ID_ASC 128 -# define X509V3_F_SXNET_GET_ID_ULONG 129 -# define X509V3_F_V2I_ASIDENTIFIERS 163 -# define X509V3_F_V2I_ASN1_BIT_STRING 101 -# define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139 -# define X509V3_F_V2I_AUTHORITY_KEYID 119 -# define X509V3_F_V2I_BASIC_CONSTRAINTS 102 -# define X509V3_F_V2I_CRLD 134 -# define X509V3_F_V2I_EXTENDED_KEY_USAGE 103 -# define X509V3_F_V2I_GENERAL_NAMES 118 -# define X509V3_F_V2I_GENERAL_NAME_EX 117 -# define X509V3_F_V2I_IDP 157 -# define X509V3_F_V2I_IPADDRBLOCKS 159 -# define X509V3_F_V2I_ISSUER_ALT 153 -# define X509V3_F_V2I_NAME_CONSTRAINTS 147 -# define X509V3_F_V2I_POLICY_CONSTRAINTS 146 -# define X509V3_F_V2I_POLICY_MAPPINGS 145 -# define X509V3_F_V2I_SUBJECT_ALT 154 -# define X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL 160 -# define X509V3_F_V3_GENERIC_EXTENSION 116 -# define X509V3_F_X509V3_ADD1_I2D 140 -# define X509V3_F_X509V3_ADD_VALUE 105 -# define X509V3_F_X509V3_EXT_ADD 104 -# define X509V3_F_X509V3_EXT_ADD_ALIAS 106 -# define X509V3_F_X509V3_EXT_CONF 107 -# define X509V3_F_X509V3_EXT_FREE 165 -# define X509V3_F_X509V3_EXT_I2D 136 -# define X509V3_F_X509V3_EXT_NCONF 152 -# define X509V3_F_X509V3_GET_SECTION 142 -# define X509V3_F_X509V3_GET_STRING 143 -# define X509V3_F_X509V3_GET_VALUE_BOOL 110 -# define X509V3_F_X509V3_PARSE_LIST 109 -# define X509V3_F_X509_PURPOSE_ADD 137 -# define X509V3_F_X509_PURPOSE_SET 141 - -/* Reason codes. */ -# define X509V3_R_BAD_IP_ADDRESS 118 -# define X509V3_R_BAD_OBJECT 119 -# define X509V3_R_BN_DEC2BN_ERROR 100 -# define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101 -# define X509V3_R_CANNOT_FIND_FREE_FUNCTION 168 -# define X509V3_R_DIRNAME_ERROR 149 -# define X509V3_R_DISTPOINT_ALREADY_SET 160 -# define X509V3_R_DUPLICATE_ZONE_ID 133 -# define X509V3_R_ERROR_CONVERTING_ZONE 131 -# define X509V3_R_ERROR_CREATING_EXTENSION 144 -# define X509V3_R_ERROR_IN_EXTENSION 128 -# define X509V3_R_EXPECTED_A_SECTION_NAME 137 -# define X509V3_R_EXTENSION_EXISTS 145 -# define X509V3_R_EXTENSION_NAME_ERROR 115 -# define X509V3_R_EXTENSION_NOT_FOUND 102 -# define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103 -# define X509V3_R_EXTENSION_VALUE_ERROR 116 -# define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151 -# define X509V3_R_ILLEGAL_HEX_DIGIT 113 -# define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152 -# define X509V3_R_INVALID_ASNUMBER 162 -# define X509V3_R_INVALID_ASRANGE 163 -# define X509V3_R_INVALID_BOOLEAN_STRING 104 -# define X509V3_R_INVALID_EXTENSION_STRING 105 -# define X509V3_R_INVALID_INHERITANCE 165 -# define X509V3_R_INVALID_IPADDRESS 166 -# define X509V3_R_INVALID_MULTIPLE_RDNS 161 -# define X509V3_R_INVALID_NAME 106 -# define X509V3_R_INVALID_NULL_ARGUMENT 107 -# define X509V3_R_INVALID_NULL_NAME 108 -# define X509V3_R_INVALID_NULL_VALUE 109 -# define X509V3_R_INVALID_NUMBER 140 -# define X509V3_R_INVALID_NUMBERS 141 -# define X509V3_R_INVALID_OBJECT_IDENTIFIER 110 -# define X509V3_R_INVALID_OPTION 138 -# define X509V3_R_INVALID_POLICY_IDENTIFIER 134 -# define X509V3_R_INVALID_PROXY_POLICY_SETTING 153 -# define X509V3_R_INVALID_PURPOSE 146 -# define X509V3_R_INVALID_SAFI 164 -# define X509V3_R_INVALID_SECTION 135 -# define X509V3_R_INVALID_SYNTAX 143 -# define X509V3_R_ISSUER_DECODE_ERROR 126 -# define X509V3_R_MISSING_VALUE 124 -# define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142 -# define X509V3_R_NO_CONFIG_DATABASE 136 -# define X509V3_R_NO_ISSUER_CERTIFICATE 121 -# define X509V3_R_NO_ISSUER_DETAILS 127 -# define X509V3_R_NO_POLICY_IDENTIFIER 139 -# define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154 -# define X509V3_R_NO_PUBLIC_KEY 114 -# define X509V3_R_NO_SUBJECT_DETAILS 125 -# define X509V3_R_ODD_NUMBER_OF_DIGITS 112 -# define X509V3_R_OPERATION_NOT_DEFINED 148 -# define X509V3_R_OTHERNAME_ERROR 147 -# define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED 155 -# define X509V3_R_POLICY_PATH_LENGTH 156 -# define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED 157 -# define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED 158 -# define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159 -# define X509V3_R_SECTION_NOT_FOUND 150 -# define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122 -# define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123 -# define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111 -# define X509V3_R_UNKNOWN_EXTENSION 129 -# define X509V3_R_UNKNOWN_EXTENSION_NAME 130 -# define X509V3_R_UNKNOWN_OPTION 120 -# define X509V3_R_UNSUPPORTED_OPTION 117 -# define X509V3_R_UNSUPPORTED_TYPE 167 -# define X509V3_R_USER_TOO_LONG 132 - -#ifdef __cplusplus -} -#endif -#endif diff --git a/libs/win32/openssl/include_x64/buildinf.h b/libs/win32/openssl/include_x64/buildinf.h deleted file mode 100644 index cd005afec4..0000000000 --- a/libs/win32/openssl/include_x64/buildinf.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef MK1MF_BUILD - /* auto-generated by Configure for crypto/cversion.c: - * for Unix builds, crypto/Makefile.ssl generates functional definitions; - * Windows builds (and other mk1mf builds) compile cversion.c with - * -DMK1MF_BUILD and use definitions added to this file by util/mk1mf.pl. */ - #error "Windows builds (PLATFORM=VC-WIN64A) use mk1mf.pl-created Makefiles" -#endif diff --git a/libs/win32/openssl/include_x64/openssl/opensslconf.h b/libs/win32/openssl/include_x64/openssl/opensslconf.h deleted file mode 100644 index 83a21939a2..0000000000 --- a/libs/win32/openssl/include_x64/openssl/opensslconf.h +++ /dev/null @@ -1,272 +0,0 @@ -/* opensslconf.h */ -/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ - -#ifdef __cplusplus -extern "C" { -#endif -/* OpenSSL was configured with the following options: */ -#ifndef OPENSSL_SYSNAME_WIN64A -# define OPENSSL_SYSNAME_WIN64A -#endif -#ifndef OPENSSL_DOING_MAKEDEPEND - - -#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 -# define OPENSSL_NO_EC_NISTP_64_GCC_128 -#endif -#ifndef OPENSSL_NO_GMP -# define OPENSSL_NO_GMP -#endif -#ifndef OPENSSL_NO_JPAKE -# define OPENSSL_NO_JPAKE -#endif -#ifndef OPENSSL_NO_KRB5 -# define OPENSSL_NO_KRB5 -#endif -#ifndef OPENSSL_NO_LIBUNBOUND -# define OPENSSL_NO_LIBUNBOUND -#endif -#ifndef OPENSSL_NO_MD2 -# define OPENSSL_NO_MD2 -#endif -#ifndef OPENSSL_NO_RC5 -# define OPENSSL_NO_RC5 -#endif -#ifndef OPENSSL_NO_RFC3779 -# define OPENSSL_NO_RFC3779 -#endif -#ifndef OPENSSL_NO_SCTP -# define OPENSSL_NO_SCTP -#endif -#ifndef OPENSSL_NO_SSL_TRACE -# define OPENSSL_NO_SSL_TRACE -#endif -#ifndef OPENSSL_NO_SSL2 -# define OPENSSL_NO_SSL2 -#endif -#ifndef OPENSSL_NO_STORE -# define OPENSSL_NO_STORE -#endif -#ifndef OPENSSL_NO_UNIT_TEST -# define OPENSSL_NO_UNIT_TEST -#endif -#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS -# define OPENSSL_NO_WEAK_SSL_CIPHERS -#endif - -#endif /* OPENSSL_DOING_MAKEDEPEND */ - -#ifndef OPENSSL_THREADS -# define OPENSSL_THREADS -#endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif - -/* The OPENSSL_NO_* macros are also defined as NO_* if the application - asks for it. This is a transient feature that is provided for those - who haven't had the time to do the appropriate changes in their - applications. */ -#ifdef OPENSSL_ALGORITHM_DEFINES -# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) -# define NO_EC_NISTP_64_GCC_128 -# endif -# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) -# define NO_GMP -# endif -# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) -# define NO_JPAKE -# endif -# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) -# define NO_KRB5 -# endif -# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) -# define NO_LIBUNBOUND -# endif -# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) -# define NO_MD2 -# endif -# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) -# define NO_RC5 -# endif -# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) -# define NO_RFC3779 -# endif -# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) -# define NO_SCTP -# endif -# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) -# define NO_SSL_TRACE -# endif -# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) -# define NO_SSL2 -# endif -# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) -# define NO_STORE -# endif -# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) -# define NO_UNIT_TEST -# endif -# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) -# define NO_WEAK_SSL_CIPHERS -# endif -#endif - -/* crypto/opensslconf.h.in */ - -/* Generate 80386 code? */ -#undef I386_ONLY - -#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ -#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) -#define ENGINESDIR "c:\\openssl-VC-WIN64/lib/engines" -#define OPENSSLDIR "c:\\openssl-VC-WIN64/ssl" -#endif -#endif - -#undef OPENSSL_UNISTD -#define OPENSSL_UNISTD - -#undef OPENSSL_EXPORT_VAR_AS_FUNCTION -#define OPENSSL_EXPORT_VAR_AS_FUNCTION - -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_INT unsigned int -#endif - -#if defined(HEADER_MD2_H) && !defined(MD2_INT) -#define MD2_INT unsigned int -#endif - -#if defined(HEADER_RC2_H) && !defined(RC2_INT) -/* I need to put in a mod for the alpha - eay */ -#define RC2_INT unsigned int -#endif - -#if defined(HEADER_RC4_H) -#if !defined(RC4_INT) -/* using int types make the structure larger but make the code faster - * on most boxes I have tested - up to %20 faster. */ -/* - * I don't know what does "most" mean, but declaring "int" is a must on: - * - Intel P6 because partial register stalls are very expensive; - * - elder Alpha because it lacks byte load/store instructions; - */ -#define RC4_INT unsigned int -#endif -#if !defined(RC4_CHUNK) -/* - * This enables code handling data aligned at natural CPU word - * boundary. See crypto/rc4/rc4_enc.c for further details. - */ -#define RC4_CHUNK unsigned long long -#endif -#endif - -#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) -/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a - * %20 speed up (longs are 8 bytes, int's are 4). */ -#ifndef DES_LONG -#define DES_LONG unsigned int -#endif -#endif - -#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) -#define CONFIG_HEADER_BN_H -#undef BN_LLONG - -/* Should we define BN_DIV2W here? */ - -/* Only one for the following should be defined */ -#undef SIXTY_FOUR_BIT_LONG -#define SIXTY_FOUR_BIT -#undef THIRTY_TWO_BIT -#endif - -#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) -#define CONFIG_HEADER_RC4_LOCL_H -/* if this is defined data[i] is used instead of *data, this is a %20 - * speedup on x86 */ -#undef RC4_INDEX -#endif - -#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) -#define CONFIG_HEADER_BF_LOCL_H -#undef BF_PTR -#endif /* HEADER_BF_LOCL_H */ - -#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) -#define CONFIG_HEADER_DES_LOCL_H -#ifndef DES_DEFAULT_OPTIONS -/* the following is tweaked from a config script, that is why it is a - * protected undef/define */ -#ifndef DES_PTR -#undef DES_PTR -#endif - -/* This helps C compiler generate the correct code for multiple functional - * units. It reduces register dependancies at the expense of 2 more - * registers */ -#ifndef DES_RISC1 -#undef DES_RISC1 -#endif - -#ifndef DES_RISC2 -#undef DES_RISC2 -#endif - -#if defined(DES_RISC1) && defined(DES_RISC2) -#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! -#endif - -/* Unroll the inner loop, this sometimes helps, sometimes hinders. - * Very mucy CPU dependant */ -#ifndef DES_UNROLL -#undef DES_UNROLL -#endif - -/* These default values were supplied by - * Peter Gutman - * They are only used if nothing else has been defined */ -#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) -/* Special defines which change the way the code is built depending on the - CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find - even newer MIPS CPU's, but at the moment one size fits all for - optimization options. Older Sparc's work better with only UNROLL, but - there's no way to tell at compile time what it is you're running on */ - -#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ -# define DES_PTR -# define DES_RISC1 -# define DES_UNROLL -#elif defined( __ultrix ) /* Older MIPS */ -# define DES_PTR -# define DES_RISC2 -# define DES_UNROLL -#elif defined( __osf1__ ) /* Alpha */ -# define DES_PTR -# define DES_RISC2 -#elif defined ( _AIX ) /* RS6000 */ - /* Unknown */ -#elif defined( __hpux ) /* HP-PA */ - /* Unknown */ -#elif defined( __aux ) /* 68K */ - /* Unknown */ -#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ -# define DES_UNROLL -#elif defined( __sgi ) /* Newer MIPS */ -# define DES_PTR -# define DES_RISC2 -# define DES_UNROLL -#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ -# define DES_PTR -# define DES_RISC1 -# define DES_UNROLL -#endif /* Systems-specific speed defines */ -#endif - -#endif /* DES_DEFAULT_OPTIONS */ -#endif /* HEADER_DES_LOCL_H */ -#ifdef __cplusplus -} -#endif diff --git a/libs/win32/openssl/include_x86/buildinf.h b/libs/win32/openssl/include_x86/buildinf.h deleted file mode 100644 index bac9879f21..0000000000 --- a/libs/win32/openssl/include_x86/buildinf.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef MK1MF_BUILD - /* auto-generated by Configure for crypto/cversion.c: - * for Unix builds, crypto/Makefile.ssl generates functional definitions; - * Windows builds (and other mk1mf builds) compile cversion.c with - * -DMK1MF_BUILD and use definitions added to this file by util/mk1mf.pl. */ - #error "Windows builds (PLATFORM=VC-WIN32) use mk1mf.pl-created Makefiles" -#endif diff --git a/libs/win32/openssl/include_x86/openssl/opensslconf.h b/libs/win32/openssl/include_x86/openssl/opensslconf.h deleted file mode 100644 index c48adceab3..0000000000 --- a/libs/win32/openssl/include_x86/openssl/opensslconf.h +++ /dev/null @@ -1,272 +0,0 @@ -/* opensslconf.h */ -/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ - -#ifdef __cplusplus -extern "C" { -#endif -/* OpenSSL was configured with the following options: */ -#ifndef OPENSSL_SYSNAME_WIN32 -# define OPENSSL_SYSNAME_WIN32 -#endif -#ifndef OPENSSL_DOING_MAKEDEPEND - - -#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 -# define OPENSSL_NO_EC_NISTP_64_GCC_128 -#endif -#ifndef OPENSSL_NO_GMP -# define OPENSSL_NO_GMP -#endif -#ifndef OPENSSL_NO_JPAKE -# define OPENSSL_NO_JPAKE -#endif -#ifndef OPENSSL_NO_KRB5 -# define OPENSSL_NO_KRB5 -#endif -#ifndef OPENSSL_NO_LIBUNBOUND -# define OPENSSL_NO_LIBUNBOUND -#endif -#ifndef OPENSSL_NO_MD2 -# define OPENSSL_NO_MD2 -#endif -#ifndef OPENSSL_NO_RC5 -# define OPENSSL_NO_RC5 -#endif -#ifndef OPENSSL_NO_RFC3779 -# define OPENSSL_NO_RFC3779 -#endif -#ifndef OPENSSL_NO_SCTP -# define OPENSSL_NO_SCTP -#endif -#ifndef OPENSSL_NO_SSL_TRACE -# define OPENSSL_NO_SSL_TRACE -#endif -#ifndef OPENSSL_NO_SSL2 -# define OPENSSL_NO_SSL2 -#endif -#ifndef OPENSSL_NO_STORE -# define OPENSSL_NO_STORE -#endif -#ifndef OPENSSL_NO_UNIT_TEST -# define OPENSSL_NO_UNIT_TEST -#endif -#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS -# define OPENSSL_NO_WEAK_SSL_CIPHERS -#endif - -#endif /* OPENSSL_DOING_MAKEDEPEND */ - -#ifndef OPENSSL_THREADS -# define OPENSSL_THREADS -#endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif - -/* The OPENSSL_NO_* macros are also defined as NO_* if the application - asks for it. This is a transient feature that is provided for those - who haven't had the time to do the appropriate changes in their - applications. */ -#ifdef OPENSSL_ALGORITHM_DEFINES -# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) -# define NO_EC_NISTP_64_GCC_128 -# endif -# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) -# define NO_GMP -# endif -# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) -# define NO_JPAKE -# endif -# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) -# define NO_KRB5 -# endif -# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) -# define NO_LIBUNBOUND -# endif -# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) -# define NO_MD2 -# endif -# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) -# define NO_RC5 -# endif -# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) -# define NO_RFC3779 -# endif -# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) -# define NO_SCTP -# endif -# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) -# define NO_SSL_TRACE -# endif -# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) -# define NO_SSL2 -# endif -# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) -# define NO_STORE -# endif -# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) -# define NO_UNIT_TEST -# endif -# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) -# define NO_WEAK_SSL_CIPHERS -# endif -#endif - -/* crypto/opensslconf.h.in */ - -/* Generate 80386 code? */ -#undef I386_ONLY - -#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ -#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) -#define ENGINESDIR "c:\\openssl-VC-WIN32/lib/engines" -#define OPENSSLDIR "c:\\openssl-VC-WIN32/ssl" -#endif -#endif - -#undef OPENSSL_UNISTD -#define OPENSSL_UNISTD - -#undef OPENSSL_EXPORT_VAR_AS_FUNCTION -#define OPENSSL_EXPORT_VAR_AS_FUNCTION - -#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) -#define IDEA_INT unsigned int -#endif - -#if defined(HEADER_MD2_H) && !defined(MD2_INT) -#define MD2_INT unsigned int -#endif - -#if defined(HEADER_RC2_H) && !defined(RC2_INT) -/* I need to put in a mod for the alpha - eay */ -#define RC2_INT unsigned int -#endif - -#if defined(HEADER_RC4_H) -#if !defined(RC4_INT) -/* using int types make the structure larger but make the code faster - * on most boxes I have tested - up to %20 faster. */ -/* - * I don't know what does "most" mean, but declaring "int" is a must on: - * - Intel P6 because partial register stalls are very expensive; - * - elder Alpha because it lacks byte load/store instructions; - */ -#define RC4_INT unsigned int -#endif -#if !defined(RC4_CHUNK) -/* - * This enables code handling data aligned at natural CPU word - * boundary. See crypto/rc4/rc4_enc.c for further details. - */ -#undef RC4_CHUNK -#endif -#endif - -#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) -/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a - * %20 speed up (longs are 8 bytes, int's are 4). */ -#ifndef DES_LONG -#define DES_LONG unsigned long -#endif -#endif - -#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) -#define CONFIG_HEADER_BN_H -#define BN_LLONG - -/* Should we define BN_DIV2W here? */ - -/* Only one for the following should be defined */ -#undef SIXTY_FOUR_BIT_LONG -#undef SIXTY_FOUR_BIT -#define THIRTY_TWO_BIT -#endif - -#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) -#define CONFIG_HEADER_RC4_LOCL_H -/* if this is defined data[i] is used instead of *data, this is a %20 - * speedup on x86 */ -#define RC4_INDEX -#endif - -#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) -#define CONFIG_HEADER_BF_LOCL_H -#undef BF_PTR -#endif /* HEADER_BF_LOCL_H */ - -#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) -#define CONFIG_HEADER_DES_LOCL_H -#ifndef DES_DEFAULT_OPTIONS -/* the following is tweaked from a config script, that is why it is a - * protected undef/define */ -#ifndef DES_PTR -#undef DES_PTR -#endif - -/* This helps C compiler generate the correct code for multiple functional - * units. It reduces register dependancies at the expense of 2 more - * registers */ -#ifndef DES_RISC1 -#undef DES_RISC1 -#endif - -#ifndef DES_RISC2 -#undef DES_RISC2 -#endif - -#if defined(DES_RISC1) && defined(DES_RISC2) -#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! -#endif - -/* Unroll the inner loop, this sometimes helps, sometimes hinders. - * Very mucy CPU dependant */ -#ifndef DES_UNROLL -#undef DES_UNROLL -#endif - -/* These default values were supplied by - * Peter Gutman - * They are only used if nothing else has been defined */ -#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) -/* Special defines which change the way the code is built depending on the - CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find - even newer MIPS CPU's, but at the moment one size fits all for - optimization options. Older Sparc's work better with only UNROLL, but - there's no way to tell at compile time what it is you're running on */ - -#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ -# define DES_PTR -# define DES_RISC1 -# define DES_UNROLL -#elif defined( __ultrix ) /* Older MIPS */ -# define DES_PTR -# define DES_RISC2 -# define DES_UNROLL -#elif defined( __osf1__ ) /* Alpha */ -# define DES_PTR -# define DES_RISC2 -#elif defined ( _AIX ) /* RS6000 */ - /* Unknown */ -#elif defined( __hpux ) /* HP-PA */ - /* Unknown */ -#elif defined( __aux ) /* 68K */ - /* Unknown */ -#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ -# define DES_UNROLL -#elif defined( __sgi ) /* Newer MIPS */ -# define DES_PTR -# define DES_RISC2 -# define DES_UNROLL -#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ -# define DES_PTR -# define DES_RISC1 -# define DES_UNROLL -#endif /* Systems-specific speed defines */ -#endif - -#endif /* DES_DEFAULT_OPTIONS */ -#endif /* HEADER_DES_LOCL_H */ -#ifdef __cplusplus -} -#endif diff --git a/libs/win32/openssl/libeay32.2010.vcxproj.filters b/libs/win32/openssl/libeay32.2010.vcxproj.filters deleted file mode 100644 index ce9c62b732..0000000000 --- a/libs/win32/openssl/libeay32.2010.vcxproj.filters +++ /dev/null @@ -1,2183 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {2850971f-3d57-4ec1-ba4e-4eeeca46de09} - - - {6b648b8e-8ebf-4f48-8c17-1f6b2d9477ce} - - - {05ec904a-2b0d-4d2b-87ce-fcbaf9bc53ef} - - - {919079e4-52ba-479b-9d7e-673ad9bf6958} - - - {644aa6c7-8c73-4e8d-ae63-869bc189980a} - - - {636f4aed-2ca1-40a7-ac6b-92b541500300} - - - {bc509ff7-3aaa-468b-80fa-7354cb810c13} - - - {96559708-7eee-4deb-a2b2-667298a4ef01} - - - {1c09035a-c83f-40d7-920a-744cd59ef2f4} - - - {61e88564-1f38-4f1d-9e30-8e9d9506c71d} - - - {3ec0ae46-a65d-4fdf-828c-44a3c79a6513} - - - {616027a2-c98f-4445-9af0-0c50bb044818} - - - {6c98fe40-7652-4cd9-846a-554b31f968e6} - - - {b5ba2166-4005-4e4d-ba09-41746fd2c870} - - - {26f25748-94ef-4153-9724-719403f62835} - - - {daa6ffca-0173-41bf-8783-5ab2946155e5} - - - {dbfd9437-8e08-49de-a1e7-938b600a08cf} - - - {01bf1b62-b5be-47f7-8d41-e1bcfaad2aca} - - - {c47b5411-3d09-4382-b89f-a4108640aa92} - - - {ce0f14aa-10a0-4127-a466-3df1411abd2e} - - - {3e96a0c0-5174-442b-9340-fbfe40c6240b} - - - {aae1c437-51fa-4235-a078-145f1ce455cf} - - - {89511946-5b9a-46b2-9d0e-97899bcaf018} - - - {b0206185-99ef-40cc-aa8d-49e0034f98d4} - - - {fba7f92a-93a9-448d-a552-5491255db0ac} - - - {224fad84-0750-4fee-addb-83a53b3b761d} - - - {c754b49b-c6b8-4b49-802f-8eedfa4dbef4} - - - {78d696b8-88c1-4190-8a68-032e09b6d29d} - - - {ead8484b-aeec-45cf-a491-6eb06779ede7} - - - {9edce7d9-19e3-4272-aad1-c5602e2b2104} - - - {c76dbab1-9425-4178-9328-e680a21cb7f9} - - - {e796b6ee-d0c0-46ff-b949-556db483591e} - - - {e2f6b450-d8b6-4e3b-aa18-3af97ff00386} - - - {dabdf468-70c7-4047-a321-4257eddfd30e} - - - {b193f02f-4d4f-42df-bde9-29d40f5ab39b} - - - {8c36cfee-583f-4e0e-bd3c-a518d31d4eb2} - - - {f2d3a7a0-acdb-4e85-85ed-d74e176e5bea} - - - {0581d1b8-2fe1-4bfd-841f-78ae4af03566} - - - {90017bfa-d91a-430a-bba6-fde2d6a53129} - - - {fbe18987-9cdd-4d25-a173-865867f652b6} - - - {9a9acc90-e65f-4655-9fe5-644a9166663f} - - - {99a1ece1-fa73-4505-b850-a331cb41c53e} - - - {5b9dd7d9-bb80-40c4-87e3-6cd084d94034} - - - {b3c6fe14-7ab4-42ad-b73a-998cd8b071bd} - - - {cc048924-f80a-4a77-8113-cad552f4f420} - - - {87b53a26-4389-42b6-bd9a-559c5f8f6a47} - - - {673da9b9-025a-4a23-b7d7-834804ad564c} - - - {1531b88a-1a6c-43cd-be72-1059d1ac32a8} - - - {834fc5df-340b-41b0-b9d6-d9c77bdaa848} - - - {0a0643bb-ea56-4e8e-936b-95c56933441d} - - - {2f1cce25-c551-43c1-9ec3-478bea639d9e} - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {c42c3a40-6d53-49e8-bad0-bd02521f475d} - - - {12a7c0f3-1955-4c42-ab0d-5dfeb8e97f30} - - - {3a939d2d-882a-49cf-9b39-d6e29932ba2f} - - - {4e1235aa-5f4b-44f0-8cd2-db2bc40052c3} - - - {c4935409-609f-4bac-8306-8f480f529596} - - - {87bddb4f-8d2e-4acd-b718-d23b945c5092} - - - {9e1d75f1-f5db-497d-9678-2a182cc70369} - - - - - Source Files\crypto - - - Source Files\crypto - - - Source Files\crypto - - - Source Files\crypto - - - Source Files\crypto - - - Source Files\crypto - - - Source Files\crypto - - - Source Files\crypto - - - Source Files\crypto - - - Source Files\crypto - - - Source Files\crypto\rc2 - - - Source Files\crypto\rc2 - - - Source Files\crypto\rc2 - - - Source Files\crypto\rc2 - - - Source Files\crypto\rc2 - - - Source Files\crypto\rc4 - - - Source Files\crypto\rc4 - - - Source Files\crypto\idea - - - Source Files\crypto\idea - - - Source Files\crypto\idea - - - Source Files\crypto\idea - - - Source Files\crypto\idea - - - Source Files\crypto\bf - - - Source Files\crypto\bf - - - Source Files\crypto\bf - - - Source Files\crypto\bf - - - Source Files\crypto\bf - - - Source Files\crypto\cast - - - Source Files\crypto\cast - - - Source Files\crypto\cast - - - Source Files\crypto\cast - - - Source Files\crypto\cast - - - Source Files\crypto\ripemd - - - Source Files\crypto\ripemd - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\des - - - Source Files\crypto\aes - - - Source Files\crypto\aes - - - Source Files\crypto\aes - - - Source Files\crypto\aes - - - Source Files\crypto\aes - - - Source Files\crypto\aes - - - Source Files\crypto\aes - - - Source Files\crypto\aes - - - Source Files\crypto\aes - - - Source Files\crypto\camellia - - - Source Files\crypto\camellia - - - Source Files\crypto\camellia - - - Source Files\crypto\camellia - - - Source Files\crypto\camellia - - - Source Files\crypto\camellia - - - Source Files\crypto\camellia - - - Source Files\crypto\seed - - - Source Files\crypto\seed - - - Source Files\crypto\seed - - - Source Files\crypto\seed - - - Source Files\crypto\seed - - - Source Files\crypto\modes - - - Source Files\crypto\modes - - - Source Files\crypto\modes - - - Source Files\crypto\modes - - - Source Files\crypto\modes - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\bn - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\rsa - - - Source Files\crypto\dsa - - - Source Files\crypto\dsa - - - Source Files\crypto\dsa - - - Source Files\crypto\dsa - - - Source Files\crypto\dsa - - - Source Files\crypto\dsa - - - Source Files\crypto\dsa - - - Source Files\crypto\dsa - - - Source Files\crypto\dsa - - - Source Files\crypto\dsa - - - Source Files\crypto\dsa - - - Source Files\crypto\dsa - - - Source Files\crypto\rand - - - Source Files\crypto\rand - - - Source Files\crypto\rand - - - Source Files\crypto\rand - - - Source Files\crypto\rand - - - Source Files\crypto\rand - - - Source Files\crypto\rand - - - Source Files\crypto\rand - - - Source Files\crypto\rand - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\bio - - - Source Files\crypto\err - - - Source Files\crypto\err - - - Source Files\crypto\err - - - Source Files\crypto\ui - - - Source Files\crypto\ui - - - Source Files\crypto\ui - - - Source Files\crypto\ui - - - Source Files\crypto\ui - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\x509 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\asn1 - - - Source Files\crypto\objects - - - Source Files\crypto\objects - - - Source Files\crypto\objects - - - Source Files\crypto\objects - - - Source Files\crypto\objects - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\buffer - - - Source Files\crypto\buffer - - - Source Files\crypto\cms - - - Source Files\crypto\cms - - - Source Files\crypto\cms - - - Source Files\crypto\cms - - - Source Files\crypto\cms - - - Source Files\crypto\cms - - - Source Files\crypto\cms - - - Source Files\crypto\cms - - - Source Files\crypto\cms - - - Source Files\crypto\cms - - - Source Files\crypto\cms - - - Source Files\crypto\cms - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\stack - - - Source Files\crypto\pkcs7 - - - Source Files\crypto\pkcs7 - - - Source Files\crypto\pkcs7 - - - Source Files\crypto\pkcs7 - - - Source Files\crypto\pkcs7 - - - Source Files\crypto\pkcs7 - - - Source Files\crypto\pkcs7 - - - Source Files\crypto\pkcs7 - - - Source Files\crypto\dh - - - Source Files\crypto\dh - - - Source Files\crypto\dh - - - Source Files\crypto\dh - - - Source Files\crypto\dh - - - Source Files\crypto\dh - - - Source Files\crypto\dh - - - Source Files\crypto\dh - - - Source Files\crypto\dh - - - Source Files\crypto\dh - - - Source Files\crypto\ocsp - - - Source Files\crypto\ocsp - - - Source Files\crypto\ocsp - - - Source Files\crypto\ocsp - - - Source Files\crypto\ocsp - - - Source Files\crypto\ocsp - - - Source Files\crypto\ocsp - - - Source Files\crypto\ocsp - - - Source Files\crypto\ocsp - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\x509v3 - - - Source Files\crypto\ts - - - Source Files\crypto\ts - - - Source Files\crypto\ts - - - Source Files\crypto\ts - - - Source Files\crypto\ts - - - Source Files\crypto\ts - - - Source Files\crypto\ts - - - Source Files\crypto\ts - - - Source Files\crypto\ts - - - Source Files\crypto\ts - - - Source Files\crypto\ts - - - Source Files\crypto\conf - - - Source Files\crypto\conf - - - Source Files\crypto\conf - - - Source Files\crypto\conf - - - Source Files\crypto\conf - - - Source Files\crypto\conf - - - Source Files\crypto\conf - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ecdh - - - Source Files\crypto\ecdh - - - Source Files\crypto\ecdh - - - Source Files\crypto\ecdh - - - Source Files\crypto\ecdsa - - - Source Files\crypto\ecdsa - - - Source Files\crypto\ecdsa - - - Source Files\crypto\ecdsa - - - Source Files\crypto\ecdsa - - - Source Files\crypto\ecdsa - - - Source Files\crypto\md5 - - - Source Files\crypto\md5 - - - Source Files\crypto\md4 - - - Source Files\crypto\md4 - - - Source Files\crypto\lhash - - - Source Files\crypto\lhash - - - Source Files\crypto\dso - - - Source Files\crypto\dso - - - Source Files\crypto\dso - - - Source Files\crypto\dso - - - Source Files\crypto\dso - - - Source Files\crypto\dso - - - Source Files\crypto\dso - - - Source Files\crypto\dso - - - Source Files\crypto\dso - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\pkcs12 - - - Source Files\crypto\hmac - - - Source Files\crypto\hmac - - - Source Files\crypto\hmac - - - Source Files\crypto\sha - - - Source Files\crypto\sha - - - Source Files\crypto\sha - - - Source Files\crypto\sha - - - Source Files\crypto\sha - - - Source Files\crypto\sha - - - Source Files\crypto\sha - - - Source Files\crypto\comp - - - Source Files\crypto\comp - - - Source Files\crypto\comp - - - Source Files\crypto\comp - - - Source Files\crypto\pem - - - Source Files\crypto\pem - - - Source Files\crypto\pem - - - Source Files\crypto\pem - - - Source Files\crypto\pem - - - Source Files\crypto\pem - - - Source Files\crypto\pem - - - Source Files\crypto\pem - - - Source Files\crypto\pem - - - Source Files\crypto\pem - - - Source Files\crypto\pem - - - Source Files\crypto\pem - - - Source Files\crypto\whrlpool - - - Source Files\crypto\whrlpool - - - Source Files\crypto\mdc2 - - - Source Files\crypto\mdc2 - - - Source Files\crypto\krb5 - - - Source Files\crypto\txt_db - - - Source Files\crypto\pqueue - - - Source Files\ms - - - Source Files\crypto\buffer - - - Source Files\crypto\camellia - - - Source Files\crypto\ec - - - Source Files\crypto\rc4 - - - Source Files\crypto\rsa - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\evp - - - Source Files\crypto\evp - - - Source Files\crypto\modes - - - Source Files\crypto\modes - - - Source Files\crypto\modes - - - Source Files\crypto\engine - - - Source Files\crypto\engine - - - Source Files\crypto\cms - - - Source Files\crypto\cmac - - - Source Files\crypto\cmac - - - Source Files\crypto\cmac - - - Source Files\crypto - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\ec - - - Source Files\crypto\srp - - - Source Files\crypto\srp - - - Source Files\crypto\evp - - - Source Files\crypto\bn - - - Source Files\crypto - - - Source Files\crypto - - - Source Files\crypto\evp - - - - - Header Files - - - Header Files\crypto - - - Header Files\crypto - - - Header Files\crypto - - - Header Files\crypto - - - Header Files\crypto\evp - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\openssl - - - Header Files\bf - - - Header Files\bf - - - Header Files\bf - - - Header Files\ms - - - \ No newline at end of file diff --git a/libs/win32/openssl/libeay32.2015.vcxproj b/libs/win32/openssl/libeay32.2015.vcxproj deleted file mode 100644 index 376125a5a7..0000000000 --- a/libs/win32/openssl/libeay32.2015.vcxproj +++ /dev/null @@ -1,884 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - libeay32 - {D331904D-A00A-4694-A5A3-FCFF64AB5DBE} - openssl - Win32Proj - - - - DynamicLibrary - Unicode - false - true - v140 - - - DynamicLibrary - Unicode - false - v140 - - - DynamicLibrary - Unicode - false - true - v140 - - - DynamicLibrary - Unicode - false - v140 - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - true - true - false - false - $(PlatformName)\libeay32\$(Configuration)\ - $(PlatformName)\libeay32\$(Configuration)\ - $(PlatformName)\libeay32\$(Configuration)\ - $(PlatformName)\libeay32\$(Configuration)\ - - - - /Gs0 %(AdditionalOptions) - Disabled - AnySuitable - include_x86;include;..\..\openssl-$(OpenSSLVersion)\crypto;..\..\openssl-$(OpenSSLVersion)\crypto\aes;..\..\openssl-$(OpenSSLVersion)\crypto\asn1;..\..\openssl-$(OpenSSLVersion)\crypto\bf;..\..\openssl-$(OpenSSLVersion)\crypto\bio;..\..\openssl-$(OpenSSLVersion)\crypto\bn;..\..\openssl-$(OpenSSLVersion)\crypto\buffer;..\..\openssl-$(OpenSSLVersion)\crypto\camellia;..\..\openssl-$(OpenSSLVersion)\crypto\cast;..\..\openssl-$(OpenSSLVersion)\crypto\cms;..\..\openssl-$(OpenSSLVersion)\crypto\comp;..\..\openssl-$(OpenSSLVersion)\crypto\conf;..\..\openssl-$(OpenSSLVersion)\crypto\des;..\..\openssl-$(OpenSSLVersion)\crypto\dh;..\..\openssl-$(OpenSSLVersion)\crypto\dsa;..\..\openssl-$(OpenSSLVersion)\crypto\dso;..\..\openssl-$(OpenSSLVersion)\crypto\ec;..\..\openssl-$(OpenSSLVersion)\crypto\ecdh;..\..\openssl-$(OpenSSLVersion)\crypto\ecdsa;..\..\openssl-$(OpenSSLVersion)\crypto\engine;..\..\openssl-$(OpenSSLVersion)\crypto\err;..\..\openssl-$(OpenSSLVersion)\crypto\evp;..\..\openssl-$(OpenSSLVersion)\crypto\modes;..\..\openssl-$(OpenSSLVersion)\ms;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WINDOWS;WIN32;_DEBUG;_CRT_NON_CONFORMING_SWPRINTFS;OPENSSL_THREADS;DSO_WIN32;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_NO_ASM;OPENSSL_NO_GMP;OPENSSL_NO_JPAKE;OPENSSL_NO_KRB5;OPENSSL_NO_MD2;OPENSSL_NO_RFC3779;OPENSSL_NO_STORE;OPENSSL_NO_STATIC_ENGINE;OPENSSL_BUILD_SHLIBCRYPTO;MK1MF_BUILD;OPENSSL_NO_SCTP;OPENSSL_NO_EC_NISTP_64_GCC_128;%(PreprocessorDefinitions) - true - MultiThreadedDebugDLL - true - - - Level3 - true - ProgramDatabase - 4311;4164;4996;4267;4244;%(DisableSpecificWarnings) - false - true - - - ws2_32.lib;%(AdditionalDependencies) - $(ProjectDir)libeay32.def - true - true - MachineX86 - - - - - X64 - - - /Gs0 %(AdditionalOptions) - Disabled - AnySuitable - include_x64;include;..\..\openssl-$(OpenSSLVersion)\crypto;..\..\openssl-$(OpenSSLVersion)\crypto\aes;..\..\openssl-$(OpenSSLVersion)\crypto\asn1;..\..\openssl-$(OpenSSLVersion)\crypto\bf;..\..\openssl-$(OpenSSLVersion)\crypto\bio;..\..\openssl-$(OpenSSLVersion)\crypto\bn;..\..\openssl-$(OpenSSLVersion)\crypto\buffer;..\..\openssl-$(OpenSSLVersion)\crypto\camellia;..\..\openssl-$(OpenSSLVersion)\crypto\cast;..\..\openssl-$(OpenSSLVersion)\crypto\cms;..\..\openssl-$(OpenSSLVersion)\crypto\comp;..\..\openssl-$(OpenSSLVersion)\crypto\conf;..\..\openssl-$(OpenSSLVersion)\crypto\des;..\..\openssl-$(OpenSSLVersion)\crypto\dh;..\..\openssl-$(OpenSSLVersion)\crypto\dsa;..\..\openssl-$(OpenSSLVersion)\crypto\dso;..\..\openssl-$(OpenSSLVersion)\crypto\ec;..\..\openssl-$(OpenSSLVersion)\crypto\ecdh;..\..\openssl-$(OpenSSLVersion)\crypto\ecdsa;..\..\openssl-$(OpenSSLVersion)\crypto\engine;..\..\openssl-$(OpenSSLVersion)\crypto\err;..\..\openssl-$(OpenSSLVersion)\crypto\evp;..\..\openssl-$(OpenSSLVersion)\crypto\modes;..\..\openssl-$(OpenSSLVersion)\ms;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WINDOWS;WIN32;_DEBUG;_CRT_NON_CONFORMING_SWPRINTFS;OPENSSL_THREADS;DSO_WIN32;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_NO_ASM;OPENSSL_NO_GMP;OPENSSL_NO_JPAKE;OPENSSL_NO_KRB5;OPENSSL_NO_MD2;OPENSSL_NO_RFC3779;OPENSSL_NO_STORE;OPENSSL_NO_STATIC_ENGINE;OPENSSL_BUILD_SHLIBCRYPTO;MK1MF_BUILD;OPENSSL_NO_SCTP;OPENSSL_NO_EC_NISTP_64_GCC_128;%(PreprocessorDefinitions) - true - MultiThreadedDebugDLL - true - - - Level3 - ProgramDatabase - 4311;4164;4996;4267;4244;%(DisableSpecificWarnings) - false - true - - - ws2_32.lib;%(AdditionalDependencies) - $(ProjectDir)libeay32.def - true - true - MachineX64 - - - - - /Gs0 %(AdditionalOptions) - Full - AnySuitable - include_x86;include;..\..\openssl-$(OpenSSLVersion)\crypto;..\..\openssl-$(OpenSSLVersion)\crypto\aes;..\..\openssl-$(OpenSSLVersion)\crypto\asn1;..\..\openssl-$(OpenSSLVersion)\crypto\bf;..\..\openssl-$(OpenSSLVersion)\crypto\bio;..\..\openssl-$(OpenSSLVersion)\crypto\bn;..\..\openssl-$(OpenSSLVersion)\crypto\buffer;..\..\openssl-$(OpenSSLVersion)\crypto\camellia;..\..\openssl-$(OpenSSLVersion)\crypto\cast;..\..\openssl-$(OpenSSLVersion)\crypto\cms;..\..\openssl-$(OpenSSLVersion)\crypto\comp;..\..\openssl-$(OpenSSLVersion)\crypto\conf;..\..\openssl-$(OpenSSLVersion)\crypto\des;..\..\openssl-$(OpenSSLVersion)\crypto\dh;..\..\openssl-$(OpenSSLVersion)\crypto\dsa;..\..\openssl-$(OpenSSLVersion)\crypto\dso;..\..\openssl-$(OpenSSLVersion)\crypto\ec;..\..\openssl-$(OpenSSLVersion)\crypto\ecdh;..\..\openssl-$(OpenSSLVersion)\crypto\ecdsa;..\..\openssl-$(OpenSSLVersion)\crypto\engine;..\..\openssl-$(OpenSSLVersion)\crypto\err;..\..\openssl-$(OpenSSLVersion)\crypto\evp;..\..\openssl-$(OpenSSLVersion)\crypto\modes;..\..\openssl-$(OpenSSLVersion)\ms;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CRT_NON_CONFORMING_SWPRINTFS;OPENSSL_THREADS;DSO_WIN32;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_NO_ASM;OPENSSL_NO_GMP;OPENSSL_NO_JPAKE;OPENSSL_NO_KRB5;OPENSSL_NO_MD2;OPENSSL_NO_RFC3779;OPENSSL_NO_STORE;OPENSSL_NO_STATIC_ENGINE;OPENSSL_BUILD_SHLIBCRYPTO;MK1MF_BUILD;OPENSSL_NO_SCTP;OPENSSL_NO_EC_NISTP_64_GCC_128;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - ProgramDatabase - 4311;4164;4996;4267;4244;%(DisableSpecificWarnings) - false - true - - - ws2_32.lib;%(AdditionalDependencies) - $(ProjectDir)libeay32.def - true - true - MachineX86 - - - - - X64 - - - /Gs0 %(AdditionalOptions) - Full - AnySuitable - include_x64;include;..\..\openssl-$(OpenSSLVersion)\crypto;..\..\openssl-$(OpenSSLVersion)\crypto\aes;..\..\openssl-$(OpenSSLVersion)\crypto\asn1;..\..\openssl-$(OpenSSLVersion)\crypto\bf;..\..\openssl-$(OpenSSLVersion)\crypto\bio;..\..\openssl-$(OpenSSLVersion)\crypto\bn;..\..\openssl-$(OpenSSLVersion)\crypto\buffer;..\..\openssl-$(OpenSSLVersion)\crypto\camellia;..\..\openssl-$(OpenSSLVersion)\crypto\cast;..\..\openssl-$(OpenSSLVersion)\crypto\cms;..\..\openssl-$(OpenSSLVersion)\crypto\comp;..\..\openssl-$(OpenSSLVersion)\crypto\conf;..\..\openssl-$(OpenSSLVersion)\crypto\des;..\..\openssl-$(OpenSSLVersion)\crypto\dh;..\..\openssl-$(OpenSSLVersion)\crypto\dsa;..\..\openssl-$(OpenSSLVersion)\crypto\dso;..\..\openssl-$(OpenSSLVersion)\crypto\ec;..\..\openssl-$(OpenSSLVersion)\crypto\ecdh;..\..\openssl-$(OpenSSLVersion)\crypto\ecdsa;..\..\openssl-$(OpenSSLVersion)\crypto\engine;..\..\openssl-$(OpenSSLVersion)\crypto\err;..\..\openssl-$(OpenSSLVersion)\crypto\evp;..\..\openssl-$(OpenSSLVersion)\crypto\modes;..\..\openssl-$(OpenSSLVersion)\ms;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CRT_NON_CONFORMING_SWPRINTFS;OPENSSL_THREADS;DSO_WIN32;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_NO_ASM;OPENSSL_NO_GMP;OPENSSL_NO_JPAKE;OPENSSL_NO_KRB5;OPENSSL_NO_MD2;OPENSSL_NO_RFC3779;OPENSSL_NO_STORE;OPENSSL_NO_STATIC_ENGINE;OPENSSL_BUILD_SHLIBCRYPTO;MK1MF_BUILD;OPENSSL_NO_SCTP;OPENSSL_NO_EC_NISTP_64_GCC_128;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4311;4164;4996;4267;4244;%(DisableSpecificWarnings) - false - true - - - ws2_32.lib;%(AdditionalDependencies) - $(ProjectDir)libeay32.def - true - true - MachineX64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {d578e676-7ec8-4548-bd8b-845c635f14ad} - - - - - - - \ No newline at end of file diff --git a/libs/win32/openssl/libeay32.def b/libs/win32/openssl/libeay32.def deleted file mode 100644 index fcfaf472d5..0000000000 --- a/libs/win32/openssl/libeay32.def +++ /dev/null @@ -1,3689 +0,0 @@ -; -; Definition file for the DLL version of the LIBEAY library from OpenSSL -; - -LIBRARY LIBEAY32 - -EXPORTS - SSLeay @1 - ACCESS_DESCRIPTION_free @1994 - ACCESS_DESCRIPTION_it @2751 - ACCESS_DESCRIPTION_new @1925 - AES_bi_ige_encrypt @3860 - AES_cbc_encrypt @3171 - AES_cfb128_encrypt @3217 - AES_cfb1_encrypt @3279 - AES_cfb8_encrypt @3261 - AES_ctr128_encrypt @3216 - AES_decrypt @3040 - AES_ecb_encrypt @2801 - AES_encrypt @3033 - AES_ige_encrypt @3829 - AES_ofb128_encrypt @3215 - AES_options @3074 - AES_set_decrypt_key @3106 - AES_set_encrypt_key @3024 - AES_unwrap_key @3929 - AES_wrap_key @3930 - ASN1_ANY_it @3035 - ASN1_BIT_STRING_check @4495 - ASN1_BIT_STRING_free @2080 - ASN1_BIT_STRING_get_bit @1060 - ASN1_BIT_STRING_it @2878 - ASN1_BIT_STRING_name_print @2134 - ASN1_BIT_STRING_new @1957 - ASN1_BIT_STRING_num_asc @1986 - ASN1_BIT_STRING_set @2109 - ASN1_BIT_STRING_set_asc @2017 - ASN1_BIT_STRING_set_bit @1061 - ASN1_BMPSTRING_free @2057 - ASN1_BMPSTRING_it @2787 - ASN1_BMPSTRING_new @1936 - ASN1_BOOLEAN_it @3142 - ASN1_ENUMERATED_free @2027 - ASN1_ENUMERATED_get @1206 - ASN1_ENUMERATED_it @3015 - ASN1_ENUMERATED_new @2052 - ASN1_ENUMERATED_set @1205 - ASN1_ENUMERATED_to_BN @1208 - ASN1_FBOOLEAN_it @2806 - ASN1_GENERALIZEDTIME_adj @4484 - ASN1_GENERALIZEDTIME_check @1157 - ASN1_GENERALIZEDTIME_free @1908 - ASN1_GENERALIZEDTIME_it @2595 - ASN1_GENERALIZEDTIME_new @2126 - ASN1_GENERALIZEDTIME_print @1158 - ASN1_GENERALIZEDTIME_set @1159 - ASN1_GENERALIZEDTIME_set_string @1160 - ASN1_GENERALSTRING_free @2541 - ASN1_GENERALSTRING_it @2761 - ASN1_GENERALSTRING_new @2846 - ASN1_IA5STRING_free @2065 - ASN1_IA5STRING_it @2722 - ASN1_IA5STRING_new @2049 - ASN1_INTEGER_cmp @1963 - ASN1_INTEGER_dup @2114 - ASN1_INTEGER_free @2111 - ASN1_INTEGER_get @7 - ASN1_INTEGER_it @2914 - ASN1_INTEGER_new @2131 - ASN1_INTEGER_set @8 - ASN1_INTEGER_to_BN @9 - ASN1_NULL_free @2168 - ASN1_NULL_it @3150 - ASN1_NULL_new @2170 - ASN1_OBJECT_create @10 - ASN1_OBJECT_free @11 - ASN1_OBJECT_it @3180 - ASN1_OBJECT_new @12 - ASN1_OCTET_STRING_NDEF_it @3389 - ASN1_OCTET_STRING_cmp @1955 - ASN1_OCTET_STRING_dup @2108 - ASN1_OCTET_STRING_free @2016 - ASN1_OCTET_STRING_it @3090 - ASN1_OCTET_STRING_new @2130 - ASN1_OCTET_STRING_set @2040 - ASN1_PCTX_free @4498 - ASN1_PCTX_get_cert_flags @4166 - ASN1_PCTX_get_flags @4200 - ASN1_PCTX_get_nm_flags @4242 - ASN1_PCTX_get_oid_flags @4274 - ASN1_PCTX_get_str_flags @4493 - ASN1_PCTX_new @4476 - ASN1_PCTX_set_cert_flags @4528 - ASN1_PCTX_set_flags @4363 - ASN1_PCTX_set_nm_flags @4298 - ASN1_PCTX_set_oid_flags @4451 - ASN1_PCTX_set_str_flags @4392 - ASN1_PRINTABLESTRING_free @1934 - ASN1_PRINTABLESTRING_it @2797 - ASN1_PRINTABLESTRING_new @2025 - ASN1_PRINTABLE_free @3082 - ASN1_PRINTABLE_it @2861 - ASN1_PRINTABLE_new @2571 - ASN1_PRINTABLE_type @13 - ASN1_SEQUENCE_ANY_it @4148 - ASN1_SEQUENCE_it @2943 - ASN1_SET_ANY_it @4217 - ASN1_STRING_TABLE_add @2245 - ASN1_STRING_TABLE_cleanup @2020 - ASN1_STRING_TABLE_get @2091 - ASN1_STRING_clear_free @2392 - ASN1_STRING_cmp @14 - ASN1_STRING_copy @4305 - ASN1_STRING_data @2075 - ASN1_STRING_dup @15 - ASN1_STRING_free @16 - ASN1_STRING_get_default_mask @2072 - ASN1_STRING_length @2023 - ASN1_STRING_length_set @2136 - ASN1_STRING_new @17 - ASN1_STRING_print @18 - ASN1_STRING_print_ex @2432 - ASN1_STRING_print_ex_fp @2430 - ASN1_STRING_set0 @3933 - ASN1_STRING_set @19 - ASN1_STRING_set_by_NID @1996 - ASN1_STRING_set_default_mask @2032 - ASN1_STRING_set_default_mask_asc @1960 - ASN1_STRING_to_UTF8 @2442 - ASN1_STRING_type @1951 - ASN1_STRING_type_new @20 - ASN1_T61STRING_free @1946 - ASN1_T61STRING_it @2567 - ASN1_T61STRING_new @2058 - ASN1_TBOOLEAN_it @3167 - ASN1_TIME_adj @4267 - ASN1_TIME_check @2782 - ASN1_TIME_diff @4739 - ASN1_TIME_free @1954 - ASN1_TIME_it @2715 - ASN1_TIME_new @1973 - ASN1_TIME_print @1161 - ASN1_TIME_set @1253 - ASN1_TIME_set_string @4536 - ASN1_TIME_to_generalizedtime @3169 - ASN1_TYPE_cmp @4428 - ASN1_TYPE_free @21 - ASN1_TYPE_get @916 - ASN1_TYPE_get_int_octetstring @1076 - ASN1_TYPE_get_octetstring @1077 - ASN1_TYPE_new @22 - ASN1_TYPE_set1 @3932 - ASN1_TYPE_set @917 - ASN1_TYPE_set_int_octetstring @1078 - ASN1_TYPE_set_octetstring @1079 - ASN1_UNIVERSALSTRING_free @3233 - ASN1_UNIVERSALSTRING_it @3234 - ASN1_UNIVERSALSTRING_new @3230 - ASN1_UNIVERSALSTRING_to_string @23 - ASN1_UTCTIME_adj @4251 - ASN1_UTCTIME_check @24 - ASN1_UTCTIME_cmp_time_t @2455 - ASN1_UTCTIME_free @1988 - ASN1_UTCTIME_it @3021 - ASN1_UTCTIME_new @2060 - ASN1_UTCTIME_print @25 - ASN1_UTCTIME_set @26 - ASN1_UTCTIME_set_string @1080 - ASN1_UTF8STRING_free @2092 - ASN1_UTF8STRING_it @2527 - ASN1_UTF8STRING_new @1938 - ASN1_VISIBLESTRING_free @2118 - ASN1_VISIBLESTRING_it @2865 - ASN1_VISIBLESTRING_new @1932 - ASN1_add_oid_module @3186 - ASN1_bn_print @4295 - ASN1_check_infinite_end @27 - ASN1_const_check_infinite_end @3623 - ASN1_d2i_bio @28 - ASN1_d2i_fp @29 - ASN1_digest @30 - ASN1_dup @31 - ASN1_generate_nconf @3488 - ASN1_generate_v3 @3571 - ASN1_get_object @32 - ASN1_i2d_bio @33 - ASN1_i2d_fp @34 - ASN1_item_d2i @3050 - ASN1_item_d2i_bio @3069 - ASN1_item_d2i_fp @2868 - ASN1_item_digest @2552 - ASN1_item_dup @2772 - ASN1_item_ex_d2i @2957 - ASN1_item_ex_free @3141 - ASN1_item_ex_i2d @2533 - ASN1_item_ex_new @3063 - ASN1_item_free @2623 - ASN1_item_i2d @2655 - ASN1_item_i2d_bio @2858 - ASN1_item_i2d_fp @3095 - ASN1_item_ndef_i2d @3564 - ASN1_item_new @3168 - ASN1_item_pack @3136 - ASN1_item_print @4126 - ASN1_item_sign @2741 - ASN1_item_sign_ctx @4671 - ASN1_item_unpack @2640 - ASN1_item_verify @2777 - ASN1_mbstring_copy @1937 - ASN1_mbstring_ncopy @2123 - ASN1_object_size @35 - ASN1_pack_string @1261 - ASN1_parse @36 - ASN1_parse_dump @2427 - ASN1_primitive_free @3051 - ASN1_primitive_new @2860 - ASN1_put_eoc @3523 - ASN1_put_object @37 - ASN1_seq_pack @1259 - ASN1_seq_unpack @1258 - ASN1_sign @38 - ASN1_tag2bit @2788 - ASN1_tag2str @1905 - ASN1_template_d2i @2987 - ASN1_template_free @2974 - ASN1_template_i2d @2583 - ASN1_template_new @3093 - ASN1_unpack_string @1260 - ASN1_verify @39 - AUTHORITY_INFO_ACCESS_free @2048 - AUTHORITY_INFO_ACCESS_it @2805 - AUTHORITY_INFO_ACCESS_new @2247 - AUTHORITY_KEYID_free @1257 - AUTHORITY_KEYID_it @2625 - AUTHORITY_KEYID_new @1256 - BASIC_CONSTRAINTS_free @1162 - BASIC_CONSTRAINTS_it @2922 - BASIC_CONSTRAINTS_new @1163 - BF_cbc_encrypt @40 - BF_cfb64_encrypt @41 - BF_decrypt @987 - BF_ecb_encrypt @42 - BF_encrypt @43 - BF_ofb64_encrypt @44 - BF_options @45 - BF_set_key @46 - BIGNUM_it @3170 - BIO_accept @51 - BIO_asn1_get_prefix @4133 - BIO_asn1_get_suffix @4458 - BIO_asn1_set_prefix @4173 - BIO_asn1_set_suffix @4440 - BIO_callback_ctrl @2252 - BIO_clear_flags @3846 - BIO_copy_next_retry @955 - BIO_ctrl @52 - BIO_ctrl_get_read_request @1799 - BIO_ctrl_get_write_guarantee @1803 - BIO_ctrl_pending @1800 - BIO_ctrl_reset_read_request @1906 - BIO_ctrl_wpending @1801 - BIO_debug_callback @54 - BIO_dgram_non_fatal_error @3586 - BIO_dump @55 - BIO_dump_cb @3764 - BIO_dump_fp @3370 - BIO_dump_indent @2426 - BIO_dump_indent_cb @3697 - BIO_dump_indent_fp @3511 - BIO_dup_chain @56 - BIO_f_asn1 @4384 - BIO_f_base64 @57 - BIO_f_buffer @58 - BIO_f_cipher @59 - BIO_f_md @60 - BIO_f_nbio_test @915 - BIO_f_null @61 - BIO_f_reliable @1244 - BIO_fd_non_fatal_error @63 - BIO_fd_should_retry @64 - BIO_find_type @65 - BIO_free @66 - BIO_free_all @67 - BIO_get_accept_socket @69 - BIO_get_callback @3861 - BIO_get_callback_arg @3902 - BIO_get_ex_data @1062 - BIO_get_ex_new_index @1063 - BIO_get_host_ip @71 - BIO_get_port @72 - BIO_get_retry_BIO @73 - BIO_get_retry_reason @74 - BIO_gethostbyname @75 - BIO_gets @76 - BIO_hex_string @4764 - BIO_indent @3242 - BIO_int_ctrl @53 - BIO_method_name @3898 - BIO_method_type @3826 - BIO_new @78 - BIO_new_CMS @4175 - BIO_new_NDEF @4153 - BIO_new_PKCS7 @4518 - BIO_new_accept @79 - BIO_new_bio_pair @1802 - BIO_new_connect @80 - BIO_new_dgram @3330 - BIO_new_fd @81 - BIO_new_file @82 - BIO_new_fp @83 - BIO_new_mem_buf @1882 - BIO_new_socket @84 - BIO_next @2461 - BIO_nread0 @1880 - BIO_nread @1876 - BIO_number_read @2203 - BIO_number_written @2202 - BIO_nwrite0 @1878 - BIO_nwrite @1874 - BIO_pop @85 - BIO_printf @86 - BIO_ptr_ctrl @969 - BIO_push @87 - BIO_puts @88 - BIO_read @89 - BIO_s_accept @90 - BIO_s_bio @1793 - BIO_s_connect @91 - BIO_s_datagram @3542 - BIO_s_fd @92 - BIO_s_file @93 - BIO_s_mem @95 - BIO_s_null @96 - BIO_s_socket @98 - BIO_set @100 - BIO_set_callback @3903 - BIO_set_callback_arg @3820 - BIO_set_cipher @101 - BIO_set_ex_data @1064 - BIO_set_flags @3823 - BIO_set_tcp_ndelay @102 - BIO_snprintf @2292 - BIO_sock_cleanup @103 - BIO_sock_error @104 - BIO_sock_init @105 - BIO_sock_non_fatal_error @106 - BIO_sock_should_retry @107 - BIO_socket_ioctl @108 - BIO_socket_nbio @1102 - BIO_test_flags @3866 - BIO_vfree @2334 - BIO_vprintf @2443 - BIO_vsnprintf @2444 - BIO_write @109 - BN_BLINDING_convert @973 - BN_BLINDING_convert_ex @3465 - BN_BLINDING_create_param @3705 - BN_BLINDING_free @981 - BN_BLINDING_get_flags @3725 - BN_BLINDING_get_thread_id @3340 - BN_BLINDING_invert @974 - BN_BLINDING_invert_ex @3337 - BN_BLINDING_new @980 - BN_BLINDING_set_flags @3411 - BN_BLINDING_set_thread_id @3770 - BN_BLINDING_thread_id @4239 - BN_BLINDING_update @975 - BN_CTX_end @2241 - BN_CTX_free @110 - BN_CTX_get @2243 - BN_CTX_init @1135 - BN_CTX_new @111 - BN_CTX_start @2242 - BN_GENCB_call @3474 - BN_GF2m_add @3574 - BN_GF2m_arr2poly @3552 - BN_GF2m_mod @3515 - BN_GF2m_mod_arr @3431 - BN_GF2m_mod_div @3420 - BN_GF2m_mod_div_arr @3604 - BN_GF2m_mod_exp @3598 - BN_GF2m_mod_exp_arr @3361 - BN_GF2m_mod_inv @3597 - BN_GF2m_mod_inv_arr @3768 - BN_GF2m_mod_mul @3490 - BN_GF2m_mod_mul_arr @3366 - BN_GF2m_mod_solve_quad @3653 - BN_GF2m_mod_solve_quad_arr @3417 - BN_GF2m_mod_sqr @3397 - BN_GF2m_mod_sqr_arr @3540 - BN_GF2m_mod_sqrt @3548 - BN_GF2m_mod_sqrt_arr @3451 - BN_GF2m_poly2arr @3468 - BN_MONT_CTX_copy @1109 - BN_MONT_CTX_free @112 - BN_MONT_CTX_init @1136 - BN_MONT_CTX_new @113 - BN_MONT_CTX_set @114 - BN_MONT_CTX_set_locked @3310 - BN_RECP_CTX_free @1130 - BN_RECP_CTX_init @1128 - BN_RECP_CTX_new @1129 - BN_RECP_CTX_set @1131 - BN_X931_derive_prime_ex @4085 - BN_X931_generate_Xpq @3325 - BN_X931_generate_prime_ex @4060 - BN_add @115 - BN_add_word @116 - BN_asc2bn @4191 - BN_bin2bn @118 - BN_bn2bin @120 - BN_bn2dec @1002 - BN_bn2hex @119 - BN_bn2mpi @1058 - BN_bntest_rand @2464 - BN_clear @121 - BN_clear_bit @122 - BN_clear_free @123 - BN_cmp @124 - BN_consttime_swap @3907 - BN_copy @125 - BN_dec2bn @1001 - BN_div @126 - BN_div_recp @1134 - BN_div_word @127 - BN_dup @128 - BN_exp @998 - BN_free @129 - BN_from_montgomery @130 - BN_gcd @131 - BN_generate_prime @132 - BN_generate_prime_ex @3710 - BN_get0_nist_prime_192 @3358 - BN_get0_nist_prime_224 @3471 - BN_get0_nist_prime_256 @3629 - BN_get0_nist_prime_384 @3331 - BN_get0_nist_prime_521 @3708 - BN_get_params @1249 - BN_get_word @133 - BN_hex2bn @117 - BN_init @1095 - BN_is_bit_set @134 - BN_is_prime @135 - BN_is_prime_ex @3503 - BN_is_prime_fasttest @2240 - BN_is_prime_fasttest_ex @3718 - BN_kronecker @3011 - BN_lshift1 @137 - BN_lshift @136 - BN_mask_bits @138 - BN_mod_add @2774 - BN_mod_add_quick @2923 - BN_mod_exp2_mont @1514 - BN_mod_exp @140 - BN_mod_exp_mont @141 - BN_mod_exp_mont_consttime @3318 - BN_mod_exp_mont_word @2401 - BN_mod_exp_recp @1133 - BN_mod_exp_simple @143 - BN_mod_inverse @144 - BN_mod_lshift1 @3151 - BN_mod_lshift1_quick @2958 - BN_mod_lshift @3120 - BN_mod_lshift_quick @2621 - BN_mod_mul @145 - BN_mod_mul_montgomery @146 - BN_mod_mul_reciprocal @1132 - BN_mod_sqr @2802 - BN_mod_sqrt @2961 - BN_mod_sub @2824 - BN_mod_sub_quick @2933 - BN_mod_word @148 - BN_mpi2bn @1059 - BN_mul @149 - BN_mul_word @999 - BN_new @150 - BN_nist_mod_192 @3346 - BN_nist_mod_224 @3580 - BN_nist_mod_256 @3702 - BN_nist_mod_384 @3641 - BN_nist_mod_521 @3615 - BN_nnmod @2606 - BN_num_bits @151 - BN_num_bits_word @152 - BN_options @153 - BN_print @154 - BN_print_fp @155 - BN_pseudo_rand @2239 - BN_pseudo_rand_range @2523 - BN_rand @156 - BN_rand_range @2466 - BN_reciprocal @157 - BN_rshift1 @159 - BN_rshift @158 - BN_set_bit @160 - BN_set_negative @3635 - BN_set_params @1248 - BN_set_word @161 - BN_sqr @162 - BN_sub @163 - BN_sub_word @1000 - BN_swap @2990 - BN_to_ASN1_ENUMERATED @1207 - BN_to_ASN1_INTEGER @164 - BN_uadd @708 - BN_ucmp @165 - BN_usub @709 - BN_value_one @166 - BUF_MEM_free @167 - BUF_MEM_grow @168 - BUF_MEM_grow_clean @3239 - BUF_MEM_new @169 - BUF_memdup @3489 - BUF_reverse @4284 - BUF_strdup @170 - BUF_strlcat @3241 - BUF_strlcpy @3243 - BUF_strndup @3513 - BUF_strnlen @4766 - CAST_cbc_encrypt @992 - CAST_cfb64_encrypt @993 - CAST_decrypt @990 - CAST_ecb_encrypt @991 - CAST_encrypt @989 - CAST_ofb64_encrypt @994 - CAST_set_key @988 - CBIGNUM_it @2982 - CERTIFICATEPOLICIES_free @1486 - CERTIFICATEPOLICIES_it @2728 - CERTIFICATEPOLICIES_new @1485 - CMAC_CTX_cleanup @4621 - CMAC_CTX_copy @4618 - CMAC_CTX_free @4619 - CMAC_CTX_get0_cipher_ctx @4620 - CMAC_CTX_new @4625 - CMAC_Final @4626 - CMAC_Init @4622 - CMAC_Update @4623 - CMAC_resume @4624 - CMS_ContentInfo_free @3964 - CMS_ContentInfo_it @3969 - CMS_ContentInfo_new @3987 - CMS_ContentInfo_print_ctx @4401 - CMS_EncryptedData_decrypt @3995 - CMS_EncryptedData_encrypt @4005 - CMS_EncryptedData_set1_key @3977 - CMS_EnvelopedData_create @3955 - CMS_ReceiptRequest_create0 @4041 - CMS_ReceiptRequest_free @3938 - CMS_ReceiptRequest_get0_values @4001 - CMS_ReceiptRequest_it @4013 - CMS_ReceiptRequest_new @4018 - CMS_RecipientEncryptedKey_cert_cmp @4734 - CMS_RecipientEncryptedKey_get0_id @4753 - CMS_RecipientInfo_decrypt @4037 - CMS_RecipientInfo_encrypt @4712 - CMS_RecipientInfo_get0_pkey_ctx @4752 - CMS_RecipientInfo_kari_decrypt @4724 - CMS_RecipientInfo_kari_get0_alg @4729 - CMS_RecipientInfo_kari_get0_ctx @4750 - CMS_RecipientInfo_kari_get0_orig_id @4758 - CMS_RecipientInfo_kari_get0_reks @4742 - CMS_RecipientInfo_kari_orig_id_cmp @4728 - CMS_RecipientInfo_kari_set0_pkey @4746 - CMS_RecipientInfo_kekri_get0_id @4011 - CMS_RecipientInfo_kekri_id_cmp @4022 - CMS_RecipientInfo_ktri_cert_cmp @3962 - CMS_RecipientInfo_ktri_get0_algs @3963 - CMS_RecipientInfo_ktri_get0_signer_id @4032 - CMS_RecipientInfo_set0_key @4009 - CMS_RecipientInfo_set0_password @4660 - CMS_RecipientInfo_set0_pkey @4043 - CMS_RecipientInfo_type @3988 - CMS_SharedInfo_encode @4756 - CMS_SignedData_init @4010 - CMS_SignerInfo_cert_cmp @3973 - CMS_SignerInfo_get0_algs @3951 - CMS_SignerInfo_get0_md_ctx @4744 - CMS_SignerInfo_get0_pkey_ctx @4725 - CMS_SignerInfo_get0_signature @4741 - CMS_SignerInfo_get0_signer_id @4024 - CMS_SignerInfo_set1_signer_cert @3999 - CMS_SignerInfo_sign @3974 - CMS_SignerInfo_verify @3967 - CMS_SignerInfo_verify_content @3958 - CMS_add0_CertificateChoices @3940 - CMS_add0_RevocationInfoChoice @3997 - CMS_add0_cert @4004 - CMS_add0_crl @3957 - CMS_add0_recipient_key @4016 - CMS_add0_recipient_password @4658 - CMS_add1_ReceiptRequest @4023 - CMS_add1_cert @3952 - CMS_add1_crl @4405 - CMS_add1_recipient_cert @4034 - CMS_add1_signer @4042 - CMS_add_simple_smimecap @3966 - CMS_add_smimecap @3982 - CMS_add_standard_smimecap @3986 - CMS_compress @3971 - CMS_dataFinal @4031 - CMS_dataInit @4035 - CMS_data @3968 - CMS_data_create @3975 - CMS_decrypt @3978 - CMS_decrypt_set1_key @3950 - CMS_decrypt_set1_password @4659 - CMS_decrypt_set1_pkey @3998 - CMS_digest_create @3972 - CMS_digest_verify @4006 - CMS_encrypt @3954 - CMS_final @3965 - CMS_get0_RecipientInfos @3996 - CMS_get0_SignerInfos @4003 - CMS_get0_content @4019 - CMS_get0_eContentType @4039 - CMS_get0_signers @4000 - CMS_get0_type @3989 - CMS_get1_ReceiptRequest @4020 - CMS_get1_certs @4028 - CMS_get1_crls @4015 - CMS_is_detached @3990 - CMS_set1_eContentType @4040 - CMS_set1_signers_certs @4007 - CMS_set_detached @3953 - CMS_sign @3991 - CMS_sign_receipt @3943 - CMS_signed_add1_attr @3992 - CMS_signed_add1_attr_by_NID @4029 - CMS_signed_add1_attr_by_OBJ @4021 - CMS_signed_add1_attr_by_txt @4036 - CMS_signed_delete_attr @3945 - CMS_signed_get0_data_by_OBJ @4002 - CMS_signed_get_attr @4008 - CMS_signed_get_attr_by_NID @4027 - CMS_signed_get_attr_by_OBJ @3984 - CMS_signed_get_attr_count @4038 - CMS_stream @4271 - CMS_uncompress @3956 - CMS_unsigned_add1_attr @4026 - CMS_unsigned_add1_attr_by_NID @4025 - CMS_unsigned_add1_attr_by_OBJ @3941 - CMS_unsigned_add1_attr_by_txt @4030 - CMS_unsigned_delete_attr @3980 - CMS_unsigned_get0_data_by_OBJ @3959 - CMS_unsigned_get_attr @3961 - CMS_unsigned_get_attr_by_NID @3947 - CMS_unsigned_get_attr_by_OBJ @3993 - CMS_unsigned_get_attr_count @3981 - CMS_verify @3948 - CMS_verify_receipt @4012 - COMP_CTX_free @1097 - COMP_CTX_new @1096 - COMP_compress_block @1144 - COMP_expand_block @1145 - COMP_rle @1146 - COMP_zlib @1147 - COMP_zlib_cleanup @3936 - CONF_dump_bio @2288 - CONF_dump_fp @2283 - CONF_free @171 - CONF_get1_default_config_file @3194 - CONF_get_number @172 - CONF_get_section @173 - CONF_get_string @174 - CONF_imodule_get_flags @3195 - CONF_imodule_get_module @3196 - CONF_imodule_get_name @3198 - CONF_imodule_get_usr_data @3200 - CONF_imodule_get_value @3190 - CONF_imodule_set_flags @3201 - CONF_imodule_set_usr_data @3183 - CONF_load @175 - CONF_load_bio @1805 - CONF_load_fp @1806 - CONF_module_add @3193 - CONF_module_get_usr_data @3185 - CONF_module_set_usr_data @3191 - CONF_modules_finish @3187 - CONF_modules_free @3226 - CONF_modules_load @3197 - CONF_modules_load_file @3182 - CONF_modules_unload @3189 - CONF_parse_list @3192 - CONF_set_default_method @2290 - CONF_set_nconf @3081 - CRL_DIST_POINTS_free @1539 - CRL_DIST_POINTS_it @2869 - CRL_DIST_POINTS_new @1538 - CRYPTO_128_unwrap @4722 - CRYPTO_128_wrap @4720 - CRYPTO_THREADID_cmp @4176 - CRYPTO_THREADID_cpy @4165 - CRYPTO_THREADID_current @4244 - CRYPTO_THREADID_get_callback @4416 - CRYPTO_THREADID_hash @4400 - CRYPTO_THREADID_set_callback @4346 - CRYPTO_THREADID_set_numeric @4334 - CRYPTO_THREADID_set_pointer @4159 - CRYPTO_add_lock @176 - CRYPTO_cbc128_decrypt @4561 - CRYPTO_cbc128_encrypt @4556 - CRYPTO_ccm128_aad @4649 - CRYPTO_ccm128_decrypt @4648 - CRYPTO_ccm128_decrypt_ccm64 @4629 - CRYPTO_ccm128_encrypt @4630 - CRYPTO_ccm128_encrypt_ccm64 @4639 - CRYPTO_ccm128_init @4644 - CRYPTO_ccm128_setiv @4641 - CRYPTO_ccm128_tag @4647 - CRYPTO_cfb128_1_encrypt @4555 - CRYPTO_cfb128_8_encrypt @4563 - CRYPTO_cfb128_encrypt @4562 - CRYPTO_cleanup_all_ex_data @2604 - CRYPTO_ctr128_encrypt @4557 - CRYPTO_ctr128_encrypt_ctr32 @4627 - CRYPTO_cts128_decrypt @4559 - CRYPTO_cts128_decrypt_block @4554 - CRYPTO_cts128_encrypt @4553 - CRYPTO_cts128_encrypt_block @4560 - CRYPTO_dbg_free @177 - CRYPTO_dbg_get_options @2246 - CRYPTO_dbg_malloc @178 - CRYPTO_dbg_realloc @179 - CRYPTO_dbg_set_options @2157 - CRYPTO_destroy_dynlockid @2413 - CRYPTO_dup_ex_data @1025 - CRYPTO_ex_data_new_class @3036 - CRYPTO_free @181 - CRYPTO_free_ex_data @1004 - CRYPTO_free_locked @1513 - CRYPTO_gcm128_aad @4643 - CRYPTO_gcm128_decrypt @4651 - CRYPTO_gcm128_decrypt_ctr32 @4653 - CRYPTO_gcm128_encrypt @4631 - CRYPTO_gcm128_encrypt_ctr32 @4654 - CRYPTO_gcm128_finish @4655 - CRYPTO_gcm128_init @4650 - CRYPTO_gcm128_new @4646 - CRYPTO_gcm128_release @4628 - CRYPTO_gcm128_setiv @4635 - CRYPTO_gcm128_tag @4638 - CRYPTO_get_add_lock_callback @182 - CRYPTO_get_dynlock_create_callback @2420 - CRYPTO_get_dynlock_destroy_callback @2418 - CRYPTO_get_dynlock_lock_callback @2417 - CRYPTO_get_dynlock_value @2419 - CRYPTO_get_ex_data @1005 - CRYPTO_get_ex_data_implementation @3135 - CRYPTO_get_ex_new_index @1041 - CRYPTO_get_id_callback @183 - CRYPTO_get_lock_name @184 - CRYPTO_get_locked_mem_ex_functions @2781 - CRYPTO_get_locked_mem_functions @1511 - CRYPTO_get_locking_callback @185 - CRYPTO_get_mem_debug_functions @2159 - CRYPTO_get_mem_debug_options @2248 - CRYPTO_get_mem_ex_functions @2855 - CRYPTO_get_mem_functions @186 - CRYPTO_get_new_dynlockid @2410 - CRYPTO_get_new_lockid @1026 - CRYPTO_is_mem_check_on @2160 - CRYPTO_lock @187 - CRYPTO_malloc @188 - CRYPTO_malloc_locked @1512 - CRYPTO_mem_ctrl @189 - CRYPTO_mem_leaks @190 - CRYPTO_mem_leaks_cb @191 - CRYPTO_mem_leaks_fp @192 - CRYPTO_memcmp @3906 - CRYPTO_new_ex_data @1027 - CRYPTO_nistcts128_decrypt @4645 - CRYPTO_nistcts128_decrypt_block @4634 - CRYPTO_nistcts128_encrypt @4636 - CRYPTO_nistcts128_encrypt_block @4642 - CRYPTO_num_locks @1804 - CRYPTO_ofb128_encrypt @4558 - CRYPTO_pop_info @2162 - CRYPTO_push_info_ @2163 - CRYPTO_realloc @193 - CRYPTO_realloc_clean @3240 - CRYPTO_remalloc @194 - CRYPTO_remove_all_info @2158 - CRYPTO_set_add_lock_callback @195 - CRYPTO_set_dynlock_create_callback @2415 - CRYPTO_set_dynlock_destroy_callback @2412 - CRYPTO_set_dynlock_lock_callback @2416 - CRYPTO_set_ex_data @1007 - CRYPTO_set_ex_data_implementation @2841 - CRYPTO_set_id_callback @196 - CRYPTO_set_locked_mem_ex_functions @2770 - CRYPTO_set_locked_mem_functions @1510 - CRYPTO_set_locking_callback @197 - CRYPTO_set_mem_debug_functions @2161 - CRYPTO_set_mem_debug_options @2164 - CRYPTO_set_mem_ex_functions @2778 - CRYPTO_set_mem_functions @198 - CRYPTO_strdup @4093 - CRYPTO_thread_id @199 - CRYPTO_xts128_encrypt @4632 - Camellia_cbc_encrypt @3784 - Camellia_cfb128_encrypt @3785 - Camellia_cfb1_encrypt @3786 - Camellia_cfb8_encrypt @3787 - Camellia_ctr128_encrypt @3788 - Camellia_decrypt @3790 - Camellia_ecb_encrypt @3791 - Camellia_encrypt @3792 - Camellia_ofb128_encrypt @3793 - Camellia_set_key @3794 - DES_cbc_cksum @777 - DES_cbc_encrypt @778 - DES_cfb64_encrypt @780 - DES_cfb_encrypt @781 - DES_check_key_parity @2256 - DES_crypt @2249 - DES_decrypt3 @782 - DES_ecb3_encrypt @783 - DES_ecb_encrypt @784 - DES_ede3_cbc_encrypt @785 - DES_ede3_cbcm_encrypt @1225 - DES_ede3_cfb64_encrypt @786 - DES_ede3_cfb_encrypt @3257 - DES_ede3_ofb64_encrypt @787 - DES_enc_read @788 - DES_enc_write @789 - DES_encrypt1 @790 - DES_encrypt2 @791 - DES_encrypt3 @792 - DES_fcrypt @793 - DES_is_weak_key @794 - DES_key_sched @795 - DES_ncbc_encrypt @796 - DES_ofb64_encrypt @797 - DES_ofb_encrypt @798 - DES_options @799 - DES_pcbc_encrypt @800 - DES_quad_cksum @801 - DES_random_key @802 - DES_read_2passwords @3206 - DES_read_password @3207 - DES_set_key @808 - DES_set_key_checked @2144 - DES_set_key_unchecked @2147 - DES_set_odd_parity @809 - DES_string_to_2keys @810 - DES_string_to_key @811 - DES_xcbc_encrypt @812 - DH_KDF_X9_42 @4735 - DH_OpenSSL @1890 - DH_check @200 - DH_check_pub_key @3774 - DH_compute_key @201 - DH_compute_key_padded @4732 - DH_free @202 - DH_generate_key @203 - DH_generate_parameters @204 - DH_generate_parameters_ex @3713 - DH_get_1024_160 @4685 - DH_get_2048_224 @4691 - DH_get_2048_256 @4689 - DH_get_default_method @1892 - DH_get_ex_data @1886 - DH_get_ex_new_index @1887 - DH_new @205 - DH_new_method @1889 - DH_set_default_method @1894 - DH_set_ex_data @1883 - DH_set_method @1884 - DH_size @206 - DH_up_ref @2930 - DHparams_dup @4540 - DHparams_print @207 - DHparams_print_fp @208 - DIRECTORYSTRING_free @2038 - DIRECTORYSTRING_it @2767 - DIRECTORYSTRING_new @2137 - DISPLAYTEXT_free @1998 - DISPLAYTEXT_it @2836 - DISPLAYTEXT_new @1907 - DIST_POINT_NAME_free @1547 - DIST_POINT_NAME_it @3084 - DIST_POINT_NAME_new @1546 - DIST_POINT_free @1544 - DIST_POINT_it @2950 - DIST_POINT_new @1542 - DIST_POINT_set_dpname @4215 - DSA_OpenSSL @1885 - DSA_SIG_free @1334 - DSA_SIG_new @1333 - DSA_do_sign @1335 - DSA_do_verify @1336 - DSA_dup_DH @1871 - DSA_free @209 - DSA_generate_key @210 - DSA_generate_parameters @211 - DSA_generate_parameters_ex @3687 - DSA_get_default_method @1941 - DSA_get_ex_data @1895 - DSA_get_ex_new_index @1891 - DSA_new @213 - DSA_new_method @1888 - DSA_print @214 - DSA_print_fp @215 - DSA_set_default_method @1989 - DSA_set_ex_data @1893 - DSA_set_method @1949 - DSA_sign @216 - DSA_sign_setup @217 - DSA_size @218 - DSA_up_ref @2785 - DSA_verify @219 - DSAparams_dup @4539 - DSAparams_print @220 - DSAparams_print_fp @221 - DSO_METHOD_beos @4122 - DSO_METHOD_dl @2275 - DSO_METHOD_dlfcn @2272 - DSO_METHOD_null @2270 - DSO_METHOD_openssl @2271 - DSO_METHOD_vms @2462 - DSO_METHOD_win32 @2273 - DSO_bind_func @2409 - DSO_bind_var @2269 - DSO_convert_filename @2618 - DSO_ctrl @2293 - DSO_flags @2262 - DSO_free @2261 - DSO_get_default_method @2265 - DSO_get_filename @3115 - DSO_get_loaded_filename @2731 - DSO_get_method @2266 - DSO_global_lookup @4195 - DSO_load @2268 - DSO_merge @3762 - DSO_new @2259 - DSO_new_method @2260 - DSO_pathbyaddr @4523 - DSO_set_default_method @2264 - DSO_set_filename @2622 - DSO_set_method @2267 - DSO_set_name_converter @3105 - DSO_up_ref @2843 - ECDH_KDF_X9_62 @4749 - ECDH_OpenSSL @3442 - ECDH_compute_key @3644 - ECDH_get_default_method @3351 - ECDH_get_ex_data @3438 - ECDH_get_ex_new_index @3590 - ECDH_set_default_method @3549 - ECDH_set_ex_data @3613 - ECDH_set_method @3611 - ECDSA_METHOD_free @4759 - ECDSA_METHOD_get_app_data @4770 - ECDSA_METHOD_new @4751 - ECDSA_METHOD_set_app_data @4768 - ECDSA_METHOD_set_flags @4726 - ECDSA_METHOD_set_name @4723 - ECDSA_METHOD_set_sign @4733 - ECDSA_METHOD_set_sign_setup @4727 - ECDSA_METHOD_set_verify @4755 - ECDSA_OpenSSL @3620 - ECDSA_SIG_free @3455 - ECDSA_SIG_new @3395 - ECDSA_do_sign @3440 - ECDSA_do_sign_ex @3671 - ECDSA_do_verify @3672 - ECDSA_get_default_method @3522 - ECDSA_get_ex_data @3509 - ECDSA_get_ex_new_index @3744 - ECDSA_set_default_method @3625 - ECDSA_set_ex_data @3739 - ECDSA_set_method @3731 - ECDSA_sign @3719 - ECDSA_sign_ex @3403 - ECDSA_sign_setup @3416 - ECDSA_size @3706 - ECDSA_verify @3666 - ECPKParameters_print @3607 - ECPKParameters_print_fp @3453 - ECParameters_print @3485 - ECParameters_print_fp @3688 - EC_GF2m_simple_method @3738 - EC_GFp_mont_method @2689 - EC_GFp_nist_method @3529 - EC_GFp_simple_method @3099 - EC_GROUP_check @3555 - EC_GROUP_check_discriminant @3372 - EC_GROUP_clear_free @2550 - EC_GROUP_cmp @3627 - EC_GROUP_copy @2962 - EC_GROUP_dup @3661 - EC_GROUP_free @2877 - EC_GROUP_get0_generator @2693 - EC_GROUP_get0_seed @3601 - EC_GROUP_get_asn1_flag @3587 - EC_GROUP_get_basis_type @3637 - EC_GROUP_get_cofactor @2683 - EC_GROUP_get_curve_GF2m @3500 - EC_GROUP_get_curve_GFp @2985 - EC_GROUP_get_curve_name @3695 - EC_GROUP_get_degree @3570 - EC_GROUP_get_mont_data @4772 - EC_GROUP_get_order @2701 - EC_GROUP_get_pentanomial_basis @3409 - EC_GROUP_get_point_conversion_form @3405 - EC_GROUP_get_seed_len @3517 - EC_GROUP_get_trinomial_basis @3347 - EC_GROUP_have_precompute_mult @3429 - EC_GROUP_method_of @2568 - EC_GROUP_new @2995 - EC_GROUP_new_by_curve_name @3711 - EC_GROUP_new_curve_GF2m @3382 - EC_GROUP_new_curve_GFp @2885 - EC_GROUP_precompute_mult @3100 - EC_GROUP_set_asn1_flag @3749 - EC_GROUP_set_curve_GF2m @3545 - EC_GROUP_set_curve_GFp @2564 - EC_GROUP_set_curve_name @3533 - EC_GROUP_set_generator @2724 - EC_GROUP_set_point_conversion_form @3617 - EC_GROUP_set_seed @3494 - EC_KEY_check_key @3750 - EC_KEY_clear_flags @4602 - EC_KEY_copy @3369 - EC_KEY_dup @3729 - EC_KEY_free @3422 - EC_KEY_generate_key @3550 - EC_KEY_get0_group @3575 - EC_KEY_get0_private_key @3608 - EC_KEY_get0_public_key @3480 - EC_KEY_get_conv_form @3388 - EC_KEY_get_enc_flags @3622 - EC_KEY_get_flags @4593 - EC_KEY_get_key_method_data @3402 - EC_KEY_insert_key_method_data @3557 - EC_KEY_new @3663 - EC_KEY_new_by_curve_name @3353 - EC_KEY_precompute_mult @3374 - EC_KEY_print @3742 - EC_KEY_print_fp @3430 - EC_KEY_set_asn1_flag @3400 - EC_KEY_set_conv_form @3443 - EC_KEY_set_enc_flags @3665 - EC_KEY_set_flags @4603 - EC_KEY_set_group @3512 - EC_KEY_set_private_key @3459 - EC_KEY_set_public_key @3682 - EC_KEY_set_public_key_affine_coordinates @4585 - EC_KEY_up_ref @3418 - EC_METHOD_get_field_type @3528 - EC_POINT_add @2532 - EC_POINT_bn2point @3398 - EC_POINT_clear_free @3039 - EC_POINT_cmp @2953 - EC_POINT_copy @3010 - EC_POINT_dbl @3070 - EC_POINT_dup @3444 - EC_POINT_free @2929 - EC_POINT_get_Jprojective_coordinates_GFp @2779 - EC_POINT_get_affine_coordinates_GF2m @3660 - EC_POINT_get_affine_coordinates_GFp @2909 - EC_POINT_hex2point @3763 - EC_POINT_invert @2896 - EC_POINT_is_at_infinity @2616 - EC_POINT_is_on_curve @2769 - EC_POINT_make_affine @3114 - EC_POINT_method_of @2852 - EC_POINT_mul @2831 - EC_POINT_new @2924 - EC_POINT_oct2point @2578 - EC_POINT_point2bn @3379 - EC_POINT_point2hex @3667 - EC_POINT_point2oct @3178 - EC_POINT_set_Jprojective_coordinates_GFp @2575 - EC_POINT_set_affine_coordinates_GF2m @3360 - EC_POINT_set_affine_coordinates_GFp @2611 - EC_POINT_set_compressed_coordinates_GF2m @3626 - EC_POINT_set_compressed_coordinates_GFp @2597 - EC_POINT_set_to_infinity @3176 - EC_POINTs_make_affine @2830 - EC_POINTs_mul @2940 - EC_curve_nid2nist @4688 - EC_curve_nist2nid @4684 - EC_get_builtin_curves @3447 - EDIPARTYNAME_free @2883 - EDIPARTYNAME_it @3005 - EDIPARTYNAME_new @2671 - ENGINE_add @2518 - ENGINE_add_conf_module @3202 - ENGINE_by_id @2493 - ENGINE_cleanup @2949 - ENGINE_cmd_is_executable @2759 - ENGINE_ctrl @2481 - ENGINE_ctrl_cmd @2900 - ENGINE_ctrl_cmd_string @2628 - ENGINE_finish @2478 - ENGINE_free @2502 - ENGINE_get_DH @2480 - ENGINE_get_DSA @2520 - ENGINE_get_ECDH @3716 - ENGINE_get_ECDSA @3723 - ENGINE_get_RAND @2491 - ENGINE_get_RSA @2489 - ENGINE_get_STORE @3668 - ENGINE_get_cipher @2756 - ENGINE_get_cipher_engine @3008 - ENGINE_get_ciphers @2529 - ENGINE_get_cmd_defns @2658 - ENGINE_get_ctrl_function @2521 - ENGINE_get_default_DH @2488 - ENGINE_get_default_DSA @2506 - ENGINE_get_default_ECDH @3387 - ENGINE_get_default_ECDSA @3662 - ENGINE_get_default_RAND @2509 - ENGINE_get_default_RSA @2470 - ENGINE_get_destroy_function @3080 - ENGINE_get_digest @2748 - ENGINE_get_digest_engine @2563 - ENGINE_get_digests @2816 - ENGINE_get_ex_data @2856 - ENGINE_get_ex_new_index @2826 - ENGINE_get_finish_function @2469 - ENGINE_get_first @2492 - ENGINE_get_flags @2911 - ENGINE_get_id @2516 - ENGINE_get_init_function @2482 - ENGINE_get_last @2486 - ENGINE_get_load_privkey_function @3172 - ENGINE_get_load_pubkey_function @2792 - ENGINE_get_name @2485 - ENGINE_get_next @2504 - ENGINE_get_pkey_asn1_meth @4151 - ENGINE_get_pkey_asn1_meth_engine @4140 - ENGINE_get_pkey_asn1_meth_str @4393 - ENGINE_get_pkey_asn1_meths @4342 - ENGINE_get_pkey_meth @4154 - ENGINE_get_pkey_meth_engine @4425 - ENGINE_get_pkey_meths @4287 - ENGINE_get_prev @2487 - ENGINE_get_ssl_client_cert_function @4045 - ENGINE_get_static_state @3393 - ENGINE_get_table_flags @3143 - ENGINE_init @2475 - ENGINE_load_builtin_engines @2708 - ENGINE_load_cryptodev @2617 - ENGINE_load_dynamic @2547 - ENGINE_load_openssl @2657 - ENGINE_load_private_key @2498 - ENGINE_load_public_key @2479 - ENGINE_load_rdrand @4640 - ENGINE_load_ssl_client_cert @4046 - ENGINE_new @2515 - ENGINE_pkey_asn1_find_str @4282 - ENGINE_register_DH @2584 - ENGINE_register_DSA @2762 - ENGINE_register_ECDH @3355 - ENGINE_register_ECDSA @3335 - ENGINE_register_RAND @2609 - ENGINE_register_RSA @2664 - ENGINE_register_STORE @3685 - ENGINE_register_all_DH @2907 - ENGINE_register_all_DSA @2918 - ENGINE_register_all_ECDH @3646 - ENGINE_register_all_ECDSA @3658 - ENGINE_register_all_RAND @2546 - ENGINE_register_all_RSA @2809 - ENGINE_register_all_STORE @3567 - ENGINE_register_all_ciphers @3009 - ENGINE_register_all_complete @2970 - ENGINE_register_all_digests @2637 - ENGINE_register_all_pkey_asn1_meths @4398 - ENGINE_register_all_pkey_meths @4367 - ENGINE_register_ciphers @2620 - ENGINE_register_complete @2941 - ENGINE_register_digests @2889 - ENGINE_register_pkey_asn1_meths @4297 - ENGINE_register_pkey_meths @4129 - ENGINE_remove @2501 - ENGINE_set_DH @2473 - ENGINE_set_DSA @2468 - ENGINE_set_ECDH @3477 - ENGINE_set_ECDSA @3605 - ENGINE_set_RAND @2511 - ENGINE_set_RSA @2497 - ENGINE_set_STORE @3334 - ENGINE_set_ciphers @2676 - ENGINE_set_cmd_defns @2875 - ENGINE_set_ctrl_function @2522 - ENGINE_set_default @2490 - ENGINE_set_default_DH @2514 - ENGINE_set_default_DSA @2484 - ENGINE_set_default_ECDH @3759 - ENGINE_set_default_ECDSA @3546 - ENGINE_set_default_RAND @2499 - ENGINE_set_default_RSA @2508 - ENGINE_set_default_ciphers @3029 - ENGINE_set_default_digests @2661 - ENGINE_set_default_pkey_asn1_meths @4193 - ENGINE_set_default_pkey_meths @4300 - ENGINE_set_default_string @3184 - ENGINE_set_destroy_function @2992 - ENGINE_set_digests @2937 - ENGINE_set_ex_data @2980 - ENGINE_set_finish_function @2494 - ENGINE_set_flags @3162 - ENGINE_set_id @2512 - ENGINE_set_init_function @2483 - ENGINE_set_load_privkey_function @2659 - ENGINE_set_load_pubkey_function @2764 - ENGINE_set_load_ssl_client_cert_function @4044 - ENGINE_set_name @2505 - ENGINE_set_pkey_asn1_meths @4409 - ENGINE_set_pkey_meths @4508 - ENGINE_set_table_flags @3073 - ENGINE_unregister_DH @2917 - ENGINE_unregister_DSA @2665 - ENGINE_unregister_ECDH @3441 - ENGINE_unregister_ECDSA @3769 - ENGINE_unregister_RAND @3044 - ENGINE_unregister_RSA @2539 - ENGINE_unregister_STORE @3384 - ENGINE_unregister_ciphers @2528 - ENGINE_unregister_digests @2813 - ENGINE_unregister_pkey_asn1_meths @4497 - ENGINE_unregister_pkey_meths @4478 - ENGINE_up_ref @3238 - ERR_add_error_data @1081 - ERR_add_error_vdata @4589 - ERR_clear_error @222 - ERR_error_string @223 - ERR_error_string_n @2291 - ERR_free_strings @224 - ERR_func_error_string @225 - ERR_get_err_state_table @226 - ERR_get_error @227 - ERR_get_error_line @228 - ERR_get_error_line_data @1515 - ERR_get_implementation @2601 - ERR_get_next_error_library @966 - ERR_get_state @229 - ERR_get_string_table @230 - ERR_lib_error_string @231 - ERR_load_ASN1_strings @232 - ERR_load_BIO_strings @233 - ERR_load_BN_strings @234 - ERR_load_BUF_strings @235 - ERR_load_CMS_strings @3942 - ERR_load_COMP_strings @2525 - ERR_load_CONF_strings @236 - ERR_load_CRYPTO_strings @1009 - ERR_load_DH_strings @237 - ERR_load_DSA_strings @238 - ERR_load_DSO_strings @2274 - ERR_load_ECDH_strings @3728 - ERR_load_ECDSA_strings @3636 - ERR_load_EC_strings @2849 - ERR_load_ENGINE_strings @2467 - ERR_load_ERR_strings @239 - ERR_load_EVP_strings @240 - ERR_load_OBJ_strings @241 - ERR_load_OCSP_strings @3177 - ERR_load_PEM_strings @242 - ERR_load_PKCS12_strings @1300 - ERR_load_PKCS7_strings @919 - ERR_load_RAND_strings @2205 - ERR_load_RSA_strings @244 - ERR_load_TS_strings @4314 - ERR_load_UI_strings @3091 - ERR_load_X509V3_strings @1164 - ERR_load_X509_strings @245 - ERR_load_crypto_strings @246 - ERR_load_strings @247 - ERR_peek_error @248 - ERR_peek_error_line @249 - ERR_peek_error_line_data @1516 - ERR_peek_last_error @3205 - ERR_peek_last_error_line @3203 - ERR_peek_last_error_line_data @3204 - ERR_pop_to_mark @3566 - ERR_print_errors @250 - ERR_print_errors_cb @2675 - ERR_print_errors_fp @251 - ERR_put_error @252 - ERR_reason_error_string @253 - ERR_release_err_state_table @3247 - ERR_remove_state @254 - ERR_remove_thread_state @4445 - ERR_set_error_data @1082 - ERR_set_implementation @2848 - ERR_set_mark @3332 - ERR_unload_strings @2881 - ESS_CERT_ID_dup @4203 - ESS_CERT_ID_free @4477 - ESS_CERT_ID_new @4281 - ESS_ISSUER_SERIAL_dup @4491 - ESS_ISSUER_SERIAL_free @4391 - ESS_ISSUER_SERIAL_new @4404 - ESS_SIGNING_CERT_dup @4452 - ESS_SIGNING_CERT_free @4504 - ESS_SIGNING_CERT_new @4385 - EVP_BytesToKey @255 - EVP_CIPHER_CTX_block_size @3879 - EVP_CIPHER_CTX_cipher @3888 - EVP_CIPHER_CTX_cleanup @256 - EVP_CIPHER_CTX_clear_flags @4050 - EVP_CIPHER_CTX_copy @4549 - EVP_CIPHER_CTX_ctrl @2400 - EVP_CIPHER_CTX_flags @3891 - EVP_CIPHER_CTX_free @3783 - EVP_CIPHER_CTX_get_app_data @3889 - EVP_CIPHER_CTX_init @961 - EVP_CIPHER_CTX_iv_length @3899 - EVP_CIPHER_CTX_key_length @3841 - EVP_CIPHER_CTX_new @3782 - EVP_CIPHER_CTX_nid @3831 - EVP_CIPHER_CTX_rand_key @3730 - EVP_CIPHER_CTX_set_app_data @3819 - EVP_CIPHER_CTX_set_flags @4059 - EVP_CIPHER_CTX_set_key_length @2399 - EVP_CIPHER_CTX_set_padding @3019 - EVP_CIPHER_CTX_test_flags @4069 - EVP_CIPHER_asn1_to_param @1083 - EVP_CIPHER_block_size @3816 - EVP_CIPHER_do_all @4353 - EVP_CIPHER_do_all_sorted @4429 - EVP_CIPHER_flags @3857 - EVP_CIPHER_get_asn1_iv @1085 - EVP_CIPHER_iv_length @3836 - EVP_CIPHER_key_length @3873 - EVP_CIPHER_nid @3877 - EVP_CIPHER_param_to_asn1 @1084 - EVP_CIPHER_set_asn1_iv @1086 - EVP_CIPHER_type @1649 - EVP_CipherFinal @257 - EVP_CipherFinal_ex @2602 - EVP_CipherInit @258 - EVP_CipherInit_ex @2915 - EVP_CipherUpdate @259 - EVP_Cipher @3874 - EVP_DecodeBlock @260 - EVP_DecodeFinal @261 - EVP_DecodeInit @262 - EVP_DecodeUpdate @263 - EVP_DecryptFinal @264 - EVP_DecryptFinal_ex @2656 - EVP_DecryptInit @265 - EVP_DecryptInit_ex @3067 - EVP_DecryptUpdate @266 - EVP_DigestFinal @267 - EVP_DigestFinal_ex @2936 - EVP_DigestInit @268 - EVP_DigestInit_ex @3109 - EVP_DigestSignFinal @4372 - EVP_DigestSignInit @4144 - EVP_DigestUpdate @269 - EVP_DigestVerifyFinal @4206 - EVP_DigestVerifyInit @4299 - EVP_Digest @3165 - EVP_EncodeBlock @270 - EVP_EncodeFinal @271 - EVP_EncodeInit @272 - EVP_EncodeUpdate @273 - EVP_EncryptFinal @274 - EVP_EncryptFinal_ex @2660 - EVP_EncryptInit @275 - EVP_EncryptInit_ex @2894 - EVP_EncryptUpdate @276 - EVP_MD_CTX_cleanup @2821 - EVP_MD_CTX_clear_flags @3853 - EVP_MD_CTX_copy @1202 - EVP_MD_CTX_copy_ex @2589 - EVP_MD_CTX_create @2712 - EVP_MD_CTX_destroy @2925 - EVP_MD_CTX_init @2630 - EVP_MD_CTX_md @3896 - EVP_MD_CTX_set_flags @3883 - EVP_MD_CTX_test_flags @3845 - EVP_MD_block_size @3890 - EVP_MD_do_all @4442 - EVP_MD_do_all_sorted @4253 - EVP_MD_flags @4537 - EVP_MD_pkey_type @3852 - EVP_MD_size @3844 - EVP_MD_type @3837 - EVP_OpenFinal @277 - EVP_OpenInit @278 - EVP_PBE_CipherInit @1650 - EVP_PBE_alg_add @1322 - EVP_PBE_alg_add_type @4437 - EVP_PBE_cleanup @1324 - EVP_PBE_find @4386 - EVP_PKCS82PKEY @1318 - EVP_PKEY2PKCS8 @1319 - EVP_PKEY2PKCS8_broken @2244 - EVP_PKEY_CTX_ctrl @4233 - EVP_PKEY_CTX_ctrl_str @4187 - EVP_PKEY_CTX_dup @4316 - EVP_PKEY_CTX_free @4430 - EVP_PKEY_CTX_get0_peerkey @4465 - EVP_PKEY_CTX_get0_pkey @4381 - EVP_PKEY_CTX_get_app_data @4344 - EVP_PKEY_CTX_get_cb @4419 - EVP_PKEY_CTX_get_data @4218 - EVP_PKEY_CTX_get_keygen_info @4137 - EVP_PKEY_CTX_get_operation @4434 - EVP_PKEY_CTX_new @4119 - EVP_PKEY_CTX_new_id @4532 - EVP_PKEY_CTX_set0_keygen_info @4214 - EVP_PKEY_CTX_set_app_data @4330 - EVP_PKEY_CTX_set_cb @4272 - EVP_PKEY_CTX_set_data @4182 - EVP_PKEY_add1_attr @3690 - EVP_PKEY_add1_attr_by_NID @3345 - EVP_PKEY_add1_attr_by_OBJ @3756 - EVP_PKEY_add1_attr_by_txt @3410 - EVP_PKEY_asn1_add0 @4130 - EVP_PKEY_asn1_add_alias @4222 - EVP_PKEY_asn1_copy @4427 - EVP_PKEY_asn1_find @4121 - EVP_PKEY_asn1_find_str @4383 - EVP_PKEY_asn1_free @4503 - EVP_PKEY_asn1_get0 @4258 - EVP_PKEY_asn1_get0_info @4320 - EVP_PKEY_asn1_get_count @4296 - EVP_PKEY_asn1_new @4152 - EVP_PKEY_asn1_set_ctrl @4530 - EVP_PKEY_asn1_set_free @4178 - EVP_PKEY_asn1_set_item @4774 - EVP_PKEY_asn1_set_param @4361 - EVP_PKEY_asn1_set_private @4308 - EVP_PKEY_asn1_set_public @4171 - EVP_PKEY_assign @279 - EVP_PKEY_base_id @4230 - EVP_PKEY_bits @1010 - EVP_PKEY_cmp @3433 - EVP_PKEY_cmp_parameters @967 - EVP_PKEY_copy_parameters @280 - EVP_PKEY_decrypt @1070 - EVP_PKEY_decrypt_init @4245 - EVP_PKEY_decrypt_old @4378 - EVP_PKEY_delete_attr @3624 - EVP_PKEY_derive @4388 - EVP_PKEY_derive_init @4220 - EVP_PKEY_derive_set_peer @4488 - EVP_PKEY_encrypt @1071 - EVP_PKEY_encrypt_init @4164 - EVP_PKEY_encrypt_old @4163 - EVP_PKEY_free @281 - EVP_PKEY_get0 @4439 - EVP_PKEY_get0_asn1 @4179 - EVP_PKEY_get1_DH @2128 - EVP_PKEY_get1_DSA @1935 - EVP_PKEY_get1_EC_KEY @3385 - EVP_PKEY_get1_RSA @2034 - EVP_PKEY_get_attr @3439 - EVP_PKEY_get_attr_by_NID @3721 - EVP_PKEY_get_attr_by_OBJ @3651 - EVP_PKEY_get_attr_count @3498 - EVP_PKEY_get_default_digest_nid @4188 - EVP_PKEY_id @4470 - EVP_PKEY_keygen @4143 - EVP_PKEY_keygen_init @4183 - EVP_PKEY_meth_add0 @4446 - EVP_PKEY_meth_copy @4588 - EVP_PKEY_meth_find @4469 - EVP_PKEY_meth_free @4460 - EVP_PKEY_meth_get0_info @4587 - EVP_PKEY_meth_new @4448 - EVP_PKEY_meth_set_cleanup @4502 - EVP_PKEY_meth_set_copy @4527 - EVP_PKEY_meth_set_ctrl @4236 - EVP_PKEY_meth_set_decrypt @4135 - EVP_PKEY_meth_set_derive @4276 - EVP_PKEY_meth_set_encrypt @4362 - EVP_PKEY_meth_set_init @4264 - EVP_PKEY_meth_set_keygen @4514 - EVP_PKEY_meth_set_paramgen @4517 - EVP_PKEY_meth_set_sign @4243 - EVP_PKEY_meth_set_signctx @4426 - EVP_PKEY_meth_set_verify @4317 - EVP_PKEY_meth_set_verify_recover @4269 - EVP_PKEY_meth_set_verifyctx @4332 - EVP_PKEY_missing_parameters @282 - EVP_PKEY_new @283 - EVP_PKEY_new_mac_key @4174 - EVP_PKEY_paramgen @4516 - EVP_PKEY_paramgen_init @4261 - EVP_PKEY_print_params @4207 - EVP_PKEY_print_private @4248 - EVP_PKEY_print_public @4118 - EVP_PKEY_save_parameters @284 - EVP_PKEY_set1_DH @2107 - EVP_PKEY_set1_DSA @1970 - EVP_PKEY_set1_EC_KEY @3450 - EVP_PKEY_set1_RSA @2063 - EVP_PKEY_set_type @4524 - EVP_PKEY_set_type_str @4136 - EVP_PKEY_sign @4262 - EVP_PKEY_sign_init @4125 - EVP_PKEY_size @285 - EVP_PKEY_type @286 - EVP_PKEY_verify @4369 - EVP_PKEY_verify_init @4474 - EVP_PKEY_verify_recover @4519 - EVP_PKEY_verify_recover_init @4181 - EVP_SealFinal @287 - EVP_SealInit @288 - EVP_SignFinal @289 - EVP_VerifyFinal @290 - EVP_add_alg_module @4077 - EVP_add_cipher @292 - EVP_add_digest @293 - EVP_aes_128_cbc @2927 - EVP_aes_128_cbc_hmac_sha1 @4637 - EVP_aes_128_cbc_hmac_sha256 @4731 - EVP_aes_128_ccm @4609 - EVP_aes_128_cfb128 @3222 - EVP_aes_128_cfb1 @3251 - EVP_aes_128_cfb8 @3248 - EVP_aes_128_ctr @4590 - EVP_aes_128_ecb @2644 - EVP_aes_128_gcm @4601 - EVP_aes_128_ofb @3224 - EVP_aes_128_wrap @4743 - EVP_aes_128_xts @4595 - EVP_aes_192_cbc @3155 - EVP_aes_192_ccm @4617 - EVP_aes_192_cfb128 @3225 - EVP_aes_192_cfb1 @3264 - EVP_aes_192_cfb8 @3252 - EVP_aes_192_ctr @4586 - EVP_aes_192_ecb @2862 - EVP_aes_192_gcm @4611 - EVP_aes_192_ofb @3221 - EVP_aes_192_wrap @4730 - EVP_aes_256_cbc @2996 - EVP_aes_256_cbc_hmac_sha1 @4656 - EVP_aes_256_cbc_hmac_sha256 @4740 - EVP_aes_256_ccm @4605 - EVP_aes_256_cfb128 @3223 - EVP_aes_256_cfb1 @3271 - EVP_aes_256_cfb8 @3255 - EVP_aes_256_ctr @4591 - EVP_aes_256_ecb @2720 - EVP_aes_256_gcm @4615 - EVP_aes_256_ofb @3220 - EVP_aes_256_wrap @4719 - EVP_aes_256_xts @4599 - EVP_bf_cbc @294 - EVP_bf_cfb64 @295 - EVP_bf_ecb @296 - EVP_bf_ofb @297 - EVP_camellia_128_cbc @3795 - EVP_camellia_128_cfb128 @3796 - EVP_camellia_128_cfb1 @3797 - EVP_camellia_128_cfb8 @3798 - EVP_camellia_128_ecb @3799 - EVP_camellia_128_ofb @3800 - EVP_camellia_192_cbc @3801 - EVP_camellia_192_cfb128 @3802 - EVP_camellia_192_cfb1 @3803 - EVP_camellia_192_cfb8 @3804 - EVP_camellia_192_ecb @3805 - EVP_camellia_192_ofb @3806 - EVP_camellia_256_cbc @3807 - EVP_camellia_256_cfb128 @3808 - EVP_camellia_256_cfb1 @3809 - EVP_camellia_256_cfb8 @3810 - EVP_camellia_256_ecb @3811 - EVP_camellia_256_ofb @3812 - EVP_cast5_cbc @983 - EVP_cast5_cfb64 @984 - EVP_cast5_ecb @985 - EVP_cast5_ofb @986 - EVP_cleanup @298 - EVP_des_cbc @299 - EVP_des_cfb1 @3277 - EVP_des_cfb64 @300 - EVP_des_cfb8 @3267 - EVP_des_ecb @301 - EVP_des_ede3 @303 - EVP_des_ede3_cbc @304 - EVP_des_ede3_cfb1 @3280 - EVP_des_ede3_cfb64 @305 - EVP_des_ede3_cfb8 @3258 - EVP_des_ede3_ecb @3236 - EVP_des_ede3_ofb @306 - EVP_des_ede3_wrap @4737 - EVP_des_ede @302 - EVP_des_ede_cbc @307 - EVP_des_ede_cfb64 @308 - EVP_des_ede_ecb @3231 - EVP_des_ede_ofb @309 - EVP_des_ofb @310 - EVP_desx_cbc @311 - EVP_dss1 @313 - EVP_dss @312 - EVP_ecdsa @3724 - EVP_enc_null @314 - EVP_get_cipherbyname @315 - EVP_get_digestbyname @316 - EVP_get_pw_prompt @317 - EVP_idea_cbc @318 - EVP_idea_cfb64 @319 - EVP_idea_ecb @320 - EVP_idea_ofb @321 - EVP_md4 @2438 - EVP_md5 @323 - EVP_md_null @324 - EVP_mdc2 @942 - EVP_rc2_40_cbc @959 - EVP_rc2_64_cbc @1103 - EVP_rc2_cbc @325 - EVP_rc2_cfb64 @326 - EVP_rc2_ecb @327 - EVP_rc2_ofb @328 - EVP_rc4 @329 - EVP_rc4_40 @960 - EVP_rc4_hmac_md5 @4633 - EVP_read_pw_string @330 - EVP_read_pw_string_min @4552 - EVP_ripemd160 @1252 - EVP_seed_cbc @3914 - EVP_seed_cfb128 @3918 - EVP_seed_ecb @3916 - EVP_seed_ofb @3911 - EVP_set_pw_prompt @331 - EVP_sha1 @333 - EVP_sha224 @3314 - EVP_sha256 @3315 - EVP_sha384 @3312 - EVP_sha512 @3313 - EVP_sha @332 - EVP_whirlpool @4360 - EXTENDED_KEY_USAGE_free @2631 - EXTENDED_KEY_USAGE_it @3098 - EXTENDED_KEY_USAGE_new @2549 - FIPS_mode @3283 - FIPS_mode_set @3253 - GENERAL_NAMES_free @1216 - GENERAL_NAMES_it @2804 - GENERAL_NAMES_new @1215 - GENERAL_NAME_cmp @4506 - GENERAL_NAME_dup @4147 - GENERAL_NAME_free @1214 - GENERAL_NAME_get0_otherName @4511 - GENERAL_NAME_get0_value @4249 - GENERAL_NAME_it @2594 - GENERAL_NAME_new @1213 - GENERAL_NAME_print @2870 - GENERAL_NAME_set0_othername @4421 - GENERAL_NAME_set0_value @4225 - GENERAL_SUBTREE_free @3349 - GENERAL_SUBTREE_it @3694 - GENERAL_SUBTREE_new @3445 - HMAC @962 - HMAC_CTX_cleanup @2784 - HMAC_CTX_copy @4340 - HMAC_CTX_init @2747 - HMAC_CTX_set_flags @3288 - HMAC_Final @965 - HMAC_Init @963 - HMAC_Init_ex @2572 - HMAC_Update @964 - ISSUING_DIST_POINT_free @4403 - ISSUING_DIST_POINT_it @4431 - ISSUING_DIST_POINT_new @4266 - KRB5_APREQBODY_free @2692 - KRB5_APREQBODY_it @3061 - KRB5_APREQBODY_new @2626 - KRB5_APREQ_free @3179 - KRB5_APREQ_it @3079 - KRB5_APREQ_new @2984 - KRB5_AUTHDATA_free @2775 - KRB5_AUTHDATA_it @3121 - KRB5_AUTHDATA_new @2687 - KRB5_AUTHENTBODY_free @3049 - KRB5_AUTHENTBODY_it @2976 - KRB5_AUTHENTBODY_new @3003 - KRB5_AUTHENT_free @2645 - KRB5_AUTHENT_it @2735 - KRB5_AUTHENT_new @3103 - KRB5_CHECKSUM_free @2634 - KRB5_CHECKSUM_it @2531 - KRB5_CHECKSUM_new @3026 - KRB5_ENCDATA_free @2963 - KRB5_ENCDATA_it @2791 - KRB5_ENCDATA_new @2842 - KRB5_ENCKEY_free @2592 - KRB5_ENCKEY_it @2557 - KRB5_ENCKEY_new @2986 - KRB5_PRINCNAME_free @3096 - KRB5_PRINCNAME_it @3066 - KRB5_PRINCNAME_new @2699 - KRB5_TICKET_free @3156 - KRB5_TICKET_it @3154 - KRB5_TICKET_new @2983 - KRB5_TKTBODY_free @2624 - KRB5_TKTBODY_it @2750 - KRB5_TKTBODY_new @3089 - LONG_it @2864 - MD4 @2433 - MD4_Final @2435 - MD4_Init @2437 - MD4_Transform @2434 - MD4_Update @2436 - MD5 @339 - MD5_Final @340 - MD5_Init @341 - MD5_Transform @1011 - MD5_Update @342 - MDC2 @343 - MDC2_Final @344 - MDC2_Init @345 - MDC2_Update @346 - NAME_CONSTRAINTS_check @4494 - NAME_CONSTRAINTS_free @3338 - NAME_CONSTRAINTS_it @3350 - NAME_CONSTRAINTS_new @3478 - NCONF_WIN32 @3229 - NCONF_default @3227 - NCONF_dump_bio @2287 - NCONF_dump_fp @2285 - NCONF_free @2281 - NCONF_free_data @2289 - NCONF_get_number_e @2704 - NCONF_get_section @2286 - NCONF_get_string @2280 - NCONF_load @2276 - NCONF_load_bio @2284 - NCONF_load_fp @2278 - NCONF_new @2279 - NETSCAPE_CERT_SEQUENCE_free @1165 - NETSCAPE_CERT_SEQUENCE_it @2803 - NETSCAPE_CERT_SEQUENCE_new @1166 - NETSCAPE_SPKAC_free @347 - NETSCAPE_SPKAC_it @2641 - NETSCAPE_SPKAC_new @348 - NETSCAPE_SPKI_b64_decode @1901 - NETSCAPE_SPKI_b64_encode @1899 - NETSCAPE_SPKI_free @349 - NETSCAPE_SPKI_get_pubkey @1900 - NETSCAPE_SPKI_it @3006 - NETSCAPE_SPKI_new @350 - NETSCAPE_SPKI_print @1897 - NETSCAPE_SPKI_set_pubkey @1898 - NETSCAPE_SPKI_sign @351 - NETSCAPE_SPKI_verify @352 - NETSCAPE_X509_free @4246 - NETSCAPE_X509_it @4374 - NETSCAPE_X509_new @4485 - NOTICEREF_free @1503 - NOTICEREF_it @3030 - NOTICEREF_new @1501 - OBJ_NAME_add @1101 - OBJ_NAME_cleanup @1104 - OBJ_NAME_do_all @2939 - OBJ_NAME_do_all_sorted @2743 - OBJ_NAME_get @1105 - OBJ_NAME_init @1106 - OBJ_NAME_new_index @1107 - OBJ_NAME_remove @1108 - OBJ_add_object @353 - OBJ_add_sigid @4259 - OBJ_bsearch_ @4331 - OBJ_bsearch_ex_ @4294 - OBJ_cleanup @355 - OBJ_cmp @356 - OBJ_create @357 - OBJ_create_objects @997 - OBJ_dup @358 - OBJ_find_sigid_algs @4513 - OBJ_find_sigid_by_algs @4210 - OBJ_ln2nid @359 - OBJ_new_nid @360 - OBJ_nid2ln @361 - OBJ_nid2obj @362 - OBJ_nid2sn @363 - OBJ_obj2nid @364 - OBJ_obj2txt @1870 - OBJ_sigid_free @4263 - OBJ_sn2nid @365 - OBJ_txt2nid @366 - OBJ_txt2obj @1167 - OCSP_BASICRESP_add1_ext_i2d @2839 - OCSP_BASICRESP_add_ext @2556 - OCSP_BASICRESP_delete_ext @2553 - OCSP_BASICRESP_free @2838 - OCSP_BASICRESP_get1_ext_d2i @2905 - OCSP_BASICRESP_get_ext @3134 - OCSP_BASICRESP_get_ext_by_NID @3083 - OCSP_BASICRESP_get_ext_by_OBJ @2577 - OCSP_BASICRESP_get_ext_by_critical @2646 - OCSP_BASICRESP_get_ext_count @3014 - OCSP_BASICRESP_it @2800 - OCSP_BASICRESP_new @3077 - OCSP_CERTID_dup @4355 - OCSP_CERTID_free @2726 - OCSP_CERTID_it @2534 - OCSP_CERTID_new @3043 - OCSP_CERTSTATUS_free @2653 - OCSP_CERTSTATUS_it @3116 - OCSP_CERTSTATUS_new @2603 - OCSP_CRLID_free @2904 - OCSP_CRLID_it @3127 - OCSP_CRLID_new @2910 - OCSP_ONEREQ_add1_ext_i2d @3145 - OCSP_ONEREQ_add_ext @2934 - OCSP_ONEREQ_delete_ext @3166 - OCSP_ONEREQ_free @2796 - OCSP_ONEREQ_get1_ext_d2i @2545 - OCSP_ONEREQ_get_ext @2851 - OCSP_ONEREQ_get_ext_by_NID @2733 - OCSP_ONEREQ_get_ext_by_OBJ @2859 - OCSP_ONEREQ_get_ext_by_critical @2919 - OCSP_ONEREQ_get_ext_count @2717 - OCSP_ONEREQ_it @2912 - OCSP_ONEREQ_new @3153 - OCSP_REQINFO_free @2884 - OCSP_REQINFO_it @3001 - OCSP_REQINFO_new @3133 - OCSP_REQUEST_add1_ext_i2d @2828 - OCSP_REQUEST_add_ext @2710 - OCSP_REQUEST_delete_ext @2794 - OCSP_REQUEST_free @2827 - OCSP_REQUEST_get1_ext_d2i @2886 - OCSP_REQUEST_get_ext @2635 - OCSP_REQUEST_get_ext_by_NID @3078 - OCSP_REQUEST_get_ext_by_OBJ @2565 - OCSP_REQUEST_get_ext_by_critical @3161 - OCSP_REQUEST_get_ext_count @3129 - OCSP_REQUEST_it @2799 - OCSP_REQUEST_new @3034 - OCSP_REQUEST_print @2981 - OCSP_REQ_CTX_add1_header @4541 - OCSP_REQ_CTX_free @3921 - OCSP_REQ_CTX_get0_mem_bio @4709 - OCSP_REQ_CTX_http @4713 - OCSP_REQ_CTX_i2d @4708 - OCSP_REQ_CTX_nbio @4714 - OCSP_REQ_CTX_nbio_d2i @4718 - OCSP_REQ_CTX_new @4717 - OCSP_REQ_CTX_set1_req @4542 - OCSP_RESPBYTES_free @2926 - OCSP_RESPBYTES_it @2811 - OCSP_RESPBYTES_new @2711 - OCSP_RESPDATA_free @2818 - OCSP_RESPDATA_it @2968 - OCSP_RESPDATA_new @2688 - OCSP_RESPID_free @3124 - OCSP_RESPID_it @2994 - OCSP_RESPID_new @2967 - OCSP_RESPONSE_free @3173 - OCSP_RESPONSE_it @3111 - OCSP_RESPONSE_new @3023 - OCSP_RESPONSE_print @2749 - OCSP_REVOKEDINFO_free @2690 - OCSP_REVOKEDINFO_it @3032 - OCSP_REVOKEDINFO_new @2954 - OCSP_SERVICELOC_free @2876 - OCSP_SERVICELOC_it @2740 - OCSP_SERVICELOC_new @2610 - OCSP_SIGNATURE_free @3094 - OCSP_SIGNATURE_it @2554 - OCSP_SIGNATURE_new @2863 - OCSP_SINGLERESP_add1_ext_i2d @2866 - OCSP_SINGLERESP_add_ext @2975 - OCSP_SINGLERESP_delete_ext @2871 - OCSP_SINGLERESP_free @2707 - OCSP_SINGLERESP_get1_ext_d2i @2928 - OCSP_SINGLERESP_get_ext @2903 - OCSP_SINGLERESP_get_ext_by_NID @2825 - OCSP_SINGLERESP_get_ext_by_OBJ @2965 - OCSP_SINGLERESP_get_ext_by_critical @2652 - OCSP_SINGLERESP_get_ext_count @2579 - OCSP_SINGLERESP_it @2951 - OCSP_SINGLERESP_new @2758 - OCSP_accept_responses_new @3058 - OCSP_archive_cutoff_new @2574 - OCSP_basic_add1_cert @2600 - OCSP_basic_add1_nonce @2956 - OCSP_basic_add1_status @3123 - OCSP_basic_sign @2897 - OCSP_basic_verify @3048 - OCSP_cert_id_new @2921 - OCSP_cert_status_str @2647 - OCSP_cert_to_id @2966 - OCSP_check_nonce @2899 - OCSP_check_validity @2971 - OCSP_copy_nonce @2686 - OCSP_crlID_new @3181 - OCSP_crl_reason_str @2844 - OCSP_id_cmp @3076 - OCSP_id_get0_info @2960 - OCSP_id_issuer_cmp @2938 - OCSP_onereq_get0_id @3028 - OCSP_parse_url @2902 - OCSP_request_add0_id @3113 - OCSP_request_add1_cert @3117 - OCSP_request_add1_nonce @2874 - OCSP_request_is_signed @2590 - OCSP_request_onereq_count @3047 - OCSP_request_onereq_get0 @3101 - OCSP_request_set1_name @2716 - OCSP_request_sign @2935 - OCSP_request_verify @2703 - OCSP_resp_count @3025 - OCSP_resp_find @2605 - OCSP_resp_find_status @2713 - OCSP_resp_get0 @2593 - OCSP_response_create @3158 - OCSP_response_get1_basic @3164 - OCSP_response_status @2561 - OCSP_response_status_str @2598 - OCSP_sendreq_bio @2551 - OCSP_sendreq_nbio @3923 - OCSP_sendreq_new @3924 - OCSP_set_max_response_length @4716 - OCSP_single_get0_status @2989 - OCSP_url_svcloc_new @2973 - OPENSSL_DIR_end @3396 - OPENSSL_DIR_read @3657 - OPENSSL_add_all_algorithms_conf @3213 - OPENSSL_add_all_algorithms_noconf @3212 - OPENSSL_asc2uni @1282 - OPENSSL_cleanse @3245 - OPENSSL_config @3188 - OPENSSL_cpuid_setup @4675 - OPENSSL_gmtime @4567 - OPENSSL_gmtime_adj @4568 - OPENSSL_gmtime_diff @4745 - OPENSSL_ia32cap_loc @3467 - OPENSSL_init @4091 - OPENSSL_isservice @4048 - OPENSSL_issetugid @2465 - OPENSSL_load_builtin_modules @3214 - OPENSSL_memcmp @4565 - OPENSSL_no_config @3228 - OPENSSL_showfatal @4676 - OPENSSL_stderr @4674 - OPENSSL_strcasecmp @4564 - OPENSSL_strncasecmp @4566 - OPENSSL_uni2asc @1283 - OTHERNAME_cmp @4224 - OTHERNAME_free @2112 - OTHERNAME_it @2820 - OTHERNAME_new @1999 - OpenSSLDie @3244 - OpenSSL_add_all_ciphers @509 - OpenSSL_add_all_digests @510 - PBE2PARAM_free @1404 - PBE2PARAM_it @2753 - PBE2PARAM_new @1402 - PBEPARAM_free @1313 - PBEPARAM_it @3002 - PBEPARAM_new @1311 - PBKDF2PARAM_free @1400 - PBKDF2PARAM_it @2548 - PBKDF2PARAM_new @1398 - PEM_ASN1_read @367 - PEM_ASN1_read_bio @368 - PEM_ASN1_write @369 - PEM_ASN1_write_bio @370 - PEM_SealFinal @371 - PEM_SealInit @372 - PEM_SealUpdate @373 - PEM_SignFinal @374 - PEM_SignInit @375 - PEM_SignUpdate @376 - PEM_X509_INFO_read @377 - PEM_X509_INFO_read_bio @378 - PEM_X509_INFO_write_bio @379 - PEM_bytes_read_bio @2766 - PEM_def_callback @2948 - PEM_dek_info @380 - PEM_do_header @381 - PEM_get_EVP_CIPHER_INFO @382 - PEM_proc_type @383 - PEM_read @384 - PEM_read_CMS @3983 - PEM_read_DHparams @385 - PEM_read_DSAPrivateKey @386 - PEM_read_DSA_PUBKEY @1984 - PEM_read_DSAparams @387 - PEM_read_ECPKParameters @3683 - PEM_read_ECPrivateKey @3632 - PEM_read_EC_PUBKEY @3618 - PEM_read_NETSCAPE_CERT_SEQUENCE @1168 - PEM_read_PKCS7 @388 - PEM_read_PKCS8 @1782 - PEM_read_PKCS8_PRIV_KEY_INFO @1786 - PEM_read_PUBKEY @2012 - PEM_read_PrivateKey @389 - PEM_read_RSAPrivateKey @390 - PEM_read_RSAPublicKey @947 - PEM_read_RSA_PUBKEY @1977 - PEM_read_X509 @391 - PEM_read_X509_AUX @1917 - PEM_read_X509_CERT_PAIR @3507 - PEM_read_X509_CRL @392 - PEM_read_X509_REQ @393 - PEM_read_bio @394 - PEM_read_bio_CMS @4014 - PEM_read_bio_DHparams @395 - PEM_read_bio_DSAPrivateKey @396 - PEM_read_bio_DSA_PUBKEY @2088 - PEM_read_bio_DSAparams @397 - PEM_read_bio_ECPKParameters @3408 - PEM_read_bio_ECPrivateKey @3714 - PEM_read_bio_EC_PUBKEY @3519 - PEM_read_bio_NETSCAPE_CERT_SEQUENCE @1169 - PEM_read_bio_PKCS7 @398 - PEM_read_bio_PKCS8 @1787 - PEM_read_bio_PKCS8_PRIV_KEY_INFO @1778 - PEM_read_bio_PUBKEY @1995 - PEM_read_bio_Parameters @4489 - PEM_read_bio_PrivateKey @399 - PEM_read_bio_RSAPrivateKey @400 - PEM_read_bio_RSAPublicKey @943 - PEM_read_bio_RSA_PUBKEY @2081 - PEM_read_bio_X509 @401 - PEM_read_bio_X509_AUX @1959 - PEM_read_bio_X509_CERT_PAIR @3753 - PEM_read_bio_X509_CRL @402 - PEM_read_bio_X509_REQ @403 - PEM_write @404 - PEM_write_CMS @3939 - PEM_write_DHparams @405 - PEM_write_DHxparams @4686 - PEM_write_DSAPrivateKey @406 - PEM_write_DSA_PUBKEY @2101 - PEM_write_DSAparams @407 - PEM_write_ECPKParameters @3643 - PEM_write_ECPrivateKey @3679 - PEM_write_EC_PUBKEY @3609 - PEM_write_NETSCAPE_CERT_SEQUENCE @1170 - PEM_write_PKCS7 @408 - PEM_write_PKCS8PrivateKey @1798 - PEM_write_PKCS8PrivateKey_nid @2165 - PEM_write_PKCS8 @1785 - PEM_write_PKCS8_PRIV_KEY_INFO @1788 - PEM_write_PUBKEY @1921 - PEM_write_PrivateKey @409 - PEM_write_RSAPrivateKey @410 - PEM_write_RSAPublicKey @949 - PEM_write_RSA_PUBKEY @2095 - PEM_write_X509 @411 - PEM_write_X509_AUX @2039 - PEM_write_X509_CERT_PAIR @3696 - PEM_write_X509_CRL @412 - PEM_write_X509_REQ @413 - PEM_write_X509_REQ_NEW @2251 - PEM_write_bio @414 - PEM_write_bio_ASN1_stream @4499 - PEM_write_bio_CMS @3960 - PEM_write_bio_CMS_stream @4466 - PEM_write_bio_DHparams @415 - PEM_write_bio_DHxparams @4690 - PEM_write_bio_DSAPrivateKey @416 - PEM_write_bio_DSA_PUBKEY @1968 - PEM_write_bio_DSAparams @417 - PEM_write_bio_ECPKParameters @3456 - PEM_write_bio_ECPrivateKey @3424 - PEM_write_bio_EC_PUBKEY @3481 - PEM_write_bio_NETSCAPE_CERT_SEQUENCE @1171 - PEM_write_bio_PKCS7 @418 - PEM_write_bio_PKCS7_stream @4189 - PEM_write_bio_PKCS8PrivateKey @1797 - PEM_write_bio_PKCS8PrivateKey_nid @2166 - PEM_write_bio_PKCS8 @1776 - PEM_write_bio_PKCS8_PRIV_KEY_INFO @1781 - PEM_write_bio_PUBKEY @2117 - PEM_write_bio_Parameters @4410 - PEM_write_bio_PrivateKey @419 - PEM_write_bio_RSAPrivateKey @420 - PEM_write_bio_RSAPublicKey @944 - PEM_write_bio_RSA_PUBKEY @1961 - PEM_write_bio_X509 @421 - PEM_write_bio_X509_AUX @2066 - PEM_write_bio_X509_CERT_PAIR @3432 - PEM_write_bio_X509_CRL @422 - PEM_write_bio_X509_REQ @423 - PEM_write_bio_X509_REQ_NEW @2250 - PKCS12_AUTHSAFES_it @2719 - PKCS12_BAGS_free @1287 - PKCS12_BAGS_it @2972 - PKCS12_BAGS_new @1285 - PKCS12_MAC_DATA_free @1295 - PKCS12_MAC_DATA_it @3057 - PKCS12_MAC_DATA_new @1293 - PKCS12_MAKE_KEYBAG @1263 - PKCS12_MAKE_SHKEYBAG @1265 - PKCS12_PBE_add @1301 - PKCS12_PBE_keyivgen @1517 - PKCS12_SAFEBAGS_it @2872 - PKCS12_SAFEBAG_free @1299 - PKCS12_SAFEBAG_it @2700 - PKCS12_SAFEBAG_new @1297 - PKCS12_add_CSPName_asc @2615 - PKCS12_add_cert @3726 - PKCS12_add_friendlyname_asc @1269 - PKCS12_add_friendlyname_uni @1270 - PKCS12_add_key @3761 - PKCS12_add_localkeyid @1268 - PKCS12_add_safe @3352 - PKCS12_add_safes @3464 - PKCS12_certbag2x509 @2672 - PKCS12_certbag2x509crl @2754 - PKCS12_create @1305 - PKCS12_decrypt_skey @2734 - PKCS12_free @1291 - PKCS12_gen_mac @1278 - PKCS12_get_attr_gen @1303 - PKCS12_get_friendlyname @1271 - PKCS12_init @1275 - PKCS12_item_decrypt_d2i @2526 - PKCS12_item_i2d_encrypt @2696 - PKCS12_item_pack_safebag @2887 - PKCS12_it @2651 - PKCS12_key_gen_asc @1276 - PKCS12_key_gen_uni @1277 - PKCS12_new @1290 - PKCS12_newpass @2141 - PKCS12_pack_authsafes @2721 - PKCS12_pack_p7data @1266 - PKCS12_pack_p7encdata @1267 - PKCS12_parse @1304 - PKCS12_pbe_crypt @1272 - PKCS12_set_mac @1280 - PKCS12_setup_mac @1281 - PKCS12_unpack_authsafes @2639 - PKCS12_unpack_p7data @2684 - PKCS12_unpack_p7encdata @2746 - PKCS12_verify_mac @1279 - PKCS12_x5092certbag @3108 - PKCS12_x509crl2certbag @2739 - PKCS1_MGF1 @3324 - PKCS5_PBE_add @1775 - PKCS5_PBE_keyivgen @1789 - PKCS5_PBKDF2_HMAC @4515 - PKCS5_PBKDF2_HMAC_SHA1 @1795 - PKCS5_pbe2_set @1794 - PKCS5_pbe2_set_iv @4341 - PKCS5_pbe_set0_algor @4238 - PKCS5_pbe_set @1323 - PKCS5_pbkdf2_set @4657 - PKCS5_v2_PBE_keyivgen @1796 - PKCS7_ATTR_SIGN_it @2632 - PKCS7_ATTR_VERIFY_it @3060 - PKCS7_DIGEST_free @424 - PKCS7_DIGEST_it @3107 - PKCS7_DIGEST_new @425 - PKCS7_ENCRYPT_free @426 - PKCS7_ENCRYPT_it @2681 - PKCS7_ENCRYPT_new @427 - PKCS7_ENC_CONTENT_free @428 - PKCS7_ENC_CONTENT_it @3112 - PKCS7_ENC_CONTENT_new @429 - PKCS7_ENVELOPE_free @430 - PKCS7_ENVELOPE_it @2537 - PKCS7_ENVELOPE_new @431 - PKCS7_ISSUER_AND_SERIAL_digest @432 - PKCS7_ISSUER_AND_SERIAL_free @433 - PKCS7_ISSUER_AND_SERIAL_it @2752 - PKCS7_ISSUER_AND_SERIAL_new @434 - PKCS7_RECIP_INFO_free @435 - PKCS7_RECIP_INFO_get0_alg @4226 - PKCS7_RECIP_INFO_it @3097 - PKCS7_RECIP_INFO_new @436 - PKCS7_RECIP_INFO_set @1072 - PKCS7_SIGNED_free @437 - PKCS7_SIGNED_it @2755 - PKCS7_SIGNED_new @438 - PKCS7_SIGNER_INFO_free @439 - PKCS7_SIGNER_INFO_get0_algs @4376 - PKCS7_SIGNER_INFO_it @2698 - PKCS7_SIGNER_INFO_new @440 - PKCS7_SIGNER_INFO_set @930 - PKCS7_SIGNER_INFO_sign @4260 - PKCS7_SIGN_ENVELOPE_free @441 - PKCS7_SIGN_ENVELOPE_it @2882 - PKCS7_SIGN_ENVELOPE_new @442 - PKCS7_add0_attrib_signing_time @4131 - PKCS7_add1_attrib_digest @4406 - PKCS7_add_attrib_content_type @4444 - PKCS7_add_attrib_smimecap @2156 - PKCS7_add_attribute @1138 - PKCS7_add_certificate @932 - PKCS7_add_crl @933 - PKCS7_add_recipient @1073 - PKCS7_add_recipient_info @1074 - PKCS7_add_signature @938 - PKCS7_add_signed_attribute @1139 - PKCS7_add_signer @931 - PKCS7_cert_from_signer_info @939 - PKCS7_content_new @934 - PKCS7_ctrl @927 - PKCS7_dataDecode @1246 - PKCS7_dataFinal @1245 - PKCS7_dataInit @937 - PKCS7_dataVerify @936 - PKCS7_decrypt @2151 - PKCS7_digest_from_attributes @1140 - PKCS7_dup @443 - PKCS7_encrypt @2146 - PKCS7_final @4229 - PKCS7_free @444 - PKCS7_get0_signers @2150 - PKCS7_get_attribute @1141 - PKCS7_get_issuer_and_serial @1142 - PKCS7_get_signed_attribute @1143 - PKCS7_get_signer_info @940 - PKCS7_get_smimecap @2154 - PKCS7_it @3160 - PKCS7_new @445 - PKCS7_print_ctx @4358 - PKCS7_set0_type_other @3752 - PKCS7_set_attributes @1153 - PKCS7_set_cipher @1075 - PKCS7_set_content @929 - PKCS7_set_digest @3741 - PKCS7_set_signed_attributes @1154 - PKCS7_set_type @928 - PKCS7_sign @2155 - PKCS7_sign_add_signer @4335 - PKCS7_signatureVerify @1845 - PKCS7_simple_smimecap @2153 - PKCS7_stream @4481 - PKCS7_to_TS_TST_INFO @4273 - PKCS7_verify @2145 - PKCS8_PRIV_KEY_INFO_free @1317 - PKCS8_PRIV_KEY_INFO_it @3000 - PKCS8_PRIV_KEY_INFO_new @1315 - PKCS8_add_keyusage @1302 - PKCS8_decrypt @2765 - PKCS8_encrypt @1264 - PKCS8_pkey_get0 @4257 - PKCS8_pkey_set0 @4304 - PKCS8_set_broken @1320 - PKEY_USAGE_PERIOD_free @1235 - PKEY_USAGE_PERIOD_it @2638 - PKEY_USAGE_PERIOD_new @1234 - POLICYINFO_free @1491 - POLICYINFO_it @2991 - POLICYINFO_new @1489 - POLICYQUALINFO_free @1495 - POLICYQUALINFO_it @2619 - POLICYQUALINFO_new @1493 - POLICY_CONSTRAINTS_free @3344 - POLICY_CONSTRAINTS_it @3649 - POLICY_CONSTRAINTS_new @3547 - POLICY_MAPPINGS_it @3693 - POLICY_MAPPING_free @3419 - POLICY_MAPPING_it @3342 - POLICY_MAPPING_new @3746 - PROXY_CERT_INFO_EXTENSION_free @3306 - PROXY_CERT_INFO_EXTENSION_it @3307 - PROXY_CERT_INFO_EXTENSION_new @3305 - PROXY_POLICY_free @3308 - PROXY_POLICY_it @3301 - PROXY_POLICY_new @3309 - RAND_SSLeay @1113 - RAND_add @2201 - RAND_bytes @464 - RAND_cleanup @465 - RAND_egd @2253 - RAND_egd_bytes @2402 - RAND_event @2258 - RAND_file_name @466 - RAND_get_rand_method @1137 - RAND_load_file @467 - RAND_poll @2423 - RAND_pseudo_bytes @2206 - RAND_query_egd_bytes @2945 - RAND_screen @468 - RAND_seed @469 - RAND_set_rand_engine @2730 - RAND_set_rand_method @1114 - RAND_status @2254 - RAND_write_file @470 - RC2_cbc_encrypt @471 - RC2_cfb64_encrypt @472 - RC2_decrypt @995 - RC2_ecb_encrypt @473 - RC2_encrypt @474 - RC2_ofb64_encrypt @475 - RC2_set_key @476 - RC4 @477 - RC4_options @478 - RC4_set_key @479 - RIPEMD160 @1045 - RIPEMD160_Final @1044 - RIPEMD160_Init @1042 - RIPEMD160_Transform @1046 - RIPEMD160_Update @1043 - RSAPrivateKey_dup @481 - RSAPrivateKey_it @2906 - RSAPublicKey_dup @482 - RSAPublicKey_it @2737 - RSA_OAEP_PARAMS_free @4736 - RSA_OAEP_PARAMS_it @4738 - RSA_OAEP_PARAMS_new @4721 - RSA_PKCS1_SSLeay @483 - RSA_PSS_PARAMS_free @4668 - RSA_PSS_PARAMS_it @4667 - RSA_PSS_PARAMS_new @4663 - RSA_X931_hash_id @3319 - RSA_blinding_off @978 - RSA_blinding_on @977 - RSA_check_key @1869 - RSA_flags @956 - RSA_free @484 - RSA_generate_key @485 - RSA_generate_key_ex @3686 - RSA_get_default_method @1848 - RSA_get_ex_data @1029 - RSA_get_ex_new_index @1030 - RSA_get_method @1847 - RSA_memory_lock @1115 - RSA_new @486 - RSA_new_method @487 - RSA_null_method @1904 - RSA_padding_add_PKCS1_OAEP @1226 - RSA_padding_add_PKCS1_OAEP_mgf1 @4757 - RSA_padding_add_PKCS1_PSS @3323 - RSA_padding_add_PKCS1_PSS_mgf1 @4594 - RSA_padding_add_PKCS1_type_1 @1031 - RSA_padding_add_PKCS1_type_2 @1032 - RSA_padding_add_SSLv23 @1033 - RSA_padding_add_X931 @3322 - RSA_padding_add_none @1034 - RSA_padding_check_PKCS1_OAEP @1227 - RSA_padding_check_PKCS1_OAEP_mgf1 @4754 - RSA_padding_check_PKCS1_type_1 @1035 - RSA_padding_check_PKCS1_type_2 @1036 - RSA_padding_check_SSLv23 @1037 - RSA_padding_check_X931 @3320 - RSA_padding_check_none @1038 - RSA_print @488 - RSA_print_fp @489 - RSA_private_decrypt @490 - RSA_private_encrypt @491 - RSA_public_decrypt @492 - RSA_public_encrypt @493 - RSA_set_default_method @494 - RSA_set_ex_data @1028 - RSA_set_method @1846 - RSA_setup_blinding @3541 - RSA_sign @495 - RSA_sign_ASN1_OCTET_STRING @496 - RSA_size @497 - RSA_up_ref @2760 - RSA_verify @498 - RSA_verify_ASN1_OCTET_STRING @499 - RSA_verify_PKCS1_PSS @3321 - RSA_verify_PKCS1_PSS_mgf1 @4607 - SEED_cbc_encrypt @3910 - SEED_cfb128_encrypt @3912 - SEED_decrypt @3908 - SEED_ecb_encrypt @3915 - SEED_encrypt @3909 - SEED_ofb128_encrypt @3913 - SEED_set_key @3917 - SHA1 @501 - SHA1_Final @502 - SHA1_Init @503 - SHA1_Transform @1012 - SHA1_Update @504 - SHA224 @3510 - SHA224_Final @3560 - SHA224_Init @3631 - SHA224_Update @3562 - SHA256 @3654 - SHA256_Final @3712 - SHA256_Init @3479 - SHA256_Transform @3664 - SHA256_Update @3765 - SHA384 @3745 - SHA384_Final @3740 - SHA384_Init @3737 - SHA384_Update @3551 - SHA512 @3669 - SHA512_Final @3581 - SHA512_Init @3633 - SHA512_Transform @3675 - SHA512_Update @3356 - SHA @500 - SHA_Final @505 - SHA_Init @506 - SHA_Transform @1013 - SHA_Update @507 - SMIME_crlf_copy @2148 - SMIME_read_ASN1 @4017 - SMIME_read_CMS @3949 - SMIME_read_PKCS7 @2143 - SMIME_text @2152 - SMIME_write_ASN1 @4161 - SMIME_write_CMS @3994 - SMIME_write_PKCS7 @2142 - SRP_Calc_A @4581 - SRP_Calc_B @4578 - SRP_Calc_client_key @4575 - SRP_Calc_server_key @4570 - SRP_Calc_u @4573 - SRP_Calc_x @4577 - SRP_VBASE_free @4574 - SRP_VBASE_get1_by_user @2393 - SRP_VBASE_get_by_user @4569 - SRP_VBASE_init @4583 - SRP_VBASE_new @4579 - SRP_Verify_A_mod_N @4582 - SRP_Verify_B_mod_N @4584 - SRP_check_known_gN_param @4580 - SRP_create_verifier @4571 - SRP_create_verifier_BN @4572 - SRP_get_default_gN @4576 - SRP_user_pwd_free @2394 - SSLeay_version @2 - SXNETID_free @1332 - SXNETID_it @2669 - SXNETID_new @1331 - SXNET_add_id_INTEGER @1479 - SXNET_add_id_asc @1477 - SXNET_add_id_ulong @1478 - SXNET_free @1328 - SXNET_get_id_INTEGER @1482 - SXNET_get_id_asc @1480 - SXNET_get_id_ulong @1481 - SXNET_it @2613 - SXNET_new @1327 - TS_ACCURACY_dup @4397 - TS_ACCURACY_free @4486 - TS_ACCURACY_get_micros @4492 - TS_ACCURACY_get_millis @4395 - TS_ACCURACY_get_seconds @4352 - TS_ACCURACY_new @4240 - TS_ACCURACY_set_micros @4525 - TS_ACCURACY_set_millis @4145 - TS_ACCURACY_set_seconds @4255 - TS_ASN1_INTEGER_print_bio @4521 - TS_CONF_get_tsa_section @4160 - TS_CONF_load_cert @4123 - TS_CONF_load_certs @4312 - TS_CONF_load_key @4168 - TS_CONF_set_accuracy @4450 - TS_CONF_set_certs @4319 - TS_CONF_set_clock_precision_digits @4490 - TS_CONF_set_crypto_device @4473 - TS_CONF_set_def_policy @4483 - TS_CONF_set_default_engine @4254 - TS_CONF_set_digests @4234 - TS_CONF_set_ess_cert_id_chain @4380 - TS_CONF_set_ordering @4436 - TS_CONF_set_policies @4475 - TS_CONF_set_serial @4347 - TS_CONF_set_signer_cert @4534 - TS_CONF_set_signer_key @4394 - TS_CONF_set_tsa_name @4196 - TS_MSG_IMPRINT_dup @4357 - TS_MSG_IMPRINT_free @4479 - TS_MSG_IMPRINT_get_algo @4185 - TS_MSG_IMPRINT_get_msg @4326 - TS_MSG_IMPRINT_new @4468 - TS_MSG_IMPRINT_print_bio @4190 - TS_MSG_IMPRINT_set_algo @4155 - TS_MSG_IMPRINT_set_msg @4457 - TS_OBJ_print_bio @4268 - TS_REQ_add_ext @4329 - TS_REQ_delete_ext @4205 - TS_REQ_dup @4146 - TS_REQ_ext_free @4177 - TS_REQ_free @4459 - TS_REQ_get_cert_req @4302 - TS_REQ_get_ext @4124 - TS_REQ_get_ext_by_NID @4237 - TS_REQ_get_ext_by_OBJ @4533 - TS_REQ_get_ext_by_critical @4322 - TS_REQ_get_ext_count @4283 - TS_REQ_get_ext_d2i @4420 - TS_REQ_get_exts @4461 - TS_REQ_get_msg_imprint @4209 - TS_REQ_get_nonce @4212 - TS_REQ_get_policy_id @4192 - TS_REQ_get_version @4328 - TS_REQ_new @4467 - TS_REQ_print_bio @4186 - TS_REQ_set_cert_req @4345 - TS_REQ_set_msg_imprint @4232 - TS_REQ_set_nonce @4280 - TS_REQ_set_policy_id @4138 - TS_REQ_set_version @4438 - TS_REQ_to_TS_VERIFY_CTX @4526 - TS_RESP_CTX_add_failure_info @4463 - TS_RESP_CTX_add_flags @4455 - TS_RESP_CTX_add_md @4407 - TS_RESP_CTX_add_policy @4310 - TS_RESP_CTX_free @4538 - TS_RESP_CTX_get_request @4423 - TS_RESP_CTX_get_tst_info @4414 - TS_RESP_CTX_new @4227 - TS_RESP_CTX_set_accuracy @4279 - TS_RESP_CTX_set_certs @4482 - TS_RESP_CTX_set_clock_precision_digits @4462 - TS_RESP_CTX_set_def_policy @4373 - TS_RESP_CTX_set_extension_cb @4366 - TS_RESP_CTX_set_serial_cb @4323 - TS_RESP_CTX_set_signer_cert @4231 - TS_RESP_CTX_set_signer_key @4162 - TS_RESP_CTX_set_status_info @4184 - TS_RESP_CTX_set_status_info_cond @4368 - TS_RESP_CTX_set_time_cb @4325 - TS_RESP_create_response @4375 - TS_RESP_dup @4128 - TS_RESP_free @4402 - TS_RESP_get_status_info @4270 - TS_RESP_get_token @4396 - TS_RESP_get_tst_info @4487 - TS_RESP_new @4202 - TS_RESP_print_bio @4338 - TS_RESP_set_status_info @4142 - TS_RESP_set_tst_info @4228 - TS_RESP_verify_response @4350 - TS_RESP_verify_signature @4415 - TS_RESP_verify_token @4293 - TS_STATUS_INFO_dup @4204 - TS_STATUS_INFO_free @4292 - TS_STATUS_INFO_new @4418 - TS_STATUS_INFO_print_bio @4219 - TS_TST_INFO_add_ext @4275 - TS_TST_INFO_delete_ext @4390 - TS_TST_INFO_dup @4408 - TS_TST_INFO_ext_free @4327 - TS_TST_INFO_free @4348 - TS_TST_INFO_get_accuracy @4411 - TS_TST_INFO_get_ext @4529 - TS_TST_INFO_get_ext_by_NID @4201 - TS_TST_INFO_get_ext_by_OBJ @4158 - TS_TST_INFO_get_ext_by_critical @4531 - TS_TST_INFO_get_ext_count @4422 - TS_TST_INFO_get_ext_d2i @4309 - TS_TST_INFO_get_exts @4339 - TS_TST_INFO_get_msg_imprint @4313 - TS_TST_INFO_get_nonce @4377 - TS_TST_INFO_get_ordering @4337 - TS_TST_INFO_get_policy_id @4301 - TS_TST_INFO_get_serial @4211 - TS_TST_INFO_get_time @4256 - TS_TST_INFO_get_tsa @4417 - TS_TST_INFO_get_version @4315 - TS_TST_INFO_new @4252 - TS_TST_INFO_print_bio @4285 - TS_TST_INFO_set_accuracy @4443 - TS_TST_INFO_set_msg_imprint @4505 - TS_TST_INFO_set_nonce @4127 - TS_TST_INFO_set_ordering @4157 - TS_TST_INFO_set_policy_id @4379 - TS_TST_INFO_set_serial @4471 - TS_TST_INFO_set_time @4134 - TS_TST_INFO_set_tsa @4447 - TS_TST_INFO_set_version @4413 - TS_VERIFY_CTX_cleanup @4291 - TS_VERIFY_CTX_free @4321 - TS_VERIFY_CTX_init @4480 - TS_VERIFY_CTX_new @4365 - TS_X509_ALGOR_print_bio @4501 - TS_ext_print_bio @4520 - TXT_DB_create_index @511 - TXT_DB_free @512 - TXT_DB_get_by_index @513 - TXT_DB_insert @514 - TXT_DB_read @515 - TXT_DB_write @516 - UI_OpenSSL @2947 - UI_UTIL_read_pw @3208 - UI_UTIL_read_pw_string @3209 - UI_add_error_string @2633 - UI_add_info_string @3148 - UI_add_input_boolean @2538 - UI_add_input_string @3126 - UI_add_user_data @2793 - UI_add_verify_string @3064 - UI_construct_prompt @2585 - UI_create_method @3144 - UI_ctrl @2580 - UI_destroy_method @2857 - UI_dup_error_string @2736 - UI_dup_info_string @2649 - UI_dup_input_boolean @2614 - UI_dup_input_string @2587 - UI_dup_verify_string @3119 - UI_free @2892 - UI_get0_action_string @2850 - UI_get0_output_string @3118 - UI_get0_result @2718 - UI_get0_result_string @2845 - UI_get0_test_string @3007 - UI_get0_user_data @2783 - UI_get_default_method @2694 - UI_get_ex_data @2691 - UI_get_ex_new_index @2932 - UI_get_input_flags @2723 - UI_get_method @2795 - UI_get_result_maxsize @3042 - UI_get_result_minsize @3149 - UI_get_string_type @2916 - UI_method_get_closer @3045 - UI_method_get_flusher @2678 - UI_method_get_opener @2979 - UI_method_get_prompt_constructor @4550 - UI_method_get_reader @3013 - UI_method_get_writer @2946 - UI_method_set_closer @2558 - UI_method_set_flusher @2789 - UI_method_set_opener @3140 - UI_method_set_prompt_constructor @4551 - UI_method_set_reader @3174 - UI_method_set_writer @3102 - UI_new @3157 - UI_new_method @2893 - UI_process @2913 - UI_set_default_method @2944 - UI_set_ex_data @2807 - UI_set_method @2959 - UI_set_result @3016 - USERNOTICE_free @1499 - USERNOTICE_it @3132 - USERNOTICE_new @1497 - UTF8_getc @1903 - UTF8_putc @1902 - WHIRLPOOL @4149 - WHIRLPOOL_BitUpdate @4199 - WHIRLPOOL_Final @4370 - WHIRLPOOL_Init @4141 - WHIRLPOOL_Update @4449 - X509V3_EXT_CRL_add_conf @1247 - X509V3_EXT_CRL_add_nconf @3031 - X509V3_EXT_REQ_add_conf @1896 - X509V3_EXT_REQ_add_nconf @2627 - X509V3_EXT_add @1172 - X509V3_EXT_add_alias @1173 - X509V3_EXT_add_conf @1174 - X509V3_EXT_add_list @1648 - X509V3_EXT_add_nconf @2832 - X509V3_EXT_add_nconf_sk @2763 - X509V3_EXT_cleanup @1175 - X509V3_EXT_conf @1176 - X509V3_EXT_conf_nid @1177 - X509V3_EXT_d2i @1238 - X509V3_EXT_free @4763 - X509V3_EXT_get @1178 - X509V3_EXT_get_nid @1179 - X509V3_EXT_i2d @1646 - X509V3_EXT_nconf @2540 - X509V3_EXT_nconf_nid @2942 - X509V3_EXT_print @1180 - X509V3_EXT_print_fp @1181 - X509V3_EXT_val_prn @1647 - X509V3_NAME_from_section @3689 - X509V3_add1_i2d @2536 - X509V3_add_standard_extensions @1182 - X509V3_add_value @1183 - X509V3_add_value_bool @1184 - X509V3_add_value_bool_nf @1651 - X509V3_add_value_int @1185 - X509V3_add_value_uchar @1549 - X509V3_conf_free @1186 - X509V3_extensions_print @3085 - X509V3_get_d2i @2026 - X509V3_get_section @1505 - X509V3_get_string @1504 - X509V3_get_value_bool @1187 - X509V3_get_value_int @1188 - X509V3_parse_list @1189 - X509V3_section_free @1507 - X509V3_set_conf_lhash @1483 - X509V3_set_ctx @1508 - X509V3_set_nconf @2695 - X509V3_string_free @1506 - X509_ALGORS_it @3926 - X509_ALGOR_cmp @2398 - X509_ALGOR_dup @1518 - X509_ALGOR_free @517 - X509_ALGOR_get0 @3927 - X509_ALGOR_it @2714 - X509_ALGOR_new @518 - X509_ALGOR_set0 @3928 - X509_ALGOR_set_md @4612 - X509_ATTRIBUTE_count @2193 - X509_ATTRIBUTE_create @1155 - X509_ATTRIBUTE_create_by_NID @2191 - X509_ATTRIBUTE_create_by_OBJ @2194 - X509_ATTRIBUTE_create_by_txt @2218 - X509_ATTRIBUTE_dup @1156 - X509_ATTRIBUTE_free @519 - X509_ATTRIBUTE_get0_data @2198 - X509_ATTRIBUTE_get0_object @2195 - X509_ATTRIBUTE_get0_type @2187 - X509_ATTRIBUTE_it @2732 - X509_ATTRIBUTE_new @520 - X509_ATTRIBUTE_set1_data @2188 - X509_ATTRIBUTE_set1_object @2192 - X509_CERT_AUX_free @1926 - X509_CERT_AUX_it @2727 - X509_CERT_AUX_new @2001 - X509_CERT_AUX_print @1982 - X509_CERT_PAIR_free @3578 - X509_CERT_PAIR_it @3534 - X509_CERT_PAIR_new @3684 - X509_CINF_free @521 - X509_CINF_it @2812 - X509_CINF_new @522 - X509_CRL_INFO_free @523 - X509_CRL_INFO_it @3104 - X509_CRL_INFO_new @524 - X509_CRL_METHOD_free @4241 - X509_CRL_METHOD_new @4371 - X509_CRL_add0_revoked @3004 - X509_CRL_add1_ext_i2d @2834 - X509_CRL_add_ext @525 - X509_CRL_check_suiteb @4695 - X509_CRL_cmp @526 - X509_CRL_delete_ext @527 - X509_CRL_diff @4706 - X509_CRL_digest @2391 - X509_CRL_dup @528 - X509_CRL_free @529 - X509_CRL_get0_by_cert @4387 - X509_CRL_get0_by_serial @4412 - X509_CRL_get_ext @530 - X509_CRL_get_ext_by_NID @531 - X509_CRL_get_ext_by_OBJ @532 - X509_CRL_get_ext_by_critical @533 - X509_CRL_get_ext_count @534 - X509_CRL_get_ext_d2i @2009 - X509_CRL_get_meth_data @4324 - X509_CRL_http_nbio @4707 - X509_CRL_it @2555 - X509_CRL_match @4307 - X509_CRL_new @535 - X509_CRL_print @1229 - X509_CRL_print_fp @1228 - X509_CRL_set_default_method @4399 - X509_CRL_set_issuer_name @2742 - X509_CRL_set_lastUpdate @2837 - X509_CRL_set_meth_data @4303 - X509_CRL_set_nextUpdate @2798 - X509_CRL_set_version @2823 - X509_CRL_sign @536 - X509_CRL_sign_ctx @4664 - X509_CRL_sort @2607 - X509_CRL_verify @537 - X509_EXTENSIONS_it @3919 - X509_EXTENSION_create_by_NID @538 - X509_EXTENSION_create_by_OBJ @539 - X509_EXTENSION_dup @540 - X509_EXTENSION_free @541 - X509_EXTENSION_get_critical @542 - X509_EXTENSION_get_data @543 - X509_EXTENSION_get_object @544 - X509_EXTENSION_it @2667 - X509_EXTENSION_new @545 - X509_EXTENSION_set_critical @546 - X509_EXTENSION_set_data @547 - X509_EXTENSION_set_object @548 - X509_INFO_free @549 - X509_INFO_new @550 - X509_LOOKUP_by_alias @551 - X509_LOOKUP_by_fingerprint @552 - X509_LOOKUP_by_issuer_serial @553 - X509_LOOKUP_by_subject @554 - X509_LOOKUP_ctrl @555 - X509_LOOKUP_file @556 - X509_LOOKUP_free @557 - X509_LOOKUP_hash_dir @558 - X509_LOOKUP_init @559 - X509_LOOKUP_new @560 - X509_LOOKUP_shutdown @561 - X509_NAME_ENTRY_create_by_NID @562 - X509_NAME_ENTRY_create_by_OBJ @563 - X509_NAME_ENTRY_create_by_txt @2071 - X509_NAME_ENTRY_dup @564 - X509_NAME_ENTRY_free @565 - X509_NAME_ENTRY_get_data @566 - X509_NAME_ENTRY_get_object @567 - X509_NAME_ENTRY_it @2931 - X509_NAME_ENTRY_new @568 - X509_NAME_ENTRY_set_data @569 - X509_NAME_ENTRY_set_object @570 - X509_NAME_add_entry @571 - X509_NAME_add_entry_by_NID @1914 - X509_NAME_add_entry_by_OBJ @2008 - X509_NAME_add_entry_by_txt @1912 - X509_NAME_cmp @572 - X509_NAME_delete_entry @573 - X509_NAME_digest @574 - X509_NAME_dup @575 - X509_NAME_entry_count @576 - X509_NAME_free @577 - X509_NAME_get_entry @578 - X509_NAME_get_index_by_NID @579 - X509_NAME_get_index_by_OBJ @580 - X509_NAME_get_text_by_NID @581 - X509_NAME_get_text_by_OBJ @582 - X509_NAME_hash @583 - X509_NAME_hash_old @4535 - X509_NAME_it @3131 - X509_NAME_new @584 - X509_NAME_oneline @585 - X509_NAME_print @586 - X509_NAME_print_ex @2431 - X509_NAME_print_ex_fp @2429 - X509_NAME_set @587 - X509_OBJECT_free_contents @588 - X509_OBJECT_idx_by_subject @2450 - X509_OBJECT_retrieve_by_subject @589 - X509_OBJECT_retrieve_match @2449 - X509_OBJECT_up_ref_count @590 - X509_PKEY_free @591 - X509_PKEY_new @592 - X509_POLICY_NODE_print @3736 - X509_PUBKEY_free @593 - X509_PUBKEY_get0_param @4356 - X509_PUBKEY_get @594 - X509_PUBKEY_it @2679 - X509_PUBKEY_new @595 - X509_PUBKEY_set0_param @4213 - X509_PUBKEY_set @596 - X509_PURPOSE_add @2090 - X509_PURPOSE_cleanup @2119 - X509_PURPOSE_get0 @1915 - X509_PURPOSE_get0_name @2011 - X509_PURPOSE_get0_sname @2105 - X509_PURPOSE_get_by_id @1990 - X509_PURPOSE_get_by_sname @1952 - X509_PURPOSE_get_count @2067 - X509_PURPOSE_get_id @1997 - X509_PURPOSE_get_trust @2022 - X509_PURPOSE_set @3138 - X509_REQ_INFO_free @597 - X509_REQ_INFO_it @3139 - X509_REQ_INFO_new @598 - X509_REQ_add1_attr @2214 - X509_REQ_add1_attr_by_NID @2209 - X509_REQ_add1_attr_by_OBJ @2212 - X509_REQ_add1_attr_by_txt @2217 - X509_REQ_add_extensions @1881 - X509_REQ_add_extensions_nid @1879 - X509_REQ_check_private_key @3516 - X509_REQ_delete_attr @2215 - X509_REQ_digest @2362 - X509_REQ_dup @599 - X509_REQ_extension_nid @1875 - X509_REQ_free @600 - X509_REQ_get1_email @2403 - X509_REQ_get_attr @2208 - X509_REQ_get_attr_by_NID @2207 - X509_REQ_get_attr_by_OBJ @2210 - X509_REQ_get_attr_count @2213 - X509_REQ_get_extension_nids @1877 - X509_REQ_get_extensions @1872 - X509_REQ_get_pubkey @601 - X509_REQ_it @2879 - X509_REQ_new @602 - X509_REQ_print @603 - X509_REQ_print_ex @3237 - X509_REQ_print_fp @604 - X509_REQ_set_extension_nids @1873 - X509_REQ_set_pubkey @605 - X509_REQ_set_subject_name @606 - X509_REQ_set_version @607 - X509_REQ_sign @608 - X509_REQ_sign_ctx @4662 - X509_REQ_to_X509 @609 - X509_REQ_verify @610 - X509_REVOKED_add1_ext_i2d @3087 - X509_REVOKED_add_ext @611 - X509_REVOKED_delete_ext @612 - X509_REVOKED_dup @4711 - X509_REVOKED_free @613 - X509_REVOKED_get_ext @614 - X509_REVOKED_get_ext_by_NID @615 - X509_REVOKED_get_ext_by_OBJ @616 - X509_REVOKED_get_ext_by_critical @617 - X509_REVOKED_get_ext_count @618 - X509_REVOKED_get_ext_d2i @1909 - X509_REVOKED_it @2642 - X509_REVOKED_new @619 - X509_REVOKED_set_revocationDate @2608 - X509_REVOKED_set_serialNumber @2543 - X509_SIG_free @620 - X509_SIG_it @2847 - X509_SIG_new @621 - X509_STORE_CTX_cleanup @622 - X509_STORE_CTX_free @1969 - X509_STORE_CTX_get0_current_crl @4544 - X509_STORE_CTX_get0_current_issuer @4546 - X509_STORE_CTX_get0_param @3505 - X509_STORE_CTX_get0_parent_ctx @4545 - X509_STORE_CTX_get0_policy_tree @3748 - X509_STORE_CTX_get0_store @4710 - X509_STORE_CTX_get1_chain @2204 - X509_STORE_CTX_get1_issuer @2448 - X509_STORE_CTX_get_chain @1014 - X509_STORE_CTX_get_current_cert @1015 - X509_STORE_CTX_get_error @1016 - X509_STORE_CTX_get_error_depth @1017 - X509_STORE_CTX_get_ex_data @1018 - X509_STORE_CTX_get_ex_new_index @1100 - X509_STORE_CTX_get_explicit_policy @3524 - X509_STORE_CTX_init @623 - X509_STORE_CTX_new @2033 - X509_STORE_CTX_purpose_inherit @1976 - X509_STORE_CTX_set0_crls @3333 - X509_STORE_CTX_set0_param @3341 - X509_STORE_CTX_set_cert @1020 - X509_STORE_CTX_set_chain @1021 - X509_STORE_CTX_set_default @3595 - X509_STORE_CTX_set_depth @3377 - X509_STORE_CTX_set_error @1022 - X509_STORE_CTX_set_ex_data @1023 - X509_STORE_CTX_set_flags @2451 - X509_STORE_CTX_set_purpose @2064 - X509_STORE_CTX_set_time @2447 - X509_STORE_CTX_set_trust @2030 - X509_STORE_CTX_set_verify_cb @2524 - X509_STORE_CTX_trusted_stack @2452 - X509_STORE_add_cert @624 - X509_STORE_add_crl @957 - X509_STORE_add_lookup @625 - X509_STORE_free @626 - X509_STORE_get1_certs @4433 - X509_STORE_get1_crls @4150 - X509_STORE_get_by_subject @627 - X509_STORE_load_locations @628 - X509_STORE_new @629 - X509_STORE_set1_param @3676 - X509_STORE_set_default_paths @630 - X509_STORE_set_depth @3508 - X509_STORE_set_flags @2596 - X509_STORE_set_lookup_crls_cb @4705 - X509_STORE_set_purpose @2559 - X509_STORE_set_trust @2586 - X509_STORE_set_verify_cb @4543 - X509_TRUST_add @1931 - X509_TRUST_cleanup @2007 - X509_TRUST_get0 @2047 - X509_TRUST_get0_name @2046 - X509_TRUST_get_by_id @2021 - X509_TRUST_get_count @2110 - X509_TRUST_get_flags @2056 - X509_TRUST_get_trust @2055 - X509_TRUST_set @2833 - X509_TRUST_set_default @2185 - X509_VAL_free @631 - X509_VAL_it @2829 - X509_VAL_new @632 - X509_VERIFY_PARAM_add0_policy @3652 - X509_VERIFY_PARAM_add0_table @3703 - X509_VERIFY_PARAM_add1_host @4771 - X509_VERIFY_PARAM_clear_flags @3772 - X509_VERIFY_PARAM_free @3527 - X509_VERIFY_PARAM_get0 @4762 - X509_VERIFY_PARAM_get0_name @4761 - X509_VERIFY_PARAM_get0_peername @4767 - X509_VERIFY_PARAM_get_count @4760 - X509_VERIFY_PARAM_get_depth @3559 - X509_VERIFY_PARAM_get_flags @3781 - X509_VERIFY_PARAM_inherit @3378 - X509_VERIFY_PARAM_lookup @3659 - X509_VERIFY_PARAM_new @3437 - X509_VERIFY_PARAM_set1 @3610 - X509_VERIFY_PARAM_set1_email @4696 - X509_VERIFY_PARAM_set1_host @4702 - X509_VERIFY_PARAM_set1_ip @4703 - X509_VERIFY_PARAM_set1_ip_asc @4694 - X509_VERIFY_PARAM_set1_name @3413 - X509_VERIFY_PARAM_set1_policies @3412 - X509_VERIFY_PARAM_set_depth @3399 - X509_VERIFY_PARAM_set_flags @3421 - X509_VERIFY_PARAM_set_hostflags @4765 - X509_VERIFY_PARAM_set_purpose @3414 - X509_VERIFY_PARAM_set_time @3757 - X509_VERIFY_PARAM_set_trust @3495 - X509_VERIFY_PARAM_table_cleanup @3525 - X509_add1_ext_i2d @2697 - X509_add1_reject_object @2082 - X509_add1_trust_object @2140 - X509_add_ext @633 - X509_alias_get0 @2074 - X509_alias_set1 @1933 - X509_certificate_type @635 - X509_chain_check_suiteb @4692 - X509_chain_up_ref @4693 - X509_check_akid @4496 - X509_check_ca @3286 - X509_check_email @4697 - X509_check_host @4698 - X509_check_ip @4704 - X509_check_ip_asc @4699 - X509_check_issued @2454 - X509_check_private_key @636 - X509_check_purpose @2051 - X509_check_trust @2083 - X509_cmp @2135 - X509_cmp_current_time @637 - X509_cmp_time @2446 - X509_delete_ext @638 - X509_digest @639 - X509_dup @640 - X509_email_free @2405 - X509_find_by_issuer_and_serial @920 - X509_find_by_subject @921 - X509_free @641 - X509_get0_pubkey_bitstr @2662 - X509_get0_signature @4700 - X509_get1_email @2404 - X509_get1_ocsp @3920 - X509_get_default_cert_area @642 - X509_get_default_cert_dir @643 - X509_get_default_cert_dir_env @644 - X509_get_default_cert_file @645 - X509_get_default_cert_file_env @646 - X509_get_default_private_dir @647 - X509_get_ex_data @1950 - X509_get_ex_new_index @2019 - X509_get_ext @648 - X509_get_ext_by_NID @649 - X509_get_ext_by_OBJ @650 - X509_get_ext_by_critical @651 - X509_get_ext_count @652 - X509_get_ext_d2i @1958 - X509_get_issuer_name @653 - X509_get_pubkey @654 - X509_get_pubkey_parameters @655 - X509_get_serialNumber @656 - X509_get_signature_nid @4701 - X509_get_subject_name @657 - X509_gmtime_adj @658 - X509_http_nbio @4715 - X509_issuer_and_serial_cmp @659 - X509_issuer_and_serial_hash @660 - X509_issuer_name_cmp @661 - X509_issuer_name_hash @662 - X509_issuer_name_hash_old @4547 - X509_it @2773 - X509_keyid_get0 @3363 - X509_keyid_set1 @2460 - X509_load_cert_crl_file @1972 - X509_load_cert_file @663 - X509_load_crl_file @958 - X509_new @664 - X509_ocspid_print @2790 - X509_policy_check @3720 - X509_policy_level_get0_node @3568 - X509_policy_level_node_count @3434 - X509_policy_node_get0_parent @3371 - X509_policy_node_get0_policy @3463 - X509_policy_node_get0_qualifiers @3448 - X509_policy_tree_free @3466 - X509_policy_tree_get0_level @3616 - X509_policy_tree_get0_policies @3381 - X509_policy_tree_get0_user_policies @3656 - X509_policy_tree_level_count @3573 - X509_print @665 - X509_print_ex @2544 - X509_print_ex_fp @3018 - X509_print_fp @666 - X509_pubkey_digest @2895 - X509_reject_clear @2184 - X509_set_ex_data @1910 - X509_set_issuer_name @667 - X509_set_notAfter @668 - X509_set_notBefore @669 - X509_set_pubkey @670 - X509_set_serialNumber @671 - X509_set_subject_name @672 - X509_set_version @673 - X509_sign @674 - X509_sign_ctx @4669 - X509_signature_dump @4665 - X509_signature_print @2706 - X509_subject_name_cmp @675 - X509_subject_name_hash @676 - X509_subject_name_hash_old @4548 - X509_supported_extension @2977 - X509_time_adj @2453 - X509_time_adj_ex @4454 - X509_to_X509_REQ @677 - X509_trust_clear @1928 - X509_verify @678 - X509_verify_cert @679 - X509_verify_cert_error_string @680 - X509at_add1_attr @2197 - X509at_add1_attr_by_NID @2211 - X509at_add1_attr_by_OBJ @2216 - X509at_add1_attr_by_txt @2219 - X509at_delete_attr @2199 - X509at_get0_data_by_OBJ @3931 - X509at_get_attr @2189 - X509at_get_attr_by_NID @2196 - X509at_get_attr_by_OBJ @2200 - X509at_get_attr_count @2190 - X509v3_add_ext @681 - X509v3_delete_ext @688 - X509v3_get_ext @689 - X509v3_get_ext_by_NID @690 - X509v3_get_ext_by_OBJ @691 - X509v3_get_ext_by_critical @692 - X509v3_get_ext_count @693 - ZLONG_it @2780 - _ossl_096_des_random_seed @3219 - _ossl_old_crypt @711 - _ossl_old_des_cbc_cksum @2776 - _ossl_old_des_cbc_encrypt @2880 - _ossl_old_des_cfb64_encrypt @3086 - _ossl_old_des_cfb_encrypt @2964 - _ossl_old_des_crypt @2654 - _ossl_old_des_decrypt3 @2705 - _ossl_old_des_ecb3_encrypt @2854 - _ossl_old_des_ecb_encrypt @3163 - _ossl_old_des_ede3_cbc_encrypt @2729 - _ossl_old_des_ede3_cfb64_encrypt @2786 - _ossl_old_des_ede3_ofb64_encrypt @3012 - _ossl_old_des_enc_read @2680 - _ossl_old_des_enc_write @3022 - _ossl_old_des_encrypt2 @2998 - _ossl_old_des_encrypt3 @2999 - _ossl_old_des_encrypt @2570 - _ossl_old_des_fcrypt @2835 - _ossl_old_des_is_weak_key @2576 - _ossl_old_des_key_sched @2666 - _ossl_old_des_ncbc_encrypt @3037 - _ossl_old_des_ofb64_encrypt @2673 - _ossl_old_des_ofb_encrypt @3088 - _ossl_old_des_options @2612 - _ossl_old_des_pcbc_encrypt @3056 - _ossl_old_des_quad_cksum @2988 - _ossl_old_des_random_key @2566 - _ossl_old_des_random_seed @803 - _ossl_old_des_read_2passwords @804 - _ossl_old_des_read_password @805 - _ossl_old_des_read_pw @806 - _ossl_old_des_read_pw_string @807 - _ossl_old_des_set_key @3065 - _ossl_old_des_set_odd_parity @2817 - _ossl_old_des_string_to_2keys @2725 - _ossl_old_des_string_to_key @2808 - _ossl_old_des_xcbc_encrypt @3159 - _shadow_DES_check_key @3146 - _shadow_DES_rw_mode @2581 - a2d_ASN1_OBJECT @699 - a2i_ASN1_ENUMERATED @1210 - a2i_ASN1_INTEGER @700 - a2i_ASN1_STRING @701 - a2i_GENERAL_NAME @4472 - a2i_IPADDRESS @3375 - a2i_IPADDRESS_NC @3732 - a2i_ipadd @3813 - asn1_Finish @702 - asn1_GetSequence @703 - asn1_add_error @1091 - asn1_const_Finish @3700 - asn1_do_adb @2582 - asn1_do_lock @3059 - asn1_enc_free @2993 - asn1_enc_init @3041 - asn1_enc_restore @2891 - asn1_enc_save @3054 - asn1_ex_c2i @2888 - asn1_ex_i2c @2663 - asn1_get_choice_selector @3071 - asn1_get_field_ptr @3125 - asn1_set_choice_selector @3122 - b2i_PVK_bio @4250 - b2i_PrivateKey @4343 - b2i_PrivateKey_bio @4354 - b2i_PublicKey @4290 - b2i_PublicKey_bio @4172 - bn_add_words @1039 - bn_div_words @704 - bn_dup_expand @2920 - bn_expand2 @705 - bn_mul_add_words @706 - bn_mul_words @707 - bn_sqr_words @710 - bn_sub_words @1116 - c2i_ASN1_BIT_STRING @2421 - c2i_ASN1_INTEGER @2424 - c2i_ASN1_OBJECT @2428 - check_defer @4522 - d2i_ACCESS_DESCRIPTION @1927 - d2i_ASN1_BIT_STRING @712 - d2i_ASN1_BMPSTRING @1092 - d2i_ASN1_BOOLEAN @713 - d2i_ASN1_ENUMERATED @1204 - d2i_ASN1_GENERALIZEDTIME @1190 - d2i_ASN1_GENERALSTRING @2822 - d2i_ASN1_IA5STRING @715 - d2i_ASN1_INTEGER @716 - d2i_ASN1_NULL @2169 - d2i_ASN1_OBJECT @717 - d2i_ASN1_OCTET_STRING @718 - d2i_ASN1_PRINTABLESTRING @720 - d2i_ASN1_PRINTABLE @719 - d2i_ASN1_SEQUENCE_ANY @4510 - d2i_ASN1_SET @721 - d2i_ASN1_SET_ANY @4507 - d2i_ASN1_T61STRING @722 - d2i_ASN1_TIME @1191 - d2i_ASN1_TYPE @723 - d2i_ASN1_UINTEGER @1652 - d2i_ASN1_UNIVERSALSTRING @3235 - d2i_ASN1_UTCTIME @724 - d2i_ASN1_UTF8STRING @1342 - d2i_ASN1_VISIBLESTRING @1340 - d2i_ASN1_bytes @725 - d2i_ASN1_type_bytes @726 - d2i_AUTHORITY_INFO_ACCESS @1918 - d2i_AUTHORITY_KEYID @1255 - d2i_AutoPrivateKey @2186 - d2i_BASIC_CONSTRAINTS @1192 - d2i_CERTIFICATEPOLICIES @1487 - d2i_CMS_ContentInfo @3985 - d2i_CMS_ReceiptRequest @3970 - d2i_CMS_bio @3946 - d2i_CRL_DIST_POINTS @1540 - d2i_DHparams @727 - d2i_DHxparams @4687 - d2i_DIRECTORYSTRING @1344 - d2i_DISPLAYTEXT @1346 - d2i_DIST_POINT @1543 - d2i_DIST_POINT_NAME @1548 - d2i_DSAPrivateKey @728 - d2i_DSAPrivateKey_bio @729 - d2i_DSAPrivateKey_fp @730 - d2i_DSAPublicKey @731 - d2i_DSA_PUBKEY @2050 - d2i_DSA_PUBKEY_bio @2093 - d2i_DSA_PUBKEY_fp @2041 - d2i_DSA_SIG @1337 - d2i_DSAparams @732 - d2i_ECDSA_SIG @3717 - d2i_ECPKParameters @3475 - d2i_ECParameters @3733 - d2i_ECPrivateKey @3563 - d2i_ECPrivateKey_bio @3556 - d2i_ECPrivateKey_fp @3673 - d2i_EC_PUBKEY @3425 - d2i_EC_PUBKEY_bio @3707 - d2i_EC_PUBKEY_fp @3751 - d2i_EDIPARTYNAME @2814 - d2i_ESS_CERT_ID @4512 - d2i_ESS_ISSUER_SERIAL @4265 - d2i_ESS_SIGNING_CERT @4435 - d2i_EXTENDED_KEY_USAGE @2674 - d2i_GENERAL_NAMES @1217 - d2i_GENERAL_NAME @1212 - d2i_ISSUING_DIST_POINT @4286 - d2i_KRB5_APREQBODY @2677 - d2i_KRB5_APREQ @2588 - d2i_KRB5_AUTHDATA @2685 - d2i_KRB5_AUTHENTBODY @2840 - d2i_KRB5_AUTHENT @2573 - d2i_KRB5_CHECKSUM @2771 - d2i_KRB5_ENCDATA @3046 - d2i_KRB5_ENCKEY @2901 - d2i_KRB5_PRINCNAME @2810 - d2i_KRB5_TICKET @2819 - d2i_KRB5_TKTBODY @2952 - d2i_NETSCAPE_CERT_SEQUENCE @1193 - d2i_NETSCAPE_SPKAC @733 - d2i_NETSCAPE_SPKI @734 - d2i_NETSCAPE_X509 @4180 - d2i_NOTICEREF @1502 - d2i_Netscape_RSA @735 - d2i_OCSP_BASICRESP @2530 - d2i_OCSP_CERTID @2867 - d2i_OCSP_CERTSTATUS @2542 - d2i_OCSP_CRLID @2768 - d2i_OCSP_ONEREQ @3152 - d2i_OCSP_REQINFO @3147 - d2i_OCSP_REQUEST @2648 - d2i_OCSP_RESPBYTES @2535 - d2i_OCSP_RESPDATA @2969 - d2i_OCSP_RESPID @2702 - d2i_OCSP_RESPONSE @3020 - d2i_OCSP_REVOKEDINFO @2599 - d2i_OCSP_SERVICELOC @2815 - d2i_OCSP_SIGNATURE @2873 - d2i_OCSP_SINGLERESP @2670 - d2i_OTHERNAME @2096 - d2i_PBE2PARAM @1403 - d2i_PBEPARAM @1312 - d2i_PBKDF2PARAM @1399 - d2i_PKCS12 @1289 - d2i_PKCS12_BAGS @1286 - d2i_PKCS12_MAC_DATA @1294 - d2i_PKCS12_SAFEBAG @1298 - d2i_PKCS12_bio @1308 - d2i_PKCS12_fp @1309 - d2i_PKCS7 @736 - d2i_PKCS7_DIGEST @737 - d2i_PKCS7_ENCRYPT @738 - d2i_PKCS7_ENC_CONTENT @739 - d2i_PKCS7_ENVELOPE @740 - d2i_PKCS7_ISSUER_AND_SERIAL @741 - d2i_PKCS7_RECIP_INFO @742 - d2i_PKCS7_SIGNED @743 - d2i_PKCS7_SIGNER_INFO @744 - d2i_PKCS7_SIGN_ENVELOPE @745 - d2i_PKCS7_bio @746 - d2i_PKCS7_fp @747 - d2i_PKCS8PrivateKey_bio @2167 - d2i_PKCS8PrivateKey_fp @2175 - d2i_PKCS8_PRIV_KEY_INFO @1316 - d2i_PKCS8_PRIV_KEY_INFO_bio @1783 - d2i_PKCS8_PRIV_KEY_INFO_fp @1780 - d2i_PKCS8_bio @1779 - d2i_PKCS8_fp @1784 - d2i_PKEY_USAGE_PERIOD @1233 - d2i_POLICYINFO @1490 - d2i_POLICYQUALINFO @1494 - d2i_PROXY_CERT_INFO_EXTENSION @3300 - d2i_PROXY_POLICY @3304 - d2i_PUBKEY @2054 - d2i_PUBKEY_bio @2441 - d2i_PUBKEY_fp @2445 - d2i_PrivateKey @748 - d2i_PrivateKey_bio @2181 - d2i_PrivateKey_fp @2182 - d2i_PublicKey @749 - d2i_RSAPrivateKey @750 - d2i_RSAPrivateKey_bio @751 - d2i_RSAPrivateKey_fp @752 - d2i_RSAPublicKey @753 - d2i_RSAPublicKey_bio @945 - d2i_RSAPublicKey_fp @952 - d2i_RSA_NET @2408 - d2i_RSA_OAEP_PARAMS @4748 - d2i_RSA_PSS_PARAMS @4666 - d2i_RSA_PUBKEY @2044 - d2i_RSA_PUBKEY_bio @2053 - d2i_RSA_PUBKEY_fp @1964 - d2i_SXNETID @1330 - d2i_SXNET @1326 - d2i_TS_ACCURACY @4194 - d2i_TS_MSG_IMPRINT @4235 - d2i_TS_MSG_IMPRINT_bio @4170 - d2i_TS_MSG_IMPRINT_fp @4432 - d2i_TS_REQ @4382 - d2i_TS_REQ_bio @4453 - d2i_TS_REQ_fp @4349 - d2i_TS_RESP @4311 - d2i_TS_RESP_bio @4223 - d2i_TS_RESP_fp @4139 - d2i_TS_STATUS_INFO @4456 - d2i_TS_TST_INFO @4221 - d2i_TS_TST_INFO_bio @4336 - d2i_TS_TST_INFO_fp @4306 - d2i_USERNOTICE @1498 - d2i_X509 @754 - d2i_X509_ALGORS @3937 - d2i_X509_ALGOR @755 - d2i_X509_ATTRIBUTE @756 - d2i_X509_AUX @1980 - d2i_X509_CERT_AUX @2115 - d2i_X509_CERT_PAIR @3698 - d2i_X509_CINF @757 - d2i_X509_CRL @758 - d2i_X509_CRL_INFO @759 - d2i_X509_CRL_bio @760 - d2i_X509_CRL_fp @761 - d2i_X509_EXTENSIONS @3925 - d2i_X509_EXTENSION @762 - d2i_X509_NAME @763 - d2i_X509_NAME_ENTRY @764 - d2i_X509_PKEY @765 - d2i_X509_PUBKEY @766 - d2i_X509_REQ @767 - d2i_X509_REQ_INFO @768 - d2i_X509_REQ_bio @769 - d2i_X509_REQ_fp @770 - d2i_X509_REVOKED @771 - d2i_X509_SIG @772 - d2i_X509_VAL @773 - d2i_X509_bio @774 - d2i_X509_fp @775 - get_rfc2409_prime_1024 @3773 - get_rfc2409_prime_768 @3780 - get_rfc3526_prime_1536 @3777 - get_rfc3526_prime_2048 @3775 - get_rfc3526_prime_3072 @3778 - get_rfc3526_prime_4096 @3779 - get_rfc3526_prime_6144 @3776 - get_rfc3526_prime_8192 @3771 - hex_to_string @1223 - i2a_ACCESS_DESCRIPTION @3110 - i2a_ASN1_ENUMERATED @1209 - i2a_ASN1_INTEGER @815 - i2a_ASN1_OBJECT @816 - i2a_ASN1_STRING @817 - i2b_PVK_bio @4247 - i2b_PrivateKey_bio @4288 - i2b_PublicKey_bio @4318 - i2c_ASN1_BIT_STRING @2422 - i2c_ASN1_INTEGER @2425 - i2d_ACCESS_DESCRIPTION @2077 - i2d_ASN1_BIT_STRING @818 - i2d_ASN1_BMPSTRING @1093 - i2d_ASN1_BOOLEAN @819 - i2d_ASN1_ENUMERATED @1203 - i2d_ASN1_GENERALIZEDTIME @1197 - i2d_ASN1_GENERALSTRING @2560 - i2d_ASN1_IA5STRING @821 - i2d_ASN1_INTEGER @822 - i2d_ASN1_NULL @2173 - i2d_ASN1_OBJECT @823 - i2d_ASN1_OCTET_STRING @824 - i2d_ASN1_PRINTABLESTRING @2149 - i2d_ASN1_PRINTABLE @825 - i2d_ASN1_SEQUENCE_ANY @4169 - i2d_ASN1_SET @826 - i2d_ASN1_SET_ANY @4197 - i2d_ASN1_T61STRING @3175 - i2d_ASN1_TIME @1198 - i2d_ASN1_TYPE @827 - i2d_ASN1_UNIVERSALSTRING @3232 - i2d_ASN1_UTCTIME @828 - i2d_ASN1_UTF8STRING @1341 - i2d_ASN1_VISIBLESTRING @1339 - i2d_ASN1_bio_stream @4500 - i2d_ASN1_bytes @829 - i2d_AUTHORITY_INFO_ACCESS @2062 - i2d_AUTHORITY_KEYID @1254 - i2d_BASIC_CONSTRAINTS @1199 - i2d_CERTIFICATEPOLICIES @1484 - i2d_CMS_ContentInfo @3944 - i2d_CMS_ReceiptRequest @4033 - i2d_CMS_bio @3976 - i2d_CMS_bio_stream @4208 - i2d_CRL_DIST_POINTS @1537 - i2d_DHparams @830 - i2d_DHxparams @4683 - i2d_DIRECTORYSTRING @1343 - i2d_DISPLAYTEXT @1345 - i2d_DIST_POINT @1541 - i2d_DIST_POINT_NAME @1545 - i2d_DSAPrivateKey @831 - i2d_DSAPrivateKey_bio @832 - i2d_DSAPrivateKey_fp @833 - i2d_DSAPublicKey @834 - i2d_DSA_PUBKEY @1981 - i2d_DSA_PUBKEY_bio @2014 - i2d_DSA_PUBKEY_fp @1971 - i2d_DSA_SIG @1338 - i2d_DSAparams @835 - i2d_ECDSA_SIG @3619 - i2d_ECPKParameters @3473 - i2d_ECParameters @3472 - i2d_ECPrivateKey @3357 - i2d_ECPrivateKey_bio @3452 - i2d_ECPrivateKey_fp @3655 - i2d_EC_PUBKEY @3521 - i2d_EC_PUBKEY_bio @3585 - i2d_EC_PUBKEY_fp @3701 - i2d_EDIPARTYNAME @2908 - i2d_ESS_CERT_ID @4364 - i2d_ESS_ISSUER_SERIAL @4351 - i2d_ESS_SIGNING_CERT @4167 - i2d_EXTENDED_KEY_USAGE @3052 - i2d_GENERAL_NAMES @1218 - i2d_GENERAL_NAME @1211 - i2d_ISSUING_DIST_POINT @4216 - i2d_KRB5_APREQBODY @2853 - i2d_KRB5_APREQ @2569 - i2d_KRB5_AUTHDATA @2978 - i2d_KRB5_AUTHENTBODY @3128 - i2d_KRB5_AUTHENT @2668 - i2d_KRB5_CHECKSUM @3072 - i2d_KRB5_ENCDATA @3137 - i2d_KRB5_ENCKEY @3092 - i2d_KRB5_PRINCNAME @2997 - i2d_KRB5_TICKET @3017 - i2d_KRB5_TKTBODY @3038 - i2d_NETSCAPE_CERT_SEQUENCE @1200 - i2d_NETSCAPE_SPKAC @836 - i2d_NETSCAPE_SPKI @837 - i2d_NETSCAPE_X509 @4424 - i2d_NOTICEREF @1500 - i2d_Netscape_RSA @838 - i2d_OCSP_BASICRESP @2744 - i2d_OCSP_CERTID @3068 - i2d_OCSP_CERTSTATUS @2955 - i2d_OCSP_CRLID @2757 - i2d_OCSP_ONEREQ @2709 - i2d_OCSP_REQINFO @2591 - i2d_OCSP_REQUEST @2738 - i2d_OCSP_RESPBYTES @2745 - i2d_OCSP_RESPDATA @2629 - i2d_OCSP_RESPID @2898 - i2d_OCSP_RESPONSE @2682 - i2d_OCSP_REVOKEDINFO @2890 - i2d_OCSP_SERVICELOC @2562 - i2d_OCSP_SIGNATURE @3053 - i2d_OCSP_SINGLERESP @3062 - i2d_OTHERNAME @2015 - i2d_PBE2PARAM @1401 - i2d_PBEPARAM @1310 - i2d_PBKDF2PARAM @1397 - i2d_PKCS12 @1288 - i2d_PKCS12_BAGS @1284 - i2d_PKCS12_MAC_DATA @1292 - i2d_PKCS12_SAFEBAG @1296 - i2d_PKCS12_bio @1306 - i2d_PKCS12_fp @1307 - i2d_PKCS7 @839 - i2d_PKCS7_DIGEST @840 - i2d_PKCS7_ENCRYPT @841 - i2d_PKCS7_ENC_CONTENT @842 - i2d_PKCS7_ENVELOPE @843 - i2d_PKCS7_ISSUER_AND_SERIAL @844 - i2d_PKCS7_NDEF @3569 - i2d_PKCS7_RECIP_INFO @845 - i2d_PKCS7_SIGNED @846 - i2d_PKCS7_SIGNER_INFO @847 - i2d_PKCS7_SIGN_ENVELOPE @848 - i2d_PKCS7_bio @849 - i2d_PKCS7_bio_stream @4333 - i2d_PKCS7_fp @850 - i2d_PKCS8PrivateKeyInfo_bio @2178 - i2d_PKCS8PrivateKeyInfo_fp @2177 - i2d_PKCS8PrivateKey_bio @2171 - i2d_PKCS8PrivateKey_fp @2172 - i2d_PKCS8PrivateKey_nid_bio @2176 - i2d_PKCS8PrivateKey_nid_fp @2174 - i2d_PKCS8_PRIV_KEY_INFO @1314 - i2d_PKCS8_PRIV_KEY_INFO_bio @1792 - i2d_PKCS8_PRIV_KEY_INFO_fp @1791 - i2d_PKCS8_bio @1790 - i2d_PKCS8_fp @1777 - i2d_PKEY_USAGE_PERIOD @1232 - i2d_POLICYINFO @1488 - i2d_POLICYQUALINFO @1492 - i2d_PROXY_CERT_INFO_EXTENSION @3303 - i2d_PROXY_POLICY @3302 - i2d_PUBKEY @1987 - i2d_PUBKEY_bio @2439 - i2d_PUBKEY_fp @2440 - i2d_PrivateKey @851 - i2d_PrivateKey_bio @2183 - i2d_PrivateKey_fp @2180 - i2d_PublicKey @852 - i2d_RSAPrivateKey @853 - i2d_RSAPrivateKey_bio @854 - i2d_RSAPrivateKey_fp @855 - i2d_RSAPublicKey @856 - i2d_RSAPublicKey_bio @946 - i2d_RSAPublicKey_fp @954 - i2d_RSA_NET @2406 - i2d_RSA_OAEP_PARAMS @4747 - i2d_RSA_PSS_PARAMS @4670 - i2d_RSA_PUBKEY @1974 - i2d_RSA_PUBKEY_bio @1985 - i2d_RSA_PUBKEY_fp @2113 - i2d_SXNETID @1329 - i2d_SXNET @1325 - i2d_TS_ACCURACY @4115 - i2d_TS_MSG_IMPRINT @4117 - i2d_TS_MSG_IMPRINT_bio @4278 - i2d_TS_MSG_IMPRINT_fp @4116 - i2d_TS_REQ @4389 - i2d_TS_REQ_bio @4359 - i2d_TS_REQ_fp @4509 - i2d_TS_RESP @4289 - i2d_TS_RESP_bio @4464 - i2d_TS_RESP_fp @4277 - i2d_TS_STATUS_INFO @4441 - i2d_TS_TST_INFO @4120 - i2d_TS_TST_INFO_bio @4156 - i2d_TS_TST_INFO_fp @4132 - i2d_USERNOTICE @1496 - i2d_X509 @857 - i2d_X509_ALGORS @3934 - i2d_X509_ALGOR @858 - i2d_X509_ATTRIBUTE @859 - i2d_X509_AUX @2132 - i2d_X509_CERT_AUX @2028 - i2d_X509_CERT_PAIR @3642 - i2d_X509_CINF @860 - i2d_X509_CRL @861 - i2d_X509_CRL_INFO @862 - i2d_X509_CRL_bio @863 - i2d_X509_CRL_fp @864 - i2d_X509_EXTENSIONS @3922 - i2d_X509_EXTENSION @865 - i2d_X509_NAME @866 - i2d_X509_NAME_ENTRY @867 - i2d_X509_PKEY @868 - i2d_X509_PUBKEY @869 - i2d_X509_REQ @870 - i2d_X509_REQ_INFO @871 - i2d_X509_REQ_bio @872 - i2d_X509_REQ_fp @873 - i2d_X509_REVOKED @874 - i2d_X509_SIG @875 - i2d_X509_VAL @876 - i2d_X509_bio @877 - i2d_X509_fp @878 - i2d_re_X509_tbs @4773 - i2o_ECPublicKey @3373 - i2s_ASN1_ENUMERATED @1241 - i2s_ASN1_ENUMERATED_TABLE @1242 - i2s_ASN1_INTEGER @1237 - i2s_ASN1_OCTET_STRING @1220 - i2t_ASN1_OBJECT @979 - i2v_ASN1_BIT_STRING @3639 - i2v_GENERAL_NAMES @1219 - i2v_GENERAL_NAME @1230 - idea_cbc_encrypt @879 - idea_cfb64_encrypt @880 - idea_ecb_encrypt @881 - idea_encrypt @882 - idea_ofb64_encrypt @883 - idea_options @884 - idea_set_decrypt_key @885 - idea_set_encrypt_key @886 - lh_delete @887 - lh_doall @888 - lh_doall_arg @889 - lh_free @890 - lh_insert @891 - lh_new @892 - lh_node_stats @893 - lh_node_stats_bio @894 - lh_node_usage_stats @895 - lh_node_usage_stats_bio @896 - lh_num_items @2257 - lh_retrieve @897 - lh_stats @898 - lh_stats_bio @899 - lh_strhash @900 - name_cmp @1239 - o2i_ECPublicKey @3368 - pitem_free @3767 - pitem_new @3365 - pqueue_find @3454 - pqueue_free @3704 - pqueue_insert @3766 - pqueue_iterator @3394 - pqueue_new @3758 - pqueue_next @3754 - pqueue_peek @3460 - pqueue_pop @3647 - pqueue_print @3428 - pqueue_size @4114 - private_AES_set_decrypt_key @4597 - private_AES_set_encrypt_key @4606 - private_RC4_set_key @3294 - s2i_ASN1_INTEGER @1509 - s2i_ASN1_OCTET_STRING @1221 - sk_deep_copy @4769 - sk_delete @901 - sk_delete_ptr @902 - sk_dup @903 - sk_find @904 - sk_find_ex @3544 - sk_free @905 - sk_insert @906 - sk_is_sorted @3285 - sk_new @907 - sk_new_null @2411 - sk_num @1654 - sk_pop @908 - sk_pop_free @909 - sk_push @910 - sk_set @1655 - sk_set_cmp_func @911 - sk_shift @912 - sk_sort @1671 - sk_unshift @913 - sk_value @1653 - sk_zero @914 - string_to_hex @1224 - v2i_ASN1_BIT_STRING @3592 - v2i_GENERAL_NAMES @1236 - v2i_GENERAL_NAME @1231 - v2i_GENERAL_NAME_ex @3612 - diff --git a/libs/win32/openssl/openssl.2010.vcxproj.filters b/libs/win32/openssl/openssl.2010.vcxproj.filters deleted file mode 100644 index a87e2e4a24..0000000000 --- a/libs/win32/openssl/openssl.2010.vcxproj.filters +++ /dev/null @@ -1,182 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {cf6ed228-8b22-4124-ad73-05c2a9dc3ba9} - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {059be3d7-da1e-4270-8f05-a6772ccc5e10} - - - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - Source Files\apps - - - - - Header Files\apps - - - \ No newline at end of file diff --git a/libs/win32/openssl/openssl.2015.vcxproj b/libs/win32/openssl/openssl.2015.vcxproj deleted file mode 100644 index d901745d32..0000000000 --- a/libs/win32/openssl/openssl.2015.vcxproj +++ /dev/null @@ -1,271 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - openssl - {25BD39B1-C8BF-4676-A738-9CABD9C6BC79} - openssl - Win32Proj - - - - Application - Unicode - true - v140 - - - Application - Unicode - v140 - - - Application - Unicode - true - v140 - - - Application - Unicode - v140 - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - true - false - true - false - - - - /Gs0 %(AdditionalOptions) - MaxSpeed - AnySuitable - include_x86;include;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;OPENSSL_THREADS;MONOLITH;DSO_WIN32;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_USE_APPLINK;OPENSSL_NO_RC5;OPENSSL_NO_MD2;OPENSSL_NO_KRB5;OPENSSL_NO_JPAKE;OPENSSL_NO_STATIC_ENGINE;%(PreprocessorDefinitions) - true - false - Default - MultiThreadedDebugDLL - true - - - Level3 - true - ProgramDatabase - 4996;4133;4267;4244;%(DisableSpecificWarnings) - true - - - ws2_32.lib;%(AdditionalDependencies) - $(ProjectDir)$(Configuration);%(AdditionalLibraryDirectories) - true - Console - MachineX86 - - - - - /Gs0 %(AdditionalOptions) - MaxSpeed - AnySuitable - true - include_x86;include;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;_CONSOLE;OPENSSL_THREADS;MONOLITH;DSO_WIN32;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_USE_APPLINK;OPENSSL_NO_RC5;OPENSSL_NO_MD2;OPENSSL_NO_KRB5;OPENSSL_NO_JPAKE;OPENSSL_NO_STATIC_ENGINE;%(PreprocessorDefinitions) - true - false - Default - MultiThreadedDLL - true - - - Level3 - true - ProgramDatabase - 4996;4133;4267;4244;%(DisableSpecificWarnings) - true - - - ws2_32.lib;%(AdditionalDependencies) - $(ProjectDir)$(Configuration);%(AdditionalLibraryDirectories) - true - Console - true - true - MachineX86 - - - - - X64 - - - /Gs0 %(AdditionalOptions) - MaxSpeed - AnySuitable - include_x64;include;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;OPENSSL_THREADS;MONOLITH;DSO_WIN32;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_USE_APPLINK;OPENSSL_NO_RC5;OPENSSL_NO_MD2;OPENSSL_NO_KRB5;OPENSSL_NO_JPAKE;OPENSSL_NO_STATIC_ENGINE;%(PreprocessorDefinitions) - true - false - Default - MultiThreadedDebugDLL - true - - - Level3 - ProgramDatabase - 4996;4133;4267;4244;%(DisableSpecificWarnings) - true - - - ws2_32.lib;%(AdditionalDependencies) - $(ProjectDir)$(Configuration);%(AdditionalLibraryDirectories) - true - Console - MachineX64 - - - - - X64 - - - /Gs0 %(AdditionalOptions) - MaxSpeed - AnySuitable - true - include_x64;include;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CONSOLE;_CONSOLE;OPENSSL_THREADS;MONOLITH;DSO_WIN32;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_USE_APPLINK;OPENSSL_NO_RC5;OPENSSL_NO_MD2;OPENSSL_NO_KRB5;OPENSSL_NO_JPAKE;OPENSSL_NO_STATIC_ENGINE;%(PreprocessorDefinitions) - true - false - Default - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4996;4133;4267;4244;%(DisableSpecificWarnings) - true - - - ws2_32.lib;%(AdditionalDependencies) - $(ProjectDir)$(Configuration);%(AdditionalLibraryDirectories) - true - Console - true - true - MachineX64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {d331904d-a00a-4694-a5a3-fcff64ab5dbe} - - - {b4b62169-5ad4-4559-8707-3d933ac5db39} - - - - - - \ No newline at end of file diff --git a/libs/win32/openssl/ssleay32.2010.vcxproj.filters b/libs/win32/openssl/ssleay32.2010.vcxproj.filters deleted file mode 100644 index 5686c6efca..0000000000 --- a/libs/win32/openssl/ssleay32.2010.vcxproj.filters +++ /dev/null @@ -1,176 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {f25bde33-475c-4870-aa63-95c0a3bcf356} - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {0a4387d1-72f1-4eaf-96bd-d83822dea414} - - - {8364f4d3-cb5e-498a-b5b1-46107d580c6c} - - - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - Source Files\ssl - - - - - Header Files\crypto - - - Header Files\crypto - - - Header Files\crypto\evp - - - \ No newline at end of file diff --git a/libs/win32/openssl/ssleay32.2015.vcxproj b/libs/win32/openssl/ssleay32.2015.vcxproj deleted file mode 100644 index cd58397459..0000000000 --- a/libs/win32/openssl/ssleay32.2015.vcxproj +++ /dev/null @@ -1,264 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - ssleay32 - {B4B62169-5AD4-4559-8707-3D933AC5DB39} - ssleay32 - Win32Proj - - - - DynamicLibrary - Unicode - false - true - v140 - - - DynamicLibrary - Unicode - false - v140 - - - DynamicLibrary - Unicode - false - true - v140 - - - DynamicLibrary - Unicode - false - v140 - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - true - false - true - false - $(PlatformName)\ssleay32\$(Configuration)\ - $(PlatformName)\ssleay32\$(Configuration)\ - $(PlatformName)\ssleay32\$(Configuration)\ - $(PlatformName)\ssleay32\$(Configuration)\ - - - - /Gs0 %(AdditionalOptions) - MaxSpeed - AnySuitable - include_x86;include;..\..\openssl-$(OpenSSLVersion)\crypto;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WIN32;_DEBUG;DSO_WIN32;OPENSSL_THREADS;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_USE_APPLINK;OPENSSL_NO_RC5;OPENSSL_NO_MD2;OPENSSL_NO_KRB5;OPENSSL_NO_JPAKE;OPENSSL_NO_STATIC_ENGINE;_WINDLL;OPENSSL_BUILD_SHLIBSSL;OPENSSL_NO_SCTP;%(PreprocessorDefinitions) - true - MultiThreadedDebugDLL - true - - - Level3 - true - ProgramDatabase - 4311;4267;4244;%(DisableSpecificWarnings) - true - - - $(ProjectDir)$(Configuration);%(AdditionalLibraryDirectories) - ssleay32.def - true - true - MachineX86 - - - - - /Gs0 %(AdditionalOptions) - MaxSpeed - AnySuitable - include_x86;include;..\..\openssl-$(OpenSSLVersion)\crypto;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WIN32;NDEBUG;DSO_WIN32;OPENSSL_THREADS;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_USE_APPLINK;OPENSSL_NO_RC5;OPENSSL_NO_MD2;OPENSSL_NO_KRB5;OPENSSL_NO_JPAKE;OPENSSL_NO_STATIC_ENGINE;_WINDLL;OPENSSL_BUILD_SHLIBSSL;OPENSSL_NO_SCTP;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - true - ProgramDatabase - 4311;4267;4244;%(DisableSpecificWarnings) - true - - - $(ProjectDir)$(Configuration);%(AdditionalLibraryDirectories) - ssleay32.def - true - true - MachineX86 - - - - - X64 - - - /Gs0 %(AdditionalOptions) - MaxSpeed - AnySuitable - include_x64;include;..\..\openssl-$(OpenSSLVersion)\crypto;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WIN32;_DEBUG;DSO_WIN32;OPENSSL_THREADS;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_USE_APPLINK;OPENSSL_NO_RC5;OPENSSL_NO_MD2;OPENSSL_NO_KRB5;OPENSSL_NO_JPAKE;OPENSSL_NO_STATIC_ENGINE;_WINDLL;OPENSSL_BUILD_SHLIBSSL;OPENSSL_NO_SCTP;%(PreprocessorDefinitions) - true - MultiThreadedDebugDLL - true - - - Level3 - ProgramDatabase - 4311;4267;4244;%(DisableSpecificWarnings) - true - - - %(AdditionalDependencies) - $(ProjectDir)$(Configuration);%(AdditionalLibraryDirectories) - ssleay32.def - true - true - MachineX64 - - - - - X64 - - - /Gs0 %(AdditionalOptions) - MaxSpeed - AnySuitable - include_x64;include;..\..\openssl-$(OpenSSLVersion)\crypto;..\..\openssl-$(OpenSSLVersion);%(AdditionalIncludeDirectories) - WIN32;NDEBUG;DSO_WIN32;OPENSSL_THREADS;OPENSSL_SYSNAME_WIN32;WIN32_LEAN_AND_MEAN;L_ENDIAN;_CRT_SECURE_NO_DEPRECATE;OPENSSL_USE_APPLINK;OPENSSL_NO_RC5;OPENSSL_NO_MD2;OPENSSL_NO_KRB5;OPENSSL_NO_JPAKE;OPENSSL_NO_STATIC_ENGINE;_WINDLL;OPENSSL_BUILD_SHLIBSSL;OPENSSL_NO_SCTP;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - - - Level3 - ProgramDatabase - 4311;4267;4244;%(DisableSpecificWarnings) - true - - - %(AdditionalDependencies) - $(ProjectDir)$(Configuration);%(AdditionalLibraryDirectories) - ssleay32.def - true - true - MachineX64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {d331904d-a00a-4694-a5a3-fcff64ab5dbe} - - - - - - \ No newline at end of file diff --git a/libs/win32/openssl/ssleay32.def b/libs/win32/openssl/ssleay32.def deleted file mode 100644 index eb9d51b356..0000000000 --- a/libs/win32/openssl/ssleay32.def +++ /dev/null @@ -1,328 +0,0 @@ -; -; Definition file for the DLL version of the SSLEAY library from OpenSSL -; - -LIBRARY SSLEAY32 - -EXPORTS - BIO_f_ssl @121 - BIO_new_buffer_ssl_connect @173 - BIO_new_ssl @122 - BIO_new_ssl_connect @174 - BIO_ssl_copy_session_id @124 - BIO_ssl_shutdown @131 - DTLS_client_method @368 - DTLS_method @367 - DTLS_server_method @405 - DTLSv1_2_client_method @384 - DTLSv1_2_method @404 - DTLSv1_2_server_method @373 - DTLSv1_client_method @268 - DTLSv1_method @273 - DTLSv1_server_method @275 - ERR_load_SSL_strings @1 - PEM_read_SSL_SESSION @301 - PEM_read_bio_SSL_SESSION @302 - PEM_write_SSL_SESSION @305 - PEM_write_bio_SSL_SESSION @296 - SRP_Calc_A_param @332 - SRP_generate_client_master_secret @335 - SRP_generate_server_master_secret @333 - SSL_CIPHER_description @2 - SSL_CIPHER_find @382 - SSL_CIPHER_get_bits @128 - SSL_CIPHER_get_id @349 - SSL_CIPHER_get_name @130 - SSL_CIPHER_get_version @129 - SSL_COMP_add_compression_method @184 - SSL_COMP_free_compression_methods @407 - SSL_COMP_get_compression_methods @276 - SSL_COMP_get_name @271 - SSL_COMP_set0_compression_methods @374 - SSL_CONF_CTX_clear_flags @386 - SSL_CONF_CTX_finish @366 - SSL_CONF_CTX_free @401 - SSL_CONF_CTX_new @396 - SSL_CONF_CTX_set1_prefix @395 - SSL_CONF_CTX_set_flags @397 - SSL_CONF_CTX_set_ssl @398 - SSL_CONF_CTX_set_ssl_ctx @381 - SSL_CONF_cmd @379 - SSL_CONF_cmd_argv @372 - SSL_CONF_cmd_value_type @392 - SSL_CTX_SRP_CTX_free @334 - SSL_CTX_SRP_CTX_init @330 - SSL_CTX_add_client_CA @3 - SSL_CTX_add_client_custom_ext @376 - SSL_CTX_add_server_custom_ext @389 - SSL_CTX_add_session @4 - SSL_CTX_callback_ctrl @243 - SSL_CTX_check_private_key @5 - SSL_CTX_ctrl @6 - SSL_CTX_flush_sessions @7 - SSL_CTX_free @8 - SSL_CTX_get0_certificate @390 - SSL_CTX_get0_param @378 - SSL_CTX_get0_privatekey @364 - SSL_CTX_get_cert_store @180 - SSL_CTX_get_client_CA_list @9 - SSL_CTX_get_client_cert_cb @288 - SSL_CTX_get_ex_data @138 - SSL_CTX_get_ex_new_index @167 - SSL_CTX_get_info_callback @282 - SSL_CTX_get_quiet_shutdown @140 - SSL_CTX_get_ssl_method @380 - SSL_CTX_get_timeout @179 - SSL_CTX_get_verify_callback @10 - SSL_CTX_get_verify_depth @228 - SSL_CTX_get_verify_mode @11 - SSL_CTX_load_verify_locations @141 - SSL_CTX_new @12 - SSL_CTX_remove_session @13 - SSL_CTX_sess_get_get_cb @279 - SSL_CTX_sess_get_new_cb @287 - SSL_CTX_sess_get_remove_cb @289 - SSL_CTX_sess_set_get_cb @280 - SSL_CTX_sess_set_new_cb @278 - SSL_CTX_sess_set_remove_cb @285 - SSL_CTX_sessions @245 - SSL_CTX_set1_param @310 - SSL_CTX_set_alpn_protos @387 - SSL_CTX_set_alpn_select_cb @391 - SSL_CTX_set_cert_cb @375 - SSL_CTX_set_cert_store @181 - SSL_CTX_set_cert_verify_callback @232 - SSL_CTX_set_cipher_list @15 - SSL_CTX_set_client_CA_list @16 - SSL_CTX_set_client_cert_cb @284 - SSL_CTX_set_client_cert_engine @293 - SSL_CTX_set_cookie_generate_cb @283 - SSL_CTX_set_cookie_verify_cb @281 - SSL_CTX_set_default_passwd_cb @17 - SSL_CTX_set_default_passwd_cb_userdata @235 - SSL_CTX_set_default_verify_paths @142 - SSL_CTX_set_ex_data @143 - SSL_CTX_set_generate_session_id @264 - SSL_CTX_set_info_callback @286 - SSL_CTX_set_msg_callback @266 - SSL_CTX_set_next_proto_select_cb @361 - SSL_CTX_set_next_protos_advertised_cb @355 - SSL_CTX_set_psk_client_callback @295 - SSL_CTX_set_psk_server_callback @303 - SSL_CTX_set_purpose @238 - SSL_CTX_set_quiet_shutdown @145 - SSL_CTX_set_session_id_context @231 - SSL_CTX_set_srp_cb_arg @328 - SSL_CTX_set_srp_client_pwd_callback @316 - SSL_CTX_set_srp_password @324 - SSL_CTX_set_srp_strength @325 - SSL_CTX_set_srp_username @329 - SSL_CTX_set_srp_username_callback @318 - SSL_CTX_set_srp_verify_param_callback @326 - SSL_CTX_set_ssl_version @19 - SSL_CTX_set_timeout @178 - SSL_CTX_set_tlsext_use_srtp @358 - SSL_CTX_set_tmp_dh_callback @176 - SSL_CTX_set_tmp_ecdh_callback @269 - SSL_CTX_set_tmp_rsa_callback @177 - SSL_CTX_set_trust @237 - SSL_CTX_set_verify @21 - SSL_CTX_set_verify_depth @225 - SSL_CTX_use_PrivateKey @22 - SSL_CTX_use_PrivateKey_ASN1 @23 - SSL_CTX_use_PrivateKey_file @24 - SSL_CTX_use_RSAPrivateKey @25 - SSL_CTX_use_RSAPrivateKey_ASN1 @26 - SSL_CTX_use_RSAPrivateKey_file @27 - SSL_CTX_use_certificate @28 - SSL_CTX_use_certificate_ASN1 @29 - SSL_CTX_use_certificate_chain_file @222 - SSL_CTX_use_certificate_file @30 - SSL_CTX_use_psk_identity_hint @294 - SSL_CTX_use_serverinfo @383 - SSL_CTX_use_serverinfo_file @406 - SSL_SESSION_free @31 - SSL_SESSION_get0_peer @340 - SSL_SESSION_get_compress_id @362 - SSL_SESSION_get_ex_data @146 - SSL_SESSION_get_ex_new_index @168 - SSL_SESSION_get_id @277 - SSL_SESSION_get_time @134 - SSL_SESSION_get_timeout @136 - SSL_SESSION_new @32 - SSL_SESSION_print @33 - SSL_SESSION_print_fp @34 - SSL_SESSION_set1_id_context @342 - SSL_SESSION_set_ex_data @148 - SSL_SESSION_set_time @135 - SSL_SESSION_set_timeout @137 - SSL_SRP_CTX_free @338 - SSL_SRP_CTX_init @331 - SSL_accept @35 - SSL_add_client_CA @36 - SSL_add_dir_cert_subjects_to_stack @188 - SSL_add_file_cert_subjects_to_stack @185 - SSL_alert_desc_string @37 - SSL_alert_desc_string_long @38 - SSL_alert_type_string @39 - SSL_alert_type_string_long @40 - SSL_cache_hit @344 - SSL_callback_ctrl @244 - SSL_certs_clear @400 - SSL_check_chain @399 - SSL_check_private_key @41 - SSL_clear @42 - SSL_connect @43 - SSL_copy_session_id @44 - SSL_ctrl @45 - SSL_do_handshake @125 - SSL_dup @46 - SSL_dup_CA_list @47 - SSL_export_keying_material @353 - SSL_extension_supported @409 - SSL_free @48 - SSL_get0_alpn_selected @385 - SSL_get0_next_proto_negotiated @356 - SSL_get0_param @363 - SSL_get1_session @242 - SSL_get_SSL_CTX @150 - SSL_get_certificate @49 - SSL_get_cipher_list @52 - SSL_get_ciphers @55 - SSL_get_client_CA_list @56 - SSL_get_current_cipher @127 - SSL_get_current_compression @272 - SSL_get_current_expansion @274 - SSL_get_default_timeout @57 - SSL_get_error @58 - SSL_get_ex_data @151 - SSL_get_ex_data_X509_STORE_CTX_idx @175 - SSL_get_ex_new_index @169 - SSL_get_fd @59 - SSL_get_finished @240 - SSL_get_info_callback @165 - SSL_get_peer_cert_chain @60 - SSL_get_peer_certificate @61 - SSL_get_peer_finished @241 - SSL_get_privatekey @126 - SSL_get_psk_identity @304 - SSL_get_psk_identity_hint @297 - SSL_get_quiet_shutdown @153 - SSL_get_rbio @63 - SSL_get_read_ahead @64 - SSL_get_rfd @246 - SSL_get_selected_srtp_profile @357 - SSL_get_servername @291 - SSL_get_servername_type @292 - SSL_get_session @154 - SSL_get_shared_ciphers @65 - SSL_get_shared_sigalgs @365 - SSL_get_shutdown @155 - SSL_get_sigalgs @394 - SSL_get_srp_N @322 - SSL_get_srp_g @317 - SSL_get_srp_userinfo @319 - SSL_get_srp_username @323 - SSL_get_srtp_profiles @360 - SSL_get_ssl_method @66 - SSL_get_verify_callback @69 - SSL_get_verify_depth @229 - SSL_get_verify_mode @70 - SSL_get_verify_result @157 - SSL_get_version @71 - SSL_get_wbio @72 - SSL_get_wfd @247 - SSL_has_matching_session_id @249 - SSL_is_server @377 - SSL_library_init @183 - SSL_load_client_CA_file @73 - SSL_load_error_strings @74 - SSL_new @75 - SSL_peek @76 - SSL_pending @77 - SSL_read @78 - SSL_renegotiate @79 - SSL_renegotiate_abbreviated @312 - SSL_renegotiate_pending @265 - SSL_rstate_string @80 - SSL_rstate_string_long @81 - SSL_select_next_proto @359 - SSL_set1_param @309 - SSL_set_SSL_CTX @290 - SSL_set_accept_state @82 - SSL_set_alpn_protos @370 - SSL_set_bio @83 - SSL_set_cert_cb @393 - SSL_set_cipher_list @84 - SSL_set_client_CA_list @85 - SSL_set_connect_state @86 - SSL_set_debug @339 - SSL_set_ex_data @158 - SSL_set_fd @87 - SSL_set_generate_session_id @258 - SSL_set_info_callback @160 - SSL_set_msg_callback @267 - SSL_set_psk_client_callback @300 - SSL_set_psk_server_callback @298 - SSL_set_purpose @236 - SSL_set_quiet_shutdown @161 - SSL_set_read_ahead @88 - SSL_set_rfd @89 - SSL_set_session @90 - SSL_set_session_id_context @189 - SSL_set_session_secret_cb @307 - SSL_set_session_ticket_ext @306 - SSL_set_session_ticket_ext_cb @308 - SSL_set_shutdown @162 - SSL_set_srp_server_param @320 - SSL_set_srp_server_param_pw @321 - SSL_set_ssl_method @91 - SSL_set_state @348 - SSL_set_tlsext_use_srtp @354 - SSL_set_tmp_dh_callback @187 - SSL_set_tmp_ecdh_callback @270 - SSL_set_tmp_rsa_callback @186 - SSL_set_trust @239 - SSL_set_verify @94 - SSL_set_verify_depth @226 - SSL_set_verify_result @163 - SSL_set_wfd @95 - SSL_shutdown @96 - SSL_srp_server_param_with_username @336 - SSL_state @166 - SSL_state_string @97 - SSL_state_string_long @98 - SSL_use_PrivateKey @99 - SSL_use_PrivateKey_ASN1 @100 - SSL_use_PrivateKey_file @101 - SSL_use_RSAPrivateKey @102 - SSL_use_RSAPrivateKey_ASN1 @103 - SSL_use_RSAPrivateKey_file @104 - SSL_use_certificate @105 - SSL_use_certificate_ASN1 @106 - SSL_use_certificate_file @107 - SSL_use_psk_identity_hint @299 - SSL_version @164 - SSL_want @182 - SSL_write @108 - SSLv23_client_method @110 - SSLv23_method @111 - SSLv23_server_method @112 - SSLv2_client_method @113 - SSLv2_method @114 - SSLv2_server_method @115 - SSLv3_client_method @116 - SSLv3_method @117 - SSLv3_server_method @118 - TLSv1_1_client_method @314 - TLSv1_1_method @313 - TLSv1_1_server_method @315 - TLSv1_2_client_method @341 - TLSv1_2_method @350 - TLSv1_2_server_method @343 - TLSv1_client_method @172 - TLSv1_method @170 - TLSv1_server_method @171 - d2i_SSL_SESSION @119 - i2d_SSL_SESSION @120 - diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.2015.vcxproj b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.2015.vcxproj index f4196aacde..c8f0402c35 100644 --- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.2015.vcxproj +++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.2015.vcxproj @@ -82,7 +82,7 @@ - $(SolutionDir)Debug/bin;$(AdditionalLibraryDirectories) + $(SolutionDir)Debug/bin;%(AdditionalLibraryDirectories) false diff --git a/w32/openssl.props b/w32/openssl.props index 05b75f0fa5..9d6a04239e 100644 --- a/w32/openssl.props +++ b/w32/openssl.props @@ -2,23 +2,73 @@ + true + + + + + + + + + + + + + + + + + + - $(BaseDir)libs\win32\openssl\include_x86;$(BaseDir)libs\win32\openssl\include;%(AdditionalIncludeDirectories) - $(BaseDir)libs\win32\openssl\include_x64;$(BaseDir)libs\win32\openssl\include;%(AdditionalIncludeDirectories) + $(OpenSSLLibDir)\include;%(AdditionalIncludeDirectories) + $(OpenSSLLibDir)\include_x86;%(AdditionalIncludeDirectories) + $(OpenSSLLibDir)\include_x64;%(AdditionalIncludeDirectories) HAVE_OPENSSL;HAVE_OPENSSL_DTLS_SRTP;HAVE_OPENSSL_DTLS;%(PreprocessorDefinitions) + + $(OpenSSLLibDir)\binaries\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) + ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies) + ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies) + - - - {d331904d-a00a-4694-a5a3-fcff64ab5dbe} - - - {b4b62169-5ad4-4559-8707-3d933ac5db39} - - \ No newline at end of file From 89770f4522327a2c0376284dfd93277b61616401 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 27 Mar 2018 19:35:04 -0500 Subject: [PATCH 133/264] FS-11057: [mod_conference] CPU race on personal canvas #resolve --- .../mod_conference/conference_api.c | 21 ++++++++++++------- .../mod_conference/conference_member.c | 8 +++++-- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index d8341361b2..46d1798ed9 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -1418,13 +1418,8 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s float sdiv = 0; int fdiv = 0; int force_w = 0, force_h = 0; - - - if (!conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { - stream->write_function(stream, "-ERR Bandwidth control not available.\n"); - return SWITCH_STATUS_SUCCESS; - } - + conference_member_t *imember; + if (!argv[2]) { stream->write_function(stream, "-ERR Invalid input\n"); return SWITCH_STATUS_SUCCESS; @@ -1485,6 +1480,18 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s } switch_mutex_lock(conference->member_mutex); + + for (imember = conference->members; imember; imember = imember->next) { + + if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO_READY)) { + continue; + } + + switch_core_media_set_outgoing_bitrate(imember->session, SWITCH_MEDIA_TYPE_VIDEO, video_write_bandwidth); + + stream->write_function(stream, "+OK Set Bandwidth %d kps for member %s\n", video_write_bandwidth, switch_channel_get_name(imember->channel)); + } + for (i = 0; i <= conference->canvas_count; i++) { if (i > -1 && i != id - 1) { continue; diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 274f274c52..23f4fd24e8 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -829,14 +829,18 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m if ((var = switch_channel_get_variable(member->channel, "rtp_video_max_bandwidth_out"))) { member->max_bw_out = switch_parse_bandwidth_string(var); - + if (member->max_bw_out < conference->video_codec_settings.video.bandwidth) { conference_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING); - switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, member->max_bw_out); + //switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, member->max_bw_out); } } } + if (conference->video_codec_settings.video.bandwidth) { + switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, conference->video_codec_settings.video.bandwidth); + } + switch_channel_set_variable_printf(channel, "conference_member_id", "%d", member->id); switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); switch_channel_set_variable_printf(channel, "conference_ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); From 9e3bbdd10cbf94674037abb4fb4f0aaf4c7997f1 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 28 Mar 2018 10:10:31 -0500 Subject: [PATCH 134/264] FS-11068: [mod_conference] Avatar members not supported on personal canvas leading to miscount #resolve --- src/mod/applications/mod_conference/mod_conference.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 7ca2215e62..dc77c4312b 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -343,8 +343,12 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob members_seeing_video++; } - if (imember->avatar_png_img && !switch_channel_test_flag(channel, CF_VIDEO)) { - members_with_avatar++; + if (!conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { + if (imember->avatar_png_img && !switch_channel_test_flag(channel, CF_VIDEO)) { + members_with_avatar++; + } + } else { + members_with_avatar = 0; } if (conference_utils_member_test_flag(imember, MFLAG_NOMOH)) { From f193aff26920f98a78e1ea4a7b79d4ac8330df77 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Wed, 28 Mar 2018 12:11:15 -0400 Subject: [PATCH 135/264] FS-11057: [mod_conference] CPU race on personal canvas #resolve --- .../mod_conference/conference_member.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 23f4fd24e8..79ebcfcc4f 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -806,6 +806,8 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m conference_video_reset_member_codec_index(member); if (has_video) { + int bitrate = conference->video_codec_settings.video.bandwidth; + if ((var = switch_channel_get_variable_dup(member->channel, "video_mute_png", SWITCH_FALSE, -1))) { member->video_mute_png = switch_core_strdup(member->pool, var); member->video_mute_img = switch_img_read_png(member->video_mute_png, SWITCH_IMG_FMT_I420); @@ -829,17 +831,19 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m if ((var = switch_channel_get_variable(member->channel, "rtp_video_max_bandwidth_out"))) { member->max_bw_out = switch_parse_bandwidth_string(var); - + if (member->max_bw_out < conference->video_codec_settings.video.bandwidth) { conference_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING); - //switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, member->max_bw_out); + bitrate = member->max_bw_out; } } + + if (bitrate) { + switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, bitrate); + } + } - if (conference->video_codec_settings.video.bandwidth) { - switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, conference->video_codec_settings.video.bandwidth); - } switch_channel_set_variable_printf(channel, "conference_member_id", "%d", member->id); switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); From b5a7b74b1c581ff8e8a1c0f68ccf5859c3884d25 Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 28 Mar 2018 17:44:06 -0500 Subject: [PATCH 136/264] revert --- .../mod_conference/conference_api.c | 21 +++++++------------ .../mod_conference/conference_member.c | 10 +-------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index 46d1798ed9..d8341361b2 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -1418,8 +1418,13 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s float sdiv = 0; int fdiv = 0; int force_w = 0, force_h = 0; - conference_member_t *imember; - + + + if (!conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { + stream->write_function(stream, "-ERR Bandwidth control not available.\n"); + return SWITCH_STATUS_SUCCESS; + } + if (!argv[2]) { stream->write_function(stream, "-ERR Invalid input\n"); return SWITCH_STATUS_SUCCESS; @@ -1480,18 +1485,6 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s } switch_mutex_lock(conference->member_mutex); - - for (imember = conference->members; imember; imember = imember->next) { - - if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO_READY)) { - continue; - } - - switch_core_media_set_outgoing_bitrate(imember->session, SWITCH_MEDIA_TYPE_VIDEO, video_write_bandwidth); - - stream->write_function(stream, "+OK Set Bandwidth %d kps for member %s\n", video_write_bandwidth, switch_channel_get_name(imember->channel)); - } - for (i = 0; i <= conference->canvas_count; i++) { if (i > -1 && i != id - 1) { continue; diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 79ebcfcc4f..274f274c52 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -806,8 +806,6 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m conference_video_reset_member_codec_index(member); if (has_video) { - int bitrate = conference->video_codec_settings.video.bandwidth; - if ((var = switch_channel_get_variable_dup(member->channel, "video_mute_png", SWITCH_FALSE, -1))) { member->video_mute_png = switch_core_strdup(member->pool, var); member->video_mute_img = switch_img_read_png(member->video_mute_png, SWITCH_IMG_FMT_I420); @@ -834,17 +832,11 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m if (member->max_bw_out < conference->video_codec_settings.video.bandwidth) { conference_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING); - bitrate = member->max_bw_out; + switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, member->max_bw_out); } } - - if (bitrate) { - switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, bitrate); - } - } - switch_channel_set_variable_printf(channel, "conference_member_id", "%d", member->id); switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); switch_channel_set_variable_printf(channel, "conference_ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); From b12762dd5a4b69b493db9807803c5e3c940f7711 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 23 Mar 2018 15:46:24 -0500 Subject: [PATCH 137/264] FS-11057: [mod_conference] CPU race on personal canvas #resolve --- .../mod_conference/conference_api.c | 21 ++++++++++++------- .../mod_conference/conference_member.c | 10 ++++++++- .../mod_conference/conference_video.c | 8 +++---- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index d8341361b2..46d1798ed9 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -1418,13 +1418,8 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s float sdiv = 0; int fdiv = 0; int force_w = 0, force_h = 0; - - - if (!conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { - stream->write_function(stream, "-ERR Bandwidth control not available.\n"); - return SWITCH_STATUS_SUCCESS; - } - + conference_member_t *imember; + if (!argv[2]) { stream->write_function(stream, "-ERR Invalid input\n"); return SWITCH_STATUS_SUCCESS; @@ -1485,6 +1480,18 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s } switch_mutex_lock(conference->member_mutex); + + for (imember = conference->members; imember; imember = imember->next) { + + if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO_READY)) { + continue; + } + + switch_core_media_set_outgoing_bitrate(imember->session, SWITCH_MEDIA_TYPE_VIDEO, video_write_bandwidth); + + stream->write_function(stream, "+OK Set Bandwidth %d kps for member %s\n", video_write_bandwidth, switch_channel_get_name(imember->channel)); + } + for (i = 0; i <= conference->canvas_count; i++) { if (i > -1 && i != id - 1) { continue; diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 274f274c52..79ebcfcc4f 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -806,6 +806,8 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m conference_video_reset_member_codec_index(member); if (has_video) { + int bitrate = conference->video_codec_settings.video.bandwidth; + if ((var = switch_channel_get_variable_dup(member->channel, "video_mute_png", SWITCH_FALSE, -1))) { member->video_mute_png = switch_core_strdup(member->pool, var); member->video_mute_img = switch_img_read_png(member->video_mute_png, SWITCH_IMG_FMT_I420); @@ -832,11 +834,17 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m if (member->max_bw_out < conference->video_codec_settings.video.bandwidth) { conference_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING); - switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, member->max_bw_out); + bitrate = member->max_bw_out; } } + + if (bitrate) { + switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, bitrate); + } + } + switch_channel_set_variable_printf(channel, "conference_member_id", "%d", member->id); switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); switch_channel_set_variable_printf(channel, "conference_ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 7259fdb60f..110b5f0d54 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3783,8 +3783,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr } if (layer && use_img) { - switch_img_copy(use_img, &layer->cur_img); - conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); + //switch_img_copy(use_img, &layer->cur_img); + conference_video_scale_and_patch(layer, use_img, SWITCH_FALSE); } } @@ -3806,8 +3806,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr switch_img_free(&layer->banner_img); switch_img_free(&layer->logo_img); layer->member_id = -1; - switch_img_copy(img, &layer->cur_img); - conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); + //switch_img_copy(img, &layer->cur_img); + conference_video_scale_and_patch(layer, img, SWITCH_FALSE); } } From d22e16ece9b6d94a9245995270c0b4d8d47b592b Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 29 Mar 2018 02:00:10 +0300 Subject: [PATCH 138/264] FS-11069: [Build-System] Update zlib to 1.2.11 and move it to pre-compiled binaries on Windows. --- Freeswitch.2015.sln | 34 ----- libs/.gitignore | 2 + libs/win32/Download zlib.2015.vcxproj | 82 ----------- libs/win32/libpng/libpng.vcxproj | 19 +-- libs/win32/zlib/zlib.vcxproj | 188 -------------------------- w32/zlib-version.props | 19 +++ w32/zlib.props | 107 +++++++-------- 7 files changed, 75 insertions(+), 376 deletions(-) delete mode 100644 libs/win32/Download zlib.2015.vcxproj delete mode 100644 libs/win32/zlib/zlib.vcxproj create mode 100644 w32/zlib-version.props diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index 269f87731d..e347bda003 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -583,19 +583,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyuv", "libs\win32\libyuv EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvpx", "libs\win32\libvpx\libvpx.2015.vcxproj", "{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "libs\win32\zlib\zlib.vcxproj", "{60F89955-91C6-3A36-8000-13C592FEC2DF}" - ProjectSection(ProjectDependencies) = postProject - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311} = {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "libs\win32\libpng\libpng.vcxproj", "{D6973076-9317-4EF2-A0B8-B7A18AC0713E}" ProjectSection(ProjectDependencies) = postProject - {60F89955-91C6-3A36-8000-13C592FEC2DF} = {60F89955-91C6-3A36-8000-13C592FEC2DF} {C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33} = {C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download zlib", "libs\win32\Download zlib.2015.vcxproj", "{CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libpng", "libs\win32\Download libpng.2015.vcxproj", "{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "libs\win32\freetype\freetype.vcxproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}" @@ -2682,18 +2674,6 @@ Global {DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Win32.Build.0 = Release|Win32 {DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|x64.ActiveCfg = Release|x64 {DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|x64.Build.0 = Release|x64 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.All|Win32.ActiveCfg = Release|Win32 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.All|Win32.Build.0 = Release|Win32 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.All|x64.ActiveCfg = Release|x64 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.All|x64.Build.0 = Release|x64 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|Win32.ActiveCfg = Debug|Win32 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|Win32.Build.0 = Debug|Win32 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|x64.ActiveCfg = Debug|x64 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.Debug|x64.Build.0 = Debug|x64 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|Win32.ActiveCfg = Release|Win32 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|Win32.Build.0 = Release|Win32 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|x64.ActiveCfg = Release|x64 - {60F89955-91C6-3A36-8000-13C592FEC2DF}.Release|x64.Build.0 = Release|x64 {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.All|Win32.ActiveCfg = Release|Win32 {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.All|Win32.Build.0 = Release|Win32 {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.All|x64.ActiveCfg = Release|x64 @@ -2706,18 +2686,6 @@ Global {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|Win32.Build.0 = Release|Win32 {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|x64.ActiveCfg = Release|x64 {D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|x64.Build.0 = Release|x64 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.All|Win32.ActiveCfg = Release|Win32 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.All|Win32.Build.0 = Release|Win32 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.All|x64.ActiveCfg = Release|Win32 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.All|x64.Build.0 = Release|Win32 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.Debug|Win32.ActiveCfg = Debug|Win32 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.Debug|Win32.Build.0 = Debug|Win32 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.Debug|x64.ActiveCfg = Debug|Win32 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.Debug|x64.Build.0 = Debug|Win32 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.Release|Win32.ActiveCfg = Release|Win32 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.Release|Win32.Build.0 = Release|Win32 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.Release|x64.ActiveCfg = Release|Win32 - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311}.Release|x64.Build.0 = Release|Win32 {C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.All|Win32.ActiveCfg = Release|Win32 {C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.All|Win32.Build.0 = Release|Win32 {C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.All|x64.ActiveCfg = Release|Win32 @@ -3147,9 +3115,7 @@ Global {5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {B6E22500-3DB6-4E6E-8CD5-591B781D7D99} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} - {60F89955-91C6-3A36-8000-13C592FEC2DF} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311} = {C120A020-773F-4EA3-923F-B67AF28B750D} {C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33} = {C120A020-773F-4EA3-923F-B67AF28B750D} {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {0AD87FDA-989F-4638-B6E1-B0132BB0560A} = {C120A020-773F-4EA3-923F-B67AF28B750D} diff --git a/libs/.gitignore b/libs/.gitignore index 450b313e42..670c2438b3 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -842,3 +842,5 @@ spandsp/configure srtp/configure tiff-4.0.2/configure unimrcp/configure +zlib-*/ +zlib-* diff --git a/libs/win32/Download zlib.2015.vcxproj b/libs/win32/Download zlib.2015.vcxproj deleted file mode 100644 index d0e044de79..0000000000 --- a/libs/win32/Download zlib.2015.vcxproj +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - Download zlib - {CDCEC78E-D445-47AC-A2AE-DEBE2CE3A311} - Download zlib - Win32Proj - - - - Utility - MultiByte - v140 - - - Utility - MultiByte - v140 - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(PlatformName)\zlib\$(Configuration)\ - $(PlatformName)\zlib\$(Configuration)\ - - - - $(IntDir)BuildLog $(ProjectName).htm - - - - - - - - - $(IntDir)BuildLog $(ProjectName).htm - - - - - - - - - Document - Downloading zlib. - if not exist "$(ProjectDir)..\zlib" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/zlib.tar.bz2 "$(ProjectDir).." - - $(ProjectDir)..\zlib;%(Outputs) - Downloading zlib. - if not exist "$(ProjectDir)..\zlib" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/zlib.tar.bz2 "$(ProjectDir).." - - $(ProjectDir)..\zlib;%(Outputs) - - - - - - \ No newline at end of file diff --git a/libs/win32/libpng/libpng.vcxproj b/libs/win32/libpng/libpng.vcxproj index a6a66f1e00..0fcf409fab 100644 --- a/libs/win32/libpng/libpng.vcxproj +++ b/libs/win32/libpng/libpng.vcxproj @@ -100,7 +100,6 @@ CompileAsC true $(DisableSpecificWarnings) - $(ZLibSrcDir);%(AdditionalIncludeDirectories) $(TreatWarningAsError) Disabled MultiThreadedDebugDLL @@ -108,9 +107,7 @@ Windows true - zlib.lib 16 - $(OutDir) @@ -129,18 +126,15 @@ true false $(DisableSpecificWarnings) - $(ZLibSrcDir);%(AdditionalIncludeDirectories) $(TreatWarningAsError) Full Windows - true + false true true - zlib.lib 16 - $(OutDir) @@ -163,7 +157,6 @@ CompileAsC true $(DisableSpecificWarnings) - $(ZLibSrcDir);%(AdditionalIncludeDirectories) $(TreatWarningAsError) Disabled MultiThreadedDebugDLL @@ -171,9 +164,7 @@ Windows true - zlib.lib 16 - $(OutDir) @@ -195,18 +186,15 @@ true false $(DisableSpecificWarnings) - $(ZLibSrcDir);%(AdditionalIncludeDirectories) $(TreatWarningAsError) Full Windows - true + false true true - zlib.lib 16 - $(OutDir) @@ -245,9 +233,6 @@ {c2d5eb6d-f4de-4dee-b5b8-b6fd26c22d33} - - {60f89955-91c6-3a36-8000-13c592fec2df} - diff --git a/libs/win32/zlib/zlib.vcxproj b/libs/win32/zlib/zlib.vcxproj deleted file mode 100644 index ec44043925..0000000000 --- a/libs/win32/zlib/zlib.vcxproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - {cdcec78e-d445-47ac-a2ae-debe2ce3a311} - - - - {60F89955-91C6-3A36-8000-13C592FEC2DF} - Win32Proj - zlib - - - - - StaticLibrary - v140 - - - StaticLibrary - v140 - - - StaticLibrary - v140 - false - - - StaticLibrary - v140 - - - - - - - - - - - - - - - - - - - - - - - true - - - true - - - true - - - true - - - - WIN32;_DEBUG;_WINDOWS;Z_SOLO;%(PreprocessorDefinitions) - $(WarningLevel) - ProgramDatabase - Disabled - true - true - $(DisableSpecificWarnings);4127;4131;4242;4244 - $(TreatWarningAsError) - MultiThreadedDebugDLL - - - MachineX86 - true - Windows - - - - - $(WarningLevel) - ProgramDatabase - Full - true - true - false - true - true - $(DisableSpecificWarnings);4127;4131;4242;4244 - $(TreatWarningAsError) - WIN32;NDEBUG;_WINDOWS;Z_SOLO;%(PreprocessorDefinitions) - - - MachineX86 - true - Windows - true - true - - - true - - - - - X64 - - - WIN32;_DEBUG;_WINDOWS;Z_SOLO;%(PreprocessorDefinitions) - $(WarningLevel) - ProgramDatabase - Disabled - true - true - $(DisableSpecificWarnings);4127;4131;4242;4244 - $(TreatWarningAsError) - MultiThreadedDebugDLL - - - true - Windows - - - - - X64 - - - $(WarningLevel) - ProgramDatabase - Full - true - true - false - true - true - $(DisableSpecificWarnings);4127;4131;4242;4244 - $(TreatWarningAsError) - WIN32;NDEBUG;_WINDOWS;Z_SOLO;%(PreprocessorDefinitions) - - - true - Windows - true - true - - - true - - - - - - \ No newline at end of file diff --git a/w32/zlib-version.props b/w32/zlib-version.props new file mode 100644 index 0000000000..48ad7072af --- /dev/null +++ b/w32/zlib-version.props @@ -0,0 +1,19 @@ + + + + + + + 1.2.11 + + + true + + + + + + $(zlibVersion) + + + diff --git a/w32/zlib.props b/w32/zlib.props index 9f152a267b..af8292a2c4 100644 --- a/w32/zlib.props +++ b/w32/zlib.props @@ -1,64 +1,61 @@ - - - - - - $(SolutionDir)libs\zlib - - - true - - - EnableAllWarnings - true - 4255;4668;4710;4711;4746;4820;4996 + + $(BaseDir)libs\zlib-$(zlibVersion) + + + + + + + + + + - $(SolutionDir)libs\zlib;%(AdditionalIncludeDirectories) + $(SolutionDir)libs\zlib-$(zlibVersion)\include;%(AdditionalIncludeDirectories) HAVE_ZLIB;ZLIB_STATICLIB;%(PreprocessorDefinitions) + + $(SolutionDir)libs\zlib-$(zlibVersion)\binaries\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + zlib.lib;%(AdditionalDependencies) + \ No newline at end of file From 49d19bffcdc602ef25fbb954dd727ff772ca6d30 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 29 Mar 2018 18:50:16 +0300 Subject: [PATCH 139/264] FS-11074: [Core, Build-System] Add PostgreSQL to the Freeswitch Core on Windows. --- libs/.gitignore | 2 + src/switch_pgsql.c | 30 +++++++++-- w32/Library/FreeSwitchCore.2015.vcxproj | 1 + w32/libpq-version.props | 19 +++++++ w32/libpq.props | 72 +++++++++++++++++++++++++ 5 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 w32/libpq-version.props create mode 100644 w32/libpq.props diff --git a/libs/.gitignore b/libs/.gitignore index 670c2438b3..376e537633 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -844,3 +844,5 @@ tiff-4.0.2/configure unimrcp/configure zlib-*/ zlib-* +libpq-*/ +libpq-* diff --git a/src/switch_pgsql.c b/src/switch_pgsql.c index f3411361fd..b3fa2d06e4 100644 --- a/src/switch_pgsql.c +++ b/src/switch_pgsql.c @@ -39,7 +39,12 @@ #ifdef SWITCH_HAVE_PGSQL #include + +#ifndef _WIN32 #include +#else +#include +#endif struct switch_pgsql_handle { @@ -253,6 +258,7 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_send_query(switch_pgsql_handl if (!PQsendQuery(handle->con, sql)) { err_str = switch_pgsql_handle_get_error(handle); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failed to send query (%s) to database: %s\n", sql, err_str); + switch_safe_free(err_str); switch_pgsql_finish_results(handle); goto error; } @@ -292,7 +298,11 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_next_result_timed(switch_pgsq switch_time_t ctime; unsigned int usec = msec * 1000; char *err_str; - struct pollfd fds[2] = { {0} }; +#ifndef _WIN32 + struct pollfd fds[2] = { { 0 } }; +#else + fd_set rs, es; +#endif int poll_res = 0; if(!handle) { @@ -309,6 +319,8 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_next_result_timed(switch_pgsq start = switch_micro_time_now(); while((ctime = switch_micro_time_now()) - start <= usec) { int wait_time = (usec - (ctime - start)) / 1000; + /* Wait for the PostgreSQL socket to be ready for data reads. */ +#ifndef _WIN32 fds[0].fd = handle->sock; fds[0].events |= POLLIN; fds[0].events |= POLLERR; @@ -318,8 +330,17 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_next_result_timed(switch_pgsq fds[0].events |= POLLRDNORM; fds[0].events |= POLLRDBAND; - /* Wait for the PostgreSQL socket to be ready for data reads. */ - if ((poll_res = poll(&fds[0], 1, wait_time)) > 0 ) { + poll_res = poll(&fds[0], 1, wait_time); +#else + struct timeval wait = { wait_time * 1000, 0}; + FD_ZERO(&rs); + FD_SET(handle->sock, &rs); + FD_ZERO(&es); + FD_SET(handle->sock, &es); + poll_res = select(0, &rs, 0, &es, &wait); +#endif + if (poll_res > 0 ) { +#ifndef _WIN32 if (fds[0].revents & POLLHUP || fds[0].revents & POLLNVAL) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "PGSQL socket closed or invalid while waiting for result for query (%s)\n", handle->sql); goto error; @@ -327,6 +348,9 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_next_result_timed(switch_pgsq switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Poll error trying to read PGSQL socket for query (%s)\n", handle->sql); goto error; } else if (fds[0].revents & POLLIN || fds[0].revents & POLLPRI || fds[0].revents & POLLRDNORM || fds[0].revents & POLLRDBAND) { +#else + if (FD_ISSET(handle->sock, &rs)) { +#endif /* Then try to consume any input waiting. */ if (PQconsumeInput(handle->con)) { if (PQstatus(handle->con) == CONNECTION_BAD) { diff --git a/w32/Library/FreeSwitchCore.2015.vcxproj b/w32/Library/FreeSwitchCore.2015.vcxproj index 62e2684aee..583100e5a5 100644 --- a/w32/Library/FreeSwitchCore.2015.vcxproj +++ b/w32/Library/FreeSwitchCore.2015.vcxproj @@ -47,6 +47,7 @@ v140 + diff --git a/w32/libpq-version.props b/w32/libpq-version.props new file mode 100644 index 0000000000..7d92fe6980 --- /dev/null +++ b/w32/libpq-version.props @@ -0,0 +1,19 @@ + + + + + + + 10.3 + + + true + + + + + + $(libpqVersion) + + + diff --git a/w32/libpq.props b/w32/libpq.props new file mode 100644 index 0000000000..6a53bc8d95 --- /dev/null +++ b/w32/libpq.props @@ -0,0 +1,72 @@ + + + + + + + + + $(BaseDir)libs\libpq-$(libpqVersion) + + + + + + + + + + + + + + + + + + + + + + $(libpqlibDir)\include;%(AdditionalIncludeDirectories) + SWITCH_HAVE_PGSQL;%(PreprocessorDefinitions) + + + $(libpqlibDir)\binaries\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) + libpq.lib;Secur32.lib;%(AdditionalDependencies) + + + From 0e33e567e3196605c1d0879c5afca4838fb88aec Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 29 Mar 2018 10:54:52 -0500 Subject: [PATCH 140/264] revert --- .../mod_conference/conference_api.c | 21 +++++++------------ .../mod_conference/conference_member.c | 10 +-------- .../mod_conference/conference_video.c | 8 +++---- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index 46d1798ed9..d8341361b2 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -1418,8 +1418,13 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s float sdiv = 0; int fdiv = 0; int force_w = 0, force_h = 0; - conference_member_t *imember; - + + + if (!conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { + stream->write_function(stream, "-ERR Bandwidth control not available.\n"); + return SWITCH_STATUS_SUCCESS; + } + if (!argv[2]) { stream->write_function(stream, "-ERR Invalid input\n"); return SWITCH_STATUS_SUCCESS; @@ -1480,18 +1485,6 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s } switch_mutex_lock(conference->member_mutex); - - for (imember = conference->members; imember; imember = imember->next) { - - if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO_READY)) { - continue; - } - - switch_core_media_set_outgoing_bitrate(imember->session, SWITCH_MEDIA_TYPE_VIDEO, video_write_bandwidth); - - stream->write_function(stream, "+OK Set Bandwidth %d kps for member %s\n", video_write_bandwidth, switch_channel_get_name(imember->channel)); - } - for (i = 0; i <= conference->canvas_count; i++) { if (i > -1 && i != id - 1) { continue; diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 79ebcfcc4f..274f274c52 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -806,8 +806,6 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m conference_video_reset_member_codec_index(member); if (has_video) { - int bitrate = conference->video_codec_settings.video.bandwidth; - if ((var = switch_channel_get_variable_dup(member->channel, "video_mute_png", SWITCH_FALSE, -1))) { member->video_mute_png = switch_core_strdup(member->pool, var); member->video_mute_img = switch_img_read_png(member->video_mute_png, SWITCH_IMG_FMT_I420); @@ -834,17 +832,11 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m if (member->max_bw_out < conference->video_codec_settings.video.bandwidth) { conference_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING); - bitrate = member->max_bw_out; + switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, member->max_bw_out); } } - - if (bitrate) { - switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, bitrate); - } - } - switch_channel_set_variable_printf(channel, "conference_member_id", "%d", member->id); switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); switch_channel_set_variable_printf(channel, "conference_ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 110b5f0d54..7259fdb60f 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3783,8 +3783,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr } if (layer && use_img) { - //switch_img_copy(use_img, &layer->cur_img); - conference_video_scale_and_patch(layer, use_img, SWITCH_FALSE); + switch_img_copy(use_img, &layer->cur_img); + conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); } } @@ -3806,8 +3806,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr switch_img_free(&layer->banner_img); switch_img_free(&layer->logo_img); layer->member_id = -1; - //switch_img_copy(img, &layer->cur_img); - conference_video_scale_and_patch(layer, img, SWITCH_FALSE); + switch_img_copy(img, &layer->cur_img); + conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); } } From 443166dc2bfc73c638ac77539a865a98066cf7ac Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 23 Mar 2018 15:46:24 -0500 Subject: [PATCH 141/264] FS-11057: [mod_conference] CPU race on personal canvas #resolve --- .../mod_conference/conference_api.c | 21 ++++++++++++------- .../mod_conference/conference_member.c | 10 ++++++++- .../mod_conference/conference_video.c | 8 +++---- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index d8341361b2..46d1798ed9 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -1418,13 +1418,8 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s float sdiv = 0; int fdiv = 0; int force_w = 0, force_h = 0; - - - if (!conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { - stream->write_function(stream, "-ERR Bandwidth control not available.\n"); - return SWITCH_STATUS_SUCCESS; - } - + conference_member_t *imember; + if (!argv[2]) { stream->write_function(stream, "-ERR Invalid input\n"); return SWITCH_STATUS_SUCCESS; @@ -1485,6 +1480,18 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s } switch_mutex_lock(conference->member_mutex); + + for (imember = conference->members; imember; imember = imember->next) { + + if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO_READY)) { + continue; + } + + switch_core_media_set_outgoing_bitrate(imember->session, SWITCH_MEDIA_TYPE_VIDEO, video_write_bandwidth); + + stream->write_function(stream, "+OK Set Bandwidth %d kps for member %s\n", video_write_bandwidth, switch_channel_get_name(imember->channel)); + } + for (i = 0; i <= conference->canvas_count; i++) { if (i > -1 && i != id - 1) { continue; diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 274f274c52..79ebcfcc4f 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -806,6 +806,8 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m conference_video_reset_member_codec_index(member); if (has_video) { + int bitrate = conference->video_codec_settings.video.bandwidth; + if ((var = switch_channel_get_variable_dup(member->channel, "video_mute_png", SWITCH_FALSE, -1))) { member->video_mute_png = switch_core_strdup(member->pool, var); member->video_mute_img = switch_img_read_png(member->video_mute_png, SWITCH_IMG_FMT_I420); @@ -832,11 +834,17 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m if (member->max_bw_out < conference->video_codec_settings.video.bandwidth) { conference_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING); - switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, member->max_bw_out); + bitrate = member->max_bw_out; } } + + if (bitrate) { + switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, bitrate); + } + } + switch_channel_set_variable_printf(channel, "conference_member_id", "%d", member->id); switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); switch_channel_set_variable_printf(channel, "conference_ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 7259fdb60f..110b5f0d54 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3783,8 +3783,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr } if (layer && use_img) { - switch_img_copy(use_img, &layer->cur_img); - conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); + //switch_img_copy(use_img, &layer->cur_img); + conference_video_scale_and_patch(layer, use_img, SWITCH_FALSE); } } @@ -3806,8 +3806,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr switch_img_free(&layer->banner_img); switch_img_free(&layer->logo_img); layer->member_id = -1; - switch_img_copy(img, &layer->cur_img); - conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); + //switch_img_copy(img, &layer->cur_img); + conference_video_scale_and_patch(layer, img, SWITCH_FALSE); } } From fe9f2713b47fbe7f4ad28e3e2d7c4dff59b099b3 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 29 Mar 2018 19:53:31 +0300 Subject: [PATCH 142/264] FS-11075: [mod_amqp] Add mod_amqp to the Windows build. --- .gitignore | 3 +- Freeswitch.2015.sln | 15 ++ .../mod_amqp/mod_amqp.2015.vcxproj | 151 ++++++++++++++++++ src/mod/event_handlers/mod_amqp/mod_amqp.h | 3 + w32/Setup/Setup.2015.wixproj | 8 + w32/rabbitmq-c-version.props | 19 +++ w32/rabbitmq-c.props | 62 +++++++ 7 files changed, 260 insertions(+), 1 deletion(-) create mode 100644 src/mod/event_handlers/mod_amqp/mod_amqp.2015.vcxproj create mode 100644 w32/rabbitmq-c-version.props create mode 100644 w32/rabbitmq-c.props diff --git a/.gitignore b/.gitignore index ff9c25c0e2..b271188bbf 100644 --- a/.gitignore +++ b/.gitignore @@ -254,4 +254,5 @@ libs/ilbc-*/ libs/broadvoice-*/ libs/libcodec2-*/ libs/libsilk-*/ - +libs/rabbitmq-c-*/ +libs/rabbitmq-c-*.zip diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index e347bda003..e544a41779 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -634,6 +634,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libcodec2", "libs\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libsilk", "libs\win32\Download libsilk.2015.vcxproj", "{08782D64-E775-4E96-B707-CC633A226F32}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_amqp", "src\mod\event_handlers\mod_amqp\mod_amqp.2015.vcxproj", "{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -2906,6 +2908,18 @@ Global {08782D64-E775-4E96-B707-CC633A226F32}.Release|Win32.Build.0 = Release|Win32 {08782D64-E775-4E96-B707-CC633A226F32}.Release|x64.ActiveCfg = Release|Win32 {08782D64-E775-4E96-B707-CC633A226F32}.Release|x64.Build.0 = Release|Win32 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|Win32.ActiveCfg = Release|Win32 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|Win32.Build.0 = Release|Win32 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|x64.ActiveCfg = Release|x64 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|x64.Build.0 = Release|x64 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|Win32.ActiveCfg = Debug|Win32 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|Win32.Build.0 = Debug|Win32 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|x64.ActiveCfg = Debug|x64 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|x64.Build.0 = Debug|x64 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|Win32.ActiveCfg = Release|Win32 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|Win32.Build.0 = Release|Win32 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|x64.ActiveCfg = Release|x64 + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3136,5 +3150,6 @@ Global {CB4E68A1-8D19-4B5E-87B9-97A895E1BA17} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {9CFA562C-C611-48A7-90A2-BB031B47FE6D} = {C120A020-773F-4EA3-923F-B67AF28B750D} {08782D64-E775-4E96-B707-CC633A226F32} = {C120A020-773F-4EA3-923F-B67AF28B750D} + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0} EndGlobalSection EndGlobal diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp.2015.vcxproj b/src/mod/event_handlers/mod_amqp/mod_amqp.2015.vcxproj new file mode 100644 index 0000000000..f0ba526010 --- /dev/null +++ b/src/mod/event_handlers/mod_amqp/mod_amqp.2015.vcxproj @@ -0,0 +1,151 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_amqp + mod_amqp + Win32Proj + {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + %(AdditionalIncludeDirectories) + + + + + false + + + + + + + X64 + + + %(AdditionalIncludeDirectories) + + + + + false + + + MachineX64 + + + + + %(AdditionalIncludeDirectories) + + + + + %(AdditionalLibraryDirectories) + false + + + + + + + X64 + + + %(AdditionalIncludeDirectories) + + + + + %(AdditionalLibraryDirectories) + false + + + MachineX64 + + + + + + + + + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp.h b/src/mod/event_handlers/mod_amqp/mod_amqp.h index 145d8112ff..0282c1a34c 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp.h +++ b/src/mod/event_handlers/mod_amqp/mod_amqp.h @@ -43,7 +43,10 @@ #include #include #include + +#ifndef _MSC_VER #include +#endif #define MAX_LOG_MESSAGE_SIZE 1024 #define AMQP_MAX_HOSTS 4 diff --git a/w32/Setup/Setup.2015.wixproj b/w32/Setup/Setup.2015.wixproj index 92931d3f7d..6db627261c 100644 --- a/w32/Setup/Setup.2015.wixproj +++ b/w32/Setup/Setup.2015.wixproj @@ -543,6 +543,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_amqp + {7ac7ab4f-5ef3-40a0-ad2b-cf4d9720fac3} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_cdr_csv {44d7deaf-fda5-495e-8b9d-1439e4f4c21e} diff --git a/w32/rabbitmq-c-version.props b/w32/rabbitmq-c-version.props new file mode 100644 index 0000000000..cea5739846 --- /dev/null +++ b/w32/rabbitmq-c-version.props @@ -0,0 +1,19 @@ + + + + + + + 0.8.0 + + + true + + + + + + $(rabbitmq_cVersion) + + + diff --git a/w32/rabbitmq-c.props b/w32/rabbitmq-c.props new file mode 100644 index 0000000000..30db81dfdd --- /dev/null +++ b/w32/rabbitmq-c.props @@ -0,0 +1,62 @@ + + + + + + + + + $(BaseDir)libs\rabbitmq-c-$(rabbitmq_cVersion) + + + + + + + + + + + + + + + $(rabbitmq_c_libDir)\include;%(AdditionalIncludeDirectories) + + + $(rabbitmq_c_libDir)\binaries\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) + librabbitmq.4.lib;%(AdditionalDependencies) + + + + From cd0fdcd58b89bc48a922a668e39b2795d52b1227 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 29 Mar 2018 22:23:12 +0300 Subject: [PATCH 143/264] FS-11076: [mod_cdr_pg_csv] Add mod_cdr_pg_csv to the Windows build. --- Freeswitch.2015.sln | 15 ++ .../mod_cdr_pg_csv.2015.vcxproj | 136 ++++++++++++++++++ w32/Setup/Setup.2015.wixproj | 10 +- 3 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.2015.vcxproj diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index e544a41779..edaf4fbb07 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -636,6 +636,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libsilk", "libs\wi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_amqp", "src\mod\event_handlers\mod_amqp\mod_amqp.2015.vcxproj", "{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr_pg_csv", "src\mod\event_handlers\mod_cdr_pg_csv\mod_cdr_pg_csv.2015.vcxproj", "{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -2920,6 +2922,18 @@ Global {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|Win32.Build.0 = Release|Win32 {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|x64.ActiveCfg = Release|x64 {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|x64.Build.0 = Release|x64 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|Win32.ActiveCfg = Release|Win32 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|Win32.Build.0 = Release|Win32 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|x64.ActiveCfg = Release|x64 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|x64.Build.0 = Release|x64 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|Win32.ActiveCfg = Debug|Win32 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|Win32.Build.0 = Debug|Win32 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|x64.ActiveCfg = Debug|x64 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|x64.Build.0 = Debug|x64 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|Win32.ActiveCfg = Release|Win32 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|Win32.Build.0 = Release|Win32 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|x64.ActiveCfg = Release|x64 + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3151,5 +3165,6 @@ Global {9CFA562C-C611-48A7-90A2-BB031B47FE6D} = {C120A020-773F-4EA3-923F-B67AF28B750D} {08782D64-E775-4E96-B707-CC633A226F32} = {C120A020-773F-4EA3-923F-B67AF28B750D} {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0} + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0} EndGlobalSection EndGlobal diff --git a/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.2015.vcxproj b/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.2015.vcxproj new file mode 100644 index 0000000000..3f9242914f --- /dev/null +++ b/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.2015.vcxproj @@ -0,0 +1,136 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_cdr_pg_csv + mod_cdr_pg_csv + Win32Proj + {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + diff --git a/w32/Setup/Setup.2015.wixproj b/w32/Setup/Setup.2015.wixproj index 6db627261c..db00bf943c 100644 --- a/w32/Setup/Setup.2015.wixproj +++ b/w32/Setup/Setup.2015.wixproj @@ -4,7 +4,7 @@ true - + {47213370-b933-487d-9f45-bca26d7e2b6f} @@ -559,6 +559,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_cdr_pg_csv + {411f6d43-9f09-47d0-8b04-e1eb6b67c5bf} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_event_multicast {784113ef-44d9-4949-835d-7065d3c7ad08} From 20eb89dcb0e59c6705236cc2e4f376ecd4ef2517 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 29 Mar 2018 14:51:37 -0500 Subject: [PATCH 144/264] FS-11070: [mod_conference] Improve video bridge first two for mux mode -- add support for files playing in this mode #resolve --- .../mod_conference/conference_video.c | 32 +++++++++++++++++-- .../mod_conference/mod_conference.h | 1 + 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 110b5f0d54..bde83666c2 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3106,6 +3106,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr check_async_file = 1; file_count++; video_count++; + if (!files_playing) { + send_keyframe = 1; + } files_playing = 1; } @@ -3113,10 +3116,24 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr check_file = 1; file_count++; video_count++; + if (!files_playing) { + send_keyframe = 1; + } files_playing = 1; } switch_mutex_unlock(conference->file_mutex); + if (conference_utils_test_flag(conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { + if (conference->members_seeing_video < 3 && !file_count) { + conference->mux_paused = 1; + files_playing = 0; + switch_yield(20000); + continue; + } else { + conference->mux_paused = 0; + } + } + switch_mutex_lock(conference->member_mutex); watchers = 0; @@ -4848,7 +4865,8 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session, //char *name = switch_channel_get_name(channel); conference_member_t *member = (conference_member_t *)user_data; conference_relationship_t *rel = NULL, *last = NULL; - + int files_playing = 0; + switch_assert(member); if (switch_test_flag(frame, SFF_CNG) || !frame->packet) { @@ -4864,8 +4882,18 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session, } + switch_mutex_lock(member->conference->file_mutex); + if (member->conference->async_fnode && switch_core_file_has_video(&member->conference->async_fnode->fh, SWITCH_TRUE)) { + files_playing = 1; + } + + if (member->conference->fnode && switch_core_file_has_video(&member->conference->fnode->fh, SWITCH_TRUE)) { + files_playing = 1; + } + switch_mutex_unlock(member->conference->file_mutex); + if (conference_utils_test_flag(member->conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { - if (member->conference->members_seeing_video < 3) { + if (member->conference->members_seeing_video < 3 && !files_playing && member->conference->mux_paused) { conference_video_write_frame(member->conference, member, frame); conference_video_check_recording(member->conference, NULL, frame); switch_thread_rwlock_unlock(member->conference->rwlock); diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h index 45c09d52dc..4d5a16de83 100644 --- a/src/mod/applications/mod_conference/mod_conference.h +++ b/src/mod/applications/mod_conference/mod_conference.h @@ -758,6 +758,7 @@ typedef struct conference_obj { uint32_t moh_wait; uint32_t floor_holder_score_iir; char *default_layout_name; + int mux_paused; } conference_obj_t; /* Relationship with another member */ From d91374eddebb47a85d3fae060cc870d43c8820a1 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 30 Mar 2018 00:17:14 +0300 Subject: [PATCH 145/264] FS-11078: [Build-System] Add mod_say_(es_ar, fa, he, hr, hu, ja, pl, th) modules to the Windows build. --- Freeswitch.2015.sln | 120 ++++++++++++++++ .../mod_say_es_ar/mod_say_es_ar.2015.vcxproj | 135 ++++++++++++++++++ .../say/mod_say_fa/mod_say_fa.2015.vcxproj | 135 ++++++++++++++++++ .../say/mod_say_he/mod_say_he.2015.vcxproj | 135 ++++++++++++++++++ .../say/mod_say_hr/mod_say_hr.2015.vcxproj | 135 ++++++++++++++++++ .../say/mod_say_hu/mod_say_hu.2015.vcxproj | 135 ++++++++++++++++++ .../say/mod_say_ja/mod_say_ja.2015.vcxproj | 135 ++++++++++++++++++ .../say/mod_say_pl/mod_say_pl.2015.vcxproj | 135 ++++++++++++++++++ .../say/mod_say_th/mod_say_th.2015.vcxproj | 135 ++++++++++++++++++ w32/Setup/Setup.2015.wixproj | 64 +++++++++ 10 files changed, 1264 insertions(+) create mode 100644 src/mod/say/mod_say_es_ar/mod_say_es_ar.2015.vcxproj create mode 100644 src/mod/say/mod_say_fa/mod_say_fa.2015.vcxproj create mode 100644 src/mod/say/mod_say_he/mod_say_he.2015.vcxproj create mode 100644 src/mod/say/mod_say_hr/mod_say_hr.2015.vcxproj create mode 100644 src/mod/say/mod_say_hu/mod_say_hu.2015.vcxproj create mode 100644 src/mod/say/mod_say_ja/mod_say_ja.2015.vcxproj create mode 100644 src/mod/say/mod_say_pl/mod_say_pl.2015.vcxproj create mode 100644 src/mod/say/mod_say_th/mod_say_th.2015.vcxproj diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index edaf4fbb07..6587c691a3 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -638,6 +638,22 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_amqp", "src\mod\event_h EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr_pg_csv", "src\mod\event_handlers\mod_cdr_pg_csv\mod_cdr_pg_csv.2015.vcxproj", "{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_es_ar", "src\mod\say\mod_say_es_ar\mod_say_es_ar.2015.vcxproj", "{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_fa", "src\mod\say\mod_say_fa\mod_say_fa.2015.vcxproj", "{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_he", "src\mod\say\mod_say_he\mod_say_he.2015.vcxproj", "{A3D7C6CF-AEB1-4159-B741-160EB4B37345}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_hr", "src\mod\say\mod_say_hr\mod_say_hr.2015.vcxproj", "{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_hu", "src\mod\say\mod_say_hu\mod_say_hu.2015.vcxproj", "{AF675478-995A-4115-90C4-B2B0D6470688}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_ja", "src\mod\say\mod_say_ja\mod_say_ja.2015.vcxproj", "{07EA6E5A-D181-4ABB-BECF-67A906867D04}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_pl", "src\mod\say\mod_say_pl\mod_say_pl.2015.vcxproj", "{20B15650-F910-4211-8729-AAB0F520C805}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_th", "src\mod\say\mod_say_th\mod_say_th.2015.vcxproj", "{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -2934,6 +2950,102 @@ Global {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|Win32.Build.0 = Release|Win32 {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|x64.ActiveCfg = Release|x64 {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|x64.Build.0 = Release|x64 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|Win32.ActiveCfg = Release|Win32 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|Win32.Build.0 = Release|Win32 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|x64.ActiveCfg = Release|x64 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|x64.Build.0 = Release|x64 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|Win32.ActiveCfg = Debug|Win32 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|Win32.Build.0 = Debug|Win32 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|x64.ActiveCfg = Debug|x64 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|x64.Build.0 = Debug|x64 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|Win32.ActiveCfg = Release|Win32 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|Win32.Build.0 = Release|Win32 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|x64.ActiveCfg = Release|x64 + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|x64.Build.0 = Release|x64 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|Win32.ActiveCfg = Release|Win32 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|Win32.Build.0 = Release|Win32 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|x64.ActiveCfg = Release|x64 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|x64.Build.0 = Release|x64 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|Win32.ActiveCfg = Debug|Win32 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|Win32.Build.0 = Debug|Win32 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|x64.ActiveCfg = Debug|x64 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|x64.Build.0 = Debug|x64 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|Win32.ActiveCfg = Release|Win32 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|Win32.Build.0 = Release|Win32 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|x64.ActiveCfg = Release|x64 + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|x64.Build.0 = Release|x64 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|Win32.ActiveCfg = Release|Win32 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|Win32.Build.0 = Release|Win32 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|x64.ActiveCfg = Release|x64 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|x64.Build.0 = Release|x64 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|Win32.ActiveCfg = Debug|Win32 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|Win32.Build.0 = Debug|Win32 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|x64.ActiveCfg = Debug|x64 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|x64.Build.0 = Debug|x64 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|Win32.ActiveCfg = Release|Win32 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|Win32.Build.0 = Release|Win32 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|x64.ActiveCfg = Release|x64 + {A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|x64.Build.0 = Release|x64 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|Win32.ActiveCfg = Release|Win32 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|Win32.Build.0 = Release|Win32 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|x64.ActiveCfg = Release|x64 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|x64.Build.0 = Release|x64 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|Win32.Build.0 = Debug|Win32 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|x64.ActiveCfg = Debug|x64 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|x64.Build.0 = Debug|x64 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|Win32.ActiveCfg = Release|Win32 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|Win32.Build.0 = Release|Win32 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|x64.ActiveCfg = Release|x64 + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|x64.Build.0 = Release|x64 + {AF675478-995A-4115-90C4-B2B0D6470688}.All|Win32.ActiveCfg = Release|Win32 + {AF675478-995A-4115-90C4-B2B0D6470688}.All|Win32.Build.0 = Release|Win32 + {AF675478-995A-4115-90C4-B2B0D6470688}.All|x64.ActiveCfg = Release|x64 + {AF675478-995A-4115-90C4-B2B0D6470688}.All|x64.Build.0 = Release|x64 + {AF675478-995A-4115-90C4-B2B0D6470688}.Debug|Win32.ActiveCfg = Debug|Win32 + {AF675478-995A-4115-90C4-B2B0D6470688}.Debug|Win32.Build.0 = Debug|Win32 + {AF675478-995A-4115-90C4-B2B0D6470688}.Debug|x64.ActiveCfg = Debug|x64 + {AF675478-995A-4115-90C4-B2B0D6470688}.Debug|x64.Build.0 = Debug|x64 + {AF675478-995A-4115-90C4-B2B0D6470688}.Release|Win32.ActiveCfg = Release|Win32 + {AF675478-995A-4115-90C4-B2B0D6470688}.Release|Win32.Build.0 = Release|Win32 + {AF675478-995A-4115-90C4-B2B0D6470688}.Release|x64.ActiveCfg = Release|x64 + {AF675478-995A-4115-90C4-B2B0D6470688}.Release|x64.Build.0 = Release|x64 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|Win32.ActiveCfg = Release|Win32 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|Win32.Build.0 = Release|Win32 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|x64.ActiveCfg = Release|x64 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|x64.Build.0 = Release|x64 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|Win32.ActiveCfg = Debug|Win32 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|Win32.Build.0 = Debug|Win32 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|x64.ActiveCfg = Debug|x64 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|x64.Build.0 = Debug|x64 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|Win32.ActiveCfg = Release|Win32 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|Win32.Build.0 = Release|Win32 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|x64.ActiveCfg = Release|x64 + {07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|x64.Build.0 = Release|x64 + {20B15650-F910-4211-8729-AAB0F520C805}.All|Win32.ActiveCfg = Release|Win32 + {20B15650-F910-4211-8729-AAB0F520C805}.All|Win32.Build.0 = Release|Win32 + {20B15650-F910-4211-8729-AAB0F520C805}.All|x64.ActiveCfg = Release|x64 + {20B15650-F910-4211-8729-AAB0F520C805}.All|x64.Build.0 = Release|x64 + {20B15650-F910-4211-8729-AAB0F520C805}.Debug|Win32.ActiveCfg = Debug|Win32 + {20B15650-F910-4211-8729-AAB0F520C805}.Debug|Win32.Build.0 = Debug|Win32 + {20B15650-F910-4211-8729-AAB0F520C805}.Debug|x64.ActiveCfg = Debug|x64 + {20B15650-F910-4211-8729-AAB0F520C805}.Debug|x64.Build.0 = Debug|x64 + {20B15650-F910-4211-8729-AAB0F520C805}.Release|Win32.ActiveCfg = Release|Win32 + {20B15650-F910-4211-8729-AAB0F520C805}.Release|Win32.Build.0 = Release|Win32 + {20B15650-F910-4211-8729-AAB0F520C805}.Release|x64.ActiveCfg = Release|x64 + {20B15650-F910-4211-8729-AAB0F520C805}.Release|x64.Build.0 = Release|x64 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|Win32.ActiveCfg = Release|Win32 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|Win32.Build.0 = Release|Win32 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|x64.ActiveCfg = Release|x64 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|x64.Build.0 = Release|x64 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|Win32.ActiveCfg = Debug|Win32 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|Win32.Build.0 = Debug|Win32 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|x64.ActiveCfg = Debug|x64 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|x64.Build.0 = Debug|x64 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|Win32.ActiveCfg = Release|Win32 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|Win32.Build.0 = Release|Win32 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|x64.ActiveCfg = Release|x64 + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3166,5 +3278,13 @@ Global {08782D64-E775-4E96-B707-CC633A226F32} = {C120A020-773F-4EA3-923F-B67AF28B750D} {7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0} {411F6D43-9F09-47D0-8B04-E1EB6B67C5BF} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0} + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} + {A3D7C6CF-AEB1-4159-B741-160EB4B37345} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} + {AF675478-995A-4115-90C4-B2B0D6470688} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} + {07EA6E5A-D181-4ABB-BECF-67A906867D04} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} + {20B15650-F910-4211-8729-AAB0F520C805} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} EndGlobalSection EndGlobal diff --git a/src/mod/say/mod_say_es_ar/mod_say_es_ar.2015.vcxproj b/src/mod/say/mod_say_es_ar/mod_say_es_ar.2015.vcxproj new file mode 100644 index 0000000000..0283041c41 --- /dev/null +++ b/src/mod/say/mod_say_es_ar/mod_say_es_ar.2015.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_say_es_ar + mod_say_es_ar + Win32Proj + {CEEE31E6-8A08-42C7-BEBD-5EC12072C136} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + diff --git a/src/mod/say/mod_say_fa/mod_say_fa.2015.vcxproj b/src/mod/say/mod_say_fa/mod_say_fa.2015.vcxproj new file mode 100644 index 0000000000..87e115b18d --- /dev/null +++ b/src/mod/say/mod_say_fa/mod_say_fa.2015.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_say_fa + mod_say_fa + Win32Proj + {0E469F3A-DDD0-43BA-A94F-7D93C02219F3} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + diff --git a/src/mod/say/mod_say_he/mod_say_he.2015.vcxproj b/src/mod/say/mod_say_he/mod_say_he.2015.vcxproj new file mode 100644 index 0000000000..c2ddbf6024 --- /dev/null +++ b/src/mod/say/mod_say_he/mod_say_he.2015.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_say_he + mod_say_he + Win32Proj + {A3D7C6CF-AEB1-4159-B741-160EB4B37345} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + diff --git a/src/mod/say/mod_say_hr/mod_say_hr.2015.vcxproj b/src/mod/say/mod_say_hr/mod_say_hr.2015.vcxproj new file mode 100644 index 0000000000..5b4325c085 --- /dev/null +++ b/src/mod/say/mod_say_hr/mod_say_hr.2015.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_say_hr + mod_say_hr + Win32Proj + {DA7ADDF1-DA33-4194-83A5-B48DB714D35B} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + diff --git a/src/mod/say/mod_say_hu/mod_say_hu.2015.vcxproj b/src/mod/say/mod_say_hu/mod_say_hu.2015.vcxproj new file mode 100644 index 0000000000..839c0c9328 --- /dev/null +++ b/src/mod/say/mod_say_hu/mod_say_hu.2015.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_say_hu + mod_say_hu + Win32Proj + {AF675478-995A-4115-90C4-B2B0D6470688} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + diff --git a/src/mod/say/mod_say_ja/mod_say_ja.2015.vcxproj b/src/mod/say/mod_say_ja/mod_say_ja.2015.vcxproj new file mode 100644 index 0000000000..97416be382 --- /dev/null +++ b/src/mod/say/mod_say_ja/mod_say_ja.2015.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_say_ja + mod_say_ja + Win32Proj + {07EA6E5A-D181-4ABB-BECF-67A906867D04} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + diff --git a/src/mod/say/mod_say_pl/mod_say_pl.2015.vcxproj b/src/mod/say/mod_say_pl/mod_say_pl.2015.vcxproj new file mode 100644 index 0000000000..9b640e3857 --- /dev/null +++ b/src/mod/say/mod_say_pl/mod_say_pl.2015.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_say_pl + mod_say_pl + Win32Proj + {20B15650-F910-4211-8729-AAB0F520C805} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + diff --git a/src/mod/say/mod_say_th/mod_say_th.2015.vcxproj b/src/mod/say/mod_say_th/mod_say_th.2015.vcxproj new file mode 100644 index 0000000000..1de59de2c5 --- /dev/null +++ b/src/mod/say/mod_say_th/mod_say_th.2015.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_say_th + mod_say_th + Win32Proj + {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + diff --git a/w32/Setup/Setup.2015.wixproj b/w32/Setup/Setup.2015.wixproj index db00bf943c..40e74ae151 100644 --- a/w32/Setup/Setup.2015.wixproj +++ b/w32/Setup/Setup.2015.wixproj @@ -695,6 +695,22 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_say_es_ar + {ceee31e6-8a08-42c7-bebd-5ec12072c136} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + + + mod_say_fa + {0e469f3a-ddd0-43ba-a94f-7d93c02219f3} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_say_fr {06e3a538-ab32-44f2-b477-755ff9cb5d37} @@ -703,6 +719,30 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_say_he + {a3d7c6cf-aeb1-4159-b741-160eb4b37345} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + + + mod_say_hr + {da7addf1-da33-4194-83a5-b48db714d35b} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + + + mod_say_hu + {af675478-995a-4115-90c4-b2b0d6470688} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_say_it {6d1bec70-4dcd-4fe9-adbd-4a43a67e4d05} @@ -711,6 +751,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_say_ja + {07ea6e5a-d181-4abb-becf-67a906867d04} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_say_nl {a4b122cf-5196-476b-8c0e-d8bd59ac3c14} @@ -719,6 +767,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_say_pl + {20b15650-f910-4211-8729-aab0f520c805} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_say_pt {7c22bdff-cc09-400c-8a09-660733980028} @@ -743,6 +799,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_say_th + {c955e1a9-c12c-4bad-ac32-8d53d9268af7} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_say_zh {b6a9fb7a-1cc4-442b-812d-ec33e4e4a36e} From e7dc398a1fcf3d1c3678b523f2e24bf67bb9fa62 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 30 Mar 2018 11:15:17 -0500 Subject: [PATCH 146/264] Revert "FS-11070: [mod_conference] Improve video bridge first two for mux mode -- add support for files playing in this mode #resolve" This reverts commit 04296b5708524b462d35a94824eac9bbe103230d. --- .../mod_conference/conference_video.c | 32 ++----------------- .../mod_conference/mod_conference.h | 1 - 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index bde83666c2..110b5f0d54 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3106,9 +3106,6 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr check_async_file = 1; file_count++; video_count++; - if (!files_playing) { - send_keyframe = 1; - } files_playing = 1; } @@ -3116,24 +3113,10 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr check_file = 1; file_count++; video_count++; - if (!files_playing) { - send_keyframe = 1; - } files_playing = 1; } switch_mutex_unlock(conference->file_mutex); - if (conference_utils_test_flag(conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { - if (conference->members_seeing_video < 3 && !file_count) { - conference->mux_paused = 1; - files_playing = 0; - switch_yield(20000); - continue; - } else { - conference->mux_paused = 0; - } - } - switch_mutex_lock(conference->member_mutex); watchers = 0; @@ -4865,8 +4848,7 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session, //char *name = switch_channel_get_name(channel); conference_member_t *member = (conference_member_t *)user_data; conference_relationship_t *rel = NULL, *last = NULL; - int files_playing = 0; - + switch_assert(member); if (switch_test_flag(frame, SFF_CNG) || !frame->packet) { @@ -4882,18 +4864,8 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session, } - switch_mutex_lock(member->conference->file_mutex); - if (member->conference->async_fnode && switch_core_file_has_video(&member->conference->async_fnode->fh, SWITCH_TRUE)) { - files_playing = 1; - } - - if (member->conference->fnode && switch_core_file_has_video(&member->conference->fnode->fh, SWITCH_TRUE)) { - files_playing = 1; - } - switch_mutex_unlock(member->conference->file_mutex); - if (conference_utils_test_flag(member->conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { - if (member->conference->members_seeing_video < 3 && !files_playing && member->conference->mux_paused) { + if (member->conference->members_seeing_video < 3) { conference_video_write_frame(member->conference, member, frame); conference_video_check_recording(member->conference, NULL, frame); switch_thread_rwlock_unlock(member->conference->rwlock); diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h index 4d5a16de83..45c09d52dc 100644 --- a/src/mod/applications/mod_conference/mod_conference.h +++ b/src/mod/applications/mod_conference/mod_conference.h @@ -758,7 +758,6 @@ typedef struct conference_obj { uint32_t moh_wait; uint32_t floor_holder_score_iir; char *default_layout_name; - int mux_paused; } conference_obj_t; /* Relationship with another member */ From 9140aba9f9e9a4e64279f9a911dd034fdfe075ec Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 30 Mar 2018 11:33:23 -0500 Subject: [PATCH 147/264] Revert "FS-11057: [mod_conference] CPU race on personal canvas #resolve" This reverts commit 7acc94be97c405941481bfc8f7b8159c63372968. --- .../mod_conference/conference_api.c | 21 +++++++------------ .../mod_conference/conference_member.c | 10 +-------- .../mod_conference/conference_video.c | 8 +++---- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index 46d1798ed9..d8341361b2 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -1418,8 +1418,13 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s float sdiv = 0; int fdiv = 0; int force_w = 0, force_h = 0; - conference_member_t *imember; - + + + if (!conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { + stream->write_function(stream, "-ERR Bandwidth control not available.\n"); + return SWITCH_STATUS_SUCCESS; + } + if (!argv[2]) { stream->write_function(stream, "-ERR Invalid input\n"); return SWITCH_STATUS_SUCCESS; @@ -1480,18 +1485,6 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s } switch_mutex_lock(conference->member_mutex); - - for (imember = conference->members; imember; imember = imember->next) { - - if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO_READY)) { - continue; - } - - switch_core_media_set_outgoing_bitrate(imember->session, SWITCH_MEDIA_TYPE_VIDEO, video_write_bandwidth); - - stream->write_function(stream, "+OK Set Bandwidth %d kps for member %s\n", video_write_bandwidth, switch_channel_get_name(imember->channel)); - } - for (i = 0; i <= conference->canvas_count; i++) { if (i > -1 && i != id - 1) { continue; diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 79ebcfcc4f..274f274c52 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -806,8 +806,6 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m conference_video_reset_member_codec_index(member); if (has_video) { - int bitrate = conference->video_codec_settings.video.bandwidth; - if ((var = switch_channel_get_variable_dup(member->channel, "video_mute_png", SWITCH_FALSE, -1))) { member->video_mute_png = switch_core_strdup(member->pool, var); member->video_mute_img = switch_img_read_png(member->video_mute_png, SWITCH_IMG_FMT_I420); @@ -834,17 +832,11 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m if (member->max_bw_out < conference->video_codec_settings.video.bandwidth) { conference_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING); - bitrate = member->max_bw_out; + switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, member->max_bw_out); } } - - if (bitrate) { - switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, bitrate); - } - } - switch_channel_set_variable_printf(channel, "conference_member_id", "%d", member->id); switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); switch_channel_set_variable_printf(channel, "conference_ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 110b5f0d54..7259fdb60f 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3783,8 +3783,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr } if (layer && use_img) { - //switch_img_copy(use_img, &layer->cur_img); - conference_video_scale_and_patch(layer, use_img, SWITCH_FALSE); + switch_img_copy(use_img, &layer->cur_img); + conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); } } @@ -3806,8 +3806,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr switch_img_free(&layer->banner_img); switch_img_free(&layer->logo_img); layer->member_id = -1; - //switch_img_copy(img, &layer->cur_img); - conference_video_scale_and_patch(layer, img, SWITCH_FALSE); + switch_img_copy(img, &layer->cur_img); + conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); } } From 7ca8eec496ce617767fe52ae99fc07b4982a77eb Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 30 Mar 2018 11:36:22 -0500 Subject: [PATCH 148/264] rewind --- .../mod_conference/conference_video.c | 15 +++++++++------ .../applications/mod_conference/mod_conference.c | 8 ++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 7259fdb60f..a324cb504f 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -2696,11 +2696,15 @@ void conference_video_pop_next_image(conference_member_t *member, switch_image_t switch_image_t *img = *imgP; int size = 0; void *pop; + int half; //if (member->avatar_png_img && switch_channel_test_flag(member->channel, CF_VIDEO_READY) && conference_utils_member_test_flag(member, MFLAG_ACK_VIDEO)) { // switch_img_free(&member->avatar_png_img); //} - + if ((half = switch_queue_size(member->video_queue) / 2) < 1) { + half = 1; + } + if (switch_channel_test_flag(member->channel, CF_VIDEO_READY)) { do { pop = NULL; @@ -2712,7 +2716,7 @@ void conference_video_pop_next_image(conference_member_t *member, switch_image_t break; } size = switch_queue_size(member->video_queue); - } while(size > 1); + } while(size > half); if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && member->video_layer_id > -1 && @@ -3543,14 +3547,12 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr layout_group_t *lg = NULL; video_layout_t *vlayout = NULL; conference_member_t *omember; - + if (video_key_freq && (now - last_key_time) > video_key_freq) { send_keyframe = SWITCH_TRUE; last_key_time = now; } - switch_core_timer_next(&canvas->timer); - switch_mutex_lock(conference->member_mutex); for (imember = conference->members; imember; imember = imember->next) { @@ -3695,7 +3697,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr switch_thread_rwlock_unlock(omember->rwlock); } } - + + for (omember = conference->members; omember; omember = omember->next) { mcu_layer_t *layer = NULL; switch_image_t *use_img = NULL; diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index dc77c4312b..7ca2215e62 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -343,12 +343,8 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob members_seeing_video++; } - if (!conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { - if (imember->avatar_png_img && !switch_channel_test_flag(channel, CF_VIDEO)) { - members_with_avatar++; - } - } else { - members_with_avatar = 0; + if (imember->avatar_png_img && !switch_channel_test_flag(channel, CF_VIDEO)) { + members_with_avatar++; } if (conference_utils_member_test_flag(imember, MFLAG_NOMOH)) { From 2a6990a7e06e2899d733f06302936af8c6344886 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 30 Mar 2018 11:45:02 -0500 Subject: [PATCH 149/264] rewind --- .../mod_conference/conference_member.c | 2 +- .../mod_conference/conference_video.c | 23 ++++--------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 274f274c52..5121ee3168 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -1070,7 +1070,7 @@ void conference_member_set_floor_holder(conference_obj_t *conference, conference } if (member && conference_utils_member_test_flag(member, MFLAG_DED_VID_LAYER)) { - goto end; + return; } conference->floor_holder_score_iir = 0; diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index a324cb504f..c1bd8ff425 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -2667,25 +2667,10 @@ switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_ca void conference_video_next_canvas(conference_member_t *imember) { - int x = 0, y = 0; - - if (imember->conference->canvas_count < 2) { - return; - } - - y = imember->canvas_id; - - for (x = 0; x < imember->conference->canvas_count; x++) { - if (y == (int)imember->conference->canvas_count - 1) { - y = 0; - } else { - y++; - } - - if (imember->conference->canvases[y]->video_count < imember->conference->canvases[y]->total_layers) { - imember->canvas_id = y; - break; - } + if (imember->canvas_id == (int)imember->conference->canvas_count - 1) { + imember->canvas_id = 0; + } else { + imember->canvas_id++; } imember->layer_timeout = DEFAULT_LAYER_TIMEOUT; From 9d9af7c1532c052b61a3476f335ad1b56a600e79 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 10 Jan 2018 14:51:02 -0600 Subject: [PATCH 150/264] FS-10883: [mod_conference] Conference member can get stuck read locked #resolve --- src/mod/applications/mod_conference/conference_member.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 5121ee3168..274f274c52 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -1070,7 +1070,7 @@ void conference_member_set_floor_holder(conference_obj_t *conference, conference } if (member && conference_utils_member_test_flag(member, MFLAG_DED_VID_LAYER)) { - return; + goto end; } conference->floor_holder_score_iir = 0; From d6abe0e9ebfeddb18c557b04fd7044326816bf1b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 11 Jan 2018 15:02:09 -0600 Subject: [PATCH 151/264] tmp revert --- .../mod_conference/conference_video.c | 60 +------------------ 1 file changed, 2 insertions(+), 58 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index c1bd8ff425..2fab1a01a3 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -1168,75 +1168,19 @@ void conference_member_set_logo(conference_member_t *member, const char *path) if (params && (var = switch_event_get_header(params, "text"))) { switch_image_t *img = NULL; const char *tmp; - int x = 0, y = 0, center = 0, center_off = 0; + int x = 0, y = 0; - if ((tmp = switch_event_get_header(params, "center_offset"))) { - center_off = atoi(tmp); - if (center_off < 0) { - center_off = 0; - } - } - if ((tmp = switch_event_get_header(params, "text_x"))) { - if (!strcasecmp(tmp, "center")) { - center = 1; - } else { - x = atoi(tmp); - if (x < 0) x = 0; - } + x = atoi(tmp); } if ((tmp = switch_event_get_header(params, "text_y"))) { y = atoi(tmp); - if (y < 0) y = 0; } img = switch_img_write_text_img(member->video_logo->d_w, member->video_logo->d_h, SWITCH_FALSE, var); switch_img_fit(&img, member->video_logo->d_w, member->video_logo->d_h, SWITCH_FIT_NECESSARY); switch_img_attenuate(member->video_logo); - - if (center) { - x = center_off + ((member->video_logo->d_w - center_off - img->d_w) / 2); - } - - switch_img_patch(member->video_logo, img, x, y); - switch_img_free(&img); - } - - if (params && (var = switch_event_get_header(params, "alt_text"))) { - switch_image_t *img = NULL; - const char *tmp; - int x = 0, y = 0, center = 0, center_off = 0; - - if ((tmp = switch_event_get_header(params, "alt_center_offset"))) { - center_off = atoi(tmp); - if (center_off < 0) { - center_off = 0; - } - } - - if ((tmp = switch_event_get_header(params, "alt_text_x"))) { - if (!strcasecmp(tmp, "center")) { - center = 1; - } else { - x = atoi(tmp); - if (x < 0) x = 0; - } - } - - if ((tmp = switch_event_get_header(params, "alt_text_y"))) { - y = atoi(tmp); - if (y < 0) y = 0; - } - - img = switch_img_write_text_img(member->video_logo->d_w, member->video_logo->d_h, SWITCH_FALSE, var); - switch_img_fit(&img, member->video_logo->d_w, member->video_logo->d_h, SWITCH_FIT_NECESSARY); - switch_img_attenuate(member->video_logo); - - if (center) { - x = center_off + ((member->video_logo->d_w - center_off - img->d_w) / 2); - } - switch_img_patch(member->video_logo, img, x, y); switch_img_free(&img); } From 5199939f48fa898b7c4a03661b68b3565c4d54b9 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 11 Jan 2018 15:02:39 -0600 Subject: [PATCH 152/264] FS-10893: [mod_conference] Add more banner text params #resolve --- .../mod_conference/conference_video.c | 60 ++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 2fab1a01a3..c1bd8ff425 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -1168,19 +1168,75 @@ void conference_member_set_logo(conference_member_t *member, const char *path) if (params && (var = switch_event_get_header(params, "text"))) { switch_image_t *img = NULL; const char *tmp; - int x = 0, y = 0; + int x = 0, y = 0, center = 0, center_off = 0; + if ((tmp = switch_event_get_header(params, "center_offset"))) { + center_off = atoi(tmp); + if (center_off < 0) { + center_off = 0; + } + } + if ((tmp = switch_event_get_header(params, "text_x"))) { - x = atoi(tmp); + if (!strcasecmp(tmp, "center")) { + center = 1; + } else { + x = atoi(tmp); + if (x < 0) x = 0; + } } if ((tmp = switch_event_get_header(params, "text_y"))) { y = atoi(tmp); + if (y < 0) y = 0; } img = switch_img_write_text_img(member->video_logo->d_w, member->video_logo->d_h, SWITCH_FALSE, var); switch_img_fit(&img, member->video_logo->d_w, member->video_logo->d_h, SWITCH_FIT_NECESSARY); switch_img_attenuate(member->video_logo); + + if (center) { + x = center_off + ((member->video_logo->d_w - center_off - img->d_w) / 2); + } + + switch_img_patch(member->video_logo, img, x, y); + switch_img_free(&img); + } + + if (params && (var = switch_event_get_header(params, "alt_text"))) { + switch_image_t *img = NULL; + const char *tmp; + int x = 0, y = 0, center = 0, center_off = 0; + + if ((tmp = switch_event_get_header(params, "alt_center_offset"))) { + center_off = atoi(tmp); + if (center_off < 0) { + center_off = 0; + } + } + + if ((tmp = switch_event_get_header(params, "alt_text_x"))) { + if (!strcasecmp(tmp, "center")) { + center = 1; + } else { + x = atoi(tmp); + if (x < 0) x = 0; + } + } + + if ((tmp = switch_event_get_header(params, "alt_text_y"))) { + y = atoi(tmp); + if (y < 0) y = 0; + } + + img = switch_img_write_text_img(member->video_logo->d_w, member->video_logo->d_h, SWITCH_FALSE, var); + switch_img_fit(&img, member->video_logo->d_w, member->video_logo->d_h, SWITCH_FIT_NECESSARY); + switch_img_attenuate(member->video_logo); + + if (center) { + x = center_off + ((member->video_logo->d_w - center_off - img->d_w) / 2); + } + switch_img_patch(member->video_logo, img, x, y); switch_img_free(&img); } From ada117fb734c0c03539ea95e3aad25ebe48fecdb Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 19 Feb 2018 16:42:35 -0600 Subject: [PATCH 153/264] FS-10967: [mod_conference] chan var "conference_enter_sound" not working, only work when profile param active and being overridden #resolve --- src/mod/applications/mod_conference/conference_member.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 274f274c52..9d3c6d06c8 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -866,7 +866,7 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m conference_file_stop(conference, FILE_STOP_ASYNC); } - if (!switch_channel_test_app_flag_key("conference_silent", channel, CONF_SILENT_REQ) && !zstr(conference->enter_sound)) { + if (!switch_channel_test_app_flag_key("conference_silent", channel, CONF_SILENT_REQ)) { const char * enter_sound = switch_channel_get_variable(channel, "conference_enter_sound"); if (conference_utils_test_flag(conference, CFLAG_ENTER_SOUND) && !conference_utils_member_test_flag(member, MFLAG_SILENT)) { if (!zstr(enter_sound)) { From b04883041427316ceb5f861914e4ce53ebd3492f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 8 Mar 2018 15:23:20 -0600 Subject: [PATCH 154/264] FS-11017: [mod_conference] Add moh controls to conference #resolve --- .../mod_conference/conference_api.c | 36 +++++++++++++++++++ .../mod_conference/conference_loop.c | 6 ++++ .../mod_conference/conference_member.c | 3 +- .../mod_conference/mod_conference.c | 14 ++++++-- .../mod_conference/mod_conference.h | 6 +++- 5 files changed, 61 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index d8341361b2..0a3aacde3e 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -59,6 +59,7 @@ api_command_t conference_api_sub_commands[] = { {"position", (void_fn_t) & conference_api_sub_position, CONF_API_SUB_MEMBER_TARGET, "position", " ::"}, {"auto-3d-position", (void_fn_t) & conference_api_sub_auto_position, CONF_API_SUB_ARGS_SPLIT, "auto-3d-position", "[on|off]"}, {"play", (void_fn_t) & conference_api_sub_play, CONF_API_SUB_ARGS_SPLIT, "play", " [async| [nomux]]"}, + {"moh", (void_fn_t) & conference_api_sub_moh, CONF_API_SUB_ARGS_SPLIT, "moh", "|toggle|[on|off]"}, {"pause_play", (void_fn_t) & conference_api_sub_pause_play, CONF_API_SUB_ARGS_SPLIT, "pause", "[]"}, {"play_status", (void_fn_t) & conference_api_sub_play_status, CONF_API_SUB_ARGS_SPLIT, "play_status", "[]"}, {"file_seek", (void_fn_t) & conference_api_sub_file_seek, CONF_API_SUB_ARGS_SPLIT, "file_seek", "[+-] []"}, @@ -2471,6 +2472,41 @@ switch_status_t conference_api_sub_file_seek(conference_obj_t *conference, switc return SWITCH_STATUS_GENERR; } +switch_status_t conference_api_set_moh(conference_obj_t *conference, const char *what) +{ + + if (!strcasecmp(what, "toggle")) { + if (conference_utils_test_flag(conference, CFLAG_NO_MOH)) { + conference_utils_clear_flag(conference, CFLAG_NO_MOH); + } else { + conference_utils_set_flag(conference, CFLAG_NO_MOH); + } + } else if (!strcasecmp(what, "on")) { + conference_utils_clear_flag(conference, CFLAG_NO_MOH); + } else if (!strcasecmp(what, "off")) { + conference_utils_set_flag(conference, CFLAG_NO_MOH); + } else if (!strcasecmp(what, "reset")) { + conference->tmp_moh_sound = NULL; + } else { + conference->tmp_moh_sound = switch_core_strdup(conference->pool, what); + } + + if (conference_utils_test_flag(conference, CFLAG_NO_MOH) || conference->tmp_moh_sound) { + conference_file_stop(conference, FILE_STOP_ASYNC); + } + + return SWITCH_STATUS_SUCCESS; +} + + +switch_status_t conference_api_sub_moh(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) +{ + + conference_api_set_moh(conference, argv[2]); + + return SWITCH_STATUS_SUCCESS; +} + switch_status_t conference_api_sub_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv) { int ret_status = SWITCH_STATUS_GENERR; diff --git a/src/mod/applications/mod_conference/conference_loop.c b/src/mod/applications/mod_conference/conference_loop.c index 5c6947252b..ef39461ff7 100644 --- a/src/mod/applications/mod_conference/conference_loop.c +++ b/src/mod/applications/mod_conference/conference_loop.c @@ -45,6 +45,7 @@ struct _mapping control_mappings[] = { {"mute", conference_loop_mute_toggle}, {"mute on", conference_loop_mute_on}, {"mute off", conference_loop_mute_off}, + {"moh toggle", conference_loop_moh_toggle}, {"vmute", conference_loop_vmute_toggle}, {"vmute on", conference_loop_vmute_on}, {"vmute off", conference_loop_vmute_off}, @@ -167,6 +168,11 @@ void conference_loop_conference_video_vmute_snapoff(conference_member_t *member, conference_video_vmute_snap(member, SWITCH_TRUE); } +void conference_loop_moh_toggle(conference_member_t *member, caller_control_action_t *action) +{ + conference_api_set_moh(member->conference, "toggle"); +} + void conference_loop_vmute_toggle(conference_member_t *member, caller_control_action_t *action) { if (member == NULL) diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 9d3c6d06c8..2ee3af83b8 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -860,10 +860,11 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m } if (conference->count > 1) { - if ((conference->moh_sound && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) || + if (((conference->moh_sound || conference->tmp_moh_sound) && !conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) || (conference_utils_test_flag(conference, CFLAG_WAIT_MOD) && !switch_true(switch_channel_get_variable(channel, "conference_permanent_wait_mod_moh")))) { /* stop MoH if any */ conference_file_stop(conference, FILE_STOP_ASYNC); + conference_utils_clear_flag(conference, CFLAG_NO_MOH); } if (!switch_channel_test_app_flag_key("conference_silent", channel, CONF_SILENT_REQ)) { diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 7ca2215e62..eed989dbc5 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -372,15 +372,25 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob conference_member_set_floor_holder(conference, NULL, floor_holder); } + if (conference_utils_test_flag(conference, CFLAG_NO_MOH)) { + nomoh++; + } + if (conference->moh_wait > 0) { conference->moh_wait--; } else { + char *moh_sound = conference->tmp_moh_sound; + + if (!moh_sound) { + moh_sound = conference->moh_sound; + } + if (conference->perpetual_sound && !conference->async_fnode) { moh_status = conference_file_play(conference, conference->perpetual_sound, CONF_DEFAULT_LEADIN, NULL, 1); - } else if (conference->moh_sound && ((nomoh == 0 && conference->count == 1) + } else if (moh_sound && ((nomoh == 0 && conference->count == 1) || conference_utils_test_flag(conference, CFLAG_WAIT_MOD)) && !conference->async_fnode && !conference->fnode) { - moh_status = conference_file_play(conference, conference->moh_sound, CONF_DEFAULT_LEADIN, NULL, 1); + moh_status = conference_file_play(conference, moh_sound, CONF_DEFAULT_LEADIN, NULL, 1); } } diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h index 45c09d52dc..5b174a58ed 100644 --- a/src/mod/applications/mod_conference/mod_conference.h +++ b/src/mod/applications/mod_conference/mod_conference.h @@ -258,6 +258,7 @@ typedef enum { CFLAG_PERSONAL_CANVAS, CFLAG_REFRESH_LAYOUT, CFLAG_VIDEO_MUTE_EXIT_CANVAS, + CFLAG_NO_MOH, ///////////////////////////////// CFLAG_MAX } conference_flag_t; @@ -609,6 +610,7 @@ typedef struct conference_obj { char *alone_sound; char *perpetual_sound; char *moh_sound; + char *tmp_moh_sound; char *muted_sound; char *mute_detect_sound; char *unmuted_sound; @@ -1191,6 +1193,7 @@ switch_status_t conference_api_sub_dtmf(conference_member_t *member, switch_stre switch_status_t conference_api_sub_pause_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); switch_status_t conference_api_sub_play_status(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); switch_status_t conference_api_sub_play(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); +switch_status_t conference_api_sub_moh(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); switch_status_t conference_api_sub_say(conference_obj_t *conference, switch_stream_handle_t *stream, const char *text); switch_status_t conference_api_sub_dial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); switch_status_t conference_api_sub_bgdial(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); @@ -1249,7 +1252,7 @@ switch_status_t conference_api_sub_vid_personal(conference_obj_t *conference, sw switch_status_t conference_api_dispatch(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv, const char *cmdline, int argn); switch_status_t conference_api_sub_syntax(char **syntax); switch_status_t conference_api_main_real(const char *cmd, switch_core_session_t *session, switch_stream_handle_t *stream); - +switch_status_t conference_api_set_moh(conference_obj_t *conference, const char *what); void conference_loop_mute_on(conference_member_t *member, caller_control_action_t *action); void conference_loop_mute_toggle(conference_member_t *member, caller_control_action_t *action); @@ -1273,6 +1276,7 @@ void conference_loop_conference_video_vmute_snap(conference_member_t *member, ca void conference_loop_conference_video_vmute_snapoff(conference_member_t *member, caller_control_action_t *action); void conference_loop_vmute_toggle(conference_member_t *member, caller_control_action_t *action); void conference_loop_vmute_on(conference_member_t *member, caller_control_action_t *action); +void conference_loop_moh_toggle(conference_member_t *member, caller_control_action_t *action); void conference_loop_deafmute_toggle(conference_member_t *member, caller_control_action_t *action); void conference_loop_hangup(conference_member_t *member, caller_control_action_t *action); void conference_loop_transfer(conference_member_t *member, caller_control_action_t *action); From 054229fb68e1a7037bac7d21ae1f1037ba7600f0 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 9 Mar 2018 16:05:24 -0600 Subject: [PATCH 155/264] FS-11021: [mod_conference] Add video mirror #resolve --- src/include/switch_core_video.h | 1 + .../mod_conference/conference_api.c | 34 +++++++++----- .../mod_conference/conference_video.c | 5 ++- .../mod_conference/mod_conference.h | 1 + src/switch_core_video.c | 45 +++++++++++++++++++ 5 files changed, 73 insertions(+), 13 deletions(-) diff --git a/src/include/switch_core_video.h b/src/include/switch_core_video.h index 6d96b3b472..8998d0bac5 100644 --- a/src/include/switch_core_video.h +++ b/src/include/switch_core_video.h @@ -406,6 +406,7 @@ SWITCH_DECLARE(void) switch_png_free(switch_png_t **pngP); */ SWITCH_DECLARE(void) switch_img_overlay(switch_image_t *IMG, switch_image_t *img, int x, int y, uint8_t percent); +SWITCH_DECLARE(switch_status_t) switch_img_mirror(switch_image_t *src, switch_image_t **destP); SWITCH_DECLARE(switch_status_t) switch_img_scale(switch_image_t *src, switch_image_t **destP, int width, int height); SWITCH_DECLARE(switch_status_t) switch_img_fit(switch_image_t **srcP, int width, int height, switch_img_fit_t fit); SWITCH_DECLARE(switch_img_position_t) parse_img_position(const char *name); diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index 0a3aacde3e..2ea16ae9ef 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -747,24 +747,34 @@ switch_status_t conference_api_sub_vid_flip(conference_member_t *member, switch_ return SWITCH_STATUS_GENERR; } - if (conference_utils_member_test_flag(member, MFLAG_FLIP_VIDEO) && !arg) { + if ((conference_utils_member_test_flag(member, MFLAG_FLIP_VIDEO) || conference_utils_member_test_flag(member, MFLAG_MIRROR_VIDEO)) && !arg) { conference_utils_member_clear_flag_locked(member, MFLAG_FLIP_VIDEO); conference_utils_member_clear_flag_locked(member, MFLAG_ROTATE_VIDEO); + conference_utils_member_clear_flag_locked(member, MFLAG_MIRROR_VIDEO); } else { - conference_utils_member_set_flag_locked(member, MFLAG_FLIP_VIDEO); - if (arg) { - if (!strcasecmp(arg, "rotate")) { - conference_utils_member_set_flag_locked(member, MFLAG_ROTATE_VIDEO); - } else if (switch_is_number(arg)) { - int num = atoi(arg); - - if (num == 0 || num == 90 || num == 180 || num == 270) { - member->flip = num; - } + if (arg && !strcasecmp(arg, "mirror")) { + if (conference_utils_member_test_flag(member, MFLAG_MIRROR_VIDEO)) { + conference_utils_member_clear_flag_locked(member, MFLAG_MIRROR_VIDEO); + } else { + conference_utils_member_set_flag_locked(member, MFLAG_MIRROR_VIDEO); } } else { - member->flip = 180; + conference_utils_member_set_flag_locked(member, MFLAG_FLIP_VIDEO); + + if (arg) { + if (!strcasecmp(arg, "rotate")) { + conference_utils_member_set_flag_locked(member, MFLAG_ROTATE_VIDEO); + } else if (switch_is_number(arg)) { + int num = atoi(arg); + + if (num == 0 || num == 90 || num == 180 || num == 270) { + member->flip = num; + } + } + } else { + member->flip = 180; + } } } diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index c1bd8ff425..494c2c3624 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -4872,7 +4872,8 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session, switch_queue_size(member->video_queue) < member->conference->video_fps.fps && !member->conference->canvases[canvas_id]->playing_video_file) { - if (conference_utils_member_test_flag(member, MFLAG_FLIP_VIDEO) || conference_utils_member_test_flag(member, MFLAG_ROTATE_VIDEO)) { + if (conference_utils_member_test_flag(member, MFLAG_FLIP_VIDEO) || + conference_utils_member_test_flag(member, MFLAG_ROTATE_VIDEO) || conference_utils_member_test_flag(member, MFLAG_MIRROR_VIDEO)) { if (conference_utils_member_test_flag(member, MFLAG_ROTATE_VIDEO)) { if (member->flip_count++ > (int)(member->conference->video_fps.fps / 2)) { member->flip += 90; @@ -4883,6 +4884,8 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session, } switch_img_rotate_copy(frame->img, &img_copy, member->flip); + } else if (conference_utils_member_test_flag(member, MFLAG_MIRROR_VIDEO)) { + switch_img_mirror(frame->img, &img_copy); } else { switch_img_rotate_copy(frame->img, &img_copy, member->flip); } diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h index 5b174a58ed..a80f47a9a4 100644 --- a/src/mod/applications/mod_conference/mod_conference.h +++ b/src/mod/applications/mod_conference/mod_conference.h @@ -213,6 +213,7 @@ typedef enum { MFLAG_SILENT, MFLAG_FLIP_VIDEO, MFLAG_ROTATE_VIDEO, + MFLAG_MIRROR_VIDEO, MFLAG_INDICATE_DEAF, MFLAG_INDICATE_UNDEAF, MFLAG_TALK_DATA_EVENTS, diff --git a/src/switch_core_video.c b/src/switch_core_video.c index ca9ff3863d..69e8f25032 100644 --- a/src/switch_core_video.c +++ b/src/switch_core_video.c @@ -3191,6 +3191,51 @@ SWITCH_DECLARE(switch_status_t) switch_img_scale(switch_image_t *src, switch_ima #endif } + +SWITCH_DECLARE(switch_status_t) switch_img_mirror(switch_image_t *src, switch_image_t **destP) +{ +#ifdef SWITCH_HAVE_YUV + switch_image_t *dest = NULL; + int ret = 0; + + if (destP) { + dest = *destP; + } + + if (dest && src->fmt != dest->fmt) switch_img_free(&dest); + + if (!dest) dest = switch_img_alloc(NULL, src->fmt, src->d_w, src->d_h, 1); + + if (src->fmt == SWITCH_IMG_FMT_I420) { + ret = I420Mirror(src->planes[0], src->stride[0], + src->planes[1], src->stride[1], + src->planes[2], src->stride[2], + dest->planes[0], dest->stride[0], + dest->planes[1], dest->stride[1], + dest->planes[2], dest->stride[2], + src->d_w, src->d_h); + } else if (src->fmt == SWITCH_IMG_FMT_ARGB) { + ret = ARGBMirror(src->planes[SWITCH_PLANE_PACKED], src->d_w * 4, + dest->planes[SWITCH_PLANE_PACKED], src->d_w * 4, + src->d_w, src->d_h); + + } + + if (ret != 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Mirror Error: ret: %d\n", ret); + return SWITCH_STATUS_FALSE; + } + + if (destP) { + *destP = dest; + } + + return SWITCH_STATUS_SUCCESS; +#else + return SWITCH_STATUS_FALSE; +#endif +} + SWITCH_DECLARE(void) switch_img_find_position(switch_img_position_t pos, int sw, int sh, int iw, int ih, int *xP, int *yP) { switch(pos) { From b272c5e521a57a8c988054631fda41672a51537a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 14 Mar 2018 13:40:08 -0500 Subject: [PATCH 156/264] FS-11031: [mod_conference] refresh and keyframes sent too often in multi-canvas mode #resolve --- .../mod_conference/conference_video.c | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 494c2c3624..337ca82db9 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -2667,10 +2667,25 @@ switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_ca void conference_video_next_canvas(conference_member_t *imember) { - if (imember->canvas_id == (int)imember->conference->canvas_count - 1) { - imember->canvas_id = 0; - } else { - imember->canvas_id++; + int x = 0, y = 0; + + if (imember->conference->canvas_count < 2) { + return; + } + + y = imember->canvas_id; + + for (x = 0; x < imember->conference->canvas_count; x++) { + if (y == (int)imember->conference->canvas_count - 1) { + y = 0; + } else { + y++; + } + + if (imember->conference->canvases[y]->video_count < imember->conference->canvases[y]->total_layers) { + imember->canvas_id = y; + break; + } } imember->layer_timeout = DEFAULT_LAYER_TIMEOUT; From 2a82d401a66b91f0b4d9d905debeafc781743b65 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 14 Mar 2018 18:30:49 -0500 Subject: [PATCH 157/264] FS-11034: [mod_conference] Add border control to video #resolve --- .../mod_conference/conference_api.c | 57 +++++++++++++++++++ .../mod_conference/conference_loop.c | 6 ++ .../mod_conference/conference_video.c | 40 +++++++------ .../mod_conference/mod_conference.c | 2 +- .../mod_conference/mod_conference.h | 4 ++ 5 files changed, 92 insertions(+), 17 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index 2ea16ae9ef..b94e8ee104 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -70,6 +70,7 @@ api_command_t conference_api_sub_commands[] = { {"dtmf", (void_fn_t) & conference_api_sub_dtmf, CONF_API_SUB_MEMBER_TARGET, "dtmf", "<[member_id|all|last|non_moderator]> "}, {"kick", (void_fn_t) & conference_api_sub_kick, CONF_API_SUB_MEMBER_TARGET, "kick", "<[member_id|all|last|non_moderator]> []"}, {"vid-flip", (void_fn_t) & conference_api_sub_vid_flip, CONF_API_SUB_MEMBER_TARGET, "vid-flip", "<[member_id|all|last|non_moderator]>"}, + {"vid-border", (void_fn_t) & conference_api_sub_vid_border, CONF_API_SUB_MEMBER_TARGET, "vid-border", "<[member_id|all|last|non_moderator]>"}, {"hup", (void_fn_t) & conference_api_sub_hup, CONF_API_SUB_MEMBER_TARGET, "hup", "<[member_id|all|last|non_moderator]>"}, {"mute", (void_fn_t) & conference_api_sub_mute, CONF_API_SUB_MEMBER_TARGET, "mute", "<[member_id|all]|last|non_moderator> []"}, {"tmute", (void_fn_t) & conference_api_sub_tmute, CONF_API_SUB_MEMBER_TARGET, "tmute", "<[member_id|all]|last|non_moderator> []"}, @@ -738,6 +739,62 @@ switch_status_t conference_api_sub_kick(conference_member_t *member, switch_stre return SWITCH_STATUS_SUCCESS; } +switch_status_t conference_api_sub_vid_border(conference_member_t *member, switch_stream_handle_t *stream, void *data) +{ + char *arg = (char *) data; + mcu_layer_t *layer = NULL; + int len = 5; + + if (member == NULL) { + return SWITCH_STATUS_GENERR; + } + + if (zstr(arg)) { + if (stream) { + stream->write_function(stream, "-ERR No text supplied\n", switch_channel_get_name(member->channel)); + } + goto end; + } + + layer = conference_video_get_layer_locked(member); + + if (!layer) { + if (stream) { + stream->write_function(stream, "-ERR Channel %s is not in a video layer\n", switch_channel_get_name(member->channel)); + } + goto end; + } + + if (!strcasecmp(arg, "toggle")) { + if (member->video_manual_border) { + len = 0; + } else { + len = 5; + } + } else { + len = atoi(arg); + } + + if (len < 0 || len > 20) { + len = 0; + } + + member->video_manual_border = len; + layer->manual_border = len; + + if (stream) { + stream->write_function(stream, "+OK\n"); + } + + end: + + if (layer) { + conference_video_release_layer(&layer); + } + + return SWITCH_STATUS_SUCCESS; +} + switch_status_t conference_api_sub_vid_flip(conference_member_t *member, switch_stream_handle_t *stream, void *data) { diff --git a/src/mod/applications/mod_conference/conference_loop.c b/src/mod/applications/mod_conference/conference_loop.c index ef39461ff7..5bfc2738f9 100644 --- a/src/mod/applications/mod_conference/conference_loop.c +++ b/src/mod/applications/mod_conference/conference_loop.c @@ -46,6 +46,7 @@ struct _mapping control_mappings[] = { {"mute on", conference_loop_mute_on}, {"mute off", conference_loop_mute_off}, {"moh toggle", conference_loop_moh_toggle}, + {"border", conference_loop_border}, {"vmute", conference_loop_vmute_toggle}, {"vmute on", conference_loop_vmute_on}, {"vmute off", conference_loop_vmute_off}, @@ -173,6 +174,11 @@ void conference_loop_moh_toggle(conference_member_t *member, caller_control_acti conference_api_set_moh(member->conference, "toggle"); } +void conference_loop_border(conference_member_t *member, caller_control_action_t *action) +{ + conference_api_sub_vid_border(member, NULL, action->expanded_data); +} + void conference_loop_vmute_toggle(conference_member_t *member, caller_control_action_t *action) { if (member == NULL) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 337ca82db9..1c94c6350a 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -415,7 +415,8 @@ void conference_video_reset_layer(mcu_layer_t *layer) layer->banner_patched = 0; layer->is_avatar = 0; layer->need_patch = 0; - + layer->manual_border = 0; + conference_video_reset_layer_cam(layer); if (layer->geometry.overlap) { @@ -504,7 +505,7 @@ static void set_bounds(int *x, int *y, int img_w, int img_h, int crop_w, int cro void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, switch_bool_t freeze) { switch_image_t *IMG, *img; - int img_changed = 0, want_w = 0, want_h = 0; + int img_changed = 0, want_w = 0, want_h = 0, border = 0; switch_mutex_lock(layer->canvas->mutex); @@ -817,6 +818,12 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, y_pos += (layer->screen_h - img_h) / 2; } + if (layer->manual_border) { + border = layer->manual_border; + } if (layer->geometry.border) { + border = layer->geometry.border; + } + if (layer->img) { if (layer->banner_img) { want_h = img_h - layer->banner_img->d_h; @@ -824,8 +831,9 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, want_h = img_h; } - want_w = img_w; - + want_w = img_w - (border * 2); + want_h -= (border * 2); + if (layer->img->d_w != img_w || layer->img->d_h != img_h) { switch_img_free(&layer->img); conference_video_clear_layer(layer); @@ -840,28 +848,28 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, switch_assert(layer->img); - if (layer->geometry.border) { + if (border) { switch_img_fill(IMG, x_pos, y_pos, img_w, img_h, &layer->canvas->border_color); } - img_w -= (layer->geometry.border * 2); - img_h -= (layer->geometry.border * 2); + //img_w -= (border * 2); + //img_h -= (border * 2); //printf("SCALE %d,%d %dx%d\n", x_pos, y_pos, img_w, img_h); switch_img_scale(img, &layer->img, img_w, img_h); if (layer->logo_img) { - //int ew = layer->screen_w - (layer->geometry.border * 2), eh = layer->screen_h - (layer->banner_img ? layer->banner_img->d_h : 0) - (layer->geometry.border * 2); - int ew = layer->img->d_w, eh = layer->img->d_h; + //int ew = layer->screen_w - (border * 2), eh = layer->screen_h - (layer->banner_img ? layer->banner_img->d_h : 0) - (border * 2); + int ew = layer->img->d_w - (border * 2), eh = layer->img->d_h - (border * 2); int ex = 0, ey = 0; switch_img_fit(&layer->logo_img, ew, eh, layer->logo_fit); switch_img_find_position(layer->logo_pos, ew, eh, layer->logo_img->d_w, layer->logo_img->d_h, &ex, &ey); - switch_img_patch(layer->img, layer->logo_img, ex, ey); - //switch_img_patch(IMG, layer->logo_img, layer->x_pos + ex + layer->geometry.border, layer->y_pos + ey + layer->geometry.border); + switch_img_patch(layer->img, layer->logo_img, ex + border, ey + border); + //switch_img_patch(IMG, layer->logo_img, layer->x_pos + ex + border, layer->y_pos + ey + border); } @@ -871,8 +879,8 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, switch_img_fit(&layer->banner_img, layer->screen_w, layer->screen_h, SWITCH_FIT_SIZE); switch_img_find_position(POS_LEFT_BOT, ew, eh, layer->banner_img->d_w, layer->banner_img->d_h, &ex, &ey); - switch_img_patch(IMG, layer->banner_img, layer->x_pos + layer->geometry.border, - layer->y_pos + (layer->screen_h - layer->banner_img->d_h) + layer->geometry.border); + switch_img_patch(IMG, layer->banner_img, layer->x_pos + border, + layer->y_pos + (layer->screen_h - layer->banner_img->d_h) + border); layer->banner_patched = 1; } @@ -905,8 +913,8 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, } switch_mutex_unlock(layer->overlay_mutex); - - switch_img_patch_rect(IMG, x_pos + layer->geometry.border, y_pos + layer->geometry.border, layer->img, 0, 0, want_w, want_h); + + switch_img_patch_rect(IMG, x_pos + border, y_pos + border, layer->img, 0, 0, want_w, want_h); } @@ -1477,7 +1485,7 @@ switch_status_t conference_video_attach_video_layer(conference_member_t *member, member->layer_timeout = DEFAULT_LAYER_TIMEOUT; conference_utils_member_set_flag_locked(member, MFLAG_VIDEO_JOIN); switch_channel_set_flag(member->channel, CF_VIDEO_REFRESH_REQ); - + layer->manual_border = member->video_manual_border; canvas->send_keyframe = 30; //member->watching_canvas_id = canvas->canvas_id; diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index eed989dbc5..995f1ef307 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -3196,7 +3196,7 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co } if (!video_border_color) { - video_border_color = "#000000"; + video_border_color = "#00ff00"; } if (!video_super_canvas_bgcolor) { diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h index a80f47a9a4..c87c7adaef 100644 --- a/src/mod/applications/mod_conference/mod_conference.h +++ b/src/mod/applications/mod_conference/mod_conference.h @@ -505,6 +505,7 @@ typedef struct mcu_layer_s { mcu_layer_cam_opts_t cam_opts; switch_mutex_t *overlay_mutex; switch_core_video_filter_t overlay_filters; + int manual_border; } mcu_layer_t; typedef struct video_layout_s { @@ -904,6 +905,7 @@ struct conference_member { mcu_layer_cam_opts_t cam_opts; switch_core_video_filter_t video_filters; + int video_manual_border; }; typedef enum { @@ -1245,6 +1247,7 @@ switch_status_t conference_api_sub_canvas(conference_member_t *member, switch_st switch_status_t conference_api_sub_layer(conference_member_t *member, switch_stream_handle_t *stream, void *data); switch_status_t conference_api_sub_kick(conference_member_t *member, switch_stream_handle_t *stream, void *data); switch_status_t conference_api_sub_vid_flip(conference_member_t *member, switch_stream_handle_t *stream, void *data); +switch_status_t conference_api_sub_vid_border(conference_member_t *member, switch_stream_handle_t *stream, void *data); switch_status_t conference_api_sub_transfer(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); switch_status_t conference_api_sub_record(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); switch_status_t conference_api_sub_norecord(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv); @@ -1278,6 +1281,7 @@ void conference_loop_conference_video_vmute_snapoff(conference_member_t *member, void conference_loop_vmute_toggle(conference_member_t *member, caller_control_action_t *action); void conference_loop_vmute_on(conference_member_t *member, caller_control_action_t *action); void conference_loop_moh_toggle(conference_member_t *member, caller_control_action_t *action); +void conference_loop_border(conference_member_t *member, caller_control_action_t *action); void conference_loop_deafmute_toggle(conference_member_t *member, caller_control_action_t *action); void conference_loop_hangup(conference_member_t *member, caller_control_action_t *action); void conference_loop_transfer(conference_member_t *member, caller_control_action_t *action); From d3aee10e286b8e75cef16feaf81aee0f89010f7f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 23 Mar 2018 15:46:24 -0500 Subject: [PATCH 158/264] FS-11057: [mod_conference] CPU race on personal canvas #resolve --- .../mod_conference/conference_api.c | 21 +++++++++++------ .../mod_conference/conference_member.c | 10 +++++++- .../mod_conference/conference_video.c | 23 ++++++++----------- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c index b94e8ee104..bd379ea177 100644 --- a/src/mod/applications/mod_conference/conference_api.c +++ b/src/mod/applications/mod_conference/conference_api.c @@ -1486,13 +1486,8 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s float sdiv = 0; int fdiv = 0; int force_w = 0, force_h = 0; - - - if (!conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) { - stream->write_function(stream, "-ERR Bandwidth control not available.\n"); - return SWITCH_STATUS_SUCCESS; - } - + conference_member_t *imember; + if (!argv[2]) { stream->write_function(stream, "-ERR Invalid input\n"); return SWITCH_STATUS_SUCCESS; @@ -1553,6 +1548,18 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s } switch_mutex_lock(conference->member_mutex); + + for (imember = conference->members; imember; imember = imember->next) { + + if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO_READY)) { + continue; + } + + switch_core_media_set_outgoing_bitrate(imember->session, SWITCH_MEDIA_TYPE_VIDEO, video_write_bandwidth); + + stream->write_function(stream, "+OK Set Bandwidth %d kps for member %s\n", video_write_bandwidth, switch_channel_get_name(imember->channel)); + } + for (i = 0; i <= conference->canvas_count; i++) { if (i > -1 && i != id - 1) { continue; diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c index 2ee3af83b8..b530a6e3ff 100644 --- a/src/mod/applications/mod_conference/conference_member.c +++ b/src/mod/applications/mod_conference/conference_member.c @@ -806,6 +806,8 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m conference_video_reset_member_codec_index(member); if (has_video) { + int bitrate = conference->video_codec_settings.video.bandwidth; + if ((var = switch_channel_get_variable_dup(member->channel, "video_mute_png", SWITCH_FALSE, -1))) { member->video_mute_png = switch_core_strdup(member->pool, var); member->video_mute_img = switch_img_read_png(member->video_mute_png, SWITCH_IMG_FMT_I420); @@ -832,11 +834,17 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m if (member->max_bw_out < conference->video_codec_settings.video.bandwidth) { conference_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING); - switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, member->max_bw_out); + bitrate = member->max_bw_out; } } + + if (bitrate) { + switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, bitrate); + } + } + switch_channel_set_variable_printf(channel, "conference_member_id", "%d", member->id); switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false"); switch_channel_set_variable_printf(channel, "conference_ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false"); diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 1c94c6350a..4810f4359d 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -2704,15 +2704,11 @@ void conference_video_pop_next_image(conference_member_t *member, switch_image_t switch_image_t *img = *imgP; int size = 0; void *pop; - int half; //if (member->avatar_png_img && switch_channel_test_flag(member->channel, CF_VIDEO_READY) && conference_utils_member_test_flag(member, MFLAG_ACK_VIDEO)) { // switch_img_free(&member->avatar_png_img); //} - if ((half = switch_queue_size(member->video_queue) / 2) < 1) { - half = 1; - } - + if (switch_channel_test_flag(member->channel, CF_VIDEO_READY)) { do { pop = NULL; @@ -2724,7 +2720,7 @@ void conference_video_pop_next_image(conference_member_t *member, switch_image_t break; } size = switch_queue_size(member->video_queue); - } while(size > half); + } while(size > 1); if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && member->video_layer_id > -1 && @@ -3555,12 +3551,14 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr layout_group_t *lg = NULL; video_layout_t *vlayout = NULL; conference_member_t *omember; - + if (video_key_freq && (now - last_key_time) > video_key_freq) { send_keyframe = SWITCH_TRUE; last_key_time = now; } + switch_core_timer_next(&canvas->timer); + switch_mutex_lock(conference->member_mutex); for (imember = conference->members; imember; imember = imember->next) { @@ -3705,8 +3703,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr switch_thread_rwlock_unlock(omember->rwlock); } } - - + for (omember = conference->members; omember; omember = omember->next) { mcu_layer_t *layer = NULL; switch_image_t *use_img = NULL; @@ -3794,8 +3791,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr } if (layer && use_img) { - switch_img_copy(use_img, &layer->cur_img); - conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); + //switch_img_copy(use_img, &layer->cur_img); + conference_video_scale_and_patch(layer, use_img, SWITCH_FALSE); } } @@ -3817,8 +3814,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr switch_img_free(&layer->banner_img); switch_img_free(&layer->logo_img); layer->member_id = -1; - switch_img_copy(img, &layer->cur_img); - conference_video_scale_and_patch(layer, NULL, SWITCH_FALSE); + //switch_img_copy(img, &layer->cur_img); + conference_video_scale_and_patch(layer, img, SWITCH_FALSE); } } From d8c3b3ab664ff4df2e55a62a4b124360fcb35ce6 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 28 Mar 2018 10:10:31 -0500 Subject: [PATCH 159/264] FS-11068: [mod_conference] Avatar members not supported on personal canvas leading to miscount #resolve --- src/mod/applications/mod_conference/mod_conference.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 995f1ef307..6026d63fa8 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -343,8 +343,12 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob members_seeing_video++; } - if (imember->avatar_png_img && !switch_channel_test_flag(channel, CF_VIDEO)) { - members_with_avatar++; + if (!conference_utils_test_flag(conference, CFLAG_PERSONAL_CANVAS)) { + if (imember->avatar_png_img && !switch_channel_test_flag(channel, CF_VIDEO)) { + members_with_avatar++; + } + } else { + members_with_avatar = 0; } if (conference_utils_member_test_flag(imember, MFLAG_NOMOH)) { From f33aa1a859227d1f097d1a36c4e020285b2bdc3b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 28 Mar 2018 19:18:39 -0500 Subject: [PATCH 160/264] FS-11070: [mod_conference] Improve video bridge first two for mux mode #resolve --- .../mod_conference/conference_video.c | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 4810f4359d..39cbe2cd2f 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3107,6 +3107,14 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr canvas->send_keyframe = 1; } + + if (conference_utils_test_flag(conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { + if (conference->members_seeing_video < 3) { + switch_yield(20000); + continue; + } + } + video_count = 0; switch_mutex_lock(conference->file_mutex); @@ -3239,13 +3247,6 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr members_with_video = conference->members_with_video; members_with_avatar = conference->members_with_avatar; - if (conference_utils_test_flag(conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { - if (conference->members_seeing_video < 3) { - switch_yield(20000); - continue; - } - } - switch_mutex_lock(conference->member_mutex); for (imember = conference->members; imember; imember = imember->next) { @@ -4761,11 +4762,13 @@ void conference_video_write_frame(conference_obj_t *conference, conference_membe int x,y; switch_img_copy(vid_frame->img, &tmp_img); - switch_img_fit(&tmp_img, conference->canvases[0]->width, conference->canvases[0]->height, SWITCH_FIT_SIZE); + switch_img_fit(&tmp_img, conference->canvases[0]->width, conference->canvases[0]->height, SWITCH_FIT_SIZE_AND_SCALE); + frame_img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, conference->canvases[0]->width, conference->canvases[0]->height, 1); conference_video_reset_image(frame_img, &conference->canvases[0]->bgcolor); switch_img_find_position(POS_CENTER_MID, frame_img->d_w, frame_img->d_h, tmp_img->d_w, tmp_img->d_h, &x, &y); switch_img_patch(frame_img, tmp_img, x, y); + tmp_frame.packet = buf; tmp_frame.data = buf + 12; tmp_frame.img = frame_img; @@ -4802,14 +4805,27 @@ void conference_video_write_frame(conference_obj_t *conference, conference_membe !(imember->id == imember->conference->video_floor_holder && imember->conference->last_video_floor_holder))) { send_frame = 1; } - + if (send_frame) { if (vid_frame->img) { if (conference->canvases[0]) { + switch_frame_t *dupframe; + tmp_frame.packet = buf; - tmp_frame.packetlen = sizeof(buf) - 12; + tmp_frame.packetlen = 0; + tmp_frame.buflen = SWITCH_RTP_MAX_BUF_LEN - 12; tmp_frame.data = buf + 12; - switch_core_session_write_video_frame(imember->session, &tmp_frame, SWITCH_IO_FLAG_NONE, 0); + + if (imember->fb) { + if (switch_frame_buffer_dup(imember->fb, &tmp_frame, &dupframe) == SWITCH_STATUS_SUCCESS) { + if (switch_frame_buffer_trypush(imember->fb, dupframe) != SWITCH_STATUS_SUCCESS) { + switch_frame_buffer_free(imember->fb, &dupframe); + } + dupframe = NULL; + } + } else { + switch_core_session_write_video_frame(imember->session, &tmp_frame, SWITCH_IO_FLAG_NONE, 0); + } } else { switch_core_session_write_video_frame(imember->session, vid_frame, SWITCH_IO_FLAG_NONE, 0); } From 00f14981b400d11d9acdef249f13a8fdf272c3ee Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 29 Mar 2018 14:51:37 -0500 Subject: [PATCH 161/264] FS-11070: [mod_conference] Improve video bridge first two for mux mode -- add support for files playing in this mode #resolve --- .../mod_conference/conference_video.c | 39 ++++++++++++++----- .../mod_conference/mod_conference.h | 1 + 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index 39cbe2cd2f..81f2fbc09d 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -3108,13 +3108,6 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr } - if (conference_utils_test_flag(conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { - if (conference->members_seeing_video < 3) { - switch_yield(20000); - continue; - } - } - video_count = 0; switch_mutex_lock(conference->file_mutex); @@ -3122,6 +3115,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr check_async_file = 1; file_count++; video_count++; + if (!files_playing) { + send_keyframe = 1; + } files_playing = 1; } @@ -3129,10 +3125,24 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr check_file = 1; file_count++; video_count++; + if (!files_playing) { + send_keyframe = 1; + } files_playing = 1; } switch_mutex_unlock(conference->file_mutex); + if (conference_utils_test_flag(conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { + if (conference->members_seeing_video < 3 && !file_count) { + conference->mux_paused = 1; + files_playing = 0; + switch_yield(20000); + continue; + } else { + conference->mux_paused = 0; + } + } + switch_mutex_lock(conference->member_mutex); watchers = 0; @@ -4872,7 +4882,8 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session, //char *name = switch_channel_get_name(channel); conference_member_t *member = (conference_member_t *)user_data; conference_relationship_t *rel = NULL, *last = NULL; - + int files_playing = 0; + switch_assert(member); if (switch_test_flag(frame, SFF_CNG) || !frame->packet) { @@ -4888,8 +4899,18 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session, } + switch_mutex_lock(member->conference->file_mutex); + if (member->conference->async_fnode && switch_core_file_has_video(&member->conference->async_fnode->fh, SWITCH_TRUE)) { + files_playing = 1; + } + + if (member->conference->fnode && switch_core_file_has_video(&member->conference->fnode->fh, SWITCH_TRUE)) { + files_playing = 1; + } + switch_mutex_unlock(member->conference->file_mutex); + if (conference_utils_test_flag(member->conference, CFLAG_VIDEO_BRIDGE_FIRST_TWO)) { - if (member->conference->members_seeing_video < 3) { + if (member->conference->members_seeing_video < 3 && !files_playing && member->conference->mux_paused) { conference_video_write_frame(member->conference, member, frame); conference_video_check_recording(member->conference, NULL, frame); switch_thread_rwlock_unlock(member->conference->rwlock); diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h index c87c7adaef..c4f7b14fba 100644 --- a/src/mod/applications/mod_conference/mod_conference.h +++ b/src/mod/applications/mod_conference/mod_conference.h @@ -762,6 +762,7 @@ typedef struct conference_obj { uint32_t moh_wait; uint32_t floor_holder_score_iir; char *default_layout_name; + int mux_paused; } conference_obj_t; /* Relationship with another member */ From 50d38ba36c545b1df33196bca8d3919368362806 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 30 Mar 2018 20:04:34 +0300 Subject: [PATCH 162/264] FS-10980: [mod_lua] Update lua version to 5.3.4 and move it to pre-compiled binaries on Windows. --- Freeswitch.2015.sln | 30 --- libs/.gitignore | 2 + libs/win32/Download lua.2015.vcxproj | 81 ------- libs/win32/lua/lua.2015.vcxproj | 198 ------------------ .../languages/mod_lua/mod_lua.2015.vcxproj | 6 +- w32/lua-version.props | 2 +- w32/lua.props | 60 +++++- 7 files changed, 62 insertions(+), 317 deletions(-) delete mode 100644 libs/win32/Download lua.2015.vcxproj delete mode 100644 libs/win32/lua/lua.2015.vcxproj diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index 6587c691a3..0e3b1fb7fb 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -616,10 +616,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download tiff", "libs\win32 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_http_cache", "src\mod\applications\mod_http_cache\mod_http_cache.vcxproj", "{87933C2D-0159-46F7-B326-E1B6E982C21E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua52", "libs\win32\lua\lua.2015.vcxproj", "{4F990563-6DFB-45C3-B083-1938C6D7FFA4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download lua", "libs\win32\Download lua.2015.vcxproj", "{45CD36EE-0AF3-4387-8790-4F11E928299D}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download g722_1", "libs\win32\Download g722_1.2015.vcxproj", "{36603FE1-253F-4C2C-AAB6-12927A626135}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download iLBC", "libs\win32\Download iLBC.2015.vcxproj", "{53AADA60-DF12-46FF-BF94-566BBF849336}" @@ -2818,30 +2814,6 @@ Global {87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|Win32.Build.0 = Release|Win32 {87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|x64.ActiveCfg = Release|x64 {87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|x64.Build.0 = Release|x64 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.All|Win32.ActiveCfg = Release|Win32 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.All|Win32.Build.0 = Release|Win32 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.All|x64.ActiveCfg = Release|x64 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.All|x64.Build.0 = Release|x64 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.Debug|Win32.ActiveCfg = Debug|Win32 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.Debug|Win32.Build.0 = Debug|Win32 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.Debug|x64.ActiveCfg = Debug|x64 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.Debug|x64.Build.0 = Debug|x64 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.Release|Win32.ActiveCfg = Release|Win32 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.Release|Win32.Build.0 = Release|Win32 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.Release|x64.ActiveCfg = Release|x64 - {4F990563-6DFB-45C3-B083-1938C6D7FFA4}.Release|x64.Build.0 = Release|x64 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.All|Win32.ActiveCfg = Release|Win32 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.All|Win32.Build.0 = Release|Win32 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.All|x64.ActiveCfg = Release|Win32 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.All|x64.Build.0 = Release|Win32 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.Debug|Win32.ActiveCfg = Debug|Win32 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.Debug|Win32.Build.0 = Debug|Win32 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.Debug|x64.ActiveCfg = Debug|Win32 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.Debug|x64.Build.0 = Debug|Win32 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.Release|Win32.ActiveCfg = Release|Win32 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.Release|Win32.Build.0 = Release|Win32 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.Release|x64.ActiveCfg = Release|Win32 - {45CD36EE-0AF3-4387-8790-4F11E928299D}.Release|x64.Build.0 = Release|Win32 {36603FE1-253F-4C2C-AAB6-12927A626135}.All|Win32.ActiveCfg = Release|Win32 {36603FE1-253F-4C2C-AAB6-12927A626135}.All|Win32.Build.0 = Release|Win32 {36603FE1-253F-4C2C-AAB6-12927A626135}.All|x64.ActiveCfg = Release|Win32 @@ -3267,8 +3239,6 @@ Global {6D1BC01C-3F97-4C08-8A45-69C9B94281AA} = {C120A020-773F-4EA3-923F-B67AF28B750D} {583D8CEA-4171-4493-9025-B63265F408D8} = {C120A020-773F-4EA3-923F-B67AF28B750D} {87933C2D-0159-46F7-B326-E1B6E982C21E} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} - {4F990563-6DFB-45C3-B083-1938C6D7FFA4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} - {45CD36EE-0AF3-4387-8790-4F11E928299D} = {C120A020-773F-4EA3-923F-B67AF28B750D} {36603FE1-253F-4C2C-AAB6-12927A626135} = {C120A020-773F-4EA3-923F-B67AF28B750D} {53AADA60-DF12-46FF-BF94-566BBF849336} = {C120A020-773F-4EA3-923F-B67AF28B750D} {46502007-0D94-47AC-A640-C2B5EEA98333} = {C120A020-773F-4EA3-923F-B67AF28B750D} diff --git a/libs/.gitignore b/libs/.gitignore index 376e537633..79dbc2ca7a 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -846,3 +846,5 @@ zlib-*/ zlib-* libpq-*/ libpq-* +lua-*/ +lua-* diff --git a/libs/win32/Download lua.2015.vcxproj b/libs/win32/Download lua.2015.vcxproj deleted file mode 100644 index ff8763b7ca..0000000000 --- a/libs/win32/Download lua.2015.vcxproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - Download lua - Download lua - Win32Proj - {45CD36EE-0AF3-4387-8790-4F11E928299D} - - - - Utility - MultiByte - v140 - - - Utility - MultiByte - v140 - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(PlatformName)\lua\$(Configuration)\ - $(PlatformName)\lua\$(Configuration)\ - - - - $(IntDir)BuildLog $(ProjectName).htm - - - - - - - - - $(IntDir)BuildLog $(ProjectName).htm - - - - - - - - - Document - Downloading lua. - if not exist "$(SolutionDir)libs\lua-$(LuaVersion)" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/lua-$(LuaVersion).tar.gz "$(SolutionDir)libs" - - $(SolutionDir)libs\lua-$(LuaVersion);%(Outputs) - Downloading lua. - if not exist "$(SolutionDir)libs\lua-$(LuaVersion)" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/lua-$(LuaVersion).tar.gz "$(SolutionDir)libs" - - $(SolutionDir)libs\lua-$(LuaVersion);%(Outputs) - - - - - - \ No newline at end of file diff --git a/libs/win32/lua/lua.2015.vcxproj b/libs/win32/lua/lua.2015.vcxproj deleted file mode 100644 index ab57b9d995..0000000000 --- a/libs/win32/lua/lua.2015.vcxproj +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - lua52 - lua55 - Win32Proj - {4F990563-6DFB-45C3-B083-1938C6D7FFA4} - - - - DynamicLibrary - MultiByte - v140 - - - DynamicLibrary - MultiByte - v140 - - - DynamicLibrary - MultiByte - v140 - - - DynamicLibrary - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - - - - WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_WIN32;LUA_BUILD_AS_DLL;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - 4127; 4505;%(DisableSpecificWarnings) - false - - - true - false - MachineX86 - - - - - X64 - - - WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_WIN32;LUA_BUILD_AS_DLL;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - 4127; 4505;%(DisableSpecificWarnings) - false - - - true - false - MachineX64 - - - - - _CRT_SECURE_NO_DEPRECATE;_WIN32;LUA_BUILD_AS_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - 4127; 4505;%(DisableSpecificWarnings) - - - false - MachineX86 - - - - - X64 - - - _CRT_SECURE_NO_DEPRECATE;_WIN32;LUA_BUILD_AS_DLL;%(PreprocessorDefinitions) - MultiThreadedDLL - 4127; 4505;%(DisableSpecificWarnings) - - - false - MachineX64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {45cd36ee-0af3-4387-8790-4f11e928299d} - - - - - - \ No newline at end of file diff --git a/src/mod/languages/mod_lua/mod_lua.2015.vcxproj b/src/mod/languages/mod_lua/mod_lua.2015.vcxproj index 51f8b4d921..ba4e217fb6 100644 --- a/src/mod/languages/mod_lua/mod_lua.2015.vcxproj +++ b/src/mod/languages/mod_lua/mod_lua.2015.vcxproj @@ -25,7 +25,7 @@ Win32Proj - + DynamicLibrary MultiByte @@ -155,10 +155,6 @@ {202d7a4e-760d-4d0e-afa1-d7459ced30ff} false - - {4F990563-6DFB-45C3-B083-1938C6D7FFA4} - false - diff --git a/w32/lua-version.props b/w32/lua-version.props index cb39a1bfb7..c01dae59b0 100644 --- a/w32/lua-version.props +++ b/w32/lua-version.props @@ -2,7 +2,7 @@ - 5.2.4 + 5.3.4 true diff --git a/w32/lua.props b/w32/lua.props index 7589e56174..72dc226000 100644 --- a/w32/lua.props +++ b/w32/lua.props @@ -2,14 +2,70 @@ + $(SolutionDir)libs\lua-$(LuaVersion) - $(LuaLibDir)\src + + + + + + + + + + + + + + + + + + + - $(LuaDir);%(AdditionalIncludeDirectories) + $(LuaLibDir)\include;%(AdditionalIncludeDirectories) + + $(LuaLibDir)\binaries\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) + lua53.lib;%(AdditionalDependencies) + \ No newline at end of file From 5c04c4ad6ba9fe3ff7d6ced31c6473b9bcff3f3c Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 30 Mar 2018 23:31:35 +0300 Subject: [PATCH 163/264] FS-11082: [Build-System] Add mod_odbc_cdr to the Windows build. --- Freeswitch.2015.sln | 15 ++ .../mod_odbc_cdr/mod_odbc_cdr.2015.vcxproj | 141 ++++++++++++++++++ w32/Setup/Setup.2015.wixproj | 8 + 3 files changed, 164 insertions(+) create mode 100644 src/mod/event_handlers/mod_odbc_cdr/mod_odbc_cdr.2015.vcxproj diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index 0e3b1fb7fb..f320925699 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -650,6 +650,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_pl", "src\mod\say\m EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_th", "src\mod\say\mod_say_th\mod_say_th.2015.vcxproj", "{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_odbc_cdr", "src\mod\event_handlers\mod_odbc_cdr\mod_odbc_cdr.2015.vcxproj", "{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -3018,6 +3020,18 @@ Global {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|Win32.Build.0 = Release|Win32 {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|x64.ActiveCfg = Release|x64 {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|x64.Build.0 = Release|x64 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|Win32.ActiveCfg = Release|Win32 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|Win32.Build.0 = Release|Win32 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|x64.ActiveCfg = Release|x64 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|x64.Build.0 = Release|x64 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|Win32.ActiveCfg = Debug|Win32 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|Win32.Build.0 = Debug|Win32 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|x64.ActiveCfg = Debug|x64 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|x64.Build.0 = Debug|x64 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|Win32.ActiveCfg = Release|Win32 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|Win32.Build.0 = Release|Win32 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|x64.ActiveCfg = Release|x64 + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3256,5 +3270,6 @@ Global {07EA6E5A-D181-4ABB-BECF-67A906867D04} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} {20B15650-F910-4211-8729-AAB0F520C805} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0} EndGlobalSection EndGlobal diff --git a/src/mod/event_handlers/mod_odbc_cdr/mod_odbc_cdr.2015.vcxproj b/src/mod/event_handlers/mod_odbc_cdr/mod_odbc_cdr.2015.vcxproj new file mode 100644 index 0000000000..7c43b6a407 --- /dev/null +++ b/src/mod/event_handlers/mod_odbc_cdr/mod_odbc_cdr.2015.vcxproj @@ -0,0 +1,141 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_odbc_cdr + mod_odbc_cdr + Win32Proj + {096C9A84-55B2-4F9B-97E5-0FDF116FD25F} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + %(AdditionalIncludeDirectories) + + + + + false + + + + + + + X64 + + + %(AdditionalIncludeDirectories) + + + + + false + + + MachineX64 + + + + + %(AdditionalIncludeDirectories) + + + + + %(AdditionalLibraryDirectories) + false + + + + + + + X64 + + + %(AdditionalIncludeDirectories) + + + + + %(AdditionalLibraryDirectories) + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + \ No newline at end of file diff --git a/w32/Setup/Setup.2015.wixproj b/w32/Setup/Setup.2015.wixproj index 40e74ae151..589fe6be6c 100644 --- a/w32/Setup/Setup.2015.wixproj +++ b/w32/Setup/Setup.2015.wixproj @@ -583,6 +583,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_odbc_cdr + {096c9a84-55b2-4f9b-97e5-0fdf116fd25f} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_local_stream {2ca40887-1622-46a1-a7f9-17fd7e7e545b} From 2e7e6221f82572aa3a42f3c04b4d1757fe7711a9 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sat, 31 Mar 2018 00:04:15 +0300 Subject: [PATCH 164/264] FS-11083: [Build-System] Add mod_cdr_sqlite to the Windows build. --- Freeswitch.2015.sln | 15 ++ .../mod_cdr_sqlite.2015.vcxproj | 135 ++++++++++++++++++ w32/Setup/Setup.2015.wixproj | 8 ++ 3 files changed, 158 insertions(+) create mode 100644 src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.2015.vcxproj diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index f320925699..0199750738 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -652,6 +652,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_th", "src\mod\say\m EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_odbc_cdr", "src\mod\event_handlers\mod_odbc_cdr\mod_odbc_cdr.2015.vcxproj", "{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr_sqlite", "src\mod\event_handlers\mod_cdr_sqlite\mod_cdr_sqlite.2015.vcxproj", "{2CA661A7-01DD-4532-BF88-B6629DFB544A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -3032,6 +3034,18 @@ Global {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|Win32.Build.0 = Release|Win32 {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|x64.ActiveCfg = Release|x64 {096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|x64.Build.0 = Release|x64 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|Win32.ActiveCfg = Release|Win32 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|Win32.Build.0 = Release|Win32 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|x64.ActiveCfg = Release|x64 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|x64.Build.0 = Release|x64 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|Win32.ActiveCfg = Debug|Win32 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|Win32.Build.0 = Debug|Win32 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|x64.ActiveCfg = Debug|x64 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|x64.Build.0 = Debug|x64 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|Win32.ActiveCfg = Release|Win32 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|Win32.Build.0 = Release|Win32 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|x64.ActiveCfg = Release|x64 + {2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3271,5 +3285,6 @@ Global {20B15650-F910-4211-8729-AAB0F520C805} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} {096C9A84-55B2-4F9B-97E5-0FDF116FD25F} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0} + {2CA661A7-01DD-4532-BF88-B6629DFB544A} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0} EndGlobalSection EndGlobal diff --git a/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.2015.vcxproj b/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.2015.vcxproj new file mode 100644 index 0000000000..73a038d54f --- /dev/null +++ b/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.2015.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_cdr_sqlite + mod_cdr_sqlite + Win32Proj + {2CA661A7-01DD-4532-BF88-B6629DFB544A} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + \ No newline at end of file diff --git a/w32/Setup/Setup.2015.wixproj b/w32/Setup/Setup.2015.wixproj index 589fe6be6c..9c3a23349f 100644 --- a/w32/Setup/Setup.2015.wixproj +++ b/w32/Setup/Setup.2015.wixproj @@ -567,6 +567,14 @@ Binaries;Content;Satellites INSTALLFOLDER + + mod_cdr_sqlite + {2ca661a7-01dd-4532-bf88-b6629dfb544a} + True + True + Binaries;Content;Satellites + INSTALLFOLDER + mod_event_multicast {784113ef-44d9-4949-835d-7065d3c7ad08} From c31e7062b75bee66580fbc80bc0d6f27a992a827 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sat, 31 Mar 2018 21:59:02 +0300 Subject: [PATCH 165/264] FS-11085: [Build-System] Update curl to 7.59.0 and move to pre-compiled binaries on Windows. --- Freeswitch.2015.sln | 28 -- libs/.gitignore | 2 + libs/win32/Download CURL.2015.vcxproj | 85 ---- libs/win32/curl/ca-bundle.h | 1 - libs/win32/curl/cleancount | 1 - libs/win32/curl/curllib.2010.vcxproj.filters | 340 ------------- libs/win32/curl/curllib.2015.vcxproj | 450 ------------------ .../mod_curl/mod_curl.2015.vcxproj | 8 - .../mod_http_cache/mod_http_cache.vcxproj | 5 +- .../formats/mod_shout/mod_shout.2015.vcxproj | 12 +- src/mod/languages/mod_v8/mod_v8.2015.vcxproj | 4 - .../languages/mod_v8/mod_v8_skel.2015.vcxproj | 4 - .../mod_xml_cdr/mod_xml_cdr.2015.vcxproj | 4 - .../mod_xml_curl/mod_xml_curl.2015.vcxproj | 4 - w32/Library/FreeSwitchCore.2015.vcxproj | 15 +- w32/curl-version.props | 8 +- w32/curl.props | 61 ++- w32/openssl.props | 17 +- w32/zlib.props | 11 +- 19 files changed, 97 insertions(+), 963 deletions(-) delete mode 100644 libs/win32/Download CURL.2015.vcxproj delete mode 100644 libs/win32/curl/ca-bundle.h delete mode 100644 libs/win32/curl/cleancount delete mode 100644 libs/win32/curl/curllib.2010.vcxproj.filters delete mode 100644 libs/win32/curl/curllib.2015.vcxproj diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index 0199750738..b15ca7c65a 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -238,8 +238,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iksemel", "libs\win32\iksem EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsndfile", "libs\win32\libsndfile\libsndfile.2015.vcxproj", "{3D0370CA-BED2-4657-A475-32375CBCB6E4}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curllib", "libs\win32\curl\curllib.2015.vcxproj", "{87EE9DA4-DE1E-4448-8324-183C98DCA588}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "libs\win32\apr-util\xml.2015.vcxproj", "{155844C3-EC5F-407F-97A4-A2DDADED9B2F}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sofia", "src\mod\endpoints\mod_sofia\mod_sofia.2015.vcxproj", "{0DF3ABD0-DDC0-4265-B778-07C66780979B}" @@ -563,8 +561,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_t43_gray_code_tables", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "winFailToBan", "src\mod\languages\mod_managed\managed\examples\winFailToBan\winFailToBan.csproj", "{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download CURL", "libs\win32\Download CURL.2015.vcxproj", "{3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PCRE", "libs\win32\Download PCRE.2015.vcxproj", "{B1E7E876-347F-4DC9-9BEA-D1AFBD9DFF8A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download SPEEX", "libs\win32\Download SPEEX.2015.vcxproj", "{1BDAB935-27DC-47E3-95EA-17E024D39C31}" @@ -1003,17 +999,6 @@ Global {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.Build.0 = Release|Win32 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|x64.ActiveCfg = Release|x64 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|x64.Build.0 = Release|x64 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.All|Win32.ActiveCfg = Debug|x64 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.All|x64.ActiveCfg = Debug|x64 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.All|x64.Build.0 = Debug|x64 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.ActiveCfg = Debug|Win32 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.Build.0 = Debug|Win32 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|x64.ActiveCfg = Debug|x64 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|x64.Build.0 = Debug|x64 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.ActiveCfg = Release|Win32 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.Build.0 = Release|Win32 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|x64.ActiveCfg = Release|x64 - {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|x64.Build.0 = Release|x64 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|Win32.ActiveCfg = Debug|x64 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|x64.ActiveCfg = Debug|x64 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|x64.Build.0 = Debug|x64 @@ -2582,17 +2567,6 @@ Global {5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.Debug|x64.ActiveCfg = Debug|Any CPU {5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.Release|Win32.ActiveCfg = Release|Any CPU {5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.Release|x64.ActiveCfg = Release|Any CPU - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}.All|Win32.ActiveCfg = Release|Win32 - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}.All|Win32.Build.0 = Release|Win32 - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}.All|x64.ActiveCfg = Release|Win32 - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}.Debug|Win32.ActiveCfg = Debug|Win32 - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}.Debug|Win32.Build.0 = Debug|Win32 - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}.Debug|x64.ActiveCfg = Debug|Win32 - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}.Debug|x64.Build.0 = Debug|Win32 - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}.Release|Win32.ActiveCfg = Release|Win32 - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}.Release|Win32.Build.0 = Release|Win32 - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}.Release|x64.ActiveCfg = Release|Win32 - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5}.Release|x64.Build.0 = Release|Win32 {B1E7E876-347F-4DC9-9BEA-D1AFBD9DFF8A}.All|Win32.ActiveCfg = Release|Win32 {B1E7E876-347F-4DC9-9BEA-D1AFBD9DFF8A}.All|Win32.Build.0 = Release|Win32 {B1E7E876-347F-4DC9-9BEA-D1AFBD9DFF8A}.All|x64.ActiveCfg = Release|Win32 @@ -3099,7 +3073,6 @@ Global {F057DA7F-79E5-4B00-845C-EF446EF055E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {E727E8F6-935D-46FE-8B0E-37834748A0E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {3D0370CA-BED2-4657-A475-32375CBCB6E4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} - {87EE9DA4-DE1E-4448-8324-183C98DCA588} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {0DF3ABD0-DDC0-4265-B778-07C66780979B} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D} @@ -3245,7 +3218,6 @@ Global {64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB} = {F881ADA2-2F1A-4046-9FEB-191D9422D781} {EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0} = {0C808854-54D1-4230-BFF5-77B5FD905000} - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5} = {C120A020-773F-4EA3-923F-B67AF28B750D} {B1E7E876-347F-4DC9-9BEA-D1AFBD9DFF8A} = {C120A020-773F-4EA3-923F-B67AF28B750D} {1BDAB935-27DC-47E3-95EA-17E024D39C31} = {C120A020-773F-4EA3-923F-B67AF28B750D} {97D25665-34CD-4E0C-96E7-88F0795B8883} = {C120A020-773F-4EA3-923F-B67AF28B750D} diff --git a/libs/.gitignore b/libs/.gitignore index 79dbc2ca7a..ad93a4dbe7 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -848,3 +848,5 @@ libpq-*/ libpq-* lua-*/ lua-* +curl-*/ +curl-* diff --git a/libs/win32/Download CURL.2015.vcxproj b/libs/win32/Download CURL.2015.vcxproj deleted file mode 100644 index fcdcfeeb77..0000000000 --- a/libs/win32/Download CURL.2015.vcxproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - Download CURL - {3970BCDE-BE1A-4CF3-A65F-5264BA2E47B5} - Download CURL - Win32Proj - - - - Utility - MultiByte - v140 - - - Utility - MultiByte - v140 - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(PlatformName)\CURL\$(Configuration)\ - $(PlatformName)\CURL\$(Configuration)\ - - - - $(IntDir)BuildLog $(ProjectName).htm - - - - - - - - - $(IntDir)BuildLog $(ProjectName).htm - - - - - - - - - - - - - Document - Downloading Curl. - if not exist "$(ProjectDir)..\curl-$(cURL_Version)" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/curl-$(cURL_Version).tar.gz "$(ProjectDir).." - - $(ProjectDir)..\curl-$(cURL_Version);%(Outputs) - Downloading Curl. - if not exist "$(ProjectDir)..\curl-$(cURL_Version)" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/curl-$(cURL_Version).tar.gz "$(ProjectDir).." - - $(ProjectDir)..\curl-$(cURL_Version);%(Outputs) - - - - - - \ No newline at end of file diff --git a/libs/win32/curl/ca-bundle.h b/libs/win32/curl/ca-bundle.h deleted file mode 100644 index 12390bc7b9..0000000000 --- a/libs/win32/curl/ca-bundle.h +++ /dev/null @@ -1 +0,0 @@ -/* ca bundle path set in here*/ diff --git a/libs/win32/curl/cleancount b/libs/win32/curl/cleancount deleted file mode 100644 index 56a6051ca2..0000000000 --- a/libs/win32/curl/cleancount +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/libs/win32/curl/curllib.2010.vcxproj.filters b/libs/win32/curl/curllib.2010.vcxproj.filters deleted file mode 100644 index c5e79c5988..0000000000 --- a/libs/win32/curl/curllib.2010.vcxproj.filters +++ /dev/null @@ -1,340 +0,0 @@ - - - - - {6b959500-cd81-4335-bdf2-c430b2f07328} - - - {ee1686be-f512-40e0-8f5e-76480b95aafc} - - - {fd722a55-89b7-4153-9226-3eec445000d1} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - \ No newline at end of file diff --git a/libs/win32/curl/curllib.2015.vcxproj b/libs/win32/curl/curllib.2015.vcxproj deleted file mode 100644 index 4767430291..0000000000 --- a/libs/win32/curl/curllib.2015.vcxproj +++ /dev/null @@ -1,450 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - curllib - {87EE9DA4-DE1E-4448-8324-183C98DCA588} - curllib - - - - StaticLibrary - false - MultiByte - v140 - - - StaticLibrary - false - MultiByte - v140 - - - StaticLibrary - false - MultiByte - v140 - - - StaticLibrary - false - MultiByte - v140 - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - $(IntDir)curllib.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\curl-$(cURL_Version)\lib\;..\..\curl-$(cURL_Version)\include;.;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILDING_LIBCURL;USE_SSLEAY;USE_OPENSSL;CURL_DISABLE_LDAP;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - true - TurnOffAllWarnings - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - $(IntDir)curllib.bsc - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - X64 - $(IntDir)curllib.tlb - - - - - MaxSpeed - OnlyExplicitInline - ..\..\curl-$(cURL_Version)\lib\;..\..\curl-$(cURL_Version)\include;.;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;BUILDING_LIBCURL;USE_SSLEAY;USE_OPENSSL;CURL_DISABLE_LDAP;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - true - TurnOffAllWarnings - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - $(IntDir)curllib.bsc - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - $(IntDir)curllib.tlb - - - - - Disabled - ..\..\curl-$(cURL_Version)\lib\;..\..\curl-$(cURL_Version)\include;.;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_LIBCURL;USE_SSLEAY;USE_OPENSSL;CURL_DISABLE_LDAP;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - true - TurnOffAllWarnings - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - $(IntDir)curllib.bsc - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - X64 - $(IntDir)curllib.tlb - - - - - Disabled - ..\..\curl-$(cURL_Version)\lib\;..\..\curl-$(cURL_Version)\include;.;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;BUILDING_LIBCURL;USE_SSLEAY;USE_OPENSSL;CURL_DISABLE_LDAP;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - true - TurnOffAllWarnings - true - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - $(IntDir)curllib.bsc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {3970bcde-be1a-4cf3-a65f-5264ba2e47b5} - - - - - - \ No newline at end of file diff --git a/src/mod/applications/mod_curl/mod_curl.2015.vcxproj b/src/mod/applications/mod_curl/mod_curl.2015.vcxproj index 8665e366a6..64a32e6076 100644 --- a/src/mod/applications/mod_curl/mod_curl.2015.vcxproj +++ b/src/mod/applications/mod_curl/mod_curl.2015.vcxproj @@ -72,7 +72,6 @@ - CURL_STATICLIB;%(PreprocessorDefinitions) @@ -87,7 +86,6 @@ X64 - CURL_STATICLIB;%(PreprocessorDefinitions) @@ -100,7 +98,6 @@ - CURL_STATICLIB;%(PreprocessorDefinitions) @@ -115,7 +112,6 @@ X64 - CURL_STATICLIB;%(PreprocessorDefinitions) @@ -130,10 +126,6 @@ - - {87ee9da4-de1e-4448-8324-183c98dca588} - false - {202d7a4e-760d-4d0e-afa1-d7459ced30ff} false diff --git a/src/mod/applications/mod_http_cache/mod_http_cache.vcxproj b/src/mod/applications/mod_http_cache/mod_http_cache.vcxproj index f8e10d063e..5d0cf7e87d 100644 --- a/src/mod/applications/mod_http_cache/mod_http_cache.vcxproj +++ b/src/mod/applications/mod_http_cache/mod_http_cache.vcxproj @@ -45,7 +45,7 @@ MultiByte v140 - + @@ -133,9 +133,6 @@ - - {87ee9da4-de1e-4448-8324-183c98dca588} - {202d7a4e-760d-4d0e-afa1-d7459ced30ff} false diff --git a/src/mod/formats/mod_shout/mod_shout.2015.vcxproj b/src/mod/formats/mod_shout/mod_shout.2015.vcxproj index f4ba0a1c7b..256ef22386 100644 --- a/src/mod/formats/mod_shout/mod_shout.2015.vcxproj +++ b/src/mod/formats/mod_shout/mod_shout.2015.vcxproj @@ -75,7 +75,7 @@ Disabled ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories) - _TIMESPEC_DEFINED;CURL_STATICLIB;%(PreprocessorDefinitions) + _TIMESPEC_DEFINED;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -97,7 +97,7 @@ Disabled ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories) - CURL_STATICLIB;%(PreprocessorDefinitions) + %(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -117,7 +117,7 @@ MaxSpeed true ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories) - _TIMESPEC_DEFINED;CURL_STATICLIB;%(PreprocessorDefinitions) + _TIMESPEC_DEFINED;%(PreprocessorDefinitions) MultiThreadedDLL true Level3 @@ -141,7 +141,7 @@ MaxSpeed true ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories) - CURL_STATICLIB;%(PreprocessorDefinitions) + %(PreprocessorDefinitions) MultiThreadedDLL true Level3 @@ -166,10 +166,6 @@ - - {87ee9da4-de1e-4448-8324-183c98dca588} - false - {e316772f-5d8f-4f2a-8f71-094c3e859d34} false diff --git a/src/mod/languages/mod_v8/mod_v8.2015.vcxproj b/src/mod/languages/mod_v8/mod_v8.2015.vcxproj index df75233dc6..1c25a1b01c 100644 --- a/src/mod/languages/mod_v8/mod_v8.2015.vcxproj +++ b/src/mod/languages/mod_v8/mod_v8.2015.vcxproj @@ -210,10 +210,6 @@ {89385c74-5860-4174-9caf-a39e7c48909c} - - {87ee9da4-de1e-4448-8324-183c98dca588} - false - {202d7a4e-760d-4d0e-afa1-d7459ced30ff} false diff --git a/src/mod/languages/mod_v8/mod_v8_skel.2015.vcxproj b/src/mod/languages/mod_v8/mod_v8_skel.2015.vcxproj index 855c6b69d0..6231095ec7 100644 --- a/src/mod/languages/mod_v8/mod_v8_skel.2015.vcxproj +++ b/src/mod/languages/mod_v8/mod_v8_skel.2015.vcxproj @@ -185,10 +185,6 @@ - - {87ee9da4-de1e-4448-8324-183c98dca588} - false - {202d7a4e-760d-4d0e-afa1-d7459ced30ff} false diff --git a/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.2015.vcxproj b/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.2015.vcxproj index b3f3c81236..6f3796937a 100644 --- a/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.2015.vcxproj +++ b/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.2015.vcxproj @@ -131,10 +131,6 @@ {f6c55d93-b927-4483-bb69-15aef3dd2dff} false - - {87ee9da4-de1e-4448-8324-183c98dca588} - false - {202d7a4e-760d-4d0e-afa1-d7459ced30ff} false diff --git a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.2015.vcxproj b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.2015.vcxproj index 1ea0611f34..92cdbc5a9a 100644 --- a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.2015.vcxproj +++ b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.2015.vcxproj @@ -130,10 +130,6 @@ - - {87ee9da4-de1e-4448-8324-183c98dca588} - false - {202d7a4e-760d-4d0e-afa1-d7459ced30ff} false diff --git a/w32/Library/FreeSwitchCore.2015.vcxproj b/w32/Library/FreeSwitchCore.2015.vcxproj index 583100e5a5..dc5169ef1d 100644 --- a/w32/Library/FreeSwitchCore.2015.vcxproj +++ b/w32/Library/FreeSwitchCore.2015.vcxproj @@ -754,10 +754,14 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs 4100;%(DisableSpecificWarnings) - - - - + + + + + + + + @@ -892,9 +896,6 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs true false - - {87ee9da4-de1e-4448-8324-183c98dca588} - {8d04b550-d240-4a44-8a18-35da3f7038d9} false diff --git a/w32/curl-version.props b/w32/curl-version.props index 0e13f8d88a..0c9c4de24c 100644 --- a/w32/curl-version.props +++ b/w32/curl-version.props @@ -2,16 +2,16 @@ - 7.54.1 + 7.59.0 - true + true - - $(cURL_Version) + + $(curlVersion) \ No newline at end of file diff --git a/w32/curl.props b/w32/curl.props index e591da7aa1..791d967ada 100644 --- a/w32/curl.props +++ b/w32/curl.props @@ -1,15 +1,72 @@  - + + + + true + + + Debug + Release + + + + $(SolutionDir)libs\curl-$(curlVersion) + + + + + + + + + + + - $(SolutionDir)libs\curl-$(cURL_Version)\include;%(AdditionalIncludeDirectories) + $(curlLibDir)\include;%(AdditionalIncludeDirectories) HAVE_CURL;CURL_STATICLIB;%(PreprocessorDefinitions) + + $(curlLibDir)\binaries\$(Platform)\$(LibraryConfiguration);%(AdditionalLibraryDirectories) + curl.lib;%(AdditionalDependencies) + + \ No newline at end of file diff --git a/w32/openssl.props b/w32/openssl.props index 9d6a04239e..0d927cce7a 100644 --- a/w32/openssl.props +++ b/w32/openssl.props @@ -8,6 +8,11 @@ true + + Debug + Release + + + + + + + + + + + + + + $(fliteLibDir)\include;%(AdditionalIncludeDirectories) + + + $(fliteLibDir)\binaries\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories) + flite.lib;%(AdditionalDependencies) + + + + From d7fb26b12ad24bd769a9e64bd74da0424a03a5cd Mon Sep 17 00:00:00 2001 From: Seven Du Date: Tue, 13 Mar 2018 20:30:10 +0800 Subject: [PATCH 167/264] FS-11024 #resolve fix pdf turn pages --- src/mod/formats/mod_imagick/mod_imagick.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mod/formats/mod_imagick/mod_imagick.c b/src/mod/formats/mod_imagick/mod_imagick.c index 7680e65a13..96efd74df0 100644 --- a/src/mod/formats/mod_imagick/mod_imagick.c +++ b/src/mod/formats/mod_imagick/mod_imagick.c @@ -465,6 +465,7 @@ static switch_status_t imagick_file_seek(switch_file_handle_t *handle, unsigned context->same_page = 0; *cur_sample = page; handle->vpos = page; + handle->pos = page * (handle->samplerate / 1000); } return status; From b32db0dcfb5376fa0259a9a4a7e91339a78f6850 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Tue, 13 Mar 2018 21:35:39 +0800 Subject: [PATCH 168/264] FS-11022 #resolve ImageMagic 7 support --- configure.ac | 4 ++++ src/mod/formats/mod_imagick/Makefile.am | 5 +++++ src/mod/formats/mod_imagick/mod_imagick.c | 16 +++++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b8df6d1759..a52af80ccd 100644 --- a/configure.ac +++ b/configure.ac @@ -1389,6 +1389,10 @@ PKG_CHECK_MODULES([MAGICK], [ImageMagick >= 6.0.0],[ AM_CONDITIONAL([HAVE_MAGICK],[true])],[ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK],[false])]) +PKG_CHECK_MODULES([MAGICK7], [ImageMagick >= 7.0.0],[ + AM_CONDITIONAL([HAVE_MAGICK7],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_MAGICK7],[false])]) + PKG_CHECK_MODULES([SILK], [silk >= 1.0.8],[ AM_CONDITIONAL([HAVE_SILK],[true])],[ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_SILK],[false])]) diff --git a/src/mod/formats/mod_imagick/Makefile.am b/src/mod/formats/mod_imagick/Makefile.am index 19270b6003..3bcc4017c1 100644 --- a/src/mod/formats/mod_imagick/Makefile.am +++ b/src/mod/formats/mod_imagick/Makefile.am @@ -6,6 +6,11 @@ if HAVE_MAGICK mod_LTLIBRARIES = mod_imagick.la mod_imagick_la_SOURCES = mod_imagick.c mod_imagick_la_CFLAGS = $(AM_CFLAGS) $(MAGICK_CFLAGS) + +if HAVE_MAGICK7 +mod_imagick_la_CFLAGS += -DHAVE_MAGIC7 +endif + mod_imagick_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(MAGICK_LIBS) mod_imagick_la_LDFLAGS = -avoid-version -module -no-undefined -shared diff --git a/src/mod/formats/mod_imagick/mod_imagick.c b/src/mod/formats/mod_imagick/mod_imagick.c index 96efd74df0..d008632b74 100644 --- a/src/mod/formats/mod_imagick/mod_imagick.c +++ b/src/mod/formats/mod_imagick/mod_imagick.c @@ -49,8 +49,11 @@ #define MAGICKCORE_HDRI_ENABLE 0 #endif +#ifdef HAVE_MAGIC7 +#include +#else #include - +#endif #ifdef _MSC_VER // Disable MSVC warnings that suggest making code non-portable. @@ -101,7 +104,13 @@ static void *SWITCH_THREAD_FUNC open_pdf_thread_run(switch_thread_t *thread, voi Image *tmp_images; switch_snprintf(path, sizeof(path), "%s[%d]", context->path, pagenumber); switch_set_string(context->image_info->filename, path); + +#ifdef HAVE_MAGIC7 + if ((tmp_images = ReadImages(context->image_info, path, context->exception))) { +#else if ((tmp_images = ReadImages(context->image_info, context->exception))) { +#endif + pagenumber++; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s page %d loaded\n", context->path, pagenumber); AppendImageToList(&context->images, tmp_images); @@ -229,7 +238,12 @@ static switch_status_t imagick_file_open(switch_file_handle_t *handle, const cha switch_set_string(context->image_info->filename, path); } +#ifdef HAVE_MAGIC7 + context->images = ReadImages(context->image_info, context->lazy ? range_path : path, context->exception); +#else context->images = ReadImages(context->image_info, context->exception); +#endif + if (context->exception->severity != UndefinedException) { CatchException(context->exception); } From 6ced48476c927fd00d2d1d33a20fe8f676ee3c19 Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 29 Mar 2018 15:27:20 -0500 Subject: [PATCH 169/264] FS-11077: [mod_enum] Memory Leak in mod_enum #resolve --- src/mod/applications/mod_enum/mod_enum.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_enum/mod_enum.c b/src/mod/applications/mod_enum/mod_enum.c index a00095e531..493e2c176a 100644 --- a/src/mod/applications/mod_enum/mod_enum.c +++ b/src/mod/applications/mod_enum/mod_enum.c @@ -866,7 +866,8 @@ SWITCH_STANDARD_API(enum_function) } else { stream->write_function(stream, "Invalid Input!\n"); } - + switch_safe_free(mydata); + return SWITCH_STATUS_SUCCESS; } From 8084162d4d6809ca94a0114c3acac0ad4f5499f7 Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 30 Mar 2018 14:07:36 -0500 Subject: [PATCH 170/264] FS-11080: [freeswitch-core] Auto sync of jb can fail on extreme loss #resolve --- src/switch_core_media.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 84405c4e80..6d4b780df3 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -2513,10 +2513,16 @@ static void check_jb(switch_core_session_t *session, const char *input, int32_t maxlen = (a_engine->read_codec.implementation->microseconds_per_packet / 1000) * abs(maxlen); } + + if (jb_msec < 10 || jb_msec > 10000) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, - "Invalid Jitterbuffer spec [%d] must be between 10 and 10000\n", jb_msec); - } else { + //switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, + //"Invalid Jitterbuffer spec [%d] must be between 10 and 10000\n", jb_msec); + jb_msec = (a_engine->read_codec.implementation->microseconds_per_packet / 1000) * 1; + maxlen = jb_msec * 100; + } + + if (jb_msec && maxlen) { int qlen, maxqlen = 50; qlen = jb_msec / (a_engine->read_impl.microseconds_per_packet / 1000); From bea634679cd78086cce036ed034fccd7b37303fa Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 30 Mar 2018 14:10:28 -0500 Subject: [PATCH 171/264] FS-11081: [mod_video_filter] Teleportation #resolve --- .../mod_video_filter/mod_video_filter.c | 132 +++++++++++++++++- 1 file changed, 128 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_video_filter/mod_video_filter.c b/src/mod/applications/mod_video_filter/mod_video_filter.c index 1b831b6ed0..8645fdb0d0 100644 --- a/src/mod/applications/mod_video_filter/mod_video_filter.c +++ b/src/mod/applications/mod_video_filter/mod_video_filter.c @@ -38,7 +38,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_video_filter_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_video_filter_shutdown); SWITCH_MODULE_DEFINITION(mod_video_filter, mod_video_filter_load, mod_video_filter_shutdown, NULL); - typedef struct chromakey_context_s { int threshold; switch_image_t *bgimg; @@ -60,8 +59,18 @@ typedef struct chromakey_context_s { int mod; switch_chromakey_t *ck; switch_core_video_filter_t video_filters; + switch_queue_t *child_queue; + char *child_uuid; + switch_media_bug_t *child_bug; } chromakey_context_t; +typedef struct chromakey_child_context_s { + chromakey_context_t *parent; + char *master_uuid; +} chromakey_child_context_t; + + + static void init_context(chromakey_context_t *context) { switch_color_set_rgb(&context->bgcolor, "#000000"); @@ -79,6 +88,11 @@ static void uninit_context(chromakey_context_t *context) switch_img_free(&context->imgbg); switch_img_free(&context->imgfg); + if (context->child_bug) { + switch_core_media_bug_close(&context->child_bug, SWITCH_TRUE); + context->child_uuid = NULL; + } + if (switch_test_flag(&context->vfh, SWITCH_FILE_OPEN)) { switch_core_file_close(&context->vfh); memset(&context->vfh, 0, sizeof(context->vfh)); @@ -94,6 +108,61 @@ static void uninit_context(chromakey_context_t *context) switch_chromakey_destroy(&context->ck); } +static int flush_video_queue(switch_queue_t *q, int min) +{ + void *pop; + + if (switch_queue_size(q) > min) { + while (switch_queue_trypop(q, &pop) == SWITCH_STATUS_SUCCESS) { + switch_image_t *img = (switch_image_t *) pop; + switch_img_free(&img); + if (min && switch_queue_size(q) <= min) { + break; + } + } + } + + return switch_queue_size(q); +} + +static switch_bool_t chromakey_child_bug_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type) +{ + chromakey_child_context_t *child_context = (chromakey_child_context_t *)user_data; + + switch (type) { + case SWITCH_ABC_TYPE_INIT: + { + } + break; + case SWITCH_ABC_TYPE_CLOSE: + { + } + break; + case SWITCH_ABC_TYPE_READ_VIDEO_PING: + case SWITCH_ABC_TYPE_VIDEO_PATCH: + { + switch_image_t *img = NULL; + switch_frame_t *frame = switch_core_media_bug_get_video_ping_frame(bug); + + if (frame && frame->img) { + switch_img_copy(frame->img, &img); + if (switch_queue_trypush(child_context->parent->child_queue, img) != SWITCH_STATUS_SUCCESS) { + switch_img_free(&img); + } + img = NULL; + } + } + break; + default: + break; + } + + return SWITCH_TRUE; +} + + + + static void parse_params(chromakey_context_t *context, int start, int argc, char **argv, const char **function, switch_media_bug_flag_t *flags) { int n = argc - start; @@ -151,6 +220,12 @@ static void parse_params(chromakey_context_t *context, int start, int argc, char if (n > 2 && argv[i]) { + if (context->child_bug) { + printf("WTF CLOSE IT\n"); + switch_core_media_bug_close(&context->child_bug, SWITCH_TRUE); + context->child_uuid = NULL; + } + if (switch_test_flag(&context->vfh, SWITCH_FILE_OPEN)) { switch_core_file_close(&context->vfh); memset(&context->vfh, 0, sizeof(context->vfh)); @@ -175,6 +250,37 @@ static void parse_params(chromakey_context_t *context, int start, int argc, char if (argv[i][0] == '#') { // bgcolor switch_color_set_rgb(&context->bgcolor, argv[i]); + } else if (!strncasecmp(argv[i], "uuid:", 5)) { + char *uuid = argv[i] + 5; + switch_core_session_t *bsession; + switch_status_t status; + + + if (!zstr(uuid) && (bsession = switch_core_session_locate(uuid))) { + switch_channel_t *channel = switch_core_session_get_channel(bsession); + chromakey_child_context_t *child_context; + switch_media_bug_flag_t flags = SMBF_READ_VIDEO_PING|SMBF_READ_VIDEO_PATCH; + + switch_channel_wait_for_flag(channel, CF_VIDEO_READY, SWITCH_TRUE, 10000, NULL); + + child_context = (chromakey_child_context_t *) switch_core_session_alloc(bsession, sizeof(*child_context)); + child_context->master_uuid = switch_core_session_strdup(bsession, switch_core_session_get_uuid(context->session)); + + + if ((status = switch_core_media_bug_add(bsession, "chromakey_child", NULL, + chromakey_child_bug_callback, child_context, 0, flags, + &context->child_bug)) == SWITCH_STATUS_SUCCESS) { + + switch_queue_create(&context->child_queue, 200, switch_core_session_get_pool(context->session)); + child_context->parent = context; + context->child_uuid = switch_core_session_strdup(context->session, switch_core_session_get_uuid(bsession)); + } else { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(bsession), SWITCH_LOG_ERROR, "Failure! %d\n", status); + } + + switch_core_session_rwunlock(bsession); + } + } else if (switch_stristr(".png", argv[i])) { if (!(context->bgimg_orig = switch_img_read_png(argv[i], SWITCH_IMG_FMT_ARGB))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening png\n"); @@ -382,7 +488,7 @@ static switch_status_t video_thread_callback(switch_core_session_t *session, swi } } - } else if (switch_test_flag(&context->vfh, SWITCH_FILE_OPEN)) { + } else if (switch_test_flag(&context->vfh, SWITCH_FILE_OPEN) || !zstr(context->child_uuid)) { switch_image_t *use_img = NULL; switch_frame_t file_frame = { 0 }; switch_status_t status; @@ -390,8 +496,26 @@ static switch_status_t video_thread_callback(switch_core_session_t *session, swi context->vfh.mm.scale_w = frame->img->d_w; context->vfh.mm.scale_h = frame->img->d_h; - status = switch_core_file_read_video(&context->vfh, &file_frame, SVR_FLUSH); - switch_core_file_command(&context->vfh, SCFC_FLUSH_AUDIO); + if (!zstr(context->child_uuid)) { + void *pop = NULL; + + flush_video_queue(context->child_queue, 1); + + if ((status = switch_queue_trypop(context->child_queue, &pop)) == SWITCH_STATUS_SUCCESS && pop) { + file_frame.img = (switch_image_t *) pop; + + if (file_frame.img->d_w != context->vfh.mm.scale_w || file_frame.img->d_h != context->vfh.mm.scale_h) { + switch_img_fit(&file_frame.img, context->vfh.mm.scale_w, context->vfh.mm.scale_h, SWITCH_FIT_SIZE_AND_SCALE); + if (file_frame.img->d_w != context->vfh.mm.scale_w || file_frame.img->d_h != context->vfh.mm.scale_h) { + switch_img_free(&file_frame.img); + } + } + } + + } else { + status = switch_core_file_read_video(&context->vfh, &file_frame, SVR_FLUSH); + switch_core_file_command(&context->vfh, SCFC_FLUSH_AUDIO); + } if (file_frame.img) { switch_img_free(&context->bgimg_scaled); From 99d2e5e2437147c15a29b0ae69d284921c1ad548 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Wed, 7 Mar 2018 22:28:30 +0800 Subject: [PATCH 172/264] FS-11014 [core] add vad to core --- Makefile.am | 10 +- configure.ac | 4 + src/include/switch.h | 1 + src/include/switch_types.h | 8 + src/include/switch_vad.h | 66 ++++++ .../applications/mod_dptools/mod_dptools.c | 68 ++++++ src/switch_vad.c | 219 ++++++++++++++++++ 7 files changed, 374 insertions(+), 2 deletions(-) create mode 100644 src/include/switch_vad.h create mode 100644 src/switch_vad.c diff --git a/Makefile.am b/Makefile.am index 53bd7c66aa..2789737efd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -179,6 +179,10 @@ if HAVE_GUMBO CORE_CFLAGS += -DSWITCH_HAVE_GUMBO $(LIBGUMBO_CFLAGS) endif +if HAVE_FVAD +CORE_CFLAGS += -DSWITCH_HAVE_FVAD $(LIBFVAD_CFLAGS) +endif + ## ## libfreeswitch ## @@ -241,9 +245,9 @@ CORE_LIBS+=libfreeswitch_libyuv.la endif lib_LTLIBRARIES = libfreeswitch.la -libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(AM_CFLAGS) +libfreeswitch_la_CFLAGS = $(CORE_CFLAGS) $(SQLITE_CFLAGS) $(GUMBO_CFLAGS) $(FVAD_CFLAGS) $(FREETYPE_CFLAGS) $(CURL_CFLAGS) $(PCRE_CFLAGS) $(SPEEX_CFLAGS) $(LIBEDIT_CFLAGS) $(openssl_CFLAGS) $(AM_CFLAGS) libfreeswitch_la_LDFLAGS = -version-info 1:0:0 $(AM_LDFLAGS) $(PLATFORM_CORE_LDFLAGS) -no-undefined -libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) +libfreeswitch_la_LIBADD = $(CORE_LIBS) $(APR_LIBS) $(SQLITE_LIBS) $(GUMBO_LIBS) $(FVAD_LIBS) $(FREETYPE_LIBS) $(CURL_LIBS) $(PCRE_LIBS) $(SPEEX_LIBS) $(LIBEDIT_LIBS) $(openssl_LIBS) $(PLATFORM_CORE_LIBS) libfreeswitch_la_DEPENDENCIES = $(BUILT_SOURCES) if HAVE_PNG @@ -312,6 +316,7 @@ library_include_HEADERS = \ src/include/switch_utf8.h \ src/include/switch_msrp.h \ src/include/switch_vpx.h \ + src/include/switch_vad.h \ libs/libteletone/src/libteletone_detect.h \ libs/libteletone/src/libteletone_generate.h \ libs/libteletone/src/libteletone.h \ @@ -395,6 +400,7 @@ libfreeswitch_la_SOURCES = \ src/switch_hashtable.c\ src/switch_utf8.c \ src/switch_msrp.c \ + src/switch_vad.c \ src/switch_vpx.c \ libs/libtpl-1.5/src/tpl.c \ libs/libteletone/src/libteletone_detect.c \ diff --git a/configure.ac b/configure.ac index a52af80ccd..5345b354c1 100644 --- a/configure.ac +++ b/configure.ac @@ -1310,6 +1310,10 @@ PKG_CHECK_MODULES([GUMBO], [gumbo >= 0.10.1],[ AM_CONDITIONAL([HAVE_GUMBO],[true])],[ AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_GUMBO],[false])]) +PKG_CHECK_MODULES([FVAD], [libfvad >= 1.0],[ + AM_CONDITIONAL([HAVE_FVAD],[true])],[ + AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FVAD],[false])]) + PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.6.20]) PKG_CHECK_MODULES([CURL], [libcurl >= 7.19]) PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8]) diff --git a/src/include/switch.h b/src/include/switch.h index 0b1ff4c8e9..3498aecc19 100644 --- a/src/include/switch.h +++ b/src/include/switch.h @@ -145,6 +145,7 @@ #include "switch_core_video.h" #include "switch_jitterbuffer.h" #include "switch_estimators.h" +#include "switch_vad.h" #include diff --git a/src/include/switch_types.h b/src/include/switch_types.h index e479e30bbd..a85d7be59a 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -622,6 +622,14 @@ typedef enum { } switch_vad_flag_enum_t; typedef uint32_t switch_vad_flag_t; +typedef enum { + SWITCH_VAD_STATE_NONE, + SWITCH_VAD_STATE_START_TALKING, + SWITCH_VAD_STATE_TALKING, + SWITCH_VAD_STATE_STOP_TALKING, + SWITCH_VAD_STATE_ERROR +} switch_vad_state_t; +typedef struct switch_vad_s switch_vad_t; typedef struct error_period { int64_t start; diff --git a/src/include/switch_vad.h b/src/include/switch_vad.h new file mode 100644 index 0000000000..8cc6c63f05 --- /dev/null +++ b/src/include/switch_vad.h @@ -0,0 +1,66 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2018, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Seven Du + * + * + * switch_vad.h VAD code with optional libfvad + * + */ +/*! + \defgroup vad1 VAD code with optional libfvad + \ingroup core1 + \{ +*/ +#ifndef FREESWITCH_VAD_H +#define FREESWITCH_VAD_H + +SWITCH_BEGIN_EXTERN_C + +SWITCH_DECLARE(switch_vad_t *) switch_vad_init(int sample_rate, int channels); + +/* + * Valid modes are -1 ("disable fvad, using native"), 0 ("quality"), 1 ("low bitrate"), 2 ("aggressive"), and 3 * ("very aggressive"). + * The default mode is -1. +*/ + +SWITCH_DECLARE(int) switch_vad_set_mode(switch_vad_t *vad, int mode); +SWITCH_DECLARE(void) switch_vad_set_param(switch_vad_t *vad, const char *key, int val); +SWITCH_DECLARE(switch_vad_state_t) switch_vad_process(switch_vad_t *vad, int16_t *data, unsigned int samples); +SWITCH_DECLARE(void) switch_vad_reset(switch_vad_t *vad); +SWITCH_DECLARE(void) switch_vad_destroy(switch_vad_t **vad); + +SWITCH_END_EXTERN_C +#endif +/* For Emacs: + * Local Variables: + * mode:c + * indent-tabs-mode:t + * tab-width:4 + * c-basic-offset:4 + * End: + * For VIM: + * vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet: + */ diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 812e56a3f1..4cc8dfab64 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -6128,6 +6128,73 @@ SWITCH_STANDARD_APP(deduplicate_dtmf_app_function) } } +SWITCH_STANDARD_APP(vad_test_function) +{ + switch_channel_t *channel = switch_core_session_get_channel(session); + switch_codec_implementation_t imp = { 0 }; + switch_vad_t *vad; + switch_frame_t *frame = { 0 }; + switch_vad_state_t vad_state; + int mode = -1; + const char *var = NULL; + int tmp; + + if (!zstr(data)) { + mode = atoi(data); + + if (mode > 3) mode = 3; + } + + switch_core_session_raw_read(session); + switch_core_session_get_read_impl(session, &imp); + + vad = switch_vad_init(imp.samples_per_second, imp.number_of_channels); + switch_assert(vad); + switch_vad_set_mode(vad, mode); + + if ((var = switch_channel_get_variable(channel, "vad_hangover_len"))) { + tmp = atoi(var); + + if (tmp > 0) switch_vad_set_param(vad, "hangover_len", tmp); + } + + if ((var = switch_channel_get_variable(channel, "vad_thresh"))) { + tmp = atoi(var); + + if (tmp > 0) switch_vad_set_param(vad, "thresh", tmp); + } + + if ((var = switch_channel_get_variable(channel, "vad_timeout_len"))) { + tmp = atoi(var); + + if (tmp > 0) switch_vad_set_param(vad, "timeout_len", tmp); + } + + while(switch_channel_ready(channel)) { + switch_core_session_read_frame(session, &frame, SWITCH_IO_FLAG_NONE, 0); + + if (switch_test_flag(frame, SFF_CNG)) { + continue; + } + + vad_state = switch_vad_process(vad, frame->data, frame->datalen / 2); + + if (vad_state == SWITCH_VAD_STATE_START_TALKING) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "START TALKING\n"); + switch_core_session_write_frame(session, frame, SWITCH_IO_FLAG_NONE, 0); + } else if (vad_state == SWITCH_VAD_STATE_STOP_TALKING) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "STOP TALKING\n"); + } else if (vad_state == SWITCH_VAD_STATE_TALKING) { + switch_core_session_write_frame(session, frame, SWITCH_IO_FLAG_NONE, 0); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "vad_state: %d\n", vad_state); + } + } + + switch_vad_destroy(&vad); + switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE); +} + #define SPEAK_DESC "Speak text to a channel via the tts interface" #define DISPLACE_DESC "Displace audio from a file to the channels input" #define SESS_REC_DESC "Starts a background recording of the entire session" @@ -6462,6 +6529,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) SWITCH_ADD_APP(app_interface, "pickup", "Pickup", "Pickup a call", pickup_function, PICKUP_SYNTAX, SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "deduplicate_dtmf", "Prevent duplicate inband + 2833 dtmf", "", deduplicate_dtmf_app_function, "[only_rtp]", SAF_SUPPORT_NOMEDIA); + SWITCH_ADD_APP(app_interface, "vad_test", "VAD test", "VAD test, mode = -1(default), 0, 1, 2, 3", vad_test_function, "[mode]", SAF_NONE); SWITCH_ADD_DIALPLAN(dp_interface, "inline", inline_dialplan_hunt); diff --git a/src/switch_vad.c b/src/switch_vad.c new file mode 100644 index 0000000000..c22ed2f352 --- /dev/null +++ b/src/switch_vad.c @@ -0,0 +1,219 @@ +/* + * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * Copyright (C) 2018, Anthony Minessale II + * + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application + * + * The Initial Developer of the Original Code is + * Anthony Minessale II + * Portions created by the Initial Developer are Copyright (C) + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Seven Du + * + * + * switch_vad.c VAD code with optional libfvad + * + */ + +#include + +#ifdef SWITCH_HAVE_FVAD +#include +#endif + +struct switch_vad_s { + int talking; + int talked; + int talk_hits; + int hangover; + int hangover_len; + int divisor; + int thresh; + int timeout_len; + int timeout; + int channels; + int sample_rate; + + int _hangover_len; + int _thresh; + int _timeout_len; +#ifdef SWITCH_HAVE_FVAD + Fvad *fvad; +#endif +}; + +SWITCH_DECLARE(switch_vad_t *) switch_vad_init(int sample_rate, int channels) +{ + switch_vad_t *vad = malloc(sizeof(switch_vad_t)); + + if (!vad) return NULL; + + memset(vad, 0, sizeof(*vad)); + vad->sample_rate = sample_rate ? sample_rate : 8000; + vad->channels = channels; + vad->_hangover_len = 25; + vad->_thresh = 100; + vad->_timeout_len = 25; + + switch_vad_reset(vad); + + return vad; +} + +//Valid modes are 0 ("quality"), 1 ("low bitrate"), 2 ("aggressive"), and 3 * ("very aggressive"). The default mode is 0. +SWITCH_DECLARE(int) switch_vad_set_mode(switch_vad_t *vad, int mode) +{ +#ifdef SWITCH_HAVE_FVAD + int ret; + + if (mode < 0) return 0; + + vad->fvad = fvad_new(); + ret = fvad_set_mode(vad->fvad, mode); + fvad_set_sample_rate(vad->fvad, vad->sample_rate); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "libfvad started, mode = %d\n", mode); + return ret; +#else + return 0; +#endif +} + +SWITCH_DECLARE(void) switch_vad_set_param(switch_vad_t *vad, const char *key, int val) +{ + if (!key) return; + + if (!strcmp(key, "hangover_len")) { + vad->hangover_len = vad->_hangover_len = val; + } else if (!strcmp(key, "thresh")) { + vad->thresh = vad->_thresh = val; + } else if (!strcmp(key, "timeout_len")) { + vad->timeout = vad->timeout_len = vad->_timeout_len = val; + } +} + +SWITCH_DECLARE(void) switch_vad_reset(switch_vad_t *vad) +{ +#ifdef SWITCH_HAVE_FVAD + if (vad->fvad) { + fvad_reset(vad->fvad); + return; + } +#endif + + vad->talking = 0; + vad->talked = 0; + vad->talk_hits = 0; + vad->hangover = 0; + vad->hangover_len = vad->_hangover_len; + vad->divisor = vad->sample_rate / 8000; + vad->thresh = vad->_thresh; + vad->timeout_len = vad->_timeout_len; + vad->timeout = vad->timeout_len; +} + +SWITCH_DECLARE(switch_vad_state_t) switch_vad_process(switch_vad_t *vad, int16_t *data, unsigned int samples) +{ + int energy = 0, j = 0, count = 0; + int score = 0; + switch_vad_state_t vad_state = SWITCH_VAD_STATE_NONE; + +#ifdef SWITCH_HAVE_FVAD + if (vad->fvad) { + int ret = fvad_process(vad->fvad, data, samples); + + // printf("%d ", ret); fflush(stdout); + + score = vad->thresh + ret - 1; + } else { +#endif + + for (energy = 0, j = 0, count = 0; count < samples; count++) { + energy += abs(data[j]); + j += vad->channels; + } + + score = (uint32_t) (energy / (samples / vad->divisor)); + +#ifdef SWITCH_HAVE_FVAD + } +#endif + + // printf("%d ", score); fflush(stdout); + // printf("yay %d %d %d\n", score, vad->hangover, vad->talking); + + if (vad->talking && score < vad->thresh) { + if (vad->hangover > 0) { + vad->hangover--; + } else {// if (hangover <= 0) { + vad->talking = 0; + vad->talk_hits = 0; + vad->hangover = 0; + } + } else { + if (score >= vad->thresh) { + vad_state = vad->talking ? SWITCH_VAD_STATE_TALKING : SWITCH_VAD_STATE_START_TALKING; + vad->talking = 1; + vad->hangover = vad->hangover_len; + } + } + + // printf("WTF %d %d %d\n", score, vad->talked, vad->talking); + + if (vad->talking) { + vad->talk_hits++; + // printf("WTF %d %d %d\n", vad->talking, vad->talk_hits, vad->talked); + if (vad->talk_hits > 10) { + vad->talked = 1; + vad_state = SWITCH_VAD_STATE_TALKING; + } + } else { + vad->talk_hits = 0; + } + + if (vad->timeout > 0 && !vad->talking) { + vad->timeout--; + } + + if ((vad->talked && !vad->talking)) { + // printf("NOT TALKING ANYMORE\n"); + vad->talked = 0; + vad->timeout = vad->timeout_len; + vad_state = SWITCH_VAD_STATE_STOP_TALKING; + } else { + // if (vad->skip > 0) { + // vad->skip--; + // } + } + + if (vad_state) return vad_state; + + return SWITCH_VAD_STATE_NONE; +} + +SWITCH_DECLARE(void) switch_vad_destroy(switch_vad_t **vad) +{ + if (*vad) { + +#ifdef SWITCH_HAVE_FVAD + if ((*vad)->fvad) free ((*vad)->fvad); +#endif + + free(*vad); + *vad = NULL; + } +} From 5fa0a04b9ba840d2a3cffc1db356b343e195c900 Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 9 Feb 2018 15:20:24 -0600 Subject: [PATCH 173/264] update adapter.js --- html5/verto/js/src/vendor/adapter-latest.js | 1137 +++++++++++------ .../video_demo-live_canvas/js/verto-min.js | 205 +-- html5/verto/video_demo/js/verto-min.js | 205 +-- 3 files changed, 944 insertions(+), 603 deletions(-) diff --git a/html5/verto/js/src/vendor/adapter-latest.js b/html5/verto/js/src/vendor/adapter-latest.js index 46242f30c6..8d59b777bb 100644 --- a/html5/verto/js/src/vendor/adapter-latest.js +++ b/html5/verto/js/src/vendor/adapter-latest.js @@ -25,9 +25,7 @@ function writeMediaSection(transceiver, caps, type, stream, dtlsRole) { sdp += 'a=mid:' + transceiver.mid + '\r\n'; - if (transceiver.direction) { - sdp += 'a=' + transceiver.direction + '\r\n'; - } else if (transceiver.rtpSender && transceiver.rtpReceiver) { + if (transceiver.rtpSender && transceiver.rtpReceiver) { sdp += 'a=sendrecv\r\n'; } else if (transceiver.rtpSender) { sdp += 'a=sendonly\r\n'; @@ -101,7 +99,6 @@ function filterIceServers(iceServers, edgeVersion) { server.urls = isString ? urls[0] : urls; return !!urls.length; } - return false; }); } @@ -215,25 +212,51 @@ function maybeAddCandidate(iceTransport, candidate) { return !alreadyAdded; } + +// https://w3c.github.io/mediacapture-main/#mediastream +// Helper function to add the track to the stream and +// dispatch the event ourselves. +function addTrackToStreamAndFireEvent(track, stream) { + stream.addTrack(track); + var e = new Event('addtrack'); // TODO: MediaStreamTrackEvent + e.track = track; + stream.dispatchEvent(e); +} + +function removeTrackFromStreamAndFireEvent(track, stream) { + stream.removeTrack(track); + var e = new Event('removetrack'); // TODO: MediaStreamTrackEvent + e.track = track; + stream.dispatchEvent(e); +} + +function fireAddTrack(pc, track, receiver, streams) { + var trackEvent = new Event('track'); + trackEvent.track = track; + trackEvent.receiver = receiver; + trackEvent.transceiver = {receiver: receiver}; + trackEvent.streams = streams; + window.setTimeout(function() { + pc._dispatchEvent('track', trackEvent); + }); +} + +function makeError(name, description) { + var e = new Error(description); + e.name = name; + return e; +} + module.exports = function(window, edgeVersion) { var RTCPeerConnection = function(config) { - var self = this; + var pc = this; var _eventTarget = document.createDocumentFragment(); ['addEventListener', 'removeEventListener', 'dispatchEvent'] .forEach(function(method) { - self[method] = _eventTarget[method].bind(_eventTarget); + pc[method] = _eventTarget[method].bind(_eventTarget); }); - this.onicecandidate = null; - this.onaddstream = null; - this.ontrack = null; - this.onremovestream = null; - this.onsignalingstatechange = null; - this.oniceconnectionstatechange = null; - this.onicegatheringstatechange = null; - this.onnegotiationneeded = null; - this.ondatachannel = null; this.canTrickleIceCandidates = null; this.needNegotiation = false; @@ -252,9 +275,8 @@ module.exports = function(window, edgeVersion) { this.usingBundle = config.bundlePolicy === 'max-bundle'; if (config.rtcpMuxPolicy === 'negotiate') { - var e = new Error('rtcpMuxPolicy \'negotiate\' is not supported'); - e.name = 'NotSupportedError'; - throw(e); + throw(makeError('NotSupportedError', + 'rtcpMuxPolicy \'negotiate\' is not supported')); } else if (!config.rtcpMuxPolicy) { config.rtcpMuxPolicy = 'require'; } @@ -302,14 +324,34 @@ module.exports = function(window, edgeVersion) { this._sdpSessionVersion = 0; this._dtlsRole = undefined; // role for a=setup to use in answers. + + this._isClosed = false; + }; + + // set up event handlers on prototype + RTCPeerConnection.prototype.onicecandidate = null; + RTCPeerConnection.prototype.onaddstream = null; + RTCPeerConnection.prototype.ontrack = null; + RTCPeerConnection.prototype.onremovestream = null; + RTCPeerConnection.prototype.onsignalingstatechange = null; + RTCPeerConnection.prototype.oniceconnectionstatechange = null; + RTCPeerConnection.prototype.onicegatheringstatechange = null; + RTCPeerConnection.prototype.onnegotiationneeded = null; + RTCPeerConnection.prototype.ondatachannel = null; + + RTCPeerConnection.prototype._dispatchEvent = function(name, event) { + if (this._isClosed) { + return; + } + this.dispatchEvent(event); + if (typeof this['on' + name] === 'function') { + this['on' + name](event); + } }; RTCPeerConnection.prototype._emitGatheringStateChange = function() { var event = new Event('icegatheringstatechange'); - this.dispatchEvent(event); - if (typeof this.onicegatheringstatechange === 'function') { - this.onicegatheringstatechange(event); - } + this._dispatchEvent('icegatheringstatechange', event); }; RTCPeerConnection.prototype.getConfiguration = function() { @@ -342,6 +384,7 @@ module.exports = function(window, edgeVersion) { sendEncodingParameters: null, recvEncodingParameters: null, stream: null, + associatedRemoteMediaStreams: [], wantReceive: true }; if (this.usingBundle && hasBundleTransport) { @@ -357,6 +400,19 @@ module.exports = function(window, edgeVersion) { }; RTCPeerConnection.prototype.addTrack = function(track, stream) { + var alreadyExists = this.transceivers.find(function(s) { + return s.track === track; + }); + + if (alreadyExists) { + throw makeError('InvalidAccessError', 'Track already exists.'); + } + + if (this.signalingState === 'closed') { + throw makeError('InvalidStateError', + 'Attempted to call addTrack on a closed peerconnection.'); + } + var transceiver; for (var i = 0; i < this.transceivers.length; i++) { if (!this.transceivers[i].track && @@ -382,10 +438,10 @@ module.exports = function(window, edgeVersion) { }; RTCPeerConnection.prototype.addStream = function(stream) { - var self = this; + var pc = this; if (edgeVersion >= 15025) { stream.getTracks().forEach(function(track) { - self.addTrack(track, stream); + pc.addTrack(track, stream); }); } else { // Clone is necessary for local demos mostly, attaching directly @@ -399,17 +455,54 @@ module.exports = function(window, edgeVersion) { }); }); clonedStream.getTracks().forEach(function(track) { - self.addTrack(track, clonedStream); + pc.addTrack(track, clonedStream); }); } }; - RTCPeerConnection.prototype.removeStream = function(stream) { - var idx = this.localStreams.indexOf(stream); - if (idx > -1) { - this.localStreams.splice(idx, 1); - this._maybeFireNegotiationNeeded(); + RTCPeerConnection.prototype.removeTrack = function(sender) { + if (!(sender instanceof window.RTCRtpSender)) { + throw new TypeError('Argument 1 of RTCPeerConnection.removeTrack ' + + 'does not implement interface RTCRtpSender.'); } + + var transceiver = this.transceivers.find(function(t) { + return t.rtpSender === sender; + }); + + if (!transceiver) { + throw makeError('InvalidAccessError', + 'Sender was not created by this connection.'); + } + var stream = transceiver.stream; + + transceiver.rtpSender.stop(); + transceiver.rtpSender = null; + transceiver.track = null; + transceiver.stream = null; + + // remove the stream from the set of local streams + var localStreams = this.transceivers.map(function(t) { + return t.stream; + }); + if (localStreams.indexOf(stream) === -1 && + this.localStreams.indexOf(stream) > -1) { + this.localStreams.splice(this.localStreams.indexOf(stream), 1); + } + + this._maybeFireNegotiationNeeded(); + }; + + RTCPeerConnection.prototype.removeStream = function(stream) { + var pc = this; + stream.getTracks().forEach(function(track) { + var sender = pc.getSenders().find(function(s) { + return s.track === track; + }); + if (sender) { + pc.removeTrack(sender); + } + }); }; RTCPeerConnection.prototype.getSenders = function() { @@ -433,7 +526,7 @@ module.exports = function(window, edgeVersion) { RTCPeerConnection.prototype._createIceGatherer = function(sdpMLineIndex, usingBundle) { - var self = this; + var pc = this; if (usingBundle && sdpMLineIndex > 0) { return this.transceivers[0].iceGatherer; } else if (this._iceGatherers.length) { @@ -453,8 +546,8 @@ module.exports = function(window, edgeVersion) { // polyfill since RTCIceGatherer.state is not implemented in // Edge 10547 yet. iceGatherer.state = end ? 'completed' : 'gathering'; - if (self.transceivers[sdpMLineIndex].candidates !== null) { - self.transceivers[sdpMLineIndex].candidates.push(event.candidate); + if (pc.transceivers[sdpMLineIndex].candidates !== null) { + pc.transceivers[sdpMLineIndex].candidates.push(event.candidate); } }; iceGatherer.addEventListener('localcandidate', @@ -464,7 +557,7 @@ module.exports = function(window, edgeVersion) { // start gathering from an RTCIceGatherer. RTCPeerConnection.prototype._gather = function(mid, sdpMLineIndex) { - var self = this; + var pc = this; var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer; if (iceGatherer.onlocalcandidate) { return; @@ -474,7 +567,7 @@ module.exports = function(window, edgeVersion) { iceGatherer.removeEventListener('localcandidate', this.transceivers[sdpMLineIndex].bufferCandidates); iceGatherer.onlocalcandidate = function(evt) { - if (self.usingBundle && sdpMLineIndex > 0) { + if (pc.usingBundle && sdpMLineIndex > 0) { // if we know that we use bundle we can drop candidates with // ѕdpMLineIndex > 0. If we don't do this then our state gets // confused since we dispose the extra ice gatherer. @@ -502,7 +595,7 @@ module.exports = function(window, edgeVersion) { } // update local description. - var sections = SDPUtils.splitSections(self.localDescription.sdp); + var sections = SDPUtils.splitSections(pc.localDescription.sdp); if (!end) { sections[event.candidate.sdpMLineIndex + 1] += 'a=' + event.candidate.candidate + '\r\n'; @@ -510,32 +603,26 @@ module.exports = function(window, edgeVersion) { sections[event.candidate.sdpMLineIndex + 1] += 'a=end-of-candidates\r\n'; } - self.localDescription.sdp = sections.join(''); - var complete = self.transceivers.every(function(transceiver) { + pc.localDescription.sdp = sections.join(''); + var complete = pc.transceivers.every(function(transceiver) { return transceiver.iceGatherer && transceiver.iceGatherer.state === 'completed'; }); - if (self.iceGatheringState !== 'gathering') { - self.iceGatheringState = 'gathering'; - self._emitGatheringStateChange(); + if (pc.iceGatheringState !== 'gathering') { + pc.iceGatheringState = 'gathering'; + pc._emitGatheringStateChange(); } // Emit candidate. Also emit null candidate when all gatherers are // complete. if (!end) { - self.dispatchEvent(event); - if (typeof self.onicecandidate === 'function') { - self.onicecandidate(event); - } + pc._dispatchEvent('icecandidate', event); } if (complete) { - self.dispatchEvent(new Event('icecandidate')); - if (typeof self.onicecandidate === 'function') { - self.onicecandidate(new Event('icecandidate')); - } - self.iceGatheringState = 'complete'; - self._emitGatheringStateChange(); + pc._dispatchEvent('icecandidate', new Event('icecandidate')); + pc.iceGatheringState = 'complete'; + pc._emitGatheringStateChange(); } }; @@ -551,21 +638,21 @@ module.exports = function(window, edgeVersion) { // Create ICE transport and DTLS transport. RTCPeerConnection.prototype._createIceAndDtlsTransports = function() { - var self = this; + var pc = this; var iceTransport = new window.RTCIceTransport(null); iceTransport.onicestatechange = function() { - self._updateConnectionState(); + pc._updateConnectionState(); }; var dtlsTransport = new window.RTCDtlsTransport(iceTransport); dtlsTransport.ondtlsstatechange = function() { - self._updateConnectionState(); + pc._updateConnectionState(); }; dtlsTransport.onerror = function() { - // onerror does not set state to failed by itself. + // onerror does not set state to failed by itpc. Object.defineProperty(dtlsTransport, 'state', {value: 'failed', writable: true}); - self._updateConnectionState(); + pc._updateConnectionState(); }; return { @@ -621,11 +708,15 @@ module.exports = function(window, edgeVersion) { delete p.rtx; }); } - params.encodings = transceiver.recvEncodingParameters; + if (transceiver.recvEncodingParameters.length) { + params.encodings = transceiver.recvEncodingParameters; + } params.rtcp = { - cname: transceiver.rtcpParameters.cname, compound: transceiver.rtcpParameters.compound }; + if (transceiver.rtcpParameters.cname) { + params.rtcp.cname = transceiver.rtcpParameters.cname; + } if (transceiver.sendEncodingParameters.length) { params.rtcp.ssrc = transceiver.sendEncodingParameters[0].ssrc; } @@ -634,20 +725,13 @@ module.exports = function(window, edgeVersion) { }; RTCPeerConnection.prototype.setLocalDescription = function(description) { - var self = this; - var args = arguments; + var pc = this; if (!isActionAllowedInSignalingState('setLocalDescription', - description.type, this.signalingState)) { - return new Promise(function(resolve, reject) { - var e = new Error('Can not set local ' + description.type + - ' in state ' + self.signalingState); - e.name = 'InvalidStateError'; - if (args.length > 2 && typeof args[2] === 'function') { - args[2].apply(null, [e]); - } - reject(e); - }); + description.type, this.signalingState) || this._isClosed) { + return Promise.reject(makeError('InvalidStateError', + 'Can not set local ' + description.type + + ' in state ' + pc.signalingState)); } var sections; @@ -659,19 +743,19 @@ module.exports = function(window, edgeVersion) { sessionpart = sections.shift(); sections.forEach(function(mediaSection, sdpMLineIndex) { var caps = SDPUtils.parseRtpParameters(mediaSection); - self.transceivers[sdpMLineIndex].localCapabilities = caps; + pc.transceivers[sdpMLineIndex].localCapabilities = caps; }); this.transceivers.forEach(function(transceiver, sdpMLineIndex) { - self._gather(transceiver.mid, sdpMLineIndex); + pc._gather(transceiver.mid, sdpMLineIndex); }); } else if (description.type === 'answer') { - sections = SDPUtils.splitSections(self.remoteDescription.sdp); + sections = SDPUtils.splitSections(pc.remoteDescription.sdp); sessionpart = sections.shift(); var isIceLite = SDPUtils.matchPrefix(sessionpart, 'a=ice-lite').length > 0; sections.forEach(function(mediaSection, sdpMLineIndex) { - var transceiver = self.transceivers[sdpMLineIndex]; + var transceiver = pc.transceivers[sdpMLineIndex]; var iceGatherer = transceiver.iceGatherer; var iceTransport = transceiver.iceTransport; var dtlsTransport = transceiver.dtlsTransport; @@ -680,7 +764,7 @@ module.exports = function(window, edgeVersion) { // treat bundle-only as not-rejected. var rejected = SDPUtils.isRejected(mediaSection) && - !SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 1; + SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 0; if (!rejected && !transceiver.isDatachannel) { var remoteIceParameters = SDPUtils.getIceParameters( @@ -691,8 +775,8 @@ module.exports = function(window, edgeVersion) { remoteDtlsParameters.role = 'server'; } - if (!self.usingBundle || sdpMLineIndex === 0) { - self._gather(transceiver.mid, sdpMLineIndex); + if (!pc.usingBundle || sdpMLineIndex === 0) { + pc._gather(transceiver.mid, sdpMLineIndex); if (iceTransport.state === 'new') { iceTransport.start(iceGatherer, remoteIceParameters, isIceLite ? 'controlling' : 'controlled'); @@ -708,7 +792,7 @@ module.exports = function(window, edgeVersion) { // Start the RTCRtpSender. The RTCRtpReceiver for this // transceiver has already been started in setRemoteDescription. - self._transceive(transceiver, + pc._transceive(transceiver, params.codecs.length > 0, false); } @@ -731,34 +815,17 @@ module.exports = function(window, edgeVersion) { '"'); } - // If a success callback was provided, emit ICE candidates after it - // has been executed. Otherwise, emit callback after the Promise is - // resolved. - var cb = arguments.length > 1 && typeof arguments[1] === 'function' && - arguments[1]; - return new Promise(function(resolve) { - if (cb) { - cb.apply(null); - } - resolve(); - }); + return Promise.resolve(); }; RTCPeerConnection.prototype.setRemoteDescription = function(description) { - var self = this; - var args = arguments; + var pc = this; if (!isActionAllowedInSignalingState('setRemoteDescription', - description.type, this.signalingState)) { - return new Promise(function(resolve, reject) { - var e = new Error('Can not set remote ' + description.type + - ' in state ' + self.signalingState); - e.name = 'InvalidStateError'; - if (args.length > 2 && typeof args[2] === 'function') { - args[2].apply(null, [e]); - } - reject(e); - }); + description.type, this.signalingState) || this._isClosed) { + return Promise.reject(makeError('InvalidStateError', + 'Can not set remote ' + description.type + + ' in state ' + pc.signalingState)); } var streams = {}; @@ -787,7 +854,7 @@ module.exports = function(window, edgeVersion) { var kind = SDPUtils.getKind(mediaSection); // treat bundle-only as not-rejected. var rejected = SDPUtils.isRejected(mediaSection) && - !SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 1; + SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 0; var protocol = lines[0].substr(2).split(' ')[2]; var direction = SDPUtils.getDirection(mediaSection, sessionpart); @@ -797,7 +864,7 @@ module.exports = function(window, edgeVersion) { // Reject datachannels which are not implemented yet. if (kind === 'application' && protocol === 'DTLS/SCTP') { - self.transceivers[sdpMLineIndex] = { + pc.transceivers[sdpMLineIndex] = { mid: mid, isDatachannel: true }; @@ -843,30 +910,30 @@ module.exports = function(window, edgeVersion) { // Check if we can use BUNDLE and dispose transports. if ((description.type === 'offer' || description.type === 'answer') && !rejected && usingBundle && sdpMLineIndex > 0 && - self.transceivers[sdpMLineIndex]) { - self._disposeIceAndDtlsTransports(sdpMLineIndex); - self.transceivers[sdpMLineIndex].iceGatherer = - self.transceivers[0].iceGatherer; - self.transceivers[sdpMLineIndex].iceTransport = - self.transceivers[0].iceTransport; - self.transceivers[sdpMLineIndex].dtlsTransport = - self.transceivers[0].dtlsTransport; - if (self.transceivers[sdpMLineIndex].rtpSender) { - self.transceivers[sdpMLineIndex].rtpSender.setTransport( - self.transceivers[0].dtlsTransport); + pc.transceivers[sdpMLineIndex]) { + pc._disposeIceAndDtlsTransports(sdpMLineIndex); + pc.transceivers[sdpMLineIndex].iceGatherer = + pc.transceivers[0].iceGatherer; + pc.transceivers[sdpMLineIndex].iceTransport = + pc.transceivers[0].iceTransport; + pc.transceivers[sdpMLineIndex].dtlsTransport = + pc.transceivers[0].dtlsTransport; + if (pc.transceivers[sdpMLineIndex].rtpSender) { + pc.transceivers[sdpMLineIndex].rtpSender.setTransport( + pc.transceivers[0].dtlsTransport); } - if (self.transceivers[sdpMLineIndex].rtpReceiver) { - self.transceivers[sdpMLineIndex].rtpReceiver.setTransport( - self.transceivers[0].dtlsTransport); + if (pc.transceivers[sdpMLineIndex].rtpReceiver) { + pc.transceivers[sdpMLineIndex].rtpReceiver.setTransport( + pc.transceivers[0].dtlsTransport); } } if (description.type === 'offer' && !rejected) { - transceiver = self.transceivers[sdpMLineIndex] || - self._createTransceiver(kind); + transceiver = pc.transceivers[sdpMLineIndex] || + pc._createTransceiver(kind); transceiver.mid = mid; if (!transceiver.iceGatherer) { - transceiver.iceGatherer = self._createIceGatherer(sdpMLineIndex, + transceiver.iceGatherer = pc._createIceGatherer(sdpMLineIndex, usingBundle); } @@ -895,6 +962,7 @@ module.exports = function(window, edgeVersion) { ssrc: (2 * sdpMLineIndex + 2) * 1001 }]; + // TODO: rewrite to use http://w3c.github.io/webrtc-pc/#set-associated-remote-streams var isNewTrack = false; if (direction === 'sendrecv' || direction === 'sendonly') { isNewTrack = !transceiver.rtpReceiver; @@ -905,7 +973,9 @@ module.exports = function(window, edgeVersion) { var stream; track = rtpReceiver.track; // FIXME: does not work with Plan B. - if (remoteMsid) { + if (remoteMsid && remoteMsid.stream === '-') { + // no-op. a stream id of '-' means: no associated stream. + } else if (remoteMsid) { if (!streams[remoteMsid.stream]) { streams[remoteMsid.stream] = new window.MediaStream(); Object.defineProperty(streams[remoteMsid.stream], 'id', { @@ -926,9 +996,22 @@ module.exports = function(window, edgeVersion) { } stream = streams.default; } - stream.addTrack(track); + if (stream) { + addTrackToStreamAndFireEvent(track, stream); + transceiver.associatedRemoteMediaStreams.push(stream); + } receiverList.push([track, rtpReceiver, stream]); } + } else if (transceiver.rtpReceiver && transceiver.rtpReceiver.track) { + transceiver.associatedRemoteMediaStreams.forEach(function(s) { + var nativeTrack = s.getTracks().find(function(t) { + return t.id === transceiver.rtpReceiver.track.id; + }); + if (nativeTrack) { + removeTrackFromStreamAndFireEvent(nativeTrack, s); + } + }); + transceiver.associatedRemoteMediaStreams = []; } transceiver.localCapabilities = localCapabilities; @@ -940,11 +1023,11 @@ module.exports = function(window, edgeVersion) { // Start the RTCRtpReceiver now. The RTPSender is started in // setLocalDescription. - self._transceive(self.transceivers[sdpMLineIndex], + pc._transceive(pc.transceivers[sdpMLineIndex], false, isNewTrack); } else if (description.type === 'answer' && !rejected) { - transceiver = self.transceivers[sdpMLineIndex]; + transceiver = pc.transceivers[sdpMLineIndex]; iceGatherer = transceiver.iceGatherer; iceTransport = transceiver.iceTransport; dtlsTransport = transceiver.dtlsTransport; @@ -952,11 +1035,11 @@ module.exports = function(window, edgeVersion) { sendEncodingParameters = transceiver.sendEncodingParameters; localCapabilities = transceiver.localCapabilities; - self.transceivers[sdpMLineIndex].recvEncodingParameters = + pc.transceivers[sdpMLineIndex].recvEncodingParameters = recvEncodingParameters; - self.transceivers[sdpMLineIndex].remoteCapabilities = + pc.transceivers[sdpMLineIndex].remoteCapabilities = remoteCapabilities; - self.transceivers[sdpMLineIndex].rtcpParameters = rtcpParameters; + pc.transceivers[sdpMLineIndex].rtcpParameters = rtcpParameters; if (cands.length && iceTransport.state === 'new') { if ((isIceLite || isComplete) && @@ -979,10 +1062,11 @@ module.exports = function(window, edgeVersion) { } } - self._transceive(transceiver, + pc._transceive(transceiver, direction === 'sendrecv' || direction === 'recvonly', direction === 'sendrecv' || direction === 'sendonly'); + // TODO: rewrite to use http://w3c.github.io/webrtc-pc/#set-associated-remote-streams if (rtpReceiver && (direction === 'sendrecv' || direction === 'sendonly')) { track = rtpReceiver.track; @@ -990,13 +1074,13 @@ module.exports = function(window, edgeVersion) { if (!streams[remoteMsid.stream]) { streams[remoteMsid.stream] = new window.MediaStream(); } - streams[remoteMsid.stream].addTrack(track); + addTrackToStreamAndFireEvent(track, streams[remoteMsid.stream]); receiverList.push([track, rtpReceiver, streams[remoteMsid.stream]]); } else { if (!streams.default) { streams.default = new window.MediaStream(); } - streams.default.addTrack(track); + addTrackToStreamAndFireEvent(track, streams.default); receiverList.push([track, rtpReceiver, streams.default]); } } else { @@ -1028,15 +1112,12 @@ module.exports = function(window, edgeVersion) { Object.keys(streams).forEach(function(sid) { var stream = streams[sid]; if (stream.getTracks().length) { - if (self.remoteStreams.indexOf(stream) === -1) { - self.remoteStreams.push(stream); + if (pc.remoteStreams.indexOf(stream) === -1) { + pc.remoteStreams.push(stream); var event = new Event('addstream'); event.stream = stream; window.setTimeout(function() { - self.dispatchEvent(event); - if (typeof self.onaddstream === 'function') { - self.onaddstream(event); - } + pc._dispatchEvent('addstream', event); }); } @@ -1046,28 +1127,24 @@ module.exports = function(window, edgeVersion) { if (stream.id !== item[2].id) { return; } - var trackEvent = new Event('track'); - trackEvent.track = track; - trackEvent.receiver = receiver; - trackEvent.transceiver = {receiver: receiver}; - trackEvent.streams = [stream]; - window.setTimeout(function() { - self.dispatchEvent(trackEvent); - if (typeof self.ontrack === 'function') { - self.ontrack(trackEvent); - } - }); + fireAddTrack(pc, track, receiver, [stream]); }); } }); + receiverList.forEach(function(item) { + if (item[2]) { + return; + } + fireAddTrack(pc, item[0], item[1], []); + }); // check whether addIceCandidate({}) was called within four seconds after // setRemoteDescription. window.setTimeout(function() { - if (!(self && self.transceivers)) { + if (!(pc && pc.transceivers)) { return; } - self.transceivers.forEach(function(transceiver) { + pc.transceivers.forEach(function(transceiver) { if (transceiver.iceTransport && transceiver.iceTransport.state === 'new' && transceiver.iceTransport.getRemoteCandidates().length > 0) { @@ -1078,12 +1155,7 @@ module.exports = function(window, edgeVersion) { }); }, 4000); - return new Promise(function(resolve) { - if (args.length > 1 && typeof args[1] === 'function') { - args[1].apply(null); - } - resolve(); - }); + return Promise.resolve(); }; RTCPeerConnection.prototype.close = function() { @@ -1107,6 +1179,7 @@ module.exports = function(window, edgeVersion) { } }); // FIXME: clean up tracks, local streams, remote streams, etc + this._isClosed = true; this._updateSignalingState('closed'); }; @@ -1114,29 +1187,23 @@ module.exports = function(window, edgeVersion) { RTCPeerConnection.prototype._updateSignalingState = function(newState) { this.signalingState = newState; var event = new Event('signalingstatechange'); - this.dispatchEvent(event); - if (typeof this.onsignalingstatechange === 'function') { - this.onsignalingstatechange(event); - } + this._dispatchEvent('signalingstatechange', event); }; // Determine whether to fire the negotiationneeded event. RTCPeerConnection.prototype._maybeFireNegotiationNeeded = function() { - var self = this; + var pc = this; if (this.signalingState !== 'stable' || this.needNegotiation === true) { return; } this.needNegotiation = true; window.setTimeout(function() { - if (self.needNegotiation === false) { + if (pc.needNegotiation === false) { return; } - self.needNegotiation = false; + pc.needNegotiation = false; var event = new Event('negotiationneeded'); - self.dispatchEvent(event); - if (typeof self.onnegotiationneeded === 'function') { - self.onnegotiationneeded(event); - } + pc._dispatchEvent('negotiationneeded', event); }, 0); }; @@ -1176,22 +1243,16 @@ module.exports = function(window, edgeVersion) { if (newState !== this.iceConnectionState) { this.iceConnectionState = newState; var event = new Event('iceconnectionstatechange'); - this.dispatchEvent(event); - if (typeof this.oniceconnectionstatechange === 'function') { - this.oniceconnectionstatechange(event); - } + this._dispatchEvent('iceconnectionstatechange', event); } }; RTCPeerConnection.prototype.createOffer = function() { - var self = this; - var args = arguments; + var pc = this; - var offerOptions; - if (arguments.length === 1 && typeof arguments[0] !== 'function') { - offerOptions = arguments[0]; - } else if (arguments.length === 3) { - offerOptions = arguments[2]; + if (this._isClosed) { + return Promise.reject(makeError('InvalidStateError', + 'Can not call createOffer after close')); } var numAudioTracks = this.transceivers.filter(function(t) { @@ -1202,6 +1263,7 @@ module.exports = function(window, edgeVersion) { }).length; // Determine number of audio and video tracks we need to send/recv. + var offerOptions = arguments[0]; if (offerOptions) { // Reject Chrome legacy constraints. if (offerOptions.mandatory || offerOptions.optional) { @@ -1265,8 +1327,8 @@ module.exports = function(window, edgeVersion) { transceiver.mid = mid; if (!transceiver.iceGatherer) { - transceiver.iceGatherer = self._createIceGatherer(sdpMLineIndex, - self.usingBundle); + transceiver.iceGatherer = pc._createIceGatherer(sdpMLineIndex, + pc.usingBundle); } var localCapabilities = window.RTCRtpSender.getCapabilities(kind); @@ -1320,11 +1382,11 @@ module.exports = function(window, edgeVersion) { this.transceivers.forEach(function(transceiver, sdpMLineIndex) { sdp += writeMediaSection(transceiver, transceiver.localCapabilities, - 'offer', transceiver.stream, self._dtlsRole); + 'offer', transceiver.stream, pc._dtlsRole); sdp += 'a=rtcp-rsize\r\n'; - if (transceiver.iceGatherer && self.iceGatheringState !== 'new' && - (sdpMLineIndex === 0 || !self.usingBundle)) { + if (transceiver.iceGatherer && pc.iceGatheringState !== 'new' && + (sdpMLineIndex === 0 || !pc.usingBundle)) { transceiver.iceGatherer.getLocalCandidates().forEach(function(cand) { cand.component = 1; sdp += 'a=' + SDPUtils.writeCandidate(cand) + '\r\n'; @@ -1340,19 +1402,16 @@ module.exports = function(window, edgeVersion) { type: 'offer', sdp: sdp }); - return new Promise(function(resolve) { - if (args.length > 0 && typeof args[0] === 'function') { - args[0].apply(null, [desc]); - resolve(); - return; - } - resolve(desc); - }); + return Promise.resolve(desc); }; RTCPeerConnection.prototype.createAnswer = function() { - var self = this; - var args = arguments; + var pc = this; + + if (this._isClosed) { + return Promise.reject(makeError('InvalidStateError', + 'Can not call createAnswer after close')); + } var sdp = SDPUtils.writeSessionBoilerplate(this._sdpSessionId, this._sdpSessionVersion++); @@ -1406,7 +1465,7 @@ module.exports = function(window, edgeVersion) { } sdp += writeMediaSection(transceiver, commonCapabilities, - 'answer', transceiver.stream, self._dtlsRole); + 'answer', transceiver.stream, pc._dtlsRole); if (transceiver.rtcpParameters && transceiver.rtcpParameters.reducedSize) { sdp += 'a=rtcp-rsize\r\n'; @@ -1417,18 +1476,10 @@ module.exports = function(window, edgeVersion) { type: 'answer', sdp: sdp }); - return new Promise(function(resolve) { - if (args.length > 0 && typeof args[0] === 'function') { - args[0].apply(null, [desc]); - resolve(); - return; - } - resolve(desc); - }); + return Promise.resolve(desc); }; RTCPeerConnection.prototype.addIceCandidate = function(candidate) { - var err; var sections; if (!candidate || candidate.candidate === '') { for (var j = 0; j < this.transceivers.length; j++) { @@ -1446,9 +1497,8 @@ module.exports = function(window, edgeVersion) { } else if (!(candidate.sdpMLineIndex !== undefined || candidate.sdpMid)) { throw new TypeError('sdpMLineIndex or sdpMid required'); } else if (!this.remoteDescription) { - err = new Error('Can not add ICE candidate without ' + - 'a remote description'); - err.name = 'InvalidStateError'; + return Promise.reject(makeError('InvalidStateError', + 'Can not add ICE candidate without a remote description')); } else { var sdpMLineIndex = candidate.sdpMLineIndex; if (candidate.sdpMid) { @@ -1479,42 +1529,27 @@ module.exports = function(window, edgeVersion) { if (sdpMLineIndex === 0 || (sdpMLineIndex > 0 && transceiver.iceTransport !== this.transceivers[0].iceTransport)) { if (!maybeAddCandidate(transceiver.iceTransport, cand)) { - err = new Error('Can not add ICE candidate'); - err.name = 'OperationError'; + return Promise.reject(makeError('OperationError', + 'Can not add ICE candidate')); } } - if (!err) { - // update the remoteDescription. - var candidateString = candidate.candidate.trim(); - if (candidateString.indexOf('a=') === 0) { - candidateString = candidateString.substr(2); - } - sections = SDPUtils.splitSections(this.remoteDescription.sdp); - sections[sdpMLineIndex + 1] += 'a=' + - (cand.type ? candidateString : 'end-of-candidates') - + '\r\n'; - this.remoteDescription.sdp = sections.join(''); + // update the remoteDescription. + var candidateString = candidate.candidate.trim(); + if (candidateString.indexOf('a=') === 0) { + candidateString = candidateString.substr(2); } + sections = SDPUtils.splitSections(this.remoteDescription.sdp); + sections[sdpMLineIndex + 1] += 'a=' + + (cand.type ? candidateString : 'end-of-candidates') + + '\r\n'; + this.remoteDescription.sdp = sections.join(''); } else { - err = new Error('Can not add ICE candidate'); - err.name = 'OperationError'; + return Promise.reject(makeError('OperationError', + 'Can not add ICE candidate')); } } - var args = arguments; - return new Promise(function(resolve, reject) { - if (err) { - if (args.length > 2 && typeof args[2] === 'function') { - args[2].apply(null, [err]); - } - reject(err); - } else { - if (args.length > 1 && typeof args[1] === 'function') { - args[1].apply(null); - } - resolve(); - } - }); + return Promise.resolve(); }; RTCPeerConnection.prototype.getStats = function() { @@ -1527,8 +1562,6 @@ module.exports = function(window, edgeVersion) { } }); }); - var cb = arguments.length > 1 && typeof arguments[1] === 'function' && - arguments[1]; var fixStatsType = function(stat) { return { inboundrtp: 'inbound-rtp', @@ -1548,13 +1581,74 @@ module.exports = function(window, edgeVersion) { results.set(id, result[id]); }); }); - if (cb) { - cb.apply(null, results); - } resolve(results); }); }); }; + + // legacy callback shims. Should be moved to adapter.js some days. + var methods = ['createOffer', 'createAnswer']; + methods.forEach(function(method) { + var nativeMethod = RTCPeerConnection.prototype[method]; + RTCPeerConnection.prototype[method] = function() { + var args = arguments; + if (typeof args[0] === 'function' || + typeof args[1] === 'function') { // legacy + return nativeMethod.apply(this, [arguments[2]]) + .then(function(description) { + if (typeof args[0] === 'function') { + args[0].apply(null, [description]); + } + }, function(error) { + if (typeof args[1] === 'function') { + args[1].apply(null, [error]); + } + }); + } + return nativeMethod.apply(this, arguments); + }; + }); + + methods = ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']; + methods.forEach(function(method) { + var nativeMethod = RTCPeerConnection.prototype[method]; + RTCPeerConnection.prototype[method] = function() { + var args = arguments; + if (typeof args[1] === 'function' || + typeof args[2] === 'function') { // legacy + return nativeMethod.apply(this, arguments) + .then(function() { + if (typeof args[1] === 'function') { + args[1].apply(null); + } + }, function(error) { + if (typeof args[2] === 'function') { + args[2].apply(null, [error]); + } + }); + } + return nativeMethod.apply(this, arguments); + }; + }); + + // getStats is special. It doesn't have a spec legacy method yet we support + // getStats(something, cb) without error callbacks. + ['getStats'].forEach(function(method) { + var nativeMethod = RTCPeerConnection.prototype[method]; + RTCPeerConnection.prototype[method] = function() { + var args = arguments; + if (typeof args[1] === 'function') { + return nativeMethod.apply(this, arguments) + .then(function() { + if (typeof args[1] === 'function') { + args[1].apply(null); + } + }); + } + return nativeMethod.apply(this, arguments); + }; + }); + return RTCPeerConnection; }; @@ -2261,14 +2355,6 @@ module.exports = function(dependencies, opts) { var logging = utils.log; var browserDetails = utils.detectBrowser(window); - // Export to the adapter global object visible in the browser. - var adapter = { - browserDetails: browserDetails, - extractVersion: utils.extractVersion, - disableLog: utils.disableLog, - disableWarnings: utils.disableWarnings - }; - // Uncomment the line below if you want logging to occur, including logging // for the switch statement below. Can also be turned on in the browser via // adapter.disableLog(false), but then logging from the switch statement below @@ -2282,6 +2368,15 @@ module.exports = function(dependencies, opts) { var safariShim = require('./safari/safari_shim') || null; var commonShim = require('./common_shim') || null; + // Export to the adapter global object visible in the browser. + var adapter = { + browserDetails: browserDetails, + commonShim: commonShim, + extractVersion: utils.extractVersion, + disableLog: utils.disableLog, + disableWarnings: utils.disableWarnings + }; + // Shim browser if found. switch (browserDetails.browser) { case 'chrome': @@ -2304,6 +2399,8 @@ module.exports = function(dependencies, opts) { chromeShim.shimGetSendersWithDtmf(window); commonShim.shimRTCIceCandidate(window); + commonShim.shimMaxMessageSize(window); + commonShim.shimSendThrowTypeError(window); break; case 'firefox': if (!firefoxShim || !firefoxShim.shimPeerConnection || @@ -2323,6 +2420,8 @@ module.exports = function(dependencies, opts) { firefoxShim.shimRemoveStream(window); commonShim.shimRTCIceCandidate(window); + commonShim.shimMaxMessageSize(window); + commonShim.shimSendThrowTypeError(window); break; case 'edge': if (!edgeShim || !edgeShim.shimPeerConnection || !options.shimEdge) { @@ -2339,6 +2438,9 @@ module.exports = function(dependencies, opts) { edgeShim.shimReplaceTrack(window); // the edge shim implements the full RTCIceCandidate object. + + commonShim.shimMaxMessageSize(window); + commonShim.shimSendThrowTypeError(window); break; case 'safari': if (!safariShim || !options.shimSafari) { @@ -2359,6 +2461,8 @@ module.exports = function(dependencies, opts) { safariShim.shimCreateOfferLegacy(window); commonShim.shimRTCIceCandidate(window); + commonShim.shimMaxMessageSize(window); + commonShim.shimSendThrowTypeError(window); break; default: logging('Unsupported browser!'); @@ -2382,7 +2486,8 @@ module.exports = function(dependencies, opts) { var utils = require('../utils.js'); var logging = utils.log; -var chromeShim = { +module.exports = { + shimGetUserMedia: require('./getusermedia'), shimMediaStream: function(window) { window.MediaStream = window.MediaStream || window.webkitMediaStream; }, @@ -2447,6 +2552,13 @@ var chromeShim = { } return origSetRemoteDescription.apply(pc, arguments); }; + } else if (!('RTCRtpTransceiver' in window)) { + utils.wrapPeerConnectionEvent(window, 'track', function(e) { + if (!e.transceiver) { + e.transceiver = {receiver: e.receiver}; + } + return e; + }); } }, @@ -2598,12 +2710,88 @@ var chromeShim = { } }, + shimAddTrackRemoveTrackWithNative: function(window) { + // shim addTrack/removeTrack with native variants in order to make + // the interactions with legacy getLocalStreams behave as in other browsers. + // Keeps a mapping stream.id => [stream, rtpsenders...] + window.RTCPeerConnection.prototype.getLocalStreams = function() { + var pc = this; + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + return Object.keys(this._shimmedLocalStreams).map(function(streamId) { + return pc._shimmedLocalStreams[streamId][0]; + }); + }; + + var origAddTrack = window.RTCPeerConnection.prototype.addTrack; + window.RTCPeerConnection.prototype.addTrack = function(track, stream) { + if (!stream) { + return origAddTrack.apply(this, arguments); + } + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + + var sender = origAddTrack.apply(this, arguments); + if (!this._shimmedLocalStreams[stream.id]) { + this._shimmedLocalStreams[stream.id] = [stream, sender]; + } else if (this._shimmedLocalStreams[stream.id].indexOf(sender) === -1) { + this._shimmedLocalStreams[stream.id].push(sender); + } + return sender; + }; + + var origAddStream = window.RTCPeerConnection.prototype.addStream; + window.RTCPeerConnection.prototype.addStream = function(stream) { + var pc = this; + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + + stream.getTracks().forEach(function(track) { + var alreadyExists = pc.getSenders().find(function(s) { + return s.track === track; + }); + if (alreadyExists) { + throw new DOMException('Track already exists.', + 'InvalidAccessError'); + } + }); + var existingSenders = pc.getSenders(); + origAddStream.apply(this, arguments); + var newSenders = pc.getSenders().filter(function(newSender) { + return existingSenders.indexOf(newSender) === -1; + }); + this._shimmedLocalStreams[stream.id] = [stream].concat(newSenders); + }; + + var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; + window.RTCPeerConnection.prototype.removeStream = function(stream) { + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + delete this._shimmedLocalStreams[stream.id]; + return origRemoveStream.apply(this, arguments); + }; + + var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack; + window.RTCPeerConnection.prototype.removeTrack = function(sender) { + var pc = this; + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + if (sender) { + Object.keys(this._shimmedLocalStreams).forEach(function(streamId) { + var idx = pc._shimmedLocalStreams[streamId].indexOf(sender); + if (idx !== -1) { + pc._shimmedLocalStreams[streamId].splice(idx, 1); + } + if (pc._shimmedLocalStreams[streamId].length === 1) { + delete pc._shimmedLocalStreams[streamId]; + } + }); + } + return origRemoveTrack.apply(this, arguments); + }; + }, + shimAddTrackRemoveTrack: function(window) { var browserDetails = utils.detectBrowser(window); // shim addTrack and removeTrack. if (window.RTCPeerConnection.prototype.addTrack && - browserDetails.version >= 64) { - return; + browserDetails.version >= 65) { + return this.shimAddTrackRemoveTrackWithNative(window); } // also shim pc.getLocalStreams when addTrack is shimmed @@ -2611,11 +2799,11 @@ var chromeShim = { var origGetLocalStreams = window.RTCPeerConnection.prototype .getLocalStreams; window.RTCPeerConnection.prototype.getLocalStreams = function() { - var self = this; + var pc = this; var nativeStreams = origGetLocalStreams.apply(this); - self._reverseStreams = self._reverseStreams || {}; + pc._reverseStreams = pc._reverseStreams || {}; return nativeStreams.map(function(stream) { - return self._reverseStreams[stream.id]; + return pc._reverseStreams[stream.id]; }); }; @@ -2841,7 +3029,7 @@ var chromeShim = { var browserDetails = utils.detectBrowser(window); // The RTCPeerConnection object. - if (!window.RTCPeerConnection) { + if (!window.RTCPeerConnection && window.webkitRTCPeerConnection) { window.RTCPeerConnection = function(pcConfig, pcConstraints) { // Translate iceTransportPolicy to iceTransports, // see https://code.google.com/p/webrtc/issues/detail?id=4869 @@ -2897,7 +3085,7 @@ var chromeShim = { var origGetStats = window.RTCPeerConnection.prototype.getStats; window.RTCPeerConnection.prototype.getStats = function(selector, successCallback, errorCallback) { - var self = this; + var pc = this; var args = arguments; // If selector is a function then we are in the old style stats so just @@ -2952,7 +3140,7 @@ var chromeShim = { // promise-support return new Promise(function(resolve, reject) { - origGetStats.apply(self, [ + origGetStats.apply(pc, [ function(response) { resolve(makeMapStats(fixChromeStats_(response))); }, reject]); @@ -2966,9 +3154,9 @@ var chromeShim = { var nativeMethod = window.RTCPeerConnection.prototype[method]; window.RTCPeerConnection.prototype[method] = function() { var args = arguments; - var self = this; + var pc = this; var promise = new Promise(function(resolve, reject) { - nativeMethod.apply(self, [args[0], resolve, reject]); + nativeMethod.apply(pc, [args[0], resolve, reject]); }); if (args.length < 2) { return promise; @@ -2991,12 +3179,12 @@ var chromeShim = { ['createOffer', 'createAnswer'].forEach(function(method) { var nativeMethod = window.RTCPeerConnection.prototype[method]; window.RTCPeerConnection.prototype[method] = function() { - var self = this; + var pc = this; if (arguments.length < 1 || (arguments.length === 1 && typeof arguments[0] === 'object')) { var opts = arguments.length === 1 ? arguments[0] : undefined; return new Promise(function(resolve, reject) { - nativeMethod.apply(self, [resolve, reject, opts]); + nativeMethod.apply(pc, [resolve, reject, opts]); }); } return nativeMethod.apply(this, arguments); @@ -3031,18 +3219,6 @@ var chromeShim = { } }; - -// Expose public methods. -module.exports = { - shimMediaStream: chromeShim.shimMediaStream, - shimOnTrack: chromeShim.shimOnTrack, - shimAddTrackRemoveTrack: chromeShim.shimAddTrackRemoveTrack, - shimGetSendersWithDtmf: chromeShim.shimGetSendersWithDtmf, - shimSourceObject: chromeShim.shimSourceObject, - shimPeerConnection: chromeShim.shimPeerConnection, - shimGetUserMedia: require('./getusermedia') -}; - },{"../utils.js":13,"./getusermedia":6}],6:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. @@ -3299,57 +3475,6 @@ module.exports = function(window) { var SDPUtils = require('sdp'); var utils = require('./utils'); -// Wraps the peerconnection event eventNameToWrap in a function -// which returns the modified event object. -function wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) { - if (!window.RTCPeerConnection) { - return; - } - var proto = window.RTCPeerConnection.prototype; - var nativeAddEventListener = proto.addEventListener; - proto.addEventListener = function(nativeEventName, cb) { - if (nativeEventName !== eventNameToWrap) { - return nativeAddEventListener.apply(this, arguments); - } - var wrappedCallback = function(e) { - cb(wrapper(e)); - }; - this._eventMap = this._eventMap || {}; - this._eventMap[cb] = wrappedCallback; - return nativeAddEventListener.apply(this, [nativeEventName, - wrappedCallback]); - }; - - var nativeRemoveEventListener = proto.removeEventListener; - proto.removeEventListener = function(nativeEventName, cb) { - if (nativeEventName !== eventNameToWrap || !this._eventMap - || !this._eventMap[cb]) { - return nativeRemoveEventListener.apply(this, arguments); - } - var unwrappedCb = this._eventMap[cb]; - delete this._eventMap[cb]; - return nativeRemoveEventListener.apply(this, [nativeEventName, - unwrappedCb]); - }; - - Object.defineProperty(proto, 'on' + eventNameToWrap, { - get: function() { - return this['_on' + eventNameToWrap]; - }, - set: function(cb) { - if (this['_on' + eventNameToWrap]) { - this.removeEventListener(eventNameToWrap, - this['_on' + eventNameToWrap]); - delete this['_on' + eventNameToWrap]; - } - if (cb) { - this.addEventListener(eventNameToWrap, - this['_on' + eventNameToWrap] = cb); - } - } - }); -} - module.exports = { shimRTCIceCandidate: function(window) { // foundation is arbitrarily chosen as an indicator for full support for @@ -3388,7 +3513,7 @@ module.exports = { // Hook up the augmented candidate in onicecandidate and // addEventListener('icecandidate', ...) - wrapPeerConnectionEvent(window, 'icecandidate', function(e) { + utils.wrapPeerConnectionEvent(window, 'icecandidate', function(e) { if (e.candidate) { Object.defineProperty(e, 'candidate', { value: new window.RTCIceCandidate(e.candidate), @@ -3450,6 +3575,165 @@ module.exports = { } return nativeSetAttribute.apply(this, arguments); }; + }, + + shimMaxMessageSize: function(window) { + if (window.RTCSctpTransport || !window.RTCPeerConnection) { + return; + } + var browserDetails = utils.detectBrowser(window); + + if (!('sctp' in window.RTCPeerConnection.prototype)) { + Object.defineProperty(window.RTCPeerConnection.prototype, 'sctp', { + get: function() { + return typeof this._sctp === 'undefined' ? null : this._sctp; + } + }); + } + + var sctpInDescription = function(description) { + var sections = SDPUtils.splitSections(description.sdp); + sections.shift(); + return sections.some(function(mediaSection) { + var mLine = SDPUtils.parseMLine(mediaSection); + return mLine && mLine.kind === 'application' + && mLine.protocol.indexOf('SCTP') !== -1; + }); + }; + + var getRemoteFirefoxVersion = function(description) { + // TODO: Is there a better solution for detecting Firefox? + var match = description.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/); + if (match === null || match.length < 2) { + return -1; + } + var version = parseInt(match[1], 10); + // Test for NaN (yes, this is ugly) + return version !== version ? -1 : version; + }; + + var getCanSendMaxMessageSize = function(remoteIsFirefox) { + // Every implementation we know can send at least 64 KiB. + // Note: Although Chrome is technically able to send up to 256 KiB, the + // data does not reach the other peer reliably. + // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=8419 + var canSendMaxMessageSize = 65536; + if (browserDetails.browser === 'firefox') { + if (browserDetails.version < 57) { + if (remoteIsFirefox === -1) { + // FF < 57 will send in 16 KiB chunks using the deprecated PPID + // fragmentation. + canSendMaxMessageSize = 16384; + } else { + // However, other FF (and RAWRTC) can reassemble PPID-fragmented + // messages. Thus, supporting ~2 GiB when sending. + canSendMaxMessageSize = 2147483637; + } + } else { + // Currently, all FF >= 57 will reset the remote maximum message size + // to the default value when a data channel is created at a later + // stage. :( + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831 + canSendMaxMessageSize = + browserDetails.version === 57 ? 65535 : 65536; + } + } + return canSendMaxMessageSize; + }; + + var getMaxMessageSize = function(description, remoteIsFirefox) { + // Note: 65536 bytes is the default value from the SDP spec. Also, + // every implementation we know supports receiving 65536 bytes. + var maxMessageSize = 65536; + + // FF 57 has a slightly incorrect default remote max message size, so + // we need to adjust it here to avoid a failure when sending. + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1425697 + if (browserDetails.browser === 'firefox' + && browserDetails.version === 57) { + maxMessageSize = 65535; + } + + var match = SDPUtils.matchPrefix(description.sdp, 'a=max-message-size:'); + if (match.length > 0) { + maxMessageSize = parseInt(match[0].substr(19), 10); + } else if (browserDetails.browser === 'firefox' && + remoteIsFirefox !== -1) { + // If the maximum message size is not present in the remote SDP and + // both local and remote are Firefox, the remote peer can receive + // ~2 GiB. + maxMessageSize = 2147483637; + } + return maxMessageSize; + }; + + var origSetRemoteDescription = + window.RTCPeerConnection.prototype.setRemoteDescription; + window.RTCPeerConnection.prototype.setRemoteDescription = function() { + var pc = this; + pc._sctp = null; + + if (sctpInDescription(arguments[0])) { + // Check if the remote is FF. + var isFirefox = getRemoteFirefoxVersion(arguments[0]); + + // Get the maximum message size the local peer is capable of sending + var canSendMMS = getCanSendMaxMessageSize(isFirefox); + + // Get the maximum message size of the remote peer. + var remoteMMS = getMaxMessageSize(arguments[0], isFirefox); + + // Determine final maximum message size + var maxMessageSize; + if (canSendMMS === 0 && remoteMMS === 0) { + maxMessageSize = Number.POSITIVE_INFINITY; + } else if (canSendMMS === 0 || remoteMMS === 0) { + maxMessageSize = Math.max(canSendMMS, remoteMMS); + } else { + maxMessageSize = Math.min(canSendMMS, remoteMMS); + } + + // Create a dummy RTCSctpTransport object and the 'maxMessageSize' + // attribute. + var sctp = {}; + Object.defineProperty(sctp, 'maxMessageSize', { + get: function() { + return maxMessageSize; + } + }); + pc._sctp = sctp; + } + + return origSetRemoteDescription.apply(pc, arguments); + }; + }, + + shimSendThrowTypeError: function(window) { + // Note: Although Firefox >= 57 has a native implementation, the maximum + // message size can be reset for all data channels at a later stage. + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831 + + var origCreateDataChannel = + window.RTCPeerConnection.prototype.createDataChannel; + window.RTCPeerConnection.prototype.createDataChannel = function() { + var pc = this; + var dataChannel = origCreateDataChannel.apply(pc, arguments); + var origDataChannelSend = dataChannel.send; + + // Patch 'send' method + dataChannel.send = function() { + var dc = this; + var data = arguments[0]; + var length = data.length || data.size || data.byteLength; + if (length > pc.sctp.maxMessageSize) { + throw new DOMException('Message too large (can send a maximum of ' + + pc.sctp.maxMessageSize + ' bytes)', 'TypeError'); + } + return origDataChannelSend.apply(dc, arguments); + }; + + return dataChannel; + }; } }; @@ -3584,7 +3868,8 @@ module.exports = function(window) { var utils = require('../utils'); -var firefoxShim = { +module.exports = { + shimGetUserMedia: require('./getusermedia'), shimOnTrack: function(window) { if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in window.RTCPeerConnection.prototype)) { @@ -3789,15 +4074,6 @@ var firefoxShim = { } }; -// Expose public methods. -module.exports = { - shimOnTrack: firefoxShim.shimOnTrack, - shimSourceObject: firefoxShim.shimSourceObject, - shimPeerConnection: firefoxShim.shimPeerConnection, - shimRemoveStream: firefoxShim.shimRemoveStream, - shimGetUserMedia: require('./getusermedia') -}; - },{"../utils":13,"./getusermedia":11}],11:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. @@ -4020,13 +4296,7 @@ module.exports = function(window) { 'use strict'; var utils = require('../utils'); -var safariShim = { - // TODO: DrAlex, should be here, double check against LayoutTests - - // TODO: once the back-end for the mac port is done, add. - // TODO: check for webkitGTK+ - // shimPeerConnection: function() { }, - +module.exports = { shimLocalStreamsAPI: function(window) { if (typeof window !== 'object' || !window.RTCPeerConnection) { return; @@ -4068,9 +4338,9 @@ var safariShim = { if (this._localStreams.indexOf(stream) === -1) { this._localStreams.push(stream); } - var self = this; + var pc = this; stream.getTracks().forEach(function(track) { - _addTrack.call(self, track, stream); + _addTrack.call(pc, track, stream); }); }; @@ -4095,11 +4365,11 @@ var safariShim = { return; } this._localStreams.splice(index, 1); - var self = this; + var pc = this; var tracks = stream.getTracks(); this.getSenders().forEach(function(sender) { if (tracks.indexOf(sender.track) !== -1) { - self.removeTrack(sender); + pc.removeTrack(sender); } }); }; @@ -4120,24 +4390,26 @@ var safariShim = { return this._onaddstream; }, set: function(f) { + var pc = this; if (this._onaddstream) { this.removeEventListener('addstream', this._onaddstream); this.removeEventListener('track', this._onaddstreampoly); } this.addEventListener('addstream', this._onaddstream = f); this.addEventListener('track', this._onaddstreampoly = function(e) { - var stream = e.streams[0]; - if (!this._remoteStreams) { - this._remoteStreams = []; - } - if (this._remoteStreams.indexOf(stream) >= 0) { - return; - } - this._remoteStreams.push(stream); - var event = new Event('addstream'); - event.stream = e.streams[0]; - this.dispatchEvent(event); - }.bind(this)); + e.streams.forEach(function(stream) { + if (!pc._remoteStreams) { + pc._remoteStreams = []; + } + if (pc._remoteStreams.indexOf(stream) >= 0) { + return; + } + pc._remoteStreams.push(stream); + var event = new Event('addstream'); + event.stream = stream; + pc.dispatchEvent(event); + }); + }); } }); } @@ -4277,9 +4549,17 @@ var safariShim = { }); if (offerOptions.offerToReceiveAudio === false && audioTransceiver) { if (audioTransceiver.direction === 'sendrecv') { - audioTransceiver.setDirection('sendonly'); + if (audioTransceiver.setDirection) { + audioTransceiver.setDirection('sendonly'); + } else { + audioTransceiver.direction = 'sendonly'; + } } else if (audioTransceiver.direction === 'recvonly') { - audioTransceiver.setDirection('inactive'); + if (audioTransceiver.setDirection) { + audioTransceiver.setDirection('inactive'); + } else { + audioTransceiver.direction = 'inactive'; + } } } else if (offerOptions.offerToReceiveAudio === true && !audioTransceiver) { @@ -4306,19 +4586,6 @@ var safariShim = { } }; -// Expose public methods. -module.exports = { - shimCallbacksAPI: safariShim.shimCallbacksAPI, - shimLocalStreamsAPI: safariShim.shimLocalStreamsAPI, - shimRemoteStreamsAPI: safariShim.shimRemoteStreamsAPI, - shimGetUserMedia: safariShim.shimGetUserMedia, - shimRTCIceServerUrls: safariShim.shimRTCIceServerUrls, - shimTrackEventTransceiver: safariShim.shimTrackEventTransceiver, - shimCreateOfferLegacy: safariShim.shimCreateOfferLegacy - // TODO - // shimPeerConnection: safariShim.shimPeerConnection -}; - },{"../utils":13}],13:[function(require,module,exports){ /* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. @@ -4333,8 +4600,74 @@ module.exports = { var logDisabled_ = true; var deprecationWarnings_ = true; +/** + * Extract browser version out of the provided user agent string. + * + * @param {!string} uastring userAgent string. + * @param {!string} expr Regular expression used as match criteria. + * @param {!number} pos position in the version string to be returned. + * @return {!number} browser version. + */ +function extractVersion(uastring, expr, pos) { + var match = uastring.match(expr); + return match && match.length >= pos && parseInt(match[pos], 10); +} + +// Wraps the peerconnection event eventNameToWrap in a function +// which returns the modified event object. +function wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) { + if (!window.RTCPeerConnection) { + return; + } + var proto = window.RTCPeerConnection.prototype; + var nativeAddEventListener = proto.addEventListener; + proto.addEventListener = function(nativeEventName, cb) { + if (nativeEventName !== eventNameToWrap) { + return nativeAddEventListener.apply(this, arguments); + } + var wrappedCallback = function(e) { + cb(wrapper(e)); + }; + this._eventMap = this._eventMap || {}; + this._eventMap[cb] = wrappedCallback; + return nativeAddEventListener.apply(this, [nativeEventName, + wrappedCallback]); + }; + + var nativeRemoveEventListener = proto.removeEventListener; + proto.removeEventListener = function(nativeEventName, cb) { + if (nativeEventName !== eventNameToWrap || !this._eventMap + || !this._eventMap[cb]) { + return nativeRemoveEventListener.apply(this, arguments); + } + var unwrappedCb = this._eventMap[cb]; + delete this._eventMap[cb]; + return nativeRemoveEventListener.apply(this, [nativeEventName, + unwrappedCb]); + }; + + Object.defineProperty(proto, 'on' + eventNameToWrap, { + get: function() { + return this['_on' + eventNameToWrap]; + }, + set: function(cb) { + if (this['_on' + eventNameToWrap]) { + this.removeEventListener(eventNameToWrap, + this['_on' + eventNameToWrap]); + delete this['_on' + eventNameToWrap]; + } + if (cb) { + this.addEventListener(eventNameToWrap, + this['_on' + eventNameToWrap] = cb); + } + } + }); +} + // Utility methods. -var utils = { +module.exports = { + extractVersion: extractVersion, + wrapPeerConnectionEvent: wrapPeerConnectionEvent, disableLog: function(bool) { if (typeof bool !== 'boolean') { return new Error('Argument type: ' + typeof bool + @@ -4380,19 +4713,6 @@ var utils = { ' instead.'); }, - /** - * Extract browser version out of the provided user agent string. - * - * @param {!string} uastring userAgent string. - * @param {!string} expr Regular expression used as match criteria. - * @param {!number} pos position in the version string to be returned. - * @return {!number} browser version. - */ - extractVersion: function(uastring, expr, pos) { - var match = uastring.match(expr); - return match && match.length >= pos && parseInt(match[pos], 10); - }, - /** * Browser detector. * @@ -4413,38 +4733,25 @@ var utils = { return result; } - // Firefox. - if (navigator.mozGetUserMedia) { + if (navigator.mozGetUserMedia) { // Firefox. result.browser = 'firefox'; - result.version = this.extractVersion(navigator.userAgent, + result.version = extractVersion(navigator.userAgent, /Firefox\/(\d+)\./, 1); } else if (navigator.webkitGetUserMedia) { - // Chrome, Chromium, Webview, Opera, all use the chrome shim for now - if (window.webkitRTCPeerConnection) { - result.browser = 'chrome'; - result.version = this.extractVersion(navigator.userAgent, + // Chrome, Chromium, Webview, Opera. + // Version matches Chrome/WebRTC version. + result.browser = 'chrome'; + result.version = extractVersion(navigator.userAgent, /Chrom(e|ium)\/(\d+)\./, 2); - } else { // Safari (in an unpublished version) or unknown webkit-based. - if (navigator.userAgent.match(/Version\/(\d+).(\d+)/)) { - result.browser = 'safari'; - result.version = this.extractVersion(navigator.userAgent, - /AppleWebKit\/(\d+)\./, 1); - } else { // unknown webkit-based browser. - result.browser = 'Unsupported webkit-based browser ' + - 'with GUM support but no WebRTC support.'; - return result; - } - } } else if (navigator.mediaDevices && navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) { // Edge. result.browser = 'edge'; - result.version = this.extractVersion(navigator.userAgent, + result.version = extractVersion(navigator.userAgent, /Edge\/(\d+).(\d+)$/, 2); } else if (navigator.mediaDevices && - navigator.userAgent.match(/AppleWebKit\/(\d+)\./)) { - // Safari, with webkitGetUserMedia removed. + navigator.userAgent.match(/AppleWebKit\/(\d+)\./)) { // Safari. result.browser = 'safari'; - result.version = this.extractVersion(navigator.userAgent, + result.version = extractVersion(navigator.userAgent, /AppleWebKit\/(\d+)\./, 1); } else { // Default fallthrough: not supported. result.browser = 'Not a supported browser.'; @@ -4452,19 +4759,7 @@ var utils = { } return result; - }, - -}; - -// Export. -module.exports = { - log: utils.log, - deprecated: utils.deprecated, - disableLog: utils.disableLog, - disableWarnings: utils.disableWarnings, - extractVersion: utils.extractVersion, - shimCreateObjectURL: utils.shimCreateObjectURL, - detectBrowser: utils.detectBrowser.bind(utils) + } }; },{}]},{},[3])(3) diff --git a/html5/verto/video_demo-live_canvas/js/verto-min.js b/html5/verto/video_demo-live_canvas/js/verto-min.js index fdf5432fa5..78f8bc450e 100644 --- a/html5/verto/video_demo-live_canvas/js/verto-min.js +++ b/html5/verto/video_demo-live_canvas/js/verto-min.js @@ -307,7 +307,7 @@ navigator.getUserMedia({audio:(has_audio>0?true:false),video:(has_video>0?true:f navigator.mediaDevices.enumerateDevices().then(checkTypes).catch(handleError);};$.verto.refreshDevices=function(runtime){checkDevices(runtime);} $.verto.init=function(obj,runtime){if(!obj){obj={};} if(!obj.skipPermCheck&&!obj.skipDeviceCheck){$.FSRTC.checkPerms(function(status){checkDevices(runtime);},true,true);}else if(obj.skipPermCheck&&!obj.skipDeviceCheck){checkDevices(runtime);}else if(!obj.skipPermCheck&&obj.skipDeviceCheck){$.FSRTC.checkPerms(function(status){runtime(status);},true,true);}else{runtime(null);}} -$.verto.genUUID=function(){return generateGUID();}})(jQuery);(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.adapter=f()}})(function(){var define,module,exports;return(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=14393&&url.indexOf('?transport=udp')===-1;});delete server.url;server.urls=isString?urls[0]:urls;return!!urls.length;} -return false;});} +return url.indexOf('stun:')===0&&edgeVersion>=14393&&url.indexOf('?transport=udp')===-1;});delete server.url;server.urls=isString?urls[0]:urls;return!!urls.length;}});} function getCommonCapabilities(localCapabilities,remoteCapabilities){var commonCapabilities={codecs:[],headerExtensions:[],fecMechanisms:[]};var findCodecByPayloadType=function(pt,codecs){pt=parseInt(pt,10);for(var i=0;i0;i--){this._iceGatherers=new window.RTCIceGatherer({iceServers:config.iceServers,gatherPolicy:config.iceTransportPolicy});}}else{config.iceCandidatePoolSize=0;} -this._config=config;this.transceivers=[];this._sdpSessionId=SDPUtils.generateSessionId();this._sdpSessionVersion=0;this._dtlsRole=undefined;};RTCPeerConnection.prototype._emitGatheringStateChange=function(){var event=new Event('icegatheringstatechange');this.dispatchEvent(event);if(typeof this.onicegatheringstatechange==='function'){this.onicegatheringstatechange(event);}};RTCPeerConnection.prototype.getConfiguration=function(){return this._config;};RTCPeerConnection.prototype.getLocalStreams=function(){return this.localStreams;};RTCPeerConnection.prototype.getRemoteStreams=function(){return this.remoteStreams;};RTCPeerConnection.prototype._createTransceiver=function(kind){var hasBundleTransport=this.transceivers.length>0;var transceiver={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:kind,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,wantReceive:true};if(this.usingBundle&&hasBundleTransport){transceiver.iceTransport=this.transceivers[0].iceTransport;transceiver.dtlsTransport=this.transceivers[0].dtlsTransport;}else{var transports=this._createIceAndDtlsTransports();transceiver.iceTransport=transports.iceTransport;transceiver.dtlsTransport=transports.dtlsTransport;} -this.transceivers.push(transceiver);return transceiver;};RTCPeerConnection.prototype.addTrack=function(track,stream){var transceiver;for(var i=0;i0;var transceiver={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:kind,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:true};if(this.usingBundle&&hasBundleTransport){transceiver.iceTransport=this.transceivers[0].iceTransport;transceiver.dtlsTransport=this.transceivers[0].dtlsTransport;}else{var transports=this._createIceAndDtlsTransports();transceiver.iceTransport=transports.iceTransport;transceiver.dtlsTransport=transports.dtlsTransport;} +this.transceivers.push(transceiver);return transceiver;};RTCPeerConnection.prototype.addTrack=function(track,stream){var alreadyExists=this.transceivers.find(function(s){return s.track===track;});if(alreadyExists){throw makeError('InvalidAccessError','Track already exists.');} +if(this.signalingState==='closed'){throw makeError('InvalidStateError','Attempted to call addTrack on a closed peerconnection.');} +var transceiver;for(var i=0;i=15025){stream.getTracks().forEach(function(track){self.addTrack(track,stream);});}else{var clonedStream=stream.clone();stream.getTracks().forEach(function(track,idx){var clonedTrack=clonedStream.getTracks()[idx];track.addEventListener('enabled',function(event){clonedTrack.enabled=event.enabled;});});clonedStream.getTracks().forEach(function(track){self.addTrack(track,clonedStream);});}};RTCPeerConnection.prototype.removeStream=function(stream){var idx=this.localStreams.indexOf(stream);if(idx>-1){this.localStreams.splice(idx,1);this._maybeFireNegotiationNeeded();}};RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpSender;}).map(function(transceiver){return transceiver.rtpSender;});};RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpReceiver;}).map(function(transceiver){return transceiver.rtpReceiver;});};RTCPeerConnection.prototype._createIceGatherer=function(sdpMLineIndex,usingBundle){var self=this;if(usingBundle&&sdpMLineIndex>0){return this.transceivers[0].iceGatherer;}else if(this._iceGatherers.length){return this._iceGatherers.shift();} -var iceGatherer=new window.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});Object.defineProperty(iceGatherer,'state',{value:'new',writable:true});this.transceivers[sdpMLineIndex].candidates=[];this.transceivers[sdpMLineIndex].bufferCandidates=function(event){var end=!event.candidate||Object.keys(event.candidate).length===0;iceGatherer.state=end?'completed':'gathering';if(self.transceivers[sdpMLineIndex].candidates!==null){self.transceivers[sdpMLineIndex].candidates.push(event.candidate);}};iceGatherer.addEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);return iceGatherer;};RTCPeerConnection.prototype._gather=function(mid,sdpMLineIndex){var self=this;var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer.onlocalcandidate){return;} -var candidates=this.transceivers[sdpMLineIndex].candidates;this.transceivers[sdpMLineIndex].candidates=null;iceGatherer.removeEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);iceGatherer.onlocalcandidate=function(evt){if(self.usingBundle&&sdpMLineIndex>0){return;} +transceiver.track=track;transceiver.stream=stream;transceiver.rtpSender=new window.RTCRtpSender(track,transceiver.dtlsTransport);return transceiver.rtpSender;};RTCPeerConnection.prototype.addStream=function(stream){var pc=this;if(edgeVersion>=15025){stream.getTracks().forEach(function(track){pc.addTrack(track,stream);});}else{var clonedStream=stream.clone();stream.getTracks().forEach(function(track,idx){var clonedTrack=clonedStream.getTracks()[idx];track.addEventListener('enabled',function(event){clonedTrack.enabled=event.enabled;});});clonedStream.getTracks().forEach(function(track){pc.addTrack(track,clonedStream);});}};RTCPeerConnection.prototype.removeTrack=function(sender){if(!(sender instanceof window.RTCRtpSender)){throw new TypeError('Argument 1 of RTCPeerConnection.removeTrack '+'does not implement interface RTCRtpSender.');} +var transceiver=this.transceivers.find(function(t){return t.rtpSender===sender;});if(!transceiver){throw makeError('InvalidAccessError','Sender was not created by this connection.');} +var stream=transceiver.stream;transceiver.rtpSender.stop();transceiver.rtpSender=null;transceiver.track=null;transceiver.stream=null;var localStreams=this.transceivers.map(function(t){return t.stream;});if(localStreams.indexOf(stream)===-1&&this.localStreams.indexOf(stream)>-1){this.localStreams.splice(this.localStreams.indexOf(stream),1);} +this._maybeFireNegotiationNeeded();};RTCPeerConnection.prototype.removeStream=function(stream){var pc=this;stream.getTracks().forEach(function(track){var sender=pc.getSenders().find(function(s){return s.track===track;});if(sender){pc.removeTrack(sender);}});};RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpSender;}).map(function(transceiver){return transceiver.rtpSender;});};RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpReceiver;}).map(function(transceiver){return transceiver.rtpReceiver;});};RTCPeerConnection.prototype._createIceGatherer=function(sdpMLineIndex,usingBundle){var pc=this;if(usingBundle&&sdpMLineIndex>0){return this.transceivers[0].iceGatherer;}else if(this._iceGatherers.length){return this._iceGatherers.shift();} +var iceGatherer=new window.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});Object.defineProperty(iceGatherer,'state',{value:'new',writable:true});this.transceivers[sdpMLineIndex].candidates=[];this.transceivers[sdpMLineIndex].bufferCandidates=function(event){var end=!event.candidate||Object.keys(event.candidate).length===0;iceGatherer.state=end?'completed':'gathering';if(pc.transceivers[sdpMLineIndex].candidates!==null){pc.transceivers[sdpMLineIndex].candidates.push(event.candidate);}};iceGatherer.addEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);return iceGatherer;};RTCPeerConnection.prototype._gather=function(mid,sdpMLineIndex){var pc=this;var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer.onlocalcandidate){return;} +var candidates=this.transceivers[sdpMLineIndex].candidates;this.transceivers[sdpMLineIndex].candidates=null;iceGatherer.removeEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);iceGatherer.onlocalcandidate=function(evt){if(pc.usingBundle&&sdpMLineIndex>0){return;} var event=new Event('icecandidate');event.candidate={sdpMid:mid,sdpMLineIndex:sdpMLineIndex};var cand=evt.candidate;var end=!cand||Object.keys(cand).length===0;if(end){if(iceGatherer.state==='new'||iceGatherer.state==='gathering'){iceGatherer.state='completed';}}else{if(iceGatherer.state==='new'){iceGatherer.state='gathering';} cand.component=1;event.candidate.candidate=SDPUtils.writeCandidate(cand);} -var sections=SDPUtils.splitSections(self.localDescription.sdp);if(!end){sections[event.candidate.sdpMLineIndex+1]+='a='+event.candidate.candidate+'\r\n';}else{sections[event.candidate.sdpMLineIndex+1]+='a=end-of-candidates\r\n';} -self.localDescription.sdp=sections.join('');var complete=self.transceivers.every(function(transceiver){return transceiver.iceGatherer&&transceiver.iceGatherer.state==='completed';});if(self.iceGatheringState!=='gathering'){self.iceGatheringState='gathering';self._emitGatheringStateChange();} -if(!end){self.dispatchEvent(event);if(typeof self.onicecandidate==='function'){self.onicecandidate(event);}} -if(complete){self.dispatchEvent(new Event('icecandidate'));if(typeof self.onicecandidate==='function'){self.onicecandidate(new Event('icecandidate'));} -self.iceGatheringState='complete';self._emitGatheringStateChange();}};window.setTimeout(function(){candidates.forEach(function(candidate){var e=new Event('RTCIceGatherEvent');e.candidate=candidate;iceGatherer.onlocalcandidate(e);});},0);};RTCPeerConnection.prototype._createIceAndDtlsTransports=function(){var self=this;var iceTransport=new window.RTCIceTransport(null);iceTransport.onicestatechange=function(){self._updateConnectionState();};var dtlsTransport=new window.RTCDtlsTransport(iceTransport);dtlsTransport.ondtlsstatechange=function(){self._updateConnectionState();};dtlsTransport.onerror=function(){Object.defineProperty(dtlsTransport,'state',{value:'failed',writable:true});self._updateConnectionState();};return{iceTransport:iceTransport,dtlsTransport:dtlsTransport};};RTCPeerConnection.prototype._disposeIceAndDtlsTransports=function(sdpMLineIndex){var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer){delete iceGatherer.onlocalcandidate;delete this.transceivers[sdpMLineIndex].iceGatherer;} +var sections=SDPUtils.splitSections(pc.localDescription.sdp);if(!end){sections[event.candidate.sdpMLineIndex+1]+='a='+event.candidate.candidate+'\r\n';}else{sections[event.candidate.sdpMLineIndex+1]+='a=end-of-candidates\r\n';} +pc.localDescription.sdp=sections.join('');var complete=pc.transceivers.every(function(transceiver){return transceiver.iceGatherer&&transceiver.iceGatherer.state==='completed';});if(pc.iceGatheringState!=='gathering'){pc.iceGatheringState='gathering';pc._emitGatheringStateChange();} +if(!end){pc._dispatchEvent('icecandidate',event);} +if(complete){pc._dispatchEvent('icecandidate',new Event('icecandidate'));pc.iceGatheringState='complete';pc._emitGatheringStateChange();}};window.setTimeout(function(){candidates.forEach(function(candidate){var e=new Event('RTCIceGatherEvent');e.candidate=candidate;iceGatherer.onlocalcandidate(e);});},0);};RTCPeerConnection.prototype._createIceAndDtlsTransports=function(){var pc=this;var iceTransport=new window.RTCIceTransport(null);iceTransport.onicestatechange=function(){pc._updateConnectionState();};var dtlsTransport=new window.RTCDtlsTransport(iceTransport);dtlsTransport.ondtlsstatechange=function(){pc._updateConnectionState();};dtlsTransport.onerror=function(){Object.defineProperty(dtlsTransport,'state',{value:'failed',writable:true});pc._updateConnectionState();};return{iceTransport:iceTransport,dtlsTransport:dtlsTransport};};RTCPeerConnection.prototype._disposeIceAndDtlsTransports=function(sdpMLineIndex){var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer){delete iceGatherer.onlocalcandidate;delete this.transceivers[sdpMLineIndex].iceGatherer;} var iceTransport=this.transceivers[sdpMLineIndex].iceTransport;if(iceTransport){delete iceTransport.onicestatechange;delete this.transceivers[sdpMLineIndex].iceTransport;} var dtlsTransport=this.transceivers[sdpMLineIndex].dtlsTransport;if(dtlsTransport){delete dtlsTransport.ondtlsstatechange;delete dtlsTransport.onerror;delete this.transceivers[sdpMLineIndex].dtlsTransport;}};RTCPeerConnection.prototype._transceive=function(transceiver,send,recv){var params=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);if(send&&transceiver.rtpSender){params.encodings=transceiver.sendEncodingParameters;params.rtcp={cname:SDPUtils.localCName,compound:transceiver.rtcpParameters.compound};if(transceiver.recvEncodingParameters.length){params.rtcp.ssrc=transceiver.recvEncodingParameters[0].ssrc;} transceiver.rtpSender.send(params);} if(recv&&transceiver.rtpReceiver&¶ms.codecs.length>0){if(transceiver.kind==='video'&&transceiver.recvEncodingParameters&&edgeVersion<15019){transceiver.recvEncodingParameters.forEach(function(p){delete p.rtx;});} -params.encodings=transceiver.recvEncodingParameters;params.rtcp={cname:transceiver.rtcpParameters.cname,compound:transceiver.rtcpParameters.compound};if(transceiver.sendEncodingParameters.length){params.rtcp.ssrc=transceiver.sendEncodingParameters[0].ssrc;} -transceiver.rtpReceiver.receive(params);}};RTCPeerConnection.prototype.setLocalDescription=function(description){var self=this;var args=arguments;if(!isActionAllowedInSignalingState('setLocalDescription',description.type,this.signalingState)){return new Promise(function(resolve,reject){var e=new Error('Can not set local '+description.type+' in state '+self.signalingState);e.name='InvalidStateError';if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[e]);} -reject(e);});} -var sections;var sessionpart;if(description.type==='offer'){sections=SDPUtils.splitSections(description.sdp);sessionpart=sections.shift();sections.forEach(function(mediaSection,sdpMLineIndex){var caps=SDPUtils.parseRtpParameters(mediaSection);self.transceivers[sdpMLineIndex].localCapabilities=caps;});this.transceivers.forEach(function(transceiver,sdpMLineIndex){self._gather(transceiver.mid,sdpMLineIndex);});}else if(description.type==='answer'){sections=SDPUtils.splitSections(self.remoteDescription.sdp);sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;sections.forEach(function(mediaSection,sdpMLineIndex){var transceiver=self.transceivers[sdpMLineIndex];var iceGatherer=transceiver.iceGatherer;var iceTransport=transceiver.iceTransport;var dtlsTransport=transceiver.dtlsTransport;var localCapabilities=transceiver.localCapabilities;var remoteCapabilities=transceiver.remoteCapabilities;var rejected=SDPUtils.isRejected(mediaSection)&&!SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===1;if(!rejected&&!transceiver.isDatachannel){var remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);var remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);if(isIceLite){remoteDtlsParameters.role='server';} -if(!self.usingBundle||sdpMLineIndex===0){self._gather(transceiver.mid,sdpMLineIndex);if(iceTransport.state==='new'){iceTransport.start(iceGatherer,remoteIceParameters,isIceLite?'controlling':'controlled');} +if(transceiver.recvEncodingParameters.length){params.encodings=transceiver.recvEncodingParameters;} +params.rtcp={compound:transceiver.rtcpParameters.compound};if(transceiver.rtcpParameters.cname){params.rtcp.cname=transceiver.rtcpParameters.cname;} +if(transceiver.sendEncodingParameters.length){params.rtcp.ssrc=transceiver.sendEncodingParameters[0].ssrc;} +transceiver.rtpReceiver.receive(params);}};RTCPeerConnection.prototype.setLocalDescription=function(description){var pc=this;if(!isActionAllowedInSignalingState('setLocalDescription',description.type,this.signalingState)||this._isClosed){return Promise.reject(makeError('InvalidStateError','Can not set local '+description.type+' in state '+pc.signalingState));} +var sections;var sessionpart;if(description.type==='offer'){sections=SDPUtils.splitSections(description.sdp);sessionpart=sections.shift();sections.forEach(function(mediaSection,sdpMLineIndex){var caps=SDPUtils.parseRtpParameters(mediaSection);pc.transceivers[sdpMLineIndex].localCapabilities=caps;});this.transceivers.forEach(function(transceiver,sdpMLineIndex){pc._gather(transceiver.mid,sdpMLineIndex);});}else if(description.type==='answer'){sections=SDPUtils.splitSections(pc.remoteDescription.sdp);sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;sections.forEach(function(mediaSection,sdpMLineIndex){var transceiver=pc.transceivers[sdpMLineIndex];var iceGatherer=transceiver.iceGatherer;var iceTransport=transceiver.iceTransport;var dtlsTransport=transceiver.dtlsTransport;var localCapabilities=transceiver.localCapabilities;var remoteCapabilities=transceiver.remoteCapabilities;var rejected=SDPUtils.isRejected(mediaSection)&&SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===0;if(!rejected&&!transceiver.isDatachannel){var remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);var remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);if(isIceLite){remoteDtlsParameters.role='server';} +if(!pc.usingBundle||sdpMLineIndex===0){pc._gather(transceiver.mid,sdpMLineIndex);if(iceTransport.state==='new'){iceTransport.start(iceGatherer,remoteIceParameters,isIceLite?'controlling':'controlled');} if(dtlsTransport.state==='new'){dtlsTransport.start(remoteDtlsParameters);}} -var params=getCommonCapabilities(localCapabilities,remoteCapabilities);self._transceive(transceiver,params.codecs.length>0,false);}});} +var params=getCommonCapabilities(localCapabilities,remoteCapabilities);pc._transceive(transceiver,params.codecs.length>0,false);}});} this.localDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-local-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} -var cb=arguments.length>1&&typeof arguments[1]==='function'&&arguments[1];return new Promise(function(resolve){if(cb){cb.apply(null);} -resolve();});};RTCPeerConnection.prototype.setRemoteDescription=function(description){var self=this;var args=arguments;if(!isActionAllowedInSignalingState('setRemoteDescription',description.type,this.signalingState)){return new Promise(function(resolve,reject){var e=new Error('Can not set remote '+description.type+' in state '+self.signalingState);e.name='InvalidStateError';if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[e]);} -reject(e);});} +return Promise.resolve();};RTCPeerConnection.prototype.setRemoteDescription=function(description){var pc=this;if(!isActionAllowedInSignalingState('setRemoteDescription',description.type,this.signalingState)||this._isClosed){return Promise.reject(makeError('InvalidStateError','Can not set remote '+description.type+' in state '+pc.signalingState));} var streams={};this.remoteStreams.forEach(function(stream){streams[stream.id]=stream;});var receiverList=[];var sections=SDPUtils.splitSections(description.sdp);var sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;var usingBundle=SDPUtils.matchPrefix(sessionpart,'a=group:BUNDLE ').length>0;this.usingBundle=usingBundle;var iceOptions=SDPUtils.matchPrefix(sessionpart,'a=ice-options:')[0];if(iceOptions){this.canTrickleIceCandidates=iceOptions.substr(14).split(' ').indexOf('trickle')>=0;}else{this.canTrickleIceCandidates=false;} -sections.forEach(function(mediaSection,sdpMLineIndex){var lines=SDPUtils.splitLines(mediaSection);var kind=SDPUtils.getKind(mediaSection);var rejected=SDPUtils.isRejected(mediaSection)&&!SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===1;var protocol=lines[0].substr(2).split(' ')[2];var direction=SDPUtils.getDirection(mediaSection,sessionpart);var remoteMsid=SDPUtils.parseMsid(mediaSection);var mid=SDPUtils.getMid(mediaSection)||SDPUtils.generateIdentifier();if(kind==='application'&&protocol==='DTLS/SCTP'){self.transceivers[sdpMLineIndex]={mid:mid,isDatachannel:true};return;} +sections.forEach(function(mediaSection,sdpMLineIndex){var lines=SDPUtils.splitLines(mediaSection);var kind=SDPUtils.getKind(mediaSection);var rejected=SDPUtils.isRejected(mediaSection)&&SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===0;var protocol=lines[0].substr(2).split(' ')[2];var direction=SDPUtils.getDirection(mediaSection,sessionpart);var remoteMsid=SDPUtils.parseMsid(mediaSection);var mid=SDPUtils.getMid(mediaSection)||SDPUtils.generateIdentifier();if(kind==='application'&&protocol==='DTLS/SCTP'){pc.transceivers[sdpMLineIndex]={mid:mid,isDatachannel:true};return;} var transceiver;var iceGatherer;var iceTransport;var dtlsTransport;var rtpReceiver;var sendEncodingParameters;var recvEncodingParameters;var localCapabilities;var track;var remoteCapabilities=SDPUtils.parseRtpParameters(mediaSection);var remoteIceParameters;var remoteDtlsParameters;if(!rejected){remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);remoteDtlsParameters.role='client';} -recvEncodingParameters=SDPUtils.parseRtpEncodingParameters(mediaSection);var rtcpParameters=SDPUtils.parseRtcpParameters(mediaSection);var isComplete=SDPUtils.matchPrefix(mediaSection,'a=end-of-candidates',sessionpart).length>0;var cands=SDPUtils.matchPrefix(mediaSection,'a=candidate:').map(function(cand){return SDPUtils.parseCandidate(cand);}).filter(function(cand){return cand.component===1;});if((description.type==='offer'||description.type==='answer')&&!rejected&&usingBundle&&sdpMLineIndex>0&&self.transceivers[sdpMLineIndex]){self._disposeIceAndDtlsTransports(sdpMLineIndex);self.transceivers[sdpMLineIndex].iceGatherer=self.transceivers[0].iceGatherer;self.transceivers[sdpMLineIndex].iceTransport=self.transceivers[0].iceTransport;self.transceivers[sdpMLineIndex].dtlsTransport=self.transceivers[0].dtlsTransport;if(self.transceivers[sdpMLineIndex].rtpSender){self.transceivers[sdpMLineIndex].rtpSender.setTransport(self.transceivers[0].dtlsTransport);} -if(self.transceivers[sdpMLineIndex].rtpReceiver){self.transceivers[sdpMLineIndex].rtpReceiver.setTransport(self.transceivers[0].dtlsTransport);}} -if(description.type==='offer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex]||self._createTransceiver(kind);transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=self._createIceGatherer(sdpMLineIndex,usingBundle);} +recvEncodingParameters=SDPUtils.parseRtpEncodingParameters(mediaSection);var rtcpParameters=SDPUtils.parseRtcpParameters(mediaSection);var isComplete=SDPUtils.matchPrefix(mediaSection,'a=end-of-candidates',sessionpart).length>0;var cands=SDPUtils.matchPrefix(mediaSection,'a=candidate:').map(function(cand){return SDPUtils.parseCandidate(cand);}).filter(function(cand){return cand.component===1;});if((description.type==='offer'||description.type==='answer')&&!rejected&&usingBundle&&sdpMLineIndex>0&&pc.transceivers[sdpMLineIndex]){pc._disposeIceAndDtlsTransports(sdpMLineIndex);pc.transceivers[sdpMLineIndex].iceGatherer=pc.transceivers[0].iceGatherer;pc.transceivers[sdpMLineIndex].iceTransport=pc.transceivers[0].iceTransport;pc.transceivers[sdpMLineIndex].dtlsTransport=pc.transceivers[0].dtlsTransport;if(pc.transceivers[sdpMLineIndex].rtpSender){pc.transceivers[sdpMLineIndex].rtpSender.setTransport(pc.transceivers[0].dtlsTransport);} +if(pc.transceivers[sdpMLineIndex].rtpReceiver){pc.transceivers[sdpMLineIndex].rtpReceiver.setTransport(pc.transceivers[0].dtlsTransport);}} +if(description.type==='offer'&&!rejected){transceiver=pc.transceivers[sdpMLineIndex]||pc._createTransceiver(kind);transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=pc._createIceGatherer(sdpMLineIndex,usingBundle);} if(cands.length&&transceiver.iceTransport.state==='new'){if(isComplete&&(!usingBundle||sdpMLineIndex===0)){transceiver.iceTransport.setRemoteCandidates(cands);}else{cands.forEach(function(candidate){maybeAddCandidate(transceiver.iceTransport,candidate);});}} localCapabilities=window.RTCRtpReceiver.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} -sendEncodingParameters=transceiver.sendEncodingParameters||[{ssrc:(2*sdpMLineIndex+2)*1001}];var isNewTrack=false;if(direction==='sendrecv'||direction==='sendonly'){isNewTrack=!transceiver.rtpReceiver;rtpReceiver=transceiver.rtpReceiver||new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);if(isNewTrack){var stream;track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();Object.defineProperty(streams[remoteMsid.stream],'id',{get:function(){return remoteMsid.stream;}});} +sendEncodingParameters=transceiver.sendEncodingParameters||[{ssrc:(2*sdpMLineIndex+2)*1001}];var isNewTrack=false;if(direction==='sendrecv'||direction==='sendonly'){isNewTrack=!transceiver.rtpReceiver;rtpReceiver=transceiver.rtpReceiver||new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);if(isNewTrack){var stream;track=rtpReceiver.track;if(remoteMsid&&remoteMsid.stream==='-'){}else if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();Object.defineProperty(streams[remoteMsid.stream],'id',{get:function(){return remoteMsid.stream;}});} Object.defineProperty(track,'id',{get:function(){return remoteMsid.track;}});stream=streams[remoteMsid.stream];}else{if(!streams.default){streams.default=new window.MediaStream();} stream=streams.default;} -stream.addTrack(track);receiverList.push([track,rtpReceiver,stream]);}} -transceiver.localCapabilities=localCapabilities;transceiver.remoteCapabilities=remoteCapabilities;transceiver.rtpReceiver=rtpReceiver;transceiver.rtcpParameters=rtcpParameters;transceiver.sendEncodingParameters=sendEncodingParameters;transceiver.recvEncodingParameters=recvEncodingParameters;self._transceive(self.transceivers[sdpMLineIndex],false,isNewTrack);}else if(description.type==='answer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex];iceGatherer=transceiver.iceGatherer;iceTransport=transceiver.iceTransport;dtlsTransport=transceiver.dtlsTransport;rtpReceiver=transceiver.rtpReceiver;sendEncodingParameters=transceiver.sendEncodingParameters;localCapabilities=transceiver.localCapabilities;self.transceivers[sdpMLineIndex].recvEncodingParameters=recvEncodingParameters;self.transceivers[sdpMLineIndex].remoteCapabilities=remoteCapabilities;self.transceivers[sdpMLineIndex].rtcpParameters=rtcpParameters;if(cands.length&&iceTransport.state==='new'){if((isIceLite||isComplete)&&(!usingBundle||sdpMLineIndex===0)){iceTransport.setRemoteCandidates(cands);}else{cands.forEach(function(candidate){maybeAddCandidate(transceiver.iceTransport,candidate);});}} +if(stream){addTrackToStreamAndFireEvent(track,stream);transceiver.associatedRemoteMediaStreams.push(stream);} +receiverList.push([track,rtpReceiver,stream]);}}else if(transceiver.rtpReceiver&&transceiver.rtpReceiver.track){transceiver.associatedRemoteMediaStreams.forEach(function(s){var nativeTrack=s.getTracks().find(function(t){return t.id===transceiver.rtpReceiver.track.id;});if(nativeTrack){removeTrackFromStreamAndFireEvent(nativeTrack,s);}});transceiver.associatedRemoteMediaStreams=[];} +transceiver.localCapabilities=localCapabilities;transceiver.remoteCapabilities=remoteCapabilities;transceiver.rtpReceiver=rtpReceiver;transceiver.rtcpParameters=rtcpParameters;transceiver.sendEncodingParameters=sendEncodingParameters;transceiver.recvEncodingParameters=recvEncodingParameters;pc._transceive(pc.transceivers[sdpMLineIndex],false,isNewTrack);}else if(description.type==='answer'&&!rejected){transceiver=pc.transceivers[sdpMLineIndex];iceGatherer=transceiver.iceGatherer;iceTransport=transceiver.iceTransport;dtlsTransport=transceiver.dtlsTransport;rtpReceiver=transceiver.rtpReceiver;sendEncodingParameters=transceiver.sendEncodingParameters;localCapabilities=transceiver.localCapabilities;pc.transceivers[sdpMLineIndex].recvEncodingParameters=recvEncodingParameters;pc.transceivers[sdpMLineIndex].remoteCapabilities=remoteCapabilities;pc.transceivers[sdpMLineIndex].rtcpParameters=rtcpParameters;if(cands.length&&iceTransport.state==='new'){if((isIceLite||isComplete)&&(!usingBundle||sdpMLineIndex===0)){iceTransport.setRemoteCandidates(cands);}else{cands.forEach(function(candidate){maybeAddCandidate(transceiver.iceTransport,candidate);});}} if(!usingBundle||sdpMLineIndex===0){if(iceTransport.state==='new'){iceTransport.start(iceGatherer,remoteIceParameters,'controlling');} if(dtlsTransport.state==='new'){dtlsTransport.start(remoteDtlsParameters);}} -self._transceive(transceiver,direction==='sendrecv'||direction==='recvonly',direction==='sendrecv'||direction==='sendonly');if(rtpReceiver&&(direction==='sendrecv'||direction==='sendonly')){track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();} -streams[remoteMsid.stream].addTrack(track);receiverList.push([track,rtpReceiver,streams[remoteMsid.stream]]);}else{if(!streams.default){streams.default=new window.MediaStream();} -streams.default.addTrack(track);receiverList.push([track,rtpReceiver,streams.default]);}}else{delete transceiver.rtpReceiver;}}});if(this._dtlsRole===undefined){this._dtlsRole=description.type==='offer'?'active':'passive';} +pc._transceive(transceiver,direction==='sendrecv'||direction==='recvonly',direction==='sendrecv'||direction==='sendonly');if(rtpReceiver&&(direction==='sendrecv'||direction==='sendonly')){track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();} +addTrackToStreamAndFireEvent(track,streams[remoteMsid.stream]);receiverList.push([track,rtpReceiver,streams[remoteMsid.stream]]);}else{if(!streams.default){streams.default=new window.MediaStream();} +addTrackToStreamAndFireEvent(track,streams.default);receiverList.push([track,rtpReceiver,streams.default]);}}else{delete transceiver.rtpReceiver;}}});if(this._dtlsRole===undefined){this._dtlsRole=description.type==='offer'?'active':'passive';} this.remoteDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-remote-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} -Object.keys(streams).forEach(function(sid){var stream=streams[sid];if(stream.getTracks().length){if(self.remoteStreams.indexOf(stream)===-1){self.remoteStreams.push(stream);var event=new Event('addstream');event.stream=stream;window.setTimeout(function(){self.dispatchEvent(event);if(typeof self.onaddstream==='function'){self.onaddstream(event);}});} +Object.keys(streams).forEach(function(sid){var stream=streams[sid];if(stream.getTracks().length){if(pc.remoteStreams.indexOf(stream)===-1){pc.remoteStreams.push(stream);var event=new Event('addstream');event.stream=stream;window.setTimeout(function(){pc._dispatchEvent('addstream',event);});} receiverList.forEach(function(item){var track=item[0];var receiver=item[1];if(stream.id!==item[2].id){return;} -var trackEvent=new Event('track');trackEvent.track=track;trackEvent.receiver=receiver;trackEvent.transceiver={receiver:receiver};trackEvent.streams=[stream];window.setTimeout(function(){self.dispatchEvent(trackEvent);if(typeof self.ontrack==='function'){self.ontrack(trackEvent);}});});}});window.setTimeout(function(){if(!(self&&self.transceivers)){return;} -self.transceivers.forEach(function(transceiver){if(transceiver.iceTransport&&transceiver.iceTransport.state==='new'&&transceiver.iceTransport.getRemoteCandidates().length>0){console.warn('Timeout for addRemoteCandidate. Consider sending '+'an end-of-candidates notification');transceiver.iceTransport.addRemoteCandidate({});}});},4000);return new Promise(function(resolve){if(args.length>1&&typeof args[1]==='function'){args[1].apply(null);} -resolve();});};RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(transceiver){if(transceiver.iceTransport){transceiver.iceTransport.stop();} +fireAddTrack(pc,track,receiver,[stream]);});}});receiverList.forEach(function(item){if(item[2]){return;} +fireAddTrack(pc,item[0],item[1],[]);});window.setTimeout(function(){if(!(pc&&pc.transceivers)){return;} +pc.transceivers.forEach(function(transceiver){if(transceiver.iceTransport&&transceiver.iceTransport.state==='new'&&transceiver.iceTransport.getRemoteCandidates().length>0){console.warn('Timeout for addRemoteCandidate. Consider sending '+'an end-of-candidates notification');transceiver.iceTransport.addRemoteCandidate({});}});},4000);return Promise.resolve();};RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(transceiver){if(transceiver.iceTransport){transceiver.iceTransport.stop();} if(transceiver.dtlsTransport){transceiver.dtlsTransport.stop();} if(transceiver.rtpSender){transceiver.rtpSender.stop();} -if(transceiver.rtpReceiver){transceiver.rtpReceiver.stop();}});this._updateSignalingState('closed');};RTCPeerConnection.prototype._updateSignalingState=function(newState){this.signalingState=newState;var event=new Event('signalingstatechange');this.dispatchEvent(event);if(typeof this.onsignalingstatechange==='function'){this.onsignalingstatechange(event);}};RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var self=this;if(this.signalingState!=='stable'||this.needNegotiation===true){return;} -this.needNegotiation=true;window.setTimeout(function(){if(self.needNegotiation===false){return;} -self.needNegotiation=false;var event=new Event('negotiationneeded');self.dispatchEvent(event);if(typeof self.onnegotiationneeded==='function'){self.onnegotiationneeded(event);}},0);};RTCPeerConnection.prototype._updateConnectionState=function(){var newState;var states={'new':0,closed:0,connecting:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};this.transceivers.forEach(function(transceiver){states[transceiver.iceTransport.state]++;states[transceiver.dtlsTransport.state]++;});states.connected+=states.completed;newState='new';if(states.failed>0){newState='failed';}else if(states.connecting>0||states.checking>0){newState='connecting';}else if(states.disconnected>0){newState='disconnected';}else if(states.new>0){newState='new';}else if(states.connected>0||states.completed>0){newState='connected';} -if(newState!==this.iceConnectionState){this.iceConnectionState=newState;var event=new Event('iceconnectionstatechange');this.dispatchEvent(event);if(typeof this.oniceconnectionstatechange==='function'){this.oniceconnectionstatechange(event);}}};RTCPeerConnection.prototype.createOffer=function(){var self=this;var args=arguments;var offerOptions;if(arguments.length===1&&typeof arguments[0]!=='function'){offerOptions=arguments[0];}else if(arguments.length===3){offerOptions=arguments[2];} -var numAudioTracks=this.transceivers.filter(function(t){return t.kind==='audio';}).length;var numVideoTracks=this.transceivers.filter(function(t){return t.kind==='video';}).length;if(offerOptions){if(offerOptions.mandatory||offerOptions.optional){throw new TypeError('Legacy mandatory/optional constraints not supported.');} +if(transceiver.rtpReceiver){transceiver.rtpReceiver.stop();}});this._isClosed=true;this._updateSignalingState('closed');};RTCPeerConnection.prototype._updateSignalingState=function(newState){this.signalingState=newState;var event=new Event('signalingstatechange');this._dispatchEvent('signalingstatechange',event);};RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var pc=this;if(this.signalingState!=='stable'||this.needNegotiation===true){return;} +this.needNegotiation=true;window.setTimeout(function(){if(pc.needNegotiation===false){return;} +pc.needNegotiation=false;var event=new Event('negotiationneeded');pc._dispatchEvent('negotiationneeded',event);},0);};RTCPeerConnection.prototype._updateConnectionState=function(){var newState;var states={'new':0,closed:0,connecting:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};this.transceivers.forEach(function(transceiver){states[transceiver.iceTransport.state]++;states[transceiver.dtlsTransport.state]++;});states.connected+=states.completed;newState='new';if(states.failed>0){newState='failed';}else if(states.connecting>0||states.checking>0){newState='connecting';}else if(states.disconnected>0){newState='disconnected';}else if(states.new>0){newState='new';}else if(states.connected>0||states.completed>0){newState='connected';} +if(newState!==this.iceConnectionState){this.iceConnectionState=newState;var event=new Event('iceconnectionstatechange');this._dispatchEvent('iceconnectionstatechange',event);}};RTCPeerConnection.prototype.createOffer=function(){var pc=this;if(this._isClosed){return Promise.reject(makeError('InvalidStateError','Can not call createOffer after close'));} +var numAudioTracks=this.transceivers.filter(function(t){return t.kind==='audio';}).length;var numVideoTracks=this.transceivers.filter(function(t){return t.kind==='video';}).length;var offerOptions=arguments[0];if(offerOptions){if(offerOptions.mandatory||offerOptions.optional){throw new TypeError('Legacy mandatory/optional constraints not supported.');} if(offerOptions.offerToReceiveAudio!==undefined){if(offerOptions.offerToReceiveAudio===true){numAudioTracks=1;}else if(offerOptions.offerToReceiveAudio===false){numAudioTracks=0;}else{numAudioTracks=offerOptions.offerToReceiveAudio;}} if(offerOptions.offerToReceiveVideo!==undefined){if(offerOptions.offerToReceiveVideo===true){numVideoTracks=1;}else if(offerOptions.offerToReceiveVideo===false){numVideoTracks=0;}else{numVideoTracks=offerOptions.offerToReceiveVideo;}}} this.transceivers.forEach(function(transceiver){if(transceiver.kind==='audio'){numAudioTracks--;if(numAudioTracks<0){transceiver.wantReceive=false;}}else if(transceiver.kind==='video'){numVideoTracks--;if(numVideoTracks<0){transceiver.wantReceive=false;}}});while(numAudioTracks>0||numVideoTracks>0){if(numAudioTracks>0){this._createTransceiver('audio');numAudioTracks--;} if(numVideoTracks>0){this._createTransceiver('video');numVideoTracks--;}} -var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);this.transceivers.forEach(function(transceiver,sdpMLineIndex){var track=transceiver.track;var kind=transceiver.kind;var mid=SDPUtils.generateIdentifier();transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=self._createIceGatherer(sdpMLineIndex,self.usingBundle);} +var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);this.transceivers.forEach(function(transceiver,sdpMLineIndex){var track=transceiver.track;var kind=transceiver.kind;var mid=SDPUtils.generateIdentifier();transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=pc._createIceGatherer(sdpMLineIndex,pc.usingBundle);} var localCapabilities=window.RTCRtpSender.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} localCapabilities.codecs.forEach(function(codec){if(codec.name==='H264'&&codec.parameters['level-asymmetry-allowed']===undefined){codec.parameters['level-asymmetry-allowed']='1';}});var sendEncodingParameters=transceiver.sendEncodingParameters||[{ssrc:(2*sdpMLineIndex+1)*1001}];if(track){if(edgeVersion>=15019&&kind==='video'&&!sendEncodingParameters[0].rtx){sendEncodingParameters[0].rtx={ssrc:sendEncodingParameters[0].ssrc+1};}} if(transceiver.wantReceive){transceiver.rtpReceiver=new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);} transceiver.localCapabilities=localCapabilities;transceiver.sendEncodingParameters=sendEncodingParameters;});if(this._config.bundlePolicy!=='max-compat'){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} -sdp+='a=ice-options:trickle\r\n';this.transceivers.forEach(function(transceiver,sdpMLineIndex){sdp+=writeMediaSection(transceiver,transceiver.localCapabilities,'offer',transceiver.stream,self._dtlsRole);sdp+='a=rtcp-rsize\r\n';if(transceiver.iceGatherer&&self.iceGatheringState!=='new'&&(sdpMLineIndex===0||!self.usingBundle)){transceiver.iceGatherer.getLocalCandidates().forEach(function(cand){cand.component=1;sdp+='a='+SDPUtils.writeCandidate(cand)+'\r\n';});if(transceiver.iceGatherer.state==='completed'){sdp+='a=end-of-candidates\r\n';}}});var desc=new window.RTCSessionDescription({type:'offer',sdp:sdp});return new Promise(function(resolve){if(args.length>0&&typeof args[0]==='function'){args[0].apply(null,[desc]);resolve();return;} -resolve(desc);});};RTCPeerConnection.prototype.createAnswer=function(){var self=this;var args=arguments;var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);if(this.usingBundle){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} +sdp+='a=ice-options:trickle\r\n';this.transceivers.forEach(function(transceiver,sdpMLineIndex){sdp+=writeMediaSection(transceiver,transceiver.localCapabilities,'offer',transceiver.stream,pc._dtlsRole);sdp+='a=rtcp-rsize\r\n';if(transceiver.iceGatherer&&pc.iceGatheringState!=='new'&&(sdpMLineIndex===0||!pc.usingBundle)){transceiver.iceGatherer.getLocalCandidates().forEach(function(cand){cand.component=1;sdp+='a='+SDPUtils.writeCandidate(cand)+'\r\n';});if(transceiver.iceGatherer.state==='completed'){sdp+='a=end-of-candidates\r\n';}}});var desc=new window.RTCSessionDescription({type:'offer',sdp:sdp});return Promise.resolve(desc);};RTCPeerConnection.prototype.createAnswer=function(){var pc=this;if(this._isClosed){return Promise.reject(makeError('InvalidStateError','Can not call createAnswer after close'));} +var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);if(this.usingBundle){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} var mediaSectionsInOffer=SDPUtils.splitSections(this.remoteDescription.sdp).length-1;this.transceivers.forEach(function(transceiver,sdpMLineIndex){if(sdpMLineIndex+1>mediaSectionsInOffer){return;} if(transceiver.isDatachannel){sdp+='m=application 0 DTLS/SCTP 5000\r\n'+'c=IN IP4 0.0.0.0\r\n'+'a=mid:'+transceiver.mid+'\r\n';return;} if(transceiver.stream){var localTrack;if(transceiver.kind==='audio'){localTrack=transceiver.stream.getAudioTracks()[0];}else if(transceiver.kind==='video'){localTrack=transceiver.stream.getVideoTracks()[0];} if(localTrack){if(edgeVersion>=15019&&transceiver.kind==='video'&&!transceiver.sendEncodingParameters[0].rtx){transceiver.sendEncodingParameters[0].rtx={ssrc:transceiver.sendEncodingParameters[0].ssrc+1};}}} var commonCapabilities=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);var hasRtx=commonCapabilities.codecs.filter(function(c){return c.name.toLowerCase()==='rtx';}).length;if(!hasRtx&&transceiver.sendEncodingParameters[0].rtx){delete transceiver.sendEncodingParameters[0].rtx;} -sdp+=writeMediaSection(transceiver,commonCapabilities,'answer',transceiver.stream,self._dtlsRole);if(transceiver.rtcpParameters&&transceiver.rtcpParameters.reducedSize){sdp+='a=rtcp-rsize\r\n';}});var desc=new window.RTCSessionDescription({type:'answer',sdp:sdp});return new Promise(function(resolve){if(args.length>0&&typeof args[0]==='function'){args[0].apply(null,[desc]);resolve();return;} -resolve(desc);});};RTCPeerConnection.prototype.addIceCandidate=function(candidate){var err;var sections;if(!candidate||candidate.candidate===''){for(var j=0;j0?SDPUtils.parseCandidate(candidate.candidate):{};if(cand.protocol==='tcp'&&(cand.port===0||cand.port===9)){return Promise.resolve();} if(cand.component&&cand.component!==1){return Promise.resolve();} -if(sdpMLineIndex===0||(sdpMLineIndex>0&&transceiver.iceTransport!==this.transceivers[0].iceTransport)){if(!maybeAddCandidate(transceiver.iceTransport,cand)){err=new Error('Can not add ICE candidate');err.name='OperationError';}} -if(!err){var candidateString=candidate.candidate.trim();if(candidateString.indexOf('a=')===0){candidateString=candidateString.substr(2);} +if(sdpMLineIndex===0||(sdpMLineIndex>0&&transceiver.iceTransport!==this.transceivers[0].iceTransport)){if(!maybeAddCandidate(transceiver.iceTransport,cand)){return Promise.reject(makeError('OperationError','Can not add ICE candidate'));}} +var candidateString=candidate.candidate.trim();if(candidateString.indexOf('a=')===0){candidateString=candidateString.substr(2);} sections=SDPUtils.splitSections(this.remoteDescription.sdp);sections[sdpMLineIndex+1]+='a='+ (cand.type?candidateString:'end-of-candidates') -+'\r\n';this.remoteDescription.sdp=sections.join('');}}else{err=new Error('Can not add ICE candidate');err.name='OperationError';}} -var args=arguments;return new Promise(function(resolve,reject){if(err){if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[err]);} -reject(err);}else{if(args.length>1&&typeof args[1]==='function'){args[1].apply(null);} -resolve();}});};RTCPeerConnection.prototype.getStats=function(){var promises=[];this.transceivers.forEach(function(transceiver){['rtpSender','rtpReceiver','iceGatherer','iceTransport','dtlsTransport'].forEach(function(method){if(transceiver[method]){promises.push(transceiver[method].getStats());}});});var cb=arguments.length>1&&typeof arguments[1]==='function'&&arguments[1];var fixStatsType=function(stat){return{inboundrtp:'inbound-rtp',outboundrtp:'outbound-rtp',candidatepair:'candidate-pair',localcandidate:'local-candidate',remotecandidate:'remote-candidate'}[stat.type]||stat.type;};return new Promise(function(resolve){var results=new Map();Promise.all(promises).then(function(res){res.forEach(function(result){Object.keys(result).forEach(function(id){result[id].type=fixStatsType(result[id]);results.set(id,result[id]);});});if(cb){cb.apply(null,results);} -resolve(results);});});};return RTCPeerConnection;};},{"sdp":2}],2:[function(require,module,exports){'use strict';var SDPUtils={};SDPUtils.generateIdentifier=function(){return Math.random().toString(36).substr(2,10);};SDPUtils.localCName=SDPUtils.generateIdentifier();SDPUtils.splitLines=function(blob){return blob.trim().split('\n').map(function(line){return line.trim();});};SDPUtils.splitSections=function(blob){var parts=blob.split('\nm=');return parts.map(function(part,index){return(index>0?'m='+part:part).trim()+'\r\n';});};SDPUtils.matchPrefix=function(blob,prefix){return SDPUtils.splitLines(blob).filter(function(line){return line.indexOf(prefix)===0;});};SDPUtils.parseCandidate=function(line){var parts;if(line.indexOf('a=candidate:')===0){parts=line.substring(12).split(' ');}else{parts=line.substring(10).split(' ');} ++'\r\n';this.remoteDescription.sdp=sections.join('');}else{return Promise.reject(makeError('OperationError','Can not add ICE candidate'));}} +return Promise.resolve();};RTCPeerConnection.prototype.getStats=function(){var promises=[];this.transceivers.forEach(function(transceiver){['rtpSender','rtpReceiver','iceGatherer','iceTransport','dtlsTransport'].forEach(function(method){if(transceiver[method]){promises.push(transceiver[method].getStats());}});});var fixStatsType=function(stat){return{inboundrtp:'inbound-rtp',outboundrtp:'outbound-rtp',candidatepair:'candidate-pair',localcandidate:'local-candidate',remotecandidate:'remote-candidate'}[stat.type]||stat.type;};return new Promise(function(resolve){var results=new Map();Promise.all(promises).then(function(res){res.forEach(function(result){Object.keys(result).forEach(function(id){result[id].type=fixStatsType(result[id]);results.set(id,result[id]);});});resolve(results);});});};var methods=['createOffer','createAnswer'];methods.forEach(function(method){var nativeMethod=RTCPeerConnection.prototype[method];RTCPeerConnection.prototype[method]=function(){var args=arguments;if(typeof args[0]==='function'||typeof args[1]==='function'){return nativeMethod.apply(this,[arguments[2]]).then(function(description){if(typeof args[0]==='function'){args[0].apply(null,[description]);}},function(error){if(typeof args[1]==='function'){args[1].apply(null,[error]);}});} +return nativeMethod.apply(this,arguments);};});methods=['setLocalDescription','setRemoteDescription','addIceCandidate'];methods.forEach(function(method){var nativeMethod=RTCPeerConnection.prototype[method];RTCPeerConnection.prototype[method]=function(){var args=arguments;if(typeof args[1]==='function'||typeof args[2]==='function'){return nativeMethod.apply(this,arguments).then(function(){if(typeof args[1]==='function'){args[1].apply(null);}},function(error){if(typeof args[2]==='function'){args[2].apply(null,[error]);}});} +return nativeMethod.apply(this,arguments);};});['getStats'].forEach(function(method){var nativeMethod=RTCPeerConnection.prototype[method];RTCPeerConnection.prototype[method]=function(){var args=arguments;if(typeof args[1]==='function'){return nativeMethod.apply(this,arguments).then(function(){if(typeof args[1]==='function'){args[1].apply(null);}});} +return nativeMethod.apply(this,arguments);};});return RTCPeerConnection;};},{"sdp":2}],2:[function(require,module,exports){'use strict';var SDPUtils={};SDPUtils.generateIdentifier=function(){return Math.random().toString(36).substr(2,10);};SDPUtils.localCName=SDPUtils.generateIdentifier();SDPUtils.splitLines=function(blob){return blob.trim().split('\n').map(function(line){return line.trim();});};SDPUtils.splitSections=function(blob){var parts=blob.split('\nm=');return parts.map(function(part,index){return(index>0?'m='+part:part).trim()+'\r\n';});};SDPUtils.matchPrefix=function(blob,prefix){return SDPUtils.splitLines(blob).filter(function(line){return line.indexOf(prefix)===0;});};SDPUtils.parseCandidate=function(line){var parts;if(line.indexOf('a=candidate:')===0){parts=line.substring(12).split(' ');}else{parts=line.substring(10).split(' ');} var candidate={foundation:parts[0],component:parseInt(parts[1],10),protocol:parts[2].toLowerCase(),priority:parseInt(parts[3],10),ip:parts[4],port:parseInt(parts[5],10),type:parts[7]};for(var i=8;i=64){return;} -var origGetLocalStreams=window.RTCPeerConnection.prototype.getLocalStreams;window.RTCPeerConnection.prototype.getLocalStreams=function(){var self=this;var nativeStreams=origGetLocalStreams.apply(this);self._reverseStreams=self._reverseStreams||{};return nativeStreams.map(function(stream){return self._reverseStreams[stream.id];});};var origAddStream=window.RTCPeerConnection.prototype.addStream;window.RTCPeerConnection.prototype.addStream=function(stream){var pc=this;pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};stream.getTracks().forEach(function(track){var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');}});if(!pc._reverseStreams[stream.id]){var newStream=new window.MediaStream(stream.getTracks());pc._streams[stream.id]=newStream;pc._reverseStreams[newStream.id]=stream;stream=newStream;} +self.src=URL.createObjectURL(stream);});}});}}},shimAddTrackRemoveTrackWithNative:function(window){window.RTCPeerConnection.prototype.getLocalStreams=function(){var pc=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{};return Object.keys(this._shimmedLocalStreams).map(function(streamId){return pc._shimmedLocalStreams[streamId][0];});};var origAddTrack=window.RTCPeerConnection.prototype.addTrack;window.RTCPeerConnection.prototype.addTrack=function(track,stream){if(!stream){return origAddTrack.apply(this,arguments);} +this._shimmedLocalStreams=this._shimmedLocalStreams||{};var sender=origAddTrack.apply(this,arguments);if(!this._shimmedLocalStreams[stream.id]){this._shimmedLocalStreams[stream.id]=[stream,sender];}else if(this._shimmedLocalStreams[stream.id].indexOf(sender)===-1){this._shimmedLocalStreams[stream.id].push(sender);} +return sender;};var origAddStream=window.RTCPeerConnection.prototype.addStream;window.RTCPeerConnection.prototype.addStream=function(stream){var pc=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{};stream.getTracks().forEach(function(track){var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');}});var existingSenders=pc.getSenders();origAddStream.apply(this,arguments);var newSenders=pc.getSenders().filter(function(newSender){return existingSenders.indexOf(newSender)===-1;});this._shimmedLocalStreams[stream.id]=[stream].concat(newSenders);};var origRemoveStream=window.RTCPeerConnection.prototype.removeStream;window.RTCPeerConnection.prototype.removeStream=function(stream){this._shimmedLocalStreams=this._shimmedLocalStreams||{};delete this._shimmedLocalStreams[stream.id];return origRemoveStream.apply(this,arguments);};var origRemoveTrack=window.RTCPeerConnection.prototype.removeTrack;window.RTCPeerConnection.prototype.removeTrack=function(sender){var pc=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{};if(sender){Object.keys(this._shimmedLocalStreams).forEach(function(streamId){var idx=pc._shimmedLocalStreams[streamId].indexOf(sender);if(idx!==-1){pc._shimmedLocalStreams[streamId].splice(idx,1);} +if(pc._shimmedLocalStreams[streamId].length===1){delete pc._shimmedLocalStreams[streamId];}});} +return origRemoveTrack.apply(this,arguments);};},shimAddTrackRemoveTrack:function(window){var browserDetails=utils.detectBrowser(window);if(window.RTCPeerConnection.prototype.addTrack&&browserDetails.version>=65){return this.shimAddTrackRemoveTrackWithNative(window);} +var origGetLocalStreams=window.RTCPeerConnection.prototype.getLocalStreams;window.RTCPeerConnection.prototype.getLocalStreams=function(){var pc=this;var nativeStreams=origGetLocalStreams.apply(this);pc._reverseStreams=pc._reverseStreams||{};return nativeStreams.map(function(stream){return pc._reverseStreams[stream.id];});};var origAddStream=window.RTCPeerConnection.prototype.addStream;window.RTCPeerConnection.prototype.addStream=function(stream){var pc=this;pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};stream.getTracks().forEach(function(track){var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');}});if(!pc._reverseStreams[stream.id]){var newStream=new window.MediaStream(stream.getTracks());pc._streams[stream.id]=newStream;pc._reverseStreams[newStream.id]=stream;stream=newStream;} origAddStream.apply(pc,[stream]);};var origRemoveStream=window.RTCPeerConnection.prototype.removeStream;window.RTCPeerConnection.prototype.removeStream=function(stream){var pc=this;pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};origRemoveStream.apply(pc,[(pc._streams[stream.id]||stream)]);delete pc._reverseStreams[(pc._streams[stream.id]?pc._streams[stream.id].id:stream.id)];delete pc._streams[stream.id];};window.RTCPeerConnection.prototype.addTrack=function(track,stream){var pc=this;if(pc.signalingState==='closed'){throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.','InvalidStateError');} var streams=[].slice.call(arguments,1);if(streams.length!==1||!streams[0].getTracks().find(function(t){return t===track;})){throw new DOMException('The adapter.js addTrack polyfill only supports a single '+' stream which is associated with the specified track.','NotSupportedError');} var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');} @@ -489,20 +501,20 @@ return replaceInternalStreamId(pc,description);}});window.RTCPeerConnection.prot if(!sender._pc){throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack '+'does not implement interface RTCRtpSender.','TypeError');} var isLocal=sender._pc===pc;if(!isLocal){throw new DOMException('Sender was not created by this connection.','InvalidAccessError');} pc._streams=pc._streams||{};var stream;Object.keys(pc._streams).forEach(function(streamid){var hasTrack=pc._streams[streamid].getTracks().find(function(track){return sender.track===track;});if(hasTrack){stream=pc._streams[streamid];}});if(stream){if(stream.getTracks().length===1){pc.removeStream(pc._reverseStreams[stream.id]);}else{stream.removeTrack(sender.track);} -pc.dispatchEvent(new Event('negotiationneeded'));}};},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(!window.RTCPeerConnection){window.RTCPeerConnection=function(pcConfig,pcConstraints){logging('PeerConnection');if(pcConfig&&pcConfig.iceTransportPolicy){pcConfig.iceTransports=pcConfig.iceTransportPolicy;} +pc.dispatchEvent(new Event('negotiationneeded'));}};},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(!window.RTCPeerConnection&&window.webkitRTCPeerConnection){window.RTCPeerConnection=function(pcConfig,pcConstraints){logging('PeerConnection');if(pcConfig&&pcConfig.iceTransportPolicy){pcConfig.iceTransports=pcConfig.iceTransportPolicy;} return new window.webkitRTCPeerConnection(pcConfig,pcConstraints);};window.RTCPeerConnection.prototype=window.webkitRTCPeerConnection.prototype;if(window.webkitRTCPeerConnection.generateCertificate){Object.defineProperty(window.RTCPeerConnection,'generateCertificate',{get:function(){return window.webkitRTCPeerConnection.generateCertificate;}});}}else{var OrigPeerConnection=window.RTCPeerConnection;window.RTCPeerConnection=function(pcConfig,pcConstraints){if(pcConfig&&pcConfig.iceServers){var newIceServers=[];for(var i=0;i0&&typeof selector==='function'){return origGetStats.apply(this,arguments);} +var origGetStats=window.RTCPeerConnection.prototype.getStats;window.RTCPeerConnection.prototype.getStats=function(selector,successCallback,errorCallback){var pc=this;var args=arguments;if(arguments.length>0&&typeof selector==='function'){return origGetStats.apply(this,arguments);} if(origGetStats.length===0&&(arguments.length===0||typeof arguments[0]!=='function')){return origGetStats.apply(this,[]);} var fixChromeStats_=function(response){var standardReport={};var reports=response.result();reports.forEach(function(report){var standardStats={id:report.id,timestamp:report.timestamp,type:{localcandidate:'local-candidate',remotecandidate:'remote-candidate'}[report.type]||report.type};report.names().forEach(function(name){standardStats[name]=report.stat(name);});standardReport[standardStats.id]=standardStats;});return standardReport;};var makeMapStats=function(stats){return new Map(Object.keys(stats).map(function(key){return[key,stats[key]];}));};if(arguments.length>=2){var successCallbackWrapper_=function(response){args[1](makeMapStats(fixChromeStats_(response)));};return origGetStats.apply(this,[successCallbackWrapper_,arguments[0]]);} -return new Promise(function(resolve,reject){origGetStats.apply(self,[function(response){resolve(makeMapStats(fixChromeStats_(response)));},reject]);}).then(successCallback,errorCallback);};if(browserDetails.version<51){['setLocalDescription','setRemoteDescription','addIceCandidate'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){var args=arguments;var self=this;var promise=new Promise(function(resolve,reject){nativeMethod.apply(self,[args[0],resolve,reject]);});if(args.length<2){return promise;} +return new Promise(function(resolve,reject){origGetStats.apply(pc,[function(response){resolve(makeMapStats(fixChromeStats_(response)));},reject]);}).then(successCallback,errorCallback);};if(browserDetails.version<51){['setLocalDescription','setRemoteDescription','addIceCandidate'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){var args=arguments;var pc=this;var promise=new Promise(function(resolve,reject){nativeMethod.apply(pc,[args[0],resolve,reject]);});if(args.length<2){return promise;} return promise.then(function(){args[1].apply(null,[]);},function(err){if(args.length>=3){args[2].apply(null,[err]);}});};});} -if(browserDetails.version<52){['createOffer','createAnswer'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){var self=this;if(arguments.length<1||(arguments.length===1&&typeof arguments[0]==='object')){var opts=arguments.length===1?arguments[0]:undefined;return new Promise(function(resolve,reject){nativeMethod.apply(self,[resolve,reject,opts]);});} +if(browserDetails.version<52){['createOffer','createAnswer'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){var pc=this;if(arguments.length<1||(arguments.length===1&&typeof arguments[0]==='object')){var opts=arguments.length===1?arguments[0]:undefined;return new Promise(function(resolve,reject){nativeMethod.apply(pc,[resolve,reject,opts]);});} return nativeMethod.apply(this,arguments);};});} ['setLocalDescription','setRemoteDescription','addIceCandidate'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){arguments[0]=new((method==='addIceCandidate')?window.RTCIceCandidate:window.RTCSessionDescription)(arguments[0]);return nativeMethod.apply(this,arguments);};});var nativeAddIceCandidate=window.RTCPeerConnection.prototype.addIceCandidate;window.RTCPeerConnection.prototype.addIceCandidate=function(){if(!arguments[0]){if(arguments[1]){arguments[1].apply(null);} return Promise.resolve();} -return nativeAddIceCandidate.apply(this,arguments);};}};module.exports={shimMediaStream:chromeShim.shimMediaStream,shimOnTrack:chromeShim.shimOnTrack,shimAddTrackRemoveTrack:chromeShim.shimAddTrackRemoveTrack,shimGetSendersWithDtmf:chromeShim.shimGetSendersWithDtmf,shimSourceObject:chromeShim.shimSourceObject,shimPeerConnection:chromeShim.shimPeerConnection,shimGetUserMedia:require('./getusermedia')};},{"../utils.js":13,"./getusermedia":6}],6:[function(require,module,exports){'use strict';var utils=require('../utils.js');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var constraintsToChrome_=function(c){if(typeof c!=='object'||c.mandatory||c.optional){return c;} +return nativeAddIceCandidate.apply(this,arguments);};}};},{"../utils.js":13,"./getusermedia":6}],6:[function(require,module,exports){'use strict';var utils=require('../utils.js');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var constraintsToChrome_=function(c){if(typeof c!=='object'||c.mandatory||c.optional){return c;} var cc={};Object.keys(c).forEach(function(key){if(key==='require'||key==='advanced'||key==='mediaSource'){return;} var r=(typeof c[key]==='object')?c[key]:{ideal:c[key]};if(r.exact!==undefined&&typeof r.exact==='number'){r.min=r.max=r.exact;} var oldname_=function(prefix,name){if(prefix){return prefix+name.charAt(0).toUpperCase()+name.slice(1);} @@ -519,24 +531,29 @@ logging('chrome: '+JSON.stringify(constraints));return func(constraints);};var s if(!navigator.mediaDevices.getUserMedia){navigator.mediaDevices.getUserMedia=function(constraints){return getUserMediaPromise_(constraints);};}else{var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(cs){return shimConstraints_(cs,function(c){return origGetUserMedia(c).then(function(stream){if(c.audio&&!stream.getAudioTracks().length||c.video&&!stream.getVideoTracks().length){stream.getTracks().forEach(function(track){track.stop();});throw new DOMException('','NotFoundError');} return stream;},function(e){return Promise.reject(shimError_(e));});});};} if(typeof navigator.mediaDevices.addEventListener==='undefined'){navigator.mediaDevices.addEventListener=function(){logging('Dummy mediaDevices.addEventListener called.');};} -if(typeof navigator.mediaDevices.removeEventListener==='undefined'){navigator.mediaDevices.removeEventListener=function(){logging('Dummy mediaDevices.removeEventListener called.');};}};},{"../utils.js":13}],7:[function(require,module,exports){'use strict';var SDPUtils=require('sdp');var utils=require('./utils');function wrapPeerConnectionEvent(window,eventNameToWrap,wrapper){if(!window.RTCPeerConnection){return;} -var proto=window.RTCPeerConnection.prototype;var nativeAddEventListener=proto.addEventListener;proto.addEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap){return nativeAddEventListener.apply(this,arguments);} -var wrappedCallback=function(e){cb(wrapper(e));};this._eventMap=this._eventMap||{};this._eventMap[cb]=wrappedCallback;return nativeAddEventListener.apply(this,[nativeEventName,wrappedCallback]);};var nativeRemoveEventListener=proto.removeEventListener;proto.removeEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap||!this._eventMap||!this._eventMap[cb]){return nativeRemoveEventListener.apply(this,arguments);} -var unwrappedCb=this._eventMap[cb];delete this._eventMap[cb];return nativeRemoveEventListener.apply(this,[nativeEventName,unwrappedCb]);};Object.defineProperty(proto,'on'+eventNameToWrap,{get:function(){return this['_on'+eventNameToWrap];},set:function(cb){if(this['_on'+eventNameToWrap]){this.removeEventListener(eventNameToWrap,this['_on'+eventNameToWrap]);delete this['_on'+eventNameToWrap];} -if(cb){this.addEventListener(eventNameToWrap,this['_on'+eventNameToWrap]=cb);}}});} -module.exports={shimRTCIceCandidate:function(window){if(window.RTCIceCandidate&&'foundation'in +if(typeof navigator.mediaDevices.removeEventListener==='undefined'){navigator.mediaDevices.removeEventListener=function(){logging('Dummy mediaDevices.removeEventListener called.');};}};},{"../utils.js":13}],7:[function(require,module,exports){'use strict';var SDPUtils=require('sdp');var utils=require('./utils');module.exports={shimRTCIceCandidate:function(window){if(window.RTCIceCandidate&&'foundation'in window.RTCIceCandidate.prototype){return;} var NativeRTCIceCandidate=window.RTCIceCandidate;window.RTCIceCandidate=function(args){if(typeof args==='object'&&args.candidate&&args.candidate.indexOf('a=')===0){args=JSON.parse(JSON.stringify(args));args.candidate=args.candidate.substr(2);} -var nativeCandidate=new NativeRTCIceCandidate(args);var parsedCandidate=SDPUtils.parseCandidate(args.candidate);var augmentedCandidate=Object.assign(nativeCandidate,parsedCandidate);augmentedCandidate.toJSON=function(){return{candidate:augmentedCandidate.candidate,sdpMid:augmentedCandidate.sdpMid,sdpMLineIndex:augmentedCandidate.sdpMLineIndex,usernameFragment:augmentedCandidate.usernameFragment,};};return augmentedCandidate;};wrapPeerConnectionEvent(window,'icecandidate',function(e){if(e.candidate){Object.defineProperty(e,'candidate',{value:new window.RTCIceCandidate(e.candidate),writable:'false'});} +var nativeCandidate=new NativeRTCIceCandidate(args);var parsedCandidate=SDPUtils.parseCandidate(args.candidate);var augmentedCandidate=Object.assign(nativeCandidate,parsedCandidate);augmentedCandidate.toJSON=function(){return{candidate:augmentedCandidate.candidate,sdpMid:augmentedCandidate.sdpMid,sdpMLineIndex:augmentedCandidate.sdpMLineIndex,usernameFragment:augmentedCandidate.usernameFragment,};};return augmentedCandidate;};utils.wrapPeerConnectionEvent(window,'icecandidate',function(e){if(e.candidate){Object.defineProperty(e,'candidate',{value:new window.RTCIceCandidate(e.candidate),writable:'false'});} return e;});},shimCreateObjectURL:function(window){var URL=window&&window.URL;if(!(typeof window==='object'&&window.HTMLMediaElement&&'srcObject'in window.HTMLMediaElement.prototype&&URL.createObjectURL&&URL.revokeObjectURL)){return undefined;} var nativeCreateObjectURL=URL.createObjectURL.bind(URL);var nativeRevokeObjectURL=URL.revokeObjectURL.bind(URL);var streams=new Map(),newId=0;URL.createObjectURL=function(stream){if('getTracks'in stream){var url='polyblob:'+(++newId);streams.set(url,stream);utils.deprecated('URL.createObjectURL(stream)','elem.srcObject = stream');return url;} return nativeCreateObjectURL(stream);};URL.revokeObjectURL=function(url){nativeRevokeObjectURL(url);streams.delete(url);};var dsc=Object.getOwnPropertyDescriptor(window.HTMLMediaElement.prototype,'src');Object.defineProperty(window.HTMLMediaElement.prototype,'src',{get:function(){return dsc.get.apply(this);},set:function(url){this.srcObject=streams.get(url)||null;return dsc.set.apply(this,[url]);}});var nativeSetAttribute=window.HTMLMediaElement.prototype.setAttribute;window.HTMLMediaElement.prototype.setAttribute=function(){if(arguments.length===2&&(''+arguments[0]).toLowerCase()==='src'){this.srcObject=streams.get(arguments[1])||null;} -return nativeSetAttribute.apply(this,arguments);};}};},{"./utils":13,"sdp":2}],8:[function(require,module,exports){'use strict';var utils=require('../utils');var shimRTCPeerConnection=require('rtcpeerconnection-shim');module.exports={shimGetUserMedia:require('./getusermedia'),shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(window.RTCIceGatherer){if(!window.RTCIceCandidate){window.RTCIceCandidate=function(args){return args;};} +return nativeSetAttribute.apply(this,arguments);};},shimMaxMessageSize:function(window){if(window.RTCSctpTransport||!window.RTCPeerConnection){return;} +var browserDetails=utils.detectBrowser(window);if(!('sctp'in window.RTCPeerConnection.prototype)){Object.defineProperty(window.RTCPeerConnection.prototype,'sctp',{get:function(){return typeof this._sctp==='undefined'?null:this._sctp;}});} +var sctpInDescription=function(description){var sections=SDPUtils.splitSections(description.sdp);sections.shift();return sections.some(function(mediaSection){var mLine=SDPUtils.parseMLine(mediaSection);return mLine&&mLine.kind==='application'&&mLine.protocol.indexOf('SCTP')!==-1;});};var getRemoteFirefoxVersion=function(description){var match=description.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(match===null||match.length<2){return-1;} +var version=parseInt(match[1],10);return version!==version?-1:version;};var getCanSendMaxMessageSize=function(remoteIsFirefox){var canSendMaxMessageSize=65536;if(browserDetails.browser==='firefox'){if(browserDetails.version<57){if(remoteIsFirefox===-1){canSendMaxMessageSize=16384;}else{canSendMaxMessageSize=2147483637;}}else{canSendMaxMessageSize=browserDetails.version===57?65535:65536;}} +return canSendMaxMessageSize;};var getMaxMessageSize=function(description,remoteIsFirefox){var maxMessageSize=65536;if(browserDetails.browser==='firefox'&&browserDetails.version===57){maxMessageSize=65535;} +var match=SDPUtils.matchPrefix(description.sdp,'a=max-message-size:');if(match.length>0){maxMessageSize=parseInt(match[0].substr(19),10);}else if(browserDetails.browser==='firefox'&&remoteIsFirefox!==-1){maxMessageSize=2147483637;} +return maxMessageSize;};var origSetRemoteDescription=window.RTCPeerConnection.prototype.setRemoteDescription;window.RTCPeerConnection.prototype.setRemoteDescription=function(){var pc=this;pc._sctp=null;if(sctpInDescription(arguments[0])){var isFirefox=getRemoteFirefoxVersion(arguments[0]);var canSendMMS=getCanSendMaxMessageSize(isFirefox);var remoteMMS=getMaxMessageSize(arguments[0],isFirefox);var maxMessageSize;if(canSendMMS===0&&remoteMMS===0){maxMessageSize=Number.POSITIVE_INFINITY;}else if(canSendMMS===0||remoteMMS===0){maxMessageSize=Math.max(canSendMMS,remoteMMS);}else{maxMessageSize=Math.min(canSendMMS,remoteMMS);} +var sctp={};Object.defineProperty(sctp,'maxMessageSize',{get:function(){return maxMessageSize;}});pc._sctp=sctp;} +return origSetRemoteDescription.apply(pc,arguments);};},shimSendThrowTypeError:function(window){var origCreateDataChannel=window.RTCPeerConnection.prototype.createDataChannel;window.RTCPeerConnection.prototype.createDataChannel=function(){var pc=this;var dataChannel=origCreateDataChannel.apply(pc,arguments);var origDataChannelSend=dataChannel.send;dataChannel.send=function(){var dc=this;var data=arguments[0];var length=data.length||data.size||data.byteLength;if(length>pc.sctp.maxMessageSize){throw new DOMException('Message too large (can send a maximum of '+ +pc.sctp.maxMessageSize+' bytes)','TypeError');} +return origDataChannelSend.apply(dc,arguments);};return dataChannel;};}};},{"./utils":13,"sdp":2}],8:[function(require,module,exports){'use strict';var utils=require('../utils');var shimRTCPeerConnection=require('rtcpeerconnection-shim');module.exports={shimGetUserMedia:require('./getusermedia'),shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(window.RTCIceGatherer){if(!window.RTCIceCandidate){window.RTCIceCandidate=function(args){return args;};} if(!window.RTCSessionDescription){window.RTCSessionDescription=function(args){return args;};} if(browserDetails.version<15025){var origMSTEnabled=Object.getOwnPropertyDescriptor(window.MediaStreamTrack.prototype,'enabled');Object.defineProperty(window.MediaStreamTrack.prototype,'enabled',{set:function(value){origMSTEnabled.set.call(this,value);var ev=new Event('enabled');ev.enabled=value;this.dispatchEvent(ev);}});}} if(window.RTCRtpSender&&!('dtmf'in window.RTCRtpSender.prototype)){Object.defineProperty(window.RTCRtpSender.prototype,'dtmf',{get:function(){if(this._dtmf===undefined){if(this.track.kind==='audio'){this._dtmf=new window.RTCDtmfSender(this);}else if(this.track.kind==='video'){this._dtmf=null;}} return this._dtmf;}});} -window.RTCPeerConnection=shimRTCPeerConnection(window,browserDetails.version);},shimReplaceTrack:function(window){if(window.RTCRtpSender&&!('replaceTrack'in window.RTCRtpSender.prototype)){window.RTCRtpSender.prototype.replaceTrack=window.RTCRtpSender.prototype.setTrack;}}};},{"../utils":13,"./getusermedia":9,"rtcpeerconnection-shim":1}],9:[function(require,module,exports){'use strict';module.exports=function(window){var navigator=window&&window.navigator;var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError'}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name;}};};var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(c){return origGetUserMedia(c).catch(function(e){return Promise.reject(shimError_(e));});};};},{}],10:[function(require,module,exports){'use strict';var utils=require('../utils');var firefoxShim={shimOnTrack:function(window){if(typeof window==='object'&&window.RTCPeerConnection&&!('ontrack'in +window.RTCPeerConnection=shimRTCPeerConnection(window,browserDetails.version);},shimReplaceTrack:function(window){if(window.RTCRtpSender&&!('replaceTrack'in window.RTCRtpSender.prototype)){window.RTCRtpSender.prototype.replaceTrack=window.RTCRtpSender.prototype.setTrack;}}};},{"../utils":13,"./getusermedia":9,"rtcpeerconnection-shim":1}],9:[function(require,module,exports){'use strict';module.exports=function(window){var navigator=window&&window.navigator;var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError'}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name;}};};var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(c){return origGetUserMedia(c).catch(function(e){return Promise.reject(shimError_(e));});};};},{}],10:[function(require,module,exports){'use strict';var utils=require('../utils');module.exports={shimGetUserMedia:require('./getusermedia'),shimOnTrack:function(window){if(typeof window==='object'&&window.RTCPeerConnection&&!('ontrack'in window.RTCPeerConnection.prototype)){Object.defineProperty(window.RTCPeerConnection.prototype,'ontrack',{get:function(){return this._ontrack;},set:function(f){if(this._ontrack){this.removeEventListener('track',this._ontrack);this.removeEventListener('addstream',this._ontrackpoly);} this.addEventListener('track',this._ontrack=f);this.addEventListener('addstream',this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(track){var event=new Event('track');event.track=track;event.receiver={track:track};event.transceiver={receiver:event.receiver};event.streams=[e.stream];this.dispatchEvent(event);}.bind(this));}.bind(this));}});} if(typeof window==='object'&&window.RTCTrackEvent&&('receiver'in window.RTCTrackEvent.prototype)&&!('transceiver'in window.RTCTrackEvent.prototype)){Object.defineProperty(window.RTCTrackEvent.prototype,'transceiver',{get:function(){return{receiver:this.receiver};}});}},shimSourceObject:function(window){if(typeof window==='object'){if(window.HTMLMediaElement&&!('srcObject'in window.HTMLMediaElement.prototype)){Object.defineProperty(window.HTMLMediaElement.prototype,'srcObject',{get:function(){return this.mozSrcObject;},set:function(stream){this.mozSrcObject=stream;}});}}},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(typeof window!=='object'||!(window.RTCPeerConnection||window.mozRTCPeerConnection)){return;} @@ -551,7 +568,7 @@ return nativeAddIceCandidate.apply(this,arguments);};var makeMapStats=function(s if(browserDetails.version<53&&!onSucc){try{stats.forEach(function(stat){stat.type=modernStatsTypes[stat.type]||stat.type;});}catch(e){if(e.name!=='TypeError'){throw e;} stats.forEach(function(stat,i){stats.set(i,Object.assign({},stat,{type:modernStatsTypes[stat.type]||stat.type}));});}} return stats;}).then(onSucc,onErr);};},shimRemoveStream:function(window){if(!window.RTCPeerConnection||'removeStream'in window.RTCPeerConnection.prototype){return;} -window.RTCPeerConnection.prototype.removeStream=function(stream){var pc=this;utils.deprecated('removeStream','removeTrack');this.getSenders().forEach(function(sender){if(sender.track&&stream.getTracks().indexOf(sender.track)!==-1){pc.removeTrack(sender);}});};}};module.exports={shimOnTrack:firefoxShim.shimOnTrack,shimSourceObject:firefoxShim.shimSourceObject,shimPeerConnection:firefoxShim.shimPeerConnection,shimRemoveStream:firefoxShim.shimRemoveStream,shimGetUserMedia:require('./getusermedia')};},{"../utils":13,"./getusermedia":11}],11:[function(require,module,exports){'use strict';var utils=require('../utils');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var MediaStreamTrack=window&&window.MediaStreamTrack;var shimError_=function(e){return{name:{InternalError:'NotReadableError',NotSupportedError:'TypeError',PermissionDeniedError:'NotAllowedError',SecurityError:'NotAllowedError'}[e.name]||e.name,message:{'The operation is insecure.':'The request is not allowed by the '+'user agent or the platform in the current context.'}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&': ')+this.message;}};};var getUserMedia_=function(constraints,onSuccess,onError){var constraintsToFF37_=function(c){if(typeof c!=='object'||c.require){return c;} +window.RTCPeerConnection.prototype.removeStream=function(stream){var pc=this;utils.deprecated('removeStream','removeTrack');this.getSenders().forEach(function(sender){if(sender.track&&stream.getTracks().indexOf(sender.track)!==-1){pc.removeTrack(sender);}});};}};},{"../utils":13,"./getusermedia":11}],11:[function(require,module,exports){'use strict';var utils=require('../utils');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var MediaStreamTrack=window&&window.MediaStreamTrack;var shimError_=function(e){return{name:{InternalError:'NotReadableError',NotSupportedError:'TypeError',PermissionDeniedError:'NotAllowedError',SecurityError:'NotAllowedError'}[e.name]||e.name,message:{'The operation is insecure.':'The request is not allowed by the '+'user agent or the platform in the current context.'}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&': ')+this.message;}};};var getUserMedia_=function(constraints,onSuccess,onError){var constraintsToFF37_=function(c){if(typeof c!=='object'||c.require){return c;} var require=[];Object.keys(c).forEach(function(key){if(key==='require'||key==='advanced'||key==='mediaSource'){return;} var r=c[key]=(typeof c[key]==='object')?c[key]:{ideal:c[key]};if(r.min!==undefined||r.max!==undefined||r.exact!==undefined){require.push(key);} if(r.exact!==undefined){if(typeof r.exact==='number'){r.min=r.max=r.exact;}else{c[key]=r.exact;} @@ -571,7 +588,7 @@ return nativeGetUserMedia(c);};if(MediaStreamTrack&&MediaStreamTrack.prototype.g if(MediaStreamTrack&&MediaStreamTrack.prototype.applyConstraints){var nativeApplyConstraints=MediaStreamTrack.prototype.applyConstraints;MediaStreamTrack.prototype.applyConstraints=function(c){if(this.kind==='audio'&&typeof c==='object'){c=JSON.parse(JSON.stringify(c));remap(c,'autoGainControl','mozAutoGainControl');remap(c,'noiseSuppression','mozNoiseSuppression');} return nativeApplyConstraints.apply(this,[c]);};}} navigator.getUserMedia=function(constraints,onSuccess,onError){if(browserDetails.version<44){return getUserMedia_(constraints,onSuccess,onError);} -utils.deprecated('navigator.getUserMedia','navigator.mediaDevices.getUserMedia');navigator.mediaDevices.getUserMedia(constraints).then(onSuccess,onError);};};},{"../utils":13}],12:[function(require,module,exports){'use strict';var utils=require('../utils');var safariShim={shimLocalStreamsAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} +utils.deprecated('navigator.getUserMedia','navigator.mediaDevices.getUserMedia');navigator.mediaDevices.getUserMedia(constraints).then(onSuccess,onError);};};},{"../utils":13}],12:[function(require,module,exports){'use strict';var utils=require('../utils');module.exports={shimLocalStreamsAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} if(!('getLocalStreams'in window.RTCPeerConnection.prototype)){window.RTCPeerConnection.prototype.getLocalStreams=function(){if(!this._localStreams){this._localStreams=[];} return this._localStreams;};} if(!('getStreamById'in window.RTCPeerConnection.prototype)){window.RTCPeerConnection.prototype.getStreamById=function(id){var result=null;if(this._localStreams){this._localStreams.forEach(function(stream){if(stream.id===id){result=stream;}});} @@ -579,16 +596,16 @@ if(this._remoteStreams){this._remoteStreams.forEach(function(stream){if(stream.i return result;};} if(!('addStream'in window.RTCPeerConnection.prototype)){var _addTrack=window.RTCPeerConnection.prototype.addTrack;window.RTCPeerConnection.prototype.addStream=function(stream){if(!this._localStreams){this._localStreams=[];} if(this._localStreams.indexOf(stream)===-1){this._localStreams.push(stream);} -var self=this;stream.getTracks().forEach(function(track){_addTrack.call(self,track,stream);});};window.RTCPeerConnection.prototype.addTrack=function(track,stream){if(stream){if(!this._localStreams){this._localStreams=[stream];}else if(this._localStreams.indexOf(stream)===-1){this._localStreams.push(stream);}} +var pc=this;stream.getTracks().forEach(function(track){_addTrack.call(pc,track,stream);});};window.RTCPeerConnection.prototype.addTrack=function(track,stream){if(stream){if(!this._localStreams){this._localStreams=[stream];}else if(this._localStreams.indexOf(stream)===-1){this._localStreams.push(stream);}} return _addTrack.call(this,track,stream);};} if(!('removeStream'in window.RTCPeerConnection.prototype)){window.RTCPeerConnection.prototype.removeStream=function(stream){if(!this._localStreams){this._localStreams=[];} var index=this._localStreams.indexOf(stream);if(index===-1){return;} -this._localStreams.splice(index,1);var self=this;var tracks=stream.getTracks();this.getSenders().forEach(function(sender){if(tracks.indexOf(sender.track)!==-1){self.removeTrack(sender);}});};}},shimRemoteStreamsAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} +this._localStreams.splice(index,1);var pc=this;var tracks=stream.getTracks();this.getSenders().forEach(function(sender){if(tracks.indexOf(sender.track)!==-1){pc.removeTrack(sender);}});};}},shimRemoteStreamsAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} if(!('getRemoteStreams'in window.RTCPeerConnection.prototype)){window.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[];};} -if(!('onaddstream'in window.RTCPeerConnection.prototype)){Object.defineProperty(window.RTCPeerConnection.prototype,'onaddstream',{get:function(){return this._onaddstream;},set:function(f){if(this._onaddstream){this.removeEventListener('addstream',this._onaddstream);this.removeEventListener('track',this._onaddstreampoly);} -this.addEventListener('addstream',this._onaddstream=f);this.addEventListener('track',this._onaddstreampoly=function(e){var stream=e.streams[0];if(!this._remoteStreams){this._remoteStreams=[];} -if(this._remoteStreams.indexOf(stream)>=0){return;} -this._remoteStreams.push(stream);var event=new Event('addstream');event.stream=e.streams[0];this.dispatchEvent(event);}.bind(this));}});}},shimCallbacksAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} +if(!('onaddstream'in window.RTCPeerConnection.prototype)){Object.defineProperty(window.RTCPeerConnection.prototype,'onaddstream',{get:function(){return this._onaddstream;},set:function(f){var pc=this;if(this._onaddstream){this.removeEventListener('addstream',this._onaddstream);this.removeEventListener('track',this._onaddstreampoly);} +this.addEventListener('addstream',this._onaddstream=f);this.addEventListener('track',this._onaddstreampoly=function(e){e.streams.forEach(function(stream){if(!pc._remoteStreams){pc._remoteStreams=[];} +if(pc._remoteStreams.indexOf(stream)>=0){return;} +pc._remoteStreams.push(stream);var event=new Event('addstream');event.stream=stream;pc.dispatchEvent(event);});});}});}},shimCallbacksAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} var prototype=window.RTCPeerConnection.prototype;var createOffer=prototype.createOffer;var createAnswer=prototype.createAnswer;var setLocalDescription=prototype.setLocalDescription;var setRemoteDescription=prototype.setRemoteDescription;var addIceCandidate=prototype.addIceCandidate;prototype.createOffer=function(successCallback,failureCallback){var options=(arguments.length>=2)?arguments[2]:arguments[0];var promise=createOffer.apply(this,[options]);if(!failureCallback){return promise;} promise.then(successCallback,failureCallback);return Promise.resolve();};prototype.createAnswer=function(successCallback,failureCallback){var options=(arguments.length>=2)?arguments[2]:arguments[0];var promise=createAnswer.apply(this,[options]);if(!failureCallback){return promise;} promise.then(successCallback,failureCallback);return Promise.resolve();};var withCallback=function(description,successCallback,failureCallback){var promise=setLocalDescription.apply(this,[description]);if(!failureCallback){return promise;} @@ -596,12 +613,18 @@ promise.then(successCallback,failureCallback);return Promise.resolve();};prototy promise.then(successCallback,failureCallback);return Promise.resolve();};prototype.setRemoteDescription=withCallback;withCallback=function(candidate,successCallback,failureCallback){var promise=addIceCandidate.apply(this,[candidate]);if(!failureCallback){return promise;} promise.then(successCallback,failureCallback);return Promise.resolve();};prototype.addIceCandidate=withCallback;},shimGetUserMedia:function(window){var navigator=window&&window.navigator;if(!navigator.getUserMedia){if(navigator.webkitGetUserMedia){navigator.getUserMedia=navigator.webkitGetUserMedia.bind(navigator);}else if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia){navigator.getUserMedia=function(constraints,cb,errcb){navigator.mediaDevices.getUserMedia(constraints).then(cb,errcb);}.bind(navigator);}}},shimRTCIceServerUrls:function(window){var OrigPeerConnection=window.RTCPeerConnection;window.RTCPeerConnection=function(pcConfig,pcConstraints){if(pcConfig&&pcConfig.iceServers){var newIceServers=[];for(var i=0;i=pos&&parseInt(match[pos],10);} +function wrapPeerConnectionEvent(window,eventNameToWrap,wrapper){if(!window.RTCPeerConnection){return;} +var proto=window.RTCPeerConnection.prototype;var nativeAddEventListener=proto.addEventListener;proto.addEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap){return nativeAddEventListener.apply(this,arguments);} +var wrappedCallback=function(e){cb(wrapper(e));};this._eventMap=this._eventMap||{};this._eventMap[cb]=wrappedCallback;return nativeAddEventListener.apply(this,[nativeEventName,wrappedCallback]);};var nativeRemoveEventListener=proto.removeEventListener;proto.removeEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap||!this._eventMap||!this._eventMap[cb]){return nativeRemoveEventListener.apply(this,arguments);} +var unwrappedCb=this._eventMap[cb];delete this._eventMap[cb];return nativeRemoveEventListener.apply(this,[nativeEventName,unwrappedCb]);};Object.defineProperty(proto,'on'+eventNameToWrap,{get:function(){return this['_on'+eventNameToWrap];},set:function(cb){if(this['_on'+eventNameToWrap]){this.removeEventListener(eventNameToWrap,this['_on'+eventNameToWrap]);delete this['_on'+eventNameToWrap];} +if(cb){this.addEventListener(eventNameToWrap,this['_on'+eventNameToWrap]=cb);}}});} +module.exports={extractVersion:extractVersion,wrapPeerConnectionEvent:wrapPeerConnectionEvent,disableLog:function(bool){if(typeof bool!=='boolean'){return new Error('Argument type: '+typeof bool+'. Please use a boolean.');} logDisabled_=bool;return(bool)?'adapter.js logging disabled':'adapter.js logging enabled';},disableWarnings:function(bool){if(typeof bool!=='boolean'){return new Error('Argument type: '+typeof bool+'. Please use a boolean.');} deprecationWarnings_=!bool;return'adapter.js deprecation warnings '+(bool?'disabled':'enabled');},log:function(){if(typeof window==='object'){if(logDisabled_){return;} if(typeof console!=='undefined'&&typeof console.log==='function'){console.log.apply(console,arguments);}}},deprecated:function(oldMethod,newMethod){if(!deprecationWarnings_){return;} -console.warn(oldMethod+' is deprecated, please use '+newMethod+' instead.');},extractVersion:function(uastring,expr,pos){var match=uastring.match(expr);return match&&match.length>=pos&&parseInt(match[pos],10);},detectBrowser:function(window){var navigator=window&&window.navigator;var result={};result.browser=null;result.version=null;if(typeof window==='undefined'||!window.navigator){result.browser='Not a browser.';return result;} -if(navigator.mozGetUserMedia){result.browser='firefox';result.version=this.extractVersion(navigator.userAgent,/Firefox\/(\d+)\./,1);}else if(navigator.webkitGetUserMedia){if(window.webkitRTCPeerConnection){result.browser='chrome';result.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/(\d+)\./,2);}else{if(navigator.userAgent.match(/Version\/(\d+).(\d+)/)){result.browser='safari';result.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1);}else{result.browser='Unsupported webkit-based browser '+'with GUM support but no WebRTC support.';return result;}}}else if(navigator.mediaDevices&&navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)){result.browser='edge';result.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2);}else if(navigator.mediaDevices&&navigator.userAgent.match(/AppleWebKit\/(\d+)\./)){result.browser='safari';result.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1);}else{result.browser='Not a supported browser.';return result;} -return result;},};module.exports={log:utils.log,deprecated:utils.deprecated,disableLog:utils.disableLog,disableWarnings:utils.disableWarnings,extractVersion:utils.extractVersion,shimCreateObjectURL:utils.shimCreateObjectURL,detectBrowser:utils.detectBrowser.bind(utils)};},{}]},{},[3])(3)}); \ No newline at end of file +console.warn(oldMethod+' is deprecated, please use '+newMethod+' instead.');},detectBrowser:function(window){var navigator=window&&window.navigator;var result={};result.browser=null;result.version=null;if(typeof window==='undefined'||!window.navigator){result.browser='Not a browser.';return result;} +if(navigator.mozGetUserMedia){result.browser='firefox';result.version=extractVersion(navigator.userAgent,/Firefox\/(\d+)\./,1);}else if(navigator.webkitGetUserMedia){result.browser='chrome';result.version=extractVersion(navigator.userAgent,/Chrom(e|ium)\/(\d+)\./,2);}else if(navigator.mediaDevices&&navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)){result.browser='edge';result.version=extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2);}else if(navigator.mediaDevices&&navigator.userAgent.match(/AppleWebKit\/(\d+)\./)){result.browser='safari';result.version=extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1);}else{result.browser='Not a supported browser.';return result;} +return result;}};},{}]},{},[3])(3)}); \ No newline at end of file diff --git a/html5/verto/video_demo/js/verto-min.js b/html5/verto/video_demo/js/verto-min.js index fdf5432fa5..78f8bc450e 100644 --- a/html5/verto/video_demo/js/verto-min.js +++ b/html5/verto/video_demo/js/verto-min.js @@ -307,7 +307,7 @@ navigator.getUserMedia({audio:(has_audio>0?true:false),video:(has_video>0?true:f navigator.mediaDevices.enumerateDevices().then(checkTypes).catch(handleError);};$.verto.refreshDevices=function(runtime){checkDevices(runtime);} $.verto.init=function(obj,runtime){if(!obj){obj={};} if(!obj.skipPermCheck&&!obj.skipDeviceCheck){$.FSRTC.checkPerms(function(status){checkDevices(runtime);},true,true);}else if(obj.skipPermCheck&&!obj.skipDeviceCheck){checkDevices(runtime);}else if(!obj.skipPermCheck&&obj.skipDeviceCheck){$.FSRTC.checkPerms(function(status){runtime(status);},true,true);}else{runtime(null);}} -$.verto.genUUID=function(){return generateGUID();}})(jQuery);(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.adapter=f()}})(function(){var define,module,exports;return(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=14393&&url.indexOf('?transport=udp')===-1;});delete server.url;server.urls=isString?urls[0]:urls;return!!urls.length;} -return false;});} +return url.indexOf('stun:')===0&&edgeVersion>=14393&&url.indexOf('?transport=udp')===-1;});delete server.url;server.urls=isString?urls[0]:urls;return!!urls.length;}});} function getCommonCapabilities(localCapabilities,remoteCapabilities){var commonCapabilities={codecs:[],headerExtensions:[],fecMechanisms:[]};var findCodecByPayloadType=function(pt,codecs){pt=parseInt(pt,10);for(var i=0;i0;i--){this._iceGatherers=new window.RTCIceGatherer({iceServers:config.iceServers,gatherPolicy:config.iceTransportPolicy});}}else{config.iceCandidatePoolSize=0;} -this._config=config;this.transceivers=[];this._sdpSessionId=SDPUtils.generateSessionId();this._sdpSessionVersion=0;this._dtlsRole=undefined;};RTCPeerConnection.prototype._emitGatheringStateChange=function(){var event=new Event('icegatheringstatechange');this.dispatchEvent(event);if(typeof this.onicegatheringstatechange==='function'){this.onicegatheringstatechange(event);}};RTCPeerConnection.prototype.getConfiguration=function(){return this._config;};RTCPeerConnection.prototype.getLocalStreams=function(){return this.localStreams;};RTCPeerConnection.prototype.getRemoteStreams=function(){return this.remoteStreams;};RTCPeerConnection.prototype._createTransceiver=function(kind){var hasBundleTransport=this.transceivers.length>0;var transceiver={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:kind,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,wantReceive:true};if(this.usingBundle&&hasBundleTransport){transceiver.iceTransport=this.transceivers[0].iceTransport;transceiver.dtlsTransport=this.transceivers[0].dtlsTransport;}else{var transports=this._createIceAndDtlsTransports();transceiver.iceTransport=transports.iceTransport;transceiver.dtlsTransport=transports.dtlsTransport;} -this.transceivers.push(transceiver);return transceiver;};RTCPeerConnection.prototype.addTrack=function(track,stream){var transceiver;for(var i=0;i0;var transceiver={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:kind,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:true};if(this.usingBundle&&hasBundleTransport){transceiver.iceTransport=this.transceivers[0].iceTransport;transceiver.dtlsTransport=this.transceivers[0].dtlsTransport;}else{var transports=this._createIceAndDtlsTransports();transceiver.iceTransport=transports.iceTransport;transceiver.dtlsTransport=transports.dtlsTransport;} +this.transceivers.push(transceiver);return transceiver;};RTCPeerConnection.prototype.addTrack=function(track,stream){var alreadyExists=this.transceivers.find(function(s){return s.track===track;});if(alreadyExists){throw makeError('InvalidAccessError','Track already exists.');} +if(this.signalingState==='closed'){throw makeError('InvalidStateError','Attempted to call addTrack on a closed peerconnection.');} +var transceiver;for(var i=0;i=15025){stream.getTracks().forEach(function(track){self.addTrack(track,stream);});}else{var clonedStream=stream.clone();stream.getTracks().forEach(function(track,idx){var clonedTrack=clonedStream.getTracks()[idx];track.addEventListener('enabled',function(event){clonedTrack.enabled=event.enabled;});});clonedStream.getTracks().forEach(function(track){self.addTrack(track,clonedStream);});}};RTCPeerConnection.prototype.removeStream=function(stream){var idx=this.localStreams.indexOf(stream);if(idx>-1){this.localStreams.splice(idx,1);this._maybeFireNegotiationNeeded();}};RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpSender;}).map(function(transceiver){return transceiver.rtpSender;});};RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpReceiver;}).map(function(transceiver){return transceiver.rtpReceiver;});};RTCPeerConnection.prototype._createIceGatherer=function(sdpMLineIndex,usingBundle){var self=this;if(usingBundle&&sdpMLineIndex>0){return this.transceivers[0].iceGatherer;}else if(this._iceGatherers.length){return this._iceGatherers.shift();} -var iceGatherer=new window.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});Object.defineProperty(iceGatherer,'state',{value:'new',writable:true});this.transceivers[sdpMLineIndex].candidates=[];this.transceivers[sdpMLineIndex].bufferCandidates=function(event){var end=!event.candidate||Object.keys(event.candidate).length===0;iceGatherer.state=end?'completed':'gathering';if(self.transceivers[sdpMLineIndex].candidates!==null){self.transceivers[sdpMLineIndex].candidates.push(event.candidate);}};iceGatherer.addEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);return iceGatherer;};RTCPeerConnection.prototype._gather=function(mid,sdpMLineIndex){var self=this;var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer.onlocalcandidate){return;} -var candidates=this.transceivers[sdpMLineIndex].candidates;this.transceivers[sdpMLineIndex].candidates=null;iceGatherer.removeEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);iceGatherer.onlocalcandidate=function(evt){if(self.usingBundle&&sdpMLineIndex>0){return;} +transceiver.track=track;transceiver.stream=stream;transceiver.rtpSender=new window.RTCRtpSender(track,transceiver.dtlsTransport);return transceiver.rtpSender;};RTCPeerConnection.prototype.addStream=function(stream){var pc=this;if(edgeVersion>=15025){stream.getTracks().forEach(function(track){pc.addTrack(track,stream);});}else{var clonedStream=stream.clone();stream.getTracks().forEach(function(track,idx){var clonedTrack=clonedStream.getTracks()[idx];track.addEventListener('enabled',function(event){clonedTrack.enabled=event.enabled;});});clonedStream.getTracks().forEach(function(track){pc.addTrack(track,clonedStream);});}};RTCPeerConnection.prototype.removeTrack=function(sender){if(!(sender instanceof window.RTCRtpSender)){throw new TypeError('Argument 1 of RTCPeerConnection.removeTrack '+'does not implement interface RTCRtpSender.');} +var transceiver=this.transceivers.find(function(t){return t.rtpSender===sender;});if(!transceiver){throw makeError('InvalidAccessError','Sender was not created by this connection.');} +var stream=transceiver.stream;transceiver.rtpSender.stop();transceiver.rtpSender=null;transceiver.track=null;transceiver.stream=null;var localStreams=this.transceivers.map(function(t){return t.stream;});if(localStreams.indexOf(stream)===-1&&this.localStreams.indexOf(stream)>-1){this.localStreams.splice(this.localStreams.indexOf(stream),1);} +this._maybeFireNegotiationNeeded();};RTCPeerConnection.prototype.removeStream=function(stream){var pc=this;stream.getTracks().forEach(function(track){var sender=pc.getSenders().find(function(s){return s.track===track;});if(sender){pc.removeTrack(sender);}});};RTCPeerConnection.prototype.getSenders=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpSender;}).map(function(transceiver){return transceiver.rtpSender;});};RTCPeerConnection.prototype.getReceivers=function(){return this.transceivers.filter(function(transceiver){return!!transceiver.rtpReceiver;}).map(function(transceiver){return transceiver.rtpReceiver;});};RTCPeerConnection.prototype._createIceGatherer=function(sdpMLineIndex,usingBundle){var pc=this;if(usingBundle&&sdpMLineIndex>0){return this.transceivers[0].iceGatherer;}else if(this._iceGatherers.length){return this._iceGatherers.shift();} +var iceGatherer=new window.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});Object.defineProperty(iceGatherer,'state',{value:'new',writable:true});this.transceivers[sdpMLineIndex].candidates=[];this.transceivers[sdpMLineIndex].bufferCandidates=function(event){var end=!event.candidate||Object.keys(event.candidate).length===0;iceGatherer.state=end?'completed':'gathering';if(pc.transceivers[sdpMLineIndex].candidates!==null){pc.transceivers[sdpMLineIndex].candidates.push(event.candidate);}};iceGatherer.addEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);return iceGatherer;};RTCPeerConnection.prototype._gather=function(mid,sdpMLineIndex){var pc=this;var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer.onlocalcandidate){return;} +var candidates=this.transceivers[sdpMLineIndex].candidates;this.transceivers[sdpMLineIndex].candidates=null;iceGatherer.removeEventListener('localcandidate',this.transceivers[sdpMLineIndex].bufferCandidates);iceGatherer.onlocalcandidate=function(evt){if(pc.usingBundle&&sdpMLineIndex>0){return;} var event=new Event('icecandidate');event.candidate={sdpMid:mid,sdpMLineIndex:sdpMLineIndex};var cand=evt.candidate;var end=!cand||Object.keys(cand).length===0;if(end){if(iceGatherer.state==='new'||iceGatherer.state==='gathering'){iceGatherer.state='completed';}}else{if(iceGatherer.state==='new'){iceGatherer.state='gathering';} cand.component=1;event.candidate.candidate=SDPUtils.writeCandidate(cand);} -var sections=SDPUtils.splitSections(self.localDescription.sdp);if(!end){sections[event.candidate.sdpMLineIndex+1]+='a='+event.candidate.candidate+'\r\n';}else{sections[event.candidate.sdpMLineIndex+1]+='a=end-of-candidates\r\n';} -self.localDescription.sdp=sections.join('');var complete=self.transceivers.every(function(transceiver){return transceiver.iceGatherer&&transceiver.iceGatherer.state==='completed';});if(self.iceGatheringState!=='gathering'){self.iceGatheringState='gathering';self._emitGatheringStateChange();} -if(!end){self.dispatchEvent(event);if(typeof self.onicecandidate==='function'){self.onicecandidate(event);}} -if(complete){self.dispatchEvent(new Event('icecandidate'));if(typeof self.onicecandidate==='function'){self.onicecandidate(new Event('icecandidate'));} -self.iceGatheringState='complete';self._emitGatheringStateChange();}};window.setTimeout(function(){candidates.forEach(function(candidate){var e=new Event('RTCIceGatherEvent');e.candidate=candidate;iceGatherer.onlocalcandidate(e);});},0);};RTCPeerConnection.prototype._createIceAndDtlsTransports=function(){var self=this;var iceTransport=new window.RTCIceTransport(null);iceTransport.onicestatechange=function(){self._updateConnectionState();};var dtlsTransport=new window.RTCDtlsTransport(iceTransport);dtlsTransport.ondtlsstatechange=function(){self._updateConnectionState();};dtlsTransport.onerror=function(){Object.defineProperty(dtlsTransport,'state',{value:'failed',writable:true});self._updateConnectionState();};return{iceTransport:iceTransport,dtlsTransport:dtlsTransport};};RTCPeerConnection.prototype._disposeIceAndDtlsTransports=function(sdpMLineIndex){var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer){delete iceGatherer.onlocalcandidate;delete this.transceivers[sdpMLineIndex].iceGatherer;} +var sections=SDPUtils.splitSections(pc.localDescription.sdp);if(!end){sections[event.candidate.sdpMLineIndex+1]+='a='+event.candidate.candidate+'\r\n';}else{sections[event.candidate.sdpMLineIndex+1]+='a=end-of-candidates\r\n';} +pc.localDescription.sdp=sections.join('');var complete=pc.transceivers.every(function(transceiver){return transceiver.iceGatherer&&transceiver.iceGatherer.state==='completed';});if(pc.iceGatheringState!=='gathering'){pc.iceGatheringState='gathering';pc._emitGatheringStateChange();} +if(!end){pc._dispatchEvent('icecandidate',event);} +if(complete){pc._dispatchEvent('icecandidate',new Event('icecandidate'));pc.iceGatheringState='complete';pc._emitGatheringStateChange();}};window.setTimeout(function(){candidates.forEach(function(candidate){var e=new Event('RTCIceGatherEvent');e.candidate=candidate;iceGatherer.onlocalcandidate(e);});},0);};RTCPeerConnection.prototype._createIceAndDtlsTransports=function(){var pc=this;var iceTransport=new window.RTCIceTransport(null);iceTransport.onicestatechange=function(){pc._updateConnectionState();};var dtlsTransport=new window.RTCDtlsTransport(iceTransport);dtlsTransport.ondtlsstatechange=function(){pc._updateConnectionState();};dtlsTransport.onerror=function(){Object.defineProperty(dtlsTransport,'state',{value:'failed',writable:true});pc._updateConnectionState();};return{iceTransport:iceTransport,dtlsTransport:dtlsTransport};};RTCPeerConnection.prototype._disposeIceAndDtlsTransports=function(sdpMLineIndex){var iceGatherer=this.transceivers[sdpMLineIndex].iceGatherer;if(iceGatherer){delete iceGatherer.onlocalcandidate;delete this.transceivers[sdpMLineIndex].iceGatherer;} var iceTransport=this.transceivers[sdpMLineIndex].iceTransport;if(iceTransport){delete iceTransport.onicestatechange;delete this.transceivers[sdpMLineIndex].iceTransport;} var dtlsTransport=this.transceivers[sdpMLineIndex].dtlsTransport;if(dtlsTransport){delete dtlsTransport.ondtlsstatechange;delete dtlsTransport.onerror;delete this.transceivers[sdpMLineIndex].dtlsTransport;}};RTCPeerConnection.prototype._transceive=function(transceiver,send,recv){var params=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);if(send&&transceiver.rtpSender){params.encodings=transceiver.sendEncodingParameters;params.rtcp={cname:SDPUtils.localCName,compound:transceiver.rtcpParameters.compound};if(transceiver.recvEncodingParameters.length){params.rtcp.ssrc=transceiver.recvEncodingParameters[0].ssrc;} transceiver.rtpSender.send(params);} if(recv&&transceiver.rtpReceiver&¶ms.codecs.length>0){if(transceiver.kind==='video'&&transceiver.recvEncodingParameters&&edgeVersion<15019){transceiver.recvEncodingParameters.forEach(function(p){delete p.rtx;});} -params.encodings=transceiver.recvEncodingParameters;params.rtcp={cname:transceiver.rtcpParameters.cname,compound:transceiver.rtcpParameters.compound};if(transceiver.sendEncodingParameters.length){params.rtcp.ssrc=transceiver.sendEncodingParameters[0].ssrc;} -transceiver.rtpReceiver.receive(params);}};RTCPeerConnection.prototype.setLocalDescription=function(description){var self=this;var args=arguments;if(!isActionAllowedInSignalingState('setLocalDescription',description.type,this.signalingState)){return new Promise(function(resolve,reject){var e=new Error('Can not set local '+description.type+' in state '+self.signalingState);e.name='InvalidStateError';if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[e]);} -reject(e);});} -var sections;var sessionpart;if(description.type==='offer'){sections=SDPUtils.splitSections(description.sdp);sessionpart=sections.shift();sections.forEach(function(mediaSection,sdpMLineIndex){var caps=SDPUtils.parseRtpParameters(mediaSection);self.transceivers[sdpMLineIndex].localCapabilities=caps;});this.transceivers.forEach(function(transceiver,sdpMLineIndex){self._gather(transceiver.mid,sdpMLineIndex);});}else if(description.type==='answer'){sections=SDPUtils.splitSections(self.remoteDescription.sdp);sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;sections.forEach(function(mediaSection,sdpMLineIndex){var transceiver=self.transceivers[sdpMLineIndex];var iceGatherer=transceiver.iceGatherer;var iceTransport=transceiver.iceTransport;var dtlsTransport=transceiver.dtlsTransport;var localCapabilities=transceiver.localCapabilities;var remoteCapabilities=transceiver.remoteCapabilities;var rejected=SDPUtils.isRejected(mediaSection)&&!SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===1;if(!rejected&&!transceiver.isDatachannel){var remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);var remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);if(isIceLite){remoteDtlsParameters.role='server';} -if(!self.usingBundle||sdpMLineIndex===0){self._gather(transceiver.mid,sdpMLineIndex);if(iceTransport.state==='new'){iceTransport.start(iceGatherer,remoteIceParameters,isIceLite?'controlling':'controlled');} +if(transceiver.recvEncodingParameters.length){params.encodings=transceiver.recvEncodingParameters;} +params.rtcp={compound:transceiver.rtcpParameters.compound};if(transceiver.rtcpParameters.cname){params.rtcp.cname=transceiver.rtcpParameters.cname;} +if(transceiver.sendEncodingParameters.length){params.rtcp.ssrc=transceiver.sendEncodingParameters[0].ssrc;} +transceiver.rtpReceiver.receive(params);}};RTCPeerConnection.prototype.setLocalDescription=function(description){var pc=this;if(!isActionAllowedInSignalingState('setLocalDescription',description.type,this.signalingState)||this._isClosed){return Promise.reject(makeError('InvalidStateError','Can not set local '+description.type+' in state '+pc.signalingState));} +var sections;var sessionpart;if(description.type==='offer'){sections=SDPUtils.splitSections(description.sdp);sessionpart=sections.shift();sections.forEach(function(mediaSection,sdpMLineIndex){var caps=SDPUtils.parseRtpParameters(mediaSection);pc.transceivers[sdpMLineIndex].localCapabilities=caps;});this.transceivers.forEach(function(transceiver,sdpMLineIndex){pc._gather(transceiver.mid,sdpMLineIndex);});}else if(description.type==='answer'){sections=SDPUtils.splitSections(pc.remoteDescription.sdp);sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;sections.forEach(function(mediaSection,sdpMLineIndex){var transceiver=pc.transceivers[sdpMLineIndex];var iceGatherer=transceiver.iceGatherer;var iceTransport=transceiver.iceTransport;var dtlsTransport=transceiver.dtlsTransport;var localCapabilities=transceiver.localCapabilities;var remoteCapabilities=transceiver.remoteCapabilities;var rejected=SDPUtils.isRejected(mediaSection)&&SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===0;if(!rejected&&!transceiver.isDatachannel){var remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);var remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);if(isIceLite){remoteDtlsParameters.role='server';} +if(!pc.usingBundle||sdpMLineIndex===0){pc._gather(transceiver.mid,sdpMLineIndex);if(iceTransport.state==='new'){iceTransport.start(iceGatherer,remoteIceParameters,isIceLite?'controlling':'controlled');} if(dtlsTransport.state==='new'){dtlsTransport.start(remoteDtlsParameters);}} -var params=getCommonCapabilities(localCapabilities,remoteCapabilities);self._transceive(transceiver,params.codecs.length>0,false);}});} +var params=getCommonCapabilities(localCapabilities,remoteCapabilities);pc._transceive(transceiver,params.codecs.length>0,false);}});} this.localDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-local-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} -var cb=arguments.length>1&&typeof arguments[1]==='function'&&arguments[1];return new Promise(function(resolve){if(cb){cb.apply(null);} -resolve();});};RTCPeerConnection.prototype.setRemoteDescription=function(description){var self=this;var args=arguments;if(!isActionAllowedInSignalingState('setRemoteDescription',description.type,this.signalingState)){return new Promise(function(resolve,reject){var e=new Error('Can not set remote '+description.type+' in state '+self.signalingState);e.name='InvalidStateError';if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[e]);} -reject(e);});} +return Promise.resolve();};RTCPeerConnection.prototype.setRemoteDescription=function(description){var pc=this;if(!isActionAllowedInSignalingState('setRemoteDescription',description.type,this.signalingState)||this._isClosed){return Promise.reject(makeError('InvalidStateError','Can not set remote '+description.type+' in state '+pc.signalingState));} var streams={};this.remoteStreams.forEach(function(stream){streams[stream.id]=stream;});var receiverList=[];var sections=SDPUtils.splitSections(description.sdp);var sessionpart=sections.shift();var isIceLite=SDPUtils.matchPrefix(sessionpart,'a=ice-lite').length>0;var usingBundle=SDPUtils.matchPrefix(sessionpart,'a=group:BUNDLE ').length>0;this.usingBundle=usingBundle;var iceOptions=SDPUtils.matchPrefix(sessionpart,'a=ice-options:')[0];if(iceOptions){this.canTrickleIceCandidates=iceOptions.substr(14).split(' ').indexOf('trickle')>=0;}else{this.canTrickleIceCandidates=false;} -sections.forEach(function(mediaSection,sdpMLineIndex){var lines=SDPUtils.splitLines(mediaSection);var kind=SDPUtils.getKind(mediaSection);var rejected=SDPUtils.isRejected(mediaSection)&&!SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===1;var protocol=lines[0].substr(2).split(' ')[2];var direction=SDPUtils.getDirection(mediaSection,sessionpart);var remoteMsid=SDPUtils.parseMsid(mediaSection);var mid=SDPUtils.getMid(mediaSection)||SDPUtils.generateIdentifier();if(kind==='application'&&protocol==='DTLS/SCTP'){self.transceivers[sdpMLineIndex]={mid:mid,isDatachannel:true};return;} +sections.forEach(function(mediaSection,sdpMLineIndex){var lines=SDPUtils.splitLines(mediaSection);var kind=SDPUtils.getKind(mediaSection);var rejected=SDPUtils.isRejected(mediaSection)&&SDPUtils.matchPrefix(mediaSection,'a=bundle-only').length===0;var protocol=lines[0].substr(2).split(' ')[2];var direction=SDPUtils.getDirection(mediaSection,sessionpart);var remoteMsid=SDPUtils.parseMsid(mediaSection);var mid=SDPUtils.getMid(mediaSection)||SDPUtils.generateIdentifier();if(kind==='application'&&protocol==='DTLS/SCTP'){pc.transceivers[sdpMLineIndex]={mid:mid,isDatachannel:true};return;} var transceiver;var iceGatherer;var iceTransport;var dtlsTransport;var rtpReceiver;var sendEncodingParameters;var recvEncodingParameters;var localCapabilities;var track;var remoteCapabilities=SDPUtils.parseRtpParameters(mediaSection);var remoteIceParameters;var remoteDtlsParameters;if(!rejected){remoteIceParameters=SDPUtils.getIceParameters(mediaSection,sessionpart);remoteDtlsParameters=SDPUtils.getDtlsParameters(mediaSection,sessionpart);remoteDtlsParameters.role='client';} -recvEncodingParameters=SDPUtils.parseRtpEncodingParameters(mediaSection);var rtcpParameters=SDPUtils.parseRtcpParameters(mediaSection);var isComplete=SDPUtils.matchPrefix(mediaSection,'a=end-of-candidates',sessionpart).length>0;var cands=SDPUtils.matchPrefix(mediaSection,'a=candidate:').map(function(cand){return SDPUtils.parseCandidate(cand);}).filter(function(cand){return cand.component===1;});if((description.type==='offer'||description.type==='answer')&&!rejected&&usingBundle&&sdpMLineIndex>0&&self.transceivers[sdpMLineIndex]){self._disposeIceAndDtlsTransports(sdpMLineIndex);self.transceivers[sdpMLineIndex].iceGatherer=self.transceivers[0].iceGatherer;self.transceivers[sdpMLineIndex].iceTransport=self.transceivers[0].iceTransport;self.transceivers[sdpMLineIndex].dtlsTransport=self.transceivers[0].dtlsTransport;if(self.transceivers[sdpMLineIndex].rtpSender){self.transceivers[sdpMLineIndex].rtpSender.setTransport(self.transceivers[0].dtlsTransport);} -if(self.transceivers[sdpMLineIndex].rtpReceiver){self.transceivers[sdpMLineIndex].rtpReceiver.setTransport(self.transceivers[0].dtlsTransport);}} -if(description.type==='offer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex]||self._createTransceiver(kind);transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=self._createIceGatherer(sdpMLineIndex,usingBundle);} +recvEncodingParameters=SDPUtils.parseRtpEncodingParameters(mediaSection);var rtcpParameters=SDPUtils.parseRtcpParameters(mediaSection);var isComplete=SDPUtils.matchPrefix(mediaSection,'a=end-of-candidates',sessionpart).length>0;var cands=SDPUtils.matchPrefix(mediaSection,'a=candidate:').map(function(cand){return SDPUtils.parseCandidate(cand);}).filter(function(cand){return cand.component===1;});if((description.type==='offer'||description.type==='answer')&&!rejected&&usingBundle&&sdpMLineIndex>0&&pc.transceivers[sdpMLineIndex]){pc._disposeIceAndDtlsTransports(sdpMLineIndex);pc.transceivers[sdpMLineIndex].iceGatherer=pc.transceivers[0].iceGatherer;pc.transceivers[sdpMLineIndex].iceTransport=pc.transceivers[0].iceTransport;pc.transceivers[sdpMLineIndex].dtlsTransport=pc.transceivers[0].dtlsTransport;if(pc.transceivers[sdpMLineIndex].rtpSender){pc.transceivers[sdpMLineIndex].rtpSender.setTransport(pc.transceivers[0].dtlsTransport);} +if(pc.transceivers[sdpMLineIndex].rtpReceiver){pc.transceivers[sdpMLineIndex].rtpReceiver.setTransport(pc.transceivers[0].dtlsTransport);}} +if(description.type==='offer'&&!rejected){transceiver=pc.transceivers[sdpMLineIndex]||pc._createTransceiver(kind);transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=pc._createIceGatherer(sdpMLineIndex,usingBundle);} if(cands.length&&transceiver.iceTransport.state==='new'){if(isComplete&&(!usingBundle||sdpMLineIndex===0)){transceiver.iceTransport.setRemoteCandidates(cands);}else{cands.forEach(function(candidate){maybeAddCandidate(transceiver.iceTransport,candidate);});}} localCapabilities=window.RTCRtpReceiver.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} -sendEncodingParameters=transceiver.sendEncodingParameters||[{ssrc:(2*sdpMLineIndex+2)*1001}];var isNewTrack=false;if(direction==='sendrecv'||direction==='sendonly'){isNewTrack=!transceiver.rtpReceiver;rtpReceiver=transceiver.rtpReceiver||new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);if(isNewTrack){var stream;track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();Object.defineProperty(streams[remoteMsid.stream],'id',{get:function(){return remoteMsid.stream;}});} +sendEncodingParameters=transceiver.sendEncodingParameters||[{ssrc:(2*sdpMLineIndex+2)*1001}];var isNewTrack=false;if(direction==='sendrecv'||direction==='sendonly'){isNewTrack=!transceiver.rtpReceiver;rtpReceiver=transceiver.rtpReceiver||new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);if(isNewTrack){var stream;track=rtpReceiver.track;if(remoteMsid&&remoteMsid.stream==='-'){}else if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();Object.defineProperty(streams[remoteMsid.stream],'id',{get:function(){return remoteMsid.stream;}});} Object.defineProperty(track,'id',{get:function(){return remoteMsid.track;}});stream=streams[remoteMsid.stream];}else{if(!streams.default){streams.default=new window.MediaStream();} stream=streams.default;} -stream.addTrack(track);receiverList.push([track,rtpReceiver,stream]);}} -transceiver.localCapabilities=localCapabilities;transceiver.remoteCapabilities=remoteCapabilities;transceiver.rtpReceiver=rtpReceiver;transceiver.rtcpParameters=rtcpParameters;transceiver.sendEncodingParameters=sendEncodingParameters;transceiver.recvEncodingParameters=recvEncodingParameters;self._transceive(self.transceivers[sdpMLineIndex],false,isNewTrack);}else if(description.type==='answer'&&!rejected){transceiver=self.transceivers[sdpMLineIndex];iceGatherer=transceiver.iceGatherer;iceTransport=transceiver.iceTransport;dtlsTransport=transceiver.dtlsTransport;rtpReceiver=transceiver.rtpReceiver;sendEncodingParameters=transceiver.sendEncodingParameters;localCapabilities=transceiver.localCapabilities;self.transceivers[sdpMLineIndex].recvEncodingParameters=recvEncodingParameters;self.transceivers[sdpMLineIndex].remoteCapabilities=remoteCapabilities;self.transceivers[sdpMLineIndex].rtcpParameters=rtcpParameters;if(cands.length&&iceTransport.state==='new'){if((isIceLite||isComplete)&&(!usingBundle||sdpMLineIndex===0)){iceTransport.setRemoteCandidates(cands);}else{cands.forEach(function(candidate){maybeAddCandidate(transceiver.iceTransport,candidate);});}} +if(stream){addTrackToStreamAndFireEvent(track,stream);transceiver.associatedRemoteMediaStreams.push(stream);} +receiverList.push([track,rtpReceiver,stream]);}}else if(transceiver.rtpReceiver&&transceiver.rtpReceiver.track){transceiver.associatedRemoteMediaStreams.forEach(function(s){var nativeTrack=s.getTracks().find(function(t){return t.id===transceiver.rtpReceiver.track.id;});if(nativeTrack){removeTrackFromStreamAndFireEvent(nativeTrack,s);}});transceiver.associatedRemoteMediaStreams=[];} +transceiver.localCapabilities=localCapabilities;transceiver.remoteCapabilities=remoteCapabilities;transceiver.rtpReceiver=rtpReceiver;transceiver.rtcpParameters=rtcpParameters;transceiver.sendEncodingParameters=sendEncodingParameters;transceiver.recvEncodingParameters=recvEncodingParameters;pc._transceive(pc.transceivers[sdpMLineIndex],false,isNewTrack);}else if(description.type==='answer'&&!rejected){transceiver=pc.transceivers[sdpMLineIndex];iceGatherer=transceiver.iceGatherer;iceTransport=transceiver.iceTransport;dtlsTransport=transceiver.dtlsTransport;rtpReceiver=transceiver.rtpReceiver;sendEncodingParameters=transceiver.sendEncodingParameters;localCapabilities=transceiver.localCapabilities;pc.transceivers[sdpMLineIndex].recvEncodingParameters=recvEncodingParameters;pc.transceivers[sdpMLineIndex].remoteCapabilities=remoteCapabilities;pc.transceivers[sdpMLineIndex].rtcpParameters=rtcpParameters;if(cands.length&&iceTransport.state==='new'){if((isIceLite||isComplete)&&(!usingBundle||sdpMLineIndex===0)){iceTransport.setRemoteCandidates(cands);}else{cands.forEach(function(candidate){maybeAddCandidate(transceiver.iceTransport,candidate);});}} if(!usingBundle||sdpMLineIndex===0){if(iceTransport.state==='new'){iceTransport.start(iceGatherer,remoteIceParameters,'controlling');} if(dtlsTransport.state==='new'){dtlsTransport.start(remoteDtlsParameters);}} -self._transceive(transceiver,direction==='sendrecv'||direction==='recvonly',direction==='sendrecv'||direction==='sendonly');if(rtpReceiver&&(direction==='sendrecv'||direction==='sendonly')){track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();} -streams[remoteMsid.stream].addTrack(track);receiverList.push([track,rtpReceiver,streams[remoteMsid.stream]]);}else{if(!streams.default){streams.default=new window.MediaStream();} -streams.default.addTrack(track);receiverList.push([track,rtpReceiver,streams.default]);}}else{delete transceiver.rtpReceiver;}}});if(this._dtlsRole===undefined){this._dtlsRole=description.type==='offer'?'active':'passive';} +pc._transceive(transceiver,direction==='sendrecv'||direction==='recvonly',direction==='sendrecv'||direction==='sendonly');if(rtpReceiver&&(direction==='sendrecv'||direction==='sendonly')){track=rtpReceiver.track;if(remoteMsid){if(!streams[remoteMsid.stream]){streams[remoteMsid.stream]=new window.MediaStream();} +addTrackToStreamAndFireEvent(track,streams[remoteMsid.stream]);receiverList.push([track,rtpReceiver,streams[remoteMsid.stream]]);}else{if(!streams.default){streams.default=new window.MediaStream();} +addTrackToStreamAndFireEvent(track,streams.default);receiverList.push([track,rtpReceiver,streams.default]);}}else{delete transceiver.rtpReceiver;}}});if(this._dtlsRole===undefined){this._dtlsRole=description.type==='offer'?'active':'passive';} this.remoteDescription={type:description.type,sdp:description.sdp};switch(description.type){case'offer':this._updateSignalingState('have-remote-offer');break;case'answer':this._updateSignalingState('stable');break;default:throw new TypeError('unsupported type "'+description.type+'"');} -Object.keys(streams).forEach(function(sid){var stream=streams[sid];if(stream.getTracks().length){if(self.remoteStreams.indexOf(stream)===-1){self.remoteStreams.push(stream);var event=new Event('addstream');event.stream=stream;window.setTimeout(function(){self.dispatchEvent(event);if(typeof self.onaddstream==='function'){self.onaddstream(event);}});} +Object.keys(streams).forEach(function(sid){var stream=streams[sid];if(stream.getTracks().length){if(pc.remoteStreams.indexOf(stream)===-1){pc.remoteStreams.push(stream);var event=new Event('addstream');event.stream=stream;window.setTimeout(function(){pc._dispatchEvent('addstream',event);});} receiverList.forEach(function(item){var track=item[0];var receiver=item[1];if(stream.id!==item[2].id){return;} -var trackEvent=new Event('track');trackEvent.track=track;trackEvent.receiver=receiver;trackEvent.transceiver={receiver:receiver};trackEvent.streams=[stream];window.setTimeout(function(){self.dispatchEvent(trackEvent);if(typeof self.ontrack==='function'){self.ontrack(trackEvent);}});});}});window.setTimeout(function(){if(!(self&&self.transceivers)){return;} -self.transceivers.forEach(function(transceiver){if(transceiver.iceTransport&&transceiver.iceTransport.state==='new'&&transceiver.iceTransport.getRemoteCandidates().length>0){console.warn('Timeout for addRemoteCandidate. Consider sending '+'an end-of-candidates notification');transceiver.iceTransport.addRemoteCandidate({});}});},4000);return new Promise(function(resolve){if(args.length>1&&typeof args[1]==='function'){args[1].apply(null);} -resolve();});};RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(transceiver){if(transceiver.iceTransport){transceiver.iceTransport.stop();} +fireAddTrack(pc,track,receiver,[stream]);});}});receiverList.forEach(function(item){if(item[2]){return;} +fireAddTrack(pc,item[0],item[1],[]);});window.setTimeout(function(){if(!(pc&&pc.transceivers)){return;} +pc.transceivers.forEach(function(transceiver){if(transceiver.iceTransport&&transceiver.iceTransport.state==='new'&&transceiver.iceTransport.getRemoteCandidates().length>0){console.warn('Timeout for addRemoteCandidate. Consider sending '+'an end-of-candidates notification');transceiver.iceTransport.addRemoteCandidate({});}});},4000);return Promise.resolve();};RTCPeerConnection.prototype.close=function(){this.transceivers.forEach(function(transceiver){if(transceiver.iceTransport){transceiver.iceTransport.stop();} if(transceiver.dtlsTransport){transceiver.dtlsTransport.stop();} if(transceiver.rtpSender){transceiver.rtpSender.stop();} -if(transceiver.rtpReceiver){transceiver.rtpReceiver.stop();}});this._updateSignalingState('closed');};RTCPeerConnection.prototype._updateSignalingState=function(newState){this.signalingState=newState;var event=new Event('signalingstatechange');this.dispatchEvent(event);if(typeof this.onsignalingstatechange==='function'){this.onsignalingstatechange(event);}};RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var self=this;if(this.signalingState!=='stable'||this.needNegotiation===true){return;} -this.needNegotiation=true;window.setTimeout(function(){if(self.needNegotiation===false){return;} -self.needNegotiation=false;var event=new Event('negotiationneeded');self.dispatchEvent(event);if(typeof self.onnegotiationneeded==='function'){self.onnegotiationneeded(event);}},0);};RTCPeerConnection.prototype._updateConnectionState=function(){var newState;var states={'new':0,closed:0,connecting:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};this.transceivers.forEach(function(transceiver){states[transceiver.iceTransport.state]++;states[transceiver.dtlsTransport.state]++;});states.connected+=states.completed;newState='new';if(states.failed>0){newState='failed';}else if(states.connecting>0||states.checking>0){newState='connecting';}else if(states.disconnected>0){newState='disconnected';}else if(states.new>0){newState='new';}else if(states.connected>0||states.completed>0){newState='connected';} -if(newState!==this.iceConnectionState){this.iceConnectionState=newState;var event=new Event('iceconnectionstatechange');this.dispatchEvent(event);if(typeof this.oniceconnectionstatechange==='function'){this.oniceconnectionstatechange(event);}}};RTCPeerConnection.prototype.createOffer=function(){var self=this;var args=arguments;var offerOptions;if(arguments.length===1&&typeof arguments[0]!=='function'){offerOptions=arguments[0];}else if(arguments.length===3){offerOptions=arguments[2];} -var numAudioTracks=this.transceivers.filter(function(t){return t.kind==='audio';}).length;var numVideoTracks=this.transceivers.filter(function(t){return t.kind==='video';}).length;if(offerOptions){if(offerOptions.mandatory||offerOptions.optional){throw new TypeError('Legacy mandatory/optional constraints not supported.');} +if(transceiver.rtpReceiver){transceiver.rtpReceiver.stop();}});this._isClosed=true;this._updateSignalingState('closed');};RTCPeerConnection.prototype._updateSignalingState=function(newState){this.signalingState=newState;var event=new Event('signalingstatechange');this._dispatchEvent('signalingstatechange',event);};RTCPeerConnection.prototype._maybeFireNegotiationNeeded=function(){var pc=this;if(this.signalingState!=='stable'||this.needNegotiation===true){return;} +this.needNegotiation=true;window.setTimeout(function(){if(pc.needNegotiation===false){return;} +pc.needNegotiation=false;var event=new Event('negotiationneeded');pc._dispatchEvent('negotiationneeded',event);},0);};RTCPeerConnection.prototype._updateConnectionState=function(){var newState;var states={'new':0,closed:0,connecting:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};this.transceivers.forEach(function(transceiver){states[transceiver.iceTransport.state]++;states[transceiver.dtlsTransport.state]++;});states.connected+=states.completed;newState='new';if(states.failed>0){newState='failed';}else if(states.connecting>0||states.checking>0){newState='connecting';}else if(states.disconnected>0){newState='disconnected';}else if(states.new>0){newState='new';}else if(states.connected>0||states.completed>0){newState='connected';} +if(newState!==this.iceConnectionState){this.iceConnectionState=newState;var event=new Event('iceconnectionstatechange');this._dispatchEvent('iceconnectionstatechange',event);}};RTCPeerConnection.prototype.createOffer=function(){var pc=this;if(this._isClosed){return Promise.reject(makeError('InvalidStateError','Can not call createOffer after close'));} +var numAudioTracks=this.transceivers.filter(function(t){return t.kind==='audio';}).length;var numVideoTracks=this.transceivers.filter(function(t){return t.kind==='video';}).length;var offerOptions=arguments[0];if(offerOptions){if(offerOptions.mandatory||offerOptions.optional){throw new TypeError('Legacy mandatory/optional constraints not supported.');} if(offerOptions.offerToReceiveAudio!==undefined){if(offerOptions.offerToReceiveAudio===true){numAudioTracks=1;}else if(offerOptions.offerToReceiveAudio===false){numAudioTracks=0;}else{numAudioTracks=offerOptions.offerToReceiveAudio;}} if(offerOptions.offerToReceiveVideo!==undefined){if(offerOptions.offerToReceiveVideo===true){numVideoTracks=1;}else if(offerOptions.offerToReceiveVideo===false){numVideoTracks=0;}else{numVideoTracks=offerOptions.offerToReceiveVideo;}}} this.transceivers.forEach(function(transceiver){if(transceiver.kind==='audio'){numAudioTracks--;if(numAudioTracks<0){transceiver.wantReceive=false;}}else if(transceiver.kind==='video'){numVideoTracks--;if(numVideoTracks<0){transceiver.wantReceive=false;}}});while(numAudioTracks>0||numVideoTracks>0){if(numAudioTracks>0){this._createTransceiver('audio');numAudioTracks--;} if(numVideoTracks>0){this._createTransceiver('video');numVideoTracks--;}} -var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);this.transceivers.forEach(function(transceiver,sdpMLineIndex){var track=transceiver.track;var kind=transceiver.kind;var mid=SDPUtils.generateIdentifier();transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=self._createIceGatherer(sdpMLineIndex,self.usingBundle);} +var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);this.transceivers.forEach(function(transceiver,sdpMLineIndex){var track=transceiver.track;var kind=transceiver.kind;var mid=SDPUtils.generateIdentifier();transceiver.mid=mid;if(!transceiver.iceGatherer){transceiver.iceGatherer=pc._createIceGatherer(sdpMLineIndex,pc.usingBundle);} var localCapabilities=window.RTCRtpSender.getCapabilities(kind);if(edgeVersion<15019){localCapabilities.codecs=localCapabilities.codecs.filter(function(codec){return codec.name!=='rtx';});} localCapabilities.codecs.forEach(function(codec){if(codec.name==='H264'&&codec.parameters['level-asymmetry-allowed']===undefined){codec.parameters['level-asymmetry-allowed']='1';}});var sendEncodingParameters=transceiver.sendEncodingParameters||[{ssrc:(2*sdpMLineIndex+1)*1001}];if(track){if(edgeVersion>=15019&&kind==='video'&&!sendEncodingParameters[0].rtx){sendEncodingParameters[0].rtx={ssrc:sendEncodingParameters[0].ssrc+1};}} if(transceiver.wantReceive){transceiver.rtpReceiver=new window.RTCRtpReceiver(transceiver.dtlsTransport,kind);} transceiver.localCapabilities=localCapabilities;transceiver.sendEncodingParameters=sendEncodingParameters;});if(this._config.bundlePolicy!=='max-compat'){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} -sdp+='a=ice-options:trickle\r\n';this.transceivers.forEach(function(transceiver,sdpMLineIndex){sdp+=writeMediaSection(transceiver,transceiver.localCapabilities,'offer',transceiver.stream,self._dtlsRole);sdp+='a=rtcp-rsize\r\n';if(transceiver.iceGatherer&&self.iceGatheringState!=='new'&&(sdpMLineIndex===0||!self.usingBundle)){transceiver.iceGatherer.getLocalCandidates().forEach(function(cand){cand.component=1;sdp+='a='+SDPUtils.writeCandidate(cand)+'\r\n';});if(transceiver.iceGatherer.state==='completed'){sdp+='a=end-of-candidates\r\n';}}});var desc=new window.RTCSessionDescription({type:'offer',sdp:sdp});return new Promise(function(resolve){if(args.length>0&&typeof args[0]==='function'){args[0].apply(null,[desc]);resolve();return;} -resolve(desc);});};RTCPeerConnection.prototype.createAnswer=function(){var self=this;var args=arguments;var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);if(this.usingBundle){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} +sdp+='a=ice-options:trickle\r\n';this.transceivers.forEach(function(transceiver,sdpMLineIndex){sdp+=writeMediaSection(transceiver,transceiver.localCapabilities,'offer',transceiver.stream,pc._dtlsRole);sdp+='a=rtcp-rsize\r\n';if(transceiver.iceGatherer&&pc.iceGatheringState!=='new'&&(sdpMLineIndex===0||!pc.usingBundle)){transceiver.iceGatherer.getLocalCandidates().forEach(function(cand){cand.component=1;sdp+='a='+SDPUtils.writeCandidate(cand)+'\r\n';});if(transceiver.iceGatherer.state==='completed'){sdp+='a=end-of-candidates\r\n';}}});var desc=new window.RTCSessionDescription({type:'offer',sdp:sdp});return Promise.resolve(desc);};RTCPeerConnection.prototype.createAnswer=function(){var pc=this;if(this._isClosed){return Promise.reject(makeError('InvalidStateError','Can not call createAnswer after close'));} +var sdp=SDPUtils.writeSessionBoilerplate(this._sdpSessionId,this._sdpSessionVersion++);if(this.usingBundle){sdp+='a=group:BUNDLE '+this.transceivers.map(function(t){return t.mid;}).join(' ')+'\r\n';} var mediaSectionsInOffer=SDPUtils.splitSections(this.remoteDescription.sdp).length-1;this.transceivers.forEach(function(transceiver,sdpMLineIndex){if(sdpMLineIndex+1>mediaSectionsInOffer){return;} if(transceiver.isDatachannel){sdp+='m=application 0 DTLS/SCTP 5000\r\n'+'c=IN IP4 0.0.0.0\r\n'+'a=mid:'+transceiver.mid+'\r\n';return;} if(transceiver.stream){var localTrack;if(transceiver.kind==='audio'){localTrack=transceiver.stream.getAudioTracks()[0];}else if(transceiver.kind==='video'){localTrack=transceiver.stream.getVideoTracks()[0];} if(localTrack){if(edgeVersion>=15019&&transceiver.kind==='video'&&!transceiver.sendEncodingParameters[0].rtx){transceiver.sendEncodingParameters[0].rtx={ssrc:transceiver.sendEncodingParameters[0].ssrc+1};}}} var commonCapabilities=getCommonCapabilities(transceiver.localCapabilities,transceiver.remoteCapabilities);var hasRtx=commonCapabilities.codecs.filter(function(c){return c.name.toLowerCase()==='rtx';}).length;if(!hasRtx&&transceiver.sendEncodingParameters[0].rtx){delete transceiver.sendEncodingParameters[0].rtx;} -sdp+=writeMediaSection(transceiver,commonCapabilities,'answer',transceiver.stream,self._dtlsRole);if(transceiver.rtcpParameters&&transceiver.rtcpParameters.reducedSize){sdp+='a=rtcp-rsize\r\n';}});var desc=new window.RTCSessionDescription({type:'answer',sdp:sdp});return new Promise(function(resolve){if(args.length>0&&typeof args[0]==='function'){args[0].apply(null,[desc]);resolve();return;} -resolve(desc);});};RTCPeerConnection.prototype.addIceCandidate=function(candidate){var err;var sections;if(!candidate||candidate.candidate===''){for(var j=0;j0?SDPUtils.parseCandidate(candidate.candidate):{};if(cand.protocol==='tcp'&&(cand.port===0||cand.port===9)){return Promise.resolve();} if(cand.component&&cand.component!==1){return Promise.resolve();} -if(sdpMLineIndex===0||(sdpMLineIndex>0&&transceiver.iceTransport!==this.transceivers[0].iceTransport)){if(!maybeAddCandidate(transceiver.iceTransport,cand)){err=new Error('Can not add ICE candidate');err.name='OperationError';}} -if(!err){var candidateString=candidate.candidate.trim();if(candidateString.indexOf('a=')===0){candidateString=candidateString.substr(2);} +if(sdpMLineIndex===0||(sdpMLineIndex>0&&transceiver.iceTransport!==this.transceivers[0].iceTransport)){if(!maybeAddCandidate(transceiver.iceTransport,cand)){return Promise.reject(makeError('OperationError','Can not add ICE candidate'));}} +var candidateString=candidate.candidate.trim();if(candidateString.indexOf('a=')===0){candidateString=candidateString.substr(2);} sections=SDPUtils.splitSections(this.remoteDescription.sdp);sections[sdpMLineIndex+1]+='a='+ (cand.type?candidateString:'end-of-candidates') -+'\r\n';this.remoteDescription.sdp=sections.join('');}}else{err=new Error('Can not add ICE candidate');err.name='OperationError';}} -var args=arguments;return new Promise(function(resolve,reject){if(err){if(args.length>2&&typeof args[2]==='function'){args[2].apply(null,[err]);} -reject(err);}else{if(args.length>1&&typeof args[1]==='function'){args[1].apply(null);} -resolve();}});};RTCPeerConnection.prototype.getStats=function(){var promises=[];this.transceivers.forEach(function(transceiver){['rtpSender','rtpReceiver','iceGatherer','iceTransport','dtlsTransport'].forEach(function(method){if(transceiver[method]){promises.push(transceiver[method].getStats());}});});var cb=arguments.length>1&&typeof arguments[1]==='function'&&arguments[1];var fixStatsType=function(stat){return{inboundrtp:'inbound-rtp',outboundrtp:'outbound-rtp',candidatepair:'candidate-pair',localcandidate:'local-candidate',remotecandidate:'remote-candidate'}[stat.type]||stat.type;};return new Promise(function(resolve){var results=new Map();Promise.all(promises).then(function(res){res.forEach(function(result){Object.keys(result).forEach(function(id){result[id].type=fixStatsType(result[id]);results.set(id,result[id]);});});if(cb){cb.apply(null,results);} -resolve(results);});});};return RTCPeerConnection;};},{"sdp":2}],2:[function(require,module,exports){'use strict';var SDPUtils={};SDPUtils.generateIdentifier=function(){return Math.random().toString(36).substr(2,10);};SDPUtils.localCName=SDPUtils.generateIdentifier();SDPUtils.splitLines=function(blob){return blob.trim().split('\n').map(function(line){return line.trim();});};SDPUtils.splitSections=function(blob){var parts=blob.split('\nm=');return parts.map(function(part,index){return(index>0?'m='+part:part).trim()+'\r\n';});};SDPUtils.matchPrefix=function(blob,prefix){return SDPUtils.splitLines(blob).filter(function(line){return line.indexOf(prefix)===0;});};SDPUtils.parseCandidate=function(line){var parts;if(line.indexOf('a=candidate:')===0){parts=line.substring(12).split(' ');}else{parts=line.substring(10).split(' ');} ++'\r\n';this.remoteDescription.sdp=sections.join('');}else{return Promise.reject(makeError('OperationError','Can not add ICE candidate'));}} +return Promise.resolve();};RTCPeerConnection.prototype.getStats=function(){var promises=[];this.transceivers.forEach(function(transceiver){['rtpSender','rtpReceiver','iceGatherer','iceTransport','dtlsTransport'].forEach(function(method){if(transceiver[method]){promises.push(transceiver[method].getStats());}});});var fixStatsType=function(stat){return{inboundrtp:'inbound-rtp',outboundrtp:'outbound-rtp',candidatepair:'candidate-pair',localcandidate:'local-candidate',remotecandidate:'remote-candidate'}[stat.type]||stat.type;};return new Promise(function(resolve){var results=new Map();Promise.all(promises).then(function(res){res.forEach(function(result){Object.keys(result).forEach(function(id){result[id].type=fixStatsType(result[id]);results.set(id,result[id]);});});resolve(results);});});};var methods=['createOffer','createAnswer'];methods.forEach(function(method){var nativeMethod=RTCPeerConnection.prototype[method];RTCPeerConnection.prototype[method]=function(){var args=arguments;if(typeof args[0]==='function'||typeof args[1]==='function'){return nativeMethod.apply(this,[arguments[2]]).then(function(description){if(typeof args[0]==='function'){args[0].apply(null,[description]);}},function(error){if(typeof args[1]==='function'){args[1].apply(null,[error]);}});} +return nativeMethod.apply(this,arguments);};});methods=['setLocalDescription','setRemoteDescription','addIceCandidate'];methods.forEach(function(method){var nativeMethod=RTCPeerConnection.prototype[method];RTCPeerConnection.prototype[method]=function(){var args=arguments;if(typeof args[1]==='function'||typeof args[2]==='function'){return nativeMethod.apply(this,arguments).then(function(){if(typeof args[1]==='function'){args[1].apply(null);}},function(error){if(typeof args[2]==='function'){args[2].apply(null,[error]);}});} +return nativeMethod.apply(this,arguments);};});['getStats'].forEach(function(method){var nativeMethod=RTCPeerConnection.prototype[method];RTCPeerConnection.prototype[method]=function(){var args=arguments;if(typeof args[1]==='function'){return nativeMethod.apply(this,arguments).then(function(){if(typeof args[1]==='function'){args[1].apply(null);}});} +return nativeMethod.apply(this,arguments);};});return RTCPeerConnection;};},{"sdp":2}],2:[function(require,module,exports){'use strict';var SDPUtils={};SDPUtils.generateIdentifier=function(){return Math.random().toString(36).substr(2,10);};SDPUtils.localCName=SDPUtils.generateIdentifier();SDPUtils.splitLines=function(blob){return blob.trim().split('\n').map(function(line){return line.trim();});};SDPUtils.splitSections=function(blob){var parts=blob.split('\nm=');return parts.map(function(part,index){return(index>0?'m='+part:part).trim()+'\r\n';});};SDPUtils.matchPrefix=function(blob,prefix){return SDPUtils.splitLines(blob).filter(function(line){return line.indexOf(prefix)===0;});};SDPUtils.parseCandidate=function(line){var parts;if(line.indexOf('a=candidate:')===0){parts=line.substring(12).split(' ');}else{parts=line.substring(10).split(' ');} var candidate={foundation:parts[0],component:parseInt(parts[1],10),protocol:parts[2].toLowerCase(),priority:parseInt(parts[3],10),ip:parts[4],port:parseInt(parts[5],10),type:parts[7]};for(var i=8;i=64){return;} -var origGetLocalStreams=window.RTCPeerConnection.prototype.getLocalStreams;window.RTCPeerConnection.prototype.getLocalStreams=function(){var self=this;var nativeStreams=origGetLocalStreams.apply(this);self._reverseStreams=self._reverseStreams||{};return nativeStreams.map(function(stream){return self._reverseStreams[stream.id];});};var origAddStream=window.RTCPeerConnection.prototype.addStream;window.RTCPeerConnection.prototype.addStream=function(stream){var pc=this;pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};stream.getTracks().forEach(function(track){var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');}});if(!pc._reverseStreams[stream.id]){var newStream=new window.MediaStream(stream.getTracks());pc._streams[stream.id]=newStream;pc._reverseStreams[newStream.id]=stream;stream=newStream;} +self.src=URL.createObjectURL(stream);});}});}}},shimAddTrackRemoveTrackWithNative:function(window){window.RTCPeerConnection.prototype.getLocalStreams=function(){var pc=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{};return Object.keys(this._shimmedLocalStreams).map(function(streamId){return pc._shimmedLocalStreams[streamId][0];});};var origAddTrack=window.RTCPeerConnection.prototype.addTrack;window.RTCPeerConnection.prototype.addTrack=function(track,stream){if(!stream){return origAddTrack.apply(this,arguments);} +this._shimmedLocalStreams=this._shimmedLocalStreams||{};var sender=origAddTrack.apply(this,arguments);if(!this._shimmedLocalStreams[stream.id]){this._shimmedLocalStreams[stream.id]=[stream,sender];}else if(this._shimmedLocalStreams[stream.id].indexOf(sender)===-1){this._shimmedLocalStreams[stream.id].push(sender);} +return sender;};var origAddStream=window.RTCPeerConnection.prototype.addStream;window.RTCPeerConnection.prototype.addStream=function(stream){var pc=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{};stream.getTracks().forEach(function(track){var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');}});var existingSenders=pc.getSenders();origAddStream.apply(this,arguments);var newSenders=pc.getSenders().filter(function(newSender){return existingSenders.indexOf(newSender)===-1;});this._shimmedLocalStreams[stream.id]=[stream].concat(newSenders);};var origRemoveStream=window.RTCPeerConnection.prototype.removeStream;window.RTCPeerConnection.prototype.removeStream=function(stream){this._shimmedLocalStreams=this._shimmedLocalStreams||{};delete this._shimmedLocalStreams[stream.id];return origRemoveStream.apply(this,arguments);};var origRemoveTrack=window.RTCPeerConnection.prototype.removeTrack;window.RTCPeerConnection.prototype.removeTrack=function(sender){var pc=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{};if(sender){Object.keys(this._shimmedLocalStreams).forEach(function(streamId){var idx=pc._shimmedLocalStreams[streamId].indexOf(sender);if(idx!==-1){pc._shimmedLocalStreams[streamId].splice(idx,1);} +if(pc._shimmedLocalStreams[streamId].length===1){delete pc._shimmedLocalStreams[streamId];}});} +return origRemoveTrack.apply(this,arguments);};},shimAddTrackRemoveTrack:function(window){var browserDetails=utils.detectBrowser(window);if(window.RTCPeerConnection.prototype.addTrack&&browserDetails.version>=65){return this.shimAddTrackRemoveTrackWithNative(window);} +var origGetLocalStreams=window.RTCPeerConnection.prototype.getLocalStreams;window.RTCPeerConnection.prototype.getLocalStreams=function(){var pc=this;var nativeStreams=origGetLocalStreams.apply(this);pc._reverseStreams=pc._reverseStreams||{};return nativeStreams.map(function(stream){return pc._reverseStreams[stream.id];});};var origAddStream=window.RTCPeerConnection.prototype.addStream;window.RTCPeerConnection.prototype.addStream=function(stream){var pc=this;pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};stream.getTracks().forEach(function(track){var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');}});if(!pc._reverseStreams[stream.id]){var newStream=new window.MediaStream(stream.getTracks());pc._streams[stream.id]=newStream;pc._reverseStreams[newStream.id]=stream;stream=newStream;} origAddStream.apply(pc,[stream]);};var origRemoveStream=window.RTCPeerConnection.prototype.removeStream;window.RTCPeerConnection.prototype.removeStream=function(stream){var pc=this;pc._streams=pc._streams||{};pc._reverseStreams=pc._reverseStreams||{};origRemoveStream.apply(pc,[(pc._streams[stream.id]||stream)]);delete pc._reverseStreams[(pc._streams[stream.id]?pc._streams[stream.id].id:stream.id)];delete pc._streams[stream.id];};window.RTCPeerConnection.prototype.addTrack=function(track,stream){var pc=this;if(pc.signalingState==='closed'){throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.','InvalidStateError');} var streams=[].slice.call(arguments,1);if(streams.length!==1||!streams[0].getTracks().find(function(t){return t===track;})){throw new DOMException('The adapter.js addTrack polyfill only supports a single '+' stream which is associated with the specified track.','NotSupportedError');} var alreadyExists=pc.getSenders().find(function(s){return s.track===track;});if(alreadyExists){throw new DOMException('Track already exists.','InvalidAccessError');} @@ -489,20 +501,20 @@ return replaceInternalStreamId(pc,description);}});window.RTCPeerConnection.prot if(!sender._pc){throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack '+'does not implement interface RTCRtpSender.','TypeError');} var isLocal=sender._pc===pc;if(!isLocal){throw new DOMException('Sender was not created by this connection.','InvalidAccessError');} pc._streams=pc._streams||{};var stream;Object.keys(pc._streams).forEach(function(streamid){var hasTrack=pc._streams[streamid].getTracks().find(function(track){return sender.track===track;});if(hasTrack){stream=pc._streams[streamid];}});if(stream){if(stream.getTracks().length===1){pc.removeStream(pc._reverseStreams[stream.id]);}else{stream.removeTrack(sender.track);} -pc.dispatchEvent(new Event('negotiationneeded'));}};},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(!window.RTCPeerConnection){window.RTCPeerConnection=function(pcConfig,pcConstraints){logging('PeerConnection');if(pcConfig&&pcConfig.iceTransportPolicy){pcConfig.iceTransports=pcConfig.iceTransportPolicy;} +pc.dispatchEvent(new Event('negotiationneeded'));}};},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(!window.RTCPeerConnection&&window.webkitRTCPeerConnection){window.RTCPeerConnection=function(pcConfig,pcConstraints){logging('PeerConnection');if(pcConfig&&pcConfig.iceTransportPolicy){pcConfig.iceTransports=pcConfig.iceTransportPolicy;} return new window.webkitRTCPeerConnection(pcConfig,pcConstraints);};window.RTCPeerConnection.prototype=window.webkitRTCPeerConnection.prototype;if(window.webkitRTCPeerConnection.generateCertificate){Object.defineProperty(window.RTCPeerConnection,'generateCertificate',{get:function(){return window.webkitRTCPeerConnection.generateCertificate;}});}}else{var OrigPeerConnection=window.RTCPeerConnection;window.RTCPeerConnection=function(pcConfig,pcConstraints){if(pcConfig&&pcConfig.iceServers){var newIceServers=[];for(var i=0;i0&&typeof selector==='function'){return origGetStats.apply(this,arguments);} +var origGetStats=window.RTCPeerConnection.prototype.getStats;window.RTCPeerConnection.prototype.getStats=function(selector,successCallback,errorCallback){var pc=this;var args=arguments;if(arguments.length>0&&typeof selector==='function'){return origGetStats.apply(this,arguments);} if(origGetStats.length===0&&(arguments.length===0||typeof arguments[0]!=='function')){return origGetStats.apply(this,[]);} var fixChromeStats_=function(response){var standardReport={};var reports=response.result();reports.forEach(function(report){var standardStats={id:report.id,timestamp:report.timestamp,type:{localcandidate:'local-candidate',remotecandidate:'remote-candidate'}[report.type]||report.type};report.names().forEach(function(name){standardStats[name]=report.stat(name);});standardReport[standardStats.id]=standardStats;});return standardReport;};var makeMapStats=function(stats){return new Map(Object.keys(stats).map(function(key){return[key,stats[key]];}));};if(arguments.length>=2){var successCallbackWrapper_=function(response){args[1](makeMapStats(fixChromeStats_(response)));};return origGetStats.apply(this,[successCallbackWrapper_,arguments[0]]);} -return new Promise(function(resolve,reject){origGetStats.apply(self,[function(response){resolve(makeMapStats(fixChromeStats_(response)));},reject]);}).then(successCallback,errorCallback);};if(browserDetails.version<51){['setLocalDescription','setRemoteDescription','addIceCandidate'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){var args=arguments;var self=this;var promise=new Promise(function(resolve,reject){nativeMethod.apply(self,[args[0],resolve,reject]);});if(args.length<2){return promise;} +return new Promise(function(resolve,reject){origGetStats.apply(pc,[function(response){resolve(makeMapStats(fixChromeStats_(response)));},reject]);}).then(successCallback,errorCallback);};if(browserDetails.version<51){['setLocalDescription','setRemoteDescription','addIceCandidate'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){var args=arguments;var pc=this;var promise=new Promise(function(resolve,reject){nativeMethod.apply(pc,[args[0],resolve,reject]);});if(args.length<2){return promise;} return promise.then(function(){args[1].apply(null,[]);},function(err){if(args.length>=3){args[2].apply(null,[err]);}});};});} -if(browserDetails.version<52){['createOffer','createAnswer'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){var self=this;if(arguments.length<1||(arguments.length===1&&typeof arguments[0]==='object')){var opts=arguments.length===1?arguments[0]:undefined;return new Promise(function(resolve,reject){nativeMethod.apply(self,[resolve,reject,opts]);});} +if(browserDetails.version<52){['createOffer','createAnswer'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){var pc=this;if(arguments.length<1||(arguments.length===1&&typeof arguments[0]==='object')){var opts=arguments.length===1?arguments[0]:undefined;return new Promise(function(resolve,reject){nativeMethod.apply(pc,[resolve,reject,opts]);});} return nativeMethod.apply(this,arguments);};});} ['setLocalDescription','setRemoteDescription','addIceCandidate'].forEach(function(method){var nativeMethod=window.RTCPeerConnection.prototype[method];window.RTCPeerConnection.prototype[method]=function(){arguments[0]=new((method==='addIceCandidate')?window.RTCIceCandidate:window.RTCSessionDescription)(arguments[0]);return nativeMethod.apply(this,arguments);};});var nativeAddIceCandidate=window.RTCPeerConnection.prototype.addIceCandidate;window.RTCPeerConnection.prototype.addIceCandidate=function(){if(!arguments[0]){if(arguments[1]){arguments[1].apply(null);} return Promise.resolve();} -return nativeAddIceCandidate.apply(this,arguments);};}};module.exports={shimMediaStream:chromeShim.shimMediaStream,shimOnTrack:chromeShim.shimOnTrack,shimAddTrackRemoveTrack:chromeShim.shimAddTrackRemoveTrack,shimGetSendersWithDtmf:chromeShim.shimGetSendersWithDtmf,shimSourceObject:chromeShim.shimSourceObject,shimPeerConnection:chromeShim.shimPeerConnection,shimGetUserMedia:require('./getusermedia')};},{"../utils.js":13,"./getusermedia":6}],6:[function(require,module,exports){'use strict';var utils=require('../utils.js');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var constraintsToChrome_=function(c){if(typeof c!=='object'||c.mandatory||c.optional){return c;} +return nativeAddIceCandidate.apply(this,arguments);};}};},{"../utils.js":13,"./getusermedia":6}],6:[function(require,module,exports){'use strict';var utils=require('../utils.js');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var constraintsToChrome_=function(c){if(typeof c!=='object'||c.mandatory||c.optional){return c;} var cc={};Object.keys(c).forEach(function(key){if(key==='require'||key==='advanced'||key==='mediaSource'){return;} var r=(typeof c[key]==='object')?c[key]:{ideal:c[key]};if(r.exact!==undefined&&typeof r.exact==='number'){r.min=r.max=r.exact;} var oldname_=function(prefix,name){if(prefix){return prefix+name.charAt(0).toUpperCase()+name.slice(1);} @@ -519,24 +531,29 @@ logging('chrome: '+JSON.stringify(constraints));return func(constraints);};var s if(!navigator.mediaDevices.getUserMedia){navigator.mediaDevices.getUserMedia=function(constraints){return getUserMediaPromise_(constraints);};}else{var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(cs){return shimConstraints_(cs,function(c){return origGetUserMedia(c).then(function(stream){if(c.audio&&!stream.getAudioTracks().length||c.video&&!stream.getVideoTracks().length){stream.getTracks().forEach(function(track){track.stop();});throw new DOMException('','NotFoundError');} return stream;},function(e){return Promise.reject(shimError_(e));});});};} if(typeof navigator.mediaDevices.addEventListener==='undefined'){navigator.mediaDevices.addEventListener=function(){logging('Dummy mediaDevices.addEventListener called.');};} -if(typeof navigator.mediaDevices.removeEventListener==='undefined'){navigator.mediaDevices.removeEventListener=function(){logging('Dummy mediaDevices.removeEventListener called.');};}};},{"../utils.js":13}],7:[function(require,module,exports){'use strict';var SDPUtils=require('sdp');var utils=require('./utils');function wrapPeerConnectionEvent(window,eventNameToWrap,wrapper){if(!window.RTCPeerConnection){return;} -var proto=window.RTCPeerConnection.prototype;var nativeAddEventListener=proto.addEventListener;proto.addEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap){return nativeAddEventListener.apply(this,arguments);} -var wrappedCallback=function(e){cb(wrapper(e));};this._eventMap=this._eventMap||{};this._eventMap[cb]=wrappedCallback;return nativeAddEventListener.apply(this,[nativeEventName,wrappedCallback]);};var nativeRemoveEventListener=proto.removeEventListener;proto.removeEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap||!this._eventMap||!this._eventMap[cb]){return nativeRemoveEventListener.apply(this,arguments);} -var unwrappedCb=this._eventMap[cb];delete this._eventMap[cb];return nativeRemoveEventListener.apply(this,[nativeEventName,unwrappedCb]);};Object.defineProperty(proto,'on'+eventNameToWrap,{get:function(){return this['_on'+eventNameToWrap];},set:function(cb){if(this['_on'+eventNameToWrap]){this.removeEventListener(eventNameToWrap,this['_on'+eventNameToWrap]);delete this['_on'+eventNameToWrap];} -if(cb){this.addEventListener(eventNameToWrap,this['_on'+eventNameToWrap]=cb);}}});} -module.exports={shimRTCIceCandidate:function(window){if(window.RTCIceCandidate&&'foundation'in +if(typeof navigator.mediaDevices.removeEventListener==='undefined'){navigator.mediaDevices.removeEventListener=function(){logging('Dummy mediaDevices.removeEventListener called.');};}};},{"../utils.js":13}],7:[function(require,module,exports){'use strict';var SDPUtils=require('sdp');var utils=require('./utils');module.exports={shimRTCIceCandidate:function(window){if(window.RTCIceCandidate&&'foundation'in window.RTCIceCandidate.prototype){return;} var NativeRTCIceCandidate=window.RTCIceCandidate;window.RTCIceCandidate=function(args){if(typeof args==='object'&&args.candidate&&args.candidate.indexOf('a=')===0){args=JSON.parse(JSON.stringify(args));args.candidate=args.candidate.substr(2);} -var nativeCandidate=new NativeRTCIceCandidate(args);var parsedCandidate=SDPUtils.parseCandidate(args.candidate);var augmentedCandidate=Object.assign(nativeCandidate,parsedCandidate);augmentedCandidate.toJSON=function(){return{candidate:augmentedCandidate.candidate,sdpMid:augmentedCandidate.sdpMid,sdpMLineIndex:augmentedCandidate.sdpMLineIndex,usernameFragment:augmentedCandidate.usernameFragment,};};return augmentedCandidate;};wrapPeerConnectionEvent(window,'icecandidate',function(e){if(e.candidate){Object.defineProperty(e,'candidate',{value:new window.RTCIceCandidate(e.candidate),writable:'false'});} +var nativeCandidate=new NativeRTCIceCandidate(args);var parsedCandidate=SDPUtils.parseCandidate(args.candidate);var augmentedCandidate=Object.assign(nativeCandidate,parsedCandidate);augmentedCandidate.toJSON=function(){return{candidate:augmentedCandidate.candidate,sdpMid:augmentedCandidate.sdpMid,sdpMLineIndex:augmentedCandidate.sdpMLineIndex,usernameFragment:augmentedCandidate.usernameFragment,};};return augmentedCandidate;};utils.wrapPeerConnectionEvent(window,'icecandidate',function(e){if(e.candidate){Object.defineProperty(e,'candidate',{value:new window.RTCIceCandidate(e.candidate),writable:'false'});} return e;});},shimCreateObjectURL:function(window){var URL=window&&window.URL;if(!(typeof window==='object'&&window.HTMLMediaElement&&'srcObject'in window.HTMLMediaElement.prototype&&URL.createObjectURL&&URL.revokeObjectURL)){return undefined;} var nativeCreateObjectURL=URL.createObjectURL.bind(URL);var nativeRevokeObjectURL=URL.revokeObjectURL.bind(URL);var streams=new Map(),newId=0;URL.createObjectURL=function(stream){if('getTracks'in stream){var url='polyblob:'+(++newId);streams.set(url,stream);utils.deprecated('URL.createObjectURL(stream)','elem.srcObject = stream');return url;} return nativeCreateObjectURL(stream);};URL.revokeObjectURL=function(url){nativeRevokeObjectURL(url);streams.delete(url);};var dsc=Object.getOwnPropertyDescriptor(window.HTMLMediaElement.prototype,'src');Object.defineProperty(window.HTMLMediaElement.prototype,'src',{get:function(){return dsc.get.apply(this);},set:function(url){this.srcObject=streams.get(url)||null;return dsc.set.apply(this,[url]);}});var nativeSetAttribute=window.HTMLMediaElement.prototype.setAttribute;window.HTMLMediaElement.prototype.setAttribute=function(){if(arguments.length===2&&(''+arguments[0]).toLowerCase()==='src'){this.srcObject=streams.get(arguments[1])||null;} -return nativeSetAttribute.apply(this,arguments);};}};},{"./utils":13,"sdp":2}],8:[function(require,module,exports){'use strict';var utils=require('../utils');var shimRTCPeerConnection=require('rtcpeerconnection-shim');module.exports={shimGetUserMedia:require('./getusermedia'),shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(window.RTCIceGatherer){if(!window.RTCIceCandidate){window.RTCIceCandidate=function(args){return args;};} +return nativeSetAttribute.apply(this,arguments);};},shimMaxMessageSize:function(window){if(window.RTCSctpTransport||!window.RTCPeerConnection){return;} +var browserDetails=utils.detectBrowser(window);if(!('sctp'in window.RTCPeerConnection.prototype)){Object.defineProperty(window.RTCPeerConnection.prototype,'sctp',{get:function(){return typeof this._sctp==='undefined'?null:this._sctp;}});} +var sctpInDescription=function(description){var sections=SDPUtils.splitSections(description.sdp);sections.shift();return sections.some(function(mediaSection){var mLine=SDPUtils.parseMLine(mediaSection);return mLine&&mLine.kind==='application'&&mLine.protocol.indexOf('SCTP')!==-1;});};var getRemoteFirefoxVersion=function(description){var match=description.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(match===null||match.length<2){return-1;} +var version=parseInt(match[1],10);return version!==version?-1:version;};var getCanSendMaxMessageSize=function(remoteIsFirefox){var canSendMaxMessageSize=65536;if(browserDetails.browser==='firefox'){if(browserDetails.version<57){if(remoteIsFirefox===-1){canSendMaxMessageSize=16384;}else{canSendMaxMessageSize=2147483637;}}else{canSendMaxMessageSize=browserDetails.version===57?65535:65536;}} +return canSendMaxMessageSize;};var getMaxMessageSize=function(description,remoteIsFirefox){var maxMessageSize=65536;if(browserDetails.browser==='firefox'&&browserDetails.version===57){maxMessageSize=65535;} +var match=SDPUtils.matchPrefix(description.sdp,'a=max-message-size:');if(match.length>0){maxMessageSize=parseInt(match[0].substr(19),10);}else if(browserDetails.browser==='firefox'&&remoteIsFirefox!==-1){maxMessageSize=2147483637;} +return maxMessageSize;};var origSetRemoteDescription=window.RTCPeerConnection.prototype.setRemoteDescription;window.RTCPeerConnection.prototype.setRemoteDescription=function(){var pc=this;pc._sctp=null;if(sctpInDescription(arguments[0])){var isFirefox=getRemoteFirefoxVersion(arguments[0]);var canSendMMS=getCanSendMaxMessageSize(isFirefox);var remoteMMS=getMaxMessageSize(arguments[0],isFirefox);var maxMessageSize;if(canSendMMS===0&&remoteMMS===0){maxMessageSize=Number.POSITIVE_INFINITY;}else if(canSendMMS===0||remoteMMS===0){maxMessageSize=Math.max(canSendMMS,remoteMMS);}else{maxMessageSize=Math.min(canSendMMS,remoteMMS);} +var sctp={};Object.defineProperty(sctp,'maxMessageSize',{get:function(){return maxMessageSize;}});pc._sctp=sctp;} +return origSetRemoteDescription.apply(pc,arguments);};},shimSendThrowTypeError:function(window){var origCreateDataChannel=window.RTCPeerConnection.prototype.createDataChannel;window.RTCPeerConnection.prototype.createDataChannel=function(){var pc=this;var dataChannel=origCreateDataChannel.apply(pc,arguments);var origDataChannelSend=dataChannel.send;dataChannel.send=function(){var dc=this;var data=arguments[0];var length=data.length||data.size||data.byteLength;if(length>pc.sctp.maxMessageSize){throw new DOMException('Message too large (can send a maximum of '+ +pc.sctp.maxMessageSize+' bytes)','TypeError');} +return origDataChannelSend.apply(dc,arguments);};return dataChannel;};}};},{"./utils":13,"sdp":2}],8:[function(require,module,exports){'use strict';var utils=require('../utils');var shimRTCPeerConnection=require('rtcpeerconnection-shim');module.exports={shimGetUserMedia:require('./getusermedia'),shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(window.RTCIceGatherer){if(!window.RTCIceCandidate){window.RTCIceCandidate=function(args){return args;};} if(!window.RTCSessionDescription){window.RTCSessionDescription=function(args){return args;};} if(browserDetails.version<15025){var origMSTEnabled=Object.getOwnPropertyDescriptor(window.MediaStreamTrack.prototype,'enabled');Object.defineProperty(window.MediaStreamTrack.prototype,'enabled',{set:function(value){origMSTEnabled.set.call(this,value);var ev=new Event('enabled');ev.enabled=value;this.dispatchEvent(ev);}});}} if(window.RTCRtpSender&&!('dtmf'in window.RTCRtpSender.prototype)){Object.defineProperty(window.RTCRtpSender.prototype,'dtmf',{get:function(){if(this._dtmf===undefined){if(this.track.kind==='audio'){this._dtmf=new window.RTCDtmfSender(this);}else if(this.track.kind==='video'){this._dtmf=null;}} return this._dtmf;}});} -window.RTCPeerConnection=shimRTCPeerConnection(window,browserDetails.version);},shimReplaceTrack:function(window){if(window.RTCRtpSender&&!('replaceTrack'in window.RTCRtpSender.prototype)){window.RTCRtpSender.prototype.replaceTrack=window.RTCRtpSender.prototype.setTrack;}}};},{"../utils":13,"./getusermedia":9,"rtcpeerconnection-shim":1}],9:[function(require,module,exports){'use strict';module.exports=function(window){var navigator=window&&window.navigator;var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError'}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name;}};};var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(c){return origGetUserMedia(c).catch(function(e){return Promise.reject(shimError_(e));});};};},{}],10:[function(require,module,exports){'use strict';var utils=require('../utils');var firefoxShim={shimOnTrack:function(window){if(typeof window==='object'&&window.RTCPeerConnection&&!('ontrack'in +window.RTCPeerConnection=shimRTCPeerConnection(window,browserDetails.version);},shimReplaceTrack:function(window){if(window.RTCRtpSender&&!('replaceTrack'in window.RTCRtpSender.prototype)){window.RTCRtpSender.prototype.replaceTrack=window.RTCRtpSender.prototype.setTrack;}}};},{"../utils":13,"./getusermedia":9,"rtcpeerconnection-shim":1}],9:[function(require,module,exports){'use strict';module.exports=function(window){var navigator=window&&window.navigator;var shimError_=function(e){return{name:{PermissionDeniedError:'NotAllowedError'}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name;}};};var origGetUserMedia=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);navigator.mediaDevices.getUserMedia=function(c){return origGetUserMedia(c).catch(function(e){return Promise.reject(shimError_(e));});};};},{}],10:[function(require,module,exports){'use strict';var utils=require('../utils');module.exports={shimGetUserMedia:require('./getusermedia'),shimOnTrack:function(window){if(typeof window==='object'&&window.RTCPeerConnection&&!('ontrack'in window.RTCPeerConnection.prototype)){Object.defineProperty(window.RTCPeerConnection.prototype,'ontrack',{get:function(){return this._ontrack;},set:function(f){if(this._ontrack){this.removeEventListener('track',this._ontrack);this.removeEventListener('addstream',this._ontrackpoly);} this.addEventListener('track',this._ontrack=f);this.addEventListener('addstream',this._ontrackpoly=function(e){e.stream.getTracks().forEach(function(track){var event=new Event('track');event.track=track;event.receiver={track:track};event.transceiver={receiver:event.receiver};event.streams=[e.stream];this.dispatchEvent(event);}.bind(this));}.bind(this));}});} if(typeof window==='object'&&window.RTCTrackEvent&&('receiver'in window.RTCTrackEvent.prototype)&&!('transceiver'in window.RTCTrackEvent.prototype)){Object.defineProperty(window.RTCTrackEvent.prototype,'transceiver',{get:function(){return{receiver:this.receiver};}});}},shimSourceObject:function(window){if(typeof window==='object'){if(window.HTMLMediaElement&&!('srcObject'in window.HTMLMediaElement.prototype)){Object.defineProperty(window.HTMLMediaElement.prototype,'srcObject',{get:function(){return this.mozSrcObject;},set:function(stream){this.mozSrcObject=stream;}});}}},shimPeerConnection:function(window){var browserDetails=utils.detectBrowser(window);if(typeof window!=='object'||!(window.RTCPeerConnection||window.mozRTCPeerConnection)){return;} @@ -551,7 +568,7 @@ return nativeAddIceCandidate.apply(this,arguments);};var makeMapStats=function(s if(browserDetails.version<53&&!onSucc){try{stats.forEach(function(stat){stat.type=modernStatsTypes[stat.type]||stat.type;});}catch(e){if(e.name!=='TypeError'){throw e;} stats.forEach(function(stat,i){stats.set(i,Object.assign({},stat,{type:modernStatsTypes[stat.type]||stat.type}));});}} return stats;}).then(onSucc,onErr);};},shimRemoveStream:function(window){if(!window.RTCPeerConnection||'removeStream'in window.RTCPeerConnection.prototype){return;} -window.RTCPeerConnection.prototype.removeStream=function(stream){var pc=this;utils.deprecated('removeStream','removeTrack');this.getSenders().forEach(function(sender){if(sender.track&&stream.getTracks().indexOf(sender.track)!==-1){pc.removeTrack(sender);}});};}};module.exports={shimOnTrack:firefoxShim.shimOnTrack,shimSourceObject:firefoxShim.shimSourceObject,shimPeerConnection:firefoxShim.shimPeerConnection,shimRemoveStream:firefoxShim.shimRemoveStream,shimGetUserMedia:require('./getusermedia')};},{"../utils":13,"./getusermedia":11}],11:[function(require,module,exports){'use strict';var utils=require('../utils');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var MediaStreamTrack=window&&window.MediaStreamTrack;var shimError_=function(e){return{name:{InternalError:'NotReadableError',NotSupportedError:'TypeError',PermissionDeniedError:'NotAllowedError',SecurityError:'NotAllowedError'}[e.name]||e.name,message:{'The operation is insecure.':'The request is not allowed by the '+'user agent or the platform in the current context.'}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&': ')+this.message;}};};var getUserMedia_=function(constraints,onSuccess,onError){var constraintsToFF37_=function(c){if(typeof c!=='object'||c.require){return c;} +window.RTCPeerConnection.prototype.removeStream=function(stream){var pc=this;utils.deprecated('removeStream','removeTrack');this.getSenders().forEach(function(sender){if(sender.track&&stream.getTracks().indexOf(sender.track)!==-1){pc.removeTrack(sender);}});};}};},{"../utils":13,"./getusermedia":11}],11:[function(require,module,exports){'use strict';var utils=require('../utils');var logging=utils.log;module.exports=function(window){var browserDetails=utils.detectBrowser(window);var navigator=window&&window.navigator;var MediaStreamTrack=window&&window.MediaStreamTrack;var shimError_=function(e){return{name:{InternalError:'NotReadableError',NotSupportedError:'TypeError',PermissionDeniedError:'NotAllowedError',SecurityError:'NotAllowedError'}[e.name]||e.name,message:{'The operation is insecure.':'The request is not allowed by the '+'user agent or the platform in the current context.'}[e.message]||e.message,constraint:e.constraint,toString:function(){return this.name+(this.message&&': ')+this.message;}};};var getUserMedia_=function(constraints,onSuccess,onError){var constraintsToFF37_=function(c){if(typeof c!=='object'||c.require){return c;} var require=[];Object.keys(c).forEach(function(key){if(key==='require'||key==='advanced'||key==='mediaSource'){return;} var r=c[key]=(typeof c[key]==='object')?c[key]:{ideal:c[key]};if(r.min!==undefined||r.max!==undefined||r.exact!==undefined){require.push(key);} if(r.exact!==undefined){if(typeof r.exact==='number'){r.min=r.max=r.exact;}else{c[key]=r.exact;} @@ -571,7 +588,7 @@ return nativeGetUserMedia(c);};if(MediaStreamTrack&&MediaStreamTrack.prototype.g if(MediaStreamTrack&&MediaStreamTrack.prototype.applyConstraints){var nativeApplyConstraints=MediaStreamTrack.prototype.applyConstraints;MediaStreamTrack.prototype.applyConstraints=function(c){if(this.kind==='audio'&&typeof c==='object'){c=JSON.parse(JSON.stringify(c));remap(c,'autoGainControl','mozAutoGainControl');remap(c,'noiseSuppression','mozNoiseSuppression');} return nativeApplyConstraints.apply(this,[c]);};}} navigator.getUserMedia=function(constraints,onSuccess,onError){if(browserDetails.version<44){return getUserMedia_(constraints,onSuccess,onError);} -utils.deprecated('navigator.getUserMedia','navigator.mediaDevices.getUserMedia');navigator.mediaDevices.getUserMedia(constraints).then(onSuccess,onError);};};},{"../utils":13}],12:[function(require,module,exports){'use strict';var utils=require('../utils');var safariShim={shimLocalStreamsAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} +utils.deprecated('navigator.getUserMedia','navigator.mediaDevices.getUserMedia');navigator.mediaDevices.getUserMedia(constraints).then(onSuccess,onError);};};},{"../utils":13}],12:[function(require,module,exports){'use strict';var utils=require('../utils');module.exports={shimLocalStreamsAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} if(!('getLocalStreams'in window.RTCPeerConnection.prototype)){window.RTCPeerConnection.prototype.getLocalStreams=function(){if(!this._localStreams){this._localStreams=[];} return this._localStreams;};} if(!('getStreamById'in window.RTCPeerConnection.prototype)){window.RTCPeerConnection.prototype.getStreamById=function(id){var result=null;if(this._localStreams){this._localStreams.forEach(function(stream){if(stream.id===id){result=stream;}});} @@ -579,16 +596,16 @@ if(this._remoteStreams){this._remoteStreams.forEach(function(stream){if(stream.i return result;};} if(!('addStream'in window.RTCPeerConnection.prototype)){var _addTrack=window.RTCPeerConnection.prototype.addTrack;window.RTCPeerConnection.prototype.addStream=function(stream){if(!this._localStreams){this._localStreams=[];} if(this._localStreams.indexOf(stream)===-1){this._localStreams.push(stream);} -var self=this;stream.getTracks().forEach(function(track){_addTrack.call(self,track,stream);});};window.RTCPeerConnection.prototype.addTrack=function(track,stream){if(stream){if(!this._localStreams){this._localStreams=[stream];}else if(this._localStreams.indexOf(stream)===-1){this._localStreams.push(stream);}} +var pc=this;stream.getTracks().forEach(function(track){_addTrack.call(pc,track,stream);});};window.RTCPeerConnection.prototype.addTrack=function(track,stream){if(stream){if(!this._localStreams){this._localStreams=[stream];}else if(this._localStreams.indexOf(stream)===-1){this._localStreams.push(stream);}} return _addTrack.call(this,track,stream);};} if(!('removeStream'in window.RTCPeerConnection.prototype)){window.RTCPeerConnection.prototype.removeStream=function(stream){if(!this._localStreams){this._localStreams=[];} var index=this._localStreams.indexOf(stream);if(index===-1){return;} -this._localStreams.splice(index,1);var self=this;var tracks=stream.getTracks();this.getSenders().forEach(function(sender){if(tracks.indexOf(sender.track)!==-1){self.removeTrack(sender);}});};}},shimRemoteStreamsAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} +this._localStreams.splice(index,1);var pc=this;var tracks=stream.getTracks();this.getSenders().forEach(function(sender){if(tracks.indexOf(sender.track)!==-1){pc.removeTrack(sender);}});};}},shimRemoteStreamsAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} if(!('getRemoteStreams'in window.RTCPeerConnection.prototype)){window.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[];};} -if(!('onaddstream'in window.RTCPeerConnection.prototype)){Object.defineProperty(window.RTCPeerConnection.prototype,'onaddstream',{get:function(){return this._onaddstream;},set:function(f){if(this._onaddstream){this.removeEventListener('addstream',this._onaddstream);this.removeEventListener('track',this._onaddstreampoly);} -this.addEventListener('addstream',this._onaddstream=f);this.addEventListener('track',this._onaddstreampoly=function(e){var stream=e.streams[0];if(!this._remoteStreams){this._remoteStreams=[];} -if(this._remoteStreams.indexOf(stream)>=0){return;} -this._remoteStreams.push(stream);var event=new Event('addstream');event.stream=e.streams[0];this.dispatchEvent(event);}.bind(this));}});}},shimCallbacksAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} +if(!('onaddstream'in window.RTCPeerConnection.prototype)){Object.defineProperty(window.RTCPeerConnection.prototype,'onaddstream',{get:function(){return this._onaddstream;},set:function(f){var pc=this;if(this._onaddstream){this.removeEventListener('addstream',this._onaddstream);this.removeEventListener('track',this._onaddstreampoly);} +this.addEventListener('addstream',this._onaddstream=f);this.addEventListener('track',this._onaddstreampoly=function(e){e.streams.forEach(function(stream){if(!pc._remoteStreams){pc._remoteStreams=[];} +if(pc._remoteStreams.indexOf(stream)>=0){return;} +pc._remoteStreams.push(stream);var event=new Event('addstream');event.stream=stream;pc.dispatchEvent(event);});});}});}},shimCallbacksAPI:function(window){if(typeof window!=='object'||!window.RTCPeerConnection){return;} var prototype=window.RTCPeerConnection.prototype;var createOffer=prototype.createOffer;var createAnswer=prototype.createAnswer;var setLocalDescription=prototype.setLocalDescription;var setRemoteDescription=prototype.setRemoteDescription;var addIceCandidate=prototype.addIceCandidate;prototype.createOffer=function(successCallback,failureCallback){var options=(arguments.length>=2)?arguments[2]:arguments[0];var promise=createOffer.apply(this,[options]);if(!failureCallback){return promise;} promise.then(successCallback,failureCallback);return Promise.resolve();};prototype.createAnswer=function(successCallback,failureCallback){var options=(arguments.length>=2)?arguments[2]:arguments[0];var promise=createAnswer.apply(this,[options]);if(!failureCallback){return promise;} promise.then(successCallback,failureCallback);return Promise.resolve();};var withCallback=function(description,successCallback,failureCallback){var promise=setLocalDescription.apply(this,[description]);if(!failureCallback){return promise;} @@ -596,12 +613,18 @@ promise.then(successCallback,failureCallback);return Promise.resolve();};prototy promise.then(successCallback,failureCallback);return Promise.resolve();};prototype.setRemoteDescription=withCallback;withCallback=function(candidate,successCallback,failureCallback){var promise=addIceCandidate.apply(this,[candidate]);if(!failureCallback){return promise;} promise.then(successCallback,failureCallback);return Promise.resolve();};prototype.addIceCandidate=withCallback;},shimGetUserMedia:function(window){var navigator=window&&window.navigator;if(!navigator.getUserMedia){if(navigator.webkitGetUserMedia){navigator.getUserMedia=navigator.webkitGetUserMedia.bind(navigator);}else if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia){navigator.getUserMedia=function(constraints,cb,errcb){navigator.mediaDevices.getUserMedia(constraints).then(cb,errcb);}.bind(navigator);}}},shimRTCIceServerUrls:function(window){var OrigPeerConnection=window.RTCPeerConnection;window.RTCPeerConnection=function(pcConfig,pcConstraints){if(pcConfig&&pcConfig.iceServers){var newIceServers=[];for(var i=0;i=pos&&parseInt(match[pos],10);} +function wrapPeerConnectionEvent(window,eventNameToWrap,wrapper){if(!window.RTCPeerConnection){return;} +var proto=window.RTCPeerConnection.prototype;var nativeAddEventListener=proto.addEventListener;proto.addEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap){return nativeAddEventListener.apply(this,arguments);} +var wrappedCallback=function(e){cb(wrapper(e));};this._eventMap=this._eventMap||{};this._eventMap[cb]=wrappedCallback;return nativeAddEventListener.apply(this,[nativeEventName,wrappedCallback]);};var nativeRemoveEventListener=proto.removeEventListener;proto.removeEventListener=function(nativeEventName,cb){if(nativeEventName!==eventNameToWrap||!this._eventMap||!this._eventMap[cb]){return nativeRemoveEventListener.apply(this,arguments);} +var unwrappedCb=this._eventMap[cb];delete this._eventMap[cb];return nativeRemoveEventListener.apply(this,[nativeEventName,unwrappedCb]);};Object.defineProperty(proto,'on'+eventNameToWrap,{get:function(){return this['_on'+eventNameToWrap];},set:function(cb){if(this['_on'+eventNameToWrap]){this.removeEventListener(eventNameToWrap,this['_on'+eventNameToWrap]);delete this['_on'+eventNameToWrap];} +if(cb){this.addEventListener(eventNameToWrap,this['_on'+eventNameToWrap]=cb);}}});} +module.exports={extractVersion:extractVersion,wrapPeerConnectionEvent:wrapPeerConnectionEvent,disableLog:function(bool){if(typeof bool!=='boolean'){return new Error('Argument type: '+typeof bool+'. Please use a boolean.');} logDisabled_=bool;return(bool)?'adapter.js logging disabled':'adapter.js logging enabled';},disableWarnings:function(bool){if(typeof bool!=='boolean'){return new Error('Argument type: '+typeof bool+'. Please use a boolean.');} deprecationWarnings_=!bool;return'adapter.js deprecation warnings '+(bool?'disabled':'enabled');},log:function(){if(typeof window==='object'){if(logDisabled_){return;} if(typeof console!=='undefined'&&typeof console.log==='function'){console.log.apply(console,arguments);}}},deprecated:function(oldMethod,newMethod){if(!deprecationWarnings_){return;} -console.warn(oldMethod+' is deprecated, please use '+newMethod+' instead.');},extractVersion:function(uastring,expr,pos){var match=uastring.match(expr);return match&&match.length>=pos&&parseInt(match[pos],10);},detectBrowser:function(window){var navigator=window&&window.navigator;var result={};result.browser=null;result.version=null;if(typeof window==='undefined'||!window.navigator){result.browser='Not a browser.';return result;} -if(navigator.mozGetUserMedia){result.browser='firefox';result.version=this.extractVersion(navigator.userAgent,/Firefox\/(\d+)\./,1);}else if(navigator.webkitGetUserMedia){if(window.webkitRTCPeerConnection){result.browser='chrome';result.version=this.extractVersion(navigator.userAgent,/Chrom(e|ium)\/(\d+)\./,2);}else{if(navigator.userAgent.match(/Version\/(\d+).(\d+)/)){result.browser='safari';result.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1);}else{result.browser='Unsupported webkit-based browser '+'with GUM support but no WebRTC support.';return result;}}}else if(navigator.mediaDevices&&navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)){result.browser='edge';result.version=this.extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2);}else if(navigator.mediaDevices&&navigator.userAgent.match(/AppleWebKit\/(\d+)\./)){result.browser='safari';result.version=this.extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1);}else{result.browser='Not a supported browser.';return result;} -return result;},};module.exports={log:utils.log,deprecated:utils.deprecated,disableLog:utils.disableLog,disableWarnings:utils.disableWarnings,extractVersion:utils.extractVersion,shimCreateObjectURL:utils.shimCreateObjectURL,detectBrowser:utils.detectBrowser.bind(utils)};},{}]},{},[3])(3)}); \ No newline at end of file +console.warn(oldMethod+' is deprecated, please use '+newMethod+' instead.');},detectBrowser:function(window){var navigator=window&&window.navigator;var result={};result.browser=null;result.version=null;if(typeof window==='undefined'||!window.navigator){result.browser='Not a browser.';return result;} +if(navigator.mozGetUserMedia){result.browser='firefox';result.version=extractVersion(navigator.userAgent,/Firefox\/(\d+)\./,1);}else if(navigator.webkitGetUserMedia){result.browser='chrome';result.version=extractVersion(navigator.userAgent,/Chrom(e|ium)\/(\d+)\./,2);}else if(navigator.mediaDevices&&navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)){result.browser='edge';result.version=extractVersion(navigator.userAgent,/Edge\/(\d+).(\d+)$/,2);}else if(navigator.mediaDevices&&navigator.userAgent.match(/AppleWebKit\/(\d+)\./)){result.browser='safari';result.version=extractVersion(navigator.userAgent,/AppleWebKit\/(\d+)\./,1);}else{result.browser='Not a supported browser.';return result;} +return result;}};},{}]},{},[3])(3)}); \ No newline at end of file From b5daae72da8f9513faf6ba261133ae52e6f96ef2 Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 9 Feb 2018 11:52:27 -0600 Subject: [PATCH 174/264] FS-10945: [Build-System] build fails for Master #resolve --- libs/srtp/crypto/include/datatypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/srtp/crypto/include/datatypes.h b/libs/srtp/crypto/include/datatypes.h index d20b9e6f8c..8440376824 100644 --- a/libs/srtp/crypto/include/datatypes.h +++ b/libs/srtp/crypto/include/datatypes.h @@ -342,7 +342,7 @@ octet_string_set_to_zero(void *s, size_t len); /* Fall back. */ static inline uint32_t be32_to_cpu(uint32_t v) { /* optimized for x86. */ - asm("bswap %0" : "=r" (v) : "0" (v)); + __asm__("bswap %0" : "=r" (v) : "0" (v)); return v; } # else /* HAVE_X86 */ From 89102544f30783fb4d96905209ff7336db16311d Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Tue, 3 Apr 2018 00:38:43 +0300 Subject: [PATCH 175/264] FS-11014: [core] Add vad to core on Windows. --- w32/Library/FreeSwitchCore.2015.vcxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/w32/Library/FreeSwitchCore.2015.vcxproj b/w32/Library/FreeSwitchCore.2015.vcxproj index dc5169ef1d..8fff28f4d4 100644 --- a/w32/Library/FreeSwitchCore.2015.vcxproj +++ b/w32/Library/FreeSwitchCore.2015.vcxproj @@ -470,6 +470,7 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs + @@ -805,6 +806,7 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs + From b3ff29eb5c408fa046fbef2345a830714ba82b5d Mon Sep 17 00:00:00 2001 From: Brian West Date: Wed, 17 Jan 2018 13:29:51 -0600 Subject: [PATCH 176/264] FS-10908: [mod_amqp] AMQP routing key (format_fields) formation broke and invalid reads reported by valgrind #resolve --- src/mod/event_handlers/mod_amqp/mod_amqp_utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c b/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c index 9f0ed3ffd0..7ebcff6e3f 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_utils.c @@ -98,25 +98,25 @@ switch_status_t mod_amqp_do_config(switch_bool_t reload) } if (reload) { - switch_hash_index_t *hi; + switch_hash_index_t *hi = NULL; mod_amqp_producer_profile_t *producer; mod_amqp_command_profile_t *command; mod_amqp_logging_profile_t *logging; switch_event_unbind_callback(mod_amqp_producer_event_handler); - while ((hi = switch_core_hash_first(mod_amqp_globals.producer_hash))) { + while ((hi = switch_core_hash_first_iter(mod_amqp_globals.producer_hash, hi))) { switch_core_hash_this(hi, NULL, NULL, (void **)&producer); mod_amqp_producer_destroy(&producer); } - while ((hi = switch_core_hash_first(mod_amqp_globals.command_hash))) { + while ((hi = switch_core_hash_first_iter(mod_amqp_globals.command_hash, hi))) { switch_core_hash_this(hi, NULL, NULL, (void **)&command); mod_amqp_command_destroy(&command); } switch_log_unbind_logger(mod_amqp_logging_recv); - while ((hi = switch_core_hash_first(mod_amqp_globals.logging_hash))) { + while ((hi = switch_core_hash_first_iter(mod_amqp_globals.logging_hash, hi))) { switch_core_hash_this(hi, NULL, NULL, (void **)&logging); mod_amqp_logging_destroy(&logging); } From 9fcbf5d1c0f1cadbc5163b90ab941c2d68728024 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 8 Feb 2018 11:04:11 -0600 Subject: [PATCH 177/264] FS-10941: [mod_conference] Segfault SIGFPE, Arithmetic exception in mod_conference #resolve --- src/switch_core_media.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 6d4b780df3..e15dad3e09 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -6600,11 +6600,11 @@ SWITCH_DECLARE(void) switch_core_session_write_blank_video(switch_core_session_t switch_color_set_rgb(&bgcolor, "#000000"); switch_img_fill(blank_img, 0, 0, blank_img->d_w, blank_img->d_h, &bgcolor); + if (fps < 15) fps = 15; frame_ms = (uint32_t) 1000 / fps; + if (frame_ms <= 0) frame_ms = 66; frames = (uint32_t) ms / frame_ms; - - switch_core_media_gen_key_frame(session); for (i = 0; i < frames; i++) { fr.img = blank_img; From 118c8ab0c2e2be839f9954beb84bc655f6112b0f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 8 Mar 2018 12:49:56 -0600 Subject: [PATCH 178/264] FS-11016: [mod_av] Looping a video file that has resize feature enabled can allow a non-resized frame to slip after file seek #resolve --- src/mod/applications/mod_av/avformat.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index aab7d50a40..4d9929ea05 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -2324,14 +2324,14 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f context->last_img = (switch_image_t *)pop; switch_img_copy(context->last_img, &frame->img); context->vid_ready = 1; - return SWITCH_STATUS_SUCCESS; + goto resize_check; } if (context->last_img) { // repeat the last img switch_img_copy(context->last_img, &frame->img); context->vid_ready = 1; context->seek_ts = -1; - return SWITCH_STATUS_SUCCESS; + goto resize_check; } if ((flags & SVR_BLOCK) && sanity-- > 0) { @@ -2346,7 +2346,7 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f if ((flags & SVR_BLOCK)) switch_yield(100000); switch_img_copy(context->last_img, &frame->img); context->vid_ready = 1; - return SWITCH_STATUS_SUCCESS; + goto resize_check; } if ((flags & SVR_BLOCK)) { @@ -2359,7 +2359,7 @@ static switch_status_t av_file_read_video(switch_file_handle_t *handle, switch_f context->last_img = (switch_image_t *)pop; switch_img_copy(context->last_img, &frame->img); context->vid_ready = 1; - return SWITCH_STATUS_SUCCESS; + goto resize_check; } return SWITCH_STATUS_BREAK; @@ -2475,6 +2475,8 @@ GCC_DIAG_ON(deprecated-declarations) return SWITCH_STATUS_BREAK; } + resize_check: + if (frame->img) { if (frame->img && context->handle->mm.scale_w && context->handle->mm.scale_h) { if (frame->img->d_w != context->handle->mm.scale_w || frame->img->d_h != context->handle->mm.scale_h) { From 4719d04706eade0881af7b3273d0b9de58e08700 Mon Sep 17 00:00:00 2001 From: Seven Du Date: Tue, 23 Jan 2018 10:56:30 +0800 Subject: [PATCH 179/264] FS-10918 #resolve --- src/switch_xml.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/switch_xml.c b/src/switch_xml.c index 1dc8166eca..0dffbd4b8c 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -141,6 +141,24 @@ static void preprocess_exec_set(char *keyval) } } +static void preprocess_env_set(char *keyval) +{ + char *key = keyval; + char *val = strchr(key, '='); + + if (key && val) { + *val++ = '\0'; + + if (*val++ == '$') { + char *data = getenv(val); + + if (data) { + switch_core_set_variable(key, data); + } + } + } +} + static int preprocess(const char *cwd, const char *file, FILE *write_fd, int rlevel); typedef struct switch_xml_root *switch_xml_root_t; @@ -1469,6 +1487,8 @@ static int preprocess(const char *cwd, const char *file, FILE *write_fd, int rle } else if (!strcasecmp(tcmd, "exec-set")) { preprocess_exec_set(targ); + } else if (!strcasecmp(tcmd, "env-set")) { + preprocess_env_set(targ); } else if (!strcasecmp(tcmd, "include")) { preprocess_glob(cwd, targ, write_fd, rlevel + 1); } else if (!strcasecmp(tcmd, "exec")) { From 3563ec1e63d754f8f42a820d126df9d652835538 Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 8 Feb 2018 15:16:32 -0600 Subject: [PATCH 180/264] FS-10946: [core] Duplicate code in switch_xml.c #resolve --- src/switch_xml.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/switch_xml.c b/src/switch_xml.c index 0dffbd4b8c..a815c92039 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -3112,12 +3112,6 @@ SWITCH_DECLARE(int) switch_xml_std_datetime_check(switch_xml_t xcond, int *offse "XML DateTime Check: day of month[%d] =~ %s (%s)\n", test, xmday, time_match ? "PASS" : "FAIL"); } - if (time_match && xweek) { - int test = (int) (tm.tm_yday / 7 + 1); - time_match = switch_number_cmp(xweek, test); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG9, - "XML DateTime Check: week of year[%d] =~ %s (%s)\n", test, xweek, time_match ? "PASS" : "FAIL"); - } if (time_match && xweek) { int test = (int) (tm.tm_yday / 7 + 1); time_match = switch_number_cmp(xweek, test); From 8a5bbe19e8363c05a0ef5842839b4270fe8fb30e Mon Sep 17 00:00:00 2001 From: Seven Du Date: Mon, 4 Dec 2017 22:14:52 +0800 Subject: [PATCH 181/264] [mod_shout] use 0xFFFFFFFF flag to query frame_size --- src/mod/formats/mod_shout/mod_shout.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/mod/formats/mod_shout/mod_shout.c b/src/mod/formats/mod_shout/mod_shout.c index 942f1ff6d2..99ea757700 100644 --- a/src/mod/formats/mod_shout/mod_shout.c +++ b/src/mod/formats/mod_shout/mod_shout.c @@ -1683,6 +1683,17 @@ static switch_status_t switch_mp3_encode(switch_codec_t *codec, return SWITCH_STATUS_FALSE; } + if (flag && *flag == 0xFFFFFFFF) { // query frame_size + *(uint32_t *)encoded_data = lame_get_framesize(context->gfp); + *encoded_data_len = sizeof(uint32_t); + return SWITCH_STATUS_SUCCESS; + } + + if (decoded_data_len == 0) { // flush encoder buffer + *encoded_data_len = lame_encode_flush(context->gfp, encoded_data, *encoded_data_len); + return SWITCH_STATUS_SUCCESS; + } + if (codec->implementation->number_of_channels == 2) { len = lame_encode_buffer_interleaved(context->gfp, decoded_data, decoded_data_len / 4, encoded_data, *encoded_data_len); } else { From e47a6922b3c6773d191e584047dd53c71484a232 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Mon, 2 Apr 2018 17:27:18 -0500 Subject: [PATCH 182/264] swigall --- src/mod/languages/mod_managed/managed/swig.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index 3fbcd3b37f..fc4bf3cb1f 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -44651,6 +44651,25 @@ namespace FreeSWITCH.Native { namespace FreeSWITCH.Native { +public enum switch_vad_state_t { + SWITCH_VAD_STATE_NONE, + SWITCH_VAD_STATE_START_TALKING, + SWITCH_VAD_STATE_TALKING, + SWITCH_VAD_STATE_STOP_TALKING, + SWITCH_VAD_STATE_ERROR +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.12 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + using System; using System.Runtime.InteropServices; From 07fbd3fc49194486ba319b4ab1a826a02b51ea23 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Tue, 3 Apr 2018 21:21:54 +0300 Subject: [PATCH 183/264] FS-11087: [Build-System] Use shared zlib library on Windows. --- libs/win32/libpng/libpng.vcxproj | 2 +- w32/curl.props | 2 +- w32/zlib.props | 25 ++++++++++++++++++++----- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/libs/win32/libpng/libpng.vcxproj b/libs/win32/libpng/libpng.vcxproj index 0fcf409fab..a14b4b3dd9 100644 --- a/libs/win32/libpng/libpng.vcxproj +++ b/libs/win32/libpng/libpng.vcxproj @@ -24,8 +24,8 @@ Win32Proj libpng - + DynamicLibrary MultiByte diff --git a/w32/curl.props b/w32/curl.props index 791d967ada..2b2d7b0efc 100644 --- a/w32/curl.props +++ b/w32/curl.props @@ -4,7 +4,7 @@ - + true diff --git a/w32/zlib.props b/w32/zlib.props index 47d64d27a1..0c50ebb96f 100644 --- a/w32/zlib.props +++ b/w32/zlib.props @@ -1,5 +1,8 @@ + + true + @@ -8,10 +11,12 @@ Debug Release + zlibd + zlib - $(BaseDir)libs\zlib-$(zlibVersion) + $(BaseDir)libs\zlib-$(zlibVersion) + + + + + + + + + + + + + + + - $(BaseDir)libs\pcre-$(PCREVersion);%(AdditionalIncludeDirectories) + $(BaseDir)libs\pcre-$(pcreVersion)\include;%(AdditionalIncludeDirectories) true - PCRE_STATIC;%(PreprocessorDefinitions) + ;%(PreprocessorDefinitions) + + $(SolutionDir)libs\pcre-$(pcreVersion)\binaries\$(Platform)\$(LibraryConfiguration)\lib;%(AdditionalLibraryDirectories) + pcred.lib;%(AdditionalDependencies) + pcre.lib;%(AdditionalDependencies) + From 32c16669c4c2fab6a1a88dc9980cf9b158c4f061 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 5 Apr 2018 01:56:04 +0300 Subject: [PATCH 185/264] FS-11091: [mod_sndfile] Remove libsndfile from the code base, use pre-compiled binaries on Windows, update to libsndfile 1.0.28 --- Freeswitch.2015.sln | 14 - libs/.gitignore | 2 + libs/libsndfile/.update | 1 - libs/libsndfile/AUTHORS | 14 - libs/libsndfile/COPYING | 503 - libs/libsndfile/Cfg/.empty | 0 libs/libsndfile/ChangeLog | 9764 ----------------- libs/libsndfile/INSTALL | 182 - libs/libsndfile/M4/Makefile.am | 5 - libs/libsndfile/M4/add_cflags.m4 | 18 - libs/libsndfile/M4/add_cxxflags.m4 | 19 - libs/libsndfile/M4/clang.m4 | 31 - libs/libsndfile/M4/clip_mode.m4 | 124 - libs/libsndfile/M4/endian.m4 | 155 - libs/libsndfile/M4/extra_largefile.m4 | 114 - libs/libsndfile/M4/extra_pkg.m4 | 105 - libs/libsndfile/M4/flexible_array.m4 | 32 - libs/libsndfile/M4/gcc_version.m4 | 33 - libs/libsndfile/M4/llrint.m4 | 38 - libs/libsndfile/M4/lrint.m4 | 37 - libs/libsndfile/M4/lrintf.m4 | 37 - libs/libsndfile/M4/mkoctfile_version.m4 | 38 - libs/libsndfile/M4/octave.m4 | 143 - libs/libsndfile/M4/really_gcc.m4 | 33 - libs/libsndfile/M4/stack_protect.m4 | 73 - libs/libsndfile/Makefile.am | 46 - libs/libsndfile/Mingw-make-dist.sh | 116 - libs/libsndfile/NEWS | 175 - libs/libsndfile/Octave/Makefile.am | 79 - libs/libsndfile/Octave/PKG_ADD | 3 - libs/libsndfile/Octave/Readme.txt | 23 - libs/libsndfile/Octave/format.h | 21 - libs/libsndfile/Octave/octave_test.m | 52 - libs/libsndfile/Octave/octave_test.sh | 81 - libs/libsndfile/Octave/sndfile.cc | 405 - libs/libsndfile/Octave/sndfile_load.m | 52 - libs/libsndfile/Octave/sndfile_play.m | 59 - libs/libsndfile/Octave/sndfile_save.m | 53 - libs/libsndfile/README | 68 - libs/libsndfile/README.md | 79 - libs/libsndfile/Scripts/android-configure.sh | 92 - .../Scripts/build-test-tarball.mk.in | 61 - libs/libsndfile/Scripts/clang-sanitize.sh | 13 - libs/libsndfile/Scripts/cstyle.py | 246 - libs/libsndfile/Scripts/git-pre-commit-hook | 79 - .../Scripts/linux-to-win-cross-configure.sh | 22 - libs/libsndfile/TODO | 42 - libs/libsndfile/Win32/Makefile.am | 4 - .../Win32/README-precompiled-dll.txt | 40 - libs/libsndfile/Win32/testprog.c | 16 - libs/libsndfile/acinclude.m4 | 637 -- libs/libsndfile/autogen.sh | 179 - libs/libsndfile/binheader_readf_check.py | 62 - libs/libsndfile/configure.ac | 697 -- libs/libsndfile/configure.gnu | 4 - libs/libsndfile/doc/FAQ.html | 851 -- libs/libsndfile/doc/Makefile.am | 9 - libs/libsndfile/doc/api.html | 781 -- libs/libsndfile/doc/bugs.html | 76 - libs/libsndfile/doc/command.html | 1687 --- libs/libsndfile/doc/development.html | 43 - libs/libsndfile/doc/dither.html | 1017 -- libs/libsndfile/doc/donate.html | 112 - libs/libsndfile/doc/embedded_files.html | 47 - libs/libsndfile/doc/index.html | 493 - libs/libsndfile/doc/libsndfile.css.in | 92 - .../doc/linux_games_programming.txt | 434 - libs/libsndfile/doc/lists.html | 52 - libs/libsndfile/doc/new_file_type.HOWTO | 135 - libs/libsndfile/doc/octave.html | 118 - libs/libsndfile/doc/pkgconfig.html | 71 - libs/libsndfile/doc/print.css | 14 - libs/libsndfile/doc/sndfile_info.html | 53 - libs/libsndfile/doc/tutorial.html | 34 - libs/libsndfile/doc/win32.html | 53 - libs/libsndfile/echo-install-dirs.in | 25 - libs/libsndfile/examples/Makefile.am | 25 - libs/libsndfile/examples/cooledit-fixer.c | 231 - libs/libsndfile/examples/generate.c | 133 - libs/libsndfile/examples/generate.cs | 250 - libs/libsndfile/examples/list_formats.c | 83 - libs/libsndfile/examples/make_sine.c | 96 - libs/libsndfile/examples/sfprocess.c | 142 - libs/libsndfile/examples/sndfile-convert.c | 376 - libs/libsndfile/examples/sndfile-info.c | 354 - .../libsndfile/examples/sndfile-play-beos.cpp | 153 - libs/libsndfile/examples/sndfile-play.c | 960 -- libs/libsndfile/examples/sndfile-to-text.c | 128 - libs/libsndfile/examples/sndfilehandle.cc | 84 - libs/libsndfile/libsndfile.spec.in | 69 - libs/libsndfile/make_lite.py | 491 - libs/libsndfile/man/Makefile.am | 15 - libs/libsndfile/man/sndfile-cmp.1 | 16 - libs/libsndfile/man/sndfile-concat.1 | 16 - libs/libsndfile/man/sndfile-convert.1 | 22 - libs/libsndfile/man/sndfile-info.1 | 16 - libs/libsndfile/man/sndfile-interleave.1 | 23 - libs/libsndfile/man/sndfile-metadata-get.1 | 26 - libs/libsndfile/man/sndfile-play.1 | 36 - libs/libsndfile/programs/Makefile.am | 47 - libs/libsndfile/programs/common.c | 466 - libs/libsndfile/programs/common.h | 78 - libs/libsndfile/programs/sndfile-cmp.c | 165 - libs/libsndfile/programs/sndfile-concat.c | 169 - libs/libsndfile/programs/sndfile-convert.c | 377 - .../programs/sndfile-deinterleave.c | 194 - libs/libsndfile/programs/sndfile-info.c | 529 - libs/libsndfile/programs/sndfile-interleave.c | 202 - libs/libsndfile/programs/sndfile-jackplay.c | 277 - .../programs/sndfile-metadata-get.c | 176 - .../programs/sndfile-metadata-set.c | 284 - .../libsndfile/programs/sndfile-play-beos.cpp | 144 - libs/libsndfile/programs/sndfile-play.c | 1211 -- libs/libsndfile/programs/sndfile-salvage.c | 277 - .../programs/test-sndfile-metadata-set.py | 188 - libs/libsndfile/reconfigure.mk | 63 - libs/libsndfile/regtest/Makefile.am | 12 - libs/libsndfile/regtest/Readme.txt | 108 - libs/libsndfile/regtest/checksum.c | 117 - libs/libsndfile/regtest/database.c | 495 - libs/libsndfile/regtest/regtest.h | 38 - libs/libsndfile/regtest/sndfile-regtest.c | 121 - libs/libsndfile/sndfile.pc.in | 12 - libs/libsndfile/src/ALAC/ALACAudioTypes.h | 200 - libs/libsndfile/src/ALAC/ALACBitUtilities.c | 262 - libs/libsndfile/src/ALAC/ALACBitUtilities.h | 91 - libs/libsndfile/src/ALAC/ALACDecoder.h | 61 - libs/libsndfile/src/ALAC/ALACEncoder.h | 92 - libs/libsndfile/src/ALAC/EndianPortable.h | 39 - libs/libsndfile/src/ALAC/LICENSE | 170 - libs/libsndfile/src/ALAC/ag_dec.c | 355 - libs/libsndfile/src/ALAC/ag_enc.c | 360 - libs/libsndfile/src/ALAC/aglib.h | 81 - libs/libsndfile/src/ALAC/alac_codec.h | 103 - libs/libsndfile/src/ALAC/alac_decoder.c | 646 -- libs/libsndfile/src/ALAC/alac_decoder.h | 61 - libs/libsndfile/src/ALAC/alac_encoder.c | 1342 --- libs/libsndfile/src/ALAC/dp_dec.c | 375 - libs/libsndfile/src/ALAC/dp_enc.c | 380 - libs/libsndfile/src/ALAC/dplib.h | 61 - libs/libsndfile/src/ALAC/matrix_dec.c | 320 - libs/libsndfile/src/ALAC/matrix_enc.c | 272 - libs/libsndfile/src/ALAC/matrixlib.h | 81 - libs/libsndfile/src/G72x/ChangeLog | 50 - libs/libsndfile/src/G72x/Makefile.am | 22 - libs/libsndfile/src/G72x/README | 0 libs/libsndfile/src/G72x/README.original | 94 - libs/libsndfile/src/G72x/g721.c | 155 - libs/libsndfile/src/G72x/g723_16.c | 162 - libs/libsndfile/src/G72x/g723_24.c | 139 - libs/libsndfile/src/G72x/g723_40.c | 153 - libs/libsndfile/src/G72x/g72x.c | 644 -- libs/libsndfile/src/G72x/g72x.h | 91 - libs/libsndfile/src/G72x/g72x_priv.h | 109 - libs/libsndfile/src/G72x/g72x_test.c | 214 - libs/libsndfile/src/GSM610/COPYRIGHT | 16 - libs/libsndfile/src/GSM610/ChangeLog | 56 - libs/libsndfile/src/GSM610/Makefile.am | 16 - libs/libsndfile/src/GSM610/README | 36 - libs/libsndfile/src/GSM610/add.c | 240 - libs/libsndfile/src/GSM610/code.c | 87 - libs/libsndfile/src/GSM610/config.h | 26 - libs/libsndfile/src/GSM610/decode.c | 59 - libs/libsndfile/src/GSM610/gsm.h | 52 - libs/libsndfile/src/GSM610/gsm610_priv.h | 301 - libs/libsndfile/src/GSM610/gsm_create.c | 37 - libs/libsndfile/src/GSM610/gsm_decode.c | 359 - libs/libsndfile/src/GSM610/gsm_destroy.c | 24 - libs/libsndfile/src/GSM610/gsm_encode.c | 449 - libs/libsndfile/src/GSM610/gsm_option.c | 66 - libs/libsndfile/src/GSM610/long_term.c | 959 -- libs/libsndfile/src/GSM610/lpc.c | 331 - libs/libsndfile/src/GSM610/preprocess.c | 105 - libs/libsndfile/src/GSM610/rpe.c | 480 - libs/libsndfile/src/GSM610/short_term.c | 417 - libs/libsndfile/src/GSM610/table.c | 60 - libs/libsndfile/src/Makefile.am | 134 - libs/libsndfile/src/Symbols.darwin | 37 - libs/libsndfile/src/Symbols.linux | 42 - libs/libsndfile/src/Symbols.os2 | 43 - libs/libsndfile/src/aiff.c | 1778 --- libs/libsndfile/src/alac.c | 964 -- libs/libsndfile/src/alaw.c | 548 - libs/libsndfile/src/au.c | 450 - libs/libsndfile/src/audio_detect.c | 105 - libs/libsndfile/src/avr.c | 246 - libs/libsndfile/src/binheader_writef_check.py | 117 - libs/libsndfile/src/broadcast.c | 191 - libs/libsndfile/src/caf.c | 804 -- libs/libsndfile/src/cart.c | 101 - libs/libsndfile/src/chanmap.c | 262 - libs/libsndfile/src/chanmap.h | 32 - libs/libsndfile/src/chunk.c | 255 - libs/libsndfile/src/command.c | 390 - libs/libsndfile/src/common.c | 1662 --- libs/libsndfile/src/common.h | 1044 -- libs/libsndfile/src/create_symbols_file.py | 182 - libs/libsndfile/src/cygsndfile.def | 39 - libs/libsndfile/src/dither.c | 534 - libs/libsndfile/src/double64.c | 1058 -- libs/libsndfile/src/dwd.c | 201 - libs/libsndfile/src/dwvw.c | 674 -- libs/libsndfile/src/file_io.c | 1550 --- libs/libsndfile/src/flac.c | 1385 --- libs/libsndfile/src/float32.c | 1012 -- libs/libsndfile/src/float_cast.h | 273 - libs/libsndfile/src/g72x.c | 608 - libs/libsndfile/src/gsm610.c | 627 -- libs/libsndfile/src/htk.c | 226 - libs/libsndfile/src/id3.c | 57 - libs/libsndfile/src/ima_adpcm.c | 948 -- libs/libsndfile/src/ima_oki_adpcm.c | 297 - libs/libsndfile/src/ima_oki_adpcm.h | 54 - libs/libsndfile/src/interleave.c | 299 - libs/libsndfile/src/ircam.c | 323 - libs/libsndfile/src/libsndfile-1.def | 41 - libs/libsndfile/src/libsndfile.def | 39 - libs/libsndfile/src/macbinary3.c | 45 - libs/libsndfile/src/macos.c | 51 - .../src/make-static-lib-hidden-privates.sh | 14 - libs/libsndfile/src/mat4.c | 390 - libs/libsndfile/src/mat5.c | 509 - libs/libsndfile/src/mpc2k.c | 204 - libs/libsndfile/src/ms_adpcm.c | 836 -- libs/libsndfile/src/new.c | 116 - libs/libsndfile/src/nist.c | 375 - libs/libsndfile/src/ogg.c | 253 - libs/libsndfile/src/ogg.h | 52 - libs/libsndfile/src/ogg_opus.c | 149 - libs/libsndfile/src/ogg_pcm.c | 164 - libs/libsndfile/src/ogg_speex.c | 425 - libs/libsndfile/src/ogg_vorbis.c | 1172 -- libs/libsndfile/src/paf.c | 819 -- libs/libsndfile/src/pcm.c | 2961 ----- libs/libsndfile/src/pvf.c | 188 - libs/libsndfile/src/raw.c | 104 - libs/libsndfile/src/rf64.c | 726 -- libs/libsndfile/src/rx2.c | 318 - libs/libsndfile/src/sd2.c | 654 -- libs/libsndfile/src/sds.c | 1022 -- libs/libsndfile/src/sf_unistd.h | 63 - libs/libsndfile/src/sfconfig.h | 115 - libs/libsndfile/src/sfendian.h | 296 - libs/libsndfile/src/sndfile.c | 3093 ------ libs/libsndfile/src/sndfile.h.in | 824 -- libs/libsndfile/src/sndfile.hh | 446 - libs/libsndfile/src/strings.c | 222 - libs/libsndfile/src/svx.c | 416 - libs/libsndfile/src/test_audio_detect.c | 111 - libs/libsndfile/src/test_broadcast_var.c | 119 - libs/libsndfile/src/test_cart_var.c | 91 - libs/libsndfile/src/test_conversions.c | 110 - libs/libsndfile/src/test_endswap.c | 235 - libs/libsndfile/src/test_endswap.def | 40 - libs/libsndfile/src/test_endswap.tpl | 151 - libs/libsndfile/src/test_file_io.c | 438 - libs/libsndfile/src/test_float.c | 104 - libs/libsndfile/src/test_ima_oki_adpcm.c | 157 - libs/libsndfile/src/test_log_printf.c | 123 - libs/libsndfile/src/test_main.c | 49 - libs/libsndfile/src/test_main.h | 41 - libs/libsndfile/src/test_strncpy_crlf.c | 56 - libs/libsndfile/src/txw.c | 377 - libs/libsndfile/src/ulaw.c | 1051 -- libs/libsndfile/src/version-metadata.rc.in | 32 - libs/libsndfile/src/voc.c | 882 -- libs/libsndfile/src/vox_adpcm.c | 400 - libs/libsndfile/src/w64.c | 639 -- libs/libsndfile/src/wav.c | 2048 ---- libs/libsndfile/src/wav_w64.c | 678 -- libs/libsndfile/src/wav_w64.h | 298 - libs/libsndfile/src/windows.c | 93 - libs/libsndfile/src/wve.c | 209 - libs/libsndfile/src/xi.c | 1230 --- libs/libsndfile/tests/Makefile.am | 218 - libs/libsndfile/tests/aiff_rw_test.c | 164 - libs/libsndfile/tests/alaw_test.c | 236 - libs/libsndfile/tests/benchmark-0.0.28 | 40 - libs/libsndfile/tests/benchmark-1.0.0 | 35 - libs/libsndfile/tests/benchmark-1.0.0rc2 | 31 - .../tests/benchmark-1.0.18pre16-hendrix | 38 - .../tests/benchmark-1.0.18pre16-mingus | 38 - .../tests/benchmark-1.0.6pre10-coltrane | 39 - .../tests/benchmark-1.0.6pre10-miles | 39 - .../tests/benchmark-latest-coltrane | 75 - libs/libsndfile/tests/benchmark.c | 545 - libs/libsndfile/tests/benchmark.def | 17 - libs/libsndfile/tests/benchmark.tpl | 360 - libs/libsndfile/tests/channel_test.c | 134 - libs/libsndfile/tests/checksum_test.c | 128 - libs/libsndfile/tests/chunk_test.c | 293 - libs/libsndfile/tests/command_test.c | 1570 --- libs/libsndfile/tests/compression_size_test.c | 205 - libs/libsndfile/tests/cpp_test.cc | 313 - libs/libsndfile/tests/dft_cmp.c | 149 - libs/libsndfile/tests/dft_cmp.h | 25 - libs/libsndfile/tests/dither_test.c | 180 - libs/libsndfile/tests/dwvw_test.c | 109 - libs/libsndfile/tests/error_test.c | 246 - libs/libsndfile/tests/external_libs_test.c | 149 - libs/libsndfile/tests/fix_this.c | 328 - libs/libsndfile/tests/floating_point_test.c | 694 -- libs/libsndfile/tests/floating_point_test.def | 32 - libs/libsndfile/tests/floating_point_test.tpl | 355 - libs/libsndfile/tests/format_check_test.c | 149 - libs/libsndfile/tests/generate.c | 73 - libs/libsndfile/tests/generate.h | 19 - libs/libsndfile/tests/header_test.c | 741 -- libs/libsndfile/tests/header_test.def | 22 - libs/libsndfile/tests/header_test.tpl | 543 - libs/libsndfile/tests/headerless_test.c | 185 - libs/libsndfile/tests/largefile_test.c | 83 - libs/libsndfile/tests/locale_test.c | 167 - libs/libsndfile/tests/lossy_comp_test.c | 2372 ---- libs/libsndfile/tests/misc_test.c | 415 - libs/libsndfile/tests/multi_file_test.c | 238 - libs/libsndfile/tests/ogg_test.c | 344 - libs/libsndfile/tests/open_fail_test.c | 81 - libs/libsndfile/tests/pcm_test.c | 1723 --- libs/libsndfile/tests/pcm_test.def | 34 - libs/libsndfile/tests/pcm_test.tpl | 931 -- libs/libsndfile/tests/peak_chunk_test.c | 362 - .../tests/pedantic-header-test.sh.in | 58 - libs/libsndfile/tests/pipe_test.c | 525 - libs/libsndfile/tests/pipe_test.def | 14 - libs/libsndfile/tests/pipe_test.tpl | 374 - libs/libsndfile/tests/raw_test.c | 187 - libs/libsndfile/tests/rdwr_test.def | 32 - libs/libsndfile/tests/rdwr_test.tpl | 105 - libs/libsndfile/tests/scale_clip_test.c | 1853 ---- libs/libsndfile/tests/scale_clip_test.def | 56 - libs/libsndfile/tests/scale_clip_test.tpl | 438 - libs/libsndfile/tests/sftest.c | 65 - libs/libsndfile/tests/sfversion.c | 45 - libs/libsndfile/tests/stdin_test.c | 204 - libs/libsndfile/tests/stdio_test.c | 153 - libs/libsndfile/tests/stdout_test.c | 161 - libs/libsndfile/tests/string_test.c | 795 -- libs/libsndfile/tests/test_wrapper.sh.in | 365 - libs/libsndfile/tests/ulaw_test.c | 257 - libs/libsndfile/tests/utils.c | 1162 -- libs/libsndfile/tests/utils.def | 52 - libs/libsndfile/tests/utils.h | 183 - libs/libsndfile/tests/utils.tpl | 897 -- libs/libsndfile/tests/virtual_io_test.c | 237 - libs/libsndfile/tests/vorbis_test.c | 176 - libs/libsndfile/tests/win32_ordinal_test.c | 145 - libs/libsndfile/tests/win32_test.c | 318 - libs/libsndfile/tests/write_read_test.c | 3731 ------- libs/libsndfile/tests/write_read_test.def | 75 - libs/libsndfile/tests/write_read_test.tpl | 1184 -- libs/win32/libsndfile/cleancount | 1 - libs/win32/libsndfile/config.h | 294 - .../libsndfile.2010.vcxproj.filters | 285 - libs/win32/libsndfile/libsndfile.2015.vcxproj | 222 - libs/win32/libsndfile/sndfile.h | 817 -- .../mod_sndfile/mod_sndfile.2015.vcxproj | 13 +- w32/libsndfile-version.props | 19 + w32/libsndfile.props | 78 + 359 files changed, 100 insertions(+), 119233 deletions(-) delete mode 100644 libs/libsndfile/.update delete mode 100644 libs/libsndfile/AUTHORS delete mode 100644 libs/libsndfile/COPYING delete mode 100644 libs/libsndfile/Cfg/.empty delete mode 100644 libs/libsndfile/ChangeLog delete mode 100644 libs/libsndfile/INSTALL delete mode 100644 libs/libsndfile/M4/Makefile.am delete mode 100644 libs/libsndfile/M4/add_cflags.m4 delete mode 100644 libs/libsndfile/M4/add_cxxflags.m4 delete mode 100644 libs/libsndfile/M4/clang.m4 delete mode 100644 libs/libsndfile/M4/clip_mode.m4 delete mode 100644 libs/libsndfile/M4/endian.m4 delete mode 100644 libs/libsndfile/M4/extra_largefile.m4 delete mode 100644 libs/libsndfile/M4/extra_pkg.m4 delete mode 100644 libs/libsndfile/M4/flexible_array.m4 delete mode 100644 libs/libsndfile/M4/gcc_version.m4 delete mode 100644 libs/libsndfile/M4/llrint.m4 delete mode 100644 libs/libsndfile/M4/lrint.m4 delete mode 100644 libs/libsndfile/M4/lrintf.m4 delete mode 100644 libs/libsndfile/M4/mkoctfile_version.m4 delete mode 100644 libs/libsndfile/M4/octave.m4 delete mode 100644 libs/libsndfile/M4/really_gcc.m4 delete mode 100644 libs/libsndfile/M4/stack_protect.m4 delete mode 100644 libs/libsndfile/Makefile.am delete mode 100755 libs/libsndfile/Mingw-make-dist.sh delete mode 100644 libs/libsndfile/NEWS delete mode 100644 libs/libsndfile/Octave/Makefile.am delete mode 100644 libs/libsndfile/Octave/PKG_ADD delete mode 100644 libs/libsndfile/Octave/Readme.txt delete mode 100644 libs/libsndfile/Octave/format.h delete mode 100644 libs/libsndfile/Octave/octave_test.m delete mode 100755 libs/libsndfile/Octave/octave_test.sh delete mode 100644 libs/libsndfile/Octave/sndfile.cc delete mode 100644 libs/libsndfile/Octave/sndfile_load.m delete mode 100644 libs/libsndfile/Octave/sndfile_play.m delete mode 100644 libs/libsndfile/Octave/sndfile_save.m delete mode 100644 libs/libsndfile/README delete mode 100644 libs/libsndfile/README.md delete mode 100644 libs/libsndfile/Scripts/android-configure.sh delete mode 100644 libs/libsndfile/Scripts/build-test-tarball.mk.in delete mode 100644 libs/libsndfile/Scripts/clang-sanitize.sh delete mode 100644 libs/libsndfile/Scripts/cstyle.py delete mode 100644 libs/libsndfile/Scripts/git-pre-commit-hook delete mode 100644 libs/libsndfile/Scripts/linux-to-win-cross-configure.sh delete mode 100644 libs/libsndfile/TODO delete mode 100644 libs/libsndfile/Win32/Makefile.am delete mode 100644 libs/libsndfile/Win32/README-precompiled-dll.txt delete mode 100644 libs/libsndfile/Win32/testprog.c delete mode 100644 libs/libsndfile/acinclude.m4 delete mode 100644 libs/libsndfile/autogen.sh delete mode 100644 libs/libsndfile/binheader_readf_check.py delete mode 100644 libs/libsndfile/configure.ac delete mode 100644 libs/libsndfile/configure.gnu delete mode 100644 libs/libsndfile/doc/FAQ.html delete mode 100644 libs/libsndfile/doc/Makefile.am delete mode 100644 libs/libsndfile/doc/api.html delete mode 100644 libs/libsndfile/doc/bugs.html delete mode 100644 libs/libsndfile/doc/command.html delete mode 100644 libs/libsndfile/doc/development.html delete mode 100644 libs/libsndfile/doc/dither.html delete mode 100644 libs/libsndfile/doc/donate.html delete mode 100644 libs/libsndfile/doc/embedded_files.html delete mode 100644 libs/libsndfile/doc/index.html delete mode 100644 libs/libsndfile/doc/libsndfile.css.in delete mode 100644 libs/libsndfile/doc/linux_games_programming.txt delete mode 100644 libs/libsndfile/doc/lists.html delete mode 100644 libs/libsndfile/doc/new_file_type.HOWTO delete mode 100644 libs/libsndfile/doc/octave.html delete mode 100644 libs/libsndfile/doc/pkgconfig.html delete mode 100644 libs/libsndfile/doc/print.css delete mode 100644 libs/libsndfile/doc/sndfile_info.html delete mode 100644 libs/libsndfile/doc/tutorial.html delete mode 100644 libs/libsndfile/doc/win32.html delete mode 100644 libs/libsndfile/echo-install-dirs.in delete mode 100644 libs/libsndfile/examples/Makefile.am delete mode 100644 libs/libsndfile/examples/cooledit-fixer.c delete mode 100644 libs/libsndfile/examples/generate.c delete mode 100644 libs/libsndfile/examples/generate.cs delete mode 100644 libs/libsndfile/examples/list_formats.c delete mode 100644 libs/libsndfile/examples/make_sine.c delete mode 100644 libs/libsndfile/examples/sfprocess.c delete mode 100644 libs/libsndfile/examples/sndfile-convert.c delete mode 100644 libs/libsndfile/examples/sndfile-info.c delete mode 100644 libs/libsndfile/examples/sndfile-play-beos.cpp delete mode 100644 libs/libsndfile/examples/sndfile-play.c delete mode 100644 libs/libsndfile/examples/sndfile-to-text.c delete mode 100644 libs/libsndfile/examples/sndfilehandle.cc delete mode 100644 libs/libsndfile/libsndfile.spec.in delete mode 100644 libs/libsndfile/make_lite.py delete mode 100644 libs/libsndfile/man/Makefile.am delete mode 100644 libs/libsndfile/man/sndfile-cmp.1 delete mode 100644 libs/libsndfile/man/sndfile-concat.1 delete mode 100644 libs/libsndfile/man/sndfile-convert.1 delete mode 100644 libs/libsndfile/man/sndfile-info.1 delete mode 100644 libs/libsndfile/man/sndfile-interleave.1 delete mode 100644 libs/libsndfile/man/sndfile-metadata-get.1 delete mode 100644 libs/libsndfile/man/sndfile-play.1 delete mode 100644 libs/libsndfile/programs/Makefile.am delete mode 100644 libs/libsndfile/programs/common.c delete mode 100644 libs/libsndfile/programs/common.h delete mode 100644 libs/libsndfile/programs/sndfile-cmp.c delete mode 100644 libs/libsndfile/programs/sndfile-concat.c delete mode 100644 libs/libsndfile/programs/sndfile-convert.c delete mode 100644 libs/libsndfile/programs/sndfile-deinterleave.c delete mode 100644 libs/libsndfile/programs/sndfile-info.c delete mode 100644 libs/libsndfile/programs/sndfile-interleave.c delete mode 100644 libs/libsndfile/programs/sndfile-jackplay.c delete mode 100644 libs/libsndfile/programs/sndfile-metadata-get.c delete mode 100644 libs/libsndfile/programs/sndfile-metadata-set.c delete mode 100644 libs/libsndfile/programs/sndfile-play-beos.cpp delete mode 100644 libs/libsndfile/programs/sndfile-play.c delete mode 100644 libs/libsndfile/programs/sndfile-salvage.c delete mode 100644 libs/libsndfile/programs/test-sndfile-metadata-set.py delete mode 100644 libs/libsndfile/reconfigure.mk delete mode 100644 libs/libsndfile/regtest/Makefile.am delete mode 100644 libs/libsndfile/regtest/Readme.txt delete mode 100644 libs/libsndfile/regtest/checksum.c delete mode 100644 libs/libsndfile/regtest/database.c delete mode 100644 libs/libsndfile/regtest/regtest.h delete mode 100644 libs/libsndfile/regtest/sndfile-regtest.c delete mode 100644 libs/libsndfile/sndfile.pc.in delete mode 100644 libs/libsndfile/src/ALAC/ALACAudioTypes.h delete mode 100644 libs/libsndfile/src/ALAC/ALACBitUtilities.c delete mode 100644 libs/libsndfile/src/ALAC/ALACBitUtilities.h delete mode 100644 libs/libsndfile/src/ALAC/ALACDecoder.h delete mode 100644 libs/libsndfile/src/ALAC/ALACEncoder.h delete mode 100644 libs/libsndfile/src/ALAC/EndianPortable.h delete mode 100644 libs/libsndfile/src/ALAC/LICENSE delete mode 100644 libs/libsndfile/src/ALAC/ag_dec.c delete mode 100644 libs/libsndfile/src/ALAC/ag_enc.c delete mode 100644 libs/libsndfile/src/ALAC/aglib.h delete mode 100644 libs/libsndfile/src/ALAC/alac_codec.h delete mode 100644 libs/libsndfile/src/ALAC/alac_decoder.c delete mode 100644 libs/libsndfile/src/ALAC/alac_decoder.h delete mode 100644 libs/libsndfile/src/ALAC/alac_encoder.c delete mode 100644 libs/libsndfile/src/ALAC/dp_dec.c delete mode 100644 libs/libsndfile/src/ALAC/dp_enc.c delete mode 100644 libs/libsndfile/src/ALAC/dplib.h delete mode 100644 libs/libsndfile/src/ALAC/matrix_dec.c delete mode 100644 libs/libsndfile/src/ALAC/matrix_enc.c delete mode 100644 libs/libsndfile/src/ALAC/matrixlib.h delete mode 100644 libs/libsndfile/src/G72x/ChangeLog delete mode 100644 libs/libsndfile/src/G72x/Makefile.am delete mode 100644 libs/libsndfile/src/G72x/README delete mode 100644 libs/libsndfile/src/G72x/README.original delete mode 100644 libs/libsndfile/src/G72x/g721.c delete mode 100644 libs/libsndfile/src/G72x/g723_16.c delete mode 100644 libs/libsndfile/src/G72x/g723_24.c delete mode 100644 libs/libsndfile/src/G72x/g723_40.c delete mode 100644 libs/libsndfile/src/G72x/g72x.c delete mode 100644 libs/libsndfile/src/G72x/g72x.h delete mode 100644 libs/libsndfile/src/G72x/g72x_priv.h delete mode 100644 libs/libsndfile/src/G72x/g72x_test.c delete mode 100644 libs/libsndfile/src/GSM610/COPYRIGHT delete mode 100644 libs/libsndfile/src/GSM610/ChangeLog delete mode 100644 libs/libsndfile/src/GSM610/Makefile.am delete mode 100644 libs/libsndfile/src/GSM610/README delete mode 100644 libs/libsndfile/src/GSM610/add.c delete mode 100644 libs/libsndfile/src/GSM610/code.c delete mode 100644 libs/libsndfile/src/GSM610/config.h delete mode 100644 libs/libsndfile/src/GSM610/decode.c delete mode 100644 libs/libsndfile/src/GSM610/gsm.h delete mode 100644 libs/libsndfile/src/GSM610/gsm610_priv.h delete mode 100644 libs/libsndfile/src/GSM610/gsm_create.c delete mode 100644 libs/libsndfile/src/GSM610/gsm_decode.c delete mode 100644 libs/libsndfile/src/GSM610/gsm_destroy.c delete mode 100644 libs/libsndfile/src/GSM610/gsm_encode.c delete mode 100644 libs/libsndfile/src/GSM610/gsm_option.c delete mode 100644 libs/libsndfile/src/GSM610/long_term.c delete mode 100644 libs/libsndfile/src/GSM610/lpc.c delete mode 100644 libs/libsndfile/src/GSM610/preprocess.c delete mode 100644 libs/libsndfile/src/GSM610/rpe.c delete mode 100644 libs/libsndfile/src/GSM610/short_term.c delete mode 100644 libs/libsndfile/src/GSM610/table.c delete mode 100644 libs/libsndfile/src/Makefile.am delete mode 100644 libs/libsndfile/src/Symbols.darwin delete mode 100644 libs/libsndfile/src/Symbols.linux delete mode 100644 libs/libsndfile/src/Symbols.os2 delete mode 100644 libs/libsndfile/src/aiff.c delete mode 100644 libs/libsndfile/src/alac.c delete mode 100644 libs/libsndfile/src/alaw.c delete mode 100644 libs/libsndfile/src/au.c delete mode 100644 libs/libsndfile/src/audio_detect.c delete mode 100644 libs/libsndfile/src/avr.c delete mode 100644 libs/libsndfile/src/binheader_writef_check.py delete mode 100644 libs/libsndfile/src/broadcast.c delete mode 100644 libs/libsndfile/src/caf.c delete mode 100644 libs/libsndfile/src/cart.c delete mode 100644 libs/libsndfile/src/chanmap.c delete mode 100644 libs/libsndfile/src/chanmap.h delete mode 100644 libs/libsndfile/src/chunk.c delete mode 100644 libs/libsndfile/src/command.c delete mode 100644 libs/libsndfile/src/common.c delete mode 100644 libs/libsndfile/src/common.h delete mode 100755 libs/libsndfile/src/create_symbols_file.py delete mode 100644 libs/libsndfile/src/cygsndfile.def delete mode 100644 libs/libsndfile/src/dither.c delete mode 100644 libs/libsndfile/src/double64.c delete mode 100644 libs/libsndfile/src/dwd.c delete mode 100644 libs/libsndfile/src/dwvw.c delete mode 100644 libs/libsndfile/src/file_io.c delete mode 100644 libs/libsndfile/src/flac.c delete mode 100644 libs/libsndfile/src/float32.c delete mode 100644 libs/libsndfile/src/float_cast.h delete mode 100644 libs/libsndfile/src/g72x.c delete mode 100644 libs/libsndfile/src/gsm610.c delete mode 100644 libs/libsndfile/src/htk.c delete mode 100644 libs/libsndfile/src/id3.c delete mode 100644 libs/libsndfile/src/ima_adpcm.c delete mode 100644 libs/libsndfile/src/ima_oki_adpcm.c delete mode 100644 libs/libsndfile/src/ima_oki_adpcm.h delete mode 100644 libs/libsndfile/src/interleave.c delete mode 100644 libs/libsndfile/src/ircam.c delete mode 100644 libs/libsndfile/src/libsndfile-1.def delete mode 100644 libs/libsndfile/src/libsndfile.def delete mode 100644 libs/libsndfile/src/macbinary3.c delete mode 100644 libs/libsndfile/src/macos.c delete mode 100644 libs/libsndfile/src/make-static-lib-hidden-privates.sh delete mode 100644 libs/libsndfile/src/mat4.c delete mode 100644 libs/libsndfile/src/mat5.c delete mode 100644 libs/libsndfile/src/mpc2k.c delete mode 100644 libs/libsndfile/src/ms_adpcm.c delete mode 100644 libs/libsndfile/src/new.c delete mode 100644 libs/libsndfile/src/nist.c delete mode 100644 libs/libsndfile/src/ogg.c delete mode 100644 libs/libsndfile/src/ogg.h delete mode 100644 libs/libsndfile/src/ogg_opus.c delete mode 100644 libs/libsndfile/src/ogg_pcm.c delete mode 100644 libs/libsndfile/src/ogg_speex.c delete mode 100644 libs/libsndfile/src/ogg_vorbis.c delete mode 100644 libs/libsndfile/src/paf.c delete mode 100644 libs/libsndfile/src/pcm.c delete mode 100644 libs/libsndfile/src/pvf.c delete mode 100644 libs/libsndfile/src/raw.c delete mode 100644 libs/libsndfile/src/rf64.c delete mode 100644 libs/libsndfile/src/rx2.c delete mode 100644 libs/libsndfile/src/sd2.c delete mode 100644 libs/libsndfile/src/sds.c delete mode 100644 libs/libsndfile/src/sf_unistd.h delete mode 100644 libs/libsndfile/src/sfconfig.h delete mode 100644 libs/libsndfile/src/sfendian.h delete mode 100644 libs/libsndfile/src/sndfile.c delete mode 100644 libs/libsndfile/src/sndfile.h.in delete mode 100644 libs/libsndfile/src/sndfile.hh delete mode 100644 libs/libsndfile/src/strings.c delete mode 100644 libs/libsndfile/src/svx.c delete mode 100644 libs/libsndfile/src/test_audio_detect.c delete mode 100644 libs/libsndfile/src/test_broadcast_var.c delete mode 100644 libs/libsndfile/src/test_cart_var.c delete mode 100644 libs/libsndfile/src/test_conversions.c delete mode 100644 libs/libsndfile/src/test_endswap.c delete mode 100644 libs/libsndfile/src/test_endswap.def delete mode 100644 libs/libsndfile/src/test_endswap.tpl delete mode 100644 libs/libsndfile/src/test_file_io.c delete mode 100644 libs/libsndfile/src/test_float.c delete mode 100644 libs/libsndfile/src/test_ima_oki_adpcm.c delete mode 100644 libs/libsndfile/src/test_log_printf.c delete mode 100644 libs/libsndfile/src/test_main.c delete mode 100644 libs/libsndfile/src/test_main.h delete mode 100644 libs/libsndfile/src/test_strncpy_crlf.c delete mode 100644 libs/libsndfile/src/txw.c delete mode 100644 libs/libsndfile/src/ulaw.c delete mode 100644 libs/libsndfile/src/version-metadata.rc.in delete mode 100644 libs/libsndfile/src/voc.c delete mode 100644 libs/libsndfile/src/vox_adpcm.c delete mode 100644 libs/libsndfile/src/w64.c delete mode 100644 libs/libsndfile/src/wav.c delete mode 100644 libs/libsndfile/src/wav_w64.c delete mode 100644 libs/libsndfile/src/wav_w64.h delete mode 100644 libs/libsndfile/src/windows.c delete mode 100644 libs/libsndfile/src/wve.c delete mode 100644 libs/libsndfile/src/xi.c delete mode 100644 libs/libsndfile/tests/Makefile.am delete mode 100644 libs/libsndfile/tests/aiff_rw_test.c delete mode 100644 libs/libsndfile/tests/alaw_test.c delete mode 100644 libs/libsndfile/tests/benchmark-0.0.28 delete mode 100644 libs/libsndfile/tests/benchmark-1.0.0 delete mode 100644 libs/libsndfile/tests/benchmark-1.0.0rc2 delete mode 100644 libs/libsndfile/tests/benchmark-1.0.18pre16-hendrix delete mode 100644 libs/libsndfile/tests/benchmark-1.0.18pre16-mingus delete mode 100644 libs/libsndfile/tests/benchmark-1.0.6pre10-coltrane delete mode 100644 libs/libsndfile/tests/benchmark-1.0.6pre10-miles delete mode 100644 libs/libsndfile/tests/benchmark-latest-coltrane delete mode 100644 libs/libsndfile/tests/benchmark.c delete mode 100644 libs/libsndfile/tests/benchmark.def delete mode 100644 libs/libsndfile/tests/benchmark.tpl delete mode 100644 libs/libsndfile/tests/channel_test.c delete mode 100644 libs/libsndfile/tests/checksum_test.c delete mode 100644 libs/libsndfile/tests/chunk_test.c delete mode 100644 libs/libsndfile/tests/command_test.c delete mode 100644 libs/libsndfile/tests/compression_size_test.c delete mode 100644 libs/libsndfile/tests/cpp_test.cc delete mode 100644 libs/libsndfile/tests/dft_cmp.c delete mode 100644 libs/libsndfile/tests/dft_cmp.h delete mode 100644 libs/libsndfile/tests/dither_test.c delete mode 100644 libs/libsndfile/tests/dwvw_test.c delete mode 100644 libs/libsndfile/tests/error_test.c delete mode 100644 libs/libsndfile/tests/external_libs_test.c delete mode 100644 libs/libsndfile/tests/fix_this.c delete mode 100644 libs/libsndfile/tests/floating_point_test.c delete mode 100644 libs/libsndfile/tests/floating_point_test.def delete mode 100644 libs/libsndfile/tests/floating_point_test.tpl delete mode 100644 libs/libsndfile/tests/format_check_test.c delete mode 100644 libs/libsndfile/tests/generate.c delete mode 100644 libs/libsndfile/tests/generate.h delete mode 100644 libs/libsndfile/tests/header_test.c delete mode 100644 libs/libsndfile/tests/header_test.def delete mode 100644 libs/libsndfile/tests/header_test.tpl delete mode 100644 libs/libsndfile/tests/headerless_test.c delete mode 100644 libs/libsndfile/tests/largefile_test.c delete mode 100644 libs/libsndfile/tests/locale_test.c delete mode 100644 libs/libsndfile/tests/lossy_comp_test.c delete mode 100644 libs/libsndfile/tests/misc_test.c delete mode 100644 libs/libsndfile/tests/multi_file_test.c delete mode 100644 libs/libsndfile/tests/ogg_test.c delete mode 100644 libs/libsndfile/tests/open_fail_test.c delete mode 100644 libs/libsndfile/tests/pcm_test.c delete mode 100644 libs/libsndfile/tests/pcm_test.def delete mode 100644 libs/libsndfile/tests/pcm_test.tpl delete mode 100644 libs/libsndfile/tests/peak_chunk_test.c delete mode 100644 libs/libsndfile/tests/pedantic-header-test.sh.in delete mode 100644 libs/libsndfile/tests/pipe_test.c delete mode 100644 libs/libsndfile/tests/pipe_test.def delete mode 100644 libs/libsndfile/tests/pipe_test.tpl delete mode 100644 libs/libsndfile/tests/raw_test.c delete mode 100644 libs/libsndfile/tests/rdwr_test.def delete mode 100644 libs/libsndfile/tests/rdwr_test.tpl delete mode 100644 libs/libsndfile/tests/scale_clip_test.c delete mode 100644 libs/libsndfile/tests/scale_clip_test.def delete mode 100644 libs/libsndfile/tests/scale_clip_test.tpl delete mode 100644 libs/libsndfile/tests/sftest.c delete mode 100644 libs/libsndfile/tests/sfversion.c delete mode 100644 libs/libsndfile/tests/stdin_test.c delete mode 100644 libs/libsndfile/tests/stdio_test.c delete mode 100644 libs/libsndfile/tests/stdout_test.c delete mode 100644 libs/libsndfile/tests/string_test.c delete mode 100644 libs/libsndfile/tests/test_wrapper.sh.in delete mode 100644 libs/libsndfile/tests/ulaw_test.c delete mode 100644 libs/libsndfile/tests/utils.c delete mode 100644 libs/libsndfile/tests/utils.def delete mode 100644 libs/libsndfile/tests/utils.h delete mode 100644 libs/libsndfile/tests/utils.tpl delete mode 100644 libs/libsndfile/tests/virtual_io_test.c delete mode 100644 libs/libsndfile/tests/vorbis_test.c delete mode 100644 libs/libsndfile/tests/win32_ordinal_test.c delete mode 100644 libs/libsndfile/tests/win32_test.c delete mode 100644 libs/libsndfile/tests/write_read_test.c delete mode 100644 libs/libsndfile/tests/write_read_test.def delete mode 100644 libs/libsndfile/tests/write_read_test.tpl delete mode 100644 libs/win32/libsndfile/cleancount delete mode 100644 libs/win32/libsndfile/config.h delete mode 100644 libs/win32/libsndfile/libsndfile.2010.vcxproj.filters delete mode 100644 libs/win32/libsndfile/libsndfile.2015.vcxproj delete mode 100644 libs/win32/libsndfile/sndfile.h create mode 100644 w32/libsndfile-version.props create mode 100644 w32/libsndfile.props diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index 955be84cc8..f0529beaca 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -232,8 +232,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "libs\win32\ap EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iksemel", "libs\win32\iksemel\iksemel.2015.vcxproj", "{E727E8F6-935D-46FE-8B0E-37834748A0E3}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsndfile", "libs\win32\libsndfile\libsndfile.2015.vcxproj", "{3D0370CA-BED2-4657-A475-32375CBCB6E4}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "libs\win32\apr-util\xml.2015.vcxproj", "{155844C3-EC5F-407F-97A4-A2DDADED9B2F}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sofia", "src\mod\endpoints\mod_sofia\mod_sofia.2015.vcxproj", "{0DF3ABD0-DDC0-4265-B778-07C66780979B}" @@ -956,17 +954,6 @@ Global {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.Build.0 = Release|Win32 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.ActiveCfg = Release|x64 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.Build.0 = Release|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.All|Win32.ActiveCfg = Release|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.All|x64.ActiveCfg = Release|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.All|x64.Build.0 = Release|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.ActiveCfg = Debug|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.Build.0 = Debug|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|x64.ActiveCfg = Debug|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|x64.Build.0 = Debug|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.ActiveCfg = Release|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.Build.0 = Release|Win32 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|x64.ActiveCfg = Release|x64 - {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|x64.Build.0 = Release|x64 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|Win32.ActiveCfg = Debug|x64 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|x64.ActiveCfg = Debug|x64 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|x64.Build.0 = Debug|x64 @@ -3005,7 +2992,6 @@ Global {F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {F057DA7F-79E5-4B00-845C-EF446EF055E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {E727E8F6-935D-46FE-8B0E-37834748A0E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} - {3D0370CA-BED2-4657-A475-32375CBCB6E4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B} {0DF3ABD0-DDC0-4265-B778-07C66780979B} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C} {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D} diff --git a/libs/.gitignore b/libs/.gitignore index 49d7177e88..f66304d9f7 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -854,3 +854,5 @@ flite-*/ flite-* pcre-*/ pcre-* +libsndfile-*/ +libsndfile-* diff --git a/libs/libsndfile/.update b/libs/libsndfile/.update deleted file mode 100644 index cbf0edf709..0000000000 --- a/libs/libsndfile/.update +++ /dev/null @@ -1 +0,0 @@ -Fri Feb 28 03:45:32 CDT 2014 diff --git a/libs/libsndfile/AUTHORS b/libs/libsndfile/AUTHORS deleted file mode 100644 index b7e2232b95..0000000000 --- a/libs/libsndfile/AUTHORS +++ /dev/null @@ -1,14 +0,0 @@ -The main author of libsndfile is Erik de Castro Lopo -apart from code in the following directories: - - - src/GSM610 : Written by Jutta Degener and Carsten - Bormann . They should not be contacted in relation to - libsndfile or the GSM 6.10 code that is part of libsndfile. Their original - code can be found at: - - http://kbs.cs.tu-berlin.de/~jutta/toast.html - - - src/G72x : Released by Sun Microsystems, Inc. to the public domain. Minor - modifications were required to integrate these files into libsndfile. The - changes are listed in src/G72x/ChangeLog. - diff --git a/libs/libsndfile/COPYING b/libs/libsndfile/COPYING deleted file mode 100644 index c396169eea..0000000000 --- a/libs/libsndfile/COPYING +++ /dev/null @@ -1,503 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - diff --git a/libs/libsndfile/Cfg/.empty b/libs/libsndfile/Cfg/.empty deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libs/libsndfile/ChangeLog b/libs/libsndfile/ChangeLog deleted file mode 100644 index d22be00cd7..0000000000 --- a/libs/libsndfile/ChangeLog +++ /dev/null @@ -1,9764 +0,0 @@ -2013-04-05 Erik de Castro Lopo - - * Makefile.am - Make sure checkprograms are built as part of 'make test-tarball'. - Closes: https://github.com/erikd/libsndfile/issues/37 - -2013-03-29 Erik de Castro Lopo - - * tests/dft_cmp.c - Fix a buffer overflow detected using GCC 4.8's -fsantiize=address runtime - error checking functionality. This was a buffer overflow in libsndfile's - test suite, not in the actual library code. - -2013-03-09 Erik de Castro Lopo - - * M4/gcc_version.m4 - Fix to work with OpenBSD's sed. - -2013-03-07 Erik de Castro Lopo - - * src/ALAC/alac_encoder.c - Patch from Michael Pruett (author of libaudiofile) to add correct byte - swapping for the mChannelLayoutTag field. - -2013-03-02 Erik de Castro Lopo - - * doc/bugs.html - Bugs should bt reported on the github issue tracker. - -2013-02-22 Erik de Castro Lopo - - * configure.ac - Improve sanitization of FLAC_CFLAGS value. - -2013-02-21 Erik de Castro Lopo - - * src/Makefile.am - Call python interpreter instead of using '#!' in script. Thanks to Jan - Stary for reporting this. - - * doc/index.html doc/FAQ.html - Make internal links relative. Patch from Jan Stary. - -2013-02-13 Erik de Castro Lopo - - * src/test_endswap.def src/test_endswap.tpl - Add tests for psf_put_be32() and psf_put_be64(). - - * src/sfendian.h src/test_endswap.(def|tpl) - Add functions psf_get_be(16|32|64) with tests. - These are needed for platforms where un-aligned accesses cause bus faults. - - * src/ALAC/ag_enc.c src/ALAC/alac_decoder.c - Replace all un-aligned accesses with safe alternatives. - Closes: https://github.com/erikd/libsndfile/issues/19 - -2013-02-12 Erik de Castro Lopo - - * src/sfendian.h - Add big endian versions of H2BE_16 and H2BE_32. - -2013-02-11 Erik de Castro Lopo - - * src/ALAC/ - Replace Apple endswap routines with ones from libsndfile. - - * merge from libsndfile-cart repo - Add ability to set and get a cart chunk with WAV and RF64. - Orignal patch by Chris Roberts required a number of - tweaks. - -2013-02-10 Erik de Castro Lopo - - * src/common.h - Bump SF_HEADER_LEN from 8192 to 12292, the value it was in the 1.0.25 - release. - -2013-02-09 Erik de Castro Lopo - - * src/alac.c - Fix segfault when encoding 8 channel files. - Closes: https://github.com/erikd/libsndfile/issues/30 - -2013-02-07 Erik de Castro Lopo - - * src/ALAC/EndianPortable.c - Fall back to compiler's __BYTE_ORDER__ for endian-ness detection. - -2013-02-06 Erik de Castro Lopo - - * configure.ac src/common.h src/ima_adpcm.c src/ms_adpcm.c src/paf.c - Drop tests for and #ifdef hackery for C99 struct flexible array feature. - libsndfile assumes the compiler supports most of the ISO C99 standard. - - * src/alac.c - Fix valgrind invalid realloc. Reported by nu774. - Closes: https://github.com/erikd/libsndfile/issues/31 - -2013-02-05 Erik de Castro Lopo - - * src/alac.c - The 'pakt' chunk header should now be written correctly. - Closes: https://github.com/erikd/libsndfile/issues/24 - - * configure.ac Makefile.am - Use PKG_INSTALLDIR when it exists. Suggestion from Christoph Thompson. - Closes: https://github.com/erikd/libsndfile/pull/28 - -2013-02-03 Erik de Castro Lopo - - * src/common.h src/caf.c - Read the ALAC 'pakt' header and stash the values. - - * src/sfendian.h - Add functions psf_put_be64() and psf_put_be32(). - - * src/alac.c - Start work on filling on the 'pakt' chunk header. - -2013-02-02 Erik de Castro Lopo - - * doc/FAQ.html - Add missing opening

tag. - - * src/alac.c - Increase ALAC_BYTE_BUFFER_SIZE to 82000. - -2013-01-27 Erik de Castro Lopo - - * doc/FAQ.html - Improve question #8. - -2013-01-02 Erik de Castro Lopo - - * src/ogg_opus.c - Add skeleton implementation so someone else can run with it. - -2012-12-12 Erik de Castro Lopo - - * src/common.h src/dwd.c src/rx2.c src/txw.c - Fix for compiling when configured with --enable-experimental. Thanks to - Eric Wong for reporting this. - -2012-12-01 Erik de Castro Lopo - - * configure.ac programs/sndfile-play.c - OS X 10.8 uses a different audio API to previous versions. - Fix compile failure on by disabling sndfile-play on this version. - Someone needs to supply code for the new API. - -2012-11-30 Erik de Castro Lopo - - * Octave/Makefile.am Octave/octave_test.sh - Fix 'make distcheck'. - -2012-10-13 Erik de Castro Lopo - - * M4/octave.m4 - Relax constraints on Octave version. - -2012-10-11 Erik de Castro Lopo - - * tests/utils.tpl - Improve compare_*_or_die() functions. - - * src/command.c - Fix bug reported by Keiler Florian. When reading short or int data from a - file containing float data, and setting SFC_SET_SCALE_FLOAT_INT_READ to - SF_TRUE would fail 3, 5, 7 and other channels counts. Problem was that - psf_calc_signal_max() was not calculating the signal max correctly. - Calculation of the signal max was failing because it was trying to read - a sample count that was not an integer multiple of the channel count. - - * tests/channel_test.c tests/Makefile.am tests/test_wrapper.sh.in - Add test for the above. - -2012-09-25 Erik de Castro Lopo - - * src/sndfile.hh - Added a constructor to allow the use of SF_VIRTUAL_IO. Patch from - DannyDaemonic : https://github.com/erikd/libsndfile/pull/20 - -2012-08-23 Erik de Castro Lopo - - * doc/octave.html - Fix link to octave.sourceforge.net. Thanks to IOhannes m zmoelnig. - - * src/mat5.c - Allow reading of mat5 files without a specified sample rate (default to - 44.1kHz). Thanks to IOhannes m zmoelnig. - -2012-08-19 Erik de Castro Lopo - - * src/paf.c - Error out if channel count is zero. Bug report from William ELla via - launchpad: - https://bugs.launchpad.net/ubuntu/+source/libsndfile/+bug/1036831 - -2012-08-04 Erik de Castro Lopo - - * configure.ac programs/sndfile-play.c - Patch from Ricci Adams to use OSX's AudioQueues on OSX 10.7 and greater. - -2012-07-09 Erik de Castro Lopo - - * programs/common.c - Accept "ogg" as a file extention for Ogg/Vorbis files. - -2012-06-22 Erik de Castro Lopo - - * src/flac.c - Make sure any previously allocated FLAC stream encoder and stream decoder - objects are deleted before a new one is allocated. - -2012-06-20 Erik de Castro Lopo - - * tests/utils.tpl - Rename gen_lowpass_noise_float() to gen_lowpass_signal_float() and add a - sine wave component so that different FLAC compression levels can be - tested. - - * src/sndfile.h.in doc/command.html - Add SFC_SET_COMPRESSION_LEVEL and document it. - - * src/sndfile.c - Catch SFC_SET_VBR_ENCODING_QUALITY command and implement it as the inverse - of SFC_SET_COMPRESSION_LEVEL. - - * src/ogg_vorbis.c src/flac.c - Implement SFC_SET_COMPRESSION_LEVEL command. - - * tests/test_wrapper.sh.in tests/compression_size_test.c - Use the compression_size_test on FLAC as well. - -2012-06-19 Erik de Castro Lopo - - * tests/ - Rename vorbis_test.c -> compression_size_test.c so it can be extended to - test FLAC as well. - -2012-06-18 Erik de Castro Lopo - - * src/broadcast.c - Fix a bug where a file with a 'bext' chunk with a zero length coding - history field would get corrupted when the file was closed. - Reported by Paul Davis of the Ardour project. - - * src/test_broadcast_var.c - Add a test for the above. - -2012-05-19 Erik de Castro Lopo - - * src/sndfile.c - sf_format_check: For SF_FORMAT_AIFF, reject endian-ness setttings for - non-PCM formats. - -2012-04-12 Erik de Castro Lopo - - * src/aiff.c - Fix regression in handling of odd length SSND chunks. - Thanks Olivier Tristan for the example file. - - * src/aiff.c src/wav.c - Exit parser loop when marker == 0. - -2012-04-04 Erik de Castro Lopo - - * doc/FAQ.html - Fix text. Thanks to Richard Collins. - -2012-03-24 Erik de Castro Lopo - - * src/caf.c - Exit parse loop if the marker is zero. Pass jump offsets as size_t instead - of int. - -2012-03-20 Erik de Castro Lopo - - * src/alac.c - Fix segfault when decoding CAF/ALAC file with more than 4 channels. - Fixes github issue #8 reported by Charles Van Winkle. - -2012-03-20 Erik de Castro Lopo - - * src/common.h - Change 'typedef SF_CHUNK_ITERATOR { ... } SF_CHUNK_ITERATOR' into 'struct - SF_CHUNK_ITERATOR { ... }' to prevent older compilers from complaining of - re-typedef-ing of SF_CHUNK_ITERATOR. - - * configure.ac - Fix if test for empty $prefix. - -2012-03-18 Erik de Castro Lopo - - * src/*.c tests/chunk_test.c - Reworking of custom chunk handling code. - - Memory for the iterator is now attached to the SF_PRIVATE struct and - freed one sf_close(). - - Rename sf_create_chunk_iterator() -> sf_get_chunk_iterator(). - - Each SNDFILE handle never has more than one SF_CHUNK_ITERATOR handle. - - * tests/string_test.c - Fix un-initialised char buffer. - -2012-03-17 Erik de Castro Lopo - - * src/*.c tests/chunk_test.c - Add improved handling of custom chunk getting and settings. Set of patches - from IOhannes m zmoelnig submitted via github pull request #6. - - * src/alac.c - Fix calculated frame count for files with zero block length. - -2012-03-13 Erik de Castro Lopo - - * src/avr.c - Remove double assignment to psf->endian. Thanks Kao Dome. - - * src/gsm610.c - Fix clearing of buffers. Thanks Kao Dome. - - * src/paf.c - Remove duplicate code. Thanks Kao Dome. - - * src/test_strncpy_crlf.c - Fix minor error in test. Thanks Kao Dome. - - * src/common.h src/*.c - Fix a bunch of valgrind errors. - -2012-03-13 Erik de Castro Lopo - - * src/sndfile.c - Fix typo in error string 'Uknown' -> 'Unknown'. - - * tests/fix_this.c - Fix potential int overflow. - -2012-03-10 Erik de Castro Lopo - - * src/alac.c - Fix decoding of last block so that the decode length is not a multiple of - the block length. Fixes github issue #4 reported by Charles Van Winkle. - - * src/sfconfig.h src/sfendian.h - Fix for MinGW cross compiling. Use '#if (defined __*66__)' instead of - '#if __*86__' because the MinGW header use '#ifdef __x86_64__'. - -2012-03-10 Erik de Castro Lopo - - * src/ALAC/ src/alac.c - Unify the interface between libsndfile and Apple ALAC codec. Regardless of - file bit width samples are now passed between the two as int32_t that are - justified towards the most significant bit. Without this modification, 16 - conversion functions would have been needed between the libsndfile (short, - int, float, double) types and the ALAC types (16, 20, 24 and 32 bit). With - this mod, only 4 are needed. - - * tests/floating_point_test.tpl tests/write_read_test.(def|tpl) - Add tests for 20 and 24 bit ALAC/CAF files. - - * src/command.c - Add ALAC/CAF to the SFC_GET_FORMAT_* commands. Fixes github issue #5. - - * configure.ac - Only use automake AM_SLIENT_RULES where supported. Thanks Dave Yeo. - - * tests/pipe_test.tpl - Disable tests on OS/2. Thanks Dave Yeo. - -2012-03-09 Erik de Castro Lopo - - * configure.ac src/sfconfig.h src/sfendian.h - For GCC, use inline assembler for endian swapping. This should work with - older versions of GCC like the one currently used in OS/2. - -2012-03-06 Erik de Castro Lopo - - * src/alac.c - Make sure temp file gets opened in binary mode. - - * src/alac.c src/common.c src/common.h - Fix function alac_write16_d(). - - * tests/floating_point_test.tpl - Add tests for 16 bit ALAC/CAF. - - * src/alac.c src/common.c src/common.h - Add support for 32 bit ALAC/CAF files. - - * tests/floating_point_test.tpl tests/write_read_test.tpl - Add tests for 32 bit ALAC/CAF files. - -2012-03-05 Erik de Castro Lopo - - * src/ - Refactor chunk storage so it work on big as well as little endian CPUs. - - * tests/chunk_test.c - Clean up error messages. - - * src/sfendian.h src/*.c - Rename endian swapping macros and add ENDSWAP_64 and BE2H_64. - - * configure.ac - Detect presence of header file. - - * src/sfendian.h - Use intrinsics (ie for MinGW) when is not - present. - Make ENDSWAP_64() work with i686-w64-mingw32 compiler. - - * src/ALAC/EndianPortable.c - Add support for __powerpc__. - - * src/sfconfig.h - Make sure HAVE_X86INTRIN_H is either 1 or 0. - -2012-03-03 Erik de Castro Lopo - - * src/ALAC/* - Big dump of code for Apple's ALAC file format. The copyyright to this code - is owned by Apple who have released it under an Apache style license. A few - small modifications were made to allow this to be integrated into libsndfile - but unfortunately the history of those changes were lost because they were - developed in a Bzr tree and during that time libsndfile moved to Git. - - * src/alac.c src/caf.c src/common.[ch] src/Makefile.am src/sndfile.h.in - src/sndfile.c - Hook new ALAC codec in. - - * programs/sndfile-convert.c - Add support for alac codec. - - * tests/write_read_test.tpl - Expand tests to cover ALAC. - -2012-03-02 Erik de Castro Lopo - - * src/aiff.c src/wav.c - Fix a couple of regressions from version 1.0.25. - -2012-03-01 Erik de Castro Lopo - - * src/strings.c - Minor refactoring. Make sure that the memory allocation size if always > 0 - to avoid undefined behaviour. - -2012-02-29 Erik de Castro Lopo - - * src/chunk.c - Fix buffer overrun introduced in recently added chunk logging. This chunk - logging has not yet made it to a libsndfile release version. Thanks to - Olivier Tristan for providing an example file. - - * src/wav.c - Fix handling of odd sized chunks which was causing the parser to lose some - chunks. Thanks to Olivier Tristan for providing an example file. - -2012-02-26 Erik de Castro Lopo - - * tests/util.tpl - Used gnu_printf format checking with mingw-w64 compiler. - - * tests/header_test.tpl - Printf format fixes. - -2012-02-25 Erik de Castro Lopo - - * M4/extra_pkg.m4 - Update PKG_CHECK_MOD_VERSION macro to add an AC_TRY_LINK step. This fix - allows the configure process to catch attempts to link incompatible - libraries. For example, linking 32 bit version of eg libFLAC to a 64 bit - version of libsndfile will now fail. Similarly, when cross compiling - libsndfile from Linux to Windows linking the Linux versions of a library - to the Windows version of libsndfile will now also fail. - - * src/sndfile.h.in src/sndfile.c src/common.h src/create_symbols_file.py - Add API function sf_current_byterate(). - - * src/dwvw.c src/flac.c src/ogg_vorbis.c src/sds.c - Add codec specific handlers for current byterate. - - * tests/floating_point_test.tpl - Add initial test for sf_current_byterate(). - -2012-02-24 Erik de Castro Lopo - - * src/common.[ch] - Add function psf_decode_frame_count(). - - * src/dwvw.c - Fix a termnation bug that caused the decoder to go into an infinite loop. - -2012-02-24 Erik de Castro Lopo - - * src/wav.c - Fix a regression in the WAV header parser. Thanks to Olivier Tristan for - bug report and the example file. - -2012-02-21 Erik de Castro Lopo - - * src/sndfile.c - Return error when SF_BROADCAST_INFO struct has bad coding_history_size. - Thanks to Alex Weiss for the report. - -2012-02-20 Erik de Castro Lopo - - * src/au.c src/flac.c src/g72x.c src/ogg_vorbis.c src/wav_w64.c - Don't fake psf->bytewidth values. - -2012-02-19 Erik de Castro Lopo - - * tests/string_test.c - Fix valgrind warnings. - - * src/common.h src/sndfile.c src/strings.c - Make string storage dynamically allocated. - - * src/sndfile.c - Add extra validation for custom chunk handling. - -2012-02-18 Erik de Castro Lopo - - * src/wav.c - Improve handlling unknown chunk types. Thanks to Olivier Tristan for sending - example files. - - * src/utils.tpl - Add GCC specific testing for format string parameters for exit_if_true(). - - * tests/*.c tests/*.tpl - Fix all printf format warnings. - - * programs/sndfile-play.c - Remove un-needed OSX include . Thanks jamesfmilne for github - issue #3. - - * tests/chunk_test.c - Extend custom chunk test. - -2012-02-12 Erik de Castro Lopo - - * src/wav.c - Jump over some more chunk types while parsing. - -2012-02-04 Erik de Castro Lopo - - * src/common.h src/strings.c - Change way strings are stored in SF_PRIVATE in preparation for dynamically - allocating the storage. - -2012-02-02 Erik de Castro Lopo - - * src/common.h src*.c - Improve encapsulation of string data in SF_PRIVATE. - -2012-02-01 Erik de Castro Lopo - - * src/common.h src*.c - Remove the buffer union from SF_PRIVATE. Most uses of this have been - replaced with a BUF_UNION that is allocated on the stack. - -2012-01-31 Erik de Castro Lopo - - * src/common.h src*.c - Rename logbuffer field of SF_PRIVATE to parselog and reduce its size. - Put the parselog buffer and the index inside a struct within SF_PRIVATE. - -2012-01-26 Erik de Castro Lopo - - * configure.ac - Fix typo, FLAC_CLFAGS -> FLAC_CFLAGS. Thanks to Jeremy Friesner. - -2012-01-21 Erik de Castro Lopo - - * src/sndfile.c src/ogg.c - Fix misleading error message when trying to create an SF_FORMAT_OGG file - with anything other than SF_FORMAT_FILE. Thanks to Charles Van Winkle for - the bug report. Github issue #1. - -2012-01-20 Erik de Castro Lopo - - * src/sndfile.c src/wav.c - Allow files opened in RDWR mode with string data in the tailer to be - extended. Thanks to Bodo for the patch. - - * tests/string_test.c - Add tests for the above changes (patch from Bodo). - -2012-01-09 Erik de Castro Lopo - - * src/aiff.c - Refactor reading of chunk size and use of psf_store_read_chunk(). - - * src/(caf|wav).c - Correct storing of chunk offset. - -2012-01-05 Erik de Castro Lopo - - * src/aiff.c src/wav.c src/common.h - Refactor common code into src/common.h. - - * src/caf.c - Make custom chunks work for CAF files. - - * tests/chunk_test.c tests/test_wrapper.sh.in - Test CAF files with custom chunks. - - * src/sndfile.c - Prevent psf->codec_close() being called more than once. - -2012-01-04 Erik de Castro Lopo - - * programs/sndfile-cmp.c - Catch the case where the second file has more frames than the first. - -2012-01-02 Erik de Castro Lopo - - * src/create_symbols_file.py - Add sf_set_chunk/sf_get_chunk_size/sf_get_chunk_data. - -2011-12-31 Erik de Castro Lopo - - * tests/chunk_test.c tests/Makefile.am - New test for custom chunks. - - * src/aiff.c src/chunk.c src/common.h src/sndfile.c - Make custom chunks work on AIFF files. - - * src/wav.c - Make custom chunks work on WAV files (includes refactoring). - -2011-11-12 Erik de Castro Lopo - - * src/sndfile.h.in src/common.h src/sndfile.c - Start working on setting/getting chunks. - -2011-11-24 Erik de Castro Lopo - - * src/binheader_writef_check.py src/create_symbols_file.py - Make it work for Python 2 and 3. Thanks Michael. - -2011-11-19 Erik de Castro Lopo - - * libsndfile.spec.in - Change field name 'URL' to 'Url'. - - * src/sndfile.h.in - Add SF_SEEK_SET/CUR/END. - -2011-11-05 Erik de Castro Lopo - - * src/id3.c - Fix a stack overflow that can occur when parsing a file with multiple - ID3 headers which would cause libsndfile to go into an infinite recursion - until it blew the stack. Thanks to Anders Svensson for supplying an example - file. - -2011-10-30 Erik de Castro Lopo - - * src/double64.c src/float32.c src/common.h - Make (float32|double_64)_(be|le)_read() functions const correct. - -2011-10-28 Erik de Castro Lopo - - * src/sfendian.h - Minor tweaking of types. Cast to ptr to correct final type rather void*. - - * programs/sndfile-play.c tests/utils.tpl - Fix compiler warnings with latest MinGW cross compiler. - -2011-10-13 Erik de Castro Lopo - - * src/file_io.c - Use the non-deprecated resource fork name on OSX. Thanks to Olivier Tristan. - -2011-10-12 Erik de Castro Lopo - - * src/wav.c - Jump over the 'olym' chunks when parsing. - -2011-10-06 Erik de Castro Lopo - - * tests/write_read_test.tpl - Remove windows only truncate() implementation. - -2011-09-04 Erik de Castro Lopo - - * src/sd2.c src/sndfile.c - Make sure 23 bit PCM SD2 files are readable/writeable. - - * tests/write_read_test.tpl - Add tests for 32 bit PCM SD2 files. - -2011-08-23 Erik de Castro Lopo - - * configure.ac - Use AC_SYS_LARGEFILE instead of AC_SYS_EXTRA_LARGEFILE as suggested by - Jan Willies. - -2011-08-07 Erik de Castro Lopo - - * configure.ac Makefile.am - Move ACLOCAL_AMFLAGS setup to Makefile.am. - -2011-07-15 Erik de Castro Lopo - - * doc/command.html - Merge two separate blocks of SFC_SET_VBR_ENCODING_QUALITY documentation. - - * src/paf.c - Replace ppaf24->samplesperblock with a compile time constant. - -2011-07-13 Erik de Castro Lopo - - * src/ogg_vorbis.c - Fix return value of SFC_SET_VBR_ENCODING_QUALITY command. - - * doc/command.html - Document SFC_SET_VBR_ENCODING_QUALITY, SFC_GET/SET_LOOP_INFO and - SFC_GET_INSTRUMENT. - - * NEWS README configure.ac doc/*.html - Updates for 1.0.25. - -2011-07-07 Erik de Castro Lopo - - * src/sfconfig.h - Add handling for HAVE_SYS_WAIT_H. - - * Makefile.am src/Makefile.am tests/Makefile.am - Add 'checkprograms' target. - -2011-07-05 Erik de Castro Lopo - - * src/common.h src/sndfile.c - Purge SF_ASSERT macro. Use standard C assert instead. - - * src/paf.c src/common.h src/sndfile.c - Fix for Secunia Advisory SA45125, heap overflow (heap gets overwritten with - byte value of 0) due to integer overflow if PAF file handler. - - * src/ima_adpcm.c src/ms_adpcm.c src/paf.c - Use calloc instead of malloc followed by memset. - - * tests/utils.tpl - Clean up use of memset. - -2011-07-05 Erik de Castro Lopo - - * src/ogg.c - Fix log message. - - * tests/format_check_test.c - Fix compiler warnings. - -2011-07-04 Erik de Castro Lopo - - * src/sndfile.c - Fix error message for erro code SFE_ZERO_MINOR_FORMAT. - - * tests/format_check_test.c - Add a test to for SF_FINFO format field validation. - - * src/ogg.c src/ogg_vorbis.c src/ogg.h src/ogg_pcm.c src/ogg_speex.c - src/common.h src/Makefile.am - Move vorbis specific code to ogg_vorbis.c, add new files for handling PCM - and Speex codecs in an Ogg container. The later two are only enabled with - ENABLE_EXPERIMENTAL_CODE config variable. - -2011-06-28 Erik de Castro Lopo - - * src/strings.c - Clean up and refactor storage of SF_STR_SOFTWARE. - -2011-06-23 Erik de Castro Lopo - - * src/sndfile.h.in doc/api.html - Fix definition of SF_STR_LAST and update SF_STR_* related docs. Thanks to - Tim van der Molen for the patch. - -2011-06-21 Erik de Castro Lopo - - * programs/sndfile-interleave.c - Fix handling of argc. Thanks to Marius Hennecke. - - * src/wav_w64.c - Accept broken WAV files with blockalign == 0. Thanks to Olivier Tristan for - providing example files. - - * src/wav.c - Jump over 'FLLR' chunks. - -2011-06-14 Erik de Castro Lopo - - * src/sndfile.h.in - Fix -Wundef warning due to ENABLE_SNDFILE_WINDOWS_PROTOTYPES. - - * configure.ac - Add -Wundef to CFLAGS. - - * src/ogg.c - Fix -Wunder warning. - -2011-05-18 Erik de Castro Lopo - - * configure.ac - Use int64_t instead of off_t when they are the same size. - - * src/Makefile.am tests/Makefile.am - Use check_PROGRAMS instead of noinst_PROGRAMS where appropriate. - -2011-05-08 Erik de Castro Lopo - - * src/wav.c - Don't allow unknown and/or un-editable chunks to prevent the file from being - opened in SFM_RDWR mode. - -2011-04-25 Erik de Castro Lopo - - * tests/format_check_test.c - Fix segfault in test program. - -2011-04-25 Erik de Castro Lopo - - * tests/format_check_test.c - New test program to check to make sure that sf_open() and sf_check_format() - agree as to what is a valid program. - - * tests/Makefile.am tests/test_wrapper.sh.in - Hook into build and test runner. - - * src/sndfile.c - Fix some sf_format_check() problems. Thanks to Charles Van Winkle for the - notification. - -2011-04-06 Erik de Castro Lopo - - * src/caf.c - Add validation to size of 'data' chunk and fix size of written 'data' - chunk. Thanks to Michael Pruett for reporting this. - -2011-03-28 Erik de Castro Lopo - - * src/* tests/* programs/* - Fix a bunch of compiler warnings with gcc-4.6. - -2011-03-25 Erik de Castro Lopo - - * tests/util.tpl - Add NOT macro to util.h. - - * src/strings.c - Fix handling of SF_STR_SOFTWARE that resulted in a segfault due to calling - strlen() on an unterminated string. Thanks to Francois Thibaud for reporting - this problem. - - * tests/string_test.c - Add test for SF_STR_SOFTWARE segfault bug. - - * configure.ac - Sanitize FLAC_CFLAGS value supplied by pkg-config which returns a value of - '-I${includedir}/FLAC'. However FLAC also provides an include file - which clashes with the Standard C header of the same name. The - solution is strip the 'FLAC' part off the end and include all FLAC headers - as . - - * configure.ac src/Makefile.am - Use non-recursive make in src/ directory. - -2011-03-23 Erik de Castro Lopo - - * NEWS README docs/*.html - Updates for 1.0.24 release. - -2011-03-22 Erik de Castro Lopo - - * configure.ac - Fix up usage of sed (should not assume GNU sed). - - * M4/add_(c|cxx)flags.m4 - Test flags in isolation. - - * tests/cpp_test.cc - Fix a broken test (test segfaults). Report by Dave Flogeras. - -2011-03-21 Erik de Castro Lopo - - * programs/common.[ch] - Add function program_name() which returns the program name minus the path - from argv [0]. - - * programs/*.c programs/Makefile.am - Use program_name() where appropriate. Fix build. - -2011-03-20 Erik de Castro Lopo - - * src/wav.c - For u-law and A-law files, write an 18 byte 'fmt ' chunk instead of a 16 - byte one. Win98 accepts files with a 16 but not 18 byte 'fmt' chunk. Later - version accept 18 byte but not 16 byte. - -2011-03-15 Erik de Castro Lopo - - * doc/FAQ.html - Add examples for question 12. - - * doc/libsndfile.css.in - Add tweaks for h4 element. - - * doc/api.html - Add documentation for virtual I/O functionality. Thanks to Uli Franke. - - * tests/util.tpl - Add static inline functions sf_info_clear() and sf_info_setup(). - - * tests/(alaw|dwvw|ulaw)_test.c - Use functions sf_info_clear() and sf_info_setup(). - -2011-03-08 Erik de Castro Lopo - - * configure.ac - Fail more gracefully if pkg-config is missing. Suggestion from Brian - Willoughby. - -2011-02-27 Erik de Castro Lopo - - * src/common.c - Use size_t instead of int for size params with varargs. - -2011-02-09 Erik de Castro Lopo - - * doc/index.html - Update supported platforms with more Debian platforms and Android. - -2011-01-27 Erik de Castro Lopo - - * src/sndfile.hh - Add an LPCWSTR version of the SndfileHandle constructor to the SndfileHandle - class definition. Thanks to Eric Eizenman for pointing out this was missing. - - * tests/cpp_test.cc - Add test for LPCWSTR version of the SndfileHandle constructor. - -2011-01-19 Erik de Castro Lopo - - * programs/sndfile-play.c - Remove cruft. - -2010-12-01 Erik de Castro Lopo - - * src/sndfile.hh - Add methods rawHandle() and takeOwnership(). Thanks to Tim Blechmann for - the patch. - - * tests/cpp_test.cc - Add tests for above two methods. Also supplied by Tim Blechmann. - -2010-11-11 Erik de Castro Lopo - - * doc/api.html - Add mention of use of sf_strerror() when sf_open() fails. - -2010-11-01 Erik de Castro Lopo - - * configure.ac - Make TYPEOF_SF_COUNT_T int64_t where possible. This may fix problems where - people are compiling on a 64 bit system with the GCC -m32 flag. - - * src/sndfile.h.in - Fix comments on sf_count_t. - -2010-10-26 Erik de Castro Lopo - - * src/aiff.c - Handle non-zero offset field in SSND chunk. Thanks to Michael Chinen. - -2010-10-20 Erik de Castro Lopo - - * configure.ac - Sed fix for FreeBSD. Thanks Tony Theodore. - -2010-10-14 Erik de Castro Lopo - - * shave.in M4/shave.m4 - Fix shave invocation of windres compiler. Thanks Damien Lespiau (upstream - shave author). - - * configure.ac M4/shave.m4 shave-libtool.in shave.in - Switch from shave to automake-1.11's AM_SILENT_RULES. - -2010-10-13 Erik de Castro Lopo - - * shave-libtool.in shave.in - Sync to upstream version. - - * src/rf64.c - More work to make the parser more robust and accepting of mal-formed files. - -2010-10-12 Erik de Castro Lopo - - * src/common.h - Add functions psf_strlcpy() and psf_strlcat(). - - * src/broadcast.c src/sndfile.c src/strings.c src/test_main.c - src/test_main.h src/test_strncpy_crlf.c - Use functions psf_strlcpy() and psf_strlcat() as appropriate. - - * tests/string_test.c - Add tests for SF_STR_GENRE and SF_STR_TRACKNUMBER. - - * src/rf64.c - Fix size of 'ds64' chunk when writing RF64. - -2010-10-10 Erik de Castro Lopo - - * programs/*.c - Add the libsndfile version to the usage message of all programs. - -2010-10-10 Erik de Castro Lopo - - * configure.ac src/version-metadata.rc.in src/Makefile.am - Add version string resources to the windows DLL. - - * doc/api.html - Update to add missing SF_FORMAT_* values. Closed Debian bug #545257. - - * NEWS README configure.ac doc/*.html - Updates for 1.0.23 release. - -2010-10-09 Erik de Castro Lopo - - * tests/pedantic-header-test.sh.in - Handle unusual values of CC environment variable. - - * src/rf64.c - Minor tweaks and additional sanity checking. - - * src/Makefile.am src/binheader_writef_check.py - Use python 2.6. - -2010-10-08 Erik de Castro Lopo - - * src/sndfile.hh - Add a missing 'inline' before a constructor defintion. - -2010-10-06 Erik de Castro Lopo - - * src/common.h - Add macro NOT. - - * src/rf64.c - Minor tweaks. - - * Makefile.am */Makefile.am - Add *~ to CLEANFILES. - -2010-10-05 Erik de Castro Lopo - - * src/sndfile.c - Fix a typo in the error string for SFE_OPEN_PIPE_RDWR. Thanks to Charles - Van Winkle for the report. - -2010-10-04 Erik de Castro Lopo - - * src/flac.c src/ogg.c src/sndfile.h.in src/strings.c src/wav.c - Add ability to read/write tracknumber and genre to flac/ogg/wav files. - Thanks to Matti Nykyri for the patch. - - * src/common.h src/broadcast.c src/strings.c - Add function psf_safe_strncpy() and use where appropriate. - -2010-10-04 Erik de Castro Lopo - - * NEWS README configure.ac doc/*.html - Updates for 1.0.22 release. - -2010-10-03 Erik de Castro Lopo - - * src/common.h src/broadcast.c src/rf64.c src/sndfile.c src/wav.c - Rewrite of SF_BROADCAST_INFO handling. - - * src/test_broadcast_var.c tests/command_test.c - Tweak SF_BROADCAST_INFO tests. - - * src/test_broadcast_var.c - Fix OSX stack check error. - -2010-09-30 Erik de Castro Lopo - - * src/sds.c - Set sustain_loop_end to 0 as suggested by Brian Lewis. - -2010-09-29 Erik de Castro Lopo - - * src/sds.c - Make sure the correct frame count gets written into the header. - - * tests/write_read_test.tpl - Don't allow SDS files to have a long frame count. - -2010-09-17 Erik de Castro Lopo - - * src/sds.c - Apply a pair of patches from Brian Lewis to fix the packet number location - and the checksum. - -2010-09-10 Erik de Castro Lopo - - * src/aiff.c src/file_io.c src/ogg.c src/rf64.c src/sndfile.c - src/strings.c src/test_audio_detect.c src/test_strncpy_crlf.c - src/wav.c tests/pcm_test.tpl - Fix a bunch of minor issues found using static analysis. - -2010-08-23 Erik de Castro Lopo - - * src/test_broadcast_var.c - New file containing tests for broadcast_set_var(). - - * src/Makefile.am src/test_main.[ch] - Hook test_broadcast_var.c into tests. - -2010-08-22 Erik de Castro Lopo - - * src/broadcast.c src/common.(c|h) - Move function strncpy_crlf() to src/common.c so the function can be tested - in isolation. - - * src/test_strncpy_crlf.c - New file. - - * src/Makefile.am src/test_main.[ch] - Hook test_strncpy_crlf.c into tests. - -2010-08-18 Erik de Castro Lopo - - * src/common.h - Move code around to make comments make sense. - - * src/broadcast.c - Add debugging code that is disabled by default. - -2010-08-02 Erik de Castro Lopo - - * src/flac.c - When the file meta data says the file has zero frames set psf->sf.frames - to SF_COUNT_MAX. Fixes Debian bug #590752. - - * programs/sndfile-info.c - Print 'unknown' if frame count == SF_COUNT_MAX. - -2010-06-27 Erik de Castro Lopo - - * src/sndfile.c - Only support writing mono SVX files. Multichannel SVX files are not - interleaved and there is no support infrastructure to cache and write - multiple channels to create a non-interleaved file. - - * src/file_io.c - Don't call close() on a file descriptor of -1. Thanks to Jeremy Friesner - for the bug report. - -2010-06-09 Erik de Castro Lopo - - * src/common.h - Add macro SF_ASSERT. - - * src/sndfile.c - Use SF_ASSERT to ensure sizeof (sf_count_t) == 8. - - * src/svx.c - Add support for reading and writing stereo SVX files. - -2010-05-07 Erik de Castro Lopo - - * configure.ac - When compiling with x86_64-w64-mingw32-gcc link with -static-libgcc flags. - - * programs/common.c programs/sndfile-metadata-set.c - Update metadata after the audio data is copied. Other minor fixes. Patch - from Marius Hennecke. - -2010-05-04 Erik de Castro Lopo - - * src/nist.c - Fix a regression reported by Hugh Secker-Walker. - - * src/api.html - Add comment about sf_open_fd() not working on Windows if the application - and the libsndfile DLL are linked to different versions of the Microsoft - C runtime DLL. - -2010-04-23 Erik de Castro Lopo - - * tests/pedantic-header-test.sh.in - Fix 'make distcheck'. - -2010-04-21 Erik de Castro Lopo - - * tests/pedantic-header-test.sh.in - New file to test whether sndfile.h can be compiled with gcc's -pedantic - flag. - - * configure.ac tests/test_wrapper.sh.in - Hook pedantic-header-test into test suite. - - * src/sndfile.h.in - Fix -pedantic warning. - -2010-04-19 Erik de Castro Lopo - - * programs/sndfile-salvage.c programs/Makefile.am - New program to salvage the audio data from WAV/WAVEX/AIFF files which are - greater than 4Gig in size. - -2010-04-09 Erik de Castro Lopo - - * programs/sndfile-convert.c - Fix valgrind warning. - -2010-04-06 Erik de Castro Lopo - - * programs/sndfile-cmp.c - When files differ in the PCM data, also print the difference offset. - Minor cleanup. - -2010-03-19 Erik de Castro Lopo - - * src/aiff.c - Don't use the 'twos' marker for 24 and 32 bit PCM, use 'in24' and 'in32' - instead. Thanks to Paul Davis (Ardour) for this suggestion. - -2010-02-28 Erik de Castro Lopo - - * configure.ac - Clean up configure report. - - * tests/utils.tpl - Add functions test_read_raw_or_die and test_write_raw_or_die. - - * tests/rdwr_test.(def|tpl) tests/Makefile.am - Add new test program and hook into build. - - * src/sndfile.c - Fix minor issues with sf_read/write_raw(). Bug reported by Milan Křápek. - - * tests/test_wrapper.sh.in - Add rdwr_test to the test wrapper script. - -2010-02-22 Erik de Castro Lopo - - * configure.ac - Remove -fpascal-strings from OSX's OS_SPECIFIC_CFLAGS. - - * programs/common.[ch] programs/sndfile-metadata-set.c - Apply a patch from Robin Gareus allowing the setting of the time reference - field of the BEXT chunk. - -2010-02-06 Erik de Castro Lopo - - * src/ima_adpcm.c - Add a fix from Jonatan Liljedahl to handle predictor overflow when decoding - IMA4. - -2010-01-26 Erik de Castro Lopo - - * src/sndfile.hh - Add a constructor which takes an existing file descriptor and then calls - sf_open_fd(). Patch from Sakari Bergen. - -2010-01-10 Erik de Castro Lopo - - * programs/sndfile-deinterleave.c programs/sndfile-interleave.c - Improve usage messages. - -2010-01-09 Erik de Castro Lopo - - * src/id3.c src/Makefile.am - Add new file src/id3.c and hook into build. - - * src/sndfile.c src/common.h - Detect and skip and ID3 header at the start of the file. - -2010-01-07 Erik de Castro Lopo - - * programs/common.c - Fix update_strings() copyright, comment, album and license are correctly - written. Thanks to Todd Allen for reporting this. - - * man/Makefile.am - Change GNU makeism to something more widely supported. Thanks to Christian - Weisgerber for reporting this. - - * configure.ac programs/Makefile.am programs/sndfile-play.c - Apply patch from Christian Weisgerber and Jacob Meuserto add support for - OpenBSD's sndio. - -2010-01-05 Erik de Castro Lopo - - * doc/api.html - Discourage the use of sf_read/write_raw(). - -2009-12-28 Erik de Castro Lopo - - * configure.ac - Test for Unix pipe() and waitpid() functions. - - * src/sfconfig.h tests/pipe_test.tpl - Disable pipe_test if pipe() and waitpid() aren't available. - -2009-12-16 Erik de Castro Lopo - - * configure.ac src/Makefile.am src/create_symbols_file.py - src/make-static-lib-hidden-privates.sh - Change name of generated file src/Symbols.linux to Symbols.gnu-binutils and - and use the same symbols file for other systems which use GNU binutils like - Debian's kfreebsd. - - * M4/shave.m4 shave.in - Update shave files from upstream. - -2009-12-15 Erik de Castro Lopo - - * man/sndfile-metadata-get.1 - Fix typo. - - * man/sndfile-interleave.1 man/Makefile.am - New man page. - -2009-12-13 Erik de Castro Lopo - - * src/ogg.c - When decoding to short or int, clip the decoded signal to [-1.0, 1.0] if - its too hot. Thanks to Dmitry Baikov for suggesting this. - - * NEWS README doc/*.html - Updates for 1.0.21. - -2009-12-09 Erik de Castro Lopo - - * programs/sndfile-jackplay.c man/sndfile-jackplay.1 - Remove these which will now be in found in the sndfile-tools package. - - * programs/Makefile.am man/Makefile.am - Remove build rules for sndfile-jackplay. - - * configure.ac - Remove detection of JACK Audio Connect Kit. - - * programs/sndfile-concat.c man/sndfile-concat.1 - Add new program with man page. - - * man/Makefile.am programs/Makefile.am - Hook sndfile-concat into build system. - -2009-12-08 Erik de Castro Lopo - - * tests/error_test.c - Don't terminate when sf_close() returns zero in error_close_test(). - It seems that Windows 7 behaves differently from earlier versions of - Windows. - -2009-12-03 Erik de Castro Lopo - - * configure.ac M4/*.m4 - Rename all custom macros from AC_* to MN_*. - - * programs/sndfile-interleave.c - Make it actually work. - -2009-12-02 Erik de Castro Lopo - - * doc/*.html configure.ac - Corrections and clarifications courtesy of Robin Forder. - - * programs/sndfile-convert.c programs/common.[ch] - Move some code from convert to common for reuse. - - * programs/sndfile-interleave.c programs/sndfile-interleave.c - Add new programs sndfile-interleave and sndfile-deinterleave. - - * programs/Makefile.am - Hook new programs into build. - -2009-12-01 Erik de Castro Lopo - - * src/create_symbols_file.py tests/stdio_test.c tests/win32_test.c - Minor OS/2 tweaks as suggested by David Yeo. - - * tests/multi_file_test.c - Fix file creation flags on windows. Thanks to Bruce Sharpe. - - * src/sf_unistd.h - Set all group and other file create permssions to zero. - - * tests/win32_test.c - Add a new test. - -2009-11-30 Erik de Castro Lopo - - * doc/print.css doc/*.html - Add a print stylesheet and update all HTML documents to reference it. - Thanks to Aditya Bhargava for suggesting this. - - * doc/index.html - Minor corrections. - -2009-11-29 Erik de Castro Lopo - - * sndfile.pc.in - Add a Libs.private entry to assist with static linking. - -2009-11-28 Erik de Castro Lopo - - * src/make-static-lib-hidden-privates.sh src/Makefile.am - Add a script to hide all non-public symbols in the libsndfile.a static - library. - -2009-11-22 Erik de Castro Lopo - - * tests/locale_test.c - Correct usage of ENABLE_SNDFILE_WINDOWS_PROTOTYPES. - -2009-11-20 Erik de Castro Lopo - - * src/windows.c - Correct usage of ENABLE_SNDFILE_WINDOWS_PROTOTYPES. - -2009-11-16 Erik de Castro Lopo - - * programs/sndfile-convert.c - Allow the program to read from stdin by specifying '-' on the command line - as the input file. - - * src/sndfile.h.in - Hash define ENABLE_SNDFILE_WINDOWS_PROTOTYPES to 1 for greater safety. - - * tests/virtual_io_test.c - Add a PAF/PCM_24 test and verify the file length is not negative - immediately after openning the file for write. - -2009-10-18 Erik de Castro Lopo - - * src/wav.c - When writing loop lengths, adjust the end position by one to make up for - Microsoft's screwed up spec. Thanks to Olivier Tristan for the patch. - -2009-10-14 Erik de Castro Lopo - - * src/flac.c - Apply patch from Uli Franke allowing FLAC files to be encoded at any sample - rate. - -2009-10-09 Erik de Castro Lopo - - * src/nist.c - Fix parsing of odd ulaw encoded file provided by Jan Silovsky. - - * configure.ac - Insist on libvorbis >= 1.2.3. Earlier verions have bugs that cause the - libsndfile test suite to fail on MIPS, PowerPC and others. - See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549899 - -2009-10-06 Erik de Castro Lopo - - * man/sndfile-convert.1 - Fix warning from Debian's lintian checks. - - * man/sndfile-cmp.1 man/sndfile-jackplay.1 man/sndfile-metadata-get.1 - man/Makefile.am - Add three new minimal manpages and hook into build. - -2009-10-05 Erik de Castro Lopo - - * tests/test_wrapper.sh.in - Don't run cpp_test on x86_64-w64-mingw32. - -2009-09-28 Erik de Castro Lopo - - * tests/utils.tpl - On windows, make sure the open() function doesn't get called with a third - parameter of 0 which fails for no good reason. Also make sure this third - parameter doesn't get called with S_IRGRP when compiling for windows because - Wine complains. - - * src/sndfile.hh - Add a SndfileHandle constructor for windows that takes a 'const wchar_t *' - string. - - * doc/FAQ.html - Add Q/A : I'm cross compiling libsndfile for another platform. How can I - run the test suite? - - * src/create_symbols_file.py src/Makefile.am - Add Symbols.static target, a list of symbols, one per line. - -2009-09-27 Erik de Castro Lopo - - * tests/test_wrapper.sh.in - Update to allow all tests to be gathered up into a testsuite tarball and - then be run using this script. - - * build-test-tarball.mk.in - Add a Make script to build a tarball of all the test binaries and the test - wrapper script. This is useful for cross compiling; you can build the - binaries, build test test tarball and transfer the test tarball to the - target machine for testing. - -2009-09-26 Erik de Castro Lopo - - * src/common.h src/*.c - Modify SF_FILE struct to allow it to carry either 8-bit or 16-bit strings - for the file path, directory and name. Fixes for this change throughout. - - * src/windows.c src/Makefile.am - New file defining new windows only public function sf_wchar_open() which - takes a 'const wchar_t *' string (LPCWSTR) for the file name parameter. - - * src/sndfile.h.in - Add SF_CHANNEL_MAP_ABISONIC_* entries. - Add windows only defintion for sf_wchar_open(). - - * src/create_symbols_file.py - Add sf_wchar_open() to the list of public symbols (windows only). - - * tests/locale_test.c - Add a wchar_test() to test sf_wchar_open(). - -2009-09-25 Erik de Castro Lopo - - * src/common.h src/*.c - Split file stuff into PSF_FILE struct within the SF_PRIVATE struct. - -2009-09-23 Erik de Castro Lopo - - * src/aiff.c src/voc.c - When a byte is needed, use unsigned char. - - * src/ima_oki_adpcm.c src/broadcast.c src/test_ima_oki_adpcm.c - Include sfconfig.h to prevent compile errors with MinGW compilers. - - * configure.ac - Remove AM_CONFIG_HEADER due to warnings from autoconf 2.64. - - * tests/locale_test.c - Update to work with xx_XX.UTF-8 style locales. Refactoring. - -2009-09-22 Erik de Castro Lopo - - * configure.ac - Set __USE_MINGW_ANSI_STDIO to 1 when compiling using MinGW compilers. - Remove unneeded AC_SUBST. - Report Host CPU/OS/vendor. - -2009-09-19 Erik de Castro Lopo - - * src/sndfile.c - Fix error message string. - - * src/flac.c - Add 88200 to the list of supported sample rates. - - * src/ogg.c - Fix compiler warning when using gcc-4.5.0. - - * programs/sndfile-info.c tests/utils.tpl - Remove WIN32 snprintf #define. - - * src/ima_adpcm.c - Fix minor bug in aiff_ima_encode_block. Thanks to Denis Fileev for finding - this. - -2009-09-16 Erik de Castro Lopo - - * src/caf.c - Use the correct C99 format specifier for int64_t. - - * M4/endian.m4 - Fix detection of CPU endian-ness when cross compiling. Thanks to Pierre - Ossman for the bug report. - - * src/caf.c src/sndfile.c - Fix reading and writing of PEAK chunks in CAF files. - - * tests/peak_chunk_test.c tests/test_wrapper.sh.in - Run peak_chunk_test on CAF files. - -2009-09-15 Erik de Castro Lopo - - * src/aiff.c src/wav.c - Use the correct C99 format specifier for int64_t. - -2009-08-30 Erik de Castro Lopo - - * src/rf64.c src/sndfile.c src/wav.c src/wav_w64.h - Apply a patch (massaged slightly) from Uli Franke adding handling of the - BEXT chunk in RF64 files. - - * tests/command_test.c - Update channel_map_test() function so WAV test passes. - - * src/rf64.c - Add channel mapping and ambisonic support. - - * src/sndfile.h - Add comments showing correspondance between libsndfile channel map - defintiions and those used by Apple and MS. - - Add handling of reading/writing channel map info. - - * tests/command_test.c tests/test_wrapper.sh.in - Update channel map tests. - -2009-07-29 Erik de Castro Lopo - - * src/common.h - Add function psf_isprint() a replacement for the standard C isprint() - function which ignores any locale settings and treats all input as ASCII. - - * src/(aiff|common|rf64|sd2|strings|svx|wav).c - Use psf_isprint() instead of isprint(). - -2009-07-13 Erik de Castro Lopo - - * src/command.c - Add string descriptions for SF_FORMAT_RF64 and SF_FORMAT_MPC2K. - -2009-06-30 Erik de Castro Lopo - - * programs/sndfile-play.c - Allow use of Open Sound System audio output under FreeBSD. - -2009-06-24 Erik de Castro Lopo - - * configure.ac - Add patch from Conrad Parker to add --disable-jack. - -2009-05-28 Erik de Castro Lopo - - * src/alaw.c src/float32.c src/htk.c src/pcm.c src/sds.c src/ulaw.c - Fix bugs where invalid files can cause a divide by zero error (SIGFPE). - Thanks to Sami Liedes for reporting this a Debian bug #530831. - -2009-05-26 Erik de Castro Lopo - - * src/chanmap.[ch] - New files for channel map decoding/encoding. - -2009-05-25 Erik de Castro Lopo - - * configure.ac src/sndfile.h.in - Fix MSVC definition of sf_count_t. - -2009-05-24 Erik de Castro Lopo - - * src/wav_w64.[ch] - Add wavex_channelmask to WAV_PRIVATE struct and add a function to convert - an array of SF_CHANNEL_MASK_* values into a bit mask for use in WAV files. - - * src/wav.c - Add ability to write the channel mask. - -2009-05-23 Erik de Castro Lopo - - * programs/sndfile-info.c - Add -c command line option to dump the channel map information. - - * src/wav_w64.c - Don't bail from parser if channel map bitmask is faulty. - - * src/common.h src/sndfile.c - Remove error code SFE_W64_BAD_CHANNEL_MAP which is not needed any more. - - * src/sndfile.c - On SFC_SET_CHANNEL_MAP_INFO pass the channel map command down to container's - command handler. - -2009-05-22 Erik de Castro Lopo - - * src/sndfile.h.in src/common.h src/sndfile.c src/wav_w64.c - Apply a patch from Lennart Poettering (PulseAudio) to allow reading of - channel data in WAV and W64 files. - Add a test for the above. - -2009-05-20 Erik de Castro Lopo - - * src/FAQ.html - Update the section about pre-compiled binaries for Win64. - -2009-05-14 Erik de Castro Lopo - - * src/common.h src/test_conversions.c - Be more careful when including so compiling on pre-C99 platforms - (hello Slowlaris) might actually work. - - * NEWS README doc/*.html - Updates for 1.0.20. - -2009-04-21 Erik de Castro Lopo - - * src/voc.c - Fix a bug whereby opening a specially crafted VOC file could result in a - heap overflow. Thanks to Tobias Klein (http://www.trapkit.de) for reporting - this issue. - - * src/aiff.c - Fix potential (heap) buffer overflow when parsing 'MARK' chunk. - -2009-04-12 Erik de Castro Lopo - - * tests/stdin_test.c - Check psf->error after opening file. - - * src/file_io.c - Fix obscure seeking bug reported by Hugh Secker-Walker. - - * tests/utils.tpl - Add check of sf_error to test_open_file_or_die(). - - * src/sndfile.c - Clear error if opening resource fork fails. - -2009-04-11 Erik de Castro Lopo - - * tests/alaw_test.c tests/locale_test.c tests/ulaw_test.c - Cleanup output. - -2009-03-25 Erik de Castro Lopo - - * src/float32.c - Fix f2s_clip_array. - -2009-03-24 Erik de Castro Lopo - - * src/float32.c - In host_read_f2s call convert instead of f2s_array. - - * src/ima_adpcm.c - Remove dead code. - - * src/test_ima_oki_adpcm.c examples/generate.c tests/dither_test.c - tests/dwvw_test.c tests/fix_this.c tests/generate.c - tests/multi_file_test.c - Minor fixes. - -2009-03-23 Erik de Castro Lopo - - * M4/shave.m4 shave.in - Pulled update from upstream. - -2009-03-19 Erik de Castro Lopo - - * doc/api.html - Add pointers to example programs in source code tarball. - -2009-03-17 Erik de Castro Lopo - - * src/common.h - Define SF_PLATFORM_S64 for non-gcc compilers with 'long long' type. - - * configure.ac - Add documentation for --disable-external-libs and improve error handling - for that option. - - * src/sndfile.c src/sndfile.h.in src/create_symbols_file.py - Add public function sf_version_string. - - * tests/sfversion.c - Test function sf_version_string. - - * M4/shave.m4 shave-libtool.in shave.in - Add new files from 'git clone git://git.lespiau.name/shave'. - - * configure.ac - Enable shave. - - * src/Makefile.am src/binheader_writef_check.py Octave/* - Shave related tweaks. - -2009-03-15 Erik de Castro Lopo - - * src/common.h src/caf.c src/sndfile.c - Add SF_MAX_CHANNELS (set to 256) and use it. - - * src/sndfile.h.in - Check for either _MSCVER or _MSC_VER being defined. - -2009-03-04 Erik de Castro Lopo - - * tests/vorbis_test.c - Relax test slighly to allow test to pass on more CPUs etc. - -2009-03-03 Erik de Castro Lopo - - * configure.ac - Detect vorbis_version_string() correctly. - -2009-03-02 Erik de Castro Lopo - - * doc/index.html - Add a 'See Also' section with a link to sndfile-tools. - - * NEWS README doc/*.html - Updates for 1.0.19 release. - - * configure.ac - Fix --enable-external-libs logic. - -2009-03-01 Erik de Castro Lopo - - * src/aiff.c - Fix resource leak and potential read beyond end of buffer. - - * src/nist.c - Fix reading of header value sample_n_bytes. - - * src/sd2.c src/wav.c - Fix potential read beyond end of buffer. - - * src/sndfile.c src/svx.c - Check return values of file_io functions. - - * tests/win32_test.c - Fix resource leak. - - * configure.ac - Detect the presence/absence of vorbis_version_string() in libvorbis. - - * src/ogg.c - Only call vorbis_version_string() from libvorbis if present. - -2009-02-24 Erik de Castro Lopo - - * tests/win32_test.c - Don't use sprintf, even on windows. - - * src/aiff.c src/rf64.c src/wav.c - Eliminate dead code, more validation of data read from file. - -2009-02-22 Erik de Castro Lopo - - * src/ima_adpcm.c - Clamp values to a valid range before indexing ima_step_size array. - - * src/GSM610/*.c tests/*c programs/*.c src/audio_detect.c - Don't include un-needed headers. - - * programs/sndfile-info.c - Remove dead code. - - * tests/test_wrapper.sh.in - Add 'set -e' so the script exits on error. - - * src/test_ima_oki_adpcm.c - Fix read beyond end of array. - - * tests/win32_test.c - Add missing close on file descriptor. - - * src/nist.c programs/sndfile-metadata-set.c - Fix 'unused variable' warnings. - - * src/aiff.c - Fix potential memory leak in handling of 'MARK' chunk. - Remove un-needed test (unsigned > 0). - - * src/sd2.c - Improve handling of heap allocated buffer. - - * src/sndfile.c - Remove un-needed test (always true). - - * src/wav.c src/rf64.c - Ifdef out dead code that will be resurected some time in the future. - - * src/wav.c src/w64.c src/xi.c - Handle error return values from psf_ftell. - - * src/wav_w64.c - Fix handling and error checking of MSADPCM coefficient arrays. - - * regtest/*.c - Bunch of fixes. - - * src/test_file_io.c - Use snprintf instead of strncpy in test program. - -2009-02-21 Erik de Castro Lopo - - * src/sd2.c - Validate data before using. - - * src/caf.c - Validate channels per frame value before using, fixing a possible integer - overflow bug, leading to a possible heap overflow. Found by Alin Rad Pop of - Secunia Research (CVE-2009-0186). - -2009-02-20 Erik de Castro Lopo - - * Octave/octave_test.sh - Unset TERM environment variable and export LD_LIBRARY_PATH. - -2009-02-16 Erik de Castro Lopo - - * src/file_io.c - In windows code, cast LPVOID to 'char*' in printf. - -2009-02-15 Erik de Castro Lopo - - * M4/octave.m4 - Clear the TERM environment before evaluating anything in Octave. This works - around problems that might occur if a users TERM settings are incorrect. - Thanks to Rob Til Freedmen for helping to debug this. - - * src/wav.c - Handle four zero bytes as a marker within a LIST or INFO chunk. - Thanks to Rogério Brito for supplying an example file. - -2009-02-14 Erik de Castro Lopo - - * src/common.h src/*.c - Use C99 snprintf everywhere. - -2009-02-11 Erik de Castro Lopo - - * tests/test_wrapper.sh.in - New file to act as the template for the test wrapper script. - - * configure.ac - Generate tests/test_wrapper.sh from the template. - - * tests/Makefile.am - Replace all tests with a single invocation of the test wrapper script. - -2009-02-09 Erik de Castro Lopo - - * src/ogg.c - Record vorbis library version string. - - * configure.ac - Require libvorbis >= 1.2.2. - - * M4/endian.m4 - Fix bracketing of function for autoconf 2.63. Thanks to Richard Ash. - - * M4/octave.m4 M4/mkoctfile_version.m4 - Clean up AC_WITH_ARG usage using AC_HELP_STRING. - -2009-02-08 Erik de Castro Lopo - - * Octave/Makefile.am - Use $(top_buildir) instead of $(builddir) which may not be defined. - - * M4/octave.m4 - Improve logic and status reporting. - -2009-02-07 Erik de Castro Lopo - - * configure.ac AUTHORS NEWS README doc/*.html - Final tweaks for 1.0.18 release. - -2009-02-03 Erik de Castro Lopo - - * programs/sndfile-convert.c - Add 'htk' to the list of convert formats. - - * programs/sndfile-info.c - Simplify get_signal_max using SFC_CALC_SIGNAL_MAX command. - Increase size of files for which signal max will be calculated. - -2009-01-14 Erik de Castro Lopo - - * doc/index.html - Fix links for SoX and WavPlay. Thanks to Daniel Griscom. - -2009-01-11 Erik de Castro Lopo - - * programs/sndfile-metadata-get.c - Make valgrind clean. - Clean up temp string array usage. - Error out if trying to update coding history in RDWR mode. - -2009-01-10 Erik de Castro Lopo - - * doc/index.html - Fix links to versions of the LGPL. - -2008-12-14 Erik de Castro Lopo - - * tests/string_test.c - Add test for RDWR mode where the file ends up shorter than when it was - opened. - - * src/wav.c - Truncate the file on close for RDWR mode where the file ends up shorter - than when it was opened. - -2008-11-30 Erik de Castro Lopo - - * M4/add_cflags.m4 - Fix problem with quoting of '#include'. - - * M4/add_cxxflags.m4 configure.ac - Add new file M4/add_cxxflags.m4 and use it in configure.ac. - -2008-11-19 Erik de Castro Lopo - - * programs/sndfile-info.c - Apply patch from Conrad Parker to calculate and display total duration when - more than one file is dumped. - -2008-11-10 Erik de Castro Lopo - - * configure.ac src/Makefile.am - Tweaks to generation of Symbols files. - - * tests/win32_ordinal_test.c - Update tests for above changes. - -2008-11-06 Erik de Castro Lopo - - * programs/common.c - When merging broadcast info, make sure to clear the destination field - before copying in the new data. - - * programs/test-sndfile-metadata-set.py - Add test for the above. - - * src/broadcast.c - Fix checking of required coding_history_size. - -2008-10-28 Erik de Castro Lopo - - * tests/command_test.c - Add test to detect if coding history is truncated. - - * src/broadcast.c - Fix truncation of coding history. - -2008-10-27 Erik de Castro Lopo - - * tests/command_test.c - Add broadcast_coding_history_size test. - - * programs/*.[ch] - Use SF_BROADCAST_INFO_VAR to manipulate larger 'bext' chunks. - - * src/rf64.c - Add code to prevent infinite loop on malformed file. - - * src/common.h src/sndfile.c src/w64.c src/wav_w64.c - Rationalize and improve error handling when parsing 'fmt ' chunk. - - * M4/octave.m4 - Simplify and remove cruft. - Check for correct Octave version. - - * Octave/* - Reduce 3 C++ files to one, fix build for octave 3.0, fix build. - - * Octave/sndfile.cc Octave/PKG_ADD - Add Octave function sfversion which returns the libsndfile version that the - module is linked against. - - * Octave/Makefile.am - Bunch of build and 'make distcheck' fixes. - -2008-10-26 Erik de Castro Lopo - - * programs/common.c - Return 1 if SFC_SET_BROADCAST_INFO fails. - - * programs/test-sndfile-metadata-set.py - Update for new programs directory, exit on any error. - - * tests/error_test.c - Fix failure behaviour in error_number_test. - - * src/common.h src/sndfile.c - Add error number SFE_BAD_BROADCAST_INFO_SIZE. - - * src/* - Reimplement handling of broadcast extentioon chunk in WAV/WAVEX files. - - * src/broadcast.c - Fix generation of added coding history. - -2008-10-25 Erik de Castro Lopo - - * programs/sndfile-metadata-get.c programs/sndfile-info.c - Exit with non-zero on errors. - -2008-10-21 Erik de Castro Lopo - - * examples/sndfile-to-text.c examples/Makefile.am - Add a new example program and hook it into the build. - - * examples/ programs/ - Add a new directory programs and move sndfile-info, sndfile-play and other - real programs to the new directory, leaving example programs where they - were. - -2008-10-20 Erik de Castro Lopo - - * tests/Makefile.am - Automake 1.10 MinGW cross compiling fixes. - -2008-10-19 Erik de Castro Lopo - - * examples/sndfile-play.c - Remove call to deprecated function snd_pcm_sw_params_get_xfer_align. - Fix gcc-4.3 compiler warnings. - - * tests/command_test.c - Fix a valgrind warning. - - * tests/error_test.c tests/multi_file_test.c tests/peak_chunk_test.c - tests/pipe_test.tpl tests/stdio_test.c tests/win32_test.c - Fix gcc-4.3 compiler warnings. - -2008-10-17 Erik de Castro Lopo - - * src/broadcast.c - Fix termination of desitination string in strncpy_crlf. - When copying BROADCAST_INFO chunk, make sure destination gets correct line - endings. - - * examples/common.c - Fix copying of BROADCAST_INFO coding_history field. - -2008-10-13 Erik de Castro Lopo - - * tests/command_test.c - Add test function instrument_rw_test, but don't hook it into the testing - yet. - - * src/common.h src/command.c src/sndfile.c src/flac.c - Error code rationalization. - - * src/common.h src/sndfile.c - Set psf->error to SFE_CMD_HAS_DATA when adding metadata via sf_command() - fails due to psf->have_written being true. - - * doc/command.html - Document the SFC_GET/SET_BROADCAST_INFO comamnds. - -2008-10-10 Erik de Castro Lopo - - * tests/command_test.c - Improve error reporting when '\0' is found in coding history. - Fix false failure. - -2008-10-09 Erik de Castro Lopo - - * src/broadcast.c - Convert all coding history line endings to \r\n. - - * tests/command_test.c - Add test to make sure all line endings are converted to \r\n. - -2008-10-08 Erik de Castro Lopo - - * src/broadcast.c - Changed the order of coding history fields. - - * tests/command_test.c - Update bextch test to cope with previous change. - - * examples/common.c - Add extra length check when copying broadcast info data. - -2008-10-05 Erik de Castro Lopo - - * tests/utils.tpl tests/pcm_test.tpl - Update check_file_hash_or_die to use 64 bit hash. - - * tests/checksum_test.c tests/Makefile.am - Add new checksum_test specifically for lossy compression of headerless - files. - -2008-10-04 Erik de Castro Lopo - - * src/gsm610.c - Seek to psf->dataoffset before decoding first block. - - * src/sndfile.c - Fix detection of mpc2k files on big endian systems. - -2008-10-03 Erik de Castro Lopo - - * src/broadcast.c - Use '\r\n' newlines in Coding History as required by spec. - -2008-10-02 Erik de Castro Lopo - - * src/test_conversions.c - Use int64_t instead of 'long long'. - -2008-10-01 Erik de Castro Lopo - - * examples/sndfile-metadata-set.c - Remove --bext-coding-history-append command line option because it didn't - really make sense. - - * examples/sndfile-metadata-(get|set).c - Add usage messages. - - * examples/test-sndfile-metadata-set.py - Start work on test coding history. - -2008-09-30 Erik de Castro Lopo - - * README doc/win32.html - Bring these up to date. - - * src/aiff.c - Fix parsing of REX files. - -2008-09-29 Erik de Castro Lopo - - * src/file_io.c - Use intptr_t instead of long for return value of _get_osfhandle. - - * src/test_conversions.c src/test_endswap.tpl - Fix printing of int64_t values. - - * examples/sndfile-play.c - Fix win64 issues. - - * tests/win32_ordinal_test.c - Fix calling of GetProcAddress with ordinal under win64. - - * tests/utils.tpl - Fix win64 issues. - -2008-09-25 Erik de Castro Lopo - - * examples/* - Rename copy_data.[ch] to common.[ch]. Fix build. - Move code from sndfile-metadata-set.c to common.c. - - * examples/Makefile.am tests/Makefile.am regtest/Makefile.am - Clean paths. - -2008-09-19 Erik de Castro Lopo - - * doc/tutorial.html doc/Makefile.am - Add file doc/tutorial.html and hook into build/dist system. - -2008-09-14 Erik de Castro Lopo - - * examples/sndfile-metadata-set.c - Clean up handling of bext command line params. - -2008-09-13 Erik de Castro Lopo - - * src/w64.c - Add handling/skipping of a couple of new chunk types. - -2008-09-09 Erik de Castro Lopo - - * configure.ac - Add -funsigned-char to CFLAGS if the compiler supports it. - - * examples/sndfile-metadata-(get|set).c - Add handling for more metadata types. - -2008-09-04 Erik de Castro Lopo - - * src/common.h - Add macros SF_CONTAINER, SF_CODEC and SF_ENDIAN useful for splitting format - field of SF_INFO into component parts. - - * src/*.c - Use new macros everywhere it is appropriate. - -2008-09-02 Erik de Castro Lopo - - * examples/sndfile-bwf-set.c - Massive reworking. - -2008-08-24 Erik de Castro Lopo - - * examples/sndfile-bwf-set.c - Add --info-auto-create-date command line option. - - * examples/sndfile-metadata-set.c examples/sndfile-metadata-get.c - examples/Makefile.am examples/test-sndfile-bwf-set.py - Rename sndfile-bwf-(set|get).c to sndfile-metadata-(set|get).c. - Change command line args. - -2008-08-23 Erik de Castro Lopo - - * src/wav.c - Allow 'PAD ' chunk to be modified in RDWR mode. - - * src/sndfile.h.in src/sndfile.c - Add handling (incomplete) for SFC_SET_ADD_HEADER_PAD_CHUNK. - - * tests/Makefile.am tests/write_read_test.tpl tests/header_test.tpl - tests/misc_test.c - Add tests for RF64. - - * src/rf64.c - Fixes to make sure all tests pass. - - * tests/Makefile.am tests/string_test.c - Add string tests (not yet passing). - -2008-08-22 Erik de Castro Lopo - - * src/rf64.c - First pass at writing RF64 now working. - -2008-08-21 Erik de Castro Lopo - - * examples/sndfile-convert.c - Add SF_FORMAT_RF64 to format_map. - - * src/common.h src/sndfile.c - More RF64 support code. - - * examples/sndfile-bwf-set.c - Fix the month number in autogenerated date string and use hypen in date - instead of slash. - - * examples/test-sndfile-bwf-set.py - Update tests. - - * examples/sndfile-info.c - When called with -i or -b option, operate on all files on command line, not - just the first. - -2008-08-19 Erik de Castro Lopo - - * src/rf64.c - New file to handle RF64 (WAV like format supportting > 4Gig files). - - * src/sndfile.h.in src/common.h src/sndfile.c src/Makefile.am - Hook the above into build so hacking can begin. - - * src/pcm.c - Improve log message when pcm_init fails. - - * src/sndfile-info.c - Only calculate and print 'Signal Max' if file is less than 10 megabytes in - length. - -2008-08-18 Erik de Castro Lopo - - * tests/string_test.c - Polish string_multi_set_test. - - * src/wav.c - In RDWR mode, pad the header if necessary (ie LIST chunk has moved or - length has changed). - Minor fixes in wav_write_strings. - Write PAD chunk with default endian-ness, not a specific endian-ness. - - * examples/test-sndfile-bwf-set.py - Add Python script to test sndfile-bwf-set/get. - - * examples/sndfile-bwf-set.c - Clean up and fixes. - - * src/wav.c - Merge function wavex_write_header into wav_write_header, deleting about 70 - lines of code. - - * src/common.h - Double value of SF_MAX_STRINGS. - - * tests/string_test.c - Add string tests for WAVEX and RIFX files. - - * tests/command_test.c - Add broadcast test for WAVEX files. - -2008-08-17 Erik de Castro Lopo - - * tests/string_test.c - Add a new string_rdwr_test (currently failing for WAV). - Add a new string_multi_set_test (currently failing). - - * tests/command_test.c - Add new broadcast_rdwr_test (currently failing). - - * src/wav.c - Fix to WAV parser to allow 'bext' chunk to be updated in place. - In wav_write_tailer, seek to psf->dataend if its greater than zero. - - * src/sndfile.c - Make sure psf->have_written gets set correctly in mode SFM_RDWR. - - * configure.ac - Test for and gettimeofday. - - * src/common.c - Use gettimeofday() to initialize psf_rand_int32. - - * src/common.h src/sndfile.c - Add unique_id field to SF_PRIVATE struct. - - * src/common.h src/sndfile.c src/wav.c src/wav_w64.[ch] - Move wavex_ambisonic field from SF_PRIVATE struct to WAV_PRIVATE struct. - - * src/common.h src/strings.c - Add function psf_location_string_count. - -2008-08-16 Erik de Castro Lopo - - * configure.ac - Test for localtime and localtime_r. - - * examples/sndfile-convert.c - In function copy_metadata(), copy broadcast info if present. - - * examples/copy_data.[ch] examples/Makefile.am - Break some functionality out of sndfile-convert.c so it can be used in - examples/sndfile-bwf-set.c. - - * tests/utils.tpl - Add new function create_short_sndfile(). - - * examples/sndfile-bwf-set.c examples/sndfile-bwf-get.c - examples/Makefile.am - Add new files and hook into build. - -2008-08-11 Erik de Castro Lopo - - * src/sndfile.h.in - Fix comments. Patch from Mark Glines. - -2008-07-30 Erik de Castro Lopo - - * tests/misc_test.c - Use zero_data_test on Ogg/Vorbis files. - - * src/ogg.c - Fix segfault when closing an Ogg/Vorbis file that has been opened for write - but had no actual data written to it. Bug reported by Chinoy Gupta. - - * tests/Makefile.am - Make sure to run mist_test on Ogg/Vorbis files. - -2008-07-19 Erik de Castro Lopo - - * regtest/Makefile.am - Use SQLITE3_CFLAGS to locate sqlite headers. - -2008-07-10 Erik de Castro Lopo - - * doc/index.html doc/FAQ.html - Add notes about which versions of windows libsndfile works on. - -2008-07-03 Erik de Castro Lopo - - * tests/misc_test.c - Add a test for correct handling of Ambisonic files. Thanks to Fons - Adriaensen for the test. - - * src/wav.c src/wav_w64.c - Fix handling of Ambisonic files. Thanks to Fons Adriaensen for the patch. - -2008-06-29 Erik de Castro Lopo - - * configure.ac - Fix detection/enabling of external libs. - - * M4/extra_pkg.m4 M4/Makefile.am - Add m4 macro PKG_CHECK_MOD_VERSION which is a hacked version - PKG_CHECK_MODULES. The new macro prints the version number of the package - it is searching for. - -2008-06-14 Erik de Castro Lopo - - * src/aiff.c - Apply a fix from Axel Röbel where if the second loop in the instrument - chunk is none, the loop mode is written into the first loop. - -2008-05-31 Erik de Castro Lopo - - * src/test_float.c src/test_main.(c|h) src/Makefile.am - Add new file to test functions float32_(le|be)_(read|write) and - double64_(le|be)_(read|write). Hook into build and testsuite. - - * src/double64.c src/float32.c - Fix bugs in functions found by test added above. Thanks to Nicolas Castagne - for reporting this bug. - - * src/sndfile.h.in - Change time_reference_(low|high) entries of SF_BROADCAST_INFO struct to - unsigned. - - * examples/sndfile-info.c - Print out the BEXT time reference in a sensible format. - -2008-05-21 Erik de Castro Lopo - - * src/*.c - Fuzz fixes. - - * src/ogg.c - Add call to ogg_stream_clear to fix valgrind warning. - - * src/aiff.c - Fix x86_64 compile issue. - - * configure.ac src/Makefile.am src/flac.c src/ogg.c - Link to external versions of FLAC, Ogg and Vorbis. - - * tests/lossy_comp_test.c tests/ogg_test.c tests/string_test.c - tests/vorbis_test.c tests/write_read_test.tpl - Fix tests when configured with --disable-external-libs. - - * tests/external_libs_test.c tests/Makefile.am - Add new test and hook into build and test suite. - - * src/command.c - Use HAVE_EXTERNAL_LIBS to ensure that the SFC_GET_FORMAT_* commands return - the right data when external libs are disabled. - -2008-05-11 Erik de Castro Lopo - - * tests/write_read_test.tpl - Add a test for extending a file during write by seeking past the current - end of file. - - * src/sndfile.c - Allow seeking past end of file during write. - -2008-05-10 Erik de Castro Lopo - - * doc/api.html doc/command.html - Move all information about the sf_command function to command.html and add - a link from documentation of the sf_read/write_raw function to the - SFC_RAW_NEEDS_ENDSWAP command. - - * doc/index.html doc/FAQ.html doc/libsndfile.css - Minor documentation tweaks. - -2008-05-09 Erik de Castro Lopo - - * configure.ac - Add AM_PROG_CC_C_O. - -2008-04-27 Erik de Castro Lopo - - * tests/error_test.c - Add a test to make sure if file opened with sf_open_fd, and then the file - descriptor is closed, then sf_close will return an error code. Thanks to - Dave Flogeras for the bug report. - - * src/sndfile.c - Make sf_close return an error is the file descriptor is already closed. - -2008-04-19 Erik de Castro Lopo - - * configure.ac - Set object format to aout for OS/2. Thanks to David Yeo. - - * src/mpc2k.c src/sndfile.c src/sndfile.h.in src/common.h src/Makefile.am - Add ability to read MPC 2000 file. - - * tests/write_read_test.tpl tests/misc_test.c tests/header_test.tpl - tests/Makefile.am - Add tests for MPC 2000 file format. - - * examples/sndfile-convert.c - Allow conversion to MPC 2000 file format. - -2008-04-17 Erik de Castro Lopo - - * src/VORBIS/lib/codebook.c - Sync from upstream SVN. - - * autogen.sh configure.ac - Minor tweaks. - -2008-04-13 Erik de Castro Lopo - - * src/ogg.c - Add a patch that fixes finding the length in samples of an Ogg/Vorbis file. - The patch as supplied segfaulted and required many hours of debugging. - - * src/OGG/bitwise.c - Sync from upstream SVN. - -2008-04-09 Erik de Castro Lopo - - * src/aiff.c - Fix up handling of 'APPL' chunk. Thanks to Axel Röbel for bringing up - this issue. - -2008-04-06 Erik de Castro Lopo - - * tests/*.c - Add calls to sf_close() where needed. - - * tests/utils.tpl tests/multi_file_test.c - Always pass 0 as the third argument to open when OS_IS_WIN32. - -2008-04-03 Erik de Castro Lopo - - * src/test_* - Add files test_main.[ch]. - Collapse all tests into a single executable. - -2008-03-30 Erik de Castro Lopo - - * src/FLAC - Sync to upstream CVS. - -2008-03-25 Erik de Castro Lopo - - * src/common.h - Make SF_MIN and SF_MAX macros MinGW friendly. - - * examples/sndfile-(info|play).c - Use Sleep function from instead of _sleep. - - * tests/locale_test.c - Disable some tests when OS_IS_WIN32. - - * src/FLAC/src/share/replaygain_anal/replaygain_analysis.c - src/FLAC/src/share/utf8/utf8.c - MinGW fixes. - -2008-03-11 Erik de Castro Lopo - - * doc/FAQ.html - Tweaks to pcm16 <-> float conversion answer. - -2008-02-10 Erik de Castro Lopo - - * src/OGG - Sync to SVN upstream. - - * Makefile.am - Add 'DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror'. - -2008-02-05 Erik de Castro Lopo - - * examples/sndfile-jackplay.c - Minor tweaks to warning message printed when compiled without libjack. - -2008-01-27 Erik de Castro Lopo - - * tests/peak_chunk_test.c - Improve read_write_peak_test to find more errors. Inspired by example - provided by Nicolas Castagne. - - * src/aiff.c - Another SFM_RDWR fix shown up by above test. - -2008-01-24 Erik de Castro Lopo - - * src/aiff.c - Fix reading of COMM encoding string. - - * src/chunk.c src/common.h src/Makefile.am - New file for storing and retrieving info about header chunks. Hook into - build. - - * src/aiff.c - Use new chunk logging to fix problem with AIFF in RDWR mode. - -2008-01-22 Erik de Castro Lopo - - * src/command.c - Add WVE to the list of major formats. - - * tests/aiff_rw_test.c - Fix error reporting. - -2008-01-21 Erik de Castro Lopo - - * src/common.[ch] - Add internal functions str_of_major_format, str_of_minor_format, - str_of_open_mode and str_of_endianness. - - * tests/write_read_test.tpl - Fix reporting of errors in new_rdwr_XXXX_test. - -2008-01-20 Erik de Castro Lopo - - * examples/sndfile-play.c - Apply patch from Yair K. to fix compiles with OSS v4. - - * src/common.h src/float32.c src/double64.c - Rename psf->float_enswap to psf->data_endswap. - - * src/sndfile.h.in src/sndfile.c src/pcm.c - Add command SFC_RAW_NEEDS_ENDSWAP. - - * tests/command.c - Add test for SFC_RAW_NEEDS_ENDSWAP. - - * doc/command.html - Document SFC_RAW_NEEDS_ENDSWAP. - - * tests/peak_chunk_test.c - Add test function read_write_peak_test. Thanks to Nicolas Castagne for the - bug report. - -2008-01-09 Erik de Castro Lopo - - * examples/sndfile-cmp.c - Add new example program contributed by Conrad Parker. - - * examples/Makefile.am - Hook into build. - - * doc/development.html - Change use or reconfigure.mk to autogen.sh. - -2008-01-08 Erik de Castro Lopo - - * tests/win32_test.c - Add another win32 test. - - * tests/util.tpl - Add function file_length_fd which wraps fstat. - - * tests/Makefile.am - Run the multi_file_test on AU files. - - * tests/multi_file_test.c - Use function file_length_fd() instead of file_length() to overcome stupid - win32 bug. Fscking hell Microsoft sucks so much. - -2008-01-05 Erik de Castro Lopo - - * src/sd2.c - Fix a rsrc parsing bug. Example file supplied by Uli Franke. - -2007-12-28 Erik de Castro Lopo - - * doc/index.html - Allow use of either LGPL v2.1 or LGPL v3. - - * tests/header_test.tpl - Add header_shrink_test from Axel Röbel. - - * src/wav.c - Add fix from Axel Röbel for writing files with float data but no peak - chunk (ie peak chunk gets removed after the file is opened). - - * src/aiff.c tests/header_test.tpl - Apply similar fix to above for AIFF files. - - * src/wav.c tests/header_test.tpl - Apply similar fix to above for WAVEX files. - - * src/command.c - Add Ogg/Vorbis to 'get format' commands. - -2007-12-16 Erik de Castro Lopo - - * src/ogg.c - Fix seeking on multichannel Ogg Vorbis files. Reported by Bodo. - Set the default encoding quality to 0.4 instead of 4.0 (Bodo again). - - * tests/ogg_test.c - Add stereo seek tests. - -2007-12-14 Erik de Castro Lopo - - * tests/ogg_test.c - Add a test (currently failing) for stereo seeking on Ogg Vorbis files. Test - case supplied by Bodo. - - * tests/utils.(def|tpl) - Add compare_XXX_or_die functions. - -2007-12-05 Erik de Castro Lopo - - * src/aiff.c - Fix a bug where ignoring ssnd_fmt.offset and ssnd_fmt.blocksize caused - misaligned reading of 24 bit data. Thanks to Uli Franke for reporting this. - -2007-12-03 Erik de Castro Lopo - - * src/vox_adpcm.c src/ima_oki_adpcm.[ch] src/Makefile.am - Merge in code from the vox-patch branch. Thanks to Robs for the patch - which fixes a long standing bug in the VOX codec. - -2007-12-01 Erik de Castro Lopo - - * examples/sndfile-convert.c - Fix handling of -override-sample-rate=X option. - -2007-11-25 Erik de Castro Lopo - - * src/ogg.c src/VORBIS - Merge in Ogg Vorbis support from John ffitch of the Csound project. - -2007-11-24 Erik de Castro Lopo - - * src/sndfile.c - Recognise files with 'vox6' extension as 6kHz OKI VOX ADPCM files. Also - recognise 'vox8' as and 'vox' as 8kHz files. - - * configure.ac - Detect libjack (JACK Audio Connect Kit). - - * examples/sndfile-jackplay.c examples/Makefile.am - Add new example program to play sound files using the JACK audio server. - Thanks to Jonatan Liljedahl for allowing this to be included. - -2007-11-21 Erik de Castro Lopo - - * doc/index.html - Update support table with SD2 and FLAC. - -2007-11-17 Erik de Castro Lopo - - * src/sndfile.c - Fix calculation of internal value psf->read_current when attempting to read - past end of audio data. - Remove redundant code. - - * tests/lossy_comp_test.c - Add read_raw_test to check that raw reads do not go past the end of the - audio data section. - Clean up error output messages. - - * src/sndfile.c - Add code to prevent sf_read_raw from reading past the end of the audio data. - - * tests/Makefile.am - Add the wav_pcm lossy_comp_test. - -2007-11-16 Erik de Castro Lopo - - * configure.ac src/Makefile.am src/create_symbols_file.py - More OS/2 fixes from David Yeo. - -2007-11-12 Erik de Castro Lopo - - * src/file_io.c tests/utils.tpl tests/benchmark.tpl - Improve handling of requirements for O_BINARY as suggested by Ed Schouten. - -2007-11-11 Erik de Castro Lopo - - * src/common.h - Fix symbol class when SF_MIN is nested inside SF_MAX or vice versa. - - * src/create_symbols_file.py - Add support for OS/2 contributed by David Yeo. - -2007-11-05 Erik de Castro Lopo - - * M4/gcc_version.m4 - Add macro AC_GCC_VERSION to detect GCC_MAJOR_VERSION and GCC_MINOR_VERSION. - - * configure.ac - Use AC_GCC_VERSION to work around gcc-4.2 inline warning stupidity. - See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33995 - Use -fgnu-inline to prevent stupid warnings. - -2007-11-03 Erik de Castro Lopo - - * tests/util.tpl - Increase the printing width for print_test_name(). - - * tests/command_test.c tests/Makefile.am - Add tests for correct updating of broadcast WAV coding history. - - * examples/sndfilehandle.cc examples/Makefile.am - Add example program using the C++ SndfileHandle class. - -2007-10-29 Erik de Castro Lopo - - * src/common.h src/sndfile.c - Add error codes SFE_ZERO_MAJOR_FORMAT and SFE_ZERO_MINOR_FORMAT. - -2007-10-26 Erik de Castro Lopo - - * src/sd2.c - Identify sample-rate/sample-size/channels by resource id. - -2007-10-25 Erik de Castro Lopo - - * src/broadcast.c src/common.h src/sndfile.c - Improvements to handling of broadcast info in WAV files. Thanks to Frederic - Cornu and other for their input. - -2007-10-24 Erik de Castro Lopo - - * src/FLAC/include/share/alloc.h - Mingw fix for SIZE_T_MAX from Uli Franke. - -2007-10-23 Erik de Castro Lopo - - * tests/open_fail_test.c tests/error_test.c tests/Makefile.am - Move tests from open_fail_test.c to error_test.c and remove the former. - -2007-10-22 Erik de Castro Lopo - - * tests/scale_clip_test.(def|tpl) - Add tests for SFC_SET_INT_FLOAT_WRITE command. - - * doc/command.html - Add docs for SFC_SET_INT_FLOAT_WRITE command. - - * examples/sndfile-play.c tests/dft_cmp.c - Fix gcc-4.2 warning messages. - -2007-10-21 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c - Add command SFC_GET_CURRENT_SF_INFO. - - * src/sndfile.h.in src/sndfile.c src/create_symbols_file.py - Remove function sf_get_info (only ever in pre-release code). - - * tests/command_test.c - Add test for SFC_GET_CURRENT_SF_INFO. - -2007-10-15 Erik de Castro Lopo - - * src/wav.c - Add parsing of 'exif' chunks. Originally coded by Trent Apted. - - * configure.ac - Put config stuff in Cfg directory. - Remove check for inttypes.h. - -2007-10-10 Erik de Castro Lopo - - * src/w64.c - Fix writing of 'riff' chunk length and check for correct value in parser. - -2007-09-20 Erik de Castro Lopo - - * doc/index.html - Link to MP3 FAQ entry. - -2007-09-18 Erik de Castro Lopo - - * src/flac.c - Move the blocksize check to an earlier stage of flac_buffer_copy. - -2007-09-12 Erik de Castro Lopo - - * src/FLAC - Huge merge from FLAC upstream. - -2007-09-10 Erik de Castro Lopo - - * examples/*.c - Change license to all example programs to BSD. - -2007-09-08 Erik de Castro Lopo - - * src/FLAC/include/FLAC/metadata.h - Include to prevent compile error on OSX. - - * Octave/octave_test.sh - Disable test on OSX. Can't get it to work. - - * src/flac.c - Check the blocksize returned from the FLAC decoder to prevent buffer - overruns. Reported by Jeremy Friesner. Thanks. - -2007-09-07 Erik de Castro Lopo - - * Makefile.am M4/octave.m4 - Fix build when Octave headers are not present. - -2007-08-27 Erik de Castro Lopo - - * doc/development.html - Add note about bzr repository directory looking empty. - -2007-08-26 Erik de Castro Lopo - - * configure.ac Octave/* M4/octave_* - Bunch of changes to add ability to build GNU Octave modules to read/write - sound files using libsndfile from Octave. - -2007-08-23 Erik de Castro Lopo - - * acinclude.m4 configure.ac ... - Get rid of acinclude.m4 and replace it with an M4 directory. - -2007-08-21 Erik de Castro Lopo - - * src/sndfile.h.in - Remove crufty Metrowerks compiler support. Allow header file to be compiled - on windows with both GCC and microsoft compiler. - -2007-08-19 Erik de Castro Lopo - - * tests/dft_cmp.[ch] tests/floating_point_test.tpl - Clean up floating point tests. - -2007-08-14 Erik de Castro Lopo - - * src/aiff.c - Fix segfault when COMM chunk length is byte swapped. - -2007-08-09 Erik de Castro Lopo - - * src/common.h src/mat4.c src/mat5.c src/sndfile.c - Add a generic SFE_CHANNEL_COUNT_ZERO error, remove format specific errors. - - * src/au.c - Fix crash on AU files with zero channel count. Reported by Ben Alison. - -2007-08-08 Erik de Castro Lopo - - * src/voc.c - Fix bug in handling file supplied by Matt Olenik. - -2007-07-31 Erik de Castro Lopo - - * src/OGG - Merge from OGG upstream sources. - -2007-07-25 Erik de Castro Lopo - - * src/FLAC - Merge from FLAC upstream sources. - -2007-07-15 Erik de Castro Lopo - - * src/flac.c - Fix memory leak; set copy parameter to FALSE in call to - FLAC__metadata_object_vorbiscomment_append_comment. - - * src/common.[ch] - Add function psf_rand_int32(). - -2007-07-14 Erik de Castro Lopo - - * src/FLAC - Merge from FLAC upstream sources. - - * src/strings.c tests/string_test.c tests/Makefile.am - Make sure string tests for SF_STR_LICENSE actually works. - -2007-07-13 Erik de Castro Lopo - - * tests/string_test.c - Add ability to test strings stored in metadata secion of FLAC files. - - * src/string.c - Fix logic for testing if audio data has been written and string is added. - Make sure SF_STR_ALBUM actually works. - - * src/flac.c - Finalize reading/writing string metadata. Tests pass. - - * src/sndfile.h.in tests/string_test.c src/flac.c - Add string type SF_STR_LICENSE, update test and use for FLAC files. - - * src/sndfile.h.in - Add definition for SFC_SET_SCALE_FLOAT_INT_WRITE command. - - * src/common.h src/double64.c src/float32.c src/sndfile.c - Add support for SFC_SET_SCALE_FLOAT_INT_WRITE (still needs testing). - -2007-07-12 Erik de Castro Lopo - - * src/flac.c - Apply patch from Ed Schouten to read artist and title metadata from FLAC - files. - Improve reporting of FLAC metadata. - - * src/sndfile.h.in tests/string_test.c src/flac.c - Add string type SF_STR_ALBUM, update test and use for FLAC files. - -2007-06-28 Erik de Castro Lopo - - * src/FLAC/* - Merge from upstream CVS. - -2007-06-16 Erik de Castro Lopo - - * src/FLAC/* - Update from upstream CVS. - -2007-06-14 Erik de Castro Lopo - - * tests/cpp_test.cc - Add extra tests for when the SndfileHandle constructor fails. - - * src/sndfile.hh - Make sure failure to open the file in the constructor does not allow later - calls to other methods to fail. - -2007-06-10 Erik de Castro Lopo - - * tests/util.tpl - Add function write_mono_file. - - * tests/generate.[ch] tests/Makefile.am - Add files generate.[ch] and hook into build. - - * tests/write_read_test.tpl - Add multi_seek_test. - - * src/flac.c - Fix buffer overflow bug. Test provided by Jeremy Friesner and fix provided - by David Viens. - -2007-06-07 Erik de Castro Lopo - - * doc/FAQ.html - Minor update. - - * configure.ac src/FLAC/src/libFLAC/ia32/Makefile.am src/Makefile.am - Apply patch from Trent Apted make it compile on Intel MacOSX. Thanks Trent. - -2007-05-28 Erik de Castro Lopo - - * src/wav.c - Fix writing of MSGUID subtypes. Thanks to Bruce Sharpe. - -2007-05-22 Erik de Castro Lopo - - * src/wav.c - Fix array indexing bug raised by Bruce Sharpe. - -2007-05-12 Erik de Castro Lopo - - * src/FLAC/src/share/getopt/getopt.c - Fix Mac OSX / PowerPC compile warnings. - - * configure.ac - Make sure WORDS_BIGENDIAN gets correctly defined for FLAC code. - -2007-05-04 Erik de Castro Lopo - - * doc/FAQ.html - Add Q/A about MP3 support. - -2007-05-03 Erik de Castro Lopo - - * doc/new_file_type.HOWTO - Minor updates. - -2007-05-02 Erik de Castro Lopo - - * src/wve.c - Fix a couple bad parameters with psf_log_printf. - - * src/pcm.c - Improve error reporting. - - * src/common.h src/common.c - Constify psf_hexdump. - -2007-04-30 Erik de Castro Lopo - - * src/FLAC - Ditch and re-import required FLAC code. - - * configure.ac - Force FLAC__HAS_OGG variable to 1. - - * src/FLAC/src/libFLAC/stream_encoder.c - Fix compiler warnings. - -2007-04-23 Erik de Castro Lopo - - * configure.ac tests/win32_ordinal_test.c - Detect if win32 DLL is beging generated and only run win32_ordinal_test if - true. - - * src/G72x/Makefile.am src/Makefile.am - Use $(EXEEXT) where possible. - -2007-04-18 Erik de Castro Lopo - - * src/wve.c src/common.h src/sndfile.c - Complete definition of SfE_WVE_NO_WVE error message. - - * src/wve.c - Fix error in files generated on big endian systems. Robustify parsing. - -2007-04-16 Erik de Castro Lopo - - * src/double64.c - Fix clipping of double to short conversions on 64 bit systems. - - * src/flac.c regtest/database.c tests/cpp_test.cc - Fix compile warnings for 64 bit systems. - -2007-04-15 Erik de Castro Lopo - - * src/wav.c src/wav_w64.c - Use audio detect function when 'fmt ' chunk data is suspicious. - - * configure.ac - Add ugly hack to remove -Werror from some Makefiles. - -2007-04-14 Erik de Castro Lopo - - * src/GSM610/long_term.c src/macbinary3.c tests/cpp_test.cc - Add patch from André Pang to clean up compiles on OSX. - - * src/wve.c src/common.h src/sndfile.c src/sndfile.h.in - examples/sndfile-convert.c - Merge changes from Reuben Thomas to improve WVE support. - - * tests/lossy_comp_test.c tests/Makefile.am - Add tests for WVE files. - -2007-04-11 Erik de Castro Lopo - - * src/sndfile.hh - Add a static SndfileHandle::formatCheck method as suggested by Jorge - Jiménez. - -2007-04-09 Erik de Castro Lopo - - * src/sndfile.c - Fixed a bug in sf_error() where the function itself was being compared - against zero. Add a check for a NULL return from peak_info_calloc. Fix a - possible NULL dereference. - -2007-04-07 Erik de Castro Lopo - - * src/flac.c - Turn off seekable flag when writing, return SFE_BAD_RDWR_FORMAT when - opening file for RDWR. - - * src/sndfile.c - Improve error message for SFE_BAD_RDWR_FORMAT. - - * src/mat4.c - Fix array indexing issue. Thanks to Ben Allison (Nullsoft) for alerting me. - -2007-03-05 Erik de Castro Lopo - - * doc/FAQ.html - Add Q/A 19 on project files. - -2007-03-01 Erik de Castro Lopo - - * src/sndfile.c - Guard agains MacOSX universal binary compiles. - - * doc/FAQ.html - Add Q/A 18 and clean up Q3. - -2007-02-22 Erik de Castro Lopo - - * src/aiff.c - Add support for 'in24' files. - -2007-02-13 Erik de Castro Lopo - - * src/wav.c src/wav_w64.c src/wav_w64.h - Start work towards detecting ausio codec type from the actual audio data. - - * src/audio_detect.c src/test_audio_detect.c - Add new file and its unit test. - -2007-02-07 Erik de Castro Lopo - - * examples/cooledit-fixer.c examples/Makefile.am - Remove old broken example program. - -2007-02-06 Erik de Castro Lopo - - * src/sndfile.c src/sndfile.h.in src/create_symbols_file.py - Add function sf_get_info. - -2007-01-25 Erik de Castro Lopo - - * examples/sndfile-play.c - For ALSA, use the 'default' device instead of 'plughw:0'. - -2007-01-22 Erik de Castro Lopo - - * src/sndfile.c - Allow writing of WAV/WAVEX 'BEXT' chunks in SFM_RDWR mode. - -2007-01-21 Erik de Castro Lopo - - * doc/development.html doc/embedded_files.html man/sndfile-play.1 - Minor documentation fixes. Thanks Reuben Thomas. - -2006-12-16 Erik de Castro Lopo - - * examples/sndfile-convert.c - Add -override-sample-rate command line option. - -2006-11-19 Erik de Castro Lopo - - * tests/misc_test.c - Force errno to zero at start of some tests. - - * src/sndfile.c - Minor clean up of error handling. - - * configure.ac - Remove an assembler test which was failing on OSX. - -2006-11-15 Erik de Castro Lopo - - * src/common.h - Fix the definition of SF_PLATFORM_S64 for MinGW. - - * src/FLAC/Makefile.am src/FLAC/share/grabbag/Makefile.am - Fix path problems for MinGW. - -2006-11-13 Erik de Castro Lopo - - * src/sfendian.h - Add include guard. - - * src/Makefile.am src/flac.c - Clean up include paths. - - * src/test_conversions.c - New file to test psf_binheader_readf/writef functions. - - * src/Makefile.am src/test_file_io.c src/test_log_printf.c src/common.c - Clean up unit testing. - - * src/common.c - Fix a bug reading/writing 64 bit header fields. Thanks to Jonathan Woithe - for reporting this. - - * src/test_conversions.c - Complete unit test for above fix. - -2006-11-11 Erik de Castro Lopo - - * src/sndfile.c - More refactoring to clean up psf_open_file() and vairous sf_open() - functions. - -2006-11-09 Erik de Castro Lopo - - * src/wav.c - Apply a patch from Jonathan Woithe to allow opening of (malformed) WAV - files of over 4 gigabytes. - -2006-11-05 Erik de Castro Lopo - - * src/sndfile.c - Refactor function psf_open_file() to provide a single return point. - - * tests/misc_test.c - Fix permission_test to ensure that read only file can be created. - -2006-11-03 Erik de Castro Lopo - - * src/common.h - Add SF_PLATFORM_S64 macro as a platform independant way of doing signed 64 - bit integers. - - * src/aiff.c src/svx.c src/wav.c - Add warning in log if files are larger than 4 gigabytes in size. - -2006-11-01 Erik de Castro Lopo - - * src/FLAC src/OGG confgure.ac src/Makefile.am - Pull in all required FLAC and OGG code so external libraries are not - needed. This makes compiling on stupid fscking Windoze easier. - -2006-10-27 Erik de Castro Lopo - - * src/sd2.c - Add workaround for switched sample rate and sample size. - - * src/wav.c - Add workaround for excessively long coding history in the 'bext' chunk. - -2006-10-23 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c src/wav.c doc/command.html - Use SF_AMBISONIC_* instead of SF_TRUE/SF_FALSE. - -2006-10-22 Erik de Castro Lopo - - * src/sndfile.h.in src/wav.c src/wav_w64.c src/common.h doc/command.html - Apply a patch from Fons Adriaensen to allow writing on WAVEX Ambisonic - files. Still needs a little tweaking before its ready for release. - - * src/*.c - Use the UNUSED macro to prevent compiler warnings. - -2006-10-19 Erik de Castro Lopo - - * src/aiff.c - Fix a bug in parsing AIFF files with a slightly unusual 'basc' chunk. Thanks - to David Viens for providing two example files. - - * src/common.(c|h) src/aiff.c - Add a function psf_sanitize_string and use it in aiff.c. - -2006-10-18 Erik de Castro Lopo - - * src/wav_w64.c - Apply a patch from Fons Adriaensen which fixes a minor WAVEX GUID issue. - -2006-10-17 Erik de Castro Lopo - - * src/Makefile.am - Fix problem related to recent test coverage changes. - -2006-10-15 Erik de Castro Lopo - - * configure.ac tests/Makefile.am - Add --enable-test-coverage configure option. - -2006-10-05 Erik de Castro Lopo - - * src/sndfile.hh - Add an std::string SndfileHandle constructor. - - * tests/scale_clip_test.tpl - Fix the 'make distcheck' target. - -2006-10-03 Erik de Castro Lopo - - * src/double64.c src/float32.c - Add optional clipping on float file data to int read data conversions. - - * tests/tests/scale_clip_test.(def|tpl) - Add test for above new code. - -2006-09-06 Erik de Castro Lopo - - * tests/aiff_rw_test.c - Add 'MARK' chunks to make sure they are parsed correctly. - -2006-09-05 Erik de Castro Lopo - - * src/aiff.c - Fix parsing of MARK chunks. Many thanks to Sciss for generating files to - help debug the problem. - -2006-09-02 Erik de Castro Lopo - - * src/common.h - Make the SF_MIN and SF_MAX macros at least partially type safe. - - * tests/lossy_comp_test.c - Fix overflow problems when ensuring that signalis not zero. - -2006-08-31 Erik de Castro Lopo - - * configure.ac docs/*.html - Changes for release 1.0.17. - -2006-08-08 Erik de Castro Lopo - - * src/flac.c - Remove inline from functions called by pointer. Thanks to Sampo Savolainen - for notifying me of this. - -2006-07-31 Erik de Castro Lopo - - * src/sndfile.hh - Add writeSync method. - Add copy constructor and assignment operator (thanks Daniel Schmitt). - Add methods readRaw and writeRaw. - Make read/write/readf/writef simple overlaods instead of templates (thanks - to Trent Apted for suggesting this). - - * tests/cpp_test.cc - Cleanup. Add tests. - -2006-07-30 Erik de Castro Lopo - - * src/sndfile.hh - Templatize the read/write/readf/writef methods as suggested by Lars Luthman. - Prevent the potential leak of SNDFILE* pointers in the openRead/openWrite/ - openReadWrite methods. - Add const to SF_INFO pointer in Sndfile constructor. - Make the destrictor call the close() method. - - * tests/cpp_test.cc - Add more tests. - -2006-07-29 Erik de Castro Lopo - - * tests/cpp_test.cc - Remove the generated file so "make distcheck" passes. - - * src/Makefile.am - Add sndfile.hh to distributed header files. - - * src/sndfile.hh - Change the license for the C++ wrapper to modified BSD. - -2006-07-28 Erik de Castro Lopo - - * src/sndfile.hh - Complete it. - - * tests/cpp_test.cc - Add more tests. - -2006-07-27 Erik de Castro Lopo - - * tests/utils.tpl - Add extern C to generated header file. - - * src/sndfile.hh - Work towards completing this. - - * tests/cpp_test.cc tests/Makefile.am - Add a C++ test and hook into build. - - * configure.ac - Add appropriate CXXFLAGS. - -2006-07-26 Erik de Castro Lopo - - * configure.ac - Test if compiler supports -Wpointer-arith. - - * src/common.c - Fix a warning resulting from -Wpointer-arith. - -2006-07-15 Erik de Castro Lopo - - * examples/sndfile-play.c - Explicitly set endian-ness as well as setting 16 bit output. - - * examples/sndfile-info.c - Make sure to parse info if file fails to open. - - * src/sndfile.c - Handle parse error a little better. - - * src/wav_w64.[ch] - Minor clean up, add detection of IPP ITU G723.1. - -2006-06-23 Erik de Castro Lopo - - * src/sndfile.c - Make sure psf->dataoffset gets reset to zero when openning headersless - files based on the file name extension. - -2006-06-21 Erik de Castro Lopo - - * tests/(command|lossy_comp|pcm|scale_clip)_test.c tests/fix_this.c - tests/write_read_test.(tpl|def) - Fix gcc-4.1 compiler warnings about "dereferencing type-punned pointer will - break strict-aliasing rules". - - * examples/cooledit-fixer.c - More fixes like above. - -2006-06-20 Erik de Castro Lopo - - * src/file_io.c - Fix a windows bug where the syserr string of SF_PRIVATE was not being set - correctly. - - * src/sndfile.c - Fixed a logic bug in sf_seek(). Thanks to Paul Davis for finding this. - -2006-06-04 Erik de Castro Lopo - - * configure.ac - Fixed detection of S_IRGRP. - -2006-05-30 Erik de Castro Lopo - - * sndfile-convert.c - Add conversion SF_INSTRUMENT data when present. - -2006-05-22 Erik de Castro Lopo - - * doc/development.html - Removed references to tla on windows. - - * src/common.h src/sndfile.c - Add separate void pointers for file containter and file codec data to - SF_PRIVATE struct. Still need to move all existing fdata pointers. - - * tests/write_read_test.tpl - Change the order of some tests. - - * src/aiff.c - When writing 'AIFC' files, make sure get an 'FVER' gets added. - - * src/common.h src/(dwvw|flac|g72x|gsm610|ima_adpcm|ms_adpcm|paf|sds).c - src/(sndfile|voc|vox_adpcm|xi).c - Remove fdata field from SF_PRIVATE struct and replace it with codec_data. - -2006-05-10 Erik de Castro Lopo - - * Win32/testprog.c Win32/Makefile.am - Add a minimal win32 test program. - - * Win32/README-precompiled-dll.txt Mingw-make-dist.sh - Update readme and Mingw build script. - -2006-05-09 Erik de Castro Lopo - - * configure.ac acinclude.m4 - Minor fixes for Solaris. - -2006-05-05 Erik de Castro Lopo - - * src/test_endswap.(def|tpl) - Fix printf formatting for int64_t on 64 bit machines. - -2006-05-04 Erik de Castro Lopo - - * src/binhead_check.py - New file to check for bad parameters passed to psf_binheader_writef(). - - * src/Makefile.am - Hook into test suite. - - * src/voc.c src/caf.c src/wav.c src/mat5.c src/mat4.c - Fix bugs found by new test program. - - * src/double64.c - Clean up double64_get_capability(). - -2006-05-03 Erik de Castro Lopo - - * src/wav_w64.c - Fix a bug on x86_64 where an int was being passed via stdargs and being - read using size_t which is 64 bits. Thenks to John ffitch for giving me a - login on his box. - -2006-05-02 Erik de Castro Lopo - - * src/caf.c src/double64.c examples/sndfile-info.c tests/virtual_io_test.c - tests/utils.tpl - Fix a couple of signed/unsigned problems. - -2006-05-01 Erik de Castro Lopo - - * tests/command_test.c - Add channel map tests. - - * src/common.h src/sndfile.c - Add a pointer the the SF_PRIVATE struct and make sure it gets freed in - sf_close(). - -2006-04-30 Erik de Castro Lopo - - * configure.ac doc/(command|index|api).html NEWS README - Updates for 1.0.16 release. - - * src/sndfile.h.in - Define enums for channel mapping. - - * examples/sndfile-info.c - Clean up usage of SF_INFO struct. - -2006-04-29 Erik de Castro Lopo - - * tests/util.tpl - Add function testing function exit_if_true(). - - * tests/floating_point_test.tpl - Fix a problem where the test program was not exiting when the test failed. - -2006-04-15 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c src/common.h src/command.c - Implement new commands SFC_GET_SIGNAL_MAX and SFC_GET_MAX_ALL_CHANNELS. - - * doc/commands.html - Document new commands. Other minor updates. - - * tests/peak_chunk_test.c - Update tests for new commands. - -2006-04-02 Erik de Castro Lopo - - * tests/peak_chunk_test.c - Add test for RIFX and WAVEX files. - Try and confuse the PEAK chunk writing by enabling and disabling it. - - * src/sndfile.c - Fix a bug where enabling and disabling PEAK chunk was screwing up. - -2006-03-31 Erik de Castro Lopo - - * src/sndfile.h.in - Add the block of 190 reserved bytes into this struct to allow for - future expansion. - - * src/wav.c src/sndfile.c src/broadcast.c - Significant cleanup of broadcast wave stuff. - - * examples/sndfile-info.c - Fix print message. - - * tests/command_test.c tests/Makefile.am - Complete bext tests, hook test in test suite. - -2006-03-30 Erik de Castro Lopo - - * src/sndfile.h.in - Make coding_history field of SF_BROADCAST_INFO struct a char array instead - of a char pointer. - - * src/sndfile.c src/common.h src/wav.c - Clean up knock on effects of above chnage. - - * examples/sndfile-info.c - Add -b command line option to usage message. - Clean up output of broadcast wave info. - - * src/wav.c - Ignore and skip the 'levl' chunk. - -2006-03-26 Erik de Castro Lopo - - * configure.ac - Fix handling of --enable and --disable configure args. Thanks to Diego - 'Flameeyes' Pettenò who sent the patch. - -2006-03-22 Erik de Castro Lopo - - * doc/win32.html - Make it really clear that although the MSVC++ cannot compile libsndfile, - the precompiled DLL can be used in C++ programs compiled with MSVC++. - -2006-03-18 Erik de Castro Lopo - - * src/aiff.c - Fix bug in writing of INST chunk in AIFF files. - Fix potential bug in writing MARK chunks. - - * src/sndfile.c - Make sure the instrument chunk can only be written at the start of the file. - - * tests/command_test.c - Add check of log buffer. - - * tests/utils.tpl - Add usage of space character to psf_binheader_writef. - -2006-03-17 Erik de Castro Lopo - - * src/Makefile.am tests/Makefile.am - Remove --source-time argument from autogen command lines. - - * src/broadcast.c - New file for EBU Broadcast chunk in WAV files. - - * src/sndfile.c src/sndfile.h.in src/wav.c src/common.h - Add patch from Paul Davis implementing read/write of the BEXT chunk. - -2006-03-16 Erik de Castro Lopo - - * Win32/README-precompiled-dll.txt - New file descibing how to use the precompiled DLL. - - * Win32/Makefile.am - Add Win32/README-precompiled-dll.txt to EXTRA_DIST files. - - * configure.ac - Bump version to 1.0.15. - -2006-03-11 Erik de Castro Lopo - - * src/wav.c - On read, only add the endian flag if the file is big endian. - - * src/ms_adpcm.c - Fixed writing of APDCM coeffs in RIFX files. - - * tests/write_read_test.tpl tests/lossy_comp_test.c - Add tests for RIFX files. - -2006-03-10 Erik de Castro Lopo - - * Mingw-make-dist.sh - Bunch of improvements. - - * doc/win32.html - Update MinGW program versions. - -2006-03-09 Erik de Castro Lopo - - * src/create_symbols_file.py - Fix the library name in created win32 DEF file. Add correct DLL name for - Cygwin DLL. - - * Win32/Makefile.am tests/Makefile.am - Remove redundant files, add win32_ordinal_test to test suite. - - * tests/win32_ordinal_test.c - Update to do test in cygsndfile-1.dll as well. - - * doc/win32.html - Fix typo, mention that -mno-cygwin with the Cygwin compiler does not work. - - * src/wav.c src/wav_w64.c src/sndfile.c src/sndfile.h.in - Apply large patch from Jesse Chappell which adds support for RIFX files. - -2006-03-08 Erik de Castro Lopo - - * Makefile.am - Add Mingw-make-dist.sh to the extra dist files. - - * configure.ac - Fix setting SHLIB_VERSION_ARG for MinGW. - - * tests/win32_ordinal_test.c - New test program to test that the win32 DLL ordinals agree with the DEF - file. - -2006-03-04 Erik de Castro Lopo - - * src/common.h - Add a static inline function to convert an int to a size_t. This will be - a compile to nothing on 32 bit CPUs and a sign extension on 64 bit CPUs. - - * src/aiff.c src/avr.c src/common.c src/xi.c src/gsm610.c - Fix an ia64 problem where a varargs function was being passed an int in - some places and a size_t in other places. - - * src/sd2.c - Add a workaround for situations where OSX seems to add an extra 0x52 bytes - to the start of the resource fork. - -2006-02-19 Erik de Castro Lopo - - * Mingw-make-dist.sh - Add a shell script to build the windows binary/source ZIP file. - - * doc/index.html - Add download link for windows binary/source ZIP file. Add links for GPG - signatures. - - * doc/win32.html - Remove info about building using microsoft compiler. - - * configure.ac - Bump version to 1.0.14. - -2006-02-11 Erik de Castro Lopo - - * src/sd2.c - Improve logging of errors in resource fork parser. - -2006-01-31 Erik de Castro Lopo - - * Win32/Makefile.msvc - Replace au_g72x.* with g72x.*. Thanks to ussell Borogove. - -2006-01-29 Erik de Castro Lopo - - * src/common.c - Make sure return values are initialised header buffer is full. - - * src/wav.c - Add workarounds for messed up WAV files. - -2006-01-21 Erik de Castro Lopo - - * Win32/config.h - Undef HAVE_INTTYPES_H for win32. - - * tests/command_test.c - Don't exit on error in instrument test for XI files. - - * configure.ac - Bump version to 1.0.13. - - * doc/*.html NEWS README - Update version numbers. - -2006-01-19 Erik de Castro Lopo - - * src/xi.c - Start work on add read/write of instrument chunks. - - * src/command_test.c - Add tests for XI instrument chunk. - - * tests/largefile_test.c tests/Makefile.am - Add new test and hook it into the build system. This test will not be run - automatically because it requires 3 Gig of disk space and takes 3 minutes - to run. - -2006-01-10 Erik de Castro Lopo - - * examples/sndfile-play.c - Fix calculation of samples remaining in win32 code. Thanks Axel Röbel. - - * src/common.h - Make sure length of header buffer can hold header plus strings. Thanks Axel - Röbel. - -2006-01-09 Erik de Castro Lopo - - * src/sndfile.h.in src/aiff.c src/wav.c - Apply a patch from John ffitch (Csound project). - Add detune field to SF_INSTRUMENT struct. - Add reading/writing instrument chunks to WAV files. - - * tests/command_test.c - Update SF_INSTRUMENT tests. - - * tests/Makefile.am - Hook instrument tests into test suite. - -2006-01-05 Erik de Castro Lopo - - * configure.ac - Check for because some broken systems (like Solaris) don't have - which is the 1999 ISO C standard file containing int64_t. - - * src/sfendian.h src/common.h - Use if is not available. - -2005-12-30 Erik de Castro Lopo - - * tests/peak_chunk_test.c - Extend and clean up tests. - - * src/sndfile.c - Fix a bug that prevented the turning off of PEAK chunks. - -2005-12-29 Erik de Castro Lopo - - * tests/error_test.c - Make the test distclean correct. - - * src/file_io.c - Fix an SD2 MacOSX bug (reported by vince schwarzinger). - -2005-12-28 Erik de Castro Lopo - - * src/aiff.c tests/command_test.c - Apply a big patch from John ffitch (Csound project) to add reading and - writing of instrument chunks to AIFF files. Also update the test. - -2005-12-10 Erik de Castro Lopo - - * tests/aiff_rw_test.c tests/virtual_io_test.c tests/utils.tpl - Move test function dump_data_to_file() to utils.tpl. - - * tests/error_test.c tests/Makefile.am - Updates, including a new test to test that sf_error() returns a valid error - number. - -2005-12-07 Erik de Castro Lopo - - * examples/list_formats.c - Make sure the SF_INFO struct is memset to all zero before being used. - Thanks to Stephen F. Booth. - - * src/sndfile.c - Make the return value of sf_error() match the API documentation. - -2005-11-19 Erik de Castro Lopo - - * examples/sndfile-convert.c - Allow conversion to raw gsm610. - - * src/common.h src/sndfile.c src/au.c - Remove au_nh_open() and all references to it (wasn't working anyway). - - * tests/headerless_test.c - Add new test for file extension based detection. - - * src/sndfile.c - Rejig file extension based file type detection. - -2005-11-16 Erik de Castro Lopo - - * src/sndfile.c - Add "gsm" as a recognised file extension when no magic number can be found. - - * tests/lossy_comp_test.c tests/Makefile.am - Test headerless GSM610. - -2005-11-13 Erik de Castro Lopo - - * doc/api.html - Fix a minor typo and a minor error. Thanks Christoph Kobe and John Pavel. - -2005-10-30 Erik de Castro Lopo - - * src/wav_w64.c - Add more reporting of 'fmt ' chunk for G721 encoded files. - - * src/wav.c - Gernerate a more correct 20 byte 'fmt ' chunk rather than a 16 byte one. - -2005-10-29 Erik de Castro Lopo - - * src/G72x/g72x.[ch] - Minor cleanup of interface. - -2005-10-28 Erik de Castro Lopo - - * src/ogg.c - Removed the horribly broken and non-functional OGG implementation when - --enable-experimental was enabled. When OGG does finally work it will be - merged. - - * src/caf.c - Fix a memory leak. - -2005-10-27 Erik de Castro Lopo - - * src/g72x.c src/G72x/*.(c|h) src/common.h src/sndfile.c src/wav.c src/au.c - Add support for G721 encoded WAV files. - - * doc/index.html - Update support matrix. - - * tests/lossy_comp_test.c - For file formats that support it, add string data after the audio data and - make sure it isn't treated as audio data on read. - - * src/gsm610.c - Add code to ensure that the container close function (ie for WAV files) gets - called after the codec's close function. This allows GSM610 encoded WAV files - to have string data following the audio data. - Add an AIFF specific check on psf->datalength. - - * src/wav.c - Simplify wav_close function. - - * src/aiff.c - Make sure the tailer data gets written at an even file offset. Pad if - necessary. - - * src/common.h - Replace the close function pointer in SF_PRIVATE with separate functions - codec_close and container_close. The former is always called first. - - * src/*.c - Fix knock on effects of above. - -2005-10-26 Erik de Castro Lopo - - * examples/sndfile-info.c - Complete dumping SF_INSTRUMENT data. - - * src/dwvw.c src/ima_adpcm.c src/gsm610.c src/ms_adpcm.c - Add extra checks in *_init function. - - * tests/lossy_comp_test.c - Add a string comment to the end of the files to make sure that the decoder - doesn't decode beyond the end of the audio data section. - -2005-10-25 Erik de Castro Lopo - - * examples/sndfile-info.c - Minor code cleanup. - Start work on dumping SF_INSTRUMENT data. - -2005-10-23 Erik de Castro Lopo - - * src/sndfile.h.in src/common.h src/common.c - Update definition of SF_INSTRUMENT struct and create a function to allocate - and initialize the struct (input from David Viens). - Clean up definition of SF_INSTRUMENT struct. - - * src/wav.c src/wav_w64.c - Add support for Ambisoncs B WAVEX files (David Viens). - - * src/aiff.c src/wav.c src/wav_w64.c - Start work on reading/writing the SF_INSTRUMENT data. - - * src/sndfile.c - Add code to get and set SF_INSTRUMENT data. - - * tests/command_test.* tests/Makefile.am - Add test for set and getof SF_INSTRUMENT data. - The file command_test.c is no longer autogen generated. - -2005-10-15 Erik de Castro Lopo - - * src/gsm610.c - Minor cleanup. - -2005-10-14 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Minor cleanup. - -2005-10-13 Erik de Castro Lopo - - * src/*.c - Ensure sfconfig.h is included before any other header file. - - * src/file_io.c - Add comments documenting the three sections of the file. - - * src/gsm610.c - Make sure SF_FORMAT_WAVEX are handled correctly. - -2005-10-07 Erik de Castro Lopo - - * configure.ac - Add options to allow disabling of FLAC and ALSA. Suggested by Ben Greear. - -2005-09-30 Erik de Castro Lopo - - * tests/locale_test.c - Modify the way the unicode strings were encoded so that older compilers - do not complain. Thanks Axel Röbel. - - * configure.ac - Bump the version to 1.0.12 for release. - - * NEWS README Win32/config.h doc/(FAQ|index.html|command|api).html - Update version numbers. - -2005-09-26 Erik de Castro Lopo - - * src/flac.c - Fix valgrind error and minor cleanup. - -2005-09-25 Erik de Castro Lopo - - * src/(au|paf|aiff|w64|wav|svx).c - Make sure structs are initialised. - -2005-09-24 Erik de Castro Lopo - - * configure.ac - Make -Wdeclaration-after-statement work with --enable-gcc-werror configure - option. - Add -std=gnu99 (C99 plus posix style stuff like gmtime_r) to CFLAGS if the - compiler supports it. - -2005-09-23 Erik de Castro Lopo - - * configure.ac acinclude.m4 - Add -Wdeclaration-after-statement to CFLAGS if the compilers supports it. - -2005-09-22 Erik de Castro Lopo - - * tests/util.(tpl|def) - Make the test_write_*_or_die() functions const safe. - -2005-09-21 Erik de Castro Lopo - - * src/nist.c - Make sure the data offset is read from the file header. Thanks to - David A. van Leeuwen for a patch. - -2005-09-20 Erik de Castro Lopo - - * configure.ac src/sfconfig.h - Check for and the function setlocale(). - Set config variables to zero if not found. - - * tests/locale_test.c tests/Makefile.am - Add new test program and hook into build/test system. - -2005-09-18 Erik de Castro Lopo - - * src/common.h src/file_io.c - On windows, use windows specific types for file handles. - Add functions psf_init_files() and psf_use_rsrc(). - - * src/sd2.c - Make resource fork handling independant of file desciptor/handles. - - * src/sndfile.c src/test_file_io.c - Fix knock on effects. - -2005-09-06 Erik de Castro Lopo - - * src/float_cast.h - The lrint and lrintf implementations in Cygwin are both buggy and slow. - Add replacements which were pulled from the Public Domain MinGW math.h - header file. - -2005-09-05 Erik de Castro Lopo - - * tests/(lossy_comp_test|virtual_io_test).c - More Valgrind fixups. - - * configure.ac - Simplify and correct configuring for Cygwin. - - * Win32/config.h Win32/sndfile.h Win32/Makefile.msvc - Update build for MSVC. - -2005-09-04 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Make sure to close SNDFILE when exiting test when file format is not seekable. - - * tests/(aiff_rw_test|virtual_io_test).c - Do a few valgrind fix ups. - -2005-09-03 Erik de Castro Lopo - - * src/float32.c src/double64.c - Replace floating point equality comparisons with greater/less comparisons. - Found by John Pavel using the Intel compiler. - - * src/sfconfig.h - New file to clean up issues surrounding autoconf generated preprocessor - symbols. - - * src/*.(c|h) tests/*.(c|tpl) examples/*.c - Fixed a bunch of other stuff found by John Pavel using the Intel compiler. - - * src/file_io.c - Remove Mac OS9 Metrowerks compiler specific hacks. - -2005-08-31 Erik de Castro Lopo - - * src/w64.c - Cast integer literal to sf_count_t in call to psf_binheader_writef() to - prevent Valgrind error. - -2005-08-30 Erik de Castro Lopo - - * doc/command.html - Improve documentation of SF_GET_FORMAT_SUBTYPE. - -2005-08-26 Erik de Castro Lopo - - * examples/sndfile-convert.c - Allow files to be converted to SD2 format. - - * src/sd2.c - Fix a bug in reading and writing of SD2 files on little endian CPUs. - Thanks to Matthew Willis for finding this. - -2005-08-25 Erik de Castro Lopo - - * doc/api.html - Update Note2 to point to SFC_SET_SCALE_FLOAT_INT_READ. - -2005-08-16 Erik de Castro Lopo - - * configure.ac - Use $host_os instead of $target_os (thanks to Mo De Jong). - -2005-08-15 Erik de Castro Lopo - - * src/Makefile.am - Apply a patch from Mo DeJong to allow building outside of the source dir. - - * src/file_io.c - Fix psf_fsync() for win32. - - * src/wav.c src/wav_w64.(c|h) - Move some code from wav.c to wav_w64.c to improve the log output of files of - type WAVE_FORMAT_EXTENSIBLE. - -2005-08-10 Erik de Castro Lopo - - * src/create_symbols_file.py - Make sure sf_write_fsync is an exported symbol. - - * examples/sndfile-convert.c - Add support for writing VOX adpcm files. - -2005-07-31 Erik de Castro Lopo - - * doc/api.html - Document the new function sf_write_sync(). - - * doc/FAQ.html - Do you plan to support XYZ codec. - -2005-07-28 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c - Add function sf_write_sync() to the API. - - * src/common.h src/file_io.c - Low level implementation (win32 not done yet). - - * tests/write_read_test.tpl - Use the new function in the tests. - -2005-07-24 Erik de Castro Lopo - - * src/common.h src/double64.c src/float32.c src/sndfile.c - Change the way PEAK chunk info is stored. Peaks now stored as an sf_count_t - for position and a double as the value. - - * src/aiff.c src/caf.c src/wav.c - Fix knock on effects of above changes. - - * src/caf.c - Implement 'peak' chunk for file wuth data in SF_FORMAT_FLOAT or - SF_FORMAT_DOUBLE format. - -2005-07-23 Erik de Castro Lopo - - * src/nist.c - Fix a bug where a variable was being used without being initialized. - - * src/flac.c - Add extra debug in sf_flac_meta_callback. - Make a bunch of private functions static. - - * src/aiff.c src/wav.c - Fix allocation for PEAK_CHUNK (bug found using valgrind). - -2005-07-21 Erik de Castro Lopo - - * src/common.h - Move the peak_loc field of SF_PRIVATE to the PEAK_CHUNK struct. - Remove had_peak field of SF_PRIVATE, use pchunk != NULL instead. - Rename PEAK_CHUNK and PEAK_POS to PEAK_CHUNK_32 and PEAK_POS_32. - - * src/aiff.c src/caf.c src/wav.c src/float32.c src/double64.c - Fix knock on effects from above. - -2005-07-19 Erik de Castro Lopo - - * src/wav.c - Prevent files with unknown chunks from being opened read/write. - -2005-07-14 Erik de Castro Lopo - - * src/flac.c - Do not use psf->end_of_file because it never gets set to anything. - - * src/common.h - Remove unused SF_PRIVATE field end_of_file. - -2005-07-12 Erik de Castro Lopo - - * src/common.c - Change the 'S' format specifier of psf_binheader_writef() to write AIFF - style strings (no terminating character). - - * src/aiff.c - Move to new (correct) AIFF string style. Thanks to Axel Röbel for being - so persistent on this issue. - -2005-07-11 Erik de Castro Lopo - - * src/sndfile.c - Allow SFE_UNSUPPORTED_FORMAT as an error from sf_open(). - - * doc/api.html doc/command.html - Documentation updates (thanks to Kyroz for promoting these updates). - - * src/mat5.c - Modify the way the header is written. - -2005-07-10 Erik de Castro Lopo - - * src/caf.c - Add a 'free' chunk to the written file so that the audio data starts at - an offset of 0x1000. - - * src/sndfile.c - Allow SFE_UNSUPPORTED_FORMAT as an error from sf_open(). - -2005-07-09 Erik de Castro Lopo - - * src/caf.c src/sndfile.c - Add support for signed 8 bit integers. - - * tests/write_read_test.tpl - Add test for signed 8 bit integers in CAF files. - - * doc/index.html - Update matrix for signed 8 bit integers in CAF files. - -2005-07-08 Erik de Castro Lopo - - * src/sndfile.c - Update sf_check_format() to support CAF. - - * examples/sndfile-convert.c - Add support for ".caf" file extension. - - * doc/index.html - Add Apple CAF to the support matrix. - - * src/caf.c - Add file write support. - - * src/common.c - Fix printing of Frames. - - * tests/Makefile.am tests/write_read_test.tpl tests/lossy_comp_test.c - tests/header_test.tpl misc_test.c - Add tests for CAF files. - -2005-07-07 Erik de Castro Lopo - - * doc/FAQ.html - Fix Q/A about reading/writing memory buffers. - - * src/caf.c - Bunch of work to support reading of CAF files. - -2005-07-04 Erik de Castro Lopo - - * src/(aiff|ima_adpcm|mat4|mat5|ms_adpcm).c examples/sndfile-play.c - Fix sign conversion errors reported by gcc-4.0. - - * src/caf.c - New file for Apple's Core Audio File format. - - * src/sndfile.c src/common.h src/sndfile.h.in src/Makefile.am - Hook new file into build system. - -2005-06-21 Erik de Castro Lopo - - * src_wav_w64.c - Fix handling of stupidly large 'fmt ' chunks. Thanks to Vadim Berezniker - for supplying an example file. - - * src/common.h src/sndfile.c - Remove redundant error code SFE_WAV_FMT_TOO_BIG. - -2005-06-20 Erik de Castro Lopo - - * src/sndfile.h.in src/common.h src/sndfile.c - Add public error value SF_ERR_MALFORMED_FILE. - - * src/sndfile.c - When parsing a file header fails and we don't have a system error, then set - the error number to SF_ERR_MALFORMED_FILE (suggested by Kyroz). - - * configure.ac - Allow sqlite support to be disabled in configure script. - - * regtest/database.c regtest/sndfile-regtest.c - Fix compiling when sqlite is missing. - -2005-06-11 Erik de Castro Lopo - - * src/file_io.c - Fix psf_is_pipe() and return value of psf_fread() when using virtual i/o. - - * src/sndfile.c - Fix VALIDATE_AND_ASSIGN_PSF macro for virtual i/o. - - * tests/virtual_io_test.c - Fill in skeleton test program. - - * tests/Makefile.am - Move virtual i/o tests to end of tests with stdio/pipe tests. - - * src/(sndfile.h.in|file_io.c|common.h|sndfile.c) tests/virtual_io_test.c - Rename some of the virtual i/o functions and data types. - -2005-06-10 Erik de Castro Lopo - - * src/sndfile.c - Fix the return values of sf_commands : SFC_SET_NORM_DOUBLE, - SFC_SET_NORM_FLOAT, SFC_GET_LIB_VERSION and SFC_GET_LOG_INFO. Thanks to - Kyroz for pointing out these errors. - - * doc/command.html - Correct documented return values for SFC_SET_NORM_DOUBLE and - SFC_SET_NORM_FLOAT. Thanks to Kyroz again. - -2005-05-17 Erik de Castro Lopo - - * regtest/* - Add new files for sndfile-regtest program. - - * configure.ac Makefile.am - Hook regetest into build. - - * src/wav.c src/common.c - Fix a regression where long ICMT chunks were causing the WAV parser - to exit. - -2005-05-15 Erik de Castro Lopo - - * libsndfile.spec.in - Add html docs to the files section as suggested by Karsten Jeppesen. - - * src/aiff.c - Fix parsing of odd length ANNO chunks. - -2005-05-13 Erik de Castro Lopo - - * src/common.h - Change the include guard to prevent clashes with other code. - -2005-05-12 Erik de Castro Lopo - - * examples/sndfile-play.c - Improve error handling in code for playback under Linux/ALSA. - -2005-05-10 Erik de Castro Lopo - - * src/ircam.c - Fix writing of IRCAM files on big endian systems (thanks to Axel Röbel). - - * src/wav.c - Add workaround for files created by the Peak audio editor on Mac which can - produce files with very short LIST chunks (thanks to Jonathan Segel who - supplied the file). - -2005-04-30 Erik de Castro Lopo - - * src/aiff.c - Apply a patch From David Viens to make the parsing of basc chunks more - robust. - - * src/wav.c - Another patch from David Viens to write correct wavex channel masks for - the most common channel configurations. - -2005-04-08 Erik de Castro Lopo - - * src/command.c - Only allow FLAC in the format arrays if FLAC is enabled. Thanks to - Leigh Smith. - -2005-03-09 Erik de Castro Lopo - - * src/common.h - Add a directory field for storing the file directory to the SF_PRIVATE - struct. - - * src/sndfile.c - Grab the directory name when copying the file path. - - * src/file_io.c - Cleanup psf_open_rsrc() and also check for resource fork in - .AppleDouble/filename. - -2005-03-01 Erik de Castro Lopo - - * src/svx.c - Fix a bug in the printing of the channel count. Bug reported by Michael - Schwendt. Thanks. - -2005-01-26 Erik de Castro Lopo - - * src/paf.c - Fix a seek bug for 24 bit PAF files. - - * tests/write_read_test.tpl - Update write_read_test to trigger the previously hidden PAF seek bug. - -2005-01-25 Erik de Castro Lopo - - * src/aiff.c src/w64.c src/wav.c - Do not return a header parse error when the log buffer overflows. - Continuing parsing works even on files where the log buffer does overflow. - This avoids a bug on some weirdo WAV (and other) files. - - * src/common.h src/sndfile.c - Remove SFE_LOG_OVERRIN error and its associated error message. - - * src/file_io.c - Fix a rsrc fork problem on MacOSX. - -2004-12-31 Erik de Castro Lopo - - * src/sndfile-play.c - In the ALSA output code, added call to snd_pcm_drain() just before - snd_pcm_close() as suggested by Thomas Kaeding. - In the OSS output code, added two ioctls (SNDCTL_DSP_POST and - SNDCTL_DSP_SYNC) just before the close of the audio device. - - * tests/virtual_io_test.c tests/Makefile.am - Add a new test program (currently empty) and add it to the build. - -2004-12-29 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.h src/common.h src/file_io.c - src/create_symbols_file.py - Apply patch from Steve Baker which is the beginnings of a virtual - I/O interface. - -2004-12-23 Erik de Castro Lopo - - * src/*.c src/sndfile.h.in - Const-ify the write path throughout the library. - -2004-12-14 Erik de Castro Lopo - - * doc/development.html - Minor improvements. - -2004-11-29 Erik de Castro Lopo - - * doc/bugs.html - Minor improvements. - -2004-11-18 Erik de Castro Lopo - - * src/aiff.c - Add workaround for Logic Platinum AIFF files with broken COMT chunks. - -2004-11-16 Erik de Castro Lopo - - * doc/FAQ.html - Remove some ambiguities in the SD2 FAQ answer. - -2004-11-15 Erik de Castro Lopo - - * Win32/sndfile.h Win32/config.h MacOS9/sndfile.h MacOS9/config.h - Updates from autoconfig versions. - -2004-11-13 Erik de Castro Lopo - - * src/aiff.c - Fix parsing of COMT chunks. Store SF_STR_COMMENT data in ANNO chunks - instead of COMT chunk. - -2004-11-07 Erik de Castro Lopo - - * src/file_io.c src/common.h - Change the ptr argument to psf_write() from "void*" to a "const void*". - Thanks to Tobias Gehrig for suggesting this. - -2004-10-31 Erik de Castro Lopo - - * src/file_io.c src/common.h - Add functions psf_close_rsrc() and read length of resourse fork into - rsrclength field of SF_PRIVATE. - - * src/sd2.c - Make sure resource fork gets closed. - - * tests/util.tpl - Add functions to check for file descriptor leakage. - - * src/write_read_test.tpl - Use the file descriptor leak checks. - - * src/sndfile.h.in - Add SFC_GET_LOOP_INFO and SF_LOOP_INFO struct. - - * src/common.h - Add SF_LOOP_INFO pointer to SF_PRIVATE. - - * src/wav.c src/aiff.c - Improve and add parsing of 'ACID' and 'basc' chunks, filling in - SF_LOOP_INFO data in SF_PRIVATE. - -2004-10-30 Erik de Castro Lopo - - * src/sd2.c - Further cleanup: remove printfs, change snprintf to LSF_SNPRINTF. - - * Win32/config.h Win32/sndfile.h - Updates. - - * tests/util.tpl - Add win32 macro for snprintf. - -2004-10-29 Erik de Castro Lopo - - * src/sfendian.h - Add macros : H2BE_SHORT, H2BE_INT, H2LE_SHORT and H2LE_INT. - - * src/sd2.c - Use macros to make sure writing SD2 files on little endian machines works - correctly. - - * tests/util.tpl - Add a delete_file() function which also deletes the resource fork of SD2 - files. - - * tests/write_read_test.tpl - Use delete_file() so that "make distcheck" works. - -2004-10-28 Erik de Castro Lopo - - * src/sndfile.c src/file_io.c - Move resource filename construction and testing to psf_open_rsrc(). - - * src/common.h src/sndfile.c - Add error SFE_SD2_FD_DISALLOWED. - - * tests/util.tpl tests/*.(c|tpl) - Add and allow_fd parameter to test_open_file_or_die() so that use of - sf_open_fd() can be avoided when opening SD2 files. - -2004-10-27 Erik de Castro Lopo - - * src/wav.c - Update ACID chunk parsing. - - * src/sd2.c - More fixes for files with large resource forks. - -2004-10-23 Erik de Castro Lopo - - * src/common.h src/sndfile.c - Add error numbers and messages for sd2 files. - - * src/sd2.c - Reading of sd2 (resource fork version) now seems to be working. - -2004-10-17 Erik de Castro Lopo - - * src/file_io.h - Update file_io.c to include win32 psf_rsrc_open(). - - * tests/floating_point_test.tpl - Remove use of __func__ in test programs (MSVC++ doesn't grok this). - - * Win32/(config|sndfile).h MacOS9/(config|sndfile).h - Updates. - -2004-10-13 Erik de Castro Lopo - - * src/sfendian.h - Fix endswap_int64_t_(array|copy). - - * src/test_endswap.(tpl|def) - Add tests for above and inprove all tests. - -2004-10-12 Erik de Castro Lopo - - * src/sfendian.h - Improve type safety, add endswap_double_array(). - - * src/double64.c - Use endswap_double_array() instead of endswap_long_array(). - - * src/test_endswap.(tpl|def) src/Makefile.am - Add preliminary endswap tests and hook into build system. - -2004-10-06 Erik de Castro Lopo - - * src/configure.ac src/makefile.am - Finally fix the bulding of DLLs on Win32/MinGW. - - * tests/makefile.am - Fix running of tests on Win32/MinGW. - -2004-10-01 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c tests/floating_point_test.tpl - Rename SFC_SET_FLOAT_INT_MULTIPLIER to SFC_SET_SCALE_FLOAT_INT_READ. - - * doc/command.html - Document SFC_SET_SCALE_FLOAT_INT_READ. - -2004-09-30 Erik de Castro Lopo - - * tests/floating_point_test.(tpl|def) - Derived from floating_point_test.c. - Add (float|double)_(short|int)_test functions. - - * tests/util.(tpl|def) - Make separate float and double versions of gen_windowed_sine(). - - * tests/write_read_test.tpl - Fix after changes to gen_windowed_sine(). - - * src/(float32|double64).c - Implement SFC_SET_FLOAT_INT_MULTIPPLIER. - -2004-09-29 Erik de Castro Lopo - - * acinclude.m4 - Fix warnings from automake 1.8 and later. - - * examples/sndfile-info.c - Add a "fflush (stdout)" after printing Win32 message. - -2004-09-28 Erik de Castro Lopo - - * Win32/Makefile.mingw.in - Add a "make install" target. - -2004-09-24 Erik de Castro Lopo - - * src/sndfile.h.in src/common.h src/sndfile.c src/command.c - Start work on adding command SFC_SET_FLOAT_INT_MULTIPLIER. - -2004-09-22 Erik de Castro Lopo - - * examples/sndfile-convert.c - Fix a bug converting stereo integer PCM files to float. - -2004-09-22 Erik de Castro Lopo - - * examples/sndfile-play.c - Appy patch from Conrad Parker to make Mac OSX error messages more - consistent and informative. - - * doc/api.html - Fix a HTML HREF which was wrong. - - * doc/win32.html - Add information about when nmake fails. - -2004-09-05 Erik de Castro Lopo - - * examples/sndfile-play.c - Another patch from Denis Cote to prevent race conditions. - -2004-09-02 Erik de Castro Lopo - - * src/common.h src/ms_adpcm.c src/ima_adpcm.c - Fix alternative to ISO standard flexible struct array feature for broken - compilers. - -2004-08-31 Erik de Castro Lopo - - * src/common.h src/string.c src/sndfile.c - Make sf_set_string() return an error if trying to set a string when in - read mode. - -2004-08-29 Erik de Castro Lopo - - * src/common.h - Change the unnamed union into a named union so gcc-2.95 will compile it. - - * src/*.c - Fixes to allow for the above change. - -2004-08-20 Erik de Castro Lopo - - * examples/sndfile-play.c - Fixes for Win32. Thanks to Denis Cote. - - * Win32/Win32/Makefile.(msvc|mingw.in) - Fix build system after removal of sfendian.h. - Build sndfile-convert. - - * src/Makefile.am - Remove sfendian.c from dependancies. - -2004-08-10 Erik de Castro Lopo - - * src/sndfile.h.in - Fix typo in comments (thanks Tommi Sakari Uimonen). - -2004-07-31 Erik de Castro Lopo - - * tests/(a|u)law_test.c - Minor cleanup. - -2004-07-29 Erik de Castro Lopo - - * src/(pcm|float|double64|ulaw|alaw|xi).c - Optimise read/write loops by removing a redundant variable. - -2004-07-24 Erik de Castro Lopo - - * src/file_io.c - Remove call to fsync() in psf_close(). - -2004-07-19 Erik de Castro Lopo - - * src/pcm.c - Inline x2y_array() functions where possible. - - * configure.ac - Detect presence of type int64_t. - - * src/sfendian.c src/sfendian.h - Move functions in the first file to the sfendian.h as static inline - functions. - Improve endswap_long_*() where possible. - -2004-07-17 Erik de Castro Lopo - - * src/pcm.c - When converting from unsigned char to float or double, subtract 128 before - converting to float/double rather than after to save a floating point - operation as suggested by Stefan Briesenick. - - * src/(pcm|sfendian|alaw|ulaw|double64|float32).c - Optimize inner loops by changing the loop counting slightly as suggested - by Stefan Briesenick. - - * configure.ac - Detect presence of . - - * src/sfendian.h - Use if present as suggested by Stefan Briesenick. - - * src/pcm.c - Update bytewapping. - -2004-07-02 Erik de Castro Lopo - - * src/common.h src/*.c - Change the psf->buffer field of SF_PRIVATE into a more type safe union with - double, float, int etc elements. - -2004-06-28 Erik de Castro Lopo - - * examples/sndfile-play.c - Merge slightly modifed patch from Stanko Juzbasic which allows playback of - mono files on MacOSX. - -2004-06-25 Erik de Castro Lopo - - * examples/sndfile-convert.c - Move copy_metadata() after the second sf_open(). - -2004-06-21 Erik de Castro Lopo - - * examples/sndfile-convert.c - Fix a bug which caused the program to go into an infinite loop if the source - file has no meta-data. Thanks to Ron Parker for reporting this. - - * src/sndfile.h.in - Add SF_STR_FIRST and SF_STR_LAST to allow enumeration of string types. - - * Win32/sndfile.h MacOS9/sndfile.h - Update these as per the above file. - -2004-06-17 Erik de Castro Lopo - - * configure.ac src/common.h src/ogg.c src/sndfile.c src/sndfile.h.in - src/Makefile.am - Apply large patch from Conrad Parker implementing Ogg Vorbis, Ogg Speex and - Annodex support via liboggz and libfishsound. Thanks Conrad. - -2004-06-15 Erik de Castro Lopo - - * src/avr.c src/ircam.c src/nist.c src/paf.c src/xi.c - Add cast to size_t for some parameters passed to psf_binheader_writef. This - is Debian bug number 253490. Thanks to Anand Kumria and Andreas Jochens. - - * src/w64.c - Found and fixed a bug resulting from use of size_t when writing W64 'fmt ' - chunk. - -2004-06-14 Erik de Castro Lopo - - * configure.ac - Bump version to 1.0.10 ready for release. - - * Makefile.am - Remove redundant files (check_libsndfile.py libsndfile_version_convert.py) - from distribution tarball. - - * tests/header_test.tpl - Fix uninitialised variable. - - * src/GSM610/short_term.c - Fix compiler warning on MSVC++. - -2004-05-23 Erik de Castro Lopo - - * src/wav.c - Improve record keeping of chunks seen and return an error if a file with - unusual chunks is opened in mode SFM_RDWR. - - * src/mmreg.h - This file not needed so remove it. - -2004-05-22 Erik de Castro Lopo - - * tests/header_test.tpl - Add extra_header_test(). - - * src/common.h src/sndfile.c - Add SFE_RDWR_BAD_HEADER error number and string. - -2004-05-21 Erik de Castro Lopo - - * tests/utils.tpl tests/*.c tests/*.tpl - Add a line number argument to check_log_buffer_or_die() and update all - files that use that function. - - * tests/header_test.tpl - Modify/update tests for files opened SFM_RDWR and SFC_UPDATE_HEADER_AUTO. - - * src/aiff.c src/wav.c - Fix another bug in AIFF and WAV files opened in SFM_RDWR and using - SFC_UPDATE_HEADER_AUTO. - - * src/test_file_io.c - Add a test for psf_ftruncate() function. - -2004-05-19 Erik de Castro Lopo - - * src/sndfile.c - Fix another weird corner case bug found by Martin Rumori. Thanks. - - * tests/header_test.(tpl|def) - Two new files to test for the absence of the above bug and include tests - moved from tests/misc_test.c. - - * tests/Makefile.am - Hook new tests into build/test system. - - * tests/misc_test.c - Remove update_header_test() which has been moved to the new files above. - -2004-05-16 Erik de Castro Lopo - - * src/aiff.c - Fixed a bug reported by Martin Rumori on the LAD list. If a file created - with a format of SF_FORMAT_FLOAT and then closed before any data is written - to it, the header can get screwed up (PEAK chunk gets overwritten). - - * tests/write_read_test.tpl - Add a test (empty_file_test) for the above bug. - -2004-05-13 Erik de Castro Lopo - - * Win32/Makefile.mingw.in - Added a Makefile for MinGW (needs to be processed by configure). - - * src/mmsystem.h src/mmreg.h - Add files from the Wine project (under the LGPL) to allow build of - sndfile-play.exe under MinGW. - -2004-05-12 Erik de Castro Lopo - - * src/GSM610/gsm610_priv.h - Replace ugly macros with inline functions. - - * src/GSM610/*.c - Remove temporary variables used by macros and other minor fixes required by - above change. - -2004-05-10 Erik de Castro Lopo - - * tests/pipe_test.tpl tests/stdio_test.c Win32/Makefile.msvc - Make sure these programs compile (even though they do nothing) on Win32 - and add them to the "make check" target. - - * src/sfendian.h - Fix warning on Sparc CPU and code cleanup. - -2004-05-09 Erik de Castro Lopo - - * src/file_io.c - Fix warning messages when compiling under MinGW. - -2004-05-01 Erik de Castro Lopo - - * configure.ac - Set HAVE_FLEXIBLE_ARRAY in src/config.h depending on whether the compiler - accepts the flexible array struct member as per 1999 ISO C standard. - - * src/common.h src/ima_adpcm.c src/paf.c src/ms_adpcm.c - Added ugly #if HAVE_FLEXIBLE_ARRAY and provided a non-standards compliant - hack for non 1999 ISO C compliant compilers. - -2004-04-26 Erik de Castro Lopo - - * src/strings.c - If adding an SF_STR_SOFTWARE string, only append libsndfile-X.Y.Z if the - string does not already have libsndfile in the string. Thanks to Conrad - Parker. - - * tests/string_test.c - Add test to verify the above. - - * examples/sndfile-convert.c - Add ability to transcode meta data as well (Conrad Parker). - -2004-04-25 Erik de Castro Lopo - - * doc/command.html - Fix minor error. Thanks to Simon Burton. - - * doc/win32.html - Started adding instructions for compiling libsndfile under MinGW. - - * configure.ac - Add --enable-bow-docs to enable black text on a white background HTML docs. - - * doc/libsndfile.css.in - This is now a template file for configure which sets the foreground and - background colours. - -2004-04-20 Erik de Castro Lopo - - * configure.ac - Do some MinGW fixes. - - * configure.ac doc/Makefile.am - Install HTML docs when doing make install. - -2004-04-19 Erik de Castro Lopo - - * examples/sndfile-info.c - Print out the dB level with the signal max. - -2004-04-15 Erik de Castro Lopo - - * src/file_io.c - Define S_ISSOCK in src/file_io.c if required. - -2004-04-03 Erik de Castro Lopo - - * configure.ac - Improve printout configuration summary (as suggested by Axel Röbel). - - * doc/index.html - Add link to pre-release location. - - * src/sndfile.h.in - Remove comma after last element of enum. - - * src/float32.c src/double64.c - Fix read/write of float/double encoded raw files to/from pipes. - - * tests/pipe_test.c tests/pipe_test.tpl tests/pipe_test.def - Turn pipe_test.c into an autogenerated file and add tests for reading/ - writing floats and doubles. - - * tests/Makefile.am - Hook tests/pipe_test.* into build system. - -2004-04-02 Erik de Castro Lopo - - * configure.ac acinclude.m4 - Rename AC_C_STRUCT_HACK macro to AC_C99_FLEXIBLE_ARRAY. - -2004-03-31 Erik de Castro Lopo - - * tests/misc_test.c - Perform update_header_test in RDWR mode as well. - - * src/aiff.c - Fix problems when updating header in RDWR mode. - -2004-03-30 Erik de Castro Lopo - - * src/wav.c src/w64.c src/wav_w64.c - Integrate code supplied by David Viens for supporting microsoft's - WAVEFORMATEXTENSIBLE stuff. Thanks David for supplying this. - - * configure.ac doc/*.html - Bump version to 1.0.9. - -2004-03-28 Erik de Castro Lopo - - * src/command.c src/sndfile.c src/sndfile.h.in src/wav.c - Started work on supporting microsoft's WAVEFORMATEXTENSIBLE gunk. - -2004-03-26 Erik de Castro Lopo - - * src/avr.c - New file to handle Audio Visual Resaerch files. - - * src/sndfile.h.in src/common.h src/sndfile.c src/command.c - Hook AVR into everything else. - - * tests/Makefile.am tests/write_read_test.tpl tests/misc_test.c - Add testing for AVR files. - -2004-03-22 Erik de Castro Lopo - - * src/file_io.c - Fix psf_set_file() for win32. Thanks to Vincent Trussart (Plogue Art et - Technologie) for coming up with the solution. - -2004-03-21 Erik de Castro Lopo - - * tests/write_read_test.tpl - Fixed a bug that was causing valgrind to report a memory leak. The bug was - in the test code itself, not the library. - -2004-03-20 Erik de Castro Lopo - - * examples/generate.cs - An example showing how to use libsndfile from C#. Thanks to James Robson - for providing this. - -2004-03-19 Erik de Castro Lopo - - * src/common.c - Fix problems with WAV files containing large chunks after the 'data' - chunk. Thanks to Koen Tanghe for providing a sample file. - -2004-03-17 Erik de Castro Lopo - - * configure.ac - Detect presense of ALSA (Advanced Linux Sound Architecture). - - * examples/sndfile-play.c - Add ALSA output support. - - * examples/Makefile.am - Add ALSA_LIBS to link line of sndfile-play.c. - -2004-03-15 Erik de Castro Lopo - - * acinclude.m4 - Add new macro (AC_C_STRUCT_HACK) to detect whether the C compiler allows - the use of the what is known as the struct hack introduced by the 1999 ISO - C Standard. - - * configure.ac - The last release would not compile with gcc-2.95 due to the use of features - (ie struct hack) introduced by the 1999 ISO C Standard. - Add check to make sure compiler handles this and bomb out if it doesn't. - -2004-03-14 Erik de Castro Lopo - - * tests/write_read_test.tpl - Fix compiler warning on Win32. - - * src/file_io.c - Fix use of an un-initialised variable in Win32 stuff. - - * Win32/config.h examples/sndfile-play.c - Win32 fixes. - -2004-03-10 Erik de Castro Lopo - - * configure.ac - Fix bug which occurres when configuring for MinGW. - If compiler is gcc and cross compiling use -nostdinc. - -2004-03-09 Erik de Castro Lopo - - * src/common.h src/aiff.c src/wav.c src/float32.c src/double64.c - src/sndfile.c - Fix a bug with PEAK chunk handling for files with more than 16 channels. - Thanks to Remy Bruno for finding this. - -2004-03-08 Erik de Castro Lopo - - * src/common.c - Fix a bug which was preventing WAV files being openned correctly if the - file had a very large header. Thanks to Eldad Zack for finding this. - -2004-03-04 Erik de Castro Lopo - - * configure.ac src/file_io.c - Fix cross-compiling from Linux to Win32 using the MinGW tools. - -2004-03-01 Erik de Castro Lopo - - * src/create_symbols_file.sh - Christian Weisgerber pointed out that the shell script did not run on a - real Bourne shell although it did run under Bash in Bourne shell mode. - - * src/create_symbols_file.py - Rewrite of above in Python. Also add support for writing Win32 .def files. - The Python script generates Symbols.linux, Symbols.darwin and - libsndfile.def (Win32 version). These files get shipped with the tarball - so there should not be necessary to run the Python script when building - the code from the tarball. - - * configure.ac src/Makefile.am Win32/Makefile.am - Hook new Python script into the build system. - -2004-02-25 Erik de Castro Lopo - - * src/configure.ac - Add --enable-gcc-werror option and move GCC specific stuff down. - -2004-02-24 Erik de Castro Lopo - - * acinclude.m4 configure.ac - Fix clip mode detection (tested in one of HP's testdrive Itanium II boxes). - - * src/file_io.c - Added check for sizeof (off_t) != sizeof (sf_count_t) to prevent recurrence - of missing large file support on Linux and Solaris. - -2004-02-19 Erik de Castro Lopo - - * examples/sndfile-play.c - Fix a MacOSX specific bug which was caused by a space being inserted in - the middle of a file name. - - * configure.ac src/Makefile.am examples/Makefile.am - Fix a couple of MacOSX build issues. - -2004-02-17 Erik de Castro Lopo - - * doc/command.html - Document SFC_SET_CLIPPING and SFC_GET_CLIPPING. - -2004-02-14 Erik de Castro Lopo - - * doc/*.html - Applied patch from Frank Neumann (author of lakai) which fixes many minor - typos in documentation. Thanks Frank. - -2004-02-13 Erik de Castro Lopo - - * ChangeLog - Changed my email address throughout source and docs. - -2004-02-08 Erik de Castro Lopo - - * src/file_io.c - Make sure config.h is included before stdio.h to make sure large file - support is enabled on Linux (and Solaris). - - * tests/misc_test.c - Disable update_header test on Win32. This should work but doesn't and - I'm not sure why. - - * Make.bat Win32/Makefile.msvc - Updates. - -2004-01-07 Erik de Castro Lopo - - * src/common.h - Changed logindex, headindex and headend files of SF_PRIVATE from unsigned - int to int to prevent weird arithmetic bugs. - - * src/common.c src/aiff.c src/wav.c src/w64.c - Fixed compiler warnings resulting from above change. - -2004-01-06 Erik de Castro Lopo - - * src/common.c - Fixed a bug in header reader for some files with data after the sample data. - -2003-12-29 Erik de Castro Lopo - - * tests/lossy_comp_test.c tests/Makefile.am - Add tests for AIFF/IMA files. - -2003-12-26 Erik de Castro Lopo - - * src/macbinary3.c src/macos.c - Two new files required for handling SD2 files. - - * src/common.h - Add prototypes for functions in above two files. - - * src/Makefile.am - Hook new files into build system. - -2003-12-21 Erik de Castro Lopo - - * configure.ac - Add checks for mmap() and getpagesize() which might be used at some time - for faster file reads. - Add detection of MacOSX. - -2003-12-13 Erik de Castro Lopo - - * doc/FAQ.html - Minor mods to pkg-config section. - -2003-12-12 Erik de Castro Lopo - - * src/create_symbols_file.sh - Andre Pang (also known as Ozone) pointed out that on MacOSX, all non - static symbols are exported causing troubles when trying to link - libsndfile with another library which has any of the same symbols. - He fixed this by supplying the MacOSX linker with a file containing - all the public symbols so that only they would be exported and then - supplied a patch for libsndfile. - This wasn't quite ideal, because I would have to maintain two (3 if - you include Win32) separate files containing the exported symbols. - A better solution was to create this script which can generate a - Symbols file for Linux, MacoSX and any other OS that supports - minimising the number of exported symbols. - - * configure.ac src/Makefile.am - Hook the new script into the build process. - -2003-12-10 Erik de Castro Lopo - - * doc/index.html - Added comments about Steve Dekorte's SoundConverter scam. - -2003-12-07 Erik de Castro Lopo - - * src/file_io.c - Axel Röbel pointed out that on Mac OSX a pipe is not considered a fifo - (S_ISFIFO (st.st_mode) is false) but a socket (S_ISSOCK (st.st_mode) is - true). The test has therefore been changed to is S_ISREG and anything - which which does not return true for S_ISREG is considered a pipe. - -2003-11-25 Erik de Castro Lopo - - * tests/misc_test.c - Fix update_header_test to pass SDS. - - * src/sds.c - More minor fixes. - - * tests/floating_point_test.c - Add test for SDS files. - - * src/command.c - Add SDS to major_formats array. - -2003-11-24 Erik de Castro Lopo - - * tests/write_read_test.tpl tests/misc_test.c - Add tests for SDS files. - - * src/sds.c - Fix a bug in header update code. - -2003-11-23 Erik de Castro Lopo - - * src/sds.c - Get file write working. - - * src/paf.c - Fix a potential bug in paf24_seek(). - -2003-11-04 Erik de Castro Lopo - - * doc/FAQ.html - Add Q/A about u-law encoded WAV files. - - * Win32/*.h - Updated so it compiles on Win32. - -2003-11-03 Erik de Castro Lopo - - * examples/sndfile-convert.c - Add -alaw and -ulaw command line arguments. - - * configure.ac - Add library versioning comments. - Add arguments to AC_INIT. - -2003-10-28 Erik de Castro Lopo - - * src/file_io.c - Ross Bencina has contributed code to replace all of the (mostly broken) - Win32 POSIX emulation calls with calls the native Win32 file I/O API. - This code still needs testing but is likely to be a huge improvemnt - of support for Win32. Thanks Ross. - -2003-10-27 Erik de Castro Lopo - - * src/dwvw.c - Removed filedes field from the DWVW_PRIVATE struct. - - * src/file_io.c - Change psf_fopen() so it returns psf->error instead of the file descriptor. - Add new functions psf_set_stdio() and psf_set_file(). - - * src/sndfile.c - Change these to work with changed psf_fopen() return value. - Remove all uses of psf->filedes from sndfile, making it easier to slot native - Win32 API file handling functions. - - * src/test_file_io.c - Minor changes to make it compile with new file_io.c stuff. - -2003-10-26 Erik de Castro Lopo - - * src/gsm610.h - Rename a variable from true to true_flag. As Ross Bencina points out, - true is defined in the C99 header . - - * src/file_io.c - If fstat() fails, return SF_TRUE instead of -1 (Ross Bencina). - -2003-10-09 Erik de Castro Lopo - - * src/common.h - Increase the size of SF_BUFFER_LEN and SF_HEADER_LEN. - - * src/sndfile.c - Fix sf_read/write_raw which were dividing by psf->bytwidth and - psf->blockwidth which can both be zero. - - * examples/sndfile-info.c - Increase size of BUFFER_LEN. - -2003-09-21 Erik de Castro Lopo - - * configure.ac - Add checks for and ssize_t. - Other Win32/MinGW checks. - - * src/aiff.c src/au_g72x.c src/file_io.c src/gsm610.c src/interleave.c - src/paf.c src/sds.c src/svx.c src/voc.c src/w64.c src/wav.c src/xi.c - Fix compiler warnings. - -2003-09-20 Erik de Castro Lopo - - * tests/scale_clip_test.tpl - Add definition of M_PI if needed. - -2003-09-19 Erik de Castro Lopo - - * configure.ac - Detect if S_IRGRP is declared in . - - * src/file_io.c tests/*.tpl tests/*.c - More fixes for Win32/MSVC++ and MinGW. MinGW does have but that - file doesn't declare S_IRGRP. - -2003-10-18 Erik de Castro Lopo - - * src/config.h.in - Add comment stating that the sf_count_t typedef is determined when - libsndfile is being compiled. - - * tests/utils.tpl - Modified so that utils.c gets one copy of the GPL and not two. - - -2003-09-17 Erik de Castro Lopo - - * Win32/unistd.h src/sf_unistd.h - Move first file to the second. This will help for Win32/MSVC++ and MinGW. - - * Win32/Makefile.am src/Makefile.am - Changed in line with above. - - * Win32/Makefile.msvc - Removed "/I Win32" which is no longer required. - - * src/file_io.c src/test_file_io.c tests/*.tpl tests/*.c - If HAVE_UNISTD_H include else include . This should - work for Win32, MinGW and other fakes Unix-like OSes. - - * src/*.c - Removed #include from files which didn't need it. - -2003-09-16 Erik de Castro Lopo - - * libsndfile.spec.in - Apply fix from Andrew Schultz. - -2003-09-07 Erik de Castro Lopo - - * src/vox_adpcm.c - Only set psf->sf.samplerate if the existing value is invalid. - -2003-09-06 Erik de Castro Lopo - - * examples/sndfile-play.c - Started adding support for ALSA output. - -2003-09-04 Erik de Castro Lopo - - * src/sndfile.h.in - Removed from sndfile.h. - - * src/*.c examples/*.c tests/*.c tests/*.tpl - Added where needed. - -2003-09-02 Erik de Castro Lopo - - * src/common.h - Added ARRAY_LEN, SF_MAX and SF_MIN macros. - -2003-08-19 Erik de Castro Lopo - - * doc/index.html - Remove statements about alternative licensing arrangements. - -2003-08-17 Erik de Castro Lopo - - * MacOS MacOS9 Makefile.am configure.ac - Change directory name from MacOS to MacOS9 - - * MacOS9/MacOS9-readme.txt - Change name to make it really obvious, add text to top of file to make it - still more obvious again. - -2003-08-16 Erik de Castro Lopo - - * src/test_log_printf.c - Add tests for %u conversions. - - * src/common.c - Fix psf_log_printf() %u conversions. - -2003-08-15 Erik de Castro Lopo - - * src/aiff.c - Fixed a bug where opening a file with a non-trival header in SFM_RDWR mode - would over-write part of the header. Thanks to Axel Röbel for pointing - this out. Axel also provided a patch to fix this but I came up with a - neater and more general solution. - Return error when openning an AIFF file with data after the SSND chunk - (Thanks Axel Röbel). - - * tests/aiff_rw_test.c - Improvements to test program which will later allow it to be generalised to - test WAV, SVX and others as required. - -2003-08-14 Erik de Castro Lopo - - * tests/pipe_test.c - Add useek_pipe_rw_test() submitted by Russell Francis. - - * src/sndfile.c - In sf_open_fd(), check if input file descriptor is a pipe. - - * src/sndfile.[ch] - Fix typo in variable name do_not_close_descriptor. - -2003-08-13 Erik de Castro Lopo - - * src/test_log_printf.c - Improve the tests for %d and %s conversions. - - * src/common.c - Fixed a few problems in psf_log_printf() found using new tests. - -2003-08-06 Erik de Castro Lopo - - * configure.ac - Add -Wwrite-strings warning to CFLAGS if the compiler is GCC. Thanks to - Peter Miller (Aegis author) for suggesting this and supplying a patch. - - * src/*.c examples/*.c tests/*.c - Fix all compiler warnings arising from the above. - -2003-08-02 Erik de Castro Lopo - - * tests/aiff_rw_test.c tests/Makefile.am - New test program to check for errors re-writing the headers of AIFC files - opened in mode SFM_RDWR. - -2003-07-21 Erik de Castro Lopo - - * examples/sndfile-play.c - Applied a patch from Tero Pelander to allow this program to run on systems - using devfs which used /dev/sound/dsp instead of /dev/dsp. - -2003-07-11 Erik de Castro Lopo - - * doc/new_file_type.HOWTO - Updated document. Still incomplete. - -2003-06-29 Erik de Castro Lopo - - * src/sndfile.c - Fix VALIDATE_SNDFILE_AND_ASSIGN_PSF which was returning an error rather - than saving it and returning zero. - -2003-06-25 Erik de Castro Lopo - - * src/file_io.c - Two fixes for Mac OS9. - Fix all casts from sf_count_t to ssize_t (not size_t). - -2003-06-22 Erik de Castro Lopo - - * src/wav.c - Fix for reading files with RIFF length of 8 and data length of 0. - -2003-06-14 Erik de Castro Lopo - - * src/*.c tests/*.c tests/*.tpl - Added comments to mark code for removal when make Lite version of - libsndfile. - -2003-06-09 Erik de Castro Lopo - - * examples/sndfile-convert.c - Add extra error checking for unrecognised arguments. - -2003-06-08 Erik de Castro Lopo - - * src/ima_adpcm.c - Started adding code to write IMA ADPCM encoded AIFF files. - - * src/test_log_printf.c src/Makefile.am - New file to test psf_log_printf() function and add hooks into build system. - - * src/common.c - Move psf_log_printf() function to top of the file and only compile the rest - of the file if if PSF_LOG_PRINTF_ONLY is not defined. - -2003-06-03 Erik de Castro Lopo - - * Win32/config.h Win32/sndfile.h - Updated with new config variables. - - * Win32/unistd.h src/file_io.c - Added implementation of S_ISFIFO macro which Win32 seems to lack and is - used in src/file_io.c. - - * tests/utils.tpl - Added #include to pull in Win32/unistd.h so it compiles for - Win32. - - * src/Makefile.msvc - Added src\test_file_io.exe build target and run this as the very first - test. - - * tests/win32_test.c - Add support for testing Cygwin32. - - * configure.ac - Detect POSIX fsync() and fdatasync() functions. - - * src/file_io.c - If compiling for Cygwin, call fsync() before calling fstat() to retrieve - file length. - - * tests/pcm_test.tpl - Add a test for lrintf() function. This was required to detect a really - broken lrint() and lrintf() on Cygwin. - - * tests/misc_test.c - Don't run permission test when compiling under Cygwin. - - * src/float_cast.h - Fix fallback macro for lrint() and lrintf() to cast to long instead of int - to match official function prototypes. - -2003-06-02 Erik de Castro Lopo - - * examples/sndfile-convert.c - Modifications to improve accuracy of conversions; use double data for - floating point and int for everything else. - - * src/ima_apdcm.c - Completed work on decoding IMA ADPCM encoded AIFF files. Still need to - get encoding working. - -2003-05-28 Erik de Castro Lopo - - * src/aiff.c src/ima_adpcm.c - Start working on getting IMA ADPCM encoded AIFF files working. - -2003-05-27 Erik de Castro Lopo - - * configure.ac - Fixed the touch command for when the autogen program is not found (Matt - Flax). - - * src/ulaw.c src/alaw.c - Made these pipe-able. - -2003-05-24 Erik de Castro Lopo - - * src/paf.c src/ircam.c - Fixed writing to pipe. - - * src/wav.c src/aiff.c src/nist.c src/mat*.c src/svx.c src/w64.c - Return SFE_NO_PIPE_WRITE if an attempt is made to write to a pipe. - -2003-05-23 Erik de Castro Lopo - - * examples/sndfile-info.c - Modified to detect unknown file lengths. - - * src/mat4.c - Fix reading from a pipe. - -2003-05-22 Erik de Castro Lopo - - * tests/pipe_test.c - Add more file types to tests. - - * src/mat4.c - Removed explicit setting of psf->sf.seekable to SF_TRUE. - - * tests/utils.tpl - Add macro for generating and check data in the stdio and pipe tests. - - * tests/stdout_test.c tests/stdin_test.c - Use the above macro to generate known data on output and check data on - input. - - * src/voc.c src/htk.c common.h sndfile.c - Disallow reading/writing VOC and HTK files from/to pipes be returning new - error values. - - * src/w64.c - Fixes to allow reading from a pipe. - -2003-05-21 Erik de Castro Lopo - - * configure.ac src/sndfile.h.in - When the configure script determines the sizeof (sf_count_t), also set the - value of SF_COUNT_MAX in sndfile.h. - - * configure.ac - Remove -pedantic flag from default GCC compiler flags. - - * tests/pipe_test.c - Add a pipe_read_test() before doing pipe_write_test(). - - * tests/scale_clip_test.c - Add test to make sure non-normalized values also clip in the right way. - -2003-05-18 Erik de Castro Lopo - - * configure.ac - Add test to detect processor clipping capabilities. - - * tests/stdin_test.c tests/stdout_test.c - Fix a pair of compiler warnings. - - * src/common.h - Add new pipeoffset field to SF_PRIVATE. This will contain the current file - offset when operating on a pipe. - - * src/common.c - Removed direct calls to psf_fread()/psf_fseek()/psf_fgets() etc from - psf_binheader_readf and redirect them to new buffered versions - header_read(), header_seek() and header_gets(). - Add "G" format specifier to emulate fgets() functionality with buffering. - This will allow reading some file types from pipes. - - * src/file_io.c - When the file descriptor is a pipe, manintain psf->pipeoffset. - - * src/pvf.c - Change use of psf_fgets() to psf_binheader_readf() as required but changes to header re - - * src/au.c - Fix reading from a pipe. - -2003-05-17 Erik de Castro Lopo - - * src/pcm.c - Add clipping versions of the f2XXX_array() functions to allow option of - clipping data that would otherwise overflow. - - * tests/scale_clip_test.tpl tests/scale_clip_test.def - New files test that clipping option does actually work. - -2003-05-14 Erik de Castro Lopo - - * doc/index.html - Fixed a typo ("OS(" instead of "OS9"). - -2003-05-13 Erik de Castro Lopo - - * tests/open_fail_test.c - Include to prevent warning message of missing declaration of - memset(). - -2003-05-12 Erik de Castro Lopo - - * src/common.h - Add new "add_clipping" field to SF_PRIVATE. - - * src/sndfile.h.in src/sndfile.c - Add command SFC_SET_CLIPPING which sets/resets add_clipping field. - -2003-05-11 Erik de Castro Lopo - - * doc/api.html - Add docs for sf_set_string() and sf_get_string(). - - * src/common.h src/sndfile.c - Add new SFE_STR_BAD_STRING error. - - * tests/stdin_test.c tests/stdout_test.c - Removed all non-error print statements. - - * tests/stdio_test.c tests/pipe_test.c tests/Makefile.am - Add print statements removed from two files above. - -2003-05-10 Erik de Castro Lopo - - * libsndfile.spec.in - Fixed a coulpe of minor errors discovered by someone calling themselves - Agent Smith. - - * src/common.c src/common.h src/file_io.h - Added is_pipe field to SF_PRIVATE and declaration of psf_is_pipe() - function. (Axel Röbel) - - * src/sndfile.c - Fixed determination of whether the file is a pipe. (Axel Röbel) - - * src/paf.c - Force paf24 to start with undefined mode. (Axel Röbel) - - * tests/pipe_test.c - Mods to make this test work and actually do the test on RAW files. (Axel - Röbel). - -2003-05-05 Erik de Castro Lopo - - * src/sndfile.c - Fixed a potential bug where psf->sf.seekable was being set to FALSE when - operating on stdin or stdout but then the default initialiser was reseting - it to TRUE. Thanks to Axel Röbel. - - * src/aiff.c - Fixed a bug in the header parser where it was not handling an odd length - COMM chunk correctly. Thanks to Axel Röbel. - - * src/test_file_io.c - Add more tests. - - * tests/win32_test.c - New file for showing the bugs in the Win32 implementation of the POSIX API. - It also runs on Linux for sanity checking. - - * tests/Makefile.am Win32/Makefile.msvc - Hook the new test program into the build system. - -2003-05-04 Erik de Castro Lopo - - * src/test_file_io.c - New test program to test operation of functions defined in file_io.c. This - should make supporting win32 significantly easier. - - * src/Makefile.am - Hook new test program into the build system. - - * src/file_io.c - Add compile/run time check that sizeof statbuf.st_size and sf_count_t are - the same. - - * src/common.h src/sndfile.c - Added new error code and error message for new check. - - * tests/benchmark.tpl - Fix to use frames instead of samples in SF_INFO. - -2003-05-03 Erik de Castro Lopo - - * src/file_io.c - More stuffing about working around PLAIN OLD-FASHIONED **BUGS** in Win32. - - * examples/sndfile-info.c - Applied patch from Conrad Parker to add "--help" and "-h" options as - well as an improved usage message. - -2003-05-02 Erik de Castro Lopo - - * src/au.c - Added embedded file support. - - * tests/multi_file_test.c - Added tests for embedded AU files. - Added verbose testing mode. - - * src/common.h src/sndfile.c - Added an embedded AU specific error code and message. - - * src/wav.c - Added patch from Conrad Parker which filled in a little more information - about ACIDized WAV files. - -2003-04-30 Erik de Castro Lopo - - * src/file_io.c - Fixed Win32 version of psf_fseek() which was calling psf_get_filelen() - which was in turn calling psf_fseek() which in the end blew the stack. - Now of course this would have been easy to find on Linux, but this blow - up was happening in kernel32.dll and the fscking MSVC++ debugger couldn't - figure out what call caused this (it couldn't even tell me the stack had - overflowed) and was absolutley useless for this debugging exercise. - On top of that, the reason I got into this mess was that windoze doesn't - have a working fstat() function which can return file lengths > 2 Gig. It - HAS a fscking _fstati64() but the file length value is only updated AFTER - the bloody file is closed. That makes it completely useless. - How the hell do people stand working on this crap excuse of an OS? - -2003-04-29 Erik de Castro Lopo - - * Win32/unistd.h src/file_io.c - Moved definitions of S_IGRP etc from file_io.c to unistd.h so that these - can be used in the test programs. - - * Win32/libsndfile.def - Added sf_open_fd. - - * Win32/sndfile.h - Updated to match src/sndfile.h.in. - - * Win32/Makefile.msvc - Added dither.c and htk.c to libsndfile.dll target. - -2003-04-28 Erik de Castro Lopo - - * src/file_io.c - First attempt at getting the Win32 versions of the these functions working. - They still need to be tested. - -2003-04-27 Erik de Castro Lopo - - * src/strings.c - Found and fixed a bug which was causing psf_store_string() to fail on - Motorola 68k processors. Many thanks fo Joshua Haberman (Debian maintainer - of libsndfile) for compiling and running debug code to help me debug the - problem. - -2003-04-26 Erik de Castro Lopo - - * src/sndfile.c src/file_io.c src/wav.c src/aiff.c - Much hacking to get reading and writing of embedded files working (ie sound - files at a non-zero files offset). - - * doc/embedded_files.html - First pass atempt at documenting reading/writing embedded files. - -2003-04-21 Erik de Castro Lopo - - * doc/FAQ.html - Updated answer to "Why doesn't libsndfile do interleaving/de-interleaving?" - -2003-04-19 Erik de Castro Lopo - - * src/wav.c src/aiff.c - Fix retrieving and storing of string data from files. Need to be careful - about using psf->buffer for strings. - -2003-04-18 Erik de Castro Lopo - - * src/file_io.c - Fix psf_fseek() for seeks withing embedded files. - -2003-04-15 Erik de Castro Lopo - - * src/sndfile.h.in - Changed the definition of SNDFILE slightly to produce warnings when it isn't - used correctly. This should have zero affect in code which uses the SNDFILE - type correctly. - - * src/sndfile.c - Fixed a few compiler warnings cause by the changes to the SNDFILE type. - -2003-04-12 Erik de Castro Lopo - - * doc/FAQ.html - Added question and answer to the question "How about adding the ability - to write/read sound files to/from memory buffers?". - -2003-04-08 Erik de Castro Lopo - - * tests/write_read_test.tpl - Removed un-needed enums declaring TRUE and FALSE and replaced usage of - these with SF_TRUE and SF_FALSE. - - * tests/multi_file_test.c - New test program to test sf_open_fd() on files containing data other than - a single sound file. - -2003-04-06 Erik de Castro Lopo - - * src/file_io.c - When creating files, set the readable by others flag. This still allows - further restrictions to be enforced by use of the user's umask. Fix - suggested by Eric Lyon. - -2003-04-05 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c - Changed sf_open_fd(). Dropped offset parameter and added a close_desc - parameter. If close desc is TRUE, the file descritpor passed into the - library will be closed when sf_close() is called. - - * tests/utils.tpl - Modified call to sf_open_fd() to set close_desc parameter to SF_TRUE. - -2003-04-04 Erik de Castro Lopo - - * tests/write_read_test.tpl - Add a string (using sf_set_string() function) before and after data section - of all files. This will make sure that if string data can be added, it - doesn't overwrite real audio data. - -2003-04-02 Erik de Castro Lopo - - * src/sndfile.c - Started work on supporting a non-zero offset parameter for sf_open_fd (). - - * src/.c - Removed many uses of psf_fseek (SEEK_END) which to allow for future use of - sf_open_fd() with non-zero offset. - Associated refactoring. - - * src/aiff.c - Implemented functionality required to get sf_get_string() and - sf_set_string() working for AIFF files. - -2003-04-01 Erik de Castro Lopo - - * tests/utils.tpl - Modified test_open_file_or_die() to alternately use sf_open() and - sf_open_fd(). - - * src/svx.c - Fixed a bug which occurred when openning an existing file for read/write - using sf_open_fd(). In this case, the existing NAME chunk needs to be - read into psf->filename. - Fixed printing of sf_count_t types to logbuffer. - -2003-03-31 Erik de Castro Lopo - - * src/sndfile.h.in - Added prototype for new function sf_open_fd(). - - * src/sndfile.c - Moved most of the code in sf_open() to a new function psf_open_file(). - Created new function sf_open_fd() which also uses psf_open_file() but - does not currently support the offset parameter. - - * doc/api.html - Document sf_open_fd(). - -2003-03-09 Erik de Castro Lopo - - * src/sndfile.c - Fixed a memory leak reported by Evgeny Karpov. Memory leak only occurred - when an attempt was made to read and the open() call fails. - -2003-03-08 Erik de Castro Lopo - - * tests/open_fail_test.c - New test program to check for memory leaks when sf_open fails on a valid - file. Currently this must be run manually under valgrid. - - * tests/Makefile.am - Hook new test program into build. - -2003-03-03 Erik de Castro Lopo - - * Octave/sndfile_save.m Octave/sndfile_play.m - Added a -mat-binary option to the octave save command to force the output - to binary mode even if the user has set ascii data as the default. Found - by Christopher Moore. - -2003-02-27 Erik de Castro Lopo - - * doc/dither.html - New file which will document the interface which allows the addition of - audio dither when sample word sizes are being reduced. - - * src/dither.c - More work. - -2003-02-26 Erik de Castro Lopo - - * tests/misc_test.c - In update_header_test(), make HTK files a special case. - - * doc/index.html - Added HTK to the feature matrix. - -2003-02-25 Erik de Castro Lopo - - * src/htk.c - New file for reading/writing HMM Tool Kit files. - - * src/sndfile.h.in src/sndfile.c src/command.c src/Makefile.am - Hook in htk.c - - * tests/write_read_test.tpl tests/misc_test.c tests/Makefile.am - Add tests for HTK files. - -2003-02-22 Erik de Castro Lopo - - * src/wav.c - Fixed a bug where the LIST chunk length was being written incorrectly. - - * tests/string_test.c - Added call to check_log_buffer(). - Minor cleanups. - -2003-02-10 Erik de Castro Lopo - - * src/wav_w64.h - Applied patch from Antoine Mathys to add extra WAV format definitions and - a G72x_ADPCM_WAV_FMT struct definition. - - * src/wav_w64.c - Applied patch from Antoine Mathys which converts wav_w64_format_str() from - one huge inefficient switch statement to a binary search. - - * tests/string_test.c - Dump log buffer if tests fail. - -2003-02-07 Erik de Castro Lopo - - * tests/string_test.c - David Viens supplied some modifications to this file which showed up a bug - when using sf_set_string() and the sf_writef_float() functions. - - * src/sndfile.c - Fixed the above bug. - -2003-02-06 Erik de Castro Lopo - - * doc/FAQ.html - Added Q and A on how to detect libsndfile in configure.in (at the suggestion - of Davy Durham). - -2003-02-05 Erik de Castro Lopo - - * src/sndfile.h.in - Add enums and typedefs for dither. - Deprecate SFC_SET_ADD_DITHER_ON_WRITE and SFC_SET_ADD_DITHER_ON_READ, to be - replaced with SFC_SET_DITHER_ON_WRITE and SFC_SET_DITHER_ON_READ which will - allow different dither algorithms to be enabled. - Added SFC_GET_DITHER_INFO_COUNT and SFC_GET_DITHER_INFO. - - * src/sndfile.h.in src/Version_script.in Win32/libsndfile.def. - Added public sf_dither_*() functions. - - * src/sndfile.c - Implement commands above. - - * src/dither.c - More work. Framework and external hooks into dither algorithms complete. - -2003-02-03 Erik de Castro Lopo - - * doc/version-1.html libsndfile_version_convert.py - Remove redundant files. - - * doc/index.html doc/api.html - Remove links to version-1.html. - - * src/dither.c - New file to allow the addition of audio dither on input and output. - - * src/common.h - Add prototype for dither_init() function. - - * Makefile.am doc/Makefile.am - Changes for added and removed files. - -2003-02-02 Erik de Castro Lopo - - * Win32/Makefile.msvc - Changes to force example binaries to be placed in the top level directory - instead of the examples/ directory. - Add src/strings.c and src/xi.c to the build. - Add string_test to build and to tests on WAV files. - - * doc/index.html - Added XI to support matrix. - -2003-01-27 Erik de Castro Lopo - - * src/sndfile.h.in - Added prototypes for sf_get_string() and sf_set_string() and SF_STR_* - enum values. - - * src/sndfile.c - Added public interface to sf_get_string() and sf_set_string(). - - * src/wav.c - Added code for setting and getting strings in WAV files. - - * tests/string_test.c - New test program for sf_get_string() and sf_set_string() functionality. - - * tests/Makefile.am - Hook new test program into build and test framework. - -2003-01-26 Erik de Castro Lopo - - * src/common.h - Added fields to SF_PRIVATE for string data needed to implement - sf_get_string() and sf_set_string(). - - * src/strings.c - New file for storing and retrieving strings to/from files. - - * src/Makefile.am - Added strings.c to build. - -2003-01-25 Erik de Castro Lopo - - * src/xi.c - Read seems to be working so looking at write. - - * src/sndfile.h.in - Added SF_FORMAT_XI, SF_FORMAT_DPCM_8 and SF_FORMAT_DPCM_16 enum values. - - * tests/floating_point_test.c tests/lossy_comp_test.c tests/Makefile.am - Added test for 8 and 16 bit XI format files. - -2003-01-24 Erik de Castro Lopo - - * doc/index.html - Added a non-lawyer readable summary of the licensing provisions as - suggested by Steve Dekorte. - -2003-01-23 Erik de Castro Lopo - - * src/wav.c - Fixed a compiler warning found by Alexander Lerch. - -2003-01-18 Erik de Castro Lopo - - * configure.ac - Fixed the multiple linking of libm. - -2003-01-17 Erik de Castro Lopo - - * Win32/Makefile.mcvs - Added comments on the correct way to set up the MSVCDir environment - variable. - - * doc/win32.html - Add on how to set up the MSVCDir environment variable. - -2003-01-15 Erik de Castro Lopo - - * examples/sndfile-play.c examples/sndfile-info.c - When run on Win32 without any command line parameters print a message and - then sleep for 5 seconds. This means the when somebody double clicks on - these programs in explorer the user will actually see the message. - -2003-01-14 Erik de Castro Lopo - - * tests/misc_test.c - Bypass permission test if running as root because root is allowed to open - a readonly file for write. - -2003-01-08 Erik de Castro Lopo - - * Win32/Makefile.msvc - Added pvf.c and xi.c source files to project. - - * src/sndfile.h - Updated for PVF files. - -2003-01-07 Erik de Castro Lopo - - * src/sndfile.c - Modified validate_sfinfo() to force samplerate, channels and sections - to be >= 1. - In format_from_extension() replaced calls to does_extension_match() - with strcmp(). - - * src/xi.c - More work. - -2003-01-06 Erik de Castro Lopo - - * doc/Makefile.am - Added octave.html which had been left out. Found by Jan Weil. - -2003-01-05 Erik de Castro Lopo - - * src/pvf.c src/common.h src/sndfile.c - Fixed error handling for PVF files. - - * src/xi.c - New file for handling Fasttracker 2 Extended Instrument files. Not working - yet and included when configured with --enable-experimental. - - * src/sndfile.c src/common.h - Hooked in new file xi.c. - -2002-12-30 Erik de Castro Lopo - - * src/rx2.c - Added a patch from Marek Peteraj which sheds a little more light on the - slices within an RX2 file. Still need to find out data encoding. - -2002-12-20 Erik de Castro Lopo - - * src/wav.c - Started work on decoding 'acid' and 'strc' chunks. - -2002-12-14 Erik de Castro Lopo - - * tests/peak_check_test.c - Minor cleanup. - -2002-12-12 Erik de Castro Lopo - - * tests/write_read_test.tpl - Added check to make sure no error was generated when an attempt was made to - read past the end of the file. - -2002-12-11 Erik de Castro Lopo - - * doc/lists.html - Added "mailto" links for all three lists. - - * src/pvf.c - New file for Portable Voice Format files. - - * src/sndfile.h.in src/sndfile.c src/common.h src/command.c src/Makefile.am - Added hooks for SF_FORMAT_PVF format files. - - * tests/write_read_test.tpl tests/std*.c - Add tests for SF_FORMAT_PVF. - - * doc/index.html - Add PVF to the compatibility matrix. - - * src/pcm.c src/alaw.c src/ulaw.c src/float32.c src/double64.c - Previously, attempts to read beyond the end of a file would set psf->error - to SFE_SHORT_ERROR. This behaviour diverged from the behaviour of the POSIX - read() call but has now been fixed. - Attempts to read beyond the end of the file will return a short read count - but will not longer set any error. - -2002-12-09 Erik de Castro Lopo - - * src/sndfile.c - Add more sanity checking when opening a RAW file for read. When format is - not RAW, zero out all members of the SF_INFO struct. - - * tests/raw_test.c - Add bad_raw_test() to check for above problem. - - * tests/stdin_test.c examples/sndfile-info.c - Set the format field of the SF_INFO struct to zero before calling - sf_open(). - - * doc/api.html - Add information about the need to set the format field of the SF_INFO struct - to zero when opening non-RAW files for read. - - * configure.ac - Removed use of conversion script on Solaris. Not all Solaris versions - support it. - - * doc/lists.html - New file containg details of the mailing lists. - - * doc/index.html - Add a link to the above new file. - -2002-12-04 Erik de Castro Lopo - - * tests/dft_cmp.c - Fixed a SIGFPE on Alpha caused by a log10 (0.0). Thanks to Joshua Haberman - for providing the gdb traceback. - -2002-11-28 Erik de Castro Lopo - - * src/wav.c - Added more capabilities to 'smpl' chunk parser. - - * src/sndfile.c - Fixed some (not all) possible problems found with Flawfinder. - -2002-11-24 Erik de Castro Lopo - - * src/sndfile.c - Fixed a bug in sf_seek(). This bug could only occur when an attempt was - made to read beyond the end and then sf_seek() was called with a whence - parameter of SEEK_CUR. - - * src/file_io.c - Win32's _fstati64() does not work, it returns BS. Re-implemented - psf_get_filelen() in terms of psf_fseek(). - - * tests/write_read_test.tpl - Add a test to detect above bug. - - * src/float_cast.h - Modification to prevent compiler warnings on Mac OS X. - - * src/file_io.c - Fixes for windows (what a f**ked OS). - -2002-11-08 Erik de Castro Lopo - - * configure.ac - Disable use of native lrint()/lrintf() on Mac OSX. These functions exist on - Mac OSX 10.2 but not on 10.1. Forcing the use of the versions in - src/float_cast.h means that a library compiled on 10.2 will still work on - 10.1. - -2002-11-06 Erik de Castro Lopo - - * configure.in configure.ac - Renamed configure.in to configure.ac as expected by later versions of - autoconf. - Slight hacking of configure.ac to work with version 2.54 of autoconf. - Changed to using -dumpversion instead of --version for determining GCC - version numer as suggested by Anand Kumria. - - * src/G72x/Makefile.am - Slight hacking required for operation with automake 1.6.3. - -2002-11-05 Erik de Castro Lopo - - * src/common.c - In psf_binheader_readf() changed type parameter type "b" type from size_t - to int to prevent errors on IA64 CPU where sizeof (size_t) != sizeof (int). - Thanks to Enrique Robledo Arnuncio for debugging this. - -2002-11-04 Erik de Castro Lopo - - * test/command_test.tpl - Changed test value so test would pass on Solaris. - - * src/Version_script.in - Modified version numbering so that later versions of 1.0.X can replace - earlier versions without recompilation. - - * src/vox_adpcm.c - Fixed bug causing short reads. - -2002-11-03 Erik de Castro Lopo - - * test/floating_point_test.c - Code cleanup using functions from util.c. - Add test for IEEE replacement floats and doubles. - -2002-11-01 Erik de Castro Lopo - - * src/wav.c - Fixed a possible divide by zero error when read the 'smpl' chunk. Thanks to - Serg Repalov for the example file. - - * tests/pcm_test.tpl - Used sf_command (SFC_TEST_IEEE_FLOAT_REPLACE) to test IEEE replacement code. - Clean up pcm_double_test(). - - * src/float32.c src/double64.c - Force use of IEEE replacement code using psf->ieee_replace is TRUE, - Print message to log_buffer as well. - Rename all broken_read_* and broken_write* functions to replace_read_* and - replace_write_*. - - * tests/util.tpl - Added string_in_log_buffer(). - - * tests/pcm_test.tpl - Use string_in_log_buffer() to ensure that IEEE replacement code has been - used. - - * configure.in - Removed --enable-force-broken-float option. IEEE replacement code is now - always tested. - -2002-10-31 Erik de Castro Lopo - - * src/double64.c - Implement code for read/writing IEEE doubles on platforms where the native - double format is not IEEE. - - * src/float32.c src/common.h - Remove float32_read() and float32_write(). Replace with float32_le_read(), - float32_be_read(), float32_le_write() and float32_be_write() to match stuff - in src/double64.c. - - * src/common.c - Fix all usage of float32_write(). - - * src/sndfile.h.in - Added SFC_TEST_IEEE_FLOAT_REPLACE command (testing only). - - * src/common.h - Added SF_PRIVATE field ieee_replace. - - * src/sndfile.c - In sf_command() set/reset psf->ieee_replace. - -2002-10-26 Erik de Castro Lopo - - * tests/pcm_test.tpl - Fixed a problem when testing with --enable-force-broken-float. The test was - generating a value of negative zero and the broken float code is not able - to write negative zero. Removing the negative zero fixed the test. - -2002-10-25 Erik de Castro Lopo - - * src/file_io.c - Added fix for Cygwin (suggested by Maros Michalik). - -2002-10-23 Erik de Castro Lopo - - * src/file_io.c - Improved error detection and handling. - - * src/file_io.c src/common.h - Removed functions psf_ferror() and psf_clearerr() which were redundant - after above improvements. - - * src/aiff.c src/svx.c src/w64.c src/wav.c - Removed all use of psf_ferror() and psf_clearerr(). - - * src/sndfile.c - Removed #include of , , and which - are no longer needed. - - * tests/misc_test.c - Added test to make sure the correct error message is returned with an - existing read-only file is openned for write. - -2002-10-21 Erik de Castro Lopo - - * doc/index.html doc/api.html - Updated for OKI Dialogic ADPCM files. - - * src/command.c - Added VOX ADPCM to sub_fomats. - -2002-10-20 Erik de Castro Lopo - - * src/vox_adpcm.c src/Makefile.am - New file for handling OKI Dialogic ADPCM files. - - * src/sndfile.h - Add new subtype SF_FORMAT_VOX_ADPCM. - - * src/sndfile.c - Renamed function is_au_snd_file () to format_from_extenstion () and expanded - its functionality to detect headerless VOX files. - - * src/raw.c - Added hooks for SF_FORMAT_VOX_ADPCM. - - * examples/sndfile-info.c - Print out file duration (suggested by Conrad Parker). - - * libsndfile.spec.in - Force installation of sndfile.pc file (found by John Thompson). - - * tests/Makefile.am tests/lossy_comp_test.c tests/floating_point_test.c - Add tests for SF_FORMAT_VOX_ADPCM. - -2002-10-18 Erik de Castro Lopo - - * tests/misc_test.c - Add test which attempts to write to /dev/full (on Linux anyway) to check - for correct handling of writing to a full filesystem. - - * src/sndfile.c - Return correct error message if the header cannot be written because the - filesystem is full. - - * tests/util.tpl - Corrected printing of file mode in error reporting. - - * src/mat5.c - Fixed a bug where a MAT5 file written by libsndfile could not be opened by - Octave 2.1.36. - -2002-10-13 Erik de Castro Lopo - - * src/common.h src/file_io.c - All low level file I/O have been modified to be better able to report - system errors resulting from calling system level open/read/write etc. - - * src/*.c - Updated for compatibility with above changes. - - * examples/cooledit-fixer.c - New example program which fixes badly broken file created by Syntrillium's - Cooledit which are marked as containing PCM samples but actually contain - floating point data. - - * examples/Makefile.am - Hooked cooledit-fixer into the build system. - -2002-10-10 Erik de Castro Lopo - - * doc/command.html - Document SFC_GET_FORMAT_INFO. - -2002-10-09 Erik de Castro Lopo - - * examples/wav32_aiff24.c examples/sndfile2oct.c examples/sfhexdump.c - examples/sfdump.c - Removed these files because they weren't interesting. - - * examples/sfconvert.c examples/sndfile-convert.c - Renamed the first to the latter. - - * examples/Makefile.am - Added sndfile-convert to the bin_PROGRAMS, so it is installed when the lib - is installed. - Removed old programs wav32_aiff24 and sndfile2oct. - - * man/sndfile-convert.1 - New man page. - - * examples/sndfile-convert.c - Added some gloss now that sndfile-convert.c is an installed program. - - * src/sndfile.h.in src/sndfile.c src/common.h src/command.h - Added command SFC_GET_FORMAT_INFO. - - * tests/command_test.c - Added tests form SFC_GET_FORMAT_INFO. - -2002-10-08 Erik de Castro Lopo - - * src/sndfile.c - In sf_format_check() return error if samplerate < 0. - -2002-10-07 Erik de Castro Lopo - - * src/aiff.c - Fixed bug in handling of COMM chunks with a 4 byte encoding byte but no - encoding string. - -2002-10-06 Erik de Castro Lopo - - * src/sndfile.c - Fixed repeated word in an error message. - -2002-10-05 Erik de Castro Lopo - - * doc/index.html - Improved advertising in Features section. - -2002-10-04 Erik de Castro Lopo - - * src/wav.c - Added decoding of 'labl' chunks within 'LIST' chunks. - - * src/common.h - Added (experimental only) SF_FORMAT_OGG and SF_FORMAT_VORBIS and definition - of ogg_open(). This is nowhere near working yet. - - * src/sndfile.c - Added detection of 'OggS' file marker and added call to ogg_open() to - switch statement. - - * src/ogg.c - New file. Very early start of Ogg Vorbis support. - - * src/wav.c - Added handling of brain-damaged and broken Cooledit "32 bit 24.0 float - type 1" files. These files are marked as being 24 bit WAVE_FORMAT_PCM with - a block alignment of 4 times the numbers of channels but are in fact 32 bit - floating point. - -2002-10-02 Erik de Castro Lopo - - * configure.in - Modified option --enable-experimental to set ENABLE_EXPERIMENTAL_CODE in - config.h to either 0 or 1. - - * src/sndfile.c - Modify sf_command (SFC_GET_LIB_VERSION) to append "-exp" to the version - string if experimental code has been enabled. - -2002-10-01 Erik de Castro Lopo - - * src/Makefile.am - Added -lm to libsndfile_la_LIBADD. This means that -lm is not longer needed - in the link line when linking something to libsndfile. - - * tests/Makefile.am examples/Makefile.am - Removed -lm from all link lines. - - * sndfile.pc.in - Removed -lm from Libs line. - -2002-09-24 Erik de Castro Lopo - - * src/file_io.c - Removed all perror() calls. - - * src/nist.c - Removed calls to exit() function. - Added check to detect NIST files dammaged from Unix CR -> Win32 CRLF - conversion process. - -2002-09-24 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c - New function sf_strerror() which will eventually replace functions - sf_perror() and sf_error_str(). - Function sf_error_number() has also been changed, but this was documented - as being for testing only. - - * doc/api.html - Documented above changes. - - * tests/*.c examples/*.c - Changed to new error functions. - -2002-09-22 Erik de Castro Lopo - - * configure.in - Detect GCC version, and print a warning message about writeable strings - it GCC major version number is less than 3. - -2002-09-21 Erik de Castro Lopo - - * src/sndfile.h.in doc/api.html - Documentation fixes. - -2002-09-19 Erik de Castro Lopo - - * src/Version_script.in src/Makefile.am configure.in - Use the version script to prevent the exporting of all non public symbols. - This currently only works with Linux. Will test on Solaris as well. - - * src/float_cast.h - Added #ifndef to prevent the #warning directives killing the SGI MIPSpro - compiler. - - * src/au_g72x.c src/double64.c src/float32.c src/gsm610.c src/ima_adpcm.c - src/ms_adpcm.c - Fix benign compiler warnings arising from previously added compiler - flags. - -2002-09-18 Erik de Castro Lopo - - * src/sndfile.c - Fixed a bug in sf_error_str() where errnum was used as the index instead - of k. Found by Tim Hockin. - - * examples/sndfile-play.c - Fixed a compiler warning resulting from a variable shadowing a previously - defined local. - -2002-09-17 Erik de Castro Lopo - - * src/sndfile.h.in src/sndfile.c - Added command SFC_SET_RAW_START_OFFSET. - - * doc/command.html - Document SFC_SET_RAW_START_OFFSET. - - * tests/raw_test.c tests/Makefile.am - Add new file for for testing SF_FORMAT_RAW specific functionality. - - * tests/dwvw_test.c - Updates. - -2002-09-16 Erik de Castro Lopo - - * src/wav.c - Modified reading of 'smpl' chunk to take account of the sampler data field. - - * tests/utils.tpl tests/utils.h - Added function print_test_name(). - - * tests/misc_test.c tests/write_read_test.tpl tests/lossy_comp_test.c - tests/pcm_test.tpl tests/command_test.tpl tests/floating_point_test.c - Convert to use function print_test_name(). - -2002-09-15 Erik de Castro Lopo - - * doc/octave.html - Added a link to some other Octave scripts for reading and writing sound - files. - - * src/paf.c - Change type of dummy data field to int. This should fix a benign compiler - warning on some CPUs. - Removed superfluous casts resulting from the above change. - - * src/rx2.c - More hacking. - -2002-09-14 Erik de Castro Lopo - - * src/mat5.c src/common.c - Changed usage of snprintf() to LSF_SNPRINTF(). - - * Win32/Makefile.msvc - Updated to include new files and add new tests. - - * Win32/config.h Win32/sndfile.h - Updated. - - * doc/api.html - Added note about the possibility of "missing" features actually being - implemented as an sf_command(). - -2002-09-13 Erik de Castro Lopo - - * tests/misc_test.c - Added previously missing update_header_test and zero_data_tests for PAF, - MAT4 and MAT5 formats. - - * src/paf.c src/mat4.c src/mat5.c - Fixed bugs uncovered by new tests above. - - * src/mat5.c - Generalised parsing of name fields of MAT5 files. - - * src/mat5.c src/sndfile.c - Added support for unsigned 8 bit PCM MAT5 files. - - * tests/write_read_test.tpl - Added test for unsigned 8 bit PCM MAT5 files. - - * doc/index.html - Added unsigned 8 bit PCM MAT5 to capabilities matrix. - -2002-09-12 Erik de Castro Lopo - - * test/update_header_test.c tests/misc_test.c - Renamed update_header_test.c to misc_test.c. - Added zero_data_test() to check for case where file is opened for write and - closed immediately. The resulting file can be left in a state where - libsndfile cannot open it. Problem reported by Werner Schweer, the author - of Muse. - - * src/aiff.c - Removed superfluous cast. - - * src/wav.c src/svx.c - Fixed case of file generated with no data. - Removed superfluous cast. - - * src/sndfile.c - Fixed error on IA64 platform caused by incorrect termination of - SndfileErrors struct array. This problem was found in the Debian buildd - logs (http://buildd.debian.org/). - - * configure.in - Added Octave directory. - - * Octave/Makefile.ma - New Makfile.am for Octave directory. - - * Octave/sndfile_load.m Octave/sndfile_save.m Octave/sndfile_play.m - New files for working with Octave. - - * doc/octave.html - Document explaining the use of the above three Octave scripts. - -2002-09-10 Erik de Castro Lopo - - * src/sndfile.c - Fixed bug in RDWR mode. - -2002-09-09 Erik de Castro Lopo - - * src/common.c - Fixed psf_get_date_str() for systems which don't have gmtime_r() or - gmtime(). - - * src/file_io.c - Added #include for Win32. Reported by Koen Tanghe. - -2002-09-08 Erik de Castro Lopo - - * src/common.c - Added 'S' format specifier for psf_binheader_writef() which writes a C - string, including single null terminator to the header. - Added 'j' format specifier to allow jumping forwards or backwards in the - header. - Added function psf_get_date_str(). - - * src/mat5.c - Complete read and write support. - - * doc/index.html - Added entries for MAT4 and MAT5 in capabilities matrix. - -2002-09-06 Erik de Castro Lopo - - * src/mat4.c - Completed read and write support. - - * src/common.h src/sndfile.c - Added MAT4 and MAT5 specific error messages. - - * tests/write_read_test.tpl tests/Makefile.am - Added tests for MAT4 and MAT5 files. - - * tests/stdio_test.c tests/stdout_test.c tests/stdin_test.c - Added tests for MAT4 and MAT5 files. - -2002-09-05 Erik de Castro Lopo - - * src/command.c - Added elements for SF_FORMAT_MAT4 and SF_FORMAT_MAT5 to major_formats - array. - - * examples/sfconvert.c - Added mat4 and mat5 output targets. - -2002-09-04 Erik de Castro Lopo - - * src/sndfile.c - Added check to prevent errors openning read only formats for read/write. - - * src/interleave.c - New file for interleaving non-interleaved data. Non-interleaved data is - only supported on read. - - * src/Makefile.am - Added src/interleave.c to build. - -2002-09-03 Erik de Castro Lopo - - * src/double64.c src/common.h - Added double64_be_read(), double64_le_read(), double64_be_write() and - double64_le_write() which replace double64_read() and double64_write(). - - * src/common.c - Cleanup of psf_binheader_readf() and add ability to read big and little - endian doubles (required by mat4.c and mat5.c). - Add ability for psf_binheader_writef() to write doubles to sound file - headers. - -2002-09-01 Erik de Castro Lopo - - * src/mat5.c - New file for reading Matlab (tm) version 5 data files. This is also the - native binary file format for version 2.1.X of GNU Octave which will be - used for testing. - Not complete yet. - - * src/mat4.c - New file for reading Matlab (tm) version 4.2 data files. This is also the - native binary file format for version 2.0.X of GNU Octave which will be - used for testing. - Not complete yet. - - * src/sndfile.h.in src/sndfile.c src/common.h src/command.c src/Makefile.am - Mods to add Matlab files. - - * src/common.[ch] - Added readf_endian field to SF_PRIVATE struct allowing endianness to - remembered across calls to sf_binheader_readf(). - Fixed bug in width_specifier behaviour for printing hex values. - -2002-08-31 Erik de Castro Lopo - - * src/file_io.c - Check return value of close() call in psf_fclose(). - -2002-08-24 Erik de Castro Lopo - - * src/ms_adpcm.c - Commented out some code where 0x10000 was being subtracted from a short - and the result assigned to a short again. Andrew Zaja found this. - -2002-08-23 Erik de Castro Lopo - - * doc/command.html - Fixed typo found by Tommi Ilmonen. - - * src/ima_adpcm.c - Changed type of diff from short to int to prevent errors which can occur - during very rare circumstances. Thanks to FUWAFUWA. - -2002-08-16 Erik de Castro Lopo - - * tests/floating_point_test.c - Disable testing on machines without lrintf(). - - * Win32/Makefile.msvc - Added dwd.c and wve.c to build. - - * configure.in - Bumped version to 1.0.0. - -2002-08-15 Erik de Castro Lopo - - * src/file_io.c - Add a #include for Mac OS 9. Thanks to Stephane Letz. - - * src/wav.c - Changed an snprintf to LSF_SNPRINTF. - - * doc/Makefile.am - Added version-1.html. - -2002-08-14 Erik de Castro Lopo - - * configure.in - Bumped version to 1.0.rc6. - - * src/*.c - Modified scaling of normalised floats and doubles to integers. Until now - this has been done by multiplying by 0x8000 for short output, 0x80000000 - for 32 bit ints and so on. Unfortunately this can cause an overflow and - wrap around in the target value. All thes values have therefore been - reduced to 0x7FFF, 0x7FFFFFFF and so on. The conversion from ints to - normalised floats and doubles remains unchanged. This does mean that for - repeated conversions normalised float -> pcm16 -> normalised float would - result in a decrease in amplitude of 0x7FFF/0x8000 on every round trip. - This is undesirable but less undesireable than the wrap around I am trying - to avoid. - - * tests/floating_point_test.c - Removed file hash checking because new float scaling procedure introduced - above prevented the ability to crate a has on both x86 and PowerPC systems. - -2002-08-13 Erik de Castro Lopo - - * src/txw.c - Completed reading of TXW files. Seek doesn't work yet. - - * src/file_io.c - Added a MacOS 9 replacement for ftruncate(). - - * MacOS/sndfile.h - Added MacOS 9 header file. This should be copied into src/ to compile - libsndfile for MacOS9. - -2002-08-12 Erik de Castro Lopo - - * src/sndfile.c - Fixed commands SF_SET_NORM_DOUBLE and SFC_SET_NORM_FLOAT to return their - values after being set. Reported by Jussi Laako. - - * configure.in - If autogen is not found, touch all .c and .h files in tests/. - - * src/common.c - Added format width specifier to psf_log_printf() for %u, %d, %D and %X. - - * src/dwd.c - Completed implementation of read only access to these files. - - * src/common.h src/*.c src/pcm.c - Removed redundant field chars from SF_PRIVATE struct and modified - pcm_init() to do without it. - -2002-08-11 Erik de Castro Lopo - - * src/wve.c - New file implementing read of Psion Alaw files. This will be a read only - format. Implementation complete. - - * src/dwd/c - Started implementation of DiamondWare Digitized files. Also read only, not - complete. - - * src/wav.c - Add parsing of 'smpl' chunk. - - * src/paf.c - Fixed reading on un-normalized doubles and floats from 24 bit PAF files. - This brings it into line with the reading of 8 bit files into - un-normalized doubles which returns values in the range [-128, 127]. - - * src/common.c - Modified psf_log_printf() to accept the %% conversion specifier to allow - printing of a single '%'. - - * src/sds.c - Read only of 16 bit samples is working. Need to build a test harness for - this and other read only formats. - -2002-08-10 Erik de Castro Lopo - - * configure.in - Added --enable-experimental configure option. - Removed pkg-config message at the end of the configure process. - - * src/sds.c src/txw.c src/rx2.c src/sd2.c - Moved all the code in these files inside #if ENABLE_EXPERIMENTAL_CODE - blocks and added new *_open() function for the case where experimental is - not enabled. These new functions just return SFE_UNIMPLMENTED. - - * Win32/sndfile.h src/sndfile.h.in src/common.h - Removed un-necessary #pragma pack commands. - - * src/file_io.c - Implemented psf_ftruncate() and much other hacking for Win32. - - * Win32/Makefile.msvc - Updated. - - * doc/win32.html - Updated to include the copying of the sndfile.h file from the Win32/ - directory to the src/ directory. - - * Make.bat - Batch file to make compiling on Wi32 a little easier. Implements "make" and - "make check". - -2002-08-09 Erik de Castro Lopo - - * src/file_io.c - Add place holder for ftruncate() on Win32 which doesn't have ftruncate(). - This will need to be fixed later. - - * src/sndfile.h.in - New file (copy of sndfile.h) with sets up @TYPEOF_SF_COUNT_T@ which will be - replaced by the correct type during configure. - - * configure.in - Modified to find a good type for TYPEOF_SF_COUNT_T. - - * src/aiff.c - Fixed a bug when reading malformed headers. - - * src/common.c - Set read values to zero before performing read. - -2002-08-08 Erik de Castro Lopo - - * doc/command.html - Fixed some HTML tags which were not allowing jumps to links within the - page. - - * src/sds.c - Massive hacking on this. - - * src/wav.c - Added recognition of 'clm ' tag. - -2002-08-07 Erik de Castro Lopo - - * doc/index.html - Added beginning of a capabilities list beyond simple file formats which - can be read/written. - - * src/aiff.c - Added parsing of INST and MARK chunks of AIFF files. At the moment this - data is simply recorded in the log buffer. Later it will be possible to - read this data from an application using sf_command(). - - * src/wav.c - Added parsing of 'cue ' chunk which contains loop information in WAV files. - - * exampes/sndfile-info.c - Changed reporting of Samples to Frames. - - * src/wav.c src/w64.c src/aiff.c src/wav_w64.h - Moved from a samples to a frames nomenclature to avoid confusion. - - * doc/FAQ.html - What's the best format for storing temporary files? - - * src/sds.c - New file for reading/writing Midi Sample Dump Standard files. - - * src/Makefile.am src/sndfile.c src/common.[ch] - Added hooks for sds.c. - - * examples/sndfile-info.c - Changed from using sf_perror() to using sf_error_str(). - -2002-08-06 Erik de Castro Lopo - - * doc/api.html - Added explanation of mode parameter for sf_open(). - Added explanation of usage of SFM_* values in sf_seek(). - - * src/sndfile.[ch] src/command.c src/file_io.c src/common.h - Implemented SFC_FILE_TRUNCATE to allow a file to be truncated. File - truncation was suggested by James McCartney. - - * src/command.html - Documented SFC_FILE_TRUNCATE. - - * tests/command_test.c - Add tests for SFC_FILE_TRUNCATE. - - * src/sndfile.c - Added a thrid parameter to the VALIDATE_SNDFILE_AND_ASSIGN_PSF macro to - make resetting the error number optional. All uses of the macro other than - in error reporting functions were changed to reset the error number. - - * src/pcm.c - Fixed a bug were sf_read_* was logging an SFE_SHORT_READ even when no error - occurred. - - * tests/write_read_test.tpl - Added tests of internal error state. - -2002-08-05 Erik de Castro Lopo - - * src/GSM610/private.h src/GSM610/*.c src/GSM610/Makefile.am - Renamed private.h to gsm610_priv.h to prevent clash with other headers - named private.h in other directories. (Probably only a problem on MacOS 9). - - * src/G72x/private.h src/G72x/*.c src/G72x/Makefile.am - Renamed private.h to g72x_priv.h to prevent clash with other headers - named private.h in other directories. (Probably only a problem on MacOS 9). - - * MacOS/config.h - Changed values of HAVE_LRINT and HAVE_LRINTF to force use of code in - float_cash.h. - - * src/sndfile.h - Changes the name of samples field of the SF_INFO to frames. The old name - had caused too much confusion and it simply had to be changed. There will - be at least one more pre-release. - -2002-08-04 Erik de Castro Lopo - - * doc/index.html - Updated formats matrix to include RAW (header-less) GSM 6.10. - Fix specificaltion of table and spelling mistakes. - - * src/sndfile.c src/command.c - Fixed bug in SFC_CALC_MAX_SIGNAL family and psf_calc_signal_max (). - - * tests/command.c - Removed cruft. - Added test for SFC_CALC_MAX_SIGNAL and SFC_CALC_NORM_MAX_SIGNAL. - - * configure.in - Update version to 1.0.0rc5. - - * sfendian.h - Removed inclusion of un-necessary header. - -2002-08-03 Erik de Castro Lopo - - * src/aiff.c - Minor fixes of info written to log buffer. - - * src/float_cast.h - Add definition of HAVE_LRINT_REPLACEMENT. - - * tests/floating_point_test.c - Fix file hash check on systems without lrint/lrintf. - - * tests/dft_cmp.c - Limit SNR to less than -500.0dB. - - * examples/sndfile2oct.c - Fixed compiler warnings. - - * doc/api.html - Fixed error where last parameter of sf_error_str() was sf_count_t instead - of size_t. - -2002-08-02 Erik de Castro Lopo - - * doc/FAQ.html - Why doesn't libsndfile do interleaving/de-interleaving. - - * tests/pcm_test.tpl - On Win32 do not perform hash check on files containing doubles. - -2002-08-01 Erik de Castro Lopo - - * src/common.h - Defined SF_COUNT_MAX_POSITIVE() macro, a portable way of setting variables - of type sf_count_t to their maximum positive value. - - * src/dwvw.c src/w64.c - Used SF_COUNT_MAX_POSITIVE(). - -2002-07-31 Erik de Castro Lopo - - * src/paf.c - Fixed bug in reading/writing of 24 bit PCM PAF files on big endian systems. - - * tests/floating_point_tests.c - Fixed hash values for 24 bit PCM PAF files. - Disabled file has check if lrintf() function is not available and added - warning. - Decreased level of signal from a peak of 1.0 to a value of 0.95 to prevent - problems on platforms without lrintf() ie Solaris. - -2002-07-30 Erik de Castro Lopo - - * src/wav.c - Fixed a problem with two different kinds of mal-formed WAV file header. The - first had the 'fact' chunk before the 'fmt ' chunk, the other had an - incomplete 'INFO' chunk at the end of the file. - - * src/w64.c - Added fix to allow differentiation between W64 files and ACID files. - - * src/au_g72x.c src/common.h src/sndfile.c - Added error for G72x encoded files with more than one channel. - - * tests/pcm_test.tpl tests/utils.tpl - Moved function check_file_hash_or_die() to utils.tpl. Function was then - modified to calculate the has of the whole file. - - * src/wav.c - Fixed problem writing the 'fact' chunk on big endian systems. - - * tests/sfconvert.c - Fixed bug where .paf files were being written as Sphere NIST. - -2002-07-29 Erik de Castro Lopo - - * src/voc.c - Fix for reading headers generated using SFC_UPDATE_HEADER_NOW. - - * doc/command.html - Add docs for SFC_UPDATE_HEADER_NOW and SFC_SET_UPDATE_HEADER_AUTO. - -2002-07-28 Erik de Castro Lopo - - * man/sndfile-info.1 man/sndfile-play.1 - Added manpages supplied by Joshua Haberman the Debian maintainer for - libsndfile. Additional tweaks by me. - - * configure.in man/Makefile.am - Hooked manpages into autoconf/automake system. - - * src/sndfile.c - Added hooks for SFC_SET_UPDATE_HEADER_AUTO. - - * tests/update_header_test.c - Improved rigor of testing. - - * src/*.c - Fixed problem with *_write_header() functions. - -2002-07-27 Erik de Castro Lopo - - * doc/*.html - Updates to documentation to fix problems found by wdg-html-validator. - - * src/common.h src/command.c - Added normalize parameter to calls to psf_calc_signal_max() and - psf_calc_max_all_channels(). - - * src/sndfile.c - Added handling for commands SFC_CALC_NORM_SIGNAL_MAX and - SFC_CALC_NORM_MAX_ALL_CHANNELS. - - * doc/command.html - Added entry for SFC_CALC_NORM_SIGNAL_MAX and SFC_CALC_NORM_MAX_ALL_CHANNELS. - -2002-07-26 Erik de Castro Lopo - - * examples/sndfile-play.c Win32/Makefile.msvc - Get sndfile-play program working on Win32. The Win32 PCM sample I/O API - sucks. The sndfile-play program now works on Linux, MacOSX, Solaris and - Win32. - -2002-07-25 Erik de Castro Lopo - - * doc/FAQ.html - New file for frequently asked questsions. - -2002-07-22 Erik de Castro Lopo - - * doc/api.html - Documentation fixes. - - * src/au.[ch] src/au_g72x.c src/G72x/g72x.h - Add support of 40kbps G723 ADPCM encoding. - - * tests/lossy_comp_test.c tests/floating_point_test.c - Add tests for 40kbps G723 ADPCM encoding. - - * doc/index.html - Update support matrix. - -2002-07-21 Erik de Castro Lopo - - * doc/command.html - Documented SFC_GET_SIMPLE_FORMAT_COUNT, SFC_GET_SIMPLE_FORMAT, - SFC_GET_FORMAT_* and SFC_SET_ADD_PEAK_CHUNK. - - * src/sndfile.c src/pcm.c - Add ability to turn on and off the addition of a PEAK chunk for floating - point WAV and AIFF files. - - * src/sndfile.[ch] src/common.h src/command.c - Added sf_command SFC_CALC_MAX_ALL_CHANNELS. Implemented by Maurizio Umberto - Puxeddu. - - * doc/command.html - Docs for SFC_CALC_MAX_ALL_CHANNELS (assisted by Maurizio Umberto Puxeddu). - -2002-07-18 Erik de Castro Lopo - - * src/sndfile.c src/gsm610.c - Finalised support for GSM 6.10 AIFF files and added support for GSM 6.10 - encoded RAW (header-less) files. - - * src/wav.c - Add support for IBM_FORMAT_MULAW and IBM_FORMAT_ALAW encodings. - - * src/api.html - Fixed more documentation bugs. - -2002-07-17 Erik de Castro Lopo - - * src/sndfile.h src/common.h - Moved some yet-to-be-implelmented values for SF_FORMAT_* from the public - header file sndfile.h to the private header file common.h to avoid - confusion about the actual capabilities of libsndfile. - -2002-07-16 Erik de Castro Lopo - - * src/aiff.c src/wav.c - Fixed file parsing for WAV and AIFF files containing non-audio data after - the data chunk. - - * src/aiff.c src/sndfile.c - Add support for GSM 6.10 encoded AIFF files. - - * tests/lossy_comp_test.c tests/Makefile.am - Add tests for GSM 6.10 encoded AIFF files. - - * src/*.c - Fix compiler warnings. - -2002-07-15 Erik de Castro Lopo - - * tests/command_test.c - For SFC_SET_NORM_* tests, change the file format from SF_FORMAT_WAV to - SF_FORMAT_RAW. - - * src/sndfile.c - Added sf_command(SFC_TEST_ADD_TRAILING_DATA) to allow testing of reading - from AIFF and WAV files with non-audio data after the audio chunk. - - * src/common.h - Add test commands SFC_TEST_WAV_ADD_INFO_CHUNK and - SFC_TEST_AIFF_ADD_INST_CHUNK. When these commands are working, they will be - moved to src/sndfile.h - - * src/aiff.c src/wav.c - Begin implementation of XXXX_command() hook for sf_command(). - - * tests/write_read_test.tpl - Added sf_command (SFC_TEST_ADD_TRAILING_DATA) to ensure above new code was - working. - -2002-07-13 Erik de Castro Lopo - - * tests/update_header_test.c - Allow read sample count == write sample count - 1 to fix problems with VOC - files. - - * tests/write_read_test.tpl tests/pcm_test.tpl - Fixed some problems in the test suite discovered by using Valgrind. - -2002-07-12 Erik de Castro Lopo - - * tests/utils.[ch] tests/*.c - Renamed check_log_buffer() to check_log_buffer_or_die(). - - * src/sndfile.c - SFC_UPDATE_HEADER_NOW and SFC_SETUPDATE_HEADER_AUTO almost finished. Works - for all file formats other than VOC. - -2002-07-11 Erik de Castro Lopo - - * src/sndfile.[ch] src/common.h - Started adding functionality to allow the file header to be updated before - the file is closed on files open for SFM_WRITE. This was requested by - Maurizio Umberto Puxeddu who is using libsndfile for file I/O in iCSound. - - * tests/update_header_test.c - New test program to test that the above functionality is working correctly. - - * tests/peak_chunk_test.c tests/floating_point_test.c - Cleanups. - -2002-07-10 Erik de Castro Lopo - - * src/sfendian.[ch] - Changed length count parameters for all endswap_XXX() functions from - sf_count_t (which can be 64 bit even on 32 bit architectures) to int. These - functions are only called frin inside the library, are always called with - integer parameters and doing the actual calculation on 64 bit values is - slow in comparision to doing it on ints. - - * examples/sndfile-play.c - More playback hacking for Win32. - -2002-07-09 Erik de Castro Lopo - - * src/common.c - In psf_log_printf(), changed %D format conversion specifier to %M (marker) and - added %D specifier for printing the sf_count_t type. - - * src/*.c - Changed all usage of psf_log_printf() with %D format conversion specifiers - to use %M conversion instead. - - * tests/pcm_test.tpl tests/pcm_test.def - New files to autogen pcm_test.c. - - * src/pcm.c - Fixed bug in scaling floats and doubles to 24 bit PCM and vice versa. - -2002-07-08 Erik de Castro Lopo - - * configure.in - Fix setup of $ac_cv_sys_largefile_CFLAGS so that sndfile.pc gets valid - values for CFLAGS. - - * examples/sndfile-play.c - Start adding playback support for Win32. - -2002-07-07 Erik de Castro Lopo - - * src/*.c - Worked to removed compiler warnings. - Extensive refactoring. - - * src/common.[ch] - Added function psf_memset() which works like the standard C function memset - but takes and sf_count_t as the length parameter. - - * src/sndfile.c - Replaced calls to memset(0 with calls to psf_memset() as required. - -2002-07-06 Erik de Castro Lopo - - * src/sndfile.c - Added "libsndfile : " to the start of all error messages. This was suggested - by Conrad Parker author of Sweep ( http://sweep.sourceforge.net/ ). - - * src/sfendian.[ch] - Added endswap_XXXX_copy() functions. - - * src/pcm.c src/float32.c src/double64.c - Use endswap_XXXX_copy() functions and removed dead code. - Cleanups and optimisations. - -2002-07-05 Erik de Castro Lopo - - * src/sndfile.c src/sndfile.h - Gave values to all the SFC_* enum values to allow better control of the - interface as commands are added and removed. - Added new command SFC_SET_ADD_PEAK_CHUNK. - - * src/wav.c src/aiff.c - Modified wav_write_header and aiff_write_header to make addition of a PEAK - chunk optional, even on floating point files. - - * tests/benchmark.tpl - Added call to sf_command(SFC_SET_ADD_PEAK_CHUNK) to turn off addition of a - PEAK chunk for the benchmark where we are trying to miximize speed. - - * src.pcm.c - Changed tribyte typedef to something more sensible. - Further conversion speed ups. - -2002-07-03 Erik de Castro Lopo - - * src/command.c - In major_formats rename "Sphere NIST" to "NIST Sphere". - - * src/common.c src/sfendian.c - Moved all endswap_XXX_array() functions to sfendian.c. These functions will - be tweaked to provide maximum performance. Since maximum performance on one - platform does not guarantee maximum performance on another, a small set of - functions will be written and the optimal one chosen at compile time. - - * src/common.h src/sfendian.h - Declarations of all endswap_XXX_array() functions moved to sfendian.h. - - * src/Makefile.am - Add sfendian.c to build targets. - -2002-07-01 Erik de Castro Lopo - - * src/pcm.c src/sfendian.h - Re-coded PCM encoders and decoders to match or better the speed of - libsndfile version 0.0.28. - -2002-06-30 Erik de Castro Lopo - - * src/wav.c - Add checking for WAVPACK data in standard PCM WAV file. Return error if - found. This WAVPACK is *WAY* broken. It uses the same PCM WAV file header - and then stores non-PCM data. - - * tests/benchmark.tpl - Added more tests. - -2002-06-29 Erik de Castro Lopo - - * tests/benchmark.tpl - Added conditional definition of M_PI. - For Win32, set WRITE_PERMS to 0777. - - * Win32/Makefile.msvc - Added target to make generate program on Win32. - - * src/samplitude.c - Removed handler for Samplitude RAP file format. This file type seems rarer - than hens teeth and is completely undocumented. - - * src/common.h src/sndfile.c src/Makefile.am Win32/Makefile.msvc - Removed references to sampltiude RAP format. - - * tests/benchmark.tpl - Benchmark program now prints the libsndfile version number when run. This - program was also backported to version 0 to compare results. Version - 1.0.0rc2 is faster than version 0.0.28 on most conversions but slower on - some. The slow ones need to be fixed before final release. - -2002-06-28 Erik de Castro Lopo - - * tests/benchmark.def tests/benchmark.tpl - New files which generate tests/benchmark.c using Autogen. Added int -> - SF_FORMAT_PCM_24 test. - - * tests/benchmark.c - Now and Autogen output file. - - * tests/Makefile.am - Updated for above changes. - -2002-06-27 Erik de Castro Lopo - - * tests/benchmark.c - Basic benchmark program complete. Need to convert it to Autogen. - - * Win32/Makefile.msvc - Added benchmark.exe target. - -2002-06-26 Erik de Castro Lopo - - * examples/generate.c - New program to generate a number of different output file formats from a - single input file. This allows testing of the created files. - - * tests/benchmark.c - New test program to benchmark libsndfile. Nowhere near complete yet. - - * examples/Makefile.am tests/Makefile.am - New make rules for the two new programs. - -2002-06-25 Erik de Castro Lopo - - * Win32/libsndfile.def - Removed definition for sf_signal_max(). - - * src/sndfile.c - Removed cruft. - - * doc/index.html - A number of documentation bugs were fixed. Thanks to Anand Kumria. - - * doc/version-1.html - Minor doc updates. - - * configure.in - Bumped version to 1.0.0rc2. - - * src/sf_command.h src/Makefile.am - Removed the header file as it was no longer being used. Thanks to Anand - Kunria for spotting this. - - * doc/index.html - A number of documentation bugs were fixed. Thanks to Anand Kumria. - -2002-06-24 Erik de Castro Lopo - - * src/common.h - Test for Win32 before testing SIZEOF_OFF_T so that it works correctly - on Win32.. - - * src/file_io.c - Win32 fixes to ensure O_BINARY is used for file open. - - * doc/win32.html - New file documenting the building libsndfile on Win32. - - * doc/*.html - Updating of documentation. - -2002-06-23 Erik de Castro Lopo - - * tests/pcm_test.c - Minor changes to allow easier determination of test file name. - - * src/sndfile.[ch] - Removed function sf_signal_max(). - - * examples/sndfile-play.c - Changed call to sf_signal_max() to a call to sf_command(). - -2002-06-22 Erik de Castro Lopo - - * src/format.c src/command.c - Renamed format.c to command.c which will now include code for sf_command() - calls to perform operations other than format commands. - - * src/sndfile.c src/sndfile.h - Removed function sf_get_signal_max() which is replaced by commands passed - to sf_command(). - - * src/command.c - Implement commands SFC_CALC_SIGNAL_MAX. - - * doc/command.html - Documented SFC_CALC_SIGNAL_MAX. - -2002-06-21 Erik de Castro Lopo - - * examples/sndfile-play.c - Mods to make sndfile-play work on Solaris. The program sndfile-play now - runs on Linux, MaxOSX and Solaris. Win32 to come. - - * src/format.c - Added SF_FORMAT_DWVW_* to subtype_formats array. - - * src/nist.c - Added support for 8 bit NIST Sphere files. Example file supplied by Anand - Kumria. - -2002-06-20 Erik de Castro Lopo - - * examples/sndfile-info.c - Tidy up of output format. - - * examnples/sndfile-play.c - Mods to make sndfile-play work on MacOSX using Apple's CoreAudio API. - - * configure.in - Add new variables OS_SPECIFIC_INCLUDES and OS_SPECIFIC_LINKS which were - required to supply extra include paths and link parameters to get - sndfile-play working on MacOSX. - - * examples/Makefile.am - Use OS_SPOECIFIC_INCLUDES and OS_SPECIFIC_LINKS to build commands for - sndfile-play. - -2002-06-19 Erik de Castro Lopo - - * src/nist.c - Added ability to read/write new NIST Sphere file types (A-law, u-law). - Header parser was re-written from scratch. Example files supplied by Anand - Kumria. - - * src/sndfile.c - Support for A-law and u-law NIST files. - - * tests/Makefile.am tests/lossy_comp_test.c - Tests for A-law and u-law NIST files. - -2002-06-18 Erik de Castro Lopo - - * tests/utils.c - Fixed an error in error string. - -2002-06-17 Erik de Castro Lopo - - * acinclude.m4 - Removed exit command to allow cross-compiling. - - * Win32/unistd.h src/file_io.c - Moved contents of first file into the second file (enclosed in #ifdef). - Win32/unistd.h is now an empty file but still must be there for libsndfile - to compile on Win32. - - * src/sd2.c, src/sndfile.c: - Fixes for Sound Designer II files on big endian systems. - -2002-06-16 Erik de Castro Lopo - - * configure.in - Modified to work around problems with crappy MacOSX version of sed. - Added sanity check for proper values for CFLAGS. - -2002-06-14 Erik de Castro Lopo - - * src/sndfile.c - Code clean up in sf_open (). - - * Win32/Makefile.msvc - Michael Fink's contributed MSVC++ makefile was hacked to bits and put back - together in a new improved form. - - * src/file_io.c - Fixes for Win32; _lseeki64() returns an invalid argument for calls like - _lseeki64(fd, 0, SEEK_CUR) so need to use _telli64 (fd) instead. - - * src/common.h src/sndfile.c src/wav.c src/aiff.c - Added SFE_LOG_OVERRUN error. - Added termination for potential infinite loop when parsing file headers. - - * src/wav.c src/w64.c - Fixed bug casuing incorrect header generation when opening file read/write. - -2002-06-12 Erik de Castro Lopo - - * doc/api.html - Improved the documentation to make it clearer that the file read method - and the underlying file format are completely disconnected. Suggested - by Josh Green. - - * doc/command.html - Started correcting docs to take into account changes made to the - operations of the sf_command () function. Not complete yet. - - * src/sndfile.c - Reverted some changes which had broken the partially working SDII header - parsing. Now have access to an iBook with OS X so reading and writing SDII - files on all platforms should be a reality in the near future. On Mac this - will involve reading the resource fork via the standard MacOS API. To move - a file from Mac to another OS, the resource and data forks will need to be - combined before transfer. The combined file will be read on both Mac and - other OSes like any other file. - -2002-06-08 Erik de Castro Lopo - - * ltmain.sh - Applied a patch from http://fink.sourceforge.net/doc/porting/libtool.php - which allows libsndfile to compile on MacOSX 10.1. This patch should not - interfere with compiling on other OSes. - - * src/GSM610/private.h - Changes to fix compile problems on MacOSX (see src/GSM610/ChangeLog). - - * src/float_cast.h - Added MacOSX replacements for lrint() and lrintf(). - -2002-06-05 Erik de Castro Lopo - - * src/sndfile.c - Replaced the code to print the filename to the log buffer when a file is - opened. This code seems to have been left out during the merge of - sf_open_read() and sf_open_write() to make a single functions sf_open(). - -2002-06-01 Erik de Castro Lopo - - * src/wav.c - Fixed a bug where the WAV header parser was going into an infinite loop - on a badly formed LIST chunk. File supplied by David Viens. - -2002-05-25 Erik de Castro Lopo - - * configure.in - Added a message at the end of the configuration process to warn about the - need for the use of pkg-config when linking programs against version 1 of - libsndfile. - - * doc/pkg-config.html - New documentation file containing details of how to use pkg-config to - retrieve settings for CFLAGS and library locations for linking files - against version 1 of libsndfile. - -2002-05-17 Erik de Castro Lopo - - * src/wav.c - Fixed minor bug in handling of so-called ACIDized WAV files. - -2002-05-16 Erik de Castro Lopo - - * Win32/libsndfile.def Win32/Makefile.msvc - Two new files contributed by Michael Fink (from the winLAME project) - which allows libsndfile to be built on windows in a MSDOS box by doing - "nmake -f Makefile.msvc". Way cool! - -2002-05-15 Erik de Castro Lopo - - * configure.in - MacOSX is SSSOOOOOOO screwed up!!! I can't believe how hard it is to - generate a tarball which will configure and compile on that platform. - Joined the libtool mailing list to try and get some answers. - -2002-05-13 Erik de Castro Lopo - - * configure.in - Changed to autoconf version 2.50. MacOSX uses autoconf version 2.53 which - is incompatible with with version 2.13 which had been using until now. - The AC_SYS_LARGE_FILE macro distributed withe autoconf 2.50 is missing a - few features so AC_SYS_EXTRA_LARGE file was defined to replace it. - - * configure.in - Changed to automake version 1.5 to try and make a tarball which will - work on MacOSX. - -2002-05-12 Erik de Castro Lopo - - * src/wav_gsm610.c - Changed name to gsm610.c. Added reading/writing of headerless files. - - * src/sndfile.c src/raw.c - Added ability to read/write headerless (SF_FORMAT_RAW) GSM 6.10 files. - -2002-05-11 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Clean up in preparation for Autogen-ing this file. - - * src/GSM610/*.[ch] - Code cleanup and prepartion forgetting file seek working. Details in - src/GSM610/ChangeLog. - - * sndfile.pc.in - Testing complete. Is sndfile.m4 still needed? - -2002-05-09 Erik de Castro Lopo - - * tests/write_read_test.tpl tests/rdwr_test.tpl - Merged tests from these two programs into write_read_test.tpl and deleted - rdwr_test.tpl. - -2002-05-08 Erik de Castro Lopo - - * src/w64.c src/svx.c src/paf.c - Fixed bugs in read/write mode. - -2002-05-07 Erik de Castro Lopo - - * examples/Makefile.am - Renamed sfplay.c to sndfile-play.c and sndfile_info.c to sndfile-info.c for - consistency when these programs become part of the Debian package - sndfile-programs. - - * sndfile.pc.in - New file to replace sndfile-config.in. Libsndfile now uses the pkg-config - model for providing installation parameters to dependant programs. - - * src/sndfile.c - Cleanup of code in sf_open(). - -2002-05-06 Erik de Castro Lopo - - * tests/utils.tpl tests/write_read_test.tpl - More conversion to Autogen fixes and enchancements. - - * src/*.c - Read/write mode is now working for 16, 24 and 32 bit PCM as well as 32 - bit float and 64 bit double data. More tests still required. - - * src/Makefile.am - Added DISTCLEANFILES target to remove config.status and config.last. - - * Win32/Makefile.am MacOS/Makefile.am - Added DISTCLEANFILES target to remove Makefile. - -2002-05-05 Erik de Castro Lopo - - * src/*.[ch] tests/rdwr_test.c - More verifying workings of read/write mode. Fixing bugs found. - - * tests/utils.[ch] - Made these files Autogen generated files. - - * tests/util.tpl tests/util.def - New Autogen files to generate utils.[ch]. Moved some generic test functions - into this file. Autogen is such a great tool! - -2002-05-03 Erik de Castro Lopo - - * src/pcm.c src/float_cast.h Win32/config.h - Fixed a couple of Win32 specific bugs pointed out by Michael Fink - (maintainer of WinLAME) and David Viens. - - * tests/check_log_buffer.[ch] tests/utils.[ch] - Moved check_log_buffer() to utils.[ch] and deleted old file. - -2002-05-02 Erik de Castro Lopo - - * src/common.[ch] src/sndfile.c - New function psf_default_seek() which will be the default seek function - for things like PCM and floating point data. This default is set for - both read and write in sf_open() but can be over-ridden by any codec - during it's initialisation. - -2002-05-01 Erik de Castro Lopo - - * src/au.c - AU files use a data size value of -1 to mean unknown. Fixed au_open_read() - to allow opening files like this. - - * tests/rdwr_test .c - Added more tests. - - * src/sndfile.c - Fixed bugs in read/write mode found due to improvements in the test - program. - -2002-04-30 Erik de Castro Lopo - - * tests/rdwr_test .c - New file for testing read/write mode. - -2002-04-29 Erik de Castro Lopo - - * m4/* - Removed all m4 macros from this directory as they get concatenated to form - the file aclocal.m4 anyway. - - * sndfile.m4 - Moved this from the m4 directory to the root directory asn this is part of - the distribution and is installed during "make install". - -2002-04-29 Erik de Castro Lopo - - * src/float32.c - Removed logging of peaks for all file formats other than AIFF and WAV. - - * tests/write_read_test.tpl tests/write_read_test.def - New files which autogen uses to generate write_read_test.c. Doing it this - way makes write_read_test.c far easier to maintain. Other test programs - will be converted to autogen in the near future. - - * src/*.c - Fixed a few bugs found when testing on Sparc (bug endian) Solaris. - -2002-04-28 Erik de Castro Lopo - - * doc/*.html - Fixed documention versioning. - - * configure.in - Fixed a bug in the routines which search for Large File Support on systems - which have large file support by defualt. - -2002-04-27 Erik de Castro Lopo - - * src/*.[ch] - Found and fixed an issue which can cause a bug in other software (I was - porting Conrad Parker's Sweep program from version 0 of the library to - version 1). When opening a file for write, the libsndfile code would - set the sfinfo.samples field to a maximum value. - - * tests/write_read_test.c - Added tests to detect the above problem. - -2002-04-25 Erik de Castro Lopo - - * src/*.[ch] - Finished base implementation of read/write mode. Much more testing still - needed. - - * m4/largefile.m4 - Macro for detecting Large File Standard capabilities. This macro was ripped - out of the aclocal.m4 file of GNU tar-1.13. - - * configure.in - Added detection of large file support. Files larger than 2 Gigabytes should - now be supported on 64 bit platforms and many 32 bit platforms including - Linux (2.4 kernel, glibc-2.2), *BSD, MacOS, Win32. - - * libsndfile_convert_version.py - A Python script which attempts to autoconvert code written to use version 0 - to version 1. - -2002-04-24 Erik de Castro Lopo - - * src/*.[ch] - Finished base implementation of read/write mode. Much more testing still - needed. - - * tests/write_read_test.c - Preliminary tests for read/write mode added. More needed. - -2002-04-20 Erik de Castro Lopo - - * src/sndfile.[ch] - Removed sf_open_read() and sf_open_write() functions,replacting them with - sf_open() which takes an extra mode parameter (SF_OPEN_READ, SF_OPEN_WRITE, - or SF_OPEN_RDWR). This new function sf_open can now be modified to allow - opening a file formodification (RDWR). - -2002-04-19 Erik de Castro Lopo - - * src/*.c - Completed merging of separate xxx_open_read() and xxx_open_write() - functions. All tests pass. - -2002-04-18 Erik de Castro Lopo - - * src/au.c - Massive refactoring required to merge au_open_read() with au_open_write() - to create au_open(). - -2002-04-17 Erik de Castro Lopo - - * src/*.c - Started changes required to allow a sound file to be opened in read/write - mode, with separate file pointers for read and write. This involves merging - of encoder/decoder functions like pcm_read_init() and pcm_write_init() - int a new function pcm_init() as well as doing something similar for all - the file type specific functions ie aiff_open_read() and aiff_open_write() - were merged to make the function aiff_open(). - -2002-04-15 Erik de Castro Lopo - - * src/file_io.c - New file containing psf_fopen(), psf_fread(), psf_fwrite(), psf_fseek() and - psf_ftell() functions. These function will replace use of fopen/fread/fwrite - etc and allow access to files larger than 2 gigabytes on a number of 32 bit - OSes (Linux on x86, 32 bit Solaris user space apps, Win32 and MacOS). - - * src/*.c - Replaced all instances of fopen with psf_open, fread with psd_read, fwrite - with psf_write and so on. - -2002-03-11 Erik de Castro Lopo - - * src/dwvw.c - Finally fixed all known problems with 12, 16 and 24 bit DWVW encoding. - - * tests/floating_point_test.c - Added tests for 12, 16 and 24 bit DWVW encoding. - -2002-03-03 Erik de Castro Lopo - - * m4/endian.m4 - Defines a new m4 macro AC_C_FIND_ENDIAN, for determining the endian-ness of - the target CPU. It first checks for the definition of BYTE_ORDER in - , then in and . If none of these work - and the C compiler is not a cross compiler it compiles and runs a program - to test for endian-ness. If the compiler is a cross compiler it makes a - guess based on $target_cpu. - - * configure.in - Modified to use AC_C_FIND_ENDIAN. - - * src/sfendian.h - Simplified. - -2002-02-23 Erik de Castro Lopo - - * tests/floating_point_test.c - Tests completely rewritten using the dft_cmp function. Now able to - calculate a quick guesstimate of the Signal to Noise Ratio of the encoder. - -2002-02-15 Erik de Castro Lopo - - * tests/dft_cmp.[ch] - New files containing functions for comparing pre and post lossily - compressed data using a quickly hacked DFT. - - * tests/utils.[ch] - New files containing functions for saving pre and post encoded data in a - file readable by the GNU Octave package. - -2002-02-13 Erik de Castro Lopo - - * m4/lrint.m4 m4/lrintf.m4 - Fixed m4 macros to define HAVE_LRINT and HAVE_LRINTF even when the test - is cached. - -2002-02-12 Erik de Castro Lopo - - * tests/floating_point_test.c - Fixed improper use of strncat (). - -2002-02-11 Erik de Castro Lopo - - * tests/headerless_test.c - New test program to test the ability to open and read a known file type as a - RAW header-less file. - -2002-02-07 Erik de Castro Lopo - - * tests/losy_comp_test.c - Added a test to ensure that the data read from a file is not all zeros. - - * examples/sfconvert.c - Added "-gsm610" encoding types. - -2002-01-29 Erik de Castro Lopo - - * examples/sfconvert.c - Added "-dwvw12", "-dwvw16" and "-dwvw24" encoding types. - - * tests/dwvw_test.c - New file for testing DWVW encoder/decoder. - -2002-01-28 Erik de Castro Lopo - - * src/dwvw.c - Implemented writing of DWVW. 12 bit seems to work, 16 and 24 bit still broken. - - * src/aiff.c - Improved reporting of encoding types. - - * src/voc.c - Clean up. - -2002-01-27 Erik de Castro Lopo - - * src/dwvw.c - New file implementing lossless Delta Word Variable Width (DWVW) encoding. - Reading 12 bit DWVW is now working. - - * src/aiff.c common.h sndfile.c - Added hooks for DWVW encoded AIFF and RAW files. - -2002-01-15 Erik de Castro Lopo - - * src/w64.c - Robustify header parsing. - - * src/wav_w64.h - Header file wav.h was renamed to wav_w64.h to signify sharing of - definitions across the two file types. - - * src/wav.c src/w64.c src/wav_w64.c - Refactoring. - Modified and moved functions with a high degree of similarity between - wav.c and w64.c to wav_w64.c. - -2002-01-14 Erik de Castro Lopo - - * src/w64.c - Completed work on getting read and write working. - - * examples/sfplay.c - Added code to scale floating point data so it plays at a reasonable volume. - - * tests/Makefile.am tests/write_read_test.c - Added tests for W64 files. - -2002-01-13 Erik de Castro Lopo - - * src/*.c - Modded all code in file header writing routines to use - psf_new_binheader_writef(). - Removed psf_binheader_writef() from src/common.c. - Globally replaced psf_new_binheader_writef with psf_binheader_writef. - -2002-01-12 Erik de Castro Lopo - - * src/*.c - Modded all code in file parsing routines to use psf_new_binheader_readf(). - Removed psf_binheader_readf() from src/common.c. - Globally replaced psf_new_binheader_readf with psf_binheader_readf. - - * src/common.[ch] - Added new function psf_new_binheader_writef () which will soon replace - psf_binheader_writef (). The new function has basically the same function - as the original but has a more flexible and capable interface. It also - allows the writing of 64 bit integer values for files contains 64 bit file - offsets. - -2002-01-11 Erik de Castro Lopo - - * src/formats.c src/sndfile.c src/sndfile.h - Added code allowing full enumeration of supported file formats via the - sf_command () interface. - This feature will allow applications to avoid needing recompilation when - support for new file formats are added to libsndfile. - - * tests/command_test.c - Added test code for the above feature. - - * examples/list_formats.c - New file. An example of the use of the supported file enumeration - interface. This program lists all the major formats and for each major - format the supported subformats. - -2002-01-10 Erik de Castro Lopo - - * src/*.[ch] tests/*.c - Changed command parameter of sf_command () function from a test string to - an int. The valid values for the command parameter begin with SFC_ and are - listed in src/sndfile.h. - -2001-12-20 Erik de Castro Lopo - - * src/formats.c src/sndfile.c - Added an way of enumerating a set of common file formats using the - sf_command () interface. This interface was suggested by Dominic Mazzoni, - one of the main authors of Audacity (http://audacity.sourceforge.net/). - -2001-12-26 Erik de Castro Lopo - - * src/sndfile.c - Added checking of filename parameter in sf_open_read (). Previousy, if a - NULL pointer was passed the library would segfault. - -2001-12-18 Erik de Castro Lopo - - * src/common.c src/common.h - Changed the len parameter of the endswap_*_array () functions from type - int to type long. - - * src/pcm.c - Fixed a problem which - -2001-12-15 Erik de Castro Lopo - - * src/sndfile.c - Added conditional #include for EMX/gcc on OS/2. Thanks to - Paul Hartman for pointing this out. - - * tests/lossy_comp_test.c tests/floating_point_test.c - Added definitions for M_PI for when it isn't defined in . - -2001-11-30 Erik de Castro Lopo - - * src/ircam.c - Re-implemented the header reader. Old version was making incorrect - assumptions about the endian-ness of the file from the magic number at the - start of the file. The new code looks at the integer which holds the - number of channels and determines the endian-ness from that. - -2001-11-30 Erik de Castro Lopo - - * src/aiff.c - Added support for other AIFC types ('raw ', 'in32', '23ni'). - Further work on IMA ADPCM encoding. - -2001-11-29 Erik de Castro Lopo - - * src/ima_adpcm.c - Renamed from wav_ima_adpcm.c. This file will soon handle IMA ADPCM - encodings for both WAV and AIFF files. - - * src/aiff.c - Started adding IMA ADPCM support. - -2001-11-28 Erik de Castro Lopo - - * src/double.c - New file for handling double precision floating point (SF_FORMAT_DOUBLE) - data. - - * src/wav.c src/aiff.c src/au.c src/raw.c - Added support for SF_FORMAT_DOUBLE data. - - * src/common.[ch] - Addition of endswap_long_array () for endian swapping 64 bit integers. This - function will work correctly on processors with 32 bit and 64 bit longs. - Optimised endswap_short_array () and endswap_int_array (). - - * tests/pcm_test.c - Added and extra check. After the first file of each type is written to disk - a checksum is performed of the first 64 bytes and checked against a pre- - calculated value. This will work whatever the endian-ness of the host - machine. - -2001-11-27 Erik de Castro Lopo - - * src/aiff.c - Added handling of u-law, A-law encoded AIFF files. Thanks to Tom Erbe for - supplying example files. - - * tests/lossy_comp_test.c - Added tests for above. - - * src/common.h src/*.c - Removed function typedefs from common.h and function pointer casting in all - the other files. This allows the compiler to perform proper type checking. - Hopefully this will prevernt problems like the sf_seek bug for OpenBSD, - BeOS etc. - - * src/common.[ch] - Added new function psf_new_binheader_readf () which will eventually replace - psf_binheader_readf (). The new function has basically the same function as - the original but has a more flexible and capable interface. It also allows - the reading of 64 bit integer values for files contains 64 bit file - offsets. - -2001-11-26 Erik de Castro Lopo - - * src/voc.c - Completed implementation of VOC file handling. Can now handle 8 and 16 bit - PCM, u-law and A-law files with one or two channels. - - * src/write_read_test.c tests/lossy_comp_test.c - Added tests for VOC files. - -2001-11-22 Erik de Castro Lopo - - * src/float_cast.h - Added inline asm version of lrint/lrintf for MacOS. Solution provided by - Stephane Letz. - - * src/voc.c - More work on this braindamaged format. The VOC files produced by SoX also - have a number of inconsistencies. - -2001-11-19 Erik de Castro Lopo - - * src/paf.c - Added support for 8 bit PCM PAF files. - - * tests/write_read_test.c - Added tests for 8 bit PAF files. - -2001-11-18 Erik de Castro Lopo - - * tests/pcm_test.c - New test program to test for correct scaling of integer values between - different sized integer containers (ie short -> int). - The new specs for libsndfile state that when the source and destination - containers are of a different size, the most significant bit of the source - value becomes the most significant bit of the destination container. - - * src/pcm.c src/paf.c - Modified to pass the above test program. - - * tests/write_read_test.c tests/lossy_comp_test.c - Modified to work with the new scaling rules. - -2001-11-17 Erik de Castro Lopo - - * src/raw.c tests/write_read_test.c tests/write_read_test.c - Added ability to do raw reads/writes of float, u-law and A-law files. - - * src/*.[ch] examples/*.[ch] tests/*.[ch] - Removed dependance on pcmbitwidth field of SF_INFO struct and moved to new - SF_FORMAT_* types and use of SF_ENDIAN_BIG/LITTLE/CPU. - -2001-11-12 Erik de Castro Lopo - - * src/*.[ch] - Started implmentation of major changes documented in doc/version1.html. - - Removed all usage of off_t which is not part of the ISO C standard. All - places which were using it are now using type long which is the type of - the offset parameter for the fseek function. - This should fix problems on BeOS, MacOS and *BSD like systems which were - failing "make check" because sizeof (long) != sizeof (off_t). - --------------------------------------------------------------------------------- -This is the boundary between version 1 of the library above and version 0 below. --------------------------------------------------------------------------------- - -2001-11-11 Erik de Castro Lopo - - * examples/sfplay_beos.cpp - Added BeOS version of sfplay.c. This needs to be compiled using a C++ - compiler so is therefore not built by default. Thanks to Marcus Overhagen - for providing this. - -2001-11-10 Erik de Castro Lopo - - * examples/sfplay.c - New example file showing how libsndfile can be used to read and play a - sound file. - At the moment on Linux is supported. Others will follow in the near future. - -2001-11-09 Erik de Castro Lopo - - * src/pcm.c - Fixed problem with normalisation code where a value of 1.0 could map to - a value greater than MAX_SHORT or MAX_INT. Thanks to Roger Dannenberg for - pointing this out. - -2001-11-08 Erik de Castro Lopo - - * src/pcm.c - Fixed scaling issue when reading/writing 8 bit files using - sf_read/sf_write_short (). - On read, values are scaled so that the most significant bit in the char - ends up in the most significant bit of the short. On write, values are - scaled so that most significant bit in the short ends up as the most - significant bit in the char. - -2001-11-07 Erik de Castro Lopo - - * src/au.c src/sndfile.c - Added support for 32 bit float data in big and little endian AU files. - - * tests/write_read_test.c - Added tests for 32 bit float data in AU files. - -2001-11-06 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Finalised testing of stereo files where possible. - -2001-11-05 Erik de Castro Lopo - - * src/wav_ms_adpcm.c - Fixed bug in writing stereo MS ADPCM WAV files. Thanks to Xu Xin for - pointing out this problem. - -2001-10-24 Erik de Castro Lopo - - * src/wav_ms_adpcm.c - Modified function srate2blocksize () to handle 44k1Hz stereo files. - -2001-10-21 Erik de Castro Lopo - - * src/w64.c - Added support for Sonic Foundry 64 bit WAV format. As Linux (my main - development platform) does not yet support 64 bit file offsets by default, - current handling of this file format treats everything as 32 bit and fails - openning the file, if it finds anything that goes beyond 32 bit values. - - * src/sndfile.[hc] src/common.h src/Makefile.am - Added hooks for W64 support. - -2001-10-21 Erik de Castro Lopo - - * configure.in - Added more warnings options to CFLAGS when the gcc compiler is detected. - - * src/*.[ch] tests/*.c examples/*.c - Started fixing the warning messages due to the new CFLASG. - - * src/voc.c - More work on VOC file read/writing. - - * src/paf.c - Found that PAF files were not checking the normalisation flag when reading - or writing floats and doubles. Fixed it. - - * tests/floating_point_test.c - Added specific test for the above problem. - - * src/float_cast.h src/pcm.c - Added a section for Win32 to define lrint () and lrintf () in the header - and implement it in the pcm.c - -2001-10-20 Erik de Castro Lopo - - * sndfile-config.in m4/sndfile.m4 - These files were donated by Conrad Parker who also provided instructions - on how to install them using autoconf/automake. - - * src/float_cast.h - Fiddled around with this file some more. On Linux and other gcc supported - OSes use the C99 functions lrintf() and lrint() for casting from floating - point to int without incurring the huge perfromance penalty (particularly - on the i386 family) caused by the regular C cast from float to int. - These new C99 functions replace the FLOAT_TO_* and DOUBLE_TO_* macros which - I had been playing with. - - * configure.in m4/lrint.m4 m4/lrintf.m4 - Add detection of these functions. - -2001-10-17 Erik de Castro Lopo - - * src/voc.c - Completed code for reading VOC files containing a single audio data - segment. - Started implementing code to handle files with multiple VOC_SOUND_DATA - segments but couldn't be bothered finishing it. Multiple segment files can - have different sample rates for different sections and other nasties like - silence and repeat segments. - -2001-10-16 Erik de Castro Lopo - - * src/common.h src/*.c - Removed SF_PRIVATE struct field fdata and replaced it with extra_data. - - * src/voc.c - Further development of the read part of this woefult file format. - -2001-10-04 Erik de Castro Lopo - - * src/float_cast.h - Implemented gcc and i386 floating point to int cast macros. Standard cast - will be used when not on gcc for i385. - - * src/pcm.c - Modified all uses of FLOAT/DOUBLE_TO_INT and FLOAT/DOUBLE_TO_SHORT casts to - comply with macros in float_cast.h. - -2001-10-04 Erik de Castro Lopo - - * src/voc.c - Changed the TYPE_xxx enum names to VOC_TYPE_xxx to prevent name clashes - on MacOS with CodeWarrior 6.0. - - * MacOS/MacOS-readme.txt - Updated the compile instructions. Probably still need work as I don't have - access to a Mac. - -2001-10-01 Erik de Castro Lopo - - * src/wav.c src/aiff.c common.c - Changed all references to snprintf to LSF_SNPRINTF and all vsnprintf to - LSF_VSNPRINTF. LSF_VSNPRINTF and LSF_VSNPRINTF are defined in common.h. - - * src/common.h - Added checking of HAVE_SNPRINTF and HAVE_VSNPRINTF and defining - LSF_VSNPRINTF and LSF_VSNPRINTF to appropriate values. - - * src/missing.c - New file containing a minimal implementation of snprintf and vsnprintf - functions named missing_snprintf and missing_vsnprintf respectively. These - are only compliled into the binary if snprintf and/or vsnprintf are not - available. - -2001-09-29 Erik de Castro Lopo - - * src/ircam.c - New file to handle Berkeley/IRCAM/CARL files. - - * src/sndfile.c src/common.h - Modified for IRCAM handling. - - * tests/*.c - Added tests for IRCAM files. - -2001-09-27 Erik de Castro Lopo - - * src/wav.c - Apparently microsoft windows (tm) doesn't like ulaw and Alaw WAV files with - 20 byte format chunks (contrary to ms's own documentation). Fixed the WAV - header writing code to generate smaller ms compliant ulaw and Alaw WAV - files. - -2001-09-17 Erik de Castro Lopo - - * tests/stdio_test.sh tests/stdio_test.c - Shell script was rewritten as a C program due to incompatibilities of the - sh shell on Linux and Solaris. - -2001-09-16 Erik de Castro Lopo - - * tests/stdio_test.sh tests/stdout_test.c tests/stdin_test.c - New test programs to verify the correct operation of reading from stdin and - writing to stdout. - - * src/sndfile.c wav.c au.c nist.c paf.c - Fixed a bugs uncovered by the new test programs above. - -2001-09-15 Erik de Castro Lopo - - * src/sndfile.c wav.c - Fixed a bug preventing reading a file from stdin. Found by T. Narita. - -2001-09-12 Erik de Castro Lopo - - * src/common.h - Fixed a problem on OpenBSD 2.9 which was causing sf_seek() to fail on IMA - WAV files. Root cause was the declaration of the func_seek typedef not - matching the functions it was actually being used to point to. In OpenBSD - sizeof (off_t) != sizeof (int). Thanks to Heikki Korpela for allowing me - to log into his OpenBSD machine to debug this problem. - -2001-09-03 Erik de Castro Lopo - - * src/sndfile.c - Implemented sf_command ("norm float"). - - * src/*.c - Implemented handling of sf_command ("set-norm-float"). Float normalization - can now be turned on and off. - - * tests/double_test.c - Renamed to floating_point_test.c. Modified to include tests for all scaled - reads and writes of floats and doubles. - - * src/au_g72x.c - Fixed bug in normalization code found with improved floating_point_test - program. - - * src/wav.c - Added code for parsing 'INFO' and 'LIST' chunks. Will be used for extract - text annotations from WAV files. - - * src/aiff.c - Added code for parsing '(c) ' and 'ANNO' chunks. Will be used for extract - text annotations from WAV files. - -2001-09-02 Erik de Castro Lopo - - * examples/sf_info.c example/Makefile.am - Renamed to sndfile_info.c. The program sndfile_info will now be installed - when the library is installed. - - * src/float_cast.h - New file defining floating point to short and int casts. These casts will - eventually replace all flot and double casts to short and int. See comments - at the top of the file for the reasoning. - - * src/*.c - Changed all default float and double casts to short or int with macros - defined in floatcast.h. At the moment these casts do nothing. They will be - replaced with faster float to int cast operations in the near future. - -2001-08-31 Erik de Castro Lopo - - * tests/command_test.c - New file for testing sf_command () functionality. - - * src/sndfile.c - Revisiting of error return values of some functions. - Started implementing sf_command () a new function will allow on-the-fly - modification of library behaviour, or instance, sample value scaling. - - * src/common.h - Added hook for format specific sf_command () calls to SNDFILE struct. - - * doc/api.html - Updated and errors corrected. - - * doc/command.html - New documentation file explaining new sf_command () function. - -2001-08-11 Erik de Castro Lopo - - * src/sndfile.c - Fixed error return values from sf_read*() and sf_write*(). There were - numerous instances of -1 being returned through size_t. These now all set - error int the SF_PRIVATE struct and return 0. Thanks to David Viens for - spotting this. - -2001-08-01 Erik de Castro Lopo - - * src/common.c - Fixed use of va_arg() calls that were causing warning messages with the - latest version of gcc (thanks Maurizio Umberto Puxeddu). - -2001-07-25 Erik de Castro Lopo - - * src/*.c src/sfendian.h - Moved definition of MAKE_MARKER macro to sfendian.h - -2001-07-23 Erik de Castro Lopo - - * src/sndfile.c - Modified sf_get_lib_version () so that version string will be visible using - the Unix strings command. - - * examples/Makefile.am examples/sfinfo.c - Renamed sfinfo program and source code to sf_info. This prevents a name - clash with the program included with libaudiofile. - -2001-07-22 Erik de Castro Lopo - - * tests/read_seek_test.c tests/lossy_comp_test.c - Added tests for sf_read_float () and sf_readf_float (). - - * src/voc.c - New files for handling Creative Voice files (not complete). - - * src/samplitude.c - New files for handling Samplitude files (not complete). - -2001-07-21 Erik de Castro Lopo - - * src/aiff.c src/au.c src/paf.c src/svx.c src/wav.c - Converted these files to using psf_binheader_readf() function. Will soon be - ready to attempt to make reading writing from pipes work reliably. - - * src/*.[ch] - Added code for sf_read_float () and sf_readf_float () methods of accessing - file data. - -2001-07-20 Erik de Castro Lopo - - * src/paf.c src/wav_gsm610.c - Removed two printf()s which had escaped notice for some time (thanks - Sigbjørn Skjæret). - -2001-07-19 Erik de Castro Lopo - - * src/wav_gsm610.c - Fixed a bug which prevented GSM 6.10 encoded WAV files generated by - libsndfile from being played in Windoze (thanks klay). - -2001-07-18 Erik de Castro Lopo - - * src/common.[ch] - Implemented psf_binheader_readf() which will do for file header reading what - psf_binheader_writef() did for writing headers. Will eventually allow - libsndfile to read and write from pipes, including named pipes. - -2001-07-16 Erik de Castro Lopo - - * MacOS/config.h Win32/config.h - Attempted to bring these two files uptodate with src/config.h. As I don't - have access to either of these systems support for them may be completely - broken. - -2001-06-18 Erik de Castro Lopo - - * src/float32.c - Fixed bug for big endian processors that can't read 32 bit IEEE floats. Now - tested on Intel x86 and UltraSparc processors. - -2001-06-13 Erik de Castro Lopo - - * src/aiff.c - Modified to allow REX files (from Propellorhead's Recycle and Reason - programs) to be read. - REX files are basically an AIFF file with slightly unusual sequence of - chunks (AIFF files are supposed to allow any sequence) and some extra - application specific information. - Not yet able to write a REX file as the details of the application specific - data is unknown. - -2001-06-12 Erik de Castro Lopo - - * src/wav.c - Fixed endian bug when reading PEAK chunk on big endian machines. - - * src/common.c - Fixed endian bug when reading PEAK chunk on big endian machines with - --enable-force-broken-float configure option. - Fix psf_binheader_writef for (FORCE_BROKEN_FLOAT ||______) - -2001-06-07 Erik de Castro Lopo - - * configure.in src/config.h.in - Removed old CAN_READ_WRITE_x86_IEEE configure variable now that float - capabilities are detected at run time. - Added FORCE_BROKEN_FLOAT to allow testing of broken float code on machines - where the processor can in fact handle floats correctly. - - * src/float32.c - Rejigged code reading and writing of floats on broken processors. - - * m4/ - Removed this directory and all its files as they are no longer needed. - -2001-06-05 Erik de Castro Lopo - - * tests/peak_chunk_test.c - New test to validate reading and writing of peak chunk. - - * examples/sfconvert - Added -float32 option. - - * src/*.c - Changed all error return values to negative values (ie the negative of what - they were). - - * src/sndfile.c tests/error_test.c - Modified to take account of the previous change. - -2001-06-04 Erik de Castro Lopo - - * src/float32.c - File renamed from wav_float.c and renamed function to something more - general. - Added runtime detection of floating point capabilities. - Added recording of peaks during write for generation of PEAK chunk. - - * src/wav.c src/aiff.c - Added handing for PEAK chunk for floating point files. PEAK is read when the - file headers are read and generated when the file is closed. Logic is in - place for adding PEAK chunk to end of file when writing to a pipe (reading - and writing from/to pipe to be implemented soon). - - * src/sndfile.c - Modified sf_signal_max () to use PEAK values if present. - -2001-06-03 Erik de Castro Lopo - - * src/*.c - Added pcm_read_init () and pcm_write_init () to src/pcm.c and removed all - other calls to functions in this file from the filetype specific files. - - * src/*.c - Added alaw_read_init (), alaw_write_int (), ulaw_read_init () and - ulaw_write_init () and removed all other calls to functions in alaw.c and - ulaw.c from the filetype specific files. - - * tests/write_read_test.c - Added tests to validate sf_seek () on all file types. - - * src/raw.c - Implemented raw_seek () function to fix a bug where - sf_seek (file, 0, SEEK_SET) on a RAW file failed. - - * src/paf.c - Fixed a bug in paf24_seek () found due to added seeks tests in - tests/write_read_test.c - -2001-06-01 Erik de Castro Lopo - - * tests/read_seek_test.c - Fixed a couple of broken binary files. - - * src/aiff.c src/wav.c - Added handling of PEAK chunks on file read. - -2001-05-31 Erik de Castro Lopo - - * check_libsndfile.py - New file for the regression testing of libsndfile. - check_libsndfile.py is a Python script which reads in a file containing - filenames of audio files. Each file is checked by running the examples/sfinfo - program on them and checking for error or warning messages in the libsndfile - log buffer. - - * check_libsndfile.list - This is an example list of audio files for use with check_libsndfile.py - - * tests/lossy_comp_test.c - Changed the defined value of M_PI for math header files which don't have it. - This fixed validation test failures on MetroWerks compilers. Thanks to Lord - Praetor Satanus of Acheron for bringing this to my attention. - -2001-05-30 Erik de Castro Lopo - - * src/common.[ch] - Removed psf_header_setf () which was no longer required after refactoring - and simplification of header writing. - Added 'z' format specifier to psf_binheader_writef () for zero filling header - with N bytes. Used by paf.c and nist.c - - * tests/check_log_buffer.c - New file implementing check_log_buffer () which reads the log buffer of a - SNDFILE* object and searches for error and warning messages. Calls exit () - if any are found. - - * tests/*.c - Added calls to check_log_buffer () after each call to sf_open_XXX (). - -2001-05-29 Erik de Castro Lopo - - * src/wav.c src/wav_ms_adpcm.c src/wav_gsm610.c - Major rehack of header writing using psf_binheader_writef (). - -2001-05-28 Erik de Castro Lopo - - * src/wav.c src/wav_ima_adpcm.c - Major rehack of header writing using psf_binheader_writef (). - -2001-05-27 Erik de Castro Lopo - - * src/wav.c - Changed return type of get_encoding_str () to prevent compiler warnings on - Mac OSX. - - * src/aiff.c src/au.c - Major rehack of header writing using psf_binheader_writef (). - -2001-05-25 Erik de Castro Lopo - - * src/common.h src/common.c - Added comments. - Name of log buffer changed from strbuffer to logbuffer. - Name of log buffer index variable changed from strindex to logindex. - - * src/*.[ch] - Changed name of internal logging function from psf_sprintf () to - psf_log_printf (). - Changed name of internal header generation functions from - psf_[ab]h_printf () to psf_asciiheader_printf () and - psf_binheader_writef (). - Changed name of internal header manipulation function psf_hsetf () to - psf_header_setf (). - -2001-05-24 Erik de Castro Lopo - - * src/nist.c - Fixed reading and writing of sample_byte_format header. "01" means little - endian and "10" means big endian regardless of bit width. - - * configure.in - Detect Mac OSX and disable -Wall and -pedantic gcc options. Mac OSX is - way screwed up and spews out buckets of warning messages from the system - headers. - Added --disable-gcc-opt configure option (sets gcc optimisation to -O0 ) for - easier debugging. - Made decision to harmonise source code version number and .so library - version number. Future releases will stick to this rule. - - * doc/new_file_type.HOWTO - New file to document the addition of new file types to libsndfile. - -2001-05-23 Erik de Castro Lopo - - * src/nist.c - New file for reading/writing Sphere NIST audio file format. - Originally requested by Elis Pomales in 1999. - Retrieved from unstable (and untouched for 18 months) branch of libsndfile. - Some vital information gleaned from the source code to Bill Schottstaedt's - sndlib library : ftp://ccrma-ftp.stanford.edu/pub/Lisp/sndlib.tar.gz - Currently reading and writing 16, 24 and 32 bit, big-endian and little - endian, stereo and mono files. - - * src/common.h src/common.c - Added psf_ah_printf () function to help construction of ASCII headers (ie NIST). - - * configure.in - Added test for vsnprintf () required by psf_ah_printf (). - - * tests/write_read_test.c - Added tests for supported NIST files. - -2001-05-22 Erik de Castro Lopo - - * tests/write_read_test.c - Added tests for little endian AIFC files. - - * src/aiff.c - Minor re-working of aiff_open_write (). - Added write support for little endian PCM encoded AIFC files. - -2001-05-13 Erik de Castro Lopo - - * src/aiff.c - Minor re-working of aiff_open_read (). - Added read support for little endian PCM encoded AIFC files from the Mac - OSX CD ripper program. Guillaume Lessard provided a couple of sample files - and a working patch. - The patch was not used as is but gave a good guide as to what to do. - -2001-05-11 Erik de Castro Lopo - - * src/sndfile.h - Fixed comments about endian-ness of WAV and AIFF files. Guillaume Lessard - pointed out the error. - -2001-04-23 Erik de Castro Lopo - - * examples/make_sine.c - Re-write of this example using sample rate and required frequency in Hz. - -2001-02-11 Erik de Castro Lopo - - * src/sndfile.c - Fixed bug that prevented known file types from being read as RAW PCM data. - -2000-12-16 Erik de Castro Lopo - - * src/aiff.c - Added handing of COMT chunk. - -2000-11-16 Erik de Castro Lopo - - * examples/sfconvert.c - Fixed bug in normalisatio code. Pointed out by Johnny Wu. - -2000-11-08 Erik de Castro Lopo - - * Win32/config.h - Fixed the incorrect setting of HAVE_ENDIAN_H parameter. Win32 only issue. - -2000-10-27 Erik de Castro Lopo - - * tests/Makefile.am - Added -lm for write_read_test_LDADD. - -2000-10-16 Erik de Castro Lopo - - * src/sndfile.c src/au.c - Fixed bug which prevented writing of G723 24kbps AU files. - - * tests/lossy_comp_test.c - Corrrection to options for G723 tests. - - * configure.in - Added --disable-gcc-pipe option for DJGPP compiler (gcc on MS-DOS) which - doesn't allow gcc -pipe option. - -2000-09-03 Erik de Castro Lopo - - * src/ulaw.c src/alaw.c src/wav_imaadpcm.c src/msadpcm.c src/wav_gsm610.c - Fixed normailsation bugs shown up by new double_test program. - -2000-08-31 Erik de Castro Lopo - - * src/pcm.c - Fixed bug in normalisation code (spotted by Steve Lhomme). - - * tests/double_test.c - New file to test scaled and unscaled sf_read_double() and sf_write_double() - functions. - -2000-08-28 Erik de Castro Lopo - - * COPYING - Changed to the LGPL COPYING file (spotted by H. S. Teoh). - -2000-08-21 Erik de Castro Lopo - - * src/sndfile.h - Removed prototype of unimplemented function sf_get_info(). Added prototype - for sf_error_number() Thanks to Sigbjørn Skjæret for spotting these. - -2000-08-18 Erik de Castro Lopo - - * src/newpcm.h - New file to contain a complete rewrite of the PCM data handling. - -2000-08-15 Erik de Castro Lopo - - * src/sndfile.c - Fixed a leak of FILE* pointers in sf_open_write(). Thanks to Sigbjørn - Skjæret for spotting this one. - -2000-08-13 Erik de Castro Lopo - - * src/au_g72x.c src/G72x/g72x.c - Added G723 encoded AU file support. - - * tests/lossy_comp_test.c - Added tests for G721 and G723 encoded AU files. - -2000-08-06 Erik de Castro Lopo - - * all files - Changed the license to LGPL. Albert Faber who had copyright on - Win32/unistd.h gave his permission to change the license on that file. All - other files were either copyright erikd AT mega-nerd DOT com or copyright - under a GPL/LGPL compatible license. - -2000-08-06 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Fixed incorrect error message. - - * src/au_g72x.c src/G72x/* - G721 encoded AU files now working. - - * Win32/README-Win32.txt - Replaced this file with a new one which gives a full explanation - of how to build libsndfile under Win32. Thanks to Mike Ricos. - -2000-08-05 Erik de Castro Lopo - - * src/*.[ch] - Removed double leading underscores from the start of all variable and - function names. Identifiers with a leading underscores are reserved - for use by the compiler. - - * src/au_g72x.c src/G72x/* - Continued work on G721 encoded AU files. - -2000-07-12 Erik de Castro Lopo - - * src/G72x/* - New files for reading/writing G721 and G723 ADPCM audio. These files - are from a Sun Microsystems reference implementation released under a - free software licence. - Extensive changes to this code to make it fit in with libsndfile. - See the ChangeLog in this directory for details. - - * src/au_g72x.c - New file for G721 encoded AU files. - -2000-07-08 Erik de Castro Lopo - - * libsndfile.spec.in - Added a spec file for making RPMs. Thanks to Josh Green for supplying this. - -2000-06-28 Erik de Castro Lopo - - * src/sndfile.c src/sndfile.h - Add checking for and handling of header-less u-law encoded AU/SND files. - Any file with a ".au" or ".snd" file extension and without the normal - AU file header is treated as an 8kHz, u-law encoded file. - - * src/au.h - New function for opening a headerless u-law encoded file for read. - -2000-06-04 Erik de Castro Lopo - - * src/paf.c - Add checking for files shorter than minimal PAF file header length. - -2000-06-02 Erik de Castro Lopo - - * tests/write_read_test.c - Added extra sf_perror() calls when sf_write_XXXX fails. - -2000-05-29 Erik de Castro Lopo - - * src/common.c - Modified usage of va_arg() macro to work correctly on PowerPC - Linux. Thanks to Kyle Wheeler for giving me ssh access to his - machine while I was trying to track this down. - - * configure.in src/*.[ch] - Sorted out some endian-ness issues brought up by PowerPC Linux. - - * tests/read_seek_test.c - Added extra debugging for when tests fail. - -2000-05-18 Erik de Castro Lopo - - * src/wav.c - Fixed bug in GSM 6.10 handling for big-endian machines. Thanks - to Sigbjørn Skjæret for reporting this. - -2000-04-25 Erik de Castro Lopo - - * src/sndfile.c src/wav.c src/wav_gsm610.c - Finallised writing of GSM 6.10 WAV files. - - * tests/lossy_comp_test.c - Wrote new test code for GSM 6.10 files. - - * examples/sfinfo.c - Fixed incorrect format in printf() statement. - -2000-04-06 Erik de Castro Lopo - - * src/sndfile.h.in - Fixed comments about sf_perror () and sf_error_str (). - -2000-03-14 Erik de Castro Lopo - - * configure.in - Fixed --enable-justsrc option. - -2000-03-07 Erik de Castro Lopo - - * wav.c - Fixed checking of bytespersec field of header. Still some weirdness - with some files. - -2000-03-05 Erik de Castro Lopo - - * tests/lossy_comp_test.c - Added option to test PCM WAV files (sanity check). - Fixed bug in sf_seek() tests. - -2000-02-29 Erik de Castro Lopo - - * src/sndfile.c src/wav.c - Minor changes to allow writing of GSM 6.10 WAV files. - -2000-02-28 Erik de Castro Lopo - - * configure.in Makefile.am src/Makefile.am - Finally got around to figuring out how to build a single library from - multiple source directories. - Reading GSM 6.10 files now seems to work. - -2000-01-03 Erik de Castro Lopo - - * src/wav.c - Added more error reporting in read_fmt_chunk(). - -1999-12-21 Erik de Castro Lopo - - * examples/sfinfo.c - Modified program to accept multiple filenames from the command line. - -1999-11-27 Erik de Castro Lopo - - * src/wav_ima_adpcm.c - Moved code around in preparation to adding ability to read/write IMA ADPCM - encoded AIFF files. - -1999-11-16 Erik de Castro Lopo - - * src/common.c - Fixed put_int() and put_short() macros used by _psf_hprintf() which were - causing seg. faults on Sparc Solaris. - -1999-11-15 Erik de Castro Lopo - - * src/common.c - Added string.h to includes. Thanks to Sigbjxrn Skjfret. - - * src/svx.c - Fixed __svx_close() function to ensure FORM and BODY chunks are correctly - set. - -1999-10-01 Erik de Castro Lopo - - * src/au.c - Fixed handling of incorrect size field in AU header on read. Thanks to - Christoph Lauer for finding this problem. - -1999-09-28 Erik de Castro Lopo - - * src/aiff.c - Fixed a bug with incorrect SSND chunk length being written. This also lead - to finding an minor error in AIFF header parsing. Thanks to Dan Timis for - pointing this out. - -1999-09-24 Erik de Castro Lopo - - * src/paf.c - Fixed a bug with reading and writing 24 bit stereo PAF files. This problem - came to light when implementing tests for the new functions which operate - in terms of frames rather than items. - -1999-09-23 Erik de Castro Lopo - - * src/sndfile.c - Modified file type detection to use first 12 bytes of file rather than - file name extension. Required this because NIST files use the same - filename extension as Microsoft WAV files. - - * src/sndfile.c src/sndfile.h - Added short, int and double read/write functions which work in frames - rather than items. This was originally suggested by Maurizio Umberto - Puxeddu. - -1999-09-22 Erik de Castro Lopo - - * src/svx.c - Finished off implementation of write using __psf_hprintf(). - -1999-09-21 Erik de Castro Lopo - - * src/common.h - Added a buffer to SF_PRIVATE for writing the header. This is required - to make generating headers for IFF/SVX files easier as well as making - it easier to do re-write the headers which will be required when - sf_rewrite_header() is implemented. - - * src/common.c - Implemented __psf_hprintf() function. This is an internal function - which is documented briefly just above the code. - -1999-09-05 Erik de Castro Lopo - - * src/sndfile.c - Fixed a bug in sf_write_raw() where it was returning incorrect values - (thanks to Richard Dobson for finding this one). Must put in a test - routine for sf_read_raw and sf_write_raw. - - * src/aiff.c - Fixed default FORMsize in __aiff_open_write (). - - * src/sndfile.c - Added copy of filename to internal data structure. IFF/SVX files - contain a NAME header chunk. Both sf_open_read() and sf_open_write() - copy the file name (less the leading path information) to the - filename field. - - * src/svx.c - Started implementing writing of files. - -1999-08-04 Erik de Castro Lopo - - * src/svx.c - New file for reading/writing 8SVX and 16SVX files. - - * src/sndfile.[ch] src/common.h - Changes for SVX files. - - * src/aiff.c - Fixed header parsing when unknown chunk is found. - -1999-08-01 Erik de Castro Lopo - - * src/paf.c - New file for reading/writing Ensoniq PARIS audio file format. - - * src/sndfile.[ch] src/common.h - Changes for PAF files. - - * src/sndfile.[ch] - Added stuff for sf_get_lib_version() function. - - -1999-07-31 Erik de Castro Lopo - - * src/sndfile.h MacOS/config.h - Fixed minor MacOS configuration issues. - -1999-07-30 Erik de Castro Lopo - - * MacOS/ - Added a new directory for the MacOS config.h file and the - readme file. - - * src/aiff.c - Fixed calculation of datalength when reading SSND chunk. Thanks to - Sigbjørn Skjæret for pointing out this error. - -1999-07-29 Erik de Castro Lopo - - * src/sndfile.c src/sndfile.h src/raw.c - Further fixing of #includes for MacOS. - -1999-07-25 Erik de Castro Lopo - - * src/wav.c src/aiff.c - Added call to ferror () in main header parsing loop of __XXX_open_read - functions. This should fix problems on platforms (MacOS, AmigaOS) where - fseek()ing or fread()ing beyond the end of the file puts the FILE* - stream in an error state until clearerr() is called. - - * tests/write_read_test.c - Added tests for RAW header-less PCM files. - - * src/common.h - Moved definition of struct tribyte to pcm.c which is the only place - which needs it. - - * src/pcm.c - Modified all code which assumed sizeof (struct tribyte) == 3. This code - did not work on MacOS. Thanks to Ben "Jacobs" for pointing this out. - - * src/au.c - Removed from list of #includes (not being used). - - * src/sndfile.c - Added MacOS specific #ifdef to replace . - - * src/sndfile.h - Added MacOS specific #ifdef to replace . - - * src/sndfile.h - Added MacOS specific typedef for off_t. - - * MacOS-readme.txt - New file with instructions for building libsndfile under MacOS. Thanks - to Ben "Jacobs" for supplying these instructions. - -1999-07-24 Erik de Castro Lopo - - * configure.in - Removed sndfile.h from generated file list as there were no longer - any autoconf substitutions being made. - - * src/raw.c - New file for handling raw header-less PCM files. In order to open these - for read, the user must specify format, pcmbitwidth and channels in the - SF_INFO struct when calling sf_open_read (). - - * src/sndfile.c - Added support for raw header-less PCM files. - -1999-07-22 Erik de Castro Lopo - - * examples/sfinfo.c - Removed options so the sfinfo program always prints out all the information. - -1999-07-19 Erik de Castro Lopo - - * src/alaw.c - New file for A-law encoding (similar to u-law). - - * tests/alaw_test.c - New test program to test the A-law encode/decode lookup tables. - - * tests/lossy_comp_test.c - Added tests for a-law encoded WAV, AU and AULE files. - -1999-07-18 Erik de Castro Lopo - - * src/sndfile.c src/au.c - Removed second "#include ". Thanks to Ben "Jacobs" for pointing - this out. - -1999-07-18 Erik de Castro Lopo - - * tests/ulaw_test.c - New test program to test the u-law encode/decode lookup tables. - -1999-07-16 Erik de Castro Lopo - - * src/sndfile.h - Made corrections to comments on the return values from sf_seek (). - - * src/sndfile.c - Fixed boundary condition checking bug and accounting bug in sf_read_raw (). - -1999-07-15 Erik de Castro Lopo - - * src/au.c src/ulaw.c - Finished implementation of u-law encoded AU files. - - * src/wav.c - Implemented reading and writing of u-law encoded WAV files. - - * tests/ - Changed name of adpcm_test.c to lossy_comp_test.c. This test program - will now be used to test Ulaw and Alaw encoding as well as APDCM. - Added tests for Ulaw encoded WAV files. - -1999-07-14 Erik de Castro Lopo - - * tests/adpcm_test.c - Initialised amp variable in gen_signal() to remove compiler warning. - -1999-07-12 Erik de Castro Lopo - - * src/aiff.c - In __aiff_open_read () prevented fseek()ing beyond end of file which - was causing trouble on MacOS with the MetroWerks compiler. Thanks to - Ben "Jacobs" for pointing this out. - - *src/wav.c - Fixed as above in __wav_open_read (). - -1999-07-01 Erik de Castro Lopo - - * src/wav_ms_adpcm.c - Implemented MS ADPCM encoding. Code cleanup of decoder. - - * tests/adpcm_test.c - Added tests for MS ADPCM WAV files. - - * src/wav_ima_adpcm.c - Fixed incorrect parameter in call to srate2blocksize () from - __ima_writer_init (). - -1999-06-23 Erik de Castro Lopo - - * tests/read_seek_test.c - Added test for 8 bit AIFF files. - -1999-06-18 Erik de Castro Lopo - - * tests/write_read_test.c - Removed test for IMA ADPCM WAV files which is now done in adpcm_test.c - - * configure.in - Added -Wconversion to CFLAGS. - - * src/*.c tests/*.c examples/*.c - Fixed all warnings resulting from use of -Wconversion. - -1999-06-17 Erik de Castro Lopo - - * src/wav.c - Added fact chunk handling on read and write for all non WAVE_FORMAT_PCM - WAV files. - - * src/wav_ima.c - Changed block alignment to be dependant on sample rate. This should make - WAV files created with libsndfile compatible with the MS Windows media - players. - - * tests/adpcm_test.c - Reimplemented adpcm_test_short and implemented adpcm_test_int and - adpcm_test_double. - Now have full testing of IMA ADPCM WAV file read, write and seek. - -1999-06-15 Erik de Castro Lopo - - * src/wav_float.c - Fixed function prototype for x86f2d_array () which was causing ocassional - seg. faults on Sparc Solaris machines. - -1999-06-14 Erik de Castro Lopo - - * src/aiff.c - Fixed bug in __aiff_close where the length fields in the header were - not being correctly calculated before writing. - - * tests/write_read_test.c - Modified to detect the above bug in WAV, AIFF and AU files. - -1999-06-12 Erik de Castro Lopo - - * Win32/* - Added a contribution from Albert Faber to allow libsndfile to compile - under Win32 systems. libsndfile will now be used as part of LAME the - the MPEG 1 Layer 3 encoder (http://internet.roadrunner.com/~mt/mp3/). - -1999-06-11 Erik de Castro Lopo - - * configure.in - Changed to reflect previous changes. - - * src/wav_ima_adpcm.c - Fixed incorrect calculation of bytespersec header field (IMA ADPCM only). - - Fixed bug when writing from int or double data to IMA ADPCM file. Will need - to write test code for this. - - Fixed bug in __ima_write () whereby the length of the current block was - calculated incorrectly. Thanks to Jongcheon Park for pointing this out. - -1999-03-27 Erik de Castro Lopo - - * src/*.c - Changed all read/write/lseek function calls to fread/fwrite/ - fseek/ftell and added error checking of return values from - fread and fwrite in critical areas of the code. - - * src/au.c - Fixed incorrect datasize element in AU header on write. - - * tests/error_test.c - Add new test to check all error values have an associated error - string. This will avoid embarrassing real world core dumps. - -1999-03-23 Erik de Castro Lopo - - * src/wav.c src/aiff.c - Added handling for unknown chunk markers in the file. - -1999-03-22 Erik de Castro Lopo - - * src/sndfile.c - Filled in missing error strings in SndfileErrors array. Missing entries - can cause core dumps when calling sf_error-str (). Thanks to Sam - for finding this problem. - -1999-03-21 Erik de Castro Lopo - - * src/wav_ima_adpcm.c - Work on wav_ms_adpcm.c uncovered a bug in __ima_read () when reading - stereo files. Caused by not adjusting offset into buffer of decoded - samples for 2 channels. A similar bug existed in __ima_write (). - Need a test for stereo ADPCM files. - - * src/wav_ms_adpcm.c - Decoder working correctly. - -1999-03-18 Erik de Castro Lopo - - * configure.in Makefile.am - Added --enable-justsrc configuration variable sent by Sam - . - - * src/wav_ima_adpcm.c - Fixed bug when reading beyond end of data section due to not - checking pima->blockcount. - This uncovered __ima_seek () bug due to pima->blockcount being set - before calling __ima_init_block (). - -1999-03-17 Erik de Castro Lopo - - * src/wav.c - Started implementing MS ADPCM decoder. - If file is WAVE_FORMAT_ADPCM and length of data chunk is odd, this - encoder seems to add an extra byte. Why not just give an even data - length? - -1999-03-16 Erik de Castro Lopo - - * src/wav.c - Split code out of wav.c to create wav_float.c and wav_ima_adpcm.c. - This will make it easier to add and debug other kinds of WAV files - in future. - -1999-03-14 Erik de Castro Lopo - - * tests/ - Added adpcm_test.c which implements test functions for - IMA ADPCM reading/writing/seeking etc. - - * src/wav.c - Fixed many bugs in IMA ADPCM encoder and decoder. - -1999-03-11 Erik de Castro Lopo - - * src/wav.c - Finished implementing IMA ADPCM encoder and decoder (what a bitch!). - -1999-03-03 Erik de Castro Lopo - - * src/wav.c - Started implementing IMA ADPCM decoder. - -1999-03-02 Erik de Castro Lopo - - * src/sndfile.c - Fixed bug where the sf_read_XXX functions were returning a - incorrect read count when reading past end of file. - Fixed bug in sf_seek () when seeking backwards from end of file. - - * tests/read_seek_test.c - Added multiple read test to short_test(), int_test () and - double_test (). - Added extra chunk to all test WAV files to test that reading - stops at end of 'data' chunk. - -1999-02-21 Erik de Castro Lopo - - * tests/write_read_test.c - Added tests for little DEC endian AU files. - - * src/au.c - Add handling for DEC format little endian AU files. - -1999-02-20 Erik de Castro Lopo - - * src/aiff.c src/au.c src/wav.c - Add __psf_sprintf calls during header parsing. - - * src/sndfile.c src/common.c - Implement sf_header_info (sndfile.c) function and __psf_sprintf (common.c). - - * tests/write_read_test.c - Added tests for 8 bit PCM files (WAV, AIFF and AU). - - * src/au.c src/aiff.c - Add handling of 8 bit PCM data format. - - * src/aiff.c - On write, set blocksize in SSND chunk to zero like everybody else. - -1999-02-16 Erik de Castro Lopo - - * src/pcm.c: - Fixed bug in let2s_array (cptr was not being initialised). - - * src/sndfile.c: - Fixed bug in sf_read_raw and sf_write_raw. sf_seek should - now work when using these functions. - -1999-02-15 Erik de Castro Lopo - - * tests/write_read_test.c: - Force test_buffer array to be double aligned. Sparc Solaris - requires this. - -1999-02-14 Erik de Castro Lopo - - * src/pcm.c: - Fixed a bug which was causing errors in the reading - and writing of 24 bit PCM files. - - * doc/api.html - Finished of preliminary documentaion. - -1999-02-13 Erik de Castro Lopo - - * src/aiff.c: - Changed reading of 'COMM' chunk to avoid reading an int - which overlaps an int (4 byte) boundary. diff --git a/libs/libsndfile/INSTALL b/libs/libsndfile/INSTALL deleted file mode 100644 index b42a17ac46..0000000000 --- a/libs/libsndfile/INSTALL +++ /dev/null @@ -1,182 +0,0 @@ -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: - CPU-COMPANY-SYSTEM - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the host type. - - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Operation Controls -================== - - `configure' recognizes the following options to control how it -operates. - -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - -`--help' - Print a summary of the options to `configure', and exit. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`configure' also accepts some other, not widely useful, options. diff --git a/libs/libsndfile/M4/Makefile.am b/libs/libsndfile/M4/Makefile.am deleted file mode 100644 index e2d984a43a..0000000000 --- a/libs/libsndfile/M4/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -## Process this file with automake to produce Makefile.in - -EXTRA_DIST = add_cflags.m4 clip_mode.m4 endian.m4 \ - flexible_array.m4 llrint.m4 lrint.m4 lrintf.m4 octave.m4 extra_pkg.m4 - diff --git a/libs/libsndfile/M4/add_cflags.m4 b/libs/libsndfile/M4/add_cflags.m4 deleted file mode 100644 index 55a326c580..0000000000 --- a/libs/libsndfile/M4/add_cflags.m4 +++ /dev/null @@ -1,18 +0,0 @@ -dnl @synopsis MN_ADD_CFLAGS -dnl -dnl Add the given option to CFLAGS, if it doesn't break the compiler - -AC_DEFUN([MN_ADD_CFLAGS], -[AC_MSG_CHECKING([if $CC accepts $1]) - ac_add_cflags__old_cflags="$CFLAGS" - CFLAGS="$1" - AC_TRY_LINK([ - #include - ], - [puts("Hello, World!"); return 0;], - AC_MSG_RESULT([yes]) - CFLAGS="$ac_add_cflags__old_cflags $1", - AC_MSG_RESULT([no]) - CFLAGS="$ac_add_cflags__old_cflags" - ) -])# MN_ADD_CFLAGS diff --git a/libs/libsndfile/M4/add_cxxflags.m4 b/libs/libsndfile/M4/add_cxxflags.m4 deleted file mode 100644 index 1c0a4deb96..0000000000 --- a/libs/libsndfile/M4/add_cxxflags.m4 +++ /dev/null @@ -1,19 +0,0 @@ -dnl @synopsis MN_ADD_CXXFLAGS -dnl -dnl Add the given option to CXXFLAGS, if it doesn't break the compiler - -AC_DEFUN([MN_ADD_CXXFLAGS], -[AC_MSG_CHECKING([if $CXX accepts $1]) - AC_LANG_ASSERT([C++]) - ac_add_cxxflags__old_cxxflags="$CXXFLAGS" - CXXFLAGS="$1" - AC_TRY_LINK([ - #include - ], - [puts("Hello, World!"); return 0;], - AC_MSG_RESULT([yes]) - CXXFLAGS="$ac_add_cxxflags__old_cxxflags $1", - AC_MSG_RESULT([no]) - CXXFLAGS="$ac_add_cxxflags__old_cxxflags" - ) -])# MN_ADD_CXXFLAGS diff --git a/libs/libsndfile/M4/clang.m4 b/libs/libsndfile/M4/clang.m4 deleted file mode 100644 index 4cf3077d64..0000000000 --- a/libs/libsndfile/M4/clang.m4 +++ /dev/null @@ -1,31 +0,0 @@ -dnl @synopsis MN_C_COMPILER_IS_CLANG -dnl -dnl Find out if a compiler claiming to be gcc really is gcc (fuck you clang). -dnl @version 1.0 Oct 31 2013 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - - -AC_DEFUN([MN_C_COMPILER_IS_CLANG], -[AC_CACHE_CHECK(whether we are using the CLANG C compiler, - mn_cv_c_compiler_clang, - [ AC_LANG_ASSERT(C) - AC_TRY_LINK([ - #include - ], - [ - #ifndef __clang__ - This is not clang! - #endif - ], - mn_cv_c_compiler_clang=yes, - mn_cv_c_compiler_clang=no - ]) - ) -]) diff --git a/libs/libsndfile/M4/clip_mode.m4 b/libs/libsndfile/M4/clip_mode.m4 deleted file mode 100644 index 4556b937a0..0000000000 --- a/libs/libsndfile/M4/clip_mode.m4 +++ /dev/null @@ -1,124 +0,0 @@ -dnl @synopsis MN_C_CLIP_MODE -dnl -dnl Determine the clipping mode when converting float to int. -dnl @version 1.0 May 17 2003 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - - - - - - - -dnl Find the clipping mode in the following way: -dnl 1) If we are not cross compiling test it. -dnl 2) IF we are cross compiling, assume that clipping isn't done correctly. - -AC_DEFUN([MN_C_CLIP_MODE], -[AC_CACHE_CHECK(processor clipping capabilities, - ac_cv_c_clip_type, - -# Initialize to unknown -ac_cv_c_clip_positive=unknown -ac_cv_c_clip_negative=unknown - - -if test $ac_cv_c_clip_positive = unknown ; then - AC_TRY_RUN( - [[ - #define _ISOC9X_SOURCE 1 - #define _ISOC99_SOURCE 1 - #define __USE_ISOC99 1 - #define __USE_ISOC9X 1 - #include - int main (void) - { double fval ; - int k, ival ; - - fval = 1.0 * 0x7FFFFFFF ; - for (k = 0 ; k < 100 ; k++) - { ival = (lrint (fval)) >> 24 ; - if (ival != 127) - return 1 ; - - fval *= 1.2499999 ; - } ; - - return 0 ; - } - ]], - ac_cv_c_clip_positive=yes, - ac_cv_c_clip_positive=no, - ac_cv_c_clip_positive=unknown - ) - - AC_TRY_RUN( - [[ - #define _ISOC9X_SOURCE 1 - #define _ISOC99_SOURCE 1 - #define __USE_ISOC99 1 - #define __USE_ISOC9X 1 - #include - int main (void) - { double fval ; - int k, ival ; - - fval = -8.0 * 0x10000000 ; - for (k = 0 ; k < 100 ; k++) - { ival = (lrint (fval)) >> 24 ; - if (ival != -128) - return 1 ; - - fval *= 1.2499999 ; - } ; - - return 0 ; - } - ]], - ac_cv_c_clip_negative=yes, - ac_cv_c_clip_negative=no, - ac_cv_c_clip_negative=unknown - ) - fi - -if test $ac_cv_c_clip_positive = yes ; then - ac_cv_c_clip_positive=1 -else - ac_cv_c_clip_positive=0 - fi - -if test $ac_cv_c_clip_negative = yes ; then - ac_cv_c_clip_negative=1 -else - ac_cv_c_clip_negative=0 - fi - -[[ -case "$ac_cv_c_clip_positive$ac_cv_c_clip_negative" in - "00") - ac_cv_c_clip_type="none" - ;; - "10") - ac_cv_c_clip_type="positive" - ;; - "01") - ac_cv_c_clip_type="negative" - ;; - "11") - ac_cv_c_clip_type="both" - ;; - esac - ]] - -) -] - -)# MN_C_CLIP_MODE - - diff --git a/libs/libsndfile/M4/endian.m4 b/libs/libsndfile/M4/endian.m4 deleted file mode 100644 index 5d766ff39e..0000000000 --- a/libs/libsndfile/M4/endian.m4 +++ /dev/null @@ -1,155 +0,0 @@ -dnl @synopsis MN_C_FIND_ENDIAN -dnl -dnl Determine endian-ness of target processor. -dnl @version 1.1 Mar 03 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Majority written from scratch to replace the standard autoconf macro -dnl AC_C_BIGENDIAN. Only part remaining from the original it the invocation -dnl of the AC_TRY_RUN macro. -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - -dnl Find endian-ness in the following way: -dnl 1) Look in . -dnl 2) If 1) fails, look in and . -dnl 3) If 1) and 2) fails and not cross compiling run a test program. -dnl 4) If 1) and 2) fails and cross compiling then guess based on target. - -AC_DEFUN([MN_C_FIND_ENDIAN], -[AC_CACHE_CHECK(processor byte ordering, - ac_cv_c_byte_order, - -# Initialize to unknown -ac_cv_c_byte_order=unknown - -if test x$ac_cv_header_endian_h = xyes ; then - - # First try which should set BYTE_ORDER. - - [AC_TRY_LINK([ - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - [AC_TRY_LINK([ - #include - #if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=big - )] - - fi - -if test $ac_cv_c_byte_order = unknown ; then - - [AC_TRY_LINK([ - #include - #include - #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros - #endif - ], return 0 ;, - - [AC_TRY_LINK([ - #include - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - [AC_TRY_LINK([ - #include - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - )] - - fi - -if test $ac_cv_c_byte_order = unknown ; then - if test $cross_compiling = yes ; then - # This is the last resort. Try to guess the target processor endian-ness - # by looking at the target CPU type. - [ - case "$target_cpu" in - alpha* | i?86* | mipsel* | ia64*) - ac_cv_c_byte_order=little - ;; - - m68* | mips* | powerpc* | hppa* | sparc*) - ac_cv_c_byte_order=big - ;; - - esac - ] - else - AC_TRY_RUN( - [[ - int main (void) - { /* Are we little or big endian? From Harbison&Steele. */ - union - { long l ; - char c [sizeof (long)] ; - } u ; - u.l = 1 ; - return (u.c [sizeof (long) - 1] == 1); - } - ]], , ac_cv_c_byte_order=big, - ) - - AC_TRY_RUN( - [[int main (void) - { /* Are we little or big endian? From Harbison&Steele. */ - union - { long l ; - char c [sizeof (long)] ; - } u ; - u.l = 1 ; - return (u.c [0] == 1); - }]], , ac_cv_c_byte_order=little, - ) - fi - fi - -) - -if test $ac_cv_c_byte_order = big ; then - ac_cv_c_big_endian=1 - ac_cv_c_little_endian=0 -elif test $ac_cv_c_byte_order = little ; then - ac_cv_c_big_endian=0 - ac_cv_c_little_endian=1 -else - ac_cv_c_big_endian=0 - ac_cv_c_little_endian=0 - - AC_MSG_WARN([[*****************************************************************]]) - AC_MSG_WARN([[*** Not able to determine endian-ness of target processor. ]]) - AC_MSG_WARN([[*** The constants CPU_IS_BIG_ENDIAN and CPU_IS_LITTLE_ENDIAN in ]]) - AC_MSG_WARN([[*** src/config.h may need to be hand editied. ]]) - AC_MSG_WARN([[*****************************************************************]]) - fi - -] -)# MN_C_FIND_ENDIAN - - diff --git a/libs/libsndfile/M4/extra_largefile.m4 b/libs/libsndfile/M4/extra_largefile.m4 deleted file mode 100644 index 3e614c3f70..0000000000 --- a/libs/libsndfile/M4/extra_largefile.m4 +++ /dev/null @@ -1,114 +0,0 @@ -dnl By default, many hosts won't let programs access large files; -dnl one must use special compiler options to get large-file access to work. -dnl For more details about this brain damage please see: -dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html - -dnl Written by Paul Eggert . - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl MN_SYS_EXTRA_LARGEFILE_FLAGS(FLAGSNAME) -AC_DEFUN([MN_SYS_EXTRA_LARGEFILE_FLAGS], - [AC_CACHE_CHECK([for $1 value to request large file support], - ac_cv_sys_largefile_$1, - [ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || { - ac_cv_sys_largefile_$1=no - ifelse($1, CFLAGS, - [case "$host_os" in - # IRIX 6.2 and later require cc -n32. -changequote(, )dnl - irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) -changequote([, ])dnl - if test "$GCC" != yes; then - ac_cv_sys_largefile_CFLAGS=-n32 - fi - ac_save_CC="$CC" - CC="$CC $ac_cv_sys_largefile_CFLAGS" - AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) - CC="$ac_save_CC" - esac]) - }])]) - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(VAR, VAL) -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND], - [case $2 in - no) ;; - ?*) - case "[$]$1" in - '') $1=$2 ;; - *) $1=[$]$1' '$2 ;; - esac ;; - esac]) - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT) -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE], - [AC_CACHE_CHECK([for $1], $2, - [$2=no -changequote(, )dnl - $4 - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - -D$1) - $2=1 ;; - -D$1=*) - $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; - esac - done -changequote([, ])dnl - ]) - if test "[$]$2" != no; then - AC_DEFINE_UNQUOTED([$1], [$]$2, [$3]) - fi]) - -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE], - [AC_REQUIRE([AC_CANONICAL_HOST]) - AC_ARG_ENABLE(largefile, - [ --disable-largefile omit support for large files]) - if test "$enable_largefile" != no; then - AC_CHECK_TOOL(GETCONF, getconf) - MN_SYS_EXTRA_LARGEFILE_FLAGS(CFLAGS) - MN_SYS_EXTRA_LARGEFILE_FLAGS(LDFLAGS) - MN_SYS_EXTRA_LARGEFILE_FLAGS(LIBS) - - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - no) ;; - -D_FILE_OFFSET_BITS=*) ;; - -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; - -D_LARGE_FILES | -D_LARGE_FILES=*) ;; - -D?* | -I?*) - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;; - *) - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;; - esac - done - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, - ac_cv_sys_file_offset_bits, - [Number of bits in a file offset, on hosts where this is settable.]) - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_file_offset_bits=64 ;; - esac] - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, - ac_cv_sys_largefile_source, - [Define to make fseeko etc. visible, on some hosts.], - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_largefile_source=1 ;; - esac]) - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGE_FILES, - ac_cv_sys_large_files, - [Define for large files, on AIX-style hosts.], - [case "$host_os" in - # AIX 4.2 and later - aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) - ac_cv_sys_large_files=1 ;; - esac]) - fi - ]) - diff --git a/libs/libsndfile/M4/extra_pkg.m4 b/libs/libsndfile/M4/extra_pkg.m4 deleted file mode 100644 index afe474e224..0000000000 --- a/libs/libsndfile/M4/extra_pkg.m4 +++ /dev/null @@ -1,105 +0,0 @@ -# extra_pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# -# Copyright (c) 2008-2012 Erik de Castro Lopo -# Copyright (c) 2004 Scott James Remnant . -# -# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# -------------------------------------------------------------- -# PKG_CHECK_MOD_VERSION(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# This is a very slight modification to the macro PKG_CHECK_MODULES that -# is in the original pkg.m4 file. It prints the versions in the checking -# message (erikd@mega-nerd.com). - -AC_DEFUN([PKG_CHECK_MOD_VERSION], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $2 ]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -pkg_link_saved_CFLAGS=$CFLAGS -pkg_link_saved_LIBS=$LIBS - -eval "pkg_CFLAGS=\${pkg_cv_[]$1[]_CFLAGS}" -eval "pkg_LIBS=\${pkg_cv_[]$1[]_LIBS}" - -CFLAGS="$CFLAGS $pkg_CFLAGS" -LIBS="$LIBS $pkg_LIBS" - -AC_TRY_LINK([], puts ("");, pkg_link=yes, pkg_link=no) - -CFLAGS=$pkg_link_saved_CFLAGS -LIBS=$pkg_link_saved_LIBS - -if test $pkg_link = no ; then - $as_echo_n "link failed ... " - pkg_failed=yes - fi - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - ifelse([$4], , [AC_MSG_ERROR(dnl -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) -elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])], - [$4]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) -fi[]dnl -])# PKG_CHECK_MOD_VERSION diff --git a/libs/libsndfile/M4/flexible_array.m4 b/libs/libsndfile/M4/flexible_array.m4 deleted file mode 100644 index 661da17b23..0000000000 --- a/libs/libsndfile/M4/flexible_array.m4 +++ /dev/null @@ -1,32 +0,0 @@ -dnl @synopsis MN_C99_FLEXIBLE_ARRAY -dnl -dnl Dose the compiler support the 1999 ISO C Standard "stuct hack". -dnl @version 1.1 Mar 15 2004 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - -AC_DEFUN([MN_C99_FLEXIBLE_ARRAY], -[AC_CACHE_CHECK(C99 struct flexible array support, - ac_cv_c99_flexible_array, - -# Initialize to unknown -ac_cv_c99_flexible_array=no - -AC_TRY_LINK([[ - #include - typedef struct { - int k; - char buffer [] ; - } MY_STRUCT ; - ]], - [ MY_STRUCT *p = calloc (1, sizeof (MY_STRUCT) + 42); ], - ac_cv_c99_flexible_array=yes, - ac_cv_c99_flexible_array=no - ))] -) # MN_C99_FLEXIBLE_ARRAY - diff --git a/libs/libsndfile/M4/gcc_version.m4 b/libs/libsndfile/M4/gcc_version.m4 deleted file mode 100644 index f8c5cbebe4..0000000000 --- a/libs/libsndfile/M4/gcc_version.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl @synopsis MN_GCC_VERSION -dnl -dnl Find the version of gcc. -dnl @version 1.0 Nov 05 2007 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - -AC_DEFUN([MN_GCC_VERSION], -[ -if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then - - AC_MSG_CHECKING([for version of $CC]) - GCC_VERSION=`$CC -dumpversion` - AC_MSG_RESULT($GCC_VERSION) - - changequote(,)dnl - GCC_MAJOR_VERSION=`echo $GCC_VERSION | sed "s/\..*//"` - GCC_MINOR_VERSION=`echo $GCC_VERSION | sed "s/$GCC_MAJOR_VERSION\.//" | sed "s/\..*//"` - changequote([,])dnl - fi - -AC_SUBST(GCC_VERSION) -AC_SUBST(GCC_MAJOR_VERSION) -AC_SUBST(GCC_MINOR_VERSION) - -])# MN_GCC_VERSION - diff --git a/libs/libsndfile/M4/llrint.m4 b/libs/libsndfile/M4/llrint.m4 deleted file mode 100644 index 66be206187..0000000000 --- a/libs/libsndfile/M4/llrint.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl @synopsis MN_C99_FUNC_LLRINT -dnl -dnl Check whether C99's llrint function is available. -dnl @version 1.1 Sep 30 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([MN_C99_FUNC_LLRINT], -[AC_CACHE_CHECK(for llrint, - ac_cv_c99_llrint, -[ -llrint_save_CFLAGS=$CFLAGS -CFLAGS="-lm" -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -#include -], int64_t x ; x = llrint(3.14159) ;, ac_cv_c99_llrint=yes, ac_cv_c99_llrint=no) - -CFLAGS=$llrint_save_CFLAGS - -]) - -if test "$ac_cv_c99_llrint" = yes; then - AC_DEFINE(HAVE_LLRINT, 1, - [Define if you have C99's llrint function.]) -fi -])# MN_C99_FUNC_LLRINT - diff --git a/libs/libsndfile/M4/lrint.m4 b/libs/libsndfile/M4/lrint.m4 deleted file mode 100644 index c2c21d60f4..0000000000 --- a/libs/libsndfile/M4/lrint.m4 +++ /dev/null @@ -1,37 +0,0 @@ -dnl @synopsis MN_C99_FUNC_LRINT -dnl -dnl Check whether C99's lrint function is available. -dnl @version 1.3 Feb 12 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([MN_C99_FUNC_LRINT], -[AC_CACHE_CHECK(for lrint, - ac_cv_c99_lrint, -[ -lrint_save_CFLAGS=$CFLAGS -CFLAGS="-lm" -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -], if (!lrint(3.14159)) lrint(2.7183);, ac_cv_c99_lrint=yes, ac_cv_c99_lrint=no) - -CFLAGS=$lrint_save_CFLAGS - -]) - -if test "$ac_cv_c99_lrint" = yes; then - AC_DEFINE(HAVE_LRINT, 1, - [Define if you have C99's lrint function.]) -fi -])# MN_C99_FUNC_LRINT - diff --git a/libs/libsndfile/M4/lrintf.m4 b/libs/libsndfile/M4/lrintf.m4 deleted file mode 100644 index 04f4d6603c..0000000000 --- a/libs/libsndfile/M4/lrintf.m4 +++ /dev/null @@ -1,37 +0,0 @@ -dnl @synopsis MN_C99_FUNC_LRINTF -dnl -dnl Check whether C99's lrintf function is available. -dnl @version 1.3 Feb 12 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([MN_C99_FUNC_LRINTF], -[AC_CACHE_CHECK(for lrintf, - ac_cv_c99_lrintf, -[ -lrintf_save_CFLAGS=$CFLAGS -CFLAGS="-lm" -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no) - -CFLAGS=$lrintf_save_CFLAGS - -]) - -if test "$ac_cv_c99_lrintf" = yes; then - AC_DEFINE(HAVE_LRINTF, 1, - [Define if you have C99's lrintf function.]) -fi -])# MN_C99_FUNC_LRINTF - diff --git a/libs/libsndfile/M4/mkoctfile_version.m4 b/libs/libsndfile/M4/mkoctfile_version.m4 deleted file mode 100644 index c17333ea25..0000000000 --- a/libs/libsndfile/M4/mkoctfile_version.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl @synopsis OCTAVE_MKOCTFILE_VERSION -dnl -dnl Find the version of mkoctfile. -dnl @version 1.0 Aug 23 2007 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - -AC_DEFUN([OCTAVE_MKOCTFILE_VERSION], -[ - - -AC_ARG_WITH(mkoctfile, - AC_HELP_STRING([--with-mkoctfile], [choose the mkoctfile version]), - [ with_mkoctfile=$withval ]) - -test -z "$with_mkoctfile" && with_mkoctfile=mkoctfile - -AC_CHECK_PROG(HAVE_MKOCTFILE,$with_mkoctfile,yes,no) - -if test "x$ac_cv_prog_HAVE_MKOCTFILE" = "xyes" ; then - MKOCTFILE=$with_mkoctfile - - AC_MSG_CHECKING([for version of $MKOCTFILE]) - MKOCTFILE_VERSION=`$with_mkoctfile --version 2>&1 | sed 's/mkoctfile, version //g'` - AC_MSG_RESULT($MKOCTFILE_VERSION) - fi - -AC_SUBST(MKOCTFILE) -AC_SUBST(MKOCTFILE_VERSION) - -])# OCTAVE_MKOCTFILE_VERSION - diff --git a/libs/libsndfile/M4/octave.m4 b/libs/libsndfile/M4/octave.m4 deleted file mode 100644 index 88d5a5b9b0..0000000000 --- a/libs/libsndfile/M4/octave.m4 +++ /dev/null @@ -1,143 +0,0 @@ -dnl Evaluate an expression in octave -dnl -dnl OCTAVE_EVAL(expr,var) -> var=expr -dnl -dnl Stolen from octave-forge - -AC_DEFUN([OCTAVE_EVAL], -[ -AC_MSG_CHECKING([for $1 in $OCTAVE]) -$2=`TERM=;$OCTAVE -qfH --eval "disp($1)"` -AC_MSG_RESULT($$2) -AC_SUBST($2) -]) # OCTAVE_EVAL - -dnl @synopsis AC_OCTAVE_VERSION -dnl -dnl Find the version of Octave. -dnl @version 1.0 Aug 23 2007 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - -AC_DEFUN([AC_OCTAVE_VERSION], -[ - -AC_ARG_WITH(octave, - AC_HELP_STRING([--with-octave], [choose the octave version]), - [ with_octave=$withval ]) - -test -z "$with_octave" && with_octave=octave - -AC_CHECK_PROG(HAVE_OCTAVE,$with_octave,yes,no) - -if test "x$ac_cv_prog_HAVE_OCTAVE" = "xyes" ; then - OCTAVE=$with_octave - OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION) - fi - -AC_SUBST(OCTAVE) -AC_SUBST(OCTAVE_VERSION) - -])# AC_OCTAVE_VERSION - -dnl @synopsis AC_OCTAVE_CONFIG_VERSION -dnl -dnl Find the version of Octave. -dnl @version 1.0 Aug 23 2007 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - -AC_DEFUN([AC_OCTAVE_CONFIG_VERSION], -[ - -AC_ARG_WITH(octave-config, - AC_HELP_STRING([--with-octave-config], [choose the octave-config version]), - [ with_octave_config=$withval ]) - -test -z "$with_octave_config" && with_octave_config=octave-config - -AC_CHECK_PROG(HAVE_OCTAVE_CONFIG,$with_octave_config,yes,no) - -if test "x$ac_cv_prog_HAVE_OCTAVE_CONFIG" = "xyes" ; then - OCTAVE_CONFIG=$with_octave_config - AC_MSG_CHECKING([for version of $OCTAVE_CONFIG]) - OCTAVE_CONFIG_VERSION=`$OCTAVE_CONFIG --version` - AC_MSG_RESULT($OCTAVE_CONFIG_VERSION) - fi - -AC_SUBST(OCTAVE_CONFIG) -AC_SUBST(OCTAVE_CONFIG_VERSION) - -])# AC_OCTAVE_CONFIG_VERSION - -dnl @synopsis AC_OCTAVE_BUILD -dnl -dnl Check programs and headers required for building octave plugins. -dnl @version 1.0 Aug 23 2007 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - - -AC_DEFUN([AC_OCTAVE_BUILD], -[ - -dnl Default to no. -OCTAVE_BUILD=no - -AC_OCTAVE_VERSION -OCTAVE_MKOCTFILE_VERSION -AC_OCTAVE_CONFIG_VERSION - -prog_concat="$ac_cv_prog_HAVE_OCTAVE$ac_cv_prog_HAVE_OCTAVE_CONFIG$ac_cv_prog_HAVE_MKOCTFILE" - -if test "x$prog_concat" = "xyesyesyes" ; then - if test "x$OCTAVE_VERSION" != "x$MKOCTFILE_VERSION" ; then - AC_MSG_WARN([** Mismatch between versions of octave and mkoctfile. **]) - AC_MSG_WARN([** Octave libsndfile modules will not be built. **]) - elif test "x$OCTAVE_VERSION" != "x$OCTAVE_CONFIG_VERSION" ; then - AC_MSG_WARN([** Mismatch between versions of octave and octave-config. **]) - AC_MSG_WARN([** Octave libsndfile modules will not be built. **]) - else - case "$MKOCTFILE_VERSION" in - 2.*) - AC_MSG_WARN([Octave version 2.X is not supported.]) - ;; - 3.*) - OCTAVE_DEST_ODIR=`$OCTAVE_CONFIG --oct-site-dir | sed 's%^/usr%${prefix}%'` - OCTAVE_DEST_MDIR=`$OCTAVE_CONFIG --m-site-dir | sed 's%^/usr%${prefix}%'` - - OCTAVE_BUILD=yes - ;; - *) - AC_MSG_WARN([Octave version $MKOCTFILE_VERSION is not supported.]) - ;; - esac - fi - AC_MSG_RESULT([building octave libsndfile module... $OCTAVE_BUILD]) - fi - -AC_SUBST(OCTAVE_DEST_ODIR) -AC_SUBST(OCTAVE_DEST_MDIR) - -AC_SUBST(MKOCTFILE) - -AM_CONDITIONAL(BUILD_OCTAVE_MOD, test "x$OCTAVE_BUILD" = xyes) - -])# AC_OCTAVE_BUILD diff --git a/libs/libsndfile/M4/really_gcc.m4 b/libs/libsndfile/M4/really_gcc.m4 deleted file mode 100644 index 67aed7802f..0000000000 --- a/libs/libsndfile/M4/really_gcc.m4 +++ /dev/null @@ -1,33 +0,0 @@ -dnl @synopsis MN_GCC_REALLY_IS_GCC -dnl -dnl Find out if a compiler claiming to be gcc really is gcc (fuck you clang). -dnl @version 1.0 Oct 31 2013 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl - -# If the configure script has already detected GNU GCC, then make sure it -# isn't CLANG masquerading as GCC. - -AC_DEFUN([MN_GCC_REALLY_IS_GCC], -[ AC_LANG_ASSERT(C) - if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then - AC_TRY_LINK([ - #include - ], - [ - #ifdef __clang__ - This is clang! - #endif - ], - ac_cv_c_compiler_gnu=yes, - ac_cv_c_compiler_gnu=no - ) - fi - -]) diff --git a/libs/libsndfile/M4/stack_protect.m4 b/libs/libsndfile/M4/stack_protect.m4 deleted file mode 100644 index bf27e6e74f..0000000000 --- a/libs/libsndfile/M4/stack_protect.m4 +++ /dev/null @@ -1,73 +0,0 @@ -dnl Copyright (C) 2013 Xiph.org Foundation -dnl -dnl Redistribution and use in source and binary forms, with or without -dnl modification, are permitted provided that the following conditions -dnl are met: -dnl -dnl - Redistributions of source code must retain the above copyright -dnl notice, this list of conditions and the following disclaimer. -dnl -dnl - Redistributions in binary form must reproduce the above copyright -dnl notice, this list of conditions and the following disclaimer in the -dnl documentation and/or other materials provided with the distribution. -dnl -dnl - Neither the name of the Xiph.org Foundation nor the names of its -dnl contributors may be used to endorse or promote products derived from -dnl this software without specific prior written permission. -dnl -dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -dnl ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -dnl CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -dnl Want to know of GCC stack protector works, botfor the C and for the C++ -dnl compiler. -dnl -dnl Just checking if the compiler accepts the required CFLAGSs is not enough -dnl because we have seen at least one instance where this check was -dnl in-sufficient. -dnl -dnl Instead, try to compile and link a test program with the stack protector -dnl flags. If that works, we use it. - -AC_DEFUN([XIPH_GCC_STACK_PROTECTOR], -[AC_LANG_ASSERT(C) - AC_MSG_CHECKING([if $CC supports stack smash protection]) - xiph_stack_check_old_cflags="$CFLAGS" - SSP_FLAGS="-fstack-protector --param ssp-buffer-size=4" - CFLAGS=$SSP_FLAGS - AC_TRY_LINK([ - #include - ], - [puts("Hello, World!"); return 0;], - AC_MSG_RESULT([yes]) - CFLAGS="$xiph_stack_check_old_cflags $SSP_FLAGS", - AC_MSG_RESULT([no]) - CFLAGS="$xiph_stack_check_old_cflags" - ) -])# XIPH_GCC_STACK_PROTECTOR - -AC_DEFUN([XIPH_GXX_STACK_PROTECTOR], -[AC_LANG_PUSH([C++]) - AC_MSG_CHECKING([if $CXX supports stack smash protection]) - xiph_stack_check_old_cflags="$CFLAGS" - SSP_FLAGS="-fstack-protector --param ssp-buffer-size=4" - CFLAGS=$SSP_FLAGS - AC_TRY_LINK([ - #include - ], - [puts("Hello, World!"); return 0;], - AC_MSG_RESULT([yes]) - CFLAGS="$xiph_stack_check_old_cflags $SSP_FLAGS", - AC_MSG_RESULT([no]) - CFLAGS="$xiph_stack_check_old_cflags" - ) - AC_LANG_POP([C++]) -])# XIPH_GXX_STACK_PROTECTOR diff --git a/libs/libsndfile/Makefile.am b/libs/libsndfile/Makefile.am deleted file mode 100644 index a429c5b3fa..0000000000 --- a/libs/libsndfile/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -## Process this file with automake to produce Makefile.in - -ACLOCAL_AMFLAGS = -I M4 - -DISTCHECK_CONFIGURE_FLAGS = --enable-gcc-werror - -if BUILD_OCTAVE_MOD -octave_dir = Octave -endif - -SUBDIRS = M4 Win32 src $(octave_dir) -#man doc examples regtest tests programs - -DIST_SUBDIRS = M4 man doc Win32 src Octave examples regtest tests programs - -EXTRA_DIST = libsndfile.spec.in sndfile.pc.in Scripts/android-configure.sh \ - Scripts/linux-to-win-cross-configure.sh Scripts/build-test-tarball.mk.in - -CLEANFILES = *~ - -#pkgconfig_DATA = sndfile.pc - -m4datadir = $(datadir)/aclocal - -#=============================================================================== - -test: check-recursive - -# Target to make autogenerated files. -genfiles : - (cd src ; make genfiles) -# (cd tests ; make genfiles) - -checkprograms : - (cd src ; make libsndfile.la checkprograms) -# (cd tests ; make checkprograms) - -testprogs : - (cd src ; make testprogs) -# (cd tests ; make testprogs) - - -test-tarball : Scripts/build-test-tarball.mk - (cd src ; make all libsndfile.la checkprograms) -# (cd tests ; make all checkprograms) -# make -f Scripts/build-test-tarball.mk diff --git a/libs/libsndfile/Mingw-make-dist.sh b/libs/libsndfile/Mingw-make-dist.sh deleted file mode 100755 index f2a6474233..0000000000 --- a/libs/libsndfile/Mingw-make-dist.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2006 Erik de Castro Lopo -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the author nor the names of any contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -set -e - -function unix_to_dos { - sed -e "s/\n/\r\n/" $1 > temp_file - mv -f temp_file $1 -} - -if [ $# -lt 1 ] || [ $# -gt 2 ]; then - echo "Usage : Mingw-make-dist.sh ." - exit 1 - fi - -TARGZ=$1 -if [ ! -f $TARGZ ]; then - echo "Can't find source tarball." - fi - -TARGZ=$1 -if [ ! -f $TARGZ.asc ]; then - echo "Can't find source tarball signature." - fi - -UNAME=`uname -s` -if [ x$UNAME != "xMINGW32_NT-5.1" ]; then - echo "Not able to build Win32 binaries on this platform." - fi - -echo "Building MinGW binary/source zip file." - -VERSION=`pwd | sed -e "s#.*/##" | sed -e s/libsndfile-//` -BUILD=`echo $VERSION | sed -e "s/\./_/g"` -INSTALL="libsndfile-$BUILD" -ZIPNAME="$INSTALL.zip" - -if [ -z "$BUILD" ]; then - echo "Bad BUILD variable : '$BUILD'" - exit 1 - fi - -if [ ! -d $INSTALL/ ]; then - mkdir $INSTALL - fi - -if [ ! -f config.status ]; then - ./configure --prefix=`pwd`/$INSTALL/ -else - teststr=`grep "with options" config.status | grep -- --prefix=` - if [ -z "$teststr" ]; then - # --disable-static doesn't work. - ./configure --prefix=`pwd`/$INSTALL/ - fi - fi - -if [ ! -f src/.libs/libsndfile-1.dll ]; then - make all check - fi - -if [ ! -f $INSTALL/bin/libsndfile-1.dll ]; then - make install - rm -f $INSTALL/bin/sndfile-regtest.exe - strip $INSTALL/bin/*.* - mv $INSTALL/bin/*.* $INSTALL/include/*.* $INSTALL/ - rmdir $INSTALL/bin - rm -rf $INSTALL/lib - rmdir $INSTALL/include - cp src/libsndfile.def $INSTALL/libsndfile-1.def - cp Win32/README-precompiled-dll.txt Win32/testprog.c $INSTALL/ - unix_to_dos $INSTALL/libsndfile-1.def - unix_to_dos $INSTALL/sndfile.h - unix_to_dos $INSTALL/README-precompiled-dll.txt - unix_to_dos $INSTALL/testprog.c - fi - -if [ ! -f $INSTALL/libsndfile-$VERSION.tar.gz ]; then - cp $TARGZ $INSTALL/ - if [ -f $TARGZ.asc ]; then - cp $TARGZ.asc $INSTALL/ - fi - fi - -if [ ! -f $ZIPNAME ]; then - zip -r $ZIPNAME $INSTALL/ - fi - diff --git a/libs/libsndfile/NEWS b/libs/libsndfile/NEWS deleted file mode 100644 index 9626d45166..0000000000 --- a/libs/libsndfile/NEWS +++ /dev/null @@ -1,175 +0,0 @@ -Version 1.0.25 (2011-07-13) - * Fix for Secunia Advisory SA45125, heap overflow in PAF file handler. - * Accept broken WAV files with blockalign == 0. - * Minor bug fixes and improvements. - -Version 1.0.24 (2011-03-23) - * WAV files now have an 18 byte u-law and A-law fmt chunk. - * Document virtual I/O functionality. - * Two new methods rawHandle() and takeOwnership() in sndfile.hh. - * AIFF fix for non-zero offset value in SSND chunk. - * Minor bug fixes and improvements. - -Version 1.0.23 (2010-10-10) - * Add version metadata to Windows DLL. - * Add a missing 'inline' to sndfile.hh. - * Update docs. - * Minor bug fixes and improvements. - -Version 1.0.22 (2010-10-04) - * Couple of fixes for SDS file writer. - * Fixes arising from static analysis. - * Handle FLAC files with ID3 meta data at start of file. - * Handle FLAC files which report zero length. - * Other minor bug fixes and improvements. - -Version 1.0.21 (2009-12-13) - * Add a couple of new binary programs to programs/ dir. - * Remove sndfile-jackplay (now in sndfile-tools package). - * Add windows only function sf_wchar_open(). - * Bunch of minor bug fixes. - -Version 1.0.20 (2009-05-14) - * Fix potential heap overflow in VOC file parser (Tobias Klein, http://www.trapkit.de/). - -Version 1.0.19 (2009-03-02) - * Fix for CVE-2009-0186 (Alin Rad Pop, Secunia Research). - * Huge number of minor bug fixes as a result of static analysis. - -Version 1.0.18 (2009-02-07) - * Add Ogg/Vorbis support (thanks to John ffitch). - * Remove captive FLAC library. - * Many new features and bug fixes. - * Generate Win32 and Win64 pre-compiled binaries. - -Version 1.0.17 (2006-08-31) - * Add sndfile.hh C++ wrapper. - * Update Win32 MinGW build instructions. - * Minor bug fixes and cleanups. - -Version 1.0.16 (2006-04-30) - * Add support for Broadcast (BEXT) chunks in WAV files. - * Implement new commands SFC_GET_SIGNAL_MAX and SFC_GET_MAX_ALL_CHANNELS. - * Add support for RIFX (big endian WAV variant). - * Fix configure script bugs. - * Fix bug in INST and MARK chunk writing for AIFF files. - -Version 1.0.15 (2006-03-16) - * Fix some ia64 issues. - * Fix precompiled DLL. - * Minor bug fixes. - -Version 1.0.14 (2006-02-19) - * Really fix MinGW compile problems. - * Minor bug fixes. - -Version 1.0.13 (2006-01-21) - * Fix for MinGW compiler problems. - * Allow readin/write of instrument chunks from WAV and AIFF files. - * Compile problem fix for Solaris compiler. - * Minor cleanups and bug fixes. - -Version 1.0.12 (2005-09-30) - * Add support for FLAC and Apple's Core Audio Format (CAF). - * Add virtual I/O interface (still needs docs). - * Cygwin and other Win32 fixes. - * Minor bug fixes and cleanups. - -Version 1.0.11 (2004-11-15) - * Add support for SD2 files. - * Add read support for loop info in WAV and AIFF files. - * Add more tests. - * Improve type safety. - * Minor optimisations and bug fixes. - -Version 1.0.10 (2004-06-15) - * Fix AIFF read/write mode bugs. - * Add support for compiling Win32 DLLS using MinGW. - * Fix problems resulting in failed compiles with gcc-2.95. - * Improve test suite. - * Minor bug fixes. - -Version 1.0.9 (2004-03-30) - * Add handling of AVR (Audio Visual Research) files. - * Improve handling of WAVEFORMATEXTENSIBLE WAV files. - * Fix for using pipes on Win32. - -Version 1.0.8 (2004-03-14) - * Correct peak chunk handing for files with > 16 tracks. - * Fix for WAV files with huge number of CUE chunks. - -Version 1.0.7 (2004-02-25) - * Fix clip mode detection on ia64, MIPS and other CPUs. - * Fix two MacOSX build problems. - -Version 1.0.6 (2004-02-08) - * Added support for native Win32 file access API (Ross Bencina). - * New mode to add clippling then a converting from float/double to integer - would otherwise wrap around. - * Fixed a bug in reading/writing files > 2Gig on Linux, Solaris and others. - * Many minor bug fixes. - * Other random fixes for Win32. - -Version 1.0.5 (2003-05-03) - * Added support for HTK files. - * Added new function sf_open_fd() to allow for secure opening of temporary - files as well as reading/writing sound files embedded within larger - container files. - * Added string support for AIFF files. - * Minor bug fixes and code cleanups. - -Version 1.0.4 (2003-02-02) - * Added suport of PVF and XI files. - * Added functionality for setting and retreiving strings from sound files. - * Minor code cleanups and bug fixes. - -Version 1.0.3 (2002-12-09) - * Minor bug fixes. - -Version 1.0.2 (2002-11-24) - * Added support for VOX ADPCM. - * Improved error reporting. - * Added version scripting on Linux and Solaris. - * Minor bug fixes. - -Version 1.0.1 (2002-09-14) - * Added MAT and MAT5 file formats. - * Minor bug fixes. - -Version 1.0.0 (2002-08-16) - * Final release for 1.0.0. - -Version 1.0.0rc6 (2002-08-14) - * Release candidate 6 for the 1.0.0 series. - * MacOS9 fixes. - -Version 1.0.0rc5 (2002-08-10) - * Release candidate 5 for the 1.0.0 series. - * Changed the definition of sf_count_t which was causing problems when - libsndfile was compiled with other libraries (ie WxWindows). - * Minor bug fixes. - * Documentation cleanup. - -Version 1.0.0rc4 (2002-08-03) - * Release candidate 4 for the 1.0.0 series. - * Minor bug fixes. - * Fix broken Win32 "make check". - -Version 1.0.0rc3 (2002-08-02) - * Release candidate 3 for the 1.0.0 series. - * Fix bug where libsndfile was reading beyond the end of the data chunk. - * Added on-the-fly header updates on write. - * Fix a couple of documentation issues. - -Version 1.0.0rc2 (2002-06-24) - * Release candidate 2 for the 1.0.0 series. - * Fix compile problem for Win32. - -Version 1.0.0rc1 (2002-06-24) - * Release candidate 1 for the 1.0.0 series. - -Version 0.0.28 (2002-04-27) - * Last offical release of 0.0.X series of the library. - -Version 0.0.8 (1999-02-16) - * First offical release. diff --git a/libs/libsndfile/Octave/Makefile.am b/libs/libsndfile/Octave/Makefile.am deleted file mode 100644 index 3f0078e18f..0000000000 --- a/libs/libsndfile/Octave/Makefile.am +++ /dev/null @@ -1,79 +0,0 @@ -## Process this file with automake to produce Makefile.in - -# Prevent any extension. -EXEEXT = - -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ - -EXTRA_DIST = sndfile_load.m sndfile_save.m sndfile_play.m \ - octave_test.m octave_test.sh $(oct_module_srcs) PKG_ADD - -octconfigdir = $(exec_prefix)/share/octave/site/m -octconfig_DATA = sndfile_load.m sndfile_save.m sndfile_play.m - -OCTAVE_DEST_MDIR = @OCTAVE_DEST_MDIR@ -OCTAVE_DEST_ODIR = @OCTAVE_DEST_ODIR@/sndfile - -OCT_CXXFLAGS = @OCT_CXXFLAGS@ -OCT_LIB_DIR = @OCT_LIB_DIR@ -OCT_LIBS = @OCT_LIBS@ - -SNDFILEDIR = $(top_builddir)/src -AM_CPPFLAGS = -I$(SNDFILEDIR) - -oct_module_srcs = sndfile.cc -oct_module_files = sndfile.oct PKG_ADD - -# Make these noinst so they can be installed manually. -noinst_DATA = $(oct_module_files) - - -# Used by shave which cleans up automake generated Makefile output. -V = @ -Q = $(V:1=) -QUIET_GEN = $(Q:@=@echo ' GEN '$@;) - - -# Use Octave's mkoctfile to do all the heavy lifting. Unfortunately, its -# a little dumb so we need to guide it carefully. -sndfile.oct : sndfile.o - $(QUIET_GEN) $(MKOCTFILE) -v $(INCLUDES) $(top_builddir)/Octave/$+ -L$(SNDFILEDIR)/.libs -L$(SNDFILEDIR) -lsndfile -o $(top_builddir)/Octave/$@ > /dev/null - -sndfile.o : sndfile.cc - $(QUIET_GEN) $(MKOCTFILE) -v $(INCLUDES) -c $+ -o $(top_builddir)/Octave/$@ > /dev/null - -# Allow for the test being run in the build dir, but the test script -# being located in the source dir. -check : - octave_src_dir=$(srcdir) $(srcdir)/octave_test.sh - - -# Since the octave modules are installed in a special location, a custom install -# and uninstall routine must be specified. -install-exec-local : $(oct_module_files) - @$(NORMAL_INSTALL) - test -z "$(OCTAVE_DEST_ODIR)" || $(mkdir_p) "$(DESTDIR)$(OCTAVE_DEST_ODIR)" - @list='$(oct_module_files)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL) '$$p' '$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL) "$$p" "$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f" || exit 1; \ - else :; fi; \ - done - -uninstall-local : - @$(NORMAL_UNINSTALL) - @list='$(oct_module_files)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f'"; \ - rm -f "$(DESTDIR)$(OCTAVE_DEST_ODIR)/$$f"; \ - done - -clean-local : - rm -f sndfile.o sndfile.oct - @if test $(abs_builddir) != $(abs_srcdir) ; then rm -f PKG_ADD ; fi diff --git a/libs/libsndfile/Octave/PKG_ADD b/libs/libsndfile/Octave/PKG_ADD deleted file mode 100644 index 3efd688550..0000000000 --- a/libs/libsndfile/Octave/PKG_ADD +++ /dev/null @@ -1,3 +0,0 @@ -autoload ("sfread", "sndfile.oct"); -autoload ("sfversion", "sndfile.oct"); -autoload ("sfwrite", "sndfile.oct"); diff --git a/libs/libsndfile/Octave/Readme.txt b/libs/libsndfile/Octave/Readme.txt deleted file mode 100644 index c38605bffc..0000000000 --- a/libs/libsndfile/Octave/Readme.txt +++ /dev/null @@ -1,23 +0,0 @@ -The libsndfile Modules for GNU Octave -===================================== - -These modules are currently known to work with version 3.0 of GNU Octave on -Linux. They have not been tested elsewhere. - - -Build Requirements ------------------- - -In order to build these libsndfile related modules for GNU Octave on a Debian -GNU/Linux (or Debian derived) system, you will need (on top of what is normally -required to build libsndfile) the package: - - octaveX.Y-headers - -where X.Y matches the version number of your installation of GNU Octave. - -The configure script in the top level libsndfile directory will detect the -presence and correct versions of the Octave build tools. The building of these -modules will only go ahead if everything is correct. - - diff --git a/libs/libsndfile/Octave/format.h b/libs/libsndfile/Octave/format.h deleted file mode 100644 index ce769b2c69..0000000000 --- a/libs/libsndfile/Octave/format.h +++ /dev/null @@ -1,21 +0,0 @@ -/* -** Copyright (C) 2007-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -int format_of_str (const std::string & fmt) ; - -void string_of_format (std::string & fmt, int format) ; diff --git a/libs/libsndfile/Octave/octave_test.m b/libs/libsndfile/Octave/octave_test.m deleted file mode 100644 index 25a922e897..0000000000 --- a/libs/libsndfile/Octave/octave_test.m +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2007-2011 Erik de Castro Lopo -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# These tests are nowhere near comprehensive. - -printf (" Running Octave tests : ") ; -fflush (stdout) ; - -filename = "whatever" ; -srate_out = 32000 ; -fmt_out = "wav-float" ; - -t = (2 * pi / srate_out * (0:srate_out-1))' ; -data_out = sin (440.0 * t) ; - -# Write out a file. -sfwrite (filename, data_out, srate_out, fmt_out) ; - -# Read it back in again. -[ data_in, srate_in, fmt_in ] = sfread (filename) ; - -if (srate_in != srate_out) - error ("\n\nSample rate mismatch : %d -> %d.\n\n", srate_out, srate_in) ; - endif - -# Octave strcmp return 1 for the same. -if (strcmp (fmt_in, fmt_out) != 1) - error ("\n\nFormat error : '%s' -> '%s'.\n\n", fmt_out, fmt_in) ; - endif - -err = max (abs (data_out - data_in)) ; - -if (err > 1e-7) - error ("err : %g\n", err) ; - endif - -printf ("ok") ; - -unlink (filename) ; diff --git a/libs/libsndfile/Octave/octave_test.sh b/libs/libsndfile/Octave/octave_test.sh deleted file mode 100755 index 3c6f36e236..0000000000 --- a/libs/libsndfile/Octave/octave_test.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash - - -# Check where we're being run from. -if test -d Octave ; then - cd Octave - octave_src_dir=$(pwd) -elif test -z "$octave_src_dir" ; then - echo - echo "Error : \$octave_src_dir is undefined." - echo - exit 1 -else - octave_src_dir=$(cd $octave_src_dir && pwd) - fi - -# Find libsndfile shared object. -libsndfile_lib_location="" - -if test -f "../src/.libs/libsndfile.so" ; then - libsndfile_lib_location="../src/.libs/" -elif test -f "../src/libsndfile.so" ; then - libsndfile_lib_location="../src/" -elif test -f "../src/.libs/libsndfile.dylib" ; then - libsndfile_lib_location="../src/.libs/" -elif test -f "../src/libsndfile.dylib" ; then - libsndfile_lib_location="../src/" -else - echo - echo "Not able to find the libsndfile shared lib we've just built." - echo "This may cause the following test to fail." - echo - fi - -libsndfile_lib_location=`(cd $libsndfile_lib_location && pwd)` - - -# Find sndfile.oct -sndfile_oct_location="" - -if test -f .libs/sndfile.oct ; then - sndfile_oct_location=".libs" -elif test -f sndfile.oct ; then - sndfile_oct_location="." -else - echo "Not able to find the sndfile.oct binaries we've just built." - exit 1 - fi - -case `file -b $sndfile_oct_location/sndfile.oct` in - ELF*) - ;; - Mach*) - echo "Tests don't work on this platform." - exit 0 - ;; - *) - echo "Not able to find the sndfile.oct binary we just built." - exit 1 - ;; - esac - - -# Make sure the TERM environment variable doesn't contain anything wrong. -unset TERM -# echo "octave_src_dir : $octave_src_dir" -# echo "libsndfile_lib_location : $libsndfile_lib_location" -# echo "sndfile_oct_location : $sndfile_oct_location" - -if test ! -f PKG_ADD ; then - cp $octave_src_dir/PKG_ADD . - fi - -export LD_LIBRARY_PATH="$libsndfile_lib_location:$LD_LIBRARY_PATH" - -octave_script="$octave_src_dir/octave_test.m" - -(cd $sndfile_oct_location && octave -qH $octave_script) -res=$? -echo -exit $res diff --git a/libs/libsndfile/Octave/sndfile.cc b/libs/libsndfile/Octave/sndfile.cc deleted file mode 100644 index 6e9cd44cc9..0000000000 --- a/libs/libsndfile/Octave/sndfile.cc +++ /dev/null @@ -1,405 +0,0 @@ -/* -** Copyright (C) 2007-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include - -#include "sndfile.h" - -#define FOUR_GIG (0x100000000LL) -#define BUFFER_FRAMES 8192 - - -static int format_of_str (const std::string & fmt) ; -static void string_of_format (std::string & fmt, int format) ; - - -DEFUN_DLD (sfversion, args, nargout , -"-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {@var{version} =} sfversion ()\n\ -@cindex Reading sound files\n\ -Return a string containing the libsndfile version.\n\ -@seealso{sfread, sfwrite}\n\ -@end deftypefn") -{ char buffer [256] ; - octave_value_list retval ; - - /* Bail out if the input parameters are bad. */ - if (args.length () != 0 || nargout > 1) - { print_usage () ; - return retval ; - } ; - - sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; - - std::string version (buffer) ; - - retval.append (version) ; - return retval ; -} /* sfversion */ - - -DEFUN_DLD (sfread, args, nargout , -"-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {@var{data},@var{srate},@var{format} =} sfread (@var{filename})\n\ -@cindex Reading sound files\n\ -Read a sound file from disk using libsndfile.\n\ -@seealso{sfversion, sfwrite}\n\ -@end deftypefn") -{ SNDFILE * file ; - SF_INFO sfinfo ; - - octave_value_list retval ; - - int nargin = args.length () ; - - /* Bail out if the input parameters are bad. */ - if ((nargin != 1) || !args (0) .is_string () || nargout < 1 || nargout > 3) - { print_usage () ; - return retval ; - } ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - std::string filename = args (0).string_value () ; - - if ((file = sf_open (filename.c_str (), SFM_READ, &sfinfo)) == NULL) - { error ("sfread: couldn't open file %s : %s", filename.c_str (), sf_strerror (NULL)) ; - return retval ; - } ; - - if (sfinfo.frames > FOUR_GIG) - printf ("This is a really huge file (%lld frames).\nYou may run out of memory trying to load it.\n", (long long) sfinfo.frames) ; - - dim_vector dim = dim_vector () ; - dim.resize (2) ; - dim (0) = sfinfo.frames ; - dim (1) = sfinfo.channels ; - - /* Should I be using Matrix instead? */ - NDArray out (dim, 0.0) ; - - float buffer [BUFFER_FRAMES * sfinfo.channels] ; - int readcount ; - sf_count_t total = 0 ; - - do - { readcount = sf_readf_float (file, buffer, BUFFER_FRAMES) ; - - /* Make sure we don't read more frames than we allocated. */ - if (total + readcount > sfinfo.frames) - readcount = sfinfo.frames - total ; - - for (int ch = 0 ; ch < sfinfo.channels ; ch++) - { for (int k = 0 ; k < readcount ; k++) - out (total + k, ch) = buffer [k * sfinfo.channels + ch] ; - } ; - - total += readcount ; - } while (readcount > 0 && total < sfinfo.frames) ; - - retval.append (out.squeeze ()) ; - - if (nargout >= 2) - retval.append ((octave_uint32) sfinfo.samplerate) ; - - if (nargout >= 3) - { std::string fmt ("") ; - string_of_format (fmt, sfinfo.format) ; - retval.append (fmt) ; - } ; - - /* Clean up. */ - sf_close (file) ; - - return retval ; -} /* sfread */ - -DEFUN_DLD (sfwrite, args, nargout , -"-*- texinfo -*-\n\ -@deftypefn {Function File} sfwrite (@var{filename},@var{data},@var{srate},@var{format})\n\ -Write a sound file to disk using libsndfile.\n\ -@seealso{sfread, sfversion}\n\ -@end deftypefn\n\ -") -{ SNDFILE * file ; - SF_INFO sfinfo ; - - octave_value_list retval ; - - int nargin = args.length () ; - - /* Bail out if the input parameters are bad. */ - if (nargin != 4 || !args (0).is_string () || !args (1).is_real_matrix () - || !args (2).is_real_scalar () || !args (3).is_string () - || nargout != 0) - { print_usage () ; - return retval ; - } ; - - std::string filename = args (0).string_value () ; - std::string format = args (3).string_value () ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - sfinfo.format = format_of_str (format) ; - if (sfinfo.format == 0) - { error ("Bad format '%s'", format.c_str ()) ; - return retval ; - } ; - - sfinfo.samplerate = lrint (args (2).scalar_value ()) ; - if (sfinfo.samplerate < 1) - { error ("Bad sample rate : %d.\n", sfinfo.samplerate) ; - return retval ; - } ; - - Matrix data = args (1).matrix_value () ; - long rows = args (1).rows () ; - long cols = args (1).columns () ; - - if (cols > rows) - { error ("Audio data should have one column per channel, but supplied data " - "has %ld rows and %ld columns.\n", rows, cols) ; - return retval ; - } ; - - sfinfo.channels = cols ; - - if ((file = sf_open (filename.c_str (), SFM_WRITE, &sfinfo)) == NULL) - { error ("Couldn't open file %s : %s", filename.c_str (), sf_strerror (NULL)) ; - return retval ; - } ; - - float buffer [BUFFER_FRAMES * sfinfo.channels] ; - int writecount ; - long total = 0 ; - - do - { - writecount = BUFFER_FRAMES ; - - /* Make sure we don't read more frames than we allocated. */ - if (total + writecount > rows) - writecount = rows - total ; - - for (int ch = 0 ; ch < sfinfo.channels ; ch++) - { for (int k = 0 ; k < writecount ; k++) - buffer [k * sfinfo.channels + ch] = data (total + k, ch) ; - } ; - - if (writecount > 0) - sf_writef_float (file, buffer, writecount) ; - - total += writecount ; - } while (writecount > 0 && total < rows) ; - - /* Clean up. */ - sf_close (file) ; - - return retval ; -} /* sfwrite */ - - -static void -str_split (const std::string & str, const std::string & delim, std::vector & output) -{ - unsigned int offset = 0 ; - size_t delim_index = 0 ; - - delim_index = str.find (delim, offset) ; - - while (delim_index != std::string::npos) - { - output.push_back (str.substr(offset, delim_index - offset)) ; - offset += delim_index - offset + delim.length () ; - delim_index = str.find (delim, offset) ; - } - - output.push_back (str.substr (offset)) ; -} /* str_split */ - -static int -hash_of_str (const std::string & str) -{ - int hash = 0 ; - - for (unsigned k = 0 ; k < str.length () ; k++) - hash = (hash * 3) + tolower (str [k]) ; - - return hash ; -} /* hash_of_str */ - -static int -major_format_of_hash (const std::string & str) -{ int hash ; - - hash = hash_of_str (str) ; - - switch (hash) - { - case 0x5c8 : /* 'wav' */ return SF_FORMAT_WAV ; - case 0xf84 : /* 'aiff' */ return SF_FORMAT_AIFF ; - case 0x198 : /* 'au' */ return SF_FORMAT_AU ; - case 0x579 : /* 'paf' */ return SF_FORMAT_PAF ; - case 0x5e5 : /* 'svx' */ return SF_FORMAT_SVX ; - case 0x1118 : /* 'nist' */ return SF_FORMAT_NIST ; - case 0x5d6 : /* 'voc' */ return SF_FORMAT_VOC ; - case 0x324a : /* 'ircam' */ return SF_FORMAT_IRCAM ; - case 0x505 : /* 'w64' */ return SF_FORMAT_W64 ; - case 0x1078 : /* 'mat4' */ return SF_FORMAT_MAT4 ; - case 0x1079 : /* 'mat5' */ return SF_FORMAT_MAT5 ; - case 0x5b8 : /* 'pvf' */ return SF_FORMAT_PVF ; - case 0x1d1 : /* 'xi' */ return SF_FORMAT_XI ; - case 0x56f : /* 'htk' */ return SF_FORMAT_HTK ; - case 0x5aa : /* 'sds' */ return SF_FORMAT_SDS ; - case 0x53d : /* 'avr' */ return SF_FORMAT_AVR ; - case 0x11d0 : /* 'wavx' */ return SF_FORMAT_WAVEX ; - case 0x569 : /* 'sd2' */ return SF_FORMAT_SD2 ; - case 0x1014 : /* 'flac' */ return SF_FORMAT_FLAC ; - case 0x504 : /* 'caf' */ return SF_FORMAT_CAF ; - case 0x5f6 : /* 'wve' */ return SF_FORMAT_WVE ; - default : break ; - } ; - - printf ("%s : hash '%s' -> 0x%x\n", __func__, str.c_str (), hash) ; - - return 0 ; -} /* major_format_of_hash */ - -static int -minor_format_of_hash (const std::string & str) -{ int hash ; - - hash = hash_of_str (str) ; - - switch (hash) - { - case 0x1085 : /* 'int8' */ return SF_FORMAT_PCM_S8 ; - case 0x358a : /* 'uint8' */ return SF_FORMAT_PCM_U8 ; - case 0x31b0 : /* 'int16' */ return SF_FORMAT_PCM_16 ; - case 0x31b1 : /* 'int24' */ return SF_FORMAT_PCM_24 ; - case 0x31b2 : /* 'int32' */ return SF_FORMAT_PCM_32 ; - case 0x3128 : /* 'float' */ return SF_FORMAT_FLOAT ; - case 0x937d : /* 'double' */ return SF_FORMAT_DOUBLE ; - case 0x11bd : /* 'ulaw' */ return SF_FORMAT_ULAW ; - case 0xfa1 : /* 'alaw' */ return SF_FORMAT_ALAW ; - case 0xfc361 : /* 'ima_adpcm' */ return SF_FORMAT_IMA_ADPCM ; - case 0x5739a : /* 'ms_adpcm' */ return SF_FORMAT_MS_ADPCM ; - case 0x9450 : /* 'gsm610' */ return SF_FORMAT_GSM610 ; - case 0x172a3 : /* 'g721_32' */ return SF_FORMAT_G721_32 ; - case 0x172d8 : /* 'g723_24' */ return SF_FORMAT_G723_24 ; - case 0x172da : /* 'g723_40' */ return SF_FORMAT_G723_40 ; - default : break ; - } ; - - printf ("%s : hash '%s' -> 0x%x\n", __func__, str.c_str (), hash) ; - - return 0 ; -} /* minor_format_of_hash */ - - -static const char * -string_of_major_format (int format) -{ - switch (format & SF_FORMAT_TYPEMASK) - { - case SF_FORMAT_WAV : return "wav" ; - case SF_FORMAT_AIFF : return "aiff" ; - case SF_FORMAT_AU : return "au" ; - case SF_FORMAT_PAF : return "paf" ; - case SF_FORMAT_SVX : return "svx" ; - case SF_FORMAT_NIST : return "nist" ; - case SF_FORMAT_VOC : return "voc" ; - case SF_FORMAT_IRCAM : return "ircam" ; - case SF_FORMAT_W64 : return "w64" ; - case SF_FORMAT_MAT4 : return "mat4" ; - case SF_FORMAT_MAT5 : return "mat5" ; - case SF_FORMAT_PVF : return "pvf" ; - case SF_FORMAT_XI : return "xi" ; - case SF_FORMAT_HTK : return "htk" ; - case SF_FORMAT_SDS : return "sds" ; - case SF_FORMAT_AVR : return "avr" ; - case SF_FORMAT_WAVEX : return "wavx" ; - case SF_FORMAT_SD2 : return "sd2" ; - case SF_FORMAT_FLAC : return "flac" ; - case SF_FORMAT_CAF : return "caf" ; - case SF_FORMAT_WVE : return "wfe" ; - default : break ; - } ; - - return "unknown" ; -} /* string_of_major_format */ - -static const char * -string_of_minor_format (int format) -{ - switch (format & SF_FORMAT_SUBMASK) - { - case SF_FORMAT_PCM_S8 : return "int8" ; - case SF_FORMAT_PCM_U8 : return "uint8" ; - case SF_FORMAT_PCM_16 : return "int16" ; - case SF_FORMAT_PCM_24 : return "int24" ; - case SF_FORMAT_PCM_32 : return "int32" ; - case SF_FORMAT_FLOAT : return "float" ; - case SF_FORMAT_DOUBLE : return "double" ; - case SF_FORMAT_ULAW : return "ulaw" ; - case SF_FORMAT_ALAW : return "alaw" ; - case SF_FORMAT_IMA_ADPCM : return "ima_adpcm" ; - case SF_FORMAT_MS_ADPCM : return "ms_adpcm" ; - case SF_FORMAT_GSM610 : return "gsm610" ; - case SF_FORMAT_G721_32 : return "g721_32" ; - case SF_FORMAT_G723_24 : return "g723_24" ; - case SF_FORMAT_G723_40 : return "g723_40" ; - default : break ; - } ; - - return "unknown" ; -} /* string_of_minor_format */ - -static int -format_of_str (const std::string & fmt) -{ - std::vector split ; - - str_split (fmt, "-", split) ; - - if (split.size () != 2) - return 0 ; - - int major_fmt = major_format_of_hash (split.at (0)) ; - if (major_fmt == 0) - return 0 ; - - int minor_fmt = minor_format_of_hash (split.at (1)) ; - if (minor_fmt == 0) - return 0 ; - - return major_fmt | minor_fmt ; -} /* format_of_str */ - -static void -string_of_format (std::string & fmt, int format) -{ - char buffer [64] ; - - snprintf (buffer, sizeof (buffer), "%s-%s", string_of_major_format (format), string_of_minor_format (format)) ; - - fmt = buffer ; - - return ; -} /* string_of_format */ diff --git a/libs/libsndfile/Octave/sndfile_load.m b/libs/libsndfile/Octave/sndfile_load.m deleted file mode 100644 index c66198fa35..0000000000 --- a/libs/libsndfile/Octave/sndfile_load.m +++ /dev/null @@ -1,52 +0,0 @@ -## Copyright (C) 2002-2011 Erik de Castro Lopo -## -## 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, 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 file. If not, write to the Free Software Foundation, -## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -## -*- texinfo -*- -## @deftypefn {Function File} {} sndfile_load (@var{filename}) -## Load data from the file given by @var{filename}. -## @end deftypefn - -## Author: Erik de Castro Lopo -## Description: Load the sound data from the given file name - -function [data fs] = sndfile_load (filename) - -if (nargin != 1), - error ("Need an input filename") ; - endif - -samplerate = -1 ; -samplingrate = -1 ; -wavedata = -1 ; - - -eval (sprintf ('load -f %s', filename)) ; - -if (samplerate > 0), - fs = samplerate ; -elseif (samplingrate > 0), - fs = samplingrate ; -else - error ("Not able to find sample rate.") ; - endif - -if (max (size (wavedata)) > 1), - data = wavedata ; -else - error ("Not able to find waveform data.") ; - endif - -endfunction diff --git a/libs/libsndfile/Octave/sndfile_play.m b/libs/libsndfile/Octave/sndfile_play.m deleted file mode 100644 index e8a34a74cb..0000000000 --- a/libs/libsndfile/Octave/sndfile_play.m +++ /dev/null @@ -1,59 +0,0 @@ -## Copyright (C) 2002-2011 Erik de Castro Lopo -## -## 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, 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 file. If not, write to the Free Software Foundation, -## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -## -*- texinfo -*- -## @deftypefn {Function File} {} sndfile_play (@var{data, fs}) -## Play @var{data} at sample rate @var{fs} using the sndfile-play -## program. -## @end deftypefn - -## Author: Erik de Castro Lopo -## Description: Play the given data as a sound file - -function sndfile_play (data, fs) - -if nargin != 2, - error ("Need two input arguments: data and fs.") ; - endif - -if (max (size (fs)) > 1), - error ("Second parameter fs must be a single value.") ; - endif - -[nr nc] = size (data) ; - -if (nr > nc), - data = data' ; - endif - -samplerate = fs ; -wavedata = data ; - -filename = tmpnam () ; - -cmd = sprintf ("save -mat-binary %s fs data", filename) ; - -eval (cmd) ; - -cmd = sprintf ("sndfile-play %s", filename) ; - -[output, status] = system (cmd) ; - -if (status), - disp (outout) ; - endif - -endfunction diff --git a/libs/libsndfile/Octave/sndfile_save.m b/libs/libsndfile/Octave/sndfile_save.m deleted file mode 100644 index 5b7e7c7d0f..0000000000 --- a/libs/libsndfile/Octave/sndfile_save.m +++ /dev/null @@ -1,53 +0,0 @@ -## Copyright (C) 2002-2011 Erik de Castro Lopo -## -## 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, 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 file. If not, write to the Free Software Foundation, -## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -## -*- texinfo -*- -## @deftypefn {Function File} {} sndfile_save (@var{filename, data, fs}) -## Save the given @var{data} as audio data to the given at @var{fs}. Set -## the sample rate to @var{fs}. -## @end deftypefn - -## Author: Erik de Castro Lopo -## Description: Save data as a sound file - -function sndfile_save (filename, data, fs) - -if nargin != 3, - error ("Need three input arguments: filename, data and fs.") ; - endif - -if (! isstr (filename)), - error ("First parameter 'filename' is must be a string.") ; - endif - -if (max (size (fs)) > 1), - error ("Second parameter 'fs' must be a single value, not an array or matrix.") ; - endif - -[nr nc] = size (data) ; - -if (nr > nc), - data = data' ; - endif - -samplerate = fs ; -wavedata = data ; - -str = sprintf ("save -mat-binary %s samplerate wavedata", filename) ; - -eval (str) ; - -endfunction diff --git a/libs/libsndfile/README b/libs/libsndfile/README deleted file mode 100644 index 8df79c7d9f..0000000000 --- a/libs/libsndfile/README +++ /dev/null @@ -1,68 +0,0 @@ -This is libsndfile, 1.0.25 - -libsndfile is a library of C routines for reading and writing -files containing sampled audio data. - -The src/ directory contains the source code for library itself. - -The doc/ directory contains the libsndfile documentation. - -The examples/ directory contains examples of how to write code using -libsndfile. - -The tests/ directory contains programs which link against libsndfile -and test its functionality. - -The src/GSM610 directory contains code written by Jutta Degener and Carsten -Bormann. Their original code can be found at : - http://kbs.cs.tu-berlin.de/~jutta/toast.html - -The src/G72x directory contains code written and released by Sun Microsystems -under a suitably free license. - -The src/ALAC directory contains code written and released by Apple Inc and -released under the Apache license. - - -LINUX ------ -Whereever possible, you should use the packages supplied by your Linux -distribution. - -If you really do need to compile from source it should be as easy as: - - ./configure - make - make install - -Since libsndfile optionally links against libFLAC, libogg and libvorbis, you -will need to install appropriate versions of these libraries before running -configure as above. - - -UNIX ----- -Compile as for Linux. - - -Win32/Win64 ------------ -The default Windows compilers are nowhere near compliant with the 1999 ISO -C Standard and hence not able to compile libsndfile. - -Please use the libsndfile binaries available on the libsndfile web site. - - -MacOSX ------- -Building on MacOSX should be the same as building it on any other Unix. - - -CONTACTS --------- - -libsndfile was written by Erik de Castro Lopo (erikd AT mega-nerd DOT com). -The libsndfile home page is at : - - http://www.mega-nerd.com/libsndfile/ - diff --git a/libs/libsndfile/README.md b/libs/libsndfile/README.md deleted file mode 100644 index a7fdaea71f..0000000000 --- a/libs/libsndfile/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# libsndfile - -libsndfile is a C library for reading and writing files containing sampled audio -data. - -## Hacking - -The canonical source code repository for libsndfile is at -[https://github.com/erikd/libsndfile/][github]. - -You can grab the source code using: - - $ git clone git://github.com/erikd/libsndfile.git - -Building on Linux, OSX and Windows (Using GNU GCC) will require a number of GNU -and other Free and Open Source Software tools including: - -* [Autoconf][autoconf] -* [Autogen][autogen] -* [Automake][automake] -* [Libtool][libtool] -* [Pkgconfig][pkgconfig] -* [Python][python] - -If you are on Linux, its probably best to install these via your Linux -distribution's package manager. - -If you want to compile libsndfile with support for formats like FLAC and -Ogg/Vorbis you will also need to install the following optional libraries: - -* [FLAC][flac] -* [libogg][libogg] -* [libvorbis][libvorbis] - -Support for these extra libraries is an all or nothing affair. Unless all of -them are installed none of them will be supported. - - $ ./autogen.sh - -Running `autogen.sh` also installs a git pre-commit hook. The pre-commit hook -is run each time a user tries to commit and checks code about to be committed -against coding guidelines. - -Nest step is to run configure, with the following configure options being -recommended for anyone contemplating sending libsndfile patches: - - $ ./configure --enable-gcc-werror - -Finally libsndfile can be built and tested: - - $ make - $ make check - -## Submitting Patches. - -* Patches should pass all pre-commit hook tests. -* Patches should always be submitted via a either Github "pull request" or a - via emailed patches created using "git format-patch". -* Patches for new features should include tests and documentation. -* Patches to fix bugs should either pass all tests, or modify the tests in some - sane way. -* When a new feature is added for a particular file format and that feature - makes sense for other formats, then it should also be implemented for one - or two of the other formats. - - - - - -[autoconf]: http://www.gnu.org/s/autoconf/ -[autogen]: http://www.gnu.org/s/autogen/ -[automake]: http://www.gnu.org/software/automake/ -[flac]: http://flac.sourceforge.net/ -[github]: https://github.com/erikd/libsndfile/ -[libogg]: http://xiph.org/ogg/ -[libtool]: http://www.gnu.org/software/libtool/ -[libvorbis]: http://www.vorbis.com/ -[pkgconfig]: http://www.freedesktop.org/wiki/Software/pkg-config -[python]: http://www.python.org/ diff --git a/libs/libsndfile/Scripts/android-configure.sh b/libs/libsndfile/Scripts/android-configure.sh deleted file mode 100644 index c981d4927a..0000000000 --- a/libs/libsndfile/Scripts/android-configure.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -e - -# Copyright (C) 2013 Erik de Castro Lopo -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Neither the author nor the names of any contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Android NDK version number; eg r8e, r9 etc -ANDROID_NDK_VER=r9 - -# Android NDK gcc version; eg 4.7, 4.9 etc. -ANDROID_GCC_VER=4.8 - -# Android API version; eg 9 (Android 2.3), 14 (Android 4.0) etc. -ANDROID_API_VER=9 - -#------------------------------------------------------------------------------- -# No more user config beyond here. - -BUILD_MACHINE=$(uname -s | tr 'A-Z' 'a-z')-$(uname -m) - -function die_with { - echo $1 - exit 1 -} - -export CROSS_COMPILE=arm-linux-androideabi - -# I put all my dev stuff in here -export DEV_PREFIX=$HOME/Android -test -d ${DEV_PREFIX} || die_with "Error : DEV_PREFIX '$DEV_PREFIX' does not exist." - -# Don't forget to adjust this to your NDK path -export ANDROID_NDK=${DEV_PREFIX}/android-ndk-${ANDROID_NDK_VER} -test -d ${ANDROID_NDK} || die_with "Error : ANDROID_NDK '$ANDROID_NDK' does not exist." - -export ANDROID_PREFIX=${ANDROID_NDK}/toolchains/arm-linux-androideabi-${ANDROID_GCC_VER}/prebuilt/${BUILD_MACHINE} -test -d ${ANDROID_PREFIX} || die_with "Error : ANDROID_PREFIX '$ANDROID_PREFIX' does not exist." - -export SYSROOT=${ANDROID_NDK}/platforms/android-${ANDROID_API_VER}/arch-arm -test -d ${SYSROOT} || die_with "Error : SYSROOT '$SYSROOT' does not exist." - -export CROSS_PREFIX=${ANDROID_PREFIX}/bin/${CROSS_COMPILE} -test -f ${CROSS_PREFIX}-gcc || die_with "Error : CROSS_PREFIX compiler '${CROSS_PREFIX}-gcc' does not exist." - - -# Non-exhaustive lists of compiler + binutils -# Depending on what you compile, you might need more binutils than that -export CPP=${CROSS_PREFIX}-cpp -export AR=${CROSS_PREFIX}-ar -export AS=${CROSS_PREFIX}-as -export NM=${CROSS_PREFIX}-nm -export CC=${CROSS_PREFIX}-gcc -export CXX=${CROSS_PREFIX}-g++ -export LD=${CROSS_PREFIX}-ld -export RANLIB=${CROSS_PREFIX}-ranlib - -# Don't mix up .pc files from your host and build target -export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig - -# Set up the needed FLAGS. -export CFLAGS="${CFLAGS} -gstabs --sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${ANDROID_PREFIX}/include" -export CXXFLAGS="${CXXFLAGS} -gstabs -fno-exceptions --sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${ANDROID_PREFIX}/include -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VER}/include/ -I${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/${ANDROID_GCC_VER}/libs/armeabi/include" - -export CPPFLAGS="${CFLAGS}" -export LDFLAGS="${LDFLAGS} -L${SYSROOT}/usr/lib -L${ANDROID_PREFIX}/lib" - -# Create a symlink to the gdbclient. -test -h gdbclient || ln -s ${ANDROID_PREFIX}/bin/arm-linux-androideabi-gdb gdbclient - -./configure --host=${CROSS_COMPILE} --with-sysroot=${SYSROOT} "$@" diff --git a/libs/libsndfile/Scripts/build-test-tarball.mk.in b/libs/libsndfile/Scripts/build-test-tarball.mk.in deleted file mode 100644 index 931edb6464..0000000000 --- a/libs/libsndfile/Scripts/build-test-tarball.mk.in +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/make -f - -# This is probably only going to work with GNU Make. -# This in a separate file instead of in Makefile.am because Automake complains -# about the GNU Make-isms. - -EXEEXT = @EXEEXT@ - -PACKAGE_VERSION = @PACKAGE_VERSION@ - -HOST_TRIPLET = @HOST_TRIPLET@ - -SRC_BINDIR = @SRC_BINDIR@ -TEST_BINDIR = @TEST_BINDIR@ - -LIBRARY := $(SRC_BINDIR)libsndfile.so.$(LIB_VERSION) - -LIB_VERSION := $(shell echo $(PACKAGE_VERSION) | sed -e 's/[a-z].*//') - -TESTNAME = libsndfile-testsuite-$(HOST_TRIPLET)-$(PACKAGE_VERSION) - -TARBALL = $(TESTNAME).tar.gz - -# Find the test programs by grepping the script for the programs it executes. -testprogs := $(shell grep '^\./' tests/test_wrapper.sh | sed -e "s|./||" -e "s/ .*//" | sort | uniq) -# Also add the programs not found by the above. -testprogs += sfversion@EXEEXT@ stdin_test@EXEEXT@ stdout_test@EXEEXT@ cpp_test@EXEEXT@ win32_test@EXEEXT@ - -# Find the single test program in src/ . -srcprogs := $(shell if test -x src/.libs/test_main$(EXEEXT) ; then echo "src/.libs/test_main$(EXEEXT)" ; else echo "src/test_main$(EXEEXT)" ; fi) - -libfiles := $(shell if test ! -z $(EXEEXT) ; then echo "src/libsndfile-1.def src/.libs/libsndfile-1.dll" ; elif test -f $(LIBRARY) ; then echo $(LIBRARY) ; fi ; fi) - -testbins := $(addprefix $(TEST_BINDIR),$(subst @EXEEXT@,$(EXEEXT),$(testprogs))) $(libfiles) $(srcprogs) - - -all : $(TARBALL) - -clean : - rm -rf $(TARBALL) $(TESTNAME)/ - -check : $(TESTNAME)/test_wrapper.sh - (cd ./$(TESTNAME)/ && ./test_wrapper.sh) - -$(TARBALL) : $(TESTNAME)/test_wrapper.sh - tar zcf $@ $(TESTNAME) - rm -rf $(TESTNAME) - @echo - @echo "Created : $(TARBALL)" - @echo - -$(TESTNAME)/test_wrapper.sh : $(testbins) tests/test_wrapper.sh tests/pedantic-header-test.sh - rm -rf $(TESTNAME) - mkdir -p $(TESTNAME)/tests/ - cp $(testbins) $(TESTNAME)/tests/ - cp tests/test_wrapper.sh $(TESTNAME)/ - cp tests/pedantic-header-test.sh $(TESTNAME)/tests/ - chmod u+x $@ - -tests/test_wrapper.sh : tests/test_wrapper.sh.in - (cd tests/ ; make $@) diff --git a/libs/libsndfile/Scripts/clang-sanitize.sh b/libs/libsndfile/Scripts/clang-sanitize.sh deleted file mode 100644 index 2898883c21..0000000000 --- a/libs/libsndfile/Scripts/clang-sanitize.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# This is known to work with clang-3.4 from Debian testing/unstable. -# 2013/07/14 - -export CC=clang -export CXX=clang++ -export CFLAGS="-O3 -fsanitize=address,integer,undefined" -export CXXFLAGS="-O3 -fsanitize=address,integer,undefined" - -./configure --enable-gcc-werror - -make clean all check diff --git a/libs/libsndfile/Scripts/cstyle.py b/libs/libsndfile/Scripts/cstyle.py deleted file mode 100644 index 94a969c6e2..0000000000 --- a/libs/libsndfile/Scripts/cstyle.py +++ /dev/null @@ -1,246 +0,0 @@ -#!/usr/bin/python -tt -# -# Copyright (C) 2005-2012 Erik de Castro Lopo -# -# Released under the 2 clause BSD license. - -""" -This program checks C code for compliance to coding standards used in -libsndfile and other projects I run. -""" - -import re -import sys - - -class Preprocessor: - """ - Preprocess lines of C code to make it easier for the CStyleChecker class to - test for correctness. Preprocessing works on a single line at a time but - maintains state between consecutive lines so it can preprocessess multi-line - comments. - Preprocessing involves: - - Strip C++ style comments from a line. - - Strip C comments from a series of lines. When a C comment starts and - ends on the same line it will be replaced with 'comment'. - - Replace arbitrary C strings with the zero length string. - - Replace '#define f(x)' with '#define f (c)' (The C #define requires that - there be no space between defined macro name and the open paren of the - argument list). - Used by the CStyleChecker class. - """ - def __init__ (self): - self.comment_nest = 0 - self.leading_space_re = re.compile ('^(\t+| )') - self.trailing_space_re = re.compile ('(\t+| )$') - self.define_hack_re = re.compile ("(#\s*define\s+[a-zA-Z0-9_]+)\(") - - def comment_nesting (self): - """ - Return the currect comment nesting. At the start and end of the file, - this value should be zero. Inside C comments it should be 1 or - (possibly) more. - """ - return self.comment_nest - - def __call__ (self, line): - """ - Strip the provided line of C and C++ comments. Stripping of multi-line - C comments works as expected. - """ - - line = self.define_hack_re.sub (r'\1 (', line) - - line = self.process_strings (line) - - # Strip C++ style comments. - if self.comment_nest == 0: - line = re.sub ("( |\t*)//.*", '', line) - - # Strip C style comments. - open_comment = line.find ('/*') - close_comment = line.find ('*/') - - if self.comment_nest > 0 and close_comment < 0: - # Inside a comment block that does not close on this line. - return "" - - if open_comment >= 0 and close_comment < 0: - # A comment begins on this line but doesn't close on this line. - self.comment_nest += 1 - return self.trailing_space_re.sub ('', line [:open_comment]) - - if open_comment < 0 and close_comment >= 0: - # Currently open comment ends on this line. - self.comment_nest -= 1 - return self.trailing_space_re.sub ('', line [close_comment + 2:]) - - if open_comment >= 0 and close_comment > 0 and self.comment_nest == 0: - # Comment begins and ends on this line. Replace it with 'comment' - # so we don't need to check whitespace before and after the comment - # we're removing. - newline = line [:open_comment] + "comment" + line [close_comment + 2:] - return self.__call__ (newline) - - return line - - def process_strings (self, line): - """ - Given a line of C code, return a string where all literal C strings have - been replaced with the empty string literal "". - """ - for k in range (0, len (line)): - if line [k] == '"': - start = k - for k in range (start + 1, len (line)): - if line [k] == '"' and line [k - 1] != '\\': - return line [:start + 1] + '"' + self.process_strings (line [k + 1:]) - return line - - -class CStyleChecker: - """ - A class for checking the whitespace and layout of a C code. - """ - def __init__ (self, debug): - self.debug = debug - self.filename = None - self.error_count = 0 - self.line_num = 1 - self.orig_line = '' - self.trailing_newline_re = re.compile ('[\r\n]+$') - self.indent_re = re.compile ("^\s*") - self.last_line_indent = "" - self.last_line_indent_curly = False - self.re_checks = \ - [ ( re.compile (" "), "multiple space instead of tab" ) - , ( re.compile ("\t "), "space after tab" ) - , ( re.compile ("[^ ];"), "missing space before semi-colon" ) - , ( re.compile ("{[^\s}]"), "missing space after open brace" ) - , ( re.compile ("[^{\s]}"), "missing space before close brace" ) - , ( re.compile ("[ \t]+$"), "contains trailing whitespace" ) - - , ( re.compile (",[^\s\n]"), "missing space after comma" ) - , ( re.compile (";[a-zA-Z0-9]"), "missing space after semi-colon" ) - , ( re.compile ("=[^\s\"'=]"), "missing space after assignment" ) - - # Open and close parenthesis. - , ( re.compile ("[^\s\(\[\*&']\("), "missing space before open parenthesis" ) - , ( re.compile ("\)(-[^>]|[^,'\s\n\)\]-])"), "missing space after close parenthesis" ) - , ( re.compile ("\s(do|for|if|when)\s.*{$"), "trailing open parenthesis at end of line" ) - , ( re.compile ("\( [^;]"), "space after open parenthesis" ) - , ( re.compile ("[^;] \)"), "space before close parenthesis" ) - - # Open and close square brace. - , ( re.compile ("[^\s\(\]]\["), "missing space before open square brace" ) - , ( re.compile ("\][^,\)\]\[\s\.-]"), "missing space after close square brace" ) - , ( re.compile ("\[ "), "space after open square brace" ) - , ( re.compile (" \]"), "space before close square brace" ) - - # Space around operators. - , ( re.compile ("[^\s][\*/%+-][=][^\s]"), "missing space around opassign" ) - , ( re.compile ("[^\s][<>!=^/][=]{1,2}[^\s]"), "missing space around comparison" ) - - # Parens around single argument to return. - , ( re.compile ("\s+return\s+\([a-zA-Z0-9_]+\)\s+;"), "parens around return value" ) - ] - - def get_error_count (self): - """ - Return the current error count for this CStyleChecker object. - """ - return self.error_count - - def check_files (self, files): - """ - Run the style checker on all the specified files. - """ - for filename in files: - self.check_file (filename) - - def check_file (self, filename): - """ - Run the style checker on the specified file. - """ - self.filename = filename - cfile = open (filename, "r") - - self.line_num = 1 - - preprocess = Preprocessor () - while 1: - line = cfile.readline () - if not line: - break - - line = self.trailing_newline_re.sub ('', line) - self.orig_line = line - - self.line_checks (preprocess (line)) - - self.line_num += 1 - - cfile.close () - self.filename = None - - # Check for errors finding comments. - if preprocess.comment_nesting () != 0: - print ("Weird, comments nested incorrectly.") - sys.exit (1) - - return - - def line_checks (self, line): - """ - Run the style checker on provided line of text, but within the context - of how the line fits within the file. - """ - - indent = len (self.indent_re.search (line).group ()) - if re.search ("^\s+}", line): - if not self.last_line_indent_curly and indent != self.last_line_indent: - None # self.error ("bad indent on close curly brace") - self.last_line_indent_curly = True - else: - self.last_line_indent_curly = False - - # Now all the regex checks. - for (check_re, msg) in self.re_checks: - if check_re.search (line): - self.error (msg) - - if re.search ("[a-zA-Z0-9][<>!=^/&\|]{1,2}[a-zA-Z0-9]", line): - if not re.search (".*#include.*[a-zA-Z0-9]/[a-zA-Z]", line): - self.error ("missing space around operator") - - self.last_line_indent = indent - return - - def error (self, msg): - """ - Print an error message and increment the error count. - """ - print ("%s (%d) : %s" % (self.filename, self.line_num, msg)) - if self.debug: - print ("'" + self.orig_line + "'") - self.error_count += 1 - -#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - -if len (sys.argv) < 1: - print ("Usage : yada yada") - sys.exit (1) - -# Create a new CStyleChecker object -if sys.argv [1] == '-d' or sys.argv [1] == '--debug': - cstyle = CStyleChecker (True) - cstyle.check_files (sys.argv [2:]) -else: - cstyle = CStyleChecker (False) - cstyle.check_files (sys.argv [1:]) - - -if cstyle.get_error_count (): - sys.exit (1) - -sys.exit (0) diff --git a/libs/libsndfile/Scripts/git-pre-commit-hook b/libs/libsndfile/Scripts/git-pre-commit-hook deleted file mode 100644 index 6df1308ac3..0000000000 --- a/libs/libsndfile/Scripts/git-pre-commit-hook +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh -# - -if git rev-parse --verify HEAD >/dev/null 2>&1 ; then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 - fi - -files=$(git diff-index --name-status --cached HEAD | grep -v ^D | sed -r "s/^[A-Z]+[A-Z0-9]*[ \t]+/ /") - -# Redirect output to stderr. -exec 1>&2 - -#------------------------------------------------------------------------------- -# Check the copyright notice of all files to be commited. - -user=`git config --global user.email` -year=`date +"%Y"` - -missing_copyright_year="" -if test $user = "erikd@mega-nerd.com" ; then - for f in $files ; do - if test `head -5 $f | grep -c -i copyright` -gt 0 ; then - user_copyright=`grep -i copyright $f | grep $user | grep -c $year` - if test $user_copyright -lt 1 ; then - missing_copyright_year="$missing_copyright_year $f" - fi - fi - done - fi - -if test -n "$missing_copyright_year" ; then - echo "Missing current year in the copyright notice of the following files:" - for f in $missing_copyright_year ; do - echo " $f" - done - echo "Commit aborted." - exit 1 - fi - -#------------------------------------------------------------------------------- -# Check the formatting of all C files. - -cfiles="" -for f in $files ; do - if test `dirname $f` = "src/ALAC" ; then - echo "Skipping cstyle checking on $f" - elif test `echo $f | grep -c "\.[ch]$"` -gt 0 ; then - cfiles="$cfiles $f" - fi - done - -if test -n "$cfiles" ; then - Scripts/cstyle.py $cfiles - if test $? -ne 0 ; then - echo - echo "Commit aborted. Fix the above error before trying again." - exit 1 - fi - fi - -#------------------------------------------------------------------------------- -# Prevent files with non-ascii filenames from being committed. - -if test $(git diff --cached --name-only --diff-filter=A -z $against | LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 ; then - echo "Error: Attempt to add a non-ascii file name." - echo - echo "This can cause problems if you want to work" - echo "with people on other platforms." - echo - echo "To be portable it is advisable to rename the file ..." - echo - echo "Commit aborted." - exit 1 - fi - -exit 0 diff --git a/libs/libsndfile/Scripts/linux-to-win-cross-configure.sh b/libs/libsndfile/Scripts/linux-to-win-cross-configure.sh deleted file mode 100644 index c1fdc072b3..0000000000 --- a/libs/libsndfile/Scripts/linux-to-win-cross-configure.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -case "$1" in - w32) - compiler_name=i686-w64-mingw32 - ;; - w64) - compiler_name=x86_64-w64-mingw32 - ;; - *) - echo "$0 (w32|w64) " - exit 0 - ;; - esac - -shift - -build_cpu=$(dpkg-architecture -qDEB_BUILD_GNU_CPU) -build_host=$build_cpu-linux - -./configure --host=$compiler_name --target=$compiler_name --build=$build_host \ - --program-prefix='' --disable-sqlite --disable-static $@ diff --git a/libs/libsndfile/TODO b/libs/libsndfile/TODO deleted file mode 100644 index f6da6dff6a..0000000000 --- a/libs/libsndfile/TODO +++ /dev/null @@ -1,42 +0,0 @@ -Here's a list of what I (erikd AT mega-nerd DOT com) think needs to be -done. The list is by no means exhaustive and people are encouraged to -email me with suggestions. - - o Add pipe in/out capabilities. libsndfile should be able to read - its input from a pipe and write its output to a pipe. - - o Add checks of the error state after fseek???? Use ferror (). - - o Modify tests/lossy_comp_test.c to add tests for stereo files. - - o Testing compilation and correctness on more platforms. - - o Improve testing routines. Must test all combinations of inputs - and outputs. - - o Test sf_seek function on write??? - - o Add more sound file formats. People should contact me with their - requirements. - - o Add support for accessing sound formats with multiple audio - data sections (ie samples within tracker files, Soundfont II and - multi-sample sampler formats). - - o Add an interface to allow reading and writing of sample loop points - and other info within AIFF and other file formats. This must be a - general solution. - - o Improve documentation. Is HTML documentation good enough? - - o Look into the possibility of optional sample rate convert on file - read. - -As I am the person who knows libsndfile best, I can probably implement -any new features faster than anybody else (and you can spend your time -writing applications with libsndfile). All I need is some -documentation and some sample files. Please contact me before emailing -me documentation and sample files. I would much rather pull them off -the web than have them clogging up my email inbox. - - diff --git a/libs/libsndfile/Win32/Makefile.am b/libs/libsndfile/Win32/Makefile.am deleted file mode 100644 index 4fe8efa7b9..0000000000 --- a/libs/libsndfile/Win32/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -## Process this file with automake to produce Makefile.in - -EXTRA_DIST = README-precompiled-dll.txt testprog.c - diff --git a/libs/libsndfile/Win32/README-precompiled-dll.txt b/libs/libsndfile/Win32/README-precompiled-dll.txt deleted file mode 100644 index bde8124219..0000000000 --- a/libs/libsndfile/Win32/README-precompiled-dll.txt +++ /dev/null @@ -1,40 +0,0 @@ -Notes on Using the Pre-compiled libsndfile DLL. -=============================================== - -In order to use this pre-compiled DLL with Visual Studio, you will need to -generate a .LIB file from the DLL. - -This can be achieved as follows: - - 1) In a CMD window, change to the directory containing this file and - run the command: - - lib /machine:i386 /def:libsndfile-1.def - -You now have two files: - - libsndfile-1.dll - libsndfile-1.lib - -to be used with VisualStudio. - -If the lib command fails with a command saying "'lib' is not recognized as -an internal or external command, operable program or batch file", you need -to find the location of "lib.exe" and add that directory to your PATH -environment variable. Another alternative is to use the "Visual Studio 2005 -Command Prompt" Start menu item: - - Start -> - All Programs -> - Visual Studio 2005 -> - Visual Studio Tools -> - Visual Studio 2005 Command Prompt - -If for some reason these instructions don't work for you or you are still -not able to use the libsndfile DLL with you project, please do not contact -the main author of libsndfile. Instead, join the libsndfile-users mailing -list : - - http://www.mega-nerd.com/libsndfile/lists.html - -and ask a question there. diff --git a/libs/libsndfile/Win32/testprog.c b/libs/libsndfile/Win32/testprog.c deleted file mode 100644 index d26d844adf..0000000000 --- a/libs/libsndfile/Win32/testprog.c +++ /dev/null @@ -1,16 +0,0 @@ -/* Simple test program to make sure that Win32 linking to libsndfile is -** working. -*/ - -#include - -#include "sndfile.h" - -int -main (void) -{ static char strbuffer [256] ; - sf_command (NULL, SFC_GET_LIB_VERSION, strbuffer, sizeof (strbuffer)) ; - puts (strbuffer) ; - return 0 ; -} - diff --git a/libs/libsndfile/acinclude.m4 b/libs/libsndfile/acinclude.m4 deleted file mode 100644 index c411cebbda..0000000000 --- a/libs/libsndfile/acinclude.m4 +++ /dev/null @@ -1,637 +0,0 @@ -dnl By default, many hosts won't let programs access large files; -dnl one must use special compiler options to get large-file access to work. -dnl For more details about this brain damage please see: -dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html - -dnl Written by Paul Eggert . - -m4_include([M4/gcc_version.m4]) -m4_include([M4/octave.m4]) -m4_include([M4/mkoctfile_version.m4]) -m4_include([M4/extra_pkg.m4]) -m4_include([M4/lrint.m4]) -m4_include([M4/lrintf.m4]) -m4_include([M4/clang.m4]) -m4_include([M4/really_gcc.m4]) -m4_include([M4/stack_protect.m4]) -m4_include([M4/clip_mode.m4]) -m4_include([M4/add_cflags.m4]) -m4_include([M4/add_cxxflags.m4]) -m4_include([M4/flexible_array.m4]) -m4_include([M4/endian.m4]) -m4_include([M4/extra_largefile.m4]) - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl AC_SYS_EXTRA_LARGEFILE_FLAGS(FLAGSNAME) -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_FLAGS], - [AC_CACHE_CHECK([for $1 value to request large file support], - ac_cv_sys_largefile_$1, - [ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || { - ac_cv_sys_largefile_$1=no - ifelse($1, CFLAGS, - [case "$host_os" in - # IRIX 6.2 and later require cc -n32. -changequote(, )dnl - irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) -changequote([, ])dnl - if test "$GCC" != yes; then - ac_cv_sys_largefile_CFLAGS=-n32 - fi - ac_save_CC="$CC" - CC="$CC $ac_cv_sys_largefile_CFLAGS" - AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) - CC="$ac_save_CC" - esac]) - }])]) - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(VAR, VAL) -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND], - [case $2 in - no) ;; - ?*) - case "[$]$1" in - '') $1=$2 ;; - *) $1=[$]$1' '$2 ;; - esac ;; - esac]) - -dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE. -dnl AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT) -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE], - [AC_CACHE_CHECK([for $1], $2, - [$2=no -changequote(, )dnl - $4 - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - -D$1) - $2=1 ;; - -D$1=*) - $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; - esac - done -changequote([, ])dnl - ]) - if test "[$]$2" != no; then - AC_DEFINE_UNQUOTED([$1], [$]$2, [$3]) - fi]) - -AC_DEFUN([AC_SYS_EXTRA_LARGEFILE], - [AC_REQUIRE([AC_CANONICAL_HOST]) - AC_ARG_ENABLE(largefile, - [ --disable-largefile omit support for large files]) - if test "$enable_largefile" != no; then - AC_CHECK_TOOL(GETCONF, getconf) - AC_SYS_EXTRA_LARGEFILE_FLAGS(CFLAGS) - AC_SYS_EXTRA_LARGEFILE_FLAGS(LDFLAGS) - AC_SYS_EXTRA_LARGEFILE_FLAGS(LIBS) - - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - no) ;; - -D_FILE_OFFSET_BITS=*) ;; - -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; - -D_LARGE_FILES | -D_LARGE_FILES=*) ;; - -D?* | -I?*) - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;; - *) - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;; - esac - done - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") - AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, - ac_cv_sys_file_offset_bits, - [Number of bits in a file offset, on hosts where this is settable.]) - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_file_offset_bits=64 ;; - esac] - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, - ac_cv_sys_largefile_source, - [Define to make fseeko etc. visible, on some hosts.], - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_largefile_source=1 ;; - esac]) - AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGE_FILES, - ac_cv_sys_large_files, - [Define for large files, on AIX-style hosts.], - [case "$host_os" in - # AIX 4.2 and later - aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) - ac_cv_sys_large_files=1 ;; - esac]) - fi - ]) - - - - - - -dnl @synopsis AC_C_FIND_ENDIAN -dnl -dnl Determine endian-ness of target processor. -dnl @version 1.1 Mar 03 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Majority written from scratch to replace the standard autoconf macro -dnl AC_C_BIGENDIAN. Only part remaining from the original it the invocation -dnl of the AC_TRY_RUN macro. -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - -dnl Find endian-ness in the following way: -dnl 1) Look in . -dnl 2) If 1) fails, look in and . -dnl 3) If 1) and 2) fails and not cross compiling run a test program. -dnl 4) If 1) and 2) fails and cross compiling then guess based on target. - -AC_DEFUN([AC_C_FIND_ENDIAN], -[AC_CACHE_CHECK(processor byte ordering, - ac_cv_c_byte_order, - -# Initialize to unknown -ac_cv_c_byte_order=unknown - -if test x$ac_cv_header_endian_h = xyes ; then - - # First try which should set BYTE_ORDER. - - [AC_TRY_LINK([ - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - [AC_TRY_LINK([ - #include - #if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=big - )] - - fi - -if test $ac_cv_c_byte_order = unknown ; then - - [AC_TRY_LINK([ - #include - #include - #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros - #endif - ], return 0 ;, - - [AC_TRY_LINK([ - #include - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - [AC_TRY_LINK([ - #include - #include - #if BYTE_ORDER != LITTLE_ENDIAN - not big endian - #endif - ], return 0 ;, - ac_cv_c_byte_order=little - )] - - )] - - fi - -if test $ac_cv_c_byte_order = unknown ; then - if test $cross_compiling = yes ; then - # This is the last resort. Try to guess the target processor endian-ness - # by looking at the target CPU type. - [ - case "$target_cpu" in - alpha* | i?86* | mipsel* | ia64*) - ac_cv_c_big_endian=0 - ac_cv_c_little_endian=1 - ;; - - m68* | mips* | powerpc* | hppa* | sparc*) - ac_cv_c_big_endian=1 - ac_cv_c_little_endian=0 - ;; - - esac - ] - else - AC_TRY_RUN( - [[ - int main (void) - { /* Are we little or big endian? From Harbison&Steele. */ - union - { long l ; - char c [sizeof (long)] ; - } u ; - u.l = 1 ; - return (u.c [sizeof (long) - 1] == 1); - } - ]], , ac_cv_c_byte_order=big, - ac_cv_c_byte_order=unknown - ) - - AC_TRY_RUN( - [[int main (void) - { /* Are we little or big endian? From Harbison&Steele. */ - union - { long l ; - char c [sizeof (long)] ; - } u ; - u.l = 1 ; - return (u.c [0] == 1); - }]], , ac_cv_c_byte_order=little, - ac_cv_c_byte_order=unknown - ) - fi - fi - -) -] - -if test $ac_cv_c_byte_order = big ; then - ac_cv_c_big_endian=1 - ac_cv_c_little_endian=0 -elif test $ac_cv_c_byte_order = little ; then - ac_cv_c_big_endian=0 - ac_cv_c_little_endian=1 -else - ac_cv_c_big_endian=0 - ac_cv_c_little_endian=0 - - fi - -)# AC_C_FIND_ENDIAN - - - - - -dnl @synopsis AC_C99_FLEXIBLE_ARRAY -dnl -dnl Dose the compiler support the 1999 ISO C Standard "stuct hack". -dnl @version 1.1 Mar 15 2004 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - -AC_DEFUN([AC_C99_FLEXIBLE_ARRAY], -[AC_CACHE_CHECK(C99 struct flexible array support, - ac_cv_c99_flexible_array, - -# Initialize to unknown -ac_cv_c99_flexible_array=no - -AC_TRY_LINK([[ - #include - typedef struct { - int k; - char buffer [] ; - } MY_STRUCT ; - ]], - [ MY_STRUCT *p = calloc (1, sizeof (MY_STRUCT) + 42); ], - ac_cv_c99_flexible_array=yes, - ac_cv_c99_flexible_array=no - ))] -) # AC_C99_FLEXIBLE_ARRAY - - - - - -dnl @synopsis AC_C99_FUNC_LRINT -dnl -dnl Check whether C99's lrint function is available. -dnl @version 1.3 Feb 12 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([AC_C99_FUNC_LRINT], -[AC_CACHE_CHECK(for lrint, - ac_cv_c99_lrint, -[ -lrint_save_CFLAGS=$CFLAGS -CFLAGS="-lm" -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -], if (!lrint(3.14159)) lrint(2.7183);, ac_cv_c99_lrint=yes, ac_cv_c99_lrint=no) - -CFLAGS=$lrint_save_CFLAGS - -]) - -if test "$ac_cv_c99_lrint" = yes; then - AC_DEFINE(HAVE_LRINT, 1, - [Define if you have C99's lrint function.]) -fi -])# AC_C99_FUNC_LRINT -dnl @synopsis AC_C99_FUNC_LRINTF -dnl -dnl Check whether C99's lrintf function is available. -dnl @version 1.3 Feb 12 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([AC_C99_FUNC_LRINTF], -[AC_CACHE_CHECK(for lrintf, - ac_cv_c99_lrintf, -[ -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no) -]) - -if test "$ac_cv_c99_lrintf" = yes; then - AC_DEFINE(HAVE_LRINTF, 1, - [Define if you have C99's lrintf function.]) -fi -])# AC_C99_FUNC_LRINTF - - - - -dnl @synopsis AC_C99_FUNC_LLRINT -dnl -dnl Check whether C99's llrint function is available. -dnl @version 1.1 Sep 30 2002 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. -dnl -AC_DEFUN([AC_C99_FUNC_LLRINT], -[AC_CACHE_CHECK(for llrint, - ac_cv_c99_llrint, -[ -AC_TRY_LINK([ -#define _ISOC9X_SOURCE 1 -#define _ISOC99_SOURCE 1 -#define __USE_ISOC99 1 -#define __USE_ISOC9X 1 - -#include -#include -], int64_t x ; x = llrint(3.14159) ;, ac_cv_c99_llrint=yes, ac_cv_c99_llrint=no) -]) - -if test "$ac_cv_c99_llrint" = yes; then - AC_DEFINE(HAVE_LLRINT, 1, - [Define if you have C99's llrint function.]) -fi -])# AC_C99_FUNC_LLRINT - - - -dnl @synopsis AC_C_CLIP_MODE -dnl -dnl Determine the clipping mode when converting float to int. -dnl @version 1.0 May 17 2003 -dnl @author Erik de Castro Lopo -dnl -dnl Permission to use, copy, modify, distribute, and sell this file for any -dnl purpose is hereby granted without fee, provided that the above copyright -dnl and this permission notice appear in all copies. No representations are -dnl made about the suitability of this software for any purpose. It is -dnl provided "as is" without express or implied warranty. - - - -dnl Find the clipping mode in the following way: -dnl 1) If we are not cross compiling test it. -dnl 2) IF we are cross compiling, assume that clipping isn't done correctly. - -AC_DEFUN([AC_C_CLIP_MODE], -[AC_CACHE_CHECK(processor clipping capabilities, - ac_cv_c_clip_type, - -# Initialize to unknown -ac_cv_c_clip_positive=unknown -ac_cv_c_clip_negative=unknown - -if test $ac_cv_c_clip_positive = unknown ; then - AC_TRY_RUN( - [[ - #define _ISOC9X_SOURCE 1 - #define _ISOC99_SOURCE 1 - #define __USE_ISOC99 1 - #define __USE_ISOC9X 1 - #include - int main (void) - { double fval ; - int k, ival ; - - fval = 1.0 * 0x7FFFFFFF ; - for (k = 0 ; k < 100 ; k++) - { ival = (lrint (fval)) >> 24 ; - if (ival != 127) - return 1 ; - - fval *= 1.2499999 ; - } ; - - return 0 ; - } - ]], - ac_cv_c_clip_positive=yes, - ac_cv_c_clip_positive=no, - ac_cv_c_clip_positive=unknown - ) - - AC_TRY_RUN( - [[ - #define _ISOC9X_SOURCE 1 - #define _ISOC99_SOURCE 1 - #define __USE_ISOC99 1 - #define __USE_ISOC9X 1 - #include - int main (void) - { double fval ; - int k, ival ; - - fval = -8.0 * 0x10000000 ; - for (k = 0 ; k < 100 ; k++) - { ival = (lrint (fval)) >> 24 ; - if (ival != -128) - return 1 ; - - fval *= 1.2499999 ; - } ; - - return 0 ; - } - ]], - ac_cv_c_clip_negative=yes, - ac_cv_c_clip_negative=no, - ac_cv_c_clip_negative=unknown - ) - fi - -if test $ac_cv_c_clip_positive = yes ; then - ac_cv_c_clip_positive=1 -else - ac_cv_c_clip_positive=0 - fi - -if test $ac_cv_c_clip_negative = yes ; then - ac_cv_c_clip_negative=1 -else - ac_cv_c_clip_negative=0 - fi - -[[ -case "$ac_cv_c_clip_positive$ac_cv_c_clip_negative" in - "00") - ac_cv_c_clip_type="none" - ;; - "10") - ac_cv_c_clip_type="positive" - ;; - "01") - ac_cv_c_clip_type="negative" - ;; - "11") - ac_cv_c_clip_type="both" - ;; - esac - ]] - -) -] - -)# AC_C_CLIP_MODE - - -dnl @synopsis AC_ADD_CFLAGS -dnl -dnl Add the given option to CFLAGS, if it doesn't break the compiler - -AC_DEFUN([AC_ADD_CFLAGS], -[AC_MSG_CHECKING([if $CC accepts $1]) - ac_add_cflags__old_cflags="$CFLAGS" - CFLAGS="$CFLAGS $1" - AC_TRY_LINK([#include ], - [printf("Hello, World!\n"); return 0;], - AC_MSG_RESULT([yes]), - AC_MSG_RESULT([no]) - CFLAGS="$ac_add_cflags__old_cflags") -]) - - - -dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -AC_DEFUN([PKG_CHECK_MODULES], [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) - - - - -ifelse(dnl - - Do not edit or modify anything in this comment block. - The arch-tag line is a file identity tag for the GNU Arch - revision control system. - - arch-tag: bc38294d-bb5c-42ad-90b9-779def5eaab7 - -)dnl diff --git a/libs/libsndfile/autogen.sh b/libs/libsndfile/autogen.sh deleted file mode 100644 index 5047159fe4..0000000000 --- a/libs/libsndfile/autogen.sh +++ /dev/null @@ -1,179 +0,0 @@ -#!/bin/sh -# Run this to set up the build system: configure, makefiles, etc. -# (based on the version in enlightenment's cvs) - -package="libsndfile" - -ACLOCAL_FLAGS="-I M4" - -olddir=`pwd` -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -DIE=0 - -printf "checking for autogen ... " -result="yes" -(autogen --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have GNU autogen installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - result="no" - DIE=1 -} -echo $result - -printf "checking for autoconf ... " -result="yes" -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - result="no" - DIE=1 -} -echo $result - -VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/" -VERSIONMKMAJ="sed -e s/\([0-9][0-9]*\)[^0-9].*/\\1/" -VERSIONMKMIN="sed -e s/.*[0-9][0-9]*\.//" - -# do we need automake? -if test -r Makefile.am; then - AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am` - AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP` - if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then - AM_NEEDED="" - fi - if test -z $AM_NEEDED; then - printf "checking for automake ... " - AUTOMAKE=automake - ACLOCAL=aclocal - if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then - echo "yes" - else - echo "no" - AUTOMAKE= - fi - else - printf "checking for automake $AM_NEEDED or later ... " - majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ` - minneeded=`echo $AM_NEEDED | $VERSIONMKMIN` - for am in automake-$AM_NEEDED automake$AM_NEEDED \ - automake automake-1.7 automake-1.8 automake-1.9 automake-1.10; do - ($am --version < /dev/null > /dev/null 2>&1) || continue - ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP` - maj=`echo $ver | $VERSIONMKMAJ` - min=`echo $ver | $VERSIONMKMIN` - if test $maj -eq $majneeded -a $min -ge $minneeded; then - AUTOMAKE=$am - echo $AUTOMAKE - break - fi - done - test -z $AUTOMAKE && echo "no" - printf "checking for aclocal $AM_NEEDED or later ... " - for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \ - aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10; do - ($ac --version < /dev/null > /dev/null 2>&1) || continue - ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP` - maj=`echo $ver | $VERSIONMKMAJ` - min=`echo $ver | $VERSIONMKMIN` - if test $maj -eq $majneeded -a $min -ge $minneeded; then - ACLOCAL=$ac - echo $ACLOCAL - break - fi - done - test -z $ACLOCAL && echo "no" - fi - test -z $AUTOMAKE || test -z $ACLOCAL && { - echo - echo "You must have automake installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - exit 1 - } -fi - -printf "checking for libtool ... " -for LIBTOOLIZE in libtoolize glibtoolize nope; do - ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break -done -if test x$LIBTOOLIZE = xnope; then - echo "nope." - LIBTOOLIZE=libtoolize -else - echo $LIBTOOLIZE -fi -($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have libtool installed to compile $package." - echo "Download the appropriate package for your system," - echo "or get the source from one of the GNU ftp sites" - echo "listed in http://www.gnu.org/order/ftp.html" - DIE=1 -} - -printf "checking for pkg-config ... " -result="yes" -(pkg-config --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have pkg-config installed to compile $package." - echo "Download the appropriate package for your distribution." - result="no" - DIE=1 -} -echo $result - - -printf "checking for python ... " -result="yes" -(python --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have Python installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at http://python.org/" - result="no" - DIE=1 -} -echo $result - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test ! -d Cfg ; then - echo "Creating 'Cfg' directory." - mkdir Cfg -fi - -echo "Generating configuration files for $package, please wait ... " - -echo " $ACLOCAL $ACLOCAL_FLAGS" -$ACLOCAL $ACLOCAL_FLAGS || exit 1 -echo " $LIBTOOLIZE --automake --force" -$LIBTOOLIZE --automake --force || exit 1 -echo " autoheader" -autoheader || exit 1 -echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS" -$AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1 -echo " autoconf" -autoconf || exit 1 - -cd $olddir - -fprecommit=.git/hooks/pre-commit -if test ! -f $fprecommit ; then - echo - echo "Installing git pre-commit hook for this project." - cat > $fprecommit << 'foobar' -#!/bin/sh -exec Scripts/git-pre-commit-hook -foobar - chmod u+x $fprecommit - echo - fi diff --git a/libs/libsndfile/binheader_readf_check.py b/libs/libsndfile/binheader_readf_check.py deleted file mode 100644 index 774abcd988..0000000000 --- a/libs/libsndfile/binheader_readf_check.py +++ /dev/null @@ -1,62 +0,0 @@ -g#!/usr/bin/python - -import re, string, sys - -def trim_function_and_params (section): - k = string.find (section, "(") + 1 - brackets = 1 - section_len = len (section) - while k < section_len: - if section [k] == '(': - brackets += 1 - elif section [k] == ')': - brackets -= 1 - if brackets < 1: - return section [:k+1] - k += 1 - print "Whoops!!!!" - sys.exit (1) - -def get_function_calls (filedata): - filedata = string.split (filedata, "psf_binheader_readf") - filedata = filedata [1:] - - func_calls = [] - for section in filedata: - section = "psf_binheader_readf" + section - func_calls.append (trim_function_and_params (section)) - - return func_calls - -def search_for_problems (filename): - filedata = open (filename, "r").read () - - if len (filedata) < 1: - print "Error : file '%s' contains no data." % filename - sys.exit (1) - - count = 0 - - calls = get_function_calls (filedata) - for call in calls: - if string.find (call, "sizeof") > 0: - print "Found : ", call - count += 1 - - if count == 0: - print "%-20s : No problems found." % filename - else: - print "\n%-20s : Found %d errors." % (filename, count) - sys.exit (1) - return - - -#------------------------------------------------------------------------------- - -if len (sys.argv) < 2: - print "Usage : %s " % sys.argv [0] - sys.exit (1) - -for file in sys.argv [1:]: - search_for_problems (file) - diff --git a/libs/libsndfile/configure.ac b/libs/libsndfile/configure.ac deleted file mode 100644 index 5893db2a66..0000000000 --- a/libs/libsndfile/configure.ac +++ /dev/null @@ -1,697 +0,0 @@ -# Copyright (C) 1999-2013 Erik de Castro Lopo . - -dnl Require autoconf version -AC_PREREQ(2.57) - -AC_INIT([libsndfile],[1.0.26pre5],[sndfile@mega-nerd.com], - [libsndfile],[http://www.mega-nerd.com/libsndfile/]) - -# Put config stuff in Cfg. -AC_CONFIG_AUX_DIR(Cfg) - -AC_CONFIG_SRCDIR([src/sndfile.c]) -AC_CANONICAL_TARGET([]) - -AC_CONFIG_MACRO_DIR([M4]) -AC_CONFIG_HEADERS([src/config.h]) - -CFLAGS="$CFLAGS $CONFIGURE_CFLAGS" -CXXFLAGS="$CXXFLAGS $CONFIGURE_CXXFLAGS" -LDFLAGS="$LDFLAGS $CONFIGURE_LDFLAGS" - -AM_INIT_AUTOMAKE -AC_SUBST(ACLOCAL_AMFLAGS, "-I M4") -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -AC_LANG([C]) - -AC_PROG_CC_STDC -AC_USE_SYSTEM_EXTENSIONS -AM_PROG_CC_C_O -AC_PROG_CXX - -MN_C_COMPILER_IS_CLANG -MN_GCC_REALLY_IS_GCC - -AC_PROG_SED - -# Do not check for F77. -define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl - -AM_PROG_LIBTOOL -LT_PROG_RC - -AC_PROG_INSTALL -AC_PROG_LN_S - -AC_CHECK_PROG(HAVE_AUTOGEN, autogen, yes, no) -AC_CHECK_PROG(HAVE_WINE, wine, yes, no) -AC_CHECK_PROG(HAVE_XCODE_SELECT, xcode-select, yes, no) - -#------------------------------------------------------------------------------------ -# Rules for library version information: -# -# 1. Start with version information of `0:0:0' for each libtool library. -# 2. Update the version information only immediately before a public release of -# your software. More frequent updates are unnecessary, and only guarantee -# that the current interface number gets larger faster. -# 3. If the library source code has changed at all since the last update, then -# increment revision (`c:r:a' becomes `c:r+1:a'). -# 4. If any interfaces have been added, removed, or changed since the last update, -# increment current, and set revision to 0. -# 5. If any interfaces have been added since the last public release, then increment -# age. -# 6. If any interfaces have been removed since the last public release, then set age -# to 0. - -CLEAN_VERSION=`echo $PACKAGE_VERSION | $SED "s/p.*//"` -VERSION_MINOR=`echo $CLEAN_VERSION | $SED "s/.*\.//"` - -SHARED_VERSION_INFO="1:$VERSION_MINOR:0" - -#------------------------------------------------------------------------------------ - -AC_HEADER_STDC - -AC_CHECK_HEADERS(endian.h) -AC_CHECK_HEADERS(byteswap.h) -AC_CHECK_HEADERS(locale.h) -AC_CHECK_HEADERS(sys/time.h) - -AC_HEADER_SYS_WAIT - -AC_CHECK_DECLS(S_IRGRP) -if test x$ac_cv_have_decl_S_IRGRP = xyes ; then - AC_DEFINE_UNQUOTED([HAVE_DECL_S_IRGRP],1,[Set to 1 if S_IRGRP is defined.]) -else - AC_DEFINE_UNQUOTED([HAVE_DECL_S_IRGRP],0) - fi - -AM_CONDITIONAL([LINUX_MINGW_CROSS_TEST], - [test "$build_os:$target_os:$host_os:$HAVE_WINE" = "linux-gnu:mingw32msvc:mingw32msvc:yes"]) - -#==================================================================================== -# Couple of initializations here. Fill in real values later. - -SHLIB_VERSION_ARG="" - -#==================================================================================== -# Finished checking, handle options. - -AC_ARG_ENABLE(experimental, - AC_HELP_STRING([--enable-experimental], [enable experimental code])) - -EXPERIMENTAL_CODE=0 -if test x$enable_experimental = xyes ; then - EXPERIMENTAL_CODE=1 - fi -AC_DEFINE_UNQUOTED([ENABLE_EXPERIMENTAL_CODE],${EXPERIMENTAL_CODE}, [Set to 1 to enable experimental code.]) - -AC_ARG_ENABLE(werror, - AC_HELP_STRING([--enable-werror], [enable -Werror in all Makefiles])) - -AC_ARG_ENABLE(stack-smash-protection, - AC_HELP_STRING([--enable-stack-smash-protection], [Enable GNU GCC stack smash protection])) - -AC_ARG_ENABLE(gcc-pipe, - AC_HELP_STRING([--disable-gcc-pipe], [disable gcc -pipe option])) - -AC_ARG_ENABLE(gcc-opt, - AC_HELP_STRING([--disable-gcc-opt], [disable gcc optimisations])) - -AC_ARG_ENABLE(cpu-clip, - AC_HELP_STRING([--disable-cpu-clip], [disable tricky cpu specific clipper])) - -AC_ARG_ENABLE(bow-docs, - AC_HELP_STRING([--enable-bow-docs], [enable black-on-white html docs])) - -AC_ARG_ENABLE(sqlite, - AC_HELP_STRING([--disable-sqlite], [disable use of sqlite])) - -AC_ARG_ENABLE(alsa, - AC_HELP_STRING([--disable-alsa], [disable use of ALSA])) - -AC_ARG_ENABLE(external-libs, - AC_HELP_STRING([--disable-external-libs], [disable use of FLAC, Ogg and Vorbis [[default=no]]])) - -AC_ARG_ENABLE(octave, - AC_HELP_STRING([--enable-octave], [disable building of GNU Octave module])) - -AC_ARG_ENABLE(test-coverage, - AC_HELP_STRING([--enable-test-coverage], [enable test coverage])) -AM_CONDITIONAL([ENABLE_TEST_COVERAGE], [test "$enable_test_coverage" = yes]) - -#==================================================================================== -# Check types and their sizes. - -AC_CHECK_SIZEOF(wchar_t,4) -AC_CHECK_SIZEOF(short,2) -AC_CHECK_SIZEOF(int,4) -AC_CHECK_SIZEOF(long,4) -AC_CHECK_SIZEOF(float,4) -AC_CHECK_SIZEOF(double,4) -AC_CHECK_SIZEOF(void*,8) -AC_CHECK_SIZEOF(size_t,4) -AC_CHECK_SIZEOF(int64_t,8) -AC_CHECK_SIZEOF(long long,8) - -#==================================================================================== -# Find an appropriate type for sf_count_t. -# On systems supporting files larger than 2 Gig, sf_count_t must be a 64 bit value. -# Unfortunately there is more than one way of ensuring this so need to do some -# pretty rigourous testing here. - -# Check for common 64 bit file offset types. -AC_CHECK_SIZEOF(off_t,1) -AC_CHECK_SIZEOF(loff_t,1) -AC_CHECK_SIZEOF(off64_t,1) - -if test "$enable_largefile:$ac_cv_sizeof_off_t" = "no:8" ; then - echo - echo "Error : Cannot disable large file support because sizeof (off_t) == 8." - echo - exit 1 - fi - - -case "$host_os" in - mingw32msvc | mingw32) - TYPEOF_SF_COUNT_T="__int64" - SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" - SIZEOF_SF_COUNT_T=8 - AC_DEFINE([__USE_MINGW_ANSI_STDIO],1,[Set to 1 to use C99 printf/snprintf in MinGW.]) - ;; - *) - SIZEOF_SF_COUNT_T=0 - if test "x$ac_cv_sizeof_off_t" = "x8" ; then - # If sizeof (off_t) is 8, no further checking is needed. - TYPEOF_SF_COUNT_T="int64_t" - SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" - SIZEOF_SF_COUNT_T=8 - elif test "x$ac_cv_sizeof_loff_t" = "x8" ; then - TYPEOF_SF_COUNT_T="int64_t" - SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" - SIZEOF_SF_COUNT_T=8 - elif test "x$ac_cv_sizeof_off64_t" = "x8" ; then - TYPEOF_SF_COUNT_T="int64_t" - SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" - SIZEOF_SF_COUNT_T=8 - else - # Save the old sizeof (off_t) value and then unset it to see if it - # changes when Large File Support is enabled. - pre_largefile_sizeof_off_t=$ac_cv_sizeof_off_t - unset ac_cv_sizeof_off_t - - AC_SYS_LARGEFILE - - if test "x$ac_cv_sys_largefile_CFLAGS" = "xno" ; then - ac_cv_sys_largefile_CFLAGS="" - fi - if test "x$ac_cv_sys_largefile_LDFLAGS" = "xno" ; then - ac_cv_sys_largefile_LDFLAGS="" - fi - if test "x$ac_cv_sys_largefile_LIBS" = "xno" ; then - ac_cv_sys_largefile_LIBS="" - fi - - AC_CHECK_SIZEOF(off_t,1) - - if test "x$ac_cv_sizeof_off_t" = "x8" ; then - TYPEOF_SF_COUNT_T="int64_t" - SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" - elif test "x$TYPEOF_SF_COUNT_T" = "xunknown" ; then - echo - echo "*** The configure process has determined that this system is capable" - echo "*** of Large File Support but has not been able to find a type which" - echo "*** is an unambiguous 64 bit file offset." - echo "*** Please contact the author to help resolve this problem." - echo - AC_MSG_ERROR([[Bad file offset type.]]) - fi - fi - ;; - esac - -if test $SIZEOF_SF_COUNT_T = 4 ; then - SF_COUNT_MAX="0x7FFFFFFF" - fi - -AC_DEFINE_UNQUOTED([TYPEOF_SF_COUNT_T],${TYPEOF_SF_COUNT_T}, [Set to long if unknown.]) -AC_SUBST(TYPEOF_SF_COUNT_T) - -AC_DEFINE_UNQUOTED([SIZEOF_SF_COUNT_T],${SIZEOF_SF_COUNT_T}, [Set to sizeof (long) if unknown.]) -AC_SUBST(SIZEOF_SF_COUNT_T) - -AC_DEFINE_UNQUOTED([SF_COUNT_MAX],${SF_COUNT_MAX}, [Set to maximum allowed value of sf_count_t type.]) -AC_SUBST(SF_COUNT_MAX) - -AC_CHECK_TYPES(ssize_t) -AC_CHECK_SIZEOF(ssize_t,4) - -#==================================================================================== -# Determine endian-ness of target processor. - -MN_C_FIND_ENDIAN - -AC_DEFINE_UNQUOTED(CPU_IS_BIG_ENDIAN, ${ac_cv_c_big_endian}, - [Target processor is big endian.]) -AC_DEFINE_UNQUOTED(CPU_IS_LITTLE_ENDIAN, ${ac_cv_c_little_endian}, - [Target processor is little endian.]) -AC_DEFINE_UNQUOTED(WORDS_BIGENDIAN, ${ac_cv_c_big_endian}, - [Target processor is big endian.]) - -#==================================================================================== -# Check for functions. - -AC_CHECK_FUNCS(malloc calloc realloc free) -AC_CHECK_FUNCS(open read write lseek lseek64) -AC_CHECK_FUNCS(fstat fstat64 ftruncate fsync) -AC_CHECK_FUNCS(snprintf vsnprintf) -AC_CHECK_FUNCS(gmtime gmtime_r localtime localtime_r gettimeofday) -AC_CHECK_FUNCS(mmap getpagesize) -AC_CHECK_FUNCS(setlocale) -AC_CHECK_FUNCS(pipe waitpid) - -AC_CHECK_LIB([m],floor) -AC_CHECK_FUNCS(floor ceil fmod lround) - -MN_C99_FUNC_LRINT -MN_C99_FUNC_LRINTF - -#==================================================================================== -# Check for requirements for building plugins for other languages/enviroments. - -dnl Octave maths environment http://www.octave.org/ -if test x$cross_compiling = xno ; then - if test x$enable_octave = xno ; then - AM_CONDITIONAL(BUILD_OCTAVE_MOD, false) - else - AC_OCTAVE_BUILD - fi -else - AM_CONDITIONAL(BUILD_OCTAVE_MOD, false) - fi - -#==================================================================================== -# Check for Ogg, Vorbis and FLAC. - -HAVE_EXTERNAL_LIBS=0 -EXTERNAL_CFLAGS="" -EXTERNAL_LIBS="" - -# Check for pkg-config outside the if statement. -#PKG_PROG_PKG_CONFIG -#m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig)) - -#if test -n "$PKG_CONFIG" ; then -# if test x$enable_external_libs = xno ; then -# AC_MSG_WARN([[*** External libs (FLAC, Ogg, Vorbis) disabled. ***]]) -# else -# PKG_CHECK_MOD_VERSION([FLAC], [flac >= 1.2.1], [ac_cv_flac=yes], [ac_cv_flac=no]) - - # Make sure the FLAC_CFLAGS value is sane. -# FLAC_CFLAGS=`echo $FLAC_CFLAGS | $SED "s|include/FLAC|include|"` - -# PKG_CHECK_MOD_VERSION([OGG], [ogg >= 1.1.3], [ac_cv_ogg=yes], [ac_cv_ogg=no]) - -# if test x$enable_experimental = xyes ; then -# PKG_CHECK_MOD_VERSION([SPEEX], [speex >= 1.2], [ac_cv_speex=yes], [ac_cv_speex=no]) -# else -# SPEEX_CFLAGS="" -# SPEEX_LIBS="" -# fi - - # Vorbis versions earlier than 1.2.3 have bugs that cause the libsndfile - # test suite to fail on MIPS, PowerPC and others. - # See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549899 -# PKG_CHECK_MOD_VERSION([VORBIS], [vorbis >= 1.2.3], [ac_cv_vorbis=yes], [ac_cv_vorbis=no]) -# PKG_CHECK_MOD_VERSION([VORBISENC], [vorbisenc >= 1.2.3], [ac_cv_vorbisenc=yes], [ac_cv_vorbisenc=no]) -# enable_external_libs=yes -# fi - -# if test x$ac_cv_flac$ac_cv_ogg$ac_cv_vorbis$ac_cv_vorbisenc = "xyesyesyesyes" ; then -# HAVE_EXTERNAL_LIBS=1 -# enable_external_libs=yes - -# EXTERNAL_CFLAGS="$FLAC_CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS $VORBISENC_CFLAGS $SPEEX_CFLAGS" -# EXTERNAL_LIBS="$FLAC_LIBS $OGG_LIBS $VORBIS_LIBS $VORBISENC_LIBS $SPEEX_LIBS " -# else -# echo -# AC_MSG_WARN([[*** One or more of the external libraries (ie libflac, libogg and]]) -# AC_MSG_WARN([[*** libvorbis) is either missing (possibly only the development]]) -# AC_MSG_WARN([[*** headers) or is of an unsupported version.]]) -# AC_MSG_WARN([[***]]) -# AC_MSG_WARN([[*** Unfortunately, for ease of maintenance, the external libs]]) -# AC_MSG_WARN([[*** are an all or nothing affair.]]) -# echo -# enable_external_libs=no -# fi -# fi - -AC_DEFINE_UNQUOTED([HAVE_EXTERNAL_LIBS], $HAVE_EXTERNAL_LIBS, [Will be set to 1 if flac, ogg and vorbis are available.]) - -#==================================================================================== -# Check for libsqlite3 (only used in regtest). - -ac_cv_sqlite3=no -#if test x$enable_sqlite != xno ; then -# PKG_CHECK_MOD_VERSION([SQLITE3], [sqlite3 >= 3.2], [ac_cv_sqlite3=yes], [ac_cv_sqlite3=no]) -# fi - -if test x$ac_cv_sqlite3 = "xyes" ; then - HAVE_SQLITE3=1 -else - HAVE_SQLITE3=0 - fi - -AC_DEFINE_UNQUOTED([HAVE_SQLITE3],$HAVE_SQLITE3,[Set to 1 if you have libsqlite3.]) - -#==================================================================================== -# Determine if the processor can do clipping on float to int conversions. - -if test x$enable_cpu_clip != "xno" ; then - MN_C_CLIP_MODE -else - echo "checking processor clipping capabilities... disabled" - ac_cv_c_clip_positive=0 - ac_cv_c_clip_negative=0 - fi - -AC_DEFINE_UNQUOTED(CPU_CLIPS_POSITIVE, ${ac_cv_c_clip_positive}, - [Target processor clips on positive float to int conversion.]) -AC_DEFINE_UNQUOTED(CPU_CLIPS_NEGATIVE, ${ac_cv_c_clip_negative}, - [Target processor clips on negative float to int conversion.]) - -#==================================================================================== -# Target OS specific stuff. - -OS_SPECIFIC_CFLAGS="" -OS_SPECIFIC_LINKS="" -os_is_win32=0 -use_windows_api=0 -osx_darwin_version=0 - -case "$host_os" in - darwin* | rhapsody*) - osx_darwin_version=$(echo "$host_os" | sed 's/\..*//;s/darwin//g') - if test x$HAVE_XCODE_SELECT = xyes ; then - developer_path=`xcode-select --print-path` - else - developer_path="/Developer" - fi - OS_SPECIFIC_CFLAGS="-I${developer_path}/Headers/FlatCarbon" - OS_SPECIFIC_LINKS="-framework CoreAudio -framework AudioToolbox -framework CoreFoundation" - ;; - mingw*) - os_is_win32=1 - use_windows_api=1 - OS_SPECIFIC_LINKS="-lwinmm" - ;; - esac - -AC_DEFINE_UNQUOTED(OS_IS_WIN32, ${os_is_win32}, [Set to 1 if compiling for Win32]) -AC_DEFINE_UNQUOTED(USE_WINDOWS_API, ${use_windows_api}, [Set to 1 to use the native windows API]) -AC_DEFINE_UNQUOTED(OSX_DARWIN_VERSION, ${osx_darwin_version}, [The darwin version, no-zero is valid]) -AM_CONDITIONAL(USE_WIN_VERSION_FILE, test ${use_windows_api} -eq 1) - -#==================================================================================== -# Check for ALSA. - -ALSA_LIBS="" - -if test x$enable_alsa != xno ; then - AC_CHECK_HEADERS(alsa/asoundlib.h) - if test x$ac_cv_header_alsa_asoundlib_h = xyes ; then - ALSA_LIBS="-lasound" - enable_alsa=yes - fi - fi - -#==================================================================================== -# Check for OpenBSD's sndio. - -SNDIO_LIBS="" -AC_CHECK_HEADERS(sndio.h) -if test x$ac_cv_header_sndio_h = xyes ; then - SNDIO_LIBS="-lsndio" - fi - -#==================================================================================== -# Test for sanity when cross-compiling. - -if test $ac_cv_sizeof_short != 2 ; then - AC_MSG_WARN([[******************************************************************]]) - AC_MSG_WARN([[*** sizeof (short) != 2. ]]) - AC_MSG_WARN([[******************************************************************]]) - fi - -if test $ac_cv_sizeof_int != 4 ; then - AC_MSG_WARN([[******************************************************************]]) - AC_MSG_WARN([[*** sizeof (int) != 4 ]]) - AC_MSG_WARN([[******************************************************************]]) - fi - -if test $ac_cv_sizeof_float != 4 ; then - AC_MSG_WARN([[******************************************************************]]) - AC_MSG_WARN([[*** sizeof (float) != 4. ]]) - AC_MSG_WARN([[******************************************************************]]) - fi - -if test $ac_cv_sizeof_double != 8 ; then - AC_MSG_WARN([[******************************************************************]]) - AC_MSG_WARN([[*** sizeof (double) != 8. ]]) - AC_MSG_WARN([[******************************************************************]]) - fi - -if test x"$ac_cv_prog_HAVE_AUTOGEN" = "xno" ; then - AC_MSG_WARN([[Touching files in directory tests/.]]) - touch tests/*.c tests/*.h - fi - -#==================================================================================== -# Settings for the HTML documentation. - -if test x$enable_bow_docs = "xyes" ; then - HTML_BGCOLOUR="white" - HTML_FGCOLOUR="black" -else - HTML_BGCOLOUR="black" - HTML_FGCOLOUR="white" - fi - -#==================================================================================== -# Now use the information from the checking stage. - -win32_target_dll=0 -COMPILER_IS_GCC=0 - -if test x$ac_cv_c_compiler_gnu = xyes ; then - MN_ADD_CFLAGS(-std=gnu99) - - MN_GCC_VERSION - - if test "x$GCC_MAJOR_VERSION$GCC_MINOR_VERSION" = "x42" ; then - AC_MSG_WARN([****************************************************************]) - AC_MSG_WARN([** GCC version 4.2 warns about the inline keyword for no good **]) - AC_MSG_WARN([** reason but the maintainers do not see it as a bug. **]) - AC_MSG_WARN([** See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33995 **]) - AC_MSG_WARN([** Using -fgnu-inline to avoid this stupidity. **]) - AC_MSG_WARN([****************************************************************]) - MN_ADD_CFLAGS([-fgnu89-inline]) - fi - - CFLAGS="$CFLAGS -Wall" - CXXFLAGS="$CXXFLAGS -Wall" - - MN_ADD_CFLAGS([-Wextra]) - - AC_LANG_PUSH([C++]) - MN_ADD_CXXFLAGS([-Wextra]) - AC_LANG_POP([C++]) - - MN_ADD_CFLAGS([-Wdeclaration-after-statement]) - MN_ADD_CFLAGS([-Wpointer-arith]) - MN_ADD_CFLAGS([-funsigned-char]) - - MN_ADD_CFLAGS([-D_FORTIFY_SOURCE=2]) - - if test x$enable_stack_smash_protection = "xyes" ; then - XIPH_GCC_STACK_PROTECTOR - XIPH_GXX_STACK_PROTECTOR - fi - - if test x$enable_test_coverage = "xyes" ; then - # MN_ADD_CFLAGS([-ftest-coverage]) - MN_ADD_CFLAGS([-coverage]) - fi - - CFLAGS="$CFLAGS -Wcast-align -Wcast-qual -Wshadow -Wbad-function-cast -Wwrite-strings -Wundef -Wuninitialized -Winit-self -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Waggregate-return" - # -Winline -Wconversion -Wunreachable-code" - CXXFLAGS="$CXXFLAGS -Wcast-align -Wcast-qual -Wshadow -Wwrite-strings -Wctor-dtor-privacy -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder -Wsign-promo -Wundef -Wuninitialized -Winit-self" - - if test "x$enable_gcc_opt" = "xno" ; then - temp_CFLAGS=`echo $CFLAGS | $SED "s/O2/O0/"` - CFLAGS=$temp_CFLAGS - AC_MSG_WARN([[*** Compiler optimisations switched off. ***]]) - fi - - # OS specific tweaks. - case "$host_os" in - darwin* | rhapsody*) - # Disable -Wall, -pedantic and -Wshadow for Apple Darwin/Rhapsody. - # System headers on these systems are broken. - temp_CFLAGS=`echo $CFLAGS | $SED "s/-Wall -pedantic//" | $SED "s/-Wshadow//" | $SED "s/-Waggregate-return//"` - CFLAGS=$temp_CFLAGS - SHLIB_VERSION_ARG="-Wl,-exported_symbols_list -Wl,\$(builddir)/Symbols.darwin" - ;; - linux*|kfreebsd*-gnu*|gnu*) - SHLIB_VERSION_ARG="-Wl,--version-script=\$(builddir)/Symbols.gnu-binutils" - ;; - mingw*) - # Linker flag '-Wl,--out-implib' does not work with mingw cross compiler - # so we don't use it here. - SHLIB_VERSION_ARG="-Wl,\$(builddir)/libsndfile-1.def" - win32_target_dll=1 - if test x"$enable_shared" = xno ; then - win32_target_dll=0 - fi - ;; - os2*) - SHLIB_VERSION_ARG="-Wl,-export-symbols \$(builddir)/Symbols.os2" - ;; - *) - ;; - esac - if test x$enable_gcc_pipe != "xno" ; then - CFLAGS="$CFLAGS -pipe" - fi - - COMPILER_IS_GCC=1 - fi - -if test x$enable_werror = "xyes" ; then - MN_ADD_CFLAGS([-Werror]) - - AC_LANG_PUSH([C++]) - MN_ADD_CXXFLAGS([-Werror]) - AC_LANG_POP([C++]) - fi - - -AC_DEFINE_UNQUOTED([WIN32_TARGET_DLL], ${win32_target_dll}, [Set to 1 if windows DLL is being built.]) -AC_DEFINE_UNQUOTED([COMPILER_IS_GCC], ${COMPILER_IS_GCC}, [Set to 1 if the compile is GNU GCC.]) - -CFLAGS="$CFLAGS $OS_SPECIFIC_CFLAGS" - -if test x"$CFLAGS" = x ; then - echo "Error in configure script. CFLAGS has been screwed up." - exit - fi - -HOST_TRIPLET="${host_cpu}-${host_vendor}-${host_os}" - -AC_DEFINE_UNQUOTED([HOST_TRIPLET], "${HOST_TRIPLET}", [The host triplet of the compiled binary.]) - -if test "$HOST_TRIPLET" = "x86_64-w64-mingw32" ; then - OS_SPECIFIC_LINKS=" -static-libgcc $OS_SPECIFIC_LINKS" - fi - -WIN_RC_VERSION=`echo $PACKAGE_VERSION | $SED -e "s/p.*//" -e "s/\./,/g"` - - -if test "$enable_static" = no ; then - SRC_BINDIR=src/.libs/ - TEST_BINDIR=tests/.libs/ -else - SRC_BINDIR=src/ - TEST_BINDIR=tests/ - fi - -#------------------------------------------------------------------------------- - -AC_SUBST(HOST_TRIPLET) - -AC_SUBST(HTML_BGCOLOUR) -AC_SUBST(HTML_FGCOLOUR) - -AC_SUBST(SHLIB_VERSION_ARG) -AC_SUBST(SHARED_VERSION_INFO) -AC_SUBST(CLEAN_VERSION) -AC_SUBST(WIN_RC_VERSION) - -AC_SUBST(OS_SPECIFIC_CFLAGS) -AC_SUBST(OS_SPECIFIC_LINKS) -AC_SUBST(ALSA_LIBS) -AC_SUBST(SNDIO_LIBS) - -AC_SUBST(EXTERNAL_CFLAGS) -AC_SUBST(EXTERNAL_LIBS) -AC_SUBST(SRC_BINDIR) -AC_SUBST(TEST_BINDIR) - -dnl The following line causes the libtool distributed with the source -dnl to be replaced if the build system has a more recent version. -AC_SUBST(LIBTOOL_DEPS) - -AC_CONFIG_FILES([ \ - src/Makefile man/Makefile examples/Makefile tests/Makefile regtest/Makefile \ - M4/Makefile Win32/Makefile Octave/Makefile programs/Makefile \ - Makefile \ - src/version-metadata.rc tests/test_wrapper.sh tests/pedantic-header-test.sh \ - doc/libsndfile.css Scripts/build-test-tarball.mk libsndfile.spec sndfile.pc \ - src/sndfile.h \ - echo-install-dirs - ]) -AC_OUTPUT - -# Make sure these are executable. -chmod u+x tests/test_wrapper.sh build-test-tarball.mk echo-install-dirs - -#==================================================================================== - -AC_MSG_RESULT([ --=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=- - - Configuration summary : - - libsndfile version : .................. ${VERSION} - - Host CPU : ............................ ${host_cpu} - Host Vendor : ......................... ${host_vendor} - Host OS : ............................. ${host_os} - - Experimental code : ................... ${enable_experimental:-no} - Using ALSA in example programs : ...... ${enable_alsa:-no} - External FLAC/Ogg/Vorbis : ............ ${enable_external_libs:-no} -]) - -if test -z "$PKG_CONFIG" ; then - echo " *****************************************************************" - echo " *** The pkg-config program is missing. ***" - echo " *** External FLAC/Ogg/Vorbis libs cannot be found without it. ***" - echo " *** http://pkg-config.freedesktop.org/wiki/ ***" - echo " *****************************************************************" - echo - fi - -echo " Tools :" -echo -echo " Compiler is Clang : ................... ${mn_cv_c_compiler_clang}" -echo " Compiler is GCC : ..................... ${ac_cv_c_compiler_gnu}" - -if test x$ac_cv_c_compiler_gnu = xyes ; then - echo " GCC version : ......................... ${GCC_VERSION}" - if test $GCC_MAJOR_VERSION -lt 3 ; then - echo "\n" - echo " ** This compiler version allows applications to write" - echo " ** to static strings within the library." - echo " ** Compile with GCC version 3.X or above to avoid this problem." - fi - fi - -./echo-install-dirs - -# Remove symlink created by Scripts/android-configure.sh. -test -h gdbclient && rm -f gdbclient - -(cd src && make genfiles) diff --git a/libs/libsndfile/configure.gnu b/libs/libsndfile/configure.gnu deleted file mode 100644 index 80e107f2be..0000000000 --- a/libs/libsndfile/configure.gnu +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -srcpath=$(dirname $0 2>/dev/null ) || srcpath="." -$srcpath/configure "$@" --disable-sqlite --disable-shared --with-pic --disable-octave --disable-external-libs - diff --git a/libs/libsndfile/doc/FAQ.html b/libs/libsndfile/doc/FAQ.html deleted file mode 100644 index 4465b77bd5..0000000000 --- a/libs/libsndfile/doc/FAQ.html +++ /dev/null @@ -1,851 +0,0 @@ - - - - - - libsndfile : Frequently Asked Questions. - - - - - - - - - - -

libsndfile : Frequently Asked Questions.

-

-Q1 : Do you plan to support XYZ codec in libsndfile?
-Q2 : In version 0 the SF_INFO struct had a pcmbitwidth field - but version 1 does not. Why?
-Q3 : Compiling is really slow on MacOS X. Why?
-Q4 : When trying to compile libsndfile on Solaris I get a "bad - substitution" error during linking. What can I do to fix this?
-Q5 : Why doesn't libsndfile do interleaving/de-interleaving?
-Q6 : What's the best format for storing temporary files?
-Q7 : On Linux/Unix/MacOS X, what's the best way of detecting the - presence of libsndfile?
-Q8 : I have libsndfile installed and now I want to use it. I - just want a simple Makefile! What do I do?
-Q9 : How about adding the ability to write/read sound files to/from - memory buffers?
-Q10 : Reading a 16 bit PCM file as normalised floats and then - writing them back changes some sample values. Why?
-Q11 : I'm having problems with u-law encoded WAV files generated by - libsndfile in Winamp. Why?
-Q12 : I'm looking at sf_read*. What are items? What are frames?
-Q13 : Why can't libsndfile open this Sound Designer II (SD2) - file?
-Q14 : I'd like to statically link libsndfile to my closed source - application. Can I buy a license so that this is possible?
-Q15 : My program is crashing during a call to a function in libsndfile. - Is this a bug in libsndfile?
-Q16 : Will you accept a fix for compiling libsndfile with compiler X? -
-Q17 : Can libsndfile read/write files from/to UNIX pipes? -
-Q18 : Is it possible to build a Universal Binary on Mac OS X? -
-Q19 : I have project files for Visual Studio / XCode / Whatever. Why - don't you distribute them with libsndfile? -
-Q20 : Why doesn't libsndfile support MP3? Lots of other Open Source - projects support it! -
-Q21 : How do I use libsndfile in a closed source or commercial program - and comply with the license? -
-Q22 : What versions of windows does libsndfile work on? -
-Q23 : I'm cross compiling libsndfile for another platform. How can I - run the test suite? -
-


- - - -


Q1 : Do you plan to support XYZ codec in libsndfile?

-

-If source code for XYZ codec is available under a suitable license (LGPL, BSD, -MIT etc) then yes, I'd like to add it. -

-

-If suitable documentation is available on how to decode and encode the format -then maybe, depending on how much work is involved. -

-

-If XYZ is some proprietary codec where no source code or documentation is -available then no. -

-

-So if you want support for XYZ codec, first find existing source code or -documentation. -If you can't find either then the answer is no. -

- - -


Q2 : In version 0 the SF_INFO struct had a pcmbitwidth field - but version 1 does not. Why?

-

- This was dropped for a number of reasons: -

-
    -
  • pcmbitwidth makes little sense on compressed or floating point formats -
  • with the new API you really don't need to know it -
-

-As documented - here -there is now a well defined behaviour which ensures that no matter what the -bit width of the source file, the scaling always does something sensible. -This makes it safe to read 8, 16, 24 and 32 bit PCM files using sf_read_short() -and always have the optimal behaviour. -

- - - -


Q3 : Compiling is really slow on MacOS X. Why?

-

-When you configure and compile libsndfile, it uses the /bin/sh shell for a number -of tasks (ie configure script and libtool). -Older versions of OS X (10.2?) shipped a really crappy Bourne shell as /bin/sh -which resulted in really slow compiles. -Newer version of OS X ship GNU Bash as /bin/sh and this answer doesn't apply in that -case. -

-

-To fix this I suggest that you install the GNU Bash shell, rename /bin/sh to -/bin/sh.old and make a symlink from /bin/sh to the bash shell. -Bash is designed to behave as a Bourne shell when is is called as /bin/sh. -

-

-When I did this on my iBook running MacOS X, compile times dropped from 13 minutes -to 3 minutes. -

- - - -


Q4 : When trying to compile libsndfile on Solaris I get a "bad - substitution" error on linking. Why?

-

-It seems that the Solaris Bourne shell disagrees with GNU libtool. -

-

-To fix this I suggest that you install the GNU Bash shell, rename /bin/sh to -/bin/sh.old and make a symlink from /bin/sh to the bash shell. -Bash is designed to behave as a Bourne shell when is is called as /bin/sh. -

- - - -


Q5 : Why doesn't libsndfile do interleaving/de-interleaving?

-

-This problem is bigger than it may seem at first. -

-

-For a stereo file, it is a pretty safe bet that a simple interleaving/de-interleaving -could satisfy most users. -However, for files with more than 2 channels this is unlikely to be the case. -If the user has a 4 channel file and want to play that file on a stereo output -sound card they either want the first 2 channels or they want some mixed combination -of the 4 channels. -

-

-When you add more channels, the combinations grow exponentially and it becomes -increasingly difficult to cover even a sensible subset of the possible combinations. -On top of that, coding any one style of interleaver/de-interleaver is trivial, while -coding one that can cover all combinations is far from trivial. -This means that this feature will not be added any time soon. -

- - - -


Q6 : What's the best format for storing temporary files?

- -

-When you want to store temporary data there are a number of requirements; -

-
    -
  • A simple, easy to parse header. -
  • The format must provide the fastest possible read and write rates (ie - avoid conversions and encoding/decoding). -
  • The file format must be reasonably common and playable by most players. -
  • Able to store data in either endian-ness. -
-

-The format which best meets these requirements is AU, which allows data to be -stored in any one of short, int, float and double (among others) formats. -

-

-For instance, if an application uses float data internally, its temporary files -should use a format of (SF_ENDIAN_CPU | SF_FORMAT_AU | SF_FORMAT_FLOAT) which -will store big endian float data in big endian CPUs and little endian float data -on little endian CPUs. -Reading and writing this format will not require any conversions or byte swapping -regardless of the host CPU. -

- - - - -


Q7 : On Linux/Unix/MaxOS X, what's the best way of detecting the presence - of libsndfile using autoconf?

- -

-libsndfile uses the pkg-config (man pkg-config) method of registering itself with the -host system. -The best way of detecting its presence is using something like this in configure.ac -(or configure.in): -

-
-        PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.2, ac_cv_sndfile=1, ac_cv_sndfile=0)
-
-        AC_DEFINE_UNQUOTED([HAVE_SNDFILE],${ac_cv_sndfile},
-			[Set to 1 if you have libsndfile.])
-
-        AC_SUBST(SNDFILE_CFLAGS)
-        AC_SUBST(SNDFILE_LIBS)
-
-

-This will automatically set the SNDFILE_CFLAGS and SNDFILE_LIBS -variables which can be used in Makefile.am like this: -

-
-        SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
-        SNDFILE_LIBS = @SNDFILE_LIBS@
-
-

-If you install libsndfile from source, you will probably need to set the -PKG_CONFIG_PATH environment variable as suggested at the end of the -libsndfile configure process. For instance on my system I get this: -

-
-        -=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-
-
-          Configuration summary :
-
-            Version : ..................... 1.0.5
-            Experimental code : ........... no
-
-          Tools :
-
-            Compiler is GCC : ............. yes
-            GCC major version : ........... 3
-
-          Installation directories :
-
-            Library directory : ........... /usr/local/lib
-            Program directory : ........... /usr/local/bin
-            Pkgconfig directory : ......... /usr/local/lib/pkgconfig
-
-        Compiling some other packages against libsndfile may require
-        the addition of "/usr/local/lib/pkgconfig" to the
-        PKG_CONFIG_PATH environment variable.
-
- - - - -


Q8 : I have libsndfile installed and now I want to use it. I just want - a simple Makefile! What do I do?

- -

-The pkg-config program makes finding the correct compiler flag values and -library location far easier. -During the installation of libsndfile, a file named sndfile.pc is installed -in the directory ${libdir}/pkgconfig (ie if libsndfile is installed in -/usr/local/lib, sndfile.pc will be installed in -/usr/local/lib/pkgconfig/). -

-

-In order for pkg-config to find sndfile.pc it may be necessary to point the -environment variable PKG_CONFIG_PATH in the right direction. -

-
-        export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
-
- -

-Then, to compile a C file into an object file, the command would be: -

-
-        gcc `pkg-config --cflags sndfile` -c somefile.c
-
-

-and to link a number of objects into an executable that links against libsndfile, -the command would be: -

-
-        gcc `pkg-config --libs sndfile` obj1.o obj2.o -o program
-
- - - - -


Q9 : How about adding the ability to write/read sound files to/from - memory buffers?

- -

-This has been added for version 1.0.13. -

- - - - -


Q10 : Reading a 16 bit PCM file as normalised floats and then - writing them back changes some sample values. Why?

- -

-This is caused by the fact that the conversion from 16 bit short to float is -done by dividing by 32768 (0x8000 in hexadecimal) while the conversion from -float to 16 bit short is done by multiplying by 32767 (0x7FFF in hex). -So for instance, a value in a 16 bit PCM file of 20000 gets read as a floating -point number of 0.6103515625 (20000.0 / 0x8000). -Converting that back to a 16 bit short results in a value of 19999.3896484375 -(0.6103515625 * 0x7FFF) which then gets rounded down to 19999. -

-

-You will notice that for this particular case, the error is 1 in 20000 or -0.005%. -Interestingly, for values of less than 16369, dividing by 0x8000 followed -by multiplying by 0x7FFF and then rounding the result, gives back the -original value. -It turns out that as long as the host operating system supplies the 1999 ISO -C Standard functions lrintf and lrint (or a replacement has -been supplied) then the maximum possible error is 1 in 16369 or about 0.006%. -

-

-Regardless of the size of the error, the reason why this is done is rather -subtle. -

-

-In a file containing 16 bit PCM samples, the values are restricted to the range -[-32768, 32767] while we want floating point values in the range [-1.0, 1.0]. -The only way to do this conversion is to do a floating point division by a value -of 0x8000. -Converting the other way, the only way to ensure that floating point values in -the range [-1.0, 1.0] are within the valid range allowed by a 16 bit short is -to multiply by 0x7FFF. -

-

-Some people would say that this is a severe short-coming of libsndfile. -I would counter that anybody who is constantly converting back and forth -between 16 bit shorts and normalised floats is going to suffer other losses -in audio quality that they should also be concerned about. -

-

-Since this problem only occurs when converting between integer data on disk and -normalized floats in the application, it can be avoided by using something -other than normalized floats in the application. -Alternatives to normalized floats are the short and int data -types (ie using sf_read_short or sf_read_int) or using un-normalized floats -(see - - SFC_SET_NORM_FLOAT). -

-

-Another way to deal with this problem is to consider 16 bit short data as a -final destination format only, not as an intermediate storage format. -All intermediate data (ie which is going to be processed further) should be -stored in floating point format which is supported by all of the most common -file formats. -If floating point files are considered too large (2 times the size of a 16 bit -PCM file), it would also be possible to use 24 bit PCM as an intermediate -storage format (and which is also supported by most common file types). -

- - - - -


Q11 : I'm having problems with u-law encoded WAV files generated by - libsndfile in Winamp. Why? -

- -

-This is actually a Winamp problem. -The official Microsoft spec suggests that the 'fmt ' chunk should be 18 bytes. -Unfortunately at least one of Microsoft's own applications (Sound Recorder on -Win98 I believe) did not accept 18 bytes 'fmt ' chunks. -

-

-Michael Lee did some experimenting and found that: -

-
-    I have checked that Windows Media Player 9, QuickTime Player 6.4,
-    RealOne Player 2.0 and GoldWave 5.06 can all play u-law files with
-    16-byte or 18-byte 'fmt ' chunk. Only Winamp (2.91) and foobar2000
-    are unable to play u-law files with 16-byte 'fmt ' chunk.
-
- -

-Even this is a very small sampling of all the players out there. -For that reason it is probably not a good idea to change this now because there -is the risk of breaking something that currently works. -

- - - - -


Q12 : I'm looking at sf_read*. What are items? What are frames? -

- -

-An item is a single sample of the data type you are reading; ie a -single short value for sf_read_short or a single float -for sf_read_float. -

- -

-For a sound file with only one channel, a frame is the same as a item (ie a -single sample) while for multi channel sound files, a single frame contains a -single item for each channel. -

- -

-Here are two simple, correct examples, both of which are assumed to be working -on a stereo file, first using items: -

- -
-        #define CHANNELS 2
-        short data [CHANNELS * 100] ;
-        sf_count items_read = sf_read_short (file, data, 200) ;
-        assert (items_read == 200) ;
-
- -

-and now readng the exact same amount of data using frames: -

- -
-        #define CHANNELS 2
-        short data [CHANNELS * 100] ;
-        sf_count frames_read = sf_readf_short (file, data, 100) ;
-        assert (frames_read == 100) ;
-
- - - - -


Q13 : Why can't libsndfile open this Sound Designer II (SD2) file? -

- -

-This is somewhat complicated. -First some background. -

- -

-SD2 files are native to the Apple Macintosh platform and use features of -the Mac filesystem (file resource forks) to store the file's sample rate, -number of channels, sample width and more. -When you look at a file and its resource fork on Mac OS X it looks like -this: -

- -
-        -rw-r--r--  1 erikd erikd   46512 Oct 18 22:57 file.sd2
-        -rw-r--r--  1 erikd erikd     538 Oct 18 22:57 file.sd2/rsrc
-
- -

-Notice how the file itself looks like a directory containing a single file -named rsrc. -When libsndfile is compiled for MacOS X, it should open (for write and read) -SD2 file with resource forks like this without any problems. -It will also handle files with the resource fork in a separate file as -described below. -

- -

-When SD2 files are moved to other platforms, the resource fork of the file -can sometimes be dropped altogether. -All that remains is the raw audio data and no information about the number -of channels, sample rate or bit width which makes it a little difficult for -libsndfile to open the file. -

- -

-However, it is possible to safely move an SD2 file to a Linux or Windows -machine. -For instance, when an SD2 file is copied from inside MacOS X to a windows -shared directory or a Samba share (ie Linux), MacOS X is clever enough to -store the resource fork of the file in a separate hidden file in the -same directory like this: -

-
-        -rw-r--r--  1 erikd erikd     538 Oct 18 22:57 ._file.sd2
-        -rw-r--r--  1 erikd erikd   46512 Oct 18 22:57 file.sd2
-
- -

-Regardless of what platform it is running on, when libsndfile is asked to -open a file named "foo" and it can't recognize the file type from -the data in the file, it will attempt to open the resource fork and if -that fails, it then tries to open a file named "._foo" to see if -the file has a valid resource fork. -This is the same regardless of whether the file is being opened for read -or write. -

- -

-In short, libsndfile should open SD2 files with a valid resource fork on -all of the platforms that libsndfile supports. -If a file has lost its resource fork, the only option is the open the file -using the SF_FORMAT_RAW option and guessing its sample rate, channel count -and bit width. -

- -

-Occasionally, when SD2 files are moved to other systems, the file is - BinHexed -which wraps the resource fork and the data fork together. -For these files, it would be possible to write a BinHex parser but -there is not a lot to gain considering how rare these BinHexed SD2 -files are. -

- - - -


Q14 : I'd like to statically link libsndfile to my closed source - application. Can I buy a license so that this is possible? -

- -

-Unfortunately no. -libsndfile contains code written by other people who have agreed that their -code be used under the GNU LGPL but no more. -Even if they were to agree, there would be significant difficulties in -dividing up the payments fairly. -

- -

-The only way you can legally use libsndfile as a statically linked -library is if your application is released under the GNU GPL or LGPL. -

- - - -


Q15 : My program is crashing during a call to a function in libsndfile. - Is this a bug in libsndfile? -

- -

-libsndfile is being used by large numbers of people all over the world -without any problems like this. That means that it is much more likely -that your code has a bug than libsndfile. However, it is still possible -that there is a bug in libsndfile. -

-

-To figure out whether it is your code or libsndfile you should do the -following: -

-
    -
  • Make sure you are compiling your code with warnings switched on and - that you fix as many warnings as possible. - With the GNU compiler (gcc) I would recommend at least - -W -Wall -Werror which will force you to fix all warnings - before you can run the code. -
  • Try using a memory debugger. - Valgrind on x86 Linux is excellent. - Purify also - has a good reputation. -
  • If the code is clean after the above two steps and you still get - a crash in libsndfile, then send me a small snippet of code (no - more than 30-40 lines) which includes the call to sf_open() and - also shows how all variables passed to/returned from sf_open() - are defined. -
- - - -


Q16 : Will you accept a fix for compiling libsndfile with compiler X? -

- -

-If compiler X is a C++ compiler then no. -C and C++ are different enough to make writing code that compiles as valid C -and valid C++ too difficult. -I would rather spend my time fixing bugs and adding features. -

- -

-If compiler X is a C compiler then I will do what I can as long as that does -not hamper the correctness, portability and maintainability of the existing -code. -It should be noted however that libsndfile uses features specified by the 1999 -ISO C Standard. -This can make compiling libsndfile with some older compilers difficult. -

- - - -


Q17 : Can libsndfile read/write files from/to UNIX pipes? -

- -

-Yes, libsndfile can read files from pipes. -Unfortunately, the write case is much more complicated. -

- -

-File formats like AIFF and WAV have information at the start of the file (the -file header) which states the length of the file, the number of sample frames -etc. -This information must be filled in correctly when the file header is written, -but this information is not reliably known until the file is closed. -This means that libsndfile cannot write AIFF, WAV and many other file types -to a pipe. -

- -

-However, there is at least one file format (AU) which is specifically designed -to be written to a pipe. -Like AIFF and WAV, AU has a header with a sample frames field, but it is -specifically allowable to set that frames field to 0x7FFFFFFF if the file -length is not known when the header is written. -The AU file format can also hold data in many of the standard formats (ie -SF_FORMAT_PCM_16, SF_FORMAT_PCM_24, SF_FORMAT_FLOAT etc) as well as allowing -data in both big and little endian format. -

- -

-See also FAQ Q6. -

- - - -


Q18 : Is it possible to build a Universal Binary on Mac OS X? -

- -

-Yes, but you must do two separate configure/build/test runs; one on PowerPC -and one on Intel. -It is then possible to merge the binaries into a single universal binary using -one of the programs in the Apple tool chain. -

- -

-It is not possible to build a working universal binary via a single -compile/build run on a single CPU. -

- -

-The problem is that the libsndfile build process detects features of the CPU its -being built for during the configure process and when building a universal binary, -configure is only run once and that data is then used for both CPUs. -That configure data will be wrong for one of those CPUs. -You will still be able to compile libsndfile, and the test suite will pass on -the machine you compiled it on. -However, if you take the universal binary test suite programs compiled on one -CPU and run them on the other, the test suite will fail. -

- -

-Part of the problem is the the CPU endian-ness is detected at configure time. -Yes, I know the Apple compiler defines one of the macros __LITTLE_ENDIAN__ -and __BIG_ENDIAN__, but those macros are not part of the 1999 ISO C Standard -and they are not portable. -

- -

-Endian issues are not the only reason why the cross compiled binary will fail. -The configure script also detects other CPU specific idiosyncrasies to provide -more optimized code. -

- -

-Finally, the real show stopper problem with universal binaries is the problem -with the test suite. -libsndfile contains a huge, comprehensive test suite. -When you compile a universal binary and run the test suite, you only test the -native compile. -The cross compiled binary (the one with the much higher chance of having -problems) cannot be tested. -

- -

-Now, if you have read this far you're probably thinking there must be a way -to fix this and there probably is. -The problem is that its a hell of a lot of work and would require significant -changes to the configure process, the internal code and the test suite. -In addition, these changes must not break compilation on any of the platforms -libsndfile is currently working on. -

- - - - -


Q19 : I have project files for Visual Studio / XCode / Whatever. Why - don't you distribute them with libsndfile? -

- -

-There's a very good reason for this. -I will only distribute things that I actually have an ability to test and -maintain. -Project files for a bunch of different compilers and Integrated Development -Environments are simply too difficult to maintain. -

- -

-The problem is that every time I add a new file to libsndfile or rename an -existing file I would have to modify all the project files and then test that -libsndfile still built with all the different compilers. -

- -

-Maintaining these project files is also rather difficult if I don't have access -to the required compiler/IDE. -If I just edit the project files without testing them I will almost certainly -get it wrong. -If I release a version of libsndfile with broken project files, I'll get a bunch -of emails from people complaining about it not building and have no way of -fixing or even testing it. -

- -

-I currently release sources that I personally test on Win32, Linux and -MacOS X (PowerPC) using the compiler I trust (GNU GCC). -Supporting one compiler on three (actually much more because GCC is available -almost everywhere) platforms is doable without too much pain. -I also release binaries for Win32 with instructions on how to use those -binaries with Visual Studio. -As a guy who is mainly interested in Linux, I'm not to keen to jump through -a bunch of hoops to support compilers and operating systems I don't use. -

- -

-So, I hear you want to volunteer to maintain the project files for Some Crappy -Compiler 2007? -Well sorry, that won't work either. -I have had numerous people over the years offer to maintaining the project -files for Microsoft's Visual Studio. -Every single time that happened, they maintained it for a release or two and -then disappeared off the face of the earth. -Hence, I'm not willing to enter into an arrangement like that again. -

- - - -


Q20 : Why doesn't libsndfile support MP3? Lots of other Open Source - projects support it! -

- -

-MP3 is not supported for one very good reason; doing so requires the payment -of licensing fees. -As can be seen from - - mp3licensing.com -the required royalty payments are not cheap. -

- -

-Yes, I know other libraries ignore the licensing requirements, but their legal -status is extremely dubious. -At any time, the body selling the licenses could go after the authors of those -libraries. -Some of those authors may be students and hence wouldn't be worth pursuing. -

- -

-However, libsndfile is released under the name of a company, Mega Nerd Pty Ltd; -a company which has income from from libsamplerate licensing, libsndfile based -consulting income and other unrelated consulting income. -Adding MP3 support to libsndfile could place that income under legal threat. -

- -

-Fortunately, Ogg Vorbis exists as an alternative to MP3. -Support for Ogg Vorbis was added to libsndfile (mostly due to the efforts of -John ffitch of the Csound project) in version 1.0.18. -

- - - - -


Q21 : How do I use libsndfile in a closed source or commercial program - and comply with the license? -

- -

-Here is a checklist of things you need to do to make sure your use of libsndfile -in a closed source or commercial project complies with the license libsndfile is -released under, the GNU Lesser General Public License (LGPL): -

- -
    -
  • Make sure you are linking to libsndfile as a shared library (Linux and Unix - systems), Dynamic Link Library (Microsoft Windows) or dynlib (Mac OS X). - If you are using some other operating system that doesn't allow dynamically - linked libraries, you will not be able to use libsndfile unless you release - the source code to your program. -
  • In the licensing documentation for your program, add a statement that your - software depends on libsndfile and that libsndfile is released under the GNU - Lesser General Public License, either - version 2.1 - or optionally - version 3. -
  • Include the text for both versions of the license, possibly as separate - files named libsndfile_lgpl_v2_1.txt and libsndfile_lgpl_v3.txt. -
- - - -


Q22 : What versions of Windows does libsndfile work on? -

- -

-Currently the precompiled windows binaries are thoroughly tested on Windows XP. -As such, they should also work on Win2k and Windows Vista. -They may also work on earlier versions of Windows. -

- -

-Since version 0.1.18 I have also been releasing precompiled binaries for Win64, -the 64 bit version of Windows. -These binaries have received much less testing than the 32 bit versions, but -should work as expected. -I'd be very interested in receiving feedback on these binaries. -

- - - -


Q23 : I'm cross compiling libsndfile for another platform. How can I - run the test suite? -

- -

-

- -

-Since version 1.0.21 the top level Makefile has an extra make target, -'test-tarball'. -Building this target creates a tarball called called: -

- -
-libsndfile-testsuite-${host_triplet}-${version}.tar.gz -
- -

-in the top level directory. -This tarball can then be copied to the target platform. -Once untarred and test script test_wrapper.sh can be run from -the top level of the extracted tarball. -

- - -
-

- The libsndfile home page is here : - - http://www.mega-nerd.com/libsndfile/. -
-Version : 1.0.25 -

- - - diff --git a/libs/libsndfile/doc/Makefile.am b/libs/libsndfile/doc/Makefile.am deleted file mode 100644 index b89f1454aa..0000000000 --- a/libs/libsndfile/doc/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -## Process this file with automake to produce Makefile.in - -html_DATA = index.html libsndfile.jpg libsndfile.css api.html command.html \ - bugs.html sndfile_info.html new_file_type.HOWTO \ - win32.html FAQ.html lists.html embedded_files.html octave.html \ - dither.html tutorial.html - -EXTRA_DIST = $(html_DATA) - diff --git a/libs/libsndfile/doc/api.html b/libs/libsndfile/doc/api.html deleted file mode 100644 index 33d53dd02f..0000000000 --- a/libs/libsndfile/doc/api.html +++ /dev/null @@ -1,781 +0,0 @@ - - - - - - The libsndfile API - - - - - - - - - - -
-

libsndfile

-

- Libsndfile is a library designed to allow the reading and writing of many - different sampled sound file formats (such as MS Windows WAV and the Apple/SGI - AIFF format) through one standard library interface. -

- -

- During read and write operations, formats are seamlessly converted between the - format the application program has requested or supplied and the file's data - format. The application programmer can remain blissfully unaware of issues - such as file endian-ness and data format. See Note 1 and - Note 2. -

- -

- Every effort is made to keep these documents up-to-date, error free and - unambiguous. - However, since maintaining the documentation is the least fun part of working - on libsndfile, these docs can and do fall behind the behaviour of library. - If any errors, omissions or ambiguities are found, please notify me (erikd) - at mega-nerd dot com. -

- -

- To supplement this reference documentation, there are simple example programs - included in the source code tarball. - The test suite which is also part of the source code tarball is also a good - place to look for the correct usage of the library functions. -

- -

- Finally, if you think there is some feature missing from libsndfile, check that - it isn't already implemented (and documented) - here. - -

- -

Synopsis

-

-The functions of libsndfile are defined as follows: -

- -
-      #include <stdio.h>
-      #include <sndfile.h>
-
-      SNDFILE*    sf_open          (const char *path, int mode, SF_INFO *sfinfo) ;
-      SNDFILE*    sf_open_fd       (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
-      SNDFILE* 	  sf_open_virtual  (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ;
-      int         sf_format_check  (const SF_INFO *info) ;
-
-      sf_count_t  sf_seek          (SNDFILE *sndfile, sf_count_t frames, int whence) ;
-
-      int         sf_command       (SNDFILE *sndfile, int cmd, void *data, int datasize) ;
-
-      int         sf_error         (SNDFILE *sndfile) ;
-      const char* sf_strerror      (SNDFILE *sndfile) ;
-      const char* sf_error_number  (int errnum) ;
-
-      int         sf_perror        (SNDFILE *sndfile) ;
-      int         sf_error_str     (SNDFILE *sndfile, char* str, size_t len) ;
-
-      int         sf_close         (SNDFILE *sndfile) ;
-      void        sf_write_sync    (SNDFILE *sndfile) ;
-
-      sf_count_t  sf_read_short    (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_int      (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_float    (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_double   (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
-
-      sf_count_t  sf_readf_short   (SNDFILE *sndfile, short *ptr, sf_count_t frames) ;
-      sf_count_t  sf_readf_int     (SNDFILE *sndfile, int *ptr, sf_count_t frames) ;
-      sf_count_t  sf_readf_float   (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
-      sf_count_t  sf_readf_double  (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
-
-      sf_count_t  sf_write_short   (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_int     (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_float   (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_double  (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
-
-      sf_count_t  sf_writef_short  (SNDFILE *sndfile, short *ptr, sf_count_t frames) ;
-      sf_count_t  sf_writef_int    (SNDFILE *sndfile, int *ptr, sf_count_t frames) ;
-      sf_count_t  sf_writef_float  (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
-      sf_count_t  sf_writef_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
-
-      sf_count_t  sf_read_raw      (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
-      sf_count_t  sf_write_raw     (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
-
-      const char* sf_get_string    (SNDFILE *sndfile, int str_type) ;
-      int         sf_set_string    (SNDFILE *sndfile, int str_type, const char* str) ;
-
-
- -

-SNDFILE* is an anonymous pointer to data which is private to the library. -

- - - -

File Open Function

- -
-      SNDFILE*  sf_open    (const char *path, int mode, SF_INFO *sfinfo) ;
-
- -

-The SF_INFO structure is for passing data between the calling function and the library -when opening a file for reading or writing. It is defined in sndfile.h as follows: -

- -
-      typedef struct
-      {    sf_count_t  frames ;     /* Used to be called samples. */
-           int         samplerate ;
-           int         channels ;
-           int         format ;
-           int         sections ;
-           int         seekable ;
-       } SF_INFO ;
-
- -

-The mode parameter for this function can be any one of the following three values: -

- -
-      SFM_READ    - read only mode
-      SFM_WRITE   - write only mode
-      SFM_RDWR    - read/write mode
-
- -

-When opening a file for read, the format field should be set to zero before -calling sf_open(). -The only exception to this is the case of RAW files where the caller has to set -the samplerate, channels and format fields to valid values. -All other fields of the structure are filled in by the library. -

- -

-When opening a file for write, the caller must fill in structure members samplerate, -channels, and format. -

- -

-The format field in the above SF_INFO structure is made up of the bit-wise OR of a -major format type (values between 0x10000 and 0x08000000), a minor format type -(with values less than 0x10000) and an optional endian-ness value. -The currently understood formats are listed in sndfile.h as follows and also include -bitmasks for separating major and minor file types. -Not all combinations of endian-ness and major and minor file types are valid. -

- -
-      enum
-      {   /* Major formats. */
-          SF_FORMAT_WAV          = 0x010000,     /* Microsoft WAV format (little endian). */
-          SF_FORMAT_AIFF         = 0x020000,     /* Apple/SGI AIFF format (big endian). */
-          SF_FORMAT_AU           = 0x030000,     /* Sun/NeXT AU format (big endian). */
-          SF_FORMAT_RAW          = 0x040000,     /* RAW PCM data. */
-          SF_FORMAT_PAF          = 0x050000,     /* Ensoniq PARIS file format. */
-          SF_FORMAT_SVX          = 0x060000,     /* Amiga IFF / SVX8 / SV16 format. */
-          SF_FORMAT_NIST         = 0x070000,     /* Sphere NIST format. */
-          SF_FORMAT_VOC          = 0x080000,     /* VOC files. */
-          SF_FORMAT_IRCAM        = 0x0A0000,     /* Berkeley/IRCAM/CARL */
-          SF_FORMAT_W64          = 0x0B0000,     /* Sonic Foundry's 64 bit RIFF/WAV */
-          SF_FORMAT_MAT4         = 0x0C0000,     /* Matlab (tm) V4.2 / GNU Octave 2.0 */
-          SF_FORMAT_MAT5         = 0x0D0000,     /* Matlab (tm) V5.0 / GNU Octave 2.1 */
-          SF_FORMAT_PVF          = 0x0E0000,     /* Portable Voice Format */
-          SF_FORMAT_XI           = 0x0F0000,     /* Fasttracker 2 Extended Instrument */
-          SF_FORMAT_HTK          = 0x100000,     /* HMM Tool Kit format */
-          SF_FORMAT_SDS          = 0x110000,     /* Midi Sample Dump Standard */
-          SF_FORMAT_AVR          = 0x120000,     /* Audio Visual Research */
-          SF_FORMAT_WAVEX        = 0x130000,     /* MS WAVE with WAVEFORMATEX */
-          SF_FORMAT_SD2          = 0x160000,     /* Sound Designer 2 */
-          SF_FORMAT_FLAC         = 0x170000,     /* FLAC lossless file format */
-          SF_FORMAT_CAF          = 0x180000,     /* Core Audio File format */
-          SF_FORMAT_WVE          = 0x190000,     /* Psion WVE format */
-          SF_FORMAT_OGG          = 0x200000,     /* Xiph OGG container */
-          SF_FORMAT_MPC2K        = 0x210000,     /* Akai MPC 2000 sampler */
-          SF_FORMAT_RF64         = 0x220000,     /* RF64 WAV file */
-
-          /* Subtypes from here on. */
-
-          SF_FORMAT_PCM_S8       = 0x0001,       /* Signed 8 bit data */
-          SF_FORMAT_PCM_16       = 0x0002,       /* Signed 16 bit data */
-          SF_FORMAT_PCM_24       = 0x0003,       /* Signed 24 bit data */
-          SF_FORMAT_PCM_32       = 0x0004,       /* Signed 32 bit data */
-
-          SF_FORMAT_PCM_U8       = 0x0005,       /* Unsigned 8 bit data (WAV and RAW only) */
-
-          SF_FORMAT_FLOAT        = 0x0006,       /* 32 bit float data */
-          SF_FORMAT_DOUBLE       = 0x0007,       /* 64 bit float data */
-
-          SF_FORMAT_ULAW         = 0x0010,       /* U-Law encoded. */
-          SF_FORMAT_ALAW         = 0x0011,       /* A-Law encoded. */
-          SF_FORMAT_IMA_ADPCM    = 0x0012,       /* IMA ADPCM. */
-          SF_FORMAT_MS_ADPCM     = 0x0013,       /* Microsoft ADPCM. */
-
-          SF_FORMAT_GSM610       = 0x0020,       /* GSM 6.10 encoding. */
-          SF_FORMAT_VOX_ADPCM    = 0x0021,       /* Oki Dialogic ADPCM encoding. */
-
-          SF_FORMAT_G721_32      = 0x0030,       /* 32kbs G721 ADPCM encoding. */
-          SF_FORMAT_G723_24      = 0x0031,       /* 24kbs G723 ADPCM encoding. */
-          SF_FORMAT_G723_40      = 0x0032,       /* 40kbs G723 ADPCM encoding. */
-
-          SF_FORMAT_DWVW_12      = 0x0040,       /* 12 bit Delta Width Variable Word encoding. */
-          SF_FORMAT_DWVW_16      = 0x0041,       /* 16 bit Delta Width Variable Word encoding. */
-          SF_FORMAT_DWVW_24      = 0x0042,       /* 24 bit Delta Width Variable Word encoding. */
-          SF_FORMAT_DWVW_N       = 0x0043,       /* N bit Delta Width Variable Word encoding. */
-
-          SF_FORMAT_DPCM_8       = 0x0050,       /* 8 bit differential PCM (XI only) */
-          SF_FORMAT_DPCM_16      = 0x0051,       /* 16 bit differential PCM (XI only) */
-
-          SF_FORMAT_VORBIS       = 0x0060,       /* Xiph Vorbis encoding. */
-
-          /* Endian-ness options. */
-
-          SF_ENDIAN_FILE         = 0x00000000,   /* Default file endian-ness. */
-          SF_ENDIAN_LITTLE       = 0x10000000,   /* Force little endian-ness. */
-          SF_ENDIAN_BIG          = 0x20000000,   /* Force big endian-ness. */
-          SF_ENDIAN_CPU          = 0x30000000,   /* Force CPU endian-ness. */
-
-          SF_FORMAT_SUBMASK      = 0x0000FFFF,
-          SF_FORMAT_TYPEMASK     = 0x0FFF0000,
-          SF_FORMAT_ENDMASK      = 0x30000000
-      } ;
-
- -

-Every call to sf_open() should be matched with a call to sf_close() to free up -memory allocated during the call to sf_open(). -

- -

-On success, the sf_open function returns a non-NULL pointer which should be -passed as the first parameter to all subsequent libsndfile calls dealing with -that audio file. -On fail, the sf_open function returns a NULL pointer. -An explanation of the error can obtained by passing NULL to - sf_strerror. -

- - -

File Descriptor Open

- -
-      SNDFILE*  sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
-
- -

-Note: On Microsoft Windows, this function does not work if the -application and the libsndfile DLL are linked to different versions of the -Microsoft C runtime DLL. -

-

-The second open function takes a file descriptor of a file that has already been -opened. -Care should be taken to ensure that the mode of the file represented by the -descriptor matches the mode argument. -This function is useful in the following circumstances: -

- -
    -
  • Opening temporary files securely (ie use the tmpfile() to return a - FILE* pointer and then using fileno() to retrieve the file descriptor - which is then passed to libsndfile). -
  • Opening files with file names using OS specific character encodings - and then passing the file descriptor to sf_open_fd(). -
  • Opening sound files embedded within larger files. - More info. -
- -

-Every call to sf_open_fd() should be matched with a call to sf_close() to free up -memory allocated during the call to sf_open(). -

- -

-When sf_close() is called, the file descriptor is only closed if the close_desc -parameter was TRUE when the sf_open_fd() function was called. -

- -

-On success, the sf_open_fd function returns a non-NULL pointer which should be -passed as the first parameter to all subsequent libsndfile calls dealing with -that audio file. -On fail, the sf_open_fd function returns a NULL pointer. -

- - -

Virtual File Open Function

-
-      SNDFILE* 	sf_open_virtual	(SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ;
-
-

- Opens a soundfile from a virtual file I/O context which is provided - by the caller. This is usually used to interface libsndfile to a stream or buffer - based system. Apart from the sfvirtual and the user_data parameters this function behaves - like sf_open. -

- -
-      typedef struct
-      {    sf_vio_get_filelen  get_filelen ;
-           sf_vio_seek         seek ;
-           sf_vio_read         read ;
-           sf_vio_write        write ;
-           sf_vio_tell         tell ;
-      } SF_VIRTUAL_IO ;
-
-

-Libsndfile calls the callbacks provided by the SF_VIRTUAL_IO structure when opening, reading -and writing to the virtual file context. The user_data pointer is a user defined context which -will be available in the callbacks. -

-
-      typedef sf_count_t  (*sf_vio_get_filelen) (void *user_data) ;
-      typedef sf_count_t  (*sf_vio_seek)        (sf_count_t offset, int whence, void *user_data) ;
-      typedef sf_count_t  (*sf_vio_read)        (void *ptr, sf_count_t count, void *user_data) ;
-      typedef sf_count_t  (*sf_vio_write)       (const void *ptr, sf_count_t count, void *user_data) ;
-      typedef sf_count_t  (*sf_vio_tell)        (void *user_data) ;
-
-

sf_vio_get_filelen

-
-      typedef sf_count_t  (*sf_vio_get_filelen) (void *user_data) ;
-
-

-The virtual file contex must return the length of the virtual file in bytes.
-

-

sf_vio_seek

-
-      typedef sf_count_t  (*sf_vio_seek)        (sf_count_t offset, int whence, void *user_data) ;
-
-

-The virtual file context must seek to offset using the seek mode provided by whence which is one of
-

-
-      SEEK_CUR
-      SEEK_SET
-      SEEK_END
-
-

-The return value must contain the new offset in the file. -

-

sf_vio_read

-
-      typedef sf_count_t  (*sf_vio_read)        (void *ptr, sf_count_t count, void *user_data) ;
-
-

-The virtual file context must copy ("read") "count" bytes into the -buffer provided by ptr and return the count of actually copied bytes. -

-

sf_vio_write

-
-      typedef sf_count_t  (*sf_vio_write)       (const void *ptr, sf_count_t count, void *user_data) ;
-
-

-The virtual file context must process "count" bytes stored in the -buffer passed with ptr and return the count of actually processed bytes.
-

-

sf_vio_tell

-
-      typedef sf_count_t  (*sf_vio_tell)        (void *user_data) ;
-
-

-Return the current position of the virtual file context.
-

- - - -

Format Check Function

- -
-      int  sf_format_check (const SF_INFO *info) ;
-
- -

-This function allows the caller to check if a set of parameters in the SF_INFO struct -is valid before calling sf_open (SFM_WRITE). -

-

-sf_format_check returns TRUE if the parameters are valid and FALSE otherwise. -

- - -

File Seek Functions

- -
-      sf_count_t  sf_seek  (SNDFILE *sndfile, sf_count_t frames, int whence) ;
-
- -

-The file seek functions work much like lseek in unistd.h with the exception that -the non-audio data is ignored and the seek only moves within the audio data section of -the file. -In addition, seeks are defined in number of (multichannel) frames. -Therefore, a seek in a stereo file from the current position forward with an offset -of 1 would skip forward by one sample of both channels. -

- -

-like lseek(), the whence parameter can be any one of the following three values: -

- -
-      SEEK_SET  - The offset is set to the start of the audio data plus offset (multichannel) frames.
-      SEEK_CUR  - The offset is set to its current location plus offset (multichannel) frames.
-      SEEK_END  - The offset is set to the end of the data plus offset (multichannel) frames.
-
- -

-Internally, libsndfile keeps track of the read and write locations using separate -read and write pointers. -If a file has been opened with a mode of SFM_RDWR, bitwise OR-ing the standard whence -values above with either SFM_READ or SFM_WRITE allows the read and write pointers to -be modified separately. -If the SEEK_* values are used on their own, the read and write pointers are -both modified. -

- -

-Note that the frames offset can be negative and in fact should be when SEEK_END is used for the -whence parameter. -

-

-sf_seek will return the offset in (multichannel) frames from the start of the audio data -or -1 if an error occured (ie an attempt is made to seek beyond the start or end of the file). -

- - -


Error Reporting Functions

- - -
-      int         sf_error        (SNDFILE *sndfile) ;
-
-

-This function returns the current error number for the given SNDFILE. -The error number may be one of the following: -

-
-        enum
-        {   SF_ERR_NO_ERROR             = 0,
-            SF_ERR_UNRECOGNISED_FORMAT  = 1,
-            SF_ERR_SYSTEM               = 2,
-            SF_ERR_MALFORMED_FILE       = 3,
-            SF_ERR_UNSUPPORTED_ENCODING = 4
-        } ;
-
- -

-or any one of many other internal error values. -Applications should only test the return value against error values defined in -<sndfile.h> as the internal error values are subject to change at any -time. -For errors not in the above list, the function sf_error_number() can be used to -convert it to an error string. -

- -
-      const char* sf_strerror     (SNDFILE *sndfile) ;
-      const char* sf_error_number (int errnum) ;
-
- -

-The error functions sf_strerror() and sf_error_number() convert the library's internal -error enumerations into text strings. -

-
-      int         sf_perror     (SNDFILE *sndfile) ;
-      int         sf_error_str  (SNDFILE *sndfile, char* str, size_t len) ;
-
- -

-The functions sf_perror() and sf_error_str() are deprecated and will be dropped -from the library at some later date. -

- - -


File Close Function

- -
-      int  sf_close  (SNDFILE *sndfile) ;
-
- -

-The close function closes the file, deallocates its internal buffers and returns -0 on success or an error value otherwise. -

-
- - -


Write Sync Function

- -
-      void  sf_write_sync  (SNDFILE *sndfile) ;
-
- -

-If the file is opened SFM_WRITE or SFM_RDWR, call the operating system's function -to force the writing of all file cache buffers to disk. If the file is opened -SFM_READ no action is taken. -

-
- - - -


File Read Functions (Items)

- -
-      sf_count_t  sf_read_short   (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_int     (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_float   (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
-      sf_count_t  sf_read_double  (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
-
- -

-The file read items functions fill the array pointed to by ptr with the requested -number of items. The items parameter must be an integer product of the number -of channels or an error will occur. -

- -

-It is important to note that the data type used by the calling program and the data -format of the file do not need to be the same. For instance, it is possible to open -a 16 bit PCM encoded WAV file and read the data using sf_read_float(). The library -seamlessly converts between the two formats on-the-fly. See -Note 1. -

- -

-The sf_read_XXXX functions return the number of items read. -Unless the end of the file was reached during the read, the return value should -equal the number of items requested. -Attempts to read beyond the end of the file will not result in an error but will -cause the sf_read_XXXX functions to return less than the number of items requested -or 0 if already at the end of the file. -

- - -


File Read Functions (Frames)

- -
-      sf_count_t  sf_readf_short   (SNDFILE *sndfile, short *ptr, sf_count_t frames) ;
-      sf_count_t  sf_readf_int     (SNDFILE *sndfile, int *ptr, sf_count_t frames) ;
-      sf_count_t  sf_readf_float   (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
-      sf_count_t  sf_readf_double  (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
-
- -

-The file read frames functions fill the array pointed to by ptr with the requested -number of frames of data. The array must be large enough to hold the product of -frames and the number of channels. -

- -

-Care must be taken to ensure that there is enough space in the array pointed to by -ptr, to take (frames * channels) number of items (shorts, ints, floats or doubles). -

- -

-The sf_readf_XXXX functions return the number of frames read. -Unless the end of the file was reached during the read, the return value should equal -the number of frames requested. -Attempts to read beyond the end of the file will not result in an error but will cause -the sf_readf_XXXX functions to return less than the number of frames requested or 0 if -already at the end of the file. -

- - -


File Write Functions (Items)

- -
-      sf_count_t  sf_write_short   (SNDFILE *sndfile, short *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_int     (SNDFILE *sndfile, int *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_float   (SNDFILE *sndfile, float *ptr, sf_count_t items) ;
-      sf_count_t  sf_write_double  (SNDFILE *sndfile, double *ptr, sf_count_t items) ;
-
- -

-The file write items functions write the data in the array pointed to by ptr to the file. -The items parameter must be an integer product of the number of channels or an error -will occur. -

- -

-It is important to note that the data type used by the calling program and the data -format of the file do not need to be the same. For instance, it is possible to open -a 16 bit PCM encoded WAV file and write the data using sf_write_float(). The library -seamlessly converts between the two formats on-the-fly. See -Note 1. -

-

-The sf_write_XXXX functions return the number of items written (which should be the -same as the items parameter). -

- - -


File Write Functions (Frames)

- -
-      sf_count_t  sf_writef_short  (SNDFILE *sndfile, short *ptr, sf_count_t frames) ;
-      sf_count_t  sf_writef_int    (SNDFILE *sndfile, int *ptr, sf_count_t frames) ;
-      sf_count_t  sf_writef_float  (SNDFILE *sndfile, float *ptr, sf_count_t frames) ;
-      sf_count_t  sf_writef_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) ;
-
- -

-The file write frames functions write the data in the array pointed to by ptr to the file. -The array must be large enough to hold the product of frames and the number of channels. -

-

-The sf_writef_XXXX functions return the number of frames written (which should be the -same as the frames parameter). -

- - -


Raw File Read and Write Functions

- -
-      sf_count_t  sf_read_raw     (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
-      sf_count_t  sf_write_raw    (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;
-
- -

-Note: Unless you are writing an external decoder/encode that uses -libsndfile to handle the file headers, you should not be using these -functions. -

- -

-The raw read and write functions read raw audio data from the audio file (not to be -confused with reading RAW header-less PCM files). The number of bytes read or written -must always be an integer multiple of the number of channels multiplied by the number -of bytes required to represent one sample from one channel. -

- -

-The raw read and write functions return the number of bytes read or written (which -should be the same as the bytes parameter). -

- -

- -Note : The result of using of both regular reads/writes and raw reads/writes on -compressed file formats other than SF_FORMAT_ALAW and SF_FORMAT_ULAW is undefined. - -

- -

-See also : SFC_RAW_NEEDS_ENDSWAP -

- - -


Functions for Reading and Writing String Data

- - -
-      const char* sf_get_string   (SNDFILE *sndfile, int str_type) ;
-      int         sf_set_string   (SNDFILE *sndfile, int str_type, const char* str) ;
-
- -

-These functions allow strings to be set on files opened for write and to be -retrieved from files opened for read where supported by the given file type. -The str_type parameter can be any one of the following string types: -

- -
-          enum
-          {   SF_STR_TITLE,
-              SF_STR_COPYRIGHT,
-              SF_STR_SOFTWARE,
-              SF_STR_ARTIST,
-              SF_STR_COMMENT,
-              SF_STR_DATE,
-              SF_STR_ALBUM,
-              SF_STR_LICENSE,
-              SF_STR_TRACKNUMBER,
-              SF_STR_GENRE
-          } ;
-
- -

-The sf_get_string() function returns the specified string if it exists and a -NULL pointer otherwise. -In addition to the string ids above, SF_STR_FIRST (== SF_STR_TITLE) and -SF_STR_LAST (always the same as the highest numbers string id) are also -available to allow iteration over all the available string ids. -

- -

-The sf_set_string() function sets the string data. -It returns zero on success and non-zero on error. -The error code can be converted to a string using sf_error_number(). -

- - -

- -

- -
- - -


Note 1

- -

-When converting between integer PCM formats of differing size (ie using sf_read_int() -to read a 16 bit PCM encoded WAV file) libsndfile obeys one simple rule: -

- -

-Whenever integer data is moved from one sized container to another sized container, -the most significant bit in the source container will become the most significant bit -in the destination container. -

- -

-When converting between integer data and floating point data, different rules apply. -The default behaviour when reading floating point data (sf_read_float() or -sf_read_double ()) from a file with integer data is normalisation. Regardless of -whether data in the file is 8, 16, 24 or 32 bit wide, the data will be read as -floating point data in the range [-1.0, 1.0]. Similarly, data in the range [-1.0, 1.0] -will be written to an integer PCM file so that a data value of 1.0 will be the largest -allowable integer for the given bit width. This normalisation can be turned on or off -using the sf_command interface. -

- - -


Note 2

- -

-Reading a file containg floating point data (allowable with WAV, AIFF, AU and other -file formats) using integer read methods (sf_read_short() or sf_read_int()) can -produce unexpected results. -For instance the data in the file may have a maximum absolute value < 1.0 which -would mean that all sample values read from the file will be zero. -In order to read these files correctly using integer read methods, it is recommended -that you use the - sf_command -interface, a command of - SFC_SET_SCALE_FLOAT_INT_READ -and a parameter of SF_TRUE to force correct scaling. -

- -
- -

- The libsndfile home page is - here. -

-

-Version : 1.0.25 -

- - - - - - - diff --git a/libs/libsndfile/doc/bugs.html b/libs/libsndfile/doc/bugs.html deleted file mode 100644 index 3a441fef11..0000000000 --- a/libs/libsndfile/doc/bugs.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - Bug Reporting - - - - - - - - -
-

Reporting Bugs in libsndfile

-
-

- Before even attempting to report a bug in libsndfile please make sure you have - read the - Frequently Asked Questions. - If you are having a problem writing code using libsndfile make sure you read - the - Application Programming Interface - documentation. -

-

- That said, I am interested in finding and fixing all genuine bugs in libsndfile. - Bugs I want to fix include any of the following problems (and probably others) : -

-
    -
  • Compilation problems on new platforms. -
  • Errors being detected during the `make check' process. -
  • Segmentation faults occuring inside libsndfile. -
  • libsndfile hanging when opening a file. -
  • Supported sound file types being incorrectly read or written. -
  • Omissions, errors or spelling mistakes in the documentation. -
- -

- When submitting a bug report you must include : -

-
    -
  • Your system (CPU and memory size should be enough). -
  • The operating system you are using. -
  • Whether you are using a package provided by your distribution or you - compiled it youself. -
  • If you compiled it yourself, the compiler you are using. (Also make - sure to run 'make check'.) -
  • A description of the problem. -
  • Information generated by the sndfile-info program (see next paragraph). -
  • If you are having problems with sndfile-play and ALSA on Linux, I will - need information about your kernel, ALSA version, compiler version, - whether you compiled the kernel/ALSA your self or installed from a - package etc. -
- -

- If libsndfile compiles and installs correctly but has difficulty reading a particular - file or type of file you should run the sndfile-info program (from the examples - directory of the libsndfile distribution) on the file. See - here - for an example of the use of the sndfile-info program. -

-

- Please do not send me a sound file which fails to open under libsndfile unless I - specifically ask you to. The above information should usually suffice for most - problems. -

-

- Once you have the above information you should submit a ticket on the libsnfile - github issue tracker. - -

- - diff --git a/libs/libsndfile/doc/command.html b/libs/libsndfile/doc/command.html deleted file mode 100644 index f2ed083760..0000000000 --- a/libs/libsndfile/doc/command.html +++ /dev/null @@ -1,1687 +0,0 @@ - - - - - - libsndfile : the sf_command function. - - - - - - - - - - - -

sf_command

-
-
-        int    sf_command (SNDFILE *sndfile, int cmd, void *data, int datasize) ;
-
-

- This function allows the caller to retrieve information from or change aspects of the - library behaviour. - Examples include retrieving a string containing the library version or changing the - scaling applied to floating point sample data during read and write. - Most of these operations are performed on a per-file basis. -

-

- The cmd parameter is an integer identifier which is defined in <sndfile.h>. - All of the valid command identifiers have names beginning with "SFC_". - Data is passed to and returned from the library by use of a void pointer. - The library will not read or write more than datasize bytes from the void pointer. - For some calls no data is required in which case data should be NULL and datasize - may be used for some other purpose. -

-

- The available commands are as follows: -

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SFC_GET_LIB_VERSIONRetrieve the version of the library.
SFC_GET_LOG_INFORetrieve the internal per-file operation log.
SFC_CALC_SIGNAL_MAXCalculate the measured maximum signal value.
SFC_CALC_NORM_SIGNAL_MAXCalculate the measured normalised maximum signal value.
SFC_CALC_MAX_ALL_CHANNELSCalculate the peak value for each channel.
SFC_CALC_NORM_MAX_ALL_CHANNELSCalculate the normalised peak for each channel.
SFC_GET_SIGNAL_MAXRetrieve the peak value for the file (as stored in the file header).
SFC_GET_MAX_ALL_CHANNELSRetrieve the peak value for each channel (as stored in the file header).
SFC_SET_NORM_FLOATModify the normalisation behaviour of the floating point reading and writing functions.
SFC_SET_NORM_DOUBLEModify the normalisation behaviour of the double precision floating point reading and writing functions.
SFC_GET_NORM_FLOATRetrieve the current normalisation behaviour of the floating point reading and writing functions.
SFC_GET_NORM_DOUBLERetrieve the current normalisation behaviour of the double precision floating point reading and writing functions.
SFC_SET_SCALE_FLOAT_INT_READSet/clear the scale factor when integer (short/int) data is read from a file - containing floating point data.
SFC_SET_SCALE_INT_FLOAT_WRITESet/clear the scale factor when integer (short/int) data is written to a file - as floating point data.
SFC_GET_SIMPLE_FORMAT_COUNTRetrieve the number of simple formats supported by libsndfile.
SFC_GET_SIMPLE_FORMATRetrieve information about a simple format.
SFC_GET_FORMAT_INFORetrieve information about a major or subtype format.
SFC_GET_FORMAT_MAJOR_COUNTRetrieve the number of major formats.
SFC_GET_FORMAT_MAJORRetrieve information about a major format type.
SFC_GET_FORMAT_SUBTYPE_COUNTRetrieve the number of subformats.
SFC_GET_FORMAT_SUBTYPERetrieve information about a subformat.
SFC_SET_ADD_PEAK_CHUNKSwitch the code for adding the PEAK chunk to WAV and AIFF files on or off.
SFC_UPDATE_HEADER_NOWUsed when a file is open for write, this command will update the file - header to reflect the data written so far.
SFC_SET_UPDATE_HEADER_AUTOUsed when a file is open for write, this command will cause the file header - to be updated after each write to the file.
SFC_FILE_TRUNCATETruncate a file open for write or for read/write.
SFC_SET_RAW_START_OFFSETChange the data start offset for files opened up as SF_FORMAT_RAW.
SFC_SET_CLIPPINGTurn on/off automatic clipping when doing floating point to integer - conversion.
SFC_GET_CLIPPINGRetrieve current clipping setting.
SFC_GET_EMBED_FILE_INFORetrieve information about audio files embedded inside other files.
SFC_GET_AMBISONICTest a WAVEX file for Ambisonic format
SFC_SET_AMBISONICModify a WAVEX header for Ambisonic format
SFC_SET_VBR_ENCODING_QUALITYSet the Variable Bit Rate encoding quality
SFC_SET_COMPRESSION_LEVELSet the compression level.
SFC_RAW_NEEDS_ENDSWAPDetermine if raw data needs endswapping
SFC_GET_BROADCAST_INFORetrieve the Broadcast Chunk info
SFC_SET_BROADCAST_INFOSet the Broadcast Chunk info
SFC_SET_CART_INFOSet the Cart Chunk info
SFC_GET_CART_INFORetrieve the Cart Chunk info
SFC_GET_LOOP_INFOGet loop info
SFC_GET_INSTRUMENTGet instrument info
SFC_SET_INSTRUMENTSet instrument info
-
- -

- -
- - - -


SFC_GET_LIB_VERSION

-

-Retrieve the version of the library as a string. -

-

-Parameters: -

-        sndfile  : Not used
-        cmd      : SFC_GET_LIB_VERSION
-        data     : A pointer to a char buffer
-        datasize : The size of the the buffer
-
-

-Example: -

-
-        char  buffer [128] ;
-        sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ;
-
- -
-
Return value:
-
This call will return the length of the retrieved version string. -
-
-
Notes:
-
-The string returned in the buffer passed to this function will not overflow -the buffer and will always be null terminated . -
- - - -


SFC_GET_LOG_INFO

-

-Retrieve the log buffer generated when opening a file as a string. This log -buffer can often contain a good reason for why libsndfile failed to open a -particular file. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_LOG_INFO
-        data     : A pointer to a char buffer
-        datasize : The size of the the buffer
-
-

-Example: -

-
-        char  buffer [2048] ;
-        sf_command (sndfile, SFC_GET_LOG_INFO, buffer, sizeof (buffer)) ;
-
- -
-
Return value:
-
This call will return the length of the retrieved version string. -
-
-
Notes:
-
-The string returned in the buffer passed to this function will not overflow -the buffer and will always be null terminated . -
- - - -


SFC_CALC_SIGNAL_MAX

-

-Retrieve the measured maximum signal value. This involves reading through -the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_SIGNAL_MAX
-        data     : A pointer to a double
-        datasize : sizeof (double)
-
-

-Example: -

-
-        double   max_val ;
-        sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &max_val, sizeof (max_val)) ;
-
- -
-
Return value:
-
Zero on success, non-zero otherwise. -
- - - -


SFC_CALC_NORM_SIGNAL_MAX

-

-Retrieve the measured normalised maximum signal value. This involves reading -through the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_NORM_SIGNAL_MAX
-        data     : A pointer to a double
-        datasize : sizeof (double)
-
-

-Example: -

-
-        double   max_val ;
-        sf_command (sndfile, SFC_CALC_NORM_SIGNAL_MAX, &max_val, sizeof (max_val)) ;
-
- -
-
Return value:
-
Zero on success, non-zero otherwise. -
- - - -


SFC_CALC_MAX_ALL_CHANNELS

-

-Calculate the peak value (ie a single number) for each channel. -This involves reading through the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_MAX_ALL_CHANNELS
-        data     : A pointer to a double
-        datasize : sizeof (double) * number_of_channels
-
-

-Example: -

-
-        double   peaks [number_of_channels] ;
-        sf_command (sndfile, SFC_CALC_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ;
-
-
-
Return value:
-
Zero if peaks have been calculated successfully and non-zero otherwise. -
- - - - -


SFC_CALC_NORM_MAX_ALL_CHANNELS

-

-Calculate the normalised peak for each channel. -This involves reading through the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_NORM_MAX_ALL_CHANNELS
-        data     : A pointer to a double
-        datasize : sizeof (double) * number_of_channels
-
-

-Example: -

-
-        double   peaks [number_of_channels] ;
-        sf_command (sndfile, SFC_CALC_NORM_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ;
-
-
-
Return value:
-
Zero if peaks have been calculated successfully and non-zero otherwise. -
- - - - - - -


SFC_GET_SIGNAL_MAX

-

-Retrieve the peak value for the file as stored in the file header. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_SIGNAL_MAX
-        data     : A pointer to a double
-        datasize : sizeof (double)
-
-

-Example: -

-
-        double   max_peak ;
-        sf_command (sndfile, SFC_GET_SIGNAL_MAX, &max_peak, sizeof (max_peak)) ;
-
-
-
Return value:
-
SF_TRUE if the file header contained the peak value. SF_FALSE otherwise. -
- - - -


SFC_GET_MAX_ALL_CHANNELS

-

-Retrieve the peak value for the file as stored in the file header. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_SIGNAL_MAX
-        data     : A pointer to an array of doubles
-        datasize : sizeof (double) * number_of_channels
-
-

-Example: -

-
-        double   peaks [number_of_channels] ;
-        sf_command (sndfile, SFC_GET_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ;
-
-
-
Return value:
-
SF_TRUE if the file header contains per channel peak values for the file. - SF_FALSE otherwise. -
- - - - -


SFC_SET_NORM_FLOAT

-

-This command only affects data read from or written to using the floating point functions: -

-
-	size_t    sf_read_float    (SNDFILE *sndfile, float *ptr, size_t items) ;
-	size_t    sf_readf_float   (SNDFILE *sndfile, float *ptr, size_t frames) ;
-
-	size_t    sf_write_float   (SNDFILE *sndfile, float *ptr, size_t items) ;
-	size_t    sf_writef_float  (SNDFILE *sndfile, float *ptr, size_t frames) ;
-
-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_NORM_FLOAT
-        data     : NULL
-        datasize : SF_TRUE or SF_FALSE
-
-

-For read operations setting normalisation to SF_TRUE means that the data from all -subsequent reads will be be normalised to the range [-1.0, 1.0]. -

-

-For write operations, setting normalisation to SF_TRUE means than all data supplied -to the float write functions should be in the range [-1.0, 1.0] and will be scaled -for the file format as necessary. -

-

-For both cases, setting normalisation to SF_FALSE means that no scaling will take place. -

-

-Example: -

-
-        sf_command (sndfile, SFC_SET_NORM_FLOAT, NULL, SF_TRUE) ;
-
-        sf_command (sndfile, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns the previous float normalisation mode. -
- - - -


SFC_SET_NORM_DOUBLE

-

-This command only affects data read from or written to using the double precision -floating point functions: -

-
-	size_t    sf_read_double    (SNDFILE *sndfile, double *ptr, size_t items) ;
-	size_t    sf_readf_double   (SNDFILE *sndfile, double *ptr, size_t frames) ;
-
-	size_t    sf_write_double   (SNDFILE *sndfile, double *ptr, size_t items) ;
-	size_t    sf_writef_double  (SNDFILE *sndfile, double *ptr, size_t frames) ;
-
-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_NORM_DOUBLE
-        data     : NULL
-        datasize : SF_TRUE or SF_FALSE
-
-

-For read operations setting normalisation to SF_TRUE means that the data -from all subsequent reads will be be normalised to the range [-1.0, 1.0]. -

-

-For write operations, setting normalisation to SF_TRUE means than all data supplied -to the double write functions should be in the range [-1.0, 1.0] and will be scaled -for the file format as necessary. -

-

-For both cases, setting normalisation to SF_FALSE means that no scaling will take place. -

-

-Example: -

-
-        sf_command (sndfile, SFC_SET_NORM_DOUBLE, NULL, SF_TRUE) ;
-
-        sf_command (sndfile, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns the previous double normalisation mode. -
- - - -


SFC_GET_NORM_FLOAT

-

-Retrieve the current float normalisation mode. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_NORM_FLOAT
-        data     : NULL
-        datasize : anything
-
-

-Example: -

-
-        normalisation = sf_command (sndfile, SFC_GET_NORM_FLOAT, NULL, 0) ;
-
-
-
Return value:
-
Returns TRUE if normalisation is on and FALSE otherwise. -
- - - -


SFC_GET_NORM_DOUBLE

-

-Retrieve the current float normalisation mode. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_NORM_DOUBLE
-        data     : NULL
-        datasize : anything
-
-

-Example: -

-
-        normalisation = sf_command (sndfile, SFC_GET_NORM_DOUBLE, NULL, 0) ;
-
-
-
Return value:
-
Returns TRUE if normalisation is on and FALSE otherwise. -
- - - - -


SFC_SET_SCALE_FLOAT_INT_READ

-

-Set/clear the scale factor when integer (short/int) data is read from a file -containing floating point data. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_SCALE_FLOAT_INT_READ
-        data     : NULL
-        datasize : TRUE or FALSE
-
-

-Example: -

-
-        sf_command (sndfile, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ;
-
-
-
Return value:
-
Returns the previous SFC_SET_SCALE_FLOAT_INT_READ setting for this file. -
- - - - -


SFC_SET_SCALE_INT_FLOAT_WRITE

-

-Set/clear the scale factor when integer (short/int) data is written to a file -as floating point data. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_SCALE_FLOAT_INT_READ
-        data     : NULL
-        datasize : TRUE or FALSE
-
-

-Example: -

-
-        sf_command (sndfile, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_TRUE) ;
-
-
-
Return value:
-
Returns the previous SFC_SET_SCALE_INT_FLOAT_WRITE setting for this file. -
- - - -


SFC_GET_SIMPLE_FORMAT_COUNT

-

-Retrieve the number of simple formats supported by libsndfile. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_SIMPLE_FORMAT_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int  count ;
-        sf_command (sndfile, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_SIMPLE_FORMAT

-

-Retrieve information about a simple format. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_SIMPLE_FORMAT
-        data     : a pointer to an  SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-The SF_FORMAT_INFO struct is defined in <sndfile.h> as: -

-
-        typedef struct
-        {   int         format ;
-            const char  *name ;
-            const char  *extension ;
-        } SF_FORMAT_INFO ;
-
-

-When sf_command() is called with SF_GET_SIMPLE_FORMAT, the value of the format -field should be the format number (ie 0 <= format <= count value obtained using -SF_GET_SIMPLE_FORMAT_COUNT). -

-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_SIMPLE_FORMAT, &format_info, sizeof (format_info)) ;
-            printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-            } ;
-
-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field of the SF_FORMAT_INFO struct will be a value which - can be placed in the format field of an SF_INFO struct when a file is to be opened - for write. -
The name field will contain a char* pointer to the name of the string, eg. "WAV (Microsoft 16 bit PCM)". -
The extension field will contain the most commonly used file extension for that file type. -
- - - -


SFC_GET_FORMAT_INFO

-

-Retrieve information about a major or subtype format. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_INFO
-        data     : a pointer to an SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-The SF_FORMAT_INFO struct is defined in <sndfile.h> as: -

-
-        typedef struct
-        {   int         format ;
-            const char  *name ;
-            const char  *extension ;
-        } SF_FORMAT_INFO ;
-
-

-When sf_command() is called with SF_GET_FORMAT_INFO, the format field is -examined and if (format & SF_FORMAT_TYPEMASK) is a valid format then the struct -is filled in with information about the given major type. -If (format & SF_FORMAT_TYPEMASK) is FALSE and (format & SF_FORMAT_SUBMASK) is a -valid subtype format then the struct is filled in with information about the given -subtype. -

-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-
-        format_info.format = SF_FORMAT_WAV ;
-        sf_command (sndfile, SFC_GET_FORMAT_INFO, &format_info, sizeof (format_info)) ;
-        printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-
-        format_info.format = SF_FORMAT_ULAW ;
-        sf_command (sndfile, SFC_GET_FORMAT_INFO, &format_info, sizeof (format_info)) ;
-        printf ("%08x  %s\n", format_info.format, format_info.name) ;
-
-
-
Return value:
-
0 on success and non-zero otherwise. -
- - -


SFC_GET_FORMAT_MAJOR_COUNT

-

-Retrieve the number of major formats. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_MAJOR_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int  count ;
-        sf_command (sndfile, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_FORMAT_MAJOR

-

-Retrieve information about a major format type. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_MAJOR
-        data     : a pointer to an  SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info)) ;
-            printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-            } ;
-
-

-For a more comprehensive example, see the program list_formats.c in the examples/ -directory of the libsndfile source code distribution. -

-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field will be one of the major format identifiers such as - SF_FORMAT_WAV or SF_FORMAT_AIFF. -
The name field will contain a char* pointer to the name of the string, eg. "WAV (Microsoft)". -
The extension field will contain the most commonly used file extension for that file type. -
- - - -


SFC_GET_FORMAT_SUBTYPE_COUNT

-

-Retrieve the number of subformats. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_SUBTYPE_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int   count ;
-        sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_FORMAT_SUBTYPE

-

-Enumerate the subtypes (this function does not translate a subtype into -a string describing that subtype). -A typical use case might be retrieving a string description of all subtypes -so that a dialog box can be filled in. -

-

- -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_SUBTYPE
-        data     : a pointer to an SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-Example 1: Retrieve all sybtypes supported by the WAV format. -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ;
-            if (! sf_format_check (format_info.format | SF_FORMAT_WAV))
-               continue ;
-            printf ("%08x  %s\n", format_info.format, format_info.name) ;
-            } ;
-
-

-Example 2: Print a string describing the SF_FORMAT_PCM_16 subtype. -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ;
-            if (format_info.format == SF_FORMAT_PCM_16)
-            {   printf ("%08x  %s\n", format_info.format, format_info.name) ;
-                break ;
-                } ;
-            } ;
-
-

-For a more comprehensive example, see the program list_formats.c in the examples/ -directory of the libsndfile source code distribution. -

-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field will be one of the major format identifiers such as - SF_FORMAT_WAV or SF_FORMAT_AIFF. -
The name field will contain a char* pointer to the name of the string; for instance - "WAV (Microsoft)" or "AIFF (Apple/SGI)". -
The extension field will be a NULL pointer. -
- - - -


SFC_SET_ADD_PEAK_CHUNK

-

-By default, WAV and AIFF files which contain floating point data (subtype SF_FORMAT_FLOAT -or SF_FORMAT_DOUBLE) have a PEAK chunk. -By using this command, the addition of a PEAK chunk can be turned on or off. -

-

-Note : This call must be made before any data is written to the file. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_ADD_PEAK_CHUNK
-        data     : Not used (should be NULL)
-        datasize : TRUE or FALSE.
-
-

-Example: -

-
-        /* Turn on the PEAK chunk. */
-        sf_command (sndfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_TRUE) ;
-
-        /* Turn off the PEAK chunk. */
-        sf_command (sndfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns SF_TRUE if the peak chunk will be written after this call. -
Returns SF_FALSE if the peak chunk will not be written after this call. -
- - - -


SFC_UPDATE_HEADER_NOW

-

-The header of an audio file is normally written by libsndfile when the file is -closed using sf_close(). -

-

-There are however situations where large files are being generated and it would -be nice to have valid data in the header before the file is complete. -Using this command will update the file header to reflect the amount of data written -to the file so far. -Other programs opening the file for read (before any more data is written) will -then read a valid sound file header. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_UPDATE_HEADER_NOW
-        data     : Not used (should be NULL)
-        datasize : Not used.
-
-

-Example: -

-
-        /* Update the header now. */
-        sf_command (sndfile, SFC_UPDATE_HEADER_NOW, NULL, 0) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_SET_UPDATE_HEADER_AUTO

-

-Similar to SFC_UPDATE_HEADER_NOW but updates the header at the end of every call -to the sf_write* functions. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_UPDATE_HEADER_NOW
-        data     : Not used (should be NULL)
-        datasize : SF_TRUE or SF_FALSE
-
-

-Example: -

-
-        /* Turn on auto header update. */
-        sf_command (sndfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ;
-
-        /* Turn off auto header update. */
-        sf_command (sndfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_FALSE) ;
-
-
-
Return value:
-
TRUE if auto update header is now on; FALSE otherwise. -
- - - -


SFC_FILE_TRUNCATE

-

-Truncate a file that was opened for write or read/write. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_FILE_TRUNCATE
-        data     : A pointer to an sf_count_t.
-        datasize : sizeof (sf_count_t)
-
- -

-Truncate the file to the number of frames specified by the sf_count_t pointed -to by data. -After this command, both the read and the write pointer will be -at the new end of the file. -This command will fail (returning non-zero) if the requested truncate position -is beyond the end of the file. -

-

-Example: -

-
-        /* Truncate the file to a length of 20 frames. */
-        sf_count_t  frames = 20 ;
-        sf_command (sndfile, SFC_FILE_TRUNCATE, &frames, sizeof (frames)) ;
-
-
-
Return value:
-
Zero on sucess, non-zero otherwise. -
- - - -


SFC_SET_RAW_START_OFFSET

-

-Change the data start offset for files opened up as SF_FORMAT_RAW. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_RAW_START_OFFSET
-        data     : A pointer to an sf_count_t.
-        datasize : sizeof (sf_count_t)
-
- -

-For a file opened as format SF_FORMAT_RAW, set the data offset to the value -given by data. -

-

-Example: -

-
-        /* Reset the data offset to 5 bytes from the start of the file. */
-        sf_count_t  offset = 5 ;
-        sf_command (sndfile, SFC_SET_RAW_START_OFFSET, &offset, sizeof (offset)) ;
-
-
-
Return value:
-
Zero on success, non-zero otherwise. -
- - - -


SFC_SET_CLIPPING

-

-Turn on/off automatic clipping when doing floating point to integer conversion. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_CLIPPING
-        data     : NULL
-        datasize : SF_TRUE or SF_FALSE.
-
- -

-Turn on (datasize == SF_TRUE) or off (datasize == SF_FALSE) clipping. -

-

-Example: -

-
-        sf_command (sndfile, SFC_SET_CLIPPING, NULL, SF_TRUE) ;
-
-
-
Return value:
-
Clipping mode (SF_TRUE or SF_FALSE). -
- - - - -


SFC_GET_CLIPPING

-

-Turn on/off automatic clipping when doing floating point to integer conversion. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_CLIPPING
-        data     : NULL
-        datasize : 0
-
- -

-Retrieve the current cliiping setting. -

-

-Example: -

-
-        sf_command (sndfile, SFC_GET_CLIPPING, NULL, 0) ;
-
-
-
Return value:
-
Clipping mode (SF_TRUE or SF_FALSE). -
- - - -


SFC_GET_EMBED_FILE_INFO

-

-Get the file offset and file length of a file enbedded within another -larger file. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_CLIPPING
-        data     : a pointer to an  SF_EMBED_FILE_INFO struct
-        datasize : sizeof (SF_EMBED_FILE_INFO)
-
-

-The SF_EMBED_FILE_INFO struct is defined in <sndfile.h> as: -

-
-        typedef struct
-        {   sf_count_t	offset ;
-            sf_count_t	length ;
-        } SF_EMBED_FILE_INFO ;
-
-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the offset field of the SF_EMBED_FILE_INFO struct will be - the offsets in bytes from the start of the outer file to the start of - the audio file. -
The value of the offset field of the SF_EMBED_FILE_INFO struct will be - the length in bytes of the embedded file. -
- - - - - -


SFC_WAVEX_GET_AMBISONIC

-

-Test if the current file has the GUID of a WAVEX file for any of the Ambisonic -formats. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_WAVEX_GET_AMBISONIC
-        data     : NULL
-        datasize : 0
-
-

- The Ambisonic WAVEX formats are defined here : - - http://dream.cs.bath.ac.uk/researchdev/wave-ex/bformat.html. -

-
-
Return value:
-
SF_AMBISONIC_NONE or SF_AMBISONIC_B_FORMAT or zero if the file format - does not support ambisonic formats. -
- - - -


SFC_WAVEX_SET_AMBISONIC

-

-Set the GUID of a new WAVEX file to indicate an Ambisonics format. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_WAVEX_SET_AMBISONIC
-        data     : NULL
-        datasize : SF_AMBISONIC_NONE or SF_AMBISONIC_B_FORMAT
-
-

-Turn on (SF_AMBISONIC_B_FORMAT) or off (SF_AMBISONIC_NONE) encoding. -This command is currently only supported for files with SF_FORMAT_WAVEX format. -

-

- The Ambisonic WAVEX formats are defined here : - - http://dream.cs.bath.ac.uk/researchdev/wave-ex/bformat.html. -

-
-
Return value:
-
Return the ambisonic value that has just been set or zero if the file - format does not support ambisonic encoding. -
- - - -


SFC_SET_VBR_ENCODING_QUALITY

-

-Set the Variable Bit Rate encoding quality. -The encoding quality value should be between 0.0 (lowest quality) and 1.0 -(highest quality). -Currenly this command is only implemented for FLAC and Ogg/Vorbis files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_VBR_ENCODING_QUALITY
-        data     : A pointer to a double value
-        datasize : sizeof (double)
-
-

-The command must be sent before any audio data is written to the file. -

-

-

-
-
Return value:
-
SF_TRUE if VBR encoding quality was set. - SF_FALSE otherwise. -
- - - -


SFC_SET_COMPRESSION_LEVEL

-

-Set the compression level. -The compression level should be between 0.0 (minimum compression level) and 1.0 -(highest compression level). -Currenly this command is only implemented for FLAC and Ogg/Vorbis files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_COMPRESSION_LEVEL
-        data     : A pointer to a double value
-        datasize : sizeof (double)
-
-

-The command must be sent before any audio data is written to the file. -

-

-

-
-
Return value:
-
SF_TRUE if compression level was set. - SF_FALSE otherwise. -
- - - -


SFC_RAW_NEEDS_ENDSWAP

-

-Determine if raw data read using - - sf_read_raw -needs to be end swapped on the host CPU. -

-

-For instance, will return SF_TRUE on when reading WAV containing -SF_FORMAT_PCM_16 data on a big endian machine and SF_FALSE on a little endian -machine. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_RAW_NEEDS_ENDSWAP
-        data     : NULL
-        datasize : 0
-
- -
-
Return value:
-
SF_TRUE or SF_FALSE -
- - - - -


SFC_GET_BROADCAST_INFO

-

-Retrieve the Broadcast Extension Chunk from WAV (and related) files. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_BROADCAST_INFO
-        data     : a pointer to an SF_BROADCAST_INFO struct
-        datasize : sizeof (SF_BROADCAST_INFO)
-
-

-The SF_BROADCAST_INFO struct is defined in <sndfile.h> as: -

-
-    typedef struct
-    {   char            description [256] ;
-        char            originator [32] ;
-        char            originator_reference [32] ;
-        char            origination_date [10] ;
-        char            origination_time [8] ;
-        unsigned int    time_reference_low ;
-        unsigned int    time_reference_high ;
-        short           version ;
-        char            umid [64] ;
-        char            reserved [190] ;
-        unsigned int    coding_history_size ;
-        char            coding_history [256] ;
-    } SF_BROADCAST_INFO ;
-
- -
-
Return value:
-
SF_TRUE if the file contained a Broadcast Extension chunk or SF_FALSE - otherwise. -
- - - -


SFC_SET_BROADCAST_INFO

-

-Set the Broadcast Extension Chunk for WAV (and related) files. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_BROADCAST_INFO
-        data     : a pointer to an SF_BROADCAST_INFO struct
-        datasize : sizeof (SF_BROADCAST_INFO)
-
- -
-
Return value:
-
SF_TRUE if setting the Broadcast Extension chunk was successful and SF_FALSE - otherwise. - -
- - - -


SFC_GET_CART_INFO

-

Retrieve the Cart Chunk from WAV (and related) files. Based on AES46 standard for CartChunk (see CartChunk.org for more information. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_CART_INFO
-        data     : a pointer to an SF_CART_INFO struct
-        datasize : sizeof (SF_CART_INFO)
-
-

-The SF_CART_INFO struct is defined in <sndfile.h> as: -

-
-#define SF_CART_INFO_VAR(p_tag_text_size) \
-                        struct
-                        {       char            version [4] ;
-                                char            title [64] ;
-                                char            artist [64] ;
-                                char            cut_id [64] ;
-                                char            client_id [64] ;
-                                char            category [64] ;
-                                char            classification [64] ;
-                                char            out_cue [64] ;
-                                char            start_date [10] ;
-                                char            start_time [8] ;
-                                char            end_date [10] ;
-                                char            end_time [8] ;
-                                char            producer_app_id [64] ;
-                                char            producer_app_version [64] ;
-                                char            user_def [64] ;
-                                long    level_reference ;
-                                SF_CART_TIMER   post_timers [8] ;
-                                char            reserved [276] ;
-                                char            url [1024] ;
-                                unsigned int    tag_text_size ;
-                                char            tag_text[p_tag_text_size] ;
-                        }
-
- -
-
Return value:
-
SF_TRUE if the file contained a Cart chunk or SF_FALSE - otherwise. -
- - - -


SFC_SET_CART_INFO

-

-Set the Cart Chunk for WAV (and related) files. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_CART_INFO
-        data     : a pointer to an SF_CART_INFO struct
-        datasize : sizeof (SF_CART_INFO)
-
- -
-
Return value:
-
SF_TRUE if setting the Cart chunk was successful and SF_FALSE - otherwise. -
- - - -


SFC_GET_LOOP_INFO

-

-Retrieve loop information for file including time signature, length in -beats and original MIDI base note -

-

-Parameters: -

-
-         sndfile  : A valid SNDFILE* pointer
-         cmd      : SFC_GET_LOOP_INFO
-         data     : a pointer to an SF_LOOP_INFO struct
-         datasize : sizeof (SF_LOOP_INFO)
-
-

-The SF_BROADCAST_INFO struct is defined in <sndfile.h> as: -

-
-        typedef struct
-        {   short    time_sig_num ;   /* any positive integer    > 0  */
-            short    time_sig_den ;   /* any positive power of 2 > 0  */
-            int        loop_mode ;    /* see SF_LOOP enum             */
-
-            int        num_beats ;    /* this is NOT the amount of quarter notes !!!*/
-                                      /* a full bar of 4/4 is 4 beats */
-                                      /* a full bar of 7/8 is 7 beats */
-
-            float    bpm ;            /* suggestion, as it can be calculated using other fields:*/
-                                      /* file's lenght, file's sampleRate and our time_sig_den*/
-                                      /* -> bpms are always the amount of _quarter notes_ per minute */
-
-            int    root_key ;         /* MIDI note, or -1 for None */
-            int future [6] ;
-        } SF_LOOP_INFO ;
-
-

-Example: -

-
-         SF_LOOP_INFO loop;
-         sf_command (sndfile, SFC_GET_LOOP_INFO, &loop, sizeof (loop)) ;
-
-
-
Return value:
-
SF_TRUE if the file header contains loop information for the file. - SF_FALSE otherwise. -
- - - - - -


SFC_GET_INSTRUMENT

-

-Retrieve instrument information from file including MIDI base note, -keyboard mapping and looping informations(start/stop and mode). -

-

-Parameters: -

-
-         sndfile  : A valid SNDFILE* pointer
-         cmd      : SFC_GET_INSTRUMENT
-         data     : a pointer to an SF_INSTRUMENT struct
-         datasize : sizeof (SF_INSTRUMENT)
-
- -

-The SF_INSTRUMENT struct is defined in <sndfile.h> as: -

-
-        enum
-        {    /*
-            **    The loop mode field in SF_INSTRUMENT will be one of the following.
-            */
-            SF_LOOP_NONE = 800,
-            SF_LOOP_FORWARD,
-            SF_LOOP_BACKWARD,
-            SF_LOOP_ALTERNATING
-        } ;
-
-        typedef struct
-        {   int gain ;
-            char basenote, detune ;
-            char velocity_lo, velocity_hi ;
-            char key_lo, key_hi ;
-            int loop_count ;
-
-            struct
-            {   int mode ;
-                unsigned int start ;
-                unsigned int end ;
-                unsigned int count ;
-            } loops [16] ; /* make variable in a sensible way */
-        } SF_INSTRUMENT ;
-
- -

-Example: -

-
-         SF_INSTRUMENT inst ;
-         sf_command (sndfile, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) ;
-
-
-
Return value:
-
SF_TRUE if the file header contains instrument information for the - file. SF_FALSE otherwise. -
- - - - - -


SFC_SET_INSTRUMENT

-

-Set the instrument information for the file. -

-

-Parameters: -

-
-         sndfile  : A valid SNDFILE* pointer
-         cmd      : SFC_GET_INSTRUMENT
-         data     : a pointer to an SF_INSTRUMENT struct
-         datasize : sizeof (SF_INSTRUMENT)
-
-

-Example: -

-
-         SF_INSTRUMENT inst ;
-         sf_command (sndfile, SFC_SET_INSTRUMENT, &inst, sizeof (inst)) ;
-
-
-
Return value:
-
SF_TRUE if the file header contains instrument information for the - file. SF_FALSE otherwise. -
- - - - -
-

- The libsndfile home page is here : - - http://www.mega-nerd.com/libsndfile/. -
-Version : 1.0.25 -

- - - diff --git a/libs/libsndfile/doc/development.html b/libs/libsndfile/doc/development.html deleted file mode 100644 index 4236cdbb87..0000000000 --- a/libs/libsndfile/doc/development.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - libsndfile Development - - - - - - - - -


libsndfile Development

- -

-libsndfile is being developed by a small but growing community of users -and hackers led by Erik de Castro Lopo. -People interested in helping should join the libsndfile-devel - mailing list -where most of the discussion about new features takes place. -

- -

-The main repository can be found on Github: -

- -
- - https://github.com/erikd/libsndfile/ -
- -

-and includes - - instuctions -on how to build libsndfilefrom the Git repo. -

- - - - diff --git a/libs/libsndfile/doc/dither.html b/libs/libsndfile/doc/dither.html deleted file mode 100644 index 01a416f8b3..0000000000 --- a/libs/libsndfile/doc/dither.html +++ /dev/null @@ -1,1017 +0,0 @@ - - - - - - libsndfile : the sf_command function. - - - - - - - - - - - -

sf_command

-
-
-        int    sf_command (SNDFILE *sndfile, int cmd, void *data, int datasize) ;
-
-

- This function allows the caller to retrieve information from or change aspects of the - library behaviour. - Examples include retrieving a string containing the library version or changing the - scaling applied to floating point sample data during read and write. - Most of these operations are performed on a per-file basis. -

-

- The cmd parameter is a integer identifier which is defined in <sndfile.h>. - All of the valid command identifiers have names begining with "SFC_". - Data is passed to and returned from the library by use of a void pointer. - The library will not read or write more than datasize bytes from the void pointer. - For some calls no data is required in which case data should be NULL and datasize - may be used for some other purpose. -

-

- The available commands are as follows: -

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SFC_GET_LIB_VERSIONRetrieve the version of the library.
SFC_GET_LOG_INFORetrieve the internal per-file operation log.
SFC_CALC_SIGNAL_MAXRetrieve the measured maximum signal value.
SFC_CALC_NORM_SIGNAL_MAXRetrieve the measured normalised maximum signal value.
SFC_CALC_MAX_ALL_CHANNELSCalculate peaks for all channels.
SFC_CALC_NORM_MAX_ALL_CHANNELSCalculate normalised peaks for all channels.
SFC_SET_NORM_FLOATModify the normalisation behaviour of the floating point reading and writing functions.
SFC_SET_NORM_DOUBLEModify the normalisation behaviour of the double precision floating point reading and writing functions.
SFC_GET_NORM_FLOATRetrieve the current normalisation behaviour of the floating point reading and writing functions.
SFC_GET_NORM_DOUBLERetrieve the current normalisation behaviour of the double precision floating point reading and writing functions.
SFC_GET_SIMPLE_FORMAT_COUNTRetrieve the number of simple formats supported by libsndfile.
SFC_GET_SIMPLE_FORMATRetrieve information about a simple format.
SFC_GET_FORMAT_INFORetrieve information about a major or subtype format.
SFC_GET_FORMAT_MAJOR_COUNTRetrieve the number of major formats.
SFC_GET_FORMAT_MAJORRetrieve information about a major format type.
SFC_GET_FORMAT_SUBTYPE_COUNTRetrieve the number of subformats.
SFC_GET_FORMAT_SUBTYPERetrieve information about a subformat.
SFC_SET_ADD_PEAK_CHUNKSwitch the code for adding the PEAK chunk to WAV and AIFF files on or off.
SFC_UPDATE_HEADER_NOWUsed when a file is open for write, this command will update the file - header to reflect the data written so far.
SFC_SET_UPDATE_HEADER_AUTOUsed when a file is open for write, this command will cause the file header - to be updated after each write to the file.
SFC_FILE_TRUNCATETruncate a file open for write or for read/write.
SFC_SET_RAW_START_OFFSETChange the data start offset for files opened up as SF_FORMAT_RAW.
-
- -

- -
- - - -


SFC_GET_LIB_VERSION

-

-Retrieve the version of the library as a string. -

-

-Parameters: -

-        sndfile  : Not used
-        cmd      : SFC_GET_LIB_VERSION
-        data     : A pointer to a char buffer
-        datasize : The size of the the buffer
-
-

-Example: -

-
-        char  buffer [128] ;
-        sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ;
-
- -
-
Return value:
-
This call will return the length of the retrieved version string. -
-
-
Notes:
-
-The string returned in the buffer passed to this function will not overflow -the buffer and will always be null terminated . -
- - - -


SFC_GET_LOG_INFO

-

-Retrieve the log buffer generated when opening a file as a string. This log -buffer can often contain a good reason for why libsndfile failed to open a -particular file. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_LOG_INFO
-        data     : A pointer to a char buffer
-        datasize : The size of the the buffer
-
-

-Example: -

-
-        char  buffer [2048] ;
-        sf_command (sndfile, SFC_GET_LOG_INFO, buffer, sizeof (buffer)) ;
-
- -
-
Return value:
-
This call will return the length of the retrieved version string. -
-
-
Notes:
-
-The string returned in the buffer passed to this function will not overflow -the buffer and will always be null terminated . -
- - - -


SFC_CALC_SIGNAL_MAX

-

-Retrieve the measured maximum signal value. This involves reading through -the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_SIGNAL_MAX
-        data     : A pointer to a double
-        datasize : sizeof (double)
-
-

-Example: -

-
-        double   max_val ;
-        sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &max_val, sizeof (max_val)) ;
-
- -
-
Return value:
-
Zero on success, non-zero otherwise. -
- - - -


SFC_CALC_NORM_SIGNAL_MAX

-

-Retrieve the measured normailised maximum signal value. This involves reading -through the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_NORM_SIGNAL_MAX
-        data     : A pointer to a double
-        datasize : sizeof (double)
-
-

-Example: -

-
-        double   max_val ;
-        sf_command (sndfile, SFC_CALC_NORM_SIGNAL_MAX, &max_val, sizeof (max_val)) ;
-
- -
-
Return value:
-
Zero on success, non-zero otherwise. -
- - - -


SFC_CALC_MAX_ALL_CHANNELS

-

-Calculate peaks for all channels. This involves reading through -the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_MAX_ALL_CHANNELS
-        data     : A pointer to a double
-        datasize : sizeof (double) * number_of_channels
-
-

-Example: -

-
-        double   peaks [number_of_channels] ;
-        sf_command (sndfile, SFC_CALC_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ;
-
-
-
Return value:
-
Zero if peaks have been calculated successfully and non-zero otherwise. -
- - - - -


SFC_CALC_NORM_MAX_ALL_CHANNELS

-

-Calculate normalised peaks for all channels. This involves reading through -the whole file which can be slow on large files. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_CALC_NORM_MAX_ALL_CHANNELS
-        data     : A pointer to a double
-        datasize : sizeof (double) * number_of_channels
-
-

-Example: -

-
-        double   peaks [number_of_channels] ;
-        sf_command (sndfile, SFC_CALC_NORM_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ;
-
-
-
Return value:
-
Zero if peaks have been calculated successfully and non-zero otherwise. -
- - - - - - - - - - - -


SFC_SET_NORM_FLOAT

-

-This command only affects data read from or written to using the floating point functions: -

-
-	size_t    sf_read_float    (SNDFILE *sndfile, float *ptr, size_t items) ;
-	size_t    sf_readf_float   (SNDFILE *sndfile, float *ptr, size_t frames) ;
-
-	size_t    sf_write_float   (SNDFILE *sndfile, float *ptr, size_t items) ;
-	size_t    sf_writef_float  (SNDFILE *sndfile, float *ptr, size_t frames) ;
-
-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_NORM_FLOAT
-        data     : NULL
-        datasize : SF_TRUE or SF_FALSE
-
-

-For read operations setting normalisation to SF_TRUE means that the data from all -subsequent reads will be be normalised to the range [-1.0, 1.0]. -

-

-For write operations, setting normalisation to SF_TRUE means than all data supplied -to the float write functions should be in the range [-1.0, 1.0] and will be scaled -for the file format as necessary. -

-

-For both cases, setting normalisation to SF_FALSE means that no scaling will take place. -

-

-Example: -

-
-        sf_command (sndfile, SFC_SET_NORM_FLOAT, NULL, SF_TRUE) ;
-
-        sf_command (sndfile, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns 1 on success or 0 for failure. -
- - - -


SFC_SET_NORM_DOUBLE

-

-This command only affects data read from or written to using the double precision -floating point functions: -

-
-	size_t    sf_read_double    (SNDFILE *sndfile, double *ptr, size_t items) ;
-	size_t    sf_readf_double   (SNDFILE *sndfile, double *ptr, size_t frames) ;
-
-	size_t    sf_write_double   (SNDFILE *sndfile, double *ptr, size_t items) ;
-	size_t    sf_writef_double  (SNDFILE *sndfile, double *ptr, size_t frames) ;
-
-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_NORM_DOUBLE
-        data     : NULL
-        datasize : SF_TRUE or SF_FALSE
-
-

-For read operations setting normalisation to SF_TRUE means that the data -from all subsequent reads will be be normalised to the range [-1.0, 1.0]. -

-

-For write operations, setting normalisation to SF_TRUE means than all data supplied -to the double write functions should be in the range [-1.0, 1.0] and will be scaled -for the file format as necessary. -

-

-For both cases, setting normalisation to SF_FALSE means that no scaling will take place. -

-

-Example: -

-
-        sf_command (sndfile, SFC_SET_NORM_DOUBLE, NULL, SF_TRUE) ;
-
-        sf_command (sndfile, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns 1 on success or 0 for failure. -
- - - -


SFC_GET_NORM_FLOAT

-

-Retrieve the current float normalisation mode. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_NORM_FLOAT
-        data     : NULL
-        datasize : anything
-
-

-Example: -

-
-        normalisation = sf_command (sndfile, SFC_GET_NORM_FLOAT, NULL, 0) ;
-
-
-
Return value:
-
Returns TRUE if normaisation is on and FALSE otherwise. -
- - - -


SFC_GET_NORM_DOUBLE

-

-Retrieve the current float normalisation mode. -

-

-Parameters: -

-
-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_GET_NORM_DOUBLE
-        data     : NULL
-        datasize : anything
-
-

-Example: -

-
-        normalisation = sf_command (sndfile, SFC_GET_NORM_DOUBLE, NULL, 0) ;
-
-
-
Return value:
-
Returns TRUE if normalisation is on and FALSE otherwise. -
- - - -


SFC_GET_SIMPLE_FORMAT_COUNT

-

-Retrieve the number of simple formats supported by libsndfile. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_SIMPLE_FORMAT_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int  count ;
-        sf_command (sndfile, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_SIMPLE_FORMAT

-

-Retrieve information about a simple format. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_SIMPLE_FORMAT
-        data     : a pointer to an  SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-The SF_FORMAT_INFO struct is defined in <sndfile.h> as: -

-
-        typedef struct
-        {   int         format ;
-            const char  *name ;
-            const char  *extension ;
-        } SF_FORMAT_INFO ;
-
-

-When sf_command() is called with SF_GET_SIMPLE_FORMAT, the value of the format -field should be the format number (ie 0 <= format <= count value obtained using -SF_GET_SIMPLE_FORMAT_COUNT). -

-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_SIMPLE_FORMAT, &format_info, sizeof (format_info)) ;
-            printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-            } ;
-
-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field of the SF_FORMAT_INFO struct will be an value which - can be placed in the format field of an SF_INFO struct when a file is to be opened - for write. -
The name field will contain a char* pointer to the name of the string ie "WAV (Microsoft 16 bit PCM)". -
The extention field will contain the most commonly used file extension for that file type. -
- - - -


SFC_GET_FORMAT_INFO

-

-Retrieve information about a major or subtype format. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_INFO
-        data     : a pointer to an SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-The SF_FORMAT_INFO struct is defined in <sndfile.h> as: -

-
-        typedef struct
-        {   int         format ;
-            const char  *name ;
-            const char  *extension ;
-        } SF_FORMAT_INFO ;
-
-

-When sf_command() is called with SF_GET_FORMAT_INFO, the format field is -examined and if (format & SF_FORMAT_TYPEMASK) is a valid format then the struct -is filled in with information about the given major type. -If (format & SF_FORMAT_TYPEMASK) is FALSE and (format & SF_FORMAT_SUBMASK) is a -valid subtype format then the struct is filled in with information about the given -subtype. -

-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-
-        format_info.format = SF_FORMAT_WAV ;
-        sf_command (sndfile, SFC_GET_FORMAT_INFO, &format_info, sizeof (format_info)) ;
-        printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-
-        format_info.format = SF_FORMAT_ULAW ;
-        sf_command (sndfile, SFC_GET_FORMAT_INFO, &format_info, sizeof (format_info)) ;
-        printf ("%08x  %s\n", format_info.format, format_info.name) ;
-
-
-
Return value:
-
0 on success and non-zero otherwise. -
- - -


SFC_GET_FORMAT_MAJOR_COUNT

-

-Retrieve the number of major formats. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_MAJOR_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int  count ;
-        sf_command (sndfile, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_FORMAT_MAJOR

-

-Retrieve information about a major format type. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_MAJOR
-        data     : a pointer to an  SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)) ;
-
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info)) ;
-            printf ("%08x  %s %s\n", format_info.format, format_info.name, format_info.extension) ;
-            } ;
-
-

-For a more comprehensive example, see the program list_formats.c in the examples/ -directory of the libsndfile source code distribution. -

-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field will one of the major format identifiers suc as SF_FORMAT_WAV - SF_FORMAT_AIFF. -
The name field will contain a char* pointer to the name of the string ie "WAV (Microsoft)". -
The extention field will contain the most commonly used file extension for that file type. -
- - - -


SFC_GET_FORMAT_SUBTYPE_COUNT

-

-Retrieve the number of subformats. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_SUBTYPE_COUNT
-        data     : a pointer to an int
-        datasize : sizeof (int)
-
-

-Example: -

-
-        int   count ;
-        sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_GET_FORMAT_SUBTYPE

-

-Retrieve information about a subformat. -

-

-Parameters: -

-
-        sndfile  : Not used.
-        cmd      : SFC_GET_FORMAT_SUBTYPE
-        data     : a pointer to an SF_FORMAT_INFO struct
-        datasize : sizeof (SF_FORMAT_INFO)
-
-

-Example: -

-
-        SF_FORMAT_INFO	format_info ;
-        int             k, count ;
-
-        sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ;
-
-        /* Retrieve all the subtypes supported by the WAV format. */
-        for (k = 0 ; k < count ; k++)
-        {   format_info.format = k ;
-            sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ;
-            if (! sf_format_check (format.info | SF_FORMAT_WAV))
-               continue ;
-            printf ("%08x  %s\n", format_info.format, format_info.name) ;
-            } ;
-
-

-For a more comprehensive example, see the program list_formats.c in the examples/ -directory of the libsndfile source code distribution. -

-
-
Return value:
-
0 on success and non-zero otherwise. -
The value of the format field will one of the major format identifiers such as SF_FORMAT_WAV - SF_FORMAT_AIFF. -
The name field will contain a char* pointer to the name of the string; for instance - "WAV (Microsoft)" or "AIFF (Apple/SGI)". -
The extention field will be a NULL pointer. -
- - - -


SFC_SET_ADD_PEAK_CHUNK

-

-By default, WAV and AIFF files which contain floating point data (subtype SF_FORMAT_FLOAT -or SF_FORMAT_DOUBLE) have a PEAK chunk. -By using this command, the addition of a PEAK chunk can be turned on or off. -

-

-Note : This call must be made before any data is written to the file. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_ADD_PEAK_CHUNK
-        data     : Not used (should be NULL)
-        datasize : TRUE or FALSE.
-
-

-Example: -

-
-        /* Turn on the PEAK chunk. */
-        sf_command (sndfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_TRUE) ;
-
-        /* Turn off the PEAK chunk. */
-        sf_command (sndfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ;
-
-
-
Return value:
-
Returns SF_TRUE if the peak chunk will be written after this call. -
Returns SF_FALSE if the peak chunk will not be written after this call. -
- - - -


SFC_UPDATE_HEADER_NOW

-

-The header of an audio file is normally written by libsndfile when the file is -closed using sf_close(). -

-

-There are however situations where large files are being generated and it would -be nice to have valid data in the header before the file is complete. -Using this command will update the file header to reflect the amount of data written -to the file so far. -Other programs opening the file for read (before any more data is written) will -then read a valid sound file header. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_UPDATE_HEADER_NOW
-        data     : Not used (should be NULL)
-        datasize : Not used.
-
-

-Example: -

-
-        /* Update the header now. */
-        sf_command (sndfile, SFC_UPDATE_HEADER_NOW, NULL, 0) ;
-
-
-
Return value:
-
0 -
- - - -


SFC_SET_UPDATE_HEADER_AUTO

-

-Similar to SFC_UPDATE_HEADER_NOW but updates the header at the end of every call -to the sf_write* functions. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_UPDATE_HEADER_NOW
-        data     : Not used (should be NULL)
-        datasize : SF_TRUE or SF_FALSE
-
-

-Example: -

-
-        /* Turn on auto header update. */
-        sf_command (sndfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ;
-
-        /* Turn off auto header update. */
-        sf_command (sndfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_FALSE) ;
-
-
-
Return value:
-
TRUE if auto update header is now on; FALSE otherwise. -
- - - -


SFC_FILE_TRUNCATE

-

-Truncate a file open for write or for read/write. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_FILE_TRUNCATE
-        data     : A pointer to an sf_count_t.
-        datasize : sizeof (sf_count_t)
-
- -

-Truncate the file to the number of frames specified by the sf_count_t pointed -to by data. -After this command, both the read and the write pointer will be -at the new end of the file. -This command will fail (returning non-zero) if the requested truncate position -is beyond the end of the file. -

-

-Example: -

-
-        /* Truncate the file to a length of 20 frames. */
-        sf_count_t  frames = 20 ;
-        sf_command (sndfile, SFC_FILE_TRUNCATE, &frames, sizeof (frames)) ;
-
-
-
Return value:
-
Zero on sucess, non-zero otherwise. -
- - - -


SFC_SET_RAW_START_OFFSET

-

-Change the data start offset for files opened up as SF_FORMAT_RAW. -

-

-Parameters: -

-        sndfile  : A valid SNDFILE* pointer
-        cmd      : SFC_SET_RAW_START_OFFSET
-        data     : A pointer to an sf_count_t.
-        datasize : sizeof (sf_count_t)
-
- -

-For a file opened as format SF_FORMAT_RAW, set the data offset to the value -given by data. -

-

-Example: -

-
-        /* Reset the data offset to 5 bytes from the start of the file. */
-        sf_count_t  offset = 5 ;
-        sf_command (sndfile, SFC_SET_RAW_START_OFFSET, &offset, sizeof (offset)) ;
-
-
-
Return value:
-
Zero on sucess, non-zero otherwise. -
- - - -
-

- The libsndfile home page is here : - - http://www.mega-nerd.com/libsndfile/. -
-Version : 1.0.25 -

- - - diff --git a/libs/libsndfile/doc/donate.html b/libs/libsndfile/doc/donate.html deleted file mode 100644 index c611f47ffd..0000000000 --- a/libs/libsndfile/doc/donate.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - libsndfile : donate. - - - - - - - - - - - -
- -
- libsndfile.jpg -
- -
- -

-Dear libsndfile user, -

- -

-This library was developed on Linux for Linux. I am not a Windows user and -maintaining this library for Windows costs me significant amounts of time above -and beyond the time taken to make it work on Linux and Unix-like systems. -

- -

-I therefore ask Windows users of libsndfile to donate to ensure that libsndfile's -support for Windows continues. As long as donations continue to flow in at a decent -rate, I will continue to release precompiled Windows binaries in sync with the -Linux/Unix version. If donations are poor, support for windows will fall behind. -

- - -

-You are free to donate any amount you chose. -As a guideline: -

- -
    -
  • If you are simply a user of libsndfile that would like to ensure that - the development of libsndfile continues, a donation of $10US would be more - than adequate. -
  • -
  • If you are shareware author that distributes libsndfile with your app and - makes more than $1000 a year from your shareware, a one off donation of $50 - would be appropriate. -
  • -
  • If your company is a commercial software house that distributes one or more - products that ship with libsndfile, a donation of $100 every second or third - year would be appropriate. -
  • -
- - -

-Donations can be made in Bitcoin to the Bitcoin address - 15hVWemFiH6DLJ22SBYPk9b4fgWtxBEvfQ - -which can be verified by checking the following GPG signature. -

- -
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA256
-
-libsndfile Bitcoin address : 15hVWemFiH6DLJ22SBYPk9b4fgWtxBEvfQ
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.12 (GNU/Linux)
-
-iQIcBAEBCAAGBQJSK7MUAAoJEEXYQ7zIiotIgXEP/R8hy65tlV7TiPw9bY9BklXS
-/Vl8FU2RhDkBt61ZmxbfDTybyQ5Vce/3wWph15L4RvpoX1OyeintQFmwwuPjOGiq
-eIz0nT9vDorG37Xdo5NZNBu9Tp1Od9MNtxFaAsRWFrDfvKEKljBHrcfM972cYrAp
-DaFd0Ik+bHKom9iQXFB7TFd0w2V4uszVMQDUGqb/vRNeRURZS7ypeMNwc8tZyTKR
-waEGMTa5sxxRjs7MqGRxSovnFT7JV3TNfdkBInUliIR/XvrudFR9J4Fiv+8Dk9P8
-WNjm6uFxvgIqiu1G9bjrwwr+DsBju93ljGNcZoayAKw5vwbX6KTcCbc31k9dP8Hf
-p6YdmPlZVKZmva+P3nLSJBTlxNu24Jm+ha+ZM/svDXTaPFWC8l5FP17kK0Bj8wCq
-N7pDz6RchEn10u+HdhfT1XiUjxj0zNXrr0GGj9apjl0RlT0O49eBttV0oXIdBRLi
-nTEaOWITpCgu7ggw1kWXHIWEncuiaSuJy/iH8PgNepWVj/6PxQRMrTqG4ux2Snk8
-Ua4vO8YHLMZX/XvSUS7eMtgfM7AO6YjJ/ac9bQif9bh6LsYEVVklysMUin6ZRS7Z
-Cms23FnqeQKtJOzdvqSJiV06lK6fP+tYdM4WSYn+AfL4IfYl2v48xXVU8XOOK9BH
-bJPKMDcz1ZvfYtX5mSW1
-=WXGB
------END PGP SIGNATURE-----
-
- -

-Thanks and regards, -
-Erik de Castro Lopo -
-Main libsndfile author and maintainer -

- - - - - - - - diff --git a/libs/libsndfile/doc/embedded_files.html b/libs/libsndfile/doc/embedded_files.html deleted file mode 100644 index c73e86a3b5..0000000000 --- a/libs/libsndfile/doc/embedded_files.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - libsndfile : Embedded Sound Files. - - - - - - - - - - -

Embedded Sound Files.

- -

-By using the open SNDFILE with a file descriptor function: -

- -
-      SNDFILE*  sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
-
- -

-it is possible to open sound files embedded within larger files. -There are however a couple of caveats: -

- -

    -
  • Read/Write mode (SFM_RDWR) is not supported. -
  • Writing of embedded files is only supported at the end of the file. -
  • Reading of embedded files is only supported at file offsets greater - than zero. -
  • Not all file formats are supported (currently only WAV, AIFF and AU). -
- -

-The test program multi_file_test.c in the tests/ directory of the -source code tarball shows how this functionality is used to read and write -embedded files. -

- - - diff --git a/libs/libsndfile/doc/index.html b/libs/libsndfile/doc/index.html deleted file mode 100644 index bdd25aad10..0000000000 --- a/libs/libsndfile/doc/index.html +++ /dev/null @@ -1,493 +0,0 @@ - - - - - - libsndfile - - - - - - - - - - - - -
- libsndfile.jpg -
- -
- History -+- - Features -+- - Similar or Related Projects -+- - News -
- Development -+- - Programming Interface -+- - Bug Reporting -+- - Download -
- FAQ -+- - Mailing Lists -+- - Change Log -+- - Licensing Information -+- - See Also -
- -

-

- Libsndfile is a C library for reading and writing files containing sampled sound - (such as MS Windows WAV and the Apple/SGI AIFF format) through one standard - library interface. It is released in source code format under the - Gnu Lesser General Public License. -

- -

- The library was written to compile and run on a Linux system but should compile - and run on just about any Unix (including MacOS X). - There are also pre-compiled binaries available for 32 and 64 bit windows. -

-

- It was designed to handle both little-endian (such as WAV) and big-endian - (such as AIFF) data, and to compile and run correctly on little-endian (such as Intel - and DEC/Compaq Alpha) processor systems as well as big-endian processor systems such - as Motorola 68k, Power PC, MIPS and Sparc. - Hopefully the design of the library will also make it easy to extend for reading and - writing new sound file formats. -

- -

- It has been compiled and tested (at one time or another) on the following systems: -

- -
    -
  • Every platform supported by Debian GNU/Linux including x86_64-linux-gnu, - i486-linux-gnu, powerpc-linux-gnu, sparc-linux-gnu, alpha-linux-gnu, - mips-linux-gnu and armel-linux-gnu.
  • -
  • powerpc-apple-darwin7.0 (Mac OS X 10.3)
  • -
  • sparc-sun-solaris2.8 (using gcc)
  • -
  • mips-sgi-irix5.3 (using gcc)
  • -
  • QNX 6.0
  • -
  • i386-unknown-openbsd2.9
  • -
- -

- At the moment, each new release is being tested on i386 Linux, x86_64 Linux, - PowerPC Linux, Win32 and Win64. -

- - - - -

Features

-

- libsndfile has the following main features : -

-
    -
  • Ability to read and write a large number of file formats. -
  • A simple, elegant and easy to use Applications Programming Interface. -
  • Usable on Unix, Win32, MacOS and others. -
  • On the fly format conversion, including endian-ness swapping, type conversion - and bitwidth scaling. -
  • Optional normalisation when reading floating point data from files containing - integer data. -
  • Ability to open files in read/write mode. -
  • The ability to write the file header without closing the file (only on files - open for write or read/write). -
  • Ability to query the library about all supported formats and retrieve text - strings describing each format. -
-

- libsndfile has a comprehensive test suite so that each release is as bug free - as possible. - When new bugs are found, new tests are added to the test suite to ensure that - these bugs don't creep back into the code. - When new features are added, tests are added to the test suite to make sure that - these features continue to work correctly even when they are old features. -

-

- The following table lists the file formats and encodings that libsndfile can read - and write. - The file formats are arranged across the top and encodings along the left - edge. -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Micro- soft
WAV
SGI / Apple
AIFF / AIFC
Sun / DEC /
NeXT
AU / SND
Header- less
RAW
Paris Audio
File
PAF
Commo- dore
Amiga
IFF / SVX
Sphere
Nist
WAV
IRCAM
SF
Creative
VOC
Sound forge
W64
GNU Octave 2.0
MAT4
GNU Octave 2.1
MAT5
Portable Voice Format
PVF
Fasttracker 2
XI
HMM Tool Kit
HTK
Apple
CAF
Sound
Designer II
SD2
Free Lossless Audio Codec
FLAC
Unsigned 8 bit PCMR/WR/W R/W    R/WR/W R/W      
Signed 8 bit PCM R/WR/WR/WR/WR/WR/W     R/W  R/WR/WR/W
Signed 16 bit PCMR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/WR/W R/WR/WR/WR/W
Signed 24 bit PCMR/WR/WR/WR/WR/W R/WR/W R/W     R/WR/WR/W
Signed 32 bit PCMR/WR/WR/WR/W  R/WR/W R/WR/WR/WR/W  R/W  
32 bit floatR/WR/WR/WR/W   R/W R/WR/WR/W   R/W  
64 bit doubleR/WR/WR/WR/W     R/WR/WR/W   R/W  
u-law encodingR/WR/WR/WR/W  R/WR/WR/WR/W     R/W  
A-law encodingR/WR/WR/WR/W  R/WR/WR/WR/W     R/W  
IMA ADPCMR/W        R/W        
MS ADPCMR/W        R/W        
GSM 6.10R/WR/W R/W     R/W        
G721 ADPCM 32kbpsR/W R/W               
G723 ADPCM 24kbps  R/W               
G723 ADPCM 40kbps  R/W               
12 bit DWVW R/W R/W              
16 bit DWVW R/W R/W              
24 bit DWVW R/W R/W              
Ok Dialogic ADPCM   R/W              
8 bit DPCM             R/W    
16 bit DPCM             R/W    
- -

-From version 1.0.18, libsndfile also reads and writes - FLAC -and - Ogg/Vorbis. -

- - - -

- Some of the file formats I am also interested in adding are: -

-
    -
  • Kurzweil K2000 sampler files. -
  • Ogg Speex. -
-

- I have decided that I will not be adding support for MPEG Layer 3 (commonly - known as MP3) due to the patent issues surrounding this file format. - See - - the FAQ - for more. -

-

- Other file formats may also be added on request. -

- - - - -

History

-

- My first attempt at reading and writing WAV files was in 1990 or so under Windows - 3.1. - I started using Linux in early 1995 and contributed some code to the - wavplay - program. - That contributed code would eventually mutate into this library. - As one of my interests is Digital Signal Processing (DSP) I decided that as well as - reading data from an audio file in the native format (typically 16 bit short integers) - it would also be useful to be able to have the library do the conversion to floating - point numbers for DSP applications. - It then dawned on me that whatever file format (anything from 8 bit unsigned chars, - to 32 bit floating point numbers) the library should be able to convert the data to - whatever format the library user wishes to use it in. - For example, in a sound playback program, the library caller typically wants the sound - data in 16 bit short integers to dump into a sound card even though the data in the - file may be 32 bit floating point numbers (ie Microsoft's WAVE_FORMAT_IEEE_FLOAT - format). - Another example would be someone doing speech recognition research who has recorded - some speech as a 16 bit WAV file but wants to process it as double precision floating - point numbers. -

-

- Here is the release history for libsndfile : -

-
    -
  • Version 0.0.8 (Feb 15 1999) First official release. -
  • Version 0.0.28 (Apr 26 2002) Final release of version 0 of libsndfile. -
  • Version 1.0.0rc1 (Jun 24 2002) Release candidate 1 of version 1 of libsndfile. -
  • Version 1.0.0rc6 (Aug 14 2002) MacOS 9 fixes. -
  • Version 1.0.0 (Aug 16 2002) First 1.0.X release. -
  • Version 1.0.1 (Sep 14 2002) Added MAT4 and MAT5 file formats. -
  • Version 1.0.2 (Nov 24 2002) Added VOX ADPCM format. -
  • Version 1.0.3 (Dec 09 2002) Fixes for Linux on ia64 CPUs. -
  • Version 1.0.4 (Feb 02 2003) New file formats and functionality. -
  • Version 1.0.5 (May 03 2003) One new file format and new functionality. -
  • Version 1.0.6 (Feb 08 2004) Large file fix for Linux/Solaris, new functionality - and Win32 improvements. -
  • Version 1.0.7 (Feb 24 2004) Fix build problems on MacOS X and fix ia64/MIPS etc - clip mode detction. -
  • Version 1.0.8 (Mar 14 2004) Minor bug fixes. -
  • Version 1.0.9 (Mar 30 2004) Add AVR format. Improve handling of some WAV files. -
  • Version 1.0.10 (Jun 15 2004) Minor bug fixes. Fix support for Win32 MinGW compiler. -
  • Version 1.0.11 (Nov 15 2004) Add SD2 file support, reading of loop data in WAV and AIFF. - Minor bug fixes. -
  • Version 1.0.12 (Sep 30 2005) Add FLAC and CAF file support, virtual I/O interface. - Minor bug fixes and cleanups. -
  • Version 1.0.13 (Jan 21 2006) Add read/write of instrument chunks. Minor bug fixes. -
  • Version 1.0.14 (Feb 19 2006) Minor bug fixes. Start shipping windows binary/source ZIP. -
  • Version 1.0.15 (Mar 16 2006) Minor bug fixes. -
  • Version 1.0.16 (Apr 30 2006) Add support for RIFX. Other minor feature enhancements and - bug fixes. -
  • Version 1.0.17 (Aug 31 2006) Add C++ wrapper sndfile.hh. Minor bug fixes and cleanups. -
  • Version 1.0.18 (Feb 07 2009) Add Ogg/Vorbis suppport, remove captive libraries, many - new features and bug fixes. Generate Win32 and Win64 pre-compiled binaries. -
  • Version 1.0.19 (Mar 02 2009) Fix for CVE-2009-0186. Huge number of minor fixes as a - result of static analysis. -
  • Version 1.0.20 (May 14 2009) Fix for potential heap overflow. -
  • Version 1.0.21 (December 13 2009) Bunch of minor bug fixes. -
  • Version 1.0.22 (October 04 2010) Bunch of minor bug fixes. -
  • Version 1.0.23 (October 10 2010) Minor bug fixes. -
  • Version 1.0.24 (March 23 2011) Minor bug fixes. -
  • Version 1.0.25 (July 13 2011) Fix for Secunia Advisory SA45125. Minor bug fixes and - improvements. -
- - -

Similar or Related Projects

- -
    -
  • SoX is a program for - converting between sound file formats. -
  • Wavplay started out - as a minimal WAV file player under Linux and has mutated into Gnuwave, a client/server - application for more general multimedia and games sound playback. -
  • Audiofile (libaudiofile) is - a library similar to libsndfile but with a different programming interface. The - author Michael Pruett has set out to clone (and fix some bugs in) the libaudiofile - library which ships with SGI's IRIX OS. -
  • sndlib.tar.gz is - another library written by Bill Schottstaedt of CCRMA. -
- - -

Licensing

-

- libsndfile is released under the terms of the GNU Lesser General Public License, - of which there are two versions; - version 2.1 - and - version 3. - To maximise the compatibility of libsndfile, the user may choose to use libsndfile - under either of the above two licenses. - You can also read a simple explanation of the ideas behind the GPL and the LGPL - here. -

-

- You can use libsndfile with - Free Software, - Open Source, - proprietary, shareware or other closed source applications as long as libsndfile - is used as a dynamically loaded library and you abide by a small number of other - conditions (read the LGPL for more info). - With applications released under the GNU GPL you can also use libsndfile statically - linked to your application. -

-

- I would like to see libsndfile used as widely as possible but I would prefer it - if you released software that uses libsndfile as - Free Software - or - Open Source. - However, if you put in a great deal of effort building a significant application - which simply uses libsndfile for file I/O, then I have no problem with you releasing - that as closed source and charging as much money as you want for it as long as you - abide by the license. -

- - -

Download

-

- Here is the latest version. It is available in the following formats: -

- - -

-The Win32 installer was compiled for Windows XP but should also work on Windows -2000, Vista and Windows 7. -

- -

- Pre-release versions of libsndfile are available - here - and are announced on the - libsndfile-devel - mailing list. -

- - -

See Also

- - -

- -
- -

- The latest version of this document can be found - here. -

-

-Author : - - Erik de Castro Lopo -

- -

-This page has been accessed - counter.gif -times. -

- - - - -

- - diff --git a/libs/libsndfile/doc/libsndfile.css.in b/libs/libsndfile/doc/libsndfile.css.in deleted file mode 100644 index 40fca0f145..0000000000 --- a/libs/libsndfile/doc/libsndfile.css.in +++ /dev/null @@ -1,92 +0,0 @@ -body { - background : @HTML_BGCOLOUR@ ; - color : @HTML_FGCOLOUR@ ; - font-family : arial, helvetica, sans-serif ; - line-height: 1.5 ; -} -td { - font-family : arial, helvetica, sans-serif ; - background : @HTML_BGCOLOUR@ ; - color : @HTML_FGCOLOUR@ ; -} -center { - font-family : arial, helvetica, sans-serif ; -} -p { - font-family : arial, helvetica, sans-serif ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -.indent_block { - font-family : arial, helvetica, sans-serif ; - text-align : left ; - margin-left : 10% ; - margin-right : 10% ; -} -br { - font-family : arial, helvetica, sans-serif ; -} -form { - font-family : arial, helvetica, sans-serif ; -} -ul { - font-family : arial, helvetica, sans-serif ; - text-align : left ; - margin-left : 3% ; - margin-right : 6% ; -} -ol { - font-family : arial, helvetica, sans-serif ; - text-align : left ; - margin-left : 3% ; - margin-right : 6% ; -} -dl { - font-family : arial, helvetica, sans-serif ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -h1 { - font-size : xx-large ; - background : @HTML_BGCOLOUR@ ; - color : #5050FF ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -h2 { - font-size : x-large ; - background : @HTML_BGCOLOUR@ ; - color : #5050FF ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -h3 { - font-size : large ; - background : @HTML_BGCOLOUR@ ; - color : #5050FF ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -h4 { - font-size : medium ; - background : @HTML_BGCOLOUR@ ; - color : #5050FF ; - text-align : left ; - margin-left : 3% ; - margin-right : 3% ; -} -pre { - font-family : courier, monospace ; - font-size : medium ; - margin-left : 6% ; - margin-right : 6% ; -} -a:link { color : #9090FF ; } -a:visited { color : #5050FF ; } -a:active { color : #FF00FF ; } -a:hover { background-color : #202080 ; } diff --git a/libs/libsndfile/doc/linux_games_programming.txt b/libs/libsndfile/doc/linux_games_programming.txt deleted file mode 100644 index 747f59db26..0000000000 --- a/libs/libsndfile/doc/linux_games_programming.txt +++ /dev/null @@ -1,434 +0,0 @@ -# Here are some some emails I exchanged with a guy trying to use -# libsndfile version 1 with code from the book "Linux Games Programming" -# by John Hall. The email addresses have been changed to foil the spam -# bots. - -Date: Tue, 20 Jul 2004 22:49:21 +0100 -From: Paul -To: erikd@fake-domain-name.com -Subject: Can you help with a problem? -Date: Tue, 20 Jul 2004 22:49:21 +0100 - -Hi, - -I'm trying to get the source examples in the "Programming Linux Games" -(NoStarch, Loki Software + John R. Hall) which use sndfile.h/libsndfile. - -While I can guess some of the newer versions of function calls and -enumerations, there are some which I cannot guess. - -Would you be able to translate them to the current version of -enumeration and function calls so that I can update the source? - -These are the three currently failing me: - - sf_open_read(filename, SF_INFO *sfinfo) (guess: sf_open(filename,SFM_READ, &sfinfo)) - SF_FORMAT_PCM (guess: either SF_FORMAT_PCM_U8 or _RAW) - SF_INFO.pcmbitwidth (guess: no idea!) - -There are probably more. I'm happy to send you the source files for -sound calls, scan the pages or anything else. Failing that, is there -somewhere with the changes listed so I can try and fix the code for myself? - -Thanks - -TTFN - -Paul - -================================================================================ - -Date: Wed, 21 Jul 2004 17:38:08 +1000 -From: Erik de Castro Lopo -To: Paul -Subject: Re: Can you help with a problem? - -On Tue, 20 Jul 2004 22:49:21 +0100 -Paul wrote: - -> Hi, -> -> I'm trying to get the source examples in the "Programming Linux Games" -> (NoStarch, Loki Software + John R. Hall) which use sndfile.h/libsndfile. -> -> While I can guess some of the newer versions of function calls and -> enumerations, there are some which I cannot guess. -> -> Would you be able to translate them to the current version of -> enumeration and function calls so that I can update the source? -> -> These are the three currently failing me: -> -> sf_open_read(filename, SF_INFO *sfinfo) (guess: sf_open(filename, -> SFM_READ, &sfinfo)) - -yes. - -> SF_FORMAT_PCM (guess: either SF_FORMAT_PCM_U8 or _RAW) - -Actually this list: - - SF_FORMAT_PCM_U8 - SF_FORMAT_PCM_S8 - SF_FORMAT_PCM_16 - SF_FORMAT_PCM_24 - SF_FORMAT_PCM_32 - -> SF_INFO.pcmbitwidth (guess: no idea!) - -WIth the above change, pcmbitwidth becomes redundant. - -> There are probably more. I'm happy to send you the source files for -> sound calls, scan the pages or anything else. Failing that, is there -> somewhere with the changes listed so I can try and fix the code for -> myself? - -Version 1.0.0 came out some time ago, but I think this: - - http://www.mega-nerd.com/libsndfile/version-1.html - -lists most of the changes. You should also look at the API docs: - - http://www.mega-nerd.com/libsndfile/api.html - -HTH, -Erik --- -+-----------------------------------------------------------+ - Erik de Castro Lopo nospam@fake-domain-name.com -+-----------------------------------------------------------+ -"There is no reason why anyone would want a computer in their home" -Ken Olson, DEC, 1977 - -================================================================================ - -From: PFJ -To: Erik de Castro Lopo -Subject: Re: Can you help with a problem? -Date: Wed, 21 Jul 2004 09:07:39 +0100 - - -Hi Erik, - -Thanks for getting back to me. - -> > sf_open_read(filename, SF_INFO *sfinfo) (guess: sf_open(filename, SFM_READ, &sfinfo)) -> -> yes. - -Yay! - -> > SF_FORMAT_PCM (guess: either SF_FORMAT_PCM_U8 or _RAW) -> -> Actually this list: -> -> SF_FORMAT_PCM_U8 -> SF_FORMAT_PCM_S8 -> SF_FORMAT_PCM_16 -> SF_FORMAT_PCM_24 -> SF_FORMAT_PCM_32 - -I know, but the source code explicitly has SF_FORMAT_PCM which given the -code afterwards would equate to one of the above, but given that PCM -files can have a varied bitwidth the author probably wanted to cover all -bases. - -> Version 1.0.0 came out some time ago, but I think this: -> -> http://www.mega-nerd.com/libsndfile/version-1.html -> -> lists most of the changes. You should also look at the API docs: -> -> http://www.mega-nerd.com/libsndfile/api.html - -I'll download them and see what I can gleen. - -Thanks again for getting back to me - -TTFN - -Paul - -================================================================================ - -Date: Wed, 21 Jul 2004 18:20:29 +1000 -From: Erik de Castro Lopo -To: PFJ -Subject: Re: Can you help with a problem? - -On Wed, 21 Jul 2004 09:07:39 +0100 -PFJ wrote: - -> I know, but the source code explicitly has SF_FORMAT_PCM which given the -> code afterwards would equate to one of the above, but given that PCM -> files can have a varied bitwidth the author probably wanted to cover all -> bases. - -But surely the existing code does something like: - - sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM; - sfinfo.pcmbitwidth = 16; - -which can be directly translated to: - - sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16; - -and the same for pcmbitwitdhs of 24 and 32. For pcmbitwidth of 8 -you need to know that WAV files use SF_FORMAT_PCM_U8 and AIFF -files use SF_FORMAT_PCM_S8. Thats all there is to it. - -Erik --- -+-----------------------------------------------------------+ - Erik de Castro Lopo nospam@fake-domain-name.com -+-----------------------------------------------------------+ -"Python addresses true pseudocode's two major failings: that it -isn't standardized, and it isn't executable." -- Grant R. Griffin in comp.dsp - -================================================================================ - -Subject: Re: Can you help with a problem? -From: PFJ -To: Erik de Castro Lopo -Date: Wed, 21 Jul 2004 09:50:55 +0100 - -Hi Erik, - -> > I know, but the source code explicitly has SF_FORMAT_PCM which given the -> > code afterwards would equate to one of the above, but given that PCM -> > files can have a varied bitwidth the author probably wanted to cover all -> > bases. -> -> But surely the existing code does something like: -> -> sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM; -> sfinfo.pcmbitwidth = 16; - -If only! - -The actual code is this - -int LoadSoundFile(char *filename, sound_p sound) -{ - SNDFILE *file; - SF_INFO file_info; - short *buffer_short = NULL; - u_int8_t *buffer_8 = NULL; - int16_t *buffer_16 = NULL; - unsigned int i; - - /* Open the file and retrieve sample information. */ - file = sf_open_read(filename, &file_info); - // I've sorted this one already - PFJ - - /* Make sure the format is acceptable. */ - if ((file_info.format & 0x0F) != SF_FORMAT_PCM) { - printf("'%s' is not a PCM-based audio file.\n", filename); - sf_close(file); - return -1; - } - - if ((file_info.pcmbitwidth == 8) && (file_info.channels == 1)) { - sound->format = AL_FORMAT_MONO8; - } else if ((file_info.pcmbitwidth == 8) && (file_info.channels == 2)) { - sound->format = AL_FORMAT_STEREO8; - } else if ((file_info.pcmbitwidth == 16) && (file_info.channels == 1)) { - sound->format = AL_FORMAT_MONO16; - } else if ((file_info.pcmbitwidth == 16) && (file_info.channels == 2)) { - sound->format = AL_FORMAT_STEREO16; - } else { - printf("Unknown sample format in %s.\n", filename); - sf_close(file); - return -1; - } - - /* Allocate buffers. */ - buffer_short = (short *)malloc(file_info.samples * file_info.channels * sizeof (short)); - - buffer_8 = (u_int8_t *)malloc(file_info.samples * file_info.channels * file_info.pcmbitwidth / 8); - - buffer_16 = (int16_t *)buffer_8; - - if (buffer_short == NULL || buffer_8 == NULL) { - printf("Unable to allocate enough memory for '%s'.\n", filename); - goto error_cleanup; - } - - /* Read the entire sound file. */ - if (sf_readf_short(file,buffer_short,file_info.samples) == (size_t)-1) { - printf("Error while reading samples from '%s'.\n", filename); - goto error_cleanup; - } - - - - /* Fill in the sound data structure. */ - sound->freq = file_info.samplerate; - sound->size = file_info.samples * file_info.channels * file_info.pcmbitwidth / 8; - - /* Give our sound data to OpenAL. */ - alGenBuffers(1, &sound->name); - if (alGetError() != AL_NO_ERROR) { - printf("Error creating an AL buffer name for %s.\n", filename); - goto error_cleanup; - } - - alBufferData(sound->name, sound->format, buffer_8, sound->size,sound->freq); - if (alGetError() != AL_NO_ERROR) { - printf("Error sending buffer data to OpenAL for %s.\n", filename); - goto error_cleanup; - } - - /* Close the file and return success. */ - sf_close(file); - free(buffer_short); - free(buffer_8); - - return 0; - - error_cleanup: - if (file != NULL) fclose(file); - free(buffer_short); - free(buffer_8); - return -1; -} - -As you can see, the PCM material in the listing will not currently -compile and for the other sndfile material, it probably won't either. - -Any help would be appreciated. - -TTFN - -Paul - -================================================================================ - -From: Erik de Castro Lopo -To: PFJ -Subject: Re: Can you help with a problem? -Date: Wed, 21 Jul 2004 19:36:46 +1000 - -On Wed, 21 Jul 2004 09:50:55 +0100 -PFJ wrote: - -> Hi Erik, -> -> > > I know, but the source code explicitly has SF_FORMAT_PCM which given the -> > > code afterwards would equate to one of the above, but given that PCM -> > > files can have a varied bitwidth the author probably wanted to cover all -> > > bases. -> > -> > But surely the existing code does something like: -> > -> > sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM; -> > sfinfo.pcmbitwidth = 16; -> -> If only! - -No, really. - -Drop this completely: - -> /* Make sure the format is acceptable. */ -> if ((file_info.format & 0x0F) != SF_FORMAT_PCM) { -> printf("'%s' is not a PCM-based audio file.\n", filename); -> sf_close(file); -> return -1; -> } - -Replace this block: - -> if ((file_info.pcmbitwidth == 8) && (file_info.channels == 1)) { -> sound->format = AL_FORMAT_MONO8; -> } else if ((file_info.pcmbitwidth == 8) && (file_info.channels == 2)) { -> sound->format = AL_FORMAT_STEREO8; -> } else if ((file_info.pcmbitwidth == 16) && (file_info.channels == 1)) { -> sound->format = AL_FORMAT_MONO16; -> } else if ((file_info.pcmbitwidth == 16) && (file_info.channels == 2)) { -> sound->format = AL_FORMAT_STEREO16; -> } else { -> printf("Unknown sample format in %s.\n", filename); -> sf_close(file); -> return -1; -> } - -with: - - int pcmbitwidth = 0; - - if (file_info.format & SF_FORMAT_SUBMASK != SF_FORMAT_PCM_16) - { printf("'%s' is not a PCM-based audio file.\n", filename); - sf_close(file); - return -1; - } - - if (file_info.channels < 1 || file_info.channels > 2) - { printf("'%s' bad channel count.\n", filename); - sf_close(file); - return -1; - } - - switch (file_info.format & SF_FORMAT_SUBMASK + file_info.channels << 16) - { case (SF_FORMAT_PCM_U8 + 1 << 16): - sound->format = AL_FORMAT_MONO8; - pcmbitwidth = 8; - break; - case (SF_FORMAT_PCM_U8 + 2 << 16): - sound->format = AL_FORMAT_STEREO8; - pcmbitwidth = 8; - break; - case (SF_FORMAT_PCM_16 + 1 << 16): - sound->format = AL_FORMAT_MONO16; - pcmbitwidth = 16; - break; - case (SF_FORMAT_PCM_16 + 2 << 16): - sound->format = AL_FORMAT_STEREO16; - pcmbitwidth = 16; - break; - default: - printf("Unknown sample format in %s.\n", filename); - sf_close(file); - return -1; - } - -> /* Allocate buffers. */ -> buffer_short = (short *)malloc(file_info.samples * -> file_info.channels * -> sizeof (short)); -> -> buffer_8 = (u_int8_t *)malloc(file_info.samples * -> file_info.channels * -> file_info.pcmbitwidth / 8); - -Use pcmbitwidth as calculated above. - -> buffer_16 = (int16_t *)buffer_8; -> -> if (buffer_short == NULL || buffer_8 == NULL) { -> printf("Unable to allocate enough memory for '%s'.\n", filename); -> goto error_cleanup; -> } -> -> /* Read the entire sound file. */ -> if (sf_readf_short(file,buffer_short,file_info.samples) == (size_t)- 1) { - -Replace "(size_t) - 1" with " < 0". - -> As you can see, the PCM material in the listing will not currently -> compile and for the other sndfile material, it probably won't either. - -None of the changes above should have been very difficult to figure -out. - -Erik --- -+-----------------------------------------------------------+ - Erik de Castro Lopo nospam@fake-domain-name.com -+-----------------------------------------------------------+ -Microsoft is finally bringing all of its Windows operating system families -under one roof. It will combine all of the features of CE, stability and -support of ME and the speed of NT. -It will be called Windows CEMENT... - diff --git a/libs/libsndfile/doc/lists.html b/libs/libsndfile/doc/lists.html deleted file mode 100644 index 7d95170271..0000000000 --- a/libs/libsndfile/doc/lists.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - libsndfile Mailing Lists - - - - - - - - -


libsndfile Mailing Lists

- -

-There are three mailing lists for libsndfile: -

- -
    -
  • libsndfile-announce@mega-nerd.com   - Subscribe -
    - A list which will announce each new release of libsndfile. - Noone can post to this list except the author. -

    - -
  • libsndfile-devel@mega-nerd.com   - Subscribe -
    - A list for discussing bugs, porting issues and feature requests. - Posting is restricted to subscribers. -

    - -
  • libsndfile-users@mega-nerd.com   - Subscribe -
    - A list for discussing the use of libsndfile in other programs. - Posting is restricted to subscribers. - -

    -
- -

-The libsndfile-devel and libsndfile-users list will automatically receive a -copy of all emails to the libsndfile-announce list. -

-
- - - diff --git a/libs/libsndfile/doc/new_file_type.HOWTO b/libs/libsndfile/doc/new_file_type.HOWTO deleted file mode 100644 index a6da80aeff..0000000000 --- a/libs/libsndfile/doc/new_file_type.HOWTO +++ /dev/null @@ -1,135 +0,0 @@ -new_file_type.HOWTO -=================== - - Original : Wed May 23 19:05:07 EST 2001 - Update 1 : Fri Jul 11 22:12:38 EST 2003 - -This document will attempt to explain as fully as possible how to add code to -libsndfile to allow the reading and writing of new file types. By new file -type I particularly mean a new header type rather than a new encoding method -for an existing file type. - -This HOWTO will take the form of a step by step guide. It will assume that you -have all required tools including : - - - gcc - - make (should really be the GNU version) - - autoconf - - automake - - libtool - -These should all be available on the GNU ftp site: ftp://ftp.gnu.org/pub/gnu/. - -To help make these steps clearer let's suppose we are adding support for the -Whacky file format whose files contain 'W','A','C' and 'K' as the first four -bytes of the file format. Lets also assume that Whacky files contain PCM encoded -data. - -Step 1 ------- -Create a new .c file in the src/ directory of the libsndfile source tree. The -file name should be reasonable descriptive so that is is obvious that files of -the new type are handled by this file. In this particular case the file might -be named 'whacky.c'. - -Step 2 ------- -Add your new source code file to the build process. - -Edit the file src/Makefile.am and add the name of your file handler to the -FILESPECIFIC list of handlers. This list looks something like this: - -FILESPECIFIC = aiff.c au.c au_g72x.c nist.c paf.c raw.c samplitude.c \ - svx.c wav.c wav_float.c wav_gsm610.c wav_ima_adpcm.c \ - wav_ms_adpcm.c - -Then, run the script named 'reconf' in the libsndfile top level directory, -which will run autoconf and other associated tools. Finally run "./configure" -in the top level directory. You may want to use the "--disable-gcc-opt" option -to disable gcc optimisations and make debugging with gdb/ddd easier. - -Step 3 ------- -Add a unique identifier for the new file type. - -Edit src/sndfile.h.in and find the enum containing the SF_FORMAT_XXX identifiers. -Since you will be adding a major file type you should add your identifier to the -top part of the list where the values are above 0x10000 in value. The easiest -way to do this is to find the largest value in the list, add 0x10000 to it and -make that your new identifier value. The identifier should be something like -SF_FORMAT_WACK. - -Step 4 ------- -Add code to the file type recogniser function. - -Edit src/sndfile.c and find the function guess_file_type (). This function -reads the first 3 ints of the file and from that makes a guess at the file -type. In our case we would add: - - - if (buffer [0] == MAKE_MARKER ('W','A','C','K')) - return SF_FORMAT_WACK ; - -The use of the MAKE_MARKER macro should be pretty obvious and it is defined at the -top of file should you need to have a look at it. - -Step 5 ------- -Add a call to your open function from psf_open_file (). - -Edit src/sndfile.c and find the switch statement in psf_open_file (). It starts -like this: - - switch (filetype) - { case SF_FORMAT_WAV : - error = wav_open (psf) ; - break ; - - case SF_FORMAT_AIFF : - error = aiff_open (psf) ; - break ; - -Towards the bottom of this switch statement your should add one for the new file -type. Something like: - - case SF_FORMAT_WACK : - sf_errno = whacky_open (psf) ; - break ; - -Setp 6 ------- -Add prototypes for new open read and open write functions. - -Edit src/common.h, go to the bottom of the file and add something like - - int whacky_open (SF_PRIVATE *psf) ; - -Step 7 ------- - -Implement your open read function. The best way to do this is by coding -something much like one of the other file formats. The file src/au.c might be -a good place to start. - -In src/whacky.c you should now implement the function whacky_open() which -was prototyped in src/common.h. This function should return 0 on success and -a non-zero number on error. - -Error values are defined in src/common.h in a enum which starts at SFE_NO_ERROR. -When adding a new error value, you also need to add an error string to the -SndfileErrors array in src/sndfile.c. - -To parse the header of your new file type you should avoid using standard read/ -write/seek functions (and the fread/fwrite/fseek etc) and instead use -psf_binheader_readf () which is implemented and documented in src/common.h. - -During the parsing process, you should also print logging information to -libsndfile's internal log buffer using the psf_log_printf() function. - -At the end of the open read process, you should have set a number of fields in the -SF_PRIVATE structure pointed to by psf. - - - -*** THIS FILE IS INCOMPLETE *** diff --git a/libs/libsndfile/doc/octave.html b/libs/libsndfile/doc/octave.html deleted file mode 100644 index b696e6b81a..0000000000 --- a/libs/libsndfile/doc/octave.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - libsndfile and GNU Octave - - - - - - - - -
-

libsndfile and GNU Octave

-

- GNU Octave is a high-level interactive - language for numerical computations. - There are currently two development streams, a stable 2.0.X series and a - development 2.1.X series. - Octave reads and writes data in binary formats that were originally developed - for - MATLAB. - Version 2.0.X of Octave uses binary data files compatible with MATLAB - version 4.2 while Octave 2.1.X uses binary data files compatible - with MATLAB version 5.0 as well as being able to read the older MATLAB 4.2 - format. -

-

- From version 1.0.1 of libsndfile onwards, libsndfile has the ability of reading - and writing a small subset of the binary data files used by both versions - of GNU Octave. - This gives people using GNU Octave for audio based work an easy method of - moving audio data between GNU Octave and other programs which use libsndfile. -

-

- For instance it is now possible to do the following: -

- -
    -
  • Load a WAV file into a sound file editor such as - Sweep. -
  • Save it as a MAT4 file. -
  • Load the data into Octave for manipulation. -
  • Save the modified data. -
  • Reload it in Sweep. -
-

- Another example would be using the MAT4 or MAT5 file formats as a format which - can be easily loaded into Octave for viewing/analyzing as well as a format - which can be played with command line players such as the one included with - libsndfile. -

- -

Details

-

- Octave, like most programming languages, uses variables to store data, and - Octave variables can contain both arrays and matrices. - It is also able to store one or more of these variables in a file. - When reading Octave files, libsndfile expects a file to contain two - variables and their associated data. - The first variable should contain a variable holding the file sample rate - while the second variable contains the audio data. -

-

- For example, to generate a sine wave and store it as a binary file which - is compatible with libsndfile, do the following: -

-
-        octave:1 > samplerate = 44100 ;
-        octave:2 > wavedata = sin ((0:1023)*2*pi/1024) ;
-        octave:3 > save sine.mat samplerate wavedata
-
- -

- The process of reading and writing files compatible with libsndfile can be - made easier by use of two Octave script files : -

-
-        octave:4 > [data fs] = sndfile_load ("sine.mat") ;
-        octave:5 > sndfile_save ("sine2.mat", data, fs) ;
-
-

- In addition, libsndfile contains a command line program which which is able - to play the correct types of Octave files. - Using this command line player sndfile-play and a third Octave script - file allows Octave data to be played from within Octave on any of the platforms - which sndfile-play supports (at the moment: Linux, MacOS X, Solaris and - Win32). -

-
-        octave:6 > sndfile_play (data, fs) ;
-
-

- These three Octave scripts are installed automatically in Octave's site - script directory when libsndfile is installed (except on Win32) ie when - libsndfile is being installed into /usr/local, the Octave scripts will - be installed in /usr/local/share/octave/site/m/. -

- -

- There are some other Octave scripts for audio to be found - here. -

- -
- - -
-

- The libsndfile home page is here : - - http://www.mega-nerd.com/libsndfile/. -

- - - diff --git a/libs/libsndfile/doc/pkgconfig.html b/libs/libsndfile/doc/pkgconfig.html deleted file mode 100644 index c89193d1ed..0000000000 --- a/libs/libsndfile/doc/pkgconfig.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - libsndfile : pkg-config - - - - - - - - -
-

libsndfile and pkg-config

- -

- From version 1.0.0 libsndfile has had the ability to read and write files of - greater than 2 Gig in size on most OSes even if sizeof (long) == 4. - OSes which support this feature include Linux (2.4 kernel, glibc6) on x86, PPC and - probably others, Win32, MacOS X, *BSD, Solaris and probably others. - OSes on 64 bit processors where the default compile environment is LP64 (longs and - pointers are 64 bit ie Linux on DEC/Compaq/HP Alpha processors) automatically - support large file access. -

-

- Other OSes including Linux on 32 bit processors, 32 bit Solaris and others require - special compiler flags to add large file support. - This applies to both the compilation of the library itself and the compilation of - programs which link to the library. -

-

- Note : People using Win32, MacOS (both OS X and pre-OS X) or *BSD can disregard the - rest of this document as it does not apply to either of these OSes. -

-

- The pkg-config program makes finding the correct compiler flag values and - library location far easier. - During the installation of libsndfile, a file named sndfile.pc is installed - in the directory ${libdir}/pkgconfig (ie if libsndfile is installed in - /usr/local/lib, sndfile.pc will be installed in - /usr/local/lib/pkgconfig/). -

-

- In order for pkg-config to find sndfile.pc it may be necessary to point the - environment variable PKG_CONFIG_PATH in the right direction. -

-
-        export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
-	
- -

- Then, to compile a C file into an object file, the command would be: -

-
-        gcc `pkg-config --cflags sndfile` -c somefile.c
-	
-

- and to link a number of objects into an executable that links against libsndfile, - the command would be: -

-
-        gcc `pkg-config --libs sndfile` obj1.o obj2.o -o program
-	
- -

- Obviously all this can be rolled into a Makefile for easier maintenance. -

- - diff --git a/libs/libsndfile/doc/print.css b/libs/libsndfile/doc/print.css deleted file mode 100644 index deb5b13da0..0000000000 --- a/libs/libsndfile/doc/print.css +++ /dev/null @@ -1,14 +0,0 @@ -body { - background:white; - color:black; -} - -h1{ - background:white; - color:black; -} - -h2 { - background:white; - color:#666; -} diff --git a/libs/libsndfile/doc/sndfile_info.html b/libs/libsndfile/doc/sndfile_info.html deleted file mode 100644 index a84f24150f..0000000000 --- a/libs/libsndfile/doc/sndfile_info.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - sndfile-info - - - - - - - - -

- Here is an example of the output from the sndfile-info program distributed with - libsndfile. -

- -

- This file was opened and parsed correctly but had been truncated so that the values - in the FORM and SSND chunks were incorrect. -

-
-        erikd@hendrix > examples/sndfile-info truncated.aiff 
-        truncated.aiff
-        size : 200000
-        FORM : 307474 (should be 199992)
-         AIFF
-         COMM : 18
-          Sample Rate : 16000
-          Samples     : 76857
-          Channels    : 2
-          Sample Size : 16
-         SSND : 307436 (should be 199946)
-          Offset     : 0
-          Block Size : 0
-        
-        --------------------------------
-        Sample Rate : 16000
-        Frames      : 76857
-        Channels    : 2
-        Bit Width   : 16
-        Format      : 0x00020001
-        Sections    : 1
-        Seekable    : TRUE
-        Signal Max  : 32766
-        	
-
- - - - diff --git a/libs/libsndfile/doc/tutorial.html b/libs/libsndfile/doc/tutorial.html deleted file mode 100644 index e3112393ad..0000000000 --- a/libs/libsndfile/doc/tutorial.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - libsndfile Tutorial - - - - - - - - -


libsndfile Tutorial

- -

-More coming soon. -

- -

-For now, the best place to look for example code is the examples/ -directory of the source code distribution and the libsndfile test suite which -is located in the tests/ directory of the source code distribution. -

- - - - - - - - - diff --git a/libs/libsndfile/doc/win32.html b/libs/libsndfile/doc/win32.html deleted file mode 100644 index 6ee3153c7d..0000000000 --- a/libs/libsndfile/doc/win32.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - Building libsndfile on Win32 - - - - - - - - -


Building libsndfile on Win32

- -

-Note : For pre-compiled binaries for windows, both for win32 and win64, see the -main web page. -

- -

-There is currently only one way of building libsndfile for Win32 and Win64; -cross compiling from Linux using the MinGW cross compiler. -

- -

-libsndfile is written to be compiled by a compiler which supports large -chunks of the 1999 ISO C Standard. -Unfortunately, the microsoft compiler supports close to nothing of this -standard and hence is not suitable for libsndfile. -

- -

-It may be possible to compile libsndfile on windows using the - MinGW -compiler suite, but I haven't tested that and have no interest in supporting -that. -

- - - - - - -
- - - - - - - diff --git a/libs/libsndfile/echo-install-dirs.in b/libs/libsndfile/echo-install-dirs.in deleted file mode 100644 index 48d54b4e2d..0000000000 --- a/libs/libsndfile/echo-install-dirs.in +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# @configure_input@ - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -bindir=@bindir@ -pkgconfigdir=@pkgconfigdir@ -datadir=@datadir@ -datarootdir=@datarootdir@ -docdir=@docdir@ -htmldir=@htmldir@ - -echo " - Installation directories : - - Library directory : ................... $libdir - Program directory : ................... $bindir - Pkgconfig directory : ................. $pkgconfigdir - HTML docs directory : ................. $htmldir -" -echo "Compiling some other packages against libsndfile may require" -echo "the addition of '$pkgconfigdir' to the" -echo "PKG_CONFIG_PATH environment variable." -echo diff --git a/libs/libsndfile/examples/Makefile.am b/libs/libsndfile/examples/Makefile.am deleted file mode 100644 index da841fa218..0000000000 --- a/libs/libsndfile/examples/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -## Process this file with automake to produce Makefile.in - -noinst_PROGRAMS = make_sine sfprocess list_formats generate sndfilehandle sndfile-to-text - -AM_CPPFLAGS = -I$(top_srcdir)/src - -sndfile_to_text_SOURCES = sndfile-to-text.c -sndfile_to_text_LDADD = $(top_builddir)/src/libsndfile.la - -make_sine_SOURCES = make_sine.c -make_sine_LDADD = $(top_builddir)/src/libsndfile.la - -sfprocess_SOURCES = sfprocess.c -sfprocess_LDADD = $(top_builddir)/src/libsndfile.la - -list_formats_SOURCES = list_formats.c -list_formats_LDADD = $(top_builddir)/src/libsndfile.la - -generate_SOURCES = generate.c -generate_LDADD = $(top_builddir)/src/libsndfile.la - -sndfilehandle_SOURCES = sndfilehandle.cc -sndfilehandle_LDADD = $(top_builddir)/src/libsndfile.la - -CLEANFILES = *~ *.exe diff --git a/libs/libsndfile/examples/cooledit-fixer.c b/libs/libsndfile/examples/cooledit-fixer.c deleted file mode 100644 index 06ceae6a92..0000000000 --- a/libs/libsndfile/examples/cooledit-fixer.c +++ /dev/null @@ -1,231 +0,0 @@ -/* -** Copyright (C) 2002-2005 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include -#include - -#include - -#define BUFFER_LEN 1024 - -static void usage_exit (char *progname) ; -static int is_data_really_float (SNDFILE *sndfile) ; -static void fix_file (char *filename) ; -static off_t file_size (char *filename) ; - -static union -{ int i [BUFFER_LEN] ; - float f [BUFFER_LEN] ; -} buffer ; - -int -main (int argc, char *argv []) -{ SNDFILE *sndfile ; - SF_INFO sfinfo ; - int k, data_is_float, converted = 0 ; - - puts ("\nCooledit Fixer.\n---------------") ; - - if (argc < 2) - usage_exit (argv [0]) ; - - for (k = 1 ; k < argc ; k++) - { if ((sndfile = sf_open (argv [k], SFM_READ, &sfinfo)) == NULL) - { /*-printf ("Failed to open : %s\n", argv [k]) ;-*/ - continue ; - } ; - - if (sfinfo.format != (SF_FORMAT_WAV | SF_FORMAT_PCM_32)) - { /*-printf ("%-50s : not a 32 bit PCM WAV file.\n", argv [k]) ;-*/ - sf_close (sndfile) ; - continue ; - } ; - - data_is_float = is_data_really_float (sndfile) ; - - sf_close (sndfile) ; - - if (data_is_float == SF_FALSE) - { /*-printf ("%-50s : not a Cooledit abomination.\n", argv [k]) ;-*/ - continue ; - } ; - - fix_file (argv [k]) ; - converted ++ ; - } ; - - if (converted == 0) - puts ("\nNo files converted.") ; - - puts ("") ; - - return 0 ; -} /* main */ - - -static void -usage_exit (char *progname) -{ char *cptr ; - - if ((cptr = strrchr (progname, '/'))) - progname = cptr + 1 ; - if ((cptr = strrchr (progname, '\\'))) - progname = cptr + 1 ; - - printf ("\n Usage : %s \n", progname) ; - puts ("\n" - "Fix broken files created by Syntrillium's Cooledit. These files are \n" - "marked as containing PCM data but actually contain floating point \n" - "data. Only the broken files created by Cooledit are processed. All \n" - "other files remain untouched.\n" - "\n" - "More than one file may be included on the command line. \n" - ) ; - - exit (1) ; -} /* usage_exit */ - -static int -is_data_really_float (SNDFILE *sndfile) -{ int k, readcount ; - - while ((readcount = sf_read_int (sndfile, buffer.i, BUFFER_LEN)) > 0) - { for (k = 0 ; k < readcount ; k++) - { if (buffer.i [k] == 0) - continue ; - - if (fabs (buffer.f [k]) > 32768.0) - return SF_FALSE ; - } ; - } ; - - return SF_TRUE ; -} /* is_data_really_float */ - -static void -fix_file (char *filename) -{ static char newfilename [512] ; - - SNDFILE *infile, *outfile ; - SF_INFO sfinfo ; - int readcount, k ; - float normfactor ; - char *cptr ; - - printf ("\nFixing : %s\n", filename) ; - - if ((infile = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Not able to open input file %s\n", filename) ; - exit (1) ; - } ; - - if (strlen (filename) >= sizeof (newfilename) - 1) - { puts ("Error : Path name too long.\n") ; - exit (1) ; - } ; - - strncpy (newfilename, filename, sizeof (newfilename)) ; - newfilename [sizeof (newfilename) - 1] = 0 ; - - if ((cptr = strrchr (newfilename, '/')) == NULL) - cptr = strrchr (newfilename, '\\') ; - - if (cptr) - { cptr [1] = 0 ; - strncat (newfilename, "fixed.wav", sizeof (newfilename) - strlen (newfilename) - 1) ; - } - else - strncpy (newfilename, "fixed.wav", sizeof (newfilename) - 1) ; - - newfilename [sizeof (newfilename) - 1] = 0 ; - - printf (" Output : %s\n", newfilename) ; - - sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_FLOAT ; - - if ((outfile = sf_open (newfilename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("Not able to output open file %s\n", filename) ; - exit (1) ; - } ; - - /* Find the file peak. sf-command (SFC_CALC_SIGNAL_MAX) cannot be used. */ - - normfactor = 0.0 ; - - while ((readcount = sf_read_int (infile, buffer.i, BUFFER_LEN)) > 0) - { for (k = 0 ; k < readcount ; k++) - if (fabs (buffer.f [k]) > normfactor) - normfactor = fabs (buffer.f [k]) ; - } ; - - printf (" Peak : %g\n", normfactor) ; - - normfactor = 1.0 / normfactor ; - - sf_seek (infile, 0, SEEK_SET) ; - - while ((readcount = sf_read_int (infile, buffer.i, BUFFER_LEN)) > 0) - { for (k = 0 ; k < readcount ; k++) - buffer.f [k] *= normfactor ; - sf_write_float (outfile, buffer.f, readcount) ; - } ; - - sf_close (infile) ; - sf_close (outfile) ; - - if (abs (file_size (filename) - file_size (newfilename)) > 50) - { puts ("Error : file size mismatch.\n") ; - exit (1) ; - } ; - - printf (" Renaming : %s\n", filename) ; - - if (remove (filename) != 0) - { perror ("rename") ; - exit (1) ; - } ; - - if (rename (newfilename, filename) != 0) - { perror ("rename") ; - exit (1) ; - } ; - - return ; -} /* fix_file */ - -static off_t -file_size (char *filename) -{ struct stat buf ; - - if (stat (filename, &buf) != 0) - { perror ("stat") ; - exit (1) ; - } ; - - return buf.st_size ; -} /* file_size */ -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 5475655e-3898-40ff-969b-c8ab2351b0e4 -*/ diff --git a/libs/libsndfile/examples/generate.c b/libs/libsndfile/examples/generate.c deleted file mode 100644 index 884e8d79d3..0000000000 --- a/libs/libsndfile/examples/generate.c +++ /dev/null @@ -1,133 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include - -#define BUFFER_LEN 4096 - -static void encode_file (const char *infilename, const char *outfilename, int filetype) ; - -int -main (int argc, char **argv) -{ - if (argc != 2) - { puts ("\nEncode a single input file into a number of different output ") ; - puts ("encodings. These output encodings can then be moved to another ") ; - puts ("OS for testing.\n") ; - puts (" Usage : generate \n") ; - exit (1) ; - } ; - - /* A couple of standard WAV files. Make sure Win32 plays these. */ - encode_file (argv [1], "pcmu8.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_U8) ; - encode_file (argv [1], "pcm16.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - encode_file (argv [1], "imaadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM) ; - encode_file (argv [1], "msadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM) ; - encode_file (argv [1], "gsm610.wav" , SF_FORMAT_WAV | SF_FORMAT_GSM610) ; - - /* Soundforge W64. */ - encode_file (argv [1], "pcmu8.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_U8) ; - encode_file (argv [1], "pcm16.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_16) ; - encode_file (argv [1], "imaadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_MS_ADPCM) ; - encode_file (argv [1], "msadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_IMA_ADPCM) ; - encode_file (argv [1], "gsm610.w64" , SF_FORMAT_W64 | SF_FORMAT_GSM610) ; - - return 0 ; -} /* main */ - -/*============================================================================================ -** Helper functions and macros. -*/ - -#define PUT_DOTS(k) \ - { while (k--) \ - putchar ('.') ; \ - putchar (' ') ; \ - } - -/*======================================================================================== -*/ - -static void -encode_file (const char *infilename, const char *outfilename, int filetype) -{ static float buffer [BUFFER_LEN] ; - - SNDFILE *infile, *outfile ; - SF_INFO sfinfo ; - int k, readcount ; - - printf (" %s -> %s ", infilename, outfilename) ; - fflush (stdout) ; - - k = 16 - strlen (outfilename) ; - PUT_DOTS (k) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if (! (infile = sf_open (infilename, SFM_READ, &sfinfo))) - { printf ("Error : could not open file : %s\n", infilename) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } - - sfinfo.format = filetype ; - - if (! sf_format_check (&sfinfo)) - { sf_close (infile) ; - printf ("Invalid encoding\n") ; - return ; - } ; - - if (! (outfile = sf_open (outfilename, SFM_WRITE, &sfinfo))) - { printf ("Error : could not open file : %s\n", outfilename) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - while ((readcount = sf_read_float (infile, buffer, BUFFER_LEN)) > 0) - sf_write_float (outfile, buffer, readcount) ; - - sf_close (infile) ; - sf_close (outfile) ; - - printf ("ok\n") ; - - return ; -} /* encode_file */ - diff --git a/libs/libsndfile/examples/generate.cs b/libs/libsndfile/examples/generate.cs deleted file mode 100644 index 1817856fa7..0000000000 --- a/libs/libsndfile/examples/generate.cs +++ /dev/null @@ -1,250 +0,0 @@ -/* (c) 2004 James Robson, http://www.arbingersys.com -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -** -** **************************** -** -** How to use: -** - libsndfile.dll must have already been compiled and be in this -** application's search path -** -** - You must edit this file to point to the file you want to convert. Set -** the following line of code (found in the Main() function further below) -** to the name of a .WAV file that exists on your system. -** 186: string sfn = "input.wav"; -** -** - From a command prompt type -** csc generate.cs -** -** - Run the resulting executable 'generate.exe' -** -** -** Note: You will obviously need the csc compiler and the .NET runtime. I think -** these are freely available for download from Microsoft's website -** (part of the .NET SDK?). -*/ - - -using System; -using System.Runtime.InteropServices; -using sf_count_t = System.Int64; //alias; see SF_INFO struct - -#if PLATFORM_64 -using size_t = System.UInt64; -#else -using size_t = System.UInt32; -#endif - - -class lsndf_example { - - -//sound file formats - public enum lsndf_frmts { - SF_FORMAT_WAV = 0x010000, /* Microsoft WAV format (little endian). */ - SF_FORMAT_AIFF = 0x020000, /* Apple/SGI AIFF format (big endian). */ - SF_FORMAT_AU = 0x030000, /* Sun/NeXT AU format (big endian). */ - SF_FORMAT_RAW = 0x040000, /* RAW PCM data. */ - SF_FORMAT_PAF = 0x050000, /* Ensoniq PARIS file format. */ - SF_FORMAT_SVX = 0x060000, /* Amiga IFF / SVX8 / SV16 format. */ - SF_FORMAT_NIST = 0x070000, /* Sphere NIST format. */ - SF_FORMAT_VOC = 0x080000, /* VOC files. */ - SF_FORMAT_IRCAM = 0x0A0000, /* Berkeley/IRCAM/CARL */ - SF_FORMAT_W64 = 0x0B0000, /* Sonic Foundry's 64 bit RIFF/WAV */ - SF_FORMAT_MAT4 = 0x0C0000, /* Matlab (tm) V4.2 / GNU Octave 2.0 */ - SF_FORMAT_MAT5 = 0x0D0000, /* Matlab (tm) V5.0 / GNU Octave 2.1 */ - SF_FORMAT_PVF = 0x0E0000, /* Portable Voice Format */ - SF_FORMAT_XI = 0x0F0000, /* Fasttracker 2 Extended Instrument */ - SF_FORMAT_HTK = 0x100000, /* HMM Tool Kit format */ - SF_FORMAT_SDS = 0x110000, /* Midi Sample Dump Standard */ - - /* Subtypes from here on. */ - - SF_FORMAT_PCM_S8 = 0x0001, /* Signed 8 bit data */ - SF_FORMAT_PCM_16 = 0x0002, /* Signed 16 bit data */ - SF_FORMAT_PCM_24 = 0x0003, /* Signed 24 bit data */ - SF_FORMAT_PCM_32 = 0x0004, /* Signed 32 bit data */ - - SF_FORMAT_PCM_U8 = 0x0005, /* Unsigned 8 bit data (WAV and RAW only) */ - - SF_FORMAT_FLOAT = 0x0006, /* 32 bit float data */ - SF_FORMAT_DOUBLE = 0x0007, /* 64 bit float data */ - - SF_FORMAT_ULAW = 0x0010, /* U-Law encoded. */ - SF_FORMAT_ALAW = 0x0011, /* A-Law encoded. */ - SF_FORMAT_IMA_ADPCM = 0x0012, /* IMA ADPCM. */ - SF_FORMAT_MS_ADPCM = 0x0013, /* Microsoft ADPCM. */ - - SF_FORMAT_GSM610 = 0x0020, /* GSM 6.10 encoding. */ - SF_FORMAT_VOX_ADPCM = 0x0021, /* OKI / Dialogix ADPCM */ - - SF_FORMAT_G721_32 = 0x0030, /* 32kbs G721 ADPCM encoding. */ - SF_FORMAT_G723_24 = 0x0031, /* 24kbs G723 ADPCM encoding. */ - SF_FORMAT_G723_40 = 0x0032, /* 40kbs G723 ADPCM encoding. */ - - SF_FORMAT_DWVW_12 = 0x0040, /* 12 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_16 = 0x0041, /* 16 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_24 = 0x0042, /* 24 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_N = 0x0043, /* N bit Delta Width Variable Word encoding. */ - - SF_FORMAT_DPCM_8 = 0x0050, /* 8 bit differential PCM (XI only) */ - SF_FORMAT_DPCM_16 = 0x0051, /* 16 bit differential PCM (XI only) */ - - - /* Endian-ness options. */ - - SF_ENDIAN_FILE = 0x00000000, /* Default file endian-ness. */ - SF_ENDIAN_LITTLE = 0x10000000, /* Force little endian-ness. */ - SF_ENDIAN_BIG = 0x20000000, /* Force big endian-ness. */ - SF_ENDIAN_CPU = 0x30000000, /* Force CPU endian-ness. */ - - SF_FORMAT_SUBMASK = 0x0000FFFF, - SF_FORMAT_TYPEMASK = 0x0FFF0000, - SF_FORMAT_ENDMASK = 0x30000000 - } - - -//modes and other - public enum lsndf_tf - { /* True and false */ - SF_FALSE = 0, - SF_TRUE = 1, - - /* Modes for opening files. */ - SFM_READ = 0x10, - SFM_WRITE = 0x20, - SFM_RDWR = 0x30 - } - - -//important SF_INFO structure - [StructLayout(LayoutKind.Sequential)] - public struct SF_INFO - { - public sf_count_t frames ; // Used to be called samples. Changed to avoid confusion. - public int samplerate ; - public int channels ; - public int format ; - public int sections ; - public int seekable ; - }; - - -//function declarations -//Note: Not all functions have been prototyped here. Only the ones necessary to -// make this application work. The below code should give some clues as to -// how to add the rest since they have a lot of parameter and return type -// similarities. - [DllImport("libsndfile.dll")] - public static extern IntPtr sf_open ([MarshalAs(UnmanagedType.LPStr)] string path, int mode, ref SF_INFO sfinfo); - - [DllImport("libsndfile.dll")] - static extern int sf_error (IntPtr sndfile); - - [DllImport("libsndfile.dll")] - static extern IntPtr sf_strerror (IntPtr sndfile); - - [DllImport("libsndfile.dll")] - static extern int sf_format_check (ref SF_INFO info); - - [DllImport("libsndfile.dll")] - static extern sf_count_t sf_read_float (IntPtr sndfile, float[] ptr, sf_count_t items); - - [DllImport("libsndfile.dll")] - static extern sf_count_t sf_write_float (IntPtr sndfile, float[] ptr, sf_count_t items); - - [DllImport("libsndfile.dll")] - static extern int sf_close (IntPtr sndfile); - - - public const sf_count_t BUFFER_LEN = 4096; - - -//program entry - static void Main( ) { - - -//declarations - SF_INFO sfinfo = new SF_INFO(); - float[] buffer = new float[BUFFER_LEN]; - sf_count_t rcnt; - -//set the input file - string sfn = "input.wav"; //set to a file on YOUR system - //string sfn = "noexist.wav"; //test with non-existent file - -//set the output file - string ofn = "output.wav"; - -//read in sound file to convert - IntPtr infile = sf_open (sfn, (int)lsndf_tf.SFM_READ, ref sfinfo); - -//exit if error was thrown - if ( (int)infile == 0 ) { - Console.WriteLine("Error opening " + sfn); - Console.WriteLine("Error #" + sf_error(infile)); - return; - } - -//set the file type for the output file -//uncomment one and only one of the statements below to change the output -//file encoding. - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_WAV | lsndf_frmts.SF_FORMAT_PCM_U8); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_WAV | lsndf_frmts.SF_FORMAT_PCM_16); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_WAV | lsndf_frmts.SF_FORMAT_MS_ADPCM); - sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_WAV | lsndf_frmts.SF_FORMAT_IMA_ADPCM); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_WAV | lsndf_frmts.SF_FORMAT_GSM610); - /* Soundforge W64. */ - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_W64 | lsndf_frmts.SF_FORMAT_PCM_U8); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_W64 | lsndf_frmts.SF_FORMAT_PCM_16); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_W64 | lsndf_frmts.SF_FORMAT_MS_ADPCM); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_W64 | lsndf_frmts.SF_FORMAT_IMA_ADPCM); - //sfinfo.format = (int)(lsndf_frmts.SF_FORMAT_W64 | lsndf_frmts.SF_FORMAT_GSM610); - - -//check that SF_INFO is valid - if ( sf_format_check(ref sfinfo) == 0 ) { - Console.WriteLine("sf_format_check failed. Invalid encoding"); - return; - } - -//open output file - IntPtr outfile = sf_open (ofn, (int)lsndf_tf.SFM_WRITE, ref sfinfo); - -//exit if error was thrown - if ( (int)outfile == 0 ) { - Console.WriteLine("Error opening " + ofn); - Console.WriteLine("Error #" + sf_error(outfile)); - return; - } - -//infile -> outfile - Console.Write(sfn + " -> " + ofn); - while ( (rcnt = sf_read_float (infile, buffer, BUFFER_LEN)) > 0) { - Console.Write("."); - sf_write_float (outfile, buffer, BUFFER_LEN); - } - Console.WriteLine("done."); - -//close up shop - sf_close(infile); - sf_close(outfile); - - - } //main() - - -} //class lsndf_example {} - diff --git a/libs/libsndfile/examples/list_formats.c b/libs/libsndfile/examples/list_formats.c deleted file mode 100644 index 6d462f0790..0000000000 --- a/libs/libsndfile/examples/list_formats.c +++ /dev/null @@ -1,83 +0,0 @@ -/* -** Copyright (C) 2001-2011 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include - -int -main (void) -{ SF_FORMAT_INFO info ; - SF_INFO sfinfo ; - char buffer [128] ; - int format, major_count, subtype_count, m, s ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - buffer [0] = 0 ; - sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; - if (strlen (buffer) < 1) - { printf ("Line %d: could not retrieve lib version.\n", __LINE__) ; - exit (1) ; - } ; - printf ("Version : %s\n\n", buffer) ; - - sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof (int)) ; - sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &subtype_count, sizeof (int)) ; - - sfinfo.channels = 1 ; - for (m = 0 ; m < major_count ; m++) - { info.format = m ; - sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)) ; - printf ("%s (extension \"%s\")\n", info.name, info.extension) ; - - format = info.format ; - - for (s = 0 ; s < subtype_count ; s++) - { info.format = s ; - sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info)) ; - - format = (format & SF_FORMAT_TYPEMASK) | info.format ; - - sfinfo.format = format ; - if (sf_format_check (&sfinfo)) - printf (" %s\n", info.name) ; - } ; - puts ("") ; - } ; - puts ("") ; - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/examples/make_sine.c b/libs/libsndfile/examples/make_sine.c deleted file mode 100644 index 1db0e00d26..0000000000 --- a/libs/libsndfile/examples/make_sine.c +++ /dev/null @@ -1,96 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -#define SAMPLE_RATE 44100 -#define SAMPLE_COUNT (SAMPLE_RATE * 4) /* 4 seconds */ -#define AMPLITUDE (1.0 * 0x7F000000) -#define LEFT_FREQ (344.0 / SAMPLE_RATE) -#define RIGHT_FREQ (466.0 / SAMPLE_RATE) - -int -main (void) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - int *buffer ; - - if (! (buffer = malloc (2 * SAMPLE_COUNT * sizeof (int)))) - { printf ("Malloc failed.\n") ; - exit (0) ; - } ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = SAMPLE_COUNT ; - sfinfo.channels = 2 ; - sfinfo.format = (SF_FORMAT_WAV | SF_FORMAT_PCM_24) ; - - if (! (file = sf_open ("sine.wav", SFM_WRITE, &sfinfo))) - { printf ("Error : Not able to open output file.\n") ; - return 1 ; - } ; - - if (sfinfo.channels == 1) - { for (k = 0 ; k < SAMPLE_COUNT ; k++) - buffer [k] = AMPLITUDE * sin (LEFT_FREQ * 2 * k * M_PI) ; - } - else if (sfinfo.channels == 2) - { for (k = 0 ; k < SAMPLE_COUNT ; k++) - { buffer [2 * k] = AMPLITUDE * sin (LEFT_FREQ * 2 * k * M_PI) ; - buffer [2 * k + 1] = AMPLITUDE * sin (RIGHT_FREQ * 2 * k * M_PI) ; - } ; - } - else - { printf ("makesine can only generate mono or stereo files.\n") ; - exit (1) ; - } ; - - if (sf_write_int (file, buffer, sfinfo.channels * SAMPLE_COUNT) != - sfinfo.channels * SAMPLE_COUNT) - puts (sf_strerror (file)) ; - - sf_close (file) ; - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/examples/sfprocess.c b/libs/libsndfile/examples/sfprocess.c deleted file mode 100644 index 1c141a4981..0000000000 --- a/libs/libsndfile/examples/sfprocess.c +++ /dev/null @@ -1,142 +0,0 @@ -/* -** Copyright (C) 2001-2013 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include - -/* Include this header file to use functions from libsndfile. */ -#include - -/* This will be the length of the buffer used to hold.frames while -** we process them. -*/ -#define BUFFER_LEN 1024 - -/* libsndfile can handle more than 6 channels but we'll restrict it to 6. */ -#define MAX_CHANNELS 6 - -/* Function prototype. */ -static void process_data (double *data, int count, int channels) ; - - -int -main (void) -{ /* This is a buffer of double precision floating point values - ** which will hold our data while we process it. - */ - static double data [BUFFER_LEN] ; - - /* A SNDFILE is very much like a FILE in the Standard C library. The - ** sf_open function return an SNDFILE* pointer when they sucessfully - ** open the specified file. - */ - SNDFILE *infile, *outfile ; - - /* A pointer to an SF_INFO struct is passed to sf_open. - ** On read, the library fills this struct with information about the file. - ** On write, the struct must be filled in before calling sf_open. - */ - SF_INFO sfinfo ; - int readcount ; - const char *infilename = "input.wav" ; - const char *outfilename = "output.wav" ; - - /* The SF_INFO struct must be initialized before using it. - */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - /* Here's where we open the input file. We pass sf_open the file name and - ** a pointer to an SF_INFO struct. - ** On successful open, sf_open returns a SNDFILE* pointer which is used - ** for all subsequent operations on that file. - ** If an error occurs during sf_open, the function returns a NULL pointer. - ** - ** If you are trying to open a raw headerless file you will need to set the - ** format and channels fields of sfinfo before calling sf_open(). For - ** instance to open a raw 16 bit stereo PCM file you would need the following - ** two lines: - ** - ** sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16 ; - ** sfinfo.channels = 2 ; - */ - if (! (infile = sf_open (infilename, SFM_READ, &sfinfo))) - { /* Open failed so print an error message. */ - printf ("Not able to open input file %s.\n", infilename) ; - /* Print the error message from libsndfile. */ - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - if (sfinfo.channels > MAX_CHANNELS) - { printf ("Not able to process more than %d channels\n", MAX_CHANNELS) ; - return 1 ; - } ; - /* Open the output file. */ - if (! (outfile = sf_open (outfilename, SFM_WRITE, &sfinfo))) - { printf ("Not able to open output file %s.\n", outfilename) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - /* While there are.frames in the input file, read them, process - ** them and write them to the output file. - */ - while ((readcount = sf_read_double (infile, data, BUFFER_LEN))) - { process_data (data, readcount, sfinfo.channels) ; - sf_write_double (outfile, data, readcount) ; - } ; - - /* Close input and output files. */ - sf_close (infile) ; - sf_close (outfile) ; - - return 0 ; -} /* main */ - -static void -process_data (double *data, int count, int channels) -{ double channel_gain [MAX_CHANNELS] = { 0.5, 0.8, 0.1, 0.4, 0.4, 0.9 } ; - int k, chan ; - - /* Process the data here. - ** If the soundfile contains more then 1 channel you need to take care of - ** the data interleaving youself. - ** Current we just apply a channel dependant gain. - */ - - for (chan = 0 ; chan < channels ; chan ++) - for (k = chan ; k < count ; k+= channels) - data [k] *= channel_gain [chan] ; - - return ; -} /* process_data */ - diff --git a/libs/libsndfile/examples/sndfile-convert.c b/libs/libsndfile/examples/sndfile-convert.c deleted file mode 100644 index e1422579bd..0000000000 --- a/libs/libsndfile/examples/sndfile-convert.c +++ /dev/null @@ -1,376 +0,0 @@ -/* -** Copyright (C) 1999-2005 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include -#include -#include -#include - -#include - -#define BUFFER_LEN 1024 - - -typedef struct -{ char *infilename, *outfilename ; - SF_INFO infileinfo, outfileinfo ; -} OptionData ; - -typedef struct -{ const char *ext ; - int len ; - int format ; -} OUTPUT_FORMAT_MAP ; - -static void copy_metadata (SNDFILE *outfile, SNDFILE *infile) ; -static void copy_data_fp (SNDFILE *outfile, SNDFILE *infile, int channels) ; -static void copy_data_int (SNDFILE *outfile, SNDFILE *infile, int channels) ; - -static OUTPUT_FORMAT_MAP format_map [] = -{ - { "aif", 3, SF_FORMAT_AIFF }, - { "wav", 0, SF_FORMAT_WAV }, - { "au", 0, SF_FORMAT_AU }, - { "caf", 0, SF_FORMAT_CAF }, - { "flac", 0, SF_FORMAT_FLAC }, - { "snd", 0, SF_FORMAT_AU }, - { "svx", 0, SF_FORMAT_SVX }, - { "paf", 0, SF_ENDIAN_BIG | SF_FORMAT_PAF }, - { "fap", 0, SF_ENDIAN_LITTLE | SF_FORMAT_PAF }, - { "gsm", 0, SF_FORMAT_RAW }, - { "nist", 0, SF_FORMAT_NIST }, - { "ircam", 0, SF_FORMAT_IRCAM }, - { "sf", 0, SF_FORMAT_IRCAM }, - { "voc", 0, SF_FORMAT_VOC }, - { "w64", 0, SF_FORMAT_W64 }, - { "raw", 0, SF_FORMAT_RAW }, - { "mat4", 0, SF_FORMAT_MAT4 }, - { "mat5", 0, SF_FORMAT_MAT5 }, - { "mat", 0, SF_FORMAT_MAT4 }, - { "pvf", 0, SF_FORMAT_PVF }, - { "sds", 0, SF_FORMAT_SDS }, - { "sd2", 0, SF_FORMAT_SD2 }, - { "vox", 0, SF_FORMAT_RAW }, - { "xi", 0, SF_FORMAT_XI } -} ; /* format_map */ - -static int -guess_output_file_type (char *str, int format) -{ char buffer [16], *cptr ; - int k ; - - format &= SF_FORMAT_SUBMASK ; - - if ((cptr = strrchr (str, '.')) == NULL) - return 0 ; - - strncpy (buffer, cptr + 1, 15) ; - buffer [15] = 0 ; - - for (k = 0 ; buffer [k] ; k++) - buffer [k] = tolower ((buffer [k])) ; - - if (strcmp (buffer, "gsm") == 0) - return SF_FORMAT_RAW | SF_FORMAT_GSM610 ; - - if (strcmp (buffer, "vox") == 0) - return SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM ; - - for (k = 0 ; k < (int) (sizeof (format_map) / sizeof (format_map [0])) ; k++) - { if (format_map [k].len > 0 && strncmp (buffer, format_map [k].ext, format_map [k].len) == 0) - return format_map [k].format | format ; - else if (strcmp (buffer, format_map [k].ext) == 0) - return format_map [k].format | format ; - } ; - - return 0 ; -} /* guess_output_file_type */ - - -static void -print_usage (char *progname) -{ SF_FORMAT_INFO info ; - - int k ; - - printf ("\nUsage : %s [encoding] \n", progname) ; - puts ("\n" - " where [encoding] may be one of the following:\n\n" - " -pcms8 : force the output to signed 8 bit pcm\n" - " -pcmu8 : force the output to unsigned 8 bit pcm\n" - " -pcm16 : force the output to 16 bit pcm\n" - " -pcm24 : force the output to 24 bit pcm\n" - " -pcm32 : force the output to 32 bit pcm\n" - " -float32 : force the output to 32 bit floating point" - ) ; - puts ( - " -ulaw : force the output ULAW\n" - " -alaw : force the output ALAW\n" - " -ima-adpcm : force the output to IMA ADPCM (WAV only)\n" - " -ms-adpcm : force the output to MS ADPCM (WAV only)\n" - " -gsm610 : force the GSM6.10 (WAV only)\n" - " -dwvw12 : force the output to 12 bit DWVW (AIFF only)\n" - " -dwvw16 : force the output to 16 bit DWVW (AIFF only)\n" - " -dwvw24 : force the output to 24 bit DWVW (AIFF only)\n" - ) ; - - puts ( - " The format of the output file is determined by the file extension of the\n" - " output file name. The following extensions are currently understood:\n" - ) ; - - for (k = 0 ; k < (int) (sizeof (format_map) / sizeof (format_map [0])) ; k++) - { info.format = format_map [k].format ; - sf_command (NULL, SFC_GET_FORMAT_INFO, &info, sizeof (info)) ; - printf (" %-10s : %s\n", format_map [k].ext, info.name) ; - } ; - - puts ("") ; -} /* print_usage */ - -int -main (int argc, char * argv []) -{ char *progname, *infilename, *outfilename ; - SNDFILE *infile = NULL, *outfile = NULL ; - SF_INFO sfinfo ; - int k, outfilemajor, outfileminor = 0, infileminor ; - - progname = strrchr (argv [0], '/') ; - progname = progname ? progname + 1 : argv [0] ; - - if (argc < 3 || argc > 5) - { print_usage (progname) ; - return 1 ; - } ; - - infilename = argv [argc-2] ; - outfilename = argv [argc-1] ; - - if (strcmp (infilename, outfilename) == 0) - { printf ("Error : Input and output filenames are the same.\n\n") ; - print_usage (progname) ; - return 1 ; - } ; - - if (infilename [0] == '-') - { printf ("Error : Input filename (%s) looks like an option.\n\n", infilename) ; - print_usage (progname) ; - return 1 ; - } ; - - if (outfilename [0] == '-') - { printf ("Error : Output filename (%s) looks like an option.\n\n", outfilename) ; - print_usage (progname) ; - return 1 ; - } ; - - for (k = 1 ; k < argc - 2 ; k++) - { if (! strcmp (argv [k], "-pcms8")) - { outfileminor = SF_FORMAT_PCM_S8 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcmu8")) - { outfileminor = SF_FORMAT_PCM_U8 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm16")) - { outfileminor = SF_FORMAT_PCM_16 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm24")) - { outfileminor = SF_FORMAT_PCM_24 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm32")) - { outfileminor = SF_FORMAT_PCM_32 ; - continue ; - } ; - if (! strcmp (argv [k], "-float32")) - { outfileminor = SF_FORMAT_FLOAT ; - continue ; - } ; - if (! strcmp (argv [k], "-ulaw")) - { outfileminor = SF_FORMAT_ULAW ; - continue ; - } ; - if (! strcmp (argv [k], "-alaw")) - { outfileminor = SF_FORMAT_ALAW ; - continue ; - } ; - if (! strcmp (argv [k], "-ima-adpcm")) - { outfileminor = SF_FORMAT_IMA_ADPCM ; - continue ; - } ; - if (! strcmp (argv [k], "-ms-adpcm")) - { outfileminor = SF_FORMAT_MS_ADPCM ; - continue ; - } ; - if (! strcmp (argv [k], "-gsm610")) - { outfileminor = SF_FORMAT_GSM610 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw12")) - { outfileminor = SF_FORMAT_DWVW_12 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw16")) - { outfileminor = SF_FORMAT_DWVW_16 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw24")) - { outfileminor = SF_FORMAT_DWVW_24 ; - continue ; - } ; - - printf ("Error : Not able to decode argunment '%s'.\n", argv [k]) ; - exit (1) ; - } ; - - if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL) - { printf ("Not able to open input file %s.\n", infilename) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - infileminor = sfinfo.format & SF_FORMAT_SUBMASK ; - - if ((sfinfo.format = guess_output_file_type (outfilename, sfinfo.format)) == 0) - { printf ("Error : Not able to determine output file type for %s.\n", outfilename) ; - return 1 ; - } ; - - outfilemajor = sfinfo.format & (SF_FORMAT_TYPEMASK | SF_FORMAT_ENDMASK) ; - - if (outfileminor == 0) - outfileminor = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (outfileminor != 0) - sfinfo.format = outfilemajor | outfileminor ; - else - sfinfo.format = outfilemajor | (sfinfo.format & SF_FORMAT_SUBMASK) ; - - if ((sfinfo.format & SF_FORMAT_TYPEMASK) == SF_FORMAT_XI) - switch (sfinfo.format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_16 : - sfinfo.format = outfilemajor | SF_FORMAT_DPCM_16 ; - break ; - - case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - sfinfo.format = outfilemajor | SF_FORMAT_DPCM_8 ; - break ; - } ; - - if (sf_format_check (&sfinfo) == 0) - { printf ("Error : output file format is invalid (0x%08X).\n", sfinfo.format) ; - return 1 ; - } ; - - /* Open the output file. */ - if ((outfile = sf_open (outfilename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("Not able to open output file %s : %s\n", outfilename, sf_strerror (NULL)) ; - return 1 ; - } ; - - /* Copy the metadata */ - copy_metadata (outfile, infile) ; - - if ((outfileminor == SF_FORMAT_DOUBLE) || (outfileminor == SF_FORMAT_FLOAT) || - (infileminor == SF_FORMAT_DOUBLE) || (infileminor == SF_FORMAT_FLOAT)) - copy_data_fp (outfile, infile, sfinfo.channels) ; - else - copy_data_int (outfile, infile, sfinfo.channels) ; - - sf_close (infile) ; - sf_close (outfile) ; - - return 0 ; -} /* main */ - -static void -copy_metadata (SNDFILE *outfile, SNDFILE *infile) -{ SF_INSTRUMENT inst ; - const char *str ; - int k, err = 0 ; - - for (k = SF_STR_FIRST ; k <= SF_STR_LAST ; k++) - { str = sf_get_string (infile, k) ; - if (str != NULL) - err = sf_set_string (outfile, k, str) ; - } ; - - memset (&inst, 0, sizeof (inst)) ; - if (sf_command (infile, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) == SF_TRUE) - sf_command (outfile, SFC_SET_INSTRUMENT, &inst, sizeof (inst)) ; - -} /* copy_metadata */ - -static void -copy_data_fp (SNDFILE *outfile, SNDFILE *infile, int channels) -{ static double data [BUFFER_LEN], max ; - int frames, readcount, k ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - sf_command (infile, SFC_CALC_SIGNAL_MAX, &max, sizeof (max)) ; - - if (max < 1.0) - { while (readcount > 0) - { readcount = sf_readf_double (infile, data, frames) ; - sf_writef_double (outfile, data, readcount) ; - } ; - } - else - { sf_command (infile, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - while (readcount > 0) - { readcount = sf_readf_double (infile, data, frames) ; - for (k = 0 ; k < readcount * channels ; k++) - data [k] /= max ; - sf_writef_double (outfile, data, readcount) ; - } ; - } ; - - return ; -} /* copy_data_fp */ - -static void -copy_data_int (SNDFILE *outfile, SNDFILE *infile, int channels) -{ static int data [BUFFER_LEN] ; - int frames, readcount ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - while (readcount > 0) - { readcount = sf_readf_int (infile, data, frames) ; - sf_writef_int (outfile, data, readcount) ; - } ; - - return ; -} /* copy_data_int */ - -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 259682b3-2887-48a6-b5bb-3cde00521ba3 -*/ diff --git a/libs/libsndfile/examples/sndfile-info.c b/libs/libsndfile/examples/sndfile-info.c deleted file mode 100644 index 44e2ec174f..0000000000 --- a/libs/libsndfile/examples/sndfile-info.c +++ /dev/null @@ -1,354 +0,0 @@ -/* -** Copyright (C) 1999-2006 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include -#include - -#include - -#define BUFFER_LEN (1 << 16) - -#if (defined (WIN32) || defined (_WIN32)) -#define snprintf _snprintf -#endif - -static void print_version (void) ; -static void print_usage (const char *progname) ; - -static void info_dump (const char *filename) ; -static void instrument_dump (const char *filename) ; -static void broadcast_dump (const char *filename) ; - -int -main (int argc, char *argv []) -{ int k ; - - print_version () ; - - if (argc < 2 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0) - { char *progname ; - - progname = strrchr (argv [0], '/') ; - progname = progname ? progname + 1 : argv [0] ; - - print_usage (progname) ; - return 1 ; - } ; - - if (strcmp (argv [1], "-i") == 0) - { instrument_dump (argv [2]) ; - return 0 ; - } ; - - if (strcmp (argv [1], "-b") == 0) - { broadcast_dump (argv [2]) ; - return 0 ; - } ; - - for (k = 1 ; k < argc ; k++) - info_dump (argv [k]) ; - - return 0 ; -} /* main */ - -/*============================================================================== -** Print version and usage. -*/ - -static double data [BUFFER_LEN] ; - -static void -print_version (void) -{ char buffer [256] ; - - sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; - printf ("\nVersion : %s\n\n", buffer) ; -} /* print_version */ - - -static void -print_usage (const char *progname) -{ printf ("Usage :\n %s ...\n", progname) ; - printf (" Prints out information about one or more sound files.\n\n") ; - printf (" %s -i \n", progname) ; - printf (" Prints out the instrument data for the given file.\n\n") ; - printf (" %s -b \n", progname) ; - printf (" Prints out the broadcast WAV info for the given file.\n\n") ; -#if (defined (_WIN32) || defined (WIN32)) - printf ("This is a Unix style command line application which\n" - "should be run in a MSDOS box or Command Shell window.\n\n") ; - printf ("Sleeping for 5 seconds before exiting.\n\n") ; - fflush (stdout) ; - - /* This is the officially blessed by microsoft way but I can't get - ** it to link. - ** Sleep (15) ; - ** Instead, use this: - */ - _sleep (5 * 1000) ; -#endif -} /* print_usage */ - -/*============================================================================== -** Dumping of sndfile info. -*/ - -static double data [BUFFER_LEN] ; - -static double -get_signal_max (SNDFILE *file) -{ double max, temp ; - int readcount, k, save_state ; - - save_state = sf_command (file, SFC_GET_NORM_DOUBLE, NULL, 0) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - max = 0.0 ; - while ((readcount = sf_read_double (file, data, BUFFER_LEN))) - { for (k = 0 ; k < readcount ; k++) - { temp = fabs (data [k]) ; - if (temp > max) - max = temp ; - } ; - } ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, save_state) ; - - return max ; -} /* get_signal_max */ - -static double -calc_decibels (SF_INFO * sfinfo, double max) -{ double decibels ; - - switch (sfinfo->format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_S8 : - decibels = max / 0x80 ; - break ; - - case SF_FORMAT_PCM_16 : - decibels = max / 0x8000 ; - break ; - - case SF_FORMAT_PCM_24 : - decibels = max / 0x800000 ; - break ; - - case SF_FORMAT_PCM_32 : - decibels = max / 0x80000000 ; - break ; - - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - decibels = max / 1.0 ; - break ; - - default : - decibels = max / 0x8000 ; - break ; - } ; - - return 20.0 * log10 (decibels) ; -} /* calc_decibels */ - -static const char * -generate_duration_str (SF_INFO *sfinfo) -{ static char str [128] ; - - int seconds ; - - memset (str, 0, sizeof (str)) ; - - if (sfinfo->samplerate < 1) - return NULL ; - - if (sfinfo->frames / sfinfo->samplerate > 0x7FFFFFFF) - return "unknown" ; - - seconds = sfinfo->frames / sfinfo->samplerate ; - - snprintf (str, sizeof (str) - 1, "%02d:", seconds / 60 / 60) ; - - seconds = seconds % (60 * 60) ; - snprintf (str + strlen (str), sizeof (str) - strlen (str) - 1, "%02d:", seconds / 60) ; - - seconds = seconds % 60 ; - snprintf (str + strlen (str), sizeof (str) - strlen (str) - 1, "%02d.", seconds) ; - - seconds = ((1000 * sfinfo->frames) / sfinfo->samplerate) % 1000 ; - snprintf (str + strlen (str), sizeof (str) - strlen (str) - 1, "%03d", seconds) ; - - return str ; -} /* generate_duration_str */ - -static void -info_dump (const char *filename) -{ static char strbuffer [BUFFER_LEN] ; - SNDFILE *file ; - SF_INFO sfinfo ; - double signal_max, decibels ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - sf_command (file, SFC_GET_LOG_INFO, strbuffer, BUFFER_LEN) ; - puts (strbuffer) ; - puts (sf_strerror (NULL)) ; - return ; - } ; - - printf ("========================================\n") ; - sf_command (file, SFC_GET_LOG_INFO, strbuffer, BUFFER_LEN) ; - puts (strbuffer) ; - printf ("----------------------------------------\n") ; - - if (file == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - } - else - { printf ("Sample Rate : %d\n", sfinfo.samplerate) ; - if (sfinfo.frames > 0x7FFFFFFF) - printf ("Frames : unknown\n") ; - else - printf ("Frames : %ld\n", (long) sfinfo.frames) ; - printf ("Channels : %d\n", sfinfo.channels) ; - printf ("Format : 0x%08X\n", sfinfo.format) ; - printf ("Sections : %d\n", sfinfo.sections) ; - printf ("Seekable : %s\n", (sfinfo.seekable ? "TRUE" : "FALSE")) ; - printf ("Duration : %s\n", generate_duration_str (&sfinfo)) ; - - /* Do not use sf_signal_max because it doesn work for non-seekable files . */ - signal_max = get_signal_max (file) ; - decibels = calc_decibels (&sfinfo, signal_max) ; - printf ("Signal Max : %g (%4.2f dB)\n\n", signal_max, decibels) ; - } ; - - sf_close (file) ; - -} /* info_dump */ - -/*============================================================================== -** Dumping of SF_INSTRUMENT data. -*/ - -static const char * -str_of_type (int mode) -{ switch (mode) - { case SF_LOOP_NONE : return "none" ; - case SF_LOOP_FORWARD : return "fwd " ; - case SF_LOOP_BACKWARD : return "back" ; - case SF_LOOP_ALTERNATING : return "alt " ; - default : break ; - } ; - - return "????" ; -} /* str_of_mode */ - -static void -instrument_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_INSTRUMENT inst ; - int got_inst, k ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return ; - } ; - - got_inst = sf_command (file, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) ; - sf_close (file) ; - - if (got_inst == SF_FALSE) - { printf ("Error : File '%s' does not contain instrument data.\n\n", filename) ; - return ; - } ; - - printf ("Instrument : %s\n\n", filename) ; - printf (" Gain : %d\n", inst.gain) ; - printf (" Base note : %d\n", inst.basenote) ; - printf (" Velocity : %d - %d\n", (int) inst.velocity_lo, (int) inst.velocity_hi) ; - printf (" Key : %d - %d\n", (int) inst.key_lo, (int) inst.key_hi) ; - printf (" Loop points : %d\n", inst.loop_count) ; - - for (k = 0 ; k < inst.loop_count ; k++) - printf (" %-2d Mode : %s Start : %6d End : %6d Count : %6d\n", k, str_of_type (inst.loops [k].mode), inst.loops [k].start, inst.loops [k].end, inst.loops [k].count) ; - - putchar ('\n') ; -} /* instrument_dump */ - -static void -broadcast_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_BROADCAST_INFO bext ; - int got_bext ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return ; - } ; - - memset (&bext, 0, sizeof (SF_BROADCAST_INFO)) ; - - got_bext = sf_command (file, SFC_GET_BROADCAST_INFO, &bext, sizeof (bext)) ; - sf_close (file) ; - - if (got_bext == SF_FALSE) - { printf ("Error : File '%s' does not contain broadcast information.\n\n", filename) ; - return ; - } ; - - printf ("Description : %.*s\n", (int) sizeof (bext.description), bext.description) ; - printf ("Originator : %.*s\n", (int) sizeof (bext.originator), bext.originator) ; - printf ("Origination ref : %.*s\n", (int) sizeof (bext.originator_reference), bext.originator_reference) ; - printf ("Origination date : %.*s\n", (int) sizeof (bext.origination_date), bext.origination_date) ; - printf ("Origination time : %.*s\n", (int) sizeof (bext.origination_time), bext.origination_time) ; - printf ("BWF version : %d\n", bext.version) ; - printf ("UMID : %.*s\n", (int) sizeof (bext.umid), bext.umid) ; - printf ("Coding history : %.*s\n", bext.coding_history_size, bext.coding_history) ; - -} /* broadcast_dump */ - -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: f59a05db-a182-41de-aedd-d717ce2bb099 -*/ diff --git a/libs/libsndfile/examples/sndfile-play-beos.cpp b/libs/libsndfile/examples/sndfile-play-beos.cpp deleted file mode 100644 index 56f7415119..0000000000 --- a/libs/libsndfile/examples/sndfile-play-beos.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* -** Copyright (C) 2001 Marcus Overhagen -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include - -#include -#include -#include - -#include - -#define BUFFER_LEN 1024 - -/*------------------------------------------------------------------------------ -** BeOS functions for playing a sound. -*/ - -#if defined (__BEOS__) - -struct shared_data -{ - BSoundPlayer *player; - SNDFILE *sndfile; - SF_INFO sfinfo; - sem_id finished; -}; - -static void -buffer_callback(void *theCookie, void *buf, size_t size, const media_raw_audio_format &format) -{ - shared_data *data = (shared_data *)theCookie; - short *buffer = (short *)buf; - int count = size / sizeof(short); - int m, readcount; - - if (!data->player->HasData()) - return; - - readcount = sf_read_short(data->sndfile, buffer, count); - if (readcount == 0) - { data->player->SetHasData(false); - release_sem(data->finished); - } - if (readcount < count) - { for (m = readcount ; m < count ; m++) - buffer [m] = 0 ; - } - if (data->sfinfo.pcmbitwidth < 16) - { for (m = 0 ; m < count ; m++) - buffer [m] *= 256 ; - } -} - -static void -beos_play (int argc, char *argv []) -{ - shared_data data; - status_t status; - int k; - - /* BSoundPlayer requires a BApplication object */ - BApplication app("application/x-vnd.MarcusOverhagen-sfplay"); - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (data.sndfile = sf_open_read (argv [k], &data.sfinfo))) - { sf_perror (NULL) ; - continue ; - } ; - - if (data.sfinfo.channels < 1 || data.sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", data.sfinfo.channels) ; - sf_close (data.sndfile) ; - continue ; - } ; - - data.finished = create_sem(0,"finished"); - - media_raw_audio_format format = - { data.sfinfo.samplerate, - data.sfinfo.channels, - media_raw_audio_format::B_AUDIO_SHORT, - B_HOST_IS_LENDIAN ? B_MEDIA_LITTLE_ENDIAN : B_MEDIA_BIG_ENDIAN, - BUFFER_LEN * sizeof(short) - }; - - BSoundPlayer player(&format,"player",buffer_callback,NULL,&data); - data.player = &player; - - if ((status = player.InitCheck()) != B_OK) - { - printf ("Error : BSoundPlayer init failed, %s.\n", strerror(status)) ; - delete_sem(data.finished); - sf_close (data.sndfile) ; - continue ; - } - - player.SetVolume(1.0); - player.Start(); - player.SetHasData(true); - acquire_sem(data.finished); - player.Stop(); - delete_sem(data.finished); - - sf_close (data.sndfile) ; - - } ; - -} /* beos_play */ - -#endif - -/*============================================================================== -** Main function. -*/ - -int -main (int argc, char *argv []) -{ - if (argc < 2) - { printf ("Usage : %s \n\n", argv [0]) ; - return 1 ; - } ; - - beos_play (argc, argv) ; - - return 0 ; -} /* main */ - - -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 5407a79d-88de-41c7-8d8e-9acf2cf13cc1 -*/ - diff --git a/libs/libsndfile/examples/sndfile-play.c b/libs/libsndfile/examples/sndfile-play.c deleted file mode 100644 index 7969693a44..0000000000 --- a/libs/libsndfile/examples/sndfile-play.c +++ /dev/null @@ -1,960 +0,0 @@ -/* -** Copyright (C) 1999-2005 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if HAVE_ALSA_ASOUNDLIB_H - #define ALSA_PCM_NEW_HW_PARAMS_API - #define ALSA_PCM_NEW_SW_PARAMS_API - #include - #include -#endif - -#if defined (__linux__) - #include - #include - #include - -#elif (defined (__MACH__) && defined (__APPLE__)) - #include - #include - -#elif (defined (sun) && defined (unix)) - #include - #include - #include - -#elif (OS_IS_WIN32 == 1) - #include - #include - -#endif - -#include - -#define SIGNED_SIZEOF(x) ((int) sizeof (x)) -#define BUFFER_LEN (2048) - -/*------------------------------------------------------------------------------ -** Linux/OSS functions for playing a sound. -*/ - -#if HAVE_ALSA_ASOUNDLIB_H - -static snd_pcm_t * alsa_open (int channels, unsigned srate, int realtime) ; -static int alsa_write_float (snd_pcm_t *alsa_dev, float *data, int frames, int channels) ; - -static void -alsa_play (int argc, char *argv []) -{ static float buffer [BUFFER_LEN] ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - snd_pcm_t * alsa_dev ; - int k, readcount, subformat ; - - for (k = 1 ; k < argc ; k++) - { memset (&sfinfo, 0, sizeof (sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - if ((alsa_dev = alsa_open (sfinfo.channels, (unsigned) sfinfo.samplerate, SF_FALSE)) == NULL) - continue ; - - subformat = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - { double scale ; - int m ; - - sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &scale, sizeof (scale)) ; - if (scale < 1e-10) - scale = 1.0 ; - else - scale = 32700.0 / scale ; - - while ((readcount = sf_read_float (sndfile, buffer, BUFFER_LEN))) - { for (m = 0 ; m < readcount ; m++) - buffer [m] *= scale ; - alsa_write_float (alsa_dev, buffer, BUFFER_LEN / sfinfo.channels, sfinfo.channels) ; - } ; - } - else - { while ((readcount = sf_read_float (sndfile, buffer, BUFFER_LEN))) - alsa_write_float (alsa_dev, buffer, BUFFER_LEN / sfinfo.channels, sfinfo.channels) ; - } ; - - snd_pcm_drain (alsa_dev) ; - snd_pcm_close (alsa_dev) ; - - sf_close (sndfile) ; - } ; - - return ; -} /* alsa_play */ - -static snd_pcm_t * -alsa_open (int channels, unsigned samplerate, int realtime) -{ const char * device = "plughw:0" ; - snd_pcm_t *alsa_dev = NULL ; - snd_pcm_hw_params_t *hw_params ; - snd_pcm_uframes_t buffer_size, xfer_align, start_threshold ; - snd_pcm_uframes_t alsa_period_size, alsa_buffer_frames ; - snd_pcm_sw_params_t *sw_params ; - - int err ; - - if (realtime) - { alsa_period_size = 256 ; - alsa_buffer_frames = 3 * alsa_period_size ; - } - else - { alsa_period_size = 1024 ; - alsa_buffer_frames = 4 * alsa_period_size ; - } ; - - if ((err = snd_pcm_open (&alsa_dev, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) - { fprintf (stderr, "cannot open audio device \"%s\" (%s)\n", device, snd_strerror (err)) ; - goto catch_error ; - } ; - - snd_pcm_nonblock (alsa_dev, 0) ; - - if ((err = snd_pcm_hw_params_malloc (&hw_params)) < 0) - { fprintf (stderr, "cannot allocate hardware parameter structure (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_any (alsa_dev, hw_params)) < 0) - { fprintf (stderr, "cannot initialize hardware parameter structure (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_access (alsa_dev, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) - { fprintf (stderr, "cannot set access type (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_format (alsa_dev, hw_params, SND_PCM_FORMAT_FLOAT)) < 0) - { fprintf (stderr, "cannot set sample format (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_rate_near (alsa_dev, hw_params, &samplerate, 0)) < 0) - { fprintf (stderr, "cannot set sample rate (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_channels (alsa_dev, hw_params, channels)) < 0) - { fprintf (stderr, "cannot set channel count (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_buffer_size_near (alsa_dev, hw_params, &alsa_buffer_frames)) < 0) - { fprintf (stderr, "cannot set buffer size (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_period_size_near (alsa_dev, hw_params, &alsa_period_size, 0)) < 0) - { fprintf (stderr, "cannot set period size (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params (alsa_dev, hw_params)) < 0) - { fprintf (stderr, "cannot set parameters (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - /* extra check: if we have only one period, this code won't work */ - snd_pcm_hw_params_get_period_size (hw_params, &alsa_period_size, 0) ; - snd_pcm_hw_params_get_buffer_size (hw_params, &buffer_size) ; - if (alsa_period_size == buffer_size) - { fprintf (stderr, "Can't use period equal to buffer size (%lu == %lu)", alsa_period_size, buffer_size) ; - goto catch_error ; - } ; - - snd_pcm_hw_params_free (hw_params) ; - - if ((err = snd_pcm_sw_params_malloc (&sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params_malloc: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_sw_params_current (alsa_dev, sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params_current: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - /* note: set start threshold to delay start until the ring buffer is full */ - snd_pcm_sw_params_current (alsa_dev, sw_params) ; - if ((err = snd_pcm_sw_params_get_xfer_align (sw_params, &xfer_align)) < 0) - { fprintf (stderr, "cannot get xfer align (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - /* round up to closest transfer boundary */ - start_threshold = (buffer_size / xfer_align) * xfer_align ; - if (start_threshold < 1) - start_threshold = 1 ; - if ((err = snd_pcm_sw_params_set_start_threshold (alsa_dev, sw_params, start_threshold)) < 0) - { fprintf (stderr, "cannot set start threshold (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_sw_params (alsa_dev, sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - snd_pcm_sw_params_free (sw_params) ; - - snd_pcm_reset (alsa_dev) ; - -catch_error : - - if (err < 0 && alsa_dev != NULL) - { snd_pcm_close (alsa_dev) ; - return NULL ; - } ; - - return alsa_dev ; -} /* alsa_open */ - -static int -alsa_write_float (snd_pcm_t *alsa_dev, float *data, int frames, int channels) -{ static int epipe_count = 0 ; - - snd_pcm_status_t *status ; - int total = 0 ; - int retval ; - - if (epipe_count > 0) - epipe_count -- ; - - while (total < frames) - { retval = snd_pcm_writei (alsa_dev, data + total * channels, frames - total) ; - - if (retval >= 0) - { total += retval ; - if (total == frames) - return total ; - - continue ; - } ; - - switch (retval) - { case -EAGAIN : - puts ("alsa_write_float: EAGAIN") ; - continue ; - break ; - - case -EPIPE : - if (epipe_count > 0) - { printf ("alsa_write_float: EPIPE %d\n", epipe_count) ; - if (epipe_count > 140) - return retval ; - } ; - epipe_count += 100 ; - - if (0) - { snd_pcm_status_alloca (&status) ; - if ((retval = snd_pcm_status (alsa_dev, status)) < 0) - fprintf (stderr, "alsa_out: xrun. can't determine length\n") ; - else if (snd_pcm_status_get_state (status) == SND_PCM_STATE_XRUN) - { struct timeval now, diff, tstamp ; - - gettimeofday (&now, 0) ; - snd_pcm_status_get_trigger_tstamp (status, &tstamp) ; - timersub (&now, &tstamp, &diff) ; - - fprintf (stderr, "alsa_write_float xrun: of at least %.3f msecs. resetting stream\n", - diff.tv_sec * 1000 + diff.tv_usec / 1000.0) ; - } - else - fprintf (stderr, "alsa_write_float: xrun. can't determine length\n") ; - } ; - - snd_pcm_prepare (alsa_dev) ; - break ; - - case -EBADFD : - fprintf (stderr, "alsa_write_float: Bad PCM state.n") ; - return 0 ; - break ; - - case -ESTRPIPE : - fprintf (stderr, "alsa_write_float: Suspend event.n") ; - return 0 ; - break ; - - case -EIO : - puts ("alsa_write_float: EIO") ; - return 0 ; - - default : - fprintf (stderr, "alsa_write_float: retval = %d\n", retval) ; - return 0 ; - break ; - } ; /* switch */ - } ; /* while */ - - return total ; -} /* alsa_write_float */ - -#endif /* HAVE_ALSA_ASOUNDLIB_H */ - -/*------------------------------------------------------------------------------ -** Linux/OSS functions for playing a sound. -*/ - -#if defined (__linux__) - -static int linux_open_dsp_device (int channels, int srate) ; - -static void -linux_play (int argc, char *argv []) -{ static short buffer [BUFFER_LEN] ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - int k, audio_device, readcount, subformat ; - - for (k = 1 ; k < argc ; k++) - { memset (&sfinfo, 0, sizeof (sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - audio_device = linux_open_dsp_device (sfinfo.channels, sfinfo.samplerate) ; - - subformat = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - { static float float_buffer [BUFFER_LEN] ; - double scale ; - int m ; - - sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &scale, sizeof (scale)) ; - if (scale < 1e-10) - scale = 1.0 ; - else - scale = 32700.0 / scale ; - - while ((readcount = sf_read_float (sndfile, float_buffer, BUFFER_LEN))) - { for (m = 0 ; m < readcount ; m++) - buffer [m] = scale * float_buffer [m] ; - write (audio_device, buffer, readcount * sizeof (short)) ; - } ; - } - else - { while ((readcount = sf_read_short (sndfile, buffer, BUFFER_LEN))) - write (audio_device, buffer, readcount * sizeof (short)) ; - } ; - - if (ioctl (audio_device, SNDCTL_DSP_POST, 0) == -1) - perror ("ioctl (SNDCTL_DSP_POST) ") ; - - if (ioctl (audio_device, SNDCTL_DSP_SYNC, 0) == -1) - perror ("ioctl (SNDCTL_DSP_SYNC) ") ; - - close (audio_device) ; - - sf_close (sndfile) ; - } ; - - return ; -} /* linux_play */ - -static int -linux_open_dsp_device (int channels, int srate) -{ int fd, stereo, fmt ; - - if ((fd = open ("/dev/dsp", O_WRONLY, 0)) == -1 && - (fd = open ("/dev/sound/dsp", O_WRONLY, 0)) == -1) - { perror ("linux_open_dsp_device : open ") ; - exit (1) ; - } ; - - stereo = 0 ; - if (ioctl (fd, SNDCTL_DSP_STEREO, &stereo) == -1) - { /* Fatal error */ - perror ("linux_open_dsp_device : stereo ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_RESET, 0)) - { perror ("linux_open_dsp_device : reset ") ; - exit (1) ; - } ; - - fmt = CPU_IS_BIG_ENDIAN ? AFMT_S16_BE : AFMT_S16_LE ; - if (ioctl (fd, SOUND_PCM_SETFMT, &fmt) != 0) - { perror ("linux_open_dsp_device : set format ") ; - exit (1) ; - } ; - - if (ioctl (fd, SOUND_PCM_WRITE_CHANNELS, &channels) != 0) - { perror ("linux_open_dsp_device : channels ") ; - exit (1) ; - } ; - - if (ioctl (fd, SOUND_PCM_WRITE_RATE, &srate) != 0) - { perror ("linux_open_dsp_device : sample rate ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_SYNC, 0) != 0) - { perror ("linux_open_dsp_device : sync ") ; - exit (1) ; - } ; - - return fd ; -} /* linux_open_dsp_device */ - -#endif /* __linux__ */ - -/*------------------------------------------------------------------------------ -** Mac OS X functions for playing a sound. -*/ - -#if (defined (__MACH__) && defined (__APPLE__)) /* MacOSX */ - -typedef struct -{ AudioStreamBasicDescription format ; - - UInt32 buf_size ; - AudioDeviceID device ; - - SNDFILE *sndfile ; - SF_INFO sfinfo ; - - int fake_stereo ; - int done_playing ; -} MacOSXAudioData ; - -#include - -static OSStatus -macosx_audio_out_callback (AudioDeviceID device, const AudioTimeStamp* current_time, - const AudioBufferList* data_in, const AudioTimeStamp* time_in, - AudioBufferList* data_out, const AudioTimeStamp* time_out, - void* client_data) -{ MacOSXAudioData *audio_data ; - int size, sample_count, read_count, k ; - float *buffer ; - - /* Prevent compiler warnings. */ - device = device ; - current_time = current_time ; - data_in = data_in ; - time_in = time_in ; - time_out = time_out ; - - audio_data = (MacOSXAudioData*) client_data ; - - size = data_out->mBuffers [0].mDataByteSize ; - sample_count = size / sizeof (float) ; - - buffer = (float*) data_out->mBuffers [0].mData ; - - if (audio_data->fake_stereo != 0) - { read_count = sf_read_float (audio_data->sndfile, buffer, sample_count / 2) ; - - for (k = read_count - 1 ; k >= 0 ; k--) - { buffer [2 * k ] = buffer [k] ; - buffer [2 * k + 1] = buffer [k] ; - } ; - read_count *= 2 ; - } - else - read_count = sf_read_float (audio_data->sndfile, buffer, sample_count) ; - - /* Fill the remainder with zeroes. */ - if (read_count < sample_count) - { if (audio_data->fake_stereo == 0) - memset (&(buffer [read_count]), 0, (sample_count - read_count) * sizeof (float)) ; - /* Tell the main application to terminate. */ - audio_data->done_playing = SF_TRUE ; - } ; - - return noErr ; -} /* macosx_audio_out_callback */ - -static void -macosx_play (int argc, char *argv []) -{ MacOSXAudioData audio_data ; - OSStatus err ; - UInt32 count, buffer_size ; - int k ; - - audio_data.fake_stereo = 0 ; - audio_data.device = kAudioDeviceUnknown ; - - /* get the default output device for the HAL */ - count = sizeof (AudioDeviceID) ; - if ((err = AudioHardwareGetProperty (kAudioHardwarePropertyDefaultOutputDevice, - &count, (void *) &(audio_data.device))) != noErr) - { printf ("AudioHardwareGetProperty (kAudioDevicePropertyDefaultOutputDevice) failed.\n") ; - return ; - } ; - - /* get the buffersize that the default device uses for IO */ - count = sizeof (UInt32) ; - if ((err = AudioDeviceGetProperty (audio_data.device, 0, false, kAudioDevicePropertyBufferSize, - &count, &buffer_size)) != noErr) - { printf ("AudioDeviceGetProperty (kAudioDevicePropertyBufferSize) failed.\n") ; - return ; - } ; - - /* get a description of the data format used by the default device */ - count = sizeof (AudioStreamBasicDescription) ; - if ((err = AudioDeviceGetProperty (audio_data.device, 0, false, kAudioDevicePropertyStreamFormat, - &count, &(audio_data.format))) != noErr) - { printf ("AudioDeviceGetProperty (kAudioDevicePropertyStreamFormat) failed.\n") ; - return ; - } ; - - /* Base setup completed. Now play files. */ - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (audio_data.sndfile = sf_open (argv [k], SFM_READ, &(audio_data.sfinfo)))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (audio_data.sfinfo.channels < 1 || audio_data.sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", audio_data.sfinfo.channels) ; - continue ; - } ; - - audio_data.format.mSampleRate = audio_data.sfinfo.samplerate ; - - if (audio_data.sfinfo.channels == 1) - { audio_data.format.mChannelsPerFrame = 2 ; - audio_data.fake_stereo = 1 ; - } - else - audio_data.format.mChannelsPerFrame = audio_data.sfinfo.channels ; - - if ((err = AudioDeviceSetProperty (audio_data.device, NULL, 0, false, kAudioDevicePropertyStreamFormat, - sizeof (AudioStreamBasicDescription), &(audio_data.format))) != noErr) - { printf ("AudioDeviceSetProperty (kAudioDevicePropertyStreamFormat) failed.\n") ; - return ; - } ; - - /* we want linear pcm */ - if (audio_data.format.mFormatID != kAudioFormatLinearPCM) - return ; - - /* Fire off the device. */ - if ((err = AudioDeviceAddIOProc (audio_data.device, macosx_audio_out_callback, - (void *) &audio_data)) != noErr) - { printf ("AudioDeviceAddIOProc failed.\n") ; - return ; - } ; - - err = AudioDeviceStart (audio_data.device, macosx_audio_out_callback) ; - if (err != noErr) - return ; - - audio_data.done_playing = SF_FALSE ; - - while (audio_data.done_playing == SF_FALSE) - usleep (10 * 1000) ; /* 10 000 milliseconds. */ - - if ((err = AudioDeviceStop (audio_data.device, macosx_audio_out_callback)) != noErr) - { printf ("AudioDeviceStop failed.\n") ; - return ; - } ; - - err = AudioDeviceRemoveIOProc (audio_data.device, macosx_audio_out_callback) ; - if (err != noErr) - { printf ("AudioDeviceRemoveIOProc failed.\n") ; - return ; - } ; - - sf_close (audio_data.sndfile) ; - } ; - - return ; -} /* macosx_play */ - -#endif /* MacOSX */ - - -/*------------------------------------------------------------------------------ -** Win32 functions for playing a sound. -** -** This API sucks. Its needlessly complicated and is *WAY* too loose with -** passing pointers arounf in integers and and using char* pointers to -** point to data instead of short*. It plain sucks! -*/ - -#if (OS_IS_WIN32 == 1) - -#define WIN32_BUFFER_LEN (1<<15) - -typedef struct -{ HWAVEOUT hwave ; - WAVEHDR whdr [2] ; - - CRITICAL_SECTION mutex ; /* to control access to BuffersInUSe */ - HANDLE Event ; /* signal that a buffer is free */ - - short buffer [WIN32_BUFFER_LEN / sizeof (short)] ; - int current, bufferlen ; - int BuffersInUse ; - - SNDFILE *sndfile ; - SF_INFO sfinfo ; - - sf_count_t remaining ; -} Win32_Audio_Data ; - - -static void -win32_play_data (Win32_Audio_Data *audio_data) -{ int thisread, readcount ; - - /* fill a buffer if there is more data and we can read it sucessfully */ - readcount = (audio_data->remaining > audio_data->bufferlen) ? audio_data->bufferlen : (int) audio_data->remaining ; - - thisread = (int) sf_read_short (audio_data->sndfile, (short *) (audio_data->whdr [audio_data->current].lpData), readcount) ; - - audio_data->remaining -= thisread ; - - if (thisread > 0) - { /* Fix buffer length if this is only a partial block. */ - if (thisread < audio_data->bufferlen) - audio_data->whdr [audio_data->current].dwBufferLength = thisread * sizeof (short) ; - - /* Queue the WAVEHDR */ - waveOutWrite (audio_data->hwave, (LPWAVEHDR) &(audio_data->whdr [audio_data->current]), sizeof (WAVEHDR)) ; - - /* count another buffer in use */ - EnterCriticalSection (&audio_data->mutex) ; - audio_data->BuffersInUse ++ ; - LeaveCriticalSection (&audio_data->mutex) ; - - /* use the other buffer next time */ - audio_data->current = (audio_data->current + 1) % 2 ; - } ; - - return ; -} /* win32_play_data */ - -static void CALLBACK -win32_audio_out_callback (HWAVEOUT hwave, UINT msg, DWORD data, DWORD param1, DWORD param2) -{ Win32_Audio_Data *audio_data ; - - /* Prevent compiler warnings. */ - hwave = hwave ; - param1 = param2 ; - - if (data == 0) - return ; - - /* - ** I consider this technique of passing a pointer via an integer as - ** fundamentally broken but thats the way microsoft has defined the - ** interface. - */ - audio_data = (Win32_Audio_Data*) data ; - - /* let main loop know a buffer is free */ - if (msg == MM_WOM_DONE) - { EnterCriticalSection (&audio_data->mutex) ; - audio_data->BuffersInUse -- ; - LeaveCriticalSection (&audio_data->mutex) ; - SetEvent (audio_data->Event) ; - } ; - - return ; -} /* win32_audio_out_callback */ - -/* This is needed for earlier versions of the M$ development tools. */ -#ifndef DWORD_PTR -#define DWORD_PTR DWORD -#endif - -static void -win32_play (int argc, char *argv []) -{ Win32_Audio_Data audio_data ; - - WAVEFORMATEX wf ; - int k, error ; - - audio_data.sndfile = NULL ; - audio_data.hwave = 0 ; - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - - if (! (audio_data.sndfile = sf_open (argv [k], SFM_READ, &(audio_data.sfinfo)))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - audio_data.remaining = audio_data.sfinfo.frames * audio_data.sfinfo.channels ; - audio_data.current = 0 ; - - InitializeCriticalSection (&audio_data.mutex) ; - audio_data.Event = CreateEvent (0, FALSE, FALSE, 0) ; - - wf.nChannels = audio_data.sfinfo.channels ; - wf.wFormatTag = WAVE_FORMAT_PCM ; - wf.cbSize = 0 ; - wf.wBitsPerSample = 16 ; - - wf.nSamplesPerSec = audio_data.sfinfo.samplerate ; - - wf.nBlockAlign = audio_data.sfinfo.channels * sizeof (short) ; - - wf.nAvgBytesPerSec = wf.nBlockAlign * wf.nSamplesPerSec ; - - error = waveOutOpen (&(audio_data.hwave), WAVE_MAPPER, &wf, (DWORD_PTR) win32_audio_out_callback, - (DWORD_PTR) &audio_data, CALLBACK_FUNCTION) ; - if (error) - { puts ("waveOutOpen failed.") ; - audio_data.hwave = 0 ; - continue ; - } ; - - audio_data.whdr [0].lpData = (char*) audio_data.buffer ; - audio_data.whdr [1].lpData = ((char*) audio_data.buffer) + sizeof (audio_data.buffer) / 2 ; - - audio_data.whdr [0].dwBufferLength = sizeof (audio_data.buffer) / 2 ; - audio_data.whdr [1].dwBufferLength = sizeof (audio_data.buffer) / 2 ; - - audio_data.whdr [0].dwFlags = 0 ; - audio_data.whdr [1].dwFlags = 0 ; - - /* length of each audio buffer in samples */ - audio_data.bufferlen = sizeof (audio_data.buffer) / 2 / sizeof (short) ; - - /* Prepare the WAVEHDRs */ - if ((error = waveOutPrepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)))) - { printf ("waveOutPrepareHeader [0] failed : %08X\n", error) ; - waveOutClose (audio_data.hwave) ; - continue ; - } ; - - if ((error = waveOutPrepareHeader (audio_data.hwave, &(audio_data.whdr [1]), sizeof (WAVEHDR)))) - { printf ("waveOutPrepareHeader [1] failed : %08X\n", error) ; - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)) ; - waveOutClose (audio_data.hwave) ; - continue ; - } ; - - /* Fill up both buffers with audio data */ - audio_data.BuffersInUse = 0 ; - win32_play_data (&audio_data) ; - win32_play_data (&audio_data) ; - - /* loop until both buffers are released */ - while (audio_data.BuffersInUse > 0) - { - /* wait for buffer to be released */ - WaitForSingleObject (audio_data.Event, INFINITE) ; - - /* refill the buffer if there is more data to play */ - win32_play_data (&audio_data) ; - } ; - - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)) ; - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [1]), sizeof (WAVEHDR)) ; - - waveOutClose (audio_data.hwave) ; - audio_data.hwave = 0 ; - - DeleteCriticalSection (&audio_data.mutex) ; - - sf_close (audio_data.sndfile) ; - } ; - -} /* win32_play */ - -#endif /* Win32 */ - -/*------------------------------------------------------------------------------ -** Solaris. -*/ - -#if (defined (sun) && defined (unix)) /* ie Solaris */ - -static void -solaris_play (int argc, char *argv []) -{ static short buffer [BUFFER_LEN] ; - audio_info_t audio_info ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - unsigned long delay_time ; - long k, start_count, output_count, write_count, read_count ; - int audio_fd, error, done ; - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - /* open the audio device - write only, non-blocking */ - if ((audio_fd = open ("/dev/audio", O_WRONLY | O_NONBLOCK)) < 0) - { perror ("open (/dev/audio) failed") ; - return ; - } ; - - /* Retrive standard values. */ - AUDIO_INITINFO (&audio_info) ; - - audio_info.play.sample_rate = sfinfo.samplerate ; - audio_info.play.channels = sfinfo.channels ; - audio_info.play.precision = 16 ; - audio_info.play.encoding = AUDIO_ENCODING_LINEAR ; - audio_info.play.gain = AUDIO_MAX_GAIN ; - audio_info.play.balance = AUDIO_MID_BALANCE ; - - if ((error = ioctl (audio_fd, AUDIO_SETINFO, &audio_info))) - { perror ("ioctl (AUDIO_SETINFO) failed") ; - return ; - } ; - - /* Delay time equal to 1/4 of a buffer in microseconds. */ - delay_time = (BUFFER_LEN * 1000000) / (audio_info.play.sample_rate * 4) ; - - done = 0 ; - while (! done) - { read_count = sf_read_short (sndfile, buffer, BUFFER_LEN) ; - if (read_count < BUFFER_LEN) - { memset (&(buffer [read_count]), 0, (BUFFER_LEN - read_count) * sizeof (short)) ; - /* Tell the main application to terminate. */ - done = SF_TRUE ; - } ; - - start_count = 0 ; - output_count = BUFFER_LEN * sizeof (short) ; - - while (output_count > 0) - { /* write as much data as possible */ - write_count = write (audio_fd, &(buffer [start_count]), output_count) ; - if (write_count > 0) - { output_count -= write_count ; - start_count += write_count ; - } - else - { /* Give the audio output time to catch up. */ - usleep (delay_time) ; - } ; - } ; /* while (outpur_count > 0) */ - } ; /* while (! done) */ - - close (audio_fd) ; - } ; - - return ; -} /* solaris_play */ - -#endif /* Solaris */ - -/*============================================================================== -** Main function. -*/ - -int -main (int argc, char *argv []) -{ - if (argc < 2) - { - printf ("\nUsage : %s \n\n", argv [0]) ; -#if (OS_IS_WIN32 == 1) - printf ("This is a Unix style command line application which\n" - "should be run in a MSDOS box or Command Shell window.\n\n") ; - printf ("Sleeping for 5 seconds before exiting.\n\n") ; - - /* This is the officially blessed by microsoft way but I can't get - ** it to link. - ** Sleep (15) ; - ** Instead, use this: - */ - _sleep (5 * 1000) ; -#endif - return 1 ; - } ; - -#if defined (__linux__) - #if HAVE_ALSA_ASOUNDLIB_H - if (access ("/proc/asound/cards", R_OK) == 0) - alsa_play (argc, argv) ; - else - #endif - linux_play (argc, argv) ; -#elif (defined (__MACH__) && defined (__APPLE__)) - macosx_play (argc, argv) ; -#elif (defined (sun) && defined (unix)) - solaris_play (argc, argv) ; -#elif (OS_IS_WIN32 == 1) - win32_play (argc, argv) ; -#elif defined (__BEOS__) - printf ("This program cannot be compiled on BeOS.\n") ; - printf ("Instead, compile the file sfplay_beos.cpp.\n") ; - return 1 ; -#else - puts ("*** Playing sound not yet supported on this platform.") ; - puts ("*** Please feel free to submit a patch.") ; - return 1 ; -#endif - - return 0 ; -} /* main */ -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 8fc4110d-6cec-4e03-91df-0f384cabedac -*/ diff --git a/libs/libsndfile/examples/sndfile-to-text.c b/libs/libsndfile/examples/sndfile-to-text.c deleted file mode 100644 index 466bb860b5..0000000000 --- a/libs/libsndfile/examples/sndfile-to-text.c +++ /dev/null @@ -1,128 +0,0 @@ -/* -** Copyright (C) 2008-2012 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include - -#define BLOCK_SIZE 512 - -static void -print_usage (char *progname) -{ printf ("\nUsage : %s \n", progname) ; - puts ("\n" - " Where the output file will contain a line for each frame\n" - " and a column for each channel.\n" - ) ; - -} /* print_usage */ - -static void -convert_to_text (SNDFILE * infile, FILE * outfile, int channels) -{ float buf [channels * BLOCK_SIZE] ; - int k, m, readcount ; - - while ((readcount = sf_readf_float (infile, buf, BLOCK_SIZE)) > 0) - { for (k = 0 ; k < readcount ; k++) - { for (m = 0 ; m < channels ; m++) - fprintf (outfile, " % 12.10f", buf [k * channels + m]) ; - fprintf (outfile, "\n") ; - } ; - } ; - - return ; -} /* convert_to_text */ - -int -main (int argc, char * argv []) -{ char *progname, *infilename, *outfilename ; - SNDFILE *infile = NULL ; - FILE *outfile = NULL ; - SF_INFO sfinfo ; - - progname = strrchr (argv [0], '/') ; - progname = progname ? progname + 1 : argv [0] ; - - if (argc != 3) - { print_usage (progname) ; - return 1 ; - } ; - - infilename = argv [1] ; - outfilename = argv [2] ; - - if (strcmp (infilename, outfilename) == 0) - { printf ("Error : Input and output filenames are the same.\n\n") ; - print_usage (progname) ; - return 1 ; - } ; - - if (infilename [0] == '-') - { printf ("Error : Input filename (%s) looks like an option.\n\n", infilename) ; - print_usage (progname) ; - return 1 ; - } ; - - if (outfilename [0] == '-') - { printf ("Error : Output filename (%s) looks like an option.\n\n", outfilename) ; - print_usage (progname) ; - return 1 ; - } ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL) - { printf ("Not able to open input file %s.\n", infilename) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - /* Open the output file. */ - if ((outfile = fopen (outfilename, "w")) == NULL) - { printf ("Not able to open output file %s : %s\n", outfilename, sf_strerror (NULL)) ; - return 1 ; - } ; - - fprintf (outfile, "# Converted from file %s.\n", infilename) ; - fprintf (outfile, "# Channels %d, Sample rate %d\n", sfinfo.channels, sfinfo.samplerate) ; - - convert_to_text (infile, outfile, sfinfo.channels) ; - - sf_close (infile) ; - fclose (outfile) ; - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/examples/sndfilehandle.cc b/libs/libsndfile/examples/sndfilehandle.cc deleted file mode 100644 index c9a1931aea..0000000000 --- a/libs/libsndfile/examples/sndfilehandle.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* -** Copyright (C) 2007-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include - -#include - -#define BUFFER_LEN 1024 - -static void -create_file (const char * fname, int format) -{ static short buffer [BUFFER_LEN] ; - - SndfileHandle file ; - int channels = 2 ; - int srate = 48000 ; - - printf ("Creating file named '%s'\n", fname) ; - - file = SndfileHandle (fname, SFM_WRITE, format, channels, srate) ; - - memset (buffer, 0, sizeof (buffer)) ; - - file.write (buffer, BUFFER_LEN) ; - - puts ("") ; - /* - ** The SndfileHandle object will automatically close the file and - ** release all allocated memory when the object goes out of scope. - ** This is the Resource Acquisition Is Initailization idom. - ** See : http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization - */ -} /* create_file */ - -static void -read_file (const char * fname) -{ static short buffer [BUFFER_LEN] ; - - SndfileHandle file ; - - file = SndfileHandle (fname) ; - - printf ("Opened file '%s'\n", fname) ; - printf (" Sample rate : %d\n", file.samplerate ()) ; - printf (" Channels : %d\n", file.channels ()) ; - - file.read (buffer, BUFFER_LEN) ; - - puts ("") ; - - /* RAII takes care of destroying SndfileHandle object. */ -} /* read_file */ - -int -main (void) -{ const char * fname = "test.wav" ; - - puts ("\nSimple example showing usage of the C++ SndfileHandle object.\n") ; - - create_file (fname, SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - - read_file (fname) ; - - puts ("Done.\n") ; - return 0 ; -} /* main */ - - diff --git a/libs/libsndfile/libsndfile.spec.in b/libs/libsndfile/libsndfile.spec.in deleted file mode 100644 index d4427289a2..0000000000 --- a/libs/libsndfile/libsndfile.spec.in +++ /dev/null @@ -1,69 +0,0 @@ - -%define name @PACKAGE@ -%define version @VERSION@ -%define release 1 - -Summary: A library to handle various audio file formats. -Name: %{name} -Version: %{version} -Release: %{release} -Copyright: LGPL -Group: Libraries/Sound -Source: http://www.mega-nerd.com/libsndfile/libsndfile-%{version}.tar.gz -Url: http://www.mega-nerd.com/libsndfile/ -BuildRoot: /var/tmp/%{name}-%{version} - -%description -libsndfile is a C library for reading and writing sound files such as -AIFF, AU and WAV files through one standard interface. It can currently -read/write 8, 16, 24 and 32-bit PCM files as well as 32-bit floating -point WAV files and a number of compressed formats. - -%package devel -Summary: Libraries, includes, etc to develop libsndfile applications -Group: Libraries - -%description devel -Libraries, include files, etc you can use to develop libsndfile applications. - -%prep -%setup - -%build -%configure -make - -%install -if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi -mkdir -p $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install -%clean -if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi - -%files -%defattr(-,root,root) -%doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO doc -%{_libdir}/libsndfile.so.* -%{_bindir}/* -%{_mandir}/man1/* -%{_datadir}/octave/site/m/* -%{_defaultdocdir}/libsndfile1-dev/html/* - -%files devel -%defattr(-,root,root) -%{_libdir}/libsndfile.a -%{_libdir}/libsndfile.la -%{_libdir}/libsndfile.so -%{_includedir}/sndfile.h -%{_libdir}/pkgconfig/sndfile.pc - -%changelog -* Sun May 15 2005 Erik de Castro Lopo -- Add html files to the files section. -* Tue Sep 16 2003 Erik de Castro Lopo -- Apply corrections from Andrew Schultz. -* Mon Oct 21 2002 Erik de Castro Lopo -- Force installation of sndfile.pc file. -* Thu Jul 6 2000 Josh Green -- Created libsndfile.spec.in - diff --git a/libs/libsndfile/make_lite.py b/libs/libsndfile/make_lite.py deleted file mode 100644 index eee69fc82d..0000000000 --- a/libs/libsndfile/make_lite.py +++ /dev/null @@ -1,491 +0,0 @@ -#!/usr/bin/python - -import commands, os, re, string, sys, time - -def count_enclosed_functions (source): - func_count = 0 - open_brace = 0 - close_brace = 0 - for ch in source: - if ch == '{': - open_brace += 1 - elif ch == '}': - close_brace += 1 - if open_brace == close_brace: - func_count += 1 - if open_brace < close_brace: - print "count_enclosed_functions : open_brace < close_brace" - return -1 - return func_count - -def find_function_prototype (source, proto_name): - proto_re = "(^[a-zA-Z_ \t]+\s+%s[^a-zA-Z0-9_]\s*\([^\)]+\)\s+;\n)" % (proto_name) - proto_result = re.search (proto_re, source, re.MULTILINE | re.DOTALL) - if not proto_result: - return None - proto_text = proto_result.groups ()[0] - return proto_text - -def find_function_definition (source, func_name): - func_re = "(\n[a-zA-Z_ \t]+\n%s[^a-zA-Z0-9_].* /\* %s \*/\n)" % (func_name, func_name) - func_result = re.search (func_re, source, re.MULTILINE | re.DOTALL) - if not func_result: - sys.exit (1) - return None - func_text = func_result.groups ()[0] - - # Now to check that we only have one enclosing function. - func_count = count_enclosed_functions (func_text) - if func_count != 1: - return None - return func_text - -def find_include (source, inc_name): - inc_re = "(^#include\s+[\<\"]%s[\"\>]\s*)" % inc_name - inc_result = re.search (inc_re, source, re.MULTILINE | re.DOTALL) - if not inc_result: - return None - inc_text = inc_result.groups ()[0] - return inc_text - -def find_assign_statement (source, var_name): - var_re = "(^\s+%s\s*=[^;]+;)" % var_name - var_result = re.search (var_re, source, re.MULTILINE | re.DOTALL) - if not var_result: - return None - assign_text = var_result.groups ()[0] - return assign_text - -#-------------------------------------------------------------------------------- - -def remove_include (source, inc_name): - inc_text = find_include (source, inc_name) - if not inc_text: - print "remove_include : include '%s' not found. Exiting." % inc_name - sys.exit (1) - - source = string.replace (source, inc_text, "") - return source - -def remove_assign (source, assign_name): - assign_text = find_assign (source, inc_name) - if not inc_text: - print "remove_include : include '%s' not found. Exiting." % inc_name - sys.exit (1) - - source = string.replace (source, inc_text, "") - return source - -def remove_prototype (source, proto_name): - proto_text = find_function_prototype (source, proto_name) - if not proto_text: - print "remove_prototype : prototype '%s' not found. Exiting." % proto_name - sys.exit (1) - - source = string.replace (source, proto_text, "") - return source - -def remove_function (source, func_name): - func_text = find_function_definition (source, func_name) - if not func_text: - print "remove_function : function '%s' not found. Exiting." % func_name - sys.exit (1) - - source = string.replace (source, func_text, "/* Function %s() removed here. */\n" % func_name) - return source - -def remove_all_assignments (source, var): - count = 0 - while 1: - assign_text = find_assign_statement (source, var) - if not assign_text: - if count != 0: - break - print "remove_all_assignments : variable '%s' not found. Exiting." % var - sys.exit (1) - - source = string.replace (source, assign_text, "") - count += 1 - return source - - - -#---------------------------------------------------------------- - -def remove_funcs_and_protos_from_file (filename, func_list): - source_code = open (filename, 'r').read () - - for func in func_list: - source_code = remove_prototype (source_code, func) ; - source_code = remove_function (source_code, func) ; - open (filename, 'w').write (source_code) - -def remove_funcs_from_file (filename, func_list): - source_code = open (filename, 'r').read () - - for func in func_list: - source_code = remove_function (source_code, func) ; - open (filename, 'w').write (source_code) - -def remove_protos_from_file (filename, func_list): - source_code = open (filename, 'r').read () - - for func in func_list: - source_code = remove_prototype (source_code, func) ; - open (filename, 'w').write (source_code) - -def remove_includes_from_file (filename, inc_list): - source_code = open (filename, 'r').read () - - for inc in inc_list: - source_code = remove_include (source_code, inc) ; - open (filename, 'w').write (source_code) - -def remove_all_assignments_from_file (filename, var_list): - source_code = open (filename, 'r').read () - - for var in var_list: - source_code = remove_all_assignments (source_code, var) ; - open (filename, 'w').write (source_code) - -def remove_comment_start_end (filename, start_comment, end_comment): - source_code = open (filename, 'r').read () - - while 1: - start_index = string.find (source_code, start_comment) - end_index = string.find (source_code, end_comment) - if start_index < 0 or end_index < start_index: - break - end_index += len (end_comment) - source_code = source_code [:start_index-1] + source_code [end_index:] ; - - open (filename, 'w').write (source_code) - -def remove_strings_from_file (filename, str_list): - file_text = open (filename, 'r').read () - for current_str in str_list: - file_text = string.replace (file_text, current_str, '') - open (filename, 'w').write (file_text) - -def string_replace_in_file (filename, from_str, to_str): - file_text = open (filename, 'r').read () - file_text = string.replace (file_text, from_str, to_str) - open (filename, 'w').write (file_text) - -def remove_regex_from_file (filename, regex_list): - file_text = open (filename, 'r').read () - for regex in regex_list: - file_text = re.sub (regex, '', file_text, re.MULTILINE | re.DOTALL) - open (filename, 'w').write (file_text) - -#========================================================================== - -def find_configure_version (filename): - # AM_INIT_AUTOMAKE(libsndfile,0.0.21pre6) - file = open (filename) - while 1: - line = file.readline () - if re.search ("AC_INIT", line): - x = re.sub ("[^\(]+\(", "", line) - x = re.sub ("\).*\n", "", x) - x = string.split (x, ",") - package = x [0] - version = x [1] - break - file.close () - # version = re.escape (version) - return package, version - -def fix_configure_ac_file (filename): - data = open (filename, 'r').read () - data = string.replace (data, "AM_INIT_AUTOMAKE(libsndfile,", "AM_INIT_AUTOMAKE(libsndfile_lite,", 1) - - file = open (filename, 'w') - file.write (data) - file.close () - - -def make_dist_file (package, version): - print "Making dist file." - tar_gz_file = "%s-%s.tar.gz" % (package, version) - if os.path.exists (tar_gz_file): - return - if os.system ("make dist"): - sys.exit (1) - return - -def delete_files (file_list): - for file_name in file_list: - os.remove (file_name) - -#======================================================================= - -source_dir = os.getcwd () - -conf_package, conf_version = find_configure_version ('configure.ac') - -package_version = "%s-%s" % (conf_package, conf_version) -lite_version = "%s_lite-%s" % (conf_package, conf_version) - -os.system ("rm -rf %s%s.tar.gz" % (source_dir, package_version)) - -os.system ("make dist") - -make_dist_file (conf_package, conf_version) - -os.chdir ("/tmp") - -print "Uncompressing .tar.gz file." -os.system ("rm -rf %s" % package_version) -if os.system ("tar zxf %s/%s.tar.gz" % (source_dir, package_version)): - sys.exit (1) - - -print "Renaming to libsndfile_lite." -os.system ("rm -rf %s" % lite_version) -os.rename (package_version, lite_version) - -print "Changing into libsndfile_lite directory." -os.chdir (lite_version) - -print "Removing un-neeed directories." -delete_dirs = [ 'src/G72x' ] - -for dir_name in delete_dirs: - os.system ("rm -rf %s" % dir_name) - -print "Removing un-needed files." -delete_files ([ 'src/ircam.c', 'src/nist.c', - 'src/ima_adpcm.c', 'src/ms_adpcm.c', 'src/au_g72x.c', - 'src/mat4.c', 'src/mat5.c', 'src/dwvw.c', 'src/paf.c', - 'src/ogg.c', 'src/pvf.c', 'src/xi.c', 'src/htk.c', - 'src/sd2.c', 'src/rx2.c', 'src/txw.c', 'src/wve.c', - 'src/dwd.c', 'src/svx.c', 'src/voc.c', 'src/vox_adpcm.c', - 'src/sds.c' - ]) - - -print "Hacking 'configure.ac' and 'src/Makefile.am'." -remove_strings_from_file ('configure.ac', [ 'src/G72x/Makefile' ]) -remove_strings_from_file ('src/Makefile.am', [ 'G72x/libg72x.la', 'G72x', - 'ircam.c', 'nist.c', 'ima_adpcm.c', 'ms_adpcm.c', 'au_g72x.c', 'mat4.c', - 'mat5.c', 'dwvw.c', 'paf.c', 'ogg.c', 'pvf.c', 'xi.c', 'htk.c', - 'sd2.c', 'rx2.c', 'txw.c', 'wve.c', 'dwd.c', 'svx.c', 'voc.c', - 'vox_adpcm.c', 'sds.c' - ]) - -#---------------------------------------------------------------------------- - -print "Hacking header files." - -remove_protos_from_file ('src/common.h', [ 'xi_open', 'sd2_open', 'ogg_open', - 'dwvw_init', 'paf_open', 'svx_open', 'nist_open', 'rx2_open', 'mat4_open', - 'voc_open', 'txw_open', 'dwd_open', 'htk_open', 'wve_open', 'mat5_open', - 'pvf_open', 'ircam_open', 'sds_open', - 'float32_init', 'double64_init', 'aiff_ima_init', 'vox_adpcm_init', - 'wav_w64_ima_init', 'wav_w64_msadpcm_init' - ]) - -remove_protos_from_file ('src/au.h', - [ 'au_g72x_reader_init', 'au_g72x_writer_init' ]) - -remove_protos_from_file ('src/wav_w64.h', [ 'msadpcm_write_adapt_coeffs' ]) - -#---------------------------------------------------------------------------- - -print "Hacking case statements." - -remove_comment_start_end ('src/sndfile.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/aiff.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/au.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/raw.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/w64.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/wav.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/double64.c', '/* Lite remove start */' , '/* Lite remove end */') -remove_comment_start_end ('src/float32.c', '/* Lite remove start */' , '/* Lite remove end */') - - -#---------------------------------------------------------------------------- - -print "Hacking src/pcm.c." -remove_funcs_from_file ('src/pcm.c', [ - 'f2sc_array', 'f2sc_clip_array', 'f2uc_array', 'f2uc_clip_array', - 'f2bes_array', 'f2bes_clip_array', 'f2les_array', 'f2les_clip_array', - 'f2let_array', 'f2let_clip_array', 'f2bet_array', 'f2bet_clip_array', - 'f2bei_array', 'f2bei_clip_array', 'f2lei_array', 'f2lei_clip_array', - 'd2sc_array', 'd2sc_clip_array', 'd2uc_array', 'd2uc_clip_array', - 'd2bes_array', 'd2bes_clip_array', 'd2les_array', 'd2les_clip_array', - 'd2let_array', 'd2let_clip_array', 'd2bet_array', 'd2bet_clip_array', - 'd2bei_array', 'd2bei_clip_array', 'd2lei_array', 'd2lei_clip_array', - ]) - -remove_funcs_and_protos_from_file ('src/pcm.c', [ - 'pcm_read_sc2f', 'pcm_read_uc2f', 'pcm_read_les2f', 'pcm_read_bes2f', - 'pcm_read_let2f', 'pcm_read_bet2f', 'pcm_read_lei2f', 'pcm_read_bei2f', - 'pcm_read_sc2d', 'pcm_read_uc2d', 'pcm_read_les2d', 'pcm_read_bes2d', - 'pcm_read_let2d', 'pcm_read_bet2d', 'pcm_read_lei2d', 'pcm_read_bei2d', - 'pcm_write_f2sc', 'pcm_write_f2uc', 'pcm_write_f2bes', 'pcm_write_f2les', - 'pcm_write_f2bet', 'pcm_write_f2let', 'pcm_write_f2bei', 'pcm_write_f2lei', - 'pcm_write_d2sc', 'pcm_write_d2uc', 'pcm_write_d2bes', 'pcm_write_d2les', - 'pcm_write_d2bet', 'pcm_write_d2let', 'pcm_write_d2bei', 'pcm_write_d2lei', - - 'sc2f_array', 'uc2f_array', 'bes2f_array', 'les2f_array', - 'bet2f_array', 'let2f_array', 'bei2f_array', 'lei2f_array', - 'sc2d_array', 'uc2d_array', 'bes2d_array', 'les2d_array', - 'bet2d_array', 'let2d_array', 'bei2d_array', 'lei2d_array' - ]) - -remove_includes_from_file ('src/pcm.c', [ 'float_cast.h' ]) -remove_all_assignments_from_file ('src/pcm.c', [ - 'psf-\>write_float', 'psf\-\>write_double', - 'psf-\>read_float', 'psf\-\>read_double' ]) - -#---------------------------------------------------------------------------- -print "Hacking src/ulaw.c." -remove_funcs_and_protos_from_file ('src/ulaw.c', [ - 'ulaw_read_ulaw2f', 'ulaw_read_ulaw2d', - 'ulaw_write_f2ulaw', 'ulaw_write_d2ulaw', - 'ulaw2f_array', 'ulaw2d_array', 'f2ulaw_array', 'd2ulaw_array' - ]) - -remove_includes_from_file ('src/ulaw.c', [ 'float_cast.h' ]) -remove_all_assignments_from_file ('src/ulaw.c', [ - 'psf-\>write_float', 'psf\-\>write_double', - 'psf-\>read_float', 'psf\-\>read_double' ]) - -#---------------------------------------------------------------------------- - -print "Hacking src/alaw.c." -remove_funcs_and_protos_from_file ('src/alaw.c', [ - 'alaw_read_alaw2f', 'alaw_read_alaw2d', - 'alaw_write_f2alaw', 'alaw_write_d2alaw', - 'alaw2f_array', 'alaw2d_array', 'f2alaw_array', 'd2alaw_array' - ]) - -remove_includes_from_file ('src/alaw.c', [ 'float_cast.h' ]) -remove_all_assignments_from_file ('src/alaw.c', [ - 'psf-\>write_float', 'psf\-\>write_double', - 'psf-\>read_float', 'psf\-\>read_double' ]) - -#---------------------------------------------------------------------------- - -print "Hacking src/gsm610.c." -remove_funcs_and_protos_from_file ('src/gsm610.c', [ - 'gsm610_read_f', 'gsm610_read_d', 'gsm610_write_f', 'gsm610_write_d' - ]) - -remove_includes_from_file ('src/gsm610.c', [ 'float_cast.h' ]) -remove_all_assignments_from_file ('src/gsm610.c', [ - 'psf-\>write_float', 'psf\-\>write_double', - 'psf-\>read_float', 'psf\-\>read_double' ]) - -#---------------------------------------------------------------------------- - -print "Hacking src/float32.c." - -# string_replace_in_file ('src/float32.c', '"float_cast.h"', '') -remove_funcs_from_file ('src/float32.c', [ 'float32_init' ]) - -remove_funcs_and_protos_from_file ('src/float32.c', [ - 'host_read_f2s', 'host_read_f2i', 'host_read_f', 'host_read_f2d', - 'host_write_s2f', 'host_write_i2f', 'host_write_f', 'host_write_d2f', - 'f2s_array', 'f2i_array', 'f2d_array', 's2f_array', 'i2f_array', 'd2f_array', - 'float32_peak_update', - 'replace_read_f2s', 'replace_read_f2i', 'replace_read_f', 'replace_read_f2d', - 'replace_write_s2f', 'replace_write_i2f', 'replace_write_f', 'replace_write_d2f', - 'bf2f_array', 'f2bf_array', - 'float32_get_capability', - ]) - -#---------------------------------------------------------------------------- - -print "Hacking src/double64.c." -remove_funcs_from_file ('src/double64.c', [ 'double64_init' ]) - -remove_funcs_and_protos_from_file ('src/double64.c', [ - 'host_read_d2s', 'host_read_d2i', 'host_read_d2f', 'host_read_d', - 'host_write_s2d', 'host_write_i2d', 'host_write_f2d', 'host_write_d', - 'd2s_array', 'd2i_array', 'd2f_array', - 's2d_array', 'i2d_array', 'f2d_array', - 'double64_peak_update', 'double64_get_capability', - 'replace_read_d2s', 'replace_read_d2i', 'replace_read_d2f', 'replace_read_d', - 'replace_write_s2d', 'replace_write_i2d', 'replace_write_f2d', 'replace_write_d', - 'd2bd_read', 'bd2d_write' - ]) - -#---------------------------------------------------------------------------- - -print "Hacking test programs." -delete_files ([ 'tests/dwvw_test.c', 'tests/floating_point_test.c', - 'tests/dft_cmp.c', 'tests/peak_chunk_test.c', - 'tests/scale_clip_test.tpl', 'tests/scale_clip_test.def' - ]) - -remove_comment_start_end ('tests/write_read_test.def', '/* Lite remove start */', '/* Lite remove end */') -remove_comment_start_end ('tests/write_read_test.tpl', '/* Lite remove start */', '/* Lite remove end */') - -remove_comment_start_end ('tests/Makefile.am', '# Lite remove start', '# Lite remove end') - -remove_strings_from_file ('tests/Makefile.am', [ - 'scale_clip_test.tpl', 'scale_clip_test.def', - '\n\t./dwvw_test', - '\n\t./floating_point_test', '\n\t./scale_clip_test', - '\n\t./peak_chunk_test aiff', '\n\t./peak_chunk_test wav', - '\n\t./command_test norm', '\n\t./command_test peak', - '\n\t./lossy_comp_test wav_ima', '\n\t./lossy_comp_test wav_msadpcm', - '\n\t./lossy_comp_test au_g721', '\n\t./lossy_comp_test au_g723', - '\n\t./lossy_comp_test vox_adpcm', - '\n\t./lossy_comp_test w64_ima', '\n\t./lossy_comp_test w64_msadpcm', - 'peak_chunk_test', 'dwvw_test', 'floating_point_test', 'scale_clip_test', - - 'paf-tests', 'svx-tests', 'nist-tests', 'ircam-tests', 'voc-tests', - 'mat4-tests', 'mat5-tests', 'pvf-tests', 'xi-tests', 'htk-tests', - 'sds-tests' - ]) - -remove_comment_start_end ('tests/pcm_test.c', '/* Lite remove start */', '/* Lite remove end */') -remove_funcs_and_protos_from_file ('tests/pcm_test.c', [ - 'pcm_test_float', 'pcm_test_double' - ]) - -remove_comment_start_end ('tests/lossy_comp_test.c', '/* Lite remove start */', '/* Lite remove end */') -remove_funcs_and_protos_from_file ('tests/lossy_comp_test.c', [ - 'lcomp_test_float', 'lcomp_test_double', 'sdlcomp_test_float', 'sdlcomp_test_double', - 'smoothed_diff_float', 'smoothed_diff_double' - ]) - -remove_comment_start_end ('tests/multi_file_test.c', '/* Lite remove start */', '/* Lite remove end */') - -remove_strings_from_file ('tests/stdio_test.c', [ - '"paf",', '"svx",', '"nist",', '"ircam",', '"voc",', '"mat4",', '"mat5",', '"pvf",' - ]) - -remove_comment_start_end ('tests/pipe_test.c', '/* Lite remove start */', '/* Lite remove end */') - -#---------------------------------------------------------------------------- - -print "Fixing configure.ac file." -fix_configure_ac_file ('configure.ac') - -print "Building and testing source." - # Try --disable-shared --disable-gcc-opt -if os.system ("./reconfigure.mk && ./configure --disable-shared --disable-gcc-opt && make check"): - os.system ('PS1="FIX > " bash --norc') - sys.exit (1) - -print "Making distcheck" -if os.system ("make distcheck"): - os.system ('PS1="FIX > " bash --norc') - sys.exit (1) - -print "Copying tarball" -if os.system ("cp %s.tar.gz %s" % (lite_version, source_dir)): - print "??? %s.tar.gz ???" % lite_version - os.system ('PS1="FIX > " bash --norc') - sys.exit (1) - -os.chdir (source_dir) - -os.system ("rm -rf /tmp/%s" % lite_version) - -print "Done." diff --git a/libs/libsndfile/man/Makefile.am b/libs/libsndfile/man/Makefile.am deleted file mode 100644 index 3f5d9efdc4..0000000000 --- a/libs/libsndfile/man/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -## Process this file with automake to produce Makefile.in - -man_MANS = sndfile-info.1 sndfile-play.1 sndfile-convert.1 sndfile-cmp.1 \ - sndfile-metadata-get.1 sndfile-metadata-set.1 sndfile-concat.1 \ - sndfile-interleave.1 sndfile-deinterleave.1 - -EXTRA_DIST = sndfile-info.1 sndfile-play.1 sndfile-convert.1 sndfile-cmp.1 \ - sndfile-metadata-get.1 sndfile-concat.1 sndfile-interleave.1 - -# Same manpage for both programs. -sndfile-metadata-set.1 : sndfile-metadata-get.1 - $(LN_S) $(srcdir)/sndfile-metadata-get.1 $@ - -sndfile-deinterleave.1 : sndfile-interleave.1 - $(LN_S) $(srcdir)/sndfile-interleave.1 $@ diff --git a/libs/libsndfile/man/sndfile-cmp.1 b/libs/libsndfile/man/sndfile-cmp.1 deleted file mode 100644 index 30870bdfc3..0000000000 --- a/libs/libsndfile/man/sndfile-cmp.1 +++ /dev/null @@ -1,16 +0,0 @@ -.TH SNDFILE-CMP 1 "October 5, 2009" -.SH NAME -sndfile-cmp \- compares two audio files -.SH SYNOPSIS -.B sndfile-cmp -.RI "file1 file2" -.SH DESCRIPTION -sndfile-cmp compares the audio data of two sound files. In particular most -differences in the audio file header, particularly metadata like string info, -are completely ignored. - -sndfile-cmp does its work using libsndfile -(http://www.mega-nerd.com/libsndfile/). -.SH AUTHOR -This manual page was written by Erik de Castro Lopo . - diff --git a/libs/libsndfile/man/sndfile-concat.1 b/libs/libsndfile/man/sndfile-concat.1 deleted file mode 100644 index 1d95765f6c..0000000000 --- a/libs/libsndfile/man/sndfile-concat.1 +++ /dev/null @@ -1,16 +0,0 @@ -.TH SNDFILE-CONCAT 1 "December 9, 2009" -.SH NAME -sndfile-concat \- concatenates two or more audio files -.SH SYNOPSIS -.B sndfile-concat -.RI "infile1 infile2 .... outfile" -.SH DESCRIPTION -sndfile-concat generates a new output file by concatenating two or more input -files. The format of the output file is the same as the format of the input -file. - -sndfile-concat does its work using libsndfile -(http://www.mega-nerd.com/libsndfile/). -.SH AUTHOR -This manual page was written by Erik de Castro Lopo . - diff --git a/libs/libsndfile/man/sndfile-convert.1 b/libs/libsndfile/man/sndfile-convert.1 deleted file mode 100644 index 583c9562c9..0000000000 --- a/libs/libsndfile/man/sndfile-convert.1 +++ /dev/null @@ -1,22 +0,0 @@ -.TH SNDFILE-CONVERT 1 "October 09, 2002" -.SH NAME -sndfile-convert \- convert a sound files from one format to another -.SH SYNOPSIS -.B sndfile-convert -.RI "[encoding] input_file output_file" -.LP -.B sndfile-convert -.RI --help -.SH DESCRIPTION -sndfile-convert converts sound files from one format to another using -libsndfile (http://www.mega-nerd.com/libsndfile/) to read and write -the data. -.LP -The format of the output file is determined by the filename extension -of the output file. -.LP -The optional encoding parameter allows setting of the data encoding for -the output file. Run "sndfile\-convert \-\-help" for more information. -.SH AUTHOR -This manual page was written by Erik de Castro Lopo . - diff --git a/libs/libsndfile/man/sndfile-info.1 b/libs/libsndfile/man/sndfile-info.1 deleted file mode 100644 index b66875852d..0000000000 --- a/libs/libsndfile/man/sndfile-info.1 +++ /dev/null @@ -1,16 +0,0 @@ -.TH SNDFILE-INFO 1 "July 28, 2002" -.SH NAME -sndfile-info \- display information about a sound file -.SH SYNOPSIS -.B sndfile-info -.RI file -.SH DESCRIPTION -sndfile-info will display basic information about a sound file such as -its format, its sample rate, and the number of channels. This information -is obtained using libsndfile (http://www.mega-nerd.com/libsndfile/). -.SH AUTHOR -This manual page was originally written by Joshua Haberman -, for the Debian GNU/Linux system (but may be used by -others). Further additions have been made by Erik de Castro Lopo -. - diff --git a/libs/libsndfile/man/sndfile-interleave.1 b/libs/libsndfile/man/sndfile-interleave.1 deleted file mode 100644 index 26ca345205..0000000000 --- a/libs/libsndfile/man/sndfile-interleave.1 +++ /dev/null @@ -1,23 +0,0 @@ -.TH SNDFILE-INTERLEAVE 1 "December 14, 2009" -.SH NAME -sndfile-interleave \- convert multiple single channel files into a multi-channel file -.br -sndfile-deinterleave \- split a multi-channel into multiple single channel files -.SH SYNOPSIS -.B sndfile-interleave -.RI " ... -o " -.br -.B sndfile-deinterleave -.RI "filename" - -.SH DESCRIPTION -sndfile-interleave and sndfile-deinterleave use libsndfile -(http://www.mega-nerd.com/libsndfile/) to convert back and forth between multiple -single channel files and a single multi-channel sound file. - -Run "sndfile\-interleave \-\-help" or "sndfile\-deinterleave \-\-help" for -more information - -.SH AUTHOR -This manual page was written by Erik de Castro Lopo . - diff --git a/libs/libsndfile/man/sndfile-metadata-get.1 b/libs/libsndfile/man/sndfile-metadata-get.1 deleted file mode 100644 index b97560ea39..0000000000 --- a/libs/libsndfile/man/sndfile-metadata-get.1 +++ /dev/null @@ -1,26 +0,0 @@ -.TH SNDFILE-METADATA-GET 1 "October 6, 2009" -.SH NAME -sndfile-metadata-get \- retrieve metadata from a sound file -.br -sndfile-metadata-set \- set metadata in a sound file -.SH SYNOPSIS -.B sndfile-metadata-get -.RI "[options] file" -.br -.B sndfile-metadata-set -.RI "[options] file" -.br -.B sndfile-metadata-set -.RI "[options] input-file output-file" - -.SH DESCRIPTION -sndfile-metadata-get and sndfile-metadata-set use libsndfile -(http://www.mega-nerd.com/libsndfile/) to retrieve metadata from or set metadata -in a sound file. - -Run "sndfile\-metadata\-get \-\-help" or "sndfile\-metadata\-set \-\-help" for -more information - -.SH AUTHOR -This manual page was written by Erik de Castro Lopo . - diff --git a/libs/libsndfile/man/sndfile-play.1 b/libs/libsndfile/man/sndfile-play.1 deleted file mode 100644 index 0196461c19..0000000000 --- a/libs/libsndfile/man/sndfile-play.1 +++ /dev/null @@ -1,36 +0,0 @@ -.de EX -.ne 5 -.if n .sp 1 -.if t .sp .5 -.nf -.in +.5i -.. -.de EE -.fi -.in -.5i -.if n .sp 1 -.if t .sp .5 -.. -.TH SNDFILE-PLAY 1 "July 28, 2002" -.SH NAME -sndfile-play \- play a sound file -.SH SYNOPSIS -.B sndfile-play -.RI file -.SH DESCRIPTION -sndfile-play plays the specified sound file using : -.EX -ALSA on Linux -/dev/dsp on systems supporting OSS (including Linux) -/dev/audio on Sun Solaris -CoreAudio on Apple MacOSX -waveOut on Microsoft Win32 -.EE -sndfile-play uses libsndfile (http://www.mega-nerd.com/libsndfile/) -to read the file. -.SH AUTHOR -This manual page was originally written by Joshua Haberman -, for the Debian GNU/Linux system (but may be used by -others). Further additions have been made by Erik de Castro Lopo -. - diff --git a/libs/libsndfile/programs/Makefile.am b/libs/libsndfile/programs/Makefile.am deleted file mode 100644 index 81495539b3..0000000000 --- a/libs/libsndfile/programs/Makefile.am +++ /dev/null @@ -1,47 +0,0 @@ -## Process this file with automake to produce Makefile.in - -bin_PROGRAMS = sndfile-info sndfile-play sndfile-convert sndfile-cmp \ - sndfile-metadata-set sndfile-metadata-get sndfile-interleave \ - sndfile-deinterleave sndfile-concat sndfile-salvage - -OS_SPECIFIC_CFLAGS = @OS_SPECIFIC_CFLAGS@ -OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@ - -AM_CPPFLAGS = -I$(top_srcdir)/src $(OS_SPECIFIC_CFLAGS) - -CLEANFILES = *~ sndfile-*.exe - -# This is the BeOS version of sndfile-play. It needs to be compiled with the C++ -# compiler. -EXTRA_DIST = sndfile-play-beos.cpp test-sndfile-metadata-set.py - -sndfile_info_SOURCES = sndfile-info.c common.c common.h -sndfile_info_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_play_SOURCES = sndfile-play.c common.c common.h -sndfile_play_LDADD = $(top_builddir)/src/libsndfile.la $(OS_SPECIFIC_LINKS) $(ALSA_LIBS) $(SNDIO_LIBS) - -sndfile_convert_SOURCES = sndfile-convert.c common.c common.h -sndfile_convert_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_cmp_SOURCES = sndfile-cmp.c common.c common.h -sndfile_cmp_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_metadata_set_SOURCES = sndfile-metadata-set.c common.c common.h -sndfile_metadata_set_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_metadata_get_SOURCES = sndfile-metadata-get.c common.c common.h -sndfile_metadata_get_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_interleave_SOURCES = sndfile-interleave.c common.c common.h -sndfile_interleave_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_deinterleave_SOURCES = sndfile-deinterleave.c common.c common.h -sndfile_deinterleave_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_concat_SOURCES = sndfile-concat.c common.c common.h -sndfile_concat_LDADD = $(top_builddir)/src/libsndfile.la - -sndfile_salvage_SOURCES = sndfile-salvage.c common.c common.h -sndfile_salvage_LDADD = $(top_builddir)/src/libsndfile.la - diff --git a/libs/libsndfile/programs/common.c b/libs/libsndfile/programs/common.c deleted file mode 100644 index 2811536f3f..0000000000 --- a/libs/libsndfile/programs/common.c +++ /dev/null @@ -1,466 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** Copyright (C) 2008 George Blood Audio -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN 4096 - -#define MIN(x, y) ((x) < (y) ? (x) : (y)) - -void -sfe_copy_data_fp (SNDFILE *outfile, SNDFILE *infile, int channels, int normalize) -{ static double data [BUFFER_LEN], max ; - int frames, readcount, k ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - sf_command (infile, SFC_CALC_SIGNAL_MAX, &max, sizeof (max)) ; - - if (!normalize && max < 1.0) - { while (readcount > 0) - { readcount = sf_readf_double (infile, data, frames) ; - sf_writef_double (outfile, data, readcount) ; - } ; - } - else - { sf_command (infile, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - while (readcount > 0) - { readcount = sf_readf_double (infile, data, frames) ; - for (k = 0 ; k < readcount * channels ; k++) - data [k] /= max ; - sf_writef_double (outfile, data, readcount) ; - } ; - } ; - - return ; -} /* sfe_copy_data_fp */ - -void -sfe_copy_data_int (SNDFILE *outfile, SNDFILE *infile, int channels) -{ static int data [BUFFER_LEN] ; - int frames, readcount ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - while (readcount > 0) - { readcount = sf_readf_int (infile, data, frames) ; - sf_writef_int (outfile, data, readcount) ; - } ; - - return ; -} /* sfe_copy_data_int */ - -/*============================================================================== -*/ - -static int -merge_broadcast_info (SNDFILE * infile, SNDFILE * outfile, int format, const METADATA_INFO * info) -{ SF_BROADCAST_INFO_2K binfo ; - int infileminor ; - - memset (&binfo, 0, sizeof (binfo)) ; - - if ((SF_FORMAT_TYPEMASK & format) != SF_FORMAT_WAV) - { printf ("Error : This is not a WAV file and hence broadcast info cannot be added to it.\n\n") ; - return 1 ; - } ; - - infileminor = SF_FORMAT_SUBMASK & format ; - - switch (infileminor) - { case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - break ; - - default : - printf ( - "Warning : The EBU Technical Recommendation R68-2000 states that the only\n" - " allowed encodings are Linear PCM and MPEG3. This file is not in\n" - " the right format.\n\n" - ) ; - break ; - } ; - - if (sf_command (infile, SFC_GET_BROADCAST_INFO, &binfo, sizeof (binfo)) == 0) - { if (infile == outfile) - { printf ( - "Error : Attempting in-place broadcast info update, but file does not\n" - " have a 'bext' chunk to modify. The solution is to specify both\n" - " input and output files on the command line.\n\n" - ) ; - return 1 ; - } ; - } ; - -#define REPLACE_IF_NEW(x) \ - if (info->x != NULL) \ - { memset (binfo.x, 0, sizeof (binfo.x)) ; \ - memcpy (binfo.x, info->x, MIN (strlen (info->x), sizeof (binfo.x))) ; \ - } ; - - REPLACE_IF_NEW (description) ; - REPLACE_IF_NEW (originator) ; - REPLACE_IF_NEW (originator_reference) ; - REPLACE_IF_NEW (origination_date) ; - REPLACE_IF_NEW (origination_time) ; - REPLACE_IF_NEW (umid) ; - - /* Special case for Time Ref. */ - if (info->time_ref != NULL) - { uint64_t ts = atoll (info->time_ref) ; - - binfo.time_reference_high = (ts >> 32) ; - binfo.time_reference_low = (ts & 0xffffffff) ; - } ; - - /* Special case for coding_history because we may want to append. */ - if (info->coding_history != NULL) - { if (info->coding_hist_append) - { int slen = strlen (binfo.coding_history) ; - - while (slen > 1 && isspace (binfo.coding_history [slen - 1])) - slen -- ; - - memcpy (binfo.coding_history + slen, info->coding_history, sizeof (binfo.coding_history) - slen) ; - } - else - { size_t slen = MIN (strlen (info->coding_history), sizeof (binfo.coding_history)) ; - - memset (binfo.coding_history, 0, sizeof (binfo.coding_history)) ; - memcpy (binfo.coding_history, info->coding_history, slen) ; - binfo.coding_history_size = slen ; - } ; - } ; - - if (sf_command (outfile, SFC_SET_BROADCAST_INFO, &binfo, sizeof (binfo)) == 0) - { printf ("Error : Setting of broadcast info chunks failed.\n\n") ; - return 1 ; - } ; - - return 0 ; -} /* merge_broadcast_info*/ - -static void -update_strings (SNDFILE * outfile, const METADATA_INFO * info) -{ - if (info->title != NULL) - sf_set_string (outfile, SF_STR_TITLE, info->title) ; - - if (info->copyright != NULL) - sf_set_string (outfile, SF_STR_COPYRIGHT, info->copyright) ; - - if (info->artist != NULL) - sf_set_string (outfile, SF_STR_ARTIST, info->artist) ; - - if (info->comment != NULL) - sf_set_string (outfile, SF_STR_COMMENT, info->comment) ; - - if (info->date != NULL) - sf_set_string (outfile, SF_STR_DATE, info->date) ; - - if (info->album != NULL) - sf_set_string (outfile, SF_STR_ALBUM, info->album) ; - - if (info->license != NULL) - sf_set_string (outfile, SF_STR_LICENSE, info->license) ; - -} /* update_strings */ - - - -void -sfe_apply_metadata_changes (const char * filenames [2], const METADATA_INFO * info) -{ SNDFILE *infile = NULL, *outfile = NULL ; - SF_INFO sfinfo ; - METADATA_INFO tmpinfo ; - int error_code = 0 ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - memset (&tmpinfo, 0, sizeof (tmpinfo)) ; - - if (filenames [1] == NULL) - infile = outfile = sf_open (filenames [0], SFM_RDWR, &sfinfo) ; - else - { infile = sf_open (filenames [0], SFM_READ, &sfinfo) ; - - /* Output must be WAV. */ - sfinfo.format = SF_FORMAT_WAV | (SF_FORMAT_SUBMASK & sfinfo.format) ; - outfile = sf_open (filenames [1], SFM_WRITE, &sfinfo) ; - } ; - - if (infile == NULL) - { printf ("Error : Not able to open input file '%s' : %s\n", filenames [0], sf_strerror (infile)) ; - error_code = 1 ; - goto cleanup_exit ; - } ; - - if (outfile == NULL) - { printf ("Error : Not able to open output file '%s' : %s\n", filenames [1], sf_strerror (outfile)) ; - error_code = 1 ; - goto cleanup_exit ; - } ; - - if (info->has_bext_fields && merge_broadcast_info (infile, outfile, sfinfo.format, info)) - { error_code = 1 ; - goto cleanup_exit ; - } ; - - if (infile != outfile) - { int infileminor = SF_FORMAT_SUBMASK & sfinfo.format ; - - /* If the input file is not the same as the output file, copy the data. */ - if ((infileminor == SF_FORMAT_DOUBLE) || (infileminor == SF_FORMAT_FLOAT)) - sfe_copy_data_fp (outfile, infile, sfinfo.channels, SF_FALSE) ; - else - sfe_copy_data_int (outfile, infile, sfinfo.channels) ; - } ; - - update_strings (outfile, info) ; - -cleanup_exit : - - if (outfile != NULL && outfile != infile) - sf_close (outfile) ; - - if (infile != NULL) - sf_close (infile) ; - - if (error_code) - exit (error_code) ; - - return ; -} /* sfe_apply_metadata_changes */ - -/*============================================================================== -*/ - -typedef struct -{ const char *ext ; - int len ; - int format ; -} OUTPUT_FORMAT_MAP ; - -static OUTPUT_FORMAT_MAP format_map [] = -{ - { "aif", 3, SF_FORMAT_AIFF }, - { "wav", 0, SF_FORMAT_WAV }, - { "au", 0, SF_FORMAT_AU }, - { "caf", 0, SF_FORMAT_CAF }, - { "flac", 0, SF_FORMAT_FLAC }, - { "snd", 0, SF_FORMAT_AU }, - { "svx", 0, SF_FORMAT_SVX }, - { "paf", 0, SF_ENDIAN_BIG | SF_FORMAT_PAF }, - { "fap", 0, SF_ENDIAN_LITTLE | SF_FORMAT_PAF }, - { "gsm", 0, SF_FORMAT_RAW }, - { "nist", 0, SF_FORMAT_NIST }, - { "htk", 0, SF_FORMAT_HTK }, - { "ircam", 0, SF_FORMAT_IRCAM }, - { "sf", 0, SF_FORMAT_IRCAM }, - { "voc", 0, SF_FORMAT_VOC }, - { "w64", 0, SF_FORMAT_W64 }, - { "raw", 0, SF_FORMAT_RAW }, - { "mat4", 0, SF_FORMAT_MAT4 }, - { "mat5", 0, SF_FORMAT_MAT5 }, - { "mat", 0, SF_FORMAT_MAT4 }, - { "pvf", 0, SF_FORMAT_PVF }, - { "sds", 0, SF_FORMAT_SDS }, - { "sd2", 0, SF_FORMAT_SD2 }, - { "vox", 0, SF_FORMAT_RAW }, - { "xi", 0, SF_FORMAT_XI }, - { "wve", 0, SF_FORMAT_WVE }, - { "oga", 0, SF_FORMAT_OGG }, - { "ogg", 0, SF_FORMAT_OGG }, - { "mpc", 0, SF_FORMAT_MPC2K }, - { "rf64", 0, SF_FORMAT_RF64 }, -} ; /* format_map */ - -int -sfe_file_type_of_ext (const char *str, int format) -{ char buffer [16], *cptr ; - int k ; - - format &= SF_FORMAT_SUBMASK ; - - if ((cptr = strrchr (str, '.')) == NULL) - return 0 ; - - strncpy (buffer, cptr + 1, 15) ; - buffer [15] = 0 ; - - for (k = 0 ; buffer [k] ; k++) - buffer [k] = tolower ((buffer [k])) ; - - if (strcmp (buffer, "gsm") == 0) - return SF_FORMAT_RAW | SF_FORMAT_GSM610 ; - - if (strcmp (buffer, "vox") == 0) - return SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM ; - - for (k = 0 ; k < (int) (sizeof (format_map) / sizeof (format_map [0])) ; k++) - { if (format_map [k].len > 0 && strncmp (buffer, format_map [k].ext, format_map [k].len) == 0) - return format_map [k].format | format ; - else if (strcmp (buffer, format_map [k].ext) == 0) - return format_map [k].format | format ; - } ; - - /* Default if all the above fails. */ - return (SF_FORMAT_WAV | SF_FORMAT_PCM_24) ; -} /* sfe_file_type_of_ext */ - -void -sfe_dump_format_map (void) -{ SF_FORMAT_INFO info ; - int k ; - - for (k = 0 ; k < ARRAY_LEN (format_map) ; k++) - { info.format = format_map [k].format ; - sf_command (NULL, SFC_GET_FORMAT_INFO, &info, sizeof (info)) ; - printf (" %-10s : %s\n", format_map [k].ext, info.name == NULL ? "????" : info.name) ; - } ; - -} /* sfe_dump_format_map */ - -const char * -program_name (const char * argv0) -{ const char * tmp ; - - tmp = strrchr (argv0, '/') ; - argv0 = tmp ? tmp + 1 : argv0 ; - - tmp = strrchr (argv0, '/') ; - argv0 = tmp ? tmp + 1 : argv0 ; - - /* Remove leading libtool name mangling. */ - if (strstr (argv0, "lt-") == argv0) - return argv0 + 3 ; - - return argv0 ; -} /* program_name */ - -const char * -sfe_endian_name (int format) -{ - switch (format & SF_FORMAT_ENDMASK) - { case SF_ENDIAN_FILE : return "file" ; - case SF_ENDIAN_LITTLE : return "little" ; - case SF_ENDIAN_BIG : return "big" ; - case SF_ENDIAN_CPU : return "cpu" ; - default : break ; - } ; - - return "unknown" ; -} /* sfe_endian_name */ - -const char * -sfe_container_name (int format) -{ - switch (format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_WAV : return "WAV" ; - case SF_FORMAT_AIFF : return "AIFF" ; - case SF_FORMAT_AU : return "AU" ; - case SF_FORMAT_RAW : return "RAW" ; - case SF_FORMAT_PAF : return "PAF" ; - case SF_FORMAT_SVX : return "SVX" ; - case SF_FORMAT_NIST : return "NIST" ; - case SF_FORMAT_VOC : return "VOC" ; - case SF_FORMAT_IRCAM : return "IRCAM" ; - case SF_FORMAT_W64 : return "W64" ; - case SF_FORMAT_MAT4 : return "MAT4" ; - case SF_FORMAT_MAT5 : return "MAT5" ; - case SF_FORMAT_PVF : return "PVF" ; - case SF_FORMAT_XI : return "XI" ; - case SF_FORMAT_HTK : return "HTK" ; - case SF_FORMAT_SDS : return "SDS" ; - case SF_FORMAT_AVR : return "AVR" ; - case SF_FORMAT_WAVEX : return "WAVEX" ; - case SF_FORMAT_SD2 : return "SD2" ; - case SF_FORMAT_FLAC : return "FLAC" ; - case SF_FORMAT_CAF : return "CAF" ; - case SF_FORMAT_WVE : return "WVE" ; - case SF_FORMAT_OGG : return "OGG" ; - case SF_FORMAT_MPC2K : return "MPC2K" ; - case SF_FORMAT_RF64 : return "RF64" ; - default : break ; - } ; - - return "unknown" ; -} /* sfe_container_name */ - -const char * -sfe_codec_name (int format) -{ - switch (format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_S8 : return "signed 8 bit PCM" ; - case SF_FORMAT_PCM_16 : return "16 bit PCM" ; - case SF_FORMAT_PCM_24 : return "24 bit PCM" ; - case SF_FORMAT_PCM_32 : return "32 bit PCM" ; - case SF_FORMAT_PCM_U8 : return "unsigned 8 bit PCM" ; - case SF_FORMAT_FLOAT : return "32 bit float" ; - case SF_FORMAT_DOUBLE : return "64 bit double" ; - case SF_FORMAT_ULAW : return "u-law" ; - case SF_FORMAT_ALAW : return "a-law" ; - case SF_FORMAT_IMA_ADPCM : return "IMA ADPCM" ; - case SF_FORMAT_MS_ADPCM : return "MS ADPCM" ; - case SF_FORMAT_GSM610 : return "gsm610" ; - case SF_FORMAT_VOX_ADPCM : return "Vox ADPCM" ; - case SF_FORMAT_G721_32 : return "g721 32kbps" ; - case SF_FORMAT_G723_24 : return "g723 24kbps" ; - case SF_FORMAT_G723_40 : return "g723 40kbps" ; - case SF_FORMAT_DWVW_12 : return "12 bit DWVW" ; - case SF_FORMAT_DWVW_16 : return "16 bit DWVW" ; - case SF_FORMAT_DWVW_24 : return "14 bit DWVW" ; - case SF_FORMAT_DWVW_N : return "DWVW" ; - case SF_FORMAT_DPCM_8 : return "8 bit DPCM" ; - case SF_FORMAT_DPCM_16 : return "16 bit DPCM" ; - case SF_FORMAT_VORBIS : return "Vorbis" ; - case SF_FORMAT_ALAC_16 : return "16 bit ALAC" ; - case SF_FORMAT_ALAC_20 : return "20 bit ALAC" ; - case SF_FORMAT_ALAC_24 : return "24 bit ALAC" ; - case SF_FORMAT_ALAC_32 : return "32 bit ALAC" ; - default : break ; - } ; - return "unknown" ; -} /* sfe_codec_name */ - diff --git a/libs/libsndfile/programs/common.h b/libs/libsndfile/programs/common.h deleted file mode 100644 index eda2d7d743..0000000000 --- a/libs/libsndfile/programs/common.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof (x [0]))) -#define MAX(a, b) ((a) > (b) ? (a) : (b)) - -typedef struct -{ const char * title ; - const char * copyright ; - const char * artist ; - const char * comment ; - const char * date ; - const char * album ; - const char * license ; - - - /* Stuff to go in the 'bext' chunk of WAV files. */ - int has_bext_fields ; - int coding_hist_append ; - - const char * description ; - const char * originator ; - const char * originator_reference ; - const char * origination_date ; - const char * origination_time ; - const char * umid ; - const char * coding_history ; - const char * time_ref ; -} METADATA_INFO ; - -typedef SF_BROADCAST_INFO_VAR (2048) SF_BROADCAST_INFO_2K ; - -void sfe_apply_metadata_changes (const char * filenames [2], const METADATA_INFO * info) ; - -void sfe_copy_data_fp (SNDFILE *outfile, SNDFILE *infile, int channels, int normalize) ; - -void sfe_copy_data_int (SNDFILE *outfile, SNDFILE *infile, int channels) ; - -int sfe_file_type_of_ext (const char *filename, int format) ; - -void sfe_dump_format_map (void) ; - -const char * program_name (const char * argv0) ; - -const char * sfe_endian_name (int format) ; -const char * sfe_container_name (int format) ; -const char * sfe_codec_name (int format) ; - diff --git a/libs/libsndfile/programs/sndfile-cmp.c b/libs/libsndfile/programs/sndfile-cmp.c deleted file mode 100644 index 121d25a629..0000000000 --- a/libs/libsndfile/programs/sndfile-cmp.c +++ /dev/null @@ -1,165 +0,0 @@ -/* -** Copyright (C) 2008-2012 Erik de Castro Lopo -** Copyright (C) 2008 Conrad Parker -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include - -#include "common.h" - -/* Length of comparison data buffers in units of items */ -#define BUFLEN 65536 - -static const char * progname = NULL ; -static char * filename1 = NULL, * filename2 = NULL ; - -static int -comparison_error (const char * what, sf_count_t frame_offset) -{ char buffer [128] = "" ; - - if (frame_offset >= 0) - snprintf (buffer, sizeof (buffer), " (at frame offset %" PRId64 ")", frame_offset) ; - - printf ("%s: %s of files %s and %s differ%s.\n", progname, what, filename1, filename2, buffer) ; - return 1 ; -} /* comparison_error */ - -static int -compare (void) -{ - double buf1 [BUFLEN], buf2 [BUFLEN] ; - SF_INFO sfinfo1, sfinfo2 ; - SNDFILE * sf1 = NULL, * sf2 = NULL ; - sf_count_t items, i, nread1, nread2, offset = 0 ; - int retval = 0 ; - - memset (&sfinfo1, 0, sizeof (SF_INFO)) ; - sf1 = sf_open (filename1, SFM_READ, &sfinfo1) ; - if (sf1 == NULL) - { printf ("Error opening %s.\n", filename1) ; - retval = 1 ; - goto out ; - } ; - - memset (&sfinfo2, 0, sizeof (SF_INFO)) ; - sf2 = sf_open (filename2, SFM_READ, &sfinfo2) ; - if (sf2 == NULL) - { printf ("Error opening %s.\n", filename2) ; - retval = 1 ; - goto out ; - } ; - - if (sfinfo1.samplerate != sfinfo2.samplerate) - { retval = comparison_error ("Samplerates", -1) ; - goto out ; - } ; - - if (sfinfo1.channels != sfinfo2.channels) - { retval = comparison_error ("Number of channels", -1) ; - goto out ; - } ; - - /* Calculate the framecount that will fit in our data buffers */ - items = BUFLEN / sfinfo1.channels ; - - while ((nread1 = sf_readf_double (sf1, buf1, items)) > 0) - { nread2 = sf_readf_double (sf2, buf2, nread1) ; - if (nread2 != nread1) - { retval = comparison_error ("PCM data lengths", -1) ; - goto out ; - } ; - for (i = 0 ; i < nread1 * sfinfo1.channels ; i++) - { if (buf1 [i] != buf2 [i]) - { retval = comparison_error ("PCM data", offset + i / sfinfo1.channels) ; - goto out ; - } ; - } ; - offset += nread1 ; - } ; - - if ((nread2 = sf_readf_double (sf2, buf2, items)) != 0) - { retval = comparison_error ("PCM data lengths", -1) ; - goto out ; - } ; - -out : - sf_close (sf1) ; - sf_close (sf2) ; - - return retval ; -} /* compare */ - -static void -print_version (void) -{ char buffer [256] ; - - sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; - printf ("\nVersion : %s\n\n", buffer) ; -} /* print_version */ - -static void -usage_exit (void) -{ - print_version () ; - - printf ("Usage : %s \n", progname) ; - printf (" Compare the PCM data of two sound files.\n\n") ; - exit (0) ; -} /* usage_exit */ - -int -main (int argc, char *argv []) -{ - progname = program_name (argv [0]) ; - - if (argc != 3) - { usage_exit () ; - return 1 ; - } ; - - filename1 = argv [argc - 2] ; - filename2 = argv [argc - 1] ; - - if (strcmp (filename1, filename2) == 0) - { printf ("Error : Input filenames are the same.\n\n") ; - usage_exit () ; - return 1 ; - } ; - - return compare () ; -} /* main */ diff --git a/libs/libsndfile/programs/sndfile-concat.c b/libs/libsndfile/programs/sndfile-concat.c deleted file mode 100644 index ef5312b693..0000000000 --- a/libs/libsndfile/programs/sndfile-concat.c +++ /dev/null @@ -1,169 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN (1 << 16) - - -static void concat_data_fp (SNDFILE *wfile, SNDFILE *rofile, int channels) ; -static void concat_data_int (SNDFILE *wfile, SNDFILE *rofile, int channels) ; - -static void -usage_exit (const char *progname) -{ - printf ("\nUsage : %s ... \n\n", progname) ; - puts ( - " Create a new output file containing the concatenated\n" - " audio data from froms ....\n" - "\n" - " The joined file will be encoded in the same format as the data\n" - " in infile1, with all the data in subsequent files automatically\n" - " converted to the correct encoding.\n" - "\n" - " The only restriction is that the two files must have the same\n" - " number of channels.\n" - ) ; - - exit (0) ; -} /* usage_exit */ - -int -main (int argc, char *argv []) -{ const char *progname, *outfilename ; - SNDFILE *outfile, **infiles ; - SF_INFO sfinfo_out, sfinfo_in ; - void (*func) (SNDFILE*, SNDFILE*, int) ; - int k ; - - progname = program_name (argv [0]) ; - - if (argc < 4) - usage_exit (progname) ; - - argv ++ ; - argc -- ; - - argc -- ; - outfilename = argv [argc] ; - - if ((infiles = calloc (argc, sizeof (SNDFILE*))) == NULL) - { printf ("\nError : Malloc failed.\n\n") ; - exit (1) ; - } ; - - memset (&sfinfo_in, 0, sizeof (sfinfo_in)) ; - - if ((infiles [0] = sf_open (argv [0], SFM_READ, &sfinfo_in)) == NULL) - { printf ("\nError : failed to open file '%s'.\n\n", argv [0]) ; - exit (1) ; - } ; - - sfinfo_out = sfinfo_in ; - - for (k = 1 ; k < argc ; k++) - { if ((infiles [k] = sf_open (argv [k], SFM_READ, &sfinfo_in)) == NULL) - { printf ("\nError : failed to open file '%s'.\n\n", argv [k]) ; - exit (1) ; - } ; - - if (sfinfo_in.channels != sfinfo_out.channels) - { printf ("\nError : File '%s' has %d channels (should have %d).\n\n", argv [k], sfinfo_in.channels, sfinfo_out.channels) ; - exit (1) ; - } ; - } ; - - if ((outfile = sf_open (outfilename, SFM_WRITE, &sfinfo_out)) == NULL) - { printf ("\nError : Not able to open input file %s.\n", outfilename) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - if ((sfinfo_out.format & SF_FORMAT_SUBMASK) == SF_FORMAT_DOUBLE || - (sfinfo_out.format & SF_FORMAT_SUBMASK) == SF_FORMAT_FLOAT) - func = concat_data_fp ; - else - func = concat_data_int ; - - for (k = 0 ; k < argc ; k++) - { func (outfile, infiles [k], sfinfo_out.channels) ; - sf_close (infiles [k]) ; - } ; - - sf_close (outfile) ; - - return 0 ; -} /* main */ - -static void -concat_data_fp (SNDFILE *wfile, SNDFILE *rofile, int channels) -{ static double data [BUFFER_LEN] ; - int frames, readcount ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - sf_seek (wfile, 0, SEEK_END) ; - - while (readcount > 0) - { readcount = sf_readf_double (rofile, data, frames) ; - sf_writef_double (wfile, data, readcount) ; - } ; - - return ; -} /* concat_data_fp */ - -static void -concat_data_int (SNDFILE *wfile, SNDFILE *rofile, int channels) -{ static int data [BUFFER_LEN] ; - int frames, readcount ; - - frames = BUFFER_LEN / channels ; - readcount = frames ; - - sf_seek (wfile, 0, SEEK_END) ; - - while (readcount > 0) - { readcount = sf_readf_int (rofile, data, frames) ; - sf_writef_int (wfile, data, readcount) ; - } ; - - return ; -} /* concat_data_int */ - diff --git a/libs/libsndfile/programs/sndfile-convert.c b/libs/libsndfile/programs/sndfile-convert.c deleted file mode 100644 index c22cc9b16a..0000000000 --- a/libs/libsndfile/programs/sndfile-convert.c +++ /dev/null @@ -1,377 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include - -#include "common.h" - - -typedef struct -{ char *infilename, *outfilename ; - SF_INFO infileinfo, outfileinfo ; -} OptionData ; - -static void copy_metadata (SNDFILE *outfile, SNDFILE *infile, int channels) ; - -static void -usage_exit (const char *progname) -{ - printf ("\nUsage : %s [options] [encoding] \n", progname) ; - puts ("\n" - " where [option] may be:\n\n" - " -override-sample-rate=X : force sample rate of input to X\n" - " -endian=little : force output file to little endian data\n" - " -endian=big : force output file to big endian data\n" - " -endian=cpu : force output file same endian-ness as the CPU\n" - " -normalize : normalize the data in the output file\n" - ) ; - - puts ( - " where [encoding] may be one of the following:\n\n" - " -pcms8 : force the output to signed 8 bit pcm\n" - " -pcmu8 : force the output to unsigned 8 bit pcm\n" - " -pcm16 : force the output to 16 bit pcm\n" - " -pcm24 : force the output to 24 bit pcm\n" - " -pcm32 : force the output to 32 bit pcm\n" - " -float32 : force the output to 32 bit floating point" - ) ; - puts ( - " -ulaw : force the output ULAW\n" - " -alaw : force the output ALAW\n" - " -alac16 : force the output 16 bit ALAC (CAF only)\n" - " -alac20 : force the output 20 bit ALAC (CAF only)\n" - " -alac24 : force the output 24 bit ALAC (CAF only)\n" - " -alac32 : force the output 32 bit ALAC (CAF only)\n" - " -ima-adpcm : force the output to IMA ADPCM (WAV only)\n" - " -ms-adpcm : force the output to MS ADPCM (WAV only)\n" - " -gsm610 : force the GSM6.10 (WAV only)\n" - " -dwvw12 : force the output to 12 bit DWVW (AIFF only)\n" - " -dwvw16 : force the output to 16 bit DWVW (AIFF only)\n" - " -dwvw24 : force the output to 24 bit DWVW (AIFF only)\n" - " -vorbis : force the output to Vorbis (OGG only)\n" - ) ; - - puts ( - " If no encoding is specified, the program will try to use the encoding\n" - " of the input file in the output file. This will not always work as\n" - " most container formats (eg WAV, AIFF etc) only support a small subset\n" - " of codec formats (eg 16 bit PCM, a-law, Vorbis etc).\n" - ) ; - - puts ( - " The format of the output file is determined by the file extension of the\n" - " output file name. The following extensions are currently understood:\n" - ) ; - - sfe_dump_format_map () ; - - puts ("") ; - exit (0) ; -} /* usage_exit */ - -static void -report_format_error_exit (const char * argv0, SF_INFO * sfinfo) -{ int old_format = sfinfo->format ; - int endian = sfinfo->format & SF_FORMAT_ENDMASK ; - - sfinfo->format = old_format & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (endian && sf_format_check (sfinfo)) - { printf ("Error : output file format does not support %s endian-ness.\n", sfe_endian_name (endian)) ; - exit (1) ; - } ; - - printf ("\n" - "Error : output file format is invalid.\n" - "The '%s' container does not support '%s' codec data.\n" - "Run '%s --help' for clues.\n\n", - sfe_container_name (sfinfo->format), sfe_codec_name (sfinfo->format), program_name (argv0)) ; - exit (1) ; -} /* report_format_error_exit */ - -int -main (int argc, char * argv []) -{ const char *progname, *infilename, *outfilename ; - SNDFILE *infile = NULL, *outfile = NULL ; - SF_INFO sfinfo ; - int k, outfilemajor, outfileminor = 0, infileminor ; - int override_sample_rate = 0 ; /* assume no sample rate override. */ - int endian = SF_ENDIAN_FILE, normalize = SF_FALSE ; - - progname = program_name (argv [0]) ; - - if (argc < 3 || argc > 5) - { usage_exit (progname) ; - return 1 ; - } ; - - infilename = argv [argc-2] ; - outfilename = argv [argc-1] ; - - if (strcmp (infilename, outfilename) == 0) - { printf ("Error : Input and output filenames are the same.\n\n") ; - usage_exit (progname) ; - return 1 ; - } ; - - if (strlen (infilename) > 1 && infilename [0] == '-') - { printf ("Error : Input filename (%s) looks like an option.\n\n", infilename) ; - usage_exit (progname) ; - return 1 ; - } ; - - if (outfilename [0] == '-') - { printf ("Error : Output filename (%s) looks like an option.\n\n", outfilename) ; - usage_exit (progname) ; - return 1 ; - } ; - - for (k = 1 ; k < argc - 2 ; k++) - { if (! strcmp (argv [k], "-pcms8")) - { outfileminor = SF_FORMAT_PCM_S8 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcmu8")) - { outfileminor = SF_FORMAT_PCM_U8 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm16")) - { outfileminor = SF_FORMAT_PCM_16 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm24")) - { outfileminor = SF_FORMAT_PCM_24 ; - continue ; - } ; - if (! strcmp (argv [k], "-pcm32")) - { outfileminor = SF_FORMAT_PCM_32 ; - continue ; - } ; - if (! strcmp (argv [k], "-float32")) - { outfileminor = SF_FORMAT_FLOAT ; - continue ; - } ; - if (! strcmp (argv [k], "-ulaw")) - { outfileminor = SF_FORMAT_ULAW ; - continue ; - } ; - if (! strcmp (argv [k], "-alaw")) - { outfileminor = SF_FORMAT_ALAW ; - continue ; - } ; - if (! strcmp (argv [k], "-alac16")) - { outfileminor = SF_FORMAT_ALAC_16 ; - continue ; - } ; - if (! strcmp (argv [k], "-alac20")) - { outfileminor = SF_FORMAT_ALAC_20 ; - continue ; - } ; - if (! strcmp (argv [k], "-alac24")) - { outfileminor = SF_FORMAT_ALAC_24 ; - continue ; - } ; - if (! strcmp (argv [k], "-alac32")) - { outfileminor = SF_FORMAT_ALAC_32 ; - continue ; - } ; - if (! strcmp (argv [k], "-ima-adpcm")) - { outfileminor = SF_FORMAT_IMA_ADPCM ; - continue ; - } ; - if (! strcmp (argv [k], "-ms-adpcm")) - { outfileminor = SF_FORMAT_MS_ADPCM ; - continue ; - } ; - if (! strcmp (argv [k], "-gsm610")) - { outfileminor = SF_FORMAT_GSM610 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw12")) - { outfileminor = SF_FORMAT_DWVW_12 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw16")) - { outfileminor = SF_FORMAT_DWVW_16 ; - continue ; - } ; - if (! strcmp (argv [k], "-dwvw24")) - { outfileminor = SF_FORMAT_DWVW_24 ; - continue ; - } ; - if (! strcmp (argv [k], "-vorbis")) - { outfileminor = SF_FORMAT_VORBIS ; - continue ; - } ; - - if (strstr (argv [k], "-override-sample-rate=") == argv [k]) - { const char *ptr ; - - ptr = argv [k] + strlen ("-override-sample-rate=") ; - override_sample_rate = atoi (ptr) ; - continue ; - } ; - - if (! strcmp (argv [k], "-endian=little")) - { endian = SF_ENDIAN_LITTLE ; - continue ; - } ; - - if (! strcmp (argv [k], "-endian=big")) - { endian = SF_ENDIAN_BIG ; - continue ; - } ; - - if (! strcmp (argv [k], "-endian=cpu")) - { endian = SF_ENDIAN_CPU ; - continue ; - } ; - - if (! strcmp (argv [k], "-endian=file")) - { endian = SF_ENDIAN_FILE ; - continue ; - } ; - - if (! strcmp (argv [k], "-normalize")) - { normalize = SF_TRUE ; - continue ; - } ; - - printf ("Error : Not able to decode argunment '%s'.\n", argv [k]) ; - exit (1) ; - } ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL) - { printf ("Not able to open input file %s.\n", infilename) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - /* Update sample rate if forced to something else. */ - if (override_sample_rate) - sfinfo.samplerate = override_sample_rate ; - - infileminor = sfinfo.format & SF_FORMAT_SUBMASK ; - - if ((sfinfo.format = sfe_file_type_of_ext (outfilename, sfinfo.format)) == 0) - { printf ("Error : Not able to determine output file type for %s.\n", outfilename) ; - return 1 ; - } ; - - outfilemajor = sfinfo.format & (SF_FORMAT_TYPEMASK | SF_FORMAT_ENDMASK) ; - - if (outfileminor == 0) - outfileminor = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (outfileminor != 0) - sfinfo.format = outfilemajor | outfileminor ; - else - sfinfo.format = outfilemajor | (sfinfo.format & SF_FORMAT_SUBMASK) ; - - sfinfo.format |= endian ; - - if ((sfinfo.format & SF_FORMAT_TYPEMASK) == SF_FORMAT_XI) - switch (sfinfo.format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_16 : - sfinfo.format = outfilemajor | SF_FORMAT_DPCM_16 ; - break ; - - case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - sfinfo.format = outfilemajor | SF_FORMAT_DPCM_8 ; - break ; - } ; - - if (sf_format_check (&sfinfo) == 0) - report_format_error_exit (argv [0], &sfinfo) ; - - /* Open the output file. */ - if ((outfile = sf_open (outfilename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("Not able to open output file %s : %s\n", outfilename, sf_strerror (NULL)) ; - return 1 ; - } ; - - /* Copy the metadata */ - copy_metadata (outfile, infile, sfinfo.channels) ; - - if (normalize - || (outfileminor == SF_FORMAT_DOUBLE) || (outfileminor == SF_FORMAT_FLOAT) - || (infileminor == SF_FORMAT_DOUBLE) || (infileminor == SF_FORMAT_FLOAT) - || (infileminor == SF_FORMAT_VORBIS) || (outfileminor == SF_FORMAT_VORBIS)) - sfe_copy_data_fp (outfile, infile, sfinfo.channels, normalize) ; - else - sfe_copy_data_int (outfile, infile, sfinfo.channels) ; - - sf_close (infile) ; - sf_close (outfile) ; - - return 0 ; -} /* main */ - -static void -copy_metadata (SNDFILE *outfile, SNDFILE *infile, int channels) -{ SF_INSTRUMENT inst ; - SF_BROADCAST_INFO_2K binfo ; - const char *str ; - int k, chanmap [256] ; - - for (k = SF_STR_FIRST ; k <= SF_STR_LAST ; k++) - { str = sf_get_string (infile, k) ; - if (str != NULL) - sf_set_string (outfile, k, str) ; - } ; - - memset (&inst, 0, sizeof (inst)) ; - memset (&binfo, 0, sizeof (binfo)) ; - - if (channels < ARRAY_LEN (chanmap)) - { size_t size = channels * sizeof (chanmap [0]) ; - - if (sf_command (infile, SFC_GET_CHANNEL_MAP_INFO, chanmap, size) == SF_TRUE) - sf_command (outfile, SFC_SET_CHANNEL_MAP_INFO, chanmap, size) ; - } ; - - if (sf_command (infile, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) == SF_TRUE) - sf_command (outfile, SFC_SET_INSTRUMENT, &inst, sizeof (inst)) ; - - if (sf_command (infile, SFC_GET_BROADCAST_INFO, &binfo, sizeof (binfo)) == SF_TRUE) - sf_command (outfile, SFC_SET_BROADCAST_INFO, &binfo, sizeof (binfo)) ; - -} /* copy_metadata */ - diff --git a/libs/libsndfile/programs/sndfile-deinterleave.c b/libs/libsndfile/programs/sndfile-deinterleave.c deleted file mode 100644 index df80b04222..0000000000 --- a/libs/libsndfile/programs/sndfile-deinterleave.c +++ /dev/null @@ -1,194 +0,0 @@ -/* -** Copyright (C) 2009-2011 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include "common.h" - -#define BUFFER_LEN 4096 -#define MAX_CHANNELS 16 - - -typedef struct -{ SNDFILE * infile ; - SNDFILE * outfile [MAX_CHANNELS] ; - - union - { double d [MAX_CHANNELS * BUFFER_LEN] ; - int i [MAX_CHANNELS * BUFFER_LEN] ; - } din ; - - union - { double d [BUFFER_LEN] ; - int i [BUFFER_LEN] ; - } dout ; - - int channels ; -} STATE ; - -static void usage_exit (void) ; - -static void deinterleave_int (STATE * state) ; -static void deinterleave_double (STATE * state) ; - -int -main (int argc, char **argv) -{ STATE state ; - SF_INFO sfinfo ; - char pathname [512], ext [32], *cptr ; - int ch, double_split ; - - if (argc != 2) - { if (argc != 1) - puts ("\nError : need a single input file.\n") ; - usage_exit () ; - } ; - - memset (&state, 0, sizeof (state)) ; - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((state.infile = sf_open (argv [1], SFM_READ, &sfinfo)) == NULL) - { printf ("\nError : Not able to open input file '%s'\n%s\n", argv [1], sf_strerror (NULL)) ; - exit (1) ; - } ; - - if (sfinfo.channels < 2) - { printf ("\nError : Input file '%s' only has one channel.\n", argv [1]) ; - exit (1) ; - } ; - - state.channels = sfinfo.channels ; - sfinfo.channels = 1 ; - - snprintf (pathname, sizeof (pathname), "%s", argv [1]) ; - if ((cptr = strrchr (pathname, '.')) == NULL) - ext [0] = 0 ; - else - { snprintf (ext, sizeof (ext), "%s", cptr) ; - cptr [0] = 0 ; - } ; - - printf ("Input file : %s\n", pathname) ; - puts ("Output files :") ; - - for (ch = 0 ; ch < state.channels ; ch++) - { char filename [520] ; - - snprintf (filename, sizeof (filename), "%s_%02d%s", pathname, ch, ext) ; - - if ((state.outfile [ch] = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("Not able to open output file '%s'\n%s\n", filename, sf_strerror (NULL)) ; - exit (1) ; - } ; - - printf (" %s\n", filename) ; - } ; - - switch (sfinfo.format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - case SF_FORMAT_VORBIS : - double_split = 1 ; - break ; - - default : - double_split = 0 ; - break ; - } ; - - if (double_split) - deinterleave_double (&state) ; - else - deinterleave_int (&state) ; - - sf_close (state.infile) ; - for (ch = 0 ; ch < MAX_CHANNELS ; ch++) - if (state.outfile [ch] != NULL) - sf_close (state.outfile [ch]) ; - - return 0 ; -} /* main */ - -/*------------------------------------------------------------------------------ -*/ - -static void -usage_exit (void) -{ puts ("\nUsage : sndfile-deinterleave \n") ; - puts ( - "Split a mutli-channel file into a set of mono files.\n" - "\n" - "If the input file is named 'a.wav', the output files will be named\n" - "a_00.wav, a_01.wav and so on.\n" - ) ; - printf ("Using %s.\n\n", sf_version_string ()) ; - exit (0) ; -} /* usage_exit */ - -static void -deinterleave_int (STATE * state) -{ int read_len ; - int ch, k ; - - do - { read_len = sf_readf_int (state->infile, state->din.i, BUFFER_LEN) ; - - for (ch = 0 ; ch < state->channels ; ch ++) - { for (k = 0 ; k < read_len ; k++) - state->dout.i [k] = state->din.i [k * state->channels + ch] ; - sf_write_int (state->outfile [ch], state->dout.i, read_len) ; - } ; - } - while (read_len > 0) ; - -} /* deinterleave_int */ - -static void -deinterleave_double (STATE * state) -{ int read_len ; - int ch, k ; - - do - { read_len = sf_readf_double (state->infile, state->din.d, BUFFER_LEN) ; - - for (ch = 0 ; ch < state->channels ; ch ++) - { for (k = 0 ; k < read_len ; k++) - state->dout.d [k] = state->din.d [k * state->channels + ch] ; - sf_write_double (state->outfile [ch], state->dout.d, read_len) ; - } ; - } - while (read_len > 0) ; - -} /* deinterleave_double */ diff --git a/libs/libsndfile/programs/sndfile-info.c b/libs/libsndfile/programs/sndfile-info.c deleted file mode 100644 index 06982fd2c2..0000000000 --- a/libs/libsndfile/programs/sndfile-info.c +++ /dev/null @@ -1,529 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN (1 << 16) - -#if (defined (WIN32) || defined (_WIN32)) -#include -#endif - -static void print_version (void) ; -static void usage_exit (const char *progname) ; - -static void info_dump (const char *filename) ; -static int instrument_dump (const char *filename) ; -static int broadcast_dump (const char *filename) ; -static int chanmap_dump (const char *filename) ; -static int cart_dump (const char *filename) ; -static void total_dump (void) ; - -static double total_seconds = 0.0 ; - -int -main (int argc, char *argv []) -{ int k ; - - print_version () ; - - if (argc < 2 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0) - { usage_exit (program_name (argv [0])) ; - return 1 ; - } ; - - if (strcmp (argv [1], "--instrument") == 0) - { int error = 0 ; - - for (k = 2 ; k < argc ; k++) - error += instrument_dump (argv [k]) ; - return error ; - } ; - - if (strcmp (argv [1], "--broadcast") == 0) - { int error = 0 ; - - for (k = 2 ; k < argc ; k++) - error += broadcast_dump (argv [k]) ; - return error ; - } ; - - if (strcmp (argv [1], "--channel-map") == 0) - { int error = 0 ; - - for (k = 2 ; k < argc ; k++) - error += chanmap_dump (argv [k]) ; - return error ; - } ; - - if (strcmp (argv [1], "--cart") == 0) - { int error = 0 ; - - for (k = 2 ; k < argc ; k++) - error += cart_dump (argv [k]) ; - return error ; - } ; - - for (k = 1 ; k < argc ; k++) - info_dump (argv [k]) ; - - if (argc > 2) - total_dump () ; - - return 0 ; -} /* main */ - -/*============================================================================== -** Print version and usage. -*/ - -static double data [BUFFER_LEN] ; - -static void -print_version (void) -{ char buffer [256] ; - - sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; - printf ("\nVersion : %s\n\n", buffer) ; -} /* print_version */ - - -static void -usage_exit (const char *progname) -{ printf ("Usage :\n %s ...\n", progname) ; - printf (" Prints out information about one or more sound files.\n\n") ; - printf (" %s --instrument \n", progname) ; - printf (" Prints out the instrument data for the given file.\n\n") ; - printf (" %s --broadcast \n", progname) ; - printf (" Prints out the broadcast WAV info for the given file.\n\n") ; - printf (" %s --channel-map \n", progname) ; - printf (" Prints out the channel map for the given file.\n\n") ; - printf (" %s --cart \n", progname) ; - printf (" Prints out the cart chunk WAV info for the given file.\n\n") ; -#if (defined (_WIN32) || defined (WIN32)) - printf ("This is a Unix style command line application which\n" - "should be run in a MSDOS box or Command Shell window.\n\n") ; - printf ("Sleeping for 5 seconds before exiting.\n\n") ; - fflush (stdout) ; - - /* This is the officially blessed by microsoft way but I can't get - ** it to link. - ** Sleep (15) ; - ** Instead, use this: - */ - Sleep (5 * 1000) ; -#endif - exit (0) ; -} /* usage_exit */ - -/*============================================================================== -** Dumping of sndfile info. -*/ - -static double data [BUFFER_LEN] ; - -static double -calc_decibels (SF_INFO * sfinfo, double max) -{ double decibels ; - - switch (sfinfo->format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_S8 : - decibels = max / 0x80 ; - break ; - - case SF_FORMAT_PCM_16 : - decibels = max / 0x8000 ; - break ; - - case SF_FORMAT_PCM_24 : - decibels = max / 0x800000 ; - break ; - - case SF_FORMAT_PCM_32 : - decibels = max / 0x80000000 ; - break ; - - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - decibels = max / 1.0 ; - break ; - - default : - decibels = max / 0x8000 ; - break ; - } ; - - return 20.0 * log10 (decibels) ; -} /* calc_decibels */ - -static const char * -format_duration_str (double seconds) -{ static char str [128] ; - int hrs, min ; - double sec ; - - memset (str, 0, sizeof (str)) ; - - hrs = (int) (seconds / 3600.0) ; - min = (int) ((seconds - (hrs * 3600.0)) / 60.0) ; - sec = seconds - (hrs * 3600.0) - (min * 60.0) ; - - snprintf (str, sizeof (str) - 1, "%02d:%02d:%06.3f", hrs, min, sec) ; - - return str ; -} /* format_duration_str */ - -static const char * -generate_duration_str (SF_INFO *sfinfo) -{ - double seconds ; - - if (sfinfo->samplerate < 1) - return NULL ; - - if (sfinfo->frames / sfinfo->samplerate > 0x7FFFFFFF) - return "unknown" ; - - seconds = (1.0 * sfinfo->frames) / sfinfo->samplerate ; - - /* Accumulate the total of all known file durations */ - total_seconds += seconds ; - - return format_duration_str (seconds) ; -} /* generate_duration_str */ - -static void -info_dump (const char *filename) -{ static char strbuffer [BUFFER_LEN] ; - SNDFILE *file ; - SF_INFO sfinfo ; - double signal_max, decibels ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - sf_command (file, SFC_GET_LOG_INFO, strbuffer, BUFFER_LEN) ; - puts (strbuffer) ; - puts (sf_strerror (NULL)) ; - return ; - } ; - - printf ("========================================\n") ; - sf_command (file, SFC_GET_LOG_INFO, strbuffer, BUFFER_LEN) ; - puts (strbuffer) ; - printf ("----------------------------------------\n") ; - - printf ("Sample Rate : %d\n", sfinfo.samplerate) ; - - if (sfinfo.frames == SF_COUNT_MAX) - printf ("Frames : unknown\n") ; - else - printf ("Frames : %" PRId64 "\n", sfinfo.frames) ; - - printf ("Channels : %d\n", sfinfo.channels) ; - printf ("Format : 0x%08X\n", sfinfo.format) ; - printf ("Sections : %d\n", sfinfo.sections) ; - printf ("Seekable : %s\n", (sfinfo.seekable ? "TRUE" : "FALSE")) ; - printf ("Duration : %s\n", generate_duration_str (&sfinfo)) ; - - if (sfinfo.frames < 100 * 1024 * 1024) - { /* Do not use sf_signal_max because it doesn't work for non-seekable files . */ - sf_command (file, SFC_CALC_SIGNAL_MAX, &signal_max, sizeof (signal_max)) ; - decibels = calc_decibels (&sfinfo, signal_max) ; - printf ("Signal Max : %g (%4.2f dB)\n", signal_max, decibels) ; - } ; - putchar ('\n') ; - - sf_close (file) ; - -} /* info_dump */ - -/*============================================================================== -** Dumping of SF_INSTRUMENT data. -*/ - -static const char * -str_of_type (int mode) -{ switch (mode) - { case SF_LOOP_NONE : return "none" ; - case SF_LOOP_FORWARD : return "fwd " ; - case SF_LOOP_BACKWARD : return "back" ; - case SF_LOOP_ALTERNATING : return "alt " ; - default : break ; - } ; - - return "????" ; -} /* str_of_mode */ - -static int -instrument_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_INSTRUMENT inst ; - int got_inst, k ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - got_inst = sf_command (file, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) ; - sf_close (file) ; - - if (got_inst == SF_FALSE) - { printf ("Error : File '%s' does not contain instrument data.\n\n", filename) ; - return 1 ; - } ; - - printf ("Instrument : %s\n\n", filename) ; - printf (" Gain : %d\n", inst.gain) ; - printf (" Base note : %d\n", inst.basenote) ; - printf (" Velocity : %d - %d\n", (int) inst.velocity_lo, (int) inst.velocity_hi) ; - printf (" Key : %d - %d\n", (int) inst.key_lo, (int) inst.key_hi) ; - printf (" Loop points : %d\n", inst.loop_count) ; - - for (k = 0 ; k < inst.loop_count ; k++) - printf (" %-2d Mode : %s Start : %6d End : %6d Count : %6d\n", k, str_of_type (inst.loops [k].mode), inst.loops [k].start, inst.loops [k].end, inst.loops [k].count) ; - - putchar ('\n') ; - return 0 ; -} /* instrument_dump */ - -static int -broadcast_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_BROADCAST_INFO_2K bext ; - double time_ref_sec ; - int got_bext ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - memset (&bext, 0, sizeof (SF_BROADCAST_INFO_2K)) ; - - got_bext = sf_command (file, SFC_GET_BROADCAST_INFO, &bext, sizeof (bext)) ; - sf_close (file) ; - - if (got_bext == SF_FALSE) - { printf ("Error : File '%s' does not contain broadcast information.\n\n", filename) ; - return 1 ; - } ; - - /* - ** From : http://www.ebu.ch/en/technical/publications/userguides/bwf_user_guide.php - ** - ** Time Reference: - ** This field is a count from midnight in samples to the first sample - ** of the audio sequence. - */ - - time_ref_sec = ((pow (2.0, 32) * bext.time_reference_high) + (1.0 * bext.time_reference_low)) / sfinfo.samplerate ; - - printf ("Description : %.*s\n", (int) sizeof (bext.description), bext.description) ; - printf ("Originator : %.*s\n", (int) sizeof (bext.originator), bext.originator) ; - printf ("Origination ref : %.*s\n", (int) sizeof (bext.originator_reference), bext.originator_reference) ; - printf ("Origination date : %.*s\n", (int) sizeof (bext.origination_date), bext.origination_date) ; - printf ("Origination time : %.*s\n", (int) sizeof (bext.origination_time), bext.origination_time) ; - - if (bext.time_reference_high == 0 && bext.time_reference_low == 0) - printf ("Time ref : 0\n") ; - else - printf ("Time ref : 0x%x%08x (%.6f seconds)\n", bext.time_reference_high, bext.time_reference_low, time_ref_sec) ; - - printf ("BWF version : %d\n", bext.version) ; - printf ("UMID : %.*s\n", (int) sizeof (bext.umid), bext.umid) ; - printf ("Coding history : %.*s\n", bext.coding_history_size, bext.coding_history) ; - - return 0 ; -} /* broadcast_dump */ - -static int -chanmap_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int * channel_map ; - int got_chanmap, k ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - if ((channel_map = calloc (sfinfo.channels, sizeof (int))) == NULL) - { printf ("Error : malloc failed.\n\n") ; - return 1 ; - } ; - - got_chanmap = sf_command (file, SFC_GET_CHANNEL_MAP_INFO, channel_map, sfinfo.channels * sizeof (int)) ; - sf_close (file) ; - - if (got_chanmap == SF_FALSE) - { printf ("Error : File '%s' does not contain channel map information.\n\n", filename) ; - free (channel_map) ; - return 1 ; - } ; - - printf ("File : %s\n\n", filename) ; - - puts (" Chan Position") ; - for (k = 0 ; k < sfinfo.channels ; k ++) - { const char * name ; - -#define CASE_NAME(x) case x : name = #x ; break ; - switch (channel_map [k]) - { CASE_NAME (SF_CHANNEL_MAP_INVALID) ; - CASE_NAME (SF_CHANNEL_MAP_MONO) ; - CASE_NAME (SF_CHANNEL_MAP_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_FRONT_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_FRONT_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_FRONT_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_REAR_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_REAR_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_REAR_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_LFE) ; - CASE_NAME (SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_SIDE_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_SIDE_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_FRONT_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_FRONT_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_FRONT_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_REAR_LEFT) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_REAR_RIGHT) ; - CASE_NAME (SF_CHANNEL_MAP_TOP_REAR_CENTER) ; - CASE_NAME (SF_CHANNEL_MAP_MAX) ; - default : name = "default" ; - break ; - } ; - - printf (" %3d %s\n", k, name) ; - } ; - - putchar ('\n') ; - free (channel_map) ; - - return 0 ; -} /* chanmap_dump */ - -static int -cart_dump (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_CART_INFO_VAR (1024) cart ; - int got_cart, k ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - memset (&cart, 0, sizeof (cart)) ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Not able to open input file %s.\n", filename) ; - fflush (stdout) ; - memset (data, 0, sizeof (data)) ; - puts (sf_strerror (NULL)) ; - return 1 ; - } ; - - got_cart = sf_command (file, SFC_GET_CART_INFO, &cart, sizeof (cart)) ; - sf_close (file) ; - - if (got_cart == SF_FALSE) - { printf ("Error : File '%s' does not contain cart information.\n\n", filename) ; - return 1 ; - } ; - - printf ("Version : %.*s\n", (int) sizeof (cart.version), cart.version) ; - printf ("Title : %.*s\n", (int) sizeof (cart.title), cart.title) ; - printf ("Artist : %.*s\n", (int) sizeof (cart.artist), cart.artist) ; - printf ("Cut id : %.*s\n", (int) sizeof (cart.cut_id), cart.cut_id) ; - printf ("Category : %.*s\n", (int) sizeof (cart.category), cart.category) ; - printf ("Classification : %.*s\n", (int) sizeof (cart.classification), cart.classification) ; - printf ("Out cue : %.*s\n", (int) sizeof (cart.out_cue), cart.out_cue) ; - printf ("Start date : %.*s\n", (int) sizeof (cart.start_date), cart.start_date) ; - printf ("Start time : %.*s\n", (int) sizeof (cart.start_time), cart.start_time) ; - printf ("End date : %.*s\n", (int) sizeof (cart.end_date), cart.end_date) ; - printf ("End time : %.*s\n", (int) sizeof (cart.end_time), cart.end_time) ; - printf ("App id : %.*s\n", (int) sizeof (cart.producer_app_id), cart.producer_app_id) ; - printf ("App version : %.*s\n", (int) sizeof (cart.producer_app_version), cart.producer_app_version) ; - printf ("User defined : %.*s\n", (int) sizeof (cart.user_def), cart.user_def) ; - printf ("Level ref. : %d\n", cart.level_reference) ; - printf ("Post timers :\n") ; - - for (k = 0 ; k < ARRAY_LEN (cart.post_timers) ; k++) - if (cart.post_timers [k].usage [0]) - printf (" %d %.*s %d\n", k, (int) sizeof (cart.post_timers [k].usage), cart.post_timers [k].usage, cart.post_timers [k].value) ; - - printf ("Reserved : %.*s\n", (int) sizeof (cart.reserved), cart.reserved) ; - printf ("Url : %.*s\n", (int) sizeof (cart.url), cart.url) ; - printf ("Tag text : %.*s\n", cart.tag_text_size, cart.tag_text) ; - - return 0 ; -} /* cart_dump */ - -static void -total_dump (void) -{ printf ("========================================\n") ; - printf ("Total Duration : %s\n", format_duration_str (total_seconds)) ; -} /* total_dump */ diff --git a/libs/libsndfile/programs/sndfile-interleave.c b/libs/libsndfile/programs/sndfile-interleave.c deleted file mode 100644 index 24d6b9d874..0000000000 --- a/libs/libsndfile/programs/sndfile-interleave.c +++ /dev/null @@ -1,202 +0,0 @@ -/* -** Copyright (C) 2009-2011 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include - -#include "common.h" - -#define BUFFER_LEN 4096 -#define MAX_INPUTS 16 - - -typedef struct -{ SNDFILE * infile [MAX_INPUTS] ; - SNDFILE * outfile ; - - union - { double d [BUFFER_LEN] ; - int i [BUFFER_LEN] ; - } din ; - - union - - { double d [MAX_INPUTS * BUFFER_LEN] ; - int i [MAX_INPUTS * BUFFER_LEN] ; - } dout ; - - int channels ; -} STATE ; - - -static void usage_exit (void) ; -static void interleave_int (STATE * state) ; -static void interleave_double (STATE * state) ; - - -int -main (int argc, char **argv) -{ STATE state ; - SF_INFO sfinfo ; - int k, double_merge = 0 ; - - if (argc < 5) - { if (argc > 1) - puts ("\nError : need at least 2 input files.") ; - usage_exit () ; - } ; - - if (strcmp (argv [argc - 2], "-o") != 0) - { puts ("\nError : second last command line parameter should be '-o'.\n") ; - usage_exit () ; - } ; - - if (argc - 3 > MAX_INPUTS) - { printf ("\nError : Cannot handle more than %d input channels.\n\n", MAX_INPUTS) ; - exit (1) ; - } ; - - memset (&state, 0, sizeof (state)) ; - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - for (k = 1 ; k < argc - 2 ; k++) - { - if ((state.infile [k - 1] = sf_open (argv [k], SFM_READ, &sfinfo)) == NULL) - { printf ("\nError : Not able to open input file '%s'\n%s\n", argv [k], sf_strerror (NULL)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\bError : Input file '%s' should be mono (has %d channels).\n", argv [k], sfinfo.channels) ; - exit (1) ; - } ; - - switch (sfinfo.format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - case SF_FORMAT_VORBIS : - double_merge = 1 ; - break ; - - default : - break ; - } ; - - state.channels ++ ; - } ; - - sfinfo.channels = state.channels ; - sfinfo.format = sfe_file_type_of_ext (argv [argc - 1], sfinfo.format) ; - - if ((state.outfile = sf_open (argv [argc - 1], SFM_WRITE, &sfinfo)) == NULL) - { printf ("Not able to open output file '%s'\n%s\n", argv [argc - 1], sf_strerror (NULL)) ; - exit (1) ; - } ; - - if (double_merge) - interleave_double (&state) ; - else - interleave_int (&state) ; - - for (k = 0 ; k < MAX_INPUTS ; k++) - if (state.infile [k] != NULL) - sf_close (state.infile [k]) ; - sf_close (state.outfile) ; - - return 0 ; -} /* main */ - -/*------------------------------------------------------------------------------ -*/ - - -static void -usage_exit (void) -{ puts ("\nUsage : sndfile-interleave ... -o \n") ; - puts ("Merge two or more mono files into a single multi-channel file.\n") ; - printf ("Using %s.\n\n", sf_version_string ()) ; - exit (0) ; -} /* usage_exit */ - - -static void -interleave_int (STATE * state) -{ int max_read_len, read_len ; - int ch, k ; - - do - { max_read_len = 0 ; - - for (ch = 0 ; ch < state->channels ; ch ++) - { read_len = sf_read_int (state->infile [ch], state->din.i, BUFFER_LEN) ; - if (read_len < BUFFER_LEN) - memset (state->din.i + read_len, 0, sizeof (state->din.i [0]) * (BUFFER_LEN - read_len)) ; - - for (k = 0 ; k < read_len ; k++) - state->dout.i [k * state->channels + ch] = state->din.i [k] ; - - max_read_len = MAX (max_read_len, read_len) ; - } ; - - sf_writef_int (state->outfile, state->dout.i, max_read_len) ; - } - while (max_read_len > 0) ; - -} /* interleave_int */ - - -static void -interleave_double (STATE * state) -{ int max_read_len, read_len ; - int ch, k ; - - do - { max_read_len = 0 ; - - for (ch = 0 ; ch < state->channels ; ch ++) - { read_len = sf_read_double (state->infile [ch], state->din.d, BUFFER_LEN) ; - if (read_len < BUFFER_LEN) - memset (state->din.d + read_len, 0, sizeof (state->din.d [0]) * (BUFFER_LEN - read_len)) ; - - for (k = 0 ; k < read_len ; k++) - state->dout.d [k * state->channels + ch] = state->din.d [k] ; - - max_read_len = MAX (max_read_len, read_len) ; - } ; - - sf_writef_double (state->outfile, state->dout.d, max_read_len) ; - } - while (max_read_len > 0) ; - -} /* interleave_double */ diff --git a/libs/libsndfile/programs/sndfile-jackplay.c b/libs/libsndfile/programs/sndfile-jackplay.c deleted file mode 100644 index 87b722de2f..0000000000 --- a/libs/libsndfile/programs/sndfile-jackplay.c +++ /dev/null @@ -1,277 +0,0 @@ -/* -** Copyright (c) 2007-2009 Erik de Castro Lopo -** Copyright (C) 2007 Jonatan Liljedahl -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_JACK - -#include -#include - -#include -#include - -#include - -#define RB_SIZE (1 << 16) - -typedef struct _thread_info -{ pthread_t thread_id ; - SNDFILE *sndfile ; - jack_nframes_t pos ; - jack_client_t *client ; - unsigned int channels ; - volatile int can_process ; - volatile int read_done ; - volatile int play_done ; -} thread_info_t ; - -pthread_mutex_t disk_thread_lock = PTHREAD_MUTEX_INITIALIZER ; -pthread_cond_t data_ready = PTHREAD_COND_INITIALIZER ; - -static jack_ringbuffer_t *ringbuf ; -static jack_port_t **output_port ; -static jack_default_audio_sample_t ** outs ; -const size_t sample_size = sizeof (jack_default_audio_sample_t) ; - -static int -process (jack_nframes_t nframes, void * arg) -{ - thread_info_t *info = (thread_info_t *) arg ; - jack_default_audio_sample_t buf [info->channels] ; - unsigned i, n ; - - if (! info->can_process) - return 0 ; - - for (n = 0 ; n < info->channels ; n++) - outs [n] = jack_port_get_buffer (output_port [n], nframes) ; - - for (i = 0 ; i < nframes ; i++) - { size_t read_cnt ; - - /* Read one frame of audio. */ - read_cnt = jack_ringbuffer_read (ringbuf, (void*) buf, sample_size*info->channels) ; - if (read_cnt == 0 && info->read_done) - { /* File is done, so stop the main loop. */ - info->play_done = 1 ; - return 0 ; - } ; - - /* Update play-position counter. */ - info->pos += read_cnt / (sample_size*info->channels) ; - - /* Output each channel of the frame. */ - for (n = 0 ; n < info->channels ; n++) - outs [n][i] = buf [n] ; - } ; - - /* Wake up the disk thread to read more data. */ - if (pthread_mutex_trylock (&disk_thread_lock) == 0) - { pthread_cond_signal (&data_ready) ; - pthread_mutex_unlock (&disk_thread_lock) ; - } ; - - return 0 ; -} /* process */ - -static void * -disk_thread (void *arg) -{ thread_info_t *info = (thread_info_t *) arg ; - sf_count_t buf_avail, read_frames ; - jack_ringbuffer_data_t vec [2] ; - size_t bytes_per_frame = sample_size*info->channels ; - - pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL) ; - pthread_mutex_lock (&disk_thread_lock) ; - - while (1) - { jack_ringbuffer_get_write_vector (ringbuf, vec) ; - - read_frames = 0 ; - - if (vec [0].len) - { /* Fill the first part of the ringbuffer. */ - buf_avail = vec [0].len / bytes_per_frame ; - read_frames = sf_readf_float (info->sndfile, (float *) vec [0].buf, buf_avail) ; - if (vec [1].len) - { /* Fill the second part of the ringbuffer? */ - buf_avail = vec [1].len / bytes_per_frame ; - read_frames += sf_readf_float (info->sndfile, (float *) vec [1].buf, buf_avail) ; - } ; - } ; - - if (read_frames == 0) - break ; /* end of file? */ - - jack_ringbuffer_write_advance (ringbuf, read_frames * bytes_per_frame) ; - - /* Tell process that we've filled the ringbuffer. */ - info->can_process = 1 ; - - /* Wait for the process thread to wake us up. */ - pthread_cond_wait (&data_ready, &disk_thread_lock) ; - } ; - - /* Tell that we're done reading the file. */ - info->read_done = 1 ; - pthread_mutex_unlock (&disk_thread_lock) ; - - return 0 ; -} /* disk_thread */ - -static void -jack_shutdown (void *arg) -{ (void) arg ; - exit (1) ; -} /* jack_shutdown */ - -static void -print_time (jack_nframes_t pos, int jack_sr) -{ float sec = pos / (1.0 * jack_sr) ; - int min = sec / 60.0 ; - fprintf (stderr, "%02d:%05.2f", min, fmod (sec, 60.0)) ; -} /* print_time */ - -int -main (int narg, char * args []) -{ - SNDFILE *sndfile ; - SF_INFO sndfileinfo ; - jack_client_t *client ; - thread_info_t info ; - int i, jack_sr ; - - if (narg < 2) - { fprintf (stderr, "no soundfile given\n") ; - return 1 ; - } ; - - // create jack client - if ((client = jack_client_new ("jackplay")) == 0) - { - fprintf (stderr, "Jack server not running?\n") ; - return 1 ; - } ; - - jack_sr = jack_get_sample_rate (client) ; - - /* Open the soundfile. */ - sndfileinfo.format = 0 ; - sndfile = sf_open (args [1], SFM_READ, &sndfileinfo) ; - if (sndfile == NULL) - { fprintf (stderr, "Could not open soundfile '%s'\n", args [1]) ; - return 1 ; - } ; - - fprintf (stderr, "Channels : %d\nSample rate : %d Hz\nDuration : ", sndfileinfo.channels, sndfileinfo.samplerate) ; - - print_time (sndfileinfo.frames, sndfileinfo.samplerate) ; - fprintf (stderr, "\n") ; - - if (sndfileinfo.samplerate != jack_sr) - fprintf (stderr, "Warning: samplerate of soundfile (%d Hz) does not match jack server (%d Hz).\n", sndfileinfo.samplerate, jack_sr) ; - - /* Init the thread info struct. */ - memset (&info, 0, sizeof (info)) ; - info.can_process = 0 ; - info.read_done = 0 ; - info.play_done = 0 ; - info.sndfile = sndfile ; - info.channels = sndfileinfo.channels ; - info.client = client ; - info.pos = 0 ; - - /* Set up callbacks. */ - jack_set_process_callback (client, process, &info) ; - jack_on_shutdown (client, jack_shutdown, 0) ; - - /* Allocate output ports. */ - output_port = calloc (sndfileinfo.channels, sizeof (jack_port_t *)) ; - outs = calloc (sndfileinfo.channels, sizeof (jack_default_audio_sample_t *)) ; - for (i = 0 ; i < sndfileinfo.channels ; i++) - { char name [16] ; - - snprintf (name, sizeof (name), "out_%d", i + 1) ; - output_port [i] = jack_port_register (client, name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0) ; - } ; - - /* Allocate and clear ringbuffer. */ - ringbuf = jack_ringbuffer_create (sizeof (jack_default_audio_sample_t) * RB_SIZE) ; - memset (ringbuf->buf, 0, ringbuf->size) ; - - /* Activate client. */ - if (jack_activate (client)) - { fprintf (stderr, "Cannot activate client.\n") ; - return 1 ; - } ; - - /* Auto connect all channels. */ - for (i = 0 ; i < sndfileinfo.channels ; i++) - { char name [64] ; - - snprintf (name, sizeof (name), "alsa_pcm:playback_%d", i + 1) ; - - if (jack_connect (client, jack_port_name (output_port [i]), name)) - fprintf (stderr, "Cannot connect output port %d (%s).\n", i, name) ; - } ; - - /* Start the disk thread. */ - pthread_create (&info.thread_id, NULL, disk_thread, &info) ; - - /* Sit in a loop, displaying the current play position. */ - while (! info.play_done) - { fprintf (stderr, "\r-> ") ; - print_time (info.pos, jack_sr) ; - fflush (stdout) ; - usleep (50000) ; - } ; - - /* Clean up. */ - jack_client_close (client) ; - jack_ringbuffer_free (ringbuf) ; - sf_close (sndfile) ; - free (outs) ; - free (output_port) ; - - puts ("") ; - - return 0 ; -} /* main */ - -#else - -int -main (void) -{ - puts ( - "Sorry this program was compiled without libjack (which probably\n" - "only exists on Linux and Mac OSX) and hence doesn't work." - ) ; - - return 0 ; -} /* main */ - -#endif diff --git a/libs/libsndfile/programs/sndfile-metadata-get.c b/libs/libsndfile/programs/sndfile-metadata-get.c deleted file mode 100644 index b4aa9b60f0..0000000000 --- a/libs/libsndfile/programs/sndfile-metadata-get.c +++ /dev/null @@ -1,176 +0,0 @@ -/* -** Copyright (C) 2008-2012 Erik de Castro Lopo -** Copyright (C) 2008-2010 George Blood Audio -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include - -#include -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN (1 << 16) - -static void usage_exit (const char *progname, int exit_code) ; -static void process_args (SNDFILE * file, const SF_BROADCAST_INFO_2K * binfo, int argc, char * argv []) ; - -int -main (int argc, char *argv []) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_BROADCAST_INFO_2K binfo ; - const char *progname ; - const char * filename = NULL ; - int start ; - - /* Store the program name. */ - progname = program_name (argv [0]) ; - - /* Check if we've been asked for help. */ - if (argc <= 2 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0) - usage_exit (progname, 0) ; - - if (argv [argc - 1][0] != '-') - { filename = argv [argc - 1] ; - start = 1 ; - } - else if (argv [1][0] != '-') - { filename = argv [1] ; - start = 2 ; - } - else - { printf ("Error : Either the first or the last command line parameter should be a filename.\n\n") ; - exit (1) ; - } ; - - /* Get the time in case we need it later. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("Error : Open of file '%s' failed : %s\n\n", filename, sf_strerror (file)) ; - exit (1) ; - } ; - - memset (&binfo, 0, sizeof (binfo)) ; - if (sf_command (file, SFC_GET_BROADCAST_INFO, &binfo, sizeof (binfo)) == 0) - memset (&binfo, 0, sizeof (binfo)) ; - - process_args (file, &binfo, argc - 2, argv + start) ; - - sf_close (file) ; - return 0 ; -} /* main */ - -/*============================================================================== -** Print version and usage. -*/ - -static void -usage_exit (const char *progname, int exit_code) -{ printf ("\nUsage :\n %s [options] \n\nOptions:\n", progname) ; - - puts ( - " --bext-description Print the 'bext' description.\n" - " --bext-originator Print the 'bext; originator info.\n" - " --bext-orig-ref Print the 'bext' origination reference.\n" - " --bext-umid Print the 'bext' UMID.\n" - " --bext-orig-date Print the 'bext' origination date.\n" - " --bext-orig-time Print the 'bext' origination time.\n" - " --bext-coding-hist Print the 'bext' coding history.\n" - ) ; - - puts ( - " --str-title Print the title metadata.\n" - " --str-copyright Print the copyright metadata.\n" - " --str-artist Print the artist metadata.\n" - " --str-comment Print the comment metadata.\n" - " --str-date Print the creation date metadata.\n" - " --str-album Print the album metadata.\n" - " --str-license Print the license metadata.\n" - ) ; - - printf ("Using %s.\n\n", sf_version_string ()) ; - exit (exit_code) ; -} /* usage_exit */ - -static void -process_args (SNDFILE * file, const SF_BROADCAST_INFO_2K * binfo, int argc, char * argv []) -{ const char * str ; - int k, do_all = 0 ; - -#define HANDLE_BEXT_ARG(cmd, name, field) \ - if (do_all || strcmp (argv [k], cmd) == 0) \ - { printf ("%-20s : %.*s\n", name, (int) sizeof (binfo->field), binfo->field) ; \ - if (! do_all) \ - continue ; \ - } ; - -#define HANDLE_STR_ARG(cmd, name, id) \ - if (do_all || strcmp (argv [k], cmd) == 0) \ - { str = sf_get_string (file, id) ; \ - printf ("%-20s : %s\n", name, str ? str : "") ; \ - if (! do_all) continue ; \ - } ; - - for (k = 0 ; k < argc ; k++) - { if (do_all || strcmp (argv [k], "--all") == 0) - do_all = 1 ; - - HANDLE_BEXT_ARG ("--bext-description", "Description", description) ; - HANDLE_BEXT_ARG ("--bext-originator", "Originator", originator) ; - HANDLE_BEXT_ARG ("--bext-orig-ref", "Origination ref", originator_reference) ; - HANDLE_BEXT_ARG ("--bext-umid", "UMID", umid) ; - HANDLE_BEXT_ARG ("--bext-orig-date", "Origination date", origination_date) ; - HANDLE_BEXT_ARG ("--bext-orig-time", "Origination time", origination_time) ; - HANDLE_BEXT_ARG ("--bext-coding-hist", "Coding history", coding_history) ; - - HANDLE_STR_ARG ("--str-title", "Name", SF_STR_TITLE) ; - HANDLE_STR_ARG ("--str-copyright", "Copyright", SF_STR_COPYRIGHT) ; - HANDLE_STR_ARG ("--str-artist", "Artist", SF_STR_ARTIST) ; - HANDLE_STR_ARG ("--str-comment", "Comment", SF_STR_COMMENT) ; - HANDLE_STR_ARG ("--str-date", "Create date", SF_STR_DATE) ; - HANDLE_STR_ARG ("--str-album", "Album", SF_STR_ALBUM) ; - HANDLE_STR_ARG ("--str-license", "License", SF_STR_LICENSE) ; - - if (! do_all) - { printf ("Error : Don't know what to do with command line arg '%s'.\n\n", argv [k]) ; - exit (1) ; - } ; - break ; - } ; - - return ; -} /* process_args */ diff --git a/libs/libsndfile/programs/sndfile-metadata-set.c b/libs/libsndfile/programs/sndfile-metadata-set.c deleted file mode 100644 index b1d021a888..0000000000 --- a/libs/libsndfile/programs/sndfile-metadata-set.c +++ /dev/null @@ -1,284 +0,0 @@ -/* -** Copyright (C) 2008-2012 Erik de Castro Lopo -** Copyright (C) 2008-2010 George Blood Audio -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include - -#include -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN (1 << 16) - - -static void usage_exit (const char *progname, int exit_code) ; -static void missing_param (const char * option) ; -static void read_localtime (struct tm * timedata) ; -static int has_bext_fields_set (const METADATA_INFO * info) ; - -int -main (int argc, char *argv []) -{ METADATA_INFO info ; - struct tm timedata ; - const char *progname ; - const char * filenames [2] = { NULL, NULL } ; - int k ; - - /* Store the program name. */ - progname = program_name (argv [0]) ; - - /* Check if we've been asked for help. */ - if (argc < 3 || strcmp (argv [1], "--help") == 0 || strcmp (argv [1], "-h") == 0) - usage_exit (progname, 0) ; - - /* Clear set all fields of the struct to zero bytes. */ - memset (&info, 0, sizeof (info)) ; - - /* Get the time in case we need it later. */ - read_localtime (&timedata) ; - - for (k = 1 ; k < argc ; k++) - { char tmp [20] ; - - if (argv [k][0] != '-') - { if (filenames [0] == NULL) - filenames [0] = argv [k] ; - else if (filenames [1] == NULL) - filenames [1] = argv [k] ; - else - { printf ("Error : Already have two file names on the command line and then found '%s'.\n\n", argv [k]) ; - usage_exit (progname, 1) ; - } ; - continue ; - } ; - -#define HANDLE_BEXT_ARG(cmd, field) \ - if (strcmp (argv [k], cmd) == 0) \ - { k ++ ; \ - if (k == argc) missing_param (argv [k - 1]) ; \ - info.field = argv [k] ; \ - continue ; \ - } ; - - HANDLE_BEXT_ARG ("--bext-description", description) ; - HANDLE_BEXT_ARG ("--bext-originator", originator) ; - HANDLE_BEXT_ARG ("--bext-orig-ref", originator_reference) ; - HANDLE_BEXT_ARG ("--bext-umid", umid) ; - HANDLE_BEXT_ARG ("--bext-orig-date", origination_date) ; - HANDLE_BEXT_ARG ("--bext-orig-time", origination_time) ; - HANDLE_BEXT_ARG ("--bext-coding-hist", coding_history) ; - HANDLE_BEXT_ARG ("--bext-time-ref", time_ref) ; - -#define HANDLE_STR_ARG(cmd, field) \ - if (strcmp (argv [k], cmd) == 0) \ - { k ++ ; \ - if (k == argc) missing_param (argv [k - 1]) ; \ - info.field = argv [k] ; \ - continue ; \ - } ; - - HANDLE_STR_ARG ("--str-comment", comment) ; - HANDLE_STR_ARG ("--str-title", title) ; - HANDLE_STR_ARG ("--str-copyright", copyright) ; - HANDLE_STR_ARG ("--str-artist", artist) ; - HANDLE_STR_ARG ("--str-date", date) ; - HANDLE_STR_ARG ("--str-album", album) ; - HANDLE_STR_ARG ("--str-license", license) ; - - /* Following options do not take an argument. */ - if (strcmp (argv [k], "--bext-auto-time-date") == 0) - { snprintf (tmp, sizeof (tmp), "%02d:%02d:%02d", timedata.tm_hour, timedata.tm_min, timedata.tm_sec) ; - info.origination_time = strdup (tmp) ; - - snprintf (tmp, sizeof (tmp), "%04d-%02d-%02d", timedata.tm_year + 1900, timedata.tm_mon + 1, timedata.tm_mday) ; - info.origination_date = strdup (tmp) ; - continue ; - } ; - - if (strcmp (argv [k], "--bext-auto-time") == 0) - { snprintf (tmp, sizeof (tmp), "%02d:%02d:%02d", timedata.tm_hour, timedata.tm_min, timedata.tm_sec) ; - info.origination_time = strdup (tmp) ; - continue ; - } ; - - if (strcmp (argv [k], "--bext-auto-date") == 0) - { snprintf (tmp, sizeof (tmp), "%04d-%02d-%02d", timedata.tm_year + 1900, timedata.tm_mon + 1, timedata.tm_mday) ; - info.origination_date = strdup (tmp) ; - continue ; - } ; - - if (strcmp (argv [k], "--str-auto-date") == 0) - { snprintf (tmp, sizeof (tmp), "%04d-%02d-%02d", timedata.tm_year + 1900, timedata.tm_mon + 1, timedata.tm_mday) ; - - info.date = strdup (tmp) ; - continue ; - } ; - - printf ("Error : Don't know what to do with command line arg '%s'.\n\n", argv [k]) ; - usage_exit (progname, 1) ; - } ; - - /* Find out if any of the 'bext' fields are set. */ - info.has_bext_fields = has_bext_fields_set (&info) ; - - if (filenames [0] == NULL) - { printf ("Error : No input file specificed.\n\n") ; - exit (1) ; - } ; - - if (filenames [1] != NULL && strcmp (filenames [0], filenames [1]) == 0) - { printf ("Error : Input and output files are the same.\n\n") ; - exit (1) ; - } ; - - if (info.coding_history != NULL && filenames [1] == NULL) - { printf ("\n" - "Error : Trying to update coding history of an existing file which unfortunately\n" - " is not supported. Instead, create a new file using :\n" - "\n" - " %s --bext-coding-hist \"Coding history\" old_file.wav new_file.wav\n" - "\n", - progname) ; - exit (1) ; - } ; - - sfe_apply_metadata_changes (filenames, &info) ; - - return 0 ; -} /* main */ - -/*============================================================================== -** Print version and usage. -*/ - -static void -usage_exit (const char *progname, int exit_code) -{ printf ("\nUsage :\n\n" - " %s [options] \n" - " %s [options] \n" - "\n", - progname, progname) ; - - puts ( - "Where an option is made up of a pair of a field to set (one of\n" - "the 'bext' or metadata fields below) and a string. Fields are\n" - "as follows :\n" - ) ; - - puts ( - " --bext-description Set the 'bext' description.\n" - " --bext-originator Set the 'bext' originator.\n" - " --bext-orig-ref Set the 'bext' originator reference.\n" - " --bext-umid Set the 'bext' UMID.\n" - " --bext-orig-date Set the 'bext' origination date.\n" - " --bext-orig-time Set the 'bext' origination time.\n" - " --bext-coding-hist Set the 'bext' coding history.\n" - " --bext-time-raf Set the 'bext' Time ref.\n" - "\n" - " --str-comment Set the metadata comment.\n" - " --str-title Set the metadata title.\n" - " --str-copyright Set the metadata copyright.\n" - " --str-artist Set the metadata artist.\n" - " --str-date Set the metadata date.\n" - " --str-album Set the metadata album.\n" - " --str-license Set the metadata license.\n" - ) ; - - puts ( - "There are also the following arguments which do not take a\n" - "parameter :\n\n" - " --bext-auto-time-date Set the 'bext' time and date to current time/date.\n" - " --bext-auto-time Set the 'bext' time to current time.\n" - " --bext-auto-date Set the 'bext' date to current date.\n" - " --str-auto-date Set the metadata date to current date.\n" - ) ; - - puts ( - "Most of the above operations can be done in-place on an existing\n" - "file. If any operation cannot be performed, the application will\n" - "exit with an appropriate error message.\n" - ) ; - - printf ("Using %s.\n\n", sf_version_string ()) ; - exit (exit_code) ; -} /* usage_exit */ - -static void -missing_param (const char * option) -{ - printf ("Error : Option '%s' needs a parameter but doesn't seem to have one.\n\n", option) ; - exit (1) ; -} /* missing_param */ - -/*============================================================================== -*/ - -static int -has_bext_fields_set (const METADATA_INFO * info) -{ - if (info->description || info->originator || info->originator_reference) - return 1 ; - - if (info->origination_date || info->origination_time || info->umid || info->coding_history || info->time_ref) - return 1 ; - - return 0 ; -} /* has_bext_fields_set */ - -static void -read_localtime (struct tm * timedata) -{ time_t current ; - - time (¤t) ; - memset (timedata, 0, sizeof (struct tm)) ; - -#if defined (HAVE_LOCALTIME_R) - /* If the re-entrant version is available, use it. */ - localtime_r (¤t, timedata) ; -#elif defined (HAVE_LOCALTIME) - { - struct tm *tmptr ; - /* Otherwise use the standard one and copy the data to local storage. */ - if ((tmptr = localtime (¤t)) != NULL) - memcpy (timedata, tmptr, sizeof (struct tm)) ; - } -#endif - - return ; -} /* read_localtime */ - diff --git a/libs/libsndfile/programs/sndfile-play-beos.cpp b/libs/libsndfile/programs/sndfile-play-beos.cpp deleted file mode 100644 index fb3fde4cdc..0000000000 --- a/libs/libsndfile/programs/sndfile-play-beos.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* -** Copyright (C) 2001 Marcus Overhagen -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include - -#include -#include -#include - -#include - -#define BUFFER_LEN 1024 - -/*------------------------------------------------------------------------------ -** BeOS functions for playing a sound. -*/ - -#if defined (__BEOS__) - -struct shared_data -{ - BSoundPlayer *player; - SNDFILE *sndfile; - SF_INFO sfinfo; - sem_id finished; -}; - -static void -buffer_callback(void *theCookie, void *buf, size_t size, const media_raw_audio_format &format) -{ - shared_data *data = (shared_data *)theCookie; - short *buffer = (short *)buf; - int count = size / sizeof(short); - int m, readcount; - - if (!data->player->HasData()) - return; - - readcount = sf_read_short(data->sndfile, buffer, count); - if (readcount == 0) - { data->player->SetHasData(false); - release_sem(data->finished); - } - if (readcount < count) - { for (m = readcount ; m < count ; m++) - buffer [m] = 0 ; - } - if (data->sfinfo.pcmbitwidth < 16) - { for (m = 0 ; m < count ; m++) - buffer [m] *= 256 ; - } -} - -static void -beos_play (int argc, char *argv []) -{ - shared_data data; - status_t status; - int k; - - /* BSoundPlayer requires a BApplication object */ - BApplication app("application/x-vnd.MarcusOverhagen-sfplay"); - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (data.sndfile = sf_open_read (argv [k], &data.sfinfo))) - { sf_perror (NULL) ; - continue ; - } ; - - if (data.sfinfo.channels < 1 || data.sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", data.sfinfo.channels) ; - sf_close (data.sndfile) ; - continue ; - } ; - - data.finished = create_sem(0,"finished"); - - media_raw_audio_format format = - { data.sfinfo.samplerate, - data.sfinfo.channels, - media_raw_audio_format::B_AUDIO_SHORT, - B_HOST_IS_LENDIAN ? B_MEDIA_LITTLE_ENDIAN : B_MEDIA_BIG_ENDIAN, - BUFFER_LEN * sizeof(short) - }; - - BSoundPlayer player(&format,"player",buffer_callback,NULL,&data); - data.player = &player; - - if ((status = player.InitCheck()) != B_OK) - { - printf ("Error : BSoundPlayer init failed, %s.\n", strerror(status)) ; - delete_sem(data.finished); - sf_close (data.sndfile) ; - continue ; - } - - player.SetVolume(1.0); - player.Start(); - player.SetHasData(true); - acquire_sem(data.finished); - player.Stop(); - delete_sem(data.finished); - - sf_close (data.sndfile) ; - - } ; - -} /* beos_play */ - -#endif - -/*============================================================================== -** Main function. -*/ - -int -main (int argc, char *argv []) -{ - if (argc < 2) - { printf ("Usage : %s \n\n", argv [0]) ; - return 1 ; - } ; - - beos_play (argc, argv) ; - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/programs/sndfile-play.c b/libs/libsndfile/programs/sndfile-play.c deleted file mode 100644 index f779f11a86..0000000000 --- a/libs/libsndfile/programs/sndfile-play.c +++ /dev/null @@ -1,1211 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "common.h" - -#if HAVE_ALSA_ASOUNDLIB_H - #define ALSA_PCM_NEW_HW_PARAMS_API - #define ALSA_PCM_NEW_SW_PARAMS_API - #include - #include -#endif - -#if defined (__ANDROID__) - -#elif defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__FreeBSD__) - #include - #include - #include - -#elif (defined (__MACH__) && defined (__APPLE__)) - #include - #include - - #if (OSX_DARWIN_VERSION > 11) - /* Includes go here. */ - #elif (OSX_DARWIN_VERSION == 11) - #include - #elif (OSX_DARWIN_VERSION > 0 && OSX_DARWIN_VERSION <= 10) - #include - #include - #endif - -#elif defined (HAVE_SNDIO_H) - #include - -#elif (defined (sun) && defined (unix)) - #include - #include - #include - -#elif (OS_IS_WIN32 == 1) - #include - #include - -#endif - -#define SIGNED_SIZEOF(x) ((int) sizeof (x)) -#define BUFFER_LEN (2048) - -/*------------------------------------------------------------------------------ -** Linux/OSS functions for playing a sound. -*/ - -#if HAVE_ALSA_ASOUNDLIB_H - -static snd_pcm_t * alsa_open (int channels, unsigned srate, int realtime) ; -static int alsa_write_float (snd_pcm_t *alsa_dev, float *data, int frames, int channels) ; - -static void -alsa_play (int argc, char *argv []) -{ static float buffer [BUFFER_LEN] ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - snd_pcm_t * alsa_dev ; - int k, readcount, subformat ; - - for (k = 1 ; k < argc ; k++) - { memset (&sfinfo, 0, sizeof (sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - if ((alsa_dev = alsa_open (sfinfo.channels, (unsigned) sfinfo.samplerate, SF_FALSE)) == NULL) - continue ; - - subformat = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - { double scale ; - int m ; - - sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &scale, sizeof (scale)) ; - if (scale < 1e-10) - scale = 1.0 ; - else - scale = 32700.0 / scale ; - - while ((readcount = sf_read_float (sndfile, buffer, BUFFER_LEN))) - { for (m = 0 ; m < readcount ; m++) - buffer [m] *= scale ; - alsa_write_float (alsa_dev, buffer, BUFFER_LEN / sfinfo.channels, sfinfo.channels) ; - } ; - } - else - { while ((readcount = sf_read_float (sndfile, buffer, BUFFER_LEN))) - alsa_write_float (alsa_dev, buffer, BUFFER_LEN / sfinfo.channels, sfinfo.channels) ; - } ; - - snd_pcm_drain (alsa_dev) ; - snd_pcm_close (alsa_dev) ; - - sf_close (sndfile) ; - } ; - - return ; -} /* alsa_play */ - -static snd_pcm_t * -alsa_open (int channels, unsigned samplerate, int realtime) -{ const char * device = "default" ; - snd_pcm_t *alsa_dev = NULL ; - snd_pcm_hw_params_t *hw_params ; - snd_pcm_uframes_t buffer_size ; - snd_pcm_uframes_t alsa_period_size, alsa_buffer_frames ; - snd_pcm_sw_params_t *sw_params ; - - int err ; - - if (realtime) - { alsa_period_size = 256 ; - alsa_buffer_frames = 3 * alsa_period_size ; - } - else - { alsa_period_size = 1024 ; - alsa_buffer_frames = 4 * alsa_period_size ; - } ; - - if ((err = snd_pcm_open (&alsa_dev, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) - { fprintf (stderr, "cannot open audio device \"%s\" (%s)\n", device, snd_strerror (err)) ; - goto catch_error ; - } ; - - snd_pcm_nonblock (alsa_dev, 0) ; - - if ((err = snd_pcm_hw_params_malloc (&hw_params)) < 0) - { fprintf (stderr, "cannot allocate hardware parameter structure (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_any (alsa_dev, hw_params)) < 0) - { fprintf (stderr, "cannot initialize hardware parameter structure (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_access (alsa_dev, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) - { fprintf (stderr, "cannot set access type (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_format (alsa_dev, hw_params, SND_PCM_FORMAT_FLOAT)) < 0) - { fprintf (stderr, "cannot set sample format (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_rate_near (alsa_dev, hw_params, &samplerate, 0)) < 0) - { fprintf (stderr, "cannot set sample rate (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_channels (alsa_dev, hw_params, channels)) < 0) - { fprintf (stderr, "cannot set channel count (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_buffer_size_near (alsa_dev, hw_params, &alsa_buffer_frames)) < 0) - { fprintf (stderr, "cannot set buffer size (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params_set_period_size_near (alsa_dev, hw_params, &alsa_period_size, 0)) < 0) - { fprintf (stderr, "cannot set period size (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_hw_params (alsa_dev, hw_params)) < 0) - { fprintf (stderr, "cannot set parameters (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - /* extra check: if we have only one period, this code won't work */ - snd_pcm_hw_params_get_period_size (hw_params, &alsa_period_size, 0) ; - snd_pcm_hw_params_get_buffer_size (hw_params, &buffer_size) ; - if (alsa_period_size == buffer_size) - { fprintf (stderr, "Can't use period equal to buffer size (%lu == %lu)", alsa_period_size, buffer_size) ; - goto catch_error ; - } ; - - snd_pcm_hw_params_free (hw_params) ; - - if ((err = snd_pcm_sw_params_malloc (&sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params_malloc: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_sw_params_current (alsa_dev, sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params_current: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - /* note: set start threshold to delay start until the ring buffer is full */ - snd_pcm_sw_params_current (alsa_dev, sw_params) ; - - if ((err = snd_pcm_sw_params_set_start_threshold (alsa_dev, sw_params, buffer_size)) < 0) - { fprintf (stderr, "cannot set start threshold (%s)\n", snd_strerror (err)) ; - goto catch_error ; - } ; - - if ((err = snd_pcm_sw_params (alsa_dev, sw_params)) != 0) - { fprintf (stderr, "%s: snd_pcm_sw_params: %s", __func__, snd_strerror (err)) ; - goto catch_error ; - } ; - - snd_pcm_sw_params_free (sw_params) ; - - snd_pcm_reset (alsa_dev) ; - -catch_error : - - if (err < 0 && alsa_dev != NULL) - { snd_pcm_close (alsa_dev) ; - return NULL ; - } ; - - return alsa_dev ; -} /* alsa_open */ - -static int -alsa_write_float (snd_pcm_t *alsa_dev, float *data, int frames, int channels) -{ static int epipe_count = 0 ; - - int total = 0 ; - int retval ; - - if (epipe_count > 0) - epipe_count -- ; - - while (total < frames) - { retval = snd_pcm_writei (alsa_dev, data + total * channels, frames - total) ; - - if (retval >= 0) - { total += retval ; - if (total == frames) - return total ; - - continue ; - } ; - - switch (retval) - { case -EAGAIN : - puts ("alsa_write_float: EAGAIN") ; - continue ; - break ; - - case -EPIPE : - if (epipe_count > 0) - { printf ("alsa_write_float: EPIPE %d\n", epipe_count) ; - if (epipe_count > 140) - return retval ; - } ; - epipe_count += 100 ; - -#if 0 - if (0) - { snd_pcm_status_t *status ; - - snd_pcm_status_alloca (&status) ; - if ((retval = snd_pcm_status (alsa_dev, status)) < 0) - fprintf (stderr, "alsa_out: xrun. can't determine length\n") ; - else if (snd_pcm_status_get_state (status) == SND_PCM_STATE_XRUN) - { struct timeval now, diff, tstamp ; - - gettimeofday (&now, 0) ; - snd_pcm_status_get_trigger_tstamp (status, &tstamp) ; - timersub (&now, &tstamp, &diff) ; - - fprintf (stderr, "alsa_write_float xrun: of at least %.3f msecs. resetting stream\n", - diff.tv_sec * 1000 + diff.tv_usec / 1000.0) ; - } - else - fprintf (stderr, "alsa_write_float: xrun. can't determine length\n") ; - } ; -#endif - - snd_pcm_prepare (alsa_dev) ; - break ; - - case -EBADFD : - fprintf (stderr, "alsa_write_float: Bad PCM state.n") ; - return 0 ; - break ; - - case -ESTRPIPE : - fprintf (stderr, "alsa_write_float: Suspend event.n") ; - return 0 ; - break ; - - case -EIO : - puts ("alsa_write_float: EIO") ; - return 0 ; - - default : - fprintf (stderr, "alsa_write_float: retval = %d\n", retval) ; - return 0 ; - break ; - } ; /* switch */ - } ; /* while */ - - return total ; -} /* alsa_write_float */ - -#endif /* HAVE_ALSA_ASOUNDLIB_H */ - -/*------------------------------------------------------------------------------ -** Linux/OSS functions for playing a sound. -*/ - -#if !defined (__ANDROID__) && (defined (__linux__) || defined (__FreeBSD_kernel__) || defined (__FreeBSD__)) - -static int opensoundsys_open_device (int channels, int srate) ; - -static int -opensoundsys_play (int argc, char *argv []) -{ static short buffer [BUFFER_LEN] ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - int k, audio_device, readcount, writecount, subformat ; - - for (k = 1 ; k < argc ; k++) - { memset (&sfinfo, 0, sizeof (sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - audio_device = opensoundsys_open_device (sfinfo.channels, sfinfo.samplerate) ; - - subformat = sfinfo.format & SF_FORMAT_SUBMASK ; - - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - { static float float_buffer [BUFFER_LEN] ; - double scale ; - int m ; - - sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &scale, sizeof (scale)) ; - if (scale < 1e-10) - scale = 1.0 ; - else - scale = 32700.0 / scale ; - - while ((readcount = sf_read_float (sndfile, float_buffer, BUFFER_LEN))) - { for (m = 0 ; m < readcount ; m++) - buffer [m] = scale * float_buffer [m] ; - writecount = write (audio_device, buffer, readcount * sizeof (short)) ; - } ; - } - else - { while ((readcount = sf_read_short (sndfile, buffer, BUFFER_LEN))) - writecount = write (audio_device, buffer, readcount * sizeof (short)) ; - } ; - - if (ioctl (audio_device, SNDCTL_DSP_POST, 0) == -1) - perror ("ioctl (SNDCTL_DSP_POST) ") ; - - if (ioctl (audio_device, SNDCTL_DSP_SYNC, 0) == -1) - perror ("ioctl (SNDCTL_DSP_SYNC) ") ; - - close (audio_device) ; - - sf_close (sndfile) ; - } ; - - return writecount ; -} /* opensoundsys_play */ - -static int -opensoundsys_open_device (int channels, int srate) -{ int fd, stereo, fmt ; - - if ((fd = open ("/dev/dsp", O_WRONLY, 0)) == -1 && - (fd = open ("/dev/sound/dsp", O_WRONLY, 0)) == -1) - { perror ("opensoundsys_open_device : open ") ; - exit (1) ; - } ; - - stereo = 0 ; - if (ioctl (fd, SNDCTL_DSP_STEREO, &stereo) == -1) - { /* Fatal error */ - perror ("opensoundsys_open_device : stereo ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_RESET, 0)) - { perror ("opensoundsys_open_device : reset ") ; - exit (1) ; - } ; - - fmt = CPU_IS_BIG_ENDIAN ? AFMT_S16_BE : AFMT_S16_LE ; - if (ioctl (fd, SNDCTL_DSP_SETFMT, &fmt) != 0) - { perror ("opensoundsys_open_device : set format ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_CHANNELS, &channels) != 0) - { perror ("opensoundsys_open_device : channels ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_SPEED, &srate) != 0) - { perror ("opensoundsys_open_device : sample rate ") ; - exit (1) ; - } ; - - if (ioctl (fd, SNDCTL_DSP_SYNC, 0) != 0) - { perror ("opensoundsys_open_device : sync ") ; - exit (1) ; - } ; - - return fd ; -} /* opensoundsys_open_device */ - -#endif /* __linux__ */ - -/*------------------------------------------------------------------------------ -** Mac OS X functions for playing a sound. -*/ - -#if (OSX_DARWIN_VERSION > 11) -/* MacOSX 10.8 use a new Audio API. Someone needs to write some code for it. */ -#endif /* OSX_DARWIN_VERSION > 11 */ - -#if (OSX_DARWIN_VERSION == 11) -/* MacOSX 10.7 use AudioQueue API */ - -#define kBytesPerAudioBuffer (1024 * 8) -#define kNumberOfAudioBuffers 4 - -typedef struct -{ AudioStreamBasicDescription format ; - - AudioQueueRef queue ; - AudioQueueBufferRef queueBuffer [kNumberOfAudioBuffers] ; - - UInt32 buf_size ; - - SNDFILE *sndfile ; - SF_INFO sfinfo ; - - int done_playing ; -} MacOSXAudioData ; - - -static void -macosx_fill_buffer (MacOSXAudioData *audio_data, AudioQueueBufferRef audio_buffer) -{ int size, sample_count, read_count ; - short *buffer ; - - size = audio_buffer->mAudioDataBytesCapacity ; - sample_count = size / sizeof (short) ; - - buffer = (short*) audio_buffer->mAudioData ; - - read_count = sf_read_short (audio_data->sndfile, buffer, sample_count) ; - - if (read_count > 0) - { audio_buffer->mAudioDataByteSize = read_count * sizeof (short) ; - AudioQueueEnqueueBuffer (audio_data->queue, audio_buffer, 0, NULL) ; - } - else - AudioQueueStop (audio_data->queue, false) ; - -} /* macosx_fill_buffer */ - - -static void -macosx_audio_out_callback (void *user_data, AudioQueueRef audio_queue, AudioQueueBufferRef audio_buffer) -{ MacOSXAudioData *audio_data = (MacOSXAudioData *) user_data ; - - if (audio_data->queue == audio_queue) - macosx_fill_buffer (audio_data, audio_buffer) ; - -} /* macosx_audio_out_callback */ - - -static void -macosx_audio_out_property_callback (void *user_data, AudioQueueRef audio_queue, AudioQueuePropertyID prop) -{ MacOSXAudioData *audio_data = (MacOSXAudioData *) user_data ; - - if (prop == kAudioQueueProperty_IsRunning) - { UInt32 is_running = 0 ; - UInt32 is_running_size = sizeof (is_running) ; - - AudioQueueGetProperty (audio_queue, kAudioQueueProperty_IsRunning, &is_running, &is_running_size) ; - - if (!is_running) - { audio_data->done_playing = SF_TRUE ; - CFRunLoopStop (CFRunLoopGetCurrent ()) ; - } ; - } ; -} /* macosx_audio_out_property_callback */ - - - -static void -macosx_play (int argc, char *argv []) -{ MacOSXAudioData audio_data ; - OSStatus err ; - int i ; - int k ; - - memset (&audio_data, 0x55, sizeof (audio_data)) ; - - for (k = 1 ; k < argc ; k++) - { memset (&(audio_data.sfinfo), 0, sizeof (audio_data.sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (audio_data.sndfile = sf_open (argv [k], SFM_READ, &(audio_data.sfinfo)))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (audio_data.sfinfo.channels < 1 || audio_data.sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", audio_data.sfinfo.channels) ; - continue ; - } ; - - /* fill ASBD */ - audio_data.format.mSampleRate = audio_data.sfinfo.samplerate ; - audio_data.format.mChannelsPerFrame = audio_data.sfinfo.channels ; - audio_data.format.mFormatID = kAudioFormatLinearPCM ; - audio_data.format.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked ; - audio_data.format.mBytesPerPacket = audio_data.format.mChannelsPerFrame * 2 ; - audio_data.format.mFramesPerPacket = 1 ; - audio_data.format.mBytesPerFrame = audio_data.format.mBytesPerPacket ; - audio_data.format.mBitsPerChannel = 16 ; - audio_data.format.mReserved = 0 ; - - /* create the queue */ - if ((err = AudioQueueNewOutput (&(audio_data.format), macosx_audio_out_callback, &audio_data, - CFRunLoopGetCurrent (), kCFRunLoopCommonModes, 0, &(audio_data.queue))) != noErr) - { printf ("AudioQueueNewOutput failed\n") ; - return ; - } ; - - /* add property listener */ - if ((err = AudioQueueAddPropertyListener (audio_data.queue, kAudioQueueProperty_IsRunning, macosx_audio_out_property_callback, &audio_data)) != noErr) - { printf ("AudioQueueAddPropertyListener failed\n") ; - return ; - } ; - - /* create the buffers */ - for (i = 0 ; i < kNumberOfAudioBuffers ; i++) - { if ((err = AudioQueueAllocateBuffer (audio_data.queue, kBytesPerAudioBuffer, &audio_data.queueBuffer [i])) != noErr) - { printf ("AudioQueueAllocateBuffer failed\n") ; - return ; - } ; - - macosx_fill_buffer (&audio_data, audio_data.queueBuffer [i]) ; - } ; - - audio_data.done_playing = SF_FALSE ; - - /* start queue */ - if ((err = AudioQueueStart (audio_data.queue, NULL)) != noErr) - { printf ("AudioQueueStart failed\n") ; - return ; - } ; - - while (audio_data.done_playing == SF_FALSE) - CFRunLoopRun () ; - - /* free the buffers */ - for (i = 0 ; i < kNumberOfAudioBuffers ; i++) - { if ((err = AudioQueueFreeBuffer (audio_data.queue, audio_data.queueBuffer [i])) != noErr) - { printf ("AudioQueueFreeBuffer failed\n") ; - return ; - } ; - } ; - - /* free the queue */ - if ((err = AudioQueueDispose (audio_data.queue, true)) != noErr) - { printf ("AudioQueueDispose failed\n") ; - return ; - } ; - - sf_close (audio_data.sndfile) ; - } ; - - return ; -} /* macosx_play, AudioQueue implementation */ - -#endif /* OSX_DARWIN_VERSION == 11 */ - -#if (OSX_DARWIN_VERSION > 0 && OSX_DARWIN_VERSION <= 10) -/* MacOSX 10.6 or earlier, use Carbon and AudioHardware API */ - -typedef struct -{ AudioStreamBasicDescription format ; - - UInt32 buf_size ; - AudioDeviceID device ; - - SNDFILE *sndfile ; - SF_INFO sfinfo ; - - int fake_stereo ; - int done_playing ; -} MacOSXAudioData ; - -#include - -static OSStatus -macosx_audio_out_callback (AudioDeviceID device, const AudioTimeStamp* current_time, - const AudioBufferList* data_in, const AudioTimeStamp* time_in, - AudioBufferList* data_out, const AudioTimeStamp* time_out, - void* client_data) -{ MacOSXAudioData *audio_data ; - int size, sample_count, read_count, k ; - float *buffer ; - - /* Prevent compiler warnings. */ - device = device ; - current_time = current_time ; - data_in = data_in ; - time_in = time_in ; - time_out = time_out ; - - audio_data = (MacOSXAudioData*) client_data ; - - size = data_out->mBuffers [0].mDataByteSize ; - sample_count = size / sizeof (float) ; - - buffer = (float*) data_out->mBuffers [0].mData ; - - if (audio_data->fake_stereo != 0) - { read_count = sf_read_float (audio_data->sndfile, buffer, sample_count / 2) ; - - for (k = read_count - 1 ; k >= 0 ; k--) - { buffer [2 * k ] = buffer [k] ; - buffer [2 * k + 1] = buffer [k] ; - } ; - read_count *= 2 ; - } - else - read_count = sf_read_float (audio_data->sndfile, buffer, sample_count) ; - - /* Fill the remainder with zeroes. */ - if (read_count < sample_count) - { if (audio_data->fake_stereo == 0) - memset (&(buffer [read_count]), 0, (sample_count - read_count) * sizeof (float)) ; - /* Tell the main application to terminate. */ - audio_data->done_playing = SF_TRUE ; - } ; - - return noErr ; -} /* macosx_audio_out_callback */ - -static void -macosx_play (int argc, char *argv []) -{ MacOSXAudioData audio_data ; - OSStatus err ; - UInt32 count, buffer_size ; - int k ; - - audio_data.fake_stereo = 0 ; - audio_data.device = kAudioDeviceUnknown ; - - /* get the default output device for the HAL */ - count = sizeof (AudioDeviceID) ; - if ((err = AudioHardwareGetProperty (kAudioHardwarePropertyDefaultOutputDevice, - &count, (void *) &(audio_data.device))) != noErr) - { printf ("AudioHardwareGetProperty (kAudioDevicePropertyDefaultOutputDevice) failed.\n") ; - return ; - } ; - - /* get the buffersize that the default device uses for IO */ - count = sizeof (UInt32) ; - if ((err = AudioDeviceGetProperty (audio_data.device, 0, false, kAudioDevicePropertyBufferSize, - &count, &buffer_size)) != noErr) - { printf ("AudioDeviceGetProperty (kAudioDevicePropertyBufferSize) failed.\n") ; - return ; - } ; - - /* get a description of the data format used by the default device */ - count = sizeof (AudioStreamBasicDescription) ; - if ((err = AudioDeviceGetProperty (audio_data.device, 0, false, kAudioDevicePropertyStreamFormat, - &count, &(audio_data.format))) != noErr) - { printf ("AudioDeviceGetProperty (kAudioDevicePropertyStreamFormat) failed.\n") ; - return ; - } ; - - /* Base setup completed. Now play files. */ - for (k = 1 ; k < argc ; k++) - { memset (&(audio_data.sfinfo), 0, sizeof (audio_data.sfinfo)) ; - - printf ("Playing %s\n", argv [k]) ; - if (! (audio_data.sndfile = sf_open (argv [k], SFM_READ, &(audio_data.sfinfo)))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (audio_data.sfinfo.channels < 1 || audio_data.sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", audio_data.sfinfo.channels) ; - continue ; - } ; - - audio_data.format.mSampleRate = audio_data.sfinfo.samplerate ; - - if (audio_data.sfinfo.channels == 1) - { audio_data.format.mChannelsPerFrame = 2 ; - audio_data.fake_stereo = 1 ; - } - else - audio_data.format.mChannelsPerFrame = audio_data.sfinfo.channels ; - - if ((err = AudioDeviceSetProperty (audio_data.device, NULL, 0, false, kAudioDevicePropertyStreamFormat, - sizeof (AudioStreamBasicDescription), &(audio_data.format))) != noErr) - { printf ("AudioDeviceSetProperty (kAudioDevicePropertyStreamFormat) failed.\n") ; - return ; - } ; - - /* we want linear pcm */ - if (audio_data.format.mFormatID != kAudioFormatLinearPCM) - return ; - - /* Fire off the device. */ - if ((err = AudioDeviceAddIOProc (audio_data.device, macosx_audio_out_callback, - (void *) &audio_data)) != noErr) - { printf ("AudioDeviceAddIOProc failed.\n") ; - return ; - } ; - - err = AudioDeviceStart (audio_data.device, macosx_audio_out_callback) ; - if (err != noErr) - return ; - - audio_data.done_playing = SF_FALSE ; - - while (audio_data.done_playing == SF_FALSE) - usleep (10 * 1000) ; /* 10 000 milliseconds. */ - - if ((err = AudioDeviceStop (audio_data.device, macosx_audio_out_callback)) != noErr) - { printf ("AudioDeviceStop failed.\n") ; - return ; - } ; - - err = AudioDeviceRemoveIOProc (audio_data.device, macosx_audio_out_callback) ; - if (err != noErr) - { printf ("AudioDeviceRemoveIOProc failed.\n") ; - return ; - } ; - - sf_close (audio_data.sndfile) ; - } ; - - return ; -} /* macosx_play, AudioHardware implementation */ - -#endif /* OSX_DARWIN_VERSION > 0 && OSX_DARWIN_VERSION <= 10 */ - -/*------------------------------------------------------------------------------ -** Win32 functions for playing a sound. -** -** This API sucks. Its needlessly complicated and is *WAY* too loose with -** passing pointers arounf in integers and and using char* pointers to -** point to data instead of short*. It plain sucks! -*/ - -#if (OS_IS_WIN32 == 1) - -#define WIN32_BUFFER_LEN (1 << 15) - -typedef struct -{ HWAVEOUT hwave ; - WAVEHDR whdr [2] ; - - CRITICAL_SECTION mutex ; /* to control access to BuffersInUSe */ - HANDLE Event ; /* signal that a buffer is free */ - - short buffer [WIN32_BUFFER_LEN / sizeof (short)] ; - int current, bufferlen ; - int BuffersInUse ; - - SNDFILE *sndfile ; - SF_INFO sfinfo ; - - sf_count_t remaining ; -} Win32_Audio_Data ; - - -static void -win32_play_data (Win32_Audio_Data *audio_data) -{ int thisread, readcount ; - - /* fill a buffer if there is more data and we can read it sucessfully */ - readcount = (audio_data->remaining > audio_data->bufferlen) ? audio_data->bufferlen : (int) audio_data->remaining ; - - thisread = (int) sf_read_short (audio_data->sndfile, (short *) (audio_data->whdr [audio_data->current].lpData), readcount) ; - - audio_data->remaining -= thisread ; - - if (thisread > 0) - { /* Fix buffer length if this is only a partial block. */ - if (thisread < audio_data->bufferlen) - audio_data->whdr [audio_data->current].dwBufferLength = thisread * sizeof (short) ; - - /* Queue the WAVEHDR */ - waveOutWrite (audio_data->hwave, (LPWAVEHDR) &(audio_data->whdr [audio_data->current]), sizeof (WAVEHDR)) ; - - /* count another buffer in use */ - EnterCriticalSection (&audio_data->mutex) ; - audio_data->BuffersInUse ++ ; - LeaveCriticalSection (&audio_data->mutex) ; - - /* use the other buffer next time */ - audio_data->current = (audio_data->current + 1) % 2 ; - } ; - - return ; -} /* win32_play_data */ - -static void CALLBACK -win32_audio_out_callback (HWAVEOUT hwave, UINT msg, DWORD_PTR data, DWORD param1, DWORD param2) -{ Win32_Audio_Data *audio_data ; - - /* Prevent compiler warnings. */ - (void) hwave ; - (void) param1 ; - (void) param2 ; - - if (data == 0) - return ; - - /* - ** I consider this technique of passing a pointer via an integer as - ** fundamentally broken but thats the way microsoft has defined the - ** interface. - */ - audio_data = (Win32_Audio_Data*) data ; - - /* let main loop know a buffer is free */ - if (msg == MM_WOM_DONE) - { EnterCriticalSection (&audio_data->mutex) ; - audio_data->BuffersInUse -- ; - LeaveCriticalSection (&audio_data->mutex) ; - SetEvent (audio_data->Event) ; - } ; - - return ; -} /* win32_audio_out_callback */ - -static void -win32_play (int argc, char *argv []) -{ Win32_Audio_Data audio_data ; - - WAVEFORMATEX wf ; - int k, error ; - - audio_data.sndfile = NULL ; - audio_data.hwave = 0 ; - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - - if (! (audio_data.sndfile = sf_open (argv [k], SFM_READ, &(audio_data.sfinfo)))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - audio_data.remaining = audio_data.sfinfo.frames * audio_data.sfinfo.channels ; - audio_data.current = 0 ; - - InitializeCriticalSection (&audio_data.mutex) ; - audio_data.Event = CreateEvent (0, FALSE, FALSE, 0) ; - - wf.nChannels = audio_data.sfinfo.channels ; - wf.wFormatTag = WAVE_FORMAT_PCM ; - wf.cbSize = 0 ; - wf.wBitsPerSample = 16 ; - - wf.nSamplesPerSec = audio_data.sfinfo.samplerate ; - - wf.nBlockAlign = audio_data.sfinfo.channels * sizeof (short) ; - - wf.nAvgBytesPerSec = wf.nBlockAlign * wf.nSamplesPerSec ; - - error = waveOutOpen (&(audio_data.hwave), WAVE_MAPPER, &wf, (DWORD_PTR) win32_audio_out_callback, - (DWORD_PTR) &audio_data, CALLBACK_FUNCTION) ; - if (error) - { puts ("waveOutOpen failed.") ; - audio_data.hwave = 0 ; - continue ; - } ; - - audio_data.whdr [0].lpData = (char*) audio_data.buffer ; - audio_data.whdr [1].lpData = ((char*) audio_data.buffer) + sizeof (audio_data.buffer) / 2 ; - - audio_data.whdr [0].dwBufferLength = sizeof (audio_data.buffer) / 2 ; - audio_data.whdr [1].dwBufferLength = sizeof (audio_data.buffer) / 2 ; - - audio_data.whdr [0].dwFlags = 0 ; - audio_data.whdr [1].dwFlags = 0 ; - - /* length of each audio buffer in samples */ - audio_data.bufferlen = sizeof (audio_data.buffer) / 2 / sizeof (short) ; - - /* Prepare the WAVEHDRs */ - if ((error = waveOutPrepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)))) - { printf ("waveOutPrepareHeader [0] failed : %08X\n", error) ; - waveOutClose (audio_data.hwave) ; - continue ; - } ; - - if ((error = waveOutPrepareHeader (audio_data.hwave, &(audio_data.whdr [1]), sizeof (WAVEHDR)))) - { printf ("waveOutPrepareHeader [1] failed : %08X\n", error) ; - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)) ; - waveOutClose (audio_data.hwave) ; - continue ; - } ; - - /* Fill up both buffers with audio data */ - audio_data.BuffersInUse = 0 ; - win32_play_data (&audio_data) ; - win32_play_data (&audio_data) ; - - /* loop until both buffers are released */ - while (audio_data.BuffersInUse > 0) - { - /* wait for buffer to be released */ - WaitForSingleObject (audio_data.Event, INFINITE) ; - - /* refill the buffer if there is more data to play */ - win32_play_data (&audio_data) ; - } ; - - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [0]), sizeof (WAVEHDR)) ; - waveOutUnprepareHeader (audio_data.hwave, &(audio_data.whdr [1]), sizeof (WAVEHDR)) ; - - waveOutClose (audio_data.hwave) ; - audio_data.hwave = 0 ; - - DeleteCriticalSection (&audio_data.mutex) ; - - sf_close (audio_data.sndfile) ; - } ; - -} /* win32_play */ - -#endif /* Win32 */ - -/*------------------------------------------------------------------------------ -** OpenBDS's sndio. -*/ - -#if defined (HAVE_SNDIO_H) - -static void -sndio_play (int argc, char *argv []) -{ struct sio_hdl *hdl ; - struct sio_par par ; - short buffer [BUFFER_LEN] ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - int k, readcount ; - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - if ((hdl = sio_open (NULL, SIO_PLAY, 0)) == NULL) - { fprintf (stderr, "open sndio device failed") ; - return ; - } ; - - sio_initpar (&par) ; - par.rate = sfinfo.samplerate ; - par.pchan = sfinfo.channels ; - par.bits = 16 ; - par.sig = 1 ; - par.le = SIO_LE_NATIVE ; - - if (! sio_setpar (hdl, &par) || ! sio_getpar (hdl, &par)) - { fprintf (stderr, "set sndio params failed") ; - return ; - } ; - - if (! sio_start (hdl)) - { fprintf (stderr, "sndio start failed") ; - return ; - } ; - - while ((readcount = sf_read_short (sndfile, buffer, BUFFER_LEN))) - sio_write (hdl, buffer, readcount * sizeof (short)) ; - - sio_close (hdl) ; - } ; - - return ; -} /* sndio_play */ - -#endif /* sndio */ - -/*------------------------------------------------------------------------------ -** Solaris. -*/ - -#if (defined (sun) && defined (unix)) /* ie Solaris */ - -static void -solaris_play (int argc, char *argv []) -{ static short buffer [BUFFER_LEN] ; - audio_info_t audio_info ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - unsigned long delay_time ; - long k, start_count, output_count, write_count, read_count ; - int audio_fd, error, done ; - - for (k = 1 ; k < argc ; k++) - { printf ("Playing %s\n", argv [k]) ; - if (! (sndfile = sf_open (argv [k], SFM_READ, &sfinfo))) - { puts (sf_strerror (NULL)) ; - continue ; - } ; - - if (sfinfo.channels < 1 || sfinfo.channels > 2) - { printf ("Error : channels = %d.\n", sfinfo.channels) ; - continue ; - } ; - - /* open the audio device - write only, non-blocking */ - if ((audio_fd = open ("/dev/audio", O_WRONLY | O_NONBLOCK)) < 0) - { perror ("open (/dev/audio) failed") ; - return ; - } ; - - /* Retrive standard values. */ - AUDIO_INITINFO (&audio_info) ; - - audio_info.play.sample_rate = sfinfo.samplerate ; - audio_info.play.channels = sfinfo.channels ; - audio_info.play.precision = 16 ; - audio_info.play.encoding = AUDIO_ENCODING_LINEAR ; - audio_info.play.gain = AUDIO_MAX_GAIN ; - audio_info.play.balance = AUDIO_MID_BALANCE ; - - if ((error = ioctl (audio_fd, AUDIO_SETINFO, &audio_info))) - { perror ("ioctl (AUDIO_SETINFO) failed") ; - return ; - } ; - - /* Delay time equal to 1/4 of a buffer in microseconds. */ - delay_time = (BUFFER_LEN * 1000000) / (audio_info.play.sample_rate * 4) ; - - done = 0 ; - while (! done) - { read_count = sf_read_short (sndfile, buffer, BUFFER_LEN) ; - if (read_count < BUFFER_LEN) - { memset (&(buffer [read_count]), 0, (BUFFER_LEN - read_count) * sizeof (short)) ; - /* Tell the main application to terminate. */ - done = SF_TRUE ; - } ; - - start_count = 0 ; - output_count = BUFFER_LEN * sizeof (short) ; - - while (output_count > 0) - { /* write as much data as possible */ - write_count = write (audio_fd, &(buffer [start_count]), output_count) ; - if (write_count > 0) - { output_count -= write_count ; - start_count += write_count ; - } - else - { /* Give the audio output time to catch up. */ - usleep (delay_time) ; - } ; - } ; /* while (outpur_count > 0) */ - } ; /* while (! done) */ - - close (audio_fd) ; - } ; - - return ; -} /* solaris_play */ - -#endif /* Solaris */ - -/*============================================================================== -** Main function. -*/ - -int -main (int argc, char *argv []) -{ - if (argc < 2) - { - printf ("\nUsage : %s \n\n", program_name (argv [0])) ; - printf (" Using %s.\n\n", sf_version_string ()) ; -#if (OS_IS_WIN32 == 1) - printf ("This is a Unix style command line application which\n" - "should be run in a MSDOS box or Command Shell window.\n\n") ; - printf ("Sleeping for 5 seconds before exiting.\n\n") ; - - Sleep (5 * 1000) ; -#endif - return 1 ; - } ; - -#if defined (__ANDROID__) - puts ("*** Playing sound not yet supported on Android.") ; - puts ("*** Please feel free to submit a patch.") ; - return 1 ; -#elif defined (__linux__) - #if HAVE_ALSA_ASOUNDLIB_H - if (access ("/proc/asound/cards", R_OK) == 0) - alsa_play (argc, argv) ; - else - #endif - opensoundsys_play (argc, argv) ; -#elif defined (__FreeBSD_kernel__) || defined (__FreeBSD__) - opensoundsys_play (argc, argv) ; -#elif (defined (__MACH__) && defined (__APPLE__) && OSX_DARWIN_VERSION <= 11) - macosx_play (argc, argv) ; -#elif defined HAVE_SNDIO_H - sndio_play (argc, argv) ; -#elif (defined (sun) && defined (unix)) - solaris_play (argc, argv) ; -#elif (OS_IS_WIN32 == 1) - win32_play (argc, argv) ; -#elif (defined (__MACH__) && defined (__APPLE__) && OSX_DARWIN_VERSION > 11) - printf ("OS X 10.8 and later have a new Audio API.\n") ; - printf ("Someone needs to write code to use that API.\n") ; - return 1 ; -#elif defined (__BEOS__) - printf ("This program cannot be compiled on BeOS.\n") ; - printf ("Instead, compile the file sfplay_beos.cpp.\n") ; - return 1 ; -#else - puts ("*** Playing sound not yet supported on this platform.") ; - puts ("*** Please feel free to submit a patch.") ; - return 1 ; -#endif - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/programs/sndfile-salvage.c b/libs/libsndfile/programs/sndfile-salvage.c deleted file mode 100644 index db55e60edd..0000000000 --- a/libs/libsndfile/programs/sndfile-salvage.c +++ /dev/null @@ -1,277 +0,0 @@ -/* -** Copyright (C) 2010-2012 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "common.h" - -#define BUFFER_LEN (1 << 16) - -#define NOT(x) (! (x)) - - -static void usage_exit (const char *progname) ; -static void salvage_file (const char * broken_wav, const char * fixed_w64) ; - -int -main (int argc, char *argv []) -{ - if (argc != 3) - usage_exit (program_name (argv [0])) ; - - salvage_file (argv [1], argv [2]) ; - - return 0 ; -} /* main */ - -/*============================================================================== -*/ - -static void lseek_or_die (int fd, off_t offset, int whence) ; -static sf_count_t get_file_length (int fd, const char * name) ; -static sf_count_t find_data_offset (int fd, int format) ; -static void copy_data (int fd, SNDFILE * sndfile, int readsize) ; - - -static void -usage_exit (const char *progname) -{ printf ("Usage :\n\n %s \n\n", progname) ; - puts ("Salvages the audio data from WAV files which are more than 4G in length.\n") ; - printf ("Using %s.\n\n", sf_version_string ()) ; - exit (0) ; -} /* usage_exit */ - -static void -salvage_file (const char * broken_wav, const char * fixed_w64) -{ SNDFILE * sndfile ; - SF_INFO sfinfo ; - sf_count_t broken_len, data_offset ; - int fd, read_size ; - - if (strcmp (broken_wav, fixed_w64) == 0) - { printf ("Error : Input and output files must be different.\n\n") ; - exit (1) ; - } ; - - if ((fd = open (broken_wav, O_RDONLY)) < 0) - { printf ("Error : Not able to open file '%s' : %s\n", broken_wav, strerror (errno)) ; - exit (1) ; - } ; - - broken_len = get_file_length (fd, broken_wav) ; - if (broken_len <= 0xffffffff) - printf ("File is not greater than 4Gig but salvaging anyway.\n") ; - - /* Grab the format info from the broken file. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - if ((sndfile = sf_open (broken_wav, SFM_READ, &sfinfo)) == NULL) - { printf ("sf_open ('%s') failed : %s\n", broken_wav, sf_strerror (NULL)) ; - exit (1) ; - } ; - sf_close (sndfile) ; - - data_offset = find_data_offset (fd, sfinfo.format & SF_FORMAT_TYPEMASK) ; - - printf ("Offset to audio data : %" PRId64 "\n", data_offset) ; - - switch (sfinfo.format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_WAV : - case SF_FORMAT_WAVEX : - sfinfo.format = SF_FORMAT_W64 | (sfinfo.format & SF_FORMAT_SUBMASK) ; - break ; - - default : - printf ("Don't currently support this file type.\n") ; - exit (1) ; - } ; - - switch (sfinfo.format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_S8 : - read_size = 1 ; - break ; - - case SF_FORMAT_PCM_16 : - read_size = 2 ; - break ; - - case SF_FORMAT_PCM_24 : - read_size = 3 ; - break ; - - case SF_FORMAT_PCM_32 : - case SF_FORMAT_FLOAT : - read_size = 4 ; - break ; - - case SF_FORMAT_DOUBLE : - read_size = 8 ; - break ; - - default : - printf ("Sorry, don't currently support this file encoding type.\n") ; - exit (1) ; - } ; - - read_size *= sfinfo.channels ; - - if ((sndfile = sf_open (fixed_w64, SFM_WRITE, &sfinfo)) == NULL) - { printf ("sf_open ('%s') failed : %s\n", broken_wav, sf_strerror (NULL)) ; - exit (1) ; - } ; - - lseek_or_die (fd, data_offset, SEEK_SET) ; - - copy_data (fd, sndfile, read_size) ; - - sf_close (sndfile) ; - - puts ("Done!") ; -} /* salvage_file */ - -/*------------------------------------------------------------------------------ -*/ - -static void -lseek_or_die (int fd, off_t offset, int whence) -{ - if (lseek (fd, offset, whence) < 0) - { printf ("lseek failed : %s\n", strerror (errno)) ; - exit (1) ; - } ; - - return ; -} /* lseek_or_die */ - - -static sf_count_t -get_file_length (int fd, const char * name) -{ struct stat sbuf ; - - if (sizeof (sbuf.st_size) != 8) - { puts ("Error : sizeof (sbuf.st_size) != 8. Was program compiled with\n" - " 64 bit file offsets?\n") ; - exit (1) ; - } ; - - if (fstat (fd, &sbuf) != 0) - { printf ("Error : fstat ('%s') failed : %s\n", name, strerror (errno)) ; - exit (1) ; - } ; - - return sbuf.st_size ; -} /* get_file_length */ - -static sf_count_t -find_data_offset (int fd, int format) -{ char buffer [8192], *cptr ; - const char * target = "XXXX" ; - sf_count_t offset = -1, extra ; - int rlen, slen ; - - switch (format) - { case SF_FORMAT_WAV : - case SF_FORMAT_WAVEX : - target = "data" ; - extra = 8 ; - break ; - - case SF_FORMAT_AIFF : - target = "SSND" ; - extra = 16 ; - break ; - - default : - puts ("Error : Sorry, don't handle this input file format.\n") ; - exit (1) ; - } ; - - slen = strlen (target) ; - - lseek_or_die (fd, 0, SEEK_SET) ; - - printf ("Searching for '%s' maker.\n", target) ; - - if ((rlen = read (fd, buffer, sizeof (buffer))) < 0) - { printf ("Error : failed read : %s\n", strerror (errno)) ; - exit (1) ; - } ; - - cptr = memchr (buffer, target [0], rlen - slen) ; - if (cptr && memcmp (cptr, target, slen) == 0) - offset = cptr - buffer ; - else - { printf ("Error : Could not find data offset.\n") ; - exit (1) ; - } ; - - return offset + extra ; -} /* find_data_offset */ - -static void -copy_data (int fd, SNDFILE * sndfile, int readsize) -{ static char * buffer ; - sf_count_t readlen, count ; - int bufferlen, done = 0 ; - - bufferlen = readsize * 1024 ; - buffer = malloc (bufferlen) ; - - while (NOT (done) && (readlen = read (fd, buffer, bufferlen)) >= 0) - { if (readlen < bufferlen) - { readlen -= readlen % readsize ; - done = 1 ; - } ; - - if ((count = sf_write_raw (sndfile, buffer, readlen)) != readlen) - { printf ("Error : sf_write_raw returned %" PRId64 " : %s\n", count, sf_strerror (sndfile)) ; - return ; - } ; - } ; - - free (buffer) ; - - return ; -} /* copy_data */ - diff --git a/libs/libsndfile/programs/test-sndfile-metadata-set.py b/libs/libsndfile/programs/test-sndfile-metadata-set.py deleted file mode 100644 index a21a36b3d1..0000000000 --- a/libs/libsndfile/programs/test-sndfile-metadata-set.py +++ /dev/null @@ -1,188 +0,0 @@ -#!/usr/bin/python - -# Copyright (C) 2008-2011 Erik de Castro Lopo -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the author nor the names of any contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Simple test script for the sndfile-metadata-set program. - -import commands, os, sys -import time, datetime - -def print_test_name (name): - print " %-30s :" % name, - -def assert_info (filename, arg, value): - cmd = "./sndfile-metadata-get %s %s" % (arg, filename) - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - if output.find (value) < 0: - print "\n\nError : not able to find '%s'." % value - print output - sys.exit (1) - return - - -def check_executable (name): - if not (os.path.isfile (name)): - print "\n\nError : Can't find executable '%s'. Have you run make?" % name - sys.exit (1) - -def test_empty_fail (): - print_test_name ("Empty fail test") - cmd = "./sndfile-metadata-set --bext-description Alpha sine.wav" - status, output = commands.getstatusoutput (cmd) - if not status: - print "\n\nError : command '%s' should have failed." % cmd - sys.exit (1) - print "ok" - -def test_copy (): - print_test_name ("Copy test") - cmd = "./sndfile-metadata-set --bext-description \"First Try\" sine.wav output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - assert_info ("output.wav", "--bext-description", "First Try") - print "ok" - -def test_update (tests): - print_test_name ("Update test") - for arg, value in tests: - cmd = "./sndfile-metadata-set %s \"%s\" output.wav" % (arg, value) - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - assert_info ("output.wav", arg, value) - print "ok" - -def test_post_mod (tests): - print_test_name ("Post mod test") - for arg, value in tests: - assert_info ("output.wav", arg, value) - print "ok" - -def test_auto_date (): - print_test_name ("Auto date test") - cmd = "./sndfile-metadata-set --bext-auto-time-date sine.wav date-time.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - target = datetime.date.today ().__str__ () - assert_info ("date-time.wav", "--bext-orig-date", target) - print "ok" - - -#------------------------------------------------------------------------------- - -def test_coding_history (): - print_test_name ("Coding history test") - cmd = "./sndfile-metadata-set --bext-coding-hist \"alpha beta\" output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - cmd = "./sndfile-metadata-get --bext-coding-hist output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - print "ok" - -#------------------------------------------------------------------------------- - -def test_rewrite (): - print_test_name ("Rewrite test") - cmd = "./sndfile-metadata-set --bext-originator \"Really, really long string\" output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - cmd = "./sndfile-metadata-set --bext-originator \"Short\" output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - cmd = "./sndfile-metadata-get --bext-originator output.wav" - status, output = commands.getstatusoutput (cmd) - if status: - print "\n\nError : command '%s' should not have failed." % cmd - sys.exit (1) - if output.find ("really long") > 0: - print "\n\nError : output '%s' should not contain 'really long'." % output - sys.exit (1) - print "ok" - -#=============================================================================== - -test_dir = "programs" - -if os.path.isdir (test_dir): - os.chdir (test_dir) - -for f in [ "sndfile-metadata-set", "sndfile-metadata-get", "../examples/make_sine" ]: - check_executable (f) - -os.system ("../examples/make_sine") -if not os.path.isfile ("sine.wav"): - print "\n\nError : Can't file file 'sine.wav'." - sys.exit (1) - -print "" - -test_empty_fail () -test_copy () - -tests = [ - ("--bext-description", "Alpha"), ("--bext-originator", "Beta"), ("--bext-orig-ref", "Charlie"), - ("--bext-umid", "Delta"), ("--bext-orig-date", "2001-10-01"), ("--bext-orig-time", "01:02:03"), - ("--str-title", "Echo"), ("--str-artist", "Fox trot") - ] - -test_auto_date () -test_update (tests) -test_post_mod (tests) - -test_update ([ ("--str-artist", "Fox") ]) - -# This never worked. -# test_coding_history () - -test_rewrite () - - -print "" - -sys.exit (0) - diff --git a/libs/libsndfile/reconfigure.mk b/libs/libsndfile/reconfigure.mk deleted file mode 100644 index 5ec5943ea8..0000000000 --- a/libs/libsndfile/reconfigure.mk +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/make -f - -# The auto tools MUST be run in the following order: -# -# 1. aclocal -# 2. libtoolize (if you use libtool) -# 3. autoconf -# 4. autoheader (if you use autoheader) -# 5. automake (if you use automake) -# -# The following makefile runs these in the correct order according to their -# dependancies. It also makes up for Mac OSX's fucked-upped-ness. - -ACLOCAL = aclocal - -ifneq ($(shell uname -s), Darwin) - LIBTOOLIZE = libtoolize -else - # Fuck Apple! Why the hell did they rename libtoolize???? - LIBTOOLIZE = glibtoolize - # Fink sucks as well, but this seems necessary. - ACLOCAL_INC = -I /sw/share/aclocal -endif - -genfiles : config.status - (cd src && make genfiles) - (cd tests && make genfiles) - -config.status: configure src/config.h.in Makefile.in src/Makefile.in tests/Makefile.in - ./configure --enable-gcc-werror - -configure: ltmain.sh - autoconf - -Makefile.in: Makefile.am - automake --copy --add-missing - -src/Makefile.in: src/Makefile.am - automake --copy --add-missing - -tests/Makefile.in: tests/Makefile.am - automake --copy --add-missing - -src/config.h.in: configure - autoheader - -libtool ltmain.sh: aclocal.m4 - $(LIBTOOLIZE) --copy --force - -# Need to re-run aclocal whenever acinclude.m4 is modified. -aclocal.m4: acinclude.m4 - $(ACLOCAL) $(ACLOCAL_INC) - -clean: - rm -f libtool ltmain.sh aclocal.m4 Makefile.in src/config.h.in config.cache config.status - find . -name .deps -type d -exec rm -rf {} \; - - -# Do not edit or modify anything in this comment block. -# The arch-tag line is a file identity tag for the GNU Arch -# revision control system. -# -# arch-tag: 2b02bfd0-d5ed-489b-a554-2bf36903cca9 diff --git a/libs/libsndfile/regtest/Makefile.am b/libs/libsndfile/regtest/Makefile.am deleted file mode 100644 index a87d0c4f83..0000000000 --- a/libs/libsndfile/regtest/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -## Process this file with automake to produce Makefile.in - -bin_PROGRAMS = sndfile-regtest - -noinst_HEADERS = regtest.h - -AM_CPPFLAGS = -I$(top_srcdir)/src $(SQLITE3_CFLAGS) $(OS_SPECIFIC_CFLAGS) - -sndfile_regtest_SOURCES = sndfile-regtest.c database.c checksum.c -sndfile_regtest_LDADD = $(top_builddir)/src/libsndfile.la $(SQLITE3_LIBS) - -CLEANFILES = *~ *.exe diff --git a/libs/libsndfile/regtest/Readme.txt b/libs/libsndfile/regtest/Readme.txt deleted file mode 100644 index bc038d6429..0000000000 --- a/libs/libsndfile/regtest/Readme.txt +++ /dev/null @@ -1,108 +0,0 @@ -sndfile-regtest -=============== - -The 'sndfile-regtest' program is a regression test-suite for libsndile. - -This program is intended to allow anyone who has an interest in the -reliability and correctness of libsndfile to do their own regression -testing. From the point of view of the libsndfile developers, this -program now allows for distributed regression testing of libsndfile -which will make libsndfile better. - - -How Does it Work ----------------- -Anyone who wishes to take part in the distributed regression testing of -libsndfile can download the regression test program and install it. - -Once installed the user can start collecting files and adding them to -their own personal database. Then, as new versions of libsndfile come -out, the user should test the new library version against their database -of files (instructions below). - -Any files which were successfully added to the database in the past but -now fail the check with the new library version represent a regression. -The user should then contact the libsndfile developers so that a copy -of the test file can be made available to the developers. - - -Requirements ------------- -The regression test program uses sqlite3 as the database engine. On -Debian, the required packages are : - - sqlite3 - libsqlite3-0 - libsqlite3-dev - -but similar packages should be available on any other Linux style -system. - -The regression test currently only compiles under Unix-like systems. -At some time in the future the regression test will distributed along -with the libsndfile source code distribution. - - -Organization of Files ---------------------- -The regession test program keeps its database file in the directory it -is run from. In addition, the database only contains information about -the files, not the files themselves. - -This means that database file should probably be kept in the same -directory (or a directory above) the test files. - - -Setting it Up for the First Time --------------------------------- -The sndfile-regtest program should be on your PATH. You can then cd into -the directory where you intend to keep you test files and -run the command: - - sndfile-regtest --create-db - -which creates a file named '.sndfile-regtest.db' in the current directory. - -Files can then be added to the database using the command: - - sndfile-regtest --add-file file1.wav - -The --add-file option allows more than one file to be added at a time -using: - - sndfile-regtest --add-file file1.wav file2.aif ..... - - -Checking Files --------------- -One or more files that have already been added to the database can be -checked using: - - sndfile-regtest --check-file file1.wav file2.aif ..... - -It is also possible to check all files in the database using: - - sndfile-regtest --check-all - - -Running a Regression Test -------------------------- -Once you have a collection of files and a database it is possible to test -new versions of libsndfile before you install them. If for instance you -have just compiled a new version of libsndfile in the directory -/usr/src/libsndfile-X.Y.Z, then you can use an existing sndfile-regtest -binary with the new libsndfile using something like: - - LD_PRELOAD=/usr/src/libsndfile-X.Y.Z/src/.libs/libsndfile.so.X.Y.Z \ - sndfile-regtest --check-all - - -Reporting Regressions ---------------------- -Any user who finds a file which was added to the regression database with -an earlier version of libsndfile and then fails the check with a later -version of the library should contact the author (erikd at mega dash nerd -dot com). If possible place the file on a web server and email the author -a link to it. - - diff --git a/libs/libsndfile/regtest/checksum.c b/libs/libsndfile/regtest/checksum.c deleted file mode 100644 index 7f433a41c8..0000000000 --- a/libs/libsndfile/regtest/checksum.c +++ /dev/null @@ -1,117 +0,0 @@ -/* -** Copyright (C) 2005-2011 Erik de Castro Lopo -** -** 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. -*/ - -/* -** A simple checksum for short, int and float data. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include - -#include "regtest.h" - -#define BIG_PRIME 999983 - -#define ARRAY_LEN(x) ((int) (sizeof (x)) / (sizeof ((x) [0]))) - -static int short_checksum (SNDFILE * file, int start) ; -static int int_checksum (SNDFILE * file, int start) ; -static int float_checksum (SNDFILE * file, int start) ; - -int -calc_checksum (SNDFILE * file, const SF_INFO * info) -{ int start ; - - /* Seed the checksum with data from the SF_INFO struct. */ - start = info->samplerate ; - start = start * BIG_PRIME + info->channels ; - start = start * BIG_PRIME + info->format ; - - switch (info->format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - return float_checksum (file, start) ; - - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - return int_checksum (file, start) ; - - default : - return short_checksum (file, start) ; - } ; - - return 0 ; -} /* calc_checksum */ - -/*------------------------------------------------------------------------------ -*/ - -static union -{ short s [1 << 16] ; - int i [1 << 15] ; - float f [1 << 15] ; -} data ; - -static int -short_checksum (SNDFILE * file, int start) -{ int k, count ; - - do - { count = (int) sf_read_short (file, data.s, ARRAY_LEN (data.s)) ; - for (k = 0 ; k < count ; k++) - start = start * BIG_PRIME + data.s [k] ; - } - while (count > 0) ; - - return start ; -} /* short_checksum */ - -static int -int_checksum (SNDFILE * file, int start) -{ int k, count ; - - do - { count = (int) sf_read_int (file, data.i, ARRAY_LEN (data.i)) ; - for (k = 0 ; k < count ; k++) - start = start * BIG_PRIME + data.i [k] ; - } - while (count > 0) ; - - return start ; -} /* int_checksum */ - -static int -float_checksum (SNDFILE * file, int start) -{ int k, count ; - - do - { count = (int) sf_read_float (file, data.f, ARRAY_LEN (data.f)) ; - for (k = 0 ; k < count ; k++) - start = start * BIG_PRIME + lrintf (0x7FFFFFFF * data.f [k]) ; - } - while (count > 0) ; - - return start ; -} /* float_checksum */ - diff --git a/libs/libsndfile/regtest/database.c b/libs/libsndfile/regtest/database.c deleted file mode 100644 index f800a2c873..0000000000 --- a/libs/libsndfile/regtest/database.c +++ /dev/null @@ -1,495 +0,0 @@ -/* -** Copyright (C) 2005-2011 Erik de Castro Lopo -** -** 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. -*/ - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include - -#include "regtest.h" - -#if HAVE_SQLITE3 - -#include - -typedef struct -{ sqlite3 *sql ; - - int count ; - int ekey_max ; - - /* Filename and pathname for file. */ - char filename [256] ; - char pathname [512] ; - - /* Storage for createding SQL commands. Must be larger than logbuf below. */ - char cmdbuf [1 << 15] ; - - /* Storage for log buffer retrieved from SNDFILE* .*/ - char logbuf [1 << 14] ; - -} REGTEST_DB ; - -/* In checksum.c */ -int calc_checksum (SNDFILE * file, const SF_INFO * info) ; - -static void get_filename_pathname (REGTEST_DB * db, const char *filepath) ; -static void single_quote_replace (char * buf) ; - -static int get_ekey_from_filename (REGTEST_DB * db, const char *filepath) ; -static int get_filename_pathname_by_ekey (REGTEST_DB * db, int ekey) ; -static int check_file_by_ekey (REGTEST_DB * db, int ekey) ; - -static int count_callback (REGTEST_DB * db, int argc, char **argv, char **colname) ; -static int ekey_max_callback (REGTEST_DB * db, int argc, char **argv, char **colname) ; -static int callback (void *unused, int argc, char **argv, char **colname) ; - -REG_DB * -db_open (const char * db_name) -{ REGTEST_DB * db ; - int err ; - - if ((db = malloc (sizeof (REGTEST_DB))) == NULL) - { perror ("malloc") ; - exit (1) ; - } ; - - if ((err = sqlite3_open (db_name, &(db->sql))) != 0) - { printf ("Can't open database: %s\n", sqlite3_errmsg (db->sql)) ; - sqlite3_close (db->sql) ; - free (db) ; - exit (1) ; - } ; - - return (REG_DB *) db ; -} /* db_open */ - -int -db_create (const char * db_name) -{ REGTEST_DB * db ; - const char *cmd ; - char * errmsg = NULL ; - int err ; - - db = (REGTEST_DB *) db_open (db_name) ; - - cmd = "create table sndfile (ekey INTEGER PRIMARY KEY," - "fname VARCHAR(1)," - "fpath VARCHAR(1)," - "srate INTEGER," - "frames VARCHAR(1)," - "channels INTEGER," - "format VARCHAR(1)," - "checksum VARCHAR(1)," - "logbuf VARCHAR(1)" - ");" ; - - err = sqlite3_exec (db->sql, cmd, callback, 0, &errmsg) ; - if (err != SQLITE_OK) - printf ("Line %d : SQL error: %s\n", __LINE__, errmsg) ; - - sqlite3_close (db->sql) ; - free (db) ; - - return 0 ; -} /* db_create */ - -int -db_close (REG_DB * db_handle) -{ REGTEST_DB * db ; - - db = (REGTEST_DB *) db_handle ; - - sqlite3_close (db->sql) ; - free (db) ; - - return 0 ; -} /* db_close */ - -/*============================================================================== -*/ - -int -db_file_exists (REG_DB * db_handle, const char * filename) -{ REGTEST_DB * db ; - const char * cptr ; - char * errmsg ; - int err ; - - db = (REGTEST_DB *) db_handle ; - - if ((cptr = strrchr (filename, '/')) != NULL) - filename = cptr + 1 ; - - snprintf (db->cmdbuf, sizeof (db->cmdbuf), "select fname from sndfile where fname='%s'", filename) ; - - db->count = 0 ; - err = sqlite3_exec (db->sql, db->cmdbuf, (sqlite3_callback) count_callback, db, &errmsg) ; - if (err == 0 && db->count == 1) - return 1 ; - - return 0 ; -} /* db_file_exists */ - -int -db_add_file (REG_DB * db_handle, const char * filepath) -{ REGTEST_DB * db ; - SNDFILE * sndfile ; - SF_INFO info ; - char * errmsg ; - int err, checksum ; - - db = (REGTEST_DB *) db_handle ; - - get_filename_pathname (db, filepath) ; - - if (db_file_exists (db_handle, filepath)) - { printf (" %s : already in database\n", db->filename) ; - return 0 ; - } ; - - memset (&info, 0, sizeof (info)) ; - sndfile = sf_open (db->pathname, SFM_READ, &info) ; - sf_command (sndfile, SFC_GET_LOG_INFO, db->logbuf, sizeof (db->logbuf)) ; - checksum = (sndfile == NULL) ? 0 : calc_checksum (sndfile, &info) ; - sf_close (sndfile) ; - - if (sndfile == NULL) - { printf (" %s : could not open : %s\n", db->filename, sf_strerror (NULL)) ; - puts (db->logbuf) ; - return 1 ; - } ; - - single_quote_replace (db->logbuf) ; - - snprintf (db->cmdbuf, sizeof (db->cmdbuf), "insert into sndfile " - "(fname, fpath, srate, frames, channels, format, checksum, logbuf) values" - "('%s','%s',%d,'%ld', %d, '0x%08x', '0x%08x', '%s');", - db->filename, db->pathname, info.samplerate, (long) info.frames, info.channels, info.format, checksum, db->logbuf) ; - - if (strlen (db->cmdbuf) >= sizeof (db->cmdbuf) - 1) - { printf ("strlen (db->cmdbuf) too long.\n") ; - exit (1) ; - } ; - - err = sqlite3_exec (db->sql, db->cmdbuf, callback, 0, &errmsg) ; - if (err != SQLITE_OK) - { printf ("Line %d : SQL error: %s\n", __LINE__, errmsg) ; - puts (db->cmdbuf) ; - } ; - - return 0 ; -} /* db_add_file */ - -int -db_check_file (REG_DB * db_handle, const char * filepath) -{ REGTEST_DB * db ; - int ekey ; - - if (db_file_exists (db_handle, filepath) == 0) - { printf ("\nFile not in database.\n\n") ; - exit (0) ; - } ; - - db = (REGTEST_DB *) db_handle ; - - ekey = get_ekey_from_filename (db, filepath) ; - - return check_file_by_ekey (db, ekey) ; -} /* db_check_file */ - -/*============================================================================== -*/ - -int -db_check_all (REG_DB * db_handle) -{ REGTEST_DB * db ; - char * errmsg ; - int err, ekey ; - - db = (REGTEST_DB *) db_handle ; - - db->ekey_max = 0 ; - - snprintf (db->cmdbuf, sizeof (db->cmdbuf), "select ekey from sndfile") ; - - err = sqlite3_exec (db->sql, db->cmdbuf, (sqlite3_callback) ekey_max_callback, db, &errmsg) ; - if (err != SQLITE_OK) - { printf ("Line %d : SQL error: %s\n", __LINE__, errmsg) ; - puts (db->cmdbuf) ; - } ; - - for (ekey = 1 ; ekey <= db->ekey_max ; ekey++) - if (get_filename_pathname_by_ekey (db, ekey) != 0) - check_file_by_ekey (db, ekey) ; - - return 0 ; -} /* db_check_all */ - - -int -db_list_all (REG_DB * db_handle) -{ - printf ("%s : %p\n", __func__, db_handle) ; - return 0 ; -} /* db_list_all */ - -int -db_del_entry (REG_DB * db_handle, const char * entry) -{ - printf ("%s : %p %s\n", __func__, db_handle, entry) ; - return 0 ; -} /* db_del_entry */ - -/*============================================================================== -*/ - -static int -get_ekey_from_filename (REGTEST_DB * db, const char *filepath) -{ char * errmsg, **result ; - int err, ekey = 0, rows, cols ; - - get_filename_pathname (db, filepath) ; - - snprintf (db->cmdbuf, sizeof (db->cmdbuf), "select ekey from sndfile where fname='%s'", db->filename) ; - - err = sqlite3_get_table (db->sql, db->cmdbuf, &result, &rows, &cols, &errmsg) ; - if (err != SQLITE_OK) - { printf ("Line %d : SQL error: %s\n", __LINE__, errmsg) ; - puts (db->cmdbuf) ; - } ; - - if (cols != 1 || rows != 1) - { printf ("Bad juju!! rows = %d cols = %d\n", rows, cols) ; - exit (1) ; - } ; - - ekey = strtol (result [1], NULL, 10) ; - - sqlite3_free_table (result) ; - - return ekey ; -} /* get_ekey_from_filename */ - -static int -get_filename_pathname_by_ekey (REGTEST_DB * db, int ekey) -{ char *errmsg, **result ; - int err, rows, cols ; - - snprintf (db->cmdbuf, sizeof (db->cmdbuf), "select fname,fpath from sndfile where ekey='%d'", ekey) ; - - err = sqlite3_get_table (db->sql, db->cmdbuf, &result, &rows, &cols, &errmsg) ; - if (err != SQLITE_OK) - { printf ("Line %d : SQL error: %s\n", __LINE__, errmsg) ; - puts (db->cmdbuf) ; - return 0 ; - } ; - - if (cols != 2 || rows != 1) - { printf ("\nError (%s %d) : rows = %d cols = %d\n", __func__, __LINE__, rows, cols) ; - exit (1) ; - } ; - - snprintf (db->filename, sizeof (db->filename), "%s", result [2]) ; - snprintf (db->pathname, sizeof (db->pathname), "%s", result [3]) ; - - sqlite3_free_table (result) ; - - return 1 ; -} /* get_filename_pathname_by_ekey */ - -static int -check_file_by_ekey (REGTEST_DB * db, int ekey) -{ SNDFILE * sndfile ; - SF_INFO info ; - char * errmsg, **result ; - int err, k, rows, cols, checksum ; - - printf (" %s : ", db->filename) ; - fflush (stdout) ; - - memset (&info, 0, sizeof (info)) ; - sndfile = sf_open (db->pathname, SFM_READ, &info) ; - sf_command (sndfile, SFC_GET_LOG_INFO, db->logbuf, sizeof (db->logbuf)) ; - checksum = (sndfile == NULL) ? 0 : calc_checksum (sndfile, &info) ; - sf_close (sndfile) ; - - if (sndfile == NULL) - { printf ("\n\nError : Could not open '%s' : %s\n", db->pathname, sf_strerror (NULL)) ; - puts (db->logbuf) ; - exit (1) ; - } ; - - single_quote_replace (db->logbuf) ; - - snprintf (db->cmdbuf, sizeof (db->cmdbuf), "select fname,srate,frames,channels,format," - "checksum,logbuf from sndfile where ekey='%d'", ekey) ; - - err = sqlite3_get_table (db->sql, db->cmdbuf, &result, &rows, &cols, &errmsg) ; - if (err != SQLITE_OK) - { printf ("Line %d : SQL error: %s\n", __LINE__, errmsg) ; - puts (db->cmdbuf) ; - } ; - - for (k = 0 ; k < cols ; k++) - { if (strcmp (result [k], "fname") == 0) - { if (strcmp (result [k + cols], db->filename) == 0) - continue ; - printf ("\n\nError : fname doesn't match : %s != %s\n", result [k + cols], db->filename) ; - } ; - - if (strcmp (result [k], "srate") == 0) - { if (strtol (result [k + cols], NULL, 10) == info.samplerate) - continue ; - printf ("\n\nError : srate doesn't match : %s == %d\n", result [k + cols], info.samplerate) ; - } ; - - if (strcmp (result [k], "frames") == 0) - { if (strtoll (result [k + cols], NULL, 10) == info.frames) - continue ; - printf ("\n\nError : frames doesn't match : %s == %ld\n", result [k + cols], (long) info.frames) ; - } ; - - if (strcmp (result [k], "channels") == 0) - { if (strtol (result [k + cols], NULL, 10) == info.channels) - continue ; - printf ("\n\nError : channels doesn't match : %s == %d\n", result [k + cols], info.channels) ; - } ; - - if (strcmp (result [k], "format") == 0) - { if (strtol (result [k + cols], NULL, 16) == info.format) - continue ; - printf ("\n\nError : format doesn't match : %s == 0x%08x\n", result [k + cols], info.format) ; - } ; - - if (strcmp (result [k], "checksum") == 0) - { int db_val = (int) strtoll (result [k + cols], NULL, 16) ; - - if (db_val == checksum) - continue ; - printf ("\n\nError : checksum doesn't match : 0x%08x == 0x%08x\n", db_val, checksum) ; - } ; - - if (strcmp (result [k], "logbuf") == 0) - continue ; - - printf ("\nHere is the old logubuffer :\n\n%s\n\nand the new :\n\n%s\n\n", result [2 * cols - 1], db->logbuf) ; - exit (1) ; - } ; - - sqlite3_free_table (result) ; - - puts ("ok") ; - - return 0 ; -} /* check_file_by_ekey */ - -/*============================================================================== -*/ - -static void -get_filename_pathname (REGTEST_DB * db, const char *filepath) -{ const char * cptr ; - int slen ; - - if (filepath [0] != '/') - { memset (db->pathname, 0, sizeof (db->pathname)) ; - if (getcwd (db->pathname, sizeof (db->pathname)) == NULL) - { perror ("\ngetcwd failed") ; - exit (1) ; - } ; - - slen = strlen (db->pathname) ; - db->pathname [slen ++] = '/' ; - snprintf (db->pathname + slen, sizeof (db->pathname) - slen, "%s", filepath) ; - } - else - snprintf (db->pathname, sizeof (db->pathname), "%s", filepath) ; - - if ((cptr = strrchr (db->pathname, '/')) == NULL) - { printf ("\nError : bad pathname %s\n", filepath) ; - exit (1) ; - } ; - - snprintf (db->filename, sizeof (db->filename), "%s", cptr + 1) ; -} /* get filename_pathname */ - -static void -single_quote_replace (char * buf) -{ while ((buf = strchr (buf, '\'')) != 0) - buf [0] = '"' ; -} /* single_quote_replace */ - -static int -count_callback (REGTEST_DB * db, int argc, char **argv, char **colname) -{ db->count ++ ; - - (void) argc ; - (void) argv ; - (void) colname ; - return 0 ; -} /* count_callback */ - -static int -ekey_max_callback (REGTEST_DB * db, int argc, char **argv, char **unused) -{ int ekey ; - - (void) argc ; - (void) unused ; - - ekey = strtol (argv [0], NULL, 10) ; - if (ekey > db->ekey_max) - db->ekey_max = ekey ; - - return 0 ; -} /* ekey_max_callback */ - -static int -callback (void *unused, int argc, char **argv, char **colname) -{ int k ; - - (void) unused ; - - for (k = 0 ; k < argc ; k++) - printf ("%s = %s\n", colname [k], argv [k] ? argv [k] : "NULL") ; - - printf ("\n") ; - - return 0 ; -} /* callback */ - -#else - -int dummy (void) ; - -int -dummy (void) -{ /* - ** Empty dummy fnction so tha compiler doesn't winge about an - ** empty file. - */ - return 0 ; -} /* dummy */ - -#endif diff --git a/libs/libsndfile/regtest/regtest.h b/libs/libsndfile/regtest/regtest.h deleted file mode 100644 index 567d97be28..0000000000 --- a/libs/libsndfile/regtest/regtest.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -** Copyright (C) 2005-2011 Erik de Castro Lopo -** -** 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. -*/ - -typedef struct REG_DB_tag REG_DB ; - -/* In database.c */ -REG_DB * db_open (const char * db_name) ; - -int db_create (const char * dbname) ; - -int db_close (REG_DB * db_handle) ; - -int db_file_exists (REG_DB * db_handle, const char * filename) ; -int db_add_file (REG_DB * db_handle, const char * filename) ; -int db_check_file (REG_DB * db_handle, const char * filename) ; - -int db_list_all (REG_DB * db_handle) ; -int db_check_all (REG_DB * db_handle) ; -int db_del_entry (REG_DB * db_handle, const char * entry) ; - -/* In checksum.c */ -int calc_checksum (SNDFILE * file, const SF_INFO * info) ; - diff --git a/libs/libsndfile/regtest/sndfile-regtest.c b/libs/libsndfile/regtest/sndfile-regtest.c deleted file mode 100644 index a28caa2d84..0000000000 --- a/libs/libsndfile/regtest/sndfile-regtest.c +++ /dev/null @@ -1,121 +0,0 @@ -/* -** Copyright (C) 2005-2011 Erik de Castro Lopo -** -** 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. -*/ - -#include "config.h" - -#include -#include -#include - -#include - -#if HAVE_SQLITE3 - -#include "regtest.h" - -enum -{ OPT_ADD_FILE = 0x0100, - OPT_CREATE_DB = 0x0200, - OPT_DEL_ENTRY = 0x0400, - OPT_LIST_ALL = 0x0800, - OPT_TEST_ALL = 0x1000, - OPT_VERBOSE = 0x2000 -} ; - -static void print_libsndfile_version (void) ; - -int -main (int argc, char * argv []) -{ const char *db_name = "./.sndfile-regtest.db" ; - REG_DB *reg_db ; - int k, retval ; - - if (argc < 2) - { printf ("\nUsage message goes here.\n\n") ; - exit (0) ; - } ; - - if (argc == 2 && strcmp (argv [1], "--create-db") == 0) - return db_create (db_name) ; - - reg_db = db_open (db_name) ; - - if (argc == 2) - { if (strcmp (argv [1], "--list-all") == 0) - return db_list_all (reg_db) ; - - if (strcmp (argv [1], "--check-all") == 0) - { print_libsndfile_version () ; - retval = db_check_all (reg_db) ; - puts ("\nDone.\n") ; - return retval ; - } ; - } ; - - if (argc == 3 && strcmp (argv [1], "--del-entry") == 0) - { db_del_entry (reg_db, argv [2]) ; - db_close (reg_db) ; - return 0 ; - } ; - - if (strcmp (argv [1], "--check-file") == 0) - { print_libsndfile_version () ; - - for (k = 2 ; k < argc ; k++) - db_check_file (reg_db, argv [k]) ; - db_close (reg_db) ; - return 0 ; - } ; - - if (strcmp (argv [1], "--add-file") == 0) - { print_libsndfile_version () ; - - for (k = 2 ; k < argc ; k++) - db_add_file (reg_db, argv [k]) ; - db_close (reg_db) ; - return 0 ; - } ; - - printf ("\nError : unhandled command line args :") ; - for (k = 1 ; k < argc ; k++) - printf (" %s", argv [k]) ; - puts ("\n") ; - - return 1 ; -} /* main */ - -static void -print_libsndfile_version (void) -{ char version [64] ; - - sf_command (NULL, SFC_GET_LIB_VERSION, version, sizeof (version)) ; - printf ("\nsndfile-regtest : using %s\n\n", version) ; -} /* print_lib_version */ - -#else - -int -main (void) -{ - puts ("\nThis program was not compiled with libsqlite3 and hence doesn't work.\n") ; - - return 0 ; -} /* main */ - -#endif - diff --git a/libs/libsndfile/sndfile.pc.in b/libs/libsndfile/sndfile.pc.in deleted file mode 100644 index 28269c19eb..0000000000 --- a/libs/libsndfile/sndfile.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: sndfile -Description: A library for reading and writing audio files -Requires: -Version: @VERSION@ -Libs: -L${libdir} -lsndfile -Libs.private: @EXTERNAL_LIBS@ -Cflags: -I${includedir} diff --git a/libs/libsndfile/src/ALAC/ALACAudioTypes.h b/libs/libsndfile/src/ALAC/ALACAudioTypes.h deleted file mode 100644 index 4d120fa5e4..0000000000 --- a/libs/libsndfile/src/ALAC/ALACAudioTypes.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: ALACAudioTypes.h -*/ - -#ifndef ALACAUDIOTYPES_H -#define ALACAUDIOTYPES_H - -/* Force these Mac OS specific things to zero. */ -#define PRAGMA_STRUCT_ALIGN 0 -#define PRAGMA_STRUCT_PACKPUSH 0 -#define PRAGMA_STRUCT_PACK 0 -#define PRAGMA_ONCE 0 -#define PRAGMA_MARK 0 - - -#if PRAGMA_ONCE -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#include "sfendian.h" - -#if CPU_IS_BIG_ENDIAN == 1 -#define TARGET_RT_BIG_ENDIAN 1 -#else -#define TARGET_RT_BIG_ENDIAN 0 -#endif - -#define kChannelAtomSize 12 - -enum -{ - kALAC_UnimplementedError = -4, - kALAC_FileNotFoundError = -43, - kALAC_ParamError = -50, - kALAC_MemFullError = -108, - fALAC_FrameLengthError = -666, -}; - -enum -{ - kALACFormatAppleLossless = MAKE_MARKER ('a', 'l', 'a', 'c'), - kALACFormatLinearPCM = MAKE_MARKER ('l', 'p', 'c', 'm') -}; - -enum -{ - kALACMaxChannels = 8, - kALACMaxEscapeHeaderBytes = 8, - kALACMaxSearches = 16, - kALACMaxCoefs = 16, - kALACDefaultFramesPerPacket = 4096 -}; - -typedef uint32_t ALACChannelLayoutTag; - -enum -{ - kALACFormatFlagIsFloat = (1 << 0), // 0x1 - kALACFormatFlagIsBigEndian = (1 << 1), // 0x2 - kALACFormatFlagIsSignedInteger = (1 << 2), // 0x4 - kALACFormatFlagIsPacked = (1 << 3), // 0x8 - kALACFormatFlagIsAlignedHigh = (1 << 4), // 0x10 -}; - -enum -{ -#if TARGET_RT_BIG_ENDIAN - kALACFormatFlagsNativeEndian = kALACFormatFlagIsBigEndian -#else - kALACFormatFlagsNativeEndian = 0 -#endif -}; - -// this is required to be an IEEE 64bit float -typedef double alac_float64_t; - -// These are the Channel Layout Tags used in the Channel Layout Info portion of the ALAC magic cookie -enum -{ - kALACChannelLayoutTag_Mono = (100<<16) | 1, // C - kALACChannelLayoutTag_Stereo = (101<<16) | 2, // L R - kALACChannelLayoutTag_MPEG_3_0_B = (113<<16) | 3, // C L R - kALACChannelLayoutTag_MPEG_4_0_B = (116<<16) | 4, // C L R Cs - kALACChannelLayoutTag_MPEG_5_0_D = (120<<16) | 5, // C L R Ls Rs - kALACChannelLayoutTag_MPEG_5_1_D = (124<<16) | 6, // C L R Ls Rs LFE - kALACChannelLayoutTag_AAC_6_1 = (142<<16) | 7, // C L R Ls Rs Cs LFE - kALACChannelLayoutTag_MPEG_7_1_B = (127<<16) | 8 // C Lc Rc L R Ls Rs LFE (doc: IS-13818-7 MPEG2-AAC) -}; - -// ALAC currently only utilizes these channels layouts. There is a one for one correspondance between a -// given number of channels and one of these layout tags -static const ALACChannelLayoutTag ALACChannelLayoutTags[kALACMaxChannels] = -{ - kALACChannelLayoutTag_Mono, // C - kALACChannelLayoutTag_Stereo, // L R - kALACChannelLayoutTag_MPEG_3_0_B, // C L R - kALACChannelLayoutTag_MPEG_4_0_B, // C L R Cs - kALACChannelLayoutTag_MPEG_5_0_D, // C L R Ls Rs - kALACChannelLayoutTag_MPEG_5_1_D, // C L R Ls Rs LFE - kALACChannelLayoutTag_AAC_6_1, // C L R Ls Rs Cs LFE - kALACChannelLayoutTag_MPEG_7_1_B // C Lc Rc L R Ls Rs LFE (doc: IS-13818-7 MPEG2-AAC) -}; - -// AudioChannelLayout from CoreAudioTypes.h. We never need the AudioChannelDescription so we remove it -struct ALACAudioChannelLayout -{ - ALACChannelLayoutTag mChannelLayoutTag; - uint32_t mChannelBitmap; - uint32_t mNumberChannelDescriptions; -}; -typedef struct ALACAudioChannelLayout ALACAudioChannelLayout; - -struct AudioFormatDescription -{ - alac_float64_t mSampleRate; - uint32_t mFormatID; - uint32_t mFormatFlags; - uint32_t mBytesPerPacket; - uint32_t mFramesPerPacket; - uint32_t mBytesPerFrame; - uint32_t mChannelsPerFrame; - uint32_t mBitsPerChannel; - uint32_t mReserved; -}; -typedef struct AudioFormatDescription AudioFormatDescription; - -/* Lossless Definitions */ - -enum -{ - kALACCodecFormat = MAKE_MARKER ('a', 'l', 'a', 'c'), - kALACVersion = 0, - kALACCompatibleVersion = kALACVersion, - kALACDefaultFrameSize = 4096 -}; - -// note: this struct is wrapped in an 'alac' atom in the sample description extension area -// note: in QT movies, it will be further wrapped in a 'wave' atom surrounded by 'frma' and 'term' atoms -typedef struct ALACSpecificConfig -{ - uint32_t frameLength; - uint8_t compatibleVersion; - uint8_t bitDepth; // max 32 - uint8_t pb; // 0 <= pb <= 255 - uint8_t mb; - uint8_t kb; - uint8_t numChannels; - uint16_t maxRun; - uint32_t maxFrameBytes; - uint32_t avgBitRate; - uint32_t sampleRate; - -} ALACSpecificConfig; - - -// The AudioChannelLayout atom type is not exposed yet so define it here -enum -{ - AudioChannelLayoutAID = MAKE_MARKER ('c', 'h', 'a', 'n') -}; - -#if PRAGMA_STRUCT_ALIGN - #pragma options align=reset -#elif PRAGMA_STRUCT_PACKPUSH - #pragma pack(pop) -#elif PRAGMA_STRUCT_PACK - #pragma pack() -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* ALACAUDIOTYPES_H */ diff --git a/libs/libsndfile/src/ALAC/ALACBitUtilities.c b/libs/libsndfile/src/ALAC/ALACBitUtilities.c deleted file mode 100644 index f385daff0c..0000000000 --- a/libs/libsndfile/src/ALAC/ALACBitUtilities.c +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/*============================================================================= - File: ALACBitUtilities.c - - $NoKeywords: $ -=============================================================================*/ - -#include -#include "ALACBitUtilities.h" - -#define PRAGMA_MARK 0 - -// BitBufferInit -// -void BitBufferInit( BitBuffer * bits, uint8_t * buffer, uint32_t byteSize ) -{ - bits->cur = buffer; - bits->end = bits->cur + byteSize; - bits->bitIndex = 0; - bits->byteSize = byteSize; -} - -// BitBufferRead -// -uint32_t BitBufferRead( BitBuffer * bits, uint8_t numBits ) -{ - uint32_t returnBits; - - //Assert( numBits <= 16 ); - - returnBits = ((uint32_t)bits->cur[0] << 16) | ((uint32_t)bits->cur[1] << 8) | ((uint32_t)bits->cur[2]); - returnBits = returnBits << bits->bitIndex; - returnBits &= 0x00FFFFFF; - - bits->bitIndex += numBits; - - returnBits = returnBits >> (24 - numBits); - - bits->cur += (bits->bitIndex >> 3); - bits->bitIndex &= 7; - - //Assert( bits->cur <= bits->end ); - - return returnBits; -} - -// BitBufferReadSmall -// -// Reads up to 8 bits -uint8_t BitBufferReadSmall( BitBuffer * bits, uint8_t numBits ) -{ - uint16_t returnBits; - - //Assert( numBits <= 8 ); - - returnBits = (bits->cur[0] << 8) | bits->cur[1]; - returnBits = returnBits << bits->bitIndex; - - bits->bitIndex += numBits; - - returnBits = returnBits >> (16 - numBits); - - bits->cur += (bits->bitIndex >> 3); - bits->bitIndex &= 7; - - //Assert( bits->cur <= bits->end ); - - return (uint8_t)returnBits; -} - -// BitBufferReadOne -// -// Reads one byte -uint8_t BitBufferReadOne( BitBuffer * bits ) -{ - uint8_t returnBits; - - returnBits = (bits->cur[0] >> (7 - bits->bitIndex)) & 1; - - bits->bitIndex++; - - bits->cur += (bits->bitIndex >> 3); - bits->bitIndex &= 7; - - //Assert( bits->cur <= bits->end ); - - return returnBits; -} - -// BitBufferPeek -// -uint32_t BitBufferPeek( BitBuffer * bits, uint8_t numBits ) -{ - return ((((((uint32_t) bits->cur[0] << 16) | ((uint32_t) bits->cur[1] << 8) | - ((uint32_t) bits->cur[2])) << bits->bitIndex) & 0x00FFFFFF) >> (24 - numBits)); -} - -// BitBufferPeekOne -// -uint32_t BitBufferPeekOne( BitBuffer * bits ) -{ - return ((bits->cur[0] >> (7 - bits->bitIndex)) & 1); -} - -// BitBufferUnpackBERSize -// -uint32_t BitBufferUnpackBERSize( BitBuffer * bits ) -{ - uint32_t size; - uint8_t tmp; - - for ( size = 0, tmp = 0x80u; tmp &= 0x80u; size = (size << 7u) | (tmp & 0x7fu) ) - tmp = (uint8_t) BitBufferReadSmall( bits, 8 ); - - return size; -} - -// BitBufferGetPosition -// -uint32_t BitBufferGetPosition( BitBuffer * bits ) -{ - uint8_t * begin; - - begin = bits->end - bits->byteSize; - - return ((uint32_t)(bits->cur - begin) * 8) + bits->bitIndex; -} - -// BitBufferByteAlign -// -void BitBufferByteAlign( BitBuffer * bits, int32_t addZeros ) -{ - // align bit buffer to next byte boundary, writing zeros if requested - if ( bits->bitIndex == 0 ) - return; - - if ( addZeros ) - BitBufferWrite( bits, 0, 8 - bits->bitIndex ); - else - BitBufferAdvance( bits, 8 - bits->bitIndex ); -} - -// BitBufferAdvance -// -void BitBufferAdvance( BitBuffer * bits, uint32_t numBits ) -{ - if ( numBits ) - { - bits->bitIndex += numBits; - bits->cur += (bits->bitIndex >> 3); - bits->bitIndex &= 7; - } -} - -// BitBufferRewind -// -void BitBufferRewind( BitBuffer * bits, uint32_t numBits ) -{ - uint32_t numBytes; - - if ( numBits == 0 ) - return; - - if ( bits->bitIndex >= numBits ) - { - bits->bitIndex -= numBits; - return; - } - - numBits -= bits->bitIndex; - bits->bitIndex = 0; - - numBytes = numBits / 8; - numBits = numBits % 8; - - bits->cur -= numBytes; - - if ( numBits > 0 ) - { - bits->bitIndex = 8 - numBits; - bits->cur--; - } - - if ( bits->cur < (bits->end - bits->byteSize) ) - { - //DebugCMsg("BitBufferRewind: Rewound too far."); - - bits->cur = (bits->end - bits->byteSize); - bits->bitIndex = 0; - } -} - -// BitBufferWrite -// -void BitBufferWrite( BitBuffer * bits, uint32_t bitValues, uint32_t numBits ) -{ - uint32_t invBitIndex; - - RequireAction( bits != NULL, return; ); - RequireActionSilent( numBits > 0, return; ); - - invBitIndex = 8 - bits->bitIndex; - - while ( numBits > 0 ) - { - uint32_t tmp; - uint8_t shift; - uint8_t mask; - uint32_t curNum; - - curNum = MIN( invBitIndex, numBits ); - - tmp = bitValues >> (numBits - curNum); - - shift = (uint8_t)(invBitIndex - curNum); - mask = 0xffu >> (8 - curNum); // must be done in two steps to avoid compiler sequencing ambiguity - mask <<= shift; - - bits->cur[0] = (bits->cur[0] & ~mask) | (((uint8_t) tmp << shift) & mask); - numBits -= curNum; - - // increment to next byte if need be - invBitIndex -= curNum; - if ( invBitIndex == 0 ) - { - invBitIndex = 8; - bits->cur++; - } - } - - bits->bitIndex = 8 - invBitIndex; -} - -void BitBufferReset( BitBuffer * bits ) -//void BitBufferInit( BitBuffer * bits, uint8_t * buffer, uint32_t byteSize ) -{ - bits->cur = bits->end - bits->byteSize; - bits->bitIndex = 0; -} - -#if PRAGMA_MARK -#pragma mark - -#endif diff --git a/libs/libsndfile/src/ALAC/ALACBitUtilities.h b/libs/libsndfile/src/ALAC/ALACBitUtilities.h deleted file mode 100644 index 5d3a4c1433..0000000000 --- a/libs/libsndfile/src/ALAC/ALACBitUtilities.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/*============================================================================= - File: ALACBitUtilities.h - - $NoKeywords: $ -=============================================================================*/ - -#ifndef __ALACBITUTILITIES_H -#define __ALACBITUTILITIES_H - -#include - -#ifndef MIN -#define MIN(x, y) ( (x)<(y) ?(x) :(y) ) -#endif //MIN -#ifndef MAX -#define MAX(x, y) ( (x)>(y) ?(x): (y) ) -#endif //MAX - -#define RequireAction(condition, action) if (!(condition)) { action } -#define RequireActionSilent(condition, action) if (!(condition)) { action } -#define RequireNoErr(condition, action) if ((condition)) { action } - -enum -{ - ALAC_noErr = 0 -}; - - -typedef enum -{ - - ID_SCE = 0, /* Single Channel Element */ - ID_CPE = 1, /* Channel Pair Element */ - ID_CCE = 2, /* Coupling Channel Element */ - ID_LFE = 3, /* LFE Channel Element */ - ID_DSE = 4, /* not yet supported */ - ID_PCE = 5, - ID_FIL = 6, - ID_END = 7 -} ELEMENT_TYPE; - -// types -typedef struct BitBuffer -{ - uint8_t * cur; - uint8_t * end; - uint32_t bitIndex; - uint32_t byteSize; - -} BitBuffer; - -/* - BitBuffer routines - - these routines take a fixed size buffer and read/write to it - - bounds checking must be done by the client -*/ -void BitBufferInit( BitBuffer * bits, uint8_t * buffer, uint32_t byteSize ); -uint32_t BitBufferRead( BitBuffer * bits, uint8_t numBits ); // note: cannot read more than 16 bits at a time -uint8_t BitBufferReadSmall( BitBuffer * bits, uint8_t numBits ); -uint8_t BitBufferReadOne( BitBuffer * bits ); -uint32_t BitBufferPeek( BitBuffer * bits, uint8_t numBits ); // note: cannot read more than 16 bits at a time -uint32_t BitBufferPeekOne( BitBuffer * bits ); -uint32_t BitBufferUnpackBERSize( BitBuffer * bits ); -uint32_t BitBufferGetPosition( BitBuffer * bits ); -void BitBufferByteAlign( BitBuffer * bits, int32_t addZeros ); -void BitBufferAdvance( BitBuffer * bits, uint32_t numBits ); -void BitBufferRewind( BitBuffer * bits, uint32_t numBits ); -void BitBufferWrite( BitBuffer * bits, uint32_t value, uint32_t numBits ); -void BitBufferReset( BitBuffer * bits); - -#endif /* __BITUTILITIES_H */ diff --git a/libs/libsndfile/src/ALAC/ALACDecoder.h b/libs/libsndfile/src/ALAC/ALACDecoder.h deleted file mode 100644 index baebd4fac4..0000000000 --- a/libs/libsndfile/src/ALAC/ALACDecoder.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: ALACDecoder.h -*/ - -#ifndef _ALACDECODER_H -#define _ALACDECODER_H - -#include - -#include "ALACAudioTypes.h" - -struct BitBuffer; - -class ALACDecoder -{ - public: - ALACDecoder(); - ~ALACDecoder(); - - int32_t Init( void * inMagicCookie, uint32_t inMagicCookieSize ); - int32_t Decode( struct BitBuffer * bits, uint8_t * sampleBuffer, uint32_t numSamples, uint32_t numChannels, uint32_t * outNumSamples ); - - public: - // decoding parameters (public for use in the analyzer) - ALACSpecificConfig mConfig; - - protected: - int32_t FillElement( struct BitBuffer * bits ); - int32_t DataStreamElement( struct BitBuffer * bits ); - - uint16_t mActiveElements; - - // decoding buffers - int32_t * mMixBufferU; - int32_t * mMixBufferV; - int32_t * mPredictor; - uint16_t * mShiftBuffer; // note: this points to mPredictor's memory but different - // variable for clarity and type difference -}; - -#endif /* _ALACDECODER_H */ diff --git a/libs/libsndfile/src/ALAC/ALACEncoder.h b/libs/libsndfile/src/ALAC/ALACEncoder.h deleted file mode 100644 index 75a0a43721..0000000000 --- a/libs/libsndfile/src/ALAC/ALACEncoder.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: ALACEncoder.h -*/ - -#pragma once - -#include - -#include "ALACAudioTypes.h" - - -struct BitBuffer; - -class ALACEncoder -{ - public: - ALACEncoder(); - virtual ~ALACEncoder(); - - virtual int32_t Encode(AudioFormatDescription theInputFormat, AudioFormatDescription theOutputFormat, - unsigned char * theReadBuffer, unsigned char * theWriteBuffer, int32_t * ioNumBytes); - virtual int32_t Finish( ); - - void SetFastMode( bool fast ) { mFastMode = fast; }; - - // this must be called *before* InitializeEncoder() - void SetFrameSize( uint32_t frameSize ) { mFrameSize = frameSize; }; - - void GetConfig( ALACSpecificConfig & config ); - uint32_t GetMagicCookieSize(uint32_t inNumChannels); - void GetMagicCookie( void * config, uint32_t * ioSize ); - - virtual int32_t InitializeEncoder(AudioFormatDescription theOutputFormat); - - protected: - virtual void GetSourceFormat( const AudioFormatDescription * source, AudioFormatDescription * output ); - - int32_t EncodeStereo( struct BitBuffer * bitstream, void * input, uint32_t stride, uint32_t channelIndex, uint32_t numSamples ); - int32_t EncodeStereoFast( struct BitBuffer * bitstream, void * input, uint32_t stride, uint32_t channelIndex, uint32_t numSamples ); - int32_t EncodeStereoEscape( struct BitBuffer * bitstream, void * input, uint32_t stride, uint32_t numSamples ); - int32_t EncodeMono( struct BitBuffer * bitstream, void * input, uint32_t stride, uint32_t channelIndex, uint32_t numSamples ); - - - // ALAC encoder parameters - int16_t mBitDepth; - bool mFastMode; - - // encoding state - int16_t mLastMixRes[kALACMaxChannels]; - - // encoding buffers - int32_t * mMixBufferU; - int32_t * mMixBufferV; - int32_t * mPredictorU; - int32_t * mPredictorV; - uint16_t * mShiftBufferUV; - - uint8_t * mWorkBuffer; - - // per-channel coefficients buffers - int16_t mCoefsU[kALACMaxChannels][kALACMaxSearches][kALACMaxCoefs]; - int16_t mCoefsV[kALACMaxChannels][kALACMaxSearches][kALACMaxCoefs]; - - // encoding statistics - uint32_t mTotalBytesGenerated; - uint32_t mAvgBitRate; - uint32_t mMaxFrameBytes; - uint32_t mFrameSize; - uint32_t mMaxOutputBytes; - uint32_t mNumChannels; - uint32_t mOutputSampleRate; -}; diff --git a/libs/libsndfile/src/ALAC/EndianPortable.h b/libs/libsndfile/src/ALAC/EndianPortable.h deleted file mode 100644 index d0b132761f..0000000000 --- a/libs/libsndfile/src/ALAC/EndianPortable.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. -** Copyright (C) 2013 Erik de Castro Lopo - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -// -// EndianPortable.h -// -// Copyright 2011 Apple Inc. All rights reserved. -// - -#ifndef _EndianPortable_h -#define _EndianPortable_h - -#include - -#define Swap16NtoB(x) H2BE_16(x) -#define Swap16BtoN(x) BE2H_16(x) - -#define Swap32NtoB(x) H2BE_32(x) -#define Swap32BtoN(x) BE2H_32(x) - -#endif diff --git a/libs/libsndfile/src/ALAC/LICENSE b/libs/libsndfile/src/ALAC/LICENSE deleted file mode 100644 index 7d8595490d..0000000000 --- a/libs/libsndfile/src/ALAC/LICENSE +++ /dev/null @@ -1,170 +0,0 @@ -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the -copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other -entities that control, are controlled by, or are under common control -with that entity. For the purposes of this definition, "control" means -(i) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (ii) ownership -of fifty percent (50%) or more of the outstanding shares, or (iii) -beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, -including but not limited to software source code, documentation source, -and configuration files. - -"Object" form shall mean any form resulting from mechanical -transformation or translation of a Source form, including but not -limited to compiled object code, generated documentation, and -conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object -form, made available under the License, as indicated by a copyright -notice that is included in or attached to the work (an example is -provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object -form, that is based on (or derived from) the Work and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. For the purposes -of this License, Derivative Works shall not include works that remain -separable from, or merely link (or bind by name) to the interfaces of, -the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original -version of the Work and any modifications or additions to that Work or -Derivative Works thereof, that is intentionally submitted to Licensor -for inclusion in the Work by the copyright owner or by an individual -or Legal Entity authorized to submit on behalf of the copyright owner. -For the purposes of this definition, "submitted" means any form of -electronic, verbal, or written communication sent to the Licensor -or its representatives, including but not limited to communication -on electronic mailing lists, source code control systems, and issue -tracking systems that are managed by, or on behalf of, the Licensor -for the purpose of discussing and improving the Work, but excluding -communication that is conspicuously marked or otherwise designated in -writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity -on behalf of whom a Contribution has been received by Licensor and -subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions -of this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -copyright license to reproduce, prepare Derivative Works of, publicly -display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except -as stated in this section) patent license to make, have made, use, -offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such -Contributor that are necessarily infringed by their Contribution(s) -alone or by combination of their Contribution(s) with the Work to which -such Contribution(s) was submitted. If You institute patent litigation -against any entity (including a cross-claim or counterclaim in a -lawsuit) alleging that the Work or a Contribution incorporated within -the Work constitutes direct or contributory patent infringement, then -any patent licenses granted to You under this License for that Work -shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the -Work or Derivative Works thereof in any medium, with or without -modifications, and in Source or Object form, provided that You meet the -following conditions: - -You must give any other recipients of the Work or Derivative Works a -copy of this License; and - -You must cause any modified files to carry prominent notices stating -that You changed the files; and - -You must retain, in the Source form of any Derivative Works that You -distribute, all copyright, patent, trademark, and attribution notices -from the Source form of the Work, excluding those notices that do not -pertain to any part of the Derivative Works; and - -If the Work includes a "NOTICE" text file as part of its distribution, -then any Derivative Works that You distribute must include a readable -copy of the attribution notices contained within such NOTICE file, -excluding those notices that do not pertain to any part of the -Derivative Works, in at least one of the following places: within a -NOTICE text file distributed as part of the Derivative Works; within -the Source form or documentation, if provided along with the Derivative -Works; or, within a display generated by the Derivative Works, if and -wherever such third-party notices normally appear. The contents of the -NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative -Works that You distribute, alongside or as an addendum to the NOTICE -text from the Work, provided that such additional attribution notices -cannot be construed as modifying the License. You may add Your own -copyright statement to Your modifications and may provide additional -or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as -a whole, provided Your use, reproduction, and distribution of the Work -otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, -any Contribution intentionally submitted for inclusion in the Work by -You to the Licensor shall be under the terms and conditions of this -License, without any additional terms or conditions. Notwithstanding -the above, nothing herein shall supersede or modify the terms of any -separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. This License does not grant permission to use the trade -names, trademarks, service marks, or product names of the Licensor, -except as required for reasonable and customary use in describing the -origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed -to in writing, Licensor provides the Work (and each Contributor -provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied, including, without -limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, -MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your -exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, -whether in tort (including negligence), contract, or otherwise, unless -required by applicable law (such as deliberate and grossly negligent -acts) or agreed to in writing, shall any Contributor be liable to You -for damages, including any direct, indirect, special, incidental, or -consequential damages of any character arising as a result of this -License or out of the use or inability to use the Work (including but -not limited to damages for loss of goodwill, work stoppage, computer -failure or malfunction, or any and all other commercial damages or -losses), even if such Contributor has been advised of the possibility of -such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the -Work or Derivative Works thereof, You may choose to offer, and charge a -fee for, acceptance of support, warranty, indemnity, or other liability -obligations and/or rights consistent with this License. However, in -accepting such obligations, You may act only on Your own behalf and -on Your sole responsibility, not on behalf of any other Contributor, -and only if You agree to indemnify, defend, and hold each Contributor -harmless for any liability incurred by, or claims asserted against, such -Contributor by reason of your accepting any such warranty or additional -liability. diff --git a/libs/libsndfile/src/ALAC/ag_dec.c b/libs/libsndfile/src/ALAC/ag_dec.c deleted file mode 100644 index 81c18dc920..0000000000 --- a/libs/libsndfile/src/ALAC/ag_dec.c +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: ag_dec.c - - Contains: Adaptive Golomb decode routines. - - Copyright: (c) 2001-2011 Apple, Inc. -*/ - -#include "aglib.h" -#include "ALACBitUtilities.h" -#include "ALACAudioTypes.h" - -#include -#include -#include -#include - -#define CODE_TO_LONG_MAXBITS 32 -#define N_MAX_MEAN_CLAMP 0xffff -#define N_MEAN_CLAMP_VAL 0xffff -#define REPORT_VAL 40 - -#if __GNUC__ -#define ALWAYS_INLINE __attribute__((always_inline)) -#else -#define ALWAYS_INLINE -#endif - -/* And on the subject of the CodeWarrior x86 compiler and inlining, I reworked a lot of this - to help the compiler out. In many cases this required manual inlining or a macro. Sorry - if it is ugly but the performance gains are well worth it. - - WSK 5/19/04 -*/ - -void set_standard_ag_params(AGParamRecPtr params, uint32_t fullwidth, uint32_t sectorwidth) -{ - /* Use - fullwidth = sectorwidth = numOfSamples, for analog 1-dimensional type-short data, - but use - fullwidth = full image width, sectorwidth = sector (patch) width - for such as image (2-dim.) data. - */ - set_ag_params( params, MB0, PB0, KB0, fullwidth, sectorwidth, MAX_RUN_DEFAULT ); -} - -void set_ag_params(AGParamRecPtr params, uint32_t m, uint32_t p, uint32_t k, uint32_t f, uint32_t s, uint32_t maxrun) -{ - params->mb = params->mb0 = m; - params->pb = p; - params->kb = k; - params->wb = (1u<kb)-1; - params->qb = QB-params->pb; - params->fw = f; - params->sw = s; - params->maxrun = maxrun; -} - -#if PRAGMA_MARK -#pragma mark - -#endif - - -// note: implementing this with some kind of "count leading zeros" assembly is a big performance win -static inline int32_t lead( int32_t m ) -{ - long j; - unsigned long c = (1ul << 31); - - for(j=0; j < 32; j++) - { - if((c & m) != 0) - break; - c >>= 1; - } - return (j); -} - -#define arithmin(a, b) ((a) < (b) ? (a) : (b)) - -static inline int32_t ALWAYS_INLINE lg3a( int32_t x) -{ - int32_t result; - - x += 3; - result = lead(x); - - return 31 - result; -} - -static inline uint32_t ALWAYS_INLINE read32bit( uint8_t * buffer ) -{ - // embedded CPUs typically can't read unaligned 32-bit words so just read the bytes - uint32_t value; - - value = ((uint32_t)buffer[0] << 24) | ((uint32_t)buffer[1] << 16) | - ((uint32_t)buffer[2] << 8) | (uint32_t)buffer[3]; - return value; - -} - -#if PRAGMA_MARK -#pragma mark - -#endif - -#define get_next_fromlong(inlong, suff) ((inlong) >> (32 - (suff))) - - -static inline uint32_t ALWAYS_INLINE -getstreambits( uint8_t *in, int32_t bitoffset, int32_t numbits ) -{ - uint32_t load1, load2; - uint32_t byteoffset = bitoffset / 8; - uint32_t result; - - //Assert( numbits <= 32 ); - - load1 = read32bit( in + byteoffset ); - - if ( (numbits + (bitoffset & 0x7)) > 32) - { - int32_t load2shift; - - result = load1 << (bitoffset & 0x7); - load2 = (uint32_t) in[byteoffset+4]; - load2shift = (8-(numbits + (bitoffset & 0x7)-32)); - load2 >>= load2shift; - result >>= (32-numbits); - result |= load2; - } - else - { - result = load1 >> (32-numbits-(bitoffset & 7)); - } - - // a shift of >= "the number of bits in the type of the value being shifted" results in undefined - // behavior so don't try to shift by 32 - if ( numbits != (sizeof(result) * 8) ) - result &= ~(0xfffffffful << numbits); - - return result; -} - - -static inline int32_t dyn_get(unsigned char *in, uint32_t *bitPos, uint32_t m, uint32_t k) -{ - uint32_t tempbits = *bitPos; - uint32_t result; - uint32_t pre = 0, v; - uint32_t streamlong; - - streamlong = read32bit( in + (tempbits >> 3) ); - streamlong <<= (tempbits & 7); - - /* find the number of bits in the prefix */ - { - uint32_t notI = ~streamlong; - pre = lead( notI); - } - - if(pre >= MAX_PREFIX_16) - { - pre = MAX_PREFIX_16; - tempbits += pre; - streamlong <<= pre; - result = get_next_fromlong(streamlong,MAX_DATATYPE_BITS_16); - tempbits += MAX_DATATYPE_BITS_16; - - } - else - { - // all of the bits must fit within the long we have loaded - //Assert(pre+1+k <= 32); - - tempbits += pre; - tempbits += 1; - streamlong <<= pre+1; - v = get_next_fromlong(streamlong, k); - tempbits += k; - - result = pre*m + v-1; - - if(v<2) { - result -= (v-1); - tempbits -= 1; - } - } - - *bitPos = tempbits; - return result; -} - - -static inline int32_t dyn_get_32bit( uint8_t * in, uint32_t * bitPos, int32_t m, int32_t k, int32_t maxbits ) -{ - uint32_t tempbits = *bitPos; - uint32_t v; - uint32_t streamlong; - uint32_t result; - - streamlong = read32bit( in + (tempbits >> 3) ); - streamlong <<= (tempbits & 7); - - /* find the number of bits in the prefix */ - { - uint32_t notI = ~streamlong; - result = lead( notI); - } - - if(result >= MAX_PREFIX_32) - { - result = getstreambits(in, tempbits+MAX_PREFIX_32, maxbits); - tempbits += MAX_PREFIX_32 + maxbits; - } - else - { - /* all of the bits must fit within the long we have loaded*/ - //Assert(k<=14); - //Assert(result=2) - { - result += (v-1); - tempbits += 1; - } - } - } - - *bitPos = tempbits; - - return result; -} - -int32_t dyn_decomp( AGParamRecPtr params, BitBuffer * bitstream, int32_t * pc, int32_t numSamples, int32_t maxSize, uint32_t * outNumBits ) -{ - uint8_t *in; - int32_t *outPtr = pc; - uint32_t bitPos, startPos, maxPos; - uint32_t j, m, k, n, c, mz; - int32_t del, zmode; - uint32_t mb; - uint32_t pb_local = params->pb; - uint32_t kb_local = params->kb; - uint32_t wb_local = params->wb; - int32_t status; - - RequireAction( (bitstream != NULL) && (pc != NULL) && (outNumBits != NULL), return kALAC_ParamError; ); - *outNumBits = 0; - - in = bitstream->cur; - startPos = bitstream->bitIndex; - maxPos = bitstream->byteSize * 8; - bitPos = startPos; - - mb = params->mb0; - zmode = 0; - - c = 0; - status = ALAC_noErr; - - while (c < (uint32_t) numSamples) - { - // bail if we've run off the end of the buffer - RequireAction( bitPos < maxPos, status = kALAC_ParamError; goto Exit; ); - - m = (mb)>>QBSHIFT; - k = lg3a(m); - - k = arithmin(k, kb_local); - m = (1<> 1) * (multiplier); - } - - *outPtr++ = del; - - c++; - - mb = pb_local*(n+zmode) + mb - ((pb_local*mb)>>QBSHIFT); - - // update mean tracking - if (n > N_MAX_MEAN_CLAMP) - mb = N_MEAN_CLAMP_VAL; - - zmode = 0; - - if (((mb << MMULSHIFT) < QB) && (c < (uint32_t) numSamples)) - { - zmode = 1; - k = lead(mb) - BITOFF+((mb+MOFF)>>MDENSHIFT); - mz = ((1<= 65535) - zmode = 0; - - mb = 0; - } - } - -Exit: - *outNumBits = (bitPos - startPos); - BitBufferAdvance( bitstream, *outNumBits ); - RequireAction( bitstream->cur <= bitstream->end, status = kALAC_ParamError; ); - - return status; -} diff --git a/libs/libsndfile/src/ALAC/ag_enc.c b/libs/libsndfile/src/ALAC/ag_enc.c deleted file mode 100644 index 0916cc0852..0000000000 --- a/libs/libsndfile/src/ALAC/ag_enc.c +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * Copyright (C) 2013 Erik de Castro Lopo - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: ag_enc.c - - Contains: Adaptive Golomb encode routines. - - Copyright: (c) 2001-2011 Apple, Inc. -*/ - -#include "aglib.h" -#include "ALACBitUtilities.h" -#include "EndianPortable.h" -#include "ALACAudioTypes.h" - -#include -#include -#include -#include - -#define CODE_TO_LONG_MAXBITS 32 -#define N_MAX_MEAN_CLAMP 0xffff -#define N_MEAN_CLAMP_VAL 0xffff -#define REPORT_VAL 40 - -#if __GNUC__ -#define ALWAYS_INLINE __attribute__((always_inline)) -#else -#define ALWAYS_INLINE -#endif - - -/* And on the subject of the CodeWarrior x86 compiler and inlining, I reworked a lot of this - to help the compiler out. In many cases this required manual inlining or a macro. Sorry - if it is ugly but the performance gains are well worth it. - - WSK 5/19/04 -*/ - -// note: implementing this with some kind of "count leading zeros" assembly is a big performance win -static inline int32_t lead( int32_t m ) -{ - long j; - unsigned long c = (1ul << 31); - - for(j=0; j < 32; j++) - { - if((c & m) != 0) - break; - c >>= 1; - } - return (j); -} - -#define arithmin(a, b) ((a) < (b) ? (a) : (b)) - -static inline int32_t ALWAYS_INLINE lg3a( int32_t x) -{ - int32_t result; - - x += 3; - result = lead(x); - - return 31 - result; -} - -static inline int32_t ALWAYS_INLINE abs_func( int32_t a ) -{ - // note: the CW PPC intrinsic __abs() turns into these instructions so no need to try and use it - int32_t isneg = a >> 31; - int32_t xorval = a ^ isneg; - int32_t result = xorval-isneg; - - return result; -} - -static inline uint32_t ALWAYS_INLINE read32bit( uint8_t * buffer ) -{ - // embedded CPUs typically can't read unaligned 32-bit words so just read the bytes - uint32_t value; - - value = ((uint32_t)buffer[0] << 24) | ((uint32_t)buffer[1] << 16) | - ((uint32_t)buffer[2] << 8) | (uint32_t)buffer[3]; - return value; -} - -#if PRAGMA_MARK -#pragma mark - -#endif - -static inline int32_t dyn_code(int32_t m, int32_t k, int32_t n, uint32_t *outNumBits) -{ - uint32_t divx, mod, de; - uint32_t numBits; - uint32_t value; - - //Assert( n >= 0 ); - - divx = n/m; - - if(divx >= MAX_PREFIX_16) - { - numBits = MAX_PREFIX_16 + MAX_DATATYPE_BITS_16; - value = (((1< MAX_PREFIX_16 + MAX_DATATYPE_BITS_16) - { - numBits = MAX_PREFIX_16 + MAX_DATATYPE_BITS_16; - value = (((1< 25) - goto codeasescape; - } - else - { -codeasescape: - numBits = MAX_PREFIX_32; - value = (((1<> 3); - - shift = 32 - (bitPos & 7) - numBits; - - mask = ~0u >> (32 - numBits); // mask must be created in two steps to avoid compiler sequencing ambiguity - mask <<= shift; - - value = (value << shift) & mask; - value |= curr & ~mask; - - psf_put_be32 (out, bitPos >> 3, value) ; -} - - -static inline void ALWAYS_INLINE dyn_jam_noDeref_large(unsigned char *out, uint32_t bitPos, uint32_t numBits, uint32_t value) -{ - uint32_t w; - uint32_t curr; - uint32_t mask; - int32_t shiftvalue = (32 - (bitPos&7) - numBits); - - //Assert(numBits <= 32); - - curr = psf_get_be32 (out, bitPos >> 3); - - if (shiftvalue < 0) - { - uint8_t tailbyte; - uint8_t *tailptr; - - w = value >> -shiftvalue; - mask = ~0u >> -shiftvalue; - w |= (curr & ~mask); - - tailptr = out + (bitPos>>3) + 4; - tailbyte = (value << ((8+shiftvalue))) & 0xff; - *tailptr = (uint8_t)tailbyte; - } - else - { - mask = ~0u >> (32 - numBits); - mask <<= shiftvalue; // mask must be created in two steps to avoid compiler sequencing ambiguity - - w = (value << shiftvalue) & mask; - w |= curr & ~mask; - } - - psf_put_be32 (out, bitPos >> 3, w) ; -} - - -int32_t dyn_comp( AGParamRecPtr params, int32_t * pc, BitBuffer * bitstream, int32_t numSamples, int32_t bitSize, uint32_t * outNumBits ) -{ - unsigned char * out; - uint32_t bitPos, startPos; - uint32_t m, k, n, c, mz, nz; - uint32_t numBits; - uint32_t value; - int32_t del, zmode; - uint32_t overflow, overflowbits; - int32_t status; - - // shadow the variables in params so there's not the dereferencing overhead - uint32_t mb, pb, kb, wb; - int32_t rowPos = 0; - int32_t rowSize = params->sw; - int32_t rowJump = (params->fw) - rowSize; - int32_t * inPtr = pc; - - *outNumBits = 0; - RequireAction( (bitSize >= 1) && (bitSize <= 32), return kALAC_ParamError; ); - - out = bitstream->cur; - startPos = bitstream->bitIndex; - bitPos = startPos; - - mb = params->mb = params->mb0; - pb = params->pb; - kb = params->kb; - wb = params->wb; - zmode = 0; - - c=0; - status = ALAC_noErr; - - while (c < (uint32_t) numSamples) - { - m = mb >> QBSHIFT; - k = lg3a(m); - if ( k > kb) - { - k = kb; - } - m = (1<> 31) & 1) - zmode; - //Assert( 32-lead(n) <= bitSize ); - - if ( dyn_code_32bit(bitSize, m, k, n, &numBits, &value, &overflow, &overflowbits) ) - { - dyn_jam_noDeref(out, bitPos, numBits, value); - bitPos += numBits; - dyn_jam_noDeref_large(out, bitPos, overflowbits, overflow); - bitPos += overflowbits; - } - else - { - dyn_jam_noDeref(out, bitPos, numBits, value); - bitPos += numBits; - } - - c++; - if ( rowPos >= rowSize) - { - rowPos = 0; - inPtr += rowJump; - } - - mb = pb * (n + zmode) + mb - ((pb *mb)>>QBSHIFT); - - // update mean tracking if it's overflowed - if (n > N_MAX_MEAN_CLAMP) - mb = N_MEAN_CLAMP_VAL; - - zmode = 0; - - RequireAction(c <= (uint32_t) numSamples, status = kALAC_ParamError; goto Exit; ); - - if (((mb << MMULSHIFT) < QB) && (c < (uint32_t) numSamples)) - { - zmode = 1; - nz = 0; - - while(c<(uint32_t) numSamples && *inPtr == 0) - { - /* Take care of wrap-around globals. */ - ++inPtr; - ++nz; - ++c; - if ( ++rowPos >= rowSize) - { - rowPos = 0; - inPtr += rowJump; - } - - if(nz >= 65535) - { - zmode = 0; - break; - } - } - - k = lead(mb) - BITOFF+((mb+MOFF)>>MDENSHIFT); - mz = ((1< - -#ifdef __cplusplus -extern "C" { -#endif - -#define QBSHIFT 9 -#define QB (1< - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: alac_codec.h -*/ - -#ifndef ALAC_CODEC_H -#define ALAC_CODEC_H - -#include - -#include "ALACAudioTypes.h" - -#define ALAC_FRAME_LENGTH 4096 - -struct BitBuffer; - -typedef struct alac_decoder_s -{ - // decoding parameters (public for use in the analyzer) - ALACSpecificConfig mConfig; - - uint16_t mActiveElements; - - // decoding buffers - int32_t mMixBufferU [ALAC_FRAME_LENGTH]; - int32_t mMixBufferV [ALAC_FRAME_LENGTH]; - union - { - int32_t mPredictor [ALAC_FRAME_LENGTH]; - uint16_t mShiftBuffer [ALAC_FRAME_LENGTH]; - } ; -} ALAC_DECODER ; - -typedef struct alac_encoder_s -{ - // ALAC encoder parameters - int16_t mBitDepth; - - // encoding state - int16_t mLastMixRes [kALACMaxChannels]; - - int32_t mFastMode; - - // encoding buffers - int32_t mMixBufferU [ALAC_FRAME_LENGTH] ; - int32_t mMixBufferV [ALAC_FRAME_LENGTH] ; - int32_t mPredictorU [ALAC_FRAME_LENGTH] ; - int32_t mPredictorV [ALAC_FRAME_LENGTH] ; - uint16_t mShiftBufferUV [2 * ALAC_FRAME_LENGTH] ; - uint8_t mWorkBuffer [4 * ALAC_FRAME_LENGTH]; - - // per-channel coefficients buffers - int16_t mCoefsU [kALACMaxChannels][kALACMaxSearches][kALACMaxCoefs]; - int16_t mCoefsV [kALACMaxChannels][kALACMaxSearches][kALACMaxCoefs]; - - // encoding statistics - uint32_t mTotalBytesGenerated; - uint32_t mAvgBitRate; - uint32_t mMaxFrameBytes; - uint32_t mFrameSize; - uint32_t mMaxOutputBytes; - uint32_t mNumChannels; - uint32_t mOutputSampleRate; -} ALAC_ENCODER ; - - -int32_t alac_decoder_init (ALAC_DECODER *p, void * inMagicCookie, uint32_t inMagicCookieSize) ; -int32_t alac_encoder_init (ALAC_ENCODER *p, uint32_t samplerate, uint32_t channels, uint32_t format_flags, uint32_t frameSize) ; - -int32_t alac_decode (ALAC_DECODER *, struct BitBuffer * bits, int32_t * sampleBuffer, - uint32_t numSamples, uint32_t numChannels, uint32_t * outNumSamples) ; - -int32_t alac_encode (ALAC_ENCODER *p, uint32_t numChannels, uint32_t numSamples, - int32_t * theReadBuffer, unsigned char * theWriteBuffer, - uint32_t * ioNumBytes) ; - -void alac_set_fastmode(ALAC_ENCODER * p, int32_t fast) ; - -uint32_t alac_get_magic_cookie_size(uint32_t inNumChannels) ; -void alac_get_magic_cookie(ALAC_ENCODER *p, void * config, uint32_t * ioSize) ; -void alac_get_source_format(ALAC_ENCODER *p, const AudioFormatDescription * source, AudioFormatDescription * output) ; - -#endif diff --git a/libs/libsndfile/src/ALAC/alac_decoder.c b/libs/libsndfile/src/ALAC/alac_decoder.c deleted file mode 100644 index 2681ef6275..0000000000 --- a/libs/libsndfile/src/ALAC/alac_decoder.c +++ /dev/null @@ -1,646 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * Copyright (C) 2012-2013 Erik de Castro Lopo - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: ALACDecoder.cpp -*/ - -#include -#include -#include - -#include "alac_codec.h" - -#include "dplib.h" -#include "aglib.h" -#include "matrixlib.h" - -#include "ALACBitUtilities.h" -#include "EndianPortable.h" - -typedef enum -{ false = 0, - true = 1 -} bool ; - -// constants/data -const uint32_t kMaxBitDepth = 32; // max allowed bit depth is 32 - - -// prototypes -static int32_t alac_fill_element (struct BitBuffer * bits) ; -static int32_t alac_data_stream_element (struct BitBuffer * bits) ; - -static void Zero32( int32_t * buffer, uint32_t numItems, uint32_t stride ); - - -/* - Init() - - initialize the decoder with the given configuration -*/ -int32_t -alac_decoder_init (ALAC_DECODER *p, void * inMagicCookie, uint32_t inMagicCookieSize) -{ - int32_t status = ALAC_noErr; - ALACSpecificConfig theConfig; - uint8_t * theActualCookie = (uint8_t *)inMagicCookie; - uint32_t theCookieBytesRemaining = inMagicCookieSize; - - // For historical reasons the decoder needs to be resilient to magic cookies vended by older encoders. - // As specified in the ALACMagicCookieDescription.txt document, there may be additional data encapsulating - // the ALACSpecificConfig. This would consist of format ('frma') and 'alac' atoms which precede the - // ALACSpecificConfig. - // See ALACMagicCookieDescription.txt for additional documentation concerning the 'magic cookie' - - // skip format ('frma') atom if present - if (theActualCookie[4] == 'f' && theActualCookie[5] == 'r' && theActualCookie[6] == 'm' && theActualCookie[7] == 'a') - { - theActualCookie += 12; - theCookieBytesRemaining -= 12; - } - - // skip 'alac' atom header if present - if (theActualCookie[4] == 'a' && theActualCookie[5] == 'l' && theActualCookie[6] == 'a' && theActualCookie[7] == 'c') - { - theActualCookie += 12; - theCookieBytesRemaining -= 12; - } - - // read the ALACSpecificConfig - if (theCookieBytesRemaining >= sizeof(ALACSpecificConfig)) - { - theConfig.frameLength = psf_get_be32 (theActualCookie, offsetof (ALACSpecificConfig, frameLength)) ; - - if (theConfig.frameLength > ALAC_FRAME_LENGTH) - return fALAC_FrameLengthError ; - - theConfig.compatibleVersion = theActualCookie [offsetof (ALACSpecificConfig, compatibleVersion)] ; - theConfig.bitDepth = theActualCookie [offsetof (ALACSpecificConfig, bitDepth)] ; - theConfig.pb = theActualCookie [offsetof (ALACSpecificConfig, pb)] ; - theConfig.mb = theActualCookie [offsetof (ALACSpecificConfig, mb)] ; - theConfig.kb = theActualCookie [offsetof (ALACSpecificConfig, kb)] ; - theConfig.numChannels = theActualCookie [offsetof (ALACSpecificConfig, numChannels)] ; - theConfig.maxRun = psf_get_be16 (theActualCookie, offsetof (ALACSpecificConfig, maxRun)) ; - theConfig.maxFrameBytes = psf_get_be32 (theActualCookie, offsetof (ALACSpecificConfig, maxFrameBytes)) ; - theConfig.avgBitRate = psf_get_be32 (theActualCookie, offsetof (ALACSpecificConfig, avgBitRate)) ; - theConfig.sampleRate = psf_get_be32 (theActualCookie, offsetof (ALACSpecificConfig, sampleRate)) ; - - p->mConfig = theConfig; - - RequireAction( p->mConfig.compatibleVersion <= kALACVersion, return kALAC_ParamError; ); - - RequireAction( (p->mMixBufferU != NULL) && (p->mMixBufferV != NULL) && (p->mPredictor != NULL), - status = kALAC_MemFullError; goto Exit; ); - } - else - { - status = kALAC_ParamError; - } - - // skip to Channel Layout Info - // theActualCookie += sizeof(ALACSpecificConfig); - - // Currently, the Channel Layout Info portion of the magic cookie (as defined in the - // ALACMagicCookieDescription.txt document) is unused by the decoder. - -Exit: - return status; -} - -/* - Decode() - - the decoded samples are interleaved into the output buffer in the order they arrive in - the bitstream -*/ -int32_t -alac_decode (ALAC_DECODER *p, struct BitBuffer * bits, int32_t * sampleBuffer, uint32_t numSamples, uint32_t numChannels, uint32_t * outNumSamples) -{ - BitBuffer shiftBits; - uint32_t bits1, bits2; - uint8_t tag; - uint8_t elementInstanceTag; - AGParamRec agParams; - uint32_t channelIndex; - int16_t coefsU[32]; // max possible size is 32 although NUMCOEPAIRS is the current limit - int16_t coefsV[32]; - uint8_t numU, numV; - uint8_t mixBits; - int8_t mixRes; - uint16_t unusedHeader; - uint8_t escapeFlag; - uint32_t chanBits; - uint8_t bytesShifted; - uint32_t shift; - uint8_t modeU, modeV; - uint32_t denShiftU, denShiftV; - uint16_t pbFactorU, pbFactorV; - uint16_t pb; - int32_t * out32; - uint8_t headerByte; - uint8_t partialFrame; - uint32_t extraBits; - int32_t val; - uint32_t i, j; - int32_t status; - - RequireAction( (bits != NULL) && (sampleBuffer != NULL) && (outNumSamples != NULL), return kALAC_ParamError; ); - RequireAction( numChannels > 0, return kALAC_ParamError; ); - - p->mActiveElements = 0; - channelIndex = 0; - - status = ALAC_noErr; - *outNumSamples = numSamples; - - while ( status == ALAC_noErr ) - { - // bail if we ran off the end of the buffer - RequireAction( bits->cur < bits->end, status = kALAC_ParamError; goto Exit; ); - - // copy global decode params for this element - pb = p->mConfig.pb; - - // read element tag - tag = BitBufferReadSmall( bits, 3 ); - switch ( tag ) - { - case ID_SCE: - case ID_LFE: - { - // mono/LFE channel - elementInstanceTag = BitBufferReadSmall( bits, 4 ); - p->mActiveElements |= (1u << elementInstanceTag); - - // read the 12 unused header bits - unusedHeader = (uint16_t) BitBufferRead( bits, 12 ); - RequireAction( unusedHeader == 0, status = kALAC_ParamError; goto Exit; ); - - // read the 1-bit "partial frame" flag, 2-bit "shift-off" flag & 1-bit "escape" flag - headerByte = (uint8_t) BitBufferRead( bits, 4 ); - - partialFrame = headerByte >> 3; - - bytesShifted = (headerByte >> 1) & 0x3u; - RequireAction( bytesShifted != 3, status = kALAC_ParamError; goto Exit; ); - - shift = bytesShifted * 8; - - escapeFlag = headerByte & 0x1; - - chanBits = p->mConfig.bitDepth - (bytesShifted * 8); - - // check for partial frame to override requested numSamples - if ( partialFrame != 0 ) - { - numSamples = BitBufferRead( bits, 16 ) << 16; - numSamples |= BitBufferRead( bits, 16 ); - } - - if ( escapeFlag == 0 ) - { - // compressed frame, read rest of parameters - mixBits = (uint8_t) BitBufferRead( bits, 8 ); - mixRes = (int8_t) BitBufferRead( bits, 8 ); - //Assert( (mixBits == 0) && (mixRes == 0) ); // no mixing for mono - - headerByte = (uint8_t) BitBufferRead( bits, 8 ); - modeU = headerByte >> 4; - denShiftU = headerByte & 0xfu; - - headerByte = (uint8_t) BitBufferRead( bits, 8 ); - pbFactorU = headerByte >> 5; - numU = headerByte & 0x1fu; - - for ( i = 0; i < numU; i++ ) - coefsU[i] = (int16_t) BitBufferRead( bits, 16 ); - - // if shift active, skip the the shift buffer but remember where it starts - if ( bytesShifted != 0 ) - { - shiftBits = *bits; - BitBufferAdvance( bits, (bytesShifted * 8) * numSamples ); - } - - // decompress - set_ag_params( &agParams, p->mConfig.mb, (pb * pbFactorU) / 4, p->mConfig.kb, numSamples, numSamples, p->mConfig.maxRun ); - status = dyn_decomp( &agParams, bits, p->mPredictor, numSamples, chanBits, &bits1 ); - RequireNoErr( status, goto Exit; ); - - if ( modeU == 0 ) - { - unpc_block( p->mPredictor, p->mMixBufferU, numSamples, &coefsU[0], numU, chanBits, denShiftU ); - } - else - { - // the special "numActive == 31" mode can be done in-place - unpc_block( p->mPredictor, p->mPredictor, numSamples, NULL, 31, chanBits, 0 ); - unpc_block( p->mPredictor, p->mMixBufferU, numSamples, &coefsU[0], numU, chanBits, denShiftU ); - } - } - else - { - //Assert( bytesShifted == 0 ); - - // uncompressed frame, copy data into the mix buffer to use common output code - shift = 32 - chanBits; - if ( chanBits <= 16 ) - { - for ( i = 0; i < numSamples; i++ ) - { - val = (int32_t) BitBufferRead( bits, (uint8_t) chanBits ); - val = (val << shift) >> shift; - p->mMixBufferU[i] = val; - } - } - else - { - // BitBufferRead() can't read more than 16 bits at a time so break up the reads - extraBits = chanBits - 16; - for ( i = 0; i < numSamples; i++ ) - { - val = (int32_t) BitBufferRead( bits, 16 ); - val = (val << 16) >> shift; - p->mMixBufferU[i] = val | BitBufferRead( bits, (uint8_t) extraBits ); - } - } - - mixBits = mixRes = 0; - bits1 = chanBits * numSamples; - bytesShifted = 0; - } - - // now read the shifted values into the shift buffer - if ( bytesShifted != 0 ) - { - shift = bytesShifted * 8; - //Assert( shift <= 16 ); - - for ( i = 0; i < numSamples; i++ ) - p->mShiftBuffer[i] = (uint16_t) BitBufferRead( &shiftBits, (uint8_t) shift ); - } - - // convert 32-bit integers into output buffer - switch ( p->mConfig.bitDepth ) - { - case 16: - out32 = sampleBuffer + channelIndex; - for ( i = 0, j = 0; i < numSamples; i++, j += numChannels ) - out32[j] = p->mMixBufferU[i] << 16; - break; - case 20: - out32 = sampleBuffer + channelIndex; - copyPredictorTo20( p->mMixBufferU, out32, numChannels, numSamples ); - break; - case 24: - out32 = sampleBuffer + channelIndex; - if ( bytesShifted != 0 ) - copyPredictorTo24Shift( p->mMixBufferU, p->mShiftBuffer, out32, numChannels, numSamples, bytesShifted ); - else - copyPredictorTo24( p->mMixBufferU, out32, numChannels, numSamples ); - break; - case 32: - out32 = sampleBuffer + channelIndex; - if ( bytesShifted != 0 ) - copyPredictorTo32Shift( p->mMixBufferU, p->mShiftBuffer, out32, numChannels, numSamples, bytesShifted ); - else - copyPredictorTo32( p->mMixBufferU, out32, numChannels, numSamples); - break; - } - - channelIndex += 1; - *outNumSamples = numSamples; - break; - } - - case ID_CPE: - { - // if decoding this pair would take us over the max channels limit, bail - if ( (channelIndex + 2) > numChannels ) - goto NoMoreChannels; - - // stereo channel pair - elementInstanceTag = BitBufferReadSmall( bits, 4 ); - p->mActiveElements |= (1u << elementInstanceTag); - - // read the 12 unused header bits - unusedHeader = (uint16_t) BitBufferRead( bits, 12 ); - RequireAction( unusedHeader == 0, status = kALAC_ParamError; goto Exit; ); - - // read the 1-bit "partial frame" flag, 2-bit "shift-off" flag & 1-bit "escape" flag - headerByte = (uint8_t) BitBufferRead( bits, 4 ); - - partialFrame = headerByte >> 3; - - bytesShifted = (headerByte >> 1) & 0x3u; - RequireAction( bytesShifted != 3, status = kALAC_ParamError; goto Exit; ); - - shift = bytesShifted * 8; - - escapeFlag = headerByte & 0x1; - - chanBits = p->mConfig.bitDepth - (bytesShifted * 8) + 1; - - // check for partial frame length to override requested numSamples - if ( partialFrame != 0 ) - { - numSamples = BitBufferRead( bits, 16 ) << 16; - numSamples |= BitBufferRead( bits, 16 ); - } - - if ( escapeFlag == 0 ) - { - // compressed frame, read rest of parameters - mixBits = (uint8_t) BitBufferRead( bits, 8 ); - mixRes = (int8_t) BitBufferRead( bits, 8 ); - - headerByte = (uint8_t) BitBufferRead( bits, 8 ); - modeU = headerByte >> 4; - denShiftU = headerByte & 0xfu; - - headerByte = (uint8_t) BitBufferRead( bits, 8 ); - pbFactorU = headerByte >> 5; - numU = headerByte & 0x1fu; - for ( i = 0; i < numU; i++ ) - coefsU[i] = (int16_t) BitBufferRead( bits, 16 ); - - headerByte = (uint8_t) BitBufferRead( bits, 8 ); - modeV = headerByte >> 4; - denShiftV = headerByte & 0xfu; - - headerByte = (uint8_t) BitBufferRead( bits, 8 ); - pbFactorV = headerByte >> 5; - numV = headerByte & 0x1fu; - for ( i = 0; i < numV; i++ ) - coefsV[i] = (int16_t) BitBufferRead( bits, 16 ); - - // if shift active, skip the interleaved shifted values but remember where they start - if ( bytesShifted != 0 ) - { - shiftBits = *bits; - BitBufferAdvance( bits, (bytesShifted * 8) * 2 * numSamples ); - } - - // decompress and run predictor for "left" channel - set_ag_params( &agParams, p->mConfig.mb, (pb * pbFactorU) / 4, p->mConfig.kb, numSamples, numSamples, p->mConfig.maxRun ); - status = dyn_decomp( &agParams, bits, p->mPredictor, numSamples, chanBits, &bits1 ); - RequireNoErr( status, goto Exit; ); - - if ( modeU == 0 ) - { - unpc_block( p->mPredictor, p->mMixBufferU, numSamples, &coefsU[0], numU, chanBits, denShiftU ); - } - else - { - // the special "numActive == 31" mode can be done in-place - unpc_block( p->mPredictor, p->mPredictor, numSamples, NULL, 31, chanBits, 0 ); - unpc_block( p->mPredictor, p->mMixBufferU, numSamples, &coefsU[0], numU, chanBits, denShiftU ); - } - - // decompress and run predictor for "right" channel - set_ag_params( &agParams, p->mConfig.mb, (pb * pbFactorV) / 4, p->mConfig.kb, numSamples, numSamples, p->mConfig.maxRun ); - status = dyn_decomp( &agParams, bits, p->mPredictor, numSamples, chanBits, &bits2 ); - RequireNoErr( status, goto Exit; ); - - if ( modeV == 0 ) - { - unpc_block( p->mPredictor, p->mMixBufferV, numSamples, &coefsV[0], numV, chanBits, denShiftV ); - } - else - { - // the special "numActive == 31" mode can be done in-place - unpc_block( p->mPredictor, p->mPredictor, numSamples, NULL, 31, chanBits, 0 ); - unpc_block( p->mPredictor, p->mMixBufferV, numSamples, &coefsV[0], numV, chanBits, denShiftV ); - } - } - else - { - //Assert( bytesShifted == 0 ); - - // uncompressed frame, copy data into the mix buffers to use common output code - chanBits = p->mConfig.bitDepth; - shift = 32 - chanBits; - if ( chanBits <= 16 ) - { - for ( i = 0; i < numSamples; i++ ) - { - val = (int32_t) BitBufferRead( bits, (uint8_t) chanBits ); - val = (val << shift) >> shift; - p->mMixBufferU[i] = val; - - val = (int32_t) BitBufferRead( bits, (uint8_t) chanBits ); - val = (val << shift) >> shift; - p->mMixBufferV[i] = val; - } - } - else - { - // BitBufferRead() can't read more than 16 bits at a time so break up the reads - extraBits = chanBits - 16; - for ( i = 0; i < numSamples; i++ ) - { - val = (int32_t) BitBufferRead( bits, 16 ); - val = (val << 16) >> shift; - p->mMixBufferU[i] = val | BitBufferRead( bits, (uint8_t)extraBits ); - - val = (int32_t) BitBufferRead( bits, 16 ); - val = (val << 16) >> shift; - p->mMixBufferV[i] = val | BitBufferRead( bits, (uint8_t)extraBits ); - } - } - - bits1 = chanBits * numSamples; - bits2 = chanBits * numSamples; - mixBits = mixRes = 0; - bytesShifted = 0; - } - - // now read the shifted values into the shift buffer - if ( bytesShifted != 0 ) - { - shift = bytesShifted * 8; - //Assert( shift <= 16 ); - - for ( i = 0; i < (numSamples * 2); i += 2 ) - { - p->mShiftBuffer[i + 0] = (uint16_t) BitBufferRead( &shiftBits, (uint8_t) shift ); - p->mShiftBuffer[i + 1] = (uint16_t) BitBufferRead( &shiftBits, (uint8_t) shift ); - } - } - - // un-mix the data and convert to output format - // - note that mixRes = 0 means just interleave so we use that path for uncompressed frames - switch ( p->mConfig.bitDepth ) - { - case 16: - out32 = sampleBuffer + channelIndex; - unmix16( p->mMixBufferU, p->mMixBufferV, out32, numChannels, numSamples, mixBits, mixRes ); - break; - case 20: - out32 = sampleBuffer + channelIndex; - unmix20( p->mMixBufferU, p->mMixBufferV, out32, numChannels, numSamples, mixBits, mixRes ); - break; - case 24: - out32 = sampleBuffer + channelIndex; - unmix24( p->mMixBufferU, p->mMixBufferV, out32, numChannels, numSamples, - mixBits, mixRes, p->mShiftBuffer, bytesShifted ); - break; - case 32: - out32 = sampleBuffer + channelIndex; - unmix32( p->mMixBufferU, p->mMixBufferV, out32, numChannels, numSamples, - mixBits, mixRes, p->mShiftBuffer, bytesShifted ); - break; - } - - channelIndex += 2; - *outNumSamples = numSamples; - break; - } - - case ID_CCE: - case ID_PCE: - { - // unsupported element, bail - //AssertNoErr( tag ); - status = kALAC_ParamError; - break; - } - - case ID_DSE: - { - // data stream element -- parse but ignore - status = alac_data_stream_element (bits) ; - break; - } - - case ID_FIL: - { - // fill element -- parse but ignore - status = alac_fill_element (bits) ; - break; - } - - case ID_END: - { - // frame end, all done so byte align the frame and check for overruns - BitBufferByteAlign( bits, false ); - //Assert( bits->cur == bits->end ); - goto Exit; - } - } - -#if 0 // ! DEBUG - // if we've decoded all of our channels, bail (but not in debug b/c we want to know if we're seeing bad bits) - // - this also protects us if the config does not match the bitstream or crap data bits follow the audio bits - if ( channelIndex >= numChannels ) - break; -#endif - } - -NoMoreChannels: - - // if we get here and haven't decoded all of the requested channels, fill the remaining channels with zeros - for ( ; channelIndex < numChannels; channelIndex++ ) - { - int32_t * fill32 = sampleBuffer + channelIndex; - Zero32( fill32, numSamples, numChannels ); - } - -Exit: - return status; -} - -#if PRAGMA_MARK -#pragma mark - -#endif - -/* - FillElement() - - they're just filler so we don't need 'em -*/ -static int32_t -alac_fill_element (struct BitBuffer * bits) -{ - int16_t count; - - // 4-bit count or (4-bit + 8-bit count) if 4-bit count == 15 - // - plus this weird -1 thing I still don't fully understand - count = BitBufferReadSmall( bits, 4 ); - if ( count == 15 ) - count += (int16_t) BitBufferReadSmall( bits, 8 ) - 1; - - BitBufferAdvance( bits, count * 8 ); - - RequireAction( bits->cur <= bits->end, return kALAC_ParamError; ); - - return ALAC_noErr; -} - -/* - DataStreamElement() - - we don't care about data stream elements so just skip them -*/ -static int32_t -alac_data_stream_element (struct BitBuffer * bits) -{ - int32_t data_byte_align_flag; - uint16_t count; - - // the tag associates this data stream element with a given audio element - - /* element_instance_tag = */ BitBufferReadSmall( bits, 4 ); - - data_byte_align_flag = BitBufferReadOne( bits ); - - // 8-bit count or (8-bit + 8-bit count) if 8-bit count == 255 - count = BitBufferReadSmall( bits, 8 ); - if ( count == 255 ) - count += BitBufferReadSmall( bits, 8 ); - - // the align flag means the bitstream should be byte-aligned before reading the following data bytes - if ( data_byte_align_flag ) - BitBufferByteAlign( bits, false ); - - // skip the data bytes - BitBufferAdvance( bits, count * 8 ); - - RequireAction( bits->cur <= bits->end, return kALAC_ParamError; ); - - return ALAC_noErr; -} - -/* - ZeroN() - - helper routines to clear out output channel buffers when decoding fewer channels than requested -*/ -static void Zero32( int32_t * buffer, uint32_t numItems, uint32_t stride ) -{ - uint32_t indx; - - if ( stride == 1 ) - { - memset( buffer, 0, numItems * sizeof(int32_t) ); - } - else - { - for ( indx = 0; indx < (numItems * stride); indx += stride ) - buffer[indx] = 0; - } -} diff --git a/libs/libsndfile/src/ALAC/alac_decoder.h b/libs/libsndfile/src/ALAC/alac_decoder.h deleted file mode 100644 index 78f3cb29ca..0000000000 --- a/libs/libsndfile/src/ALAC/alac_decoder.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: alac_decoder.h -*/ - -#ifndef ALAC_DECODER_H -#define ALAC_DECODER_H - -#include - -#include "ALACAudioTypes.h" - -typedef enum -{ - false = 0, - ALAC_TRUE = 1 -} bool ; - -struct BitBuffer; - -typedef struct alac_decoder -{ - // decoding parameters (public for use in the analyzer) - ALACSpecificConfig mConfig; - - uint16_t mActiveElements; - - // decoding buffers - int32_t * mMixBufferU; - int32_t * mMixBufferV; - int32_t * mPredictor; - uint16_t * mShiftBuffer; // note: this points to mPredictor's memory but different - // variable for clarity and type difference -} alac_decoder ; - -alac_decoder * alac_decoder_new (void) ; -void alac_decoder_delete (alac_decoder *) ; - -int32_t alac_init (alac_decoder *p, void * inMagicCookie, uint32_t inMagicCookieSize) ; -int32_t alac_decode (alac_decoder *, struct BitBuffer * bits, uint8_t * sampleBuffer, uint32_t numSamples, uint32_t numChannels, uint32_t * outNumSamples) ; - -#endif /* ALAC_DECODER_H */ diff --git a/libs/libsndfile/src/ALAC/alac_encoder.c b/libs/libsndfile/src/ALAC/alac_encoder.c deleted file mode 100644 index 02210ee51b..0000000000 --- a/libs/libsndfile/src/ALAC/alac_encoder.c +++ /dev/null @@ -1,1342 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * Copyright (C) 2012-2013 Erik de Castro Lopo - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: ALACEncoder.cpp -*/ - -// build stuff -#define VERBOSE_DEBUG 0 -#define DebugMsg printf - -// headers -#include -#include -#include - -#include "sfendian.h" - -#include "alac_codec.h" - -#include "aglib.h" -#include "dplib.h" -#include "matrixlib.h" - -#include "ALACBitUtilities.h" -#include "ALACAudioTypes.h" -#include "EndianPortable.h" - -typedef enum -{ - false = 0, - true = 1 -} bool ; - -static void GetConfig(ALAC_ENCODER *p, ALACSpecificConfig * config ); - -static int32_t EncodeStereo(ALAC_ENCODER *p, struct BitBuffer * bitstream, int32_t * input, uint32_t stride, uint32_t channelIndex, uint32_t numSamples ); -static int32_t EncodeStereoFast(ALAC_ENCODER *p, struct BitBuffer * bitstream, int32_t * input, uint32_t stride, uint32_t channelIndex, uint32_t numSamples ); -static int32_t EncodeStereoEscape(ALAC_ENCODER *p, struct BitBuffer * bitstream, int32_t * input, uint32_t stride, uint32_t numSamples ); -static int32_t EncodeMono(ALAC_ENCODER *p, struct BitBuffer * bitstream, int32_t * input, uint32_t stride, uint32_t channelIndex, uint32_t numSamples ); - - - -// Note: in C you can't typecast to a 2-dimensional array pointer but that's what we need when -// picking which coefs to use so we declare this typedef b/c we *can* typecast to this type -typedef int16_t (*SearchCoefs)[kALACMaxCoefs]; - -// defines/constants -const uint32_t kALACEncoderMagic = MAKE_MARKER ('d', 'p', 'g', 'e'); -const uint32_t kMaxSampleSize = 32; // max allowed bit width is 32 -const uint32_t kDefaultMixBits = 2; -const uint32_t kDefaultMixRes = 0; -const uint32_t kMaxRes = 4; -const uint32_t kDefaultNumUV = 8; -const uint32_t kMinUV = 4; -const uint32_t kMaxUV = 8; - -// static functions -#if VERBOSE_DEBUG -static void AddFiller( BitBuffer * bits, int32_t numBytes ); -#endif - - -/* - Map Format: 3-bit field per channel which is the same as the "element tag" that should be placed - at the beginning of the frame for that channel. Indicates whether SCE, CPE, or LFE. - Each particular field is accessed via the current channel indx. Note that the channel - indx increments by two for channel pairs. - - For example: - - C L R 3-channel input = (ID_CPE << 3) | (ID_SCE) - indx 0 value = (map & (0x7ul << (0 * 3))) >> (0 * 3) - indx 1 value = (map & (0x7ul << (1 * 3))) >> (1 * 3) - - C L R Ls Rs LFE 5.1-channel input = (ID_LFE << 15) | (ID_CPE << 9) | (ID_CPE << 3) | (ID_SCE) - indx 0 value = (map & (0x7ul << (0 * 3))) >> (0 * 3) - indx 1 value = (map & (0x7ul << (1 * 3))) >> (1 * 3) - indx 3 value = (map & (0x7ul << (3 * 3))) >> (3 * 3) - indx 5 value = (map & (0x7ul << (5 * 3))) >> (5 * 3) - indx 7 value = (map & (0x7ul << (7 * 3))) >> (7 * 3) -*/ -static const uint32_t sChannelMaps[kALACMaxChannels] = -{ - ID_SCE, - ID_CPE, - (ID_CPE << 3) | (ID_SCE), - (ID_SCE << 9) | (ID_CPE << 3) | (ID_SCE), - (ID_CPE << 9) | (ID_CPE << 3) | (ID_SCE), - (ID_SCE << 15) | (ID_CPE << 9) | (ID_CPE << 3) | (ID_SCE), - (ID_SCE << 18) | (ID_SCE << 15) | (ID_CPE << 9) | (ID_CPE << 3) | (ID_SCE), - (ID_SCE << 21) | (ID_CPE << 15) | (ID_CPE << 9) | (ID_CPE << 3) | (ID_SCE) -}; - -static const uint32_t sSupportediPodSampleRates[] = -{ - 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 -}; - - -#if PRAGMA_MARK -#pragma mark - -#endif - -void -alac_set_fastmode (ALAC_ENCODER * p, int32_t fast ) -{ - p->mFastMode = fast; -} - - -/* - HEADER SPECIFICATION - - For every segment we adopt the following header: - - 1 byte reserved (always 0) - 1 byte flags (see below) - [4 byte frame length] (optional, see below) - ---Next, the per-segment ALAC parameters--- - 1 byte mixBits (middle-side parameter) - 1 byte mixRes (middle-side parameter, interpreted as signed char) - - 1 byte shiftU (4 bits modeU, 4 bits denShiftU) - 1 byte filterU (3 bits pbFactorU, 5 bits numU) - (numU) shorts (signed DP coefficients for V channel) - ---Next, 2nd-channel ALAC parameters in case of stereo mode--- - 1 byte shiftV (4 bits modeV, 4 bits denShiftV) - 1 byte filterV (3 bits pbFactorV, 5 bits numV) - (numV) shorts (signed DP coefficients for V channel) - ---After this come the shift-off bytes for (>= 24)-bit data (n-byte shift) if indicated--- - ---Then comes the AG-compressor bitstream--- - - - FLAGS - ----- - - The presence of certain flag bits changes the header format such that the parameters might - not even be sent. The currently defined flags format is: - - 0000psse - - where 0 = reserved, must be 0 - p = 1-bit field "partial frame" flag indicating 32-bit frame length follows this byte - ss = 2-bit field indicating "number of shift-off bytes ignored by compression" - e = 1-bit field indicating "escape" - - The "partial frame" flag means that the following segment is not equal to the frame length specified - in the out-of-band decoder configuration. This allows the decoder to deal with end-of-file partial - segments without incurring the 32-bit overhead for each segment. - - The "shift-off" field indicates the number of bytes at the bottom of the word that were passed through - uncompressed. The reason for this is that the entropy inherent in the LS bytes of >= 24-bit words - quite often means that the frame would have to be "escaped" b/c the compressed size would be >= the - uncompressed size. However, by shifting the input values down and running the remaining bits through - the normal compression algorithm, a net win can be achieved. If this field is non-zero, it means that - the shifted-off bytes follow after the parameter section of the header and before the compressed - bitstream. Note that doing this also allows us to use matrixing on 32-bit inputs after one or more - bytes are shifted off the bottom which helps the eventual compression ratio. For stereo channels, - the shifted off bytes are interleaved. - - The "escape" flag means that this segment was not compressed b/c the compressed size would be - >= uncompressed size. In that case, the audio data was passed through uncompressed after the header. - The other header parameter bytes will not be sent. - - - PARAMETERS - ---------- - - If the segment is not a partial or escape segment, the total header size (in bytes) is given exactly by: - - 4 + (2 + 2 * numU) (mono mode) - 4 + (2 + 2 * numV) + (2 + 2 * numV) (stereo mode) - - where the ALAC filter-lengths numU, numV are bounded by a - constant (in the current source, numU, numV <= NUMCOEPAIRS), and - this forces an absolute upper bound on header size. - - Each segment-decode process loads up these bytes from the front of the - local stream, in the above order, then follows with the entropy-encoded - bits for the given segment. - - To generalize middle-side, there are various mixing modes including middle-side, each lossless, - as embodied in the mix() and unmix() functions. These functions exploit a generalized middle-side - transformation: - - u := [(rL + (m-r)R)/m]; - v := L - R; - - where [ ] denotes integer floor. The (lossless) inverse is - - L = u + v - [rV/m]; - R = L - v; - - In the segment header, m and r are encoded in mixBits and mixRes. - Classical "middle-side" is obtained with m = 2, r = 1, but now - we have more generalized mixes. - - NOTES - ----- - The relevance of the ALAC coefficients is explained in detail - in patent documents. -*/ - -/* - EncodeStereo() - - encode a channel pair -*/ -static int32_t -EncodeStereo(ALAC_ENCODER *p, struct BitBuffer * bitstream, int32_t * inputBuffer, uint32_t stride, uint32_t channelIndex, uint32_t numSamples ) -{ - BitBuffer workBits; - BitBuffer startBits = *bitstream; // squirrel away copy of current state in case we need to go back and do an escape packet - AGParamRec agParams; - uint32_t bits1, bits2; - uint32_t dilate; - int32_t mixBits, mixRes, maxRes; - uint32_t minBits, minBits1, minBits2; - uint32_t numU, numV; - uint32_t mode; - uint32_t pbFactor; - uint32_t chanBits; - uint8_t bytesShifted; - SearchCoefs coefsU; - SearchCoefs coefsV; - uint32_t indx; - uint8_t partialFrame; - uint32_t escapeBits; - bool doEscape; - int32_t status = ALAC_noErr; - int32_t bestRes; - uint32_t numUV, converge; - - // make sure we handle this bit-depth before we get going - RequireAction( (p->mBitDepth == 16) || (p->mBitDepth == 20) || (p->mBitDepth == 24) || (p->mBitDepth == 32), return kALAC_ParamError; ); - - // reload coefs pointers for this channel pair - // - note that, while you might think they should be re-initialized per block, retaining state across blocks - // actually results in better overall compression - // - strangely, re-using the same coefs for the different passes of the "mixRes" search loop instead of using - // different coefs for the different passes of "mixRes" results in even better compression - coefsU = (SearchCoefs) p->mCoefsU[channelIndex]; - coefsV = (SearchCoefs) p->mCoefsV[channelIndex]; - - // matrix encoding adds an extra bit but 32-bit inputs cannot be matrixed b/c 33 is too many - // so enable 16-bit "shift off" and encode in 17-bit mode - // - in addition, 24-bit mode really improves with one byte shifted off - if ( p->mBitDepth == 32 ) - bytesShifted = 2; - else if ( p->mBitDepth >= 24 ) - bytesShifted = 1; - else - bytesShifted = 0; - - chanBits = p->mBitDepth - (bytesShifted * 8) + 1; - - // flag whether or not this is a partial frame - partialFrame = (numSamples == p->mFrameSize) ? 0 : 1; - - // brute-force encode optimization loop - // - run over variations of the encoding params to find the best choice - mixBits = kDefaultMixBits; - maxRes = kMaxRes; - numU = numV = kDefaultNumUV; - mode = 0; - pbFactor = 4; - dilate = 8; - - minBits = minBits1 = minBits2 = 1ul << 31; - - bestRes = p->mLastMixRes[channelIndex]; - - for ( mixRes = 0; mixRes <= maxRes; mixRes++ ) - { - // mix the stereo inputs - switch ( p->mBitDepth ) - { - case 16: - mix16( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples/dilate, mixBits, mixRes ); - break; - case 20: - mix20( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples/dilate, mixBits, mixRes ); - break; - case 24: - // includes extraction of shifted-off bytes - mix24( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples/dilate, - mixBits, mixRes, p->mShiftBufferUV, bytesShifted ); - break; - case 32: - // includes extraction of shifted-off bytes - mix32( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples/dilate, - mixBits, mixRes, p->mShiftBufferUV, bytesShifted ); - break; - } - - BitBufferInit( &workBits, p->mWorkBuffer, p->mMaxOutputBytes ); - - // run the dynamic predictors - pc_block( p->mMixBufferU, p->mPredictorU, numSamples/dilate, coefsU[numU - 1], numU, chanBits, DENSHIFT_DEFAULT ); - pc_block( p->mMixBufferV, p->mPredictorV, numSamples/dilate, coefsV[numV - 1], numV, chanBits, DENSHIFT_DEFAULT ); - - // run the lossless compressor on each channel - set_ag_params( &agParams, MB0, (pbFactor * PB0) / 4, KB0, numSamples/dilate, numSamples/dilate, MAX_RUN_DEFAULT ); - status = dyn_comp( &agParams, p->mPredictorU, &workBits, numSamples/dilate, chanBits, &bits1 ); - RequireNoErr( status, goto Exit; ); - - set_ag_params( &agParams, MB0, (pbFactor * PB0) / 4, KB0, numSamples/dilate, numSamples/dilate, MAX_RUN_DEFAULT ); - status = dyn_comp( &agParams, p->mPredictorV, &workBits, numSamples/dilate, chanBits, &bits2 ); - RequireNoErr( status, goto Exit; ); - - // look for best match - if ( (bits1 + bits2) < minBits1 ) - { - minBits1 = bits1 + bits2; - bestRes = mixRes; - } - } - - p->mLastMixRes[channelIndex] = (int16_t)bestRes; - - // mix the stereo inputs with the current best mixRes - mixRes = p->mLastMixRes[channelIndex]; - switch ( p->mBitDepth ) - { - case 16: - mix16( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples, mixBits, mixRes ); - break; - case 20: - mix20( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples, mixBits, mixRes ); - break; - case 24: - // also extracts the shifted off bytes into the shift buffers - mix24( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples, - mixBits, mixRes, p->mShiftBufferUV, bytesShifted ); - break; - case 32: - // also extracts the shifted off bytes into the shift buffers - mix32( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples, - mixBits, mixRes, p->mShiftBufferUV, bytesShifted ); - break; - } - - // now it's time for the predictor coefficient search loop - numU = numV = kMinUV; - minBits1 = minBits2 = 1ul << 31; - - for ( numUV = kMinUV; numUV <= kMaxUV; numUV += 4 ) - { - BitBufferInit( &workBits, p->mWorkBuffer, p->mMaxOutputBytes ); - - dilate = 32; - - // run the predictor over the same data multiple times to help it converge - for ( converge = 0; converge < 8; converge++ ) - { - pc_block( p->mMixBufferU, p->mPredictorU, numSamples/dilate, coefsU[numUV-1], numUV, chanBits, DENSHIFT_DEFAULT ); - pc_block( p->mMixBufferV, p->mPredictorV, numSamples/dilate, coefsV[numUV-1], numUV, chanBits, DENSHIFT_DEFAULT ); - } - - dilate = 8; - - set_ag_params( &agParams, MB0, (pbFactor * PB0)/4, KB0, numSamples/dilate, numSamples/dilate, MAX_RUN_DEFAULT ); - status = dyn_comp( &agParams, p->mPredictorU, &workBits, numSamples/dilate, chanBits, &bits1 ); - - if ( (bits1 * dilate + 16 * numUV) < minBits1 ) - { - minBits1 = bits1 * dilate + 16 * numUV; - numU = numUV; - } - - set_ag_params( &agParams, MB0, (pbFactor * PB0)/4, KB0, numSamples/dilate, numSamples/dilate, MAX_RUN_DEFAULT ); - status = dyn_comp( &agParams, p->mPredictorV, &workBits, numSamples/dilate, chanBits, &bits2 ); - - if ( (bits2 * dilate + 16 * numUV) < minBits2 ) - { - minBits2 = bits2 * dilate + 16 * numUV; - numV = numUV; - } - } - - // test for escape hatch if best calculated compressed size turns out to be more than the input size - minBits = minBits1 + minBits2 + (8 /* mixRes/maxRes/etc. */ * 8) + ((partialFrame == true) ? 32 : 0); - if ( bytesShifted != 0 ) - minBits += (numSamples * (bytesShifted * 8) * 2); - - escapeBits = (numSamples * p->mBitDepth * 2) + ((partialFrame == true) ? 32 : 0) + (2 * 8); /* 2 common header bytes */ - - doEscape = (minBits >= escapeBits) ? true : false; - - if ( doEscape == false ) - { - // write bitstream header and coefs - BitBufferWrite( bitstream, 0, 12 ); - BitBufferWrite( bitstream, (partialFrame << 3) | (bytesShifted << 1), 4 ); - if ( partialFrame ) - BitBufferWrite( bitstream, numSamples, 32 ); - BitBufferWrite( bitstream, mixBits, 8 ); - BitBufferWrite( bitstream, mixRes, 8 ); - - //Assert( (mode < 16) && (DENSHIFT_DEFAULT < 16) ); - //Assert( (pbFactor < 8) && (numU < 32) ); - //Assert( (pbFactor < 8) && (numV < 32) ); - - BitBufferWrite( bitstream, (mode << 4) | DENSHIFT_DEFAULT, 8 ); - BitBufferWrite( bitstream, (pbFactor << 5) | numU, 8 ); - for ( indx = 0; indx < numU; indx++ ) - BitBufferWrite( bitstream, coefsU[numU - 1][indx], 16 ); - - BitBufferWrite( bitstream, (mode << 4) | DENSHIFT_DEFAULT, 8 ); - BitBufferWrite( bitstream, (pbFactor << 5) | numV, 8 ); - for ( indx = 0; indx < numV; indx++ ) - BitBufferWrite( bitstream, coefsV[numV - 1][indx], 16 ); - - // if shift active, write the interleaved shift buffers - if ( bytesShifted != 0 ) - { - uint32_t bitShift = bytesShifted * 8; - - //Assert( bitShift <= 16 ); - - for ( indx = 0; indx < (numSamples * 2); indx += 2 ) - { - uint32_t shiftedVal; - - shiftedVal = ((uint32_t) p->mShiftBufferUV[indx + 0] << bitShift) | (uint32_t) p->mShiftBufferUV[indx + 1]; - BitBufferWrite( bitstream, shiftedVal, bitShift * 2 ); - } - } - - // run the dynamic predictor and lossless compression for the "left" channel - // - note: to avoid allocating more buffers, we're mixing and matching between the available buffers instead - // of only using "U" buffers for the U-channel and "V" buffers for the V-channel - if ( mode == 0 ) - { - pc_block( p->mMixBufferU, p->mPredictorU, numSamples, coefsU[numU - 1], numU, chanBits, DENSHIFT_DEFAULT ); - } - else - { - pc_block( p->mMixBufferU, p->mPredictorV, numSamples, coefsU[numU - 1], numU, chanBits, DENSHIFT_DEFAULT ); - pc_block( p->mPredictorV, p->mPredictorU, numSamples, NULL, 31, chanBits, 0 ); - } - - set_ag_params( &agParams, MB0, (pbFactor * PB0) / 4, KB0, numSamples, numSamples, MAX_RUN_DEFAULT ); - status = dyn_comp( &agParams, p->mPredictorU, bitstream, numSamples, chanBits, &bits1 ); - RequireNoErr( status, goto Exit; ); - - // run the dynamic predictor and lossless compression for the "right" channel - if ( mode == 0 ) - { - pc_block( p->mMixBufferV, p->mPredictorV, numSamples, coefsV[numV - 1], numV, chanBits, DENSHIFT_DEFAULT ); - } - else - { - pc_block( p->mMixBufferV, p->mPredictorU, numSamples, coefsV[numV - 1], numV, chanBits, DENSHIFT_DEFAULT ); - pc_block( p->mPredictorU, p->mPredictorV, numSamples, NULL, 31, chanBits, 0 ); - } - - set_ag_params( &agParams, MB0, (pbFactor * PB0) / 4, KB0, numSamples, numSamples, MAX_RUN_DEFAULT ); - status = dyn_comp( &agParams, p->mPredictorV, bitstream, numSamples, chanBits, &bits2 ); - RequireNoErr( status, goto Exit; ); - - /* if we happened to create a compressed packet that was actually bigger than an escape packet would be, - chuck it and do an escape packet - */ - minBits = BitBufferGetPosition( bitstream ) - BitBufferGetPosition( &startBits ); - if ( minBits >= escapeBits ) - { - *bitstream = startBits; // reset bitstream state - doEscape = true; - printf( "compressed frame too big: %u vs. %u \n", minBits, escapeBits ); - } - } - - if ( doEscape == true ) - { - /* escape */ - status = EncodeStereoEscape(p, bitstream, inputBuffer, stride, numSamples ); - -#if VERBOSE_DEBUG - DebugMsg( "escape!: %u vs %u\n", minBits, escapeBits ); -#endif - } - -Exit: - return status; -} - -/* - EncodeStereoFast() - - encode a channel pair without the search loop for maximum possible speed -*/ -static int32_t -EncodeStereoFast(ALAC_ENCODER *p, struct BitBuffer * bitstream, int32_t * inputBuffer, uint32_t stride, uint32_t channelIndex, uint32_t numSamples ) -{ - BitBuffer startBits = *bitstream; // squirrel away current bit position in case we decide to use escape hatch - AGParamRec agParams; - uint32_t bits1, bits2; - int32_t mixBits, mixRes; - uint32_t minBits, minBits1, minBits2; - uint32_t numU, numV; - uint32_t mode; - uint32_t pbFactor; - uint32_t chanBits; - uint8_t bytesShifted; - SearchCoefs coefsU; - SearchCoefs coefsV; - uint32_t indx; - uint8_t partialFrame; - uint32_t escapeBits; - bool doEscape; - int32_t status; - - // make sure we handle this bit-depth before we get going - RequireAction( (p->mBitDepth == 16) || (p->mBitDepth == 20) || (p->mBitDepth == 24) || (p->mBitDepth == 32), return kALAC_ParamError; ); - - // reload coefs pointers for this channel pair - // - note that, while you might think they should be re-initialized per block, retaining state across blocks - // actually results in better overall compression - // - strangely, re-using the same coefs for the different passes of the "mixRes" search loop instead of using - // different coefs for the different passes of "mixRes" results in even better compression - coefsU = (SearchCoefs) p->mCoefsU[channelIndex]; - coefsV = (SearchCoefs) p->mCoefsV[channelIndex]; - - // matrix encoding adds an extra bit but 32-bit inputs cannot be matrixed b/c 33 is too many - // so enable 16-bit "shift off" and encode in 17-bit mode - // - in addition, 24-bit mode really improves with one byte shifted off - if ( p->mBitDepth == 32 ) - bytesShifted = 2; - else if ( p->mBitDepth >= 24 ) - bytesShifted = 1; - else - bytesShifted = 0; - - chanBits = p->mBitDepth - (bytesShifted * 8) + 1; - - // flag whether or not this is a partial frame - partialFrame = (numSamples == p->mFrameSize) ? 0 : 1; - - // set up default encoding parameters for "fast" mode - mixBits = kDefaultMixBits; - mixRes = kDefaultMixRes; - numU = numV = kDefaultNumUV; - mode = 0; - pbFactor = 4; - - minBits = minBits1 = minBits2 = 1ul << 31; - - // mix the stereo inputs with default mixBits/mixRes - switch ( p->mBitDepth ) - { - case 16: - mix16( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples, mixBits, mixRes ); - break; - case 20: - mix20( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples, mixBits, mixRes ); - break; - case 24: - // also extracts the shifted off bytes into the shift buffers - mix24( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples, - mixBits, mixRes, p->mShiftBufferUV, bytesShifted ); - break; - case 32: - // also extracts the shifted off bytes into the shift buffers - mix32( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples, - mixBits, mixRes, p->mShiftBufferUV, bytesShifted ); - break; - } - - /* speculatively write the bitstream assuming the compressed version will be smaller */ - - // write bitstream header and coefs - BitBufferWrite( bitstream, 0, 12 ); - BitBufferWrite( bitstream, (partialFrame << 3) | (bytesShifted << 1), 4 ); - if ( partialFrame ) - BitBufferWrite( bitstream, numSamples, 32 ); - BitBufferWrite( bitstream, mixBits, 8 ); - BitBufferWrite( bitstream, mixRes, 8 ); - - //Assert( (mode < 16) && (DENSHIFT_DEFAULT < 16) ); - //Assert( (pbFactor < 8) && (numU < 32) ); - //Assert( (pbFactor < 8) && (numV < 32) ); - - BitBufferWrite( bitstream, (mode << 4) | DENSHIFT_DEFAULT, 8 ); - BitBufferWrite( bitstream, (pbFactor << 5) | numU, 8 ); - for ( indx = 0; indx < numU; indx++ ) - BitBufferWrite( bitstream, coefsU[numU - 1][indx], 16 ); - - BitBufferWrite( bitstream, (mode << 4) | DENSHIFT_DEFAULT, 8 ); - BitBufferWrite( bitstream, (pbFactor << 5) | numV, 8 ); - for ( indx = 0; indx < numV; indx++ ) - BitBufferWrite( bitstream, coefsV[numV - 1][indx], 16 ); - - // if shift active, write the interleaved shift buffers - if ( bytesShifted != 0 ) - { - uint32_t bitShift = bytesShifted * 8; - - //Assert( bitShift <= 16 ); - - for ( indx = 0; indx < (numSamples * 2); indx += 2 ) - { - uint32_t shiftedVal; - - shiftedVal = ((uint32_t) p->mShiftBufferUV[indx + 0] << bitShift) | (uint32_t) p->mShiftBufferUV[indx + 1]; - BitBufferWrite( bitstream, shiftedVal, bitShift * 2 ); - } - } - - // run the dynamic predictor and lossless compression for the "left" channel - // - note: we always use mode 0 in the "fast" path so we don't need the code for mode != 0 - pc_block( p->mMixBufferU, p->mPredictorU, numSamples, coefsU[numU - 1], numU, chanBits, DENSHIFT_DEFAULT ); - - set_ag_params( &agParams, MB0, (pbFactor * PB0) / 4, KB0, numSamples, numSamples, MAX_RUN_DEFAULT ); - status = dyn_comp( &agParams, p->mPredictorU, bitstream, numSamples, chanBits, &bits1 ); - RequireNoErr( status, goto Exit; ); - - // run the dynamic predictor and lossless compression for the "right" channel - pc_block( p->mMixBufferV, p->mPredictorV, numSamples, coefsV[numV - 1], numV, chanBits, DENSHIFT_DEFAULT ); - - set_ag_params( &agParams, MB0, (pbFactor * PB0) / 4, KB0, numSamples, numSamples, MAX_RUN_DEFAULT ); - status = dyn_comp( &agParams, p->mPredictorV, bitstream, numSamples, chanBits, &bits2 ); - RequireNoErr( status, goto Exit; ); - - // do bit requirement calculations - minBits1 = bits1 + (numU * sizeof(int16_t) * 8); - minBits2 = bits2 + (numV * sizeof(int16_t) * 8); - - // test for escape hatch if best calculated compressed size turns out to be more than the input size - minBits = minBits1 + minBits2 + (8 /* mixRes/maxRes/etc. */ * 8) + ((partialFrame == true) ? 32 : 0); - if ( bytesShifted != 0 ) - minBits += (numSamples * (bytesShifted * 8) * 2); - - escapeBits = (numSamples * p->mBitDepth * 2) + ((partialFrame == true) ? 32 : 0) + (2 * 8); /* 2 common header bytes */ - - doEscape = (minBits >= escapeBits) ? true : false; - - if ( doEscape == false ) - { - /* if we happened to create a compressed packet that was actually bigger than an escape packet would be, - chuck it and do an escape packet - */ - minBits = BitBufferGetPosition( bitstream ) - BitBufferGetPosition( &startBits ); - if ( minBits >= escapeBits ) - { - doEscape = true; - printf( "compressed frame too big: %u vs. %u\n", minBits, escapeBits ); - } - - } - - if ( doEscape == true ) - { - /* escape */ - - // reset bitstream position since we speculatively wrote the compressed version - *bitstream = startBits; - - // write escape frame - status = EncodeStereoEscape(p, bitstream, inputBuffer, stride, numSamples ); - -#if VERBOSE_DEBUG - DebugMsg( "escape!: %u vs %u\n", minBits, (numSamples * p->mBitDepth * 2) ); -#endif - } - -Exit: - return status; -} - -/* - EncodeStereoEscape() - - encode stereo escape frame -*/ -static int32_t -EncodeStereoEscape(ALAC_ENCODER *p, struct BitBuffer * bitstream, int32_t * inputBuffer, uint32_t stride, uint32_t numSamples ) -{ - uint8_t partialFrame; - uint32_t indx; - - // flag whether or not this is a partial frame - partialFrame = (numSamples == p->mFrameSize) ? 0 : 1; - - // write bitstream header - BitBufferWrite( bitstream, 0, 12 ); - BitBufferWrite( bitstream, (partialFrame << 3) | 1, 4 ); // LSB = 1 means "frame not compressed" - if ( partialFrame ) - BitBufferWrite( bitstream, numSamples, 32 ); - - // just copy the input data to the output buffer - switch ( p->mBitDepth ) - { - case 16: - for ( indx = 0; indx < (numSamples * stride); indx += stride ) - { - BitBufferWrite( bitstream, inputBuffer[indx + 0] >> 16, 16 ); - BitBufferWrite( bitstream, inputBuffer[indx + 1] >> 16, 16 ); - } - break; - case 20: - for ( indx = 0; indx < (numSamples * stride); indx += stride ) - { - BitBufferWrite( bitstream, inputBuffer[indx + 0] >> 12, 16 ); - BitBufferWrite( bitstream, inputBuffer[indx + 1] >> 12, 16 ); - } - break; - case 24: - // mix24() with mixres param = 0 means de-interleave so use it to simplify things - mix24( inputBuffer, stride, p->mMixBufferU, p->mMixBufferV, numSamples, 0, 0, p->mShiftBufferUV, 0 ); - for ( indx = 0; indx < numSamples; indx++ ) - { - BitBufferWrite( bitstream, p->mMixBufferU[indx] >> 8, 24 ); - BitBufferWrite( bitstream, p->mMixBufferV[indx] >> 8, 24 ); - } - break; - case 32: - for ( indx = 0; indx < (numSamples * stride); indx += stride ) - { - BitBufferWrite( bitstream, inputBuffer[indx + 0], 32 ); - BitBufferWrite( bitstream, inputBuffer[indx + 1], 32 ); - } - break; - } - - return ALAC_noErr; -} - -/* - EncodeMono() - - encode a mono input buffer -*/ -static int32_t -EncodeMono(ALAC_ENCODER *p, struct BitBuffer * bitstream, int32_t * inputBuffer, uint32_t stride, uint32_t channelIndex, uint32_t numSamples ) -{ - BitBuffer startBits = *bitstream; // squirrel away copy of current state in case we need to go back and do an escape packet - AGParamRec agParams; - uint32_t bits1; - uint32_t numU; - SearchCoefs coefsU; - uint32_t dilate; - uint32_t minBits, bestU; - uint32_t minU, maxU; - uint32_t indx, indx2; - uint8_t bytesShifted; - uint32_t shift; - uint32_t mask; - uint32_t chanBits; - uint8_t pbFactor; - uint8_t partialFrame; - uint32_t escapeBits; - bool doEscape; - int32_t status = ALAC_noErr; - uint32_t converge; - - - // make sure we handle this bit-depth before we get going - RequireAction( (p->mBitDepth == 16) || (p->mBitDepth == 20) || (p->mBitDepth == 24) || (p->mBitDepth == 32), return kALAC_ParamError; ); - - // reload coefs array from previous frame - coefsU = (SearchCoefs) p->mCoefsU[channelIndex]; - - // pick bit depth for actual encoding - // - we lop off the lower byte(s) for 24-/32-bit encodings - if ( p->mBitDepth == 32 ) - bytesShifted = 2; - else if ( p->mBitDepth >= 24 ) - bytesShifted = 1; - else - bytesShifted = 0; - - shift = bytesShifted * 8; - mask = (1ul << shift) - 1; - chanBits = p->mBitDepth - (bytesShifted * 8); - - // flag whether or not this is a partial frame - partialFrame = (numSamples == p->mFrameSize) ? 0 : 1; - - // convert N-bit data to 32-bit for predictor - switch ( p->mBitDepth ) - { - case 16: - // convert 16-bit data to 32-bit for predictor - for ( indx = 0, indx2 = 0; indx < numSamples; indx++, indx2 += stride ) - p->mMixBufferU[indx] = inputBuffer[indx2] >> 16; - break; - - case 20: - // convert 20-bit data to 32-bit for predictor - for ( indx = 0, indx2 = 0; indx < numSamples; indx++, indx2 += stride ) - p->mMixBufferU[indx] = inputBuffer[indx2] >> 12; - break; - case 24: - // convert 24-bit data to 32-bit for the predictor and extract the shifted off byte(s) - for ( indx = 0, indx2 = 0; indx < numSamples; indx++, indx2 += stride ) - { - p->mMixBufferU[indx] = inputBuffer[indx2] >> 8; - p->mShiftBufferUV[indx] = (uint16_t)(p->mMixBufferU[indx] & mask); - p->mMixBufferU[indx] >>= shift; - } - - break; - case 32: - // just copy the 32-bit input data for the predictor and extract the shifted off byte(s) - for ( indx = 0, indx2 = 0; indx < numSamples; indx++, indx2 += stride ) - { - p->mShiftBufferUV[indx] = (uint16_t)(inputBuffer[indx2] & mask); - p->mMixBufferU[indx] = inputBuffer[indx2] >> shift; - } - break; - } - - // brute-force encode optimization loop (implied "encode depth" of 0 if comparing to cmd line tool) - // - run over variations of the encoding params to find the best choice - minU = 4; - maxU = 8; - minBits = 1ul << 31; - pbFactor = 4; - - bestU = minU; - - for ( numU = minU; numU <= maxU; numU += 4 ) - { - BitBuffer workBits; - uint32_t numBits; - - BitBufferInit( &workBits, p->mWorkBuffer, p->mMaxOutputBytes ); - - dilate = 32; - for ( converge = 0; converge < 7; converge++ ) - pc_block( p->mMixBufferU, p->mPredictorU, numSamples/dilate, coefsU[numU-1], numU, chanBits, DENSHIFT_DEFAULT ); - - dilate = 8; - pc_block( p->mMixBufferU, p->mPredictorU, numSamples/dilate, coefsU[numU-1], numU, chanBits, DENSHIFT_DEFAULT ); - - set_ag_params( &agParams, MB0, (pbFactor * PB0) / 4, KB0, numSamples/dilate, numSamples/dilate, MAX_RUN_DEFAULT ); - status = dyn_comp( &agParams, p->mPredictorU, &workBits, numSamples/dilate, chanBits, &bits1 ); - RequireNoErr( status, goto Exit; ); - - numBits = (dilate * bits1) + (16 * numU); - if ( numBits < minBits ) - { - bestU = numU; - minBits = numBits; - } - } - - // test for escape hatch if best calculated compressed size turns out to be more than the input size - // - first, add bits for the header bytes mixRes/maxRes/shiftU/filterU - minBits += (4 /* mixRes/maxRes/etc. */ * 8) + ((partialFrame == true) ? 32 : 0); - if ( bytesShifted != 0 ) - minBits += (numSamples * (bytesShifted * 8)); - - escapeBits = (numSamples * p->mBitDepth) + ((partialFrame == true) ? 32 : 0) + (2 * 8); /* 2 common header bytes */ - - doEscape = (minBits >= escapeBits) ? true : false; - - if ( doEscape == false ) - { - // write bitstream header - BitBufferWrite( bitstream, 0, 12 ); - BitBufferWrite( bitstream, (partialFrame << 3) | (bytesShifted << 1), 4 ); - if ( partialFrame ) - BitBufferWrite( bitstream, numSamples, 32 ); - BitBufferWrite( bitstream, 0, 16 ); // mixBits = mixRes = 0 - - // write the params and predictor coefs - numU = bestU; - BitBufferWrite( bitstream, (0 << 4) | DENSHIFT_DEFAULT, 8 ); // modeU = 0 - BitBufferWrite( bitstream, (pbFactor << 5) | numU, 8 ); - for ( indx = 0; indx < numU; indx++ ) - BitBufferWrite( bitstream, coefsU[numU-1][indx], 16 ); - - // if shift active, write the interleaved shift buffers - if ( bytesShifted != 0 ) - { - for ( indx = 0; indx < numSamples; indx++ ) - BitBufferWrite( bitstream, p->mShiftBufferUV[indx], shift ); - } - - // run the dynamic predictor with the best result - pc_block( p->mMixBufferU, p->mPredictorU, numSamples, coefsU[numU-1], numU, chanBits, DENSHIFT_DEFAULT ); - - // do lossless compression - set_standard_ag_params( &agParams, numSamples, numSamples ); - status = dyn_comp( &agParams, p->mPredictorU, bitstream, numSamples, chanBits, &bits1 ); - //AssertNoErr( status ); - - - /* if we happened to create a compressed packet that was actually bigger than an escape packet would be, - chuck it and do an escape packet - */ - minBits = BitBufferGetPosition( bitstream ) - BitBufferGetPosition( &startBits ); - if ( minBits >= escapeBits ) - { - *bitstream = startBits; // reset bitstream state - doEscape = true; - printf( "compressed frame too big: %u vs. %u\n", minBits, escapeBits ); - } - } - - if ( doEscape == true ) - { - // write bitstream header and coefs - BitBufferWrite( bitstream, 0, 12 ); - BitBufferWrite( bitstream, (partialFrame << 3) | 1, 4 ); // LSB = 1 means "frame not compressed" - if ( partialFrame ) - BitBufferWrite( bitstream, numSamples, 32 ); - - // just copy the input data to the output buffer - switch ( p->mBitDepth ) - { - case 16: - for ( indx = 0; indx < (numSamples * stride); indx += stride ) - BitBufferWrite( bitstream, inputBuffer[indx] >> 16, 16 ); - break; - case 20: - // convert 20-bit data to 32-bit for simplicity - for ( indx = 0; indx < (numSamples * stride); indx += stride ) - BitBufferWrite( bitstream, inputBuffer[indx] >> 12, 20 ); - break; - case 24: - // convert 24-bit data to 32-bit for simplicity - for ( indx = 0, indx2 = 0; indx < numSamples; indx++, indx2 += stride ) - { - p->mMixBufferU[indx] = inputBuffer[indx2] >> 8; - BitBufferWrite( bitstream, p->mMixBufferU[indx], 24 ); - } - break; - case 32: - for ( indx = 0; indx < (numSamples * stride); indx += stride ) - BitBufferWrite( bitstream, inputBuffer[indx], 32 ); - break; - } -#if VERBOSE_DEBUG - DebugMsg( "escape!: %u vs %u\n", minBits, (numSamples * p->mBitDepth) ); -#endif - } - -Exit: - return status; -} - -#if PRAGMA_MARK -#pragma mark - -#endif - -/* - Encode() - - encode the next block of samples -*/ -int32_t -alac_encode(ALAC_ENCODER *p, uint32_t numChannels, uint32_t numSamples, - int32_t * theReadBuffer, unsigned char * theWriteBuffer, uint32_t * ioNumBytes) -{ - uint32_t outputSize; - BitBuffer bitstream; - int32_t status; - - // create a bit buffer structure pointing to our output buffer - BitBufferInit( &bitstream, theWriteBuffer, p->mMaxOutputBytes ); - - if ( numChannels == 2 ) - { - // add 3-bit frame start tag ID_CPE = channel pair & 4-bit element instance tag = 0 - BitBufferWrite( &bitstream, ID_CPE, 3 ); - BitBufferWrite( &bitstream, 0, 4 ); - - // encode stereo input buffer - if ( p->mFastMode == false ) - status = EncodeStereo(p, &bitstream, theReadBuffer, 2, 0, numSamples ); - else - status = EncodeStereoFast(p, &bitstream, theReadBuffer, 2, 0, numSamples ); - RequireNoErr( status, goto Exit; ); - } - else if ( numChannels == 1 ) - { - // add 3-bit frame start tag ID_SCE = mono channel & 4-bit element instance tag = 0 - BitBufferWrite( &bitstream, ID_SCE, 3 ); - BitBufferWrite( &bitstream, 0, 4 ); - - // encode mono input buffer - status = EncodeMono(p, &bitstream, theReadBuffer, 1, 0, numSamples ); - RequireNoErr( status, goto Exit; ); - } - else - { - int32_t * inputBuffer; - uint32_t tag; - uint32_t channelIndex; - uint32_t inputIncrement; - uint8_t stereoElementTag; - uint8_t monoElementTag; - uint8_t lfeElementTag; - - inputBuffer = theReadBuffer; - inputIncrement = ((p->mBitDepth + 7) / 8); - - stereoElementTag = 0; - monoElementTag = 0; - lfeElementTag = 0; - - for ( channelIndex = 0; channelIndex < numChannels; ) - { - tag = (sChannelMaps[numChannels - 1] & (0x7ul << (channelIndex * 3))) >> (channelIndex * 3); - - BitBufferWrite( &bitstream, tag, 3 ); - switch ( tag ) - { - case ID_SCE: - // mono - BitBufferWrite( &bitstream, monoElementTag, 4 ); - - status = EncodeMono(p, &bitstream, inputBuffer, numChannels, channelIndex, numSamples ); - - inputBuffer += inputIncrement; - channelIndex++; - monoElementTag++; - break; - - case ID_CPE: - // stereo - BitBufferWrite( &bitstream, stereoElementTag, 4 ); - - status = EncodeStereo(p,&bitstream, inputBuffer, numChannels, channelIndex, numSamples ); - - inputBuffer += (inputIncrement * 2); - channelIndex += 2; - stereoElementTag++; - break; - - case ID_LFE: - // LFE channel (subwoofer) - BitBufferWrite( &bitstream, lfeElementTag, 4 ); - - status = EncodeMono(p, &bitstream, inputBuffer, numChannels, channelIndex, numSamples ); - - inputBuffer += inputIncrement; - channelIndex++; - lfeElementTag++; - break; - - default: - printf( "That ain't right! (%u)\n", tag ); - status = kALAC_ParamError; - goto Exit; - } - - RequireNoErr( status, goto Exit; ); - } - } - -#if VERBOSE_DEBUG -{ - // if there is room left in the output buffer, add some random fill data to test decoder - int32_t bitsLeft; - int32_t bytesLeft; - - bitsLeft = BitBufferGetPosition( &bitstream ) - 3; // - 3 for ID_END tag - bytesLeft = bitstream.byteSize - ((bitsLeft + 7) / 8); - - if ( (bytesLeft > 20) && ((bytesLeft & 0x4u) != 0) ) - AddFiller( &bitstream, bytesLeft ); -} -#endif - - // add 3-bit frame end tag: ID_END - BitBufferWrite( &bitstream, ID_END, 3 ); - - // byte-align the output data - BitBufferByteAlign( &bitstream, true ); - - outputSize = BitBufferGetPosition( &bitstream ) / 8; - //Assert( outputSize <= mMaxOutputBytes ); - - - // all good, let iTunes know what happened and remember the total number of input sample frames - *ioNumBytes = outputSize; - //mEncodedFrames += encodeMsg->numInputSamples; - - // gather encoding stats - p->mTotalBytesGenerated += outputSize; - p->mMaxFrameBytes = MAX( p->mMaxFrameBytes, outputSize ); - - status = ALAC_noErr; - -Exit: - return status; -} - - -#if PRAGMA_MARK -#pragma mark - -#endif - -/* - GetConfig() -*/ -void -GetConfig(ALAC_ENCODER *p, ALACSpecificConfig * config ) -{ - config->frameLength = Swap32NtoB(p->mFrameSize); - config->compatibleVersion = (uint8_t) kALACCompatibleVersion; - config->bitDepth = (uint8_t) p->mBitDepth; - config->pb = (uint8_t) PB0; - config->kb = (uint8_t) KB0; - config->mb = (uint8_t) MB0; - config->numChannels = (uint8_t) p->mNumChannels; - config->maxRun = Swap16NtoB((uint16_t) MAX_RUN_DEFAULT); - config->maxFrameBytes = Swap32NtoB(p->mMaxFrameBytes); - config->avgBitRate = Swap32NtoB(p->mAvgBitRate); - config->sampleRate = Swap32NtoB(p->mOutputSampleRate); -} - -uint32_t -alac_get_magic_cookie_size(uint32_t inNumChannels) -{ - if (inNumChannels > 2) - { - return sizeof(ALACSpecificConfig) + kChannelAtomSize + sizeof(ALACAudioChannelLayout); - } - else - { - return sizeof(ALACSpecificConfig); - } -} - -void -alac_get_magic_cookie(ALAC_ENCODER *p, void * outCookie, uint32_t * ioSize ) -{ - ALACSpecificConfig theConfig = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - ALACAudioChannelLayout theChannelLayout = {0, 0, 0}; - uint8_t theChannelAtom[kChannelAtomSize] = {0, 0, 0, 0, 'c', 'h', 'a', 'n', 0, 0, 0, 0}; - uint32_t theCookieSize = sizeof(ALACSpecificConfig); - uint8_t * theCookiePointer = (uint8_t *)outCookie; - - GetConfig(p, &theConfig); - if (theConfig.numChannels > 2) - { - theChannelLayout.mChannelLayoutTag = Swap32NtoB(ALACChannelLayoutTags[theConfig.numChannels - 1]); - theCookieSize += (sizeof(ALACAudioChannelLayout) + kChannelAtomSize); - } - if (*ioSize >= theCookieSize) - { - memcpy(theCookiePointer, &theConfig, sizeof(ALACSpecificConfig)); - theChannelAtom[3] = (sizeof(ALACAudioChannelLayout) + kChannelAtomSize); - if (theConfig.numChannels > 2) - { - theCookiePointer += sizeof(ALACSpecificConfig); - memcpy(theCookiePointer, theChannelAtom, kChannelAtomSize); - theCookiePointer += kChannelAtomSize; - memcpy(theCookiePointer, &theChannelLayout, sizeof(ALACAudioChannelLayout)); - } - *ioSize = theCookieSize; - } - else - { - *ioSize = 0; // no incomplete cookies - } -} - -/* - alac_encoder_init() - - initialize the encoder component with the current config -*/ -int32_t -alac_encoder_init (ALAC_ENCODER *p, uint32_t samplerate, uint32_t channels, uint32_t format_flags, uint32_t frameSize) -{ - int32_t status; - uint32_t indx; - int32_t channel, search; - - p->mFrameSize = (frameSize > 0 && frameSize <= ALAC_FRAME_LENGTH) ? frameSize : ALAC_FRAME_LENGTH ; - - p->mOutputSampleRate = samplerate; - p->mNumChannels = channels; - switch (format_flags) - { - case 1: - p->mBitDepth = 16; - break; - case 2: - p->mBitDepth = 20; - break; - case 3: - p->mBitDepth = 24; - break; - case 4: - p->mBitDepth = 32; - break; - default: - break; - } - - // set up default encoding parameters and state - // - note: mFrameSize is set in the constructor or via alac_set_frame_size() which must be called before this routine - for ( indx = 0; indx < kALACMaxChannels; indx++ ) - p->mLastMixRes[indx] = kDefaultMixRes; - - // the maximum output frame size can be no bigger than (samplesPerBlock * numChannels * ((10 + sampleSize)/8) + 1) - // but note that this can be bigger than the input size! - // - since we don't yet know what our input format will be, use our max allowed sample size in the calculation - p->mMaxOutputBytes = p->mFrameSize * p->mNumChannels * ((10 + kMaxSampleSize) / 8) + 1; - - status = ALAC_noErr; - - // initialize coefs arrays once b/c retaining state across blocks actually improves the encode ratio - for ( channel = 0; channel < (int32_t) p->mNumChannels; channel++ ) - { - for ( search = 0; search < kALACMaxSearches; search++ ) - { - init_coefs( p->mCoefsU[channel][search], DENSHIFT_DEFAULT, kALACMaxCoefs ); - init_coefs( p->mCoefsV[channel][search], DENSHIFT_DEFAULT, kALACMaxCoefs ); - } - } - - return status; -} - -/* - alac_get_source_format() - - given the input format, return one of our supported formats -*/ -void -alac_get_source_format(ALAC_ENCODER *p, const AudioFormatDescription * source, AudioFormatDescription * output ) -{ - (void) output ; - // default is 16-bit native endian - // - note: for float input we assume that's coming from one of our decoders (mp3, aac) so it only makes sense - // to encode to 16-bit since the source was lossy in the first place - // - note: if not a supported bit depth, find the closest supported bit depth to the input one - if ( (source->mFormatID != kALACFormatLinearPCM) || ((source->mFormatFlags & kALACFormatFlagIsFloat) != 0) || - ( source->mBitsPerChannel <= 16 ) ) - p->mBitDepth = 16; - else if ( source->mBitsPerChannel <= 20 ) - p->mBitDepth = 20; - else if ( source->mBitsPerChannel <= 24 ) - p->mBitDepth = 24; - else - p->mBitDepth = 32; - - // we support 16/20/24/32-bit integer data at any sample rate and our target number of channels - // and sample rate were specified when we were configured - /* - MakeUncompressedAudioFormat( mNumChannels, (float) mOutputSampleRate, mBitDepth, kAudioFormatFlagsNativeIntegerPacked, output ); - */ -} - - - -#if VERBOSE_DEBUG - -#if PRAGMA_MARK -#pragma mark - -#endif - -/* - AddFiller() - - add fill and data stream elements to the bitstream to test the decoder -*/ -static void AddFiller( BitBuffer * bits, int32_t numBytes ) -{ - uint8_t tag; - int32_t indx; - - // out of lameness, subtract 6 bytes to deal with header + alignment as required for fill/data elements - numBytes -= 6; - if ( numBytes <= 0 ) - return; - - // randomly pick Fill or Data Stream Element based on numBytes requested - tag = (numBytes & 0x8) ? ID_FIL : ID_DSE; - - BitBufferWrite( bits, tag, 3 ); - if ( tag == ID_FIL ) - { - // can't write more than 269 bytes in a fill element - numBytes = (numBytes > 269) ? 269 : numBytes; - - // fill element = 4-bit size unless >= 15 then 4-bit size + 8-bit extension size - if ( numBytes >= 15 ) - { - uint16_t extensionSize; - - BitBufferWrite( bits, 15, 4 ); - - // 8-bit extension count field is "extra + 1" which is weird but I didn't define the syntax - // - otherwise, there's no way to represent 15 - // - for example, to really mean 15 bytes you must encode extensionSize = 1 - // - why it's not like data stream elements I have no idea - extensionSize = (numBytes - 15) + 1; - //Assert( extensionSize <= 255 ); - BitBufferWrite( bits, extensionSize, 8 ); - } - else - BitBufferWrite( bits, numBytes, 4 ); - - BitBufferWrite( bits, 0x10, 8 ); // extension_type = FILL_DATA = b0001 or'ed with fill_nibble = b0000 - for ( indx = 0; indx < (numBytes - 1); indx++ ) - BitBufferWrite( bits, 0xa5, 8 ); // fill_byte = b10100101 = 0xa5 - } - else - { - // can't write more than 510 bytes in a data stream element - numBytes = (numBytes > 510) ? 510 : numBytes; - - BitBufferWrite( bits, 0, 4 ); // element instance tag - BitBufferWrite( bits, 1, 1 ); // byte-align flag = true - - // data stream element = 8-bit size unless >= 255 then 8-bit size + 8-bit size - if ( numBytes >= 255 ) - { - BitBufferWrite( bits, 255, 8 ); - BitBufferWrite( bits, numBytes - 255, 8 ); - } - else - BitBufferWrite( bits, numBytes, 8 ); - - BitBufferByteAlign( bits, true ); // byte-align with zeros - - for ( indx = 0; indx < numBytes; indx++ ) - BitBufferWrite( bits, 0x5a, 8 ); - } -} - -#endif /* VERBOSE_DEBUG */ diff --git a/libs/libsndfile/src/ALAC/dp_dec.c b/libs/libsndfile/src/ALAC/dp_dec.c deleted file mode 100644 index 45aae7a9e1..0000000000 --- a/libs/libsndfile/src/ALAC/dp_dec.c +++ /dev/null @@ -1,375 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: dp_dec.c - - Contains: Dynamic Predictor decode routines - - Copyright: (c) 2001-2011 Apple, Inc. -*/ - - -#include "dplib.h" -#include - -#if __GNUC__ -#define ALWAYS_INLINE __attribute__((always_inline)) -#else -#define ALWAYS_INLINE -#endif - -#define LOOP_ALIGN - -static inline int32_t ALWAYS_INLINE sign_of_int( int32_t i ) -{ - int32_t negishift; - - negishift = ((uint32_t)-i) >> 31; - return negishift | (i >> 31); -} - -void unpc_block( int32_t * pc1, int32_t * out, int32_t num, int16_t * coefs, int32_t numactive, uint32_t chanbits, uint32_t denshift ) -{ - register int16_t a0, a1, a2, a3; - register int32_t b0, b1, b2, b3; - int32_t j, k, lim; - int32_t sum1, sg, sgn, top, dd; - int32_t * pout; - int32_t del, del0; - uint32_t chanshift = 32 - chanbits; - int32_t denhalf = 1<<(denshift-1); - - out[0] = pc1[0]; - if ( numactive == 0 ) - { - // just copy if numactive == 0 (but don't bother if in/out pointers the same) - if ( (num > 1) && (pc1 != out) ) - memcpy( &out[1], &pc1[1], (num - 1) * sizeof(int32_t) ); - return; - } - if ( numactive == 31 ) - { - // short-circuit if numactive == 31 - int32_t prev; - - /* this code is written such that the in/out buffers can be the same - to conserve buffer space on embedded devices like the iPod - - (original code) - for ( j = 1; j < num; j++ ) - del = pc1[j] + out[j-1]; - out[j] = (del << chanshift) >> chanshift; - */ - prev = out[0]; - for ( j = 1; j < num; j++ ) - { - del = pc1[j] + prev; - prev = (del << chanshift) >> chanshift; - out[j] = prev; - } - return; - } - - for ( j = 1; j <= numactive; j++ ) - { - del = pc1[j] + out[j-1]; - out[j] = (del << chanshift) >> chanshift; - } - - lim = numactive + 1; - - if ( numactive == 4 ) - { - // optimization for numactive == 4 - register int16_t ia0, ia1, ia2, ia3; - register int32_t ib0, ib1, ib2, ib3; - - ia0 = coefs[0]; - ia1 = coefs[1]; - ia2 = coefs[2]; - ia3 = coefs[3]; - - for ( j = lim; j < num; j++ ) - { - LOOP_ALIGN - - top = out[j - lim]; - pout = out + j - 1; - - ib0 = top - pout[0]; - ib1 = top - pout[-1]; - ib2 = top - pout[-2]; - ib3 = top - pout[-3]; - - sum1 = (denhalf - ia0 * ib0 - ia1 * ib1 - ia2 * ib2 - ia3 * ib3) >> denshift; - - del = pc1[j]; - del0 = del; - sg = sign_of_int(del); - del += top + sum1; - - out[j] = (del << chanshift) >> chanshift; - - if ( sg > 0 ) - { - sgn = sign_of_int( ib3 ); - ia3 -= sgn; - del0 -= (4 - 3) * ((sgn * ib3) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( ib2 ); - ia2 -= sgn; - del0 -= (4 - 2) * ((sgn * ib2) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( ib1 ); - ia1 -= sgn; - del0 -= (4 - 1) * ((sgn * ib1) >> denshift); - if ( del0 <= 0 ) - continue; - - ia0 -= sign_of_int( ib0 ); - } - else if ( sg < 0 ) - { - // note: to avoid unnecessary negations, we flip the value of "sgn" - sgn = -sign_of_int( ib3 ); - ia3 -= sgn; - del0 -= (4 - 3) * ((sgn * ib3) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( ib2 ); - ia2 -= sgn; - del0 -= (4 - 2) * ((sgn * ib2) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( ib1 ); - ia1 -= sgn; - del0 -= (4 - 1) * ((sgn * ib1) >> denshift); - if ( del0 >= 0 ) - continue; - - ia0 += sign_of_int( ib0 ); - } - } - - coefs[0] = ia0; - coefs[1] = ia1; - coefs[2] = ia2; - coefs[3] = ia3; - } - else if ( numactive == 8 ) - { - register int16_t a4, a5, a6, a7; - register int32_t b4, b5, b6, b7; - - // optimization for numactive == 8 - a0 = coefs[0]; - a1 = coefs[1]; - a2 = coefs[2]; - a3 = coefs[3]; - a4 = coefs[4]; - a5 = coefs[5]; - a6 = coefs[6]; - a7 = coefs[7]; - - for ( j = lim; j < num; j++ ) - { - LOOP_ALIGN - - top = out[j - lim]; - pout = out + j - 1; - - b0 = top - (*pout--); - b1 = top - (*pout--); - b2 = top - (*pout--); - b3 = top - (*pout--); - b4 = top - (*pout--); - b5 = top - (*pout--); - b6 = top - (*pout--); - b7 = top - (*pout); - pout += 8; - - sum1 = (denhalf - a0 * b0 - a1 * b1 - a2 * b2 - a3 * b3 - - a4 * b4 - a5 * b5 - a6 * b6 - a7 * b7) >> denshift; - - del = pc1[j]; - del0 = del; - sg = sign_of_int(del); - del += top + sum1; - - out[j] = (del << chanshift) >> chanshift; - - if ( sg > 0 ) - { - sgn = sign_of_int( b7 ); - a7 -= sgn; - del0 -= 1 * ((sgn * b7) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b6 ); - a6 -= sgn; - del0 -= 2 * ((sgn * b6) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b5 ); - a5 -= sgn; - del0 -= 3 * ((sgn * b5) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b4 ); - a4 -= sgn; - del0 -= 4 * ((sgn * b4) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b3 ); - a3 -= sgn; - del0 -= 5 * ((sgn * b3) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b2 ); - a2 -= sgn; - del0 -= 6 * ((sgn * b2) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b1 ); - a1 -= sgn; - del0 -= 7 * ((sgn * b1) >> denshift); - if ( del0 <= 0 ) - continue; - - a0 -= sign_of_int( b0 ); - } - else if ( sg < 0 ) - { - // note: to avoid unnecessary negations, we flip the value of "sgn" - sgn = -sign_of_int( b7 ); - a7 -= sgn; - del0 -= 1 * ((sgn * b7) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b6 ); - a6 -= sgn; - del0 -= 2 * ((sgn * b6) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b5 ); - a5 -= sgn; - del0 -= 3 * ((sgn * b5) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b4 ); - a4 -= sgn; - del0 -= 4 * ((sgn * b4) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b3 ); - a3 -= sgn; - del0 -= 5 * ((sgn * b3) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b2 ); - a2 -= sgn; - del0 -= 6 * ((sgn * b2) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b1 ); - a1 -= sgn; - del0 -= 7 * ((sgn * b1) >> denshift); - if ( del0 >= 0 ) - continue; - - a0 += sign_of_int( b0 ); - } - } - - coefs[0] = a0; - coefs[1] = a1; - coefs[2] = a2; - coefs[3] = a3; - coefs[4] = a4; - coefs[5] = a5; - coefs[6] = a6; - coefs[7] = a7; - } - else - { - // general case - for ( j = lim; j < num; j++ ) - { - LOOP_ALIGN - - sum1 = 0; - pout = out + j - 1; - top = out[j-lim]; - - for ( k = 0; k < numactive; k++ ) - sum1 += coefs[k] * (pout[-k] - top); - - del = pc1[j]; - del0 = del; - sg = sign_of_int( del ); - del += top + ((sum1 + denhalf) >> denshift); - out[j] = (del << chanshift) >> chanshift; - - if ( sg > 0 ) - { - for ( k = (numactive - 1); k >= 0; k-- ) - { - dd = top - pout[-k]; - sgn = sign_of_int( dd ); - coefs[k] -= sgn; - del0 -= (numactive - k) * ((sgn * dd) >> denshift); - if ( del0 <= 0 ) - break; - } - } - else if ( sg < 0 ) - { - for ( k = (numactive - 1); k >= 0; k-- ) - { - dd = top - pout[-k]; - sgn = sign_of_int( dd ); - coefs[k] += sgn; - del0 -= (numactive - k) * ((-sgn * dd) >> denshift); - if ( del0 >= 0 ) - break; - } - } - } - } -} diff --git a/libs/libsndfile/src/ALAC/dp_enc.c b/libs/libsndfile/src/ALAC/dp_enc.c deleted file mode 100644 index f81cdba520..0000000000 --- a/libs/libsndfile/src/ALAC/dp_enc.c +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: dp_enc.c - - Contains: Dynamic Predictor encode routines - - Copyright: (c) 2001-2011 Apple, Inc. -*/ - -#include "dplib.h" -#include - -#if __GNUC__ -#define ALWAYS_INLINE __attribute__((always_inline)) -#else -#define ALWAYS_INLINE -#endif - -#define LOOP_ALIGN - -void init_coefs( int16_t * coefs, uint32_t denshift, int32_t numPairs ) -{ - int32_t k; - int32_t den = 1 << denshift; - - coefs[0] = (AINIT * den) >> 4; - coefs[1] = (BINIT * den) >> 4; - coefs[2] = (CINIT * den) >> 4; - for ( k = 3; k < numPairs; k++ ) - coefs[k] = 0; -} - -void copy_coefs( int16_t * srcCoefs, int16_t * dstCoefs, int32_t numPairs ) -{ - int32_t k; - - for ( k = 0; k < numPairs; k++ ) - dstCoefs[k] = srcCoefs[k]; -} - -static inline int32_t ALWAYS_INLINE sign_of_int( int32_t i ) -{ - int32_t negishift; - - negishift = ((uint32_t)-i) >> 31; - return negishift | (i >> 31); -} - -void pc_block( int32_t * in, int32_t * pc1, int32_t num, int16_t * coefs, int32_t numactive, uint32_t chanbits, uint32_t denshift ) -{ - register int16_t a0, a1, a2, a3; - register int32_t b0, b1, b2, b3; - int32_t j, k, lim; - int32_t * pin; - int32_t sum1, dd; - int32_t sg, sgn; - int32_t top; - int32_t del, del0; - uint32_t chanshift = 32 - chanbits; - int32_t denhalf = 1 << (denshift - 1); - - pc1[0] = in[0]; - if ( numactive == 0 ) - { - // just copy if numactive == 0 (but don't bother if in/out pointers the same) - if ( (num > 1) && (in != pc1) ) - memcpy( &pc1[1], &in[1], (num - 1) * sizeof(int32_t) ); - return; - } - if ( numactive == 31 ) - { - // short-circuit if numactive == 31 - for( j = 1; j < num; j++ ) - { - del = in[j] - in[j-1]; - pc1[j] = (del << chanshift) >> chanshift; - } - return; - } - - for ( j = 1; j <= numactive; j++ ) - { - del = in[j] - in[j-1]; - pc1[j] = (del << chanshift) >> chanshift; - } - - lim = numactive + 1; - - if ( numactive == 4 ) - { - // optimization for numactive == 4 - a0 = coefs[0]; - a1 = coefs[1]; - a2 = coefs[2]; - a3 = coefs[3]; - - for ( j = lim; j < num; j++ ) - { - LOOP_ALIGN - - top = in[j - lim]; - pin = in + j - 1; - - b0 = top - pin[0]; - b1 = top - pin[-1]; - b2 = top - pin[-2]; - b3 = top - pin[-3]; - - sum1 = (denhalf - a0 * b0 - a1 * b1 - a2 * b2 - a3 * b3) >> denshift; - - del = in[j] - top - sum1; - del = (del << chanshift) >> chanshift; - pc1[j] = del; - del0 = del; - - sg = sign_of_int(del); - if ( sg > 0 ) - { - sgn = sign_of_int( b3 ); - a3 -= sgn; - del0 -= (4 - 3) * ((sgn * b3) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b2 ); - a2 -= sgn; - del0 -= (4 - 2) * ((sgn * b2) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b1 ); - a1 -= sgn; - del0 -= (4 - 1) * ((sgn * b1) >> denshift); - if ( del0 <= 0 ) - continue; - - a0 -= sign_of_int( b0 ); - } - else if ( sg < 0 ) - { - // note: to avoid unnecessary negations, we flip the value of "sgn" - sgn = -sign_of_int( b3 ); - a3 -= sgn; - del0 -= (4 - 3) * ((sgn * b3) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b2 ); - a2 -= sgn; - del0 -= (4 - 2) * ((sgn * b2) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b1 ); - a1 -= sgn; - del0 -= (4 - 1) * ((sgn * b1) >> denshift); - if ( del0 >= 0 ) - continue; - - a0 += sign_of_int( b0 ); - } - } - - coefs[0] = a0; - coefs[1] = a1; - coefs[2] = a2; - coefs[3] = a3; - } - else if ( numactive == 8 ) - { - // optimization for numactive == 8 - register int16_t a4, a5, a6, a7; - register int32_t b4, b5, b6, b7; - - a0 = coefs[0]; - a1 = coefs[1]; - a2 = coefs[2]; - a3 = coefs[3]; - a4 = coefs[4]; - a5 = coefs[5]; - a6 = coefs[6]; - a7 = coefs[7]; - - for ( j = lim; j < num; j++ ) - { - LOOP_ALIGN - - top = in[j - lim]; - pin = in + j - 1; - - b0 = top - (*pin--); - b1 = top - (*pin--); - b2 = top - (*pin--); - b3 = top - (*pin--); - b4 = top - (*pin--); - b5 = top - (*pin--); - b6 = top - (*pin--); - b7 = top - (*pin); - pin += 8; - - sum1 = (denhalf - a0 * b0 - a1 * b1 - a2 * b2 - a3 * b3 - - a4 * b4 - a5 * b5 - a6 * b6 - a7 * b7) >> denshift; - - del = in[j] - top - sum1; - del = (del << chanshift) >> chanshift; - pc1[j] = del; - del0 = del; - - sg = sign_of_int(del); - if ( sg > 0 ) - { - sgn = sign_of_int( b7 ); - a7 -= sgn; - del0 -= 1 * ((sgn * b7) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b6 ); - a6 -= sgn; - del0 -= 2 * ((sgn * b6) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b5 ); - a5 -= sgn; - del0 -= 3 * ((sgn * b5) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b4 ); - a4 -= sgn; - del0 -= 4 * ((sgn * b4) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b3 ); - a3 -= sgn; - del0 -= 5 * ((sgn * b3) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b2 ); - a2 -= sgn; - del0 -= 6 * ((sgn * b2) >> denshift); - if ( del0 <= 0 ) - continue; - - sgn = sign_of_int( b1 ); - a1 -= sgn; - del0 -= 7 * ((sgn * b1) >> denshift); - if ( del0 <= 0 ) - continue; - - a0 -= sign_of_int( b0 ); - } - else if ( sg < 0 ) - { - // note: to avoid unnecessary negations, we flip the value of "sgn" - sgn = -sign_of_int( b7 ); - a7 -= sgn; - del0 -= 1 * ((sgn * b7) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b6 ); - a6 -= sgn; - del0 -= 2 * ((sgn * b6) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b5 ); - a5 -= sgn; - del0 -= 3 * ((sgn * b5) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b4 ); - a4 -= sgn; - del0 -= 4 * ((sgn * b4) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b3 ); - a3 -= sgn; - del0 -= 5 * ((sgn * b3) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b2 ); - a2 -= sgn; - del0 -= 6 * ((sgn * b2) >> denshift); - if ( del0 >= 0 ) - continue; - - sgn = -sign_of_int( b1 ); - a1 -= sgn; - del0 -= 7 * ((sgn * b1) >> denshift); - if ( del0 >= 0 ) - continue; - - a0 += sign_of_int( b0 ); - } - } - - coefs[0] = a0; - coefs[1] = a1; - coefs[2] = a2; - coefs[3] = a3; - coefs[4] = a4; - coefs[5] = a5; - coefs[6] = a6; - coefs[7] = a7; - } - else - { -//pc_block_general: - // general case - for ( j = lim; j < num; j++ ) - { - LOOP_ALIGN - - top = in[j - lim]; - pin = in + j - 1; - - sum1 = 0; - for ( k = 0; k < numactive; k++ ) - sum1 -= coefs[k] * (top - pin[-k]); - - del = in[j] - top - ((sum1 + denhalf) >> denshift); - del = (del << chanshift) >> chanshift; - pc1[j] = del; - del0 = del; - - sg = sign_of_int( del ); - if ( sg > 0 ) - { - for ( k = (numactive - 1); k >= 0; k-- ) - { - dd = top - pin[-k]; - sgn = sign_of_int( dd ); - coefs[k] -= sgn; - del0 -= (numactive - k) * ((sgn * dd) >> denshift); - if ( del0 <= 0 ) - break; - } - } - else if ( sg < 0 ) - { - for ( k = (numactive - 1); k >= 0; k-- ) - { - dd = top - pin[-k]; - sgn = sign_of_int( dd ); - coefs[k] += sgn; - del0 -= (numactive - k) * ((-sgn * dd) >> denshift); - if ( del0 >= 0 ) - break; - } - } - } - } -} diff --git a/libs/libsndfile/src/ALAC/dplib.h b/libs/libsndfile/src/ALAC/dplib.h deleted file mode 100644 index 37d3353313..0000000000 --- a/libs/libsndfile/src/ALAC/dplib.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: dplib.h - - Contains: Dynamic Predictor routines - - Copyright: Copyright (C) 2001-2011 Apple, Inc. -*/ - -#ifndef __DPLIB_H__ -#define __DPLIB_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// defines - -#define DENSHIFT_MAX 15 -#define DENSHIFT_DEFAULT 9 -#define AINIT 38 -#define BINIT (-29) -#define CINIT (-2) -#define NUMCOEPAIRS 16 - -// prototypes - -void init_coefs( int16_t * coefs, uint32_t denshift, int32_t numPairs ); -void copy_coefs( int16_t * srcCoefs, int16_t * dstCoefs, int32_t numPairs ); - -// NOTE: these routines read at least "numactive" samples so the i/o buffers must be at least that big - -void pc_block( int32_t * in, int32_t * pc, int32_t num, int16_t * coefs, int32_t numactive, uint32_t chanbits, uint32_t denshift ); -void unpc_block( int32_t * pc, int32_t * out, int32_t num, int16_t * coefs, int32_t numactive, uint32_t chanbits, uint32_t denshift ); - -#ifdef __cplusplus -} -#endif - -#endif /* __DPLIB_H__ */ diff --git a/libs/libsndfile/src/ALAC/matrix_dec.c b/libs/libsndfile/src/ALAC/matrix_dec.c deleted file mode 100644 index cb812d1d4d..0000000000 --- a/libs/libsndfile/src/ALAC/matrix_dec.c +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * Copyright (C) 2012 Erik de Castro Lopo - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: matrix_dec.c - - Contains: ALAC mixing/matrixing decode routines. - - Copyright: (c) 2004-2011 Apple, Inc. -*/ - -#include "matrixlib.h" -#include "ALACAudioTypes.h" - -// up to 24-bit "offset" macros for the individual bytes of a 20/24-bit word -#if TARGET_RT_BIG_ENDIAN - #define LBYTE 2 - #define MBYTE 1 - #define HBYTE 0 -#else - #define LBYTE 0 - #define MBYTE 1 - #define HBYTE 2 -#endif - -/* - There is no plain middle-side option; instead there are various mixing - modes including middle-side, each lossless, as embodied in the mix() - and unmix() functions. These functions exploit a generalized middle-side - transformation: - - u := [(rL + (m-r)R)/m]; - v := L - R; - - where [ ] denotes integer floor. The (lossless) inverse is - - L = u + v - [rV/m]; - R = L - v; -*/ - -// 16-bit routines - -void unmix16( int32_t * u, int32_t * v, int32_t * out, uint32_t stride, int32_t numSamples, int32_t mixbits, int32_t mixres ) -{ - int32_t j; - - if ( mixres != 0 ) - { - /* matrixed stereo */ - for ( j = 0; j < numSamples; j++ ) - { - int32_t l, r; - - l = u[j] + v[j] - ((mixres * v[j]) >> mixbits); - r = l - v[j]; - - out[0] = l << 16; - out[1] = r << 16; - out += stride; - } - } - else - { - /* Conventional separated stereo. */ - for ( j = 0; j < numSamples; j++ ) - { - out[0] = u[j] << 16; - out[1] = v[j] << 16; - out += stride; - } - } -} - -// 20-bit routines -// - the 20 bits of data are left-justified in 3 bytes of storage but right-aligned for input/output predictor buffers - -void unmix20( int32_t * u, int32_t * v, int32_t * out, uint32_t stride, int32_t numSamples, int32_t mixbits, int32_t mixres ) -{ - int32_t j; - - if ( mixres != 0 ) - { - /* matrixed stereo */ - for ( j = 0; j < numSamples; j++ ) - { - int32_t l, r; - - l = u[j] + v[j] - ((mixres * v[j]) >> mixbits); - r = l - v[j]; - - out[0] = l << 12; - out[1] = r << 12; - out += stride; - } - } - else - { - /* Conventional separated stereo. */ - for ( j = 0; j < numSamples; j++ ) - { - out[0] = u[j] << 12; - out[1] = v[j] << 12; - out += stride; - } - } -} - -// 24-bit routines -// - the 24 bits of data are right-justified in the input/output predictor buffers - -void unmix24( int32_t * u, int32_t * v, int32_t * out, uint32_t stride, int32_t numSamples, - int32_t mixbits, int32_t mixres, uint16_t * shiftUV, int32_t bytesShifted ) -{ - int32_t shift = bytesShifted * 8; - int32_t l, r; - int32_t j, k; - - if ( mixres != 0 ) - { - /* matrixed stereo */ - if ( bytesShifted != 0 ) - { - for ( j = 0, k = 0; j < numSamples; j++, k += 2 ) - { - l = u[j] + v[j] - ((mixres * v[j]) >> mixbits); - r = l - v[j]; - - l = (l << shift) | (uint32_t) shiftUV[k + 0]; - r = (r << shift) | (uint32_t) shiftUV[k + 1]; - - out[0] = l << 8; - out[1] = r << 8; - out += stride; - } - } - else - { - for ( j = 0; j < numSamples; j++ ) - { - l = u[j] + v[j] - ((mixres * v[j]) >> mixbits); - r = l - v[j]; - - out[0] = l << 8; - out[1] = r << 8; - out += stride; - } - } - } - else - { - /* Conventional separated stereo. */ - if ( bytesShifted != 0 ) - { - for ( j = 0, k = 0; j < numSamples; j++, k += 2 ) - { - l = u[j]; - r = v[j]; - - l = (l << shift) | (uint32_t) shiftUV[k + 0]; - r = (r << shift) | (uint32_t) shiftUV[k + 1]; - - out[0] = l << 8; - out[1] = r << 8; - out += stride; - } - } - else - { - for ( j = 0; j < numSamples; j++ ) - { - out[0] = u[j] << 8; - out[1] = v[j] << 8; - out += stride; - } - } - } -} - -// 32-bit routines -// - note that these really expect the internal data width to be < 32 but the arrays are 32-bit -// - otherwise, the calculations might overflow into the 33rd bit and be lost -// - therefore, these routines deal with the specified "unused lower" bytes in the "shift" buffers - -void unmix32( int32_t * u, int32_t * v, int32_t * out, uint32_t stride, int32_t numSamples, - int32_t mixbits, int32_t mixres, uint16_t * shiftUV, int32_t bytesShifted ) -{ - int32_t shift = bytesShifted * 8; - int32_t l, r; - int32_t j, k; - - if ( mixres != 0 ) - { - //Assert( bytesShifted != 0 ); - - /* matrixed stereo with shift */ - for ( j = 0, k = 0; j < numSamples; j++, k += 2 ) - { - int32_t lt, rt; - - lt = u[j]; - rt = v[j]; - - l = lt + rt - ((mixres * rt) >> mixbits); - r = l - rt; - - out[0] = (l << shift) | (uint32_t) shiftUV[k + 0]; - out[1] = (r << shift) | (uint32_t) shiftUV[k + 1]; - out += stride; - } - } - else - { - if ( bytesShifted == 0 ) - { - /* interleaving w/o shift */ - for ( j = 0; j < numSamples; j++ ) - { - out[0] = u[j]; - out[1] = v[j]; - out += stride; - } - } - else - { - /* interleaving with shift */ - for ( j = 0, k = 0; j < numSamples; j++, k += 2 ) - { - out[0] = (u[j] << shift) | (uint32_t) shiftUV[k + 0]; - out[1] = (v[j] << shift) | (uint32_t) shiftUV[k + 1]; - out += stride; - } - } - } -} - -// 20/24-bit <-> 32-bit helper routines (not really matrixing but convenient to put here) - -void copyPredictorTo24( int32_t * in, int32_t * out, uint32_t stride, int32_t numSamples ) -{ - int32_t j; - - for ( j = 0; j < numSamples; j++ ) - { - out[0] = in[j] << 8; - out += stride; - } -} - -void copyPredictorTo24Shift( int32_t * in, uint16_t * shift, int32_t * out, uint32_t stride, int32_t numSamples, int32_t bytesShifted ) -{ - int32_t shiftVal = bytesShifted * 8; - int32_t j; - - //Assert( bytesShifted != 0 ); - - for ( j = 0; j < numSamples; j++ ) - { - int32_t val = in[j]; - - val = (val << shiftVal) | (uint32_t) shift[j]; - out[0] = val << 8; - out += stride; - } -} - -void copyPredictorTo20( int32_t * in, int32_t * out, uint32_t stride, int32_t numSamples ) -{ - int32_t j; - - // 32-bit predictor values are right-aligned but 20-bit output values should be left-aligned - // in the 24-bit output buffer - for ( j = 0; j < numSamples; j++ ) - { - out[0] = in[j] << 12; - out += stride; - } -} - -void copyPredictorTo32( int32_t * in, int32_t * out, uint32_t stride, int32_t numSamples ) -{ - int32_t i, j; - - // this is only a subroutine to abstract the "iPod can only output 16-bit data" problem - for ( i = 0, j = 0; i < numSamples; i++, j += stride ) - out[j] = in[i] << 8; -} - -void copyPredictorTo32Shift( int32_t * in, uint16_t * shift, int32_t * out, uint32_t stride, int32_t numSamples, int32_t bytesShifted ) -{ - int32_t * op = out; - uint32_t shiftVal = bytesShifted * 8; - int32_t j; - - //Assert( bytesShifted != 0 ); - - // this is only a subroutine to abstract the "iPod can only output 16-bit data" problem - for ( j = 0; j < numSamples; j++ ) - { - op[0] = (in[j] << shiftVal) | (uint32_t) shift[j]; - op += stride; - } -} diff --git a/libs/libsndfile/src/ALAC/matrix_enc.c b/libs/libsndfile/src/ALAC/matrix_enc.c deleted file mode 100644 index 5b4d1589eb..0000000000 --- a/libs/libsndfile/src/ALAC/matrix_enc.c +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * Copyright (C) 2012 Erik de Castro Lopo - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: matrix_enc.c - - Contains: ALAC mixing/matrixing encode routines. - - Copyright: (c) 2004-2011 Apple, Inc. -*/ - -#include "matrixlib.h" -#include "ALACAudioTypes.h" - -/* - There is no plain middle-side option; instead there are various mixing - modes including middle-side, each lossless, as embodied in the mix() - and unmix() functions. These functions exploit a generalized middle-side - transformation: - - u := [(rL + (m-r)R)/m]; - v := L - R; - - where [ ] denotes integer floor. The (lossless) inverse is - - L = u + v - [rV/m]; - R = L - v; -*/ - -// 16-bit routines - -void mix16( int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, int32_t mixbits, int32_t mixres ) -{ - int32_t j; - - if ( mixres != 0 ) - { - int32_t mod = 1 << mixbits; - int32_t m2; - - /* matrixed stereo */ - m2 = mod - mixres; - for ( j = 0; j < numSamples; j++ ) - { - int32_t l, r; - - l = in[0] >> 16; - r = in[1] >> 16; - in += stride; - u[j] = (mixres * l + m2 * r) >> mixbits; - v[j] = l - r; - } - } - else - { - /* Conventional separated stereo. */ - for ( j = 0; j < numSamples; j++ ) - { - u[j] = in[0] >> 16; - v[j] = in[1] >> 16; - in += stride; - } - } -} - -// 20-bit routines -// - the 20 bits of data are left-justified in 3 bytes of storage but right-aligned for input/output predictor buffers - -void mix20( int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, int32_t mixbits, int32_t mixres ) -{ - int32_t l, r; - int32_t j; - - if ( mixres != 0 ) - { - /* matrixed stereo */ - int32_t mod = 1 << mixbits; - int32_t m2 = mod - mixres; - - for ( j = 0; j < numSamples; j++ ) - { - l = in[0] >> 12; - r = in[1] >> 12; - in += stride; - - u[j] = (mixres * l + m2 * r) >> mixbits; - v[j] = l - r; - } - } - else - { - /* Conventional separated stereo. */ - for ( j = 0; j < numSamples; j++ ) - { - u[j] = in[0] >> 12; - v[j] = in[1] >> 12; - in += stride; - } - } -} - -// 24-bit routines -// - the 24 bits of data are right-justified in the input/output predictor buffers - -void mix24( int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, - int32_t mixbits, int32_t mixres, uint16_t * shiftUV, int32_t bytesShifted ) -{ - int32_t l, r; - int32_t shift = bytesShifted * 8; - uint32_t mask = (1ul << shift) - 1; - int32_t j, k; - - if ( mixres != 0 ) - { - /* matrixed stereo */ - int32_t mod = 1 << mixbits; - int32_t m2 = mod - mixres; - - if ( bytesShifted != 0 ) - { - for ( j = 0, k = 0; j < numSamples; j++, k += 2 ) - { - l = in[0] >> 8; - r = in[1] >> 8; - in += stride; - - shiftUV[k + 0] = (uint16_t)(l & mask); - shiftUV[k + 1] = (uint16_t)(r & mask); - - l >>= shift; - r >>= shift; - - u[j] = (mixres * l + m2 * r) >> mixbits; - v[j] = l - r; - } - } - else - { - for ( j = 0; j < numSamples; j++ ) - { - l = in[0] >> 8; - r = in[1] >> 8; - in += stride; - - u[j] = (mixres * l + m2 * r) >> mixbits; - v[j] = l - r; - } - } - } - else - { - /* Conventional separated stereo. */ - if ( bytesShifted != 0 ) - { - for ( j = 0, k = 0; j < numSamples; j++, k += 2 ) - { - l = in[0] >> 8; - r = in[1] >> 8; - in += stride; - - shiftUV[k + 0] = (uint16_t)(l & mask); - shiftUV[k + 1] = (uint16_t)(r & mask); - - l >>= shift; - r >>= shift; - - u[j] = l; - v[j] = r; - } - } - else - { - for ( j = 0; j < numSamples; j++ ) - { - l = in[0] >> 8; - r = in[1] >> 8; - in += stride; - } - } - } -} - -// 32-bit routines -// - note that these really expect the internal data width to be < 32 but the arrays are 32-bit -// - otherwise, the calculations might overflow into the 33rd bit and be lost -// - therefore, these routines deal with the specified "unused lower" bytes in the "shift" buffers - -void mix32( int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, - int32_t mixbits, int32_t mixres, uint16_t * shiftUV, int32_t bytesShifted ) -{ - int32_t shift = bytesShifted * 8; - uint32_t mask = (1ul << shift) - 1; - int32_t l, r; - int32_t j, k; - - if ( mixres != 0 ) - { - int32_t mod = 1 << mixbits; - int32_t m2; - - //Assert( bytesShifted != 0 ); - - /* matrixed stereo with shift */ - m2 = mod - mixres; - for ( j = 0, k = 0; j < numSamples; j++, k += 2 ) - { - l = in[0]; - r = in[1]; - in += stride; - - shiftUV[k + 0] = (uint16_t)(l & mask); - shiftUV[k + 1] = (uint16_t)(r & mask); - - l >>= shift; - r >>= shift; - - u[j] = (mixres * l + m2 * r) >> mixbits; - v[j] = l - r; - } - } - else - { - if ( bytesShifted == 0 ) - { - /* de-interleaving w/o shift */ - for ( j = 0; j < numSamples; j++ ) - { - u[j] = in[0]; - v[j] = in[1]; - in += stride; - } - } - else - { - /* de-interleaving with shift */ - for ( j = 0, k = 0; j < numSamples; j++, k += 2 ) - { - l = in[0]; - r = in[1]; - in += stride; - - shiftUV[k + 0] = (uint16_t)(l & mask); - shiftUV[k + 1] = (uint16_t)(r & mask); - - l >>= shift; - r >>= shift; - - u[j] = l; - v[j] = r; - } - } - } -} - diff --git a/libs/libsndfile/src/ALAC/matrixlib.h b/libs/libsndfile/src/ALAC/matrixlib.h deleted file mode 100644 index d405cbcd20..0000000000 --- a/libs/libsndfile/src/ALAC/matrixlib.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2011 Apple Inc. All rights reserved. - * Copyright (C) 2012 Erik de Castro Lopo - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -/* - File: matrixlib.h - - Contains: ALAC mixing/matrixing routines to/from 32-bit predictor buffers. - - Copyright: Copyright (C) 2004 to 2011 Apple, Inc. -*/ - -#ifndef __MATRIXLIB_H -#define __MATRIXLIB_H - -#pragma once - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// 16-bit routines -void mix16( int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, int32_t mixbits, int32_t mixres ); -void unmix16( int32_t * u, int32_t * v, int32_t * out, uint32_t stride, int32_t numSamples, int32_t mixbits, int32_t mixres ); - -// 20-bit routines -void mix20( int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, int32_t mixbits, int32_t mixres ); -void unmix20( int32_t * u, int32_t * v, int32_t * out, uint32_t stride, int32_t numSamples, int32_t mixbits, int32_t mixres ); - -// 24-bit routines -// - 24-bit data sometimes compresses better by shifting off the bottom byte so these routines deal with -// the specified "unused lower bytes" in the combined "shift" buffer -void mix24( int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, - int32_t mixbits, int32_t mixres, uint16_t * shiftUV, int32_t bytesShifted ); -void unmix24( int32_t * u, int32_t * v, int32_t * out, uint32_t stride, int32_t numSamples, - int32_t mixbits, int32_t mixres, uint16_t * shiftUV, int32_t bytesShifted ); - -// 32-bit routines -// - note that these really expect the internal data width to be < 32-bit but the arrays are 32-bit -// - otherwise, the calculations might overflow into the 33rd bit and be lost -// - therefore, these routines deal with the specified "unused lower" bytes in the combined "shift" buffer -void mix32( int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, - int32_t mixbits, int32_t mixres, uint16_t * shiftUV, int32_t bytesShifted ); -void unmix32( int32_t * u, int32_t * v, int32_t * out, uint32_t stride, int32_t numSamples, - int32_t mixbits, int32_t mixres, uint16_t * shiftUV, int32_t bytesShifted ); - -// 20/24/32-bit <-> 32-bit helper routines (not really matrixing but convenient to put here) -void copy20ToPredictor( int32_t * in, uint32_t stride, int32_t * out, int32_t numSamples ); -void copy24ToPredictor( int32_t * in, uint32_t stride, int32_t * out, int32_t numSamples ); - -void copyPredictorTo24( int32_t * in, int32_t * out, uint32_t stride, int32_t numSamples ); -void copyPredictorTo24Shift( int32_t * in, uint16_t * shift, int32_t * out, uint32_t stride, int32_t numSamples, int32_t bytesShifted ); -void copyPredictorTo20( int32_t * in, int32_t * out, uint32_t stride, int32_t numSamples ); - -void copyPredictorTo32( int32_t * in, int32_t * out, uint32_t stride, int32_t numSamples ); -void copyPredictorTo32Shift( int32_t * in, uint16_t * shift, int32_t * out, uint32_t stride, int32_t numSamples, int32_t bytesShifted ); - -#ifdef __cplusplus -} -#endif - -#endif /* __MATRIXLIB_H */ diff --git a/libs/libsndfile/src/G72x/ChangeLog b/libs/libsndfile/src/G72x/ChangeLog deleted file mode 100644 index aa108dff7f..0000000000 --- a/libs/libsndfile/src/G72x/ChangeLog +++ /dev/null @@ -1,50 +0,0 @@ -2001-06-05 Erik de Castro Lopo - - * g72x.c - Added {} in function update () to prevent 'ambiguous else' warning messages. - -2000-07-14 Erik de Castro Lopo - - * g72x.c - Modified g72x_init_state () to fit in with the new structure of the code. - Implemented g72x_encode_block () and g72x_decode_block (). - -2000-07-12 Erik de Castro Lopo - - * g72x.h - Moved nearly all definitions and function prototypes from this file have been - moved to private.h. - Added an enum defining the 4 different G72x ADPCM codecs. - Added new function prototypes to define a cleaner interface to the encoder - and decoder. This new interface also allows samples to be processed in blocks - rather than on a sample by sample basis like the original code. - - * private.h - Added prototypes moved from g72x.h. - Changed struct g72x_state to a typedef struct { .. } G72x_PRIVATE. - Added fields to G72x_PRIVATE required for working on blocks of samples. - -2000-06-07 Erik de Castro Lopo - - * g72x.c - Fixed all compiler warnings. - Removed functions tandem_adjust() which is not required by libsndfile. - - * g721.c - Fixed all compiler warnings. - Removed functions tandem_adjust_alaw() and tandem_adjust_ulaw () which are not - required by libsndfile. - Removed second parameter to g721_encoder () which is not required. - - * g72x.h - Removed in_coding and out_coding parameters from all functions. These allowed - g72x encoding/decoding to/from A-law or u-law and are not required by libsndfile. - Removed unneeded defines for A-law, u-law and linear encoding. - - * g723_16.c - Removed second parameter (in_coding) for g723_16_encoder(). - Removed second parameter (out_coding) for g723_16_decoder(). - - * private.h - New file containing prototypes and tyepdefs private to G72x code. - diff --git a/libs/libsndfile/src/G72x/Makefile.am b/libs/libsndfile/src/G72x/Makefile.am deleted file mode 100644 index 62a0aa112f..0000000000 --- a/libs/libsndfile/src/G72x/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -## Process this file with automake to produce Makefile.in - -EXTRA_DIST = README README.original ChangeLog - -noinst_HEADERS = g72x.h g72x_priv.h -noinst_LTLIBRARIES = libg72x.la - -noinst_PROGRAMS = g72x_test - -CFILES = g72x.c g721.c g723_16.c g723_24.c g723_40.c - -libg72x_la_SOURCES = $(CFILES) $(noinst_HEADERS) - -g72x_test_SOURCES = g72x_test.c -g72x_test_LDADD = ./libg72x.la -lm - -check: g72x_test$(EXEEXT) - ./g72x_test$(EXEEXT) all - -# Disable autoheader. -AUTOHEADER=echo - diff --git a/libs/libsndfile/src/G72x/README b/libs/libsndfile/src/G72x/README deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/libs/libsndfile/src/G72x/README.original b/libs/libsndfile/src/G72x/README.original deleted file mode 100644 index 23b0e7dd50..0000000000 --- a/libs/libsndfile/src/G72x/README.original +++ /dev/null @@ -1,94 +0,0 @@ -The files in this directory comprise ANSI-C language reference implementations -of the CCITT (International Telegraph and Telephone Consultative Committee) -G.711, G.721 and G.723 voice compressions. They have been tested on Sun -SPARCstations and passed 82 out of 84 test vectors published by CCITT -(Dec. 20, 1988) for G.721 and G.723. [The two remaining test vectors, -which the G.721 decoder implementation for u-law samples did not pass, -may be in error because they are identical to two other vectors for G.723_40.] - -This source code is released by Sun Microsystems, Inc. to the public domain. -Please give your acknowledgement in product literature if this code is used -in your product implementation. - -Sun Microsystems supports some CCITT audio formats in Solaris 2.0 system -software. However, Sun's implementations have been optimized for higher -performance on SPARCstations. - - -The source files for CCITT conversion routines in this directory are: - - g72x.h header file for g721.c, g723_24.c and g723_40.c - g711.c CCITT G.711 u-law and A-law compression - g72x.c common denominator of G.721 and G.723 ADPCM codes - g721.c CCITT G.721 32Kbps ADPCM coder (with g72x.c) - g723_24.c CCITT G.723 24Kbps ADPCM coder (with g72x.c) - g723_40.c CCITT G.723 40Kbps ADPCM coder (with g72x.c) - - -Simple conversions between u-law, A-law, and 16-bit linear PCM are invoked -as follows: - - unsigned char ucode, acode; - short pcm_val; - - ucode = linear2ulaw(pcm_val); - ucode = alaw2ulaw(acode); - - acode = linear2alaw(pcm_val); - acode = ulaw2alaw(ucode); - - pcm_val = ulaw2linear(ucode); - pcm_val = alaw2linear(acode); - - -The other CCITT compression routines are invoked as follows: - - #include "g72x.h" - - struct g72x_state state; - int sample, code; - - g72x_init_state(&state); - code = {g721,g723_24,g723_40}_encoder(sample, coding, &state); - sample = {g721,g723_24,g723_40}_decoder(code, coding, &state); - -where - coding = AUDIO_ENCODING_ULAW for 8-bit u-law samples - AUDIO_ENCODING_ALAW for 8-bit A-law samples - AUDIO_ENCODING_LINEAR for 16-bit linear PCM samples - - - -This directory also includes the following sample programs: - - encode.c CCITT ADPCM encoder - decode.c CCITT ADPCM decoder - Makefile makefile for the sample programs - - -The sample programs contain examples of how to call the various compression -routines and pack/unpack the bits. The sample programs read byte streams from -stdin and write to stdout. The input/output data is raw data (no file header -or other identifying information is embedded). The sample programs are -invoked as follows: - - encode [-3|4|5] [-a|u|l] outfile - decode [-3|4|5] [-a|u|l] outfile -where: - -3 encode to (decode from) G.723 24kbps (3-bit) data - -4 encode to (decode from) G.721 32kbps (4-bit) data [the default] - -5 encode to (decode from) G.723 40kbps (5-bit) data - -a encode from (decode to) A-law data - -u encode from (decode to) u-law data [the default] - -l encode from (decode to) 16-bit linear data - -Examples: - # Read 16-bit linear and output G.721 - encode -4 -l g721file - - # Read 40Kbps G.723 and output A-law - decode -5 -a alawfile - - # Compress and then decompress u-law data using 24Kbps G.723 - encode -3 ulawout - diff --git a/libs/libsndfile/src/G72x/g721.c b/libs/libsndfile/src/G72x/g721.c deleted file mode 100644 index d305ba8f0d..0000000000 --- a/libs/libsndfile/src/G72x/g721.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use. Users may copy or modify this source code without - * charge. - * - * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING - * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * g721.c - * - * Description: - * - * g721_encoder(), g721_decoder() - * - * These routines comprise an implementation of the CCITT G.721 ADPCM - * coding algorithm. Essentially, this implementation is identical to - * the bit level description except for a few deviations which - * take advantage of work station attributes, such as hardware 2's - * complement arithmetic and large memory. Specifically, certain time - * consuming operations such as multiplications are replaced - * with lookup tables and software 2's complement operations are - * replaced with hardware 2's complement. - * - * The deviation from the bit level specification (lookup tables) - * preserves the bit level performance specifications. - * - * As outlined in the G.721 Recommendation, the algorithm is broken - * down into modules. Each section of code below is preceded by - * the name of the module which it is implementing. - * - */ - -#include "g72x.h" -#include "g72x_priv.h" - -static short qtab_721[7] = {-124, 80, 178, 246, 300, 349, 400}; -/* - * Maps G.721 code word to reconstructed scale factor normalized log - * magnitude values. - */ -static short _dqlntab[16] = {-2048, 4, 135, 213, 273, 323, 373, 425, - 425, 373, 323, 273, 213, 135, 4, -2048}; - -/* Maps G.721 code word to log of scale factor multiplier. */ -static short _witab[16] = {-12, 18, 41, 64, 112, 198, 355, 1122, - 1122, 355, 198, 112, 64, 41, 18, -12}; -/* - * Maps G.721 code words to a set of values whose long and short - * term averages are computed and then compared to give an indication - * how stationary (steady state) the signal is. - */ -static short _fitab[16] = {0, 0, 0, 0x200, 0x200, 0x200, 0x600, 0xE00, - 0xE00, 0x600, 0x200, 0x200, 0x200, 0, 0, 0}; - -/* - * g721_encoder() - * - * Encodes the input vale of linear PCM, A-law or u-law data sl and returns - * the resulting code. -1 is returned for unknown input coding value. - */ -int -g721_encoder( - int sl, - G72x_STATE *state_ptr) -{ - short sezi, se, sez; /* ACCUM */ - short d; /* SUBTA */ - short sr; /* ADDB */ - short y; /* MIX */ - short dqsez; /* ADDC */ - short dq, i; - - /* linearize input sample to 14-bit PCM */ - sl >>= 2; /* 14-bit dynamic range */ - - sezi = predictor_zero(state_ptr); - sez = sezi >> 1; - se = (sezi + predictor_pole(state_ptr)) >> 1; /* estimated signal */ - - d = sl - se; /* estimation difference */ - - /* quantize the prediction difference */ - y = step_size(state_ptr); /* quantizer step size */ - i = quantize(d, y, qtab_721, 7); /* i = ADPCM code */ - - dq = reconstruct(i & 8, _dqlntab[i], y); /* quantized est diff */ - - sr = (dq < 0) ? se - (dq & 0x3FFF) : se + dq; /* reconst. signal */ - - dqsez = sr + sez - se; /* pole prediction diff. */ - - update(4, y, _witab[i] << 5, _fitab[i], dq, sr, dqsez, state_ptr); - - return (i); -} - -/* - * g721_decoder() - * - * Description: - * - * Decodes a 4-bit code of G.721 encoded data of i and - * returns the resulting linear PCM, A-law or u-law value. - * return -1 for unknown out_coding value. - */ -int -g721_decoder( - int i, - G72x_STATE *state_ptr) -{ - short sezi, sei, sez, se; /* ACCUM */ - short y; /* MIX */ - short sr; /* ADDB */ - short dq; - short dqsez; - - i &= 0x0f; /* mask to get proper bits */ - sezi = predictor_zero(state_ptr); - sez = sezi >> 1; - sei = sezi + predictor_pole(state_ptr); - se = sei >> 1; /* se = estimated signal */ - - y = step_size(state_ptr); /* dynamic quantizer step size */ - - dq = reconstruct(i & 0x08, _dqlntab[i], y); /* quantized diff. */ - - sr = (dq < 0) ? (se - (dq & 0x3FFF)) : se + dq; /* reconst. signal */ - - dqsez = sr - se + sez; /* pole prediction diff. */ - - update(4, y, _witab[i] << 5, _fitab[i], dq, sr, dqsez, state_ptr); - - /* sr was 14-bit dynamic range */ - return (sr << 2); -} - diff --git a/libs/libsndfile/src/G72x/g723_16.c b/libs/libsndfile/src/G72x/g723_16.c deleted file mode 100644 index ae90b6c438..0000000000 --- a/libs/libsndfile/src/G72x/g723_16.c +++ /dev/null @@ -1,162 +0,0 @@ -/* - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use. Users may copy or modify this source code without - * charge. - * - * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING - * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ -/* 16kbps version created, used 24kbps code and changing as little as possible. - * G.726 specs are available from ITU's gopher or WWW site (http://www.itu.ch) - * If any errors are found, please contact me at mrand@tamu.edu - * -Marc Randolph - */ - -/* - * g723_16.c - * - * Description: - * - * g723_16_encoder(), g723_16_decoder() - * - * These routines comprise an implementation of the CCITT G.726 16 Kbps - * ADPCM coding algorithm. Essentially, this implementation is identical to - * the bit level description except for a few deviations which take advantage - * of workstation attributes, such as hardware 2's complement arithmetic. - * - */ - -#include "g72x.h" -#include "g72x_priv.h" - -/* - * Maps G.723_16 code word to reconstructed scale factor normalized log - * magnitude values. Comes from Table 11/G.726 - */ -static short _dqlntab[4] = { 116, 365, 365, 116}; - -/* Maps G.723_16 code word to log of scale factor multiplier. - * - * _witab[4] is actually {-22 , 439, 439, -22}, but FILTD wants it - * as WI << 5 (multiplied by 32), so we'll do that here - */ -static short _witab[4] = {-704, 14048, 14048, -704}; - -/* - * Maps G.723_16 code words to a set of values whose long and short - * term averages are computed and then compared to give an indication - * how stationary (steady state) the signal is. - */ - -/* Comes from FUNCTF */ -static short _fitab[4] = {0, 0xE00, 0xE00, 0}; - -/* Comes from quantizer decision level tables (Table 7/G.726) - */ -static short qtab_723_16[1] = {261}; - - -/* - * g723_16_encoder() - * - * Encodes a linear PCM, A-law or u-law input sample and returns its 2-bit code. - * Returns -1 if invalid input coding value. - */ -int -g723_16_encoder( - int sl, - G72x_STATE *state_ptr) -{ - short sei, sezi, se, sez; /* ACCUM */ - short d; /* SUBTA */ - short y; /* MIX */ - short sr; /* ADDB */ - short dqsez; /* ADDC */ - short dq, i; - - /* linearize input sample to 14-bit PCM */ - sl >>= 2; /* sl of 14-bit dynamic range */ - - sezi = predictor_zero(state_ptr); - sez = sezi >> 1; - sei = sezi + predictor_pole(state_ptr); - se = sei >> 1; /* se = estimated signal */ - - d = sl - se; /* d = estimation diff. */ - - /* quantize prediction difference d */ - y = step_size(state_ptr); /* quantizer step size */ - i = quantize(d, y, qtab_723_16, 1); /* i = ADPCM code */ - - /* Since quantize() only produces a three level output - * (1, 2, or 3), we must create the fourth one on our own - */ - if (i == 3) /* i code for the zero region */ - if ((d & 0x8000) == 0) /* If d > 0, i=3 isn't right... */ - i = 0; - - dq = reconstruct(i & 2, _dqlntab[i], y); /* quantized diff. */ - - sr = (dq < 0) ? se - (dq & 0x3FFF) : se + dq; /* reconstructed signal */ - - dqsez = sr + sez - se; /* pole prediction diff. */ - - update(2, y, _witab[i], _fitab[i], dq, sr, dqsez, state_ptr); - - return (i); -} - -/* - * g723_16_decoder() - * - * Decodes a 2-bit CCITT G.723_16 ADPCM code and returns - * the resulting 16-bit linear PCM, A-law or u-law sample value. - * -1 is returned if the output coding is unknown. - */ -int -g723_16_decoder( - int i, - G72x_STATE *state_ptr) -{ - short sezi, sei, sez, se; /* ACCUM */ - short y; /* MIX */ - short sr; /* ADDB */ - short dq; - short dqsez; - - i &= 0x03; /* mask to get proper bits */ - sezi = predictor_zero(state_ptr); - sez = sezi >> 1; - sei = sezi + predictor_pole(state_ptr); - se = sei >> 1; /* se = estimated signal */ - - y = step_size(state_ptr); /* adaptive quantizer step size */ - dq = reconstruct(i & 0x02, _dqlntab[i], y); /* unquantize pred diff */ - - sr = (dq < 0) ? (se - (dq & 0x3FFF)) : (se + dq); /* reconst. signal */ - - dqsez = sr - se + sez; /* pole prediction diff. */ - - update(2, y, _witab[i], _fitab[i], dq, sr, dqsez, state_ptr); - - /* sr was of 14-bit dynamic range */ - return (sr << 2); -} - diff --git a/libs/libsndfile/src/G72x/g723_24.c b/libs/libsndfile/src/G72x/g723_24.c deleted file mode 100644 index 02b6c24a05..0000000000 --- a/libs/libsndfile/src/G72x/g723_24.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use. Users may copy or modify this source code without - * charge. - * - * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING - * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * g723_24.c - * - * Description: - * - * g723_24_encoder(), g723_24_decoder() - * - * These routines comprise an implementation of the CCITT G.723 24 Kbps - * ADPCM coding algorithm. Essentially, this implementation is identical to - * the bit level description except for a few deviations which take advantage - * of workstation attributes, such as hardware 2's complement arithmetic. - * - */ - -#include "g72x.h" -#include "g72x_priv.h" - -/* - * Maps G.723_24 code word to reconstructed scale factor normalized log - * magnitude values. - */ -static short _dqlntab[8] = {-2048, 135, 273, 373, 373, 273, 135, -2048}; - -/* Maps G.723_24 code word to log of scale factor multiplier. */ -static short _witab[8] = {-128, 960, 4384, 18624, 18624, 4384, 960, -128}; - -/* - * Maps G.723_24 code words to a set of values whose long and short - * term averages are computed and then compared to give an indication - * how stationary (steady state) the signal is. - */ -static short _fitab[8] = {0, 0x200, 0x400, 0xE00, 0xE00, 0x400, 0x200, 0}; - -static short qtab_723_24[3] = {8, 218, 331}; - -/* - * g723_24_encoder() - * - * Encodes a linear PCM, A-law or u-law input sample and returns its 3-bit code. - * Returns -1 if invalid input coding value. - */ -int -g723_24_encoder( - int sl, - G72x_STATE *state_ptr) -{ - short sei, sezi, se, sez; /* ACCUM */ - short d; /* SUBTA */ - short y; /* MIX */ - short sr; /* ADDB */ - short dqsez; /* ADDC */ - short dq, i; - - /* linearize input sample to 14-bit PCM */ - sl >>= 2; /* sl of 14-bit dynamic range */ - - sezi = predictor_zero(state_ptr); - sez = sezi >> 1; - sei = sezi + predictor_pole(state_ptr); - se = sei >> 1; /* se = estimated signal */ - - d = sl - se; /* d = estimation diff. */ - - /* quantize prediction difference d */ - y = step_size(state_ptr); /* quantizer step size */ - i = quantize(d, y, qtab_723_24, 3); /* i = ADPCM code */ - dq = reconstruct(i & 4, _dqlntab[i], y); /* quantized diff. */ - - sr = (dq < 0) ? se - (dq & 0x3FFF) : se + dq; /* reconstructed signal */ - - dqsez = sr + sez - se; /* pole prediction diff. */ - - update(3, y, _witab[i], _fitab[i], dq, sr, dqsez, state_ptr); - - return (i); -} - -/* - * g723_24_decoder() - * - * Decodes a 3-bit CCITT G.723_24 ADPCM code and returns - * the resulting 16-bit linear PCM, A-law or u-law sample value. - * -1 is returned if the output coding is unknown. - */ -int -g723_24_decoder( - int i, - G72x_STATE *state_ptr) -{ - short sezi, sei, sez, se; /* ACCUM */ - short y; /* MIX */ - short sr; /* ADDB */ - short dq; - short dqsez; - - i &= 0x07; /* mask to get proper bits */ - sezi = predictor_zero(state_ptr); - sez = sezi >> 1; - sei = sezi + predictor_pole(state_ptr); - se = sei >> 1; /* se = estimated signal */ - - y = step_size(state_ptr); /* adaptive quantizer step size */ - dq = reconstruct(i & 0x04, _dqlntab[i], y); /* unquantize pred diff */ - - sr = (dq < 0) ? (se - (dq & 0x3FFF)) : (se + dq); /* reconst. signal */ - - dqsez = sr - se + sez; /* pole prediction diff. */ - - update(3, y, _witab[i], _fitab[i], dq, sr, dqsez, state_ptr); - - return (sr << 2); /* sr was of 14-bit dynamic range */ -} - diff --git a/libs/libsndfile/src/G72x/g723_40.c b/libs/libsndfile/src/G72x/g723_40.c deleted file mode 100644 index d520395340..0000000000 --- a/libs/libsndfile/src/G72x/g723_40.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use. Users may copy or modify this source code without - * charge. - * - * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING - * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * g723_40.c - * - * Description: - * - * g723_40_encoder(), g723_40_decoder() - * - * These routines comprise an implementation of the CCITT G.723 40Kbps - * ADPCM coding algorithm. Essentially, this implementation is identical to - * the bit level description except for a few deviations which - * take advantage of workstation attributes, such as hardware 2's - * complement arithmetic. - * - * The deviation from the bit level specification (lookup tables), - * preserves the bit level performance specifications. - * - * As outlined in the G.723 Recommendation, the algorithm is broken - * down into modules. Each section of code below is preceded by - * the name of the module which it is implementing. - * - */ - -#include "g72x.h" -#include "g72x_priv.h" - -/* - * Maps G.723_40 code word to ructeconstructed scale factor normalized log - * magnitude values. - */ -static short _dqlntab[32] = {-2048, -66, 28, 104, 169, 224, 274, 318, - 358, 395, 429, 459, 488, 514, 539, 566, - 566, 539, 514, 488, 459, 429, 395, 358, - 318, 274, 224, 169, 104, 28, -66, -2048}; - -/* Maps G.723_40 code word to log of scale factor multiplier. */ -static short _witab[32] = {448, 448, 768, 1248, 1280, 1312, 1856, 3200, - 4512, 5728, 7008, 8960, 11456, 14080, 16928, 22272, - 22272, 16928, 14080, 11456, 8960, 7008, 5728, 4512, - 3200, 1856, 1312, 1280, 1248, 768, 448, 448}; - -/* - * Maps G.723_40 code words to a set of values whose long and short - * term averages are computed and then compared to give an indication - * how stationary (steady state) the signal is. - */ -static short _fitab[32] = {0, 0, 0, 0, 0, 0x200, 0x200, 0x200, - 0x200, 0x200, 0x400, 0x600, 0x800, 0xA00, 0xC00, 0xC00, - 0xC00, 0xC00, 0xA00, 0x800, 0x600, 0x400, 0x200, 0x200, - 0x200, 0x200, 0x200, 0, 0, 0, 0, 0}; - -static short qtab_723_40[15] = {-122, -16, 68, 139, 198, 250, 298, 339, - 378, 413, 445, 475, 502, 528, 553}; - -/* - * g723_40_encoder() - * - * Encodes a 16-bit linear PCM, A-law or u-law input sample and retuens - * the resulting 5-bit CCITT G.723 40Kbps code. - * Returns -1 if the input coding value is invalid. - */ -int g723_40_encoder (int sl, G72x_STATE *state_ptr) -{ - short sei, sezi, se, sez; /* ACCUM */ - short d; /* SUBTA */ - short y; /* MIX */ - short sr; /* ADDB */ - short dqsez; /* ADDC */ - short dq, i; - - /* linearize input sample to 14-bit PCM */ - sl >>= 2; /* sl of 14-bit dynamic range */ - - sezi = predictor_zero(state_ptr); - sez = sezi >> 1; - sei = sezi + predictor_pole(state_ptr); - se = sei >> 1; /* se = estimated signal */ - - d = sl - se; /* d = estimation difference */ - - /* quantize prediction difference */ - y = step_size(state_ptr); /* adaptive quantizer step size */ - i = quantize(d, y, qtab_723_40, 15); /* i = ADPCM code */ - - dq = reconstruct(i & 0x10, _dqlntab[i], y); /* quantized diff */ - - sr = (dq < 0) ? se - (dq & 0x7FFF) : se + dq; /* reconstructed signal */ - - dqsez = sr + sez - se; /* dqsez = pole prediction diff. */ - - update(5, y, _witab[i], _fitab[i], dq, sr, dqsez, state_ptr); - - return (i); -} - -/* - * g723_40_decoder() - * - * Decodes a 5-bit CCITT G.723 40Kbps code and returns - * the resulting 16-bit linear PCM, A-law or u-law sample value. - * -1 is returned if the output coding is unknown. - */ -int g723_40_decoder (int i, G72x_STATE *state_ptr) -{ - short sezi, sei, sez, se; /* ACCUM */ - short y ; /* MIX */ - short sr; /* ADDB */ - short dq; - short dqsez; - - i &= 0x1f; /* mask to get proper bits */ - sezi = predictor_zero(state_ptr); - sez = sezi >> 1; - sei = sezi + predictor_pole(state_ptr); - se = sei >> 1; /* se = estimated signal */ - - y = step_size(state_ptr); /* adaptive quantizer step size */ - dq = reconstruct(i & 0x10, _dqlntab[i], y); /* estimation diff. */ - - sr = (dq < 0) ? (se - (dq & 0x7FFF)) : (se + dq); /* reconst. signal */ - - dqsez = sr - se + sez; /* pole prediction diff. */ - - update(5, y, _witab[i], _fitab[i], dq, sr, dqsez, state_ptr); - - return (sr << 2); /* sr was of 14-bit dynamic range */ -} - diff --git a/libs/libsndfile/src/G72x/g72x.c b/libs/libsndfile/src/G72x/g72x.c deleted file mode 100644 index 3fae81aa8e..0000000000 --- a/libs/libsndfile/src/G72x/g72x.c +++ /dev/null @@ -1,644 +0,0 @@ -/* - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use. Users may copy or modify this source code without - * charge. - * - * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING - * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * g72x.c - * - * Common routines for G.721 and G.723 conversions. - */ - -#include -#include -#include - -#include "g72x.h" -#include "g72x_priv.h" - -static G72x_STATE * g72x_state_new (void) ; -static int unpack_bytes (int bits, int blocksize, const unsigned char * block, short * samples) ; -static int pack_bytes (int bits, const short * samples, unsigned char * block) ; - -static -short power2 [15] = -{ 1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80, - 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000 -} ; - -/* - * quan() - * - * quantizes the input val against the table of size short integers. - * It returns i if table[i - 1] <= val < table[i]. - * - * Using linear search for simple coding. - */ -static -int quan (int val, short *table, int size) -{ - int i; - - for (i = 0; i < size; i++) - if (val < *table++) - break; - return (i); -} - -/* - * fmult() - * - * returns the integer product of the 14-bit integer "an" and - * "floating point" representation (4-bit exponent, 6-bit mantessa) "srn". - */ -static -int fmult (int an, int srn) -{ - short anmag, anexp, anmant; - short wanexp, wanmant; - short retval; - - anmag = (an > 0) ? an : ((-an) & 0x1FFF); - anexp = quan(anmag, power2, 15) - 6; - anmant = (anmag == 0) ? 32 : - (anexp >= 0) ? anmag >> anexp : anmag << -anexp; - wanexp = anexp + ((srn >> 6) & 0xF) - 13; - - /* - ** The original was : - ** wanmant = (anmant * (srn & 0x3F) + 0x30) >> 4 ; - ** but could see no valid reason for the + 0x30. - ** Removed it and it improved the SNR of the codec. - */ - - wanmant = (anmant * (srn & 0x3F)) >> 4 ; - - retval = (wanexp >= 0) ? ((wanmant << wanexp) & 0x7FFF) : - (wanmant >> -wanexp); - - return (((an ^ srn) < 0) ? -retval : retval); -} - -static G72x_STATE * g72x_state_new (void) -{ return calloc (1, sizeof (G72x_STATE)) ; -} - -/* - * private_init_state() - * - * This routine initializes and/or resets the G72x_PRIVATE structure - * pointed to by 'state_ptr'. - * All the initial state values are specified in the CCITT G.721 document. - */ -void private_init_state (G72x_STATE *state_ptr) -{ - int cnta; - - state_ptr->yl = 34816; - state_ptr->yu = 544; - state_ptr->dms = 0; - state_ptr->dml = 0; - state_ptr->ap = 0; - for (cnta = 0; cnta < 2; cnta++) { - state_ptr->a[cnta] = 0; - state_ptr->pk[cnta] = 0; - state_ptr->sr[cnta] = 32; - } - for (cnta = 0; cnta < 6; cnta++) { - state_ptr->b[cnta] = 0; - state_ptr->dq[cnta] = 32; - } - state_ptr->td = 0; -} /* private_init_state */ - -struct g72x_state * g72x_reader_init (int codec, int *blocksize, int *samplesperblock) -{ G72x_STATE *pstate ; - - if ((pstate = g72x_state_new ()) == NULL) - return NULL ; - - private_init_state (pstate) ; - - pstate->encoder = NULL ; - - switch (codec) - { case G723_16_BITS_PER_SAMPLE : /* 2 bits per sample. */ - pstate->decoder = g723_16_decoder ; - *blocksize = G723_16_BYTES_PER_BLOCK ; - *samplesperblock = G723_16_SAMPLES_PER_BLOCK ; - pstate->codec_bits = 2 ; - pstate->blocksize = G723_16_BYTES_PER_BLOCK ; - pstate->samplesperblock = G723_16_SAMPLES_PER_BLOCK ; - break ; - - case G723_24_BITS_PER_SAMPLE : /* 3 bits per sample. */ - pstate->decoder = g723_24_decoder ; - *blocksize = G723_24_BYTES_PER_BLOCK ; - *samplesperblock = G723_24_SAMPLES_PER_BLOCK ; - pstate->codec_bits = 3 ; - pstate->blocksize = G723_24_BYTES_PER_BLOCK ; - pstate->samplesperblock = G723_24_SAMPLES_PER_BLOCK ; - break ; - - case G721_32_BITS_PER_SAMPLE : /* 4 bits per sample. */ - pstate->decoder = g721_decoder ; - *blocksize = G721_32_BYTES_PER_BLOCK ; - *samplesperblock = G721_32_SAMPLES_PER_BLOCK ; - pstate->codec_bits = 4 ; - pstate->blocksize = G721_32_BYTES_PER_BLOCK ; - pstate->samplesperblock = G721_32_SAMPLES_PER_BLOCK ; - break ; - - case G721_40_BITS_PER_SAMPLE : /* 5 bits per sample. */ - pstate->decoder = g723_40_decoder ; - *blocksize = G721_40_BYTES_PER_BLOCK ; - *samplesperblock = G721_40_SAMPLES_PER_BLOCK ; - pstate->codec_bits = 5 ; - pstate->blocksize = G721_40_BYTES_PER_BLOCK ; - pstate->samplesperblock = G721_40_SAMPLES_PER_BLOCK ; - break ; - - default : - free (pstate) ; - return NULL ; - } ; - - return pstate ; -} /* g72x_reader_init */ - -struct g72x_state * g72x_writer_init (int codec, int *blocksize, int *samplesperblock) -{ G72x_STATE *pstate ; - - if ((pstate = g72x_state_new ()) == NULL) - return NULL ; - - private_init_state (pstate) ; - pstate->decoder = NULL ; - - switch (codec) - { case G723_16_BITS_PER_SAMPLE : /* 2 bits per sample. */ - pstate->encoder = g723_16_encoder ; - *blocksize = G723_16_BYTES_PER_BLOCK ; - *samplesperblock = G723_16_SAMPLES_PER_BLOCK ; - pstate->codec_bits = 2 ; - pstate->blocksize = G723_16_BYTES_PER_BLOCK ; - pstate->samplesperblock = G723_16_SAMPLES_PER_BLOCK ; - break ; - - case G723_24_BITS_PER_SAMPLE : /* 3 bits per sample. */ - pstate->encoder = g723_24_encoder ; - *blocksize = G723_24_BYTES_PER_BLOCK ; - *samplesperblock = G723_24_SAMPLES_PER_BLOCK ; - pstate->codec_bits = 3 ; - pstate->blocksize = G723_24_BYTES_PER_BLOCK ; - pstate->samplesperblock = G723_24_SAMPLES_PER_BLOCK ; - break ; - - case G721_32_BITS_PER_SAMPLE : /* 4 bits per sample. */ - pstate->encoder = g721_encoder ; - *blocksize = G721_32_BYTES_PER_BLOCK ; - *samplesperblock = G721_32_SAMPLES_PER_BLOCK ; - pstate->codec_bits = 4 ; - pstate->blocksize = G721_32_BYTES_PER_BLOCK ; - pstate->samplesperblock = G721_32_SAMPLES_PER_BLOCK ; - break ; - - case G721_40_BITS_PER_SAMPLE : /* 5 bits per sample. */ - pstate->encoder = g723_40_encoder ; - *blocksize = G721_40_BYTES_PER_BLOCK ; - *samplesperblock = G721_40_SAMPLES_PER_BLOCK ; - pstate->codec_bits = 5 ; - pstate->blocksize = G721_40_BYTES_PER_BLOCK ; - pstate->samplesperblock = G721_40_SAMPLES_PER_BLOCK ; - break ; - - default : - free (pstate) ; - return NULL ; - } ; - - return pstate ; -} /* g72x_writer_init */ - -int g72x_decode_block (G72x_STATE *pstate, const unsigned char *block, short *samples) -{ int k, count ; - - count = unpack_bytes (pstate->codec_bits, pstate->blocksize, block, samples) ; - - for (k = 0 ; k < count ; k++) - samples [k] = pstate->decoder (samples [k], pstate) ; - - return 0 ; -} /* g72x_decode_block */ - -int g72x_encode_block (G72x_STATE *pstate, short *samples, unsigned char *block) -{ int k, count ; - - for (k = 0 ; k < pstate->samplesperblock ; k++) - samples [k] = pstate->encoder (samples [k], pstate) ; - - count = pack_bytes (pstate->codec_bits, samples, block) ; - - return count ; -} /* g72x_encode_block */ - -/* - * predictor_zero() - * - * computes the estimated signal from 6-zero predictor. - * - */ -int predictor_zero (G72x_STATE *state_ptr) -{ - int i; - int sezi; - - sezi = fmult(state_ptr->b[0] >> 2, state_ptr->dq[0]); - for (i = 1; i < 6; i++) /* ACCUM */ - sezi += fmult(state_ptr->b[i] >> 2, state_ptr->dq[i]); - return (sezi); -} -/* - * predictor_pole() - * - * computes the estimated signal from 2-pole predictor. - * - */ -int predictor_pole(G72x_STATE *state_ptr) -{ - return (fmult(state_ptr->a[1] >> 2, state_ptr->sr[1]) + - fmult(state_ptr->a[0] >> 2, state_ptr->sr[0])); -} -/* - * step_size() - * - * computes the quantization step size of the adaptive quantizer. - * - */ -int step_size (G72x_STATE *state_ptr) -{ - int y; - int dif; - int al; - - if (state_ptr->ap >= 256) - return (state_ptr->yu); - else { - y = state_ptr->yl >> 6; - dif = state_ptr->yu - y; - al = state_ptr->ap >> 2; - if (dif > 0) - y += (dif * al) >> 6; - else if (dif < 0) - y += (dif * al + 0x3F) >> 6; - return (y); - } -} - -/* - * quantize() - * - * Given a raw sample, 'd', of the difference signal and a - * quantization step size scale factor, 'y', this routine returns the - * ADPCM codeword to which that sample gets quantized. The step - * size scale factor division operation is done in the log base 2 domain - * as a subtraction. - */ -int quantize( - int d, /* Raw difference signal sample */ - int y, /* Step size multiplier */ - short *table, /* quantization table */ - int size) /* table size of short integers */ -{ - short dqm; /* Magnitude of 'd' */ - short expon; /* Integer part of base 2 log of 'd' */ - short mant; /* Fractional part of base 2 log */ - short dl; /* Log of magnitude of 'd' */ - short dln; /* Step size scale factor normalized log */ - int i; - - /* - * LOG - * - * Compute base 2 log of 'd', and store in 'dl'. - */ - dqm = abs(d); - expon = quan(dqm >> 1, power2, 15); - mant = ((dqm << 7) >> expon) & 0x7F; /* Fractional portion. */ - dl = (expon << 7) + mant; - - /* - * SUBTB - * - * "Divide" by step size multiplier. - */ - dln = dl - (y >> 2); - - /* - * QUAN - * - * Obtain codword i for 'd'. - */ - i = quan(dln, table, size); - if (d < 0) /* take 1's complement of i */ - return ((size << 1) + 1 - i); - else if (i == 0) /* take 1's complement of 0 */ - return ((size << 1) + 1); /* new in 1988 */ - else - return (i); -} -/* - * reconstruct() - * - * Returns reconstructed difference signal 'dq' obtained from - * codeword 'i' and quantization step size scale factor 'y'. - * Multiplication is performed in log base 2 domain as addition. - */ -int -reconstruct( - int sign, /* 0 for non-negative value */ - int dqln, /* G.72x codeword */ - int y) /* Step size multiplier */ -{ - short dql; /* Log of 'dq' magnitude */ - short dex; /* Integer part of log */ - short dqt; - short dq; /* Reconstructed difference signal sample */ - - dql = dqln + (y >> 2); /* ADDA */ - - if (dql < 0) { - return ((sign) ? -0x8000 : 0); - } else { /* ANTILOG */ - dex = (dql >> 7) & 15; - dqt = 128 + (dql & 127); - dq = (dqt << 7) >> (14 - dex); - return ((sign) ? (dq - 0x8000) : dq); - } -} - - -/* - * update() - * - * updates the state variables for each output code - */ -void -update( - int code_size, /* distinguish 723_40 with others */ - int y, /* quantizer step size */ - int wi, /* scale factor multiplier */ - int fi, /* for long/short term energies */ - int dq, /* quantized prediction difference */ - int sr, /* reconstructed signal */ - int dqsez, /* difference from 2-pole predictor */ - G72x_STATE *state_ptr) /* coder state pointer */ -{ - int cnt; - short mag, expon; /* Adaptive predictor, FLOAT A */ - short a2p = 0; /* LIMC */ - short a1ul; /* UPA1 */ - short pks1; /* UPA2 */ - short fa1; - char tr; /* tone/transition detector */ - short ylint, thr2, dqthr; - short ylfrac, thr1; - short pk0; - - pk0 = (dqsez < 0) ? 1 : 0; /* needed in updating predictor poles */ - - mag = dq & 0x7FFF; /* prediction difference magnitude */ - /* TRANS */ - ylint = state_ptr->yl >> 15; /* exponent part of yl */ - ylfrac = (state_ptr->yl >> 10) & 0x1F; /* fractional part of yl */ - thr1 = (32 + ylfrac) << ylint; /* threshold */ - thr2 = (ylint > 9) ? 31 << 10 : thr1; /* limit thr2 to 31 << 10 */ - dqthr = (thr2 + (thr2 >> 1)) >> 1; /* dqthr = 0.75 * thr2 */ - if (state_ptr->td == 0) /* signal supposed voice */ - tr = 0; - else if (mag <= dqthr) /* supposed data, but small mag */ - tr = 0; /* treated as voice */ - else /* signal is data (modem) */ - tr = 1; - - /* - * Quantizer scale factor adaptation. - */ - - /* FUNCTW & FILTD & DELAY */ - /* update non-steady state step size multiplier */ - state_ptr->yu = y + ((wi - y) >> 5); - - /* LIMB */ - if (state_ptr->yu < 544) /* 544 <= yu <= 5120 */ - state_ptr->yu = 544; - else if (state_ptr->yu > 5120) - state_ptr->yu = 5120; - - /* FILTE & DELAY */ - /* update steady state step size multiplier */ - state_ptr->yl += state_ptr->yu + ((-state_ptr->yl) >> 6); - - /* - * Adaptive predictor coefficients. - */ - if (tr == 1) { /* reset a's and b's for modem signal */ - state_ptr->a[0] = 0; - state_ptr->a[1] = 0; - state_ptr->b[0] = 0; - state_ptr->b[1] = 0; - state_ptr->b[2] = 0; - state_ptr->b[3] = 0; - state_ptr->b[4] = 0; - state_ptr->b[5] = 0; - } else { /* update a's and b's */ - pks1 = pk0 ^ state_ptr->pk[0]; /* UPA2 */ - - /* update predictor pole a[1] */ - a2p = state_ptr->a[1] - (state_ptr->a[1] >> 7); - if (dqsez != 0) { - fa1 = (pks1) ? state_ptr->a[0] : -state_ptr->a[0]; - if (fa1 < -8191) /* a2p = function of fa1 */ - a2p -= 0x100; - else if (fa1 > 8191) - a2p += 0xFF; - else - a2p += fa1 >> 5; - - if (pk0 ^ state_ptr->pk[1]) - { /* LIMC */ - if (a2p <= -12160) - a2p = -12288; - else if (a2p >= 12416) - a2p = 12288; - else - a2p -= 0x80; - } - else if (a2p <= -12416) - a2p = -12288; - else if (a2p >= 12160) - a2p = 12288; - else - a2p += 0x80; - } - - /* TRIGB & DELAY */ - state_ptr->a[1] = a2p; - - /* UPA1 */ - /* update predictor pole a[0] */ - state_ptr->a[0] -= state_ptr->a[0] >> 8; - if (dqsez != 0) - { if (pks1 == 0) - state_ptr->a[0] += 192; - else - state_ptr->a[0] -= 192; - } ; - - /* LIMD */ - a1ul = 15360 - a2p; - if (state_ptr->a[0] < -a1ul) - state_ptr->a[0] = -a1ul; - else if (state_ptr->a[0] > a1ul) - state_ptr->a[0] = a1ul; - - /* UPB : update predictor zeros b[6] */ - for (cnt = 0; cnt < 6; cnt++) { - if (code_size == 5) /* for 40Kbps G.723 */ - state_ptr->b[cnt] -= state_ptr->b[cnt] >> 9; - else /* for G.721 and 24Kbps G.723 */ - state_ptr->b[cnt] -= state_ptr->b[cnt] >> 8; - if (dq & 0x7FFF) { /* XOR */ - if ((dq ^ state_ptr->dq[cnt]) >= 0) - state_ptr->b[cnt] += 128; - else - state_ptr->b[cnt] -= 128; - } - } - } - - for (cnt = 5; cnt > 0; cnt--) - state_ptr->dq[cnt] = state_ptr->dq[cnt-1]; - /* FLOAT A : convert dq[0] to 4-bit exp, 6-bit mantissa f.p. */ - if (mag == 0) { - state_ptr->dq[0] = (dq >= 0) ? 0x20 : 0xFC20; - } else { - expon = quan(mag, power2, 15); - state_ptr->dq[0] = (dq >= 0) ? - (expon << 6) + ((mag << 6) >> expon) : - (expon << 6) + ((mag << 6) >> expon) - 0x400; - } - - state_ptr->sr[1] = state_ptr->sr[0]; - /* FLOAT B : convert sr to 4-bit exp., 6-bit mantissa f.p. */ - if (sr == 0) { - state_ptr->sr[0] = 0x20; - } else if (sr > 0) { - expon = quan(sr, power2, 15); - state_ptr->sr[0] = (expon << 6) + ((sr << 6) >> expon); - } else if (sr > -32768) { - mag = -sr; - expon = quan(mag, power2, 15); - state_ptr->sr[0] = (expon << 6) + ((mag << 6) >> expon) - 0x400; - } else - state_ptr->sr[0] = (short) 0xFC20; - - /* DELAY A */ - state_ptr->pk[1] = state_ptr->pk[0]; - state_ptr->pk[0] = pk0; - - /* TONE */ - if (tr == 1) /* this sample has been treated as data */ - state_ptr->td = 0; /* next one will be treated as voice */ - else if (a2p < -11776) /* small sample-to-sample correlation */ - state_ptr->td = 1; /* signal may be data */ - else /* signal is voice */ - state_ptr->td = 0; - - /* - * Adaptation speed control. - */ - state_ptr->dms += (fi - state_ptr->dms) >> 5; /* FILTA */ - state_ptr->dml += (((fi << 2) - state_ptr->dml) >> 7); /* FILTB */ - - if (tr == 1) - state_ptr->ap = 256; - else if (y < 1536) /* SUBTC */ - state_ptr->ap += (0x200 - state_ptr->ap) >> 4; - else if (state_ptr->td == 1) - state_ptr->ap += (0x200 - state_ptr->ap) >> 4; - else if (abs((state_ptr->dms << 2) - state_ptr->dml) >= - (state_ptr->dml >> 3)) - state_ptr->ap += (0x200 - state_ptr->ap) >> 4; - else - state_ptr->ap += (-state_ptr->ap) >> 4; - - return ; -} /* update */ - -/*------------------------------------------------------------------------------ -*/ - -static int -unpack_bytes (int bits, int blocksize, const unsigned char * block, short * samples) -{ unsigned int in_buffer = 0 ; - unsigned char in_byte ; - int k, in_bits = 0, bindex = 0 ; - - for (k = 0 ; bindex <= blocksize && k < G72x_BLOCK_SIZE ; k++) - { if (in_bits < bits) - { in_byte = block [bindex++] ; - - in_buffer |= (in_byte << in_bits); - in_bits += 8; - } - samples [k] = in_buffer & ((1 << bits) - 1); - in_buffer >>= bits; - in_bits -= bits; - } ; - - return k ; -} /* unpack_bytes */ - -static int -pack_bytes (int bits, const short * samples, unsigned char * block) -{ - unsigned int out_buffer = 0 ; - int k, bindex = 0, out_bits = 0 ; - unsigned char out_byte ; - - for (k = 0 ; k < G72x_BLOCK_SIZE ; k++) - { out_buffer |= (samples [k] << out_bits) ; - out_bits += bits ; - if (out_bits >= 8) - { out_byte = out_buffer & 0xFF ; - out_bits -= 8 ; - out_buffer >>= 8 ; - block [bindex++] = out_byte ; - } - } ; - - return bindex ; -} /* pack_bytes */ - diff --git a/libs/libsndfile/src/G72x/g72x.h b/libs/libsndfile/src/G72x/g72x.h deleted file mode 100644 index d7631e6d8e..0000000000 --- a/libs/libsndfile/src/G72x/g72x.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -** Copyright (C) 1999-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** This file is not the same as the original file from Sun Microsystems. Nearly -** all the original definitions and function prototypes that were in the file -** of this name have been moved to g72x_priv.h. -*/ - -#ifndef G72X_HEADER_FILE -#define G72X_HEADER_FILE - -/* -** Number of samples per block to process. -** Must be a common multiple of possible bits per sample : 2, 3, 4, 5 and 8. -*/ -#define G72x_BLOCK_SIZE (3 * 5 * 8) - -/* -** Identifiers for the differing kinds of G72x ADPCM codecs. -** The identifiers also define the number of encoded bits per sample. -*/ - -enum -{ G723_16_BITS_PER_SAMPLE = 2, - G723_24_BITS_PER_SAMPLE = 3, - G723_40_BITS_PER_SAMPLE = 5, - - G721_32_BITS_PER_SAMPLE = 4, - G721_40_BITS_PER_SAMPLE = 5, - - G723_16_SAMPLES_PER_BLOCK = G72x_BLOCK_SIZE, - G723_24_SAMPLES_PER_BLOCK = G723_24_BITS_PER_SAMPLE * (G72x_BLOCK_SIZE / G723_24_BITS_PER_SAMPLE), - G723_40_SAMPLES_PER_BLOCK = G723_40_BITS_PER_SAMPLE * (G72x_BLOCK_SIZE / G723_40_BITS_PER_SAMPLE), - - G721_32_SAMPLES_PER_BLOCK = G72x_BLOCK_SIZE, - G721_40_SAMPLES_PER_BLOCK = G721_40_BITS_PER_SAMPLE * (G72x_BLOCK_SIZE / G721_40_BITS_PER_SAMPLE), - - G723_16_BYTES_PER_BLOCK = (G723_16_BITS_PER_SAMPLE * G72x_BLOCK_SIZE) / 8, - G723_24_BYTES_PER_BLOCK = (G723_24_BITS_PER_SAMPLE * G72x_BLOCK_SIZE) / 8, - G723_40_BYTES_PER_BLOCK = (G723_40_BITS_PER_SAMPLE * G72x_BLOCK_SIZE) / 8, - - G721_32_BYTES_PER_BLOCK = (G721_32_BITS_PER_SAMPLE * G72x_BLOCK_SIZE) / 8, - G721_40_BYTES_PER_BLOCK = (G721_40_BITS_PER_SAMPLE * G72x_BLOCK_SIZE) / 8 -} ; - -/* Forward declaration of of g72x_state. */ - -struct g72x_state ; - -/* External function definitions. */ - -struct g72x_state * g72x_reader_init (int codec, int *blocksize, int *samplesperblock) ; -struct g72x_state * g72x_writer_init (int codec, int *blocksize, int *samplesperblock) ; -/* -** Initialize the ADPCM state table for the given codec. -** Return 0 on success, 1 on fail. -*/ - -int g72x_decode_block (struct g72x_state *pstate, const unsigned char *block, short *samples) ; -/* -** The caller fills data->block with data->bytes bytes before calling the -** function. The value data->bytes must be an integer multiple of -** data->blocksize and be <= data->max_bytes. -** When it returns, the caller can read out data->samples samples. -*/ - -int g72x_encode_block (struct g72x_state *pstate, short *samples, unsigned char *block) ; -/* -** The caller fills state->samples some integer multiple data->samples_per_block -** (up to G72x_BLOCK_SIZE) samples before calling the function. -** When it returns, the caller can read out bytes encoded bytes. -*/ - -#endif /* !G72X_HEADER_FILE */ - diff --git a/libs/libsndfile/src/G72x/g72x_priv.h b/libs/libsndfile/src/G72x/g72x_priv.h deleted file mode 100644 index 867c64b385..0000000000 --- a/libs/libsndfile/src/G72x/g72x_priv.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use. Users may copy or modify this source code without - * charge. - * - * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING - * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#ifndef G72X_PRIVATE_H -#define G72X_PRIVATE_H - -#ifdef __cplusplus -#error "This code is not designed to be compiled with a C++ compiler." -#endif - -/* -** The following is the definition of the state structure used by the -** G.721/G.723 encoder and decoder to preserve their internal state -** between successive calls. The meanings of the majority of the state -** structure fields are explained in detail in the CCITT Recommendation -** G.721. The field names are essentially identical to variable names -** in the bit level description of the coding algorithm included in this -** Recommendation. -*/ - -struct g72x_state -{ long yl; /* Locked or steady state step size multiplier. */ - short yu; /* Unlocked or non-steady state step size multiplier. */ - short dms; /* Short term energy estimate. */ - short dml; /* Long term energy estimate. */ - short ap; /* Linear weighting coefficient of 'yl' and 'yu'. */ - - short a[2]; /* Coefficients of pole portion of prediction filter. */ - short b[6]; /* Coefficients of zero portion of prediction filter. */ - short pk[2]; /* - ** Signs of previous two samples of a partially - ** reconstructed signal. - **/ - short dq[6]; /* - ** Previous 6 samples of the quantized difference - ** signal represented in an internal floating point - ** format. - **/ - short sr[2]; /* - ** Previous 2 samples of the quantized difference - ** signal represented in an internal floating point - ** format. - */ - char td; /* delayed tone detect, new in 1988 version */ - - /* The following struct members were added for libsndfile. The original - ** code worked by calling a set of functions on a sample by sample basis - ** which is slow on architectures like Intel x86. For libsndfile, this - ** was changed so that the encoding and decoding routines could work on - ** a block of samples at a time to reduce the function call overhead. - */ - int (*encoder) (int, struct g72x_state* state) ; - int (*decoder) (int, struct g72x_state* state) ; - - int codec_bits, blocksize, samplesperblock ; -} ; - -typedef struct g72x_state G72x_STATE ; - -int predictor_zero (G72x_STATE *state_ptr); - -int predictor_pole (G72x_STATE *state_ptr); - -int step_size (G72x_STATE *state_ptr); - -int quantize (int d, int y, short *table, int size); - -int reconstruct (int sign, int dqln, int y); - -void update (int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, G72x_STATE *state_ptr); - -int g721_encoder (int sample, G72x_STATE *state_ptr); -int g721_decoder (int code, G72x_STATE *state_ptr); - -int g723_16_encoder (int sample, G72x_STATE *state_ptr); -int g723_16_decoder (int code, G72x_STATE *state_ptr); - -int g723_24_encoder (int sample, G72x_STATE *state_ptr); -int g723_24_decoder (int code, G72x_STATE *state_ptr); - -int g723_40_encoder (int sample, G72x_STATE *state_ptr); -int g723_40_decoder (int code, G72x_STATE *state_ptr); - -void private_init_state (G72x_STATE *state_ptr) ; - -#endif /* G72X_PRIVATE_H */ diff --git a/libs/libsndfile/src/G72x/g72x_test.c b/libs/libsndfile/src/G72x/g72x_test.c deleted file mode 100644 index 79cabce11b..0000000000 --- a/libs/libsndfile/src/G72x/g72x_test.c +++ /dev/null @@ -1,214 +0,0 @@ -/* -** Copyright (C) 1999-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include -#include - -#include "g72x.h" -#include "g72x_priv.h" - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -#define BUFFER_SIZE (1<<14) /* Should be (1<<14) */ -#define SAMPLE_RATE 11025 - - -static void g721_test (void) ; -static void g723_test (double margin) ; - -static void gen_signal_double (double *data, double scale, int datalen) ; -static int error_function (double data, double orig, double margin) ; - -static int oct_save_short (short *a, short *b, int len) ; - -int -main (int argc, char *argv []) -{ int bDoAll = 0 ; - int nTests = 0 ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" g721 - test G721 encoder and decoder\n") ; - printf (" g723 - test G721 encoder and decoder\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - bDoAll=!strcmp (argv [1], "all"); - - if (bDoAll || ! strcmp (argv [1], "g721")) - { g721_test () ; - nTests++ ; - } ; - - if (bDoAll || ! strcmp (argv [1], "g723")) - { g723_test (0.53) ; - nTests++ ; - } ; - - if (nTests == 0) - { printf ("Mono : ************************************\n") ; - printf ("Mono : * No '%s' test defined.\n", argv [1]) ; - printf ("Mono : ************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - -static void -g721_test (void) -{ - return ; -} /* g721_test */ - -static void -g723_test (double margin) -{ static double orig_buffer [BUFFER_SIZE] ; - static short orig [BUFFER_SIZE] ; - static short data [BUFFER_SIZE] ; - - G72x_STATE encoder_state, decoder_state ; - - long k ; - int code, position, max_err ; - - private_init_state (&encoder_state) ; - encoder_state.encoder = g723_24_encoder ; - encoder_state.codec_bits = 3 ; - - private_init_state (&decoder_state) ; - decoder_state.decoder = g723_24_decoder ; - decoder_state.codec_bits = 3 ; - - memset (data, 0, BUFFER_SIZE * sizeof (short)) ; - memset (orig, 0, BUFFER_SIZE * sizeof (short)) ; - - printf (" g723_test : ") ; - fflush (stdout) ; - - gen_signal_double (orig_buffer, 32000.0, BUFFER_SIZE) ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - orig [k] = (short) orig_buffer [k] ; - - /* Write and read data here. */ - position = 0 ; - max_err = 0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - { code = encoder_state.encoder (orig [k], &encoder_state) ; - data [k] = decoder_state.decoder (code, &decoder_state) ; - if (abs (orig [k] - data [k]) > max_err) - { position = k ; - max_err = abs (orig [k] - data [k]) ; - } ; - } ; - - printf ("\n\nMax error of %d at postion %d.\n", max_err, position) ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - { if (error_function (data [k], orig [k], margin)) - { printf ("Line %d: Incorrect sample A (#%ld : %d should be %d).\n", __LINE__, k, data [k], orig [k]) ; - oct_save_short (orig, data, BUFFER_SIZE) ; - exit (1) ; - } ; - } ; - - - printf ("ok\n") ; - - return ; -} /* g723_test */ - - -#define SIGNAL_MAXVAL 30000.0 -#define DECAY_COUNT 1000 - -static void -gen_signal_double (double *gendata, double scale, int gendatalen) -{ int k, ramplen ; - double amp = 0.0 ; - - ramplen = DECAY_COUNT ; - - for (k = 0 ; k < gendatalen ; k++) - { if (k <= ramplen) - amp = scale * k / ((double) ramplen) ; - else if (k > gendatalen - ramplen) - amp = scale * (gendatalen - k) / ((double) ramplen) ; - - gendata [k] = amp * (0.4 * sin (33.3 * 2.0 * M_PI * ((double) (k+1)) / ((double) SAMPLE_RATE)) - + 0.3 * cos (201.1 * 2.0 * M_PI * ((double) (k+1)) / ((double) SAMPLE_RATE))) ; - } ; - - return ; -} /* gen_signal_double */ - -static int -error_function (double data, double orig, double margin) -{ double error ; - - if (fabs (orig) <= 500.0) - error = fabs (fabs (data) - fabs(orig)) / 2000.0 ; - else if (fabs (orig) <= 1000.0) - error = fabs (data - orig) / 3000.0 ; - else - error = fabs (data - orig) / fabs (orig) ; - - if (error > margin) - { printf ("\n\n*******************\nError : %f\n", error) ; - return 1 ; - } ; - return 0 ; -} /* error_function */ - -static int -oct_save_short (short *a, short *b, int len) -{ FILE *file ; - int k ; - - if (! (file = fopen ("error.dat", "w"))) - return 1 ; - - fprintf (file, "# Not created by Octave\n") ; - - fprintf (file, "# name: a\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, "% d\n", a [k]) ; - - fprintf (file, "# name: b\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, "% d\n", b [k]) ; - - fclose (file) ; - return 0 ; -} /* oct_save_short */ - diff --git a/libs/libsndfile/src/GSM610/COPYRIGHT b/libs/libsndfile/src/GSM610/COPYRIGHT deleted file mode 100644 index eba0e523bb..0000000000 --- a/libs/libsndfile/src/GSM610/COPYRIGHT +++ /dev/null @@ -1,16 +0,0 @@ -Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, -Technische Universitaet Berlin - -Any use of this software is permitted provided that this notice is not -removed and that neither the authors nor the Technische Universitaet Berlin -are deemed to have made any representations as to the suitability of this -software for any purpose nor are held responsible for any defects of -this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - -As a matter of courtesy, the authors request to be informed about uses -this software has found, about bugs in this software, and about any -improvements that may be of general interest. - -Berlin, 28.11.1994 -Jutta Degener -Carsten Bormann diff --git a/libs/libsndfile/src/GSM610/ChangeLog b/libs/libsndfile/src/GSM610/ChangeLog deleted file mode 100644 index 24f524882d..0000000000 --- a/libs/libsndfile/src/GSM610/ChangeLog +++ /dev/null @@ -1,56 +0,0 @@ -2004-05-12 Erik de Castro Lopo - - * gsm610_priv.h - Replace ugly macros with inline functions. - - * *.c - Remove temporary variables used by macros and other minor fixes required by - above change. - -2003-06-02 Erik de Castro Lopo - - * rpe.c - Renamed variables "exp" to "expon" to avoid shadowed parameter warnigns. - -2002-06-08 Erik de Castro Lopo - - * long_term.c - Changes tp removed compiler warnings about shadowed parameters. - -2002-06-08 Erik de Castro Lopo - - * private.h - Made declarations of gsm_A, gsm_B, gsm_MIC etc extern. This fixed a compile - problem on MacOSX. - -2002-05-10 Erik de Castro Lopo - - * *.[ch] - Removed all pre-ANSI prototype kludges. Removed proto.h and unproto.h. - Started work on making GSM 6.10 files seekable. Currently they are not. - - * code.c private.h - Function Gsm_Coder () used a statically defined array. This was obviously - not re-entrant so moved it to struct gsm_state. - -2001-09-16 Erik de Castro Lopo - - * code.c - Added #includes for string.h and stdlib.h. - -2000-10-27 Erik de Castro Lopo - - * config.h - Removed some commented out #defines (ie //*efine) which were causing problems on - the Sun cc compiler. - -2000-02-29 Erik de Castro Lopo - - * private.h - Added #defines to emulate normal compile time options. - -2000-02-28 Erik de Castro Lopo - - * everthing - Created this directory and copied files from libgsm. - http://kbs.cs.tu-berlin.de/~jutta/toast.html diff --git a/libs/libsndfile/src/GSM610/Makefile.am b/libs/libsndfile/src/GSM610/Makefile.am deleted file mode 100644 index a7358f283b..0000000000 --- a/libs/libsndfile/src/GSM610/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -## Process this file with automake to produce Makefile.in - -EXTRA_DIST = README COPYRIGHT ChangeLog - -noinst_HEADERS = gsm.h config.h gsm610_priv.h -noinst_LTLIBRARIES = libgsm.la - -CFILES = add.c decode.c gsm_decode.c gsm_encode.c long_term.c preprocess.c \ - short_term.c code.c gsm_create.c gsm_destroy.c gsm_option.c lpc.c rpe.c table.c - -libgsm_la_SOURCES = $(CFILES) $(noinst_HEADERS) - -# Disable autoheader. -AUTOHEADER=echo - - diff --git a/libs/libsndfile/src/GSM610/README b/libs/libsndfile/src/GSM610/README deleted file mode 100644 index b57132b051..0000000000 --- a/libs/libsndfile/src/GSM610/README +++ /dev/null @@ -1,36 +0,0 @@ -GSM 06.10 13 kbit/s RPE/LTP speech codec ----------------------------------------- - -All the file in this directory were written by Jutta Degener -and Carsten Borman for The Communications and Operating Systems -Research Group (KBS) at the Technische Universitaet Berlin. - -Their work was released under the following license which is -assumed to be compatible with The GNU Lesser General Public License. - ----------------------------------------------------------------------------- - -Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, -Technische Universitaet Berlin - -Any use of this software is permitted provided that this notice is not -removed and that neither the authors nor the Technische Universitaet Berlin -are deemed to have made any representations as to the suitability of this -software for any purpose nor are held responsible for any defects of -this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - -As a matter of courtesy, the authors request to be informed about uses -this software has found, about bugs in this software, and about any -improvements that may be of general interest. - -Berlin, 28.11.1994 -Jutta Degener (jutta@cs.tu-berlin.de) -Carsten Bormann (cabo@cs.tu-berlin.de) - ----------------------------------------------------------------------------- - -Jutta Degener and Carsten Bormann's work can be found on their homepage -at: - - http://kbs.cs.tu-berlin.de/~jutta/toast.html - diff --git a/libs/libsndfile/src/GSM610/add.c b/libs/libsndfile/src/GSM610/add.c deleted file mode 100644 index 6f4eb5cc5f..0000000000 --- a/libs/libsndfile/src/GSM610/add.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - * 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. - */ - -/* - * See private.h for the more commonly used macro versions. - */ - -#include -#include - -#include "gsm610_priv.h" - -#define saturate(x) \ - ((x) < MIN_WORD ? MIN_WORD : (x) > MAX_WORD ? MAX_WORD: (x)) - -word gsm_add ( word a, word b) -{ - longword sum = (longword)a + (longword)b; - return saturate(sum); -} - -word gsm_sub ( word a, word b) -{ - longword diff = (longword)a - (longword)b; - return saturate(diff); -} - -word gsm_mult ( word a, word b) -{ - if (a == MIN_WORD && b == MIN_WORD) - return MAX_WORD; - - return SASR_L( (longword)a * (longword)b, 15 ); -} - -word gsm_mult_r ( word a, word b) -{ - if (b == MIN_WORD && a == MIN_WORD) return MAX_WORD; - else { - longword prod = (longword)a * (longword)b + 16384; - prod >>= 15; - return prod & 0xFFFF; - } -} - -word gsm_abs (word a) -{ - return a < 0 ? (a == MIN_WORD ? MAX_WORD : -a) : a; -} - -longword gsm_L_mult (word a, word b) -{ - assert( a != MIN_WORD || b != MIN_WORD ); - return ((longword)a * (longword)b) << 1; -} - -longword gsm_L_add ( longword a, longword b) -{ - if (a < 0) { - if (b >= 0) return a + b; - else { - ulongword A = (ulongword)-(a + 1) + (ulongword)-(b + 1); - return A >= MAX_LONGWORD ? MIN_LONGWORD :-(longword)A-2; - } - } - else if (b <= 0) return a + b; - else { - ulongword A = (ulongword)a + (ulongword)b; - return A > MAX_LONGWORD ? MAX_LONGWORD : A; - } -} - -longword gsm_L_sub ( longword a, longword b) -{ - if (a >= 0) { - if (b >= 0) return a - b; - else { - /* a>=0, b<0 */ - - ulongword A = (ulongword)a + -(b + 1); - return A >= MAX_LONGWORD ? MAX_LONGWORD : (A + 1); - } - } - else if (b <= 0) return a - b; - else { - /* a<0, b>0 */ - - ulongword A = (ulongword)-(a + 1) + b; - return A >= MAX_LONGWORD ? MIN_LONGWORD : -(longword)A - 1; - } -} - -static unsigned char const bitoff[ 256 ] = { - 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -word gsm_norm (longword a ) -/* - * the number of left shifts needed to normalize the 32 bit - * variable L_var1 for positive values on the interval - * - * with minimum of - * minimum of 1073741824 (01000000000000000000000000000000) and - * maximum of 2147483647 (01111111111111111111111111111111) - * - * - * and for negative values on the interval with - * minimum of -2147483648 (-10000000000000000000000000000000) and - * maximum of -1073741824 ( -1000000000000000000000000000000). - * - * in order to normalize the result, the following - * operation must be done: L_norm_var1 = L_var1 << norm( L_var1 ); - * - * (That's 'ffs', only from the left, not the right..) - */ -{ - assert(a != 0); - - if (a < 0) { - if (a <= -1073741824) return 0; - a = ~a; - } - - return a & 0xffff0000 - ? ( a & 0xff000000 - ? -1 + bitoff[ 0xFF & (a >> 24) ] - : 7 + bitoff[ 0xFF & (a >> 16) ] ) - : ( a & 0xff00 - ? 15 + bitoff[ 0xFF & (a >> 8) ] - : 23 + bitoff[ 0xFF & a ] ); -} - -longword gsm_L_asl (longword a, int n) -{ - if (n >= 32) return 0; - if (n <= -32) return -(a < 0); - if (n < 0) return gsm_L_asr(a, -n); - return a << n; -} - -word gsm_asr (word a, int n) -{ - if (n >= 16) return -(a < 0); - if (n <= -16) return 0; - if (n < 0) return a << -n; - - return SASR_W (a, (word) n); -} - -word gsm_asl (word a, int n) -{ - if (n >= 16) return 0; - if (n <= -16) return -(a < 0); - if (n < 0) return gsm_asr(a, -n); - return a << n; -} - -longword gsm_L_asr (longword a, int n) -{ - if (n >= 32) return -(a < 0); - if (n <= -32) return 0; - if (n < 0) return a << -n; - - return SASR_L (a, (word) n); -} - -/* -** word gsm_asr (word a, int n) -** { -** if (n >= 16) return -(a < 0); -** if (n <= -16) return 0; -** if (n < 0) return a << -n; -** -** # ifdef SASR_W -** return a >> n; -** # else -** if (a >= 0) return a >> n; -** else return -(word)( -(uword)a >> n ); -** # endif -** } -** -*/ -/* - * (From p. 46, end of section 4.2.5) - * - * NOTE: The following lines gives [sic] one correct implementation - * of the div(num, denum) arithmetic operation. Compute div - * which is the integer division of num by denum: with denum - * >= num > 0 - */ - -word gsm_div (word num, word denum) -{ - longword L_num = num; - longword L_denum = denum; - word div = 0; - int k = 15; - - /* The parameter num sometimes becomes zero. - * Although this is explicitly guarded against in 4.2.5, - * we assume that the result should then be zero as well. - */ - - /* assert(num != 0); */ - - assert(num >= 0 && denum >= num); - if (num == 0) - return 0; - - while (k--) { - div <<= 1; - L_num <<= 1; - - if (L_num >= L_denum) { - L_num -= L_denum; - div++; - } - } - - return div; -} - diff --git a/libs/libsndfile/src/GSM610/code.c b/libs/libsndfile/src/GSM610/code.c deleted file mode 100644 index 78cb853c1d..0000000000 --- a/libs/libsndfile/src/GSM610/code.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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. - */ - - -#include -#include - -#include "gsm610_priv.h" - -/* - * 4.2 FIXED POINT IMPLEMENTATION OF THE RPE-LTP CODER - */ - -void Gsm_Coder ( - - struct gsm_state * State, - - word * s, /* [0..159] samples IN */ - -/* - * The RPE-LTD coder works on a frame by frame basis. The length of - * the frame is equal to 160 samples. Some computations are done - * once per frame to produce at the output of the coder the - * LARc[1..8] parameters which are the coded LAR coefficients and - * also to realize the inverse filtering operation for the entire - * frame (160 samples of signal d[0..159]). These parts produce at - * the output of the coder: - */ - - word * LARc, /* [0..7] LAR coefficients OUT */ - -/* - * Procedure 4.2.11 to 4.2.18 are to be executed four times per - * frame. That means once for each sub-segment RPE-LTP analysis of - * 40 samples. These parts produce at the output of the coder: - */ - - word * Nc, /* [0..3] LTP lag OUT */ - word * bc, /* [0..3] coded LTP gain OUT */ - word * Mc, /* [0..3] RPE grid selection OUT */ - word * xmaxc,/* [0..3] Coded maximum amplitude OUT */ - word * xMc /* [13*4] normalized RPE samples OUT */ -) -{ - int k; - word * dp = State->dp0 + 120; /* [ -120...-1 ] */ - word * dpp = dp; /* [ 0...39 ] */ - - word so[160]; - - Gsm_Preprocess (State, s, so); - Gsm_LPC_Analysis (State, so, LARc); - Gsm_Short_Term_Analysis_Filter (State, LARc, so); - - for (k = 0; k <= 3; k++, xMc += 13) { - - Gsm_Long_Term_Predictor ( State, - so+k*40, /* d [0..39] IN */ - dp, /* dp [-120..-1] IN */ - State->e + 5, /* e [0..39] OUT */ - dpp, /* dpp [0..39] OUT */ - Nc++, - bc++); - - Gsm_RPE_Encoding ( /*-S,-*/ - State->e + 5, /* e ][0..39][ IN/OUT */ - xmaxc++, Mc++, xMc ); - /* - * Gsm_Update_of_reconstructed_short_time_residual_signal - * ( dpp, State->e + 5, dp ); - */ - - { register int i; - for (i = 0; i <= 39; i++) - dp[ i ] = GSM_ADD( State->e[5 + i], dpp[i] ); - } - dp += 40; - dpp += 40; - - } - (void)memcpy( (char *)State->dp0, (char *)(State->dp0 + 160), - 120 * sizeof(*State->dp0) ); -} - diff --git a/libs/libsndfile/src/GSM610/config.h b/libs/libsndfile/src/GSM610/config.h deleted file mode 100644 index f3eeb82e89..0000000000 --- a/libs/libsndfile/src/GSM610/config.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -#ifndef CONFIG_H -#define CONFIG_H - -#define HAS_STDLIB_H 1 /* /usr/include/stdlib.h */ -#define HAS_FCNTL_H 1 /* /usr/include/fcntl.h */ - -#define HAS_FSTAT 1 /* fstat syscall */ -#define HAS_FCHMOD 1 /* fchmod syscall */ -#define HAS_CHMOD 1 /* chmod syscall */ -#define HAS_FCHOWN 1 /* fchown syscall */ -#define HAS_CHOWN 1 /* chown syscall */ - -#define HAS_STRING_H 1 /* /usr/include/string.h */ - -#define HAS_UNISTD_H 1 /* /usr/include/unistd.h */ -#define HAS_UTIME 1 /* POSIX utime(path, times) */ -#define HAS_UTIME_H 1 /* UTIME header file */ - -#endif /* CONFIG_H */ - diff --git a/libs/libsndfile/src/GSM610/decode.c b/libs/libsndfile/src/GSM610/decode.c deleted file mode 100644 index 350df12969..0000000000 --- a/libs/libsndfile/src/GSM610/decode.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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. - */ - -#include - -#include "gsm610_priv.h" - -/* - * 4.3 FIXED POINT IMPLEMENTATION OF THE RPE-LTP DECODER - */ - -static void Postprocessing ( - struct gsm_state * S, - register word * s) -{ - register int k; - register word msr = S->msr; - register word tmp; - - for (k = 160; k--; s++) { - tmp = GSM_MULT_R( msr, 28180 ); - msr = GSM_ADD(*s, tmp); /* Deemphasis */ - *s = GSM_ADD(msr, msr) & 0xFFF8; /* Truncation & Upscaling */ - } - S->msr = msr; -} - -void Gsm_Decoder ( - struct gsm_state * S, - - word * LARcr, /* [0..7] IN */ - - word * Ncr, /* [0..3] IN */ - word * bcr, /* [0..3] IN */ - word * Mcr, /* [0..3] IN */ - word * xmaxcr, /* [0..3] IN */ - word * xMcr, /* [0..13*4] IN */ - - word * s) /* [0..159] OUT */ -{ - int j, k; - word erp[40], wt[160]; - word * drp = S->dp0 + 120; - - for (j=0; j <= 3; j++, xmaxcr++, bcr++, Ncr++, Mcr++, xMcr += 13) { - - Gsm_RPE_Decoding( /*-S,-*/ *xmaxcr, *Mcr, xMcr, erp ); - Gsm_Long_Term_Synthesis_Filtering( S, *Ncr, *bcr, erp, drp ); - - for (k = 0; k <= 39; k++) wt[ j * 40 + k ] = drp[ k ]; - } - - Gsm_Short_Term_Synthesis_Filter( S, LARcr, wt, s ); - Postprocessing(S, s); -} - diff --git a/libs/libsndfile/src/GSM610/gsm.h b/libs/libsndfile/src/GSM610/gsm.h deleted file mode 100644 index 48aecc75aa..0000000000 --- a/libs/libsndfile/src/GSM610/gsm.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -#ifndef GSM_H -#define GSM_H - -#include /* for FILE * */ - -/* - * Interface - */ - -typedef struct gsm_state * gsm; -typedef short gsm_signal; /* signed 16 bit */ -typedef unsigned char gsm_byte; -typedef gsm_byte gsm_frame[33]; /* 33 * 8 bits */ - -#define GSM_MAGIC 0xD /* 13 kbit/s RPE-LTP */ - -#define GSM_PATCHLEVEL 10 -#define GSM_MINOR 0 -#define GSM_MAJOR 1 - -#define GSM_OPT_VERBOSE 1 -#define GSM_OPT_FAST 2 -#define GSM_OPT_LTP_CUT 3 -#define GSM_OPT_WAV49 4 -#define GSM_OPT_FRAME_INDEX 5 -#define GSM_OPT_FRAME_CHAIN 6 - -gsm gsm_create (void); - -/* Added for libsndfile : May 6, 2002 */ -void gsm_init (gsm); - -void gsm_destroy (gsm); - -int gsm_print (FILE *, gsm, gsm_byte *); -int gsm_option (gsm, int, int *); - -void gsm_encode (gsm, gsm_signal *, gsm_byte *); -int gsm_decode (gsm, gsm_byte *, gsm_signal *); - -int gsm_explode (gsm, gsm_byte *, gsm_signal *); -void gsm_implode (gsm, gsm_signal *, gsm_byte *); - -#endif /* GSM_H */ - - diff --git a/libs/libsndfile/src/GSM610/gsm610_priv.h b/libs/libsndfile/src/GSM610/gsm610_priv.h deleted file mode 100644 index e121c1c34e..0000000000 --- a/libs/libsndfile/src/GSM610/gsm610_priv.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - * 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. - */ - -#ifndef PRIVATE_H -#define PRIVATE_H - -/* Added by Erik de Castro Lopo */ -#define USE_FLOAT_MUL -#define FAST -#define WAV49 - -#ifdef __cplusplus -#error "This code is not designed to be compiled with a C++ compiler." -#endif -/* Added by Erik de Castro Lopo */ - - - -typedef short word; /* 16 bit signed int */ -typedef int longword; /* 32 bit signed int */ - -typedef unsigned short uword; /* unsigned word */ -typedef unsigned int ulongword; /* unsigned longword */ - -struct gsm_state -{ word dp0[ 280 ] ; - - word z1; /* preprocessing.c, Offset_com. */ - longword L_z2; /* Offset_com. */ - int mp; /* Preemphasis */ - - word u[8] ; /* short_term_aly_filter.c */ - word LARpp[2][8] ; /* */ - word j; /* */ - - word ltp_cut; /* long_term.c, LTP crosscorr. */ - word nrp; /* 40 */ /* long_term.c, synthesis */ - word v[9] ; /* short_term.c, synthesis */ - word msr; /* decoder.c, Postprocessing */ - - char verbose; /* only used if !NDEBUG */ - char fast; /* only used if FAST */ - - char wav_fmt; /* only used if WAV49 defined */ - unsigned char frame_index; /* odd/even chaining */ - unsigned char frame_chain; /* half-byte to carry forward */ - - /* Moved here from code.c where it was defined as static */ - word e[50] ; -} ; - -typedef struct gsm_state GSM_STATE ; - -#define MIN_WORD (-32767 - 1) -#define MAX_WORD 32767 - -#define MIN_LONGWORD (-2147483647 - 1) -#define MAX_LONGWORD 2147483647 - -/* Signed arithmetic shift right. */ -static inline word -SASR_W (word x, word by) -{ return (x >> by) ; -} /* SASR */ - -static inline longword -SASR_L (longword x, word by) -{ return (x >> by) ; -} /* SASR */ - -/* - * Prototypes from add.c - */ -word gsm_mult (word a, word b) ; -longword gsm_L_mult (word a, word b) ; -word gsm_mult_r (word a, word b) ; - -word gsm_div (word num, word denum) ; - -word gsm_add (word a, word b ) ; -longword gsm_L_add (longword a, longword b ) ; - -word gsm_sub (word a, word b) ; -longword gsm_L_sub (longword a, longword b) ; - -word gsm_abs (word a) ; - -word gsm_norm (longword a ) ; - -longword gsm_L_asl (longword a, int n) ; -word gsm_asl (word a, int n) ; - -longword gsm_L_asr (longword a, int n) ; -word gsm_asr (word a, int n) ; - -/* - * Inlined functions from add.h - */ - -static inline longword -GSM_MULT_R (word a, word b) -{ return (((longword) (a)) * ((longword) (b)) + 16384) >> 15 ; -} /* GSM_MULT_R */ - -static inline longword -GSM_MULT (word a, word b) -{ return (((longword) (a)) * ((longword) (b))) >> 15 ; -} /* GSM_MULT */ - -static inline longword -GSM_L_MULT (word a, word b) -{ return ((longword) (a)) * ((longword) (b)) << 1 ; -} /* GSM_L_MULT */ - -static inline longword -GSM_L_ADD (longword a, longword b) -{ ulongword utmp ; - - if (a < 0 && b < 0) - { utmp = (ulongword)-((a) + 1) + (ulongword)-((b) + 1) ; - return (utmp >= (ulongword) MAX_LONGWORD) ? MIN_LONGWORD : -(longword)utmp-2 ; - } ; - - if (a > 0 && b > 0) - { utmp = (ulongword) a + (ulongword) b ; - return (utmp >= (ulongword) MAX_LONGWORD) ? MAX_LONGWORD : utmp ; - } ; - - return a + b ; -} /* GSM_L_ADD */ - -static inline longword -GSM_ADD (word a, word b) -{ longword ltmp ; - - ltmp = ((longword) a) + ((longword) b) ; - - if (ltmp >= MAX_WORD) - return MAX_WORD ; - if (ltmp <= MIN_WORD) - return MIN_WORD ; - - return ltmp ; -} /* GSM_ADD */ - -static inline longword -GSM_SUB (word a, word b) -{ longword ltmp ; - - ltmp = ((longword) a) - ((longword) b) ; - - if (ltmp >= MAX_WORD) - ltmp = MAX_WORD ; - else if (ltmp <= MIN_WORD) - ltmp = MIN_WORD ; - - return ltmp ; -} /* GSM_SUB */ - -static inline word -GSM_ABS (word a) -{ - if (a > 0) - return a ; - if (a == MIN_WORD) - return MAX_WORD ; - return -a ; -} /* GSM_ADD */ - - -/* - * More prototypes from implementations.. - */ -void Gsm_Coder ( - struct gsm_state * S, - word * s, /* [0..159] samples IN */ - word * LARc, /* [0..7] LAR coefficients OUT */ - word * Nc, /* [0..3] LTP lag OUT */ - word * bc, /* [0..3] coded LTP gain OUT */ - word * Mc, /* [0..3] RPE grid selection OUT */ - word * xmaxc,/* [0..3] Coded maximum amplitude OUT */ - word * xMc) ;/* [13*4] normalized RPE samples OUT */ - -void Gsm_Long_Term_Predictor ( /* 4x for 160 samples */ - struct gsm_state * S, - word * d, /* [0..39] residual signal IN */ - word * dp, /* [-120..-1] d' IN */ - word * e, /* [0..40] OUT */ - word * dpp, /* [0..40] OUT */ - word * Nc, /* correlation lag OUT */ - word * bc) ; /* gain factor OUT */ - -void Gsm_LPC_Analysis ( - struct gsm_state * S, - word * s, /* 0..159 signals IN/OUT */ - word * LARc) ; /* 0..7 LARc's OUT */ - -void Gsm_Preprocess ( - struct gsm_state * S, - word * s, word * so) ; - -void Gsm_Encoding ( - struct gsm_state * S, - word * e, - word * ep, - word * xmaxc, - word * Mc, - word * xMc) ; - -void Gsm_Short_Term_Analysis_Filter ( - struct gsm_state * S, - word * LARc, /* coded log area ratio [0..7] IN */ - word * d) ; /* st res. signal [0..159] IN/OUT */ - -void Gsm_Decoder ( - struct gsm_state * S, - word * LARcr, /* [0..7] IN */ - word * Ncr, /* [0..3] IN */ - word * bcr, /* [0..3] IN */ - word * Mcr, /* [0..3] IN */ - word * xmaxcr, /* [0..3] IN */ - word * xMcr, /* [0..13*4] IN */ - word * s) ; /* [0..159] OUT */ - -void Gsm_Decoding ( - struct gsm_state * S, - word xmaxcr, - word Mcr, - word * xMcr, /* [0..12] IN */ - word * erp) ; /* [0..39] OUT */ - -void Gsm_Long_Term_Synthesis_Filtering ( - struct gsm_state* S, - word Ncr, - word bcr, - word * erp, /* [0..39] IN */ - word * drp) ; /* [-120..-1] IN, [0..40] OUT */ - -void Gsm_RPE_Decoding ( - /*-struct gsm_state *S,-*/ - word xmaxcr, - word Mcr, - word * xMcr, /* [0..12], 3 bits IN */ - word * erp) ; /* [0..39] OUT */ - -void Gsm_RPE_Encoding ( - /*-struct gsm_state * S,-*/ - word * e, /* -5..-1][0..39][40..44 IN/OUT */ - word * xmaxc, /* OUT */ - word * Mc, /* OUT */ - word * xMc) ; /* [0..12] OUT */ - -void Gsm_Short_Term_Synthesis_Filter ( - struct gsm_state * S, - word * LARcr, /* log area ratios [0..7] IN */ - word * drp, /* received d [0...39] IN */ - word * s) ; /* signal s [0..159] OUT */ - -void Gsm_Update_of_reconstructed_short_time_residual_signal ( - word * dpp, /* [0...39] IN */ - word * ep, /* [0...39] IN */ - word * dp) ; /* [-120...-1] IN/OUT */ - -/* - * Tables from table.c - */ -#ifndef GSM_TABLE_C - -extern word gsm_A [8], gsm_B [8], gsm_MIC [8], gsm_MAC [8] ; -extern word gsm_INVA [8] ; -extern word gsm_DLB [4], gsm_QLB [4] ; -extern word gsm_H [11] ; -extern word gsm_NRFAC [8] ; -extern word gsm_FAC [8] ; - -#endif /* GSM_TABLE_C */ - -/* - * Debugging - */ -#ifdef NDEBUG - -# define gsm_debug_words(a, b, c, d) /* nil */ -# define gsm_debug_longwords(a, b, c, d) /* nil */ -# define gsm_debug_word(a, b) /* nil */ -# define gsm_debug_longword(a, b) /* nil */ - -#else /* !NDEBUG => DEBUG */ - - void gsm_debug_words (char * name, int, int, word *) ; - void gsm_debug_longwords (char * name, int, int, longword *) ; - void gsm_debug_longword (char * name, longword) ; - void gsm_debug_word (char * name, word) ; - -#endif /* !NDEBUG */ - -#endif /* PRIVATE_H */ - diff --git a/libs/libsndfile/src/GSM610/gsm_create.c b/libs/libsndfile/src/GSM610/gsm_create.c deleted file mode 100644 index 2bb430776d..0000000000 --- a/libs/libsndfile/src/GSM610/gsm_create.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -#include "config.h" - -#include -#include -#include - - - -#include "gsm.h" -#include "gsm610_priv.h" - -gsm gsm_create (void) -{ - gsm r; - - r = malloc (sizeof(struct gsm_state)); - if (!r) return r; - - memset((char *)r, 0, sizeof (struct gsm_state)); - r->nrp = 40; - - return r; -} - -/* Added for libsndfile : May 6, 2002. Not sure if it works. */ -void gsm_init (gsm state) -{ - memset (state, 0, sizeof (struct gsm_state)) ; - state->nrp = 40 ; -} - diff --git a/libs/libsndfile/src/GSM610/gsm_decode.c b/libs/libsndfile/src/GSM610/gsm_decode.c deleted file mode 100644 index b13308a807..0000000000 --- a/libs/libsndfile/src/GSM610/gsm_decode.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - * 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. - */ - -#include "gsm610_priv.h" - -#include "gsm.h" - -int gsm_decode (gsm s, gsm_byte * c, gsm_signal * target) -{ - word LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4], xmc[13*4]; - -#ifdef WAV49 - if (s->wav_fmt) { - - uword sr = 0; - - s->frame_index = !s->frame_index; - if (s->frame_index) { - - sr = *c++; - LARc[0] = sr & 0x3f; sr >>= 6; - sr |= (uword)*c++ << 2; - LARc[1] = sr & 0x3f; sr >>= 6; - sr |= (uword)*c++ << 4; - LARc[2] = sr & 0x1f; sr >>= 5; - LARc[3] = sr & 0x1f; sr >>= 5; - sr |= (uword)*c++ << 2; - LARc[4] = sr & 0xf; sr >>= 4; - LARc[5] = sr & 0xf; sr >>= 4; - sr |= (uword)*c++ << 2; /* 5 */ - LARc[6] = sr & 0x7; sr >>= 3; - LARc[7] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[0] = sr & 0x7f; sr >>= 7; - bc[0] = sr & 0x3; sr >>= 2; - Mc[0] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[0] = sr & 0x3f; sr >>= 6; - xmc[0] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[1] = sr & 0x7; sr >>= 3; - xmc[2] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[3] = sr & 0x7; sr >>= 3; - xmc[4] = sr & 0x7; sr >>= 3; - xmc[5] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 10 */ - xmc[6] = sr & 0x7; sr >>= 3; - xmc[7] = sr & 0x7; sr >>= 3; - xmc[8] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[9] = sr & 0x7; sr >>= 3; - xmc[10] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[11] = sr & 0x7; sr >>= 3; - xmc[12] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[1] = sr & 0x7f; sr >>= 7; - bc[1] = sr & 0x3; sr >>= 2; - Mc[1] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[1] = sr & 0x3f; sr >>= 6; - xmc[13] = sr & 0x7; sr >>= 3; - sr = *c++; /* 15 */ - xmc[14] = sr & 0x7; sr >>= 3; - xmc[15] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[16] = sr & 0x7; sr >>= 3; - xmc[17] = sr & 0x7; sr >>= 3; - xmc[18] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[19] = sr & 0x7; sr >>= 3; - xmc[20] = sr & 0x7; sr >>= 3; - xmc[21] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[22] = sr & 0x7; sr >>= 3; - xmc[23] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[24] = sr & 0x7; sr >>= 3; - xmc[25] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; /* 20 */ - Nc[2] = sr & 0x7f; sr >>= 7; - bc[2] = sr & 0x3; sr >>= 2; - Mc[2] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[2] = sr & 0x3f; sr >>= 6; - xmc[26] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[27] = sr & 0x7; sr >>= 3; - xmc[28] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[29] = sr & 0x7; sr >>= 3; - xmc[30] = sr & 0x7; sr >>= 3; - xmc[31] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[32] = sr & 0x7; sr >>= 3; - xmc[33] = sr & 0x7; sr >>= 3; - xmc[34] = sr & 0x7; sr >>= 3; - sr = *c++; /* 25 */ - xmc[35] = sr & 0x7; sr >>= 3; - xmc[36] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[37] = sr & 0x7; sr >>= 3; - xmc[38] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[3] = sr & 0x7f; sr >>= 7; - bc[3] = sr & 0x3; sr >>= 2; - Mc[3] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[3] = sr & 0x3f; sr >>= 6; - xmc[39] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[40] = sr & 0x7; sr >>= 3; - xmc[41] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; /* 30 */ - xmc[42] = sr & 0x7; sr >>= 3; - xmc[43] = sr & 0x7; sr >>= 3; - xmc[44] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[45] = sr & 0x7; sr >>= 3; - xmc[46] = sr & 0x7; sr >>= 3; - xmc[47] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[48] = sr & 0x7; sr >>= 3; - xmc[49] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[50] = sr & 0x7; sr >>= 3; - xmc[51] = sr & 0x7; sr >>= 3; - - s->frame_chain = sr & 0xf; - } - else { - sr = s->frame_chain; - sr |= (uword)*c++ << 4; /* 1 */ - LARc[0] = sr & 0x3f; sr >>= 6; - LARc[1] = sr & 0x3f; sr >>= 6; - sr = *c++; - LARc[2] = sr & 0x1f; sr >>= 5; - sr |= (uword)*c++ << 3; - LARc[3] = sr & 0x1f; sr >>= 5; - LARc[4] = sr & 0xf; sr >>= 4; - sr |= (uword)*c++ << 2; - LARc[5] = sr & 0xf; sr >>= 4; - LARc[6] = sr & 0x7; sr >>= 3; - LARc[7] = sr & 0x7; sr >>= 3; - sr = *c++; /* 5 */ - Nc[0] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[0] = sr & 0x3; sr >>= 2; - Mc[0] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[0] = sr & 0x3f; sr >>= 6; - xmc[0] = sr & 0x7; sr >>= 3; - xmc[1] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[2] = sr & 0x7; sr >>= 3; - xmc[3] = sr & 0x7; sr >>= 3; - xmc[4] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[5] = sr & 0x7; sr >>= 3; - xmc[6] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; /* 10 */ - xmc[7] = sr & 0x7; sr >>= 3; - xmc[8] = sr & 0x7; sr >>= 3; - xmc[9] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[10] = sr & 0x7; sr >>= 3; - xmc[11] = sr & 0x7; sr >>= 3; - xmc[12] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[1] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[1] = sr & 0x3; sr >>= 2; - Mc[1] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[1] = sr & 0x3f; sr >>= 6; - xmc[13] = sr & 0x7; sr >>= 3; - xmc[14] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 15 */ - xmc[15] = sr & 0x7; sr >>= 3; - xmc[16] = sr & 0x7; sr >>= 3; - xmc[17] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[18] = sr & 0x7; sr >>= 3; - xmc[19] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[20] = sr & 0x7; sr >>= 3; - xmc[21] = sr & 0x7; sr >>= 3; - xmc[22] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[23] = sr & 0x7; sr >>= 3; - xmc[24] = sr & 0x7; sr >>= 3; - xmc[25] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[2] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; /* 20 */ - bc[2] = sr & 0x3; sr >>= 2; - Mc[2] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[2] = sr & 0x3f; sr >>= 6; - xmc[26] = sr & 0x7; sr >>= 3; - xmc[27] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[28] = sr & 0x7; sr >>= 3; - xmc[29] = sr & 0x7; sr >>= 3; - xmc[30] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[31] = sr & 0x7; sr >>= 3; - xmc[32] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[33] = sr & 0x7; sr >>= 3; - xmc[34] = sr & 0x7; sr >>= 3; - xmc[35] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 25 */ - xmc[36] = sr & 0x7; sr >>= 3; - xmc[37] = sr & 0x7; sr >>= 3; - xmc[38] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[3] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[3] = sr & 0x3; sr >>= 2; - Mc[3] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[3] = sr & 0x3f; sr >>= 6; - xmc[39] = sr & 0x7; sr >>= 3; - xmc[40] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[41] = sr & 0x7; sr >>= 3; - xmc[42] = sr & 0x7; sr >>= 3; - xmc[43] = sr & 0x7; sr >>= 3; - sr = *c++; /* 30 */ - xmc[44] = sr & 0x7; sr >>= 3; - xmc[45] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[46] = sr & 0x7; sr >>= 3; - xmc[47] = sr & 0x7; sr >>= 3; - xmc[48] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[49] = sr & 0x7; sr >>= 3; - xmc[50] = sr & 0x7; sr >>= 3; - xmc[51] = sr & 0x7; sr >>= 3; - } - } - else -#endif - { - /* GSM_MAGIC = (*c >> 4) & 0xF; */ - - if (((*c >> 4) & 0x0F) != GSM_MAGIC) return -1; - - LARc[0] = (*c++ & 0xF) << 2; /* 1 */ - LARc[0] |= (*c >> 6) & 0x3; - LARc[1] = *c++ & 0x3F; - LARc[2] = (*c >> 3) & 0x1F; - LARc[3] = (*c++ & 0x7) << 2; - LARc[3] |= (*c >> 6) & 0x3; - LARc[4] = (*c >> 2) & 0xF; - LARc[5] = (*c++ & 0x3) << 2; - LARc[5] |= (*c >> 6) & 0x3; - LARc[6] = (*c >> 3) & 0x7; - LARc[7] = *c++ & 0x7; - Nc[0] = (*c >> 1) & 0x7F; - bc[0] = (*c++ & 0x1) << 1; - bc[0] |= (*c >> 7) & 0x1; - Mc[0] = (*c >> 5) & 0x3; - xmaxc[0] = (*c++ & 0x1F) << 1; - xmaxc[0] |= (*c >> 7) & 0x1; - xmc[0] = (*c >> 4) & 0x7; - xmc[1] = (*c >> 1) & 0x7; - xmc[2] = (*c++ & 0x1) << 2; - xmc[2] |= (*c >> 6) & 0x3; - xmc[3] = (*c >> 3) & 0x7; - xmc[4] = *c++ & 0x7; - xmc[5] = (*c >> 5) & 0x7; - xmc[6] = (*c >> 2) & 0x7; - xmc[7] = (*c++ & 0x3) << 1; /* 10 */ - xmc[7] |= (*c >> 7) & 0x1; - xmc[8] = (*c >> 4) & 0x7; - xmc[9] = (*c >> 1) & 0x7; - xmc[10] = (*c++ & 0x1) << 2; - xmc[10] |= (*c >> 6) & 0x3; - xmc[11] = (*c >> 3) & 0x7; - xmc[12] = *c++ & 0x7; - Nc[1] = (*c >> 1) & 0x7F; - bc[1] = (*c++ & 0x1) << 1; - bc[1] |= (*c >> 7) & 0x1; - Mc[1] = (*c >> 5) & 0x3; - xmaxc[1] = (*c++ & 0x1F) << 1; - xmaxc[1] |= (*c >> 7) & 0x1; - xmc[13] = (*c >> 4) & 0x7; - xmc[14] = (*c >> 1) & 0x7; - xmc[15] = (*c++ & 0x1) << 2; - xmc[15] |= (*c >> 6) & 0x3; - xmc[16] = (*c >> 3) & 0x7; - xmc[17] = *c++ & 0x7; - xmc[18] = (*c >> 5) & 0x7; - xmc[19] = (*c >> 2) & 0x7; - xmc[20] = (*c++ & 0x3) << 1; - xmc[20] |= (*c >> 7) & 0x1; - xmc[21] = (*c >> 4) & 0x7; - xmc[22] = (*c >> 1) & 0x7; - xmc[23] = (*c++ & 0x1) << 2; - xmc[23] |= (*c >> 6) & 0x3; - xmc[24] = (*c >> 3) & 0x7; - xmc[25] = *c++ & 0x7; - Nc[2] = (*c >> 1) & 0x7F; - bc[2] = (*c++ & 0x1) << 1; /* 20 */ - bc[2] |= (*c >> 7) & 0x1; - Mc[2] = (*c >> 5) & 0x3; - xmaxc[2] = (*c++ & 0x1F) << 1; - xmaxc[2] |= (*c >> 7) & 0x1; - xmc[26] = (*c >> 4) & 0x7; - xmc[27] = (*c >> 1) & 0x7; - xmc[28] = (*c++ & 0x1) << 2; - xmc[28] |= (*c >> 6) & 0x3; - xmc[29] = (*c >> 3) & 0x7; - xmc[30] = *c++ & 0x7; - xmc[31] = (*c >> 5) & 0x7; - xmc[32] = (*c >> 2) & 0x7; - xmc[33] = (*c++ & 0x3) << 1; - xmc[33] |= (*c >> 7) & 0x1; - xmc[34] = (*c >> 4) & 0x7; - xmc[35] = (*c >> 1) & 0x7; - xmc[36] = (*c++ & 0x1) << 2; - xmc[36] |= (*c >> 6) & 0x3; - xmc[37] = (*c >> 3) & 0x7; - xmc[38] = *c++ & 0x7; - Nc[3] = (*c >> 1) & 0x7F; - bc[3] = (*c++ & 0x1) << 1; - bc[3] |= (*c >> 7) & 0x1; - Mc[3] = (*c >> 5) & 0x3; - xmaxc[3] = (*c++ & 0x1F) << 1; - xmaxc[3] |= (*c >> 7) & 0x1; - xmc[39] = (*c >> 4) & 0x7; - xmc[40] = (*c >> 1) & 0x7; - xmc[41] = (*c++ & 0x1) << 2; - xmc[41] |= (*c >> 6) & 0x3; - xmc[42] = (*c >> 3) & 0x7; - xmc[43] = *c++ & 0x7; /* 30 */ - xmc[44] = (*c >> 5) & 0x7; - xmc[45] = (*c >> 2) & 0x7; - xmc[46] = (*c++ & 0x3) << 1; - xmc[46] |= (*c >> 7) & 0x1; - xmc[47] = (*c >> 4) & 0x7; - xmc[48] = (*c >> 1) & 0x7; - xmc[49] = (*c++ & 0x1) << 2; - xmc[49] |= (*c >> 6) & 0x3; - xmc[50] = (*c >> 3) & 0x7; - xmc[51] = *c & 0x7; /* 33 */ - } - - Gsm_Decoder(s, LARc, Nc, bc, Mc, xmaxc, xmc, target); - - return 0; -} - diff --git a/libs/libsndfile/src/GSM610/gsm_destroy.c b/libs/libsndfile/src/GSM610/gsm_destroy.c deleted file mode 100644 index 9b417116d8..0000000000 --- a/libs/libsndfile/src/GSM610/gsm_destroy.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -#include "gsm.h" -#include "config.h" - -#ifdef HAS_STDLIB_H -# include -#else -# ifdef HAS_MALLOC_H -# include -# else - extern void free(); -# endif -#endif - -void gsm_destroy (gsm S) -{ - if (S) free((char *)S); -} - diff --git a/libs/libsndfile/src/GSM610/gsm_encode.c b/libs/libsndfile/src/GSM610/gsm_encode.c deleted file mode 100644 index 5c9e1ab33e..0000000000 --- a/libs/libsndfile/src/GSM610/gsm_encode.c +++ /dev/null @@ -1,449 +0,0 @@ -/* - * 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. - */ - -#include "gsm610_priv.h" -#include "gsm.h" - -void gsm_encode (gsm s, gsm_signal * source, gsm_byte * c) -{ - word LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4], xmc[13*4]; - - Gsm_Coder(s, source, LARc, Nc, bc, Mc, xmaxc, xmc); - - - /* variable size - - GSM_MAGIC 4 - - LARc[0] 6 - LARc[1] 6 - LARc[2] 5 - LARc[3] 5 - LARc[4] 4 - LARc[5] 4 - LARc[6] 3 - LARc[7] 3 - - Nc[0] 7 - bc[0] 2 - Mc[0] 2 - xmaxc[0] 6 - xmc[0] 3 - xmc[1] 3 - xmc[2] 3 - xmc[3] 3 - xmc[4] 3 - xmc[5] 3 - xmc[6] 3 - xmc[7] 3 - xmc[8] 3 - xmc[9] 3 - xmc[10] 3 - xmc[11] 3 - xmc[12] 3 - - Nc[1] 7 - bc[1] 2 - Mc[1] 2 - xmaxc[1] 6 - xmc[13] 3 - xmc[14] 3 - xmc[15] 3 - xmc[16] 3 - xmc[17] 3 - xmc[18] 3 - xmc[19] 3 - xmc[20] 3 - xmc[21] 3 - xmc[22] 3 - xmc[23] 3 - xmc[24] 3 - xmc[25] 3 - - Nc[2] 7 - bc[2] 2 - Mc[2] 2 - xmaxc[2] 6 - xmc[26] 3 - xmc[27] 3 - xmc[28] 3 - xmc[29] 3 - xmc[30] 3 - xmc[31] 3 - xmc[32] 3 - xmc[33] 3 - xmc[34] 3 - xmc[35] 3 - xmc[36] 3 - xmc[37] 3 - xmc[38] 3 - - Nc[3] 7 - bc[3] 2 - Mc[3] 2 - xmaxc[3] 6 - xmc[39] 3 - xmc[40] 3 - xmc[41] 3 - xmc[42] 3 - xmc[43] 3 - xmc[44] 3 - xmc[45] 3 - xmc[46] 3 - xmc[47] 3 - xmc[48] 3 - xmc[49] 3 - xmc[50] 3 - xmc[51] 3 - */ - -#ifdef WAV49 - - if (s->wav_fmt) { - s->frame_index = !s->frame_index; - if (s->frame_index) { - - uword sr; - - sr = 0; - sr = sr >> 6 | LARc[0] << 10; - sr = sr >> 6 | LARc[1] << 10; - *c++ = sr >> 4; - sr = sr >> 5 | LARc[2] << 11; - *c++ = sr >> 7; - sr = sr >> 5 | LARc[3] << 11; - sr = sr >> 4 | LARc[4] << 12; - *c++ = sr >> 6; - sr = sr >> 4 | LARc[5] << 12; - sr = sr >> 3 | LARc[6] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | LARc[7] << 13; - sr = sr >> 7 | Nc[0] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[0] << 14; - sr = sr >> 2 | Mc[0] << 14; - sr = sr >> 6 | xmaxc[0] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[0] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[1] << 13; - sr = sr >> 3 | xmc[2] << 13; - sr = sr >> 3 | xmc[3] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[4] << 13; - sr = sr >> 3 | xmc[5] << 13; - sr = sr >> 3 | xmc[6] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[7] << 13; - sr = sr >> 3 | xmc[8] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[9] << 13; - sr = sr >> 3 | xmc[10] << 13; - sr = sr >> 3 | xmc[11] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[12] << 13; - sr = sr >> 7 | Nc[1] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[1] << 14; - sr = sr >> 2 | Mc[1] << 14; - sr = sr >> 6 | xmaxc[1] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[13] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[14] << 13; - sr = sr >> 3 | xmc[15] << 13; - sr = sr >> 3 | xmc[16] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[17] << 13; - sr = sr >> 3 | xmc[18] << 13; - sr = sr >> 3 | xmc[19] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[20] << 13; - sr = sr >> 3 | xmc[21] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[22] << 13; - sr = sr >> 3 | xmc[23] << 13; - sr = sr >> 3 | xmc[24] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[25] << 13; - sr = sr >> 7 | Nc[2] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[2] << 14; - sr = sr >> 2 | Mc[2] << 14; - sr = sr >> 6 | xmaxc[2] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[26] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[27] << 13; - sr = sr >> 3 | xmc[28] << 13; - sr = sr >> 3 | xmc[29] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[30] << 13; - sr = sr >> 3 | xmc[31] << 13; - sr = sr >> 3 | xmc[32] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[33] << 13; - sr = sr >> 3 | xmc[34] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[35] << 13; - sr = sr >> 3 | xmc[36] << 13; - sr = sr >> 3 | xmc[37] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[38] << 13; - sr = sr >> 7 | Nc[3] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[3] << 14; - sr = sr >> 2 | Mc[3] << 14; - sr = sr >> 6 | xmaxc[3] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[39] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[40] << 13; - sr = sr >> 3 | xmc[41] << 13; - sr = sr >> 3 | xmc[42] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[43] << 13; - sr = sr >> 3 | xmc[44] << 13; - sr = sr >> 3 | xmc[45] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[46] << 13; - sr = sr >> 3 | xmc[47] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[48] << 13; - sr = sr >> 3 | xmc[49] << 13; - sr = sr >> 3 | xmc[50] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[51] << 13; - sr = sr >> 4; - *c = sr >> 8; - s->frame_chain = *c; - } - else { - uword sr; - - sr = 0; - sr = sr >> 4 | s->frame_chain << 12; - sr = sr >> 6 | LARc[0] << 10; - *c++ = sr >> 6; - sr = sr >> 6 | LARc[1] << 10; - *c++ = sr >> 8; - sr = sr >> 5 | LARc[2] << 11; - sr = sr >> 5 | LARc[3] << 11; - *c++ = sr >> 6; - sr = sr >> 4 | LARc[4] << 12; - sr = sr >> 4 | LARc[5] << 12; - *c++ = sr >> 6; - sr = sr >> 3 | LARc[6] << 13; - sr = sr >> 3 | LARc[7] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[0] << 9; - sr = sr >> 2 | bc[0] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[0] << 14; - sr = sr >> 6 | xmaxc[0] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[0] << 13; - sr = sr >> 3 | xmc[1] << 13; - sr = sr >> 3 | xmc[2] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[3] << 13; - sr = sr >> 3 | xmc[4] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[5] << 13; - sr = sr >> 3 | xmc[6] << 13; - sr = sr >> 3 | xmc[7] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[8] << 13; - sr = sr >> 3 | xmc[9] << 13; - sr = sr >> 3 | xmc[10] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[11] << 13; - sr = sr >> 3 | xmc[12] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[1] << 9; - sr = sr >> 2 | bc[1] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[1] << 14; - sr = sr >> 6 | xmaxc[1] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[13] << 13; - sr = sr >> 3 | xmc[14] << 13; - sr = sr >> 3 | xmc[15] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[16] << 13; - sr = sr >> 3 | xmc[17] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[18] << 13; - sr = sr >> 3 | xmc[19] << 13; - sr = sr >> 3 | xmc[20] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[21] << 13; - sr = sr >> 3 | xmc[22] << 13; - sr = sr >> 3 | xmc[23] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[24] << 13; - sr = sr >> 3 | xmc[25] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[2] << 9; - sr = sr >> 2 | bc[2] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[2] << 14; - sr = sr >> 6 | xmaxc[2] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[26] << 13; - sr = sr >> 3 | xmc[27] << 13; - sr = sr >> 3 | xmc[28] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[29] << 13; - sr = sr >> 3 | xmc[30] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[31] << 13; - sr = sr >> 3 | xmc[32] << 13; - sr = sr >> 3 | xmc[33] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[34] << 13; - sr = sr >> 3 | xmc[35] << 13; - sr = sr >> 3 | xmc[36] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[37] << 13; - sr = sr >> 3 | xmc[38] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[3] << 9; - sr = sr >> 2 | bc[3] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[3] << 14; - sr = sr >> 6 | xmaxc[3] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[39] << 13; - sr = sr >> 3 | xmc[40] << 13; - sr = sr >> 3 | xmc[41] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[42] << 13; - sr = sr >> 3 | xmc[43] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[44] << 13; - sr = sr >> 3 | xmc[45] << 13; - sr = sr >> 3 | xmc[46] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[47] << 13; - sr = sr >> 3 | xmc[48] << 13; - sr = sr >> 3 | xmc[49] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[50] << 13; - sr = sr >> 3 | xmc[51] << 13; - *c++ = sr >> 8; - } - } - - else - -#endif /* WAV49 */ - { - - *c++ = ((GSM_MAGIC & 0xF) << 4) /* 1 */ - | ((LARc[0] >> 2) & 0xF); - *c++ = ((LARc[0] & 0x3) << 6) - | (LARc[1] & 0x3F); - *c++ = ((LARc[2] & 0x1F) << 3) - | ((LARc[3] >> 2) & 0x7); - *c++ = ((LARc[3] & 0x3) << 6) - | ((LARc[4] & 0xF) << 2) - | ((LARc[5] >> 2) & 0x3); - *c++ = ((LARc[5] & 0x3) << 6) - | ((LARc[6] & 0x7) << 3) - | (LARc[7] & 0x7); - *c++ = ((Nc[0] & 0x7F) << 1) - | ((bc[0] >> 1) & 0x1); - *c++ = ((bc[0] & 0x1) << 7) - | ((Mc[0] & 0x3) << 5) - | ((xmaxc[0] >> 1) & 0x1F); - *c++ = ((xmaxc[0] & 0x1) << 7) - | ((xmc[0] & 0x7) << 4) - | ((xmc[1] & 0x7) << 1) - | ((xmc[2] >> 2) & 0x1); - *c++ = ((xmc[2] & 0x3) << 6) - | ((xmc[3] & 0x7) << 3) - | (xmc[4] & 0x7); - *c++ = ((xmc[5] & 0x7) << 5) /* 10 */ - | ((xmc[6] & 0x7) << 2) - | ((xmc[7] >> 1) & 0x3); - *c++ = ((xmc[7] & 0x1) << 7) - | ((xmc[8] & 0x7) << 4) - | ((xmc[9] & 0x7) << 1) - | ((xmc[10] >> 2) & 0x1); - *c++ = ((xmc[10] & 0x3) << 6) - | ((xmc[11] & 0x7) << 3) - | (xmc[12] & 0x7); - *c++ = ((Nc[1] & 0x7F) << 1) - | ((bc[1] >> 1) & 0x1); - *c++ = ((bc[1] & 0x1) << 7) - | ((Mc[1] & 0x3) << 5) - | ((xmaxc[1] >> 1) & 0x1F); - *c++ = ((xmaxc[1] & 0x1) << 7) - | ((xmc[13] & 0x7) << 4) - | ((xmc[14] & 0x7) << 1) - | ((xmc[15] >> 2) & 0x1); - *c++ = ((xmc[15] & 0x3) << 6) - | ((xmc[16] & 0x7) << 3) - | (xmc[17] & 0x7); - *c++ = ((xmc[18] & 0x7) << 5) - | ((xmc[19] & 0x7) << 2) - | ((xmc[20] >> 1) & 0x3); - *c++ = ((xmc[20] & 0x1) << 7) - | ((xmc[21] & 0x7) << 4) - | ((xmc[22] & 0x7) << 1) - | ((xmc[23] >> 2) & 0x1); - *c++ = ((xmc[23] & 0x3) << 6) - | ((xmc[24] & 0x7) << 3) - | (xmc[25] & 0x7); - *c++ = ((Nc[2] & 0x7F) << 1) /* 20 */ - | ((bc[2] >> 1) & 0x1); - *c++ = ((bc[2] & 0x1) << 7) - | ((Mc[2] & 0x3) << 5) - | ((xmaxc[2] >> 1) & 0x1F); - *c++ = ((xmaxc[2] & 0x1) << 7) - | ((xmc[26] & 0x7) << 4) - | ((xmc[27] & 0x7) << 1) - | ((xmc[28] >> 2) & 0x1); - *c++ = ((xmc[28] & 0x3) << 6) - | ((xmc[29] & 0x7) << 3) - | (xmc[30] & 0x7); - *c++ = ((xmc[31] & 0x7) << 5) - | ((xmc[32] & 0x7) << 2) - | ((xmc[33] >> 1) & 0x3); - *c++ = ((xmc[33] & 0x1) << 7) - | ((xmc[34] & 0x7) << 4) - | ((xmc[35] & 0x7) << 1) - | ((xmc[36] >> 2) & 0x1); - *c++ = ((xmc[36] & 0x3) << 6) - | ((xmc[37] & 0x7) << 3) - | (xmc[38] & 0x7); - *c++ = ((Nc[3] & 0x7F) << 1) - | ((bc[3] >> 1) & 0x1); - *c++ = ((bc[3] & 0x1) << 7) - | ((Mc[3] & 0x3) << 5) - | ((xmaxc[3] >> 1) & 0x1F); - *c++ = ((xmaxc[3] & 0x1) << 7) - | ((xmc[39] & 0x7) << 4) - | ((xmc[40] & 0x7) << 1) - | ((xmc[41] >> 2) & 0x1); - *c++ = ((xmc[41] & 0x3) << 6) /* 30 */ - | ((xmc[42] & 0x7) << 3) - | (xmc[43] & 0x7); - *c++ = ((xmc[44] & 0x7) << 5) - | ((xmc[45] & 0x7) << 2) - | ((xmc[46] >> 1) & 0x3); - *c++ = ((xmc[46] & 0x1) << 7) - | ((xmc[47] & 0x7) << 4) - | ((xmc[48] & 0x7) << 1) - | ((xmc[49] >> 2) & 0x1); - *c++ = ((xmc[49] & 0x3) << 6) - | ((xmc[50] & 0x7) << 3) - | (xmc[51] & 0x7); - - } -} - diff --git a/libs/libsndfile/src/GSM610/gsm_option.c b/libs/libsndfile/src/GSM610/gsm_option.c deleted file mode 100644 index 0139c353f7..0000000000 --- a/libs/libsndfile/src/GSM610/gsm_option.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ - -#include "gsm610_priv.h" - -#include "gsm.h" - -int gsm_option (gsm r, int opt, int * val) -{ - int result = -1; - - switch (opt) { - case GSM_OPT_LTP_CUT: -#ifdef LTP_CUT - result = r->ltp_cut; - if (val) r->ltp_cut = *val; -#endif - break; - - case GSM_OPT_VERBOSE: -#ifndef NDEBUG - result = r->verbose; - if (val) r->verbose = *val; -#endif - break; - - case GSM_OPT_FAST: - -#if defined(FAST) && defined(USE_FLOAT_MUL) - result = r->fast; - if (val) r->fast = !!*val; -#endif - break; - - case GSM_OPT_FRAME_CHAIN: - -#ifdef WAV49 - result = r->frame_chain; - if (val) r->frame_chain = *val; -#endif - break; - - case GSM_OPT_FRAME_INDEX: - -#ifdef WAV49 - result = r->frame_index; - if (val) r->frame_index = *val; -#endif - break; - - case GSM_OPT_WAV49: - -#ifdef WAV49 - result = r->wav_fmt; - if (val) r->wav_fmt = !!*val; -#endif - break; - - default: - break; - } - return result; -} diff --git a/libs/libsndfile/src/GSM610/long_term.c b/libs/libsndfile/src/GSM610/long_term.c deleted file mode 100644 index 0d2cd0ff47..0000000000 --- a/libs/libsndfile/src/GSM610/long_term.c +++ /dev/null @@ -1,959 +0,0 @@ -/* - * 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. - */ - -#include -#include - -#include "gsm610_priv.h" - -/* - * 4.2.11 .. 4.2.12 LONG TERM PREDICTOR (LTP) SECTION - */ - - -/* - * This module computes the LTP gain (bc) and the LTP lag (Nc) - * for the long term analysis filter. This is done by calculating a - * maximum of the cross-correlation function between the current - * sub-segment short term residual signal d[0..39] (output of - * the short term analysis filter; for simplification the index - * of this array begins at 0 and ends at 39 for each sub-segment of the - * RPE-LTP analysis) and the previous reconstructed short term - * residual signal dp[ -120 .. -1 ]. A dynamic scaling must be - * performed to avoid overflow. - */ - - /* The next procedure exists in six versions. First two integer - * version (if USE_FLOAT_MUL is not defined); then four floating - * point versions, twice with proper scaling (USE_FLOAT_MUL defined), - * once without (USE_FLOAT_MUL and FAST defined, and fast run-time - * option used). Every pair has first a Cut version (see the -C - * option to toast or the LTP_CUT option to gsm_option()), then the - * uncut one. (For a detailed explanation of why this is altogether - * a bad idea, see Henry Spencer and Geoff Collyer, ``#ifdef Considered - * Harmful''.) - */ - -#ifndef USE_FLOAT_MUL - -#ifdef LTP_CUT - -static void Cut_Calculation_of_the_LTP_parameters ( - - struct gsm_state * st, - - register word * d, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - word Nc, bc; - word wt[40]; - - longword L_result; - longword L_max, L_power; - word R, S, dmax, scal, best_k; - word ltp_cut; - - register word temp, wt_k; - - /* Search of the optimum scaling of d[0..39]. - */ - dmax = 0; - for (k = 0; k <= 39; k++) { - temp = d[k]; - temp = GSM_ABS( temp ); - if (temp > dmax) { - dmax = temp; - best_k = k; - } - } - temp = 0; - if (dmax == 0) scal = 0; - else { - assert(dmax > 0); - temp = gsm_norm( (longword)dmax << 16 ); - } - if (temp > 6) scal = 0; - else scal = 6 - temp; - assert(scal >= 0); - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - wt_k = SASR_W(d[best_k], scal); - - for (lambda = 40; lambda <= 120; lambda++) { - L_result = (longword)wt_k * dp[best_k - lambda]; - if (L_result > L_max) { - Nc = lambda; - L_max = L_result; - } - } - *Nc_out = Nc; - L_max <<= 1; - - /* Rescaling of L_max - */ - assert(scal <= 100 && scal >= -100); - L_max = L_max >> (6 - scal); /* sub(6, scal) */ - - assert( Nc <= 120 && Nc >= 40); - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - L_power = 0; - for (k = 0; k <= 39; k++) { - - register longword L_temp; - - L_temp = SASR_W( dp[k - Nc], 3 ); - L_power += L_temp * L_temp; - } - L_power <<= 1; /* from L_MULT */ - - /* Normalization of L_max and L_power - */ - - if (L_max <= 0) { - *bc_out = 0; - return; - } - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - temp = gsm_norm( L_power ); - - R = SASR( L_max << temp, 16 ); - S = SASR( L_power << temp, 16 ); - - /* Coding of the LTP gain - */ - - /* Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break; - *bc_out = bc; -} - -#endif /* LTP_CUT */ - -static void Calculation_of_the_LTP_parameters ( - register word * d, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - word Nc, bc; - word wt[40]; - - longword L_max, L_power; - word R, S, dmax, scal; - register word temp; - - /* Search of the optimum scaling of d[0..39]. - */ - dmax = 0; - - for (k = 0; k <= 39; k++) { - temp = d[k]; - temp = GSM_ABS( temp ); - if (temp > dmax) dmax = temp; - } - - temp = 0; - if (dmax == 0) scal = 0; - else { - assert(dmax > 0); - temp = gsm_norm( (longword)dmax << 16 ); - } - - if (temp > 6) scal = 0; - else scal = 6 - temp; - - assert(scal >= 0); - - /* Initialization of a working array wt - */ - - for (k = 0; k <= 39; k++) wt[k] = SASR_W( d[k], scal ); - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - - for (lambda = 40; lambda <= 120; lambda++) { - -# undef STEP -# define STEP(k) (longword)wt[k] * dp[k - lambda] - - register longword L_result; - - L_result = STEP(0) ; L_result += STEP(1) ; - L_result += STEP(2) ; L_result += STEP(3) ; - L_result += STEP(4) ; L_result += STEP(5) ; - L_result += STEP(6) ; L_result += STEP(7) ; - L_result += STEP(8) ; L_result += STEP(9) ; - L_result += STEP(10) ; L_result += STEP(11) ; - L_result += STEP(12) ; L_result += STEP(13) ; - L_result += STEP(14) ; L_result += STEP(15) ; - L_result += STEP(16) ; L_result += STEP(17) ; - L_result += STEP(18) ; L_result += STEP(19) ; - L_result += STEP(20) ; L_result += STEP(21) ; - L_result += STEP(22) ; L_result += STEP(23) ; - L_result += STEP(24) ; L_result += STEP(25) ; - L_result += STEP(26) ; L_result += STEP(27) ; - L_result += STEP(28) ; L_result += STEP(29) ; - L_result += STEP(30) ; L_result += STEP(31) ; - L_result += STEP(32) ; L_result += STEP(33) ; - L_result += STEP(34) ; L_result += STEP(35) ; - L_result += STEP(36) ; L_result += STEP(37) ; - L_result += STEP(38) ; L_result += STEP(39) ; - - if (L_result > L_max) { - - Nc = lambda; - L_max = L_result; - } - } - - *Nc_out = Nc; - - L_max <<= 1; - - /* Rescaling of L_max - */ - assert(scal <= 100 && scal >= -100); - L_max = L_max >> (6 - scal); /* sub(6, scal) */ - - assert( Nc <= 120 && Nc >= 40); - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - L_power = 0; - for (k = 0; k <= 39; k++) { - - register longword L_temp; - - L_temp = SASR_W( dp[k - Nc], 3 ); - L_power += L_temp * L_temp; - } - L_power <<= 1; /* from L_MULT */ - - /* Normalization of L_max and L_power - */ - - if (L_max <= 0) { - *bc_out = 0; - return; - } - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - temp = gsm_norm( L_power ); - - R = SASR_L( L_max << temp, 16 ); - S = SASR_L( L_power << temp, 16 ); - - /* Coding of the LTP gain - */ - - /* Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break; - *bc_out = bc; -} - -#else /* USE_FLOAT_MUL */ - -#ifdef LTP_CUT - -static void Cut_Calculation_of_the_LTP_parameters ( - struct gsm_state * st, /* IN */ - register word * d, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - word Nc, bc; - word ltp_cut; - - float wt_float[40]; - float dp_float_base[120], * dp_float = dp_float_base + 120; - - longword L_max, L_power; - word R, S, dmax, scal; - register word temp; - - /* Search of the optimum scaling of d[0..39]. - */ - dmax = 0; - - for (k = 0; k <= 39; k++) { - temp = d[k]; - temp = GSM_ABS( temp ); - if (temp > dmax) dmax = temp; - } - - temp = 0; - if (dmax == 0) scal = 0; - else { - assert(dmax > 0); - temp = gsm_norm( (longword)dmax << 16 ); - } - - if (temp > 6) scal = 0; - else scal = 6 - temp; - - assert(scal >= 0); - ltp_cut = (longword)SASR_W(dmax, scal) * st->ltp_cut / 100; - - - /* Initialization of a working array wt - */ - - for (k = 0; k < 40; k++) { - register word w = SASR_W( d[k], scal ); - if (w < 0 ? w > -ltp_cut : w < ltp_cut) { - wt_float[k] = 0.0; - } - else { - wt_float[k] = w; - } - } - for (k = -120; k < 0; k++) dp_float[k] = dp[k]; - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - - for (lambda = 40; lambda <= 120; lambda += 9) { - - /* Calculate L_result for l = lambda .. lambda + 9. - */ - register float *lp = dp_float - lambda; - - register float W; - register float a = lp[-8], b = lp[-7], c = lp[-6], - d = lp[-5], e = lp[-4], f = lp[-3], - g = lp[-2], h = lp[-1]; - register float E; - register float S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0, - S5 = 0, S6 = 0, S7 = 0, S8 = 0; - -# undef STEP -# define STEP(K, a, b, c, d, e, f, g, h) \ - if ((W = wt_float[K]) != 0.0) { \ - E = W * a; S8 += E; \ - E = W * b; S7 += E; \ - E = W * c; S6 += E; \ - E = W * d; S5 += E; \ - E = W * e; S4 += E; \ - E = W * f; S3 += E; \ - E = W * g; S2 += E; \ - E = W * h; S1 += E; \ - a = lp[K]; \ - E = W * a; S0 += E; } else (a = lp[K]) - -# define STEP_A(K) STEP(K, a, b, c, d, e, f, g, h) -# define STEP_B(K) STEP(K, b, c, d, e, f, g, h, a) -# define STEP_C(K) STEP(K, c, d, e, f, g, h, a, b) -# define STEP_D(K) STEP(K, d, e, f, g, h, a, b, c) -# define STEP_E(K) STEP(K, e, f, g, h, a, b, c, d) -# define STEP_F(K) STEP(K, f, g, h, a, b, c, d, e) -# define STEP_G(K) STEP(K, g, h, a, b, c, d, e, f) -# define STEP_H(K) STEP(K, h, a, b, c, d, e, f, g) - - STEP_A( 0); STEP_B( 1); STEP_C( 2); STEP_D( 3); - STEP_E( 4); STEP_F( 5); STEP_G( 6); STEP_H( 7); - - STEP_A( 8); STEP_B( 9); STEP_C(10); STEP_D(11); - STEP_E(12); STEP_F(13); STEP_G(14); STEP_H(15); - - STEP_A(16); STEP_B(17); STEP_C(18); STEP_D(19); - STEP_E(20); STEP_F(21); STEP_G(22); STEP_H(23); - - STEP_A(24); STEP_B(25); STEP_C(26); STEP_D(27); - STEP_E(28); STEP_F(29); STEP_G(30); STEP_H(31); - - STEP_A(32); STEP_B(33); STEP_C(34); STEP_D(35); - STEP_E(36); STEP_F(37); STEP_G(38); STEP_H(39); - -# undef STEP_A -# undef STEP_B -# undef STEP_C -# undef STEP_D -# undef STEP_E -# undef STEP_F -# undef STEP_G -# undef STEP_H - - if (S0 > L_max) { L_max = S0; Nc = lambda; } - if (S1 > L_max) { L_max = S1; Nc = lambda + 1; } - if (S2 > L_max) { L_max = S2; Nc = lambda + 2; } - if (S3 > L_max) { L_max = S3; Nc = lambda + 3; } - if (S4 > L_max) { L_max = S4; Nc = lambda + 4; } - if (S5 > L_max) { L_max = S5; Nc = lambda + 5; } - if (S6 > L_max) { L_max = S6; Nc = lambda + 6; } - if (S7 > L_max) { L_max = S7; Nc = lambda + 7; } - if (S8 > L_max) { L_max = S8; Nc = lambda + 8; } - - } - *Nc_out = Nc; - - L_max <<= 1; - - /* Rescaling of L_max - */ - assert(scal <= 100 && scal >= -100); - L_max = L_max >> (6 - scal); /* sub(6, scal) */ - - assert( Nc <= 120 && Nc >= 40); - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - L_power = 0; - for (k = 0; k <= 39; k++) { - - register longword L_temp; - - L_temp = SASR_W( dp[k - Nc], 3 ); - L_power += L_temp * L_temp; - } - L_power <<= 1; /* from L_MULT */ - - /* Normalization of L_max and L_power - */ - - if (L_max <= 0) { - *bc_out = 0; - return; - } - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - temp = gsm_norm( L_power ); - - R = SASR( L_max << temp, 16 ); - S = SASR( L_power << temp, 16 ); - - /* Coding of the LTP gain - */ - - /* Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break; - *bc_out = bc; -} - -#endif /* LTP_CUT */ - -static void Calculation_of_the_LTP_parameters ( - register word * din, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - word Nc, bc; - - float wt_float[40]; - float dp_float_base[120], * dp_float = dp_float_base + 120; - - longword L_max, L_power; - word R, S, dmax, scal; - register word temp; - - /* Search of the optimum scaling of d[0..39]. - */ - dmax = 0; - - for (k = 0; k <= 39; k++) { - temp = din [k] ; - temp = GSM_ABS (temp) ; - if (temp > dmax) dmax = temp; - } - - temp = 0; - if (dmax == 0) scal = 0; - else { - assert(dmax > 0); - temp = gsm_norm( (longword)dmax << 16 ); - } - - if (temp > 6) scal = 0; - else scal = 6 - temp; - - assert(scal >= 0); - - /* Initialization of a working array wt - */ - - for (k = 0; k < 40; k++) wt_float[k] = SASR_W (din [k], scal) ; - for (k = -120; k < 0; k++) dp_float[k] = dp[k]; - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - - for (lambda = 40; lambda <= 120; lambda += 9) { - - /* Calculate L_result for l = lambda .. lambda + 9. - */ - register float *lp = dp_float - lambda; - - register float W; - register float a = lp[-8], b = lp[-7], c = lp[-6], - d = lp[-5], e = lp[-4], f = lp[-3], - g = lp[-2], h = lp[-1]; - register float E; - register float S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0, - S5 = 0, S6 = 0, S7 = 0, S8 = 0; - -# undef STEP -# define STEP(K, a, b, c, d, e, f, g, h) \ - W = wt_float[K]; \ - E = W * a; S8 += E; \ - E = W * b; S7 += E; \ - E = W * c; S6 += E; \ - E = W * d; S5 += E; \ - E = W * e; S4 += E; \ - E = W * f; S3 += E; \ - E = W * g; S2 += E; \ - E = W * h; S1 += E; \ - a = lp[K]; \ - E = W * a; S0 += E - -# define STEP_A(K) STEP(K, a, b, c, d, e, f, g, h) -# define STEP_B(K) STEP(K, b, c, d, e, f, g, h, a) -# define STEP_C(K) STEP(K, c, d, e, f, g, h, a, b) -# define STEP_D(K) STEP(K, d, e, f, g, h, a, b, c) -# define STEP_E(K) STEP(K, e, f, g, h, a, b, c, d) -# define STEP_F(K) STEP(K, f, g, h, a, b, c, d, e) -# define STEP_G(K) STEP(K, g, h, a, b, c, d, e, f) -# define STEP_H(K) STEP(K, h, a, b, c, d, e, f, g) - - STEP_A( 0); STEP_B( 1); STEP_C( 2); STEP_D( 3); - STEP_E( 4); STEP_F( 5); STEP_G( 6); STEP_H( 7); - - STEP_A( 8); STEP_B( 9); STEP_C(10); STEP_D(11); - STEP_E(12); STEP_F(13); STEP_G(14); STEP_H(15); - - STEP_A(16); STEP_B(17); STEP_C(18); STEP_D(19); - STEP_E(20); STEP_F(21); STEP_G(22); STEP_H(23); - - STEP_A(24); STEP_B(25); STEP_C(26); STEP_D(27); - STEP_E(28); STEP_F(29); STEP_G(30); STEP_H(31); - - STEP_A(32); STEP_B(33); STEP_C(34); STEP_D(35); - STEP_E(36); STEP_F(37); STEP_G(38); STEP_H(39); - -# undef STEP_A -# undef STEP_B -# undef STEP_C -# undef STEP_D -# undef STEP_E -# undef STEP_F -# undef STEP_G -# undef STEP_H - - if (S0 > L_max) { L_max = S0; Nc = lambda; } - if (S1 > L_max) { L_max = S1; Nc = lambda + 1; } - if (S2 > L_max) { L_max = S2; Nc = lambda + 2; } - if (S3 > L_max) { L_max = S3; Nc = lambda + 3; } - if (S4 > L_max) { L_max = S4; Nc = lambda + 4; } - if (S5 > L_max) { L_max = S5; Nc = lambda + 5; } - if (S6 > L_max) { L_max = S6; Nc = lambda + 6; } - if (S7 > L_max) { L_max = S7; Nc = lambda + 7; } - if (S8 > L_max) { L_max = S8; Nc = lambda + 8; } - } - *Nc_out = Nc; - - L_max <<= 1; - - /* Rescaling of L_max - */ - assert(scal <= 100 && scal >= -100); - L_max = L_max >> (6 - scal); /* sub(6, scal) */ - - assert( Nc <= 120 && Nc >= 40); - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - L_power = 0; - for (k = 0; k <= 39; k++) { - - register longword L_temp; - - L_temp = SASR_W( dp[k - Nc], 3 ); - L_power += L_temp * L_temp; - } - L_power <<= 1; /* from L_MULT */ - - /* Normalization of L_max and L_power - */ - - if (L_max <= 0) { - *bc_out = 0; - return; - } - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - temp = gsm_norm( L_power ); - - R = SASR_L ( L_max << temp, 16 ); - S = SASR_L ( L_power << temp, 16 ); - - /* Coding of the LTP gain - */ - - /* Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break; - *bc_out = bc; -} - -#ifdef FAST -#ifdef LTP_CUT - -static void Cut_Fast_Calculation_of_the_LTP_parameters ( - struct gsm_state * st, /* IN */ - register word * d, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - register float wt_float; - word Nc, bc; - word wt_max, best_k, ltp_cut; - - float dp_float_base[120], * dp_float = dp_float_base + 120; - - register float L_result, L_max, L_power; - - wt_max = 0; - - for (k = 0; k < 40; ++k) { - if ( d[k] > wt_max) wt_max = d[best_k = k]; - else if (-d[k] > wt_max) wt_max = -d[best_k = k]; - } - - assert(wt_max >= 0); - wt_float = (float)wt_max; - - for (k = -120; k < 0; ++k) dp_float[k] = (float)dp[k]; - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - - for (lambda = 40; lambda <= 120; lambda++) { - L_result = wt_float * dp_float[best_k - lambda]; - if (L_result > L_max) { - Nc = lambda; - L_max = L_result; - } - } - - *Nc_out = Nc; - if (L_max <= 0.) { - *bc_out = 0; - return; - } - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - dp_float -= Nc; - L_power = 0; - for (k = 0; k < 40; ++k) { - register float f = dp_float[k]; - L_power += f * f; - } - - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - /* Coding of the LTP gain - * Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - lambda = L_max / L_power * 32768.; - for (bc = 0; bc <= 2; ++bc) if (lambda <= gsm_DLB[bc]) break; - *bc_out = bc; -} - -#endif /* LTP_CUT */ - -static void Fast_Calculation_of_the_LTP_parameters ( - register word * din, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - word Nc, bc; - - float wt_float[40]; - float dp_float_base[120], * dp_float = dp_float_base + 120; - - register float L_max, L_power; - - for (k = 0; k < 40; ++k) wt_float[k] = (float) din [k] ; - for (k = -120; k < 0; ++k) dp_float[k] = (float) dp [k] ; - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - - for (lambda = 40; lambda <= 120; lambda += 9) { - - /* Calculate L_result for l = lambda .. lambda + 9. - */ - register float *lp = dp_float - lambda; - - register float W; - register float a = lp[-8], b = lp[-7], c = lp[-6], - d = lp[-5], e = lp[-4], f = lp[-3], - g = lp[-2], h = lp[-1]; - register float E; - register float S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0, - S5 = 0, S6 = 0, S7 = 0, S8 = 0; - -# undef STEP -# define STEP(K, a, b, c, d, e, f, g, h) \ - W = wt_float[K]; \ - E = W * a; S8 += E; \ - E = W * b; S7 += E; \ - E = W * c; S6 += E; \ - E = W * d; S5 += E; \ - E = W * e; S4 += E; \ - E = W * f; S3 += E; \ - E = W * g; S2 += E; \ - E = W * h; S1 += E; \ - a = lp[K]; \ - E = W * a; S0 += E - -# define STEP_A(K) STEP(K, a, b, c, d, e, f, g, h) -# define STEP_B(K) STEP(K, b, c, d, e, f, g, h, a) -# define STEP_C(K) STEP(K, c, d, e, f, g, h, a, b) -# define STEP_D(K) STEP(K, d, e, f, g, h, a, b, c) -# define STEP_E(K) STEP(K, e, f, g, h, a, b, c, d) -# define STEP_F(K) STEP(K, f, g, h, a, b, c, d, e) -# define STEP_G(K) STEP(K, g, h, a, b, c, d, e, f) -# define STEP_H(K) STEP(K, h, a, b, c, d, e, f, g) - - STEP_A( 0); STEP_B( 1); STEP_C( 2); STEP_D( 3); - STEP_E( 4); STEP_F( 5); STEP_G( 6); STEP_H( 7); - - STEP_A( 8); STEP_B( 9); STEP_C(10); STEP_D(11); - STEP_E(12); STEP_F(13); STEP_G(14); STEP_H(15); - - STEP_A(16); STEP_B(17); STEP_C(18); STEP_D(19); - STEP_E(20); STEP_F(21); STEP_G(22); STEP_H(23); - - STEP_A(24); STEP_B(25); STEP_C(26); STEP_D(27); - STEP_E(28); STEP_F(29); STEP_G(30); STEP_H(31); - - STEP_A(32); STEP_B(33); STEP_C(34); STEP_D(35); - STEP_E(36); STEP_F(37); STEP_G(38); STEP_H(39); - - if (S0 > L_max) { L_max = S0; Nc = lambda; } - if (S1 > L_max) { L_max = S1; Nc = lambda + 1; } - if (S2 > L_max) { L_max = S2; Nc = lambda + 2; } - if (S3 > L_max) { L_max = S3; Nc = lambda + 3; } - if (S4 > L_max) { L_max = S4; Nc = lambda + 4; } - if (S5 > L_max) { L_max = S5; Nc = lambda + 5; } - if (S6 > L_max) { L_max = S6; Nc = lambda + 6; } - if (S7 > L_max) { L_max = S7; Nc = lambda + 7; } - if (S8 > L_max) { L_max = S8; Nc = lambda + 8; } - } - *Nc_out = Nc; - - if (L_max <= 0.) { - *bc_out = 0; - return; - } - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - dp_float -= Nc; - L_power = 0; - for (k = 0; k < 40; ++k) { - register float f = dp_float[k]; - L_power += f * f; - } - - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - /* Coding of the LTP gain - * Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - lambda = L_max / L_power * 32768.; - for (bc = 0; bc <= 2; ++bc) if (lambda <= gsm_DLB[bc]) break; - *bc_out = bc; -} - -#endif /* FAST */ -#endif /* USE_FLOAT_MUL */ - - -/* 4.2.12 */ - -static void Long_term_analysis_filtering ( - word bc, /* IN */ - word Nc, /* IN */ - register word * dp, /* previous d [-120..-1] IN */ - register word * d, /* d [0..39] IN */ - register word * dpp, /* estimate [0..39] OUT */ - register word * e /* long term res. signal [0..39] OUT */ -) -/* - * In this part, we have to decode the bc parameter to compute - * the samples of the estimate dpp[0..39]. The decoding of bc needs the - * use of table 4.3b. The long term residual signal e[0..39] - * is then calculated to be fed to the RPE encoding section. - */ -{ - register int k; - -# undef STEP -# define STEP(BP) \ - for (k = 0; k <= 39; k++) { \ - dpp[k] = GSM_MULT_R( BP, dp[k - Nc]); \ - e[k] = GSM_SUB( d[k], dpp[k] ); \ - } - - switch (bc) { - case 0: STEP( 3277 ); break; - case 1: STEP( 11469 ); break; - case 2: STEP( 21299 ); break; - case 3: STEP( 32767 ); break; - } -} - -void Gsm_Long_Term_Predictor ( /* 4x for 160 samples */ - - struct gsm_state * S, - - word * d, /* [0..39] residual signal IN */ - word * dp, /* [-120..-1] d' IN */ - - word * e, /* [0..39] OUT */ - word * dpp, /* [0..39] OUT */ - word * Nc, /* correlation lag OUT */ - word * bc /* gain factor OUT */ -) -{ - assert( d ); assert( dp ); assert( e ); - assert( dpp); assert( Nc ); assert( bc ); - -#if defined(FAST) && defined(USE_FLOAT_MUL) - if (S->fast) -#if defined (LTP_CUT) - if (S->ltp_cut) - Cut_Fast_Calculation_of_the_LTP_parameters(S, - d, dp, bc, Nc); - else -#endif /* LTP_CUT */ - Fast_Calculation_of_the_LTP_parameters(d, dp, bc, Nc ); - else -#endif /* FAST & USE_FLOAT_MUL */ -#ifdef LTP_CUT - if (S->ltp_cut) - Cut_Calculation_of_the_LTP_parameters(S, d, dp, bc, Nc); - else -#endif - Calculation_of_the_LTP_parameters(d, dp, bc, Nc); - - Long_term_analysis_filtering( *bc, *Nc, dp, d, dpp, e ); -} - -/* 4.3.2 */ -void Gsm_Long_Term_Synthesis_Filtering ( - struct gsm_state * S, - - word Ncr, - word bcr, - register word * erp, /* [0..39] IN */ - register word * drp /* [-120..-1] IN, [-120..40] OUT */ -) -/* - * This procedure uses the bcr and Ncr parameter to realize the - * long term synthesis filtering. The decoding of bcr needs - * table 4.3b. - */ -{ - register int k; - word brp, drpp, Nr; - - /* Check the limits of Nr. - */ - Nr = Ncr < 40 || Ncr > 120 ? S->nrp : Ncr; - S->nrp = Nr; - assert(Nr >= 40 && Nr <= 120); - - /* Decoding of the LTP gain bcr - */ - brp = gsm_QLB[ bcr ]; - - /* Computation of the reconstructed short term residual - * signal drp[0..39] - */ - assert(brp != MIN_WORD); - - for (k = 0; k <= 39; k++) { - drpp = GSM_MULT_R( brp, drp[ k - Nr ] ); - drp[k] = GSM_ADD( erp[k], drpp ); - } - - /* - * Update of the reconstructed short term residual signal - * drp[ -1..-120 ] - */ - - for (k = 0; k <= 119; k++) drp[ -120 + k ] = drp[ -80 + k ]; -} diff --git a/libs/libsndfile/src/GSM610/lpc.c b/libs/libsndfile/src/GSM610/lpc.c deleted file mode 100644 index 0e776e3639..0000000000 --- a/libs/libsndfile/src/GSM610/lpc.c +++ /dev/null @@ -1,331 +0,0 @@ -/* - * 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. - */ - -#include -#include - -#include "gsm610_priv.h" - -/* - * 4.2.4 .. 4.2.7 LPC ANALYSIS SECTION - */ - -/* 4.2.4 */ - - -static void Autocorrelation ( - word * s, /* [0..159] IN/OUT */ - longword * L_ACF) /* [0..8] OUT */ -/* - * The goal is to compute the array L_ACF[k]. The signal s[i] must - * be scaled in order to avoid an overflow situation. - */ -{ - register int k, i; - - word temp, smax, scalauto; - -#ifdef USE_FLOAT_MUL - float float_s[160]; -#endif - - /* Dynamic scaling of the array s[0..159] - */ - - /* Search for the maximum. - */ - smax = 0; - for (k = 0; k <= 159; k++) { - temp = GSM_ABS( s[k] ); - if (temp > smax) smax = temp; - } - - /* Computation of the scaling factor. - */ - if (smax == 0) scalauto = 0; - else { - assert(smax > 0); - scalauto = 4 - gsm_norm( (longword)smax << 16 );/* sub(4,..) */ - } - - /* Scaling of the array s[0...159] - */ - - if (scalauto > 0) { - -# ifdef USE_FLOAT_MUL -# define SCALE(n) \ - case n: for (k = 0; k <= 159; k++) \ - float_s[k] = (float) \ - (s[k] = GSM_MULT_R(s[k], 16384 >> (n-1)));\ - break; -# else -# define SCALE(n) \ - case n: for (k = 0; k <= 159; k++) \ - s[k] = GSM_MULT_R( s[k], 16384 >> (n-1) );\ - break; -# endif /* USE_FLOAT_MUL */ - - switch (scalauto) { - SCALE(1) - SCALE(2) - SCALE(3) - SCALE(4) - } -# undef SCALE - } -# ifdef USE_FLOAT_MUL - else for (k = 0; k <= 159; k++) float_s[k] = (float) s[k]; -# endif - - /* Compute the L_ACF[..]. - */ - { -# ifdef USE_FLOAT_MUL - register float * sp = float_s; - register float sl = *sp; - -# define STEP(k) L_ACF[k] += (longword)(sl * sp[ -(k) ]); -# else - word * sp = s; - word sl = *sp; - -# define STEP(k) L_ACF[k] += ((longword)sl * sp[ -(k) ]); -# endif - -# define NEXTI sl = *++sp - - - for (k = 9; k--; L_ACF[k] = 0) ; - - STEP (0); - NEXTI; - STEP(0); STEP(1); - NEXTI; - STEP(0); STEP(1); STEP(2); - NEXTI; - STEP(0); STEP(1); STEP(2); STEP(3); - NEXTI; - STEP(0); STEP(1); STEP(2); STEP(3); STEP(4); - NEXTI; - STEP(0); STEP(1); STEP(2); STEP(3); STEP(4); STEP(5); - NEXTI; - STEP(0); STEP(1); STEP(2); STEP(3); STEP(4); STEP(5); STEP(6); - NEXTI; - STEP(0); STEP(1); STEP(2); STEP(3); STEP(4); STEP(5); STEP(6); STEP(7); - - for (i = 8; i <= 159; i++) { - - NEXTI; - - STEP(0); - STEP(1); STEP(2); STEP(3); STEP(4); - STEP(5); STEP(6); STEP(7); STEP(8); - } - - for (k = 9; k--; L_ACF[k] <<= 1) ; - - } - /* Rescaling of the array s[0..159] - */ - if (scalauto > 0) { - assert(scalauto <= 4); - for (k = 160; k--; *s++ <<= scalauto) ; - } -} - -#if defined(USE_FLOAT_MUL) && defined(FAST) - -static void Fast_Autocorrelation ( - word * s, /* [0..159] IN/OUT */ - longword * L_ACF) /* [0..8] OUT */ -{ - register int k, i; - float f_L_ACF[9]; - float scale; - - float s_f[160]; - register float *sf = s_f; - - for (i = 0; i < 160; ++i) sf[i] = s[i]; - for (k = 0; k <= 8; k++) { - register float L_temp2 = 0; - register float *sfl = sf - k; - for (i = k; i < 160; ++i) L_temp2 += sf[i] * sfl[i]; - f_L_ACF[k] = L_temp2; - } - scale = MAX_LONGWORD / f_L_ACF[0]; - - for (k = 0; k <= 8; k++) { - L_ACF[k] = f_L_ACF[k] * scale; - } -} -#endif /* defined (USE_FLOAT_MUL) && defined (FAST) */ - -/* 4.2.5 */ - -static void Reflection_coefficients ( - longword * L_ACF, /* 0...8 IN */ - register word * r /* 0...7 OUT */ -) -{ - register int i, m, n; - register word temp; - word ACF[9]; /* 0..8 */ - word P[ 9]; /* 0..8 */ - word K[ 9]; /* 2..8 */ - - /* Schur recursion with 16 bits arithmetic. - */ - - if (L_ACF[0] == 0) { - for (i = 8; i--; *r++ = 0) ; - return; - } - - assert( L_ACF[0] != 0 ); - temp = gsm_norm( L_ACF[0] ); - - assert(temp >= 0 && temp < 32); - - /* ? overflow ? */ - for (i = 0; i <= 8; i++) ACF[i] = SASR_L( L_ACF[i] << temp, 16 ); - - /* Initialize array P[..] and K[..] for the recursion. - */ - - for (i = 1; i <= 7; i++) K[ i ] = ACF[ i ]; - for (i = 0; i <= 8; i++) P[ i ] = ACF[ i ]; - - /* Compute reflection coefficients - */ - for (n = 1; n <= 8; n++, r++) { - - temp = P[1]; - temp = GSM_ABS(temp); - if (P[0] < temp) { - for (i = n; i <= 8; i++) *r++ = 0; - return; - } - - *r = gsm_div( temp, P[0] ); - - assert(*r >= 0); - if (P[1] > 0) *r = -*r; /* r[n] = sub(0, r[n]) */ - assert (*r != MIN_WORD); - if (n == 8) return; - - /* Schur recursion - */ - temp = GSM_MULT_R( P[1], *r ); - P[0] = GSM_ADD( P[0], temp ); - - for (m = 1; m <= 8 - n; m++) { - temp = GSM_MULT_R( K[ m ], *r ); - P[m] = GSM_ADD( P[ m+1 ], temp ); - - temp = GSM_MULT_R( P[ m+1 ], *r ); - K[m] = GSM_ADD( K[ m ], temp ); - } - } -} - -/* 4.2.6 */ - -static void Transformation_to_Log_Area_Ratios ( - register word * r /* 0..7 IN/OUT */ -) -/* - * The following scaling for r[..] and LAR[..] has been used: - * - * r[..] = integer( real_r[..]*32768. ); -1 <= real_r < 1. - * LAR[..] = integer( real_LAR[..] * 16384 ); - * with -1.625 <= real_LAR <= 1.625 - */ -{ - register word temp; - register int i; - - - /* Computation of the LAR[0..7] from the r[0..7] - */ - for (i = 1; i <= 8; i++, r++) { - - temp = *r; - temp = GSM_ABS(temp); - assert(temp >= 0); - - if (temp < 22118) { - temp >>= 1; - } else if (temp < 31130) { - assert( temp >= 11059 ); - temp -= 11059; - } else { - assert( temp >= 26112 ); - temp -= 26112; - temp <<= 2; - } - - *r = *r < 0 ? -temp : temp; - assert( *r != MIN_WORD ); - } -} - -/* 4.2.7 */ - -static void Quantization_and_coding ( - register word * LAR /* [0..7] IN/OUT */ -) -{ - register word temp; - - /* This procedure needs four tables; the following equations - * give the optimum scaling for the constants: - * - * A[0..7] = integer( real_A[0..7] * 1024 ) - * B[0..7] = integer( real_B[0..7] * 512 ) - * MAC[0..7] = maximum of the LARc[0..7] - * MIC[0..7] = minimum of the LARc[0..7] - */ - -# undef STEP -# define STEP( A, B, MAC, MIC ) \ - temp = GSM_MULT( A, *LAR ); \ - temp = GSM_ADD( temp, B ); \ - temp = GSM_ADD( temp, 256 ); \ - temp = SASR_W( temp, 9 ); \ - *LAR = temp>MAC ? MAC - MIC : (tempfast) Fast_Autocorrelation (s, L_ACF ); - else -#endif - Autocorrelation (s, L_ACF ); - Reflection_coefficients (L_ACF, LARc ); - Transformation_to_Log_Area_Ratios (LARc); - Quantization_and_coding (LARc); -} diff --git a/libs/libsndfile/src/GSM610/preprocess.c b/libs/libsndfile/src/GSM610/preprocess.c deleted file mode 100644 index 723e226a56..0000000000 --- a/libs/libsndfile/src/GSM610/preprocess.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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. - */ - -#include -#include - -#include "gsm610_priv.h" - -/* 4.2.0 .. 4.2.3 PREPROCESSING SECTION - * - * After A-law to linear conversion (or directly from the - * Ato D converter) the following scaling is assumed for - * input to the RPE-LTP algorithm: - * - * in: 0.1.....................12 - * S.v.v.v.v.v.v.v.v.v.v.v.v.*.*.* - * - * Where S is the sign bit, v a valid bit, and * a "don't care" bit. - * The original signal is called sop[..] - * - * out: 0.1................... 12 - * S.S.v.v.v.v.v.v.v.v.v.v.v.v.0.0 - */ - - -void Gsm_Preprocess ( - struct gsm_state * S, - word * s, - word * so ) /* [0..159] IN/OUT */ -{ - - word z1 = S->z1; - longword L_z2 = S->L_z2; - word mp = S->mp; - - word s1; - longword L_s2; - - longword L_temp; - - word msp, lsp; - word SO; - - register int k = 160; - - while (k--) { - - /* 4.2.1 Downscaling of the input signal - */ - SO = SASR_W( *s, 3 ) << 2; - s++; - - assert (SO >= -0x4000); /* downscaled by */ - assert (SO <= 0x3FFC); /* previous routine. */ - - - /* 4.2.2 Offset compensation - * - * This part implements a high-pass filter and requires extended - * arithmetic precision for the recursive part of this filter. - * The input of this procedure is the array so[0...159] and the - * output the array sof[ 0...159 ]. - */ - /* Compute the non-recursive part - */ - - s1 = SO - z1; /* s1 = gsm_sub( *so, z1 ); */ - z1 = SO; - - assert(s1 != MIN_WORD); - - /* Compute the recursive part - */ - L_s2 = s1; - L_s2 <<= 15; - - /* Execution of a 31 bv 16 bits multiplication - */ - - msp = SASR_L( L_z2, 15 ); - lsp = L_z2-((longword)msp<<15); /* gsm_L_sub(L_z2,(msp<<15)); */ - - L_s2 += GSM_MULT_R( lsp, 32735 ); - L_temp = (longword)msp * 32735; /* GSM_L_MULT(msp,32735) >> 1;*/ - L_z2 = GSM_L_ADD( L_temp, L_s2 ); - - /* Compute sof[k] with rounding - */ - L_temp = GSM_L_ADD( L_z2, 16384 ); - - /* 4.2.3 Preemphasis - */ - - msp = GSM_MULT_R( mp, -28180 ); - mp = SASR_L( L_temp, 15 ); - *so++ = GSM_ADD( mp, msp ); - } - - S->z1 = z1; - S->L_z2 = L_z2; - S->mp = mp; -} diff --git a/libs/libsndfile/src/GSM610/rpe.c b/libs/libsndfile/src/GSM610/rpe.c deleted file mode 100644 index d8f931e214..0000000000 --- a/libs/libsndfile/src/GSM610/rpe.c +++ /dev/null @@ -1,480 +0,0 @@ -/* - * 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. - */ - -#include -#include - -#include "gsm610_priv.h" - -/* 4.2.13 .. 4.2.17 RPE ENCODING SECTION - */ - -/* 4.2.13 */ - -static void Weighting_filter ( - register word * e, /* signal [-5..0.39.44] IN */ - word * x /* signal [0..39] OUT */ -) -/* - * The coefficients of the weighting filter are stored in a table - * (see table 4.4). The following scaling is used: - * - * H[0..10] = integer( real_H[ 0..10] * 8192 ); - */ -{ - /* word wt[ 50 ]; */ - - register longword L_result; - register int k /* , i */ ; - - /* Initialization of a temporary working array wt[0...49] - */ - - /* for (k = 0; k <= 4; k++) wt[k] = 0; - * for (k = 5; k <= 44; k++) wt[k] = *e++; - * for (k = 45; k <= 49; k++) wt[k] = 0; - * - * (e[-5..-1] and e[40..44] are allocated by the caller, - * are initially zero and are not written anywhere.) - */ - e -= 5; - - /* Compute the signal x[0..39] - */ - for (k = 0; k <= 39; k++) { - - L_result = 8192 >> 1; - - /* for (i = 0; i <= 10; i++) { - * L_temp = GSM_L_MULT( wt[k+i], gsm_H[i] ); - * L_result = GSM_L_ADD( L_result, L_temp ); - * } - */ - -#undef STEP -#define STEP( i, H ) (e[ k + i ] * (longword)H) - - /* Every one of these multiplications is done twice -- - * but I don't see an elegant way to optimize this. - * Do you? - */ - -#ifdef STUPID_COMPILER - L_result += STEP( 0, -134 ) ; - L_result += STEP( 1, -374 ) ; - /* + STEP( 2, 0 ) */ - L_result += STEP( 3, 2054 ) ; - L_result += STEP( 4, 5741 ) ; - L_result += STEP( 5, 8192 ) ; - L_result += STEP( 6, 5741 ) ; - L_result += STEP( 7, 2054 ) ; - /* + STEP( 8, 0 ) */ - L_result += STEP( 9, -374 ) ; - L_result += STEP( 10, -134 ) ; -#else - L_result += - STEP( 0, -134 ) - + STEP( 1, -374 ) - /* + STEP( 2, 0 ) */ - + STEP( 3, 2054 ) - + STEP( 4, 5741 ) - + STEP( 5, 8192 ) - + STEP( 6, 5741 ) - + STEP( 7, 2054 ) - /* + STEP( 8, 0 ) */ - + STEP( 9, -374 ) - + STEP(10, -134 ) - ; -#endif - - /* L_result = GSM_L_ADD( L_result, L_result ); (* scaling(x2) *) - * L_result = GSM_L_ADD( L_result, L_result ); (* scaling(x4) *) - * - * x[k] = SASR( L_result, 16 ); - */ - - /* 2 adds vs. >>16 => 14, minus one shift to compensate for - * those we lost when replacing L_MULT by '*'. - */ - - L_result = SASR_L( L_result, 13 ); - x[k] = ( L_result < MIN_WORD ? MIN_WORD - : (L_result > MAX_WORD ? MAX_WORD : L_result )); - } -} - -/* 4.2.14 */ - -static void RPE_grid_selection ( - word * x, /* [0..39] IN */ - word * xM, /* [0..12] OUT */ - word * Mc_out /* OUT */ -) -/* - * The signal x[0..39] is used to select the RPE grid which is - * represented by Mc. - */ -{ - /* register word temp1; */ - register int /* m, */ i; - register longword L_result, L_temp; - longword EM; /* xxx should be L_EM? */ - word Mc; - - longword L_common_0_3; - - EM = 0; - Mc = 0; - - /* for (m = 0; m <= 3; m++) { - * L_result = 0; - * - * - * for (i = 0; i <= 12; i++) { - * - * temp1 = SASR_W( x[m + 3*i], 2 ); - * - * assert(temp1 != MIN_WORD); - * - * L_temp = GSM_L_MULT( temp1, temp1 ); - * L_result = GSM_L_ADD( L_temp, L_result ); - * } - * - * if (L_result > EM) { - * Mc = m; - * EM = L_result; - * } - * } - */ - -#undef STEP -#define STEP( m, i ) L_temp = SASR_W( x[m + 3 * i], 2 ); \ - L_result += L_temp * L_temp; - - /* common part of 0 and 3 */ - - L_result = 0; - STEP( 0, 1 ); STEP( 0, 2 ); STEP( 0, 3 ); STEP( 0, 4 ); - STEP( 0, 5 ); STEP( 0, 6 ); STEP( 0, 7 ); STEP( 0, 8 ); - STEP( 0, 9 ); STEP( 0, 10); STEP( 0, 11); STEP( 0, 12); - L_common_0_3 = L_result; - - /* i = 0 */ - - STEP( 0, 0 ); - L_result <<= 1; /* implicit in L_MULT */ - EM = L_result; - - /* i = 1 */ - - L_result = 0; - STEP( 1, 0 ); - STEP( 1, 1 ); STEP( 1, 2 ); STEP( 1, 3 ); STEP( 1, 4 ); - STEP( 1, 5 ); STEP( 1, 6 ); STEP( 1, 7 ); STEP( 1, 8 ); - STEP( 1, 9 ); STEP( 1, 10); STEP( 1, 11); STEP( 1, 12); - L_result <<= 1; - if (L_result > EM) { - Mc = 1; - EM = L_result; - } - - /* i = 2 */ - - L_result = 0; - STEP( 2, 0 ); - STEP( 2, 1 ); STEP( 2, 2 ); STEP( 2, 3 ); STEP( 2, 4 ); - STEP( 2, 5 ); STEP( 2, 6 ); STEP( 2, 7 ); STEP( 2, 8 ); - STEP( 2, 9 ); STEP( 2, 10); STEP( 2, 11); STEP( 2, 12); - L_result <<= 1; - if (L_result > EM) { - Mc = 2; - EM = L_result; - } - - /* i = 3 */ - - L_result = L_common_0_3; - STEP( 3, 12 ); - L_result <<= 1; - if (L_result > EM) { - Mc = 3; - EM = L_result; - } - - /**/ - - /* Down-sampling by a factor 3 to get the selected xM[0..12] - * RPE sequence. - */ - for (i = 0; i <= 12; i ++) xM[i] = x[Mc + 3*i]; - *Mc_out = Mc; -} - -/* 4.12.15 */ - -static void APCM_quantization_xmaxc_to_exp_mant ( - word xmaxc, /* IN */ - word * expon_out, /* OUT */ - word * mant_out ) /* OUT */ -{ - word expon, mant; - - /* Compute expononent and mantissa of the decoded version of xmaxc - */ - - expon = 0; - if (xmaxc > 15) expon = SASR_W(xmaxc, 3) - 1; - mant = xmaxc - (expon << 3); - - if (mant == 0) { - expon = -4; - mant = 7; - } - else { - while (mant <= 7) { - mant = mant << 1 | 1; - expon--; - } - mant -= 8; - } - - assert( expon >= -4 && expon <= 6 ); - assert( mant >= 0 && mant <= 7 ); - - *expon_out = expon; - *mant_out = mant; -} - -static void APCM_quantization ( - word * xM, /* [0..12] IN */ - word * xMc, /* [0..12] OUT */ - word * mant_out, /* OUT */ - word * expon_out, /* OUT */ - word * xmaxc_out /* OUT */ -) -{ - int i, itest; - - word xmax, xmaxc, temp, temp1, temp2; - word expon, mant; - - - /* Find the maximum absolute value xmax of xM[0..12]. - */ - - xmax = 0; - for (i = 0; i <= 12; i++) { - temp = xM[i]; - temp = GSM_ABS(temp); - if (temp > xmax) xmax = temp; - } - - /* Qantizing and coding of xmax to get xmaxc. - */ - - expon = 0; - temp = SASR_W( xmax, 9 ); - itest = 0; - - for (i = 0; i <= 5; i++) { - - itest |= (temp <= 0); - temp = SASR_W( temp, 1 ); - - assert(expon <= 5); - if (itest == 0) expon++; /* expon = add (expon, 1) */ - } - - assert(expon <= 6 && expon >= 0); - temp = expon + 5; - - assert(temp <= 11 && temp >= 0); - xmaxc = gsm_add( SASR_W(xmax, temp), (word) (expon << 3) ); - - /* Quantizing and coding of the xM[0..12] RPE sequence - * to get the xMc[0..12] - */ - - APCM_quantization_xmaxc_to_exp_mant( xmaxc, &expon, &mant ); - - /* This computation uses the fact that the decoded version of xmaxc - * can be calculated by using the expononent and the mantissa part of - * xmaxc (logarithmic table). - * So, this method avoids any division and uses only a scaling - * of the RPE samples by a function of the expononent. A direct - * multiplication by the inverse of the mantissa (NRFAC[0..7] - * found in table 4.5) gives the 3 bit coded version xMc[0..12] - * of the RPE samples. - */ - - - /* Direct computation of xMc[0..12] using table 4.5 - */ - - assert( expon <= 4096 && expon >= -4096); - assert( mant >= 0 && mant <= 7 ); - - temp1 = 6 - expon; /* normalization by the expononent */ - temp2 = gsm_NRFAC[ mant ]; /* inverse mantissa */ - - for (i = 0; i <= 12; i++) { - - assert(temp1 >= 0 && temp1 < 16); - - temp = xM[i] << temp1; - temp = GSM_MULT( temp, temp2 ); - temp = SASR_W(temp, 12); - xMc[i] = temp + 4; /* see note below */ - } - - /* NOTE: This equation is used to make all the xMc[i] positive. - */ - - *mant_out = mant; - *expon_out = expon; - *xmaxc_out = xmaxc; -} - -/* 4.2.16 */ - -static void APCM_inverse_quantization ( - register word * xMc, /* [0..12] IN */ - word mant, - word expon, - register word * xMp) /* [0..12] OUT */ -/* - * This part is for decoding the RPE sequence of coded xMc[0..12] - * samples to obtain the xMp[0..12] array. Table 4.6 is used to get - * the mantissa of xmaxc (FAC[0..7]). - */ -{ - int i; - word temp, temp1, temp2, temp3; - - assert( mant >= 0 && mant <= 7 ); - - temp1 = gsm_FAC[ mant ]; /* see 4.2-15 for mant */ - temp2 = gsm_sub( 6, expon ); /* see 4.2-15 for exp */ - temp3 = gsm_asl( 1, gsm_sub( temp2, 1 )); - - for (i = 13; i--;) { - - assert( *xMc <= 7 && *xMc >= 0 ); /* 3 bit unsigned */ - - /* temp = gsm_sub( *xMc++ << 1, 7 ); */ - temp = (*xMc++ << 1) - 7; /* restore sign */ - assert( temp <= 7 && temp >= -7 ); /* 4 bit signed */ - - temp <<= 12; /* 16 bit signed */ - temp = GSM_MULT_R( temp1, temp ); - temp = GSM_ADD( temp, temp3 ); - *xMp++ = gsm_asr( temp, temp2 ); - } -} - -/* 4.2.17 */ - -static void RPE_grid_positioning ( - word Mc, /* grid position IN */ - register word * xMp, /* [0..12] IN */ - register word * ep /* [0..39] OUT */ -) -/* - * This procedure computes the reconstructed long term residual signal - * ep[0..39] for the LTP analysis filter. The inputs are the Mc - * which is the grid position selection and the xMp[0..12] decoded - * RPE samples which are upsampled by a factor of 3 by inserting zero - * values. - */ -{ - int i = 13; - - assert(0 <= Mc && Mc <= 3); - - switch (Mc) { - case 3: *ep++ = 0; - case 2: do { - *ep++ = 0; - case 1: *ep++ = 0; - case 0: *ep++ = *xMp++; - } while (--i); - } - while (++Mc < 4) *ep++ = 0; - - /* - - int i, k; - for (k = 0; k <= 39; k++) ep[k] = 0; - for (i = 0; i <= 12; i++) { - ep[ Mc + (3*i) ] = xMp[i]; - } - */ -} - -/* 4.2.18 */ - -/* This procedure adds the reconstructed long term residual signal - * ep[0..39] to the estimated signal dpp[0..39] from the long term - * analysis filter to compute the reconstructed short term residual - * signal dp[-40..-1]; also the reconstructed short term residual - * array dp[-120..-41] is updated. - */ - -#if 0 /* Has been inlined in code.c */ -void Gsm_Update_of_reconstructed_short_time_residual_signal ( - word * dpp, /* [0...39] IN */ - word * ep, /* [0...39] IN */ - word * dp) /* [-120...-1] IN/OUT */ -{ - int k; - - for (k = 0; k <= 79; k++) - dp[ -120 + k ] = dp[ -80 + k ]; - - for (k = 0; k <= 39; k++) - dp[ -40 + k ] = gsm_add( ep[k], dpp[k] ); -} -#endif /* Has been inlined in code.c */ - -void Gsm_RPE_Encoding ( - /*-struct gsm_state * S,-*/ - - word * e, /* -5..-1][0..39][40..44 IN/OUT */ - word * xmaxc, /* OUT */ - word * Mc, /* OUT */ - word * xMc) /* [0..12] OUT */ -{ - word x[40]; - word xM[13], xMp[13]; - word mant, expon; - - Weighting_filter(e, x); - RPE_grid_selection(x, xM, Mc); - - APCM_quantization( xM, xMc, &mant, &expon, xmaxc); - APCM_inverse_quantization( xMc, mant, expon, xMp); - - RPE_grid_positioning( *Mc, xMp, e ); - -} - -void Gsm_RPE_Decoding ( - /*-struct gsm_state * S,-*/ - - word xmaxcr, - word Mcr, - word * xMcr, /* [0..12], 3 bits IN */ - word * erp /* [0..39] OUT */ -) -{ - word expon, mant; - word xMp[ 13 ]; - - APCM_quantization_xmaxc_to_exp_mant( xmaxcr, &expon, &mant ); - APCM_inverse_quantization( xMcr, mant, expon, xMp ); - RPE_grid_positioning( Mcr, xMp, erp ); - -} diff --git a/libs/libsndfile/src/GSM610/short_term.c b/libs/libsndfile/src/GSM610/short_term.c deleted file mode 100644 index 904856318f..0000000000 --- a/libs/libsndfile/src/GSM610/short_term.c +++ /dev/null @@ -1,417 +0,0 @@ -/* - * 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. - */ - -#include -#include - -#include "gsm610_priv.h" - -/* - * SHORT TERM ANALYSIS FILTERING SECTION - */ - -/* 4.2.8 */ - -static void Decoding_of_the_coded_Log_Area_Ratios ( - word * LARc, /* coded log area ratio [0..7] IN */ - word * LARpp) /* out: decoded .. */ -{ - register word temp1 /* , temp2 */; - - /* This procedure requires for efficient implementation - * two tables. - * - * INVA[1..8] = integer( (32768 * 8) / real_A[1..8]) - * MIC[1..8] = minimum value of the LARc[1..8] - */ - - /* Compute the LARpp[1..8] - */ - - /* for (i = 1; i <= 8; i++, B++, MIC++, INVA++, LARc++, LARpp++) { - * - * temp1 = GSM_ADD( *LARc, *MIC ) << 10; - * temp2 = *B << 1; - * temp1 = GSM_SUB( temp1, temp2 ); - * - * assert(*INVA != MIN_WORD); - * - * temp1 = GSM_MULT_R( *INVA, temp1 ); - * *LARpp = GSM_ADD( temp1, temp1 ); - * } - */ - -#undef STEP -#define STEP( B, MIC, INVA ) \ - temp1 = GSM_ADD( *LARc++, MIC ) << 10; \ - temp1 = GSM_SUB( temp1, B << 1 ); \ - temp1 = GSM_MULT_R( INVA, temp1 ); \ - *LARpp++ = GSM_ADD( temp1, temp1 ); - - STEP( 0, -32, 13107 ); - STEP( 0, -32, 13107 ); - STEP( 2048, -16, 13107 ); - STEP( -2560, -16, 13107 ); - - STEP( 94, -8, 19223 ); - STEP( -1792, -8, 17476 ); - STEP( -341, -4, 31454 ); - STEP( -1144, -4, 29708 ); - - /* NOTE: the addition of *MIC is used to restore - * the sign of *LARc. - */ -} - -/* 4.2.9 */ -/* Computation of the quantized reflection coefficients - */ - -/* 4.2.9.1 Interpolation of the LARpp[1..8] to get the LARp[1..8] - */ - -/* - * Within each frame of 160 analyzed speech samples the short term - * analysis and synthesis filters operate with four different sets of - * coefficients, derived from the previous set of decoded LARs(LARpp(j-1)) - * and the actual set of decoded LARs (LARpp(j)) - * - * (Initial value: LARpp(j-1)[1..8] = 0.) - */ - -static void Coefficients_0_12 ( - register word * LARpp_j_1, - register word * LARpp_j, - register word * LARp) -{ - register int i; - - for (i = 1; i <= 8; i++, LARp++, LARpp_j_1++, LARpp_j++) { - *LARp = GSM_ADD( SASR_W( *LARpp_j_1, 2 ), SASR_W( *LARpp_j, 2 )); - *LARp = GSM_ADD( *LARp, SASR_W( *LARpp_j_1, 1)); - } -} - -static void Coefficients_13_26 ( - register word * LARpp_j_1, - register word * LARpp_j, - register word * LARp) -{ - register int i; - for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) { - *LARp = GSM_ADD( SASR_W( *LARpp_j_1, 1), SASR_W( *LARpp_j, 1 )); - } -} - -static void Coefficients_27_39 ( - register word * LARpp_j_1, - register word * LARpp_j, - register word * LARp) -{ - register int i; - - for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) { - *LARp = GSM_ADD( SASR_W( *LARpp_j_1, 2 ), SASR_W( *LARpp_j, 2 )); - *LARp = GSM_ADD( *LARp, SASR_W( *LARpp_j, 1 )); - } -} - - -static void Coefficients_40_159 ( - register word * LARpp_j, - register word * LARp) -{ - register int i; - - for (i = 1; i <= 8; i++, LARp++, LARpp_j++) - *LARp = *LARpp_j; -} - -/* 4.2.9.2 */ - -static void LARp_to_rp ( - register word * LARp) /* [0..7] IN/OUT */ -/* - * The input of this procedure is the interpolated LARp[0..7] array. - * The reflection coefficients, rp[i], are used in the analysis - * filter and in the synthesis filter. - */ -{ - register int i; - register word temp; - - for (i = 1; i <= 8; i++, LARp++) { - - /* temp = GSM_ABS( *LARp ); - * - * if (temp < 11059) temp <<= 1; - * else if (temp < 20070) temp += 11059; - * else temp = GSM_ADD( temp >> 2, 26112 ); - * - * *LARp = *LARp < 0 ? -temp : temp; - */ - - if (*LARp < 0) { - temp = *LARp == MIN_WORD ? MAX_WORD : -(*LARp); - *LARp = - ((temp < 11059) ? temp << 1 - : ((temp < 20070) ? temp + 11059 - : GSM_ADD( (word) (temp >> 2), (word) 26112 ))); - } else { - temp = *LARp; - *LARp = (temp < 11059) ? temp << 1 - : ((temp < 20070) ? temp + 11059 - : GSM_ADD( (word) (temp >> 2), (word) 26112 )); - } - } -} - - -/* 4.2.10 */ -static void Short_term_analysis_filtering ( - struct gsm_state * S, - register word * rp, /* [0..7] IN */ - register int k_n, /* k_end - k_start */ - register word * s /* [0..n-1] IN/OUT */ -) -/* - * This procedure computes the short term residual signal d[..] to be fed - * to the RPE-LTP loop from the s[..] signal and from the local rp[..] - * array (quantized reflection coefficients). As the call of this - * procedure can be done in many ways (see the interpolation of the LAR - * coefficient), it is assumed that the computation begins with index - * k_start (for arrays d[..] and s[..]) and stops with index k_end - * (k_start and k_end are defined in 4.2.9.1). This procedure also - * needs to keep the array u[0..7] in memory for each call. - */ -{ - register word * u = S->u; - register int i; - register word di, zzz, ui, sav, rpi; - - for (; k_n--; s++) { - - di = sav = *s; - - for (i = 0; i < 8; i++) { /* YYY */ - - ui = u[i]; - rpi = rp[i]; - u[i] = sav; - - zzz = GSM_MULT_R(rpi, di); - sav = GSM_ADD( ui, zzz); - - zzz = GSM_MULT_R(rpi, ui); - di = GSM_ADD( di, zzz ); - } - - *s = di; - } -} - -#if defined(USE_FLOAT_MUL) && defined(FAST) - -static void Fast_Short_term_analysis_filtering ( - struct gsm_state * S, - register word * rp, /* [0..7] IN */ - register int k_n, /* k_end - k_start */ - register word * s /* [0..n-1] IN/OUT */ -) -{ - register word * u = S->u; - register int i; - - float uf[8], - rpf[8]; - - register float scalef = 3.0517578125e-5; - register float sav, di, temp; - - for (i = 0; i < 8; ++i) { - uf[i] = u[i]; - rpf[i] = rp[i] * scalef; - } - for (; k_n--; s++) { - sav = di = *s; - for (i = 0; i < 8; ++i) { - register float rpfi = rpf[i]; - register float ufi = uf[i]; - - uf[i] = sav; - temp = rpfi * di + ufi; - di += rpfi * ufi; - sav = temp; - } - *s = di; - } - for (i = 0; i < 8; ++i) u[i] = uf[i]; -} -#endif /* ! (defined (USE_FLOAT_MUL) && defined (FAST)) */ - -static void Short_term_synthesis_filtering ( - struct gsm_state * S, - register word * rrp, /* [0..7] IN */ - register int k, /* k_end - k_start */ - register word * wt, /* [0..k-1] IN */ - register word * sr /* [0..k-1] OUT */ -) -{ - register word * v = S->v; - register int i; - register word sri, tmp1, tmp2; - - while (k--) { - sri = *wt++; - for (i = 8; i--;) { - - /* sri = GSM_SUB( sri, gsm_mult_r( rrp[i], v[i] ) ); - */ - tmp1 = rrp[i]; - tmp2 = v[i]; - tmp2 = ( tmp1 == MIN_WORD && tmp2 == MIN_WORD - ? MAX_WORD - : 0x0FFFF & (( (longword)tmp1 * (longword)tmp2 - + 16384) >> 15)) ; - - sri = GSM_SUB( sri, tmp2 ); - - /* v[i+1] = GSM_ADD( v[i], gsm_mult_r( rrp[i], sri ) ); - */ - tmp1 = ( tmp1 == MIN_WORD && sri == MIN_WORD - ? MAX_WORD - : 0x0FFFF & (( (longword)tmp1 * (longword)sri - + 16384) >> 15)) ; - - v[i+1] = GSM_ADD( v[i], tmp1); - } - *sr++ = v[0] = sri; - } -} - - -#if defined(FAST) && defined(USE_FLOAT_MUL) - -static void Fast_Short_term_synthesis_filtering ( - struct gsm_state * S, - register word * rrp, /* [0..7] IN */ - register int k, /* k_end - k_start */ - register word * wt, /* [0..k-1] IN */ - register word * sr /* [0..k-1] OUT */ -) -{ - register word * v = S->v; - register int i; - - float va[9], rrpa[8]; - register float scalef = 3.0517578125e-5, temp; - - for (i = 0; i < 8; ++i) { - va[i] = v[i]; - rrpa[i] = (float)rrp[i] * scalef; - } - while (k--) { - register float sri = *wt++; - for (i = 8; i--;) { - sri -= rrpa[i] * va[i]; - if (sri < -32768.) sri = -32768.; - else if (sri > 32767.) sri = 32767.; - - temp = va[i] + rrpa[i] * sri; - if (temp < -32768.) temp = -32768.; - else if (temp > 32767.) temp = 32767.; - va[i+1] = temp; - } - *sr++ = va[0] = sri; - } - for (i = 0; i < 9; ++i) v[i] = va[i]; -} - -#endif /* defined(FAST) && defined(USE_FLOAT_MUL) */ - -void Gsm_Short_Term_Analysis_Filter ( - - struct gsm_state * S, - - word * LARc, /* coded log area ratio [0..7] IN */ - word * s /* signal [0..159] IN/OUT */ -) -{ - word * LARpp_j = S->LARpp[ S->j ]; - word * LARpp_j_1 = S->LARpp[ S->j ^= 1 ]; - - word LARp[8]; - -#undef FILTER -#if defined(FAST) && defined(USE_FLOAT_MUL) -# define FILTER (* (S->fast \ - ? Fast_Short_term_analysis_filtering \ - : Short_term_analysis_filtering )) - -#else -# define FILTER Short_term_analysis_filtering -#endif - - Decoding_of_the_coded_Log_Area_Ratios( LARc, LARpp_j ); - - Coefficients_0_12( LARpp_j_1, LARpp_j, LARp ); - LARp_to_rp( LARp ); - FILTER( S, LARp, 13, s); - - Coefficients_13_26( LARpp_j_1, LARpp_j, LARp); - LARp_to_rp( LARp ); - FILTER( S, LARp, 14, s + 13); - - Coefficients_27_39( LARpp_j_1, LARpp_j, LARp); - LARp_to_rp( LARp ); - FILTER( S, LARp, 13, s + 27); - - Coefficients_40_159( LARpp_j, LARp); - LARp_to_rp( LARp ); - FILTER( S, LARp, 120, s + 40); -} - -void Gsm_Short_Term_Synthesis_Filter ( - struct gsm_state * S, - - word * LARcr, /* received log area ratios [0..7] IN */ - word * wt, /* received d [0..159] IN */ - - word * s /* signal s [0..159] OUT */ -) -{ - word * LARpp_j = S->LARpp[ S->j ]; - word * LARpp_j_1 = S->LARpp[ S->j ^=1 ]; - - word LARp[8]; - -#undef FILTER -#if defined(FAST) && defined(USE_FLOAT_MUL) - -# define FILTER (* (S->fast \ - ? Fast_Short_term_synthesis_filtering \ - : Short_term_synthesis_filtering )) -#else -# define FILTER Short_term_synthesis_filtering -#endif - - Decoding_of_the_coded_Log_Area_Ratios( LARcr, LARpp_j ); - - Coefficients_0_12( LARpp_j_1, LARpp_j, LARp ); - LARp_to_rp( LARp ); - FILTER( S, LARp, 13, wt, s ); - - Coefficients_13_26( LARpp_j_1, LARpp_j, LARp); - LARp_to_rp( LARp ); - FILTER( S, LARp, 14, wt + 13, s + 13 ); - - Coefficients_27_39( LARpp_j_1, LARpp_j, LARp); - LARp_to_rp( LARp ); - FILTER( S, LARp, 13, wt + 27, s + 27 ); - - Coefficients_40_159( LARpp_j, LARp ); - LARp_to_rp( LARp ); - FILTER(S, LARp, 120, wt + 40, s + 40); -} diff --git a/libs/libsndfile/src/GSM610/table.c b/libs/libsndfile/src/GSM610/table.c deleted file mode 100644 index 8b83f78cf5..0000000000 --- a/libs/libsndfile/src/GSM610/table.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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. - */ - -/* Most of these tables are inlined at their point of use. - */ - -/* 4.4 TABLES USED IN THE FIXED POINT IMPLEMENTATION OF THE RPE-LTP - * CODER AND DECODER - * - * (Most of them inlined, so watch out.) - */ - -#define GSM_TABLE_C -#include "gsm610_priv.h" - -/* Table 4.1 Quantization of the Log.-Area Ratios - */ -/* i 1 2 3 4 5 6 7 8 */ -word gsm_A[8] = {20480, 20480, 20480, 20480, 13964, 15360, 8534, 9036}; -word gsm_B[8] = { 0, 0, 2048, -2560, 94, -1792, -341, -1144}; -word gsm_MIC[8] = { -32, -32, -16, -16, -8, -8, -4, -4 }; -word gsm_MAC[8] = { 31, 31, 15, 15, 7, 7, 3, 3 }; - - -/* Table 4.2 Tabulation of 1/A[1..8] - */ -word gsm_INVA[8]={ 13107, 13107, 13107, 13107, 19223, 17476, 31454, 29708 }; - - -/* Table 4.3a Decision level of the LTP gain quantizer - */ -/* bc 0 1 2 3 */ -word gsm_DLB[4] = { 6554, 16384, 26214, 32767 }; - - -/* Table 4.3b Quantization levels of the LTP gain quantizer - */ -/* bc 0 1 2 3 */ -word gsm_QLB[4] = { 3277, 11469, 21299, 32767 }; - - -/* Table 4.4 Coefficients of the weighting filter - */ -/* i 0 1 2 3 4 5 6 7 8 9 10 */ -word gsm_H[11] = {-134, -374, 0, 2054, 5741, 8192, 5741, 2054, 0, -374, -134 }; - - -/* Table 4.5 Normalized inverse mantissa used to compute xM/xmax - */ -/* i 0 1 2 3 4 5 6 7 */ -word gsm_NRFAC[8] = { 29128, 26215, 23832, 21846, 20165, 18725, 17476, 16384 }; - - -/* Table 4.6 Normalized direct mantissa used to compute xM/xmax - */ -/* i 0 1 2 3 4 5 6 7 */ -word gsm_FAC[8] = { 18431, 20479, 22527, 24575, 26623, 28671, 30719, 32767 }; diff --git a/libs/libsndfile/src/Makefile.am b/libs/libsndfile/src/Makefile.am deleted file mode 100644 index 7c307a8b42..0000000000 --- a/libs/libsndfile/src/Makefile.am +++ /dev/null @@ -1,134 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AUTOMAKE_OPTIONS = subdir-objects - -AM_CPPFLAGS = @EXTERNAL_CFLAGS@ - -lib_LTLIBRARIES = libsndfile.la -include_HEADERS = sndfile.hh -nodist_include_HEADERS = sndfile.h - -noinst_LTLIBRARIES = GSM610/libgsm.la G72x/libg72x.la ALAC/libalac.la libcommon.la - -OS_SPECIFIC_CFLAGS = @OS_SPECIFIC_CFLAGS@ -OS_SPECIFIC_LINKS = @OS_SPECIFIC_LINKS@ - -SYMBOL_FILES = Symbols.gnu-binutils Symbols.darwin libsndfile-1.def Symbols.os2 Symbols.static - -EXTRA_DIST = sndfile.h.in config.h.in test_endswap.tpl test_endswap.def \ - create_symbols_file.py binheader_writef_check.py \ - GSM610/README GSM610/COPYRIGHT GSM610/ChangeLog \ - G72x/README G72x/README.original G72x/ChangeLog \ - make-static-lib-hidden-privates.sh - -noinst_HEADERS = common.h sfconfig.h sfendian.h wav_w64.h sf_unistd.h ogg.h chanmap.h - -noinst_PROGRAMS = - -COMMON = common.c file_io.c command.c pcm.c ulaw.c alaw.c float32.c \ - double64.c ima_adpcm.c ms_adpcm.c gsm610.c dwvw.c vox_adpcm.c \ - interleave.c strings.c dither.c cart.c broadcast.c audio_detect.c \ - ima_oki_adpcm.c ima_oki_adpcm.h alac.c chunk.c ogg.c chanmap.c \ - windows.c id3.c $(WIN_VERSION_FILE) - -FILESPECIFIC = sndfile.c aiff.c au.c avr.c caf.c dwd.c flac.c g72x.c htk.c ircam.c \ - macbinary3.c macos.c mat4.c mat5.c nist.c paf.c pvf.c raw.c rx2.c sd2.c \ - sds.c svx.c txw.c voc.c wve.c w64.c wav_w64.c wav.c xi.c mpc2k.c rf64.c \ - ogg_vorbis.c ogg_speex.c ogg_pcm.c ogg_opus.c - -CLEANFILES = *~ *.exe G72x/*.exe - -if USE_WIN_VERSION_FILE -WIN_VERSION_FILE = version-metadata.rc -else -WIN_VERSION_FILE = -endif - -#=============================================================================== -# MinGW requires -no-undefined if a DLL is to be built. -libsndfile_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@ @SHLIB_VERSION_ARG@ -libsndfile_la_SOURCES = $(FILESPECIFIC) $(noinst_HEADERS) -nodist_libsndfile_la_SOURCES = $(nodist_include_HEADERS) -libsndfile_la_LIBADD = GSM610/libgsm.la G72x/libg72x.la ALAC/libalac.la \ - libcommon.la @EXTERNAL_LIBS@ -lm - -libcommon_la_SOURCES = $(COMMON) - -#====================================================================== -# Subdir libraries. - -GSM610_libgsm_la_SOURCES = GSM610/config.h GSM610/gsm.h GSM610/gsm610_priv.h \ - GSM610/add.c GSM610/code.c GSM610/decode.c GSM610/gsm_create.c \ - GSM610/gsm_decode.c GSM610/gsm_destroy.c GSM610/gsm_encode.c \ - GSM610/gsm_option.c GSM610/long_term.c GSM610/lpc.c GSM610/preprocess.c \ - GSM610/rpe.c GSM610/short_term.c GSM610/table.c - -G72x_libg72x_la_SOURCES = G72x/g72x.h G72x/g72x_priv.h \ - G72x/g721.c G72x/g723_16.c G72x/g723_24.c G72x/g723_40.c G72x/g72x.c - -ALAC_libalac_la_SOURCES = ALAC/ALACAudioTypes.h ALAC/ALACBitUtilities.h \ - ALAC/EndianPortable.h ALAC/aglib.h ALAC/dplib.h ALAC/matrixlib.h \ - ALAC/alac_codec.h \ - ALAC/ALACBitUtilities.c ALAC/ag_dec.c \ - ALAC/ag_enc.c ALAC/dp_dec.c ALAC/dp_enc.c ALAC/matrix_dec.c \ - ALAC/matrix_enc.c ALAC/alac_decoder.c ALAC/alac_encoder.c - -#=============================================================================== -# Test programs. - -#test_main_SOURCES = test_main.c test_main.h test_conversions.c test_float.c test_endswap.c \ -# test_audio_detect.c test_log_printf.c test_file_io.c test_ima_oki_adpcm.c \ -# test_strncpy_crlf.c test_broadcast_var.c test_cart_var.c -#test_main_LDADD = libcommon.la - -#G72x_g72x_test_SOURCES = G72x/g72x_test.c -#G72x_g72x_test_LDADD = G72x/libg72x.la - -#test_endswap.c: test_endswap.def test_endswap.tpl -# cd $(srcdir) && autogen --writable test_endswap.def && cd $(abs_builddir) - -genfiles : #$(SYMBOL_FILES) - -check : - @if [ -x /usr/bin/python ]; then $(srcdir)/binheader_writef_check.py $(srcdir)/*.c ; fi -# G72x/g72x_test$(EXEEXT) all - ./test_main$(EXEEXT) - -# Need this target to force building of test programs. -checkprograms : $(check_PROGRAMS) - -#====================================================================== -# Generate an OS specific Symbols files. This is done when the author -# builds the distribution tarball. There should be not need for the -# end user to create these files. - -Symbols.gnu-binutils: create_symbols_file.py - python $(srcdir)/create_symbols_file.py linux $(VERSION) > $@ - -Symbols.darwin: create_symbols_file.py - python $(srcdir)/create_symbols_file.py darwin $(VERSION) > $@ - -libsndfile-1.def: create_symbols_file.py - python $(srcdir)/create_symbols_file.py win32 $(VERSION) > $@ - -Symbols.os2: create_symbols_file.py - python $(srcdir)/create_symbols_file.py os2 $(VERSION) > $@ - -Symbols.static: create_symbols_file.py - python $(srcdir)/create_symbols_file.py static $(VERSION) > $@ - -# Fake dependancy to force the creation of these files. -#sndfile.o : $(SYMBOL_FILES) - -#====================================================================== -# Building windows resource files (if needed). - -.rc.lo: - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) $< -o $@ - -#====================================================================== -# Disable autoheader. -AUTOHEADER=echo - - - diff --git a/libs/libsndfile/src/Symbols.darwin b/libs/libsndfile/src/Symbols.darwin deleted file mode 100644 index a671460756..0000000000 --- a/libs/libsndfile/src/Symbols.darwin +++ /dev/null @@ -1,37 +0,0 @@ -# Auto-generated by create_symbols_file.py - -_sf_command -_sf_open -_sf_close -_sf_seek -_sf_error -_sf_perror -_sf_error_str -_sf_error_number -_sf_format_check -_sf_read_raw -_sf_readf_short -_sf_readf_int -_sf_readf_float -_sf_readf_double -_sf_read_short -_sf_read_int -_sf_read_float -_sf_read_double -_sf_write_raw -_sf_writef_short -_sf_writef_int -_sf_writef_float -_sf_writef_double -_sf_write_short -_sf_write_int -_sf_write_float -_sf_write_double -_sf_strerror -_sf_get_string -_sf_set_string -_sf_version_string -_sf_open_fd -_sf_open_virtual -_sf_write_sync - diff --git a/libs/libsndfile/src/Symbols.linux b/libs/libsndfile/src/Symbols.linux deleted file mode 100644 index 163346f700..0000000000 --- a/libs/libsndfile/src/Symbols.linux +++ /dev/null @@ -1,42 +0,0 @@ -# Auto-generated by create_symbols_file.py - -libsndfile.so.1.0 -{ - global: - sf_command ; - sf_open ; - sf_close ; - sf_seek ; - sf_error ; - sf_perror ; - sf_error_str ; - sf_error_number ; - sf_format_check ; - sf_read_raw ; - sf_readf_short ; - sf_readf_int ; - sf_readf_float ; - sf_readf_double ; - sf_read_short ; - sf_read_int ; - sf_read_float ; - sf_read_double ; - sf_write_raw ; - sf_writef_short ; - sf_writef_int ; - sf_writef_float ; - sf_writef_double ; - sf_write_short ; - sf_write_int ; - sf_write_float ; - sf_write_double ; - sf_strerror ; - sf_get_string ; - sf_set_string ; - sf_open_fd ; - sf_open_virtual ; - sf_write_sync ; - local: - * ; -} ; - diff --git a/libs/libsndfile/src/Symbols.os2 b/libs/libsndfile/src/Symbols.os2 deleted file mode 100644 index 118ceba728..0000000000 --- a/libs/libsndfile/src/Symbols.os2 +++ /dev/null @@ -1,43 +0,0 @@ -; Auto-generated by create_symbols_file.py - -LIBRARY sndfile1 -INITINSTANCE TERMINSTANCE -CODE PRELOAD MOVEABLE DISCARDABLE -DATA PRELOAD MOVEABLE MULTIPLE NONSHARED -EXPORTS - -_sf_command @1 -_sf_open @2 -_sf_close @3 -_sf_seek @4 -_sf_error @7 -_sf_perror @8 -_sf_error_str @9 -_sf_error_number @10 -_sf_format_check @11 -_sf_read_raw @16 -_sf_readf_short @17 -_sf_readf_int @18 -_sf_readf_float @19 -_sf_readf_double @20 -_sf_read_short @21 -_sf_read_int @22 -_sf_read_float @23 -_sf_read_double @24 -_sf_write_raw @32 -_sf_writef_short @33 -_sf_writef_int @34 -_sf_writef_float @35 -_sf_writef_double @36 -_sf_write_short @37 -_sf_write_int @38 -_sf_write_float @39 -_sf_write_double @40 -_sf_strerror @50 -_sf_get_string @60 -_sf_set_string @61 -_sf_version_string @68 -_sf_open_fd @70 -_sf_open_virtual @80 -_sf_write_sync @90 - diff --git a/libs/libsndfile/src/aiff.c b/libs/libsndfile/src/aiff.c deleted file mode 100644 index c0175b2f24..0000000000 --- a/libs/libsndfile/src/aiff.c +++ /dev/null @@ -1,1778 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** Copyright (C) 2005 David Viens -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#ifdef HAVE_INTTYPES_H -#include -#endif - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" -#include "chanmap.h" - -/*------------------------------------------------------------------------------ - * Macros to handle big/little endian issues. - */ - -#define FORM_MARKER (MAKE_MARKER ('F', 'O', 'R', 'M')) -#define AIFF_MARKER (MAKE_MARKER ('A', 'I', 'F', 'F')) -#define AIFC_MARKER (MAKE_MARKER ('A', 'I', 'F', 'C')) -#define COMM_MARKER (MAKE_MARKER ('C', 'O', 'M', 'M')) -#define SSND_MARKER (MAKE_MARKER ('S', 'S', 'N', 'D')) -#define MARK_MARKER (MAKE_MARKER ('M', 'A', 'R', 'K')) -#define INST_MARKER (MAKE_MARKER ('I', 'N', 'S', 'T')) -#define APPL_MARKER (MAKE_MARKER ('A', 'P', 'P', 'L')) -#define CHAN_MARKER (MAKE_MARKER ('C', 'H', 'A', 'N')) - -#define c_MARKER (MAKE_MARKER ('(', 'c', ')', ' ')) -#define NAME_MARKER (MAKE_MARKER ('N', 'A', 'M', 'E')) -#define AUTH_MARKER (MAKE_MARKER ('A', 'U', 'T', 'H')) -#define ANNO_MARKER (MAKE_MARKER ('A', 'N', 'N', 'O')) -#define COMT_MARKER (MAKE_MARKER ('C', 'O', 'M', 'T')) -#define FVER_MARKER (MAKE_MARKER ('F', 'V', 'E', 'R')) -#define SFX_MARKER (MAKE_MARKER ('S', 'F', 'X', '!')) - -#define PEAK_MARKER (MAKE_MARKER ('P', 'E', 'A', 'K')) -#define basc_MARKER (MAKE_MARKER ('b', 'a', 's', 'c')) - -/* Supported AIFC encodings.*/ -#define NONE_MARKER (MAKE_MARKER ('N', 'O', 'N', 'E')) -#define sowt_MARKER (MAKE_MARKER ('s', 'o', 'w', 't')) -#define twos_MARKER (MAKE_MARKER ('t', 'w', 'o', 's')) -#define raw_MARKER (MAKE_MARKER ('r', 'a', 'w', ' ')) -#define in24_MARKER (MAKE_MARKER ('i', 'n', '2', '4')) -#define ni24_MARKER (MAKE_MARKER ('4', '2', 'n', '1')) -#define in32_MARKER (MAKE_MARKER ('i', 'n', '3', '2')) -#define ni32_MARKER (MAKE_MARKER ('2', '3', 'n', 'i')) - -#define fl32_MARKER (MAKE_MARKER ('f', 'l', '3', '2')) -#define FL32_MARKER (MAKE_MARKER ('F', 'L', '3', '2')) -#define fl64_MARKER (MAKE_MARKER ('f', 'l', '6', '4')) -#define FL64_MARKER (MAKE_MARKER ('F', 'L', '6', '4')) - -#define ulaw_MARKER (MAKE_MARKER ('u', 'l', 'a', 'w')) -#define ULAW_MARKER (MAKE_MARKER ('U', 'L', 'A', 'W')) -#define alaw_MARKER (MAKE_MARKER ('a', 'l', 'a', 'w')) -#define ALAW_MARKER (MAKE_MARKER ('A', 'L', 'A', 'W')) - -#define DWVW_MARKER (MAKE_MARKER ('D', 'W', 'V', 'W')) -#define GSM_MARKER (MAKE_MARKER ('G', 'S', 'M', ' ')) -#define ima4_MARKER (MAKE_MARKER ('i', 'm', 'a', '4')) - -/* -** This value is officially assigned to Mega Nerd Pty Ltd by Apple -** Corportation as the Application marker for libsndfile. -** -** See : http://developer.apple.com/faq/datatype.html -*/ -#define m3ga_MARKER (MAKE_MARKER ('m', '3', 'g', 'a')) - -/* Unsupported AIFC encodings.*/ - -#define MAC3_MARKER (MAKE_MARKER ('M', 'A', 'C', '3')) -#define MAC6_MARKER (MAKE_MARKER ('M', 'A', 'C', '6')) -#define ADP4_MARKER (MAKE_MARKER ('A', 'D', 'P', '4')) - -/* Predfined chunk sizes. */ -#define SIZEOF_AIFF_COMM 18 -#define SIZEOF_AIFC_COMM_MIN 22 -#define SIZEOF_AIFC_COMM 24 -#define SIZEOF_SSND_CHUNK 8 -#define SIZEOF_INST_CHUNK 20 - -/* Is it constant? */ - -/* AIFC/IMA4 defines. */ -#define AIFC_IMA4_BLOCK_LEN 34 -#define AIFC_IMA4_SAMPLES_PER_BLOCK 64 - -#define AIFF_PEAK_CHUNK_SIZE(ch) (2 * sizeof (int) + ch * (sizeof (float) + sizeof (int))) - -/*------------------------------------------------------------------------------ - * Typedefs for file chunks. - */ - -enum -{ HAVE_FORM = 0x01, - HAVE_AIFF = 0x02, - HAVE_AIFC = 0x04, - HAVE_FVER = 0x08, - HAVE_COMM = 0x10, - HAVE_SSND = 0x20 -} ; - -typedef struct -{ unsigned int size ; - short numChannels ; - unsigned int numSampleFrames ; - short sampleSize ; - unsigned char sampleRate [10] ; - unsigned int encoding ; - char zero_bytes [2] ; -} COMM_CHUNK ; - -typedef struct -{ unsigned int offset ; - unsigned int blocksize ; -} SSND_CHUNK ; - -typedef struct -{ short playMode ; - unsigned short beginLoop ; - unsigned short endLoop ; -} INST_LOOP ; - -typedef struct -{ char baseNote ; /* all notes are MIDI note numbers */ - char detune ; /* cents off, only -50 to +50 are significant */ - char lowNote ; - char highNote ; - char lowVelocity ; /* 1 to 127 */ - char highVelocity ; /* 1 to 127 */ - short gain ; /* in dB, 0 is normal */ - INST_LOOP sustain_loop ; - INST_LOOP release_loop ; -} INST_CHUNK ; - - -enum -{ basc_SCALE_MINOR = 1, - basc_SCALE_MAJOR, - basc_SCALE_NEITHER, - basc_SCALE_BOTH -} ; - -enum -{ basc_TYPE_LOOP = 0, - basc_TYPE_ONE_SHOT -} ; - - -typedef struct -{ unsigned int version ; - unsigned int numBeats ; - unsigned short rootNote ; - unsigned short scaleType ; - unsigned short sigNumerator ; - unsigned short sigDenominator ; - unsigned short loopType ; -} basc_CHUNK ; - -typedef struct -{ unsigned short markerID ; - unsigned int position ; -} MARK_ID_POS ; - -typedef struct -{ sf_count_t comm_offset ; - sf_count_t ssnd_offset ; - - int chanmap_tag ; - - MARK_ID_POS *markstr ; -} AIFF_PRIVATE ; - -/*------------------------------------------------------------------------------ - * Private static functions. - */ - -static int aiff_close (SF_PRIVATE *psf) ; - -static int tenbytefloat2int (unsigned char *bytes) ; -static void uint2tenbytefloat (unsigned int num, unsigned char *bytes) ; - -static int aiff_read_comm_chunk (SF_PRIVATE *psf, COMM_CHUNK *comm_fmt) ; - -static int aiff_read_header (SF_PRIVATE *psf, COMM_CHUNK *comm_fmt) ; - -static int aiff_write_header (SF_PRIVATE *psf, int calc_length) ; -static int aiff_write_tailer (SF_PRIVATE *psf) ; -static void aiff_write_strings (SF_PRIVATE *psf, int location) ; - -static int aiff_command (SF_PRIVATE *psf, int command, void *data, int datasize) ; - -static const char *get_loop_mode_str (short mode) ; - -static short get_loop_mode (short mode) ; - -static int aiff_read_basc_chunk (SF_PRIVATE * psf, int) ; - -static int aiff_read_chanmap (SF_PRIVATE * psf, unsigned dword) ; - -static unsigned int marker_to_position (const MARK_ID_POS *m, unsigned short n, int marksize) ; - -static int aiff_set_chunk (SF_PRIVATE *psf, const SF_CHUNK_INFO * chunk_info) ; -static SF_CHUNK_ITERATOR * aiff_next_chunk_iterator (SF_PRIVATE *psf, SF_CHUNK_ITERATOR * iterator) ; -static int aiff_get_chunk_size (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) ; -static int aiff_get_chunk_data (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -aiff_open (SF_PRIVATE *psf) -{ COMM_CHUNK comm_fmt ; - int error, subformat ; - - memset (&comm_fmt, 0, sizeof (comm_fmt)) ; - - subformat = SF_CODEC (psf->sf.format) ; - - if ((psf->container_data = calloc (1, sizeof (AIFF_PRIVATE))) == NULL) - return SFE_MALLOC_FAILED ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = aiff_read_header (psf, &comm_fmt))) - return error ; - - psf->next_chunk_iterator = aiff_next_chunk_iterator ; - psf->get_chunk_size = aiff_get_chunk_size ; - psf->get_chunk_data = aiff_get_chunk_data ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (psf->is_pipe) - return SFE_NO_PIPE_WRITE ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_AIFF) - return SFE_BAD_OPEN_FORMAT ; - - if (psf->file.mode == SFM_WRITE && (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE)) - { if ((psf->peak_info = peak_info_calloc (psf->sf.channels)) == NULL) - return SFE_MALLOC_FAILED ; - psf->peak_info->peak_loc = SF_PEAK_START ; - } ; - - if (psf->file.mode != SFM_RDWR || psf->filelength < 40) - { psf->filelength = 0 ; - psf->datalength = 0 ; - psf->dataoffset = 0 ; - psf->sf.frames = 0 ; - } ; - - psf->strings.flags = SF_STR_ALLOW_START | SF_STR_ALLOW_END ; - - if ((error = aiff_write_header (psf, SF_FALSE))) - return error ; - - psf->write_header = aiff_write_header ; - psf->set_chunk = aiff_set_chunk ; - } ; - - psf->container_close = aiff_close ; - psf->command = aiff_command ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_U8 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_PCM_S8 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_ULAW : - error = ulaw_init (psf) ; - break ; - - case SF_FORMAT_ALAW : - error = alaw_init (psf) ; - break ; - - /* Lite remove start */ - case SF_FORMAT_FLOAT : - error = float32_init (psf) ; - break ; - - case SF_FORMAT_DOUBLE : - error = double64_init (psf) ; - break ; - - case SF_FORMAT_DWVW_12 : - error = dwvw_init (psf, 12) ; - break ; - - case SF_FORMAT_DWVW_16 : - error = dwvw_init (psf, 16) ; - break ; - - case SF_FORMAT_DWVW_24 : - error = dwvw_init (psf, 24) ; - break ; - - case SF_FORMAT_DWVW_N : - if (psf->file.mode != SFM_READ) - { error = SFE_DWVW_BAD_BITWIDTH ; - break ; - } ; - if (comm_fmt.sampleSize >= 8 && comm_fmt.sampleSize < 24) - { error = dwvw_init (psf, comm_fmt.sampleSize) ; - psf->sf.frames = comm_fmt.numSampleFrames ; - break ; - } ; - psf_log_printf (psf, "AIFC/DWVW : Bad bitwidth %d\n", comm_fmt.sampleSize) ; - error = SFE_DWVW_BAD_BITWIDTH ; - break ; - - case SF_FORMAT_IMA_ADPCM : - /* - ** IMA ADPCM encoded AIFF files always have a block length - ** of 34 which decodes to 64 samples. - */ - error = aiff_ima_init (psf, AIFC_IMA4_BLOCK_LEN, AIFC_IMA4_SAMPLES_PER_BLOCK) ; - break ; - /* Lite remove end */ - - case SF_FORMAT_GSM610 : - error = gsm610_init (psf) ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - - return error ; -} /* aiff_open */ - -/*========================================================================================== -** Private functions. -*/ - -/* This function ought to check size */ -static unsigned int -marker_to_position (const MARK_ID_POS *m, unsigned short n, int marksize) -{ int i ; - - for (i = 0 ; i < marksize ; i++) - if (m [i].markerID == n) - return m [i].position ; - return 0 ; -} /* marker_to_position */ - -static int -aiff_read_header (SF_PRIVATE *psf, COMM_CHUNK *comm_fmt) -{ SSND_CHUNK ssnd_fmt ; - AIFF_PRIVATE *paiff ; - BUF_UNION ubuf ; - unsigned chunk_size = 0, FORMsize, SSNDsize, bytesread ; - int k, found_chunk = 0, done = 0, error = 0 ; - char *cptr ; - int instr_found = 0, mark_found = 0, mark_count = 0 ; - - if (psf->filelength > SF_PLATFORM_S64 (0xffffffff)) - psf_log_printf (psf, "Warning : filelength > 0xffffffff. This is bad!!!!\n") ; - - if ((paiff = psf->container_data) == NULL) - return SFE_INTERNAL ; - - paiff->comm_offset = 0 ; - paiff->ssnd_offset = 0 ; - - /* Set position to start of file to begin reading header. */ - psf_binheader_readf (psf, "p", 0) ; - - memset (comm_fmt, 0, sizeof (COMM_CHUNK)) ; - - /* Until recently AIF* file were all BIG endian. */ - psf->endian = SF_ENDIAN_BIG ; - - /* AIFF files can apparently have their chunks in any order. However, they - ** must have a FORM chunk. Approach here is to read all the chunks one by - ** one and then check for the mandatory chunks at the end. - */ - while (! done) - { unsigned marker ; - size_t jump = chunk_size & 1 ; - - marker = chunk_size = 0 ; - psf_binheader_readf (psf, "Ejm4", jump, &marker, &chunk_size) ; - if (marker == 0) - { psf_log_printf (psf, "Have 0 marker.\n") ; - break ; - } ; - - if (psf->file.mode == SFM_RDWR && (found_chunk & HAVE_SSND)) - return SFE_AIFF_RW_SSND_NOT_LAST ; - - psf_store_read_chunk_u32 (&psf->rchunks, marker, psf_ftell (psf), chunk_size) ; - - switch (marker) - { case FORM_MARKER : - if (found_chunk) - return SFE_AIFF_NO_FORM ; - - FORMsize = chunk_size ; - - found_chunk |= HAVE_FORM ; - psf_binheader_readf (psf, "m", &marker) ; - switch (marker) - { case AIFC_MARKER : - case AIFF_MARKER : - found_chunk |= (marker == AIFC_MARKER) ? (HAVE_AIFC | HAVE_AIFF) : HAVE_AIFF ; - break ; - default : - break ; - } ; - - if (psf->fileoffset > 0 && psf->filelength > FORMsize + 8) - { /* Set file length. */ - psf->filelength = FORMsize + 8 ; - psf_log_printf (psf, "FORM : %u\n %M\n", FORMsize, marker) ; - } - else if (FORMsize != psf->filelength - 2 * SIGNED_SIZEOF (chunk_size)) - { chunk_size = psf->filelength - 2 * sizeof (chunk_size) ; - psf_log_printf (psf, "FORM : %u (should be %u)\n %M\n", FORMsize, chunk_size, marker) ; - FORMsize = chunk_size ; - } - else - psf_log_printf (psf, "FORM : %u\n %M\n", FORMsize, marker) ; - /* Set this to 0, so we don't jump a byte when parsing the next marker. */ - chunk_size = 0 ; - break ; - - - case COMM_MARKER : - paiff->comm_offset = psf_ftell (psf) - 8 ; - chunk_size += chunk_size & 1 ; - comm_fmt->size = chunk_size ; - if ((error = aiff_read_comm_chunk (psf, comm_fmt)) != 0) - return error ; - - found_chunk |= HAVE_COMM ; - break ; - - case PEAK_MARKER : - /* Must have COMM chunk before PEAK chunk. */ - if ((found_chunk & (HAVE_FORM | HAVE_AIFF | HAVE_COMM)) != (HAVE_FORM | HAVE_AIFF | HAVE_COMM)) - return SFE_AIFF_PEAK_B4_COMM ; - - psf_log_printf (psf, "%M : %d\n", marker, chunk_size) ; - if (chunk_size != AIFF_PEAK_CHUNK_SIZE (psf->sf.channels)) - { psf_binheader_readf (psf, "j", chunk_size) ; - psf_log_printf (psf, "*** File PEAK chunk too big.\n") ; - return SFE_WAV_BAD_PEAK ; - } ; - - if ((psf->peak_info = peak_info_calloc (psf->sf.channels)) == NULL) - return SFE_MALLOC_FAILED ; - - /* read in rest of PEAK chunk. */ - psf_binheader_readf (psf, "E44", &(psf->peak_info->version), &(psf->peak_info->timestamp)) ; - - if (psf->peak_info->version != 1) - psf_log_printf (psf, " version : %d *** (should be version 1)\n", psf->peak_info->version) ; - else - psf_log_printf (psf, " version : %d\n", psf->peak_info->version) ; - - psf_log_printf (psf, " time stamp : %d\n", psf->peak_info->timestamp) ; - psf_log_printf (psf, " Ch Position Value\n") ; - - cptr = ubuf.cbuf ; - for (k = 0 ; k < psf->sf.channels ; k++) - { float value ; - unsigned int position ; - - psf_binheader_readf (psf, "Ef4", &value, &position) ; - psf->peak_info->peaks [k].value = value ; - psf->peak_info->peaks [k].position = position ; - - snprintf (cptr, sizeof (ubuf.scbuf), " %2d %-12" PRId64 " %g\n", - k, psf->peak_info->peaks [k].position, psf->peak_info->peaks [k].value) ; - cptr [sizeof (ubuf.scbuf) - 1] = 0 ; - psf_log_printf (psf, "%s", cptr) ; - } ; - - psf->peak_info->peak_loc = ((found_chunk & HAVE_SSND) == 0) ? SF_PEAK_START : SF_PEAK_END ; - break ; - - case SSND_MARKER : - if ((found_chunk & HAVE_AIFC) && (found_chunk & HAVE_FVER) == 0) - psf_log_printf (psf, "*** Valid AIFC files should have an FVER chunk.\n") ; - - paiff->ssnd_offset = psf_ftell (psf) - 8 ; - SSNDsize = chunk_size ; - psf_binheader_readf (psf, "E44", &(ssnd_fmt.offset), &(ssnd_fmt.blocksize)) ; - - psf->datalength = SSNDsize - sizeof (ssnd_fmt) ; - psf->dataoffset = psf_ftell (psf) ; - - if (psf->datalength > psf->filelength - psf->dataoffset || psf->datalength < 0) - { psf_log_printf (psf, " SSND : %u (should be %D)\n", SSNDsize, psf->filelength - psf->dataoffset + sizeof (SSND_CHUNK)) ; - psf->datalength = psf->filelength - psf->dataoffset ; - } - else - psf_log_printf (psf, " SSND : %u\n", SSNDsize) ; - - if (ssnd_fmt.offset == 0 || psf->dataoffset + ssnd_fmt.offset == ssnd_fmt.blocksize) - { psf_log_printf (psf, " Offset : %u\n", ssnd_fmt.offset) ; - psf_log_printf (psf, " Block Size : %u\n", ssnd_fmt.blocksize) ; - - psf->dataoffset += ssnd_fmt.offset ; - psf->datalength -= ssnd_fmt.offset ; - } - else - { psf_log_printf (psf, " Offset : %u\n", ssnd_fmt.offset) ; - psf_log_printf (psf, " Block Size : %u ???\n", ssnd_fmt.blocksize) ; - psf->dataoffset += ssnd_fmt.offset ; - psf->datalength -= ssnd_fmt.offset ; - } ; - - /* Only set dataend if there really is data at the end. */ - if (psf->datalength + psf->dataoffset < psf->filelength) - psf->dataend = psf->datalength + psf->dataoffset ; - - found_chunk |= HAVE_SSND ; - - if (! psf->sf.seekable) - break ; - - /* Seek to end of SSND chunk. */ - psf_fseek (psf, psf->dataoffset + psf->datalength, SEEK_SET) ; - break ; - - case c_MARKER : - if (chunk_size == 0) - break ; - if (chunk_size >= SIGNED_SIZEOF (ubuf.scbuf)) - { psf_log_printf (psf, " %M : %d (too big)\n", marker, chunk_size) ; - return SFE_INTERNAL ; - } ; - - cptr = ubuf.cbuf ; - psf_binheader_readf (psf, "b", cptr, chunk_size + (chunk_size & 1)) ; - cptr [chunk_size] = 0 ; - - psf_sanitize_string (cptr, chunk_size) ; - - psf_log_printf (psf, " %M : %s\n", marker, cptr) ; - psf_store_string (psf, SF_STR_COPYRIGHT, cptr) ; - chunk_size += chunk_size & 1 ; - break ; - - case AUTH_MARKER : - if (chunk_size == 0) - break ; - if (chunk_size >= SIGNED_SIZEOF (ubuf.scbuf) - 1) - { psf_log_printf (psf, " %M : %d (too big)\n", marker, chunk_size) ; - return SFE_INTERNAL ; - } ; - - cptr = ubuf.cbuf ; - psf_binheader_readf (psf, "b", cptr, chunk_size + (chunk_size & 1)) ; - cptr [chunk_size] = 0 ; - psf_log_printf (psf, " %M : %s\n", marker, cptr) ; - psf_store_string (psf, SF_STR_ARTIST, cptr) ; - chunk_size += chunk_size & 1 ; - break ; - - case COMT_MARKER : - { unsigned short count, id, len ; - unsigned int timestamp, bytes ; - - if (chunk_size == 0) - break ; - bytes = chunk_size ; - bytes -= psf_binheader_readf (psf, "E2", &count) ; - psf_log_printf (psf, " %M : %d\n count : %d\n", marker, chunk_size, count) ; - - for (k = 0 ; k < count ; k++) - { bytes -= psf_binheader_readf (psf, "E422", ×tamp, &id, &len) ; - psf_log_printf (psf, " time : 0x%x\n marker : %x\n length : %d\n", timestamp, id, len) ; - - if (len + 1 > SIGNED_SIZEOF (ubuf.scbuf)) - { psf_log_printf (psf, "\nError : string length (%d) too big.\n", len) ; - return SFE_INTERNAL ; - } ; - - cptr = ubuf.cbuf ; - bytes -= psf_binheader_readf (psf, "b", cptr, len) ; - cptr [len] = 0 ; - psf_log_printf (psf, " string : %s\n", cptr) ; - } ; - - if (bytes > 0) - psf_binheader_readf (psf, "j", bytes) ; - } ; - break ; - - case APPL_MARKER : - { unsigned appl_marker ; - - if (chunk_size == 0) - break ; - if (chunk_size >= SIGNED_SIZEOF (ubuf.scbuf) - 1) - { psf_log_printf (psf, " %M : %d (too big, skipping)\n", marker, chunk_size) ; - psf_binheader_readf (psf, "j", chunk_size + (chunk_size & 1)) ; - break ; - } ; - - if (chunk_size < 4) - { psf_log_printf (psf, " %M : %d (too small, skipping)\n", marker, chunk_size) ; - psf_binheader_readf (psf, "j", chunk_size + (chunk_size & 1)) ; - break ; - } ; - - cptr = ubuf.cbuf ; - psf_binheader_readf (psf, "mb", &appl_marker, cptr, chunk_size + (chunk_size & 1) - 4) ; - cptr [chunk_size] = 0 ; - - for (k = 0 ; k < (int) chunk_size ; k++) - if (! psf_isprint (cptr [k])) - { cptr [k] = 0 ; - break ; - } ; - - psf_log_printf (psf, " %M : %d\n AppSig : %M\n Name : %s\n", marker, chunk_size, appl_marker, cptr) ; - psf_store_string (psf, SF_STR_SOFTWARE, cptr) ; - chunk_size += chunk_size & 1 ; - } ; - break ; - - case NAME_MARKER : - if (chunk_size == 0) - break ; - if (chunk_size >= SIGNED_SIZEOF (ubuf.scbuf) - 2) - { psf_log_printf (psf, " %M : %d (too big)\n", marker, chunk_size) ; - return SFE_INTERNAL ; - } ; - - cptr = ubuf.cbuf ; - psf_binheader_readf (psf, "b", cptr, chunk_size + (chunk_size & 1)) ; - cptr [chunk_size] = 0 ; - psf_log_printf (psf, " %M : %s\n", marker, cptr) ; - psf_store_string (psf, SF_STR_TITLE, cptr) ; - chunk_size += chunk_size & 1 ; - break ; - - case ANNO_MARKER : - if (chunk_size == 0) - break ; - if (chunk_size >= SIGNED_SIZEOF (ubuf.scbuf) - 2) - { psf_log_printf (psf, " %M : %d (too big)\n", marker, chunk_size) ; - return SFE_INTERNAL ; - } ; - - cptr = ubuf.cbuf ; - psf_binheader_readf (psf, "b", cptr, chunk_size + (chunk_size & 1)) ; - cptr [chunk_size] = 0 ; - psf_log_printf (psf, " %M : %s\n", marker, cptr) ; - psf_store_string (psf, SF_STR_COMMENT, cptr) ; - chunk_size += chunk_size & 1 ; - break ; - - case INST_MARKER : - if (chunk_size != SIZEOF_INST_CHUNK) - { psf_log_printf (psf, " %M : %d (should be %d)\n", marker, chunk_size, SIZEOF_INST_CHUNK) ; - psf_binheader_readf (psf, "j", chunk_size) ; - break ; - } ; - psf_log_printf (psf, " %M : %d\n", marker, chunk_size) ; - { unsigned char bytes [6] ; - short gain ; - - if (psf->instrument == NULL && (psf->instrument = psf_instrument_alloc ()) == NULL) - return SFE_MALLOC_FAILED ; - - psf_binheader_readf (psf, "b", bytes, 6) ; - psf_log_printf (psf, " Base Note : %u\n Detune : %u\n" - " Low Note : %u\n High Note : %u\n" - " Low Vel. : %u\n High Vel. : %u\n", - bytes [0], bytes [1], bytes [2], bytes [3], bytes [4], bytes [5]) ; - psf->instrument->basenote = bytes [0] ; - psf->instrument->detune = bytes [1] ; - psf->instrument->key_lo = bytes [2] ; - psf->instrument->key_hi = bytes [3] ; - psf->instrument->velocity_lo = bytes [4] ; - psf->instrument->velocity_hi = bytes [5] ; - psf_binheader_readf (psf, "E2", &gain) ; - psf->instrument->gain = gain ; - psf_log_printf (psf, " Gain (dB) : %d\n", gain) ; - } ; - { short mode ; /* 0 - no loop, 1 - forward looping, 2 - backward looping */ - const char *loop_mode ; - unsigned short begin, end ; - - psf_binheader_readf (psf, "E222", &mode, &begin, &end) ; - loop_mode = get_loop_mode_str (mode) ; - mode = get_loop_mode (mode) ; - if (mode == SF_LOOP_NONE) - { psf->instrument->loop_count = 0 ; - psf->instrument->loops [0].mode = SF_LOOP_NONE ; - } - else - { psf->instrument->loop_count = 1 ; - psf->instrument->loops [0].mode = SF_LOOP_FORWARD ; - psf->instrument->loops [0].start = begin ; - psf->instrument->loops [0].end = end ; - psf->instrument->loops [0].count = 0 ; - } ; - psf_log_printf (psf, " Sustain\n mode : %d => %s\n begin : %u\n end : %u\n", - mode, loop_mode, begin, end) ; - psf_binheader_readf (psf, "E222", &mode, &begin, &end) ; - loop_mode = get_loop_mode_str (mode) ; - mode = get_loop_mode (mode) ; - if (mode == SF_LOOP_NONE) - psf->instrument->loops [1].mode = SF_LOOP_NONE ; - else - { psf->instrument->loop_count += 1 ; - psf->instrument->loops [1].mode = SF_LOOP_FORWARD ; - psf->instrument->loops [1].start = begin ; - psf->instrument->loops [1].end = end ; - psf->instrument->loops [1].count = 0 ; - } ; - psf_log_printf (psf, " Release\n mode : %d => %s\n begin : %u\n end : %u\n", - mode, loop_mode, begin, end) ; - } ; - instr_found++ ; - break ; - - case basc_MARKER : - psf_log_printf (psf, " basc : %u\n", chunk_size) ; - - if ((error = aiff_read_basc_chunk (psf, chunk_size))) - return error ; - break ; - - case MARK_MARKER : - psf_log_printf (psf, " %M : %d\n", marker, chunk_size) ; - { unsigned short mark_id, n = 0 ; - unsigned int position ; - - bytesread = psf_binheader_readf (psf, "E2", &n) ; - mark_count = n ; - psf_log_printf (psf, " Count : %d\n", mark_count) ; - if (paiff->markstr != NULL) - { psf_log_printf (psf, "*** Second MARK chunk found. Throwing away the first.\n") ; - free (paiff->markstr) ; - } ; - paiff->markstr = calloc (mark_count, sizeof (MARK_ID_POS)) ; - if (paiff->markstr == NULL) - return SFE_MALLOC_FAILED ; - - for (n = 0 ; n < mark_count && bytesread < chunk_size ; n++) - { unsigned int pstr_len ; - unsigned char ch ; - - bytesread += psf_binheader_readf (psf, "E241", &mark_id, &position, &ch) ; - psf_log_printf (psf, " Mark ID : %u\n Position : %u\n", mark_id, position) ; - - pstr_len = (ch & 1) ? ch : ch + 1 ; - - if (pstr_len < sizeof (ubuf.scbuf) - 1) - { bytesread += psf_binheader_readf (psf, "b", ubuf.scbuf, pstr_len) ; - ubuf.scbuf [pstr_len] = 0 ; - } - else - { unsigned int read_len = pstr_len - (sizeof (ubuf.scbuf) - 1) ; - bytesread += psf_binheader_readf (psf, "bj", ubuf.scbuf, read_len, pstr_len - read_len) ; - ubuf.scbuf [sizeof (ubuf.scbuf) - 1] = 0 ; - } - - psf_log_printf (psf, " Name : %s\n", ubuf.scbuf) ; - - paiff->markstr [n].markerID = mark_id ; - paiff->markstr [n].position = position ; - /* - ** TODO if ubuf.scbuf is equal to - ** either Beg_loop, Beg loop or beg loop and spam - ** if (psf->instrument == NULL && (psf->instrument = psf_instrument_alloc ()) == NULL) - ** return SFE_MALLOC_FAILED ; - */ - } ; - } ; - mark_found++ ; - psf_binheader_readf (psf, "j", chunk_size - bytesread) ; - break ; - - case FVER_MARKER : - found_chunk |= HAVE_FVER ; - /* Fall through to next case. */ - - case SFX_MARKER : - psf_log_printf (psf, " %M : %d\n", marker, chunk_size) ; - psf_binheader_readf (psf, "j", chunk_size) ; - break ; - - case NONE_MARKER : - /* Fix for broken AIFC files with incorrect COMM chunk length. */ - chunk_size = (chunk_size >> 24) - 3 ; - psf_log_printf (psf, " %M : %d\n", marker, chunk_size) ; - psf_binheader_readf (psf, "j", make_size_t (chunk_size)) ; - break ; - - case CHAN_MARKER : - if (chunk_size < 12) - { psf_log_printf (psf, " %M : %d (should be >= 12)\n", marker, chunk_size) ; - psf_binheader_readf (psf, "j", chunk_size) ; - break ; - } - - psf_log_printf (psf, " %M : %d\n", marker, chunk_size) ; - - if ((error = aiff_read_chanmap (psf, chunk_size))) - return error ; - break ; - - default : - if (psf_isprint ((marker >> 24) & 0xFF) && psf_isprint ((marker >> 16) & 0xFF) - && psf_isprint ((marker >> 8) & 0xFF) && psf_isprint (marker & 0xFF)) - { psf_log_printf (psf, " %M : %d (unknown marker)\n", marker, chunk_size) ; - - psf_binheader_readf (psf, "j", chunk_size) ; - break ; - } ; - if ((chunk_size = psf_ftell (psf)) & 0x03) - { psf_log_printf (psf, " Unknown chunk marker %X at position %d. Resyncing.\n", marker, chunk_size - 4) ; - - psf_binheader_readf (psf, "j", -3) ; - break ; - } ; - psf_log_printf (psf, "*** Unknown chunk marker %X at position %D. Exiting parser.\n", marker, psf_ftell (psf)) ; - done = 1 ; - break ; - } ; /* switch (marker) */ - - if ((! psf->sf.seekable) && (found_chunk & HAVE_SSND)) - break ; - - if (psf_ftell (psf) >= psf->filelength - (2 * SIGNED_SIZEOF (int32_t))) - break ; - } ; /* while (1) */ - - if (instr_found && mark_found) - { int j ; - - for (j = 0 ; j < psf->instrument->loop_count ; j ++) - { if (j < ARRAY_LEN (psf->instrument->loops)) - { psf->instrument->loops [j].start = marker_to_position (paiff->markstr, psf->instrument->loops [j].start, mark_count) ; - psf->instrument->loops [j].end = marker_to_position (paiff->markstr, psf->instrument->loops [j].end, mark_count) ; - psf->instrument->loops [j].mode = SF_LOOP_FORWARD ; - } ; - } ; - } ; - - if (! (found_chunk & HAVE_FORM)) - return SFE_AIFF_NO_FORM ; - - if (! (found_chunk & HAVE_AIFF)) - return SFE_AIFF_COMM_NO_FORM ; - - if (! (found_chunk & HAVE_COMM)) - return SFE_AIFF_SSND_NO_COMM ; - - if (! psf->dataoffset) - return SFE_AIFF_NO_DATA ; - - return 0 ; -} /* aiff_read_header */ - -static int -aiff_close (SF_PRIVATE *psf) -{ AIFF_PRIVATE *paiff = psf->container_data ; - - if (paiff != NULL && paiff->markstr != NULL) - { free (paiff->markstr) ; - paiff->markstr = NULL ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { aiff_write_tailer (psf) ; - aiff_write_header (psf, SF_TRUE) ; - } ; - - return 0 ; -} /* aiff_close */ - -static int -aiff_read_comm_chunk (SF_PRIVATE *psf, COMM_CHUNK *comm_fmt) -{ BUF_UNION ubuf ; - int subformat, samplerate ; - - ubuf.scbuf [0] = 0 ; - - /* The COMM chunk has an int aligned to an odd word boundary. Some - ** procesors are not able to deal with this (ie bus fault) so we have - ** to take special care. - */ - - psf_binheader_readf (psf, "E242b", &(comm_fmt->numChannels), &(comm_fmt->numSampleFrames), - &(comm_fmt->sampleSize), &(comm_fmt->sampleRate), SIGNED_SIZEOF (comm_fmt->sampleRate)) ; - - if (comm_fmt->size > 0x10000 && (comm_fmt->size & 0xffff) == 0) - { psf_log_printf (psf, " COMM : %d (0x%x) *** should be ", comm_fmt->size, comm_fmt->size) ; - comm_fmt->size = ENDSWAP_32 (comm_fmt->size) ; - psf_log_printf (psf, "%d (0x%x)\n", comm_fmt->size, comm_fmt->size) ; - } - else - psf_log_printf (psf, " COMM : %d\n", comm_fmt->size) ; - - if (comm_fmt->size == SIZEOF_AIFF_COMM) - comm_fmt->encoding = NONE_MARKER ; - else if (comm_fmt->size == SIZEOF_AIFC_COMM_MIN) - psf_binheader_readf (psf, "Em", &(comm_fmt->encoding)) ; - else if (comm_fmt->size >= SIZEOF_AIFC_COMM) - { unsigned char encoding_len ; - unsigned read_len ; - - psf_binheader_readf (psf, "Em1", &(comm_fmt->encoding), &encoding_len) ; - - comm_fmt->size = SF_MIN (sizeof (ubuf.scbuf), make_size_t (comm_fmt->size)) ; - memset (ubuf.scbuf, 0, comm_fmt->size) ; - read_len = comm_fmt->size - SIZEOF_AIFC_COMM + 1 ; - psf_binheader_readf (psf, "b", ubuf.scbuf, read_len) ; - ubuf.scbuf [read_len + 1] = 0 ; - } ; - - samplerate = tenbytefloat2int (comm_fmt->sampleRate) ; - - psf_log_printf (psf, " Sample Rate : %d\n", samplerate) ; - psf_log_printf (psf, " Frames : %u%s\n", comm_fmt->numSampleFrames, (comm_fmt->numSampleFrames == 0 && psf->filelength > 104) ? " (Should not be 0)" : "") ; - psf_log_printf (psf, " Channels : %d\n", comm_fmt->numChannels) ; - - /* Found some broken 'fl32' files with comm.samplesize == 16. Fix it here. */ - if ((comm_fmt->encoding == fl32_MARKER || comm_fmt->encoding == FL32_MARKER) && comm_fmt->sampleSize != 32) - { psf_log_printf (psf, " Sample Size : %d (should be 32)\n", comm_fmt->sampleSize) ; - comm_fmt->sampleSize = 32 ; - } - else if ((comm_fmt->encoding == fl64_MARKER || comm_fmt->encoding == FL64_MARKER) && comm_fmt->sampleSize != 64) - { psf_log_printf (psf, " Sample Size : %d (should be 64)\n", comm_fmt->sampleSize) ; - comm_fmt->sampleSize = 64 ; - } - else - psf_log_printf (psf, " Sample Size : %d\n", comm_fmt->sampleSize) ; - - subformat = s_bitwidth_to_subformat (comm_fmt->sampleSize) ; - - psf->sf.samplerate = samplerate ; - psf->sf.frames = comm_fmt->numSampleFrames ; - psf->sf.channels = comm_fmt->numChannels ; - psf->bytewidth = BITWIDTH2BYTES (comm_fmt->sampleSize) ; - - psf->endian = SF_ENDIAN_BIG ; - - switch (comm_fmt->encoding) - { case NONE_MARKER : - psf->sf.format = (SF_FORMAT_AIFF | subformat) ; - break ; - - case twos_MARKER : - case in24_MARKER : - case in32_MARKER : - psf->sf.format = (SF_ENDIAN_BIG | SF_FORMAT_AIFF | subformat) ; - break ; - - case sowt_MARKER : - case ni24_MARKER : - case ni32_MARKER : - psf->endian = SF_ENDIAN_LITTLE ; - psf->sf.format = (SF_ENDIAN_LITTLE | SF_FORMAT_AIFF | subformat) ; - break ; - - case fl32_MARKER : - case FL32_MARKER : - psf->sf.format = (SF_FORMAT_AIFF | SF_FORMAT_FLOAT) ; - break ; - - case ulaw_MARKER : - case ULAW_MARKER : - psf->sf.format = (SF_FORMAT_AIFF | SF_FORMAT_ULAW) ; - break ; - - case alaw_MARKER : - case ALAW_MARKER : - psf->sf.format = (SF_FORMAT_AIFF | SF_FORMAT_ALAW) ; - break ; - - case fl64_MARKER : - case FL64_MARKER : - psf->sf.format = (SF_FORMAT_AIFF | SF_FORMAT_DOUBLE) ; - break ; - - case raw_MARKER : - psf->sf.format = (SF_FORMAT_AIFF | SF_FORMAT_PCM_U8) ; - break ; - - case DWVW_MARKER : - psf->sf.format = SF_FORMAT_AIFF ; - switch (comm_fmt->sampleSize) - { case 12 : - psf->sf.format |= SF_FORMAT_DWVW_12 ; - break ; - case 16 : - psf->sf.format |= SF_FORMAT_DWVW_16 ; - break ; - case 24 : - psf->sf.format |= SF_FORMAT_DWVW_24 ; - break ; - - default : - psf->sf.format |= SF_FORMAT_DWVW_N ; - break ; - } ; - break ; - - case GSM_MARKER : - psf->sf.format = SF_FORMAT_AIFF ; - psf->sf.format = (SF_FORMAT_AIFF | SF_FORMAT_GSM610) ; - break ; - - - case ima4_MARKER : - psf->endian = SF_ENDIAN_BIG ; - psf->sf.format = (SF_FORMAT_AIFF | SF_FORMAT_IMA_ADPCM) ; - break ; - - default : - psf_log_printf (psf, "AIFC : Unimplemented format : %M\n", comm_fmt->encoding) ; - return SFE_UNIMPLEMENTED ; - } ; - - if (! ubuf.scbuf [0]) - psf_log_printf (psf, " Encoding : %M\n", comm_fmt->encoding) ; - else - psf_log_printf (psf, " Encoding : %M => %s\n", comm_fmt->encoding, ubuf.scbuf) ; - - return 0 ; -} /* aiff_read_comm_chunk */ - - -/*========================================================================================== -*/ - -static void -aiff_rewrite_header (SF_PRIVATE *psf) -{ - /* Assuming here that the header has already been written and just - ** needs to be corrected for new data length. That means that we - ** only change the length fields of the FORM and SSND chunks ; - ** everything else can be skipped over. - */ - int k, ch, comm_size, comm_frames ; - - psf_fseek (psf, 0, SEEK_SET) ; - psf_fread (psf->header, psf->dataoffset, 1, psf) ; - - psf->headindex = 0 ; - - /* FORM chunk. */ - psf_binheader_writef (psf, "Etm8", FORM_MARKER, psf->filelength - 8) ; - - /* COMM chunk. */ - if ((k = psf_find_read_chunk_m32 (&psf->rchunks, COMM_MARKER)) >= 0) - { psf->headindex = psf->rchunks.chunks [k].offset - 8 ; - comm_frames = psf->sf.frames ; - comm_size = psf->rchunks.chunks [k].len ; - psf_binheader_writef (psf, "Em42t4", COMM_MARKER, comm_size, psf->sf.channels, comm_frames) ; - } ; - - /* PEAK chunk. */ - if ((k = psf_find_read_chunk_m32 (&psf->rchunks, PEAK_MARKER)) >= 0) - { psf->headindex = psf->rchunks.chunks [k].offset - 8 ; - psf_binheader_writef (psf, "Em4", PEAK_MARKER, AIFF_PEAK_CHUNK_SIZE (psf->sf.channels)) ; - psf_binheader_writef (psf, "E44", 1, time (NULL)) ; - for (ch = 0 ; ch < psf->sf.channels ; ch++) - psf_binheader_writef (psf, "Eft8", (float) psf->peak_info->peaks [ch].value, psf->peak_info->peaks [ch].position) ; - } ; - - - /* SSND chunk. */ - if ((k = psf_find_read_chunk_m32 (&psf->rchunks, SSND_MARKER)) >= 0) - { psf->headindex = psf->rchunks.chunks [k].offset - 8 ; - psf_binheader_writef (psf, "Etm8", SSND_MARKER, psf->datalength + SIZEOF_SSND_CHUNK) ; - } ; - - /* Header mangling complete so write it out. */ - psf_fseek (psf, 0, SEEK_SET) ; - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - return ; -} /* aiff_rewrite_header */ - -static int -aiff_write_header (SF_PRIVATE *psf, int calc_length) -{ sf_count_t current ; - AIFF_PRIVATE *paiff ; - unsigned char comm_sample_rate [10], comm_zero_bytes [2] = { 0, 0 } ; - unsigned int comm_type, comm_size, comm_encoding, comm_frames = 0, uk ; - int k, endian, has_data = SF_FALSE ; - short bit_width ; - - if ((paiff = psf->container_data) == NULL) - return SFE_INTERNAL ; - - current = psf_ftell (psf) ; - - if (current > psf->dataoffset) - has_data = SF_TRUE ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - - if (psf->bytewidth > 0) - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - if (psf->file.mode == SFM_RDWR && psf->dataoffset > 0 && psf->rchunks.count > 0) - { aiff_rewrite_header (psf) ; - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - return 0 ; - } ; - - endian = SF_ENDIAN (psf->sf.format) ; - if (CPU_IS_LITTLE_ENDIAN && endian == SF_ENDIAN_CPU) - endian = SF_ENDIAN_LITTLE ; - - /* Standard value here. */ - bit_width = psf->bytewidth * 8 ; - comm_frames = (psf->sf.frames > 0xFFFFFFFF) ? 0xFFFFFFFF : psf->sf.frames ; - - switch (SF_CODEC (psf->sf.format) | endian) - { case SF_FORMAT_PCM_S8 | SF_ENDIAN_BIG : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = twos_MARKER ; - break ; - - case SF_FORMAT_PCM_S8 | SF_ENDIAN_LITTLE : - psf->endian = SF_ENDIAN_LITTLE ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = sowt_MARKER ; - break ; - - case SF_FORMAT_PCM_16 | SF_ENDIAN_BIG : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = twos_MARKER ; - break ; - - case SF_FORMAT_PCM_16 | SF_ENDIAN_LITTLE : - psf->endian = SF_ENDIAN_LITTLE ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = sowt_MARKER ; - break ; - - case SF_FORMAT_PCM_24 | SF_ENDIAN_BIG : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = in24_MARKER ; - break ; - - case SF_FORMAT_PCM_24 | SF_ENDIAN_LITTLE : - psf->endian = SF_ENDIAN_LITTLE ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = ni24_MARKER ; - break ; - - case SF_FORMAT_PCM_32 | SF_ENDIAN_BIG : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = in32_MARKER ; - break ; - - case SF_FORMAT_PCM_32 | SF_ENDIAN_LITTLE : - psf->endian = SF_ENDIAN_LITTLE ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = ni32_MARKER ; - break ; - - case SF_FORMAT_PCM_S8 : /* SF_ENDIAN_FILE */ - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFF_MARKER ; - comm_size = SIZEOF_AIFF_COMM ; - comm_encoding = 0 ; - break ; - - case SF_FORMAT_FLOAT : /* Big endian floating point. */ - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = FL32_MARKER ; /* Use 'FL32' because its easier to read. */ - break ; - - case SF_FORMAT_DOUBLE : /* Big endian double precision floating point. */ - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = FL64_MARKER ; /* Use 'FL64' because its easier to read. */ - break ; - - case SF_FORMAT_ULAW : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = ulaw_MARKER ; - break ; - - case SF_FORMAT_ALAW : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = alaw_MARKER ; - break ; - - case SF_FORMAT_PCM_U8 : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = raw_MARKER ; - break ; - - case SF_FORMAT_DWVW_12 : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = DWVW_MARKER ; - - /* Override standard value here.*/ - bit_width = 12 ; - break ; - - case SF_FORMAT_DWVW_16 : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = DWVW_MARKER ; - - /* Override standard value here.*/ - bit_width = 16 ; - break ; - - case SF_FORMAT_DWVW_24 : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = DWVW_MARKER ; - - /* Override standard value here.*/ - bit_width = 24 ; - break ; - - case SF_FORMAT_GSM610 : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = GSM_MARKER ; - - /* Override standard value here.*/ - bit_width = 16 ; - break ; - - case SF_FORMAT_IMA_ADPCM : - psf->endian = SF_ENDIAN_BIG ; - comm_type = AIFC_MARKER ; - comm_size = SIZEOF_AIFC_COMM ; - comm_encoding = ima4_MARKER ; - - /* Override standard value here.*/ - bit_width = 16 ; - comm_frames = psf->sf.frames / AIFC_IMA4_SAMPLES_PER_BLOCK ; - break ; - - default : return SFE_BAD_OPEN_FORMAT ; - } ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - psf_binheader_writef (psf, "Etm8", FORM_MARKER, psf->filelength - 8) ; - - /* Write AIFF/AIFC marker and COM chunk. */ - if (comm_type == AIFC_MARKER) - /* AIFC must have an FVER chunk. */ - psf_binheader_writef (psf, "Emm44", comm_type, FVER_MARKER, 4, 0xA2805140) ; - else - psf_binheader_writef (psf, "Em", comm_type) ; - - paiff->comm_offset = psf->headindex - 8 ; - - memset (comm_sample_rate, 0, sizeof (comm_sample_rate)) ; - uint2tenbytefloat (psf->sf.samplerate, comm_sample_rate) ; - - psf_binheader_writef (psf, "Em42t42", COMM_MARKER, comm_size, psf->sf.channels, comm_frames, bit_width) ; - psf_binheader_writef (psf, "b", comm_sample_rate, sizeof (comm_sample_rate)) ; - - /* AIFC chunks have some extra data. */ - if (comm_type == AIFC_MARKER) - psf_binheader_writef (psf, "mb", comm_encoding, comm_zero_bytes, sizeof (comm_zero_bytes)) ; - - if (psf->channel_map && paiff->chanmap_tag) - psf_binheader_writef (psf, "Em4444", CHAN_MARKER, 12, paiff->chanmap_tag, 0, 0) ; - - if (psf->instrument != NULL) - { MARK_ID_POS m [4] ; - INST_CHUNK ch ; - unsigned short ct = 0 ; - - memset (m, 0, sizeof (m)) ; - memset (&ch, 0, sizeof (ch)) ; - - ch.baseNote = psf->instrument->basenote ; - ch.detune = psf->instrument->detune ; - ch.lowNote = psf->instrument->key_lo ; - ch.highNote = psf->instrument->key_hi ; - ch.lowVelocity = psf->instrument->velocity_lo ; - ch.highVelocity = psf->instrument->velocity_hi ; - ch.gain = psf->instrument->gain ; - if (psf->instrument->loops [0].mode != SF_LOOP_NONE) - { ch.sustain_loop.playMode = 1 ; - ch.sustain_loop.beginLoop = ct ; - m [0].markerID = ct++ ; - m [0].position = psf->instrument->loops [0].start ; - ch.sustain_loop.endLoop = ct ; - m [1].markerID = ct++ ; - m [1].position = psf->instrument->loops [0].end ; - } ; - if (psf->instrument->loops [1].mode != SF_LOOP_NONE) - { ch.release_loop.playMode = 1 ; - ch.release_loop.beginLoop = ct ; - m [2].markerID = ct++ ; - m [2].position = psf->instrument->loops [1].start ; - ch.release_loop.endLoop = ct ; - m [3].markerID = ct++ ; - m [3].position = psf->instrument->loops [1].end ; - } - else - { ch.release_loop.playMode = 0 ; - ch.release_loop.beginLoop = 0 ; - ch.release_loop.endLoop = 0 ; - } ; - - psf_binheader_writef (psf, "Em4111111", INST_MARKER, SIZEOF_INST_CHUNK, ch.baseNote, ch.detune, - ch.lowNote, ch.highNote, ch.lowVelocity, ch.highVelocity) ; - psf_binheader_writef (psf, "2222222", ch.gain, ch.sustain_loop.playMode, - ch.sustain_loop.beginLoop, ch.sustain_loop.endLoop, ch.release_loop.playMode, - ch.release_loop.beginLoop, ch.release_loop.endLoop) ; - - if (ct == 2) - psf_binheader_writef (psf, "Em42241b241b", - MARK_MARKER, 2 + 2 * (2 + 4 + 1 + 9), 2, - m [0].markerID, m [0].position, 8, "beg loop", make_size_t (9), - m [1].markerID, m [1].position, 8, "end loop", make_size_t (9)) ; - else if (ct == 4) - psf_binheader_writef (psf, "Em42 241b 241b 241b 241b", - MARK_MARKER, 2 + 4 * (2 + 4 + 1 + 9), 4, - m [0].markerID, m [0].position, 8, "beg loop", make_size_t (9), - m [1].markerID, m [1].position, 8, "end loop", make_size_t (9), - m [2].markerID, m [2].position, 8, "beg loop", make_size_t (9), - m [3].markerID, m [3].position, 8, "end loop", make_size_t (9)) ; - } ; - - if (psf->strings.flags & SF_STR_LOCATE_START) - aiff_write_strings (psf, SF_STR_LOCATE_START) ; - - if (psf->peak_info != NULL && psf->peak_info->peak_loc == SF_PEAK_START) - { psf_binheader_writef (psf, "Em4", PEAK_MARKER, AIFF_PEAK_CHUNK_SIZE (psf->sf.channels)) ; - psf_binheader_writef (psf, "E44", 1, time (NULL)) ; - for (k = 0 ; k < psf->sf.channels ; k++) - psf_binheader_writef (psf, "Eft8", (float) psf->peak_info->peaks [k].value, psf->peak_info->peaks [k].position) ; - } ; - - /* Write custom headers. */ - for (uk = 0 ; uk < psf->wchunks.used ; uk++) - psf_binheader_writef (psf, "Em4b", psf->wchunks.chunks [uk].mark32, psf->wchunks.chunks [uk].len, psf->wchunks.chunks [uk].data, make_size_t (psf->wchunks.chunks [uk].len)) ; - - /* Write SSND chunk. */ - paiff->ssnd_offset = psf->headindex ; - psf_binheader_writef (psf, "Etm844", SSND_MARKER, psf->datalength + SIZEOF_SSND_CHUNK, 0, 0) ; - - /* Header construction complete so write it out. */ - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - if (has_data && psf->dataoffset != psf->headindex) - return psf->error = SFE_INTERNAL ; - - psf->dataoffset = psf->headindex ; - - if (! has_data) - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - else if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* aiff_write_header */ - -static int -aiff_write_tailer (SF_PRIVATE *psf) -{ int k ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - - psf->dataend = psf_fseek (psf, 0, SEEK_END) ; - - /* Make sure tailer data starts at even byte offset. Pad if necessary. */ - if (psf->dataend % 2 == 1) - { psf_fwrite (psf->header, 1, 1, psf) ; - psf->dataend ++ ; - } ; - - if (psf->peak_info != NULL && psf->peak_info->peak_loc == SF_PEAK_END) - { psf_binheader_writef (psf, "Em4", PEAK_MARKER, AIFF_PEAK_CHUNK_SIZE (psf->sf.channels)) ; - psf_binheader_writef (psf, "E44", 1, time (NULL)) ; - for (k = 0 ; k < psf->sf.channels ; k++) - psf_binheader_writef (psf, "Eft8", (float) psf->peak_info->peaks [k].value, psf->peak_info->peaks [k].position) ; - } ; - - if (psf->strings.flags & SF_STR_LOCATE_END) - aiff_write_strings (psf, SF_STR_LOCATE_END) ; - - /* Write the tailer. */ - if (psf->headindex > 0) - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - return 0 ; -} /* aiff_write_tailer */ - -static void -aiff_write_strings (SF_PRIVATE *psf, int location) -{ int k, slen ; - - for (k = 0 ; k < SF_MAX_STRINGS ; k++) - { if (psf->strings.data [k].type == 0) - break ; - - if (psf->strings.data [k].flags != location) - continue ; - - switch (psf->strings.data [k].type) - { case SF_STR_SOFTWARE : - slen = strlen (psf->strings.storage + psf->strings.data [k].offset) ; - psf_binheader_writef (psf, "Em4mb", APPL_MARKER, slen + 4, m3ga_MARKER, psf->strings.storage + psf->strings.data [k].offset, make_size_t (slen + (slen & 1))) ; - break ; - - case SF_STR_TITLE : - psf_binheader_writef (psf, "EmS", NAME_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - case SF_STR_COPYRIGHT : - psf_binheader_writef (psf, "EmS", c_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - case SF_STR_ARTIST : - psf_binheader_writef (psf, "EmS", AUTH_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - case SF_STR_COMMENT : - psf_binheader_writef (psf, "EmS", ANNO_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - /* - case SF_STR_DATE : - psf_binheader_writef (psf, "Ems", ICRD_MARKER, psf->strings.data [k].str) ; - break ; - */ - } ; - } ; - - return ; -} /* aiff_write_strings */ - -static int -aiff_command (SF_PRIVATE * psf, int command, void * UNUSED (data), int UNUSED (datasize)) -{ AIFF_PRIVATE *paiff ; - - if ((paiff = psf->container_data) == NULL) - return SFE_INTERNAL ; - - switch (command) - { case SFC_SET_CHANNEL_MAP_INFO : - paiff->chanmap_tag = aiff_caf_find_channel_layout_tag (psf->channel_map, psf->sf.channels) ; - return (paiff->chanmap_tag != 0) ; - - default : - break ; - } ; - - return 0 ; -} /* aiff_command */ - -static const char* -get_loop_mode_str (short mode) -{ switch (mode) - { case 0 : return "none" ; - case 1 : return "forward" ; - case 2 : return "backward" ; - } ; - - return "*** unknown" ; -} /* get_loop_mode_str */ - -static short -get_loop_mode (short mode) -{ switch (mode) - { case 0 : return SF_LOOP_NONE ; - case 1 : return SF_LOOP_FORWARD ; - case 2 : return SF_LOOP_BACKWARD ; - } ; - - return SF_LOOP_NONE ; -} /* get_loop_mode */ - -/*========================================================================================== -** Rough hack at converting from 80 bit IEEE float in AIFF header to an int and -** back again. It assumes that all sample rates are between 1 and 800MHz, which -** should be OK as other sound file formats use a 32 bit integer to store sample -** rate. -** There is another (probably better) version in the source code to the SoX but it -** has a copyright which probably prevents it from being allowable as GPL/LGPL. -*/ - -static int -tenbytefloat2int (unsigned char *bytes) -{ int val = 3 ; - - if (bytes [0] & 0x80) /* Negative number. */ - return 0 ; - - if (bytes [0] <= 0x3F) /* Less than 1. */ - return 1 ; - - if (bytes [0] > 0x40) /* Way too big. */ - return 0x4000000 ; - - if (bytes [0] == 0x40 && bytes [1] > 0x1C) /* Too big. */ - return 800000000 ; - - /* Ok, can handle it. */ - - val = (bytes [2] << 23) | (bytes [3] << 15) | (bytes [4] << 7) | (bytes [5] >> 1) ; - - val >>= (29 - bytes [1]) ; - - return val ; -} /* tenbytefloat2int */ - -static void -uint2tenbytefloat (unsigned int num, unsigned char *bytes) -{ unsigned int mask = 0x40000000 ; - int count ; - - if (num <= 1) - { bytes [0] = 0x3F ; - bytes [1] = 0xFF ; - bytes [2] = 0x80 ; - return ; - } ; - - bytes [0] = 0x40 ; - - if (num >= mask) - { bytes [1] = 0x1D ; - return ; - } ; - - for (count = 0 ; count <= 32 ; count ++) - { if (num & mask) - break ; - mask >>= 1 ; - } ; - - num <<= count + 1 ; - bytes [1] = 29 - count ; - bytes [2] = (num >> 24) & 0xFF ; - bytes [3] = (num >> 16) & 0xFF ; - bytes [4] = (num >> 8) & 0xFF ; - bytes [5] = num & 0xFF ; - -} /* uint2tenbytefloat */ - -static int -aiff_read_basc_chunk (SF_PRIVATE * psf, int datasize) -{ const char * type_str ; - basc_CHUNK bc ; - int count ; - - count = psf_binheader_readf (psf, "E442", &bc.version, &bc.numBeats, &bc.rootNote) ; - count += psf_binheader_readf (psf, "E222", &bc.scaleType, &bc.sigNumerator, &bc.sigDenominator) ; - count += psf_binheader_readf (psf, "E2j", &bc.loopType, datasize - sizeof (bc)) ; - - psf_log_printf (psf, " Version ? : %u\n Num Beats : %u\n Root Note : 0x%x\n", - bc.version, bc.numBeats, bc.rootNote) ; - - switch (bc.scaleType) - { case basc_SCALE_MINOR : - type_str = "MINOR" ; - break ; - case basc_SCALE_MAJOR : - type_str = "MAJOR" ; - break ; - case basc_SCALE_NEITHER : - type_str = "NEITHER" ; - break ; - case basc_SCALE_BOTH : - type_str = "BOTH" ; - break ; - default : - type_str = "!!WRONG!!" ; - break ; - } ; - - psf_log_printf (psf, " ScaleType : 0x%x (%s)\n", bc.scaleType, type_str) ; - psf_log_printf (psf, " Time Sig : %d/%d\n", bc.sigNumerator, bc.sigDenominator) ; - - switch (bc.loopType) - { case basc_TYPE_ONE_SHOT : - type_str = "One Shot" ; - break ; - case basc_TYPE_LOOP : - type_str = "Loop" ; - break ; - default: - type_str = "!!WRONG!!" ; - break ; - } ; - - psf_log_printf (psf, " Loop Type : 0x%x (%s)\n", bc.loopType, type_str) ; - - if ((psf->loop_info = calloc (1, sizeof (SF_LOOP_INFO))) == NULL) - return SFE_MALLOC_FAILED ; - - psf->loop_info->time_sig_num = bc.sigNumerator ; - psf->loop_info->time_sig_den = bc.sigDenominator ; - psf->loop_info->loop_mode = (bc.loopType == basc_TYPE_ONE_SHOT) ? SF_LOOP_NONE : SF_LOOP_FORWARD ; - psf->loop_info->num_beats = bc.numBeats ; - - /* Can always be recalculated from other known fields. */ - psf->loop_info->bpm = (1.0 / psf->sf.frames) * psf->sf.samplerate - * ((bc.numBeats * 4.0) / bc.sigDenominator) * 60.0 ; - psf->loop_info->root_key = bc.rootNote ; - - if (count < datasize) - psf_binheader_readf (psf, "j", datasize - count) ; - - return 0 ; -} /* aiff_read_basc_chunk */ - - -static int -aiff_read_chanmap (SF_PRIVATE * psf, unsigned dword) -{ const AIFF_CAF_CHANNEL_MAP * map_info ; - unsigned channel_bitmap, channel_decriptions, bytesread ; - int layout_tag ; - - bytesread = psf_binheader_readf (psf, "444", &layout_tag, &channel_bitmap, &channel_decriptions) ; - - if ((map_info = aiff_caf_of_channel_layout_tag (layout_tag)) == NULL) - return 0 ; - - psf_log_printf (psf, " Tag : %x\n", layout_tag) ; - if (map_info) - psf_log_printf (psf, " Layout : %s\n", map_info->name) ; - - if (bytesread < dword) - psf_binheader_readf (psf, "j", dword - bytesread) ; - - if (map_info->channel_map != NULL) - { size_t chanmap_size = psf->sf.channels * sizeof (psf->channel_map [0]) ; - - free (psf->channel_map) ; - - if ((psf->channel_map = malloc (chanmap_size)) == NULL) - return SFE_MALLOC_FAILED ; - - memcpy (psf->channel_map, map_info->channel_map, chanmap_size) ; - } ; - - return 0 ; -} /* aiff_read_chanmap */ - -/*============================================================================== -*/ - -static int -aiff_set_chunk (SF_PRIVATE *psf, const SF_CHUNK_INFO * chunk_info) -{ return psf_save_write_chunk (&psf->wchunks, chunk_info) ; -} /* aiff_set_chunk */ - -static SF_CHUNK_ITERATOR * -aiff_next_chunk_iterator (SF_PRIVATE *psf, SF_CHUNK_ITERATOR * iterator) -{ return psf_next_chunk_iterator (&psf->rchunks, iterator) ; -} /* aiff_next_chunk_iterator */ - -static int -aiff_get_chunk_size (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) -{ int indx ; - - if ((indx = psf_find_read_chunk_iterator (&psf->rchunks, iterator)) < 0) - return SFE_UNKNOWN_CHUNK ; - - chunk_info->datalen = psf->rchunks.chunks [indx].len ; - - return SFE_NO_ERROR ; -} /* aiff_get_chunk_size */ - -static int -aiff_get_chunk_data (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) -{ sf_count_t pos ; - int indx ; - - if ((indx = psf_find_read_chunk_iterator (&psf->rchunks, iterator)) < 0) - return SFE_UNKNOWN_CHUNK ; - - if (chunk_info->data == NULL) - return SFE_BAD_CHUNK_DATA_PTR ; - - chunk_info->id_size = psf->rchunks.chunks [indx].id_size ; - memcpy (chunk_info->id, psf->rchunks.chunks [indx].id, sizeof (chunk_info->id) / sizeof (*chunk_info->id)) ; - - pos = psf_ftell (psf) ; - psf_fseek (psf, psf->rchunks.chunks [indx].offset, SEEK_SET) ; - psf_fread (chunk_info->data, SF_MIN (chunk_info->datalen, psf->rchunks.chunks [indx].len), 1, psf) ; - psf_fseek (psf, pos, SEEK_SET) ; - - return SFE_NO_ERROR ; -} /* aiff_get_chunk_data */ diff --git a/libs/libsndfile/src/alac.c b/libs/libsndfile/src/alac.c deleted file mode 100644 index 747e032769..0000000000 --- a/libs/libsndfile/src/alac.c +++ /dev/null @@ -1,964 +0,0 @@ -/* -** Copyright (C) 2011-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" -#include "ALAC/alac_codec.h" -#include "ALAC/ALACBitUtilities.h" - -#define ALAC_MAX_FRAME_SIZE 8192 -#define ALAC_BYTE_BUFFER_SIZE 82000 - - -typedef struct -{ uint32_t current, count, allocated ; - uint32_t packet_size [] ; -} PAKT_INFO ; - -typedef struct -{ sf_count_t input_data_pos ; - - PAKT_INFO * pakt_info ; - - int channels, final_write_block ; - - uint32_t frames_this_block, partial_block_frames, frames_per_block ; - uint32_t bits_per_sample, kuki_size ; - - - /* Can't have a decoder and an encoder at the same time so stick - ** them in an un-named union. - */ - union - { ALAC_DECODER decoder ; - ALAC_ENCODER encoder ; - } ; - - char enctmpname [512] ; - FILE *enctmp ; - - int buffer [] ; - -} ALAC_PRIVATE ; - -/*============================================================================================ -*/ - -static int alac_reader_init (SF_PRIVATE *psf, const ALAC_DECODER_INFO * info) ; -static int alac_writer_init (SF_PRIVATE *psf) ; - -static sf_count_t alac_reader_calc_frames (SF_PRIVATE *psf, ALAC_PRIVATE *plac) ; - -static sf_count_t alac_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t alac_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t alac_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t alac_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t alac_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t alac_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t alac_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t alac_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static sf_count_t alac_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; - -static int alac_close (SF_PRIVATE *psf) ; -static int alac_byterate (SF_PRIVATE *psf) ; - -static int alac_decode_block (SF_PRIVATE *psf, ALAC_PRIVATE *plac) ; -static int alac_encode_block (SF_PRIVATE *psf, ALAC_PRIVATE *plac) ; - -static uint32_t alac_kuki_read (SF_PRIVATE * psf, uint32_t kuki_offset, uint8_t * kuki, size_t kuki_maxlen) ; - -static PAKT_INFO * alac_pakt_alloc (uint32_t initial_count) ; -static PAKT_INFO * alac_pakt_read_decode (SF_PRIVATE * psf, uint32_t pakt_offset) ; -static PAKT_INFO * alac_pakt_append (PAKT_INFO * info, uint32_t value) ; -static uint8_t * alac_pakt_encode (const SF_PRIVATE *psf, uint32_t * pakt_size) ; -static sf_count_t alac_pakt_block_offset (const PAKT_INFO *info, uint32_t block) ; - -/*============================================================================================ -** ALAC Reader initialisation function. -*/ - -int -alac_init (SF_PRIVATE *psf, const ALAC_DECODER_INFO * info) -{ int error ; - - if ((psf->codec_data = calloc (1, sizeof (ALAC_PRIVATE) + psf->sf.channels * sizeof (int) * ALAC_MAX_FRAME_SIZE)) == NULL) - return SFE_MALLOC_FAILED ; - - psf->codec_close = alac_close ; - - switch (psf->file.mode) - { case SFM_RDWR : - return SFE_BAD_MODE_RW ; - - case SFM_READ : - if ((error = alac_reader_init (psf, info))) - return error ; - break ; - - case SFM_WRITE : - if ((error = alac_writer_init (psf))) - return error ; - break ; - - default : - psf_log_printf (psf, "%s : Bad psf->file.mode.\n", __func__) ; - return SFE_INTERNAL ; - } ; - - psf->byterate = alac_byterate ; - - return 0 ; -} /* aiff_alac_init */ - -void -alac_get_desc_chunk_items (int subformat, uint32_t *fmt_flags, uint32_t *frames_per_packet) -{ switch (subformat) - { case SF_FORMAT_ALAC_16 : - *fmt_flags = 1 ; - break ; - case SF_FORMAT_ALAC_20 : - *fmt_flags = 2 ; - break ; - case SF_FORMAT_ALAC_24 : - *fmt_flags = 3 ; - break ; - case SF_FORMAT_ALAC_32 : - *fmt_flags = 4 ; - break ; - default : - break ; - } ; - *frames_per_packet = ALAC_FRAME_LENGTH ; -} /* alac_get_desc_chunk_items */ - -static int -alac_close (SF_PRIVATE *psf) -{ ALAC_PRIVATE *plac ; - BUF_UNION ubuf ; - - plac = psf->codec_data ; - - if (psf->file.mode == SFM_WRITE) - { ALAC_ENCODER *penc = &plac->encoder ; - SF_CHUNK_INFO chunk_info ; - sf_count_t readcount ; - uint32_t pakt_size = 0, saved_partial_block_frames ; -#ifndef _MSC_VER - uint8_t *kuki_data [plac->kuki_size]; -#else - uint8_t *kuki_data = (uint8_t *)_alloca(plac->kuki_size); -#endif - - plac->final_write_block = 1 ; - saved_partial_block_frames = plac->partial_block_frames ; - - /* If a block has been partially assembled, write it out as the final block. */ - if (plac->partial_block_frames && plac->partial_block_frames < plac->frames_per_block) - alac_encode_block (psf, plac) ; - - plac->partial_block_frames = saved_partial_block_frames ; - - alac_get_magic_cookie (penc, kuki_data, &plac->kuki_size) ; - - memset (&chunk_info, 0, sizeof (chunk_info)) ; - chunk_info.id_size = snprintf (chunk_info.id, sizeof (chunk_info.id), "kuki") ; - chunk_info.data = kuki_data ; - chunk_info.datalen = plac->kuki_size ; - psf_save_write_chunk (&psf->wchunks, &chunk_info) ; - - memset (&chunk_info, 0, sizeof (chunk_info)) ; - chunk_info.id_size = snprintf (chunk_info.id, sizeof (chunk_info.id), "pakt") ; - chunk_info.data = alac_pakt_encode (psf, &pakt_size) ; - chunk_info.datalen = pakt_size ; - psf_save_write_chunk (&psf->wchunks, &chunk_info) ; - - free (chunk_info.data) ; - chunk_info.data = NULL ; - - psf->write_header (psf, 1) ; - - if (plac->enctmp != NULL) - { fseek (plac->enctmp, 0, SEEK_SET) ; - - while ((readcount = fread (ubuf.ucbuf, 1, sizeof (ubuf.ucbuf), plac->enctmp)) > 0) - psf_fwrite (ubuf.ucbuf, 1, readcount, psf) ; - fclose (plac->enctmp) ; - remove (plac->enctmpname) ; - } ; - free(kuki_data); - } ; - - if (plac->pakt_info) - free (plac->pakt_info) ; - plac->pakt_info = NULL ; - - return 0 ; -} /* alac_close */ - -static int -alac_byterate (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_READ) - return (psf->datalength * psf->sf.samplerate) / psf->sf.frames ; - - return -1 ; -} /* alac_byterate */ - -/*============================================================================================ -** ALAC initialisation Functions. -*/ - -static int -alac_reader_init (SF_PRIVATE *psf, const ALAC_DECODER_INFO * info) -{ ALAC_PRIVATE *plac ; - uint32_t kuki_size ; - union { uint8_t kuki [512] ; uint32_t alignment ; } u ; - - if (info == NULL) - { psf_log_printf (psf, "%s : ALAC_DECODER_INFO is NULL.\n", __func__) ; - return SFE_INTERNAL ; - } ; - - plac = psf->codec_data ; - - plac->channels = psf->sf.channels ; - plac->frames_per_block = info->frames_per_packet ; - plac->bits_per_sample = info->bits_per_sample ; - - if (plac->pakt_info != NULL) - free (plac->pakt_info) ; - plac->pakt_info = alac_pakt_read_decode (psf, info->pakt_offset) ; - - - if (plac->pakt_info == NULL) - { psf_log_printf (psf, "%s : alac_pkt_read() returns NULL.\n", __func__) ; - return SFE_MALLOC_FAILED ; - } ; - - /* Read in the ALAC cookie data and pass it to the init function. */ - kuki_size = alac_kuki_read (psf, info->kuki_offset, u.kuki, sizeof (u.kuki)) ; - - alac_decoder_init (&plac->decoder, u.kuki, kuki_size) ; - - switch (info->bits_per_sample) - { case 16 : - case 20 : - case 24 : - case 32 : - psf->read_short = alac_read_s ; - psf->read_int = alac_read_i ; - psf->read_float = alac_read_f ; - psf->read_double = alac_read_d ; - break ; - - default : - printf ("%s : info->bits_per_sample %u\n", __func__, info->bits_per_sample) ; - return SFE_UNSUPPORTED_ENCODING ; - } ; - - psf->codec_close = alac_close ; - psf->seek = alac_seek ; - - psf->sf.frames = alac_reader_calc_frames (psf, plac) ; - alac_seek (psf, SFM_READ, 0) ; - - return 0 ; -} /* alac_reader_init */ - -static int -alac_writer_init (SF_PRIVATE *psf) -{ ALAC_PRIVATE *plac ; - uint32_t alac_format_flags = 0 ; - - plac = psf->codec_data ; - - if (psf->file.mode != SFM_WRITE) - return SFE_BAD_MODE_RW ; - - plac->channels = psf->sf.channels ; - plac->kuki_size = alac_get_magic_cookie_size (psf->sf.channels) ; - - psf->write_short = alac_write_s ; - psf->write_int = alac_write_i ; - psf->write_float = alac_write_f ; - psf->write_double = alac_write_d ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_ALAC_16 : - alac_format_flags = 1 ; - plac->bits_per_sample = 16 ; - break ; - - case SF_FORMAT_ALAC_20 : - alac_format_flags = 2 ; - plac->bits_per_sample = 20 ; - break ; - - case SF_FORMAT_ALAC_24 : - alac_format_flags = 3 ; - plac->bits_per_sample = 24 ; - break ; - - case SF_FORMAT_ALAC_32 : - alac_format_flags = 4 ; - plac->bits_per_sample = 32 ; - break ; - - default : - psf_log_printf (psf, "%s : Can't figure out bits per sample.\n", __func__) ; - return SFE_UNIMPLEMENTED ; - } ; - - plac->frames_per_block = ALAC_FRAME_LENGTH ; - - plac->pakt_info = alac_pakt_alloc (2000) ; - - if ((plac->enctmp = psf_open_tmpfile (plac->enctmpname, sizeof (plac->enctmpname))) == NULL) - { psf_log_printf (psf, "Error : Failed to open temp file '%s' : \n", plac->enctmpname, strerror (errno)) ; - return SFE_ALAC_FAIL_TMPFILE ; - } ; - - alac_encoder_init (&plac->encoder, psf->sf.samplerate, psf->sf.channels, alac_format_flags, ALAC_FRAME_LENGTH) ; - - return 0 ; -} /* alac_writer_init */ - -/*============================================================================================ -** ALAC block decoder and encoder. -*/ - -static inline uint32_t -alac_reader_next_packet_size (PAKT_INFO * info) -{ if (info->current >= info->count) - return 0 ; - return info->packet_size [info->current++] ; -} /* alac_reader_next_packet_size */ - -static sf_count_t -alac_reader_calc_frames (SF_PRIVATE *psf, ALAC_PRIVATE *plac) -{ sf_count_t frames = 0 ; - uint32_t current_pos = 1, blocks = 0 ; - - plac->pakt_info->current = 0 ; - - while (current_pos < psf->filelength && current_pos > 0) - { current_pos = alac_reader_next_packet_size (plac->pakt_info) ; - blocks = current_pos > 0 ? blocks + 1 : blocks ; - } ; - - if (blocks == 0) - return 0 ; - - /* Only count full blocks. */ - frames = plac->frames_per_block * (blocks - 1) ; - - alac_seek (psf, SFM_READ, frames) ; - alac_decode_block (psf, plac) ; - frames += plac->frames_this_block ; - - plac->pakt_info->current = 0 ; - - return frames ; -} /* alac_reader_calc_frames */ - -static int -alac_decode_block (SF_PRIVATE *psf, ALAC_PRIVATE *plac) -{ ALAC_DECODER *pdec = &plac->decoder ; - uint8_t byte_buffer [ALAC_BYTE_BUFFER_SIZE] ; - uint32_t packet_size ; - BitBuffer bit_buffer ; - - packet_size = alac_reader_next_packet_size (plac->pakt_info) ; - if (packet_size == 0) - { if (plac->pakt_info->current < plac->pakt_info->count) - psf_log_printf (psf, "packet_size is 0 (%d of %d)\n", plac->pakt_info->current, plac->pakt_info->count) ; - return 0 ; - } ; - - psf_fseek (psf, plac->input_data_pos, SEEK_SET) ; - - if (packet_size > SIGNED_SIZEOF (byte_buffer)) - { psf_log_printf (psf, "%s : bad packet_size (%u)\n", __func__, packet_size) ; - return 0 ; - } ; - - if ((packet_size != psf_fread (byte_buffer, 1, packet_size, psf))) - return 0 ; - - BitBufferInit (&bit_buffer, byte_buffer, packet_size) ; - - plac->input_data_pos += packet_size ; - plac->frames_this_block = 0 ; - alac_decode (pdec, &bit_buffer, plac->buffer, plac->frames_per_block, psf->sf.channels, &plac->frames_this_block) ; - - plac->partial_block_frames = 0 ; - - return 1 ; -} /* alac_decode_block */ - - -static int -alac_encode_block (SF_PRIVATE * psf, ALAC_PRIVATE *plac) -{ ALAC_ENCODER *penc = &plac->encoder ; - uint32_t num_bytes = 0 ; -#ifndef _MSC_VER - uint8_t byte_buffer [psf->sf.channels * ALAC_BYTE_BUFFER_SIZE] ; -#else - uint8_t* byte_buffer = (uint8_t*)_alloca (psf->sf.channels * ALAC_BYTE_BUFFER_SIZE) ; -#endif - - alac_encode (penc, plac->channels, plac->partial_block_frames, plac->buffer, byte_buffer, &num_bytes) ; - - if (fwrite (byte_buffer, 1, num_bytes, plac->enctmp) != num_bytes) - { - free (byte_buffer); - return 0 ; - } - free(byte_buffer); - - if ((plac->pakt_info = alac_pakt_append (plac->pakt_info, num_bytes)) == NULL) - return 0 ; - - plac->partial_block_frames = 0 ; - - return 1 ; -} /* alac_encode_block */ - -/*============================================================================================ -** ALAC read functions. -*/ - -static sf_count_t -alac_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ ALAC_PRIVATE *plac ; - int *iptr ; - int k, readcount ; - sf_count_t total = 0 ; - - if ((plac = (ALAC_PRIVATE*) psf->codec_data) == NULL) - return 0 ; - - while (len > 0) - { if (plac->partial_block_frames >= plac->frames_this_block && alac_decode_block (psf, plac) == 0) - break ; - - readcount = (plac->frames_this_block - plac->partial_block_frames) * plac->channels ; - readcount = readcount > len ? len : readcount ; - - iptr = plac->buffer + plac->partial_block_frames * plac->channels ; - - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = iptr [k] >> 16 ; - - plac->partial_block_frames += readcount / plac->channels ; - total += readcount ; - len -= readcount ; - } ; - - return total ; -} /* alac_read_s */ - -static sf_count_t -alac_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ ALAC_PRIVATE *plac ; - int *iptr ; - int k, readcount ; - sf_count_t total = 0 ; - - if ((plac = (ALAC_PRIVATE*) psf->codec_data) == NULL) - return 0 ; - - while (len > 0) - { if (plac->partial_block_frames >= plac->frames_this_block && alac_decode_block (psf, plac) == 0) - break ; - - readcount = (plac->frames_this_block - plac->partial_block_frames) * plac->channels ; - readcount = readcount > len ? len : readcount ; - - iptr = plac->buffer + plac->partial_block_frames * plac->channels ; - - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = iptr [k] ; - - plac->partial_block_frames += readcount / plac->channels ; - total += readcount ; - len -= readcount ; - } ; - - return total ; -} /* alac_read_i */ - -static sf_count_t -alac_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ ALAC_PRIVATE *plac ; - int *iptr ; - int k, readcount ; - sf_count_t total = 0 ; - float normfact ; - - if ((plac = (ALAC_PRIVATE*) psf->codec_data) == NULL) - return 0 ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x80000000) : 1.0 ; - - while (len > 0) - { if (plac->partial_block_frames >= plac->frames_this_block && alac_decode_block (psf, plac) == 0) - break ; - - readcount = (plac->frames_this_block - plac->partial_block_frames) * plac->channels ; - readcount = readcount > len ? len : readcount ; - - iptr = plac->buffer + plac->partial_block_frames * plac->channels ; - - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * iptr [k] ; - - plac->partial_block_frames += readcount / plac->channels ; - total += readcount ; - len -= readcount ; - } ; - - return total ; -} /* alac_read_f */ - -static sf_count_t -alac_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ ALAC_PRIVATE *plac ; - int *iptr ; - int k, readcount ; - sf_count_t total = 0 ; - double normfact ; - - if ((plac = (ALAC_PRIVATE*) psf->codec_data) == NULL) - return 0 ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((float) 0x80000000) : 1.0 ; - - while (len > 0) - { if (plac->partial_block_frames >= plac->frames_this_block && alac_decode_block (psf, plac) == 0) - break ; - - readcount = (plac->frames_this_block - plac->partial_block_frames) * plac->channels ; - readcount = readcount > len ? len : readcount ; - - iptr = plac->buffer + plac->partial_block_frames * plac->channels ; - - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * iptr [k] ; - - plac->partial_block_frames += readcount / plac->channels ; - total += readcount ; - len -= readcount ; - } ; - - return total ; -} /* alac_read_d */ - -/*============================================================================================ -*/ - -static sf_count_t -alac_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) -{ ALAC_PRIVATE *plac ; - int newblock, newsample ; - - if (! psf->codec_data) - return 0 ; - plac = (ALAC_PRIVATE*) psf->codec_data ; - - if (psf->datalength < 0 || psf->dataoffset < 0) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - if (offset == 0) - { psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - plac->frames_this_block = 0 ; - plac->input_data_pos = psf->dataoffset ; - plac->pakt_info->current = 0 ; - return 0 ; - } ; - - if (offset < 0 || offset > plac->pakt_info->count * plac->frames_per_block) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - newblock = offset / plac->frames_per_block ; - newsample = offset % plac->frames_per_block ; - - if (mode == SFM_READ) - { plac->input_data_pos = psf->dataoffset + alac_pakt_block_offset (plac->pakt_info, newblock) ; - - plac->pakt_info->current = newblock ; - alac_decode_block (psf, plac) ; - plac->partial_block_frames = newsample ; - } - else - { /* What to do about write??? */ - psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - return newblock * plac->frames_per_block + newsample ; -} /* alac_seek */ - -/*========================================================================================== -** ALAC Write Functions. -*/ - -static sf_count_t -alac_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ ALAC_PRIVATE *plac ; - int *iptr ; - int k, writecount ; - sf_count_t total = 0 ; - - if ((plac = (ALAC_PRIVATE*) psf->codec_data) == NULL) - return 0 ; - - while (len > 0) - { writecount = (plac->frames_per_block - plac->partial_block_frames) * plac->channels ; - writecount = (writecount == 0 || writecount > len) ? len : writecount ; - - iptr = plac->buffer + plac->partial_block_frames * plac->channels ; - - for (k = 0 ; k < writecount ; k++) - iptr [k] = ptr [total + k] << 16 ; - - plac->partial_block_frames += writecount / plac->channels ; - total += writecount ; - len -= writecount ; - - if (plac->partial_block_frames >= plac->frames_per_block) - alac_encode_block (psf, plac) ; - } ; - - return total ; -} /* alac_write_s */ - -static sf_count_t -alac_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ ALAC_PRIVATE *plac ; - int *iptr ; - int k, writecount ; - sf_count_t total = 0 ; - - if ((plac = (ALAC_PRIVATE*) psf->codec_data) == NULL) - return 0 ; - - while (len > 0) - { writecount = (plac->frames_per_block - plac->partial_block_frames) * plac->channels ; - writecount = (writecount == 0 || writecount > len) ? len : writecount ; - - iptr = plac->buffer + plac->partial_block_frames * plac->channels ; - - for (k = 0 ; k < writecount ; k++) - iptr [k] = ptr [total + k] ; - - plac->partial_block_frames += writecount / plac->channels ; - total += writecount ; - len -= writecount ; - - if (plac->partial_block_frames >= plac->frames_per_block) - alac_encode_block (psf, plac) ; - } ; - - return total ; -} /* alac_write_i */ - -static sf_count_t -alac_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ ALAC_PRIVATE *plac ; - void (*convert) (const float *, int *t, int, int) ; - int *iptr ; - int writecount ; - sf_count_t total = 0 ; - - if ((plac = (ALAC_PRIVATE*) psf->codec_data) == NULL) - return 0 ; - - convert = (psf->add_clipping) ? psf_f2i_clip_array : psf_f2i_array ; - - while (len > 0) - { writecount = (plac->frames_per_block - plac->partial_block_frames) * plac->channels ; - writecount = (writecount == 0 || writecount > len) ? len : writecount ; - - iptr = plac->buffer + plac->partial_block_frames * plac->channels ; - - convert (ptr, iptr, writecount, psf->norm_float) ; - - plac->partial_block_frames += writecount / plac->channels ; - total += writecount ; - len -= writecount ; - - if (plac->partial_block_frames >= plac->frames_per_block) - alac_encode_block (psf, plac) ; - } ; - - return total ; -} /* alac_write_f */ - -static sf_count_t -alac_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ ALAC_PRIVATE *plac ; - void (*convert) (const double *, int *t, int, int) ; - int *iptr ; - int writecount ; - sf_count_t total = 0 ; - - if ((plac = (ALAC_PRIVATE*) psf->codec_data) == NULL) - return 0 ; - - convert = (psf->add_clipping) ? psf_d2i_clip_array : psf_d2i_array ; - - while (len > 0) - { writecount = (plac->frames_per_block - plac->partial_block_frames) * plac->channels ; - writecount = (writecount == 0 || writecount > len) ? len : writecount ; - - iptr = plac->buffer + plac->partial_block_frames * plac->channels ; - - convert (ptr, iptr, writecount, psf->norm_float) ; - - plac->partial_block_frames += writecount / plac->channels ; - total += writecount ; - len -= writecount ; - - if (plac->partial_block_frames >= plac->frames_per_block) - alac_encode_block (psf, plac) ; - } ; - - return total ; -} /* alac_write_d */ - -/*============================================================================== -** PAKT_INFO handling. -*/ - -static PAKT_INFO * -alac_pakt_alloc (uint32_t initial_count) -{ PAKT_INFO * info ; - - if ((info = calloc (1, sizeof (PAKT_INFO) + initial_count * sizeof (info->packet_size [0]))) == NULL) - return NULL ; - - info->allocated = initial_count ; - info->current = 0 ; - info->count = 0 ; - - return info ; -} /* alac_pakt_alloc */ - -static PAKT_INFO * -alac_pakt_append (PAKT_INFO * info, uint32_t value) -{ - if (info->count >= info->allocated) - { PAKT_INFO * temp ; - uint32_t newcount = info->allocated + info->allocated / 2 ; - - if ((temp = realloc (info, sizeof (PAKT_INFO) + newcount * sizeof (info->packet_size [0]))) == NULL) - return NULL ; - - info = temp ; - info->allocated = newcount ; - } ; - - info->packet_size [info->count++] = value ; - return info ; -} /* alac_pakt_append */ - -static PAKT_INFO * -alac_pakt_read_decode (SF_PRIVATE * psf, uint32_t UNUSED (pakt_offset)) -{ SF_CHUNK_INFO chunk_info ; - PAKT_INFO * info = NULL ; - uint8_t *pakt_data = NULL ; - uint32_t bcount, value = 1, pakt_size ; - SF_CHUNK_ITERATOR * chunk_iterator ; - - - memset (&chunk_info, 0, sizeof (chunk_info)) ; - snprintf (chunk_info.id, sizeof (chunk_info.id), "pakt") ; - chunk_info.id_size = 4 ; - - if ((chunk_iterator = psf_get_chunk_iterator (psf, chunk_info.id)) == NULL) - { printf ("%s %d : no chunk iterator found\n\n", __func__, __LINE__) ; - free (chunk_info.data) ; - chunk_info.data = NULL ; - return NULL ; - } ; - - psf->get_chunk_size (psf, chunk_iterator, &chunk_info) ; - - pakt_size = chunk_info.datalen ; - chunk_info.data = pakt_data = malloc (pakt_size + 5) ; - - if ((bcount = psf->get_chunk_data (psf, chunk_iterator, &chunk_info)) != SF_ERR_NO_ERROR) - { printf ("%s %d : %s\n\n", __func__, __LINE__, sf_error_number (bcount)) ; - while (chunk_iterator) - chunk_iterator = psf->next_chunk_iterator (psf, chunk_iterator) ; - free (chunk_info.data) ; - chunk_info.data = NULL ; - return NULL ; - } ; - - while (chunk_iterator) - chunk_iterator = psf->next_chunk_iterator (psf, chunk_iterator) ; - - info = alac_pakt_alloc (pakt_size / 4) ; - - /* Start at 24 bytes in, skipping over the 'pakt' chunks header. */ - for (bcount = 24 ; bcount < pakt_size && value != 0 ; ) - { uint8_t byte ; - int32_t count = 0 ; - - value = 0 ; - do - { byte = pakt_data [bcount + count] ; - value = (value << 7) + (byte & 0x7F) ; - - count ++ ; - if (count > 5 || bcount + count > pakt_size) - { printf ("%s %d : Ooops! count %d bcount %d\n", __func__, __LINE__, count, bcount) ; - value = 0 ; - break ; - } ; - } - while (byte & 0x80) ; - - bcount += count ; - - if ((info = alac_pakt_append (info, value)) == NULL) - goto FreeExit ; - } ; - - free (pakt_data) ; - - return info ; - -FreeExit : - free (pakt_data) ; - free (info) ; - return NULL ; -} /* alac_pakt_read_decode */ - -static uint8_t * -alac_pakt_encode (const SF_PRIVATE *psf, uint32_t * pakt_size_out) -{ const ALAC_PRIVATE *plac ; - const PAKT_INFO *info ; - uint8_t *data ; - uint32_t k, allocated, pakt_size ; - - plac = psf->codec_data ; - info = plac->pakt_info ; - - allocated = 100 + 2 * info->count ; - if ((data = calloc (1, allocated)) == NULL) - return NULL ; - - psf_put_be64 (data, 0, info->count) ; - psf_put_be64 (data, 8, psf->sf.frames) ; - psf_put_be32 (data, 20, kALACDefaultFramesPerPacket - plac->partial_block_frames) ; - - /* Real 'pakt' data starts after 24 byte header. */ - pakt_size = 24 ; - - for (k = 0 ; k < info->count ; k++) - { int32_t value = info->packet_size [k] ; - - if ((value & 0x7f) == value) - { data [pakt_size++] = value ; - continue ; - } ; - - if ((value & 0x3fff) == value) - { data [pakt_size++] = (value >> 7) | 0x80 ; - data [pakt_size++] = value & 0x7f ; - continue ; - } ; - - if ((value & 0x1fffff) == value) - { data [pakt_size++] = (value >> 14) | 0x80 ; - data [pakt_size++] = ((value >> 7) & 0x7f) | 0x80 ; - data [pakt_size++] = value & 0x7f ; - continue ; - } ; - - if ((value & 0x0fffffff) == value) - { data [pakt_size++] = (value >> 21) | 0x80 ; - data [pakt_size++] = ((value >> 14) & 0x7f) | 0x80 ; - data [pakt_size++] = ((value >> 7) & 0x7f) | 0x80 ; - data [pakt_size++] = value & 0x7f ; - continue ; - } ; - - *pakt_size_out = 0 ; - free (data) ; - return NULL ; - } ; - - *pakt_size_out = pakt_size ; - return data ; -} /* alac_pakt_encode */ - -static sf_count_t -alac_pakt_block_offset (const PAKT_INFO *info, uint32_t block) -{ sf_count_t offset = 0 ; - uint32_t k ; - - for (k = 0 ; k < block ; k++) - offset += info->packet_size [k] ; - - return offset ; -} /* alac_pakt_block_offset */ - -static uint32_t -alac_kuki_read (SF_PRIVATE * psf, uint32_t kuki_offset, uint8_t * kuki, size_t kuki_maxlen) -{ uint32_t marker ; - uint64_t kuki_size ; - - if (psf_fseek (psf, kuki_offset, SEEK_SET) != kuki_offset) - return 0 ; - - psf_fread (&marker, 1, sizeof (marker), psf) ; - if (marker != MAKE_MARKER ('k', 'u', 'k', 'i')) - return 0 ; - - psf_fread (&kuki_size, 1, sizeof (kuki_size), psf) ; - kuki_size = BE2H_64 (kuki_size) ; - - if (kuki_size == 0 || kuki_size > kuki_maxlen) - { psf_log_printf (psf, "%s : Bad size (%D) of 'kuki' chunk.\n", __func__, kuki_size) ; - return 0 ; - } ; - - psf_fread (kuki, 1, kuki_size, psf) ; - - return kuki_size ; -} /* alac_kuki_read */ diff --git a/libs/libsndfile/src/alaw.c b/libs/libsndfile/src/alaw.c deleted file mode 100644 index 81d7696863..0000000000 --- a/libs/libsndfile/src/alaw.c +++ /dev/null @@ -1,548 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include - -#include "sndfile.h" -#include "common.h" - -static sf_count_t alaw_read_alaw2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t alaw_read_alaw2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t alaw_read_alaw2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t alaw_read_alaw2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t alaw_write_s2alaw (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t alaw_write_i2alaw (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t alaw_write_f2alaw (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t alaw_write_d2alaw (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static void alaw2s_array (unsigned char *buffer, int count, short *ptr) ; -static void alaw2i_array (unsigned char *buffer, int count, int *ptr) ; -static void alaw2f_array (unsigned char *buffer, int count, float *ptr, float normfact) ; -static void alaw2d_array (unsigned char *buffer, int count, double *ptr, double normfact) ; - -static void s2alaw_array (const short *buffer, int count, unsigned char *ptr) ; -static void i2alaw_array (const int *buffer, int count, unsigned char *ptr) ; -static void f2alaw_array (const float *buffer, int count, unsigned char *ptr, float normfact) ; -static void d2alaw_array (const double *buffer, int count, unsigned char *ptr, double normfact) ; - - -int -alaw_init (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_READ || psf->file.mode == SFM_RDWR) - { psf->read_short = alaw_read_alaw2s ; - psf->read_int = alaw_read_alaw2i ; - psf->read_float = alaw_read_alaw2f ; - psf->read_double = alaw_read_alaw2d ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { psf->write_short = alaw_write_s2alaw ; - psf->write_int = alaw_write_i2alaw ; - psf->write_float = alaw_write_f2alaw ; - psf->write_double = alaw_write_d2alaw ; - } ; - - psf->bytewidth = 1 ; - psf->blockwidth = psf->sf.channels ; - - if (psf->filelength > psf->dataoffset) - psf->datalength = (psf->dataend) ? psf->dataend - psf->dataoffset : psf->filelength - psf->dataoffset ; - else - psf->datalength = 0 ; - - psf->sf.frames = psf->blockwidth > 0 ? psf->datalength / psf->blockwidth : 0 ; - - return 0 ; -} /* alaw_init */ - -/*============================================================================== - * Private static functions and data. - */ - -static -short alaw_decode [256] = -{ -5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736, - -7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784, - -2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368, - -3776, -3648, -4032, -3904, -3264, -3136, -3520, -3392, - -22016, -20992, -24064, -23040, -17920, -16896, -19968, -18944, - -30208, -29184, -32256, -31232, -26112, -25088, -28160, -27136, - -11008, -10496, -12032, -11520, -8960, -8448, -9984, -9472, - -15104, -14592, -16128, -15616, -13056, -12544, -14080, -13568, - -344, -328, -376, -360, -280, -264, -312, -296, - -472, -456, -504, -488, -408, -392, -440, -424, - -88, -72, -120, -104, -24, -8, -56, -40, - -216, -200, -248, -232, -152, -136, -184, -168, - -1376, -1312, -1504, -1440, -1120, -1056, -1248, -1184, - -1888, -1824, -2016, -1952, -1632, -1568, -1760, -1696, - -688, -656, -752, -720, -560, -528, -624, -592, - -944, -912, -1008, -976, -816, -784, -880, -848, - 5504, 5248, 6016, 5760, 4480, 4224, 4992, 4736, - 7552, 7296, 8064, 7808, 6528, 6272, 7040, 6784, - 2752, 2624, 3008, 2880, 2240, 2112, 2496, 2368, - 3776, 3648, 4032, 3904, 3264, 3136, 3520, 3392, - 22016, 20992, 24064, 23040, 17920, 16896, 19968, 18944, - 30208, 29184, 32256, 31232, 26112, 25088, 28160, 27136, - 11008, 10496, 12032, 11520, 8960, 8448, 9984, 9472, - 15104, 14592, 16128, 15616, 13056, 12544, 14080, 13568, - 344, 328, 376, 360, 280, 264, 312, 296, - 472, 456, 504, 488, 408, 392, 440, 424, - 88, 72, 120, 104, 24, 8, 56, 40, - 216, 200, 248, 232, 152, 136, 184, 168, - 1376, 1312, 1504, 1440, 1120, 1056, 1248, 1184, - 1888, 1824, 2016, 1952, 1632, 1568, 1760, 1696, - 688, 656, 752, 720, 560, 528, 624, 592, - 944, 912, 1008, 976, 816, 784, 880, 848 -} ; /* alaw_decode */ - -static -unsigned char alaw_encode [2048 + 1] = -{ 0xd5, 0xd4, 0xd7, 0xd6, 0xd1, 0xd0, 0xd3, 0xd2, 0xdd, 0xdc, 0xdf, 0xde, - 0xd9, 0xd8, 0xdb, 0xda, 0xc5, 0xc4, 0xc7, 0xc6, 0xc1, 0xc0, 0xc3, 0xc2, - 0xcd, 0xcc, 0xcf, 0xce, 0xc9, 0xc8, 0xcb, 0xca, 0xf5, 0xf5, 0xf4, 0xf4, - 0xf7, 0xf7, 0xf6, 0xf6, 0xf1, 0xf1, 0xf0, 0xf0, 0xf3, 0xf3, 0xf2, 0xf2, - 0xfd, 0xfd, 0xfc, 0xfc, 0xff, 0xff, 0xfe, 0xfe, 0xf9, 0xf9, 0xf8, 0xf8, - 0xfb, 0xfb, 0xfa, 0xfa, 0xe5, 0xe5, 0xe5, 0xe5, 0xe4, 0xe4, 0xe4, 0xe4, - 0xe7, 0xe7, 0xe7, 0xe7, 0xe6, 0xe6, 0xe6, 0xe6, 0xe1, 0xe1, 0xe1, 0xe1, - 0xe0, 0xe0, 0xe0, 0xe0, 0xe3, 0xe3, 0xe3, 0xe3, 0xe2, 0xe2, 0xe2, 0xe2, - 0xed, 0xed, 0xed, 0xed, 0xec, 0xec, 0xec, 0xec, 0xef, 0xef, 0xef, 0xef, - 0xee, 0xee, 0xee, 0xee, 0xe9, 0xe9, 0xe9, 0xe9, 0xe8, 0xe8, 0xe8, 0xe8, - 0xeb, 0xeb, 0xeb, 0xeb, 0xea, 0xea, 0xea, 0xea, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x95, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, - 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x96, 0x96, 0x96, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x93, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9c, 0x9c, 0x9c, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, - 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x99, 0x99, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9a, 0x9a, 0x9a, 0x9a, - 0x9a, 0x9a, 0x9a, 0x9a, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0xb5, 0xb5, 0xb5, 0xb5, - 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, - 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, - 0xb5, 0xb5, 0xb5, 0xb5, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, - 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, - 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, - 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, - 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, - 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb6, 0xb6, 0xb6, 0xb6, - 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, - 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, - 0xb6, 0xb6, 0xb6, 0xb6, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, - 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, - 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, - 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, - 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, - 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb3, 0xb3, 0xb3, 0xb3, - 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, - 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, - 0xb3, 0xb3, 0xb3, 0xb3, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, - 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, - 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, - 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, - 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, - 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbc, 0xbc, 0xbc, 0xbc, - 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, - 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, - 0xbc, 0xbc, 0xbc, 0xbc, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, - 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, - 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, - 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, - 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, - 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xb9, 0xb9, 0xb9, 0xb9, - 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, - 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, - 0xb9, 0xb9, 0xb9, 0xb9, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, - 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, - 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, - 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, - 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, - 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xba, 0xba, 0xba, 0xba, - 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, - 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, - 0xba, 0xba, 0xba, 0xba, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa4, 0xa4, 0xa4, 0xa4, - 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, - 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, - 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, - 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, - 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, - 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, - 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, - 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, - 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, - 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, - 0xa7, 0xa7, 0xa7, 0xa7, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa1, 0xa1, 0xa1, 0xa1, - 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, - 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, - 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, - 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, - 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, - 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, - 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, - 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, - 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, - 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, - 0xa0, 0xa0, 0xa0, 0xa0, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, - 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, - 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, - 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, - 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, - 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa2, 0xa2, 0xa2, 0xa2, - 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, - 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, - 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, - 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, - 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, - 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, - 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, - 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, - 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, - 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, - 0xad, 0xad, 0xad, 0xad, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, - 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, - 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, - 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, - 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, - 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xaf, 0xaf, 0xaf, 0xaf, - 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, - 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, - 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, - 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, - 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, - 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, - 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, - 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, - 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, - 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, - 0xae, 0xae, 0xae, 0xae, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, - 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, - 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, - 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, - 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, - 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa8, 0xa8, 0xa8, 0xa8, - 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, - 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, - 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, - 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, - 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, - 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa -} ; /* alaw_encode */ - -static inline void -alaw2s_array (unsigned char *buffer, int count, short *ptr) -{ while (--count >= 0) - ptr [count] = alaw_decode [(int) buffer [count]] ; -} /* alaw2s_array */ - -static inline void -alaw2i_array (unsigned char *buffer, int count, int *ptr) -{ while (--count >= 0) - ptr [count] = alaw_decode [(int) buffer [count]] << 16 ; -} /* alaw2i_array */ - -static inline void -alaw2f_array (unsigned char *buffer, int count, float *ptr, float normfact) -{ while (--count >= 0) - ptr [count] = normfact * alaw_decode [(int) buffer [count]] ; -} /* alaw2f_array */ - -static inline void -alaw2d_array (unsigned char *buffer, int count, double *ptr, double normfact) -{ while (--count >= 0) - ptr [count] = normfact * alaw_decode [(int) buffer [count]] ; -} /* alaw2d_array */ - -static inline void -s2alaw_array (const short *ptr, int count, unsigned char *buffer) -{ while (--count >= 0) - { if (ptr [count] >= 0) - buffer [count] = alaw_encode [ptr [count] / 16] ; - else - buffer [count] = 0x7F & alaw_encode [ptr [count] / -16] ; - } ; -} /* s2alaw_array */ - -static inline void -i2alaw_array (const int *ptr, int count, unsigned char *buffer) -{ while (--count >= 0) - { if (ptr [count] >= 0) - buffer [count] = alaw_encode [ptr [count] >> (16 + 4)] ; - else - buffer [count] = 0x7F & alaw_encode [- ptr [count] >> (16 + 4)] ; - } ; -} /* i2alaw_array */ - -static inline void -f2alaw_array (const float *ptr, int count, unsigned char *buffer, float normfact) -{ while (--count >= 0) - { if (ptr [count] >= 0) - buffer [count] = alaw_encode [lrintf (normfact * ptr [count])] ; - else - buffer [count] = 0x7F & alaw_encode [- lrintf (normfact * ptr [count])] ; - } ; -} /* f2alaw_array */ - -static inline void -d2alaw_array (const double *ptr, int count, unsigned char *buffer, double normfact) -{ while (--count >= 0) - { if (ptr [count] >= 0) - buffer [count] = alaw_encode [lrint (normfact * ptr [count])] ; - else - buffer [count] = 0x7F & alaw_encode [- lrint (normfact * ptr [count])] ; - } ; -} /* d2alaw_array */ - -/*============================================================================== -*/ - -static sf_count_t -alaw_read_alaw2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ; - alaw2s_array (ubuf.ucbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* alaw_read_alaw2s */ - -static sf_count_t -alaw_read_alaw2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ; - alaw2i_array (ubuf.ucbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* alaw_read_alaw2i */ - -static sf_count_t -alaw_read_alaw2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x8000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ; - alaw2f_array (ubuf.ucbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* alaw_read_alaw2f */ - -static sf_count_t -alaw_read_alaw2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double) ? 1.0 / ((double) 0x8000) : 1.0 ; - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ; - alaw2d_array (ubuf.ucbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* alaw_read_alaw2d */ - -/*============================================================================================= -*/ - -static sf_count_t -alaw_write_s2alaw (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2alaw_array (ptr + total, bufferlen, ubuf.ucbuf) ; - writecount = psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* alaw_write_s2alaw */ - -static sf_count_t -alaw_write_i2alaw (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2alaw_array (ptr + total, bufferlen, ubuf.ucbuf) ; - writecount = psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* alaw_write_i2alaw */ - -static sf_count_t -alaw_write_f2alaw (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - float normfact ; - - normfact = (psf->norm_float == SF_TRUE) ? (1.0 * 0x7FFF) / 16.0 : 1.0 / 16 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - f2alaw_array (ptr + total, bufferlen, ubuf.ucbuf, normfact) ; - writecount = psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* alaw_write_f2alaw */ - -static sf_count_t -alaw_write_d2alaw (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double) ? (1.0 * 0x7FFF) / 16.0 : 1.0 / 16.0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - d2alaw_array (ptr + total, bufferlen, ubuf.ucbuf, normfact) ; - writecount = psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* alaw_write_d2alaw */ - diff --git a/libs/libsndfile/src/au.c b/libs/libsndfile/src/au.c deleted file mode 100644 index bcd869a70a..0000000000 --- a/libs/libsndfile/src/au.c +++ /dev/null @@ -1,450 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues. -*/ - -#define DOTSND_MARKER (MAKE_MARKER ('.', 's', 'n', 'd')) -#define DNSDOT_MARKER (MAKE_MARKER ('d', 'n', 's', '.')) - -#define AU_DATA_OFFSET 24 - -/*------------------------------------------------------------------------------ -** Known AU file encoding types. -*/ - -enum -{ AU_ENCODING_ULAW_8 = 1, /* 8-bit u-law samples */ - AU_ENCODING_PCM_8 = 2, /* 8-bit linear samples */ - AU_ENCODING_PCM_16 = 3, /* 16-bit linear samples */ - AU_ENCODING_PCM_24 = 4, /* 24-bit linear samples */ - AU_ENCODING_PCM_32 = 5, /* 32-bit linear samples */ - - AU_ENCODING_FLOAT = 6, /* floating-point samples */ - AU_ENCODING_DOUBLE = 7, /* double-precision float samples */ - AU_ENCODING_INDIRECT = 8, /* fragmented sampled data */ - AU_ENCODING_NESTED = 9, /* ? */ - AU_ENCODING_DSP_CORE = 10, /* DSP program */ - AU_ENCODING_DSP_DATA_8 = 11, /* 8-bit fixed-point samples */ - AU_ENCODING_DSP_DATA_16 = 12, /* 16-bit fixed-point samples */ - AU_ENCODING_DSP_DATA_24 = 13, /* 24-bit fixed-point samples */ - AU_ENCODING_DSP_DATA_32 = 14, /* 32-bit fixed-point samples */ - - AU_ENCODING_DISPLAY = 16, /* non-audio display data */ - AU_ENCODING_MULAW_SQUELCH = 17, /* ? */ - AU_ENCODING_EMPHASIZED = 18, /* 16-bit linear with emphasis */ - AU_ENCODING_NEXT = 19, /* 16-bit linear with compression (NEXT) */ - AU_ENCODING_COMPRESSED_EMPHASIZED = 20, /* A combination of the two above */ - AU_ENCODING_DSP_COMMANDS = 21, /* Music Kit DSP commands */ - AU_ENCODING_DSP_COMMANDS_SAMPLES = 22, /* ? */ - - AU_ENCODING_ADPCM_G721_32 = 23, /* G721 32 kbs ADPCM - 4 bits per sample. */ - AU_ENCODING_ADPCM_G722 = 24, /* G722 64 kbs ADPCM */ - AU_ENCODING_ADPCM_G723_24 = 25, /* G723 24 kbs ADPCM - 3 bits per sample. */ - AU_ENCODING_ADPCM_G723_40 = 26, /* G723 40 kbs ADPCM - 5 bits per sample. */ - - AU_ENCODING_ALAW_8 = 27 -} ; - -/*------------------------------------------------------------------------------ -** Typedefs. -*/ - -typedef struct -{ int dataoffset ; - int datasize ; - int encoding ; - int samplerate ; - int channels ; -} AU_FMT ; - - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int au_close (SF_PRIVATE *psf) ; - -static int au_format_to_encoding (int format) ; - -static int au_write_header (SF_PRIVATE *psf, int calc_length) ; -static int au_read_header (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -au_open (SF_PRIVATE *psf) -{ int subformat ; - int error = 0 ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = au_read_header (psf))) - return error ; - } ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_AU) - return SFE_BAD_OPEN_FORMAT ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { psf->endian = SF_ENDIAN (psf->sf.format) ; - if (CPU_IS_LITTLE_ENDIAN && psf->endian == SF_ENDIAN_CPU) - psf->endian = SF_ENDIAN_LITTLE ; - else if (psf->endian != SF_ENDIAN_LITTLE) - psf->endian = SF_ENDIAN_BIG ; - - if (au_write_header (psf, SF_FALSE)) - return psf->error ; - - psf->write_header = au_write_header ; - } ; - - psf->container_close = au_close ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - switch (subformat) - { case SF_FORMAT_ULAW : /* 8-bit Ulaw encoding. */ - ulaw_init (psf) ; - break ; - - case SF_FORMAT_PCM_S8 : /* 8-bit linear PCM. */ - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_PCM_16 : /* 16-bit linear PCM. */ - case SF_FORMAT_PCM_24 : /* 24-bit linear PCM */ - case SF_FORMAT_PCM_32 : /* 32-bit linear PCM. */ - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_ALAW : /* 8-bit Alaw encoding. */ - alaw_init (psf) ; - break ; - - /* Lite remove start */ - case SF_FORMAT_FLOAT : /* 32-bit floats. */ - error = float32_init (psf) ; - break ; - - case SF_FORMAT_DOUBLE : /* 64-bit double precision floats. */ - error = double64_init (psf) ; - break ; - - case SF_FORMAT_G721_32 : - error = g72x_init (psf) ; - psf->sf.seekable = SF_FALSE ; - break ; - - case SF_FORMAT_G723_24 : - error = g72x_init (psf) ; - psf->sf.seekable = SF_FALSE ; - break ; - - case SF_FORMAT_G723_40 : - error = g72x_init (psf) ; - psf->sf.seekable = SF_FALSE ; - break ; - /* Lite remove end */ - - default : break ; - } ; - - return error ; -} /* au_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -au_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - au_write_header (psf, SF_TRUE) ; - - return 0 ; -} /* au_close */ - -static int -au_write_header (SF_PRIVATE *psf, int calc_length) -{ sf_count_t current ; - int encoding, datalength ; - - if (psf->pipeoffset > 0) - return 0 ; - - current = psf_ftell (psf) ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - } ; - - encoding = au_format_to_encoding (SF_CODEC (psf->sf.format)) ; - if (! encoding) - return (psf->error = SFE_BAD_OPEN_FORMAT) ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - - /* - ** Only attempt to seek if we are not writng to a pipe. If we are - ** writing to a pipe we shouldn't be here anyway. - */ - if (psf->is_pipe == SF_FALSE) - psf_fseek (psf, 0, SEEK_SET) ; - - /* - ** AU format files allow a datalength value of -1 if the datalength - ** is not know at the time the header is written. - ** Also use this value of -1 if the datalength > 2 gigabytes. - */ - if (psf->datalength < 0 || psf->datalength > 0x7FFFFFFF) - datalength = -1 ; - else - datalength = (int) (psf->datalength & 0x7FFFFFFF) ; - - if (psf->endian == SF_ENDIAN_BIG) - { psf_binheader_writef (psf, "Em4", DOTSND_MARKER, AU_DATA_OFFSET) ; - psf_binheader_writef (psf, "E4444", datalength, encoding, psf->sf.samplerate, psf->sf.channels) ; - } - else if (psf->endian == SF_ENDIAN_LITTLE) - { psf_binheader_writef (psf, "em4", DNSDOT_MARKER, AU_DATA_OFFSET) ; - psf_binheader_writef (psf, "e4444", datalength, encoding, psf->sf.samplerate, psf->sf.channels) ; - } - else - return (psf->error = SFE_BAD_OPEN_FORMAT) ; - - /* Header construction complete so write it out. */ - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* au_write_header */ - -static int -au_format_to_encoding (int format) -{ - switch (format) - { case SF_FORMAT_PCM_S8 : return AU_ENCODING_PCM_8 ; - case SF_FORMAT_PCM_16 : return AU_ENCODING_PCM_16 ; - case SF_FORMAT_PCM_24 : return AU_ENCODING_PCM_24 ; - case SF_FORMAT_PCM_32 : return AU_ENCODING_PCM_32 ; - - case SF_FORMAT_FLOAT : return AU_ENCODING_FLOAT ; - case SF_FORMAT_DOUBLE : return AU_ENCODING_DOUBLE ; - - case SF_FORMAT_ULAW : return AU_ENCODING_ULAW_8 ; - case SF_FORMAT_ALAW : return AU_ENCODING_ALAW_8 ; - - case SF_FORMAT_G721_32 : return AU_ENCODING_ADPCM_G721_32 ; - case SF_FORMAT_G723_24 : return AU_ENCODING_ADPCM_G723_24 ; - case SF_FORMAT_G723_40 : return AU_ENCODING_ADPCM_G723_40 ; - - default : break ; - } ; - return 0 ; -} /* au_format_to_encoding */ - -static int -au_read_header (SF_PRIVATE *psf) -{ AU_FMT au_fmt ; - int marker, dword ; - - memset (&au_fmt, 0, sizeof (au_fmt)) ; - psf_binheader_readf (psf, "pm", 0, &marker) ; - psf_log_printf (psf, "%M\n", marker) ; - - if (marker == DOTSND_MARKER) - { psf->endian = SF_ENDIAN_BIG ; - - psf_binheader_readf (psf, "E44444", &(au_fmt.dataoffset), &(au_fmt.datasize), - &(au_fmt.encoding), &(au_fmt.samplerate), &(au_fmt.channels)) ; - } - else if (marker == DNSDOT_MARKER) - { psf->endian = SF_ENDIAN_LITTLE ; - psf_binheader_readf (psf, "e44444", &(au_fmt.dataoffset), &(au_fmt.datasize), - &(au_fmt.encoding), &(au_fmt.samplerate), &(au_fmt.channels)) ; - } - else - return SFE_AU_NO_DOTSND ; - - psf_log_printf (psf, " Data Offset : %d\n", au_fmt.dataoffset) ; - - if (psf->fileoffset > 0 && au_fmt.datasize == -1) - { psf_log_printf (psf, " Data Size : -1\n") ; - return SFE_AU_EMBED_BAD_LEN ; - } ; - - if (psf->fileoffset > 0) - { psf->filelength = au_fmt.dataoffset + au_fmt.datasize ; - psf_log_printf (psf, " Data Size : %d\n", au_fmt.datasize) ; - } - else if (au_fmt.datasize == -1 || au_fmt.dataoffset + au_fmt.datasize == psf->filelength) - psf_log_printf (psf, " Data Size : %d\n", au_fmt.datasize) ; - else if (au_fmt.dataoffset + au_fmt.datasize < psf->filelength) - { psf->filelength = au_fmt.dataoffset + au_fmt.datasize ; - psf_log_printf (psf, " Data Size : %d\n", au_fmt.datasize) ; - } - else - { dword = psf->filelength - au_fmt.dataoffset ; - psf_log_printf (psf, " Data Size : %d (should be %d)\n", au_fmt.datasize, dword) ; - au_fmt.datasize = dword ; - } ; - - psf->dataoffset = au_fmt.dataoffset ; - psf->datalength = psf->filelength - psf->dataoffset ; - - if (psf_ftell (psf) < psf->dataoffset) - psf_binheader_readf (psf, "j", psf->dataoffset - psf_ftell (psf)) ; - - psf->sf.samplerate = au_fmt.samplerate ; - psf->sf.channels = au_fmt.channels ; - - /* Only fill in type major. */ - if (psf->endian == SF_ENDIAN_BIG) - psf->sf.format = SF_FORMAT_AU ; - else if (psf->endian == SF_ENDIAN_LITTLE) - psf->sf.format = SF_ENDIAN_LITTLE | SF_FORMAT_AU ; - - psf_log_printf (psf, " Encoding : %d => ", au_fmt.encoding) ; - - psf->sf.format = SF_ENDIAN (psf->sf.format) ; - - switch (au_fmt.encoding) - { case AU_ENCODING_ULAW_8 : - psf->sf.format |= SF_FORMAT_AU | SF_FORMAT_ULAW ; - psf->bytewidth = 1 ; /* Before decoding */ - psf_log_printf (psf, "8-bit ISDN u-law\n") ; - break ; - - case AU_ENCODING_PCM_8 : - psf->sf.format |= SF_FORMAT_AU | SF_FORMAT_PCM_S8 ; - psf->bytewidth = 1 ; - psf_log_printf (psf, "8-bit linear PCM\n") ; - break ; - - case AU_ENCODING_PCM_16 : - psf->sf.format |= SF_FORMAT_AU | SF_FORMAT_PCM_16 ; - psf->bytewidth = 2 ; - psf_log_printf (psf, "16-bit linear PCM\n") ; - break ; - - case AU_ENCODING_PCM_24 : - psf->sf.format |= SF_FORMAT_AU | SF_FORMAT_PCM_24 ; - psf->bytewidth = 3 ; - psf_log_printf (psf, "24-bit linear PCM\n") ; - break ; - - case AU_ENCODING_PCM_32 : - psf->sf.format |= SF_FORMAT_AU | SF_FORMAT_PCM_32 ; - psf->bytewidth = 4 ; - psf_log_printf (psf, "32-bit linear PCM\n") ; - break ; - - case AU_ENCODING_FLOAT : - psf->sf.format |= SF_FORMAT_AU | SF_FORMAT_FLOAT ; - psf->bytewidth = 4 ; - psf_log_printf (psf, "32-bit float\n") ; - break ; - - case AU_ENCODING_DOUBLE : - psf->sf.format |= SF_FORMAT_AU | SF_FORMAT_DOUBLE ; - psf->bytewidth = 8 ; - psf_log_printf (psf, "64-bit double precision float\n") ; - break ; - - case AU_ENCODING_ALAW_8 : - psf->sf.format |= SF_FORMAT_AU | SF_FORMAT_ALAW ; - psf->bytewidth = 1 ; /* Before decoding */ - psf_log_printf (psf, "8-bit ISDN A-law\n") ; - break ; - - case AU_ENCODING_ADPCM_G721_32 : - psf->sf.format |= SF_FORMAT_AU | SF_FORMAT_G721_32 ; - psf->bytewidth = 0 ; - psf_log_printf (psf, "G721 32kbs ADPCM\n") ; - break ; - - case AU_ENCODING_ADPCM_G723_24 : - psf->sf.format |= SF_FORMAT_AU | SF_FORMAT_G723_24 ; - psf->bytewidth = 0 ; - psf_log_printf (psf, "G723 24kbs ADPCM\n") ; - break ; - - case AU_ENCODING_ADPCM_G723_40 : - psf->sf.format |= SF_FORMAT_AU | SF_FORMAT_G723_40 ; - psf->bytewidth = 0 ; - psf_log_printf (psf, "G723 40kbs ADPCM\n") ; - break ; - - case AU_ENCODING_ADPCM_G722 : - psf_log_printf (psf, "G722 64 kbs ADPCM (unsupported)\n") ; - break ; - - case AU_ENCODING_NEXT : - psf_log_printf (psf, "Weird NeXT encoding format (unsupported)\n") ; - break ; - - default : - psf_log_printf (psf, "Unknown!!\n") ; - break ; - } ; - - psf_log_printf (psf, " Sample Rate : %d\n", au_fmt.samplerate) ; - if (au_fmt.channels < 1) - { psf_log_printf (psf, " Channels : %d **** should be >= 1\n", au_fmt.channels) ; - return SFE_CHANNEL_COUNT_ZERO ; - } - else - psf_log_printf (psf, " Channels : %d\n", au_fmt.channels) ; - - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - - if (! psf->sf.frames && psf->blockwidth) - psf->sf.frames = (psf->filelength - psf->dataoffset) / psf->blockwidth ; - - return 0 ; -} /* au_read_header */ - diff --git a/libs/libsndfile/src/audio_detect.c b/libs/libsndfile/src/audio_detect.c deleted file mode 100644 index 9cac83bcff..0000000000 --- a/libs/libsndfile/src/audio_detect.c +++ /dev/null @@ -1,105 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include "sfconfig.h" - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include -#include - -#include "common.h" - -typedef struct -{ int le_float ; - int be_float ; - int le_int_24_32 ; - int be_int_24_32 ; -} VOTE ; - - -static void vote_for_format (VOTE * vote, const unsigned char * data, int datalen) ; - -int -audio_detect (SF_PRIVATE * psf, AUDIO_DETECT *ad, const unsigned char * data, int datalen) -{ VOTE vote ; - - if (psf == NULL) - return 0 ; - - if (ad == NULL || datalen < 256) - return 0 ; - - vote_for_format (&vote, data, datalen) ; - - psf_log_printf (psf, "audio_detect :\n" - " le_float : %d\n" - " be_float : %d\n" - " le_int_24_32 : %d\n" - " be_int_24_32 : %d\n", - vote.le_float, vote.be_float, vote.le_int_24_32, vote.be_int_24_32) ; - - if (0) puts (psf->parselog.buf) ; - - if (ad->endianness == SF_ENDIAN_LITTLE && vote.le_float > (3 * datalen) / 4) - { /* Almost certainly 32 bit floats. */ - return SF_FORMAT_FLOAT ; - } ; - - if (ad->endianness == SF_ENDIAN_LITTLE && vote.le_int_24_32 > (3 * datalen) / 4) - { /* Almost certainly 24 bit data stored in 32 bit ints. */ - return SF_FORMAT_PCM_32 ; - } ; - - return 0 ; -} /* data_detect */ - -static void -vote_for_format (VOTE * vote, const unsigned char * data, int datalen) -{ - int k ; - - memset (vote, 0, sizeof (VOTE)) ; - - datalen -= datalen % 4 ; - - for (k = 0 ; k < datalen ; k ++) - { if ((k % 4) == 0) - { if (data [k] == 0 && data [k + 1] != 0) - vote->le_int_24_32 += 4 ; - - if (data [2] != 0 && data [3] == 0) - vote->le_int_24_32 += 4 ; - - if (data [0] != 0 && data [3] > 0x43 && data [3] < 0x4B) - vote->le_float += 4 ; - - if (data [3] != 0 && data [0] > 0x43 && data [0] < 0x4B) - vote->be_float += 4 ; - } ; - } ; - - return ; -} /* vote_for_format */ - diff --git a/libs/libsndfile/src/avr.c b/libs/libsndfile/src/avr.c deleted file mode 100644 index a235b0d7a4..0000000000 --- a/libs/libsndfile/src/avr.c +++ /dev/null @@ -1,246 +0,0 @@ -/* -** Copyright (C) 2004-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#define TWOBIT_MARKER (MAKE_MARKER ('2', 'B', 'I', 'T')) -#define AVR_HDR_SIZE 128 - -#define SFE_AVR_X 666 - -/* -** From: hyc@hanauma.Jpl.Nasa.Gov (Howard Chu) -** -** A lot of PD software exists to play Mac .snd files on the ST. One other -** format that seems pretty popular (used by a number of commercial packages) -** is the AVR format (from Audio Visual Research). This format has a 128 byte -** header that looks like this (its actually packed, but thats not portable): -*/ - -typedef struct -{ int marker ; /* 2BIT */ - char name [8] ; /* null-padded sample name */ - short mono ; /* 0 = mono, 0xffff = stereo */ - short rez ; /* 8 = 8 bit, 16 = 16 bit */ - short sign ; /* 0 = unsigned, 0xffff = signed */ - - short loop ; /* 0 = no loop, 0xffff = looping sample */ - short midi ; /* 0xffff = no MIDI note assigned, */ - /* 0xffXX = single key note assignment */ - /* 0xLLHH = key split, low/hi note */ - int srate ; /* sample frequency in hertz */ - int frames ; /* sample length in bytes or words (see rez) */ - int lbeg ; /* offset to start of loop in bytes or words. */ - /* set to zero if unused */ - int lend ; /* offset to end of loop in bytes or words. */ - /* set to sample length if unused */ - short res1 ; /* Reserved, MIDI keyboard split */ - short res2 ; /* Reserved, sample compression */ - short res3 ; /* Reserved */ - char ext [20] ; /* Additional filename space, used if (name[7] != 0) */ - char user [64] ; /* User defined. Typically ASCII message */ -} AVR_HEADER ; - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int avr_close (SF_PRIVATE *psf) ; - -static int avr_read_header (SF_PRIVATE *psf) ; -static int avr_write_header (SF_PRIVATE *psf, int calc_length) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -avr_open (SF_PRIVATE *psf) -{ int error = 0 ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = avr_read_header (psf))) - return error ; - } ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_AVR) - return SFE_BAD_OPEN_FORMAT ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { psf->endian = SF_ENDIAN_BIG ; - - if (avr_write_header (psf, SF_FALSE)) - return psf->error ; - - psf->write_header = avr_write_header ; - } ; - - psf->container_close = avr_close ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - error = pcm_init (psf) ; - - return error ; -} /* avr_open */ - -static int -avr_read_header (SF_PRIVATE *psf) -{ AVR_HEADER hdr ; - - memset (&hdr, 0, sizeof (hdr)) ; - - psf_binheader_readf (psf, "pmb", 0, &hdr.marker, &hdr.name, sizeof (hdr.name)) ; - psf_log_printf (psf, "%M\n", hdr.marker) ; - - if (hdr.marker != TWOBIT_MARKER) - return SFE_AVR_X ; - - psf_log_printf (psf, " Name : %s\n", hdr.name) ; - - psf_binheader_readf (psf, "E22222", &hdr.mono, &hdr.rez, &hdr.sign, &hdr.loop, &hdr.midi) ; - - psf->sf.channels = (hdr.mono & 1) + 1 ; - - psf_log_printf (psf, " Channels : %d\n Bit width : %d\n Signed : %s\n", - (hdr.mono & 1) + 1, hdr.rez, hdr.sign ? "yes" : "no") ; - - switch ((hdr.rez << 16) + (hdr.sign & 1)) - { case ((8 << 16) + 0) : - psf->sf.format = SF_FORMAT_AVR | SF_FORMAT_PCM_U8 ; - psf->bytewidth = 1 ; - break ; - - case ((8 << 16) + 1) : - psf->sf.format = SF_FORMAT_AVR | SF_FORMAT_PCM_S8 ; - psf->bytewidth = 1 ; - break ; - - case ((16 << 16) + 1) : - psf->sf.format = SF_FORMAT_AVR | SF_FORMAT_PCM_16 ; - psf->bytewidth = 2 ; - break ; - - default : - psf_log_printf (psf, "Error : bad rez/sign combination.\n") ; - return SFE_AVR_X ; - } ; - - psf_binheader_readf (psf, "E4444", &hdr.srate, &hdr.frames, &hdr.lbeg, &hdr.lend) ; - - psf->sf.frames = hdr.frames ; - psf->sf.samplerate = hdr.srate ; - - psf_log_printf (psf, " Frames : %D\n", psf->sf.frames) ; - psf_log_printf (psf, " Sample rate : %d\n", psf->sf.samplerate) ; - - psf_binheader_readf (psf, "E222", &hdr.res1, &hdr.res2, &hdr.res3) ; - psf_binheader_readf (psf, "bb", hdr.ext, sizeof (hdr.ext), hdr.user, sizeof (hdr.user)) ; - - psf_log_printf (psf, " Ext : %s\n User : %s\n", hdr.ext, hdr.user) ; - - psf->endian = SF_ENDIAN_BIG ; - - psf->dataoffset = AVR_HDR_SIZE ; - psf->datalength = hdr.frames * (hdr.rez / 8) ; - - if (psf->fileoffset > 0) - psf->filelength = AVR_HDR_SIZE + psf->datalength ; - - if (psf_ftell (psf) != psf->dataoffset) - psf_binheader_readf (psf, "j", psf->dataoffset - psf_ftell (psf)) ; - - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - - if (psf->sf.frames == 0 && psf->blockwidth) - psf->sf.frames = (psf->filelength - psf->dataoffset) / psf->blockwidth ; - - return 0 ; -} /* avr_read_header */ - -static int -avr_write_header (SF_PRIVATE *psf, int calc_length) -{ sf_count_t current ; - int sign ; - - if (psf->pipeoffset > 0) - return 0 ; - - current = psf_ftell (psf) ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - - /* - ** Only attempt to seek if we are not writng to a pipe. If we are - ** writing to a pipe we shouldn't be here anyway. - */ - if (psf->is_pipe == SF_FALSE) - psf_fseek (psf, 0, SEEK_SET) ; - - psf_binheader_writef (psf, "Emz22", TWOBIT_MARKER, make_size_t (8), - psf->sf.channels == 2 ? 0xFFFF : 0, psf->bytewidth * 8) ; - - sign = ((SF_CODEC (psf->sf.format)) == SF_FORMAT_PCM_U8) ? 0 : 0xFFFF ; - - psf_binheader_writef (psf, "E222", sign, 0, 0xFFFF) ; - psf_binheader_writef (psf, "E4444", psf->sf.samplerate, psf->sf.frames, 0, 0) ; - - psf_binheader_writef (psf, "E222zz", 0, 0, 0, make_size_t (20), make_size_t (64)) ; - - /* Header construction complete so write it out. */ - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* avr_write_header */ - -static int -avr_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - avr_write_header (psf, SF_TRUE) ; - - return 0 ; -} /* avr_close */ - diff --git a/libs/libsndfile/src/binheader_writef_check.py b/libs/libsndfile/src/binheader_writef_check.py deleted file mode 100644 index 6ee609e010..0000000000 --- a/libs/libsndfile/src/binheader_writef_check.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/python - -# Copyright (C) 2006-2011 Erik de Castro Lopo -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the author nor the names of any contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -# This parses C code using regexes (yes, thats horrible) and makes sure -# that calling conventions to the function psf_binheader_writef are -# correct. - - - -import re, string, sys - -_whitespace_re = re.compile ("\s+", re.MULTILINE) - -def find_binheader_writefs (data): - lst = re.findall ('psf_binheader_writef\s*\(\s*[a-zA-Z_]+\s*,\s*\"[^;]+;', data, re.MULTILINE) - return [_whitespace_re.sub (" ", x) for x in lst] - -def find_format_string (s): - fmt = re.search ('"([^"]+)"', s) - if not fmt: - print ("Bad format in :\n\n\t%s\n\n" % s) - sys.exit (1) - fmt = fmt.groups () - if len (fmt) != 1: - print ("Bad format in :\n\n\t%s\n\n" % s) - sys.exit (1) - return _whitespace_re.sub ("", fmt [0]) - -def get_param_list (data): - dlist = re.search ("\((.+)\)\s*;", data) - dlist = dlist.groups ()[0] - dlist = dlist.split(",") - dlist = [x.strip() for x in dlist] - return dlist [2:] - -def handle_file (fname): - errors = 0 - data = open (fname, "r").read () - - writefs = find_binheader_writefs (data) - for item in writefs: - fmt = find_format_string (item) - params = get_param_list (item) - param_index = 0 - - # print item - - for ch in fmt: - if ch in 'Eet ': - continue - - # print " param [%d] %c : %s" % (param_index, ch, params [param_index]) - - if ch != 'b': - param_index += 1 - continue - - # print item - # print " param [%d] %c : %s <-> %s" % (param_index, ch, params [param_index], params [param_index + 1]) - - # print (params [param_index + 1]) - if params [param_index + 1].find ("sizeof") < 0 \ - and params [param_index + 1].find ("make_size_t") < 0 \ - and params [param_index + 1].find ("strlen") < 0: - if errors == 0: sys.stdout.write ("\n") - print ("\n%s :" % fname) - print (" param [%d] %c : %s <-> %s" % (param_index, ch, params [param_index], params [param_index + 1])) - print (" %s" % item) - errors += 1 - param_index += 2 - - return errors - -#=============================================================================== - -if len (sys.argv) > 1: - sys.stdout.write ("\n binheader_writef_check :") - sys.stdout.flush () - errors = 0 - for fname in sys.argv [1:]: - errors += handle_file (fname) - if errors > 0: - print ("\nErrors : %d\n" % errors) - sys.exit (1) - -print ("ok\n") - diff --git a/libs/libsndfile/src/broadcast.c b/libs/libsndfile/src/broadcast.c deleted file mode 100644 index 128a6a2c55..0000000000 --- a/libs/libsndfile/src/broadcast.c +++ /dev/null @@ -1,191 +0,0 @@ -/* -** Copyright (C) 2006-2013 Erik de Castro Lopo -** Copyright (C) 2006 Paul Davis -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#include "common.h" - - -static int gen_coding_history (char * added_history, int added_history_max, const SF_INFO * psfinfo) ; - -static inline size_t -bc_min_size (const SF_BROADCAST_INFO* info) -{ if (info == NULL) - return 0 ; - - return offsetof (SF_BROADCAST_INFO, coding_history) + info->coding_history_size ; -} /* bc_min_size */ - -SF_BROADCAST_INFO_16K* -broadcast_var_alloc (void) -{ return calloc (1, sizeof (SF_BROADCAST_INFO_16K)) ; -} /* broadcast_var_alloc */ - -int -broadcast_var_set (SF_PRIVATE *psf, const SF_BROADCAST_INFO * info, size_t datasize) -{ size_t len ; - - if (info == NULL) - return SF_FALSE ; - - if (bc_min_size (info) > datasize) - { psf->error = SFE_BAD_BROADCAST_INFO_SIZE ; - return SF_FALSE ; - } ; - - if (datasize >= sizeof (SF_BROADCAST_INFO_16K)) - { psf->error = SFE_BAD_BROADCAST_INFO_TOO_BIG ; - return SF_FALSE ; - } ; - - if (psf->broadcast_16k == NULL) - { if ((psf->broadcast_16k = broadcast_var_alloc ()) == NULL) - { psf->error = SFE_MALLOC_FAILED ; - return SF_FALSE ; - } ; - } ; - - /* Only copy the first part of the struct. */ - memcpy (psf->broadcast_16k, info, offsetof (SF_BROADCAST_INFO, coding_history)) ; - - psf_strlcpy_crlf (psf->broadcast_16k->coding_history, info->coding_history, sizeof (psf->broadcast_16k->coding_history), datasize - offsetof (SF_BROADCAST_INFO, coding_history)) ; - len = strlen (psf->broadcast_16k->coding_history) ; - - if (len > 0 && psf->broadcast_16k->coding_history [len - 1] != '\n') - psf_strlcat (psf->broadcast_16k->coding_history, sizeof (psf->broadcast_16k->coding_history), "\r\n") ; - - if (psf->file.mode == SFM_WRITE) - { char added_history [256] ; - - gen_coding_history (added_history, sizeof (added_history), &(psf->sf)) ; - psf_strlcat (psf->broadcast_16k->coding_history, sizeof (psf->broadcast_16k->coding_history), added_history) ; - } ; - - /* Force coding_history_size to be even. */ - len = strlen (psf->broadcast_16k->coding_history) ; - len += (len & 1) ? 1 : 0 ; - psf->broadcast_16k->coding_history_size = len ; - - /* Currently writing this version. */ - psf->broadcast_16k->version = 1 ; - - return SF_TRUE ; -} /* broadcast_var_set */ - - -int -broadcast_var_get (SF_PRIVATE *psf, SF_BROADCAST_INFO * data, size_t datasize) -{ size_t size ; - - if (psf->broadcast_16k == NULL) - return SF_FALSE ; - - size = SF_MIN (datasize, bc_min_size ((const SF_BROADCAST_INFO *) psf->broadcast_16k)) ; - - memcpy (data, psf->broadcast_16k, size) ; - - return SF_TRUE ; -} /* broadcast_var_get */ - -/*------------------------------------------------------------------------------ -*/ - -static int -gen_coding_history (char * added_history, int added_history_max, const SF_INFO * psfinfo) -{ char chnstr [16] ; - int count, width ; - - /* - ** From : http://www.sr.se/utveckling/tu/bwf/docs/codhist2.htm - ** - ** Parameter Variable string Unit - ** ========================================================================================== - ** Coding Algorithm A= - ** Sampling frequency F=<11000,22050,24000,32000,44100,48000> [Hz] - ** Bit-rate B= - ** Word Length W=<8, 12, 14, 16, 18, 20, 22, 24> [bits] - ** Mode M= - ** Text, free string T= - */ - - switch (psfinfo->channels) - { case 0 : - return SF_FALSE ; - - case 1 : - psf_strlcpy (chnstr, sizeof (chnstr), "mono") ; - break ; - - case 2 : - psf_strlcpy (chnstr, sizeof (chnstr), "stereo") ; - break ; - - default : - snprintf (chnstr, sizeof (chnstr), "%uchn", psfinfo->channels) ; - break ; - } ; - - switch (SF_CODEC (psfinfo->format)) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_S8 : - width = 8 ; - break ; - case SF_FORMAT_PCM_16 : - width = 16 ; - break ; - case SF_FORMAT_PCM_24 : - width = 24 ; - break ; - case SF_FORMAT_PCM_32 : - width = 32 ; - break ; - case SF_FORMAT_FLOAT : - width = 24 ; /* Bits in the mantissa + 1 */ - break ; - case SF_FORMAT_DOUBLE : - width = 53 ; /* Bits in the mantissa + 1 */ - break ; - case SF_FORMAT_ULAW : - case SF_FORMAT_ALAW : - width = 12 ; - break ; - default : - width = 42 ; - break ; - } ; - - count = snprintf (added_history, added_history_max, - "A=PCM,F=%u,W=%d,M=%s,T=%s-%s\r\n", - psfinfo->samplerate, width, chnstr, PACKAGE, VERSION) ; - - if (count >= added_history_max) - return 0 ; - - return count ; -} /* gen_coding_history */ - diff --git a/libs/libsndfile/src/caf.c b/libs/libsndfile/src/caf.c deleted file mode 100644 index 8f95d781eb..0000000000 --- a/libs/libsndfile/src/caf.c +++ /dev/null @@ -1,804 +0,0 @@ -/* -** Copyright (C) 2005-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#ifdef HAVE_INTTYPES_H -#include -#endif - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" -#include "chanmap.h" - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues. -*/ - -#define aac_MARKER MAKE_MARKER ('a', 'a', 'c', ' ') -#define alac_MARKER MAKE_MARKER ('a', 'l', 'a', 'c') -#define alaw_MARKER MAKE_MARKER ('a', 'l', 'a', 'w') -#define caff_MARKER MAKE_MARKER ('c', 'a', 'f', 'f') -#define chan_MARKER MAKE_MARKER ('c', 'h', 'a', 'n') -#define data_MARKER MAKE_MARKER ('d', 'a', 't', 'a') -#define desc_MARKER MAKE_MARKER ('d', 'e', 's', 'c') -#define edct_MARKER MAKE_MARKER ('e', 'd', 'c', 't') -#define free_MARKER MAKE_MARKER ('f', 'r', 'e', 'e') -#define ima4_MARKER MAKE_MARKER ('i', 'm', 'a', '4') -#define info_MARKER MAKE_MARKER ('i', 'n', 'f', 'o') -#define inst_MARKER MAKE_MARKER ('i', 'n', 's', 't') -#define kuki_MARKER MAKE_MARKER ('k', 'u', 'k', 'i') -#define lpcm_MARKER MAKE_MARKER ('l', 'p', 'c', 'm') -#define mark_MARKER MAKE_MARKER ('m', 'a', 'r', 'k') -#define midi_MARKER MAKE_MARKER ('m', 'i', 'd', 'i') -#define mp1_MARKER MAKE_MARKER ('.', 'm', 'p', '1') -#define mp2_MARKER MAKE_MARKER ('.', 'm', 'p', '2') -#define mp3_MARKER MAKE_MARKER ('.', 'm', 'p', '3') -#define ovvw_MARKER MAKE_MARKER ('o', 'v', 'v', 'w') -#define pakt_MARKER MAKE_MARKER ('p', 'a', 'k', 't') -#define peak_MARKER MAKE_MARKER ('p', 'e', 'a', 'k') -#define regn_MARKER MAKE_MARKER ('r', 'e', 'g', 'n') -#define strg_MARKER MAKE_MARKER ('s', 't', 'r', 'g') -#define umid_MARKER MAKE_MARKER ('u', 'm', 'i', 'd') -#define uuid_MARKER MAKE_MARKER ('u', 'u', 'i', 'd') -#define ulaw_MARKER MAKE_MARKER ('u', 'l', 'a', 'w') -#define MAC3_MARKER MAKE_MARKER ('M', 'A', 'C', '3') -#define MAC6_MARKER MAKE_MARKER ('M', 'A', 'C', '6') - -#define CAF_PEAK_CHUNK_SIZE(ch) ((int) (sizeof (int) + ch * (sizeof (float) + 8))) - -#define SFE_CAF_NOT_CAF 666 -#define SFE_CAF_NO_DESC 667 -#define SFE_CAF_BAD_PEAK 668 - -/*------------------------------------------------------------------------------ -** Typedefs. -*/ - -typedef struct -{ uint8_t srate [8] ; - uint32_t fmt_id ; - uint32_t fmt_flags ; - uint32_t pkt_bytes ; - uint32_t frames_per_packet ; - uint32_t channels_per_frame ; - uint32_t bits_per_chan ; -} DESC_CHUNK ; - -typedef struct -{ int chanmap_tag ; - - ALAC_DECODER_INFO alac ; -} CAF_PRIVATE ; - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int caf_close (SF_PRIVATE *psf) ; -static int caf_read_header (SF_PRIVATE *psf) ; -static int caf_write_header (SF_PRIVATE *psf, int calc_length) ; -static int caf_command (SF_PRIVATE *psf, int command, void *data, int datasize) ; -static int caf_read_chanmap (SF_PRIVATE * psf, sf_count_t chunk_size) ; - -static int caf_set_chunk (SF_PRIVATE *psf, const SF_CHUNK_INFO * chunk_info) ; -static SF_CHUNK_ITERATOR * caf_next_chunk_iterator (SF_PRIVATE *psf, SF_CHUNK_ITERATOR * iterator) ; -static int caf_get_chunk_size (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) ; -static int caf_get_chunk_data (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -caf_open (SF_PRIVATE *psf) -{ CAF_PRIVATE * pcaf ; - int subformat, format, error = 0 ; - - if ((psf->container_data = calloc (1, sizeof (CAF_PRIVATE))) == NULL) - return SFE_MALLOC_FAILED ; - - pcaf = psf->container_data ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = caf_read_header (psf))) - return error ; - - psf->next_chunk_iterator = caf_next_chunk_iterator ; - psf->get_chunk_size = caf_get_chunk_size ; - psf->get_chunk_data = caf_get_chunk_data ; - } ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (psf->is_pipe) - return SFE_NO_PIPE_WRITE ; - - format = SF_CONTAINER (psf->sf.format) ; - if (format != SF_FORMAT_CAF) - return SFE_BAD_OPEN_FORMAT ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - if (psf->file.mode != SFM_RDWR || psf->filelength < 44) - { psf->filelength = 0 ; - psf->datalength = 0 ; - psf->dataoffset = 0 ; - psf->sf.frames = 0 ; - } ; - - psf->strings.flags = SF_STR_ALLOW_START ; - - /* - ** By default, add the peak chunk to floating point files. Default behaviour - ** can be switched off using sf_command (SFC_SET_PEAK_CHUNK, SF_FALSE). - */ - if (psf->file.mode == SFM_WRITE && (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE)) - { if ((psf->peak_info = peak_info_calloc (psf->sf.channels)) == NULL) - return SFE_MALLOC_FAILED ; - psf->peak_info->peak_loc = SF_PEAK_START ; - } ; - - if ((error = caf_write_header (psf, SF_FALSE)) != 0) - return error ; - - psf->write_header = caf_write_header ; - psf->set_chunk = caf_set_chunk ; - } ; - - psf->container_close = caf_close ; - psf->command = caf_command ; - - switch (subformat) - { case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_ULAW : - error = ulaw_init (psf) ; - break ; - - case SF_FORMAT_ALAW : - error = alaw_init (psf) ; - break ; - - /* Lite remove start */ - case SF_FORMAT_FLOAT : - error = float32_init (psf) ; - break ; - - case SF_FORMAT_DOUBLE : - error = double64_init (psf) ; - break ; - - case SF_FORMAT_ALAC_16 : - case SF_FORMAT_ALAC_20 : - case SF_FORMAT_ALAC_24 : - case SF_FORMAT_ALAC_32 : - if (psf->file.mode == SFM_READ) - /* Only pass the ALAC_DECODER_INFO in read mode. */ - error = alac_init (psf, &pcaf->alac) ; - else - error = alac_init (psf, NULL) ; - break ; - - /* Lite remove end */ - - default : - return SFE_UNSUPPORTED_ENCODING ; - } ; - - return error ; -} /* caf_open */ - -static int -caf_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - caf_write_header (psf, SF_TRUE) ; - - return 0 ; -} /* caf_close */ - -static int -caf_command (SF_PRIVATE * psf, int command, void * UNUSED (data), int UNUSED (datasize)) -{ CAF_PRIVATE *pcaf ; - - if ((pcaf = psf->container_data) == NULL) - return SFE_INTERNAL ; - - switch (command) - { case SFC_SET_CHANNEL_MAP_INFO : - pcaf->chanmap_tag = aiff_caf_find_channel_layout_tag (psf->channel_map, psf->sf.channels) ; - return (pcaf->chanmap_tag != 0) ; - - default : - break ; - } ; - - return 0 ; -} /* caf_command */ - -/*------------------------------------------------------------------------------ -*/ - -static int -decode_desc_chunk (SF_PRIVATE *psf, const DESC_CHUNK *desc) -{ int format = SF_FORMAT_CAF ; - - psf->sf.channels = desc->channels_per_frame ; - - if (desc->fmt_id == alac_MARKER) - { CAF_PRIVATE *pcaf ; - - if ((pcaf = psf->container_data) != NULL) - { switch (desc->fmt_flags) - { case 1 : - pcaf->alac.bits_per_sample = 16 ; - format |= SF_FORMAT_ALAC_16 ; - break ; - case 2 : - pcaf->alac.bits_per_sample = 20 ; - format |= SF_FORMAT_ALAC_20 ; - break ; - case 3 : - pcaf->alac.bits_per_sample = 24 ; - format |= SF_FORMAT_ALAC_24 ; - break ; - case 4 : - pcaf->alac.bits_per_sample = 32 ; - format |= SF_FORMAT_ALAC_32 ; - break ; - default : - psf_log_printf (psf, "Bad ALAC format flag value of %d\n", desc->fmt_flags) ; - } ; - - pcaf->alac.frames_per_packet = desc->frames_per_packet ; - } ; - - return format ; - } ; - - format |= psf->endian == SF_ENDIAN_LITTLE ? SF_ENDIAN_LITTLE : 0 ; - - if (desc->fmt_id == lpcm_MARKER && desc->fmt_flags & 1) - { /* Floating point data. */ - if (desc->bits_per_chan == 32 && desc->pkt_bytes == 4 * desc->channels_per_frame) - { psf->bytewidth = 4 ; - return format | SF_FORMAT_FLOAT ; - } ; - if (desc->bits_per_chan == 64 && desc->pkt_bytes == 8 * desc->channels_per_frame) - { psf->bytewidth = 8 ; - return format | SF_FORMAT_DOUBLE ; - } ; - } ; - - if (desc->fmt_id == lpcm_MARKER && (desc->fmt_flags & 1) == 0) - { /* Integer data. */ - if (desc->bits_per_chan == 32 && desc->pkt_bytes == 4 * desc->channels_per_frame) - { psf->bytewidth = 4 ; - return format | SF_FORMAT_PCM_32 ; - } ; - if (desc->bits_per_chan == 24 && desc->pkt_bytes == 3 * desc->channels_per_frame) - { psf->bytewidth = 3 ; - return format | SF_FORMAT_PCM_24 ; - } ; - if (desc->bits_per_chan == 16 && desc->pkt_bytes == 2 * desc->channels_per_frame) - { psf->bytewidth = 2 ; - return format | SF_FORMAT_PCM_16 ; - } ; - if (desc->bits_per_chan == 8 && desc->pkt_bytes == 1 * desc->channels_per_frame) - { psf->bytewidth = 1 ; - return format | SF_FORMAT_PCM_S8 ; - } ; - } ; - - if (desc->fmt_id == alaw_MARKER && desc->bits_per_chan == 8) - { psf->bytewidth = 1 ; - return format | SF_FORMAT_ALAW ; - } ; - - if (desc->fmt_id == ulaw_MARKER && desc->bits_per_chan == 8) - { psf->bytewidth = 1 ; - return format | SF_FORMAT_ULAW ; - } ; - - psf_log_printf (psf, "**** Unknown format identifier.\n") ; - - return 0 ; -} /* decode_desc_chunk */ - -static int -caf_read_header (SF_PRIVATE *psf) -{ CAF_PRIVATE *pcaf ; - BUF_UNION ubuf ; - DESC_CHUNK desc ; - sf_count_t chunk_size ; - double srate ; - short version, flags ; - int marker, k, have_data = 0, error ; - - if ((pcaf = psf->container_data) == NULL) - return SFE_INTERNAL ; - - memset (&desc, 0, sizeof (desc)) ; - - /* Set position to start of file to begin reading header. */ - psf_binheader_readf (psf, "pmE2E2", 0, &marker, &version, &flags) ; - psf_log_printf (psf, "%M\n Version : %d\n Flags : %x\n", marker, version, flags) ; - if (marker != caff_MARKER) - return SFE_CAF_NOT_CAF ; - - psf_binheader_readf (psf, "mE8b", &marker, &chunk_size, ubuf.ucbuf, 8) ; - srate = double64_be_read (ubuf.ucbuf) ; - snprintf (ubuf.cbuf, sizeof (ubuf.cbuf), "%5.3f", srate) ; - psf_log_printf (psf, "%M : %D\n Sample rate : %s\n", marker, chunk_size, ubuf.cbuf) ; - if (marker != desc_MARKER) - return SFE_CAF_NO_DESC ; - - if (chunk_size < SIGNED_SIZEOF (DESC_CHUNK)) - { psf_log_printf (psf, "**** Chunk size too small. Should be > 32 bytes.\n") ; - return SFE_MALFORMED_FILE ; - } ; - - psf->sf.samplerate = lrint (srate) ; - - psf_binheader_readf (psf, "mE44444", &desc.fmt_id, &desc.fmt_flags, &desc.pkt_bytes, &desc.frames_per_packet, - &desc.channels_per_frame, &desc.bits_per_chan) ; - psf_log_printf (psf, " Format id : %M\n Format flags : %x\n Bytes / packet : %u\n" - " Frames / packet : %u\n Channels / frame : %u\n Bits / channel : %u\n", - desc.fmt_id, desc.fmt_flags, desc.pkt_bytes, desc.frames_per_packet, desc.channels_per_frame, desc.bits_per_chan) ; - - if (desc.channels_per_frame > SF_MAX_CHANNELS) - { psf_log_printf (psf, "**** Bad channels per frame value %u.\n", desc.channels_per_frame) ; - return SFE_MALFORMED_FILE ; - } ; - - if (chunk_size > SIGNED_SIZEOF (DESC_CHUNK)) - psf_binheader_readf (psf, "j", (int) (chunk_size - sizeof (DESC_CHUNK))) ; - - psf->sf.channels = desc.channels_per_frame ; - - while (psf_ftell (psf) < psf->filelength) - { marker = 0 ; - chunk_size = 0 ; - - psf_binheader_readf (psf, "mE8", &marker, &chunk_size) ; - if (marker == 0) - { psf_log_printf (psf, "Have 0 marker.\n") ; - break ; - } ; - - psf_store_read_chunk_u32 (&psf->rchunks, marker, psf_ftell (psf), chunk_size) ; - - switch (marker) - { case peak_MARKER : - psf_log_printf (psf, "%M : %D\n", marker, chunk_size) ; - if (chunk_size != CAF_PEAK_CHUNK_SIZE (psf->sf.channels)) - { psf_binheader_readf (psf, "j", make_size_t (chunk_size)) ; - psf_log_printf (psf, "*** File PEAK chunk %D should be %d.\n", chunk_size, CAF_PEAK_CHUNK_SIZE (psf->sf.channels)) ; - return SFE_CAF_BAD_PEAK ; - } ; - - if ((psf->peak_info = peak_info_calloc (psf->sf.channels)) == NULL) - return SFE_MALLOC_FAILED ; - - /* read in rest of PEAK chunk. */ - psf_binheader_readf (psf, "E4", & (psf->peak_info->edit_number)) ; - psf_log_printf (psf, " edit count : %d\n", psf->peak_info->edit_number) ; - - psf_log_printf (psf, " Ch Position Value\n") ; - for (k = 0 ; k < psf->sf.channels ; k++) - { sf_count_t position ; - float value ; - - psf_binheader_readf (psf, "Ef8", &value, &position) ; - psf->peak_info->peaks [k].value = value ; - psf->peak_info->peaks [k].position = position ; - - snprintf (ubuf.cbuf, sizeof (ubuf.cbuf), " %2d %-12" PRId64 " %g\n", k, position, value) ; - psf_log_printf (psf, ubuf.cbuf) ; - } ; - - psf->peak_info->peak_loc = SF_PEAK_START ; - break ; - - case chan_MARKER : - if (chunk_size < 12) - { psf_log_printf (psf, "%M : %D (should be >= 12)\n", marker, chunk_size) ; - psf_binheader_readf (psf, "j", make_size_t (chunk_size)) ; - break ; - } - - psf_log_printf (psf, "%M : %D\n", marker, chunk_size) ; - - if ((error = caf_read_chanmap (psf, chunk_size))) - return error ; - break ; - - case free_MARKER : - psf_log_printf (psf, "%M : %D\n", marker, chunk_size) ; - psf_binheader_readf (psf, "j", make_size_t (chunk_size)) ; - break ; - - case data_MARKER : - psf_binheader_readf (psf, "E4", &k) ; - psf_log_printf (psf, " edit : %u\n", k) ; - - if (chunk_size == -1) - { psf_log_printf (psf, "%M : -1\n") ; - chunk_size = psf->filelength - psf->headindex ; - } - else if (psf->filelength > 0 && psf->filelength < psf->headindex + chunk_size - 16) - psf_log_printf (psf, "%M : %D (should be %D)\n", marker, chunk_size, psf->filelength - psf->headindex - 8) ; - else - psf_log_printf (psf, "%M : %D\n", marker, chunk_size) ; - - - psf->dataoffset = psf->headindex ; - - /* Subtract the 4 bytes of the 'edit' field above. */ - psf->datalength = chunk_size - 4 ; - - psf_binheader_readf (psf, "j", psf->datalength) ; - have_data = 1 ; - break ; - - case kuki_MARKER : - psf_log_printf (psf, "%M : %D\n", marker, chunk_size) ; - pcaf->alac.kuki_offset = psf_ftell (psf) - 12 ; - psf_binheader_readf (psf, "j", make_size_t (chunk_size)) ; - break ; - - case pakt_MARKER : - psf_log_printf (psf, "%M : %D\n", marker, chunk_size) ; - - psf_binheader_readf (psf, "E8844", &pcaf->alac.packets, &pcaf->alac.valid_frames, - &pcaf->alac.priming_frames, &pcaf->alac.remainder_frames) ; - - psf_log_printf (psf, - " Packets : %D\n" - " Valid frames : %D\n" - " Priming frames : %d\n" - " Remainder frames : %d\n", - pcaf->alac.packets, pcaf->alac.valid_frames, pcaf->alac.priming_frames, - pcaf->alac.remainder_frames - ) ; - - if (pcaf->alac.packets == 0 && pcaf->alac.valid_frames == 0 - && pcaf->alac.priming_frames == 0 && pcaf->alac.remainder_frames == 0) - psf_log_printf (psf, "*** 'pakt' chunk header is all zero.\n") ; - - pcaf->alac.pakt_offset = psf_ftell (psf) - 12 ; - psf_binheader_readf (psf, "j", make_size_t (chunk_size) - 24) ; - break ; - - default : - psf_log_printf (psf, "%M : %D (skipped)\n", marker, chunk_size) ; - psf_binheader_readf (psf, "j", make_size_t (chunk_size)) ; - break ; - } ; - - if (! psf->sf.seekable && have_data) - break ; - - if (psf_ftell (psf) >= psf->filelength - SIGNED_SIZEOF (chunk_size)) - { psf_log_printf (psf, "End\n") ; - break ; - } ; - } ; - - if (have_data == 0) - { psf_log_printf (psf, "**** Error, could not find 'data' chunk.\n") ; - return SFE_MALFORMED_FILE ; - } ; - - psf->endian = (desc.fmt_flags & 2) ? SF_ENDIAN_LITTLE : SF_ENDIAN_BIG ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - if ((psf->sf.format = decode_desc_chunk (psf, &desc)) == 0) - return SFE_UNSUPPORTED_ENCODING ; - - if (psf->bytewidth > 0) - psf->sf.frames = psf->datalength / psf->bytewidth ; - - return 0 ; -} /* caf_read_header */ - -/*------------------------------------------------------------------------------ -*/ - -static int -caf_write_header (SF_PRIVATE *psf, int calc_length) -{ BUF_UNION ubuf ; - CAF_PRIVATE *pcaf ; - DESC_CHUNK desc ; - sf_count_t current, free_len ; - uint32_t uk ; - int subformat, append_free_block = SF_TRUE ; - - if ((pcaf = psf->container_data) == NULL) - return SFE_INTERNAL ; - - memset (&desc, 0, sizeof (desc)) ; - - current = psf_ftell (psf) ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - - if (psf->bytewidth > 0) - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - /* 'caff' marker, version and flags. */ - psf_binheader_writef (psf, "Em22", caff_MARKER, 1, 0) ; - - /* 'desc' marker and chunk size. */ - psf_binheader_writef (psf, "Em8", desc_MARKER, (sf_count_t) (sizeof (DESC_CHUNK))) ; - - double64_be_write (1.0 * psf->sf.samplerate, ubuf.ucbuf) ; - psf_binheader_writef (psf, "b", ubuf.ucbuf, make_size_t (8)) ; - - subformat = SF_CODEC (psf->sf.format) ; - - psf->endian = SF_ENDIAN (psf->sf.format) ; - - if (CPU_IS_BIG_ENDIAN && (psf->endian == 0 || psf->endian == SF_ENDIAN_CPU)) - psf->endian = SF_ENDIAN_BIG ; - else if (CPU_IS_LITTLE_ENDIAN && (psf->endian == SF_ENDIAN_LITTLE || psf->endian == SF_ENDIAN_CPU)) - psf->endian = SF_ENDIAN_LITTLE ; - - if (psf->endian == SF_ENDIAN_LITTLE) - desc.fmt_flags = 2 ; - else - psf->endian = SF_ENDIAN_BIG ; - - /* initial section (same for all, it appears) */ - switch (subformat) - { case SF_FORMAT_PCM_S8 : - desc.fmt_id = lpcm_MARKER ; - psf->bytewidth = 1 ; - desc.pkt_bytes = psf->bytewidth * psf->sf.channels ; - desc.frames_per_packet = 1 ; - desc.channels_per_frame = psf->sf.channels ; - desc.bits_per_chan = 8 ; - break ; - - case SF_FORMAT_PCM_16 : - desc.fmt_id = lpcm_MARKER ; - psf->bytewidth = 2 ; - desc.pkt_bytes = psf->bytewidth * psf->sf.channels ; - desc.frames_per_packet = 1 ; - desc.channels_per_frame = psf->sf.channels ; - desc.bits_per_chan = 16 ; - break ; - - case SF_FORMAT_PCM_24 : - psf->bytewidth = 3 ; - desc.pkt_bytes = psf->bytewidth * psf->sf.channels ; - desc.frames_per_packet = 1 ; - desc.channels_per_frame = psf->sf.channels ; - desc.bits_per_chan = 24 ; - desc.fmt_id = lpcm_MARKER ; - break ; - - case SF_FORMAT_PCM_32 : - desc.fmt_id = lpcm_MARKER ; - psf->bytewidth = 4 ; - desc.pkt_bytes = psf->bytewidth * psf->sf.channels ; - desc.frames_per_packet = 1 ; - desc.channels_per_frame = psf->sf.channels ; - desc.bits_per_chan = 32 ; - break ; - - case SF_FORMAT_FLOAT : - desc.fmt_id = lpcm_MARKER ; - desc.fmt_flags |= 1 ; - psf->bytewidth = 4 ; - desc.pkt_bytes = psf->bytewidth * psf->sf.channels ; - desc.frames_per_packet = 1 ; - desc.channels_per_frame = psf->sf.channels ; - desc.bits_per_chan = 32 ; - break ; - - case SF_FORMAT_DOUBLE : - desc.fmt_id = lpcm_MARKER ; - desc.fmt_flags |= 1 ; - psf->bytewidth = 8 ; - desc.pkt_bytes = psf->bytewidth * psf->sf.channels ; - desc.frames_per_packet = 1 ; - desc.channels_per_frame = psf->sf.channels ; - desc.bits_per_chan = 64 ; - break ; - - case SF_FORMAT_ALAW : - desc.fmt_id = alaw_MARKER ; - psf->bytewidth = 1 ; - desc.pkt_bytes = psf->bytewidth * psf->sf.channels ; - desc.frames_per_packet = 1 ; - desc.channels_per_frame = psf->sf.channels ; - desc.bits_per_chan = 8 ; - break ; - - case SF_FORMAT_ULAW : - desc.fmt_id = ulaw_MARKER ; - psf->bytewidth = 1 ; - desc.pkt_bytes = psf->bytewidth * psf->sf.channels ; - desc.frames_per_packet = 1 ; - desc.channels_per_frame = psf->sf.channels ; - desc.bits_per_chan = 8 ; - break ; - - case SF_FORMAT_ALAC_16 : - case SF_FORMAT_ALAC_20 : - case SF_FORMAT_ALAC_24 : - case SF_FORMAT_ALAC_32 : - desc.fmt_id = alac_MARKER ; - desc.pkt_bytes = psf->bytewidth * psf->sf.channels ; - desc.channels_per_frame = psf->sf.channels ; - alac_get_desc_chunk_items (subformat, &desc.fmt_flags, &desc.frames_per_packet) ; - append_free_block = SF_FALSE ; - break ; - - default : - return SFE_UNIMPLEMENTED ; - } ; - - psf_binheader_writef (psf, "mE44444", desc.fmt_id, desc.fmt_flags, desc.pkt_bytes, desc.frames_per_packet, desc.channels_per_frame, desc.bits_per_chan) ; - -#if 0 - if (psf->strings.flags & SF_STR_LOCATE_START) - caf_write_strings (psf, SF_STR_LOCATE_START) ; -#endif - - if (psf->peak_info != NULL) - { int k ; - psf_binheader_writef (psf, "Em84", peak_MARKER, (sf_count_t) CAF_PEAK_CHUNK_SIZE (psf->sf.channels), psf->peak_info->edit_number) ; - for (k = 0 ; k < psf->sf.channels ; k++) - psf_binheader_writef (psf, "Ef8", (float) psf->peak_info->peaks [k].value, psf->peak_info->peaks [k].position) ; - } ; - - if (psf->channel_map && pcaf->chanmap_tag) - psf_binheader_writef (psf, "Em8444", chan_MARKER, (sf_count_t) 12, pcaf->chanmap_tag, 0, 0) ; - - /* Write custom headers. */ - for (uk = 0 ; uk < psf->wchunks.used ; uk++) - psf_binheader_writef (psf, "m44b", (int) psf->wchunks.chunks [uk].mark32, 0, psf->wchunks.chunks [uk].len, psf->wchunks.chunks [uk].data, make_size_t (psf->wchunks.chunks [uk].len)) ; - - if (append_free_block) - { /* Add free chunk so that the actual audio data starts at a multiple 0x1000. */ - free_len = 0x1000 - psf->headindex - 16 - 12 ; - while (free_len < 0) - free_len += 0x1000 ; - psf_binheader_writef (psf, "Em8z", free_MARKER, free_len, (int) free_len) ; - } ; - - psf_binheader_writef (psf, "Em84", data_MARKER, psf->datalength + 4, 0) ; - - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - if (current < psf->dataoffset) - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - else if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* caf_write_header */ - -static int -caf_read_chanmap (SF_PRIVATE * psf, sf_count_t chunk_size) -{ const AIFF_CAF_CHANNEL_MAP * map_info ; - unsigned channel_bitmap, channel_decriptions, bytesread ; - int layout_tag ; - - bytesread = psf_binheader_readf (psf, "E444", &layout_tag, &channel_bitmap, &channel_decriptions) ; - - map_info = aiff_caf_of_channel_layout_tag (layout_tag) ; - - psf_log_printf (psf, " Tag : %x\n", layout_tag) ; - if (map_info) - psf_log_printf (psf, " Layout : %s\n", map_info->name) ; - - if (bytesread < chunk_size) - psf_binheader_readf (psf, "j", chunk_size - bytesread) ; - - if (map_info->channel_map != NULL) - { size_t chanmap_size = psf->sf.channels * sizeof (psf->channel_map [0]) ; - - free (psf->channel_map) ; - - if ((psf->channel_map = malloc (chanmap_size)) == NULL) - return SFE_MALLOC_FAILED ; - - memcpy (psf->channel_map, map_info->channel_map, chanmap_size) ; - } ; - - return 0 ; -} /* caf_read_chanmap */ - -/*============================================================================== -*/ - -static int -caf_set_chunk (SF_PRIVATE *psf, const SF_CHUNK_INFO * chunk_info) -{ return psf_save_write_chunk (&psf->wchunks, chunk_info) ; -} /* caf_set_chunk */ - -static SF_CHUNK_ITERATOR * -caf_next_chunk_iterator (SF_PRIVATE *psf, SF_CHUNK_ITERATOR * iterator) -{ return psf_next_chunk_iterator (&psf->rchunks, iterator) ; -} /* caf_next_chunk_iterator */ - -static int -caf_get_chunk_size (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) -{ int indx ; - - if ((indx = psf_find_read_chunk_iterator (&psf->rchunks, iterator)) < 0) - return SFE_UNKNOWN_CHUNK ; - - chunk_info->datalen = psf->rchunks.chunks [indx].len ; - - return SFE_NO_ERROR ; -} /* caf_get_chunk_size */ - -static int -caf_get_chunk_data (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) -{ int indx ; - sf_count_t pos ; - - if ((indx = psf_find_read_chunk_iterator (&psf->rchunks, iterator)) < 0) - return SFE_UNKNOWN_CHUNK ; - - if (chunk_info->data == NULL) - return SFE_BAD_CHUNK_DATA_PTR ; - - chunk_info->id_size = psf->rchunks.chunks [indx].id_size ; - memcpy (chunk_info->id, psf->rchunks.chunks [indx].id, sizeof (chunk_info->id) / sizeof (*chunk_info->id)) ; - - pos = psf_ftell (psf) ; - psf_fseek (psf, psf->rchunks.chunks [indx].offset, SEEK_SET) ; - psf_fread (chunk_info->data, SF_MIN (chunk_info->datalen, psf->rchunks.chunks [indx].len), 1, psf) ; - psf_fseek (psf, pos, SEEK_SET) ; - - return SFE_NO_ERROR ; -} /* caf_get_chunk_data */ diff --git a/libs/libsndfile/src/cart.c b/libs/libsndfile/src/cart.c deleted file mode 100644 index a56ed60e51..0000000000 --- a/libs/libsndfile/src/cart.c +++ /dev/null @@ -1,101 +0,0 @@ -/* -** Copyright (C) 2012 Chris Roberts -** Copyright (C) 2006-2013 Erik de Castro Lopo -** Copyright (C) 2006 Paul Davis -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include "common.h" - - - -static inline size_t -cart_min_size (const SF_CART_INFO* info) -{ if (info == NULL) - return 0 ; - - return offsetof (SF_CART_INFO, tag_text) + info->tag_text_size ; -} /* cart_min_size */ - -SF_CART_INFO_16K* -cart_var_alloc (void) -{ SF_CART_INFO_16K* thing ; - thing = malloc (sizeof (SF_CART_INFO_16K)) ; - return thing ; -} /* cart_var_alloc */ - -int -cart_var_set (SF_PRIVATE *psf, const SF_CART_INFO * info, size_t datasize) -{ size_t len ; - - if (info == NULL) - return SF_FALSE ; - - if (cart_min_size (info) > datasize) - { psf->error = SFE_BAD_CART_INFO_SIZE ; - return SF_FALSE ; - } ; - - if (datasize >= sizeof (SF_CART_INFO_16K)) - { psf->error = SFE_BAD_CART_INFO_TOO_BIG ; - return SF_FALSE ; - } ; - - if (psf->cart_16k == NULL) - { if ((psf->cart_16k = cart_var_alloc ()) == NULL) - { psf->error = SFE_MALLOC_FAILED ; - return SF_FALSE ; - } ; - } ; - - memcpy (psf->cart_16k, info, offsetof (SF_CART_INFO, tag_text)) ; - psf_strlcpy_crlf (psf->cart_16k->tag_text, info->tag_text, sizeof (psf->cart_16k->tag_text), datasize - offsetof (SF_CART_INFO, tag_text)) ; - - len = strlen (psf->cart_16k->tag_text) ; - - if (len > 0 && psf->cart_16k->tag_text [len - 1] != '\n') - psf_strlcat (psf->cart_16k->tag_text, sizeof (psf->cart_16k->tag_text), "\r\n") ; - - /* Force tag_text_size to be even. */ - len = strlen (psf->cart_16k->tag_text) ; - len += (len & 1) ? 1 : 2 ; - - psf->cart_16k->tag_text_size = len ; - - return SF_TRUE ; -} /* cart_var_set */ - - -int -cart_var_get (SF_PRIVATE *psf, SF_CART_INFO * data, size_t datasize) -{ size_t size ; - if (psf->cart_16k == NULL) - return SF_FALSE ; - - size = SF_MIN (datasize, cart_min_size ((const SF_CART_INFO *) psf->cart_16k)) ; - - memcpy (data, psf->cart_16k, size) ; - - return SF_TRUE ; -} /* cart_var_get */ - - diff --git a/libs/libsndfile/src/chanmap.c b/libs/libsndfile/src/chanmap.c deleted file mode 100644 index 9a9f7f0f16..0000000000 --- a/libs/libsndfile/src/chanmap.c +++ /dev/null @@ -1,262 +0,0 @@ -/* -** Copyright (C) 2009-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** Mostly from "Apple Core Audio Format Specification 1.0": -** -** http://developer.apple.com/documentation/MusicAudio/Reference/CAFSpec/CAFSpec.pdf -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#include "sndfile.h" -#include "common.h" -#include "chanmap.h" - - -static const AIFF_CAF_CHANNEL_MAP zero_chan [] = -{ { (0 << 16) | 0, NULL, "Use channel descriptions." }, - { (1 << 16) | 0, NULL, "Use channel bitmap." } -} ; /* zero_chan */ - - -static const int one_chan_mono [1] = { SF_CHANNEL_MAP_MONO } ; - -static const AIFF_CAF_CHANNEL_MAP one_chan [] = -{ { (100 << 16) | 1, one_chan_mono, "mono" } -} ; /* one_chan */ - - -static const int two_channel_stereo [2] = { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT } ; - -static const AIFF_CAF_CHANNEL_MAP two_chan [] = -{ { (101 << 16) | 2, two_channel_stereo, "stereo (L, R)" }, - { (102 << 16) | 2, two_channel_stereo, "stereo headphones (L, R)" }, -#if 0 - { (103 << 16) | 2, NULL, "matrix stereo (Lt, Rt)" }, - { (104 << 16) | 2, NULL, "2 channels (mid, side)" }, - { (105 << 16) | 2, NULL, "coincident mic pair" }, - { (106 << 16) | 2, NULL, "binaural stereo (L, R)" - } -#endif -} ; /* two_chan */ - - -static const int three_channel_mpeg_30a [3] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_CENTER } ; -static const int three_channel_mpeg_30b [3] = - { SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT } ; -static const int three_channel_itu_21 [3] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_CENTER } ; -static const int three_channel_dvd_4 [3] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_LFE } ; - -static const AIFF_CAF_CHANNEL_MAP three_chan [] = -{ { (113 << 16) | 3, three_channel_mpeg_30a, "MPEG 3 0 A (L, R, C)" }, - { (114 << 16) | 3, three_channel_mpeg_30b, "MPEG 3 0 B (C, L, R)" }, - { (131 << 16) | 3, three_channel_itu_21, "ITU 2.1 (L, R, Cs)" }, - { (133 << 16) | 3, three_channel_dvd_4, "DVD 4 (L, R, LFE)" } -} ; /* three_chan */ - - -static const int four_channel_ambisonc_b [4] = - { SF_CHANNEL_MAP_AMBISONIC_B_W, SF_CHANNEL_MAP_AMBISONIC_B_X, SF_CHANNEL_MAP_AMBISONIC_B_Y, SF_CHANNEL_MAP_AMBISONIC_B_Z } ; -static const int four_channel_quad [4] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT } ; -static const int four_channel_mpeg_40a [4] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_REAR_CENTER } ; -static const int four_channel_mpeg_40b [4] = - { SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_CENTER } ; -static const int four_channel_itu_23 [4] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT } ; -static const int four_channel_dvd_5 [4] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_LFE, SF_CHANNEL_MAP_REAR_CENTER } ; -static const int four_channel_dvd_10 [4] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_LFE } ; - -static const AIFF_CAF_CHANNEL_MAP four_chan [] = -{ { (107 << 16) | 4, four_channel_ambisonc_b, "ambisonic B (W, X, Y, Z)" }, - { (108 << 16) | 4, four_channel_quad, "quad (Lfront, Rfront, Lrear, Rrear)" }, - { (115 << 16) | 4, four_channel_mpeg_40a, "MPEG 4.0 A (L, R, C, Cs)" }, - { (116 << 16) | 4, four_channel_mpeg_40b, "MPEG 4.0 B (C, L, R, Cs)" }, - { (132 << 16) | 4, four_channel_itu_23, "ITU 2.3 (L, R, Ls, Rs)" }, - { (134 << 16) | 4, four_channel_dvd_5, "DVD 5 (L, R, LFE, Cs)" }, - { (136 << 16) | 4, four_channel_dvd_10, "DVD 10 (L, R, C, LFE)" } -} ; /* four_chan */ - - -static const int five_channel_pentagonal [5] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT, SF_CHANNEL_MAP_CENTER } ; -static const int five_channel_mpeg_50_a [5] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT } ; -static const int five_channel_mpeg_50_b [5] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT, SF_CHANNEL_MAP_CENTER } ; -static const int five_channel_mpeg_50_c [5] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT } ; -static const int five_channel_mpeg_50_d [5] = - { SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT } ; -static const int five_channel_dvd_6 [5] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_LFE, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT } ; -static const int five_channel_dvd_11 [5] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_LFE, SF_CHANNEL_MAP_REAR_CENTER } ; -static const int five_channel_dvd_18 [5] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT, SF_CHANNEL_MAP_LFE } ; - -static const AIFF_CAF_CHANNEL_MAP five_chan [] = -{ { (109 << 16) | 5, five_channel_pentagonal, "pentagonal (L, R, Lrear, Rrear, C)" }, - { (117 << 16) | 5, five_channel_mpeg_50_a, "MPEG 5.0 A (L, R, C, Ls, Rs)" }, - { (118 << 16) | 5, five_channel_mpeg_50_b, "MPEG 5.0 B (L, R, Ls, Rs, C)" }, - { (119 << 16) | 5, five_channel_mpeg_50_c, "MPEG 5.0 C (L, C, R, Ls, Rs,)" }, - { (120 << 16) | 5, five_channel_mpeg_50_d, "MPEG 5.0 D (C, L, R, Ls, Rs)" }, - { (135 << 16) | 5, five_channel_dvd_6, "DVD 6 (L, R, LFE, Ls, Rs)" }, - { (137 << 16) | 5, five_channel_dvd_11, "DVD 11 (L, R, C, LFE, Cs)" }, - { (138 << 16) | 5, five_channel_dvd_18, "DVD 18 (L, R, Ls, Rs, LFE)" } -} ; /* five_chan */ - - -static const int six_channel_mpeg_51_a [6] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_LFE, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT } ; -static const int six_channel_mpeg_51_b [6] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT, SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_LFE } ; -static const int six_channel_mpeg_51_c [6] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT, SF_CHANNEL_MAP_LFE } ; -static const int six_channel_mpeg_51_d [6] = - { SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT, SF_CHANNEL_MAP_LFE } ; -static const int six_channel_audio_unit_60 [6] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT, SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_REAR_CENTER } ; -static const int six_channel_aac_60 [6] = - { SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT, SF_CHANNEL_MAP_REAR_CENTER } ; - -static const AIFF_CAF_CHANNEL_MAP six_chan [] = -{ { (110 << 16) | 6, NULL, "hexagonal (L, R, Lr, Rr, C, Rear)" }, - { (121 << 16) | 6, six_channel_mpeg_51_a, "MPEG 5.1 A (L, R, C, LFE, Ls, Rs)" }, - { (122 << 16) | 6, six_channel_mpeg_51_b, "MPEG 5.1 B (L, R, Ls, Rs, C, LFE)" }, - { (123 << 16) | 6, six_channel_mpeg_51_c, "MPEG 5.1 C (L, C, R, Ls, Rs, LFE)" }, - { (124 << 16) | 6, six_channel_mpeg_51_d, "MPEG 5.1 D (C, L, R, Ls, Rs, LFE)" }, - { (139 << 16) | 6, six_channel_audio_unit_60, "AudioUnit 6.0 (L, R, Ls, Rs, C, Cs)" }, - { (141 << 16) | 6, six_channel_aac_60, "AAC 6.0 (C, L, R, Ls, Rs, Cs)" } -} ; /* six_chan */ - - -static const int six_channel_mpeg_61a [7] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_LFE, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT, SF_CHANNEL_MAP_REAR_CENTER } ; -static const int six_channel_aac_61 [7] = - { SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT, SF_CHANNEL_MAP_REAR_CENTER, SF_CHANNEL_MAP_LFE } ; - -static const AIFF_CAF_CHANNEL_MAP seven_chan [] = -{ { (125 << 16) | 7, six_channel_mpeg_61a, "MPEG 6.1 A (L, R, C, LFE, Ls, Rs, Cs)" }, - { (140 << 16) | 7, NULL, "AudioUnit 7.0 (L, R, Ls, Rs, C, Rls, Rrs)" }, - { (142 << 16) | 7, six_channel_aac_61, "AAC 6.1 (C, L, R, Ls, Rs, Cs, Lfe)" }, - { (143 << 16) | 7, NULL, "AAC 7.0 (C, L, R, Ls, Rs, Rls, Rrs,)" } -} ; /* seven_chan */ - - -static const AIFF_CAF_CHANNEL_MAP eight_chan [] = -{ { (111 << 16) | 8, NULL, - // front left, front right, rear left, rear right, - // front center, rear center, side left, side right - "octagonal (Lf, Rf, Lr, Rr, Cf, Cr, Ls, Rs)" - }, - { (112 << 16) | 8, NULL, - // left, right, rear left, rear right - // top left, top right, top rear left, top rear right - "cube (L, R, Lrear, Rrear, Ltop, Rtop, Ltoprear, Rtoprear)" - }, - { (126 << 16) | 8, NULL, "MPEG 7.1 A (L, R, C, LFE, Ls, Rs, Lc, Rc)" }, - { (127 << 16) | 8, NULL, "MPEG 7.1 B (C, Lc, Rc, L, R, Ls, Rs, LFE)" }, - { (128 << 16) | 8, NULL, "MPEG 7.1 C (L, R, C, LFE, Ls, R, Rls, Rrs)" }, - { (129 << 16) | 8, NULL, "Emagic Default 7.1 (L, R, Ls, Rs, C, LFE, Lc, Rc)" }, - { (130 << 16) | 8, NULL, - // (ITU_5_1 plus a matrix encoded stereo mix) - "SMPTE DTV (L, R, C, LFE, Ls, Rs, Lt, Rt)" - }, - { (144 << 16) | 8, NULL, "AAC octagonal (C, L, R, Ls, Rs, Rls, Rrs, Cs)" } -} ; /* eight_chan */ - - - -#if 0 - -TMH_10_2_std = (145 << 16) | 16, -// L R C Vhc Lsd Rsd Ls Rs Vhl Vhr Lw Rw Csd Cs LFE1 LFE2 - -TMH_10_2_full = (146 << 16) | 21, -// TMH_10_2_std plus: Lc Rc HI VI Haptic - -#endif - - -typedef struct -{ const AIFF_CAF_CHANNEL_MAP * map ; - int len ; -} MAP_MAP ; - -static const MAP_MAP map [] = -{ { zero_chan, ARRAY_LEN (zero_chan) }, - { one_chan, ARRAY_LEN (one_chan) }, - { two_chan, ARRAY_LEN (two_chan) }, - { three_chan, ARRAY_LEN (three_chan) }, - { four_chan, ARRAY_LEN (four_chan) }, - { five_chan, ARRAY_LEN (five_chan) }, - { six_chan, ARRAY_LEN (six_chan) }, - { seven_chan, ARRAY_LEN (seven_chan) }, - { eight_chan, ARRAY_LEN (eight_chan) } -} ; /* map */ - - -int -aiff_caf_find_channel_layout_tag (const int *chan_map, int channels) -{ const AIFF_CAF_CHANNEL_MAP * curr_map ; - unsigned k, len ; - - if (channels < 1 || channels > ARRAY_LEN (map)) - return 0 ; - - curr_map = map [channels].map ; - len = map [channels].len ; - - for (k = 0 ; k < len ; k++) - if (curr_map [k].channel_map != NULL) - if (memcmp (chan_map, curr_map [k].channel_map, channels * sizeof (chan_map [0])) == 0) - return curr_map [k].channel_layout_tag ; - - return 0 ; -} /* aiff_caf_find_channel_layout_tag */ - -const AIFF_CAF_CHANNEL_MAP * -aiff_caf_of_channel_layout_tag (int tag) -{ const AIFF_CAF_CHANNEL_MAP * curr_map ; - unsigned k, len ; - int channels = tag & 0xffff ; - - if (channels < 0 || channels > ARRAY_LEN (map)) - return NULL ; - - curr_map = map [channels].map ; - len = map [channels].len ; - - for (k = 0 ; k < len ; k++) - if (curr_map [k].channel_layout_tag == tag) - return curr_map + k ; - - return NULL ; -} /* aiff_caf_of_channel_layout_tag */ diff --git a/libs/libsndfile/src/chanmap.h b/libs/libsndfile/src/chanmap.h deleted file mode 100644 index 8af409dbac..0000000000 --- a/libs/libsndfile/src/chanmap.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -** Copyright (C) 2009-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -typedef struct -{ /* The tag in the AIFF or CAF file. */ - int channel_layout_tag ; - - /* The equivalent array of SF_CHANNEL_MAP_* entries. */ - const int * channel_map ; - - const char * name ; -} AIFF_CAF_CHANNEL_MAP ; - - -int aiff_caf_find_channel_layout_tag (const int *chan_map, int channels) ; - -const AIFF_CAF_CHANNEL_MAP * aiff_caf_of_channel_layout_tag (int tag) ; diff --git a/libs/libsndfile/src/chunk.c b/libs/libsndfile/src/chunk.c deleted file mode 100644 index b661ce5c2b..0000000000 --- a/libs/libsndfile/src/chunk.c +++ /dev/null @@ -1,255 +0,0 @@ -/* -** Copyright (C) 2008-2012 Erik de Castro Lopo -** Copyright (C) 2012 IOhannes m zmoelnig, IEM -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -static int64_t -hash_of_str (const char * str) -{ int64_t marker = 0 ; - int k ; - - for (k = 0 ; str [k] ; k++) - marker = marker * 0x7f + ((const uint8_t *) str) [k] ; - - return marker ; -} /* hash_of_str */ - -SF_CHUNK_ITERATOR * -psf_get_chunk_iterator (SF_PRIVATE * psf, const char * marker_str) -{ const READ_CHUNKS * pchk = &psf->rchunks ; - int idx ; - - if (marker_str) - idx = psf_find_read_chunk_str (pchk, marker_str) ; - else - idx = pchk->used > 0 ? 0 : -1 ; - - if (idx < 0) - return NULL ; - - if (psf->iterator == NULL) - { psf->iterator = calloc (1, sizeof (SF_CHUNK_ITERATOR)) ; - if (psf->iterator == NULL) - return NULL ; - } ; - - psf->iterator->sndfile = (SNDFILE *) psf ; - - if (marker_str) - { int64_t hash ; - size_t marker_len ; - union - { uint32_t marker ; - char str [5] ; - } u ; - - snprintf (u.str, sizeof (u.str), "%s", marker_str) ; - - marker_len = strlen (marker_str) ; - if (marker_len > 64) - marker_len = 64 ; - - hash = marker_len > 4 ? hash_of_str (marker_str) : u.marker ; - - memcpy (psf->iterator->id, marker_str, marker_len) ; - psf->iterator->id_size = marker_len ; - psf->iterator->hash = hash ; - } - - psf->iterator->current = idx ; - - return psf->iterator ; -} /* psf_get_chunk_iterator */ - -SF_CHUNK_ITERATOR * -psf_next_chunk_iterator (const READ_CHUNKS * pchk , SF_CHUNK_ITERATOR * iterator) -{ int64_t hash = iterator->hash ; - uint32_t k ; - - iterator->current++ ; - - if (hash) - { for (k = iterator->current ; k < pchk->used ; k++) - if (pchk->chunks [k].hash == hash) - { iterator->current = k ; - return iterator ; - } - } - else if (iterator->current < pchk->used) - return iterator ; - - /* No match, clear iterator and return NULL */ - memset (iterator, 0, sizeof (*iterator)) ; - return NULL ; -} /* psf_next_chunk_iterator */ - -static int -psf_store_read_chunk (READ_CHUNKS * pchk, const READ_CHUNK * rchunk) -{ if (pchk->count == 0) - { pchk->used = 0 ; - pchk->count = 20 ; - pchk->chunks = calloc (pchk->count, sizeof (READ_CHUNK)) ; - } - else if (pchk->used > pchk->count) - return SFE_INTERNAL ; - else if (pchk->used == pchk->count) - { READ_CHUNK * old_ptr = pchk->chunks ; - int new_count = 3 * (pchk->count + 1) / 2 ; - - pchk->chunks = realloc (old_ptr, new_count * sizeof (READ_CHUNK)) ; - if (pchk->chunks == NULL) - { pchk->chunks = old_ptr ; - return SFE_MALLOC_FAILED ; - } ; - pchk->count = new_count ; - } ; - - pchk->chunks [pchk->used] = *rchunk ; - - pchk->used ++ ; - - return SFE_NO_ERROR ; -} /* psf_store_read_chunk */ - -int -psf_store_read_chunk_u32 (READ_CHUNKS * pchk, uint32_t marker, sf_count_t offset, uint32_t len) -{ READ_CHUNK rchunk ; - - memset (&rchunk, 0, sizeof (rchunk)) ; - - rchunk.hash = marker ; - rchunk.mark32 = marker ; - rchunk.offset = offset ; - rchunk.len = len ; - - rchunk.id_size = 4 ; - memcpy (rchunk.id, &marker, rchunk.id_size) ; - - return psf_store_read_chunk (pchk, &rchunk) ; -} /* psf_store_read_chunk_u32 */ - -int -psf_find_read_chunk_str (const READ_CHUNKS * pchk, const char * marker_str) -{ int64_t hash ; - uint32_t k ; - union - { uint32_t marker ; - char str [5] ; - } u ; - - snprintf (u.str, sizeof (u.str), "%s", marker_str) ; - - hash = strlen (marker_str) > 4 ? hash_of_str (marker_str) : u.marker ; - - for (k = 0 ; k < pchk->used ; k++) - if (pchk->chunks [k].hash == hash) - return k ; - - return -1 ; -} /* psf_find_read_chunk_str */ - -int -psf_find_read_chunk_m32 (const READ_CHUNKS * pchk, uint32_t marker) -{ uint32_t k ; - - for (k = 0 ; k < pchk->used ; k++) - if (pchk->chunks [k].mark32 == marker) - return k ; - - return -1 ; -} /* psf_find_read_chunk_m32 */ -int -psf_find_read_chunk_iterator (const READ_CHUNKS * pchk, const SF_CHUNK_ITERATOR * marker) -{ if (marker->current < pchk->used) - return marker->current ; - - return -1 ; -} /* psf_find_read_chunk_iterator */ - -int -psf_store_read_chunk_str (READ_CHUNKS * pchk, const char * marker_str, sf_count_t offset, uint32_t len) -{ READ_CHUNK rchunk ; - union - { uint32_t marker ; - char str [5] ; - } u ; - size_t marker_len ; - - memset (&rchunk, 0, sizeof (rchunk)) ; - snprintf (u.str, sizeof (u.str), "%s", marker_str) ; - - marker_len = strlen (marker_str) ; - - rchunk.hash = marker_len > 4 ? hash_of_str (marker_str) : u.marker ; - rchunk.mark32 = u.marker ; - rchunk.offset = offset ; - rchunk.len = len ; - - rchunk.id_size = marker_len > 64 ? 64 : marker_len ; - memcpy (rchunk.id, marker_str, rchunk.id_size) ; - - return psf_store_read_chunk (pchk, &rchunk) ; -} /* psf_store_read_chunk_str */ - -int -psf_save_write_chunk (WRITE_CHUNKS * pchk, const SF_CHUNK_INFO * chunk_info) -{ union - { uint32_t marker ; - char str [5] ; - } u ; - uint32_t len ; - - if (pchk->count == 0) - { pchk->used = 0 ; - pchk->count = 20 ; - pchk->chunks = calloc (pchk->count, sizeof (WRITE_CHUNK)) ; - } - else if (pchk->used >= pchk->count) - { WRITE_CHUNK * old_ptr = pchk->chunks ; - int new_count = 3 * (pchk->count + 1) / 2 ; - - pchk->chunks = realloc (old_ptr, new_count * sizeof (WRITE_CHUNK)) ; - if (pchk->chunks == NULL) - { pchk->chunks = old_ptr ; - return SFE_MALLOC_FAILED ; - } ; - } ; - - len = chunk_info->datalen ; - while (len & 3) len ++ ; - - snprintf (u.str, sizeof (u.str), "%s", chunk_info->id) ; - - pchk->chunks [pchk->used].hash = strlen (chunk_info->id) > 4 ? hash_of_str (chunk_info->id) : u.marker ; - pchk->chunks [pchk->used].mark32 = u.marker ; - pchk->chunks [pchk->used].len = len ; - pchk->chunks [pchk->used].data = psf_memdup (chunk_info->data, chunk_info->datalen) ; - - pchk->used ++ ; - - return SFE_NO_ERROR ; -} /* psf_save_write_chunk */ - diff --git a/libs/libsndfile/src/command.c b/libs/libsndfile/src/command.c deleted file mode 100644 index 6db7315415..0000000000 --- a/libs/libsndfile/src/command.c +++ /dev/null @@ -1,390 +0,0 @@ -/* -** Copyright (C) 2001-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#include "sndfile.h" -#include "common.h" - -static SF_FORMAT_INFO const simple_formats [] = -{ - { SF_FORMAT_AIFF | SF_FORMAT_PCM_16, - "AIFF (Apple/SGI 16 bit PCM)", "aiff" - }, - - { SF_FORMAT_AIFF | SF_FORMAT_FLOAT, - "AIFF (Apple/SGI 32 bit float)", "aifc" - }, - - { SF_FORMAT_AIFF | SF_FORMAT_PCM_S8, - "AIFF (Apple/SGI 8 bit PCM)", "aiff" - }, - - { SF_FORMAT_AU | SF_FORMAT_PCM_16, - "AU (Sun/Next 16 bit PCM)", "au" - }, - - { SF_FORMAT_AU | SF_FORMAT_ULAW, - "AU (Sun/Next 8-bit u-law)", "au" - }, - - { SF_FORMAT_CAF | SF_FORMAT_ALAC_16, - "CAF (Apple 16 bit ALAC)", "caf" - }, - - { SF_FORMAT_CAF | SF_FORMAT_PCM_16, - "CAF (Apple 16 bit PCM)", "caf" - }, - -#if HAVE_EXTERNAL_LIBS - { SF_FORMAT_FLAC | SF_FORMAT_PCM_16, - "FLAC 16 bit", "flac" - }, -#endif - - { SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, - "OKI Dialogic VOX ADPCM", "vox" - }, - -#if HAVE_EXTERNAL_LIBS - { SF_FORMAT_OGG | SF_FORMAT_VORBIS, - "Ogg Vorbis (Xiph Foundation)", "oga" - }, -#endif - - { SF_FORMAT_WAV | SF_FORMAT_PCM_16, - "WAV (Microsoft 16 bit PCM)", "wav" - }, - - { SF_FORMAT_WAV | SF_FORMAT_FLOAT, - "WAV (Microsoft 32 bit float)", "wav" - }, - - { SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, - "WAV (Microsoft 4 bit IMA ADPCM)", "wav" - }, - - { SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, - "WAV (Microsoft 4 bit MS ADPCM)", "wav" - }, - - { SF_FORMAT_WAV | SF_FORMAT_PCM_U8, - "WAV (Microsoft 8 bit PCM)", "wav" - }, - -} ; /* simple_formats */ - -int -psf_get_format_simple_count (void) -{ return (sizeof (simple_formats) / sizeof (SF_FORMAT_INFO)) ; -} /* psf_get_format_simple_count */ - -int -psf_get_format_simple (SF_FORMAT_INFO *data) -{ int indx ; - - if (data->format < 0 || data->format >= (SIGNED_SIZEOF (simple_formats) / SIGNED_SIZEOF (SF_FORMAT_INFO))) - return SFE_BAD_COMMAND_PARAM ; - - indx = data->format ; - memcpy (data, &(simple_formats [indx]), SIGNED_SIZEOF (SF_FORMAT_INFO)) ; - - return 0 ; -} /* psf_get_format_simple */ - -/*============================================================================ -** Major format info. -*/ - -static SF_FORMAT_INFO const major_formats [] = -{ - { SF_FORMAT_AIFF, "AIFF (Apple/SGI)", "aiff" }, - { SF_FORMAT_AU, "AU (Sun/NeXT)", "au" }, - { SF_FORMAT_AVR, "AVR (Audio Visual Research)", "avr" }, - { SF_FORMAT_CAF, "CAF (Apple Core Audio File)", "caf" }, -#if HAVE_EXTERNAL_LIBS - { SF_FORMAT_FLAC, "FLAC (Free Lossless Audio Codec)", "flac" }, -#endif - { SF_FORMAT_HTK, "HTK (HMM Tool Kit)", "htk" }, - { SF_FORMAT_SVX, "IFF (Amiga IFF/SVX8/SV16)", "iff" }, - { SF_FORMAT_MAT4, "MAT4 (GNU Octave 2.0 / Matlab 4.2)", "mat" }, - { SF_FORMAT_MAT5, "MAT5 (GNU Octave 2.1 / Matlab 5.0)", "mat" }, - { SF_FORMAT_MPC2K, "MPC (Akai MPC 2k)", "mpc" }, -#if HAVE_EXTERNAL_LIBS - { SF_FORMAT_OGG, "OGG (OGG Container format)", "oga" }, -#endif - { SF_FORMAT_PAF, "PAF (Ensoniq PARIS)", "paf" }, - { SF_FORMAT_PVF, "PVF (Portable Voice Format)", "pvf" }, - { SF_FORMAT_RAW, "RAW (header-less)", "raw" }, - { SF_FORMAT_RF64, "RF64 (RIFF 64)", "rf64" }, - { SF_FORMAT_SD2, "SD2 (Sound Designer II)", "sd2" }, - { SF_FORMAT_SDS, "SDS (Midi Sample Dump Standard)", "sds" }, - { SF_FORMAT_IRCAM, "SF (Berkeley/IRCAM/CARL)", "sf" }, - { SF_FORMAT_VOC, "VOC (Creative Labs)", "voc" }, - { SF_FORMAT_W64, "W64 (SoundFoundry WAVE 64)", "w64" }, - { SF_FORMAT_WAV, "WAV (Microsoft)", "wav" }, - { SF_FORMAT_NIST, "WAV (NIST Sphere)", "wav" }, - { SF_FORMAT_WAVEX, "WAVEX (Microsoft)", "wav" }, - { SF_FORMAT_WVE, "WVE (Psion Series 3)", "wve" }, - { SF_FORMAT_XI, "XI (FastTracker 2)", "xi" }, - -} ; /* major_formats */ - -int -psf_get_format_major_count (void) -{ return (sizeof (major_formats) / sizeof (SF_FORMAT_INFO)) ; -} /* psf_get_format_major_count */ - -int -psf_get_format_major (SF_FORMAT_INFO *data) -{ int indx ; - - if (data->format < 0 || data->format >= (SIGNED_SIZEOF (major_formats) / SIGNED_SIZEOF (SF_FORMAT_INFO))) - return SFE_BAD_COMMAND_PARAM ; - - indx = data->format ; - memcpy (data, &(major_formats [indx]), SIGNED_SIZEOF (SF_FORMAT_INFO)) ; - - return 0 ; -} /* psf_get_format_major */ - -/*============================================================================ -** Subtype format info. -*/ - -static SF_FORMAT_INFO subtype_formats [] = -{ - { SF_FORMAT_PCM_S8, "Signed 8 bit PCM", NULL }, - { SF_FORMAT_PCM_16, "Signed 16 bit PCM", NULL }, - { SF_FORMAT_PCM_24, "Signed 24 bit PCM", NULL }, - { SF_FORMAT_PCM_32, "Signed 32 bit PCM", NULL }, - - { SF_FORMAT_PCM_U8, "Unsigned 8 bit PCM", NULL }, - - { SF_FORMAT_FLOAT, "32 bit float", NULL }, - { SF_FORMAT_DOUBLE, "64 bit float", NULL }, - - { SF_FORMAT_ULAW, "U-Law", NULL }, - { SF_FORMAT_ALAW, "A-Law", NULL }, - { SF_FORMAT_IMA_ADPCM, "IMA ADPCM", NULL }, - { SF_FORMAT_MS_ADPCM, "Microsoft ADPCM", NULL }, - - { SF_FORMAT_GSM610, "GSM 6.10", NULL }, - - { SF_FORMAT_G721_32, "32kbs G721 ADPCM", NULL }, - { SF_FORMAT_G723_24, "24kbs G723 ADPCM", NULL }, - - { SF_FORMAT_DWVW_12, "12 bit DWVW", NULL }, - { SF_FORMAT_DWVW_16, "16 bit DWVW", NULL }, - { SF_FORMAT_DWVW_24, "24 bit DWVW", NULL }, - { SF_FORMAT_VOX_ADPCM, "VOX ADPCM", "vox" }, - - { SF_FORMAT_DPCM_16, "16 bit DPCM", NULL }, - { SF_FORMAT_DPCM_8, "8 bit DPCM", NULL }, - -#if HAVE_EXTERNAL_LIBS - { SF_FORMAT_VORBIS, "Vorbis", NULL }, -#endif - - { SF_FORMAT_ALAC_16, "16 bit ALAC", NULL }, - { SF_FORMAT_ALAC_20, "20 bit ALAC", NULL }, - { SF_FORMAT_ALAC_24, "24 bit ALAC", NULL }, - { SF_FORMAT_ALAC_32, "32 bit ALAC", NULL }, -} ; /* subtype_formats */ - -int -psf_get_format_subtype_count (void) -{ return (sizeof (subtype_formats) / sizeof (SF_FORMAT_INFO)) ; -} /* psf_get_format_subtype_count */ - -int -psf_get_format_subtype (SF_FORMAT_INFO *data) -{ int indx ; - - if (data->format < 0 || data->format >= (SIGNED_SIZEOF (subtype_formats) / SIGNED_SIZEOF (SF_FORMAT_INFO))) - { data->format = 0 ; - return SFE_BAD_COMMAND_PARAM ; - } ; - - indx = data->format ; - memcpy (data, &(subtype_formats [indx]), sizeof (SF_FORMAT_INFO)) ; - - return 0 ; -} /* psf_get_format_subtype */ - -/*============================================================================== -*/ - -int -psf_get_format_info (SF_FORMAT_INFO *data) -{ int k, format ; - - if (SF_CONTAINER (data->format)) - { format = SF_CONTAINER (data->format) ; - - for (k = 0 ; k < (SIGNED_SIZEOF (major_formats) / SIGNED_SIZEOF (SF_FORMAT_INFO)) ; k++) - { if (format == major_formats [k].format) - { memcpy (data, &(major_formats [k]), sizeof (SF_FORMAT_INFO)) ; - return 0 ; - } ; - } ; - } - else if (SF_CODEC (data->format)) - { format = SF_CODEC (data->format) ; - - for (k = 0 ; k < (SIGNED_SIZEOF (subtype_formats) / SIGNED_SIZEOF (SF_FORMAT_INFO)) ; k++) - { if (format == subtype_formats [k].format) - { memcpy (data, &(subtype_formats [k]), sizeof (SF_FORMAT_INFO)) ; - return 0 ; - } ; - } ; - } ; - - memset (data, 0, sizeof (SF_FORMAT_INFO)) ; - - return SFE_BAD_COMMAND_PARAM ; -} /* psf_get_format_info */ - -/*============================================================================== -*/ - -double -psf_calc_signal_max (SF_PRIVATE *psf, int normalize) -{ BUF_UNION ubuf ; - sf_count_t position ; - double max_val, temp, *data ; - int k, len, readcount, save_state ; - - /* If the file is not seekable, there is nothing we can do. */ - if (! psf->sf.seekable) - { psf->error = SFE_NOT_SEEKABLE ; - return 0.0 ; - } ; - - if (! psf->read_double) - { psf->error = SFE_UNIMPLEMENTED ; - return 0.0 ; - } ; - - save_state = sf_command ((SNDFILE*) psf, SFC_GET_NORM_DOUBLE, NULL, 0) ; - sf_command ((SNDFILE*) psf, SFC_SET_NORM_DOUBLE, NULL, normalize) ; - - /* Brute force. Read the whole file and find the biggest sample. */ - /* Get current position in file */ - position = sf_seek ((SNDFILE*) psf, 0, SEEK_CUR) ; - /* Go to start of file. */ - sf_seek ((SNDFILE*) psf, 0, SEEK_SET) ; - - data = ubuf.dbuf ; - /* Make sure len is an integer multiple of the channel count. */ - len = ARRAY_LEN (ubuf.dbuf) - (ARRAY_LEN (ubuf.dbuf) % psf->sf.channels) ; - - for (readcount = 1, max_val = 0.0 ; readcount > 0 ; /* nothing */) - { readcount = sf_read_double ((SNDFILE*) psf, data, len) ; - for (k = 0 ; k < readcount ; k++) - { temp = fabs (data [k]) ; - max_val = temp > max_val ? temp : max_val ; - } ; - } ; - - /* Return to SNDFILE to original state. */ - sf_seek ((SNDFILE*) psf, position, SEEK_SET) ; - sf_command ((SNDFILE*) psf, SFC_SET_NORM_DOUBLE, NULL, save_state) ; - - return max_val ; -} /* psf_calc_signal_max */ - -int -psf_calc_max_all_channels (SF_PRIVATE *psf, double *peaks, int normalize) -{ BUF_UNION ubuf ; - sf_count_t position ; - double temp, *data ; - int k, len, readcount, save_state ; - int chan ; - - /* If the file is not seekable, there is nothing we can do. */ - if (! psf->sf.seekable) - return (psf->error = SFE_NOT_SEEKABLE) ; - - if (! psf->read_double) - return (psf->error = SFE_UNIMPLEMENTED) ; - - save_state = sf_command ((SNDFILE*) psf, SFC_GET_NORM_DOUBLE, NULL, 0) ; - sf_command ((SNDFILE*) psf, SFC_SET_NORM_DOUBLE, NULL, normalize) ; - - memset (peaks, 0, sizeof (double) * psf->sf.channels) ; - - /* Brute force. Read the whole file and find the biggest sample for each channel. */ - position = sf_seek ((SNDFILE*) psf, 0, SEEK_CUR) ; /* Get current position in file */ - sf_seek ((SNDFILE*) psf, 0, SEEK_SET) ; /* Go to start of file. */ - - len = ARRAY_LEN (ubuf.dbuf) ; - - data = ubuf.dbuf ; - - chan = 0 ; - readcount = len ; - while (readcount > 0) - { readcount = sf_read_double ((SNDFILE*) psf, data, len) ; - for (k = 0 ; k < readcount ; k++) - { temp = fabs (data [k]) ; - peaks [chan] = temp > peaks [chan] ? temp : peaks [chan] ; - chan = (chan + 1) % psf->sf.channels ; - } ; - } ; - - sf_seek ((SNDFILE*) psf, position, SEEK_SET) ; /* Return to original position. */ - - sf_command ((SNDFILE*) psf, SFC_SET_NORM_DOUBLE, NULL, save_state) ; - - return 0 ; -} /* psf_calc_max_all_channels */ - -int -psf_get_signal_max (SF_PRIVATE *psf, double *peak) -{ int k ; - - if (psf->peak_info == NULL) - return SF_FALSE ; - - peak [0] = psf->peak_info->peaks [0].value ; - - for (k = 1 ; k < psf->sf.channels ; k++) - peak [0] = SF_MAX (peak [0], psf->peak_info->peaks [k].value) ; - - return SF_TRUE ; -} /* psf_get_signal_max */ - -int -psf_get_max_all_channels (SF_PRIVATE *psf, double *peaks) -{ int k ; - - if (psf->peak_info == NULL) - return SF_FALSE ; - - for (k = 0 ; k < psf->sf.channels ; k++) - peaks [k] = psf->peak_info->peaks [k].value ; - - return SF_TRUE ; -} /* psf_get_max_all_channels */ - - diff --git a/libs/libsndfile/src/common.c b/libs/libsndfile/src/common.c deleted file mode 100644 index f42bc91575..0000000000 --- a/libs/libsndfile/src/common.c +++ /dev/null @@ -1,1662 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include - -#include -#include - -#ifndef _MSC_VER -#include -#endif -#include -#include -#include -#ifndef _MSC_VER -#include -#endif - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*----------------------------------------------------------------------------------------------- -** psf_log_printf allows libsndfile internal functions to print to an internal parselog which -** can later be displayed. -** The format specifiers are as for printf but without the field width and other modifiers. -** Printing is performed to the parselog char array of the SF_PRIVATE struct. -** Printing is done in such a way as to guarantee that the log never overflows the end of the -** parselog array. -*/ - -static inline void -log_putchar (SF_PRIVATE *psf, char ch) -{ if (psf->parselog.indx < SIGNED_SIZEOF (psf->parselog.buf) - 1) - { psf->parselog.buf [psf->parselog.indx++] = ch ; - psf->parselog.buf [psf->parselog.indx] = 0 ; - } ; - return ; -} /* log_putchar */ - -void -psf_log_printf (SF_PRIVATE *psf, const char *format, ...) -{ va_list ap ; - unsigned int u ; - int d, tens, shift, width, width_specifier, left_align ; - char c, *strptr, istr [5], lead_char, sign_char ; - - va_start (ap, format) ; - - while ((c = *format++)) - { if (c != '%') - { log_putchar (psf, c) ; - continue ; - } ; - - if (format [0] == '%') /* Handle %% */ - { log_putchar (psf, '%') ; - format ++ ; - continue ; - } ; - - sign_char = 0 ; - left_align = SF_FALSE ; - while (1) - { switch (format [0]) - { case ' ' : - case '+' : - sign_char = format [0] ; - format ++ ; - continue ; - - case '-' : - left_align = SF_TRUE ; - format ++ ; - continue ; - - default : break ; - } ; - - break ; - } ; - - if (format [0] == 0) - break ; - - lead_char = ' ' ; - if (format [0] == '0') - lead_char = '0' ; - - width_specifier = 0 ; - while ((c = *format++) && isdigit (c)) - width_specifier = width_specifier * 10 + (c - '0') ; - - switch (c) - { case 0 : /* NULL character. */ - va_end (ap) ; - return ; - - case 's': /* string */ - strptr = va_arg (ap, char *) ; - if (strptr == NULL) - break ; - width_specifier -= strlen (strptr) ; - if (left_align == SF_FALSE) - while (width_specifier -- > 0) - log_putchar (psf, ' ') ; - while (*strptr) - log_putchar (psf, *strptr++) ; - while (width_specifier -- > 0) - log_putchar (psf, ' ') ; - break ; - - case 'd': /* int */ - d = va_arg (ap, int) ; - - if (d < 0) - { d = -d ; - sign_char = '-' ; - if (lead_char != '0' && left_align == SF_FALSE) - width_specifier -- ; - } ; - - tens = 1 ; - width = 1 ; - while (d / tens >= 10) - { tens *= 10 ; - width ++ ; - } ; - - width_specifier -= width ; - - if (sign_char == ' ') - { log_putchar (psf, ' ') ; - width_specifier -- ; - } ; - - if (left_align == SF_FALSE && lead_char != '0') - { if (sign_char == '+') - width_specifier -- ; - - while (width_specifier -- > 0) - log_putchar (psf, lead_char) ; - } ; - - if (sign_char == '+' || sign_char == '-') - { log_putchar (psf, sign_char) ; - width_specifier -- ; - } ; - - if (left_align == SF_FALSE) - while (width_specifier -- > 0) - log_putchar (psf, lead_char) ; - - while (tens > 0) - { log_putchar (psf, '0' + d / tens) ; - d %= tens ; - tens /= 10 ; - } ; - - while (width_specifier -- > 0) - log_putchar (psf, lead_char) ; - break ; - - case 'D': /* sf_count_t */ - { sf_count_t D, Tens ; - - D = va_arg (ap, sf_count_t) ; - - if (D == 0) - { while (-- width_specifier > 0) - log_putchar (psf, lead_char) ; - log_putchar (psf, '0') ; - break ; - } - if (D < 0) - { log_putchar (psf, '-') ; - D = -D ; - } ; - Tens = 1 ; - width = 1 ; - while (D / Tens >= 10) - { Tens *= 10 ; - width ++ ; - } ; - - while (width_specifier > width) - { log_putchar (psf, lead_char) ; - width_specifier-- ; - } ; - - while (Tens > 0) - { log_putchar (psf, '0' + D / Tens) ; - D %= Tens ; - Tens /= 10 ; - } ; - } ; - break ; - - case 'u': /* unsigned int */ - u = va_arg (ap, unsigned int) ; - - tens = 1 ; - width = 1 ; - while (u / tens >= 10) - { tens *= 10 ; - width ++ ; - } ; - - width_specifier -= width ; - - if (sign_char == ' ') - { log_putchar (psf, ' ') ; - width_specifier -- ; - } ; - - if (left_align == SF_FALSE && lead_char != '0') - { if (sign_char == '+') - width_specifier -- ; - - while (width_specifier -- > 0) - log_putchar (psf, lead_char) ; - } ; - - if (sign_char == '+' || sign_char == '-') - { log_putchar (psf, sign_char) ; - width_specifier -- ; - } ; - - if (left_align == SF_FALSE) - while (width_specifier -- > 0) - log_putchar (psf, lead_char) ; - - while (tens > 0) - { log_putchar (psf, '0' + u / tens) ; - u %= tens ; - tens /= 10 ; - } ; - - while (width_specifier -- > 0) - log_putchar (psf, lead_char) ; - break ; - - case 'c': /* char */ - c = va_arg (ap, int) & 0xFF ; - log_putchar (psf, c) ; - break ; - - case 'x': /* hex */ - case 'X': /* hex */ - d = va_arg (ap, int) ; - - if (d == 0) - { while (--width_specifier > 0) - log_putchar (psf, lead_char) ; - log_putchar (psf, '0') ; - break ; - } ; - shift = 28 ; - width = (width_specifier < 8) ? 8 : width_specifier ; - while (! ((0xF << shift) & d)) - { shift -= 4 ; - width -- ; - } ; - - while (width > 0 && width_specifier > width) - { log_putchar (psf, lead_char) ; - width_specifier-- ; - } ; - - while (shift >= 0) - { c = (d >> shift) & 0xF ; - log_putchar (psf, (c > 9) ? c + 'A' - 10 : c + '0') ; - shift -= 4 ; - } ; - break ; - - case 'M': /* int2str */ - d = va_arg (ap, int) ; - if (CPU_IS_LITTLE_ENDIAN) - { istr [0] = d & 0xFF ; - istr [1] = (d >> 8) & 0xFF ; - istr [2] = (d >> 16) & 0xFF ; - istr [3] = (d >> 24) & 0xFF ; - } - else - { istr [3] = d & 0xFF ; - istr [2] = (d >> 8) & 0xFF ; - istr [1] = (d >> 16) & 0xFF ; - istr [0] = (d >> 24) & 0xFF ; - } ; - istr [4] = 0 ; - strptr = istr ; - while (*strptr) - { c = *strptr++ ; - log_putchar (psf, c) ; - } ; - break ; - - default : - log_putchar (psf, '*') ; - log_putchar (psf, c) ; - log_putchar (psf, '*') ; - break ; - } /* switch */ - } /* while */ - - va_end (ap) ; - return ; -} /* psf_log_printf */ - -/*----------------------------------------------------------------------------------------------- -** ASCII header printf functions. -** Some formats (ie NIST) use ascii text in their headers. -** Format specifiers are the same as the standard printf specifiers (uses vsnprintf). -** If this generates a compile error on any system, the author should be notified -** so an alternative vsnprintf can be provided. -*/ - -void -psf_asciiheader_printf (SF_PRIVATE *psf, const char *format, ...) -{ va_list argptr ; - int maxlen ; - char *start ; - - maxlen = strlen ((char*) psf->header) ; - start = ((char*) psf->header) + maxlen ; - maxlen = sizeof (psf->header) - maxlen ; - - va_start (argptr, format) ; - vsnprintf (start, maxlen, format, argptr) ; - va_end (argptr) ; - - /* Make sure the string is properly terminated. */ - start [maxlen - 1] = 0 ; - - psf->headindex = strlen ((char*) psf->header) ; - - return ; -} /* psf_asciiheader_printf */ - -/*----------------------------------------------------------------------------------------------- -** Binary header writing functions. Returns number of bytes written. -** -** Format specifiers for psf_binheader_writef are as follows -** m - marker - four bytes - no endian manipulation -** -** e - all following numerical values will be little endian -** E - all following numerical values will be big endian -** -** t - all following O types will be truncated to 4 bytes -** T - switch off truncation of all following O types -** -** 1 - single byte value -** 2 - two byte value -** 3 - three byte value -** 4 - four byte value -** 8 - eight byte value (sometimes written as 4 bytes) -** -** s - string preceded by a four byte length -** S - string including null terminator -** f - floating point data -** d - double precision floating point data -** h - 16 binary bytes value -** -** b - binary data (see below) -** z - zero bytes (ses below) -** j - jump forwards or backwards -** -** To write a word followed by an int (both little endian) use: -** psf_binheader_writef ("e24", wordval, longval) ; -** -** To write binary data use: -** psf_binheader_writef ("b", &bindata, sizeof (bindata)) ; -** -** To write N zero bytes use: -** NOTE: due to platform issues (ie x86-64) you should cast the -** argument to size_t or ensure the variable type is size_t. -** psf_binheader_writef ("z", N) ; -*/ - -/* These macros may seem a bit messy but do prevent problems with processors which -** seg. fault when asked to write an int or short to a non-int/short aligned address. -*/ - -static inline void -header_put_byte (SF_PRIVATE *psf, char x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 1) - psf->header [psf->headindex++] = x ; -} /* header_put_byte */ - -#if (CPU_IS_BIG_ENDIAN == 1) -static inline void -header_put_marker (SF_PRIVATE *psf, int x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 4) - { psf->header [psf->headindex++] = (x >> 24) ; - psf->header [psf->headindex++] = (x >> 16) ; - psf->header [psf->headindex++] = (x >> 8) ; - psf->header [psf->headindex++] = x ; - } ; -} /* header_put_marker */ - -#elif (CPU_IS_LITTLE_ENDIAN == 1) -static inline void -header_put_marker (SF_PRIVATE *psf, int x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 4) - { psf->header [psf->headindex++] = x ; - psf->header [psf->headindex++] = (x >> 8) ; - psf->header [psf->headindex++] = (x >> 16) ; - psf->header [psf->headindex++] = (x >> 24) ; - } ; -} /* header_put_marker */ - -#else -# error "Cannot determine endian-ness of processor." -#endif - - -static inline void -header_put_be_short (SF_PRIVATE *psf, int x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 2) - { psf->header [psf->headindex++] = (x >> 8) ; - psf->header [psf->headindex++] = x ; - } ; -} /* header_put_be_short */ - -static inline void -header_put_le_short (SF_PRIVATE *psf, int x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 2) - { psf->header [psf->headindex++] = x ; - psf->header [psf->headindex++] = (x >> 8) ; - } ; -} /* header_put_le_short */ - -static inline void -header_put_be_3byte (SF_PRIVATE *psf, int x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 3) - { psf->header [psf->headindex++] = (x >> 16) ; - psf->header [psf->headindex++] = (x >> 8) ; - psf->header [psf->headindex++] = x ; - } ; -} /* header_put_be_3byte */ - -static inline void -header_put_le_3byte (SF_PRIVATE *psf, int x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 3) - { psf->header [psf->headindex++] = x ; - psf->header [psf->headindex++] = (x >> 8) ; - psf->header [psf->headindex++] = (x >> 16) ; - } ; -} /* header_put_le_3byte */ - -static inline void -header_put_be_int (SF_PRIVATE *psf, int x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 4) - { psf->header [psf->headindex++] = (x >> 24) ; - psf->header [psf->headindex++] = (x >> 16) ; - psf->header [psf->headindex++] = (x >> 8) ; - psf->header [psf->headindex++] = x ; - } ; -} /* header_put_be_int */ - -static inline void -header_put_le_int (SF_PRIVATE *psf, int x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 4) - { psf->header [psf->headindex++] = x ; - psf->header [psf->headindex++] = (x >> 8) ; - psf->header [psf->headindex++] = (x >> 16) ; - psf->header [psf->headindex++] = (x >> 24) ; - } ; -} /* header_put_le_int */ - -#if (SIZEOF_SF_COUNT_T == 4) - -static inline void -header_put_be_8byte (SF_PRIVATE *psf, sf_count_t x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 8) - { psf->header [psf->headindex++] = 0 ; - psf->header [psf->headindex++] = 0 ; - psf->header [psf->headindex++] = 0 ; - psf->header [psf->headindex++] = 0 ; - psf->header [psf->headindex++] = (x >> 24) ; - psf->header [psf->headindex++] = (x >> 16) ; - psf->header [psf->headindex++] = (x >> 8) ; - psf->header [psf->headindex++] = x ; - } ; -} /* header_put_be_8byte */ - -static inline void -header_put_le_8byte (SF_PRIVATE *psf, sf_count_t x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 8) - { psf->header [psf->headindex++] = x ; - psf->header [psf->headindex++] = (x >> 8) ; - psf->header [psf->headindex++] = (x >> 16) ; - psf->header [psf->headindex++] = (x >> 24) ; - psf->header [psf->headindex++] = 0 ; - psf->header [psf->headindex++] = 0 ; - psf->header [psf->headindex++] = 0 ; - psf->header [psf->headindex++] = 0 ; - } ; -} /* header_put_le_8byte */ - -#elif (SIZEOF_SF_COUNT_T == 8) - -static inline void -header_put_be_8byte (SF_PRIVATE *psf, sf_count_t x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 8) - { psf->header [psf->headindex++] = (x >> 56) ; - psf->header [psf->headindex++] = (x >> 48) ; - psf->header [psf->headindex++] = (x >> 40) ; - psf->header [psf->headindex++] = (x >> 32) ; - psf->header [psf->headindex++] = (x >> 24) ; - psf->header [psf->headindex++] = (x >> 16) ; - psf->header [psf->headindex++] = (x >> 8) ; - psf->header [psf->headindex++] = x ; - } ; -} /* header_put_be_8byte */ - -static inline void -header_put_le_8byte (SF_PRIVATE *psf, sf_count_t x) -{ if (psf->headindex < SIGNED_SIZEOF (psf->header) - 8) - { psf->header [psf->headindex++] = x ; - psf->header [psf->headindex++] = (x >> 8) ; - psf->header [psf->headindex++] = (x >> 16) ; - psf->header [psf->headindex++] = (x >> 24) ; - psf->header [psf->headindex++] = (x >> 32) ; - psf->header [psf->headindex++] = (x >> 40) ; - psf->header [psf->headindex++] = (x >> 48) ; - psf->header [psf->headindex++] = (x >> 56) ; - } ; -} /* header_put_le_8byte */ - -#else -#error "SIZEOF_SF_COUNT_T is not defined." -#endif - -int -psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...) -{ va_list argptr ; - sf_count_t countdata ; - unsigned long longdata ; - unsigned int data ; - float floatdata ; - double doubledata ; - void *bindata ; - size_t size ; - char c, *strptr ; - int count = 0, trunc_8to4 ; - - trunc_8to4 = SF_FALSE ; - - va_start (argptr, format) ; - - while ((c = *format++)) - { switch (c) - { case ' ' : /* Do nothing. Just used to space out format string. */ - break ; - - case 'e' : /* All conversions are now from LE to host. */ - psf->rwf_endian = SF_ENDIAN_LITTLE ; - break ; - - case 'E' : /* All conversions are now from BE to host. */ - psf->rwf_endian = SF_ENDIAN_BIG ; - break ; - - case 't' : /* All 8 byte values now get written as 4 bytes. */ - trunc_8to4 = SF_TRUE ; - break ; - - case 'T' : /* All 8 byte values now get written as 8 bytes. */ - trunc_8to4 = SF_FALSE ; - break ; - - case 'm' : - data = va_arg (argptr, unsigned int) ; - header_put_marker (psf, data) ; - count += 4 ; - break ; - - case '1' : - data = va_arg (argptr, unsigned int) ; - header_put_byte (psf, data) ; - count += 1 ; - break ; - - case '2' : - data = va_arg (argptr, unsigned int) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - { header_put_be_short (psf, data) ; - } - else - { header_put_le_short (psf, data) ; - } ; - count += 2 ; - break ; - - case '3' : /* tribyte */ - data = va_arg (argptr, unsigned int) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - { header_put_be_3byte (psf, data) ; - } - else - { header_put_le_3byte (psf, data) ; - } ; - count += 3 ; - break ; - - case '4' : - data = va_arg (argptr, unsigned int) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - { header_put_be_int (psf, data) ; - } - else - { header_put_le_int (psf, data) ; - } ; - count += 4 ; - break ; - - case '8' : - countdata = va_arg (argptr, sf_count_t) ; - if (psf->rwf_endian == SF_ENDIAN_BIG && trunc_8to4 == SF_FALSE) - { header_put_be_8byte (psf, countdata) ; - count += 8 ; - } - else if (psf->rwf_endian == SF_ENDIAN_LITTLE && trunc_8to4 == SF_FALSE) - { header_put_le_8byte (psf, countdata) ; - count += 8 ; - } - else if (psf->rwf_endian == SF_ENDIAN_BIG && trunc_8to4 == SF_TRUE) - { longdata = countdata & 0xFFFFFFFF ; - header_put_be_int (psf, longdata) ; - count += 4 ; - } - else if (psf->rwf_endian == SF_ENDIAN_LITTLE && trunc_8to4 == SF_TRUE) - { longdata = countdata & 0xFFFFFFFF ; - header_put_le_int (psf, longdata) ; - count += 4 ; - } - break ; - - case 'f' : - /* Floats are passed as doubles. Is this always true? */ - floatdata = (float) va_arg (argptr, double) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - float32_be_write (floatdata, psf->header + psf->headindex) ; - else - float32_le_write (floatdata, psf->header + psf->headindex) ; - psf->headindex += 4 ; - count += 4 ; - break ; - - case 'd' : - doubledata = va_arg (argptr, double) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - double64_be_write (doubledata, psf->header + psf->headindex) ; - else - double64_le_write (doubledata, psf->header + psf->headindex) ; - psf->headindex += 8 ; - count += 8 ; - break ; - - case 's' : - /* Write a C string (guaranteed to have a zero terminator). */ - strptr = va_arg (argptr, char *) ; - size = strlen (strptr) + 1 ; - size += (size & 1) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - header_put_be_int (psf, size) ; - else - header_put_le_int (psf, size) ; - memcpy (&(psf->header [psf->headindex]), strptr, size) ; - psf->headindex += size ; - psf->header [psf->headindex - 1] = 0 ; - count += 4 + size ; - break ; - - case 'S' : - /* - ** Write an AIFF style string (no zero terminator but possibly - ** an extra pad byte if the string length is odd). - */ - strptr = va_arg (argptr, char *) ; - size = strlen (strptr) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - header_put_be_int (psf, size) ; - else - header_put_le_int (psf, size) ; - memcpy (&(psf->header [psf->headindex]), strptr, size + 1) ; - size += (size & 1) ; - psf->headindex += size ; - psf->header [psf->headindex] = 0 ; - count += 4 + size ; - break ; - - case 'b' : - bindata = va_arg (argptr, void *) ; - size = va_arg (argptr, size_t) ; - memcpy (&(psf->header [psf->headindex]), bindata, size) ; - psf->headindex += size ; - count += size ; - break ; - - case 'z' : - size = va_arg (argptr, size_t) ; - count += size ; - while (size) - { psf->header [psf->headindex] = 0 ; - psf->headindex ++ ; - size -- ; - } ; - break ; - - case 'h' : - bindata = va_arg (argptr, void *) ; - memcpy (&(psf->header [psf->headindex]), bindata, 16) ; - psf->headindex += 16 ; - count += 16 ; - break ; - - case 'j' : - size = va_arg (argptr, size_t) ; - psf->headindex += size ; - count = size ; - break ; - - default : - psf_log_printf (psf, "*** Invalid format specifier `%c'\n", c) ; - psf->error = SFE_INTERNAL ; - break ; - } ; - } ; - - va_end (argptr) ; - return count ; -} /* psf_binheader_writef */ - -/*----------------------------------------------------------------------------------------------- -** Binary header reading functions. Returns number of bytes read. -** -** Format specifiers are the same as for header write function above with the following -** additions: -** -** p - jump a given number of position from start of file. -** -** If format is NULL, psf_binheader_readf returns the current offset. -*/ - -#if (CPU_IS_BIG_ENDIAN == 1) -#define GET_MARKER(ptr) ( ((ptr) [0] << 24) | ((ptr) [1] << 16) | \ - ((ptr) [2] << 8) | ((ptr) [3])) - -#elif (CPU_IS_LITTLE_ENDIAN == 1) -#define GET_MARKER(ptr) ( ((ptr) [0]) | ((ptr) [1] << 8) | \ - ((ptr) [2] << 16) | ((ptr) [3] << 24)) - -#else -# error "Cannot determine endian-ness of processor." -#endif - -#define GET_LE_SHORT(ptr) (((ptr) [1] << 8) | ((ptr) [0])) -#define GET_BE_SHORT(ptr) (((ptr) [0] << 8) | ((ptr) [1])) - -#define GET_LE_3BYTE(ptr) ( ((ptr) [2] << 16) | ((ptr) [1] << 8) | ((ptr) [0])) -#define GET_BE_3BYTE(ptr) ( ((ptr) [0] << 16) | ((ptr) [1] << 8) | ((ptr) [2])) - -#define GET_LE_INT(ptr) ( ((ptr) [3] << 24) | ((ptr) [2] << 16) | \ - ((ptr) [1] << 8) | ((ptr) [0])) - -#define GET_BE_INT(ptr) ( ((ptr) [0] << 24) | ((ptr) [1] << 16) | \ - ((ptr) [2] << 8) | ((ptr) [3])) - -#define GET_LE_8BYTE(ptr) ( (((sf_count_t) (ptr) [7]) << 56) | (((sf_count_t) (ptr) [6]) << 48) | \ - (((sf_count_t) (ptr) [5]) << 40) | (((sf_count_t) (ptr) [4]) << 32) | \ - (((sf_count_t) (ptr) [3]) << 24) | (((sf_count_t) (ptr) [2]) << 16) | \ - (((sf_count_t) (ptr) [1]) << 8) | ((ptr) [0])) - -#define GET_BE_8BYTE(ptr) ( (((sf_count_t) (ptr) [0]) << 56) | (((sf_count_t) (ptr) [1]) << 48) | \ - (((sf_count_t) (ptr) [2]) << 40) | (((sf_count_t) (ptr) [3]) << 32) | \ - (((sf_count_t) (ptr) [4]) << 24) | (((sf_count_t) (ptr) [5]) << 16) | \ - (((sf_count_t) (ptr) [6]) << 8) | ((ptr) [7])) - - - -static int -header_read (SF_PRIVATE *psf, void *ptr, int bytes) -{ int count = 0 ; - - if (psf->headindex >= SIGNED_SIZEOF (psf->header)) - { memset (ptr, 0, SIGNED_SIZEOF (psf->header) - psf->headindex) ; - - /* This is the best that we can do. */ - psf_fseek (psf, bytes, SEEK_CUR) ; - return bytes ; - } ; - - if (psf->headindex + bytes > SIGNED_SIZEOF (psf->header)) - { int most ; - - most = SIGNED_SIZEOF (psf->header) - psf->headindex ; - psf_fread (psf->header + psf->headend, 1, most, psf) ; - memset ((char *) ptr + most, 0, bytes - most) ; - - psf_fseek (psf, bytes - most, SEEK_CUR) ; - return bytes ; - } ; - - if (psf->headindex + bytes > psf->headend) - { count = psf_fread (psf->header + psf->headend, 1, bytes - (psf->headend - psf->headindex), psf) ; - if (count != bytes - (int) (psf->headend - psf->headindex)) - { psf_log_printf (psf, "Error : psf_fread returned short count.\n") ; - return 0 ; - } ; - psf->headend += count ; - } ; - - memcpy (ptr, psf->header + psf->headindex, bytes) ; - psf->headindex += bytes ; - - return bytes ; -} /* header_read */ - -static void -header_seek (SF_PRIVATE *psf, sf_count_t position, int whence) -{ - - switch (whence) - { case SEEK_SET : - if (position > SIGNED_SIZEOF (psf->header)) - { /* Too much header to cache so just seek instead. */ - psf_fseek (psf, position, whence) ; - return ; - } ; - if (position > psf->headend) - psf->headend += psf_fread (psf->header + psf->headend, 1, position - psf->headend, psf) ; - psf->headindex = position ; - break ; - - case SEEK_CUR : - if (psf->headindex + position < 0) - break ; - - if (psf->headindex >= SIGNED_SIZEOF (psf->header)) - { psf_fseek (psf, position, whence) ; - return ; - } ; - - if (psf->headindex + position <= psf->headend) - { psf->headindex += position ; - break ; - } ; - - if (psf->headindex + position > SIGNED_SIZEOF (psf->header)) - { /* Need to jump this without caching it. */ - psf->headindex = psf->headend ; - psf_fseek (psf, position, SEEK_CUR) ; - break ; - } ; - - psf->headend += psf_fread (psf->header + psf->headend, 1, position - (psf->headend - psf->headindex), psf) ; - psf->headindex = psf->headend ; - break ; - - case SEEK_END : - default : - psf_log_printf (psf, "Bad whence param in header_seek().\n") ; - break ; - } ; - - return ; -} /* header_seek */ - -static int -header_gets (SF_PRIVATE *psf, char *ptr, int bufsize) -{ - int k ; - - for (k = 0 ; k < bufsize - 1 ; k++) - { if (psf->headindex < psf->headend) - { ptr [k] = psf->header [psf->headindex] ; - psf->headindex ++ ; - } - else - { psf->headend += psf_fread (psf->header + psf->headend, 1, 1, psf) ; - ptr [k] = psf->header [psf->headindex] ; - psf->headindex = psf->headend ; - } ; - - if (ptr [k] == '\n') - break ; - } ; - - ptr [k] = 0 ; - - return k ; -} /* header_gets */ - -int -psf_binheader_readf (SF_PRIVATE *psf, char const *format, ...) -{ va_list argptr ; - sf_count_t *countptr, countdata ; - unsigned char *ucptr, sixteen_bytes [16] ; - unsigned int *intptr, intdata ; - unsigned short *shortptr ; - char *charptr ; - float *floatptr ; - double *doubleptr ; - char c ; - int byte_count = 0, count ; - - if (! format) - return psf_ftell (psf) ; - - va_start (argptr, format) ; - - while ((c = *format++)) - { switch (c) - { case 'e' : /* All conversions are now from LE to host. */ - psf->rwf_endian = SF_ENDIAN_LITTLE ; - break ; - - case 'E' : /* All conversions are now from BE to host. */ - psf->rwf_endian = SF_ENDIAN_BIG ; - break ; - - case 'm' : - intptr = va_arg (argptr, unsigned int*) ; - ucptr = (unsigned char*) intptr ; - byte_count += header_read (psf, ucptr, sizeof (int)) ; - *intptr = GET_MARKER (ucptr) ; - break ; - - case 'h' : - intptr = va_arg (argptr, unsigned int*) ; - ucptr = (unsigned char*) intptr ; - byte_count += header_read (psf, sixteen_bytes, sizeof (sixteen_bytes)) ; - { int k ; - intdata = 0 ; - for (k = 0 ; k < 16 ; k++) - intdata ^= sixteen_bytes [k] << k ; - } - *intptr = intdata ; - break ; - - case '1' : - charptr = va_arg (argptr, char*) ; - *charptr = 0 ; - byte_count += header_read (psf, charptr, sizeof (char)) ; - break ; - - case '2' : - shortptr = va_arg (argptr, unsigned short*) ; - *shortptr = 0 ; - ucptr = (unsigned char*) shortptr ; - byte_count += header_read (psf, ucptr, sizeof (short)) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - *shortptr = GET_BE_SHORT (ucptr) ; - else - *shortptr = GET_LE_SHORT (ucptr) ; - break ; - - case '3' : - intptr = va_arg (argptr, unsigned int*) ; - *intptr = 0 ; - byte_count += header_read (psf, sixteen_bytes, 3) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - *intptr = GET_BE_3BYTE (sixteen_bytes) ; - else - *intptr = GET_LE_3BYTE (sixteen_bytes) ; - break ; - - case '4' : - intptr = va_arg (argptr, unsigned int*) ; - *intptr = 0 ; - ucptr = (unsigned char*) intptr ; - byte_count += header_read (psf, ucptr, sizeof (int)) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - *intptr = GET_BE_INT (ucptr) ; - else - *intptr = GET_LE_INT (ucptr) ; - break ; - - case '8' : - countptr = va_arg (argptr, sf_count_t *) ; - *countptr = 0 ; - byte_count += header_read (psf, sixteen_bytes, 8) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - countdata = GET_BE_8BYTE (sixteen_bytes) ; - else - countdata = GET_LE_8BYTE (sixteen_bytes) ; - *countptr = countdata ; - break ; - - case 'f' : /* Float conversion */ - floatptr = va_arg (argptr, float *) ; - *floatptr = 0.0 ; - byte_count += header_read (psf, floatptr, sizeof (float)) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - *floatptr = float32_be_read ((unsigned char*) floatptr) ; - else - *floatptr = float32_le_read ((unsigned char*) floatptr) ; - break ; - - case 'd' : /* double conversion */ - doubleptr = va_arg (argptr, double *) ; - *doubleptr = 0.0 ; - byte_count += header_read (psf, doubleptr, sizeof (double)) ; - if (psf->rwf_endian == SF_ENDIAN_BIG) - *doubleptr = double64_be_read ((unsigned char*) doubleptr) ; - else - *doubleptr = double64_le_read ((unsigned char*) doubleptr) ; - break ; - - case 's' : - psf_log_printf (psf, "Format conversion 's' not implemented yet.\n") ; - /* - strptr = va_arg (argptr, char *) ; - size = strlen (strptr) + 1 ; - size += (size & 1) ; - longdata = H2LE_32 (size) ; - get_int (psf, longdata) ; - memcpy (&(psf->header [psf->headindex]), strptr, size) ; - psf->headindex += size ; - */ - break ; - - case 'b' : - charptr = va_arg (argptr, char*) ; - count = va_arg (argptr, size_t) ; - if (count > 0) - byte_count += header_read (psf, charptr, count) ; - break ; - - case 'G' : - charptr = va_arg (argptr, char*) ; - count = va_arg (argptr, size_t) ; - if (count > 0) - byte_count += header_gets (psf, charptr, count) ; - break ; - - case 'z' : - psf_log_printf (psf, "Format conversion 'z' not implemented yet.\n") ; - /* - size = va_arg (argptr, size_t) ; - while (size) - { psf->header [psf->headindex] = 0 ; - psf->headindex ++ ; - size -- ; - } ; - */ - break ; - - case 'p' : - /* Get the seek position first. */ - count = va_arg (argptr, size_t) ; - header_seek (psf, count, SEEK_SET) ; - byte_count = count ; - break ; - - case 'j' : - /* Get the seek position first. */ - count = va_arg (argptr, size_t) ; - header_seek (psf, count, SEEK_CUR) ; - byte_count += count ; - break ; - - default : - psf_log_printf (psf, "*** Invalid format specifier `%c'\n", c) ; - psf->error = SFE_INTERNAL ; - break ; - } ; - } ; - - va_end (argptr) ; - - return byte_count ; -} /* psf_binheader_readf */ - -/*----------------------------------------------------------------------------------------------- -*/ - -sf_count_t -psf_default_seek (SF_PRIVATE *psf, int UNUSED (mode), sf_count_t samples_from_start) -{ sf_count_t position, retval ; - - if (! (psf->blockwidth && psf->dataoffset >= 0)) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - if (! psf->sf.seekable) - { psf->error = SFE_NOT_SEEKABLE ; - return PSF_SEEK_ERROR ; - } ; - - position = psf->dataoffset + psf->blockwidth * samples_from_start ; - - if ((retval = psf_fseek (psf, position, SEEK_SET)) != position) - { psf->error = SFE_SEEK_FAILED ; - return PSF_SEEK_ERROR ; - } ; - - return samples_from_start ; -} /* psf_default_seek */ - -/*----------------------------------------------------------------------------------------------- -*/ - -void -psf_hexdump (const void *ptr, int len) -{ const char *data ; - char ascii [17] ; - int k, m ; - - if ((data = ptr) == NULL) - return ; - if (len <= 0) - return ; - - puts ("") ; - for (k = 0 ; k < len ; k += 16) - { memset (ascii, ' ', sizeof (ascii)) ; - - printf ("%08X: ", k) ; - for (m = 0 ; m < 16 && k + m < len ; m++) - { printf (m == 8 ? " %02X " : "%02X ", data [k + m] & 0xFF) ; - ascii [m] = psf_isprint (data [k + m]) ? data [k + m] : '.' ; - } ; - - if (m <= 8) printf (" ") ; - for ( ; m < 16 ; m++) printf (" ") ; - - ascii [16] = 0 ; - printf (" %s\n", ascii) ; - } ; - - puts ("") ; -} /* psf_hexdump */ - -void -psf_log_SF_INFO (SF_PRIVATE *psf) -{ psf_log_printf (psf, "---------------------------------\n") ; - - psf_log_printf (psf, " Sample rate : %d\n", psf->sf.samplerate) ; - if (psf->sf.frames == SF_COUNT_MAX) - psf_log_printf (psf, " Frames : unknown\n") ; - else - psf_log_printf (psf, " Frames : %D\n", psf->sf.frames) ; - psf_log_printf (psf, " Channels : %d\n", psf->sf.channels) ; - - psf_log_printf (psf, " Format : 0x%X\n", psf->sf.format) ; - psf_log_printf (psf, " Sections : %d\n", psf->sf.sections) ; - psf_log_printf (psf, " Seekable : %s\n", psf->sf.seekable ? "TRUE" : "FALSE") ; - - psf_log_printf (psf, "---------------------------------\n") ; -} /* psf_dump_SFINFO */ - -/*======================================================================================== -*/ - -void* -psf_memset (void *s, int c, sf_count_t len) -{ char *ptr ; - int setcount ; - - ptr = (char *) s ; - - while (len > 0) - { setcount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - memset (ptr, c, setcount) ; - - ptr += setcount ; - len -= setcount ; - } ; - - return s ; -} /* psf_memset */ - -SF_INSTRUMENT * -psf_instrument_alloc (void) -{ SF_INSTRUMENT *instr ; - - instr = calloc (1, sizeof (SF_INSTRUMENT)) ; - - if (instr == NULL) - return NULL ; - - /* Set non-zero default values. */ - instr->basenote = -1 ; - instr->velocity_lo = -1 ; - instr->velocity_hi = -1 ; - instr->key_lo = -1 ; - instr->key_hi = -1 ; - - return instr ; -} /* psf_instrument_alloc */ - -void -psf_sanitize_string (char * cptr, int len) -{ - do - { - len -- ; - cptr [len] = psf_isprint (cptr [len]) ? cptr [len] : '.' ; - } - while (len > 0) ; -} /* psf_sanitize_string */ - -void -psf_get_date_str (char *str, int maxlen) -{ time_t current ; - struct tm timedata, *tmptr ; - - time (¤t) ; - -#if defined (HAVE_GMTIME_R) - /* If the re-entrant version is available, use it. */ - tmptr = gmtime_r (¤t, &timedata) ; -#elif defined (HAVE_GMTIME) - /* Otherwise use the standard one and copy the data to local storage. */ - tmptr = gmtime (¤t) ; - memcpy (&timedata, tmptr, sizeof (timedata)) ; -#else - tmptr = NULL ; -#endif - - if (tmptr) - snprintf (str, maxlen, "%4d-%02d-%02d %02d:%02d:%02d UTC", - 1900 + timedata.tm_year, timedata.tm_mon, timedata.tm_mday, - timedata.tm_hour, timedata.tm_min, timedata.tm_sec) ; - else - snprintf (str, maxlen, "Unknown date") ; - - return ; -} /* psf_get_date_str */ - -int -subformat_to_bytewidth (int format) -{ - switch (format) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_S8 : - return 1 ; - case SF_FORMAT_PCM_16 : - return 2 ; - case SF_FORMAT_PCM_24 : - return 3 ; - case SF_FORMAT_PCM_32 : - case SF_FORMAT_FLOAT : - return 4 ; - case SF_FORMAT_DOUBLE : - return 8 ; - } ; - - return 0 ; -} /* subformat_to_bytewidth */ - -int -s_bitwidth_to_subformat (int bits) -{ static int array [] = - { SF_FORMAT_PCM_S8, SF_FORMAT_PCM_16, SF_FORMAT_PCM_24, SF_FORMAT_PCM_32 - } ; - - if (bits < 8 || bits > 32) - return 0 ; - - return array [((bits + 7) / 8) - 1] ; -} /* bitwidth_to_subformat */ - -int -u_bitwidth_to_subformat (int bits) -{ static int array [] = - { SF_FORMAT_PCM_U8, SF_FORMAT_PCM_16, SF_FORMAT_PCM_24, SF_FORMAT_PCM_32 - } ; - - if (bits < 8 || bits > 32) - return 0 ; - - return array [((bits + 7) / 8) - 1] ; -} /* bitwidth_to_subformat */ - -/* -** psf_rand_int32 : Not crypto quality, but more than adequate for things -** like stream serial numbers in Ogg files or the unique_id field of the -** SF_PRIVATE struct. -*/ - -int32_t -psf_rand_int32 (void) -{ static int32_t value = -1 ; - int k, count ; - - if (value == -1) - { -#if HAVE_GETTIMEOFDAY - struct timeval tv ; - gettimeofday (&tv, NULL) ; - value = tv.tv_sec + tv.tv_usec ; -#else - value = time (NULL) ; -#endif - } ; - - count = 4 + (value & 7) ; - for (k = 0 ; k < count ; k++) - value = 11117 * value + 211231 ; - - return value ; -} /* psf_rand_int32 */ - -void -append_snprintf (char * dest, size_t maxlen, const char * fmt, ...) -{ size_t len = strlen (dest) ; - - if (len < maxlen) - { va_list ap ; - - va_start (ap, fmt) ; - vsnprintf (dest + len, maxlen - len, fmt, ap) ; - va_end (ap) ; - } ; - - return ; -} /* append_snprintf */ - - -void -psf_strlcpy_crlf (char *dest, const char *src, size_t destmax, size_t srcmax) -{ /* Must be minus 2 so it can still expand a single trailing '\n' or '\r'. */ - char * destend = dest + destmax - 2 ; - const char * srcend = src + srcmax ; - - while (dest < destend && src < srcend) - { if ((src [0] == '\r' && src [1] == '\n') || (src [0] == '\n' && src [1] == '\r')) - { *dest++ = '\r' ; - *dest++ = '\n' ; - src += 2 ; - continue ; - } ; - - if (src [0] == '\r') - { *dest++ = '\r' ; - *dest++ = '\n' ; - src += 1 ; - continue ; - } ; - - if (src [0] == '\n') - { *dest++ = '\r' ; - *dest++ = '\n' ; - src += 1 ; - continue ; - } ; - - *dest++ = *src++ ; - } ; - - /* Make sure dest is terminated. */ - *dest = 0 ; -} /* psf_strlcpy_crlf */ - -sf_count_t -psf_decode_frame_count (SF_PRIVATE *psf) -{ sf_count_t count, readlen, total = 0 ; - BUF_UNION ubuf ; - - /* If we're reading from a pipe or the file is too long, just return SF_COUNT_MAX. */ - if (psf_is_pipe (psf) || psf->datalength > 0x1000000) - return SF_COUNT_MAX ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - readlen = ARRAY_LEN (ubuf.ibuf) / psf->sf.channels ; - readlen *= psf->sf.channels ; - - while ((count = psf->read_int (psf, ubuf.ibuf, readlen)) > 0) - total += count ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - return total / psf->sf.channels ; -} /* psf_decode_frame_count */ - -/*============================================================================== -*/ - -#define CASE_NAME(x) case x : return #x ; break ; - -const char * -str_of_major_format (int format) -{ switch (SF_CONTAINER (format)) - { CASE_NAME (SF_FORMAT_WAV) ; - CASE_NAME (SF_FORMAT_AIFF) ; - CASE_NAME (SF_FORMAT_AU) ; - CASE_NAME (SF_FORMAT_RAW) ; - CASE_NAME (SF_FORMAT_PAF) ; - CASE_NAME (SF_FORMAT_SVX) ; - CASE_NAME (SF_FORMAT_NIST) ; - CASE_NAME (SF_FORMAT_VOC) ; - CASE_NAME (SF_FORMAT_IRCAM) ; - CASE_NAME (SF_FORMAT_W64) ; - CASE_NAME (SF_FORMAT_MAT4) ; - CASE_NAME (SF_FORMAT_MAT5) ; - CASE_NAME (SF_FORMAT_PVF) ; - CASE_NAME (SF_FORMAT_XI) ; - CASE_NAME (SF_FORMAT_HTK) ; - CASE_NAME (SF_FORMAT_SDS) ; - CASE_NAME (SF_FORMAT_AVR) ; - CASE_NAME (SF_FORMAT_WAVEX) ; - CASE_NAME (SF_FORMAT_SD2) ; - CASE_NAME (SF_FORMAT_FLAC) ; - CASE_NAME (SF_FORMAT_CAF) ; - CASE_NAME (SF_FORMAT_WVE) ; - CASE_NAME (SF_FORMAT_OGG) ; - default : - break ; - } ; - - return "BAD_MAJOR_FORMAT" ; -} /* str_of_major_format */ - -const char * -str_of_minor_format (int format) -{ switch (SF_CODEC (format)) - { CASE_NAME (SF_FORMAT_PCM_S8) ; - CASE_NAME (SF_FORMAT_PCM_16) ; - CASE_NAME (SF_FORMAT_PCM_24) ; - CASE_NAME (SF_FORMAT_PCM_32) ; - CASE_NAME (SF_FORMAT_PCM_U8) ; - CASE_NAME (SF_FORMAT_FLOAT) ; - CASE_NAME (SF_FORMAT_DOUBLE) ; - CASE_NAME (SF_FORMAT_ULAW) ; - CASE_NAME (SF_FORMAT_ALAW) ; - CASE_NAME (SF_FORMAT_IMA_ADPCM) ; - CASE_NAME (SF_FORMAT_MS_ADPCM) ; - CASE_NAME (SF_FORMAT_GSM610) ; - CASE_NAME (SF_FORMAT_VOX_ADPCM) ; - CASE_NAME (SF_FORMAT_G721_32) ; - CASE_NAME (SF_FORMAT_G723_24) ; - CASE_NAME (SF_FORMAT_G723_40) ; - CASE_NAME (SF_FORMAT_DWVW_12) ; - CASE_NAME (SF_FORMAT_DWVW_16) ; - CASE_NAME (SF_FORMAT_DWVW_24) ; - CASE_NAME (SF_FORMAT_DWVW_N) ; - CASE_NAME (SF_FORMAT_DPCM_8) ; - CASE_NAME (SF_FORMAT_DPCM_16) ; - CASE_NAME (SF_FORMAT_VORBIS) ; - default : - break ; - } ; - - return "BAD_MINOR_FORMAT" ; -} /* str_of_minor_format */ - -const char * -str_of_open_mode (int mode) -{ switch (mode) - { CASE_NAME (SFM_READ) ; - CASE_NAME (SFM_WRITE) ; - CASE_NAME (SFM_RDWR) ; - - default : - break ; - } ; - - return "BAD_MODE" ; -} /* str_of_open_mode */ - -const char * -str_of_endianness (int end) -{ switch (end) - { CASE_NAME (SF_ENDIAN_BIG) ; - CASE_NAME (SF_ENDIAN_LITTLE) ; - CASE_NAME (SF_ENDIAN_CPU) ; - default : - break ; - } ; - - /* Zero length string for SF_ENDIAN_FILE. */ - return "" ; -} /* str_of_endianness */ - -/*============================================================================== -*/ - -void -psf_f2s_array (const float *src, short *dest, int count, int normalize) -{ float normfact ; - - normfact = normalize ? (1.0 * 0x7FFF) : 1.0 ; - while (--count >= 0) - dest [count] = lrintf (src [count] * normfact) ; - - return ; -} /* psf_f2s_array */ - -void -psf_f2s_clip_array (const float *src, short *dest, int count, int normalize) -{ float normfact, scaled_value ; - - normfact = normalize ? (1.0 * 0x8000) : 1.0 ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFF)) - { dest [count] = 0x7FFF ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x1000)) - { dest [count] = 0x8000 ; - continue ; - } ; - - dest [count] = lrintf (scaled_value) ; - } ; - - return ; -} /* psf_f2s_clip_array */ - -void -psf_d2s_array (const double *src, short *dest, int count, int normalize) -{ double normfact ; - - normfact = normalize ? (1.0 * 0x7FFF) : 1.0 ; - while (--count >= 0) - dest [count] = lrint (src [count] * normfact) ; - - return ; -} /* psf_f2s_array */ - -void -psf_d2s_clip_array (const double *src, short *dest, int count, int normalize) -{ double normfact, scaled_value ; - - normfact = normalize ? (1.0 * 0x8000) : 1.0 ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFF)) - { dest [count] = 0x7FFF ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x1000)) - { dest [count] = 0x8000 ; - continue ; - } ; - - dest [count] = lrint (scaled_value) ; - } ; - - return ; -} /* psf_d2s_clip_array */ - - -void -psf_f2i_array (const float *src, int *dest, int count, int normalize) -{ float normfact ; - - normfact = normalize ? (1.0 * 0x7FFFFFFF) : 1.0 ; - while (--count >= 0) - dest [count] = lrintf (src [count] * normfact) ; - - return ; -} /* psf_f2i_array */ - -void -psf_f2i_clip_array (const float *src, int *dest, int count, int normalize) -{ float normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10000000) : 1.0 ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { dest [count] = 0x7FFFFFFF ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { dest [count] = 0x80000000 ; - continue ; - } ; - - dest [count] = lrintf (scaled_value) ; - } ; - - return ; -} /* psf_f2i_clip_array */ - -void -psf_d2i_array (const double *src, int *dest, int count, int normalize) -{ double normfact ; - - normfact = normalize ? (1.0 * 0x7FFFFFFF) : 1.0 ; - while (--count >= 0) - dest [count] = lrint (src [count] * normfact) ; - - return ; -} /* psf_f2i_array */ - -void -psf_d2i_clip_array (const double *src, int *dest, int count, int normalize) -{ double normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10000000) : 1.0 ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { dest [count] = 0x7FFFFFFF ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { dest [count] = 0x80000000 ; - continue ; - } ; - - dest [count] = lrint (scaled_value) ; - } ; - - return ; -} /* psf_d2i_clip_array */ - -FILE * -psf_open_tmpfile (char * fname, size_t fnamelen) -{ const char * tmpdir ; - FILE * file ; - - if (OS_IS_WIN32) - tmpdir = getenv ("TEMP") ; - else - { tmpdir = getenv ("TMPDIR") ; - tmpdir = tmpdir == NULL ? "/tmp" : tmpdir ; - } ; - -// if (tmpdir && access (tmpdir, R_OK | W_OK | X_OK) == 0) - { snprintf (fname, fnamelen, "%s/%x%x-alac.tmp", tmpdir, psf_rand_int32 (), psf_rand_int32 ()) ; - if ((file = fopen (fname, "wb+")) != NULL) - return file ; - } ; - - snprintf (fname, fnamelen, "%x%x-alac.tmp", psf_rand_int32 (), psf_rand_int32 ()) ; - if ((file = fopen (fname, "wb+")) != NULL) - return file ; - - memset (fname, 0, fnamelen) ; - return NULL ; -} /* psf_open_tmpfile */ diff --git a/libs/libsndfile/src/common.h b/libs/libsndfile/src/common.h deleted file mode 100644 index 4d61619804..0000000000 --- a/libs/libsndfile/src/common.h +++ /dev/null @@ -1,1044 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef SNDFILE_COMMON_H -#define SNDFILE_COMMON_H - -#include "sfconfig.h" - -#include -#include - -#if HAVE_STDINT_H -#include -#elif HAVE_INTTYPES_H -#include -#endif - -#ifndef SNDFILE_H -#include "sndfile.h" -#endif - -#ifdef __cplusplus -#error "This code is not designed to be compiled with a C++ compiler." -#endif - -#if (SIZEOF_LONG == 8) -# define SF_PLATFORM_S64(x) x##l -#elif (SIZEOF_LONG_LONG == 8) -# define SF_PLATFORM_S64(x) x##ll -#elif COMPILER_IS_GCC -# define SF_PLATFORM_S64(x) x##ll -#elif OS_IS_WIN32 -# define SF_PLATFORM_S64(x) x##I64 -#else -# error "Don't know how to define a 64 bit integer constant." -#endif - - - -/* -** Inspiration : http://sourcefrog.net/weblog/software/languages/C/unused.html -*/ -#ifdef UNUSED -#elif defined (__GNUC__) -# define UNUSED(x) UNUSED_ ## x __attribute__ ((unused)) -#elif defined (__LCLINT__) -# define UNUSED(x) /*@unused@*/ x -#else -# define UNUSED(x) x -#endif - -#ifdef __GNUC__ -# define WARN_UNUSED __attribute__ ((warn_unused_result)) -#else -# define WARN_UNUSED -#endif - -#define SF_BUFFER_LEN (8192) -#define SF_FILENAME_LEN (512) -#define SF_SYSERR_LEN (256) -#define SF_MAX_STRINGS (32) -#define SF_HEADER_LEN (12292) -#define SF_PARSELOG_LEN (2048) - -#define PSF_SEEK_ERROR ((sf_count_t) -1) - -#define BITWIDTH2BYTES(x) (((x) + 7) / 8) - -/* For some reason sizeof returns an unsigned value which causes -** a warning when that value is added or subtracted from a signed -** value. Use SIGNED_SIZEOF instead. -*/ -#define SIGNED_SIZEOF(x) ((int) sizeof (x)) - -#define ARRAY_LEN(x) ((int) (sizeof (x) / sizeof ((x) [0]))) - -#define NOT(x) (! (x)) - -#if (COMPILER_IS_GCC == 1) -#define SF_MAX(x, y) ({ \ - typeof (x) sf_max_x1 = (x) ; \ - typeof (y) sf_max_y1 = (y) ; \ - (void) (&sf_max_x1 == &sf_max_y1) ; \ - sf_max_x1 > sf_max_y1 ? sf_max_x1 : sf_max_y1 ; }) - -#define SF_MIN(x, y) ({ \ - typeof (x) sf_min_x2 = (x) ; \ - typeof (y) sf_min_y2 = (y) ; \ - (void) (&sf_min_x2 == &sf_min_y2) ; \ - sf_min_x2 < sf_min_y2 ? sf_min_x2 : sf_min_y2 ; }) -#else -#define SF_MAX(a, b) ((a) > (b) ? (a) : (b)) -#define SF_MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - - -#define COMPILE_TIME_ASSERT(e) (sizeof (struct { int : - !! (e) ; })) - - -#define SF_MAX_CHANNELS 256 - - -/* -* Macros for spliting the format file of SF_INFO into container type, -** codec type and endian-ness. -*/ -#define SF_CONTAINER(x) ((x) & SF_FORMAT_TYPEMASK) -#define SF_CODEC(x) ((x) & SF_FORMAT_SUBMASK) -#define SF_ENDIAN(x) ((x) & SF_FORMAT_ENDMASK) - -enum -{ /* PEAK chunk location. */ - SF_PEAK_START = 42, - SF_PEAK_END = 43, - - /* PEAK chunk location. */ - SF_SCALE_MAX = 52, - SF_SCALE_MIN = 53, - - /* str_flags values. */ - SF_STR_ALLOW_START = 0x0100, - SF_STR_ALLOW_END = 0x0200, - - /* Location of strings. */ - SF_STR_LOCATE_START = 0x0400, - SF_STR_LOCATE_END = 0x0800, - - SFD_TYPEMASK = 0x0FFFFFFF -} ; - -#define SFM_MASK (SFM_READ | SFM_WRITE | SFM_RDWR) -#define SFM_UNMASK (~SFM_MASK) - -/*--------------------------------------------------------------------------------------- -** Formats that may be supported at some time in the future. -** When support is finalised, these values move to src/sndfile.h. -*/ - -enum -{ /* Work in progress. */ - SF_FORMAT_SPEEX = 0x5000000, - SF_FORMAT_OGGFLAC = 0x5000001, - - /* Formats supported read only. */ - SF_FORMAT_TXW = 0x4030000, /* Yamaha TX16 sampler file */ - SF_FORMAT_DWD = 0x4040000, /* DiamondWare Digirized */ - - /* Following are detected but not supported. */ - SF_FORMAT_REX = 0x40A0000, /* Propellorheads Rex/Rcy */ - SF_FORMAT_REX2 = 0x40D0000, /* Propellorheads Rex2 */ - SF_FORMAT_KRZ = 0x40E0000, /* Kurzweil sampler file */ - SF_FORMAT_WMA = 0x4100000, /* Windows Media Audio. */ - SF_FORMAT_SHN = 0x4110000, /* Shorten. */ - - /* Unsupported encodings. */ - SF_FORMAT_SVX_FIB = 0x1020, /* SVX Fibonacci Delta encoding. */ - SF_FORMAT_SVX_EXP = 0x1021, /* SVX Exponential Delta encoding. */ - - SF_FORMAT_PCM_N = 0x1030 -} ; - -/*--------------------------------------------------------------------------------------- -*/ - -typedef struct -{ unsigned kuki_offset ; - unsigned pakt_offset ; - - unsigned bits_per_sample ; - unsigned frames_per_packet ; - - int64_t packets ; - int64_t valid_frames ; - int32_t priming_frames ; - int32_t remainder_frames ; -} ALAC_DECODER_INFO ; - -/*--------------------------------------------------------------------------------------- -** PEAK_CHUNK - This chunk type is common to both AIFF and WAVE files although their -** endian encodings are different. -*/ - -typedef struct -{ double value ; /* signed value of peak */ - sf_count_t position ; /* the sample frame for the peak */ -} PEAK_POS ; - -typedef struct -{ /* libsndfile internal : write a PEAK chunk at the start or end of the file? */ - int peak_loc ; - - /* WAV/AIFF */ - unsigned int version ; /* version of the PEAK chunk */ - unsigned int timestamp ; /* secs since 1/1/1970 */ - - /* CAF */ - unsigned int edit_number ; - - /* the per channel peak info */ - PEAK_POS peaks [] ; -} PEAK_INFO ; - -static inline PEAK_INFO * -peak_info_calloc (int channels) -{ return calloc (1, sizeof (PEAK_INFO) + channels * sizeof (PEAK_POS)) ; -} /* peak_info_calloc */ - -typedef struct -{ int type ; - int flags ; - size_t offset ; -} STR_DATA ; - -typedef struct -{ int64_t hash ; - char id [64] ; - unsigned id_size ; - uint32_t mark32 ; - sf_count_t offset ; - uint32_t len ; -} READ_CHUNK ; - -typedef struct -{ int64_t hash ; - uint32_t mark32 ; - uint32_t len ; - void *data ; -} WRITE_CHUNK ; - -typedef struct -{ uint32_t count ; - uint32_t used ; - READ_CHUNK *chunks ; -} READ_CHUNKS ; -typedef struct -{ uint32_t count ; - uint32_t used ; - WRITE_CHUNK *chunks ; -} WRITE_CHUNKS ; - -struct SF_CHUNK_ITERATOR -{ uint32_t current ; - int64_t hash ; - char id [64] ; - unsigned id_size ; - SNDFILE *sndfile ; -} ; - -static inline size_t -make_size_t (int x) -{ return (size_t) x ; -} /* size_t_of_int */ - -typedef SF_BROADCAST_INFO_VAR (16 * 1024) SF_BROADCAST_INFO_16K ; - -typedef SF_CART_INFO_VAR (16 * 1024) SF_CART_INFO_16K ; - -#if SIZEOF_WCHAR_T == 2 -typedef wchar_t sfwchar_t ; -#else -typedef int16_t sfwchar_t ; -#endif - - -static inline void * -psf_memdup (const void *src, size_t n) -{ void * mem = calloc (1, n & 3 ? n + 4 - (n & 3) : n) ; - return memcpy (mem, src, n) ; -} /* psf_memdup */ - -/* -** This version of isprint specifically ignores any locale info. Its used for -** determining which characters can be printed in things like hexdumps. -*/ -static inline int -psf_isprint (int ch) -{ return (ch >= ' ' && ch <= '~') ; -} /* psf_isprint */ - -/*======================================================================================= -** SF_PRIVATE stuct - a pointer to this struct is passed back to the caller of the -** sf_open_XXXX functions. The caller however has no knowledge of the struct's -** contents. -*/ - -typedef struct -{ - union - { char c [SF_FILENAME_LEN] ; - sfwchar_t wc [SF_FILENAME_LEN] ; - } path ; - - union - { char c [SF_FILENAME_LEN] ; - sfwchar_t wc [SF_FILENAME_LEN] ; - } dir ; - - union - { char c [SF_FILENAME_LEN / 4] ; - sfwchar_t wc [SF_FILENAME_LEN / 4] ; - } name ; - -#if USE_WINDOWS_API - /* - ** These fields can only be used in src/file_io.c. - ** They are basically the same as a windows file HANDLE. - */ - void *handle, *hsaved ; - - int use_wchar ; -#else - /* These fields can only be used in src/file_io.c. */ - int filedes, savedes ; -#endif - - int do_not_close_descriptor ; - int mode ; /* Open mode : SFM_READ, SFM_WRITE or SFM_RDWR. */ -} PSF_FILE ; - - - -typedef union -{ double dbuf [SF_BUFFER_LEN / sizeof (double)] ; -#if (defined (SIZEOF_INT64_T) && (SIZEOF_INT64_T == 8)) - int64_t lbuf [SF_BUFFER_LEN / sizeof (int64_t)] ; -#else - long lbuf [SF_BUFFER_LEN / sizeof (double)] ; -#endif - float fbuf [SF_BUFFER_LEN / sizeof (float)] ; - int ibuf [SF_BUFFER_LEN / sizeof (int)] ; - short sbuf [SF_BUFFER_LEN / sizeof (short)] ; - char cbuf [SF_BUFFER_LEN / sizeof (char)] ; - signed char scbuf [SF_BUFFER_LEN / sizeof (signed char)] ; - unsigned char ucbuf [SF_BUFFER_LEN / sizeof (signed char)] ; -} BUF_UNION ; - - - -typedef struct sf_private_tag -{ - /* Canary in a coal mine. */ - union - { /* Place a double here to encourage double alignment. */ - double d [2] ; - char c [16] ; - } canary ; - - PSF_FILE file, rsrc ; - - char syserr [SF_SYSERR_LEN] ; - - /* parselog and indx should only be changed within the logging functions - ** of common.c - */ - struct - { char buf [SF_PARSELOG_LEN] ; - int indx ; - } parselog ; - - unsigned char header [SF_HEADER_LEN] ; /* Must be unsigned */ - int rwf_endian ; /* Header endian-ness flag. */ - - /* Storage and housekeeping data for adding/reading strings from - ** sound files. - */ - struct - { STR_DATA data [SF_MAX_STRINGS] ; - char *storage ; - size_t storage_len ; - size_t storage_used ; - uint32_t flags ; - } strings ; - - /* Guard value. If this changes the buffers above have overflowed. */ - int Magick ; - - unsigned unique_id ; - - /* Index variables for maintaining parselog and header above. */ - int headindex, headend ; - int has_text ; - - int error ; - - int endian ; /* File endianness : SF_ENDIAN_LITTLE or SF_ENDIAN_BIG. */ - int data_endswap ; /* Need to endswap data? */ - - /* - ** Maximum float value for calculating the multiplier for - ** float/double to short/int conversions. - */ - int float_int_mult ; - float float_max ; - - int scale_int_float ; - - /* Vairables for handling pipes. */ - int is_pipe ; /* True if file is a pipe. */ - sf_count_t pipeoffset ; /* Number of bytes read from a pipe. */ - - /* True if clipping must be performed on float->int conversions. */ - int add_clipping ; - - SF_INFO sf ; - - int have_written ; /* Has a single write been done to the file? */ - PEAK_INFO *peak_info ; - - /* Loop Info */ - SF_LOOP_INFO *loop_info ; - SF_INSTRUMENT *instrument ; - - /* Broadcast (EBU) Info */ - SF_BROADCAST_INFO_16K *broadcast_16k ; - - /* Cart (AES46) Info */ - SF_CART_INFO_16K *cart_16k ; - - /* Channel map data (if present) : an array of ints. */ - int *channel_map ; - - sf_count_t filelength ; /* Overall length of (embedded) file. */ - sf_count_t fileoffset ; /* Offset in number of bytes from beginning of file. */ - - sf_count_t rsrclength ; /* Length of the resource fork (if it exists). */ - - sf_count_t dataoffset ; /* Offset in number of bytes from beginning of file. */ - sf_count_t datalength ; /* Length in bytes of the audio data. */ - sf_count_t dataend ; /* Offset to file tailer. */ - - int blockwidth ; /* Size in bytes of one set of interleaved samples. */ - int bytewidth ; /* Size in bytes of one sample (one channel). */ - - void *dither ; - void *interleave ; - - int last_op ; /* Last operation; either SFM_READ or SFM_WRITE */ - sf_count_t read_current ; - sf_count_t write_current ; - - void *container_data ; /* This is a pointer to dynamically allocated file - ** container format specific data. - */ - - void *codec_data ; /* This is a pointer to dynamically allocated file - ** codec format specific data. - */ - - SF_DITHER_INFO write_dither ; - SF_DITHER_INFO read_dither ; - - int norm_double ; - int norm_float ; - - int auto_header ; - - int ieee_replace ; - - /* A set of file specific function pointers */ - sf_count_t (*read_short) (struct sf_private_tag*, short *ptr, sf_count_t len) ; - sf_count_t (*read_int) (struct sf_private_tag*, int *ptr, sf_count_t len) ; - sf_count_t (*read_float) (struct sf_private_tag*, float *ptr, sf_count_t len) ; - sf_count_t (*read_double) (struct sf_private_tag*, double *ptr, sf_count_t len) ; - - sf_count_t (*write_short) (struct sf_private_tag*, const short *ptr, sf_count_t len) ; - sf_count_t (*write_int) (struct sf_private_tag*, const int *ptr, sf_count_t len) ; - sf_count_t (*write_float) (struct sf_private_tag*, const float *ptr, sf_count_t len) ; - sf_count_t (*write_double) (struct sf_private_tag*, const double *ptr, sf_count_t len) ; - - sf_count_t (*seek) (struct sf_private_tag*, int mode, sf_count_t samples_from_start) ; - int (*write_header) (struct sf_private_tag*, int calc_length) ; - int (*command) (struct sf_private_tag*, int command, void *data, int datasize) ; - int (*byterate) (struct sf_private_tag*) ; - - /* - ** Separate close functions for the codec and the container. - ** The codec close function is always called first. - */ - int (*codec_close) (struct sf_private_tag*) ; - int (*container_close) (struct sf_private_tag*) ; - - char *format_desc ; - - /* Virtual I/O functions. */ - int virtual_io ; - SF_VIRTUAL_IO vio ; - void *vio_user_data ; - - /* Chunk get/set. */ - SF_CHUNK_ITERATOR *iterator ; - - READ_CHUNKS rchunks ; - WRITE_CHUNKS wchunks ; - - int (*set_chunk) (struct sf_private_tag*, const SF_CHUNK_INFO * chunk_info) ; - SF_CHUNK_ITERATOR * (*next_chunk_iterator) (struct sf_private_tag*, SF_CHUNK_ITERATOR * iterator) ; - int (*get_chunk_size) (struct sf_private_tag*, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) ; - int (*get_chunk_data) (struct sf_private_tag*, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) ; -} SF_PRIVATE ; - - - -enum -{ SFE_NO_ERROR = SF_ERR_NO_ERROR, - SFE_BAD_OPEN_FORMAT = SF_ERR_UNRECOGNISED_FORMAT, - SFE_SYSTEM = SF_ERR_SYSTEM, - SFE_MALFORMED_FILE = SF_ERR_MALFORMED_FILE, - SFE_UNSUPPORTED_ENCODING = SF_ERR_UNSUPPORTED_ENCODING, - - SFE_ZERO_MAJOR_FORMAT, - SFE_ZERO_MINOR_FORMAT, - SFE_BAD_FILE, - SFE_BAD_FILE_READ, - SFE_OPEN_FAILED, - SFE_BAD_SNDFILE_PTR, - SFE_BAD_SF_INFO_PTR, - SFE_BAD_SF_INCOMPLETE, - SFE_BAD_FILE_PTR, - SFE_BAD_INT_PTR, - SFE_BAD_STAT_SIZE, - SFE_NO_TEMP_DIR, - SFE_MALLOC_FAILED, - SFE_UNIMPLEMENTED, - SFE_BAD_READ_ALIGN, - SFE_BAD_WRITE_ALIGN, - SFE_UNKNOWN_FORMAT, - SFE_NOT_READMODE, - SFE_NOT_WRITEMODE, - SFE_BAD_MODE_RW, - SFE_BAD_SF_INFO, - SFE_BAD_OFFSET, - SFE_NO_EMBED_SUPPORT, - SFE_NO_EMBEDDED_RDWR, - SFE_NO_PIPE_WRITE, - - SFE_INTERNAL, - SFE_BAD_COMMAND_PARAM, - SFE_BAD_ENDIAN, - SFE_CHANNEL_COUNT_ZERO, - SFE_CHANNEL_COUNT, - - SFE_BAD_VIRTUAL_IO, - - SFE_INTERLEAVE_MODE, - SFE_INTERLEAVE_SEEK, - SFE_INTERLEAVE_READ, - - SFE_BAD_SEEK, - SFE_NOT_SEEKABLE, - SFE_AMBIGUOUS_SEEK, - SFE_WRONG_SEEK, - SFE_SEEK_FAILED, - - SFE_BAD_OPEN_MODE, - SFE_OPEN_PIPE_RDWR, - SFE_RDWR_POSITION, - SFE_RDWR_BAD_HEADER, - SFE_CMD_HAS_DATA, - SFE_BAD_BROADCAST_INFO_SIZE, - SFE_BAD_BROADCAST_INFO_TOO_BIG, - SFE_BAD_CART_INFO_SIZE, - SFE_BAD_CART_INFO_TOO_BIG, - - SFE_STR_NO_SUPPORT, - SFE_STR_NOT_WRITE, - SFE_STR_MAX_DATA, - SFE_STR_MAX_COUNT, - SFE_STR_BAD_TYPE, - SFE_STR_NO_ADD_END, - SFE_STR_BAD_STRING, - SFE_STR_WEIRD, - - SFE_WAV_NO_RIFF, - SFE_WAV_NO_WAVE, - SFE_WAV_NO_FMT, - SFE_WAV_BAD_FMT, - SFE_WAV_FMT_SHORT, - SFE_WAV_BAD_FACT, - SFE_WAV_BAD_PEAK, - SFE_WAV_PEAK_B4_FMT, - SFE_WAV_BAD_FORMAT, - SFE_WAV_BAD_BLOCKALIGN, - SFE_WAV_NO_DATA, - SFE_WAV_BAD_LIST, - SFE_WAV_ADPCM_NOT4BIT, - SFE_WAV_ADPCM_CHANNELS, - SFE_WAV_GSM610_FORMAT, - SFE_WAV_UNKNOWN_CHUNK, - SFE_WAV_WVPK_DATA, - - SFE_AIFF_NO_FORM, - SFE_AIFF_AIFF_NO_FORM, - SFE_AIFF_COMM_NO_FORM, - SFE_AIFF_SSND_NO_COMM, - SFE_AIFF_UNKNOWN_CHUNK, - SFE_AIFF_COMM_CHUNK_SIZE, - SFE_AIFF_BAD_COMM_CHUNK, - SFE_AIFF_PEAK_B4_COMM, - SFE_AIFF_BAD_PEAK, - SFE_AIFF_NO_SSND, - SFE_AIFF_NO_DATA, - SFE_AIFF_RW_SSND_NOT_LAST, - - SFE_AU_UNKNOWN_FORMAT, - SFE_AU_NO_DOTSND, - SFE_AU_EMBED_BAD_LEN, - - SFE_RAW_READ_BAD_SPEC, - SFE_RAW_BAD_BITWIDTH, - SFE_RAW_BAD_FORMAT, - - SFE_PAF_NO_MARKER, - SFE_PAF_VERSION, - SFE_PAF_UNKNOWN_FORMAT, - SFE_PAF_SHORT_HEADER, - SFE_PAF_BAD_CHANNELS, - - SFE_SVX_NO_FORM, - SFE_SVX_NO_BODY, - SFE_SVX_NO_DATA, - SFE_SVX_BAD_COMP, - SFE_SVX_BAD_NAME_LENGTH, - - SFE_NIST_BAD_HEADER, - SFE_NIST_CRLF_CONVERISON, - SFE_NIST_BAD_ENCODING, - - SFE_VOC_NO_CREATIVE, - SFE_VOC_BAD_FORMAT, - SFE_VOC_BAD_VERSION, - SFE_VOC_BAD_MARKER, - SFE_VOC_BAD_SECTIONS, - SFE_VOC_MULTI_SAMPLERATE, - SFE_VOC_MULTI_SECTION, - SFE_VOC_MULTI_PARAM, - SFE_VOC_SECTION_COUNT, - SFE_VOC_NO_PIPE, - - SFE_IRCAM_NO_MARKER, - SFE_IRCAM_BAD_CHANNELS, - SFE_IRCAM_UNKNOWN_FORMAT, - - SFE_W64_64_BIT, - SFE_W64_NO_RIFF, - SFE_W64_NO_WAVE, - SFE_W64_NO_DATA, - SFE_W64_ADPCM_NOT4BIT, - SFE_W64_ADPCM_CHANNELS, - SFE_W64_GSM610_FORMAT, - - SFE_MAT4_BAD_NAME, - SFE_MAT4_NO_SAMPLERATE, - - SFE_MAT5_BAD_ENDIAN, - SFE_MAT5_NO_BLOCK, - SFE_MAT5_SAMPLE_RATE, - - SFE_PVF_NO_PVF1, - SFE_PVF_BAD_HEADER, - SFE_PVF_BAD_BITWIDTH, - - SFE_DWVW_BAD_BITWIDTH, - SFE_G72X_NOT_MONO, - - SFE_XI_BAD_HEADER, - SFE_XI_EXCESS_SAMPLES, - SFE_XI_NO_PIPE, - - SFE_HTK_NO_PIPE, - - SFE_SDS_NOT_SDS, - SFE_SDS_BAD_BIT_WIDTH, - - SFE_SD2_FD_DISALLOWED, - SFE_SD2_BAD_DATA_OFFSET, - SFE_SD2_BAD_MAP_OFFSET, - SFE_SD2_BAD_DATA_LENGTH, - SFE_SD2_BAD_MAP_LENGTH, - SFE_SD2_BAD_RSRC, - SFE_SD2_BAD_SAMPLE_SIZE, - - SFE_FLAC_BAD_HEADER, - SFE_FLAC_NEW_DECODER, - SFE_FLAC_INIT_DECODER, - SFE_FLAC_LOST_SYNC, - SFE_FLAC_BAD_SAMPLE_RATE, - SFE_FLAC_UNKOWN_ERROR, - - SFE_WVE_NOT_WVE, - SFE_WVE_NO_PIPE, - - SFE_VORBIS_ENCODER_BUG, - - SFE_RF64_NOT_RF64, - SFE_BAD_CHUNK_PTR, - SFE_UNKNOWN_CHUNK, - SFE_BAD_CHUNK_FORMAT, - SFE_BAD_CHUNK_MARKER, - SFE_BAD_CHUNK_DATA_PTR, - - SFE_ALAC_FAIL_TMPFILE, - - SFE_MAX_ERROR /* This must be last in list. */ -} ; - -int subformat_to_bytewidth (int format) ; -int s_bitwidth_to_subformat (int bits) ; -int u_bitwidth_to_subformat (int bits) ; - -/* Functions for reading and writing floats and doubles on processors -** with non-IEEE floats/doubles. -*/ -float float32_be_read (const unsigned char *cptr) ; -float float32_le_read (const unsigned char *cptr) ; -void float32_be_write (float in, unsigned char *out) ; -void float32_le_write (float in, unsigned char *out) ; - -double double64_be_read (const unsigned char *cptr) ; -double double64_le_read (const unsigned char *cptr) ; -void double64_be_write (double in, unsigned char *out) ; -void double64_le_write (double in, unsigned char *out) ; - -/* Functions for writing to the internal logging buffer. */ - -void psf_log_printf (SF_PRIVATE *psf, const char *format, ...) ; -void psf_log_SF_INFO (SF_PRIVATE *psf) ; - -int32_t psf_rand_int32 (void) ; - -void append_snprintf (char * dest, size_t maxlen, const char * fmt, ...) ; -void psf_strlcpy_crlf (char *dest, const char *src, size_t destmax, size_t srcmax) ; - -sf_count_t psf_decode_frame_count (SF_PRIVATE *psf) ; - -/* Functions used when writing file headers. */ - -int psf_binheader_writef (SF_PRIVATE *psf, const char *format, ...) ; -void psf_asciiheader_printf (SF_PRIVATE *psf, const char *format, ...) ; - -/* Functions used when reading file headers. */ - -int psf_binheader_readf (SF_PRIVATE *psf, char const *format, ...) ; - -/* Functions used in the write function for updating the peak chunk. */ - -void peak_update_short (SF_PRIVATE *psf, short *ptr, size_t items) ; -void peak_update_int (SF_PRIVATE *psf, int *ptr, size_t items) ; -void peak_update_double (SF_PRIVATE *psf, double *ptr, size_t items) ; - -/* Functions defined in command.c. */ - -int psf_get_format_simple_count (void) ; -int psf_get_format_simple (SF_FORMAT_INFO *data) ; - -int psf_get_format_info (SF_FORMAT_INFO *data) ; - -int psf_get_format_major_count (void) ; -int psf_get_format_major (SF_FORMAT_INFO *data) ; - -int psf_get_format_subtype_count (void) ; -int psf_get_format_subtype (SF_FORMAT_INFO *data) ; - -void psf_generate_format_desc (SF_PRIVATE *psf) ; - -double psf_calc_signal_max (SF_PRIVATE *psf, int normalize) ; -int psf_calc_max_all_channels (SF_PRIVATE *psf, double *peaks, int normalize) ; - -int psf_get_signal_max (SF_PRIVATE *psf, double *peak) ; -int psf_get_max_all_channels (SF_PRIVATE *psf, double *peaks) ; - -/* Functions in strings.c. */ - -const char* psf_get_string (SF_PRIVATE *psf, int str_type) ; -int psf_set_string (SF_PRIVATE *psf, int str_type, const char *str) ; -int psf_store_string (SF_PRIVATE *psf, int str_type, const char *str) ; -int psf_location_string_count (const SF_PRIVATE * psf, int location) ; - -/* Default seek function. Use for PCM and float encoded data. */ -sf_count_t psf_default_seek (SF_PRIVATE *psf, int mode, sf_count_t samples_from_start) ; - -int macos_guess_file_type (SF_PRIVATE *psf, const char *filename) ; - -/*------------------------------------------------------------------------------------ -** File I/O functions which will allow access to large files (> 2 Gig) on -** some 32 bit OSes. Implementation in file_io.c. -*/ - -int psf_fopen (SF_PRIVATE *psf) ; -int psf_set_stdio (SF_PRIVATE *psf) ; -int psf_file_valid (SF_PRIVATE *psf) ; -void psf_set_file (SF_PRIVATE *psf, int fd) ; -void psf_init_files (SF_PRIVATE *psf) ; -void psf_use_rsrc (SF_PRIVATE *psf, int on_off) ; - -SNDFILE * psf_open_file (SF_PRIVATE *psf, SF_INFO *sfinfo) ; - -sf_count_t psf_fseek (SF_PRIVATE *psf, sf_count_t offset, int whence) ; -sf_count_t psf_fread (void *ptr, sf_count_t bytes, sf_count_t count, SF_PRIVATE *psf) ; -sf_count_t psf_fwrite (const void *ptr, sf_count_t bytes, sf_count_t count, SF_PRIVATE *psf) ; -sf_count_t psf_fgets (char *buffer, sf_count_t bufsize, SF_PRIVATE *psf) ; -sf_count_t psf_ftell (SF_PRIVATE *psf) ; -sf_count_t psf_get_filelen (SF_PRIVATE *psf) ; - -void psf_fsync (SF_PRIVATE *psf) ; - -int psf_is_pipe (SF_PRIVATE *psf) ; - -int psf_ftruncate (SF_PRIVATE *psf, sf_count_t len) ; -int psf_fclose (SF_PRIVATE *psf) ; - -/* Open and close the resource fork of a file. */ -int psf_open_rsrc (SF_PRIVATE *psf) ; -int psf_close_rsrc (SF_PRIVATE *psf) ; - -/* -void psf_fclearerr (SF_PRIVATE *psf) ; -int psf_ferror (SF_PRIVATE *psf) ; -*/ - -/*------------------------------------------------------------------------------------ -** Functions for reading and writing different file formats. -*/ - -int aiff_open (SF_PRIVATE *psf) ; -int au_open (SF_PRIVATE *psf) ; -int avr_open (SF_PRIVATE *psf) ; -int htk_open (SF_PRIVATE *psf) ; -int ircam_open (SF_PRIVATE *psf) ; -int mat4_open (SF_PRIVATE *psf) ; -int mat5_open (SF_PRIVATE *psf) ; -int nist_open (SF_PRIVATE *psf) ; -int paf_open (SF_PRIVATE *psf) ; -int pvf_open (SF_PRIVATE *psf) ; -int raw_open (SF_PRIVATE *psf) ; -int sd2_open (SF_PRIVATE *psf) ; -int sds_open (SF_PRIVATE *psf) ; -int svx_open (SF_PRIVATE *psf) ; -int voc_open (SF_PRIVATE *psf) ; -int w64_open (SF_PRIVATE *psf) ; -int wav_open (SF_PRIVATE *psf) ; -int xi_open (SF_PRIVATE *psf) ; -int flac_open (SF_PRIVATE *psf) ; -int caf_open (SF_PRIVATE *psf) ; -int mpc2k_open (SF_PRIVATE *psf) ; -int rf64_open (SF_PRIVATE *psf) ; - -int ogg_vorbis_open (SF_PRIVATE *psf) ; -int ogg_speex_open (SF_PRIVATE *psf) ; -int ogg_pcm_open (SF_PRIVATE *psf) ; -int ogg_opus_open (SF_PRIVATE *psf) ; -int ogg_open (SF_PRIVATE *psf) ; - - -/* In progress. Do not currently work. */ - -int mpeg_open (SF_PRIVATE *psf) ; -int rx2_open (SF_PRIVATE *psf) ; -int txw_open (SF_PRIVATE *psf) ; -int wve_open (SF_PRIVATE *psf) ; -int dwd_open (SF_PRIVATE *psf) ; - -int macbinary3_open (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------------ -** Init functions for a number of common data encodings. -*/ - -int pcm_init (SF_PRIVATE *psf) ; -int ulaw_init (SF_PRIVATE *psf) ; -int alaw_init (SF_PRIVATE *psf) ; -int float32_init (SF_PRIVATE *psf) ; -int double64_init (SF_PRIVATE *psf) ; -int dwvw_init (SF_PRIVATE *psf, int bitwidth) ; -int gsm610_init (SF_PRIVATE *psf) ; -int vox_adpcm_init (SF_PRIVATE *psf) ; -int flac_init (SF_PRIVATE *psf) ; -int g72x_init (SF_PRIVATE * psf) ; -int alac_init (SF_PRIVATE *psf, const ALAC_DECODER_INFO * info) ; - -int dither_init (SF_PRIVATE *psf, int mode) ; - -int wav_w64_ima_init (SF_PRIVATE *psf, int blockalign, int samplesperblock) ; -int wav_w64_msadpcm_init (SF_PRIVATE *psf, int blockalign, int samplesperblock) ; - -int aiff_ima_init (SF_PRIVATE *psf, int blockalign, int samplesperblock) ; - -int interleave_init (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------------ -** Chunk logging functions. -*/ - -SF_CHUNK_ITERATOR * psf_get_chunk_iterator (SF_PRIVATE * psf, const char * marker_str) ; -SF_CHUNK_ITERATOR * psf_next_chunk_iterator (const READ_CHUNKS * pchk , SF_CHUNK_ITERATOR *iterator) ; -int psf_store_read_chunk_u32 (READ_CHUNKS * pchk, uint32_t marker, sf_count_t offset, uint32_t len) ; -int psf_store_read_chunk_str (READ_CHUNKS * pchk, const char * marker, sf_count_t offset, uint32_t len) ; -int psf_save_write_chunk (WRITE_CHUNKS * pchk, const SF_CHUNK_INFO * chunk_info) ; -int psf_find_read_chunk_str (const READ_CHUNKS * pchk, const char * marker) ; -int psf_find_read_chunk_m32 (const READ_CHUNKS * pchk, uint32_t marker) ; -int psf_find_read_chunk_iterator (const READ_CHUNKS * pchk, const SF_CHUNK_ITERATOR * marker) ; - -int psf_find_write_chunk (WRITE_CHUNKS * pchk, const char * marker) ; - -static inline int -fourcc_to_marker (const SF_CHUNK_INFO * chunk_info) -{ const unsigned char * cptr ; - - if (chunk_info->id_size != 4) - return 0 ; - - cptr = (const unsigned char *) chunk_info->id ; - return (cptr [3] << 24) + (cptr [2] << 16) + (cptr [1] << 8) + cptr [0] ; -} /* fourcc_to_marker */ - -/*------------------------------------------------------------------------------------ -** Functions that work like OpenBSD's strlcpy/strlcat to replace strncpy/strncat. -** -** See : http://www.gratisoft.us/todd/papers/strlcpy.html -** -** These functions are available on *BSD, but are not avaialble everywhere so we -** implement them here. -** -** The argument order has been changed to that of strncpy/strncat to cause -** compiler errors if code is carelessly converted from one to the other. -*/ - -static inline void -psf_strlcat (char *dest, size_t n, const char *src) -{ strncat (dest, src, n - strlen (dest) - 1) ; - dest [n - 1] = 0 ; -} /* psf_strlcat */ - -static inline void -psf_strlcpy (char *dest, size_t n, const char *src) -{ strncpy (dest, src, n - 1) ; - dest [n - 1] = 0 ; -} /* psf_strlcpy */ - -/*------------------------------------------------------------------------------------ -** Other helper functions. -*/ - -void *psf_memset (void *s, int c, sf_count_t n) ; - -SF_INSTRUMENT * psf_instrument_alloc (void) ; - -void psf_sanitize_string (char * cptr, int len) ; - -/* Generate the current date as a string. */ -void psf_get_date_str (char *str, int maxlen) ; - -SF_BROADCAST_INFO_16K * broadcast_var_alloc (void) ; -int broadcast_var_set (SF_PRIVATE *psf, const SF_BROADCAST_INFO * data, size_t datasize) ; -int broadcast_var_get (SF_PRIVATE *psf, SF_BROADCAST_INFO * data, size_t datasize) ; - - -SF_CART_INFO_16K * cart_var_alloc (void) ; -int cart_var_set (SF_PRIVATE *psf, const SF_CART_INFO * date, size_t datasize) ; -int cart_var_get (SF_PRIVATE *psf, SF_CART_INFO * data, size_t datasize) ; - -typedef struct -{ int channels ; - int endianness ; -} AUDIO_DETECT ; - -int audio_detect (SF_PRIVATE * psf, AUDIO_DETECT *ad, const unsigned char * data, int datalen) ; -int id3_skip (SF_PRIVATE * psf) ; - -void alac_get_desc_chunk_items (int subformat, uint32_t *fmt_flags, uint32_t *frames_per_packet) ; - -FILE * psf_open_tmpfile (char * fname, size_t fnamelen) ; - -/*------------------------------------------------------------------------------------ -** Helper/debug functions. -*/ - -void psf_hexdump (const void *ptr, int len) ; - -const char * str_of_major_format (int format) ; -const char * str_of_minor_format (int format) ; -const char * str_of_open_mode (int mode) ; -const char * str_of_endianness (int end) ; - -/*------------------------------------------------------------------------------------ -** Extra commands for sf_command(). Not for public use yet. -*/ - -enum -{ SFC_TEST_AIFF_ADD_INST_CHUNK = 0x2000, - SFC_TEST_WAV_ADD_INFO_CHUNK = 0x2010 -} ; - -/* -** Maybe, one day, make these functions or something like them, public. -** -** Buffer to buffer dithering. Pointer in and out are allowed to point -** to the same buffer for in-place dithering. -*/ - -#if 0 -int sf_dither_short (const SF_DITHER_INFO *dither, const short *in, short *out, int count) ; -int sf_dither_int (const SF_DITHER_INFO *dither, const int *in, int *out, int count) ; -int sf_dither_float (const SF_DITHER_INFO *dither, const float *in, float *out, int count) ; -int sf_dither_double (const SF_DITHER_INFO *dither, const double *in, double *out, int count) ; -#endif - -/*------------------------------------------------------------------------------------ -** Data conversion functions. -*/ - -static inline short -psf_short_of_int (int x) -{ return (x >> 16) ; -} - -void psf_f2s_array (const float *src, short *dest, int count, int normalize) ; -void psf_f2s_clip_array (const float *src, short *dest, int count, int normalize) ; - -void psf_d2s_array (const double *src, short *dest, int count, int normalize) ; -void psf_d2s_clip_array (const double *src, short *dest, int count, int normalize) ; - -void psf_f2i_array (const float *src, int *dest, int count, int normalize) ; -void psf_f2i_clip_array (const float *src, int *dest, int count, int normalize) ; - -void psf_d2i_array (const double *src, int *dest, int count, int normalize) ; -void psf_d2i_clip_array (const double *src, int *dest, int count, int normalize) ; - -#endif /* SNDFILE_COMMON_H */ - diff --git a/libs/libsndfile/src/create_symbols_file.py b/libs/libsndfile/src/create_symbols_file.py deleted file mode 100755 index 15b1ccaf4b..0000000000 --- a/libs/libsndfile/src/create_symbols_file.py +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/python - -# Copyright (C) 2003-2012 Erik de Castro Lopo -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the author nor the names of any contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import re, sys - -#---------------------------------------------------------------- -# These are all of the public functions exported from libsndfile. -# -# Its important not to change the order they are listed in or -# the ordinal values in the second column. - -ALL_SYMBOLS = ( - ( "sf_command", 1 ), - ( "sf_open", 2 ), - ( "sf_close", 3 ), - ( "sf_seek", 4 ), - ( "sf_error", 7 ), - ( "sf_perror", 8 ), - ( "sf_error_str", 9 ), - ( "sf_error_number", 10 ), - ( "sf_format_check", 11 ), - ( "sf_read_raw", 16 ), - ( "sf_readf_short", 17 ), - ( "sf_readf_int", 18 ), - ( "sf_readf_float", 19 ), - ( "sf_readf_double", 20 ), - ( "sf_read_short", 21 ), - ( "sf_read_int", 22 ), - ( "sf_read_float", 23 ), - ( "sf_read_double", 24 ), - ( "sf_write_raw", 32 ), - ( "sf_writef_short", 33 ), - ( "sf_writef_int", 34 ), - ( "sf_writef_float", 35 ), - ( "sf_writef_double", 36 ), - ( "sf_write_short", 37 ), - ( "sf_write_int", 38 ), - ( "sf_write_float", 39 ), - ( "sf_write_double", 40 ), - ( "sf_strerror", 50 ), - ( "sf_get_string", 60 ), - ( "sf_set_string", 61 ), - ( "sf_version_string", 68 ), - ( "sf_open_fd", 70 ), - ( "sf_wchar_open", 71 ), - ( "sf_open_virtual", 80 ), - ( "sf_write_sync", 90 ), - ( "sf_set_chunk", 100 ), - ( "sf_get_chunk_size", 101 ), - ( "sf_get_chunk_data", 102 ), - ( "sf_get_chunk_iterator", 103 ), - ( "sf_next_chunk_iterator", 104 ), - ( "sf_current_byterate", 110 ) - ) - -#------------------------------------------------------------------------------- - -def linux_symbols (progname, version): - print ("# Auto-generated by %s\n" %progname) - print ("libsndfile.so.%s" % version) - print ("{") - print (" global:") - for name, ordinal in ALL_SYMBOLS: - if name == "sf_wchar_open": - continue - print (" %s ;" % name) - print (" local:") - print (" * ;") - print ("} ;") - sys.stdout.write ("\n") - return - -def darwin_symbols (progname, version): - print ("# Auto-generated by %s\n" %progname) - for name, ordinal in ALL_SYMBOLS: - if name == "sf_wchar_open": - continue - print ("_%s" % name) - sys.stdout.write ("\n") - return - -def win32_symbols (progname, version, name): - print ("; Auto-generated by %s\n" %progname) - print ("LIBRARY %s-%s.dll" % (name, re.sub ("\..*", "", version))) - print ("EXPORTS\n") - for name, ordinal in ALL_SYMBOLS: - print ("%-20s @%s" % (name, ordinal)) - sys.stdout.write ("\n") - return - -def os2_symbols (progname, version, name): - print ("; Auto-generated by %s\n" %progname) - print ("LIBRARY %s%s" % (name, re.sub ("\..*", "", version))) - print ("INITINSTANCE TERMINSTANCE") - print ("CODE PRELOAD MOVEABLE DISCARDABLE") - print ("DATA PRELOAD MOVEABLE MULTIPLE NONSHARED") - print ("EXPORTS\n") - for name, ordinal in ALL_SYMBOLS: - if name == "sf_wchar_open": - continue - print ("_%-20s @%s" % (name, ordinal)) - sys.stdout.write ("\n") - return - -def plain_symbols (progname, version, name): - for name, ordinal in ALL_SYMBOLS: - print (name) - -def no_symbols (os_name): - sys.stdout.write ("\n") - print ("No known way of restricting exported symbols on '%s'." % os_name) - print ("If you know a way, please contact the author.") - sys.stdout.write ("\n") - return - -#------------------------------------------------------------------------------- - -progname = re.sub (".*[\\/]", "", sys.argv [0]) - -if len (sys.argv) != 3: - sys.stdout.write ("\n") - print ("Usage : %s ." % progname) - sys.stdout.write ("\n") - print (" Currently supported values for target OS are:") - print (" linux") - print (" darwin (ie MacOSX)") - print (" win32 (ie wintendo)") - print (" cygwin (Cygwin on wintendo)") - print (" os2 (OS/2)") - print (" plain (plain list of symbols)") - sys.stdout.write ("\n") - sys.exit (1) - -os_name = sys.argv [1] -version = re.sub ("\.[a-z0-9]+$", "", sys.argv [2]) - -if os_name == "linux" or os_name == "gnu" or os_name == "binutils": - linux_symbols (progname, version) -elif os_name == "darwin": - darwin_symbols (progname, version) -elif os_name == "win32": - win32_symbols (progname, version, "libsndfile") -elif os_name == "cygwin": - win32_symbols (progname, version, "cygsndfile") -elif os_name == "os2": - os2_symbols (progname, version, "sndfile") -elif os_name == "static": - plain_symbols (progname, version, "") -else: - no_symbols (os_name) - -sys.exit (0) - diff --git a/libs/libsndfile/src/cygsndfile.def b/libs/libsndfile/src/cygsndfile.def deleted file mode 100644 index 510aa8e229..0000000000 --- a/libs/libsndfile/src/cygsndfile.def +++ /dev/null @@ -1,39 +0,0 @@ -; Auto-generated by create_symbols_file.py - -LIBRARY cygsndfile-1.dll -EXPORTS - -sf_command @1 -sf_open @2 -sf_close @3 -sf_seek @4 -sf_error @7 -sf_perror @8 -sf_error_str @9 -sf_error_number @10 -sf_format_check @11 -sf_read_raw @16 -sf_readf_short @17 -sf_readf_int @18 -sf_readf_float @19 -sf_readf_double @20 -sf_read_short @21 -sf_read_int @22 -sf_read_float @23 -sf_read_double @24 -sf_write_raw @32 -sf_writef_short @33 -sf_writef_int @34 -sf_writef_float @35 -sf_writef_double @36 -sf_write_short @37 -sf_write_int @38 -sf_write_float @39 -sf_write_double @40 -sf_strerror @50 -sf_get_string @60 -sf_set_string @61 -sf_open_fd @70 -sf_open_virtual @80 -sf_write_sync @90 - diff --git a/libs/libsndfile/src/dither.c b/libs/libsndfile/src/dither.c deleted file mode 100644 index d149bc1b68..0000000000 --- a/libs/libsndfile/src/dither.c +++ /dev/null @@ -1,534 +0,0 @@ -/* -** Copyright (C) 2003-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*============================================================================ -** Rule number 1 is to only apply dither when going from a larger bitwidth -** to a smaller bitwidth. This can happen on both read and write. -** -** Need to apply dither on all conversions marked X below. -** -** Dither on write: -** -** Input -** | short int float double -** --------+----------------------------------------------- -** O 8 bit | X X X X -** u 16 bit | none X X X -** t 24 bit | none X X X -** p 32 bit | none none X X -** u float | none none none none -** t double | none none none none -** -** Dither on read: -** -** Input -** O | 8 bit 16 bit 24 bit 32 bit float double -** u --------+------------------------------------------------- -** t short | none none X X X X -** p int | none none none X X X -** u float | none none none none none none -** t double | none none none none none none -*/ - -#define SFE_DITHER_BAD_PTR 666 -#define SFE_DITHER_BAD_TYPE 667 - -typedef struct -{ int read_short_dither_bits, read_int_dither_bits ; - int write_short_dither_bits, write_int_dither_bits ; - double read_float_dither_scale, read_double_dither_bits ; - double write_float_dither_scale, write_double_dither_bits ; - - sf_count_t (*read_short) (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; - sf_count_t (*read_int) (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; - sf_count_t (*read_float) (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; - sf_count_t (*read_double) (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - - sf_count_t (*write_short) (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; - sf_count_t (*write_int) (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; - sf_count_t (*write_float) (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; - sf_count_t (*write_double) (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - - double buffer [SF_BUFFER_LEN / sizeof (double)] ; -} DITHER_DATA ; - -static sf_count_t dither_read_short (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t dither_read_int (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; - -static sf_count_t dither_write_short (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t dither_write_int (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t dither_write_float (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t dither_write_double (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -int -dither_init (SF_PRIVATE *psf, int mode) -{ DITHER_DATA *pdither ; - - pdither = psf->dither ; /* This may be NULL. */ - - /* Turn off dither on read. */ - if (mode == SFM_READ && psf->read_dither.type == SFD_NO_DITHER) - { if (pdither == NULL) - return 0 ; /* Dither is already off, so just return. */ - - if (pdither->read_short) - psf->read_short = pdither->read_short ; - if (pdither->read_int) - psf->read_int = pdither->read_int ; - if (pdither->read_float) - psf->read_float = pdither->read_float ; - if (pdither->read_double) - psf->read_double = pdither->read_double ; - return 0 ; - } ; - - /* Turn off dither on write. */ - if (mode == SFM_WRITE && psf->write_dither.type == SFD_NO_DITHER) - { if (pdither == NULL) - return 0 ; /* Dither is already off, so just return. */ - - if (pdither->write_short) - psf->write_short = pdither->write_short ; - if (pdither->write_int) - psf->write_int = pdither->write_int ; - if (pdither->write_float) - psf->write_float = pdither->write_float ; - if (pdither->write_double) - psf->write_double = pdither->write_double ; - return 0 ; - } ; - - /* Turn on dither on read if asked. */ - if (mode == SFM_READ && psf->read_dither.type != 0) - { if (pdither == NULL) - pdither = psf->dither = calloc (1, sizeof (DITHER_DATA)) ; - if (pdither == NULL) - return SFE_MALLOC_FAILED ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_DOUBLE : - case SF_FORMAT_FLOAT : - pdither->read_int = psf->read_int ; - psf->read_int = dither_read_int ; - break ; - - case SF_FORMAT_PCM_32 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - pdither->read_short = psf->read_short ; - psf->read_short = dither_read_short ; - break ; - - default : break ; - } ; - } ; - - /* Turn on dither on write if asked. */ - if (mode == SFM_WRITE && psf->write_dither.type != 0) - { if (pdither == NULL) - pdither = psf->dither = calloc (1, sizeof (DITHER_DATA)) ; - if (pdither == NULL) - return SFE_MALLOC_FAILED ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_DOUBLE : - case SF_FORMAT_FLOAT : - pdither->write_int = psf->write_int ; - psf->write_int = dither_write_int ; - break ; - - case SF_FORMAT_PCM_32 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - break ; - - default : break ; - } ; - - pdither->write_short = psf->write_short ; - psf->write_short = dither_write_short ; - - pdither->write_int = psf->write_int ; - psf->write_int = dither_write_int ; - - pdither->write_float = psf->write_float ; - psf->write_float = dither_write_float ; - - pdither->write_double = psf->write_double ; - psf->write_double = dither_write_double ; - } ; - - return 0 ; -} /* dither_init */ - -/*============================================================================== -*/ - -static void dither_short (const short *in, short *out, int frames, int channels) ; -static void dither_int (const int *in, int *out, int frames, int channels) ; - -static void dither_float (const float *in, float *out, int frames, int channels) ; -static void dither_double (const double *in, double *out, int frames, int channels) ; - -static sf_count_t -dither_read_short (SF_PRIVATE * UNUSED (psf), short * UNUSED (ptr), sf_count_t len) -{ - return len ; -} /* dither_read_short */ - -static sf_count_t -dither_read_int (SF_PRIVATE * UNUSED (psf), int * UNUSED (ptr), sf_count_t len) -{ - return len ; -} /* dither_read_int */ - -/*------------------------------------------------------------------------------ -*/ - -static sf_count_t -dither_write_short (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ DITHER_DATA *pdither ; - int bufferlen, writecount, thiswrite ; - sf_count_t total = 0 ; - - if ((pdither = psf->dither) == NULL) - { psf->error = SFE_DITHER_BAD_PTR ; - return 0 ; - } ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - case SF_FORMAT_DPCM_8 : - break ; - - default : - return pdither->write_short (psf, ptr, len) ; - } ; - - bufferlen = sizeof (pdither->buffer) / sizeof (short) ; - - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - writecount /= psf->sf.channels ; - writecount *= psf->sf.channels ; - - dither_short (ptr, (short*) pdither->buffer, writecount / psf->sf.channels, psf->sf.channels) ; - - thiswrite = pdither->write_short (psf, (short*) pdither->buffer, writecount) ; - total += thiswrite ; - len -= thiswrite ; - if (thiswrite < writecount) - break ; - } ; - - return total ; -} /* dither_write_short */ - -static sf_count_t -dither_write_int (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ DITHER_DATA *pdither ; - int bufferlen, writecount, thiswrite ; - sf_count_t total = 0 ; - - if ((pdither = psf->dither) == NULL) - { psf->error = SFE_DITHER_BAD_PTR ; - return 0 ; - } ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - break ; - - case SF_FORMAT_DPCM_8 : - case SF_FORMAT_DPCM_16 : - break ; - - default : - return pdither->write_int (psf, ptr, len) ; - } ; - - - bufferlen = sizeof (pdither->buffer) / sizeof (int) ; - - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - writecount /= psf->sf.channels ; - writecount *= psf->sf.channels ; - - dither_int (ptr, (int*) pdither->buffer, writecount / psf->sf.channels, psf->sf.channels) ; - - thiswrite = pdither->write_int (psf, (int*) pdither->buffer, writecount) ; - total += thiswrite ; - len -= thiswrite ; - if (thiswrite < writecount) - break ; - } ; - - return total ; -} /* dither_write_int */ - -static sf_count_t -dither_write_float (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ DITHER_DATA *pdither ; - int bufferlen, writecount, thiswrite ; - sf_count_t total = 0 ; - - if ((pdither = psf->dither) == NULL) - { psf->error = SFE_DITHER_BAD_PTR ; - return 0 ; - } ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - break ; - - case SF_FORMAT_DPCM_8 : - case SF_FORMAT_DPCM_16 : - break ; - - default : - return pdither->write_float (psf, ptr, len) ; - } ; - - bufferlen = sizeof (pdither->buffer) / sizeof (float) ; - - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (float) len ; - writecount /= psf->sf.channels ; - writecount *= psf->sf.channels ; - - dither_float (ptr, (float*) pdither->buffer, writecount / psf->sf.channels, psf->sf.channels) ; - - thiswrite = pdither->write_float (psf, (float*) pdither->buffer, writecount) ; - total += thiswrite ; - len -= thiswrite ; - if (thiswrite < writecount) - break ; - } ; - - return total ; -} /* dither_write_float */ - -static sf_count_t -dither_write_double (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ DITHER_DATA *pdither ; - int bufferlen, writecount, thiswrite ; - sf_count_t total = 0 ; - - if ((pdither = psf->dither) == NULL) - { psf->error = SFE_DITHER_BAD_PTR ; - return 0 ; - } ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - break ; - - case SF_FORMAT_DPCM_8 : - case SF_FORMAT_DPCM_16 : - break ; - - default : - return pdither->write_double (psf, ptr, len) ; - } ; - - - bufferlen = sizeof (pdither->buffer) / sizeof (double) ; - - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (double) len ; - writecount /= psf->sf.channels ; - writecount *= psf->sf.channels ; - - dither_double (ptr, (double*) pdither->buffer, writecount / psf->sf.channels, psf->sf.channels) ; - - thiswrite = pdither->write_double (psf, (double*) pdither->buffer, writecount) ; - total += thiswrite ; - len -= thiswrite ; - if (thiswrite < writecount) - break ; - } ; - - return total ; -} /* dither_write_double */ - -/*============================================================================== -*/ - -static void -dither_short (const short *in, short *out, int frames, int channels) -{ int ch, k ; - - for (ch = 0 ; ch < channels ; ch++) - for (k = ch ; k < channels * frames ; k += channels) - out [k] = in [k] ; - -} /* dither_short */ - -static void -dither_int (const int *in, int *out, int frames, int channels) -{ int ch, k ; - - for (ch = 0 ; ch < channels ; ch++) - for (k = ch ; k < channels * frames ; k += channels) - out [k] = in [k] ; - -} /* dither_int */ - -static void -dither_float (const float *in, float *out, int frames, int channels) -{ int ch, k ; - - for (ch = 0 ; ch < channels ; ch++) - for (k = ch ; k < channels * frames ; k += channels) - out [k] = in [k] ; - -} /* dither_float */ - -static void -dither_double (const double *in, double *out, int frames, int channels) -{ int ch, k ; - - for (ch = 0 ; ch < channels ; ch++) - for (k = ch ; k < channels * frames ; k += channels) - out [k] = in [k] ; - -} /* dither_double */ - -/*============================================================================== -*/ -#if 0 - -/* -** Not made public because this (maybe) requires storage of state information. -** -** Also maybe need separate state info for each channel!!!! -*/ - -int -DO_NOT_USE_sf_dither_short (const SF_DITHER_INFO *dither, const short *in, short *out, int frames, int channels) -{ int ch, k ; - - if (! dither) - return SFE_DITHER_BAD_PTR ; - - switch (dither->type & SFD_TYPEMASK) - { case SFD_WHITE : - case SFD_TRIANGULAR_PDF : - for (ch = 0 ; ch < channels ; ch++) - for (k = ch ; k < channels * frames ; k += channels) - out [k] = in [k] ; - break ; - - default : - return SFE_DITHER_BAD_TYPE ; - } ; - - return 0 ; -} /* DO_NOT_USE_sf_dither_short */ - -int -DO_NOT_USE_sf_dither_int (const SF_DITHER_INFO *dither, const int *in, int *out, int frames, int channels) -{ int ch, k ; - - if (! dither) - return SFE_DITHER_BAD_PTR ; - - switch (dither->type & SFD_TYPEMASK) - { case SFD_WHITE : - case SFD_TRIANGULAR_PDF : - for (ch = 0 ; ch < channels ; ch++) - for (k = ch ; k < channels * frames ; k += channels) - out [k] = in [k] ; - break ; - - default : - return SFE_DITHER_BAD_TYPE ; - } ; - - return 0 ; -} /* DO_NOT_USE_sf_dither_int */ - -int -DO_NOT_USE_sf_dither_float (const SF_DITHER_INFO *dither, const float *in, float *out, int frames, int channels) -{ int ch, k ; - - if (! dither) - return SFE_DITHER_BAD_PTR ; - - switch (dither->type & SFD_TYPEMASK) - { case SFD_WHITE : - case SFD_TRIANGULAR_PDF : - for (ch = 0 ; ch < channels ; ch++) - for (k = ch ; k < channels * frames ; k += channels) - out [k] = in [k] ; - break ; - - default : - return SFE_DITHER_BAD_TYPE ; - } ; - - return 0 ; -} /* DO_NOT_USE_sf_dither_float */ - -int -DO_NOT_USE_sf_dither_double (const SF_DITHER_INFO *dither, const double *in, double *out, int frames, int channels) -{ int ch, k ; - - if (! dither) - return SFE_DITHER_BAD_PTR ; - - switch (dither->type & SFD_TYPEMASK) - { case SFD_WHITE : - case SFD_TRIANGULAR_PDF : - for (ch = 0 ; ch < channels ; ch++) - for (k = ch ; k < channels * frames ; k += channels) - out [k] = in [k] ; - break ; - - default : - return SFE_DITHER_BAD_TYPE ; - } ; - - return 0 ; -} /* DO_NOT_USE_sf_dither_double */ - -#endif - diff --git a/libs/libsndfile/src/double64.c b/libs/libsndfile/src/double64.c deleted file mode 100644 index ce60699e61..0000000000 --- a/libs/libsndfile/src/double64.c +++ /dev/null @@ -1,1058 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if CPU_IS_LITTLE_ENDIAN - #define DOUBLE64_READ double64_le_read - #define DOUBLE64_WRITE double64_le_write -#elif CPU_IS_BIG_ENDIAN - #define DOUBLE64_READ double64_be_read - #define DOUBLE64_WRITE double64_be_write -#endif - -/* A 32 number which will not overflow when multiplied by sizeof (double). */ -#define SENSIBLE_LEN (0x8000000) - -/*-------------------------------------------------------------------------------------------- -** Processor floating point capabilities. double64_get_capability () returns one of the -** latter three values. -*/ - -enum -{ DOUBLE_UNKNOWN = 0x00, - DOUBLE_CAN_RW_LE = 0x23, - DOUBLE_CAN_RW_BE = 0x34, - DOUBLE_BROKEN_LE = 0x45, - DOUBLE_BROKEN_BE = 0x56 -} ; - -/*-------------------------------------------------------------------------------------------- -** Prototypes for private functions. -*/ - -static sf_count_t host_read_d2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t host_read_d2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t host_read_d2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t host_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t host_write_s2d (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t host_write_i2d (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t host_write_f2d (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t host_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static void double64_peak_update (SF_PRIVATE *psf, const double *buffer, int count, sf_count_t indx) ; - -static int double64_get_capability (SF_PRIVATE *psf) ; - -static sf_count_t replace_read_d2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t replace_read_d2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t replace_read_d2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t replace_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t replace_write_s2d (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t replace_write_i2d (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t replace_write_f2d (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t replace_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static void d2bd_read (double *buffer, int count) ; -static void bd2d_write (double *buffer, int count) ; - -/*-------------------------------------------------------------------------------------------- -** Exported functions. -*/ - -int -double64_init (SF_PRIVATE *psf) -{ static int double64_caps ; - - double64_caps = double64_get_capability (psf) ; - - psf->blockwidth = sizeof (double) * psf->sf.channels ; - - if (psf->file.mode == SFM_READ || psf->file.mode == SFM_RDWR) - { switch (psf->endian + double64_caps) - { case (SF_ENDIAN_BIG + DOUBLE_CAN_RW_BE) : - psf->data_endswap = SF_FALSE ; - psf->read_short = host_read_d2s ; - psf->read_int = host_read_d2i ; - psf->read_float = host_read_d2f ; - psf->read_double = host_read_d ; - break ; - - case (SF_ENDIAN_LITTLE + DOUBLE_CAN_RW_LE) : - psf->data_endswap = SF_FALSE ; - psf->read_short = host_read_d2s ; - psf->read_int = host_read_d2i ; - psf->read_float = host_read_d2f ; - psf->read_double = host_read_d ; - break ; - - case (SF_ENDIAN_BIG + DOUBLE_CAN_RW_LE) : - psf->data_endswap = SF_TRUE ; - psf->read_short = host_read_d2s ; - psf->read_int = host_read_d2i ; - psf->read_float = host_read_d2f ; - psf->read_double = host_read_d ; - break ; - - case (SF_ENDIAN_LITTLE + DOUBLE_CAN_RW_BE) : - psf->data_endswap = SF_TRUE ; - psf->read_short = host_read_d2s ; - psf->read_int = host_read_d2i ; - psf->read_float = host_read_d2f ; - psf->read_double = host_read_d ; - break ; - - /* When the CPU is not IEEE compatible. */ - case (SF_ENDIAN_BIG + DOUBLE_BROKEN_BE) : - psf->data_endswap = SF_FALSE ; - psf->read_short = replace_read_d2s ; - psf->read_int = replace_read_d2i ; - psf->read_float = replace_read_d2f ; - psf->read_double = replace_read_d ; - break ; - - case (SF_ENDIAN_LITTLE + DOUBLE_BROKEN_LE) : - psf->data_endswap = SF_FALSE ; - psf->read_short = replace_read_d2s ; - psf->read_int = replace_read_d2i ; - psf->read_float = replace_read_d2f ; - psf->read_double = replace_read_d ; - break ; - - case (SF_ENDIAN_BIG + DOUBLE_BROKEN_LE) : - psf->data_endswap = SF_TRUE ; - psf->read_short = replace_read_d2s ; - psf->read_int = replace_read_d2i ; - psf->read_float = replace_read_d2f ; - psf->read_double = replace_read_d ; - break ; - - case (SF_ENDIAN_LITTLE + DOUBLE_BROKEN_BE) : - psf->data_endswap = SF_TRUE ; - psf->read_short = replace_read_d2s ; - psf->read_int = replace_read_d2i ; - psf->read_float = replace_read_d2f ; - psf->read_double = replace_read_d ; - break ; - - default : break ; - } ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { switch (psf->endian + double64_caps) - { case (SF_ENDIAN_LITTLE + DOUBLE_CAN_RW_LE) : - psf->data_endswap = SF_FALSE ; - psf->write_short = host_write_s2d ; - psf->write_int = host_write_i2d ; - psf->write_float = host_write_f2d ; - psf->write_double = host_write_d ; - break ; - - case (SF_ENDIAN_BIG + DOUBLE_CAN_RW_BE) : - psf->data_endswap = SF_FALSE ; - psf->write_short = host_write_s2d ; - psf->write_int = host_write_i2d ; - psf->write_float = host_write_f2d ; - psf->write_double = host_write_d ; - break ; - - case (SF_ENDIAN_BIG + DOUBLE_CAN_RW_LE) : - psf->data_endswap = SF_TRUE ; - psf->write_short = host_write_s2d ; - psf->write_int = host_write_i2d ; - psf->write_float = host_write_f2d ; - psf->write_double = host_write_d ; - break ; - - case (SF_ENDIAN_LITTLE + DOUBLE_CAN_RW_BE) : - psf->data_endswap = SF_TRUE ; - psf->write_short = host_write_s2d ; - psf->write_int = host_write_i2d ; - psf->write_float = host_write_f2d ; - psf->write_double = host_write_d ; - break ; - - /* When the CPU is not IEEE compatible. */ - case (SF_ENDIAN_LITTLE + DOUBLE_BROKEN_LE) : - psf->data_endswap = SF_FALSE ; - psf->write_short = replace_write_s2d ; - psf->write_int = replace_write_i2d ; - psf->write_float = replace_write_f2d ; - psf->write_double = replace_write_d ; - break ; - - case (SF_ENDIAN_BIG + DOUBLE_BROKEN_BE) : - psf->data_endswap = SF_FALSE ; - psf->write_short = replace_write_s2d ; - psf->write_int = replace_write_i2d ; - psf->write_float = replace_write_f2d ; - psf->write_double = replace_write_d ; - break ; - - case (SF_ENDIAN_BIG + DOUBLE_BROKEN_LE) : - psf->data_endswap = SF_TRUE ; - psf->write_short = replace_write_s2d ; - psf->write_int = replace_write_i2d ; - psf->write_float = replace_write_f2d ; - psf->write_double = replace_write_d ; - break ; - - case (SF_ENDIAN_LITTLE + DOUBLE_BROKEN_BE) : - psf->data_endswap = SF_TRUE ; - psf->write_short = replace_write_s2d ; - psf->write_int = replace_write_i2d ; - psf->write_float = replace_write_f2d ; - psf->write_double = replace_write_d ; - break ; - - default : break ; - } ; - } ; - - if (psf->filelength > psf->dataoffset) - { psf->datalength = (psf->dataend > 0) ? psf->dataend - psf->dataoffset : - psf->filelength - psf->dataoffset ; - } - else - psf->datalength = 0 ; - - psf->sf.frames = psf->datalength / psf->blockwidth ; - - return 0 ; -} /* double64_init */ - -/*---------------------------------------------------------------------------- -** From : http://www.hpcf.cam.ac.uk/fp_formats.html -** -** 64 bit double precision layout (big endian) -** Sign bit 0 -** Exponent bits 1-11 -** Mantissa bits 12-63 -** Exponent Offset 1023 -** -** double single -** -** +INF 7FF0000000000000 7F800000 -** -INF FFF0000000000000 FF800000 -** NaN 7FF0000000000001 7F800001 -** to to -** 7FFFFFFFFFFFFFFF 7FFFFFFF -** and and -** FFF0000000000001 FF800001 -** to to -** FFFFFFFFFFFFFFFF FFFFFFFF -** +OVER 7FEFFFFFFFFFFFFF 7F7FFFFF -** -OVER FFEFFFFFFFFFFFFF FF7FFFFF -** +UNDER 0010000000000000 00800000 -** -UNDER 8010000000000000 80800000 -*/ - -double -double64_be_read (const unsigned char *cptr) -{ int exponent, negative, upper, lower ; - double dvalue ; - - negative = (cptr [0] & 0x80) ? 1 : 0 ; - exponent = ((cptr [0] & 0x7F) << 4) | ((cptr [1] >> 4) & 0xF) ; - - /* Might not have a 64 bit long, so load the mantissa into a double. */ - upper = (((cptr [1] & 0xF) << 24) | (cptr [2] << 16) | (cptr [3] << 8) | cptr [4]) ; - lower = (cptr [5] << 16) | (cptr [6] << 8) | cptr [7] ; - - if (exponent == 0 && upper == 0 && lower == 0) - return 0.0 ; - - dvalue = upper + lower / ((double) 0x1000000) ; - dvalue += 0x10000000 ; - - exponent = exponent - 0x3FF ; - - dvalue = dvalue / ((double) 0x10000000) ; - - if (negative) - dvalue *= -1 ; - - if (exponent > 0) - dvalue *= pow (2.0, exponent) ; - else if (exponent < 0) - dvalue /= pow (2.0, abs (exponent)) ; - - return dvalue ; -} /* double64_be_read */ - -double -double64_le_read (const unsigned char *cptr) -{ int exponent, negative, upper, lower ; - double dvalue ; - - negative = (cptr [7] & 0x80) ? 1 : 0 ; - exponent = ((cptr [7] & 0x7F) << 4) | ((cptr [6] >> 4) & 0xF) ; - - /* Might not have a 64 bit long, so load the mantissa into a double. */ - upper = ((cptr [6] & 0xF) << 24) | (cptr [5] << 16) | (cptr [4] << 8) | cptr [3] ; - lower = (cptr [2] << 16) | (cptr [1] << 8) | cptr [0] ; - - if (exponent == 0 && upper == 0 && lower == 0) - return 0.0 ; - - dvalue = upper + lower / ((double) 0x1000000) ; - dvalue += 0x10000000 ; - - exponent = exponent - 0x3FF ; - - dvalue = dvalue / ((double) 0x10000000) ; - - if (negative) - dvalue *= -1 ; - - if (exponent > 0) - dvalue *= pow (2.0, exponent) ; - else if (exponent < 0) - dvalue /= pow (2.0, abs (exponent)) ; - - return dvalue ; -} /* double64_le_read */ - -void -double64_be_write (double in, unsigned char *out) -{ int exponent, mantissa ; - - memset (out, 0, sizeof (double)) ; - - if (fabs (in) < 1e-30) - return ; - - if (in < 0.0) - { in *= -1.0 ; - out [0] |= 0x80 ; - } ; - - in = frexp (in, &exponent) ; - - exponent += 1022 ; - - out [0] |= (exponent >> 4) & 0x7F ; - out [1] |= (exponent << 4) & 0xF0 ; - - in *= 0x20000000 ; - mantissa = lrint (floor (in)) ; - - out [1] |= (mantissa >> 24) & 0xF ; - out [2] = (mantissa >> 16) & 0xFF ; - out [3] = (mantissa >> 8) & 0xFF ; - out [4] = mantissa & 0xFF ; - - in = fmod (in, 1.0) ; - in *= 0x1000000 ; - mantissa = lrint (floor (in)) ; - - out [5] = (mantissa >> 16) & 0xFF ; - out [6] = (mantissa >> 8) & 0xFF ; - out [7] = mantissa & 0xFF ; - - return ; -} /* double64_be_write */ - -void -double64_le_write (double in, unsigned char *out) -{ int exponent, mantissa ; - - memset (out, 0, sizeof (double)) ; - - if (fabs (in) < 1e-30) - return ; - - if (in < 0.0) - { in *= -1.0 ; - out [7] |= 0x80 ; - } ; - - in = frexp (in, &exponent) ; - - exponent += 1022 ; - - out [7] |= (exponent >> 4) & 0x7F ; - out [6] |= (exponent << 4) & 0xF0 ; - - in *= 0x20000000 ; - mantissa = lrint (floor (in)) ; - - out [6] |= (mantissa >> 24) & 0xF ; - out [5] = (mantissa >> 16) & 0xFF ; - out [4] = (mantissa >> 8) & 0xFF ; - out [3] = mantissa & 0xFF ; - - in = fmod (in, 1.0) ; - in *= 0x1000000 ; - mantissa = lrint (floor (in)) ; - - out [2] = (mantissa >> 16) & 0xFF ; - out [1] = (mantissa >> 8) & 0xFF ; - out [0] = mantissa & 0xFF ; - - return ; -} /* double64_le_write */ - -/*============================================================================================== -** Private functions. -*/ - -static void -double64_peak_update (SF_PRIVATE *psf, const double *buffer, int count, sf_count_t indx) -{ int chan ; - int k, position ; - float fmaxval ; - - for (chan = 0 ; chan < psf->sf.channels ; chan++) - { fmaxval = fabs (buffer [chan]) ; - position = 0 ; - for (k = chan ; k < count ; k += psf->sf.channels) - if (fmaxval < fabs (buffer [k])) - { fmaxval = fabs (buffer [k]) ; - position = k ; - } ; - - if (fmaxval > psf->peak_info->peaks [chan].value) - { psf->peak_info->peaks [chan].value = fmaxval ; - psf->peak_info->peaks [chan].position = psf->write_current + indx + (position / psf->sf.channels) ; - } ; - } ; - - return ; -} /* double64_peak_update */ - -static int -double64_get_capability (SF_PRIVATE *psf) -{ union - { double d ; - unsigned char c [8] ; - } data ; - - data.d = 1.234567890123456789 ; /* Some abitrary value. */ - - if (! psf->ieee_replace) - { /* If this test is true ints and floats are compatible and little endian. */ - if (data.c [0] == 0xfb && data.c [1] == 0x59 && data.c [2] == 0x8c && data.c [3] == 0x42 && - data.c [4] == 0xca && data.c [5] == 0xc0 && data.c [6] == 0xf3 && data.c [7] == 0x3f) - return DOUBLE_CAN_RW_LE ; - - /* If this test is true ints and floats are compatible and big endian. */ - if (data.c [0] == 0x3f && data.c [1] == 0xf3 && data.c [2] == 0xc0 && data.c [3] == 0xca && - data.c [4] == 0x42 && data.c [5] == 0x8c && data.c [6] == 0x59 && data.c [7] == 0xfb) - return DOUBLE_CAN_RW_BE ; - } ; - - /* Doubles are broken. Don't expect reading or writing to be fast. */ - psf_log_printf (psf, "Using IEEE replacement code for double.\n") ; - - return (CPU_IS_LITTLE_ENDIAN) ? DOUBLE_BROKEN_LE : DOUBLE_BROKEN_BE ; -} /* double64_get_capability */ - -/*======================================================================================= -*/ - -static void -d2s_array (const double *src, int count, short *dest, double scale) -{ while (--count >= 0) - { dest [count] = lrint (scale * src [count]) ; - } ; -} /* d2s_array */ - -static void -d2s_clip_array (const double *src, int count, short *dest, double scale) -{ while (--count >= 0) - { double tmp = scale * src [count] ; - - if (CPU_CLIPS_POSITIVE == 0 && tmp > 32767.0) - dest [count] = SHRT_MAX ; - else if (CPU_CLIPS_NEGATIVE == 0 && tmp < -32768.0) - dest [count] = SHRT_MIN ; - else - dest [count] = lrint (tmp) ; - } ; -} /* d2s_clip_array */ - -static void -d2i_array (const double *src, int count, int *dest, double scale) -{ while (--count >= 0) - { dest [count] = lrint (scale * src [count]) ; - } ; -} /* d2i_array */ - -static void -d2i_clip_array (const double *src, int count, int *dest, double scale) -{ while (--count >= 0) - { float tmp = scale * src [count] ; - - if (CPU_CLIPS_POSITIVE == 0 && tmp > (1.0 * INT_MAX)) - dest [count] = INT_MAX ; - else if (CPU_CLIPS_NEGATIVE == 0 && tmp < (-1.0 * INT_MAX)) - dest [count] = INT_MIN ; - else - dest [count] = lrint (tmp) ; - } ; -} /* d2i_clip_array */ - -static inline void -d2f_array (const double *src, int count, float *dest) -{ while (--count >= 0) - { dest [count] = src [count] ; - } ; -} /* d2f_array */ - -static inline void -s2d_array (const short *src, double *dest, int count, double scale) -{ while (--count >= 0) - { dest [count] = scale * src [count] ; - } ; -} /* s2d_array */ - -static inline void -i2d_array (const int *src, double *dest, int count, double scale) -{ while (--count >= 0) - { dest [count] = scale * src [count] ; - } ; -} /* i2d_array */ - -static inline void -f2d_array (const float *src, double *dest, int count) -{ while (--count >= 0) - { dest [count] = src [count] ; - } ; -} /* f2d_array */ - -/*---------------------------------------------------------------------------------------------- -*/ - -static sf_count_t -host_read_d2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const double *, int, short *, double) ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double scale ; - - convert = (psf->add_clipping) ? d2s_clip_array : d2s_array ; - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - scale = (psf->float_int_mult == 0) ? 1.0 : 0x7FFF / psf->float_max ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, readcount) ; - - convert (ubuf.dbuf, readcount, ptr + total, scale) ; - total += readcount ; - len -= readcount ; - if (readcount < bufferlen) - break ; - } ; - - return total ; -} /* host_read_d2s */ - -static sf_count_t -host_read_d2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const double *, int, int *, double) ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double scale ; - - convert = (psf->add_clipping) ? d2i_clip_array : d2i_array ; - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - scale = (psf->float_int_mult == 0) ? 1.0 : 0x7FFFFFFF / psf->float_max ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - convert (ubuf.dbuf, readcount, ptr + total, scale) ; - total += readcount ; - len -= readcount ; - if (readcount < bufferlen) - break ; - } ; - - return total ; -} /* host_read_d2i */ - -static sf_count_t -host_read_d2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - d2f_array (ubuf.dbuf, readcount, ptr + total) ; - total += readcount ; - len -= readcount ; - if (readcount < bufferlen) - break ; - } ; - - return total ; -} /* host_read_d2f */ - -static sf_count_t -host_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ int bufferlen ; - sf_count_t readcount, total = 0 ; - - readcount = psf_fread (ptr, sizeof (double), len, psf) ; - - if (psf->data_endswap != SF_TRUE) - return readcount ; - - /* If the read length was sensible, endswap output in one go. */ - if (readcount < SENSIBLE_LEN) - { endswap_double_array (ptr, readcount) ; - return readcount ; - } ; - - bufferlen = SENSIBLE_LEN ; - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - - endswap_double_array (ptr + total, bufferlen) ; - - total += bufferlen ; - len -= bufferlen ; - } ; - - return total ; -} /* host_read_d */ - -static sf_count_t -host_write_s2d (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - double scale ; - - scale = (psf->scale_int_float == 0) ? 1.0 : 1.0 / 0x8000 ; - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - - s2d_array (ptr + total, ubuf.dbuf, bufferlen, scale) ; - - if (psf->peak_info) - double64_peak_update (psf, ubuf.dbuf, bufferlen, total / psf->sf.channels) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* host_write_s2d */ - -static sf_count_t -host_write_i2d (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - double scale ; - - scale = (psf->scale_int_float == 0) ? 1.0 : 1.0 / (8.0 * 0x10000000) ; - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2d_array (ptr + total, ubuf.dbuf, bufferlen, scale) ; - - if (psf->peak_info) - double64_peak_update (psf, ubuf.dbuf, bufferlen, total / psf->sf.channels) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* host_write_i2d */ - -static sf_count_t -host_write_f2d (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - f2d_array (ptr + total, ubuf.dbuf, bufferlen) ; - - if (psf->peak_info) - double64_peak_update (psf, ubuf.dbuf, bufferlen, total / psf->sf.channels) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* host_write_f2d */ - -static sf_count_t -host_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - if (psf->peak_info) - double64_peak_update (psf, ptr, len, 0) ; - - if (psf->data_endswap != SF_TRUE) - return psf_fwrite (ptr, sizeof (double), len, psf) ; - - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - - endswap_double_copy (ubuf.dbuf, ptr + total, bufferlen) ; - - writecount = psf_fwrite (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* host_write_d */ - -/*======================================================================================= -*/ - -static sf_count_t -replace_read_d2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double scale ; - - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - scale = (psf->float_int_mult == 0) ? 1.0 : 0x7FFF / psf->float_max ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - d2bd_read (ubuf.dbuf, bufferlen) ; - - d2s_array (ubuf.dbuf, readcount, ptr + total, scale) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* replace_read_d2s */ - -static sf_count_t -replace_read_d2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double scale ; - - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - scale = (psf->float_int_mult == 0) ? 1.0 : 0x7FFFFFFF / psf->float_max ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - d2bd_read (ubuf.dbuf, bufferlen) ; - - d2i_array (ubuf.dbuf, readcount, ptr + total, scale) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* replace_read_d2i */ - -static sf_count_t -replace_read_d2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - d2bd_read (ubuf.dbuf, bufferlen) ; - - memcpy (ptr + total, ubuf.dbuf, bufferlen * sizeof (double)) ; - - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* replace_read_d2f */ - -static sf_count_t -replace_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - /* FIXME : This is probably nowhere near optimal. */ - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, readcount) ; - - d2bd_read (ubuf.dbuf, readcount) ; - - memcpy (ptr + total, ubuf.dbuf, readcount * sizeof (double)) ; - - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* replace_read_d */ - -static sf_count_t -replace_write_s2d (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - double scale ; - - scale = (psf->scale_int_float == 0) ? 1.0 : 1.0 / 0x8000 ; - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2d_array (ptr + total, ubuf.dbuf, bufferlen, scale) ; - - if (psf->peak_info) - double64_peak_update (psf, ubuf.dbuf, bufferlen, total / psf->sf.channels) ; - - bd2d_write (ubuf.dbuf, bufferlen) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* replace_write_s2d */ - -static sf_count_t -replace_write_i2d (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - double scale ; - - scale = (psf->scale_int_float == 0) ? 1.0 : 1.0 / (8.0 * 0x10000000) ; - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2d_array (ptr + total, ubuf.dbuf, bufferlen, scale) ; - - if (psf->peak_info) - double64_peak_update (psf, ubuf.dbuf, bufferlen, total / psf->sf.channels) ; - - bd2d_write (ubuf.dbuf, bufferlen) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* replace_write_i2d */ - -static sf_count_t -replace_write_f2d (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - f2d_array (ptr + total, ubuf.dbuf, bufferlen) ; - - bd2d_write (ubuf.dbuf, bufferlen) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* replace_write_f2d */ - -static sf_count_t -replace_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - /* FIXME : This is probably nowhere near optimal. */ - if (psf->peak_info) - double64_peak_update (psf, ptr, len, 0) ; - - bufferlen = ARRAY_LEN (ubuf.dbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - - memcpy (ubuf.dbuf, ptr + total, bufferlen * sizeof (double)) ; - - bd2d_write (ubuf.dbuf, bufferlen) ; - - if (psf->data_endswap == SF_TRUE) - endswap_double_array (ubuf.dbuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.dbuf, sizeof (double), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* replace_write_d */ - -/*---------------------------------------------------------------------------------------------- -*/ - -static void -d2bd_read (double *buffer, int count) -{ while (--count >= 0) - { buffer [count] = DOUBLE64_READ ((unsigned char *) (buffer + count)) ; - } ; -} /* d2bd_read */ - -static void -bd2d_write (double *buffer, int count) -{ while (--count >= 0) - { DOUBLE64_WRITE (buffer [count], (unsigned char*) (buffer + count)) ; - } ; -} /* bd2d_write */ - diff --git a/libs/libsndfile/src/dwd.c b/libs/libsndfile/src/dwd.c deleted file mode 100644 index af4d9f0e41..0000000000 --- a/libs/libsndfile/src/dwd.c +++ /dev/null @@ -1,201 +0,0 @@ -/* -** Copyright (C) 2002-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if (ENABLE_EXPERIMENTAL_CODE == 0) - -int -dwd_open (SF_PRIVATE *psf) -{ if (psf) - return SFE_UNIMPLEMENTED ; - return 0 ; -} /* dwd_open */ - -#else - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues. -*/ - -#define SFE_DWD_NO_DWD 1666 -#define SFE_DWD_BAND_BIT_WIDTH 1667 -#define SFE_DWD_COMPRESSION 1668 - -#define DWD_IDENTIFIER "DiamondWare Digitized\n\0\x1a" -#define DWD_IDENTIFIER_LEN 24 - -#define DWD_HEADER_LEN 57 - -/*------------------------------------------------------------------------------ -** Typedefs. -*/ - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int dwd_read_header (SF_PRIVATE *psf) ; - -static int dwd_close (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -dwd_open (SF_PRIVATE *psf) -{ int error = 0 ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = dwd_read_header (psf))) - return error ; - } ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_DWD) - return SFE_BAD_OPEN_FORMAT ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { - /*-psf->endian = SF_ENDIAN (psf->sf.format) ; - if (CPU_IS_LITTLE_ENDIAN && psf->endian == SF_ENDIAN_CPU) - psf->endian = SF_ENDIAN_LITTLE ; - else if (psf->endian != SF_ENDIAN_LITTLE) - psf->endian = SF_ENDIAN_BIG ; - - if (! (encoding = dwd_write_header (psf, SF_FALSE))) - return psf->error ; - - psf->write_header = dwd_write_header ; - -*/ - } ; - - psf->container_close = dwd_close ; - - /*-psf->blockwidth = psf->bytewidth * psf->sf.channels ;-*/ - - return error ; -} /* dwd_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -dwd_close (SF_PRIVATE * UNUSED (psf)) -{ - return 0 ; -} /* dwd_close */ - -/* This struct contains all the fields of interest om the DWD header, but does not -** do so in the same order and layout as the actual file, header. -** No assumptions are made about the packing of this struct. -*/ -typedef struct -{ unsigned char major, minor, compression, channels, bitwidth ; - unsigned short srate, maxval ; - unsigned int id, datalen, frames, offset ; -} DWD_HEADER ; - -static int -dwd_read_header (SF_PRIVATE *psf) -{ BUF_UNION ubuf ; - DWD_HEADER dwdh ; - - memset (ubuf.cbuf, 0, sizeof (ubuf.cbuf)) ; - /* Set position to start of file to begin reading header. */ - psf_binheader_readf (psf, "pb", 0, ubuf.cbuf, DWD_IDENTIFIER_LEN) ; - - if (memcmp (ubuf.cbuf, DWD_IDENTIFIER, DWD_IDENTIFIER_LEN) != 0) - return SFE_DWD_NO_DWD ; - - psf_log_printf (psf, "Read only : DiamondWare Digitized (.dwd)\n", ubuf.cbuf) ; - - psf_binheader_readf (psf, "11", &dwdh.major, &dwdh.minor) ; - psf_binheader_readf (psf, "e4j1", &dwdh.id, 1, &dwdh.compression) ; - psf_binheader_readf (psf, "e211", &dwdh.srate, &dwdh.channels, &dwdh.bitwidth) ; - psf_binheader_readf (psf, "e24", &dwdh.maxval, &dwdh.datalen) ; - psf_binheader_readf (psf, "e44", &dwdh.frames, &dwdh.offset) ; - - psf_log_printf (psf, " Version Major : %d\n Version Minor : %d\n Unique ID : %08X\n", - dwdh.major, dwdh.minor, dwdh.id) ; - psf_log_printf (psf, " Compression : %d => ", dwdh.compression) ; - - if (dwdh.compression != 0) - { psf_log_printf (psf, "Unsupported compression\n") ; - return SFE_DWD_COMPRESSION ; - } - else - psf_log_printf (psf, "None\n") ; - - psf_log_printf (psf, " Sample Rate : %d\n Channels : %d\n" - " Bit Width : %d\n", - dwdh.srate, dwdh.channels, dwdh.bitwidth) ; - - switch (dwdh.bitwidth) - { case 8 : - psf->sf.format = SF_FORMAT_DWD | SF_FORMAT_PCM_S8 ; - psf->bytewidth = 1 ; - break ; - - case 16 : - psf->sf.format = SF_FORMAT_DWD | SF_FORMAT_PCM_16 ; - psf->bytewidth = 2 ; - break ; - - default : - psf_log_printf (psf, "*** Bad bit width %d\n", dwdh.bitwidth) ; - return SFE_DWD_BAND_BIT_WIDTH ; - } ; - - if (psf->filelength != dwdh.offset + dwdh.datalen) - { psf_log_printf (psf, " Data Length : %d (should be %D)\n", dwdh.datalen, psf->filelength - dwdh.offset) ; - dwdh.datalen = (unsigned int) (psf->filelength - dwdh.offset) ; - } - else - psf_log_printf (psf, " Data Length : %d\n", dwdh.datalen) ; - - psf_log_printf (psf, " Max Value : %d\n", dwdh.maxval) ; - psf_log_printf (psf, " Frames : %d\n", dwdh.frames) ; - psf_log_printf (psf, " Data Offset : %d\n", dwdh.offset) ; - - psf->datalength = dwdh.datalen ; - psf->dataoffset = dwdh.offset ; - - psf->endian = SF_ENDIAN_LITTLE ; - - psf->sf.samplerate = dwdh.srate ; - psf->sf.channels = dwdh.channels ; - psf->sf.sections = 1 ; - - return pcm_init (psf) ; -} /* dwd_read_header */ - -/*------------------------------------------------------------------------------ -*/ - -#endif - diff --git a/libs/libsndfile/src/dwvw.c b/libs/libsndfile/src/dwvw.c deleted file mode 100644 index ddf86f63d5..0000000000 --- a/libs/libsndfile/src/dwvw.c +++ /dev/null @@ -1,674 +0,0 @@ -/* -** Copyright (C) 2002-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/*=========================================================================== -** Delta Word Variable Width -** -** This decoder and encoder were implemented using information found in this -** document : http://home.swbell.net/rubywand/R011SNDFMTS.TXT -** -** According to the document, the algorithm "was invented 1991 by Magnus -** Lidstrom and is copyright 1993 by NuEdge Development". -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -typedef struct -{ int bit_width, dwm_maxsize, max_delta, span ; - int samplecount ; - int bit_count, bits, last_delta_width, last_sample ; - struct - { int index, end ; - unsigned char buffer [256] ; - } b ; -} DWVW_PRIVATE ; - -/*============================================================================================ -*/ - -static sf_count_t dwvw_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t dwvw_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t dwvw_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t dwvw_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t dwvw_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t dwvw_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t dwvw_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t dwvw_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static sf_count_t dwvw_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; -static int dwvw_close (SF_PRIVATE *psf) ; -static int dwvw_byterate (SF_PRIVATE *psf) ; - -static int dwvw_decode_data (SF_PRIVATE *psf, DWVW_PRIVATE *pdwvw, int *ptr, int len) ; -static int dwvw_decode_load_bits (SF_PRIVATE *psf, DWVW_PRIVATE *pdwvw, int bit_count) ; - -static int dwvw_encode_data (SF_PRIVATE *psf, DWVW_PRIVATE *pdwvw, const int *ptr, int len) ; -static void dwvw_encode_store_bits (SF_PRIVATE *psf, DWVW_PRIVATE *pdwvw, int data, int new_bits) ; -static void dwvw_read_reset (DWVW_PRIVATE *pdwvw) ; - -/*============================================================================================ -** DWVW initialisation function. -*/ - -int -dwvw_init (SF_PRIVATE *psf, int bitwidth) -{ DWVW_PRIVATE *pdwvw ; - - if (psf->codec_data != NULL) - { psf_log_printf (psf, "*** psf->codec_data is not NULL.\n") ; - return SFE_INTERNAL ; - } ; - - if (bitwidth > 24) - return SFE_DWVW_BAD_BITWIDTH ; - - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - if ((pdwvw = calloc (1, sizeof (DWVW_PRIVATE))) == NULL) - return SFE_MALLOC_FAILED ; - - psf->codec_data = (void*) pdwvw ; - pdwvw->bit_width = bitwidth ; - dwvw_read_reset (pdwvw) ; - - if (psf->file.mode == SFM_READ) - { psf->read_short = dwvw_read_s ; - psf->read_int = dwvw_read_i ; - psf->read_float = dwvw_read_f ; - psf->read_double = dwvw_read_d ; - } ; - - if (psf->file.mode == SFM_WRITE) - { psf->write_short = dwvw_write_s ; - psf->write_int = dwvw_write_i ; - psf->write_float = dwvw_write_f ; - psf->write_double = dwvw_write_d ; - } ; - - psf->codec_close = dwvw_close ; - psf->seek = dwvw_seek ; - psf->byterate = dwvw_byterate ; - - if (psf->file.mode == SFM_READ) - { psf->sf.frames = psf_decode_frame_count (psf) ; - dwvw_read_reset (pdwvw) ; - } ; - - return 0 ; -} /* dwvw_init */ - -/*-------------------------------------------------------------------------------------------- -*/ - -static int -dwvw_close (SF_PRIVATE *psf) -{ DWVW_PRIVATE *pdwvw ; - - if (psf->codec_data == NULL) - return 0 ; - pdwvw = (DWVW_PRIVATE*) psf->codec_data ; - - if (psf->file.mode == SFM_WRITE) - { static int last_values [12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ; - - /* Write 8 zero samples to fully flush output. */ - dwvw_encode_data (psf, pdwvw, last_values, 12) ; - - /* Write the last buffer worth of data to disk. */ - psf_fwrite (pdwvw->b.buffer, 1, pdwvw->b.index, psf) ; - - if (psf->write_header) - psf->write_header (psf, SF_TRUE) ; - } ; - - return 0 ; -} /* dwvw_close */ - -static sf_count_t -dwvw_seek (SF_PRIVATE *psf, int UNUSED (mode), sf_count_t offset) -{ DWVW_PRIVATE *pdwvw ; - - if (! psf->codec_data) - { psf->error = SFE_INTERNAL ; - return PSF_SEEK_ERROR ; - } ; - - pdwvw = (DWVW_PRIVATE*) psf->codec_data ; - - if (offset == 0) - { psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - dwvw_read_reset (pdwvw) ; - return 0 ; - } ; - - psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; -} /* dwvw_seek */ - -static int -dwvw_byterate (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_READ) - return (psf->datalength * psf->sf.samplerate) / psf->sf.frames ; - - return -1 ; -} /* dwvw_byterate */ - -/*============================================================================== -*/ - -static sf_count_t -dwvw_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ DWVW_PRIVATE *pdwvw ; - BUF_UNION ubuf ; - int *iptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pdwvw = (DWVW_PRIVATE*) psf->codec_data ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = dwvw_decode_data (psf, pdwvw, iptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = iptr [k] >> 16 ; - - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* dwvw_read_s */ - -static sf_count_t -dwvw_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ DWVW_PRIVATE *pdwvw ; - int readcount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pdwvw = (DWVW_PRIVATE*) psf->codec_data ; - - while (len > 0) - { readcount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = dwvw_decode_data (psf, pdwvw, ptr, readcount) ; - - total += count ; - len -= count ; - - if (count != readcount) - break ; - } ; - - return total ; -} /* dwvw_read_i */ - -static sf_count_t -dwvw_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ DWVW_PRIVATE *pdwvw ; - BUF_UNION ubuf ; - int *iptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - float normfact ; - - if (! psf->codec_data) - return 0 ; - pdwvw = (DWVW_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x80000000) : 1.0 ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = dwvw_decode_data (psf, pdwvw, iptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * (float) (iptr [k]) ; - - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* dwvw_read_f */ - -static sf_count_t -dwvw_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ DWVW_PRIVATE *pdwvw ; - BUF_UNION ubuf ; - int *iptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - double normfact ; - - if (! psf->codec_data) - return 0 ; - pdwvw = (DWVW_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x80000000) : 1.0 ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = dwvw_decode_data (psf, pdwvw, iptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * (double) (iptr [k]) ; - - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* dwvw_read_d */ - -static int -dwvw_decode_data (SF_PRIVATE *psf, DWVW_PRIVATE *pdwvw, int *ptr, int len) -{ int count ; - int delta_width_modifier, delta_width, delta_negative, delta, sample ; - - /* Restore state from last decode call. */ - delta_width = pdwvw->last_delta_width ; - sample = pdwvw->last_sample ; - - for (count = 0 ; count < len ; count++) - { /* If bit_count parameter is zero get the delta_width_modifier. */ - delta_width_modifier = dwvw_decode_load_bits (psf, pdwvw, -1) ; - - /* Check for end of input bit stream. Break loop if end. */ - if (delta_width_modifier < 0 || (pdwvw->b.end == 0 && count == 0)) - break ; - - if (delta_width_modifier && dwvw_decode_load_bits (psf, pdwvw, 1)) - delta_width_modifier = - delta_width_modifier ; - - /* Calculate the current word width. */ - delta_width = (delta_width + delta_width_modifier + pdwvw->bit_width) % pdwvw->bit_width ; - - /* Load the delta. */ - delta = 0 ; - if (delta_width) - { delta = dwvw_decode_load_bits (psf, pdwvw, delta_width - 1) | (1 << (delta_width - 1)) ; - delta_negative = dwvw_decode_load_bits (psf, pdwvw, 1) ; - if (delta == pdwvw->max_delta - 1) - delta += dwvw_decode_load_bits (psf, pdwvw, 1) ; - if (delta_negative) - delta = -delta ; - } ; - - /* Calculate the sample */ - sample += delta ; - - if (sample >= pdwvw->max_delta) - sample -= pdwvw->span ; - else if (sample < - pdwvw->max_delta) - sample += pdwvw->span ; - - /* Store the sample justifying to the most significant bit. */ - ptr [count] = sample << (32 - pdwvw->bit_width) ; - - if (pdwvw->b.end == 0 && pdwvw->bit_count == 0) - break ; - } ; - - pdwvw->last_delta_width = delta_width ; - pdwvw->last_sample = sample ; - - pdwvw->samplecount += count ; - - return count ; -} /* dwvw_decode_data */ - -static int -dwvw_decode_load_bits (SF_PRIVATE *psf, DWVW_PRIVATE *pdwvw, int bit_count) -{ int output = 0, get_dwm = SF_FALSE ; - - /* - ** Depending on the value of parameter bit_count, either get the - ** required number of bits (ie bit_count > 0) or the - ** delta_width_modifier (otherwise). - */ - - if (bit_count < 0) - { get_dwm = SF_TRUE ; - /* modify bit_count to ensure we have enought bits for finding dwm. */ - bit_count = pdwvw->dwm_maxsize ; - } ; - - /* Load bits in bit reseviour. */ - while (pdwvw->bit_count < bit_count) - { if (pdwvw->b.index >= pdwvw->b.end) - { pdwvw->b.end = psf_fread (pdwvw->b.buffer, 1, sizeof (pdwvw->b.buffer), psf) ; - pdwvw->b.index = 0 ; - } ; - - /* Check for end of input stream. */ - if (bit_count < 8 && pdwvw->b.end == 0) - return -1 ; - - pdwvw->bits = (pdwvw->bits << 8) ; - - if (pdwvw->b.index < pdwvw->b.end) - { pdwvw->bits |= pdwvw->b.buffer [pdwvw->b.index] ; - pdwvw->b.index ++ ; - } ; - pdwvw->bit_count += 8 ; - } ; - - /* If asked to get bits do so. */ - if (! get_dwm) - { output = (pdwvw->bits >> (pdwvw->bit_count - bit_count)) & ((1 << bit_count) - 1) ; - pdwvw->bit_count -= bit_count ; - return output ; - } ; - - /* Otherwise must have been asked to get delta_width_modifier. */ - while (output < (pdwvw->dwm_maxsize)) - { pdwvw->bit_count -= 1 ; - if (pdwvw->bits & (1 << pdwvw->bit_count)) - break ; - output += 1 ; - } ; - - return output ; -} /* dwvw_decode_load_bits */ - -static void -dwvw_read_reset (DWVW_PRIVATE *pdwvw) -{ int bitwidth = pdwvw->bit_width ; - - memset (pdwvw, 0, sizeof (DWVW_PRIVATE)) ; - - pdwvw->bit_width = bitwidth ; - pdwvw->dwm_maxsize = bitwidth / 2 ; - pdwvw->max_delta = 1 << (bitwidth - 1) ; - pdwvw->span = 1 << bitwidth ; -} /* dwvw_read_reset */ - -static void -dwvw_encode_store_bits (SF_PRIVATE *psf, DWVW_PRIVATE *pdwvw, int data, int new_bits) -{ int byte ; - - /* Shift the bits into the resevoir. */ - pdwvw->bits = (pdwvw->bits << new_bits) | (data & ((1 << new_bits) - 1)) ; - pdwvw->bit_count += new_bits ; - - /* Transfer bit to buffer. */ - while (pdwvw->bit_count >= 8) - { byte = pdwvw->bits >> (pdwvw->bit_count - 8) ; - pdwvw->bit_count -= 8 ; - pdwvw->b.buffer [pdwvw->b.index] = byte & 0xFF ; - pdwvw->b.index ++ ; - } ; - - if (pdwvw->b.index > SIGNED_SIZEOF (pdwvw->b.buffer) - 4) - { psf_fwrite (pdwvw->b.buffer, 1, pdwvw->b.index, psf) ; - pdwvw->b.index = 0 ; - } ; - - return ; -} /* dwvw_encode_store_bits */ - -#if 0 -/* Debigging routine. */ -static void -dump_bits (DWVW_PRIVATE *pdwvw) -{ int k, mask ; - - for (k = 0 ; k < 10 && k < pdwvw->b.index ; k++) - { mask = 0x80 ; - while (mask) - { putchar (mask & pdwvw->b.buffer [k] ? '1' : '0') ; - mask >>= 1 ; - } ; - putchar (' ') ; - } - - for (k = pdwvw->bit_count - 1 ; k >= 0 ; k --) - putchar (pdwvw->bits & (1 << k) ? '1' : '0') ; - - putchar ('\n') ; -} /* dump_bits */ -#endif - -#define HIGHEST_BIT(x, count) \ - { int y = x ; \ - (count) = 0 ; \ - while (y) \ - { (count) ++ ; \ - y >>= 1 ; \ - } ; \ - } ; - -static int -dwvw_encode_data (SF_PRIVATE *psf, DWVW_PRIVATE *pdwvw, const int *ptr, int len) -{ int count ; - int delta_width_modifier, delta, delta_negative, delta_width, extra_bit ; - - for (count = 0 ; count < len ; count++) - { delta = (ptr [count] >> (32 - pdwvw->bit_width)) - pdwvw->last_sample ; - - /* Calculate extra_bit if needed. */ - extra_bit = -1 ; - delta_negative = 0 ; - if (delta < -pdwvw->max_delta) - delta = pdwvw->max_delta + (delta % pdwvw->max_delta) ; - else if (delta == -pdwvw->max_delta) - { extra_bit = 1 ; - delta_negative = 1 ; - delta = pdwvw->max_delta - 1 ; - } - else if (delta > pdwvw->max_delta) - { delta_negative = 1 ; - delta = pdwvw->span - delta ; - delta = abs (delta) ; - } - else if (delta == pdwvw->max_delta) - { extra_bit = 1 ; - delta = pdwvw->max_delta - 1 ; - } - else if (delta < 0) - { delta_negative = 1 ; - delta = abs (delta) ; - } ; - - if (delta == pdwvw->max_delta - 1 && extra_bit == -1) - extra_bit = 0 ; - - /* Find width in bits of delta */ - HIGHEST_BIT (delta, delta_width) ; - - /* Calculate the delta_width_modifier */ - delta_width_modifier = (delta_width - pdwvw->last_delta_width) % pdwvw->bit_width ; - if (delta_width_modifier > pdwvw->dwm_maxsize) - delta_width_modifier -= pdwvw->bit_width ; - if (delta_width_modifier < -pdwvw->dwm_maxsize) - delta_width_modifier += pdwvw->bit_width ; - - /* Write delta_width_modifier zeros, followed by terminating '1'. */ - dwvw_encode_store_bits (psf, pdwvw, 0, abs (delta_width_modifier)) ; - if (abs (delta_width_modifier) != pdwvw->dwm_maxsize) - dwvw_encode_store_bits (psf, pdwvw, 1, 1) ; - - /* Write delta_width_modifier sign. */ - if (delta_width_modifier < 0) - dwvw_encode_store_bits (psf, pdwvw, 1, 1) ; - if (delta_width_modifier > 0) - dwvw_encode_store_bits (psf, pdwvw, 0, 1) ; - - /* Write delta and delta sign bit. */ - if (delta_width) - { dwvw_encode_store_bits (psf, pdwvw, delta, abs (delta_width) - 1) ; - dwvw_encode_store_bits (psf, pdwvw, (delta_negative ? 1 : 0), 1) ; - } ; - - /* Write extra bit!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ - if (extra_bit >= 0) - dwvw_encode_store_bits (psf, pdwvw, extra_bit, 1) ; - - pdwvw->last_sample = ptr [count] >> (32 - pdwvw->bit_width) ; - pdwvw->last_delta_width = delta_width ; - } ; - - pdwvw->samplecount += count ; - - return count ; -} /* dwvw_encode_data */ - -static sf_count_t -dwvw_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ DWVW_PRIVATE *pdwvw ; - BUF_UNION ubuf ; - int *iptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pdwvw = (DWVW_PRIVATE*) psf->codec_data ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - iptr [k] = ptr [total + k] << 16 ; - count = dwvw_encode_data (psf, pdwvw, iptr, writecount) ; - - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* dwvw_write_s */ - -static sf_count_t -dwvw_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ DWVW_PRIVATE *pdwvw ; - int writecount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pdwvw = (DWVW_PRIVATE*) psf->codec_data ; - - while (len > 0) - { writecount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = dwvw_encode_data (psf, pdwvw, ptr, writecount) ; - - total += count ; - len -= count ; - - if (count != writecount) - break ; - } ; - - return total ; -} /* dwvw_write_i */ - -static sf_count_t -dwvw_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ DWVW_PRIVATE *pdwvw ; - BUF_UNION ubuf ; - int *iptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - float normfact ; - - if (! psf->codec_data) - return 0 ; - pdwvw = (DWVW_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? (1.0 * 0x7FFFFFFF) : 1.0 ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - iptr [k] = lrintf (normfact * ptr [total + k]) ; - count = dwvw_encode_data (psf, pdwvw, iptr, writecount) ; - - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* dwvw_write_f */ - -static sf_count_t -dwvw_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ DWVW_PRIVATE *pdwvw ; - BUF_UNION ubuf ; - int *iptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - double normfact ; - - if (! psf->codec_data) - return 0 ; - pdwvw = (DWVW_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_double == SF_TRUE) ? (1.0 * 0x7FFFFFFF) : 1.0 ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - iptr [k] = lrint (normfact * ptr [total + k]) ; - count = dwvw_encode_data (psf, pdwvw, iptr, writecount) ; - - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* dwvw_write_d */ - diff --git a/libs/libsndfile/src/file_io.c b/libs/libsndfile/src/file_io.c deleted file mode 100644 index 26d3d6d6ae..0000000000 --- a/libs/libsndfile/src/file_io.c +++ /dev/null @@ -1,1550 +0,0 @@ -/* -** Copyright (C) 2002-2013 Erik de Castro Lopo -** Copyright (C) 2003 Ross Bencina -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** The file is split into three sections as follows: -** - The top section (USE_WINDOWS_API == 0) for Linux, Unix and MacOSX -** systems (including Cygwin). -** - The middle section (USE_WINDOWS_API == 1) for microsoft windows -** (including MinGW) using the native windows API. -** - A legacy windows section which attempted to work around grevious -** bugs in microsoft's POSIX implementation. -*/ - -/* -** The header file sfconfig.h MUST be included before the others to ensure -** that large file support is enabled correctly on Unix systems. -*/ - -#include "sfconfig.h" - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#include -#include -#include -#include - -#include "sndfile.h" -#include "common.h" - -#define SENSIBLE_SIZE (0x40000000) - -/* -** Neat solution to the Win32/OS2 binary file flage requirement. -** If O_BINARY isn't already defined by the inclusion of the system -** headers, set it to zero. -*/ -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -static void psf_log_syserr (SF_PRIVATE *psf, int error) ; - -#if (USE_WINDOWS_API == 0) - -/*------------------------------------------------------------------------------ -** Win32 stuff at the bottom of the file. Unix and other sensible OSes here. -*/ - -static int psf_close_fd (int fd) ; -static int psf_open_fd (PSF_FILE * pfile) ; -static sf_count_t psf_get_filelen_fd (int fd) ; - -int -psf_fopen (SF_PRIVATE *psf) -{ - psf->error = 0 ; - psf->file.filedes = psf_open_fd (&psf->file) ; - - if (psf->file.filedes == - SFE_BAD_OPEN_MODE) - { psf->error = SFE_BAD_OPEN_MODE ; - psf->file.filedes = -1 ; - return psf->error ; - } ; - - if (psf->file.filedes == -1) - psf_log_syserr (psf, errno) ; - - return psf->error ; -} /* psf_fopen */ - -int -psf_fclose (SF_PRIVATE *psf) -{ int retval ; - - if (psf->virtual_io) - return 0 ; - - if (psf->file.do_not_close_descriptor) - { psf->file.filedes = -1 ; - return 0 ; - } ; - - if ((retval = psf_close_fd (psf->file.filedes)) == -1) - psf_log_syserr (psf, errno) ; - - psf->file.filedes = -1 ; - - return retval ; -} /* psf_fclose */ - -int -psf_open_rsrc (SF_PRIVATE *psf) -{ - if (psf->rsrc.filedes > 0) - return 0 ; - - /* Test for MacOSX style resource fork on HPFS or HPFS+ filesystems. */ - snprintf (psf->rsrc.path.c, sizeof (psf->rsrc.path.c), "%s/..namedfork/rsrc", psf->file.path.c) ; - psf->error = SFE_NO_ERROR ; - if ((psf->rsrc.filedes = psf_open_fd (&psf->rsrc)) >= 0) - { psf->rsrclength = psf_get_filelen_fd (psf->rsrc.filedes) ; - if (psf->rsrclength > 0 || (psf->rsrc.mode & SFM_WRITE)) - return SFE_NO_ERROR ; - psf_close_fd (psf->rsrc.filedes) ; - psf->rsrc.filedes = -1 ; - } ; - - if (psf->rsrc.filedes == - SFE_BAD_OPEN_MODE) - { psf->error = SFE_BAD_OPEN_MODE ; - return psf->error ; - } ; - - /* - ** Now try for a resource fork stored as a separate file in the same - ** directory, but preceded with a dot underscore. - */ - snprintf (psf->rsrc.path.c, sizeof (psf->rsrc.path.c), "%s._%s", psf->file.dir.c, psf->file.name.c) ; - psf->error = SFE_NO_ERROR ; - if ((psf->rsrc.filedes = psf_open_fd (&psf->rsrc)) >= 0) - { psf->rsrclength = psf_get_filelen_fd (psf->rsrc.filedes) ; - return SFE_NO_ERROR ; - } ; - - /* - ** Now try for a resource fork stored in a separate file in the - ** .AppleDouble/ directory. - */ - snprintf (psf->rsrc.path.c, sizeof (psf->rsrc.path.c), "%s.AppleDouble/%s", psf->file.dir.c, psf->file.name.c) ; - psf->error = SFE_NO_ERROR ; - if ((psf->rsrc.filedes = psf_open_fd (&psf->rsrc)) >= 0) - { psf->rsrclength = psf_get_filelen_fd (psf->rsrc.filedes) ; - return SFE_NO_ERROR ; - } ; - - /* No resource file found. */ - if (psf->rsrc.filedes == -1) - psf_log_syserr (psf, errno) ; - - psf->rsrc.filedes = -1 ; - - return psf->error ; -} /* psf_open_rsrc */ - -sf_count_t -psf_get_filelen (SF_PRIVATE *psf) -{ sf_count_t filelen ; - - if (psf->virtual_io) - return psf->vio.get_filelen (psf->vio_user_data) ; - - filelen = psf_get_filelen_fd (psf->file.filedes) ; - - if (filelen == -1) - { psf_log_syserr (psf, errno) ; - return (sf_count_t) -1 ; - } ; - - if (filelen == -SFE_BAD_STAT_SIZE) - { psf->error = SFE_BAD_STAT_SIZE ; - return (sf_count_t) -1 ; - } ; - - switch (psf->file.mode) - { case SFM_WRITE : - filelen = filelen - psf->fileoffset ; - break ; - - case SFM_READ : - if (psf->fileoffset > 0 && psf->filelength > 0) - filelen = psf->filelength ; - break ; - - case SFM_RDWR : - /* - ** Cannot open embedded files SFM_RDWR so we don't need to - ** subtract psf->fileoffset. We already have the answer we - ** need. - */ - break ; - - default : - /* Shouldn't be here, so return error. */ - filelen = -1 ; - } ; - - return filelen ; -} /* psf_get_filelen */ - -int -psf_close_rsrc (SF_PRIVATE *psf) -{ psf_close_fd (psf->rsrc.filedes) ; - psf->rsrc.filedes = -1 ; - return 0 ; -} /* psf_close_rsrc */ - -int -psf_set_stdio (SF_PRIVATE *psf) -{ int error = 0 ; - - switch (psf->file.mode) - { case SFM_RDWR : - error = SFE_OPEN_PIPE_RDWR ; - break ; - - case SFM_READ : - psf->file.filedes = 0 ; - break ; - - case SFM_WRITE : - psf->file.filedes = 1 ; - break ; - - default : - error = SFE_BAD_OPEN_MODE ; - break ; - } ; - psf->filelength = 0 ; - - return error ; -} /* psf_set_stdio */ - -void -psf_set_file (SF_PRIVATE *psf, int fd) -{ psf->file.filedes = fd ; -} /* psf_set_file */ - -int -psf_file_valid (SF_PRIVATE *psf) -{ return (psf->file.filedes >= 0) ? SF_TRUE : SF_FALSE ; -} /* psf_set_file */ - -sf_count_t -psf_fseek (SF_PRIVATE *psf, sf_count_t offset, int whence) -{ sf_count_t current_pos, new_position ; - - if (psf->virtual_io) - return psf->vio.seek (offset, whence, psf->vio_user_data) ; - - current_pos = psf_ftell (psf) ; - - switch (whence) - { case SEEK_SET : - offset += psf->fileoffset ; - break ; - - case SEEK_END : - if (psf->file.mode == SFM_WRITE) - { new_position = lseek (psf->file.filedes, offset, whence) ; - - if (new_position < 0) - psf_log_syserr (psf, errno) ; - - return new_position - psf->fileoffset ; - } ; - - /* Transform SEEK_END into a SEEK_SET, ie find the file - ** length add the requested offset (should be <= 0) to - ** get the offset wrt the start of file. - */ - whence = SEEK_SET ; - offset = lseek (psf->file.filedes, 0, SEEK_END) + offset ; - break ; - - case SEEK_CUR : - /* Translate a SEEK_CUR into a SEEK_SET. */ - offset += current_pos ; - whence = SEEK_SET ; - break ; - - default : - /* We really should not be here. */ - psf_log_printf (psf, "psf_fseek : whence is %d *****.\n", whence) ; - return 0 ; - } ; - - if (current_pos != offset) - new_position = lseek (psf->file.filedes, offset, whence) ; - else - new_position = offset ; - - if (new_position < 0) - psf_log_syserr (psf, errno) ; - - new_position -= psf->fileoffset ; - - return new_position ; -} /* psf_fseek */ - -sf_count_t -psf_fread (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf) -{ sf_count_t total = 0 ; - ssize_t count ; - - if (psf->virtual_io) - return psf->vio.read (ptr, bytes*items, psf->vio_user_data) / bytes ; - - items *= bytes ; - - /* Do this check after the multiplication above. */ - if (items <= 0) - return 0 ; - - while (items > 0) - { /* Break the read down to a sensible size. */ - count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : (ssize_t) items ; - - count = read (psf->file.filedes, ((char*) ptr) + total, (size_t) count) ; - - if (count == -1) - { if (errno == EINTR) - continue ; - - psf_log_syserr (psf, errno) ; - break ; - } ; - - if (count == 0) - break ; - - total += count ; - items -= count ; - } ; - - if (psf->is_pipe) - psf->pipeoffset += total ; - - return total / bytes ; -} /* psf_fread */ - -sf_count_t -psf_fwrite (const void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf) -{ sf_count_t total = 0 ; - ssize_t count ; - - if (psf->virtual_io) - return psf->vio.write (ptr, bytes*items, psf->vio_user_data) / bytes ; - - items *= bytes ; - - /* Do this check after the multiplication above. */ - if (items <= 0) - return 0 ; - - while (items > 0) - { /* Break the writes down to a sensible size. */ - count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : items ; - - count = write (psf->file.filedes, ((const char*) ptr) + total, count) ; - - if (count == -1) - { if (errno == EINTR) - continue ; - - psf_log_syserr (psf, errno) ; - break ; - } ; - - if (count == 0) - break ; - - total += count ; - items -= count ; - } ; - - if (psf->is_pipe) - psf->pipeoffset += total ; - - return total / bytes ; -} /* psf_fwrite */ - -sf_count_t -psf_ftell (SF_PRIVATE *psf) -{ sf_count_t pos ; - - if (psf->virtual_io) - return psf->vio.tell (psf->vio_user_data) ; - - if (psf->is_pipe) - return psf->pipeoffset ; - - pos = lseek (psf->file.filedes, 0, SEEK_CUR) ; - - if (pos == ((sf_count_t) -1)) - { psf_log_syserr (psf, errno) ; - return -1 ; - } ; - - return pos - psf->fileoffset ; -} /* psf_ftell */ - -static int -psf_close_fd (int fd) -{ int retval ; - - if (fd < 0) - return 0 ; - - while ((retval = close (fd)) == -1 && errno == EINTR) - /* Do nothing. */ ; - - return retval ; -} /* psf_close_fd */ - -sf_count_t -psf_fgets (char *buffer, sf_count_t bufsize, SF_PRIVATE *psf) -{ sf_count_t k = 0 ; - sf_count_t count ; - - while (k < bufsize - 1) - { count = read (psf->file.filedes, &(buffer [k]), 1) ; - - if (count == -1) - { if (errno == EINTR) - continue ; - - psf_log_syserr (psf, errno) ; - break ; - } ; - - if (count == 0 || buffer [k++] == '\n') - break ; - } ; - - buffer [k] = 0 ; - - return k ; -} /* psf_fgets */ - -int -psf_is_pipe (SF_PRIVATE *psf) -{ struct stat statbuf ; - - if (psf->virtual_io) - return SF_FALSE ; - - if (fstat (psf->file.filedes, &statbuf) == -1) - { psf_log_syserr (psf, errno) ; - /* Default to maximum safety. */ - return SF_TRUE ; - } ; - - if (S_ISFIFO (statbuf.st_mode) || S_ISSOCK (statbuf.st_mode)) - return SF_TRUE ; - - return SF_FALSE ; -} /* psf_is_pipe */ - -static sf_count_t -psf_get_filelen_fd (int fd) -{ -#if (SIZEOF_OFF_T == 4 && SIZEOF_SF_COUNT_T == 8 && HAVE_FSTAT64) - struct stat64 statbuf ; - - if (fstat64 (fd, &statbuf) == -1) - return (sf_count_t) -1 ; - - return statbuf.st_size ; -#else - struct stat statbuf ; - - if (fstat (fd, &statbuf) == -1) - return (sf_count_t) -1 ; - - return statbuf.st_size ; -#endif -} /* psf_get_filelen_fd */ - -int -psf_ftruncate (SF_PRIVATE *psf, sf_count_t len) -{ int retval ; - - /* Returns 0 on success, non-zero on failure. */ - if (len < 0) - return -1 ; - - if ((sizeof (off_t) < sizeof (sf_count_t)) && len > 0x7FFFFFFF) - return -1 ; - - retval = ftruncate (psf->file.filedes, len) ; - - if (retval == -1) - psf_log_syserr (psf, errno) ; - - return retval ; -} /* psf_ftruncate */ - -void -psf_init_files (SF_PRIVATE *psf) -{ psf->file.filedes = -1 ; - psf->rsrc.filedes = -1 ; - psf->file.savedes = -1 ; -} /* psf_init_files */ - -void -psf_use_rsrc (SF_PRIVATE *psf, int on_off) -{ - if (on_off) - { if (psf->file.filedes != psf->rsrc.filedes) - { psf->file.savedes = psf->file.filedes ; - psf->file.filedes = psf->rsrc.filedes ; - } ; - } - else if (psf->file.filedes == psf->rsrc.filedes) - psf->file.filedes = psf->file.savedes ; - - return ; -} /* psf_use_rsrc */ - -static int -psf_open_fd (PSF_FILE * pfile) -{ int fd, oflag, mode ; - - /* - ** Sanity check. If everything is OK, this test and the printfs will - ** be optimised out. This is meant to catch the problems caused by - ** "sfconfig.h" being included after . - */ - if (sizeof (sf_count_t) != 8) - { puts ("\n\n*** Fatal error : sizeof (sf_count_t) != 8") ; - puts ("*** This means that libsndfile was not configured correctly.\n") ; - exit (1) ; - } ; - - switch (pfile->mode) - { case SFM_READ : - oflag = O_RDONLY | O_BINARY ; - mode = 0 ; - break ; - - case SFM_WRITE : - oflag = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY ; - mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ; - break ; - - case SFM_RDWR : - oflag = O_RDWR | O_CREAT | O_BINARY ; - mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ; - break ; - - default : - return - SFE_BAD_OPEN_MODE ; - break ; - } ; - - if (mode == 0) - fd = open (pfile->path.c, oflag) ; - else - fd = open (pfile->path.c, oflag, mode) ; - - return fd ; -} /* psf_open_fd */ - -static void -psf_log_syserr (SF_PRIVATE *psf, int error) -{ - /* Only log an error if no error has been set yet. */ - if (psf->error == 0) - { psf->error = SFE_SYSTEM ; - snprintf (psf->syserr, sizeof (psf->syserr), "System error : %s.", strerror (error)) ; - } ; - - return ; -} /* psf_log_syserr */ - -void -psf_fsync (SF_PRIVATE *psf) -{ -#if HAVE_FSYNC - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - fsync (psf->file.filedes) ; -#else - psf = NULL ; -#endif -} /* psf_fsync */ - -#elif USE_WINDOWS_API - -/* Win32 file i/o functions implemented using native Win32 API */ - -#include -#include - -static int psf_close_handle (HANDLE handle) ; -static HANDLE psf_open_handle (PSF_FILE * pfile) ; -static sf_count_t psf_get_filelen_handle (HANDLE handle) ; - -/* USE_WINDOWS_API */ int -psf_fopen (SF_PRIVATE *psf) -{ - psf->error = 0 ; - psf->file.handle = psf_open_handle (&psf->file) ; - - if (psf->file.handle == NULL) - psf_log_syserr (psf, GetLastError ()) ; - - return psf->error ; -} /* psf_fopen */ - -/* USE_WINDOWS_API */ int -psf_fclose (SF_PRIVATE *psf) -{ int retval ; - - if (psf->virtual_io) - return 0 ; - - if (psf->file.do_not_close_descriptor) - { psf->file.handle = NULL ; - return 0 ; - } ; - - if ((retval = psf_close_handle (psf->file.handle)) == -1) - psf_log_syserr (psf, GetLastError ()) ; - - psf->file.handle = NULL ; - - return retval ; -} /* psf_fclose */ - -/* USE_WINDOWS_API */ int -psf_open_rsrc (SF_PRIVATE *psf) -{ - if (psf->rsrc.handle != NULL) - return 0 ; - - /* Test for MacOSX style resource fork on HPFS or HPFS+ filesystems. */ - snprintf (psf->rsrc.path.c, sizeof (psf->rsrc.path.c), "%s/rsrc", psf->file.path.c) ; - psf->error = SFE_NO_ERROR ; - if ((psf->rsrc.handle = psf_open_handle (&psf->rsrc)) != NULL) - { psf->rsrclength = psf_get_filelen_handle (psf->rsrc.handle) ; - return SFE_NO_ERROR ; - } ; - - /* - ** Now try for a resource fork stored as a separate file in the same - ** directory, but preceded with a dot underscore. - */ - snprintf (psf->rsrc.path.c, sizeof (psf->rsrc.path.c), "%s._%s", psf->file.dir.c, psf->file.name.c) ; - psf->error = SFE_NO_ERROR ; - if ((psf->rsrc.handle = psf_open_handle (&psf->rsrc)) != NULL) - { psf->rsrclength = psf_get_filelen_handle (psf->rsrc.handle) ; - return SFE_NO_ERROR ; - } ; - - /* - ** Now try for a resource fork stored in a separate file in the - ** .AppleDouble/ directory. - */ - snprintf (psf->rsrc.path.c, sizeof (psf->rsrc.path.c), "%s.AppleDouble/%s", psf->file.dir.c, psf->file.name.c) ; - psf->error = SFE_NO_ERROR ; - if ((psf->rsrc.handle = psf_open_handle (&psf->rsrc)) != NULL) - { psf->rsrclength = psf_get_filelen_handle (psf->rsrc.handle) ; - return SFE_NO_ERROR ; - } ; - - /* No resource file found. */ - if (psf->rsrc.handle == NULL) - psf_log_syserr (psf, GetLastError ()) ; - - psf->rsrc.handle = NULL ; - - return psf->error ; -} /* psf_open_rsrc */ - -/* USE_WINDOWS_API */ sf_count_t -psf_get_filelen (SF_PRIVATE *psf) -{ sf_count_t filelen ; - - if (psf->virtual_io) - return psf->vio.get_filelen (psf->vio_user_data) ; - - filelen = psf_get_filelen_handle (psf->file.handle) ; - - if (filelen == -1) - { psf_log_syserr (psf, errno) ; - return (sf_count_t) -1 ; - } ; - - if (filelen == -SFE_BAD_STAT_SIZE) - { psf->error = SFE_BAD_STAT_SIZE ; - return (sf_count_t) -1 ; - } ; - - switch (psf->file.mode) - { case SFM_WRITE : - filelen = filelen - psf->fileoffset ; - break ; - - case SFM_READ : - if (psf->fileoffset > 0 && psf->filelength > 0) - filelen = psf->filelength ; - break ; - - case SFM_RDWR : - /* - ** Cannot open embedded files SFM_RDWR so we don't need to - ** subtract psf->fileoffset. We already have the answer we - ** need. - */ - break ; - - default : - /* Shouldn't be here, so return error. */ - filelen = -1 ; - } ; - - return filelen ; -} /* psf_get_filelen */ - -/* USE_WINDOWS_API */ void -psf_init_files (SF_PRIVATE *psf) -{ psf->file.handle = NULL ; - psf->rsrc.handle = NULL ; - psf->file.hsaved = NULL ; -} /* psf_init_files */ - -/* USE_WINDOWS_API */ void -psf_use_rsrc (SF_PRIVATE *psf, int on_off) -{ - if (on_off) - { if (psf->file.handle != psf->rsrc.handle) - { psf->file.hsaved = psf->file.handle ; - psf->file.handle = psf->rsrc.handle ; - } ; - } - else if (psf->file.handle == psf->rsrc.handle) - psf->file.handle = psf->file.hsaved ; - - return ; -} /* psf_use_rsrc */ - -/* USE_WINDOWS_API */ static HANDLE -psf_open_handle (PSF_FILE * pfile) -{ DWORD dwDesiredAccess ; - DWORD dwShareMode ; - DWORD dwCreationDistribution ; - HANDLE handle ; - - switch (pfile->mode) - { case SFM_READ : - dwDesiredAccess = GENERIC_READ ; - dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE ; - dwCreationDistribution = OPEN_EXISTING ; - break ; - - case SFM_WRITE : - dwDesiredAccess = GENERIC_WRITE ; - dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE ; - dwCreationDistribution = CREATE_ALWAYS ; - break ; - - case SFM_RDWR : - dwDesiredAccess = GENERIC_READ | GENERIC_WRITE ; - dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE ; - dwCreationDistribution = OPEN_ALWAYS ; - break ; - - default : - return NULL ; - } ; - - if (pfile->use_wchar) - handle = CreateFileW ( - pfile->path.wc, /* pointer to name of the file */ - dwDesiredAccess, /* access (read-write) mode */ - dwShareMode, /* share mode */ - 0, /* pointer to security attributes */ - dwCreationDistribution, /* how to create */ - FILE_ATTRIBUTE_NORMAL, /* file attributes (could use FILE_FLAG_SEQUENTIAL_SCAN) */ - NULL /* handle to file with attributes to copy */ - ) ; - else - handle = CreateFile ( - pfile->path.c, /* pointer to name of the file */ - dwDesiredAccess, /* access (read-write) mode */ - dwShareMode, /* share mode */ - 0, /* pointer to security attributes */ - dwCreationDistribution, /* how to create */ - FILE_ATTRIBUTE_NORMAL, /* file attributes (could use FILE_FLAG_SEQUENTIAL_SCAN) */ - NULL /* handle to file with attributes to copy */ - ) ; - - if (handle == INVALID_HANDLE_VALUE) - return NULL ; - - return handle ; -} /* psf_open_handle */ - -/* USE_WINDOWS_API */ static void -psf_log_syserr (SF_PRIVATE *psf, int error) -{ LPVOID lpMsgBuf ; - - /* Only log an error if no error has been set yet. */ - if (psf->error == 0) - { psf->error = SFE_SYSTEM ; - - FormatMessage ( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - error, - MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, - 0, - NULL - ) ; - - snprintf (psf->syserr, sizeof (psf->syserr), "System error : %s", (char*) lpMsgBuf) ; - LocalFree (lpMsgBuf) ; - } ; - - return ; -} /* psf_log_syserr */ - - -/* USE_WINDOWS_API */ int -psf_close_rsrc (SF_PRIVATE *psf) -{ psf_close_handle (psf->rsrc.handle) ; - psf->rsrc.handle = NULL ; - return 0 ; -} /* psf_close_rsrc */ - - -/* USE_WINDOWS_API */ int -psf_set_stdio (SF_PRIVATE *psf) -{ HANDLE handle = NULL ; - int error = 0 ; - - switch (psf->file.mode) - { case SFM_RDWR : - error = SFE_OPEN_PIPE_RDWR ; - break ; - - case SFM_READ : - handle = GetStdHandle (STD_INPUT_HANDLE) ; - psf->file.do_not_close_descriptor = 1 ; - break ; - - case SFM_WRITE : - handle = GetStdHandle (STD_OUTPUT_HANDLE) ; - psf->file.do_not_close_descriptor = 1 ; - break ; - - default : - error = SFE_BAD_OPEN_MODE ; - break ; - } ; - - psf->file.handle = handle ; - psf->filelength = 0 ; - - return error ; -} /* psf_set_stdio */ - -/* USE_WINDOWS_API */ void -psf_set_file (SF_PRIVATE *psf, int fd) -{ HANDLE handle ; - intptr_t osfhandle ; - - osfhandle = _get_osfhandle (fd) ; - handle = (HANDLE) osfhandle ; - - psf->file.handle = handle ; -} /* psf_set_file */ - -/* USE_WINDOWS_API */ int -psf_file_valid (SF_PRIVATE *psf) -{ if (psf->file.handle == NULL) - return SF_FALSE ; - if (psf->file.handle == INVALID_HANDLE_VALUE) - return SF_FALSE ; - return SF_TRUE ; -} /* psf_set_file */ - -/* USE_WINDOWS_API */ sf_count_t -psf_fseek (SF_PRIVATE *psf, sf_count_t offset, int whence) -{ sf_count_t new_position ; - LONG lDistanceToMove, lDistanceToMoveHigh ; - DWORD dwMoveMethod ; - DWORD dwResult, dwError ; - - if (psf->virtual_io) - return psf->vio.seek (offset, whence, psf->vio_user_data) ; - - switch (whence) - { case SEEK_SET : - offset += psf->fileoffset ; - dwMoveMethod = FILE_BEGIN ; - break ; - - case SEEK_END : - dwMoveMethod = FILE_END ; - break ; - - default : - dwMoveMethod = FILE_CURRENT ; - break ; - } ; - - lDistanceToMove = (DWORD) (offset & 0xFFFFFFFF) ; - lDistanceToMoveHigh = (DWORD) ((offset >> 32) & 0xFFFFFFFF) ; - - dwResult = SetFilePointer (psf->file.handle, lDistanceToMove, &lDistanceToMoveHigh, dwMoveMethod) ; - - if (dwResult == 0xFFFFFFFF) - dwError = GetLastError () ; - else - dwError = NO_ERROR ; - - if (dwError != NO_ERROR) - { psf_log_syserr (psf, dwError) ; - return -1 ; - } ; - - new_position = (dwResult + ((__int64) lDistanceToMoveHigh << 32)) - psf->fileoffset ; - - return new_position ; -} /* psf_fseek */ - -/* USE_WINDOWS_API */ sf_count_t -psf_fread (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf) -{ sf_count_t total = 0 ; - ssize_t count ; - DWORD dwNumberOfBytesRead ; - - if (psf->virtual_io) - return psf->vio.read (ptr, bytes*items, psf->vio_user_data) / bytes ; - - items *= bytes ; - - /* Do this check after the multiplication above. */ - if (items <= 0) - return 0 ; - - while (items > 0) - { /* Break the writes down to a sensible size. */ - count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : (ssize_t) items ; - - if (ReadFile (psf->file.handle, ((char*) ptr) + total, count, &dwNumberOfBytesRead, 0) == 0) - { psf_log_syserr (psf, GetLastError ()) ; - break ; - } - else - count = dwNumberOfBytesRead ; - - if (count == 0) - break ; - - total += count ; - items -= count ; - } ; - - if (psf->is_pipe) - psf->pipeoffset += total ; - - return total / bytes ; -} /* psf_fread */ - -/* USE_WINDOWS_API */ sf_count_t -psf_fwrite (const void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf) -{ sf_count_t total = 0 ; - ssize_t count ; - DWORD dwNumberOfBytesWritten ; - - if (psf->virtual_io) - return psf->vio.write (ptr, bytes * items, psf->vio_user_data) / bytes ; - - items *= bytes ; - - /* Do this check after the multiplication above. */ - if (items <= 0) - return 0 ; - - while (items > 0) - { /* Break the writes down to a sensible size. */ - count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : (ssize_t) items ; - - if (WriteFile (psf->file.handle, ((const char*) ptr) + total, count, &dwNumberOfBytesWritten, 0) == 0) - { psf_log_syserr (psf, GetLastError ()) ; - break ; - } - else - count = dwNumberOfBytesWritten ; - - if (count == 0) - break ; - - total += count ; - items -= count ; - } ; - - if (psf->is_pipe) - psf->pipeoffset += total ; - - return total / bytes ; -} /* psf_fwrite */ - -/* USE_WINDOWS_API */ sf_count_t -psf_ftell (SF_PRIVATE *psf) -{ sf_count_t pos ; - LONG lDistanceToMoveLow, lDistanceToMoveHigh ; - DWORD dwResult, dwError ; - - if (psf->virtual_io) - return psf->vio.tell (psf->vio_user_data) ; - - if (psf->is_pipe) - return psf->pipeoffset ; - - lDistanceToMoveLow = 0 ; - lDistanceToMoveHigh = 0 ; - - dwResult = SetFilePointer (psf->file.handle, lDistanceToMoveLow, &lDistanceToMoveHigh, FILE_CURRENT) ; - - if (dwResult == 0xFFFFFFFF) - dwError = GetLastError () ; - else - dwError = NO_ERROR ; - - if (dwError != NO_ERROR) - { psf_log_syserr (psf, dwError) ; - return -1 ; - } ; - - pos = (dwResult + ((__int64) lDistanceToMoveHigh << 32)) ; - - return pos - psf->fileoffset ; -} /* psf_ftell */ - -/* USE_WINDOWS_API */ static int -psf_close_handle (HANDLE handle) -{ if (handle == NULL) - return 0 ; - - if (CloseHandle (handle) == 0) - return -1 ; - - return 0 ; -} /* psf_close_handle */ - -/* USE_WINDOWS_API */ sf_count_t -psf_fgets (char *buffer, sf_count_t bufsize, SF_PRIVATE *psf) -{ sf_count_t k = 0 ; - sf_count_t count ; - DWORD dwNumberOfBytesRead ; - - while (k < bufsize - 1) - { if (ReadFile (psf->file.handle, &(buffer [k]), 1, &dwNumberOfBytesRead, 0) == 0) - { psf_log_syserr (psf, GetLastError ()) ; - break ; - } - else - { count = dwNumberOfBytesRead ; - /* note that we only check for '\n' not other line endings such as CRLF */ - if (count == 0 || buffer [k++] == '\n') - break ; - } ; - } ; - - buffer [k] = 0 ; - - return k ; -} /* psf_fgets */ - -/* USE_WINDOWS_API */ int -psf_is_pipe (SF_PRIVATE *psf) -{ - if (psf->virtual_io) - return SF_FALSE ; - - if (GetFileType (psf->file.handle) == FILE_TYPE_DISK) - return SF_FALSE ; - - /* Default to maximum safety. */ - return SF_TRUE ; -} /* psf_is_pipe */ - -/* USE_WINDOWS_API */ sf_count_t -psf_get_filelen_handle (HANDLE handle) -{ sf_count_t filelen ; - DWORD dwFileSizeLow, dwFileSizeHigh, dwError = NO_ERROR ; - - dwFileSizeLow = GetFileSize (handle, &dwFileSizeHigh) ; - - if (dwFileSizeLow == 0xFFFFFFFF) - dwError = GetLastError () ; - - if (dwError != NO_ERROR) - return (sf_count_t) -1 ; - - filelen = dwFileSizeLow + ((__int64) dwFileSizeHigh << 32) ; - - return filelen ; -} /* psf_get_filelen_handle */ - -/* USE_WINDOWS_API */ void -psf_fsync (SF_PRIVATE *psf) -{ FlushFileBuffers (psf->file.handle) ; -} /* psf_fsync */ - - -/* USE_WINDOWS_API */ int -psf_ftruncate (SF_PRIVATE *psf, sf_count_t len) -{ int retval = 0 ; - LONG lDistanceToMoveLow, lDistanceToMoveHigh ; - DWORD dwResult, dwError = NO_ERROR ; - - /* This implementation trashes the current file position. - ** should it save and restore it? what if the current position is past - ** the new end of file? - */ - - /* Returns 0 on success, non-zero on failure. */ - if (len < 0) - return 1 ; - - lDistanceToMoveLow = (DWORD) (len & 0xFFFFFFFF) ; - lDistanceToMoveHigh = (DWORD) ((len >> 32) & 0xFFFFFFFF) ; - - dwResult = SetFilePointer (psf->file.handle, lDistanceToMoveLow, &lDistanceToMoveHigh, FILE_BEGIN) ; - - if (dwResult == 0xFFFFFFFF) - dwError = GetLastError () ; - - if (dwError != NO_ERROR) - { retval = -1 ; - psf_log_syserr (psf, dwError) ; - } - else - { /* Note: when SetEndOfFile is used to extend a file, the contents of the - ** new portion of the file is undefined. This is unlike chsize(), - ** which guarantees that the new portion of the file will be zeroed. - ** Not sure if this is important or not. - */ - if (SetEndOfFile (psf->file.handle) == 0) - { retval = -1 ; - psf_log_syserr (psf, GetLastError ()) ; - } ; - } ; - - return retval ; -} /* psf_ftruncate */ - - -#else -/* Win32 file i/o functions implemented using Unix-style file i/o API */ - -/* Win32 has a 64 file offset seek function: -** -** __int64 _lseeki64 (int handle, __int64 offset, int origin) ; -** -** It also has a 64 bit fstat function: -** -** int fstati64 (int, struct _stati64) ; -** -** but the fscking thing doesn't work!!!!! The file size parameter returned -** by this function is only valid up until more data is written at the end of -** the file. That makes this function completely 100% useless. -*/ - -#include -#include - -/* Win32 */ int -psf_fopen (SF_PRIVATE *psf, const char *pathname, int open_mode) -{ int oflag, mode ; - - switch (open_mode) - { case SFM_READ : - oflag = O_RDONLY | O_BINARY ; - mode = 0 ; - break ; - - case SFM_WRITE : - oflag = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY ; - mode = S_IRUSR | S_IWUSR | S_IRGRP ; - break ; - - case SFM_RDWR : - oflag = O_RDWR | O_CREAT | O_BINARY ; - mode = S_IRUSR | S_IWUSR | S_IRGRP ; - break ; - - default : - psf->error = SFE_BAD_OPEN_MODE ; - return -1 ; - break ; - } ; - - if (mode == 0) - psf->file.filedes = open (pathname, oflag) ; - else - psf->file.filedes = open (pathname, oflag, mode) ; - - if (psf->file.filedes == -1) - psf_log_syserr (psf, errno) ; - - return psf->file.filedes ; -} /* psf_fopen */ - -/* Win32 */ sf_count_t -psf_fseek (SF_PRIVATE *psf, sf_count_t offset, int whence) -{ sf_count_t new_position ; - - if (psf->virtual_io) - return psf->vio.seek (offset, whence, psf->vio_user_data) ; - - switch (whence) - { case SEEK_SET : - offset += psf->fileoffset ; - break ; - - case SEEK_END : - if (psf->file.mode == SFM_WRITE) - { new_position = _lseeki64 (psf->file.filedes, offset, whence) ; - - if (new_position < 0) - psf_log_syserr (psf, errno) ; - - return new_position - psf->fileoffset ; - } ; - - /* Transform SEEK_END into a SEEK_SET, ie find the file - ** length add the requested offset (should be <= 0) to - ** get the offset wrt the start of file. - */ - whence = SEEK_SET ; - offset = _lseeki64 (psf->file.filedes, 0, SEEK_END) + offset ; - break ; - - default : - /* No need to do anything about SEEK_CUR. */ - break ; - } ; - - /* - ** Bypass weird Win32-ism if necessary. - ** _lseeki64() returns an "invalid parameter" error if called with the - ** offset == 0 and whence == SEEK_CUR. - *** Use the _telli64() function instead. - */ - if (offset == 0 && whence == SEEK_CUR) - new_position = _telli64 (psf->file.filedes) ; - else - new_position = _lseeki64 (psf->file.filedes, offset, whence) ; - - if (new_position < 0) - psf_log_syserr (psf, errno) ; - - new_position -= psf->fileoffset ; - - return new_position ; -} /* psf_fseek */ - -/* Win32 */ sf_count_t -psf_fread (void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf) -{ sf_count_t total = 0 ; - ssize_t count ; - - if (psf->virtual_io) - return psf->vio.read (ptr, bytes*items, psf->vio_user_data) / bytes ; - - items *= bytes ; - - /* Do this check after the multiplication above. */ - if (items <= 0) - return 0 ; - - while (items > 0) - { /* Break the writes down to a sensible size. */ - count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : (ssize_t) items ; - - count = read (psf->file.filedes, ((char*) ptr) + total, (size_t) count) ; - - if (count == -1) - { if (errno == EINTR) - continue ; - - psf_log_syserr (psf, errno) ; - break ; - } ; - - if (count == 0) - break ; - - total += count ; - items -= count ; - } ; - - return total / bytes ; -} /* psf_fread */ - -/* Win32 */ sf_count_t -psf_fwrite (const void *ptr, sf_count_t bytes, sf_count_t items, SF_PRIVATE *psf) -{ sf_count_t total = 0 ; - ssize_t count ; - - if (psf->virtual_io) - return psf->vio.write (ptr, bytes*items, psf->vio_user_data) / bytes ; - - items *= bytes ; - - /* Do this check after the multiplication above. */ - if (items <= 0) - return 0 ; - - while (items > 0) - { /* Break the writes down to a sensible size. */ - count = (items > SENSIBLE_SIZE) ? SENSIBLE_SIZE : items ; - - count = write (psf->file.filedes, ((const char*) ptr) + total, count) ; - - if (count == -1) - { if (errno == EINTR) - continue ; - - psf_log_syserr (psf, errno) ; - break ; - } ; - - if (count == 0) - break ; - - total += count ; - items -= count ; - } ; - - return total / bytes ; -} /* psf_fwrite */ - -/* Win32 */ sf_count_t -psf_ftell (SF_PRIVATE *psf) -{ sf_count_t pos ; - - if (psf->virtual_io) - return psf->vio.tell (psf->vio_user_data) ; - - pos = _telli64 (psf->file.filedes) ; - - if (pos == ((sf_count_t) -1)) - { psf_log_syserr (psf, errno) ; - return -1 ; - } ; - - return pos - psf->fileoffset ; -} /* psf_ftell */ - -/* Win32 */ int -psf_fclose (SF_PRIVATE *psf) -{ int retval ; - - while ((retval = close (psf->file.filedes)) == -1 && errno == EINTR) - /* Do nothing. */ ; - - if (retval == -1) - psf_log_syserr (psf, errno) ; - - psf->file.filedes = -1 ; - - return retval ; -} /* psf_fclose */ - -/* Win32 */ sf_count_t -psf_fgets (char *buffer, sf_count_t bufsize, SF_PRIVATE *psf) -{ sf_count_t k = 0 ; - sf_count_t count ; - - while (k < bufsize - 1) - { count = read (psf->file.filedes, &(buffer [k]), 1) ; - - if (count == -1) - { if (errno == EINTR) - continue ; - - psf_log_syserr (psf, errno) ; - break ; - } ; - - if (count == 0 || buffer [k++] == '\n') - break ; - } ; - - buffer [k] = 0 ; - - return k ; -} /* psf_fgets */ - -/* Win32 */ int -psf_is_pipe (SF_PRIVATE *psf) -{ struct stat statbuf ; - - if (psf->virtual_io) - return SF_FALSE ; - - /* Not sure if this works. */ - if (fstat (psf->file.filedes, &statbuf) == -1) - { psf_log_syserr (psf, errno) ; - /* Default to maximum safety. */ - return SF_TRUE ; - } ; - - /* These macros are defined in Win32/unistd.h. */ - if (S_ISFIFO (statbuf.st_mode) || S_ISSOCK (statbuf.st_mode)) - return SF_TRUE ; - - return SF_FALSE ; -} /* psf_checkpipe */ - -/* Win32 */ sf_count_t -psf_get_filelen (SF_PRIVATE *psf) -{ -#if 0 - /* - ** Windoze is SOOOOO FUCKED!!!!!!! - ** This code should work but doesn't. Why? - ** Code below does work. - */ - struct _stati64 statbuf ; - - if (_fstati64 (psf->file.filedes, &statbuf)) - { psf_log_syserr (psf, errno) ; - return (sf_count_t) -1 ; - } ; - - return statbuf.st_size ; -#else - sf_count_t current, filelen ; - - if (psf->virtual_io) - return psf->vio.get_filelen (psf->vio_user_data) ; - - if ((current = _telli64 (psf->file.filedes)) < 0) - { psf_log_syserr (psf, errno) ; - return (sf_count_t) -1 ; - } ; - - /* - ** Lets face it, windoze if FUBAR!!! - ** - ** For some reason, I have to call _lseeki64() TWICE to get to the - ** end of the file. - ** - ** This might have been avoided if windows had implemented the POSIX - ** standard function fsync() but NO, that would have been too easy. - ** - ** I am VERY close to saying that windoze will no longer be supported - ** by libsndfile and changing the license to GPL at the same time. - */ - - _lseeki64 (psf->file.filedes, 0, SEEK_END) ; - - if ((filelen = _lseeki64 (psf->file.filedes, 0, SEEK_END)) < 0) - { psf_log_syserr (psf, errno) ; - return (sf_count_t) -1 ; - } ; - - if (filelen > current) - _lseeki64 (psf->file.filedes, current, SEEK_SET) ; - - switch (psf->file.mode) - { case SFM_WRITE : - filelen = filelen - psf->fileoffset ; - break ; - - case SFM_READ : - if (psf->fileoffset > 0 && psf->filelength > 0) - filelen = psf->filelength ; - break ; - - case SFM_RDWR : - /* - ** Cannot open embedded files SFM_RDWR so we don't need to - ** subtract psf->fileoffset. We already have the answer we - ** need. - */ - break ; - - default : - filelen = 0 ; - } ; - - return filelen ; -#endif -} /* psf_get_filelen */ - -/* Win32 */ int -psf_ftruncate (SF_PRIVATE *psf, sf_count_t len) -{ int retval ; - - /* Returns 0 on success, non-zero on failure. */ - if (len < 0) - return 1 ; - - /* The global village idiots at micorsoft decided to implement - ** nearly all the required 64 bit file offset functions except - ** for one, truncate. The fscking morons! - ** - ** This is not 64 bit file offset clean. Somone needs to clean - ** this up. - */ - if (len > 0x7FFFFFFF) - return -1 ; - - retval = chsize (psf->file.filedes, len) ; - - if (retval == -1) - psf_log_syserr (psf, errno) ; - - return retval ; -} /* psf_ftruncate */ - - -static void -psf_log_syserr (SF_PRIVATE *psf, int error) -{ - /* Only log an error if no error has been set yet. */ - if (psf->error == 0) - { psf->error = SFE_SYSTEM ; - snprintf (psf->syserr, sizeof (psf->syserr), "System error : %s", strerror (error)) ; - } ; - - return ; -} /* psf_log_syserr */ - -#endif - diff --git a/libs/libsndfile/src/flac.c b/libs/libsndfile/src/flac.c deleted file mode 100644 index bb74e94bc0..0000000000 --- a/libs/libsndfile/src/flac.c +++ /dev/null @@ -1,1385 +0,0 @@ -/* -** Copyright (C) 2004-2013 Erik de Castro Lopo -** Copyright (C) 2004 Tobias Gehrig -** -** This program is free software ; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation ; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program ; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#include "sndfile.h" -#include "common.h" - -#if HAVE_EXTERNAL_LIBS - -#include -#include -#include - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -#define FLAC_DEFAULT_COMPRESSION_LEVEL 5 - -#define ENC_BUFFER_SIZE 8192 - -typedef enum -{ PFLAC_PCM_SHORT = 50, - PFLAC_PCM_INT = 51, - PFLAC_PCM_FLOAT = 52, - PFLAC_PCM_DOUBLE = 53 -} PFLAC_PCM ; - -typedef struct -{ - FLAC__StreamDecoder *fsd ; - FLAC__StreamEncoder *fse ; - - PFLAC_PCM pcmtype ; - void* ptr ; - unsigned pos, len, remain ; - - FLAC__StreamMetadata *metadata ; - - const FLAC__int32 * const * wbuffer ; - FLAC__int32 * rbuffer [FLAC__MAX_CHANNELS] ; - - FLAC__int32* encbuffer ; - unsigned bufferpos ; - - const FLAC__Frame *frame ; - FLAC__bool bufferbackup ; - - unsigned compression ; -} FLAC_PRIVATE ; - -typedef struct -{ const char *tag ; - int type ; -} FLAC_TAG ; - -static sf_count_t flac_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; -static int flac_byterate (SF_PRIVATE *psf) ; -static int flac_close (SF_PRIVATE *psf) ; - -static int flac_enc_init (SF_PRIVATE *psf) ; -static int flac_read_header (SF_PRIVATE *psf) ; - -static sf_count_t flac_read_flac2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t flac_read_flac2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t flac_read_flac2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t flac_read_flac2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t flac_write_s2flac (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t flac_write_i2flac (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t flac_write_f2flac (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t flac_write_d2flac (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static void f2flac8_array (const float *src, FLAC__int32 *dest, int count, int normalize) ; -static void f2flac16_array (const float *src, FLAC__int32 *dest, int count, int normalize) ; -static void f2flac24_array (const float *src, FLAC__int32 *dest, int count, int normalize) ; -static void f2flac8_clip_array (const float *src, FLAC__int32 *dest, int count, int normalize) ; -static void f2flac16_clip_array (const float *src, FLAC__int32 *dest, int count, int normalize) ; -static void f2flac24_clip_array (const float *src, FLAC__int32 *dest, int count, int normalize) ; -static void d2flac8_array (const double *src, FLAC__int32 *dest, int count, int normalize) ; -static void d2flac16_array (const double *src, FLAC__int32 *dest, int count, int normalize) ; -static void d2flac24_array (const double *src, FLAC__int32 *dest, int count, int normalize) ; -static void d2flac8_clip_array (const double *src, FLAC__int32 *dest, int count, int normalize) ; -static void d2flac16_clip_array (const double *src, FLAC__int32 *dest, int count, int normalize) ; -static void d2flac24_clip_array (const double *src, FLAC__int32 *dest, int count, int normalize) ; - -static int flac_command (SF_PRIVATE *psf, int command, void *data, int datasize) ; - -/* Decoder Callbacks */ -static FLAC__StreamDecoderReadStatus sf_flac_read_callback (const FLAC__StreamDecoder *decoder, FLAC__byte buffer [], size_t *bytes, void *client_data) ; -static FLAC__StreamDecoderSeekStatus sf_flac_seek_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) ; -static FLAC__StreamDecoderTellStatus sf_flac_tell_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ; -static FLAC__StreamDecoderLengthStatus sf_flac_length_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) ; -static FLAC__bool sf_flac_eof_callback (const FLAC__StreamDecoder *decoder, void *client_data) ; -static FLAC__StreamDecoderWriteStatus sf_flac_write_callback (const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) ; -static void sf_flac_meta_callback (const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) ; -static void sf_flac_error_callback (const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) ; - -/* Encoder Callbacks */ -static FLAC__StreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) ; -static FLAC__StreamEncoderTellStatus sf_flac_enc_tell_callback (const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ; -static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const FLAC__StreamEncoder *encoder, const FLAC__byte buffer [], size_t bytes, unsigned samples, unsigned current_frame, void *client_data) ; - -static void -s2flac8_array (const short *src, FLAC__int32 *dest, int count) -{ while (--count >= 0) - dest [count] = src [count] >> 8 ; -} /* s2flac8_array */ - -static void -s2flac16_array (const short *src, FLAC__int32 *dest, int count) -{ while (--count >= 0) - dest [count] = src [count] ; -} /* s2flac16_array */ - -static void -s2flac24_array (const short *src, FLAC__int32 *dest, int count) -{ while (--count >= 0) - dest [count] = src [count] << 8 ; -} /* s2flac24_array */ - -static void -i2flac8_array (const int *src, FLAC__int32 *dest, int count) -{ while (--count >= 0) - dest [count] = src [count] >> 24 ; -} /* i2flac8_array */ - -static void -i2flac16_array (const int *src, FLAC__int32 *dest, int count) -{ - while (--count >= 0) - dest [count] = src [count] >> 16 ; -} /* i2flac16_array */ - -static void -i2flac24_array (const int *src, FLAC__int32 *dest, int count) -{ while (--count >= 0) - dest [count] = src [count] >> 8 ; -} /* i2flac24_array */ - -static sf_count_t -flac_buffer_copy (SF_PRIVATE *psf) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - const FLAC__Frame *frame = pflac->frame ; - const FLAC__int32* const *buffer = pflac->wbuffer ; - unsigned i = 0, j, offset ; - - /* - ** frame->header.blocksize is variable and we're using a constant blocksize - ** of FLAC__MAX_BLOCK_SIZE. - ** Check our assumptions here. - */ - if (frame->header.blocksize > FLAC__MAX_BLOCK_SIZE) - { psf_log_printf (psf, "Ooops : frame->header.blocksize (%d) > FLAC__MAX_BLOCK_SIZE (%d)\n", __func__, __LINE__, frame->header.blocksize, FLAC__MAX_BLOCK_SIZE) ; - psf->error = SFE_INTERNAL ; - return 0 ; - } ; - - if (pflac->ptr == NULL) - { /* - ** Not sure why this code is here and not elsewhere. - ** Removing it causes valgrind errors. - */ - pflac->bufferbackup = SF_TRUE ; - for (i = 0 ; i < frame->header.channels ; i++) - { - if (pflac->rbuffer [i] == NULL) - pflac->rbuffer [i] = calloc (FLAC__MAX_BLOCK_SIZE, sizeof (FLAC__int32)) ; - - memcpy (pflac->rbuffer [i], buffer [i], frame->header.blocksize * sizeof (FLAC__int32)) ; - } ; - pflac->wbuffer = (const FLAC__int32* const*) pflac->rbuffer ; - - return 0 ; - } ; - - switch (pflac->pcmtype) - { case PFLAC_PCM_SHORT : - { short *retpcm = (short*) pflac->ptr ; - int shift = 16 - frame->header.bits_per_sample ; - if (shift < 0) - { shift = abs (shift) ; - for (i = 0 ; i < frame->header.blocksize && pflac->remain > 0 ; i++) - { offset = pflac->pos + i * frame->header.channels ; - - if (pflac->bufferpos >= frame->header.blocksize) - break ; - - for (j = 0 ; j < frame->header.channels ; j++) - retpcm [offset + j] = buffer [j][pflac->bufferpos] >> shift ; - pflac->remain -= frame->header.channels ; - pflac->bufferpos++ ; - } - } - else - { for (i = 0 ; i < frame->header.blocksize && pflac->remain > 0 ; i++) - { offset = pflac->pos + i * frame->header.channels ; - - if (pflac->bufferpos >= frame->header.blocksize) - break ; - - for (j = 0 ; j < frame->header.channels ; j++) - retpcm [offset + j] = (buffer [j][pflac->bufferpos]) << shift ; - - pflac->remain -= frame->header.channels ; - pflac->bufferpos++ ; - } ; - } ; - } ; - break ; - - case PFLAC_PCM_INT : - { int *retpcm = (int*) pflac->ptr ; - int shift = 32 - frame->header.bits_per_sample ; - for (i = 0 ; i < frame->header.blocksize && pflac->remain > 0 ; i++) - { offset = pflac->pos + i * frame->header.channels ; - - if (pflac->bufferpos >= frame->header.blocksize) - break ; - - for (j = 0 ; j < frame->header.channels ; j++) - retpcm [offset + j] = buffer [j][pflac->bufferpos] << shift ; - pflac->remain -= frame->header.channels ; - pflac->bufferpos++ ; - } ; - } ; - break ; - - case PFLAC_PCM_FLOAT : - { float *retpcm = (float*) pflac->ptr ; - float norm = (psf->norm_float == SF_TRUE) ? 1.0 / (1 << (frame->header.bits_per_sample - 1)) : 1.0 ; - - for (i = 0 ; i < frame->header.blocksize && pflac->remain > 0 ; i++) - { offset = pflac->pos + i * frame->header.channels ; - - if (pflac->bufferpos >= frame->header.blocksize) - break ; - - for (j = 0 ; j < frame->header.channels ; j++) - retpcm [offset + j] = buffer [j][pflac->bufferpos] * norm ; - pflac->remain -= frame->header.channels ; - pflac->bufferpos++ ; - } ; - } ; - break ; - - case PFLAC_PCM_DOUBLE : - { double *retpcm = (double*) pflac->ptr ; - double norm = (psf->norm_double == SF_TRUE) ? 1.0 / (1 << (frame->header.bits_per_sample - 1)) : 1.0 ; - - for (i = 0 ; i < frame->header.blocksize && pflac->remain > 0 ; i++) - { offset = pflac->pos + i * frame->header.channels ; - - if (pflac->bufferpos >= frame->header.blocksize) - break ; - - for (j = 0 ; j < frame->header.channels ; j++) - retpcm [offset + j] = buffer [j][pflac->bufferpos] * norm ; - pflac->remain -= frame->header.channels ; - pflac->bufferpos++ ; - } ; - } ; - break ; - - default : - return 0 ; - } ; - - offset = i * frame->header.channels ; - pflac->pos += i * frame->header.channels ; - - return offset ; -} /* flac_buffer_copy */ - - -static FLAC__StreamDecoderReadStatus -sf_flac_read_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__byte buffer [], size_t *bytes, void *client_data) -{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; - - *bytes = psf_fread (buffer, 1, *bytes, psf) ; - if (*bytes > 0 && psf->error == 0) - return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE ; - - return FLAC__STREAM_DECODER_READ_STATUS_ABORT ; -} /* sf_flac_read_callback */ - -static FLAC__StreamDecoderSeekStatus -sf_flac_seek_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 absolute_byte_offset, void *client_data) -{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; - - psf_fseek (psf, absolute_byte_offset, SEEK_SET) ; - if (psf->error) - return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR ; - - return FLAC__STREAM_DECODER_SEEK_STATUS_OK ; -} /* sf_flac_seek_callback */ - -static FLAC__StreamDecoderTellStatus -sf_flac_tell_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 *absolute_byte_offset, void *client_data) -{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; - - *absolute_byte_offset = psf_ftell (psf) ; - if (psf->error) - return FLAC__STREAM_DECODER_TELL_STATUS_ERROR ; - - return FLAC__STREAM_DECODER_TELL_STATUS_OK ; -} /* sf_flac_tell_callback */ - -static FLAC__StreamDecoderLengthStatus -sf_flac_length_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 *stream_length, void *client_data) -{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; - - if ((*stream_length = psf->filelength) == 0) - return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR ; - - return FLAC__STREAM_DECODER_LENGTH_STATUS_OK ; -} /* sf_flac_length_callback */ - -static FLAC__bool -sf_flac_eof_callback (const FLAC__StreamDecoder *UNUSED (decoder), void *client_data) -{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; - - if (psf_ftell (psf) == psf->filelength) - return SF_TRUE ; - - return SF_FALSE ; -} /* sf_flac_eof_callback */ - -static FLAC__StreamDecoderWriteStatus -sf_flac_write_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) -{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; - FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - - pflac->frame = frame ; - pflac->bufferpos = 0 ; - - pflac->bufferbackup = SF_FALSE ; - pflac->wbuffer = buffer ; - - flac_buffer_copy (psf) ; - - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE ; -} /* sf_flac_write_callback */ - -static void -sf_flac_meta_get_vorbiscomments (SF_PRIVATE *psf, const FLAC__StreamMetadata *metadata) -{ FLAC_TAG tags [] = - { { "title", SF_STR_TITLE }, - { "copyright", SF_STR_COPYRIGHT }, - { "software", SF_STR_SOFTWARE }, - { "artist", SF_STR_ARTIST }, - { "comment", SF_STR_COMMENT }, - { "date", SF_STR_DATE }, - { "album", SF_STR_ALBUM }, - { "license", SF_STR_LICENSE }, - { "tracknumber", SF_STR_TRACKNUMBER }, - { "genre", SF_STR_GENRE } - } ; - - const char *value, *cptr ; - int k, tag_num ; - - for (k = 0 ; k < ARRAY_LEN (tags) ; k++) - { tag_num = FLAC__metadata_object_vorbiscomment_find_entry_from (metadata, 0, tags [k].tag) ; - - if (tag_num < 0) - continue ; - - value = (const char*) metadata->data.vorbis_comment.comments [tag_num].entry ; - if ((cptr = strchr (value, '=')) != NULL) - value = cptr + 1 ; - - psf_log_printf (psf, " %-10s : %s\n", tags [k].tag, value) ; - psf_store_string (psf, tags [k].type, value) ; - } ; - - return ; -} /* sf_flac_meta_get_vorbiscomments */ - -static void -sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data) -{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; - int bitwidth = 0 ; - - switch (metadata->type) - { case FLAC__METADATA_TYPE_STREAMINFO : - psf->sf.channels = metadata->data.stream_info.channels ; - psf->sf.samplerate = metadata->data.stream_info.sample_rate ; - psf->sf.frames = metadata->data.stream_info.total_samples ; - - psf_log_printf (psf, "FLAC Stream Metadata\n Channels : %d\n Sample rate : %d\n", psf->sf.channels, psf->sf.samplerate) ; - - if (psf->sf.frames == 0) - { psf_log_printf (psf, " Frames : 0 (bumping to SF_COUNT_MAX)\n") ; - psf->sf.frames = SF_COUNT_MAX ; - } - else - psf_log_printf (psf, " Frames : %D\n", psf->sf.frames) ; - - switch (metadata->data.stream_info.bits_per_sample) - { case 8 : - psf->sf.format |= SF_FORMAT_PCM_S8 ; - bitwidth = 8 ; - break ; - case 16 : - psf->sf.format |= SF_FORMAT_PCM_16 ; - bitwidth = 16 ; - break ; - case 24 : - psf->sf.format |= SF_FORMAT_PCM_24 ; - bitwidth = 24 ; - break ; - default : - psf_log_printf (psf, "sf_flac_meta_callback : bits_per_sample %d not yet implemented.\n", metadata->data.stream_info.bits_per_sample) ; - break ; - } ; - - if (bitwidth > 0) - psf_log_printf (psf, " Bit width : %d\n", bitwidth) ; - break ; - - case FLAC__METADATA_TYPE_VORBIS_COMMENT : - psf_log_printf (psf, "Vorbis Comment Metadata\n") ; - sf_flac_meta_get_vorbiscomments (psf, metadata) ; - break ; - - case FLAC__METADATA_TYPE_PADDING : - psf_log_printf (psf, "Padding Metadata\n") ; - break ; - - case FLAC__METADATA_TYPE_APPLICATION : - psf_log_printf (psf, "Application Metadata\n") ; - break ; - - case FLAC__METADATA_TYPE_SEEKTABLE : - psf_log_printf (psf, "Seektable Metadata\n") ; - break ; - - case FLAC__METADATA_TYPE_CUESHEET : - psf_log_printf (psf, "Cuesheet Metadata\n") ; - break ; - - case FLAC__METADATA_TYPE_PICTURE : - psf_log_printf (psf, "Picture Metadata\n") ; - break ; - - case FLAC__METADATA_TYPE_UNDEFINED : - psf_log_printf (psf, "Undefined Metadata\n") ; - break ; - - default : - psf_log_printf (psf, "sf_flac_meta_callback : metadata-type %d not yet implemented.\n", metadata->type) ; - break ; - } ; - - return ; -} /* sf_flac_meta_callback */ - -static void -sf_flac_error_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__StreamDecoderErrorStatus status, void *client_data) -{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; - - psf_log_printf (psf, "ERROR : %s\n", FLAC__StreamDecoderErrorStatusString [status]) ; - - switch (status) - { case FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC : - psf->error = SFE_FLAC_LOST_SYNC ; - break ; - case FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER : - psf->error = SFE_FLAC_BAD_HEADER ; - break ; - default : - psf->error = SFE_FLAC_UNKOWN_ERROR ; - break ; - } ; - - return ; -} /* sf_flac_error_callback */ - -static FLAC__StreamEncoderSeekStatus -sf_flac_enc_seek_callback (const FLAC__StreamEncoder * UNUSED (encoder), FLAC__uint64 absolute_byte_offset, void *client_data) -{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; - - psf_fseek (psf, absolute_byte_offset, SEEK_SET) ; - if (psf->error) - return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR ; - - return FLAC__STREAM_ENCODER_SEEK_STATUS_OK ; -} /* sf_flac_enc_seek_callback */ - -static FLAC__StreamEncoderTellStatus -sf_flac_enc_tell_callback (const FLAC__StreamEncoder *UNUSED (encoder), FLAC__uint64 *absolute_byte_offset, void *client_data) -{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; - - *absolute_byte_offset = psf_ftell (psf) ; - if (psf->error) - return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR ; - - return FLAC__STREAM_ENCODER_TELL_STATUS_OK ; -} /* sf_flac_enc_tell_callback */ - -static FLAC__StreamEncoderWriteStatus -sf_flac_enc_write_callback (const FLAC__StreamEncoder * UNUSED (encoder), const FLAC__byte buffer [], size_t bytes, unsigned UNUSED (samples), unsigned UNUSED (current_frame), void *client_data) -{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; - - if (psf_fwrite (buffer, 1, bytes, psf) == (sf_count_t) bytes && psf->error == 0) - return FLAC__STREAM_ENCODER_WRITE_STATUS_OK ; - - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR ; -} /* sf_flac_enc_write_callback */ - -static void -flac_write_strings (SF_PRIVATE *psf, FLAC_PRIVATE* pflac) -{ FLAC__StreamMetadata_VorbisComment_Entry entry ; - int k, string_count = 0 ; - - for (k = 0 ; k < SF_MAX_STRINGS ; k++) - { if (psf->strings.data [k].type != 0) - string_count ++ ; - } ; - - if (string_count == 0) - return ; - - if (pflac->metadata == NULL && (pflac->metadata = FLAC__metadata_object_new (FLAC__METADATA_TYPE_VORBIS_COMMENT)) == NULL) - { psf_log_printf (psf, "FLAC__metadata_object_new returned NULL\n") ; - return ; - } ; - - for (k = 0 ; k < SF_MAX_STRINGS && psf->strings.data [k].type != 0 ; k++) - { const char * key, * value ; - - switch (psf->strings.data [k].type) - { case SF_STR_SOFTWARE : - key = "software" ; - break ; - case SF_STR_TITLE : - key = "title" ; - break ; - case SF_STR_COPYRIGHT : - key = "copyright" ; - break ; - case SF_STR_ARTIST : - key = "artist" ; - break ; - case SF_STR_COMMENT : - key = "comment" ; - break ; - case SF_STR_DATE : - key = "date" ; - break ; - case SF_STR_ALBUM : - key = "album" ; - break ; - case SF_STR_LICENSE : - key = "license" ; - break ; - case SF_STR_TRACKNUMBER : - key = "tracknumber" ; - break ; - case SF_STR_GENRE : - key = "genre" ; - break ; - default : - continue ; - } ; - - value = psf->strings.storage + psf->strings.data [k].offset ; - - FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair (&entry, key, value) ; - FLAC__metadata_object_vorbiscomment_append_comment (pflac->metadata, entry, /* copy */ SF_FALSE) ; - } ; - - if (! FLAC__stream_encoder_set_metadata (pflac->fse, &pflac->metadata, 1)) - { printf ("%s %d : fail\n", __func__, __LINE__) ; - return ; - } ; - - return ; -} /* flac_write_strings */ - -static int -flac_write_header (SF_PRIVATE *psf, int UNUSED (calc_length)) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - int err ; - - flac_write_strings (psf, pflac) ; - - if ((err = FLAC__stream_encoder_init_stream (pflac->fse, sf_flac_enc_write_callback, sf_flac_enc_seek_callback, sf_flac_enc_tell_callback, NULL, psf)) != FLAC__STREAM_DECODER_INIT_STATUS_OK) - { psf_log_printf (psf, "Error : FLAC encoder init returned error : %s\n", FLAC__StreamEncoderInitStatusString [err]) ; - return SFE_FLAC_INIT_DECODER ; - } ; - - if (psf->error == 0) - psf->dataoffset = psf_ftell (psf) ; - pflac->encbuffer = calloc (ENC_BUFFER_SIZE, sizeof (FLAC__int32)) ; - - return psf->error ; -} /* flac_write_header */ - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -flac_open (SF_PRIVATE *psf) -{ int subformat ; - int error = 0 ; - - FLAC_PRIVATE* pflac = calloc (1, sizeof (FLAC_PRIVATE)) ; - psf->codec_data = pflac ; - - /* Set the default value here. Over-ridden later if necessary. */ - pflac->compression = FLAC_DEFAULT_COMPRESSION_LEVEL ; - - - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - if (psf->file.mode == SFM_READ) - { if ((error = flac_read_header (psf))) - return error ; - } ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE) - { if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_FLAC) - return SFE_BAD_OPEN_FORMAT ; - - psf->endian = SF_ENDIAN_BIG ; - psf->sf.seekable = 0 ; - - psf->strings.flags = SF_STR_ALLOW_START ; - - if ((error = flac_enc_init (psf))) - return error ; - - psf->write_header = flac_write_header ; - } ; - - psf->datalength = psf->filelength ; - psf->dataoffset = 0 ; - - psf->container_close = flac_close ; - psf->seek = flac_seek ; - psf->byterate = flac_byterate ; - - psf->command = flac_command ; - - switch (subformat) - { case SF_FORMAT_PCM_S8 : /* 8-bit FLAC. */ - case SF_FORMAT_PCM_16 : /* 16-bit FLAC. */ - case SF_FORMAT_PCM_24 : /* 24-bit FLAC. */ - error = flac_init (psf) ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - return error ; -} /* flac_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -flac_close (SF_PRIVATE *psf) -{ FLAC_PRIVATE* pflac ; - int k ; - - if ((pflac = (FLAC_PRIVATE*) psf->codec_data) == NULL) - return 0 ; - - if (pflac->metadata != NULL) - FLAC__metadata_object_delete (pflac->metadata) ; - - if (psf->file.mode == SFM_WRITE) - { FLAC__stream_encoder_finish (pflac->fse) ; - FLAC__stream_encoder_delete (pflac->fse) ; - - if (pflac->encbuffer) - free (pflac->encbuffer) ; - } ; - - if (psf->file.mode == SFM_READ) - { FLAC__stream_decoder_finish (pflac->fsd) ; - FLAC__stream_decoder_delete (pflac->fsd) ; - } ; - - for (k = 0 ; k < ARRAY_LEN (pflac->rbuffer) ; k++) - free (pflac->rbuffer [k]) ; - - free (pflac) ; - psf->codec_data = NULL ; - - return 0 ; -} /* flac_close */ - -static int -flac_enc_init (SF_PRIVATE *psf) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - unsigned bps ; - - /* To cite the flac FAQ at - ** http://flac.sourceforge.net/faq.html#general__samples - ** "FLAC supports linear sample rates from 1Hz - 655350Hz in 1Hz - ** increments." - */ - if (psf->sf.samplerate < 1 || psf->sf.samplerate > 655350) - { psf_log_printf (psf, "flac sample rate out of range.\n", psf->sf.samplerate) ; - return SFE_FLAC_BAD_SAMPLE_RATE ; - } ; - - psf_fseek (psf, 0, SEEK_SET) ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - bps = 8 ; - break ; - case SF_FORMAT_PCM_16 : - bps = 16 ; - break ; - case SF_FORMAT_PCM_24 : - bps = 24 ; - break ; - - default : - bps = 0 ; - break ; - } ; - - if (pflac->fse) - FLAC__stream_encoder_delete (pflac->fse) ; - if ((pflac->fse = FLAC__stream_encoder_new ()) == NULL) - return SFE_FLAC_NEW_DECODER ; - - if (! FLAC__stream_encoder_set_channels (pflac->fse, psf->sf.channels)) - { psf_log_printf (psf, "FLAC__stream_encoder_set_channels (%d) return false.\n", psf->sf.channels) ; - return SFE_FLAC_INIT_DECODER ; - } ; - - if (! FLAC__stream_encoder_set_sample_rate (pflac->fse, psf->sf.samplerate)) - { psf_log_printf (psf, "FLAC__stream_encoder_set_sample_rate (%d) returned false.\n", psf->sf.samplerate) ; - return SFE_FLAC_BAD_SAMPLE_RATE ; - } ; - - if (! FLAC__stream_encoder_set_bits_per_sample (pflac->fse, bps)) - { psf_log_printf (psf, "FLAC__stream_encoder_set_bits_per_sample (%d) return false.\n", bps) ; - return SFE_FLAC_INIT_DECODER ; - } ; - - if (! FLAC__stream_encoder_set_compression_level (pflac->fse, pflac->compression)) - { psf_log_printf (psf, "FLAC__stream_encoder_set_compression_level (%d) return false.\n", pflac->compression) ; - return SFE_FLAC_INIT_DECODER ; - } ; - - return 0 ; -} /* flac_enc_init */ - -static int -flac_read_header (SF_PRIVATE *psf) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - - psf_fseek (psf, 0, SEEK_SET) ; - if (pflac->fsd) - FLAC__stream_decoder_delete (pflac->fsd) ; - if ((pflac->fsd = FLAC__stream_decoder_new ()) == NULL) - return SFE_FLAC_NEW_DECODER ; - - FLAC__stream_decoder_set_metadata_respond_all (pflac->fsd) ; - - if (FLAC__stream_decoder_init_stream (pflac->fsd, sf_flac_read_callback, sf_flac_seek_callback, sf_flac_tell_callback, sf_flac_length_callback, sf_flac_eof_callback, sf_flac_write_callback, sf_flac_meta_callback, sf_flac_error_callback, psf) != FLAC__STREAM_DECODER_INIT_STATUS_OK) - return SFE_FLAC_INIT_DECODER ; - - FLAC__stream_decoder_process_until_end_of_metadata (pflac->fsd) ; - - psf_log_printf (psf, "End\n") ; - - if (psf->error == 0) - { FLAC__uint64 position ; - - FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ; - psf->dataoffset = position ; - } ; - - return psf->error ; -} /* flac_read_header */ - -static int -flac_command (SF_PRIVATE * psf, int command, void * data, int datasize) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - double quality ; - - switch (command) - { case SFC_SET_COMPRESSION_LEVEL : - if (data == NULL || datasize != sizeof (double)) - return SF_FALSE ; - - if (psf->have_written) - return SF_FALSE ; - - /* FLAC compression level is in the range [0, 8] while libsndfile takes - ** values in the range [0.0, 1.0]. Massage the libsndfile value here. - */ - quality = (*((double *) data)) * 8.0 ; - /* Clip range. */ - pflac->compression = lrint (SF_MAX (0.0, SF_MIN (8.0, quality))) ; - - psf_log_printf (psf, "%s : Setting SFC_SET_COMPRESSION_LEVEL to %u.\n", __func__, pflac->compression) ; - - if (flac_enc_init (psf)) - return SF_FALSE ; - - return SF_TRUE ; - - default : - return SF_FALSE ; - } ; - - return SF_FALSE ; -} /* flac_command */ - -int -flac_init (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - if (psf->file.mode == SFM_READ) - { psf->read_short = flac_read_flac2s ; - psf->read_int = flac_read_flac2i ; - psf->read_float = flac_read_flac2f ; - psf->read_double = flac_read_flac2d ; - } ; - - if (psf->file.mode == SFM_WRITE) - { psf->write_short = flac_write_s2flac ; - psf->write_int = flac_write_i2flac ; - psf->write_float = flac_write_f2flac ; - psf->write_double = flac_write_d2flac ; - } ; - - if (psf->filelength > psf->dataoffset) - psf->datalength = (psf->dataend) ? psf->dataend - psf->dataoffset : psf->filelength - psf->dataoffset ; - else - psf->datalength = 0 ; - - return 0 ; -} /* flac_init */ - -static unsigned -flac_read_loop (SF_PRIVATE *psf, unsigned len) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - - pflac->pos = 0 ; - pflac->len = len ; - pflac->remain = len ; - if (pflac->frame != NULL && pflac->bufferpos < pflac->frame->header.blocksize) - flac_buffer_copy (psf) ; - - while (pflac->pos < pflac->len) - { if (FLAC__stream_decoder_process_single (pflac->fsd) == 0) - break ; - if (FLAC__stream_decoder_get_state (pflac->fsd) >= FLAC__STREAM_DECODER_END_OF_STREAM) - break ; - } ; - - pflac->ptr = NULL ; - - return pflac->pos ; -} /* flac_read_loop */ - -static sf_count_t -flac_read_flac2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - sf_count_t total = 0, current ; - unsigned readlen ; - - pflac->pcmtype = PFLAC_PCM_SHORT ; - - while (total < len) - { pflac->ptr = ptr + total ; - readlen = (len - total > 0x1000000) ? 0x1000000 : (unsigned) (len - total) ; - current = flac_read_loop (psf, readlen) ; - if (current == 0) - break ; - total += current ; - } ; - - return total ; -} /* flac_read_flac2s */ - -static sf_count_t -flac_read_flac2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - sf_count_t total = 0, current ; - unsigned readlen ; - - pflac->pcmtype = PFLAC_PCM_INT ; - - while (total < len) - { pflac->ptr = ptr + total ; - readlen = (len - total > 0x1000000) ? 0x1000000 : (unsigned) (len - total) ; - current = flac_read_loop (psf, readlen) ; - if (current == 0) - break ; - total += current ; - } ; - - return total ; -} /* flac_read_flac2i */ - -static sf_count_t -flac_read_flac2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - sf_count_t total = 0, current ; - unsigned readlen ; - - pflac->pcmtype = PFLAC_PCM_FLOAT ; - - while (total < len) - { pflac->ptr = ptr + total ; - readlen = (len - total > 0x1000000) ? 0x1000000 : (unsigned) (len - total) ; - current = flac_read_loop (psf, readlen) ; - if (current == 0) - break ; - total += current ; - } ; - - return total ; -} /* flac_read_flac2f */ - -static sf_count_t -flac_read_flac2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - sf_count_t total = 0, current ; - unsigned readlen ; - - pflac->pcmtype = PFLAC_PCM_DOUBLE ; - - while (total < len) - { pflac->ptr = ptr + total ; - readlen = (len - total > 0x1000000) ? 0x1000000 : (unsigned) (len - total) ; - current = flac_read_loop (psf, readlen) ; - if (current == 0) - break ; - total += current ; - } ; - - return total ; -} /* flac_read_flac2d */ - -static sf_count_t -flac_write_s2flac (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - void (*convert) (const short *, FLAC__int32 *, int) ; - int bufferlen, writecount, thiswrite ; - sf_count_t total = 0 ; - FLAC__int32* buffer = pflac->encbuffer ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - convert = s2flac8_array ; - break ; - case SF_FORMAT_PCM_16 : - convert = s2flac16_array ; - break ; - case SF_FORMAT_PCM_24 : - convert = s2flac24_array ; - break ; - default : - return -1 ; - } ; - - bufferlen = ENC_BUFFER_SIZE / (sizeof (FLAC__int32) * psf->sf.channels) ; - bufferlen *= psf->sf.channels ; - - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - convert (ptr + total, buffer, writecount) ; - if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount / psf->sf.channels)) - thiswrite = writecount ; - else - break ; - total += thiswrite ; - if (thiswrite < writecount) - break ; - - len -= thiswrite ; - } ; - - return total ; -} /* flac_write_s2flac */ - -static sf_count_t -flac_write_i2flac (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - void (*convert) (const int *, FLAC__int32 *, int) ; - int bufferlen, writecount, thiswrite ; - sf_count_t total = 0 ; - FLAC__int32* buffer = pflac->encbuffer ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - convert = i2flac8_array ; - break ; - case SF_FORMAT_PCM_16 : - convert = i2flac16_array ; - break ; - case SF_FORMAT_PCM_24 : - convert = i2flac24_array ; - break ; - default : - return -1 ; - } ; - - bufferlen = ENC_BUFFER_SIZE / (sizeof (FLAC__int32) * psf->sf.channels) ; - bufferlen *= psf->sf.channels ; - - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - convert (ptr + total, buffer, writecount) ; - if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount / psf->sf.channels)) - thiswrite = writecount ; - else - break ; - total += thiswrite ; - if (thiswrite < writecount) - break ; - - len -= thiswrite ; - } ; - - return total ; -} /* flac_write_i2flac */ - -static sf_count_t -flac_write_f2flac (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - void (*convert) (const float *, FLAC__int32 *, int, int) ; - int bufferlen, writecount, thiswrite ; - sf_count_t total = 0 ; - FLAC__int32* buffer = pflac->encbuffer ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - convert = (psf->add_clipping) ? f2flac8_clip_array : f2flac8_array ; - break ; - case SF_FORMAT_PCM_16 : - convert = (psf->add_clipping) ? f2flac16_clip_array : f2flac16_array ; - break ; - case SF_FORMAT_PCM_24 : - convert = (psf->add_clipping) ? f2flac24_clip_array : f2flac24_array ; - break ; - default : - return -1 ; - } ; - - bufferlen = ENC_BUFFER_SIZE / (sizeof (FLAC__int32) * psf->sf.channels) ; - bufferlen *= psf->sf.channels ; - - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - convert (ptr + total, buffer, writecount, psf->norm_float) ; - if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount / psf->sf.channels)) - thiswrite = writecount ; - else - break ; - total += thiswrite ; - if (thiswrite < writecount) - break ; - - len -= thiswrite ; - } ; - - return total ; -} /* flac_write_f2flac */ - -static void -f2flac8_clip_array (const float *src, FLAC__int32 *dest, int count, int normalize) -{ float normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10) : 1.0 ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7F)) - { dest [count] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10)) - { dest [count] = 0x80 ; - continue ; - } ; - dest [count] = lrintf (scaled_value) ; - } ; - - return ; -} /* f2flac8_clip_array */ - -static void -f2flac16_clip_array (const float *src, FLAC__int32 *dest, int count, int normalize) -{ float normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x1000) : 1.0 ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFF)) - { dest [count] = 0x7FFF ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x1000)) - { dest [count] = 0x8000 ; - continue ; - } ; - dest [count] = lrintf (scaled_value) ; - } ; -} /* f2flac16_clip_array */ - -static void -f2flac24_clip_array (const float *src, FLAC__int32 *dest, int count, int normalize) -{ float normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x100000) : 1.0 ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFF)) - { dest [count] = 0x7FFFFF ; - continue ; - } ; - - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x100000)) - { dest [count] = 0x800000 ; - continue ; - } - dest [count] = lrintf (scaled_value) ; - } ; - - return ; -} /* f2flac24_clip_array */ - -static void -f2flac8_array (const float *src, FLAC__int32 *dest, int count, int normalize) -{ float normfact = normalize ? (1.0 * 0x7F) : 1.0 ; - - while (--count >= 0) - dest [count] = lrintf (src [count] * normfact) ; -} /* f2flac8_array */ - -static void -f2flac16_array (const float *src, FLAC__int32 *dest, int count, int normalize) -{ float normfact = normalize ? (1.0 * 0x7FFF) : 1.0 ; - - while (--count >= 0) - dest [count] = lrintf (src [count] * normfact) ; -} /* f2flac16_array */ - -static void -f2flac24_array (const float *src, FLAC__int32 *dest, int count, int normalize) -{ float normfact = normalize ? (1.0 * 0x7FFFFF) : 1.0 ; - - while (--count >= 0) - dest [count] = lrintf (src [count] * normfact) ; -} /* f2flac24_array */ - -static sf_count_t -flac_write_d2flac (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - void (*convert) (const double *, FLAC__int32 *, int, int) ; - int bufferlen, writecount, thiswrite ; - sf_count_t total = 0 ; - FLAC__int32* buffer = pflac->encbuffer ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - convert = (psf->add_clipping) ? d2flac8_clip_array : d2flac8_array ; - break ; - case SF_FORMAT_PCM_16 : - convert = (psf->add_clipping) ? d2flac16_clip_array : d2flac16_array ; - break ; - case SF_FORMAT_PCM_24 : - convert = (psf->add_clipping) ? d2flac24_clip_array : d2flac24_array ; - break ; - default : - return -1 ; - } ; - - bufferlen = ENC_BUFFER_SIZE / (sizeof (FLAC__int32) * psf->sf.channels) ; - bufferlen *= psf->sf.channels ; - - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - convert (ptr + total, buffer, writecount, psf->norm_double) ; - if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount / psf->sf.channels)) - thiswrite = writecount ; - else - break ; - total += thiswrite ; - if (thiswrite < writecount) - break ; - - len -= thiswrite ; - } ; - - return total ; -} /* flac_write_d2flac */ - -static void -d2flac8_clip_array (const double *src, FLAC__int32 *dest, int count, int normalize) -{ double normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10) : 1.0 ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7F)) - { dest [count] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10)) - { dest [count] = 0x80 ; - continue ; - } ; - dest [count] = lrint (scaled_value) ; - } ; - - return ; -} /* d2flac8_clip_array */ - -static void -d2flac16_clip_array (const double *src, FLAC__int32 *dest, int count, int normalize) -{ double normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x1000) : 1.0 ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFF)) - { dest [count] = 0x7FFF ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x1000)) - { dest [count] = 0x8000 ; - continue ; - } ; - dest [count] = lrint (scaled_value) ; - } ; - - return ; -} /* d2flac16_clip_array */ - -static void -d2flac24_clip_array (const double *src, FLAC__int32 *dest, int count, int normalize) -{ double normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x100000) : 1.0 ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFF)) - { dest [count] = 0x7FFFFF ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x100000)) - { dest [count] = 0x800000 ; - continue ; - } ; - dest [count] = lrint (scaled_value) ; - } ; - - return ; -} /* d2flac24_clip_array */ - -static void -d2flac8_array (const double *src, FLAC__int32 *dest, int count, int normalize) -{ double normfact = normalize ? (1.0 * 0x7F) : 1.0 ; - - while (--count >= 0) - dest [count] = lrint (src [count] * normfact) ; -} /* d2flac8_array */ - -static void -d2flac16_array (const double *src, FLAC__int32 *dest, int count, int normalize) -{ double normfact = normalize ? (1.0 * 0x7FFF) : 1.0 ; - - while (--count >= 0) - dest [count] = lrint (src [count] * normfact) ; -} /* d2flac16_array */ - -static void -d2flac24_array (const double *src, FLAC__int32 *dest, int count, int normalize) -{ double normfact = normalize ? (1.0 * 0x7FFFFF) : 1.0 ; - - while (--count >= 0) - dest [count] = lrint (src [count] * normfact) ; -} /* d2flac24_array */ - -static sf_count_t -flac_seek (SF_PRIVATE *psf, int UNUSED (mode), sf_count_t offset) -{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; - - if (pflac == NULL) - return 0 ; - - if (psf->dataoffset < 0) - { psf->error = SFE_BAD_SEEK ; - return ((sf_count_t) -1) ; - } ; - - pflac->frame = NULL ; - - if (psf->file.mode == SFM_READ) - { FLAC__uint64 position ; - - if (FLAC__stream_decoder_seek_absolute (pflac->fsd, offset)) - { FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ; - return offset ; - } ; - - if (offset == psf->sf.frames) - { /* - ** If we've been asked to seek to the very end of the file, libFLAC - ** will return an error. However, we know the length of the file so - ** instead of returning an error, we can return the offset. - */ - return offset ; - } ; - - psf->error = SFE_BAD_SEEK ; - return ((sf_count_t) -1) ; - } ; - - /* Seeking in write mode not yet supported. */ - psf->error = SFE_BAD_SEEK ; - - return ((sf_count_t) -1) ; -} /* flac_seek */ - -static int -flac_byterate (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_READ) - return (psf->datalength * psf->sf.samplerate) / psf->sf.frames ; - - return -1 ; -} /* flac_byterate */ - - -#else /* HAVE_EXTERNAL_LIBS */ - -int -flac_open (SF_PRIVATE *psf) -{ - psf_log_printf (psf, "This version of libsndfile was compiled without FLAC support.\n") ; - return SFE_UNIMPLEMENTED ; -} /* flac_open */ - -#endif diff --git a/libs/libsndfile/src/float32.c b/libs/libsndfile/src/float32.c deleted file mode 100644 index 89bcf6b754..0000000000 --- a/libs/libsndfile/src/float32.c +++ /dev/null @@ -1,1012 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if CPU_IS_LITTLE_ENDIAN - #define FLOAT32_READ float32_le_read - #define FLOAT32_WRITE float32_le_write -#elif CPU_IS_BIG_ENDIAN - #define FLOAT32_READ float32_be_read - #define FLOAT32_WRITE float32_be_write -#endif - -/*-------------------------------------------------------------------------------------------- -** Processor floating point capabilities. float32_get_capability () returns one of the -** latter four values. -*/ - -enum -{ FLOAT_UNKNOWN = 0x00, - FLOAT_CAN_RW_LE = 0x12, - FLOAT_CAN_RW_BE = 0x23, - FLOAT_BROKEN_LE = 0x34, - FLOAT_BROKEN_BE = 0x45 -} ; - -/*-------------------------------------------------------------------------------------------- -** Prototypes for private functions. -*/ - -static sf_count_t host_read_f2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t host_read_f2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t host_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t host_read_f2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t host_write_s2f (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t host_write_i2f (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t host_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t host_write_d2f (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static void float32_peak_update (SF_PRIVATE *psf, const float *buffer, int count, sf_count_t indx) ; - -static sf_count_t replace_read_f2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t replace_read_f2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t replace_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t replace_read_f2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t replace_write_s2f (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t replace_write_i2f (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t replace_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t replace_write_d2f (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static void bf2f_array (float *buffer, int count) ; -static void f2bf_array (float *buffer, int count) ; - -static int float32_get_capability (SF_PRIVATE *psf) ; - -/*-------------------------------------------------------------------------------------------- -** Exported functions. -*/ - -int -float32_init (SF_PRIVATE *psf) -{ static int float_caps ; - - float_caps = float32_get_capability (psf) ; - - psf->blockwidth = sizeof (float) * psf->sf.channels ; - - if (psf->file.mode == SFM_READ || psf->file.mode == SFM_RDWR) - { switch (psf->endian + float_caps) - { case (SF_ENDIAN_BIG + FLOAT_CAN_RW_BE) : - psf->data_endswap = SF_FALSE ; - psf->read_short = host_read_f2s ; - psf->read_int = host_read_f2i ; - psf->read_float = host_read_f ; - psf->read_double = host_read_f2d ; - break ; - - case (SF_ENDIAN_LITTLE + FLOAT_CAN_RW_LE) : - psf->data_endswap = SF_FALSE ; - psf->read_short = host_read_f2s ; - psf->read_int = host_read_f2i ; - psf->read_float = host_read_f ; - psf->read_double = host_read_f2d ; - break ; - - case (SF_ENDIAN_BIG + FLOAT_CAN_RW_LE) : - psf->data_endswap = SF_TRUE ; - psf->read_short = host_read_f2s ; - psf->read_int = host_read_f2i ; - psf->read_float = host_read_f ; - psf->read_double = host_read_f2d ; - break ; - - case (SF_ENDIAN_LITTLE + FLOAT_CAN_RW_BE) : - psf->data_endswap = SF_TRUE ; - psf->read_short = host_read_f2s ; - psf->read_int = host_read_f2i ; - psf->read_float = host_read_f ; - psf->read_double = host_read_f2d ; - break ; - - /* When the CPU is not IEEE compatible. */ - case (SF_ENDIAN_BIG + FLOAT_BROKEN_LE) : - psf->data_endswap = SF_TRUE ; - psf->read_short = replace_read_f2s ; - psf->read_int = replace_read_f2i ; - psf->read_float = replace_read_f ; - psf->read_double = replace_read_f2d ; - break ; - - case (SF_ENDIAN_LITTLE + FLOAT_BROKEN_LE) : - psf->data_endswap = SF_FALSE ; - psf->read_short = replace_read_f2s ; - psf->read_int = replace_read_f2i ; - psf->read_float = replace_read_f ; - psf->read_double = replace_read_f2d ; - break ; - - case (SF_ENDIAN_BIG + FLOAT_BROKEN_BE) : - psf->data_endswap = SF_FALSE ; - psf->read_short = replace_read_f2s ; - psf->read_int = replace_read_f2i ; - psf->read_float = replace_read_f ; - psf->read_double = replace_read_f2d ; - break ; - - case (SF_ENDIAN_LITTLE + FLOAT_BROKEN_BE) : - psf->data_endswap = SF_TRUE ; - psf->read_short = replace_read_f2s ; - psf->read_int = replace_read_f2i ; - psf->read_float = replace_read_f ; - psf->read_double = replace_read_f2d ; - break ; - - default : break ; - } ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { switch (psf->endian + float_caps) - { case (SF_ENDIAN_LITTLE + FLOAT_CAN_RW_LE) : - psf->data_endswap = SF_FALSE ; - psf->write_short = host_write_s2f ; - psf->write_int = host_write_i2f ; - psf->write_float = host_write_f ; - psf->write_double = host_write_d2f ; - break ; - - case (SF_ENDIAN_BIG + FLOAT_CAN_RW_BE) : - psf->data_endswap = SF_FALSE ; - psf->write_short = host_write_s2f ; - psf->write_int = host_write_i2f ; - psf->write_float = host_write_f ; - psf->write_double = host_write_d2f ; - break ; - - case (SF_ENDIAN_BIG + FLOAT_CAN_RW_LE) : - psf->data_endswap = SF_TRUE ; - psf->write_short = host_write_s2f ; - psf->write_int = host_write_i2f ; - psf->write_float = host_write_f ; - psf->write_double = host_write_d2f ; - break ; - - case (SF_ENDIAN_LITTLE + FLOAT_CAN_RW_BE) : - psf->data_endswap = SF_TRUE ; - psf->write_short = host_write_s2f ; - psf->write_int = host_write_i2f ; - psf->write_float = host_write_f ; - psf->write_double = host_write_d2f ; - break ; - - /* When the CPU is not IEEE compatible. */ - case (SF_ENDIAN_BIG + FLOAT_BROKEN_LE) : - psf->data_endswap = SF_TRUE ; - psf->write_short = replace_write_s2f ; - psf->write_int = replace_write_i2f ; - psf->write_float = replace_write_f ; - psf->write_double = replace_write_d2f ; - break ; - - case (SF_ENDIAN_LITTLE + FLOAT_BROKEN_LE) : - psf->data_endswap = SF_FALSE ; - psf->write_short = replace_write_s2f ; - psf->write_int = replace_write_i2f ; - psf->write_float = replace_write_f ; - psf->write_double = replace_write_d2f ; - break ; - - case (SF_ENDIAN_BIG + FLOAT_BROKEN_BE) : - psf->data_endswap = SF_FALSE ; - psf->write_short = replace_write_s2f ; - psf->write_int = replace_write_i2f ; - psf->write_float = replace_write_f ; - psf->write_double = replace_write_d2f ; - break ; - - case (SF_ENDIAN_LITTLE + FLOAT_BROKEN_BE) : - psf->data_endswap = SF_TRUE ; - psf->write_short = replace_write_s2f ; - psf->write_int = replace_write_i2f ; - psf->write_float = replace_write_f ; - psf->write_double = replace_write_d2f ; - break ; - - default : break ; - } ; - } ; - - if (psf->filelength > psf->dataoffset) - { psf->datalength = (psf->dataend > 0) ? psf->dataend - psf->dataoffset : - psf->filelength - psf->dataoffset ; - } - else - psf->datalength = 0 ; - - psf->sf.frames = psf->blockwidth > 0 ? psf->datalength / psf->blockwidth : 0 ; - - return 0 ; -} /* float32_init */ - -float -float32_be_read (const unsigned char *cptr) -{ int exponent, mantissa, negative ; - float fvalue ; - - negative = cptr [0] & 0x80 ; - exponent = ((cptr [0] & 0x7F) << 1) | ((cptr [1] & 0x80) ? 1 : 0) ; - mantissa = ((cptr [1] & 0x7F) << 16) | (cptr [2] << 8) | (cptr [3]) ; - - if (! (exponent || mantissa)) - return 0.0 ; - - mantissa |= 0x800000 ; - exponent = exponent ? exponent - 127 : 0 ; - - fvalue = mantissa ? ((float) mantissa) / ((float) 0x800000) : 0.0 ; - - if (negative) - fvalue *= -1 ; - - if (exponent > 0) - fvalue *= pow (2.0, exponent) ; - else if (exponent < 0) - fvalue /= pow (2.0, abs (exponent)) ; - - return fvalue ; -} /* float32_be_read */ - -float -float32_le_read (const unsigned char *cptr) -{ int exponent, mantissa, negative ; - float fvalue ; - - negative = cptr [3] & 0x80 ; - exponent = ((cptr [3] & 0x7F) << 1) | ((cptr [2] & 0x80) ? 1 : 0) ; - mantissa = ((cptr [2] & 0x7F) << 16) | (cptr [1] << 8) | (cptr [0]) ; - - if (! (exponent || mantissa)) - return 0.0 ; - - mantissa |= 0x800000 ; - exponent = exponent ? exponent - 127 : 0 ; - - fvalue = mantissa ? ((float) mantissa) / ((float) 0x800000) : 0.0 ; - - if (negative) - fvalue *= -1 ; - - if (exponent > 0) - fvalue *= pow (2.0, exponent) ; - else if (exponent < 0) - fvalue /= pow (2.0, abs (exponent)) ; - - return fvalue ; -} /* float32_le_read */ - -void -float32_le_write (float in, unsigned char *out) -{ int exponent, mantissa, negative = 0 ; - - memset (out, 0, sizeof (int)) ; - - if (fabs (in) < 1e-30) - return ; - - if (in < 0.0) - { in *= -1.0 ; - negative = 1 ; - } ; - - in = frexp (in, &exponent) ; - - exponent += 126 ; - - in *= (float) 0x1000000 ; - mantissa = (((int) in) & 0x7FFFFF) ; - - if (negative) - out [3] |= 0x80 ; - - if (exponent & 0x01) - out [2] |= 0x80 ; - - out [0] = mantissa & 0xFF ; - out [1] = (mantissa >> 8) & 0xFF ; - out [2] |= (mantissa >> 16) & 0x7F ; - out [3] |= (exponent >> 1) & 0x7F ; - - return ; -} /* float32_le_write */ - -void -float32_be_write (float in, unsigned char *out) -{ int exponent, mantissa, negative = 0 ; - - memset (out, 0, sizeof (int)) ; - - if (fabs (in) < 1e-30) - return ; - - if (in < 0.0) - { in *= -1.0 ; - negative = 1 ; - } ; - - in = frexp (in, &exponent) ; - - exponent += 126 ; - - in *= (float) 0x1000000 ; - mantissa = (((int) in) & 0x7FFFFF) ; - - if (negative) - out [0] |= 0x80 ; - - if (exponent & 0x01) - out [1] |= 0x80 ; - - out [3] = mantissa & 0xFF ; - out [2] = (mantissa >> 8) & 0xFF ; - out [1] |= (mantissa >> 16) & 0x7F ; - out [0] |= (exponent >> 1) & 0x7F ; - - return ; -} /* float32_be_write */ - -/*============================================================================================== -** Private functions. -*/ - -static void -float32_peak_update (SF_PRIVATE *psf, const float *buffer, int count, sf_count_t indx) -{ int chan ; - int k, position ; - float fmaxval ; - - for (chan = 0 ; chan < psf->sf.channels ; chan++) - { fmaxval = fabs (buffer [chan]) ; - position = 0 ; - for (k = chan ; k < count ; k += psf->sf.channels) - if (fmaxval < fabs (buffer [k])) - { fmaxval = fabs (buffer [k]) ; - position = k ; - } ; - - if (fmaxval > psf->peak_info->peaks [chan].value) - { psf->peak_info->peaks [chan].value = fmaxval ; - psf->peak_info->peaks [chan].position = psf->write_current + indx + (position / psf->sf.channels) ; - } ; - } ; - - return ; -} /* float32_peak_update */ - -static int -float32_get_capability (SF_PRIVATE *psf) -{ union - { float f ; - int i ; - unsigned char c [4] ; - } data ; - - data.f = (float) 1.23456789 ; /* Some abitrary value. */ - - if (! psf->ieee_replace) - { /* If this test is true ints and floats are compatible and little endian. */ - if (data.c [0] == 0x52 && data.c [1] == 0x06 && data.c [2] == 0x9e && data.c [3] == 0x3f) - return FLOAT_CAN_RW_LE ; - - /* If this test is true ints and floats are compatible and big endian. */ - if (data.c [3] == 0x52 && data.c [2] == 0x06 && data.c [1] == 0x9e && data.c [0] == 0x3f) - return FLOAT_CAN_RW_BE ; - } ; - - /* Floats are broken. Don't expect reading or writing to be fast. */ - psf_log_printf (psf, "Using IEEE replacement code for float.\n") ; - - return (CPU_IS_LITTLE_ENDIAN) ? FLOAT_BROKEN_LE : FLOAT_BROKEN_BE ; -} /* float32_get_capability */ - -/*======================================================================================= -*/ - -static void -f2s_array (const float *src, int count, short *dest, float scale) -{ - while (--count >= 0) - { dest [count] = lrintf (scale * src [count]) ; - } ; -} /* f2s_array */ - -static void -f2s_clip_array (const float *src, int count, short *dest, float scale) -{ while (--count >= 0) - { float tmp = scale * src [count] ; - - if (CPU_CLIPS_POSITIVE == 0 && tmp > 32767.0) - dest [count] = SHRT_MAX ; - else if (CPU_CLIPS_NEGATIVE == 0 && tmp < -32768.0) - dest [count] = SHRT_MIN ; - else - dest [count] = lrintf (tmp) ; - } ; -} /* f2s_clip_array */ - -static inline void -f2i_array (const float *src, int count, int *dest, float scale) -{ while (--count >= 0) - { dest [count] = lrintf (scale * src [count]) ; - } ; -} /* f2i_array */ - -static inline void -f2i_clip_array (const float *src, int count, int *dest, float scale) -{ while (--count >= 0) - { float tmp = scale * src [count] ; - - if (CPU_CLIPS_POSITIVE == 0 && tmp > (1.0 * INT_MAX)) - dest [count] = INT_MAX ; - else if (CPU_CLIPS_NEGATIVE == 0 && tmp < (-1.0 * INT_MAX)) - dest [count] = INT_MIN ; - else - dest [count] = lrintf (tmp) ; - } ; -} /* f2i_clip_array */ - -static inline void -f2d_array (const float *src, int count, double *dest) -{ while (--count >= 0) - { dest [count] = src [count] ; - } ; -} /* f2d_array */ - -static inline void -s2f_array (const short *src, float *dest, int count, float scale) -{ while (--count >= 0) - { dest [count] = scale * src [count] ; - } ; -} /* s2f_array */ - -static inline void -i2f_array (const int *src, float *dest, int count, float scale) -{ while (--count >= 0) - { dest [count] = scale * src [count] ; - } ; -} /* i2f_array */ - -static inline void -d2f_array (const double *src, float *dest, int count) -{ while (--count >= 0) - { dest [count] = src [count] ; - } ; -} /* d2f_array */ - -/*---------------------------------------------------------------------------------------------- -*/ - -static sf_count_t -host_read_f2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const float *, int, short *, float) ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float scale ; - - convert = (psf->add_clipping) ? f2s_clip_array : f2s_array ; - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - scale = (psf->float_int_mult == 0) ? 1.0 : 0x7FFF / psf->float_max ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - -/* Fix me : Need lef2s_array */ - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - convert (ubuf.fbuf, readcount, ptr + total, scale) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* host_read_f2s */ - -static sf_count_t -host_read_f2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const float *, int, int *, float) ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float scale ; - - convert = (psf->add_clipping) ? f2i_clip_array : f2i_array ; - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - scale = (psf->float_int_mult == 0) ? 1.0 : 0x7FFFFFFF / psf->float_max ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - convert (ubuf.fbuf, readcount, ptr + total, scale) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* host_read_f2i */ - -static sf_count_t -host_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - if (psf->data_endswap != SF_TRUE) - return psf_fread (ptr, sizeof (float), len, psf) ; - - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - - endswap_int_copy ((int*) (ptr + total), ubuf.ibuf, readcount) ; - - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* host_read_f */ - -static sf_count_t -host_read_f2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - -/* Fix me : Need lef2d_array */ - f2d_array (ubuf.fbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* host_read_f2d */ - -static sf_count_t -host_write_s2f (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - float scale ; - -/* Erik */ - scale = (psf->scale_int_float == 0) ? 1.0 : 1.0 / 0x8000 ; - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2f_array (ptr + total, ubuf.fbuf, bufferlen, scale) ; - - if (psf->peak_info) - float32_peak_update (psf, ubuf.fbuf, bufferlen, total / psf->sf.channels) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* host_write_s2f */ - -static sf_count_t -host_write_i2f (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - float scale ; - - scale = (psf->scale_int_float == 0) ? 1.0 : 1.0 / (8.0 * 0x10000000) ; - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2f_array (ptr + total, ubuf.fbuf, bufferlen, scale) ; - - if (psf->peak_info) - float32_peak_update (psf, ubuf.fbuf, bufferlen, total / psf->sf.channels) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.fbuf, sizeof (float) , bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* host_write_i2f */ - -static sf_count_t -host_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - if (psf->peak_info) - float32_peak_update (psf, ptr, len, 0) ; - - if (psf->data_endswap != SF_TRUE) - return psf_fwrite (ptr, sizeof (float), len, psf) ; - - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - - endswap_int_copy (ubuf.ibuf, (const int*) (ptr + total), bufferlen) ; - - writecount = psf_fwrite (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* host_write_f */ - -static sf_count_t -host_write_d2f (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - - d2f_array (ptr + total, ubuf.fbuf, bufferlen) ; - - if (psf->peak_info) - float32_peak_update (psf, ubuf.fbuf, bufferlen, total / psf->sf.channels) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* host_write_d2f */ - -/*======================================================================================= -*/ - -static sf_count_t -replace_read_f2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float scale ; - - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - scale = (psf->float_int_mult == 0) ? 1.0 : 0x7FFF / psf->float_max ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - bf2f_array (ubuf.fbuf, bufferlen) ; - - f2s_array (ubuf.fbuf, readcount, ptr + total, scale) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* replace_read_f2s */ - -static sf_count_t -replace_read_f2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float scale ; - - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - scale = (psf->float_int_mult == 0) ? 1.0 : 0x7FFF / psf->float_max ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - bf2f_array (ubuf.fbuf, bufferlen) ; - - f2i_array (ubuf.fbuf, readcount, ptr + total, scale) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* replace_read_f2i */ - -static sf_count_t -replace_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - /* FIX THIS */ - - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - bf2f_array (ubuf.fbuf, bufferlen) ; - - memcpy (ptr + total, ubuf.fbuf, bufferlen * sizeof (float)) ; - - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* replace_read_f */ - -static sf_count_t -replace_read_f2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - bf2f_array (ubuf.fbuf, bufferlen) ; - - f2d_array (ubuf.fbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* replace_read_f2d */ - -static sf_count_t -replace_write_s2f (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - float scale ; - - scale = (psf->scale_int_float == 0) ? 1.0 : 1.0 / 0x8000 ; - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2f_array (ptr + total, ubuf.fbuf, bufferlen, scale) ; - - if (psf->peak_info) - float32_peak_update (psf, ubuf.fbuf, bufferlen, total / psf->sf.channels) ; - - f2bf_array (ubuf.fbuf, bufferlen) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* replace_write_s2f */ - -static sf_count_t -replace_write_i2f (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - float scale ; - - scale = (psf->scale_int_float == 0) ? 1.0 : 1.0 / (8.0 * 0x10000000) ; - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2f_array (ptr + total, ubuf.fbuf, bufferlen, scale) ; - - if (psf->peak_info) - float32_peak_update (psf, ubuf.fbuf, bufferlen, total / psf->sf.channels) ; - - f2bf_array (ubuf.fbuf, bufferlen) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* replace_write_i2f */ - -static sf_count_t -replace_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - /* FIX THIS */ - if (psf->peak_info) - float32_peak_update (psf, ptr, len, 0) ; - - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - - memcpy (ubuf.fbuf, ptr + total, bufferlen * sizeof (float)) ; - - f2bf_array (ubuf.fbuf, bufferlen) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.fbuf, sizeof (float) , bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* replace_write_f */ - -static sf_count_t -replace_write_d2f (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.fbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - d2f_array (ptr + total, ubuf.fbuf, bufferlen) ; - - if (psf->peak_info) - float32_peak_update (psf, ubuf.fbuf, bufferlen, total / psf->sf.channels) ; - - f2bf_array (ubuf.fbuf, bufferlen) ; - - if (psf->data_endswap == SF_TRUE) - endswap_int_array (ubuf.ibuf, bufferlen) ; - - writecount = psf_fwrite (ubuf.fbuf, sizeof (float), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* replace_write_d2f */ - -/*---------------------------------------------------------------------------------------------- -*/ - -static void -bf2f_array (float *buffer, int count) -{ while (--count >= 0) - { buffer [count] = FLOAT32_READ ((unsigned char *) (buffer + count)) ; - } ; -} /* bf2f_array */ - -static void -f2bf_array (float *buffer, int count) -{ while (--count >= 0) - { FLOAT32_WRITE (buffer [count], (unsigned char*) (buffer + count)) ; - } ; -} /* f2bf_array */ - diff --git a/libs/libsndfile/src/float_cast.h b/libs/libsndfile/src/float_cast.h deleted file mode 100644 index 98c7de74b1..0000000000 --- a/libs/libsndfile/src/float_cast.h +++ /dev/null @@ -1,273 +0,0 @@ -/* -** Copyright (C) 2001-2004 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* Version 1.4 */ - -#ifndef FLOAT_CAST_HEADER -#define FLOAT_CAST_HEADER - -/*============================================================================ -** On Intel Pentium processors (especially PIII and probably P4), converting -** from float to int is very slow. To meet the C specs, the code produced by -** most C compilers targeting Pentium needs to change the FPU rounding mode -** before the float to int conversion is performed. -** -** Changing the FPU rounding mode causes the FPU pipeline to be flushed. It -** is this flushing of the pipeline which is so slow. -** -** Fortunately the ISO C99 specifications define the functions lrint, lrintf, -** llrint and llrintf which fix this problem as a side effect. -** -** On Unix-like systems, the configure process should have detected the -** presence of these functions. If they weren't found we have to replace them -** here with a standard C cast. -*/ - -/* -** The C99 prototypes for lrint and lrintf are as follows: -** -** long int lrintf (float x) ; -** long int lrint (double x) ; -*/ - -#include "sfconfig.h" - -/* -** The presence of the required functions are detected during the configure -** process and the values HAVE_LRINT and HAVE_LRINTF are set accordingly in -** the sfconfig.h file. -*/ - -#define HAVE_LRINT_REPLACEMENT 0 - -#if (HAVE_LRINT && HAVE_LRINTF) - - /* - ** These defines enable functionality introduced with the 1999 ISO C - ** standard. They must be defined before the inclusion of math.h to - ** engage them. If optimisation is enabled, these functions will be - ** inlined. With optimisation switched off, you have to link in the - ** maths library using -lm. - */ - - #define _ISOC9X_SOURCE 1 - #define _ISOC99_SOURCE 1 - - #define __USE_ISOC9X 1 - #define __USE_ISOC99 1 - - #include - -#elif (defined (__CYGWIN__)) - - #include - - #undef HAVE_LRINT_REPLACEMENT - #define HAVE_LRINT_REPLACEMENT 1 - - #undef lrint - #undef lrintf - - #define lrint double2int - #define lrintf float2int - - /* - ** The native CYGWIN lrint and lrintf functions are buggy: - ** http://sourceware.org/ml/cygwin/2005-06/msg00153.html - ** http://sourceware.org/ml/cygwin/2005-09/msg00047.html - ** and slow. - ** These functions (pulled from the Public Domain MinGW math.h header) - ** replace the native versions. - */ - - static inline long double2int (double in) - { long retval ; - - __asm__ __volatile__ - ( "fistpl %0" - : "=m" (retval) - : "t" (in) - : "st" - ) ; - - return retval ; - } /* double2int */ - - static inline long float2int (float in) - { long retval ; - - __asm__ __volatile__ - ( "fistpl %0" - : "=m" (retval) - : "t" (in) - : "st" - ) ; - - return retval ; - } /* float2int */ - -#elif (defined (WIN32) || defined (_WIN32)) && !defined(_WIN64) - - #undef HAVE_LRINT_REPLACEMENT - #define HAVE_LRINT_REPLACEMENT 1 - - #include - - /* - ** Win32 doesn't seem to have these functions. - ** Therefore implement inline versions of these functions here. - */ - - __inline long int - lrint (double flt) - { int intgr ; - - _asm - { fld flt - fistp intgr - } ; - - return intgr ; - } - - __inline long int - lrintf (float flt) - { int intgr ; - - _asm - { fld flt - fistp intgr - } ; - - return intgr ; - } - -#elif defined(_WIN64) -#if (_MSC_VER < 1800) - __inline long int lrint(double x) - { - return (long int) (x); - } - __inline long int lrintf(float x) - { - return (long int) (x); - } -#endif -#elif (defined (__MWERKS__) && defined (macintosh)) - - /* This MacOS 9 solution was provided by Stephane Letz */ - - #undef HAVE_LRINT_REPLACEMENT - #define HAVE_LRINT_REPLACEMENT 1 - #include - - #undef lrint - #undef lrintf - - #define lrint double2int - #define lrintf float2int - - inline int - float2int (register float in) - { long res [2] ; - - asm - { fctiw in, in - stfd in, res - } - return res [1] ; - } /* float2int */ - - inline int - double2int (register double in) - { long res [2] ; - - asm - { fctiw in, in - stfd in, res - } - return res [1] ; - } /* double2int */ - -#elif (defined (__MACH__) && defined (__APPLE__)) - - /* For Apple MacOSX. */ - - #undef HAVE_LRINT_REPLACEMENT - #define HAVE_LRINT_REPLACEMENT 1 - #include - - #undef lrint - #undef lrintf - - #define lrint double2int - #define lrintf float2int - - inline static long - float2int (register float in) - { int res [2] ; - - __asm__ __volatile__ - ( "fctiw %1, %1\n\t" - "stfd %1, %0" - : "=m" (res) /* Output */ - : "f" (in) /* Input */ - : "memory" - ) ; - - return res [1] ; - } /* lrintf */ - - inline static long - double2int (register double in) - { int res [2] ; - - __asm__ __volatile__ - ( "fctiw %1, %1\n\t" - "stfd %1, %0" - : "=m" (res) /* Output */ - : "f" (in) /* Input */ - : "memory" - ) ; - - return res [1] ; - } /* lrint */ - -#else - #ifndef __sgi - #warning "Don't have the functions lrint() and lrintf()." - #warning "Replacing these functions with a standard C cast." - #endif - - #include - - #define lrint(dbl) ((long) (dbl)) - #define lrintf(flt) ((long) (flt)) - -#endif - - -#endif /* FLOAT_CAST_HEADER */ - -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 42db1693-ff61-4051-bac1-e4d24c4e30b7 -*/ diff --git a/libs/libsndfile/src/g72x.c b/libs/libsndfile/src/g72x.c deleted file mode 100644 index fec5d3f336..0000000000 --- a/libs/libsndfile/src/g72x.c +++ /dev/null @@ -1,608 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" -#include "G72x/g72x.h" - -/* This struct is private to the G72x code. */ -struct g72x_state ; -typedef struct g72x_state G72x_STATE ; - -typedef struct -{ /* Private data. Don't mess with it. */ - struct g72x_state * private ; - - /* Public data. Read only. */ - int blocksize, samplesperblock, bytesperblock ; - - /* Public data. Read and write. */ - int blocks_total, block_curr, sample_curr ; - unsigned char block [G72x_BLOCK_SIZE] ; - short samples [G72x_BLOCK_SIZE] ; -} G72x_PRIVATE ; - -static int psf_g72x_decode_block (SF_PRIVATE *psf, G72x_PRIVATE *pg72x) ; -static int psf_g72x_encode_block (SF_PRIVATE *psf, G72x_PRIVATE *pg72x) ; - -static sf_count_t g72x_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t g72x_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t g72x_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t g72x_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t g72x_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t g72x_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t g72x_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t g72x_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static sf_count_t g72x_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; - -static int g72x_close (SF_PRIVATE *psf) ; - - -/*============================================================================================ -** WAV G721 Reader initialisation function. -*/ - -int -g72x_init (SF_PRIVATE * psf) -{ G72x_PRIVATE *pg72x ; - int bitspersample, bytesperblock, codec ; - - if (psf->codec_data != NULL) - { psf_log_printf (psf, "*** psf->codec_data is not NULL.\n") ; - return SFE_INTERNAL ; - } ; - - psf->sf.seekable = SF_FALSE ; - - if (psf->sf.channels != 1) - return SFE_G72X_NOT_MONO ; - - if ((pg72x = calloc (1, sizeof (G72x_PRIVATE))) == NULL) - return SFE_MALLOC_FAILED ; - - psf->codec_data = (void*) pg72x ; - - pg72x->block_curr = 0 ; - pg72x->sample_curr = 0 ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_G721_32 : - codec = G721_32_BITS_PER_SAMPLE ; - bytesperblock = G721_32_BYTES_PER_BLOCK ; - bitspersample = G721_32_BITS_PER_SAMPLE ; - break ; - - case SF_FORMAT_G723_24: - codec = G723_24_BITS_PER_SAMPLE ; - bytesperblock = G723_24_BYTES_PER_BLOCK ; - bitspersample = G723_24_BITS_PER_SAMPLE ; - break ; - - case SF_FORMAT_G723_40: - codec = G723_40_BITS_PER_SAMPLE ; - bytesperblock = G723_40_BYTES_PER_BLOCK ; - bitspersample = G723_40_BITS_PER_SAMPLE ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - psf->filelength = psf_get_filelen (psf) ; - if (psf->filelength < psf->dataoffset) - psf->filelength = psf->dataoffset ; - - psf->datalength = psf->filelength - psf->dataoffset ; - if (psf->dataend > 0) - psf->datalength -= psf->filelength - psf->dataend ; - - if (psf->file.mode == SFM_READ) - { pg72x->private = g72x_reader_init (codec, &(pg72x->blocksize), &(pg72x->samplesperblock)) ; - if (pg72x->private == NULL) - return SFE_MALLOC_FAILED ; - - pg72x->bytesperblock = bytesperblock ; - - psf->read_short = g72x_read_s ; - psf->read_int = g72x_read_i ; - psf->read_float = g72x_read_f ; - psf->read_double = g72x_read_d ; - - psf->seek = g72x_seek ; - - if (psf->datalength % pg72x->blocksize) - { psf_log_printf (psf, "*** Odd psf->datalength (%D) should be a multiple of %d\n", psf->datalength, pg72x->blocksize) ; - pg72x->blocks_total = (psf->datalength / pg72x->blocksize) + 1 ; - } - else - pg72x->blocks_total = psf->datalength / pg72x->blocksize ; - - psf->sf.frames = pg72x->blocks_total * pg72x->samplesperblock ; - - psf_g72x_decode_block (psf, pg72x) ; - } - else if (psf->file.mode == SFM_WRITE) - { pg72x->private = g72x_writer_init (codec, &(pg72x->blocksize), &(pg72x->samplesperblock)) ; - if (pg72x->private == NULL) - return SFE_MALLOC_FAILED ; - - pg72x->bytesperblock = bytesperblock ; - - psf->write_short = g72x_write_s ; - psf->write_int = g72x_write_i ; - psf->write_float = g72x_write_f ; - psf->write_double = g72x_write_d ; - - if (psf->datalength % pg72x->blocksize) - pg72x->blocks_total = (psf->datalength / pg72x->blocksize) + 1 ; - else - pg72x->blocks_total = psf->datalength / pg72x->blocksize ; - - if (psf->datalength > 0) - psf->sf.frames = (8 * psf->datalength) / bitspersample ; - - if ((psf->sf.frames * bitspersample) / 8 != psf->datalength) - psf_log_printf (psf, "*** Warning : weird psf->datalength.\n") ; - } ; - - psf->codec_close = g72x_close ; - - return 0 ; -} /* g72x_init */ - -/*============================================================================================ -** G721 Read Functions. -*/ - -static int -psf_g72x_decode_block (SF_PRIVATE *psf, G72x_PRIVATE *pg72x) -{ int k ; - - pg72x->block_curr ++ ; - pg72x->sample_curr = 0 ; - - if (pg72x->block_curr > pg72x->blocks_total) - { memset (pg72x->samples, 0, G72x_BLOCK_SIZE * sizeof (short)) ; - return 1 ; - } ; - - if ((k = psf_fread (pg72x->block, 1, pg72x->bytesperblock, psf)) != pg72x->bytesperblock) - psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, pg72x->bytesperblock) ; - - pg72x->blocksize = k ; - g72x_decode_block (pg72x->private, pg72x->block, pg72x->samples) ; - - return 1 ; -} /* psf_g72x_decode_block */ - -static int -g72x_read_block (SF_PRIVATE *psf, G72x_PRIVATE *pg72x, short *ptr, int len) -{ int count, total = 0, indx = 0 ; - - while (indx < len) - { if (pg72x->block_curr > pg72x->blocks_total) - { memset (&(ptr [indx]), 0, (len - indx) * sizeof (short)) ; - return total ; - } ; - - if (pg72x->sample_curr >= pg72x->samplesperblock) - psf_g72x_decode_block (psf, pg72x) ; - - count = pg72x->samplesperblock - pg72x->sample_curr ; - count = (len - indx > count) ? count : len - indx ; - - memcpy (&(ptr [indx]), &(pg72x->samples [pg72x->sample_curr]), count * sizeof (short)) ; - indx += count ; - pg72x->sample_curr += count ; - total = indx ; - } ; - - return total ; -} /* g72x_read_block */ - -static sf_count_t -g72x_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ G72x_PRIVATE *pg72x ; - int readcount, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - pg72x = (G72x_PRIVATE*) psf->codec_data ; - - while (len > 0) - { readcount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = g72x_read_block (psf, pg72x, ptr, readcount) ; - - total += count ; - len -= count ; - - if (count != readcount) - break ; - } ; - - return total ; -} /* g72x_read_s */ - -static sf_count_t -g72x_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - G72x_PRIVATE *pg72x ; - short *sptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - pg72x = (G72x_PRIVATE*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = SF_BUFFER_LEN / sizeof (short) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = g72x_read_block (psf, pg72x, sptr, readcount) ; - - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = sptr [k] << 16 ; - - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* g72x_read_i */ - -static sf_count_t -g72x_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - G72x_PRIVATE *pg72x ; - short *sptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - float normfact ; - - if (psf->codec_data == NULL) - return 0 ; - pg72x = (G72x_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x8000) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = SF_BUFFER_LEN / sizeof (short) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = g72x_read_block (psf, pg72x, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * sptr [k] ; - - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* g72x_read_f */ - -static sf_count_t -g72x_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - G72x_PRIVATE *pg72x ; - short *sptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - double normfact ; - - if (psf->codec_data == NULL) - return 0 ; - pg72x = (G72x_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x8000) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = SF_BUFFER_LEN / sizeof (short) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = g72x_read_block (psf, pg72x, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * (double) (sptr [k]) ; - - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* g72x_read_d */ - -static sf_count_t -g72x_seek (SF_PRIVATE *psf, int UNUSED (mode), sf_count_t UNUSED (offset)) -{ - psf_log_printf (psf, "seek unsupported\n") ; - - /* No simple solution. To do properly, would need to seek - ** to start of file and decode everything up to seek position. - ** Maybe implement SEEK_SET to 0 only? - */ - return 0 ; - -/* -** G72x_PRIVATE *pg72x ; -** int newblock, newsample, sample_curr ; -** -** if (psf->codec_data == NULL) -** return 0 ; -** pg72x = (G72x_PRIVATE*) psf->codec_data ; -** -** if (! (psf->datalength && psf->dataoffset)) -** { psf->error = SFE_BAD_SEEK ; -** return PSF_SEEK_ERROR ; -** } ; -** -** sample_curr = (8 * psf->datalength) / G721_32_BITS_PER_SAMPLE ; -** -** switch (whence) -** { case SEEK_SET : -** if (offset < 0 || offset > sample_curr) -** { psf->error = SFE_BAD_SEEK ; -** return PSF_SEEK_ERROR ; -** } ; -** newblock = offset / pg72x->samplesperblock ; -** newsample = offset % pg72x->samplesperblock ; -** break ; -** -** case SEEK_CUR : -** if (psf->current + offset < 0 || psf->current + offset > sample_curr) -** { psf->error = SFE_BAD_SEEK ; -** return PSF_SEEK_ERROR ; -** } ; -** newblock = (8 * (psf->current + offset)) / pg72x->samplesperblock ; -** newsample = (8 * (psf->current + offset)) % pg72x->samplesperblock ; -** break ; -** -** case SEEK_END : -** if (offset > 0 || sample_curr + offset < 0) -** { psf->error = SFE_BAD_SEEK ; -** return PSF_SEEK_ERROR ; -** } ; -** newblock = (sample_curr + offset) / pg72x->samplesperblock ; -** newsample = (sample_curr + offset) % pg72x->samplesperblock ; -** break ; -** -** default : -** psf->error = SFE_BAD_SEEK ; -** return PSF_SEEK_ERROR ; -** } ; -** -** if (psf->file.mode == SFM_READ) -** { psf_fseek (psf, psf->dataoffset + newblock * pg72x->blocksize, SEEK_SET) ; -** pg72x->block_curr = newblock ; -** psf_g72x_decode_block (psf, pg72x) ; -** pg72x->sample_curr = newsample ; -** } -** else -** { /+* What to do about write??? *+/ -** psf->error = SFE_BAD_SEEK ; -** return PSF_SEEK_ERROR ; -** } ; -** -** psf->current = newblock * pg72x->samplesperblock + newsample ; -** return psf->current ; -** -*/ -} /* g72x_seek */ - -/*========================================================================================== -** G72x Write Functions. -*/ - -static int -psf_g72x_encode_block (SF_PRIVATE *psf, G72x_PRIVATE *pg72x) -{ int k ; - - /* Encode the samples. */ - g72x_encode_block (pg72x->private, pg72x->samples, pg72x->block) ; - - /* Write the block to disk. */ - if ((k = psf_fwrite (pg72x->block, 1, pg72x->blocksize, psf)) != pg72x->blocksize) - psf_log_printf (psf, "*** Warning : short write (%d != %d).\n", k, pg72x->blocksize) ; - - pg72x->sample_curr = 0 ; - pg72x->block_curr ++ ; - - /* Set samples to zero for next block. */ - memset (pg72x->samples, 0, G72x_BLOCK_SIZE * sizeof (short)) ; - - return 1 ; -} /* psf_g72x_encode_block */ - -static int -g72x_write_block (SF_PRIVATE *psf, G72x_PRIVATE *pg72x, const short *ptr, int len) -{ int count, total = 0, indx = 0 ; - - while (indx < len) - { count = pg72x->samplesperblock - pg72x->sample_curr ; - - if (count > len - indx) - count = len - indx ; - - memcpy (&(pg72x->samples [pg72x->sample_curr]), &(ptr [indx]), count * sizeof (short)) ; - indx += count ; - pg72x->sample_curr += count ; - total = indx ; - - if (pg72x->sample_curr >= pg72x->samplesperblock) - psf_g72x_encode_block (psf, pg72x) ; - } ; - - return total ; -} /* g72x_write_block */ - -static sf_count_t -g72x_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ G72x_PRIVATE *pg72x ; - int writecount, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - pg72x = (G72x_PRIVATE*) psf->codec_data ; - - while (len > 0) - { writecount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = g72x_write_block (psf, pg72x, ptr, writecount) ; - - total += count ; - len -= count ; - if (count != writecount) - break ; - } ; - - return total ; -} /* g72x_write_s */ - -static sf_count_t -g72x_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - G72x_PRIVATE *pg72x ; - short *sptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - pg72x = (G72x_PRIVATE*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = SF_BUFFER_LEN / sizeof (short) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = ptr [total + k] >> 16 ; - count = g72x_write_block (psf, pg72x, sptr, writecount) ; - - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - return total ; -} /* g72x_write_i */ - -static sf_count_t -g72x_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - G72x_PRIVATE *pg72x ; - short *sptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - float normfact ; - - if (psf->codec_data == NULL) - return 0 ; - pg72x = (G72x_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? (1.0 * 0x8000) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = SF_BUFFER_LEN / sizeof (short) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = lrintf (normfact * ptr [total + k]) ; - count = g72x_write_block (psf, pg72x, sptr, writecount) ; - - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* g72x_write_f */ - -static sf_count_t -g72x_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - G72x_PRIVATE *pg72x ; - short *sptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - double normfact ; - - if (psf->codec_data == NULL) - return 0 ; - pg72x = (G72x_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_double == SF_TRUE) ? (1.0 * 0x8000) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = SF_BUFFER_LEN / sizeof (short) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = lrint (normfact * ptr [total + k]) ; - count = g72x_write_block (psf, pg72x, sptr, writecount) ; - - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* g72x_write_d */ - -static int -g72x_close (SF_PRIVATE *psf) -{ G72x_PRIVATE *pg72x ; - - pg72x = (G72x_PRIVATE*) psf->codec_data ; - - if (psf->file.mode == SFM_WRITE) - { /* If a block has been partially assembled, write it out - ** as the final block. - */ - - if (pg72x->sample_curr && pg72x->sample_curr < G72x_BLOCK_SIZE) - psf_g72x_encode_block (psf, pg72x) ; - - if (psf->write_header) - psf->write_header (psf, SF_FALSE) ; - } ; - - /* Only free the pointer allocated by g72x_(reader|writer)_init. */ - free (pg72x->private) ; - - return 0 ; -} /* g72x_close */ - diff --git a/libs/libsndfile/src/gsm610.c b/libs/libsndfile/src/gsm610.c deleted file mode 100644 index 0d2800d92b..0000000000 --- a/libs/libsndfile/src/gsm610.c +++ /dev/null @@ -1,627 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" -#include "wav_w64.h" -#include "GSM610/gsm.h" - -#define GSM610_BLOCKSIZE 33 -#define GSM610_SAMPLES 160 - -typedef struct gsm610_tag -{ int blocks ; - int blockcount, samplecount ; - int samplesperblock, blocksize ; - - int (*decode_block) (SF_PRIVATE *psf, struct gsm610_tag *pgsm610) ; - int (*encode_block) (SF_PRIVATE *psf, struct gsm610_tag *pgsm610) ; - - short samples [WAV_W64_GSM610_SAMPLES] ; - unsigned char block [WAV_W64_GSM610_BLOCKSIZE] ; - - /* Damn I hate typedef-ed pointers; yes, gsm is a pointer type. */ - gsm gsm_data ; -} GSM610_PRIVATE ; - -static sf_count_t gsm610_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t gsm610_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t gsm610_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t gsm610_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t gsm610_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t gsm610_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t gsm610_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t gsm610_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static int gsm610_read_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610, short *ptr, int len) ; -static int gsm610_write_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610, const short *ptr, int len) ; - -static int gsm610_decode_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610) ; -static int gsm610_encode_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610) ; - -static int gsm610_wav_decode_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610) ; -static int gsm610_wav_encode_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610) ; - -static sf_count_t gsm610_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; - -static int gsm610_close (SF_PRIVATE *psf) ; - -/*============================================================================================ -** WAV GSM610 initialisation function. -*/ - -int -gsm610_init (SF_PRIVATE *psf) -{ GSM610_PRIVATE *pgsm610 ; - int true_flag = 1 ; - - if (psf->codec_data != NULL) - { psf_log_printf (psf, "*** psf->codec_data is not NULL.\n") ; - return SFE_INTERNAL ; - } ; - - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - psf->sf.seekable = SF_FALSE ; - - if ((pgsm610 = calloc (1, sizeof (GSM610_PRIVATE))) == NULL) - return SFE_MALLOC_FAILED ; - - psf->codec_data = pgsm610 ; - - memset (pgsm610, 0, sizeof (GSM610_PRIVATE)) ; - -/*============================================================ - -Need separate gsm_data structs for encode and decode. - -============================================================*/ - - if ((pgsm610->gsm_data = gsm_create ()) == NULL) - return SFE_MALLOC_FAILED ; - - switch (SF_CONTAINER (psf->sf.format)) - { case SF_FORMAT_WAV : - case SF_FORMAT_WAVEX : - case SF_FORMAT_W64 : - gsm_option (pgsm610->gsm_data, GSM_OPT_WAV49, &true_flag) ; - - pgsm610->encode_block = gsm610_wav_encode_block ; - pgsm610->decode_block = gsm610_wav_decode_block ; - - pgsm610->samplesperblock = WAV_W64_GSM610_SAMPLES ; - pgsm610->blocksize = WAV_W64_GSM610_BLOCKSIZE ; - break ; - - case SF_FORMAT_AIFF : - case SF_FORMAT_RAW : - pgsm610->encode_block = gsm610_encode_block ; - pgsm610->decode_block = gsm610_decode_block ; - - pgsm610->samplesperblock = GSM610_SAMPLES ; - pgsm610->blocksize = GSM610_BLOCKSIZE ; - break ; - - default : - return SFE_INTERNAL ; - break ; - } ; - - if (psf->file.mode == SFM_READ) - { if (psf->datalength % pgsm610->blocksize == 0) - pgsm610->blocks = psf->datalength / pgsm610->blocksize ; - else if (psf->datalength % pgsm610->blocksize == 1 && pgsm610->blocksize == GSM610_BLOCKSIZE) - { /* - ** Weird AIFF specific case. - ** AIFF chunks must be at an even offset from the start of file and - ** GSM610_BLOCKSIZE is odd which can result in an odd length SSND - ** chunk. The SSND chunk then gets padded on write which means that - ** when it is read the datalength is too big by 1. - */ - pgsm610->blocks = psf->datalength / pgsm610->blocksize ; - } - else - { psf_log_printf (psf, "*** Warning : data chunk seems to be truncated.\n") ; - pgsm610->blocks = psf->datalength / pgsm610->blocksize + 1 ; - } ; - - psf->sf.frames = pgsm610->samplesperblock * pgsm610->blocks ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - pgsm610->decode_block (psf, pgsm610) ; /* Read first block. */ - - psf->read_short = gsm610_read_s ; - psf->read_int = gsm610_read_i ; - psf->read_float = gsm610_read_f ; - psf->read_double = gsm610_read_d ; - } ; - - if (psf->file.mode == SFM_WRITE) - { pgsm610->blockcount = 0 ; - pgsm610->samplecount = 0 ; - - psf->write_short = gsm610_write_s ; - psf->write_int = gsm610_write_i ; - psf->write_float = gsm610_write_f ; - psf->write_double = gsm610_write_d ; - } ; - - psf->codec_close = gsm610_close ; - - psf->seek = gsm610_seek ; - - psf->filelength = psf_get_filelen (psf) ; - psf->datalength = psf->filelength - psf->dataoffset ; - - return 0 ; -} /* gsm610_init */ - -/*============================================================================================ -** GSM 6.10 Read Functions. -*/ - -static int -gsm610_wav_decode_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610) -{ int k ; - - pgsm610->blockcount ++ ; - pgsm610->samplecount = 0 ; - - if (pgsm610->blockcount > pgsm610->blocks) - { memset (pgsm610->samples, 0, sizeof (pgsm610->samples)) ; - return 1 ; - } ; - - if ((k = psf_fread (pgsm610->block, 1, WAV_W64_GSM610_BLOCKSIZE, psf)) != WAV_W64_GSM610_BLOCKSIZE) - psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, WAV_W64_GSM610_BLOCKSIZE) ; - - if (gsm_decode (pgsm610->gsm_data, pgsm610->block, pgsm610->samples) < 0) - { psf_log_printf (psf, "Error from WAV gsm_decode() on frame : %d\n", pgsm610->blockcount) ; - return 0 ; - } ; - - if (gsm_decode (pgsm610->gsm_data, pgsm610->block + (WAV_W64_GSM610_BLOCKSIZE + 1) / 2, pgsm610->samples + WAV_W64_GSM610_SAMPLES / 2) < 0) - { psf_log_printf (psf, "Error from WAV gsm_decode() on frame : %d.5\n", pgsm610->blockcount) ; - return 0 ; - } ; - - return 1 ; -} /* gsm610_wav_decode_block */ - -static int -gsm610_decode_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610) -{ int k ; - - pgsm610->blockcount ++ ; - pgsm610->samplecount = 0 ; - - if (pgsm610->blockcount > pgsm610->blocks) - { memset (pgsm610->samples, 0, sizeof (pgsm610->samples)) ; - return 1 ; - } ; - - if ((k = psf_fread (pgsm610->block, 1, GSM610_BLOCKSIZE, psf)) != GSM610_BLOCKSIZE) - psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, GSM610_BLOCKSIZE) ; - - if (gsm_decode (pgsm610->gsm_data, pgsm610->block, pgsm610->samples) < 0) - { psf_log_printf (psf, "Error from standard gsm_decode() on frame : %d\n", pgsm610->blockcount) ; - return 0 ; - } ; - - return 1 ; -} /* gsm610_decode_block */ - -static int -gsm610_read_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610, short *ptr, int len) -{ int count, total = 0, indx = 0 ; - - while (indx < len) - { if (pgsm610->blockcount >= pgsm610->blocks && pgsm610->samplecount >= pgsm610->samplesperblock) - { memset (ptr + indx, 0, (len - indx) * sizeof (short)) ; - return total ; - } ; - - if (pgsm610->samplecount >= pgsm610->samplesperblock) - pgsm610->decode_block (psf, pgsm610) ; - - count = pgsm610->samplesperblock - pgsm610->samplecount ; - count = (len - indx > count) ? count : len - indx ; - - memcpy (&(ptr [indx]), &(pgsm610->samples [pgsm610->samplecount]), count * sizeof (short)) ; - indx += count ; - pgsm610->samplecount += count ; - total = indx ; - } ; - - return total ; -} /* gsm610_read_block */ - -static sf_count_t -gsm610_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ GSM610_PRIVATE *pgsm610 ; - int readcount, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - pgsm610 = (GSM610_PRIVATE*) psf->codec_data ; - - while (len > 0) - { readcount = (len > 0x10000000) ? 0x1000000 : (int) len ; - - count = gsm610_read_block (psf, pgsm610, ptr, readcount) ; - - total += count ; - len -= count ; - - if (count != readcount) - break ; - } ; - - return total ; -} /* gsm610_read_s */ - -static sf_count_t -gsm610_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ GSM610_PRIVATE *pgsm610 ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - pgsm610 = (GSM610_PRIVATE*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = gsm610_read_block (psf, pgsm610, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = sptr [k] << 16 ; - - total += count ; - len -= readcount ; - } ; - return total ; -} /* gsm610_read_i */ - -static sf_count_t -gsm610_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ GSM610_PRIVATE *pgsm610 ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - float normfact ; - - if (psf->codec_data == NULL) - return 0 ; - pgsm610 = (GSM610_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x8000) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = gsm610_read_block (psf, pgsm610, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * sptr [k] ; - - total += count ; - len -= readcount ; - } ; - return total ; -} /* gsm610_read_f */ - -static sf_count_t -gsm610_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ GSM610_PRIVATE *pgsm610 ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x8000) : 1.0 ; - - if (psf->codec_data == NULL) - return 0 ; - pgsm610 = (GSM610_PRIVATE*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = gsm610_read_block (psf, pgsm610, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * sptr [k] ; - - total += count ; - len -= readcount ; - } ; - return total ; -} /* gsm610_read_d */ - -static sf_count_t -gsm610_seek (SF_PRIVATE *psf, int UNUSED (mode), sf_count_t offset) -{ GSM610_PRIVATE *pgsm610 ; - int newblock, newsample ; - - if (psf->codec_data == NULL) - return 0 ; - pgsm610 = (GSM610_PRIVATE*) psf->codec_data ; - - if (psf->dataoffset < 0) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - if (offset == 0) - { int true_flag = 1 ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - pgsm610->blockcount = 0 ; - - gsm_init (pgsm610->gsm_data) ; - if ((SF_CONTAINER (psf->sf.format)) == SF_FORMAT_WAV || - (SF_CONTAINER (psf->sf.format)) == SF_FORMAT_W64) - gsm_option (pgsm610->gsm_data, GSM_OPT_WAV49, &true_flag) ; - - pgsm610->decode_block (psf, pgsm610) ; - pgsm610->samplecount = 0 ; - return 0 ; - } ; - - if (offset < 0 || offset > pgsm610->blocks * pgsm610->samplesperblock) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - newblock = offset / pgsm610->samplesperblock ; - newsample = offset % pgsm610->samplesperblock ; - - if (psf->file.mode == SFM_READ) - { if (psf->read_current != newblock * pgsm610->samplesperblock + newsample) - { psf_fseek (psf, psf->dataoffset + newblock * pgsm610->samplesperblock, SEEK_SET) ; - pgsm610->blockcount = newblock ; - pgsm610->decode_block (psf, pgsm610) ; - pgsm610->samplecount = newsample ; - } ; - - return newblock * pgsm610->samplesperblock + newsample ; - } ; - - /* What to do about write??? */ - psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; -} /* gsm610_seek */ - -/*========================================================================================== -** GSM 6.10 Write Functions. -*/ - -static int -gsm610_encode_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610) -{ int k ; - - /* Encode the samples. */ - gsm_encode (pgsm610->gsm_data, pgsm610->samples, pgsm610->block) ; - - /* Write the block to disk. */ - if ((k = psf_fwrite (pgsm610->block, 1, GSM610_BLOCKSIZE, psf)) != GSM610_BLOCKSIZE) - psf_log_printf (psf, "*** Warning : short write (%d != %d).\n", k, GSM610_BLOCKSIZE) ; - - pgsm610->samplecount = 0 ; - pgsm610->blockcount ++ ; - - /* Set samples to zero for next block. */ - memset (pgsm610->samples, 0, sizeof (pgsm610->samples)) ; - - return 1 ; -} /* gsm610_encode_block */ - -static int -gsm610_wav_encode_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610) -{ int k ; - - /* Encode the samples. */ - gsm_encode (pgsm610->gsm_data, pgsm610->samples, pgsm610->block) ; - gsm_encode (pgsm610->gsm_data, pgsm610->samples+WAV_W64_GSM610_SAMPLES / 2, pgsm610->block+WAV_W64_GSM610_BLOCKSIZE / 2) ; - - /* Write the block to disk. */ - if ((k = psf_fwrite (pgsm610->block, 1, WAV_W64_GSM610_BLOCKSIZE, psf)) != WAV_W64_GSM610_BLOCKSIZE) - psf_log_printf (psf, "*** Warning : short write (%d != %d).\n", k, WAV_W64_GSM610_BLOCKSIZE) ; - - pgsm610->samplecount = 0 ; - pgsm610->blockcount ++ ; - - /* Set samples to zero for next block. */ - memset (pgsm610->samples, 0, sizeof (pgsm610->samples)) ; - - return 1 ; -} /* gsm610_wav_encode_block */ - -static int -gsm610_write_block (SF_PRIVATE *psf, GSM610_PRIVATE *pgsm610, const short *ptr, int len) -{ int count, total = 0, indx = 0 ; - - while (indx < len) - { count = pgsm610->samplesperblock - pgsm610->samplecount ; - - if (count > len - indx) - count = len - indx ; - - memcpy (&(pgsm610->samples [pgsm610->samplecount]), &(ptr [indx]), count * sizeof (short)) ; - indx += count ; - pgsm610->samplecount += count ; - total = indx ; - - if (pgsm610->samplecount >= pgsm610->samplesperblock) - pgsm610->encode_block (psf, pgsm610) ; - } ; - - return total ; -} /* gsm610_write_block */ - -static sf_count_t -gsm610_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ GSM610_PRIVATE *pgsm610 ; - int writecount, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - pgsm610 = (GSM610_PRIVATE*) psf->codec_data ; - - while (len > 0) - { writecount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = gsm610_write_block (psf, pgsm610, ptr, writecount) ; - - total += count ; - len -= count ; - - if (count != writecount) - break ; - } ; - - return total ; -} /* gsm610_write_s */ - -static sf_count_t -gsm610_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ GSM610_PRIVATE *pgsm610 ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - pgsm610 = (GSM610_PRIVATE*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = ptr [total + k] >> 16 ; - count = gsm610_write_block (psf, pgsm610, sptr, writecount) ; - - total += count ; - len -= writecount ; - } ; - return total ; -} /* gsm610_write_i */ - -static sf_count_t -gsm610_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ GSM610_PRIVATE *pgsm610 ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - float normfact ; - - if (psf->codec_data == NULL) - return 0 ; - pgsm610 = (GSM610_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? (1.0 * 0x7FFF) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = lrintf (normfact * ptr [total + k]) ; - count = gsm610_write_block (psf, pgsm610, sptr, writecount) ; - - total += count ; - len -= writecount ; - } ; - return total ; -} /* gsm610_write_f */ - -static sf_count_t -gsm610_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ GSM610_PRIVATE *pgsm610 ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - double normfact ; - - if (psf->codec_data == NULL) - return 0 ; - pgsm610 = (GSM610_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_double == SF_TRUE) ? (1.0 * 0x7FFF) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = lrint (normfact * ptr [total + k]) ; - count = gsm610_write_block (psf, pgsm610, sptr, writecount) ; - - total += count ; - len -= writecount ; - } ; - return total ; -} /* gsm610_write_d */ - -static int -gsm610_close (SF_PRIVATE *psf) -{ GSM610_PRIVATE *pgsm610 ; - - if (psf->codec_data == NULL) - return 0 ; - - pgsm610 = (GSM610_PRIVATE*) psf->codec_data ; - - if (psf->file.mode == SFM_WRITE) - { /* If a block has been partially assembled, write it out - ** as the final block. - */ - - if (pgsm610->samplecount && pgsm610->samplecount < pgsm610->samplesperblock) - pgsm610->encode_block (psf, pgsm610) ; - } ; - - if (pgsm610->gsm_data) - gsm_destroy (pgsm610->gsm_data) ; - - return 0 ; -} /* gsm610_close */ - diff --git a/libs/libsndfile/src/htk.c b/libs/libsndfile/src/htk.c deleted file mode 100644 index 25390f1dc1..0000000000 --- a/libs/libsndfile/src/htk.c +++ /dev/null @@ -1,226 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues. -*/ - -#define SFE_HTK_BAD_FILE_LEN 1666 -#define SFE_HTK_NOT_WAVEFORM 1667 - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int htk_close (SF_PRIVATE *psf) ; - -static int htk_write_header (SF_PRIVATE *psf, int calc_length) ; -static int htk_read_header (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -htk_open (SF_PRIVATE *psf) -{ int subformat ; - int error = 0 ; - - if (psf->is_pipe) - return SFE_HTK_NO_PIPE ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = htk_read_header (psf))) - return error ; - } ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_HTK) - return SFE_BAD_OPEN_FORMAT ; - - psf->endian = SF_ENDIAN_BIG ; - - if (htk_write_header (psf, SF_FALSE)) - return psf->error ; - - psf->write_header = htk_write_header ; - } ; - - psf->container_close = htk_close ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - switch (subformat) - { case SF_FORMAT_PCM_16 : /* 16-bit linear PCM. */ - error = pcm_init (psf) ; - break ; - - default : break ; - } ; - - return error ; -} /* htk_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -htk_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - htk_write_header (psf, SF_TRUE) ; - - return 0 ; -} /* htk_close */ - -static int -htk_write_header (SF_PRIVATE *psf, int calc_length) -{ sf_count_t current ; - int sample_count, sample_period ; - - current = psf_ftell (psf) ; - - if (calc_length) - psf->filelength = psf_get_filelen (psf) ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - if (psf->filelength > 12) - sample_count = (psf->filelength - 12) / 2 ; - else - sample_count = 0 ; - - sample_period = 10000000 / psf->sf.samplerate ; - - psf_binheader_writef (psf, "E444", sample_count, sample_period, 0x20000) ; - - /* Header construction complete so write it out. */ - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* htk_write_header */ - -/* -** Found the following info in a comment block within Bill Schottstaedt's -** sndlib library. -** -** HTK format files consist of a contiguous sequence of samples preceded by a -** header. Each sample is a vector of either 2-byte integers or 4-byte floats. -** 2-byte integers are used for compressed forms as described below and for -** vector quantised data as described later in section 5.11. HTK format data -** files can also be used to store speech waveforms as described in section 5.8. -** -** The HTK file format header is 12 bytes long and contains the following data -** nSamples -- number of samples in file (4-byte integer) -** sampPeriod -- sample period in 100ns units (4-byte integer) -** sampSize -- number of bytes per sample (2-byte integer) -** parmKind -- a code indicating the sample kind (2-byte integer) -** -** The parameter kind consists of a 6 bit code representing the basic -** parameter kind plus additional bits for each of the possible qualifiers. -** The basic parameter kind codes are -** -** 0 WAVEFORM sampled waveform -** 1 LPC linear prediction filter coefficients -** 2 LPREFC linear prediction reflection coefficients -** 3 LPCEPSTRA LPC cepstral coefficients -** 4 LPDELCEP LPC cepstra plus delta coefficients -** 5 IREFC LPC reflection coef in 16 bit integer format -** 6 MFCC mel-frequency cepstral coefficients -** 7 FBANK log mel-filter bank channel outputs -** 8 MELSPEC linear mel-filter bank channel outputs -** 9 USER user defined sample kind -** 10 DISCRETE vector quantised data -** -** and the bit-encoding for the qualifiers (in octal) is -** _E 000100 has energy -** _N 000200 absolute energy suppressed -** _D 000400 has delta coefficients -** _A 001000 has acceleration coefficients -** _C 002000 is compressed -** _Z 004000 has zero mean static coef. -** _K 010000 has CRC checksum -** _O 020000 has 0'th cepstral coef. -*/ - -static int -htk_read_header (SF_PRIVATE *psf) -{ int sample_count, sample_period, marker ; - - psf_binheader_readf (psf, "pE444", 0, &sample_count, &sample_period, &marker) ; - - if (2 * sample_count + 12 != psf->filelength) - return SFE_HTK_BAD_FILE_LEN ; - - if (marker != 0x20000) - return SFE_HTK_NOT_WAVEFORM ; - - psf->sf.channels = 1 ; - - if (sample_period > 0) - { psf->sf.samplerate = 10000000 / sample_period ; - psf_log_printf (psf, "HTK Waveform file\n Sample Count : %d\n Sample Period : %d => %d Hz\n", - sample_count, sample_period, psf->sf.samplerate) ; - } - else - { psf->sf.samplerate = 16000 ; - psf_log_printf (psf, "HTK Waveform file\n Sample Count : %d\n Sample Period : %d (should be > 0) => Guessed sample rate %d Hz\n", - sample_count, sample_period, psf->sf.samplerate) ; - } ; - - psf->sf.format = SF_FORMAT_HTK | SF_FORMAT_PCM_16 ; - psf->bytewidth = 2 ; - - /* HTK always has a 12 byte header. */ - psf->dataoffset = 12 ; - psf->endian = SF_ENDIAN_BIG ; - - psf->datalength = psf->filelength - psf->dataoffset ; - - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - - if (! psf->sf.frames && psf->blockwidth) - psf->sf.frames = (psf->filelength - psf->dataoffset) / psf->blockwidth ; - - return 0 ; -} /* htk_read_header */ - diff --git a/libs/libsndfile/src/id3.c b/libs/libsndfile/src/id3.c deleted file mode 100644 index 2fd0a0b971..0000000000 --- a/libs/libsndfile/src/id3.c +++ /dev/null @@ -1,57 +0,0 @@ -/* -** Copyright (C) 2010-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -int -id3_skip (SF_PRIVATE * psf) -{ unsigned char buf [10] ; - - memset (buf, 0, sizeof (buf)) ; - psf_binheader_readf (psf, "pb", 0, buf, 10) ; - - if (buf [0] == 'I' && buf [1] == 'D' && buf [2] == '3') - { int offset = buf [6] & 0x7f ; - offset = (offset << 7) | (buf [7] & 0x7f) ; - offset = (offset << 7) | (buf [8] & 0x7f) ; - offset = (offset << 7) | (buf [9] & 0x7f) ; - - psf_log_printf (psf, "ID3 length : %d\n--------------------\n", offset) ; - - /* Never want to jump backwards in a file. */ - if (offset < 0) - return 0 ; - - /* Calculate new file offset and position ourselves there. */ - psf->fileoffset += offset + 10 ; - psf_binheader_readf (psf, "p", psf->fileoffset) ; - - return 1 ; - } ; - - return 0 ; -} /* id3_skip */ diff --git a/libs/libsndfile/src/ima_adpcm.c b/libs/libsndfile/src/ima_adpcm.c deleted file mode 100644 index 0ba4513758..0000000000 --- a/libs/libsndfile/src/ima_adpcm.c +++ /dev/null @@ -1,948 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -typedef struct IMA_ADPCM_PRIVATE_tag -{ int (*decode_block) (SF_PRIVATE *psf, struct IMA_ADPCM_PRIVATE_tag *pima) ; - int (*encode_block) (SF_PRIVATE *psf, struct IMA_ADPCM_PRIVATE_tag *pima) ; - - int channels, blocksize, samplesperblock, blocks ; - int blockcount, samplecount ; - int previous [2] ; - int stepindx [2] ; - unsigned char *block ; - short *samples ; - short data [] ; /* ISO C99 struct flexible array. */ -} IMA_ADPCM_PRIVATE ; - -/*============================================================================================ -** Predefined IMA ADPCM data. -*/ - -static int ima_indx_adjust [16] = -{ -1, -1, -1, -1, /* +0 - +3, decrease the step size */ - +2, +4, +6, +8, /* +4 - +7, increase the step size */ - -1, -1, -1, -1, /* -0 - -3, decrease the step size */ - +2, +4, +6, +8, /* -4 - -7, increase the step size */ -} ; - -static int ima_step_size [89] = -{ 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, - 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, - 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, - 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, - 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493, 10442, - 11487, 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, - 32767 -} ; - -static int ima_reader_init (SF_PRIVATE *psf, int blockalign, int samplesperblock) ; -static int ima_writer_init (SF_PRIVATE *psf, int blockalign) ; - -static int ima_read_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima, short *ptr, int len) ; -static int ima_write_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima, const short *ptr, int len) ; - -static sf_count_t ima_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t ima_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t ima_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t ima_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t ima_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t ima_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t ima_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t ima_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static sf_count_t ima_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; - -static int ima_close (SF_PRIVATE *psf) ; - -static int wav_w64_ima_decode_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima) ; -static int wav_w64_ima_encode_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima) ; - -/*-static int aiff_ima_reader_init (SF_PRIVATE *psf, int blockalign, int samplesperblock) ;-*/ -static int aiff_ima_decode_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima) ; -static int aiff_ima_encode_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima) ; - - -static inline int -clamp_ima_step_index (int indx) -{ if (indx < 0) - return 0 ; - if (indx >= ARRAY_LEN (ima_step_size)) - return ARRAY_LEN (ima_step_size) - 1 ; - - return indx ; -} /* clamp_ima_step_index */ - -/*============================================================================================ -** IMA ADPCM Reader initialisation function. -*/ - -int -wav_w64_ima_init (SF_PRIVATE *psf, int blockalign, int samplesperblock) -{ int error ; - - if (psf->codec_data != NULL) - { psf_log_printf (psf, "*** psf->codec_data is not NULL.\n") ; - return SFE_INTERNAL ; - } ; - - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - if (psf->file.mode == SFM_READ) - if ((error = ima_reader_init (psf, blockalign, samplesperblock))) - return error ; - - if (psf->file.mode == SFM_WRITE) - if ((error = ima_writer_init (psf, blockalign))) - return error ; - - psf->codec_close = ima_close ; - psf->seek = ima_seek ; - - return 0 ; -} /* wav_w64_ima_init */ - -int -aiff_ima_init (SF_PRIVATE *psf, int blockalign, int samplesperblock) -{ int error ; - - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - if (psf->file.mode == SFM_READ) - if ((error = ima_reader_init (psf, blockalign, samplesperblock))) - return error ; - - if (psf->file.mode == SFM_WRITE) - if ((error = ima_writer_init (psf, blockalign))) - return error ; - - psf->codec_close = ima_close ; - - return 0 ; -} /* aiff_ima_init */ - -static int -ima_close (SF_PRIVATE *psf) -{ IMA_ADPCM_PRIVATE *pima ; - - pima = (IMA_ADPCM_PRIVATE*) psf->codec_data ; - - if (psf->file.mode == SFM_WRITE) - { /* If a block has been partially assembled, write it out - ** as the final block. - */ - if (pima->samplecount && pima->samplecount < pima->samplesperblock) - pima->encode_block (psf, pima) ; - - psf->sf.frames = pima->samplesperblock * pima->blockcount / psf->sf.channels ; - } ; - - return 0 ; -} /* ima_close */ - -/*============================================================================================ -** IMA ADPCM Read Functions. -*/ - -static int -ima_reader_init (SF_PRIVATE *psf, int blockalign, int samplesperblock) -{ IMA_ADPCM_PRIVATE *pima ; - int pimasize, count ; - - if (psf->file.mode != SFM_READ) - return SFE_BAD_MODE_RW ; - - pimasize = sizeof (IMA_ADPCM_PRIVATE) + blockalign * psf->sf.channels + 3 * psf->sf.channels * samplesperblock ; - - if (! (pima = calloc (1, pimasize))) - return SFE_MALLOC_FAILED ; - - psf->codec_data = (void*) pima ; - - pima->samples = pima->data ; - pima->block = (unsigned char*) (pima->data + samplesperblock * psf->sf.channels) ; - - pima->channels = psf->sf.channels ; - pima->blocksize = blockalign ; - pima->samplesperblock = samplesperblock ; - - psf->filelength = psf_get_filelen (psf) ; - psf->datalength = (psf->dataend) ? psf->dataend - psf->dataoffset : - psf->filelength - psf->dataoffset ; - - if (pima->blocksize == 0) - { psf_log_printf (psf, "*** Error : pima->blocksize should not be zero.\n") ; - return SFE_INTERNAL ; - } ; - - if (psf->datalength % pima->blocksize) - pima->blocks = psf->datalength / pima->blocksize + 1 ; - else - pima->blocks = psf->datalength / pima->blocksize ; - - switch (SF_CONTAINER (psf->sf.format)) - { case SF_FORMAT_WAV : - case SF_FORMAT_W64 : - count = 2 * (pima->blocksize - 4 * pima->channels) / pima->channels + 1 ; - - if (pima->samplesperblock != count) - { psf_log_printf (psf, "*** Error : samplesperblock should be %d.\n", count) ; - return SFE_INTERNAL ; - } ; - - pima->decode_block = wav_w64_ima_decode_block ; - - psf->sf.frames = pima->samplesperblock * pima->blocks ; - break ; - - case SF_FORMAT_AIFF : - psf_log_printf (psf, "still need to check block count\n") ; - pima->decode_block = aiff_ima_decode_block ; - psf->sf.frames = pima->samplesperblock * pima->blocks / pima->channels ; - break ; - - default : - psf_log_printf (psf, "ima_reader_init: bad psf->sf.format\n") ; - return SFE_INTERNAL ; - } ; - - pima->decode_block (psf, pima) ; /* Read first block. */ - - psf->read_short = ima_read_s ; - psf->read_int = ima_read_i ; - psf->read_float = ima_read_f ; - psf->read_double = ima_read_d ; - - return 0 ; -} /* ima_reader_init */ - -static int -aiff_ima_decode_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima) -{ unsigned char *blockdata ; - int chan, k, diff, bytecode, predictor ; - short step, stepindx, *sampledata ; - -static int count = 0 ; -count ++ ; - - pima->blockcount += pima->channels ; - pima->samplecount = 0 ; - - if (pima->blockcount > pima->blocks) - { memset (pima->samples, 0, pima->samplesperblock * pima->channels * sizeof (short)) ; - return 1 ; - } ; - - if ((k = psf_fread (pima->block, 1, pima->blocksize * pima->channels, psf)) != pima->blocksize * pima->channels) - psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, pima->blocksize) ; - - /* Read and check the block header. */ - for (chan = 0 ; chan < pima->channels ; chan++) - { blockdata = pima->block + chan * 34 ; - sampledata = pima->samples + chan ; - - predictor = (blockdata [0] << 8) | (blockdata [1] & 0x80) ; - - stepindx = blockdata [1] & 0x7F ; - stepindx = clamp_ima_step_index (stepindx) ; - - /* - ** Pull apart the packed 4 bit samples and store them in their - ** correct sample positions. - */ - for (k = 0 ; k < pima->blocksize - 2 ; k++) - { bytecode = blockdata [k + 2] ; - sampledata [pima->channels * (2 * k + 0)] = bytecode & 0xF ; - sampledata [pima->channels * (2 * k + 1)] = (bytecode >> 4) & 0xF ; - } ; - - /* Decode the encoded 4 bit samples. */ - for (k = 0 ; k < pima->samplesperblock ; k ++) - { step = ima_step_size [stepindx] ; - - bytecode = pima->samples [pima->channels * k + chan] ; - - stepindx += ima_indx_adjust [bytecode] ; - stepindx = clamp_ima_step_index (stepindx) ; - - diff = step >> 3 ; - if (bytecode & 1) diff += step >> 2 ; - if (bytecode & 2) diff += step >> 1 ; - if (bytecode & 4) diff += step ; - if (bytecode & 8) diff = -diff ; - - predictor += diff ; - if (predictor < -32768) - predictor = -32768 ; - else if (predictor > 32767) - predictor = 32767 ; - - pima->samples [pima->channels * k + chan] = predictor ; - } ; - } ; - - return 1 ; -} /* aiff_ima_decode_block */ - -static int -aiff_ima_encode_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima) -{ int chan, k, step, diff, vpdiff, blockindx, indx ; - short bytecode, mask ; - - /* Encode the block header. */ - for (chan = 0 ; chan < pima->channels ; chan ++) - { blockindx = chan * pima->blocksize ; - - pima->block [blockindx] = (pima->samples [chan] >> 8) & 0xFF ; - pima->block [blockindx + 1] = (pima->samples [chan] & 0x80) + (pima->stepindx [chan] & 0x7F) ; - - pima->previous [chan] = pima->samples [chan] ; - } ; - - /* Encode second and later samples for every block as a 4 bit value. */ - for (k = pima->channels ; k < (pima->samplesperblock * pima->channels) ; k ++) - { chan = (pima->channels > 1) ? (k % 2) : 0 ; - - diff = pima->samples [k] - pima->previous [chan] ; - - bytecode = 0 ; - step = ima_step_size [pima->stepindx [chan]] ; - vpdiff = step >> 3 ; - if (diff < 0) - { bytecode = 8 ; - diff = -diff ; - } ; - mask = 4 ; - while (mask) - { if (diff >= step) - { bytecode |= mask ; - diff -= step ; - vpdiff += step ; - } ; - step >>= 1 ; - mask >>= 1 ; - } ; - - if (bytecode & 8) - pima->previous [chan] -= vpdiff ; - else - pima->previous [chan] += vpdiff ; - - if (pima->previous [chan] > 32767) - pima->previous [chan] = 32767 ; - else if (pima->previous [chan] < -32768) - pima->previous [chan] = -32768 ; - - pima->stepindx [chan] += ima_indx_adjust [bytecode] ; - - pima->stepindx [chan] = clamp_ima_step_index (pima->stepindx [chan]) ; - pima->samples [k] = bytecode ; - } ; - - /* Pack the 4 bit encoded samples. */ - - for (chan = 0 ; chan < pima->channels ; chan ++) - { for (indx = pima->channels ; indx < pima->channels * pima->samplesperblock ; indx += 2 * pima->channels) - { blockindx = chan * pima->blocksize + 2 + indx / 2 ; - - pima->block [blockindx] = pima->samples [indx] & 0x0F ; - pima->block [blockindx] |= (pima->samples [indx + chan] << 4) & 0xF0 ; - } ; - } ; - - /* Write the block to disk. */ - - if ((k = psf_fwrite (pima->block, 1, pima->channels * pima->blocksize, psf)) != pima->channels * pima->blocksize) - psf_log_printf (psf, "*** Warning : short write (%d != %d).\n", k, pima->channels * pima->blocksize) ; - - memset (pima->samples, 0, pima->channels * pima->samplesperblock * sizeof (short)) ; - pima->samplecount = 0 ; - pima->blockcount ++ ; - - return 1 ; -} /* aiff_ima_encode_block */ - -static int -wav_w64_ima_decode_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima) -{ int chan, k, predictor, blockindx, indx, indxstart, diff ; - short step, bytecode, stepindx [2] ; - - pima->blockcount ++ ; - pima->samplecount = 0 ; - - if (pima->blockcount > pima->blocks) - { memset (pima->samples, 0, pima->samplesperblock * pima->channels * sizeof (short)) ; - return 1 ; - } ; - - if ((k = psf_fread (pima->block, 1, pima->blocksize, psf)) != pima->blocksize) - psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, pima->blocksize) ; - - /* Read and check the block header. */ - - for (chan = 0 ; chan < pima->channels ; chan++) - { predictor = pima->block [chan*4] | (pima->block [chan*4+1] << 8) ; - if (predictor & 0x8000) - predictor -= 0x10000 ; - - stepindx [chan] = pima->block [chan*4+2] ; - stepindx [chan] = clamp_ima_step_index (stepindx [chan]) ; - - - if (pima->block [chan*4+3] != 0) - psf_log_printf (psf, "IMA ADPCM synchronisation error.\n") ; - - pima->samples [chan] = predictor ; - } ; - - /* - ** Pull apart the packed 4 bit samples and store them in their - ** correct sample positions. - */ - - blockindx = 4 * pima->channels ; - - indxstart = pima->channels ; - while (blockindx < pima->blocksize) - { for (chan = 0 ; chan < pima->channels ; chan++) - { indx = indxstart + chan ; - for (k = 0 ; k < 4 ; k++) - { bytecode = pima->block [blockindx++] ; - pima->samples [indx] = bytecode & 0x0F ; - indx += pima->channels ; - pima->samples [indx] = (bytecode >> 4) & 0x0F ; - indx += pima->channels ; - } ; - } ; - indxstart += 8 * pima->channels ; - } ; - - /* Decode the encoded 4 bit samples. */ - - for (k = pima->channels ; k < (pima->samplesperblock * pima->channels) ; k ++) - { chan = (pima->channels > 1) ? (k % 2) : 0 ; - - bytecode = pima->samples [k] & 0xF ; - - step = ima_step_size [stepindx [chan]] ; - predictor = pima->samples [k - pima->channels] ; - - diff = step >> 3 ; - if (bytecode & 1) - diff += step >> 2 ; - if (bytecode & 2) - diff += step >> 1 ; - if (bytecode & 4) - diff += step ; - if (bytecode & 8) - diff = -diff ; - - predictor += diff ; - - if (predictor > 32767) - predictor = 32767 ; - else if (predictor < -32768) - predictor = -32768 ; - - stepindx [chan] += ima_indx_adjust [bytecode] ; - stepindx [chan] = clamp_ima_step_index (stepindx [chan]) ; - - pima->samples [k] = predictor ; - } ; - - return 1 ; -} /* wav_w64_ima_decode_block */ - -static int -wav_w64_ima_encode_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima) -{ int chan, k, step, diff, vpdiff, blockindx, indx, indxstart ; - short bytecode, mask ; - - /* Encode the block header. */ - for (chan = 0 ; chan < pima->channels ; chan++) - { pima->block [chan*4] = pima->samples [chan] & 0xFF ; - pima->block [chan*4+1] = (pima->samples [chan] >> 8) & 0xFF ; - - pima->block [chan*4+2] = pima->stepindx [chan] ; - pima->block [chan*4+3] = 0 ; - - pima->previous [chan] = pima->samples [chan] ; - } ; - - /* Encode the samples as 4 bit. */ - - for (k = pima->channels ; k < (pima->samplesperblock * pima->channels) ; k ++) - { chan = (pima->channels > 1) ? (k % 2) : 0 ; - - diff = pima->samples [k] - pima->previous [chan] ; - - bytecode = 0 ; - step = ima_step_size [pima->stepindx [chan]] ; - vpdiff = step >> 3 ; - if (diff < 0) - { bytecode = 8 ; - diff = -diff ; - } ; - mask = 4 ; - while (mask) - { if (diff >= step) - { bytecode |= mask ; - diff -= step ; - vpdiff += step ; - } ; - step >>= 1 ; - mask >>= 1 ; - } ; - - if (bytecode & 8) - pima->previous [chan] -= vpdiff ; - else - pima->previous [chan] += vpdiff ; - - if (pima->previous [chan] > 32767) - pima->previous [chan] = 32767 ; - else if (pima->previous [chan] < -32768) - pima->previous [chan] = -32768 ; - - pima->stepindx [chan] += ima_indx_adjust [bytecode] ; - pima->stepindx [chan] = clamp_ima_step_index (pima->stepindx [chan]) ; - - pima->samples [k] = bytecode ; - } ; - - /* Pack the 4 bit encoded samples. */ - - blockindx = 4 * pima->channels ; - - indxstart = pima->channels ; - while (blockindx < pima->blocksize) - { for (chan = 0 ; chan < pima->channels ; chan++) - { indx = indxstart + chan ; - for (k = 0 ; k < 4 ; k++) - { pima->block [blockindx] = pima->samples [indx] & 0x0F ; - indx += pima->channels ; - pima->block [blockindx] |= (pima->samples [indx] << 4) & 0xF0 ; - indx += pima->channels ; - blockindx ++ ; - } ; - } ; - indxstart += 8 * pima->channels ; - } ; - - /* Write the block to disk. */ - - if ((k = psf_fwrite (pima->block, 1, pima->blocksize, psf)) != pima->blocksize) - psf_log_printf (psf, "*** Warning : short write (%d != %d).\n", k, pima->blocksize) ; - - memset (pima->samples, 0, pima->samplesperblock * sizeof (short)) ; - pima->samplecount = 0 ; - pima->blockcount ++ ; - - return 1 ; -} /* wav_w64_ima_encode_block */ - -static int -ima_read_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima, short *ptr, int len) -{ int count, total = 0, indx = 0 ; - - while (indx < len) - { if (pima->blockcount >= pima->blocks && pima->samplecount >= pima->samplesperblock) - { memset (&(ptr [indx]), 0, (size_t) ((len - indx) * sizeof (short))) ; - return total ; - } ; - - if (pima->samplecount >= pima->samplesperblock) - pima->decode_block (psf, pima) ; - - count = (pima->samplesperblock - pima->samplecount) * pima->channels ; - count = (len - indx > count) ? count : len - indx ; - - memcpy (&(ptr [indx]), &(pima->samples [pima->samplecount * pima->channels]), count * sizeof (short)) ; - indx += count ; - pima->samplecount += count / pima->channels ; - total = indx ; - } ; - - return total ; -} /* ima_read_block */ - -static sf_count_t -ima_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ IMA_ADPCM_PRIVATE *pima ; - int readcount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pima = (IMA_ADPCM_PRIVATE*) psf->codec_data ; - - while (len > 0) - { readcount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = ima_read_block (psf, pima, ptr, readcount) ; - - total += count ; - len -= count ; - if (count != readcount) - break ; - } ; - - return total ; -} /* ima_read_s */ - -static sf_count_t -ima_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ IMA_ADPCM_PRIVATE *pima ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pima = (IMA_ADPCM_PRIVATE*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : (int) len ; - count = ima_read_block (psf, pima, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = ((int) sptr [k]) << 16 ; - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* ima_read_i */ - -static sf_count_t -ima_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ IMA_ADPCM_PRIVATE *pima ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - float normfact ; - - if (! psf->codec_data) - return 0 ; - pima = (IMA_ADPCM_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x8000) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : (int) len ; - count = ima_read_block (psf, pima, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * (float) (sptr [k]) ; - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* ima_read_f */ - -static sf_count_t -ima_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ IMA_ADPCM_PRIVATE *pima ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - double normfact ; - - if (! psf->codec_data) - return 0 ; - pima = (IMA_ADPCM_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x8000) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : (int) len ; - count = ima_read_block (psf, pima, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * (double) (sptr [k]) ; - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* ima_read_d */ - -static sf_count_t -ima_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) -{ IMA_ADPCM_PRIVATE *pima ; - int newblock, newsample ; - - if (! psf->codec_data) - return 0 ; - pima = (IMA_ADPCM_PRIVATE*) psf->codec_data ; - - if (psf->datalength < 0 || psf->dataoffset < 0) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - if (offset == 0) - { psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - pima->blockcount = 0 ; - pima->decode_block (psf, pima) ; - pima->samplecount = 0 ; - return 0 ; - } ; - - if (offset < 0 || offset > pima->blocks * pima->samplesperblock) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - newblock = offset / pima->samplesperblock ; - newsample = offset % pima->samplesperblock ; - - if (mode == SFM_READ) - { psf_fseek (psf, psf->dataoffset + newblock * pima->blocksize, SEEK_SET) ; - pima->blockcount = newblock ; - pima->decode_block (psf, pima) ; - pima->samplecount = newsample ; - } - else - { /* What to do about write??? */ - psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - return newblock * pima->samplesperblock + newsample ; -} /* ima_seek */ - -/*========================================================================================== -** IMA ADPCM Write Functions. -*/ - -static int -ima_writer_init (SF_PRIVATE *psf, int blockalign) -{ IMA_ADPCM_PRIVATE *pima ; - int samplesperblock ; - unsigned int pimasize ; - - if (psf->file.mode != SFM_WRITE) - return SFE_BAD_MODE_RW ; - - samplesperblock = 2 * (blockalign - 4 * psf->sf.channels) / psf->sf.channels + 1 ; - - pimasize = sizeof (IMA_ADPCM_PRIVATE) + blockalign + 3 * psf->sf.channels * samplesperblock ; - - if ((pima = calloc (1, pimasize)) == NULL) - return SFE_MALLOC_FAILED ; - - psf->codec_data = (void*) pima ; - - pima->channels = psf->sf.channels ; - pima->blocksize = blockalign ; - pima->samplesperblock = samplesperblock ; - - pima->block = (unsigned char*) pima->data ; - pima->samples = (short*) (pima->data + blockalign) ; - - pima->samplecount = 0 ; - - switch (SF_CONTAINER (psf->sf.format)) - { case SF_FORMAT_WAV : - case SF_FORMAT_W64 : - pima->encode_block = wav_w64_ima_encode_block ; - break ; - - case SF_FORMAT_AIFF : - pima->encode_block = aiff_ima_encode_block ; - break ; - - default : - psf_log_printf (psf, "ima_reader_init: bad psf->sf.format\n") ; - return SFE_INTERNAL ; - } ; - - psf->write_short = ima_write_s ; - psf->write_int = ima_write_i ; - psf->write_float = ima_write_f ; - psf->write_double = ima_write_d ; - - return 0 ; -} /* ima_writer_init */ - -/*========================================================================================== -*/ - -static int -ima_write_block (SF_PRIVATE *psf, IMA_ADPCM_PRIVATE *pima, const short *ptr, int len) -{ int count, total = 0, indx = 0 ; - - while (indx < len) - { count = (pima->samplesperblock - pima->samplecount) * pima->channels ; - - if (count > len - indx) - count = len - indx ; - - memcpy (&(pima->samples [pima->samplecount * pima->channels]), &(ptr [total]), count * sizeof (short)) ; - indx += count ; - pima->samplecount += count / pima->channels ; - total = indx ; - - if (pima->samplecount >= pima->samplesperblock) - pima->encode_block (psf, pima) ; - } ; - - return total ; -} /* ima_write_block */ - -static sf_count_t -ima_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ IMA_ADPCM_PRIVATE *pima ; - int writecount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pima = (IMA_ADPCM_PRIVATE*) psf->codec_data ; - - while (len) - { writecount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = ima_write_block (psf, pima, ptr, writecount) ; - - total += count ; - len -= count ; - if (count != writecount) - break ; - } ; - - return total ; -} /* ima_write_s */ - -static sf_count_t -ima_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ IMA_ADPCM_PRIVATE *pima ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pima = (IMA_ADPCM_PRIVATE*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = ptr [total + k] >> 16 ; - count = ima_write_block (psf, pima, sptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* ima_write_i */ - -static sf_count_t -ima_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ IMA_ADPCM_PRIVATE *pima ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - float normfact ; - - if (! psf->codec_data) - return 0 ; - pima = (IMA_ADPCM_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? (1.0 * 0x7FFF) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = lrintf (normfact * ptr [total + k]) ; - count = ima_write_block (psf, pima, sptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* ima_write_f */ - -static sf_count_t -ima_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ IMA_ADPCM_PRIVATE *pima ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - double normfact ; - - if (! psf->codec_data) - return 0 ; - pima = (IMA_ADPCM_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_double == SF_TRUE) ? (1.0 * 0x7FFF) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = lrint (normfact * ptr [total + k]) ; - count = ima_write_block (psf, pima, sptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* ima_write_d */ - diff --git a/libs/libsndfile/src/ima_oki_adpcm.c b/libs/libsndfile/src/ima_oki_adpcm.c deleted file mode 100644 index 26db9f65fb..0000000000 --- a/libs/libsndfile/src/ima_oki_adpcm.c +++ /dev/null @@ -1,297 +0,0 @@ -/* -** Copyright (C) 2007-2012 Erik de Castro Lopo -** Copyright (c) 2007 -** -** This library is free software; you can redistribute it and/or modify it -** under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2 of the License, or (at -** your option) any later version. -** -** This library 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 Lesser -** General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this library. If not, write to the Free Software Foundation, -** Fifth Floor, 51 Franklin Street, Boston, MA 02111-1301, USA. -*/ - -/* ADPCM: IMA, OKI <==> 16-bit PCM. */ - -#include "sfconfig.h" - -#include - -/* Set up for libsndfile environment: */ -#include "common.h" - -#include "ima_oki_adpcm.h" - -#define MIN_SAMPLE -0x8000 -#define MAX_SAMPLE 0x7fff - -static int const ima_steps [] = /* ~16-bit precision */ -{ 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, - 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, - 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, - 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, - 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493, 10442, - 11487, 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, - 32767 -} ; - -static int const oki_steps [] = /* ~12-bit precision */ -{ 256, 272, 304, 336, 368, 400, 448, 496, 544, 592, 656, 720, 800, 880, 960, - 1056, 1168, 1280, 1408, 1552, 1712, 1888, 2080, 2288, 2512, 2768, 3040, 3344, - 3680, 4048, 4464, 4912, 5392, 5936, 6528, 7184, 7904, 8704, 9568, 10528, - 11584, 12736, 14016, 15408, 16960, 18656, 20512, 22576, 24832 -} ; - -static int const step_changes [] = { -1, -1, -1, -1, 2, 4, 6, 8 } ; - -void -ima_oki_adpcm_init (IMA_OKI_ADPCM * state, IMA_OKI_ADPCM_TYPE type) -{ - memset (state, 0, sizeof (*state)) ; - - if (type == IMA_OKI_ADPCM_TYPE_IMA) - { state->max_step_index = ARRAY_LEN (ima_steps) - 1 ; - state->steps = ima_steps ; - state->mask = (~0) ; - } - else - { state->max_step_index = ARRAY_LEN (oki_steps) - 1 ; - state->steps = oki_steps ; - state->mask = (~0) << 4 ; - } ; - -} /* ima_oki_adpcm_init */ - - -int -adpcm_decode (IMA_OKI_ADPCM * state, int code) -{ int s ; - - s = ((code & 7) << 1) | 1 ; - s = ((state->steps [state->step_index] * s) >> 3) & state->mask ; - - if (code & 8) - s = -s ; - s += state->last_output ; - - if (s < MIN_SAMPLE || s > MAX_SAMPLE) - { int grace ; - - grace = (state->steps [state->step_index] >> 3) & state->mask ; - - if (s < MIN_SAMPLE - grace || s > MAX_SAMPLE + grace) - state->errors ++ ; - - s = s < MIN_SAMPLE ? MIN_SAMPLE : MAX_SAMPLE ; - } ; - - state->step_index += step_changes [code & 7] ; - state->step_index = SF_MIN (SF_MAX (state->step_index, 0), state->max_step_index) ; - state->last_output = s ; - - return s ; -} /* adpcm_decode */ - -int -adpcm_encode (IMA_OKI_ADPCM * state, int sample) -{ int delta, sign = 0, code ; - - delta = sample - state->last_output ; - - if (delta < 0) - { sign = 8 ; - delta = -delta ; - } ; - - code = 4 * delta / state->steps [state->step_index] ; - code = sign | SF_MIN (code, 7) ; - adpcm_decode (state, code) ; /* Update encoder state */ - - return code ; -} /* adpcm_encode */ - - -void -ima_oki_adpcm_decode_block (IMA_OKI_ADPCM * state) -{ unsigned char code ; - int k ; - - for (k = 0 ; k < state->code_count ; k++) - { code = state->codes [k] ; - state->pcm [2 * k] = adpcm_decode (state, code >> 4) ; - state->pcm [2 * k + 1] = adpcm_decode (state, code) ; - } ; - - state->pcm_count = 2 * k ; -} /* ima_oki_adpcm_decode_block */ - - -void -ima_oki_adpcm_encode_block (IMA_OKI_ADPCM * state) -{ unsigned char code ; - int k ; - - /* - ** The codec expects an even number of input samples. - ** - ** Samples should always be passed in even length blocks. If the last block to - ** be encoded is odd length, extend that block by one zero valued sample. - */ - if (state->pcm_count % 2 == 1) - state->pcm [state->pcm_count ++] = 0 ; - - for (k = 0 ; k < state->pcm_count / 2 ; k++) - { code = adpcm_encode (state, state->pcm [2 * k]) << 4 ; - code |= adpcm_encode (state, state->pcm [2 * k + 1]) ; - state->codes [k] = code ; - } ; - - state->code_count = k ; -} /* ima_oki_adpcm_encode_block */ - - -#ifdef TEST - -static const unsigned char test_codes [] = -{ 0x08, 0x08, 0x04, 0x7f, 0x72, 0xf7, 0x9f, 0x7c, 0xd7, 0xbc, 0x7a, 0xa7, 0xb8, - 0x4b, 0x0b, 0x38, 0xf6, 0x9d, 0x7a, 0xd7, 0xbc, 0x7a, 0xd7, 0xa8, 0x6c, 0x81, - 0x98, 0xe4, 0x0e, 0x7a, 0xd7, 0x9e, 0x7b, 0xc7, 0xab, 0x7a, 0x85, 0xc0, 0xb3, - 0x8f, 0x58, 0xd7, 0xad, 0x7a, 0xd7, 0xad, 0x7a, 0x87, 0xd0, 0x2b, 0x0e, 0x48, - 0xd7, 0xad, 0x78, 0xf7, 0xbc, 0x7a, 0xb7, 0xa8, 0x4b, 0x88, 0x18, 0xd5, 0x8d, - 0x6a, 0xa4, 0x98, 0x08, 0x00, 0x80, 0x88, -} ; - -static const short test_pcm [] = -{ 32, 0, 32, 0, 32, 320, 880, -336, 2304, 4192, -992, 10128, 5360, -16352, - 30208, 2272, -31872, 14688, -7040, -32432, 14128, -1392, -15488, 22960, - 1232, -1584, 21488, -240, 2576, -15360, 960, -1152, -30032, 10320, 1008, - -30032, 16528, 1008, -30032, 16528, -5200, -30592, 15968, 448, -30592, - 15968, 448, -2368, 30960, 3024, -80, 8384, 704, -1616, -29168, -1232, 1872, - -32768, 13792, -1728, -32768, 13792, 4480, -32192, 14368, -7360, -32752, - 13808, -1712, -21456, 16992, 1472, -1344, 26848, -1088, 2016, -17728, 208, - -2112, -32768, 1376, -1728, -32768, 13792, -1728, -32768, 13792, -1728, - -32768, 13792, -1728, -32768, 13792, -1728, -4544, 32767, -1377, 1727, - 15823, -2113, 207, -27345, 591, -2513, -32768, 13792, -1728, -32768, 13792, - 10688, -31632, 14928, -6800, -32192, 14368, -1152, -20896, 17552, 2032, - -784, 22288, 560, -2256, -4816, 2176, 64, -21120, 9920, 6816, -24224, 16128, - 608, -13488, 9584, 272, -2544, 16, -2304, -192, 1728, -16, 1568, 128, -1184, -} ; - - -static void -test_oki_adpcm (void) -{ - IMA_OKI_ADPCM adpcm ; - unsigned char code ; - int i, j ; - - printf (" Testing encoder : ") ; - fflush (stdout) ; - - ima_oki_adpcm_init (&adpcm, IMA_OKI_ADPCM_TYPE_OKI) ; - for (i = 0 ; i < ARRAY_LEN (test_codes) ; i++) - for (j = 0, code = test_codes [i] ; j < 2 ; j++, code <<= 4) - if (adpcm_decode (&adpcm, code >> 4) != test_pcm [2 * i + j]) - { printf ("\n\nFail at i = %d, j = %d.\n\n", i, j) ; - exit (1) ; - } ; - - puts ("ok") ; - - printf (" Testing decoder : ") ; - fflush (stdout) ; - - ima_oki_adpcm_init (&adpcm, IMA_OKI_ADPCM_TYPE_OKI) ; - for (i = 0 ; i < ARRAY_LEN (test_pcm) ; i += j) - { code = adpcm_encode (&adpcm, test_pcm [i]) ; - code = (code << 4) | adpcm_encode (&adpcm, test_pcm [i + 1]) ; - if (code != test_codes [i / 2]) - { printf ("\n\nFail at i = %d, %d should be %d\n\n", i, code, test_codes [i / 2]) ; - exit (1) ; - } ; - } ; - - puts ("ok") ; -} /* test_oki_adpcm */ - -static void -test_oki_adpcm_block (void) -{ - IMA_OKI_ADPCM adpcm ; - int k ; - - if (ARRAY_LEN (adpcm.pcm) < ARRAY_LEN (test_pcm)) - { printf ("\n\nLine %d : ARRAY_LEN (adpcm->pcm) > ARRAY_LEN (test_pcm) (%d > %d).\n\n", __LINE__, ARRAY_LEN (adpcm.pcm), ARRAY_LEN (test_pcm)) ; - exit (1) ; - } ; - - if (ARRAY_LEN (adpcm.codes) < ARRAY_LEN (test_codes)) - { printf ("\n\nLine %d : ARRAY_LEN (adcodes->codes) > ARRAY_LEN (test_codes).n", __LINE__) ; - exit (1) ; - } ; - - printf (" Testing block encoder : ") ; - fflush (stdout) ; - - ima_oki_adpcm_init (&adpcm, IMA_OKI_ADPCM_TYPE_OKI) ; - - memcpy (adpcm.pcm, test_pcm, sizeof (adpcm.pcm [0]) * ARRAY_LEN (test_pcm)) ; - adpcm.pcm_count = ARRAY_LEN (test_pcm) ; - adpcm.code_count = 13 ; - - ima_oki_adpcm_encode_block (&adpcm) ; - - if (adpcm.code_count * 2 != ARRAY_LEN (test_pcm)) - { printf ("\n\nLine %d : %d * 2 != %d\n\n", __LINE__, adpcm.code_count * 2, ARRAY_LEN (test_pcm)) ; - exit (1) ; - } ; - - for (k = 0 ; k < ARRAY_LEN (test_codes) ; k++) - if (adpcm.codes [k] != test_codes [k]) - { printf ("\n\nLine %d : Fail at k = %d, %d should be %d\n\n", __LINE__, k, adpcm.codes [k], test_codes [k]) ; - exit (1) ; - } ; - - puts ("ok") ; - - printf (" Testing block decoder : ") ; - fflush (stdout) ; - - ima_oki_adpcm_init (&adpcm, IMA_OKI_ADPCM_TYPE_OKI) ; - - memcpy (adpcm.codes, test_codes, sizeof (adpcm.codes [0]) * ARRAY_LEN (test_codes)) ; - adpcm.code_count = ARRAY_LEN (test_codes) ; - adpcm.pcm_count = 13 ; - - ima_oki_adpcm_decode_block (&adpcm) ; - - if (adpcm.pcm_count != 2 * ARRAY_LEN (test_codes)) - { printf ("\n\nLine %d : %d * 2 != %d\n\n", __LINE__, adpcm.pcm_count, 2 * ARRAY_LEN (test_codes)) ; - exit (1) ; - } ; - - for (k = 0 ; k < ARRAY_LEN (test_pcm) ; k++) - if (adpcm.pcm [k] != test_pcm [k]) - { printf ("\n\nLine %d : Fail at i = %d, %d should be %d.\n\n", __LINE__, k, adpcm.pcm [k], test_pcm [k]) ; - exit (1) ; - } ; - - puts ("ok") ; -} /* test_oki_adpcm_block */ - -int -main (void) -{ - test_oki_adpcm () ; - test_oki_adpcm_block () ; - - return 0 ; -} /* main */ - -#endif diff --git a/libs/libsndfile/src/ima_oki_adpcm.h b/libs/libsndfile/src/ima_oki_adpcm.h deleted file mode 100644 index 86241e7a2c..0000000000 --- a/libs/libsndfile/src/ima_oki_adpcm.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -** Copyright (C) 2007-2011 Erik de Castro Lopo -** Copyright (c) 2007 -** -** This library is free software; you can redistribute it and/or modify it -** under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2 of the License, or (at -** your option) any later version. -** -** This library 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 Lesser -** General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this library. If not, write to the Free Software Foundation, -** Fifth Floor, 51 Franklin Street, Boston, MA 02111-1301, USA. -*/ - -/* ADPCM: IMA, OKI <==> 16-bit PCM. */ - - -#define IMA_OKI_ADPCM_CODE_LEN 256 -#define IMA_OKI_ADPCM_PCM_LEN (IMA_OKI_ADPCM_CODE_LEN *2) - -typedef struct -{ - /* private: */ - int mask ; - int last_output ; - int step_index ; - int max_step_index ; - int const * steps ; - - /* public: */ - int errors ; - int code_count, pcm_count ; - - unsigned char codes [IMA_OKI_ADPCM_CODE_LEN] ; - short pcm [IMA_OKI_ADPCM_PCM_LEN] ; -} IMA_OKI_ADPCM ; - -typedef enum -{ IMA_OKI_ADPCM_TYPE_IMA, - IMA_OKI_ADPCM_TYPE_OKI -} IMA_OKI_ADPCM_TYPE ; - -void ima_oki_adpcm_init (IMA_OKI_ADPCM * state, IMA_OKI_ADPCM_TYPE type) ; - -int adpcm_decode (IMA_OKI_ADPCM * state, int /* 0..15 */ code) ; -int adpcm_encode (IMA_OKI_ADPCM * state, int /* -32768..32767 */ sample) ; - -void ima_oki_adpcm_decode_block (IMA_OKI_ADPCM * state) ; -void ima_oki_adpcm_encode_block (IMA_OKI_ADPCM * state) ; diff --git a/libs/libsndfile/src/interleave.c b/libs/libsndfile/src/interleave.c deleted file mode 100644 index 5f799444c6..0000000000 --- a/libs/libsndfile/src/interleave.c +++ /dev/null @@ -1,299 +0,0 @@ -/* -** Copyright (C) 2002-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfendian.h" - -#include - -#include "sndfile.h" -#include "common.h" - -#define INTERLEAVE_CHANNELS 6 - -typedef struct -{ double buffer [SF_BUFFER_LEN / sizeof (double)] ; - - sf_count_t channel_len ; - - sf_count_t (*read_short) (SF_PRIVATE*, short *ptr, sf_count_t len) ; - sf_count_t (*read_int) (SF_PRIVATE*, int *ptr, sf_count_t len) ; - sf_count_t (*read_float) (SF_PRIVATE*, float *ptr, sf_count_t len) ; - sf_count_t (*read_double) (SF_PRIVATE*, double *ptr, sf_count_t len) ; - -} INTERLEAVE_DATA ; - - - -static sf_count_t interleave_read_short (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t interleave_read_int (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t interleave_read_float (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t interleave_read_double (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t interleave_seek (SF_PRIVATE*, int mode, sf_count_t samples_from_start) ; - - - - -int -interleave_init (SF_PRIVATE *psf) -{ INTERLEAVE_DATA *pdata ; - - if (psf->file.mode != SFM_READ) - return SFE_INTERLEAVE_MODE ; - - if (psf->interleave) - { psf_log_printf (psf, "*** Weird, already have interleave.\n") ; - return 666 ; - } ; - - /* Free this in sf_close() function. */ - if (! (pdata = malloc (sizeof (INTERLEAVE_DATA)))) - return SFE_MALLOC_FAILED ; - -puts ("interleave_init") ; - - psf->interleave = pdata ; - - /* Save the existing methods. */ - pdata->read_short = psf->read_short ; - pdata->read_int = psf->read_int ; - pdata->read_float = psf->read_float ; - pdata->read_double = psf->read_double ; - - pdata->channel_len = psf->sf.frames * psf->bytewidth ; - - /* Insert our new methods. */ - psf->read_short = interleave_read_short ; - psf->read_int = interleave_read_int ; - psf->read_float = interleave_read_float ; - psf->read_double = interleave_read_double ; - - psf->seek = interleave_seek ; - - return 0 ; -} /* pcm_interleave_init */ - -/*------------------------------------------------------------------------------ -*/ - -static sf_count_t -interleave_read_short (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ INTERLEAVE_DATA *pdata ; - sf_count_t offset, templen ; - int chan, count, k ; - short *inptr, *outptr ; - - if (! (pdata = psf->interleave)) - return 0 ; - - inptr = (short*) pdata->buffer ; - - for (chan = 0 ; chan < psf->sf.channels ; chan++) - { outptr = ptr + chan ; - - offset = psf->dataoffset + chan * psf->bytewidth * psf->read_current ; - - if (psf_fseek (psf, offset, SEEK_SET) != offset) - { psf->error = SFE_INTERLEAVE_SEEK ; - return 0 ; - } ; - - templen = len / psf->sf.channels ; - - while (templen > 0) - { if (templen > SIGNED_SIZEOF (pdata->buffer) / SIGNED_SIZEOF (short)) - count = SIGNED_SIZEOF (pdata->buffer) / SIGNED_SIZEOF (short) ; - else - count = (int) templen ; - - if (pdata->read_short (psf, inptr, count) != count) - { psf->error = SFE_INTERLEAVE_READ ; - return 0 ; - } ; - - for (k = 0 ; k < count ; k++) - { *outptr = inptr [k] ; - outptr += psf->sf.channels ; - } ; - - templen -= count ; - } ; - } ; - - return len ; -} /* interleave_read_short */ - -static sf_count_t -interleave_read_int (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ INTERLEAVE_DATA *pdata ; - sf_count_t offset, templen ; - int chan, count, k ; - int *inptr, *outptr ; - - if (! (pdata = psf->interleave)) - return 0 ; - - inptr = (int*) pdata->buffer ; - - for (chan = 0 ; chan < psf->sf.channels ; chan++) - { outptr = ptr + chan ; - - offset = psf->dataoffset + chan * psf->bytewidth * psf->read_current ; - - if (psf_fseek (psf, offset, SEEK_SET) != offset) - { psf->error = SFE_INTERLEAVE_SEEK ; - return 0 ; - } ; - - templen = len / psf->sf.channels ; - - while (templen > 0) - { if (templen > SIGNED_SIZEOF (pdata->buffer) / SIGNED_SIZEOF (int)) - count = SIGNED_SIZEOF (pdata->buffer) / SIGNED_SIZEOF (int) ; - else - count = (int) templen ; - - if (pdata->read_int (psf, inptr, count) != count) - { psf->error = SFE_INTERLEAVE_READ ; - return 0 ; - } ; - - for (k = 0 ; k < count ; k++) - { *outptr = inptr [k] ; - outptr += psf->sf.channels ; - } ; - - templen -= count ; - } ; - } ; - - return len ; -} /* interleave_read_int */ - -static sf_count_t -interleave_read_float (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ INTERLEAVE_DATA *pdata ; - sf_count_t offset, templen ; - int chan, count, k ; - float *inptr, *outptr ; - - if (! (pdata = psf->interleave)) - return 0 ; - - inptr = (float*) pdata->buffer ; - - for (chan = 0 ; chan < psf->sf.channels ; chan++) - { outptr = ptr + chan ; - - offset = psf->dataoffset + pdata->channel_len * chan + psf->read_current * psf->bytewidth ; - -/*-printf ("chan : %d read_current : %6lld offset : %6lld\n", chan, psf->read_current, offset) ;-*/ - - if (psf_fseek (psf, offset, SEEK_SET) != offset) - { psf->error = SFE_INTERLEAVE_SEEK ; -/*-puts ("interleave_seek error") ; exit (1) ;-*/ - return 0 ; - } ; - - templen = len / psf->sf.channels ; - - while (templen > 0) - { if (templen > SIGNED_SIZEOF (pdata->buffer) / SIGNED_SIZEOF (float)) - count = SIGNED_SIZEOF (pdata->buffer) / SIGNED_SIZEOF (float) ; - else - count = (int) templen ; - - if (pdata->read_float (psf, inptr, count) != count) - { psf->error = SFE_INTERLEAVE_READ ; -/*-puts ("interleave_read error") ; exit (1) ;-*/ - return 0 ; - } ; - - for (k = 0 ; k < count ; k++) - { *outptr = inptr [k] ; - outptr += psf->sf.channels ; - } ; - - templen -= count ; - } ; - } ; - - return len ; -} /* interleave_read_float */ - -static sf_count_t -interleave_read_double (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ INTERLEAVE_DATA *pdata ; - sf_count_t offset, templen ; - int chan, count, k ; - double *inptr, *outptr ; - - if (! (pdata = psf->interleave)) - return 0 ; - - inptr = (double*) pdata->buffer ; - - for (chan = 0 ; chan < psf->sf.channels ; chan++) - { outptr = ptr + chan ; - - offset = psf->dataoffset + chan * psf->bytewidth * psf->read_current ; - - if (psf_fseek (psf, offset, SEEK_SET) != offset) - { psf->error = SFE_INTERLEAVE_SEEK ; - return 0 ; - } ; - - templen = len / psf->sf.channels ; - - while (templen > 0) - { if (templen > SIGNED_SIZEOF (pdata->buffer) / SIGNED_SIZEOF (double)) - count = SIGNED_SIZEOF (pdata->buffer) / SIGNED_SIZEOF (double) ; - else - count = (int) templen ; - - if (pdata->read_double (psf, inptr, count) != count) - { psf->error = SFE_INTERLEAVE_READ ; - return 0 ; - } ; - - for (k = 0 ; k < count ; k++) - { *outptr = inptr [k] ; - outptr += psf->sf.channels ; - } ; - - templen -= count ; - } ; - } ; - - return len ; -} /* interleave_read_double */ - -/*------------------------------------------------------------------------------ -*/ - -static sf_count_t -interleave_seek (SF_PRIVATE * UNUSED (psf), int UNUSED (mode), sf_count_t samples_from_start) -{ - /* - ** Do nothing here. This is a place holder to prevent the default - ** seek function from being called. - */ - - return samples_from_start ; -} /* interleave_seek */ - diff --git a/libs/libsndfile/src/ircam.c b/libs/libsndfile/src/ircam.c deleted file mode 100644 index 6a6c7fc606..0000000000 --- a/libs/libsndfile/src/ircam.c +++ /dev/null @@ -1,323 +0,0 @@ -/* -** Copyright (C) 2001-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues. -*/ - -/* The IRCAM magic number is weird in that one byte in the number can have -** values of 0x1, 0x2, 0x03 or 0x04. Hence the need for a marker and a mask. -*/ - -#define IRCAM_BE_MASK (MAKE_MARKER (0xFF, 0xFF, 0x00, 0xFF)) -#define IRCAM_BE_MARKER (MAKE_MARKER (0x64, 0xA3, 0x00, 0x00)) - -#define IRCAM_LE_MASK (MAKE_MARKER (0xFF, 0x00, 0xFF, 0xFF)) -#define IRCAM_LE_MARKER (MAKE_MARKER (0x00, 0x00, 0xA3, 0x64)) - -#define IRCAM_02B_MARKER (MAKE_MARKER (0x64, 0xA3, 0x02, 0x00)) -#define IRCAM_03L_MARKER (MAKE_MARKER (0x64, 0xA3, 0x03, 0x00)) - -#define IRCAM_DATA_OFFSET (1024) - -/*------------------------------------------------------------------------------ -** Typedefs. -*/ - -enum -{ IRCAM_PCM_16 = 0x00002, - IRCAM_FLOAT = 0x00004, - IRCAM_ALAW = 0x10001, - IRCAM_ULAW = 0x20001, - IRCAM_PCM_32 = 0x40004 -} ; - - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int ircam_close (SF_PRIVATE *psf) ; -static int ircam_write_header (SF_PRIVATE *psf, int calc_length) ; -static int ircam_read_header (SF_PRIVATE *psf) ; - -static int get_encoding (int subformat) ; - -static const char* get_encoding_str (int encoding) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -ircam_open (SF_PRIVATE *psf) -{ int subformat ; - int error = SFE_NO_ERROR ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = ircam_read_header (psf))) - return error ; - } ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_IRCAM) - return SFE_BAD_OPEN_FORMAT ; - - psf->endian = SF_ENDIAN (psf->sf.format) ; - if (psf->endian == 0 || psf->endian == SF_ENDIAN_CPU) - psf->endian = (CPU_IS_BIG_ENDIAN) ? SF_ENDIAN_BIG : SF_ENDIAN_LITTLE ; - - psf->dataoffset = IRCAM_DATA_OFFSET ; - - if ((error = ircam_write_header (psf, SF_FALSE))) - return error ; - - psf->write_header = ircam_write_header ; - } ; - - psf->container_close = ircam_close ; - - switch (subformat) - { case SF_FORMAT_ULAW : /* 8-bit Ulaw encoding. */ - error = ulaw_init (psf) ; - break ; - - case SF_FORMAT_ALAW : /* 8-bit Alaw encoding. */ - error = alaw_init (psf) ; - break ; - - case SF_FORMAT_PCM_16 : /* 16-bit linear PCM. */ - case SF_FORMAT_PCM_32 : /* 32-bit linear PCM. */ - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_FLOAT : /* 32-bit linear PCM. */ - error = float32_init (psf) ; - break ; - - default : break ; - } ; - - return error ; -} /* ircam_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -ircam_read_header (SF_PRIVATE *psf) -{ unsigned int marker, encoding ; - float samplerate ; - int error = SFE_NO_ERROR ; - - psf_binheader_readf (psf, "epmf44", 0, &marker, &samplerate, &(psf->sf.channels), &encoding) ; - - if (((marker & IRCAM_BE_MASK) != IRCAM_BE_MARKER) && ((marker & IRCAM_LE_MASK) != IRCAM_LE_MARKER)) - { psf_log_printf (psf, "marker: 0x%X\n", marker) ; - return SFE_IRCAM_NO_MARKER ; - } ; - - psf->endian = SF_ENDIAN_LITTLE ; - - if (psf->sf.channels > 256) - { psf_binheader_readf (psf, "Epmf44", 0, &marker, &samplerate, &(psf->sf.channels), &encoding) ; - - /* Sanity checking for endian-ness detection. */ - if (psf->sf.channels > 256) - { psf_log_printf (psf, "marker: 0x%X\n", marker) ; - return SFE_IRCAM_BAD_CHANNELS ; - } ; - - psf->endian = SF_ENDIAN_BIG ; - } ; - - psf_log_printf (psf, "marker: 0x%X\n", marker) ; - - psf->sf.samplerate = (int) samplerate ; - - psf_log_printf (psf, " Sample Rate : %d\n" - " Channels : %d\n" - " Encoding : %X => %s\n", - psf->sf.samplerate, psf->sf.channels, encoding, get_encoding_str (encoding)) ; - - switch (encoding) - { case IRCAM_PCM_16 : - psf->bytewidth = 2 ; - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - - psf->sf.format = SF_FORMAT_IRCAM | SF_FORMAT_PCM_16 ; - break ; - - case IRCAM_PCM_32 : - psf->bytewidth = 4 ; - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - - psf->sf.format = SF_FORMAT_IRCAM | SF_FORMAT_PCM_32 ; - break ; - - case IRCAM_FLOAT : - psf->bytewidth = 4 ; - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - - psf->sf.format = SF_FORMAT_IRCAM | SF_FORMAT_FLOAT ; - break ; - - case IRCAM_ALAW : - psf->bytewidth = 1 ; - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - - psf->sf.format = SF_FORMAT_IRCAM | SF_FORMAT_ALAW ; - break ; - - case IRCAM_ULAW : - psf->bytewidth = 1 ; - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - - psf->sf.format = SF_FORMAT_IRCAM | SF_FORMAT_ULAW ; - break ; - - default : - error = SFE_IRCAM_UNKNOWN_FORMAT ; - break ; - } ; - - if (psf->endian == SF_ENDIAN_BIG) - psf->sf.format |= SF_ENDIAN_BIG ; - else - psf->sf.format |= SF_ENDIAN_LITTLE ; - - if (error) - return error ; - - psf->dataoffset = IRCAM_DATA_OFFSET ; - psf->datalength = psf->filelength - psf->dataoffset ; - - if (psf->sf.frames == 0 && psf->blockwidth) - psf->sf.frames = psf->datalength / psf->blockwidth ; - - psf_log_printf (psf, " Samples : %d\n", psf->sf.frames) ; - - psf_binheader_readf (psf, "p", IRCAM_DATA_OFFSET) ; - - return 0 ; -} /* ircam_read_header */ - -static int -ircam_close (SF_PRIVATE *psf) -{ - psf_log_printf (psf, "close\n") ; - - return 0 ; -} /* ircam_close */ - -static int -ircam_write_header (SF_PRIVATE *psf, int UNUSED (calc_length)) -{ int encoding ; - float samplerate ; - sf_count_t current ; - - if (psf->pipeoffset > 0) - return 0 ; - - current = psf_ftell (psf) ; - - /* This also sets psf->endian. */ - encoding = get_encoding (SF_CODEC (psf->sf.format)) ; - - if (encoding == 0) - return SFE_BAD_OPEN_FORMAT ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - - if (psf->is_pipe == SF_FALSE) - psf_fseek (psf, 0, SEEK_SET) ; - - samplerate = psf->sf.samplerate ; - - switch (psf->endian) - { case SF_ENDIAN_BIG : - psf_binheader_writef (psf, "Emf", IRCAM_02B_MARKER, samplerate) ; - psf_binheader_writef (psf, "E44", psf->sf.channels, encoding) ; - break ; - - case SF_ENDIAN_LITTLE : - psf_binheader_writef (psf, "emf", IRCAM_03L_MARKER, samplerate) ; - psf_binheader_writef (psf, "e44", psf->sf.channels, encoding) ; - break ; - - default : return SFE_BAD_OPEN_FORMAT ; - } ; - - psf_binheader_writef (psf, "z", (size_t) (IRCAM_DATA_OFFSET - psf->headindex)) ; - - /* Header construction complete so write it out. */ - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* ircam_write_header */ - -static int -get_encoding (int subformat) -{ switch (subformat) - { case SF_FORMAT_PCM_16 : return IRCAM_PCM_16 ; - case SF_FORMAT_PCM_32 : return IRCAM_PCM_32 ; - - case SF_FORMAT_FLOAT : return IRCAM_FLOAT ; - - case SF_FORMAT_ULAW : return IRCAM_ULAW ; - case SF_FORMAT_ALAW : return IRCAM_ALAW ; - - default : break ; - } ; - - return 0 ; -} /* get_encoding */ - -static const char* -get_encoding_str (int encoding) -{ switch (encoding) - { case IRCAM_PCM_16 : return "16 bit PCM" ; - case IRCAM_FLOAT : return "32 bit float" ; - case IRCAM_ALAW : return "A law" ; - case IRCAM_ULAW : return "u law" ; - case IRCAM_PCM_32 : return "32 bit PCM" ; - } ; - return "Unknown encoding" ; -} /* get_encoding_str */ - diff --git a/libs/libsndfile/src/libsndfile-1.def b/libs/libsndfile/src/libsndfile-1.def deleted file mode 100644 index 93cab02d98..0000000000 --- a/libs/libsndfile/src/libsndfile-1.def +++ /dev/null @@ -1,41 +0,0 @@ -; Auto-generated by create_symbols_file.py - -LIBRARY libsndfile-1.dll -EXPORTS - -sf_command @1 -sf_open @2 -sf_close @3 -sf_seek @4 -sf_error @7 -sf_perror @8 -sf_error_str @9 -sf_error_number @10 -sf_format_check @11 -sf_read_raw @16 -sf_readf_short @17 -sf_readf_int @18 -sf_readf_float @19 -sf_readf_double @20 -sf_read_short @21 -sf_read_int @22 -sf_read_float @23 -sf_read_double @24 -sf_write_raw @32 -sf_writef_short @33 -sf_writef_int @34 -sf_writef_float @35 -sf_writef_double @36 -sf_write_short @37 -sf_write_int @38 -sf_write_float @39 -sf_write_double @40 -sf_strerror @50 -sf_get_string @60 -sf_set_string @61 -sf_version_string @68 -sf_open_fd @70 -sf_wchar_open @71 -sf_open_virtual @80 -sf_write_sync @90 - diff --git a/libs/libsndfile/src/libsndfile.def b/libs/libsndfile/src/libsndfile.def deleted file mode 100644 index 7b144538fc..0000000000 --- a/libs/libsndfile/src/libsndfile.def +++ /dev/null @@ -1,39 +0,0 @@ -; Auto-generated by create_symbols_file.py - -LIBRARY libsndfile-1.dll -EXPORTS - -sf_command @1 -sf_open @2 -sf_close @3 -sf_seek @4 -sf_error @7 -sf_perror @8 -sf_error_str @9 -sf_error_number @10 -sf_format_check @11 -sf_read_raw @16 -sf_readf_short @17 -sf_readf_int @18 -sf_readf_float @19 -sf_readf_double @20 -sf_read_short @21 -sf_read_int @22 -sf_read_float @23 -sf_read_double @24 -sf_write_raw @32 -sf_writef_short @33 -sf_writef_int @34 -sf_writef_float @35 -sf_writef_double @36 -sf_write_short @37 -sf_write_int @38 -sf_write_float @39 -sf_write_double @40 -sf_strerror @50 -sf_get_string @60 -sf_set_string @61 -sf_open_fd @70 -sf_open_virtual @80 -sf_write_sync @90 - diff --git a/libs/libsndfile/src/macbinary3.c b/libs/libsndfile/src/macbinary3.c deleted file mode 100644 index 3ad71e68b8..0000000000 --- a/libs/libsndfile/src/macbinary3.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -** Copyright (C) 2003-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if (OSX_DARWIN_VERSION >= 1) - -int -macbinary3_open (SF_PRIVATE * UNUSED (psf)) -{ - return 0 ; -} /* macbinary3_open */ - -#else - -int -macbinary3_open (SF_PRIVATE * UNUSED (psf)) -{ - return 0 ; -} /* macbinary3_open */ - -#endif /* OSX_DARWIN_VERSION */ - diff --git a/libs/libsndfile/src/macos.c b/libs/libsndfile/src/macos.c deleted file mode 100644 index 5f6c53191c..0000000000 --- a/libs/libsndfile/src/macos.c +++ /dev/null @@ -1,51 +0,0 @@ -/* -** Copyright (C) 2003-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#define STR_MARKER MAKE_MARKER ('S', 'T', 'R', ' ') - -int -macos_guess_file_type (SF_PRIVATE * psf, const char *filename) -{ static char rsrc_name [1024] ; - struct stat statbuf ; - - snprintf (rsrc_name, sizeof (rsrc_name), "%s/rsrc", filename) ; - - /* If there is no resource fork, just return. */ - if (stat (rsrc_name, &statbuf) != 0) - { psf_log_printf (psf, "No resource fork.\n") ; - return 0 ; - } ; - - if (statbuf.st_size == 0) - { psf_log_printf (psf, "Have zero size resource fork.\n") ; - return 0 ; - } ; - - return 0 ; -} /* macos_guess_file_type */ - diff --git a/libs/libsndfile/src/make-static-lib-hidden-privates.sh b/libs/libsndfile/src/make-static-lib-hidden-privates.sh deleted file mode 100644 index 5bfd485d26..0000000000 --- a/libs/libsndfile/src/make-static-lib-hidden-privates.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -e - -# This script takes a static library and removes all non-public symbols. -# Ie, it makes a static lib whose symbols are far less likely to clash with -# the symbols of another shared or static library. - -grep sf_ Symbols.gnu-binutils | sed -e "s/[ ;]//g" > Symbols.static - -ld -r --whole-archive .libs/libsndfile.a -o libsndfile_a.o - -objcopy --keep-global-symbols=Symbols.static libsndfile_a.o libsndfile.o - -rm -f libsndfile.a -ar cru libsndfile.a libsndfile.o diff --git a/libs/libsndfile/src/mat4.c b/libs/libsndfile/src/mat4.c deleted file mode 100644 index 77ece264b1..0000000000 --- a/libs/libsndfile/src/mat4.c +++ /dev/null @@ -1,390 +0,0 @@ -/* -** Copyright (C) 2002-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*------------------------------------------------------------------------------ -** Information on how to decode and encode this file was obtained in a PDF -** file which I found on http://www.wotsit.org/. -** Also did a lot of testing with GNU Octave but do not have access to -** Matlab (tm) and so could not test it there. -*/ - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues. -*/ - -#define MAT4_BE_DOUBLE (MAKE_MARKER (0, 0, 0x03, 0xE8)) -#define MAT4_LE_DOUBLE (MAKE_MARKER (0, 0, 0, 0)) - -#define MAT4_BE_FLOAT (MAKE_MARKER (0, 0, 0x03, 0xF2)) -#define MAT4_LE_FLOAT (MAKE_MARKER (0x0A, 0, 0, 0)) - -#define MAT4_BE_PCM_32 (MAKE_MARKER (0, 0, 0x03, 0xFC)) -#define MAT4_LE_PCM_32 (MAKE_MARKER (0x14, 0, 0, 0)) - -#define MAT4_BE_PCM_16 (MAKE_MARKER (0, 0, 0x04, 0x06)) -#define MAT4_LE_PCM_16 (MAKE_MARKER (0x1E, 0, 0, 0)) - -/* Can't see any reason to ever implement this. */ -#define MAT4_BE_PCM_U8 (MAKE_MARKER (0, 0, 0x04, 0x1A)) -#define MAT4_LE_PCM_U8 (MAKE_MARKER (0x32, 0, 0, 0)) - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int mat4_close (SF_PRIVATE *psf) ; - -static int mat4_format_to_encoding (int format, int endian) ; - -static int mat4_write_header (SF_PRIVATE *psf, int calc_length) ; -static int mat4_read_header (SF_PRIVATE *psf) ; - -static const char * mat4_marker_to_str (int marker) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -mat4_open (SF_PRIVATE *psf) -{ int subformat, error = 0 ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = mat4_read_header (psf))) - return error ; - } ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_MAT4) - return SFE_BAD_OPEN_FORMAT ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (psf->is_pipe) - return SFE_NO_PIPE_WRITE ; - - psf->endian = SF_ENDIAN (psf->sf.format) ; - if (CPU_IS_LITTLE_ENDIAN && (psf->endian == SF_ENDIAN_CPU || psf->endian == 0)) - psf->endian = SF_ENDIAN_LITTLE ; - else if (CPU_IS_BIG_ENDIAN && (psf->endian == SF_ENDIAN_CPU || psf->endian == 0)) - psf->endian = SF_ENDIAN_BIG ; - - if ((error = mat4_write_header (psf, SF_FALSE))) - return error ; - - psf->write_header = mat4_write_header ; - } ; - - psf->container_close = mat4_close ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - switch (subformat) - { case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_32 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_FLOAT : - error = float32_init (psf) ; - break ; - - case SF_FORMAT_DOUBLE : - error = double64_init (psf) ; - break ; - - default : break ; - } ; - - if (error) - return error ; - - return error ; -} /* mat4_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -mat4_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - mat4_write_header (psf, SF_TRUE) ; - - return 0 ; -} /* mat4_close */ - -/*------------------------------------------------------------------------------ -*/ - -static int -mat4_write_header (SF_PRIVATE *psf, int calc_length) -{ sf_count_t current ; - int encoding ; - double samplerate ; - - current = psf_ftell (psf) ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - encoding = mat4_format_to_encoding (SF_CODEC (psf->sf.format), psf->endian) ; - - if (encoding == -1) - return SFE_BAD_OPEN_FORMAT ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - /* Need sample rate as a double for writing to the header. */ - samplerate = psf->sf.samplerate ; - - if (psf->endian == SF_ENDIAN_BIG) - { psf_binheader_writef (psf, "Em444", MAT4_BE_DOUBLE, 1, 1, 0) ; - psf_binheader_writef (psf, "E4bd", 11, "samplerate", make_size_t (11), samplerate) ; - psf_binheader_writef (psf, "tEm484", encoding, psf->sf.channels, psf->sf.frames, 0) ; - psf_binheader_writef (psf, "E4b", 9, "wavedata", make_size_t (9)) ; - } - else if (psf->endian == SF_ENDIAN_LITTLE) - { psf_binheader_writef (psf, "em444", MAT4_LE_DOUBLE, 1, 1, 0) ; - psf_binheader_writef (psf, "e4bd", 11, "samplerate", make_size_t (11), samplerate) ; - psf_binheader_writef (psf, "tem484", encoding, psf->sf.channels, psf->sf.frames, 0) ; - psf_binheader_writef (psf, "e4b", 9, "wavedata", make_size_t (9)) ; - } - else - return SFE_BAD_OPEN_FORMAT ; - - /* Header construction complete so write it out. */ - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* mat4_write_header */ - -static int -mat4_read_header (SF_PRIVATE *psf) -{ char buffer [256] ; - uint32_t marker, namesize ; - int rows, cols, imag ; - double value ; - const char *marker_str ; - char name [64] ; - - psf_binheader_readf (psf, "pm", 0, &marker) ; - - /* MAT4 file must start with a double for the samplerate. */ - if (marker == MAT4_BE_DOUBLE) - { psf->endian = psf->rwf_endian = SF_ENDIAN_BIG ; - marker_str = "big endian double" ; - } - else if (marker == MAT4_LE_DOUBLE) - { psf->endian = psf->rwf_endian = SF_ENDIAN_LITTLE ; - marker_str = "little endian double" ; - } - else - return SFE_UNIMPLEMENTED ; - - psf_log_printf (psf, "GNU Octave 2.0 / MATLAB v4.2 format\nMarker : %s\n", marker_str) ; - - psf_binheader_readf (psf, "444", &rows, &cols, &imag) ; - - psf_log_printf (psf, " Rows : %d\n Cols : %d\n Imag : %s\n", rows, cols, imag ? "True" : "False") ; - - psf_binheader_readf (psf, "4", &namesize) ; - - if (namesize >= SIGNED_SIZEOF (name)) - return SFE_MAT4_BAD_NAME ; - - psf_binheader_readf (psf, "b", name, namesize) ; - name [namesize] = 0 ; - - psf_log_printf (psf, " Name : %s\n", name) ; - - psf_binheader_readf (psf, "d", &value) ; - - snprintf (buffer, sizeof (buffer), " Value : %f\n", value) ; - psf_log_printf (psf, buffer) ; - - if ((rows != 1) || (cols != 1)) - return SFE_MAT4_NO_SAMPLERATE ; - - psf->sf.samplerate = lrint (value) ; - - /* Now write out the audio data. */ - - psf_binheader_readf (psf, "m", &marker) ; - - psf_log_printf (psf, "Marker : %s\n", mat4_marker_to_str (marker)) ; - - psf_binheader_readf (psf, "444", &rows, &cols, &imag) ; - - psf_log_printf (psf, " Rows : %d\n Cols : %d\n Imag : %s\n", rows, cols, imag ? "True" : "False") ; - - psf_binheader_readf (psf, "4", &namesize) ; - - if (namesize >= SIGNED_SIZEOF (name)) - return SFE_MAT4_BAD_NAME ; - - psf_binheader_readf (psf, "b", name, namesize) ; - name [namesize] = 0 ; - - psf_log_printf (psf, " Name : %s\n", name) ; - - psf->dataoffset = psf_ftell (psf) ; - - if (rows == 0 && cols == 0) - { psf_log_printf (psf, "*** Error : zero channel count.\n") ; - return SFE_CHANNEL_COUNT_ZERO ; - } ; - - psf->sf.channels = rows ; - psf->sf.frames = cols ; - - psf->sf.format = psf->endian | SF_FORMAT_MAT4 ; - switch (marker) - { case MAT4_BE_DOUBLE : - case MAT4_LE_DOUBLE : - psf->sf.format |= SF_FORMAT_DOUBLE ; - psf->bytewidth = 8 ; - break ; - - case MAT4_BE_FLOAT : - case MAT4_LE_FLOAT : - psf->sf.format |= SF_FORMAT_FLOAT ; - psf->bytewidth = 4 ; - break ; - - case MAT4_BE_PCM_32 : - case MAT4_LE_PCM_32 : - psf->sf.format |= SF_FORMAT_PCM_32 ; - psf->bytewidth = 4 ; - break ; - - case MAT4_BE_PCM_16 : - case MAT4_LE_PCM_16 : - psf->sf.format |= SF_FORMAT_PCM_16 ; - psf->bytewidth = 2 ; - break ; - - default : - psf_log_printf (psf, "*** Error : Bad marker %08X\n", marker) ; - return SFE_UNIMPLEMENTED ; - } ; - - if ((psf->filelength - psf->dataoffset) < psf->sf.channels * psf->sf.frames * psf->bytewidth) - { psf_log_printf (psf, "*** File seems to be truncated. %D <--> %D\n", - psf->filelength - psf->dataoffset, psf->sf.channels * psf->sf.frames * psf->bytewidth) ; - } - else if ((psf->filelength - psf->dataoffset) > psf->sf.channels * psf->sf.frames * psf->bytewidth) - psf->dataend = psf->dataoffset + rows * cols * psf->bytewidth ; - - psf->datalength = psf->filelength - psf->dataoffset - psf->dataend ; - - psf->sf.sections = 1 ; - - return 0 ; -} /* mat4_read_header */ - -static int -mat4_format_to_encoding (int format, int endian) -{ - switch (format | endian) - { case (SF_FORMAT_PCM_16 | SF_ENDIAN_BIG) : - return MAT4_BE_PCM_16 ; - - case (SF_FORMAT_PCM_16 | SF_ENDIAN_LITTLE) : - return MAT4_LE_PCM_16 ; - - case (SF_FORMAT_PCM_32 | SF_ENDIAN_BIG) : - return MAT4_BE_PCM_32 ; - - case (SF_FORMAT_PCM_32 | SF_ENDIAN_LITTLE) : - return MAT4_LE_PCM_32 ; - - case (SF_FORMAT_FLOAT | SF_ENDIAN_BIG) : - return MAT4_BE_FLOAT ; - - case (SF_FORMAT_FLOAT | SF_ENDIAN_LITTLE) : - return MAT4_LE_FLOAT ; - - case (SF_FORMAT_DOUBLE | SF_ENDIAN_BIG) : - return MAT4_BE_DOUBLE ; - - case (SF_FORMAT_DOUBLE | SF_ENDIAN_LITTLE) : - return MAT4_LE_DOUBLE ; - - default : break ; - } ; - - return -1 ; -} /* mat4_format_to_encoding */ - -static const char * -mat4_marker_to_str (int marker) -{ static char str [32] ; - - switch (marker) - { - case MAT4_BE_PCM_16 : return "big endian 16 bit PCM" ; - case MAT4_LE_PCM_16 : return "little endian 16 bit PCM" ; - - case MAT4_BE_PCM_32 : return "big endian 32 bit PCM" ; - case MAT4_LE_PCM_32 : return "little endian 32 bit PCM" ; - - - case MAT4_BE_FLOAT : return "big endian float" ; - case MAT4_LE_FLOAT : return "big endian float" ; - - case MAT4_BE_DOUBLE : return "big endian double" ; - case MAT4_LE_DOUBLE : return "little endian double" ; - } ; - - /* This is a little unsafe but is really only for debugging. */ - str [sizeof (str) - 1] = 0 ; - snprintf (str, sizeof (str) - 1, "%08X", marker) ; - return str ; -} /* mat4_marker_to_str */ - diff --git a/libs/libsndfile/src/mat5.c b/libs/libsndfile/src/mat5.c deleted file mode 100644 index 164fb29a21..0000000000 --- a/libs/libsndfile/src/mat5.c +++ /dev/null @@ -1,509 +0,0 @@ -/* -** Copyright (C) 2002-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*------------------------------------------------------------------------------ -** Information on how to decode and encode this file was obtained in a PDF -** file which I found on http://www.wotsit.org/. -** Also did a lot of testing with GNU Octave but do not have access to -** Matlab (tm) and so could not test it there. -*/ - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues. -*/ - -#define MATL_MARKER (MAKE_MARKER ('M', 'A', 'T', 'L')) - -#define IM_MARKER (('I' << 8) + 'M') -#define MI_MARKER (('M' << 8) + 'I') - -/*------------------------------------------------------------------------------ -** Enums and typedefs. -*/ - -enum -{ MAT5_TYPE_SCHAR = 0x1, - MAT5_TYPE_UCHAR = 0x2, - MAT5_TYPE_INT16 = 0x3, - MAT5_TYPE_UINT16 = 0x4, - MAT5_TYPE_INT32 = 0x5, - MAT5_TYPE_UINT32 = 0x6, - MAT5_TYPE_FLOAT = 0x7, - MAT5_TYPE_DOUBLE = 0x9, - MAT5_TYPE_ARRAY = 0xE, - - MAT5_TYPE_COMP_USHORT = 0x00020004, - MAT5_TYPE_COMP_UINT = 0x00040006 -} ; - -typedef struct -{ sf_count_t size ; - int rows, cols ; - char name [32] ; -} MAT5_MATRIX ; - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int mat5_close (SF_PRIVATE *psf) ; - -static int mat5_write_header (SF_PRIVATE *psf, int calc_length) ; -static int mat5_read_header (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -mat5_open (SF_PRIVATE *psf) -{ int subformat, error = 0 ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = mat5_read_header (psf))) - return error ; - } ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_MAT5) - return SFE_BAD_OPEN_FORMAT ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (psf->is_pipe) - return SFE_NO_PIPE_WRITE ; - - psf->endian = SF_ENDIAN (psf->sf.format) ; - if (CPU_IS_LITTLE_ENDIAN && (psf->endian == SF_ENDIAN_CPU || psf->endian == 0)) - psf->endian = SF_ENDIAN_LITTLE ; - else if (CPU_IS_BIG_ENDIAN && (psf->endian == SF_ENDIAN_CPU || psf->endian == 0)) - psf->endian = SF_ENDIAN_BIG ; - - if ((error = mat5_write_header (psf, SF_FALSE))) - return error ; - - psf->write_header = mat5_write_header ; - } ; - - psf->container_close = mat5_close ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - switch (subformat) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_32 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_FLOAT : - error = float32_init (psf) ; - break ; - - case SF_FORMAT_DOUBLE : - error = double64_init (psf) ; - break ; - - default : break ; - } ; - - return error ; -} /* mat5_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -mat5_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - mat5_write_header (psf, SF_TRUE) ; - - return 0 ; -} /* mat5_close */ - -/*------------------------------------------------------------------------------ -*/ - -static int -mat5_write_header (SF_PRIVATE *psf, int calc_length) -{ static const char *filename = "MATLAB 5.0 MAT-file, written by " PACKAGE "-" VERSION ", " ; - static const char *sr_name = "samplerate\0\0\0\0\0\0\0\0\0\0\0" ; - static const char *wd_name = "wavedata\0" ; - char buffer [256] ; - sf_count_t current, datasize ; - int encoding ; - - current = psf_ftell (psf) ; - - if (calc_length) - { psf_fseek (psf, 0, SEEK_END) ; - psf->filelength = psf_ftell (psf) ; - psf_fseek (psf, 0, SEEK_SET) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_U8 : - encoding = MAT5_TYPE_UCHAR ; - break ; - - case SF_FORMAT_PCM_16 : - encoding = MAT5_TYPE_INT16 ; - break ; - - case SF_FORMAT_PCM_32 : - encoding = MAT5_TYPE_INT32 ; - break ; - - case SF_FORMAT_FLOAT : - encoding = MAT5_TYPE_FLOAT ; - break ; - - case SF_FORMAT_DOUBLE : - encoding = MAT5_TYPE_DOUBLE ; - break ; - - default : - return SFE_BAD_OPEN_FORMAT ; - } ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - psf_get_date_str (buffer, sizeof (buffer)) ; - psf_binheader_writef (psf, "bb", filename, strlen (filename), buffer, strlen (buffer) + 1) ; - - memset (buffer, ' ', 124 - psf->headindex) ; - psf_binheader_writef (psf, "b", buffer, make_size_t (124 - psf->headindex)) ; - - psf->rwf_endian = psf->endian ; - - if (psf->rwf_endian == SF_ENDIAN_BIG) - psf_binheader_writef (psf, "2b", 0x0100, "MI", make_size_t (2)) ; - else - psf_binheader_writef (psf, "2b", 0x0100, "IM", make_size_t (2)) ; - - psf_binheader_writef (psf, "444444", MAT5_TYPE_ARRAY, 64, MAT5_TYPE_UINT32, 8, 6, 0) ; - psf_binheader_writef (psf, "4444", MAT5_TYPE_INT32, 8, 1, 1) ; - psf_binheader_writef (psf, "44b", MAT5_TYPE_SCHAR, strlen (sr_name), sr_name, make_size_t (16)) ; - - if (psf->sf.samplerate > 0xFFFF) - psf_binheader_writef (psf, "44", MAT5_TYPE_COMP_UINT, psf->sf.samplerate) ; - else - { unsigned short samplerate = psf->sf.samplerate ; - - psf_binheader_writef (psf, "422", MAT5_TYPE_COMP_USHORT, samplerate, 0) ; - } ; - - datasize = psf->sf.frames * psf->sf.channels * psf->bytewidth ; - - psf_binheader_writef (psf, "t484444", MAT5_TYPE_ARRAY, datasize + 64, MAT5_TYPE_UINT32, 8, 6, 0) ; - psf_binheader_writef (psf, "t4448", MAT5_TYPE_INT32, 8, psf->sf.channels, psf->sf.frames) ; - psf_binheader_writef (psf, "44b", MAT5_TYPE_SCHAR, strlen (wd_name), wd_name, strlen (wd_name)) ; - - datasize = psf->sf.frames * psf->sf.channels * psf->bytewidth ; - if (datasize > 0x7FFFFFFF) - datasize = 0x7FFFFFFF ; - - psf_binheader_writef (psf, "t48", encoding, datasize) ; - - /* Header construction complete so write it out. */ - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* mat5_write_header */ - -static int -mat5_read_header (SF_PRIVATE *psf) -{ char buffer [256], name [32] ; - short version, endian ; - int type, flags1, flags2, rows, cols ; - unsigned size ; - int have_samplerate = 1 ; - - psf_binheader_readf (psf, "pb", 0, buffer, 124) ; - - buffer [125] = 0 ; - - if (strlen (buffer) >= 124) - return SFE_UNIMPLEMENTED ; - - if (strstr (buffer, "MATLAB 5.0 MAT-file") == buffer) - psf_log_printf (psf, "%s\n", buffer) ; - - - psf_binheader_readf (psf, "E22", &version, &endian) ; - - if (endian == MI_MARKER) - { psf->endian = psf->rwf_endian = SF_ENDIAN_BIG ; - if (CPU_IS_LITTLE_ENDIAN) version = ENDSWAP_16 (version) ; - } - else if (endian == IM_MARKER) - { psf->endian = psf->rwf_endian = SF_ENDIAN_LITTLE ; - if (CPU_IS_BIG_ENDIAN) version = ENDSWAP_16 (version) ; - } - else - return SFE_MAT5_BAD_ENDIAN ; - - if ((CPU_IS_LITTLE_ENDIAN && endian == IM_MARKER) || - (CPU_IS_BIG_ENDIAN && endian == MI_MARKER)) - version = ENDSWAP_16 (version) ; - - psf_log_printf (psf, "Version : 0x%04X\n", version) ; - psf_log_printf (psf, "Endian : 0x%04X => %s\n", endian, - (psf->endian == SF_ENDIAN_LITTLE) ? "Little" : "Big") ; - - /*========================================================*/ - psf_binheader_readf (psf, "44", &type, &size) ; - psf_log_printf (psf, "Block\n Type : %X Size : %d\n", type, size) ; - - if (type != MAT5_TYPE_ARRAY) - return SFE_MAT5_NO_BLOCK ; - - psf_binheader_readf (psf, "44", &type, &size) ; - psf_log_printf (psf, " Type : %X Size : %d\n", type, size) ; - - if (type != MAT5_TYPE_UINT32) - return SFE_MAT5_NO_BLOCK ; - - psf_binheader_readf (psf, "44", &flags1, &flags2) ; - psf_log_printf (psf, " Flg1 : %X Flg2 : %d\n", flags1, flags2) ; - - psf_binheader_readf (psf, "44", &type, &size) ; - psf_log_printf (psf, " Type : %X Size : %d\n", type, size) ; - - if (type != MAT5_TYPE_INT32) - return SFE_MAT5_NO_BLOCK ; - - psf_binheader_readf (psf, "44", &rows, &cols) ; - psf_log_printf (psf, " Rows : %d Cols : %d\n", rows, cols) ; - - if (rows != 1 || cols != 1) - { if (psf->sf.samplerate == 0) - psf->sf.samplerate = 44100 ; - have_samplerate = 0 ; - } - psf_binheader_readf (psf, "4", &type) ; - - if (type == MAT5_TYPE_SCHAR) - { psf_binheader_readf (psf, "4", &size) ; - psf_log_printf (psf, " Type : %X Size : %d\n", type, size) ; - if (size > SIGNED_SIZEOF (name) - 1) - { psf_log_printf (psf, "Error : Bad name length.\n") ; - return SFE_MAT5_NO_BLOCK ; - } ; - - psf_binheader_readf (psf, "bj", name, size, (8 - (size % 8)) % 8) ; - name [size] = 0 ; - } - else if ((type & 0xFFFF) == MAT5_TYPE_SCHAR) - { size = type >> 16 ; - if (size > 4) - { psf_log_printf (psf, "Error : Bad name length.\n") ; - return SFE_MAT5_NO_BLOCK ; - } ; - - psf_log_printf (psf, " Type : %X\n", type) ; - psf_binheader_readf (psf, "4", &name) ; - name [size] = 0 ; - } - else - return SFE_MAT5_NO_BLOCK ; - - psf_log_printf (psf, " Name : %s\n", name) ; - - /*-----------------------------------------*/ - - psf_binheader_readf (psf, "44", &type, &size) ; - - if (!have_samplerate) - goto skip_samplerate ; - - switch (type) - { case MAT5_TYPE_DOUBLE : - { double samplerate ; - - psf_binheader_readf (psf, "d", &samplerate) ; - snprintf (name, sizeof (name), "%f\n", samplerate) ; - psf_log_printf (psf, " Val : %s\n", name) ; - - psf->sf.samplerate = lrint (samplerate) ; - } ; - break ; - - case MAT5_TYPE_COMP_USHORT : - { unsigned short samplerate ; - - psf_binheader_readf (psf, "j2j", -4, &samplerate, 2) ; - psf_log_printf (psf, " Val : %u\n", samplerate) ; - psf->sf.samplerate = samplerate ; - } - break ; - - case MAT5_TYPE_COMP_UINT : - psf_log_printf (psf, " Val : %u\n", size) ; - psf->sf.samplerate = size ; - break ; - - default : - psf_log_printf (psf, " Type : %X Size : %d ***\n", type, size) ; - return SFE_MAT5_SAMPLE_RATE ; - } ; - - /*-----------------------------------------*/ - - - psf_binheader_readf (psf, "44", &type, &size) ; - psf_log_printf (psf, " Type : %X Size : %d\n", type, size) ; - - if (type != MAT5_TYPE_ARRAY) - return SFE_MAT5_NO_BLOCK ; - - psf_binheader_readf (psf, "44", &type, &size) ; - psf_log_printf (psf, " Type : %X Size : %d\n", type, size) ; - - if (type != MAT5_TYPE_UINT32) - return SFE_MAT5_NO_BLOCK ; - - psf_binheader_readf (psf, "44", &flags1, &flags2) ; - psf_log_printf (psf, " Flg1 : %X Flg2 : %d\n", flags1, flags2) ; - - psf_binheader_readf (psf, "44", &type, &size) ; - psf_log_printf (psf, " Type : %X Size : %d\n", type, size) ; - - if (type != MAT5_TYPE_INT32) - return SFE_MAT5_NO_BLOCK ; - - psf_binheader_readf (psf, "44", &rows, &cols) ; - psf_log_printf (psf, " Rows : %X Cols : %d\n", rows, cols) ; - - psf_binheader_readf (psf, "4", &type) ; - - if (type == MAT5_TYPE_SCHAR) - { psf_binheader_readf (psf, "4", &size) ; - psf_log_printf (psf, " Type : %X Size : %d\n", type, size) ; - if (size > SIGNED_SIZEOF (name) - 1) - { psf_log_printf (psf, "Error : Bad name length.\n") ; - return SFE_MAT5_NO_BLOCK ; - } ; - - psf_binheader_readf (psf, "bj", name, size, (8 - (size % 8)) % 8) ; - name [size] = 0 ; - } - else if ((type & 0xFFFF) == MAT5_TYPE_SCHAR) - { size = type >> 16 ; - if (size > 4) - { psf_log_printf (psf, "Error : Bad name length.\n") ; - return SFE_MAT5_NO_BLOCK ; - } ; - - psf_log_printf (psf, " Type : %X\n", type) ; - psf_binheader_readf (psf, "4", &name) ; - name [size] = 0 ; - } - else - return SFE_MAT5_NO_BLOCK ; - - psf_log_printf (psf, " Name : %s\n", name) ; - - psf_binheader_readf (psf, "44", &type, &size) ; - psf_log_printf (psf, " Type : %X Size : %d\n", type, size) ; - -skip_samplerate : - /*++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - if (rows == 0 && cols == 0) - { psf_log_printf (psf, "*** Error : zero channel count.\n") ; - return SFE_CHANNEL_COUNT_ZERO ; - } ; - - psf->sf.channels = rows ; - psf->sf.frames = cols ; - - psf->sf.format = psf->endian | SF_FORMAT_MAT5 ; - - switch (type) - { case MAT5_TYPE_DOUBLE : - psf_log_printf (psf, "Data type : double\n") ; - psf->sf.format |= SF_FORMAT_DOUBLE ; - psf->bytewidth = 8 ; - break ; - - case MAT5_TYPE_FLOAT : - psf_log_printf (psf, "Data type : float\n") ; - psf->sf.format |= SF_FORMAT_FLOAT ; - psf->bytewidth = 4 ; - break ; - - case MAT5_TYPE_INT32 : - psf_log_printf (psf, "Data type : 32 bit PCM\n") ; - psf->sf.format |= SF_FORMAT_PCM_32 ; - psf->bytewidth = 4 ; - break ; - - case MAT5_TYPE_INT16 : - psf_log_printf (psf, "Data type : 16 bit PCM\n") ; - psf->sf.format |= SF_FORMAT_PCM_16 ; - psf->bytewidth = 2 ; - break ; - - case MAT5_TYPE_UCHAR : - psf_log_printf (psf, "Data type : unsigned 8 bit PCM\n") ; - psf->sf.format |= SF_FORMAT_PCM_U8 ; - psf->bytewidth = 1 ; - break ; - - default : - psf_log_printf (psf, "*** Error : Bad marker %08X\n", type) ; - return SFE_UNIMPLEMENTED ; - } ; - - psf->dataoffset = psf_ftell (psf) ; - psf->datalength = psf->filelength - psf->dataoffset ; - - return 0 ; -} /* mat5_read_header */ - diff --git a/libs/libsndfile/src/mpc2k.c b/libs/libsndfile/src/mpc2k.c deleted file mode 100644 index 0170f7ccfb..0000000000 --- a/libs/libsndfile/src/mpc2k.c +++ /dev/null @@ -1,204 +0,0 @@ -/* -** Copyright (C) 2008-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/* -** Info from Olivier Tristan -** -** HEADER -** 2 magic bytes: 1 and 4. -** 17 char for the name of the sample. -** 3 bytes: level, tune and channels (0 for channels is mono while 1 is stereo) -** 4 uint32: sampleStart, loopEnd, sampleFrames and loopLength -** 1 byte: loopMode (0 no loop, 1 forward looping) -** 1 byte: number of beat in loop -** 1 uint16: sampleRate -** -** DATA -** Data are always non compressed 16 bits interleaved -*/ - -#define HEADER_LENGTH 42 /* Sum of above data fields. */ -#define HEADER_NAME_LEN 17 /* Length of name string. */ - -#define SFE_MPC_NO_MARKER 666 - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int mpc2k_close (SF_PRIVATE *psf) ; - -static int mpc2k_write_header (SF_PRIVATE *psf, int calc_length) ; -static int mpc2k_read_header (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -mpc2k_open (SF_PRIVATE *psf) -{ int error = 0 ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = mpc2k_read_header (psf))) - return error ; - } ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_MPC2K) - return SFE_BAD_OPEN_FORMAT ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (mpc2k_write_header (psf, SF_FALSE)) - return psf->error ; - - psf->write_header = mpc2k_write_header ; - } ; - - psf->container_close = mpc2k_close ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - error = pcm_init (psf) ; - - return error ; -} /* mpc2k_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -mpc2k_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - mpc2k_write_header (psf, SF_TRUE) ; - - return 0 ; -} /* mpc2k_close */ - -static int -mpc2k_write_header (SF_PRIVATE *psf, int calc_length) -{ char sample_name [HEADER_NAME_LEN + 1] ; - sf_count_t current ; - - if (psf->pipeoffset > 0) - return 0 ; - - current = psf_ftell (psf) ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->dataoffset = HEADER_LENGTH ; - psf->datalength = psf->filelength - psf->dataoffset ; - - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - - /* - ** Only attempt to seek if we are not writng to a pipe. If we are - ** writing to a pipe we shouldn't be here anyway. - */ - if (psf->is_pipe == SF_FALSE) - psf_fseek (psf, 0, SEEK_SET) ; - - snprintf (sample_name, sizeof (sample_name), "%s ", psf->file.name.c) ; - - psf_binheader_writef (psf, "e11b", 1, 4, sample_name, make_size_t (HEADER_NAME_LEN)) ; - psf_binheader_writef (psf, "e111", 100, 0, (psf->sf.channels - 1) & 1) ; - psf_binheader_writef (psf, "et4888", 0, psf->sf.frames, psf->sf.frames, psf->sf.frames) ; - psf_binheader_writef (psf, "e112", 0, 1, (uint16_t) psf->sf.samplerate) ; - - /* Always 16 bit little endian data. */ - psf->bytewidth = 2 ; - psf->endian = SF_ENDIAN_LITTLE ; - - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* mpc2k_write_header */ - -static int -mpc2k_read_header (SF_PRIVATE *psf) -{ char sample_name [HEADER_NAME_LEN + 1] ; - unsigned char bytes [4] ; - uint32_t sample_start, loop_end, sample_frames, loop_length ; - uint16_t sample_rate ; - - psf_binheader_readf (psf, "pebb", 0, bytes, 2, sample_name, make_size_t (HEADER_NAME_LEN)) ; - - if (bytes [0] != 1 || bytes [1] != 4) - return SFE_MPC_NO_MARKER ; - - sample_name [HEADER_NAME_LEN] = 0 ; - - psf_log_printf (psf, "MPC2000\n Name : %s\n", sample_name) ; - - psf_binheader_readf (psf, "eb4444", bytes, 3, &sample_start, &loop_end, &sample_frames, &loop_length) ; - - psf->sf.channels = bytes [2] ? 2 : 1 ; - - psf_log_printf (psf, " Level : %d\n Tune : %d\n Stereo : %s\n", bytes [0], bytes [1], bytes [2] ? "Yes" : "No") ; - - psf_log_printf (psf, " Sample start : %d\n Loop end : %d\n Frames : %d\n Length : %d\n", sample_start, loop_end, sample_frames, loop_length) ; - - psf_binheader_readf (psf, "eb2", bytes, 2, &sample_rate) ; - - psf_log_printf (psf, " Loop mode : %s\n Beats : %d\n Sample rate : %d\nEnd\n", bytes [0] ? "None" : "Fwd", bytes [1], sample_rate) ; - - psf->sf.samplerate = sample_rate ; - - psf->sf.format = SF_FORMAT_MPC2K | SF_FORMAT_PCM_16 ; - - psf->dataoffset = psf_ftell (psf) ; - - /* Always 16 bit little endian data. */ - psf->bytewidth = 2 ; - psf->endian = SF_ENDIAN_LITTLE ; - - psf->datalength = psf->filelength - psf->dataoffset ; - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - psf->sf.frames = psf->datalength / psf->blockwidth ; - - psf->sf.frames = (psf->filelength - psf->dataoffset) / psf->blockwidth ; - - return 0 ; -} /* mpc2k_read_header */ - diff --git a/libs/libsndfile/src/ms_adpcm.c b/libs/libsndfile/src/ms_adpcm.c deleted file mode 100644 index 1643ddf443..0000000000 --- a/libs/libsndfile/src/ms_adpcm.c +++ /dev/null @@ -1,836 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" -#include "wav_w64.h" - -/* These required here because we write the header in this file. */ - -#define RIFF_MARKER (MAKE_MARKER ('R', 'I', 'F', 'F')) -#define WAVE_MARKER (MAKE_MARKER ('W', 'A', 'V', 'E')) -#define fmt_MARKER (MAKE_MARKER ('f', 'm', 't', ' ')) -#define fact_MARKER (MAKE_MARKER ('f', 'a', 'c', 't')) -#define data_MARKER (MAKE_MARKER ('d', 'a', 't', 'a')) - -#define WAVE_FORMAT_MS_ADPCM 0x0002 - -typedef struct -{ int channels, blocksize, samplesperblock, blocks, dataremaining ; - int blockcount ; - sf_count_t samplecount ; - short *samples ; - unsigned char *block ; - short dummydata [] ; /* ISO C99 struct flexible array. */ -} MSADPCM_PRIVATE ; - -/*============================================================================================ -** MS ADPCM static data and functions. -*/ - -static int AdaptationTable [] = -{ 230, 230, 230, 230, 307, 409, 512, 614, - 768, 614, 512, 409, 307, 230, 230, 230 -} ; - -/* TODO : The first 7 coef's are are always hardcode and must - appear in the actual WAVE file. They should be read in - in case a sound program added extras to the list. */ - -static int AdaptCoeff1 [MSADPCM_ADAPT_COEFF_COUNT] = -{ 256, 512, 0, 192, 240, 460, 392 -} ; - -static int AdaptCoeff2 [MSADPCM_ADAPT_COEFF_COUNT] = -{ 0, -256, 0, 64, 0, -208, -232 -} ; - -/*============================================================================================ -** MS ADPCM Block Layout. -** ====================== -** Block is usually 256, 512 or 1024 bytes depending on sample rate. -** For a mono file, the block is laid out as follows: -** byte purpose -** 0 block predictor [0..6] -** 1,2 initial idelta (positive) -** 3,4 sample 1 -** 5,6 sample 0 -** 7..n packed bytecodes -** -** For a stereo file, the block is laid out as follows: -** byte purpose -** 0 block predictor [0..6] for left channel -** 1 block predictor [0..6] for right channel -** 2,3 initial idelta (positive) for left channel -** 4,5 initial idelta (positive) for right channel -** 6,7 sample 1 for left channel -** 8,9 sample 1 for right channel -** 10,11 sample 0 for left channel -** 12,13 sample 0 for right channel -** 14..n packed bytecodes -*/ - -/*============================================================================================ -** Static functions. -*/ - -static int msadpcm_decode_block (SF_PRIVATE *psf, MSADPCM_PRIVATE *pms) ; -static sf_count_t msadpcm_read_block (SF_PRIVATE *psf, MSADPCM_PRIVATE *pms, short *ptr, int len) ; - -static int msadpcm_encode_block (SF_PRIVATE *psf, MSADPCM_PRIVATE *pms) ; -static sf_count_t msadpcm_write_block (SF_PRIVATE *psf, MSADPCM_PRIVATE *pms, const short *ptr, int len) ; - -static sf_count_t msadpcm_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t msadpcm_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t msadpcm_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t msadpcm_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t msadpcm_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t msadpcm_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t msadpcm_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t msadpcm_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static sf_count_t msadpcm_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; -static int msadpcm_close (SF_PRIVATE *psf) ; - -static void choose_predictor (unsigned int channels, short *data, int *bpred, int *idelta) ; - -/*============================================================================================ -** MS ADPCM Read Functions. -*/ - -int -wav_w64_msadpcm_init (SF_PRIVATE *psf, int blockalign, int samplesperblock) -{ MSADPCM_PRIVATE *pms ; - unsigned int pmssize ; - int count ; - - if (psf->codec_data != NULL) - { psf_log_printf (psf, "*** psf->codec_data is not NULL.\n") ; - return SFE_INTERNAL ; - } ; - - if (psf->file.mode == SFM_WRITE) - samplesperblock = 2 + 2 * (blockalign - 7 * psf->sf.channels) / psf->sf.channels ; - - pmssize = sizeof (MSADPCM_PRIVATE) + blockalign + 3 * psf->sf.channels * samplesperblock ; - - if (! (psf->codec_data = calloc (1, pmssize))) - return SFE_MALLOC_FAILED ; - pms = (MSADPCM_PRIVATE*) psf->codec_data ; - - pms->samples = pms->dummydata ; - pms->block = (unsigned char*) (pms->dummydata + psf->sf.channels * samplesperblock) ; - - pms->channels = psf->sf.channels ; - pms->blocksize = blockalign ; - pms->samplesperblock = samplesperblock ; - - if (pms->blocksize == 0) - { psf_log_printf (psf, "*** Error : pms->blocksize should not be zero.\n") ; - return SFE_INTERNAL ; - } ; - - if (psf->file.mode == SFM_READ) - { pms->dataremaining = psf->datalength ; - - if (psf->datalength % pms->blocksize) - pms->blocks = psf->datalength / pms->blocksize + 1 ; - else - pms->blocks = psf->datalength / pms->blocksize ; - - count = 2 * (pms->blocksize - 6 * pms->channels) / pms->channels ; - if (pms->samplesperblock != count) - { psf_log_printf (psf, "*** Error : samplesperblock should be %d.\n", count) ; - return SFE_INTERNAL ; - } ; - - psf->sf.frames = (psf->datalength / pms->blocksize) * pms->samplesperblock ; - - psf_log_printf (psf, " bpred idelta\n") ; - - msadpcm_decode_block (psf, pms) ; - - psf->read_short = msadpcm_read_s ; - psf->read_int = msadpcm_read_i ; - psf->read_float = msadpcm_read_f ; - psf->read_double = msadpcm_read_d ; - } ; - - if (psf->file.mode == SFM_WRITE) - { pms->samples = pms->dummydata ; - - pms->samplecount = 0 ; - - psf->write_short = msadpcm_write_s ; - psf->write_int = msadpcm_write_i ; - psf->write_float = msadpcm_write_f ; - psf->write_double = msadpcm_write_d ; - } ; - - psf->codec_close = msadpcm_close ; - psf->seek = msadpcm_seek ; - - return 0 ; -} /* wav_w64_msadpcm_init */ - -static int -msadpcm_decode_block (SF_PRIVATE *psf, MSADPCM_PRIVATE *pms) -{ int chan, k, blockindx, sampleindx ; - short bytecode, bpred [2], chan_idelta [2] ; - - int predict ; - int current ; - int idelta ; - - pms->blockcount ++ ; - pms->samplecount = 0 ; - - if (pms->blockcount > pms->blocks) - { memset (pms->samples, 0, pms->samplesperblock * pms->channels) ; - return 1 ; - } ; - - if ((k = psf_fread (pms->block, 1, pms->blocksize, psf)) != pms->blocksize) - psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, pms->blocksize) ; - - /* Read and check the block header. */ - - if (pms->channels == 1) - { bpred [0] = pms->block [0] ; - - if (bpred [0] >= 7) - psf_log_printf (psf, "MS ADPCM synchronisation error (%d).\n", bpred [0]) ; - - chan_idelta [0] = pms->block [1] | (pms->block [2] << 8) ; - chan_idelta [1] = 0 ; - - psf_log_printf (psf, "(%d) (%d)\n", bpred [0], chan_idelta [0]) ; - - pms->samples [1] = pms->block [3] | (pms->block [4] << 8) ; - pms->samples [0] = pms->block [5] | (pms->block [6] << 8) ; - blockindx = 7 ; - } - else - { bpred [0] = pms->block [0] ; - bpred [1] = pms->block [1] ; - - if (bpred [0] >= 7 || bpred [1] >= 7) - psf_log_printf (psf, "MS ADPCM synchronisation error (%d %d).\n", bpred [0], bpred [1]) ; - - chan_idelta [0] = pms->block [2] | (pms->block [3] << 8) ; - chan_idelta [1] = pms->block [4] | (pms->block [5] << 8) ; - - psf_log_printf (psf, "(%d, %d) (%d, %d)\n", bpred [0], bpred [1], chan_idelta [0], chan_idelta [1]) ; - - pms->samples [2] = pms->block [6] | (pms->block [7] << 8) ; - pms->samples [3] = pms->block [8] | (pms->block [9] << 8) ; - - pms->samples [0] = pms->block [10] | (pms->block [11] << 8) ; - pms->samples [1] = pms->block [12] | (pms->block [13] << 8) ; - - blockindx = 14 ; - } ; - - /*-------------------------------------------------------- - This was left over from a time when calculations were done - as ints rather than shorts. Keep this around as a reminder - in case I ever find a file which decodes incorrectly. - - if (chan_idelta [0] & 0x8000) - chan_idelta [0] -= 0x10000 ; - if (chan_idelta [1] & 0x8000) - chan_idelta [1] -= 0x10000 ; - --------------------------------------------------------*/ - - /* Pull apart the packed 4 bit samples and store them in their - ** correct sample positions. - */ - - sampleindx = 2 * pms->channels ; - while (blockindx < pms->blocksize) - { bytecode = pms->block [blockindx++] ; - pms->samples [sampleindx++] = (bytecode >> 4) & 0x0F ; - pms->samples [sampleindx++] = bytecode & 0x0F ; - } ; - - /* Decode the encoded 4 bit samples. */ - - for (k = 2 * pms->channels ; k < (pms->samplesperblock * pms->channels) ; k ++) - { chan = (pms->channels > 1) ? (k % 2) : 0 ; - - bytecode = pms->samples [k] & 0xF ; - - /* Compute next Adaptive Scale Factor (ASF) */ - idelta = chan_idelta [chan] ; - chan_idelta [chan] = (AdaptationTable [bytecode] * idelta) >> 8 ; /* => / 256 => FIXED_POINT_ADAPTATION_BASE == 256 */ - if (chan_idelta [chan] < 16) - chan_idelta [chan] = 16 ; - if (bytecode & 0x8) - bytecode -= 0x10 ; - - predict = ((pms->samples [k - pms->channels] * AdaptCoeff1 [bpred [chan]]) - + (pms->samples [k - 2 * pms->channels] * AdaptCoeff2 [bpred [chan]])) >> 8 ; /* => / 256 => FIXED_POINT_COEFF_BASE == 256 */ - current = (bytecode * idelta) + predict ; - - if (current > 32767) - current = 32767 ; - else if (current < -32768) - current = -32768 ; - - pms->samples [k] = current ; - } ; - - return 1 ; -} /* msadpcm_decode_block */ - -static sf_count_t -msadpcm_read_block (SF_PRIVATE *psf, MSADPCM_PRIVATE *pms, short *ptr, int len) -{ int count, total = 0, indx = 0 ; - - while (indx < len) - { if (pms->blockcount >= pms->blocks && pms->samplecount >= pms->samplesperblock) - { memset (&(ptr [indx]), 0, (size_t) ((len - indx) * sizeof (short))) ; - return total ; - } ; - - if (pms->samplecount >= pms->samplesperblock) - msadpcm_decode_block (psf, pms) ; - - count = (pms->samplesperblock - pms->samplecount) * pms->channels ; - count = (len - indx > count) ? count : len - indx ; - - memcpy (&(ptr [indx]), &(pms->samples [pms->samplecount * pms->channels]), count * sizeof (short)) ; - indx += count ; - pms->samplecount += count / pms->channels ; - total = indx ; - } ; - - return total ; -} /* msadpcm_read_block */ - -static sf_count_t -msadpcm_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ MSADPCM_PRIVATE *pms ; - int readcount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pms = (MSADPCM_PRIVATE*) psf->codec_data ; - - while (len > 0) - { readcount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = msadpcm_read_block (psf, pms, ptr, readcount) ; - - total += count ; - len -= count ; - if (count != readcount) - break ; - } ; - - return total ; -} /* msadpcm_read_s */ - -static sf_count_t -msadpcm_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ MSADPCM_PRIVATE *pms ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pms = (MSADPCM_PRIVATE*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = msadpcm_read_block (psf, pms, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = sptr [k] << 16 ; - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - return total ; -} /* msadpcm_read_i */ - -static sf_count_t -msadpcm_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ MSADPCM_PRIVATE *pms ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - float normfact ; - - if (! psf->codec_data) - return 0 ; - pms = (MSADPCM_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x8000) : 1.0 ; - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = msadpcm_read_block (psf, pms, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * (float) (sptr [k]) ; - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - return total ; -} /* msadpcm_read_f */ - -static sf_count_t -msadpcm_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ MSADPCM_PRIVATE *pms ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount = 0, count ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x8000) : 1.0 ; - - if (! psf->codec_data) - return 0 ; - pms = (MSADPCM_PRIVATE*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = msadpcm_read_block (psf, pms, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * (double) (sptr [k]) ; - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - return total ; -} /* msadpcm_read_d */ - -static sf_count_t -msadpcm_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) -{ MSADPCM_PRIVATE *pms ; - int newblock, newsample ; - - if (! psf->codec_data) - return 0 ; - pms = (MSADPCM_PRIVATE*) psf->codec_data ; - - if (psf->datalength < 0 || psf->dataoffset < 0) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - if (offset == 0) - { psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - pms->blockcount = 0 ; - msadpcm_decode_block (psf, pms) ; - pms->samplecount = 0 ; - return 0 ; - } ; - - if (offset < 0 || offset > pms->blocks * pms->samplesperblock) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - newblock = offset / pms->samplesperblock ; - newsample = offset % pms->samplesperblock ; - - if (mode == SFM_READ) - { psf_fseek (psf, psf->dataoffset + newblock * pms->blocksize, SEEK_SET) ; - pms->blockcount = newblock ; - msadpcm_decode_block (psf, pms) ; - pms->samplecount = newsample ; - } - else - { /* What to do about write??? */ - psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - return newblock * pms->samplesperblock + newsample ; -} /* msadpcm_seek */ - -/*========================================================================================== -** MS ADPCM Write Functions. -*/ - -void -msadpcm_write_adapt_coeffs (SF_PRIVATE *psf) -{ int k ; - - for (k = 0 ; k < MSADPCM_ADAPT_COEFF_COUNT ; k++) - psf_binheader_writef (psf, "22", AdaptCoeff1 [k], AdaptCoeff2 [k]) ; -} /* msadpcm_write_adapt_coeffs */ - -/*========================================================================================== -*/ - -static int -msadpcm_encode_block (SF_PRIVATE *psf, MSADPCM_PRIVATE *pms) -{ unsigned int blockindx ; - unsigned char byte ; - int chan, k, predict, bpred [2], idelta [2], errordelta, newsamp ; - - choose_predictor (pms->channels, pms->samples, bpred, idelta) ; - - /* Write the block header. */ - - if (pms->channels == 1) - { pms->block [0] = bpred [0] ; - pms->block [1] = idelta [0] & 0xFF ; - pms->block [2] = idelta [0] >> 8 ; - pms->block [3] = pms->samples [1] & 0xFF ; - pms->block [4] = pms->samples [1] >> 8 ; - pms->block [5] = pms->samples [0] & 0xFF ; - pms->block [6] = pms->samples [0] >> 8 ; - - blockindx = 7 ; - byte = 0 ; - - /* Encode the samples as 4 bit. */ - - for (k = 2 ; k < pms->samplesperblock ; k++) - { predict = (pms->samples [k-1] * AdaptCoeff1 [bpred [0]] + pms->samples [k-2] * AdaptCoeff2 [bpred [0]]) >> 8 ; - errordelta = (pms->samples [k] - predict) / idelta [0] ; - if (errordelta < -8) - errordelta = -8 ; - else if (errordelta > 7) - errordelta = 7 ; - newsamp = predict + (idelta [0] * errordelta) ; - if (newsamp > 32767) - newsamp = 32767 ; - else if (newsamp < -32768) - newsamp = -32768 ; - if (errordelta < 0) - errordelta += 0x10 ; - - byte = (byte << 4) | (errordelta & 0xF) ; - if (k % 2) - { pms->block [blockindx++] = byte ; - byte = 0 ; - } ; - - idelta [0] = (idelta [0] * AdaptationTable [errordelta]) >> 8 ; - if (idelta [0] < 16) - idelta [0] = 16 ; - pms->samples [k] = newsamp ; - } ; - } - else - { /* Stereo file. */ - pms->block [0] = bpred [0] ; - pms->block [1] = bpred [1] ; - - pms->block [2] = idelta [0] & 0xFF ; - pms->block [3] = idelta [0] >> 8 ; - pms->block [4] = idelta [1] & 0xFF ; - pms->block [5] = idelta [1] >> 8 ; - - pms->block [6] = pms->samples [2] & 0xFF ; - pms->block [7] = pms->samples [2] >> 8 ; - pms->block [8] = pms->samples [3] & 0xFF ; - pms->block [9] = pms->samples [3] >> 8 ; - - pms->block [10] = pms->samples [0] & 0xFF ; - pms->block [11] = pms->samples [0] >> 8 ; - pms->block [12] = pms->samples [1] & 0xFF ; - pms->block [13] = pms->samples [1] >> 8 ; - - blockindx = 14 ; - byte = 0 ; - chan = 1 ; - - for (k = 4 ; k < 2 * pms->samplesperblock ; k++) - { chan = k & 1 ; - - predict = (pms->samples [k-2] * AdaptCoeff1 [bpred [chan]] + pms->samples [k-4] * AdaptCoeff2 [bpred [chan]]) >> 8 ; - errordelta = (pms->samples [k] - predict) / idelta [chan] ; - - - if (errordelta < -8) - errordelta = -8 ; - else if (errordelta > 7) - errordelta = 7 ; - newsamp = predict + (idelta [chan] * errordelta) ; - if (newsamp > 32767) - newsamp = 32767 ; - else if (newsamp < -32768) - newsamp = -32768 ; - if (errordelta < 0) - errordelta += 0x10 ; - - byte = (byte << 4) | (errordelta & 0xF) ; - - if (chan) - { pms->block [blockindx++] = byte ; - byte = 0 ; - } ; - - idelta [chan] = (idelta [chan] * AdaptationTable [errordelta]) >> 8 ; - if (idelta [chan] < 16) - idelta [chan] = 16 ; - pms->samples [k] = newsamp ; - } ; - } ; - - /* Write the block to disk. */ - - if ((k = psf_fwrite (pms->block, 1, pms->blocksize, psf)) != pms->blocksize) - psf_log_printf (psf, "*** Warning : short write (%d != %d).\n", k, pms->blocksize) ; - - memset (pms->samples, 0, pms->samplesperblock * sizeof (short)) ; - - pms->blockcount ++ ; - pms->samplecount = 0 ; - - return 1 ; -} /* msadpcm_encode_block */ - -static sf_count_t -msadpcm_write_block (SF_PRIVATE *psf, MSADPCM_PRIVATE *pms, const short *ptr, int len) -{ int count, total = 0, indx = 0 ; - - while (indx < len) - { count = (pms->samplesperblock - pms->samplecount) * pms->channels ; - - if (count > len - indx) - count = len - indx ; - - memcpy (&(pms->samples [pms->samplecount * pms->channels]), &(ptr [total]), count * sizeof (short)) ; - indx += count ; - pms->samplecount += count / pms->channels ; - total = indx ; - - if (pms->samplecount >= pms->samplesperblock) - msadpcm_encode_block (psf, pms) ; - } ; - - return total ; -} /* msadpcm_write_block */ - -static sf_count_t -msadpcm_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ MSADPCM_PRIVATE *pms ; - int writecount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pms = (MSADPCM_PRIVATE*) psf->codec_data ; - - while (len > 0) - { writecount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = msadpcm_write_block (psf, pms, ptr, writecount) ; - - total += count ; - len -= count ; - if (count != writecount) - break ; - } ; - - return total ; -} /* msadpcm_write_s */ - -static sf_count_t -msadpcm_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ MSADPCM_PRIVATE *pms ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pms = (MSADPCM_PRIVATE*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = ptr [total + k] >> 16 ; - count = msadpcm_write_block (psf, pms, sptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - return total ; -} /* msadpcm_write_i */ - -static sf_count_t -msadpcm_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ MSADPCM_PRIVATE *pms ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - float normfact ; - - if (! psf->codec_data) - return 0 ; - pms = (MSADPCM_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? (1.0 * 0x7FFF) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = lrintf (normfact * ptr [total + k]) ; - count = msadpcm_write_block (psf, pms, sptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - return total ; -} /* msadpcm_write_f */ - -static sf_count_t -msadpcm_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ MSADPCM_PRIVATE *pms ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double == SF_TRUE) ? (1.0 * 0x7FFF) : 1.0 ; - - if (! psf->codec_data) - return 0 ; - pms = (MSADPCM_PRIVATE*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = lrint (normfact * ptr [total + k]) ; - count = msadpcm_write_block (psf, pms, sptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - return total ; -} /* msadpcm_write_d */ - -/*======================================================================================== -*/ - -static int -msadpcm_close (SF_PRIVATE *psf) -{ MSADPCM_PRIVATE *pms ; - - pms = (MSADPCM_PRIVATE*) psf->codec_data ; - - if (psf->file.mode == SFM_WRITE) - { /* Now we know static int for certain the length of the file we can - ** re-write the header. - */ - - if (pms->samplecount && pms->samplecount < pms->samplesperblock) - msadpcm_encode_block (psf, pms) ; - } ; - - return 0 ; -} /* msadpcm_close */ - -/*======================================================================================== -** Static functions. -*/ - -/*---------------------------------------------------------------------------------------- -** Choosing the block predictor. -** Each block requires a predictor and an idelta for each channel. -** The predictor is in the range [0..6] which is an indx into the two AdaptCoeff tables. -** The predictor is chosen by trying all of the possible predictors on a small set of -** samples at the beginning of the block. The predictor with the smallest average -** abs (idelta) is chosen as the best predictor for this block. -** The value of idelta is chosen to to give a 4 bit code value of +/- 4 (approx. half the -** max. code value). If the average abs (idelta) is zero, the sixth predictor is chosen. -** If the value of idelta is less then 16 it is set to 16. -** -** Microsoft uses an IDELTA_COUNT (number of sample pairs used to choose best predictor) -** value of 3. The best possible results would be obtained by using all the samples to -** choose the predictor. -*/ - -#define IDELTA_COUNT 3 - -static void -choose_predictor (unsigned int channels, short *data, int *block_pred, int *idelta) -{ unsigned int chan, k, bpred, idelta_sum, best_bpred, best_idelta ; - - for (chan = 0 ; chan < channels ; chan++) - { best_bpred = best_idelta = 0 ; - - for (bpred = 0 ; bpred < 7 ; bpred++) - { idelta_sum = 0 ; - for (k = 2 ; k < 2 + IDELTA_COUNT ; k++) - idelta_sum += abs (data [k * channels] - ((data [(k - 1) * channels] * AdaptCoeff1 [bpred] + data [(k - 2) * channels] * AdaptCoeff2 [bpred]) >> 8)) ; - idelta_sum /= (4 * IDELTA_COUNT) ; - - if (bpred == 0 || idelta_sum < best_idelta) - { best_bpred = bpred ; - best_idelta = idelta_sum ; - } ; - - if (! idelta_sum) - { best_bpred = bpred ; - best_idelta = 16 ; - break ; - } ; - - } ; /* for bpred ... */ - if (best_idelta < 16) - best_idelta = 16 ; - - block_pred [chan] = best_bpred ; - idelta [chan] = best_idelta ; - } ; - - return ; -} /* choose_predictor */ - diff --git a/libs/libsndfile/src/new.c b/libs/libsndfile/src/new.c deleted file mode 100644 index 23f3087f12..0000000000 --- a/libs/libsndfile/src/new.c +++ /dev/null @@ -1,116 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if (ENABLE_EXPERIMENTAL_CODE == 0) - -int -new_open (SF_PRIVATE *psf) -{ if (psf) - return SFE_UNIMPLEMENTED ; - return (psf && 0) ; -} /* new_open */ - -#else - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues. -*/ - -/*------------------------------------------------------------------------------ -** Typedefs. -*/ - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int new_read_header (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -new_open (SF_PRIVATE *psf) -{ int subformat, error = 0 ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - return SFE_UNIMPLEMENTED ; - - if ((error = new_read_header (psf))) - return error ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_WVE) - return SFE_BAD_OPEN_FORMAT ; - - subformat = SF_CODEC (psf->sf.format) ; - - return error ; -} /* new_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -new_read_header (SF_PRIVATE *psf) -{ int marker ; - - /* Set position to start of file to begin reading header. */ - psf_binheader_readf (psf, "pm", 0, &marker) ; - if (marker != ALAW_MARKER) - return SFE_WVE_NOT_WVE ; - - psf_binheader_readf (psf, "m", &marker) ; - if (marker != SOUN_MARKER) - return SFE_WVE_NOT_WVE ; - - psf_binheader_readf (psf, "m", &marker) ; - if (marker != DFIL_MARKER) - return SFE_WVE_NOT_WVE ; - - psf_log_printf (psf, "Read only : Psion Alaw\n" - " Sample Rate : 8000\n" - " Channels : 1\n" - " Encoding : A-law\n") ; - - psf->dataoffset = 0x20 ; - psf->datalength = psf->filelength - psf->dataoffset ; - - psf->sf.format = SF_FORMAT_WVE | SF_FORMAT_ALAW ; - psf->sf.samplerate = 8000 ; - psf->sf.frames = psf->datalength ; - psf->sf.channels = 1 ; - - return alaw_init (psf) ; -} /* new_read_header */ - -/*------------------------------------------------------------------------------ -*/ - -#endif diff --git a/libs/libsndfile/src/nist.c b/libs/libsndfile/src/nist.c deleted file mode 100644 index 2aa679e55c..0000000000 --- a/libs/libsndfile/src/nist.c +++ /dev/null @@ -1,375 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** Some of the information used to read NIST files was gleaned from -** reading the code of Bill Schottstaedt's sndlib library -** ftp://ccrma-ftp.stanford.edu/pub/Lisp/sndlib.tar.gz -** However, no code from that package was used. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*------------------------------------------------------------------------------ -*/ - -#define NIST_HEADER_LENGTH 1024 - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int nist_close (SF_PRIVATE *psf) ; -static int nist_write_header (SF_PRIVATE *psf, int calc_length) ; -static int nist_read_header (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -*/ - -int -nist_open (SF_PRIVATE *psf) -{ int error ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = nist_read_header (psf))) - return error ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (psf->is_pipe) - return SFE_NO_PIPE_WRITE ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_NIST) - return SFE_BAD_OPEN_FORMAT ; - - psf->endian = SF_ENDIAN (psf->sf.format) ; - if (psf->endian == 0 || psf->endian == SF_ENDIAN_CPU) - psf->endian = (CPU_IS_BIG_ENDIAN) ? SF_ENDIAN_BIG : SF_ENDIAN_LITTLE ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - psf->sf.frames = 0 ; - - if ((error = nist_write_header (psf, SF_FALSE))) - return error ; - - psf->write_header = nist_write_header ; - } ; - - psf->container_close = nist_close ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_ULAW : - error = ulaw_init (psf) ; - break ; - - case SF_FORMAT_ALAW : - error = alaw_init (psf) ; - break ; - - default : error = SFE_UNIMPLEMENTED ; - break ; - } ; - - return error ; -} /* nist_open */ - -/*------------------------------------------------------------------------------ -*/ - -static char bad_header [] = -{ 'N', 'I', 'S', 'T', '_', '1', 'A', 0x0d, 0x0a, - ' ', ' ', ' ', '1', '0', '2', '4', 0x0d, 0x0a, - 0 -} ; - - static int -nist_read_header (SF_PRIVATE *psf) -{ char psf_header [NIST_HEADER_LENGTH + 2] ; - int bitwidth = 0, count, encoding ; - unsigned bytes = 0 ; - char str [64], *cptr ; - long samples ; - - if (sizeof (psf->header) <= NIST_HEADER_LENGTH) - return SFE_INTERNAL ; - - /* Go to start of file and read in the whole header. */ - psf_binheader_readf (psf, "pb", 0, psf_header, NIST_HEADER_LENGTH) ; - - /* Header is a string, so make sure it is null terminated. */ - psf_header [NIST_HEADER_LENGTH] = 0 ; - - /* Now trim the header after the end marker. */ - if ((cptr = strstr (psf_header, "end_head"))) - { cptr += strlen ("end_head") + 1 ; - cptr [0] = 0 ; - } ; - - if (strstr (psf_header, bad_header) == psf_header) - return SFE_NIST_CRLF_CONVERISON ; - - /* Make sure its a NIST file. */ - if (strstr (psf_header, "NIST_1A\n") != psf_header) - { psf_log_printf (psf, "Not a NIST file.\n") ; - return SFE_NIST_BAD_HEADER ; - } ; - - if (sscanf (psf_header, "NIST_1A\n%d\n", &count) == 1) - psf->dataoffset = count ; - else - { psf_log_printf (psf, "*** Suspicious header length.\n") ; - psf->dataoffset = NIST_HEADER_LENGTH ; - } ; - - /* Determine sample encoding, start by assuming PCM. */ - encoding = SF_FORMAT_PCM_U8 ; - if ((cptr = strstr (psf_header, "sample_coding -s"))) - { sscanf (cptr, "sample_coding -s%d %63s", &count, str) ; - - if (strcmp (str, "pcm") == 0) - { /* Correct this later when we find out the bitwidth. */ - encoding = SF_FORMAT_PCM_U8 ; - } - else if (strcmp (str, "alaw") == 0) - encoding = SF_FORMAT_ALAW ; - else if ((strcmp (str, "ulaw") == 0) || (strcmp (str, "mu-law") == 0)) - encoding = SF_FORMAT_ULAW ; - else - { psf_log_printf (psf, "*** Unknown encoding : %s\n", str) ; - encoding = 0 ; - } ; - } ; - - if ((cptr = strstr (psf_header, "channel_count -i ")) != NULL) - sscanf (cptr, "channel_count -i %d", &(psf->sf.channels)) ; - - if ((cptr = strstr (psf_header, "sample_rate -i ")) != NULL) - sscanf (cptr, "sample_rate -i %d", &(psf->sf.samplerate)) ; - - if ((cptr = strstr (psf_header, "sample_count -i ")) != NULL) - { sscanf (cptr, "sample_count -i %ld", &samples) ; - psf->sf.frames = samples ; - } ; - - if ((cptr = strstr (psf_header, "sample_n_bytes -i ")) != NULL) - sscanf (cptr, "sample_n_bytes -i %d", &(psf->bytewidth)) ; - - /* Default endian-ness (for 8 bit, u-law, A-law. */ - psf->endian = (CPU_IS_BIG_ENDIAN) ? SF_ENDIAN_BIG : SF_ENDIAN_LITTLE ; - - /* This is where we figure out endian-ness. */ - if ((cptr = strstr (psf_header, "sample_byte_format -s")) - && sscanf (cptr, "sample_byte_format -s%u %8s", &bytes, str) == 2) - { - if (bytes != strlen (str)) - psf_log_printf (psf, "Weird sample_byte_format : strlen '%s' != %d\n", str, bytes) ; - - if (bytes > 1) - { if (psf->bytewidth == 0) - psf->bytewidth = bytes ; - else if (psf->bytewidth - bytes != 0) - { psf_log_printf (psf, "psf->bytewidth (%d) != bytes (%d)\n", psf->bytewidth, bytes) ; - return SFE_NIST_BAD_ENCODING ; - } ; - - if (strcmp (str, "01") == 0) - psf->endian = SF_ENDIAN_LITTLE ; - else if (strcmp (str, "10") == 0) - psf->endian = SF_ENDIAN_BIG ; - else - { psf_log_printf (psf, "Weird endian-ness : %s\n", str) ; - return SFE_NIST_BAD_ENCODING ; - } ; - } ; - - psf->sf.format |= psf->endian ; - } ; - - if ((cptr = strstr (psf_header, "sample_sig_bits -i "))) - sscanf (cptr, "sample_sig_bits -i %d", &bitwidth) ; - - if (strstr (psf_header, "channels_interleaved -s5 FALSE")) - { psf_log_printf (psf, "Non-interleaved data unsupported.\n", str) ; - return SFE_NIST_BAD_ENCODING ; - } ; - - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - psf->datalength = psf->filelength - psf->dataoffset ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - if (encoding == SF_FORMAT_PCM_U8) - { switch (psf->bytewidth) - { case 1 : - psf->sf.format |= SF_FORMAT_PCM_S8 ; - break ; - - case 2 : - psf->sf.format |= SF_FORMAT_PCM_16 ; - break ; - - case 3 : - psf->sf.format |= SF_FORMAT_PCM_24 ; - break ; - - case 4 : - psf->sf.format |= SF_FORMAT_PCM_32 ; - break ; - - default : break ; - } ; - } - else if (encoding != 0) - psf->sf.format |= encoding ; - else - return SFE_UNIMPLEMENTED ; - - /* Sanitize psf->sf.format. */ - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_ULAW : - case SF_FORMAT_ALAW : - case SF_FORMAT_PCM_U8 : - /* Blank out endian bits. */ - psf->sf.format = SF_FORMAT_NIST | SF_CODEC (psf->sf.format) ; - break ; - - default : - break ; - } ; - - return 0 ; -} /* nist_read_header */ - -static int -nist_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - nist_write_header (psf, SF_TRUE) ; - - return 0 ; -} /* nist_close */ - -/*========================================================================= -*/ - -static int -nist_write_header (SF_PRIVATE *psf, int calc_length) -{ const char *end_str ; - long samples ; - sf_count_t current ; - - current = psf_ftell (psf) ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - - if (psf->bytewidth > 0) - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - if (psf->endian == SF_ENDIAN_BIG) - end_str = "10" ; - else if (psf->endian == SF_ENDIAN_LITTLE) - end_str = "01" ; - else - end_str = "error" ; - - /* Clear the whole header. */ - memset (psf->header, 0, sizeof (psf->header)) ; - psf->headindex = 0 ; - - psf_fseek (psf, 0, SEEK_SET) ; - - psf_asciiheader_printf (psf, "NIST_1A\n 1024\n") ; - psf_asciiheader_printf (psf, "channel_count -i %d\n", psf->sf.channels) ; - psf_asciiheader_printf (psf, "sample_rate -i %d\n", psf->sf.samplerate) ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - psf_asciiheader_printf (psf, "sample_coding -s3 pcm\n") ; - psf_asciiheader_printf (psf, "sample_n_bytes -i 1\n" - "sample_sig_bits -i 8\n") ; - break ; - - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - psf_asciiheader_printf (psf, "sample_n_bytes -i %d\n", psf->bytewidth) ; - psf_asciiheader_printf (psf, "sample_sig_bits -i %d\n", psf->bytewidth * 8) ; - psf_asciiheader_printf (psf, "sample_coding -s3 pcm\n" - "sample_byte_format -s%d %s\n", psf->bytewidth, end_str) ; - break ; - - case SF_FORMAT_ALAW : - psf_asciiheader_printf (psf, "sample_coding -s4 alaw\n") ; - psf_asciiheader_printf (psf, "sample_n_bytes -s1 1\n") ; - break ; - - case SF_FORMAT_ULAW : - psf_asciiheader_printf (psf, "sample_coding -s4 ulaw\n") ; - psf_asciiheader_printf (psf, "sample_n_bytes -s1 1\n") ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - psf->dataoffset = NIST_HEADER_LENGTH ; - - /* Fix this */ - samples = psf->sf.frames ; - psf_asciiheader_printf (psf, "sample_count -i %ld\n", samples) ; - psf_asciiheader_printf (psf, "end_head\n") ; - - /* Zero fill to dataoffset. */ - psf_binheader_writef (psf, "z", (size_t) (NIST_HEADER_LENGTH - psf->headindex)) ; - - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* nist_write_header */ - diff --git a/libs/libsndfile/src/ogg.c b/libs/libsndfile/src/ogg.c deleted file mode 100644 index 7bc4b31f9f..0000000000 --- a/libs/libsndfile/src/ogg.c +++ /dev/null @@ -1,253 +0,0 @@ -/* -** Copyright (C) 2002-2012 Erik de Castro Lopo -** Copyright (C) 2007 John ffitch -** -** This program is free software ; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation ; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program ; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if HAVE_EXTERNAL_LIBS - -#include - -#include "ogg.h" - -static int ogg_close (SF_PRIVATE *psf) ; -static int ogg_stream_classify (SF_PRIVATE *psf, OGG_PRIVATE * odata) ; -static int ogg_page_classify (SF_PRIVATE * psf, const ogg_page * og) ; - -int -ogg_open (SF_PRIVATE *psf) -{ OGG_PRIVATE* odata = calloc (1, sizeof (OGG_PRIVATE)) ; - sf_count_t pos = psf_ftell (psf) ; - int error = 0 ; - - psf->container_data = odata ; - psf->container_close = ogg_close ; - - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - if (psf->file.mode == SFM_READ) - if ((error = ogg_stream_classify (psf, odata)) != 0) - return error ; - - /* Reset everything to an initial state. */ - ogg_sync_clear (&odata->osync) ; - ogg_stream_clear (&odata->ostream) ; - psf_fseek (psf, pos, SEEK_SET) ; - - if (SF_ENDIAN (psf->sf.format) != 0) - return SFE_BAD_ENDIAN ; - - switch (psf->sf.format) - { case SF_FORMAT_OGG | SF_FORMAT_VORBIS : - return ogg_vorbis_open (psf) ; - - case SF_FORMAT_OGGFLAC : - free (psf->container_data) ; - psf->container_data = NULL ; - psf->container_close = NULL ; - return flac_open (psf) ; - -#if ENABLE_EXPERIMENTAL_CODE - case SF_FORMAT_OGG | SF_FORMAT_SPEEX : - return ogg_speex_open (psf) ; - - case SF_FORMAT_OGG | SF_FORMAT_PCM_16 : - case SF_FORMAT_OGG | SF_FORMAT_PCM_24 : - return ogg_pcm_open (psf) ; -#endif - - default : - break ; - } ; - - psf_log_printf (psf, "%s : bad psf->sf.format 0x%x.\n", __func__, psf->sf.format) ; - return SFE_INTERNAL ; -} /* ogg_open */ - - -static int -ogg_close (SF_PRIVATE *psf) -{ OGG_PRIVATE* odata = psf->container_data ; - - ogg_sync_clear (&odata->osync) ; - ogg_stream_clear (&odata->ostream) ; - - return 0 ; -} /* ogg_close */ - -static int -ogg_stream_classify (SF_PRIVATE *psf, OGG_PRIVATE* odata) -{ char *buffer ; - int bytes, nn ; - - /* Call this here so it only gets called once, so no memory is leaked. */ - ogg_sync_init (&odata->osync) ; - - odata->eos = 0 ; - - /* Weird stuff happens if these aren't called. */ - ogg_stream_reset (&odata->ostream) ; - ogg_sync_reset (&odata->osync) ; - - /* - ** Grab some data at the head of the stream. We want the first page - ** (which is guaranteed to be small and only contain the Vorbis - ** stream initial header) We need the first page to get the stream - ** serialno. - */ - - /* Expose the buffer */ - buffer = ogg_sync_buffer (&odata->osync, 4096L) ; - - /* Grab the part of the header that has already been read. */ - memcpy (buffer, psf->header, psf->headindex) ; - bytes = psf->headindex ; - - /* Submit a 4k block to libvorbis' Ogg layer */ - bytes += psf_fread (buffer + psf->headindex, 1, 4096 - psf->headindex, psf) ; - ogg_sync_wrote (&odata->osync, bytes) ; - - /* Get the first page. */ - if ((nn = ogg_sync_pageout (&odata->osync, &odata->opage)) != 1) - { - /* Have we simply run out of data? If so, we're done. */ - if (bytes < 4096) - return 0 ; - - /* Error case. Must not be Vorbis data */ - psf_log_printf (psf, "Input does not appear to be an Ogg bitstream.\n") ; - return SFE_MALFORMED_FILE ; - } ; - - /* - ** Get the serial number and set up the rest of decode. - ** Serialno first ; use it to set up a logical stream. - */ - ogg_stream_clear (&odata->ostream) ; - ogg_stream_init (&odata->ostream, ogg_page_serialno (&odata->opage)) ; - - if (ogg_stream_pagein (&odata->ostream, &odata->opage) < 0) - { /* Error ; stream version mismatch perhaps. */ - psf_log_printf (psf, "Error reading first page of Ogg bitstream data\n") ; - return SFE_MALFORMED_FILE ; - } ; - - if (ogg_stream_packetout (&odata->ostream, &odata->opacket) != 1) - { /* No page? must not be vorbis. */ - psf_log_printf (psf, "Error reading initial header packet.\n") ; - return SFE_MALFORMED_FILE ; - } ; - - odata->codec = ogg_page_classify (psf, &odata->opage) ; - - switch (odata->codec) - { case OGG_VORBIS : - psf->sf.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ; - return 0 ; - - case OGG_FLAC : - case OGG_FLAC0 : - psf->sf.format = SF_FORMAT_OGGFLAC ; - return 0 ; - - case OGG_SPEEX : - psf->sf.format = SF_FORMAT_OGG | SF_FORMAT_SPEEX ; - return 0 ; - - case OGG_PCM : - psf_log_printf (psf, "Detected Ogg/PCM data. This is not supported yet.\n") ; - return SFE_UNIMPLEMENTED ; - - default : - break ; - } ; - - psf_log_printf (psf, "This Ogg bitstream contains some uknown data type.\n") ; - return SFE_UNIMPLEMENTED ; -} /* ogg_stream_classify */ - -/*============================================================================== -*/ - -static struct -{ const char *str, *name ; - int len, codec ; -} codec_lookup [] = -{ { "Annodex", "Annodex", 8, OGG_ANNODEX }, - { "AnxData", "AnxData", 7, OGG_ANXDATA }, - { "\177FLAC", "Flac1", 5, OGG_FLAC }, - { "fLaC", "Flac0", 4, OGG_FLAC0 }, - { "PCM ", "PCM", 8, OGG_PCM }, - { "Speex", "Speex", 5, OGG_SPEEX }, - { "\001vorbis", "Vorbis", 7, OGG_VORBIS }, -} ; - -static int -ogg_page_classify (SF_PRIVATE * psf, const ogg_page * og) -{ int k, len ; - - for (k = 0 ; k < ARRAY_LEN (codec_lookup) ; k++) - { if (codec_lookup [k].len > og->body_len) - continue ; - - if (memcmp (og->body, codec_lookup [k].str, codec_lookup [k].len) == 0) - { psf_log_printf (psf, "Ogg stream data : %s\n", codec_lookup [k].name) ; - psf_log_printf (psf, "Stream serialno : %u\n", (uint32_t) ogg_page_serialno (og)) ; - return codec_lookup [k].codec ; - } ; - } ; - - len = og->body_len < 8 ? og->body_len : 8 ; - - psf_log_printf (psf, "Ogg_stream data : '") ; - for (k = 0 ; k < len ; k++) - psf_log_printf (psf, "%c", isprint (og->body [k]) ? og->body [k] : '.') ; - psf_log_printf (psf, "' ") ; - for (k = 0 ; k < len ; k++) - psf_log_printf (psf, " %02x", og->body [k] & 0xff) ; - psf_log_printf (psf, "\n") ; - - return 0 ; -} /* ogg_page_classify */ - -#else /* HAVE_EXTERNAL_LIBS */ - -int -ogg_open (SF_PRIVATE *psf) -{ - psf_log_printf (psf, "This version of libsndfile was compiled without Ogg/Vorbis support.\n") ; - return SFE_UNIMPLEMENTED ; -} /* ogg_open */ - -#endif diff --git a/libs/libsndfile/src/ogg.h b/libs/libsndfile/src/ogg.h deleted file mode 100644 index 88544bb141..0000000000 --- a/libs/libsndfile/src/ogg.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -** Copyright (C) 2008-2011 Erik de Castro Lopo -** -** This program is free software ; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation ; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program ; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef SF_SRC_OGG_H - -enum -{ OGG_ANNODEX = 300, - OGG_ANXDATA, - OGG_FLAC, - OGG_FLAC0, - OGG_PCM, - OGG_SPEEX, - OGG_VORBIS, -} ; - -typedef struct -{ /* Sync and verify incoming physical bitstream */ - ogg_sync_state osync ; - /* Take physical pages, weld into a logical stream of packets */ - ogg_stream_state ostream ; - /* One Ogg bitstream page. Vorbis packets are inside */ - ogg_page opage ; - /* One raw packet of data for decode */ - ogg_packet opacket ; - int eos ; - int codec ; -} OGG_PRIVATE ; - - -#define readint(buf, base) (((buf [base + 3] << 24) & 0xff000000) | \ - ((buf [base + 2] <<16) & 0xff0000) | \ - ((buf [base + 1] << 8) & 0xff00) | \ - (buf [base] & 0xff)) - - - -#endif /* SF_SRC_OGG_H */ diff --git a/libs/libsndfile/src/ogg_opus.c b/libs/libsndfile/src/ogg_opus.c deleted file mode 100644 index 0824810c0d..0000000000 --- a/libs/libsndfile/src/ogg_opus.c +++ /dev/null @@ -1,149 +0,0 @@ -/* -** Copyright (C) 2013 Erik de Castro Lopo -** -** This program is free software ; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation ; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program ; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if (ENABLE_EXPERIMENTAL_CODE && HAVE_EXTERNAL_LIBS) - -#include - -#include "ogg.h" - -typedef struct -{ int32_t serialno ; - - - void * state ; -} OPUS_PRIVATE ; - -static int ogg_opus_read_header (SF_PRIVATE * psf) ; -static int ogg_opus_close (SF_PRIVATE *psf) ; - -int -ogg_opus_open (SF_PRIVATE *psf) -{ OGG_PRIVATE* odata = psf->container_data ; - OPUS_PRIVATE* oopus = calloc (1, sizeof (OPUS_PRIVATE)) ; - int error = 0 ; - - if (odata == NULL) - { psf_log_printf (psf, "%s : odata is NULL???\n", __func__) ; - return SFE_INTERNAL ; - } ; - - psf->codec_data = oopus ; - if (oopus == NULL) - return SFE_MALLOC_FAILED ; - - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - if (psf->file.mode == SFM_READ) - { /* Call this here so it only gets called once, so no memory is leaked. */ - ogg_sync_init (&odata->osync) ; - - if ((error = ogg_opus_read_header (psf))) - return error ; - -#if 0 - psf->read_short = ogg_opus_read_s ; - psf->read_int = ogg_opus_read_i ; - psf->read_float = ogg_opus_read_f ; - psf->read_double = ogg_opus_read_d ; - psf->sf.frames = ogg_opus_length (psf) ; -#endif - } ; - - psf->codec_close = ogg_opus_close ; - - if (psf->file.mode == SFM_WRITE) - { -#if 0 - /* Set the default oopus quality here. */ - vdata->quality = 0.4 ; - - psf->write_header = ogg_opus_write_header ; - psf->write_short = ogg_opus_write_s ; - psf->write_int = ogg_opus_write_i ; - psf->write_float = ogg_opus_write_f ; - psf->write_double = ogg_opus_write_d ; -#endif - - psf->sf.frames = SF_COUNT_MAX ; /* Unknown really */ - psf->strings.flags = SF_STR_ALLOW_START ; - } ; - - psf->bytewidth = 1 ; - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - -#if 0 - psf->seek = ogg_opus_seek ; - psf->command = ogg_opus_command ; -#endif - - /* FIXME, FIXME, FIXME : Hack these here for now and correct later. */ - psf->sf.format = SF_FORMAT_OGG | SF_FORMAT_SPEEX ; - psf->sf.sections = 1 ; - - psf->datalength = 1 ; - psf->dataoffset = 0 ; - /* End FIXME. */ - - return error ; -} /* ogg_opus_open */ - -static int -ogg_opus_read_header (SF_PRIVATE * UNUSED (psf)) -{ - return 0 ; -} /* ogg_opus_read_header */ - -static int -ogg_opus_close (SF_PRIVATE * UNUSED (psf)) -{ - - - return 0 ; -} /* ogg_opus_close */ - - -#else /* ENABLE_EXPERIMENTAL_CODE && HAVE_EXTERNAL_LIBS */ - -int -ogg_opus_open (SF_PRIVATE *psf) -{ - psf_log_printf (psf, "This version of libsndfile was compiled without Ogg/Opus support.\n") ; - return SFE_UNIMPLEMENTED ; -} /* ogg_opus_open */ - -#endif diff --git a/libs/libsndfile/src/ogg_pcm.c b/libs/libsndfile/src/ogg_pcm.c deleted file mode 100644 index 2e3b7f251c..0000000000 --- a/libs/libsndfile/src/ogg_pcm.c +++ /dev/null @@ -1,164 +0,0 @@ -/* -** Copyright (C) 2008-2012 Erik de Castro Lopo -** -** This program is free software ; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation ; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program ; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if (ENABLE_EXPERIMENTAL_CODE && HAVE_EXTERNAL_LIBS) - -#include - -#include "ogg.h" - -typedef struct -{ int32_t serialno ; - - - void * state ; -} OPCM_PRIVATE ; - -static int opcm_read_header (SF_PRIVATE * psf) ; -static int opcm_close (SF_PRIVATE *psf) ; - -int -ogg_pcm_open (SF_PRIVATE *psf) -{ OGG_PRIVATE* odata = psf->container_data ; - OPCM_PRIVATE* opcm = calloc (1, sizeof (OPCM_PRIVATE)) ; - int error = 0 ; - - if (odata == NULL) - { psf_log_printf (psf, "%s : odata is NULL???\n", __func__) ; - return SFE_INTERNAL ; - } ; - - psf->codec_data = opcm ; - if (opcm == NULL) - return SFE_MALLOC_FAILED ; - - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - if (psf->file.mode == SFM_READ) - { /* Call this here so it only gets called once, so no memory is leaked. */ - ogg_sync_init (&odata->osync) ; - - if ((error = opcm_read_header (psf))) - return error ; - -#if 0 - psf->read_short = opcm_read_s ; - psf->read_int = opcm_read_i ; - psf->read_float = opcm_read_f ; - psf->read_double = opcm_read_d ; - psf->sf.frames = opcm_length (psf) ; -#endif - } ; - - psf->codec_close = opcm_close ; - - if (psf->file.mode == SFM_WRITE) - { -#if 0 - /* Set the default opcm quality here. */ - vdata->quality = 0.4 ; - - psf->write_header = opcm_write_header ; - psf->write_short = opcm_write_s ; - psf->write_int = opcm_write_i ; - psf->write_float = opcm_write_f ; - psf->write_double = opcm_write_d ; -#endif - - psf->sf.frames = SF_COUNT_MAX ; /* Unknown really */ - psf->strings.flags = SF_STR_ALLOW_START ; - } ; - - psf->bytewidth = 1 ; - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - -#if 0 - psf->seek = opcm_seek ; - psf->command = opcm_command ; -#endif - - /* FIXME, FIXME, FIXME : Hack these here for now and correct later. */ - psf->sf.format = SF_FORMAT_OGG | SF_FORMAT_SPEEX ; - psf->sf.sections = 1 ; - - psf->datalength = 1 ; - psf->dataoffset = 0 ; - /* End FIXME. */ - - return error ; -} /* ogg_pcm_open */ - -static int -opcm_read_header (SF_PRIVATE * UNUSED (psf)) -{ - return 0 ; -} /* opcm_read_header */ - -static int -opcm_close (SF_PRIVATE * UNUSED (psf)) -{ - - - return 0 ; -} /* opcm_close */ - - - -/* -encoded_speex_frames = (frames_per_packet * Packets) - = 1 * 272 - = 272 - -audio_samples = encoded_speex_frames * frame_size - = 272 * 640 - = 174080 - -duration = audio_samples / rate - = 174080 / 44100 - = 3.947 -*/ - -#else /* ENABLE_EXPERIMENTAL_CODE && HAVE_EXTERNAL_LIBS */ - -int -ogg_pcm_open (SF_PRIVATE *psf) -{ - psf_log_printf (psf, "This version of libsndfile was compiled without Ogg/Speex support.\n") ; - return SFE_UNIMPLEMENTED ; -} /* ogg_pcm_open */ - -#endif diff --git a/libs/libsndfile/src/ogg_speex.c b/libs/libsndfile/src/ogg_speex.c deleted file mode 100644 index f24e242e57..0000000000 --- a/libs/libsndfile/src/ogg_speex.c +++ /dev/null @@ -1,425 +0,0 @@ -/* -** Copyright (C) 2008-2012 Erik de Castro Lopo -** -** This program is free software ; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation ; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program ; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if (ENABLE_EXPERIMENTAL_CODE && HAVE_EXTERNAL_LIBS) - -#include - -#include -#include -#include -#include - -#include "ogg.h" - -#define OGG_SPX_READ_SIZE 200 - -typedef struct -{ SpeexBits bits ; - - int32_t serialno ; - - int frame_size, granule_frame_size, nframes ; - int force_mode ; - - SpeexStereoState stereo ; - SpeexHeader header ; - - void * state ; -} SPX_PRIVATE ; - -static int spx_read_header (SF_PRIVATE * psf) ; -static int spx_close (SF_PRIVATE *psf) ; -static void *spx_header_read (SF_PRIVATE * psf, ogg_packet *op, spx_int32_t enh_enabled, int force_mode) ; -static void spx_print_comments (const char *comments, int length) ; - -int -ogg_speex_open (SF_PRIVATE *psf) -{ OGG_PRIVATE* odata = psf->container_data ; - SPX_PRIVATE* spx = calloc (1, sizeof (SPX_PRIVATE)) ; - int error = 0 ; - - if (odata == NULL) - { psf_log_printf (psf, "%s : odata is NULL???\n", __func__) ; - return SFE_INTERNAL ; - } ; - - psf->codec_data = spx ; - if (spx == NULL) - return SFE_MALLOC_FAILED ; - - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - if (psf->file.mode == SFM_READ) - { /* Call this here so it only gets called once, so no memory is leaked. */ - ogg_sync_init (&odata->osync) ; - - if ((error = spx_read_header (psf))) - return error ; - -#if 0 - psf->read_short = spx_read_s ; - psf->read_int = spx_read_i ; - psf->read_float = spx_read_f ; - psf->read_double = spx_read_d ; - psf->sf.frames = spx_length (psf) ; -#endif - } ; - - psf->codec_close = spx_close ; - - if (psf->file.mode == SFM_WRITE) - { -#if 0 - /* Set the default spx quality here. */ - vdata->quality = 0.4 ; - - psf->write_header = spx_write_header ; - psf->write_short = spx_write_s ; - psf->write_int = spx_write_i ; - psf->write_float = spx_write_f ; - psf->write_double = spx_write_d ; -#endif - - psf->sf.frames = SF_COUNT_MAX ; /* Unknown really */ - psf->strings.flags = SF_STR_ALLOW_START ; - } ; - - psf->bytewidth = 1 ; - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - -#if 0 - psf->seek = spx_seek ; - psf->command = spx_command ; -#endif - - /* FIXME, FIXME, FIXME : Hack these here for now and correct later. */ - psf->sf.format = SF_FORMAT_OGG | SF_FORMAT_SPEEX ; - psf->sf.sections = 1 ; - - psf->datalength = 1 ; - psf->dataoffset = 0 ; - /* End FIXME. */ - - return error ; -} /* ogg_speex_open */ - -#define le_short (x) (x) - -static int -spx_read_header (SF_PRIVATE * psf) -{ static SpeexStereoState STEREO_INIT = SPEEX_STEREO_STATE_INIT ; - - OGG_PRIVATE* odata = psf->container_data ; - SPX_PRIVATE* spx = psf->codec_data ; - - ogg_int64_t page_granule = 0 ; - int stream_init = 0 ; - int page_nb_packets = 0 ; - int packet_count = 0 ; - int enh_enabled = 1 ; - int force_mode = -1 ; - char * data ; - int nb_read ; - int lookahead ; - -printf ("%s %d\n", __func__, __LINE__) ; - - psf_log_printf (psf, "Speex header\n") ; - odata->eos = 0 ; - - /* Reset ogg stuff which has already been used in src/ogg.c. */ - ogg_stream_reset (&odata->ostream) ; - ogg_sync_reset (&odata->osync) ; - - /* Seek to start of stream. */ - psf_fseek (psf, 0, SEEK_SET) ; - - /* Initialize. */ - ogg_sync_init (&odata->osync) ; - speex_bits_init (&spx->bits) ; - - /* Set defaults. */ - psf->sf.channels = -1 ; - psf->sf.samplerate = 0 ; - spx->stereo = STEREO_INIT ; - - /* Get a pointer to the ogg buffer and read data into it. */ - data = ogg_sync_buffer (&odata->osync, OGG_SPX_READ_SIZE) ; - nb_read = psf_fread (data, 1, OGG_SPX_READ_SIZE, psf) ; - ogg_sync_wrote (&odata->osync, nb_read) ; - - /* Now we chew on Ogg packets. */ - while (ogg_sync_pageout (&odata->osync, &odata->opage) == 1) - { if (stream_init == 0) - { ogg_stream_init (&odata->ostream, ogg_page_serialno (&odata->opage)) ; - stream_init = 1 ; - } ; - - if (ogg_page_serialno (&odata->opage) != odata->ostream.serialno) - { /* so all streams are read. */ - ogg_stream_reset_serialno (&odata->ostream, ogg_page_serialno (&odata->opage)) ; - } ; - - /*Add page to the bitstream*/ - ogg_stream_pagein (&odata->ostream, &odata->opage) ; - page_granule = ogg_page_granulepos (&odata->opage) ; - page_nb_packets = ogg_page_packets (&odata->opage) ; - - /*Extract all available packets*/ - while (odata->eos == 0 && ogg_stream_packetout (&odata->ostream, &odata->opacket) == 1) - { if (odata->opacket.bytes >= 8 && memcmp (odata->opacket.packet, "Speex ", 8) == 0) - { spx->serialno = odata->ostream.serialno ; - } ; - - if (spx->serialno == -1 || odata->ostream.serialno != spx->serialno) - break ; - - if (packet_count == 0) - { spx->state = spx_header_read (psf, &odata->opacket, enh_enabled, force_mode) ; - if (! spx->state) - break ; - - speex_decoder_ctl (spx->state, SPEEX_GET_LOOKAHEAD, &lookahead) ; - if (spx->nframes == 0) - spx->nframes = 1 ; - } - else if (packet_count == 1) - { spx_print_comments ((const char*) odata->opacket.packet, odata->opacket.bytes) ; - } - else if (packet_count < 2 + spx->header.extra_headers) - { /* Ignore extra headers */ - } - packet_count ++ ; - } ; - } ; - - psf_log_printf (psf, "End\n") ; - - psf_log_printf (psf, "packet_count %d\n", packet_count) ; - psf_log_printf (psf, "page_nb_packets %d\n", page_nb_packets) ; - psf_log_printf (psf, "page_granule %lld\n", page_granule) ; - - return 0 ; -} /* spx_read_header */ - -static int -spx_close (SF_PRIVATE *psf) -{ SPX_PRIVATE* spx = psf->codec_data ; - - if (spx->state) - speex_decoder_destroy (spx->state) ; - - if (spx) - speex_bits_destroy (&spx->bits) ; - - return 0 ; -} /* spx_close */ - - - -static void * -spx_header_read (SF_PRIVATE * psf, ogg_packet *op, spx_int32_t enh_enabled, int force_mode) -{ SPX_PRIVATE* spx = psf->codec_data ; - void *st ; - const SpeexMode *mode ; - SpeexHeader *tmp_header ; - int modeID ; - SpeexCallback callback ; - - tmp_header = speex_packet_to_header ((char*) op->packet, op->bytes) ; - if (tmp_header == NULL) - { psf_log_printf (psf, "Cannot read Speex header\n") ; - return NULL ; - } ; - - memcpy (&spx->header, tmp_header, sizeof (spx->header)) ; - free (tmp_header) ; - tmp_header = NULL ; - - if (spx->header.mode >= SPEEX_NB_MODES || spx->header.mode < 0) - { psf_log_printf (psf, "Mode number %d does not (yet/any longer) exist in this version\n", spx->header.mode) ; - return NULL ; - } ; - - modeID = spx->header.mode ; - if (force_mode != -1) - modeID = force_mode ; - - mode = speex_lib_get_mode (modeID) ; - - if (spx->header.speex_version_id > 1) - { psf_log_printf (psf, "This file was encoded with Speex bit-stream version %d, which I don't know how to decode\n", spx->header.speex_version_id) ; - return NULL ; - } ; - - if (mode->bitstream_version < spx->header.mode_bitstream_version) - { psf_log_printf (psf, "The file was encoded with a newer version of Speex. You need to upgrade in order to play it.\n") ; - return NULL ; - } ; - - if (mode->bitstream_version > spx->header.mode_bitstream_version) - { psf_log_printf (psf, "The file was encoded with an older version of Speex. You would need to downgrade the version in order to play it.\n") ; - return NULL ; - } ; - - st = speex_decoder_init (mode) ; - if (!st) - { psf_log_printf (psf, "Decoder initialization failed.\n") ; - return NULL ; - } ; - - speex_decoder_ctl (st, SPEEX_SET_ENH, &enh_enabled) ; - speex_decoder_ctl (st, SPEEX_GET_FRAME_SIZE, &spx->frame_size) ; - spx->granule_frame_size = spx->frame_size ; - - if (!psf->sf.samplerate) - psf->sf.samplerate = spx->header.rate ; - /* Adjust rate if --force-* options are used */ - if (force_mode != -1) - { if (spx->header.mode < force_mode) - { psf->sf.samplerate <<= (force_mode - spx->header.mode) ; - spx->granule_frame_size >>= (force_mode - spx->header.mode) ; - } ; - if (spx->header.mode > force_mode) - { psf->sf.samplerate >>= (spx->header.mode - force_mode) ; - spx->granule_frame_size <<= (spx->header.mode - force_mode) ; - } ; - } ; - - speex_decoder_ctl (st, SPEEX_SET_SAMPLING_RATE, &psf->sf.samplerate) ; - - spx->nframes = spx->header.frames_per_packet ; - - if (psf->sf.channels == -1) - psf->sf.channels = spx->header.nb_channels ; - - if (! (psf->sf.channels == 1)) - { psf->sf.channels = 2 ; - callback.callback_id = SPEEX_INBAND_STEREO ; - callback.func = speex_std_stereo_request_handler ; - callback.data = &spx->stereo ; - speex_decoder_ctl (st, SPEEX_SET_HANDLER, &callback) ; - } ; - - spx->header.speex_version [sizeof (spx->header.speex_version) - 1] = 0 ; - - psf_log_printf (psf, " Encoder ver : %s\n Frames/packet : %d\n", - spx->header.speex_version, spx->header.frames_per_packet) ; - - if (spx->header.bitrate > 0) - psf_log_printf (psf, " Bit rate : %d\n", spx->header.bitrate) ; - - psf_log_printf (psf, " Sample rate : %d\n Mode : %s\n VBR : %s\n Channels : %d\n", - psf->sf.samplerate, mode->modeName, (spx->header.vbr ? "yes" : "no"), psf->sf.channels) ; - - psf_log_printf (psf, " Extra headers : %d\n", spx->header.extra_headers) ; - - return st ; -} /* spx_header_read */ - - -static void -spx_print_comments (const char *c, int length) -{ - const char *end ; - int len, i, nb_fields ; - -printf ("%s %d\n", __func__, __LINE__) ; - if (length < 8) - { fprintf (stderr, "Invalid/corrupted comments\n") ; - return ; - } - end = c + length ; - len = readint (c, 0) ; - c += 4 ; - if (len < 0 || c + len > end) - { fprintf (stderr, "Invalid/corrupted comments\n") ; - return ; - } - (void) fwrite (c, 1, len, stderr) ; - c += len ; - fprintf (stderr, "\n") ; - if (c + 4 > end) - { fprintf (stderr, "Invalid/corrupted comments\n") ; - return ; - } - nb_fields = readint (c, 0) ; - c += 4 ; - for (i = 0 ; i < nb_fields ; i++) - { if (c + 4 > end) - { fprintf (stderr, "Invalid/corrupted comments\n") ; - return ; - } ; - len = readint (c, 0) ; - c += 4 ; - if (len < 0 || c + len > end) - { fprintf (stderr, "Invalid/corrupted comments\n") ; - return ; - } - (void) fwrite (c, 1, len, stderr) ; - c += len ; - fprintf (stderr, "\n") ; - } ; - return ; -} /* spx_print_comments */ - - -/* -encoded_speex_frames = (frames_per_packet * Packets) - = 1 * 272 - = 272 - -audio_samples = encoded_speex_frames * frame_size - = 272 * 640 - = 174080 - -duration = audio_samples / rate - = 174080 / 44100 - = 3.947 -*/ - -#else /* ENABLE_EXPERIMENTAL_CODE && HAVE_EXTERNAL_LIBS */ - -int -ogg_speex_open (SF_PRIVATE *psf) -{ - psf_log_printf (psf, "This version of libsndfile was compiled without Ogg/Speex support.\n") ; - return SFE_UNIMPLEMENTED ; -} /* ogg_speex_open */ - -#endif diff --git a/libs/libsndfile/src/ogg_vorbis.c b/libs/libsndfile/src/ogg_vorbis.c deleted file mode 100644 index 4d1adef20f..0000000000 --- a/libs/libsndfile/src/ogg_vorbis.c +++ /dev/null @@ -1,1172 +0,0 @@ -/* -** Copyright (C) 2002-2012 Erik de Castro Lopo -** Copyright (C) 2002-2005 Michael Smith -** Copyright (C) 2007 John ffitch -** -** This program is free software ; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation ; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program ; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** Much of this code is based on the examples in libvorbis from the -** XIPHOPHORUS Company http://www.xiph.org/ which has a BSD-style Licence -** Copyright (c) 2002, Xiph.org Foundation -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** -** - Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** -** - Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** -** - Neither the name of the Xiph.org Foundation nor the names of its -** contributors may be used to endorse or promote products derived from -** this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION -** OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE, -** DATA, OR PROFITS ; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if HAVE_EXTERNAL_LIBS - -#include -#include -#include - -#include "ogg.h" - -typedef int convert_func (SF_PRIVATE *psf, int, void *, int, int, float **) ; - -static int vorbis_read_header (SF_PRIVATE *psf, int log_data) ; -static int vorbis_write_header (SF_PRIVATE *psf, int calc_length) ; -static int vorbis_close (SF_PRIVATE *psf) ; -static int vorbis_command (SF_PRIVATE *psf, int command, void *data, int datasize) ; -static int vorbis_byterate (SF_PRIVATE *psf) ; -static sf_count_t vorbis_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; -static sf_count_t vorbis_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t vorbis_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t vorbis_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t vorbis_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; -static sf_count_t vorbis_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t vorbis_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t vorbis_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t vorbis_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; -static sf_count_t vorbis_read_sample (SF_PRIVATE *psf, void *ptr, sf_count_t lens, convert_func *transfn) ; -static sf_count_t vorbis_length (SF_PRIVATE *psf) ; - -typedef struct -{ int id ; - const char *name ; -} STR_PAIRS ; - -static STR_PAIRS vorbis_metatypes [] = -{ { SF_STR_TITLE, "Title" }, - { SF_STR_COPYRIGHT, "Copyright" }, - { SF_STR_SOFTWARE, "Software" }, - { SF_STR_ARTIST, "Artist" }, - { SF_STR_COMMENT, "Comment" }, - { SF_STR_DATE, "Date" }, - { SF_STR_ALBUM, "Album" }, - { SF_STR_LICENSE, "License" }, -} ; - -typedef struct -{ /* Count current location */ - sf_count_t loc ; - /* Struct that stores all the static vorbis bitstream settings */ - vorbis_info vinfo ; - /* Struct that stores all the bitstream user comments */ - vorbis_comment vcomment ; - /* Ventral working state for the packet->PCM decoder */ - vorbis_dsp_state vdsp ; - /* Local working space for packet->PCM decode */ - vorbis_block vblock ; - - /* Encoding quality in range [0.0, 1.0]. */ - double quality ; -} VORBIS_PRIVATE ; - -static int -vorbis_read_header (SF_PRIVATE *psf, int log_data) -{ - OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ; - VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ; - char *buffer ; - int bytes ; - int i, nn ; - - odata->eos = 0 ; - - /* Weird stuff happens if these aren't called. */ - ogg_stream_reset (&odata->ostream) ; - ogg_sync_reset (&odata->osync) ; - - /* - ** Grab some data at the head of the stream. We want the first page - ** (which is guaranteed to be small and only contain the Vorbis - ** stream initial header) We need the first page to get the stream - ** serialno. - */ - - /* Expose the buffer */ - buffer = ogg_sync_buffer (&odata->osync, 4096L) ; - - /* Grab the part of the header that has already been read. */ - memcpy (buffer, psf->header, psf->headindex) ; - bytes = psf->headindex ; - - /* Submit a 4k block to libvorbis' Ogg layer */ - bytes += psf_fread (buffer + psf->headindex, 1, 4096 - psf->headindex, psf) ; - ogg_sync_wrote (&odata->osync, bytes) ; - - /* Get the first page. */ - if ((nn = ogg_sync_pageout (&odata->osync, &odata->opage)) != 1) - { - /* Have we simply run out of data? If so, we're done. */ - if (bytes < 4096) - return 0 ; - - /* Error case. Must not be Vorbis data */ - psf_log_printf (psf, "Input does not appear to be an Ogg bitstream.\n") ; - return SFE_MALFORMED_FILE ; - } ; - - /* - ** Get the serial number and set up the rest of decode. - ** Serialno first ; use it to set up a logical stream. - */ - ogg_stream_clear (&odata->ostream) ; - ogg_stream_init (&odata->ostream, ogg_page_serialno (&odata->opage)) ; - - if (ogg_stream_pagein (&odata->ostream, &odata->opage) < 0) - { /* Error ; stream version mismatch perhaps. */ - psf_log_printf (psf, "Error reading first page of Ogg bitstream data\n") ; - return SFE_MALFORMED_FILE ; - } ; - - if (ogg_stream_packetout (&odata->ostream, &odata->opacket) != 1) - { /* No page? must not be vorbis. */ - psf_log_printf (psf, "Error reading initial header packet.\n") ; - return SFE_MALFORMED_FILE ; - } ; - - /* - ** This function (vorbis_read_header) gets called multiple times, so the OGG - ** and vorbis structs have to be cleared every time we pass through to - ** prevent memory leaks. - */ - vorbis_block_clear (&vdata->vblock) ; - vorbis_dsp_clear (&vdata->vdsp) ; - vorbis_comment_clear (&vdata->vcomment) ; - vorbis_info_clear (&vdata->vinfo) ; - - /* - ** Extract the initial header from the first page and verify that the - ** Ogg bitstream is in fact Vorbis data. - ** - ** I handle the initial header first instead of just having the code - ** read all three Vorbis headers at once because reading the initial - ** header is an easy way to identify a Vorbis bitstream and it's - ** useful to see that functionality seperated out. - */ - vorbis_info_init (&vdata->vinfo) ; - vorbis_comment_init (&vdata->vcomment) ; - - if (vorbis_synthesis_headerin (&vdata->vinfo, &vdata->vcomment, &odata->opacket) < 0) - { /* Error case ; not a vorbis header. */ - psf_log_printf (psf, "Found Vorbis in stream header, but vorbis_synthesis_headerin failed.\n") ; - return SFE_MALFORMED_FILE ; - } ; - - /* - ** Common Ogg metadata fields? - ** TITLE, VERSION, ALBUM, TRACKNUMBER, ARTIST, PERFORMER, COPYRIGHT, LICENSE, - ** ORGANIZATION, DESCRIPTION, GENRE, DATE, LOCATION, CONTACT, ISRC, - */ - - if (log_data) - { int k ; - - for (k = 0 ; k < ARRAY_LEN (vorbis_metatypes) ; k++) - { char *dd ; - - dd = vorbis_comment_query (&vdata->vcomment, vorbis_metatypes [k].name, 0) ; - if (dd == NULL) - continue ; - psf_store_string (psf, vorbis_metatypes [k].id, dd) ; - } ; - } ; - - /* - ** At this point, we're sure we're Vorbis. We've set up the logical (Ogg) - ** bitstream decoder. Get the comment and codebook headers and set up the - ** Vorbis decoder. - ** - ** The next two packets in order are the comment and codebook headers. - ** They're likely large and may span multiple pages. Thus we reead - ** and submit data until we get our two pacakets, watching that no - ** pages are missing. If a page is missing, error out ; losing a - ** header page is the only place where missing data is fatal. - */ - - i = 0 ; /* Count of number of packets read */ - while (i < 2) - { int result = ogg_sync_pageout (&odata->osync, &odata->opage) ; - if (result == 0) - { /* Need more data */ - buffer = ogg_sync_buffer (&odata->osync, 4096) ; - bytes = psf_fread (buffer, 1, 4096, psf) ; - - if (bytes == 0 && i < 2) - { psf_log_printf (psf, "End of file before finding all Vorbis headers!\n") ; - return SFE_MALFORMED_FILE ; - } ; - nn = ogg_sync_wrote (&odata->osync, bytes) ; - } - else if (result == 1) - { /* - ** Don't complain about missing or corrupt data yet. We'll - ** catch it at the packet output phase. - ** - ** We can ignore any errors here as they'll also become apparent - ** at packetout. - */ - nn = ogg_stream_pagein (&odata->ostream, &odata->opage) ; - while (i < 2) - { result = ogg_stream_packetout (&odata->ostream, &odata->opacket) ; - if (result == 0) - break ; - if (result < 0) - { /* Uh oh ; data at some point was corrupted or missing! - ** We can't tolerate that in a header. Die. */ - psf_log_printf (psf, "Corrupt secondary header. Exiting.\n") ; - return SFE_MALFORMED_FILE ; - } ; - - vorbis_synthesis_headerin (&vdata->vinfo, &vdata->vcomment, &odata->opacket) ; - i++ ; - } ; - } ; - } ; - - if (log_data) - { int printed_metadata_msg = 0 ; - int k ; - - psf_log_printf (psf, "Bitstream is %d channel, %D Hz\n", vdata->vinfo.channels, vdata->vinfo.rate) ; - psf_log_printf (psf, "Encoded by : %s\n", vdata->vcomment.vendor) ; - - /* Throw the comments plus a few lines about the bitstream we're decoding. */ - for (k = 0 ; k < ARRAY_LEN (vorbis_metatypes) ; k++) - { char *dd ; - - dd = vorbis_comment_query (&vdata->vcomment, vorbis_metatypes [k].name, 0) ; - if (dd == NULL) - continue ; - - if (printed_metadata_msg == 0) - { psf_log_printf (psf, "Metadata :\n") ; - printed_metadata_msg = 1 ; - } ; - - psf_store_string (psf, vorbis_metatypes [k].id, dd) ; - psf_log_printf (psf, " %-10s : %s\n", vorbis_metatypes [k].name, dd) ; - } ; - - psf_log_printf (psf, "End\n") ; - } ; - - psf->sf.samplerate = vdata->vinfo.rate ; - psf->sf.channels = vdata->vinfo.channels ; - psf->sf.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ; - - /* OK, got and parsed all three headers. Initialize the Vorbis - ** packet->PCM decoder. - ** Central decode state. */ - vorbis_synthesis_init (&vdata->vdsp, &vdata->vinfo) ; - - /* Local state for most of the decode so multiple block decodes can - ** proceed in parallel. We could init multiple vorbis_block structures - ** for vd here. */ - vorbis_block_init (&vdata->vdsp, &vdata->vblock) ; - - vdata->loc = 0 ; - - return 0 ; -} /* vorbis_read_header */ - -static int -vorbis_write_header (SF_PRIVATE *psf, int UNUSED (calc_length)) -{ - OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ; - VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ; - int k, ret ; - - vorbis_info_init (&vdata->vinfo) ; - - /* The style of encoding should be selectable here, VBR quality mode. */ - ret = vorbis_encode_init_vbr (&vdata->vinfo, psf->sf.channels, psf->sf.samplerate, vdata->quality) ; - -#if 0 - ret = vorbis_encode_init (&vdata->vinfo, psf->sf.channels, psf->sf.samplerate, -1, 128000, -1) ; /* average bitrate mode */ - ret = ( vorbis_encode_setup_managed (&vdata->vinfo, psf->sf.channels, psf->sf.samplerate, -1, 128000, -1) - || vorbis_encode_ctl (&vdata->vinfo, OV_ECTL_RATEMANAGE_AVG, NULL) - || vorbis_encode_setup_init (&vdata->vinfo) - ) ; -#endif - if (ret) - return SFE_BAD_OPEN_FORMAT ; - - vdata->loc = 0 ; - - /* add a comment */ - vorbis_comment_init (&vdata->vcomment) ; - - vorbis_comment_add_tag (&vdata->vcomment, "ENCODER", "libsndfile") ; - for (k = 0 ; k < SF_MAX_STRINGS ; k++) - { const char * name ; - - if (psf->strings.data [k].type == 0) - break ; - - switch (psf->strings.data [k].type) - { case SF_STR_TITLE : name = "TITLE" ; break ; - case SF_STR_COPYRIGHT : name = "COPYRIGHT" ; break ; - case SF_STR_SOFTWARE : name = "SOFTWARE" ; break ; - case SF_STR_ARTIST : name = "ARTIST" ; break ; - case SF_STR_COMMENT : name = "COMMENT" ; break ; - case SF_STR_DATE : name = "DATE" ; break ; - case SF_STR_ALBUM : name = "ALBUM" ; break ; - case SF_STR_LICENSE : name = "LICENSE" ; break ; - default : continue ; - } ; - - vorbis_comment_add_tag (&vdata->vcomment, name, psf->strings.storage + psf->strings.data [k].offset) ; - } ; - - /* set up the analysis state and auxiliary encoding storage */ - vorbis_analysis_init (&vdata->vdsp, &vdata->vinfo) ; - vorbis_block_init (&vdata->vdsp, &vdata->vblock) ; - - /* - ** Set up our packet->stream encoder. - ** Pick a random serial number ; that way we can more likely build - ** chained streams just by concatenation. - */ - - ogg_stream_init (&odata->ostream, psf_rand_int32 ()) ; - - /* Vorbis streams begin with three headers ; the initial header (with - most of the codec setup parameters) which is mandated by the Ogg - bitstream spec. The second header holds any comment fields. The - third header holds the bitstream codebook. We merely need to - make the headers, then pass them to libvorbis one at a time ; - libvorbis handles the additional Ogg bitstream constraints */ - - { ogg_packet header ; - ogg_packet header_comm ; - ogg_packet header_code ; - int result ; - - vorbis_analysis_headerout (&vdata->vdsp, &vdata->vcomment, &header, &header_comm, &header_code) ; - ogg_stream_packetin (&odata->ostream, &header) ; /* automatically placed in its own page */ - ogg_stream_packetin (&odata->ostream, &header_comm) ; - ogg_stream_packetin (&odata->ostream, &header_code) ; - - /* This ensures the actual - * audio data will start on a new page, as per spec - */ - while ((result = ogg_stream_flush (&odata->ostream, &odata->opage)) != 0) - { psf_fwrite (odata->opage.header, 1, odata->opage.header_len, psf) ; - psf_fwrite (odata->opage.body, 1, odata->opage.body_len, psf) ; - } ; - } - - return 0 ; -} /* vorbis_write_header */ - -static int -vorbis_close (SF_PRIVATE *psf) -{ OGG_PRIVATE* odata = psf->container_data ; - VORBIS_PRIVATE *vdata = psf->codec_data ; - - if (odata == NULL || vdata == NULL) - return 0 ; - - /* Clean up this logical bitstream ; before exit we shuld see if we're - ** followed by another [chained]. */ - - if (psf->file.mode == SFM_WRITE) - { - if (psf->write_current <= 0) - vorbis_write_header (psf, 0) ; - - vorbis_analysis_wrote (&vdata->vdsp, 0) ; - while (vorbis_analysis_blockout (&vdata->vdsp, &vdata->vblock) == 1) - { - - /* analysis, assume we want to use bitrate management */ - vorbis_analysis (&vdata->vblock, NULL) ; - vorbis_bitrate_addblock (&vdata->vblock) ; - - while (vorbis_bitrate_flushpacket (&vdata->vdsp, &odata->opacket)) - { /* weld the packet into the bitstream */ - ogg_stream_packetin (&odata->ostream, &odata->opacket) ; - - /* write out pages (if any) */ - while (!odata->eos) - { int result = ogg_stream_pageout (&odata->ostream, &odata->opage) ; - if (result == 0) break ; - psf_fwrite (odata->opage.header, 1, odata->opage.header_len, psf) ; - psf_fwrite (odata->opage.body, 1, odata->opage.body_len, psf) ; - - /* this could be set above, but for illustrative purposes, I do - it here (to show that vorbis does know where the stream ends) */ - - if (ogg_page_eos (&odata->opage)) odata->eos = 1 ; - } - } - } - } - - /* ogg_page and ogg_packet structs always point to storage in - libvorbis. They are never freed or manipulated directly */ - - vorbis_block_clear (&vdata->vblock) ; - vorbis_dsp_clear (&vdata->vdsp) ; - vorbis_comment_clear (&vdata->vcomment) ; - vorbis_info_clear (&vdata->vinfo) ; - - return 0 ; -} /* vorbis_close */ - -int -ogg_vorbis_open (SF_PRIVATE *psf) -{ OGG_PRIVATE* odata = psf->container_data ; - VORBIS_PRIVATE* vdata = calloc (1, sizeof (VORBIS_PRIVATE)) ; - int error = 0 ; - - if (odata == NULL) - { psf_log_printf (psf, "%s : odata is NULL???\n", __func__) ; - return SFE_INTERNAL ; - } ; - - psf->codec_data = vdata ; - - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - psf_log_printf (psf, "Vorbis library version : %s\n", vorbis_version_string ()) ; - - if (psf->file.mode == SFM_READ) - { /* Call this here so it only gets called once, so no memory is leaked. */ - ogg_sync_init (&odata->osync) ; - - if ((error = vorbis_read_header (psf, 1))) - return error ; - - psf->read_short = vorbis_read_s ; - psf->read_int = vorbis_read_i ; - psf->read_float = vorbis_read_f ; - psf->read_double = vorbis_read_d ; - psf->sf.frames = vorbis_length (psf) ; - } ; - - psf->codec_close = vorbis_close ; - if (psf->file.mode == SFM_WRITE) - { - /* Set the default vorbis quality here. */ - vdata->quality = 0.4 ; - - psf->write_header = vorbis_write_header ; - psf->write_short = vorbis_write_s ; - psf->write_int = vorbis_write_i ; - psf->write_float = vorbis_write_f ; - psf->write_double = vorbis_write_d ; - - psf->sf.frames = SF_COUNT_MAX ; /* Unknown really */ - psf->strings.flags = SF_STR_ALLOW_START ; - } ; - - psf->seek = vorbis_seek ; - psf->command = vorbis_command ; - psf->byterate = vorbis_byterate ; - - /* FIXME, FIXME, FIXME : Hack these here for now and correct later. */ - psf->sf.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ; - psf->sf.sections = 1 ; - - psf->datalength = 1 ; - psf->dataoffset = 0 ; - /* End FIXME. */ - - return error ; -} /* ogg_vorbis_open */ - -static int -vorbis_command (SF_PRIVATE *psf, int command, void * data, int datasize) -{ VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ; - - switch (command) - { case SFC_SET_COMPRESSION_LEVEL : - if (data == NULL || datasize != sizeof (double)) - return SF_FALSE ; - - if (psf->have_written) - return SF_FALSE ; - - vdata->quality = 1.0 - *((double *) data) ; - - /* Clip range. */ - vdata->quality = SF_MAX (0.0, SF_MIN (1.0, vdata->quality)) ; - - psf_log_printf (psf, "%s : Setting SFC_SET_VBR_ENCODING_QUALITY to %f.\n", __func__, vdata->quality) ; - return SF_TRUE ; - - default : - return SF_FALSE ; - } ; - - return SF_FALSE ; -} /* vorbis_command */ - -static int -vorbis_rnull (SF_PRIVATE *UNUSED (psf), int samples, void *UNUSED (vptr), int UNUSED (off) , int channels, float **UNUSED (pcm)) -{ - return samples * channels ; -} /* vorbis_rnull */ - -static int -vorbis_rshort (SF_PRIVATE *psf, int samples, void *vptr, int off, int channels, float **pcm) -{ - short *ptr = (short*) vptr + off ; - int i = 0, j, n ; - if (psf->float_int_mult) - { - float inverse = 1.0 / psf->float_max ; - for (j = 0 ; j < samples ; j++) - for (n = 0 ; n < channels ; n++) - ptr [i++] = lrintf ((pcm [n][j] * inverse) * 32767.0f) ; - } - else - { - for (j = 0 ; j < samples ; j++) - for (n = 0 ; n < channels ; n++) - ptr [i++] = lrintf (pcm [n][j] * 32767.0f) ; - } - return i ; -} /* vorbis_rshort */ - -static int -vorbis_rint (SF_PRIVATE *psf, int samples, void *vptr, int off, int channels, float **pcm) -{ - int *ptr = (int*) vptr + off ; - int i = 0, j, n ; - - if (psf->float_int_mult) - { - float inverse = 1.0 / psf->float_max ; - for (j = 0 ; j < samples ; j++) - for (n = 0 ; n < channels ; n++) - ptr [i++] = lrintf ((pcm [n][j] * inverse) * 2147483647.0f) ; - } - else - { - for (j = 0 ; j < samples ; j++) - for (n = 0 ; n < channels ; n++) - ptr [i++] = lrintf (pcm [n][j] * 2147483647.0f) ; - } - return i ; -} /* vorbis_rint */ - -static int -vorbis_rfloat (SF_PRIVATE *UNUSED (psf), int samples, void *vptr, int off, int channels, float **pcm) -{ - float *ptr = (float*) vptr + off ; - int i = 0, j, n ; - for (j = 0 ; j < samples ; j++) - for (n = 0 ; n < channels ; n++) - ptr [i++] = pcm [n][j] ; - return i ; -} /* vorbis_rfloat */ - -static int -vorbis_rdouble (SF_PRIVATE *UNUSED (psf), int samples, void *vptr, int off, int channels, float **pcm) -{ - double *ptr = (double*) vptr + off ; - int i = 0, j, n ; - for (j = 0 ; j < samples ; j++) - for (n = 0 ; n < channels ; n++) - ptr [i++] = pcm [n][j] ; - return i ; -} /* vorbis_rdouble */ - - -static sf_count_t -vorbis_read_sample (SF_PRIVATE *psf, void *ptr, sf_count_t lens, convert_func *transfn) -{ - VORBIS_PRIVATE *vdata = psf->codec_data ; - OGG_PRIVATE *odata = psf->container_data ; - int len, samples, i = 0 ; - float **pcm ; - - len = lens / psf->sf.channels ; - - while ((samples = vorbis_synthesis_pcmout (&vdata->vdsp, &pcm)) > 0) - { if (samples > len) samples = len ; - i += transfn (psf, samples, ptr, i, psf->sf.channels, pcm) ; - len -= samples ; - /* tell libvorbis how many samples we actually consumed */ - vorbis_synthesis_read (&vdata->vdsp, samples) ; - vdata->loc += samples ; - if (len == 0) - return i ; /* Is this necessary */ - } - goto start0 ; /* Jump into the nasty nest */ - while (len > 0 && !odata->eos) - { - while (len > 0 && !odata->eos) - { int result = ogg_sync_pageout (&odata->osync, &odata->opage) ; - if (result == 0) break ; /* need more data */ - if (result < 0) - { /* missing or corrupt data at this page position */ - psf_log_printf (psf, "Corrupt or missing data in bitstream ; continuing...\n") ; - } - else - { /* can safely ignore errors at this point */ - ogg_stream_pagein (&odata->ostream, &odata->opage) ; - start0: - while (1) - { result = ogg_stream_packetout (&odata->ostream, &odata->opacket) ; - if (result == 0) - break ; /* need more data */ - if (result < 0) - { /* missing or corrupt data at this page position */ - /* no reason to complain ; already complained above */ - } - else - { /* we have a packet. Decode it */ - if (vorbis_synthesis (&vdata->vblock, &odata->opacket) == 0) /* test for success! */ - vorbis_synthesis_blockin (&vdata->vdsp, &vdata->vblock) ; - /* - ** pcm is a multichannel float vector. In stereo, for - ** example, pcm [0] is left, and pcm [1] is right. samples is - ** the size of each channel. Convert the float values - ** (-1.<=range<=1.) to whatever PCM format and write it out. - */ - - while ((samples = vorbis_synthesis_pcmout (&vdata->vdsp, &pcm)) > 0) - { if (samples > len) samples = len ; - i += transfn (psf, samples, ptr, i, psf->sf.channels, pcm) ; - len -= samples ; - /* tell libvorbis how many samples we actually consumed */ - vorbis_synthesis_read (&vdata->vdsp, samples) ; - vdata->loc += samples ; - if (len == 0) - return i ; /* Is this necessary */ - } ; - } - } - if (ogg_page_eos (&odata->opage)) odata->eos = 1 ; - } - } - if (!odata->eos) - { char *buffer ; - int bytes ; - buffer = ogg_sync_buffer (&odata->osync, 4096) ; - bytes = psf_fread (buffer, 1, 4096, psf) ; - ogg_sync_wrote (&odata->osync, bytes) ; - if (bytes == 0) odata->eos = 1 ; - } - } - return i ; -} /* vorbis_read_sample */ - -static sf_count_t -vorbis_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t lens) -{ return vorbis_read_sample (psf, (void*) ptr, lens, vorbis_rshort) ; -} /* vorbis_read_s */ - -static sf_count_t -vorbis_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t lens) -{ return vorbis_read_sample (psf, (void*) ptr, lens, vorbis_rint) ; -} /* vorbis_read_i */ - -static sf_count_t -vorbis_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t lens) -{ return vorbis_read_sample (psf, (void*) ptr, lens, vorbis_rfloat) ; -} /* vorbis_read_f */ - -static sf_count_t -vorbis_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t lens) -{ return vorbis_read_sample (psf, (void*) ptr, lens, vorbis_rdouble) ; -} /* vorbis_read_d */ - -/*============================================================================== -*/ - -static void -vorbis_write_samples (SF_PRIVATE *psf, OGG_PRIVATE *odata, VORBIS_PRIVATE *vdata, int in_frames) -{ - vorbis_analysis_wrote (&vdata->vdsp, in_frames) ; - - /* - ** Vorbis does some data preanalysis, then divvies up blocks for - ** more involved (potentially parallel) processing. Get a single - ** block for encoding now. - */ - while (vorbis_analysis_blockout (&vdata->vdsp, &vdata->vblock) == 1) - { - /* analysis, assume we want to use bitrate management */ - vorbis_analysis (&vdata->vblock, NULL) ; - vorbis_bitrate_addblock (&vdata->vblock) ; - - while (vorbis_bitrate_flushpacket (&vdata->vdsp, &odata->opacket)) - { - /* weld the packet into the bitstream */ - ogg_stream_packetin (&odata->ostream, &odata->opacket) ; - - /* write out pages (if any) */ - while (!odata->eos) - { int result = ogg_stream_pageout (&odata->ostream, &odata->opage) ; - if (result == 0) - break ; - psf_fwrite (odata->opage.header, 1, odata->opage.header_len, psf) ; - psf_fwrite (odata->opage.body, 1, odata->opage.body_len, psf) ; - - /* This could be set above, but for illustrative purposes, I do - ** it here (to show that vorbis does know where the stream ends) */ - if (ogg_page_eos (&odata->opage)) - odata->eos = 1 ; - } ; - } ; - } ; - - vdata->loc += in_frames ; -} /* vorbis_write_data */ - - -static sf_count_t -vorbis_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t lens) -{ - int i, m, j = 0 ; - OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ; - VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ; - int in_frames = lens / psf->sf.channels ; - float **buffer = vorbis_analysis_buffer (&vdata->vdsp, in_frames) ; - for (i = 0 ; i < in_frames ; i++) - for (m = 0 ; m < psf->sf.channels ; m++) - buffer [m][i] = (float) (ptr [j++]) / 32767.0f ; - - vorbis_write_samples (psf, odata, vdata, in_frames) ; - - return lens ; -} /* vorbis_write_s */ - -static sf_count_t -vorbis_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t lens) -{ int i, m, j = 0 ; - OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ; - VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ; - int in_frames = lens / psf->sf.channels ; - float **buffer = vorbis_analysis_buffer (&vdata->vdsp, in_frames) ; - for (i = 0 ; i < in_frames ; i++) - for (m = 0 ; m < psf->sf.channels ; m++) - buffer [m][i] = (float) (ptr [j++]) / 2147483647.0f ; - - vorbis_write_samples (psf, odata, vdata, in_frames) ; - - return lens ; -} /* vorbis_write_i */ - -static sf_count_t -vorbis_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t lens) -{ int i, m, j = 0 ; - OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ; - VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ; - int in_frames = lens / psf->sf.channels ; - float **buffer = vorbis_analysis_buffer (&vdata->vdsp, in_frames) ; - for (i = 0 ; i < in_frames ; i++) - for (m = 0 ; m < psf->sf.channels ; m++) - buffer [m][i] = ptr [j++] ; - - vorbis_write_samples (psf, odata, vdata, in_frames) ; - - return lens ; -} /* vorbis_write_f */ - -static sf_count_t -vorbis_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t lens) -{ int i, m, j = 0 ; - OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ; - VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ; - int in_frames = lens / psf->sf.channels ; - float **buffer = vorbis_analysis_buffer (&vdata->vdsp, in_frames) ; - for (i = 0 ; i < in_frames ; i++) - for (m = 0 ; m < psf->sf.channels ; m++) - buffer [m][i] = (float) ptr [j++] ; - - vorbis_write_samples (psf, odata, vdata, in_frames) ; - - return lens ; -} /* vorbis_write_d */ - -static sf_count_t -vorbis_seek (SF_PRIVATE *psf, int UNUSED (mode), sf_count_t offset) -{ - OGG_PRIVATE *odata = (OGG_PRIVATE *) psf->container_data ; - VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ; - - if (odata == NULL || vdata == NULL) - return 0 ; - - if (offset < 0) - { psf->error = SFE_BAD_SEEK ; - return ((sf_count_t) -1) ; - } ; - - if (psf->file.mode == SFM_READ) - { sf_count_t target = offset - vdata->loc ; - - if (target < 0) - { /* 12 to allow for OggS bit */ - psf_fseek (psf, 12, SEEK_SET) ; - vorbis_read_header (psf, 0) ; /* Reset state */ - target = offset ; - } ; - - while (target > 0) - { sf_count_t m = target > 4096 ? 4096 : target ; - - /* - ** Need to multiply by channels here because the seek is done in - ** terms of frames and the read function is done in terms of - ** samples. - */ - vorbis_read_sample (psf, (void *) NULL, m * psf->sf.channels, vorbis_rnull) ; - - target -= m ; - } ; - - return vdata->loc ; - } ; - - return 0 ; -} /* vorbis_seek */ - - -static int -vorbis_byterate (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_READ) - return (psf->datalength * psf->sf.samplerate) / psf->sf.frames ; - - return -1 ; -} /* vorbis_byterate */ - -/*============================================================================== -** Most of the following code was snipped from Mike Smith's ogginfo utility -** which is part of vorbis-tools. -** Vorbis tools is released under the GPL but Mike has kindly allowed the -** following to be relicensed as LGPL for libsndfile. -*/ - -typedef struct -{ - int isillegal ; - int shownillegal ; - int isnew ; - int end ; - - uint32_t serial ; /* must be 32 bit unsigned */ - ogg_stream_state ostream ; - - vorbis_info vinfo ; - vorbis_comment vcomment ; - sf_count_t lastgranulepos ; - int doneheaders ; -} stream_processor ; - -typedef struct -{ - stream_processor *streams ; - int allocated ; - int used ; - int in_headers ; -} stream_set ; - -static stream_set * -create_stream_set (void) -{ stream_set *set = calloc (1, sizeof (stream_set)) ; - - set->streams = calloc (5, sizeof (stream_processor)) ; - set->allocated = 5 ; - set->used = 0 ; - - return set ; -} /* create_stream_set */ - -static void -vorbis_end (stream_processor *stream, sf_count_t * len) -{ *len += stream->lastgranulepos ; - vorbis_comment_clear (&stream->vcomment) ; - vorbis_info_clear (&stream->vinfo) ; -} /* vorbis_end */ - -static void -free_stream_set (stream_set *set, sf_count_t * len) -{ int i ; - - for (i = 0 ; i < set->used ; i++) - { if (!set->streams [i].end) - vorbis_end (&set->streams [i], len) ; - ogg_stream_clear (&set->streams [i].ostream) ; - } ; - - free (set->streams) ; - free (set) ; -} /* free_stream_set */ - -static int -streams_open (stream_set *set) -{ int i, res = 0 ; - - for (i = 0 ; i < set->used ; i++) - if (!set->streams [i].end) - res ++ ; - return res ; -} /* streams_open */ - -static stream_processor * -find_stream_processor (stream_set *set, ogg_page *page) -{ uint32_t serial = ogg_page_serialno (page) ; - int i, invalid = 0 ; - - stream_processor *stream ; - - for (i = 0 ; i < set->used ; i++) - { - if (serial == set->streams [i].serial) - { /* We have a match! */ - stream = & (set->streams [i]) ; - - set->in_headers = 0 ; - /* if we have detected EOS, then this can't occur here. */ - if (stream->end) - { stream->isillegal = 1 ; - return stream ; - } - - stream->isnew = 0 ; - stream->end = ogg_page_eos (page) ; - stream->serial = serial ; - return stream ; - } ; - } ; - - /* If there are streams open, and we've reached the end of the - ** headers, then we can't be starting a new stream. - ** XXX: might this sometimes catch ok streams if EOS flag is missing, - ** but the stream is otherwise ok? - */ - if (streams_open (set) && !set->in_headers) - invalid = 1 ; - - set->in_headers = 1 ; - - if (set->allocated < set->used) - stream = &set->streams [set->used] ; - else - { set->allocated += 5 ; - set->streams = realloc (set->streams, sizeof (stream_processor) * set->allocated) ; - stream = &set->streams [set->used] ; - } ; - - set->used++ ; - - stream->isnew = 1 ; - stream->isillegal = invalid ; - - { - int res ; - ogg_packet packet ; - - /* We end up processing the header page twice, but that's ok. */ - ogg_stream_init (&stream->ostream, serial) ; - ogg_stream_pagein (&stream->ostream, page) ; - res = ogg_stream_packetout (&stream->ostream, &packet) ; - if (res <= 0) - return NULL ; - else if (packet.bytes >= 7 && memcmp (packet.packet, "\x01vorbis", 7) == 0) - { - stream->lastgranulepos = 0 ; - vorbis_comment_init (&stream->vcomment) ; - vorbis_info_init (&stream->vinfo) ; - } ; - - res = ogg_stream_packetout (&stream->ostream, &packet) ; - - /* re-init, ready for processing */ - ogg_stream_clear (&stream->ostream) ; - ogg_stream_init (&stream->ostream, serial) ; - } - - stream->end = ogg_page_eos (page) ; - stream->serial = serial ; - - return stream ; -} /* find_stream_processor */ - -static int -vorbis_length_get_next_page (SF_PRIVATE *psf, ogg_sync_state * osync, ogg_page *page) -{ static const int CHUNK_SIZE = 4500 ; - - while (ogg_sync_pageout (osync, page) <= 0) - { char * buffer = ogg_sync_buffer (osync, CHUNK_SIZE) ; - int bytes = psf_fread (buffer, 1, 4096, psf) ; - - if (bytes <= 0) - { ogg_sync_wrote (osync, 0) ; - return 0 ; - } ; - - ogg_sync_wrote (osync, bytes) ; - } ; - - return 1 ; -} /* vorbis_length_get_next_page */ - -static sf_count_t -vorbis_length_aux (SF_PRIVATE * psf) -{ - ogg_sync_state osync ; - ogg_page page ; - sf_count_t len = 0 ; - stream_set *processors ; - - processors = create_stream_set () ; - if (processors == NULL) - return 0 ; // out of memory? - - ogg_sync_init (&osync) ; - - while (vorbis_length_get_next_page (psf, &osync, &page)) - { - stream_processor *p = find_stream_processor (processors, &page) ; - - if (!p) - { len = 0 ; - break ; - } ; - - if (p->isillegal && !p->shownillegal) - { - p->shownillegal = 1 ; - /* If it's a new stream, we want to continue processing this page - ** anyway to suppress additional spurious errors - */ - if (!p->isnew) continue ; - } ; - - if (!p->isillegal) - { ogg_packet packet ; - int header = 0 ; - - ogg_stream_pagein (&p->ostream, &page) ; - if (p->doneheaders < 3) - header = 1 ; - - while (ogg_stream_packetout (&p->ostream, &packet) > 0) - { - if (p->doneheaders < 3) - { if (vorbis_synthesis_headerin (&p->vinfo, &p->vcomment, &packet) < 0) - continue ; - p->doneheaders ++ ; - } ; - } ; - if (!header) - { sf_count_t gp = ogg_page_granulepos (&page) ; - if (gp > 0) p->lastgranulepos = gp ; - } ; - if (p->end) - { vorbis_end (p, &len) ; - p->isillegal = 1 ; - } ; - } ; - } ; - - ogg_sync_clear (&osync) ; - free_stream_set (processors, &len) ; - - return len ; -} /* vorbis_length_aux */ - -static sf_count_t -vorbis_length (SF_PRIVATE *psf) -{ sf_count_t length ; - int error ; - - if (psf->sf.seekable == 0) - return SF_COUNT_MAX ; - - psf_fseek (psf, 0, SEEK_SET) ; - length = vorbis_length_aux (psf) ; - - psf_fseek (psf, 12, SEEK_SET) ; - if ((error = vorbis_read_header (psf, 0)) != 0) - psf->error = error ; - - return length ; -} /* vorbis_length */ - -#else /* HAVE_EXTERNAL_LIBS */ - -int -ogg_vorbis_open (SF_PRIVATE *psf) -{ - psf_log_printf (psf, "This version of libsndfile was compiled without Ogg/Vorbis support.\n") ; - return SFE_UNIMPLEMENTED ; -} /* ogg_vorbis_open */ - -#endif diff --git a/libs/libsndfile/src/paf.c b/libs/libsndfile/src/paf.c deleted file mode 100644 index 1360c33710..0000000000 --- a/libs/libsndfile/src/paf.c +++ /dev/null @@ -1,819 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues. -*/ - -#define FAP_MARKER (MAKE_MARKER ('f', 'a', 'p', ' ')) -#define PAF_MARKER (MAKE_MARKER (' ', 'p', 'a', 'f')) - -/*------------------------------------------------------------------------------ -** Other defines. -*/ - -#define PAF_HEADER_LENGTH 2048 - -#define PAF24_SAMPLES_PER_BLOCK 10 -#define PAF24_BLOCK_SIZE 32 - -/*------------------------------------------------------------------------------ -** Typedefs. -*/ - -typedef struct -{ int version ; - int endianness ; - int samplerate ; - int format ; - int channels ; - int source ; -} PAF_FMT ; - -typedef struct -{ int max_blocks, channels, blocksize ; - int read_block, write_block, read_count, write_count ; - sf_count_t sample_count ; - int *samples ; - unsigned char *block ; - int data [] ; /* ISO C99 struct flexible array. */ -} PAF24_PRIVATE ; - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int paf24_init (SF_PRIVATE *psf) ; - -static int paf_read_header (SF_PRIVATE *psf) ; -static int paf_write_header (SF_PRIVATE *psf, int calc_length) ; - -static sf_count_t paf24_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t paf24_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t paf24_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t paf24_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t paf24_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t paf24_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t paf24_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t paf24_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static sf_count_t paf24_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; - -enum -{ PAF_PCM_16 = 0, - PAF_PCM_24 = 1, - PAF_PCM_S8 = 2 -} ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -paf_open (SF_PRIVATE *psf) -{ int subformat, error, endian ; - - psf->dataoffset = PAF_HEADER_LENGTH ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = paf_read_header (psf))) - return error ; - } ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_PAF) - return SFE_BAD_OPEN_FORMAT ; - - endian = SF_ENDIAN (psf->sf.format) ; - - /* PAF is by default big endian. */ - psf->endian = SF_ENDIAN_BIG ; - - if (endian == SF_ENDIAN_LITTLE || (CPU_IS_LITTLE_ENDIAN && (endian == SF_ENDIAN_CPU))) - psf->endian = SF_ENDIAN_LITTLE ; - - if ((error = paf_write_header (psf, SF_FALSE))) - return error ; - - psf->write_header = paf_write_header ; - } ; - - switch (subformat) - { case SF_FORMAT_PCM_S8 : - psf->bytewidth = 1 ; - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_PCM_16 : - psf->bytewidth = 2 ; - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_PCM_24 : - /* No bytewidth because of whacky 24 bit encoding. */ - error = paf24_init (psf) ; - break ; - - default : return SFE_PAF_UNKNOWN_FORMAT ; - } ; - - return error ; -} /* paf_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -paf_read_header (SF_PRIVATE *psf) -{ PAF_FMT paf_fmt ; - int marker ; - - if (psf->filelength < PAF_HEADER_LENGTH) - return SFE_PAF_SHORT_HEADER ; - - memset (&paf_fmt, 0, sizeof (paf_fmt)) ; - psf_binheader_readf (psf, "pm", 0, &marker) ; - - psf_log_printf (psf, "Signature : '%M'\n", marker) ; - - if (marker == PAF_MARKER) - { psf_binheader_readf (psf, "E444444", &(paf_fmt.version), &(paf_fmt.endianness), - &(paf_fmt.samplerate), &(paf_fmt.format), &(paf_fmt.channels), &(paf_fmt.source)) ; - } - else if (marker == FAP_MARKER) - { psf_binheader_readf (psf, "e444444", &(paf_fmt.version), &(paf_fmt.endianness), - &(paf_fmt.samplerate), &(paf_fmt.format), &(paf_fmt.channels), &(paf_fmt.source)) ; - } - else - return SFE_PAF_NO_MARKER ; - - psf_log_printf (psf, "Version : %d\n", paf_fmt.version) ; - - if (paf_fmt.version != 0) - { psf_log_printf (psf, "*** Bad version number. should be zero.\n") ; - return SFE_PAF_VERSION ; - } ; - - psf_log_printf (psf, "Sample Rate : %d\n", paf_fmt.samplerate) ; - psf_log_printf (psf, "Channels : %d\n", paf_fmt.channels) ; - - psf_log_printf (psf, "Endianness : %d => ", paf_fmt.endianness) ; - if (paf_fmt.endianness) - { psf_log_printf (psf, "Little\n", paf_fmt.endianness) ; - psf->endian = SF_ENDIAN_LITTLE ; - } - else - { psf_log_printf (psf, "Big\n", paf_fmt.endianness) ; - psf->endian = SF_ENDIAN_BIG ; - } ; - - if (paf_fmt.channels < 1 || paf_fmt.channels > SF_MAX_CHANNELS) - return SFE_PAF_BAD_CHANNELS ; - - psf->datalength = psf->filelength - psf->dataoffset ; - - psf_binheader_readf (psf, "p", (int) psf->dataoffset) ; - - psf->sf.samplerate = paf_fmt.samplerate ; - psf->sf.channels = paf_fmt.channels ; - - /* Only fill in type major. */ - psf->sf.format = SF_FORMAT_PAF ; - - psf_log_printf (psf, "Format : %d => ", paf_fmt.format) ; - - /* PAF is by default big endian. */ - psf->sf.format |= paf_fmt.endianness ? SF_ENDIAN_LITTLE : SF_ENDIAN_BIG ; - - switch (paf_fmt.format) - { case PAF_PCM_S8 : - psf_log_printf (psf, "8 bit linear PCM\n") ; - psf->bytewidth = 1 ; - - psf->sf.format |= SF_FORMAT_PCM_S8 ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - psf->sf.frames = psf->datalength / psf->blockwidth ; - break ; - - case PAF_PCM_16 : - psf_log_printf (psf, "16 bit linear PCM\n") ; - psf->bytewidth = 2 ; - - psf->sf.format |= SF_FORMAT_PCM_16 ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - psf->sf.frames = psf->datalength / psf->blockwidth ; - break ; - - case PAF_PCM_24 : - psf_log_printf (psf, "24 bit linear PCM\n") ; - psf->bytewidth = 3 ; - - psf->sf.format |= SF_FORMAT_PCM_24 ; - - psf->blockwidth = 0 ; - psf->sf.frames = PAF24_SAMPLES_PER_BLOCK * psf->datalength / - (PAF24_BLOCK_SIZE * psf->sf.channels) ; - break ; - - default : psf_log_printf (psf, "Unknown\n") ; - return SFE_PAF_UNKNOWN_FORMAT ; - break ; - } ; - - psf_log_printf (psf, "Source : %d => ", paf_fmt.source) ; - - switch (paf_fmt.source) - { case 1 : psf_log_printf (psf, "Analog Recording\n") ; - break ; - case 2 : psf_log_printf (psf, "Digital Transfer\n") ; - break ; - case 3 : psf_log_printf (psf, "Multi-track Mixdown\n") ; - break ; - case 5 : psf_log_printf (psf, "Audio Resulting From DSP Processing\n") ; - break ; - default : psf_log_printf (psf, "Unknown\n") ; - break ; - } ; - - return 0 ; -} /* paf_read_header */ - -static int -paf_write_header (SF_PRIVATE *psf, int UNUSED (calc_length)) -{ int paf_format ; - - /* PAF header already written so no need to re-write. */ - if (psf_ftell (psf) >= PAF_HEADER_LENGTH) - return 0 ; - - psf->dataoffset = PAF_HEADER_LENGTH ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - paf_format = PAF_PCM_S8 ; - break ; - - case SF_FORMAT_PCM_16 : - paf_format = PAF_PCM_16 ; - break ; - - case SF_FORMAT_PCM_24 : - paf_format = PAF_PCM_24 ; - break ; - - default : return SFE_PAF_UNKNOWN_FORMAT ; - } ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - - if (psf->endian == SF_ENDIAN_BIG) - { /* Marker, version, endianness, samplerate */ - psf_binheader_writef (psf, "Em444", PAF_MARKER, 0, 0, psf->sf.samplerate) ; - /* format, channels, source */ - psf_binheader_writef (psf, "E444", paf_format, psf->sf.channels, 0) ; - } - else if (psf->endian == SF_ENDIAN_LITTLE) - { /* Marker, version, endianness, samplerate */ - psf_binheader_writef (psf, "em444", FAP_MARKER, 0, 1, psf->sf.samplerate) ; - /* format, channels, source */ - psf_binheader_writef (psf, "e444", paf_format, psf->sf.channels, 0) ; - } ; - - /* Zero fill to dataoffset. */ - psf_binheader_writef (psf, "z", (size_t) (psf->dataoffset - psf->headindex)) ; - - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - return psf->error ; -} /* paf_write_header */ - -/*=============================================================================== -** 24 bit PAF files have a really weird encoding. -** For a mono file, 10 samples (each being 3 bytes) are packed into a 32 byte -** block. The 8 ints in this 32 byte block are then endian swapped (as ints) -** if necessary before being written to disk. -** For a stereo file, blocks of 10 samples from the same channel are encoded -** into 32 bytes as for the mono case. The 32 byte blocks are then interleaved -** on disk. -** Reading has to reverse the above process :-). -** Weird!!! -** -** The code below attempts to gain efficiency while maintaining readability. -*/ - -static int paf24_read_block (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24) ; -static int paf24_write_block (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24) ; -static int paf24_close (SF_PRIVATE *psf) ; - - -static int -paf24_init (SF_PRIVATE *psf) -{ PAF24_PRIVATE *ppaf24 ; - int paf24size ; - - paf24size = sizeof (PAF24_PRIVATE) + psf->sf.channels * - (PAF24_BLOCK_SIZE + PAF24_SAMPLES_PER_BLOCK * sizeof (int)) ; - - /* - ** Not exatly sure why this needs to be here but the tests - ** fail without it. - */ - psf->last_op = 0 ; - - if (! (psf->codec_data = calloc (1, paf24size))) - return SFE_MALLOC_FAILED ; - - ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; - - ppaf24->channels = psf->sf.channels ; - ppaf24->samples = ppaf24->data ; - ppaf24->block = (unsigned char*) (ppaf24->data + PAF24_SAMPLES_PER_BLOCK * ppaf24->channels) ; - - ppaf24->blocksize = PAF24_BLOCK_SIZE * ppaf24->channels ; - - if (psf->file.mode == SFM_READ || psf->file.mode == SFM_RDWR) - { paf24_read_block (psf, ppaf24) ; /* Read first block. */ - - psf->read_short = paf24_read_s ; - psf->read_int = paf24_read_i ; - psf->read_float = paf24_read_f ; - psf->read_double = paf24_read_d ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { psf->write_short = paf24_write_s ; - psf->write_int = paf24_write_i ; - psf->write_float = paf24_write_f ; - psf->write_double = paf24_write_d ; - } ; - - psf->seek = paf24_seek ; - psf->container_close = paf24_close ; - - psf->filelength = psf_get_filelen (psf) ; - psf->datalength = psf->filelength - psf->dataoffset ; - - if (psf->datalength % PAF24_BLOCK_SIZE) - { if (psf->file.mode == SFM_READ) - psf_log_printf (psf, "*** Warning : file seems to be truncated.\n") ; - ppaf24->max_blocks = psf->datalength / ppaf24->blocksize + 1 ; - } - else - ppaf24->max_blocks = psf->datalength / ppaf24->blocksize ; - - ppaf24->read_block = 0 ; - if (psf->file.mode == SFM_RDWR) - ppaf24->write_block = ppaf24->max_blocks ; - else - ppaf24->write_block = 0 ; - - psf->sf.frames = PAF24_SAMPLES_PER_BLOCK * ppaf24->max_blocks ; - ppaf24->sample_count = psf->sf.frames ; - - return 0 ; -} /* paf24_init */ - -static sf_count_t -paf24_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) -{ PAF24_PRIVATE *ppaf24 ; - int newblock, newsample ; - - if (psf->codec_data == NULL) - { psf->error = SFE_INTERNAL ; - return PSF_SEEK_ERROR ; - } ; - - ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; - - if (mode == SFM_READ && ppaf24->write_count > 0) - paf24_write_block (psf, ppaf24) ; - - newblock = offset / PAF24_SAMPLES_PER_BLOCK ; - newsample = offset % PAF24_SAMPLES_PER_BLOCK ; - - switch (mode) - { case SFM_READ : - if (psf->last_op == SFM_WRITE && ppaf24->write_count) - paf24_write_block (psf, ppaf24) ; - - psf_fseek (psf, psf->dataoffset + newblock * ppaf24->blocksize, SEEK_SET) ; - ppaf24->read_block = newblock ; - paf24_read_block (psf, ppaf24) ; - ppaf24->read_count = newsample ; - break ; - - case SFM_WRITE : - if (offset > ppaf24->sample_count) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - if (psf->last_op == SFM_WRITE && ppaf24->write_count) - paf24_write_block (psf, ppaf24) ; - - psf_fseek (psf, psf->dataoffset + newblock * ppaf24->blocksize, SEEK_SET) ; - ppaf24->write_block = newblock ; - paf24_read_block (psf, ppaf24) ; - ppaf24->write_count = newsample ; - break ; - - default : - psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - return newblock * PAF24_SAMPLES_PER_BLOCK + newsample ; -} /* paf24_seek */ - -static int -paf24_close (SF_PRIVATE *psf) -{ PAF24_PRIVATE *ppaf24 ; - - if (psf->codec_data == NULL) - return 0 ; - - ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (ppaf24->write_count > 0) - paf24_write_block (psf, ppaf24) ; - } ; - - return 0 ; -} /* paf24_close */ - -/*--------------------------------------------------------------------------- -*/ -static int -paf24_read_block (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24) -{ int k, channel ; - unsigned char *cptr ; - - ppaf24->read_block ++ ; - ppaf24->read_count = 0 ; - - if (ppaf24->read_block * PAF24_SAMPLES_PER_BLOCK > ppaf24->sample_count) - { memset (ppaf24->samples, 0, PAF24_SAMPLES_PER_BLOCK * ppaf24->channels) ; - return 1 ; - } ; - - /* Read the block. */ - if ((k = psf_fread (ppaf24->block, 1, ppaf24->blocksize, psf)) != ppaf24->blocksize) - psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, ppaf24->blocksize) ; - - - /* Do endian swapping if necessary. */ - if (psf->endian == SF_ENDIAN_BIG) - endswap_int_array (ppaf24->data, 8 * ppaf24->channels) ; - - /* Unpack block. */ - for (k = 0 ; k < PAF24_SAMPLES_PER_BLOCK * ppaf24->channels ; k++) - { channel = k % ppaf24->channels ; - cptr = ppaf24->block + PAF24_BLOCK_SIZE * channel + 3 * (k / ppaf24->channels) ; - ppaf24->samples [k] = (cptr [0] << 8) | (cptr [1] << 16) | (cptr [2] << 24) ; - } ; - - return 1 ; -} /* paf24_read_block */ - -static int -paf24_read (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24, int *ptr, int len) -{ int count, total = 0 ; - - while (total < len) - { if (ppaf24->read_block * PAF24_SAMPLES_PER_BLOCK >= ppaf24->sample_count) - { memset (&(ptr [total]), 0, (len - total) * sizeof (int)) ; - return total ; - } ; - - if (ppaf24->read_count >= PAF24_SAMPLES_PER_BLOCK) - paf24_read_block (psf, ppaf24) ; - - count = (PAF24_SAMPLES_PER_BLOCK - ppaf24->read_count) * ppaf24->channels ; - count = (len - total > count) ? count : len - total ; - - memcpy (&(ptr [total]), &(ppaf24->samples [ppaf24->read_count * ppaf24->channels]), count * sizeof (int)) ; - total += count ; - ppaf24->read_count += count / ppaf24->channels ; - } ; - - return total ; -} /* paf24_read */ - -static sf_count_t -paf24_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - PAF24_PRIVATE *ppaf24 ; - int *iptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = paf24_read (psf, ppaf24, iptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = iptr [k] >> 16 ; - total += count ; - len -= readcount ; - } ; - return total ; -} /* paf24_read_s */ - -static sf_count_t -paf24_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ PAF24_PRIVATE *ppaf24 ; - int total ; - - if (psf->codec_data == NULL) - return 0 ; - ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; - - total = paf24_read (psf, ppaf24, ptr, len) ; - - return total ; -} /* paf24_read_i */ - -static sf_count_t -paf24_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - PAF24_PRIVATE *ppaf24 ; - int *iptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - float normfact ; - - if (psf->codec_data == NULL) - return 0 ; - ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? (1.0 / 0x80000000) : (1.0 / 0x100) ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = paf24_read (psf, ppaf24, iptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * iptr [k] ; - total += count ; - len -= readcount ; - } ; - return total ; -} /* paf24_read_f */ - -static sf_count_t -paf24_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - PAF24_PRIVATE *ppaf24 ; - int *iptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - double normfact ; - - if (psf->codec_data == NULL) - return 0 ; - ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_double == SF_TRUE) ? (1.0 / 0x80000000) : (1.0 / 0x100) ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = paf24_read (psf, ppaf24, iptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * iptr [k] ; - total += count ; - len -= readcount ; - } ; - return total ; -} /* paf24_read_d */ - -/*--------------------------------------------------------------------------- -*/ - -static int -paf24_write_block (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24) -{ int k, nextsample, channel ; - unsigned char *cptr ; - - /* First pack block. */ - - if (CPU_IS_LITTLE_ENDIAN) - { for (k = 0 ; k < PAF24_SAMPLES_PER_BLOCK * ppaf24->channels ; k++) - { channel = k % ppaf24->channels ; - cptr = ppaf24->block + PAF24_BLOCK_SIZE * channel + 3 * (k / ppaf24->channels) ; - nextsample = ppaf24->samples [k] >> 8 ; - cptr [0] = nextsample ; - cptr [1] = nextsample >> 8 ; - cptr [2] = nextsample >> 16 ; - } ; - - /* Do endian swapping if necessary. */ - if (psf->endian == SF_ENDIAN_BIG) - endswap_int_array (ppaf24->data, 8 * ppaf24->channels) ; - } - else if (CPU_IS_BIG_ENDIAN) - { /* This is correct. */ - for (k = 0 ; k < PAF24_SAMPLES_PER_BLOCK * ppaf24->channels ; k++) - { channel = k % ppaf24->channels ; - cptr = ppaf24->block + PAF24_BLOCK_SIZE * channel + 3 * (k / ppaf24->channels) ; - nextsample = ppaf24->samples [k] >> 8 ; - cptr [0] = nextsample ; - cptr [1] = nextsample >> 8 ; - cptr [2] = nextsample >> 16 ; - } ; - if (psf->endian == SF_ENDIAN_BIG) - endswap_int_array (ppaf24->data, 8 * ppaf24->channels) ; - } ; - - /* Write block to disk. */ - if ((k = psf_fwrite (ppaf24->block, 1, ppaf24->blocksize, psf)) != ppaf24->blocksize) - psf_log_printf (psf, "*** Warning : short write (%d != %d).\n", k, ppaf24->blocksize) ; - - if (ppaf24->sample_count < ppaf24->write_block * PAF24_SAMPLES_PER_BLOCK + ppaf24->write_count) - ppaf24->sample_count = ppaf24->write_block * PAF24_SAMPLES_PER_BLOCK + ppaf24->write_count ; - - if (ppaf24->write_count == PAF24_SAMPLES_PER_BLOCK) - { ppaf24->write_block ++ ; - ppaf24->write_count = 0 ; - } ; - - return 1 ; -} /* paf24_write_block */ - -static int -paf24_write (SF_PRIVATE *psf, PAF24_PRIVATE *ppaf24, const int *ptr, int len) -{ int count, total = 0 ; - - while (total < len) - { count = (PAF24_SAMPLES_PER_BLOCK - ppaf24->write_count) * ppaf24->channels ; - - if (count > len - total) - count = len - total ; - - memcpy (&(ppaf24->samples [ppaf24->write_count * ppaf24->channels]), &(ptr [total]), count * sizeof (int)) ; - total += count ; - ppaf24->write_count += count / ppaf24->channels ; - - if (ppaf24->write_count >= PAF24_SAMPLES_PER_BLOCK) - paf24_write_block (psf, ppaf24) ; - } ; - - return total ; -} /* paf24_write */ - -static sf_count_t -paf24_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - PAF24_PRIVATE *ppaf24 ; - int *iptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - iptr [k] = ptr [total + k] << 16 ; - count = paf24_write (psf, ppaf24, iptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - return total ; -} /* paf24_write_s */ - -static sf_count_t -paf24_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ PAF24_PRIVATE *ppaf24 ; - int writecount, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; - - while (len > 0) - { writecount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = paf24_write (psf, ppaf24, ptr, writecount) ; - - total += count ; - len -= count ; - if (count != writecount) - break ; - } ; - - return total ; -} /* paf24_write_i */ - -static sf_count_t -paf24_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - PAF24_PRIVATE *ppaf24 ; - int *iptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - float normfact ; - - if (psf->codec_data == NULL) - return 0 ; - ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? (1.0 * 0x7FFFFFFF) : (1.0 / 0x100) ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - iptr [k] = lrintf (normfact * ptr [total + k]) ; - count = paf24_write (psf, ppaf24, iptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* paf24_write_f */ - -static sf_count_t -paf24_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - PAF24_PRIVATE *ppaf24 ; - int *iptr ; - int k, bufferlen, writecount = 0, count ; - sf_count_t total = 0 ; - double normfact ; - - if (psf->codec_data == NULL) - return 0 ; - ppaf24 = (PAF24_PRIVATE*) psf->codec_data ; - - normfact = (psf->norm_double == SF_TRUE) ? (1.0 * 0x7FFFFFFF) : (1.0 / 0x100) ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - iptr [k] = lrint (normfact * ptr [total+k]) ; - count = paf24_write (psf, ppaf24, iptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* paf24_write_d */ - diff --git a/libs/libsndfile/src/pcm.c b/libs/libsndfile/src/pcm.c deleted file mode 100644 index 8a06858b2a..0000000000 --- a/libs/libsndfile/src/pcm.c +++ /dev/null @@ -1,2961 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/* Need to be able to handle 3 byte (24 bit) integers. So defined a -** type and use SIZEOF_TRIBYTE instead of (tribyte). -*/ - -typedef void tribyte ; - -#define SIZEOF_TRIBYTE 3 - -static sf_count_t pcm_read_sc2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t pcm_read_uc2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bes2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t pcm_read_les2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bet2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t pcm_read_let2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bei2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t pcm_read_lei2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; - -static sf_count_t pcm_read_sc2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t pcm_read_uc2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bes2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t pcm_read_les2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bet2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t pcm_read_let2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bei2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t pcm_read_lei2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; - -static sf_count_t pcm_read_sc2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t pcm_read_uc2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bes2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t pcm_read_les2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bet2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t pcm_read_let2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bei2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t pcm_read_lei2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; - -static sf_count_t pcm_read_sc2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; -static sf_count_t pcm_read_uc2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bes2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; -static sf_count_t pcm_read_les2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bet2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; -static sf_count_t pcm_read_let2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; -static sf_count_t pcm_read_bei2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; -static sf_count_t pcm_read_lei2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t pcm_write_s2sc (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t pcm_write_s2uc (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t pcm_write_s2bes (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t pcm_write_s2les (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t pcm_write_s2bet (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t pcm_write_s2let (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t pcm_write_s2bei (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t pcm_write_s2lei (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; - -static sf_count_t pcm_write_i2sc (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t pcm_write_i2uc (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t pcm_write_i2bes (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t pcm_write_i2les (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t pcm_write_i2bet (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t pcm_write_i2let (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t pcm_write_i2bei (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t pcm_write_i2lei (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; - -static sf_count_t pcm_write_f2sc (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t pcm_write_f2uc (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t pcm_write_f2bes (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t pcm_write_f2les (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t pcm_write_f2bet (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t pcm_write_f2let (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t pcm_write_f2bei (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t pcm_write_f2lei (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; - -static sf_count_t pcm_write_d2sc (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; -static sf_count_t pcm_write_d2uc (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; -static sf_count_t pcm_write_d2bes (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; -static sf_count_t pcm_write_d2les (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; -static sf_count_t pcm_write_d2bet (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; -static sf_count_t pcm_write_d2let (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; -static sf_count_t pcm_write_d2bei (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; -static sf_count_t pcm_write_d2lei (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -/*----------------------------------------------------------------------------------------------- -*/ - -enum -{ /* Char type for 8 bit files. */ - SF_CHARS_SIGNED = 200, - SF_CHARS_UNSIGNED = 201 -} ; - -/*----------------------------------------------------------------------------------------------- -*/ - -int -pcm_init (SF_PRIVATE *psf) -{ int chars = 0 ; - - if (psf->bytewidth == 0 || psf->sf.channels == 0) - { psf_log_printf (psf, "pcm_init : internal error : bytewitdh = %d, channels = %d\n", psf->bytewidth, psf->sf.channels) ; - return SFE_INTERNAL ; - } ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - if ((SF_CODEC (psf->sf.format)) == SF_FORMAT_PCM_S8) - chars = SF_CHARS_SIGNED ; - else if ((SF_CODEC (psf->sf.format)) == SF_FORMAT_PCM_U8) - chars = SF_CHARS_UNSIGNED ; - - if (CPU_IS_BIG_ENDIAN) - psf->data_endswap = (psf->endian == SF_ENDIAN_BIG) ? SF_FALSE : SF_TRUE ; - else - psf->data_endswap = (psf->endian == SF_ENDIAN_LITTLE) ? SF_FALSE : SF_TRUE ; - - if (psf->file.mode == SFM_READ || psf->file.mode == SFM_RDWR) - { switch (psf->bytewidth * 0x10000 + psf->endian + chars) - { case (0x10000 + SF_ENDIAN_BIG + SF_CHARS_SIGNED) : - case (0x10000 + SF_ENDIAN_LITTLE + SF_CHARS_SIGNED) : - psf->read_short = pcm_read_sc2s ; - psf->read_int = pcm_read_sc2i ; - psf->read_float = pcm_read_sc2f ; - psf->read_double = pcm_read_sc2d ; - break ; - case (0x10000 + SF_ENDIAN_BIG + SF_CHARS_UNSIGNED) : - case (0x10000 + SF_ENDIAN_LITTLE + SF_CHARS_UNSIGNED) : - psf->read_short = pcm_read_uc2s ; - psf->read_int = pcm_read_uc2i ; - psf->read_float = pcm_read_uc2f ; - psf->read_double = pcm_read_uc2d ; - break ; - - case (2 * 0x10000 + SF_ENDIAN_BIG) : - psf->read_short = pcm_read_bes2s ; - psf->read_int = pcm_read_bes2i ; - psf->read_float = pcm_read_bes2f ; - psf->read_double = pcm_read_bes2d ; - break ; - case (3 * 0x10000 + SF_ENDIAN_BIG) : - psf->read_short = pcm_read_bet2s ; - psf->read_int = pcm_read_bet2i ; - psf->read_float = pcm_read_bet2f ; - psf->read_double = pcm_read_bet2d ; - break ; - case (4 * 0x10000 + SF_ENDIAN_BIG) : - - psf->read_short = pcm_read_bei2s ; - psf->read_int = pcm_read_bei2i ; - psf->read_float = pcm_read_bei2f ; - psf->read_double = pcm_read_bei2d ; - break ; - - case (2 * 0x10000 + SF_ENDIAN_LITTLE) : - psf->read_short = pcm_read_les2s ; - psf->read_int = pcm_read_les2i ; - psf->read_float = pcm_read_les2f ; - psf->read_double = pcm_read_les2d ; - break ; - case (3 * 0x10000 + SF_ENDIAN_LITTLE) : - psf->read_short = pcm_read_let2s ; - psf->read_int = pcm_read_let2i ; - psf->read_float = pcm_read_let2f ; - psf->read_double = pcm_read_let2d ; - break ; - case (4 * 0x10000 + SF_ENDIAN_LITTLE) : - psf->read_short = pcm_read_lei2s ; - psf->read_int = pcm_read_lei2i ; - psf->read_float = pcm_read_lei2f ; - psf->read_double = pcm_read_lei2d ; - break ; - default : - psf_log_printf (psf, "pcm.c returning SFE_UNIMPLEMENTED\nbytewidth %d endian %d\n", psf->bytewidth, psf->endian) ; - return SFE_UNIMPLEMENTED ; - } ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { switch (psf->bytewidth * 0x10000 + psf->endian + chars) - { case (0x10000 + SF_ENDIAN_BIG + SF_CHARS_SIGNED) : - case (0x10000 + SF_ENDIAN_LITTLE + SF_CHARS_SIGNED) : - psf->write_short = pcm_write_s2sc ; - psf->write_int = pcm_write_i2sc ; - psf->write_float = pcm_write_f2sc ; - psf->write_double = pcm_write_d2sc ; - break ; - case (0x10000 + SF_ENDIAN_BIG + SF_CHARS_UNSIGNED) : - case (0x10000 + SF_ENDIAN_LITTLE + SF_CHARS_UNSIGNED) : - psf->write_short = pcm_write_s2uc ; - psf->write_int = pcm_write_i2uc ; - psf->write_float = pcm_write_f2uc ; - psf->write_double = pcm_write_d2uc ; - break ; - - case (2 * 0x10000 + SF_ENDIAN_BIG) : - psf->write_short = pcm_write_s2bes ; - psf->write_int = pcm_write_i2bes ; - psf->write_float = pcm_write_f2bes ; - psf->write_double = pcm_write_d2bes ; - break ; - - case (3 * 0x10000 + SF_ENDIAN_BIG) : - psf->write_short = pcm_write_s2bet ; - psf->write_int = pcm_write_i2bet ; - psf->write_float = pcm_write_f2bet ; - psf->write_double = pcm_write_d2bet ; - break ; - - case (4 * 0x10000 + SF_ENDIAN_BIG) : - psf->write_short = pcm_write_s2bei ; - psf->write_int = pcm_write_i2bei ; - psf->write_float = pcm_write_f2bei ; - psf->write_double = pcm_write_d2bei ; - break ; - - case (2 * 0x10000 + SF_ENDIAN_LITTLE) : - psf->write_short = pcm_write_s2les ; - psf->write_int = pcm_write_i2les ; - psf->write_float = pcm_write_f2les ; - psf->write_double = pcm_write_d2les ; - break ; - - case (3 * 0x10000 + SF_ENDIAN_LITTLE) : - psf->write_short = pcm_write_s2let ; - psf->write_int = pcm_write_i2let ; - psf->write_float = pcm_write_f2let ; - psf->write_double = pcm_write_d2let ; - break ; - - case (4 * 0x10000 + SF_ENDIAN_LITTLE) : - psf->write_short = pcm_write_s2lei ; - psf->write_int = pcm_write_i2lei ; - psf->write_float = pcm_write_f2lei ; - psf->write_double = pcm_write_d2lei ; - break ; - - default : - psf_log_printf (psf, "pcm.c returning SFE_UNIMPLEMENTED\nbytewidth %s endian %d\n", psf->bytewidth, psf->endian) ; - return SFE_UNIMPLEMENTED ; - } ; - - } ; - - if (psf->filelength > psf->dataoffset) - { psf->datalength = (psf->dataend > 0) ? psf->dataend - psf->dataoffset : - psf->filelength - psf->dataoffset ; - } - else - psf->datalength = 0 ; - - psf->sf.frames = psf->blockwidth > 0 ? psf->datalength / psf->blockwidth : 0 ; - - return 0 ; -} /* pcm_init */ - -/*============================================================================== -*/ - -static inline void -sc2s_array (signed char *src, int count, short *dest) -{ while (--count >= 0) - { dest [count] = src [count] << 8 ; - } ; -} /* sc2s_array */ - -static inline void -uc2s_array (unsigned char *src, int count, short *dest) -{ while (--count >= 0) - { dest [count] = (((short) src [count]) - 0x80) << 8 ; - } ; -} /* uc2s_array */ - -static inline void -let2s_array (tribyte *src, int count, short *dest) -{ unsigned char *ucptr ; - - ucptr = ((unsigned char*) src) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - dest [count] = LET2H_16_PTR (ucptr) ; - } ; -} /* let2s_array */ - -static inline void -bet2s_array (tribyte *src, int count, short *dest) -{ unsigned char *ucptr ; - - ucptr = ((unsigned char*) src) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - dest [count] = BET2H_16_PTR (ucptr) ; - } ; -} /* bet2s_array */ - -static inline void -lei2s_array (int *src, int count, short *dest) -{ int value ; - - while (--count >= 0) - { value = LE2H_32 (src [count]) ; - dest [count] = value >> 16 ; - } ; -} /* lei2s_array */ - -static inline void -bei2s_array (int *src, int count, short *dest) -{ int value ; - - while (--count >= 0) - { value = BE2H_32 (src [count]) ; - dest [count] = value >> 16 ; - } ; -} /* bei2s_array */ - -/*-------------------------------------------------------------------------- -*/ - -static inline void -sc2i_array (signed char *src, int count, int *dest) -{ while (--count >= 0) - { dest [count] = ((int) src [count]) << 24 ; - } ; -} /* sc2i_array */ - -static inline void -uc2i_array (unsigned char *src, int count, int *dest) -{ while (--count >= 0) - { dest [count] = (((int) src [count]) - 128) << 24 ; - } ; -} /* uc2i_array */ - -static inline void -bes2i_array (short *src, int count, int *dest) -{ short value ; - - while (--count >= 0) - { value = BE2H_16 (src [count]) ; - dest [count] = value << 16 ; - } ; -} /* bes2i_array */ - -static inline void -les2i_array (short *src, int count, int *dest) -{ short value ; - - while (--count >= 0) - { value = LE2H_16 (src [count]) ; - dest [count] = value << 16 ; - } ; -} /* les2i_array */ - -static inline void -bet2i_array (tribyte *src, int count, int *dest) -{ unsigned char *ucptr ; - - ucptr = ((unsigned char*) src) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - dest [count] = BET2H_32_PTR (ucptr) ; - } ; -} /* bet2i_array */ - -static inline void -let2i_array (tribyte *src, int count, int *dest) -{ unsigned char *ucptr ; - - ucptr = ((unsigned char*) src) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - dest [count] = LET2H_32_PTR (ucptr) ; - } ; -} /* let2i_array */ - -/*-------------------------------------------------------------------------- -*/ - -static inline void -sc2f_array (signed char *src, int count, float *dest, float normfact) -{ while (--count >= 0) - dest [count] = ((float) src [count]) * normfact ; -} /* sc2f_array */ - -static inline void -uc2f_array (unsigned char *src, int count, float *dest, float normfact) -{ while (--count >= 0) - dest [count] = (((int) src [count]) - 128) * normfact ; -} /* uc2f_array */ - -static inline void -les2f_array (short *src, int count, float *dest, float normfact) -{ short value ; - - while (--count >= 0) - { value = src [count] ; - value = LE2H_16 (value) ; - dest [count] = ((float) value) * normfact ; - } ; -} /* les2f_array */ - -static inline void -bes2f_array (short *src, int count, float *dest, float normfact) -{ short value ; - - while (--count >= 0) - { value = src [count] ; - value = BE2H_16 (value) ; - dest [count] = ((float) value) * normfact ; - } ; -} /* bes2f_array */ - -static inline void -let2f_array (tribyte *src, int count, float *dest, float normfact) -{ unsigned char *ucptr ; - int value ; - - ucptr = ((unsigned char*) src) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - value = LET2H_32_PTR (ucptr) ; - dest [count] = ((float) value) * normfact ; - } ; -} /* let2f_array */ - -static inline void -bet2f_array (tribyte *src, int count, float *dest, float normfact) -{ unsigned char *ucptr ; - int value ; - - ucptr = ((unsigned char*) src) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - value = BET2H_32_PTR (ucptr) ; - dest [count] = ((float) value) * normfact ; - } ; -} /* bet2f_array */ - -static inline void -lei2f_array (int *src, int count, float *dest, float normfact) -{ int value ; - - while (--count >= 0) - { value = src [count] ; - value = LE2H_32 (value) ; - dest [count] = ((float) value) * normfact ; - } ; -} /* lei2f_array */ - -static inline void -bei2f_array (int *src, int count, float *dest, float normfact) -{ int value ; - - while (--count >= 0) - { value = src [count] ; - value = BE2H_32 (value) ; - dest [count] = ((float) value) * normfact ; - } ; -} /* bei2f_array */ - -/*-------------------------------------------------------------------------- -*/ - -static inline void -sc2d_array (signed char *src, int count, double *dest, double normfact) -{ while (--count >= 0) - dest [count] = ((double) src [count]) * normfact ; -} /* sc2d_array */ - -static inline void -uc2d_array (unsigned char *src, int count, double *dest, double normfact) -{ while (--count >= 0) - dest [count] = (((int) src [count]) - 128) * normfact ; -} /* uc2d_array */ - -static inline void -les2d_array (short *src, int count, double *dest, double normfact) -{ short value ; - - while (--count >= 0) - { value = src [count] ; - value = LE2H_16 (value) ; - dest [count] = ((double) value) * normfact ; - } ; -} /* les2d_array */ - -static inline void -bes2d_array (short *src, int count, double *dest, double normfact) -{ short value ; - - while (--count >= 0) - { value = src [count] ; - value = BE2H_16 (value) ; - dest [count] = ((double) value) * normfact ; - } ; -} /* bes2d_array */ - -static inline void -let2d_array (tribyte *src, int count, double *dest, double normfact) -{ unsigned char *ucptr ; - int value ; - - ucptr = ((unsigned char*) src) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - value = LET2H_32_PTR (ucptr) ; - dest [count] = ((double) value) * normfact ; - } ; -} /* let2d_array */ - -static inline void -bet2d_array (tribyte *src, int count, double *dest, double normfact) -{ unsigned char *ucptr ; - int value ; - - ucptr = ((unsigned char*) src) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - value = (ucptr [0] << 24) | (ucptr [1] << 16) | (ucptr [2] << 8) ; - dest [count] = ((double) value) * normfact ; - } ; -} /* bet2d_array */ - -static inline void -lei2d_array (int *src, int count, double *dest, double normfact) -{ int value ; - - while (--count >= 0) - { value = src [count] ; - value = LE2H_32 (value) ; - dest [count] = ((double) value) * normfact ; - } ; -} /* lei2d_array */ - -static inline void -bei2d_array (int *src, int count, double *dest, double normfact) -{ int value ; - - while (--count >= 0) - { value = src [count] ; - value = BE2H_32 (value) ; - dest [count] = ((double) value) * normfact ; - } ; -} /* bei2d_array */ - -/*-------------------------------------------------------------------------- -*/ - -static inline void -s2sc_array (const short *src, signed char *dest, int count) -{ while (--count >= 0) - dest [count] = src [count] >> 8 ; -} /* s2sc_array */ - -static inline void -s2uc_array (const short *src, unsigned char *dest, int count) -{ while (--count >= 0) - dest [count] = (src [count] >> 8) + 0x80 ; -} /* s2uc_array */ - -static inline void -s2let_array (const short *src, tribyte *dest, int count) -{ unsigned char *ucptr ; - - ucptr = ((unsigned char*) dest) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - ucptr [0] = 0 ; - ucptr [1] = src [count] ; - ucptr [2] = src [count] >> 8 ; - } ; -} /* s2let_array */ - -static inline void -s2bet_array (const short *src, tribyte *dest, int count) -{ unsigned char *ucptr ; - - ucptr = ((unsigned char*) dest) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - ucptr [2] = 0 ; - ucptr [1] = src [count] ; - ucptr [0] = src [count] >> 8 ; - } ; -} /* s2bet_array */ - -static inline void -s2lei_array (const short *src, int *dest, int count) -{ unsigned char *ucptr ; - - ucptr = ((unsigned char*) dest) + 4 * count ; - while (--count >= 0) - { ucptr -= 4 ; - ucptr [0] = 0 ; - ucptr [1] = 0 ; - ucptr [2] = src [count] ; - ucptr [3] = src [count] >> 8 ; - } ; -} /* s2lei_array */ - -static inline void -s2bei_array (const short *src, int *dest, int count) -{ unsigned char *ucptr ; - - ucptr = ((unsigned char*) dest) + 4 * count ; - while (--count >= 0) - { ucptr -= 4 ; - ucptr [0] = src [count] >> 8 ; - ucptr [1] = src [count] ; - ucptr [2] = 0 ; - ucptr [3] = 0 ; - } ; -} /* s2bei_array */ - -/*-------------------------------------------------------------------------- -*/ - -static inline void -i2sc_array (const int *src, signed char *dest, int count) -{ while (--count >= 0) - dest [count] = (src [count] >> 24) ; -} /* i2sc_array */ - -static inline void -i2uc_array (const int *src, unsigned char *dest, int count) -{ while (--count >= 0) - dest [count] = ((src [count] >> 24) + 128) ; -} /* i2uc_array */ - -static inline void -i2bes_array (const int *src, short *dest, int count) -{ unsigned char *ucptr ; - - ucptr = ((unsigned char*) dest) + 2 * count ; - while (--count >= 0) - { ucptr -= 2 ; - ucptr [0] = src [count] >> 24 ; - ucptr [1] = src [count] >> 16 ; - } ; -} /* i2bes_array */ - -static inline void -i2les_array (const int *src, short *dest, int count) -{ unsigned char *ucptr ; - - ucptr = ((unsigned char*) dest) + 2 * count ; - while (--count >= 0) - { ucptr -= 2 ; - ucptr [0] = src [count] >> 16 ; - ucptr [1] = src [count] >> 24 ; - } ; -} /* i2les_array */ - -static inline void -i2let_array (const int *src, tribyte *dest, int count) -{ unsigned char *ucptr ; - int value ; - - ucptr = ((unsigned char*) dest) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - value = src [count] >> 8 ; - ucptr [0] = value ; - ucptr [1] = value >> 8 ; - ucptr [2] = value >> 16 ; - } ; -} /* i2let_array */ - -static inline void -i2bet_array (const int *src, tribyte *dest, int count) -{ unsigned char *ucptr ; - int value ; - - ucptr = ((unsigned char*) dest) + 3 * count ; - while (--count >= 0) - { ucptr -= 3 ; - value = src [count] >> 8 ; - ucptr [2] = value ; - ucptr [1] = value >> 8 ; - ucptr [0] = value >> 16 ; - } ; -} /* i2bet_array */ - -/*=============================================================================================== -*/ - -static sf_count_t -pcm_read_sc2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.scbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - sc2s_array (ubuf.scbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_sc2s */ - -static sf_count_t -pcm_read_uc2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, sizeof (unsigned char), bufferlen, psf) ; - uc2s_array (ubuf.ucbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_uc2s */ - -static sf_count_t -pcm_read_bes2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ int total ; - - total = psf_fread (ptr, sizeof (short), len, psf) ; - if (CPU_IS_LITTLE_ENDIAN) - endswap_short_array (ptr, len) ; - - return total ; -} /* pcm_read_bes2s */ - -static sf_count_t -pcm_read_les2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ int total ; - - total = psf_fread (ptr, sizeof (short), len, psf) ; - if (CPU_IS_BIG_ENDIAN) - endswap_short_array (ptr, len) ; - - return total ; -} /* pcm_read_les2s */ - -static sf_count_t -pcm_read_bet2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - bet2s_array ((tribyte*) (ubuf.ucbuf), readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_bet2s */ - -static sf_count_t -pcm_read_let2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - let2s_array ((tribyte*) (ubuf.ucbuf), readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_let2s */ - -static sf_count_t -pcm_read_bei2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - bei2s_array (ubuf.ibuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_bei2s */ - -static sf_count_t -pcm_read_lei2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - lei2s_array (ubuf.ibuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_lei2s */ - -/*----------------------------------------------------------------------------------------------- -*/ - -static sf_count_t -pcm_read_sc2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.scbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - sc2i_array (ubuf.scbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_sc2i */ - -static sf_count_t -pcm_read_uc2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, sizeof (unsigned char), bufferlen, psf) ; - uc2i_array (ubuf.ucbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_uc2i */ - -static sf_count_t -pcm_read_bes2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - bes2i_array (ubuf.sbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_bes2i */ - -static sf_count_t -pcm_read_les2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - les2i_array (ubuf.sbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_les2i */ - -static sf_count_t -pcm_read_bet2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - bet2i_array ((tribyte*) (ubuf.ucbuf), readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_bet2i */ - -static sf_count_t -pcm_read_let2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - let2i_array ((tribyte*) (ubuf.ucbuf), readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_let2i */ - -static sf_count_t -pcm_read_bei2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ int total ; - - total = psf_fread (ptr, sizeof (int), len, psf) ; - if (CPU_IS_LITTLE_ENDIAN) - endswap_int_array (ptr, len) ; - - return total ; -} /* pcm_read_bei2i */ - -static sf_count_t -pcm_read_lei2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ int total ; - - total = psf_fread (ptr, sizeof (int), len, psf) ; - if (CPU_IS_BIG_ENDIAN) - endswap_int_array (ptr, len) ; - - return total ; -} /* pcm_read_lei2i */ - -/*----------------------------------------------------------------------------------------------- -*/ - -static sf_count_t -pcm_read_sc2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x80) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.scbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - sc2f_array (ubuf.scbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_sc2f */ - -static sf_count_t -pcm_read_uc2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x80) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, sizeof (unsigned char), bufferlen, psf) ; - uc2f_array (ubuf.ucbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_uc2f */ - -static sf_count_t -pcm_read_bes2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x8000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - bes2f_array (ubuf.sbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_bes2f */ - -static sf_count_t -pcm_read_les2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x8000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - les2f_array (ubuf.sbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_les2f */ - -static sf_count_t -pcm_read_bet2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - /* Special normfactor because tribyte value is read into an int. */ - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x80000000) : 1.0 / 256.0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - bet2f_array ((tribyte*) (ubuf.ucbuf), readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_bet2f */ - -static sf_count_t -pcm_read_let2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - /* Special normfactor because tribyte value is read into an int. */ - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x80000000) : 1.0 / 256.0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - let2f_array ((tribyte*) (ubuf.ucbuf), readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_let2f */ - -static sf_count_t -pcm_read_bei2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x80000000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - bei2f_array (ubuf.ibuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_bei2f */ - -static sf_count_t -pcm_read_lei2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x80000000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - lei2f_array (ubuf.ibuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_lei2f */ - -/*----------------------------------------------------------------------------------------------- -*/ - -static sf_count_t -pcm_read_sc2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x80) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.scbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - sc2d_array (ubuf.scbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_sc2d */ - -static sf_count_t -pcm_read_uc2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x80) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, sizeof (unsigned char), bufferlen, psf) ; - uc2d_array (ubuf.ucbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_uc2d */ - -static sf_count_t -pcm_read_bes2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x8000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - bes2d_array (ubuf.sbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_bes2d */ - -static sf_count_t -pcm_read_les2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x8000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - les2d_array (ubuf.sbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_les2d */ - -static sf_count_t -pcm_read_bet2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x80000000) : 1.0 / 256.0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - bet2d_array ((tribyte*) (ubuf.ucbuf), readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_bet2d */ - -static sf_count_t -pcm_read_let2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - /* Special normfactor because tribyte value is read into an int. */ - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x80000000) : 1.0 / 256.0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - let2d_array ((tribyte*) (ubuf.ucbuf), readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_let2d */ - -static sf_count_t -pcm_read_bei2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x80000000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - bei2d_array (ubuf.ibuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_bei2d */ - -static sf_count_t -pcm_read_lei2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x80000000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - lei2d_array (ubuf.ibuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* pcm_read_lei2d */ - -/*=============================================================================================== -**----------------------------------------------------------------------------------------------- -**=============================================================================================== -*/ - -static sf_count_t -pcm_write_s2sc (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.scbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2sc_array (ptr + total, ubuf.scbuf, bufferlen) ; - writecount = psf_fwrite (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_s2sc */ - -static sf_count_t -pcm_write_s2uc (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2uc_array (ptr + total, ubuf.ucbuf, bufferlen) ; - writecount = psf_fwrite (ubuf.ucbuf, sizeof (unsigned char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_s2uc */ - -static sf_count_t -pcm_write_s2bes (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - if (CPU_IS_BIG_ENDIAN) - return psf_fwrite (ptr, sizeof (short), len, psf) ; - else - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - endswap_short_copy (ubuf.sbuf, ptr + total, bufferlen) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_s2bes */ - -static sf_count_t -pcm_write_s2les (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - if (CPU_IS_LITTLE_ENDIAN) - return psf_fwrite (ptr, sizeof (short), len, psf) ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - endswap_short_copy (ubuf.sbuf, ptr + total, bufferlen) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_s2les */ - -static sf_count_t -pcm_write_s2bet (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2bet_array (ptr + total, (tribyte*) (ubuf.ucbuf), bufferlen) ; - writecount = psf_fwrite (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_s2bet */ - -static sf_count_t -pcm_write_s2let (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2let_array (ptr + total, (tribyte*) (ubuf.ucbuf), bufferlen) ; - writecount = psf_fwrite (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_s2let */ - -static sf_count_t -pcm_write_s2bei (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2bei_array (ptr + total, ubuf.ibuf, bufferlen) ; - writecount = psf_fwrite (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_s2bei */ - -static sf_count_t -pcm_write_s2lei (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2lei_array (ptr + total, ubuf.ibuf, bufferlen) ; - writecount = psf_fwrite (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_s2lei */ - -/*----------------------------------------------------------------------------------------------- -*/ - -static sf_count_t -pcm_write_i2sc (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.scbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2sc_array (ptr + total, ubuf.scbuf, bufferlen) ; - writecount = psf_fwrite (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_i2sc */ - -static sf_count_t -pcm_write_i2uc (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2uc_array (ptr + total, ubuf.ucbuf, bufferlen) ; - writecount = psf_fwrite (ubuf.ucbuf, sizeof (signed char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_i2uc */ - -static sf_count_t -pcm_write_i2bes (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2bes_array (ptr + total, ubuf.sbuf, bufferlen) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_i2bes */ - -static sf_count_t -pcm_write_i2les (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2les_array (ptr + total, ubuf.sbuf, bufferlen) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_i2les */ - -static sf_count_t -pcm_write_i2bet (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2bet_array (ptr + total, (tribyte*) (ubuf.ucbuf), bufferlen) ; - writecount = psf_fwrite (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_i2bet */ - -static sf_count_t -pcm_write_i2let (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2let_array (ptr + total, (tribyte*) (ubuf.ucbuf), bufferlen) ; - writecount = psf_fwrite (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_i2les */ - -static sf_count_t -pcm_write_i2bei (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - if (CPU_IS_BIG_ENDIAN) - return psf_fwrite (ptr, sizeof (int), len, psf) ; - - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - endswap_int_copy (ubuf.ibuf, ptr + total, bufferlen) ; - writecount = psf_fwrite (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_i2bei */ - -static sf_count_t -pcm_write_i2lei (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - if (CPU_IS_LITTLE_ENDIAN) - return psf_fwrite (ptr, sizeof (int), len, psf) ; - - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - endswap_int_copy (ubuf.ibuf, ptr + total, bufferlen) ; - writecount = psf_fwrite (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_i2lei */ - -/*------------------------------------------------------------------------------ -**============================================================================== -**------------------------------------------------------------------------------ -*/ - -static void -f2sc_array (const float *src, signed char *dest, int count, int normalize) -{ float normfact ; - - normfact = normalize ? (1.0 * 0x7F) : 1.0 ; - - while (--count >= 0) - { dest [count] = lrintf (src [count] * normfact) ; - } ; -} /* f2sc_array */ - -static void -f2sc_clip_array (const float *src, signed char *dest, int count, int normalize) -{ float normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x1000000) ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { dest [count] = 127 ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { dest [count] = -128 ; - continue ; - } ; - - dest [count] = lrintf (scaled_value) >> 24 ; - } ; -} /* f2sc_clip_array */ - -static sf_count_t -pcm_write_f2sc (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const float *, signed char *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? f2sc_clip_array : f2sc_array ; - bufferlen = ARRAY_LEN (ubuf.scbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.scbuf, bufferlen, psf->norm_float) ; - writecount = psf_fwrite (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_f2sc */ - -/*============================================================================== -*/ - -static void -f2uc_array (const float *src, unsigned char *dest, int count, int normalize) -{ float normfact ; - - normfact = normalize ? (1.0 * 0x7F) : 1.0 ; - - while (--count >= 0) - { dest [count] = lrintf (src [count] * normfact) + 128 ; - } ; -} /* f2uc_array */ - -static void -f2uc_clip_array (const float *src, unsigned char *dest, int count, int normalize) -{ float normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x1000000) ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { dest [count] = 0xFF ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { dest [count] = 0 ; - continue ; - } ; - - dest [count] = (lrintf (scaled_value) >> 24) + 128 ; - } ; -} /* f2uc_clip_array */ - -static sf_count_t -pcm_write_f2uc (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const float *, unsigned char *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? f2uc_clip_array : f2uc_array ; - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.ucbuf, bufferlen, psf->norm_float) ; - writecount = psf_fwrite (ubuf.ucbuf, sizeof (unsigned char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_f2uc */ - -/*============================================================================== -*/ - -static void -f2bes_array (const float *src, short *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact ; - short value ; - - normfact = normalize ? (1.0 * 0x7FFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 2 * count ; - - while (--count >= 0) - { ucptr -= 2 ; - value = lrintf (src [count] * normfact) ; - ucptr [1] = value ; - ucptr [0] = value >> 8 ; - } ; -} /* f2bes_array */ - -static void -f2bes_clip_array (const float *src, short *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact, scaled_value ; - int value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x10000) ; - ucptr = ((unsigned char*) dest) + 2 * count ; - - while (--count >= 0) - { ucptr -= 2 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { ucptr [1] = 0xFF ; - ucptr [0] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [1] = 0x00 ; - ucptr [0] = 0x80 ; - continue ; - } ; - - value = lrintf (scaled_value) ; - ucptr [1] = value >> 16 ; - ucptr [0] = value >> 24 ; - } ; -} /* f2bes_clip_array */ - -static sf_count_t -pcm_write_f2bes (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const float *, short *t, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? f2bes_clip_array : f2bes_array ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.sbuf, bufferlen, psf->norm_float) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_f2bes */ - -/*============================================================================== -*/ - -static void -f2les_array (const float *src, short *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact ; - int value ; - - normfact = normalize ? (1.0 * 0x7FFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 2 * count ; - - while (--count >= 0) - { ucptr -= 2 ; - value = lrintf (src [count] * normfact) ; - ucptr [0] = value ; - ucptr [1] = value >> 8 ; - } ; -} /* f2les_array */ - -static void -f2les_clip_array (const float *src, short *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact, scaled_value ; - int value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x10000) ; - ucptr = ((unsigned char*) dest) + 2 * count ; - - while (--count >= 0) - { ucptr -= 2 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { ucptr [0] = 0xFF ; - ucptr [1] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [0] = 0x00 ; - ucptr [1] = 0x80 ; - continue ; - } ; - - value = lrintf (scaled_value) ; - ucptr [0] = value >> 16 ; - ucptr [1] = value >> 24 ; - } ; -} /* f2les_clip_array */ - -static sf_count_t -pcm_write_f2les (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const float *, short *t, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? f2les_clip_array : f2les_array ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.sbuf, bufferlen, psf->norm_float) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_f2les */ - -/*============================================================================== -*/ - -static void -f2let_array (const float *src, tribyte *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact ; - int value ; - - normfact = normalize ? (1.0 * 0x7FFFFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 3 * count ; - - while (--count >= 0) - { ucptr -= 3 ; - value = lrintf (src [count] * normfact) ; - ucptr [0] = value ; - ucptr [1] = value >> 8 ; - ucptr [2] = value >> 16 ; - } ; -} /* f2let_array */ - -static void -f2let_clip_array (const float *src, tribyte *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact, scaled_value ; - int value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x100) ; - ucptr = ((unsigned char*) dest) + 3 * count ; - - while (--count >= 0) - { ucptr -= 3 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { ucptr [0] = 0xFF ; - ucptr [1] = 0xFF ; - ucptr [2] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [0] = 0x00 ; - ucptr [1] = 0x00 ; - ucptr [2] = 0x80 ; - continue ; - } ; - - value = lrintf (scaled_value) ; - ucptr [0] = value >> 8 ; - ucptr [1] = value >> 16 ; - ucptr [2] = value >> 24 ; - } ; -} /* f2let_clip_array */ - -static sf_count_t -pcm_write_f2let (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const float *, tribyte *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? f2let_clip_array : f2let_array ; - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, (tribyte*) (ubuf.ucbuf), bufferlen, psf->norm_float) ; - writecount = psf_fwrite (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_f2let */ - -/*============================================================================== -*/ - -static void -f2bet_array (const float *src, tribyte *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact ; - int value ; - - normfact = normalize ? (1.0 * 0x7FFFFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 3 * count ; - - while (--count >= 0) - { ucptr -= 3 ; - value = lrintf (src [count] * normfact) ; - ucptr [0] = value >> 16 ; - ucptr [1] = value >> 8 ; - ucptr [2] = value ; - } ; -} /* f2bet_array */ - -static void -f2bet_clip_array (const float *src, tribyte *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact, scaled_value ; - int value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x100) ; - ucptr = ((unsigned char*) dest) + 3 * count ; - - while (--count >= 0) - { ucptr -= 3 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { ucptr [0] = 0x7F ; - ucptr [1] = 0xFF ; - ucptr [2] = 0xFF ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [0] = 0x80 ; - ucptr [1] = 0x00 ; - ucptr [2] = 0x00 ; - continue ; - } ; - - value = lrint (scaled_value) ; - ucptr [0] = value >> 24 ; - ucptr [1] = value >> 16 ; - ucptr [2] = value >> 8 ; - } ; -} /* f2bet_clip_array */ - -static sf_count_t -pcm_write_f2bet (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const float *, tribyte *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? f2bet_clip_array : f2bet_array ; - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, (tribyte*) (ubuf.ucbuf), bufferlen, psf->norm_float) ; - writecount = psf_fwrite (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_f2bet */ - -/*============================================================================== -*/ - -static void -f2bei_array (const float *src, int *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact ; - int value ; - - normfact = normalize ? (1.0 * 0x7FFFFFFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 4 * count ; - while (--count >= 0) - { ucptr -= 4 ; - value = lrintf (src [count] * normfact) ; - ucptr [0] = value >> 24 ; - ucptr [1] = value >> 16 ; - ucptr [2] = value >> 8 ; - ucptr [3] = value ; - } ; -} /* f2bei_array */ - -static void -f2bei_clip_array (const float *src, int *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact, scaled_value ; - int value ; - - normfact = normalize ? (8.0 * 0x10000000) : 1.0 ; - ucptr = ((unsigned char*) dest) + 4 * count ; - - while (--count >= 0) - { ucptr -= 4 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= 1.0 * 0x7FFFFFFF) - { ucptr [0] = 0x7F ; - ucptr [1] = 0xFF ; - ucptr [2] = 0xFF ; - ucptr [3] = 0xFF ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [0] = 0x80 ; - ucptr [1] = 0x00 ; - ucptr [2] = 0x00 ; - ucptr [3] = 0x00 ; - continue ; - } ; - - value = lrintf (scaled_value) ; - ucptr [0] = value >> 24 ; - ucptr [1] = value >> 16 ; - ucptr [2] = value >> 8 ; - ucptr [3] = value ; - } ; -} /* f2bei_clip_array */ - -static sf_count_t -pcm_write_f2bei (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const float *, int *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? f2bei_clip_array : f2bei_array ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.ibuf, bufferlen, psf->norm_float) ; - writecount = psf_fwrite (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_f2bei */ - -/*============================================================================== -*/ - -static void -f2lei_array (const float *src, int *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact ; - int value ; - - normfact = normalize ? (1.0 * 0x7FFFFFFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 4 * count ; - - while (--count >= 0) - { ucptr -= 4 ; - value = lrintf (src [count] * normfact) ; - ucptr [0] = value ; - ucptr [1] = value >> 8 ; - ucptr [2] = value >> 16 ; - ucptr [3] = value >> 24 ; - } ; -} /* f2lei_array */ - -static void -f2lei_clip_array (const float *src, int *dest, int count, int normalize) -{ unsigned char *ucptr ; - float normfact, scaled_value ; - int value ; - - normfact = normalize ? (8.0 * 0x10000000) : 1.0 ; - ucptr = ((unsigned char*) dest) + 4 * count ; - - while (--count >= 0) - { ucptr -= 4 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { ucptr [0] = 0xFF ; - ucptr [1] = 0xFF ; - ucptr [2] = 0xFF ; - ucptr [3] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [0] = 0x00 ; - ucptr [1] = 0x00 ; - ucptr [2] = 0x00 ; - ucptr [3] = 0x80 ; - continue ; - } ; - - value = lrintf (scaled_value) ; - ucptr [0] = value ; - ucptr [1] = value >> 8 ; - ucptr [2] = value >> 16 ; - ucptr [3] = value >> 24 ; - } ; -} /* f2lei_clip_array */ - -static sf_count_t -pcm_write_f2lei (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const float *, int *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? f2lei_clip_array : f2lei_array ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.ibuf, bufferlen, psf->norm_float) ; - writecount = psf_fwrite (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_f2lei */ - -/*============================================================================== -*/ - -static void -d2sc_array (const double *src, signed char *dest, int count, int normalize) -{ double normfact ; - - normfact = normalize ? (1.0 * 0x7F) : 1.0 ; - - while (--count >= 0) - { dest [count] = lrint (src [count] * normfact) ; - } ; -} /* d2sc_array */ - -static void -d2sc_clip_array (const double *src, signed char *dest, int count, int normalize) -{ double normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x1000000) ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { dest [count] = 127 ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { dest [count] = -128 ; - continue ; - } ; - - dest [count] = lrintf (scaled_value) >> 24 ; - } ; -} /* d2sc_clip_array */ - -static sf_count_t -pcm_write_d2sc (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const double *, signed char *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? d2sc_clip_array : d2sc_array ; - bufferlen = ARRAY_LEN (ubuf.scbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.scbuf, bufferlen, psf->norm_double) ; - writecount = psf_fwrite (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_d2sc */ - -/*============================================================================== -*/ - -static void -d2uc_array (const double *src, unsigned char *dest, int count, int normalize) -{ double normfact ; - - normfact = normalize ? (1.0 * 0x7F) : 1.0 ; - - while (--count >= 0) - { dest [count] = lrint (src [count] * normfact) + 128 ; - } ; -} /* d2uc_array */ - -static void -d2uc_clip_array (const double *src, unsigned char *dest, int count, int normalize) -{ double normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x1000000) ; - - while (--count >= 0) - { scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { dest [count] = 255 ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { dest [count] = 0 ; - continue ; - } ; - - dest [count] = (lrint (src [count] * normfact) >> 24) + 128 ; - } ; -} /* d2uc_clip_array */ - -static sf_count_t -pcm_write_d2uc (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const double *, unsigned char *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? d2uc_clip_array : d2uc_array ; - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.ucbuf, bufferlen, psf->norm_double) ; - writecount = psf_fwrite (ubuf.ucbuf, sizeof (unsigned char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_d2uc */ - -/*============================================================================== -*/ - -static void -d2bes_array (const double *src, short *dest, int count, int normalize) -{ unsigned char *ucptr ; - short value ; - double normfact ; - - normfact = normalize ? (1.0 * 0x7FFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 2 * count ; - - while (--count >= 0) - { ucptr -= 2 ; - value = lrint (src [count] * normfact) ; - ucptr [1] = value ; - ucptr [0] = value >> 8 ; - } ; -} /* d2bes_array */ - -static void -d2bes_clip_array (const double *src, short *dest, int count, int normalize) -{ unsigned char *ucptr ; - double normfact, scaled_value ; - int value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x10000) ; - ucptr = ((unsigned char*) dest) + 2 * count ; - - while (--count >= 0) - { ucptr -= 2 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { ucptr [1] = 0xFF ; - ucptr [0] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [1] = 0x00 ; - ucptr [0] = 0x80 ; - continue ; - } ; - - value = lrint (scaled_value) ; - ucptr [1] = value >> 16 ; - ucptr [0] = value >> 24 ; - } ; -} /* d2bes_clip_array */ - -static sf_count_t -pcm_write_d2bes (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const double *, short *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? d2bes_clip_array : d2bes_array ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.sbuf, bufferlen, psf->norm_double) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_d2bes */ - -/*============================================================================== -*/ - -static void -d2les_array (const double *src, short *dest, int count, int normalize) -{ unsigned char *ucptr ; - short value ; - double normfact ; - - normfact = normalize ? (1.0 * 0x7FFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 2 * count ; - - while (--count >= 0) - { ucptr -= 2 ; - value = lrint (src [count] * normfact) ; - ucptr [0] = value ; - ucptr [1] = value >> 8 ; - } ; -} /* d2les_array */ - -static void -d2les_clip_array (const double *src, short *dest, int count, int normalize) -{ unsigned char *ucptr ; - int value ; - double normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x10000) ; - ucptr = ((unsigned char*) dest) + 2 * count ; - - while (--count >= 0) - { ucptr -= 2 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { ucptr [0] = 0xFF ; - ucptr [1] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [0] = 0x00 ; - ucptr [1] = 0x80 ; - continue ; - } ; - - value = lrint (scaled_value) ; - ucptr [0] = value >> 16 ; - ucptr [1] = value >> 24 ; - } ; -} /* d2les_clip_array */ - -static sf_count_t -pcm_write_d2les (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const double *, short *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? d2les_clip_array : d2les_array ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.sbuf, bufferlen, psf->norm_double) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_d2les */ - -/*============================================================================== -*/ - -static void -d2let_array (const double *src, tribyte *dest, int count, int normalize) -{ unsigned char *ucptr ; - int value ; - double normfact ; - - normfact = normalize ? (1.0 * 0x7FFFFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 3 * count ; - - while (--count >= 0) - { ucptr -= 3 ; - value = lrint (src [count] * normfact) ; - ucptr [0] = value ; - ucptr [1] = value >> 8 ; - ucptr [2] = value >> 16 ; - } ; -} /* d2let_array */ - -static void -d2let_clip_array (const double *src, tribyte *dest, int count, int normalize) -{ unsigned char *ucptr ; - int value ; - double normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x100) ; - ucptr = ((unsigned char*) dest) + 3 * count ; - - while (--count >= 0) - { ucptr -= 3 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { ucptr [0] = 0xFF ; - ucptr [1] = 0xFF ; - ucptr [2] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [0] = 0x00 ; - ucptr [1] = 0x00 ; - ucptr [2] = 0x80 ; - continue ; - } ; - - value = lrint (scaled_value) ; - ucptr [0] = value >> 8 ; - ucptr [1] = value >> 16 ; - ucptr [2] = value >> 24 ; - } ; -} /* d2let_clip_array */ - -static sf_count_t -pcm_write_d2let (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const double *, tribyte *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? d2let_clip_array : d2let_array ; - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, (tribyte*) (ubuf.ucbuf), bufferlen, psf->norm_double) ; - writecount = psf_fwrite (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_d2let */ - -/*============================================================================== -*/ - -static void -d2bet_array (const double *src, tribyte *dest, int count, int normalize) -{ unsigned char *ucptr ; - int value ; - double normfact ; - - normfact = normalize ? (1.0 * 0x7FFFFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 3 * count ; - - while (--count >= 0) - { ucptr -= 3 ; - value = lrint (src [count] * normfact) ; - ucptr [2] = value ; - ucptr [1] = value >> 8 ; - ucptr [0] = value >> 16 ; - } ; -} /* d2bet_array */ - -static void -d2bet_clip_array (const double *src, tribyte *dest, int count, int normalize) -{ unsigned char *ucptr ; - int value ; - double normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10000000) : (1.0 * 0x100) ; - ucptr = ((unsigned char*) dest) + 3 * count ; - - while (--count >= 0) - { ucptr -= 3 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { ucptr [2] = 0xFF ; - ucptr [1] = 0xFF ; - ucptr [0] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [2] = 0x00 ; - ucptr [1] = 0x00 ; - ucptr [0] = 0x80 ; - continue ; - } ; - - value = lrint (scaled_value) ; - ucptr [2] = value >> 8 ; - ucptr [1] = value >> 16 ; - ucptr [0] = value >> 24 ; - } ; -} /* d2bet_clip_array */ - -static sf_count_t -pcm_write_d2bet (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const double *, tribyte *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? d2bet_clip_array : d2bet_array ; - bufferlen = sizeof (ubuf.ucbuf) / SIZEOF_TRIBYTE ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, (tribyte*) (ubuf.ucbuf), bufferlen, psf->norm_double) ; - writecount = psf_fwrite (ubuf.ucbuf, SIZEOF_TRIBYTE, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_d2bet */ - -/*============================================================================== -*/ - -static void -d2bei_array (const double *src, int *dest, int count, int normalize) -{ unsigned char *ucptr ; - int value ; - double normfact ; - - normfact = normalize ? (1.0 * 0x7FFFFFFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 4 * count ; - - while (--count >= 0) - { ucptr -= 4 ; - value = lrint (src [count] * normfact) ; - ucptr [0] = value >> 24 ; - ucptr [1] = value >> 16 ; - ucptr [2] = value >> 8 ; - ucptr [3] = value ; - } ; -} /* d2bei_array */ - -static void -d2bei_clip_array (const double *src, int *dest, int count, int normalize) -{ unsigned char *ucptr ; - int value ; - double normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10000000) : 1.0 ; - ucptr = ((unsigned char*) dest) + 4 * count ; - - while (--count >= 0) - { ucptr -= 4 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { ucptr [3] = 0xFF ; - ucptr [2] = 0xFF ; - ucptr [1] = 0xFF ; - ucptr [0] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [3] = 0x00 ; - ucptr [2] = 0x00 ; - ucptr [1] = 0x00 ; - ucptr [0] = 0x80 ; - continue ; - } ; - - value = lrint (scaled_value) ; - ucptr [0] = value >> 24 ; - ucptr [1] = value >> 16 ; - ucptr [2] = value >> 8 ; - ucptr [3] = value ; - } ; -} /* d2bei_clip_array */ - -static sf_count_t -pcm_write_d2bei (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const double *, int *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? d2bei_clip_array : d2bei_array ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.ibuf, bufferlen, psf->norm_double) ; - writecount = psf_fwrite (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_d2bei */ - -/*============================================================================== -*/ - -static void -d2lei_array (const double *src, int *dest, int count, int normalize) -{ unsigned char *ucptr ; - int value ; - double normfact ; - - normfact = normalize ? (1.0 * 0x7FFFFFFF) : 1.0 ; - ucptr = ((unsigned char*) dest) + 4 * count ; - - while (--count >= 0) - { ucptr -= 4 ; - value = lrint (src [count] * normfact) ; - ucptr [0] = value ; - ucptr [1] = value >> 8 ; - ucptr [2] = value >> 16 ; - ucptr [3] = value >> 24 ; - } ; -} /* d2lei_array */ - -static void -d2lei_clip_array (const double *src, int *dest, int count, int normalize) -{ unsigned char *ucptr ; - int value ; - double normfact, scaled_value ; - - normfact = normalize ? (8.0 * 0x10000000) : 1.0 ; - ucptr = ((unsigned char*) dest) + 4 * count ; - - while (--count >= 0) - { ucptr -= 4 ; - scaled_value = src [count] * normfact ; - if (CPU_CLIPS_POSITIVE == 0 && scaled_value >= (1.0 * 0x7FFFFFFF)) - { ucptr [0] = 0xFF ; - ucptr [1] = 0xFF ; - ucptr [2] = 0xFF ; - ucptr [3] = 0x7F ; - continue ; - } ; - if (CPU_CLIPS_NEGATIVE == 0 && scaled_value <= (-8.0 * 0x10000000)) - { ucptr [0] = 0x00 ; - ucptr [1] = 0x00 ; - ucptr [2] = 0x00 ; - ucptr [3] = 0x80 ; - continue ; - } ; - - value = lrint (scaled_value) ; - ucptr [0] = value ; - ucptr [1] = value >> 8 ; - ucptr [2] = value >> 16 ; - ucptr [3] = value >> 24 ; - } ; -} /* d2lei_clip_array */ - -static sf_count_t -pcm_write_d2lei (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - void (*convert) (const double *, int *, int, int) ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - convert = (psf->add_clipping) ? d2lei_clip_array : d2lei_array ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - convert (ptr + total, ubuf.ibuf, bufferlen, psf->norm_double) ; - writecount = psf_fwrite (ubuf.ibuf, sizeof (int), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* pcm_write_d2lei */ - diff --git a/libs/libsndfile/src/pvf.c b/libs/libsndfile/src/pvf.c deleted file mode 100644 index 4ea24b6b68..0000000000 --- a/libs/libsndfile/src/pvf.c +++ /dev/null @@ -1,188 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues. -*/ - -#define PVF1_MARKER (MAKE_MARKER ('P', 'V', 'F', '1')) - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int pvf_close (SF_PRIVATE *psf) ; - -static int pvf_write_header (SF_PRIVATE *psf, int calc_length) ; -static int pvf_read_header (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -pvf_open (SF_PRIVATE *psf) -{ int subformat ; - int error = 0 ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = pvf_read_header (psf))) - return error ; - } ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_PVF) - return SFE_BAD_OPEN_FORMAT ; - - psf->endian = SF_ENDIAN_BIG ; - - if (pvf_write_header (psf, SF_FALSE)) - return psf->error ; - - psf->write_header = pvf_write_header ; - } ; - - psf->container_close = pvf_close ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - switch (subformat) - { case SF_FORMAT_PCM_S8 : /* 8-bit linear PCM. */ - case SF_FORMAT_PCM_16 : /* 16-bit linear PCM. */ - case SF_FORMAT_PCM_32 : /* 32-bit linear PCM. */ - error = pcm_init (psf) ; - break ; - - default : break ; - } ; - - return error ; -} /* pvf_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -pvf_close (SF_PRIVATE * UNUSED (psf)) -{ - return 0 ; -} /* pvf_close */ - -static int -pvf_write_header (SF_PRIVATE *psf, int UNUSED (calc_length)) -{ sf_count_t current ; - - if (psf->pipeoffset > 0) - return 0 ; - - current = psf_ftell (psf) ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - - if (psf->is_pipe == SF_FALSE) - psf_fseek (psf, 0, SEEK_SET) ; - - snprintf ((char*) psf->header, sizeof (psf->header), "PVF1\n%d %d %d\n", - psf->sf.channels, psf->sf.samplerate, psf->bytewidth * 8) ; - - psf->headindex = strlen ((char*) psf->header) ; - - /* Header construction complete so write it out. */ - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* pvf_write_header */ - -static int -pvf_read_header (SF_PRIVATE *psf) -{ char buffer [32] ; - int marker, channels, samplerate, bitwidth ; - - psf_binheader_readf (psf, "pmj", 0, &marker, 1) ; - psf_log_printf (psf, "%M\n", marker) ; - - if (marker != PVF1_MARKER) - return SFE_PVF_NO_PVF1 ; - - /* Grab characters up until a newline which is replaced by an EOS. */ - psf_binheader_readf (psf, "G", buffer, sizeof (buffer)) ; - - if (sscanf (buffer, "%d %d %d", &channels, &samplerate, &bitwidth) != 3) - return SFE_PVF_BAD_HEADER ; - - psf_log_printf (psf, " Channels : %d\n Sample rate : %d\n Bit width : %d\n", - channels, samplerate, bitwidth) ; - - psf->sf.channels = channels ; - psf->sf.samplerate = samplerate ; - - switch (bitwidth) - { case 8 : - psf->sf.format = SF_FORMAT_PVF | SF_FORMAT_PCM_S8 ; - psf->bytewidth = 1 ; - break ; - - case 16 : - psf->sf.format = SF_FORMAT_PVF | SF_FORMAT_PCM_16 ; - psf->bytewidth = 2 ; - break ; - case 32 : - psf->sf.format = SF_FORMAT_PVF | SF_FORMAT_PCM_32 ; - psf->bytewidth = 4 ; - break ; - - default : - return SFE_PVF_BAD_BITWIDTH ; - } ; - - psf->dataoffset = psf_ftell (psf) ; - psf_log_printf (psf, " Data Offset : %D\n", psf->dataoffset) ; - - psf->endian = SF_ENDIAN_BIG ; - - psf->datalength = psf->filelength - psf->dataoffset ; - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - - if (! psf->sf.frames && psf->blockwidth) - psf->sf.frames = (psf->filelength - psf->dataoffset) / psf->blockwidth ; - - return 0 ; -} /* pvf_read_header */ diff --git a/libs/libsndfile/src/raw.c b/libs/libsndfile/src/raw.c deleted file mode 100644 index e5dc49e2ff..0000000000 --- a/libs/libsndfile/src/raw.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -** Copyright (C) 1999-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include - -#include "sndfile.h" -#include "common.h" - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -raw_open (SF_PRIVATE *psf) -{ int subformat, error = SFE_NO_ERROR ; - - subformat = SF_CODEC (psf->sf.format) ; - - psf->endian = SF_ENDIAN (psf->sf.format) ; - - if (CPU_IS_BIG_ENDIAN && (psf->endian == 0 || psf->endian == SF_ENDIAN_CPU)) - psf->endian = SF_ENDIAN_BIG ; - else if (CPU_IS_LITTLE_ENDIAN && (psf->endian == 0 || psf->endian == SF_ENDIAN_CPU)) - psf->endian = SF_ENDIAN_LITTLE ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - psf->dataoffset = 0 ; - psf->datalength = psf->filelength ; - - switch (subformat) - { case SF_FORMAT_PCM_S8 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_PCM_U8 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_ULAW : - error = ulaw_init (psf) ; - break ; - - case SF_FORMAT_ALAW : - error = alaw_init (psf) ; - break ; - - case SF_FORMAT_GSM610 : - error = gsm610_init (psf) ; - break ; - - /* Lite remove start */ - case SF_FORMAT_FLOAT : - error = float32_init (psf) ; - break ; - - case SF_FORMAT_DOUBLE : - error = double64_init (psf) ; - break ; - - case SF_FORMAT_DWVW_12 : - error = dwvw_init (psf, 12) ; - break ; - - case SF_FORMAT_DWVW_16 : - error = dwvw_init (psf, 16) ; - break ; - - case SF_FORMAT_DWVW_24 : - error = dwvw_init (psf, 24) ; - break ; - - case SF_FORMAT_VOX_ADPCM : - error = vox_adpcm_init (psf) ; - break ; - /* Lite remove end */ - - default : return SFE_BAD_OPEN_FORMAT ; - } ; - - return error ; -} /* raw_open */ diff --git a/libs/libsndfile/src/rf64.c b/libs/libsndfile/src/rf64.c deleted file mode 100644 index 7f14ef89ba..0000000000 --- a/libs/libsndfile/src/rf64.c +++ /dev/null @@ -1,726 +0,0 @@ -/* -** Copyright (C) 2008-2013 Erik de Castro Lopo -** Copyright (C) 2009 Uli Franke -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** This format documented at: -** http://www.sr.se/utveckling/tu/bwf/prog/RF_64v1_4.pdf -** -** But this may be a better reference: -** http://www.ebu.ch/CMSimages/en/tec_doc_t3306-2007_tcm6-42570.pdf -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" -#include "wav_w64.h" - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues. -*/ -#define RF64_MARKER MAKE_MARKER ('R', 'F', '6', '4') -#define FFFF_MARKER MAKE_MARKER (0xff, 0xff, 0xff, 0xff) -#define WAVE_MARKER MAKE_MARKER ('W', 'A', 'V', 'E') -#define ds64_MARKER MAKE_MARKER ('d', 's', '6', '4') -#define fmt_MARKER MAKE_MARKER ('f', 'm', 't', ' ') -#define fact_MARKER MAKE_MARKER ('f', 'a', 'c', 't') -#define data_MARKER MAKE_MARKER ('d', 'a', 't', 'a') - -#define bext_MARKER MAKE_MARKER ('b', 'e', 'x', 't') -#define cart_MARKER MAKE_MARKER ('c', 'a', 'r', 't') -#define OggS_MARKER MAKE_MARKER ('O', 'g', 'g', 'S') -#define wvpk_MARKER MAKE_MARKER ('w', 'v', 'p', 'k') - -/*------------------------------------------------------------------------------ -** Typedefs. -*/ - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int rf64_read_header (SF_PRIVATE *psf, int *blockalign, int *framesperblock) ; -static int rf64_write_header (SF_PRIVATE *psf, int calc_length) ; -static int rf64_close (SF_PRIVATE *psf) ; -static int rf64_command (SF_PRIVATE *psf, int command, void * UNUSED (data), int datasize) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -rf64_open (SF_PRIVATE *psf) -{ WAV_PRIVATE *wpriv ; - int subformat, error = 0 ; - int blockalign, framesperblock ; - - if ((wpriv = calloc (1, sizeof (WAV_PRIVATE))) == NULL) - return SFE_MALLOC_FAILED ; - psf->container_data = wpriv ; - wpriv->wavex_ambisonic = SF_AMBISONIC_NONE ; - - /* All RF64 files are little endian. */ - psf->endian = SF_ENDIAN_LITTLE ; - - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = rf64_read_header (psf, &blockalign, &framesperblock)) != 0) - return error ; - } ; - - if ((psf->sf.format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RF64) - return SFE_BAD_OPEN_FORMAT ; - - subformat = psf->sf.format & SF_FORMAT_SUBMASK ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (psf->is_pipe) - return SFE_NO_PIPE_WRITE ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - if ((error = rf64_write_header (psf, SF_FALSE))) - return error ; - - psf->write_header = rf64_write_header ; - } ; - - psf->container_close = rf64_close ; - psf->command = rf64_command ; - - switch (subformat) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_ULAW : - error = ulaw_init (psf) ; - break ; - - case SF_FORMAT_ALAW : - error = alaw_init (psf) ; - break ; - - /* Lite remove start */ - case SF_FORMAT_FLOAT : - error = float32_init (psf) ; - break ; - - case SF_FORMAT_DOUBLE : - error = double64_init (psf) ; - break ; - - /* Lite remove end */ - - default : return SFE_UNIMPLEMENTED ; - } ; - - return error ; -} /* rf64_open */ - -/*------------------------------------------------------------------------------ -*/ -enum -{ HAVE_ds64 = 0x01, - HAVE_fmt = 0x02, - HAVE_bext = 0x04, - HAVE_data = 0x08, - HAVE_cart = 0x10 -} ; - -#define HAVE_CHUNK(CHUNK) ((parsestage & CHUNK) != 0) - -static int -rf64_read_header (SF_PRIVATE *psf, int *blockalign, int *framesperblock) -{ WAV_PRIVATE *wpriv ; - WAV_FMT *wav_fmt ; - sf_count_t riff_size = 0, frame_count = 0, ds64_datalength = 0 ; - uint32_t marks [2], size32, parsestage = 0 ; - int marker, error, done = 0, format = 0 ; - - if ((wpriv = psf->container_data) == NULL) - return SFE_INTERNAL ; - wav_fmt = &wpriv->wav_fmt ; - - /* Set position to start of file to begin reading header. */ - psf_binheader_readf (psf, "pmmm", 0, &marker, marks, marks + 1) ; - if (marker != RF64_MARKER || marks [1] != WAVE_MARKER) - return SFE_RF64_NOT_RF64 ; - - if (marks [0] == FFFF_MARKER) - psf_log_printf (psf, "%M\n %M\n", RF64_MARKER, WAVE_MARKER) ; - else - psf_log_printf (psf, "%M : 0x%x (should be 0xFFFFFFFF)\n %M\n", RF64_MARKER, WAVE_MARKER) ; - - while (NOT (done)) - { psf_binheader_readf (psf, "em4", &marker, &size32) ; - - switch (marker) - { case ds64_MARKER : - { unsigned int table_len, bytesread ; - - /* Read ds64 sizes (3 8-byte words). */ - bytesread = psf_binheader_readf (psf, "888", &riff_size, &ds64_datalength, &frame_count) ; - - /* Read table length. */ - bytesread += psf_binheader_readf (psf, "4", &table_len) ; - /* Skip table for now. (this was "table_len + 4", why?) */ - bytesread += psf_binheader_readf (psf, "j", table_len) ; - - if (size32 == bytesread) - psf_log_printf (psf, "%M : %u\n", marker, size32) ; - else if (size32 >= bytesread + 4) - { unsigned int next ; - psf_binheader_readf (psf, "m", &next) ; - if (next == fmt_MARKER) - { psf_log_printf (psf, "%M : %u (should be %u)\n", marker, size32, bytesread) ; - psf_binheader_readf (psf, "j", -4) ; - } - else - { psf_log_printf (psf, "%M : %u\n", marker, size32) ; - psf_binheader_readf (psf, "j", size32 - bytesread - 4) ; - } ; - } ; - - if (psf->filelength != riff_size + 8) - psf_log_printf (psf, " Riff size : %D (should be %D)\n", riff_size, psf->filelength - 8) ; - else - psf_log_printf (psf, " Riff size : %D\n", riff_size) ; - - psf_log_printf (psf, " Data size : %D\n", ds64_datalength) ; - - psf_log_printf (psf, " Frames : %D\n", frame_count) ; - psf_log_printf (psf, " Table length : %u\n", table_len) ; - - } ; - parsestage |= HAVE_ds64 ; - break ; - - case fmt_MARKER: - psf_log_printf (psf, "%M : %u\n", marker, size32) ; - if ((error = wav_w64_read_fmt_chunk (psf, size32)) != 0) - return error ; - format = wav_fmt->format ; - parsestage |= HAVE_fmt ; - break ; - - case bext_MARKER : - if ((error = wav_read_bext_chunk (psf, size32)) != 0) - return error ; - parsestage |= HAVE_bext ; - break ; - - case cart_MARKER : - if ((error = wav_read_cart_chunk (psf, size32)) != 0) - return error ; - parsestage |= HAVE_cart ; - break ; - - case data_MARKER : - /* see wav for more sophisticated parsing -> implement state machine with parsestage */ - - if (HAVE_CHUNK (HAVE_ds64)) - { if (size32 == 0xffffffff) - psf_log_printf (psf, "%M : 0x%x\n", marker, size32) ; - else - psf_log_printf (psf, "%M : 0x%x (should be 0xffffffff\n", marker, size32) ; - psf->datalength = ds64_datalength ; - } - else - { if (size32 == 0xffffffff) - { psf_log_printf (psf, "%M : 0x%x\n", marker, size32) ; - psf_log_printf (psf, " *** Data length not specified no 'ds64' chunk.\n") ; - } - else - { psf_log_printf (psf, "%M : 0x%x\n**** Weird, RF64 file without a 'ds64' chunk and no valid 'data' size.\n", marker, size32) ; - psf->datalength = size32 ; - } ; - } ; - - psf->dataoffset = psf_ftell (psf) ; - - if (psf->dataoffset > 0) - { if (size32 == 0 && riff_size == 8 && psf->filelength > 44) - { psf_log_printf (psf, " *** Looks like a WAV file which wasn't closed properly. Fixing it.\n") ; - psf->datalength = psf->filelength - psf->dataoffset ; - } ; - - /* Only set dataend if there really is data at the end. */ - if (psf->datalength + psf->dataoffset < psf->filelength) - psf->dataend = psf->datalength + psf->dataoffset ; - - if (NOT (psf->sf.seekable) || psf->dataoffset < 0) - break ; - - /* Seek past data and continue reading header. */ - psf_fseek (psf, psf->datalength, SEEK_CUR) ; - - if (psf_ftell (psf) != psf->datalength + psf->dataoffset) - psf_log_printf (psf, " *** psf_fseek past end error ***\n") ; - break ; - } ; - break ; - - default : - if (isprint ((marker >> 24) & 0xFF) && isprint ((marker >> 16) & 0xFF) - && isprint ((marker >> 8) & 0xFF) && isprint (marker & 0xFF)) - { psf_log_printf (psf, "*** %M : %d (unknown marker)\n", marker, size32) ; - if (size32 < 8) - done = SF_TRUE ; - psf_binheader_readf (psf, "j", size32) ; - break ; - } ; - if (psf_ftell (psf) & 0x03) - { psf_log_printf (psf, " Unknown chunk marker at position 0x%x. Resynching.\n", size32 - 4) ; - psf_binheader_readf (psf, "j", -3) ; - break ; - } ; - psf_log_printf (psf, "*** Unknown chunk marker (0x%X) at position 0x%X. Exiting parser.\n", marker, psf_ftell (psf) - 4) ; - done = SF_TRUE ; - break ; - } ; /* switch (marker) */ - - if (psf_ftell (psf) >= psf->filelength - SIGNED_SIZEOF (marker)) - { psf_log_printf (psf, "End\n") ; - break ; - } ; - } ; - - if (psf->dataoffset <= 0) - return SFE_WAV_NO_DATA ; - - /* WAVs can be little or big endian */ - psf->endian = psf->rwf_endian ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - if (psf->is_pipe == 0) - { /* - ** Check for 'wvpk' at the start of the DATA section. Not able to - ** handle this. - */ - psf_binheader_readf (psf, "4", &marker) ; - if (marker == wvpk_MARKER || marker == OggS_MARKER) - return SFE_WAV_WVPK_DATA ; - } ; - - /* Seek to start of DATA section. */ - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - if (psf->blockwidth) - { if (psf->filelength - psf->dataoffset < psf->datalength) - psf->sf.frames = (psf->filelength - psf->dataoffset) / psf->blockwidth ; - else - psf->sf.frames = psf->datalength / psf->blockwidth ; - } ; - - if (frame_count != psf->sf.frames) - psf_log_printf (psf, "*** Calculated frame count %d does not match value from 'ds64' chunk of %d.\n", psf->sf.frames, frame_count) ; - - switch (format) - { - case WAVE_FORMAT_EXTENSIBLE : - - /* with WAVE_FORMAT_EXTENSIBLE the psf->sf.format field is already set. We just have to set the major to rf64 */ - psf->sf.format = (psf->sf.format & ~SF_FORMAT_TYPEMASK) | SF_FORMAT_RF64 ; - - if (psf->sf.format == (SF_FORMAT_WAVEX | SF_FORMAT_MS_ADPCM)) - { *blockalign = wav_fmt->msadpcm.blockalign ; - *framesperblock = wav_fmt->msadpcm.samplesperblock ; - } ; - break ; - - case WAVE_FORMAT_PCM : - psf->sf.format = SF_FORMAT_RF64 | u_bitwidth_to_subformat (psf->bytewidth * 8) ; - break ; - - case WAVE_FORMAT_MULAW : - case IBM_FORMAT_MULAW : - psf->sf.format = (SF_FORMAT_RF64 | SF_FORMAT_ULAW) ; - break ; - - case WAVE_FORMAT_ALAW : - case IBM_FORMAT_ALAW : - psf->sf.format = (SF_FORMAT_RF64 | SF_FORMAT_ALAW) ; - break ; - - case WAVE_FORMAT_MS_ADPCM : - psf->sf.format = (SF_FORMAT_RF64 | SF_FORMAT_MS_ADPCM) ; - *blockalign = wav_fmt->msadpcm.blockalign ; - *framesperblock = wav_fmt->msadpcm.samplesperblock ; - break ; - - case WAVE_FORMAT_IMA_ADPCM : - psf->sf.format = (SF_FORMAT_RF64 | SF_FORMAT_IMA_ADPCM) ; - *blockalign = wav_fmt->ima.blockalign ; - *framesperblock = wav_fmt->ima.samplesperblock ; - break ; - - case WAVE_FORMAT_GSM610 : - psf->sf.format = (SF_FORMAT_RF64 | SF_FORMAT_GSM610) ; - break ; - - case WAVE_FORMAT_IEEE_FLOAT : - psf->sf.format = SF_FORMAT_RF64 ; - psf->sf.format |= (psf->bytewidth == 8) ? SF_FORMAT_DOUBLE : SF_FORMAT_FLOAT ; - break ; - - case WAVE_FORMAT_G721_ADPCM : - psf->sf.format = SF_FORMAT_RF64 | SF_FORMAT_G721_32 ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - if (wpriv->fmt_is_broken) - wav_w64_analyze (psf) ; - - /* Only set the format endian-ness if its non-standard big-endian. */ - if (psf->endian == SF_ENDIAN_BIG) - psf->sf.format |= SF_ENDIAN_BIG ; - - return 0 ; -} /* rf64_read_header */ - -/* known WAVEFORMATEXTENSIBLE GUIDS */ -static const EXT_SUBFORMAT MSGUID_SUBTYPE_PCM = -{ 0x00000001, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_MS_ADPCM = -{ 0x00000002, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_IEEE_FLOAT = -{ 0x00000003, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_ALAW = -{ 0x00000006, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_MULAW = -{ 0x00000007, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -/* -** the next two are from -** http://dream.cs.bath.ac.uk/researchdev/wave-ex/bformat.html -*/ -static const EXT_SUBFORMAT MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_PCM = -{ 0x00000001, 0x0721, 0x11d3, { 0x86, 0x44, 0xC8, 0xC1, 0xCA, 0x00, 0x00, 0x00 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_IEEE_FLOAT = -{ 0x00000003, 0x0721, 0x11d3, { 0x86, 0x44, 0xC8, 0xC1, 0xCA, 0x00, 0x00, 0x00 } -} ; - - -static int -rf64_write_fmt_chunk (SF_PRIVATE *psf) -{ WAV_PRIVATE *wpriv ; - int subformat, fmt_size ; - - if ((wpriv = psf->container_data) == NULL) - return SFE_INTERNAL ; - - subformat = psf->sf.format & SF_FORMAT_SUBMASK ; - - /* initial section (same for all, it appears) */ - switch (subformat) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - case SF_FORMAT_ULAW : - case SF_FORMAT_ALAW : - fmt_size = 2 + 2 + 4 + 4 + 2 + 2 + 2 + 2 + 4 + 4 + 2 + 2 + 8 ; - - /* fmt : format, channels, samplerate */ - psf_binheader_writef (psf, "4224", fmt_size, WAVE_FORMAT_EXTENSIBLE, psf->sf.channels, psf->sf.samplerate) ; - /* fmt : bytespersec */ - psf_binheader_writef (psf, "4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ; - /* fmt : blockalign, bitwidth */ - psf_binheader_writef (psf, "22", psf->bytewidth * psf->sf.channels, psf->bytewidth * 8) ; - - /* cbSize 22 is sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX) */ - psf_binheader_writef (psf, "2", 22) ; - - /* wValidBitsPerSample, for our use same as bitwidth as we use it fully */ - psf_binheader_writef (psf, "2", psf->bytewidth * 8) ; - - /* For an Ambisonic file set the channel mask to zero. - ** Otherwise use a default based on the channel count. - */ - if (wpriv->wavex_ambisonic != SF_AMBISONIC_NONE) - psf_binheader_writef (psf, "4", 0) ; - else if (wpriv->wavex_channelmask != 0) - psf_binheader_writef (psf, "4", wpriv->wavex_channelmask) ; - else - { /* - ** Ok some liberty is taken here to use the most commonly used channel masks - ** instead of "no mapping". If you really want to use "no mapping" for 8 channels and less - ** please don't use wavex. (otherwise we'll have to create a new SF_COMMAND) - */ - switch (psf->sf.channels) - { case 1 : /* center channel mono */ - psf_binheader_writef (psf, "4", 0x4) ; - break ; - - case 2 : /* front left and right */ - psf_binheader_writef (psf, "4", 0x1 | 0x2) ; - break ; - - case 4 : /* Quad */ - psf_binheader_writef (psf, "4", 0x1 | 0x2 | 0x10 | 0x20) ; - break ; - - case 6 : /* 5.1 */ - psf_binheader_writef (psf, "4", 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20) ; - break ; - - case 8 : /* 7.1 */ - psf_binheader_writef (psf, "4", 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80) ; - break ; - - default : /* 0 when in doubt , use direct out, ie NO mapping*/ - psf_binheader_writef (psf, "4", 0x0) ; - break ; - } ; - } ; - break ; - - case SF_FORMAT_MS_ADPCM : /* Todo, GUID exists might have different header as per wav_write_header */ - default : - return SFE_UNIMPLEMENTED ; - } ; - - /* GUID section, different for each */ - - switch (subformat) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - wavex_write_guid (psf, wpriv->wavex_ambisonic == SF_AMBISONIC_NONE ? - &MSGUID_SUBTYPE_PCM : &MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_PCM) ; - break ; - - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - wavex_write_guid (psf, wpriv->wavex_ambisonic == SF_AMBISONIC_NONE ? - &MSGUID_SUBTYPE_IEEE_FLOAT : &MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_IEEE_FLOAT) ; - break ; - - case SF_FORMAT_ULAW : - wavex_write_guid (psf, &MSGUID_SUBTYPE_MULAW) ; - break ; - - case SF_FORMAT_ALAW : - wavex_write_guid (psf, &MSGUID_SUBTYPE_ALAW) ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - return 0 ; -} /* rf64_write_fmt_chunk */ - - -static int -rf64_write_header (SF_PRIVATE *psf, int calc_length) -{ sf_count_t current ; - int error = 0, has_data = SF_FALSE ; - - current = psf_ftell (psf) ; - - if (psf->dataoffset > 0 && current > psf->dataoffset) - has_data = SF_TRUE ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - psf->datalength = psf->filelength - psf->dataoffset ; - - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - - if (psf->bytewidth > 0) - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - psf_binheader_writef (psf, "em4m", RF64_MARKER, 0xffffffff, WAVE_MARKER) ; - - /* Currently no table. */ - psf_binheader_writef (psf, "m48884", ds64_MARKER, 28, psf->filelength - 8, psf->datalength, psf->sf.frames, 0) ; - - /* WAVE and 'fmt ' markers. */ - psf_binheader_writef (psf, "m", fmt_MARKER) ; - - /* Write the 'fmt ' chunk. */ - switch (psf->sf.format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_WAV : - psf_log_printf (psf, "ooops SF_FORMAT_WAV\n") ; - return SFE_UNIMPLEMENTED ; - break ; - - case SF_FORMAT_WAVEX : - case SF_FORMAT_RF64 : - if ((error = rf64_write_fmt_chunk (psf)) != 0) - return error ; - break ; - - default : - return SFE_UNIMPLEMENTED ; - } ; - - if (psf->broadcast_16k != NULL) - wav_write_bext_chunk (psf) ; - - if (psf->cart_16k != NULL) - wav_write_cart_chunk (psf) ; -#if 0 - /* The LIST/INFO chunk. */ - if (psf->strings.flags & SF_STR_LOCATE_START) - wav_write_strings (psf, SF_STR_LOCATE_START) ; - - if (psf->peak_info != NULL && psf->peak_info->peak_loc == SF_PEAK_START) - { psf_binheader_writef (psf, "m4", PEAK_MARKER, WAV_PEAK_CHUNK_SIZE (psf->sf.channels)) ; - psf_binheader_writef (psf, "44", 1, time (NULL)) ; - for (k = 0 ; k < psf->sf.channels ; k++) - psf_binheader_writef (psf, "ft8", (float) psf->peak_info->peaks [k].value, psf->peak_info->peaks [k].position) ; - } ; - -// if (psf->broadcast_info != NULL) -// wav_write_bext_chunk (psf) ; - - if (psf->instrument != NULL) - { int tmp ; - double dtune = (double) (0x40000000) / 25.0 ; - - psf_binheader_writef (psf, "m4", smpl_MARKER, 9 * 4 + psf->instrument->loop_count * 6 * 4) ; - psf_binheader_writef (psf, "44", 0, 0) ; /* Manufacturer zero is everyone */ - tmp = (int) (1.0e9 / psf->sf.samplerate) ; /* Sample period in nano seconds */ - psf_binheader_writef (psf, "44", tmp, psf->instrument->basenote) ; - tmp = (unsigned int) (psf->instrument->detune * dtune + 0.5) ; - psf_binheader_writef (psf, "4", tmp) ; - psf_binheader_writef (psf, "44", 0, 0) ; /* SMTPE format */ - psf_binheader_writef (psf, "44", psf->instrument->loop_count, 0) ; - - for (tmp = 0 ; tmp < psf->instrument->loop_count ; tmp++) - { int type ; - - type = psf->instrument->loops [tmp].mode ; - type = (type == SF_LOOP_FORWARD ? 0 : type == SF_LOOP_BACKWARD ? 2 : type == SF_LOOP_ALTERNATING ? 1 : 32) ; - - psf_binheader_writef (psf, "44", tmp, type) ; - psf_binheader_writef (psf, "44", psf->instrument->loops [tmp].start, psf->instrument->loops [tmp].end) ; - psf_binheader_writef (psf, "44", 0, psf->instrument->loops [tmp].count) ; - } ; - } ; - - if (psf->headindex + 8 < psf->dataoffset) - { /* Add PAD data if necessary. */ - k = psf->dataoffset - 16 - psf->headindex ; - psf_binheader_writef (psf, "m4z", PAD_MARKER, k, make_size_t (k)) ; - } ; - -#endif - - psf_binheader_writef (psf, "m4", data_MARKER, 0xffffffff) ; - - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - if (psf->error) - return psf->error ; - - if (has_data && psf->dataoffset != psf->headindex) - { printf ("Oooops : has_data && psf->dataoffset != psf->headindex\n") ; - return psf->error = SFE_INTERNAL ; - } ; - - psf->dataoffset = psf->headindex ; - - if (NOT (has_data)) - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - else if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* rf64_write_header */ - -static int -rf64_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { // rf64_write_tailer (psf) ; - - psf->write_header (psf, SF_TRUE) ; - } ; - - return 0 ; -} /* rf64_close */ - -static int -rf64_command (SF_PRIVATE *psf, int command, void * UNUSED (data), int datasize) -{ WAV_PRIVATE *wpriv ; - - if ((wpriv = psf->container_data) == NULL) - return SFE_INTERNAL ; - - switch (command) - { case SFC_WAVEX_SET_AMBISONIC : - if ((SF_CONTAINER (psf->sf.format)) == SF_FORMAT_WAVEX) - { if (datasize == SF_AMBISONIC_NONE) - wpriv->wavex_ambisonic = SF_AMBISONIC_NONE ; - else if (datasize == SF_AMBISONIC_B_FORMAT) - wpriv->wavex_ambisonic = SF_AMBISONIC_B_FORMAT ; - else - return 0 ; - } ; - return wpriv->wavex_ambisonic ; - - case SFC_WAVEX_GET_AMBISONIC : - return wpriv->wavex_ambisonic ; - - case SFC_SET_CHANNEL_MAP_INFO : - wpriv->wavex_channelmask = wavex_gen_channel_mask (psf->channel_map, psf->sf.channels) ; - return (wpriv->wavex_channelmask != 0) ; - - default : - break ; - } ; - - return 0 ; -} /* rf64_command */ - diff --git a/libs/libsndfile/src/rx2.c b/libs/libsndfile/src/rx2.c deleted file mode 100644 index 0a730480e7..0000000000 --- a/libs/libsndfile/src/rx2.c +++ /dev/null @@ -1,318 +0,0 @@ -/* -** Copyright (C) 2001-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if (ENABLE_EXPERIMENTAL_CODE == 0) - -int -rx2_open (SF_PRIVATE *psf) -{ if (psf) - return SFE_UNIMPLEMENTED ; - return 0 ; -} /* rx2_open */ - -#else - -/*------------------------------------------------------------------------------ - * Macros to handle big/little endian issues. -*/ - -#define CAT_MARKER (MAKE_MARKER ('C', 'A', 'T', ' ')) -#define GLOB_MARKER (MAKE_MARKER ('G', 'L', 'O', 'B')) - -#define RECY_MARKER (MAKE_MARKER ('R', 'E', 'C', 'Y')) - -#define SLCL_MARKER (MAKE_MARKER ('S', 'L', 'C', 'L')) -#define SLCE_MARKER (MAKE_MARKER ('S', 'L', 'C', 'E')) - -#define DEVL_MARKER (MAKE_MARKER ('D', 'E', 'V', 'L')) -#define TRSH_MARKER (MAKE_MARKER ('T', 'R', 'S', 'H')) - -#define EQ_MARKER (MAKE_MARKER ('E', 'Q', ' ', ' ')) -#define COMP_MARKER (MAKE_MARKER ('C', 'O', 'M', 'P')) - -#define SINF_MARKER (MAKE_MARKER ('S', 'I', 'N', 'F')) -#define SDAT_MARKER (MAKE_MARKER ('S', 'D', 'A', 'T')) - -/*------------------------------------------------------------------------------ - * Typedefs for file chunks. -*/ - - -/*------------------------------------------------------------------------------ - * Private static functions. -*/ -static int rx2_close (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -** Public functions. -*/ - -int -rx2_open (SF_PRIVATE *psf) -{ static const char *marker_type [4] = - { "Original Enabled", "Enabled Hidden", - "Additional/PencilTool", "Disabled" - } ; - - BUF_UNION ubuf ; - int error, marker, length, glob_offset, slce_count, frames ; - int sdat_length = 0, slce_total = 0 ; - int n_channels ; - - - /* So far only doing read. */ - - psf_binheader_readf (psf, "Epm4", 0, &marker, &length) ; - - if (marker != CAT_MARKER) - { psf_log_printf (psf, "length : %d\n", length) ; - return -1000 ; - } ; - - if (length != psf->filelength - 8) - psf_log_printf (psf, "%M : %d (should be %d)\n", marker, length, psf->filelength - 8) ; - else - psf_log_printf (psf, "%M : %d\n", marker, length) ; - - /* 'REX2' marker */ - psf_binheader_readf (psf, "m", &marker) ; - psf_log_printf (psf, "%M", marker) ; - - /* 'HEAD' marker */ - psf_binheader_readf (psf, "m", &marker) ; - psf_log_printf (psf, "%M\n", marker) ; - - /* Grab 'GLOB' offset. */ - psf_binheader_readf (psf, "E4", &glob_offset) ; - glob_offset += 0x14 ; /* Add the current file offset. */ - - /* Jump to offset 0x30 */ - psf_binheader_readf (psf, "p", 0x30) ; - - /* Get name length */ - length = 0 ; - psf_binheader_readf (psf, "1", &length) ; - if (length >= SIGNED_SIZEOF (ubuf.cbuf)) - { psf_log_printf (psf, " Text : %d *** Error : Too sf_count_t!\n") ; - return -1001 ; - } - - memset (ubuf.cbuf, 0, sizeof (ubuf.cbuf)) ; - psf_binheader_readf (psf, "b", ubuf.cbuf, length) ; - psf_log_printf (psf, " Text : \"%s\"\n", ubuf.cbuf) ; - - /* Jump to GLOB offset position. */ - if (glob_offset & 1) - glob_offset ++ ; - - psf_binheader_readf (psf, "p", glob_offset) ; - - slce_count = 0 ; - /* GLOB */ - while (1) - { psf_binheader_readf (psf, "m", &marker) ; - - if (marker != SLCE_MARKER && slce_count > 0) - { psf_log_printf (psf, " SLCE count : %d\n", slce_count) ; - slce_count = 0 ; - } - switch (marker) - { case GLOB_MARKER: - psf_binheader_readf (psf, "E4", &length) ; - psf_log_printf (psf, " %M : %d\n", marker, length) ; - psf_binheader_readf (psf, "j", length) ; - break ; - - case RECY_MARKER: - psf_binheader_readf (psf, "E4", &length) ; - psf_log_printf (psf, " %M : %d\n", marker, length) ; - psf_binheader_readf (psf, "j", (length+1) & 0xFFFFFFFE) ; /* ?????? */ - break ; - - case CAT_MARKER: - psf_binheader_readf (psf, "E4", &length) ; - psf_log_printf (psf, " %M : %d\n", marker, length) ; - /*-psf_binheader_readf (psf, "j", length) ;-*/ - break ; - - case DEVL_MARKER: - psf_binheader_readf (psf, "mE4", &marker, &length) ; - psf_log_printf (psf, " DEVL%M : %d\n", marker, length) ; - if (length & 1) - length ++ ; - psf_binheader_readf (psf, "j", length) ; - break ; - - case EQ_MARKER: - case COMP_MARKER: - psf_binheader_readf (psf, "E4", &length) ; - psf_log_printf (psf, " %M : %d\n", marker, length) ; - /* This is weird!!!! why make this (length - 1) */ - if (length & 1) - length ++ ; - psf_binheader_readf (psf, "j", length) ; - break ; - - case SLCL_MARKER: - psf_log_printf (psf, " %M\n (Offset, Next Offset, Type)\n", marker) ; - slce_count = 0 ; - break ; - - case SLCE_MARKER: - { int len [4], indx ; - - psf_binheader_readf (psf, "E4444", &len [0], &len [1], &len [2], &len [3]) ; - - indx = ((len [3] & 0x0000FFFF) >> 8) & 3 ; - - if (len [2] == 1) - { if (indx != 1) - indx = 3 ; /* 2 cases, where next slice offset = 1 -> disabled & enabled/hidden */ - - psf_log_printf (psf, " %M : (%6d, ?: 0x%X, %s)\n", marker, len [1], (len [3] & 0xFFFF0000) >> 16, marker_type [indx]) ; - } - else - { slce_total += len [2] ; - - psf_log_printf (psf, " %M : (%6d, SLCE_next_ofs:%d, ?: 0x%X, %s)\n", marker, len [1], len [2], (len [3] & 0xFFFF0000) >> 16, marker_type [indx]) ; - } ; - - slce_count ++ ; - } ; - break ; - - case SINF_MARKER: - psf_binheader_readf (psf, "E4", &length) ; - psf_log_printf (psf, " %M : %d\n", marker, length) ; - - psf_binheader_readf (psf, "E2", &n_channels) ; - n_channels = (n_channels & 0x0000FF00) >> 8 ; - psf_log_printf (psf, " Channels : %d\n", n_channels) ; - - psf_binheader_readf (psf, "E44", &psf->sf.samplerate, &frames) ; - psf->sf.frames = frames ; - psf_log_printf (psf, " Sample Rate : %d\n", psf->sf.samplerate) ; - psf_log_printf (psf, " Frames : %D\n", psf->sf.frames) ; - - psf_binheader_readf (psf, "E4", &length) ; - psf_log_printf (psf, " ??????????? : %d\n", length) ; - - psf_binheader_readf (psf, "E4", &length) ; - psf_log_printf (psf, " ??????????? : %d\n", length) ; - break ; - - case SDAT_MARKER: - psf_binheader_readf (psf, "E4", &length) ; - - sdat_length = length ; - - /* Get the current offset. */ - psf->dataoffset = psf_binheader_readf (psf, NULL) ; - - if (psf->dataoffset + length != psf->filelength) - psf_log_printf (psf, " %M : %d (should be %d)\n", marker, length, psf->dataoffset + psf->filelength) ; - else - psf_log_printf (psf, " %M : %d\n", marker, length) ; - break ; - - default : - psf_log_printf (psf, "Unknown marker : 0x%X %M", marker, marker) ; - return -1003 ; - break ; - } ; - - /* SDAT always last marker in file. */ - if (marker == SDAT_MARKER) - break ; - } ; - - puts (psf->parselog.buf) ; - puts ("-----------------------------------") ; - - printf ("SDAT length : %d\n", sdat_length) ; - printf ("SLCE count : %d\n", slce_count) ; - - /* Hack for zero slice count. */ - if (slce_count == 0 && slce_total == 1) - slce_total = frames ; - - printf ("SLCE samples : %d\n", slce_total) ; - - /* Two bytes per sample. */ - printf ("Comp Ratio : %f:1\n", (2.0 * slce_total * n_channels) / sdat_length) ; - - puts (" ") ; - - psf->parselog.buf [0] = 0 ; - - /* OK, have the header although not too sure what it all means. */ - - psf->endian = SF_ENDIAN_BIG ; - - psf->datalength = psf->filelength - psf->dataoffset ; - - if (psf_fseek (psf, psf->dataoffset, SEEK_SET)) - return SFE_BAD_SEEK ; - - psf->sf.format = (SF_FORMAT_REX2 | SF_FORMAT_DWVW_12) ; - - psf->sf.channels = 1 ; - psf->bytewidth = 2 ; - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - - if ((error = dwvw_init (psf, 16))) - return error ; - - psf->container_close = rx2_close ; - - if (! psf->sf.frames && psf->blockwidth) - psf->sf.frames = psf->datalength / psf->blockwidth ; - - /* All done. */ - - return 0 ; -} /* rx2_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -rx2_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE) - { /* Now we know for certain the length of the file we can re-write - ** correct values for the FORM, 8SVX and BODY chunks. - */ - - } ; - - return 0 ; -} /* rx2_close */ - -#endif diff --git a/libs/libsndfile/src/sd2.c b/libs/libsndfile/src/sd2.c deleted file mode 100644 index 6be150cd57..0000000000 --- a/libs/libsndfile/src/sd2.c +++ /dev/null @@ -1,654 +0,0 @@ -/* -** Copyright (C) 2001-2013 Erik de Castro Lopo -** Copyright (C) 2004 Paavo Jumppanen -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** The sd2 support implemented in this file was partially sponsored -** (financially) by Paavo Jumppanen. -*/ - -/* -** Documentation on the Mac resource fork was obtained here : -** http://developer.apple.com/documentation/mac/MoreToolbox/MoreToolbox-99.html -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*------------------------------------------------------------------------------ - * Markers. -*/ - -#define Sd2f_MARKER MAKE_MARKER ('S', 'd', '2', 'f') -#define Sd2a_MARKER MAKE_MARKER ('S', 'd', '2', 'a') -#define ALCH_MARKER MAKE_MARKER ('A', 'L', 'C', 'H') -#define lsf1_MARKER MAKE_MARKER ('l', 's', 'f', '1') - -#define STR_MARKER MAKE_MARKER ('S', 'T', 'R', ' ') -#define sdML_MARKER MAKE_MARKER ('s', 'd', 'M', 'L') - -enum -{ RSRC_STR = 111, - RSRC_BIN -} ; - -typedef struct -{ unsigned char * rsrc_data ; - int rsrc_len ; - int need_to_free_rsrc_data ; - - int data_offset, data_length ; - int map_offset, map_length ; - - int type_count, type_offset ; - int item_offset ; - - int str_index, str_count ; - - int string_offset ; - - /* All the above just to get these three. */ - int sample_size, sample_rate, channels ; -} SD2_RSRC ; - -typedef struct -{ int type ; - int id ; - char name [32] ; - char value [32] ; - int value_len ; -} STR_RSRC ; - -/*------------------------------------------------------------------------------ - * Private static functions. -*/ - -static int sd2_close (SF_PRIVATE *psf) ; - -static int sd2_parse_rsrc_fork (SF_PRIVATE *psf) ; -static int parse_str_rsrc (SF_PRIVATE *psf, SD2_RSRC * rsrc) ; - -static int sd2_write_rsrc_fork (SF_PRIVATE *psf, int calc_length) ; - -/*------------------------------------------------------------------------------ -** Public functions. -*/ - -int -sd2_open (SF_PRIVATE *psf) -{ int subformat, error = 0, valid ; - - /* SD2 is always big endian. */ - psf->endian = SF_ENDIAN_BIG ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->rsrclength > 0)) - { psf_use_rsrc (psf, SF_TRUE) ; - valid = psf_file_valid (psf) ; - psf_use_rsrc (psf, SF_FALSE) ; - if (! valid) - { psf_log_printf (psf, "sd2_open : psf->rsrc.filedes < 0\n") ; - return SFE_SD2_BAD_RSRC ; - } ; - - error = sd2_parse_rsrc_fork (psf) ; - - if (error) - goto error_cleanup ; - } ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_SD2) - { error = SFE_BAD_OPEN_FORMAT ; - goto error_cleanup ; - } ; - - subformat = SF_CODEC (psf->sf.format) ; - psf->dataoffset = 0 ; - - /* Only open and write the resource in RDWR mode is its current length is zero. */ - if (psf->file.mode == SFM_WRITE || (psf->file.mode == SFM_RDWR && psf->rsrclength == 0)) - { psf->rsrc.mode = psf->file.mode ; - psf_open_rsrc (psf) ; - - error = sd2_write_rsrc_fork (psf, SF_FALSE) ; - - if (error) - goto error_cleanup ; - - /* Not needed. */ - psf->write_header = NULL ; - } ; - - psf->container_close = sd2_close ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - switch (subformat) - { case SF_FORMAT_PCM_S8 : /* 8-bit linear PCM. */ - case SF_FORMAT_PCM_16 : /* 16-bit linear PCM. */ - case SF_FORMAT_PCM_24 : /* 24-bit linear PCM */ - case SF_FORMAT_PCM_32 : /* 32-bit linear PCM */ - error = pcm_init (psf) ; - break ; - - default : - error = SFE_UNIMPLEMENTED ; - break ; - } ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - -error_cleanup: - - /* Close the resource fork regardless. We won't need it again. */ - psf_close_rsrc (psf) ; - - return error ; -} /* sd2_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -sd2_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE) - { /* Now we know for certain the audio_length of the file we can re-write - ** correct values for the FORM, 8SVX and BODY chunks. - */ - - } ; - - return 0 ; -} /* sd2_close */ - -/*------------------------------------------------------------------------------ -*/ - -static inline void -write_char (unsigned char * data, int offset, char value) -{ data [offset] = value ; -} /* write_char */ - -static inline void -write_short (unsigned char * data, int offset, short value) -{ data [offset] = value >> 8 ; - data [offset + 1] = value ; -} /* write_char */ - -static inline void -write_int (unsigned char * data, int offset, int value) -{ data [offset] = value >> 24 ; - data [offset + 1] = value >> 16 ; - data [offset + 2] = value >> 8 ; - data [offset + 3] = value ; -} /* write_int */ - -static inline void -write_marker (unsigned char * data, int offset, int value) -{ - if (CPU_IS_BIG_ENDIAN) - { data [offset] = value >> 24 ; - data [offset + 1] = value >> 16 ; - data [offset + 2] = value >> 8 ; - data [offset + 3] = value ; - } - else - { data [offset] = value ; - data [offset + 1] = value >> 8 ; - data [offset + 2] = value >> 16 ; - data [offset + 3] = value >> 24 ; - } ; -} /* write_marker */ - -static void -write_str (unsigned char * data, int offset, const char * buffer, int buffer_len) -{ memcpy (data + offset, buffer, buffer_len) ; -} /* write_str */ - -static int -sd2_write_rsrc_fork (SF_PRIVATE *psf, int UNUSED (calc_length)) -{ SD2_RSRC rsrc ; - STR_RSRC str_rsrc [] = - { { RSRC_STR, 1000, "_sample-size", "", 0 }, - { RSRC_STR, 1001, "_sample-rate", "", 0 }, - { RSRC_STR, 1002, "_channels", "", 0 }, - { RSRC_BIN, 1000, "_Markers", "", 8 } - } ; - - int k, str_offset, data_offset, next_str ; - - psf_use_rsrc (psf, SF_TRUE) ; - - memset (&rsrc, 0, sizeof (rsrc)) ; - - rsrc.sample_rate = psf->sf.samplerate ; - rsrc.sample_size = psf->bytewidth ; - rsrc.channels = psf->sf.channels ; - - rsrc.rsrc_data = psf->header ; - rsrc.rsrc_len = sizeof (psf->header) ; - memset (rsrc.rsrc_data, 0xea, rsrc.rsrc_len) ; - - snprintf (str_rsrc [0].value, sizeof (str_rsrc [0].value), "_%d", rsrc.sample_size) ; - snprintf (str_rsrc [1].value, sizeof (str_rsrc [1].value), "_%d.000000", rsrc.sample_rate) ; - snprintf (str_rsrc [2].value, sizeof (str_rsrc [2].value), "_%d", rsrc.channels) ; - - for (k = 0 ; k < ARRAY_LEN (str_rsrc) ; k++) - { if (str_rsrc [k].value_len == 0) - { str_rsrc [k].value_len = strlen (str_rsrc [k].value) ; - str_rsrc [k].value [0] = str_rsrc [k].value_len - 1 ; - } ; - - /* Turn name string into a pascal string. */ - str_rsrc [k].name [0] = strlen (str_rsrc [k].name) - 1 ; - } ; - - rsrc.data_offset = 0x100 ; - - /* - ** Calculate data length : - ** length of strings, plus the length of the sdML chunk. - */ - rsrc.data_length = 0 ; - for (k = 0 ; k < ARRAY_LEN (str_rsrc) ; k++) - rsrc.data_length += str_rsrc [k].value_len + 4 ; - - rsrc.map_offset = rsrc.data_offset + rsrc.data_length ; - - /* Very start of resource fork. */ - write_int (rsrc.rsrc_data, 0, rsrc.data_offset) ; - write_int (rsrc.rsrc_data, 4, rsrc.map_offset) ; - write_int (rsrc.rsrc_data, 8, rsrc.data_length) ; - - write_char (rsrc.rsrc_data, 0x30, strlen (psf->file.name.c)) ; - write_str (rsrc.rsrc_data, 0x31, psf->file.name.c, strlen (psf->file.name.c)) ; - - write_short (rsrc.rsrc_data, 0x50, 0) ; - write_marker (rsrc.rsrc_data, 0x52, Sd2f_MARKER) ; - write_marker (rsrc.rsrc_data, 0x56, lsf1_MARKER) ; - - /* Very start of resource map. */ - write_int (rsrc.rsrc_data, rsrc.map_offset + 0, rsrc.data_offset) ; - write_int (rsrc.rsrc_data, rsrc.map_offset + 4, rsrc.map_offset) ; - write_int (rsrc.rsrc_data, rsrc.map_offset + 8, rsrc.data_length) ; - - /* These I don't currently understand. */ - if (1) - { write_char (rsrc.rsrc_data, rsrc.map_offset+ 16, 1) ; - /* Next resource map. */ - write_int (rsrc.rsrc_data, rsrc.map_offset + 17, 0x12345678) ; - /* File ref number. */ - write_short (rsrc.rsrc_data, rsrc.map_offset + 21, 0xabcd) ; - /* Fork attributes. */ - write_short (rsrc.rsrc_data, rsrc.map_offset + 23, 0) ; - } ; - - /* Resource type offset. */ - rsrc.type_offset = rsrc.map_offset + 30 ; - write_short (rsrc.rsrc_data, rsrc.map_offset + 24, rsrc.type_offset - rsrc.map_offset - 2) ; - - /* Type index max. */ - rsrc.type_count = 2 ; - write_short (rsrc.rsrc_data, rsrc.map_offset + 28, rsrc.type_count - 1) ; - - rsrc.item_offset = rsrc.type_offset + rsrc.type_count * 8 ; - - rsrc.str_count = ARRAY_LEN (str_rsrc) ; - rsrc.string_offset = rsrc.item_offset + (rsrc.str_count + 1) * 12 - rsrc.map_offset ; - write_short (rsrc.rsrc_data, rsrc.map_offset + 26, rsrc.string_offset) ; - - /* Write 'STR ' resource type. */ - rsrc.str_count = 3 ; - write_marker (rsrc.rsrc_data, rsrc.type_offset, STR_MARKER) ; - write_short (rsrc.rsrc_data, rsrc.type_offset + 4, rsrc.str_count - 1) ; - write_short (rsrc.rsrc_data, rsrc.type_offset + 6, 0x12) ; - - /* Write 'sdML' resource type. */ - write_marker (rsrc.rsrc_data, rsrc.type_offset + 8, sdML_MARKER) ; - write_short (rsrc.rsrc_data, rsrc.type_offset + 12, 0) ; - write_short (rsrc.rsrc_data, rsrc.type_offset + 14, 0x36) ; - - str_offset = rsrc.map_offset + rsrc.string_offset ; - next_str = 0 ; - data_offset = rsrc.data_offset ; - for (k = 0 ; k < ARRAY_LEN (str_rsrc) ; k++) - { write_str (rsrc.rsrc_data, str_offset, str_rsrc [k].name, strlen (str_rsrc [k].name)) ; - - write_short (rsrc.rsrc_data, rsrc.item_offset + k * 12, str_rsrc [k].id) ; - write_short (rsrc.rsrc_data, rsrc.item_offset + k * 12 + 2, next_str) ; - - str_offset += strlen (str_rsrc [k].name) ; - next_str += strlen (str_rsrc [k].name) ; - - write_int (rsrc.rsrc_data, rsrc.item_offset + k * 12 + 4, data_offset - rsrc.data_offset) ; - - write_int (rsrc.rsrc_data, data_offset, str_rsrc [k].value_len) ; - write_str (rsrc.rsrc_data, data_offset + 4, str_rsrc [k].value, str_rsrc [k].value_len) ; - data_offset += 4 + str_rsrc [k].value_len ; - } ; - - /* Finally, calculate and set map length. */ - rsrc.map_length = str_offset - rsrc.map_offset ; - write_int (rsrc.rsrc_data, 12, rsrc.map_length) ; - write_int (rsrc.rsrc_data, rsrc.map_offset + 12, rsrc.map_length) ; - - rsrc.rsrc_len = rsrc.map_offset + rsrc.map_length ; - - psf_fwrite (rsrc.rsrc_data, rsrc.rsrc_len, 1, psf) ; - - psf_use_rsrc (psf, SF_FALSE) ; - - if (psf->error) - return psf->error ; - - return 0 ; -} /* sd2_write_rsrc_fork */ - -/*------------------------------------------------------------------------------ -*/ - -static inline int -read_rsrc_char (const SD2_RSRC *prsrc, int offset) -{ const unsigned char * data = prsrc->rsrc_data ; - if (offset < 0 || offset >= prsrc->rsrc_len) - return 0 ; - return data [offset] ; -} /* read_rsrc_char */ - -static inline int -read_rsrc_short (const SD2_RSRC *prsrc, int offset) -{ const unsigned char * data = prsrc->rsrc_data ; - if (offset < 0 || offset + 1 >= prsrc->rsrc_len) - return 0 ; - return (data [offset] << 8) + data [offset + 1] ; -} /* read_rsrc_short */ - -static inline int -read_rsrc_int (const SD2_RSRC *prsrc, int offset) -{ const unsigned char * data = prsrc->rsrc_data ; - if (offset < 0 || offset + 3 >= prsrc->rsrc_len) - return 0 ; - return (data [offset] << 24) + (data [offset + 1] << 16) + (data [offset + 2] << 8) + data [offset + 3] ; -} /* read_rsrc_int */ - -static inline int -read_rsrc_marker (const SD2_RSRC *prsrc, int offset) -{ const unsigned char * data = prsrc->rsrc_data ; - - if (offset < 0 || offset + 3 >= prsrc->rsrc_len) - return 0 ; - - if (CPU_IS_BIG_ENDIAN) - return (data [offset] << 24) + (data [offset + 1] << 16) + (data [offset + 2] << 8) + data [offset + 3] ; - if (CPU_IS_LITTLE_ENDIAN) - return data [offset] + (data [offset + 1] << 8) + (data [offset + 2] << 16) + (data [offset + 3] << 24) ; - - return 0 ; -} /* read_rsrc_marker */ - -static void -read_rsrc_str (const SD2_RSRC *prsrc, int offset, char * buffer, int buffer_len) -{ const unsigned char * data = prsrc->rsrc_data ; - int k ; - - memset (buffer, 0, buffer_len) ; - - if (offset < 0 || offset + buffer_len >= prsrc->rsrc_len) - return ; - - for (k = 0 ; k < buffer_len - 1 ; k++) - { if (psf_isprint (data [offset + k]) == 0) - return ; - buffer [k] = data [offset + k] ; - } ; - return ; -} /* read_rsrc_str */ - -static int -sd2_parse_rsrc_fork (SF_PRIVATE *psf) -{ SD2_RSRC rsrc ; - int k, marker, error = 0 ; - - psf_use_rsrc (psf, SF_TRUE) ; - - memset (&rsrc, 0, sizeof (rsrc)) ; - - rsrc.rsrc_len = psf_get_filelen (psf) ; - psf_log_printf (psf, "Resource length : %d (0x%04X)\n", rsrc.rsrc_len, rsrc.rsrc_len) ; - - if (rsrc.rsrc_len > SIGNED_SIZEOF (psf->header)) - { rsrc.rsrc_data = calloc (1, rsrc.rsrc_len) ; - rsrc.need_to_free_rsrc_data = SF_TRUE ; - } - else - rsrc.rsrc_data = psf->header ; - - /* Read in the whole lot. */ - psf_fread (rsrc.rsrc_data, rsrc.rsrc_len, 1, psf) ; - - /* Reset the header storage because we have changed to the rsrcdes. */ - psf->headindex = psf->headend = rsrc.rsrc_len ; - - rsrc.data_offset = read_rsrc_int (&rsrc, 0) ; - rsrc.map_offset = read_rsrc_int (&rsrc, 4) ; - rsrc.data_length = read_rsrc_int (&rsrc, 8) ; - rsrc.map_length = read_rsrc_int (&rsrc, 12) ; - - if (rsrc.data_offset == 0x51607 && rsrc.map_offset == 0x20000) - { psf_log_printf (psf, "Trying offset of 0x52 bytes.\n") ; - rsrc.data_offset = read_rsrc_int (&rsrc, 0x52 + 0) + 0x52 ; - rsrc.map_offset = read_rsrc_int (&rsrc, 0x52 + 4) + 0x52 ; - rsrc.data_length = read_rsrc_int (&rsrc, 0x52 + 8) ; - rsrc.map_length = read_rsrc_int (&rsrc, 0x52 + 12) ; - } ; - - psf_log_printf (psf, " data offset : 0x%04X\n map offset : 0x%04X\n" - " data length : 0x%04X\n map length : 0x%04X\n", - rsrc.data_offset, rsrc.map_offset, rsrc.data_length, rsrc.map_length) ; - - if (rsrc.data_offset > rsrc.rsrc_len) - { psf_log_printf (psf, "Error : rsrc.data_offset (%d, 0x%x) > len\n", rsrc.data_offset, rsrc.data_offset) ; - error = SFE_SD2_BAD_DATA_OFFSET ; - goto parse_rsrc_fork_cleanup ; - } ; - - if (rsrc.map_offset > rsrc.rsrc_len) - { psf_log_printf (psf, "Error : rsrc.map_offset > len\n") ; - error = SFE_SD2_BAD_MAP_OFFSET ; - goto parse_rsrc_fork_cleanup ; - } ; - - if (rsrc.data_length > rsrc.rsrc_len) - { psf_log_printf (psf, "Error : rsrc.data_length > len\n") ; - error = SFE_SD2_BAD_DATA_LENGTH ; - goto parse_rsrc_fork_cleanup ; - } ; - - if (rsrc.map_length > rsrc.rsrc_len) - { psf_log_printf (psf, "Error : rsrc.map_length > len\n") ; - error = SFE_SD2_BAD_MAP_LENGTH ; - goto parse_rsrc_fork_cleanup ; - } ; - - if (rsrc.data_offset + rsrc.data_length != rsrc.map_offset || rsrc.map_offset + rsrc.map_length != rsrc.rsrc_len) - { psf_log_printf (psf, "Error : This does not look like a MacOSX resource fork.\n") ; - error = SFE_SD2_BAD_RSRC ; - goto parse_rsrc_fork_cleanup ; - } ; - - if (rsrc.map_offset + 28 >= rsrc.rsrc_len) - { psf_log_printf (psf, "Bad map offset (%d + 28 > %d).\n", rsrc.map_offset, rsrc.rsrc_len) ; - error = SFE_SD2_BAD_RSRC ; - goto parse_rsrc_fork_cleanup ; - } ; - - rsrc.string_offset = rsrc.map_offset + read_rsrc_short (&rsrc, rsrc.map_offset + 26) ; - if (rsrc.string_offset > rsrc.rsrc_len) - { psf_log_printf (psf, "Bad string offset (%d).\n", rsrc.string_offset) ; - error = SFE_SD2_BAD_RSRC ; - goto parse_rsrc_fork_cleanup ; - } ; - - rsrc.type_offset = rsrc.map_offset + 30 ; - - rsrc.type_count = read_rsrc_short (&rsrc, rsrc.map_offset + 28) + 1 ; - if (rsrc.type_count < 1) - { psf_log_printf (psf, "Bad type count.\n") ; - error = SFE_SD2_BAD_RSRC ; - goto parse_rsrc_fork_cleanup ; - } ; - - rsrc.item_offset = rsrc.type_offset + rsrc.type_count * 8 ; - if (rsrc.item_offset < 0 || rsrc.item_offset > rsrc.rsrc_len) - { psf_log_printf (psf, "Bad item offset (%d).\n", rsrc.item_offset) ; - error = SFE_SD2_BAD_RSRC ; - goto parse_rsrc_fork_cleanup ; - } ; - - rsrc.str_index = -1 ; - for (k = 0 ; k < rsrc.type_count ; k ++) - { marker = read_rsrc_marker (&rsrc, rsrc.type_offset + k * 8) ; - - if (marker == STR_MARKER) - { rsrc.str_index = k ; - rsrc.str_count = read_rsrc_short (&rsrc, rsrc.type_offset + k * 8 + 4) + 1 ; - error = parse_str_rsrc (psf, &rsrc) ; - goto parse_rsrc_fork_cleanup ; - } ; - } ; - - psf_log_printf (psf, "No 'STR ' resource.\n") ; - error = SFE_SD2_BAD_RSRC ; - -parse_rsrc_fork_cleanup : - - psf_use_rsrc (psf, SF_FALSE) ; - - if (rsrc.need_to_free_rsrc_data) - free (rsrc.rsrc_data) ; - - return error ; -} /* sd2_parse_rsrc_fork */ - -static int -parse_str_rsrc (SF_PRIVATE *psf, SD2_RSRC * rsrc) -{ char name [32], value [32] ; - int k, str_offset, rsrc_id, data_offset = 0, data_len = 0 ; - - psf_log_printf (psf, "Finding parameters :\n") ; - - str_offset = rsrc->string_offset ; - psf_log_printf (psf, " Offset RsrcId dlen slen Value\n") ; - - for (k = 0 ; data_offset + data_len < rsrc->rsrc_len ; k++) - { int slen ; - - slen = read_rsrc_char (rsrc, str_offset) ; - read_rsrc_str (rsrc, str_offset + 1, name, SF_MIN (SIGNED_SIZEOF (name), slen + 1)) ; - str_offset += slen + 1 ; - - rsrc_id = read_rsrc_short (rsrc, rsrc->item_offset + k * 12) ; - - data_offset = rsrc->data_offset + read_rsrc_int (rsrc, rsrc->item_offset + k * 12 + 4) ; - if (data_offset < 0 || data_offset > rsrc->rsrc_len) - { psf_log_printf (psf, "Exiting parser on data offset of %d.\n", data_offset) ; - break ; - } ; - - data_len = read_rsrc_int (rsrc, data_offset) ; - if (data_len < 0 || data_len > rsrc->rsrc_len) - { psf_log_printf (psf, "Exiting parser on data length of %d.\n", data_len) ; - break ; - } ; - - slen = read_rsrc_char (rsrc, data_offset + 4) ; - read_rsrc_str (rsrc, data_offset + 5, value, SF_MIN (SIGNED_SIZEOF (value), slen + 1)) ; - - psf_log_printf (psf, " 0x%04x %4d %4d %3d '%s'\n", data_offset, rsrc_id, data_len, slen, value) ; - - if (rsrc_id == 1000 && rsrc->sample_size == 0) - rsrc->sample_size = strtol (value, NULL, 10) ; - else if (rsrc_id == 1001 && rsrc->sample_rate == 0) - rsrc->sample_rate = strtol (value, NULL, 10) ; - else if (rsrc_id == 1002 && rsrc->channels == 0) - rsrc->channels = strtol (value, NULL, 10) ; - } ; - - psf_log_printf (psf, "Found Parameters :\n") ; - psf_log_printf (psf, " sample-size : %d\n", rsrc->sample_size) ; - psf_log_printf (psf, " sample-rate : %d\n", rsrc->sample_rate) ; - psf_log_printf (psf, " channels : %d\n", rsrc->channels) ; - - if (rsrc->sample_rate <= 4 && rsrc->sample_size > 4) - { int temp ; - - psf_log_printf (psf, "Geez!! Looks like sample rate and sample size got switched.\nCorrecting this screw up.\n") ; - temp = rsrc->sample_rate ; - rsrc->sample_rate = rsrc->sample_size ; - rsrc->sample_size = temp ; - } ; - - if (rsrc->sample_rate < 0) - { psf_log_printf (psf, "Bad sample rate (%d)\n", rsrc->sample_rate) ; - return SFE_SD2_BAD_RSRC ; - } ; - - if (rsrc->channels < 0) - { psf_log_printf (psf, "Bad channel count (%d)\n", rsrc->channels) ; - return SFE_SD2_BAD_RSRC ; - } ; - - psf->sf.samplerate = rsrc->sample_rate ; - psf->sf.channels = rsrc->channels ; - psf->bytewidth = rsrc->sample_size ; - - switch (rsrc->sample_size) - { case 1 : - psf->sf.format = SF_FORMAT_SD2 | SF_FORMAT_PCM_S8 ; - break ; - - case 2 : - psf->sf.format = SF_FORMAT_SD2 | SF_FORMAT_PCM_16 ; - break ; - - case 3 : - psf->sf.format = SF_FORMAT_SD2 | SF_FORMAT_PCM_24 ; - break ; - - case 4 : - psf->sf.format = SF_FORMAT_SD2 | SF_FORMAT_PCM_32 ; - break ; - - default : - psf_log_printf (psf, "Bad sample size (%d)\n", rsrc->sample_size) ; - return SFE_SD2_BAD_SAMPLE_SIZE ; - } ; - - psf_log_printf (psf, "ok\n") ; - - return 0 ; -} /* parse_str_rsrc */ - diff --git a/libs/libsndfile/src/sds.c b/libs/libsndfile/src/sds.c deleted file mode 100644 index 7dd1d9d27e..0000000000 --- a/libs/libsndfile/src/sds.c +++ /dev/null @@ -1,1022 +0,0 @@ -/* -** Copyright (C) 2002-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*------------------------------------------------------------------------------ -*/ - -#define SDS_DATA_OFFSET 0x15 -#define SDS_BLOCK_SIZE 127 - -#define SDS_AUDIO_BYTES_PER_BLOCK 120 - -#define SDS_3BYTE_TO_INT_DECODE(x) (((x) & 0x7F) | (((x) & 0x7F00) >> 1) | (((x) & 0x7F0000) >> 2)) -#define SDS_INT_TO_3BYTE_ENCODE(x) (((x) & 0x7F) | (((x) << 1) & 0x7F00) | (((x) << 2) & 0x7F0000)) - -/*------------------------------------------------------------------------------ -** Typedefs. -*/ - -typedef struct tag_SDS_PRIVATE -{ int bitwidth, frames ; - int samplesperblock, total_blocks ; - - int (*reader) (SF_PRIVATE *psf, struct tag_SDS_PRIVATE *psds) ; - int (*writer) (SF_PRIVATE *psf, struct tag_SDS_PRIVATE *psds) ; - - int read_block, read_count ; - unsigned char read_data [SDS_BLOCK_SIZE] ; - int read_samples [SDS_BLOCK_SIZE / 2] ; /* Maximum samples per block */ - - int write_block, write_count ; - int total_written ; - unsigned char write_data [SDS_BLOCK_SIZE] ; - int write_samples [SDS_BLOCK_SIZE / 2] ; /* Maximum samples per block */ -} SDS_PRIVATE ; - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int sds_close (SF_PRIVATE *psf) ; - -static int sds_write_header (SF_PRIVATE *psf, int calc_length) ; -static int sds_read_header (SF_PRIVATE *psf, SDS_PRIVATE *psds) ; - -static int sds_init (SF_PRIVATE *psf, SDS_PRIVATE *psds) ; - -static sf_count_t sds_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t sds_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t sds_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t sds_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t sds_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t sds_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t sds_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t sds_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static sf_count_t sds_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; -static int sds_byterate (SF_PRIVATE * psf) ; - -static int sds_2byte_read (SF_PRIVATE *psf, SDS_PRIVATE *psds) ; -static int sds_3byte_read (SF_PRIVATE *psf, SDS_PRIVATE *psds) ; -static int sds_4byte_read (SF_PRIVATE *psf, SDS_PRIVATE *psds) ; - -static int sds_read (SF_PRIVATE *psf, SDS_PRIVATE *psds, int *iptr, int readcount) ; - -static int sds_2byte_write (SF_PRIVATE *psf, SDS_PRIVATE *psds) ; -static int sds_3byte_write (SF_PRIVATE *psf, SDS_PRIVATE *psds) ; -static int sds_4byte_write (SF_PRIVATE *psf, SDS_PRIVATE *psds) ; - -static int sds_write (SF_PRIVATE *psf, SDS_PRIVATE *psds, const int *iptr, int writecount) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -sds_open (SF_PRIVATE *psf) -{ SDS_PRIVATE *psds ; - int error = 0 ; - - /* Hmmmm, need this here to pass update_header_test. */ - psf->sf.frames = 0 ; - - if (! (psds = calloc (1, sizeof (SDS_PRIVATE)))) - return SFE_MALLOC_FAILED ; - psf->codec_data = psds ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = sds_read_header (psf, psds))) - return error ; - } ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_SDS) - return SFE_BAD_OPEN_FORMAT ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (sds_write_header (psf, SF_FALSE)) - return psf->error ; - - psf->write_header = sds_write_header ; - - psf_fseek (psf, SDS_DATA_OFFSET, SEEK_SET) ; - } ; - - if ((error = sds_init (psf, psds)) != 0) - return error ; - - psf->container_close = sds_close ; - psf->seek = sds_seek ; - psf->byterate = sds_byterate ; - - psf->blockwidth = 0 ; - - return error ; -} /* sds_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -sds_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { SDS_PRIVATE *psds ; - - if ((psds = (SDS_PRIVATE *) psf->codec_data) == NULL) - { psf_log_printf (psf, "*** Bad psf->codec_data ptr.\n") ; - return SFE_INTERNAL ; - } ; - - if (psds->write_count > 0) - { memset (&(psds->write_data [psds->write_count]), 0, (psds->samplesperblock - psds->write_count) * sizeof (int)) ; - psds->writer (psf, psds) ; - } ; - - sds_write_header (psf, SF_TRUE) ; - } ; - - return 0 ; -} /* sds_close */ - -static int -sds_init (SF_PRIVATE *psf, SDS_PRIVATE *psds) -{ - if (psds->bitwidth < 8 || psds->bitwidth > 28) - return (psf->error = SFE_SDS_BAD_BIT_WIDTH) ; - - if (psds->bitwidth < 14) - { psds->reader = sds_2byte_read ; - psds->writer = sds_2byte_write ; - psds->samplesperblock = SDS_AUDIO_BYTES_PER_BLOCK / 2 ; - } - else if (psds->bitwidth < 21) - { psds->reader = sds_3byte_read ; - psds->writer = sds_3byte_write ; - psds->samplesperblock = SDS_AUDIO_BYTES_PER_BLOCK / 3 ; - } - else - { psds->reader = sds_4byte_read ; - psds->writer = sds_4byte_write ; - psds->samplesperblock = SDS_AUDIO_BYTES_PER_BLOCK / 4 ; - } ; - - if (psf->file.mode == SFM_READ || psf->file.mode == SFM_RDWR) - { psf->read_short = sds_read_s ; - psf->read_int = sds_read_i ; - psf->read_float = sds_read_f ; - psf->read_double = sds_read_d ; - - /* Read first block. */ - psds->reader (psf, psds) ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { psf->write_short = sds_write_s ; - psf->write_int = sds_write_i ; - psf->write_float = sds_write_f ; - psf->write_double = sds_write_d ; - } ; - - return 0 ; -} /* sds_init */ - -static int -sds_read_header (SF_PRIVATE *psf, SDS_PRIVATE *psds) -{ unsigned char channel, bitwidth, loop_type, byte ; - unsigned short sample_no, marker ; - unsigned int samp_period, data_length, sustain_loop_start, sustain_loop_end ; - int bytesread, blockcount ; - - /* Set position to start of file to begin reading header. */ - bytesread = psf_binheader_readf (psf, "pE211", 0, &marker, &channel, &byte) ; - - if (marker != 0xF07E || byte != 0x01) - return SFE_SDS_NOT_SDS ; - - bytesread += psf_binheader_readf (psf, "e2", &sample_no) ; - sample_no = SDS_3BYTE_TO_INT_DECODE (sample_no) ; - - psf_log_printf (psf, "Midi Sample Dump Standard (.sds)\nF07E\n" - " Midi Channel : %d\n Sample Number : %d\n", - channel, sample_no) ; - - bytesread += psf_binheader_readf (psf, "e13", &bitwidth, &samp_period) ; - - samp_period = SDS_3BYTE_TO_INT_DECODE (samp_period) ; - - psds->bitwidth = bitwidth ; - - if (psds->bitwidth > 1) - psf_log_printf (psf, " Bit Width : %d\n", psds->bitwidth) ; - else - { psf_log_printf (psf, " Bit Width : %d (should be > 1)\n", psds->bitwidth) ; - return SFE_SDS_BAD_BIT_WIDTH ; - } ; - - if (samp_period > 0) - { psf->sf.samplerate = 1000000000 / samp_period ; - - psf_log_printf (psf, " Sample Period : %d\n" - " Sample Rate : %d\n", - samp_period, psf->sf.samplerate) ; - } - else - { psf->sf.samplerate = 16000 ; - - psf_log_printf (psf, " Sample Period : %d (should be > 0)\n" - " Sample Rate : %d (guessed)\n", - samp_period, psf->sf.samplerate) ; - } ; - - bytesread += psf_binheader_readf (psf, "e3331", &data_length, &sustain_loop_start, &sustain_loop_end, &loop_type) ; - - data_length = SDS_3BYTE_TO_INT_DECODE (data_length) ; - - psf->sf.frames = psds->frames = data_length ; - - sustain_loop_start = SDS_3BYTE_TO_INT_DECODE (sustain_loop_start) ; - sustain_loop_end = SDS_3BYTE_TO_INT_DECODE (sustain_loop_end) ; - - psf_log_printf (psf, " Sustain Loop\n" - " Start : %d\n" - " End : %d\n" - " Loop Type : %d\n", - sustain_loop_start, sustain_loop_end, loop_type) ; - - psf->dataoffset = SDS_DATA_OFFSET ; - psf->datalength = psf->filelength - psf->dataoffset ; - - bytesread += psf_binheader_readf (psf, "1", &byte) ; - if (byte != 0xF7) - psf_log_printf (psf, "bad end : %X\n", byte & 0xFF) ; - - for (blockcount = 0 ; bytesread < psf->filelength ; blockcount++) - { - bytesread += psf_fread (&marker, 1, 2, psf) ; - - if (marker == 0) - break ; - - psf_fseek (psf, SDS_BLOCK_SIZE - 2, SEEK_CUR) ; - bytesread += SDS_BLOCK_SIZE - 2 ; - } ; - - psf_log_printf (psf, "\nBlocks : %d\n", blockcount) ; - psds->total_blocks = blockcount ; - - psds->samplesperblock = SDS_AUDIO_BYTES_PER_BLOCK / ((psds->bitwidth + 6) / 7) ; - psf_log_printf (psf, "Samples/Block : %d\n", psds->samplesperblock) ; - - psf_log_printf (psf, "Frames : %d\n", blockcount * psds->samplesperblock) ; - - /* Always Mono */ - psf->sf.channels = 1 ; - psf->sf.sections = 1 ; - - /* - ** Lie to the user about PCM bit width. Always round up to - ** the next multiple of 8. - */ - switch ((psds->bitwidth + 7) / 8) - { case 1 : - psf->sf.format = SF_FORMAT_SDS | SF_FORMAT_PCM_S8 ; - break ; - - case 2 : - psf->sf.format = SF_FORMAT_SDS | SF_FORMAT_PCM_16 ; - break ; - - case 3 : - psf->sf.format = SF_FORMAT_SDS | SF_FORMAT_PCM_24 ; - break ; - - case 4 : - psf->sf.format = SF_FORMAT_SDS | SF_FORMAT_PCM_32 ; - break ; - - default : - psf_log_printf (psf, "*** Weird byte width (%d)\n", (psds->bitwidth + 7) / 8) ; - return SFE_SDS_BAD_BIT_WIDTH ; - } ; - - psf_fseek (psf, SDS_DATA_OFFSET, SEEK_SET) ; - - return 0 ; -} /* sds_read_header */ - -static int -sds_write_header (SF_PRIVATE *psf, int calc_length) -{ SDS_PRIVATE *psds ; - sf_count_t current ; - int samp_period, data_length, sustain_loop_start, sustain_loop_end ; - unsigned char loop_type = 0 ; - - if ((psds = (SDS_PRIVATE *) psf->codec_data) == NULL) - { psf_log_printf (psf, "*** Bad psf->codec_data ptr.\n") ; - return SFE_INTERNAL ; - } ; - - if (psf->pipeoffset > 0) - return 0 ; - - current = psf_ftell (psf) ; - - if (calc_length) - psf->sf.frames = psds->total_written ; - - if (psds->write_count > 0) - { int current_count = psds->write_count ; - int current_block = psds->write_block ; - - psds->writer (psf, psds) ; - - psf_fseek (psf, -1 * SDS_BLOCK_SIZE, SEEK_CUR) ; - - psds->write_count = current_count ; - psds->write_block = current_block ; - } ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - - if (psf->is_pipe == SF_FALSE) - psf_fseek (psf, 0, SEEK_SET) ; - - psf_binheader_writef (psf, "E211", 0xF07E, 0, 1) ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - psds->bitwidth = 8 ; - break ; - case SF_FORMAT_PCM_16 : - psds->bitwidth = 16 ; - break ; - case SF_FORMAT_PCM_24 : - psds->bitwidth = 24 ; - break ; - default: - return SFE_SDS_BAD_BIT_WIDTH ; - } ; - - samp_period = SDS_INT_TO_3BYTE_ENCODE (1000000000 / psf->sf.samplerate) ; - - psf_binheader_writef (psf, "e213", 0, psds->bitwidth, samp_period) ; - - data_length = SDS_INT_TO_3BYTE_ENCODE (psds->total_written) ; - sustain_loop_start = SDS_INT_TO_3BYTE_ENCODE (0) ; - sustain_loop_end = SDS_INT_TO_3BYTE_ENCODE (0) ; - - psf_binheader_writef (psf, "e33311", data_length, sustain_loop_start, sustain_loop_end, loop_type, 0xF7) ; - - /* Header construction complete so write it out. */ - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - psf->datalength = psds->write_block * SDS_BLOCK_SIZE ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* sds_write_header */ - - -/*------------------------------------------------------------------------------ -*/ - -static int -sds_2byte_read (SF_PRIVATE *psf, SDS_PRIVATE *psds) -{ unsigned char *ucptr, checksum ; - unsigned int sample ; - int k ; - - psds->read_block ++ ; - psds->read_count = 0 ; - - if (psds->read_block * psds->samplesperblock > psds->frames) - { memset (psds->read_samples, 0, psds->samplesperblock * sizeof (int)) ; - return 1 ; - } ; - - if ((k = psf_fread (psds->read_data, 1, SDS_BLOCK_SIZE, psf)) != SDS_BLOCK_SIZE) - psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, SDS_BLOCK_SIZE) ; - - if (psds->read_data [0] != 0xF0) - { printf ("Error A : %02X\n", psds->read_data [0] & 0xFF) ; - } ; - - checksum = psds->read_data [1] ; - if (checksum != 0x7E) - { printf ("Error 1 : %02X\n", checksum & 0xFF) ; - } - - for (k = 2 ; k <= SDS_BLOCK_SIZE - 3 ; k ++) - checksum ^= psds->read_data [k] ; - - checksum &= 0x7F ; - - if (checksum != psds->read_data [SDS_BLOCK_SIZE - 2]) - { psf_log_printf (psf, "Block %d : checksum is %02X should be %02X\n", psds->read_data [4], checksum, psds->read_data [SDS_BLOCK_SIZE - 2]) ; - } ; - - ucptr = psds->read_data + 5 ; - for (k = 0 ; k < 120 ; k += 2) - { sample = (ucptr [k] << 25) + (ucptr [k + 1] << 18) ; - psds->read_samples [k / 2] = (int) (sample - 0x80000000) ; - } ; - - return 1 ; -} /* sds_2byte_read */ - -static int -sds_3byte_read (SF_PRIVATE *psf, SDS_PRIVATE *psds) -{ unsigned char *ucptr, checksum ; - unsigned int sample ; - int k ; - - psds->read_block ++ ; - psds->read_count = 0 ; - - if (psds->read_block * psds->samplesperblock > psds->frames) - { memset (psds->read_samples, 0, psds->samplesperblock * sizeof (int)) ; - return 1 ; - } ; - - if ((k = psf_fread (psds->read_data, 1, SDS_BLOCK_SIZE, psf)) != SDS_BLOCK_SIZE) - psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, SDS_BLOCK_SIZE) ; - - if (psds->read_data [0] != 0xF0) - { printf ("Error A : %02X\n", psds->read_data [0] & 0xFF) ; - } ; - - checksum = psds->read_data [1] ; - if (checksum != 0x7E) - { printf ("Error 1 : %02X\n", checksum & 0xFF) ; - } - - for (k = 2 ; k <= SDS_BLOCK_SIZE - 3 ; k ++) - checksum ^= psds->read_data [k] ; - - checksum &= 0x7F ; - - if (checksum != psds->read_data [SDS_BLOCK_SIZE - 2]) - { psf_log_printf (psf, "Block %d : checksum is %02X should be %02X\n", psds->read_data [4], checksum, psds->read_data [SDS_BLOCK_SIZE - 2]) ; - } ; - - ucptr = psds->read_data + 5 ; - for (k = 0 ; k < 120 ; k += 3) - { sample = (ucptr [k] << 25) + (ucptr [k + 1] << 18) + (ucptr [k + 2] << 11) ; - psds->read_samples [k / 3] = (int) (sample - 0x80000000) ; - } ; - - return 1 ; -} /* sds_3byte_read */ - -static int -sds_4byte_read (SF_PRIVATE *psf, SDS_PRIVATE *psds) -{ unsigned char *ucptr, checksum ; - unsigned int sample ; - int k ; - - psds->read_block ++ ; - psds->read_count = 0 ; - - if (psds->read_block * psds->samplesperblock > psds->frames) - { memset (psds->read_samples, 0, psds->samplesperblock * sizeof (int)) ; - return 1 ; - } ; - - if ((k = psf_fread (psds->read_data, 1, SDS_BLOCK_SIZE, psf)) != SDS_BLOCK_SIZE) - psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, SDS_BLOCK_SIZE) ; - - if (psds->read_data [0] != 0xF0) - { printf ("Error A : %02X\n", psds->read_data [0] & 0xFF) ; - } ; - - checksum = psds->read_data [1] ; - if (checksum != 0x7E) - { printf ("Error 1 : %02X\n", checksum & 0xFF) ; - } - - for (k = 2 ; k <= SDS_BLOCK_SIZE - 3 ; k ++) - checksum ^= psds->read_data [k] ; - - checksum &= 0x7F ; - - if (checksum != psds->read_data [SDS_BLOCK_SIZE - 2]) - { psf_log_printf (psf, "Block %d : checksum is %02X should be %02X\n", psds->read_data [4], checksum, psds->read_data [SDS_BLOCK_SIZE - 2]) ; - } ; - - ucptr = psds->read_data + 5 ; - for (k = 0 ; k < 120 ; k += 4) - { sample = (ucptr [k] << 25) + (ucptr [k + 1] << 18) + (ucptr [k + 2] << 11) + (ucptr [k + 3] << 4) ; - psds->read_samples [k / 4] = (int) (sample - 0x80000000) ; - } ; - - return 1 ; -} /* sds_4byte_read */ - - -static sf_count_t -sds_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - SDS_PRIVATE *psds ; - int *iptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - psds = (SDS_PRIVATE*) psf->codec_data ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = sds_read (psf, psds, iptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = iptr [k] >> 16 ; - total += count ; - len -= readcount ; - } ; - - return total ; -} /* sds_read_s */ - -static sf_count_t -sds_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ SDS_PRIVATE *psds ; - int total ; - - if (psf->codec_data == NULL) - return 0 ; - psds = (SDS_PRIVATE*) psf->codec_data ; - - total = sds_read (psf, psds, ptr, len) ; - - return total ; -} /* sds_read_i */ - -static sf_count_t -sds_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - SDS_PRIVATE *psds ; - int *iptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - float normfact ; - - if (psf->codec_data == NULL) - return 0 ; - psds = (SDS_PRIVATE*) psf->codec_data ; - - if (psf->norm_float == SF_TRUE) - normfact = 1.0 / 0x80000000 ; - else - normfact = 1.0 / (1 << psds->bitwidth) ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = sds_read (psf, psds, iptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * iptr [k] ; - total += count ; - len -= readcount ; - } ; - - return total ; -} /* sds_read_f */ - -static sf_count_t -sds_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - SDS_PRIVATE *psds ; - int *iptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - double normfact ; - - if (psf->codec_data == NULL) - return 0 ; - psds = (SDS_PRIVATE*) psf->codec_data ; - - if (psf->norm_double == SF_TRUE) - normfact = 1.0 / 0x80000000 ; - else - normfact = 1.0 / (1 << psds->bitwidth) ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = sds_read (psf, psds, iptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * iptr [k] ; - total += count ; - len -= readcount ; - } ; - - return total ; -} /* sds_read_d */ - -static int -sds_read (SF_PRIVATE *psf, SDS_PRIVATE *psds, int *ptr, int len) -{ int count, total = 0 ; - - while (total < len) - { if (psds->read_block * psds->samplesperblock >= psds->frames) - { memset (&(ptr [total]), 0, (len - total) * sizeof (int)) ; - return total ; - } ; - - if (psds->read_count >= psds->samplesperblock) - psds->reader (psf, psds) ; - - count = (psds->samplesperblock - psds->read_count) ; - count = (len - total > count) ? count : len - total ; - - memcpy (&(ptr [total]), &(psds->read_samples [psds->read_count]), count * sizeof (int)) ; - total += count ; - psds->read_count += count ; - } ; - - return total ; -} /* sds_read */ - -/*============================================================================== -*/ - -static sf_count_t -sds_seek (SF_PRIVATE *psf, int mode, sf_count_t seek_from_start) -{ SDS_PRIVATE *psds ; - sf_count_t file_offset ; - int newblock, newsample ; - - if ((psds = psf->codec_data) == NULL) - { psf->error = SFE_INTERNAL ; - return PSF_SEEK_ERROR ; - } ; - - if (psf->datalength < 0 || psf->dataoffset < 0) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - if (seek_from_start < 0 || seek_from_start > psf->sf.frames) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - if (mode == SFM_READ && psds->write_count > 0) - psds->writer (psf, psds) ; - - newblock = seek_from_start / psds->samplesperblock ; - newsample = seek_from_start % psds->samplesperblock ; - - switch (mode) - { case SFM_READ : - if (newblock > psds->total_blocks) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - file_offset = psf->dataoffset + newblock * SDS_BLOCK_SIZE ; - - if (psf_fseek (psf, file_offset, SEEK_SET) != file_offset) - { psf->error = SFE_SEEK_FAILED ; - return PSF_SEEK_ERROR ; - } ; - - psds->read_block = newblock ; - psds->reader (psf, psds) ; - psds->read_count = newsample ; - break ; - - case SFM_WRITE : - if (newblock > psds->total_blocks) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - file_offset = psf->dataoffset + newblock * SDS_BLOCK_SIZE ; - - if (psf_fseek (psf, file_offset, SEEK_SET) != file_offset) - { psf->error = SFE_SEEK_FAILED ; - return PSF_SEEK_ERROR ; - } ; - - psds->write_block = newblock ; - psds->reader (psf, psds) ; - psds->write_count = newsample ; - break ; - - default : - psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - break ; - } ; - - return seek_from_start ; -} /* sds_seek */ - -static int -sds_byterate (SF_PRIVATE * psf) -{ - if (psf->file.mode == SFM_READ) - return (psf->datalength * psf->sf.samplerate) / psf->sf.frames ; - - return -1 ; -} /* sds_byterate */ - -/*============================================================================== -*/ - -static int -sds_2byte_write (SF_PRIVATE *psf, SDS_PRIVATE *psds) -{ unsigned char *ucptr, checksum ; - unsigned int sample ; - int k ; - - psds->write_data [0] = 0xF0 ; - psds->write_data [1] = 0x7E ; - psds->write_data [2] = 0 ; /* Channel number */ - psds->write_data [3] = 2 ; - psds->write_data [4] = psds->write_block & 0x7F ; /* Packet number */ - - ucptr = psds->write_data + 5 ; - for (k = 0 ; k < 120 ; k += 2) - { sample = psds->write_samples [k / 2] ; - sample += 0x80000000 ; - ucptr [k] = (sample >> 25) & 0x7F ; - ucptr [k + 1] = (sample >> 18) & 0x7F ; - } ; - - checksum = psds->write_data [1] ; - for (k = 2 ; k <= SDS_BLOCK_SIZE - 3 ; k ++) - checksum ^= psds->write_data [k] ; - checksum &= 0x7F ; - - psds->write_data [SDS_BLOCK_SIZE - 2] = checksum ; - psds->write_data [SDS_BLOCK_SIZE - 1] = 0xF7 ; - - if ((k = psf_fwrite (psds->write_data, 1, SDS_BLOCK_SIZE, psf)) != SDS_BLOCK_SIZE) - psf_log_printf (psf, "*** Warning : psf_fwrite (%d != %d).\n", k, SDS_BLOCK_SIZE) ; - - psds->write_block ++ ; - psds->write_count = 0 ; - - if (psds->write_block > psds->total_blocks) - psds->total_blocks = psds->write_block ; - psds->frames = psds->total_blocks * psds->samplesperblock ; - - return 1 ; -} /* sds_2byte_write */ - -static int -sds_3byte_write (SF_PRIVATE *psf, SDS_PRIVATE *psds) -{ unsigned char *ucptr, checksum ; - unsigned int sample ; - int k ; - - psds->write_data [0] = 0xF0 ; - psds->write_data [1] = 0x7E ; - psds->write_data [2] = 0 ; /* Channel number */ - psds->write_data [3] = 2 ; - psds->write_data [4] = psds->write_block & 0x7F ; /* Packet number */ - - ucptr = psds->write_data + 5 ; - for (k = 0 ; k < 120 ; k += 3) - { sample = psds->write_samples [k / 3] ; - sample += 0x80000000 ; - ucptr [k] = (sample >> 25) & 0x7F ; - ucptr [k + 1] = (sample >> 18) & 0x7F ; - ucptr [k + 2] = (sample >> 11) & 0x7F ; - } ; - - checksum = psds->write_data [1] ; - for (k = 2 ; k <= SDS_BLOCK_SIZE - 3 ; k ++) - checksum ^= psds->write_data [k] ; - checksum &= 0x7F ; - - psds->write_data [SDS_BLOCK_SIZE - 2] = checksum ; - psds->write_data [SDS_BLOCK_SIZE - 1] = 0xF7 ; - - if ((k = psf_fwrite (psds->write_data, 1, SDS_BLOCK_SIZE, psf)) != SDS_BLOCK_SIZE) - psf_log_printf (psf, "*** Warning : psf_fwrite (%d != %d).\n", k, SDS_BLOCK_SIZE) ; - - psds->write_block ++ ; - psds->write_count = 0 ; - - if (psds->write_block > psds->total_blocks) - psds->total_blocks = psds->write_block ; - psds->frames = psds->total_blocks * psds->samplesperblock ; - - return 1 ; -} /* sds_3byte_write */ - -static int -sds_4byte_write (SF_PRIVATE *psf, SDS_PRIVATE *psds) -{ unsigned char *ucptr, checksum ; - unsigned int sample ; - int k ; - - psds->write_data [0] = 0xF0 ; - psds->write_data [1] = 0x7E ; - psds->write_data [2] = 0 ; /* Channel number */ - psds->write_data [3] = 2 ; - psds->write_data [4] = psds->write_block & 0x7F ; /* Packet number */ - - ucptr = psds->write_data + 5 ; - for (k = 0 ; k < 120 ; k += 4) - { sample = psds->write_samples [k / 4] ; - sample += 0x80000000 ; - ucptr [k] = (sample >> 25) & 0x7F ; - ucptr [k + 1] = (sample >> 18) & 0x7F ; - ucptr [k + 2] = (sample >> 11) & 0x7F ; - ucptr [k + 3] = (sample >> 4) & 0x7F ; - } ; - - checksum = psds->write_data [1] ; - for (k = 2 ; k <= SDS_BLOCK_SIZE - 3 ; k ++) - checksum ^= psds->write_data [k] ; - checksum &= 0x7F ; - - psds->write_data [SDS_BLOCK_SIZE - 2] = checksum ; - psds->write_data [SDS_BLOCK_SIZE - 1] = 0xF7 ; - - if ((k = psf_fwrite (psds->write_data, 1, SDS_BLOCK_SIZE, psf)) != SDS_BLOCK_SIZE) - psf_log_printf (psf, "*** Warning : psf_fwrite (%d != %d).\n", k, SDS_BLOCK_SIZE) ; - - psds->write_block ++ ; - psds->write_count = 0 ; - - if (psds->write_block > psds->total_blocks) - psds->total_blocks = psds->write_block ; - psds->frames = psds->total_blocks * psds->samplesperblock ; - - return 1 ; -} /* sds_4byte_write */ - -static sf_count_t -sds_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - SDS_PRIVATE *psds ; - int *iptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - - if (psf->codec_data == NULL) - return 0 ; - psds = (SDS_PRIVATE*) psf->codec_data ; - psds->total_written += len ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - iptr [k] = ptr [total + k] << 16 ; - count = sds_write (psf, psds, iptr, writecount) ; - total += count ; - len -= writecount ; - } ; - - return total ; -} /* sds_write_s */ - -static sf_count_t -sds_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ SDS_PRIVATE *psds ; - int total ; - - if (psf->codec_data == NULL) - return 0 ; - psds = (SDS_PRIVATE*) psf->codec_data ; - psds->total_written += len ; - - total = sds_write (psf, psds, ptr, len) ; - - return total ; -} /* sds_write_i */ - -static sf_count_t -sds_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - SDS_PRIVATE *psds ; - int *iptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - float normfact ; - - if (psf->codec_data == NULL) - return 0 ; - psds = (SDS_PRIVATE*) psf->codec_data ; - psds->total_written += len ; - - if (psf->norm_float == SF_TRUE) - normfact = 1.0 * 0x80000000 ; - else - normfact = 1.0 * (1 << psds->bitwidth) ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - iptr [k] = normfact * ptr [total + k] ; - count = sds_write (psf, psds, iptr, writecount) ; - total += count ; - len -= writecount ; - } ; - - return total ; -} /* sds_write_f */ - -static sf_count_t -sds_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - SDS_PRIVATE *psds ; - int *iptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - double normfact ; - - if (psf->codec_data == NULL) - return 0 ; - psds = (SDS_PRIVATE*) psf->codec_data ; - psds->total_written += len ; - - if (psf->norm_double == SF_TRUE) - normfact = 1.0 * 0x80000000 ; - else - normfact = 1.0 * (1 << psds->bitwidth) ; - - iptr = ubuf.ibuf ; - bufferlen = ARRAY_LEN (ubuf.ibuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : len ; - for (k = 0 ; k < writecount ; k++) - iptr [k] = normfact * ptr [total + k] ; - count = sds_write (psf, psds, iptr, writecount) ; - total += count ; - len -= writecount ; - } ; - - return total ; -} /* sds_write_d */ - -static int -sds_write (SF_PRIVATE *psf, SDS_PRIVATE *psds, const int *ptr, int len) -{ int count, total = 0 ; - - while (total < len) - { count = psds->samplesperblock - psds->write_count ; - if (count > len - total) - count = len - total ; - - memcpy (&(psds->write_samples [psds->write_count]), &(ptr [total]), count * sizeof (int)) ; - total += count ; - psds->write_count += count ; - - if (psds->write_count >= psds->samplesperblock) - psds->writer (psf, psds) ; - } ; - - return total ; -} /* sds_write */ - diff --git a/libs/libsndfile/src/sf_unistd.h b/libs/libsndfile/src/sf_unistd.h deleted file mode 100644 index 9fca68eff2..0000000000 --- a/libs/libsndfile/src/sf_unistd.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* Some defines that microsoft 'forgot' to implement. */ - -#ifndef S_IRWXU -#define S_IRWXU 0000700 /* rwx, owner */ -#endif - -#ifndef S_IRUSR -#define S_IRUSR 0000400 /* read permission, owner */ -#endif - -#ifndef S_IWUSR -#define S_IWUSR 0000200 /* write permission, owner */ -#endif - -#ifndef S_IXUSR -#define S_IXUSR 0000100 /* execute/search permission, owner */ -#endif - -/* Windows doesn't have group permissions so set all these to zero. */ -#define S_IRWXG 0 /* rwx, group */ -#define S_IRGRP 0 /* read permission, group */ -#define S_IWGRP 0 /* write permission, grougroup */ -#define S_IXGRP 0 /* execute/search permission, group */ - -/* Windows doesn't have others permissions so set all these to zero. */ -#define S_IRWXO 0 /* rwx, other */ -#define S_IROTH 0 /* read permission, other */ -#define S_IWOTH 0 /* write permission, other */ -#define S_IXOTH 0 /* execute/search permission, other */ - -#ifndef S_ISFIFO -#define S_ISFIFO(mode) (((mode) & _S_IFMT) == _S_IFIFO) -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) (((mode) & _S_IFREG) == _S_IFREG) -#endif - -/* -** Don't know if these are still needed. -** -** #define _IFMT _S_IFMT -** #define _IFREG _S_IFREG -*/ - diff --git a/libs/libsndfile/src/sfconfig.h b/libs/libsndfile/src/sfconfig.h deleted file mode 100644 index b9b2dbda0d..0000000000 --- a/libs/libsndfile/src/sfconfig.h +++ /dev/null @@ -1,115 +0,0 @@ -/* -** Copyright (C) 2005-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** Autoconf leaves many config parameters undefined. -** Here we change then from being undefined to defining them to 0. -** This allows things like: -** -** #if HAVE_CONFIG_PARAM -** -** and -** -** if (HAVE_CONFIG_PARAM) -** do_something () ; -*/ - -#ifndef SFCONFIG_H -#define SFCONFIG_H - -/* Include the Autoconf generated file. */ -#include "config.h" - -/* Now fiddle the values. */ - -#ifndef HAVE_ALSA_ASOUNDLIB_H -#define HAVE_ALSA_ASOUNDLIB_H 0 -#endif - -#ifndef HAVE_BYTESWAP_H -#define HAVE_BYTESWAP_H 0 -#endif - -#ifndef HAVE_DECL_S_IRGRP -#define HAVE_DECL_S_IRGRP 0 -#endif - -#ifndef HAVE_ENDIAN_H -#define HAVE_ENDIAN_H 0 -#endif - -#ifndef HAVE_FSTAT64 -#define HAVE_FSTAT64 0 -#endif - -#ifndef HAVE_FSYNC -#define HAVE_FSYNC 0 -#endif - -#ifndef HAVE_LOCALE_H -#define HAVE_LOCALE_H 0 -#endif - -#ifndef HAVE_LRINT -#define HAVE_LRINT 0 -#endif - -#ifndef HAVE_LRINTF -#define HAVE_LRINTF 0 -#endif - -#ifndef HAVE_MMAP -#define HAVE_MMAP 0 -#endif - -#ifndef HAVE_SETLOCALE -#define HAVE_SETLOCALE 0 -#endif - -#ifndef HAVE_SQLITE3 -#define HAVE_SQLITE3 0 -#endif - -#ifndef HAVE_STDINT_H -#define HAVE_STDINT_H 0 -#endif - -#ifndef HAVE_SYS_WAIT_H -#define HAVE_SYS_WAIT_H 0 -#endif - -#ifndef HAVE_UNISTD_H -#define HAVE_UNISTD_H 0 -#endif - -#ifndef HAVE_PIPE -#define HAVE_PIPE 0 -#endif - -#ifndef HAVE_WAITPID -#define HAVE_WAITPID 0 -#endif - -#ifndef HAVE_X86INTRIN_H -#define HAVE_X86INTRIN_H 0 -#endif - -#define CPU_IS_X86 (defined __i486__ || defined __i586__ || defined __i686__ || defined __x86_64__) -#define CPU_IS_X86_64 (defined __x86_64__) - -#endif diff --git a/libs/libsndfile/src/sfendian.h b/libs/libsndfile/src/sfendian.h deleted file mode 100644 index 044fa3a77f..0000000000 --- a/libs/libsndfile/src/sfendian.h +++ /dev/null @@ -1,296 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef SFENDIAN_INCLUDED -#define SFENDIAN_INCLUDED - -#include "sfconfig.h" - -#include -#ifndef WIN32 -#include -#endif - - -#if COMPILER_IS_GCC && CPU_IS_X86 - -static inline int16_t -ENDSWAP_16 (int16_t x) -{ int16_t y ; - __asm__ ("rorw $8, %w0" : "=r" (y) : "0" (x) : "cc") ; - return y ; -} /* ENDSWAP_16 */ - -static inline int32_t -ENDSWAP_32 (int32_t x) -{ int32_t y ; - __asm__ ("bswap %0" : "=r" (y) : "0" (x)) ; - return y ; -} /* ENDSWAP_32 */ - -#if CPU_IS_X86_64 - -static inline int64_t -ENDSWAP_64X (int64_t x) -{ int64_t y ; - __asm__ ("bswap %q0" : "=r" (y) : "0" (x)) ; - return y ; -} /* ENDSWAP_64X */ - -#define ENDSWAP_64 ENDSWAP_64X - -#endif - -#elif HAVE_BYTESWAP_H /* Linux, any CPU */ -#include - -#define ENDSWAP_16(x) (bswap_16 (x)) -#define ENDSWAP_32(x) (bswap_32 (x)) -#define ENDSWAP_64(x) (bswap_64 (x)) - -#else - -#define ENDSWAP_16(x) ((((x) >> 8) & 0xFF) + (((x) & 0xFF) << 8)) -#define ENDSWAP_32(x) ((((x) >> 24) & 0xFF) + (((x) >> 8) & 0xFF00) + (((x) & 0xFF00) << 8) + (((x) & 0xFF) << 24)) - -#endif - -#ifndef ENDSWAP_64 -static inline uint64_t -ENDSWAP_64 (uint64_t x) -{ union - { uint32_t parts [2] ; - uint64_t whole ; - } u ; - uint32_t temp ; - - u.whole = x ; - temp = u.parts [0] ; - u.parts [0] = ENDSWAP_32 (u.parts [1]) ; - u.parts [1] = ENDSWAP_32 (temp) ; - return u.whole ; -} -#endif - -/* -** Many file types (ie WAV, AIFF) use sets of four consecutive bytes as a -** marker indicating different sections of the file. -** The following MAKE_MARKER macro allows th creation of integer constants -** for these markers. -*/ - -#if (CPU_IS_LITTLE_ENDIAN == 1) - #define MAKE_MARKER(a, b, c, d) ((uint32_t) ((a) | ((b) << 8) | ((c) << 16) | (((uint32_t) (d)) << 24))) -#elif (CPU_IS_BIG_ENDIAN == 1) - #define MAKE_MARKER(a, b, c, d) ((uint32_t) ((((uint32_t) (a)) << 24) | ((b) << 16) | ((c) << 8) | (d))) -#else - #error "Target CPU endian-ness unknown. May need to hand edit src/sfconfig.h" -#endif - -/* -** Macros to handle reading of data of a specific endian-ness into host endian -** shorts and ints. The single input is an unsigned char* pointer to the start -** of the object. There are two versions of each macro as we need to deal with -** both big and little endian CPUs. -*/ - -#if (CPU_IS_LITTLE_ENDIAN == 1) - #define LE2H_16(x) (x) - #define LE2H_32(x) (x) - - #define BE2H_16(x) ENDSWAP_16 (x) - #define BE2H_32(x) ENDSWAP_32 (x) - #define BE2H_64(x) ENDSWAP_64 (x) - - #define H2BE_16(x) ENDSWAP_16 (x) - #define H2BE_32(x) ENDSWAP_32 (x) - -#elif (CPU_IS_BIG_ENDIAN == 1) - #define LE2H_16(x) ENDSWAP_16 (x) - #define LE2H_32(x) ENDSWAP_32 (x) - - #define BE2H_16(x) (x) - #define BE2H_32(x) (x) - #define BE2H_64(x) (x) - - #define H2BE_16(x) (x) - #define H2BE_32(x) (x) - - #define H2LE_16(x) ENDSWAP_16 (x) - #define H2LE_32(x) ENDSWAP_32 (x) - -#else - #error "Target CPU endian-ness unknown. May need to hand edit src/sfconfig.h" -#endif - -#define LET2H_16_PTR(x) ((x) [1] + ((x) [2] << 8)) -#define LET2H_32_PTR(x) (((x) [0] << 8) + ((x) [1] << 16) + ((x) [2] << 24)) - -#define BET2H_16_PTR(x) (((x) [0] << 8) + (x) [1]) -#define BET2H_32_PTR(x) (((x) [0] << 24) + ((x) [1] << 16) + ((x) [2] << 8)) - -static inline void -psf_put_be64 (uint8_t *ptr, int offset, int64_t value) -{ - ptr [offset] = value >> 56 ; - ptr [offset + 1] = value >> 48 ; - ptr [offset + 2] = value >> 40 ; - ptr [offset + 3] = value >> 32 ; - ptr [offset + 4] = value >> 24 ; - ptr [offset + 5] = value >> 16 ; - ptr [offset + 6] = value >> 8 ; - ptr [offset + 7] = value ; -} /* psf_put_be64 */ - -static inline void -psf_put_be32 (uint8_t *ptr, int offset, int32_t value) -{ - ptr [offset] = value >> 24 ; - ptr [offset + 1] = value >> 16 ; - ptr [offset + 2] = value >> 8 ; - ptr [offset + 3] = value ; -} /* psf_put_be32 */ - -static inline void -psf_put_be16 (uint8_t *ptr, int offset, int16_t value) -{ - ptr [offset] = value >> 8 ; - ptr [offset + 1] = value ; -} /* psf_put_be16 */ - -static inline int64_t -psf_get_be64 (uint8_t *ptr, int offset) -{ int64_t value ; - - value = ptr [offset] << 24 ; - value += ptr [offset + 1] << 16 ; - value += ptr [offset + 2] << 8 ; - value += ptr [offset + 3] ; - - value <<= 32 ; - - value += ptr [offset + 4] << 24 ; - value += ptr [offset + 5] << 16 ; - value += ptr [offset + 6] << 8 ; - value += ptr [offset + 7] ; - return value ; -} /* psf_get_be64 */ - -static inline int32_t -psf_get_be32 (uint8_t *ptr, int offset) -{ int32_t value ; - - value = ptr [offset] << 24 ; - value += ptr [offset + 1] << 16 ; - value += ptr [offset + 2] << 8 ; - value += ptr [offset + 3] ; - return value ; -} /* psf_get_be32 */ - -static inline int16_t -psf_get_be16 (uint8_t *ptr, int offset) -{ return (ptr [offset] << 8) + ptr [offset + 1] ; -} /* psf_get_be16 */ - -/*----------------------------------------------------------------------------------------------- -** Generic functions for performing endian swapping on integer arrays. -*/ - -static inline void -endswap_short_array (short *ptr, int len) -{ short temp ; - - while (--len >= 0) - { temp = ptr [len] ; - ptr [len] = ENDSWAP_16 (temp) ; - } ; -} /* endswap_short_array */ - -static inline void -endswap_short_copy (short *dest, const short *src, int len) -{ - while (--len >= 0) - { dest [len] = ENDSWAP_16 (src [len]) ; - } ; -} /* endswap_short_copy */ - -static inline void -endswap_int_array (int *ptr, int len) -{ int temp ; - - while (--len >= 0) - { temp = ptr [len] ; - ptr [len] = ENDSWAP_32 (temp) ; - } ; -} /* endswap_int_array */ - -static inline void -endswap_int_copy (int *dest, const int *src, int len) -{ - while (--len >= 0) - { dest [len] = ENDSWAP_32 (src [len]) ; - } ; -} /* endswap_int_copy */ - -/*======================================================================================== -*/ - -static inline void -endswap_int64_t_array (int64_t *ptr, int len) -{ int64_t value ; - - while (--len >= 0) - { value = ptr [len] ; - ptr [len] = ENDSWAP_64 (value) ; - } ; -} /* endswap_int64_t_array */ - -static inline void -endswap_int64_t_copy (int64_t *dest, const int64_t *src, int len) -{ int64_t value ; - - while (--len >= 0) - { value = src [len] ; - dest [len] = ENDSWAP_64 (value) ; - } ; -} /* endswap_int64_t_copy */ - -/* A couple of wrapper functions. */ - -static inline void -endswap_float_array (float *ptr, int len) -{ endswap_int_array ((int *) ptr, len) ; -} /* endswap_float_array */ - -static inline void -endswap_double_array (double *ptr, int len) -{ endswap_int64_t_array ((int64_t *) ptr, len) ; -} /* endswap_double_array */ - -static inline void -endswap_float_copy (float *dest, const float *src, int len) -{ endswap_int_copy ((int *) dest, (const int *) src, len) ; -} /* endswap_float_copy */ - -static inline void -endswap_double_copy (double *dest, const double *src, int len) -{ endswap_int64_t_copy ((int64_t *) dest, (const int64_t *) src, len) ; -} /* endswap_double_copy */ - -#endif /* SFENDIAN_INCLUDED */ - diff --git a/libs/libsndfile/src/sndfile.c b/libs/libsndfile/src/sndfile.c deleted file mode 100644 index cfe75ac4d9..0000000000 --- a/libs/libsndfile/src/sndfile.c +++ /dev/null @@ -1,3093 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#define SNDFILE_MAGICK 0x1234C0DE - -#ifdef __APPLE__ - /* - ** Detect if a compile for a universal binary is being attempted and barf if it is. - ** See the URL below for the rationale. - */ - #ifdef __BIG_ENDIAN__ - #if (CPU_IS_LITTLE_ENDIAN == 1) - #error "Universal binary compile detected. See http://www.mega-nerd.com/libsndfile/FAQ.html#Q018" - #endif - #endif - - #ifdef __LITTLE_ENDIAN__ - #if (CPU_IS_BIG_ENDIAN == 1) - #error "Universal binary compile detected. See http://www.mega-nerd.com/libsndfile/FAQ.html#Q018" - #endif - #endif -#endif - - -typedef struct -{ int error ; - const char *str ; -} ErrorStruct ; - -static -ErrorStruct SndfileErrors [] = -{ - /* Public error values and their associated strings. */ - { SF_ERR_NO_ERROR , "No Error." }, - { SF_ERR_UNRECOGNISED_FORMAT , "Format not recognised." }, - { SF_ERR_SYSTEM , "System error." /* Often replaced. */ }, - { SF_ERR_MALFORMED_FILE , "Supported file format but file is malformed." }, - { SF_ERR_UNSUPPORTED_ENCODING , "Supported file format but unsupported encoding." }, - - /* Private error values and their associated strings. */ - { SFE_ZERO_MAJOR_FORMAT , "Error : major format is 0." }, - { SFE_ZERO_MINOR_FORMAT , "Error : minor format is 0." }, - { SFE_BAD_FILE , "File does not exist or is not a regular file (possibly a pipe?)." }, - { SFE_BAD_FILE_READ , "File exists but no data could be read." }, - { SFE_OPEN_FAILED , "Could not open file." }, - { SFE_BAD_SNDFILE_PTR , "Not a valid SNDFILE* pointer." }, - { SFE_BAD_SF_INFO_PTR , "NULL SF_INFO pointer passed to libsndfile." }, - { SFE_BAD_SF_INCOMPLETE , "SF_PRIVATE struct incomplete and end of header parsing." }, - { SFE_BAD_FILE_PTR , "Bad FILE pointer." }, - { SFE_BAD_INT_PTR , "Internal error, Bad pointer." }, - { SFE_BAD_STAT_SIZE , "Error : software was misconfigured at compile time (sizeof statbuf.st_size)." }, - { SFE_NO_TEMP_DIR , "Error : Could not file temp dir." }, - - { SFE_MALLOC_FAILED , "Internal malloc () failed." }, - { SFE_UNIMPLEMENTED , "File contains data in an unimplemented format." }, - { SFE_BAD_READ_ALIGN , "Attempt to read a non-integer number of channels." }, - { SFE_BAD_WRITE_ALIGN , "Attempt to write a non-integer number of channels." }, - { SFE_UNKNOWN_FORMAT , "File contains data in an unknown format." }, - { SFE_NOT_READMODE , "Read attempted on file currently open for write." }, - { SFE_NOT_WRITEMODE , "Write attempted on file currently open for read." }, - { SFE_BAD_MODE_RW , "Error : This file format does not support read/write mode." }, - { SFE_BAD_SF_INFO , "Internal error : SF_INFO struct incomplete." }, - { SFE_BAD_OFFSET , "Error : supplied offset beyond end of file." }, - { SFE_NO_EMBED_SUPPORT , "Error : embedding not supported for this file format." }, - { SFE_NO_EMBEDDED_RDWR , "Error : cannot open embedded file read/write." }, - { SFE_NO_PIPE_WRITE , "Error : this file format does not support pipe write." }, - { SFE_BAD_VIRTUAL_IO , "Error : bad pointer on SF_VIRTUAL_IO struct." }, - { SFE_BAD_BROADCAST_INFO_SIZE - , "Error : bad coding_history_size in SF_BROADCAST_INFO struct." }, - { SFE_BAD_BROADCAST_INFO_TOO_BIG - , "Error : SF_BROADCAST_INFO struct too large." }, - { SFE_BAD_CART_INFO_SIZE , "Error: SF_CART_INFO struct too large." }, - { SFE_BAD_CART_INFO_TOO_BIG , "Error: bag tag_text_size in SF_CART_INFO struct." }, - { SFE_INTERLEAVE_MODE , "Attempt to write to file with non-interleaved data." }, - { SFE_INTERLEAVE_SEEK , "Bad karma in seek during interleave read operation." }, - { SFE_INTERLEAVE_READ , "Bad karma in read during interleave read operation." }, - - { SFE_INTERNAL , "Unspecified internal error." }, - { SFE_BAD_COMMAND_PARAM , "Bad parameter passed to function sf_command." }, - { SFE_BAD_ENDIAN , "Bad endian-ness. Try default endian-ness" }, - { SFE_CHANNEL_COUNT_ZERO , "Channel count is zero." }, - { SFE_CHANNEL_COUNT , "Too many channels specified." }, - - { SFE_BAD_SEEK , "Internal psf_fseek() failed." }, - { SFE_NOT_SEEKABLE , "Seek attempted on unseekable file type." }, - { SFE_AMBIGUOUS_SEEK , "Error : combination of file open mode and seek command is ambiguous." }, - { SFE_WRONG_SEEK , "Error : invalid seek parameters." }, - { SFE_SEEK_FAILED , "Error : parameters OK, but psf_seek() failed." }, - - { SFE_BAD_OPEN_MODE , "Error : bad mode parameter for file open." }, - { SFE_OPEN_PIPE_RDWR , "Error : attempt to open a pipe in read/write mode." }, - { SFE_RDWR_POSITION , "Error on RDWR position (cryptic)." }, - { SFE_RDWR_BAD_HEADER , "Error : Cannot open file in read/write mode due to string data in header." }, - { SFE_CMD_HAS_DATA , "Error : Command fails because file already has audio data." }, - - { SFE_STR_NO_SUPPORT , "Error : File type does not support string data." }, - { SFE_STR_NOT_WRITE , "Error : Trying to set a string when file is not in write mode." }, - { SFE_STR_MAX_DATA , "Error : Maximum string data storage reached." }, - { SFE_STR_MAX_COUNT , "Error : Maximum string data count reached." }, - { SFE_STR_BAD_TYPE , "Error : Bad string data type." }, - { SFE_STR_NO_ADD_END , "Error : file type does not support strings added at end of file." }, - { SFE_STR_BAD_STRING , "Error : bad string." }, - { SFE_STR_WEIRD , "Error : Weird string error." }, - - { SFE_WAV_NO_RIFF , "Error in WAV file. No 'RIFF' chunk marker." }, - { SFE_WAV_NO_WAVE , "Error in WAV file. No 'WAVE' chunk marker." }, - { SFE_WAV_NO_FMT , "Error in WAV/W64/RF64 file. No 'fmt ' chunk marker." }, - { SFE_WAV_BAD_FMT , "Error in WAV/W64/RF64 file. Malformed 'fmt ' chunk." }, - { SFE_WAV_FMT_SHORT , "Error in WAV/W64/RF64 file. Short 'fmt ' chunk." }, - - { SFE_WAV_BAD_FACT , "Error in WAV file. 'fact' chunk out of place." }, - { SFE_WAV_BAD_PEAK , "Error in WAV file. Bad 'PEAK' chunk." }, - { SFE_WAV_PEAK_B4_FMT , "Error in WAV file. 'PEAK' chunk found before 'fmt ' chunk." }, - - { SFE_WAV_BAD_FORMAT , "Error in WAV file. Errors in 'fmt ' chunk." }, - { SFE_WAV_BAD_BLOCKALIGN , "Error in WAV file. Block alignment in 'fmt ' chunk is incorrect." }, - { SFE_WAV_NO_DATA , "Error in WAV file. No 'data' chunk marker." }, - { SFE_WAV_BAD_LIST , "Error in WAV file. Malformed LIST chunk." }, - { SFE_WAV_UNKNOWN_CHUNK , "Error in WAV file. File contains an unknown chunk marker." }, - { SFE_WAV_WVPK_DATA , "Error in WAV file. Data is in WAVPACK format." }, - - { SFE_WAV_ADPCM_NOT4BIT , "Error in ADPCM WAV file. Invalid bit width." }, - { SFE_WAV_ADPCM_CHANNELS , "Error in ADPCM WAV file. Invalid number of channels." }, - { SFE_WAV_GSM610_FORMAT , "Error in GSM610 WAV file. Invalid format chunk." }, - - { SFE_AIFF_NO_FORM , "Error in AIFF file, bad 'FORM' marker." }, - { SFE_AIFF_AIFF_NO_FORM , "Error in AIFF file, 'AIFF' marker without 'FORM'." }, - { SFE_AIFF_COMM_NO_FORM , "Error in AIFF file, 'COMM' marker without 'FORM'." }, - { SFE_AIFF_SSND_NO_COMM , "Error in AIFF file, 'SSND' marker without 'COMM'." }, - { SFE_AIFF_UNKNOWN_CHUNK , "Error in AIFF file, unknown chunk." }, - { SFE_AIFF_COMM_CHUNK_SIZE, "Error in AIFF file, bad 'COMM' chunk size." }, - { SFE_AIFF_BAD_COMM_CHUNK , "Error in AIFF file, bad 'COMM' chunk." }, - { SFE_AIFF_PEAK_B4_COMM , "Error in AIFF file. 'PEAK' chunk found before 'COMM' chunk." }, - { SFE_AIFF_BAD_PEAK , "Error in AIFF file. Bad 'PEAK' chunk." }, - { SFE_AIFF_NO_SSND , "Error in AIFF file, bad 'SSND' chunk." }, - { SFE_AIFF_NO_DATA , "Error in AIFF file, no sound data." }, - { SFE_AIFF_RW_SSND_NOT_LAST, "Error in AIFF file, RDWR only possible if SSND chunk at end of file." }, - - { SFE_AU_UNKNOWN_FORMAT , "Error in AU file, unknown format." }, - { SFE_AU_NO_DOTSND , "Error in AU file, missing '.snd' or 'dns.' marker." }, - { SFE_AU_EMBED_BAD_LEN , "Embedded AU file with unknown length." }, - - { SFE_RAW_READ_BAD_SPEC , "Error while opening RAW file for read. Must specify format and channels.\n" - "Possibly trying to open unsupported format." }, - { SFE_RAW_BAD_BITWIDTH , "Error. RAW file bitwidth must be a multiple of 8." }, - { SFE_RAW_BAD_FORMAT , "Error. Bad format field in SF_INFO struct when openning a RAW file for read." }, - - { SFE_PAF_NO_MARKER , "Error in PAF file, no marker." }, - { SFE_PAF_VERSION , "Error in PAF file, bad version." }, - { SFE_PAF_UNKNOWN_FORMAT , "Error in PAF file, unknown format." }, - { SFE_PAF_SHORT_HEADER , "Error in PAF file. File shorter than minimal header." }, - { SFE_PAF_BAD_CHANNELS , "Error in PAF file. Bad channel count." }, - - { SFE_SVX_NO_FORM , "Error in 8SVX / 16SV file, no 'FORM' marker." }, - { SFE_SVX_NO_BODY , "Error in 8SVX / 16SV file, no 'BODY' marker." }, - { SFE_SVX_NO_DATA , "Error in 8SVX / 16SV file, no sound data." }, - { SFE_SVX_BAD_COMP , "Error in 8SVX / 16SV file, unsupported compression format." }, - { SFE_SVX_BAD_NAME_LENGTH , "Error in 8SVX / 16SV file, NAME chunk too long." }, - - { SFE_NIST_BAD_HEADER , "Error in NIST file, bad header." }, - { SFE_NIST_CRLF_CONVERISON, "Error : NIST file damaged by Windows CR -> CRLF conversion process." }, - { SFE_NIST_BAD_ENCODING , "Error in NIST file, unsupported compression format." }, - - { SFE_VOC_NO_CREATIVE , "Error in VOC file, no 'Creative Voice File' marker." }, - { SFE_VOC_BAD_FORMAT , "Error in VOC file, bad format." }, - { SFE_VOC_BAD_VERSION , "Error in VOC file, bad version number." }, - { SFE_VOC_BAD_MARKER , "Error in VOC file, bad marker in file." }, - { SFE_VOC_BAD_SECTIONS , "Error in VOC file, incompatible VOC sections." }, - { SFE_VOC_MULTI_SAMPLERATE, "Error in VOC file, more than one sample rate defined." }, - { SFE_VOC_MULTI_SECTION , "Unimplemented VOC file feature, file contains multiple sound sections." }, - { SFE_VOC_MULTI_PARAM , "Error in VOC file, file contains multiple bit or channel widths." }, - { SFE_VOC_SECTION_COUNT , "Error in VOC file, too many sections." }, - { SFE_VOC_NO_PIPE , "Error : not able to operate on VOC files over a pipe." }, - - { SFE_IRCAM_NO_MARKER , "Error in IRCAM file, bad IRCAM marker." }, - { SFE_IRCAM_BAD_CHANNELS , "Error in IRCAM file, bad channel count." }, - { SFE_IRCAM_UNKNOWN_FORMAT, "Error in IRCAM file, unknow encoding format." }, - - { SFE_W64_64_BIT , "Error in W64 file, file contains 64 bit offset." }, - { SFE_W64_NO_RIFF , "Error in W64 file. No 'riff' chunk marker." }, - { SFE_W64_NO_WAVE , "Error in W64 file. No 'wave' chunk marker." }, - { SFE_W64_NO_DATA , "Error in W64 file. No 'data' chunk marker." }, - { SFE_W64_ADPCM_NOT4BIT , "Error in ADPCM W64 file. Invalid bit width." }, - { SFE_W64_ADPCM_CHANNELS , "Error in ADPCM W64 file. Invalid number of channels." }, - { SFE_W64_GSM610_FORMAT , "Error in GSM610 W64 file. Invalid format chunk." }, - - { SFE_MAT4_BAD_NAME , "Error in MAT4 file. No variable name." }, - { SFE_MAT4_NO_SAMPLERATE , "Error in MAT4 file. No sample rate." }, - - { SFE_MAT5_BAD_ENDIAN , "Error in MAT5 file. Not able to determine endian-ness." }, - { SFE_MAT5_NO_BLOCK , "Error in MAT5 file. Bad block structure." }, - { SFE_MAT5_SAMPLE_RATE , "Error in MAT5 file. Not able to determine sample rate." }, - - { SFE_PVF_NO_PVF1 , "Error in PVF file. No PVF1 marker." }, - { SFE_PVF_BAD_HEADER , "Error in PVF file. Bad header." }, - { SFE_PVF_BAD_BITWIDTH , "Error in PVF file. Bad bit width." }, - - { SFE_XI_BAD_HEADER , "Error in XI file. Bad header." }, - { SFE_XI_EXCESS_SAMPLES , "Error in XI file. Excess samples in file." }, - { SFE_XI_NO_PIPE , "Error : not able to operate on XI files over a pipe." }, - - { SFE_HTK_NO_PIPE , "Error : not able to operate on HTK files over a pipe." }, - - { SFE_SDS_NOT_SDS , "Error : not an SDS file." }, - { SFE_SDS_BAD_BIT_WIDTH , "Error : bad bit width for SDS file." }, - - { SFE_SD2_FD_DISALLOWED , "Error : cannot open SD2 file without a file name." }, - { SFE_SD2_BAD_DATA_OFFSET , "Error : bad data offset." }, - { SFE_SD2_BAD_MAP_OFFSET , "Error : bad map offset." }, - { SFE_SD2_BAD_DATA_LENGTH , "Error : bad data length." }, - { SFE_SD2_BAD_MAP_LENGTH , "Error : bad map length." }, - { SFE_SD2_BAD_RSRC , "Error : bad resource fork." }, - { SFE_SD2_BAD_SAMPLE_SIZE , "Error : bad sample size." }, - - { SFE_FLAC_BAD_HEADER , "Error : bad flac header." }, - { SFE_FLAC_NEW_DECODER , "Error : problem while creating flac decoder." }, - { SFE_FLAC_INIT_DECODER , "Error : problem while initialization of the flac decoder." }, - { SFE_FLAC_LOST_SYNC , "Error : flac decoder lost sync." }, - { SFE_FLAC_BAD_SAMPLE_RATE, "Error : flac does not support this sample rate." }, - { SFE_FLAC_UNKOWN_ERROR , "Error : unknown error in flac decoder." }, - - { SFE_WVE_NOT_WVE , "Error : not a WVE file." }, - { SFE_WVE_NO_PIPE , "Error : not able to operate on WVE files over a pipe." }, - - { SFE_DWVW_BAD_BITWIDTH , "Error : Bad bit width for DWVW encoding. Must be 12, 16 or 24." }, - { SFE_G72X_NOT_MONO , "Error : G72x encoding does not support more than 1 channel." }, - - { SFE_VORBIS_ENCODER_BUG , "Error : Sample rate chosen is known to trigger a Vorbis encoder bug on this CPU." }, - - { SFE_RF64_NOT_RF64 , "Error : Not an RF64 file." }, - { SFE_ALAC_FAIL_TMPFILE , "Error : Failed to open tmp file for ALAC encoding." }, - - { SFE_BAD_CHUNK_PTR , "Error : Bad SF_CHUNK_INFO pointer." }, - { SFE_UNKNOWN_CHUNK , "Error : Unknown chunk marker." }, - { SFE_BAD_CHUNK_FORMAT , "Error : Reading/writing chunks from this file format is not supported." }, - { SFE_BAD_CHUNK_MARKER , "Error : Bad chunk marker." }, - { SFE_BAD_CHUNK_DATA_PTR , "Error : Bad data pointer in SF_CHUNK_INFO struct." }, - - { SFE_MAX_ERROR , "Maximum error number." }, - { SFE_MAX_ERROR + 1 , NULL } -} ; - -/*------------------------------------------------------------------------------ -*/ - -static int format_from_extension (SF_PRIVATE *psf) ; -static int guess_file_type (SF_PRIVATE *psf) ; -static int validate_sfinfo (SF_INFO *sfinfo) ; -static int validate_psf (SF_PRIVATE *psf) ; -static void save_header_info (SF_PRIVATE *psf) ; -static void copy_filename (SF_PRIVATE *psf, const char *path) ; -static int psf_close (SF_PRIVATE *psf) ; - -static int try_resource_fork (SF_PRIVATE * psf) ; - -/*------------------------------------------------------------------------------ -** Private (static) variables. -*/ - -int sf_errno = 0 ; -static char sf_parselog [SF_BUFFER_LEN] = { 0 } ; -static char sf_syserr [SF_SYSERR_LEN] = { 0 } ; - -/*------------------------------------------------------------------------------ -*/ - -#define VALIDATE_SNDFILE_AND_ASSIGN_PSF(a, b, c) \ - { if ((a) == NULL) \ - { sf_errno = SFE_BAD_SNDFILE_PTR ; \ - return 0 ; \ - } ; \ - (b) = (SF_PRIVATE*) (a) ; \ - if ((b)->virtual_io == SF_FALSE && \ - psf_file_valid (b) == 0) \ - { (b)->error = SFE_BAD_FILE_PTR ; \ - return 0 ; \ - } ; \ - if ((b)->Magick != SNDFILE_MAGICK) \ - { (b)->error = SFE_BAD_SNDFILE_PTR ; \ - return 0 ; \ - } ; \ - if (c) (b)->error = 0 ; \ - } - -/*------------------------------------------------------------------------------ -** Public functions. -*/ - -SNDFILE* -sf_open (const char *path, int mode, SF_INFO *sfinfo) -{ SF_PRIVATE *psf ; - - /* Ultimate sanity check. */ - assert (sizeof (sf_count_t) == 8) ; - - if ((psf = calloc (1, sizeof (SF_PRIVATE))) == NULL) - { sf_errno = SFE_MALLOC_FAILED ; - return NULL ; - } ; - - psf_init_files (psf) ; - - psf_log_printf (psf, "File : %s\n", path) ; - - copy_filename (psf, path) ; - - psf->file.mode = mode ; - if (strcmp (path, "-") == 0) - psf->error = psf_set_stdio (psf) ; - else - psf->error = psf_fopen (psf) ; - - return psf_open_file (psf, sfinfo) ; -} /* sf_open */ - -SNDFILE* -sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) -{ SF_PRIVATE *psf ; - - if ((SF_CONTAINER (sfinfo->format)) == SF_FORMAT_SD2) - { sf_errno = SFE_SD2_FD_DISALLOWED ; - return NULL ; - } ; - - if ((psf = calloc (1, sizeof (SF_PRIVATE))) == NULL) - { sf_errno = SFE_MALLOC_FAILED ; - return NULL ; - } ; - - psf_init_files (psf) ; - copy_filename (psf, "") ; - - psf->file.mode = mode ; - psf_set_file (psf, fd) ; - psf->is_pipe = psf_is_pipe (psf) ; - psf->fileoffset = psf_ftell (psf) ; - - if (! close_desc) - psf->file.do_not_close_descriptor = SF_TRUE ; - - return psf_open_file (psf, sfinfo) ; -} /* sf_open_fd */ - -SNDFILE* -sf_open_virtual (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) -{ SF_PRIVATE *psf ; - - /* Make sure we have a valid set ot virtual pointers. */ - if (sfvirtual->get_filelen == NULL || sfvirtual->seek == NULL || sfvirtual->tell == NULL) - { sf_errno = SFE_BAD_VIRTUAL_IO ; - snprintf (sf_parselog, sizeof (sf_parselog), "Bad vio_get_filelen / vio_seek / vio_tell in SF_VIRTUAL_IO struct.\n") ; - return NULL ; - } ; - - if ((mode == SFM_READ || mode == SFM_RDWR) && sfvirtual->read == NULL) - { sf_errno = SFE_BAD_VIRTUAL_IO ; - snprintf (sf_parselog, sizeof (sf_parselog), "Bad vio_read in SF_VIRTUAL_IO struct.\n") ; - return NULL ; - } ; - - if ((mode == SFM_WRITE || mode == SFM_RDWR) && sfvirtual->write == NULL) - { sf_errno = SFE_BAD_VIRTUAL_IO ; - snprintf (sf_parselog, sizeof (sf_parselog), "Bad vio_write in SF_VIRTUAL_IO struct.\n") ; - return NULL ; - } ; - - if ((psf = calloc (1, sizeof (SF_PRIVATE))) == NULL) - { sf_errno = SFE_MALLOC_FAILED ; - return NULL ; - } ; - - psf_init_files (psf) ; - - psf->virtual_io = SF_TRUE ; - psf->vio = *sfvirtual ; - psf->vio_user_data = user_data ; - - psf->file.mode = mode ; - - return psf_open_file (psf, sfinfo) ; -} /* sf_open_virtual */ - -int -sf_close (SNDFILE *sndfile) -{ SF_PRIVATE *psf ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - return psf_close (psf) ; -} /* sf_close */ - -void -sf_write_sync (SNDFILE *sndfile) -{ SF_PRIVATE *psf ; - - if ((psf = (SF_PRIVATE *) sndfile) == NULL) - return ; - - psf_fsync (psf) ; - - return ; -} /* sf_write_sync */ - -/*============================================================================== -*/ - -const char* -sf_error_number (int errnum) -{ static const char *bad_errnum = - "No error defined for this error number. This is a bug in libsndfile." ; - int k ; - - if (errnum == SFE_MAX_ERROR) - return SndfileErrors [0].str ; - - if (errnum < 0 || errnum > SFE_MAX_ERROR) - { /* This really shouldn't happen in release versions. */ - printf ("Not a valid error number (%d).\n", errnum) ; - return bad_errnum ; - } ; - - for (k = 0 ; SndfileErrors [k].str ; k++) - if (errnum == SndfileErrors [k].error) - return SndfileErrors [k].str ; - - return bad_errnum ; -} /* sf_error_number */ - -const char* -sf_strerror (SNDFILE *sndfile) -{ SF_PRIVATE *psf = NULL ; - int errnum ; - - if (sndfile == NULL) - { errnum = sf_errno ; - if (errnum == SFE_SYSTEM && sf_syserr [0]) - return sf_syserr ; - } - else - { psf = (SF_PRIVATE *) sndfile ; - - if (psf->Magick != SNDFILE_MAGICK) - return "sf_strerror : Bad magic number." ; - - errnum = psf->error ; - - if (errnum == SFE_SYSTEM && psf->syserr [0]) - return psf->syserr ; - } ; - - return sf_error_number (errnum) ; -} /* sf_strerror */ - -/*------------------------------------------------------------------------------ -*/ - -int -sf_error (SNDFILE *sndfile) -{ SF_PRIVATE *psf ; - - if (sndfile == NULL) - return sf_errno ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 0) ; - - if (psf->error) - return psf->error ; - - return 0 ; -} /* sf_error */ - -/*------------------------------------------------------------------------------ -*/ - -int -sf_perror (SNDFILE *sndfile) -{ SF_PRIVATE *psf ; - int errnum ; - - if (sndfile == NULL) - { errnum = sf_errno ; - } - else - { VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 0) ; - errnum = psf->error ; - } ; - - fprintf (stderr, "%s\n", sf_error_number (errnum)) ; - return SFE_NO_ERROR ; -} /* sf_perror */ - - -/*------------------------------------------------------------------------------ -*/ - -int -sf_error_str (SNDFILE *sndfile, char *str, size_t maxlen) -{ SF_PRIVATE *psf ; - int errnum ; - - if (str == NULL) - return SFE_INTERNAL ; - - if (sndfile == NULL) - errnum = sf_errno ; - else - { VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 0) ; - errnum = psf->error ; - } ; - - snprintf (str, maxlen, "%s", sf_error_number (errnum)) ; - - return SFE_NO_ERROR ; -} /* sf_error_str */ - -/*============================================================================== -*/ - -int -sf_format_check (const SF_INFO *info) -{ int subformat, endian ; - - subformat = SF_CODEC (info->format) ; - endian = SF_ENDIAN (info->format) ; - - /* This is the place where each file format can check if the suppiled - ** SF_INFO struct is valid. - ** Return 0 on failure, 1 ons success. - */ - - if (info->channels < 1 || info->channels > SF_MAX_CHANNELS) - return 0 ; - - if (info->samplerate < 0) - return 0 ; - - switch (SF_CONTAINER (info->format)) - { case SF_FORMAT_WAV : - /* WAV now allows both endian, RIFF or RIFX (little or big respectively) */ - if (subformat == SF_FORMAT_PCM_U8 || subformat == SF_FORMAT_PCM_16) - return 1 ; - if (subformat == SF_FORMAT_PCM_24 || subformat == SF_FORMAT_PCM_32) - return 1 ; - if ((subformat == SF_FORMAT_IMA_ADPCM || subformat == SF_FORMAT_MS_ADPCM) && info->channels <= 2) - return 1 ; - if (subformat == SF_FORMAT_GSM610 && info->channels == 1) - return 1 ; - if (subformat == SF_FORMAT_G721_32 && info->channels == 1) - return 1 ; - if (subformat == SF_FORMAT_ULAW || subformat == SF_FORMAT_ALAW) - return 1 ; - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - return 1 ; - break ; - - case SF_FORMAT_WAVEX : - if (endian == SF_ENDIAN_BIG || endian == SF_ENDIAN_CPU) - return 0 ; - if (subformat == SF_FORMAT_PCM_U8 || subformat == SF_FORMAT_PCM_16) - return 1 ; - if (subformat == SF_FORMAT_PCM_24 || subformat == SF_FORMAT_PCM_32) - return 1 ; - if (subformat == SF_FORMAT_ULAW || subformat == SF_FORMAT_ALAW) - return 1 ; - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - return 1 ; - break ; - - case SF_FORMAT_AIFF : - /* AIFF does allow both endian-nesses for PCM data.*/ - if (subformat == SF_FORMAT_PCM_16 || subformat == SF_FORMAT_PCM_24 || subformat == SF_FORMAT_PCM_32) - return 1 ; - /* For other encodings reject any endian-ness setting. */ - if (endian != 0) - return 0 ; - if (subformat == SF_FORMAT_PCM_U8 || subformat == SF_FORMAT_PCM_S8) - return 1 ; - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - return 1 ; - if (subformat == SF_FORMAT_ULAW || subformat == SF_FORMAT_ALAW) - return 1 ; - if ((subformat == SF_FORMAT_DWVW_12 || subformat == SF_FORMAT_DWVW_16 || - subformat == SF_FORMAT_DWVW_24) && info-> channels == 1) - return 1 ; - if (subformat == SF_FORMAT_GSM610 && info->channels == 1) - return 1 ; - if (subformat == SF_FORMAT_IMA_ADPCM && (info->channels == 1 || info->channels == 2)) - return 1 ; - break ; - - case SF_FORMAT_AU : - if (subformat == SF_FORMAT_PCM_S8 || subformat == SF_FORMAT_PCM_16) - return 1 ; - if (subformat == SF_FORMAT_PCM_24 || subformat == SF_FORMAT_PCM_32) - return 1 ; - if (subformat == SF_FORMAT_ULAW || subformat == SF_FORMAT_ALAW) - return 1 ; - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - return 1 ; - if (subformat == SF_FORMAT_G721_32 && info->channels == 1) - return 1 ; - if (subformat == SF_FORMAT_G723_24 && info->channels == 1) - return 1 ; - if (subformat == SF_FORMAT_G723_40 && info->channels == 1) - return 1 ; - break ; - - case SF_FORMAT_CAF : - if (subformat == SF_FORMAT_PCM_S8 || subformat == SF_FORMAT_PCM_16) - return 1 ; - if (subformat == SF_FORMAT_PCM_24 || subformat == SF_FORMAT_PCM_32) - return 1 ; - if (subformat == SF_FORMAT_ULAW || subformat == SF_FORMAT_ALAW) - return 1 ; - if (subformat == SF_FORMAT_ALAC_16 || subformat == SF_FORMAT_ALAC_20) - return 1 ; - if (subformat == SF_FORMAT_ALAC_24 || subformat == SF_FORMAT_ALAC_32) - return 1 ; - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - return 1 ; - break ; - - case SF_FORMAT_RAW : - if (subformat == SF_FORMAT_PCM_U8 || subformat == SF_FORMAT_PCM_S8 || subformat == SF_FORMAT_PCM_16) - return 1 ; - if (subformat == SF_FORMAT_PCM_24 || subformat == SF_FORMAT_PCM_32) - return 1 ; - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - return 1 ; - if (subformat == SF_FORMAT_ALAW || subformat == SF_FORMAT_ULAW) - return 1 ; - if ((subformat == SF_FORMAT_DWVW_12 || subformat == SF_FORMAT_DWVW_16 || - subformat == SF_FORMAT_DWVW_24) && info-> channels == 1) - return 1 ; - if (subformat == SF_FORMAT_GSM610 && info->channels == 1) - return 1 ; - if (subformat == SF_FORMAT_VOX_ADPCM && info->channels == 1) - return 1 ; - break ; - - case SF_FORMAT_PAF : - if (subformat == SF_FORMAT_PCM_S8 || subformat == SF_FORMAT_PCM_16 || subformat == SF_FORMAT_PCM_24) - return 1 ; - break ; - - case SF_FORMAT_SVX : - /* SVX only supports writing mono SVX files. */ - if (info->channels > 1) - return 0 ; - /* Always big endian. */ - if (endian == SF_ENDIAN_LITTLE || endian == SF_ENDIAN_CPU) - return 0 ; - - if (subformat == SF_FORMAT_PCM_S8 || subformat == SF_FORMAT_PCM_16) - return 1 ; - break ; - - case SF_FORMAT_NIST : - if (subformat == SF_FORMAT_PCM_S8 || subformat == SF_FORMAT_PCM_16) - return 1 ; - if (subformat == SF_FORMAT_PCM_24 || subformat == SF_FORMAT_PCM_32) - return 1 ; - if (subformat == SF_FORMAT_ULAW || subformat == SF_FORMAT_ALAW) - return 1 ; - break ; - - case SF_FORMAT_IRCAM : - if (subformat == SF_FORMAT_PCM_16 || subformat == SF_FORMAT_PCM_32) - return 1 ; - if (subformat == SF_FORMAT_ULAW || subformat == SF_FORMAT_ALAW || subformat == SF_FORMAT_FLOAT) - return 1 ; - break ; - - case SF_FORMAT_VOC : - /* VOC is strictly little endian. */ - if (endian == SF_ENDIAN_BIG || endian == SF_ENDIAN_CPU) - return 0 ; - if (subformat == SF_FORMAT_PCM_U8 || subformat == SF_FORMAT_PCM_16) - return 1 ; - if (subformat == SF_FORMAT_ULAW || subformat == SF_FORMAT_ALAW) - return 1 ; - break ; - - case SF_FORMAT_W64 : - /* W64 is strictly little endian. */ - if (endian == SF_ENDIAN_BIG || endian == SF_ENDIAN_CPU) - return 0 ; - if (subformat == SF_FORMAT_PCM_U8 || subformat == SF_FORMAT_PCM_16) - return 1 ; - if (subformat == SF_FORMAT_PCM_24 || subformat == SF_FORMAT_PCM_32) - return 1 ; - if ((subformat == SF_FORMAT_IMA_ADPCM || subformat == SF_FORMAT_MS_ADPCM) && info->channels <= 2) - return 1 ; - if (subformat == SF_FORMAT_GSM610 && info->channels == 1) - return 1 ; - if (subformat == SF_FORMAT_ULAW || subformat == SF_FORMAT_ALAW) - return 1 ; - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - return 1 ; - break ; - - case SF_FORMAT_MAT4 : - if (subformat == SF_FORMAT_PCM_16 || subformat == SF_FORMAT_PCM_32) - return 1 ; - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - return 1 ; - break ; - - case SF_FORMAT_MAT5 : - if (subformat == SF_FORMAT_PCM_U8 || subformat == SF_FORMAT_PCM_16 || subformat == SF_FORMAT_PCM_32) - return 1 ; - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - return 1 ; - break ; - - case SF_FORMAT_PVF : - if (subformat == SF_FORMAT_PCM_S8 || subformat == SF_FORMAT_PCM_16 || subformat == SF_FORMAT_PCM_32) - return 1 ; - break ; - - case SF_FORMAT_XI : - if (info->channels != 1) - return 0 ; - if (subformat == SF_FORMAT_DPCM_8 || subformat == SF_FORMAT_DPCM_16) - return 1 ; - break ; - - case SF_FORMAT_HTK : - /* HTK is strictly big endian. */ - if (endian == SF_ENDIAN_LITTLE || endian == SF_ENDIAN_CPU) - return 0 ; - if (info->channels != 1) - return 0 ; - if (subformat == SF_FORMAT_PCM_16) - return 1 ; - break ; - - case SF_FORMAT_SDS : - /* SDS is strictly big endian. */ - if (endian == SF_ENDIAN_LITTLE || endian == SF_ENDIAN_CPU) - return 0 ; - if (info->channels != 1) - return 0 ; - if (subformat == SF_FORMAT_PCM_S8 || subformat == SF_FORMAT_PCM_16 || subformat == SF_FORMAT_PCM_24) - return 1 ; - break ; - - case SF_FORMAT_AVR : - /* SDS is strictly big endian. */ - if (endian == SF_ENDIAN_LITTLE || endian == SF_ENDIAN_CPU) - return 0 ; - if (info->channels > 2) - return 0 ; - if (subformat == SF_FORMAT_PCM_U8 || subformat == SF_FORMAT_PCM_S8 || subformat == SF_FORMAT_PCM_16) - return 1 ; - break ; - - case SF_FORMAT_FLAC : - /* FLAC can't do more than 8 channels. */ - if (info->channels > 8) - return 0 ; - if (endian != SF_ENDIAN_FILE) - return 0 ; - if (subformat == SF_FORMAT_PCM_S8 || subformat == SF_FORMAT_PCM_16 || subformat == SF_FORMAT_PCM_24) - return 1 ; - break ; - - case SF_FORMAT_SD2 : - /* SD2 is strictly big endian. */ - if (endian == SF_ENDIAN_LITTLE || endian == SF_ENDIAN_CPU) - return 0 ; - if (subformat == SF_FORMAT_PCM_S8 || subformat == SF_FORMAT_PCM_16 || subformat == SF_FORMAT_PCM_24 || subformat == SF_FORMAT_PCM_32) - return 1 ; - break ; - - case SF_FORMAT_WVE : - /* WVE is strictly big endian. */ - if (endian == SF_ENDIAN_BIG || endian == SF_ENDIAN_CPU) - return 0 ; - if (info->channels > 1) - return 0 ; - if (subformat == SF_FORMAT_ALAW) - return 1 ; - break ; - - case SF_FORMAT_OGG : - if (endian != SF_ENDIAN_FILE) - return 0 ; - if (subformat == SF_FORMAT_VORBIS) - return 1 ; - break ; - - case SF_FORMAT_MPC2K : - /* MPC2000 is strictly little endian. */ - if (endian == SF_ENDIAN_BIG || endian == SF_ENDIAN_CPU) - return 0 ; - if (info->channels > 2) - return 0 ; - if (subformat == SF_FORMAT_PCM_16) - return 1 ; - break ; - - case SF_FORMAT_RF64 : - if (endian == SF_ENDIAN_BIG || endian == SF_ENDIAN_CPU) - return 0 ; - if (subformat == SF_FORMAT_PCM_U8 || subformat == SF_FORMAT_PCM_16) - return 1 ; - if (subformat == SF_FORMAT_PCM_24 || subformat == SF_FORMAT_PCM_32) - return 1 ; - if (subformat == SF_FORMAT_ULAW || subformat == SF_FORMAT_ALAW) - return 1 ; - if (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE) - return 1 ; - break ; - default : break ; - } ; - - return 0 ; -} /* sf_format_check */ - -/*------------------------------------------------------------------------------ -*/ - -const char * -sf_version_string (void) -{ -#if ENABLE_EXPERIMENTAL_CODE - return PACKAGE_NAME "-" PACKAGE_VERSION "-exp" ; -#else - return PACKAGE_NAME "-" PACKAGE_VERSION ; -#endif -} - - -/*------------------------------------------------------------------------------ -*/ - -int -sf_command (SNDFILE *sndfile, int command, void *data, int datasize) -{ SF_PRIVATE *psf = (SF_PRIVATE *) sndfile ; - double quality ; - int old_value ; - - /* This set of commands do not need the sndfile parameter. */ - switch (command) - { case SFC_GET_LIB_VERSION : - if (data == NULL) - { if (psf) - psf->error = SFE_BAD_COMMAND_PARAM ; - return SFE_BAD_COMMAND_PARAM ; - } ; - snprintf (data, datasize, "%s", sf_version_string ()) ; - return strlen (data) ; - - case SFC_GET_SIMPLE_FORMAT_COUNT : - if (data == NULL || datasize != SIGNED_SIZEOF (int)) - return (sf_errno = SFE_BAD_COMMAND_PARAM) ; - *((int*) data) = psf_get_format_simple_count () ; - return 0 ; - - case SFC_GET_SIMPLE_FORMAT : - if (data == NULL || datasize != SIGNED_SIZEOF (SF_FORMAT_INFO)) - return (sf_errno = SFE_BAD_COMMAND_PARAM) ; - return psf_get_format_simple (data) ; - - case SFC_GET_FORMAT_MAJOR_COUNT : - if (data == NULL || datasize != SIGNED_SIZEOF (int)) - return (sf_errno = SFE_BAD_COMMAND_PARAM) ; - *((int*) data) = psf_get_format_major_count () ; - return 0 ; - - case SFC_GET_FORMAT_MAJOR : - if (data == NULL || datasize != SIGNED_SIZEOF (SF_FORMAT_INFO)) - return (sf_errno = SFE_BAD_COMMAND_PARAM) ; - return psf_get_format_major (data) ; - - case SFC_GET_FORMAT_SUBTYPE_COUNT : - if (data == NULL || datasize != SIGNED_SIZEOF (int)) - return (sf_errno = SFE_BAD_COMMAND_PARAM) ; - *((int*) data) = psf_get_format_subtype_count () ; - return 0 ; - - case SFC_GET_FORMAT_SUBTYPE : - if (data == NULL || datasize != SIGNED_SIZEOF (SF_FORMAT_INFO)) - return (sf_errno = SFE_BAD_COMMAND_PARAM) ; - return psf_get_format_subtype (data) ; - - case SFC_GET_FORMAT_INFO : - if (data == NULL || datasize != SIGNED_SIZEOF (SF_FORMAT_INFO)) - return (sf_errno = SFE_BAD_COMMAND_PARAM) ; - return psf_get_format_info (data) ; - } ; - - if (sndfile == NULL && command == SFC_GET_LOG_INFO) - { if (data == NULL) - return (sf_errno = SFE_BAD_COMMAND_PARAM) ; - snprintf (data, datasize, "%s", sf_parselog) ; - return strlen (data) ; - } ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - switch (command) - { case SFC_SET_NORM_FLOAT : - old_value = psf->norm_float ; - psf->norm_float = (datasize) ? SF_TRUE : SF_FALSE ; - return old_value ; - - case SFC_GET_CURRENT_SF_INFO : - if (data == NULL || datasize != SIGNED_SIZEOF (SF_INFO)) - return (sf_errno = SFE_BAD_COMMAND_PARAM) ; - memcpy (data, &psf->sf, sizeof (SF_INFO)) ; - break ; - - case SFC_SET_NORM_DOUBLE : - old_value = psf->norm_double ; - psf->norm_double = (datasize) ? SF_TRUE : SF_FALSE ; - return old_value ; - - case SFC_GET_NORM_FLOAT : - return psf->norm_float ; - - case SFC_GET_NORM_DOUBLE : - return psf->norm_double ; - - case SFC_SET_SCALE_FLOAT_INT_READ : - old_value = psf->float_int_mult ; - - psf->float_int_mult = (datasize != 0) ? SF_TRUE : SF_FALSE ; - if (psf->float_int_mult && psf->float_max < 0.0) - psf->float_max = psf_calc_signal_max (psf, SF_FALSE) ; - return old_value ; - - case SFC_SET_SCALE_INT_FLOAT_WRITE : - old_value = psf->scale_int_float ; - psf->scale_int_float = (datasize != 0) ? SF_TRUE : SF_FALSE ; - return old_value ; - - case SFC_SET_ADD_PEAK_CHUNK : - { int format = SF_CONTAINER (psf->sf.format) ; - - /* Only WAV and AIFF support the PEAK chunk. */ - switch (format) - { case SF_FORMAT_AIFF : - case SF_FORMAT_CAF : - case SF_FORMAT_WAV : - case SF_FORMAT_WAVEX : - break ; - - default : - return SF_FALSE ; - } ; - - format = SF_CODEC (psf->sf.format) ; - - /* Only files containg the following data types support the PEAK chunk. */ - if (format != SF_FORMAT_FLOAT && format != SF_FORMAT_DOUBLE) - return SF_FALSE ; - - } ; - /* Can only do this is in SFM_WRITE mode. */ - if (psf->file.mode != SFM_WRITE && psf->file.mode != SFM_RDWR) - return SF_FALSE ; - /* If data has already been written this must fail. */ - if (psf->have_written) - { psf->error = SFE_CMD_HAS_DATA ; - return SF_FALSE ; - } ; - /* Everything seems OK, so set psf->has_peak and re-write header. */ - if (datasize == SF_FALSE && psf->peak_info != NULL) - { free (psf->peak_info) ; - psf->peak_info = NULL ; - } - else if (psf->peak_info == NULL) - { psf->peak_info = peak_info_calloc (psf->sf.channels) ; - if (psf->peak_info != NULL) - psf->peak_info->peak_loc = SF_PEAK_START ; - } ; - - if (psf->write_header) - psf->write_header (psf, SF_TRUE) ; - return datasize ; - - case SFC_SET_ADD_HEADER_PAD_CHUNK : - return SF_FALSE ; - - case SFC_GET_LOG_INFO : - if (data == NULL) - return SFE_BAD_COMMAND_PARAM ; - snprintf (data, datasize, "%s", psf->parselog.buf) ; - break ; - - case SFC_CALC_SIGNAL_MAX : - if (data == NULL || datasize != sizeof (double)) - return (psf->error = SFE_BAD_COMMAND_PARAM) ; - *((double*) data) = psf_calc_signal_max (psf, SF_FALSE) ; - break ; - - case SFC_CALC_NORM_SIGNAL_MAX : - if (data == NULL || datasize != sizeof (double)) - return (psf->error = SFE_BAD_COMMAND_PARAM) ; - *((double*) data) = psf_calc_signal_max (psf, SF_TRUE) ; - break ; - - case SFC_CALC_MAX_ALL_CHANNELS : - if (data == NULL || datasize != SIGNED_SIZEOF (double) * psf->sf.channels) - return (psf->error = SFE_BAD_COMMAND_PARAM) ; - return psf_calc_max_all_channels (psf, (double*) data, SF_FALSE) ; - - case SFC_CALC_NORM_MAX_ALL_CHANNELS : - if (data == NULL || datasize != SIGNED_SIZEOF (double) * psf->sf.channels) - return (psf->error = SFE_BAD_COMMAND_PARAM) ; - return psf_calc_max_all_channels (psf, (double*) data, SF_TRUE) ; - - case SFC_GET_SIGNAL_MAX : - if (data == NULL || datasize != sizeof (double)) - { psf->error = SFE_BAD_COMMAND_PARAM ; - return SF_FALSE ; - } ; - return psf_get_signal_max (psf, (double *) data) ; - - case SFC_GET_MAX_ALL_CHANNELS : - if (data == NULL || datasize != SIGNED_SIZEOF (double) * psf->sf.channels) - { psf->error = SFE_BAD_COMMAND_PARAM ; - return SF_FALSE ; - } ; - return psf_get_max_all_channels (psf, (double*) data) ; - - case SFC_UPDATE_HEADER_NOW : - if (psf->write_header) - psf->write_header (psf, SF_TRUE) ; - break ; - - case SFC_SET_UPDATE_HEADER_AUTO : - psf->auto_header = datasize ? SF_TRUE : SF_FALSE ; - return psf->auto_header ; - break ; - - case SFC_SET_ADD_DITHER_ON_WRITE : - case SFC_SET_ADD_DITHER_ON_READ : - /* - ** FIXME ! - ** These are obsolete. Just return. - ** Remove some time after version 1.0.8. - */ - break ; - - case SFC_SET_DITHER_ON_WRITE : - if (data == NULL || datasize != SIGNED_SIZEOF (SF_DITHER_INFO)) - return (psf->error = SFE_BAD_COMMAND_PARAM) ; - memcpy (&psf->write_dither, data, sizeof (psf->write_dither)) ; - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - dither_init (psf, SFM_WRITE) ; - break ; - - case SFC_SET_DITHER_ON_READ : - if (data == NULL || datasize != SIGNED_SIZEOF (SF_DITHER_INFO)) - return (psf->error = SFE_BAD_COMMAND_PARAM) ; - memcpy (&psf->read_dither, data, sizeof (psf->read_dither)) ; - if (psf->file.mode == SFM_READ || psf->file.mode == SFM_RDWR) - dither_init (psf, SFM_READ) ; - break ; - - case SFC_FILE_TRUNCATE : - if (psf->file.mode != SFM_WRITE && psf->file.mode != SFM_RDWR) - return SF_TRUE ; - if (datasize != sizeof (sf_count_t)) - return SF_TRUE ; - if (data == NULL || datasize != sizeof (sf_count_t)) - { psf->error = SFE_BAD_COMMAND_PARAM ; - return SF_FALSE ; - } - else - { sf_count_t position ; - - position = *((sf_count_t*) data) ; - - if (sf_seek (sndfile, position, SEEK_SET) != position) - return SF_TRUE ; - - psf->sf.frames = position ; - - position = psf_fseek (psf, 0, SEEK_CUR) ; - - return psf_ftruncate (psf, position) ; - } ; - break ; - - case SFC_SET_RAW_START_OFFSET : - if (data == NULL || datasize != sizeof (sf_count_t)) - return (psf->error = SFE_BAD_COMMAND_PARAM) ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_RAW) - return (psf->error = SFE_BAD_COMMAND_PARAM) ; - - psf->dataoffset = *((sf_count_t*) data) ; - sf_seek (sndfile, 0, SEEK_CUR) ; - break ; - - case SFC_GET_EMBED_FILE_INFO : - if (data == NULL || datasize != sizeof (SF_EMBED_FILE_INFO)) - return (psf->error = SFE_BAD_COMMAND_PARAM) ; - - ((SF_EMBED_FILE_INFO*) data)->offset = psf->fileoffset ; - ((SF_EMBED_FILE_INFO*) data)->length = psf->filelength ; - break ; - - /* Lite remove start */ - case SFC_TEST_IEEE_FLOAT_REPLACE : - psf->ieee_replace = (datasize) ? SF_TRUE : SF_FALSE ; - if ((SF_CODEC (psf->sf.format)) == SF_FORMAT_FLOAT) - float32_init (psf) ; - else if ((SF_CODEC (psf->sf.format)) == SF_FORMAT_DOUBLE) - double64_init (psf) ; - else - return (psf->error = SFE_BAD_COMMAND_PARAM) ; - break ; - /* Lite remove end */ - - case SFC_SET_CLIPPING : - psf->add_clipping = (datasize) ? SF_TRUE : SF_FALSE ; - return psf->add_clipping ; - - case SFC_GET_CLIPPING : - return psf->add_clipping ; - - case SFC_GET_LOOP_INFO : - if (datasize != sizeof (SF_LOOP_INFO) || data == NULL) - { psf->error = SFE_BAD_COMMAND_PARAM ; - return SF_FALSE ; - } ; - if (psf->loop_info == NULL) - return SF_FALSE ; - memcpy (data, psf->loop_info, sizeof (SF_LOOP_INFO)) ; - return SF_TRUE ; - - case SFC_SET_BROADCAST_INFO : - { int format = SF_CONTAINER (psf->sf.format) ; - - /* Only WAV and RF64 supports the BEXT (Broadcast) chunk. */ - if (format != SF_FORMAT_WAV && format != SF_FORMAT_WAVEX && format != SF_FORMAT_RF64) - return SF_FALSE ; - } ; - - /* Only makes sense in SFM_WRITE or SFM_RDWR mode. */ - if ((psf->file.mode != SFM_WRITE) && (psf->file.mode != SFM_RDWR)) - return SF_FALSE ; - /* If data has already been written this must fail. */ - if (psf->broadcast_16k == NULL && psf->have_written) - { psf->error = SFE_CMD_HAS_DATA ; - return SF_FALSE ; - } ; - - if (NOT (broadcast_var_set (psf, data, datasize))) - return SF_FALSE ; - - if (psf->write_header) - psf->write_header (psf, SF_TRUE) ; - return SF_TRUE ; - - case SFC_GET_BROADCAST_INFO : - if (data == NULL) - { psf->error = SFE_BAD_COMMAND_PARAM ; - return SF_FALSE ; - } ; - return broadcast_var_get (psf, data, datasize) ; - - case SFC_SET_CART_INFO : - { int format = SF_CONTAINER (psf->sf.format) ; - /* Only WAV and RF64 support cart chunk format */ - if (format != SF_FORMAT_WAV && format != SF_FORMAT_RF64) - return SF_FALSE ; - } ; - - /* Only makes sense in SFM_WRITE or SFM_RDWR mode */ - if ((psf->file.mode != SFM_WRITE) && (psf->file.mode != SFM_RDWR)) - return SF_FALSE ; - /* If data has already been written this must fail. */ - if (psf->cart_16k == NULL && psf->have_written) - { psf->error = SFE_CMD_HAS_DATA ; - return SF_FALSE ; - } ; - if (NOT (cart_var_set (psf, data, datasize))) - return SF_FALSE ; - if (psf->write_header) - psf->write_header (psf, SF_TRUE) ; - return SF_TRUE ; - - case SFC_GET_CART_INFO : - if (data == NULL) - { psf->error = SFE_BAD_COMMAND_PARAM ; - return SF_FALSE ; - } ; - return cart_var_get (psf, data, datasize) ; - - case SFC_GET_INSTRUMENT : - if (datasize != sizeof (SF_INSTRUMENT) || data == NULL) - { psf->error = SFE_BAD_COMMAND_PARAM ; - return SF_FALSE ; - } ; - if (psf->instrument == NULL) - return SF_FALSE ; - memcpy (data, psf->instrument, sizeof (SF_INSTRUMENT)) ; - return SF_TRUE ; - - case SFC_SET_INSTRUMENT : - /* If data has already been written this must fail. */ - if (psf->have_written) - { psf->error = SFE_CMD_HAS_DATA ; - return SF_FALSE ; - } ; - if (datasize != sizeof (SF_INSTRUMENT) || data == NULL) - { psf->error = SFE_BAD_COMMAND_PARAM ; - return SF_FALSE ; - } ; - - if (psf->instrument == NULL && (psf->instrument = psf_instrument_alloc ()) == NULL) - { psf->error = SFE_MALLOC_FAILED ; - return SF_FALSE ; - } ; - memcpy (psf->instrument, data, sizeof (SF_INSTRUMENT)) ; - return SF_TRUE ; - - case SFC_RAW_DATA_NEEDS_ENDSWAP : - return psf->data_endswap ; - - case SFC_GET_CHANNEL_MAP_INFO : - if (psf->channel_map == NULL) - return SF_FALSE ; - - if (data == NULL || datasize != SIGNED_SIZEOF (psf->channel_map [0]) * psf->sf.channels) - { psf->error = SFE_BAD_COMMAND_PARAM ; - return SF_FALSE ; - } ; - - memcpy (data, psf->channel_map, datasize) ; - return SF_TRUE ; - - case SFC_SET_CHANNEL_MAP_INFO : - if (psf->have_written) - { psf->error = SFE_CMD_HAS_DATA ; - return SF_FALSE ; - } ; - if (data == NULL || datasize != SIGNED_SIZEOF (psf->channel_map [0]) * psf->sf.channels) - { psf->error = SFE_BAD_COMMAND_PARAM ; - return SF_FALSE ; - } ; - - { int *iptr ; - - for (iptr = data ; iptr < (int*) data + psf->sf.channels ; iptr++) - { if (*iptr <= SF_CHANNEL_MAP_INVALID || *iptr >= SF_CHANNEL_MAP_MAX) - { psf->error = SFE_BAD_COMMAND_PARAM ; - return SF_FALSE ; - } ; - } ; - } ; - - free (psf->channel_map) ; - if ((psf->channel_map = malloc (datasize)) == NULL) - { psf->error = SFE_MALLOC_FAILED ; - return SF_FALSE ; - } ; - - memcpy (psf->channel_map, data, datasize) ; - - /* - ** Pass the command down to the container's command handler. - ** Don't pass user data, use validated psf->channel_map data instead. - */ - if (psf->command) - return psf->command (psf, command, NULL, 0) ; - return SF_FALSE ; - - case SFC_SET_VBR_ENCODING_QUALITY : - if (data == NULL || datasize != sizeof (double)) - return SF_FALSE ; - - quality = *((double *) data) ; - quality = 1.0 - SF_MAX (0.0, SF_MIN (1.0, quality)) ; - return sf_command (sndfile, SFC_SET_COMPRESSION_LEVEL, &quality, sizeof (quality)) ; - - - default : - /* Must be a file specific command. Pass it on. */ - if (psf->command) - return psf->command (psf, command, data, datasize) ; - - psf_log_printf (psf, "*** sf_command : cmd = 0x%X\n", command) ; - return (psf->error = SFE_BAD_COMMAND_PARAM) ; - } ; - - return 0 ; -} /* sf_command */ - -/*------------------------------------------------------------------------------ -*/ - -sf_count_t -sf_seek (SNDFILE *sndfile, sf_count_t offset, int whence) -{ SF_PRIVATE *psf ; - sf_count_t seek_from_start = 0, retval ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (! psf->sf.seekable) - { psf->error = SFE_NOT_SEEKABLE ; - return PSF_SEEK_ERROR ; - } ; - - /* If the whence parameter has a mode ORed in, check to see that - ** it makes sense. - */ - if (((whence & SFM_MASK) == SFM_WRITE && psf->file.mode == SFM_READ) || - ((whence & SFM_MASK) == SFM_READ && psf->file.mode == SFM_WRITE)) - { psf->error = SFE_WRONG_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - /* Convert all SEEK_CUR and SEEK_END into seek_from_start to be - ** used with SEEK_SET. - */ - switch (whence) - { /* The SEEK_SET behaviour is independant of mode. */ - case SEEK_SET : - case SEEK_SET | SFM_READ : - case SEEK_SET | SFM_WRITE : - case SEEK_SET | SFM_RDWR : - seek_from_start = offset ; - break ; - - /* The SEEK_CUR is a little more tricky. */ - case SEEK_CUR : - if (offset == 0) - { if (psf->file.mode == SFM_READ) - return psf->read_current ; - if (psf->file.mode == SFM_WRITE) - return psf->write_current ; - } ; - if (psf->file.mode == SFM_READ) - seek_from_start = psf->read_current + offset ; - else if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - seek_from_start = psf->write_current + offset ; - else - psf->error = SFE_AMBIGUOUS_SEEK ; - break ; - - case SEEK_CUR | SFM_READ : - if (offset == 0) - return psf->read_current ; - seek_from_start = psf->read_current + offset ; - break ; - - case SEEK_CUR | SFM_WRITE : - if (offset == 0) - return psf->write_current ; - seek_from_start = psf->write_current + offset ; - break ; - - /* The SEEK_END */ - case SEEK_END : - case SEEK_END | SFM_READ : - case SEEK_END | SFM_WRITE : - seek_from_start = psf->sf.frames + offset ; - break ; - - default : - psf->error = SFE_BAD_SEEK ; - break ; - } ; - - if (psf->error) - return PSF_SEEK_ERROR ; - - if (psf->file.mode == SFM_RDWR || psf->file.mode == SFM_WRITE) - { if (seek_from_start < 0) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - } - else if (seek_from_start < 0 || seek_from_start > psf->sf.frames) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - if (psf->seek) - { int new_mode = (whence & SFM_MASK) ? (whence & SFM_MASK) : psf->file.mode ; - - retval = psf->seek (psf, new_mode, seek_from_start) ; - - switch (new_mode) - { case SFM_READ : - psf->read_current = retval ; - break ; - case SFM_WRITE : - psf->write_current = retval ; - break ; - case SFM_RDWR : - psf->read_current = retval ; - psf->write_current = retval ; - new_mode = SFM_READ ; - break ; - } ; - - psf->last_op = new_mode ; - - return retval ; - } ; - - psf->error = SFE_AMBIGUOUS_SEEK ; - return PSF_SEEK_ERROR ; -} /* sf_seek */ - -/*------------------------------------------------------------------------------ -*/ - -const char* -sf_get_string (SNDFILE *sndfile, int str_type) -{ SF_PRIVATE *psf ; - - if ((psf = (SF_PRIVATE*) sndfile) == NULL) - return NULL ; - if (psf->Magick != SNDFILE_MAGICK) - return NULL ; - - return psf_get_string (psf, str_type) ; -} /* sf_get_string */ - -int -sf_set_string (SNDFILE *sndfile, int str_type, const char* str) -{ SF_PRIVATE *psf ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - return psf_set_string (psf, str_type, str) ; -} /* sf_get_string */ - -/*------------------------------------------------------------------------------ -*/ - -int -sf_current_byterate (SNDFILE *sndfile) -{ SF_PRIVATE *psf ; - - if ((psf = (SF_PRIVATE*) sndfile) == NULL) - return -1 ; - if (psf->Magick != SNDFILE_MAGICK) - return -1 ; - - /* This should cover all PCM and floating point formats. */ - if (psf->bytewidth) - return psf->sf.samplerate * psf->sf.channels * psf->bytewidth ; - - if (psf->byterate) - return psf->byterate (psf) ; - - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_IMA_ADPCM : - case SF_FORMAT_MS_ADPCM : - case SF_FORMAT_VOX_ADPCM : - return (psf->sf.samplerate * psf->sf.channels) / 2 ; - - case SF_FORMAT_GSM610 : - return (psf->sf.samplerate * psf->sf.channels * 13000) / 8000 ; - - case SF_FORMAT_G721_32 : /* 32kbs G721 ADPCM encoding. */ - return (psf->sf.samplerate * psf->sf.channels) / 2 ; - - case SF_FORMAT_G723_24 : /* 24kbs G723 ADPCM encoding. */ - return (psf->sf.samplerate * psf->sf.channels * 3) / 8 ; - - case SF_FORMAT_G723_40 : /* 40kbs G723 ADPCM encoding. */ - return (psf->sf.samplerate * psf->sf.channels * 5) / 8 ; - - default : - break ; - } ; - - return -1 ; -} /* sf_current_byterate */ - -/*============================================================================== -*/ - -sf_count_t -sf_read_raw (SNDFILE *sndfile, void *ptr, sf_count_t bytes) -{ SF_PRIVATE *psf ; - sf_count_t count, extra ; - int bytewidth, blockwidth ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - bytewidth = (psf->bytewidth > 0) ? psf->bytewidth : 1 ; - blockwidth = (psf->blockwidth > 0) ? psf->blockwidth : 1 ; - - if (psf->file.mode == SFM_WRITE) - { psf->error = SFE_NOT_READMODE ; - return 0 ; - } ; - - if (bytes < 0 || psf->read_current >= psf->sf.frames) - { psf_memset (ptr, 0, bytes) ; - return 0 ; - } ; - - if (bytes % (psf->sf.channels * bytewidth)) - { psf->error = SFE_BAD_READ_ALIGN ; - return 0 ; - } ; - - if (psf->last_op != SFM_READ) - if (psf->seek (psf, SFM_READ, psf->read_current) < 0) - return 0 ; - - count = psf_fread (ptr, 1, bytes, psf) ; - - if (psf->read_current + count / blockwidth <= psf->sf.frames) - psf->read_current += count / blockwidth ; - else - { count = (psf->sf.frames - psf->read_current) * blockwidth ; - extra = bytes - count ; - psf_memset (((char *) ptr) + count, 0, extra) ; - psf->read_current = psf->sf.frames ; - } ; - - psf->last_op = SFM_READ ; - - return count ; -} /* sf_read_raw */ - -/*------------------------------------------------------------------------------ -*/ - -sf_count_t -sf_read_short (SNDFILE *sndfile, short *ptr, sf_count_t len) -{ SF_PRIVATE *psf ; - sf_count_t count, extra ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_WRITE) - { psf->error = SFE_NOT_READMODE ; - return 0 ; - } ; - - if (len % psf->sf.channels) - { psf->error = SFE_BAD_READ_ALIGN ; - return 0 ; - } ; - - if (len <= 0 || psf->read_current >= psf->sf.frames) - { psf_memset (ptr, 0, len * sizeof (short)) ; - return 0 ; /* End of file. */ - } ; - - if (psf->read_short == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_READ) - if (psf->seek (psf, SFM_READ, psf->read_current) < 0) - return 0 ; - - count = psf->read_short (psf, ptr, len) ; - - if (psf->read_current + count / psf->sf.channels <= psf->sf.frames) - psf->read_current += count / psf->sf.channels ; - else - { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ; - extra = len - count ; - psf_memset (ptr + count, 0, extra * sizeof (short)) ; - psf->read_current = psf->sf.frames ; - } ; - - psf->last_op = SFM_READ ; - - return count ; -} /* sf_read_short */ - -sf_count_t -sf_readf_short (SNDFILE *sndfile, short *ptr, sf_count_t frames) -{ SF_PRIVATE *psf ; - sf_count_t count, extra ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_WRITE) - { psf->error = SFE_NOT_READMODE ; - return 0 ; - } ; - - if (frames <= 0 || psf->read_current >= psf->sf.frames) - { psf_memset (ptr, 0, frames * psf->sf.channels * sizeof (short)) ; - return 0 ; /* End of file. */ - } ; - - if (psf->read_short == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_READ) - if (psf->seek (psf, SFM_READ, psf->read_current) < 0) - return 0 ; - - count = psf->read_short (psf, ptr, frames * psf->sf.channels) ; - - if (psf->read_current + count / psf->sf.channels <= psf->sf.frames) - psf->read_current += count / psf->sf.channels ; - else - { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ; - extra = frames * psf->sf.channels - count ; - psf_memset (ptr + count, 0, extra * sizeof (short)) ; - psf->read_current = psf->sf.frames ; - } ; - - psf->last_op = SFM_READ ; - - return count / psf->sf.channels ; -} /* sf_readf_short */ - -/*------------------------------------------------------------------------------ -*/ - -sf_count_t -sf_read_int (SNDFILE *sndfile, int *ptr, sf_count_t len) -{ SF_PRIVATE *psf ; - sf_count_t count, extra ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_WRITE) - { psf->error = SFE_NOT_READMODE ; - return 0 ; - } ; - - if (len % psf->sf.channels) - { psf->error = SFE_BAD_READ_ALIGN ; - return 0 ; - } ; - - if (len <= 0 || psf->read_current >= psf->sf.frames) - { psf_memset (ptr, 0, len * sizeof (int)) ; - return 0 ; - } ; - - if (psf->read_int == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_READ) - if (psf->seek (psf, SFM_READ, psf->read_current) < 0) - return 0 ; - - count = psf->read_int (psf, ptr, len) ; - - if (psf->read_current + count / psf->sf.channels <= psf->sf.frames) - psf->read_current += count / psf->sf.channels ; - else - { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ; - extra = len - count ; - psf_memset (ptr + count, 0, extra * sizeof (int)) ; - psf->read_current = psf->sf.frames ; - } ; - - psf->last_op = SFM_READ ; - - return count ; -} /* sf_read_int */ - -sf_count_t -sf_readf_int (SNDFILE *sndfile, int *ptr, sf_count_t frames) -{ SF_PRIVATE *psf ; - sf_count_t count, extra ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_WRITE) - { psf->error = SFE_NOT_READMODE ; - return 0 ; - } ; - - if (frames <= 0 || psf->read_current >= psf->sf.frames) - { psf_memset (ptr, 0, frames * psf->sf.channels * sizeof (int)) ; - return 0 ; - } ; - - if (psf->read_int == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_READ) - if (psf->seek (psf, SFM_READ, psf->read_current) < 0) - return 0 ; - - count = psf->read_int (psf, ptr, frames * psf->sf.channels) ; - - if (psf->read_current + count / psf->sf.channels <= psf->sf.frames) - psf->read_current += count / psf->sf.channels ; - else - { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ; - extra = frames * psf->sf.channels - count ; - psf_memset (ptr + count, 0, extra * sizeof (int)) ; - psf->read_current = psf->sf.frames ; - } ; - - psf->last_op = SFM_READ ; - - return count / psf->sf.channels ; -} /* sf_readf_int */ - -/*------------------------------------------------------------------------------ -*/ - -sf_count_t -sf_read_float (SNDFILE *sndfile, float *ptr, sf_count_t len) -{ SF_PRIVATE *psf ; - sf_count_t count, extra ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_WRITE) - { psf->error = SFE_NOT_READMODE ; - return 0 ; - } ; - - if (len % psf->sf.channels) - { psf->error = SFE_BAD_READ_ALIGN ; - return 0 ; - } ; - - if (len <= 0 || psf->read_current >= psf->sf.frames) - { psf_memset (ptr, 0, len * sizeof (float)) ; - return 0 ; - } ; - - if (psf->read_float == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_READ) - if (psf->seek (psf, SFM_READ, psf->read_current) < 0) - return 0 ; - - count = psf->read_float (psf, ptr, len) ; - - if (psf->read_current + count / psf->sf.channels <= psf->sf.frames) - psf->read_current += count / psf->sf.channels ; - else - { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ; - extra = len - count ; - psf_memset (ptr + count, 0, extra * sizeof (float)) ; - psf->read_current = psf->sf.frames ; - } ; - - psf->last_op = SFM_READ ; - - return count ; -} /* sf_read_float */ - -sf_count_t -sf_readf_float (SNDFILE *sndfile, float *ptr, sf_count_t frames) -{ SF_PRIVATE *psf ; - sf_count_t count, extra ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_WRITE) - { psf->error = SFE_NOT_READMODE ; - return 0 ; - } ; - - if (frames <= 0 || psf->read_current >= psf->sf.frames) - { psf_memset (ptr, 0, frames * psf->sf.channels * sizeof (float)) ; - return 0 ; - } ; - - if (psf->read_float == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_READ) - if (psf->seek (psf, SFM_READ, psf->read_current) < 0) - return 0 ; - - count = psf->read_float (psf, ptr, frames * psf->sf.channels) ; - - if (psf->read_current + count / psf->sf.channels <= psf->sf.frames) - psf->read_current += count / psf->sf.channels ; - else - { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ; - extra = frames * psf->sf.channels - count ; - psf_memset (ptr + count, 0, extra * sizeof (float)) ; - psf->read_current = psf->sf.frames ; - } ; - - psf->last_op = SFM_READ ; - - return count / psf->sf.channels ; -} /* sf_readf_float */ - -/*------------------------------------------------------------------------------ -*/ - -sf_count_t -sf_read_double (SNDFILE *sndfile, double *ptr, sf_count_t len) -{ SF_PRIVATE *psf ; - sf_count_t count, extra ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_WRITE) - { psf->error = SFE_NOT_READMODE ; - return 0 ; - } ; - - if (len % psf->sf.channels) - { psf->error = SFE_BAD_READ_ALIGN ; - return 0 ; - } ; - - if (len <= 0 || psf->read_current >= psf->sf.frames) - { psf_memset (ptr, 0, len * sizeof (double)) ; - return 0 ; - } ; - - if (psf->read_double == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_READ) - if (psf->seek (psf, SFM_READ, psf->read_current) < 0) - return 0 ; - - count = psf->read_double (psf, ptr, len) ; - - if (psf->read_current + count / psf->sf.channels <= psf->sf.frames) - psf->read_current += count / psf->sf.channels ; - else - { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ; - extra = len - count ; - psf_memset (ptr + count, 0, extra * sizeof (double)) ; - psf->read_current = psf->sf.frames ; - } ; - - psf->last_op = SFM_READ ; - - return count ; -} /* sf_read_double */ - -sf_count_t -sf_readf_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) -{ SF_PRIVATE *psf ; - sf_count_t count, extra ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_WRITE) - { psf->error = SFE_NOT_READMODE ; - return 0 ; - } ; - - if (frames <= 0 || psf->read_current >= psf->sf.frames) - { psf_memset (ptr, 0, frames * psf->sf.channels * sizeof (double)) ; - return 0 ; - } ; - - if (psf->read_double == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_READ) - if (psf->seek (psf, SFM_READ, psf->read_current) < 0) - return 0 ; - - count = psf->read_double (psf, ptr, frames * psf->sf.channels) ; - - if (psf->read_current + count / psf->sf.channels <= psf->sf.frames) - psf->read_current += count / psf->sf.channels ; - else - { count = (psf->sf.frames - psf->read_current) * psf->sf.channels ; - extra = frames * psf->sf.channels - count ; - psf_memset (ptr + count, 0, extra * sizeof (double)) ; - psf->read_current = psf->sf.frames ; - } ; - - psf->last_op = SFM_READ ; - - return count / psf->sf.channels ; -} /* sf_readf_double */ - -/*------------------------------------------------------------------------------ -*/ - -sf_count_t -sf_write_raw (SNDFILE *sndfile, const void *ptr, sf_count_t len) -{ SF_PRIVATE *psf ; - sf_count_t count ; - int bytewidth, blockwidth ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - bytewidth = (psf->bytewidth > 0) ? psf->bytewidth : 1 ; - blockwidth = (psf->blockwidth > 0) ? psf->blockwidth : 1 ; - - if (psf->file.mode == SFM_READ) - { psf->error = SFE_NOT_WRITEMODE ; - return 0 ; - } ; - - if (len % (psf->sf.channels * bytewidth)) - { psf->error = SFE_BAD_WRITE_ALIGN ; - return 0 ; - } ; - - if (psf->last_op != SFM_WRITE) - if (psf->seek (psf, SFM_WRITE, psf->write_current) < 0) - return 0 ; - - if (psf->have_written == SF_FALSE && psf->write_header != NULL) - psf->write_header (psf, SF_FALSE) ; - psf->have_written = SF_TRUE ; - - count = psf_fwrite (ptr, 1, len, psf) ; - - psf->write_current += count / blockwidth ; - - psf->last_op = SFM_WRITE ; - - if (psf->write_current > psf->sf.frames) - { psf->sf.frames = psf->write_current ; - psf->dataend = 0 ; - } ; - - if (psf->auto_header && psf->write_header != NULL) - psf->write_header (psf, SF_TRUE) ; - - return count ; -} /* sf_write_raw */ - -/*------------------------------------------------------------------------------ -*/ - -sf_count_t -sf_write_short (SNDFILE *sndfile, const short *ptr, sf_count_t len) -{ SF_PRIVATE *psf ; - sf_count_t count ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_READ) - { psf->error = SFE_NOT_WRITEMODE ; - return 0 ; - } ; - - if (len % psf->sf.channels) - { psf->error = SFE_BAD_WRITE_ALIGN ; - return 0 ; - } ; - - if (psf->write_short == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_WRITE) - if (psf->seek (psf, SFM_WRITE, psf->write_current) < 0) - return 0 ; - - if (psf->have_written == SF_FALSE && psf->write_header != NULL) - psf->write_header (psf, SF_FALSE) ; - psf->have_written = SF_TRUE ; - - count = psf->write_short (psf, ptr, len) ; - - psf->write_current += count / psf->sf.channels ; - - psf->last_op = SFM_WRITE ; - - if (psf->write_current > psf->sf.frames) - { psf->sf.frames = psf->write_current ; - psf->dataend = 0 ; - } ; - - if (psf->auto_header && psf->write_header != NULL) - psf->write_header (psf, SF_TRUE) ; - - return count ; -} /* sf_write_short */ - -sf_count_t -sf_writef_short (SNDFILE *sndfile, const short *ptr, sf_count_t frames) -{ SF_PRIVATE *psf ; - sf_count_t count ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_READ) - { psf->error = SFE_NOT_WRITEMODE ; - return 0 ; - } ; - - if (psf->write_short == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_WRITE) - if (psf->seek (psf, SFM_WRITE, psf->write_current) < 0) - return 0 ; - - if (psf->have_written == SF_FALSE && psf->write_header != NULL) - psf->write_header (psf, SF_FALSE) ; - psf->have_written = SF_TRUE ; - - count = psf->write_short (psf, ptr, frames * psf->sf.channels) ; - - psf->write_current += count / psf->sf.channels ; - - psf->last_op = SFM_WRITE ; - - if (psf->write_current > psf->sf.frames) - { psf->sf.frames = psf->write_current ; - psf->dataend = 0 ; - } ; - - if (psf->auto_header && psf->write_header != NULL) - psf->write_header (psf, SF_TRUE) ; - - return count / psf->sf.channels ; -} /* sf_writef_short */ - -/*------------------------------------------------------------------------------ -*/ - -sf_count_t -sf_write_int (SNDFILE *sndfile, const int *ptr, sf_count_t len) -{ SF_PRIVATE *psf ; - sf_count_t count ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_READ) - { psf->error = SFE_NOT_WRITEMODE ; - return 0 ; - } ; - - if (len % psf->sf.channels) - { psf->error = SFE_BAD_WRITE_ALIGN ; - return 0 ; - } ; - - if (psf->write_int == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_WRITE) - if (psf->seek (psf, SFM_WRITE, psf->write_current) < 0) - return 0 ; - - if (psf->have_written == SF_FALSE && psf->write_header != NULL) - psf->write_header (psf, SF_FALSE) ; - psf->have_written = SF_TRUE ; - - count = psf->write_int (psf, ptr, len) ; - - psf->write_current += count / psf->sf.channels ; - - psf->last_op = SFM_WRITE ; - - if (psf->write_current > psf->sf.frames) - { psf->sf.frames = psf->write_current ; - psf->dataend = 0 ; - } ; - - if (psf->auto_header && psf->write_header != NULL) - psf->write_header (psf, SF_TRUE) ; - - return count ; -} /* sf_write_int */ - -sf_count_t -sf_writef_int (SNDFILE *sndfile, const int *ptr, sf_count_t frames) -{ SF_PRIVATE *psf ; - sf_count_t count ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_READ) - { psf->error = SFE_NOT_WRITEMODE ; - return 0 ; - } ; - - if (psf->write_int == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_WRITE) - if (psf->seek (psf, SFM_WRITE, psf->write_current) < 0) - return 0 ; - - if (psf->have_written == SF_FALSE && psf->write_header != NULL) - psf->write_header (psf, SF_FALSE) ; - psf->have_written = SF_TRUE ; - - count = psf->write_int (psf, ptr, frames * psf->sf.channels) ; - - psf->write_current += count / psf->sf.channels ; - - psf->last_op = SFM_WRITE ; - - if (psf->write_current > psf->sf.frames) - { psf->sf.frames = psf->write_current ; - psf->dataend = 0 ; - } ; - - if (psf->auto_header && psf->write_header != NULL) - psf->write_header (psf, SF_TRUE) ; - - return count / psf->sf.channels ; -} /* sf_writef_int */ - -/*------------------------------------------------------------------------------ -*/ - -sf_count_t -sf_write_float (SNDFILE *sndfile, const float *ptr, sf_count_t len) -{ SF_PRIVATE *psf ; - sf_count_t count ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_READ) - { psf->error = SFE_NOT_WRITEMODE ; - return 0 ; - } ; - - if (len % psf->sf.channels) - { psf->error = SFE_BAD_WRITE_ALIGN ; - return 0 ; - } ; - - if (psf->write_float == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_WRITE) - if (psf->seek (psf, SFM_WRITE, psf->write_current) < 0) - return 0 ; - - if (psf->have_written == SF_FALSE && psf->write_header != NULL) - psf->write_header (psf, SF_FALSE) ; - psf->have_written = SF_TRUE ; - - count = psf->write_float (psf, ptr, len) ; - - psf->write_current += count / psf->sf.channels ; - - psf->last_op = SFM_WRITE ; - - if (psf->write_current > psf->sf.frames) - { psf->sf.frames = psf->write_current ; - psf->dataend = 0 ; - } ; - - if (psf->auto_header && psf->write_header != NULL) - psf->write_header (psf, SF_TRUE) ; - - return count ; -} /* sf_write_float */ - -sf_count_t -sf_writef_float (SNDFILE *sndfile, const float *ptr, sf_count_t frames) -{ SF_PRIVATE *psf ; - sf_count_t count ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_READ) - { psf->error = SFE_NOT_WRITEMODE ; - return 0 ; - } ; - - if (psf->write_float == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_WRITE) - if (psf->seek (psf, SFM_WRITE, psf->write_current) < 0) - return 0 ; - - if (psf->have_written == SF_FALSE && psf->write_header != NULL) - psf->write_header (psf, SF_FALSE) ; - psf->have_written = SF_TRUE ; - - count = psf->write_float (psf, ptr, frames * psf->sf.channels) ; - - psf->write_current += count / psf->sf.channels ; - - psf->last_op = SFM_WRITE ; - - if (psf->write_current > psf->sf.frames) - { psf->sf.frames = psf->write_current ; - psf->dataend = 0 ; - } ; - - if (psf->auto_header && psf->write_header != NULL) - psf->write_header (psf, SF_TRUE) ; - - return count / psf->sf.channels ; -} /* sf_writef_float */ - -/*------------------------------------------------------------------------------ -*/ - -sf_count_t -sf_write_double (SNDFILE *sndfile, const double *ptr, sf_count_t len) -{ SF_PRIVATE *psf ; - sf_count_t count ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_READ) - { psf->error = SFE_NOT_WRITEMODE ; - return 0 ; - } ; - - if (len % psf->sf.channels) - { psf->error = SFE_BAD_WRITE_ALIGN ; - return 0 ; - } ; - - if (psf->write_double == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_WRITE) - if (psf->seek (psf, SFM_WRITE, psf->write_current) < 0) - return 0 ; - - if (psf->have_written == SF_FALSE && psf->write_header != NULL) - psf->write_header (psf, SF_FALSE) ; - psf->have_written = SF_TRUE ; - - count = psf->write_double (psf, ptr, len) ; - - psf->write_current += count / psf->sf.channels ; - - psf->last_op = SFM_WRITE ; - - if (psf->write_current > psf->sf.frames) - { psf->sf.frames = psf->write_current ; - psf->dataend = 0 ; - } ; - - if (psf->auto_header && psf->write_header != NULL) - psf->write_header (psf, SF_TRUE) ; - - return count ; -} /* sf_write_double */ - -sf_count_t -sf_writef_double (SNDFILE *sndfile, const double *ptr, sf_count_t frames) -{ SF_PRIVATE *psf ; - sf_count_t count ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->file.mode == SFM_READ) - { psf->error = SFE_NOT_WRITEMODE ; - return 0 ; - } ; - - if (psf->write_double == NULL || psf->seek == NULL) - { psf->error = SFE_UNIMPLEMENTED ; - return 0 ; - } ; - - if (psf->last_op != SFM_WRITE) - if (psf->seek (psf, SFM_WRITE, psf->write_current) < 0) - return 0 ; - - if (psf->have_written == SF_FALSE && psf->write_header != NULL) - psf->write_header (psf, SF_FALSE) ; - psf->have_written = SF_TRUE ; - - count = psf->write_double (psf, ptr, frames * psf->sf.channels) ; - - psf->write_current += count / psf->sf.channels ; - - psf->last_op = SFM_WRITE ; - - if (psf->write_current > psf->sf.frames) - { psf->sf.frames = psf->write_current ; - psf->dataend = 0 ; - } ; - - if (psf->auto_header && psf->write_header != NULL) - psf->write_header (psf, SF_TRUE) ; - - return count / psf->sf.channels ; -} /* sf_writef_double */ - -/*========================================================================= -** Private functions. -*/ - -static int -try_resource_fork (SF_PRIVATE * psf) -{ int old_error = psf->error ; - - /* Set READ mode now, to see if resource fork exists. */ - psf->rsrc.mode = SFM_READ ; - if (psf_open_rsrc (psf) != 0) - { psf->error = old_error ; - return 0 ; - } ; - - /* More checking here. */ - psf_log_printf (psf, "Resource fork : %s\n", psf->rsrc.path.c) ; - - return SF_FORMAT_SD2 ; -} /* try_resource_fork */ - -static int -format_from_extension (SF_PRIVATE *psf) -{ char *cptr ; - char buffer [16] ; - int format = 0 ; - - if ((cptr = strrchr (psf->file.name.c, '.')) == NULL) - return 0 ; - - cptr ++ ; - if (strlen (cptr) > sizeof (buffer) - 1) - return 0 ; - - psf_strlcpy (buffer, sizeof (buffer), cptr) ; - buffer [sizeof (buffer) - 1] = 0 ; - - /* Convert everything in the buffer to lower case. */ - cptr = buffer ; - while (*cptr) - { *cptr = tolower (*cptr) ; - cptr ++ ; - } ; - - cptr = buffer ; - - if (strcmp (cptr, "au") == 0) - { psf->sf.channels = 1 ; - psf->sf.samplerate = 8000 ; - format = SF_FORMAT_RAW | SF_FORMAT_ULAW ; - } - else if (strcmp (cptr, "snd") == 0) - { psf->sf.channels = 1 ; - psf->sf.samplerate = 8000 ; - format = SF_FORMAT_RAW | SF_FORMAT_ULAW ; - } - - else if (strcmp (cptr, "vox") == 0 || strcmp (cptr, "vox8") == 0) - { psf->sf.channels = 1 ; - psf->sf.samplerate = 8000 ; - format = SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM ; - } - else if (strcmp (cptr, "vox6") == 0) - { psf->sf.channels = 1 ; - psf->sf.samplerate = 6000 ; - format = SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM ; - } - else if (strcmp (cptr, "gsm") == 0) - { psf->sf.channels = 1 ; - psf->sf.samplerate = 8000 ; - format = SF_FORMAT_RAW | SF_FORMAT_GSM610 ; - } - - /* For RAW files, make sure the dataoffset if set correctly. */ - if ((SF_CONTAINER (format)) == SF_FORMAT_RAW) - psf->dataoffset = 0 ; - - return format ; -} /* format_from_extension */ - -static int -guess_file_type (SF_PRIVATE *psf) -{ uint32_t buffer [3], format ; - - if (psf_binheader_readf (psf, "b", &buffer, SIGNED_SIZEOF (buffer)) != SIGNED_SIZEOF (buffer)) - { psf->error = SFE_BAD_FILE_READ ; - return 0 ; - } ; - - if ((buffer [0] == MAKE_MARKER ('R', 'I', 'F', 'F') || buffer [0] == MAKE_MARKER ('R', 'I', 'F', 'X')) - && buffer [2] == MAKE_MARKER ('W', 'A', 'V', 'E')) - return SF_FORMAT_WAV ; - - if (buffer [0] == MAKE_MARKER ('F', 'O', 'R', 'M')) - { if (buffer [2] == MAKE_MARKER ('A', 'I', 'F', 'F') || buffer [2] == MAKE_MARKER ('A', 'I', 'F', 'C')) - return SF_FORMAT_AIFF ; - if (buffer [2] == MAKE_MARKER ('8', 'S', 'V', 'X') || buffer [2] == MAKE_MARKER ('1', '6', 'S', 'V')) - return SF_FORMAT_SVX ; - return 0 ; - } ; - - if (buffer [0] == MAKE_MARKER ('.', 's', 'n', 'd') || buffer [0] == MAKE_MARKER ('d', 'n', 's', '.')) - return SF_FORMAT_AU ; - - if ((buffer [0] == MAKE_MARKER ('f', 'a', 'p', ' ') || buffer [0] == MAKE_MARKER (' ', 'p', 'a', 'f'))) - return SF_FORMAT_PAF ; - - if (buffer [0] == MAKE_MARKER ('N', 'I', 'S', 'T')) - return SF_FORMAT_NIST ; - - if (buffer [0] == MAKE_MARKER ('C', 'r', 'e', 'a') && buffer [1] == MAKE_MARKER ('t', 'i', 'v', 'e')) - return SF_FORMAT_VOC ; - - if ((buffer [0] & MAKE_MARKER (0xFF, 0xFF, 0xF8, 0xFF)) == MAKE_MARKER (0x64, 0xA3, 0x00, 0x00) || - (buffer [0] & MAKE_MARKER (0xFF, 0xF8, 0xFF, 0xFF)) == MAKE_MARKER (0x00, 0x00, 0xA3, 0x64)) - return SF_FORMAT_IRCAM ; - - if (buffer [0] == MAKE_MARKER ('r', 'i', 'f', 'f')) - return SF_FORMAT_W64 ; - - if (buffer [0] == MAKE_MARKER (0, 0, 0x03, 0xE8) && buffer [1] == MAKE_MARKER (0, 0, 0, 1) && - buffer [2] == MAKE_MARKER (0, 0, 0, 1)) - return SF_FORMAT_MAT4 ; - - if (buffer [0] == MAKE_MARKER (0, 0, 0, 0) && buffer [1] == MAKE_MARKER (1, 0, 0, 0) && - buffer [2] == MAKE_MARKER (1, 0, 0, 0)) - return SF_FORMAT_MAT4 ; - - if (buffer [0] == MAKE_MARKER ('M', 'A', 'T', 'L') && buffer [1] == MAKE_MARKER ('A', 'B', ' ', '5')) - return SF_FORMAT_MAT5 ; - - if (buffer [0] == MAKE_MARKER ('P', 'V', 'F', '1')) - return SF_FORMAT_PVF ; - - if (buffer [0] == MAKE_MARKER ('E', 'x', 't', 'e') && buffer [1] == MAKE_MARKER ('n', 'd', 'e', 'd') && - buffer [2] == MAKE_MARKER (' ', 'I', 'n', 's')) - return SF_FORMAT_XI ; - - if (buffer [0] == MAKE_MARKER ('c', 'a', 'f', 'f') && buffer [2] == MAKE_MARKER ('d', 'e', 's', 'c')) - return SF_FORMAT_CAF ; - - if (buffer [0] == MAKE_MARKER ('O', 'g', 'g', 'S')) - return SF_FORMAT_OGG ; - - if (buffer [0] == MAKE_MARKER ('A', 'L', 'a', 'w') && buffer [1] == MAKE_MARKER ('S', 'o', 'u', 'n') - && buffer [2] == MAKE_MARKER ('d', 'F', 'i', 'l')) - return SF_FORMAT_WVE ; - - if (buffer [0] == MAKE_MARKER ('D', 'i', 'a', 'm') && buffer [1] == MAKE_MARKER ('o', 'n', 'd', 'W') - && buffer [2] == MAKE_MARKER ('a', 'r', 'e', ' ')) - return SF_FORMAT_DWD ; - - if (buffer [0] == MAKE_MARKER ('L', 'M', '8', '9') || buffer [0] == MAKE_MARKER ('5', '3', 0, 0)) - return SF_FORMAT_TXW ; - - if ((buffer [0] & MAKE_MARKER (0xFF, 0xFF, 0x80, 0xFF)) == MAKE_MARKER (0xF0, 0x7E, 0, 0x01)) - return SF_FORMAT_SDS ; - - if ((buffer [0] & MAKE_MARKER (0xFF, 0xFF, 0, 0)) == MAKE_MARKER (1, 4, 0, 0)) - return SF_FORMAT_MPC2K ; - - if (buffer [0] == MAKE_MARKER ('C', 'A', 'T', ' ') && buffer [2] == MAKE_MARKER ('R', 'E', 'X', '2')) - return SF_FORMAT_REX2 ; - - if (buffer [0] == MAKE_MARKER (0x30, 0x26, 0xB2, 0x75) && buffer [1] == MAKE_MARKER (0x8E, 0x66, 0xCF, 0x11)) - return 0 /*-SF_FORMAT_WMA-*/ ; - - /* HMM (Hidden Markov Model) Tool Kit. */ - if (2 * BE2H_32 (buffer [0]) + 12 == psf->filelength && buffer [2] == MAKE_MARKER (0, 2, 0, 0)) - return SF_FORMAT_HTK ; - - if (buffer [0] == MAKE_MARKER ('f', 'L', 'a', 'C')) - return SF_FORMAT_FLAC ; - - if (buffer [0] == MAKE_MARKER ('2', 'B', 'I', 'T')) - return SF_FORMAT_AVR ; - - if (buffer [0] == MAKE_MARKER ('R', 'F', '6', '4') && buffer [2] == MAKE_MARKER ('W', 'A', 'V', 'E')) - return SF_FORMAT_RF64 ; - - if (buffer [0] == MAKE_MARKER ('I', 'D', '3', 3)) - { psf_log_printf (psf, "Found 'ID3' marker.\n") ; - if (id3_skip (psf)) - return guess_file_type (psf) ; - return 0 ; - } ; - - /* Turtle Beach SMP 16-bit */ - if (buffer [0] == MAKE_MARKER ('S', 'O', 'U', 'N') && buffer [1] == MAKE_MARKER ('D', ' ', 'S', 'A')) - return 0 ; - - /* Yamaha sampler format. */ - if (buffer [0] == MAKE_MARKER ('S', 'Y', '8', '0') || buffer [0] == MAKE_MARKER ('S', 'Y', '8', '5')) - return 0 ; - - if (buffer [0] == MAKE_MARKER ('a', 'j', 'k', 'g')) - return 0 /*-SF_FORMAT_SHN-*/ ; - - /* This must be the last one. */ - if (psf->filelength > 0 && (format = try_resource_fork (psf)) != 0) - return format ; - - return 0 ; -} /* guess_file_type */ - - -static int -validate_sfinfo (SF_INFO *sfinfo) -{ if (sfinfo->samplerate < 1) - return 0 ; - if (sfinfo->frames < 0) - return 0 ; - if (sfinfo->channels < 1) - return 0 ; - if ((SF_CONTAINER (sfinfo->format)) == 0) - return 0 ; - if ((SF_CODEC (sfinfo->format)) == 0) - return 0 ; - if (sfinfo->sections < 1) - return 0 ; - return 1 ; -} /* validate_sfinfo */ - -static int -validate_psf (SF_PRIVATE *psf) -{ - if (psf->datalength < 0) - { psf_log_printf (psf, "Invalid SF_PRIVATE field : datalength == %D.\n", psf->datalength) ; - return 0 ; - } ; - if (psf->dataoffset < 0) - { psf_log_printf (psf, "Invalid SF_PRIVATE field : dataoffset == %D.\n", psf->dataoffset) ; - return 0 ; - } ; - if (psf->blockwidth && psf->blockwidth != psf->sf.channels * psf->bytewidth) - { psf_log_printf (psf, "Invalid SF_PRIVATE field : channels * bytewidth == %d.\n", - psf->sf.channels * psf->bytewidth) ; - return 0 ; - } ; - return 1 ; -} /* validate_psf */ - -static void -save_header_info (SF_PRIVATE *psf) -{ snprintf (sf_parselog, sizeof (sf_parselog), "%s", psf->parselog.buf) ; -} /* save_header_info */ - -static void -copy_filename (SF_PRIVATE *psf, const char *path) -{ const char *ccptr ; - char *cptr ; - - snprintf (psf->file.path.c, sizeof (psf->file.path.c), "%s", path) ; - if ((ccptr = strrchr (path, '/')) || (ccptr = strrchr (path, '\\'))) - ccptr ++ ; - else - ccptr = path ; - - snprintf (psf->file.name.c, sizeof (psf->file.name.c), "%s", ccptr) ; - - /* Now grab the directory. */ - snprintf (psf->file.dir.c, sizeof (psf->file.dir.c), "%s", path) ; - if ((cptr = strrchr (psf->file.dir.c, '/')) || (cptr = strrchr (psf->file.dir.c, '\\'))) - cptr [1] = 0 ; - else - psf->file.dir.c [0] = 0 ; - - return ; -} /* copy_filename */ - -/*============================================================================== -*/ - -static int -psf_close (SF_PRIVATE *psf) -{ uint32_t k ; - int error = 0 ; - - if (psf->codec_close) - { error = psf->codec_close (psf) ; - /* To prevent it being called in psf->container_close(). */ - psf->codec_close = NULL ; - } ; - - if (psf->container_close) - error = psf->container_close (psf) ; - - error = psf_fclose (psf) ; - psf_close_rsrc (psf) ; - - /* For an ISO C compliant implementation it is ok to free a NULL pointer. */ - free (psf->container_data) ; - free (psf->codec_data) ; - free (psf->interleave) ; - free (psf->dither) ; - free (psf->peak_info) ; - free (psf->broadcast_16k) ; - free (psf->loop_info) ; - free (psf->instrument) ; - free (psf->channel_map) ; - free (psf->format_desc) ; - free (psf->strings.storage) ; - - if (psf->wchunks.chunks) - for (k = 0 ; k < psf->wchunks.used ; k++) - free (psf->wchunks.chunks [k].data) ; - free (psf->rchunks.chunks) ; - free (psf->wchunks.chunks) ; - free (psf->iterator) ; - free (psf->cart_16k) ; - - memset (psf, 0, sizeof (SF_PRIVATE)) ; - free (psf) ; - - return error ; -} /* psf_close */ - -SNDFILE * -psf_open_file (SF_PRIVATE *psf, SF_INFO *sfinfo) -{ int error, format ; - - sf_errno = error = 0 ; - sf_parselog [0] = 0 ; - - if (psf->error) - { error = psf->error ; - goto error_exit ; - } ; - - if (psf->file.mode != SFM_READ && psf->file.mode != SFM_WRITE && psf->file.mode != SFM_RDWR) - { error = SFE_BAD_OPEN_MODE ; - goto error_exit ; - } ; - - if (sfinfo == NULL) - { error = SFE_BAD_SF_INFO_PTR ; - goto error_exit ; - } ; - - /* Zero out these fields. */ - sfinfo->frames = 0 ; - sfinfo->sections = 0 ; - sfinfo->seekable = 0 ; - - if (psf->file.mode == SFM_READ) - { if ((SF_CONTAINER (sfinfo->format)) == SF_FORMAT_RAW) - { if (sf_format_check (sfinfo) == 0) - { error = SFE_RAW_BAD_FORMAT ; - goto error_exit ; - } ; - } - else - memset (sfinfo, 0, sizeof (SF_INFO)) ; - } ; - - memcpy (&psf->sf, sfinfo, sizeof (SF_INFO)) ; - - psf->Magick = SNDFILE_MAGICK ; - psf->norm_float = SF_TRUE ; - psf->norm_double = SF_TRUE ; - psf->dataoffset = -1 ; - psf->datalength = -1 ; - psf->read_current = -1 ; - psf->write_current = -1 ; - psf->auto_header = SF_FALSE ; - psf->rwf_endian = SF_ENDIAN_LITTLE ; - psf->seek = psf_default_seek ; - psf->float_int_mult = 0 ; - psf->float_max = -1.0 ; - - /* An attempt at a per SF_PRIVATE unique id. */ - psf->unique_id = psf_rand_int32 () ; - - psf->sf.sections = 1 ; - - psf->is_pipe = psf_is_pipe (psf) ; - - if (psf->is_pipe) - { psf->sf.seekable = SF_FALSE ; - psf->filelength = SF_COUNT_MAX ; - } - else - { psf->sf.seekable = SF_TRUE ; - - /* File is open, so get the length. */ - psf->filelength = psf_get_filelen (psf) ; - } ; - - if (psf->fileoffset > 0) - { switch (psf->file.mode) - { case SFM_READ : - if (psf->filelength < 44) - { psf_log_printf (psf, "Short filelength: %D (fileoffset: %D)\n", psf->filelength, psf->fileoffset) ; - error = SFE_BAD_OFFSET ; - goto error_exit ; - } ; - break ; - - case SFM_WRITE : - psf->fileoffset = 0 ; - psf_fseek (psf, 0, SEEK_END) ; - psf->fileoffset = psf_ftell (psf) ; - break ; - - case SFM_RDWR : - error = SFE_NO_EMBEDDED_RDWR ; - goto error_exit ; - } ; - - psf_log_printf (psf, "Embedded file offset : %D\n", psf->fileoffset) ; - } ; - - if (psf->filelength == SF_COUNT_MAX) - psf_log_printf (psf, "Length : unknown\n") ; - else - psf_log_printf (psf, "Length : %D\n", psf->filelength) ; - - if (psf->file.mode == SFM_WRITE || (psf->file.mode == SFM_RDWR && psf->filelength == 0)) - { /* If the file is being opened for write or RDWR and the file is currently - ** empty, then the SF_INFO struct must contain valid data. - */ - if ((SF_CONTAINER (psf->sf.format)) == 0) - { error = SFE_ZERO_MAJOR_FORMAT ; - goto error_exit ; - } ; - if ((SF_CODEC (psf->sf.format)) == 0) - { error = SFE_ZERO_MINOR_FORMAT ; - goto error_exit ; - } ; - - if (sf_format_check (&psf->sf) == 0) - { error = SFE_BAD_OPEN_FORMAT ; - goto error_exit ; - } ; - } - else if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_RAW) - { /* If type RAW has not been specified then need to figure out file type. */ - psf->sf.format = guess_file_type (psf) ; - - if (psf->sf.format == 0) - psf->sf.format = format_from_extension (psf) ; - } ; - - /* Prevent unnecessary seeks */ - psf->last_op = psf->file.mode ; - - /* Set bytewidth if known. */ - switch (SF_CODEC (psf->sf.format)) - { case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - case SF_FORMAT_ULAW : - case SF_FORMAT_ALAW : - case SF_FORMAT_DPCM_8 : - psf->bytewidth = 1 ; - break ; - - case SF_FORMAT_PCM_16 : - case SF_FORMAT_DPCM_16 : - psf->bytewidth = 2 ; - break ; - - case SF_FORMAT_PCM_24 : - psf->bytewidth = 3 ; - break ; - - case SF_FORMAT_PCM_32 : - case SF_FORMAT_FLOAT : - psf->bytewidth = 4 ; - break ; - - case SF_FORMAT_DOUBLE : - psf->bytewidth = 8 ; - break ; - } ; - - /* Call the initialisation function for the relevant file type. */ - switch (SF_CONTAINER (psf->sf.format)) - { case SF_FORMAT_WAV : - case SF_FORMAT_WAVEX : - error = wav_open (psf) ; - break ; - - case SF_FORMAT_AIFF : - error = aiff_open (psf) ; - break ; - - case SF_FORMAT_AU : - error = au_open (psf) ; - break ; - - case SF_FORMAT_RAW : - error = raw_open (psf) ; - break ; - - case SF_FORMAT_W64 : - error = w64_open (psf) ; - break ; - - case SF_FORMAT_RF64 : - error = rf64_open (psf) ; - break ; - - /* Lite remove start */ - case SF_FORMAT_PAF : - error = paf_open (psf) ; - break ; - - case SF_FORMAT_SVX : - error = svx_open (psf) ; - break ; - - case SF_FORMAT_NIST : - error = nist_open (psf) ; - break ; - - case SF_FORMAT_IRCAM : - error = ircam_open (psf) ; - break ; - - case SF_FORMAT_VOC : - error = voc_open (psf) ; - break ; - - case SF_FORMAT_SDS : - error = sds_open (psf) ; - break ; - - case SF_FORMAT_OGG : - error = ogg_open (psf) ; - break ; - - case SF_FORMAT_TXW : - error = txw_open (psf) ; - break ; - - case SF_FORMAT_WVE : - error = wve_open (psf) ; - break ; - - case SF_FORMAT_DWD : - error = dwd_open (psf) ; - break ; - - case SF_FORMAT_MAT4 : - error = mat4_open (psf) ; - break ; - - case SF_FORMAT_MAT5 : - error = mat5_open (psf) ; - break ; - - case SF_FORMAT_PVF : - error = pvf_open (psf) ; - break ; - - case SF_FORMAT_XI : - error = xi_open (psf) ; - break ; - - case SF_FORMAT_HTK : - error = htk_open (psf) ; - break ; - - case SF_FORMAT_SD2 : - error = sd2_open (psf) ; - break ; - - case SF_FORMAT_REX2 : - error = rx2_open (psf) ; - break ; - - case SF_FORMAT_AVR : - error = avr_open (psf) ; - break ; - - case SF_FORMAT_FLAC : - error = flac_open (psf) ; - break ; - - case SF_FORMAT_CAF : - error = caf_open (psf) ; - break ; - - case SF_FORMAT_MPC2K : - error = mpc2k_open (psf) ; - break ; - - /* Lite remove end */ - - default : - error = SFE_UNKNOWN_FORMAT ; - } ; - - if (error) - goto error_exit ; - - /* For now, check whether embedding is supported. */ - format = SF_CONTAINER (psf->sf.format) ; - if (psf->fileoffset > 0) - { switch (format) - { case SF_FORMAT_WAV : - case SF_FORMAT_WAVEX : - case SF_FORMAT_AIFF : - case SF_FORMAT_AU : - /* Actual embedded files. */ - break ; - - case SF_FORMAT_FLAC : - /* Flac with an ID3v2 header? */ - break ; - - default : - error = SFE_NO_EMBED_SUPPORT ; - goto error_exit ; - } ; - } ; - - if (psf->fileoffset > 0) - psf_log_printf (psf, "Embedded file length : %D\n", psf->filelength) ; - - if (psf->file.mode == SFM_RDWR && sf_format_check (&psf->sf) == 0) - { error = SFE_BAD_MODE_RW ; - goto error_exit ; - } ; - - if (validate_sfinfo (&psf->sf) == 0) - { psf_log_SF_INFO (psf) ; - save_header_info (psf) ; - error = SFE_BAD_SF_INFO ; - goto error_exit ; - } ; - - if (validate_psf (psf) == 0) - { save_header_info (psf) ; - error = SFE_INTERNAL ; - goto error_exit ; - } ; - - psf->read_current = 0 ; - psf->write_current = 0 ; - if (psf->file.mode == SFM_RDWR) - { psf->write_current = psf->sf.frames ; - psf->have_written = psf->sf.frames > 0 ? SF_TRUE : SF_FALSE ; - } ; - - memcpy (sfinfo, &psf->sf, sizeof (SF_INFO)) ; - - return (SNDFILE *) psf ; - -error_exit : - sf_errno = error ; - - if (error == SFE_SYSTEM) - snprintf (sf_syserr, sizeof (sf_syserr), "%s", psf->syserr) ; - snprintf (sf_parselog, sizeof (sf_parselog), "%s", psf->parselog.buf) ; - - switch (error) - { case SF_ERR_SYSTEM : - case SF_ERR_UNSUPPORTED_ENCODING : - case SFE_UNIMPLEMENTED : - break ; - - case SFE_RAW_BAD_FORMAT : - break ; - - default : - if (psf->file.mode == SFM_READ) - { psf_log_printf (psf, "Parse error : %s\n", sf_error_number (error)) ; - error = SF_ERR_MALFORMED_FILE ; - } ; - } ; - - psf_close (psf) ; - return NULL ; -} /* psf_open_file */ - -/*============================================================================== -** Chunk getting and setting. -*/ - -int -sf_set_chunk (SNDFILE * sndfile, const SF_CHUNK_INFO * chunk_info) -{ SF_PRIVATE *psf ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (chunk_info == NULL || chunk_info->data == NULL) - return SFE_BAD_CHUNK_PTR ; - - if (psf->set_chunk) - return psf->set_chunk (psf, chunk_info) ; - - return SFE_BAD_CHUNK_FORMAT ; -} /* sf_set_chunk */ - -SF_CHUNK_ITERATOR * -sf_get_chunk_iterator (SNDFILE * sndfile, const SF_CHUNK_INFO * chunk_info) -{ SF_PRIVATE *psf ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (chunk_info) - return psf_get_chunk_iterator (psf, chunk_info->id) ; - - return psf_get_chunk_iterator (psf, NULL) ; -} /* sf_get_chunk_iterator */ - -SF_CHUNK_ITERATOR * -sf_next_chunk_iterator (SF_CHUNK_ITERATOR * iterator) -{ SF_PRIVATE *psf ; - SNDFILE *sndfile = iterator ? iterator->sndfile : NULL ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (psf->next_chunk_iterator) - return psf->next_chunk_iterator (psf, iterator) ; - - return NULL ; -} /* sf_get_chunk_iterator_next */ - -int -sf_get_chunk_size (const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) -{ SF_PRIVATE *psf ; - SNDFILE *sndfile = iterator ? iterator->sndfile : NULL ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (chunk_info == NULL) - return SFE_BAD_CHUNK_PTR ; - - if (psf->get_chunk_size) - return psf->get_chunk_size (psf, iterator, chunk_info) ; - - return SFE_BAD_CHUNK_FORMAT ; - return 0 ; -} /* sf_get_chunk_size */ - -int -sf_get_chunk_data (const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) -{ SF_PRIVATE *psf ; - SNDFILE *sndfile = iterator ? iterator->sndfile : NULL ; - - VALIDATE_SNDFILE_AND_ASSIGN_PSF (sndfile, psf, 1) ; - - if (chunk_info == NULL || chunk_info->data == NULL) - return SFE_BAD_CHUNK_PTR ; - - if (psf->get_chunk_data) - return psf->get_chunk_data (psf, iterator, chunk_info) ; - - return SFE_BAD_CHUNK_FORMAT ; -} /* sf_get_chunk_data */ diff --git a/libs/libsndfile/src/sndfile.h.in b/libs/libsndfile/src/sndfile.h.in deleted file mode 100644 index b1e32d7f21..0000000000 --- a/libs/libsndfile/src/sndfile.h.in +++ /dev/null @@ -1,824 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** sndfile.h -- system-wide definitions -** -** API documentation is in the doc/ directory of the source code tarball -** and at http://www.mega-nerd.com/libsndfile/api.html. -*/ - -#ifndef SNDFILE_H -#define SNDFILE_H - -/* This is the version 1.0.X header file. */ -#define SNDFILE_1 - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* The following file types can be read and written. -** A file type would consist of a major type (ie SF_FORMAT_WAV) bitwise -** ORed with a minor type (ie SF_FORMAT_PCM). SF_FORMAT_TYPEMASK and -** SF_FORMAT_SUBMASK can be used to separate the major and minor file -** types. -*/ - -enum -{ /* Major formats. */ - SF_FORMAT_WAV = 0x010000, /* Microsoft WAV format (little endian default). */ - SF_FORMAT_AIFF = 0x020000, /* Apple/SGI AIFF format (big endian). */ - SF_FORMAT_AU = 0x030000, /* Sun/NeXT AU format (big endian). */ - SF_FORMAT_RAW = 0x040000, /* RAW PCM data. */ - SF_FORMAT_PAF = 0x050000, /* Ensoniq PARIS file format. */ - SF_FORMAT_SVX = 0x060000, /* Amiga IFF / SVX8 / SV16 format. */ - SF_FORMAT_NIST = 0x070000, /* Sphere NIST format. */ - SF_FORMAT_VOC = 0x080000, /* VOC files. */ - SF_FORMAT_IRCAM = 0x0A0000, /* Berkeley/IRCAM/CARL */ - SF_FORMAT_W64 = 0x0B0000, /* Sonic Foundry's 64 bit RIFF/WAV */ - SF_FORMAT_MAT4 = 0x0C0000, /* Matlab (tm) V4.2 / GNU Octave 2.0 */ - SF_FORMAT_MAT5 = 0x0D0000, /* Matlab (tm) V5.0 / GNU Octave 2.1 */ - SF_FORMAT_PVF = 0x0E0000, /* Portable Voice Format */ - SF_FORMAT_XI = 0x0F0000, /* Fasttracker 2 Extended Instrument */ - SF_FORMAT_HTK = 0x100000, /* HMM Tool Kit format */ - SF_FORMAT_SDS = 0x110000, /* Midi Sample Dump Standard */ - SF_FORMAT_AVR = 0x120000, /* Audio Visual Research */ - SF_FORMAT_WAVEX = 0x130000, /* MS WAVE with WAVEFORMATEX */ - SF_FORMAT_SD2 = 0x160000, /* Sound Designer 2 */ - SF_FORMAT_FLAC = 0x170000, /* FLAC lossless file format */ - SF_FORMAT_CAF = 0x180000, /* Core Audio File format */ - SF_FORMAT_WVE = 0x190000, /* Psion WVE format */ - SF_FORMAT_OGG = 0x200000, /* Xiph OGG container */ - SF_FORMAT_MPC2K = 0x210000, /* Akai MPC 2000 sampler */ - SF_FORMAT_RF64 = 0x220000, /* RF64 WAV file */ - - /* Subtypes from here on. */ - - SF_FORMAT_PCM_S8 = 0x0001, /* Signed 8 bit data */ - SF_FORMAT_PCM_16 = 0x0002, /* Signed 16 bit data */ - SF_FORMAT_PCM_24 = 0x0003, /* Signed 24 bit data */ - SF_FORMAT_PCM_32 = 0x0004, /* Signed 32 bit data */ - - SF_FORMAT_PCM_U8 = 0x0005, /* Unsigned 8 bit data (WAV and RAW only) */ - - SF_FORMAT_FLOAT = 0x0006, /* 32 bit float data */ - SF_FORMAT_DOUBLE = 0x0007, /* 64 bit float data */ - - SF_FORMAT_ULAW = 0x0010, /* U-Law encoded. */ - SF_FORMAT_ALAW = 0x0011, /* A-Law encoded. */ - SF_FORMAT_IMA_ADPCM = 0x0012, /* IMA ADPCM. */ - SF_FORMAT_MS_ADPCM = 0x0013, /* Microsoft ADPCM. */ - - SF_FORMAT_GSM610 = 0x0020, /* GSM 6.10 encoding. */ - SF_FORMAT_VOX_ADPCM = 0x0021, /* OKI / Dialogix ADPCM */ - - SF_FORMAT_G721_32 = 0x0030, /* 32kbs G721 ADPCM encoding. */ - SF_FORMAT_G723_24 = 0x0031, /* 24kbs G723 ADPCM encoding. */ - SF_FORMAT_G723_40 = 0x0032, /* 40kbs G723 ADPCM encoding. */ - - SF_FORMAT_DWVW_12 = 0x0040, /* 12 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_16 = 0x0041, /* 16 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_24 = 0x0042, /* 24 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_N = 0x0043, /* N bit Delta Width Variable Word encoding. */ - - SF_FORMAT_DPCM_8 = 0x0050, /* 8 bit differential PCM (XI only) */ - SF_FORMAT_DPCM_16 = 0x0051, /* 16 bit differential PCM (XI only) */ - - SF_FORMAT_VORBIS = 0x0060, /* Xiph Vorbis encoding. */ - - SF_FORMAT_ALAC_16 = 0x0070, /* Apple Lossless Audio Codec (16 bit). */ - SF_FORMAT_ALAC_20 = 0x0071, /* Apple Lossless Audio Codec (20 bit). */ - SF_FORMAT_ALAC_24 = 0x0072, /* Apple Lossless Audio Codec (24 bit). */ - SF_FORMAT_ALAC_32 = 0x0073, /* Apple Lossless Audio Codec (32 bit). */ - - /* Endian-ness options. */ - - SF_ENDIAN_FILE = 0x00000000, /* Default file endian-ness. */ - SF_ENDIAN_LITTLE = 0x10000000, /* Force little endian-ness. */ - SF_ENDIAN_BIG = 0x20000000, /* Force big endian-ness. */ - SF_ENDIAN_CPU = 0x30000000, /* Force CPU endian-ness. */ - - SF_FORMAT_SUBMASK = 0x0000FFFF, - SF_FORMAT_TYPEMASK = 0x0FFF0000, - SF_FORMAT_ENDMASK = 0x30000000 -} ; - -/* -** The following are the valid command numbers for the sf_command() -** interface. The use of these commands is documented in the file -** command.html in the doc directory of the source code distribution. -*/ - -enum -{ SFC_GET_LIB_VERSION = 0x1000, - SFC_GET_LOG_INFO = 0x1001, - SFC_GET_CURRENT_SF_INFO = 0x1002, - - - SFC_GET_NORM_DOUBLE = 0x1010, - SFC_GET_NORM_FLOAT = 0x1011, - SFC_SET_NORM_DOUBLE = 0x1012, - SFC_SET_NORM_FLOAT = 0x1013, - SFC_SET_SCALE_FLOAT_INT_READ = 0x1014, - SFC_SET_SCALE_INT_FLOAT_WRITE = 0x1015, - - SFC_GET_SIMPLE_FORMAT_COUNT = 0x1020, - SFC_GET_SIMPLE_FORMAT = 0x1021, - - SFC_GET_FORMAT_INFO = 0x1028, - - SFC_GET_FORMAT_MAJOR_COUNT = 0x1030, - SFC_GET_FORMAT_MAJOR = 0x1031, - SFC_GET_FORMAT_SUBTYPE_COUNT = 0x1032, - SFC_GET_FORMAT_SUBTYPE = 0x1033, - - SFC_CALC_SIGNAL_MAX = 0x1040, - SFC_CALC_NORM_SIGNAL_MAX = 0x1041, - SFC_CALC_MAX_ALL_CHANNELS = 0x1042, - SFC_CALC_NORM_MAX_ALL_CHANNELS = 0x1043, - SFC_GET_SIGNAL_MAX = 0x1044, - SFC_GET_MAX_ALL_CHANNELS = 0x1045, - - SFC_SET_ADD_PEAK_CHUNK = 0x1050, - SFC_SET_ADD_HEADER_PAD_CHUNK = 0x1051, - - SFC_UPDATE_HEADER_NOW = 0x1060, - SFC_SET_UPDATE_HEADER_AUTO = 0x1061, - - SFC_FILE_TRUNCATE = 0x1080, - - SFC_SET_RAW_START_OFFSET = 0x1090, - - SFC_SET_DITHER_ON_WRITE = 0x10A0, - SFC_SET_DITHER_ON_READ = 0x10A1, - - SFC_GET_DITHER_INFO_COUNT = 0x10A2, - SFC_GET_DITHER_INFO = 0x10A3, - - SFC_GET_EMBED_FILE_INFO = 0x10B0, - - SFC_SET_CLIPPING = 0x10C0, - SFC_GET_CLIPPING = 0x10C1, - - SFC_GET_INSTRUMENT = 0x10D0, - SFC_SET_INSTRUMENT = 0x10D1, - - SFC_GET_LOOP_INFO = 0x10E0, - - SFC_GET_BROADCAST_INFO = 0x10F0, - SFC_SET_BROADCAST_INFO = 0x10F1, - - SFC_GET_CHANNEL_MAP_INFO = 0x1100, - SFC_SET_CHANNEL_MAP_INFO = 0x1101, - - SFC_RAW_DATA_NEEDS_ENDSWAP = 0x1110, - - /* Support for Wavex Ambisonics Format */ - SFC_WAVEX_SET_AMBISONIC = 0x1200, - SFC_WAVEX_GET_AMBISONIC = 0x1201, - - SFC_SET_VBR_ENCODING_QUALITY = 0x1300, - SFC_SET_COMPRESSION_LEVEL = 0x1301, - - /* Cart Chunk support */ - SFC_SET_CART_INFO = 0x1400, - SFC_GET_CART_INFO = 0x1401, - - /* Following commands for testing only. */ - SFC_TEST_IEEE_FLOAT_REPLACE = 0x6001, - - /* - ** SFC_SET_ADD_* values are deprecated and will disappear at some - ** time in the future. They are guaranteed to be here up to and - ** including version 1.0.8 to avoid breakage of existing software. - ** They currently do nothing and will continue to do nothing. - */ - SFC_SET_ADD_DITHER_ON_WRITE = 0x1070, - SFC_SET_ADD_DITHER_ON_READ = 0x1071 -} ; - - -/* -** String types that can be set and read from files. Not all file types -** support this and even the file types which support one, may not support -** all string types. -*/ - -enum -{ SF_STR_TITLE = 0x01, - SF_STR_COPYRIGHT = 0x02, - SF_STR_SOFTWARE = 0x03, - SF_STR_ARTIST = 0x04, - SF_STR_COMMENT = 0x05, - SF_STR_DATE = 0x06, - SF_STR_ALBUM = 0x07, - SF_STR_LICENSE = 0x08, - SF_STR_TRACKNUMBER = 0x09, - SF_STR_GENRE = 0x10 -} ; - -/* -** Use the following as the start and end index when doing metadata -** transcoding. -*/ - -#define SF_STR_FIRST SF_STR_TITLE -#define SF_STR_LAST SF_STR_GENRE - -enum -{ /* True and false */ - SF_FALSE = 0, - SF_TRUE = 1, - - /* Modes for opening files. */ - SFM_READ = 0x10, - SFM_WRITE = 0x20, - SFM_RDWR = 0x30, - - SF_AMBISONIC_NONE = 0x40, - SF_AMBISONIC_B_FORMAT = 0x41 -} ; - -/* Public error values. These are guaranteed to remain unchanged for the duration -** of the library major version number. -** There are also a large number of private error numbers which are internal to -** the library which can change at any time. -*/ - -enum -{ SF_ERR_NO_ERROR = 0, - SF_ERR_UNRECOGNISED_FORMAT = 1, - SF_ERR_SYSTEM = 2, - SF_ERR_MALFORMED_FILE = 3, - SF_ERR_UNSUPPORTED_ENCODING = 4 -} ; - - -/* Channel map values (used with SFC_SET/GET_CHANNEL_MAP). -*/ - -enum -{ SF_CHANNEL_MAP_INVALID = 0, - SF_CHANNEL_MAP_MONO = 1, - SF_CHANNEL_MAP_LEFT, /* Apple calls this 'Left' */ - SF_CHANNEL_MAP_RIGHT, /* Apple calls this 'Right' */ - SF_CHANNEL_MAP_CENTER, /* Apple calls this 'Center' */ - SF_CHANNEL_MAP_FRONT_LEFT, - SF_CHANNEL_MAP_FRONT_RIGHT, - SF_CHANNEL_MAP_FRONT_CENTER, - SF_CHANNEL_MAP_REAR_CENTER, /* Apple calls this 'Center Surround', Msft calls this 'Back Center' */ - SF_CHANNEL_MAP_REAR_LEFT, /* Apple calls this 'Left Surround', Msft calls this 'Back Left' */ - SF_CHANNEL_MAP_REAR_RIGHT, /* Apple calls this 'Right Surround', Msft calls this 'Back Right' */ - SF_CHANNEL_MAP_LFE, /* Apple calls this 'LFEScreen', Msft calls this 'Low Frequency' */ - SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER, /* Apple calls this 'Left Center' */ - SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER, /* Apple calls this 'Right Center */ - SF_CHANNEL_MAP_SIDE_LEFT, /* Apple calls this 'Left Surround Direct' */ - SF_CHANNEL_MAP_SIDE_RIGHT, /* Apple calls this 'Right Surround Direct' */ - SF_CHANNEL_MAP_TOP_CENTER, /* Apple calls this 'Top Center Surround' */ - SF_CHANNEL_MAP_TOP_FRONT_LEFT, /* Apple calls this 'Vertical Height Left' */ - SF_CHANNEL_MAP_TOP_FRONT_RIGHT, /* Apple calls this 'Vertical Height Right' */ - SF_CHANNEL_MAP_TOP_FRONT_CENTER, /* Apple calls this 'Vertical Height Center' */ - SF_CHANNEL_MAP_TOP_REAR_LEFT, /* Apple and MS call this 'Top Back Left' */ - SF_CHANNEL_MAP_TOP_REAR_RIGHT, /* Apple and MS call this 'Top Back Right' */ - SF_CHANNEL_MAP_TOP_REAR_CENTER, /* Apple and MS call this 'Top Back Center' */ - - SF_CHANNEL_MAP_AMBISONIC_B_W, - SF_CHANNEL_MAP_AMBISONIC_B_X, - SF_CHANNEL_MAP_AMBISONIC_B_Y, - SF_CHANNEL_MAP_AMBISONIC_B_Z, - - SF_CHANNEL_MAP_MAX -} ; - - -/* A SNDFILE* pointer can be passed around much like stdio.h's FILE* pointer. */ - -typedef struct SNDFILE_tag SNDFILE ; - -/* The following typedef is system specific and is defined when libsndfile is -** compiled. sf_count_t will be a 64 bit value when the underlying OS allows -** 64 bit file offsets. -** On windows, we need to allow the same header file to be compiler by both GCC -** and the Microsoft compiler. -*/ - -#if (defined (_MSCVER) || defined (_MSC_VER)) -typedef __int64 sf_count_t ; -#define SF_COUNT_MAX 0x7fffffffffffffffi64 -#else -typedef @TYPEOF_SF_COUNT_T@ sf_count_t ; -#define SF_COUNT_MAX @SF_COUNT_MAX@ -#endif - - -/* A pointer to a SF_INFO structure is passed to sf_open () and filled in. -** On write, the SF_INFO structure is filled in by the user and passed into -** sf_open (). -*/ - -struct SF_INFO -{ sf_count_t frames ; /* Used to be called samples. Changed to avoid confusion. */ - int samplerate ; - int channels ; - int format ; - int sections ; - int seekable ; -} ; - -typedef struct SF_INFO SF_INFO ; - -/* The SF_FORMAT_INFO struct is used to retrieve information about the sound -** file formats libsndfile supports using the sf_command () interface. -** -** Using this interface will allow applications to support new file formats -** and encoding types when libsndfile is upgraded, without requiring -** re-compilation of the application. -** -** Please consult the libsndfile documentation (particularly the information -** on the sf_command () interface) for examples of its use. -*/ - -typedef struct -{ int format ; - const char *name ; - const char *extension ; -} SF_FORMAT_INFO ; - -/* -** Enums and typedefs for adding dither on read and write. -** See the html documentation for sf_command(), SFC_SET_DITHER_ON_WRITE -** and SFC_SET_DITHER_ON_READ. -*/ - -enum -{ SFD_DEFAULT_LEVEL = 0, - SFD_CUSTOM_LEVEL = 0x40000000, - - SFD_NO_DITHER = 500, - SFD_WHITE = 501, - SFD_TRIANGULAR_PDF = 502 -} ; - -typedef struct -{ int type ; - double level ; - const char *name ; -} SF_DITHER_INFO ; - -/* Struct used to retrieve information about a file embedded within a -** larger file. See SFC_GET_EMBED_FILE_INFO. -*/ - -typedef struct -{ sf_count_t offset ; - sf_count_t length ; -} SF_EMBED_FILE_INFO ; - -/* -** Structs used to retrieve music sample information from a file. -*/ - -enum -{ /* - ** The loop mode field in SF_INSTRUMENT will be one of the following. - */ - SF_LOOP_NONE = 800, - SF_LOOP_FORWARD, - SF_LOOP_BACKWARD, - SF_LOOP_ALTERNATING -} ; - -typedef struct -{ int gain ; - char basenote, detune ; - char velocity_lo, velocity_hi ; - char key_lo, key_hi ; - int loop_count ; - - struct - { int mode ; - uint32_t start ; - uint32_t end ; - uint32_t count ; - } loops [16] ; /* make variable in a sensible way */ -} SF_INSTRUMENT ; - - - -/* Struct used to retrieve loop information from a file.*/ -typedef struct -{ - short time_sig_num ; /* any positive integer > 0 */ - short time_sig_den ; /* any positive power of 2 > 0 */ - int loop_mode ; /* see SF_LOOP enum */ - - int num_beats ; /* this is NOT the amount of quarter notes !!!*/ - /* a full bar of 4/4 is 4 beats */ - /* a full bar of 7/8 is 7 beats */ - - float bpm ; /* suggestion, as it can be calculated using other fields:*/ - /* file's length, file's sampleRate and our time_sig_den*/ - /* -> bpms are always the amount of _quarter notes_ per minute */ - - int root_key ; /* MIDI note, or -1 for None */ - int future [6] ; -} SF_LOOP_INFO ; - - -/* Struct used to retrieve broadcast (EBU) information from a file. -** Strongly (!) based on EBU "bext" chunk format used in Broadcast WAVE. -*/ -#define SF_BROADCAST_INFO_VAR(coding_hist_size) \ - struct \ - { char description [256] ; \ - char originator [32] ; \ - char originator_reference [32] ; \ - char origination_date [10] ; \ - char origination_time [8] ; \ - uint32_t time_reference_low ; \ - uint32_t time_reference_high ; \ - short version ; \ - char umid [64] ; \ - char reserved [190] ; \ - uint32_t coding_history_size ; \ - char coding_history [coding_hist_size] ; \ - } - -/* SF_BROADCAST_INFO is the above struct with coding_history field of 256 bytes. */ -typedef SF_BROADCAST_INFO_VAR (256) SF_BROADCAST_INFO ; - -struct SF_CART_TIMER -{ char usage[4] ; - int32_t value ; -} ; - -typedef struct SF_CART_TIMER SF_CART_TIMER ; - -#define SF_CART_INFO_VAR(p_tag_text_size) \ - struct \ - { char version [4] ; \ - char title [64] ; \ - char artist [64] ; \ - char cut_id [64] ; \ - char client_id [64] ; \ - char category [64] ; \ - char classification [64] ; \ - char out_cue [64] ; \ - char start_date [10] ; \ - char start_time [8] ; \ - char end_date [10] ; \ - char end_time [8] ; \ - char producer_app_id [64] ; \ - char producer_app_version [64] ; \ - char user_def [64] ; \ - int32_t level_reference ; \ - SF_CART_TIMER post_timers [8] ; \ - char reserved [276] ; \ - char url [1024] ; \ - uint32_t tag_text_size ; \ - char tag_text[p_tag_text_size] ; \ - } - -typedef SF_CART_INFO_VAR (256) SF_CART_INFO ; - -/* Virtual I/O functionality. */ - -typedef sf_count_t (*sf_vio_get_filelen) (void *user_data) ; -typedef sf_count_t (*sf_vio_seek) (sf_count_t offset, int whence, void *user_data) ; -typedef sf_count_t (*sf_vio_read) (void *ptr, sf_count_t count, void *user_data) ; -typedef sf_count_t (*sf_vio_write) (const void *ptr, sf_count_t count, void *user_data) ; -typedef sf_count_t (*sf_vio_tell) (void *user_data) ; - -struct SF_VIRTUAL_IO -{ sf_vio_get_filelen get_filelen ; - sf_vio_seek seek ; - sf_vio_read read ; - sf_vio_write write ; - sf_vio_tell tell ; -} ; - -typedef struct SF_VIRTUAL_IO SF_VIRTUAL_IO ; - - -/* Open the specified file for read, write or both. On error, this will -** return a NULL pointer. To find the error number, pass a NULL SNDFILE -** to sf_strerror (). -** All calls to sf_open() should be matched with a call to sf_close(). -*/ - -SNDFILE* sf_open (const char *path, int mode, SF_INFO *sfinfo) ; - - -/* Use the existing file descriptor to create a SNDFILE object. If close_desc -** is TRUE, the file descriptor will be closed when sf_close() is called. If -** it is FALSE, the descriptor will not be closed. -** When passed a descriptor like this, the library will assume that the start -** of file header is at the current file offset. This allows sound files within -** larger container files to be read and/or written. -** On error, this will return a NULL pointer. To find the error number, pass a -** NULL SNDFILE to sf_strerror (). -** All calls to sf_open_fd() should be matched with a call to sf_close(). - -*/ - -SNDFILE* sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) ; - -SNDFILE* sf_open_virtual (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ; - - -/* sf_error () returns a error number which can be translated to a text -** string using sf_error_number(). -*/ - -int sf_error (SNDFILE *sndfile) ; - - -/* sf_strerror () returns to the caller a pointer to the current error message for -** the given SNDFILE. -*/ - -const char* sf_strerror (SNDFILE *sndfile) ; - - -/* sf_error_number () allows the retrieval of the error string for each internal -** error number. -** -*/ - -const char* sf_error_number (int errnum) ; - - -/* The following two error functions are deprecated but they will remain in the -** library for the foreseeable future. The function sf_strerror() should be used -** in their place. -*/ - -int sf_perror (SNDFILE *sndfile) ; -int sf_error_str (SNDFILE *sndfile, char* str, size_t len) ; - - -/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */ - -int sf_command (SNDFILE *sndfile, int command, void *data, int datasize) ; - - -/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */ - -int sf_format_check (const SF_INFO *info) ; - - -/* Seek within the waveform data chunk of the SNDFILE. sf_seek () uses -** the same values for whence (SEEK_SET, SEEK_CUR and SEEK_END) as -** stdio.h function fseek (). -** An offset of zero with whence set to SEEK_SET will position the -** read / write pointer to the first data sample. -** On success sf_seek returns the current position in (multi-channel) -** samples from the start of the file. -** Please see the libsndfile documentation for moving the read pointer -** separately from the write pointer on files open in mode SFM_RDWR. -** On error all of these functions return -1. -*/ - -enum -{ SF_SEEK_SET = SEEK_SET, - SF_SEEK_CUR = SEEK_CUR, - SF_SEEK_END = SEEK_END -} ; - -sf_count_t sf_seek (SNDFILE *sndfile, sf_count_t frames, int whence) ; - - -/* Functions for retrieving and setting string data within sound files. -** Not all file types support this features; AIFF and WAV do. For both -** functions, the str_type parameter must be one of the SF_STR_* values -** defined above. -** On error, sf_set_string() returns non-zero while sf_get_string() -** returns NULL. -*/ - -int sf_set_string (SNDFILE *sndfile, int str_type, const char* str) ; - -const char* sf_get_string (SNDFILE *sndfile, int str_type) ; - - -/* Return the library version string. */ - -const char * sf_version_string (void) ; - -/* Return the current byterate at this point in the file. The byte rate in this -** case is the number of bytes per second of audio data. For instance, for a -** stereo, 18 bit PCM encoded file with an 16kHz sample rate, the byte rate -** would be 2 (stereo) * 2 (two bytes per sample) * 16000 => 64000 bytes/sec. -** For some file formats the returned value will be accurate and exact, for some -** it will be a close approximation, for some it will be the average bitrate for -** the whole file and for some it will be a time varying value that was accurate -** when the file was most recently read or written. -** To get the bitrate, multiple this value by 8. -** Returns -1 for unknown. -*/ -int sf_current_byterate (SNDFILE *sndfile) ; - -/* Functions for reading/writing the waveform data of a sound file. -*/ - -sf_count_t sf_read_raw (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ; -sf_count_t sf_write_raw (SNDFILE *sndfile, const void *ptr, sf_count_t bytes) ; - - -/* Functions for reading and writing the data chunk in terms of frames. -** The number of items actually read/written = frames * number of channels. -** sf_xxxx_raw read/writes the raw data bytes from/to the file -** sf_xxxx_short passes data in the native short format -** sf_xxxx_int passes data in the native int format -** sf_xxxx_float passes data in the native float format -** sf_xxxx_double passes data in the native double format -** All of these read/write function return number of frames read/written. -*/ - -sf_count_t sf_readf_short (SNDFILE *sndfile, short *ptr, sf_count_t frames) ; -sf_count_t sf_writef_short (SNDFILE *sndfile, const short *ptr, sf_count_t frames) ; - -sf_count_t sf_readf_int (SNDFILE *sndfile, int *ptr, sf_count_t frames) ; -sf_count_t sf_writef_int (SNDFILE *sndfile, const int *ptr, sf_count_t frames) ; - -sf_count_t sf_readf_float (SNDFILE *sndfile, float *ptr, sf_count_t frames) ; -sf_count_t sf_writef_float (SNDFILE *sndfile, const float *ptr, sf_count_t frames) ; - -sf_count_t sf_readf_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) ; -sf_count_t sf_writef_double (SNDFILE *sndfile, const double *ptr, sf_count_t frames) ; - - -/* Functions for reading and writing the data chunk in terms of items. -** Otherwise similar to above. -** All of these read/write function return number of items read/written. -*/ - -sf_count_t sf_read_short (SNDFILE *sndfile, short *ptr, sf_count_t items) ; -sf_count_t sf_write_short (SNDFILE *sndfile, const short *ptr, sf_count_t items) ; - -sf_count_t sf_read_int (SNDFILE *sndfile, int *ptr, sf_count_t items) ; -sf_count_t sf_write_int (SNDFILE *sndfile, const int *ptr, sf_count_t items) ; - -sf_count_t sf_read_float (SNDFILE *sndfile, float *ptr, sf_count_t items) ; -sf_count_t sf_write_float (SNDFILE *sndfile, const float *ptr, sf_count_t items) ; - -sf_count_t sf_read_double (SNDFILE *sndfile, double *ptr, sf_count_t items) ; -sf_count_t sf_write_double (SNDFILE *sndfile, const double *ptr, sf_count_t items) ; - - -/* Close the SNDFILE and clean up all memory allocations associated with this -** file. -** Returns 0 on success, or an error number. -*/ - -int sf_close (SNDFILE *sndfile) ; - - -/* If the file is opened SFM_WRITE or SFM_RDWR, call fsync() on the file -** to force the writing of data to disk. If the file is opened SFM_READ -** no action is taken. -*/ - -void sf_write_sync (SNDFILE *sndfile) ; - - - -/* The function sf_wchar_open() is Windows Only! -** Open a file passing in a Windows Unicode filename. Otherwise, this is -** the same as sf_open(). -** -** In order for this to work, you need to do the following: -** -** #include -** #define ENABLE_SNDFILE_WINDOWS_PROTOTYPES 1 -** #including -*/ - -#if (defined (ENABLE_SNDFILE_WINDOWS_PROTOTYPES) && ENABLE_SNDFILE_WINDOWS_PROTOTYPES) -SNDFILE* sf_wchar_open (LPCWSTR wpath, int mode, SF_INFO *sfinfo) ; -#endif - - - - -/* Getting and setting of chunks from within a sound file. -** -** These functions allow the getting and setting of chunks within a sound file -** (for those formats which allow it). -** -** These functions fail safely. Specifically, they will not allow you to overwrite -** existing chunks or add extra versions of format specific reserved chunks but -** should allow you to retrieve any and all chunks (may not be implemented for -** all chunks or all file formats). -*/ - -struct SF_CHUNK_INFO -{ char id [64] ; /* The chunk identifier. */ - unsigned id_size ; /* The size of the chunk identifier. */ - unsigned datalen ; /* The size of that data. */ - void *data ; /* Pointer to the data. */ -} ; - -typedef struct SF_CHUNK_INFO SF_CHUNK_INFO ; - -/* Set the specified chunk info (must be done before any audio data is written -** to the file). This will fail for format specific reserved chunks. -** The chunk_info->data pointer must be valid until the file is closed. -** Returns SF_ERR_NO_ERROR on success or non-zero on failure. -*/ -int sf_set_chunk (SNDFILE * sndfile, const SF_CHUNK_INFO * chunk_info) ; - -/* -** An opaque structure to an iterator over the all chunks of a given id -*/ -typedef struct SF_CHUNK_ITERATOR SF_CHUNK_ITERATOR ; - -/* Get an iterator for all chunks matching chunk_info. -** The iterator will point to the first chunk matching chunk_info. -** Chunks are matching, if (chunk_info->id) matches the first -** (chunk_info->id_size) bytes of a chunk found in the SNDFILE* handle. -** If chunk_info is NULL, an iterator to all chunks in the SNDFILE* handle -** is returned. -** The values of chunk_info->datalen and chunk_info->data are ignored. -** If no matching chunks are found in the sndfile, NULL is returned. -** The returned iterator will stay valid until one of the following occurs: -** a) The sndfile is closed. -** b) A new chunk is added using sf_set_chunk(). -** c) Another chunk iterator function is called on the same SNDFILE* handle -** that causes the iterator to be modified. -** The memory for the iterator belongs to the SNDFILE* handle and is freed when -** sf_close() is called. -*/ -SF_CHUNK_ITERATOR * -sf_get_chunk_iterator (SNDFILE * sndfile, const SF_CHUNK_INFO * chunk_info) ; - -/* Iterate through chunks by incrementing the iterator. -** Increments the iterator and returns a handle to the new one. -** After this call, iterator will no longer be valid, and you must use the -** newly returned handle from now on. -** The returned handle can be used to access the next chunk matching -** the criteria as defined in sf_get_chunk_iterator(). -** If iterator points to the last chunk, this will free all resources -** associated with iterator and return NULL. -** The returned iterator will stay valid until sf_get_chunk_iterator_next -** is called again, the sndfile is closed or a new chunk us added. -*/ -SF_CHUNK_ITERATOR * -sf_next_chunk_iterator (SF_CHUNK_ITERATOR * iterator) ; - - -/* Get the size of the specified chunk. -** If the specified chunk exists, the size will be returned in the -** datalen field of the SF_CHUNK_INFO struct. -** Additionally, the id of the chunk will be copied to the id -** field of the SF_CHUNK_INFO struct and it's id_size field will -** be updated accordingly. -** If the chunk doesn't exist chunk_info->datalen will be zero, and the -** id and id_size fields will be undefined. -** The function will return SF_ERR_NO_ERROR on success or non-zero on -** failure. -*/ -int -sf_get_chunk_size (const SF_CHUNK_ITERATOR * it, SF_CHUNK_INFO * chunk_info) ; - -/* Get the specified chunk data. -** If the specified chunk exists, up to chunk_info->datalen bytes of -** the chunk data will be copied into the chunk_info->data buffer -** (allocated by the caller) and the chunk_info->datalen field -** updated to reflect the size of the data. The id and id_size -** field will be updated according to the retrieved chunk -** If the chunk doesn't exist chunk_info->datalen will be zero, and the -** id and id_size fields will be undefined. -** The function will return SF_ERR_NO_ERROR on success or non-zero on -** failure. -*/ -int -sf_get_chunk_data (const SF_CHUNK_ITERATOR * it, SF_CHUNK_INFO * chunk_info) ; - - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* SNDFILE_H */ - diff --git a/libs/libsndfile/src/sndfile.hh b/libs/libsndfile/src/sndfile.hh deleted file mode 100644 index 0a0c62d7f6..0000000000 --- a/libs/libsndfile/src/sndfile.hh +++ /dev/null @@ -1,446 +0,0 @@ -/* -** Copyright (C) 2005-2012 Erik de Castro Lopo -** -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the author nor the names of any contributors may be used -** to endorse or promote products derived from this software without -** specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -** OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -** ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* -** The above modified BSD style license (GPL and LGPL compatible) applies to -** this file. It does not apply to libsndfile itself which is released under -** the GNU LGPL or the libsndfile test suite which is released under the GNU -** GPL. -** This means that this header file can be used under this modified BSD style -** license, but the LGPL still holds for the libsndfile library itself. -*/ - -/* -** sndfile.hh -- A lightweight C++ wrapper for the libsndfile API. -** -** All the methods are inlines and all functionality is contained in this -** file. There is no separate implementation file. -** -** API documentation is in the doc/ directory of the source code tarball -** and at http://www.mega-nerd.com/libsndfile/api.html. -*/ - -#ifndef SNDFILE_HH -#define SNDFILE_HH - -#include - -#include -#include // for std::nothrow - -class SndfileHandle -{ private : - struct SNDFILE_ref - { SNDFILE_ref (void) ; - ~SNDFILE_ref (void) ; - - SNDFILE *sf ; - SF_INFO sfinfo ; - int ref ; - } ; - - SNDFILE_ref *p ; - - public : - /* Default constructor */ - SndfileHandle (void) : p (NULL) {} ; - SndfileHandle (const char *path, int mode = SFM_READ, - int format = 0, int channels = 0, int samplerate = 0) ; - SndfileHandle (std::string const & path, int mode = SFM_READ, - int format = 0, int channels = 0, int samplerate = 0) ; - SndfileHandle (int fd, bool close_desc, int mode = SFM_READ, - int format = 0, int channels = 0, int samplerate = 0) ; - SndfileHandle (SF_VIRTUAL_IO &sfvirtual, void *user_data, int mode = SFM_READ, - int format = 0, int channels = 0, int samplerate = 0) ; - -#ifdef ENABLE_SNDFILE_WINDOWS_PROTOTYPES - SndfileHandle (LPCWSTR wpath, int mode = SFM_READ, - int format = 0, int channels = 0, int samplerate = 0) ; -#endif - - ~SndfileHandle (void) ; - - SndfileHandle (const SndfileHandle &orig) ; - SndfileHandle & operator = (const SndfileHandle &rhs) ; - - /* Mainly for debugging/testing. */ - int refCount (void) const { return (p == NULL) ? 0 : p->ref ; } - - operator bool () const { return (p != NULL) ; } - - bool operator == (const SndfileHandle &rhs) const { return (p == rhs.p) ; } - - sf_count_t frames (void) const { return p ? p->sfinfo.frames : 0 ; } - int format (void) const { return p ? p->sfinfo.format : 0 ; } - int channels (void) const { return p ? p->sfinfo.channels : 0 ; } - int samplerate (void) const { return p ? p->sfinfo.samplerate : 0 ; } - - int error (void) const ; - const char * strError (void) const ; - - int command (int cmd, void *data, int datasize) ; - - sf_count_t seek (sf_count_t frames, int whence) ; - - void writeSync (void) ; - - int setString (int str_type, const char* str) ; - - const char* getString (int str_type) const ; - - static int formatCheck (int format, int channels, int samplerate) ; - - sf_count_t read (short *ptr, sf_count_t items) ; - sf_count_t read (int *ptr, sf_count_t items) ; - sf_count_t read (float *ptr, sf_count_t items) ; - sf_count_t read (double *ptr, sf_count_t items) ; - - sf_count_t write (const short *ptr, sf_count_t items) ; - sf_count_t write (const int *ptr, sf_count_t items) ; - sf_count_t write (const float *ptr, sf_count_t items) ; - sf_count_t write (const double *ptr, sf_count_t items) ; - - sf_count_t readf (short *ptr, sf_count_t frames) ; - sf_count_t readf (int *ptr, sf_count_t frames) ; - sf_count_t readf (float *ptr, sf_count_t frames) ; - sf_count_t readf (double *ptr, sf_count_t frames) ; - - sf_count_t writef (const short *ptr, sf_count_t frames) ; - sf_count_t writef (const int *ptr, sf_count_t frames) ; - sf_count_t writef (const float *ptr, sf_count_t frames) ; - sf_count_t writef (const double *ptr, sf_count_t frames) ; - - sf_count_t readRaw (void *ptr, sf_count_t bytes) ; - sf_count_t writeRaw (const void *ptr, sf_count_t bytes) ; - - /**< Raw access to the handle. SndfileHandle keeps ownership. */ - SNDFILE * rawHandle (void) ; - - /**< Take ownership of handle, if reference count is 1. */ - SNDFILE * takeOwnership (void) ; -} ; - -/*============================================================================== -** Nothing but implementation below. -*/ - -inline -SndfileHandle::SNDFILE_ref::SNDFILE_ref (void) -: ref (1) -{} - -inline -SndfileHandle::SNDFILE_ref::~SNDFILE_ref (void) -{ if (sf != NULL) sf_close (sf) ; } - -inline -SndfileHandle::SndfileHandle (const char *path, int mode, int fmt, int chans, int srate) -: p (NULL) -{ - p = new (std::nothrow) SNDFILE_ref () ; - - if (p != NULL) - { p->ref = 1 ; - - p->sfinfo.frames = 0 ; - p->sfinfo.channels = chans ; - p->sfinfo.format = fmt ; - p->sfinfo.samplerate = srate ; - p->sfinfo.sections = 0 ; - p->sfinfo.seekable = 0 ; - - p->sf = sf_open (path, mode, &p->sfinfo) ; - } ; - - return ; -} /* SndfileHandle const char * constructor */ - -inline -SndfileHandle::SndfileHandle (std::string const & path, int mode, int fmt, int chans, int srate) -: p (NULL) -{ - p = new (std::nothrow) SNDFILE_ref () ; - - if (p != NULL) - { p->ref = 1 ; - - p->sfinfo.frames = 0 ; - p->sfinfo.channels = chans ; - p->sfinfo.format = fmt ; - p->sfinfo.samplerate = srate ; - p->sfinfo.sections = 0 ; - p->sfinfo.seekable = 0 ; - - p->sf = sf_open (path.c_str (), mode, &p->sfinfo) ; - } ; - - return ; -} /* SndfileHandle std::string constructor */ - -inline -SndfileHandle::SndfileHandle (int fd, bool close_desc, int mode, int fmt, int chans, int srate) -: p (NULL) -{ - if (fd < 0) - return ; - - p = new (std::nothrow) SNDFILE_ref () ; - - if (p != NULL) - { p->ref = 1 ; - - p->sfinfo.frames = 0 ; - p->sfinfo.channels = chans ; - p->sfinfo.format = fmt ; - p->sfinfo.samplerate = srate ; - p->sfinfo.sections = 0 ; - p->sfinfo.seekable = 0 ; - - p->sf = sf_open_fd (fd, mode, &p->sfinfo, close_desc) ; - } ; - - return ; -} /* SndfileHandle fd constructor */ - -inline -SndfileHandle::SndfileHandle (SF_VIRTUAL_IO &sfvirtual, void *user_data, int mode, int fmt, int chans, int srate) -: p (NULL) -{ - p = new (std::nothrow) SNDFILE_ref () ; - - if (p != NULL) - { p->ref = 1 ; - - p->sfinfo.frames = 0 ; - p->sfinfo.channels = chans ; - p->sfinfo.format = fmt ; - p->sfinfo.samplerate = srate ; - p->sfinfo.sections = 0 ; - p->sfinfo.seekable = 0 ; - - p->sf = sf_open_virtual (&sfvirtual, mode, &p->sfinfo, user_data) ; - } ; - - return ; -} /* SndfileHandle std::string constructor */ - -inline -SndfileHandle::~SndfileHandle (void) -{ if (p != NULL && --p->ref == 0) - delete p ; -} /* SndfileHandle destructor */ - - -inline -SndfileHandle::SndfileHandle (const SndfileHandle &orig) -: p (orig.p) -{ if (p != NULL) - ++p->ref ; -} /* SndfileHandle copy constructor */ - -inline SndfileHandle & -SndfileHandle::operator = (const SndfileHandle &rhs) -{ - if (&rhs == this) - return *this ; - if (p != NULL && --p->ref == 0) - delete p ; - - p = rhs.p ; - if (p != NULL) - ++p->ref ; - - return *this ; -} /* SndfileHandle assignment operator */ - -inline int -SndfileHandle::error (void) const -{ return sf_error (p->sf) ; } - -inline const char * -SndfileHandle::strError (void) const -{ return sf_strerror (p->sf) ; } - -inline int -SndfileHandle::command (int cmd, void *data, int datasize) -{ return sf_command (p->sf, cmd, data, datasize) ; } - -inline sf_count_t -SndfileHandle::seek (sf_count_t frame_count, int whence) -{ return sf_seek (p->sf, frame_count, whence) ; } - -inline void -SndfileHandle::writeSync (void) -{ sf_write_sync (p->sf) ; } - -inline int -SndfileHandle::setString (int str_type, const char* str) -{ return sf_set_string (p->sf, str_type, str) ; } - -inline const char* -SndfileHandle::getString (int str_type) const -{ return sf_get_string (p->sf, str_type) ; } - -inline int -SndfileHandle::formatCheck (int fmt, int chans, int srate) -{ - SF_INFO sfinfo ; - - sfinfo.frames = 0 ; - sfinfo.channels = chans ; - sfinfo.format = fmt ; - sfinfo.samplerate = srate ; - sfinfo.sections = 0 ; - sfinfo.seekable = 0 ; - - return sf_format_check (&sfinfo) ; -} - -/*---------------------------------------------------------------------*/ - -inline sf_count_t -SndfileHandle::read (short *ptr, sf_count_t items) -{ return sf_read_short (p->sf, ptr, items) ; } - -inline sf_count_t -SndfileHandle::read (int *ptr, sf_count_t items) -{ return sf_read_int (p->sf, ptr, items) ; } - -inline sf_count_t -SndfileHandle::read (float *ptr, sf_count_t items) -{ return sf_read_float (p->sf, ptr, items) ; } - -inline sf_count_t -SndfileHandle::read (double *ptr, sf_count_t items) -{ return sf_read_double (p->sf, ptr, items) ; } - -inline sf_count_t -SndfileHandle::write (const short *ptr, sf_count_t items) -{ return sf_write_short (p->sf, ptr, items) ; } - -inline sf_count_t -SndfileHandle::write (const int *ptr, sf_count_t items) -{ return sf_write_int (p->sf, ptr, items) ; } - -inline sf_count_t -SndfileHandle::write (const float *ptr, sf_count_t items) -{ return sf_write_float (p->sf, ptr, items) ; } - -inline sf_count_t -SndfileHandle::write (const double *ptr, sf_count_t items) -{ return sf_write_double (p->sf, ptr, items) ; } - -inline sf_count_t -SndfileHandle::readf (short *ptr, sf_count_t frame_count) -{ return sf_readf_short (p->sf, ptr, frame_count) ; } - -inline sf_count_t -SndfileHandle::readf (int *ptr, sf_count_t frame_count) -{ return sf_readf_int (p->sf, ptr, frame_count) ; } - -inline sf_count_t -SndfileHandle::readf (float *ptr, sf_count_t frame_count) -{ return sf_readf_float (p->sf, ptr, frame_count) ; } - -inline sf_count_t -SndfileHandle::readf (double *ptr, sf_count_t frame_count) -{ return sf_readf_double (p->sf, ptr, frame_count) ; } - -inline sf_count_t -SndfileHandle::writef (const short *ptr, sf_count_t frame_count) -{ return sf_writef_short (p->sf, ptr, frame_count) ; } - -inline sf_count_t -SndfileHandle::writef (const int *ptr, sf_count_t frame_count) -{ return sf_writef_int (p->sf, ptr, frame_count) ; } - -inline sf_count_t -SndfileHandle::writef (const float *ptr, sf_count_t frame_count) -{ return sf_writef_float (p->sf, ptr, frame_count) ; } - -inline sf_count_t -SndfileHandle::writef (const double *ptr, sf_count_t frame_count) -{ return sf_writef_double (p->sf, ptr, frame_count) ; } - -inline sf_count_t -SndfileHandle::readRaw (void *ptr, sf_count_t bytes) -{ return sf_read_raw (p->sf, ptr, bytes) ; } - -inline sf_count_t -SndfileHandle::writeRaw (const void *ptr, sf_count_t bytes) -{ return sf_write_raw (p->sf, ptr, bytes) ; } - -inline SNDFILE * -SndfileHandle::rawHandle (void) -{ return (p ? p->sf : NULL) ; } - -inline SNDFILE * -SndfileHandle::takeOwnership (void) -{ - if (p == NULL || (p->ref != 1)) - return NULL ; - - SNDFILE * sf = p->sf ; - p->sf = NULL ; - delete p ; - p = NULL ; - return sf ; -} - -#ifdef ENABLE_SNDFILE_WINDOWS_PROTOTYPES - -inline -SndfileHandle::SndfileHandle (LPCWSTR wpath, int mode, int fmt, int chans, int srate) -: p (NULL) -{ - p = new (std::nothrow) SNDFILE_ref () ; - - if (p != NULL) - { p->ref = 1 ; - - p->sfinfo.frames = 0 ; - p->sfinfo.channels = chans ; - p->sfinfo.format = fmt ; - p->sfinfo.samplerate = srate ; - p->sfinfo.sections = 0 ; - p->sfinfo.seekable = 0 ; - - p->sf = sf_wchar_open (wpath, mode, &p->sfinfo) ; - } ; - - return ; -} /* SndfileHandle const wchar_t * constructor */ - -#endif - -#endif /* SNDFILE_HH */ - diff --git a/libs/libsndfile/src/strings.c b/libs/libsndfile/src/strings.c deleted file mode 100644 index c587e9b736..0000000000 --- a/libs/libsndfile/src/strings.c +++ /dev/null @@ -1,222 +0,0 @@ -/* -** Copyright (C) 2001-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#include "sndfile.h" -#include "common.h" - -#define STRINGS_DEBUG 0 -#if STRINGS_DEBUG -static void hexdump (void *data, int len) ; -#endif - -int -psf_store_string (SF_PRIVATE *psf, int str_type, const char *str) -{ char new_str [128] ; - size_t str_len ; - int k, str_flags ; - - if (str == NULL) - return SFE_STR_BAD_STRING ; - - str_len = strlen (str) ; - - /* A few extra checks for write mode. */ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if ((psf->strings.flags & SF_STR_ALLOW_START) == 0) - return SFE_STR_NO_SUPPORT ; - if (psf->have_written && (psf->strings.flags & SF_STR_ALLOW_END) == 0) - return SFE_STR_NO_SUPPORT ; - /* Only allow zero length strings for software. */ - if (str_type != SF_STR_SOFTWARE && str_len == 0) - return SFE_STR_BAD_STRING ; - } ; - - /* Find the next free slot in table. */ - for (k = 0 ; k < SF_MAX_STRINGS ; k++) - { /* If we find a matching entry clear it. */ - if (psf->strings.data [k].type == str_type) - psf->strings.data [k].type = -1 ; - - if (psf->strings.data [k].type == 0) - break ; - } ; - - /* Determine flags */ - str_flags = SF_STR_LOCATE_START ; - if (psf->file.mode == SFM_RDWR || psf->have_written) - { if ((psf->strings.flags & SF_STR_ALLOW_END) == 0) - return SFE_STR_NO_ADD_END ; - str_flags = SF_STR_LOCATE_END ; - } ; - - /* More sanity checking. */ - if (k >= SF_MAX_STRINGS) - return SFE_STR_MAX_COUNT ; - - if (k == 0 && psf->strings.storage_used != 0) - { psf_log_printf (psf, "SFE_STR_WEIRD : k == 0 && psf->strings.storage_used != 0\n") ; - return SFE_STR_WEIRD ; - } ; - - if (k != 0 && psf->strings.storage_used == 0) - { psf_log_printf (psf, "SFE_STR_WEIRD : k != 0 && psf->strings.storage_used == 0\n") ; - return SFE_STR_WEIRD ; - } ; - - /* Special case for the first string. */ - if (k == 0) - psf->strings.storage_used = 0 ; - - switch (str_type) - { case SF_STR_SOFTWARE : - /* In write mode, want to append libsndfile-version to string. */ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (strstr (str, PACKAGE) == NULL) - { /* - ** If the supplied string does not already contain a - ** libsndfile-X.Y.Z component, then add it. - */ - if (strlen (str) == 0) - snprintf (new_str, sizeof (new_str), "%s-%s", PACKAGE, VERSION) ; - else - snprintf (new_str, sizeof (new_str), "%s (%s-%s)", str, PACKAGE, VERSION) ; - } - else - snprintf (new_str, sizeof (new_str), "%s", str) ; - - str = new_str ; - } ; - break ; - - case SF_STR_TITLE : - case SF_STR_COPYRIGHT : - case SF_STR_ARTIST : - case SF_STR_COMMENT : - case SF_STR_DATE : - case SF_STR_ALBUM : - case SF_STR_LICENSE : - case SF_STR_TRACKNUMBER : - case SF_STR_GENRE : - break ; - - default : - psf_log_printf (psf, "%s : SFE_STR_BAD_TYPE\n", __func__) ; - return SFE_STR_BAD_TYPE ; - } ; - - /* Plus one to catch string terminator. */ - str_len = strlen (str) + 1 ; - - if (psf->strings.storage_used + str_len + 1 > psf->strings.storage_len) - { char * temp = psf->strings.storage ; - size_t newlen = 2 * psf->strings.storage_len + str_len + 1 ; - - newlen = newlen < 256 ? 256 : newlen ; - - if ((psf->strings.storage = realloc (temp, newlen)) == NULL) - { psf->strings.storage = temp ; - return SFE_MALLOC_FAILED ; - } ; - - psf->strings.storage_len = newlen ; - } ; - - psf->strings.data [k].type = str_type ; - psf->strings.data [k].offset = psf->strings.storage_used ; - psf->strings.data [k].flags = str_flags ; - - memcpy (psf->strings.storage + psf->strings.storage_used, str, str_len) ; - psf->strings.storage_used += str_len ; - - psf->strings.flags |= str_flags ; - -#if STRINGS_DEBUG - psf_log_printf (psf, "str_storage : %p\n", psf->strings.storage) ; - psf_log_printf (psf, "storage_used : %u\n", psf->strings.storage_used) ; - psf_log_printf (psf, "used : %d\n", psf->strings.storage_used) ; - psf_log_printf (psf, "remaining : %d\n", psf->strings.storage_len - psf->strings.storage_used ; - - hexdump (psf->strings.storage, 300) ; -#endif - - return 0 ; -} /* psf_store_string */ - -int -psf_set_string (SF_PRIVATE *psf, int str_type, const char *str) -{ if (psf->file.mode == SFM_READ) - return SFE_STR_NOT_WRITE ; - - return psf_store_string (psf, str_type, str) ; -} /* psf_set_string */ - -const char* -psf_get_string (SF_PRIVATE *psf, int str_type) -{ int k ; - - for (k = 0 ; k < SF_MAX_STRINGS ; k++) - if (str_type == psf->strings.data [k].type) - return psf->strings.storage + psf->strings.data [k].offset ; - - return NULL ; -} /* psf_get_string */ - -int -psf_location_string_count (const SF_PRIVATE * psf, int location) -{ int k, count = 0 ; - - for (k = 0 ; k < SF_MAX_STRINGS ; k++) - if (psf->strings.data [k].type > 0 && psf->strings.data [k].flags & location) - count ++ ; - - return count ; -} /* psf_location_string_count */ - -/*============================================================================== -*/ - -#if STRINGS_DEBUG - -#include -static void -hexdump (void *data, int len) -{ unsigned char *ptr ; - int k ; - - ptr = data ; - - puts ("---------------------------------------------------------") ; - while (len >= 16) - { for (k = 0 ; k < 16 ; k++) - printf ("%02X ", ptr [k] & 0xFF) ; - printf (" ") ; - for (k = 0 ; k < 16 ; k++) - printf ("%c", psf_isprint (ptr [k]) ? ptr [k] : '.') ; - puts ("") ; - ptr += 16 ; - len -= 16 ; - } ; -} /* hexdump */ - -#endif diff --git a/libs/libsndfile/src/svx.c b/libs/libsndfile/src/svx.c deleted file mode 100644 index b611f760af..0000000000 --- a/libs/libsndfile/src/svx.c +++ /dev/null @@ -1,416 +0,0 @@ -/* -** Copyright (C) 1999-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - - -/*------------------------------------------------------------------------------ - * Macros to handle big/little endian issues. -*/ - -#define FORM_MARKER (MAKE_MARKER ('F', 'O', 'R', 'M')) -#define SVX8_MARKER (MAKE_MARKER ('8', 'S', 'V', 'X')) -#define SV16_MARKER (MAKE_MARKER ('1', '6', 'S', 'V')) -#define VHDR_MARKER (MAKE_MARKER ('V', 'H', 'D', 'R')) -#define BODY_MARKER (MAKE_MARKER ('B', 'O', 'D', 'Y')) - -#define ATAK_MARKER (MAKE_MARKER ('A', 'T', 'A', 'K')) -#define RLSE_MARKER (MAKE_MARKER ('R', 'L', 'S', 'E')) - -#define c_MARKER (MAKE_MARKER ('(', 'c', ')', ' ')) -#define NAME_MARKER (MAKE_MARKER ('N', 'A', 'M', 'E')) -#define AUTH_MARKER (MAKE_MARKER ('A', 'U', 'T', 'H')) -#define ANNO_MARKER (MAKE_MARKER ('A', 'N', 'N', 'O')) -#define CHAN_MARKER (MAKE_MARKER ('C', 'H', 'A', 'N')) - -/*------------------------------------------------------------------------------ - * Typedefs for file chunks. -*/ - -typedef struct -{ unsigned int oneShotHiSamples, repeatHiSamples, samplesPerHiCycle ; - unsigned short samplesPerSec ; - unsigned char octave, compression ; - unsigned int volume ; -} VHDR_CHUNK ; - -enum { - HAVE_FORM = 0x01, - - HAVE_SVX = 0x02, - HAVE_VHDR = 0x04, - HAVE_BODY = 0x08 -} ; - -/*------------------------------------------------------------------------------ - * Private static functions. -*/ - -static int svx_close (SF_PRIVATE *psf) ; -static int svx_write_header (SF_PRIVATE *psf, int calc_length) ; -static int svx_read_header (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -svx_open (SF_PRIVATE *psf) -{ int error ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = svx_read_header (psf))) - return error ; - - psf->endian = SF_ENDIAN_BIG ; /* All SVX files are big endian. */ - - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - if (psf->blockwidth) - psf->sf.frames = psf->datalength / psf->blockwidth ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (psf->is_pipe) - return SFE_NO_PIPE_WRITE ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_SVX) - return SFE_BAD_OPEN_FORMAT ; - - psf->endian = SF_ENDIAN (psf->sf.format) ; - - if (psf->endian == SF_ENDIAN_LITTLE || (CPU_IS_LITTLE_ENDIAN && psf->endian == SF_ENDIAN_CPU)) - return SFE_BAD_ENDIAN ; - - psf->endian = SF_ENDIAN_BIG ; /* All SVX files are big endian. */ - - error = svx_write_header (psf, SF_FALSE) ; - if (error) - return error ; - - psf->write_header = svx_write_header ; - } ; - - psf->container_close = svx_close ; - - if ((error = pcm_init (psf))) - return error ; - - return 0 ; -} /* svx_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -svx_read_header (SF_PRIVATE *psf) -{ VHDR_CHUNK vhdr ; - unsigned int FORMsize, vhdrsize, dword, marker ; - int filetype = 0, parsestage = 0, done = 0 ; - int bytecount = 0, channels ; - - if (psf->filelength > SF_PLATFORM_S64 (0xffffffff)) - psf_log_printf (psf, "Warning : filelength > 0xffffffff. This is bad!!!!\n") ; - - memset (&vhdr, 0, sizeof (vhdr)) ; - psf_binheader_readf (psf, "p", 0) ; - - /* Set default number of channels. Modify later if necessary */ - psf->sf.channels = 1 ; - - psf->sf.format = SF_FORMAT_SVX ; - - while (! done) - { psf_binheader_readf (psf, "m", &marker) ; - switch (marker) - { case FORM_MARKER : - if (parsestage) - return SFE_SVX_NO_FORM ; - - psf_binheader_readf (psf, "E4", &FORMsize) ; - - if (FORMsize != psf->filelength - 2 * sizeof (dword)) - { dword = psf->filelength - 2 * sizeof (dword) ; - psf_log_printf (psf, "FORM : %d (should be %d)\n", FORMsize, dword) ; - FORMsize = dword ; - } - else - psf_log_printf (psf, "FORM : %d\n", FORMsize) ; - parsestage |= HAVE_FORM ; - break ; - - case SVX8_MARKER : - case SV16_MARKER : - if (! (parsestage & HAVE_FORM)) - return SFE_SVX_NO_FORM ; - filetype = marker ; - psf_log_printf (psf, " %M\n", marker) ; - parsestage |= HAVE_SVX ; - break ; - - case VHDR_MARKER : - if (! (parsestage & (HAVE_FORM | HAVE_SVX))) - return SFE_SVX_NO_FORM ; - - psf_binheader_readf (psf, "E4", &vhdrsize) ; - - psf_log_printf (psf, " VHDR : %d\n", vhdrsize) ; - - psf_binheader_readf (psf, "E4442114", &(vhdr.oneShotHiSamples), &(vhdr.repeatHiSamples), - &(vhdr.samplesPerHiCycle), &(vhdr.samplesPerSec), &(vhdr.octave), &(vhdr.compression), - &(vhdr.volume)) ; - - psf_log_printf (psf, " OneShotHiSamples : %d\n", vhdr.oneShotHiSamples) ; - psf_log_printf (psf, " RepeatHiSamples : %d\n", vhdr.repeatHiSamples) ; - psf_log_printf (psf, " samplesPerHiCycle : %d\n", vhdr.samplesPerHiCycle) ; - psf_log_printf (psf, " Sample Rate : %d\n", vhdr.samplesPerSec) ; - psf_log_printf (psf, " Octave : %d\n", vhdr.octave) ; - - psf_log_printf (psf, " Compression : %d => ", vhdr.compression) ; - - switch (vhdr.compression) - { case 0 : psf_log_printf (psf, "None.\n") ; - break ; - case 1 : psf_log_printf (psf, "Fibonacci delta\n") ; - break ; - case 2 : psf_log_printf (psf, "Exponential delta\n") ; - break ; - } ; - - psf_log_printf (psf, " Volume : %d\n", vhdr.volume) ; - - psf->sf.samplerate = vhdr.samplesPerSec ; - - if (filetype == SVX8_MARKER) - { psf->sf.format |= SF_FORMAT_PCM_S8 ; - psf->bytewidth = 1 ; - } - else if (filetype == SV16_MARKER) - { psf->sf.format |= SF_FORMAT_PCM_16 ; - psf->bytewidth = 2 ; - } ; - - parsestage |= HAVE_VHDR ; - break ; - - case BODY_MARKER : - if (! (parsestage & HAVE_VHDR)) - return SFE_SVX_NO_BODY ; - - psf_binheader_readf (psf, "E4", &dword) ; - psf->datalength = dword ; - - psf->dataoffset = psf_ftell (psf) ; - if (psf->dataoffset < 0) - return SFE_SVX_NO_BODY ; - - if (psf->datalength > psf->filelength - psf->dataoffset) - { psf_log_printf (psf, " BODY : %D (should be %D)\n", psf->datalength, psf->filelength - psf->dataoffset) ; - psf->datalength = psf->filelength - psf->dataoffset ; - } - else - psf_log_printf (psf, " BODY : %D\n", psf->datalength) ; - - parsestage |= HAVE_BODY ; - - if (! psf->sf.seekable) - break ; - - psf_fseek (psf, psf->datalength, SEEK_CUR) ; - break ; - - case NAME_MARKER : - if (! (parsestage & HAVE_SVX)) - return SFE_SVX_NO_FORM ; - - psf_binheader_readf (psf, "E4", &dword) ; - - psf_log_printf (psf, " %M : %d\n", marker, dword) ; - - if (strlen (psf->file.name.c) != dword) - { if (dword > sizeof (psf->file.name.c) - 1) - return SFE_SVX_BAD_NAME_LENGTH ; - - psf_binheader_readf (psf, "b", psf->file.name.c, dword) ; - psf->file.name.c [dword] = 0 ; - } - else - psf_binheader_readf (psf, "j", dword) ; - break ; - - case ANNO_MARKER : - if (! (parsestage & HAVE_SVX)) - return SFE_SVX_NO_FORM ; - - psf_binheader_readf (psf, "E4", &dword) ; - - psf_log_printf (psf, " %M : %d\n", marker, dword) ; - - psf_binheader_readf (psf, "j", dword) ; - break ; - - case CHAN_MARKER : - if (! (parsestage & HAVE_SVX)) - return SFE_SVX_NO_FORM ; - - psf_binheader_readf (psf, "E4", &dword) ; - - psf_log_printf (psf, " %M : %d\n", marker, dword) ; - - bytecount += psf_binheader_readf (psf, "E4", &channels) ; - - if (channels == 2 || channels == 4) - psf_log_printf (psf, " Channels : %d => mono\n", channels) ; - else if (channels == 6) - { psf->sf.channels = 2 ; - psf_log_printf (psf, " Channels : %d => stereo\n", channels) ; - } - else - psf_log_printf (psf, " Channels : %d *** assuming mono\n", channels) ; - - psf_binheader_readf (psf, "j", dword - bytecount) ; - break ; - - - case AUTH_MARKER : - case c_MARKER : - if (! (parsestage & HAVE_SVX)) - return SFE_SVX_NO_FORM ; - - psf_binheader_readf (psf, "E4", &dword) ; - - psf_log_printf (psf, " %M : %d\n", marker, dword) ; - - psf_binheader_readf (psf, "j", dword) ; - break ; - - default : - if (psf_isprint ((marker >> 24) & 0xFF) && psf_isprint ((marker >> 16) & 0xFF) - && psf_isprint ((marker >> 8) & 0xFF) && psf_isprint (marker & 0xFF)) - { psf_binheader_readf (psf, "E4", &dword) ; - - psf_log_printf (psf, "%M : %d (unknown marker)\n", marker, dword) ; - - psf_binheader_readf (psf, "j", dword) ; - break ; - } ; - if ((dword = psf_ftell (psf)) & 0x03) - { psf_log_printf (psf, " Unknown chunk marker at position %d. Resynching.\n", dword - 4) ; - - psf_binheader_readf (psf, "j", -3) ; - break ; - } ; - psf_log_printf (psf, "*** Unknown chunk marker : %X. Exiting parser.\n", marker) ; - done = 1 ; - } ; /* switch (marker) */ - - if (! psf->sf.seekable && (parsestage & HAVE_BODY)) - break ; - - if (psf_ftell (psf) >= psf->filelength - SIGNED_SIZEOF (dword)) - break ; - } ; /* while (1) */ - - if (vhdr.compression) - return SFE_SVX_BAD_COMP ; - - if (psf->dataoffset <= 0) - return SFE_SVX_NO_DATA ; - - return 0 ; -} /* svx_read_header */ - -static int -svx_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - svx_write_header (psf, SF_TRUE) ; - - return 0 ; -} /* svx_close */ - -static int -svx_write_header (SF_PRIVATE *psf, int calc_length) -{ static char annotation [] = "libsndfile by Erik de Castro Lopo\0\0\0" ; - sf_count_t current ; - - current = psf_ftell (psf) ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - /* FORM marker and FORM size. */ - psf_binheader_writef (psf, "Etm8", FORM_MARKER, (psf->filelength < 8) ? - psf->filelength * 0 : psf->filelength - 8) ; - - psf_binheader_writef (psf, "m", (psf->bytewidth == 1) ? SVX8_MARKER : SV16_MARKER) ; - - /* VHDR chunk. */ - psf_binheader_writef (psf, "Em4", VHDR_MARKER, sizeof (VHDR_CHUNK)) ; - /* VHDR : oneShotHiSamples, repeatHiSamples, samplesPerHiCycle */ - psf_binheader_writef (psf, "E444", psf->sf.frames, 0, 0) ; - /* VHDR : samplesPerSec, octave, compression */ - psf_binheader_writef (psf, "E211", psf->sf.samplerate, 1, 0) ; - /* VHDR : volume */ - psf_binheader_writef (psf, "E4", (psf->bytewidth == 1) ? 0xFF : 0xFFFF) ; - - if (psf->sf.channels == 2) - psf_binheader_writef (psf, "Em44", CHAN_MARKER, 4, 6) ; - - /* Filename and annotation strings. */ - psf_binheader_writef (psf, "Emsms", NAME_MARKER, psf->file.name.c, ANNO_MARKER, annotation) ; - - /* BODY marker and size. */ - psf_binheader_writef (psf, "Etm8", BODY_MARKER, (psf->datalength < 0) ? - psf->datalength * 0 : psf->datalength) ; - - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* svx_write_header */ - diff --git a/libs/libsndfile/src/test_audio_detect.c b/libs/libsndfile/src/test_audio_detect.c deleted file mode 100644 index 9706249eae..0000000000 --- a/libs/libsndfile/src/test_audio_detect.c +++ /dev/null @@ -1,111 +0,0 @@ -/* -** Copyright (C) 2007-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include -#include - -#include "common.h" -#include "sfendian.h" - -#include "test_main.h" - -static unsigned char float_le_mono [] = -{ 0x36, 0x86, 0x21, 0x44, 0xB5, 0xB4, 0x49, 0x44, 0xA2, 0xC0, 0x71, 0x44, 0x7B, 0xD1, 0x8C, 0x44, - 0x54, 0xAA, 0xA0, 0x44, 0x60, 0x67, 0xB4, 0x44, 0x22, 0x05, 0xC8, 0x44, 0x29, 0x80, 0xDB, 0x44, - 0x04, 0xD5, 0xEE, 0x44, 0x27, 0x00, 0x01, 0x45, 0x50, 0x7F, 0x0A, 0x45, 0x53, 0xE6, 0x13, 0x45, - 0x85, 0x33, 0x1D, 0x45, 0x43, 0x65, 0x26, 0x45, 0xEC, 0x79, 0x2F, 0x45, 0xE3, 0x6F, 0x38, 0x45, - 0x98, 0x45, 0x41, 0x45, 0x77, 0xF9, 0x49, 0x45, 0xF6, 0x89, 0x52, 0x45, 0x8F, 0xF5, 0x5A, 0x45, - 0xC9, 0x3A, 0x63, 0x45, 0x28, 0x58, 0x6B, 0x45, 0x3C, 0x4C, 0x73, 0x45, 0x9F, 0x15, 0x7B, 0x45, - 0x75, 0x59, 0x81, 0x45, 0x64, 0x11, 0x85, 0x45, 0xF1, 0xB1, 0x88, 0x45, 0x78, 0x3A, 0x8C, 0x45, - 0x58, 0xAA, 0x8F, 0x45, 0xF2, 0x00, 0x93, 0x45, 0xB2, 0x3D, 0x96, 0x45, 0x01, 0x60, 0x99, 0x45, - 0x50, 0x67, 0x9C, 0x45, 0x15, 0x53, 0x9F, 0x45, 0xCC, 0x22, 0xA2, 0x45, 0xF0, 0xD5, 0xA4, 0x45, - 0x07, 0x6C, 0xA7, 0x45, 0x9C, 0xE4, 0xA9, 0x45, 0x3D, 0x3F, 0xAC, 0x45, 0x7A, 0x7B, 0xAE, 0x45, - 0xF2, 0x98, 0xB0, 0x45, 0x3C, 0x97, 0xB2, 0x45, 0x02, 0x76, 0xB4, 0x45, 0xEC, 0x34, 0xB6, 0x45, - 0xA8, 0xD3, 0xB7, 0x45, 0xEB, 0x51, 0xB9, 0x45, 0x6F, 0xAF, 0xBA, 0x45, 0xF5, 0xEB, 0xBB, 0x45, - 0x41, 0x07, 0xBD, 0x45, 0x21, 0x01, 0xBE, 0x45, 0x64, 0xD9, 0xBE, 0x45, 0xE3, 0x8F, 0xBF, 0x45, - 0x7E, 0x24, 0xC0, 0x45, 0x15, 0x97, 0xC0, 0x45, 0x92, 0xE7, 0xC0, 0x45, 0xE8, 0x15, 0xC1, 0x45, - 0x7E, 0x24, 0xC0, 0x45, 0x15, 0x97, 0xC0, 0x45, 0x92, 0xE7, 0xC0, 0x45, 0xE8, 0x15, 0xC1, 0x45, - 0x7E, 0x24, 0xC0, 0x45, 0x15, 0x97, 0xC0, 0x45, 0x92, 0xE7, 0xC0, 0x45, 0xE8, 0x15, 0xC1, 0x45, -} ; - -static unsigned char int24_32_le_stereo [] = -{ - 0x00, 0xE7, 0xFB, 0xFF, 0x00, 0x7C, 0xFD, 0xFF, 0x00, 0xA2, 0xFC, 0xFF, 0x00, 0x2B, 0xFC, 0xFF, - 0x00, 0xF3, 0xFD, 0xFF, 0x00, 0x19, 0xFB, 0xFF, 0x00, 0xA5, 0xFE, 0xFF, 0x00, 0x8D, 0xFA, 0xFF, - 0x00, 0x91, 0xFF, 0xFF, 0x00, 0xB5, 0xFA, 0xFF, 0x00, 0x91, 0x00, 0x00, 0x00, 0x5E, 0xFB, 0xFF, - 0x00, 0xD9, 0x01, 0x00, 0x00, 0x82, 0xFB, 0xFF, 0x00, 0xDF, 0x03, 0x00, 0x00, 0x44, 0xFC, 0xFF, - 0x00, 0x1C, 0x05, 0x00, 0x00, 0x77, 0xFC, 0xFF, 0x00, 0x8D, 0x06, 0x00, 0x00, 0x4F, 0xFC, 0xFF, - 0x00, 0x84, 0x07, 0x00, 0x00, 0x74, 0xFC, 0xFF, 0x00, 0x98, 0x08, 0x00, 0x00, 0x33, 0xFD, 0xFF, - 0x00, 0xB9, 0x09, 0x00, 0x00, 0x48, 0xFF, 0xFF, 0x00, 0xD1, 0x0A, 0x00, 0x00, 0x10, 0x02, 0x00, - 0x00, 0x28, 0x0C, 0x00, 0x00, 0xA2, 0x05, 0x00, 0x00, 0xA7, 0x0C, 0x00, 0x00, 0x45, 0x08, 0x00, - 0x00, 0x44, 0x0D, 0x00, 0x00, 0x1A, 0x0A, 0x00, 0x00, 0x65, 0x0D, 0x00, 0x00, 0x51, 0x0B, 0x00, - 0x00, 0x8B, 0x0D, 0x00, 0x00, 0x18, 0x0B, 0x00, 0x00, 0x37, 0x0E, 0x00, 0x00, 0x24, 0x0B, 0x00, - 0x00, 0x00, 0x0F, 0x00, 0x00, 0xDD, 0x0A, 0x00, 0x00, 0x83, 0x10, 0x00, 0x00, 0x31, 0x0A, 0x00, - 0x00, 0x07, 0x12, 0x00, 0x00, 0xC0, 0x08, 0x00, 0x00, 0xF7, 0x12, 0x00, 0x00, 0x47, 0x06, 0x00, - 0x00, 0xDD, 0x12, 0x00, 0x00, 0x6A, 0x03, 0x00, 0x00, 0xD5, 0x11, 0x00, 0x00, 0x99, 0x00, 0x00, - 0x00, 0x01, 0x10, 0x00, 0x00, 0xC5, 0xFE, 0xFF, 0x00, 0xF4, 0x0D, 0x00, 0x00, 0x97, 0xFD, 0xFF, - 0x00, 0x62, 0x0B, 0x00, 0x00, 0x75, 0xFC, 0xFF, 0x00, 0xE9, 0x08, 0x00, 0x00, 0xC0, 0xFB, 0xFF, - 0x00, 0x80, 0x06, 0x00, 0x00, 0x3C, 0xFB, 0xFF, 0x00, 0xDA, 0x03, 0x00, 0x00, 0xE4, 0xFA, 0xFF, - 0x00, 0xEB, 0x01, 0x00, 0x00, 0x21, 0xFB, 0xFF, 0x00, 0x20, 0x00, 0x00, 0x00, 0xE7, 0xFB, 0xFF, -} ; - - -void -test_audio_detect (void) -{ - SF_PRIVATE psf ; - AUDIO_DETECT ad ; - int errors = 0 ; - - print_test_name ("Testing audio detect") ; - - memset (&psf, 0, sizeof (psf)) ; - - ad.endianness = SF_ENDIAN_LITTLE ; - ad.channels = 1 ; - if (audio_detect (&psf, &ad, float_le_mono, sizeof (float_le_mono)) != SF_FORMAT_FLOAT) - { puts (" float_le_mono") ; - errors ++ ; - } ; - - ad.endianness = SF_ENDIAN_LITTLE ; - ad.channels = 2 ; - if (audio_detect (&psf, &ad, int24_32_le_stereo, sizeof (int24_32_le_stereo)) != SF_FORMAT_PCM_32) - { if (errors == 0) puts ("\nFailed tests :\n") ; - puts (" int24_32_le_stereo") ; - errors ++ ; - } ; - - if (errors != 0) - { printf ("\n Errors : %d\n\n", errors) ; - exit (1) ; - } ; - - puts ("ok") ; - - return ; -} /* test_audio_detect */ diff --git a/libs/libsndfile/src/test_broadcast_var.c b/libs/libsndfile/src/test_broadcast_var.c deleted file mode 100644 index dbea943124..0000000000 --- a/libs/libsndfile/src/test_broadcast_var.c +++ /dev/null @@ -1,119 +0,0 @@ -/* -** Copyright (C) 2010-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#include "common.h" - -#include "test_main.h" - -#define BCAST_MAX 512 - -typedef SF_BROADCAST_INFO_VAR (BCAST_MAX) SF_BROADCAST_INFO_512 ; - -static void -fill_coding_history (SF_BROADCAST_INFO_512 * bi) -{ static const char *lines [] = - { "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit.", - "Donec dignissim erat\nvehicula libero condimentum\ndictum porta augue faucibus.", - "Maecenas nec turpis\nsit amet quam\nfaucibus adipiscing.", - "Mauris aliquam,\nlectus interdum\ntincidunt luctus.", - "\n\n\n\n\n\n\n\n\n\n\n\n", - "In auctor lorem\nvel est euismod\ncondimentum.", - "\n\n\n\n\n\n\n\n\n\n\n\n", - "Ut vitae magna\nid dui placerat vehicula\nin id lectus.", - "\n\n\n\n\n\n\n\n\n\n\n\n", - "Sed lacus leo,\nmolestie et luctus ac,\ntincidunt sit amet nisi.", - "\n\n\n\n\n\n\n\n\n\n\n\n", - "Sed ligula neque,\ngravida semper vulputate laoreet,\ngravida eu tellus.", - "Donec dolor dolor,\nscelerisque in consequat ornare,\ntempor nec nisl." - } ; - int k ; - - bi->coding_history [0] = 0 ; - - for (k = 0 ; strlen (bi->coding_history) < bi->coding_history_size - 1 ; k ++) - append_snprintf (bi->coding_history, bi->coding_history_size, "%s\n", lines [k % ARRAY_LEN (lines)]) ; - - return ; -} /* fill_coding_listory */ - -static void -test_broadcast_var_set (void) -{ SF_PRIVATE sf_private, *psf ; - int k ; - - psf = &sf_private ; - memset (psf, 0, sizeof (sf_private)) ; - - print_test_name ("Testing broadcast_var_set ") ; - - for (k = 64 ; k < BCAST_MAX ; k++) - { - SF_BROADCAST_INFO_512 bi ; - - memset (&bi, 0, sizeof (bi)) ; - - bi.coding_history_size = k ; - fill_coding_history (&bi) ; - bi.coding_history_size -- ; - - broadcast_var_set (psf, (SF_BROADCAST_INFO*) &bi, sizeof (bi)) ; - } ; - - if (psf->broadcast_16k != NULL) - free (psf->broadcast_16k) ; - - puts ("ok") ; -} /* test_broadcast_var_set */ - -static void -test_broadcast_var_zero (void) -{ SF_PRIVATE sf_private, *psf ; - SF_BROADCAST_INFO_VAR (0) bi ; - - psf = &sf_private ; - memset (psf, 0, sizeof (sf_private)) ; - psf->file.mode = SFM_RDWR ; - - print_test_name ("Testing broadcast_var_zero ") ; - - memset (&bi, 0, sizeof (bi)) ; - - broadcast_var_set (psf, (SF_BROADCAST_INFO*) &bi, sizeof (bi)) ; - - if (psf->broadcast_16k->coding_history_size != 0) - { printf ("\n\nLine %d: coding_history_size %d should be zero.\n\n", __LINE__, psf->broadcast_16k->coding_history_size) ; - exit (1) ; - } ; - - if (psf->broadcast_16k != NULL) - free (psf->broadcast_16k) ; - - puts ("ok") ; -} /* test_broadcast_var_zero */ - -void -test_broadcast_var (void) -{ test_broadcast_var_set () ; - test_broadcast_var_zero () ; -} /* test_broadcast_var */ diff --git a/libs/libsndfile/src/test_cart_var.c b/libs/libsndfile/src/test_cart_var.c deleted file mode 100644 index 532a755876..0000000000 --- a/libs/libsndfile/src/test_cart_var.c +++ /dev/null @@ -1,91 +0,0 @@ -/* -** Copyright (C) 2010-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#include "common.h" - -#include "test_main.h" - -#define CART_MAX 512 - -typedef SF_CART_INFO_VAR (CART_MAX) SF_CART_INFO_512 ; - -static void -fill_tag_text (SF_CART_INFO_512 * ci) -{ static const char *lines [] = - { "Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit.", - "Donec dignissim erat\nvehicula libero condimentum\ndictum porta augue faucibus.", - "Maecenas nec turpis\nsit amet quam\nfaucibus adipiscing.", - "Mauris aliquam,\nlectus interdum\ntincidunt luctus.", - "\n\n\n\n\n\n\n\n\n\n\n\n", - "In auctor lorem\nvel est euismod\ncondimentum.", - "\n\n\n\n\n\n\n\n\n\n\n\n", - "Ut vitae magna\nid dui placerat vehicula\nin id lectus.", - "\n\n\n\n\n\n\n\n\n\n\n\n", - "Sed lacus leo,\nmolestie et luctus ac,\ntincidunt sit amet nisi.", - "\n\n\n\n\n\n\n\n\n\n\n\n", - "Sed ligula neque,\ngravida semper vulputate laoreet,\ngravida eu tellus.", - "Donec dolor dolor,\nscelerisque in consequat ornare,\ntempor nec nisl." - } ; - int k ; - - ci->tag_text [0] = 0 ; - - for (k = 0 ; strlen (ci->tag_text) < ci->tag_text_size - 1 ; k ++) - append_snprintf (ci->tag_text, ci->tag_text_size, "%s\n", lines [k % ARRAY_LEN (lines)]) ; - - return ; -} /* fill_tag_text */ - -void -test_cart_var (void) -{ SF_PRIVATE sf_private, *psf ; - SF_CART_TIMER timer ; - int k ; - - psf = &sf_private ; - memset (psf, 0, sizeof (sf_private)) ; - - print_test_name ("Testing cart_var_set ") ; - - for (k = 64 ; k < CART_MAX ; k++) - { - SF_CART_INFO_512 ci ; - - memset (&ci, 0, sizeof (ci)) ; - - memset (&timer, 0, sizeof (timer)) ; - memcpy (ci.post_timers, &timer, sizeof (timer)) ; - - ci.tag_text_size = k ; - fill_tag_text (&ci) ; - ci.tag_text_size -- ; - - cart_var_set (psf, (SF_CART_INFO*) &ci, sizeof (ci)) ; - } ; - - if (psf->cart_16k != NULL) - free (psf->cart_16k) ; - - puts ("ok") ; -} /* test_cart_var */ diff --git a/libs/libsndfile/src/test_conversions.c b/libs/libsndfile/src/test_conversions.c deleted file mode 100644 index 7e8c2edee0..0000000000 --- a/libs/libsndfile/src/test_conversions.c +++ /dev/null @@ -1,110 +0,0 @@ -/* -** Copyright (C) 2006-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "test_main.h" - - -/* -** This is a bit rough, but it is the nicest way to do it. -*/ - -#define cmp_test(line, ival, tval, str) \ - if (ival != tval) \ - { printf (str, line, ival, tval) ; \ - exit (1) ; \ - } ; - -static void -conversion_test (char endian) -{ - SF_PRIVATE sf_private, *psf ; - const char * filename = "conversion.bin" ; - int64_t i64 = SF_PLATFORM_S64 (0x0123456789abcdef), t64 = 0 ; - char format_str [16] ; - char test_name [64] ; - char i8 = 12, t8 = 0 ; - short i16 = 0x123, t16 = 0 ; - int i24 = 0x23456, t24 = 0 ; - int i32 = 0x0a0b0c0d, t32 = 0 ; - int bytes ; - - snprintf (format_str, sizeof (format_str), "%c12348", endian) ; - - snprintf (test_name, sizeof (test_name), "Testing %s conversions", endian == 'e' ? "little endian" : "big endian") ; - print_test_name (test_name) ; - - psf = &sf_private ; - memset (psf, 0, sizeof (sf_private)) ; - - psf->file.mode = SFM_WRITE ; - snprintf (psf->file.path.c, sizeof (psf->file.path.c), "%s", filename) ; - - if (psf_fopen (psf) != 0) - { printf ("\n\nError : failed to open file '%s' for write.\n\n", filename) ; - exit (1) ; - } ; - - psf_binheader_writef (psf, format_str, i8, i16, i24, i32, i64) ; - psf_fwrite (psf->header, 1, psf->headindex, psf) ; - psf_fclose (psf) ; - - memset (psf, 0, sizeof (sf_private)) ; - - psf->file.mode = SFM_READ ; - snprintf (psf->file.path.c, sizeof (psf->file.path.c), "%s", filename) ; - - if (psf_fopen (psf) != 0) - { printf ("\n\nError : failed to open file '%s' for read.\n\n", filename) ; - exit (1) ; - } ; - - bytes = psf_binheader_readf (psf, format_str, &t8, &t16, &t24, &t32, &t64) ; - psf_fclose (psf) ; - - if (bytes != 18) - { printf ("\n\nLine %d : read %d bytes.\n\n", __LINE__, bytes) ; - exit (1) ; - } ; - - cmp_test (__LINE__, i8, t8, "\n\nLine %d : 8 bit int failed %d -> %d.\n\n") ; - cmp_test (__LINE__, i16, t16, "\n\nLine %d : 16 bit int failed 0x%x -> 0x%x.\n\n") ; - cmp_test (__LINE__, i24, t24, "\n\nLine %d : 24 bit int failed 0x%x -> 0x%x.\n\n") ; - cmp_test (__LINE__, i32, t32, "\n\nLine %d : 32 bit int failed 0x%x -> 0x%x.\n\n") ; - cmp_test (__LINE__, i64, t64, "\n\nLine %d : 64 bit int failed 0x%" PRIx64 "x -> 0x%" PRIx64 "x.\n\n") ; - - remove (filename) ; - puts ("ok") ; -} /* conversion_test */ - -void -test_conversions (void) -{ - conversion_test ('E') ; - conversion_test ('e') ; -} /* test_conversion */ - diff --git a/libs/libsndfile/src/test_endswap.c b/libs/libsndfile/src/test_endswap.c deleted file mode 100644 index 4931650c87..0000000000 --- a/libs/libsndfile/src/test_endswap.c +++ /dev/null @@ -1,235 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include "common.h" -#include "sfendian.h" - -#include "test_main.h" - -#define FMT_SHORT "0x%04x\n" -#define FMT_INT "0x%08x\n" -#define FMT_INT64 "0x%016" PRIx64 "\n" - -/*============================================================================== -** Test functions. -*/ - - -static void -dump_short_array (const char * name, short * data, int datalen) -{ int k ; - - printf ("%-6s : ", name) ; - for (k = 0 ; k < datalen ; k++) - printf (FMT_SHORT, data [k]) ; - putchar ('\n') ; -} /* dump_short_array */ - -static void -test_endswap_short (void) -{ short orig [4], first [4], second [4] ; - int k ; - - printf (" %-40s : ", "test_endswap_short") ; - fflush (stdout) ; - - for (k = 0 ; k < ARRAY_LEN (orig) ; k++) - orig [k] = 0x3210 + k ; - - endswap_short_copy (first, orig, ARRAY_LEN (first)) ; - endswap_short_copy (second, first, ARRAY_LEN (second)) ; - - if (memcmp (orig, first, sizeof (orig)) == 0) - { printf ("\n\nLine %d : test 1 : these two array should not be the same:\n\n", __LINE__) ; - dump_short_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_short_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - if (memcmp (orig, second, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 2 : these two array should be the same:\n\n", __LINE__) ; - dump_short_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_short_array ("second", second, ARRAY_LEN (second)) ; - exit (1) ; - } ; - - endswap_short_array (first, ARRAY_LEN (first)) ; - - if (memcmp (orig, first, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 3 : these two array should be the same:\n\n", __LINE__) ; - dump_short_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_short_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - endswap_short_copy (first, orig, ARRAY_LEN (first)) ; - endswap_short_copy (first, first, ARRAY_LEN (first)) ; - - if (memcmp (orig, first, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 4 : these two array should be the same:\n\n", __LINE__) ; - dump_short_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_short_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - puts ("ok") ; -} /* test_endswap_short */ - -static void -dump_int_array (const char * name, int * data, int datalen) -{ int k ; - - printf ("%-6s : ", name) ; - for (k = 0 ; k < datalen ; k++) - printf (FMT_INT, data [k]) ; - putchar ('\n') ; -} /* dump_int_array */ - -static void -test_endswap_int (void) -{ int orig [4], first [4], second [4] ; - int k ; - - printf (" %-40s : ", "test_endswap_int") ; - fflush (stdout) ; - - for (k = 0 ; k < ARRAY_LEN (orig) ; k++) - orig [k] = 0x76543210 + k ; - - endswap_int_copy (first, orig, ARRAY_LEN (first)) ; - endswap_int_copy (second, first, ARRAY_LEN (second)) ; - - if (memcmp (orig, first, sizeof (orig)) == 0) - { printf ("\n\nLine %d : test 1 : these two array should not be the same:\n\n", __LINE__) ; - dump_int_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_int_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - if (memcmp (orig, second, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 2 : these two array should be the same:\n\n", __LINE__) ; - dump_int_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_int_array ("second", second, ARRAY_LEN (second)) ; - exit (1) ; - } ; - - endswap_int_array (first, ARRAY_LEN (first)) ; - - if (memcmp (orig, first, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 3 : these two array should be the same:\n\n", __LINE__) ; - dump_int_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_int_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - endswap_int_copy (first, orig, ARRAY_LEN (first)) ; - endswap_int_copy (first, first, ARRAY_LEN (first)) ; - - if (memcmp (orig, first, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 4 : these two array should be the same:\n\n", __LINE__) ; - dump_int_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_int_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - puts ("ok") ; -} /* test_endswap_int */ - -static void -dump_int64_t_array (const char * name, int64_t * data, int datalen) -{ int k ; - - printf ("%-6s : ", name) ; - for (k = 0 ; k < datalen ; k++) - printf (FMT_INT64, data [k]) ; - putchar ('\n') ; -} /* dump_int64_t_array */ - -static void -test_endswap_int64_t (void) -{ int64_t orig [4], first [4], second [4] ; - int k ; - - printf (" %-40s : ", "test_endswap_int64_t") ; - fflush (stdout) ; - - for (k = 0 ; k < ARRAY_LEN (orig) ; k++) - orig [k] = 0x0807050540302010LL + k ; - - endswap_int64_t_copy (first, orig, ARRAY_LEN (first)) ; - endswap_int64_t_copy (second, first, ARRAY_LEN (second)) ; - - if (memcmp (orig, first, sizeof (orig)) == 0) - { printf ("\n\nLine %d : test 1 : these two array should not be the same:\n\n", __LINE__) ; - dump_int64_t_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_int64_t_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - if (memcmp (orig, second, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 2 : these two array should be the same:\n\n", __LINE__) ; - dump_int64_t_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_int64_t_array ("second", second, ARRAY_LEN (second)) ; - exit (1) ; - } ; - - endswap_int64_t_array (first, ARRAY_LEN (first)) ; - - if (memcmp (orig, first, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 3 : these two array should be the same:\n\n", __LINE__) ; - dump_int64_t_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_int64_t_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - endswap_int64_t_copy (first, orig, ARRAY_LEN (first)) ; - endswap_int64_t_copy (first, first, ARRAY_LEN (first)) ; - - if (memcmp (orig, first, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 4 : these two array should be the same:\n\n", __LINE__) ; - dump_int64_t_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_int64_t_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - puts ("ok") ; -} /* test_endswap_int64_t */ - - - -void -test_endswap (void) -{ - test_endswap_short () ; - test_endswap_int () ; - test_endswap_int64_t () ; - -} /* test_endswap */ - diff --git a/libs/libsndfile/src/test_endswap.def b/libs/libsndfile/src/test_endswap.def deleted file mode 100644 index 9516e4d67c..0000000000 --- a/libs/libsndfile/src/test_endswap.def +++ /dev/null @@ -1,40 +0,0 @@ -autogen definitions test_endswap.tpl; - -int_type = { - name = short ; - value = 0x3210 ; - format = FMT_SHORT ; - } ; - -int_type = { - name = int ; - value = 0x76543210 ; - format = FMT_INT ; - } ; - -int_type = { - name = int64_t ; - value = "0x0807050540302010LL" ; - format = FMT_INT64 ; - } ; - -int_size = { - name = 16 ; - typename = int16_t ; - value = 0x4142 ; - strval = "AB" ; - } ; - -int_size = { - name = 32 ; - typename = int32_t ; - value = 0x30313233 ; - strval = "0123" ; - } ; - -int_size = { - name = 64 ; - typename = int64_t ; - value = 0x3031323334353637 ; - strval = "01234567" ; - } ; diff --git a/libs/libsndfile/src/test_endswap.tpl b/libs/libsndfile/src/test_endswap.tpl deleted file mode 100644 index 89b7d1473a..0000000000 --- a/libs/libsndfile/src/test_endswap.tpl +++ /dev/null @@ -1,151 +0,0 @@ -[+ AutoGen5 template c +] -/* -** Copyright (C) 2002-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include "common.h" -#include "sfendian.h" - -#include "test_main.h" - -#define FMT_SHORT "0x%04x\n" -#define FMT_INT "0x%08x\n" -#define FMT_INT64 "0x%016" PRIx64 "\n" - -/*============================================================================== -** Test functions. -*/ - -[+ FOR int_type +] -static void -dump_[+ (get "name") +]_array (const char * name, [+ (get "name") +] * data, int datalen) -{ int k ; - - printf ("%-6s : ", name) ; - for (k = 0 ; k < datalen ; k++) - printf ([+ (get "format") +], data [k]) ; - putchar ('\n') ; -} /* dump_[+ (get "name") +]_array */ - -static void -test_endswap_[+ (get "name") +] (void) -{ [+ (get "name") +] orig [4], first [4], second [4] ; - int k ; - - printf (" %-40s : ", "test_endswap_[+ (get "name") +]") ; - fflush (stdout) ; - - for (k = 0 ; k < ARRAY_LEN (orig) ; k++) - orig [k] = [+ (get "value") +] + k ; - - endswap_[+ (get "name") +]_copy (first, orig, ARRAY_LEN (first)) ; - endswap_[+ (get "name") +]_copy (second, first, ARRAY_LEN (second)) ; - - if (memcmp (orig, first, sizeof (orig)) == 0) - { printf ("\n\nLine %d : test 1 : these two array should not be the same:\n\n", __LINE__) ; - dump_[+ (get "name") +]_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_[+ (get "name") +]_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - if (memcmp (orig, second, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 2 : these two array should be the same:\n\n", __LINE__) ; - dump_[+ (get "name") +]_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_[+ (get "name") +]_array ("second", second, ARRAY_LEN (second)) ; - exit (1) ; - } ; - - endswap_[+ (get "name") +]_array (first, ARRAY_LEN (first)) ; - - if (memcmp (orig, first, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 3 : these two array should be the same:\n\n", __LINE__) ; - dump_[+ (get "name") +]_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_[+ (get "name") +]_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - endswap_[+ (get "name") +]_copy (first, orig, ARRAY_LEN (first)) ; - endswap_[+ (get "name") +]_copy (first, first, ARRAY_LEN (first)) ; - - if (memcmp (orig, first, sizeof (orig)) != 0) - { printf ("\n\nLine %d : test 4 : these two array should be the same:\n\n", __LINE__) ; - dump_[+ (get "name") +]_array ("orig", orig, ARRAY_LEN (orig)) ; - dump_[+ (get "name") +]_array ("first", first, ARRAY_LEN (first)) ; - exit (1) ; - } ; - - puts ("ok") ; -} /* test_endswap_[+ (get "name") +] */ -[+ ENDFOR int_type -+] - -[+ FOR int_size +] -static void -test_psf_put_be[+ (get "name") +] (void) -{ const char *test = "[+ (get "strval") +]" ; - uint8_t array [32] ; - int k ; - - printf (" %-40s : ", __func__) ; - fflush (stdout) ; - - for (k = 0 ; k < 10 ; k++) - { memset (array, 0, sizeof (array)) ; - - psf_put_be[+ (get "name") +] (array, k, [+ (get "value") +]) ; - if (memcmp (array + k, test, sizeof ([+ (get "typename") +])) != 0) - { printf ("\n\nLine %d : Put failed at index %d.\n", __LINE__, k) ; - exit (1) ; - } ; - if (psf_get_be[+ (get "name") +] (array, k) != [+ (get "value") +]) - { printf ("\n\nLine %d : Get failed at index %d.\n", __LINE__, k) ; - exit (1) ; - } ; - } ; - - puts ("ok") ; -} /* test_psf_put_be[+ (get "name") +] */ -[+ ENDFOR int_size -+] - -void -test_endswap (void) -{ -[+ FOR int_type -+] test_endswap_[+ (get "name") +] () ; -[+ ENDFOR int_type -+] - -[+ FOR int_size -+] test_psf_put_be[+ (get "name") +] () ; -[+ ENDFOR int_endsize -+] - -} /* test_endswap */ - diff --git a/libs/libsndfile/src/test_file_io.c b/libs/libsndfile/src/test_file_io.c deleted file mode 100644 index 08fccebd21..0000000000 --- a/libs/libsndfile/src/test_file_io.c +++ /dev/null @@ -1,438 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include -#include -#include - -#include "common.h" - -#include "test_main.h" - -static void make_data (int *data, int len, int seed) ; - -static void file_open_test (const char *filename) ; -static void file_read_write_test (const char *filename) ; -static void file_truncate_test (const char *filename) ; - -static void test_open_or_die (SF_PRIVATE *psf, int linenum) ; -static void test_close_or_die (SF_PRIVATE *psf, int linenum) ; - -static void test_write_or_die (SF_PRIVATE *psf, void *data, sf_count_t bytes, sf_count_t items, sf_count_t new_position, int linenum) ; -static void test_read_or_die (SF_PRIVATE *psf, void *data, sf_count_t bytes, sf_count_t items, sf_count_t new_position, int linenum) ; -static void test_equal_or_die (int *array1, int *array2, int len, int linenum) ; -static void test_seek_or_die (SF_PRIVATE *psf, sf_count_t offset, int whence, sf_count_t new_position, int linenum) ; - - - -/*============================================================================== -** Actual test functions. -*/ - -static void -file_open_test (const char *filename) -{ SF_PRIVATE sf_data, *psf ; - int error ; - - print_test_name ("Testing file open") ; - - memset (&sf_data, 0, sizeof (sf_data)) ; - psf = &sf_data ; - - /* Ensure that the file doesn't already exist. */ - if (unlink (filename) != 0 && errno != ENOENT) - { printf ("\n\nLine %d: unlink failed (%d) : %s\n\n", __LINE__, errno, strerror (errno)) ; - exit (1) ; - } ; - - psf->file.mode = SFM_READ ; - snprintf (psf->file.path.c, sizeof (psf->file.path.c), "%s", filename) ; - - /* Test that open for read fails if the file doesn't exist. */ - error = psf_fopen (psf) ; - if (error == 0) - { printf ("\n\nLine %d: psf_fopen() should have failed.\n\n", __LINE__) ; - exit (1) ; - } ; - - /* Reset error to zero. */ - psf->error = SFE_NO_ERROR ; - - /* Test file open in write mode. */ - psf->file.mode = SFM_WRITE ; - test_open_or_die (psf, __LINE__) ; - - test_close_or_die (psf, __LINE__) ; - - unlink (psf->file.path.c) ; - - /* Test file open in read/write mode for a non-existant file. */ - psf->file.mode = SFM_RDWR ; - test_open_or_die (psf, __LINE__) ; - - test_close_or_die (psf, __LINE__) ; - - /* Test file open in read/write mode for an existing file. */ - psf->file.mode = SFM_RDWR ; - test_open_or_die (psf, __LINE__) ; - - test_close_or_die (psf, __LINE__) ; - - unlink (psf->file.path.c) ; - puts ("ok") ; -} /* file_open_test */ - -static void -file_read_write_test (const char *filename) -{ static int data_out [512] ; - static int data_in [512] ; - - SF_PRIVATE sf_data, *psf ; - sf_count_t retval ; - - /* - ** Open a new file and write two blocks of data to the file. After each - ** write, test that psf_get_filelen() returns the new length. - */ - - print_test_name ("Testing file write") ; - - memset (&sf_data, 0, sizeof (sf_data)) ; - psf = &sf_data ; - snprintf (psf->file.path.c, sizeof (psf->file.path.c), "%s", filename) ; - - /* Test file open in write mode. */ - psf->file.mode = SFM_WRITE ; - test_open_or_die (psf, __LINE__) ; - - make_data (data_out, ARRAY_LEN (data_out), 1) ; - test_write_or_die (psf, data_out, sizeof (data_out [0]), ARRAY_LEN (data_out), sizeof (data_out), __LINE__) ; - - if ((retval = psf_get_filelen (psf)) != sizeof (data_out)) - { printf ("\n\nLine %d: file length after write is not correct (%" PRId64 " should be %zd).\n\n", __LINE__, retval, sizeof (data_out)) ; - if (retval == 0) - printf ("An fsync() may be necessary before fstat() in psf_get_filelen().\n\n") ; - exit (1) ; - } ; - - make_data (data_out, ARRAY_LEN (data_out), 2) ; - test_write_or_die (psf, data_out, ARRAY_LEN (data_out), sizeof (data_out [0]), 2 * sizeof (data_out), __LINE__) ; - - if ((retval = psf_get_filelen (psf)) != 2 * sizeof (data_out)) - { printf ("\n\nLine %d: file length after write is not correct. (%" PRId64 " should be %zd)\n\n", __LINE__, retval, 2 * sizeof (data_out)) ; - exit (1) ; - } ; - - test_close_or_die (psf, __LINE__) ; - puts ("ok") ; - - /* - ** Now open the file in read mode, check the file length and check - ** that the data is correct. - */ - - print_test_name ("Testing file read") ; - - /* Test file open in write mode. */ - psf->file.mode = SFM_READ ; - test_open_or_die (psf, __LINE__) ; - - make_data (data_out, ARRAY_LEN (data_out), 1) ; - test_read_or_die (psf, data_in, 1, sizeof (data_in), sizeof (data_in), __LINE__) ; - test_equal_or_die (data_out, data_in, ARRAY_LEN (data_out), __LINE__) ; - - make_data (data_out, ARRAY_LEN (data_out), 2) ; - test_read_or_die (psf, data_in, sizeof (data_in [0]), ARRAY_LEN (data_in), 2 * sizeof (data_in), __LINE__) ; - test_equal_or_die (data_out, data_in, ARRAY_LEN (data_out), __LINE__) ; - - test_close_or_die (psf, __LINE__) ; - - puts ("ok") ; - - /* - ** Open the file in read/write mode, seek around a bit and then seek to - ** the end of the file and write another block of data (3rd block). Then - ** go back and check that all three blocks are correct. - */ - - print_test_name ("Testing file seek") ; - - /* Test file open in read/write mode. */ - psf->file.mode = SFM_RDWR ; - test_open_or_die (psf, __LINE__) ; - - test_seek_or_die (psf, 0, SEEK_SET, 0, __LINE__) ; - test_seek_or_die (psf, 0, SEEK_END, 2 * SIGNED_SIZEOF (data_out), __LINE__) ; - test_seek_or_die (psf, -1 * SIGNED_SIZEOF (data_out), SEEK_CUR, (sf_count_t) sizeof (data_out), __LINE__) ; - - test_seek_or_die (psf, SIGNED_SIZEOF (data_out), SEEK_CUR, 2 * SIGNED_SIZEOF (data_out), __LINE__) ; - make_data (data_out, ARRAY_LEN (data_out), 3) ; - test_write_or_die (psf, data_out, sizeof (data_out [0]), ARRAY_LEN (data_out), 3 * sizeof (data_out), __LINE__) ; - - test_seek_or_die (psf, 0, SEEK_SET, 0, __LINE__) ; - make_data (data_out, ARRAY_LEN (data_out), 1) ; - test_read_or_die (psf, data_in, 1, sizeof (data_in), sizeof (data_in), __LINE__) ; - test_equal_or_die (data_out, data_in, ARRAY_LEN (data_out), __LINE__) ; - - test_seek_or_die (psf, 2 * SIGNED_SIZEOF (data_out), SEEK_SET, 2 * SIGNED_SIZEOF (data_out), __LINE__) ; - make_data (data_out, ARRAY_LEN (data_out), 3) ; - test_read_or_die (psf, data_in, 1, sizeof (data_in), 3 * sizeof (data_in), __LINE__) ; - test_equal_or_die (data_out, data_in, ARRAY_LEN (data_out), __LINE__) ; - - test_seek_or_die (psf, SIGNED_SIZEOF (data_out), SEEK_SET, SIGNED_SIZEOF (data_out), __LINE__) ; - make_data (data_out, ARRAY_LEN (data_out), 2) ; - test_read_or_die (psf, data_in, 1, sizeof (data_in), 2 * sizeof (data_in), __LINE__) ; - test_equal_or_die (data_out, data_in, ARRAY_LEN (data_out), __LINE__) ; - - test_close_or_die (psf, __LINE__) ; - puts ("ok") ; - - /* - ** Now test operations with a non-zero psf->fileoffset field. This field - ** sets an artificial file start positions so that a seek to the start of - ** the file will actually be a seek to the value given by psf->fileoffset. - */ - - print_test_name ("Testing file offset") ; - - /* Test file open in read/write mode. */ - psf->file.mode = SFM_RDWR ; - psf->fileoffset = sizeof (data_out [0]) * ARRAY_LEN (data_out) ; - test_open_or_die (psf, __LINE__) ; - - if ((retval = psf_get_filelen (psf)) != 3 * sizeof (data_out)) - { printf ("\n\nLine %d: file length after write is not correct. (%" PRId64 " should be %zd)\n\n", __LINE__, retval, 3 * sizeof (data_out)) ; - exit (1) ; - } ; - - test_seek_or_die (psf, SIGNED_SIZEOF (data_out), SEEK_SET, SIGNED_SIZEOF (data_out), __LINE__) ; - make_data (data_out, ARRAY_LEN (data_out), 5) ; - test_write_or_die (psf, data_out, sizeof (data_out [0]), ARRAY_LEN (data_out), 2 * sizeof (data_out), __LINE__) ; - test_close_or_die (psf, __LINE__) ; - - /* final test with psf->fileoffset == 0. */ - - psf->file.mode = SFM_RDWR ; - psf->fileoffset = 0 ; - test_open_or_die (psf, __LINE__) ; - - if ((retval = psf_get_filelen (psf)) != 3 * sizeof (data_out)) - { printf ("\n\nLine %d: file length after write is not correct. (%" PRId64 " should be %zd)\n\n", __LINE__, retval, 3 * sizeof (data_out)) ; - exit (1) ; - } ; - - make_data (data_out, ARRAY_LEN (data_out), 1) ; - test_read_or_die (psf, data_in, 1, sizeof (data_in), sizeof (data_in), __LINE__) ; - test_equal_or_die (data_out, data_in, ARRAY_LEN (data_out), __LINE__) ; - - make_data (data_out, ARRAY_LEN (data_out), 2) ; - test_read_or_die (psf, data_in, 1, sizeof (data_in), 2 * sizeof (data_in), __LINE__) ; - test_equal_or_die (data_out, data_in, ARRAY_LEN (data_out), __LINE__) ; - - make_data (data_out, ARRAY_LEN (data_out), 5) ; - test_read_or_die (psf, data_in, 1, sizeof (data_in), 3 * sizeof (data_in), __LINE__) ; - test_equal_or_die (data_out, data_in, ARRAY_LEN (data_out), __LINE__) ; - - test_close_or_die (psf, __LINE__) ; - - puts ("ok") ; -} /* file_read_write_test */ - -static void -file_truncate_test (const char *filename) -{ SF_PRIVATE sf_data, *psf ; - unsigned char buffer [256] ; - int k ; - - /* - ** Open a new file and write two blocks of data to the file. After each - ** write, test that psf_get_filelen() returns the new length. - */ - - print_test_name ("Testing file truncate") ; - - memset (&sf_data, 0, sizeof (sf_data)) ; - memset (buffer, 0xEE, sizeof (buffer)) ; - - psf = &sf_data ; - snprintf (psf->file.path.c, sizeof (psf->file.path.c), "%s", filename) ; - - /* - ** Open the file write mode, write 0xEE data and then extend the file - ** using truncate (the extended data should be 0x00). - */ - psf->file.mode = SFM_WRITE ; - test_open_or_die (psf, __LINE__) ; - test_write_or_die (psf, buffer, sizeof (buffer) / 2, 1, sizeof (buffer) / 2, __LINE__) ; - psf_ftruncate (psf, sizeof (buffer)) ; - test_close_or_die (psf, __LINE__) ; - - /* Open the file in read mode and check the data. */ - psf->file.mode = SFM_READ ; - test_open_or_die (psf, __LINE__) ; - test_read_or_die (psf, buffer, sizeof (buffer), 1, sizeof (buffer), __LINE__) ; - test_close_or_die (psf, __LINE__) ; - - for (k = 0 ; k < SIGNED_SIZEOF (buffer) / 2 ; k++) - if (buffer [k] != 0xEE) - { printf ("\n\nLine %d : buffer [%d] = %d (should be 0xEE)\n\n", __LINE__, k, buffer [k]) ; - exit (1) ; - } ; - - for (k = SIGNED_SIZEOF (buffer) / 2 ; k < SIGNED_SIZEOF (buffer) ; k++) - if (buffer [k] != 0) - { printf ("\n\nLine %d : buffer [%d] = %d (should be 0)\n\n", __LINE__, k, buffer [k]) ; - exit (1) ; - } ; - - /* Open the file in read/write and shorten the file using truncate. */ - psf->file.mode = SFM_RDWR ; - test_open_or_die (psf, __LINE__) ; - psf_ftruncate (psf, sizeof (buffer) / 4) ; - test_close_or_die (psf, __LINE__) ; - - /* Check the file length. */ - psf->file.mode = SFM_READ ; - test_open_or_die (psf, __LINE__) ; - test_seek_or_die (psf, 0, SEEK_END, SIGNED_SIZEOF (buffer) / 4, __LINE__) ; - test_close_or_die (psf, __LINE__) ; - - puts ("ok") ; -} /* file_truncate_test */ - -/*============================================================================== -** Testing helper functions. -*/ - -static void -test_open_or_die (SF_PRIVATE *psf, int linenum) -{ int error ; - - /* Test that open for read fails if the file doesn't exist. */ - error = psf_fopen (psf) ; - if (error) - { printf ("\n\nLine %d: psf_fopen() failed : %s\n\n", linenum, strerror (errno)) ; - exit (1) ; - } ; - -} /* test_open_or_die */ - -static void -test_close_or_die (SF_PRIVATE *psf, int linenum) -{ - psf_fclose (psf) ; - if (psf_file_valid (psf)) - { printf ("\n\nLine %d: psf->file.filedes should not be valid.\n\n", linenum) ; - exit (1) ; - } ; - -} /* test_close_or_die */ - -static void -test_write_or_die (SF_PRIVATE *psf, void *data, sf_count_t bytes, sf_count_t items, sf_count_t new_position, int linenum) -{ sf_count_t retval ; - - retval = psf_fwrite (data, bytes, items, psf) ; - if (retval != items) - { printf ("\n\nLine %d: psf_write() returned %" PRId64 " (should be %" PRId64 ")\n\n", linenum, retval, items) ; - exit (1) ; - } ; - - if ((retval = psf_ftell (psf)) != new_position) - { printf ("\n\nLine %d: file length after write is not correct. (%" PRId64 " should be %" PRId64 ")\n\n", linenum, retval, new_position) ; - exit (1) ; - } ; - - return ; -} /* test_write_or_die */ - -static void -test_read_or_die (SF_PRIVATE *psf, void *data, sf_count_t bytes, sf_count_t items, sf_count_t new_position, int linenum) -{ sf_count_t retval ; - - retval = psf_fread (data, bytes, items, psf) ; - if (retval != items) - { printf ("\n\nLine %d: psf_write() returned %" PRId64 " (should be %" PRId64 ")\n\n", linenum, retval, items) ; - exit (1) ; - } ; - - if ((retval = psf_ftell (psf)) != new_position) - { printf ("\n\nLine %d: file length after write is not correct. (%" PRId64 " should be %" PRId64 ")\n\n", linenum, retval, new_position) ; - exit (1) ; - } ; - - return ; -} /* test_write_or_die */ - -static void -test_seek_or_die (SF_PRIVATE *psf, sf_count_t offset, int whence, sf_count_t new_position, int linenum) -{ sf_count_t retval ; - - retval = psf_fseek (psf, offset, whence) ; - - if (retval != new_position) - { printf ("\n\nLine %d: psf_fseek() failed. New position is %" PRId64 " (should be %" PRId64 ").\n\n", - linenum, retval, new_position) ; - exit (1) ; - } ; - -} /* test_seek_or_die */ - -static void -test_equal_or_die (int *array1, int *array2, int len, int linenum) -{ int k ; - - for (k = 0 ; k < len ; k++) - if (array1 [k] != array2 [k]) - printf ("\n\nLine %d: error at index %d (%d != %d).\n\n", - linenum, k, array1 [k], array2 [k]) ; - - return ; -} /* test_equal_or_die */ - -static void -make_data (int *data, int len, int seed) -{ int k ; - - srand (seed * 3333333 + 14756123) ; - - for (k = 0 ; k < len ; k++) - data [k] = rand () ; - -} /* make_data */ - -void -test_file_io (void) -{ const char *filename = "file_io.dat" ; - - file_open_test (filename) ; - file_read_write_test (filename) ; - file_truncate_test (filename) ; - - unlink (filename) ; -} /* main */ - diff --git a/libs/libsndfile/src/test_float.c b/libs/libsndfile/src/test_float.c deleted file mode 100644 index 07879896e5..0000000000 --- a/libs/libsndfile/src/test_float.c +++ /dev/null @@ -1,104 +0,0 @@ -/* -** Copyright (C) 2006-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "test_main.h" - -void -test_float_convert (void) -{ static float data [] = - { 0.0, 1.0, -1.0, 1.0 * M_PI, -1.0 * M_PI, - 1e9, -1e9, 1e-9, -1e-9, 1e-10, -1e-10, - 1e-19, -1e-19, 1e19, -1e19, 1e-20, -1e-20, - } ; - - int k ; - - print_test_name (__func__) ; - - for (k = 0 ; k < ARRAY_LEN (data) ; k++) - { unsigned char bytes [4] ; - float test ; - - float32_le_write (data [k], bytes) ; - test = float32_le_read (bytes) ; - - if (fabs (data [k] - test) > 1e-20) - { printf ("\n\nLine %d : Test %d, little endian error %.15g -> %.15g.\n\n", __LINE__, k, data [k], test) ; - exit (1) ; - } ; - - float32_be_write (data [k], bytes) ; - test = float32_be_read (bytes) ; - - if (fabs (data [k] - test) > 1e-20) - { printf ("\n\nLine %d : Test %d, big endian error %.15g -> %.15g.\n\n", __LINE__, k, data [k], test) ; - exit (1) ; - } ; - - } ; - - puts ("ok") ; -} /* test_float_convert */ - -void -test_double_convert (void) -{ static double data [] = - { 0.0, 1.0, -1.0, 1.0 * M_PI, -1.0 * M_PI, - 1e9, -1e9, 1e-9, -1e-9, 1e-10, -1e-10, - 1e-19, -1e-19, 1e19, -1e19, 1e-20, -1e-20, - } ; - - int k ; - - print_test_name (__func__) ; - - for (k = 0 ; k < ARRAY_LEN (data) ; k++) - { unsigned char bytes [8] ; - double test ; - - double64_le_write (data [k], bytes) ; - test = double64_le_read (bytes) ; - - if (fabs (data [k] - test) > 1e-20) - { printf ("\n\nLine %d : Test %d, little endian error %.15g -> %.15g.\n\n", __LINE__, k, data [k], test) ; - exit (1) ; - } ; - - double64_be_write (data [k], bytes) ; - test = double64_be_read (bytes) ; - - if (fabs (data [k] - test) > 1e-20) - { printf ("\n\nLine %d : Test %d, big endian error %.15g -> %.15g.\n\n", __LINE__, k, data [k], test) ; - exit (1) ; - } ; - - } ; - - puts ("ok") ; -} /* test_double_convert */ - diff --git a/libs/libsndfile/src/test_ima_oki_adpcm.c b/libs/libsndfile/src/test_ima_oki_adpcm.c deleted file mode 100644 index 6c937d1173..0000000000 --- a/libs/libsndfile/src/test_ima_oki_adpcm.c +++ /dev/null @@ -1,157 +0,0 @@ -/* -** Copyright (C) 2007-2011 Erik de Castro Lopo -** Copyright (c) 2007 -** -** This library is free software; you can redistribute it and/or modify it -** under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2 of the License, or (at -** your option) any later version. -** -** This library 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 Lesser -** General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this library. If not, write to the Free Software Foundation, -** Fifth Floor, 51 Franklin Street, Boston, MA 02111-1301, USA. -*/ - -#include "sfconfig.h" - -#include - -#include "test_main.h" - -#include "ima_oki_adpcm.c" - -static const unsigned char test_codes [] = -{ 0x08, 0x08, 0x04, 0x7f, 0x72, 0xf7, 0x9f, 0x7c, 0xd7, 0xbc, 0x7a, 0xa7, 0xb8, - 0x4b, 0x0b, 0x38, 0xf6, 0x9d, 0x7a, 0xd7, 0xbc, 0x7a, 0xd7, 0xa8, 0x6c, 0x81, - 0x98, 0xe4, 0x0e, 0x7a, 0xd7, 0x9e, 0x7b, 0xc7, 0xab, 0x7a, 0x85, 0xc0, 0xb3, - 0x8f, 0x58, 0xd7, 0xad, 0x7a, 0xd7, 0xad, 0x7a, 0x87, 0xd0, 0x2b, 0x0e, 0x48, - 0xd7, 0xad, 0x78, 0xf7, 0xbc, 0x7a, 0xb7, 0xa8, 0x4b, 0x88, 0x18, 0xd5, 0x8d, - 0x6a, 0xa4, 0x98, 0x08, 0x00, 0x80, 0x88, -} ; - -static const short test_pcm [] = -{ 32, 0, 32, 0, 32, 320, 880, -336, 2304, 4192, -992, 10128, 5360, -16352, - 30208, 2272, -31872, 14688, -7040, -32432, 14128, -1392, -15488, 22960, - 1232, -1584, 21488, -240, 2576, -15360, 960, -1152, -30032, 10320, 1008, - -30032, 16528, 1008, -30032, 16528, -5200, -30592, 15968, 448, -30592, - 15968, 448, -2368, 30960, 3024, -80, 8384, 704, -1616, -29168, -1232, 1872, - -32768, 13792, -1728, -32768, 13792, 4480, -32192, 14368, -7360, -32752, - 13808, -1712, -21456, 16992, 1472, -1344, 26848, -1088, 2016, -17728, 208, - -2112, -32768, 1376, -1728, -32768, 13792, -1728, -32768, 13792, -1728, - -32768, 13792, -1728, -32768, 13792, -1728, -4544, 32767, -1377, 1727, - 15823, -2113, 207, -27345, 591, -2513, -32768, 13792, -1728, -32768, 13792, - 10688, -31632, 14928, -6800, -32192, 14368, -1152, -20896, 17552, 2032, - -784, 22288, 560, -2256, -4816, 2176, 64, -21120, 9920, 6816, -24224, 16128, - 608, -13488, 9584, 272, -2544, 16, -2304, -192, 1728, -16, 1568, 128, -1184, -} ; - - -static void -test_oki_adpcm (void) -{ - IMA_OKI_ADPCM adpcm ; - unsigned char code ; - int i, j ; - - print_test_name ("Testing ima/oki encoder") ; - - ima_oki_adpcm_init (&adpcm, IMA_OKI_ADPCM_TYPE_OKI) ; - for (i = 0 ; i < ARRAY_LEN (test_codes) ; i++) - for (j = 0, code = test_codes [i] ; j < 2 ; j++, code <<= 4) - if (adpcm_decode (&adpcm, code >> 4) != test_pcm [2 * i + j]) - { printf ("\n\nFail at i = %d, j = %d.\n\n", i, j) ; - exit (1) ; - } ; - - puts ("ok") ; - - print_test_name ("Testing ima/oki decoder") ; - - ima_oki_adpcm_init (&adpcm, IMA_OKI_ADPCM_TYPE_OKI) ; - for (i = 0 ; i < ARRAY_LEN (test_pcm) - 1 ; i += 2) - { code = adpcm_encode (&adpcm, test_pcm [i]) ; - code = (code << 4) | adpcm_encode (&adpcm, test_pcm [i + 1]) ; - if (code != test_codes [i / 2]) - { printf ("\n\nFail at i = %d, %d should be %d\n\n", i, code, test_codes [i / 2]) ; - exit (1) ; - } ; - } ; - - puts ("ok") ; -} /* test_oki_adpcm */ - -static void -test_oki_adpcm_block (void) -{ - IMA_OKI_ADPCM adpcm ; - int k ; - - if (ARRAY_LEN (adpcm.pcm) < ARRAY_LEN (test_pcm)) - { printf ("\n\nLine %d : ARRAY_LEN (adpcm->pcm) > ARRAY_LEN (test_pcm) (%d > %d).\n\n", __LINE__, ARRAY_LEN (adpcm.pcm), ARRAY_LEN (test_pcm)) ; - exit (1) ; - } ; - - if (ARRAY_LEN (adpcm.codes) < ARRAY_LEN (test_codes)) - { printf ("\n\nLine %d : ARRAY_LEN (adcodes->codes) > ARRAY_LEN (test_codes).n", __LINE__) ; - exit (1) ; - } ; - - print_test_name ("Testing ima/oki block encoder") ; - - ima_oki_adpcm_init (&adpcm, IMA_OKI_ADPCM_TYPE_OKI) ; - - memcpy (adpcm.pcm, test_pcm, sizeof (adpcm.pcm [0]) * ARRAY_LEN (test_pcm)) ; - adpcm.pcm_count = ARRAY_LEN (test_pcm) ; - adpcm.code_count = 13 ; - - ima_oki_adpcm_encode_block (&adpcm) ; - - if (adpcm.code_count * 2 != ARRAY_LEN (test_pcm)) - { printf ("\n\nLine %d : %d * 2 != %d\n\n", __LINE__, adpcm.code_count * 2, ARRAY_LEN (test_pcm)) ; - exit (1) ; - } ; - - for (k = 0 ; k < ARRAY_LEN (test_codes) ; k++) - if (adpcm.codes [k] != test_codes [k]) - { printf ("\n\nLine %d : Fail at k = %d, %d should be %d\n\n", __LINE__, k, adpcm.codes [k], test_codes [k]) ; - exit (1) ; - } ; - - puts ("ok") ; - - print_test_name ("Testing ima/oki block decoder") ; - - ima_oki_adpcm_init (&adpcm, IMA_OKI_ADPCM_TYPE_OKI) ; - - memcpy (adpcm.codes, test_codes, sizeof (adpcm.codes [0]) * ARRAY_LEN (test_codes)) ; - adpcm.code_count = ARRAY_LEN (test_codes) ; - adpcm.pcm_count = 13 ; - - ima_oki_adpcm_decode_block (&adpcm) ; - - if (adpcm.pcm_count != 2 * ARRAY_LEN (test_codes)) - { printf ("\n\nLine %d : %d * 2 != %d\n\n", __LINE__, adpcm.pcm_count, 2 * ARRAY_LEN (test_codes)) ; - exit (1) ; - } ; - - for (k = 0 ; k < ARRAY_LEN (test_pcm) ; k++) - if (adpcm.pcm [k] != test_pcm [k]) - { printf ("\n\nLine %d : Fail at i = %d, %d should be %d.\n\n", __LINE__, k, adpcm.pcm [k], test_pcm [k]) ; - exit (1) ; - } ; - - puts ("ok") ; -} /* test_oki_adpcm_block */ - -void -test_ima_oki_adpcm (void) -{ - test_oki_adpcm () ; - test_oki_adpcm_block () ; -} /* main */ - diff --git a/libs/libsndfile/src/test_log_printf.c b/libs/libsndfile/src/test_log_printf.c deleted file mode 100644 index e1806a1484..0000000000 --- a/libs/libsndfile/src/test_log_printf.c +++ /dev/null @@ -1,123 +0,0 @@ -/* -** Copyright (C) 2003-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#include "common.h" - -#include "test_main.h" - -#define CMP_0_ARGS(line, err, fmt) \ - { psf->parselog.indx = 0 ; \ - snprintf (buffer, sizeof (buffer), (fmt)) ; \ - psf_log_printf (psf, (fmt)) ; \ - err += compare_strings_or_die (line, fmt, buffer, psf->parselog.buf) ; \ - } - -#define CMP_2_ARGS(line, err, fmt, a) \ - { psf->parselog.indx = 0 ; \ - snprintf (buffer, sizeof (buffer), (fmt), (a), (a)) ; \ - psf_log_printf (psf, (fmt), (a), (a)) ; \ - err += compare_strings_or_die (line, fmt, buffer, psf->parselog.buf) ; \ - } - -#define CMP_4_ARGS(line, err, fmt, a) \ - { psf->parselog.indx = 0 ; \ - snprintf (buffer, sizeof (buffer), (fmt), (a), (a), (a), (a)) ; \ - psf_log_printf (psf, (fmt), (a), (a), (a), (a)) ; \ - err += compare_strings_or_die (line, fmt, buffer, psf->parselog.buf) ; \ - } - -#define CMP_5_ARGS(line, err, fmt, a) \ - { psf->parselog.indx = 0 ; \ - snprintf (buffer, sizeof (buffer), (fmt), (a), (a), (a), (a), (a)) ; \ - psf_log_printf (psf, (fmt), (a), (a), (a), (a), (a)) ; \ - err += compare_strings_or_die (line, fmt, buffer, psf->parselog.buf) ; \ - } - -#define CMP_6_ARGS(line, err, fmt, a) \ - { psf->parselog.indx = 0 ; \ - snprintf (buffer, sizeof (buffer), (fmt), (a), (a), (a), (a), (a), (a)) ; \ - psf_log_printf (psf, (fmt), (a), (a), (a), (a), (a), (a)) ; \ - err += compare_strings_or_die (line, fmt, buffer, psf->parselog.buf) ; \ - } - -static int -compare_strings_or_die (int linenum, const char *fmt, const char* s1, const char* s2) -{ int errors = 0 ; -/*-puts (s1) ;puts (s2) ;-*/ - - if (strcmp (s1, s2) != 0) - { printf ("\n\nLine %d: string compare mismatch:\n\t", linenum) ; - printf ("\"%s\"\n", fmt) ; - printf ("\t\"%s\"\n\t\"%s\"\n", s1, s2) ; - errors ++ ; - } ; - - return errors ; -} /* compare_strings_or_die */ - -void -test_log_printf (void) -{ static char buffer [2048] ; - SF_PRIVATE sf_private, *psf ; - int k, errors = 0 ; - int int_values [] = { 0, 1, 12, 123, 1234, 123456, -1, -12, -123, -1234, -123456 } ; - - print_test_name ("Testing psf_log_printf") ; - - psf = &sf_private ; - memset (psf, 0, sizeof (sf_private)) ; - - CMP_0_ARGS (__LINE__, errors, " ->%%<- ") ; - - /* Test printing of ints. */ - for (k = 0 ; k < ARRAY_LEN (int_values) ; k++) - CMP_6_ARGS (__LINE__, errors, "int A : %d, % d, %4d, % 4d, %04d, % 04d", int_values [k]) ; - - for (k = 0 ; k < ARRAY_LEN (int_values) ; k++) - CMP_5_ARGS (__LINE__, errors, "int B : %+d, %+4d, %+04d, %-d, %-4d", int_values [k]) ; - - for (k = 0 ; k < ARRAY_LEN (int_values) ; k++) - CMP_2_ARGS (__LINE__, errors, "int C : %- d, %- 4d", int_values [k]) ; - - /* Test printing of unsigned ints. */ - for (k = 0 ; k < ARRAY_LEN (int_values) ; k++) - CMP_4_ARGS (__LINE__, errors, "D : %u, %4u, %04u, %0u", int_values [k]) ; - - /* Test printing of hex ints. */ - for (k = 0 ; k < ARRAY_LEN (int_values) ; k++) - CMP_4_ARGS (__LINE__, errors, "E : %X, %4X, %04X, %0X", int_values [k]) ; - - /* Test printing of strings. */ - CMP_4_ARGS (__LINE__, errors, "B %s, %3s, %8s, %-8s", "str") ; - - if (errors) - { puts ("\nExiting due to errors.\n") ; - exit (1) ; - } ; - - puts ("ok") ; -} /* test_log_printf */ - diff --git a/libs/libsndfile/src/test_main.c b/libs/libsndfile/src/test_main.c deleted file mode 100644 index f51f7c9ee6..0000000000 --- a/libs/libsndfile/src/test_main.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -** Copyright (C) 2008-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#include "test_main.h" - -int -main (void) -{ - test_conversions () ; - test_endswap () ; - test_float_convert () ; - test_double_convert () ; - - test_log_printf () ; - test_file_io () ; - - test_audio_detect () ; - test_ima_oki_adpcm () ; - - test_psf_strlcpy_crlf () ; - test_broadcast_var () ; - test_cart_var () ; - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/src/test_main.h b/libs/libsndfile/src/test_main.h deleted file mode 100644 index 6b2f28f4cd..0000000000 --- a/libs/libsndfile/src/test_main.h +++ /dev/null @@ -1,41 +0,0 @@ -/* -** Copyright (C) 2008-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -static inline void -print_test_name (const char * name) -{ printf (" %-40s : ", name) ; - fflush (stdout) ; -} /* print_test_name */ - - - -void test_conversions (void) ; -void test_endswap (void) ; -void test_log_printf (void) ; -void test_file_io (void) ; - -void test_float_convert (void) ; -void test_double_convert (void) ; - -void test_audio_detect (void) ; -void test_ima_oki_adpcm (void) ; - -void test_psf_strlcpy_crlf (void) ; -void test_broadcast_var (void) ; - -void test_cart_var (void) ; diff --git a/libs/libsndfile/src/test_strncpy_crlf.c b/libs/libsndfile/src/test_strncpy_crlf.c deleted file mode 100644 index 774ced1083..0000000000 --- a/libs/libsndfile/src/test_strncpy_crlf.c +++ /dev/null @@ -1,56 +0,0 @@ -/* -** Copyright (C) 2010-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include - -#include "common.h" - -#include "test_main.h" - -void -test_psf_strlcpy_crlf (void) -{ const char *src = "a\nb\nc\n" ; - char *dest ; - int dest_len ; - - print_test_name ("Testing psf_strlcpy_crlf") ; - - for (dest_len = 3 ; dest_len < 30 ; dest_len++) - { dest = calloc (1, dest_len + 1) ; - if (dest == NULL) - { printf ("\n\nLine %d: calloc failed!\n\n", __LINE__) ; - exit (1) ; - } ; - - dest [dest_len] = '\xea' ; - - psf_strlcpy_crlf (dest, src, dest_len, sizeof (*src)) ; - - if (dest [dest_len] != '\xea') - { printf ("\n\nLine %d: buffer overrun for dest_len == %d\n\n", __LINE__, dest_len) ; - exit (1) ; - } ; - - free (dest) ; - } ; - - puts ("ok") ; -} /* test_psf_strlcpy_crlf */ diff --git a/libs/libsndfile/src/txw.c b/libs/libsndfile/src/txw.c deleted file mode 100644 index 16525dfe29..0000000000 --- a/libs/libsndfile/src/txw.c +++ /dev/null @@ -1,377 +0,0 @@ -/* -** Copyright (C) 2002-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/*=========================================================================== -** Yamaha TX16 Sampler Files. -** -** This header parser was written using information from the SoX source code -** and trial and error experimentation. The code here however is all original. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#if (ENABLE_EXPERIMENTAL_CODE == 0) - -int -txw_open (SF_PRIVATE *psf) -{ if (psf) - return SFE_UNIMPLEMENTED ; - return 0 ; -} /* txw_open */ - -#else - -/*------------------------------------------------------------------------------ -** Markers. -*/ - -#define TXW_DATA_OFFSET 32 - -#define TXW_LOOPED 0x49 -#define TXW_NO_LOOP 0xC9 - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int txw_read_header (SF_PRIVATE *psf) ; - -static sf_count_t txw_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t txw_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t txw_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t txw_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t txw_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; - -/*------------------------------------------------------------------------------ -** Public functions. -*/ - -/* - * ftp://ftp.t0.or.at/pub/sound/tx16w/samples.yamaha - * ftp://ftp.t0.or.at/pub/sound/tx16w/faq/tx16w.tec - * http://www.t0.or.at/~mpakesch/tx16w/ - * - * from tx16w.c sox 12.15: (7-Oct-98) (Mark Lakata and Leigh Smith) - * char filetype[6] "LM8953" - * nulls[10], - * dummy_aeg[6] - * format 0x49 = looped, 0xC9 = non-looped - * sample_rate 1 = 33 kHz, 2 = 50 kHz, 3 = 16 kHz - * atc_length[3] if sample rate 0, [2]&0xfe = 6: 33kHz, 0x10:50, 0xf6: 16, - * depending on [5] but to heck with it - * rpt_length[3] (these are for looped samples, attack and loop lengths) - * unused[2] - */ - -typedef struct -{ unsigned char format, srate, sr2, sr3 ; - unsigned short srhash ; - unsigned int attacklen, repeatlen ; -} TXW_HEADER ; - -#define ERROR_666 666 - -int -txw_open (SF_PRIVATE *psf) -{ int error ; - - if (psf->file.mode != SFM_READ) - return SFE_UNIMPLEMENTED ; - - if ((error = txw_read_header (psf))) - return error ; - - if (psf_fseek (psf, psf->dataoffset, SEEK_SET) != psf->dataoffset) - return SFE_BAD_SEEK ; - - psf->read_short = txw_read_s ; - psf->read_int = txw_read_i ; - psf->read_float = txw_read_f ; - psf->read_double = txw_read_d ; - - psf->seek = txw_seek ; - - return 0 ; -} /* txw_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -txw_read_header (SF_PRIVATE *psf) -{ BUF_UNION ubuf ; - TXW_HEADER txwh ; - const char *strptr ; - - memset (&txwh, 0, sizeof (txwh)) ; - memset (ubuf.cbuf, 0, sizeof (ubuf.cbuf)) ; - psf_binheader_readf (psf, "pb", 0, ubuf.cbuf, 16) ; - - if (memcmp (ubuf.cbuf, "LM8953\0\0\0\0\0\0\0\0\0\0", 16) != 0) - return ERROR_666 ; - - psf_log_printf (psf, "Read only : Yamaha TX-16 Sampler (.txw)\nLM8953\n") ; - - /* Jump 6 bytes (dummp_aeg), read format, read sample rate. */ - psf_binheader_readf (psf, "j11", 6, &txwh.format, &txwh.srate) ; - - /* 8 bytes (atc_length[3], rpt_length[3], unused[2]). */ - psf_binheader_readf (psf, "e33j", &txwh.attacklen, &txwh.repeatlen, 2) ; - txwh.sr2 = (txwh.attacklen >> 16) & 0xFE ; - txwh.sr3 = (txwh.repeatlen >> 16) & 0xFE ; - txwh.attacklen &= 0x1FFFF ; - txwh.repeatlen &= 0x1FFFF ; - - switch (txwh.format) - { case TXW_LOOPED : - strptr = "looped" ; - break ; - - case TXW_NO_LOOP : - strptr = "non-looped" ; - break ; - - default : - psf_log_printf (psf, " Format : 0x%02x => ?????\n", txwh.format) ; - return ERROR_666 ; - } ; - - psf_log_printf (psf, " Format : 0x%02X => %s\n", txwh.format, strptr) ; - - strptr = NULL ; - - switch (txwh.srate) - { case 1 : - psf->sf.samplerate = 33333 ; - break ; - - case 2 : - psf->sf.samplerate = 50000 ; - break ; - - case 3 : - psf->sf.samplerate = 16667 ; - break ; - - default : - /* This is ugly and braindead. */ - txwh.srhash = ((txwh.sr2 & 0xFE) << 8) | (txwh.sr3 & 0xFE) ; - switch (txwh.srhash) - { case ((0x6 << 8) | 0x52) : - psf->sf.samplerate = 33333 ; - break ; - - case ((0x10 << 8) | 0x52) : - psf->sf.samplerate = 50000 ; - break ; - - case ((0xF6 << 8) | 0x52) : - psf->sf.samplerate = 166667 ; - break ; - - default : - strptr = " Sample Rate : Unknown : forcing to 33333\n" ; - psf->sf.samplerate = 33333 ; - break ; - } ; - } ; - - - if (strptr) - psf_log_printf (psf, strptr) ; - else if (txwh.srhash) - psf_log_printf (psf, " Sample Rate : %d (0x%X) => %d\n", txwh.srate, txwh.srhash, psf->sf.samplerate) ; - else - psf_log_printf (psf, " Sample Rate : %d => %d\n", txwh.srate, psf->sf.samplerate) ; - - if (txwh.format == TXW_LOOPED) - { psf_log_printf (psf, " Attack Len : %d\n", txwh.attacklen) ; - psf_log_printf (psf, " Repeat Len : %d\n", txwh.repeatlen) ; - } ; - - psf->dataoffset = TXW_DATA_OFFSET ; - psf->datalength = psf->filelength - TXW_DATA_OFFSET ; - psf->sf.frames = 2 * psf->datalength / 3 ; - - - if (psf->datalength % 3 == 1) - psf_log_printf (psf, "*** File seems to be truncated, %d extra bytes.\n", - (int) (psf->datalength % 3)) ; - - if (txwh.attacklen + txwh.repeatlen > psf->sf.frames) - psf_log_printf (psf, "*** File has been truncated.\n") ; - - psf->sf.format = SF_FORMAT_TXW | SF_FORMAT_PCM_16 ; - psf->sf.channels = 1 ; - psf->sf.sections = 1 ; - psf->sf.seekable = SF_TRUE ; - - return 0 ; -} /* txw_read_header */ - -static sf_count_t -txw_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - unsigned char *ucptr ; - short sample ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - - bufferlen = sizeof (ubuf.cbuf) / 3 ; - bufferlen -= (bufferlen & 1) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = psf_fread (ubuf.cbuf, 3, readcount, psf) ; - - ucptr = ubuf.ucbuf ; - for (k = 0 ; k < readcount ; k += 2) - { sample = (ucptr [0] << 8) | (ucptr [1] & 0xF0) ; - ptr [total + k] = sample ; - sample = (ucptr [2] << 8) | ((ucptr [1] & 0xF) << 4) ; - ptr [total + k + 1] = sample ; - ucptr += 3 ; - } ; - - total += count ; - len -= readcount ; - } ; - - return total ; -} /* txw_read_s */ - -static sf_count_t -txw_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - unsigned char *ucptr ; - short sample ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - - bufferlen = sizeof (ubuf.cbuf) / 3 ; - bufferlen -= (bufferlen & 1) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = psf_fread (ubuf.cbuf, 3, readcount, psf) ; - - ucptr = ubuf.ucbuf ; - for (k = 0 ; k < readcount ; k += 2) - { sample = (ucptr [0] << 8) | (ucptr [1] & 0xF0) ; - ptr [total + k] = sample << 16 ; - sample = (ucptr [2] << 8) | ((ucptr [1] & 0xF) << 4) ; - ptr [total + k + 1] = sample << 16 ; - ucptr += 3 ; - } ; - - total += count ; - len -= readcount ; - } ; - - return total ; -} /* txw_read_i */ - -static sf_count_t -txw_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - unsigned char *ucptr ; - short sample ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - float normfact ; - - if (psf->norm_float == SF_TRUE) - normfact = 1.0 / 0x8000 ; - else - normfact = 1.0 / 0x10 ; - - bufferlen = sizeof (ubuf.cbuf) / 3 ; - bufferlen -= (bufferlen & 1) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = psf_fread (ubuf.cbuf, 3, readcount, psf) ; - - ucptr = ubuf.ucbuf ; - for (k = 0 ; k < readcount ; k += 2) - { sample = (ucptr [0] << 8) | (ucptr [1] & 0xF0) ; - ptr [total + k] = normfact * sample ; - sample = (ucptr [2] << 8) | ((ucptr [1] & 0xF) << 4) ; - ptr [total + k + 1] = normfact * sample ; - ucptr += 3 ; - } ; - - total += count ; - len -= readcount ; - } ; - - return total ; -} /* txw_read_f */ - -static sf_count_t -txw_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - unsigned char *ucptr ; - short sample ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - double normfact ; - - if (psf->norm_double == SF_TRUE) - normfact = 1.0 / 0x8000 ; - else - normfact = 1.0 / 0x10 ; - - bufferlen = sizeof (ubuf.cbuf) / 3 ; - bufferlen -= (bufferlen & 1) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : len ; - count = psf_fread (ubuf.cbuf, 3, readcount, psf) ; - - ucptr = ubuf.ucbuf ; - for (k = 0 ; k < readcount ; k += 2) - { sample = (ucptr [0] << 8) | (ucptr [1] & 0xF0) ; - ptr [total + k] = normfact * sample ; - sample = (ucptr [2] << 8) | ((ucptr [1] & 0xF) << 4) ; - ptr [total + k + 1] = normfact * sample ; - ucptr += 3 ; - } ; - - total += count ; - len -= readcount ; - } ; - - return total ; -} /* txw_read_d */ - -static sf_count_t -txw_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) -{ if (psf && mode) - return offset ; - - return 0 ; -} /* txw_seek */ - -#endif diff --git a/libs/libsndfile/src/ulaw.c b/libs/libsndfile/src/ulaw.c deleted file mode 100644 index ded46e929c..0000000000 --- a/libs/libsndfile/src/ulaw.c +++ /dev/null @@ -1,1051 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include - -#include "sndfile.h" -#include "common.h" - -static sf_count_t ulaw_read_ulaw2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t ulaw_read_ulaw2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t ulaw_read_ulaw2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t ulaw_read_ulaw2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t ulaw_write_s2ulaw (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t ulaw_write_i2ulaw (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t ulaw_write_f2ulaw (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t ulaw_write_d2ulaw (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -int -ulaw_init (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_READ || psf->file.mode == SFM_RDWR) - { psf->read_short = ulaw_read_ulaw2s ; - psf->read_int = ulaw_read_ulaw2i ; - psf->read_float = ulaw_read_ulaw2f ; - psf->read_double = ulaw_read_ulaw2d ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { psf->write_short = ulaw_write_s2ulaw ; - psf->write_int = ulaw_write_i2ulaw ; - psf->write_float = ulaw_write_f2ulaw ; - psf->write_double = ulaw_write_d2ulaw ; - } ; - - psf->bytewidth = 1 ; - psf->blockwidth = psf->sf.channels ; - - if (psf->filelength > psf->dataoffset) - psf->datalength = (psf->dataend) ? psf->dataend - psf->dataoffset : - psf->filelength - psf->dataoffset ; - else - psf->datalength = 0 ; - - psf->sf.frames = psf->blockwidth > 0 ? psf->datalength / psf->blockwidth : 0 ; - - return 0 ; -} /* ulaw_init */ - -/*============================================================================== -*/ - -static short ulaw_decode [256] = -{ -32124, -31100, -30076, -29052, -28028, -27004, -25980, -24956, - -23932, -22908, -21884, -20860, -19836, -18812, -17788, -16764, - -15996, -15484, -14972, -14460, -13948, -13436, -12924, -12412, - -11900, -11388, -10876, -10364, -9852, -9340, -8828, -8316, - -7932, -7676, -7420, -7164, -6908, -6652, -6396, -6140, - -5884, -5628, -5372, -5116, -4860, -4604, -4348, -4092, - -3900, -3772, -3644, -3516, -3388, -3260, -3132, -3004, - -2876, -2748, -2620, -2492, -2364, -2236, -2108, -1980, - -1884, -1820, -1756, -1692, -1628, -1564, -1500, -1436, - -1372, -1308, -1244, -1180, -1116, -1052, -988, -924, - -876, -844, -812, -780, -748, -716, -684, -652, - -620, -588, -556, -524, -492, -460, -428, -396, - -372, -356, -340, -324, -308, -292, -276, -260, - -244, -228, -212, -196, -180, -164, -148, -132, - -120, -112, -104, -96, -88, -80, -72, -64, - -56, -48, -40, -32, -24, -16, -8, 0, - - 32124, 31100, 30076, 29052, 28028, 27004, 25980, 24956, - 23932, 22908, 21884, 20860, 19836, 18812, 17788, 16764, - 15996, 15484, 14972, 14460, 13948, 13436, 12924, 12412, - 11900, 11388, 10876, 10364, 9852, 9340, 8828, 8316, - 7932, 7676, 7420, 7164, 6908, 6652, 6396, 6140, - 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092, - 3900, 3772, 3644, 3516, 3388, 3260, 3132, 3004, - 2876, 2748, 2620, 2492, 2364, 2236, 2108, 1980, - 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436, - 1372, 1308, 1244, 1180, 1116, 1052, 988, 924, - 876, 844, 812, 780, 748, 716, 684, 652, - 620, 588, 556, 524, 492, 460, 428, 396, - 372, 356, 340, 324, 308, 292, 276, 260, - 244, 228, 212, 196, 180, 164, 148, 132, - 120, 112, 104, 96, 88, 80, 72, 64, - 56, 48, 40, 32, 24, 16, 8, 0 -} ; - -static -unsigned char ulaw_encode [8193] = -{ 0xff, 0xfe, 0xfe, 0xfd, 0xfd, 0xfc, 0xfc, 0xfb, 0xfb, 0xfa, 0xfa, 0xf9, - 0xf9, 0xf8, 0xf8, 0xf7, 0xf7, 0xf6, 0xf6, 0xf5, 0xf5, 0xf4, 0xf4, 0xf3, - 0xf3, 0xf2, 0xf2, 0xf1, 0xf1, 0xf0, 0xf0, 0xef, 0xef, 0xef, 0xef, 0xee, - 0xee, 0xee, 0xee, 0xed, 0xed, 0xed, 0xed, 0xec, 0xec, 0xec, 0xec, 0xeb, - 0xeb, 0xeb, 0xeb, 0xea, 0xea, 0xea, 0xea, 0xe9, 0xe9, 0xe9, 0xe9, 0xe8, - 0xe8, 0xe8, 0xe8, 0xe7, 0xe7, 0xe7, 0xe7, 0xe6, 0xe6, 0xe6, 0xe6, 0xe5, - 0xe5, 0xe5, 0xe5, 0xe4, 0xe4, 0xe4, 0xe4, 0xe3, 0xe3, 0xe3, 0xe3, 0xe2, - 0xe2, 0xe2, 0xe2, 0xe1, 0xe1, 0xe1, 0xe1, 0xe0, 0xe0, 0xe0, 0xe0, 0xdf, - 0xdf, 0xdf, 0xdf, 0xdf, 0xdf, 0xdf, 0xdf, 0xde, 0xde, 0xde, 0xde, 0xde, - 0xde, 0xde, 0xde, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdc, - 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, - 0xdb, 0xdb, 0xdb, 0xda, 0xda, 0xda, 0xda, 0xda, 0xda, 0xda, 0xda, 0xd9, - 0xd9, 0xd9, 0xd9, 0xd9, 0xd9, 0xd9, 0xd9, 0xd8, 0xd8, 0xd8, 0xd8, 0xd8, - 0xd8, 0xd8, 0xd8, 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, 0xd7, 0xd6, - 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd5, 0xd5, 0xd5, 0xd5, 0xd5, - 0xd5, 0xd5, 0xd5, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd3, - 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, 0xd2, 0xd2, 0xd2, 0xd2, 0xd2, - 0xd2, 0xd2, 0xd2, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd1, 0xd0, - 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xd0, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, - 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xcf, 0xce, - 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, 0xce, - 0xce, 0xce, 0xce, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, - 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, - 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcb, - 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, 0xcb, - 0xcb, 0xcb, 0xcb, 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, - 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, 0xca, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, - 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc9, 0xc8, - 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, - 0xc8, 0xc8, 0xc8, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, - 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc5, - 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, 0xc5, - 0xc5, 0xc5, 0xc5, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, - 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, - 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc2, - 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, - 0xc2, 0xc2, 0xc2, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, - 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xbf, - 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, - 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, - 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, - 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, - 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, - 0xbe, 0xbe, 0xbe, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, - 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, - 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbc, - 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, - 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, - 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, - 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, - 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, - 0xbb, 0xbb, 0xbb, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, - 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, - 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xba, 0xb9, - 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, - 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, - 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, - 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, - 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, 0xb8, - 0xb8, 0xb8, 0xb8, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, - 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, - 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb7, 0xb6, - 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, - 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, - 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb6, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, - 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, - 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, - 0xb5, 0xb5, 0xb5, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, - 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, - 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb4, 0xb3, - 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, - 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, - 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, - 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, - 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, 0xb2, - 0xb2, 0xb2, 0xb2, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, - 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, - 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb1, 0xb0, - 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, - 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, - 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xb0, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, - 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, - 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, - 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, - 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, - 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xaf, 0xae, - 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, - 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, - 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, - 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, - 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, 0xae, - 0xae, 0xae, 0xae, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, - 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, - 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, - 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, - 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, - 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xad, 0xac, 0xac, 0xac, 0xac, 0xac, - 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, - 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, - 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, - 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, - 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xac, 0xab, - 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, - 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, - 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, - 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, - 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, - 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, - 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa9, 0xa8, - 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, - 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, - 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, - 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, - 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, 0xa8, - 0xa8, 0xa8, 0xa8, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, - 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, - 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, - 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, - 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, - 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa7, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa5, - 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, - 0xa5, 0xa5, 0xa5, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, - 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, - 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, - 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, - 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, - 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, - 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, - 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, - 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, - 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, - 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa2, - 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, - 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, - 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, - 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, - 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, - 0xa2, 0xa2, 0xa2, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, - 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, - 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, - 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, - 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, - 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa1, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, - 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, - 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, - 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, - 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, - 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0x9f, - 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, - 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, - 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, - 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, - 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, - 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, - 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, - 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, - 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, - 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, - 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, - 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, - 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, - 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, - 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, - 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, - 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, - 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, - 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, - 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, - 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, - 0x9e, 0x9e, 0x9e, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, - 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, - 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, - 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, - 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, - 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, - 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, - 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, - 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, - 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, - 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9d, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, - 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9c, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, - 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, - 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, - 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, - 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, - 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, - 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, - 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, - 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, - 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, - 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, 0x9b, - 0x9b, 0x9b, 0x9b, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, - 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, - 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, - 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, - 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, - 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, - 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, - 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, - 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, - 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, - 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x9a, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, - 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, - 0x98, 0x98, 0x98, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, - 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, - 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, - 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, - 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, - 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, - 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, - 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, - 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, - 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, - 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, - 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x96, 0x95, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, - 0x95, 0x95, 0x95, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, - 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, - 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, - 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, - 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, - 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, - 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, - 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, - 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, - 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, - 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, - 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, - 0x92, 0x92, 0x92, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, - 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, - 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, - 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, - 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, - 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, - 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, - 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, - 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, - 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, - 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x90, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, - 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, - 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, 0x8e, - 0x8e, 0x8e, 0x8e, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, - 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8d, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, - 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8c, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, 0x8b, - 0x8b, 0x8b, 0x8b, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, - 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x8a, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, - 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, - 0x88, 0x88, 0x88, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, - 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, - 0x85, 0x85, 0x85, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, - 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, - 0x82, 0x82, 0x82, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, - 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 -} ; - -static inline void -ulaw2s_array (unsigned char *buffer, int count, short *ptr) -{ while (--count >= 0) - ptr [count] = ulaw_decode [(int) buffer [count]] ; -} /* ulaw2s_array */ - -static inline void -ulaw2i_array (unsigned char *buffer, int count, int *ptr) -{ while (--count >= 0) - ptr [count] = ulaw_decode [buffer [count]] << 16 ; -} /* ulaw2i_array */ - -static inline void -ulaw2f_array (unsigned char *buffer, int count, float *ptr, float normfact) -{ while (--count >= 0) - ptr [count] = normfact * ulaw_decode [(int) buffer [count]] ; -} /* ulaw2f_array */ - -static inline void -ulaw2d_array (const unsigned char *buffer, int count, double *ptr, double normfact) -{ while (--count >= 0) - ptr [count] = normfact * ulaw_decode [(int) buffer [count]] ; -} /* ulaw2d_array */ - -static inline void -s2ulaw_array (const short *ptr, int count, unsigned char *buffer) -{ while (--count >= 0) - { if (ptr [count] >= 0) - buffer [count] = ulaw_encode [ptr [count] / 4] ; - else - buffer [count] = 0x7F & ulaw_encode [ptr [count] / -4] ; - } ; -} /* s2ulaw_array */ - -static inline void -i2ulaw_array (const int *ptr, int count, unsigned char *buffer) -{ while (--count >= 0) - { if (ptr [count] >= 0) - buffer [count] = ulaw_encode [ptr [count] >> (16 + 2)] ; - else - buffer [count] = 0x7F & ulaw_encode [-ptr [count] >> (16 + 2)] ; - } ; -} /* i2ulaw_array */ - -static inline void -f2ulaw_array (const float *ptr, int count, unsigned char *buffer, float normfact) -{ while (--count >= 0) - { if (ptr [count] >= 0) - buffer [count] = ulaw_encode [lrintf (normfact * ptr [count])] ; - else - buffer [count] = 0x7F & ulaw_encode [- lrintf (normfact * ptr [count])] ; - } ; -} /* f2ulaw_array */ - -static inline void -d2ulaw_array (const double *ptr, int count, unsigned char *buffer, double normfact) -{ while (--count >= 0) - { if (ptr [count] >= 0) - buffer [count] = ulaw_encode [lrint (normfact * ptr [count])] ; - else - buffer [count] = 0x7F & ulaw_encode [- lrint (normfact * ptr [count])] ; - } ; -} /* d2ulaw_array */ - -/*============================================================================== -*/ - -static sf_count_t -ulaw_read_ulaw2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ; - ulaw2s_array (ubuf.ucbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* ulaw_read_ulaw2s */ - -static sf_count_t -ulaw_read_ulaw2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ; - ulaw2i_array (ubuf.ucbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* ulaw_read_ulaw2i */ - -static sf_count_t -ulaw_read_ulaw2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x8000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ; - ulaw2f_array (ubuf.ucbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* ulaw_read_ulaw2f */ - -static sf_count_t -ulaw_read_ulaw2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - normfact = (psf->norm_double) ? 1.0 / ((double) 0x8000) : 1.0 ; - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.ucbuf, 1, bufferlen, psf) ; - ulaw2d_array (ubuf.ucbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* ulaw_read_ulaw2d */ - -/*============================================================================================= -*/ - -static sf_count_t -ulaw_write_s2ulaw (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2ulaw_array (ptr + total, bufferlen, ubuf.ucbuf) ; - writecount = psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* ulaw_write_s2ulaw */ - -static sf_count_t -ulaw_write_i2ulaw (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2ulaw_array (ptr + total, bufferlen, ubuf.ucbuf) ; - writecount = psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* ulaw_write_i2ulaw */ - -static sf_count_t -ulaw_write_f2ulaw (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - float normfact ; - - /* Factor in a divide by 4. */ - normfact = (psf->norm_float == SF_TRUE) ? (0.25 * 0x7FFF) : 0.25 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - f2ulaw_array (ptr + total, bufferlen, ubuf.ucbuf, normfact) ; - writecount = psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* ulaw_write_f2ulaw */ - -static sf_count_t -ulaw_write_d2ulaw (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - double normfact ; - - /* Factor in a divide by 4. */ - normfact = (psf->norm_double) ? (0.25 * 0x7FFF) : 0.25 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - d2ulaw_array (ptr + total, bufferlen, ubuf.ucbuf, normfact) ; - writecount = psf_fwrite (ubuf.ucbuf, 1, bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* ulaw_write_d2ulaw */ - diff --git a/libs/libsndfile/src/version-metadata.rc.in b/libs/libsndfile/src/version-metadata.rc.in deleted file mode 100644 index ed79b22ad1..0000000000 --- a/libs/libsndfile/src/version-metadata.rc.in +++ /dev/null @@ -1,32 +0,0 @@ -#include - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS -1 VERSIONINFO - FILEVERSION @WIN_RC_VERSION@,0 - PRODUCTVERSION @WIN_RC_VERSION@,0 - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN - FILEFLAGSMASK 0x00000000 - FILEFLAGS 0x00000000 -{ - BLOCK "StringFileInfo" - { - BLOCK "040904e4" - { - VALUE "FileDescription", "A library for reading and writing audio files." - VALUE "FileVersion", "@CLEAN_VERSION@.0\0" - VALUE "Full Version", "@PACKAGE_VERSION@" - VALUE "InternalName", "libsndfile" - VALUE "LegalCopyright", "Copyright (C) 1999-2012, Licensed LGPL" - VALUE "OriginalFilename", "libsndfile-1.dll" - VALUE "ProductName", "libsndfile-1 DLL" - VALUE "ProductVersion", "@CLEAN_VERSION@.0\0" - VALUE "Language", "Language Neutral" - } - } - BLOCK "VarFileInfo" - { - VALUE "Translation", 0x0409, 0x04E4 - } -} diff --git a/libs/libsndfile/src/voc.c b/libs/libsndfile/src/voc.c deleted file mode 100644 index d13b03311b..0000000000 --- a/libs/libsndfile/src/voc.c +++ /dev/null @@ -1,882 +0,0 @@ -/* -** Copyright (C) 2001-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* RANT: -** The VOC file format is the most brain damaged format I have yet had to deal -** with. No one programmer could have bee stupid enough to put this together. -** Instead it looks like a series of manic, dyslexic assembly language programmers -** hacked it to fit their needs. -** Utterly woeful. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - - -/*------------------------------------------------------------------------------ - * Typedefs for file chunks. -*/ - -#define VOC_MAX_SECTIONS 200 - -enum -{ VOC_TERMINATOR = 0, - VOC_SOUND_DATA = 1, - VOC_SOUND_CONTINUE = 2, - VOC_SILENCE = 3, - VOC_MARKER = 4, - VOC_ASCII = 5, - VOC_REPEAT = 6, - VOC_END_REPEAT = 7, - VOC_EXTENDED = 8, - VOC_EXTENDED_II = 9 -} ; - -typedef struct -{ int samples ; - int offset ; /* Offset of zero => silence. */ -} SND_DATA_BLOCKS ; - -typedef struct -{ unsigned int sections, section_types ; - int samplerate, channels, bitwidth ; - SND_DATA_BLOCKS blocks [VOC_MAX_SECTIONS] ; -} VOC_DATA ; - -/*------------------------------------------------------------------------------ - * Private static functions. -*/ - -static int voc_close (SF_PRIVATE *psf) ; -static int voc_write_header (SF_PRIVATE *psf, int calc_length) ; -static int voc_read_header (SF_PRIVATE *psf) ; - -static const char* voc_encoding2str (int encoding) ; - -#if 0 - -/* These functions would be required for files with more than one VOC_SOUND_DATA -** segment. Not sure whether to bother implementing this. -*/ - -static int voc_multi_init (SF_PRIVATE *psf, VOC_DATA *pvoc) ; - -static int voc_multi_read_uc2s (SF_PRIVATE *psf, short *ptr, int len) ; -static int voc_multi_read_les2s (SF_PRIVATE *psf, short *ptr, int len) ; - -static int voc_multi_read_uc2i (SF_PRIVATE *psf, int *ptr, int len) ; -static int voc_multi_read_les2i (SF_PRIVATE *psf, int *ptr, int len) ; - -static int voc_multi_read_uc2f (SF_PRIVATE *psf, float *ptr, int len) ; -static int voc_multi_read_les2f (SF_PRIVATE *psf, float *ptr, int len) ; - -static int voc_multi_read_uc2d (SF_PRIVATE *psf, double *ptr, int len) ; -static int voc_multi_read_les2d (SF_PRIVATE *psf, double *ptr, int len) ; -#endif - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -voc_open (SF_PRIVATE *psf) -{ int subformat, error = 0 ; - - if (psf->is_pipe) - return SFE_VOC_NO_PIPE ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = voc_read_header (psf))) - return error ; - } ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_VOC) - return SFE_BAD_OPEN_FORMAT ; - - psf->endian = SF_ENDIAN_LITTLE ; - - if ((error = voc_write_header (psf, SF_FALSE))) - return error ; - - psf->write_header = voc_write_header ; - } ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - psf->container_close = voc_close ; - - switch (subformat) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_ALAW : - error = alaw_init (psf) ; - break ; - - case SF_FORMAT_ULAW : - error = ulaw_init (psf) ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - return error ; -} /* voc_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -voc_read_header (SF_PRIVATE *psf) -{ VOC_DATA *pvoc ; - char creative [20] ; - unsigned char block_type, rate_byte ; - short version, checksum, encoding, dataoffset ; - int offset ; - - /* Set position to start of file to begin reading header. */ - offset = psf_binheader_readf (psf, "pb", 0, creative, SIGNED_SIZEOF (creative)) ; - - if (creative [sizeof (creative) - 1] != 0x1A) - return SFE_VOC_NO_CREATIVE ; - - /* Terminate the string. */ - creative [sizeof (creative) - 1] = 0 ; - - if (strcmp ("Creative Voice File", creative)) - return SFE_VOC_NO_CREATIVE ; - - psf_log_printf (psf, "%s\n", creative) ; - - offset += psf_binheader_readf (psf, "e222", &dataoffset, &version, &checksum) ; - - psf->dataoffset = dataoffset ; - - psf_log_printf (psf, "dataoffset : %d\n" - "version : 0x%X\n" - "checksum : 0x%X\n", psf->dataoffset, version, checksum) ; - - if (version != 0x010A && version != 0x0114) - return SFE_VOC_BAD_VERSION ; - - if (! (psf->codec_data = malloc (sizeof (VOC_DATA)))) - return SFE_MALLOC_FAILED ; - - pvoc = (VOC_DATA*) psf->codec_data ; - - memset (pvoc, 0, sizeof (VOC_DATA)) ; - - /* Set the default encoding now. */ - psf->sf.format = SF_FORMAT_VOC ; /* Major format */ - encoding = SF_FORMAT_PCM_U8 ; /* Minor format */ - psf->endian = SF_ENDIAN_LITTLE ; - - while (1) - { unsigned size ; - short count ; - - block_type = 0 ; - offset += psf_binheader_readf (psf, "1", &block_type) ; - - switch (block_type) - { case VOC_ASCII : - offset += psf_binheader_readf (psf, "e3", &size) ; - - psf_log_printf (psf, " ASCII : %d\n", size) ; - - if (size < sizeof (psf->header) - 1) - { offset += psf_binheader_readf (psf, "b", psf->header, size) ; - psf->header [size] = 0 ; - psf_log_printf (psf, " text : %s\n", psf->header) ; - continue ; - } - - offset += psf_binheader_readf (psf, "j", size) ; - continue ; - - case VOC_REPEAT : - offset += psf_binheader_readf (psf, "e32", &size, &count) ; - psf_log_printf (psf, " Repeat : %d\n", count) ; - continue ; - - case VOC_SOUND_DATA : - case VOC_EXTENDED : - case VOC_EXTENDED_II : - break ; - - default : psf_log_printf (psf, "*** Weird block marker (%d)\n", block_type) ; - } ; - - break ; - } ; - - if (block_type == VOC_SOUND_DATA) - { unsigned char compression ; - int size ; - - offset += psf_binheader_readf (psf, "e311", &size, &rate_byte, &compression) ; - - psf->sf.samplerate = 1000000 / (256 - (rate_byte & 0xFF)) ; - - psf_log_printf (psf, " Sound Data : %d\n sr : %d => %dHz\n comp : %d\n", - size, rate_byte, psf->sf.samplerate, compression) ; - - if (offset + size - 1 > psf->filelength) - { psf_log_printf (psf, "Seems to be a truncated file.\n") ; - psf_log_printf (psf, "offset: %d size: %d sum: %d filelength: %D\n", offset, size, offset + size, psf->filelength) ; - return SFE_VOC_BAD_SECTIONS ; - } - else if (psf->filelength - offset - size > 4) - { psf_log_printf (psf, "Seems to be a multi-segment file (#1).\n") ; - psf_log_printf (psf, "offset: %d size: %d sum: %d filelength: %D\n", offset, size, offset + size, psf->filelength) ; - return SFE_VOC_BAD_SECTIONS ; - } ; - - psf->dataoffset = offset ; - psf->dataend = psf->filelength - 1 ; - - psf->sf.channels = 1 ; - psf->bytewidth = 1 ; - - psf->sf.format = SF_FORMAT_VOC | SF_FORMAT_PCM_U8 ; - - return 0 ; - } ; - - if (block_type == VOC_EXTENDED) - { unsigned char pack, stereo, compression ; - unsigned short rate_short ; - int size ; - - offset += psf_binheader_readf (psf, "e3211", &size, &rate_short, &pack, &stereo) ; - - psf_log_printf (psf, " Extended : %d\n", size) ; - if (size == 4) - psf_log_printf (psf, " size : 4\n") ; - else - psf_log_printf (psf, " size : %d (should be 4)\n", size) ; - - psf_log_printf (psf, " pack : %d\n" - " stereo : %s\n", pack, (stereo ? "yes" : "no")) ; - - if (stereo) - { psf->sf.channels = 2 ; - psf->sf.samplerate = 128000000 / (65536 - rate_short) ; - } - else - { psf->sf.channels = 1 ; - psf->sf.samplerate = 256000000 / (65536 - rate_short) ; - } ; - - psf_log_printf (psf, " sr : %d => %dHz\n", (rate_short & 0xFFFF), psf->sf.samplerate) ; - - offset += psf_binheader_readf (psf, "1", &block_type) ; - - if (block_type != VOC_SOUND_DATA) - { psf_log_printf (psf, "*** Expecting VOC_SOUND_DATA section.\n") ; - return SFE_VOC_BAD_FORMAT ; - } ; - - offset += psf_binheader_readf (psf, "e311", &size, &rate_byte, &compression) ; - - psf_log_printf (psf, " Sound Data : %d\n" - " sr : %d\n" - " comp : %d\n", size, rate_byte, compression) ; - - - if (offset + size - 1 > psf->filelength) - { psf_log_printf (psf, "Seems to be a truncated file.\n") ; - psf_log_printf (psf, "offset: %d size: %d sum: %d filelength: %D\n", offset, size, offset + size, psf->filelength) ; - return SFE_VOC_BAD_SECTIONS ; - } - else if (offset + size - 1 < psf->filelength) - { psf_log_printf (psf, "Seems to be a multi-segment file (#2).\n") ; - psf_log_printf (psf, "offset: %d size: %d sum: %d filelength: %D\n", offset, size, offset + size, psf->filelength) ; - return SFE_VOC_BAD_SECTIONS ; - } ; - - psf->dataoffset = offset ; - psf->dataend = psf->filelength - 1 ; - - psf->bytewidth = 1 ; - - psf->sf.format = SF_FORMAT_VOC | SF_FORMAT_PCM_U8 ; - - return 0 ; - } - - if (block_type == VOC_EXTENDED_II) - { unsigned char bitwidth, channels ; - int size, fourbytes ; - - offset += psf_binheader_readf (psf, "e341124", &size, &psf->sf.samplerate, - &bitwidth, &channels, &encoding, &fourbytes) ; - - if (size * 2 == psf->filelength - 39) - { int temp_size = psf->filelength - 31 ; - - psf_log_printf (psf, " Extended II : %d (SoX bug: should be %d)\n", size, temp_size) ; - size = temp_size ; - } - else - psf_log_printf (psf, " Extended II : %d\n", size) ; - - psf_log_printf (psf, " sample rate : %d\n" - " bit width : %d\n" - " channels : %d\n", psf->sf.samplerate, bitwidth, channels) ; - - if (bitwidth == 16 && encoding == 0) - { encoding = 4 ; - psf_log_printf (psf, " encoding : 0 (SoX bug: should be 4 for 16 bit signed PCM)\n") ; - } - else - psf_log_printf (psf, " encoding : %d => %s\n", encoding, voc_encoding2str (encoding)) ; - - - psf_log_printf (psf, " fourbytes : %X\n", fourbytes) ; - - psf->sf.channels = channels ; - - psf->dataoffset = offset ; - psf->dataend = psf->filelength - 1 ; - - if (size + 31 == psf->filelength + 1) - { /* Hack for reading files produced using - ** sf_command (SFC_UPDATE_HEADER_NOW). - */ - psf_log_printf (psf, "Missing zero byte at end of file.\n") ; - size = psf->filelength - 30 ; - psf->dataend = 0 ; - } - else if (size + 31 > psf->filelength) - { psf_log_printf (psf, "Seems to be a truncated file.\n") ; - size = psf->filelength - 31 ; - } - else if (size + 31 < psf->filelength) - psf_log_printf (psf, "Seems to be a multi-segment file (#3).\n") ; - - switch (encoding) - { case 0 : - psf->sf.format = SF_FORMAT_VOC | SF_FORMAT_PCM_U8 ; - psf->bytewidth = 1 ; - break ; - - case 4 : - psf->sf.format = SF_FORMAT_VOC | SF_FORMAT_PCM_16 ; - psf->bytewidth = 2 ; - break ; - - case 6 : - psf->sf.format = SF_FORMAT_VOC | SF_FORMAT_ALAW ; - psf->bytewidth = 1 ; - break ; - - case 7 : - psf->sf.format = SF_FORMAT_VOC | SF_FORMAT_ULAW ; - psf->bytewidth = 1 ; - break ; - - default : /* Unknown */ - return SFE_UNKNOWN_FORMAT ; - break ; - } ; - - } ; - - return 0 ; -} /* voc_read_header */ - -/*==================================================================================== -*/ - -static int -voc_write_header (SF_PRIVATE *psf, int calc_length) -{ sf_count_t current ; - int rate_const, subformat ; - - current = psf_ftell (psf) ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - subformat = SF_CODEC (psf->sf.format) ; - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - /* VOC marker and 0x1A byte. */ - psf_binheader_writef (psf, "eb1", "Creative Voice File", make_size_t (19), 0x1A) ; - - /* Data offset, version and other. */ - psf_binheader_writef (psf, "e222", 26, 0x0114, 0x111F) ; - - /* Use same logic as SOX. - ** If the file is mono 8 bit data, use VOC_SOUND_DATA. - ** If the file is mono 16 bit data, use VOC_EXTENED. - ** Otherwise use VOC_EXTENED_2. - */ - - if (subformat == SF_FORMAT_PCM_U8 && psf->sf.channels == 1) - { /* samplerate = 1000000 / (256 - rate_const) ; */ - rate_const = 256 - 1000000 / psf->sf.samplerate ; - - /* First type marker, length, rate_const and compression */ - psf_binheader_writef (psf, "e1311", VOC_SOUND_DATA, (int) (psf->datalength + 1), rate_const, 0) ; - } - else if (subformat == SF_FORMAT_PCM_U8 && psf->sf.channels == 2) - { /* sample_rate = 128000000 / (65536 - rate_short) ; */ - rate_const = 65536 - 128000000 / psf->sf.samplerate ; - - /* First write the VOC_EXTENDED section - ** marker, length, rate_const and compression - */ - psf_binheader_writef (psf, "e13211", VOC_EXTENDED, 4, rate_const, 0, 1) ; - - /* samplerate = 1000000 / (256 - rate_const) ; */ - rate_const = 256 - 1000000 / psf->sf.samplerate ; - - /* Now write the VOC_SOUND_DATA section - ** marker, length, rate_const and compression - */ - psf_binheader_writef (psf, "e1311", VOC_SOUND_DATA, (int) (psf->datalength + 1), rate_const, 0) ; - } - else - { int length ; - - if (psf->sf.channels < 1 || psf->sf.channels > 2) - return SFE_CHANNEL_COUNT ; - - switch (subformat) - { case SF_FORMAT_PCM_U8 : - psf->bytewidth = 1 ; - length = psf->sf.frames * psf->sf.channels * psf->bytewidth + 12 ; - /* Marker, length, sample rate, bitwidth, stereo flag, encoding and fourt zero bytes. */ - psf_binheader_writef (psf, "e1341124", VOC_EXTENDED_II, length, psf->sf.samplerate, 16, psf->sf.channels, 4, 0) ; - break ; - - case SF_FORMAT_PCM_16 : - psf->bytewidth = 2 ; - length = psf->sf.frames * psf->sf.channels * psf->bytewidth + 12 ; - /* Marker, length, sample rate, bitwidth, stereo flag, encoding and fourt zero bytes. */ - psf_binheader_writef (psf, "e1341124", VOC_EXTENDED_II, length, psf->sf.samplerate, 16, psf->sf.channels, 4, 0) ; - break ; - - case SF_FORMAT_ALAW : - psf->bytewidth = 1 ; - length = psf->sf.frames * psf->sf.channels * psf->bytewidth + 12 ; - psf_binheader_writef (psf, "e1341124", VOC_EXTENDED_II, length, psf->sf.samplerate, 8, psf->sf.channels, 6, 0) ; - break ; - - case SF_FORMAT_ULAW : - psf->bytewidth = 1 ; - length = psf->sf.frames * psf->sf.channels * psf->bytewidth + 12 ; - psf_binheader_writef (psf, "e1341124", VOC_EXTENDED_II, length, psf->sf.samplerate, 8, psf->sf.channels, 7, 0) ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - } ; - - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* voc_write_header */ - -static int -voc_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { /* Now we know for certain the length of the file we can re-write - ** correct values for the FORM, 8SVX and BODY chunks. - */ - unsigned char byte = VOC_TERMINATOR ; - - - psf_fseek (psf, 0, SEEK_END) ; - - /* Write terminator */ - psf_fwrite (&byte, 1, 1, psf) ; - - voc_write_header (psf, SF_TRUE) ; - } ; - - return 0 ; -} /* voc_close */ - -static const char* -voc_encoding2str (int encoding) -{ - switch (encoding) - { case 0 : return "8 bit unsigned PCM" ; - case 4 : return "16 bit signed PCM" ; - case 6 : return "A-law" ; - case 7 : return "u-law" ; - default : break ; - } - return "*** Unknown ***" ; -} /* voc_encoding2str */ - -/*==================================================================================== -*/ - -#if 0 -static int -voc_multi_init (SF_PRIVATE *psf, VOC_DATA *pvoc) -{ - psf->sf.frames = 0 ; - - if (pvoc->bitwidth == 8) - { psf->read_short = voc_multi_read_uc2s ; - psf->read_int = voc_multi_read_uc2i ; - psf->read_float = voc_multi_read_uc2f ; - psf->read_double = voc_multi_read_uc2d ; - return 0 ; - } ; - - if (pvoc->bitwidth == 16) - { psf->read_short = voc_multi_read_les2s ; - psf->read_int = voc_multi_read_les2i ; - psf->read_float = voc_multi_read_les2f ; - psf->read_double = voc_multi_read_les2d ; - return 0 ; - } ; - - psf_log_printf (psf, "Error : bitwith != 8 && bitwidth != 16.\n") ; - - return SFE_UNIMPLEMENTED ; -} /* voc_multi_read_int */ - -/*------------------------------------------------------------------------------------ -*/ - -static int -voc_multi_read_uc2s (SF_PRIVATE *psf, short *ptr, int len) -{ - - return 0 ; -} /* voc_multi_read_uc2s */ - -static int -voc_multi_read_les2s (SF_PRIVATE *psf, short *ptr, int len) -{ - - return 0 ; -} /* voc_multi_read_les2s */ - - -static int -voc_multi_read_uc2i (SF_PRIVATE *psf, int *ptr, int len) -{ - - return 0 ; -} /* voc_multi_read_uc2i */ - -static int -voc_multi_read_les2i (SF_PRIVATE *psf, int *ptr, int len) -{ - - return 0 ; -} /* voc_multi_read_les2i */ - - -static int -voc_multi_read_uc2f (SF_PRIVATE *psf, float *ptr, int len) -{ - - return 0 ; -} /* voc_multi_read_uc2f */ - -static int -voc_multi_read_les2f (SF_PRIVATE *psf, float *ptr, int len) -{ - - return 0 ; -} /* voc_multi_read_les2f */ - - -static int -voc_multi_read_uc2d (SF_PRIVATE *psf, double *ptr, int len) -{ - - return 0 ; -} /* voc_multi_read_uc2d */ - -static int -voc_multi_read_les2d (SF_PRIVATE *psf, double *ptr, int len) -{ - - return 0 ; -} /* voc_multi_read_les2d */ - -#endif - -/*------------------------------------------------------------------------------------ - -Creative Voice (VOC) file format --------------------------------- - -~From: galt@dsd.es.com - -(byte numbers are hex!) - - HEADER (bytes 00-19) - Series of DATA BLOCKS (bytes 1A+) [Must end w/ Terminator Block] - -- --------------------------------------------------------------- - -HEADER: -======= - byte # Description - ------ ------------------------------------------ - 00-12 "Creative Voice File" - 13 1A (eof to abort printing of file) - 14-15 Offset of first datablock in .voc file (std 1A 00 - in Intel Notation) - 16-17 Version number (minor,major) (VOC-HDR puts 0A 01) - 18-19 1's Comp of Ver. # + 1234h (VOC-HDR puts 29 11) - -- --------------------------------------------------------------- - -DATA BLOCK: -=========== - - Data Block: TYPE(1-byte), SIZE(3-bytes), INFO(0+ bytes) - NOTE: Terminator Block is an exception -- it has only the TYPE byte. - - TYPE Description Size (3-byte int) Info - ---- ----------- ----------------- ----------------------- - 00 Terminator (NONE) (NONE) - 01 Sound data 2+length of data * - 02 Sound continue length of data Voice Data - 03 Silence 3 ** - 04 Marker 2 Marker# (2 bytes) - 05 ASCII length of string null terminated string - 06 Repeat 2 Count# (2 bytes) - 07 End repeat 0 (NONE) - 08 Extended 4 *** - - *Sound Info Format: - --------------------- - 00 Sample Rate - 01 Compression Type - 02+ Voice Data - - **Silence Info Format: - ---------------------------- - 00-01 Length of silence - 1 - 02 Sample Rate - - - ***Extended Info Format: - --------------------- - 00-01 Time Constant: Mono: 65536 - (256000000/sample_rate) - Stereo: 65536 - (25600000/(2*sample_rate)) - 02 Pack - 03 Mode: 0 = mono - 1 = stereo - - - Marker# -- Driver keeps the most recent marker in a status byte - Count# -- Number of repetitions + 1 - Count# may be 1 to FFFE for 0 - FFFD repetitions - or FFFF for endless repetitions - Sample Rate -- SR byte = 256-(1000000/sample_rate) - Length of silence -- in units of sampling cycle - Compression Type -- of voice data - 8-bits = 0 - 4-bits = 1 - 2.6-bits = 2 - 2-bits = 3 - Multi DAC = 3+(# of channels) [interesting-- - this isn't in the developer's manual] - - ---------------------------------------------------------------------------------- -Addendum submitted by Votis Kokavessis: - -After some experimenting with .VOC files I found out that there is a Data Block -Type 9, which is not covered in the VOC.TXT file. Here is what I was able to discover -about this block type: - - -TYPE: 09 -SIZE: 12 + length of data -INFO: 12 (twelve) bytes - -INFO STRUCTURE: - -Bytes 0-1: (Word) Sample Rate (e.g. 44100) -Bytes 2-3: zero (could be that bytes 0-3 are a DWord for Sample Rate) -Byte 4: Sample Size in bits (e.g. 16) -Byte 5: Number of channels (e.g. 1 for mono, 2 for stereo) -Byte 6: Unknown (equal to 4 in all files I examined) -Bytes 7-11: zero - - --------------------------------------------------------------------------------------*/ - -/*===================================================================================== -**===================================================================================== -**===================================================================================== -**===================================================================================== -*/ - -/*------------------------------------------------------------------------ -The following is taken from the Audio File Formats FAQ dated 2-Jan-1995 -and submitted by Guido van Rossum . --------------------------------------------------------------------------- -Creative Voice (VOC) file format --------------------------------- - -From: galt@dsd.es.com - -(byte numbers are hex!) - - HEADER (bytes 00-19) - Series of DATA BLOCKS (bytes 1A+) [Must end w/ Terminator Block] - -- --------------------------------------------------------------- - -HEADER: -------- - byte # Description - ------ ------------------------------------------ - 00-12 "Creative Voice File" - 13 1A (eof to abort printing of file) - 14-15 Offset of first datablock in .voc file (std 1A 00 - in Intel Notation) - 16-17 Version number (minor,major) (VOC-HDR puts 0A 01) - 18-19 2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11) - -- --------------------------------------------------------------- - -DATA BLOCK: ------------ - - Data Block: TYPE(1-byte), SIZE(3-bytes), INFO(0+ bytes) - NOTE: Terminator Block is an exception -- it has only the TYPE byte. - - TYPE Description Size (3-byte int) Info - ---- ----------- ----------------- ----------------------- - 00 Terminator (NONE) (NONE) - 01 Sound data 2+length of data * - 02 Sound continue length of data Voice Data - 03 Silence 3 ** - 04 Marker 2 Marker# (2 bytes) - 05 ASCII length of string null terminated string - 06 Repeat 2 Count# (2 bytes) - 07 End repeat 0 (NONE) - 08 Extended 4 *** - - *Sound Info Format: **Silence Info Format: - --------------------- ---------------------------- - 00 Sample Rate 00-01 Length of silence - 1 - 01 Compression Type 02 Sample Rate - 02+ Voice Data - - ***Extended Info Format: - --------------------- - 00-01 Time Constant: Mono: 65536 - (256000000/sample_rate) - Stereo: 65536 - (25600000/(2*sample_rate)) - 02 Pack - 03 Mode: 0 = mono - 1 = stereo - - - Marker# -- Driver keeps the most recent marker in a status byte - Count# -- Number of repetitions + 1 - Count# may be 1 to FFFE for 0 - FFFD repetitions - or FFFF for endless repetitions - Sample Rate -- SR byte = 256-(1000000/sample_rate) - Length of silence -- in units of sampling cycle - Compression Type -- of voice data - 8-bits = 0 - 4-bits = 1 - 2.6-bits = 2 - 2-bits = 3 - Multi DAC = 3+(# of channels) [interesting-- - this isn't in the developer's manual] - -Detailed description of new data blocks (VOC files version 1.20 and above): - - (Source is fax from Barry Boone at Creative Labs, 405/742-6622) - -BLOCK 8 - digitized sound attribute extension, must preceed block 1. - Used to define stereo, 8 bit audio - BYTE bBlockID; // = 8 - BYTE nBlockLen[3]; // 3 byte length - WORD wTimeConstant; // time constant = same as block 1 - BYTE bPackMethod; // same as in block 1 - BYTE bVoiceMode; // 0-mono, 1-stereo - - Data is stored left, right - -BLOCK 9 - data block that supersedes blocks 1 and 8. - Used for stereo, 16 bit. - - BYTE bBlockID; // = 9 - BYTE nBlockLen[3]; // length 12 plus length of sound - DWORD dwSamplesPerSec; // samples per second, not time const. - BYTE bBitsPerSample; // e.g., 8 or 16 - BYTE bChannels; // 1 for mono, 2 for stereo - WORD wFormat; // see below - BYTE reserved[4]; // pad to make block w/o data - // have a size of 16 bytes - - Valid values of wFormat are: - - 0x0000 8-bit unsigned PCM - 0x0001 Creative 8-bit to 4-bit ADPCM - 0x0002 Creative 8-bit to 3-bit ADPCM - 0x0003 Creative 8-bit to 2-bit ADPCM - 0x0004 16-bit signed PCM - 0x0006 CCITT a-Law - 0x0007 CCITT u-Law - 0x02000 Creative 16-bit to 4-bit ADPCM - - Data is stored left, right - -------------------------------------------------------------------------*/ diff --git a/libs/libsndfile/src/vox_adpcm.c b/libs/libsndfile/src/vox_adpcm.c deleted file mode 100644 index 9abd42b0d7..0000000000 --- a/libs/libsndfile/src/vox_adpcm.c +++ /dev/null @@ -1,400 +0,0 @@ -/* -** Copyright (C) 2002-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** This is the OKI / Dialogic ADPCM encoder/decoder. It converts from -** 12 bit linear sample data to a 4 bit ADPCM. -*/ - -/* - * Note: some early Dialogic hardware does not always reset the ADPCM encoder - * at the start of each vox file. This can result in clipping and/or DC offset - * problems when it comes to decoding the audio. Whilst little can be done - * about the clipping, a DC offset can be removed by passing the decoded audio - * through a high-pass filter at e.g. 10Hz. - */ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" -#include "ima_oki_adpcm.h" - - -static sf_count_t vox_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t vox_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t vox_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t vox_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t vox_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t vox_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t vox_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t vox_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static int vox_read_block (SF_PRIVATE *psf, IMA_OKI_ADPCM *pvox, short *ptr, int len) ; - -/*------------------------------------------------------------------------------ -*/ - -static int -codec_close (SF_PRIVATE * psf) -{ - IMA_OKI_ADPCM * p = (IMA_OKI_ADPCM *) psf->codec_data ; - - if (p->errors) - psf_log_printf (psf, "*** Warning : ADPCM state errors: %d\n", p->errors) ; - return p->errors ; -} /* code_close */ - -int -vox_adpcm_init (SF_PRIVATE *psf) -{ IMA_OKI_ADPCM *pvox = NULL ; - - if (psf->file.mode == SFM_RDWR) - return SFE_BAD_MODE_RW ; - - if (psf->file.mode == SFM_WRITE && psf->sf.channels != 1) - return SFE_CHANNEL_COUNT ; - - if ((pvox = malloc (sizeof (IMA_OKI_ADPCM))) == NULL) - return SFE_MALLOC_FAILED ; - - psf->codec_data = (void*) pvox ; - memset (pvox, 0, sizeof (IMA_OKI_ADPCM)) ; - - if (psf->file.mode == SFM_WRITE) - { psf->write_short = vox_write_s ; - psf->write_int = vox_write_i ; - psf->write_float = vox_write_f ; - psf->write_double = vox_write_d ; - } - else - { psf_log_printf (psf, "Header-less OKI Dialogic ADPCM encoded file.\n") ; - psf_log_printf (psf, "Setting up for 8kHz, mono, Vox ADPCM.\n") ; - - psf->read_short = vox_read_s ; - psf->read_int = vox_read_i ; - psf->read_float = vox_read_f ; - psf->read_double = vox_read_d ; - } ; - - /* Standard sample rate chennels etc. */ - if (psf->sf.samplerate < 1) - psf->sf.samplerate = 8000 ; - psf->sf.channels = 1 ; - - psf->sf.frames = psf->filelength * 2 ; - - psf->sf.seekable = SF_FALSE ; - psf->codec_close = codec_close ; - - /* Seek back to start of data. */ - if (psf_fseek (psf, 0 , SEEK_SET) == -1) - return SFE_BAD_SEEK ; - - ima_oki_adpcm_init (pvox, IMA_OKI_ADPCM_TYPE_OKI) ; - - return 0 ; -} /* vox_adpcm_init */ - -/*============================================================================== -*/ - -static int -vox_read_block (SF_PRIVATE *psf, IMA_OKI_ADPCM *pvox, short *ptr, int len) -{ int indx = 0, k ; - - while (indx < len) - { pvox->code_count = (len - indx > IMA_OKI_ADPCM_PCM_LEN) ? IMA_OKI_ADPCM_CODE_LEN : (len - indx + 1) / 2 ; - - if ((k = psf_fread (pvox->codes, 1, pvox->code_count, psf)) != pvox->code_count) - { if (psf_ftell (psf) != psf->filelength) - psf_log_printf (psf, "*** Warning : short read (%d != %d).\n", k, pvox->code_count) ; - if (k == 0) - break ; - } ; - - pvox->code_count = k ; - - ima_oki_adpcm_decode_block (pvox) ; - - memcpy (&(ptr [indx]), pvox->pcm, pvox->pcm_count * sizeof (short)) ; - indx += pvox->pcm_count ; - } ; - - return indx ; -} /* vox_read_block */ - - -static sf_count_t -vox_read_s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ IMA_OKI_ADPCM *pvox ; - int readcount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pvox = (IMA_OKI_ADPCM*) psf->codec_data ; - - while (len > 0) - { readcount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = vox_read_block (psf, pvox, ptr, readcount) ; - - total += count ; - len -= count ; - if (count != readcount) - break ; - } ; - - return total ; -} /* vox_read_s */ - -static sf_count_t -vox_read_i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ IMA_OKI_ADPCM *pvox ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pvox = (IMA_OKI_ADPCM*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : (int) len ; - count = vox_read_block (psf, pvox, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = ((int) sptr [k]) << 16 ; - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* vox_read_i */ - -static sf_count_t -vox_read_f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ IMA_OKI_ADPCM *pvox ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - float normfact ; - - if (! psf->codec_data) - return 0 ; - pvox = (IMA_OKI_ADPCM*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x8000) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : (int) len ; - count = vox_read_block (psf, pvox, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * (float) (sptr [k]) ; - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* vox_read_f */ - -static sf_count_t -vox_read_d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ IMA_OKI_ADPCM *pvox ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, readcount, count ; - sf_count_t total = 0 ; - double normfact ; - - if (! psf->codec_data) - return 0 ; - pvox = (IMA_OKI_ADPCM*) psf->codec_data ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x8000) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { readcount = (len >= bufferlen) ? bufferlen : (int) len ; - count = vox_read_block (psf, pvox, sptr, readcount) ; - for (k = 0 ; k < readcount ; k++) - ptr [total + k] = normfact * (double) (sptr [k]) ; - total += count ; - len -= readcount ; - if (count != readcount) - break ; - } ; - - return total ; -} /* vox_read_d */ - -/*------------------------------------------------------------------------------ -*/ - -static int -vox_write_block (SF_PRIVATE *psf, IMA_OKI_ADPCM *pvox, const short *ptr, int len) -{ int indx = 0, k ; - - while (indx < len) - { pvox->pcm_count = (len - indx > IMA_OKI_ADPCM_PCM_LEN) ? IMA_OKI_ADPCM_PCM_LEN : len - indx ; - - memcpy (pvox->pcm, &(ptr [indx]), pvox->pcm_count * sizeof (short)) ; - - ima_oki_adpcm_encode_block (pvox) ; - - if ((k = psf_fwrite (pvox->codes, 1, pvox->code_count, psf)) != pvox->code_count) - psf_log_printf (psf, "*** Warning : short write (%d != %d).\n", k, pvox->code_count) ; - - indx += pvox->pcm_count ; - } ; - - return indx ; -} /* vox_write_block */ - -static sf_count_t -vox_write_s (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ IMA_OKI_ADPCM *pvox ; - int writecount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pvox = (IMA_OKI_ADPCM*) psf->codec_data ; - - while (len) - { writecount = (len > 0x10000000) ? 0x10000000 : (int) len ; - - count = vox_write_block (psf, pvox, ptr, writecount) ; - - total += count ; - len -= count ; - if (count != writecount) - break ; - } ; - - return total ; -} /* vox_write_s */ - -static sf_count_t -vox_write_i (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ IMA_OKI_ADPCM *pvox ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - - if (! psf->codec_data) - return 0 ; - pvox = (IMA_OKI_ADPCM*) psf->codec_data ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = ptr [total + k] >> 16 ; - count = vox_write_block (psf, pvox, sptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* vox_write_i */ - -static sf_count_t -vox_write_f (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ IMA_OKI_ADPCM *pvox ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - float normfact ; - - if (! psf->codec_data) - return 0 ; - pvox = (IMA_OKI_ADPCM*) psf->codec_data ; - - normfact = (psf->norm_float == SF_TRUE) ? (1.0 * 0x7FFF) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = lrintf (normfact * ptr [total + k]) ; - count = vox_write_block (psf, pvox, sptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* vox_write_f */ - -static sf_count_t -vox_write_d (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ IMA_OKI_ADPCM *pvox ; - BUF_UNION ubuf ; - short *sptr ; - int k, bufferlen, writecount, count ; - sf_count_t total = 0 ; - double normfact ; - - if (! psf->codec_data) - return 0 ; - pvox = (IMA_OKI_ADPCM*) psf->codec_data ; - - normfact = (psf->norm_double == SF_TRUE) ? (1.0 * 0x7FFF) : 1.0 ; - - sptr = ubuf.sbuf ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (len > 0) - { writecount = (len >= bufferlen) ? bufferlen : (int) len ; - for (k = 0 ; k < writecount ; k++) - sptr [k] = lrint (normfact * ptr [total + k]) ; - count = vox_write_block (psf, pvox, sptr, writecount) ; - total += count ; - len -= writecount ; - if (count != writecount) - break ; - } ; - - return total ; -} /* vox_write_d */ - diff --git a/libs/libsndfile/src/w64.c b/libs/libsndfile/src/w64.c deleted file mode 100644 index 2dbc962e13..0000000000 --- a/libs/libsndfile/src/w64.c +++ /dev/null @@ -1,639 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" -#include "wav_w64.h" - -/*------------------------------------------------------------------------------ -** W64 files use 16 byte markers as opposed to the four byte marker of -** WAV files. -** For comparison purposes, an integer is required, so make an integer -** hash for the 16 bytes using MAKE_HASH16 macro, but also create a 16 -** byte array containing the complete 16 bytes required when writing the -** header. -*/ - -#define MAKE_HASH16(x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf) \ - ( (x0) ^ ((x1) << 1) ^ ((x2) << 2) ^ ((x3) << 3) ^ \ - ((x4) << 4) ^ ((x5) << 5) ^ ((x6) << 6) ^ ((x7) << 7) ^ \ - ((x8) << 8) ^ ((x9) << 9) ^ ((xa) << 10) ^ ((xb) << 11) ^ \ - ((xc) << 12) ^ ((xd) << 13) ^ ((xe) << 14) ^ ((xf) << 15) ) - -#define MAKE_MARKER16(name, x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf) \ - static unsigned char name [16] = { (x0), (x1), (x2), (x3), (x4), (x5), \ - (x6), (x7), (x8), (x9), (xa), (xb), (xc), (xd), (xe), (xf) } - -#define riff_HASH16 MAKE_HASH16 ('r', 'i', 'f', 'f', 0x2E, 0x91, 0xCF, 0x11, \ - 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00) - -#define wave_HASH16 MAKE_HASH16 ('w', 'a', 'v', 'e', 0xF3, 0xAC, 0xD3, 0x11, \ - 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A) - -#define fmt_HASH16 MAKE_HASH16 ('f', 'm', 't', ' ', 0xF3, 0xAC, 0xD3, 0x11, \ - 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A) - -#define fact_HASH16 MAKE_HASH16 ('f', 'a', 'c', 't', 0xF3, 0xAC, 0xD3, 0x11, \ - 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A) - -#define data_HASH16 MAKE_HASH16 ('d', 'a', 't', 'a', 0xF3, 0xAC, 0xD3, 0x11, \ - 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A) - -#define ACID_HASH16 MAKE_HASH16 (0x6D, 0x07, 0x1C, 0xEA, 0xA3, 0xEF, 0x78, 0x4C, \ - 0x90, 0x57, 0x7F, 0x79, 0xEE, 0x25, 0x2A, 0xAE) - -#define levl_HASH16 MAKE_HASH16 (0x6c, 0x65, 0x76, 0x6c, 0xf3, 0xac, 0xd3, 0x11, \ - 0xd1, 0x8c, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A) - -#define list_HASH16 MAKE_HASH16 (0x6C, 0x69, 0x73, 0x74, 0x2F, 0x91, 0xCF, 0x11, \ - 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00) - -#define junk_HASH16 MAKE_HASH16 (0x6A, 0x75, 0x6E, 0x6b, 0xF3, 0xAC, 0xD3, 0x11, \ - 0x8C, 0xD1, 0x00, 0xC0, 0x4f, 0x8E, 0xDB, 0x8A) - -#define bext_MARKER MAKE_HASH16 (0x62, 0x65, 0x78, 0x74, 0xf3, 0xac, 0xd3, 0xaa, \ - 0xd1, 0x8c, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A) - -#define MARKER_HASH16 MAKE_HASH16 (0x56, 0x62, 0xf7, 0xab, 0x2d, 0x39, 0xd2, 0x11, \ - 0x86, 0xc7, 0x00, 0xc0, 0x4f, 0x8e, 0xdb, 0x8a) - -#define SUMLIST_HASH16 MAKE_HASH16 (0xBC, 0x94, 0x5F, 0x92, 0x5A, 0x52, 0xD2, 0x11, \ - 0x86, 0xDC, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A) - - -MAKE_MARKER16 (riff_MARKER16, 'r', 'i', 'f', 'f', 0x2E, 0x91, 0xCF, 0x11, - 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00) ; - - -MAKE_MARKER16 (wave_MARKER16, 'w', 'a', 'v', 'e', 0xF3, 0xAC, 0xD3, 0x11, - 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A) ; - -MAKE_MARKER16 (fmt_MARKER16, 'f', 'm', 't', ' ', 0xF3, 0xAC, 0xD3, 0x11, - 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A) ; - -MAKE_MARKER16 (fact_MARKER16, 'f', 'a', 'c', 't', 0xF3, 0xAC, 0xD3, 0x11, - 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A) ; - -MAKE_MARKER16 (data_MARKER16, 'd', 'a', 't', 'a', 0xF3, 0xAC, 0xD3, 0x11, - 0x8C, 0xD1, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A) ; - -enum -{ HAVE_riff = 0x01, - HAVE_wave = 0x02, - HAVE_fmt = 0x04, - HAVE_fact = 0x08, - HAVE_data = 0x20 -} ; - -/*------------------------------------------------------------------------------ - * Private static functions. - */ - -static int w64_read_header (SF_PRIVATE *psf, int *blockalign, int *framesperblock) ; -static int w64_write_header (SF_PRIVATE *psf, int calc_length) ; -static int w64_close (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -w64_open (SF_PRIVATE *psf) -{ WAV_PRIVATE * wpriv ; - int subformat, error, blockalign = 0, framesperblock = 0 ; - - if ((wpriv = calloc (1, sizeof (WAV_PRIVATE))) == NULL) - return SFE_MALLOC_FAILED ; - psf->container_data = wpriv ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR &&psf->filelength > 0)) - { if ((error = w64_read_header (psf, &blockalign, &framesperblock))) - return error ; - } ; - - if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_W64) - return SFE_BAD_OPEN_FORMAT ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (psf->is_pipe) - return SFE_NO_PIPE_WRITE ; - - psf->endian = SF_ENDIAN_LITTLE ; /* All W64 files are little endian. */ - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - if (subformat == SF_FORMAT_IMA_ADPCM || subformat == SF_FORMAT_MS_ADPCM) - { blockalign = wav_w64_srate2blocksize (psf->sf.samplerate * psf->sf.channels) ; - framesperblock = -1 ; - - /* FIXME : This block must go */ - psf->filelength = SF_COUNT_MAX ; - psf->datalength = psf->filelength ; - if (psf->sf.frames <= 0) - psf->sf.frames = (psf->blockwidth) ? psf->filelength / psf->blockwidth : psf->filelength ; - /* EMXIF : This block must go */ - } ; - - if ((error = w64_write_header (psf, SF_FALSE))) - return error ; - - psf->write_header = w64_write_header ; - } ; - - psf->container_close = w64_close ; - - switch (subformat) - { case SF_FORMAT_PCM_U8 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_ULAW : - error = ulaw_init (psf) ; - break ; - - case SF_FORMAT_ALAW : - error = alaw_init (psf) ; - break ; - - /* Lite remove start */ - case SF_FORMAT_FLOAT : - error = float32_init (psf) ; - break ; - - case SF_FORMAT_DOUBLE : - error = double64_init (psf) ; - break ; - - case SF_FORMAT_IMA_ADPCM : - error = wav_w64_ima_init (psf, blockalign, framesperblock) ; - break ; - - case SF_FORMAT_MS_ADPCM : - error = wav_w64_msadpcm_init (psf, blockalign, framesperblock) ; - break ; - /* Lite remove end */ - - case SF_FORMAT_GSM610 : - error = gsm610_init (psf) ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - return error ; -} /* w64_open */ - -/*========================================================================= -** Private functions. -*/ - -static int -w64_read_header (SF_PRIVATE *psf, int *blockalign, int *framesperblock) -{ WAV_PRIVATE *wpriv ; - WAV_FMT *wav_fmt ; - int dword = 0, marker, format = 0 ; - sf_count_t chunk_size, bytesread = 0 ; - int parsestage = 0, error, done = 0 ; - - if ((wpriv = psf->container_data) == NULL) - return SFE_INTERNAL ; - wav_fmt = &wpriv->wav_fmt ; - - /* Set position to start of file to begin reading header. */ - psf_binheader_readf (psf, "p", 0) ; - - while (! done) - { /* Each new chunk must start on an 8 byte boundary, so jump if needed. */ - if (psf->headindex & 0x7) - psf_binheader_readf (psf, "j", 8 - (psf->headindex & 0x7)) ; - - /* Generate hash of 16 byte marker. */ - bytesread += psf_binheader_readf (psf, "h", &marker) ; - chunk_size = 0 ; - - switch (marker) - { case riff_HASH16 : - if (parsestage) - return SFE_W64_NO_RIFF ; - - bytesread += psf_binheader_readf (psf, "e8", &chunk_size) ; - - if (psf->filelength != chunk_size) - psf_log_printf (psf, "riff : %D (should be %D)\n", chunk_size, psf->filelength) ; - else - psf_log_printf (psf, "riff : %D\n", chunk_size) ; - - parsestage |= HAVE_riff ; - break ; - - case ACID_HASH16: - psf_log_printf (psf, "Looks like an ACID file. Exiting.\n") ; - return SFE_UNIMPLEMENTED ; - - case wave_HASH16 : - if ((parsestage & HAVE_riff) != HAVE_riff) - return SFE_W64_NO_WAVE ; - psf_log_printf (psf, "wave\n") ; - parsestage |= HAVE_wave ; - break ; - - case fmt_HASH16 : - if ((parsestage & (HAVE_riff | HAVE_wave)) != (HAVE_riff | HAVE_wave)) - return SFE_WAV_NO_FMT ; - - bytesread += psf_binheader_readf (psf, "e8", &chunk_size) ; - psf_log_printf (psf, " fmt : %D\n", chunk_size) ; - - /* size of 16 byte marker and 8 byte chunk_size value. */ - chunk_size -= 24 ; - - if ((error = wav_w64_read_fmt_chunk (psf, (int) chunk_size))) - return error ; - - if (chunk_size % 8) - psf_binheader_readf (psf, "j", 8 - (chunk_size % 8)) ; - - format = wav_fmt->format ; - parsestage |= HAVE_fmt ; - break ; - - case fact_HASH16: - { sf_count_t frames ; - - psf_binheader_readf (psf, "e88", &chunk_size, &frames) ; - psf_log_printf (psf, " fact : %D\n frames : %D\n", - chunk_size, frames) ; - } ; - break ; - - - case data_HASH16 : - if ((parsestage & (HAVE_riff | HAVE_wave | HAVE_fmt)) != (HAVE_riff | HAVE_wave | HAVE_fmt)) - return SFE_W64_NO_DATA ; - - psf_binheader_readf (psf, "e8", &chunk_size) ; - - psf->dataoffset = psf_ftell (psf) ; - - psf->datalength = chunk_size - 24 ; - - if (chunk_size % 8) - chunk_size += 8 - (chunk_size % 8) ; - - psf_log_printf (psf, "data : %D\n", chunk_size) ; - - parsestage |= HAVE_data ; - - if (! psf->sf.seekable) - break ; - - /* Seek past data and continue reading header. */ - psf_fseek (psf, chunk_size, SEEK_CUR) ; - break ; - - case levl_HASH16 : - psf_binheader_readf (psf, "e8", &chunk_size) ; - psf_log_printf (psf, "levl : %D\n", chunk_size) ; - dword = chunk_size ; - psf_binheader_readf (psf, "j", dword - 24) ; - break ; - - case list_HASH16 : - psf_binheader_readf (psf, "e8", &chunk_size) ; - psf_log_printf (psf, "list : %D\n", chunk_size) ; - dword = chunk_size ; - psf_binheader_readf (psf, "j", dword - 24) ; - break ; - - case junk_HASH16 : - psf_binheader_readf (psf, "e8", &chunk_size) ; - psf_log_printf (psf, "junk : %D\n", chunk_size) ; - dword = chunk_size ; - psf_binheader_readf (psf, "j", dword - 24) ; - break ; - - case bext_MARKER : - psf_binheader_readf (psf, "e8", &chunk_size) ; - psf_log_printf (psf, "bext : %D\n", chunk_size) ; - dword = chunk_size ; - psf_binheader_readf (psf, "j", dword - 24) ; - break ; - - case MARKER_HASH16 : - psf_binheader_readf (psf, "e8", &chunk_size) ; - psf_log_printf (psf, "marker : %D\n", chunk_size) ; - dword = chunk_size ; - psf_binheader_readf (psf, "j", dword - 24) ; - break ; - - case SUMLIST_HASH16 : - psf_binheader_readf (psf, "e8", &chunk_size) ; - psf_log_printf (psf, "summary list : %D\n", chunk_size) ; - dword = chunk_size ; - psf_binheader_readf (psf, "j", dword - 24) ; - break ; - - default : - psf_log_printf (psf, "*** Unknown chunk marker : %X. Exiting parser.\n", marker) ; - done = SF_TRUE ; - break ; - } ; /* switch (dword) */ - - if (psf->sf.seekable == 0 && (parsestage & HAVE_data)) - break ; - - if (psf_ftell (psf) >= (psf->filelength - (2 * SIGNED_SIZEOF (dword)))) - break ; - } ; /* while (1) */ - - if (psf->dataoffset <= 0) - return SFE_W64_NO_DATA ; - - psf->endian = SF_ENDIAN_LITTLE ; /* All W64 files are little endian. */ - - if (psf_ftell (psf) != psf->dataoffset) - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - if (psf->blockwidth) - { if (psf->filelength - psf->dataoffset < psf->datalength) - psf->sf.frames = (psf->filelength - psf->dataoffset) / psf->blockwidth ; - else - psf->sf.frames = psf->datalength / psf->blockwidth ; - } ; - - switch (format) - { case WAVE_FORMAT_PCM : - case WAVE_FORMAT_EXTENSIBLE : - /* extensible might be FLOAT, MULAW, etc as well! */ - psf->sf.format = SF_FORMAT_W64 | u_bitwidth_to_subformat (psf->bytewidth * 8) ; - break ; - - case WAVE_FORMAT_MULAW : - psf->sf.format = (SF_FORMAT_W64 | SF_FORMAT_ULAW) ; - break ; - - case WAVE_FORMAT_ALAW : - psf->sf.format = (SF_FORMAT_W64 | SF_FORMAT_ALAW) ; - break ; - - case WAVE_FORMAT_MS_ADPCM : - psf->sf.format = (SF_FORMAT_W64 | SF_FORMAT_MS_ADPCM) ; - *blockalign = wav_fmt->msadpcm.blockalign ; - *framesperblock = wav_fmt->msadpcm.samplesperblock ; - break ; - - case WAVE_FORMAT_IMA_ADPCM : - psf->sf.format = (SF_FORMAT_W64 | SF_FORMAT_IMA_ADPCM) ; - *blockalign = wav_fmt->ima.blockalign ; - *framesperblock = wav_fmt->ima.samplesperblock ; - break ; - - case WAVE_FORMAT_GSM610 : - psf->sf.format = (SF_FORMAT_W64 | SF_FORMAT_GSM610) ; - break ; - - case WAVE_FORMAT_IEEE_FLOAT : - psf->sf.format = SF_FORMAT_W64 ; - psf->sf.format |= (psf->bytewidth == 8) ? SF_FORMAT_DOUBLE : SF_FORMAT_FLOAT ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - return 0 ; -} /* w64_read_header */ - -static int -w64_write_header (SF_PRIVATE *psf, int calc_length) -{ sf_count_t fmt_size, current ; - size_t fmt_pad = 0 ; - int subformat, add_fact_chunk = SF_FALSE ; - - current = psf_ftell (psf) ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - - if (psf->bytewidth) - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - /* riff marker, length, wave and 'fmt ' markers. */ - psf_binheader_writef (psf, "eh8hh", riff_MARKER16, psf->filelength, wave_MARKER16, fmt_MARKER16) ; - - subformat = SF_CODEC (psf->sf.format) ; - - switch (subformat) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - fmt_size = 24 + 2 + 2 + 4 + 4 + 2 + 2 ; - fmt_pad = (size_t) (8 - (fmt_size & 0x7)) ; - fmt_size += fmt_pad ; - - /* fmt : format, channels, samplerate */ - psf_binheader_writef (psf, "e8224", fmt_size, WAVE_FORMAT_PCM, psf->sf.channels, psf->sf.samplerate) ; - /* fmt : bytespersec */ - psf_binheader_writef (psf, "e4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ; - /* fmt : blockalign, bitwidth */ - psf_binheader_writef (psf, "e22", psf->bytewidth * psf->sf.channels, psf->bytewidth * 8) ; - break ; - - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - fmt_size = 24 + 2 + 2 + 4 + 4 + 2 + 2 ; - fmt_pad = (size_t) (8 - (fmt_size & 0x7)) ; - fmt_size += fmt_pad ; - - /* fmt : format, channels, samplerate */ - psf_binheader_writef (psf, "e8224", fmt_size, WAVE_FORMAT_IEEE_FLOAT, psf->sf.channels, psf->sf.samplerate) ; - /* fmt : bytespersec */ - psf_binheader_writef (psf, "e4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ; - /* fmt : blockalign, bitwidth */ - psf_binheader_writef (psf, "e22", psf->bytewidth * psf->sf.channels, psf->bytewidth * 8) ; - - add_fact_chunk = SF_TRUE ; - break ; - - case SF_FORMAT_ULAW : - fmt_size = 24 + 2 + 2 + 4 + 4 + 2 + 2 ; - fmt_pad = (size_t) (8 - (fmt_size & 0x7)) ; - fmt_size += fmt_pad ; - - /* fmt : format, channels, samplerate */ - psf_binheader_writef (psf, "e8224", fmt_size, WAVE_FORMAT_MULAW, psf->sf.channels, psf->sf.samplerate) ; - /* fmt : bytespersec */ - psf_binheader_writef (psf, "e4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ; - /* fmt : blockalign, bitwidth */ - psf_binheader_writef (psf, "e22", psf->bytewidth * psf->sf.channels, 8) ; - - add_fact_chunk = SF_TRUE ; - break ; - - case SF_FORMAT_ALAW : - fmt_size = 24 + 2 + 2 + 4 + 4 + 2 + 2 ; - fmt_pad = (size_t) (8 - (fmt_size & 0x7)) ; - fmt_size += fmt_pad ; - - /* fmt : format, channels, samplerate */ - psf_binheader_writef (psf, "e8224", fmt_size, WAVE_FORMAT_ALAW, psf->sf.channels, psf->sf.samplerate) ; - /* fmt : bytespersec */ - psf_binheader_writef (psf, "e4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ; - /* fmt : blockalign, bitwidth */ - psf_binheader_writef (psf, "e22", psf->bytewidth * psf->sf.channels, 8) ; - - add_fact_chunk = SF_TRUE ; - break ; - - /* Lite remove start */ - case SF_FORMAT_IMA_ADPCM : - { int blockalign, framesperblock, bytespersec ; - - blockalign = wav_w64_srate2blocksize (psf->sf.samplerate * psf->sf.channels) ; - framesperblock = 2 * (blockalign - 4 * psf->sf.channels) / psf->sf.channels + 1 ; - bytespersec = (psf->sf.samplerate * blockalign) / framesperblock ; - - /* fmt chunk. */ - fmt_size = 24 + 2 + 2 + 4 + 4 + 2 + 2 + 2 + 2 ; - fmt_pad = (size_t) (8 - (fmt_size & 0x7)) ; - fmt_size += fmt_pad ; - - /* fmt : size, WAV format type, channels. */ - psf_binheader_writef (psf, "e822", fmt_size, WAVE_FORMAT_IMA_ADPCM, psf->sf.channels) ; - - /* fmt : samplerate, bytespersec. */ - psf_binheader_writef (psf, "e44", psf->sf.samplerate, bytespersec) ; - - /* fmt : blockalign, bitwidth, extrabytes, framesperblock. */ - psf_binheader_writef (psf, "e2222", blockalign, 4, 2, framesperblock) ; - } ; - - add_fact_chunk = SF_TRUE ; - break ; - - case SF_FORMAT_MS_ADPCM : - { int blockalign, framesperblock, bytespersec, extrabytes ; - - blockalign = wav_w64_srate2blocksize (psf->sf.samplerate * psf->sf.channels) ; - framesperblock = 2 + 2 * (blockalign - 7 * psf->sf.channels) / psf->sf.channels ; - bytespersec = (psf->sf.samplerate * blockalign) / framesperblock ; - - /* fmt chunk. */ - extrabytes = 2 + 2 + MSADPCM_ADAPT_COEFF_COUNT * (2 + 2) ; - fmt_size = 24 + 2 + 2 + 4 + 4 + 2 + 2 + 2 + extrabytes ; - fmt_pad = (size_t) (8 - (fmt_size & 0x7)) ; - fmt_size += fmt_pad ; - - /* fmt : size, W64 format type, channels. */ - psf_binheader_writef (psf, "e822", fmt_size, WAVE_FORMAT_MS_ADPCM, psf->sf.channels) ; - - /* fmt : samplerate, bytespersec. */ - psf_binheader_writef (psf, "e44", psf->sf.samplerate, bytespersec) ; - - /* fmt : blockalign, bitwidth, extrabytes, framesperblock. */ - psf_binheader_writef (psf, "e22222", blockalign, 4, extrabytes, framesperblock, 7) ; - - msadpcm_write_adapt_coeffs (psf) ; - } ; - - add_fact_chunk = SF_TRUE ; - break ; - /* Lite remove end */ - - case SF_FORMAT_GSM610 : - { int bytespersec ; - - bytespersec = (psf->sf.samplerate * WAV_W64_GSM610_BLOCKSIZE) / WAV_W64_GSM610_SAMPLES ; - - /* fmt chunk. */ - fmt_size = 24 + 2 + 2 + 4 + 4 + 2 + 2 + 2 + 2 ; - fmt_pad = (size_t) (8 - (fmt_size & 0x7)) ; - fmt_size += fmt_pad ; - - /* fmt : size, WAV format type, channels. */ - psf_binheader_writef (psf, "e822", fmt_size, WAVE_FORMAT_GSM610, psf->sf.channels) ; - - /* fmt : samplerate, bytespersec. */ - psf_binheader_writef (psf, "e44", psf->sf.samplerate, bytespersec) ; - - /* fmt : blockalign, bitwidth, extrabytes, framesperblock. */ - psf_binheader_writef (psf, "e2222", WAV_W64_GSM610_BLOCKSIZE, 0, 2, WAV_W64_GSM610_SAMPLES) ; - } ; - - add_fact_chunk = SF_TRUE ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - /* Pad to 8 bytes with zeros. */ - if (fmt_pad > 0) - psf_binheader_writef (psf, "z", fmt_pad) ; - - if (add_fact_chunk) - psf_binheader_writef (psf, "eh88", fact_MARKER16, (sf_count_t) (16 + 8 + 8), psf->sf.frames) ; - - psf_binheader_writef (psf, "eh8", data_MARKER16, psf->datalength + 24) ; - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* w64_write_header */ - -static int -w64_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - w64_write_header (psf, SF_TRUE) ; - - return 0 ; -} /* w64_close */ - diff --git a/libs/libsndfile/src/wav.c b/libs/libsndfile/src/wav.c deleted file mode 100644 index 6e616b70ff..0000000000 --- a/libs/libsndfile/src/wav.c +++ /dev/null @@ -1,2048 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** Copyright (C) 2004-2005 David Viens -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#ifdef HAVE_INTTYPES_H -#include -#endif - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" -#include "wav_w64.h" - -/*------------------------------------------------------------------------------ - * Macros to handle big/little endian issues. - */ - -#define RIFF_MARKER (MAKE_MARKER ('R', 'I', 'F', 'F')) -#define RIFX_MARKER (MAKE_MARKER ('R', 'I', 'F', 'X')) -#define WAVE_MARKER (MAKE_MARKER ('W', 'A', 'V', 'E')) -#define fmt_MARKER (MAKE_MARKER ('f', 'm', 't', ' ')) -#define data_MARKER (MAKE_MARKER ('d', 'a', 't', 'a')) -#define fact_MARKER (MAKE_MARKER ('f', 'a', 'c', 't')) -#define PEAK_MARKER (MAKE_MARKER ('P', 'E', 'A', 'K')) - -#define cue_MARKER (MAKE_MARKER ('c', 'u', 'e', ' ')) -#define LIST_MARKER (MAKE_MARKER ('L', 'I', 'S', 'T')) -#define slnt_MARKER (MAKE_MARKER ('s', 'l', 'n', 't')) -#define wavl_MARKER (MAKE_MARKER ('w', 'a', 'v', 'l')) -#define INFO_MARKER (MAKE_MARKER ('I', 'N', 'F', 'O')) -#define plst_MARKER (MAKE_MARKER ('p', 'l', 's', 't')) -#define adtl_MARKER (MAKE_MARKER ('a', 'd', 't', 'l')) -#define labl_MARKER (MAKE_MARKER ('l', 'a', 'b', 'l')) -#define ltxt_MARKER (MAKE_MARKER ('l', 't', 'x', 't')) -#define note_MARKER (MAKE_MARKER ('n', 'o', 't', 'e')) -#define smpl_MARKER (MAKE_MARKER ('s', 'm', 'p', 'l')) -#define bext_MARKER (MAKE_MARKER ('b', 'e', 'x', 't')) -#define iXML_MARKER (MAKE_MARKER ('i', 'X', 'M', 'L')) -#define levl_MARKER (MAKE_MARKER ('l', 'e', 'v', 'l')) -#define MEXT_MARKER (MAKE_MARKER ('M', 'E', 'X', 'T')) -#define DISP_MARKER (MAKE_MARKER ('D', 'I', 'S', 'P')) -#define acid_MARKER (MAKE_MARKER ('a', 'c', 'i', 'd')) -#define strc_MARKER (MAKE_MARKER ('s', 't', 'r', 'c')) -#define PAD_MARKER (MAKE_MARKER ('P', 'A', 'D', ' ')) -#define afsp_MARKER (MAKE_MARKER ('a', 'f', 's', 'p')) -#define clm_MARKER (MAKE_MARKER ('c', 'l', 'm', ' ')) -#define elmo_MARKER (MAKE_MARKER ('e', 'l', 'm', 'o')) -#define cart_MARKER (MAKE_MARKER ('c', 'a', 'r', 't')) -#define FLLR_MARKER (MAKE_MARKER ('F', 'L', 'L', 'R')) - -#define exif_MARKER (MAKE_MARKER ('e', 'x', 'i', 'f')) -#define ever_MARKER (MAKE_MARKER ('e', 'v', 'e', 'r')) -#define etim_MARKER (MAKE_MARKER ('e', 't', 'i', 'm')) -#define ecor_MARKER (MAKE_MARKER ('e', 'c', 'o', 'r')) -#define emdl_MARKER (MAKE_MARKER ('e', 'm', 'd', 'l')) -#define emnt_MARKER (MAKE_MARKER ('e', 'm', 'n', 't')) -#define erel_MARKER (MAKE_MARKER ('e', 'r', 'e', 'l')) -#define eucm_MARKER (MAKE_MARKER ('e', 'u', 'c', 'm')) -#define olym_MARKER (MAKE_MARKER ('o', 'l', 'y', 'm')) -#define minf_MARKER (MAKE_MARKER ('m', 'i', 'n', 'f')) -#define elm1_MARKER (MAKE_MARKER ('e', 'l', 'm', '1')) -#define regn_MARKER (MAKE_MARKER ('r', 'e', 'g', 'n')) -#define ovwf_MARKER (MAKE_MARKER ('o', 'v', 'w', 'f')) -#define umid_MARKER (MAKE_MARKER ('u', 'm', 'i', 'd')) -#define SyLp_MARKER (MAKE_MARKER ('S', 'y', 'L', 'p')) -#define Cr8r_MARKER (MAKE_MARKER ('C', 'r', '8', 'r')) -#define JUNK_MARKER (MAKE_MARKER ('J', 'U', 'N', 'K')) -#define PMX_MARKER (MAKE_MARKER ('_', 'P', 'M', 'X')) -#define inst_MARKER (MAKE_MARKER ('i', 'n', 's', 't')) -#define AFAn_MARKER (MAKE_MARKER ('A', 'F', 'A', 'n')) - - -#define ISFT_MARKER (MAKE_MARKER ('I', 'S', 'F', 'T')) -#define ICRD_MARKER (MAKE_MARKER ('I', 'C', 'R', 'D')) -#define ICOP_MARKER (MAKE_MARKER ('I', 'C', 'O', 'P')) -#define IARL_MARKER (MAKE_MARKER ('I', 'A', 'R', 'L')) -#define IART_MARKER (MAKE_MARKER ('I', 'A', 'R', 'T')) -#define INAM_MARKER (MAKE_MARKER ('I', 'N', 'A', 'M')) -#define IENG_MARKER (MAKE_MARKER ('I', 'E', 'N', 'G')) -#define IGNR_MARKER (MAKE_MARKER ('I', 'G', 'N', 'R')) -#define ICOP_MARKER (MAKE_MARKER ('I', 'C', 'O', 'P')) -#define IPRD_MARKER (MAKE_MARKER ('I', 'P', 'R', 'D')) -#define ISRC_MARKER (MAKE_MARKER ('I', 'S', 'R', 'C')) -#define ISBJ_MARKER (MAKE_MARKER ('I', 'S', 'B', 'J')) -#define ICMT_MARKER (MAKE_MARKER ('I', 'C', 'M', 'T')) -#define IAUT_MARKER (MAKE_MARKER ('I', 'A', 'U', 'T')) -#define ITRK_MARKER (MAKE_MARKER ('I', 'T', 'R', 'K')) - -/* Weird WAVPACK marker which can show up at the start of the DATA section. */ -#define wvpk_MARKER (MAKE_MARKER ('w', 'v', 'p', 'k')) -#define OggS_MARKER (MAKE_MARKER ('O', 'g', 'g', 'S')) - -#define WAV_PEAK_CHUNK_SIZE(ch) (2 * sizeof (int) + ch * (sizeof (float) + sizeof (int))) -#define WAV_BEXT_MIN_CHUNK_SIZE 602 -#define WAV_BEXT_MAX_CHUNK_SIZE (10 * 1024) - -#define WAV_CART_MIN_CHUNK_SIZE 2048 -#define WAV_CART_MAX_CHUNK_SIZE 0xffffffff - - -enum -{ HAVE_RIFF = 0x01, - HAVE_WAVE = 0x02, - HAVE_fmt = 0x04, - HAVE_fact = 0x08, - HAVE_PEAK = 0x10, - HAVE_data = 0x20, - HAVE_other = 0x80000000 -} ; - - - -/* known WAVEFORMATEXTENSIBLE GUIDS */ -static const EXT_SUBFORMAT MSGUID_SUBTYPE_PCM = -{ 0x00000001, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_MS_ADPCM = -{ 0x00000002, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_IEEE_FLOAT = -{ 0x00000003, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_ALAW = -{ 0x00000006, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_MULAW = -{ 0x00000007, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -/* -** the next two are from -** http://dream.cs.bath.ac.uk/researchdev/wave-ex/bformat.html -*/ -static const EXT_SUBFORMAT MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_PCM = -{ 0x00000001, 0x0721, 0x11d3, { 0x86, 0x44, 0xC8, 0xC1, 0xCA, 0x00, 0x00, 0x00 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_IEEE_FLOAT = -{ 0x00000003, 0x0721, 0x11d3, { 0x86, 0x44, 0xC8, 0xC1, 0xCA, 0x00, 0x00, 0x00 } -} ; - - -#if 0 -/* maybe interesting one day to read the following through sf_read_raw */ -/* http://www.bath.ac.uk/~masrwd/pvocex/pvocex.html */ -static const EXT_SUBFORMAT MSGUID_SUBTYPE_PVOCEX = -{ 0x8312B9C2, 0x2E6E, 0x11d4, { 0xA8, 0x24, 0xDE, 0x5B, 0x96, 0xC3, 0xAB, 0x21 } -} ; -#endif - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int wav_read_header (SF_PRIVATE *psf, int *blockalign, int *framesperblock) ; -static int wav_write_header (SF_PRIVATE *psf, int calc_length) ; - -static int wav_write_tailer (SF_PRIVATE *psf) ; -static void wav_write_strings (SF_PRIVATE *psf, int location) ; -static int wav_command (SF_PRIVATE *psf, int command, void *data, int datasize) ; -static int wav_close (SF_PRIVATE *psf) ; - -static int wav_subchunk_parse (SF_PRIVATE *psf, int chunk, uint32_t length) ; -static int exif_subchunk_parse (SF_PRIVATE *psf, uint32_t length) ; -static int wav_read_smpl_chunk (SF_PRIVATE *psf, uint32_t chunklen) ; -static int wav_read_acid_chunk (SF_PRIVATE *psf, uint32_t chunklen) ; - -static int wav_set_chunk (SF_PRIVATE *psf, const SF_CHUNK_INFO * chunk_info) ; -static SF_CHUNK_ITERATOR * wav_next_chunk_iterator (SF_PRIVATE *psf, SF_CHUNK_ITERATOR * iterator) ; -static int wav_get_chunk_size (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) ; -static int wav_get_chunk_data (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -wav_open (SF_PRIVATE *psf) -{ WAV_PRIVATE * wpriv ; - int format, subformat, error, blockalign = 0, framesperblock = 0 ; - - if ((wpriv = calloc (1, sizeof (WAV_PRIVATE))) == NULL) - return SFE_MALLOC_FAILED ; - psf->container_data = wpriv ; - - wpriv->wavex_ambisonic = SF_AMBISONIC_NONE ; - psf->strings.flags = SF_STR_ALLOW_START | SF_STR_ALLOW_END ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = wav_read_header (psf, &blockalign, &framesperblock))) - return error ; - - psf->next_chunk_iterator = wav_next_chunk_iterator ; - psf->get_chunk_size = wav_get_chunk_size ; - psf->get_chunk_data = wav_get_chunk_data ; - } ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if (psf->is_pipe) - return SFE_NO_PIPE_WRITE ; - - wpriv->wavex_ambisonic = SF_AMBISONIC_NONE ; - - format = SF_CONTAINER (psf->sf.format) ; - if (format != SF_FORMAT_WAV && format != SF_FORMAT_WAVEX) - return SFE_BAD_OPEN_FORMAT ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - /* RIFF WAVs are little-endian, RIFX WAVs are big-endian, default to little */ - psf->endian = SF_ENDIAN (psf->sf.format) ; - if (CPU_IS_BIG_ENDIAN && psf->endian == SF_ENDIAN_CPU) - psf->endian = SF_ENDIAN_BIG ; - else if (psf->endian != SF_ENDIAN_BIG) - psf->endian = SF_ENDIAN_LITTLE ; - - if (psf->file.mode != SFM_RDWR || psf->filelength < 44) - { psf->filelength = 0 ; - psf->datalength = 0 ; - psf->dataoffset = 0 ; - psf->sf.frames = 0 ; - } ; - - if (subformat == SF_FORMAT_IMA_ADPCM || subformat == SF_FORMAT_MS_ADPCM) - { blockalign = wav_w64_srate2blocksize (psf->sf.samplerate * psf->sf.channels) ; - framesperblock = -1 ; /* Corrected later. */ - } ; - - /* By default, add the peak chunk to floating point files. Default behaviour - ** can be switched off using sf_command (SFC_SET_PEAK_CHUNK, SF_FALSE). - */ - if (psf->file.mode == SFM_WRITE && (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE)) - { if ((psf->peak_info = peak_info_calloc (psf->sf.channels)) == NULL) - return SFE_MALLOC_FAILED ; - psf->peak_info->peak_loc = SF_PEAK_START ; - } ; - - psf->write_header = wav_write_header ; - psf->set_chunk = wav_set_chunk ; - } ; - - psf->container_close = wav_close ; - psf->command = wav_command ; - - switch (subformat) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - error = pcm_init (psf) ; - break ; - - case SF_FORMAT_ULAW : - error = ulaw_init (psf) ; - break ; - - case SF_FORMAT_ALAW : - error = alaw_init (psf) ; - break ; - - /* Lite remove start */ - case SF_FORMAT_FLOAT : - error = float32_init (psf) ; - break ; - - case SF_FORMAT_DOUBLE : - error = double64_init (psf) ; - break ; - - case SF_FORMAT_IMA_ADPCM : - error = wav_w64_ima_init (psf, blockalign, framesperblock) ; - break ; - - case SF_FORMAT_MS_ADPCM : - error = wav_w64_msadpcm_init (psf, blockalign, framesperblock) ; - break ; - - case SF_FORMAT_G721_32 : - error = g72x_init (psf) ; - break ; - /* Lite remove end */ - - case SF_FORMAT_GSM610 : - error = gsm610_init (psf) ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - if (psf->file.mode == SFM_WRITE || (psf->file.mode == SFM_RDWR && psf->filelength == 0)) - return psf->write_header (psf, SF_FALSE) ; - - return error ; -} /* wav_open */ - -/*========================================================================= -** Private functions. -*/ - -static int -wav_read_header (SF_PRIVATE *psf, int *blockalign, int *framesperblock) -{ WAV_PRIVATE *wpriv ; - WAV_FMT *wav_fmt ; - FACT_CHUNK fact_chunk ; - uint32_t marker, chunk_size = 0, RIFFsize = 0, done = 0, uk ; - int parsestage = 0, error, format = 0 ; - char buffer [256] ; - - if (psf->filelength > SF_PLATFORM_S64 (0xffffffff)) - psf_log_printf (psf, "Warning : filelength > 0xffffffff. This is bad!!!!\n") ; - - if ((wpriv = psf->container_data) == NULL) - return SFE_INTERNAL ; - wav_fmt = &wpriv->wav_fmt ; - - /* Set position to start of file to begin reading header. */ - psf_binheader_readf (psf, "pmj", 0, &marker, -4) ; - psf->headindex = 0 ; - - /* RIFX signifies big-endian format for all header and data to prevent - ** lots of code copying here, we'll set the psf->rwf_endian flag once here, - ** and never specify endian-ness for all other header ops/ - */ - psf->rwf_endian = (marker == RIFF_MARKER) ? SF_ENDIAN_LITTLE : SF_ENDIAN_BIG ; - - while (! done) - { size_t jump = chunk_size & 1 ; - - marker = chunk_size = 0 ; - psf_binheader_readf (psf, "jm4", jump, &marker, &chunk_size) ; - if (marker == 0) - { psf_log_printf (psf, "Have 0 marker.\n") ; - break ; - } ; - - psf_store_read_chunk_u32 (&psf->rchunks, marker, psf_ftell (psf), chunk_size) ; - - switch (marker) - { case RIFF_MARKER : - case RIFX_MARKER : - if (parsestage) - return SFE_WAV_NO_RIFF ; - - parsestage |= HAVE_RIFF ; - - RIFFsize = chunk_size ; - - if (psf->fileoffset > 0 && psf->filelength > RIFFsize + 8) - { /* Set file length. */ - psf->filelength = RIFFsize + 8 ; - if (marker == RIFF_MARKER) - psf_log_printf (psf, "RIFF : %u\n", RIFFsize) ; - else - psf_log_printf (psf, "RIFX : %u\n", RIFFsize) ; - } - else if (psf->filelength < RIFFsize + 2 * SIGNED_SIZEOF (marker)) - { if (marker == RIFF_MARKER) - psf_log_printf (psf, "RIFF : %u (should be %D)\n", RIFFsize, psf->filelength - 2 * SIGNED_SIZEOF (marker)) ; - else - psf_log_printf (psf, "RIFX : %u (should be %D)\n", RIFFsize, psf->filelength - 2 * SIGNED_SIZEOF (marker)) ; - - RIFFsize = psf->filelength - 2 * SIGNED_SIZEOF (RIFFsize) ; - } - else - { if (marker == RIFF_MARKER) - psf_log_printf (psf, "RIFF : %u\n", RIFFsize) ; - else - psf_log_printf (psf, "RIFX : %u\n", RIFFsize) ; - } ; - - psf_binheader_readf (psf, "m", &marker) ; - if (marker != WAVE_MARKER) - return SFE_WAV_NO_WAVE ; - parsestage |= HAVE_WAVE ; - psf_log_printf (psf, "WAVE\n") ; - chunk_size = 0 ; - break ; - - case fmt_MARKER : - if ((parsestage & (HAVE_RIFF | HAVE_WAVE)) != (HAVE_RIFF | HAVE_WAVE)) - return SFE_WAV_NO_FMT ; - - /* If this file has a SECOND fmt chunk, I don't want to know about it. */ - if (parsestage & HAVE_fmt) - break ; - - parsestage |= HAVE_fmt ; - - psf_log_printf (psf, "fmt : %d\n", chunk_size) ; - - if ((error = wav_w64_read_fmt_chunk (psf, chunk_size))) - return error ; - - format = wav_fmt->format ; - break ; - - case data_MARKER : - if ((parsestage & (HAVE_RIFF | HAVE_WAVE | HAVE_fmt)) != (HAVE_RIFF | HAVE_WAVE | HAVE_fmt)) - return SFE_WAV_NO_DATA ; - - if (psf->file.mode == SFM_RDWR && (parsestage & HAVE_other) != 0) - return SFE_RDWR_BAD_HEADER ; - - parsestage |= HAVE_data ; - - psf->datalength = chunk_size ; - psf->dataoffset = psf_ftell (psf) ; - - if (psf->dataoffset > 0) - { if (chunk_size == 0 && RIFFsize == 8 && psf->filelength > 44) - { psf_log_printf (psf, "*** Looks like a WAV file which wasn't closed properly. Fixing it.\n") ; - psf->datalength = psf->filelength - psf->dataoffset ; - } ; - - if (psf->datalength > psf->filelength - psf->dataoffset) - { psf_log_printf (psf, "data : %D (should be %D)\n", psf->datalength, psf->filelength - psf->dataoffset) ; - psf->datalength = psf->filelength - psf->dataoffset ; - } - else - psf_log_printf (psf, "data : %D\n", psf->datalength) ; - - /* Only set dataend if there really is data at the end. */ - if (psf->datalength + psf->dataoffset < psf->filelength) - psf->dataend = psf->datalength + psf->dataoffset ; - - psf->datalength += chunk_size & 1 ; - chunk_size = 0 ; - } ; - - if (! psf->sf.seekable || psf->dataoffset < 0) - break ; - - /* Seek past data and continue reading header. */ - psf_fseek (psf, psf->datalength, SEEK_CUR) ; - - if (psf_ftell (psf) != psf->datalength + psf->dataoffset) - psf_log_printf (psf, "*** psf_fseek past end error ***\n") ; - break ; - - case fact_MARKER : - if ((parsestage & (HAVE_RIFF | HAVE_WAVE)) != (HAVE_RIFF | HAVE_WAVE)) - return SFE_WAV_BAD_FACT ; - - parsestage |= HAVE_fact ; - - if ((parsestage & HAVE_fmt) != HAVE_fmt) - psf_log_printf (psf, "*** Should have 'fmt ' chunk before 'fact'\n") ; - - psf_binheader_readf (psf, "4", & (fact_chunk.frames)) ; - - if (chunk_size > SIGNED_SIZEOF (fact_chunk)) - psf_binheader_readf (psf, "j", (int) (chunk_size - SIGNED_SIZEOF (fact_chunk))) ; - - if (chunk_size) - psf_log_printf (psf, "%M : %d\n", marker, chunk_size) ; - else - psf_log_printf (psf, "%M : %d (should not be zero)\n", marker, chunk_size) ; - - psf_log_printf (psf, " frames : %d\n", fact_chunk.frames) ; - break ; - - case PEAK_MARKER : - if ((parsestage & (HAVE_RIFF | HAVE_WAVE | HAVE_fmt)) != (HAVE_RIFF | HAVE_WAVE | HAVE_fmt)) - return SFE_WAV_PEAK_B4_FMT ; - - parsestage |= HAVE_PEAK ; - - psf_log_printf (psf, "%M : %d\n", marker, chunk_size) ; - if (chunk_size != WAV_PEAK_CHUNK_SIZE (psf->sf.channels)) - { psf_binheader_readf (psf, "j", chunk_size) ; - psf_log_printf (psf, "*** File PEAK chunk size doesn't fit with number of channels (%d).\n", psf->sf.channels) ; - return SFE_WAV_BAD_PEAK ; - } ; - - if ((psf->peak_info = peak_info_calloc (psf->sf.channels)) == NULL) - return SFE_MALLOC_FAILED ; - - /* read in rest of PEAK chunk. */ - psf_binheader_readf (psf, "44", & (psf->peak_info->version), & (psf->peak_info->timestamp)) ; - - if (psf->peak_info->version != 1) - psf_log_printf (psf, " version : %d *** (should be version 1)\n", psf->peak_info->version) ; - else - psf_log_printf (psf, " version : %d\n", psf->peak_info->version) ; - - psf_log_printf (psf, " time stamp : %d\n", psf->peak_info->timestamp) ; - psf_log_printf (psf, " Ch Position Value\n") ; - - for (uk = 0 ; uk < (uint32_t) psf->sf.channels ; uk++) - { float value ; - uint32_t position ; - - psf_binheader_readf (psf, "f4", &value, &position) ; - psf->peak_info->peaks [uk].value = value ; - psf->peak_info->peaks [uk].position = position ; - - snprintf (buffer, sizeof (buffer), " %2d %-12" PRId64 " %g\n", - uk, psf->peak_info->peaks [uk].position, psf->peak_info->peaks [uk].value) ; - buffer [sizeof (buffer) - 1] = 0 ; - psf_log_printf (psf, "%s", buffer) ; - } ; - - psf->peak_info->peak_loc = ((parsestage & HAVE_data) == 0) ? SF_PEAK_START : SF_PEAK_END ; - break ; - - case cue_MARKER : - parsestage |= HAVE_other ; - - { uint32_t bytesread, cue_count ; - int id, position, chunk_id, chunk_start, block_start, offset ; - - bytesread = psf_binheader_readf (psf, "4", &cue_count) ; - psf_log_printf (psf, "%M : %u\n", marker, chunk_size) ; - - if (cue_count > 10) - { psf_log_printf (psf, " Count : %d (skipping)\n", cue_count) ; - psf_binheader_readf (psf, "j", cue_count * 24) ; - break ; - } ; - - psf_log_printf (psf, " Count : %d\n", cue_count) ; - - while (cue_count) - { bytesread += psf_binheader_readf (psf, "444444", &id, &position, - &chunk_id, &chunk_start, &block_start, &offset) ; - psf_log_printf (psf, " Cue ID : %2d" - " Pos : %5u Chunk : %M" - " Chk Start : %d Blk Start : %d" - " Offset : %5d\n", - id, position, chunk_id, chunk_start, block_start, offset) ; - cue_count -- ; - } ; - - if (bytesread != chunk_size) - { psf_log_printf (psf, "**** Chunk size weirdness (%d != %d)\n", chunk_size, bytesread) ; - psf_binheader_readf (psf, "j", chunk_size - bytesread) ; - } ; - } ; - break ; - - case smpl_MARKER : - parsestage |= HAVE_other ; - - psf_log_printf (psf, "smpl : %u\n", chunk_size) ; - - if ((error = wav_read_smpl_chunk (psf, chunk_size))) - return error ; - break ; - - case acid_MARKER : - parsestage |= HAVE_other ; - - psf_log_printf (psf, "acid : %u\n", chunk_size) ; - - if ((error = wav_read_acid_chunk (psf, chunk_size))) - return error ; - break ; - - case INFO_MARKER : - case LIST_MARKER : - parsestage |= HAVE_other ; - - if ((error = wav_subchunk_parse (psf, marker, chunk_size)) != 0) - return error ; - break ; - - case bext_MARKER : - /* - The 'bext' chunk can actually be updated, so don't need to set this. - parsestage |= HAVE_other ; - */ - if ((error = wav_read_bext_chunk (psf, chunk_size))) - return error ; - break ; - - case PAD_MARKER : - /* - We can eat into a 'PAD ' chunk if we need to. - parsestage |= HAVE_other ; - */ - psf_log_printf (psf, "%M : %u\n", marker, chunk_size) ; - psf_binheader_readf (psf, "j", chunk_size) ; - break ; - - case cart_MARKER: - if ((error = wav_read_cart_chunk (psf, chunk_size))) - return error ; - break ; - - case iXML_MARKER : /* See http://en.wikipedia.org/wiki/IXML */ - case strc_MARKER : /* Multiple of 32 bytes. */ - case afsp_MARKER : - case clm_MARKER : - case elmo_MARKER : - case levl_MARKER : - case plst_MARKER : - case minf_MARKER : - case elm1_MARKER : - case regn_MARKER : - case ovwf_MARKER : - case inst_MARKER : - case AFAn_MARKER : - case umid_MARKER : - case SyLp_MARKER : - case Cr8r_MARKER : - case JUNK_MARKER : - case PMX_MARKER : - case DISP_MARKER : - case MEXT_MARKER : - case FLLR_MARKER : - psf_log_printf (psf, "%M : %u\n", marker, chunk_size) ; - psf_binheader_readf (psf, "j", chunk_size) ; - break ; - - default : - if (psf_isprint ((marker >> 24) & 0xFF) && psf_isprint ((marker >> 16) & 0xFF) - && psf_isprint ((marker >> 8) & 0xFF) && psf_isprint (marker & 0xFF)) - { psf_log_printf (psf, "*** %M : %d (unknown marker)\n", marker, chunk_size) ; - psf_binheader_readf (psf, "j", chunk_size) ; - break ; - } ; - if (psf_ftell (psf) & 0x03) - { psf_log_printf (psf, " Unknown chunk marker at position %D. Resynching.\n", psf_ftell (psf) - 8) ; - psf_binheader_readf (psf, "j", -3) ; - /* File is too messed up so we prevent editing in RDWR mode here. */ - parsestage |= HAVE_other ; - break ; - } ; - psf_log_printf (psf, "*** Unknown chunk marker (%X) at position %D. Exiting parser.\n", marker, psf_ftell (psf) - 8) ; - done = SF_TRUE ; - break ; - } ; /* switch (marker) */ - - if (! psf->sf.seekable && (parsestage & HAVE_data)) - break ; - - if (psf_ftell (psf) >= psf->filelength - SIGNED_SIZEOF (chunk_size)) - { psf_log_printf (psf, "End\n") ; - break ; - } ; - } ; /* while (1) */ - - if (psf->dataoffset <= 0) - return SFE_WAV_NO_DATA ; - - /* WAVs can be little or big endian */ - psf->endian = psf->rwf_endian ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - if (psf->is_pipe == 0) - { /* - ** Check for 'wvpk' at the start of the DATA section. Not able to - ** handle this. - */ - psf_binheader_readf (psf, "4", &marker) ; - if (marker == wvpk_MARKER || marker == OggS_MARKER) - return SFE_WAV_WVPK_DATA ; - } ; - - /* Seek to start of DATA section. */ - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - if (psf->blockwidth) - { if (psf->filelength - psf->dataoffset < psf->datalength) - psf->sf.frames = (psf->filelength - psf->dataoffset) / psf->blockwidth ; - else - psf->sf.frames = psf->datalength / psf->blockwidth ; - } ; - - switch (format) - { case WAVE_FORMAT_EXTENSIBLE : - if (psf->sf.format == (SF_FORMAT_WAVEX | SF_FORMAT_MS_ADPCM)) - { *blockalign = wav_fmt->msadpcm.blockalign ; - *framesperblock = wav_fmt->msadpcm.samplesperblock ; - } ; - break ; - - case WAVE_FORMAT_PCM : - psf->sf.format = SF_FORMAT_WAV | u_bitwidth_to_subformat (psf->bytewidth * 8) ; - break ; - - case WAVE_FORMAT_MULAW : - case IBM_FORMAT_MULAW : - psf->sf.format = (SF_FORMAT_WAV | SF_FORMAT_ULAW) ; - break ; - - case WAVE_FORMAT_ALAW : - case IBM_FORMAT_ALAW : - psf->sf.format = (SF_FORMAT_WAV | SF_FORMAT_ALAW) ; - break ; - - case WAVE_FORMAT_MS_ADPCM : - psf->sf.format = (SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM) ; - *blockalign = wav_fmt->msadpcm.blockalign ; - *framesperblock = wav_fmt->msadpcm.samplesperblock ; - break ; - - case WAVE_FORMAT_IMA_ADPCM : - psf->sf.format = (SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM) ; - *blockalign = wav_fmt->ima.blockalign ; - *framesperblock = wav_fmt->ima.samplesperblock ; - break ; - - case WAVE_FORMAT_GSM610 : - psf->sf.format = (SF_FORMAT_WAV | SF_FORMAT_GSM610) ; - break ; - - case WAVE_FORMAT_IEEE_FLOAT : - psf->sf.format = SF_FORMAT_WAV ; - psf->sf.format |= (psf->bytewidth == 8) ? SF_FORMAT_DOUBLE : SF_FORMAT_FLOAT ; - break ; - - case WAVE_FORMAT_G721_ADPCM : - psf->sf.format = SF_FORMAT_WAV | SF_FORMAT_G721_32 ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - if (wpriv->fmt_is_broken) - wav_w64_analyze (psf) ; - - /* Only set the format endian-ness if its non-standard big-endian. */ - if (psf->endian == SF_ENDIAN_BIG) - psf->sf.format |= SF_ENDIAN_BIG ; - - return 0 ; -} /* wav_read_header */ - -static int -wav_write_fmt_chunk (SF_PRIVATE *psf) -{ int subformat, fmt_size, add_fact_chunk = 0 ; - - subformat = SF_CODEC (psf->sf.format) ; - - switch (subformat) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - fmt_size = 2 + 2 + 4 + 4 + 2 + 2 ; - - /* fmt : format, channels, samplerate */ - psf_binheader_writef (psf, "4224", fmt_size, WAVE_FORMAT_PCM, psf->sf.channels, psf->sf.samplerate) ; - /* fmt : bytespersec */ - psf_binheader_writef (psf, "4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ; - /* fmt : blockalign, bitwidth */ - psf_binheader_writef (psf, "22", psf->bytewidth * psf->sf.channels, psf->bytewidth * 8) ; - break ; - - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - fmt_size = 2 + 2 + 4 + 4 + 2 + 2 ; - - /* fmt : format, channels, samplerate */ - psf_binheader_writef (psf, "4224", fmt_size, WAVE_FORMAT_IEEE_FLOAT, psf->sf.channels, psf->sf.samplerate) ; - /* fmt : bytespersec */ - psf_binheader_writef (psf, "4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ; - /* fmt : blockalign, bitwidth */ - psf_binheader_writef (psf, "22", psf->bytewidth * psf->sf.channels, psf->bytewidth * 8) ; - - add_fact_chunk = SF_TRUE ; - break ; - - case SF_FORMAT_ULAW : - fmt_size = 2 + 2 + 4 + 4 + 2 + 2 + 2 ; - - /* fmt : format, channels, samplerate */ - psf_binheader_writef (psf, "4224", fmt_size, WAVE_FORMAT_MULAW, psf->sf.channels, psf->sf.samplerate) ; - /* fmt : bytespersec */ - psf_binheader_writef (psf, "4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ; - /* fmt : blockalign, bitwidth, extrabytes */ - psf_binheader_writef (psf, "222", psf->bytewidth * psf->sf.channels, 8, 0) ; - - add_fact_chunk = SF_TRUE ; - break ; - - case SF_FORMAT_ALAW : - fmt_size = 2 + 2 + 4 + 4 + 2 + 2 + 2 ; - - /* fmt : format, channels, samplerate */ - psf_binheader_writef (psf, "4224", fmt_size, WAVE_FORMAT_ALAW, psf->sf.channels, psf->sf.samplerate) ; - /* fmt : bytespersec */ - psf_binheader_writef (psf, "4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ; - /* fmt : blockalign, bitwidth, extrabytes */ - psf_binheader_writef (psf, "222", psf->bytewidth * psf->sf.channels, 8, 0) ; - - add_fact_chunk = SF_TRUE ; - break ; - - /* Lite remove start */ - case SF_FORMAT_IMA_ADPCM : - { int blockalign, framesperblock, bytespersec ; - - blockalign = wav_w64_srate2blocksize (psf->sf.samplerate * psf->sf.channels) ; - framesperblock = 2 * (blockalign - 4 * psf->sf.channels) / psf->sf.channels + 1 ; - bytespersec = (psf->sf.samplerate * blockalign) / framesperblock ; - - /* fmt chunk. */ - fmt_size = 2 + 2 + 4 + 4 + 2 + 2 + 2 + 2 ; - - /* fmt : size, WAV format type, channels, samplerate, bytespersec */ - psf_binheader_writef (psf, "42244", fmt_size, WAVE_FORMAT_IMA_ADPCM, - psf->sf.channels, psf->sf.samplerate, bytespersec) ; - - /* fmt : blockalign, bitwidth, extrabytes, framesperblock. */ - psf_binheader_writef (psf, "2222", blockalign, 4, 2, framesperblock) ; - } ; - - add_fact_chunk = SF_TRUE ; - break ; - - case SF_FORMAT_MS_ADPCM : - { int blockalign, framesperblock, bytespersec, extrabytes ; - - blockalign = wav_w64_srate2blocksize (psf->sf.samplerate * psf->sf.channels) ; - framesperblock = 2 + 2 * (blockalign - 7 * psf->sf.channels) / psf->sf.channels ; - bytespersec = (psf->sf.samplerate * blockalign) / framesperblock ; - - /* fmt chunk. */ - extrabytes = 2 + 2 + MSADPCM_ADAPT_COEFF_COUNT * (2 + 2) ; - fmt_size = 2 + 2 + 4 + 4 + 2 + 2 + 2 + extrabytes ; - - /* fmt : size, WAV format type, channels. */ - psf_binheader_writef (psf, "422", fmt_size, WAVE_FORMAT_MS_ADPCM, psf->sf.channels) ; - - /* fmt : samplerate, bytespersec. */ - psf_binheader_writef (psf, "44", psf->sf.samplerate, bytespersec) ; - - /* fmt : blockalign, bitwidth, extrabytes, framesperblock. */ - psf_binheader_writef (psf, "22222", blockalign, 4, extrabytes, framesperblock, 7) ; - - msadpcm_write_adapt_coeffs (psf) ; - } ; - - add_fact_chunk = SF_TRUE ; - break ; - - - case SF_FORMAT_G721_32 : - /* fmt chunk. */ - fmt_size = 2 + 2 + 4 + 4 + 2 + 2 + 2 + 2 ; - - /* fmt : size, WAV format type, channels, samplerate, bytespersec */ - psf_binheader_writef (psf, "42244", fmt_size, WAVE_FORMAT_G721_ADPCM, - psf->sf.channels, psf->sf.samplerate, psf->sf.samplerate * psf->sf.channels / 2) ; - - /* fmt : blockalign, bitwidth, extrabytes, auxblocksize. */ - psf_binheader_writef (psf, "2222", 64, 4, 2, 0) ; - - add_fact_chunk = SF_TRUE ; - break ; - - /* Lite remove end */ - - case SF_FORMAT_GSM610 : - { int blockalign, framesperblock, bytespersec ; - - blockalign = WAV_W64_GSM610_BLOCKSIZE ; - framesperblock = WAV_W64_GSM610_SAMPLES ; - bytespersec = (psf->sf.samplerate * blockalign) / framesperblock ; - - /* fmt chunk. */ - fmt_size = 2 + 2 + 4 + 4 + 2 + 2 + 2 + 2 ; - - /* fmt : size, WAV format type, channels. */ - psf_binheader_writef (psf, "422", fmt_size, WAVE_FORMAT_GSM610, psf->sf.channels) ; - - /* fmt : samplerate, bytespersec. */ - psf_binheader_writef (psf, "44", psf->sf.samplerate, bytespersec) ; - - /* fmt : blockalign, bitwidth, extrabytes, framesperblock. */ - psf_binheader_writef (psf, "2222", blockalign, 0, 2, framesperblock) ; - } ; - - add_fact_chunk = SF_TRUE ; - break ; - - default : return SFE_UNIMPLEMENTED ; - } ; - - if (add_fact_chunk) - psf_binheader_writef (psf, "tm48", fact_MARKER, 4, psf->sf.frames) ; - - return 0 ; -} /* wav_write_fmt_chunk */ - -static int -wavex_write_fmt_chunk (SF_PRIVATE *psf) -{ WAV_PRIVATE *wpriv ; - int subformat, fmt_size, add_fact_chunk = 0 ; - - if ((wpriv = psf->container_data) == NULL) - return SFE_INTERNAL ; - - subformat = SF_CODEC (psf->sf.format) ; - - /* initial section (same for all, it appears) */ - switch (subformat) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - case SF_FORMAT_ULAW : - case SF_FORMAT_ALAW : - fmt_size = 2 + 2 + 4 + 4 + 2 + 2 + 2 + 2 + 4 + 4 + 2 + 2 + 8 ; - - /* fmt : format, channels, samplerate */ - psf_binheader_writef (psf, "4224", fmt_size, WAVE_FORMAT_EXTENSIBLE, psf->sf.channels, psf->sf.samplerate) ; - /* fmt : bytespersec */ - psf_binheader_writef (psf, "4", psf->sf.samplerate * psf->bytewidth * psf->sf.channels) ; - /* fmt : blockalign, bitwidth */ - psf_binheader_writef (psf, "22", psf->bytewidth * psf->sf.channels, psf->bytewidth * 8) ; - - /* cbSize 22 is sizeof (WAVEFORMATEXTENSIBLE) - sizeof (WAVEFORMATEX) */ - psf_binheader_writef (psf, "2", 22) ; - - /* wValidBitsPerSample, for our use same as bitwidth as we use it fully */ - psf_binheader_writef (psf, "2", psf->bytewidth * 8) ; - - /* For an Ambisonic file set the channel mask to zero. - ** Otherwise use a default based on the channel count. - */ - if (wpriv->wavex_ambisonic != SF_AMBISONIC_NONE) - psf_binheader_writef (psf, "4", 0) ; - else if (wpriv->wavex_channelmask != 0) - psf_binheader_writef (psf, "4", wpriv->wavex_channelmask) ; - else - { /* - ** Ok some liberty is taken here to use the most commonly used channel masks - ** instead of "no mapping". If you really want to use "no mapping" for 8 channels and less - ** please don't use wavex. (otherwise we'll have to create a new SF_COMMAND) - */ - switch (psf->sf.channels) - { case 1 : /* center channel mono */ - psf_binheader_writef (psf, "4", 0x4) ; - break ; - - case 2 : /* front left and right */ - psf_binheader_writef (psf, "4", 0x1 | 0x2) ; - break ; - - case 4 : /* Quad */ - psf_binheader_writef (psf, "4", 0x1 | 0x2 | 0x10 | 0x20) ; - break ; - - case 6 : /* 5.1 */ - psf_binheader_writef (psf, "4", 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20) ; - break ; - - case 8 : /* 7.1 */ - psf_binheader_writef (psf, "4", 0x1 | 0x2 | 0x4 | 0x8 | 0x10 | 0x20 | 0x40 | 0x80) ; - break ; - - default : /* 0 when in doubt , use direct out, ie NO mapping*/ - psf_binheader_writef (psf, "4", 0x0) ; - break ; - } ; - } ; - break ; - - case SF_FORMAT_MS_ADPCM : /* Todo, GUID exists might have different header as per wav_write_header */ - default : - return SFE_UNIMPLEMENTED ; - } ; - - /* GUID section, different for each */ - - switch (subformat) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - wavex_write_guid (psf, wpriv->wavex_ambisonic == SF_AMBISONIC_NONE ? - &MSGUID_SUBTYPE_PCM : &MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_PCM) ; - break ; - - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - wavex_write_guid (psf, wpriv->wavex_ambisonic == SF_AMBISONIC_NONE ? - &MSGUID_SUBTYPE_IEEE_FLOAT : &MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_IEEE_FLOAT) ; - add_fact_chunk = SF_TRUE ; - break ; - - case SF_FORMAT_ULAW : - wavex_write_guid (psf, &MSGUID_SUBTYPE_MULAW) ; - add_fact_chunk = SF_TRUE ; - break ; - - case SF_FORMAT_ALAW : - wavex_write_guid (psf, &MSGUID_SUBTYPE_ALAW) ; - add_fact_chunk = SF_TRUE ; - break ; - -#if 0 - /* This is dead code due to return in previous switch statement. */ - case SF_FORMAT_MS_ADPCM : /* todo, GUID exists */ - wavex_write_guid (psf, &MSGUID_SUBTYPE_MS_ADPCM) ; - add_fact_chunk = SF_TRUE ; - break ; - return SFE_UNIMPLEMENTED ; -#endif - - default : return SFE_UNIMPLEMENTED ; - } ; - - if (add_fact_chunk) - psf_binheader_writef (psf, "tm48", fact_MARKER, 4, psf->sf.frames) ; - - return 0 ; -} /* wavex_write_fmt_chunk */ - - -static int -wav_write_header (SF_PRIVATE *psf, int calc_length) -{ sf_count_t current ; - uint32_t uk ; - int k, error, has_data = SF_FALSE ; - - current = psf_ftell (psf) ; - - if (current > psf->dataoffset) - has_data = SF_TRUE ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - else if (psf->bytewidth > 0 && psf->sf.seekable == SF_TRUE) - psf->datalength = psf->sf.frames * psf->bytewidth * psf->sf.channels ; - } ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - /* - ** RIFX signifies big-endian format for all header and data. - ** To prevent lots of code copying here, we'll set the psf->rwf_endian flag - ** once here, and never specify endian-ness for all other header operations. - */ - - /* RIFF/RIFX marker, length, WAVE and 'fmt ' markers. */ - - if (psf->endian == SF_ENDIAN_LITTLE) - psf_binheader_writef (psf, "etm8", RIFF_MARKER, (psf->filelength < 8) ? 8 : psf->filelength - 8) ; - else - psf_binheader_writef (psf, "Etm8", RIFX_MARKER, (psf->filelength < 8) ? 8 : psf->filelength - 8) ; - - /* WAVE and 'fmt ' markers. */ - psf_binheader_writef (psf, "mm", WAVE_MARKER, fmt_MARKER) ; - - /* Write the 'fmt ' chunk. */ - switch (SF_CONTAINER (psf->sf.format)) - { case SF_FORMAT_WAV : - if ((error = wav_write_fmt_chunk (psf)) != 0) - return error ; - break ; - - case SF_FORMAT_WAVEX : - if ((error = wavex_write_fmt_chunk (psf)) != 0) - return error ; - break ; - - default : - return SFE_UNIMPLEMENTED ; - } ; - - /* The LIST/INFO chunk. */ - if (psf->strings.flags & SF_STR_LOCATE_START) - wav_write_strings (psf, SF_STR_LOCATE_START) ; - - if (psf->peak_info != NULL && psf->peak_info->peak_loc == SF_PEAK_START) - { psf_binheader_writef (psf, "m4", PEAK_MARKER, WAV_PEAK_CHUNK_SIZE (psf->sf.channels)) ; - psf_binheader_writef (psf, "44", 1, time (NULL)) ; - for (k = 0 ; k < psf->sf.channels ; k++) - psf_binheader_writef (psf, "ft8", (float) psf->peak_info->peaks [k].value, psf->peak_info->peaks [k].position) ; - } ; - - if (psf->broadcast_16k != NULL) - wav_write_bext_chunk (psf) ; - - if (psf->cart_16k != NULL) - wav_write_cart_chunk (psf) ; - - if (psf->instrument != NULL) - { int tmp ; - double dtune = (double) (0x40000000) / 25.0 ; - - psf_binheader_writef (psf, "m4", smpl_MARKER, 9 * 4 + psf->instrument->loop_count * 6 * 4) ; - psf_binheader_writef (psf, "44", 0, 0) ; /* Manufacturer zero is everyone */ - tmp = (int) (1.0e9 / psf->sf.samplerate) ; /* Sample period in nano seconds */ - psf_binheader_writef (psf, "44", tmp, psf->instrument->basenote) ; - tmp = (uint32_t) (psf->instrument->detune * dtune + 0.5) ; - psf_binheader_writef (psf, "4", tmp) ; - psf_binheader_writef (psf, "44", 0, 0) ; /* SMTPE format */ - psf_binheader_writef (psf, "44", psf->instrument->loop_count, 0) ; - - for (tmp = 0 ; tmp < psf->instrument->loop_count ; tmp++) - { int type ; - - type = psf->instrument->loops [tmp].mode ; - type = (type == SF_LOOP_FORWARD ? 0 : type == SF_LOOP_BACKWARD ? 2 : type == SF_LOOP_ALTERNATING ? 1 : 32) ; - - psf_binheader_writef (psf, "44", tmp, type) ; - psf_binheader_writef (psf, "44", psf->instrument->loops [tmp].start, psf->instrument->loops [tmp].end - 1) ; - psf_binheader_writef (psf, "44", 0, psf->instrument->loops [tmp].count) ; - } ; - } ; - - /* Write custom headers. */ - for (uk = 0 ; uk < psf->wchunks.used ; uk++) - psf_binheader_writef (psf, "m4b", (int) psf->wchunks.chunks [uk].mark32, psf->wchunks.chunks [uk].len, psf->wchunks.chunks [uk].data, make_size_t (psf->wchunks.chunks [uk].len)) ; - - if (psf->headindex + 16 < psf->dataoffset) - { /* Add PAD data if necessary. */ - k = psf->dataoffset - (psf->headindex + 16) ; - psf_binheader_writef (psf, "m4z", PAD_MARKER, k, make_size_t (k)) ; - } ; - - psf_binheader_writef (psf, "tm8", data_MARKER, psf->datalength) ; - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - if (psf->error) - return psf->error ; - - if (has_data && psf->dataoffset != psf->headindex) - { psf_log_printf (psf, "Oooops : has_data && psf->dataoffset != psf->headindex\n") ; - return psf->error = SFE_INTERNAL ; - } ; - - psf->dataoffset = psf->headindex ; - - if (! has_data) - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - else if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* wav_write_header */ - - -static int -wav_write_tailer (SF_PRIVATE *psf) -{ int k ; - - /* Reset the current header buffer length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - - if (psf->bytewidth > 0 && psf->sf.seekable == SF_TRUE) - { psf->datalength = psf->sf.frames * psf->bytewidth * psf->sf.channels ; - psf->dataend = psf->dataoffset + psf->datalength ; - } ; - - if (psf->dataend > 0) - psf_fseek (psf, psf->dataend, SEEK_SET) ; - else - psf->dataend = psf_fseek (psf, 0, SEEK_END) ; - - /* Add a PEAK chunk if requested. */ - if (psf->peak_info != NULL && psf->peak_info->peak_loc == SF_PEAK_END) - { psf_binheader_writef (psf, "m4", PEAK_MARKER, WAV_PEAK_CHUNK_SIZE (psf->sf.channels)) ; - psf_binheader_writef (psf, "44", 1, time (NULL)) ; - for (k = 0 ; k < psf->sf.channels ; k++) - psf_binheader_writef (psf, "f4", psf->peak_info->peaks [k].value, psf->peak_info->peaks [k].position) ; - } ; - - if (psf->strings.flags & SF_STR_LOCATE_END) - wav_write_strings (psf, SF_STR_LOCATE_END) ; - - /* Write the tailer. */ - if (psf->headindex > 0) - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - return 0 ; -} /* wav_write_tailer */ - -static void -wav_write_strings (SF_PRIVATE *psf, int location) -{ int k, prev_head_index, saved_head_index ; - - if (psf_location_string_count (psf, location) == 0) - return ; - - prev_head_index = psf->headindex + 4 ; - - psf_binheader_writef (psf, "m4m", LIST_MARKER, 0xBADBAD, INFO_MARKER) ; - - for (k = 0 ; k < SF_MAX_STRINGS ; k++) - { if (psf->strings.data [k].type == 0) - break ; - if (psf->strings.data [k].type < 0 || psf->strings.data [k].flags != location) - continue ; - - switch (psf->strings.data [k].type) - { case SF_STR_SOFTWARE : - psf_binheader_writef (psf, "ms", ISFT_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - case SF_STR_TITLE : - psf_binheader_writef (psf, "ms", INAM_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - case SF_STR_COPYRIGHT : - psf_binheader_writef (psf, "ms", ICOP_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - case SF_STR_ARTIST : - psf_binheader_writef (psf, "ms", IART_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - case SF_STR_COMMENT : - psf_binheader_writef (psf, "ms", ICMT_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - case SF_STR_DATE : - psf_binheader_writef (psf, "ms", ICRD_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - case SF_STR_GENRE : - psf_binheader_writef (psf, "ms", IGNR_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - case SF_STR_ALBUM : - psf_binheader_writef (psf, "ms", IPRD_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - case SF_STR_TRACKNUMBER : - psf_binheader_writef (psf, "ms", ITRK_MARKER, psf->strings.storage + psf->strings.data [k].offset) ; - break ; - - default : - break ; - } ; - } ; - - saved_head_index = psf->headindex ; - psf->headindex = prev_head_index ; - psf_binheader_writef (psf, "4", saved_head_index - prev_head_index - 4) ; - psf->headindex = saved_head_index ; - -} /* wav_write_strings */ - -static int -wav_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { wav_write_tailer (psf) ; - - if (psf->file.mode == SFM_RDWR) - { sf_count_t current = psf_ftell (psf) ; - - /* - ** If the mode is RDWR and the current position is less than the - ** filelength, truncate the file. - */ - - if (current < psf->filelength) - { psf_ftruncate (psf, current) ; - psf->filelength = current ; - } ; - } ; - - psf->write_header (psf, SF_TRUE) ; - } ; - - return 0 ; -} /* wav_close */ - -static int -wav_command (SF_PRIVATE *psf, int command, void * UNUSED (data), int datasize) -{ WAV_PRIVATE *wpriv ; - - if ((wpriv = psf->container_data) == NULL) - return SFE_INTERNAL ; - - switch (command) - { case SFC_WAVEX_SET_AMBISONIC : - if ((SF_CONTAINER (psf->sf.format)) == SF_FORMAT_WAVEX) - { if (datasize == SF_AMBISONIC_NONE) - wpriv->wavex_ambisonic = SF_AMBISONIC_NONE ; - else if (datasize == SF_AMBISONIC_B_FORMAT) - wpriv->wavex_ambisonic = SF_AMBISONIC_B_FORMAT ; - else - return 0 ; - } ; - return wpriv->wavex_ambisonic ; - - case SFC_WAVEX_GET_AMBISONIC : - return wpriv->wavex_ambisonic ; - - case SFC_SET_CHANNEL_MAP_INFO : - wpriv->wavex_channelmask = wavex_gen_channel_mask (psf->channel_map, psf->sf.channels) ; - return (wpriv->wavex_channelmask != 0) ; - - default : - break ; - } ; - - return 0 ; -} /* wav_command */ - -static int -wav_subchunk_parse (SF_PRIVATE *psf, int chunk, uint32_t chunk_length) -{ sf_count_t current_pos ; - char buffer [512] ; - uint32_t dword, bytesread ; - - current_pos = psf_fseek (psf, 0, SEEK_CUR) - 4 ; - - bytesread = sizeof (chunk_length) ; - - if (chunk_length <= 8) - { /* This case is for broken files generated by PEAK. */ - psf_log_printf (psf, "%M : %d (weird length)\n", chunk, chunk_length) ; - psf_binheader_readf (psf, "mj", &chunk, chunk_length - 4) ; - psf_log_printf (psf, " %M\n", chunk) ; - return 0 ; - } ; - - if (psf->headindex + chunk_length > SIGNED_SIZEOF (psf->header)) - { psf_log_printf (psf, "%M : %d (too long)\n", chunk, chunk_length) ; - psf_binheader_readf (psf, "j", chunk_length) ; - return 0 ; - } ; - - if (current_pos + chunk_length > psf->filelength) - { psf_log_printf (psf, "%M : %d (should be %d)\n", chunk, chunk_length, (int) (psf->filelength - current_pos)) ; - chunk_length = psf->filelength - current_pos ; - } - else - psf_log_printf (psf, "%M : %d\n", chunk, chunk_length) ; - - while (bytesread < chunk_length) - { bytesread += psf_binheader_readf (psf, "m", &chunk) ; - - switch (chunk) - { case adtl_MARKER : - case INFO_MARKER : - /* These markers don't contain anything, not even a chunk lebgth. */ - psf_log_printf (psf, " %M\n", chunk) ; - continue ; - - case exif_MARKER : - psf_log_printf (psf, " %M\n", chunk) ; - bytesread += exif_subchunk_parse (psf, chunk_length - bytesread) ; - continue ; - - case data_MARKER : - psf_log_printf (psf, " %M inside a LIST block??? Backing out.\n", chunk) ; - /* Jump back four bytes and return to caller. */ - psf_binheader_readf (psf, "j", -4) ; - return 0 ; - - case 0 : - /* - ** Four zero bytes where a marker was expected. Assume this means - ** the rest of the chunk is garbage. - */ - psf_log_printf (psf, " *** Found weird-ass zero marker. Jumping to end of chunk.\n") ; - if (bytesread < chunk_length) - bytesread += psf_binheader_readf (psf, "j", chunk_length - bytesread + 4) ; - psf_log_printf (psf, " *** Offset is now : 0x%X\n", psf_fseek (psf, 0, SEEK_CUR)) ; - return 0 ; - - default : - break ; - } ; - - switch (chunk) - { case ISFT_MARKER : - case ICOP_MARKER : - case IARL_MARKER : - case IART_MARKER : - case ICMT_MARKER : - case ICRD_MARKER : - case IENG_MARKER : - case IGNR_MARKER : - case INAM_MARKER : - case IPRD_MARKER : - case ISBJ_MARKER : - case ISRC_MARKER : - case IAUT_MARKER : - case ITRK_MARKER : - bytesread += psf_binheader_readf (psf, "4", &dword) ; - dword += (dword & 1) ; - if (dword >= SIGNED_SIZEOF (buffer)) - { psf_log_printf (psf, " *** %M : %d (too big)\n", chunk, dword) ; - psf_binheader_readf (psf, "j", dword) ; - break ; - } ; - - bytesread += psf_binheader_readf (psf, "b", buffer, dword) ; - buffer [dword] = 0 ; - psf_log_printf (psf, " %M : %s\n", chunk, buffer) ; - break ; - - case labl_MARKER : - { int mark_id ; - - bytesread += psf_binheader_readf (psf, "44", &dword, &mark_id) ; - dword -= 4 ; - dword += (dword & 1) ; - if (dword < 1 || dword >= SIGNED_SIZEOF (buffer)) - { psf_log_printf (psf, " *** %M : %d (too big)\n", chunk, dword) ; - psf_binheader_readf (psf, "j", dword) ; - break ; - } ; - - bytesread += psf_binheader_readf (psf, "b", buffer, dword) ; - buffer [dword] = 0 ; - psf_log_printf (psf, " %M : %d : %s\n", chunk, mark_id, buffer) ; - } ; - break ; - - - case DISP_MARKER : - case ltxt_MARKER : - case note_MARKER : - bytesread += psf_binheader_readf (psf, "4", &dword) ; - dword += (dword & 1) ; - bytesread += psf_binheader_readf (psf, "j", dword) ; - psf_log_printf (psf, " %M : %d\n", chunk, dword) ; - break ; - - default : - bytesread += psf_binheader_readf (psf, "4", &dword) ; - dword += (dword & 1) ; - psf_log_printf (psf, " *** %M : %d\n", chunk, dword) ; - if (bytesread + dword > chunk_length) - { bytesread += psf_binheader_readf (psf, "j", chunk_length - bytesread + 4) ; - continue ; - } - else - bytesread += psf_binheader_readf (psf, "j", dword) ; - - if (dword >= chunk_length) - return 0 ; - break ; - } ; - - switch (chunk) - { case ISFT_MARKER : - psf_store_string (psf, SF_STR_SOFTWARE, buffer) ; - break ; - case ICOP_MARKER : - psf_store_string (psf, SF_STR_COPYRIGHT, buffer) ; - break ; - case INAM_MARKER : - psf_store_string (psf, SF_STR_TITLE, buffer) ; - break ; - case IART_MARKER : - psf_store_string (psf, SF_STR_ARTIST, buffer) ; - break ; - case ICMT_MARKER : - psf_store_string (psf, SF_STR_COMMENT, buffer) ; - break ; - case ICRD_MARKER : - psf_store_string (psf, SF_STR_DATE, buffer) ; - break ; - case IGNR_MARKER : - psf_store_string (psf, SF_STR_GENRE, buffer) ; - break ; - case IPRD_MARKER : - psf_store_string (psf, SF_STR_ALBUM, buffer) ; - break ; - case ITRK_MARKER : - psf_store_string (psf, SF_STR_TRACKNUMBER, buffer) ; - break ; - } ; - } ; - - current_pos = psf_fseek (psf, 0, SEEK_CUR) - current_pos ; - - if (current_pos - 4 != chunk_length) - psf_log_printf (psf, "**** Bad chunk length %d sbould be %D\n", chunk_length, current_pos - 4) ; - - return 0 ; -} /* wav_subchunk_parse */ - -static int -wav_read_smpl_chunk (SF_PRIVATE *psf, uint32_t chunklen) -{ char buffer [512] ; - uint32_t bytesread = 0, dword, sampler_data, loop_count ; - uint32_t note, start, end, type = -1, count ; - int j, k ; - - chunklen += (chunklen & 1) ; - - bytesread += psf_binheader_readf (psf, "4", &dword) ; - psf_log_printf (psf, " Manufacturer : %X\n", dword) ; - - bytesread += psf_binheader_readf (psf, "4", &dword) ; - psf_log_printf (psf, " Product : %u\n", dword) ; - - bytesread += psf_binheader_readf (psf, "4", &dword) ; - psf_log_printf (psf, " Period : %u nsec\n", dword) ; - - bytesread += psf_binheader_readf (psf, "4", ¬e) ; - psf_log_printf (psf, " Midi Note : %u\n", note) ; - - bytesread += psf_binheader_readf (psf, "4", &dword) ; - if (dword != 0) - { snprintf (buffer, sizeof (buffer), "%f", - (1.0 * 0x80000000) / ((uint32_t) dword)) ; - psf_log_printf (psf, " Pitch Fract. : %s\n", buffer) ; - } - else - psf_log_printf (psf, " Pitch Fract. : 0\n") ; - - bytesread += psf_binheader_readf (psf, "4", &dword) ; - psf_log_printf (psf, " SMPTE Format : %u\n", dword) ; - - bytesread += psf_binheader_readf (psf, "4", &dword) ; - snprintf (buffer, sizeof (buffer), "%02d:%02d:%02d %02d", - (dword >> 24) & 0x7F, (dword >> 16) & 0x7F, (dword >> 8) & 0x7F, dword & 0x7F) ; - psf_log_printf (psf, " SMPTE Offset : %s\n", buffer) ; - - bytesread += psf_binheader_readf (psf, "4", &loop_count) ; - psf_log_printf (psf, " Loop Count : %u\n", loop_count) ; - - /* Sampler Data holds the number of data bytes after the CUE chunks which - ** is not actually CUE data. Display value after CUE data. - */ - bytesread += psf_binheader_readf (psf, "4", &sampler_data) ; - - if ((psf->instrument = psf_instrument_alloc ()) == NULL) - return SFE_MALLOC_FAILED ; - - psf->instrument->loop_count = loop_count ; - - for (j = 0 ; loop_count > 0 && chunklen - bytesread >= 24 ; j ++) - { bytesread += psf_binheader_readf (psf, "4", &dword) ; - psf_log_printf (psf, " Cue ID : %2u", dword) ; - - bytesread += psf_binheader_readf (psf, "4", &type) ; - psf_log_printf (psf, " Type : %2u", type) ; - - bytesread += psf_binheader_readf (psf, "4", &start) ; - psf_log_printf (psf, " Start : %5u", start) ; - - bytesread += psf_binheader_readf (psf, "4", &end) ; - psf_log_printf (psf, " End : %5u", end) ; - - bytesread += psf_binheader_readf (psf, "4", &dword) ; - psf_log_printf (psf, " Fraction : %5u", dword) ; - - bytesread += psf_binheader_readf (psf, "4", &count) ; - psf_log_printf (psf, " Count : %5u\n", count) ; - - if (j < ARRAY_LEN (psf->instrument->loops)) - { psf->instrument->loops [j].start = start ; - psf->instrument->loops [j].end = end + 1 ; - psf->instrument->loops [j].count = count ; - - switch (type) - { case 0 : - psf->instrument->loops [j].mode = SF_LOOP_FORWARD ; - break ; - case 1 : - psf->instrument->loops [j].mode = SF_LOOP_ALTERNATING ; - break ; - case 2 : - psf->instrument->loops [j].mode = SF_LOOP_BACKWARD ; - break ; - default: - psf->instrument->loops [j].mode = SF_LOOP_NONE ; - break ; - } ; - } ; - - loop_count -- ; - } ; - - if (chunklen - bytesread == 0) - { if (sampler_data != 0) - psf_log_printf (psf, " Sampler Data : %u (should be 0)\n", sampler_data) ; - else - psf_log_printf (psf, " Sampler Data : %u\n", sampler_data) ; - } - else - { if (sampler_data != chunklen - bytesread) - { psf_log_printf (psf, " Sampler Data : %u (should have been %u)\n", sampler_data, chunklen - bytesread) ; - sampler_data = chunklen - bytesread ; - } - else - psf_log_printf (psf, " Sampler Data : %u\n", sampler_data) ; - - psf_log_printf (psf, " ") ; - for (k = 0 ; k < (int) sampler_data ; k++) - { char ch ; - - if (k > 0 && (k % 20) == 0) - psf_log_printf (psf, "\n ") ; - - bytesread += psf_binheader_readf (psf, "1", &ch) ; - psf_log_printf (psf, "%02X ", ch & 0xFF) ; - } ; - - psf_log_printf (psf, "\n") ; - } ; - - psf->instrument->basenote = note ; - psf->instrument->gain = 1 ; - psf->instrument->velocity_lo = psf->instrument->key_lo = 0 ; - psf->instrument->velocity_hi = psf->instrument->key_hi = 127 ; - - return 0 ; -} /* wav_read_smpl_chunk */ - -/* -** The acid chunk goes a little something like this: -** -** 4 bytes 'acid' -** 4 bytes (int) length of chunk starting at next byte -** -** 4 bytes (int) type of file: -** this appears to be a bit mask,however some combinations -** are probably impossible and/or qualified as "errors" -** -** 0x01 On: One Shot Off: Loop -** 0x02 On: Root note is Set Off: No root -** 0x04 On: Stretch is On, Off: Strech is OFF -** 0x08 On: Disk Based Off: Ram based -** 0x10 On: ?????????? Off: ????????? (Acidizer puts that ON) -** -** 2 bytes (short) root note -** if type 0x10 is OFF : [C,C#,(...),B] -> [0x30 to 0x3B] -** if type 0x10 is ON : [C,C#,(...),B] -> [0x3C to 0x47] -** (both types fit on same MIDI pitch albeit different octaves, so who cares) -** -** 2 bytes (short) ??? always set to 0x8000 -** 4 bytes (float) ??? seems to be always 0 -** 4 bytes (int) number of beats -** 2 bytes (short) meter denominator //always 4 in SF/ACID -** 2 bytes (short) meter numerator //always 4 in SF/ACID -** //are we sure about the order?? usually its num/denom -** 4 bytes (float) tempo -** -*/ - -static int -wav_read_acid_chunk (SF_PRIVATE *psf, uint32_t chunklen) -{ char buffer [512] ; - uint32_t bytesread = 0 ; - int beats, flags ; - short rootnote, q1, meter_denom, meter_numer ; - float q2, tempo ; - - chunklen += (chunklen & 1) ; - - bytesread += psf_binheader_readf (psf, "422f", &flags, &rootnote, &q1, &q2) ; - - snprintf (buffer, sizeof (buffer), "%f", q2) ; - - psf_log_printf (psf, " Flags : 0x%04x (%s,%s,%s,%s,%s)\n", flags, - (flags & 0x01) ? "OneShot" : "Loop", - (flags & 0x02) ? "RootNoteValid" : "RootNoteInvalid", - (flags & 0x04) ? "StretchOn" : "StretchOff", - (flags & 0x08) ? "DiskBased" : "RAMBased", - (flags & 0x10) ? "??On" : "??Off") ; - - psf_log_printf (psf, " Root note : 0x%x\n ???? : 0x%04x\n ???? : %s\n", - rootnote, q1, buffer) ; - - bytesread += psf_binheader_readf (psf, "422f", &beats, &meter_denom, &meter_numer, &tempo) ; - snprintf (buffer, sizeof (buffer), "%f", tempo) ; - psf_log_printf (psf, " Beats : %d\n Meter : %d/%d\n Tempo : %s\n", - beats, meter_numer, meter_denom, buffer) ; - - psf_binheader_readf (psf, "j", chunklen - bytesread) ; - - if ((psf->loop_info = calloc (1, sizeof (SF_LOOP_INFO))) == NULL) - return SFE_MALLOC_FAILED ; - - psf->loop_info->time_sig_num = meter_numer ; - psf->loop_info->time_sig_den = meter_denom ; - psf->loop_info->loop_mode = (flags & 0x01) ? SF_LOOP_NONE : SF_LOOP_FORWARD ; - psf->loop_info->num_beats = beats ; - psf->loop_info->bpm = tempo ; - psf->loop_info->root_key = (flags & 0x02) ? rootnote : -1 ; - - return 0 ; -} /* wav_read_acid_chunk */ - -int -wav_read_bext_chunk (SF_PRIVATE *psf, uint32_t chunksize) -{ - SF_BROADCAST_INFO_16K * b ; - uint32_t bytes = 0 ; - - if (chunksize < WAV_BEXT_MIN_CHUNK_SIZE) - { psf_log_printf (psf, "bext : %u (should be >= %d)\n", chunksize, WAV_BEXT_MIN_CHUNK_SIZE) ; - psf_binheader_readf (psf, "j", chunksize) ; - return 0 ; - } ; - - if (chunksize > WAV_BEXT_MAX_CHUNK_SIZE) - { psf_log_printf (psf, "bext : %u (should be < %d)\n", chunksize, WAV_BEXT_MAX_CHUNK_SIZE) ; - psf_binheader_readf (psf, "j", chunksize) ; - return 0 ; - } ; - - if (chunksize >= sizeof (SF_BROADCAST_INFO_16K)) - { psf_log_printf (psf, "bext : %u too big to be handled\n", chunksize) ; - psf_binheader_readf (psf, "j", chunksize) ; - return 0 ; - } ; - - psf_log_printf (psf, "bext : %u\n", chunksize) ; - - if ((psf->broadcast_16k = broadcast_var_alloc ()) == NULL) - { psf->error = SFE_MALLOC_FAILED ; - return psf->error ; - } ; - - b = psf->broadcast_16k ; - - bytes += psf_binheader_readf (psf, "b", b->description, sizeof (b->description)) ; - bytes += psf_binheader_readf (psf, "b", b->originator, sizeof (b->originator)) ; - bytes += psf_binheader_readf (psf, "b", b->originator_reference, sizeof (b->originator_reference)) ; - bytes += psf_binheader_readf (psf, "b", b->origination_date, sizeof (b->origination_date)) ; - bytes += psf_binheader_readf (psf, "b", b->origination_time, sizeof (b->origination_time)) ; - bytes += psf_binheader_readf (psf, "442", &b->time_reference_low, &b->time_reference_high, &b->version) ; - bytes += psf_binheader_readf (psf, "bj", &b->umid, sizeof (b->umid), 190) ; - - if (chunksize > WAV_BEXT_MIN_CHUNK_SIZE) - { /* File has coding history data. */ - - b->coding_history_size = chunksize - WAV_BEXT_MIN_CHUNK_SIZE ; - - /* We do not parse the coding history */ - bytes += psf_binheader_readf (psf, "b", b->coding_history, b->coding_history_size) ; - } ; - - if (bytes < chunksize) - psf_binheader_readf (psf, "j", chunksize - bytes) ; - - return 0 ; -} /* wav_read_bext_chunk */ - -int -wav_write_bext_chunk (SF_PRIVATE *psf) -{ SF_BROADCAST_INFO_16K *b ; - - if (psf->broadcast_16k == NULL) - return -1 ; - - b = psf->broadcast_16k ; - - psf_binheader_writef (psf, "m4", bext_MARKER, WAV_BEXT_MIN_CHUNK_SIZE + b->coding_history_size) ; - - /* - ** Note that it is very important the the field widths of the SF_BROADCAST_INFO - ** struct match those for the bext chunk fields. - */ - - psf_binheader_writef (psf, "b", b->description, sizeof (b->description)) ; - psf_binheader_writef (psf, "b", b->originator, sizeof (b->originator)) ; - psf_binheader_writef (psf, "b", b->originator_reference, sizeof (b->originator_reference)) ; - psf_binheader_writef (psf, "b", b->origination_date, sizeof (b->origination_date)) ; - psf_binheader_writef (psf, "b", b->origination_time, sizeof (b->origination_time)) ; - psf_binheader_writef (psf, "442", b->time_reference_low, b->time_reference_high, b->version) ; - psf_binheader_writef (psf, "b", b->umid, sizeof (b->umid)) ; - psf_binheader_writef (psf, "z", make_size_t (190)) ; - - if (b->coding_history_size > 0) - psf_binheader_writef (psf, "b", b->coding_history, make_size_t (b->coding_history_size)) ; - - return 0 ; -} /* wav_write_bext_chunk */ - -int -wav_read_cart_chunk (SF_PRIVATE *psf, uint32_t chunksize) -{ SF_CART_INFO_16K *c ; - uint32_t bytes = 0 ; - int k ; - - if (chunksize < WAV_CART_MIN_CHUNK_SIZE) - { psf_log_printf (psf, "cart : %u (should be >= %d)\n", chunksize, WAV_CART_MIN_CHUNK_SIZE) ; - psf_binheader_readf (psf, "j", chunksize) ; - return 0 ; - } ; - if (chunksize > WAV_CART_MAX_CHUNK_SIZE) - { psf_log_printf (psf, "cart : %u (should be < %d)\n", chunksize, WAV_CART_MAX_CHUNK_SIZE) ; - psf_binheader_readf (psf, "j", chunksize) ; - return 0 ; - } ; - - if (chunksize >= sizeof (SF_CART_INFO_16K)) - { psf_log_printf (psf, "cart : %u too big to be handled\n", chunksize) ; - psf_binheader_readf (psf, "j", chunksize) ; - return 0 ; - } ; - - psf_log_printf (psf, "cart : %u\n", chunksize) ; - - if ((psf->cart_16k = cart_var_alloc ()) == NULL) - { psf->error = SFE_MALLOC_FAILED ; - return psf->error ; - } ; - - c = psf->cart_16k ; - bytes += psf_binheader_readf (psf, "b", c->version, sizeof (c->version)) ; - bytes += psf_binheader_readf (psf, "b", c->title, sizeof (c->title)) ; - bytes += psf_binheader_readf (psf, "b", c->artist, sizeof (c->artist)) ; - bytes += psf_binheader_readf (psf, "b", c->cut_id, sizeof (c->cut_id)) ; - bytes += psf_binheader_readf (psf, "b", c->client_id, sizeof (c->client_id)) ; - bytes += psf_binheader_readf (psf, "b", c->category, sizeof (c->category)) ; - bytes += psf_binheader_readf (psf, "b", c->classification, sizeof (c->classification)) ; - bytes += psf_binheader_readf (psf, "b", c->out_cue, sizeof (c->out_cue)) ; - bytes += psf_binheader_readf (psf, "b", c->start_date, sizeof (c->start_date)) ; - bytes += psf_binheader_readf (psf, "b", c->start_time, sizeof (c->start_time)) ; - bytes += psf_binheader_readf (psf, "b", c->end_date, sizeof (c->end_date)) ; - bytes += psf_binheader_readf (psf, "b", c->end_time, sizeof (c->end_time)) ; - bytes += psf_binheader_readf (psf, "b", c->producer_app_id, sizeof (c->producer_app_id)) ; - bytes += psf_binheader_readf (psf, "b", c->producer_app_version, sizeof (c->producer_app_version)) ; - bytes += psf_binheader_readf (psf, "b", c->user_def, sizeof (c->user_def)) ; - bytes += psf_binheader_readf (psf, "e4", &c->level_reference, sizeof (c->level_reference)) ; - - for (k = 0 ; k < ARRAY_LEN (c->post_timers) ; k++) - bytes += psf_binheader_readf (psf, "b4", &c->post_timers [k].usage, make_size_t (4), &c->post_timers [k].value) ; - - bytes += psf_binheader_readf (psf, "b", c->reserved, sizeof (c->reserved)) ; - bytes += psf_binheader_readf (psf, "b", c->url, sizeof (c->url)) ; - - if (chunksize > WAV_CART_MIN_CHUNK_SIZE) - { /* File has tag text. */ - c->tag_text_size = chunksize - WAV_CART_MIN_CHUNK_SIZE ; - bytes += psf_binheader_readf (psf, "b", c->tag_text, make_size_t (c->tag_text_size)) ; - } ; - - return 0 ; -} /* wav_read_cart_chunk */ - -int -wav_write_cart_chunk (SF_PRIVATE *psf) -{ SF_CART_INFO_16K *c ; - int k ; - - if (psf->cart_16k == NULL) - return -1 ; - - c = psf->cart_16k ; - psf_binheader_writef (psf, "m4", cart_MARKER, WAV_CART_MIN_CHUNK_SIZE + c->tag_text_size) ; - /* - ** Note that it is very important the the field widths of the SF_CART_INFO - ** struct match those for the cart chunk fields. - */ - psf_binheader_writef (psf, "b", c->version, sizeof (c->version)) ; - psf_binheader_writef (psf, "b", c->title, sizeof (c->title)) ; - psf_binheader_writef (psf, "b", c->artist, sizeof (c->artist)) ; - psf_binheader_writef (psf, "b", c->cut_id, sizeof (c->cut_id)) ; - psf_binheader_writef (psf, "b", c->client_id, sizeof (c->client_id)) ; - psf_binheader_writef (psf, "b", c->category, sizeof (c->category)) ; - psf_binheader_writef (psf, "b", c->classification, sizeof (c->classification)) ; - psf_binheader_writef (psf, "b", c->out_cue, sizeof (c->out_cue)) ; - psf_binheader_writef (psf, "b", c->start_date, sizeof (c->start_date)) ; - psf_binheader_writef (psf, "b", c->start_time, sizeof (c->start_time)) ; - psf_binheader_writef (psf, "b", c->end_date, sizeof (c->end_date)) ; - psf_binheader_writef (psf, "b", c->end_time, sizeof (c->end_time)) ; - psf_binheader_writef (psf, "b", c->producer_app_id, sizeof (c->producer_app_id)) ; - psf_binheader_writef (psf, "b", c->producer_app_version, sizeof (c->producer_app_version)) ; - psf_binheader_writef (psf, "b", c->user_def, sizeof (c->user_def)) ; - psf_binheader_writef (psf, "4", c->level_reference, sizeof (c->level_reference)) ; - - for (k = 0 ; k < ARRAY_LEN (c->post_timers) ; k++) - psf_binheader_writef (psf, "b4", c->post_timers [k].usage, make_size_t (4), c->post_timers [k].value) ; - - psf_binheader_writef (psf, "z", sizeof (c->reserved)) ; // just write zeros, we don't have any other use for it - psf_binheader_writef (psf, "b", c->url, sizeof (c->url)) ; - - if (c->tag_text_size > 0) - psf_binheader_writef (psf, "b", c->tag_text, make_size_t (c->tag_text_size)) ; - - return 0 ; -} /* wav_write_cart_chunk */ - -static int -exif_fill_and_sink (SF_PRIVATE *psf, char* buf, size_t bufsz, size_t toread) -{ - size_t bytesread = 0 ; - - buf [0] = 0 ; - bufsz -= 1 ; - if (toread < bufsz) - bufsz = toread ; - bytesread = psf_binheader_readf (psf, "b", buf, bufsz) ; - buf [bufsz] = 0 ; - - if (bytesread == bufsz && toread > bufsz) - bytesread += psf_binheader_readf (psf, "j", toread - bufsz) ; - - return bytesread ; -} /* exif_fill_and_sink */ - -/* -** Exif specification for audio files, at JEITA CP-3451 Exif 2.2 section 5 -** (Exif Audio File Specification) http://www.exif.org/Exif2-2.PDF -*/ -static int -exif_subchunk_parse (SF_PRIVATE *psf, uint32_t length) -{ uint32_t marker, dword, vmajor = -1, vminor = -1, bytesread = 0 ; - char buf [4096] ; - - while (bytesread < length) - { - bytesread += psf_binheader_readf (psf, "m", &marker) ; - - switch (marker) - { - case 0 : /* camera padding? */ - break ; - - case ever_MARKER : - bytesread += psf_binheader_readf (psf, "j4", 4, &dword) ; - vmajor = 10 * (((dword >> 24) & 0xff) - '0') + (((dword >> 16) & 0xff) - '0') ; - vminor = 10 * (((dword >> 8) & 0xff) - '0') + ((dword & 0xff) - '0') ; - psf_log_printf (psf, " EXIF Version : %u.%02u\n", vmajor, vminor) ; - break ; - - case olym_MARKER : - bytesread += psf_binheader_readf (psf, "4", &dword) ; - psf_log_printf (psf, "%M : %u\n", marker, dword) ; - dword += (dword & 1) ; - bytesread += psf_binheader_readf (psf, "j", dword) ; - break ; - - case emnt_MARKER : /* design information: null-terminated string */ - case emdl_MARKER : /* model name ; null-terminated string */ - case ecor_MARKER : /* manufacturer: null-terminated string */ - case etim_MARKER : /* creation time: null-terminated string in the format "hour:minute:second.subsecond" */ - case erel_MARKER : /* relation info: null-terminated string (filename) */ - case eucm_MARKER : /* user comment: 4-byte size follows, then possibly unicode data */ - bytesread += psf_binheader_readf (psf, "4", &dword) ; - bytesread += sizeof (dword) ; - dword += (dword & 1) ; - - if (dword >= sizeof (buf)) - { psf_log_printf (psf, "*** Marker '%M' is too big %u\n\n", marker, dword) ; - return bytesread ; - } ; - - bytesread += exif_fill_and_sink (psf, buf, sizeof (buf), dword) ; - - /* BAD - don't know what's going on here -- maybe a bug in the camera */ - /* field should be NULL-terminated but there's no room for it with the reported number */ - /* example output: emdl : 8 (EX-Z1050) */ - if (marker == emdl_MARKER && dword == strlen (buf) /* should be >= strlen+1*/) - { psf_log_printf (psf, " *** field size too small for string (sinking 2 bytes)\n") ; - bytesread += psf_binheader_readf (psf, "j", 2) ; - } ; - - psf_log_printf (psf, " %M : %d (%s)\n", marker, dword, buf) ; - if (dword > length) - return bytesread ; - break ; - - default : - psf_log_printf (psf, " *** %M (%d): -- ignored --\n", marker, marker) ; - break ; - } ; - } ; - - return bytesread ; -} /* exif_subchunk_parse */ - -/*============================================================================== -*/ - -static int -wav_set_chunk (SF_PRIVATE *psf, const SF_CHUNK_INFO * chunk_info) -{ return psf_save_write_chunk (&psf->wchunks, chunk_info) ; -} /* wav_set_chunk */ - -static SF_CHUNK_ITERATOR * -wav_next_chunk_iterator (SF_PRIVATE *psf, SF_CHUNK_ITERATOR * iterator) -{ return psf_next_chunk_iterator (&psf->rchunks, iterator) ; -} /* wav_next_chunk_iterator */ - -static int -wav_get_chunk_size (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) -{ int indx ; - - if ((indx = psf_find_read_chunk_iterator (&psf->rchunks, iterator)) < 0) - return SFE_UNKNOWN_CHUNK ; - - chunk_info->datalen = psf->rchunks.chunks [indx].len ; - - return SFE_NO_ERROR ; -} /* wav_get_chunk_size */ - -static int -wav_get_chunk_data (SF_PRIVATE *psf, const SF_CHUNK_ITERATOR * iterator, SF_CHUNK_INFO * chunk_info) -{ int indx ; - sf_count_t pos ; - - if ((indx = psf_find_read_chunk_iterator (&psf->rchunks, iterator)) < 0) - return SFE_UNKNOWN_CHUNK ; - - if (chunk_info->data == NULL) - return SFE_BAD_CHUNK_DATA_PTR ; - - chunk_info->id_size = psf->rchunks.chunks [indx].id_size ; - memcpy (chunk_info->id, psf->rchunks.chunks [indx].id, sizeof (chunk_info->id) / sizeof (*chunk_info->id)) ; - - pos = psf_ftell (psf) ; - psf_fseek (psf, psf->rchunks.chunks [indx].offset, SEEK_SET) ; - psf_fread (chunk_info->data, SF_MIN (chunk_info->datalen, psf->rchunks.chunks [indx].len), 1, psf) ; - psf_fseek (psf, pos, SEEK_SET) ; - - return SFE_NO_ERROR ; -} /* wav_get_chunk_data */ diff --git a/libs/libsndfile/src/wav_w64.c b/libs/libsndfile/src/wav_w64.c deleted file mode 100644 index cf0d3ef2b1..0000000000 --- a/libs/libsndfile/src/wav_w64.c +++ /dev/null @@ -1,678 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** Copyright (C) 2004-2005 David Viens -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" -#include "wav_w64.h" - -/* Known WAVEFORMATEXTENSIBLE GUIDS. */ -static const EXT_SUBFORMAT MSGUID_SUBTYPE_PCM = -{ 0x00000001, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_MS_ADPCM = -{ 0x00000002, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_IEEE_FLOAT = -{ 0x00000003, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_ALAW = -{ 0x00000006, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_MULAW = -{ 0x00000007, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 } -} ; - -/* -** the next two are from -** http://dream.cs.bath.ac.uk/researchdev/wave-ex/bformat.html -*/ - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_PCM = -{ 0x00000001, 0x0721, 0x11d3, { 0x86, 0x44, 0xc8, 0xc1, 0xca, 0x00, 0x00, 0x00 } -} ; - -static const EXT_SUBFORMAT MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_IEEE_FLOAT = -{ 0x00000003, 0x0721, 0x11d3, { 0x86, 0x44, 0xc8, 0xc1, 0xca, 0x00, 0x00, 0x00 } -} ; - - -#if 0 -/* maybe interesting one day to read the following through sf_read_raw */ -/* http://www.bath.ac.uk/~masrwd/pvocex/pvocex.html */ -static const EXT_SUBFORMAT MSGUID_SUBTYPE_PVOCEX = -{ 0x8312b9c2, 0x2e6e, 0x11d4, { 0xa8, 0x24, 0xde, 0x5b, 0x96, 0xc3, 0xab, 0x21 } -} ; -#endif - -/* This stores which bit in dwChannelMask maps to which channel */ -static const struct chanmap_s -{ int id ; - const char * name ; -} channel_mask_bits [] = -{ /* WAVEFORMATEXTENSIBLE doesn't distuingish FRONT_LEFT from LEFT */ - { SF_CHANNEL_MAP_LEFT, "L" }, - { SF_CHANNEL_MAP_RIGHT, "R" }, - { SF_CHANNEL_MAP_CENTER, "C" }, - { SF_CHANNEL_MAP_LFE, "LFE" }, - { SF_CHANNEL_MAP_REAR_LEFT, "Ls" }, - { SF_CHANNEL_MAP_REAR_RIGHT, "Rs" }, - { SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER, "Lc" }, - { SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER, "Rc" }, - { SF_CHANNEL_MAP_REAR_CENTER, "Cs" }, - { SF_CHANNEL_MAP_SIDE_LEFT, "Sl" }, - { SF_CHANNEL_MAP_SIDE_RIGHT, "Sr" }, - { SF_CHANNEL_MAP_TOP_CENTER, "Tc" }, - { SF_CHANNEL_MAP_TOP_FRONT_LEFT, "Tfl" }, - { SF_CHANNEL_MAP_TOP_FRONT_CENTER, "Tfc" }, - { SF_CHANNEL_MAP_TOP_FRONT_RIGHT, "Tfr" }, - { SF_CHANNEL_MAP_TOP_REAR_LEFT, "Trl" }, - { SF_CHANNEL_MAP_TOP_REAR_CENTER, "Trc" }, - { SF_CHANNEL_MAP_TOP_REAR_RIGHT, "Trr" }, -} ; - -/*------------------------------------------------------------------------------ - * Private static functions. - */ - -static int -wavex_guid_equal (const EXT_SUBFORMAT * first, const EXT_SUBFORMAT * second) -{ return !memcmp (first, second, sizeof (EXT_SUBFORMAT)) ; -} /* wavex_guid_equal */ - - - -int -wav_w64_read_fmt_chunk (SF_PRIVATE *psf, int fmtsize) -{ WAV_PRIVATE * wpriv ; - WAV_FMT *wav_fmt ; - int bytesread, k, bytespersec = 0 ; - - if ((wpriv = psf->container_data) == NULL) - return SFE_INTERNAL ; - wav_fmt = &wpriv->wav_fmt ; - - memset (wav_fmt, 0, sizeof (WAV_FMT)) ; - - if (fmtsize < 16) - return SFE_WAV_FMT_SHORT ; - - /* assume psf->rwf_endian is already properly set */ - - /* Read the minimal WAV file header here. */ - bytesread = psf_binheader_readf (psf, "224422", - &(wav_fmt->format), &(wav_fmt->min.channels), - &(wav_fmt->min.samplerate), &(wav_fmt->min.bytespersec), - &(wav_fmt->min.blockalign), &(wav_fmt->min.bitwidth)) ; - - psf_log_printf (psf, " Format : 0x%X => %s\n", wav_fmt->format, wav_w64_format_str (wav_fmt->format)) ; - psf_log_printf (psf, " Channels : %d\n", wav_fmt->min.channels) ; - psf_log_printf (psf, " Sample Rate : %d\n", wav_fmt->min.samplerate) ; - - if (wav_fmt->format == WAVE_FORMAT_PCM && wav_fmt->min.blockalign == 0 - && wav_fmt->min.bitwidth > 0 && wav_fmt->min.channels > 0) - { wav_fmt->min.blockalign = wav_fmt->min.bitwidth / 8 + (wav_fmt->min.bitwidth % 8 > 0 ? 1 : 0) ; - wav_fmt->min.blockalign *= wav_fmt->min.channels ; - psf_log_printf (psf, " Block Align : 0 (should be %d)\n", wav_fmt->min.blockalign) ; - } - else - psf_log_printf (psf, " Block Align : %d\n", wav_fmt->min.blockalign) ; - - if (wav_fmt->format == WAVE_FORMAT_PCM && wav_fmt->min.bitwidth == 24 && - wav_fmt->min.blockalign == 4 * wav_fmt->min.channels) - { psf_log_printf (psf, " Bit Width : 24\n") ; - - psf_log_printf (psf, "\n" - " Ambiguous information in 'fmt ' chunk. Possibile file types:\n" - " 0) Invalid IEEE float file generated by Syntrillium's Cooledit!\n" - " 1) File generated by ALSA's arecord containing 24 bit samples in 32 bit containers.\n" - " 2) 24 bit file with incorrect Block Align value.\n" - "\n") ; - - wpriv->fmt_is_broken = 1 ; - } - else if (wav_fmt->min.bitwidth == 0) - { switch (wav_fmt->format) - { case WAVE_FORMAT_GSM610 : - case WAVE_FORMAT_IPP_ITU_G_723_1 : - psf_log_printf (psf, " Bit Width : %d\n", wav_fmt->min.bitwidth) ; - break ; - default : - psf_log_printf (psf, " Bit Width : %d (should not be 0)\n", wav_fmt->min.bitwidth) ; - } - } - else - { switch (wav_fmt->format) - { case WAVE_FORMAT_GSM610 : - case WAVE_FORMAT_IPP_ITU_G_723_1 : - psf_log_printf (psf, " Bit Width : %d (should be 0)\n", wav_fmt->min.bitwidth) ; - break ; - default : - psf_log_printf (psf, " Bit Width : %d\n", wav_fmt->min.bitwidth) ; - } - } ; - - psf->sf.samplerate = wav_fmt->min.samplerate ; - psf->sf.frames = 0 ; /* Correct this when reading data chunk. */ - psf->sf.channels = wav_fmt->min.channels ; - - switch (wav_fmt->format) - { case WAVE_FORMAT_PCM : - case WAVE_FORMAT_IEEE_FLOAT : - bytespersec = wav_fmt->min.samplerate * wav_fmt->min.blockalign ; - if (wav_fmt->min.bytespersec != (unsigned) bytespersec) - psf_log_printf (psf, " Bytes/sec : %d (should be %d)\n", wav_fmt->min.bytespersec, bytespersec) ; - else - psf_log_printf (psf, " Bytes/sec : %d\n", wav_fmt->min.bytespersec) ; - - psf->bytewidth = BITWIDTH2BYTES (wav_fmt->min.bitwidth) ; - break ; - - case WAVE_FORMAT_ALAW : - case WAVE_FORMAT_MULAW : - if (wav_fmt->min.bytespersec / wav_fmt->min.blockalign != wav_fmt->min.samplerate) - psf_log_printf (psf, " Bytes/sec : %d (should be %d)\n", wav_fmt->min.bytespersec, wav_fmt->min.samplerate * wav_fmt->min.blockalign) ; - else - psf_log_printf (psf, " Bytes/sec : %d\n", wav_fmt->min.bytespersec) ; - - psf->bytewidth = 1 ; - if (fmtsize >= 18) - { bytesread += psf_binheader_readf (psf, "2", &(wav_fmt->size20.extrabytes)) ; - psf_log_printf (psf, " Extra Bytes : %d\n", wav_fmt->size20.extrabytes) ; - } ; - break ; - - case WAVE_FORMAT_IMA_ADPCM : - if (wav_fmt->min.bitwidth != 4) - return SFE_WAV_ADPCM_NOT4BIT ; - if (wav_fmt->min.channels < 1 || wav_fmt->min.channels > 2) - return SFE_WAV_ADPCM_CHANNELS ; - - bytesread += - psf_binheader_readf (psf, "22", &(wav_fmt->ima.extrabytes), &(wav_fmt->ima.samplesperblock)) ; - - bytespersec = (wav_fmt->ima.samplerate * wav_fmt->ima.blockalign) / wav_fmt->ima.samplesperblock ; - if (wav_fmt->ima.bytespersec != (unsigned) bytespersec) - psf_log_printf (psf, " Bytes/sec : %d (should be %d)\n", wav_fmt->ima.bytespersec, bytespersec) ; - else - psf_log_printf (psf, " Bytes/sec : %d\n", wav_fmt->ima.bytespersec) ; - - psf_log_printf (psf, " Extra Bytes : %d\n", wav_fmt->ima.extrabytes) ; - psf_log_printf (psf, " Samples/Block : %d\n", wav_fmt->ima.samplesperblock) ; - break ; - - case WAVE_FORMAT_MS_ADPCM : - if (wav_fmt->msadpcm.bitwidth != 4) - return SFE_WAV_ADPCM_NOT4BIT ; - if (wav_fmt->msadpcm.channels < 1 || wav_fmt->msadpcm.channels > 2) - return SFE_WAV_ADPCM_CHANNELS ; - - bytesread += - psf_binheader_readf (psf, "222", &(wav_fmt->msadpcm.extrabytes), - &(wav_fmt->msadpcm.samplesperblock), &(wav_fmt->msadpcm.numcoeffs)) ; - - bytespersec = (wav_fmt->min.samplerate * wav_fmt->min.blockalign) / wav_fmt->msadpcm.samplesperblock ; - if (wav_fmt->min.bytespersec == (unsigned) bytespersec) - psf_log_printf (psf, " Bytes/sec : %d\n", wav_fmt->min.bytespersec) ; - else if (wav_fmt->min.bytespersec == (wav_fmt->min.samplerate / wav_fmt->msadpcm.samplesperblock) * wav_fmt->min.blockalign) - psf_log_printf (psf, " Bytes/sec : %d (should be %d (MS BUG!))\n", wav_fmt->min.bytespersec, bytespersec) ; - else - psf_log_printf (psf, " Bytes/sec : %d (should be %d)\n", wav_fmt->min.bytespersec, bytespersec) ; - - psf_log_printf (psf, " Extra Bytes : %d\n", wav_fmt->msadpcm.extrabytes) ; - psf_log_printf (psf, " Samples/Block : %d\n", wav_fmt->msadpcm.samplesperblock) ; - if (wav_fmt->msadpcm.numcoeffs > ARRAY_LEN (wav_fmt->msadpcm.coeffs)) - { psf_log_printf (psf, " No. of Coeffs : %d (should be <= %d)\n", wav_fmt->msadpcm.numcoeffs, ARRAY_LEN (wav_fmt->msadpcm.coeffs)) ; - wav_fmt->msadpcm.numcoeffs = ARRAY_LEN (wav_fmt->msadpcm.coeffs) ; - } - else - psf_log_printf (psf, " No. of Coeffs : %d\n", wav_fmt->msadpcm.numcoeffs) ; - - psf_log_printf (psf, " Index Coeffs1 Coeffs2\n") ; - for (k = 0 ; k < wav_fmt->msadpcm.numcoeffs ; k++) - { char buffer [128] ; - - bytesread += - psf_binheader_readf (psf, "22", &(wav_fmt->msadpcm.coeffs [k].coeff1), &(wav_fmt->msadpcm.coeffs [k].coeff2)) ; - snprintf (buffer, sizeof (buffer), " %2d %7d %7d\n", k, wav_fmt->msadpcm.coeffs [k].coeff1, wav_fmt->msadpcm.coeffs [k].coeff2) ; - psf_log_printf (psf, buffer) ; - } ; - break ; - - case WAVE_FORMAT_GSM610 : - if (wav_fmt->gsm610.channels != 1 || wav_fmt->gsm610.blockalign != 65) - return SFE_WAV_GSM610_FORMAT ; - - bytesread += - psf_binheader_readf (psf, "22", &(wav_fmt->gsm610.extrabytes), &(wav_fmt->gsm610.samplesperblock)) ; - - if (wav_fmt->gsm610.samplesperblock != 320) - return SFE_WAV_GSM610_FORMAT ; - - bytespersec = (wav_fmt->gsm610.samplerate * wav_fmt->gsm610.blockalign) / wav_fmt->gsm610.samplesperblock ; - if (wav_fmt->gsm610.bytespersec != (unsigned) bytespersec) - psf_log_printf (psf, " Bytes/sec : %d (should be %d)\n", wav_fmt->gsm610.bytespersec, bytespersec) ; - else - psf_log_printf (psf, " Bytes/sec : %d\n", wav_fmt->gsm610.bytespersec) ; - - psf_log_printf (psf, " Extra Bytes : %d\n", wav_fmt->gsm610.extrabytes) ; - psf_log_printf (psf, " Samples/Block : %d\n", wav_fmt->gsm610.samplesperblock) ; - break ; - - case WAVE_FORMAT_EXTENSIBLE : - if (wav_fmt->ext.bytespersec / wav_fmt->ext.blockalign != wav_fmt->ext.samplerate) - psf_log_printf (psf, " Bytes/sec : %d (should be %d)\n", wav_fmt->ext.bytespersec, wav_fmt->ext.samplerate * wav_fmt->ext.blockalign) ; - else - psf_log_printf (psf, " Bytes/sec : %d\n", wav_fmt->ext.bytespersec) ; - - bytesread += - psf_binheader_readf (psf, "224", &(wav_fmt->ext.extrabytes), &(wav_fmt->ext.validbits), - &(wav_fmt->ext.channelmask)) ; - - psf_log_printf (psf, " Valid Bits : %d\n", wav_fmt->ext.validbits) ; - - if (wav_fmt->ext.channelmask == 0) - psf_log_printf (psf, " Channel Mask : 0x0 (should not be zero)\n") ; - else - { char buffer [512] ; - unsigned bit ; - - wpriv->wavex_channelmask = wav_fmt->ext.channelmask ; - - /* It's probably wise to ignore the channel mask if it is all zero */ - free (psf->channel_map) ; - - if ((psf->channel_map = calloc (psf->sf.channels, sizeof (psf->channel_map [0]))) == NULL) - return SFE_MALLOC_FAILED ; - - /* Terminate the buffer we're going to append_snprintf into. */ - buffer [0] = 0 ; - - for (bit = k = 0 ; bit < ARRAY_LEN (channel_mask_bits) ; bit++) - { - if (wav_fmt->ext.channelmask & (1 << bit)) - { if (k > psf->sf.channels) - { psf_log_printf (psf, "*** More channel map bits than there are channels.\n") ; - break ; - } ; - - psf->channel_map [k++] = channel_mask_bits [bit].id ; - append_snprintf (buffer, sizeof (buffer), "%s, ", channel_mask_bits [bit].name) ; - } ; - } ; - - /* Remove trailing ", ". */ - bit = strlen (buffer) ; - buffer [--bit] = 0 ; - buffer [--bit] = 0 ; - - if (k != psf->sf.channels) - { psf_log_printf (psf, " Channel Mask : 0x%X\n", wav_fmt->ext.channelmask) ; - psf_log_printf (psf, "*** Less channel map bits than there are channels.\n") ; - } - else - psf_log_printf (psf, " Channel Mask : 0x%X (%s)\n", wav_fmt->ext.channelmask, buffer) ; - } ; - - bytesread += psf_binheader_readf (psf, "422", &(wav_fmt->ext.esf.esf_field1), &(wav_fmt->ext.esf.esf_field2), &(wav_fmt->ext.esf.esf_field3)) ; - - /* compare the esf_fields with each known GUID? and print? */ - psf_log_printf (psf, " Subformat\n") ; - psf_log_printf (psf, " esf_field1 : 0x%X\n", wav_fmt->ext.esf.esf_field1) ; - psf_log_printf (psf, " esf_field2 : 0x%X\n", wav_fmt->ext.esf.esf_field2) ; - psf_log_printf (psf, " esf_field3 : 0x%X\n", wav_fmt->ext.esf.esf_field3) ; - psf_log_printf (psf, " esf_field4 : ") ; - for (k = 0 ; k < 8 ; k++) - { bytesread += psf_binheader_readf (psf, "1", &(wav_fmt->ext.esf.esf_field4 [k])) ; - psf_log_printf (psf, "0x%X ", wav_fmt->ext.esf.esf_field4 [k] & 0xFF) ; - } ; - psf_log_printf (psf, "\n") ; - psf->bytewidth = BITWIDTH2BYTES (wav_fmt->ext.bitwidth) ; - - /* Compare GUIDs for known ones. */ - if (wavex_guid_equal (&wav_fmt->ext.esf, &MSGUID_SUBTYPE_PCM)) - { psf->sf.format = SF_FORMAT_WAVEX | u_bitwidth_to_subformat (psf->bytewidth * 8) ; - psf_log_printf (psf, " format : pcm\n") ; - } - else if (wavex_guid_equal (&wav_fmt->ext.esf, &MSGUID_SUBTYPE_MS_ADPCM)) - { psf->sf.format = (SF_FORMAT_WAVEX | SF_FORMAT_MS_ADPCM) ; - psf_log_printf (psf, " format : ms adpcm\n") ; - } - else if (wavex_guid_equal (&wav_fmt->ext.esf, &MSGUID_SUBTYPE_IEEE_FLOAT)) - { psf->sf.format = SF_FORMAT_WAVEX | ((psf->bytewidth == 8) ? SF_FORMAT_DOUBLE : SF_FORMAT_FLOAT) ; - psf_log_printf (psf, " format : IEEE float\n") ; - } - else if (wavex_guid_equal (&wav_fmt->ext.esf, &MSGUID_SUBTYPE_ALAW)) - { psf->sf.format = (SF_FORMAT_WAVEX | SF_FORMAT_ALAW) ; - psf_log_printf (psf, " format : A-law\n") ; - } - else if (wavex_guid_equal (&wav_fmt->ext.esf, &MSGUID_SUBTYPE_MULAW)) - { psf->sf.format = (SF_FORMAT_WAVEX | SF_FORMAT_ULAW) ; - psf_log_printf (psf, " format : u-law\n") ; - } - else if (wavex_guid_equal (&wav_fmt->ext.esf, &MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_PCM)) - { psf->sf.format = SF_FORMAT_WAVEX | u_bitwidth_to_subformat (psf->bytewidth * 8) ; - psf_log_printf (psf, " format : pcm (Ambisonic B)\n") ; - wpriv->wavex_ambisonic = SF_AMBISONIC_B_FORMAT ; - } - else if (wavex_guid_equal (&wav_fmt->ext.esf, &MSGUID_SUBTYPE_AMBISONIC_B_FORMAT_IEEE_FLOAT)) - { psf->sf.format = SF_FORMAT_WAVEX | ((psf->bytewidth == 8) ? SF_FORMAT_DOUBLE : SF_FORMAT_FLOAT) ; - psf_log_printf (psf, " format : IEEE float (Ambisonic B)\n") ; - wpriv->wavex_ambisonic = SF_AMBISONIC_B_FORMAT ; - } - else - return SFE_UNIMPLEMENTED ; - - break ; - - case WAVE_FORMAT_G721_ADPCM : - psf_log_printf (psf, " Bytes/sec : %d\n", wav_fmt->g72x.bytespersec) ; - if (fmtsize >= 20) - { bytesread += psf_binheader_readf (psf, "22", &(wav_fmt->g72x.extrabytes), &(wav_fmt->g72x.auxblocksize)) ; - if (wav_fmt->g72x.extrabytes == 0) - psf_log_printf (psf, " Extra Bytes : %d (should be 2)\n", wav_fmt->g72x.extrabytes) ; - else - psf_log_printf (psf, " Extra Bytes : %d\n", wav_fmt->g72x.extrabytes) ; - psf_log_printf (psf, " Aux Blk Size : %d\n", wav_fmt->g72x.auxblocksize) ; - } - else if (fmtsize == 18) - { bytesread += psf_binheader_readf (psf, "2", &(wav_fmt->g72x.extrabytes)) ; - psf_log_printf (psf, " Extra Bytes : %d%s\n", wav_fmt->g72x.extrabytes, wav_fmt->g72x.extrabytes != 0 ? " (should be 0)" : "") ; - } - else - psf_log_printf (psf, "*** 'fmt ' chunk should be bigger than this!\n") ; - break ; - - default : - psf_log_printf (psf, "*** No 'fmt ' chunk dumper for this format!\n") ; - return SFE_WAV_BAD_FMT ; - } ; - - if (bytesread > fmtsize) - { psf_log_printf (psf, "*** wav_w64_read_fmt_chunk (bytesread > fmtsize)\n") ; - return SFE_WAV_BAD_FMT ; - } - else - psf_binheader_readf (psf, "j", fmtsize - bytesread) ; - - psf->blockwidth = wav_fmt->min.channels * psf->bytewidth ; - - return 0 ; -} /* wav_w64_read_fmt_chunk */ - -void -wavex_write_guid (SF_PRIVATE *psf, const EXT_SUBFORMAT * subformat) -{ - psf_binheader_writef (psf, "422b", subformat->esf_field1, - subformat->esf_field2, subformat->esf_field3, - subformat->esf_field4, make_size_t (8)) ; -} /* wavex_write_guid */ - - -int -wavex_gen_channel_mask (const int *chan_map, int channels) -{ int chan, mask = 0, bit = -1, last_bit = -1 ; - - if (chan_map == NULL) - return 0 ; - - for (chan = 0 ; chan < channels ; chan ++) - { int k ; - - for (k = bit + 1 ; k < ARRAY_LEN (channel_mask_bits) ; k++) - if (chan_map [chan] == channel_mask_bits [k].id) - { bit = k ; - break ; - } ; - - /* Check for bad sequence. */ - if (bit <= last_bit) - return 0 ; - - mask += 1 << bit ; - last_bit = bit ; - } ; - - return mask ; -} /* wavex_gen_channel_mask */ - -void -wav_w64_analyze (SF_PRIVATE *psf) -{ unsigned char buffer [4096] ; - AUDIO_DETECT ad ; - int format = 0 ; - - if (psf->is_pipe) - { psf_log_printf (psf, "*** Error : Reading from a pipe. Can't analyze data section to figure out real data format.\n\n") ; - return ; - } ; - - psf_log_printf (psf, "---------------------------------------------------\n" - "Format is known to be broken. Using detection code.\n") ; - - /* Code goes here. */ - ad.endianness = SF_ENDIAN_LITTLE ; - ad.channels = psf->sf.channels ; - - psf_fseek (psf, 3 * 4 * 50, SEEK_SET) ; - - while (psf_fread (buffer, 1, sizeof (buffer), psf) == sizeof (buffer)) - { format = audio_detect (psf, &ad, buffer, sizeof (buffer)) ; - if (format != 0) - break ; - } ; - - /* Seek to start of DATA section. */ - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - if (format == 0) - { psf_log_printf (psf, "wav_w64_analyze : detection failed.\n") ; - return ; - } ; - - switch (format) - { case SF_FORMAT_PCM_32 : - case SF_FORMAT_FLOAT : - psf_log_printf (psf, "wav_w64_analyze : found format : 0x%X\n", format) ; - psf->sf.format = (psf->sf.format & ~SF_FORMAT_SUBMASK) + format ; - psf->bytewidth = 4 ; - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - break ; - - case SF_FORMAT_PCM_24 : - psf_log_printf (psf, "wav_w64_analyze : found format : 0x%X\n", format) ; - psf->sf.format = (psf->sf.format & ~SF_FORMAT_SUBMASK) + format ; - psf->bytewidth = 3 ; - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - break ; - - default : - psf_log_printf (psf, "wav_w64_analyze : unhandled format : 0x%X\n", format) ; - break ; - } ; - - return ; -} /* wav_w64_analyze */ - -/*============================================================================== -*/ - -typedef struct -{ int ID ; - const char *name ; -} WAV_FORMAT_DESC ; - -#define STR(x) #x -#define FORMAT_TYPE(x) { x, STR (x) } - -static WAV_FORMAT_DESC wave_descs [] = -{ FORMAT_TYPE (WAVE_FORMAT_PCM), - FORMAT_TYPE (WAVE_FORMAT_MS_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_IEEE_FLOAT), - FORMAT_TYPE (WAVE_FORMAT_VSELP), - FORMAT_TYPE (WAVE_FORMAT_IBM_CVSD), - FORMAT_TYPE (WAVE_FORMAT_ALAW), - FORMAT_TYPE (WAVE_FORMAT_MULAW), - FORMAT_TYPE (WAVE_FORMAT_OKI_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_IMA_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_MEDIASPACE_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_SIERRA_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_G723_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_DIGISTD), - FORMAT_TYPE (WAVE_FORMAT_DIGIFIX), - FORMAT_TYPE (WAVE_FORMAT_DIALOGIC_OKI_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_MEDIAVISION_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_CU_CODEC), - FORMAT_TYPE (WAVE_FORMAT_YAMAHA_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_SONARC), - FORMAT_TYPE (WAVE_FORMAT_DSPGROUP_TRUESPEECH), - FORMAT_TYPE (WAVE_FORMAT_ECHOSC1), - FORMAT_TYPE (WAVE_FORMAT_AUDIOFILE_AF36), - FORMAT_TYPE (WAVE_FORMAT_APTX), - FORMAT_TYPE (WAVE_FORMAT_AUDIOFILE_AF10), - FORMAT_TYPE (WAVE_FORMAT_PROSODY_1612), - FORMAT_TYPE (WAVE_FORMAT_LRC), - FORMAT_TYPE (WAVE_FORMAT_DOLBY_AC2), - FORMAT_TYPE (WAVE_FORMAT_GSM610), - FORMAT_TYPE (WAVE_FORMAT_MSNAUDIO), - FORMAT_TYPE (WAVE_FORMAT_ANTEX_ADPCME), - FORMAT_TYPE (WAVE_FORMAT_CONTROL_RES_VQLPC), - FORMAT_TYPE (WAVE_FORMAT_DIGIREAL), - FORMAT_TYPE (WAVE_FORMAT_DIGIADPCM), - FORMAT_TYPE (WAVE_FORMAT_CONTROL_RES_CR10), - FORMAT_TYPE (WAVE_FORMAT_NMS_VBXADPCM), - FORMAT_TYPE (WAVE_FORMAT_ROLAND_RDAC), - FORMAT_TYPE (WAVE_FORMAT_ECHOSC3), - FORMAT_TYPE (WAVE_FORMAT_ROCKWELL_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_ROCKWELL_DIGITALK), - FORMAT_TYPE (WAVE_FORMAT_XEBEC), - FORMAT_TYPE (WAVE_FORMAT_G721_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_G728_CELP), - FORMAT_TYPE (WAVE_FORMAT_MSG723), - FORMAT_TYPE (WAVE_FORMAT_MPEG), - FORMAT_TYPE (WAVE_FORMAT_RT24), - FORMAT_TYPE (WAVE_FORMAT_PAC), - FORMAT_TYPE (WAVE_FORMAT_MPEGLAYER3), - FORMAT_TYPE (WAVE_FORMAT_LUCENT_G723), - FORMAT_TYPE (WAVE_FORMAT_CIRRUS), - FORMAT_TYPE (WAVE_FORMAT_ESPCM), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE), - FORMAT_TYPE (WAVE_FORMAT_CANOPUS_ATRAC), - FORMAT_TYPE (WAVE_FORMAT_G726_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_G722_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_DSAT), - FORMAT_TYPE (WAVE_FORMAT_DSAT_DISPLAY), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE_BYTE_ALIGNED), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE_AC8), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE_AC10), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE_AC16), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE_AC20), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE_RT24), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE_RT29), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE_RT29HW), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE_VR12), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE_VR18), - FORMAT_TYPE (WAVE_FORMAT_VOXWARE_TQ40), - FORMAT_TYPE (WAVE_FORMAT_SOFTSOUND), - FORMAT_TYPE (WAVE_FORMAT_VOXARE_TQ60), - FORMAT_TYPE (WAVE_FORMAT_MSRT24), - FORMAT_TYPE (WAVE_FORMAT_G729A), - FORMAT_TYPE (WAVE_FORMAT_MVI_MV12), - FORMAT_TYPE (WAVE_FORMAT_DF_G726), - FORMAT_TYPE (WAVE_FORMAT_DF_GSM610), - FORMAT_TYPE (WAVE_FORMAT_ONLIVE), - FORMAT_TYPE (WAVE_FORMAT_SBC24), - FORMAT_TYPE (WAVE_FORMAT_DOLBY_AC3_SPDIF), - FORMAT_TYPE (WAVE_FORMAT_ZYXEL_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_PHILIPS_LPCBB), - FORMAT_TYPE (WAVE_FORMAT_PACKED), - FORMAT_TYPE (WAVE_FORMAT_RHETOREX_ADPCM), - FORMAT_TYPE (IBM_FORMAT_MULAW), - FORMAT_TYPE (IBM_FORMAT_ALAW), - FORMAT_TYPE (IBM_FORMAT_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_VIVO_G723), - FORMAT_TYPE (WAVE_FORMAT_VIVO_SIREN), - FORMAT_TYPE (WAVE_FORMAT_DIGITAL_G723), - FORMAT_TYPE (WAVE_FORMAT_CREATIVE_ADPCM), - FORMAT_TYPE (WAVE_FORMAT_CREATIVE_FASTSPEECH8), - FORMAT_TYPE (WAVE_FORMAT_CREATIVE_FASTSPEECH10), - FORMAT_TYPE (WAVE_FORMAT_QUARTERDECK), - FORMAT_TYPE (WAVE_FORMAT_FM_TOWNS_SND), - FORMAT_TYPE (WAVE_FORMAT_BZV_DIGITAL), - FORMAT_TYPE (WAVE_FORMAT_VME_VMPCM), - FORMAT_TYPE (WAVE_FORMAT_OLIGSM), - FORMAT_TYPE (WAVE_FORMAT_OLIADPCM), - FORMAT_TYPE (WAVE_FORMAT_OLICELP), - FORMAT_TYPE (WAVE_FORMAT_OLISBC), - FORMAT_TYPE (WAVE_FORMAT_OLIOPR), - FORMAT_TYPE (WAVE_FORMAT_LH_CODEC), - FORMAT_TYPE (WAVE_FORMAT_NORRIS), - FORMAT_TYPE (WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS), - FORMAT_TYPE (WAVE_FORMAT_DVM), - FORMAT_TYPE (WAVE_FORMAT_INTERWAV_VSC112), - FORMAT_TYPE (WAVE_FORMAT_IPP_ITU_G_723_1), - FORMAT_TYPE (WAVE_FORMAT_EXTENSIBLE), -} ; - -char const* -wav_w64_format_str (int k) -{ int lower, upper, mid ; - - lower = -1 ; - upper = sizeof (wave_descs) / sizeof (WAV_FORMAT_DESC) ; - - /* binary search */ - if ((wave_descs [0].ID <= k) && (k <= wave_descs [upper - 1].ID)) - { - while (lower + 1 < upper) - { mid = (upper + lower) / 2 ; - - if (k == wave_descs [mid].ID) - return wave_descs [mid].name ; - if (k < wave_descs [mid].ID) - upper = mid ; - else - lower = mid ; - } ; - } ; - - return "Unknown format" ; -} /* wav_w64_format_str */ - -int -wav_w64_srate2blocksize (int srate_chan_product) -{ if (srate_chan_product < 12000) - return 256 ; - if (srate_chan_product < 23000) - return 512 ; - if (srate_chan_product < 44000) - return 1024 ; - return 2048 ; -} /* srate2blocksize */ diff --git a/libs/libsndfile/src/wav_w64.h b/libs/libsndfile/src/wav_w64.h deleted file mode 100644 index 7e180801a6..0000000000 --- a/libs/libsndfile/src/wav_w64.h +++ /dev/null @@ -1,298 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* This file contains definitions commong to WAV and W64 files. */ - - -#ifndef WAV_W64_H_INCLUDED -#define WAV_W64_H_INCLUDED - -/*------------------------------------------------------------------------------ -** List of known WAV format tags -*/ - -enum -{ - /* keep sorted for wav_w64_format_str() */ - WAVE_FORMAT_UNKNOWN = 0x0000, /* Microsoft Corporation */ - WAVE_FORMAT_PCM = 0x0001, /* Microsoft PCM format */ - WAVE_FORMAT_MS_ADPCM = 0x0002, /* Microsoft ADPCM */ - WAVE_FORMAT_IEEE_FLOAT = 0x0003, /* Micrososft 32 bit float format */ - WAVE_FORMAT_VSELP = 0x0004, /* Compaq Computer Corporation */ - WAVE_FORMAT_IBM_CVSD = 0x0005, /* IBM Corporation */ - WAVE_FORMAT_ALAW = 0x0006, /* Microsoft Corporation */ - WAVE_FORMAT_MULAW = 0x0007, /* Microsoft Corporation */ - WAVE_FORMAT_OKI_ADPCM = 0x0010, /* OKI */ - WAVE_FORMAT_IMA_ADPCM = 0x0011, /* Intel Corporation */ - WAVE_FORMAT_MEDIASPACE_ADPCM = 0x0012, /* Videologic */ - WAVE_FORMAT_SIERRA_ADPCM = 0x0013, /* Sierra Semiconductor Corp */ - WAVE_FORMAT_G723_ADPCM = 0x0014, /* Antex Electronics Corporation */ - WAVE_FORMAT_DIGISTD = 0x0015, /* DSP Solutions, Inc. */ - WAVE_FORMAT_DIGIFIX = 0x0016, /* DSP Solutions, Inc. */ - WAVE_FORMAT_DIALOGIC_OKI_ADPCM = 0x0017, /* Dialogic Corporation */ - WAVE_FORMAT_MEDIAVISION_ADPCM = 0x0018, /* Media Vision, Inc. */ - WAVE_FORMAT_CU_CODEC = 0x0019, /* Hewlett-Packard Company */ - WAVE_FORMAT_YAMAHA_ADPCM = 0x0020, /* Yamaha Corporation of America */ - WAVE_FORMAT_SONARC = 0x0021, /* Speech Compression */ - WAVE_FORMAT_DSPGROUP_TRUESPEECH = 0x0022, /* DSP Group, Inc */ - WAVE_FORMAT_ECHOSC1 = 0x0023, /* Echo Speech Corporation */ - WAVE_FORMAT_AUDIOFILE_AF36 = 0x0024, /* Audiofile, Inc. */ - WAVE_FORMAT_APTX = 0x0025, /* Audio Processing Technology */ - WAVE_FORMAT_AUDIOFILE_AF10 = 0x0026, /* Audiofile, Inc. */ - WAVE_FORMAT_PROSODY_1612 = 0x0027, /* Aculab plc */ - WAVE_FORMAT_LRC = 0x0028, /* Merging Technologies S.A. */ - WAVE_FORMAT_DOLBY_AC2 = 0x0030, /* Dolby Laboratories */ - WAVE_FORMAT_GSM610 = 0x0031, /* Microsoft Corporation */ - WAVE_FORMAT_MSNAUDIO = 0x0032, /* Microsoft Corporation */ - WAVE_FORMAT_ANTEX_ADPCME = 0x0033, /* Antex Electronics Corporation */ - WAVE_FORMAT_CONTROL_RES_VQLPC = 0x0034, /* Control Resources Limited */ - WAVE_FORMAT_DIGIREAL = 0x0035, /* DSP Solutions, Inc. */ - WAVE_FORMAT_DIGIADPCM = 0x0036, /* DSP Solutions, Inc. */ - WAVE_FORMAT_CONTROL_RES_CR10 = 0x0037, /* Control Resources Limited */ - WAVE_FORMAT_NMS_VBXADPCM = 0x0038, /* Natural MicroSystems */ - WAVE_FORMAT_ROLAND_RDAC = 0x0039, /* Roland */ - WAVE_FORMAT_ECHOSC3 = 0x003A, /* Echo Speech Corporation */ - WAVE_FORMAT_ROCKWELL_ADPCM = 0x003B, /* Rockwell International */ - WAVE_FORMAT_ROCKWELL_DIGITALK = 0x003C, /* Rockwell International */ - WAVE_FORMAT_XEBEC = 0x003D, /* Xebec Multimedia Solutions Limited */ - WAVE_FORMAT_G721_ADPCM = 0x0040, /* Antex Electronics Corporation */ - WAVE_FORMAT_G728_CELP = 0x0041, /* Antex Electronics Corporation */ - WAVE_FORMAT_MSG723 = 0x0042, /* Microsoft Corporation */ - WAVE_FORMAT_MPEG = 0x0050, /* Microsoft Corporation */ - WAVE_FORMAT_RT24 = 0x0052, /* InSoft Inc. */ - WAVE_FORMAT_PAC = 0x0053, /* InSoft Inc. */ - WAVE_FORMAT_MPEGLAYER3 = 0x0055, /* MPEG 3 Layer 1 */ - WAVE_FORMAT_LUCENT_G723 = 0x0059, /* Lucent Technologies */ - WAVE_FORMAT_CIRRUS = 0x0060, /* Cirrus Logic */ - WAVE_FORMAT_ESPCM = 0x0061, /* ESS Technology */ - WAVE_FORMAT_VOXWARE = 0x0062, /* Voxware Inc */ - WAVE_FORMAT_CANOPUS_ATRAC = 0x0063, /* Canopus, Co., Ltd. */ - WAVE_FORMAT_G726_ADPCM = 0x0064, /* APICOM */ - WAVE_FORMAT_G722_ADPCM = 0x0065, /* APICOM */ - WAVE_FORMAT_DSAT = 0x0066, /* Microsoft Corporation */ - WAVE_FORMAT_DSAT_DISPLAY = 0x0067, /* Microsoft Corporation */ - WAVE_FORMAT_VOXWARE_BYTE_ALIGNED = 0x0069, /* Voxware Inc. */ - WAVE_FORMAT_VOXWARE_AC8 = 0x0070, /* Voxware Inc. */ - WAVE_FORMAT_VOXWARE_AC10 = 0x0071, /* Voxware Inc. */ - WAVE_FORMAT_VOXWARE_AC16 = 0x0072, /* Voxware Inc. */ - WAVE_FORMAT_VOXWARE_AC20 = 0x0073, /* Voxware Inc. */ - WAVE_FORMAT_VOXWARE_RT24 = 0x0074, /* Voxware Inc. */ - WAVE_FORMAT_VOXWARE_RT29 = 0x0075, /* Voxware Inc. */ - WAVE_FORMAT_VOXWARE_RT29HW = 0x0076, /* Voxware Inc. */ - WAVE_FORMAT_VOXWARE_VR12 = 0x0077, /* Voxware Inc. */ - WAVE_FORMAT_VOXWARE_VR18 = 0x0078, /* Voxware Inc. */ - WAVE_FORMAT_VOXWARE_TQ40 = 0x0079, /* Voxware Inc. */ - WAVE_FORMAT_SOFTSOUND = 0x0080, /* Softsound, Ltd. */ - WAVE_FORMAT_VOXARE_TQ60 = 0x0081, /* Voxware Inc. */ - WAVE_FORMAT_MSRT24 = 0x0082, /* Microsoft Corporation */ - WAVE_FORMAT_G729A = 0x0083, /* AT&T Laboratories */ - WAVE_FORMAT_MVI_MV12 = 0x0084, /* Motion Pixels */ - WAVE_FORMAT_DF_G726 = 0x0085, /* DataFusion Systems (Pty) (Ltd) */ - WAVE_FORMAT_DF_GSM610 = 0x0086, /* DataFusion Systems (Pty) (Ltd) */ - /* removed because duplicate */ - /* WAVE_FORMAT_ISIAUDIO = 0x0088, */ /* Iterated Systems, Inc. */ - WAVE_FORMAT_ONLIVE = 0x0089, /* OnLive! Technologies, Inc. */ - WAVE_FORMAT_SBC24 = 0x0091, /* Siemens Business Communications Systems */ - WAVE_FORMAT_DOLBY_AC3_SPDIF = 0x0092, /* Sonic Foundry */ - WAVE_FORMAT_ZYXEL_ADPCM = 0x0097, /* ZyXEL Communications, Inc. */ - WAVE_FORMAT_PHILIPS_LPCBB = 0x0098, /* Philips Speech Processing */ - WAVE_FORMAT_PACKED = 0x0099, /* Studer Professional Audio AG */ - WAVE_FORMAT_RHETOREX_ADPCM = 0x0100, /* Rhetorex, Inc. */ - - /* removed because of the following */ - /* WAVE_FORMAT_IRAT = 0x0101,*/ /* BeCubed Software Inc. */ - - /* these three are unofficial */ - IBM_FORMAT_MULAW = 0x0101, /* IBM mu-law format */ - IBM_FORMAT_ALAW = 0x0102, /* IBM a-law format */ - IBM_FORMAT_ADPCM = 0x0103, /* IBM AVC Adaptive Differential PCM format */ - - WAVE_FORMAT_VIVO_G723 = 0x0111, /* Vivo Software */ - WAVE_FORMAT_VIVO_SIREN = 0x0112, /* Vivo Software */ - WAVE_FORMAT_DIGITAL_G723 = 0x0123, /* Digital Equipment Corporation */ - WAVE_FORMAT_CREATIVE_ADPCM = 0x0200, /* Creative Labs, Inc */ - WAVE_FORMAT_CREATIVE_FASTSPEECH8 = 0x0202, /* Creative Labs, Inc */ - WAVE_FORMAT_CREATIVE_FASTSPEECH10 = 0x0203, /* Creative Labs, Inc */ - WAVE_FORMAT_QUARTERDECK = 0x0220, /* Quarterdeck Corporation */ - WAVE_FORMAT_FM_TOWNS_SND = 0x0300, /* Fujitsu Corporation */ - WAVE_FORMAT_BZV_DIGITAL = 0x0400, /* Brooktree Corporation */ - WAVE_FORMAT_VME_VMPCM = 0x0680, /* AT&T Labs, Inc. */ - WAVE_FORMAT_OLIGSM = 0x1000, /* Ing C. Olivetti & C., S.p.A. */ - WAVE_FORMAT_OLIADPCM = 0x1001, /* Ing C. Olivetti & C., S.p.A. */ - WAVE_FORMAT_OLICELP = 0x1002, /* Ing C. Olivetti & C., S.p.A. */ - WAVE_FORMAT_OLISBC = 0x1003, /* Ing C. Olivetti & C., S.p.A. */ - WAVE_FORMAT_OLIOPR = 0x1004, /* Ing C. Olivetti & C., S.p.A. */ - WAVE_FORMAT_LH_CODEC = 0x1100, /* Lernout & Hauspie */ - WAVE_FORMAT_NORRIS = 0x1400, /* Norris Communications, Inc. */ - /* removed because duplicate */ - /* WAVE_FORMAT_ISIAUDIO = 0x1401, */ /* AT&T Labs, Inc. */ - WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS = 0x1500, /* AT&T Labs, Inc. */ - WAVE_FORMAT_DVM = 0x2000, /* FAST Multimedia AG */ - WAVE_FORMAT_INTERWAV_VSC112 = 0x7150, /* ????? */ - - WAVE_FORMAT_IPP_ITU_G_723_1 = 0x7230, /* Intel Performance Primitives g723 codec. */ - - WAVE_FORMAT_EXTENSIBLE = 0xFFFE -} ; - -typedef struct -{ unsigned short format ; - unsigned short channels ; - unsigned int samplerate ; - unsigned int bytespersec ; - unsigned short blockalign ; - unsigned short bitwidth ; -} MIN_WAV_FMT ; - -typedef struct -{ unsigned short format ; - unsigned short channels ; - unsigned int samplerate ; - unsigned int bytespersec ; - unsigned short blockalign ; - unsigned short bitwidth ; - unsigned short extrabytes ; - unsigned short dummy ; -} WAV_FMT_SIZE20 ; - -typedef struct -{ unsigned short format ; - unsigned short channels ; - unsigned int samplerate ; - unsigned int bytespersec ; - unsigned short blockalign ; - unsigned short bitwidth ; - unsigned short extrabytes ; - unsigned short samplesperblock ; - unsigned short numcoeffs ; - struct - { short coeff1 ; - short coeff2 ; - } coeffs [7] ; -} MS_ADPCM_WAV_FMT ; - -typedef struct -{ unsigned short format ; - unsigned short channels ; - unsigned int samplerate ; - unsigned int bytespersec ; - unsigned short blockalign ; - unsigned short bitwidth ; - unsigned short extrabytes ; - unsigned short samplesperblock ; -} IMA_ADPCM_WAV_FMT ; - -typedef struct -{ unsigned short format ; - unsigned short channels ; - unsigned int samplerate ; - unsigned int bytespersec ; - unsigned short blockalign ; - unsigned short bitwidth ; - unsigned short extrabytes ; - unsigned short auxblocksize ; -} G72x_ADPCM_WAV_FMT ; - - -typedef struct -{ unsigned short format ; - unsigned short channels ; - unsigned int samplerate ; - unsigned int bytespersec ; - unsigned short blockalign ; - unsigned short bitwidth ; - unsigned short extrabytes ; - unsigned short samplesperblock ; -} GSM610_WAV_FMT ; - -typedef struct -{ unsigned int esf_field1 ; - unsigned short esf_field2 ; - unsigned short esf_field3 ; - char esf_field4 [8] ; -} EXT_SUBFORMAT ; - -typedef struct -{ unsigned short format ; - unsigned short channels ; - unsigned int samplerate ; - unsigned int bytespersec ; - unsigned short blockalign ; - unsigned short bitwidth ; - unsigned short extrabytes ; - unsigned short validbits ; - unsigned int channelmask ; - EXT_SUBFORMAT esf ; -} EXTENSIBLE_WAV_FMT ; - -typedef union -{ unsigned short format ; - MIN_WAV_FMT min ; - IMA_ADPCM_WAV_FMT ima ; - MS_ADPCM_WAV_FMT msadpcm ; - G72x_ADPCM_WAV_FMT g72x ; - EXTENSIBLE_WAV_FMT ext ; - GSM610_WAV_FMT gsm610 ; - WAV_FMT_SIZE20 size20 ; - char padding [512] ; -} WAV_FMT ; - -typedef struct -{ int frames ; -} FACT_CHUNK ; - -typedef struct -{ /* For ambisonic commands */ - int wavex_ambisonic ; - unsigned wavex_channelmask ; - - /* Set to true when 'fmt ' chunk is ambiguous.*/ - int fmt_is_broken ; - WAV_FMT wav_fmt ; -} WAV_PRIVATE ; - -#define WAV_W64_GSM610_BLOCKSIZE 65 -#define WAV_W64_GSM610_SAMPLES 320 - -/*------------------------------------------------------------------------------------ -** Functions defined in wav_ms_adpcm.c -*/ - -#define MSADPCM_ADAPT_COEFF_COUNT 7 - -void msadpcm_write_adapt_coeffs (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------------ -** Functions defined in wav_w64.c -*/ - -int wav_w64_srate2blocksize (int srate_chan_product) ; -char const* wav_w64_format_str (int k) ; -int wav_w64_read_fmt_chunk (SF_PRIVATE *psf, int fmtsize) ; -void wavex_write_guid (SF_PRIVATE *psf, const EXT_SUBFORMAT * subformat) ; -void wav_w64_analyze (SF_PRIVATE *psf) ; -int wavex_gen_channel_mask (const int *chan_map, int channels) ; - -int wav_read_bext_chunk (SF_PRIVATE *psf, unsigned int chunksize) ; -int wav_write_bext_chunk (SF_PRIVATE *psf) ; - -int wav_read_cart_chunk (SF_PRIVATE *psf, unsigned int chunksize) ; -int wav_write_cart_chunk (SF_PRIVATE *psf) ; - -#endif - diff --git a/libs/libsndfile/src/windows.c b/libs/libsndfile/src/windows.c deleted file mode 100644 index 387afddafe..0000000000 --- a/libs/libsndfile/src/windows.c +++ /dev/null @@ -1,93 +0,0 @@ -/* -** Copyright (C) 2009-2011 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** This needs to be a separate file so that we don't have to include -** elsewhere (too many symbol clashes). -*/ - - -#include "sfconfig.h" - -#if OS_IS_WIN32 -#include - -#define ENABLE_SNDFILE_WINDOWS_PROTOTYPES 1 -#include "sndfile.h" -#include "common.h" - -extern int sf_errno ; - -static void copy_filename (SF_PRIVATE * psf, LPCWSTR wpath) ; - -SNDFILE* -sf_wchar_open (LPCWSTR wpath, int mode, SF_INFO *sfinfo) -{ SF_PRIVATE *psf ; - char utf8name [512] ; - - if ((psf = calloc (1, sizeof (SF_PRIVATE))) == NULL) - { sf_errno = SFE_MALLOC_FAILED ; - return NULL ; - } ; - - memset (psf, 0, sizeof (SF_PRIVATE)) ; - psf_init_files (psf) ; - - if (WideCharToMultiByte (CP_UTF8, 0, wpath, -1, utf8name, sizeof (utf8name), NULL, NULL) == 0) - psf->file.path.wc [0] = 0 ; - - psf_log_printf (psf, "File : '%s' (utf-8 converted from ucs-2)\n", utf8name) ; - - copy_filename (psf, wpath) ; - psf->file.use_wchar = SF_TRUE ; - psf->file.mode = mode ; - - psf->error = psf_fopen (psf) ; - - return psf_open_file (psf, sfinfo) ; -} /* sf_wchar_open */ - - -static void -copy_filename (SF_PRIVATE *psf, LPCWSTR wpath) -{ const wchar_t *cwcptr ; - wchar_t *wcptr ; - - wcsncpy (psf->file.path.wc, wpath, ARRAY_LEN (psf->file.path.wc)) ; - psf->file.path.wc [ARRAY_LEN (psf->file.path.wc) - 1] = 0 ; - if ((cwcptr = wcsrchr (wpath, '/')) || (cwcptr = wcsrchr (wpath, '\\'))) - cwcptr ++ ; - else - cwcptr = wpath ; - - wcsncpy (psf->file.name.wc, cwcptr, ARRAY_LEN (psf->file.name.wc)) ; - psf->file.name.wc [ARRAY_LEN (psf->file.name.wc) - 1] = 0 ; - - /* Now grab the directory. */ - wcsncpy (psf->file.dir.wc, wpath, ARRAY_LEN (psf->file.dir.wc)) ; - psf->file.dir.wc [ARRAY_LEN (psf->file.dir.wc) - 1] = 0 ; - - if ((wcptr = wcsrchr (psf->file.dir.wc, '/')) || (wcptr = wcsrchr (psf->file.dir.wc, '\\'))) - wcptr [1] = 0 ; - else - psf->file.dir.wc [0] = 0 ; - - return ; -} /* copy_filename */ - -#endif diff --git a/libs/libsndfile/src/wve.c b/libs/libsndfile/src/wve.c deleted file mode 100644 index c13e7ab9b7..0000000000 --- a/libs/libsndfile/src/wve.c +++ /dev/null @@ -1,209 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** Copyright (C) 2007 Reuben Thomas -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -/*------------------------------------------------------------------------------ -** Macros to handle big/little endian issues, and other magic numbers. -*/ - -#define ALAW_MARKER MAKE_MARKER ('A', 'L', 'a', 'w') -#define SOUN_MARKER MAKE_MARKER ('S', 'o', 'u', 'n') -#define DFIL_MARKER MAKE_MARKER ('d', 'F', 'i', 'l') -#define ESSN_MARKER MAKE_MARKER ('e', '*', '*', '\0') -#define PSION_VERSION ((unsigned short) 3856) -#define PSION_DATAOFFSET 0x20 - -/*------------------------------------------------------------------------------ -** Private static functions. -*/ - -static int wve_read_header (SF_PRIVATE *psf) ; -static int wve_write_header (SF_PRIVATE *psf, int calc_length) ; -static int wve_close (SF_PRIVATE *psf) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -wve_open (SF_PRIVATE *psf) -{ int error = 0 ; - - if (psf->is_pipe) - return SFE_WVE_NO_PIPE ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = wve_read_header (psf))) - return error ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_WVE) - return SFE_BAD_OPEN_FORMAT ; - - psf->endian = SF_ENDIAN_BIG ; - - if ((error = wve_write_header (psf, SF_FALSE))) - return error ; - - psf->write_header = wve_write_header ; - } ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - psf->container_close = wve_close ; - - error = alaw_init (psf) ; - - return error ; -} /* wve_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -wve_read_header (SF_PRIVATE *psf) -{ int marker ; - unsigned short version, padding, repeats, trash ; - unsigned datalength ; - - /* Set position to start of file to begin reading header. */ - psf_binheader_readf (psf, "pm", 0, &marker) ; - if (marker != ALAW_MARKER) - { psf_log_printf (psf, "Could not find '%M'\n", ALAW_MARKER) ; - return SFE_WVE_NOT_WVE ; - } ; - - psf_binheader_readf (psf, "m", &marker) ; - if (marker != SOUN_MARKER) - { psf_log_printf (psf, "Could not find '%M'\n", SOUN_MARKER) ; - return SFE_WVE_NOT_WVE ; - } ; - - psf_binheader_readf (psf, "m", &marker) ; - if (marker != DFIL_MARKER) - { psf_log_printf (psf, "Could not find '%M'\n", DFIL_MARKER) ; - return SFE_WVE_NOT_WVE ; - } ; - - psf_binheader_readf (psf, "m", &marker) ; - if (marker != ESSN_MARKER) - { psf_log_printf (psf, "Could not find '%M'\n", ESSN_MARKER) ; - return SFE_WVE_NOT_WVE ; - } ; - - psf_binheader_readf (psf, "E2", &version) ; - - psf_log_printf (psf, "Psion Palmtop Alaw (.wve)\n" - " Sample Rate : 8000\n" - " Channels : 1\n" - " Encoding : A-law\n") ; - - if (version != PSION_VERSION) - psf_log_printf (psf, "Psion version %d should be %d\n", version, PSION_VERSION) ; - - psf_binheader_readf (psf, "E4", &datalength) ; - psf->dataoffset = PSION_DATAOFFSET ; - if (datalength != psf->filelength - psf->dataoffset) - { psf->datalength = psf->filelength - psf->dataoffset ; - psf_log_printf (psf, "Data length %d should be %D\n", datalength, psf->datalength) ; - } - else - psf->datalength = datalength ; - - psf_binheader_readf (psf, "E22222", &padding, &repeats, &trash, &trash, &trash) ; - - psf->sf.format = SF_FORMAT_WVE | SF_FORMAT_ALAW ; - psf->sf.samplerate = 8000 ; - psf->sf.frames = psf->datalength ; - psf->sf.channels = 1 ; - - return SFE_NO_ERROR ; -} /* wve_read_header */ - -/*------------------------------------------------------------------------------ -*/ - -static int -wve_write_header (SF_PRIVATE *psf, int calc_length) -{ sf_count_t current ; - unsigned datalen ; - - current = psf_ftell (psf) ; - - if (calc_length) - { psf->filelength = psf_get_filelen (psf) ; - - psf->datalength = psf->filelength - psf->dataoffset ; - if (psf->dataend) - psf->datalength -= psf->filelength - psf->dataend ; - - psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ; - } ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - /* Write header. */ - datalen = psf->datalength ; - psf_binheader_writef (psf, "Emmmm", ALAW_MARKER, SOUN_MARKER, DFIL_MARKER, ESSN_MARKER) ; - psf_binheader_writef (psf, "E2422222", PSION_VERSION, datalen, 0, 0, 0, 0, 0) ; - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->sf.channels != 1) - return SFE_CHANNEL_COUNT ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* wve_write_header */ - -/*------------------------------------------------------------------------------ -*/ - -static int -wve_close (SF_PRIVATE *psf) -{ - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { /* Now we know for certain the length of the file we can re-write - ** the header. - */ - wve_write_header (psf, SF_TRUE) ; - } ; - - return 0 ; -} /* wve_close */ diff --git a/libs/libsndfile/src/xi.c b/libs/libsndfile/src/xi.c deleted file mode 100644 index fc442d1c3a..0000000000 --- a/libs/libsndfile/src/xi.c +++ /dev/null @@ -1,1230 +0,0 @@ -/* -** Copyright (C) 2003-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#include "sndfile.h" -#include "sfendian.h" -#include "common.h" - -#define MAX_XI_SAMPLES 16 - -/*------------------------------------------------------------------------------ -** Private static functions and tyepdefs. -*/ - -typedef struct -{ /* Warning, this filename is NOT nul terminated. */ - char filename [22] ; - char software [20] ; - char sample_name [22] ; - - int loop_begin, loop_end ; - int sample_flags ; - - /* Data for encoder and decoder. */ - short last_16 ; -} XI_PRIVATE ; - -static int xi_close (SF_PRIVATE *psf) ; -static int xi_write_header (SF_PRIVATE *psf, int calc_length) ; -static int xi_read_header (SF_PRIVATE *psf) ; -static int dpcm_init (SF_PRIVATE *psf) ; - - -static sf_count_t dpcm_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) ; - -/*------------------------------------------------------------------------------ -** Public function. -*/ - -int -xi_open (SF_PRIVATE *psf) -{ XI_PRIVATE *pxi ; - int subformat, error = 0 ; - - if (psf->is_pipe) - return SFE_XI_NO_PIPE ; - - if (psf->codec_data) - pxi = psf->codec_data ; - else if ((pxi = calloc (1, sizeof (XI_PRIVATE))) == NULL) - return SFE_MALLOC_FAILED ; - - psf->codec_data = pxi ; - - if (psf->file.mode == SFM_READ || (psf->file.mode == SFM_RDWR && psf->filelength > 0)) - { if ((error = xi_read_header (psf))) - return error ; - } ; - - subformat = SF_CODEC (psf->sf.format) ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { if ((SF_CONTAINER (psf->sf.format)) != SF_FORMAT_XI) - return SFE_BAD_OPEN_FORMAT ; - - psf->endian = SF_ENDIAN_LITTLE ; - psf->sf.channels = 1 ; /* Always mono */ - psf->sf.samplerate = 44100 ; /* Always */ - - /* Set up default instrument and software name. */ - memcpy (pxi->filename, "Default Name ", sizeof (pxi->filename)) ; - memcpy (pxi->software, PACKAGE "-" VERSION " ", sizeof (pxi->software)) ; - - memset (pxi->sample_name, 0, sizeof (pxi->sample_name)) ; - snprintf (pxi->sample_name, sizeof (pxi->sample_name), "%s", "Sample #1") ; - - pxi->sample_flags = (subformat == SF_FORMAT_DPCM_16) ? 16 : 0 ; - - if (xi_write_header (psf, SF_FALSE)) - return psf->error ; - - psf->write_header = xi_write_header ; - } ; - - psf->container_close = xi_close ; - psf->seek = dpcm_seek ; - - psf->sf.seekable = SF_FALSE ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - switch (subformat) - { case SF_FORMAT_DPCM_8 : /* 8-bit differential PCM. */ - case SF_FORMAT_DPCM_16 : /* 16-bit differential PCM. */ - error = dpcm_init (psf) ; - break ; - - default : break ; - } ; - - return error ; -} /* xi_open */ - -/*------------------------------------------------------------------------------ -*/ - -static int -xi_close (SF_PRIVATE * UNUSED (psf)) -{ - return 0 ; -} /* xi_close */ - -/*============================================================================== -*/ - -static sf_count_t dpcm_read_dsc2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t dpcm_read_dsc2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t dpcm_read_dsc2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t dpcm_read_dsc2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t dpcm_write_s2dsc (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t dpcm_write_i2dsc (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t dpcm_write_f2dsc (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t dpcm_write_d2dsc (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static sf_count_t dpcm_read_dles2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) ; -static sf_count_t dpcm_read_dles2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) ; -static sf_count_t dpcm_read_dles2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) ; -static sf_count_t dpcm_read_dles2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) ; - -static sf_count_t dpcm_write_s2dles (SF_PRIVATE *psf, const short *ptr, sf_count_t len) ; -static sf_count_t dpcm_write_i2dles (SF_PRIVATE *psf, const int *ptr, sf_count_t len) ; -static sf_count_t dpcm_write_f2dles (SF_PRIVATE *psf, const float *ptr, sf_count_t len) ; -static sf_count_t dpcm_write_d2dles (SF_PRIVATE *psf, const double *ptr, sf_count_t len) ; - -static int -dpcm_init (SF_PRIVATE *psf) -{ if (psf->bytewidth == 0 || psf->sf.channels == 0) - return SFE_INTERNAL ; - - psf->blockwidth = psf->bytewidth * psf->sf.channels ; - - if (psf->file.mode == SFM_READ || psf->file.mode == SFM_RDWR) - { switch (psf->bytewidth) - { case 1 : - psf->read_short = dpcm_read_dsc2s ; - psf->read_int = dpcm_read_dsc2i ; - psf->read_float = dpcm_read_dsc2f ; - psf->read_double = dpcm_read_dsc2d ; - break ; - case 2 : - psf->read_short = dpcm_read_dles2s ; - psf->read_int = dpcm_read_dles2i ; - psf->read_float = dpcm_read_dles2f ; - psf->read_double = dpcm_read_dles2d ; - break ; - default : - psf_log_printf (psf, "dpcm_init() returning SFE_UNIMPLEMENTED\n") ; - return SFE_UNIMPLEMENTED ; - } ; - } ; - - if (psf->file.mode == SFM_WRITE || psf->file.mode == SFM_RDWR) - { switch (psf->bytewidth) - { case 1 : - psf->write_short = dpcm_write_s2dsc ; - psf->write_int = dpcm_write_i2dsc ; - psf->write_float = dpcm_write_f2dsc ; - psf->write_double = dpcm_write_d2dsc ; - break ; - case 2 : - psf->write_short = dpcm_write_s2dles ; - psf->write_int = dpcm_write_i2dles ; - psf->write_float = dpcm_write_f2dles ; - psf->write_double = dpcm_write_d2dles ; - break ; - default : - psf_log_printf (psf, "dpcm_init() returning SFE_UNIMPLEMENTED\n") ; - return SFE_UNIMPLEMENTED ; - } ; - } ; - - psf->filelength = psf_get_filelen (psf) ; - psf->datalength = (psf->dataend) ? psf->dataend - psf->dataoffset : - psf->filelength - psf->dataoffset ; - psf->sf.frames = psf->datalength / psf->blockwidth ; - - return 0 ; -} /* dpcm_init */ - -/*============================================================================== -*/ - -static sf_count_t -dpcm_seek (SF_PRIVATE *psf, int mode, sf_count_t offset) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int total, bufferlen, len ; - - if ((pxi = psf->codec_data) == NULL) - return SFE_INTERNAL ; - - if (psf->datalength < 0 || psf->dataoffset < 0) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - if (offset == 0) - { psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - pxi->last_16 = 0 ; - return 0 ; - } ; - - if (offset < 0 || offset > psf->sf.frames) - { psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - if (mode != SFM_READ) - { /* What to do about write??? */ - psf->error = SFE_BAD_SEEK ; - return PSF_SEEK_ERROR ; - } ; - - psf_fseek (psf, psf->dataoffset, SEEK_SET) ; - - if ((SF_CODEC (psf->sf.format)) == SF_FORMAT_DPCM_16) - { total = offset ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (total > 0) - { len = (total > bufferlen) ? bufferlen : total ; - total -= dpcm_read_dles2s (psf, ubuf.sbuf, len) ; - } ; - } - else - { total = offset ; - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - while (total > 0) - { len = (total > bufferlen) ? bufferlen : total ; - total -= dpcm_read_dsc2s (psf, ubuf.sbuf, len) ; - } ; - } ; - - return offset ; -} /* dpcm_seek */ - - -static int -xi_write_header (SF_PRIVATE *psf, int UNUSED (calc_length)) -{ XI_PRIVATE *pxi ; - sf_count_t current ; - const char *string ; - - if ((pxi = psf->codec_data) == NULL) - return SFE_INTERNAL ; - - current = psf_ftell (psf) ; - - /* Reset the current header length to zero. */ - psf->header [0] = 0 ; - psf->headindex = 0 ; - psf_fseek (psf, 0, SEEK_SET) ; - - string = "Extended Instrument: " ; - psf_binheader_writef (psf, "b", string, strlen (string)) ; - psf_binheader_writef (psf, "b1", pxi->filename, sizeof (pxi->filename), 0x1A) ; - - /* Write software version and two byte XI version. */ - psf_binheader_writef (psf, "eb2", pxi->software, sizeof (pxi->software), (1 << 8) + 2) ; - - /* - ** Jump note numbers (96), volume envelope (48), pan envelope (48), - ** volume points (1), pan points (1) - */ - psf_binheader_writef (psf, "z", (size_t) (96 + 48 + 48 + 1 + 1)) ; - - /* Jump volume loop (3 bytes), pan loop (3), envelope flags (3), vibrato (3) - ** fade out (2), 22 unknown bytes, and then write sample_count (2 bytes). - */ - psf_binheader_writef (psf, "ez2z2", (size_t) (4 * 3), 0x1234, make_size_t (22), 1) ; - - pxi->loop_begin = 0 ; - pxi->loop_end = 0 ; - - psf_binheader_writef (psf, "et844", psf->sf.frames, pxi->loop_begin, pxi->loop_end) ; - - /* volume, fine tune, flags, pan, note, namelen */ - psf_binheader_writef (psf, "111111", 128, 0, pxi->sample_flags, 128, 0, strlen (pxi->sample_name)) ; - - psf_binheader_writef (psf, "b", pxi->sample_name, sizeof (pxi->sample_name)) ; - - - - - - /* Header construction complete so write it out. */ - psf_fwrite (psf->header, psf->headindex, 1, psf) ; - - if (psf->error) - return psf->error ; - - psf->dataoffset = psf->headindex ; - - if (current > 0) - psf_fseek (psf, current, SEEK_SET) ; - - return psf->error ; -} /* xi_write_header */ - -static int -xi_read_header (SF_PRIVATE *psf) -{ char buffer [64], name [32] ; - short version, fade_out, sample_count ; - int k, loop_begin, loop_end ; - int sample_sizes [MAX_XI_SAMPLES] ; - - psf_binheader_readf (psf, "pb", 0, buffer, 21) ; - - memset (sample_sizes, 0, sizeof (sample_sizes)) ; - - buffer [20] = 0 ; - if (strcmp (buffer, "Extended Instrument:") != 0) - return SFE_XI_BAD_HEADER ; - - memset (buffer, 0, sizeof (buffer)) ; - psf_binheader_readf (psf, "b", buffer, 23) ; - - if (buffer [22] != 0x1A) - return SFE_XI_BAD_HEADER ; - - buffer [22] = 0 ; - for (k = 21 ; k >= 0 && buffer [k] == ' ' ; k --) - buffer [k] = 0 ; - - psf_log_printf (psf, "Extended Instrument : %s\n", buffer) ; - psf_store_string (psf, SF_STR_TITLE, buffer) ; - - psf_binheader_readf (psf, "be2", buffer, 20, &version) ; - buffer [19] = 0 ; - for (k = 18 ; k >= 0 && buffer [k] == ' ' ; k --) - buffer [k] = 0 ; - - psf_log_printf (psf, "Software : %s\nVersion : %d.%02d\n", buffer, version / 256, version % 256) ; - psf_store_string (psf, SF_STR_SOFTWARE, buffer) ; - - /* Jump note numbers (96), volume envelope (48), pan envelope (48), - ** volume points (1), pan points (1) - */ - psf_binheader_readf (psf, "j", 96 + 48 + 48 + 1 + 1) ; - - psf_binheader_readf (psf, "b", buffer, 12) ; - psf_log_printf (psf, "Volume Loop\n sustain : %u\n begin : %u\n end : %u\n", - buffer [0], buffer [1], buffer [2]) ; - psf_log_printf (psf, "Pan Loop\n sustain : %u\n begin : %u\n end : %u\n", - buffer [3], buffer [4], buffer [5]) ; - psf_log_printf (psf, "Envelope Flags\n volume : 0x%X\n pan : 0x%X\n", - buffer [6] & 0xFF, buffer [7] & 0xFF) ; - - psf_log_printf (psf, "Vibrato\n type : %u\n sweep : %u\n depth : %u\n rate : %u\n", - buffer [8], buffer [9], buffer [10], buffer [11]) ; - - /* - ** Read fade_out then jump reserved (2 bytes) and ???? (20 bytes) and - ** sample_count. - */ - psf_binheader_readf (psf, "e2j2", &fade_out, 2 + 20, &sample_count) ; - psf_log_printf (psf, "Fade out : %d\n", fade_out) ; - - /* XI file can contain up to 16 samples. */ - if (sample_count > MAX_XI_SAMPLES) - return SFE_XI_EXCESS_SAMPLES ; - - if (psf->instrument == NULL && (psf->instrument = psf_instrument_alloc ()) == NULL) - return SFE_MALLOC_FAILED ; - - psf->instrument->basenote = 0 ; - /* Log all data for each sample. */ - for (k = 0 ; k < sample_count ; k++) - { psf_binheader_readf (psf, "e444", &(sample_sizes [k]), &loop_begin, &loop_end) ; - - /* Read 5 know bytes, 1 unknown byte and 22 name bytes. */ - psf_binheader_readf (psf, "bb", buffer, 6, name, 22) ; - name [21] = 0 ; - - psf_log_printf (psf, "Sample #%d\n name : %s\n", k + 1, name) ; - - psf_log_printf (psf, " size : %d\n", sample_sizes [k]) ; - - - - psf_log_printf (psf, " loop\n begin : %d\n end : %d\n", loop_begin, loop_end) ; - - psf_log_printf (psf, " volume : %u\n f. tune : %d\n flags : 0x%02X ", - buffer [0] & 0xFF, buffer [1] & 0xFF, buffer [2] & 0xFF) ; - - psf_log_printf (psf, " (") ; - if (buffer [2] & 1) - psf_log_printf (psf, " Loop") ; - if (buffer [2] & 2) - psf_log_printf (psf, " PingPong") ; - psf_log_printf (psf, (buffer [2] & 16) ? " 16bit" : " 8bit") ; - psf_log_printf (psf, " )\n") ; - - psf_log_printf (psf, " pan : %u\n note : %d\n namelen : %d\n", - buffer [3] & 0xFF, buffer [4], buffer [5]) ; - - psf->instrument->basenote = buffer [4] ; - if (buffer [2] & 1) - { psf->instrument->loop_count = 1 ; - psf->instrument->loops [0].mode = (buffer [2] & 2) ? SF_LOOP_ALTERNATING : SF_LOOP_FORWARD ; - psf->instrument->loops [0].start = loop_begin ; - psf->instrument->loops [0].end = loop_end ; - } ; - - if (k != 0) - continue ; - - if (buffer [2] & 16) - { psf->sf.format = SF_FORMAT_XI | SF_FORMAT_DPCM_16 ; - psf->bytewidth = 2 ; - } - else - { psf->sf.format = SF_FORMAT_XI | SF_FORMAT_DPCM_8 ; - psf->bytewidth = 1 ; - } ; - } ; - - while (sample_count > 1 && sample_sizes [sample_count - 1] == 0) - sample_count -- ; - - /* Currently, we can only handle 1 sample per file. */ - - if (sample_count > 2) - { psf_log_printf (psf, "*** Sample count is less than 16 but more than 1.\n") ; - psf_log_printf (psf, " sample count : %d sample_sizes [%d] : %d\n", - sample_count, sample_count - 1, sample_sizes [sample_count - 1]) ; - return SFE_XI_EXCESS_SAMPLES ; - } ; - - psf->datalength = sample_sizes [0] ; - - psf->dataoffset = psf_ftell (psf) ; - if (psf->dataoffset < 0) - { psf_log_printf (psf, "*** Bad Data Offset : %D\n", psf->dataoffset) ; - return SFE_BAD_OFFSET ; - } ; - psf_log_printf (psf, "Data Offset : %D\n", psf->dataoffset) ; - - if (psf->dataoffset + psf->datalength > psf->filelength) - { psf_log_printf (psf, "*** File seems to be truncated. Should be at least %D bytes long.\n", - psf->dataoffset + sample_sizes [0]) ; - psf->datalength = psf->filelength - psf->dataoffset ; - } ; - - if (psf_fseek (psf, psf->dataoffset, SEEK_SET) != psf->dataoffset) - return SFE_BAD_SEEK ; - - psf->endian = SF_ENDIAN_LITTLE ; - psf->sf.channels = 1 ; /* Always mono */ - psf->sf.samplerate = 44100 ; /* Always */ - - psf->blockwidth = psf->sf.channels * psf->bytewidth ; - - if (! psf->sf.frames && psf->blockwidth) - psf->sf.frames = (psf->filelength - psf->dataoffset) / psf->blockwidth ; - - psf->instrument->gain = 1 ; - psf->instrument->velocity_lo = psf->instrument->key_lo = 0 ; - psf->instrument->velocity_hi = psf->instrument->key_hi = 127 ; - - return 0 ; -} /* xi_read_header */ - -/*============================================================================== -*/ - -static void dsc2s_array (XI_PRIVATE *pxi, signed char *src, int count, short *dest) ; -static void dsc2i_array (XI_PRIVATE *pxi, signed char *src, int count, int *dest) ; -static void dsc2f_array (XI_PRIVATE *pxi, signed char *src, int count, float *dest, float normfact) ; -static void dsc2d_array (XI_PRIVATE *pxi, signed char *src, int count, double *dest, double normfact) ; - -static void dles2s_array (XI_PRIVATE *pxi, short *src, int count, short *dest) ; -static void dles2i_array (XI_PRIVATE *pxi, short *src, int count, int *dest) ; -static void dles2f_array (XI_PRIVATE *pxi, short *src, int count, float *dest, float normfact) ; -static void dles2d_array (XI_PRIVATE *pxi, short *src, int count, double *dest, double normfact) ; - -static sf_count_t -dpcm_read_dsc2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - dsc2s_array (pxi, ubuf.scbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* dpcm_read_dsc2s */ - -static sf_count_t -dpcm_read_dsc2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - dsc2i_array (pxi, ubuf.scbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* dpcm_read_dsc2i */ - -static sf_count_t -dpcm_read_dsc2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x80) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - dsc2f_array (pxi, ubuf.scbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* dpcm_read_dsc2f */ - -static sf_count_t -dpcm_read_dsc2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x80) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - dsc2d_array (pxi, ubuf.scbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* dpcm_read_dsc2d */ - -/*------------------------------------------------------------------------------ -*/ - -static sf_count_t -dpcm_read_dles2s (SF_PRIVATE *psf, short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - dles2s_array (pxi, ubuf.sbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* dpcm_read_dles2s */ - -static sf_count_t -dpcm_read_dles2i (SF_PRIVATE *psf, int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - dles2i_array (pxi, ubuf.sbuf, readcount, ptr + total) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* dpcm_read_dles2i */ - -static sf_count_t -dpcm_read_dles2f (SF_PRIVATE *psf, float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - float normfact ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - normfact = (psf->norm_float == SF_TRUE) ? 1.0 / ((float) 0x8000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - dles2f_array (pxi, ubuf.sbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* dpcm_read_dles2f */ - -static sf_count_t -dpcm_read_dles2d (SF_PRIVATE *psf, double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, readcount ; - sf_count_t total = 0 ; - double normfact ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - normfact = (psf->norm_double == SF_TRUE) ? 1.0 / ((double) 0x8000) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - readcount = psf_fread (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - dles2d_array (pxi, ubuf.sbuf, readcount, ptr + total, normfact) ; - total += readcount ; - if (readcount < bufferlen) - break ; - len -= readcount ; - } ; - - return total ; -} /* dpcm_read_dles2d */ - -/*============================================================================== -*/ - -static void s2dsc_array (XI_PRIVATE *pxi, const short *src, signed char *dest, int count) ; -static void i2dsc_array (XI_PRIVATE *pxi, const int *src, signed char *dest, int count) ; -static void f2dsc_array (XI_PRIVATE *pxi, const float *src, signed char *dest, int count, float normfact) ; -static void d2dsc_array (XI_PRIVATE *pxi, const double *src, signed char *dest, int count, double normfact) ; - -static void s2dles_array (XI_PRIVATE *pxi, const short *src, short *dest, int count) ; -static void i2dles_array (XI_PRIVATE *pxi, const int *src, short *dest, int count) ; -static void f2dles_array (XI_PRIVATE *pxi, const float *src, short *dest, int count, float normfact) ; -static void d2dles_array (XI_PRIVATE *pxi, const double *src, short *dest, int count, double normfact) ; - - -static sf_count_t -dpcm_write_s2dsc (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2dsc_array (pxi, ptr + total, ubuf.scbuf, bufferlen) ; - writecount = psf_fwrite (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* dpcm_write_s2dsc */ - -static sf_count_t -dpcm_write_i2dsc (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2dsc_array (pxi, ptr + total, ubuf.scbuf, bufferlen) ; - writecount = psf_fwrite (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* dpcm_write_i2dsc */ - -static sf_count_t -dpcm_write_f2dsc (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - float normfact ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - normfact = (psf->norm_float == SF_TRUE) ? (1.0 * 0x7F) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - f2dsc_array (pxi, ptr + total, ubuf.scbuf, bufferlen, normfact) ; - writecount = psf_fwrite (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* dpcm_write_f2dsc */ - -static sf_count_t -dpcm_write_d2dsc (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - double normfact ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - normfact = (psf->norm_double == SF_TRUE) ? (1.0 * 0x7F) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.ucbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - d2dsc_array (pxi, ptr + total, ubuf.scbuf, bufferlen, normfact) ; - writecount = psf_fwrite (ubuf.scbuf, sizeof (signed char), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* dpcm_write_d2dsc */ - - -static sf_count_t -dpcm_write_s2dles (SF_PRIVATE *psf, const short *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - s2dles_array (pxi, ptr + total, ubuf.sbuf, bufferlen) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* dpcm_write_s2dles */ - -static sf_count_t -dpcm_write_i2dles (SF_PRIVATE *psf, const int *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - i2dles_array (pxi, ptr + total, ubuf.sbuf, bufferlen) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* dpcm_write_i2dles */ - -static sf_count_t -dpcm_write_f2dles (SF_PRIVATE *psf, const float *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - float normfact ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - normfact = (psf->norm_float == SF_TRUE) ? (1.0 * 0x7FFF) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - f2dles_array (pxi, ptr + total, ubuf.sbuf, bufferlen, normfact) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* dpcm_write_f2dles */ - -static sf_count_t -dpcm_write_d2dles (SF_PRIVATE *psf, const double *ptr, sf_count_t len) -{ BUF_UNION ubuf ; - XI_PRIVATE *pxi ; - int bufferlen, writecount ; - sf_count_t total = 0 ; - double normfact ; - - if ((pxi = psf->codec_data) == NULL) - return 0 ; - - normfact = (psf->norm_double == SF_TRUE) ? (1.0 * 0x7FFF) : 1.0 ; - - bufferlen = ARRAY_LEN (ubuf.sbuf) ; - - while (len > 0) - { if (len < bufferlen) - bufferlen = (int) len ; - d2dles_array (pxi, ptr + total, ubuf.sbuf, bufferlen, normfact) ; - writecount = psf_fwrite (ubuf.sbuf, sizeof (short), bufferlen, psf) ; - total += writecount ; - if (writecount < bufferlen) - break ; - len -= writecount ; - } ; - - return total ; -} /* dpcm_write_d2dles */ - - -/*============================================================================== -*/ - -static void -dsc2s_array (XI_PRIVATE *pxi, signed char *src, int count, short *dest) -{ signed char last_val ; - int k ; - - last_val = pxi->last_16 >> 8 ; - - for (k = 0 ; k < count ; k++) - { last_val += src [k] ; - dest [k] = last_val << 8 ; - } ; - - pxi->last_16 = last_val << 8 ; -} /* dsc2s_array */ - -static void -dsc2i_array (XI_PRIVATE *pxi, signed char *src, int count, int *dest) -{ signed char last_val ; - int k ; - - last_val = pxi->last_16 >> 8 ; - - for (k = 0 ; k < count ; k++) - { last_val += src [k] ; - dest [k] = last_val << 24 ; - } ; - - pxi->last_16 = last_val << 8 ; -} /* dsc2i_array */ - -static void -dsc2f_array (XI_PRIVATE *pxi, signed char *src, int count, float *dest, float normfact) -{ signed char last_val ; - int k ; - - last_val = pxi->last_16 >> 8 ; - - for (k = 0 ; k < count ; k++) - { last_val += src [k] ; - dest [k] = last_val * normfact ; - } ; - - pxi->last_16 = last_val << 8 ; -} /* dsc2f_array */ - -static void -dsc2d_array (XI_PRIVATE *pxi, signed char *src, int count, double *dest, double normfact) -{ signed char last_val ; - int k ; - - last_val = pxi->last_16 >> 8 ; - - for (k = 0 ; k < count ; k++) - { last_val += src [k] ; - dest [k] = last_val * normfact ; - } ; - - pxi->last_16 = last_val << 8 ; -} /* dsc2d_array */ - -/*------------------------------------------------------------------------------ -*/ - -static void -s2dsc_array (XI_PRIVATE *pxi, const short *src, signed char *dest, int count) -{ signed char last_val, current ; - int k ; - - last_val = pxi->last_16 >> 8 ; - - for (k = 0 ; k < count ; k++) - { current = src [k] >> 8 ; - dest [k] = current - last_val ; - last_val = current ; - } ; - - pxi->last_16 = last_val << 8 ; -} /* s2dsc_array */ - -static void -i2dsc_array (XI_PRIVATE *pxi, const int *src, signed char *dest, int count) -{ signed char last_val, current ; - int k ; - - last_val = pxi->last_16 >> 8 ; - - for (k = 0 ; k < count ; k++) - { current = src [k] >> 24 ; - dest [k] = current - last_val ; - last_val = current ; - } ; - - pxi->last_16 = last_val << 8 ; -} /* i2dsc_array */ - -static void -f2dsc_array (XI_PRIVATE *pxi, const float *src, signed char *dest, int count, float normfact) -{ signed char last_val, current ; - int k ; - - last_val = pxi->last_16 >> 8 ; - - for (k = 0 ; k < count ; k++) - { current = lrintf (src [k] * normfact) ; - dest [k] = current - last_val ; - last_val = current ; - } ; - - pxi->last_16 = last_val << 8 ; -} /* f2dsc_array */ - -static void -d2dsc_array (XI_PRIVATE *pxi, const double *src, signed char *dest, int count, double normfact) -{ signed char last_val, current ; - int k ; - - last_val = pxi->last_16 >> 8 ; - - for (k = 0 ; k < count ; k++) - { current = lrint (src [k] * normfact) ; - dest [k] = current - last_val ; - last_val = current ; - } ; - - pxi->last_16 = last_val << 8 ; -} /* d2dsc_array */ - -/*============================================================================== -*/ - -static void -dles2s_array (XI_PRIVATE *pxi, short *src, int count, short *dest) -{ short last_val ; - int k ; - - last_val = pxi->last_16 ; - - for (k = 0 ; k < count ; k++) - { last_val += LE2H_16 (src [k]) ; - dest [k] = last_val ; - } ; - - pxi->last_16 = last_val ; -} /* dles2s_array */ - -static void -dles2i_array (XI_PRIVATE *pxi, short *src, int count, int *dest) -{ short last_val ; - int k ; - - last_val = pxi->last_16 ; - - for (k = 0 ; k < count ; k++) - { last_val += LE2H_16 (src [k]) ; - dest [k] = last_val << 16 ; - } ; - - pxi->last_16 = last_val ; -} /* dles2i_array */ - -static void -dles2f_array (XI_PRIVATE *pxi, short *src, int count, float *dest, float normfact) -{ short last_val ; - int k ; - - last_val = pxi->last_16 ; - - for (k = 0 ; k < count ; k++) - { last_val += LE2H_16 (src [k]) ; - dest [k] = last_val * normfact ; - } ; - - pxi->last_16 = last_val ; -} /* dles2f_array */ - -static void -dles2d_array (XI_PRIVATE *pxi, short *src, int count, double *dest, double normfact) -{ short last_val ; - int k ; - - last_val = pxi->last_16 ; - - for (k = 0 ; k < count ; k++) - { last_val += LE2H_16 (src [k]) ; - dest [k] = last_val * normfact ; - } ; - - pxi->last_16 = last_val ; -} /* dles2d_array */ - -/*------------------------------------------------------------------------------ -*/ - -static void -s2dles_array (XI_PRIVATE *pxi, const short *src, short *dest, int count) -{ short diff, last_val ; - int k ; - - last_val = pxi->last_16 ; - - for (k = 0 ; k < count ; k++) - { diff = src [k] - last_val ; - dest [k] = LE2H_16 (diff) ; - last_val = src [k] ; - } ; - - pxi->last_16 = last_val ; -} /* s2dles_array */ - -static void -i2dles_array (XI_PRIVATE *pxi, const int *src, short *dest, int count) -{ short diff, last_val ; - int k ; - - last_val = pxi->last_16 ; - - for (k = 0 ; k < count ; k++) - { diff = (src [k] >> 16) - last_val ; - dest [k] = LE2H_16 (diff) ; - last_val = src [k] >> 16 ; - } ; - - pxi->last_16 = last_val ; -} /* i2dles_array */ - -static void -f2dles_array (XI_PRIVATE *pxi, const float *src, short *dest, int count, float normfact) -{ short diff, last_val, current ; - int k ; - - last_val = pxi->last_16 ; - - for (k = 0 ; k < count ; k++) - { current = lrintf (src [k] * normfact) ; - diff = current - last_val ; - dest [k] = LE2H_16 (diff) ; - last_val = current ; - } ; - - pxi->last_16 = last_val ; -} /* f2dles_array */ - -static void -d2dles_array (XI_PRIVATE *pxi, const double *src, short *dest, int count, double normfact) -{ short diff, last_val, current ; - int k ; - - last_val = pxi->last_16 ; - - for (k = 0 ; k < count ; k++) - { current = lrint (src [k] * normfact) ; - diff = current - last_val ; - dest [k] = LE2H_16 (diff) ; - last_val = current ; - } ; - - pxi->last_16 = last_val ; -} /* d2dles_array */ - diff --git a/libs/libsndfile/tests/Makefile.am b/libs/libsndfile/tests/Makefile.am deleted file mode 100644 index 089046bb81..0000000000 --- a/libs/libsndfile/tests/Makefile.am +++ /dev/null @@ -1,218 +0,0 @@ -## Process this file with automake to produce Makefile.in - -if ENABLE_TEST_COVERAGE -CPP_TEST = -else -CPP_TEST = cpp_test -endif - -AM_CPPFLAGS = -I$(top_srcdir)/src - -check_PROGRAMS = sfversion floating_point_test write_read_test \ - lossy_comp_test error_test ulaw_test alaw_test dwvw_test \ - peak_chunk_test command_test stdin_test stdout_test stdio_test \ - pcm_test headerless_test pipe_test benchmark header_test misc_test \ - raw_test string_test multi_file_test dither_test chunk_test \ - scale_clip_test win32_test fix_this aiff_rw_test virtual_io_test \ - locale_test largefile_test win32_ordinal_test ogg_test compression_size_test \ - checksum_test external_libs_test rdwr_test format_check_test $(CPP_TEST) \ - channel_test - -noinst_HEADERS = dft_cmp.h utils.h generate.h - -autogen_sources = write_read_test.tpl write_read_test.def \ - pcm_test.tpl pcm_test.def \ - header_test.tpl header_test.def \ - utils.tpl utils.def \ - scale_clip_test.tpl scale_clip_test.def \ - pipe_test.tpl pipe_test.def \ - rdwr_test.tpl rdwr_test.def \ - floating_point_test.tpl floating_point_test.def \ - benchmark.tpl benchmark.def - -EXTRA_DIST = $(autogen_sources) - -CLEANFILES = *~ *.exe - -#=============================================================================== -# If we're cross compiling from Linux to Windows and running the test suite -# under Wine, we need a symbolic link to the generated libsndfile DLL. - -if LINUX_MINGW_CROSS_TEST - -$(check_PROGRAMS) : libsndfile-1.dll - -libsndfile-1.dll : - ln -s $(top_builddir)/src/.libs/$@ $@ - -clean-local : - -rm -f libsndfile-1.dll - -endif - -#=============================================================================== - -check: test_wrapper.sh - sh test_wrapper.sh - -# Need this target to force building of test programs. -checkprograms : $(check_PROGRAMS) - -#=============================================================================== - -sfversion_SOURCES = sfversion.c -sfversion_LDADD = $(top_builddir)/src/libsndfile.la - -write_read_test_SOURCES = utils.c generate.c write_read_test.c -write_read_test_LDADD = $(top_builddir)/src/libsndfile.la - -lossy_comp_test_SOURCES = utils.c lossy_comp_test.c -lossy_comp_test_LDADD = $(top_builddir)/src/libsndfile.la - -fix_this_SOURCES = utils.c fix_this.c -fix_this_LDADD = $(top_builddir)/src/libsndfile.la - -error_test_SOURCES = error_test.c utils.c -error_test_LDADD = $(top_builddir)/src/libsndfile.la - -ulaw_test_SOURCES = utils.c ulaw_test.c -ulaw_test_LDADD = $(top_builddir)/src/libsndfile.la - -alaw_test_SOURCES = utils.c alaw_test.c -alaw_test_LDADD = $(top_builddir)/src/libsndfile.la - -aiff_rw_test_SOURCES = utils.c aiff_rw_test.c -aiff_rw_test_LDADD = $(top_builddir)/src/libsndfile.la - -command_test_SOURCES = command_test.c utils.c -command_test_LDADD = $(top_builddir)/src/libsndfile.la - -locale_test_SOURCES = locale_test.c utils.c -locale_test_LDADD = $(top_builddir)/src/libsndfile.la - -largefile_test_SOURCES = largefile_test.c utils.c -largefile_test_LDADD = $(top_builddir)/src/libsndfile.la - -pcm_test_SOURCES = pcm_test.c utils.c -pcm_test_LDADD = $(top_builddir)/src/libsndfile.la - -headerless_test_SOURCES = utils.c headerless_test.c -headerless_test_LDADD = $(top_builddir)/src/libsndfile.la - -stdin_test_SOURCES = stdin_test.c utils.c -stdin_test_LDADD = $(top_builddir)/src/libsndfile.la - -stdout_test_SOURCES = stdout_test.c -stdout_test_LDADD = $(top_builddir)/src/libsndfile.la - -stdio_test_SOURCES = stdio_test.c utils.c -stdio_test_LDADD = $(top_builddir)/src/libsndfile.la - -pipe_test_SOURCES = pipe_test.c utils.c -pipe_test_LDADD = $(top_builddir)/src/libsndfile.la - -benchmark_SOURCES = benchmark.c -benchmark_LDADD = $(top_builddir)/src/libsndfile.la - -header_test_SOURCES = header_test.c utils.c -header_test_LDADD = $(top_builddir)/src/libsndfile.la - -misc_test_SOURCES = misc_test.c utils.c -misc_test_LDADD = $(top_builddir)/src/libsndfile.la - -raw_test_SOURCES = raw_test.c utils.c -raw_test_LDADD = $(top_builddir)/src/libsndfile.la - -string_test_SOURCES = string_test.c utils.c -string_test_LDADD = $(top_builddir)/src/libsndfile.la - -dither_test_SOURCES = dither_test.c utils.c -dither_test_LDADD = $(top_builddir)/src/libsndfile.la - -chunk_test_SOURCES = chunk_test.c utils.c -chunk_test_LDADD = $(top_builddir)/src/libsndfile.la - -multi_file_test_SOURCES = multi_file_test.c utils.c -multi_file_test_LDADD = $(top_builddir)/src/libsndfile.la - -virtual_io_test_SOURCES = virtual_io_test.c utils.c -virtual_io_test_LDADD = $(top_builddir)/src/libsndfile.la - -ogg_test_SOURCES = ogg_test.c utils.c -ogg_test_LDADD = $(top_builddir)/src/libsndfile.la - -compression_size_test_SOURCES = compression_size_test.c utils.c -compression_size_test_LDADD = $(top_builddir)/src/libsndfile.la - -rdwr_test_SOURCES = rdwr_test.c utils.c -rdwr_test_LDADD = $(top_builddir)/src/libsndfile.la - -win32_test_SOURCES = win32_test.c -# Link lib here so that generating the testsuite tarball works correctly. -win32_test_LDADD = $(top_builddir)/src/libsndfile.la - -win32_ordinal_test_SOURCES = win32_ordinal_test.c utils.c -win32_ordinal_test_LDADD = $(top_builddir)/src/libsndfile.la - -external_libs_test_SOURCES = external_libs_test.c utils.c -external_libs_test_LDADD = $(top_builddir)/src/libsndfile.la - -format_check_test_SOURCES = format_check_test.c utils.c -format_check_test_LDADD = $(top_builddir)/src/libsndfile.la - -channel_test_SOURCES = channel_test.c utils.c -channel_test_LDADD = $(top_builddir)/src/libsndfile.la - -cpp_test_SOURCES = cpp_test.cc utils.c -cpp_test_LDADD = $(top_builddir)/src/libsndfile.la - -checksum_test_SOURCES = checksum_test.c utils.c -checksum_test_LDADD = $(top_builddir)/src/libsndfile.la - -# Lite remove start -dwvw_test_SOURCES = utils.c dwvw_test.c -dwvw_test_LDADD = $(top_builddir)/src/libsndfile.la - -floating_point_test_SOURCES = utils.c dft_cmp.c floating_point_test.c -floating_point_test_LDADD = $(top_builddir)/src/libsndfile.la - -peak_chunk_test_SOURCES = peak_chunk_test.c utils.c -peak_chunk_test_LDADD = $(top_builddir)/src/libsndfile.la - -scale_clip_test_SOURCES = scale_clip_test.c utils.c -scale_clip_test_LDADD = $(top_builddir)/src/libsndfile.la -# Lite remove end - -#=============================================================================== - -write_read_test.c: write_read_test.def write_read_test.tpl - cd $(srcdir) && autogen --writable write_read_test.def && cd $(abs_builddir) - -pcm_test.c: pcm_test.def pcm_test.tpl - cd $(srcdir) && autogen --writable pcm_test.def && cd $(abs_builddir) - -header_test.c: header_test.def header_test.tpl - cd $(srcdir) && autogen --writable header_test.def && cd $(abs_builddir) - -utils.c utils.h : utils.def utils.tpl - cd $(srcdir) && autogen --writable utils.def && cd $(abs_builddir) - -scale_clip_test.c: scale_clip_test.def scale_clip_test.tpl - cd $(srcdir) && autogen --writable scale_clip_test.def && cd $(abs_builddir) - -pipe_test.c: pipe_test.def pipe_test.tpl - cd $(srcdir) && autogen --writable pipe_test.def && cd $(abs_builddir) - -rdwr_test.c: rdwr_test.def rdwr_test.tpl - cd $(srcdir) && autogen --writable rdwr_test.def && cd $(abs_builddir) - -floating_point_test.c: floating_point_test.def floating_point_test.tpl - cd $(srcdir) && autogen --writable floating_point_test.def && cd $(abs_builddir) - -benchmark.c: benchmark.def benchmark.tpl - cd $(srcdir) && autogen --writable benchmark.def && cd $(abs_builddir) - -genfiles : write_read_test.c pcm_test.c header_test.c utils.c \ - scale_clip_test.c pipe_test.c floating_point_test.c rdwr_test.c \ - benchmark.c - diff --git a/libs/libsndfile/tests/aiff_rw_test.c b/libs/libsndfile/tests/aiff_rw_test.c deleted file mode 100644 index 43d34dbc8f..0000000000 --- a/libs/libsndfile/tests/aiff_rw_test.c +++ /dev/null @@ -1,164 +0,0 @@ -/* -** Copyright (C) 2003-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include -#include -#include -#include -#include -#include - - -#include - -#include "utils.h" - - -static unsigned char aifc_data [] = -{ 'F' , 'O' , 'R' , 'M' , - 0x00, 0x00, 0x01, 0xE8, /* FORM length */ - - 'A' , 'I' , 'F' , 'C' , - 0x43, 0x4F, 0x4D, 0x4D, /* COMM */ - 0x00, 0x00, 0x00, 0x26, /* COMM length */ - 0x00, 0x01, 0x00, 0x00, 0x00, 0xAE, 0x00, 0x10, 0x40, 0x0D, 0xAC, 0x44, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4E, 0x4F, 0x4E, 0x45, 0x0D, 'N' , - 'o' , 't' , ' ' , 'c' , 'o' , 'm' , 'p' , 'r' , 'e' , 's' , 's' , 'e' , - 'd' , 0x00, - - 'F' , 'V' , 'E' , 'R' , 0x00, 0x00, 0x00, 0x04, 0xA2, 0x80, 0x51, 0x40, - - /* A 'MARK' chunk. */ - 'M' , 'A' , 'R' , 'K' , 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 'A' , - 0x00, 0x02, 0x00, 0x00, 0x11, 0x3A, 0x02, 'B' , 'C' , 0x00, - 0x00, 0x03, 0x00, 0x00, 0x22, 0x74, 0x03, 'D' , 'E' , 'F', - 0x00, 0x04, 0x00, 0x00, 0x33, 0xAE, 0x04, 'G' , 'H' , 'I', 'J' , 0x00, - 0x00, 0x05, 0x00, 0x00, 0x44, 0xE8, 0x05, 'K' , 'L' , 'M', 'N' , 'O' , - - 'S' , 'S' , 'N' , 'D' , - 0x00, 0x00, 0x01, 0x64, /* SSND length */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xE0, 0xFF, 0xDB, 0xFF, 0xD0, 0xFF, 0xD5, 0xFF, 0xD6, 0xFF, 0xD0, - 0xFF, 0xBF, 0xFF, 0xBE, 0xFF, 0xB9, 0xFF, 0xC8, 0xFF, 0xBF, 0xFF, 0xD5, - 0xFF, 0xC3, 0xFF, 0xBF, 0xFF, 0xB3, 0xFF, 0xBE, 0xFF, 0xB4, 0xFF, 0xAD, - 0xFF, 0xAC, 0xFF, 0xAF, 0xFF, 0xB9, 0xFF, 0xB3, 0xFF, 0xA4, 0xFF, 0xA5, - 0xFF, 0x93, 0xFF, 0x95, 0xFF, 0x97, 0xFF, 0x98, 0xFF, 0x99, 0xFF, 0x9E, - 0xFF, 0x90, 0xFF, 0x80, 0xFF, 0x81, 0xFF, 0x7C, 0xFF, 0x80, 0xFF, 0x7C, - 0xFF, 0x72, 0xFF, 0x72, 0xFF, 0x6C, 0xFF, 0x75, 0xFF, 0x6E, 0xFF, 0x6F, - 0xFF, 0x66, 0xFF, 0x62, 0xFF, 0x5C, 0xFF, 0x64, 0xFF, 0x50, 0xFF, 0x56, - 0xFF, 0x56, 0xFF, 0x4A, 0xFF, 0x4A, 0xFF, 0x49, 0xFF, 0x44, 0xFF, 0x49, - 0xFF, 0x3B, 0xFF, 0x3F, 0xFF, 0x48, 0xFF, 0x46, 0xFF, 0x42, 0xFF, 0x49, - 0xFF, 0x43, 0xFF, 0x36, 0xFF, 0x40, 0xFF, 0x35, 0xFF, 0x3F, 0xFF, 0x36, - 0xFF, 0x37, 0xFF, 0x2E, 0xFF, 0x23, 0xFF, 0x23, 0xFF, 0x21, 0xFF, 0x1F, - 0xFF, 0x25, 0xFF, 0x2C, 0xFF, 0x1E, 0xFF, 0x22, 0xFF, 0x24, 0xFF, 0x2B, - 0xFF, 0x35, 0xFF, 0x27, 0xFF, 0x2E, 0xFF, 0x21, 0xFF, 0x18, 0xFF, 0x21, - 0xFF, 0x20, 0xFF, 0x0F, 0xFF, 0x21, 0xFF, 0x1A, 0xFF, 0x10, 0xFF, 0x09, - 0xFF, 0x1E, 0xFF, 0x19, 0xFF, 0x21, 0xFF, 0x13, 0xFF, 0x1B, 0xFF, 0x18, - 0xFF, 0x21, 0xFF, 0x0F, 0xFF, 0x1A, 0xFF, 0x16, 0xFF, 0x21, 0xFF, 0x1B, - 0xFF, 0x1B, 0xFF, 0x23, 0xFF, 0x1A, 0xFF, 0x21, 0xFF, 0x26, 0xFF, 0x23, - 0xFF, 0x26, 0xFF, 0x27, 0xFF, 0x30, 0xFF, 0x27, 0xFF, 0x2F, 0xFF, 0x28, - 0xFF, 0x2C, 0xFF, 0x27, 0xFF, 0x33, 0xFF, 0x29, 0xFF, 0x33, 0xFF, 0x3A, - 0xFF, 0x42, 0xFF, 0x3B, 0xFF, 0x4D, 0xFF, 0x4B, 0xFF, 0x4D, 0xFF, 0x4A, - 0xFF, 0x67, 0xFF, 0x77, 0xFF, 0x73, 0xFF, 0x7B, 0xFF, 0xDE, 0xFF, 0xAD, - 0x00, 0x4A, 0x00, 0x63, 0xEC, 0x8C, 0x03, 0xBB, 0x0E, 0xE4, 0x08, 0xF2, - 0x00, 0x70, 0xE3, 0xD1, 0xE5, 0xE4, 0x01, 0x6E, 0x0A, 0x67, 0x1C, 0x74, - 0xF8, 0x8E, 0x10, 0x7B, 0xEA, 0x3C, 0x09, 0x87, 0x1B, 0x24, 0xEF, 0x05, - 0x17, 0x76, 0x0D, 0x5B, 0x02, 0x43, 0xF5, 0xEF, 0x0C, 0x1D, 0xF7, 0x61, - 0x05, 0x95, 0x0B, 0xC2, 0xF1, 0x69, 0x1A, 0xA1, 0xEC, 0x75, 0xF4, 0x11, - 0x13, 0x4F, 0x13, 0x71, 0xFA, 0x33, 0xEC, 0x32, 0xC8, 0xCF, 0x05, 0xB0, - 0x0B, 0x61, 0x33, 0x19, 0xCE, 0x37, 0xEF, 0xD4, 0x21, 0x9D, 0xFA, 0xAE, -} ; - -static void rw_test (const char *filename) ; - -int -main (void) -{ const char *filename = "rw.aifc" ; - - print_test_name ("aiff_rw_test", filename) ; - - dump_data_to_file (filename, aifc_data, sizeof (aifc_data)) ; - - rw_test (filename) ; - - unlink (filename) ; - - puts ("ok") ; - return 0 ; -} /* main */ - -/*============================================================================== -*/ - -static void -rw_test (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo_rd, sfinfo_rw ; - - memset (&sfinfo_rd, 0, sizeof (sfinfo_rd)) ; - memset (&sfinfo_rw, 0, sizeof (sfinfo_rw)) ; - - /* Open the file in read only mode and fill in the SF_INFO struct. */ - if ((file = sf_open (filename, SFM_READ, &sfinfo_rd)) == NULL) - { printf ("\n\nLine %d : sf_open SFM_READ failed : %s\n\n", __LINE__, sf_strerror (NULL)) ; - exit (1) ; - } ; - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - - /* Now open read/write and close the file. */ - if ((file = sf_open (filename, SFM_RDWR, &sfinfo_rw)) == NULL) - { printf ("\n\nLine %d : sf_open SFM_RDWR failed : %s\n\n", __LINE__, sf_strerror (NULL)) ; - exit (1) ; - } ; - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - - /* Open again as read only again and fill in a new SF_INFO struct. */ - memset (&sfinfo_rw, 0, sizeof (sfinfo_rw)) ; - if ((file = sf_open (filename, SFM_READ, &sfinfo_rw)) == NULL) - { printf ("\n\nLine %d : sf_open SFM_RDWR failed : %s\n\n", __LINE__, sf_strerror (NULL)) ; - exit (1) ; - } ; - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - - /* Now compare the two. */ - if (sfinfo_rd.format != sfinfo_rw.format) - { printf ("\n\nLine %d : format mismatch (0x%08X != 0x%08X).\n\n", __LINE__, - sfinfo_rd.format, sfinfo_rw.format) ; - exit (1) ; - } ; - - if (sfinfo_rd.channels != sfinfo_rw.channels) - { printf ("\n\nLine %d : channel count mismatch (%d != %d).\n\n", __LINE__, - sfinfo_rd.channels, sfinfo_rw.channels) ; - exit (1) ; - } ; - - if (sfinfo_rd.frames != sfinfo_rw.frames) - { printf ("\n\nLine %d : frame count mismatch (rd %" PRId64 " != rw %" PRId64 ").\n\n", __LINE__, - sfinfo_rd.frames, sfinfo_rw.frames) ; - exit (1) ; - } ; - - return ; -} /* rw_test */ - diff --git a/libs/libsndfile/tests/alaw_test.c b/libs/libsndfile/tests/alaw_test.c deleted file mode 100644 index 6d71ffed98..0000000000 --- a/libs/libsndfile/tests/alaw_test.c +++ /dev/null @@ -1,236 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_SIZE (65536) - -static unsigned char alaw_encode (int sample) ; -static int alaw_decode (unsigned int alawbyte) ; - -static short short_buffer [BUFFER_SIZE] ; -static unsigned char alaw_buffer [BUFFER_SIZE] ; - -int -main (void) -{ SNDFILE *file ; - SF_INFO sfinfo ; - const char *filename ; - int k ; - - print_test_name ("alaw_test", "encoder") ; - - filename = "test.raw" ; - - sf_info_setup (&sfinfo, SF_FORMAT_RAW | SF_FORMAT_ALAW, 44100, 1) ; - - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("sf_open_write failed with error : ") ; - fflush (stdout) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - /* Generate a file containing all possible 16 bit sample values - ** and write it to disk as alaw encoded.frames. - */ - - for (k = 0 ; k < 0x10000 ; k++) - short_buffer [k] = k & 0xFFFF ; - - sf_write_short (file, short_buffer, BUFFER_SIZE) ; - sf_close (file) ; - - /* Now open that file and compare the alaw encoded sample values - ** with what they should be. - */ - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("sf_open_write failed with error : ") ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - if (sf_read_raw (file, alaw_buffer, BUFFER_SIZE) != BUFFER_SIZE) - { printf ("sf_read_raw : ") ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - for (k = 0 ; k < 0x10000 ; k++) - if (alaw_encode (short_buffer [k]) != alaw_buffer [k]) - { printf ("Encoder error : sample #%d (0x%02X should be 0x%02X)\n", k, alaw_buffer [k], alaw_encode (short_buffer [k])) ; - exit (1) ; - } ; - - sf_close (file) ; - - puts ("ok") ; - - print_test_name ("alaw_test", "decoder") ; - /* Now generate a file containing all possible 8 bit encoded - ** sample values and write it to disk as alaw encoded.frames. - */ - - if (! (file = sf_open (filename, SFM_WRITE, &sfinfo))) - { printf ("sf_open_write failed with error : ") ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - for (k = 0 ; k < 256 ; k++) - alaw_buffer [k] = k & 0xFF ; - - sf_write_raw (file, alaw_buffer, 256) ; - sf_close (file) ; - - /* Now open that file and compare the alaw decoded sample values - ** with what they should be. - */ - - if (! (file = sf_open (filename, SFM_READ, &sfinfo))) - { printf ("sf_open_write failed with error : ") ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - if (sf_read_short (file, short_buffer, 256) != 256) - { printf ("sf_read_short : ") ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - - for (k = 0 ; k < 256 ; k++) - if (short_buffer [k] != alaw_decode (alaw_buffer [k])) - { printf ("Decoder error : sample #%d (0x%02X should be 0x%02X)\n", k, short_buffer [k], alaw_decode (alaw_buffer [k])) ; - exit (1) ; - } ; - - sf_close (file) ; - - puts ("ok") ; - - unlink (filename) ; - - return 0 ; -} /* main */ - - -/*================================================================================= -** The following routines came from the sox-12.15 (Sound eXcahcnge) distribution. -** -** This code is not compiled into libsndfile. It is only used to test the -** libsndfile lookup tables for correctness. -** -** I have included the original authors comments. -*/ - -/* -** A-law routines by Graeme W. Gill. -** Date: 93/5/7 -** -** References: -** 1) CCITT Recommendation G.711 -** -*/ - -#define ACLIP 31744 - -static -unsigned char alaw_encode (int sample) -{ static int exp_lut [128] = - { 1, 1, 2, 2, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7 - } ; - - int sign, exponent, mantissa ; - unsigned char Alawbyte ; - - /* Get the sample into sign-magnitude. */ - sign = ((~sample) >> 8) & 0x80 ; /* set aside the sign */ - if (sign == 0) - sample = -sample ; /* get magnitude */ - if (sample > ACLIP) - sample = ACLIP ; /* clip the magnitude */ - - /* Convert from 16 bit linear to ulaw. */ - if (sample >= 256) - { exponent = exp_lut [(sample >> 8) & 0x7F] ; - mantissa = (sample >> (exponent + 3)) & 0x0F ; - Alawbyte = ((exponent << 4) | mantissa) ; - } - else - Alawbyte = (sample >> 4) ; - - Alawbyte ^= (sign ^ 0x55) ; - - return Alawbyte ; -} /* alaw_encode */ - -static -int alaw_decode (unsigned int Alawbyte) -{ static int exp_lut [8] = { 0, 264, 528, 1056, 2112, 4224, 8448, 16896 } ; - int sign, exponent, mantissa, sample ; - - Alawbyte ^= 0x55 ; - sign = (Alawbyte & 0x80) ; - Alawbyte &= 0x7f ; /* get magnitude */ - if (Alawbyte >= 16) - { exponent = (Alawbyte >> 4) & 0x07 ; - mantissa = Alawbyte & 0x0F ; - sample = exp_lut [exponent] + (mantissa << (exponent + 3)) ; - } - else - sample = (Alawbyte << 4) + 8 ; - if (sign == 0) - sample = -sample ; - - return sample ; -} /* alaw_decode */ - diff --git a/libs/libsndfile/tests/benchmark-0.0.28 b/libs/libsndfile/tests/benchmark-0.0.28 deleted file mode 100644 index 2d2b06f9bc..0000000000 --- a/libs/libsndfile/tests/benchmark-0.0.28 +++ /dev/null @@ -1,40 +0,0 @@ -erikd@coltrane > tests/benchmark -Benchmarking libsndfile-0.0.28 ------------------------------- -Each test takes a little over 5 seconds. - - Raw write PCM_16 : 30660117 samples per sec - Raw read PCM_16 : 62788982 samples per sec - -Native endian I/O : - Write short to PCM_16 : 83.37% of raw write - Read short from PCM_16 : 83.17% of raw read - Write int to PCM_24 : 30.78% of raw write - Read int from PCM_24 : 32.96% of raw read - Write int to PCM_32 : 42.05% of raw write - Read int from PCM_32 : 41.11% of raw read - Write float to PCM_16 : 17.75% of raw write - Read float from PCM_16 : 43.27% of raw read - Write float to PCM_24 : 15.30% of raw write - Read float from PCM_24 : 28.09% of raw read - Write float to PCM_32 : 14.55% of raw write - Read float from PCM_32 : 34.65% of raw read - Write float to FLOAT : 28.98% of raw write - Read float from FLOAT : 56.71% of raw read - -Endian swapped I/O : - Write short to PCM_16 : 43.39% of raw write - Read short from PCM_16 : 49.12% of raw read - Write int to PCM_24 : 29.65% of raw write - Read int from PCM_24 : 33.66% of raw read - Write int to PCM_32 : 19.62% of raw write - Read int from PCM_32 : 21.97% of raw read - Write float to PCM_16 : 17.63% of raw write - Read float from PCM_16 : 31.43% of raw read - Write float to PCM_24 : 14.91% of raw write - Read float from PCM_24 : 27.99% of raw read - Write float to PCM_32 : 13.69% of raw write - Read float from PCM_32 : 22.23% of raw read - Write float to FLOAT : 19.25% of raw write - Read float from FLOAT : 25.66% of raw read - diff --git a/libs/libsndfile/tests/benchmark-1.0.0 b/libs/libsndfile/tests/benchmark-1.0.0 deleted file mode 100644 index 2922836419..0000000000 --- a/libs/libsndfile/tests/benchmark-1.0.0 +++ /dev/null @@ -1,35 +0,0 @@ -Benchmarking libsndfile-1.0.0 ------------------------------ -Each test takes a little over 5 seconds. - - Raw write PCM_16 : 31084269 samples per sec - Raw read PCM_16 : 63597065 samples per sec - -Native endian I/O : - Write short to PCM_16 : 83.19% of raw write - Read short from PCM_16 : 82.93% of raw read - Write int to PCM_24 : 31.12% of raw write - Read int from PCM_24 : 37.90% of raw read - Write float to PCM_16 : 37.00% of raw write - Read float from PCM_16 : 45.53% of raw read - Write float to PCM_24 : 29.08% of raw write - Read float from PCM_24 : 28.48% of raw read - Write float to PCM_32 : 22.08% of raw write - Read float from PCM_32 : 31.21% of raw read - Write float to FLOAT : 28.70% of raw write - Read float from FLOAT : 56.32% of raw read - -Endian swapped I/O : - Write short to PCM_16 : 22.08% of raw write - Read short from PCM_16 : 23.20% of raw read - Write int to PCM_24 : 30.96% of raw write - Read int from PCM_24 : 37.76% of raw read - Write float to PCM_16 : 35.82% of raw write - Read float from PCM_16 : 22.61% of raw read - Write float to PCM_24 : 27.70% of raw write - Read float from PCM_24 : 28.37% of raw read - Write float to PCM_32 : 20.77% of raw write - Read float from PCM_32 : 23.46% of raw read - Write float to FLOAT : 15.03% of raw write - Read float from FLOAT : 15.43% of raw read - diff --git a/libs/libsndfile/tests/benchmark-1.0.0rc2 b/libs/libsndfile/tests/benchmark-1.0.0rc2 deleted file mode 100644 index 770224672f..0000000000 --- a/libs/libsndfile/tests/benchmark-1.0.0rc2 +++ /dev/null @@ -1,31 +0,0 @@ -Benchmarking libsndfile-1.0.0rc2 --------------------------------- -Each test takes a little over 5 seconds. - - Raw write PCM_16 : 31638069 samples per sec - Raw read PCM_16 : 62788982 samples per sec - -Native endian I/O : - Write short to PCM_16 : 82.37% of raw write - Read short from PCM_16 : 82.17% of raw read - Write int to PCM_24 : 30.80% of raw write - Read int from PCM_24 : 37.95% of raw read - Write float to PCM_16 : 36.22% of raw write - Read float from PCM_16 : 23.32% of raw read - Write float to PCM_24 : 28.41% of raw write - Read float from PCM_24 : 28.41% of raw read - Write float to FLOAT : 28.41% of raw write - Read float from FLOAT : 57.50% of raw read - -Endian swapped I/O : - Write short to PCM_16 : 21.73% of raw write - Read short from PCM_16 : 23.37% of raw read - Write int to PCM_24 : 31.02% of raw write - Read int from PCM_24 : 38.24% of raw read - Write float to PCM_16 : 35.51% of raw write - Read float from PCM_16 : 19.16% of raw read - Write float to PCM_24 : 27.37% of raw write - Read float from PCM_24 : 28.74% of raw read - Write float to FLOAT : 15.11% of raw write - Read float from FLOAT : 15.60% of raw read - diff --git a/libs/libsndfile/tests/benchmark-1.0.18pre16-hendrix b/libs/libsndfile/tests/benchmark-1.0.18pre16-hendrix deleted file mode 100644 index 951bc56d25..0000000000 --- a/libs/libsndfile/tests/benchmark-1.0.18pre16-hendrix +++ /dev/null @@ -1,38 +0,0 @@ -Benchmarking libsndfile-1.0.18pre15 ------------------------------------ -Each test takes a little over 5 seconds. - - Raw write PCM_16 : 103189885 samples per sec - Raw read PCM_16 : 660854036 samples per sec - -Native endian I/O : - Write short to PCM_16 : 95.08% of raw write - Read short from PCM_16 : 96.39% of raw read - Write int to PCM_24 : 54.55% of raw write - Read int from PCM_24 : 28.50% of raw read - Write int to PCM_32 : 46.97% of raw write - Read int from PCM_32 : 39.98% of raw read - Write float to PCM_16 : 60.85% of raw write - Read float from PCM_16 : 27.79% of raw read - Write float to PCM_24 : 46.23% of raw write - Read float from PCM_24 : 22.62% of raw read - Write float to PCM_32 : 35.38% of raw write - Read float from PCM_32 : 24.18% of raw read - Write float to FLOAT : 47.73% of raw write - Read float from FLOAT : 40.62% of raw read - -Endian swapped I/O : - Write short to PCM_16 : 79.98% of raw write - Read short from PCM_16 : 49.27% of raw read - Write int to PCM_24 : 53.80% of raw write - Read int from PCM_24 : 28.50% of raw read - Write int to PCM_32 : 41.68% of raw write - Read int from PCM_32 : 25.89% of raw read - Write float to PCM_16 : 61.03% of raw write - Read float from PCM_16 : 27.74% of raw read - Write float to PCM_24 : 45.10% of raw write - Read float from PCM_24 : 22.43% of raw read - Write float to PCM_32 : 35.24% of raw write - Read float from PCM_32 : 22.37% of raw read - Write float to FLOAT : 42.01% of raw write - Read float from FLOAT : 28.98% of raw read diff --git a/libs/libsndfile/tests/benchmark-1.0.18pre16-mingus b/libs/libsndfile/tests/benchmark-1.0.18pre16-mingus deleted file mode 100644 index fa0584e149..0000000000 --- a/libs/libsndfile/tests/benchmark-1.0.18pre16-mingus +++ /dev/null @@ -1,38 +0,0 @@ -Benchmarking libsndfile-1.0.18pre15 ------------------------------------ -Each test takes a little over 5 seconds. - - Raw write PCM_16 : 178237074 samples per sec - Raw read PCM_16 : 368885269 samples per sec - -Native endian I/O : - Write short to PCM_16 : 98.84% of raw write - Read short from PCM_16 : 147.10% of raw read - Write int to PCM_24 : 33.74% of raw write - Read int from PCM_24 : 30.82% of raw read - Write int to PCM_32 : 48.34% of raw write - Read int from PCM_32 : 62.43% of raw read - Write float to PCM_16 : 41.86% of raw write - Read float from PCM_16 : 36.73% of raw read - Write float to PCM_24 : 28.38% of raw write - Read float from PCM_24 : 19.50% of raw read - Write float to PCM_32 : 23.68% of raw write - Read float from PCM_32 : 28.76% of raw read - Write float to FLOAT : 47.21% of raw write - Read float from FLOAT : 60.85% of raw read - -Endian swapped I/O : - Write short to PCM_16 : 54.94% of raw write - Read short from PCM_16 : 59.03% of raw read - Write int to PCM_24 : 33.40% of raw write - Read int from PCM_24 : 31.98% of raw read - Write int to PCM_32 : 30.89% of raw write - Read int from PCM_32 : 33.68% of raw read - Write float to PCM_16 : 41.61% of raw write - Read float from PCM_16 : 26.76% of raw read - Write float to PCM_24 : 25.75% of raw write - Read float from PCM_24 : 19.84% of raw read - Write float to PCM_32 : 21.29% of raw write - Read float from PCM_32 : 21.78% of raw read - Write float to FLOAT : 30.82% of raw write - Read float from FLOAT : 35.04% of raw read diff --git a/libs/libsndfile/tests/benchmark-1.0.6pre10-coltrane b/libs/libsndfile/tests/benchmark-1.0.6pre10-coltrane deleted file mode 100644 index 12f71a8a78..0000000000 --- a/libs/libsndfile/tests/benchmark-1.0.6pre10-coltrane +++ /dev/null @@ -1,39 +0,0 @@ -Benchmarking libsndfile-1.0.6pre10 ----------------------------------- -Each test takes a little over 5 seconds. - - Raw write PCM_16 : 28845961 samples per sec - Raw read PCM_16 : 63471874 samples per sec - -Native endian I/O : - Write short to PCM_16 : 86.21% of raw write - Read short from PCM_16 : 82.60% of raw read - Write int to PCM_24 : 34.89% of raw write - Read int from PCM_24 : 37.26% of raw read - Write int to PCM_32 : 43.36% of raw write - Read int from PCM_32 : 41.30% of raw read - Write float to PCM_16 : 43.02% of raw write - Read float from PCM_16 : 43.99% of raw read - Write float to PCM_24 : 32.72% of raw write - Read float from PCM_24 : 28.21% of raw read - Write float to PCM_32 : 25.92% of raw write - Read float from PCM_32 : 30.98% of raw read - Write float to FLOAT : 46.65% of raw write - Read float from FLOAT : 56.66% of raw read - -Endian swapped I/O : - Write short to PCM_16 : 54.53% of raw write - Read short from PCM_16 : 56.32% of raw read - Write int to PCM_24 : 35.28% of raw write - Read int from PCM_24 : 37.33% of raw read - Write int to PCM_32 : 26.21% of raw write - Read int from PCM_32 : 23.51% of raw read - Write float to PCM_16 : 41.39% of raw write - Read float from PCM_16 : 23.56% of raw read - Write float to PCM_24 : 30.86% of raw write - Read float from PCM_24 : 28.27% of raw read - Write float to PCM_32 : 23.83% of raw write - Read float from PCM_32 : 20.54% of raw read - Write float to FLOAT : 27.26% of raw write - Read float from FLOAT : 29.04% of raw read - diff --git a/libs/libsndfile/tests/benchmark-1.0.6pre10-miles b/libs/libsndfile/tests/benchmark-1.0.6pre10-miles deleted file mode 100644 index fffdb84630..0000000000 --- a/libs/libsndfile/tests/benchmark-1.0.6pre10-miles +++ /dev/null @@ -1,39 +0,0 @@ -Benchmarking libsndfile-1.0.6pre10 ----------------------------------- -Each test takes a little over 5 seconds. - - Raw write PCM_16 : 40092612 samples per sec - Raw read PCM_16 : 42382563 samples per sec - -Native endian I/O : - Write short to PCM_16 : 61.90% of raw write - Read short from PCM_16 : 100.20% of raw read - Write int to PCM_24 : 28.69% of raw write - Read int from PCM_24 : 33.62% of raw read - Write int to PCM_32 : 31.14% of raw write - Read int from PCM_32 : 51.04% of raw read - Write float to PCM_16 : 25.57% of raw write - Read float from PCM_16 : 28.17% of raw read - Write float to PCM_24 : 23.59% of raw write - Read float from PCM_24 : 24.14% of raw read - Write float to PCM_32 : 18.00% of raw write - Read float from PCM_32 : 22.59% of raw read - Write float to FLOAT : 31.32% of raw write - Read float from FLOAT : 51.54% of raw read - -Endian swapped I/O : - Write short to PCM_16 : 42.81% of raw write - Read short from PCM_16 : 54.58% of raw read - Write int to PCM_24 : 29.28% of raw write - Read int from PCM_24 : 33.43% of raw read - Write int to PCM_32 : 22.21% of raw write - Read int from PCM_32 : 27.24% of raw read - Write float to PCM_16 : 25.76% of raw write - Read float from PCM_16 : 26.84% of raw read - Write float to PCM_24 : 23.71% of raw write - Read float from PCM_24 : 24.10% of raw read - Write float to PCM_32 : 18.47% of raw write - Read float from PCM_32 : 21.45% of raw read - Write float to FLOAT : 22.46% of raw write - Read float from FLOAT : 29.72% of raw read - diff --git a/libs/libsndfile/tests/benchmark-latest-coltrane b/libs/libsndfile/tests/benchmark-latest-coltrane deleted file mode 100644 index 97ce29a8a9..0000000000 --- a/libs/libsndfile/tests/benchmark-latest-coltrane +++ /dev/null @@ -1,75 +0,0 @@ -erikd@coltrane > cat tests/benchmark-0.0.28 -Benchmarking libsndfile-0.0.28 ------------------------------- -Each test takes a little over 5 seconds. - - Raw write PCM_16 : 31022959 samples per sec - Raw read PCM_16 : 63471874 samples per sec - -Native endian I/O : - Write short to PCM_16 : 83.19% of raw write - Read short from PCM_16 : 82.28% of raw read - Write int to PCM_24 : 30.81% of raw write - Read int from PCM_24 : 32.92% of raw read - Write float to PCM_16 : 17.70% of raw write - Read float from PCM_16 : 43.64% of raw read - Write float to PCM_24 : 15.09% of raw write - Read float from PCM_24 : 27.79% of raw read - Write float to PCM_32 : 14.32% of raw write - Read float from PCM_32 : 34.42% of raw read - Write float to FLOAT : 28.64% of raw write - Read float from FLOAT : 56.77% of raw read - -Endian swapped I/O : - Write short to PCM_16 : 44.04% of raw write - Read short from PCM_16 : 49.46% of raw read - Write int to PCM_24 : 28.92% of raw write - Read int from PCM_24 : 33.10% of raw read - Write float to PCM_16 : 17.30% of raw write - Read float from PCM_16 : 31.46% of raw read - Write float to PCM_24 : 14.62% of raw write - Read float from PCM_24 : 27.64% of raw read - Write float to PCM_32 : 13.65% of raw write - Read float from PCM_32 : 22.41% of raw read - Write float to FLOAT : 19.13% of raw write - Read float from FLOAT : 26.21% of raw read - -erikd@coltrane > tests/benchmark -Benchmarking libsndfile-1.0.0 ------------------------------ -Each test takes a little over 5 seconds. - - Raw write PCM_16 : 29884416 samples per sec - Raw read PCM_16 : 63347175 samples per sec - -Native endian I/O : - Write short to PCM_16 : 88.24% of raw write - Read short from PCM_16 : 82.76% of raw read - Write int to PCM_24 : 34.95% of raw write - Read int from PCM_24 : 37.17% of raw read - Write int to PCM_32 : 43.86% of raw write - Read int from PCM_32 : 41.22% of raw read - Write float to PCM_16 : 42.07% of raw write - Read float from PCM_16 : 44.25% of raw read - Write float to PCM_24 : 32.43% of raw write - Read float from PCM_24 : 28.93% of raw read - Write float to PCM_32 : 25.60% of raw write - Read float from PCM_32 : 31.10% of raw read - Write float to FLOAT : 45.55% of raw write - Read float from FLOAT : 57.41% of raw read - -Endian swapped I/O : - Write short to PCM_16 : 43.46% of raw write - Read short from PCM_16 : 43.99% of raw read - Write int to PCM_24 : 35.09% of raw write - Read int from PCM_24 : 37.34% of raw read - Write int to PCM_32 : 24.05% of raw write - Read int from PCM_32 : 19.74% of raw read - Write float to PCM_16 : 40.25% of raw write - Read float from PCM_16 : 32.15% of raw read - Write float to PCM_24 : 31.02% of raw write - Read float from PCM_24 : 28.82% of raw read - Write float to PCM_32 : 23.54% of raw write - Read float from PCM_32 : 23.65% of raw read - Write float to FLOAT : 24.87% of raw write - Read float from FLOAT : 20.28% of raw read diff --git a/libs/libsndfile/tests/benchmark.c b/libs/libsndfile/tests/benchmark.c deleted file mode 100644 index f33bfee43b..0000000000 --- a/libs/libsndfile/tests/benchmark.c +++ /dev/null @@ -1,545 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#include -#include -#include -#include -#include - -#include - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -/* -** Neat solution to the Win32/OS2 binary file flage requirement. -** If O_BINARY isn't already defined by the inclusion of the system -** headers, set it to zero. -*/ -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -#define WRITE_FLAGS (O_WRONLY | O_CREAT | O_TRUNC | O_BINARY) -#define READ_FLAGS (O_RDONLY | O_BINARY) - -#if (defined (WIN32) || defined (_WIN32) || defined (__OS2__)) - #define WRITE_PERMS 0777 -#else - #define WRITE_PERMS (S_IRUSR | S_IWUSR | S_IRGRP) -#endif - -#define BUFFER_SIZE (1<<18) -#define BLOCK_COUNT (30) -#define TEST_DURATION (5) /* 5 Seconds. */ - -typedef struct -{ double write_rate ; - double read_rate ; -} PERF_STATS ; - -static void *data = NULL ; - -static void calc_raw_performance (PERF_STATS *stats) ; - -static void calc_short_performance (int format, double read_rate, double write_rate) ; -static void calc_int_performance (int format, double read_rate, double write_rate) ; -static void calc_float_performance (int format, double read_rate, double write_rate) ; - - -static int cpu_is_big_endian (void) ; - -static const char* get_subtype_str (int subtype) ; - -int -main (int argc, char *argv []) -{ PERF_STATS stats ; - char buffer [256] = "Benchmarking " ; - int format_major ; - - if (! (data = malloc (BUFFER_SIZE * sizeof (double)))) - { perror ("Error : malloc failed") ; - exit (1) ; - } ; - - sf_command (NULL, SFC_GET_LIB_VERSION, buffer + strlen (buffer), sizeof (buffer) - strlen (buffer)) ; - - puts (buffer) ; - memset (buffer, '-', strlen (buffer)) ; - puts (buffer) ; - printf ("Each test takes a little over %d seconds.\n\n", TEST_DURATION) ; - - calc_raw_performance (&stats) ; - - if (argc < 2 || strcmp ("--native-only", argv [1]) == 0) - { puts ("\nNative endian I/O :") ; - format_major = cpu_is_big_endian () ? SF_FORMAT_AIFF : SF_FORMAT_WAV ; - - calc_short_performance (format_major | SF_FORMAT_PCM_16, stats.read_rate, stats.write_rate) ; - calc_int_performance (format_major | SF_FORMAT_PCM_24, stats.read_rate, stats.write_rate) ; - calc_int_performance (format_major | SF_FORMAT_PCM_32, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_16, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_24, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_32, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_FLOAT , stats.read_rate, stats.write_rate) ; - } ; - - if (argc < 2 || strcmp ("--swap-only", argv [1]) == 0) - { puts ("\nEndian swapped I/O :") ; - format_major = cpu_is_big_endian () ? SF_FORMAT_WAV : SF_FORMAT_AIFF ; - - calc_short_performance (format_major | SF_FORMAT_PCM_16, stats.read_rate, stats.write_rate) ; - calc_int_performance (format_major | SF_FORMAT_PCM_24, stats.read_rate, stats.write_rate) ; - calc_int_performance (format_major | SF_FORMAT_PCM_32, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_16, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_24, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_32, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_FLOAT , stats.read_rate, stats.write_rate) ; - } ; - - puts ("") ; - - free (data) ; - - return 0 ; -} /* main */ - -/*============================================================================== -*/ - -static void -calc_raw_performance (PERF_STATS *stats) -{ clock_t start_clock, clock_time ; - int fd, k, byte_count, retval, op_count ; - const char *filename ; - - filename = "benchmark.dat" ; - - byte_count = BUFFER_SIZE * sizeof (short) ; - - /* Collect write stats */ - printf (" Raw write PCM_16 : ") ; - fflush (stdout) ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if ((fd = open (filename, WRITE_FLAGS, WRITE_PERMS)) < 0) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = write (fd, data, byte_count)) != byte_count) - { printf ("Error : write returned %d (should have been %d)\n", retval, byte_count) ; - exit (1) ; - } ; - } ; - - close (fd) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - stats->write_rate = (1.0 * BUFFER_SIZE) * BLOCK_COUNT * op_count ; - stats->write_rate *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%10.0f samples per sec\n", stats->write_rate) ; - - /* Collect read stats */ - printf (" Raw read PCM_16 : ") ; - fflush (stdout) ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if ((fd = open (filename, READ_FLAGS)) < 0) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = read (fd, data, byte_count)) != byte_count) - { printf ("Error : write returned %d (should have been %d)\n", retval, byte_count) ; - exit (1) ; - } ; - } ; - - close (fd) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - stats->read_rate = (1.0 * BUFFER_SIZE) * BLOCK_COUNT * op_count ; - stats->read_rate *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%10.0f samples per sec\n", stats->read_rate) ; - - unlink (filename) ; -} /* calc_raw_performance */ - -/*------------------------------------------------------------------------------ -*/ - -static void -calc_short_performance (int format, double read_rate, double write_rate) -{ SNDFILE *file ; - SF_INFO sfinfo ; - clock_t start_clock, clock_time ; - double performance ; - int k, item_count, retval, op_count ; - const char* subtype ; - short *short_data ; - const char *filename ; - - filename = "benchmark.dat" ; - subtype = get_subtype_str (format & SF_FORMAT_SUBMASK) ; - - short_data = data ; - item_count = BUFFER_SIZE ; - for (k = 0 ; k < item_count ; k++) - short_data [k] = 32700.0 * sin (2 * M_PI * k / 32000.0) ; - - /* Collect write stats */ - printf (" Write %-5s to %s : ", "short", subtype) ; - fflush (stdout) ; - - sfinfo.channels = 1 ; - sfinfo.format = format ; - sfinfo.frames = 1 ; - sfinfo.samplerate = 32000 ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if (! (file = sf_open (filename, SFM_WRITE, &sfinfo))) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - /* Turn off the addition of a PEAK chunk. */ - sf_command (file, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = sf_write_short (file, short_data, item_count)) != item_count) - { printf ("Error : sf_write_short returned %d (should have been %d)\n", retval, item_count) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - performance = (1.0 * BUFFER_SIZE) * BLOCK_COUNT * op_count ; - performance *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%6.2f%% of raw write\n", 100.0 * performance / write_rate) ; - - /* Collect read stats */ - printf (" Read %-5s from %s : ", "short", subtype) ; - fflush (stdout) ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if (! (file = sf_open (filename, SFM_READ, &sfinfo))) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = sf_read_short (file, short_data, item_count)) != item_count) - { printf ("Error : write returned %d (should have been %d)\n", retval, item_count) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - performance = (1.0 * item_count) * BLOCK_COUNT * op_count ; - performance *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%6.2f%% of raw read\n", 100.0 * performance / read_rate) ; - - unlink (filename) ; - -} /* calc_short_performance */ -static void -calc_int_performance (int format, double read_rate, double write_rate) -{ SNDFILE *file ; - SF_INFO sfinfo ; - clock_t start_clock, clock_time ; - double performance ; - int k, item_count, retval, op_count ; - const char* subtype ; - int *int_data ; - const char *filename ; - - filename = "benchmark.dat" ; - subtype = get_subtype_str (format & SF_FORMAT_SUBMASK) ; - - int_data = data ; - item_count = BUFFER_SIZE ; - for (k = 0 ; k < item_count ; k++) - int_data [k] = 32700.0 * (1<<16) * sin (2 * M_PI * k / 32000.0) ; - - /* Collect write stats */ - printf (" Write %-5s to %s : ", "int", subtype) ; - fflush (stdout) ; - - sfinfo.channels = 1 ; - sfinfo.format = format ; - sfinfo.frames = 1 ; - sfinfo.samplerate = 32000 ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if (! (file = sf_open (filename, SFM_WRITE, &sfinfo))) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - /* Turn off the addition of a PEAK chunk. */ - sf_command (file, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = sf_write_int (file, int_data, item_count)) != item_count) - { printf ("Error : sf_write_short returned %d (should have been %d)\n", retval, item_count) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - performance = (1.0 * BUFFER_SIZE) * BLOCK_COUNT * op_count ; - performance *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%6.2f%% of raw write\n", 100.0 * performance / write_rate) ; - - /* Collect read stats */ - printf (" Read %-5s from %s : ", "int", subtype) ; - fflush (stdout) ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if (! (file = sf_open (filename, SFM_READ, &sfinfo))) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = sf_read_int (file, int_data, item_count)) != item_count) - { printf ("Error : write returned %d (should have been %d)\n", retval, item_count) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - performance = (1.0 * item_count) * BLOCK_COUNT * op_count ; - performance *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%6.2f%% of raw read\n", 100.0 * performance / read_rate) ; - - unlink (filename) ; - -} /* calc_int_performance */ -static void -calc_float_performance (int format, double read_rate, double write_rate) -{ SNDFILE *file ; - SF_INFO sfinfo ; - clock_t start_clock, clock_time ; - double performance ; - int k, item_count, retval, op_count ; - const char* subtype ; - float *float_data ; - const char *filename ; - - filename = "benchmark.dat" ; - subtype = get_subtype_str (format & SF_FORMAT_SUBMASK) ; - - float_data = data ; - item_count = BUFFER_SIZE ; - for (k = 0 ; k < item_count ; k++) - float_data [k] = 1.0 * sin (2 * M_PI * k / 32000.0) ; - - /* Collect write stats */ - printf (" Write %-5s to %s : ", "float", subtype) ; - fflush (stdout) ; - - sfinfo.channels = 1 ; - sfinfo.format = format ; - sfinfo.frames = 1 ; - sfinfo.samplerate = 32000 ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if (! (file = sf_open (filename, SFM_WRITE, &sfinfo))) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - /* Turn off the addition of a PEAK chunk. */ - sf_command (file, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = sf_write_float (file, float_data, item_count)) != item_count) - { printf ("Error : sf_write_short returned %d (should have been %d)\n", retval, item_count) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - performance = (1.0 * BUFFER_SIZE) * BLOCK_COUNT * op_count ; - performance *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%6.2f%% of raw write\n", 100.0 * performance / write_rate) ; - - /* Collect read stats */ - printf (" Read %-5s from %s : ", "float", subtype) ; - fflush (stdout) ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if (! (file = sf_open (filename, SFM_READ, &sfinfo))) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = sf_read_float (file, float_data, item_count)) != item_count) - { printf ("Error : write returned %d (should have been %d)\n", retval, item_count) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - performance = (1.0 * item_count) * BLOCK_COUNT * op_count ; - performance *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%6.2f%% of raw read\n", 100.0 * performance / read_rate) ; - - unlink (filename) ; - -} /* calc_float_performance */ - - -/*============================================================================== -*/ - -static int -cpu_is_big_endian (void) -{ unsigned char *cptr ; - int endtest ; - - endtest = 0x12345678 ; - - cptr = (unsigned char*) (&endtest) ; - - if (cptr [0] == 0x12 && cptr [1] == 0x34 && cptr [3] == 0x78) - return SF_TRUE ; - - return SF_FALSE ; -} /* cpu_is_big_endian */ - -static const char* -get_subtype_str (int subtype) -{ switch (subtype) - { case SF_FORMAT_PCM_16 : - return "PCM_16" ; - - case SF_FORMAT_PCM_24 : - return "PCM_24" ; - - case SF_FORMAT_PCM_32 : - return "PCM_32" ; - - case SF_FORMAT_FLOAT : - return "FLOAT " ; - - case SF_FORMAT_DOUBLE : - return "DOUBLE" ; - - default : break ; - } ; - - return "UNKNOWN" ; -} /* get_subtype_str */ - diff --git a/libs/libsndfile/tests/benchmark.def b/libs/libsndfile/tests/benchmark.def deleted file mode 100644 index 382bf3b1a6..0000000000 --- a/libs/libsndfile/tests/benchmark.def +++ /dev/null @@ -1,17 +0,0 @@ -autogen definitions benchmark.tpl; - -data_type = { - type_name = short ; - multiplier = "32700.0" ; - }; - -data_type = { - type_name = int ; - multiplier = "32700.0 * (1 << 16)" ; - }; - -data_type = { - type_name = float ; - multiplier = "1.0" ; - }; - diff --git a/libs/libsndfile/tests/benchmark.tpl b/libs/libsndfile/tests/benchmark.tpl deleted file mode 100644 index 14b22e2e22..0000000000 --- a/libs/libsndfile/tests/benchmark.tpl +++ /dev/null @@ -1,360 +0,0 @@ -[+ AutoGen5 template c +] -/* -** Copyright (C) 2002-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#include -#include -#include -#include -#include - -#include - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -/* -** Neat solution to the Win32/OS2 binary file flage requirement. -** If O_BINARY isn't already defined by the inclusion of the system -** headers, set it to zero. -*/ -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -#define WRITE_FLAGS (O_WRONLY | O_CREAT | O_TRUNC | O_BINARY) -#define READ_FLAGS (O_RDONLY | O_BINARY) - -#if (defined (WIN32) || defined (_WIN32) || defined (__OS2__)) - #define WRITE_PERMS 0777 -#else - #define WRITE_PERMS (S_IRUSR | S_IWUSR | S_IRGRP) -#endif - -#define BUFFER_SIZE (1 << 18) -#define BLOCK_COUNT (30) -#define TEST_DURATION (5) /* 5 Seconds. */ - -typedef struct -{ double write_rate ; - double read_rate ; -} PERF_STATS ; - -static void *data = NULL ; - -static void calc_raw_performance (PERF_STATS *stats) ; - -[+ FOR data_type -+]static void calc_[+ (get "type_name") +]_performance (int format, double read_rate, double write_rate) ; -[+ ENDFOR data_type -+] - -static int cpu_is_big_endian (void) ; - -static const char* get_subtype_str (int subtype) ; - -int -main (int argc, char *argv []) -{ PERF_STATS stats ; - char buffer [256] = "Benchmarking " ; - int format_major ; - - if (! (data = malloc (BUFFER_SIZE * sizeof (double)))) - { perror ("Error : malloc failed") ; - exit (1) ; - } ; - - sf_command (NULL, SFC_GET_LIB_VERSION, buffer + strlen (buffer), sizeof (buffer) - strlen (buffer)) ; - - puts (buffer) ; - memset (buffer, '-', strlen (buffer)) ; - puts (buffer) ; - printf ("Each test takes a little over %d seconds.\n\n", TEST_DURATION) ; - - calc_raw_performance (&stats) ; - - if (argc < 2 || strcmp ("--native-only", argv [1]) == 0) - { puts ("\nNative endian I/O :") ; - format_major = cpu_is_big_endian () ? SF_FORMAT_AIFF : SF_FORMAT_WAV ; - - calc_short_performance (format_major | SF_FORMAT_PCM_16, stats.read_rate, stats.write_rate) ; - calc_int_performance (format_major | SF_FORMAT_PCM_24, stats.read_rate, stats.write_rate) ; - calc_int_performance (format_major | SF_FORMAT_PCM_32, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_16, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_24, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_32, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_FLOAT , stats.read_rate, stats.write_rate) ; - } ; - - if (argc < 2 || strcmp ("--swap-only", argv [1]) == 0) - { puts ("\nEndian swapped I/O :") ; - format_major = cpu_is_big_endian () ? SF_FORMAT_WAV : SF_FORMAT_AIFF ; - - calc_short_performance (format_major | SF_FORMAT_PCM_16, stats.read_rate, stats.write_rate) ; - calc_int_performance (format_major | SF_FORMAT_PCM_24, stats.read_rate, stats.write_rate) ; - calc_int_performance (format_major | SF_FORMAT_PCM_32, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_16, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_24, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_PCM_32, stats.read_rate, stats.write_rate) ; - calc_float_performance (format_major | SF_FORMAT_FLOAT , stats.read_rate, stats.write_rate) ; - } ; - - puts ("") ; - - free (data) ; - - return 0 ; -} /* main */ - -/*============================================================================== -*/ - -static void -calc_raw_performance (PERF_STATS *stats) -{ clock_t start_clock, clock_time ; - int fd, k, byte_count, retval, op_count ; - const char *filename ; - - filename = "benchmark.dat" ; - - byte_count = BUFFER_SIZE * sizeof (short) ; - - /* Collect write stats */ - printf (" Raw write PCM_16 : ") ; - fflush (stdout) ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if ((fd = open (filename, WRITE_FLAGS, WRITE_PERMS)) < 0) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = write (fd, data, byte_count)) != byte_count) - { printf ("Error : write returned %d (should have been %d)\n", retval, byte_count) ; - exit (1) ; - } ; - } ; - - close (fd) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - stats->write_rate = (1.0 * BUFFER_SIZE) * BLOCK_COUNT * op_count ; - stats->write_rate *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%10.0f samples per sec\n", stats->write_rate) ; - - /* Collect read stats */ - printf (" Raw read PCM_16 : ") ; - fflush (stdout) ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if ((fd = open (filename, READ_FLAGS)) < 0) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = read (fd, data, byte_count)) != byte_count) - { printf ("Error : write returned %d (should have been %d)\n", retval, byte_count) ; - exit (1) ; - } ; - } ; - - close (fd) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - stats->read_rate = (1.0 * BUFFER_SIZE) * BLOCK_COUNT * op_count ; - stats->read_rate *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%10.0f samples per sec\n", stats->read_rate) ; - - unlink (filename) ; -} /* calc_raw_performance */ - -/*------------------------------------------------------------------------------ -*/ - -[+ FOR data_type -+]static void -calc_[+ (get "type_name") +]_performance (int format, double read_rate, double write_rate) -{ SNDFILE *file ; - SF_INFO sfinfo ; - clock_t start_clock, clock_time ; - double performance ; - int k, item_count, retval, op_count ; - const char* subtype ; - [+ (get "type_name") +] *[+ (get "type_name") +]_data ; - const char *filename ; - - filename = "benchmark.dat" ; - subtype = get_subtype_str (format & SF_FORMAT_SUBMASK) ; - - [+ (get "type_name") +]_data = data ; - item_count = BUFFER_SIZE ; - for (k = 0 ; k < item_count ; k++) - [+ (get "type_name") +]_data [k] = [+ (get "multiplier") +] * sin (2 * M_PI * k / 32000.0) ; - - /* Collect write stats */ - printf (" Write %-5s to %s : ", "[+ (get "type_name") +]", subtype) ; - fflush (stdout) ; - - sfinfo.channels = 1 ; - sfinfo.format = format ; - sfinfo.frames = 1 ; - sfinfo.samplerate = 32000 ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if (! (file = sf_open (filename, SFM_WRITE, &sfinfo))) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - /* Turn off the addition of a PEAK chunk. */ - sf_command (file, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = sf_write_[+ (get "type_name") +] (file, [+ (get "type_name") +]_data, item_count)) != item_count) - { printf ("Error : sf_write_short returned %d (should have been %d)\n", retval, item_count) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - performance = (1.0 * BUFFER_SIZE) * BLOCK_COUNT * op_count ; - performance *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%6.2f%% of raw write\n", 100.0 * performance / write_rate) ; - - /* Collect read stats */ - printf (" Read %-5s from %s : ", "[+ (get "type_name") +]", subtype) ; - fflush (stdout) ; - - clock_time = 0 ; - op_count = 0 ; - start_clock = clock () ; - - while (clock_time < (CLOCKS_PER_SEC * TEST_DURATION)) - { if (! (file = sf_open (filename, SFM_READ, &sfinfo))) - { printf ("Error : not able to open file : %s\n", filename) ; - perror ("") ; - exit (1) ; - } ; - - for (k = 0 ; k < BLOCK_COUNT ; k++) - { if ((retval = sf_read_[+ (get "type_name") +] (file, [+ (get "type_name") +]_data, item_count)) != item_count) - { printf ("Error : write returned %d (should have been %d)\n", retval, item_count) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - clock_time = clock () - start_clock ; - op_count ++ ; - } ; - - performance = (1.0 * item_count) * BLOCK_COUNT * op_count ; - performance *= (1.0 * CLOCKS_PER_SEC) / clock_time ; - printf ("%6.2f%% of raw read\n", 100.0 * performance / read_rate) ; - - unlink (filename) ; - -} /* calc_[+ (get "type_name") +]_performance */ -[+ ENDFOR data_type -+] - -/*============================================================================== -*/ - -static int -cpu_is_big_endian (void) -{ unsigned char *cptr ; - int endtest ; - - endtest = 0x12345678 ; - - cptr = (unsigned char*) (&endtest) ; - - if (cptr [0] == 0x12 && cptr [1] == 0x34 && cptr [3] == 0x78) - return SF_TRUE ; - - return SF_FALSE ; -} /* cpu_is_big_endian */ - -static const char* -get_subtype_str (int subtype) -{ switch (subtype) - { case SF_FORMAT_PCM_16 : - return "PCM_16" ; - - case SF_FORMAT_PCM_24 : - return "PCM_24" ; - - case SF_FORMAT_PCM_32 : - return "PCM_32" ; - - case SF_FORMAT_FLOAT : - return "FLOAT " ; - - case SF_FORMAT_DOUBLE : - return "DOUBLE" ; - - default : break ; - } ; - - return "UNKNOWN" ; -} /* get_subtype_str */ - diff --git a/libs/libsndfile/tests/channel_test.c b/libs/libsndfile/tests/channel_test.c deleted file mode 100644 index 8a69734389..0000000000 --- a/libs/libsndfile/tests/channel_test.c +++ /dev/null @@ -1,134 +0,0 @@ -/* -** Copyright (C) 2001-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include - -#include "utils.h" - -#define BUFFER_LEN (1 << 10) -#define LOG_BUFFER_SIZE 1024 - -static void channel_test (void) ; -static double max_diff (const float *a, const float *b, int len) ; - -int -main (void) // int argc, char *argv []) -{ channel_test () ; - return 0 ; -} /* main */ - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -channel_test (void) -{ static float float_data [1024] ; - static float read_float [1024] ; - static int read_int [1024] ; - static short read_short [1024] ; - unsigned int ch, k ; - - gen_windowed_sine_float (float_data, ARRAY_LEN (float_data), 0.9) ; - - for (ch = 1 ; ch <= 8 ; ch++) - { SNDFILE *file ; - SF_INFO wsfinfo, rsfinfo ; - sf_count_t wframes = ARRAY_LEN (float_data) / ch ; - double maxdiff ; - char filename [256] ; - - snprintf (filename, sizeof (filename), "chan_%d.wav", ch) ; - print_test_name (__func__, filename) ; - - sf_info_setup (&wsfinfo, SF_FORMAT_WAV | SF_FORMAT_FLOAT, 48000, ch) ; - sf_info_clear (&rsfinfo) ; - - /* Write the test file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &wsfinfo, SF_FALSE, __LINE__) ; - test_writef_float_or_die (file, 0, float_data, wframes, __LINE__) ; - sf_close (file) ; - - /* Read it as float and test. */ - file = test_open_file_or_die (filename, SFM_READ, &rsfinfo, SF_FALSE, __LINE__) ; - exit_if_true (rsfinfo.frames == 0, - "\n\nLine %d : Frames in file %" PRId64 ".\n\n", __LINE__, rsfinfo.frames) ; - exit_if_true (wframes != rsfinfo.frames, - "\n\nLine %d : Wrote %" PRId64 ", read %" PRId64 " frames.\n\n", __LINE__, wframes, rsfinfo.frames) ; - - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - test_readf_float_or_die (file, 0, read_float, rsfinfo.frames, __LINE__) ; - compare_float_or_die (float_data, read_float, ch * rsfinfo.frames, __LINE__) ; - - /* Read it as short and test. */ - test_seek_or_die (file, 0, SEEK_SET, 0, ch, __LINE__) ; - test_readf_short_or_die (file, 0, read_short, rsfinfo.frames, __LINE__) ; - - for (k = 0 ; k < ARRAY_LEN (read_float) ; k++) - read_float [k] = read_short [k] * (0.9 / 0x8000) ; - - maxdiff = max_diff (float_data, read_float, ch * rsfinfo.frames) ; - exit_if_true (maxdiff > 0.5, "\n\nLine %d : Max diff is %f\n\n", __LINE__, maxdiff) ; - - /* Read it as int and test. */ - test_seek_or_die (file, 0, SEEK_SET, 0, ch, __LINE__) ; - test_readf_int_or_die (file, 0, read_int, rsfinfo.frames, __LINE__) ; - - for (k = 0 ; k < ARRAY_LEN (read_float) ; k++) - read_float [k] = read_int [k] * (0.9 / 0x80000000) ; - - maxdiff = max_diff (float_data, read_float, ch * rsfinfo.frames) ; - exit_if_true (maxdiff > 0.5, "\n\nLine %d : Max diff is %f\n\n", __LINE__, maxdiff) ; - - sf_close (file) ; - unlink (filename) ; - printf ("ok\n") ; - } ; - - return ; -} /* channel_test */ - -static double -max_diff (const float *a, const float *b, int len) -{ double mdiff = 0.0, diff ; - int k ; - - for (k = 0 ; k < len ; k++) - { diff = fabs (a [k] - b [k]) ; - mdiff = diff > mdiff ? diff : mdiff ; - // printf ("%4d: % f % f % f % f\n", k, a [k], b [k], diff, mdiff) ; - } ; - - return mdiff ; -} /* max_diff */ diff --git a/libs/libsndfile/tests/checksum_test.c b/libs/libsndfile/tests/checksum_test.c deleted file mode 100644 index 544da93408..0000000000 --- a/libs/libsndfile/tests/checksum_test.c +++ /dev/null @@ -1,128 +0,0 @@ -/* -** Copyright (C) 2008-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include - -#include "utils.h" - -#define SAMPLE_RATE 8000 - -typedef struct -{ int enc_fmt ; - - const char * enc_name ; - const char * dec_name ; - - uint64_t enc_cksum ; - uint64_t dec_cksum ; -} CHECKSUM ; - -static CHECKSUM -checksum_orig [] = -{ - { SF_FORMAT_RAW | SF_FORMAT_ULAW, - "checksum.ulaw", "cksum_ulaw.pcm16", - 0x33aefae029e0c888LL, 0x595cd6e47edd0cffLL - }, - { SF_FORMAT_RAW | SF_FORMAT_ALAW, - "checksum.alaw", "cksum_alaw.pcm16", - 0x48c798da3572d468LL, 0x6837d74869af5bb6LL - }, - { SF_FORMAT_RAW | SF_FORMAT_GSM610, - "checksum.gsm", "cksum_gsm.pcm16", - 0x1b1f64ff2acf858fLL, 0x504179dbadd4bce6LL - }, - { SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, - "checksum.vox", "cksum_vox.pcm16", - 0xf1147fb3a298f4dfLL, 0xfc9c0cb8b12cb0abLL - }, -} ; - -static void checksum_test (const CHECKSUM * cksum) ; - -static float orig [1 << 14] ; -static short data [1 << 14] ; - -int -main (void) -{ unsigned k ; - - gen_windowed_sine_float (orig, ARRAY_LEN (orig), 0.9) ; - - for (k = 0 ; k < ARRAY_LEN (checksum_orig) ; k++) - checksum_test (&checksum_orig [k]) ; - - return 0 ; -} /* main */ - -/*============================================================================== -*/ - -static void -checksum_test (const CHECKSUM * cksum) -{ SNDFILE * file ; - SF_INFO info ; - - print_test_name (__func__, cksum->enc_name) ; - - info.format = cksum->enc_fmt ; - info.channels = 1 ; - info.samplerate = SAMPLE_RATE ; - - file = test_open_file_or_die (cksum->enc_name, SFM_WRITE, &info, 0, __LINE__) ; - test_write_float_or_die (file, 0, orig, ARRAY_LEN (orig), __LINE__) ; - sf_close (file) ; - - check_file_hash_or_die (cksum->enc_name, cksum->enc_cksum, __LINE__) ; - puts ("ok") ; - - /*------------------------------------------------------------------------*/ - - print_test_name (__func__, cksum->dec_name) ; - - info.format = cksum->enc_fmt ; - info.channels = 1 ; - info.samplerate = SAMPLE_RATE ; - - file = test_open_file_or_die (cksum->enc_name, SFM_READ, &info, 0, __LINE__) ; - test_read_short_or_die (file, 0, data, ARRAY_LEN (data), __LINE__) ; - sf_close (file) ; - - info.format = SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_16 ; - info.channels = 1 ; - info.samplerate = SAMPLE_RATE ; - - file = test_open_file_or_die (cksum->dec_name, SFM_WRITE, &info, 0, __LINE__) ; - test_write_short_or_die (file, 0, data, ARRAY_LEN (data), __LINE__) ; - sf_close (file) ; - - check_file_hash_or_die (cksum->dec_name, cksum->dec_cksum, __LINE__) ; - - remove (cksum->enc_name) ; - remove (cksum->dec_name) ; - - puts ("ok") ; -} /* checksum_test */ - diff --git a/libs/libsndfile/tests/chunk_test.c b/libs/libsndfile/tests/chunk_test.c deleted file mode 100644 index 5a036b1e07..0000000000 --- a/libs/libsndfile/tests/chunk_test.c +++ /dev/null @@ -1,293 +0,0 @@ -/* -** Copyright (C) 2003-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_LEN (1 << 10) -#define LOG_BUFFER_SIZE 1024 - -static void chunk_test (const char *filename, int format) ; - -static void -chunk_test_helper (const char *filename, int format, const char * testdata) ; - -int -main (int argc, char *argv []) -{ int do_all = 0 ; - int test_count = 0 ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" wav - test adding chunks to WAV files\n") ; - printf (" aiff - test adding chunks to AIFF files\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all = ! strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "wav")) - { chunk_test ("chunks_pcm16.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - chunk_test ("chunks_pcm16.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - chunk_test ("chunks_pcm16.wavex", SF_FORMAT_WAVEX | SF_FORMAT_PCM_16) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { chunk_test ("chunks_pcm16.aiff", SF_FORMAT_AIFF | SF_FORMAT_PCM_16) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "caf")) - { chunk_test ("chunks_pcm16.caf", SF_FORMAT_CAF | SF_FORMAT_PCM_16) ; - chunk_test ("chunks_alac.caf", SF_FORMAT_CAF | SF_FORMAT_ALAC_16) ; - test_count++ ; - } ; - - if (test_count == 0) - { printf ("Mono : ************************************\n") ; - printf ("Mono : * No '%s' test defined.\n", argv [1]) ; - printf ("Mono : ************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -chunk_test_helper (const char *filename, int format, const char * testdata) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_CHUNK_INFO chunk_info ; - SF_CHUNK_ITERATOR * iterator ; - uint32_t length_before ; - int err, allow_fd ; - - switch (format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_ALAC_16 : - allow_fd = SF_FALSE ; - break ; - default : - allow_fd = SF_TRUE ; - break ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - sfinfo.format = format ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - /* Set up the chunk to write. */ - memset (&chunk_info, 0, sizeof (chunk_info)) ; - snprintf (chunk_info.id, sizeof (chunk_info.id), "Test") ; - chunk_info.id_size = 4 ; - chunk_info.data = strdup (testdata) ; - chunk_info.datalen = strlen (chunk_info.data) ; - - length_before = chunk_info.datalen ; - - err = sf_set_chunk (file, &chunk_info) ; - exit_if_true ( - err != SF_ERR_NO_ERROR, - "\n\nLine %d : sf_set_chunk returned for testdata '%s' : %s\n\n", __LINE__, testdata, sf_error_number (err) - ) ; - - memset (chunk_info.data, 0, chunk_info.datalen) ; - free (chunk_info.data) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - memset (&chunk_info, 0, sizeof (chunk_info)) ; - snprintf (chunk_info.id, sizeof (chunk_info.id), "Test") ; - chunk_info.id_size = 4 ; - - iterator = sf_get_chunk_iterator (file, &chunk_info) ; - err = sf_get_chunk_size (iterator, &chunk_info) ; - exit_if_true ( - err != SF_ERR_NO_ERROR, - "\n\nLine %d : sf_get_chunk_size returned for testdata '%s' : %s\n\n", __LINE__, testdata, sf_error_number (err) - ) ; - - exit_if_true ( - length_before > chunk_info.datalen || chunk_info.datalen - length_before > 4, - "\n\nLine %d : testdata '%s' : Bad chunk length %u (previous length %u)\n\n", __LINE__, testdata, chunk_info.datalen, length_before - ) ; - - chunk_info.data = malloc (chunk_info.datalen) ; - err = sf_get_chunk_data (iterator, &chunk_info) ; - exit_if_true ( - err != SF_ERR_NO_ERROR, - "\n\nLine %d : sf_get_chunk_size returned for testdata '%s' : %s\n\n", __LINE__, testdata, sf_error_number (err) - ) ; - - exit_if_true ( - memcmp (testdata, chunk_info.data, length_before), - "\n\nLine %d : Data compare failed.\n %s\n %s\n\n", __LINE__, testdata, (char*) chunk_info.data - ) ; - - free (chunk_info.data) ; - - sf_close (file) ; - unlink (filename) ; -} /* chunk_test_helper */ - -static void -multichunk_test_helper (const char *filename, int format, const char * testdata [], size_t testdata_len) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_CHUNK_INFO chunk_info ; - SF_CHUNK_ITERATOR * iterator ; - uint32_t length_before [testdata_len] ; - int err, allow_fd ; - size_t i ; - - sfinfo.samplerate = 44100 ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - sfinfo.format = format ; - - switch (format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_ALAC_16 : - allow_fd = SF_FALSE ; - break ; - default : - allow_fd = SF_TRUE ; - break ; - } ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - /* Set up the chunk to write. */ - for (i = 0 ; i < testdata_len ; i++) - { memset (&chunk_info, 0, sizeof (chunk_info)) ; - snprintf (chunk_info.id, sizeof (chunk_info.id), "Test") ; - chunk_info.id_size = 4 ; - - chunk_info.data = strdup (testdata [i]) ; - chunk_info.datalen = strlen (chunk_info.data) ; - - length_before [i] = chunk_info.datalen ; - - err = sf_set_chunk (file, &chunk_info) ; - exit_if_true ( - err != SF_ERR_NO_ERROR, - "\n\nLine %d : sf_set_chunk returned for testdata[%d] '%s' : %s\n\n", __LINE__, (int) i, testdata [i], sf_error_number (err) - ) ; - - memset (chunk_info.data, 0, chunk_info.datalen) ; - free (chunk_info.data) ; - } - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - memset (&chunk_info, 0, sizeof (chunk_info)) ; - snprintf (chunk_info.id, sizeof (chunk_info.id), "Test") ; - chunk_info.id_size = 4 ; - - iterator = sf_get_chunk_iterator (file, &chunk_info) ; - - i = 0 ; - while (iterator) - { memset (&chunk_info, 0, sizeof (chunk_info)) ; - err = sf_get_chunk_size (iterator, &chunk_info) ; - exit_if_true ( - i > testdata_len, - "\n\nLine %d : iterated to chunk #%d, but only %d chunks have been written\n\n", __LINE__, (int) i, (int) testdata_len - ) ; - - exit_if_true ( - err != SF_ERR_NO_ERROR, - "\n\nLine %d : sf_get_chunk_size returned for testdata[%d] '%s' : %s\n\n", __LINE__, (int) i, testdata [i], sf_error_number (err) - ) ; - - exit_if_true ( - length_before [i] > chunk_info.datalen || chunk_info.datalen - length_before [i] > 4, - "\n\nLine %d : testdata[%d] '%s' : Bad chunk length %u (previous length %u)\n\n", __LINE__, (int) i, testdata [i], chunk_info.datalen, length_before [i] - ) ; - - chunk_info.data = malloc (chunk_info.datalen) ; - err = sf_get_chunk_data (iterator, &chunk_info) ; - exit_if_true ( - err != SF_ERR_NO_ERROR, - "\n\nLine %d : sf_get_chunk_size returned for testdata[%d] '%s' : %s\n\n", __LINE__, (int) i, testdata [i], sf_error_number (err) - ) ; - - exit_if_true ( - 4 != chunk_info.id_size, - "\n\nLine %d : testdata[%d] : Bad ID length %u (previous length %u)\n\n", __LINE__, (int) i, chunk_info.id_size, 4 - ) ; - exit_if_true ( - memcmp ("Test", chunk_info.id, 4), - "\n\nLine %d : ID compare failed at %d.\n %s\n %s\n\n", __LINE__, (int) i, "Test", (char*) chunk_info.id - ) ; - - exit_if_true ( - memcmp (testdata [i], chunk_info.data, length_before [i]), - "\n\nLine %d : Data compare failed at %d.\n %s\n %s\n\n", __LINE__, (int) i, testdata [i], (char*) chunk_info.data - ) ; - - free (chunk_info.data) ; - iterator = sf_next_chunk_iterator (iterator) ; - i++ ; - } - - sf_close (file) ; - unlink (filename) ; -} /* multichunk_test_helper */ - - -static void -chunk_test (const char *filename, int format) -{ const char* testdata [] = - { "There can be only one.", "", "A", "AB", "ABC", "ABCD", "ABCDE" } ; - uint32_t k ; - - print_test_name (__func__, filename) ; - - for (k = 0 ; k < ARRAY_LEN (testdata) ; k++) - chunk_test_helper (filename, format, testdata [k]) ; - - multichunk_test_helper (filename, format, testdata, ARRAY_LEN (testdata)) ; - - puts ("ok") ; -} /* chunk_test */ diff --git a/libs/libsndfile/tests/command_test.c b/libs/libsndfile/tests/command_test.c deleted file mode 100644 index 9e6bfd485b..0000000000 --- a/libs/libsndfile/tests/command_test.c +++ /dev/null @@ -1,1570 +0,0 @@ -/* -** Copyright (C) 2001-2013 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include - -#include "utils.h" - -#define BUFFER_LEN (1 << 10) -#define LOG_BUFFER_SIZE 1024 - -static void float_norm_test (const char *filename) ; -static void double_norm_test (const char *filename) ; -static void format_tests (void) ; -static void calc_peak_test (int filetype, const char *filename) ; -static void truncate_test (const char *filename, int filetype) ; -static void instrument_test (const char *filename, int filetype) ; -static void channel_map_test (const char *filename, int filetype) ; -static void current_sf_info_test (const char *filename) ; -static void raw_needs_endswap_test (const char *filename, int filetype) ; - -static void broadcast_test (const char *filename, int filetype) ; -static void broadcast_rdwr_test (const char *filename, int filetype) ; -static void broadcast_coding_history_test (const char *filename) ; -static void broadcast_coding_history_size (const char *filename) ; - -/* Cart Chunk tests */ -static void cart_test (const char *filename, int filetype) ; -static void cart_rdwr_test (const char *filename, int filetype) ; - -/* Force the start of this buffer to be double aligned. Sparc-solaris will -** choke if its not. -*/ - -static int int_data [BUFFER_LEN] ; -static float float_data [BUFFER_LEN] ; -static double double_data [BUFFER_LEN] ; - -int -main (int argc, char *argv []) -{ int do_all = 0 ; - int test_count = 0 ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" ver - test sf_command (SFC_GETLIB_VERSION)\n") ; - printf (" norm - test floating point normalisation\n") ; - printf (" format - test format string commands\n") ; - printf (" peak - test peak calculation\n") ; - printf (" trunc - test file truncation\n") ; - printf (" inst - test set/get of SF_INSTRUMENT.\n") ; - printf (" chanmap - test set/get of channel map data..\n") ; - printf (" bext - test set/get of SF_BROADCAST_INFO.\n") ; - printf (" bextch - test set/get of SF_BROADCAST_INFO coding_history.\n") ; - printf (" cart - test set/get of SF_CART_INFO.\n") ; - printf (" rawend - test SFC_RAW_NEEDS_ENDSWAP.\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all = ! strcmp (argv [1], "all") ; - - if (do_all || strcmp (argv [1], "ver") == 0) - { char buffer [128] ; - - print_test_name ("version_test", "(none)") ; - buffer [0] = 0 ; - sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; - if (strlen (buffer) < 1) - { printf ("Line %d: could not retrieve lib version.\n", __LINE__) ; - exit (1) ; - } ; - puts ("ok") ; - test_count ++ ; - } ; - - if (do_all || strcmp (argv [1], "norm") == 0) - { /* Preliminary float/double normalisation tests. More testing - ** is done in the program 'floating_point_test'. - */ - float_norm_test ("float.wav") ; - double_norm_test ("double.wav") ; - test_count ++ ; - } ; - - if (do_all || strcmp (argv [1], "peak") == 0) - { calc_peak_test (SF_ENDIAN_BIG | SF_FORMAT_RAW, "be-peak.raw") ; - calc_peak_test (SF_ENDIAN_LITTLE | SF_FORMAT_RAW, "le-peak.raw") ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "format")) - { format_tests () ; - test_count ++ ; - } ; - - if (do_all || strcmp (argv [1], "trunc") == 0) - { truncate_test ("truncate.raw", SF_FORMAT_RAW | SF_FORMAT_PCM_32) ; - truncate_test ("truncate.au" , SF_FORMAT_AU | SF_FORMAT_PCM_16) ; - test_count ++ ; - } ; - - if (do_all || strcmp (argv [1], "inst") == 0) - { instrument_test ("instrument.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - instrument_test ("instrument.aiff" , SF_FORMAT_AIFF | SF_FORMAT_PCM_24) ; - /*-instrument_test ("instrument.xi", SF_FORMAT_XI | SF_FORMAT_DPCM_16) ;-*/ - test_count ++ ; - } ; - - if (do_all || strcmp (argv [1], "current_sf_info") == 0) - { current_sf_info_test ("current.wav") ; - test_count ++ ; - } ; - - if (do_all || strcmp (argv [1], "bext") == 0) - { broadcast_test ("broadcast.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - broadcast_rdwr_test ("broadcast.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - - broadcast_test ("broadcast.wavex", SF_FORMAT_WAVEX | SF_FORMAT_PCM_16) ; - broadcast_rdwr_test ("broadcast.wavex", SF_FORMAT_WAVEX | SF_FORMAT_PCM_16) ; - - broadcast_test ("broadcast.rf64", SF_FORMAT_RF64 | SF_FORMAT_PCM_16) ; - broadcast_rdwr_test ("broadcast.rf64", SF_FORMAT_RF64 | SF_FORMAT_PCM_16) ; - test_count ++ ; - } ; - - if (do_all || strcmp (argv [1], "cart") == 0) - { cart_test ("cart.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - cart_rdwr_test ("cart.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - cart_test ("cart.rf64", SF_FORMAT_RF64 | SF_FORMAT_PCM_16) ; - cart_rdwr_test ("cart.rf64", SF_FORMAT_RF64 | SF_FORMAT_PCM_16) ; - test_count ++ ; - } ; - - if (do_all || strcmp (argv [1], "bextch") == 0) - { broadcast_coding_history_test ("coding_history.wav") ; - broadcast_coding_history_size ("coding_hist_size.wav") ; - test_count ++ ; - } ; - - if (do_all || strcmp (argv [1], "chanmap") == 0) - { channel_map_test ("chanmap.wavex", SF_FORMAT_WAVEX | SF_FORMAT_PCM_16) ; - channel_map_test ("chanmap.rf64", SF_FORMAT_RF64 | SF_FORMAT_PCM_16) ; - channel_map_test ("chanmap.aifc" , SF_FORMAT_AIFF | SF_FORMAT_PCM_16) ; - channel_map_test ("chanmap.caf" , SF_FORMAT_CAF | SF_FORMAT_PCM_16) ; - test_count ++ ; - } ; - - if (do_all || strcmp (argv [1], "rawend") == 0) - { raw_needs_endswap_test ("raw_end.wav", SF_FORMAT_WAV) ; - raw_needs_endswap_test ("raw_end.wavex", SF_FORMAT_WAVEX) ; - raw_needs_endswap_test ("raw_end.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV) ; - raw_needs_endswap_test ("raw_end.aiff", SF_FORMAT_AIFF) ; - raw_needs_endswap_test ("raw_end.aiff_le", SF_ENDIAN_LITTLE | SF_FORMAT_AIFF) ; - test_count ++ ; - } ; - - if (test_count == 0) - { printf ("Mono : ************************************\n") ; - printf ("Mono : * No '%s' test defined.\n", argv [1]) ; - printf ("Mono : ************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -float_norm_test (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - unsigned int k ; - - print_test_name ("float_norm_test", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = (SF_FORMAT_RAW | SF_FORMAT_PCM_16) ; - sfinfo.channels = 1 ; - sfinfo.frames = BUFFER_LEN ; - - /* Create float_data with all values being less than 1.0. */ - for (k = 0 ; k < BUFFER_LEN / 2 ; k++) - float_data [k] = (k + 5) / (2.0 * BUFFER_LEN) ; - for (k = BUFFER_LEN / 2 ; k < BUFFER_LEN ; k++) - float_data [k] = (k + 5) ; - - if (! (file = sf_open (filename, SFM_WRITE, &sfinfo))) - { printf ("Line %d: sf_open_write failed with error : ", __LINE__) ; - fflush (stdout) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - /* Normalisation is on by default so no need to do anything here. */ - - if ((k = sf_write_float (file, float_data, BUFFER_LEN / 2)) != BUFFER_LEN / 2) - { printf ("Line %d: sf_write_float failed with short write (%d ->%d)\n", __LINE__, BUFFER_LEN, k) ; - exit (1) ; - } ; - - /* Turn normalisation off. */ - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - if ((k = sf_write_float (file, float_data + BUFFER_LEN / 2, BUFFER_LEN / 2)) != BUFFER_LEN / 2) - { printf ("Line %d: sf_write_float failed with short write (%d ->%d)\n", __LINE__, BUFFER_LEN, k) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* sfinfo struct should still contain correct data. */ - if (! (file = sf_open (filename, SFM_READ, &sfinfo))) - { printf ("Line %d: sf_open_read failed with error : ", __LINE__) ; - fflush (stdout) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - if (sfinfo.format != (SF_FORMAT_RAW | SF_FORMAT_PCM_16)) - { printf ("Line %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, (SF_FORMAT_RAW | SF_FORMAT_PCM_16), sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_LEN) - { printf ("\n\nLine %d: Incorrect number of.frames in file. (%d => %" PRId64 ")\n", __LINE__, BUFFER_LEN, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("Line %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - /* Read float_data and check that it is normalised (ie default). */ - if ((k = sf_read_float (file, float_data, BUFFER_LEN)) != BUFFER_LEN) - { printf ("\n\nLine %d: sf_read_float failed with short read (%d ->%d)\n", __LINE__, BUFFER_LEN, k) ; - exit (1) ; - } ; - - for (k = 0 ; k < BUFFER_LEN ; k++) - if (float_data [k] >= 1.0) - { printf ("\n\nLine %d: float_data [%d] == %f which is greater than 1.0\n", __LINE__, k, float_data [k]) ; - exit (1) ; - } ; - - /* Seek to start of file, turn normalisation off, read float_data and check again. */ - sf_seek (file, 0, SEEK_SET) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - if ((k = sf_read_float (file, float_data, BUFFER_LEN)) != BUFFER_LEN) - { printf ("\n\nLine %d: sf_read_float failed with short read (%d ->%d)\n", __LINE__, BUFFER_LEN, k) ; - exit (1) ; - } ; - - for (k = 0 ; k < BUFFER_LEN ; k++) - if (float_data [k] < 1.0) - { printf ("\n\nLine %d: float_data [%d] == %f which is less than 1.0\n", __LINE__, k, float_data [k]) ; - exit (1) ; - } ; - - /* Seek to start of file, turn normalisation on, read float_data and do final check. */ - sf_seek (file, 0, SEEK_SET) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_TRUE) ; - - if ((k = sf_read_float (file, float_data, BUFFER_LEN)) != BUFFER_LEN) - { printf ("\n\nLine %d: sf_read_float failed with short read (%d ->%d)\n", __LINE__, BUFFER_LEN, k) ; - exit (1) ; - } ; - - for (k = 0 ; k < BUFFER_LEN ; k++) - if (float_data [k] > 1.0) - { printf ("\n\nLine %d: float_data [%d] == %f which is greater than 1.0\n", __LINE__, k, float_data [k]) ; - exit (1) ; - } ; - - - sf_close (file) ; - - unlink (filename) ; - - printf ("ok\n") ; -} /* float_norm_test */ - -static void -double_norm_test (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - unsigned int k ; - - print_test_name ("double_norm_test", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = (SF_FORMAT_RAW | SF_FORMAT_PCM_16) ; - sfinfo.channels = 1 ; - sfinfo.frames = BUFFER_LEN ; - - /* Create double_data with all values being less than 1.0. */ - for (k = 0 ; k < BUFFER_LEN / 2 ; k++) - double_data [k] = (k + 5) / (2.0 * BUFFER_LEN) ; - for (k = BUFFER_LEN / 2 ; k < BUFFER_LEN ; k++) - double_data [k] = (k + 5) ; - - if (! (file = sf_open (filename, SFM_WRITE, &sfinfo))) - { printf ("Line %d: sf_open_write failed with error : ", __LINE__) ; - fflush (stdout) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - /* Normailsation is on by default so no need to do anything here. */ - /*-sf_command (file, "set-norm-double", "true", 0) ;-*/ - - if ((k = sf_write_double (file, double_data, BUFFER_LEN / 2)) != BUFFER_LEN / 2) - { printf ("Line %d: sf_write_double failed with short write (%d ->%d)\n", __LINE__, BUFFER_LEN, k) ; - exit (1) ; - } ; - - /* Turn normalisation off. */ - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - if ((k = sf_write_double (file, double_data + BUFFER_LEN / 2, BUFFER_LEN / 2)) != BUFFER_LEN / 2) - { printf ("Line %d: sf_write_double failed with short write (%d ->%d)\n", __LINE__, BUFFER_LEN, k) ; - exit (1) ; - } ; - - sf_close (file) ; - - if (! (file = sf_open (filename, SFM_READ, &sfinfo))) - { printf ("Line %d: sf_open_read failed with error : ", __LINE__) ; - fflush (stdout) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - if (sfinfo.format != (SF_FORMAT_RAW | SF_FORMAT_PCM_16)) - { printf ("Line %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, (SF_FORMAT_RAW | SF_FORMAT_PCM_16), sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_LEN) - { printf ("\n\nLine %d: Incorrect number of.frames in file. (%d => %" PRId64 ")\n", __LINE__, BUFFER_LEN, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("Line %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - /* Read double_data and check that it is normalised (ie default). */ - if ((k = sf_read_double (file, double_data, BUFFER_LEN)) != BUFFER_LEN) - { printf ("\n\nLine %d: sf_read_double failed with short read (%d ->%d)\n", __LINE__, BUFFER_LEN, k) ; - exit (1) ; - } ; - - for (k = 0 ; k < BUFFER_LEN ; k++) - if (double_data [k] >= 1.0) - { printf ("\n\nLine %d: double_data [%d] == %f which is greater than 1.0\n", __LINE__, k, double_data [k]) ; - exit (1) ; - } ; - - /* Seek to start of file, turn normalisation off, read double_data and check again. */ - sf_seek (file, 0, SEEK_SET) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - if ((k = sf_read_double (file, double_data, BUFFER_LEN)) != BUFFER_LEN) - { printf ("\n\nLine %d: sf_read_double failed with short read (%d ->%d)\n", __LINE__, BUFFER_LEN, k) ; - exit (1) ; - } ; - - for (k = 0 ; k < BUFFER_LEN ; k++) - if (double_data [k] < 1.0) - { printf ("\n\nLine %d: double_data [%d] == %f which is less than 1.0\n", __LINE__, k, double_data [k]) ; - exit (1) ; - } ; - - /* Seek to start of file, turn normalisation on, read double_data and do final check. */ - sf_seek (file, 0, SEEK_SET) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_TRUE) ; - - if ((k = sf_read_double (file, double_data, BUFFER_LEN)) != BUFFER_LEN) - { printf ("\n\nLine %d: sf_read_double failed with short read (%d ->%d)\n", __LINE__, BUFFER_LEN, k) ; - exit (1) ; - } ; - - for (k = 0 ; k < BUFFER_LEN ; k++) - if (double_data [k] > 1.0) - { printf ("\n\nLine %d: double_data [%d] == %f which is greater than 1.0\n", __LINE__, k, double_data [k]) ; - exit (1) ; - } ; - - - sf_close (file) ; - - unlink (filename) ; - - printf ("ok\n") ; -} /* double_norm_test */ - -static void -format_tests (void) -{ SF_FORMAT_INFO format_info ; - SF_INFO sfinfo ; - const char *last_name ; - int k, count ; - - print_test_name ("format_tests", "(null)") ; - - /* Clear out SF_INFO struct and set channels > 0. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.channels = 1 ; - - /* First test simple formats. */ - - sf_command (NULL, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof (int)) ; - - if (count < 0 || count > 30) - { printf ("Line %d: Weird count.\n", __LINE__) ; - exit (1) ; - } ; - - format_info.format = 0 ; - sf_command (NULL, SFC_GET_SIMPLE_FORMAT, &format_info, sizeof (format_info)) ; - - last_name = format_info.name ; - for (k = 1 ; k < count ; k ++) - { format_info.format = k ; - sf_command (NULL, SFC_GET_SIMPLE_FORMAT, &format_info, sizeof (format_info)) ; - if (strcmp (last_name, format_info.name) >= 0) - { printf ("\n\nLine %d: format names out of sequence `%s' < `%s'.\n", __LINE__, last_name, format_info.name) ; - exit (1) ; - } ; - sfinfo.format = format_info.format ; - - if (! sf_format_check (&sfinfo)) - { printf ("\n\nLine %d: sf_format_check failed.\n", __LINE__) ; - printf (" Name : %s\n", format_info.name) ; - printf (" Format : 0x%X\n", sfinfo.format) ; - printf (" Channels : 0x%X\n", sfinfo.channels) ; - printf (" Sample Rate : 0x%X\n", sfinfo.samplerate) ; - exit (1) ; - } ; - last_name = format_info.name ; - } ; - format_info.format = 666 ; - sf_command (NULL, SFC_GET_SIMPLE_FORMAT, &format_info, sizeof (format_info)) ; - - /* Now test major formats. */ - sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)) ; - - if (count < 0 || count > 30) - { printf ("Line %d: Weird count.\n", __LINE__) ; - exit (1) ; - } ; - - format_info.format = 0 ; - sf_command (NULL, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info)) ; - - last_name = format_info.name ; - for (k = 1 ; k < count ; k ++) - { format_info.format = k ; - sf_command (NULL, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info)) ; - if (strcmp (last_name, format_info.name) >= 0) - { printf ("\n\nLine %d: format names out of sequence (%d) `%s' < `%s'.\n", __LINE__, k, last_name, format_info.name) ; - exit (1) ; - } ; - - last_name = format_info.name ; - } ; - format_info.format = 666 ; - sf_command (NULL, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info)) ; - - /* Now test subtype formats. */ - sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ; - - if (count < 0 || count > 30) - { printf ("Line %d: Weird count.\n", __LINE__) ; - exit (1) ; - } ; - - format_info.format = 0 ; - sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ; - - last_name = format_info.name ; - for (k = 1 ; k < count ; k ++) - { format_info.format = k ; - sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ; - } ; - format_info.format = 666 ; - sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ; - - - printf ("ok\n") ; -} /* format_tests */ - -static void -calc_peak_test (int filetype, const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, format ; - double peak ; - - print_test_name ("calc_peak_test", filename) ; - - format = (filetype | SF_FORMAT_PCM_16) ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = format ; - sfinfo.channels = 1 ; - sfinfo.frames = BUFFER_LEN ; - - /* Create double_data with max value of 0.5. */ - for (k = 0 ; k < BUFFER_LEN ; k++) - double_data [k] = (k + 1) / (2.0 * BUFFER_LEN) ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != format) - { printf ("Line %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_LEN) - { printf ("\n\nLine %d: Incorrect number of.frames in file. (%d => %" PRId64 ")\n", __LINE__, BUFFER_LEN, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("Line %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - sf_command (file, SFC_CALC_SIGNAL_MAX, &peak, sizeof (peak)) ; - if (fabs (peak - (1 << 14)) > 1.0) - { printf ("Line %d : Peak value should be %d (is %f).\n", __LINE__, (1 << 14), peak) ; - exit (1) ; - } ; - - sf_command (file, SFC_CALC_NORM_SIGNAL_MAX, &peak, sizeof (peak)) ; - if (fabs (peak - 0.5) > 4e-5) - { printf ("Line %d : Peak value should be %f (is %f).\n", __LINE__, 0.5, peak) ; - exit (1) ; - } ; - - sf_close (file) ; - - format = (filetype | SF_FORMAT_FLOAT) ; - sfinfo.samplerate = 44100 ; - sfinfo.format = format ; - sfinfo.channels = 1 ; - sfinfo.frames = BUFFER_LEN ; - - /* Create double_data with max value of 0.5. */ - for (k = 0 ; k < BUFFER_LEN ; k++) - double_data [k] = (k + 1) / (2.0 * BUFFER_LEN) ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != format) - { printf ("Line %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_LEN) - { printf ("\n\nLine %d: Incorrect number of.frames in file. (%d => %" PRId64 ")\n", __LINE__, BUFFER_LEN, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("Line %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - sf_command (file, SFC_CALC_SIGNAL_MAX, &peak, sizeof (peak)) ; - if (fabs (peak - 0.5) > 1e-5) - { printf ("Line %d : Peak value should be %f (is %f).\n", __LINE__, 0.5, peak) ; - exit (1) ; - } ; - - sf_command (file, SFC_CALC_NORM_SIGNAL_MAX, &peak, sizeof (peak)) ; - if (fabs (peak - 0.5) > 1e-5) - { printf ("Line %d : Peak value should be %f (is %f).\n", __LINE__, 0.5, peak) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - - printf ("ok\n") ; -} /* calc_peak_test */ - -static void -truncate_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - sf_count_t len ; - - print_test_name ("truncate_test", filename) ; - - sfinfo.samplerate = 11025 ; - sfinfo.format = filetype ; - sfinfo.channels = 2 ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_int_or_die (file, 0, int_data, BUFFER_LEN, __LINE__) ; - - len = 100 ; - if (sf_command (file, SFC_FILE_TRUNCATE, &len, sizeof (len))) - { printf ("Line %d: sf_command (SFC_FILE_TRUNCATE) returned error.\n", __LINE__) ; - exit (1) ; - } ; - - test_seek_or_die (file, 0, SEEK_CUR, len, 2, __LINE__) ; - test_seek_or_die (file, 0, SEEK_END, len, 2, __LINE__) ; - - sf_close (file) ; - - unlink (filename) ; - puts ("ok") ; -} /* truncate_test */ - -/*------------------------------------------------------------------------------ -*/ - -static void -instrumet_rw_test (const char *filename) -{ SNDFILE *sndfile ; - SF_INFO sfinfo ; - SF_INSTRUMENT inst ; - memset (&sfinfo, 0, sizeof (SF_INFO)) ; - - sndfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_FALSE, __LINE__) ; - - if (sf_command (sndfile, SFC_GET_INSTRUMENT, &inst, sizeof (inst)) == SF_TRUE) - { inst.basenote = 22 ; - - if (sf_command (sndfile, SFC_SET_INSTRUMENT, &inst, sizeof (inst)) == SF_TRUE) - printf ("Sucess: [%s] updated\n", filename) ; - else - printf ("Error: SFC_SET_INSTRUMENT on [%s] [%s]\n", filename, sf_strerror (sndfile)) ; - } - else - printf ("Error: SFC_GET_INSTRUMENT on [%s] [%s]\n", filename, sf_strerror (sndfile)) ; - - - if (sf_command (sndfile, SFC_UPDATE_HEADER_NOW, NULL, 0) != 0) - printf ("Error: SFC_UPDATE_HEADER_NOW on [%s] [%s]\n", filename, sf_strerror (sndfile)) ; - - sf_write_sync (sndfile) ; - sf_close (sndfile) ; - - return ; -} /* instrumet_rw_test */ - -static void -instrument_test (const char *filename, int filetype) -{ static SF_INSTRUMENT write_inst = - { 2, /* gain */ - 3, /* detune */ - 4, /* basenote */ - 5, 6, /* key low and high */ - 7, 8, /* velocity low and high */ - 2, /* loop_count */ - { { 801, 2, 3, 0 }, - { 801, 3, 4, 0 }, - } - } ; - SF_INSTRUMENT read_inst ; - SNDFILE *file ; - SF_INFO sfinfo ; - - print_test_name ("instrument_test", filename) ; - - sfinfo.samplerate = 11025 ; - sfinfo.format = filetype ; - sfinfo.channels = 1 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_SET_INSTRUMENT, &write_inst, sizeof (write_inst)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_INSTRUMENT) failed.\n\n", __LINE__) ; - exit (1) ; - } ; - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - sf_close (file) ; - - memset (&read_inst, 0, sizeof (read_inst)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_GET_INSTRUMENT, &read_inst, sizeof (read_inst)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_GET_INSTRUMENT) failed.\n\n", __LINE__) ; - exit (1) ; - return ; - } ; - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - - if ((filetype & SF_FORMAT_TYPEMASK) == SF_FORMAT_WAV) - { /* - ** For all the fields that WAV doesn't support, modify the - ** write_inst struct to hold the default value that the WAV - ** module should hold. - */ - write_inst.detune = 0 ; - write_inst.key_lo = write_inst.velocity_lo = 0 ; - write_inst.key_hi = write_inst.velocity_hi = 127 ; - write_inst.gain = 1 ; - } ; - - if ((filetype & SF_FORMAT_TYPEMASK) == SF_FORMAT_XI) - { /* - ** For all the fields that XI doesn't support, modify the - ** write_inst struct to hold the default value that the XI - ** module should hold. - */ - write_inst.basenote = 0 ; - write_inst.detune = 0 ; - write_inst.key_lo = write_inst.velocity_lo = 0 ; - write_inst.key_hi = write_inst.velocity_hi = 127 ; - write_inst.gain = 1 ; - } ; - - if (memcmp (&write_inst, &read_inst, sizeof (write_inst)) != 0) - { printf ("\n\nLine %d : instrument comparison failed.\n\n", __LINE__) ; - printf ("W Base Note : %u\n" - " Detune : %u\n" - " Low Note : %u\tHigh Note : %u\n" - " Low Vel. : %u\tHigh Vel. : %u\n" - " Gain : %d\tCount : %d\n" - " mode : %d\n" - " start : %d\tend : %d\tcount :%d\n" - " mode : %d\n" - " start : %d\tend : %d\tcount :%d\n\n", - write_inst.basenote, - write_inst.detune, - write_inst.key_lo, write_inst.key_hi, - write_inst.velocity_lo, write_inst.velocity_hi, - write_inst.gain, write_inst.loop_count, - write_inst.loops [0].mode, write_inst.loops [0].start, - write_inst.loops [0].end, write_inst.loops [0].count, - write_inst.loops [1].mode, write_inst.loops [1].start, - write_inst.loops [1].end, write_inst.loops [1].count) ; - printf ("R Base Note : %u\n" - " Detune : %u\n" - " Low Note : %u\tHigh Note : %u\n" - " Low Vel. : %u\tHigh Vel. : %u\n" - " Gain : %d\tCount : %d\n" - " mode : %d\n" - " start : %d\tend : %d\tcount :%d\n" - " mode : %d\n" - " start : %d\tend : %d\tcount :%d\n\n", - read_inst.basenote, - read_inst.detune, - read_inst.key_lo, read_inst.key_hi, - read_inst.velocity_lo, read_inst.velocity_hi, - read_inst.gain, read_inst.loop_count, - read_inst.loops [0].mode, read_inst.loops [0].start, - read_inst.loops [0].end, read_inst.loops [0].count, - read_inst.loops [1].mode, read_inst.loops [1].start, - read_inst.loops [1].end, read_inst.loops [1].count) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_XI) - exit (1) ; - } ; - - if (0) instrumet_rw_test (filename) ; - - unlink (filename) ; - puts ("ok") ; -} /* instrument_test */ - -static void -current_sf_info_test (const char *filename) -{ SNDFILE *outfile, *infile ; - SF_INFO outinfo, ininfo ; - - print_test_name ("current_sf_info_test", filename) ; - - outinfo.samplerate = 44100 ; - outinfo.format = (SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - outinfo.channels = 1 ; - outinfo.frames = 0 ; - - outfile = test_open_file_or_die (filename, SFM_WRITE, &outinfo, SF_TRUE, __LINE__) ; - sf_command (outfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, 0) ; - - exit_if_true (outinfo.frames != 0, - "\n\nLine %d : Initial sfinfo.frames is not zero.\n\n", __LINE__ - ) ; - - test_write_double_or_die (outfile, 0, double_data, BUFFER_LEN, __LINE__) ; - sf_command (outfile, SFC_GET_CURRENT_SF_INFO, &outinfo, sizeof (outinfo)) ; - - exit_if_true (outinfo.frames != BUFFER_LEN, - "\n\nLine %d : Initial sfinfo.frames (%" PRId64 ") should be %d.\n\n", __LINE__, - outinfo.frames, BUFFER_LEN - ) ; - - /* Read file making sure no channel map exists. */ - memset (&ininfo, 0, sizeof (ininfo)) ; - infile = test_open_file_or_die (filename, SFM_READ, &ininfo, SF_TRUE, __LINE__) ; - - test_write_double_or_die (outfile, 0, double_data, BUFFER_LEN, __LINE__) ; - - sf_command (infile, SFC_GET_CURRENT_SF_INFO, &ininfo, sizeof (ininfo)) ; - - exit_if_true (ininfo.frames != BUFFER_LEN, - "\n\nLine %d : Initial sfinfo.frames (%" PRId64 ") should be %d.\n\n", __LINE__, - ininfo.frames, BUFFER_LEN - ) ; - - sf_close (outfile) ; - sf_close (infile) ; - - unlink (filename) ; - puts ("ok") ; -} /* current_sf_info_test */ - -static void -broadcast_test (const char *filename, int filetype) -{ static SF_BROADCAST_INFO bc_write, bc_read ; - SNDFILE *file ; - SF_INFO sfinfo ; - int errors = 0 ; - - print_test_name ("broadcast_test", filename) ; - - sfinfo.samplerate = 11025 ; - sfinfo.format = filetype ; - sfinfo.channels = 1 ; - - memset (&bc_write, 0, sizeof (bc_write)) ; - - snprintf (bc_write.description, sizeof (bc_write.description), "Test description") ; - snprintf (bc_write.originator, sizeof (bc_write.originator), "Test originator") ; - snprintf (bc_write.originator_reference, sizeof (bc_write.originator_reference), "%08x-%08x", (unsigned int) time (NULL), (unsigned int) (~ time (NULL))) ; - snprintf (bc_write.origination_date, sizeof (bc_write.origination_date), "%d/%02d/%02d", 2006, 3, 30) ; - snprintf (bc_write.origination_time, sizeof (bc_write.origination_time), "%02d:%02d:%02d", 20, 27, 0) ; - snprintf (bc_write.umid, sizeof (bc_write.umid), "Some umid") ; - bc_write.coding_history_size = 0 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_SET_BROADCAST_INFO, &bc_write, sizeof (bc_write)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_BROADCAST_INFO) failed.\n\n", __LINE__) ; - exit (1) ; - } ; - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - sf_close (file) ; - - memset (&bc_read, 0, sizeof (bc_read)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_GET_BROADCAST_INFO, &bc_read, sizeof (bc_read)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_GET_BROADCAST_INFO) failed.\n\n", __LINE__) ; - exit (1) ; - return ; - } ; - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - - if (bc_read.version != 1) - { printf ("\n\nLine %d : Read bad version number %d.\n\n", __LINE__, bc_read.version) ; - exit (1) ; - return ; - } ; - - bc_read.version = bc_write.version = 0 ; - - if (memcmp (bc_write.description, bc_read.description, sizeof (bc_write.description)) != 0) - { printf ("\n\nLine %d : description mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, bc_write.description, bc_read.description) ; - errors ++ ; - } ; - - if (memcmp (bc_write.originator, bc_read.originator, sizeof (bc_write.originator)) != 0) - { printf ("\n\nLine %d : originator mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, bc_write.originator, bc_read.originator) ; - errors ++ ; - } ; - - if (memcmp (bc_write.originator_reference, bc_read.originator_reference, sizeof (bc_write.originator_reference)) != 0) - { printf ("\n\nLine %d : originator_reference mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, bc_write.originator_reference, bc_read.originator_reference) ; - errors ++ ; - } ; - - if (memcmp (bc_write.origination_date, bc_read.origination_date, sizeof (bc_write.origination_date)) != 0) - { printf ("\n\nLine %d : origination_date mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, bc_write.origination_date, bc_read.origination_date) ; - errors ++ ; - } ; - - if (memcmp (bc_write.origination_time, bc_read.origination_time, sizeof (bc_write.origination_time)) != 0) - { printf ("\n\nLine %d : origination_time mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, bc_write.origination_time, bc_read.origination_time) ; - errors ++ ; - } ; - - if (memcmp (bc_write.umid, bc_read.umid, sizeof (bc_write.umid)) != 0) - { printf ("\n\nLine %d : umid mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, bc_write.umid, bc_read.umid) ; - errors ++ ; - } ; - - if (errors) - exit (1) ; - - unlink (filename) ; - puts ("ok") ; -} /* broadcast_test */ - -static void -broadcast_rdwr_test (const char *filename, int filetype) -{ SF_BROADCAST_INFO binfo ; - SNDFILE *file ; - SF_INFO sfinfo ; - sf_count_t frames ; - - print_test_name (__func__, filename) ; - - create_short_sndfile (filename, filetype, 2) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - memset (&binfo, 0, sizeof (binfo)) ; - - snprintf (binfo.description, sizeof (binfo.description), "Test description") ; - snprintf (binfo.originator, sizeof (binfo.originator), "Test originator") ; - snprintf (binfo.originator_reference, sizeof (binfo.originator_reference), "%08x-%08x", (unsigned int) time (NULL), (unsigned int) (~ time (NULL))) ; - snprintf (binfo.origination_date, sizeof (binfo.origination_date), "%d/%02d/%02d", 2006, 3, 30) ; - snprintf (binfo.origination_time, sizeof (binfo.origination_time), "%02d:%02d:%02d", 20, 27, 0) ; - snprintf (binfo.umid, sizeof (binfo.umid), "Some umid") ; - binfo.coding_history_size = 0 ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - frames = sfinfo.frames ; - if (sf_command (file, SFC_SET_BROADCAST_INFO, &binfo, sizeof (binfo)) != SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_BROADCAST_INFO) should have failed but didn't.\n\n", __LINE__) ; - exit (1) ; - } ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_close (file) ; - exit_if_true (frames != sfinfo.frames, "\n\nLine %d : Frame count %" PRId64 " should be %" PRId64 ".\n", __LINE__, sfinfo.frames, frames) ; - - unlink (filename) ; - puts ("ok") ; -} /* broadcast_rdwr_test */ - -static void -check_coding_history_newlines (const char *filename) -{ static SF_BROADCAST_INFO bc_write, bc_read ; - SNDFILE *file ; - SF_INFO sfinfo ; - unsigned k ; - - sfinfo.samplerate = 22050 ; - sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16 ; - sfinfo.channels = 1 ; - - memset (&bc_write, 0, sizeof (bc_write)) ; - - snprintf (bc_write.description, sizeof (bc_write.description), "Test description") ; - snprintf (bc_write.originator, sizeof (bc_write.originator), "Test originator") ; - snprintf (bc_write.originator_reference, sizeof (bc_write.originator_reference), "%08x-%08x", (unsigned int) time (NULL), (unsigned int) (~ time (NULL))) ; - snprintf (bc_write.origination_date, sizeof (bc_write.origination_date), "%d/%02d/%02d", 2006, 3, 30) ; - snprintf (bc_write.origination_time, sizeof (bc_write.origination_time), "%02d:%02d:%02d", 20, 27, 0) ; - snprintf (bc_write.umid, sizeof (bc_write.umid), "Some umid") ; - bc_write.coding_history_size = snprintf (bc_write.coding_history, sizeof (bc_write.coding_history), "This has\nUnix\nand\rMac OS9\rline endings.\nLast line") ; ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_SET_BROADCAST_INFO, &bc_write, sizeof (bc_write)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_BROADCAST_INFO) failed.\n\n", __LINE__) ; - exit (1) ; - } ; - - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - sf_close (file) ; - - memset (&bc_read, 0, sizeof (bc_read)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_GET_BROADCAST_INFO, &bc_read, sizeof (bc_read)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_BROADCAST_INFO) failed.\n\n", __LINE__) ; - exit (1) ; - } ; - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - - if (bc_read.coding_history_size == 0) - { printf ("\n\nLine %d : missing coding history.\n\n", __LINE__) ; - exit (1) ; - } ; - - if (strstr (bc_read.coding_history, "Last line") == NULL) - { printf ("\n\nLine %d : coding history truncated.\n\n", __LINE__) ; - exit (1) ; - } ; - - for (k = 1 ; k < bc_read.coding_history_size ; k++) - { if (bc_read.coding_history [k] == '\n' && bc_read.coding_history [k - 1] != '\r') - { printf ("\n\nLine %d : '\\n' without '\\r' before.\n\n", __LINE__) ; - exit (1) ; - } ; - - if (bc_read.coding_history [k] == '\r' && bc_read.coding_history [k + 1] != '\n') - { printf ("\n\nLine %d : '\\r' without '\\n' after.\n\n", __LINE__) ; - exit (1) ; - } ; - - if (bc_read.coding_history [k] == 0 && k < bc_read.coding_history_size - 1) - { printf ("\n\nLine %d : '\\0' within coding history at index %d of %d.\n\n", __LINE__, k, bc_read.coding_history_size) ; - exit (1) ; - } ; - } ; - - return ; -} /* check_coding_history_newlines */ - -static void -broadcast_coding_history_test (const char *filename) -{ static SF_BROADCAST_INFO bc_write, bc_read ; - SNDFILE *file ; - SF_INFO sfinfo ; - const char *default_history = "A=PCM,F=22050,W=16,M=mono" ; - const char *supplied_history = - "A=PCM,F=44100,W=24,M=mono,T=other\r\n" - "A=PCM,F=22050,W=16,M=mono,T=yet_another\r\n" ; - - print_test_name ("broadcast_coding_history_test", filename) ; - - sfinfo.samplerate = 22050 ; - sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16 ; - sfinfo.channels = 1 ; - - memset (&bc_write, 0, sizeof (bc_write)) ; - - snprintf (bc_write.description, sizeof (bc_write.description), "Test description") ; - snprintf (bc_write.originator, sizeof (bc_write.originator), "Test originator") ; - snprintf (bc_write.originator_reference, sizeof (bc_write.originator_reference), "%08x-%08x", (unsigned int) time (NULL), (unsigned int) (~ time (NULL))) ; - snprintf (bc_write.origination_date, sizeof (bc_write.origination_date), "%d/%02d/%02d", 2006, 3, 30) ; - snprintf (bc_write.origination_time, sizeof (bc_write.origination_time), "%02d:%02d:%02d", 20, 27, 0) ; - snprintf (bc_write.umid, sizeof (bc_write.umid), "Some umid") ; - /* Coding history will be filled in by the library. */ - bc_write.coding_history_size = 0 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_SET_BROADCAST_INFO, &bc_write, sizeof (bc_write)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_BROADCAST_INFO) failed.\n\n", __LINE__) ; - exit (1) ; - } ; - - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - sf_close (file) ; - - memset (&bc_read, 0, sizeof (bc_read)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_GET_BROADCAST_INFO, &bc_read, sizeof (bc_read)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_BROADCAST_INFO) failed.\n\n", __LINE__) ; - exit (1) ; - } ; - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - - if (bc_read.coding_history_size == 0) - { printf ("\n\nLine %d : missing coding history.\n\n", __LINE__) ; - exit (1) ; - } ; - - if (bc_read.coding_history_size < strlen (default_history) || memcmp (bc_read.coding_history, default_history, strlen (default_history)) != 0) - { printf ("\n\n" - "Line %d : unexpected coding history '%.*s',\n" - " should be '%s'\n\n", __LINE__, bc_read.coding_history_size, bc_read.coding_history, default_history) ; - exit (1) ; - } ; - - bc_write.coding_history_size = strlen (supplied_history) ; - bc_write.coding_history_size = snprintf (bc_write.coding_history, sizeof (bc_write.coding_history), "%s", supplied_history) ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_SET_BROADCAST_INFO, &bc_write, sizeof (bc_write)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_BROADCAST_INFO) failed.\n\n", __LINE__) ; - exit (1) ; - } ; - - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - sf_close (file) ; - - memset (&bc_read, 0, sizeof (bc_read)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_GET_BROADCAST_INFO, &bc_read, sizeof (bc_read)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_BROADCAST_INFO) failed.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - - if (strstr (bc_read.coding_history, supplied_history) != bc_read.coding_history) - { printf ("\n\nLine %d : unexpected coding history :\n" - "----------------------------------------------------\n%s" - "----------------------------------------------------\n" - "should be this :\n" - "----------------------------------------------------\n%s" - "----------------------------------------------------\n" - "with one more line at the end.\n\n", - __LINE__, bc_read.coding_history, supplied_history) ; - exit (1) ; - } ; - - check_coding_history_newlines (filename) ; - - unlink (filename) ; - puts ("ok") ; -} /* broadcast_coding_history_test */ - -/*============================================================================== -*/ - -static void -broadcast_coding_history_size (const char *filename) -{ /* SF_BROADCAST_INFO struct with coding_history field of 1024 bytes. */ - static SF_BROADCAST_INFO_VAR (1024) bc_write ; - static SF_BROADCAST_INFO_VAR (1024) bc_read ; - SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - - print_test_name (__func__, filename) ; - - sfinfo.samplerate = 22050 ; - sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16 ; - sfinfo.channels = 1 ; - - memset (&bc_write, 0, sizeof (bc_write)) ; - - snprintf (bc_write.description, sizeof (bc_write.description), "Test description") ; - snprintf (bc_write.originator, sizeof (bc_write.originator), "Test originator") ; - snprintf (bc_write.originator_reference, sizeof (bc_write.originator_reference), "%08x-%08x", (unsigned int) time (NULL), (unsigned int) (~ time (NULL))) ; - snprintf (bc_write.origination_date, sizeof (bc_write.origination_date), "%d/%02d/%02d", 2006, 3, 30) ; - snprintf (bc_write.origination_time, sizeof (bc_write.origination_time), "%02d:%02d:%02d", 20, 27, 0) ; - snprintf (bc_write.umid, sizeof (bc_write.umid), "Some umid") ; - bc_write.coding_history_size = 0 ; - - for (k = 0 ; bc_write.coding_history_size < 512 ; k++) - { snprintf (bc_write.coding_history + bc_write.coding_history_size, - sizeof (bc_write.coding_history) - bc_write.coding_history_size, "line %4d\n", k) ; - bc_write.coding_history_size = strlen (bc_write.coding_history) ; - } ; - - exit_if_true (bc_write.coding_history_size < 512, - "\n\nLine %d : bc_write.coding_history_size (%d) should be > 512.\n\n", __LINE__, bc_write.coding_history_size) ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_SET_BROADCAST_INFO, &bc_write, sizeof (bc_write)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_BROADCAST_INFO) failed.\n\n", __LINE__) ; - exit (1) ; - } ; - - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - sf_close (file) ; - - memset (&bc_read, 0, sizeof (bc_read)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_GET_BROADCAST_INFO, &bc_read, sizeof (bc_read)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_BROADCAST_INFO) failed.\n\n", __LINE__) ; - exit (1) ; - } ; - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - - exit_if_true (bc_read.coding_history_size < 512, - "\n\nLine %d : unexpected coding history size %d (should be > 512).\n\n", __LINE__, bc_read.coding_history_size) ; - - exit_if_true (strstr (bc_read.coding_history, "libsndfile") == NULL, - "\n\nLine %d : coding history incomplete (should contain 'libsndfile').\n\n", __LINE__) ; - - unlink (filename) ; - puts ("ok") ; -} /* broadcast_coding_history_size */ - -/*============================================================================== -*/ -static void -cart_test (const char *filename, int filetype) -{ static SF_CART_INFO ca_write, ca_read ; - SNDFILE *file ; - SF_INFO sfinfo ; - int errors = 0 ; - - print_test_name ("cart_test", filename) ; - - sfinfo.samplerate = 11025 ; - sfinfo.format = filetype ; - sfinfo.channels = 1 ; - memset (&ca_write, 0, sizeof (ca_write)) ; - - // example test data - snprintf (ca_write.artist, sizeof (ca_write.artist), "Test artist") ; - snprintf (ca_write.version, sizeof (ca_write.version), "Test version") ; - snprintf (ca_write.cut_id, sizeof (ca_write.cut_id), "Test cut ID") ; - snprintf (ca_write.client_id, sizeof (ca_write.client_id), "Test client ID") ; - snprintf (ca_write.category, sizeof (ca_write.category), "Test category") ; - snprintf (ca_write.classification, sizeof (ca_write.classification), "Test classification") ; - snprintf (ca_write.out_cue, sizeof (ca_write.out_cue), "Test out cue") ; - snprintf (ca_write.start_date, sizeof (ca_write.start_date), "%d/%02d/%02d", 2006, 3, 30) ; - snprintf (ca_write.start_time, sizeof (ca_write.start_time), "%02d:%02d:%02d", 20, 27, 0) ; - snprintf (ca_write.end_date, sizeof (ca_write.end_date), "%d/%02d/%02d", 2006, 3, 30) ; - snprintf (ca_write.end_time, sizeof (ca_write.end_time), "%02d:%02d:%02d", 20, 27, 0) ; - snprintf (ca_write.producer_app_id, sizeof (ca_write.producer_app_id), "Test producer app id") ; - snprintf (ca_write.producer_app_version, sizeof (ca_write.producer_app_version), "Test producer app version") ; - snprintf (ca_write.user_def, sizeof (ca_write.user_def), "test user def test test") ; - ca_write.level_reference = 42 ; - snprintf (ca_write.url, sizeof (ca_write.url), "http://www.test.com/test_url") ; - snprintf (ca_write.tag_text, sizeof (ca_write.tag_text), "tag text test! \r\n") ; // must be terminated \r\n to be valid - ca_write.tag_text_size = strlen (ca_write.tag_text) ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_SET_CART_INFO, &ca_write, sizeof (ca_write)) == SF_FALSE) - exit (1) ; - - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - sf_close (file) ; - - memset (&ca_read, 0, sizeof (ca_read)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - if (sf_command (file, SFC_GET_CART_INFO, &ca_read, sizeof (ca_read)) == SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_GET_CART_INFO) failed.\n\n", __LINE__) ; - exit (1) ; - return ; - } ; - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - - - if (memcmp (ca_write.artist, ca_read.artist, sizeof (ca_write.artist)) != 0) - { printf ("\n\nLine %d : artist mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.artist, ca_read.artist) ; - errors ++ ; - } ; - - if (memcmp (ca_write.version, ca_read.version, sizeof (ca_write.version)) != 0) - { printf ("\n\nLine %d : version mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.version, ca_read.version) ; - errors ++ ; - } ; - - if (memcmp (ca_write.title, ca_read.title, sizeof (ca_write.title)) != 0) - { printf ("\n\nLine %d : title mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.title, ca_read.title) ; - errors ++ ; - } ; - - if (memcmp (ca_write.cut_id, ca_read.cut_id, sizeof (ca_write.cut_id)) != 0) - { printf ("\n\nLine %d : cut_id mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.cut_id, ca_read.cut_id) ; - errors ++ ; - } ; - - if (memcmp (ca_write.client_id, ca_read.client_id, sizeof (ca_write.client_id)) != 0) - { printf ("\n\nLine %d : client_id mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.client_id, ca_read.client_id) ; - errors ++ ; - } ; - - if (memcmp (ca_write.category, ca_read.category, sizeof (ca_write.category)) != 0) - { printf ("\n\nLine %d : category mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.category, ca_read.category) ; - errors ++ ; - } ; - - if (memcmp (ca_write.out_cue, ca_read.out_cue, sizeof (ca_write.out_cue)) != 0) - { printf ("\n\nLine %d : out_cue mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.out_cue, ca_read.out_cue) ; - errors ++ ; - } ; - - if (memcmp (ca_write.start_date, ca_read.start_date, sizeof (ca_write.start_date)) != 0) - { printf ("\n\nLine %d : start_date mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.start_date, ca_read.start_date) ; - errors ++ ; - } ; - - - if (memcmp (ca_write.start_time, ca_read.start_time, sizeof (ca_write.start_time)) != 0) - { printf ("\n\nLine %d : start_time mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.start_time, ca_read.start_time) ; - errors ++ ; - } ; - - - if (memcmp (ca_write.end_date, ca_read.end_date, sizeof (ca_write.end_date)) != 0) - { printf ("\n\nLine %d : end_date mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.end_date, ca_read.end_date) ; - errors ++ ; - } ; - - - if (memcmp (ca_write.end_time, ca_read.end_time, sizeof (ca_write.end_time)) != 0) - { printf ("\n\nLine %d : end_time mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.end_time, ca_read.end_time) ; - errors ++ ; - } ; - - - if (memcmp (ca_write.producer_app_id, ca_read.producer_app_id, sizeof (ca_write.producer_app_id)) != 0) - { printf ("\n\nLine %d : producer_app_id mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.producer_app_id, ca_read.producer_app_id) ; - errors ++ ; - } ; - - - if (memcmp (ca_write.producer_app_version, ca_read.producer_app_version, sizeof (ca_write.producer_app_version)) != 0) - { printf ("\n\nLine %d : producer_app_version mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.producer_app_version, ca_read.producer_app_version) ; - errors ++ ; - } ; - - - if (memcmp (ca_write.user_def, ca_read.user_def, sizeof (ca_write.user_def)) != 0) - { printf ("\n\nLine %d : user_def mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.user_def, ca_read.user_def) ; - errors ++ ; - } ; - - - if (ca_write.level_reference != ca_read.level_reference) - { printf ("\n\nLine %d : level_reference mismatch :\n\twrite : '%d'\n\tread : '%d'\n\n", __LINE__, ca_write.level_reference, ca_read.level_reference) ; - errors ++ ; - } ; - - // TODO: make this more helpful - if (memcmp (ca_write.post_timers, ca_read.post_timers, sizeof (ca_write.post_timers)) != 0) - { printf ("\n\nLine %d : post_timers mismatch :\n'\n\n", __LINE__) ; - errors ++ ; - } ; - - if (memcmp (ca_write.url, ca_read.url, sizeof (ca_write.url)) != 0) - { printf ("\n\nLine %d : url mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.url, ca_read.url) ; - errors ++ ; - } ; - - - if (memcmp (ca_write.tag_text, ca_read.tag_text, (size_t) (ca_read.tag_text_size)) != 0) - { printf ("\n\nLine %d : tag_text mismatch :\n\twrite : '%s'\n\tread : '%s'\n\n", __LINE__, ca_write.tag_text, ca_read.tag_text) ; - errors ++ ; - } ; - - - if (errors) - exit (1) ; - - unlink (filename) ; - puts ("ok") ; -} /* cart_test */ - -static void -cart_rdwr_test (const char *filename, int filetype) -{ SF_CART_INFO cinfo ; - SNDFILE *file ; - SF_INFO sfinfo ; - sf_count_t frames ; - - print_test_name (__func__, filename) ; - - create_short_sndfile (filename, filetype, 2) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - memset (&cinfo, 0, sizeof (cinfo)) ; - - snprintf (cinfo.artist, sizeof (cinfo.artist), "Test artist") ; - snprintf (cinfo.version, sizeof (cinfo.version), "Test version") ; - snprintf (cinfo.cut_id, sizeof (cinfo.cut_id), "Test cut ID") ; - snprintf (cinfo.client_id, sizeof (cinfo.client_id), "Test client ID") ; - snprintf (cinfo.category, sizeof (cinfo.category), "Test category") ; - snprintf (cinfo.classification, sizeof (cinfo.classification), "Test classification") ; - snprintf (cinfo.out_cue, sizeof (cinfo.out_cue), "Test out cue") ; - snprintf (cinfo.start_date, sizeof (cinfo.start_date), "%d/%02d/%02d", 2006, 3, 30) ; - snprintf (cinfo.start_time, sizeof (cinfo.start_time), "%02d:%02d:%02d", 20, 27, 0) ; - snprintf (cinfo.end_date, sizeof (cinfo.end_date), "%d/%02d/%02d", 2006, 3, 30) ; - snprintf (cinfo.end_time, sizeof (cinfo.end_time), "%02d:%02d:%02d", 20, 27, 0) ; - snprintf (cinfo.producer_app_id, sizeof (cinfo.producer_app_id), "Test producer app id") ; - snprintf (cinfo.producer_app_version, sizeof (cinfo.producer_app_version), "Test producer app version") ; - snprintf (cinfo.user_def, sizeof (cinfo.user_def), "test user def test test") ; - cinfo.level_reference = 42 ; - snprintf (cinfo.url, sizeof (cinfo.url), "http://www.test.com/test_url") ; - snprintf (cinfo.tag_text, sizeof (cinfo.tag_text), "tag text test!\r\n") ; - cinfo.tag_text_size = strlen (cinfo.tag_text) ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - frames = sfinfo.frames ; - if (sf_command (file, SFC_SET_CART_INFO, &cinfo, sizeof (cinfo)) != SF_FALSE) - { printf ("\n\nLine %d : sf_command (SFC_SET_CART_INFO) should have failed but didn't.\n\n", __LINE__) ; - exit (1) ; - } ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_close (file) ; - exit_if_true (frames != sfinfo.frames, "\n\nLine %d : Frame count %" PRId64 " should be %" PRId64 ".\n", __LINE__, sfinfo.frames, frames) ; - - unlink (filename) ; - puts ("ok") ; -} /* cart_rdwr_test */ - -/*============================================================================== -*/ - -static void -channel_map_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int channel_map_read [4], channel_map_write [4] = - { SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_LFE, - SF_CHANNEL_MAP_REAR_CENTER - } ; - - print_test_name ("channel_map_test", filename) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 11025 ; - sfinfo.format = filetype ; - sfinfo.channels = ARRAY_LEN (channel_map_read) ; - - switch (filetype & SF_FORMAT_TYPEMASK) - { /* WAVEX and RF64 have a default channel map, even if you don't specify one. */ - case SF_FORMAT_WAVEX : - case SF_FORMAT_RF64 : - /* Write file without channel map. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - sf_close (file) ; - - /* Read file making default channel map exists. */ - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - exit_if_true ( - sf_command (file, SFC_GET_CHANNEL_MAP_INFO, channel_map_read, sizeof (channel_map_read)) == SF_FALSE, - "\n\nLine %d : sf_command (SFC_GET_CHANNEL_MAP_INFO) should not have failed.\n\n", __LINE__ - ) ; - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - break ; - - default : - break ; - } ; - - /* Write file with a channel map. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - exit_if_true ( - sf_command (file, SFC_SET_CHANNEL_MAP_INFO, channel_map_write, sizeof (channel_map_write)) == SF_FALSE, - "\n\nLine %d : sf_command (SFC_SET_CHANNEL_MAP_INFO) failed.\n\n", __LINE__ - ) ; - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - sf_close (file) ; - - /* Read file making sure no channel map exists. */ - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - exit_if_true ( - sf_command (file, SFC_GET_CHANNEL_MAP_INFO, channel_map_read, sizeof (channel_map_read)) != SF_TRUE, - "\n\nLine %d : sf_command (SFC_GET_CHANNEL_MAP_INFO) failed.\n\n", __LINE__ - ) ; - check_log_buffer_or_die (file, __LINE__) ; - sf_close (file) ; - - exit_if_true ( - memcmp (channel_map_read, channel_map_write, sizeof (channel_map_read)) != 0, - "\n\nLine %d : Channel map read does not match channel map written.\n\n", __LINE__ - ) ; - - unlink (filename) ; - puts ("ok") ; -} /* channel_map_test */ - -static void -raw_needs_endswap_test (const char *filename, int filetype) -{ static int subtypes [] = - { SF_FORMAT_FLOAT, SF_FORMAT_DOUBLE, - SF_FORMAT_PCM_16, SF_FORMAT_PCM_24, SF_FORMAT_PCM_32 - } ; - SNDFILE *file ; - SF_INFO sfinfo ; - unsigned k ; - int needs_endswap ; - - print_test_name (__func__, filename) ; - - for (k = 0 ; k < ARRAY_LEN (subtypes) ; k++) - { - if (filetype == (SF_ENDIAN_LITTLE | SF_FORMAT_AIFF)) - switch (subtypes [k]) - { /* Little endian AIFF does not AFAIK support fl32 and fl64. */ - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - continue ; - default : - break ; - } ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 11025 ; - sfinfo.format = filetype | subtypes [k] ; - sfinfo.channels = 1 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_double_or_die (file, 0, double_data, BUFFER_LEN, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - needs_endswap = sf_command (file, SFC_RAW_DATA_NEEDS_ENDSWAP, NULL, 0) ; - - switch (filetype) - { case SF_FORMAT_WAV : - case SF_FORMAT_WAVEX : - case SF_FORMAT_AIFF | SF_ENDIAN_LITTLE : - exit_if_true (needs_endswap != CPU_IS_BIG_ENDIAN, - "\n\nLine %d : SFC_RAW_DATA_NEEDS_ENDSWAP failed for (%d | %d).\n\n", __LINE__, filetype, k) ; - break ; - - case SF_FORMAT_AIFF : - case SF_FORMAT_WAV | SF_ENDIAN_BIG : - exit_if_true (needs_endswap != CPU_IS_LITTLE_ENDIAN, - "\n\nLine %d : SFC_RAW_DATA_NEEDS_ENDSWAP failed for (%d | %d).\n\n", __LINE__, filetype, k) ; - break ; - - default : - printf ("\n\nLine %d : bad format value %d.\n\n", __LINE__, filetype) ; - exit (1) ; - break ; - } ; - - sf_close (file) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* raw_needs_endswap_test */ diff --git a/libs/libsndfile/tests/compression_size_test.c b/libs/libsndfile/tests/compression_size_test.c deleted file mode 100644 index ddacf94905..0000000000 --- a/libs/libsndfile/tests/compression_size_test.c +++ /dev/null @@ -1,205 +0,0 @@ -/* -** Copyright (C) 2007-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include - -#include - -#include "utils.h" -#include "dft_cmp.h" - -#define SAMPLE_RATE 16000 -#define DATA_LENGTH (SAMPLE_RATE) - -static float data_out [DATA_LENGTH] ; - -static inline float -max_float (float a, float b) -{ return a > b ? a : b ; -} /* max_float */ - -static void -vorbis_test (void) -{ static float float_data [DFT_DATA_LENGTH] ; - const char * filename = "vorbis_test.oga" ; - SNDFILE * file ; - SF_INFO sfinfo ; - float max_abs = 0.0 ; - unsigned k ; - - print_test_name ("vorbis_test", filename) ; - - /* Generate float data. */ - gen_windowed_sine_float (float_data, ARRAY_LEN (float_data), 1.0) ; - - /* Set up output file type. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ; - sfinfo.channels = 1 ; - sfinfo.samplerate = SAMPLE_RATE ; - - /* Write the output file. */ - - /* The Vorbis encoder has a bug on PowerPC and X86-64 with sample rates - ** <= 22050. Increasing the sample rate to 32000 avoids triggering it. - ** See https://trac.xiph.org/ticket/1229 - */ - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { const char * errstr ; - - errstr = sf_strerror (NULL) ; - if (strstr (errstr, "Sample rate chosen is known to trigger a Vorbis") == NULL) - { printf ("Line %d: sf_open (SFM_WRITE) failed : %s\n", __LINE__, errstr) ; - dump_log_buffer (NULL) ; - exit (1) ; - } ; - - printf ("\n Sample rate -> 32kHz ") ; - sfinfo.samplerate = 32000 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - } ; - - test_write_float_or_die (file, 0, float_data, ARRAY_LEN (float_data), __LINE__) ; - sf_close (file) ; - - memset (float_data, 0, sizeof (float_data)) ; - - /* Read the file back in again. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - test_read_float_or_die (file, 0, float_data, ARRAY_LEN (float_data), __LINE__) ; - sf_close (file) ; - - for (k = 0 ; k < ARRAY_LEN (float_data) ; k ++) - max_abs = max_float (max_abs, fabs (float_data [k])) ; - - if (max_abs > 1.021) - { printf ("\n\n Error : max_abs %f should be < 1.021.\n\n", max_abs) ; - exit (1) ; - } ; - - puts ("ok") ; - unlink (filename) ; -} /* vorbis_test */ - -static void -compression_size_test (int format, const char * filename) -{ /* - ** Encode two files, one at quality 0.3 and one at quality 0.5 and then - ** make sure that the quality 0.3 files is the smaller of the two. - */ - char q3_fname [64] ; - char q6_fname [64] ; - char test_name [64] ; - - SNDFILE *q3_file, *q6_file ; - SF_INFO sfinfo ; - int q3_size, q6_size ; - double quality ; - int k ; - - snprintf (q3_fname, sizeof (q3_fname), "q3_%s", filename) ; - snprintf (q6_fname, sizeof (q6_fname), "q6_%s", filename) ; - - snprintf (test_name, sizeof (test_name), "q[36]_%s", filename) ; - print_test_name (__func__, test_name) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - /* Set up output file type. */ - sfinfo.format = format ; - sfinfo.channels = 1 ; - sfinfo.samplerate = SAMPLE_RATE ; - - /* Write the output file. */ - q3_file = test_open_file_or_die (q3_fname, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - q6_file = test_open_file_or_die (q6_fname, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - - quality = 0.3 ; - sf_command (q3_file, SFC_SET_VBR_ENCODING_QUALITY, &quality, sizeof (quality)) ; - quality = 0.6 ; - sf_command (q6_file, SFC_SET_VBR_ENCODING_QUALITY, &quality, sizeof (quality)) ; - - for (k = 0 ; k < 5 ; k++) - { gen_lowpass_signal_float (data_out, ARRAY_LEN (data_out)) ; - test_write_float_or_die (q3_file, 0, data_out, ARRAY_LEN (data_out), __LINE__) ; - test_write_float_or_die (q6_file, 0, data_out, ARRAY_LEN (data_out), __LINE__) ; - } ; - - sf_close (q3_file) ; - sf_close (q6_file) ; - - q3_size = file_length (q3_fname) ; - q6_size = file_length (q6_fname) ; - - if (q3_size >= q6_size) - { printf ("\n\nLine %d : q3 size (%d) >= q5 size (%d)\n\n", __LINE__, q3_size, q6_size) ; - exit (1) ; - } ; - - puts ("ok") ; - unlink (q3_fname) ; - unlink (q6_fname) ; -} /* compression_size_test */ - - - -int -main (int argc, char *argv []) -{ int all_tests = 0, tests = 0 ; - - if (argc != 2) - { printf ( - "Usage : %s \n" - " Where is one of:\n" - " vorbis - test Ogg/Vorbis\n" - " flac - test FLAC\n" - " all - perform all tests\n", - argv [0]) ; - exit (0) ; - } ; - - if (! HAVE_EXTERNAL_LIBS) - { puts (" No Ogg/Vorbis tests because Ogg/Vorbis support was not compiled in.") ; - return 0 ; - } ; - - if (strcmp (argv [1], "all") == 0) - all_tests = 1 ; - - if (all_tests || strcmp (argv [1], "vorbis") == 0) - { vorbis_test () ; - compression_size_test (SF_FORMAT_OGG | SF_FORMAT_VORBIS, "vorbis.oga") ; - tests ++ ; - } ; - - if (all_tests || strcmp (argv [1], "flac") == 0) - { compression_size_test (SF_FORMAT_FLAC | SF_FORMAT_PCM_16, "pcm16.flac") ; - tests ++ ; - } ; - - return 0 ; -} /* main */ diff --git a/libs/libsndfile/tests/cpp_test.cc b/libs/libsndfile/tests/cpp_test.cc deleted file mode 100644 index 364ec86ee2..0000000000 --- a/libs/libsndfile/tests/cpp_test.cc +++ /dev/null @@ -1,313 +0,0 @@ -/* -** Copyright (C) 2006-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include - -#include - -#include "utils.h" - -static short sbuffer [100] ; -static int ibuffer [100] ; -static float fbuffer [100] ; -static double dbuffer [100] ; - -static void -ceeplusplus_wchar_test (void) -{ -#if 0 - LPCWSTR filename = L"wchar_test.wav" ; - - print_test_name (__func__, "ceeplusplus_wchar_test.wav") ; - - /* Use this scope to make sure the created file is closed. */ - { - SndfileHandle file (filename, SFM_WRITE, SF_FORMAT_WAV | SF_FORMAT_PCM_16, 2, 44100) ; - - if (file.refCount () != 1) - { printf ("\n\n%s %d : Error : Reference count (%d) should be 1.\n\n", __func__, __LINE__, file.refCount ()) ; - exit (1) ; - } ; - - /* This should check that the file did in fact get created with a - ** wchar_t * filename. - */ - exit_if_true ( - GetFileAttributesW (filename) == INVALID_FILE_ATTRIBUTES, - "\n\nLine %d : GetFileAttributes failed.\n\n", __LINE__ - ) ; - } - - /* Use this because the file was created with CreateFileW. */ - DeleteFileW (filename) ; - - puts ("ok") ; -#endif -} /* ceeplusplus_wchar_test */ - - - -static void -create_file (const char * filename, int format) -{ SndfileHandle file ; - - if (file.refCount () != 0) - { printf ("\n\n%s %d : Error : Reference count (%d) should be zero.\n\n", __func__, __LINE__, file.refCount ()) ; - exit (1) ; - } ; - - file = SndfileHandle (filename, SFM_WRITE, format, 2, 48000) ; - - if (file.refCount () != 1) - { printf ("\n\n%s %d : Error : Reference count (%d) should be 1.\n\n", __func__, __LINE__, file.refCount ()) ; - exit (1) ; - } ; - - file.setString (SF_STR_TITLE, filename) ; - - /* Item write. */ - file.write (sbuffer, ARRAY_LEN (sbuffer)) ; - file.write (ibuffer, ARRAY_LEN (ibuffer)) ; - file.write (fbuffer, ARRAY_LEN (fbuffer)) ; - file.write (dbuffer, ARRAY_LEN (dbuffer)) ; - - /* Frame write. */ - file.writef (sbuffer, ARRAY_LEN (sbuffer) / file.channels ()) ; - file.writef (ibuffer, ARRAY_LEN (ibuffer) / file.channels ()) ; - file.writef (fbuffer, ARRAY_LEN (fbuffer) / file.channels ()) ; - file.writef (dbuffer, ARRAY_LEN (dbuffer) / file.channels ()) ; - - /* RAII takes care of the SndfileHandle. */ -} /* create_file */ - -static void -check_title (const SndfileHandle & file, const char * filename) -{ const char *title = NULL ; - - title = file.getString (SF_STR_TITLE) ; - - if (title == NULL) - { printf ("\n\n%s %d : Error : No title.\n\n", __func__, __LINE__) ; - exit (1) ; - } ; - - if (strcmp (filename, title) != 0) - { printf ("\n\n%s %d : Error : title '%s' should be '%s'\n\n", __func__, __LINE__, title, filename) ; - exit (1) ; - } ; - - return ; -} /* check_title */ - -static void -read_file (const char * filename, int format) -{ SndfileHandle file ; - sf_count_t count ; - - if (file) - { printf ("\n\n%s %d : Error : should not be here.\n\n", __func__, __LINE__) ; - exit (1) ; - } ; - - file = SndfileHandle (filename) ; - - if (1) - { SndfileHandle file2 = file ; - - if (file.refCount () != 2 || file2.refCount () != 2) - { printf ("\n\n%s %d : Error : Reference count (%d) should be two.\n\n", __func__, __LINE__, file.refCount ()) ; - exit (1) ; - } ; - } ; - - if (file.refCount () != 1) - { printf ("\n\n%s %d : Error : Reference count (%d) should be one.\n\n", __func__, __LINE__, file.refCount ()) ; - exit (1) ; - } ; - - if (! file) - { printf ("\n\n%s %d : Error : should not be here.\n\n", __func__, __LINE__) ; - exit (1) ; - } ; - - if (file.format () != format) - { printf ("\n\n%s %d : Error : format 0x%08x should be 0x%08x.\n\n", __func__, __LINE__, file.format (), format) ; - exit (1) ; - } ; - - if (file.channels () != 2) - { printf ("\n\n%s %d : Error : channels %d should be 2.\n\n", __func__, __LINE__, file.channels ()) ; - exit (1) ; - } ; - - if (file.frames () != ARRAY_LEN (sbuffer) * 4) - { printf ("\n\n%s %d : Error : frames %ld should be %lu.\n\n", __func__, __LINE__, - (long) file.frames (), (long) ARRAY_LEN (sbuffer) * 4 / 2) ; - exit (1) ; - } ; - - switch (format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_AU : - break ; - - default : - check_title (file, filename) ; - break ; - } ; - - /* Item read. */ - file.read (sbuffer, ARRAY_LEN (sbuffer)) ; - file.read (ibuffer, ARRAY_LEN (ibuffer)) ; - file.read (fbuffer, ARRAY_LEN (fbuffer)) ; - file.read (dbuffer, ARRAY_LEN (dbuffer)) ; - - /* Frame read. */ - file.readf (sbuffer, ARRAY_LEN (sbuffer) / file.channels ()) ; - file.readf (ibuffer, ARRAY_LEN (ibuffer) / file.channels ()) ; - file.readf (fbuffer, ARRAY_LEN (fbuffer) / file.channels ()) ; - file.readf (dbuffer, ARRAY_LEN (dbuffer) / file.channels ()) ; - - count = file.seek (file.frames () - 10, SEEK_SET) ; - if (count != file.frames () - 10) - { printf ("\n\n%s %d : Error : offset (%ld) should be %ld\n\n", __func__, __LINE__, - (long) count, (long) (file.frames () - 10)) ; - exit (1) ; - } ; - - count = file.read (sbuffer, ARRAY_LEN (sbuffer)) ; - if (count != 10 * file.channels ()) - { printf ("\n\n%s %d : Error : count (%ld) should be %ld\n\n", __func__, __LINE__, - (long) count, (long) (10 * file.channels ())) ; - exit (1) ; - } ; - - /* RAII takes care of the SndfileHandle. */ -} /* read_file */ - -static void -ceeplusplus_test (const char *filename, int format) -{ - print_test_name ("ceeplusplus_test", filename) ; - - create_file (filename, format) ; - read_file (filename, format) ; - - remove (filename) ; - puts ("ok") ; -} /* ceeplusplus_test */ - -static void -ceeplusplus_extra_test (void) -{ SndfileHandle file ; - const char * filename = "bad_file_name.wav" ; - int error ; - - print_test_name ("ceeplusplus_extra_test", filename) ; - - file = SndfileHandle (filename) ; - - error = file.error () ; - if (error == 0) - { printf ("\n\n%s %d : error should not be zero.\n\n", __func__, __LINE__) ; - exit (1) ; - } ; - - if (file.strError () == NULL) - { printf ("\n\n%s %d : strError should not return NULL.\n\n", __func__, __LINE__) ; - exit (1) ; - } ; - - if (file.seek (0, SEEK_SET) != 0) - { printf ("\n\n%s %d : bad seek ().\n\n", __func__, __LINE__) ; - exit (1) ; - } ; - - puts ("ok") ; -} /* ceeplusplus_extra_test */ - - -static void -ceeplusplus_rawhandle_test (const char *filename) -{ - SNDFILE* handle ; - { - SndfileHandle file (filename) ; - handle = file.rawHandle () ; - sf_read_float (handle, fbuffer, ARRAY_LEN (fbuffer)) ; - } -} /* ceeplusplus_rawhandle_test */ - -static void -ceeplusplus_takeOwnership_test (const char *filename) -{ - SNDFILE* handle ; - { - SndfileHandle file (filename) ; - handle = file.takeOwnership () ; - } - - if (sf_read_float (handle, fbuffer, ARRAY_LEN (fbuffer)) <= 0) - { printf ("\n\n%s %d : error when taking ownership of handle.\n\n", __func__, __LINE__) ; - exit (1) ; - } - - if (sf_close (handle) != 0) - { printf ("\n\n%s %d : cannot close file.\n\n", __func__, __LINE__) ; - exit (1) ; - } - - SndfileHandle file (filename) ; - SndfileHandle file2 (file) ; - - if (file2.takeOwnership ()) - { printf ("\n\n%s %d : taking ownership of shared handle is not allowed.\n\n", __func__, __LINE__) ; - exit (1) ; - } -} /* ceeplusplus_takeOwnership_test */ - -static void -ceeplusplus_handle_test (const char *filename, int format) -{ - print_test_name ("ceeplusplus_handle_test", filename) ; - - create_file (filename, format) ; - - if (0) ceeplusplus_rawhandle_test (filename) ; - ceeplusplus_takeOwnership_test (filename) ; - - remove (filename) ; - puts ("ok") ; -} /* ceeplusplus_test */ - -int -main (void) -{ - ceeplusplus_test ("cpp_test.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - ceeplusplus_test ("cpp_test.aiff", SF_FORMAT_AIFF | SF_FORMAT_PCM_S8) ; - ceeplusplus_test ("cpp_test.au", SF_FORMAT_AU | SF_FORMAT_FLOAT) ; - - ceeplusplus_extra_test () ; - ceeplusplus_handle_test ("cpp_test.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - - ceeplusplus_wchar_test () ; - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/tests/dft_cmp.c b/libs/libsndfile/tests/dft_cmp.c deleted file mode 100644 index 439a53949a..0000000000 --- a/libs/libsndfile/tests/dft_cmp.c +++ /dev/null @@ -1,149 +0,0 @@ -/* -** Copyright (C) 2002-2013 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include - -#include "dft_cmp.h" -#include "utils.h" - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -#define DFT_SPEC_LENGTH (DFT_DATA_LENGTH / 2) - -static void dft_magnitude (const double *data, double *spectrum) ; -static double calc_max_spectral_difference (const double *spec1, const double *spec2) ; - -/*-------------------------------------------------------------------------------- -** Public functions. -*/ - -double -dft_cmp_float (int linenum, const float *in_data, const float *test_data, int len, double target_snr, int allow_exit) -{ static double orig [DFT_DATA_LENGTH] ; - static double test [DFT_DATA_LENGTH] ; - unsigned k ; - - if (len != DFT_DATA_LENGTH) - { printf ("Error (line %d) : dft_cmp_float : Bad input array length.\n", linenum) ; - return 1 ; - } ; - - for (k = 0 ; k < ARRAY_LEN (orig) ; k++) - { test [k] = test_data [k] ; - orig [k] = in_data [k] ; - } ; - - return dft_cmp_double (linenum, orig, test, len, target_snr, allow_exit) ; -} /* dft_cmp_float */ - -double -dft_cmp_double (int linenum, const double *orig, const double *test, int len, double target_snr, int allow_exit) -{ static double orig_spec [DFT_SPEC_LENGTH] ; - static double test_spec [DFT_SPEC_LENGTH] ; - double snr ; - - if (! orig || ! test) - { printf ("Error (line %d) : dft_cmp_double : Bad input arrays.\n", linenum) ; - return 1 ; - } ; - - if (len != DFT_DATA_LENGTH) - { printf ("Error (line %d) : dft_cmp_double : Bad input array length.\n", linenum) ; - return 1 ; - } ; - - dft_magnitude (orig, orig_spec) ; - dft_magnitude (test, test_spec) ; - - snr = calc_max_spectral_difference (orig_spec, test_spec) ; - - if (snr > target_snr) - { printf ("\n\nLine %d: Actual SNR (% 4.1f) > target SNR (% 4.1f).\n\n", linenum, snr, target_snr) ; - oct_save_double (orig, test, len) ; - if (allow_exit) - exit (1) ; - } ; - - if (snr < -500.0) - snr = -500.0 ; - - return snr ; -} /* dft_cmp_double */ - -/*-------------------------------------------------------------------------------- -** Quick dirty calculation of magnitude spectrum for real valued data using -** Discrete Fourier Transform. Since the data is real, the DFT is only -** calculated for positive frequencies. -*/ - -static void -dft_magnitude (const double *data, double *spectrum) -{ static double cos_angle [DFT_DATA_LENGTH] = { 0.0 } ; - static double sin_angle [DFT_DATA_LENGTH] ; - - double real_part, imag_part ; - int k, n ; - - /* If sine and cosine tables haven't been initialised, do so. */ - if (cos_angle [0] == 0.0) - for (n = 0 ; n < DFT_DATA_LENGTH ; n++) - { cos_angle [n] = cos (2.0 * M_PI * n / DFT_DATA_LENGTH) ; - sin_angle [n] = -1.0 * sin (2.0 * M_PI * n / DFT_DATA_LENGTH) ; - } ; - - /* DFT proper. Since the data is real, only generate a half spectrum. */ - for (k = 1 ; k < DFT_SPEC_LENGTH ; k++) - { real_part = 0.0 ; - imag_part = 0.0 ; - - for (n = 0 ; n < DFT_DATA_LENGTH ; n++) - { real_part += data [n] * cos_angle [(k * n) % DFT_DATA_LENGTH] ; - imag_part += data [n] * sin_angle [(k * n) % DFT_DATA_LENGTH] ; - } ; - - spectrum [k] = sqrt (real_part * real_part + imag_part * imag_part) ; - } ; - - spectrum [DFT_DATA_LENGTH - 1] = 0.0 ; - - spectrum [0] = spectrum [1] = spectrum [2] = spectrum [3] = spectrum [4] = 0.0 ; - - return ; -} /* dft_magnitude */ - -static double -calc_max_spectral_difference (const double *orig, const double *test) -{ double orig_max = 0.0, max_diff = 0.0 ; - int k ; - - for (k = 0 ; k < DFT_SPEC_LENGTH ; k++) - { if (orig_max < orig [k]) - orig_max = orig [k] ; - if (max_diff < fabs (orig [k] - test [k])) - max_diff = fabs (orig [k] - test [k]) ; - } ; - - if (max_diff < 1e-25) - return -500.0 ; - - return 20.0 * log10 (max_diff / orig_max) ; -} /* calc_max_spectral_difference */ diff --git a/libs/libsndfile/tests/dft_cmp.h b/libs/libsndfile/tests/dft_cmp.h deleted file mode 100644 index 3cbdd118e7..0000000000 --- a/libs/libsndfile/tests/dft_cmp.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#define DFT_DATA_LENGTH (2048) - -double dft_cmp_float (int linenum, const float *orig, const float *test, int len, double tolerance, int allow_exit) ; - -double dft_cmp_double (int linenum, const double *orig, const double *test, int len, double tolerance, int allow_exit) ; - diff --git a/libs/libsndfile/tests/dither_test.c b/libs/libsndfile/tests/dither_test.c deleted file mode 100644 index e9eef7c136..0000000000 --- a/libs/libsndfile/tests/dither_test.c +++ /dev/null @@ -1,180 +0,0 @@ -/* -** Copyright (C) 2003-2013 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - - -#include -#include -#include -#include -#include - -#include - -#include "utils.h" - -#define BUFFER_LEN (1 << 16) -#define LOG_BUFFER_SIZE 1024 - -static void dither_test (const char *filename, int filetype) ; - -/* Force the start of this buffer to be double aligned. Sparc-solaris will -** choke if its not. -*/ -static short data_out [BUFFER_LEN] ; - -int -main (int argc, char *argv []) -{ int do_all = 0 ; - int test_count = 0 ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" wav - test WAV file peak chunk\n") ; - printf (" aiff - test AIFF file PEAK chunk\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all = ! strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "wav")) - { dither_test ("dither.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_U8) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { dither_test ("dither.aiff", SF_FORMAT_AIFF | SF_FORMAT_PCM_S8) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "au")) - { dither_test ("dither.au", SF_FORMAT_AU | SF_FORMAT_PCM_S8) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "svx")) - { dither_test ("dither.svx", SF_FORMAT_SVX | SF_FORMAT_PCM_S8) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "nist")) - { dither_test ("dither.nist", SF_FORMAT_NIST | SF_FORMAT_PCM_S8) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "paf")) - { dither_test ("dither.paf", SF_FORMAT_PAF | SF_FORMAT_PCM_S8) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "ircam")) - { dither_test ("dither.ircam", SF_FORMAT_IRCAM | SF_FORMAT_PCM_S8) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "voc")) - { dither_test ("dither.voc", SF_FORMAT_VOC | SF_FORMAT_PCM_S8) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "w64")) - { dither_test ("dither.w64", SF_FORMAT_W64 | SF_FORMAT_PCM_S8) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat4")) - { dither_test ("dither.mat4", SF_FORMAT_MAT4 | SF_FORMAT_PCM_S8) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat5")) - { dither_test ("dither.mat5", SF_FORMAT_MAT5 | SF_FORMAT_PCM_S8) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "pvf")) - { dither_test ("dither.pvf", SF_FORMAT_PVF | SF_FORMAT_PCM_S8) ; - test_count++ ; - } ; - - if (test_count == 0) - { printf ("Mono : ************************************\n") ; - printf ("Mono : * No '%s' test defined.\n", argv [1]) ; - printf ("Mono : ************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -dither_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - SF_DITHER_INFO dither ; - - print_test_name ("dither_test", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = filetype ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - /* Check for old version of the dither API. */ - if (sf_command (file, SFC_SET_DITHER_ON_WRITE, NULL, SF_TRUE) == 0) - { printf ("\n\nLine %d: Should have an error here but don't.\n\n", __LINE__) ; - exit (1) ; - } ; - - memset (&dither, 0, sizeof (dither)) ; - dither.type = SFD_WHITE ; - dither.level = 0 ; - - if (sf_command (file, SFC_SET_DITHER_ON_WRITE, &dither, sizeof (dither)) != 0) - { printf ("\n\nLine %d: sf_command (SFC_SET_DITHER_ON_WRITE) returned error : %s\n\n", - __LINE__, sf_strerror (file)) ; - exit (1) ; - } ; - - /* Write data to file. */ - test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ; - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.frames != BUFFER_LEN) - { printf ("\n\nLine %d: Bad frame count %d (should be %d)\n\n", __LINE__, (int) sfinfo.frames, BUFFER_LEN) ; - } ; - - sf_close (file) ; - /*-unlink (filename) ;-*/ - - puts ("ok") ; -} /* dither_test */ - diff --git a/libs/libsndfile/tests/dwvw_test.c b/libs/libsndfile/tests/dwvw_test.c deleted file mode 100644 index 2bd11d18c9..0000000000 --- a/libs/libsndfile/tests/dwvw_test.c +++ /dev/null @@ -1,109 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_SIZE (10000) - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -static void dwvw_test (const char *filename, int format, int bit_width) ; - -int -main (void) -{ - dwvw_test ("dwvw12.raw", SF_FORMAT_RAW | SF_FORMAT_DWVW_12, 12) ; - dwvw_test ("dwvw16.raw", SF_FORMAT_RAW | SF_FORMAT_DWVW_16, 16) ; - dwvw_test ("dwvw24.raw", SF_FORMAT_RAW | SF_FORMAT_DWVW_24, 24) ; - - return 0 ; -} /* main */ - -static void -dwvw_test (const char *filename, int format, int bit_width) -{ static int write_buf [BUFFER_SIZE] ; - static int read_buf [BUFFER_SIZE] ; - - SNDFILE *file ; - SF_INFO sfinfo ; - double value ; - int k, bit_mask ; - - srand (123456) ; - - /* Only want to grab the top bit_width bits. */ - bit_mask = (-1 << (32 - bit_width)) ; - - print_test_name ("dwvw_test", filename) ; - - sf_info_setup (&sfinfo, format, 44100, 1) ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - /* Generate random.frames. */ - for (k = 0 ; k < BUFFER_SIZE / 2 ; k++) - { value = 0x7FFFFFFF * sin (123.0 / sfinfo.samplerate * 2 * k * M_PI) ; - write_buf [k] = bit_mask & lrint (value) ; - } ; - - for ( ; k < BUFFER_SIZE ; k++) - write_buf [k] = bit_mask & ((rand () << 11) ^ (rand () >> 11)) ; - - sf_write_int (file, write_buf, BUFFER_SIZE) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if ((k = sf_read_int (file, read_buf, BUFFER_SIZE)) != BUFFER_SIZE) - { printf ("Error (line %d) : Only read %d/%d.frames.\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } - - for (k = 0 ; k < BUFFER_SIZE ; k++) - { if (read_buf [k] != write_buf [k]) - { printf ("Error (line %d) : %d != %d at position %d/%d\n", __LINE__, - write_buf [k] >> (32 - bit_width), read_buf [k] >> (32 - bit_width), - k, BUFFER_SIZE) ; - oct_save_int (write_buf, read_buf, BUFFER_SIZE) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - unlink (filename) ; - printf ("ok\n") ; - - return ; -} /* dwvw_test */ - diff --git a/libs/libsndfile/tests/error_test.c b/libs/libsndfile/tests/error_test.c deleted file mode 100644 index 4207c0a3cf..0000000000 --- a/libs/libsndfile/tests/error_test.c +++ /dev/null @@ -1,246 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if OS_IS_WIN32 -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_SIZE (1 << 15) -#define SHORT_BUFFER (256) - -static void -error_number_test (void) -{ const char *noerror, *errstr ; - int k ; - - print_test_name ("error_number_test", "") ; - - noerror = sf_error_number (0) ; - - for (k = 1 ; k < 300 ; k++) - { errstr = sf_error_number (k) ; - - /* Test for termination condition. */ - if (errstr == noerror) - break ; - - /* Test for error. */ - if (strstr (errstr, "This is a bug in libsndfile.")) - { printf ("\n\nError : error number %d : %s\n\n\n", k, errstr) ; - exit (1) ; - } ; - } ; - - - puts ("ok") ; - return ; -} /* error_number_test */ - -static void -error_value_test (void) -{ static unsigned char aiff_data [0x1b0] = - { 'F' , 'O' , 'R' , 'M' , - 0x00, 0x00, 0x01, 0xA8, /* FORM length */ - - 'A' , 'I' , 'F' , 'C' , - } ; - - const char *filename = "error.aiff" ; - SNDFILE *file ; - SF_INFO sfinfo ; - int error_num ; - - print_test_name ("error_value_test", filename) ; - - dump_data_to_file (filename, aiff_data, sizeof (aiff_data)) ; - - file = sf_open (filename, SFM_READ, &sfinfo) ; - if (file != NULL) - { printf ("\n\nLine %d : Should not have been able to open this file.\n\n", __LINE__) ; - exit (1) ; - } ; - - if ((error_num = sf_error (NULL)) <= 1 || error_num > 300) - { printf ("\n\nLine %d : Should not have had an error number of %d.\n\n", __LINE__, error_num) ; - exit (1) ; - } ; - - remove (filename) ; - puts ("ok") ; - return ; -} /* error_value_test */ - -static void -no_file_test (const char * filename) -{ SNDFILE *sndfile ; - SF_INFO sfinfo ; - - print_test_name (__func__, filename) ; - - unlink (filename) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sndfile = sf_open (filename, SFM_READ, &sfinfo) ; - - exit_if_true (sndfile != NULL, "\n\nLine %d : should not have received a valid SNDFILE* pointer.\n", __LINE__) ; - - unlink (filename) ; - puts ("ok") ; -} /* no_file_test */ - -static void -zero_length_test (const char *filename) -{ SNDFILE *sndfile ; - SF_INFO sfinfo ; - FILE *file ; - - print_test_name (__func__, filename) ; - - /* Create a zero length file. */ - file = fopen (filename, "w") ; - exit_if_true (file == NULL, "\n\nLine %d : fopen ('%s') failed.\n", __LINE__, filename) ; - fclose (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sndfile = sf_open (filename, SFM_READ, &sfinfo) ; - - exit_if_true (sndfile != NULL, "\n\nLine %d : should not have received a valid SNDFILE* pointer.\n", __LINE__) ; - - exit_if_true (0 && sf_error (NULL) != SF_ERR_UNRECOGNISED_FORMAT, - "\n\nLine %3d : Error : %s\n should be : %s\n", __LINE__, - sf_strerror (NULL), sf_error_number (SF_ERR_UNRECOGNISED_FORMAT)) ; - - unlink (filename) ; - puts ("ok") ; -} /* zero_length_test */ - -static void -bad_wav_test (const char * filename) -{ SNDFILE *sndfile ; - SF_INFO sfinfo ; - - FILE *file ; - const char data [] = "RIFF WAVEfmt " ; - - print_test_name (__func__, filename) ; - - if ((file = fopen (filename, "w")) == NULL) - { printf ("\n\nLine %d : fopen returned NULL.\n", __LINE__) ; - exit (1) ; - } ; - - exit_if_true (fwrite (data, sizeof (data), 1, file) != 1, "\n\nLine %d : fwrite failed.\n", __LINE__) ; - fclose (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sndfile = sf_open (filename, SFM_READ, &sfinfo) ; - - if (sndfile) - { printf ("\n\nLine %d : should not have received a valid SNDFILE* pointer.\n", __LINE__) ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* bad_wav_test */ - -static void -error_close_test (void) -{ static short buffer [SHORT_BUFFER] ; - const char *filename = "error_close.wav" ; - SNDFILE *sndfile ; - SF_INFO sfinfo ; - FILE *file ; - - print_test_name (__func__, filename) ; - - /* Open a FILE* from which we will extract a file descriptor. */ - if ((file = fopen (filename, "w")) == NULL) - { printf ("\n\nLine %d : fopen returned NULL.\n", __LINE__) ; - exit (1) ; - } ; - - /* Set parameters for writing the file. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.channels = 1 ; - sfinfo.samplerate = 44100 ; - sfinfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16 ; - - sndfile = sf_open_fd (fileno (file), SFM_WRITE, &sfinfo, SF_TRUE) ; - if (sndfile == NULL) - { printf ("\n\nLine %d : sf_open_fd failed : %s\n", __LINE__, sf_strerror (NULL)) ; - exit (1) ; - } ; - - test_write_short_or_die (sndfile, 0, buffer, ARRAY_LEN (buffer), __LINE__) ; - - /* Now close the fd associated with file before calling sf_close. */ - fclose (file) ; - - if (sf_close (sndfile) == 0) - { -#if OS_IS_WIN32 - OSVERSIONINFOEX osvi ; - - memset (&osvi, 0, sizeof (OSVERSIONINFOEX)) ; - osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX) ; - - if (GetVersionEx ((OSVERSIONINFO *) &osvi)) - { printf ("\n\nLine %d : sf_close should not have returned zero.\n", __LINE__) ; - printf ("\nHowever, this is a known bug in version %d.%d of windows so we'll ignore it.\n\n", - (int) osvi.dwMajorVersion, (int) osvi.dwMinorVersion) ; - } ; -#else - printf ("\n\nLine %d : sf_close should not have returned zero.\n", __LINE__) ; - exit (1) ; -#endif - } ; - - unlink (filename) ; - puts ("ok") ; -} /* error_close_test */ - -int -main (void) -{ - error_number_test () ; - error_value_test () ; - - error_close_test () ; - - no_file_test ("no_file.wav") ; - zero_length_test ("zero_length.wav") ; - bad_wav_test ("bad_wav.wav") ; - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/tests/external_libs_test.c b/libs/libsndfile/tests/external_libs_test.c deleted file mode 100644 index 86b029078e..0000000000 --- a/libs/libsndfile/tests/external_libs_test.c +++ /dev/null @@ -1,149 +0,0 @@ -/* -** Copyright (C) 2008-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include - -#include "utils.h" - -static void major_format_test (void) ; -static void subtype_format_test (void) ; -static void simple_format_test (void) ; - -int -main (void) -{ - major_format_test () ; - subtype_format_test () ; - simple_format_test () ; - - return 0 ; -} /* main */ - -static void -major_format_test (void) -{ SF_FORMAT_INFO info ; - int have_ogg = 0, have_flac = 0 ; - int m, major_count ; - - print_test_name (__func__, NULL) ; - - sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof (int)) ; - - for (m = 0 ; m < major_count ; m++) - { info.format = m ; - sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)) ; - - have_flac = info.format == SF_FORMAT_FLAC ? 1 : have_flac ; - have_ogg = info.format == SF_FORMAT_OGG ? 1 : have_ogg ; - } ; - - if (HAVE_EXTERNAL_LIBS) - { exit_if_true (have_flac == 0, "\n\nLine %d : FLAC should be available.\n\n", __LINE__) ; - exit_if_true (have_ogg == 0, "\n\nLine %d : Ogg/Vorbis should be available.\n\n", __LINE__) ; - } - else - { exit_if_true (have_flac, "\n\nLine %d : FLAC should not be available.\n\n", __LINE__) ; - exit_if_true (have_ogg, "\n\nLine %d : Ogg/Vorbis should not be available.\n\n", __LINE__) ; - } ; - - puts ("ok") ; -} /* major_format_test */ - -static void -subtype_format_test (void) -{ SF_FORMAT_INFO info ; - int have_vorbis = 0 ; - int s, subtype_count ; - - print_test_name (__func__, NULL) ; - - sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &subtype_count, sizeof (int)) ; - - for (s = 0 ; s < subtype_count ; s++) - { info.format = s ; - sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &info, sizeof (info)) ; - - have_vorbis = info.format == SF_FORMAT_VORBIS ? 1 : have_vorbis ; - } ; - - if (HAVE_EXTERNAL_LIBS) - exit_if_true (have_vorbis == 0, "\n\nLine %d : Ogg/Vorbis should be available.\n\n", __LINE__) ; - else - exit_if_true (have_vorbis, "\n\nLine %d : Ogg/Vorbis should not be available.\n\n", __LINE__) ; - - puts ("ok") ; -} /* subtype_format_test */ - -static void -simple_format_test (void) -{ SF_FORMAT_INFO info ; - int have_flac = 0, have_ogg = 0, have_vorbis = 0 ; - int s, simple_count ; - - print_test_name (__func__, NULL) ; - - sf_command (NULL, SFC_GET_SIMPLE_FORMAT_COUNT, &simple_count, sizeof (int)) ; - - for (s = 0 ; s < simple_count ; s++) - { info.format = s ; - sf_command (NULL, SFC_GET_SIMPLE_FORMAT, &info, sizeof (info)) ; - - switch (info.format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_FLAC : - have_flac = 1 ; - break ; - - case SF_FORMAT_OGG : - have_ogg = 1 ; - break ; - - default : - break ; - } ; - - switch (info.format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_VORBIS : - have_vorbis = 1 ; - break ; - - default : - break ; - } ; - - } ; - - if (HAVE_EXTERNAL_LIBS) - { exit_if_true (have_flac == 0, "\n\nLine %d : FLAC should be available.\n\n", __LINE__) ; - exit_if_true (have_ogg == 0, "\n\nLine %d : Ogg/Vorbis should be available.\n\n", __LINE__) ; - exit_if_true (have_vorbis == 0, "\n\nLine %d : Ogg/Vorbis should be available.\n\n", __LINE__) ; - } - else - { exit_if_true (have_flac, "\n\nLine %d : FLAC should not be available.\n\n", __LINE__) ; - exit_if_true (have_ogg, "\n\nLine %d : Ogg/Vorbis should not be available.\n\n", __LINE__) ; - exit_if_true (have_vorbis, "\n\nLine %d : Ogg/Vorbis should not be available.\n\n", __LINE__) ; - } ; - - puts ("ok") ; -} /* simple_format_test */ diff --git a/libs/libsndfile/tests/fix_this.c b/libs/libsndfile/tests/fix_this.c deleted file mode 100644 index 4cbb8d43ac..0000000000 --- a/libs/libsndfile/tests/fix_this.c +++ /dev/null @@ -1,328 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include -#include -#include - -#include - -#include "utils.h" - -#define BUFFER_SIZE (1 << 14) -#define SAMPLE_RATE (11025) - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -static void lcomp_test_int (const char *str, const char *filename, int filetype, double margin) ; - -static int error_function (double data, double orig, double margin) ; -static int decay_response (int k) ; - -static void gen_signal_double (double *data, double scale, int datalen) ; - -/* Force the start of these buffers to be double aligned. Sparc-solaris will -** choke if they are not. -*/ - -typedef union -{ double d [BUFFER_SIZE + 1] ; - int i [BUFFER_SIZE + 1] ; -} BUFFER ; - -static BUFFER data_buffer ; -static BUFFER orig_buffer ; - -int -main (void) -{ const char *filename = "test.au" ; - - lcomp_test_int ("au_g721", filename, SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_G721_32, 0.06) ; - - return 0 ; -} /* main */ - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -lcomp_test_int (const char *str, const char *filename, int filetype, double margin) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, m, *orig, *data ; - sf_count_t datalen, seekpos ; - int64_t sum_abs ; - double scale ; - - printf ("\nThis is program is not part of the libsndfile test suite.\n\n") ; - - printf (" lcomp_test_int : %s ... ", str) ; - fflush (stdout) ; - - datalen = BUFFER_SIZE ; - - scale = 1.0 * 0x10000 ; - - data = data_buffer.i ; - orig = orig_buffer.i ; - - gen_signal_double (orig_buffer.d, 32000.0 * scale, datalen) ; - for (k = 0 ; k < datalen ; k++) - orig [k] = orig_buffer.d [k] ; - - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = 123456789 ; /* Ridiculous value. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - if (! (file = sf_open (filename, SFM_WRITE, &sfinfo))) - { printf ("sf_open_write failed with error : ") ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - if ((k = sf_writef_int (file, orig, datalen)) != datalen) - { printf ("sf_writef_int failed with short write (%" PRId64 " => %d).\n", datalen, k) ; - exit (1) ; - } ; - sf_close (file) ; - - memset (data, 0, datalen * sizeof (int)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if (! (file = sf_open (filename, SFM_READ, &sfinfo))) - { printf ("sf_open_read failed with error : ") ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - if ((sfinfo.format & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK)) != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("Line %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < datalen) - { printf ("Too few.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.frames > (datalen + datalen / 2)) - { printf ("Too many.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("Incorrect number of channels in file.\n") ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - if ((k = sf_readf_int (file, data, datalen)) != datalen) - { printf ("Line %d: short read (%d should be %" PRId64 ").\n", __LINE__, k, datalen) ; - exit (1) ; - } ; - - sum_abs = 0 ; - for (k = 0 ; k < datalen ; k++) - { if (error_function (data [k] / scale, orig [k] / scale, margin)) - { printf ("Line %d: Incorrect sample (#%d : %f should be %f).\n", __LINE__, k, data [k] / scale, orig [k] / scale) ; - oct_save_int (orig, data, datalen) ; - exit (1) ; - } ; - sum_abs += abs (data [k]) ; - } ; - - if (sum_abs < 1.0) - { printf ("Line %d: Signal is all zeros.\n", __LINE__) ; - exit (1) ; - } ; - - if ((k = sf_readf_int (file, data, datalen)) != sfinfo.frames - datalen) - { printf ("Line %d: Incorrect read length (%" PRId64 " should be %d).\n", __LINE__, sfinfo.frames - datalen, k) ; - exit (1) ; - } ; - - /* This check is only for block based encoders which must append silence - ** to the end of a file so as to fill out a block. - */ - if ((sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_MS_ADPCM) - for (k = 0 ; k < sfinfo.frames - datalen ; k++) - if (abs (data [k] / scale) > decay_response (k)) - { printf ("Line %d : Incorrect sample B (#%d : abs (%d) should be < %d).\n", __LINE__, k, data [k], decay_response (k)) ; - exit (1) ; - } ; - - if (! sfinfo.seekable) - { printf ("ok\n") ; - return ; - } ; - - /* Now test sf_seek function. */ - - if ((k = sf_seek (file, 0, SEEK_SET)) != 0) - { printf ("Line %d: Seek to start of file failed (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - for (m = 0 ; m < 3 ; m++) - { int n ; - - if ((k = sf_readf_int (file, data, 11)) != 11) - { printf ("Line %d: Incorrect read length (11 => %d).\n", __LINE__, k) ; - exit (1) ; - } ; - - for (k = 0 ; k < 11 ; k++) - if (error_function (data [k] / scale, orig [k + m * 11] / scale, margin)) - { printf ("Line %d: Incorrect sample (m = %d) (#%d : %d => %d).\n", __LINE__, m, k + m * 11, orig [k + m * 11], data [k]) ; - for (n = 0 ; n < 1 ; n++) - printf ("%d ", data [n]) ; - printf ("\n") ; - exit (1) ; - } ; - } ; - - seekpos = BUFFER_SIZE / 10 ; - - /* Check seek from start of file. */ - if ((k = sf_seek (file, seekpos, SEEK_SET)) != seekpos) - { printf ("Seek to start of file + %" PRId64 " failed (%d).\n", seekpos, k) ; - exit (1) ; - } ; - - if ((k = sf_readf_int (file, data, 1)) != 1) - { printf ("Line %d: sf_readf_int (file, data, 1) returned %d.\n", __LINE__, k) ; - exit (1) ; - } ; - - if (error_function ((double) data [0], (double) orig [seekpos], margin)) - { printf ("Line %d: sf_seek (SEEK_SET) followed by sf_readf_int failed (%d, %d).\n", __LINE__, orig [1], data [0]) ; - exit (1) ; - } ; - - if ((k = sf_seek (file, 0, SEEK_CUR)) != seekpos + 1) - { printf ("Line %d: sf_seek (SEEK_CUR) with 0 offset failed (%d should be %" PRId64 ")\n", __LINE__, k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) + BUFFER_SIZE / 5 ; - k = sf_seek (file, BUFFER_SIZE / 5, SEEK_CUR) ; - sf_readf_int (file, data, 1) ; - if (error_function ((double) data [0], (double) orig [seekpos], margin) || k != seekpos) - { printf ("Line %d: sf_seek (forwards, SEEK_CUR) followed by sf_readf_int failed (%d, %d) (%d, %" PRId64 ").\n", __LINE__, data [0], orig [seekpos], k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) - 20 ; - /* Check seek backward from current position. */ - k = sf_seek (file, -20, SEEK_CUR) ; - sf_readf_int (file, data, 1) ; - if (error_function ((double) data [0], (double) orig [seekpos], margin) || k != seekpos) - { printf ("sf_seek (backwards, SEEK_CUR) followed by sf_readf_int failed (%d, %d) (%d, %" PRId64 ").\n", data [0], orig [seekpos], k, seekpos) ; - exit (1) ; - } ; - - /* Check that read past end of file returns number of items. */ - sf_seek (file, (int) sfinfo.frames, SEEK_SET) ; - - if ((k = sf_readf_int (file, data, datalen)) != 0) - { printf ("Line %d: Return value from sf_readf_int past end of file incorrect (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - /* Check seek backward from end. */ - if ((k = sf_seek (file, 5 - (int) sfinfo.frames, SEEK_END)) != 5) - { printf ("sf_seek (SEEK_END) returned %d instead of %d.\n", k, 5) ; - exit (1) ; - } ; - - sf_readf_int (file, data, 1) ; - if (error_function (data [0] / scale, orig [5] / scale, margin)) - { printf ("Line %d: sf_seek (SEEK_END) followed by sf_readf_short failed (%d should be %d).\n", __LINE__, data [0], orig [5]) ; - exit (1) ; - } ; - - sf_close (file) ; - - printf ("ok\n") ; -} /* lcomp_test_int */ - -/*======================================================================================== -** Auxiliary functions -*/ - -#define SIGNAL_MAXVAL 30000.0 -#define DECAY_COUNT 800 - -static int -decay_response (int k) -{ if (k < 1) - return (int) (1.2 * SIGNAL_MAXVAL) ; - if (k > DECAY_COUNT) - return 0 ; - return (int) (1.2 * SIGNAL_MAXVAL * (DECAY_COUNT - k) / (1.0 * DECAY_COUNT)) ; -} /* decay_response */ - -static void -gen_signal_double (double *data, double scale, int datalen) -{ int k, ramplen ; - double amp = 0.0 ; - - ramplen = datalen / 18 ; - - for (k = 0 ; k < datalen ; k++) - { if (k <= ramplen) - amp = scale * k / ((double) ramplen) ; - else if (k > datalen - ramplen) - amp = scale * (datalen - k) / ((double) ramplen) ; - - data [k] = amp * (0.4 * sin (33.3 * 2.0 * M_PI * ((double) (k + 1)) / ((double) SAMPLE_RATE)) - + 0.3 * cos (201.1 * 2.0 * M_PI * ((double) (k + 1)) / ((double) SAMPLE_RATE))) ; - } ; - - return ; -} /* gen_signal_double */ - -static int -error_function (double data, double orig, double margin) -{ double error ; - - if (fabs (orig) <= 500.0) - error = fabs (fabs (data) - fabs (orig)) / 2000.0 ; - else if (fabs (orig) <= 1000.0) - error = fabs (data - orig) / 3000.0 ; - else - error = fabs (data - orig) / fabs (orig) ; - - if (error > margin) - { printf ("\n\n*******************\nError : %f\n", error) ; - return 1 ; - } ; - return 0 ; -} /* error_function */ - diff --git a/libs/libsndfile/tests/floating_point_test.c b/libs/libsndfile/tests/floating_point_test.c deleted file mode 100644 index aaf53866ea..0000000000 --- a/libs/libsndfile/tests/floating_point_test.c +++ /dev/null @@ -1,694 +0,0 @@ -/* -** Copyright (C) 1999-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "dft_cmp.h" -#include "utils.h" - -#define SAMPLE_RATE 16000 - -static void float_scaled_test (const char *filename, int allow_exit, int replace_float, int filetype, double target_snr) ; -static void double_scaled_test (const char *filename, int allow_exit, int replace_float, int filetype, double target_snr) ; - -static void float_short_little_test (const char * filename) ; -static void float_short_big_test (const char * filename) ; -static void float_int_little_test (const char * filename) ; -static void float_int_big_test (const char * filename) ; -static void double_short_little_test (const char * filename) ; -static void double_short_big_test (const char * filename) ; -static void double_int_little_test (const char * filename) ; -static void double_int_big_test (const char * filename) ; - - -static double double_data [DFT_DATA_LENGTH] ; -static double double_test [DFT_DATA_LENGTH] ; - -static float float_data [DFT_DATA_LENGTH] ; -static float float_test [DFT_DATA_LENGTH] ; - -static double double_data [DFT_DATA_LENGTH] ; -static short short_data [DFT_DATA_LENGTH] ; -static int int_data [DFT_DATA_LENGTH] ; - -int -main (int argc, char *argv []) -{ int allow_exit = 1 ; - - if (argc == 2 && ! strstr (argv [1], "no-exit")) - allow_exit = 0 ; - -#if ((HAVE_LRINTF == 0) && (HAVE_LRINT_REPLACEMENT == 0)) - puts ("*** Cannot run this test on this platform because it lacks lrintf().") ; - exit (0) ; -#endif - - /* Float tests. */ - float_scaled_test ("float.raw", allow_exit, SF_FALSE, SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_FLOAT, -163.0) ; - - /* Test both signed and unsigned 8 bit files. */ - float_scaled_test ("pcm_s8.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_S8, -39.0) ; - float_scaled_test ("pcm_u8.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_U8, -39.0) ; - - float_scaled_test ("pcm_16.raw", allow_exit, SF_FALSE, SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_16, -87.0) ; - float_scaled_test ("pcm_24.raw", allow_exit, SF_FALSE, SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_24, -138.0) ; - float_scaled_test ("pcm_32.raw", allow_exit, SF_FALSE, SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_32, -163.0) ; - - float_scaled_test ("ulaw.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_ULAW, -50.0) ; - float_scaled_test ("alaw.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_ALAW, -49.0) ; - - float_scaled_test ("ima_adpcm.wav", allow_exit, SF_FALSE, SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, -47.0) ; - float_scaled_test ("ms_adpcm.wav" , allow_exit, SF_FALSE, SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, -40.0) ; - float_scaled_test ("gsm610.raw" , allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_GSM610, -33.0) ; - - float_scaled_test ("g721_32.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G721_32, -34.0) ; - float_scaled_test ("g723_24.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G723_24, -34.0) ; - float_scaled_test ("g723_40.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G723_40, -40.0) ; - - /* PAF files do not use the same encoding method for 24 bit PCM data as other file - ** formats so we need to explicitly test it here. - */ - float_scaled_test ("le_paf_24.paf", allow_exit, SF_FALSE, SF_ENDIAN_LITTLE | SF_FORMAT_PAF | SF_FORMAT_PCM_24, -149.0) ; - float_scaled_test ("be_paf_24.paf", allow_exit, SF_FALSE, SF_ENDIAN_BIG | SF_FORMAT_PAF | SF_FORMAT_PCM_24, -149.0) ; - - float_scaled_test ("dwvw_12.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_12, -64.0) ; - float_scaled_test ("dwvw_16.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_16, -92.0) ; - float_scaled_test ("dwvw_24.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_24, -151.0) ; - - float_scaled_test ("adpcm.vox", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, -40.0) ; - - float_scaled_test ("dpcm_16.xi", allow_exit, SF_FALSE, SF_FORMAT_XI | SF_FORMAT_DPCM_16, -90.0) ; - float_scaled_test ("dpcm_8.xi" , allow_exit, SF_FALSE, SF_FORMAT_XI | SF_FORMAT_DPCM_8 , -41.0) ; - - float_scaled_test ("pcm_s8.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_S8, -90.0) ; - float_scaled_test ("pcm_16.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_16, -140.0) ; - float_scaled_test ("pcm_24.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_24, -170.0) ; - -#if HAVE_EXTERNAL_LIBS - float_scaled_test ("flac_8.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_S8, -39.0) ; - float_scaled_test ("flac_16.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_16, -87.0) ; - float_scaled_test ("flac_24.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_24, -138.0) ; - - float_scaled_test ("vorbis.oga", allow_exit, SF_FALSE, SF_FORMAT_OGG | SF_FORMAT_VORBIS, -31.0) ; -#endif - - float_scaled_test ("replace_float.raw", allow_exit, SF_TRUE, SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_FLOAT, -163.0) ; - - /*============================================================================== - ** Double tests. - */ - - double_scaled_test ("double.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DOUBLE, -300.0) ; - - /* Test both signed (AIFF) and unsigned (WAV) 8 bit files. */ - double_scaled_test ("pcm_s8.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_S8, -39.0) ; - double_scaled_test ("pcm_u8.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_U8, -39.0) ; - - double_scaled_test ("pcm_16.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_16, -87.0) ; - double_scaled_test ("pcm_24.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_24, -135.0) ; - double_scaled_test ("pcm_32.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_32, -184.0) ; - - double_scaled_test ("ulaw.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_ULAW, -50.0) ; - double_scaled_test ("alaw.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_ALAW, -49.0) ; - - double_scaled_test ("ima_adpcm.wav", allow_exit, SF_FALSE, SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, -47.0) ; - double_scaled_test ("ms_adpcm.wav" , allow_exit, SF_FALSE, SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, -40.0) ; - double_scaled_test ("gsm610.raw" , allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_GSM610, -33.0) ; - - double_scaled_test ("g721_32.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G721_32, -34.0) ; - double_scaled_test ("g723_24.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G723_24, -34.0) ; - double_scaled_test ("g723_40.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G723_40, -40.0) ; - - /* 24 bit PCM PAF files tested here. */ - double_scaled_test ("be_paf_24.paf", allow_exit, SF_FALSE, SF_ENDIAN_BIG | SF_FORMAT_PAF | SF_FORMAT_PCM_24, -151.0) ; - double_scaled_test ("le_paf_24.paf", allow_exit, SF_FALSE, SF_ENDIAN_LITTLE | SF_FORMAT_PAF | SF_FORMAT_PCM_24, -151.0) ; - - double_scaled_test ("dwvw_12.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_12, -64.0) ; - double_scaled_test ("dwvw_16.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_16, -92.0) ; - double_scaled_test ("dwvw_24.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_24, -151.0) ; - - double_scaled_test ("adpcm.vox" , allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, -40.0) ; - - double_scaled_test ("dpcm_16.xi", allow_exit, SF_FALSE, SF_FORMAT_XI | SF_FORMAT_DPCM_16, -90.0) ; - double_scaled_test ("dpcm_8.xi" , allow_exit, SF_FALSE, SF_FORMAT_XI | SF_FORMAT_DPCM_8 , -42.0) ; - - double_scaled_test ("pcm_s8.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_S8, -90.0) ; - double_scaled_test ("pcm_16.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_16, -140.0) ; - double_scaled_test ("pcm_24.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_24, -180.0) ; - -#if HAVE_EXTERNAL_LIBS - double_scaled_test ("flac_8.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_S8, -39.0) ; - double_scaled_test ("flac_16.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_16, -87.0) ; - double_scaled_test ("flac_24.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_24, -138.0) ; - - double_scaled_test ("vorbis.oga", allow_exit, SF_FALSE, SF_FORMAT_OGG | SF_FORMAT_VORBIS, -29.0) ; -#endif - - double_scaled_test ("replace_double.raw", allow_exit, SF_TRUE, SF_FORMAT_RAW | SF_FORMAT_DOUBLE, -300.0) ; - - putchar ('\n') ; - /* Float int tests. */ - float_short_little_test ("float_short_little.au") ; - float_short_big_test ("float_short_big.au") ; - float_int_little_test ("float_int_little.au") ; - float_int_big_test ("float_int_big.au") ; - double_short_little_test ("double_short_little.au") ; - double_short_big_test ("double_short_big.au") ; - double_int_little_test ("double_int_little.au") ; - double_int_big_test ("double_int_big.au") ; - - - return 0 ; -} /* main */ - -/*============================================================================================ - * Here are the test functions. - */ - -static void -float_scaled_test (const char *filename, int allow_exit, int replace_float, int filetype, double target_snr) -{ SNDFILE *file ; - SF_INFO sfinfo ; - double snr ; - - print_test_name ("float_scaled_test", filename) ; - - gen_windowed_sine_float (float_data, DFT_DATA_LENGTH, 1.0) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DFT_DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - - test_write_float_or_die (file, 0, float_data, DFT_DATA_LENGTH, __LINE__) ; - - sf_close (file) ; - - memset (float_test, 0, sizeof (float_test)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - - exit_if_true (sfinfo.format != filetype, "\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit_if_true (sfinfo.frames < DFT_DATA_LENGTH, "\n\nLine %d: Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), DFT_DATA_LENGTH) ; - exit_if_true (sfinfo.channels != 1, "\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_float_or_die (file, 0, float_test, DFT_DATA_LENGTH, __LINE__) ; - - sf_close (file) ; - - snr = dft_cmp_float (__LINE__, float_data, float_test, DFT_DATA_LENGTH, target_snr, allow_exit) ; - - exit_if_true (snr > target_snr, "% 6.1fdB SNR\n\n Error : should be better than % 6.1fdB\n\n", snr, target_snr) ; - - printf ("% 6.1fdB SNR ... ok\n", snr) ; - - unlink (filename) ; - - return ; -} /* float_scaled_test */ - -static void -double_scaled_test (const char *filename, int allow_exit, int replace_float, int filetype, double target_snr) -{ SNDFILE *file ; - SF_INFO sfinfo ; - double snr ; - - print_test_name ("double_scaled_test", filename) ; - - gen_windowed_sine_double (double_data, DFT_DATA_LENGTH, 0.95) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DFT_DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - - test_write_double_or_die (file, 0, double_data, DFT_DATA_LENGTH, __LINE__) ; - - sf_close (file) ; - - memset (double_test, 0, sizeof (double_test)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - - exit_if_true (sfinfo.format != filetype, "\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit_if_true (sfinfo.frames < DFT_DATA_LENGTH, "\n\nLine %d: Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), DFT_DATA_LENGTH) ; - exit_if_true (sfinfo.channels != 1, "\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, double_test, DFT_DATA_LENGTH, __LINE__) ; - - sf_close (file) ; - - snr = dft_cmp_double (__LINE__, double_data, double_test, DFT_DATA_LENGTH, target_snr, allow_exit) ; - - exit_if_true (snr > target_snr, "% 6.1fdB SNR\n\n Error : should be better than % 6.1fdB\n\n", snr, target_snr) ; - - printf ("% 6.1fdB SNR ... ok\n", snr) ; - - unlink (filename) ; - - return ; -} /* double_scaled_test */ - -/*============================================================================== -*/ - - -static void -float_short_little_test (const char * filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - unsigned k, max ; - - print_test_name ("float_short_little_test", filename) ; - - gen_windowed_sine_float (float_data, ARRAY_LEN (float_data), 0.98) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = ARRAY_LEN (short_data) ; - sfinfo.channels = 1 ; - sfinfo.format = SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_FLOAT ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_float_or_die (file, 0, float_data, ARRAY_LEN (float_data), __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.frames != ARRAY_LEN (float_data)) - { printf ("\n\nLine %d: Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), DFT_DATA_LENGTH) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - test_read_short_or_die (file, 0, short_data, ARRAY_LEN (short_data), __LINE__) ; - sf_close (file) ; - - max = 0 ; - for (k = 0 ; k < ARRAY_LEN (short_data) ; k++) - if ((unsigned) abs (short_data [k]) > max) - max = abs (short_data [k]) ; - - if (1.0 * abs (max - 0x7FFF) / 0x7FFF > 0.01) - { printf ("\n\nLine %d: Bad maximum (%d should be %d).\n\n", __LINE__, max, 0x7FFF) ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* float_short_little_test */ - -static void -float_short_big_test (const char * filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - unsigned k, max ; - - print_test_name ("float_short_big_test", filename) ; - - gen_windowed_sine_float (float_data, ARRAY_LEN (float_data), 0.98) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = ARRAY_LEN (short_data) ; - sfinfo.channels = 1 ; - sfinfo.format = SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_FLOAT ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_float_or_die (file, 0, float_data, ARRAY_LEN (float_data), __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.frames != ARRAY_LEN (float_data)) - { printf ("\n\nLine %d: Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), DFT_DATA_LENGTH) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - test_read_short_or_die (file, 0, short_data, ARRAY_LEN (short_data), __LINE__) ; - sf_close (file) ; - - max = 0 ; - for (k = 0 ; k < ARRAY_LEN (short_data) ; k++) - if ((unsigned) abs (short_data [k]) > max) - max = abs (short_data [k]) ; - - if (1.0 * abs (max - 0x7FFF) / 0x7FFF > 0.01) - { printf ("\n\nLine %d: Bad maximum (%d should be %d).\n\n", __LINE__, max, 0x7FFF) ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* float_short_big_test */ - -static void -float_int_little_test (const char * filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - unsigned k, max ; - - print_test_name ("float_int_little_test", filename) ; - - gen_windowed_sine_float (float_data, ARRAY_LEN (float_data), 0.98) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = ARRAY_LEN (int_data) ; - sfinfo.channels = 1 ; - sfinfo.format = SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_FLOAT ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_float_or_die (file, 0, float_data, ARRAY_LEN (float_data), __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.frames != ARRAY_LEN (float_data)) - { printf ("\n\nLine %d: Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), DFT_DATA_LENGTH) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - test_read_int_or_die (file, 0, int_data, ARRAY_LEN (int_data), __LINE__) ; - sf_close (file) ; - - max = 0 ; - for (k = 0 ; k < ARRAY_LEN (int_data) ; k++) - if ((unsigned) abs (int_data [k]) > max) - max = abs (int_data [k]) ; - - if (1.0 * abs (max - 0x7FFFFFFF) / 0x7FFFFFFF > 0.01) - { printf ("\n\nLine %d: Bad maximum (%d should be %d).\n\n", __LINE__, max, 0x7FFFFFFF) ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* float_int_little_test */ - -static void -float_int_big_test (const char * filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - unsigned k, max ; - - print_test_name ("float_int_big_test", filename) ; - - gen_windowed_sine_float (float_data, ARRAY_LEN (float_data), 0.98) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = ARRAY_LEN (int_data) ; - sfinfo.channels = 1 ; - sfinfo.format = SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_FLOAT ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_float_or_die (file, 0, float_data, ARRAY_LEN (float_data), __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.frames != ARRAY_LEN (float_data)) - { printf ("\n\nLine %d: Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), DFT_DATA_LENGTH) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - test_read_int_or_die (file, 0, int_data, ARRAY_LEN (int_data), __LINE__) ; - sf_close (file) ; - - max = 0 ; - for (k = 0 ; k < ARRAY_LEN (int_data) ; k++) - if ((unsigned) abs (int_data [k]) > max) - max = abs (int_data [k]) ; - - if (1.0 * abs (max - 0x7FFFFFFF) / 0x7FFFFFFF > 0.01) - { printf ("\n\nLine %d: Bad maximum (%d should be %d).\n\n", __LINE__, max, 0x7FFFFFFF) ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* float_int_big_test */ - -static void -double_short_little_test (const char * filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - unsigned k, max ; - - print_test_name ("double_short_little_test", filename) ; - - gen_windowed_sine_double (double_data, ARRAY_LEN (double_data), 0.98) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = ARRAY_LEN (short_data) ; - sfinfo.channels = 1 ; - sfinfo.format = SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_DOUBLE ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_double_or_die (file, 0, double_data, ARRAY_LEN (double_data), __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.frames != ARRAY_LEN (double_data)) - { printf ("\n\nLine %d: Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), DFT_DATA_LENGTH) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - test_read_short_or_die (file, 0, short_data, ARRAY_LEN (short_data), __LINE__) ; - sf_close (file) ; - - max = 0 ; - for (k = 0 ; k < ARRAY_LEN (short_data) ; k++) - if ((unsigned) abs (short_data [k]) > max) - max = abs (short_data [k]) ; - - if (1.0 * abs (max - 0x7FFF) / 0x7FFF > 0.01) - { printf ("\n\nLine %d: Bad maximum (%d should be %d).\n\n", __LINE__, max, 0x7FFF) ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* double_short_little_test */ - -static void -double_short_big_test (const char * filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - unsigned k, max ; - - print_test_name ("double_short_big_test", filename) ; - - gen_windowed_sine_double (double_data, ARRAY_LEN (double_data), 0.98) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = ARRAY_LEN (short_data) ; - sfinfo.channels = 1 ; - sfinfo.format = SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_DOUBLE ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_double_or_die (file, 0, double_data, ARRAY_LEN (double_data), __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.frames != ARRAY_LEN (double_data)) - { printf ("\n\nLine %d: Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), DFT_DATA_LENGTH) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - test_read_short_or_die (file, 0, short_data, ARRAY_LEN (short_data), __LINE__) ; - sf_close (file) ; - - max = 0 ; - for (k = 0 ; k < ARRAY_LEN (short_data) ; k++) - if ((unsigned) abs (short_data [k]) > max) - max = abs (short_data [k]) ; - - if (1.0 * abs (max - 0x7FFF) / 0x7FFF > 0.01) - { printf ("\n\nLine %d: Bad maximum (%d should be %d).\n\n", __LINE__, max, 0x7FFF) ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* double_short_big_test */ - -static void -double_int_little_test (const char * filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - unsigned k, max ; - - print_test_name ("double_int_little_test", filename) ; - - gen_windowed_sine_double (double_data, ARRAY_LEN (double_data), 0.98) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = ARRAY_LEN (int_data) ; - sfinfo.channels = 1 ; - sfinfo.format = SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_DOUBLE ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_double_or_die (file, 0, double_data, ARRAY_LEN (double_data), __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.frames != ARRAY_LEN (double_data)) - { printf ("\n\nLine %d: Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), DFT_DATA_LENGTH) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - test_read_int_or_die (file, 0, int_data, ARRAY_LEN (int_data), __LINE__) ; - sf_close (file) ; - - max = 0 ; - for (k = 0 ; k < ARRAY_LEN (int_data) ; k++) - if ((unsigned) abs (int_data [k]) > max) - max = abs (int_data [k]) ; - - if (1.0 * abs (max - 0x7FFFFFFF) / 0x7FFFFFFF > 0.01) - { printf ("\n\nLine %d: Bad maximum (%d should be %d).\n\n", __LINE__, max, 0x7FFFFFFF) ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* double_int_little_test */ - -static void -double_int_big_test (const char * filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - unsigned k, max ; - - print_test_name ("double_int_big_test", filename) ; - - gen_windowed_sine_double (double_data, ARRAY_LEN (double_data), 0.98) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = ARRAY_LEN (int_data) ; - sfinfo.channels = 1 ; - sfinfo.format = SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_DOUBLE ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_double_or_die (file, 0, double_data, ARRAY_LEN (double_data), __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.frames != ARRAY_LEN (double_data)) - { printf ("\n\nLine %d: Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), DFT_DATA_LENGTH) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - test_read_int_or_die (file, 0, int_data, ARRAY_LEN (int_data), __LINE__) ; - sf_close (file) ; - - max = 0 ; - for (k = 0 ; k < ARRAY_LEN (int_data) ; k++) - if ((unsigned) abs (int_data [k]) > max) - max = abs (int_data [k]) ; - - if (1.0 * abs (max - 0x7FFFFFFF) / 0x7FFFFFFF > 0.01) - { printf ("\n\nLine %d: Bad maximum (%d should be %d).\n\n", __LINE__, max, 0x7FFFFFFF) ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* double_int_big_test */ - - diff --git a/libs/libsndfile/tests/floating_point_test.def b/libs/libsndfile/tests/floating_point_test.def deleted file mode 100644 index 3441d34bc7..0000000000 --- a/libs/libsndfile/tests/floating_point_test.def +++ /dev/null @@ -1,32 +0,0 @@ -autogen definitions floating_point_test.tpl; - -endian_type = { - end_name = little ; - end_type = SF_ENDIAN_LITTLE ; - } ; - -endian_type = { - end_name = big ; - end_type = SF_ENDIAN_BIG ; - } ; - -float_type = { - float_name = float ; - minor_type = SF_FORMAT_FLOAT ; - } ; - -float_type = { - float_name = double ; - minor_type = SF_FORMAT_DOUBLE ; - } ; - -int_type = { - int_name = short ; - int_max = 0x7FFF ; - } ; - -int_type = { - int_name = int ; - int_max = 0x7FFFFFFF ; - } ; - diff --git a/libs/libsndfile/tests/floating_point_test.tpl b/libs/libsndfile/tests/floating_point_test.tpl deleted file mode 100644 index 4b2d21caab..0000000000 --- a/libs/libsndfile/tests/floating_point_test.tpl +++ /dev/null @@ -1,355 +0,0 @@ -[+ AutoGen5 template c +] -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "dft_cmp.h" -#include "utils.h" - -#define SAMPLE_RATE 16000 - -static void float_scaled_test (const char *filename, int allow_exit, int replace_float, int filetype, double target_snr) ; -static void double_scaled_test (const char *filename, int allow_exit, int replace_float, int filetype, double target_snr) ; - -[+ FOR float_type +][+ FOR int_type +][+ FOR endian_type -+]static void [+ (get "float_name") +]_[+ (get "int_name") +]_[+ (get "end_name") +]_test (const char * filename) ; -[+ ENDFOR endian_type +][+ ENDFOR int_type +][+ ENDFOR float_type -+] - -static double double_data [DFT_DATA_LENGTH] ; -static double double_test [DFT_DATA_LENGTH] ; - -static float float_data [DFT_DATA_LENGTH] ; -static float float_test [DFT_DATA_LENGTH] ; - -static double double_data [DFT_DATA_LENGTH] ; -static short short_data [DFT_DATA_LENGTH] ; -static int int_data [DFT_DATA_LENGTH] ; - -int -main (int argc, char *argv []) -{ int allow_exit = 1 ; - - if (argc == 2 && ! strstr (argv [1], "no-exit")) - allow_exit = 0 ; - -#if (HAVE_LRINTF == 0) - puts ("*** Cannot run this test on this platform because it lacks lrintf().") ; - exit (0) ; -#endif - - /* Float tests. */ - float_scaled_test ("float.raw", allow_exit, SF_FALSE, SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_FLOAT, -163.0) ; - - /* Test both signed and unsigned 8 bit files. */ - float_scaled_test ("pcm_s8.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_S8, -39.0) ; - float_scaled_test ("pcm_u8.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_U8, -39.0) ; - - float_scaled_test ("pcm_16.raw", allow_exit, SF_FALSE, SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_16, -87.0) ; - float_scaled_test ("pcm_24.raw", allow_exit, SF_FALSE, SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_24, -138.0) ; - float_scaled_test ("pcm_32.raw", allow_exit, SF_FALSE, SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_32, -163.0) ; - - float_scaled_test ("ulaw.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_ULAW, -50.0) ; - float_scaled_test ("alaw.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_ALAW, -49.0) ; - - float_scaled_test ("ima_adpcm.wav", allow_exit, SF_FALSE, SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, -47.0) ; - float_scaled_test ("ms_adpcm.wav" , allow_exit, SF_FALSE, SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, -40.0) ; - float_scaled_test ("gsm610.raw" , allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_GSM610, -33.0) ; - - float_scaled_test ("g721_32.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G721_32, -34.0) ; - float_scaled_test ("g723_24.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G723_24, -34.0) ; - float_scaled_test ("g723_40.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G723_40, -40.0) ; - - /* PAF files do not use the same encoding method for 24 bit PCM data as other file - ** formats so we need to explicitly test it here. - */ - float_scaled_test ("le_paf_24.paf", allow_exit, SF_FALSE, SF_ENDIAN_LITTLE | SF_FORMAT_PAF | SF_FORMAT_PCM_24, -149.0) ; - float_scaled_test ("be_paf_24.paf", allow_exit, SF_FALSE, SF_ENDIAN_BIG | SF_FORMAT_PAF | SF_FORMAT_PCM_24, -149.0) ; - - float_scaled_test ("dwvw_12.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_12, -64.0) ; - float_scaled_test ("dwvw_16.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_16, -92.0) ; - float_scaled_test ("dwvw_24.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_24, -151.0) ; - - float_scaled_test ("adpcm.vox", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, -40.0) ; - - float_scaled_test ("dpcm_16.xi", allow_exit, SF_FALSE, SF_FORMAT_XI | SF_FORMAT_DPCM_16, -90.0) ; - float_scaled_test ("dpcm_8.xi" , allow_exit, SF_FALSE, SF_FORMAT_XI | SF_FORMAT_DPCM_8 , -41.0) ; - - float_scaled_test ("pcm_s8.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_S8, -90.0) ; - float_scaled_test ("pcm_16.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_16, -140.0) ; - float_scaled_test ("pcm_24.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_24, -170.0) ; - - float_scaled_test ("alac_16.caf", allow_exit, SF_FALSE, SF_FORMAT_CAF | SF_FORMAT_ALAC_16, -90.0) ; - float_scaled_test ("alac_32.caf", allow_exit, SF_FALSE, SF_FORMAT_CAF | SF_FORMAT_ALAC_32, -181.0) ; - float_scaled_test ("alac_24.caf", allow_exit, SF_FALSE, SF_FORMAT_CAF | SF_FORMAT_ALAC_24, -160.0) ; - float_scaled_test ("alac_20.caf", allow_exit, SF_FALSE, SF_FORMAT_CAF | SF_FORMAT_ALAC_20, -134.0) ; - -#if HAVE_EXTERNAL_LIBS - float_scaled_test ("flac_8.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_S8, -39.0) ; - float_scaled_test ("flac_16.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_16, -87.0) ; - float_scaled_test ("flac_24.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_24, -138.0) ; - - float_scaled_test ("vorbis.oga", allow_exit, SF_FALSE, SF_FORMAT_OGG | SF_FORMAT_VORBIS, -31.0) ; -#endif - - float_scaled_test ("replace_float.raw", allow_exit, SF_TRUE, SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_FLOAT, -163.0) ; - - /*============================================================================== - ** Double tests. - */ - - double_scaled_test ("double.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DOUBLE, -205.0) ; - - /* Test both signed (AIFF) and unsigned (WAV) 8 bit files. */ - double_scaled_test ("pcm_s8.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_S8, -39.0) ; - double_scaled_test ("pcm_u8.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_U8, -39.0) ; - - double_scaled_test ("pcm_16.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_16, -87.0) ; - double_scaled_test ("pcm_24.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_24, -135.0) ; - double_scaled_test ("pcm_32.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_PCM_32, -184.0) ; - - double_scaled_test ("ulaw.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_ULAW, -50.0) ; - double_scaled_test ("alaw.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_ALAW, -49.0) ; - - double_scaled_test ("ima_adpcm.wav", allow_exit, SF_FALSE, SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, -47.0) ; - double_scaled_test ("ms_adpcm.wav" , allow_exit, SF_FALSE, SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, -40.0) ; - double_scaled_test ("gsm610.raw" , allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_GSM610, -33.0) ; - - double_scaled_test ("g721_32.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G721_32, -34.0) ; - double_scaled_test ("g723_24.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G723_24, -34.0) ; - double_scaled_test ("g723_40.au", allow_exit, SF_FALSE, SF_FORMAT_AU | SF_FORMAT_G723_40, -40.0) ; - - /* 24 bit PCM PAF files tested here. */ - double_scaled_test ("be_paf_24.paf", allow_exit, SF_FALSE, SF_ENDIAN_BIG | SF_FORMAT_PAF | SF_FORMAT_PCM_24, -151.0) ; - double_scaled_test ("le_paf_24.paf", allow_exit, SF_FALSE, SF_ENDIAN_LITTLE | SF_FORMAT_PAF | SF_FORMAT_PCM_24, -151.0) ; - - double_scaled_test ("dwvw_12.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_12, -64.0) ; - double_scaled_test ("dwvw_16.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_16, -92.0) ; - double_scaled_test ("dwvw_24.raw", allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_DWVW_24, -151.0) ; - - double_scaled_test ("adpcm.vox" , allow_exit, SF_FALSE, SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, -40.0) ; - - double_scaled_test ("dpcm_16.xi", allow_exit, SF_FALSE, SF_FORMAT_XI | SF_FORMAT_DPCM_16, -90.0) ; - double_scaled_test ("dpcm_8.xi" , allow_exit, SF_FALSE, SF_FORMAT_XI | SF_FORMAT_DPCM_8 , -42.0) ; - - double_scaled_test ("pcm_s8.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_S8, -90.0) ; - double_scaled_test ("pcm_16.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_16, -140.0) ; - double_scaled_test ("pcm_24.sds", allow_exit, SF_FALSE, SF_FORMAT_SDS | SF_FORMAT_PCM_24, -180.0) ; - - double_scaled_test ("alac_16.caf", allow_exit, SF_FALSE, SF_FORMAT_CAF | SF_FORMAT_ALAC_16, -90.0) ; - double_scaled_test ("alac_20.caf", allow_exit, SF_FALSE, SF_FORMAT_CAF | SF_FORMAT_ALAC_20, -134.0) ; - double_scaled_test ("alac_24.caf", allow_exit, SF_FALSE, SF_FORMAT_CAF | SF_FORMAT_ALAC_24, -158.0) ; - double_scaled_test ("alac_32.caf", allow_exit, SF_FALSE, SF_FORMAT_CAF | SF_FORMAT_ALAC_32, -186.0) ; - -#if HAVE_EXTERNAL_LIBS - double_scaled_test ("flac_8.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_S8, -39.0) ; - double_scaled_test ("flac_16.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_16, -87.0) ; - double_scaled_test ("flac_24.flac", allow_exit, SF_FALSE, SF_FORMAT_FLAC | SF_FORMAT_PCM_24, -138.0) ; - - double_scaled_test ("vorbis.oga", allow_exit, SF_FALSE, SF_FORMAT_OGG | SF_FORMAT_VORBIS, -29.0) ; -#endif - - double_scaled_test ("replace_double.raw", allow_exit, SF_TRUE, SF_FORMAT_RAW | SF_FORMAT_DOUBLE, -205.0) ; - - putchar ('\n') ; - /* Float int tests. */ -[+ FOR float_type +][+ FOR int_type +][+ FOR endian_type -+] [+ (get "float_name") +]_[+ (get "int_name") +]_[+ (get "end_name") +]_test ("[+ (get "float_name") +]_[+ (get "int_name") +]_[+ (get "end_name") +].au") ; -[+ ENDFOR endian_type +][+ ENDFOR int_type +][+ ENDFOR float_type -+] - - return 0 ; -} /* main */ - -/*============================================================================================ - * Here are the test functions. - */ - -static void -float_scaled_test (const char *filename, int allow_exit, int replace_float, int filetype, double target_snr) -{ SNDFILE *file ; - SF_INFO sfinfo ; - double snr ; - int byterate ; - - print_test_name ("float_scaled_test", filename) ; - - gen_windowed_sine_float (float_data, DFT_DATA_LENGTH, 1.0) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DFT_DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - - test_write_float_or_die (file, 0, float_data, DFT_DATA_LENGTH, __LINE__) ; - - sf_close (file) ; - - memset (float_test, 0, sizeof (float_test)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - - exit_if_true (sfinfo.format != filetype, "\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit_if_true (sfinfo.frames < DFT_DATA_LENGTH, "\n\nLine %d: Incorrect number of frames in file (too short). (%" PRId64 " should be %d)\n", __LINE__, sfinfo.frames, DFT_DATA_LENGTH) ; - exit_if_true (sfinfo.channels != 1, "\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_float_or_die (file, 0, float_test, DFT_DATA_LENGTH, __LINE__) ; - - byterate = sf_current_byterate (file) ; - exit_if_true (byterate <= 0, "\n\nLine %d: byterate is zero.\n", __LINE__) ; - - sf_close (file) ; - - snr = dft_cmp_float (__LINE__, float_data, float_test, DFT_DATA_LENGTH, target_snr, allow_exit) ; - - exit_if_true (snr > target_snr, "% 6.1fdB SNR\n\n Error : should be better than % 6.1fdB\n\n", snr, target_snr) ; - - printf ("% 6.1fdB SNR ... ok\n", snr) ; - - unlink (filename) ; - - return ; -} /* float_scaled_test */ - -static void -double_scaled_test (const char *filename, int allow_exit, int replace_float, int filetype, double target_snr) -{ SNDFILE *file ; - SF_INFO sfinfo ; - double snr ; - int byterate ; - - print_test_name ("double_scaled_test", filename) ; - - gen_windowed_sine_double (double_data, DFT_DATA_LENGTH, 0.95) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DFT_DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - - test_write_double_or_die (file, 0, double_data, DFT_DATA_LENGTH, __LINE__) ; - - sf_close (file) ; - - memset (double_test, 0, sizeof (double_test)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - - exit_if_true (sfinfo.format != filetype, "\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit_if_true (sfinfo.frames < DFT_DATA_LENGTH, "\n\nLine %d: Incorrect number of frames in file (too short). (%" PRId64 " should be %d)\n", __LINE__, sfinfo.frames, DFT_DATA_LENGTH) ; - exit_if_true (sfinfo.channels != 1, "\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, double_test, DFT_DATA_LENGTH, __LINE__) ; - - byterate = sf_current_byterate (file) ; - exit_if_true (byterate <= 0, "\n\nLine %d: byterate is zero.\n", __LINE__) ; - - sf_close (file) ; - - snr = dft_cmp_double (__LINE__, double_data, double_test, DFT_DATA_LENGTH, target_snr, allow_exit) ; - - exit_if_true (snr > target_snr, "% 6.1fdB SNR\n\n Error : should be better than % 6.1fdB\n\n", snr, target_snr) ; - - printf ("% 6.1fdB SNR ... ok\n", snr) ; - - unlink (filename) ; - - return ; -} /* double_scaled_test */ - -/*============================================================================== -*/ - -[+ FOR float_type +][+ FOR int_type +][+ FOR endian_type -+] -static void -[+ (get "float_name") +]_[+ (get "int_name") +]_[+ (get "end_name") +]_test (const char * filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - unsigned k, max ; - - print_test_name ("[+ (get "float_name") +]_[+ (get "int_name") +]_[+ (get "end_name") +]_test", filename) ; - - gen_windowed_sine_[+ (get "float_name") +] ([+ (get "float_name") +]_data, ARRAY_LEN ([+ (get "float_name") +]_data), 0.98) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = ARRAY_LEN ([+ (get "int_name") +]_data) ; - sfinfo.channels = 1 ; - sfinfo.format = [+ (get "end_type") +] | SF_FORMAT_AU | [+ (get "minor_type") +] ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_[+ (get "float_name") +]_or_die (file, 0, [+ (get "float_name") +]_data, ARRAY_LEN ([+ (get "float_name") +]_data), __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.frames != ARRAY_LEN ([+ (get "float_name") +]_data)) - { printf ("\n\nLine %d: Incorrect number of frames in file (too short). (%" PRId64 " should be %d)\n", __LINE__, sfinfo.frames, DFT_DATA_LENGTH) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - test_read_[+ (get "int_name") +]_or_die (file, 0, [+ (get "int_name") +]_data, ARRAY_LEN ([+ (get "int_name") +]_data), __LINE__) ; - sf_close (file) ; - - max = 0 ; - for (k = 0 ; k < ARRAY_LEN ([+ (get "int_name") +]_data) ; k++) - if ((unsigned) abs ([+ (get "int_name") +]_data [k]) > max) - max = abs ([+ (get "int_name") +]_data [k]) ; - - if (1.0 * abs (max - [+ (get "int_max") +]) / [+ (get "int_max") +] > 0.01) - { printf ("\n\nLine %d: Bad maximum (%d should be %d).\n\n", __LINE__, max, [+ (get "int_max") +]) ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* [+ (get "float_name") +]_[+ (get "int_name") +]_[+ (get "end_name") +]_test */ -[+ ENDFOR endian_type +][+ ENDFOR int_type +][+ ENDFOR float_type +] - diff --git a/libs/libsndfile/tests/format_check_test.c b/libs/libsndfile/tests/format_check_test.c deleted file mode 100644 index a371c71ff7..0000000000 --- a/libs/libsndfile/tests/format_check_test.c +++ /dev/null @@ -1,149 +0,0 @@ -/* -** Copyright (C) 2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include "sndfile.h" -#include "utils.h" - -static void format_error_test (void) ; -static void format_combo_test (void) ; - -int -main (void) -{ - format_error_test () ; - format_combo_test () ; - - return 0 ; -} /* main */ - -/*============================================================================== -*/ - -static void -format_error_test (void) -{ const char *filename = "format-error.wav" ; - SNDFILE *file ; - SF_INFO info ; - - print_test_name (__func__, NULL) ; - - memset (&info, 0, sizeof (info)) ; - info.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16 ; - info.channels = 1 ; - info.samplerate = 44100 ; - - info.format = SF_FORMAT_WAV ; - file = sf_open (filename, SFM_WRITE, &info) ; - exit_if_true (file != NULL, "\n\nLine %d : Format should not be valid.\n\n", __LINE__) ; - exit_if_true ( - strstr (sf_strerror (NULL), "minor format") == NULL, - "\n\nLine %d : Error string should reference bad 'minor format'.\n\n", __LINE__ - ) ; - - info.format = SF_FORMAT_PCM_16 ; - file = sf_open (filename, SFM_WRITE, &info) ; - exit_if_true (file != NULL, "\n\nLine %d : Format should not be valid.\n\n", __LINE__) ; - exit_if_true ( - strstr (sf_strerror (NULL), "major format") == NULL, - "\n\nLine %d : Error string should reference bad 'major format'.\n\n", __LINE__ - ) ; - - unlink (filename) ; - puts ("ok") ; -} /* format_error_test */ - -static void -format_combo_test (void) -{ int container_max, codec_max, cont, codec ; - - print_test_name (__func__, NULL) ; - - sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &container_max, sizeof (container_max)) ; - sf_command (NULL, SFC_GET_FORMAT_SUBTYPE_COUNT, &codec_max, sizeof (codec_max)) ; - - for (cont = 0 ; cont < container_max + 10 ; cont ++) - { SF_FORMAT_INFO major_fmt_info ; - - memset (&major_fmt_info, 0, sizeof (major_fmt_info)) ; - major_fmt_info.format = cont ; - (void) sf_command (NULL, SFC_GET_FORMAT_MAJOR, &major_fmt_info, sizeof (major_fmt_info)) ; - - for (codec = 0 ; codec < codec_max + 10 ; codec ++) - { SF_FORMAT_INFO subtype_fmt_info ; - SNDFILE * sndfile ; - SF_INFO info ; - char filename [128] ; - int subtype_is_valid, check_is_valid ; - - memset (&subtype_fmt_info, 0, sizeof (subtype_fmt_info)) ; - subtype_fmt_info.format = codec ; - subtype_is_valid = sf_command (NULL, SFC_GET_FORMAT_SUBTYPE, &subtype_fmt_info, sizeof (subtype_fmt_info)) == 0 ; - - sf_info_setup (&info, major_fmt_info.format | subtype_fmt_info.format, 22050, 1) ; - - check_is_valid = sf_format_check (&info) ; - - exit_if_true ( - NOT (subtype_is_valid) && check_is_valid, - "\n\nLine %d : Subtype is not valid but checks ok.\n", - __LINE__ - ) ; - - snprintf (filename, sizeof (filename), "format-check.%s", major_fmt_info.extension) ; - - sndfile = sf_open (filename, SFM_WRITE, &info) ; - - sf_close (sndfile) ; - unlink (filename) ; - - if (major_fmt_info.extension != NULL && strcmp (major_fmt_info.extension, "sd2") == 0) - { snprintf (filename, sizeof (filename), "._format-check.%s", major_fmt_info.extension) ; - unlink (filename) ; - } ; - - exit_if_true ( - sndfile && NOT (check_is_valid), - "\n\nError : Format was not valid but file opened correctly.\n" - " Container : %s\n" - " Codec : %s\n\n", - major_fmt_info.name, subtype_fmt_info.name - ) ; - - exit_if_true ( - NOT (sndfile) && check_is_valid, - "\n\nError : Format was valid but file failed to open.\n" - " Container : %s\n" - " Codec : %s\n\n", - major_fmt_info.name, subtype_fmt_info.name - ) ; - } ; - } ; - - puts ("ok") ; -} /* format_combo_test */ - diff --git a/libs/libsndfile/tests/generate.c b/libs/libsndfile/tests/generate.c deleted file mode 100644 index 653018b0f4..0000000000 --- a/libs/libsndfile/tests/generate.c +++ /dev/null @@ -1,73 +0,0 @@ -/* -** Copyright (C) 2007-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include - -#include - -#include "utils.h" -#include "generate.h" - -#define SF_MAX(x, y) ((x) > (y) ? (x) : (y)) - -static float crappy_snare (float *output, int len, int offset, float gain, float maxabs) ; - -void -generate_file (const char * filename, int format, int len) -{ float * output ; - float maxabs = 0.0 ; - - output = calloc (len, sizeof (float)) ; - - maxabs = crappy_snare (output, len, 0, 0.95, maxabs) ; - maxabs = crappy_snare (output, len, len / 4, 0.85, maxabs) ; - maxabs = crappy_snare (output, len, 2 * len / 4, 0.85, maxabs) ; - crappy_snare (output, len, 3 * len / 4, 0.85, maxabs) ; - - write_mono_file (filename, format, 44100, output, len) ; - - free (output) ; -} /* generate_file */ - -static inline float -rand_float (void) -{ return rand () / (0.5 * RAND_MAX) - 1.0 ; -} /* rand_float */ - -static float -crappy_snare (float *output, int len, int offset, float gain, float maxabs) -{ int k ; - float env = 0.0 ; - - for (k = offset ; k < len && env < gain ; k++) - { env += 0.03 ; - output [k] += env * rand_float () ; - maxabs = SF_MAX (maxabs, fabs (output [k])) ; - } ; - - for ( ; k < len && env > 1e-8 ; k++) - { env *= 0.995 ; - output [k] += env * rand_float () ; - maxabs = SF_MAX (maxabs, fabs (output [k])) ; - } ; - - return maxabs ; -} /* crappy_snare */ diff --git a/libs/libsndfile/tests/generate.h b/libs/libsndfile/tests/generate.h deleted file mode 100644 index 709ea61191..0000000000 --- a/libs/libsndfile/tests/generate.h +++ /dev/null @@ -1,19 +0,0 @@ -/* -** Copyright (C) 2007-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -void generate_file (const char * filename, int format, int len) ; diff --git a/libs/libsndfile/tests/header_test.c b/libs/libsndfile/tests/header_test.c deleted file mode 100644 index 9802fd9e58..0000000000 --- a/libs/libsndfile/tests/header_test.c +++ /dev/null @@ -1,741 +0,0 @@ -/* -** Copyright (C) 2001-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#if (defined (WIN32) || defined (_WIN32)) -#include -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_LEN (1<<10) -#define LOG_BUFFER_SIZE 1024 - -static void update_header_test (const char *filename, int typemajor) ; - -static void update_seek_short_test (const char *filename, int filetype) ; -static void update_seek_int_test (const char *filename, int filetype) ; -static void update_seek_float_test (const char *filename, int filetype) ; -static void update_seek_double_test (const char *filename, int filetype) ; - - -static void extra_header_test (const char *filename, int filetype) ; - -static void header_shrink_test (const char *filename, int filetype) ; - -/* Force the start of this buffer to be double aligned. Sparc-solaris will -** choke if its not. -*/ -static int data_out [BUFFER_LEN] ; -static int data_in [BUFFER_LEN] ; - -int -main (int argc, char *argv []) -{ int do_all = 0 ; - int test_count = 0 ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" wav - test WAV file peak chunk\n") ; - printf (" aiff - test AIFF file PEAK chunk\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all=!strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "wav")) - { update_header_test ("header.wav", SF_FORMAT_WAV) ; - update_seek_short_test ("header_short.wav", SF_FORMAT_WAV) ; - update_seek_int_test ("header_int.wav", SF_FORMAT_WAV) ; - update_seek_float_test ("header_float.wav", SF_FORMAT_WAV) ; - update_seek_double_test ("header_double.wav", SF_FORMAT_WAV) ; - header_shrink_test ("header_shrink.wav", SF_FORMAT_WAV) ; - extra_header_test ("extra.wav", SF_FORMAT_WAV) ; - - update_header_test ("header.wavex", SF_FORMAT_WAVEX) ; - update_seek_short_test ("header_short.wavex", SF_FORMAT_WAVEX) ; - update_seek_int_test ("header_int.wavex", SF_FORMAT_WAVEX) ; - update_seek_float_test ("header_float.wavex", SF_FORMAT_WAVEX) ; - update_seek_double_test ("header_double.wavex", SF_FORMAT_WAVEX) ; - header_shrink_test ("header_shrink.wavex", SF_FORMAT_WAVEX) ; - extra_header_test ("extra.wavex", SF_FORMAT_WAVEX) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { update_header_test ("header.aiff", SF_FORMAT_AIFF) ; - update_seek_short_test ("header_short.aiff", SF_FORMAT_AIFF) ; - update_seek_int_test ("header_int.aiff", SF_FORMAT_AIFF) ; - update_seek_float_test ("header_float.aiff", SF_FORMAT_AIFF) ; - update_seek_double_test ("header_double.aiff", SF_FORMAT_AIFF) ; - header_shrink_test ("header_shrink.wav", SF_FORMAT_AIFF) ; - extra_header_test ("extra.aiff", SF_FORMAT_AIFF) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "au")) - { update_header_test ("header.au", SF_FORMAT_AU) ; - update_seek_short_test ("header_short.au", SF_FORMAT_AU) ; - update_seek_int_test ("header_int.au", SF_FORMAT_AU) ; - update_seek_float_test ("header_float.au", SF_FORMAT_AU) ; - update_seek_double_test ("header_double.au", SF_FORMAT_AU) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "caf")) - { update_header_test ("header.caf", SF_FORMAT_CAF) ; - update_seek_short_test ("header_short.caf", SF_FORMAT_CAF) ; - update_seek_int_test ("header_int.caf", SF_FORMAT_CAF) ; - update_seek_float_test ("header_float.caf", SF_FORMAT_CAF) ; - update_seek_double_test ("header_double.caf", SF_FORMAT_CAF) ; - /* extra_header_test ("extra.caf", SF_FORMAT_CAF) ; */ - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "nist")) - { update_header_test ("header.nist", SF_FORMAT_NIST) ; - update_seek_short_test ("header_short.nist", SF_FORMAT_NIST) ; - update_seek_int_test ("header_int.nist", SF_FORMAT_NIST) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "paf")) - { update_header_test ("header.paf", SF_FORMAT_PAF) ; - update_seek_short_test ("header_short.paf", SF_FORMAT_PAF) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "ircam")) - { update_header_test ("header.ircam", SF_FORMAT_IRCAM) ; - update_seek_short_test ("header_short.ircam", SF_FORMAT_IRCAM) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "w64")) - { update_header_test ("header.w64", SF_FORMAT_W64) ; - update_seek_short_test ("header_short.w64", SF_FORMAT_W64) ; - update_seek_int_test ("header_int.w64", SF_FORMAT_W64) ; - update_seek_float_test ("header_float.w64", SF_FORMAT_W64) ; - update_seek_double_test ("header_double.w64", SF_FORMAT_W64) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "rf64")) - { update_header_test ("header.rf64", SF_FORMAT_RF64) ; - update_seek_short_test ("header_short.rf64", SF_FORMAT_RF64) ; - update_seek_int_test ("header_int.rf64", SF_FORMAT_RF64) ; - update_seek_float_test ("header_float.rf64", SF_FORMAT_RF64) ; - update_seek_double_test ("header_double.rf64", SF_FORMAT_RF64) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat4")) - { update_header_test ("header.mat4", SF_FORMAT_MAT4) ; - update_seek_short_test ("header_short.mat4", SF_FORMAT_MAT4) ; - update_seek_int_test ("header_int.mat4", SF_FORMAT_MAT4) ; - update_seek_float_test ("header_float.mat4", SF_FORMAT_MAT4) ; - update_seek_double_test ("header_double.mat4", SF_FORMAT_MAT4) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat5")) - { update_header_test ("header.mat5", SF_FORMAT_MAT5) ; - update_seek_short_test ("header_short.mat5", SF_FORMAT_MAT5) ; - update_seek_int_test ("header_int.mat5", SF_FORMAT_MAT5) ; - update_seek_float_test ("header_float.mat5", SF_FORMAT_MAT5) ; - update_seek_double_test ("header_double.mat5", SF_FORMAT_MAT5) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "pvf")) - { update_header_test ("header.pvf", SF_FORMAT_PVF) ; - update_seek_short_test ("header_short.pvf", SF_FORMAT_PVF) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "avr")) - { update_header_test ("header.avr", SF_FORMAT_AVR) ; - update_seek_short_test ("header_short.avr", SF_FORMAT_AVR) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "htk")) - { update_header_test ("header.htk", SF_FORMAT_HTK) ; - update_seek_short_test ("header_short.htk", SF_FORMAT_HTK) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "svx")) - { update_header_test ("header.svx", SF_FORMAT_SVX) ; - update_seek_short_test ("header_short.svx", SF_FORMAT_SVX) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "voc")) - { update_header_test ("header.voc", SF_FORMAT_VOC) ; - /*-update_seek_short_test ("header_short.voc", SF_FORMAT_VOC) ;-*/ - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "sds")) - { update_header_test ("header.sds", SF_FORMAT_SDS) ; - /*-update_seek_short_test ("header_short.sds", SF_FORMAT_SDS) ;-*/ - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mpc2k")) - { update_header_test ("header.mpc", SF_FORMAT_MPC2K) ; - update_seek_short_test ("header_short.mpc", SF_FORMAT_MPC2K) ; - test_count++ ; - } ; - - if (test_count == 0) - { printf ("Mono : ************************************\n") ; - printf ("Mono : * No '%s' test defined.\n", argv [1]) ; - printf ("Mono : ************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -update_header_sub (const char *filename, int typemajor, int write_mode) -{ SNDFILE *outfile, *infile ; - SF_INFO sfinfo ; - int k ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = (typemajor | SF_FORMAT_PCM_16) ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - - outfile = test_open_file_or_die (filename, write_mode, &sfinfo, SF_TRUE, __LINE__) ; - - for (k = 0 ; k < BUFFER_LEN ; k++) - data_out [k] = k + 1 ; - test_write_int_or_die (outfile, 0, data_out, BUFFER_LEN, __LINE__) ; - - if (typemajor != SF_FORMAT_HTK) - { /* The HTK header is not correct when the file is first written. */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_close (infile) ; - } ; - - sf_command (outfile, SFC_UPDATE_HEADER_NOW, NULL, 0) ; - - /* - ** Open file and check log buffer for an error. If header update failed - ** the the log buffer will contain errors. - */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - check_log_buffer_or_die (infile, __LINE__) ; - - if (sfinfo.frames < BUFFER_LEN || sfinfo.frames > BUFFER_LEN + 50) - { printf ("\n\nLine %d : Incorrect sample count (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), BUFFER_LEN) ; - dump_log_buffer (infile) ; - exit (1) ; - } ; - - test_read_int_or_die (infile, 0, data_in, BUFFER_LEN, __LINE__) ; - for (k = 0 ; k < BUFFER_LEN ; k++) - if (data_out [k] != k + 1) - printf ("Error : line %d\n", __LINE__) ; - - sf_close (infile) ; - - /* Set auto update on. */ - sf_command (outfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ; - - /* Write more data_out. */ - for (k = 0 ; k < BUFFER_LEN ; k++) - data_out [k] = k + 2 ; - test_write_int_or_die (outfile, 0, data_out, BUFFER_LEN, __LINE__) ; - - /* Open file again and make sure no errors in log buffer. */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - check_log_buffer_or_die (infile, __LINE__) ; - - if (sfinfo.frames < 2 * BUFFER_LEN || sfinfo.frames > 2 * BUFFER_LEN + 50) - { printf ("\n\nLine %d : Incorrect sample count (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 2 * BUFFER_LEN) ; - dump_log_buffer (infile) ; - exit (1) ; - } ; - - sf_close (infile) ; - - sf_close (outfile) ; - - unlink (filename) ; -} /* update_header_sub */ - -static void -update_header_test (const char *filename, int typemajor) -{ - print_test_name ("update_header_test", filename) ; - - update_header_sub (filename, typemajor, SFM_WRITE) ; - update_header_sub (filename, typemajor, SFM_RDWR) ; - - unlink (filename) ; - puts ("ok") ; -} /* update_header_test */ - -/*============================================================================== -*/ - -static void -update_seek_short_test (const char *filename, int filetype) -{ SNDFILE *outfile, *infile ; - SF_INFO sfinfo ; - sf_count_t frames ; - short buffer [8] ; - int k ; - - print_test_name ("update_seek_short_test", filename) ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Create sound outfile with no data. */ - sfinfo.format = filetype | SF_FORMAT_PCM_16 ; - sfinfo.samplerate = 48000 ; - sfinfo.channels = 2 ; - - if (sf_format_check (&sfinfo) == SF_FALSE) - sfinfo.channels = 1 ; - - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_close (outfile) ; - - /* Open again for read/write. */ - outfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - - /* - ** In auto header update mode, seeking to the end of the file with - ** SEEK_SET will fail from the 2nd seek on. seeking to 0, SEEK_END - ** will seek to 0 anyway - */ - if (sf_command (outfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) == 0) - { printf ("\n\nError : sf_command (SFC_SET_UPDATE_HEADER_AUTO) return error : %s\n\n", sf_strerror (outfile)) ; - exit (1) ; - } ; - - /* Now write some frames. */ - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - for (k = 0 ; k < 6 ; k++) - { test_seek_or_die (outfile, k * frames, SEEK_SET, k * frames, sfinfo.channels, __LINE__) ; - test_seek_or_die (outfile, 0, SEEK_END, k * frames, sfinfo.channels, __LINE__) ; - - /* Open file again and make sure no errors in log buffer. */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - check_log_buffer_or_die (infile, __LINE__) ; - sf_close (infile) ; - - if (sfinfo.frames != k * frames) - { printf ("\n\nLine %d : Incorrect sample count (%ld should be %ld)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), SF_COUNT_TO_LONG (k + frames)) ; - dump_log_buffer (infile) ; - exit (1) ; - } ; - - if ((k & 1) == 0) - test_write_short_or_die (outfile, k, buffer, sfinfo.channels * frames, __LINE__) ; - else - test_writef_short_or_die (outfile, k, buffer, frames, __LINE__) ; - } ; - - sf_close (outfile) ; - unlink (filename) ; - - puts ("ok") ; - return ; -} /* update_seek_short_test */ - -static void -update_seek_int_test (const char *filename, int filetype) -{ SNDFILE *outfile, *infile ; - SF_INFO sfinfo ; - sf_count_t frames ; - int buffer [8] ; - int k ; - - print_test_name ("update_seek_int_test", filename) ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Create sound outfile with no data. */ - sfinfo.format = filetype | SF_FORMAT_PCM_32 ; - sfinfo.samplerate = 48000 ; - sfinfo.channels = 2 ; - - if (sf_format_check (&sfinfo) == SF_FALSE) - sfinfo.channels = 1 ; - - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_close (outfile) ; - - /* Open again for read/write. */ - outfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - - /* - ** In auto header update mode, seeking to the end of the file with - ** SEEK_SET will fail from the 2nd seek on. seeking to 0, SEEK_END - ** will seek to 0 anyway - */ - if (sf_command (outfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) == 0) - { printf ("\n\nError : sf_command (SFC_SET_UPDATE_HEADER_AUTO) return error : %s\n\n", sf_strerror (outfile)) ; - exit (1) ; - } ; - - /* Now write some frames. */ - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - for (k = 0 ; k < 6 ; k++) - { test_seek_or_die (outfile, k * frames, SEEK_SET, k * frames, sfinfo.channels, __LINE__) ; - test_seek_or_die (outfile, 0, SEEK_END, k * frames, sfinfo.channels, __LINE__) ; - - /* Open file again and make sure no errors in log buffer. */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - check_log_buffer_or_die (infile, __LINE__) ; - sf_close (infile) ; - - if (sfinfo.frames != k * frames) - { printf ("\n\nLine %d : Incorrect sample count (%ld should be %ld)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), SF_COUNT_TO_LONG (k + frames)) ; - dump_log_buffer (infile) ; - exit (1) ; - } ; - - if ((k & 1) == 0) - test_write_int_or_die (outfile, k, buffer, sfinfo.channels * frames, __LINE__) ; - else - test_writef_int_or_die (outfile, k, buffer, frames, __LINE__) ; - } ; - - sf_close (outfile) ; - unlink (filename) ; - - puts ("ok") ; - return ; -} /* update_seek_int_test */ - -static void -update_seek_float_test (const char *filename, int filetype) -{ SNDFILE *outfile, *infile ; - SF_INFO sfinfo ; - sf_count_t frames ; - float buffer [8] ; - int k ; - - print_test_name ("update_seek_float_test", filename) ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Create sound outfile with no data. */ - sfinfo.format = filetype | SF_FORMAT_FLOAT ; - sfinfo.samplerate = 48000 ; - sfinfo.channels = 2 ; - - if (sf_format_check (&sfinfo) == SF_FALSE) - sfinfo.channels = 1 ; - - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_close (outfile) ; - - /* Open again for read/write. */ - outfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - - /* - ** In auto header update mode, seeking to the end of the file with - ** SEEK_SET will fail from the 2nd seek on. seeking to 0, SEEK_END - ** will seek to 0 anyway - */ - if (sf_command (outfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) == 0) - { printf ("\n\nError : sf_command (SFC_SET_UPDATE_HEADER_AUTO) return error : %s\n\n", sf_strerror (outfile)) ; - exit (1) ; - } ; - - /* Now write some frames. */ - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - for (k = 0 ; k < 6 ; k++) - { test_seek_or_die (outfile, k * frames, SEEK_SET, k * frames, sfinfo.channels, __LINE__) ; - test_seek_or_die (outfile, 0, SEEK_END, k * frames, sfinfo.channels, __LINE__) ; - - /* Open file again and make sure no errors in log buffer. */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - check_log_buffer_or_die (infile, __LINE__) ; - sf_close (infile) ; - - if (sfinfo.frames != k * frames) - { printf ("\n\nLine %d : Incorrect sample count (%ld should be %ld)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), SF_COUNT_TO_LONG (k + frames)) ; - dump_log_buffer (infile) ; - exit (1) ; - } ; - - if ((k & 1) == 0) - test_write_float_or_die (outfile, k, buffer, sfinfo.channels * frames, __LINE__) ; - else - test_writef_float_or_die (outfile, k, buffer, frames, __LINE__) ; - } ; - - sf_close (outfile) ; - unlink (filename) ; - - puts ("ok") ; - return ; -} /* update_seek_float_test */ - -static void -update_seek_double_test (const char *filename, int filetype) -{ SNDFILE *outfile, *infile ; - SF_INFO sfinfo ; - sf_count_t frames ; - double buffer [8] ; - int k ; - - print_test_name ("update_seek_double_test", filename) ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Create sound outfile with no data. */ - sfinfo.format = filetype | SF_FORMAT_DOUBLE ; - sfinfo.samplerate = 48000 ; - sfinfo.channels = 2 ; - - if (sf_format_check (&sfinfo) == SF_FALSE) - sfinfo.channels = 1 ; - - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_close (outfile) ; - - /* Open again for read/write. */ - outfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - - /* - ** In auto header update mode, seeking to the end of the file with - ** SEEK_SET will fail from the 2nd seek on. seeking to 0, SEEK_END - ** will seek to 0 anyway - */ - if (sf_command (outfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) == 0) - { printf ("\n\nError : sf_command (SFC_SET_UPDATE_HEADER_AUTO) return error : %s\n\n", sf_strerror (outfile)) ; - exit (1) ; - } ; - - /* Now write some frames. */ - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - for (k = 0 ; k < 6 ; k++) - { test_seek_or_die (outfile, k * frames, SEEK_SET, k * frames, sfinfo.channels, __LINE__) ; - test_seek_or_die (outfile, 0, SEEK_END, k * frames, sfinfo.channels, __LINE__) ; - - /* Open file again and make sure no errors in log buffer. */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - check_log_buffer_or_die (infile, __LINE__) ; - sf_close (infile) ; - - if (sfinfo.frames != k * frames) - { printf ("\n\nLine %d : Incorrect sample count (%ld should be %ld)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), SF_COUNT_TO_LONG (k + frames)) ; - dump_log_buffer (infile) ; - exit (1) ; - } ; - - if ((k & 1) == 0) - test_write_double_or_die (outfile, k, buffer, sfinfo.channels * frames, __LINE__) ; - else - test_writef_double_or_die (outfile, k, buffer, frames, __LINE__) ; - } ; - - sf_close (outfile) ; - unlink (filename) ; - - puts ("ok") ; - return ; -} /* update_seek_double_test */ - - - -static void -header_shrink_test (const char *filename, int filetype) -{ SNDFILE *outfile, *infile ; - SF_INFO sfinfo ; - sf_count_t frames ; - float buffer [8], bufferin [8] ; - - print_test_name ("header_shrink_test", filename) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.format = filetype | SF_FORMAT_FLOAT ; - sfinfo.channels = 1 ; - - memset (buffer, 0xA0, sizeof (buffer)) ; - - /* Now write some frames. */ - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - /* Test the file with extra header data. */ - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - - sf_command (outfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_TRUE) ; - sf_command (outfile, SFC_UPDATE_HEADER_NOW, NULL, SF_FALSE) ; - sf_command (outfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ; - - test_writef_float_or_die (outfile, 0, buffer, frames, __LINE__) ; - sf_close (outfile) ; - - /* Open again for read. */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - test_readf_float_or_die (infile, 0, bufferin, frames, __LINE__) ; - sf_close (infile) ; - - compare_float_or_die (buffer, bufferin, frames, __LINE__) ; - - unlink (filename) ; - puts ("ok") ; - return ; -} /* header_shrink_test */ - - -static void -extra_header_test (const char *filename, int filetype) -{ SNDFILE *outfile, *infile ; - SF_INFO sfinfo ; - sf_count_t frames ; - short buffer [8] ; - int k = 0 ; - - print_test_name ("extra_header_test", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = (filetype | SF_FORMAT_PCM_16) ; - sfinfo.channels = 1 ; - - memset (buffer, 0xA0, sizeof (buffer)) ; - - /* Now write some frames. */ - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - /* Test the file with extra header data. */ - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, 462) ; - sf_set_string (outfile, SF_STR_TITLE, filename) ; - test_writef_short_or_die (outfile, k, buffer, frames, 464) ; - sf_set_string (outfile, SF_STR_COPYRIGHT, "(c) 1980 Erik") ; - sf_close (outfile) ; - -#if 1 - /* - ** Erik de Castro Lopo May 23 2004. - ** - ** This file has extra string data in the header and therefore cannot - ** currently be opened in SFM_RDWR mode. This is fixable, but its in - ** a part of the code I don't want to fiddle with until the Ogg/Vorbis - ** integration is done. - */ - - if ((infile = sf_open (filename, SFM_RDWR, &sfinfo)) != NULL) - { printf ("\n\nError : should not be able to open this file in SFM_RDWR.\n\n") ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; - return ; -#else - - hexdump_file (filename, 0, 100000) ; - - /* Open again for read/write. */ - outfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, 491) ; - - /* - ** In auto header update mode, seeking to the end of the file with - ** SEEK_SET will fail from the 2nd seek on. seeking to 0, SEEK_END - ** will seek to 0 anyway - */ - if (sf_command (outfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) == 0) - { printf ("\n\nError : sf_command (SFC_SET_UPDATE_HEADER_AUTO) return error : %s\n\n", sf_strerror (outfile)) ; - exit (1) ; - } ; - - /* Now write some frames. */ - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - for (k = 1 ; k < 6 ; k++) - { - printf ("\n*** pass %d\n", k) ; - memset (buffer, 0xA0 + k, sizeof (buffer)) ; - - - test_seek_or_die (outfile, k * frames, SEEK_SET, k * frames, sfinfo.channels, 512) ; - test_seek_or_die (outfile, 0, SEEK_END, k * frames, sfinfo.channels, 513) ; - - /* Open file again and make sure no errors in log buffer. */ - if (0) - { infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, 517) ; - check_log_buffer_or_die (infile, 518) ; - sf_close (infile) ; - } ; - - if (sfinfo.frames != k * frames) - { printf ("\n\nLine %d : Incorrect sample count (%ld should be %ld)\n", 523, SF_COUNT_TO_LONG (sfinfo.frames), SF_COUNT_TO_LONG (k + frames)) ; - dump_log_buffer (infile) ; - exit (1) ; - } ; - - if ((k & 1) == 0) - test_write_short_or_die (outfile, k, buffer, sfinfo.channels * frames, 529) ; - else - test_writef_short_or_die (outfile, k, buffer, frames, 531) ; - hexdump_file (filename, 0, 100000) ; - } ; - - sf_close (outfile) ; - unlink (filename) ; - - puts ("ok") ; - return ; -#endif -} /* extra_header_test */ - diff --git a/libs/libsndfile/tests/header_test.def b/libs/libsndfile/tests/header_test.def deleted file mode 100644 index 959703ef0c..0000000000 --- a/libs/libsndfile/tests/header_test.def +++ /dev/null @@ -1,22 +0,0 @@ -autogen definitions header_test.tpl; - -data_type = { - name = "short" ; - format = "SF_FORMAT_PCM_16" ; - } ; - -data_type = { - name = "int" ; - format = "SF_FORMAT_PCM_32" ; - } ; - -data_type = { - name = "float" ; - format = "SF_FORMAT_FLOAT" ; - } ; - -data_type = { - name = "double" ; - format = "SF_FORMAT_DOUBLE" ; - } ; - diff --git a/libs/libsndfile/tests/header_test.tpl b/libs/libsndfile/tests/header_test.tpl deleted file mode 100644 index 6545bb498b..0000000000 --- a/libs/libsndfile/tests/header_test.tpl +++ /dev/null @@ -1,543 +0,0 @@ -[+ AutoGen5 template c +] -/* -** Copyright (C) 2001-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#if (defined (WIN32) || defined (_WIN32)) -#include -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_LEN (1 << 10) -#define LOG_BUFFER_SIZE 1024 - -static void update_header_test (const char *filename, int typemajor) ; - -[+ FOR data_type -+]static void update_seek_[+ (get "name") +]_test (const char *filename, int filetype) ; -[+ ENDFOR data_type -+] - -static void extra_header_test (const char *filename, int filetype) ; - -static void header_shrink_test (const char *filename, int filetype) ; - -/* Force the start of this buffer to be double aligned. Sparc-solaris will -** choke if its not. -*/ -static int data_out [BUFFER_LEN] ; -static int data_in [BUFFER_LEN] ; - -int -main (int argc, char *argv []) -{ int do_all = 0 ; - int test_count = 0 ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" wav - test WAV file peak chunk\n") ; - printf (" aiff - test AIFF file PEAK chunk\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all= !strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "wav")) - { update_header_test ("header.wav", SF_FORMAT_WAV) ; - update_seek_short_test ("header_short.wav", SF_FORMAT_WAV) ; - update_seek_int_test ("header_int.wav", SF_FORMAT_WAV) ; - update_seek_float_test ("header_float.wav", SF_FORMAT_WAV) ; - update_seek_double_test ("header_double.wav", SF_FORMAT_WAV) ; - header_shrink_test ("header_shrink.wav", SF_FORMAT_WAV) ; - extra_header_test ("extra.wav", SF_FORMAT_WAV) ; - - update_header_test ("header.wavex", SF_FORMAT_WAVEX) ; - update_seek_short_test ("header_short.wavex", SF_FORMAT_WAVEX) ; - update_seek_int_test ("header_int.wavex", SF_FORMAT_WAVEX) ; - update_seek_float_test ("header_float.wavex", SF_FORMAT_WAVEX) ; - update_seek_double_test ("header_double.wavex", SF_FORMAT_WAVEX) ; - header_shrink_test ("header_shrink.wavex", SF_FORMAT_WAVEX) ; - extra_header_test ("extra.wavex", SF_FORMAT_WAVEX) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { update_header_test ("header.aiff", SF_FORMAT_AIFF) ; - update_seek_short_test ("header_short.aiff", SF_FORMAT_AIFF) ; - update_seek_int_test ("header_int.aiff", SF_FORMAT_AIFF) ; - update_seek_float_test ("header_float.aiff", SF_FORMAT_AIFF) ; - update_seek_double_test ("header_double.aiff", SF_FORMAT_AIFF) ; - header_shrink_test ("header_shrink.wav", SF_FORMAT_AIFF) ; - extra_header_test ("extra.aiff", SF_FORMAT_AIFF) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "au")) - { update_header_test ("header.au", SF_FORMAT_AU) ; - update_seek_short_test ("header_short.au", SF_FORMAT_AU) ; - update_seek_int_test ("header_int.au", SF_FORMAT_AU) ; - update_seek_float_test ("header_float.au", SF_FORMAT_AU) ; - update_seek_double_test ("header_double.au", SF_FORMAT_AU) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "caf")) - { update_header_test ("header.caf", SF_FORMAT_CAF) ; - update_seek_short_test ("header_short.caf", SF_FORMAT_CAF) ; - update_seek_int_test ("header_int.caf", SF_FORMAT_CAF) ; - update_seek_float_test ("header_float.caf", SF_FORMAT_CAF) ; - update_seek_double_test ("header_double.caf", SF_FORMAT_CAF) ; - /* extra_header_test ("extra.caf", SF_FORMAT_CAF) ; */ - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "nist")) - { update_header_test ("header.nist", SF_FORMAT_NIST) ; - update_seek_short_test ("header_short.nist", SF_FORMAT_NIST) ; - update_seek_int_test ("header_int.nist", SF_FORMAT_NIST) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "paf")) - { update_header_test ("header.paf", SF_FORMAT_PAF) ; - update_seek_short_test ("header_short.paf", SF_FORMAT_PAF) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "ircam")) - { update_header_test ("header.ircam", SF_FORMAT_IRCAM) ; - update_seek_short_test ("header_short.ircam", SF_FORMAT_IRCAM) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "w64")) - { update_header_test ("header.w64", SF_FORMAT_W64) ; - update_seek_short_test ("header_short.w64", SF_FORMAT_W64) ; - update_seek_int_test ("header_int.w64", SF_FORMAT_W64) ; - update_seek_float_test ("header_float.w64", SF_FORMAT_W64) ; - update_seek_double_test ("header_double.w64", SF_FORMAT_W64) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "rf64")) - { update_header_test ("header.rf64", SF_FORMAT_RF64) ; - update_seek_short_test ("header_short.rf64", SF_FORMAT_RF64) ; - update_seek_int_test ("header_int.rf64", SF_FORMAT_RF64) ; - update_seek_float_test ("header_float.rf64", SF_FORMAT_RF64) ; - update_seek_double_test ("header_double.rf64", SF_FORMAT_RF64) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat4")) - { update_header_test ("header.mat4", SF_FORMAT_MAT4) ; - update_seek_short_test ("header_short.mat4", SF_FORMAT_MAT4) ; - update_seek_int_test ("header_int.mat4", SF_FORMAT_MAT4) ; - update_seek_float_test ("header_float.mat4", SF_FORMAT_MAT4) ; - update_seek_double_test ("header_double.mat4", SF_FORMAT_MAT4) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat5")) - { update_header_test ("header.mat5", SF_FORMAT_MAT5) ; - update_seek_short_test ("header_short.mat5", SF_FORMAT_MAT5) ; - update_seek_int_test ("header_int.mat5", SF_FORMAT_MAT5) ; - update_seek_float_test ("header_float.mat5", SF_FORMAT_MAT5) ; - update_seek_double_test ("header_double.mat5", SF_FORMAT_MAT5) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "pvf")) - { update_header_test ("header.pvf", SF_FORMAT_PVF) ; - update_seek_short_test ("header_short.pvf", SF_FORMAT_PVF) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "avr")) - { update_header_test ("header.avr", SF_FORMAT_AVR) ; - update_seek_short_test ("header_short.avr", SF_FORMAT_AVR) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "htk")) - { update_header_test ("header.htk", SF_FORMAT_HTK) ; - update_seek_short_test ("header_short.htk", SF_FORMAT_HTK) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "svx")) - { update_header_test ("header.svx", SF_FORMAT_SVX) ; - update_seek_short_test ("header_short.svx", SF_FORMAT_SVX) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "voc")) - { update_header_test ("header.voc", SF_FORMAT_VOC) ; - /*-update_seek_short_test ("header_short.voc", SF_FORMAT_VOC) ;-*/ - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "sds")) - { update_header_test ("header.sds", SF_FORMAT_SDS) ; - /*-update_seek_short_test ("header_short.sds", SF_FORMAT_SDS) ;-*/ - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mpc2k")) - { update_header_test ("header.mpc", SF_FORMAT_MPC2K) ; - update_seek_short_test ("header_short.mpc", SF_FORMAT_MPC2K) ; - test_count++ ; - } ; - - if (test_count == 0) - { printf ("Mono : ************************************\n") ; - printf ("Mono : * No '%s' test defined.\n", argv [1]) ; - printf ("Mono : ************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -update_header_sub (const char *filename, int typemajor, int write_mode) -{ SNDFILE *outfile, *infile ; - SF_INFO sfinfo ; - int k ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = (typemajor | SF_FORMAT_PCM_16) ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - - outfile = test_open_file_or_die (filename, write_mode, &sfinfo, SF_TRUE, __LINE__) ; - - for (k = 0 ; k < BUFFER_LEN ; k++) - data_out [k] = k + 1 ; - test_write_int_or_die (outfile, 0, data_out, BUFFER_LEN, __LINE__) ; - - if (typemajor != SF_FORMAT_HTK) - { /* The HTK header is not correct when the file is first written. */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_close (infile) ; - } ; - - sf_command (outfile, SFC_UPDATE_HEADER_NOW, NULL, 0) ; - - /* - ** Open file and check log buffer for an error. If header update failed - ** the the log buffer will contain errors. - */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - check_log_buffer_or_die (infile, __LINE__) ; - - if (sfinfo.frames < BUFFER_LEN || sfinfo.frames > BUFFER_LEN + 50) - { printf ("\n\nLine %d : Incorrect sample count (%" PRId64 " should be %d)\n", __LINE__, sfinfo.frames, BUFFER_LEN) ; - dump_log_buffer (infile) ; - exit (1) ; - } ; - - test_read_int_or_die (infile, 0, data_in, BUFFER_LEN, __LINE__) ; - for (k = 0 ; k < BUFFER_LEN ; k++) - if (data_out [k] != k + 1) - printf ("Error : line %d\n", __LINE__) ; - - sf_close (infile) ; - - /* Set auto update on. */ - sf_command (outfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ; - - /* Write more data_out. */ - for (k = 0 ; k < BUFFER_LEN ; k++) - data_out [k] = k + 2 ; - test_write_int_or_die (outfile, 0, data_out, BUFFER_LEN, __LINE__) ; - - /* Open file again and make sure no errors in log buffer. */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - check_log_buffer_or_die (infile, __LINE__) ; - - if (sfinfo.frames < 2 * BUFFER_LEN || sfinfo.frames > 2 * BUFFER_LEN + 50) - { printf ("\n\nLine %d : Incorrect sample count (%" PRId64 " should be %d)\n", __LINE__, sfinfo.frames, 2 * BUFFER_LEN) ; - dump_log_buffer (infile) ; - exit (1) ; - } ; - - sf_close (infile) ; - - sf_close (outfile) ; - - unlink (filename) ; -} /* update_header_sub */ - -static void -update_header_test (const char *filename, int typemajor) -{ - print_test_name ("update_header_test", filename) ; - - update_header_sub (filename, typemajor, SFM_WRITE) ; - update_header_sub (filename, typemajor, SFM_RDWR) ; - - unlink (filename) ; - puts ("ok") ; -} /* update_header_test */ - -/*============================================================================== -*/ - -[+ FOR data_type -+]static void -update_seek_[+ (get "name") +]_test (const char *filename, int filetype) -{ SNDFILE *outfile, *infile ; - SF_INFO sfinfo ; - sf_count_t frames ; - [+ (get "name") +] buffer [8] ; - int k ; - - print_test_name ("update_seek_[+ (get "name") +]_test", filename) ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Create sound outfile with no data. */ - sfinfo.format = filetype | [+ (get "format") +] ; - sfinfo.samplerate = 48000 ; - sfinfo.channels = 2 ; - - if (sf_format_check (&sfinfo) == SF_FALSE) - sfinfo.channels = 1 ; - - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_close (outfile) ; - - /* Open again for read/write. */ - outfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - - /* - ** In auto header update mode, seeking to the end of the file with - ** SEEK_SET will fail from the 2nd seek on. seeking to 0, SEEK_END - ** will seek to 0 anyway - */ - if (sf_command (outfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) == 0) - { printf ("\n\nError : sf_command (SFC_SET_UPDATE_HEADER_AUTO) return error : %s\n\n", sf_strerror (outfile)) ; - exit (1) ; - } ; - - /* Now write some frames. */ - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - for (k = 0 ; k < 6 ; k++) - { test_seek_or_die (outfile, k * frames, SEEK_SET, k * frames, sfinfo.channels, __LINE__) ; - test_seek_or_die (outfile, 0, SEEK_END, k * frames, sfinfo.channels, __LINE__) ; - - /* Open file again and make sure no errors in log buffer. */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - check_log_buffer_or_die (infile, __LINE__) ; - sf_close (infile) ; - - if (sfinfo.frames != k * frames) - { printf ("\n\nLine %d : Incorrect sample count (%" PRId64 " should be %" PRId64 ")\n", __LINE__, sfinfo.frames, k + frames) ; - dump_log_buffer (infile) ; - exit (1) ; - } ; - - if ((k & 1) == 0) - test_write_[+ (get "name") +]_or_die (outfile, k, buffer, sfinfo.channels * frames, __LINE__) ; - else - test_writef_[+ (get "name") +]_or_die (outfile, k, buffer, frames, __LINE__) ; - } ; - - sf_close (outfile) ; - unlink (filename) ; - - puts ("ok") ; - return ; -} /* update_seek_[+ (get "name") +]_test */ - -[+ ENDFOR data_type -+] - -static void -header_shrink_test (const char *filename, int filetype) -{ SNDFILE *outfile, *infile ; - SF_INFO sfinfo ; - sf_count_t frames ; - float buffer [8], bufferin [8] ; - - print_test_name ("header_shrink_test", filename) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.format = filetype | SF_FORMAT_FLOAT ; - sfinfo.channels = 1 ; - - memset (buffer, 0xA0, sizeof (buffer)) ; - - /* Now write some frames. */ - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - /* Test the file with extra header data. */ - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - - sf_command (outfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_TRUE) ; - sf_command (outfile, SFC_UPDATE_HEADER_NOW, NULL, SF_FALSE) ; - sf_command (outfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ; - - test_writef_float_or_die (outfile, 0, buffer, frames, __LINE__) ; - sf_close (outfile) ; - - /* Open again for read. */ - infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - test_readf_float_or_die (infile, 0, bufferin, frames, __LINE__) ; - sf_close (infile) ; - - compare_float_or_die (buffer, bufferin, frames, __LINE__) ; - - unlink (filename) ; - puts ("ok") ; - return ; -} /* header_shrink_test */ - - -static void -extra_header_test (const char *filename, int filetype) -{ SNDFILE *outfile, *infile ; - SF_INFO sfinfo ; - sf_count_t frames ; - short buffer [8] ; - int k = 0 ; - - print_test_name ("extra_header_test", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = (filetype | SF_FORMAT_PCM_16) ; - sfinfo.channels = 1 ; - - memset (buffer, 0xA0, sizeof (buffer)) ; - - /* Now write some frames. */ - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - /* Test the file with extra header data. */ - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, [+ (tpl-file-line "%2$d") +]) ; - sf_set_string (outfile, SF_STR_TITLE, filename) ; - test_writef_short_or_die (outfile, k, buffer, frames, [+ (tpl-file-line "%2$d") +]) ; - sf_set_string (outfile, SF_STR_COPYRIGHT, "(c) 1980 Erik") ; - sf_close (outfile) ; - -#if 1 - /* - ** Erik de Castro Lopo May 23 2004. - ** - ** This file has extra string data in the header and therefore cannot - ** currently be opened in SFM_RDWR mode. This is fixable, but its in - ** a part of the code I don't want to fiddle with until the Ogg/Vorbis - ** integration is done. - */ - - if ((infile = sf_open (filename, SFM_RDWR, &sfinfo)) != NULL) - { printf ("\n\nError : should not be able to open this file in SFM_RDWR.\n\n") ; - exit (1) ; - } ; - - unlink (filename) ; - puts ("ok") ; - return ; -#else - - hexdump_file (filename, 0, 100000) ; - - /* Open again for read/write. */ - outfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, [+ (tpl-file-line "%2$d") +]) ; - - /* - ** In auto header update mode, seeking to the end of the file with - ** SEEK_SET will fail from the 2nd seek on. seeking to 0, SEEK_END - ** will seek to 0 anyway - */ - if (sf_command (outfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) == 0) - { printf ("\n\nError : sf_command (SFC_SET_UPDATE_HEADER_AUTO) return error : %s\n\n", sf_strerror (outfile)) ; - exit (1) ; - } ; - - /* Now write some frames. */ - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - for (k = 1 ; k < 6 ; k++) - { - printf ("\n*** pass %d\n", k) ; - memset (buffer, 0xA0 + k, sizeof (buffer)) ; - - - test_seek_or_die (outfile, k * frames, SEEK_SET, k * frames, sfinfo.channels, [+ (tpl-file-line "%2$d") +]) ; - test_seek_or_die (outfile, 0, SEEK_END, k * frames, sfinfo.channels, [+ (tpl-file-line "%2$d") +]) ; - - /* Open file again and make sure no errors in log buffer. */ - if (0) - { infile = test_open_file_or_die (filename, SFM_READ, &sfinfo, [+ (tpl-file-line "%2$d") +]) ; - check_log_buffer_or_die (infile, [+ (tpl-file-line "%2$d") +]) ; - sf_close (infile) ; - } ; - - if (sfinfo.frames != k * frames) - { printf ("\n\nLine %d : Incorrect sample count (%" PRId64 " should be %" PRId64 ")\n", [+ (tpl-file-line "%2$d") +], sfinfo.frames, k + frames) ; - dump_log_buffer (infile) ; - exit (1) ; - } ; - - if ((k & 1) == 0) - test_write_short_or_die (outfile, k, buffer, sfinfo.channels * frames, [+ (tpl-file-line "%2$d") +]) ; - else - test_writef_short_or_die (outfile, k, buffer, frames, [+ (tpl-file-line "%2$d") +]) ; - hexdump_file (filename, 0, 100000) ; - } ; - - sf_close (outfile) ; - unlink (filename) ; - - puts ("ok") ; - return ; -#endif -} /* extra_header_test */ - diff --git a/libs/libsndfile/tests/headerless_test.c b/libs/libsndfile/tests/headerless_test.c deleted file mode 100644 index 6d3e2f2589..0000000000 --- a/libs/libsndfile/tests/headerless_test.c +++ /dev/null @@ -1,185 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_SIZE (2000) - -static void old_test (void) ; -static void headerless_test (const char * filename, int format, int expected) ; - -int -main (void) -{ - old_test () ; - - headerless_test ("raw.vox", SF_FORMAT_VOX_ADPCM, SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM) ; - headerless_test ("raw.gsm", SF_FORMAT_GSM610, SF_FORMAT_RAW | SF_FORMAT_GSM610) ; - - headerless_test ("raw.snd", SF_FORMAT_ULAW, SF_FORMAT_RAW | SF_FORMAT_ULAW) ; - headerless_test ("raw.au" , SF_FORMAT_ULAW, SF_FORMAT_RAW | SF_FORMAT_ULAW) ; - - return 0 ; -} /* main */ - -static void -headerless_test (const char * filename, int format, int expected) -{ static short buffer [BUFFER_SIZE] ; - SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - - format &= SF_FORMAT_SUBMASK ; - - print_test_name (__func__, filename) ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - buffer [k] = k ; - - sfinfo.samplerate = 8000 ; - sfinfo.frames = 0 ; - sfinfo.channels = 1 ; - sfinfo.format = SF_FORMAT_RAW | format ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - if ((k = sf_write_short (file, buffer, BUFFER_SIZE)) != BUFFER_SIZE) - { printf ("Line %d: sf_write_short failed with short write (%d => %d).\n", __LINE__, BUFFER_SIZE, k) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - sf_close (file) ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* We should be able to detect these so clear sfinfo. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != expected) - { printf ("Line %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, expected, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < BUFFER_SIZE) - { printf ("Line %d: Incorrect number of.frames in file. (%d => %" PRId64 ")\n", __LINE__, BUFFER_SIZE, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("Line %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_close (file) ; - - printf ("ok\n") ; - unlink (filename) ; -} /* headerless_test */ - -static void -old_test (void) -{ static short buffer [BUFFER_SIZE] ; - SNDFILE *file ; - SF_INFO sfinfo ; - int k, filetype ; - const char *filename = "headerless.wav" ; - - print_test_name (__func__, "") ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - buffer [k] = k ; - - filetype = SF_FORMAT_WAV | SF_FORMAT_PCM_16 ; - - sfinfo.samplerate = 32000 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - if ((k = sf_write_short (file, buffer, BUFFER_SIZE)) != BUFFER_SIZE) - { printf ("Line %d: sf_write_short failed with short write (%d => %d).\n", __LINE__, BUFFER_SIZE, k) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - sf_close (file) ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Read as RAW but get the bit width and endian-ness correct. */ - sfinfo.format = filetype = SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_16 ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("Line %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < BUFFER_SIZE) - { printf ("Line %d: Incorrect number of.frames in file. (%d => %" PRId64 ")\n", __LINE__, BUFFER_SIZE, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("Line %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - if ((k = sf_read_short (file, buffer, BUFFER_SIZE)) != BUFFER_SIZE) - { printf ("Line %d: short read (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - for (k = 0 ; k < BUFFER_SIZE - 22 ; k++) - if (buffer [k + 22] != k) - { printf ("Line %d: Incorrect sample (#%d : 0x%x => 0x%x).\n", __LINE__, k, k, buffer [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - printf ("ok\n") ; - unlink (filename) ; -} /* old_test */ - diff --git a/libs/libsndfile/tests/largefile_test.c b/libs/libsndfile/tests/largefile_test.c deleted file mode 100644 index 328a589a02..0000000000 --- a/libs/libsndfile/tests/largefile_test.c +++ /dev/null @@ -1,83 +0,0 @@ -/* -** Copyright (C) 2006-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_LEN (1024 * 1024) -#define BUFFER_COUNT (768) - -static void largefile_test (int filetype, const char * filename) ; - -int -main (void) -{ - largefile_test (SF_FORMAT_WAV, "largefile.wav") ; - largefile_test (SF_FORMAT_AIFF, "largefile.aiff") ; - - return 0 ; -} /* main */ - -static void -largefile_test (int filetype, const char * filename) -{ static float data [BUFFER_LEN] ; - SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - - print_test_name ("largefile_test", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.channels = 2 ; - sfinfo.frames = 0 ; - sfinfo.format = (filetype | SF_FORMAT_PCM_32) ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - for (k = 0 ; k < BUFFER_COUNT ; k++) - test_write_float_or_die (file, k, data, BUFFER_LEN, __LINE__) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if ((sfinfo.frames * sfinfo.channels) / BUFFER_LEN != BUFFER_COUNT) - { printf ("\n\nLine %d : bad frame count.\n", __LINE__) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - puts ("ok") ; - - - return ; -} /* largefile_test */ - diff --git a/libs/libsndfile/tests/locale_test.c b/libs/libsndfile/tests/locale_test.c deleted file mode 100644 index b67d549c58..0000000000 --- a/libs/libsndfile/tests/locale_test.c +++ /dev/null @@ -1,167 +0,0 @@ -/* -** Copyright (C) 2005-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if HAVE_LOCALE_H -#include -#endif - -#if OS_IS_WIN32 -#include -#define ENABLE_SNDFILE_WINDOWS_PROTOTYPES 1 -#endif - -#include "sndfile.h" -#include "utils.h" - -static void utf8_test (void) ; -static void wchar_test (void) ; - -int -main (void) -{ - utf8_test () ; - wchar_test () ; - - return 0 ; -} /* main */ - -/*============================================================================== -*/ - -static void -wchar_test (void) -{ -#if OS_IS_WIN32 - SNDFILE * file ; - SF_INFO info ; - LPCWSTR filename = L"test.wav" ; - - print_test_name (__func__, "test.wav") ; - - info.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16 ; - info.channels = 1 ; - info.samplerate = 44100 ; - - file = sf_wchar_open (filename, SFM_WRITE, &info) ; - exit_if_true (file == NULL, "\n\nLine %d : sf_wchar_open failed : %s\n\n", __LINE__, sf_strerror (NULL)) ; - sf_close (file) ; - - /* This should check that the file did in fact get created with a - ** wchar_t * filename. - */ - exit_if_true ( - GetFileAttributesW (filename) == INVALID_FILE_ATTRIBUTES, - "\n\nLine %d : GetFileAttributes failed.\n\n", __LINE__ - ) ; - - /* Use this because the file was created with CreateFileW. */ - DeleteFileW (filename) ; - - puts ("ok") ; -#endif -} /* wchar_test */ - -/*============================================================================== -*/ - -typedef struct -{ const char *locale ; - int utf8 ; - const char *filename ; - int width ; -} LOCALE_DATA ; - -static void locale_test (const LOCALE_DATA * locdata) ; - -static void -utf8_test (void) -{ LOCALE_DATA ldata [] = - { { "de_DE", 1, "F\303\274\303\237e.au", 7 }, - { "en_AU", 1, "kangaroo.au", 11 }, - { "POSIX", 0, "posix.au", 8 }, - { "pt_PT", 1, "concei\303\247\303\243o.au", 12 }, - -#if OS_IS_WIN32 == 0 - { "ja_JP", 1, "\343\201\212\343\201\257\343\202\210\343\201\206\343\201\224\343\201\226\343\201\204\343\201\276\343\201\231.au", 21 }, -#endif - - { "vi_VN", 1, "qu\341\273\221c ng\341\273\257.au", 11 }, - { NULL, 0, NULL, 0 } - } ; - int k ; - - for (k = 0 ; ldata [k].locale != NULL ; k++) - locale_test (ldata + k) ; -} /* utf8_test */ - - -static void -locale_test (const LOCALE_DATA * ldata) -{ -#if (HAVE_LOCALE_H == 0 || HAVE_SETLOCALE == 0) - locname = filename = NULL ; - width = 0 ; - return ; -#else - const short wdata [] = { 1, 2, 3, 4, 5, 6, 7, 8 } ; - short rdata [ARRAY_LEN (wdata)] ; - const char *old_locale ; - char utf8_locname [32] ; - SNDFILE *file ; - SF_INFO sfinfo ; - - snprintf (utf8_locname, sizeof (utf8_locname), "%s%s", ldata->locale, ldata->utf8 ? ".UTF-8" : "") ; - - /* Change the locale saving the old one. */ - if ((old_locale = setlocale (LC_CTYPE, utf8_locname)) == NULL) - return ; - - printf (" locale_test %-8s : %s %*c ", ldata->locale, ldata->filename, 24 - ldata->width, ' ') ; - fflush (stdout) ; - - sfinfo.format = SF_FORMAT_AU | SF_FORMAT_PCM_16 ; - sfinfo.channels = 1 ; - sfinfo.samplerate = 44100 ; - - file = test_open_file_or_die (ldata->filename, SFM_WRITE, &sfinfo, 0, __LINE__) ; - test_write_short_or_die (file, 0, wdata, ARRAY_LEN (wdata), __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (ldata->filename, SFM_READ, &sfinfo, 0, __LINE__) ; - test_read_short_or_die (file, 0, rdata, ARRAY_LEN (rdata), __LINE__) ; - sf_close (file) ; - - unlink (ldata->filename) ; - - /* Restore old locale. */ - setlocale (LC_CTYPE, old_locale) ; - - puts ("ok") ; -#endif -} /* locale_test */ - diff --git a/libs/libsndfile/tests/lossy_comp_test.c b/libs/libsndfile/tests/lossy_comp_test.c deleted file mode 100644 index 5f9f593f8f..0000000000 --- a/libs/libsndfile/tests/lossy_comp_test.c +++ /dev/null @@ -1,2372 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_SIZE (1 << 14) -#define SAMPLE_RATE 11025 - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -#define LCT_MAX(x, y) ((x) > (y) ? (x) : (y)) - -static void lcomp_test_short (const char *filename, int filetype, int chan, double margin) ; -static void lcomp_test_int (const char *filename, int filetype, int chan, double margin) ; -static void lcomp_test_float (const char *filename, int filetype, int chan, double margin) ; -static void lcomp_test_double (const char *filename, int filetype, int chan, double margin) ; - -static void sdlcomp_test_short (const char *filename, int filetype, int chan, double margin) ; -static void sdlcomp_test_int (const char *filename, int filetype, int chan, double margin) ; -static void sdlcomp_test_float (const char *filename, int filetype, int chan, double margin) ; -static void sdlcomp_test_double (const char *filename, int filetype, int chan, double margin) ; - -static void read_raw_test (const char *filename, int filetype, int chan) ; - -static int error_function (double data, double orig, double margin) ; -static int decay_response (int k) ; - -static void gen_signal_double (double *data, double scale, int channels, int datalen) ; - -static void smoothed_diff_short (short *data, unsigned int datalen) ; -static void smoothed_diff_int (int *data, unsigned int datalen) ; -static void smoothed_diff_float (float *data, unsigned int datalen) ; -static void smoothed_diff_double (double *data, unsigned int datalen) ; - -static void check_comment (SNDFILE * file, int format, int lineno) ; - -static int is_lossy (int filetype) ; - -/* -** Force the start of these buffers to be double aligned. Sparc-solaris will -** choke if they are not. -*/ -typedef union -{ double d [BUFFER_SIZE + 1] ; - float f [BUFFER_SIZE + 1] ; - int i [BUFFER_SIZE + 1] ; - short s [BUFFER_SIZE + 1] ; - char c [BUFFER_SIZE + 1] ; -} BUFFER ; - -static BUFFER data_buffer ; -static BUFFER orig_buffer ; -static BUFFER smooth_buffer ; - -static const char *long_comment = - "This is really quite a long comment. It is designed to be long enough " - "to screw up the encoders and decoders if the file container format does " - "not handle things correctly. If everything is working correctly, the " - "decoder will only decode the actual audio data, and not this string at " - "the end of the file." ; - -int -main (int argc, char *argv []) -{ int do_all = 0 ; - int test_count = 0 ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" wav_ima - test IMA ADPCM WAV file functions\n") ; - printf (" wav_msadpcm - test MS ADPCM WAV file functions\n") ; - printf (" wav_gsm610 - test GSM 6.10 WAV file functions\n") ; - printf (" wav_ulaw - test u-law WAV file functions\n") ; - printf (" wav_alaw - test A-law WAV file functions\n") ; - printf (" wve - test Psion WVE file functions\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all = ! strcmp (argv [1], "all") ; - - if (do_all || strcmp (argv [1], "wav_pcm") == 0) - { /* This is just a sanity test for PCM encoding. */ - lcomp_test_short ("pcm.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16, 2, 1e-50) ; - lcomp_test_int ("pcm.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_32, 2, 1e-50) ; - lcomp_test_short ("pcm.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_PCM_16, 2, 1e-50) ; - lcomp_test_int ("pcm.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_PCM_32, 2, 1e-50) ; - /* Lite remove start */ - lcomp_test_float ("pcm.wav", SF_FORMAT_WAV | SF_FORMAT_FLOAT, 2, 1e-50) ; - lcomp_test_double ("pcm.wav", SF_FORMAT_WAV | SF_FORMAT_DOUBLE, 2, 1e-50) ; - /* Lite remove end */ - - read_raw_test ("pcm.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_U8, 2) ; - test_count++ ; - } ; - - /* For all the rest, if the file format supports more than 1 channel, use stereo. */ - /* Lite remove start */ - if (do_all || strcmp (argv [1], "wav_ima") == 0) - { lcomp_test_short ("ima.wav", SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - lcomp_test_int ("ima.wav", SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.65) ; - lcomp_test_float ("ima.wav", SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - lcomp_test_double ("ima.wav", SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - - lcomp_test_short ("ima.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - lcomp_test_int ("ima.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - lcomp_test_float ("ima.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - lcomp_test_double ("ima.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - - sdlcomp_test_short ("ima.wav", SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - sdlcomp_test_int ("ima.wav", SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - sdlcomp_test_float ("ima.wav", SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - sdlcomp_test_double ("ima.wav", SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "wav_msadpcm") == 0) - { lcomp_test_short ("msadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - lcomp_test_int ("msadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - lcomp_test_float ("msadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - lcomp_test_double ("msadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - - lcomp_test_short ("msadpcm.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - lcomp_test_int ("msadpcm.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - lcomp_test_float ("msadpcm.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - lcomp_test_double ("msadpcm.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - - sdlcomp_test_short ("msadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - sdlcomp_test_int ("msadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - sdlcomp_test_float ("msadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - sdlcomp_test_double ("msadpcm.wav", SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "wav_g721") == 0) - { printf ("**** Fix this later : error bound should be 0.06 ****\n") ; - lcomp_test_short ("g721.wav", SF_FORMAT_WAV | SF_FORMAT_G721_32, 1, 0.7) ; - lcomp_test_int ("g721.wav", SF_FORMAT_WAV | SF_FORMAT_G721_32, 1, 0.7) ; - - lcomp_test_short ("g721.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_G721_32, 1, 0.7) ; - lcomp_test_int ("g721.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_G721_32, 1, 0.7) ; - - test_count++ ; - } ; - /* Lite remove end */ - - if (do_all || strcmp (argv [1], "wav_ulaw") == 0) - { lcomp_test_short ("ulaw.wav", SF_FORMAT_WAV | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_int ("ulaw.wav", SF_FORMAT_WAV | SF_FORMAT_ULAW, 2, 0.04) ; - - lcomp_test_short ("ulaw.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_int ("ulaw.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_ULAW, 2, 0.04) ; - - /* Lite remove start */ - lcomp_test_float ("ulaw.wav", SF_FORMAT_WAV | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_double ("ulaw.wav", SF_FORMAT_WAV | SF_FORMAT_ULAW, 2, 0.04) ; - /* Lite remove end */ - - read_raw_test ("ulaw.wav", SF_FORMAT_WAV | SF_FORMAT_ULAW, 2) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "wav_alaw") == 0) - { lcomp_test_short ("alaw.wav", SF_FORMAT_WAV | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_int ("alaw.wav", SF_FORMAT_WAV | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("alaw.wav", SF_FORMAT_WAV | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_double ("alaw.wav", SF_FORMAT_WAV | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove end */ - - read_raw_test ("alaw.wav", SF_FORMAT_WAV | SF_FORMAT_ALAW, 2) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "wav_gsm610") == 0) - { /* Don't do lcomp_test_XXX as the errors are too big. */ - sdlcomp_test_short ("gsm610.wav", SF_FORMAT_WAV | SF_FORMAT_GSM610, 1, 0.24) ; - sdlcomp_test_int ("gsm610.wav", SF_FORMAT_WAV | SF_FORMAT_GSM610, 1, 0.24) ; - - sdlcomp_test_short ("gsm610.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_GSM610, 1, 0.24) ; - sdlcomp_test_int ("gsm610.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_GSM610, 1, 0.24) ; - - /* Lite remove start */ - sdlcomp_test_float ("gsm610.wav", SF_FORMAT_WAV | SF_FORMAT_GSM610, 1, 0.24) ; - sdlcomp_test_double ("gsm610.wav", SF_FORMAT_WAV | SF_FORMAT_GSM610, 1, 0.24) ; - /* Lite remove end */ - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "aiff_ulaw") == 0) - { lcomp_test_short ("ulaw.aiff", SF_FORMAT_AIFF | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_int ("ulaw.aiff", SF_FORMAT_AIFF | SF_FORMAT_ULAW, 2, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("ulaw.aiff", SF_FORMAT_AIFF | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_double ("ulaw.aiff", SF_FORMAT_AIFF | SF_FORMAT_ULAW, 2, 0.04) ; - /* Lite remove end */ - - read_raw_test ("ulaw.aiff", SF_FORMAT_AIFF | SF_FORMAT_ULAW, 2) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "aiff_alaw") == 0) - { lcomp_test_short ("alaw.aiff", SF_FORMAT_AIFF | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_int ("alaw.aiff", SF_FORMAT_AIFF | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("alaw.aiff", SF_FORMAT_AIFF | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_double ("alaw.aiff", SF_FORMAT_AIFF | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove end */ - - read_raw_test ("alaw.aiff", SF_FORMAT_AIFF | SF_FORMAT_ALAW, 2) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "aiff_gsm610") == 0) - { /* Don't do lcomp_test_XXX as the errors are too big. */ - sdlcomp_test_short ("gsm610.aiff", SF_FORMAT_AIFF | SF_FORMAT_GSM610, 1, 0.24) ; - sdlcomp_test_int ("gsm610.aiff", SF_FORMAT_AIFF | SF_FORMAT_GSM610, 1, 0.24) ; - /* Lite remove start */ - sdlcomp_test_float ("gsm610.aiff", SF_FORMAT_AIFF | SF_FORMAT_GSM610, 1, 0.24) ; - sdlcomp_test_double ("gsm610.aiff", SF_FORMAT_AIFF | SF_FORMAT_GSM610, 1, 0.24) ; - /* Lite remove end */ - test_count++ ; - } ; - - if (strcmp (argv [1], "aiff_ima") == 0) - { lcomp_test_short ("ima.aiff", SF_FORMAT_AIFF | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - lcomp_test_int ("ima.aiff", SF_FORMAT_AIFF | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - /* Lite remove start */ - lcomp_test_float ("ima.aiff", SF_FORMAT_AIFF | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - lcomp_test_double ("ima.aiff", SF_FORMAT_AIFF | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - /* Lite remove end */ - } ; - - if (do_all || strcmp (argv [1], "au_ulaw") == 0) - { lcomp_test_short ("ulaw.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_int ("ulaw.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_ULAW, 2, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("ulaw.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_double ("ulaw.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_ULAW, 2, 0.04) ; - /* Lite remove end */ - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "au_alaw") == 0) - { lcomp_test_short ("alaw.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_int ("alaw.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("alaw.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_double ("alaw.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove end */ - test_count++ ; - } ; - - /* Lite remove start */ - if (do_all || strcmp (argv [1], "au_g721") == 0) - { printf ("**** Fix this later : error bound should be 0.06 ****\n") ; - lcomp_test_short ("g721.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_G721_32, 1, 0.7) ; - lcomp_test_int ("g721.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_G721_32, 1, 0.7) ; - lcomp_test_float ("g721.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_G721_32, 1, 0.7) ; - lcomp_test_double ("g721.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_G721_32, 1, 0.7) ; - -/*- sdlcomp_test_short ("g721.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_G721_32, 1, 0.07) ; - sdlcomp_test_int ("g721.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_G721_32, 1, 0.07) ; - sdlcomp_test_float ("g721.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_G721_32, 1, 0.07) ; - sdlcomp_test_double ("g721.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_G721_32, 1, 0.12) ; --*/ - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "au_g723") == 0) - { printf ("**** Fix this later : error bound should be 0.16 ****\n") ; - lcomp_test_short ("g723_24.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_G723_24, 1, 0.7) ; - lcomp_test_int ("g723_24.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_G723_24, 1, 0.7) ; - lcomp_test_float ("g723_24.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_G723_24, 1, 0.7) ; - lcomp_test_double ("g723_24.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_G723_24, 1, 0.7) ; - - lcomp_test_short ("g723_40.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_G723_40, 1, 0.85) ; - lcomp_test_int ("g723_40.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_G723_40, 1, 0.84) ; - lcomp_test_float ("g723_40.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_G723_40, 1, 0.86) ; - lcomp_test_double ("g723_40.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_G723_40, 1, 0.86) ; - -/*- sdlcomp_test_short ("g723.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_G723_24, 1, 0.15) ; - sdlcomp_test_int ("g723.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_G723_24, 1, 0.15) ; - sdlcomp_test_float ("g723.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_G723_24, 1, 0.15) ; - sdlcomp_test_double ("g723.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_G723_24, 1, 0.15) ; --*/ - test_count++ ; - } ; - /* Lite remove end */ - - if (do_all || strcmp (argv [1], "caf_ulaw") == 0) - { lcomp_test_short ("ulaw.caf", SF_FORMAT_CAF | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_int ("ulaw.caf", SF_FORMAT_CAF | SF_FORMAT_ULAW, 2, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("ulaw.caf", SF_FORMAT_CAF | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_double ("ulaw.caf", SF_FORMAT_CAF | SF_FORMAT_ULAW, 2, 0.04) ; - /* Lite remove end */ - - read_raw_test ("ulaw.caf", SF_FORMAT_CAF | SF_FORMAT_ULAW, 2) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "caf_alaw") == 0) - { lcomp_test_short ("alaw.caf", SF_FORMAT_CAF | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_int ("alaw.caf", SF_FORMAT_CAF | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("alaw.caf", SF_FORMAT_CAF | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_double ("alaw.caf", SF_FORMAT_CAF | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove end */ - - read_raw_test ("alaw.caf", SF_FORMAT_CAF | SF_FORMAT_ALAW, 2) ; - test_count++ ; - } ; - - - if (do_all || strcmp (argv [1], "raw_ulaw") == 0) - { lcomp_test_short ("ulaw.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_int ("ulaw.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_ULAW, 2, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("ulaw.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_double ("ulaw.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_ULAW, 2, 0.04) ; - /* Lite remove end */ - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "raw_alaw") == 0) - { lcomp_test_short ("alaw.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_int ("alaw.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("alaw.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_double ("alaw.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove end */ - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "raw_gsm610") == 0) - { /* Don't do lcomp_test_XXX as the errors are too big. */ - sdlcomp_test_short ("raw.gsm", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ; - sdlcomp_test_int ("raw.gsm", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ; - sdlcomp_test_float ("raw.gsm", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ; - sdlcomp_test_double ("raw.gsm", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "ogg_vorbis") == 0) - { if (HAVE_EXTERNAL_LIBS) - { /* Don't do lcomp_test_XXX as the errors are too big. */ - sdlcomp_test_short ("vorbis.oga", SF_FORMAT_OGG | SF_FORMAT_VORBIS, 1, 0.30) ; - sdlcomp_test_int ("vorbis.oga", SF_FORMAT_OGG | SF_FORMAT_VORBIS, 1, 0.30) ; - sdlcomp_test_float ("vorbis.oga", SF_FORMAT_OGG | SF_FORMAT_VORBIS, 1, 0.30) ; - sdlcomp_test_double ("vorbis.oga", SF_FORMAT_OGG | SF_FORMAT_VORBIS, 1, 0.30) ; - } - else - puts (" No Ogg/Vorbis tests because Ogg/Vorbis support was not compiled in.") ; - - test_count++ ; - } ; - - /* Lite remove start */ - if (do_all || strcmp (argv [1], "ircam_ulaw") == 0) - { lcomp_test_short ("ulaw.ircam", SF_ENDIAN_LITTLE | SF_FORMAT_IRCAM | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_int ("ulaw.ircam", SF_ENDIAN_BIG | SF_FORMAT_IRCAM | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_float ("ulaw.ircam", SF_ENDIAN_LITTLE | SF_FORMAT_IRCAM | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_double ("ulaw.ircam", SF_ENDIAN_BIG | SF_FORMAT_IRCAM | SF_FORMAT_ULAW, 2, 0.04) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "ircam_alaw") == 0) - { lcomp_test_short ("alaw.ircam", SF_ENDIAN_LITTLE | SF_FORMAT_IRCAM | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_int ("alaw.ircam", SF_ENDIAN_BIG | SF_FORMAT_IRCAM | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_float ("alaw.ircam", SF_ENDIAN_LITTLE | SF_FORMAT_IRCAM | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_double ("alaw.ircam", SF_ENDIAN_BIG | SF_FORMAT_IRCAM | SF_FORMAT_ALAW, 2, 0.04) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "nist_ulaw") == 0) - { lcomp_test_short ("ulaw.nist", SF_ENDIAN_LITTLE | SF_FORMAT_NIST | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_int ("ulaw.nist", SF_ENDIAN_BIG | SF_FORMAT_NIST | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_float ("ulaw.nist", SF_ENDIAN_LITTLE | SF_FORMAT_NIST | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_double ("ulaw.nist", SF_ENDIAN_BIG | SF_FORMAT_NIST | SF_FORMAT_ULAW, 2, 0.04) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "nist_alaw") == 0) - { lcomp_test_short ("alaw.nist", SF_ENDIAN_LITTLE | SF_FORMAT_NIST | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_int ("alaw.nist", SF_ENDIAN_BIG | SF_FORMAT_NIST | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_float ("alaw.nist", SF_ENDIAN_LITTLE | SF_FORMAT_NIST | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_double ("alaw.nist", SF_ENDIAN_BIG | SF_FORMAT_NIST | SF_FORMAT_ALAW, 2, 0.04) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "voc_ulaw") == 0) - { lcomp_test_short ("ulaw.voc", SF_FORMAT_VOC | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_int ("ulaw.voc", SF_FORMAT_VOC | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_float ("ulaw.voc", SF_FORMAT_VOC | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_double ("ulaw.voc", SF_FORMAT_VOC | SF_FORMAT_ULAW, 2, 0.04) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "voc_alaw") == 0) - { lcomp_test_short ("alaw.voc", SF_FORMAT_VOC | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_int ("alaw.voc", SF_FORMAT_VOC | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_float ("alaw.voc", SF_FORMAT_VOC | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_double ("alaw.voc", SF_FORMAT_VOC | SF_FORMAT_ALAW, 2, 0.04) ; - test_count++ ; - } ; - /* Lite remove end */ - - if (do_all || strcmp (argv [1], "w64_ulaw") == 0) - { lcomp_test_short ("ulaw.w64", SF_FORMAT_W64 | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_int ("ulaw.w64", SF_FORMAT_W64 | SF_FORMAT_ULAW, 2, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("ulaw.w64", SF_FORMAT_W64 | SF_FORMAT_ULAW, 2, 0.04) ; - lcomp_test_double ("ulaw.w64", SF_FORMAT_W64 | SF_FORMAT_ULAW, 2, 0.04) ; - /* Lite remove end */ - - read_raw_test ("ulaw.w64", SF_FORMAT_W64 | SF_FORMAT_ULAW, 2) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "w64_alaw") == 0) - { lcomp_test_short ("alaw.w64", SF_FORMAT_W64 | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_int ("alaw.w64", SF_FORMAT_W64 | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("alaw.w64", SF_FORMAT_W64 | SF_FORMAT_ALAW, 2, 0.04) ; - lcomp_test_double ("alaw.w64", SF_FORMAT_W64 | SF_FORMAT_ALAW, 2, 0.04) ; - /* Lite remove end */ - - read_raw_test ("alaw.w64", SF_FORMAT_W64 | SF_FORMAT_ALAW, 2) ; - test_count++ ; - } ; - - /* Lite remove start */ - if (do_all || strcmp (argv [1], "w64_ima") == 0) - { lcomp_test_short ("ima.w64", SF_FORMAT_W64 | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - lcomp_test_int ("ima.w64", SF_FORMAT_W64 | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - lcomp_test_float ("ima.w64", SF_FORMAT_W64 | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - lcomp_test_double ("ima.w64", SF_FORMAT_W64 | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - - sdlcomp_test_short ("ima.w64", SF_FORMAT_W64 | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - sdlcomp_test_int ("ima.w64", SF_FORMAT_W64 | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - sdlcomp_test_float ("ima.w64", SF_FORMAT_W64 | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - sdlcomp_test_double ("ima.w64", SF_FORMAT_W64 | SF_FORMAT_IMA_ADPCM, 2, 0.18) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "w64_msadpcm") == 0) - { lcomp_test_short ("msadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - lcomp_test_int ("msadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - lcomp_test_float ("msadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - lcomp_test_double ("msadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - - sdlcomp_test_short ("msadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - sdlcomp_test_int ("msadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - sdlcomp_test_float ("msadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - sdlcomp_test_double ("msadpcm.w64", SF_FORMAT_W64 | SF_FORMAT_MS_ADPCM, 2, 0.36) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "wve") == 0) - { lcomp_test_short ("psion.wve", SF_FORMAT_WVE | SF_FORMAT_ALAW, 1, 0.04) ; - lcomp_test_int ("psion.wve", SF_FORMAT_WVE | SF_FORMAT_ALAW, 1, 0.04) ; - /* Lite remove start */ - lcomp_test_float ("psion.wve", SF_FORMAT_WVE | SF_FORMAT_ALAW, 1, 0.04) ; - lcomp_test_double ("psion.wve", SF_FORMAT_WVE | SF_FORMAT_ALAW, 1, 0.04) ; - /* Lite remove end */ - test_count++ ; - } ; - - /* Lite remove end */ - - if (do_all || strcmp (argv [1], "w64_gsm610") == 0) - { /* Don't do lcomp_test_XXX as the errors are too big. */ - sdlcomp_test_short ("gsm610.w64", SF_FORMAT_W64 | SF_FORMAT_GSM610, 1, 0.2) ; - sdlcomp_test_int ("gsm610.w64", SF_FORMAT_W64 | SF_FORMAT_GSM610, 1, 0.2) ; - /* Lite remove start */ - sdlcomp_test_float ("gsm610.w64", SF_FORMAT_W64 | SF_FORMAT_GSM610, 1, 0.2) ; - sdlcomp_test_double ("gsm610.w64", SF_FORMAT_W64 | SF_FORMAT_GSM610, 1, 0.2) ; - /* Lite remove end */ - test_count++ ; - } ; - - /* Lite remove start */ - if (do_all || strcmp (argv [1], "vox_adpcm") == 0) - { lcomp_test_short ("adpcm.vox", SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, 1, 0.17) ; - lcomp_test_int ("adpcm.vox", SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, 1, 0.17) ; - lcomp_test_float ("adpcm.vox", SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, 1, 0.17) ; - lcomp_test_double ("adpcm.vox", SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, 1, 0.17) ; - - sdlcomp_test_short ("adpcm.vox", SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, 1, 0.072) ; - sdlcomp_test_int ("adpcm.vox", SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, 1, 0.072) ; - sdlcomp_test_float ("adpcm.vox", SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, 1, 0.072) ; - sdlcomp_test_double ("adpcm.vox", SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM, 1, 0.072) ; - test_count++ ; - } ; - - if (do_all || strcmp (argv [1], "xi_dpcm") == 0) - { lcomp_test_short ("8bit.xi", SF_FORMAT_XI | SF_FORMAT_DPCM_8, 1, 0.25) ; - lcomp_test_int ("8bit.xi", SF_FORMAT_XI | SF_FORMAT_DPCM_8, 1, 0.25) ; - - lcomp_test_short ("16bit.xi", SF_FORMAT_XI | SF_FORMAT_DPCM_16, 1, 0.002) ; - lcomp_test_int ("16bit.xi", SF_FORMAT_XI | SF_FORMAT_DPCM_16, 1, 0.002) ; - lcomp_test_float ("16bit.xi", SF_FORMAT_XI | SF_FORMAT_DPCM_16, 1, 0.002) ; - lcomp_test_double ("16bit.xi", SF_FORMAT_XI | SF_FORMAT_DPCM_16, 1, 0.002) ; - test_count++ ; - } ; - /* Lite remove end */ - - if (test_count == 0) - { printf ("************************************\n") ; - printf ("* No '%s' test defined.\n", argv [1]) ; - printf ("************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -lcomp_test_short (const char *filename, int filetype, int channels, double margin) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, m, seekpos, half_max_abs ; - sf_count_t datalen ; - short *orig, *data ; - - print_test_name ("lcomp_test_short", filename) ; - - datalen = BUFFER_SIZE / channels ; - - data = data_buffer.s ; - orig = orig_buffer.s ; - - gen_signal_double (orig_buffer.d, 32000.0, channels, datalen) ; - for (k = 0 ; k < channels * datalen ; k++) - orig [k] = (short) (orig_buffer.d [k]) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = 123456789 ; /* Ridiculous value. */ - sfinfo.channels = channels ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - test_writef_short_or_die (file, 0, orig, datalen, __LINE__) ; - sf_set_string (file, SF_STR_COMMENT, long_comment) ; - sf_close (file) ; - - memset (data, 0, datalen * sizeof (short)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - if ((sfinfo.format & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK)) != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < datalen / channels) - { printf ("Too few frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", sfinfo.frames, datalen) ; - exit (1) ; - } ; - - if (sfinfo.frames > (datalen + datalen / 20)) - { printf ("Too many frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", sfinfo.frames, datalen) ; - exit (1) ; - } ; - - if (sfinfo.channels != channels) - { printf ("Incorrect number of channels in file.\n") ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - check_comment (file, filetype, __LINE__) ; - - test_readf_short_or_die (file, 0, data, datalen, __LINE__) ; - - half_max_abs = 0 ; - for (k = 0 ; k < datalen ; k++) - { if (error_function (data [k], orig [k], margin)) - { printf ("\n\nLine %d: Incorrect sample A (#%d : %d should be %d).\n", __LINE__, k, data [k], orig [k]) ; - oct_save_short (orig, data, datalen) ; - exit (1) ; - } ; - half_max_abs = LCT_MAX (half_max_abs, abs (data [k] / 2)) ; - } ; - - if (half_max_abs < 1.0) - { printf ("\n\nLine %d: Signal is all zeros.\n", __LINE__) ; - exit (1) ; - } ; - - if ((k = sf_readf_short (file, data, datalen)) != sfinfo.frames - datalen) - { printf ("\n\nLine %d: Incorrect read length (%" PRId64 " should be %d).\n", __LINE__, - channels * sfinfo.frames - datalen, k) ; - exit (1) ; - } ; - - /* This check is only for block based encoders which must append silence - ** to the end of a file so as to fill out a block. - */ - for (k = 0 ; k < sfinfo.frames - datalen ; k++) - if (abs (data [channels * k]) > decay_response (channels * k)) - { printf ("\n\nLine %d : Incorrect sample B (#%d : abs (%d) should be < %d).\n", __LINE__, channels * k, data [channels * k], decay_response (channels * k)) ; - exit (1) ; - } ; - - if (! sfinfo.seekable) - { sf_close (file) ; - unlink (filename) ; - printf ("ok\n") ; - return ; - } ; - - /* Now test sf_seek function. */ - - if ((k = sf_seek (file, 0, SEEK_SET)) != 0) - { printf ("\n\nLine %d: Seek to start of file failed (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - for (m = 0 ; m < 3 ; m++) - { test_readf_short_or_die (file, m, data, 11, __LINE__) ; - - for (k = 0 ; k < channels * 11 ; k++) - if (error_function (1.0 * data [k], 1.0 * orig [k + channels * m * 11], margin)) - { printf ("\n\nLine %d: Incorrect sample (m = %d) (#%d : %d => %d).\n", __LINE__, m, k + channels * m * 11, orig [k + channels * m * 11], data [k]) ; - for (m = 0 ; m < channels ; m++) - printf ("%d ", data [m]) ; - printf ("\n") ; - exit (1) ; - } ; - } ; - - seekpos = BUFFER_SIZE / 10 ; - - /* Check seek from start of file. */ - if ((k = sf_seek (file, seekpos, SEEK_SET)) != seekpos) - { printf ("Seek to start of file + %d failed (%d).\n", seekpos, k) ; - exit (1) ; - } ; - - test_readf_short_or_die (file, 0, data, 1, __LINE__) ; - - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin)) - { printf ("\n\nLine %d: sf_seek (SEEK_SET) followed by sf_readf_short failed (%d, %d).\n", __LINE__, orig [1], data [0]) ; - exit (1) ; - } ; - - if ((k = sf_seek (file, 0, SEEK_CUR)) != seekpos + 1) - { printf ("\n\nLine %d: sf_seek (SEEK_CUR) with 0 offset failed (%d should be %d)\n", __LINE__, k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) + BUFFER_SIZE / 5 ; - k = sf_seek (file, BUFFER_SIZE / 5, SEEK_CUR) ; - test_readf_short_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin) || k != seekpos) - { printf ("\n\nLine %d: sf_seek (forwards, SEEK_CUR) followed by sf_readf_short failed (%d, %d) (%d, %d).\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos + 1) ; - oct_save_short (orig, data, datalen) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) - 20 ; - /* Check seek backward from current position. */ - k = sf_seek (file, -20, SEEK_CUR) ; - test_readf_short_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (backwards, SEEK_CUR) followed by sf_readf_short failed (%d, %d) (%d, %d).\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos) ; - exit (1) ; - } ; - - /* Check that read past end of file returns number of items. */ - sf_seek (file, sfinfo.frames, SEEK_SET) ; - - if ((k = sf_readf_short (file, data, datalen)) != 0) - { printf ("\n\nLine %d: Return value from sf_readf_short past end of file incorrect (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - /* Check seek backward from end. */ - if ((k = sf_seek (file, 5 - sfinfo.frames, SEEK_END)) != 5) - { printf ("\n\nLine %d: sf_seek (SEEK_END) returned %d instead of %d.\n", __LINE__, k, 5) ; - exit (1) ; - } ; - - test_readf_short_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (1.0 * data [0], 1.0 * orig [5 * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_END) followed by sf_readf_short failed (%d should be %d).\n", __LINE__, data [0], orig [5 * channels]) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - printf ("ok\n") ; -} /* lcomp_test_short */ - -/*-------------------------------------------------------------------------------------------- -*/ - -static void -lcomp_test_int (const char *filename, int filetype, int channels, double margin) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, m, half_max_abs ; - sf_count_t datalen, seekpos ; - double scale, max_val ; - int *orig, *data ; - - print_test_name ("lcomp_test_int", filename) ; - - datalen = BUFFER_SIZE / channels ; - - if (is_lossy (filetype)) - { scale = 1.0 * 0x10000 ; - max_val = 32000.0 * scale ; - } - else - { scale = 1.0 ; - max_val = 0x7fffffff * scale ; - } ; - - data = data_buffer.i ; - orig = orig_buffer.i ; - - gen_signal_double (orig_buffer.d, max_val, channels, datalen) ; - - for (k = 0 ; k < channels * datalen ; k++) - orig [k] = lrint (orig_buffer.d [k]) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = 123456789 ; /* Ridiculous value. */ - sfinfo.channels = channels ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - test_writef_int_or_die (file, 0, orig, datalen, __LINE__) ; - sf_set_string (file, SF_STR_COMMENT, long_comment) ; - sf_close (file) ; - - memset (data, 0, datalen * sizeof (int)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - if ((sfinfo.format & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK)) != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < datalen / channels) - { printf ("Too few.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.frames > (datalen + datalen / 20)) - { printf ("Too many.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != channels) - { printf ("Incorrect number of channels in file.\n") ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - check_comment (file, filetype, __LINE__) ; - - test_readf_int_or_die (file, 0, data, datalen, __LINE__) ; - - half_max_abs = 0 ; - for (k = 0 ; k < datalen ; k++) - { if (error_function (data [k] / scale, orig [k] / scale, margin)) - { printf ("\nLine %d: Incorrect sample (#%d : %f should be %f).\n", __LINE__, k, data [k] / scale, orig [k] / scale) ; - oct_save_int (orig, data, datalen) ; - exit (1) ; - } ; - half_max_abs = LCT_MAX (half_max_abs, abs (data [k] / 2)) ; - } ; - - if (half_max_abs < 1.0) - { printf ("\n\nLine %d: Signal is all zeros (%d, 0x%X).\n", __LINE__, half_max_abs, half_max_abs) ; - exit (1) ; - } ; - - if ((k = sf_readf_int (file, data, datalen)) != sfinfo.frames - datalen) - { printf ("\n\nLine %d: Incorrect read length (%" PRId64 " should be %d).\n", __LINE__, - channels * sfinfo.frames - datalen, k) ; - exit (1) ; - } ; - - /* This check is only for block based encoders which must append silence - ** to the end of a file so as to fill out a block. - */ - if ((sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_MS_ADPCM) - for (k = 0 ; k < sfinfo.frames - datalen ; k++) - if (abs (data [channels * k] / scale) > decay_response (channels * k)) - { printf ("\n\nLine %d : Incorrect sample B (#%d : abs (%d) should be < %d).\n", __LINE__, channels * k, data [channels * k], decay_response (channels * k)) ; - exit (1) ; - } ; - - if (! sfinfo.seekable) - { sf_close (file) ; - unlink (filename) ; - printf ("ok\n") ; - return ; - } ; - - /* Now test sf_seek function. */ - - if ((k = sf_seek (file, 0, SEEK_SET)) != 0) - { printf ("\n\nLine %d: Seek to start of file failed (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - for (m = 0 ; m < 3 ; m++) - { test_readf_int_or_die (file, m, data, 11, __LINE__) ; - - for (k = 0 ; k < channels * 11 ; k++) - if (error_function (data [k] / scale, orig [k + channels * m * 11] / scale, margin)) - { printf ("\nLine %d: Incorrect sample (m = %d) (#%d : %d => %d).\n", __LINE__, m, k + channels * m * 11, orig [k + channels * m * 11], data [k]) ; - for (m = 0 ; m < channels ; m++) - printf ("%d ", data [m]) ; - printf ("\n") ; - exit (1) ; - } ; - } ; - - seekpos = BUFFER_SIZE / 10 ; - - /* Check seek from start of file. */ - if ((k = sf_seek (file, seekpos, SEEK_SET)) != seekpos) - { printf ("Seek to start of file + %" PRId64 " failed (%d).\n", seekpos, k) ; - exit (1) ; - } ; - - test_readf_int_or_die (file, 0, data, 1, __LINE__) ; - - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_SET) followed by sf_readf_int failed (%d, %d).\n", __LINE__, orig [1], data [0]) ; - exit (1) ; - } ; - - if ((k = sf_seek (file, 0, SEEK_CUR)) != seekpos + 1) - { printf ("\n\nLine %d: sf_seek (SEEK_CUR) with 0 offset failed (%d should be %" PRId64 ")\n", __LINE__, k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) + BUFFER_SIZE / 5 ; - k = sf_seek (file, BUFFER_SIZE / 5, SEEK_CUR) ; - test_readf_int_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (forwards, SEEK_CUR) followed by sf_readf_int failed (%d, %d) (%d, %" PRId64 ").\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) - 20 ; - /* Check seek backward from current position. */ - k = sf_seek (file, -20, SEEK_CUR) ; - test_readf_int_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (backwards, SEEK_CUR) followed by sf_readf_int failed (%d, %d) (%d, %" PRId64 ").\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos) ; - exit (1) ; - } ; - - /* Check that read past end of file returns number of items. */ - sf_seek (file, sfinfo.frames, SEEK_SET) ; - - if ((k = sf_readf_int (file, data, datalen)) != 0) - { printf ("\n\nLine %d: Return value from sf_readf_int past end of file incorrect (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - /* Check seek backward from end. */ - if ((k = sf_seek (file, 5 - sfinfo.frames, SEEK_END)) != 5) - { printf ("\n\nLine %d: sf_seek (SEEK_END) returned %d instead of %d.\n", __LINE__, k, 5) ; - exit (1) ; - } ; - - test_readf_int_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (data [0] / scale, orig [5 * channels] / scale, margin)) - { printf ("\nLine %d: sf_seek (SEEK_END) followed by sf_readf_short failed (%d should be %d).\n", __LINE__, data [0], orig [5]) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - printf ("ok\n") ; -} /* lcomp_test_int */ - -/*-------------------------------------------------------------------------------------------- -*/ - -static void -lcomp_test_float (const char *filename, int filetype, int channels, double margin) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, m, seekpos ; - sf_count_t datalen ; - float *orig, *data ; - double half_max_abs ; - - print_test_name ("lcomp_test_float", filename) ; - - datalen = BUFFER_SIZE / channels ; - - data = data_buffer.f ; - orig = orig_buffer.f ; - - gen_signal_double (orig_buffer.d, 32000.0, channels, datalen) ; - for (k = 0 ; k < channels * datalen ; k++) - orig [k] = orig_buffer.d [k] ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = 123456789 ; /* Ridiculous value. */ - sfinfo.channels = channels ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - test_writef_float_or_die (file, 0, orig, datalen, __LINE__) ; - sf_set_string (file, SF_STR_COMMENT, long_comment) ; - sf_close (file) ; - - memset (data, 0, datalen * sizeof (float)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - if ((sfinfo.format & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK)) != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < datalen / channels) - { printf ("Too few.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.frames > (datalen + datalen / 20)) - { printf ("Too many.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != channels) - { printf ("Incorrect number of channels in file.\n") ; - exit (1) ; - } ; - - check_comment (file, filetype, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - check_log_buffer_or_die (file, __LINE__) ; - - check_comment (file, filetype, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - test_readf_float_or_die (file, 0, data, datalen, __LINE__) ; - - half_max_abs = 0.0 ; - for (k = 0 ; k < datalen ; k++) - { if (error_function (data [k], orig [k], margin)) - { printf ("\nLine %d: Incorrect sample A (#%d : %f should be %f).\n", __LINE__, k, data [k], orig [k]) ; - oct_save_float (orig, data, datalen) ; - exit (1) ; - } ; - half_max_abs = LCT_MAX (half_max_abs, fabs (0.5 * data [k])) ; - } ; - - if (half_max_abs < 1.0) - { printf ("\n\nLine %d: Signal is all zeros.\n", __LINE__) ; - exit (1) ; - } ; - - if ((k = sf_readf_float (file, data, datalen)) != sfinfo.frames - datalen) - { printf ("\n\nLine %d: Incorrect read length (%" PRId64 " should be %d).\n", __LINE__, - channels * sfinfo.frames - datalen, k) ; - exit (1) ; - } ; - - /* This check is only for block based encoders which must append silence - ** to the end of a file so as to fill out a block. - */ - if ((sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_MS_ADPCM) - for (k = 0 ; k < sfinfo.frames - datalen ; k++) - if (abs (data [channels * k]) > decay_response (channels * k)) - { printf ("\n\nLine %d : Incorrect sample B (#%d : abs (%f) should be < %d).\n", __LINE__, channels * k, data [channels * k], decay_response (channels * k)) ; - exit (1) ; - } ; - - if (! sfinfo.seekable) - { sf_close (file) ; - unlink (filename) ; - printf ("ok\n") ; - return ; - } ; - - /* Now test sf_seek function. */ - - if ((k = sf_seek (file, 0, SEEK_SET)) != 0) - { printf ("\n\nLine %d: Seek to start of file failed (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - for (m = 0 ; m < 3 ; m++) - { test_readf_float_or_die (file, 0, data, 11, __LINE__) ; - - for (k = 0 ; k < channels * 11 ; k++) - if (error_function (data [k], orig [k + channels * m * 11], margin)) - { printf ("\nLine %d: Incorrect sample (m = %d) (#%d : %f => %f).\n", __LINE__, m, k + channels * m * 11, orig [k + channels * m * 11], data [k]) ; - for (m = 0 ; m < channels ; m++) - printf ("%f ", data [m]) ; - printf ("\n") ; - exit (1) ; - } ; - } ; - - seekpos = BUFFER_SIZE / 10 ; - - /* Check seek from start of file. */ - if ((k = sf_seek (file, seekpos, SEEK_SET)) != seekpos) - { printf ("Seek to start of file + %d failed (%d).\n", seekpos, k) ; - exit (1) ; - } ; - - test_readf_float_or_die (file, 0, data, 1, __LINE__) ; - - if (error_function (data [0], orig [seekpos * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_SET) followed by sf_readf_float failed (%f, %f).\n", __LINE__, orig [1], data [0]) ; - exit (1) ; - } ; - - if ((k = sf_seek (file, 0, SEEK_CUR)) != seekpos + 1) - { printf ("\n\nLine %d: sf_seek (SEEK_CUR) with 0 offset failed (%d should be %d)\n", __LINE__, k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) + BUFFER_SIZE / 5 ; - k = sf_seek (file, BUFFER_SIZE / 5, SEEK_CUR) ; - test_readf_float_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (data [0], orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (forwards, SEEK_CUR) followed by sf_readf_float failed (%f, %f) (%d, %d).\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) - 20 ; - /* Check seek backward from current position. */ - k = sf_seek (file, -20, SEEK_CUR) ; - test_readf_float_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (data [0], orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (backwards, SEEK_CUR) followed by sf_readf_float failed (%f, %f) (%d, %d).\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos) ; - exit (1) ; - } ; - - /* Check that read past end of file returns number of items. */ - sf_seek (file, sfinfo.frames, SEEK_SET) ; - - if ((k = sf_readf_float (file, data, datalen)) != 0) - { printf ("\n\nLine %d: Return value from sf_readf_float past end of file incorrect (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - /* Check seek backward from end. */ - if ((k = sf_seek (file, 5 - sfinfo.frames, SEEK_END)) != 5) - { printf ("\n\nLine %d: sf_seek (SEEK_END) returned %d instead of %d.\n", __LINE__, k, 5) ; - exit (1) ; - } ; - - test_readf_float_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (data [0], orig [5 * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_END) followed by sf_readf_short failed (%f should be %f).\n", __LINE__, data [0], orig [5 * channels]) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - printf ("ok\n") ; -} /* lcomp_test_float */ - -/*-------------------------------------------------------------------------------------------- -*/ - -static void -lcomp_test_double (const char *filename, int filetype, int channels, double margin) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, m, seekpos ; - sf_count_t datalen ; - double *orig, *data ; - double half_max_abs ; - - print_test_name ("lcomp_test_double", filename) ; - - datalen = BUFFER_SIZE / channels ; - - data = data_buffer.d ; - orig = orig_buffer.d ; - - gen_signal_double (orig_buffer.d, 32000.0, channels, datalen) ; - for (k = 0 ; k < channels * datalen ; k++) - orig [k] = orig_buffer.d [k] ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = 123456789 ; /* Ridiculous value. */ - sfinfo.channels = channels ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - test_writef_double_or_die (file, 0, orig, datalen, __LINE__) ; - sf_set_string (file, SF_STR_COMMENT, long_comment) ; - sf_close (file) ; - - memset (data, 0, datalen * sizeof (double)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - if ((sfinfo.format & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK)) != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < datalen / channels) - { printf ("Too few.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.frames > (datalen + datalen / 20)) - { printf ("Too many.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != channels) - { printf ("Incorrect number of channels in file.\n") ; - exit (1) ; - } ; - - check_comment (file, filetype, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - check_log_buffer_or_die (file, __LINE__) ; - - check_comment (file, filetype, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - test_readf_double_or_die (file, 0, data, datalen, __LINE__) ; - - half_max_abs = 0.0 ; - for (k = 0 ; k < datalen ; k++) - { if (error_function (data [k], orig [k], margin)) - { printf ("\nLine %d: Incorrect sample A (#%d : %f should be %f).\n", __LINE__, k, data [k], orig [k]) ; - oct_save_double (orig, data, datalen) ; - exit (1) ; - } ; - half_max_abs = LCT_MAX (half_max_abs, abs (0.5 * data [k])) ; - } ; - - if (half_max_abs < 1.0) - { printf ("\n\nLine %d: Signal is all zeros.\n", __LINE__) ; - exit (1) ; - } ; - - if ((k = sf_readf_double (file, data, datalen)) != sfinfo.frames - datalen) - { printf ("\n\nLine %d: Incorrect read length (%" PRId64 " should be %d).\n", __LINE__, - channels * sfinfo.frames - datalen, k) ; - exit (1) ; - } ; - - /* This check is only for block based encoders which must append silence - ** to the end of a file so as to fill out a block. - */ - if ((sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_MS_ADPCM) - for (k = 0 ; k < sfinfo.frames - datalen ; k++) - if (abs (data [channels * k]) > decay_response (channels * k)) - { printf ("\n\nLine %d : Incorrect sample B (#%d : abs (%f) should be < %d).\n", __LINE__, channels * k, data [channels * k], decay_response (channels * k)) ; - exit (1) ; - } ; - - if (! sfinfo.seekable) - { sf_close (file) ; - unlink (filename) ; - printf ("ok\n") ; - return ; - } ; - - /* Now test sf_seek function. */ - - if ((k = sf_seek (file, 0, SEEK_SET)) != 0) - { printf ("\n\nLine %d: Seek to start of file failed (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - for (m = 0 ; m < 3 ; m++) - { test_readf_double_or_die (file, m, data, 11, __LINE__) ; - - for (k = 0 ; k < channels * 11 ; k++) - if (error_function (data [k], orig [k + channels * m * 11], margin)) - { printf ("\nLine %d: Incorrect sample (m = %d) (#%d : %f => %f).\n", __LINE__, m, k + channels * m * 11, orig [k + channels * m * 11], data [k]) ; - for (m = 0 ; m < channels ; m++) - printf ("%f ", data [m]) ; - printf ("\n") ; - exit (1) ; - } ; - } ; - - seekpos = BUFFER_SIZE / 10 ; - - /* Check seek from start of file. */ - if ((k = sf_seek (file, seekpos, SEEK_SET)) != seekpos) - { printf ("Seek to start of file + %d failed (%d).\n", seekpos, k) ; - exit (1) ; - } ; - - test_readf_double_or_die (file, 0, data, 1, __LINE__) ; - - if (error_function (data [0], orig [seekpos * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_SET) followed by sf_readf_double failed (%f, %f).\n", __LINE__, orig [1], data [0]) ; - exit (1) ; - } ; - - if ((k = sf_seek (file, 0, SEEK_CUR)) != seekpos + 1) - { printf ("\n\nLine %d: sf_seek (SEEK_CUR) with 0 offset failed (%d should be %d)\n", __LINE__, k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) + BUFFER_SIZE / 5 ; - k = sf_seek (file, BUFFER_SIZE / 5, SEEK_CUR) ; - test_readf_double_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (data [0], orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (forwards, SEEK_CUR) followed by sf_readf_double failed (%f, %f) (%d, %d).\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) - 20 ; - /* Check seek backward from current position. */ - k = sf_seek (file, -20, SEEK_CUR) ; - test_readf_double_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (data [0], orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (backwards, SEEK_CUR) followed by sf_readf_double failed (%f, %f) (%d, %d).\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos) ; - exit (1) ; - } ; - - /* Check that read past end of file returns number of items. */ - sf_seek (file, sfinfo.frames, SEEK_SET) ; - - if ((k = sf_readf_double (file, data, datalen)) != 0) - { printf ("\n\nLine %d: Return value from sf_readf_double past end of file incorrect (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - /* Check seek backward from end. */ - if ((k = sf_seek (file, 5 - sfinfo.frames, SEEK_END)) != 5) - { printf ("\n\nLine %d: sf_seek (SEEK_END) returned %d instead of %d.\n", __LINE__, k, 5) ; - exit (1) ; - } ; - - test_readf_double_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (data [0], orig [5 * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_END) followed by sf_readf_short failed (%f should be %f).\n", __LINE__, data [0], orig [5 * channels]) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - printf ("ok\n") ; -} /* lcomp_test_double */ - -/*======================================================================================== -** Smoothed differential loss compression tests. -*/ - -static void -sdlcomp_test_short (const char *filename, int filetype, int channels, double margin) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, m, seekpos, half_max_abs ; - sf_count_t datalen ; - short *orig, *data, *smooth ; - -channels = 1 ; - print_test_name ("sdlcomp_test_short", filename) ; - - datalen = BUFFER_SIZE ; - - orig = orig_buffer.s ; - data = data_buffer.s ; - smooth = smooth_buffer.s ; - - gen_signal_double (orig_buffer.d, 32000.0, channels, datalen) ; - for (k = 0 ; k < datalen ; k++) - orig [k] = lrint (orig_buffer.d [k]) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = 123456789 ; /* Ridiculous value. */ - sfinfo.channels = channels ; - sfinfo.format = filetype ; - - /* The Vorbis encoder has a bug on PowerPC and X86-64 with sample rates - ** <= 22050. Increasing the sample rate to 32000 avoids triggering it. - ** See https://trac.xiph.org/ticket/1229 - */ - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { const char * errstr ; - - errstr = sf_strerror (NULL) ; - if (strstr (errstr, "Sample rate chosen is known to trigger a Vorbis") == NULL) - { printf ("Line %d: sf_open_fd (SFM_WRITE) failed : %s\n", __LINE__, errstr) ; - dump_log_buffer (NULL) ; - exit (1) ; - } ; - - printf ("\n Sample rate -> 32kHz ") ; - sfinfo.samplerate = 32000 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - } ; - - test_write_short_or_die (file, 0, orig, datalen, __LINE__) ; - sf_set_string (file, SF_STR_COMMENT, long_comment) ; - sf_close (file) ; - - memset (data, 0, datalen * sizeof (short)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < datalen / channels) - { printf ("Too few.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.frames > (datalen + 400)) - { printf ("Too many.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", sfinfo.frames, datalen) ; - exit (1) ; - } ; - - if (sfinfo.channels != channels) - { printf ("Incorrect number of channels in file.\n") ; - exit (1) ; - } ; - - check_comment (file, filetype, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_short_or_die (file, 0, data, datalen, __LINE__) ; - - memcpy (smooth, orig, datalen * sizeof (short)) ; - smoothed_diff_short (data, datalen) ; - smoothed_diff_short (smooth, datalen) ; - - half_max_abs = 0.0 ; - for (k = 0 ; k < datalen ; k++) - { if (error_function (1.0 * data [k], 1.0 * smooth [k], margin)) - { printf ("\nLine %d: Incorrect sample (#%d : %d should be %d).\n", __LINE__, k, data [k], smooth [k]) ; - oct_save_short (orig, smooth, datalen) ; - exit (1) ; - } ; - half_max_abs = LCT_MAX (half_max_abs, abs (0.5 * data [k])) ; - } ; - - if (half_max_abs < 1) - { printf ("\n\nLine %d: Signal is all zeros.\n", __LINE__) ; - exit (1) ; - } ; - - if ((k = sf_read_short (file, data, datalen)) != sfinfo.frames - datalen) - { printf ("\n\nLine %d: Incorrect read length (%d should be %" PRId64 ").\n", __LINE__, k, sfinfo.frames - datalen) ; - exit (1) ; - } ; - - if ((sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_MS_ADPCM && - (sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_GSM610) - for (k = 0 ; k < sfinfo.frames - datalen ; k++) - if (abs (data [k]) > decay_response (k)) - { printf ("\n\nLine %d: Incorrect sample (#%" PRId64 " : abs (%d) should be < %d).\n", __LINE__, datalen + k, data [k], decay_response (k)) ; - exit (1) ; - } ; - - /* Now test sf_seek function. */ - if (sfinfo.seekable) - { if ((k = sf_seek (file, 0, SEEK_SET)) != 0) - { printf ("\n\nLine %d: Seek to start of file failed (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - for (m = 0 ; m < 3 ; m++) - { test_readf_short_or_die (file, m, data, datalen / 7, __LINE__) ; - - smoothed_diff_short (data, datalen / 7) ; - memcpy (smooth, orig + m * datalen / 7, datalen / 7 * sizeof (short)) ; - smoothed_diff_short (smooth, datalen / 7) ; - - for (k = 0 ; k < datalen / 7 ; k++) - if (error_function (1.0 * data [k], 1.0 * smooth [k], margin)) - { printf ("\nLine %d: Incorrect sample C (#%d (%" PRId64 ") : %d => %d).\n", __LINE__, k, k + m * (datalen / 7), smooth [k], data [k]) ; - for (m = 0 ; m < 10 ; m++) - printf ("%d ", data [k]) ; - printf ("\n") ; - exit (1) ; - } ; - } ; /* for (m = 0 ; m < 3 ; m++) */ - - seekpos = BUFFER_SIZE / 10 ; - - /* Check seek from start of file. */ - if ((k = sf_seek (file, seekpos, SEEK_SET)) != seekpos) - { printf ("Seek to start of file + %d failed (%d).\n", seekpos, k) ; - exit (1) ; - } ; - test_readf_short_or_die (file, 0, data, 1, __LINE__) ; - - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_SET) followed by sf_read_short failed (%d, %d).\n", __LINE__, orig [1], data [0]) ; - exit (1) ; - } ; - - if ((k = sf_seek (file, 0, SEEK_CUR)) != seekpos + 1) - { printf ("\n\nLine %d: sf_seek (SEEK_CUR) with 0 offset failed (%d should be %d)\n", __LINE__, k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) + BUFFER_SIZE / 5 ; - k = sf_seek (file, BUFFER_SIZE / 5, SEEK_CUR) ; - test_readf_short_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (forwards, SEEK_CUR) followed by sf_read_short failed (%d, %d) (%d, %d).\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) - 20 ; - /* Check seek backward from current position. */ - k = sf_seek (file, -20, SEEK_CUR) ; - test_readf_short_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (backwards, SEEK_CUR) followed by sf_read_short failed (%d, %d) (%d, %d).\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos) ; - exit (1) ; - } ; - - /* Check that read past end of file returns number of items. */ - sf_seek (file, sfinfo.frames, SEEK_SET) ; - - if ((k = sf_read_short (file, data, datalen)) != 0) - { printf ("\n\nLine %d: Return value from sf_read_short past end of file incorrect (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - /* Check seek backward from end. */ - - if ((k = sf_seek (file, 5 - sfinfo.frames, SEEK_END)) != 5) - { printf ("\n\nLine %d: sf_seek (SEEK_END) returned %d instead of %d.\n", __LINE__, k, 5) ; - exit (1) ; - } ; - - test_read_short_or_die (file, 0, data, channels, __LINE__) ; - if (error_function (1.0 * data [0], 1.0 * orig [5 * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_END) followed by sf_read_short failed (%d should be %d).\n", __LINE__, data [0], orig [5 * channels]) ; - exit (1) ; - } ; - } /* if (sfinfo.seekable) */ - - sf_close (file) ; - - unlink (filename) ; - printf ("ok\n") ; -} /* sdlcomp_test_short */ - -static void -sdlcomp_test_int (const char *filename, int filetype, int channels, double margin) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, m, seekpos, half_max_abs ; - sf_count_t datalen ; - int *orig, *data, *smooth ; - double scale ; - -channels = 1 ; - - print_test_name ("sdlcomp_test_int", filename) ; - - datalen = BUFFER_SIZE ; - scale = 1.0 * 0x10000 ; - - orig = orig_buffer.i ; - data = data_buffer.i ; - smooth = smooth_buffer.i ; - - gen_signal_double (orig_buffer.d, 32000.0 * scale, channels, datalen) ; - for (k = 0 ; k < datalen ; k++) - orig [k] = lrint (orig_buffer.d [k]) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = 123456789 ; /* Ridiculous value. */ - sfinfo.channels = channels ; - sfinfo.format = filetype ; - - /* The Vorbis encoder has a bug on PowerPC and X86-64 with sample rates - ** <= 22050. Increasing the sample rate to 32000 avoids triggering it. - ** See https://trac.xiph.org/ticket/1229 - */ - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { const char * errstr ; - - errstr = sf_strerror (NULL) ; - if (strstr (errstr, "Sample rate chosen is known to trigger a Vorbis") == NULL) - { printf ("Line %d: sf_open_fd (SFM_WRITE) failed : %s\n", __LINE__, errstr) ; - dump_log_buffer (NULL) ; - exit (1) ; - } ; - - printf ("\n Sample rate -> 32kHz ") ; - sfinfo.samplerate = 32000 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - } ; - - test_writef_int_or_die (file, 0, orig, datalen, __LINE__) ; - sf_set_string (file, SF_STR_COMMENT, long_comment) ; - sf_close (file) ; - - memset (data, 0, datalen * sizeof (int)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("Returned format incorrect (0x%08X => 0x%08X).\n", filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < datalen / channels) - { printf ("Too few.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.frames > (datalen + 400)) - { printf ("Too many.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", sfinfo.frames, datalen) ; - exit (1) ; - } ; - - if (sfinfo.channels != channels) - { printf ("Incorrect number of channels in file.\n") ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_int_or_die (file, 0, data, datalen, __LINE__) ; - - memcpy (smooth, orig, datalen * sizeof (int)) ; - smoothed_diff_int (data, datalen) ; - smoothed_diff_int (smooth, datalen) ; - - half_max_abs = abs (data [0] >> 16) ; - for (k = 1 ; k < datalen ; k++) - { if (error_function (data [k] / scale, smooth [k] / scale, margin)) - { printf ("\nLine %d: Incorrect sample (#%d : %d should be %d).\n", __LINE__, k, data [k], smooth [k]) ; - oct_save_int (orig, smooth, datalen) ; - exit (1) ; - } ; - half_max_abs = LCT_MAX (half_max_abs, abs (data [k] / 2)) ; - } ; - - if (half_max_abs < 1) - { printf ("\n\nLine %d: Signal is all zeros.\n", __LINE__) ; - exit (1) ; - } ; - - if ((k = sf_readf_int (file, data, datalen)) != sfinfo.frames - datalen) - { printf ("\n\nLine %d: Incorrect read length (%d should be %" PRId64 ").\n", __LINE__, k, sfinfo.frames - datalen) ; - exit (1) ; - } ; - - if ((sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_IMA_ADPCM && - (sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_MS_ADPCM && - (sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_GSM610 && - (sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_G721_32 && - (sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_G723_24) - for (k = 0 ; k < sfinfo.frames - datalen ; k++) - if (abs (data [k]) > decay_response (k)) - { printf ("\n\nLine %d: Incorrect sample (#%" PRId64 " : abs (%d) should be < %d).\n", __LINE__, datalen + k, data [k], decay_response (k)) ; - exit (1) ; - } ; - - /* Now test sf_seek function. */ - if (sfinfo.seekable) - { if ((k = sf_seek (file, 0, SEEK_SET)) != 0) - { printf ("\n\nLine %d: Seek to start of file failed (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - for (m = 0 ; m < 3 ; m++) - { test_readf_int_or_die (file, m, data, datalen / 7, __LINE__) ; - - smoothed_diff_int (data, datalen / 7) ; - memcpy (smooth, orig + m * datalen / 7, datalen / 7 * sizeof (int)) ; - smoothed_diff_int (smooth, datalen / 7) ; - - for (k = 0 ; k < datalen / 7 ; k++) - if (error_function (data [k] / scale, smooth [k] / scale, margin)) - { printf ("\nLine %d: Incorrect sample (#%d (%" PRId64 ") : %d => %d).\n", __LINE__, k, k + m * (datalen / 7), smooth [k], data [k]) ; - for (m = 0 ; m < 10 ; m++) - printf ("%d ", data [k]) ; - printf ("\n") ; - exit (1) ; - } ; - } ; /* for (m = 0 ; m < 3 ; m++) */ - - seekpos = BUFFER_SIZE / 10 ; - - /* Check seek from start of file. */ - if ((k = sf_seek (file, seekpos, SEEK_SET)) != seekpos) - { printf ("Seek to start of file + %d failed (%d).\n", seekpos, k) ; - exit (1) ; - } ; - test_readf_int_or_die (file, 0, data, 1, __LINE__) ; - - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_SET) followed by sf_readf_int failed (%d, %d).\n", __LINE__, orig [1], data [0]) ; - exit (1) ; - } ; - - if ((k = sf_seek (file, 0, SEEK_CUR)) != seekpos + 1) - { printf ("\n\nLine %d: sf_seek (SEEK_CUR) with 0 offset failed (%d should be %d)\n", __LINE__, k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) + BUFFER_SIZE / 5 ; - k = sf_seek (file, BUFFER_SIZE / 5, SEEK_CUR) ; - test_readf_int_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (forwards, SEEK_CUR) followed by sf_readf_int failed (%d, %d) (%d, %d).\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) - 20 ; - /* Check seek backward from current position. */ - k = sf_seek (file, -20, SEEK_CUR) ; - test_readf_int_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (1.0 * data [0], 1.0 * orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (backwards, SEEK_CUR) followed by sf_readf_int failed (%d, %d) (%d, %d).\n", __LINE__, data [0], orig [seekpos * channels], k, seekpos) ; - exit (1) ; - } ; - - /* Check that read past end of file returns number of items. */ - sf_seek (file, sfinfo.frames, SEEK_SET) ; - - if ((k = sf_readf_int (file, data, datalen)) != 0) - { printf ("\n\nLine %d: Return value from sf_readf_int past end of file incorrect (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - /* Check seek backward from end. */ - - if ((k = sf_seek (file, 5 - sfinfo.frames, SEEK_END)) != 5) - { printf ("\n\nLine %d: sf_seek (SEEK_END) returned %d instead of %d.\n", __LINE__, k, 5) ; - exit (1) ; - } ; - - test_readf_int_or_die (file, 0, data, 1, __LINE__) ; - if (error_function (data [0] / scale, orig [5] / scale, margin)) - { printf ("\nLine %d: sf_seek (SEEK_END) followed by sf_readf_int failed (%d should be %d).\n", __LINE__, data [0], orig [5]) ; - exit (1) ; - } ; - } /* if (sfinfo.seekable) */ - - sf_close (file) ; - - unlink (filename) ; - printf ("ok\n") ; -} /* sdlcomp_test_int */ - -static void -sdlcomp_test_float (const char *filename, int filetype, int channels, double margin) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, m, seekpos ; - sf_count_t datalen ; - float *orig, *data, *smooth ; - double half_max_abs ; - -channels = 1 ; - - print_test_name ("sdlcomp_test_float", filename) ; - - if ((filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_VORBIS) - { puts ("Not working for this format.") ; - return ; - } ; - -printf ("** fix this ** ") ; - - datalen = BUFFER_SIZE ; - - orig = orig_buffer.f ; - data = data_buffer.f ; - smooth = smooth_buffer.f ; - - gen_signal_double (orig_buffer.d, 32000.0, channels, datalen) ; - for (k = 0 ; k < datalen ; k++) - orig [k] = lrint (orig_buffer.d [k]) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = 123456789 ; /* Ridiculous value. */ - sfinfo.channels = channels ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - test_write_float_or_die (file, 0, orig, datalen, __LINE__) ; - sf_set_string (file, SF_STR_COMMENT, long_comment) ; - sf_close (file) ; - - memset (data, 0, datalen * sizeof (float)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - if ((sfinfo.format & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK)) != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < datalen / channels) - { printf ("Too few.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.frames > (datalen + 400)) - { printf ("Too many.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", sfinfo.frames, datalen) ; - exit (1) ; - } ; - - if (sfinfo.channels != channels) - { printf ("Incorrect number of channels in file.\n") ; - exit (1) ; - } ; - - check_comment (file, filetype, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_float_or_die (file, 0, data, datalen, __LINE__) ; - - memcpy (smooth, orig, datalen * sizeof (float)) ; - smoothed_diff_float (data, datalen) ; - smoothed_diff_float (smooth, datalen) ; - - half_max_abs = fabs (data [0]) ; - for (k = 1 ; k < datalen ; k++) - { if (error_function (data [k], smooth [k], margin)) - { printf ("\nLine %d: Incorrect sample (#%d : %d should be %d).\n", __LINE__, k, (int) data [k], (int) smooth [k]) ; - oct_save_float (orig, smooth, datalen) ; - exit (1) ; - } ; - half_max_abs = LCT_MAX (half_max_abs, abs (0.5 * data [k])) ; - } ; - - if (half_max_abs <= 0.0) - { printf ("\n\nLine %d: Signal is all zeros.\n", __LINE__) ; - printf ("half_max_abs : % 10.6f\n", half_max_abs) ; - exit (1) ; - } ; - - if ((k = sf_read_float (file, data, datalen)) != sfinfo.frames - datalen) - { printf ("\n\nLine %d: Incorrect read length (%d should be %" PRId64 ").\n", __LINE__, k, sfinfo.frames - datalen) ; - exit (1) ; - } ; - - if ((sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_MS_ADPCM && - (sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_GSM610) - for (k = 0 ; k < sfinfo.frames - datalen ; k++) - if (abs (data [k]) > decay_response (k)) - { printf ("\n\nLine %d: Incorrect sample (#%" PRId64 " : abs (%d) should be < %d).\n", __LINE__, datalen + k, (int) data [k], (int) decay_response (k)) ; - exit (1) ; - } ; - - /* Now test sf_seek function. */ - if (sfinfo.seekable) - { if ((k = sf_seek (file, 0, SEEK_SET)) != 0) - { printf ("\n\nLine %d: Seek to start of file failed (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - for (m = 0 ; m < 3 ; m++) - { test_read_float_or_die (file, 0, data, datalen / 7, __LINE__) ; - - smoothed_diff_float (data, datalen / 7) ; - memcpy (smooth, orig + m * datalen / 7, datalen / 7 * sizeof (float)) ; - smoothed_diff_float (smooth, datalen / 7) ; - - for (k = 0 ; k < datalen / 7 ; k++) - if (error_function (data [k], smooth [k], margin)) - { printf ("\nLine %d: Incorrect sample C (#%d (%" PRId64 ") : %d => %d).\n", __LINE__, k, k + m * (datalen / 7), (int) smooth [k], (int) data [k]) ; - for (m = 0 ; m < 10 ; m++) - printf ("%d ", (int) data [k]) ; - printf ("\n") ; - exit (1) ; - } ; - } ; /* for (m = 0 ; m < 3 ; m++) */ - - seekpos = BUFFER_SIZE / 10 ; - - /* Check seek from start of file. */ - if ((k = sf_seek (file, seekpos, SEEK_SET)) != seekpos) - { printf ("Seek to start of file + %d failed (%d).\n", seekpos, k) ; - exit (1) ; - } ; - test_read_float_or_die (file, 0, data, channels, __LINE__) ; - - if (error_function (data [0], orig [seekpos * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_SET) followed by sf_read_float failed (%d, %d).\n", __LINE__, (int) orig [1], (int) data [0]) ; - exit (1) ; - } ; - - if ((k = sf_seek (file, 0, SEEK_CUR)) != seekpos + 1) - { printf ("\n\nLine %d: sf_seek (SEEK_CUR) with 0 offset failed (%d should be %d)\n", __LINE__, k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) + BUFFER_SIZE / 5 ; - k = sf_seek (file, BUFFER_SIZE / 5, SEEK_CUR) ; - test_read_float_or_die (file, 0, data, channels, __LINE__) ; - if (error_function (data [0], orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (forwards, SEEK_CUR) followed by sf_read_float failed (%d, %d) (%d, %d).\n", __LINE__, (int) data [0], (int) orig [seekpos * channels], k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) - 20 ; - /* Check seek backward from current position. */ - k = sf_seek (file, -20, SEEK_CUR) ; - test_read_float_or_die (file, 0, data, channels, __LINE__) ; - if (error_function (data [0], orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (backwards, SEEK_CUR) followed by sf_read_float failed (%d, %d) (%d, %d).\n", __LINE__, (int) data [0], (int) orig [seekpos * channels], k, seekpos) ; - exit (1) ; - } ; - - /* Check that read past end of file returns number of items. */ - sf_seek (file, sfinfo.frames, SEEK_SET) ; - - if ((k = sf_read_float (file, data, datalen)) != 0) - { printf ("\n\nLine %d: Return value from sf_read_float past end of file incorrect (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - /* Check seek backward from end. */ - - if ((k = sf_seek (file, 5 - sfinfo.frames, SEEK_END)) != 5) - { printf ("\n\nLine %d: sf_seek (SEEK_END) returned %d instead of %d.\n", __LINE__, k, 5) ; - exit (1) ; - } ; - - test_read_float_or_die (file, 0, data, channels, __LINE__) ; - if (error_function (data [0], orig [5 * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_END) followed by sf_read_float failed (%f should be %f).\n", __LINE__, data [0], orig [5 * channels]) ; - exit (1) ; - } ; - } /* if (sfinfo.seekable) */ - - sf_close (file) ; - - unlink (filename) ; - printf ("ok\n") ; -} /* sdlcomp_test_float */ - -static void -sdlcomp_test_double (const char *filename, int filetype, int channels, double margin) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, m, seekpos ; - sf_count_t datalen ; - double *orig, *data, *smooth, half_max_abs ; - -channels = 1 ; - print_test_name ("sdlcomp_test_double", filename) ; - - if ((filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_VORBIS) - { puts ("Not working for this format.") ; - return ; - } ; - - datalen = BUFFER_SIZE ; - - orig = orig_buffer.d ; - data = data_buffer.d ; - smooth = smooth_buffer.d ; - - gen_signal_double (orig_buffer.d, 32000.0, channels, datalen) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = 123456789 ; /* Ridiculous value. */ - sfinfo.channels = channels ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - test_write_double_or_die (file, 0, orig, datalen, __LINE__) ; - sf_set_string (file, SF_STR_COMMENT, long_comment) ; - sf_close (file) ; - - memset (data, 0, datalen * sizeof (double)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("Returned format incorrect (0x%08X => 0x%08X).\n", filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < datalen / channels) - { printf ("Too few.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.frames > (datalen + 400)) - { printf ("Too many.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", sfinfo.frames, datalen) ; - exit (1) ; - } ; - - if (sfinfo.channels != channels) - { printf ("Incorrect number of channels in file.\n") ; - exit (1) ; - } ; - - check_comment (file, filetype, __LINE__) ; - - check_comment (file, filetype, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, data, datalen, __LINE__) ; - - memcpy (smooth, orig, datalen * sizeof (double)) ; - smoothed_diff_double (data, datalen) ; - smoothed_diff_double (smooth, datalen) ; - - half_max_abs = 0.0 ; - for (k = 0 ; k < datalen ; k++) - { if (error_function (data [k], smooth [k], margin)) - { printf ("\n\nLine %d: Incorrect sample (#%d : %d should be %d).\n", __LINE__, k, (int) data [k], (int) smooth [k]) ; - oct_save_double (orig, smooth, datalen) ; - exit (1) ; - } ; - half_max_abs = LCT_MAX (half_max_abs, 0.5 * fabs (data [k])) ; - } ; - - if (half_max_abs < 1.0) - { printf ("\n\nLine %d: Signal is all zeros.\n", __LINE__) ; - exit (1) ; - } ; - - if ((k = sf_read_double (file, data, datalen)) != sfinfo.frames - datalen) - { printf ("\n\nLine %d: Incorrect read length (%d should be %" PRId64 ").\n", __LINE__, k, sfinfo.frames - datalen) ; - exit (1) ; - } ; - - if ((sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_MS_ADPCM && - (sfinfo.format & SF_FORMAT_SUBMASK) != SF_FORMAT_GSM610) - for (k = 0 ; k < sfinfo.frames - datalen ; k++) - if (abs (data [k]) > decay_response (k)) - { printf ("\n\nLine %d: Incorrect sample (#%" PRId64 " : abs (%d) should be < %d).\n", __LINE__, datalen + k, (int) data [k], (int) decay_response (k)) ; - exit (1) ; - } ; - - /* Now test sf_seek function. */ - if (sfinfo.seekable) - { if ((k = sf_seek (file, 0, SEEK_SET)) != 0) - { printf ("\n\nLine %d: Seek to start of file failed (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - for (m = 0 ; m < 3 ; m++) - { test_read_double_or_die (file, m, data, datalen / 7, __LINE__) ; - - smoothed_diff_double (data, datalen / 7) ; - memcpy (smooth, orig + m * datalen / 7, datalen / 7 * sizeof (double)) ; - smoothed_diff_double (smooth, datalen / 7) ; - - for (k = 0 ; k < datalen / 7 ; k++) - if (error_function (data [k], smooth [k], margin)) - { printf ("\nLine %d: Incorrect sample C (#%d (%" PRId64 ") : %d => %d).\n", __LINE__, k, k + m * (datalen / 7), (int) smooth [k], (int) data [k]) ; - for (m = 0 ; m < 10 ; m++) - printf ("%d ", (int) data [k]) ; - printf ("\n") ; - exit (1) ; - } ; - } ; /* for (m = 0 ; m < 3 ; m++) */ - - seekpos = BUFFER_SIZE / 10 ; - - /* Check seek from start of file. */ - if ((k = sf_seek (file, seekpos, SEEK_SET)) != seekpos) - { printf ("Seek to start of file + %d failed (%d).\n", seekpos, k) ; - exit (1) ; - } ; - test_read_double_or_die (file, 0, data, channels, __LINE__) ; - - if (error_function (data [0], orig [seekpos * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_SET) followed by sf_read_double failed (%d, %d).\n", __LINE__, (int) orig [1], (int) data [0]) ; - exit (1) ; - } ; - - if ((k = sf_seek (file, 0, SEEK_CUR)) != seekpos + 1) - { printf ("\n\nLine %d: sf_seek (SEEK_CUR) with 0 offset failed (%d should be %d)\n", __LINE__, k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) + BUFFER_SIZE / 5 ; - k = sf_seek (file, BUFFER_SIZE / 5, SEEK_CUR) ; - test_read_double_or_die (file, 0, data, channels, __LINE__) ; - if (error_function (data [0], orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (forwards, SEEK_CUR) followed by sf_read_double failed (%d, %d) (%d, %d).\n", __LINE__, (int) data [0], (int) orig [seekpos * channels], k, seekpos + 1) ; - exit (1) ; - } ; - - seekpos = sf_seek (file, 0, SEEK_CUR) - 20 ; - /* Check seek backward from current position. */ - k = sf_seek (file, -20, SEEK_CUR) ; - test_read_double_or_die (file, 0, data, channels, __LINE__) ; - if (error_function (data [0], orig [seekpos * channels], margin) || k != seekpos) - { printf ("\nLine %d: sf_seek (backwards, SEEK_CUR) followed by sf_read_double failed (%d, %d) (%d, %d).\n", __LINE__, (int) data [0], (int) orig [seekpos * channels], k, seekpos) ; - exit (1) ; - } ; - - /* Check that read past end of file returns number of items. */ - sf_seek (file, sfinfo.frames, SEEK_SET) ; - - if ((k = sf_read_double (file, data, datalen)) != 0) - { printf ("\n\nLine %d: Return value from sf_read_double past end of file incorrect (%d).\n", __LINE__, k) ; - exit (1) ; - } ; - - /* Check seek backward from end. */ - - if ((k = sf_seek (file, 5 - sfinfo.frames, SEEK_END)) != 5) - { printf ("\n\nLine %d: sf_seek (SEEK_END) returned %d instead of %d.\n", __LINE__, k, 5) ; - exit (1) ; - } ; - - test_read_double_or_die (file, 0, data, channels, __LINE__) ; - if (error_function (data [0], orig [5 * channels], margin)) - { printf ("\nLine %d: sf_seek (SEEK_END) followed by sf_read_double failed (%f should be %f).\n", __LINE__, data [0], orig [5 * channels]) ; - exit (1) ; - } ; - } /* if (sfinfo.seekable) */ - - sf_close (file) ; - - unlink (filename) ; - printf ("ok\n") ; -} /* sdlcomp_test_double */ - -static void -read_raw_test (const char *filename, int filetype, int channels) -{ SNDFILE *file ; - SF_INFO sfinfo ; - sf_count_t count, datalen ; - short *orig, *data ; - int k ; - - print_test_name ("read_raw_test", filename) ; - - datalen = ARRAY_LEN (orig_buffer.s) / 2 ; - - orig = orig_buffer.s ; - data = data_buffer.s ; - - gen_signal_double (orig_buffer.d, 32000.0, channels, datalen) ; - for (k = 0 ; k < datalen ; k++) - orig [k] = lrint (orig_buffer.d [k]) ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = 123456789 ; /* Ridiculous value. */ - sfinfo.channels = channels ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - test_write_short_or_die (file, 0, orig, datalen, __LINE__) ; - sf_set_string (file, SF_STR_COMMENT, long_comment) ; - sf_close (file) ; - - memset (data, 0, datalen * sizeof (double)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("Returned format incorrect (0x%08X => 0x%08X).\n", filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < datalen / channels) - { printf ("Too few.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", datalen, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.frames > (datalen + 400)) - { printf ("Too many.frames in file. (%" PRId64 " should be a little more than %" PRId64 ")\n", sfinfo.frames, datalen) ; - exit (1) ; - } ; - - if (sfinfo.channels != channels) - { printf ("Incorrect number of channels in file.\n") ; - exit (1) ; - } ; - - check_comment (file, filetype, __LINE__) ; - - count = sf_read_raw (file, orig_buffer.c, datalen + 5 * channels) ; - if (count != sfinfo.channels * sfinfo.frames) - { printf ("\nLine %d : sf_read_raw returned %" PRId64 " should be %" PRId64 "\n", __LINE__, count, sfinfo.channels * sfinfo.frames) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - printf ("ok\n") ; -} /* read_raw_test */ - -/*======================================================================================== -** Auxiliary functions -*/ - -#define SIGNAL_MAXVAL 30000.0 -#define DECAY_COUNT 1000 - -static int -decay_response (int k) -{ if (k < 1) - return (int) (1.2 * SIGNAL_MAXVAL) ; - if (k > DECAY_COUNT) - return 0 ; - return (int) (1.2 * SIGNAL_MAXVAL * (DECAY_COUNT - k) / (1.0 * DECAY_COUNT)) ; -} /* decay_response */ - -static void -gen_signal_double (double *data, double scale, int channels, int datalen) -{ int k, ramplen ; - double amp = 0.0 ; - - ramplen = DECAY_COUNT ; - - if (channels == 1) - { for (k = 0 ; k < datalen ; k++) - { if (k <= ramplen) - amp = scale * k / ((double) ramplen) ; - else if (k > datalen - ramplen) - amp = scale * (datalen - k) / ((double) ramplen) ; - -/*-printf ("%3d : %g\n", k, amp) ;-*/ - - data [k] = amp * (0.4 * sin (33.3 * 2.0 * M_PI * ((double) (k+1)) / ((double) SAMPLE_RATE)) - + 0.3 * cos (201.1 * 2.0 * M_PI * ((double) (k+1)) / ((double) SAMPLE_RATE))) ; - } ; - } - else - { for (k = 0 ; k < datalen ; k ++) - { if (k <= ramplen) - amp = scale * k / ((double) ramplen) ; - else if (k > datalen - ramplen) - amp = scale * (datalen - k) / ((double) ramplen) ; - - data [2 * k] = amp * (0.4 * sin (33.3 * 2.0 * M_PI * ((double) (k+1)) / ((double) SAMPLE_RATE)) - + 0.3 * cos (201.1 * 2.0 * M_PI * ((double) (k+1)) / ((double) SAMPLE_RATE))) ; - data [2 * k + 1] = amp * (0.4 * sin (55.5 * 2.0 * M_PI * ((double) (k+1)) / ((double) SAMPLE_RATE)) - + 0.3 * cos (201.1 * 2.0 * M_PI * ((double) (k+1)) / ((double) SAMPLE_RATE))) ; - } ; - } ; - - return ; -} /* gen_signal_double */ - -static int -error_function (double data, double orig, double margin) -{ double error ; - - if (fabs (orig) <= 500.0) - error = fabs (fabs (data) - fabs (orig)) / 2000.0 ; - else if (fabs (orig) <= 1000.0) - error = fabs (data - orig) / 3000.0 ; - else - error = fabs (data - orig) / fabs (orig) ; - - if (error > margin) - { printf ("\n\nerror_function (data = %f, orig = %f, margin = %f) -> %f\n", data, orig, margin, error) ; - return 1 ; - } ; - return 0 ; -} /* error_function */ - -static void -smoothed_diff_short (short *data, unsigned int datalen) -{ unsigned int k ; - double memory = 0.0 ; - - /* Calculate the smoothed sample-to-sample difference. */ - for (k = 0 ; k < datalen - 1 ; k++) - { memory = 0.7 * memory + (1 - 0.7) * (double) (data [k+1] - data [k]) ; - data [k] = (short) memory ; - } ; - data [datalen-1] = data [datalen-2] ; - -} /* smoothed_diff_short */ - -static void -smoothed_diff_int (int *data, unsigned int datalen) -{ unsigned int k ; - double memory = 0.0 ; - - /* Calculate the smoothed sample-to-sample difference. */ - for (k = 0 ; k < datalen - 1 ; k++) - { memory = 0.7 * memory + (1 - 0.7) * (double) (data [k+1] - data [k]) ; - data [k] = (int) memory ; - } ; - data [datalen-1] = data [datalen-2] ; - -} /* smoothed_diff_int */ - -static void -smoothed_diff_float (float *data, unsigned int datalen) -{ unsigned int k ; - float memory = 0.0 ; - - /* Calculate the smoothed sample-to-sample difference. */ - for (k = 0 ; k < datalen - 1 ; k++) - { memory = 0.7 * memory + (1 - 0.7) * (data [k+1] - data [k]) ; - data [k] = memory ; - } ; - data [datalen-1] = data [datalen-2] ; - -} /* smoothed_diff_float */ - -static void -smoothed_diff_double (double *data, unsigned int datalen) -{ unsigned int k ; - double memory = 0.0 ; - - /* Calculate the smoothed sample-to-sample difference. */ - for (k = 0 ; k < datalen - 1 ; k++) - { memory = 0.7 * memory + (1 - 0.7) * (data [k+1] - data [k]) ; - data [k] = memory ; - } ; - data [datalen-1] = data [datalen-2] ; - -} /* smoothed_diff_double */ - -static void -check_comment (SNDFILE * file, int format, int lineno) -{ const char *comment ; - - switch (format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_AIFF : - case SF_FORMAT_WAV : - case SF_FORMAT_WAVEX : - break ; - default : - return ; - } ; - - comment = sf_get_string (file, SF_STR_COMMENT) ; - if (comment == NULL) - { printf ("\n\nLine %d : File does not contain a comment string.\n\n", lineno) ; - exit (1) ; - } ; - - if (strcmp (comment, long_comment) != 0) - { printf ("\n\nLine %d : File comment does not match comment written.\n\n", lineno) ; - exit (1) ; - } ; - - return ; -} /* check_comment */ - -static int -is_lossy (int filetype) -{ - switch (SF_FORMAT_SUBMASK & filetype) - { case SF_FORMAT_PCM_U8 : - case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_16 : - case SF_FORMAT_PCM_24 : - case SF_FORMAT_PCM_32 : - case SF_FORMAT_FLOAT : - case SF_FORMAT_DOUBLE : - return 0 ; - - default : - break ; - } ; - - return 1 ; -} /* is_lossy */ - diff --git a/libs/libsndfile/tests/misc_test.c b/libs/libsndfile/tests/misc_test.c deleted file mode 100644 index b95e421dce..0000000000 --- a/libs/libsndfile/tests/misc_test.c +++ /dev/null @@ -1,415 +0,0 @@ -/* -** Copyright (C) 2001-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#if (defined (WIN32) || defined (_WIN32)) -#include -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_LEN (1 << 10) -#define LOG_BUFFER_SIZE 1024 - -static void zero_data_test (const char *filename, int format) ; -static void filesystem_full_test (int format) ; -static void permission_test (const char *filename, int typemajor) ; -static void wavex_amb_test (const char *filename) ; - -int -main (int argc, char *argv []) -{ int do_all = 0 ; - int test_count = 0 ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" wav - test WAV file peak chunk\n") ; - printf (" aiff - test AIFF file PEAK chunk\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all = ! strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "wav")) - { zero_data_test ("zerolen.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - permission_test ("readonly.wav", SF_FORMAT_WAV) ; - wavex_amb_test ("ambisonic.wav") ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { zero_data_test ("zerolen.aiff", SF_FORMAT_AIFF | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_AIFF | SF_FORMAT_PCM_16) ; - permission_test ("readonly.aiff", SF_FORMAT_AIFF) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "au")) - { zero_data_test ("zerolen.au", SF_FORMAT_AU | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_AU | SF_FORMAT_PCM_16) ; - permission_test ("readonly.au", SF_FORMAT_AU) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "caf")) - { zero_data_test ("zerolen.caf", SF_FORMAT_CAF | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_CAF | SF_FORMAT_PCM_16) ; - permission_test ("readonly.caf", SF_FORMAT_CAF) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "svx")) - { zero_data_test ("zerolen.svx", SF_FORMAT_SVX | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_SVX | SF_FORMAT_PCM_16) ; - permission_test ("readonly.svx", SF_FORMAT_SVX) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "nist")) - { zero_data_test ("zerolen.nist", SF_FORMAT_NIST | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_NIST | SF_FORMAT_PCM_16) ; - permission_test ("readonly.nist", SF_FORMAT_NIST) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "paf")) - { zero_data_test ("zerolen.paf", SF_FORMAT_PAF | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_PAF | SF_FORMAT_PCM_16) ; - permission_test ("readonly.paf", SF_FORMAT_PAF) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "ircam")) - { zero_data_test ("zerolen.ircam", SF_FORMAT_IRCAM | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_IRCAM | SF_FORMAT_PCM_16) ; - permission_test ("readonly.ircam", SF_FORMAT_IRCAM) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "voc")) - { zero_data_test ("zerolen.voc", SF_FORMAT_VOC | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_VOC | SF_FORMAT_PCM_16) ; - permission_test ("readonly.voc", SF_FORMAT_VOC) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "w64")) - { zero_data_test ("zerolen.w64", SF_FORMAT_W64 | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_W64 | SF_FORMAT_PCM_16) ; - permission_test ("readonly.w64", SF_FORMAT_W64) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "rf64")) - { zero_data_test ("zerolen.rf64", SF_FORMAT_W64 | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_W64 | SF_FORMAT_PCM_16) ; - permission_test ("readonly.rf64", SF_FORMAT_W64) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat4")) - { zero_data_test ("zerolen.mat4", SF_FORMAT_MAT4 | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_MAT4 | SF_FORMAT_PCM_16) ; - permission_test ("readonly.mat4", SF_FORMAT_MAT4) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat5")) - { zero_data_test ("zerolen.mat5", SF_FORMAT_MAT5 | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_MAT5 | SF_FORMAT_PCM_16) ; - permission_test ("readonly.mat5", SF_FORMAT_MAT5) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "pvf")) - { zero_data_test ("zerolen.pvf", SF_FORMAT_PVF | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_PVF | SF_FORMAT_PCM_16) ; - permission_test ("readonly.pvf", SF_FORMAT_PVF) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "htk")) - { zero_data_test ("zerolen.htk", SF_FORMAT_HTK | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_HTK | SF_FORMAT_PCM_16) ; - permission_test ("readonly.htk", SF_FORMAT_HTK) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "avr")) - { zero_data_test ("zerolen.avr", SF_FORMAT_AVR | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_AVR | SF_FORMAT_PCM_16) ; - permission_test ("readonly.avr", SF_FORMAT_AVR) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "sds")) - { zero_data_test ("zerolen.sds", SF_FORMAT_SDS | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_SDS | SF_FORMAT_PCM_16) ; - permission_test ("readonly.sds", SF_FORMAT_SDS) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mpc2k")) - { zero_data_test ("zerolen.mpc", SF_FORMAT_MPC2K | SF_FORMAT_PCM_16) ; - filesystem_full_test (SF_FORMAT_MPC2K | SF_FORMAT_PCM_16) ; - permission_test ("readonly.mpc", SF_FORMAT_MPC2K) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "ogg")) - { zero_data_test ("zerolen.oga", SF_FORMAT_OGG | SF_FORMAT_VORBIS) ; - /*-filesystem_full_test (SF_FORMAT_OGG | SF_FORMAT_VORBIS) ;-*/ - permission_test ("readonly.oga", SF_FORMAT_OGG) ; - test_count++ ; - } ; - - if (test_count == 0) - { printf ("Mono : ************************************\n") ; - printf ("Mono : * No '%s' test defined.\n", argv [1]) ; - printf ("Mono : ************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -zero_data_test (const char *filename, int format) -{ SNDFILE *file ; - SF_INFO sfinfo ; - - switch (format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_OGG : - if (HAVE_EXTERNAL_LIBS == 0) - return ; - break ; - default : - break ; - } ; - - print_test_name ("zero_data_test", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = format ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sf_close (file) ; - - unlink (filename) ; - puts ("ok") ; -} /* zero_data_test */ - -static void -filesystem_full_test (int format) -{ SNDFILE *file ; - SF_INFO sfinfo ; - struct stat buf ; - - const char *filename = "/dev/full", *errorstr ; - -#if (defined (WIN32) || defined (_WIN32)) - /* Can't run this test on Win32 so return. */ - return ; -#endif - - /* Make sure errno is zero before doing anything else. */ - errno = 0 ; - - print_test_name ("filesystem_full_test", filename) ; - - if (stat (filename, &buf) != 0) - { puts ("/dev/full missing") ; - return ; - } ; - - if (S_ISCHR (buf.st_mode) == 0 && S_ISBLK (buf.st_mode) == 0) - { puts ("/dev/full is not a device file") ; - return ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = format ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) != NULL) - { printf ("\n\nLine %d : Error, file should not have openned.\n", __LINE__ - 1) ; - exit (1) ; - } ; - - errorstr = sf_strerror (file) ; - - if (strstr (errorstr, " space ") == NULL || strstr (errorstr, "device") == NULL) - { printf ("\n\nLine %d : Error bad error string : %s.\n", __LINE__ - 1, errorstr) ; - exit (1) ; - } ; - - puts ("ok") ; -} /* filesystem_full_test */ - -static void -permission_test (const char *filename, int typemajor) -{ -#if (OS_IS_WIN32) - /* Avoid compiler warnings. */ - filename = filename ; - typemajor = typemajor ; - - /* Can't run this test on Win32 so return. */ - return ; -#else - - FILE *textfile ; - SNDFILE *file ; - SF_INFO sfinfo ; - const char *errorstr ; - - /* Make sure errno is zero before doing anything else. */ - errno = 0 ; - - if (getuid () == 0) - { /* If running as root bypass this test. - ** Root is allowed to open a readonly file for write. - */ - return ; - } ; - - print_test_name ("permission_test", filename) ; - - if (access (filename, F_OK) == 0) - { chmod (filename, S_IWUSR) ; - unlink (filename) ; - } ; - - if ((textfile = fopen (filename, "w")) == NULL) - { printf ("\n\nLine %d : not able to open text file for write.\n", __LINE__) ; - exit (1) ; - } ; - - fprintf (textfile, "This is a read only file.\n") ; - fclose (textfile) ; - - if (chmod (filename, S_IRUSR | S_IRGRP)) - { printf ("\n\nLine %d : chmod failed", __LINE__) ; - fflush (stdout) ; - perror ("") ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = (typemajor | SF_FORMAT_PCM_16) ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) != NULL) - { printf ("\n\nLine %d : Error, file should not have opened.\n", __LINE__ - 1) ; - exit (1) ; - } ; - - errorstr = sf_strerror (file) ; - - if (strstr (errorstr, "ermission denied") == NULL) - { printf ("\n\nLine %d : Error bad error string : %s.\n", __LINE__ - 1, errorstr) ; - exit (1) ; - } ; - - if (chmod (filename, S_IWUSR | S_IWGRP)) - { printf ("\n\nLine %d : chmod failed", __LINE__) ; - fflush (stdout) ; - perror ("") ; - exit (1) ; - } ; - - unlink (filename) ; - - puts ("ok") ; - -#endif -} /* permission_test */ - -static void -wavex_amb_test (const char *filename) -{ static short buffer [800] ; - SNDFILE *file ; - SF_INFO sfinfo ; - sf_count_t frames ; - - print_test_name (__func__, filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = SF_FORMAT_WAVEX | SF_FORMAT_PCM_16 ; - sfinfo.channels = 4 ; - - frames = ARRAY_LEN (buffer) / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_WAVEX_SET_AMBISONIC, NULL, SF_AMBISONIC_B_FORMAT) ; - test_writef_short_or_die (file, 0, buffer, frames, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - exit_if_true ( - sf_command (file, SFC_WAVEX_GET_AMBISONIC, NULL, 0) != SF_AMBISONIC_B_FORMAT, - "\n\nLine %d : Error, this file should be in Ambisonic B format.\n", __LINE__ - ) ; - - sf_close (file) ; - - unlink (filename) ; - puts ("ok") ; -} /* wavex_amb_test */ diff --git a/libs/libsndfile/tests/multi_file_test.c b/libs/libsndfile/tests/multi_file_test.c deleted file mode 100644 index 502d15a6ba..0000000000 --- a/libs/libsndfile/tests/multi_file_test.c +++ /dev/null @@ -1,238 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#include -#include -#include - -#include - -#include "utils.h" - -#define DATA_LENGTH (512) - -static void write_file_at_end (int fd, int filetype, int channels, int file_num) ; - -static void multi_file_test (const char *filename, int *formats, int format_count) ; - -static short data [DATA_LENGTH] ; - -static int wav_formats [] = -{ SF_FORMAT_WAV | SF_FORMAT_PCM_16, - SF_FORMAT_WAV | SF_FORMAT_PCM_24, - SF_FORMAT_WAV | SF_FORMAT_ULAW, - SF_FORMAT_WAV | SF_FORMAT_ALAW, - /* Lite remove start */ - SF_FORMAT_WAV | SF_FORMAT_IMA_ADPCM, - SF_FORMAT_WAV | SF_FORMAT_MS_ADPCM, - /* Lite remove end */ - /*-SF_FORMAT_WAV | SF_FORMAT_GSM610 Doesn't work yet. -*/ -} ; - -static int aiff_formats [] = -{ SF_FORMAT_AIFF | SF_FORMAT_PCM_16, - SF_FORMAT_AIFF | SF_FORMAT_PCM_24, - SF_FORMAT_AIFF | SF_FORMAT_ULAW, - SF_FORMAT_AIFF | SF_FORMAT_ALAW -} ; - -static int au_formats [] = -{ SF_FORMAT_AU | SF_FORMAT_PCM_16, - SF_FORMAT_AU | SF_FORMAT_PCM_24, - SF_FORMAT_AU | SF_FORMAT_ULAW, - SF_FORMAT_AU | SF_FORMAT_ALAW -} ; - -static int verbose = SF_FALSE ; - -int -main (int argc, char **argv) -{ int do_all = 0 ; - int test_count = 0 ; - - if (argc == 3 && strcmp (argv [2], "-v") == 0) - { verbose = SF_TRUE ; - argc -- ; - } ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" wav - test WAV file functions (little endian)\n") ; - printf (" aiff - test AIFF file functions (big endian)\n") ; - printf (" au - test AU file functions\n") ; -#if 0 - printf (" svx - test 8SVX/16SV file functions\n") ; - printf (" nist - test NIST Sphere file functions\n") ; - printf (" ircam - test IRCAM file functions\n") ; - printf (" voc - Create Voice file functions\n") ; - printf (" w64 - Sonic Foundry's W64 file functions\n") ; -#endif - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all = !strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "wav")) - { multi_file_test ("multi_wav.dat", wav_formats, ARRAY_LEN (wav_formats)) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { multi_file_test ("multi_aiff.dat", aiff_formats, ARRAY_LEN (aiff_formats)) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "au")) - { multi_file_test ("multi_au.dat", au_formats, ARRAY_LEN (au_formats)) ; - test_count++ ; - } ; - - return 0 ; -} /* main */ - -/*====================================================================================== -*/ - -static void -multi_file_test (const char *filename, int *formats, int format_count) -{ SNDFILE *sndfile ; - SF_INFO sfinfo ; - SF_EMBED_FILE_INFO embed_info ; - sf_count_t filelen ; - int fd, k, file_count = 0 ; - - print_test_name ("multi_file_test", filename) ; - - unlink (filename) ; - - if ((fd = open (filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)) < 0) - { printf ("\n\nLine %d: open failed : %s\n", __LINE__, strerror (errno)) ; - exit (1) ; - } ; - - k = write (fd, "1234", 4) ; - - for (k = 0 ; k < format_count ; k++) - write_file_at_end (fd, formats [k], 2, k) ; - - filelen = file_length_fd (fd) ; - - embed_info.offset = 4 ; - embed_info.length = 0 ; - - - for (file_count = 1 ; embed_info.offset + embed_info.length < filelen ; file_count ++) - { - if (verbose) - { puts ("\n------------------------------------") ; - printf ("This offset : %" PRId64 "\n", embed_info.offset + embed_info.length) ; - } ; - - if (lseek (fd, embed_info.offset + embed_info.length, SEEK_SET) < 0) - { printf ("\n\nLine %d: lseek failed : %s\n", __LINE__, strerror (errno)) ; - exit (1) ; - } ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - if ((sndfile = sf_open_fd (fd, SFM_READ, &sfinfo, SF_FALSE)) == NULL) - { printf ("\n\nLine %d: sf_open_fd failed\n", __LINE__) ; - printf ("Embedded file number : %d offset : %" PRId64 "\n", file_count, embed_info.offset) ; - puts (sf_strerror (sndfile)) ; - dump_log_buffer (sndfile) ; - exit (1) ; - } ; - - sf_command (sndfile, SFC_GET_EMBED_FILE_INFO, &embed_info, sizeof (embed_info)) ; - - sf_close (sndfile) ; - - if (verbose) - printf ("\nNext offset : %" PRId64 "\nNext length : %" PRId64 "\n", embed_info.offset, embed_info.length) ; - } ; - - file_count -- ; - - if (file_count != format_count) - { printf ("\n\nLine %d: file count (%d) not equal to %d.\n\n", __LINE__, file_count, format_count) ; - printf ("Embedded file number : %d\n", file_count) ; - exit (1) ; - } ; - - close (fd) ; - unlink (filename) ; - printf ("ok\n") ; - - return ; -} /* multi_file_test */ - -/*====================================================================================== -*/ - -static void -write_file_at_end (int fd, int filetype, int channels, int file_num) -{ SNDFILE *sndfile ; - SF_INFO sfinfo ; - - int frames, k ; - - lseek (fd, 0, SEEK_END) ; - - for (k = 0 ; k < DATA_LENGTH ; k++) - data [k] = k ; - - frames = DATA_LENGTH / channels ; - - sfinfo.format = filetype ; - sfinfo.channels = channels ; - sfinfo.samplerate = 44100 ; - - if ((sndfile = sf_open_fd (fd, SFM_WRITE, &sfinfo, SF_FALSE)) == NULL) - { printf ("\n\nLine %d: sf_open_fd failed\n", __LINE__) ; - printf ("Embedded file number : %d\n", file_num) ; - puts (sf_strerror (sndfile)) ; - dump_log_buffer (sndfile) ; - exit (1) ; - } ; - - if (sf_writef_short (sndfile, data, frames) != frames) - { printf ("\n\nLine %d: short write\n", __LINE__) ; - printf ("Embedded file number : %d\n", file_num) ; - exit (1) ; - } ; - - sf_close (sndfile) ; -} /* write_file_at_end */ - diff --git a/libs/libsndfile/tests/ogg_test.c b/libs/libsndfile/tests/ogg_test.c deleted file mode 100644 index 4b1be031fc..0000000000 --- a/libs/libsndfile/tests/ogg_test.c +++ /dev/null @@ -1,344 +0,0 @@ -/* -** Copyright (C) 2007-2013 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include - -#include - -#include "utils.h" - -#define SAMPLE_RATE 44100 -#define DATA_LENGTH (SAMPLE_RATE / 8) - -typedef union -{ double d [DATA_LENGTH] ; - float f [DATA_LENGTH] ; - int i [DATA_LENGTH] ; - short s [DATA_LENGTH] ; -} BUFFER ; - -static BUFFER data_out ; -static BUFFER data_in ; - -static void -ogg_short_test (void) -{ const char * filename = "vorbis_short.oga" ; - - SNDFILE * file ; - SF_INFO sfinfo ; - short seek_data [10] ; - unsigned k ; - - print_test_name ("ogg_short_test", filename) ; - - /* Generate float data. */ - gen_windowed_sine_float (data_out.f, ARRAY_LEN (data_out.f), 1.0 * 0x7F00) ; - - /* Convert to shorteger. */ - for (k = 0 ; k < ARRAY_LEN (data_out.s) ; k++) - data_out.s [k] = lrintf (data_out.f [k]) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - /* Set up output file type. */ - sfinfo.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ; - sfinfo.channels = 1 ; - sfinfo.samplerate = SAMPLE_RATE ; - - /* Write the output file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - test_write_short_or_die (file, 0, data_out.s, ARRAY_LEN (data_out.s), __LINE__) ; - sf_close (file) ; - - /* Read the file in again. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - test_read_short_or_die (file, 0, data_in.s, ARRAY_LEN (data_in.s), __LINE__) ; - sf_close (file) ; - - puts ("ok") ; - - /* Test seeking. */ - print_test_name ("ogg_seek_test", filename) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - test_read_short_or_die (file, 0, seek_data, ARRAY_LEN (seek_data), __LINE__) ; - compare_short_or_die (seek_data, data_in.s + 10, ARRAY_LEN (seek_data), __LINE__) ; - - /* Test seek to end of file. */ - test_seek_or_die (file, 0, SEEK_END, sfinfo.frames, sfinfo.channels, __LINE__) ; - - sf_close (file) ; - - puts ("ok") ; - - unlink (filename) ; -} /* ogg_short_test */ - -static void -ogg_int_test (void) -{ const char * filename = "vorbis_int.oga" ; - - SNDFILE * file ; - SF_INFO sfinfo ; - int seek_data [10] ; - unsigned k ; - - print_test_name ("ogg_int_test", filename) ; - - /* Generate float data. */ - gen_windowed_sine_float (data_out.f, ARRAY_LEN (data_out.f), 1.0 * 0x7FFF0000) ; - - /* Convert to integer. */ - for (k = 0 ; k < ARRAY_LEN (data_out.i) ; k++) - data_out.i [k] = lrintf (data_out.f [k]) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - /* Set up output file type. */ - sfinfo.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ; - sfinfo.channels = 1 ; - sfinfo.samplerate = SAMPLE_RATE ; - - /* Write the output file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - test_write_int_or_die (file, 0, data_out.i, ARRAY_LEN (data_out.i), __LINE__) ; - sf_close (file) ; - - /* Read the file in again. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - test_read_int_or_die (file, 0, data_in.i, ARRAY_LEN (data_in.i), __LINE__) ; - sf_close (file) ; - - puts ("ok") ; - - /* Test seeking. */ - print_test_name ("ogg_seek_test", filename) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - test_read_int_or_die (file, 0, seek_data, ARRAY_LEN (seek_data), __LINE__) ; - compare_int_or_die (seek_data, data_in.i + 10, ARRAY_LEN (seek_data), __LINE__) ; - - sf_close (file) ; - - puts ("ok") ; - - unlink (filename) ; -} /* ogg_int_test */ - -static void -ogg_float_test (void) -{ const char * filename = "vorbis_float.oga" ; - - SNDFILE * file ; - SF_INFO sfinfo ; - float seek_data [10] ; - - print_test_name ("ogg_float_test", filename) ; - - gen_windowed_sine_float (data_out.f, ARRAY_LEN (data_out.f), 0.95) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - /* Set up output file type. */ - sfinfo.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ; - sfinfo.channels = 1 ; - sfinfo.samplerate = SAMPLE_RATE ; - - /* Write the output file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - test_write_float_or_die (file, 0, data_out.f, ARRAY_LEN (data_out.f), __LINE__) ; - sf_close (file) ; - - /* Read the file in again. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - test_read_float_or_die (file, 0, data_in.f, ARRAY_LEN (data_in.f), __LINE__) ; - sf_close (file) ; - - puts ("ok") ; - - /* Test seeking. */ - print_test_name ("ogg_seek_test", filename) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - test_read_float_or_die (file, 0, seek_data, ARRAY_LEN (seek_data), __LINE__) ; - compare_float_or_die (seek_data, data_in.f + 10, ARRAY_LEN (seek_data), __LINE__) ; - - sf_close (file) ; - - puts ("ok") ; - - unlink (filename) ; -} /* ogg_float_test */ - -static void -ogg_double_test (void) -{ const char * filename = "vorbis_double.oga" ; - - SNDFILE * file ; - SF_INFO sfinfo ; - double seek_data [10] ; - - print_test_name ("ogg_double_test", filename) ; - - gen_windowed_sine_double (data_out.d, ARRAY_LEN (data_out.d), 0.95) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - /* Set up output file type. */ - sfinfo.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ; - sfinfo.channels = 1 ; - sfinfo.samplerate = SAMPLE_RATE ; - - /* Write the output file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - test_write_double_or_die (file, 0, data_out.d, ARRAY_LEN (data_out.d), __LINE__) ; - sf_close (file) ; - - /* Read the file in again. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - test_read_double_or_die (file, 0, data_in.d, ARRAY_LEN (data_in.d), __LINE__) ; - sf_close (file) ; - - puts ("ok") ; - - /* Test seeking. */ - print_test_name ("ogg_seek_test", filename) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - test_read_double_or_die (file, 0, seek_data, ARRAY_LEN (seek_data), __LINE__) ; - compare_double_or_die (seek_data, data_in.d + 10, ARRAY_LEN (seek_data), __LINE__) ; - - sf_close (file) ; - - puts ("ok") ; - - unlink (filename) ; -} /* ogg_double_test */ - - -static void -ogg_stereo_seek_test (const char * filename, int format) -{ static float data [SAMPLE_RATE] ; - static float stereo_out [SAMPLE_RATE * 2] ; - - SNDFILE * file ; - SF_INFO sfinfo ; - sf_count_t pos ; - unsigned k ; - - print_test_name (__func__, filename) ; - - gen_windowed_sine_float (data, ARRAY_LEN (data), 0.95) ; - for (k = 0 ; k < ARRAY_LEN (data) ; k++) - { stereo_out [2 * k] = data [k] ; - stereo_out [2 * k + 1] = data [ARRAY_LEN (data) - k - 1] ; - } ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - /* Set up output file type. */ - sfinfo.format = format ; - sfinfo.channels = 2 ; - sfinfo.samplerate = SAMPLE_RATE ; - - /* Write the output file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - test_write_float_or_die (file, 0, stereo_out, ARRAY_LEN (stereo_out), __LINE__) ; - sf_close (file) ; - - /* Open file in again for reading. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - /* Read in the whole file. */ - test_read_float_or_die (file, 0, stereo_out, ARRAY_LEN (stereo_out), __LINE__) ; - - /* Now hammer seeking code. */ - test_seek_or_die (file, 234, SEEK_SET, 234, sfinfo.channels, __LINE__) ; - test_readf_float_or_die (file, 0, data, 10, __LINE__) ; - compare_float_or_die (data, stereo_out + (234 * sfinfo.channels), 10, __LINE__) ; - - test_seek_or_die (file, 442, SEEK_SET, 442, sfinfo.channels, __LINE__) ; - test_readf_float_or_die (file, 0, data, 10, __LINE__) ; - compare_float_or_die (data, stereo_out + (442 * sfinfo.channels), 10, __LINE__) ; - - test_seek_or_die (file, 12, SEEK_CUR, 442 + 10 + 12, sfinfo.channels, __LINE__) ; - test_readf_float_or_die (file, 0, data, 10, __LINE__) ; - compare_float_or_die (data, stereo_out + ((442 + 10 + 12) * sfinfo.channels), 10, __LINE__) ; - - test_seek_or_die (file, 12, SEEK_CUR, 442 + 20 + 24, sfinfo.channels, __LINE__) ; - test_readf_float_or_die (file, 0, data, 10, __LINE__) ; - compare_float_or_die (data, stereo_out + ((442 + 20 + 24) * sfinfo.channels), 10, __LINE__) ; - - pos = 500 - sfinfo.frames ; - test_seek_or_die (file, pos, SEEK_END, 500, sfinfo.channels, __LINE__) ; - test_readf_float_or_die (file, 0, data, 10, __LINE__) ; - compare_float_or_die (data, stereo_out + (500 * sfinfo.channels), 10, __LINE__) ; - - pos = 10 - sfinfo.frames ; - test_seek_or_die (file, pos, SEEK_END, 10, sfinfo.channels, __LINE__) ; - test_readf_float_or_die (file, 0, data, 10, __LINE__) ; - compare_float_or_die (data, stereo_out + (10 * sfinfo.channels), 10, __LINE__) ; - - sf_close (file) ; - - puts ("ok") ; - unlink (filename) ; -} /* ogg_stereo_seek_test */ - - -int -main (void) -{ - if (HAVE_EXTERNAL_LIBS) - { ogg_short_test () ; - ogg_int_test () ; - ogg_float_test () ; - ogg_double_test () ; - - /*-ogg_stereo_seek_test ("pcm.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ;-*/ - ogg_stereo_seek_test ("vorbis_seek.ogg", SF_FORMAT_OGG | SF_FORMAT_VORBIS) ; - } - else - puts (" No Ogg/Vorbis tests because Ogg/Vorbis support was not compiled in.") ; - - return 0 ; -} /* main */ diff --git a/libs/libsndfile/tests/open_fail_test.c b/libs/libsndfile/tests/open_fail_test.c deleted file mode 100644 index 620f3bad25..0000000000 --- a/libs/libsndfile/tests/open_fail_test.c +++ /dev/null @@ -1,81 +0,0 @@ -/* -** Copyright (C) 2003,2004 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -int -main (void) -{ SNDFILE *sndfile ; - SF_INFO sfinfo ; - - FILE *bad_file ; - const char *bad_wav = "bad_wav.wav" ; - const char bad_data [] = "RIFF WAVEfmt " ; - - print_test_name ("open_fail_test", bad_wav) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - sndfile = sf_open ("let's hope this file doesn't exist", SFM_READ, &sfinfo) ; - - if (sndfile) - { printf ("Line %d: should not have received a valid SNDFILE* pointer.\n", __LINE__) ; - exit (1) ; - } ; - - if ((bad_file = fopen (bad_wav, "w")) == NULL) - { printf ("Line %d: fopen returned NULL.\n", __LINE__) ; - exit (1) ; - } ; - - fwrite (bad_data, sizeof (bad_data), 1, bad_file) ; - fclose (bad_file) ; - - sndfile = sf_open (bad_wav, SFM_READ, &sfinfo) ; - - if (sndfile) - { printf ("Line %d: should not have received a valid SNDFILE* pointer.\n", __LINE__) ; - exit (1) ; - } ; - - unlink (bad_wav) ; - puts ("ok") ; - - return 0 ; -} /* main */ - - -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 24440323-00b1-4e4b-87c5-0e3b7e9605e9 -*/ diff --git a/libs/libsndfile/tests/pcm_test.c b/libs/libsndfile/tests/pcm_test.c deleted file mode 100644 index 86511f65e4..0000000000 --- a/libs/libsndfile/tests/pcm_test.c +++ /dev/null @@ -1,1723 +0,0 @@ -/* -** Copyright (C) 1999-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_SIZE (1<<12) - -static void lrintf_test (void) ; - -static void pcm_test_bits_8 (const char *filename, int filetype, uint64_t hash) ; -static void pcm_test_bits_16 (const char *filename, int filetype, uint64_t hash) ; -static void pcm_test_bits_24 (const char *filename, int filetype, uint64_t hash) ; -static void pcm_test_bits_32 (const char *filename, int filetype, uint64_t hash) ; - -static void pcm_test_float (const char *filename, int filetype, uint64_t hash, int replace_float) ; -static void pcm_test_double (const char *filename, int filetype, uint64_t hash, int replace_float) ; - -typedef union -{ double d [BUFFER_SIZE + 1] ; - float f [BUFFER_SIZE + 1] ; - int i [BUFFER_SIZE + 1] ; - short s [BUFFER_SIZE + 1] ; -} BUFFER ; - -/* Data written to the file. */ -static BUFFER data_out ; - -/* Data read back from the file. */ -static BUFFER data_in ; - -int -main (void) -{ - lrintf_test () ; - - pcm_test_bits_8 ("pcm-s8.raw", SF_FORMAT_RAW | SF_FORMAT_PCM_S8, 0x1cda335091249dbfLL) ; - pcm_test_bits_8 ("pcm-u8.raw", SF_FORMAT_RAW | SF_FORMAT_PCM_U8, 0x7f748c433d695f3fLL) ; - - pcm_test_bits_16 ("le-pcm16.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_16, 0x3a2b956c881ebf08LL) ; - pcm_test_bits_16 ("be-pcm16.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_16, 0xd9e2f840c55750f8LL) ; - - pcm_test_bits_24 ("le-pcm24.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_24, 0x933b6a759ab496f8LL) ; - pcm_test_bits_24 ("be-pcm24.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_24, 0xbb1f3eaf9c30b6f8LL) ; - - pcm_test_bits_32 ("le-pcm32.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_32, 0xa77aece1c1c17f08LL) ; - pcm_test_bits_32 ("be-pcm32.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_32, 0x3099ddf142d0b0f8LL) ; - - /* Lite remove start */ - pcm_test_float ("le-float.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_FLOAT, 0x3c2ad04f7554267aLL, SF_FALSE) ; - pcm_test_float ("be-float.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_FLOAT, 0x074de3e248fa9186LL, SF_FALSE) ; - - pcm_test_double ("le-double.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, 0xc682726f958f669cLL, SF_FALSE) ; - pcm_test_double ("be-double.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, 0xd9a3583f8ee51164LL, SF_FALSE) ; - - pcm_test_float ("le-float.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_FLOAT, 0x3c2ad04f7554267aLL, SF_TRUE) ; - pcm_test_float ("be-float.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_FLOAT, 0x074de3e248fa9186LL, SF_TRUE) ; - - pcm_test_double ("le-double.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, 0xc682726f958f669cLL, SF_TRUE) ; - pcm_test_double ("be-double.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, 0xd9a3583f8ee51164LL, SF_TRUE) ; - /* Lite remove end */ - - return 0 ; -} /* main */ - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -lrintf_test (void) -{ int k, items ; - float *float_data ; - int *int_data ; - - print_test_name ("lrintf_test", "") ; - - items = 1024 ; - - float_data = data_out.f ; - int_data = data_in.i ; - - for (k = 0 ; k < items ; k++) - float_data [k] = (k * ((k % 2) ? 333333.0 : -333333.0)) ; - - for (k = 0 ; k < items ; k++) - int_data [k] = lrintf (float_data [k]) ; - - for (k = 0 ; k < items ; k++) - if (fabs (int_data [k] - float_data [k]) > 1.0) - { printf ("\n\nLine %d: float : Incorrect sample (#%d : %f => %d).\n", __LINE__, k, float_data [k], int_data [k]) ; - exit (1) ; - } ; - - printf ("ok\n") ; -} /* lrintf_test */ - -static void -pcm_test_bits_8 (const char *filename, int filetype, uint64_t hash) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, items, zero_count ; - short *short_out, *short_in ; - int *int_out, *int_in ; - /* Lite remove start */ - float *float_out, *float_in ; - double *double_out, *double_in ; - /* Lite remove end */ - - print_test_name ("pcm_test_bits_8", filename) ; - - items = 127 ; - - short_out = data_out.s ; - short_in = data_in.s ; - - zero_count = 0 ; - for (k = 0 ; k < items ; k++) - { short_out [k] = ((k * ((k % 2) ? 1 : -1)) << 8) ; - zero_count = short_out [k] ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros.\n", __LINE__) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_short_or_die (file, 0, short_out, items, __LINE__) ; - - sf_close (file) ; - - memset (short_in, 0, items * sizeof (short)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_short_or_die (file, 0, short_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (short_out [k] != short_in [k]) - { printf ("\n\nLine %d: Incorrect sample (#%d : 0x%x => 0x%x).\n", __LINE__, k, short_out [k], short_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Finally, check the file hash. */ - check_file_hash_or_die (filename, hash, __LINE__) ; - - /*-------------------------------------------------------------------------- - ** Test sf_read/write_int () - */ - zero_count = 0 ; - - int_out = data_out.i ; - int_in = data_in.i ; - for (k = 0 ; k < items ; k++) - { int_out [k] = ((k * ((k % 2) ? 1 : -1)) << 24) ; - zero_count = int_out [k] ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros.\n", __LINE__) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_int_or_die (file, 0, int_out, items, __LINE__) ; - - sf_close (file) ; - - memset (int_in, 0, items * sizeof (int)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_int_or_die (file, 0, int_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (int_out [k] != int_in [k]) - { printf ("\n\nLine %d: int : Incorrect sample (#%d : 0x%x => 0x%x).\n", __LINE__, k, int_out [k], int_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Lite remove start */ - /*-------------------------------------------------------------------------- - ** Test sf_read/write_float () - */ - zero_count = 0 ; - - float_out = data_out.f ; - float_in = data_in.f ; - for (k = 0 ; k < items ; k++) - { float_out [k] = (k * ((k % 2) ? 1 : -1)) ; - zero_count = (fabs (float_out [k]) > 1e-10) ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros (%d/%d).\n", __LINE__, zero_count, items) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - test_write_float_or_die (file, 0, float_out, items, __LINE__) ; - - sf_close (file) ; - - memset (float_in, 0, items * sizeof (float)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - test_read_float_or_die (file, 0, float_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (fabs (float_out [k] - float_in [k]) > 1e-10) - { printf ("\n\nLine %d: float : Incorrect sample (#%d : %f => %f).\n", __LINE__, k, (double) float_out [k], (double) float_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /*-------------------------------------------------------------------------- - ** Test sf_read/write_double () - */ - zero_count = 0 ; - - double_out = data_out.d ; - double_in = data_in.d ; - for (k = 0 ; k < items ; k++) - { double_out [k] = (k * ((k % 2) ? 1 : -1)) ; - zero_count = (fabs (double_out [k]) > 1e-10) ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros (%d/%d).\n", __LINE__, zero_count, items) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - test_write_double_or_die (file, 0, double_out, items, __LINE__) ; - - sf_close (file) ; - - memset (double_in, 0, items * sizeof (double)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - test_read_double_or_die (file, 0, double_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (fabs (double_out [k] - double_in [k]) > 1e-10) - { printf ("\n\nLine %d: double : Incorrect sample (#%d : %f => %f).\n", __LINE__, k, double_out [k], double_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - /* Lite remove end */ - unlink (filename) ; - - puts ("ok") ; -} /* pcm_test_bits_8 */ - -static void -pcm_test_bits_16 (const char *filename, int filetype, uint64_t hash) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, items, zero_count ; - short *short_out, *short_in ; - int *int_out, *int_in ; - /* Lite remove start */ - float *float_out, *float_in ; - double *double_out, *double_in ; - /* Lite remove end */ - - print_test_name ("pcm_test_bits_16", filename) ; - - items = 1024 ; - - short_out = data_out.s ; - short_in = data_in.s ; - - zero_count = 0 ; - for (k = 0 ; k < items ; k++) - { short_out [k] = (k * ((k % 2) ? 3 : -3)) ; - zero_count = short_out [k] ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros.\n", __LINE__) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_short_or_die (file, 0, short_out, items, __LINE__) ; - - sf_close (file) ; - - memset (short_in, 0, items * sizeof (short)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_short_or_die (file, 0, short_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (short_out [k] != short_in [k]) - { printf ("\n\nLine %d: Incorrect sample (#%d : 0x%x => 0x%x).\n", __LINE__, k, short_out [k], short_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Finally, check the file hash. */ - check_file_hash_or_die (filename, hash, __LINE__) ; - - /*-------------------------------------------------------------------------- - ** Test sf_read/write_int () - */ - zero_count = 0 ; - - int_out = data_out.i ; - int_in = data_in.i ; - for (k = 0 ; k < items ; k++) - { int_out [k] = ((k * ((k % 2) ? 3 : -3)) << 16) ; - zero_count = int_out [k] ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros.\n", __LINE__) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_int_or_die (file, 0, int_out, items, __LINE__) ; - - sf_close (file) ; - - memset (int_in, 0, items * sizeof (int)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_int_or_die (file, 0, int_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (int_out [k] != int_in [k]) - { printf ("\n\nLine %d: int : Incorrect sample (#%d : 0x%x => 0x%x).\n", __LINE__, k, int_out [k], int_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Lite remove start */ - /*-------------------------------------------------------------------------- - ** Test sf_read/write_float () - */ - zero_count = 0 ; - - float_out = data_out.f ; - float_in = data_in.f ; - for (k = 0 ; k < items ; k++) - { float_out [k] = (k * ((k % 2) ? 3 : -3)) ; - zero_count = (fabs (float_out [k]) > 1e-10) ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros (%d/%d).\n", __LINE__, zero_count, items) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - test_write_float_or_die (file, 0, float_out, items, __LINE__) ; - - sf_close (file) ; - - memset (float_in, 0, items * sizeof (float)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - test_read_float_or_die (file, 0, float_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (fabs (float_out [k] - float_in [k]) > 1e-10) - { printf ("\n\nLine %d: float : Incorrect sample (#%d : %f => %f).\n", __LINE__, k, (double) float_out [k], (double) float_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /*-------------------------------------------------------------------------- - ** Test sf_read/write_double () - */ - zero_count = 0 ; - - double_out = data_out.d ; - double_in = data_in.d ; - for (k = 0 ; k < items ; k++) - { double_out [k] = (k * ((k % 2) ? 3 : -3)) ; - zero_count = (fabs (double_out [k]) > 1e-10) ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros (%d/%d).\n", __LINE__, zero_count, items) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - test_write_double_or_die (file, 0, double_out, items, __LINE__) ; - - sf_close (file) ; - - memset (double_in, 0, items * sizeof (double)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - test_read_double_or_die (file, 0, double_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (fabs (double_out [k] - double_in [k]) > 1e-10) - { printf ("\n\nLine %d: double : Incorrect sample (#%d : %f => %f).\n", __LINE__, k, double_out [k], double_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - /* Lite remove end */ - unlink (filename) ; - - puts ("ok") ; -} /* pcm_test_bits_16 */ - -static void -pcm_test_bits_24 (const char *filename, int filetype, uint64_t hash) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, items, zero_count ; - short *short_out, *short_in ; - int *int_out, *int_in ; - /* Lite remove start */ - float *float_out, *float_in ; - double *double_out, *double_in ; - /* Lite remove end */ - - print_test_name ("pcm_test_bits_24", filename) ; - - items = 1024 ; - - short_out = data_out.s ; - short_in = data_in.s ; - - zero_count = 0 ; - for (k = 0 ; k < items ; k++) - { short_out [k] = (k * ((k % 2) ? 3 : -3)) ; - zero_count = short_out [k] ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros.\n", __LINE__) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_short_or_die (file, 0, short_out, items, __LINE__) ; - - sf_close (file) ; - - memset (short_in, 0, items * sizeof (short)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_short_or_die (file, 0, short_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (short_out [k] != short_in [k]) - { printf ("\n\nLine %d: Incorrect sample (#%d : 0x%x => 0x%x).\n", __LINE__, k, short_out [k], short_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Finally, check the file hash. */ - check_file_hash_or_die (filename, hash, __LINE__) ; - - /*-------------------------------------------------------------------------- - ** Test sf_read/write_int () - */ - zero_count = 0 ; - - int_out = data_out.i ; - int_in = data_in.i ; - for (k = 0 ; k < items ; k++) - { int_out [k] = ((k * ((k % 2) ? 3333 : -3333)) << 8) ; - zero_count = int_out [k] ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros.\n", __LINE__) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_int_or_die (file, 0, int_out, items, __LINE__) ; - - sf_close (file) ; - - memset (int_in, 0, items * sizeof (int)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_int_or_die (file, 0, int_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (int_out [k] != int_in [k]) - { printf ("\n\nLine %d: int : Incorrect sample (#%d : 0x%x => 0x%x).\n", __LINE__, k, int_out [k], int_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Lite remove start */ - /*-------------------------------------------------------------------------- - ** Test sf_read/write_float () - */ - zero_count = 0 ; - - float_out = data_out.f ; - float_in = data_in.f ; - for (k = 0 ; k < items ; k++) - { float_out [k] = (k * ((k % 2) ? 3333 : -3333)) ; - zero_count = (fabs (float_out [k]) > 1e-10) ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros (%d/%d).\n", __LINE__, zero_count, items) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - test_write_float_or_die (file, 0, float_out, items, __LINE__) ; - - sf_close (file) ; - - memset (float_in, 0, items * sizeof (float)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - test_read_float_or_die (file, 0, float_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (fabs (float_out [k] - float_in [k]) > 1e-10) - { printf ("\n\nLine %d: float : Incorrect sample (#%d : %f => %f).\n", __LINE__, k, (double) float_out [k], (double) float_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /*-------------------------------------------------------------------------- - ** Test sf_read/write_double () - */ - zero_count = 0 ; - - double_out = data_out.d ; - double_in = data_in.d ; - for (k = 0 ; k < items ; k++) - { double_out [k] = (k * ((k % 2) ? 3333 : -3333)) ; - zero_count = (fabs (double_out [k]) > 1e-10) ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros (%d/%d).\n", __LINE__, zero_count, items) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - test_write_double_or_die (file, 0, double_out, items, __LINE__) ; - - sf_close (file) ; - - memset (double_in, 0, items * sizeof (double)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - test_read_double_or_die (file, 0, double_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (fabs (double_out [k] - double_in [k]) > 1e-10) - { printf ("\n\nLine %d: double : Incorrect sample (#%d : %f => %f).\n", __LINE__, k, double_out [k], double_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - /* Lite remove end */ - unlink (filename) ; - - puts ("ok") ; -} /* pcm_test_bits_24 */ - -static void -pcm_test_bits_32 (const char *filename, int filetype, uint64_t hash) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, items, zero_count ; - short *short_out, *short_in ; - int *int_out, *int_in ; - /* Lite remove start */ - float *float_out, *float_in ; - double *double_out, *double_in ; - /* Lite remove end */ - - print_test_name ("pcm_test_bits_32", filename) ; - - items = 1024 ; - - short_out = data_out.s ; - short_in = data_in.s ; - - zero_count = 0 ; - for (k = 0 ; k < items ; k++) - { short_out [k] = (k * ((k % 2) ? 3 : -3)) ; - zero_count = short_out [k] ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros.\n", __LINE__) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_short_or_die (file, 0, short_out, items, __LINE__) ; - - sf_close (file) ; - - memset (short_in, 0, items * sizeof (short)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_short_or_die (file, 0, short_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (short_out [k] != short_in [k]) - { printf ("\n\nLine %d: Incorrect sample (#%d : 0x%x => 0x%x).\n", __LINE__, k, short_out [k], short_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Finally, check the file hash. */ - check_file_hash_or_die (filename, hash, __LINE__) ; - - /*-------------------------------------------------------------------------- - ** Test sf_read/write_int () - */ - zero_count = 0 ; - - int_out = data_out.i ; - int_in = data_in.i ; - for (k = 0 ; k < items ; k++) - { int_out [k] = (k * ((k % 2) ? 333333 : -333333)) ; - zero_count = int_out [k] ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros.\n", __LINE__) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_int_or_die (file, 0, int_out, items, __LINE__) ; - - sf_close (file) ; - - memset (int_in, 0, items * sizeof (int)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_int_or_die (file, 0, int_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (int_out [k] != int_in [k]) - { printf ("\n\nLine %d: int : Incorrect sample (#%d : 0x%x => 0x%x).\n", __LINE__, k, int_out [k], int_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Lite remove start */ - /*-------------------------------------------------------------------------- - ** Test sf_read/write_float () - */ - zero_count = 0 ; - - float_out = data_out.f ; - float_in = data_in.f ; - for (k = 0 ; k < items ; k++) - { float_out [k] = (k * ((k % 2) ? 333333 : -333333)) ; - zero_count = (fabs (float_out [k]) > 1e-10) ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros (%d/%d).\n", __LINE__, zero_count, items) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - test_write_float_or_die (file, 0, float_out, items, __LINE__) ; - - sf_close (file) ; - - memset (float_in, 0, items * sizeof (float)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - test_read_float_or_die (file, 0, float_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (fabs (float_out [k] - float_in [k]) > 1e-10) - { printf ("\n\nLine %d: float : Incorrect sample (#%d : %f => %f).\n", __LINE__, k, (double) float_out [k], (double) float_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /*-------------------------------------------------------------------------- - ** Test sf_read/write_double () - */ - zero_count = 0 ; - - double_out = data_out.d ; - double_in = data_in.d ; - for (k = 0 ; k < items ; k++) - { double_out [k] = (k * ((k % 2) ? 333333 : -333333)) ; - zero_count = (fabs (double_out [k]) > 1e-10) ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros (%d/%d).\n", __LINE__, zero_count, items) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - test_write_double_or_die (file, 0, double_out, items, __LINE__) ; - - sf_close (file) ; - - memset (double_in, 0, items * sizeof (double)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - test_read_double_or_die (file, 0, double_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (fabs (double_out [k] - double_in [k]) > 1e-10) - { printf ("\n\nLine %d: double : Incorrect sample (#%d : %f => %f).\n", __LINE__, k, double_out [k], double_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - /* Lite remove end */ - unlink (filename) ; - - puts ("ok") ; -} /* pcm_test_bits_32 */ - - - -/*============================================================================== -*/ - -static void -pcm_test_float (const char *filename, int filetype, uint64_t hash, int replace_float) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, items, frames ; - int sign ; - double *data, error ; - - print_test_name (replace_float ? "pcm_test_float (replace)" : "pcm_test_float", filename) ; - - items = BUFFER_SIZE ; - - data = data_out.d ; - for (sign = 1, k = 0 ; k < items ; k++) - { data [k] = ((double) (k * sign)) / 100.0 ; - sign = (sign > 0) ? -1 : 1 ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = items ; - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - test_write_double_or_die (file, 0, data, items, __LINE__) ; - - sf_close (file) ; - - check_file_hash_or_die (filename, hash, __LINE__) ; - - memset (data, 0, items * sizeof (double)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - if (sfinfo.format != filetype) - { printf ("\n\nError (%s:%d) Mono : Returned format incorrect (0x%08X => 0x%08X).\n", __FILE__, __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nError (%s:%d) Mono : Incorrect number of frames in file. (%d => %ld)\n", __FILE__, __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nError (%s:%d) Mono : Incorrect number of channels in file.\n", __FILE__, __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, data, items, __LINE__) ; - - for (sign = -1, k = 0 ; k < items ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 6, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - /* Now test Stereo. */ - - if ((filetype & SF_FORMAT_TYPEMASK) == SF_FORMAT_SVX) /* SVX is mono only */ - { printf ("ok\n") ; - return ; - } ; - - items = BUFFER_SIZE ; - - data = data_out.d ; - for (sign = -1, k = 0 ; k < items ; k++) - data [k] = ((double) k) / 100.0 * (sign *= -1) ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = items ; - sfinfo.channels = 2 ; - sfinfo.format = filetype ; - - frames = items / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - test_writef_double_or_die (file, 0, data, frames, __LINE__) ; - - sf_close (file) ; - - check_file_hash_or_die (filename, hash, __LINE__) ; - - memset (data, 0, items * sizeof (double)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - if (sfinfo.format != filetype) - { printf ("\n\nError (%s:%d) Stereo : Returned format incorrect (0x%08X => 0x%08X).\n", __FILE__, __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != frames) - { printf ("\n\nError (%s:%d) Stereo : Incorrect number of frames in file. (%d => %ld)\n", __FILE__, __LINE__, frames, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 2) - { printf ("\n\nError (%s:%d) Stereo : Incorrect number of channels in file.\n", __FILE__, __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_double_or_die (file, 0, data, frames, __LINE__) ; - for (sign = -1, k = 0 ; k < items ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data + 20, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 8, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data + 40, 2, __LINE__) ; - for (k = 40 ; k < 44 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data + 20, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - printf ("ok\n") ; - unlink (filename) ; -} /* pcm_test_float */ - -static void -pcm_test_double (const char *filename, int filetype, uint64_t hash, int replace_float) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, items, frames ; - int sign ; - double *data, error ; - - /* This is the best test routine. Other should be brought up to this standard. */ - - print_test_name (replace_float ? "pcm_test_double (replace)" : "pcm_test_double", filename) ; - - items = BUFFER_SIZE ; - - data = data_out.d ; - for (sign = 1, k = 0 ; k < items ; k++) - { data [k] = ((double) (k * sign)) / 100.0 ; - sign = (sign > 0) ? -1 : 1 ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = items ; - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - test_write_double_or_die (file, 0, data, items, __LINE__) ; - - sf_close (file) ; - -#if (defined (WIN32) || defined (_WIN32)) - /* File hashing on Win32 fails due to slighty different - ** calculated values of the sin() function. - */ - hash = hash ; /* Avoid compiler warning. */ -#else - check_file_hash_or_die (filename, hash, __LINE__) ; -#endif - - memset (data, 0, items * sizeof (double)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - if (sfinfo.format != filetype) - { printf ("\n\nError (%s:%d) Mono : Returned format incorrect (0x%08X => 0x%08X).\n", __FILE__, __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nError (%s:%d) Mono : Incorrect number of frames in file. (%d => %ld)\n", __FILE__, __LINE__, items, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nError (%s:%d) Mono : Incorrect number of channels in file.\n", __FILE__, __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, data, items, __LINE__) ; - - for (sign = -1, k = 0 ; k < items ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 10, 4, __LINE__) ; - - test_seek_or_die (file, 0, SEEK_CUR, 14, sfinfo.channels, __LINE__) ; - - for (k = 10 ; k < 14 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 6, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - /* Now test Stereo. */ - - if ((filetype & SF_FORMAT_TYPEMASK) == SF_FORMAT_SVX) /* SVX is mono only */ - { printf ("ok\n") ; - return ; - } ; - - items = BUFFER_SIZE ; - - data = data_out.d ; - for (sign = -1, k = 0 ; k < items ; k++) - data [k] = ((double) k) / 100.0 * (sign *= -1) ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = items ; - sfinfo.channels = 2 ; - sfinfo.format = filetype ; - - frames = items / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - test_writef_double_or_die (file, 0, data, frames, __LINE__) ; - - sf_close (file) ; - -#if (defined (WIN32) || defined (_WIN32)) - /* File hashing on Win32 fails due to slighty different - ** calculated values. - */ - hash = hash ; /* Avoid compiler warning. */ -#else - check_file_hash_or_die (filename, hash, __LINE__) ; -#endif - - memset (data, 0, items * sizeof (double)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - if (sfinfo.format != filetype) - { printf ("\n\nError (%s:%d) Stereo : Returned format incorrect (0x%08X => 0x%08X).\n", __FILE__, __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != frames) - { printf ("\n\nError (%s:%d) Stereo : Incorrect number of frames in file. (%d => %ld)\n", __FILE__, __LINE__, frames, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 2) - { printf ("\n\nError (%s:%d) Stereo : Incorrect number of channels in file.\n", __FILE__, __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_double_or_die (file, 0, data, frames, __LINE__) ; - - for (sign = -1, k = 0 ; k < items ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 10, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 8, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data + 40, 4, __LINE__) ; - for (k = 40 ; k < 44 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames -10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - printf ("ok\n") ; - unlink (filename) ; -} /* pcm_test_double */ - -/*============================================================================== -*/ diff --git a/libs/libsndfile/tests/pcm_test.def b/libs/libsndfile/tests/pcm_test.def deleted file mode 100644 index b81f05943b..0000000000 --- a/libs/libsndfile/tests/pcm_test.def +++ /dev/null @@ -1,34 +0,0 @@ -autogen definitions pcm_test.tpl; - -data_type = { - name = "bits_8" ; - item_count = 127 ; - short_func = "((k * ((k % 2) ? 1 : -1)) << 8)" ; - int_func = "((k * ((k % 2) ? 1 : -1)) << 24)" ; - float_func = "(k * ((k % 2) ? 1 : -1))" ; - } ; - -data_type = { - name = "bits_16" ; - item_count = 1024 ; - short_func = "(k * ((k % 2) ? 3 : -3))" ; - int_func = "((k * ((k % 2) ? 3 : -3)) << 16)" ; - float_func = "(k * ((k % 2) ? 3 : -3))" ; - } ; - -data_type = { - name = "bits_24" ; - item_count = 1024 ; - short_func = "(k * ((k % 2) ? 3 : -3))" ; - int_func = "((k * ((k % 2) ? 3333 : -3333)) << 8)" ; - float_func = "(k * ((k % 2) ? 3333 : -3333))" ; - } ; - -data_type = { - name = "bits_32" ; - item_count = 1024 ; - short_func = "(k * ((k % 2) ? 3 : -3))" ; - int_func = "(k * ((k % 2) ? 333333 : -333333))" ; - float_func = "(k * ((k % 2) ? 333333 : -333333))" ; - } ; - diff --git a/libs/libsndfile/tests/pcm_test.tpl b/libs/libsndfile/tests/pcm_test.tpl deleted file mode 100644 index 459e741d0a..0000000000 --- a/libs/libsndfile/tests/pcm_test.tpl +++ /dev/null @@ -1,931 +0,0 @@ -[+ AutoGen5 template c +] -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_SIZE (1 << 12) - -static void lrintf_test (void) ; - -[+ FOR data_type -+]static void pcm_test_[+ (get "name") +] (const char *filename, int filetype, uint64_t hash) ; -[+ ENDFOR data_type -+] -static void pcm_test_float (const char *filename, int filetype, uint64_t hash, int replace_float) ; -static void pcm_test_double (const char *filename, int filetype, uint64_t hash, int replace_float) ; - -typedef union -{ double d [BUFFER_SIZE + 1] ; - float f [BUFFER_SIZE + 1] ; - int i [BUFFER_SIZE + 1] ; - short s [BUFFER_SIZE + 1] ; -} BUFFER ; - -/* Data written to the file. */ -static BUFFER data_out ; - -/* Data read back from the file. */ -static BUFFER data_in ; - -int -main (void) -{ - lrintf_test () ; - - pcm_test_bits_8 ("pcm-s8.raw", SF_FORMAT_RAW | SF_FORMAT_PCM_S8, 0x1cda335091249dbfLL) ; - pcm_test_bits_8 ("pcm-u8.raw", SF_FORMAT_RAW | SF_FORMAT_PCM_U8, 0x7f748c433d695f3fLL) ; - - pcm_test_bits_16 ("le-pcm16.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_16, 0x3a2b956c881ebf08LL) ; - pcm_test_bits_16 ("be-pcm16.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_16, 0xd9e2f840c55750f8LL) ; - - pcm_test_bits_24 ("le-pcm24.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_24, 0x933b6a759ab496f8LL) ; - pcm_test_bits_24 ("be-pcm24.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_24, 0xbb1f3eaf9c30b6f8LL) ; - - pcm_test_bits_32 ("le-pcm32.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_32, 0xa77aece1c1c17f08LL) ; - pcm_test_bits_32 ("be-pcm32.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_32, 0x3099ddf142d0b0f8LL) ; - - /* Lite remove start */ - pcm_test_float ("le-float.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_FLOAT, 0x3c2ad04f7554267aLL, SF_FALSE) ; - pcm_test_float ("be-float.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_FLOAT, 0x074de3e248fa9186LL, SF_FALSE) ; - - pcm_test_double ("le-double.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, 0xc682726f958f669cLL, SF_FALSE) ; - pcm_test_double ("be-double.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, 0xd9a3583f8ee51164LL, SF_FALSE) ; - - pcm_test_float ("le-float.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_FLOAT, 0x3c2ad04f7554267aLL, SF_TRUE) ; - pcm_test_float ("be-float.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_FLOAT, 0x074de3e248fa9186LL, SF_TRUE) ; - - pcm_test_double ("le-double.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, 0xc682726f958f669cLL, SF_TRUE) ; - pcm_test_double ("be-double.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, 0xd9a3583f8ee51164LL, SF_TRUE) ; - /* Lite remove end */ - - return 0 ; -} /* main */ - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -lrintf_test (void) -{ int k, items ; - float *float_data ; - int *int_data ; - - print_test_name ("lrintf_test", "") ; - - items = 1024 ; - - float_data = data_out.f ; - int_data = data_in.i ; - - for (k = 0 ; k < items ; k++) - float_data [k] = (k * ((k % 2) ? 333333.0 : -333333.0)) ; - - for (k = 0 ; k < items ; k++) - int_data [k] = lrintf (float_data [k]) ; - - for (k = 0 ; k < items ; k++) - if (fabs (int_data [k] - float_data [k]) > 1.0) - { printf ("\n\nLine %d: float : Incorrect sample (#%d : %f => %d).\n", __LINE__, k, float_data [k], int_data [k]) ; - exit (1) ; - } ; - - printf ("ok\n") ; -} /* lrintf_test */ - -[+ FOR data_type -+]static void -pcm_test_[+ (get "name") +] (const char *filename, int filetype, uint64_t hash) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, items, zero_count ; - short *short_out, *short_in ; - int *int_out, *int_in ; - /* Lite remove start */ - float *float_out, *float_in ; - double *double_out, *double_in ; - /* Lite remove end */ - - print_test_name ("pcm_test_[+ (get "name") +]", filename) ; - - items = [+ (get "item_count") +] ; - - short_out = data_out.s ; - short_in = data_in.s ; - - zero_count = 0 ; - for (k = 0 ; k < items ; k++) - { short_out [k] = [+ (get "short_func") +] ; - zero_count = short_out [k] ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros.\n", __LINE__) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_short_or_die (file, 0, short_out, items, __LINE__) ; - - sf_close (file) ; - - memset (short_in, 0, items * sizeof (short)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %" PRId64 ")\n", __LINE__, items, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_short_or_die (file, 0, short_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (short_out [k] != short_in [k]) - { printf ("\n\nLine %d: Incorrect sample (#%d : 0x%x => 0x%x).\n", __LINE__, k, short_out [k], short_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Finally, check the file hash. */ - check_file_hash_or_die (filename, hash, __LINE__) ; - - /*-------------------------------------------------------------------------- - ** Test sf_read/write_int () - */ - zero_count = 0 ; - - int_out = data_out.i ; - int_in = data_in.i ; - for (k = 0 ; k < items ; k++) - { int_out [k] = [+ (get "int_func") +] ; - zero_count = int_out [k] ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros.\n", __LINE__) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_int_or_die (file, 0, int_out, items, __LINE__) ; - - sf_close (file) ; - - memset (int_in, 0, items * sizeof (int)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %" PRId64 ")\n", __LINE__, items, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_int_or_die (file, 0, int_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (int_out [k] != int_in [k]) - { printf ("\n\nLine %d: int : Incorrect sample (#%d : 0x%x => 0x%x).\n", __LINE__, k, int_out [k], int_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Lite remove start */ - /*-------------------------------------------------------------------------- - ** Test sf_read/write_float () - */ - zero_count = 0 ; - - float_out = data_out.f ; - float_in = data_in.f ; - for (k = 0 ; k < items ; k++) - { float_out [k] = [+ (get "float_func") +] ; - zero_count = (fabs (float_out [k]) > 1e-10) ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros (%d/%d).\n", __LINE__, zero_count, items) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - test_write_float_or_die (file, 0, float_out, items, __LINE__) ; - - sf_close (file) ; - - memset (float_in, 0, items * sizeof (float)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %" PRId64 ")\n", __LINE__, items, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - - test_read_float_or_die (file, 0, float_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (fabs (float_out [k] - float_in [k]) > 1e-10) - { printf ("\n\nLine %d: float : Incorrect sample (#%d : %f => %f).\n", __LINE__, k, (double) float_out [k], (double) float_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - - /*-------------------------------------------------------------------------- - ** Test sf_read/write_double () - */ - zero_count = 0 ; - - double_out = data_out.d ; - double_in = data_in.d ; - for (k = 0 ; k < items ; k++) - { double_out [k] = [+ (get "float_func") +] ; - zero_count = (fabs (double_out [k]) > 1e-10) ? zero_count : zero_count + 1 ; - } ; - - if (zero_count > items / 4) - { printf ("\n\nLine %d: too many zeros (%d/%d).\n", __LINE__, zero_count, items) ; - exit (1) ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - test_write_double_or_die (file, 0, double_out, items, __LINE__) ; - - sf_close (file) ; - - memset (double_in, 0, items * sizeof (double)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %" PRId64 ")\n", __LINE__, items, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - - test_read_double_or_die (file, 0, double_in, items, __LINE__) ; - - for (k = 0 ; k < items ; k++) - if (fabs (double_out [k] - double_in [k]) > 1e-10) - { printf ("\n\nLine %d: double : Incorrect sample (#%d : %f => %f).\n", __LINE__, k, double_out [k], double_in [k]) ; - exit (1) ; - } ; - - sf_close (file) ; - /* Lite remove end */ - unlink (filename) ; - - puts ("ok") ; -} /* pcm_test_[+ (get "name") +] */ - -[+ ENDFOR data_type -+] - -/*============================================================================== -*/ - -static void -pcm_test_float (const char *filename, int filetype, uint64_t hash, int replace_float) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, items, frames ; - int sign ; - double *data, error ; - - print_test_name (replace_float ? "pcm_test_float (replace)" : "pcm_test_float", filename) ; - - items = BUFFER_SIZE ; - - data = data_out.d ; - for (sign = 1, k = 0 ; k < items ; k++) - { data [k] = ((double) (k * sign)) / 100.0 ; - sign = (sign > 0) ? -1 : 1 ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = items ; - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - test_write_double_or_die (file, 0, data, items, __LINE__) ; - - sf_close (file) ; - - check_file_hash_or_die (filename, hash, __LINE__) ; - - memset (data, 0, items * sizeof (double)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - if (sfinfo.format != filetype) - { printf ("\n\nError (%s:%d) Mono : Returned format incorrect (0x%08X => 0x%08X).\n", __FILE__, __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nError (%s:%d) Mono : Incorrect number of frames in file. (%d => %" PRId64 ")\n", __FILE__, __LINE__, items, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nError (%s:%d) Mono : Incorrect number of channels in file.\n", __FILE__, __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, data, items, __LINE__) ; - - for (sign = -1, k = 0 ; k < items ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to end of file. */ - test_seek_or_die (file, 0, SEEK_END, sfinfo.frames, sfinfo.channels, __LINE__) ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 6, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - /* Now test Stereo. */ - - if ((filetype & SF_FORMAT_TYPEMASK) == SF_FORMAT_SVX) /* SVX is mono only */ - { printf ("ok\n") ; - return ; - } ; - - items = BUFFER_SIZE ; - - data = data_out.d ; - for (sign = -1, k = 0 ; k < items ; k++) - data [k] = ((double) k) / 100.0 * (sign *= -1) ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = items ; - sfinfo.channels = 2 ; - sfinfo.format = filetype ; - - frames = items / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - test_writef_double_or_die (file, 0, data, frames, __LINE__) ; - - sf_close (file) ; - - check_file_hash_or_die (filename, hash, __LINE__) ; - - memset (data, 0, items * sizeof (double)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - if (sfinfo.format != filetype) - { printf ("\n\nError (%s:%d) Stereo : Returned format incorrect (0x%08X => 0x%08X).\n", __FILE__, __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != frames) - { printf ("\n\nError (%s:%d) Stereo : Incorrect number of frames in file. (%d => %" PRId64 ")\n", __FILE__, __LINE__, frames, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 2) - { printf ("\n\nError (%s:%d) Stereo : Incorrect number of channels in file.\n", __FILE__, __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_double_or_die (file, 0, data, frames, __LINE__) ; - for (sign = -1, k = 0 ; k < items ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data + 20, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 8, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data + 40, 2, __LINE__) ; - for (k = 40 ; k < 44 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data + 20, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - printf ("ok\n") ; - unlink (filename) ; -} /* pcm_test_float */ - -static void -pcm_test_double (const char *filename, int filetype, uint64_t hash, int replace_float) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, items, frames ; - int sign ; - double *data, error ; - - /* This is the best test routine. Other should be brought up to this standard. */ - - print_test_name (replace_float ? "pcm_test_double (replace)" : "pcm_test_double", filename) ; - - items = BUFFER_SIZE ; - - data = data_out.d ; - for (sign = 1, k = 0 ; k < items ; k++) - { data [k] = ((double) (k * sign)) / 100.0 ; - sign = (sign > 0) ? -1 : 1 ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = items ; - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - test_write_double_or_die (file, 0, data, items, __LINE__) ; - - sf_close (file) ; - -#if (defined (WIN32) || defined (_WIN32)) - /* File hashing on Win32 fails due to slighty different - ** calculated values of the sin() function. - */ - hash = hash ; /* Avoid compiler warning. */ -#else - check_file_hash_or_die (filename, hash, __LINE__) ; -#endif - - memset (data, 0, items * sizeof (double)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - if (sfinfo.format != filetype) - { printf ("\n\nError (%s:%d) Mono : Returned format incorrect (0x%08X => 0x%08X).\n", __FILE__, __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != items) - { printf ("\n\nError (%s:%d) Mono : Incorrect number of frames in file. (%d => %" PRId64 ")\n", __FILE__, __LINE__, items, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nError (%s:%d) Mono : Incorrect number of channels in file.\n", __FILE__, __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, data, items, __LINE__) ; - - for (sign = -1, k = 0 ; k < items ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 10, 4, __LINE__) ; - - test_seek_or_die (file, 0, SEEK_CUR, 14, sfinfo.channels, __LINE__) ; - - for (k = 10 ; k < 14 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 6, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Mono : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - /* Now test Stereo. */ - - if ((filetype & SF_FORMAT_TYPEMASK) == SF_FORMAT_SVX) /* SVX is mono only */ - { printf ("ok\n") ; - return ; - } ; - - items = BUFFER_SIZE ; - - data = data_out.d ; - for (sign = -1, k = 0 ; k < items ; k++) - data [k] = ((double) k) / 100.0 * (sign *= -1) ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = items ; - sfinfo.channels = 2 ; - sfinfo.format = filetype ; - - frames = items / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - test_writef_double_or_die (file, 0, data, frames, __LINE__) ; - - sf_close (file) ; - -#if (defined (WIN32) || defined (_WIN32)) - /* File hashing on Win32 fails due to slighty different - ** calculated values. - */ - hash = hash ; /* Avoid compiler warning. */ -#else - check_file_hash_or_die (filename, hash, __LINE__) ; -#endif - - memset (data, 0, items * sizeof (double)) ; - - if ((filetype & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_TEST_IEEE_FLOAT_REPLACE, NULL, replace_float) ; - if (replace_float && string_in_log_buffer (file, "Using IEEE replacement") == 0) - { printf ("\n\nLine %d : Float replacement code not working.\n\n", __LINE__) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - if (sfinfo.format != filetype) - { printf ("\n\nError (%s:%d) Stereo : Returned format incorrect (0x%08X => 0x%08X).\n", __FILE__, __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != frames) - { printf ("\n\nError (%s:%d) Stereo : Incorrect number of frames in file. (%d => %" PRId64 ")\n", __FILE__, __LINE__, frames, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 2) - { printf ("\n\nError (%s:%d) Stereo : Incorrect number of channels in file.\n", __FILE__, __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_double_or_die (file, 0, data, frames, __LINE__) ; - - for (sign = -1, k = 0 ; k < items ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, data + 10, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 8, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data + 40, 4, __LINE__) ; - for (k = 40 ; k < 44 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames -10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, data + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - { error = fabs (data [k] - ((double) k) / 100.0 * (sign *= -1)) ; - if (fabs (data [k]) > 1e-100 && fabs (error / data [k]) > 1e-5) - { printf ("\n\nError (%s:%d) Stereo : Incorrect sample (#%d : %f => %f).\n", __FILE__, __LINE__, k, ((double) k) / 100.0, data [k]) ; - exit (1) ; - } ; - } ; - - sf_close (file) ; - - printf ("ok\n") ; - unlink (filename) ; -} /* pcm_test_double */ - -/*============================================================================== -*/ diff --git a/libs/libsndfile/tests/peak_chunk_test.c b/libs/libsndfile/tests/peak_chunk_test.c deleted file mode 100644 index 9e5332a1e4..0000000000 --- a/libs/libsndfile/tests/peak_chunk_test.c +++ /dev/null @@ -1,362 +0,0 @@ -/* -** Copyright (C) 2001-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_LEN (1 << 15) -#define LOG_BUFFER_SIZE 1024 - - -static void test_float_peak (const char *filename, int filetype) ; -static void read_write_peak_test (const char *filename, int filetype) ; - -static void check_logged_peaks (char *buffer) ; - -/* Force the start of this buffer to be double aligned. Sparc-solaris will -** choke if its not. -*/ -static double data [BUFFER_LEN] ; -static char log_buffer [LOG_BUFFER_SIZE] ; - -int -main (int argc, char *argv []) -{ int do_all = 0 ; - int test_count = 0 ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" aiff - test AIFF file PEAK chunk\n") ; - printf (" caf - test CAF file PEAK chunk\n") ; - printf (" wav - test WAV file peak chunk\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all = ! strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "wav")) - { test_float_peak ("peak_float.wav", SF_FORMAT_WAV | SF_FORMAT_FLOAT) ; - test_float_peak ("peak_float.wavex", SF_FORMAT_WAVEX | SF_FORMAT_FLOAT) ; - test_float_peak ("peak_float.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_FLOAT) ; - - read_write_peak_test ("rw_peak.wav", SF_FORMAT_WAV | SF_FORMAT_FLOAT) ; - read_write_peak_test ("rw_peak.wavex", SF_FORMAT_WAVEX | SF_FORMAT_FLOAT) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { test_float_peak ("peak_float.aiff", SF_FORMAT_AIFF | SF_FORMAT_FLOAT) ; - - read_write_peak_test ("rw_peak.aiff", SF_FORMAT_AIFF | SF_FORMAT_FLOAT) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "caf")) - { test_float_peak ("peak_float.caf", SF_FORMAT_CAF | SF_FORMAT_FLOAT) ; - - read_write_peak_test ("rw_peak.caf", SF_FORMAT_CAF | SF_FORMAT_FLOAT) ; - test_count++ ; - } ; - - if (test_count == 0) - { printf ("Mono : ************************************\n") ; - printf ("Mono : * No '%s' test defined.\n", argv [1]) ; - printf ("Mono : ************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -test_float_peak (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, frames, count ; - - print_test_name ("test_float_peak", filename) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.format = filetype ; - sfinfo.channels = 4 ; - sfinfo.frames = 0 ; - - frames = BUFFER_LEN / sfinfo.channels ; - - /* Create some random data with a peak value of 0.66. */ - for (k = 0 ; k < BUFFER_LEN ; k++) - data [k] = (rand () % 2000) / 3000.0 ; - - /* Insert some larger peaks a know locations. */ - data [4 * (frames / 8) + 0] = (frames / 8) * 0.01 ; /* First channel */ - data [4 * (frames / 6) + 1] = (frames / 6) * 0.01 ; /* Second channel */ - data [4 * (frames / 4) + 2] = (frames / 4) * 0.01 ; /* Third channel */ - data [4 * (frames / 2) + 3] = (frames / 2) * 0.01 ; /* Fourth channel */ - - /* Write a file with PEAK chunks. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, 0, __LINE__) ; - - /* Try to confuse the header writer by adding a removing the PEAK chunk. */ - sf_command (file, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_TRUE) ; - sf_command (file, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ; - sf_command (file, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_TRUE) ; - - /* Write the data in four passed. The data is designed so that peaks will - ** be written in the different calls to sf_write_double (). - */ - for (count = 0 ; count < 4 ; count ++) - test_write_double_or_die (file, 0, data + count * BUFFER_LEN / 4, BUFFER_LEN / 4, BUFFER_LEN / 4) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, 0, __LINE__) ; - - if (sfinfo.format != filetype) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != frames) - { printf ("\n\nLine %d: Incorrect number of frames in file. (%d => %ld)\n", __LINE__, frames, (long) sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 4) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - /* Check these two commands. */ - if (sf_command (file, SFC_GET_SIGNAL_MAX, data, sizeof (double)) == SF_FALSE) - { printf ("\n\nLine %d: Command should have returned SF_TRUE.\n", __LINE__) ; - exit (1) ; - } ; - - if (fabs (data [0] - (frames / 2) * 0.01) > 0.01) - { printf ("\n\nLine %d: Bad peak value (%f should be %f) for command SFC_GET_SIGNAL_MAX.\n", __LINE__, data [0], (frames / 2) * 0.01) ; - exit (1) ; - } ; - - if (sf_command (file, SFC_GET_MAX_ALL_CHANNELS, data, sizeof (double) * sfinfo.channels) == SF_FALSE) - { printf ("\n\nLine %d: Command should have returned SF_TRUE.\n", __LINE__) ; - exit (1) ; - } ; - - if (fabs (data [3] - (frames / 2) * 0.01) > 0.01) - { printf ("\n\nLine %d: Bad peak value (%f should be %f) for command SFC_GET_MAX_ALL_CHANNELS.\n", __LINE__, data [0], (frames / 2) * 0.01) ; - exit (1) ; - } ; - - /* Get the log buffer data. */ - log_buffer [0] = 0 ; - sf_command (file, SFC_GET_LOG_INFO, log_buffer, LOG_BUFFER_SIZE) ; - - if (strlen (log_buffer) == 0) - { printf ("\n\nLine %d: Empty log buffer,\n", __LINE__) ; - exit (1) ; - } ; - - check_logged_peaks (log_buffer) ; - - sf_close (file) ; - - /* Write a file ***without*** PEAK chunks. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, 0, __LINE__) ; - - /* Try to confuse the header writer by adding a removing the PEAK chunk. */ - sf_command (file, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ; - sf_command (file, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_TRUE) ; - sf_command (file, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ; - - /* Write the data in four passed. The data is designed so that peaks will - ** be written in the different calls to sf_write_double (). - */ - for (count = 0 ; count < 4 ; count ++) - test_write_double_or_die (file, 0, data + count * BUFFER_LEN / 4, BUFFER_LEN / 4, BUFFER_LEN / 4) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, 0, __LINE__) ; - - /* Check these two commands. */ - if (sf_command (file, SFC_GET_SIGNAL_MAX, data, sizeof (double))) - { printf ("\n\nLine %d: Command should have returned SF_FALSE.\n", __LINE__) ; - exit (1) ; - } ; - - if (sf_command (file, SFC_GET_MAX_ALL_CHANNELS, data, sizeof (double) * sfinfo.channels)) - { printf ("\n\nLine %d: Command should have returned SF_FALSE.\n", __LINE__) ; - exit (1) ; - } ; - - /* Get the log buffer data. */ - log_buffer [0] = 0 ; - sf_command (file, SFC_GET_LOG_INFO, log_buffer, LOG_BUFFER_SIZE) ; - - if (strlen (log_buffer) == 0) - { printf ("\n\nLine %d: Empty log buffer,\n", __LINE__) ; - exit (1) ; - } ; - - if (strstr (log_buffer, "PEAK :") != NULL) - { printf ("\n\nLine %d: Should not have a PEAK chunk in this file.\n\n", __LINE__) ; - puts (log_buffer) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - printf ("ok\n") ; -} /* test_float_peak */ - -static void -check_logged_peaks (char *buffer) -{ char *cptr ; - int k, chan, channel_count, position ; - float value ; - - if (strstr (buffer, "should") || strstr (buffer, "*")) - { printf ("\n\nLine %d: Something wrong in buffer. Dumping.\n", __LINE__) ; - puts (buffer) ; - exit (1) ; - } ; - - channel_count = 0 ; - cptr = strstr (buffer, "Channels") ; - if (cptr && sscanf (cptr, "Channels : %d", &k) == 1) - channel_count = k ; - else if (cptr && sscanf (cptr, "Channels / frame : %d", &k) == 1) - channel_count = k ; - else - { printf ("\n\nLine %d: Couldn't find channel count.\n", __LINE__) ; - exit (1) ; - } ; - - if (channel_count != 4) - { printf ("\n\nLine %d: Wrong channel count (4 ->%d).\n", __LINE__, channel_count) ; - exit (1) ; - } ; - - if (! (cptr = strstr (buffer, "Ch Position Value"))) - { printf ("\n\nLine %d: Can't find PEAK data.\n", __LINE__) ; - exit (1) ; - } ; - - for (k = 0 ; k < channel_count ; k++) - { if (! (cptr = strchr (cptr, '\n'))) - { printf ("\n\nLine %d: Got lost.\n", __LINE__) ; - exit (1) ; - } ; - if (sscanf (cptr, "%d %d %f", &chan, &position, &value) != 3) - { printf ("\n\nLine %d: sscanf failed.\n", __LINE__) ; - exit (1) ; - } ; - if (position == 0) - { printf ("\n\nLine %d: peak position for channel %d should not be at offset 0.\n", __LINE__, chan) ; - printf ("%s", buffer) ; - exit (1) ; - } ; - if (chan != k || fabs ((position) * 0.01 - value) > 1e-6) - { printf ("\n\nLine %d: Error : peak value incorrect!\n", __LINE__) ; - printf ("%s", buffer) ; - printf ("\n\nLine %d: %d %f %f\n", __LINE__, chan, position * 0.01, value) ; - exit (1) ; - } ; - cptr ++ ; /* Move past current newline. */ - } ; - -} /* check_logged_peaks */ - -static void -read_write_peak_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - - double small_data [10], max_peak = 0.0 ; - unsigned k ; - - print_test_name (__func__, filename) ; - - for (k = 0 ; k < ARRAY_LEN (small_data) ; k ++) - small_data [k] = 0.1 ; - - sfinfo.samplerate = 44100 ; - sfinfo.channels = 2 ; - sfinfo.format = filetype ; - sfinfo.frames = 0 ; - - /* Open the file, add peak chunk and write samples with value 0.1. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - - sf_command (file, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_TRUE) ; - - test_write_double_or_die (file, 0, small_data, ARRAY_LEN (small_data), __LINE__) ; - - sf_close (file) ; - - /* Open the fiel RDWR, write sample valied 1.25. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_FALSE, __LINE__) ; - - for (k = 0 ; k < ARRAY_LEN (small_data) ; k ++) - small_data [k] = 1.0 ; - - test_write_double_or_die (file, 0, small_data, ARRAY_LEN (small_data), __LINE__) ; - - sf_command (file, SFC_GET_SIGNAL_MAX, &max_peak, sizeof (max_peak)) ; - - sf_close (file) ; - - exit_if_true (max_peak < 0.1, "\n\nLine %d : max peak (%5.3f) should not be 0.1.\n\n", __LINE__, max_peak) ; - - /* Open the file and test the values written to the PEAK chunk. */ - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - exit_if_true (sfinfo.channels * sfinfo.frames != 2 * ARRAY_LEN (small_data), - "Line %d : frame count is %" PRId64 ", should be %zd\n", __LINE__, sfinfo.frames, 2 * ARRAY_LEN (small_data)) ; - - sf_command (file, SFC_GET_SIGNAL_MAX, &max_peak, sizeof (double)) ; - - sf_close (file) ; - - exit_if_true (max_peak < 1.0, "\n\nLine %d : max peak (%5.3f) should be 1.0.\n\n", __LINE__, max_peak) ; - - unlink (filename) ; - puts ("ok") ; -} /* read_write_peak_test */ - diff --git a/libs/libsndfile/tests/pedantic-header-test.sh.in b/libs/libsndfile/tests/pedantic-header-test.sh.in deleted file mode 100644 index 8b1962803a..0000000000 --- a/libs/libsndfile/tests/pedantic-header-test.sh.in +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2010-2011 Erik de Castro Lopo -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the author nor the names of any contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -if test ! -f @top_srcdir@/tests/sfversion.c ; then - exit 0 - fi - -echo -n " Pedantic header test : " - -# Only do this if the compiler is GCC. -if test -n "@GCC_MAJOR_VERSION@" ; then - - CC=`echo "@CC@" | sed "s/.*shave cc //"` - # Compile with -Werror and -pedantic. - $CC -std=c99 -Werror -pedantic -I@top_builddir@/src -c @top_srcdir@/tests/sfversion.c -o /dev/null - - # Check compiler return status. - if test $? -ne 0 ; then - echo - exit 1 - fi - - echo "ok" -else - echo "n/a" - fi - -exit 0 diff --git a/libs/libsndfile/tests/pipe_test.c b/libs/libsndfile/tests/pipe_test.c deleted file mode 100644 index 10fa5725c9..0000000000 --- a/libs/libsndfile/tests/pipe_test.c +++ /dev/null @@ -1,525 +0,0 @@ -/* -** Copyright (C) 2001-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/*========================================================================== -** This is a test program which tests reading from and writing to pipes. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if (OS_IS_WIN32 || HAVE_PIPE == 0 || HAVE_WAITPID == 0) - -int -main (void) -{ - puts (" pipe_test : this test doesn't work on this OS.") ; - return 0 ; -} /* main */ - -#else - -#if HAVE_UNISTD_H -#include -#endif - -#include -#include -#include -#include - -#include - -#include "utils.h" - -typedef struct -{ int format ; - const char *ext ; -} FILETYPE ; - -static int file_exists (const char *filename) ; -static void useek_pipe_rw_test (int filetype, const char *ext) ; -static void pipe_read_test (int filetype, const char *ext) ; -static void pipe_write_test (const char *ext) ; -static void pipe_test_others (FILETYPE*, FILETYPE*) ; - -static FILETYPE read_write_types [] = -{ { SF_FORMAT_RAW , "raw" }, - { SF_FORMAT_AU , "au" }, - /* Lite remove start */ - { SF_FORMAT_PAF , "paf" }, - { SF_FORMAT_IRCAM , "ircam" }, - { SF_FORMAT_PVF , "pvf" }, - /* Lite remove end */ - { 0 , NULL } -} ; - -static FILETYPE read_only_types [] = -{ { SF_FORMAT_RAW , "raw" }, - { SF_FORMAT_AU , "au" }, - { SF_FORMAT_AIFF , "aiff" }, - { SF_FORMAT_WAV , "wav" }, - { SF_FORMAT_W64 , "w64" }, - /* Lite remove start */ - { SF_FORMAT_PAF , "paf" }, - { SF_FORMAT_NIST , "nist" }, - { SF_FORMAT_IRCAM , "ircam" }, - { SF_FORMAT_MAT4 , "mat4" }, - { SF_FORMAT_MAT5 , "mat5" }, - { SF_FORMAT_SVX , "svx" }, - { SF_FORMAT_PVF , "pvf" }, - /* Lite remove end */ - { 0 , NULL } -} ; - -int -main (void) -{ int k ; - - if (file_exists ("libsndfile.spec.in")) - exit_if_true (chdir ("tests") != 0, "\n Error : chdir ('tests') failed.\n") ; - - for (k = 0 ; read_only_types [k].format ; k++) - pipe_read_test (read_only_types [k].format, read_only_types [k].ext) ; - - for (k = 0 ; read_write_types [k].format ; k++) - pipe_write_test (read_write_types [k].ext) ; - - for (k = 0 ; read_write_types [k].format ; k++) - useek_pipe_rw_test (read_write_types [k].format, read_write_types [k].ext) ; - - if (0) - pipe_test_others (read_write_types, read_only_types) ; - - return 0 ; -} /* main */ - -/*============================================================================== -*/ - -static void -pipe_read_test (int filetype, const char *ext) -{ static short data [PIPE_TEST_LEN] ; - static char buffer [256] ; - static char filename [256] ; - - SNDFILE *outfile ; - SF_INFO sfinfo ; - int k, retval ; - - snprintf (filename, sizeof (filename), "pipe_in.%s", ext) ; - print_test_name ("pipe_read_test", filename) ; - - sfinfo.format = filetype | SF_FORMAT_PCM_16 ; - sfinfo.channels = 1 ; - sfinfo.samplerate = 44100 ; - - for (k = 0 ; k < PIPE_TEST_LEN ; k++) - data [k] = PIPE_INDEX (k) ; - - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_writef_short_or_die (outfile, 0, data, PIPE_TEST_LEN, __LINE__) ; - sf_close (outfile) ; - - snprintf (buffer, sizeof (buffer), "cat %s | ./stdin_test %s ", filename, ext) ; - if ((retval = system (buffer)) != 0) - { retval = WEXITSTATUS (retval) ; - printf ("\n\n Line %d : pipe test returned error for file type \"%s\".\n\n", __LINE__, ext) ; - exit (retval) ; - } ; - - unlink (filename) ; - puts ("ok") ; - - return ; -} /* pipe_read_test */ - -static void -pipe_write_test (const char *ext) -{ static char buffer [256] ; - - int retval ; - - print_test_name ("pipe_write_test", ext) ; - - snprintf (buffer, sizeof (buffer), "./stdout_test %s | ./stdin_test %s ", ext, ext) ; - if ((retval = system (buffer))) - { retval = WEXITSTATUS (retval) ; - printf ("\n\n Line %d : pipe test returned error file type \"%s\".\n\n", __LINE__, ext) ; - exit (retval) ; - } ; - - puts ("ok") ; - - return ; -} /* pipe_write_test */ - -/*============================================================================== -*/ - - -static void -useek_pipe_rw_short (const char * ext, SF_INFO * psfinfo_write, SF_INFO * psfinfo_read) -{ static short buffer [PIPE_TEST_LEN] ; - static short data [PIPE_TEST_LEN] ; - SNDFILE *outfile ; - SNDFILE *infile_piped ; - - int k, status = 0 ; - int pipefd [2] ; - pid_t pida ; - - for (k = 0 ; k < PIPE_TEST_LEN ; k++) - data [k] = PIPE_INDEX (k) ; - - /* - ** Create the pipe. - */ - exit_if_true (pipe (pipefd) != 0, "\n\n%s %d : pipe failed : %s\n", __func__, __LINE__, strerror (errno)) ; - - /* - ** Attach the write end of the pipe to be written to. - */ - if ((outfile = sf_open_fd (pipefd [1], SFM_WRITE, psfinfo_write, SF_TRUE)) == NULL) - { printf ("\n\n%s %d : unable to create unseekable pipe for write type \"%s\".\n", __func__, __LINE__, ext) ; - printf ("\t%s\n\n", sf_strerror (outfile)) ; - exit (1) ; - } ; - - if (sf_error (outfile) != SF_ERR_NO_ERROR) - { printf ("\n\n%s %d : unable to open unseekable pipe for write type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* - ** Attach the read end of the pipe to be read from. - */ - if ((infile_piped = sf_open_fd (pipefd [0], SFM_READ, psfinfo_read, SF_TRUE)) == NULL) - { printf ("\n\n%s %d : unable to create unseekable pipe for read type. \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - if (sf_error (infile_piped) != SF_ERR_NO_ERROR) - { printf ("\n\n%s %d : unable to open unseekable pipe for read type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* Fork a child process that will write directly into the pipe. */ - if ((pida = fork ()) == 0) /* child process */ - { test_writef_short_or_die (outfile, 0, data, PIPE_TEST_LEN, __LINE__) ; - exit (0) ; - } ; - - /* In the parent process, read from the pipe and compare what is read - ** to what is written, if they match everything went as planned. - */ - test_readf_short_or_die (infile_piped, 0, buffer, PIPE_TEST_LEN, __LINE__) ; - if (memcmp (buffer, data, sizeof (buffer)) != 0) - { printf ("\n\n%s %d : unseekable pipe test failed for file type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* Wait for the child process to return. */ - waitpid (pida, &status, 0) ; - status = WEXITSTATUS (status) ; - sf_close (outfile) ; - sf_close (infile_piped) ; - - if (status != 0) - { printf ("\n\n%s %d : status of child process is %d for file type %s.\n\n", __func__, __LINE__, status, ext) ; - exit (1) ; - } ; - - return ; -} /* useek_pipe_rw_short */ - - -static void -useek_pipe_rw_float (const char * ext, SF_INFO * psfinfo_write, SF_INFO * psfinfo_read) -{ static float buffer [PIPE_TEST_LEN] ; - static float data [PIPE_TEST_LEN] ; - SNDFILE *outfile ; - SNDFILE *infile_piped ; - - int k, status = 0 ; - int pipefd [2] ; - pid_t pida ; - - for (k = 0 ; k < PIPE_TEST_LEN ; k++) - data [k] = PIPE_INDEX (k) ; - - /* - ** Create the pipe. - */ - exit_if_true (pipe (pipefd) != 0, "\n\n%s %d : pipe failed : %s\n", __func__, __LINE__, strerror (errno)) ; - - /* - ** Attach the write end of the pipe to be written to. - */ - if ((outfile = sf_open_fd (pipefd [1], SFM_WRITE, psfinfo_write, SF_TRUE)) == NULL) - { printf ("\n\n%s %d : unable to create unseekable pipe for write type \"%s\".\n", __func__, __LINE__, ext) ; - printf ("\t%s\n\n", sf_strerror (outfile)) ; - exit (1) ; - } ; - - if (sf_error (outfile) != SF_ERR_NO_ERROR) - { printf ("\n\n%s %d : unable to open unseekable pipe for write type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* - ** Attach the read end of the pipe to be read from. - */ - if ((infile_piped = sf_open_fd (pipefd [0], SFM_READ, psfinfo_read, SF_TRUE)) == NULL) - { printf ("\n\n%s %d : unable to create unseekable pipe for read type. \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - if (sf_error (infile_piped) != SF_ERR_NO_ERROR) - { printf ("\n\n%s %d : unable to open unseekable pipe for read type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* Fork a child process that will write directly into the pipe. */ - if ((pida = fork ()) == 0) /* child process */ - { test_writef_float_or_die (outfile, 0, data, PIPE_TEST_LEN, __LINE__) ; - exit (0) ; - } ; - - /* In the parent process, read from the pipe and compare what is read - ** to what is written, if they match everything went as planned. - */ - test_readf_float_or_die (infile_piped, 0, buffer, PIPE_TEST_LEN, __LINE__) ; - if (memcmp (buffer, data, sizeof (buffer)) != 0) - { printf ("\n\n%s %d : unseekable pipe test failed for file type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* Wait for the child process to return. */ - waitpid (pida, &status, 0) ; - status = WEXITSTATUS (status) ; - sf_close (outfile) ; - sf_close (infile_piped) ; - - if (status != 0) - { printf ("\n\n%s %d : status of child process is %d for file type %s.\n\n", __func__, __LINE__, status, ext) ; - exit (1) ; - } ; - - return ; -} /* useek_pipe_rw_float */ - - -static void -useek_pipe_rw_double (const char * ext, SF_INFO * psfinfo_write, SF_INFO * psfinfo_read) -{ static double buffer [PIPE_TEST_LEN] ; - static double data [PIPE_TEST_LEN] ; - SNDFILE *outfile ; - SNDFILE *infile_piped ; - - int k, status = 0 ; - int pipefd [2] ; - pid_t pida ; - - for (k = 0 ; k < PIPE_TEST_LEN ; k++) - data [k] = PIPE_INDEX (k) ; - - /* - ** Create the pipe. - */ - exit_if_true (pipe (pipefd) != 0, "\n\n%s %d : pipe failed : %s\n", __func__, __LINE__, strerror (errno)) ; - - /* - ** Attach the write end of the pipe to be written to. - */ - if ((outfile = sf_open_fd (pipefd [1], SFM_WRITE, psfinfo_write, SF_TRUE)) == NULL) - { printf ("\n\n%s %d : unable to create unseekable pipe for write type \"%s\".\n", __func__, __LINE__, ext) ; - printf ("\t%s\n\n", sf_strerror (outfile)) ; - exit (1) ; - } ; - - if (sf_error (outfile) != SF_ERR_NO_ERROR) - { printf ("\n\n%s %d : unable to open unseekable pipe for write type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* - ** Attach the read end of the pipe to be read from. - */ - if ((infile_piped = sf_open_fd (pipefd [0], SFM_READ, psfinfo_read, SF_TRUE)) == NULL) - { printf ("\n\n%s %d : unable to create unseekable pipe for read type. \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - if (sf_error (infile_piped) != SF_ERR_NO_ERROR) - { printf ("\n\n%s %d : unable to open unseekable pipe for read type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* Fork a child process that will write directly into the pipe. */ - if ((pida = fork ()) == 0) /* child process */ - { test_writef_double_or_die (outfile, 0, data, PIPE_TEST_LEN, __LINE__) ; - exit (0) ; - } ; - - /* In the parent process, read from the pipe and compare what is read - ** to what is written, if they match everything went as planned. - */ - test_readf_double_or_die (infile_piped, 0, buffer, PIPE_TEST_LEN, __LINE__) ; - if (memcmp (buffer, data, sizeof (buffer)) != 0) - { printf ("\n\n%s %d : unseekable pipe test failed for file type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* Wait for the child process to return. */ - waitpid (pida, &status, 0) ; - status = WEXITSTATUS (status) ; - sf_close (outfile) ; - sf_close (infile_piped) ; - - if (status != 0) - { printf ("\n\n%s %d : status of child process is %d for file type %s.\n\n", __func__, __LINE__, status, ext) ; - exit (1) ; - } ; - - return ; -} /* useek_pipe_rw_double */ - - - - -static void -useek_pipe_rw_test (int filetype, const char *ext) -{ SF_INFO sfinfo_write ; - SF_INFO sfinfo_read ; - - print_test_name ("useek_pipe_rw_test", ext) ; - - /* - ** Setup the INFO structures for the filetype we will be - ** working with. - */ - sfinfo_write.format = filetype | SF_FORMAT_PCM_16 ; - sfinfo_write.channels = 1 ; - sfinfo_write.samplerate = 44100 ; - - - sfinfo_read.format = 0 ; - if (filetype == SF_FORMAT_RAW) - { sfinfo_read.format = filetype | SF_FORMAT_PCM_16 ; - sfinfo_read.channels = 1 ; - sfinfo_read.samplerate = 44100 ; - } ; - - useek_pipe_rw_short (ext, &sfinfo_write, &sfinfo_read) ; - - sfinfo_read.format = sfinfo_write.format = filetype | SF_FORMAT_FLOAT ; - if (sf_format_check (&sfinfo_read) != 0) - useek_pipe_rw_float (ext, &sfinfo_write, &sfinfo_read) ; - - sfinfo_read.format = sfinfo_write.format = filetype | SF_FORMAT_DOUBLE ; - if (sf_format_check (&sfinfo_read) != 0) - useek_pipe_rw_double (ext, &sfinfo_write, &sfinfo_read) ; - - puts ("ok") ; - return ; -} /* useek_pipe_rw_test */ - - - -static void -pipe_test_others (FILETYPE* list1, FILETYPE* list2) -{ SF_FORMAT_INFO info ; - int k, m, major_count, in_list ; - - print_test_name ("pipe_test_others", "") ; - - sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof (int)) ; - - for (k = 0 ; k < major_count ; k++) - { info.format = k ; - - sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)) ; - - in_list = SF_FALSE ; - for (m = 0 ; list1 [m].format ; m++) - if (info.format == list1 [m].format) - in_list = SF_TRUE ; - - for (m = 0 ; list2 [m].format ; m++) - if (info.format == list2 [m].format) - in_list = SF_TRUE ; - - if (in_list) - continue ; - - printf ("%s %x\n", info.name, info.format) ; - - if (1) - { static short data [PIPE_TEST_LEN] ; - static char buffer [256] ; - static const char *filename = "pipe_in.dat" ; - - SNDFILE *outfile ; - SF_INFO sfinfo ; - int retval ; - - sfinfo.format = info.format | SF_FORMAT_PCM_16 ; - sfinfo.channels = 1 ; - sfinfo.samplerate = 44100 ; - - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_writef_short_or_die (outfile, 0, data, PIPE_TEST_LEN, __LINE__) ; - sf_close (outfile) ; - - snprintf (buffer, sizeof (buffer), "cat %s | ./stdin_test %s %d ", filename, info.extension, PIPE_TEST_LEN) ; - if ((retval = system (buffer)) == 0) - { retval = WEXITSTATUS (retval) ; - printf ("\n\n Line %d : pipe test should have returned error file type \"%s\" but didn't.\n\n", __LINE__, info.name) ; - exit (1) ; - } ; - - unlink (filename) ; - } ; - } ; - - - puts ("ok") ; - - return ; -} /* pipe_test_others */ - - -/*============================================================================== -*/ - -static int -file_exists (const char *filename) -{ struct stat buf ; - - if (stat (filename, &buf)) - return 0 ; - - return 1 ; -} /* file_exists */ - -#endif - diff --git a/libs/libsndfile/tests/pipe_test.def b/libs/libsndfile/tests/pipe_test.def deleted file mode 100644 index 6469cca1ec..0000000000 --- a/libs/libsndfile/tests/pipe_test.def +++ /dev/null @@ -1,14 +0,0 @@ -autogen definitions pipe_test.tpl; - -data_type = { - type_name = short ; - }; - -data_type = { - type_name = float ; - }; - -data_type = { - type_name = double ; - }; - diff --git a/libs/libsndfile/tests/pipe_test.tpl b/libs/libsndfile/tests/pipe_test.tpl deleted file mode 100644 index 1bc1f4367e..0000000000 --- a/libs/libsndfile/tests/pipe_test.tpl +++ /dev/null @@ -1,374 +0,0 @@ -[+ AutoGen5 template c +] -/* -** Copyright (C) 2001-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/*========================================================================== -** This is a test program which tests reading from and writing to pipes. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if (OS_IS_WIN32 || defined __OS2__ || HAVE_PIPE == 0 || HAVE_WAITPID == 0) - -int -main (void) -{ - puts (" pipe_test : this test doesn't work on this OS.") ; - return 0 ; -} /* main */ - -#else - -#if HAVE_UNISTD_H -#include -#endif - -#include -#include -#include -#include - -#include - -#include "utils.h" - -typedef struct -{ int format ; - const char *ext ; -} FILETYPE ; - -static int file_exists (const char *filename) ; -static void useek_pipe_rw_test (int filetype, const char *ext) ; -static void pipe_read_test (int filetype, const char *ext) ; -static void pipe_write_test (const char *ext) ; -static void pipe_test_others (FILETYPE*, FILETYPE*) ; - -static FILETYPE read_write_types [] = -{ { SF_FORMAT_RAW , "raw" }, - { SF_FORMAT_AU , "au" }, - /* Lite remove start */ - { SF_FORMAT_PAF , "paf" }, - { SF_FORMAT_IRCAM , "ircam" }, - { SF_FORMAT_PVF , "pvf" }, - /* Lite remove end */ - { 0 , NULL } -} ; - -static FILETYPE read_only_types [] = -{ { SF_FORMAT_RAW , "raw" }, - { SF_FORMAT_AU , "au" }, - { SF_FORMAT_AIFF , "aiff" }, - { SF_FORMAT_WAV , "wav" }, - { SF_FORMAT_W64 , "w64" }, - /* Lite remove start */ - { SF_FORMAT_PAF , "paf" }, - { SF_FORMAT_NIST , "nist" }, - { SF_FORMAT_IRCAM , "ircam" }, - { SF_FORMAT_MAT4 , "mat4" }, - { SF_FORMAT_MAT5 , "mat5" }, - { SF_FORMAT_SVX , "svx" }, - { SF_FORMAT_PVF , "pvf" }, - /* Lite remove end */ - { 0 , NULL } -} ; - -int -main (void) -{ int k ; - - if (file_exists ("libsndfile.spec.in")) - exit_if_true (chdir ("tests") != 0, "\n Error : chdir ('tests') failed.\n") ; - - for (k = 0 ; read_only_types [k].format ; k++) - pipe_read_test (read_only_types [k].format, read_only_types [k].ext) ; - - for (k = 0 ; read_write_types [k].format ; k++) - pipe_write_test (read_write_types [k].ext) ; - - for (k = 0 ; read_write_types [k].format ; k++) - useek_pipe_rw_test (read_write_types [k].format, read_write_types [k].ext) ; - - if (0) - pipe_test_others (read_write_types, read_only_types) ; - - return 0 ; -} /* main */ - -/*============================================================================== -*/ - -static void -pipe_read_test (int filetype, const char *ext) -{ static short data [PIPE_TEST_LEN] ; - static char buffer [256] ; - static char filename [256] ; - - SNDFILE *outfile ; - SF_INFO sfinfo ; - int k, retval ; - - snprintf (filename, sizeof (filename), "pipe_in.%s", ext) ; - print_test_name ("pipe_read_test", filename) ; - - sfinfo.format = filetype | SF_FORMAT_PCM_16 ; - sfinfo.channels = 1 ; - sfinfo.samplerate = 44100 ; - - for (k = 0 ; k < PIPE_TEST_LEN ; k++) - data [k] = PIPE_INDEX (k) ; - - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_writef_short_or_die (outfile, 0, data, PIPE_TEST_LEN, __LINE__) ; - sf_close (outfile) ; - - snprintf (buffer, sizeof (buffer), "cat %s | ./stdin_test %s ", filename, ext) ; - if ((retval = system (buffer)) != 0) - { retval = WEXITSTATUS (retval) ; - printf ("\n\n Line %d : pipe test returned error for file type \"%s\".\n\n", __LINE__, ext) ; - exit (retval) ; - } ; - - unlink (filename) ; - puts ("ok") ; - - return ; -} /* pipe_read_test */ - -static void -pipe_write_test (const char *ext) -{ static char buffer [256] ; - - int retval ; - - print_test_name ("pipe_write_test", ext) ; - - snprintf (buffer, sizeof (buffer), "./stdout_test %s | ./stdin_test %s ", ext, ext) ; - if ((retval = system (buffer))) - { retval = WEXITSTATUS (retval) ; - printf ("\n\n Line %d : pipe test returned error file type \"%s\".\n\n", __LINE__, ext) ; - exit (retval) ; - } ; - - puts ("ok") ; - - return ; -} /* pipe_write_test */ - -/*============================================================================== -*/ - -[+ FOR data_type +] -static void -useek_pipe_rw_[+ (get "type_name") +] (const char * ext, SF_INFO * psfinfo_write, SF_INFO * psfinfo_read) -{ static [+ (get "type_name") +] buffer [PIPE_TEST_LEN] ; - static [+ (get "type_name") +] data [PIPE_TEST_LEN] ; - SNDFILE *outfile ; - SNDFILE *infile_piped ; - - int k, status = 0 ; - int pipefd [2] ; - pid_t pida ; - - for (k = 0 ; k < PIPE_TEST_LEN ; k++) - data [k] = PIPE_INDEX (k) ; - - /* - ** Create the pipe. - */ - exit_if_true (pipe (pipefd) != 0, "\n\n%s %d : pipe failed : %s\n", __func__, __LINE__, strerror (errno)) ; - - /* - ** Attach the write end of the pipe to be written to. - */ - if ((outfile = sf_open_fd (pipefd [1], SFM_WRITE, psfinfo_write, SF_TRUE)) == NULL) - { printf ("\n\n%s %d : unable to create unseekable pipe for write type \"%s\".\n", __func__, __LINE__, ext) ; - printf ("\t%s\n\n", sf_strerror (outfile)) ; - exit (1) ; - } ; - - if (sf_error (outfile) != SF_ERR_NO_ERROR) - { printf ("\n\n%s %d : unable to open unseekable pipe for write type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* - ** Attach the read end of the pipe to be read from. - */ - if ((infile_piped = sf_open_fd (pipefd [0], SFM_READ, psfinfo_read, SF_TRUE)) == NULL) - { printf ("\n\n%s %d : unable to create unseekable pipe for read type. \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - if (sf_error (infile_piped) != SF_ERR_NO_ERROR) - { printf ("\n\n%s %d : unable to open unseekable pipe for read type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* Fork a child process that will write directly into the pipe. */ - if ((pida = fork ()) == 0) /* child process */ - { test_writef_[+ (get "type_name") +]_or_die (outfile, 0, data, PIPE_TEST_LEN, __LINE__) ; - exit (0) ; - } ; - - /* In the parent process, read from the pipe and compare what is read - ** to what is written, if they match everything went as planned. - */ - test_readf_[+ (get "type_name") +]_or_die (infile_piped, 0, buffer, PIPE_TEST_LEN, __LINE__) ; - if (memcmp (buffer, data, sizeof (buffer)) != 0) - { printf ("\n\n%s %d : unseekable pipe test failed for file type \"%s\".\n\n", __func__, __LINE__, ext) ; - exit (1) ; - } ; - - /* Wait for the child process to return. */ - waitpid (pida, &status, 0) ; - status = WEXITSTATUS (status) ; - sf_close (outfile) ; - sf_close (infile_piped) ; - - if (status != 0) - { printf ("\n\n%s %d : status of child process is %d for file type %s.\n\n", __func__, __LINE__, status, ext) ; - exit (1) ; - } ; - - return ; -} /* useek_pipe_rw_[+ (get "type_name") +] */ - -[+ ENDFOR data_type +] - - -static void -useek_pipe_rw_test (int filetype, const char *ext) -{ SF_INFO sfinfo_write ; - SF_INFO sfinfo_read ; - - print_test_name ("useek_pipe_rw_test", ext) ; - - /* - ** Setup the INFO structures for the filetype we will be - ** working with. - */ - sfinfo_write.format = filetype | SF_FORMAT_PCM_16 ; - sfinfo_write.channels = 1 ; - sfinfo_write.samplerate = 44100 ; - - - sfinfo_read.format = 0 ; - if (filetype == SF_FORMAT_RAW) - { sfinfo_read.format = filetype | SF_FORMAT_PCM_16 ; - sfinfo_read.channels = 1 ; - sfinfo_read.samplerate = 44100 ; - } ; - - useek_pipe_rw_short (ext, &sfinfo_write, &sfinfo_read) ; - - sfinfo_read.format = sfinfo_write.format = filetype | SF_FORMAT_FLOAT ; - if (sf_format_check (&sfinfo_read) != 0) - useek_pipe_rw_float (ext, &sfinfo_write, &sfinfo_read) ; - - sfinfo_read.format = sfinfo_write.format = filetype | SF_FORMAT_DOUBLE ; - if (sf_format_check (&sfinfo_read) != 0) - useek_pipe_rw_double (ext, &sfinfo_write, &sfinfo_read) ; - - puts ("ok") ; - return ; -} /* useek_pipe_rw_test */ - - - -static void -pipe_test_others (FILETYPE* list1, FILETYPE* list2) -{ SF_FORMAT_INFO info ; - int k, m, major_count, in_list ; - - print_test_name ("pipe_test_others", "") ; - - sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof (int)) ; - - for (k = 0 ; k < major_count ; k++) - { info.format = k ; - - sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)) ; - - in_list = SF_FALSE ; - for (m = 0 ; list1 [m].format ; m++) - if (info.format == list1 [m].format) - in_list = SF_TRUE ; - - for (m = 0 ; list2 [m].format ; m++) - if (info.format == list2 [m].format) - in_list = SF_TRUE ; - - if (in_list) - continue ; - - printf ("%s %x\n", info.name, info.format) ; - - if (1) - { static short data [PIPE_TEST_LEN] ; - static char buffer [256] ; - static const char *filename = "pipe_in.dat" ; - - SNDFILE *outfile ; - SF_INFO sfinfo ; - int retval ; - - sfinfo.format = info.format | SF_FORMAT_PCM_16 ; - sfinfo.channels = 1 ; - sfinfo.samplerate = 44100 ; - - outfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_writef_short_or_die (outfile, 0, data, PIPE_TEST_LEN, __LINE__) ; - sf_close (outfile) ; - - snprintf (buffer, sizeof (buffer), "cat %s | ./stdin_test %s %d ", filename, info.extension, PIPE_TEST_LEN) ; - if ((retval = system (buffer)) == 0) - { retval = WEXITSTATUS (retval) ; - printf ("\n\n Line %d : pipe test should have returned error file type \"%s\" but didn't.\n\n", __LINE__, info.name) ; - exit (1) ; - } ; - - unlink (filename) ; - } ; - } ; - - - puts ("ok") ; - - return ; -} /* pipe_test_others */ - - -/*============================================================================== -*/ - -static int -file_exists (const char *filename) -{ struct stat buf ; - - if (stat (filename, &buf)) - return 0 ; - - return 1 ; -} /* file_exists */ - -#endif - diff --git a/libs/libsndfile/tests/raw_test.c b/libs/libsndfile/tests/raw_test.c deleted file mode 100644 index 002f3ee4ab..0000000000 --- a/libs/libsndfile/tests/raw_test.c +++ /dev/null @@ -1,187 +0,0 @@ -/* -** Copyright (C) 2002-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_LEN (1 << 10) -#define LOG_BUFFER_SIZE 1024 - -static void raw_offset_test (const char *filename, int typeminor) ; -static void bad_raw_test (void) ; - -/* Force the start of this buffer to be double aligned. Sparc-solaris will -** choke if its not. -*/ -static short data [BUFFER_LEN] ; - -int -main (void) -{ - raw_offset_test ("offset.raw", SF_FORMAT_PCM_16) ; - bad_raw_test () ; - - return 0 ; -} /* main */ - -/*============================================================================================ -** Here are the test functions. -*/ - -static void -raw_offset_test (const char *filename, int typeminor) -{ SNDFILE *sndfile ; - SF_INFO sfinfo ; - sf_count_t start ; - int k ; - - print_test_name ("raw_offset_test", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = SF_FORMAT_RAW | typeminor ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - - sndfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - - start = 0 ; - sf_command (sndfile, SFC_FILE_TRUNCATE, &start, sizeof (start)) ; - - for (k = 0 ; k < BUFFER_LEN ; k++) - data [k] = k ; - test_write_short_or_die (sndfile, 0, data, BUFFER_LEN, __LINE__) ; - - sf_close (sndfile) ; - - sndfile = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - check_log_buffer_or_die (sndfile, __LINE__) ; - - if (abs (BUFFER_LEN - sfinfo.frames) > 1) - { printf ("\n\nLine %d : Incorrect sample count (%" PRId64 " should be %d)\n", __LINE__, sfinfo.frames, BUFFER_LEN) ; - dump_log_buffer (sndfile) ; - exit (1) ; - } ; - - memset (data, 0 , sizeof (data)) ; - test_read_short_or_die (sndfile, 0, data, BUFFER_LEN, __LINE__) ; - for (k = 0 ; k < BUFFER_LEN ; k++) - if (data [k] != k) - printf ("Error : line %d\n", __LINE__) ; - - /* Set dataoffset to 2 bytes from beginning of file. */ - start = 2 ; - sf_command (sndfile, SFC_SET_RAW_START_OFFSET, &start, sizeof (start)) ; - - /* Seek to new start */ - test_seek_or_die (sndfile, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - memset (data, 0 , sizeof (data)) ; - test_read_short_or_die (sndfile, 0, data, BUFFER_LEN - 1, __LINE__) ; - for (k = 0 ; k < BUFFER_LEN - 1 ; k++) - if (data [k] != k + 1) - { printf ("Error : line %d\n", __LINE__) ; - exit (1) ; - } ; - - /* Set dataoffset to 4 bytes from beginning of file. */ - start = 4 ; - sf_command (sndfile, SFC_SET_RAW_START_OFFSET, &start, sizeof (start)) ; - - /* Seek to new start */ - test_seek_or_die (sndfile, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - memset (data, 0 , sizeof (data)) ; - test_read_short_or_die (sndfile, 0, data, BUFFER_LEN - 2, __LINE__) ; - for (k = 0 ; k < BUFFER_LEN - 2 ; k++) - if (data [k] != k + 2) - { printf ("Error : line %d\n", __LINE__) ; - exit (1) ; - } ; - - /* Set dataoffset back to 0 bytes from beginning of file. */ - start = 0 ; - sf_command (sndfile, SFC_SET_RAW_START_OFFSET, &start, sizeof (start)) ; - - /* Seek to new start */ - test_seek_or_die (sndfile, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - memset (data, 0 , sizeof (data)) ; - test_read_short_or_die (sndfile, 0, data, BUFFER_LEN, __LINE__) ; - for (k = 0 ; k < BUFFER_LEN ; k++) - if (data [k] != k) - { printf ("Error : line %d\n", __LINE__) ; - exit (1) ; - } ; - - sf_close (sndfile) ; - unlink (filename) ; - - puts ("ok") ; -} /* raw_offset_test */ - -static void -bad_raw_test (void) -{ FILE *textfile ; - SNDFILE *file ; - SF_INFO sfinfo ; - const char *errorstr, *filename = "bad.raw" ; - - print_test_name ("bad_raw_test", filename) ; - - if ((textfile = fopen (filename, "w")) == NULL) - { printf ("\n\nLine %d : not able to open text file for write.\n", __LINE__) ; - exit (1) ; - } ; - - fprintf (textfile, "This is not a valid file.\n") ; - fclose (textfile) ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = SF_FORMAT_RAW | 0xABCD ; - sfinfo.channels = 1 ; - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) != NULL) - { printf ("\n\nLine %d : Error, file should not have opened.\n", __LINE__ - 1) ; - exit (1) ; - } ; - - errorstr = sf_strerror (file) ; - - if (strstr (errorstr, "Bad format field in SF_INFO struct") == NULL) - { printf ("\n\nLine %d : Error bad error string : %s.\n", __LINE__ - 1, errorstr) ; - exit (1) ; - } ; - - unlink (filename) ; - - puts ("ok") ; -} /* bad_raw_test */ - diff --git a/libs/libsndfile/tests/rdwr_test.def b/libs/libsndfile/tests/rdwr_test.def deleted file mode 100644 index 43c1089818..0000000000 --- a/libs/libsndfile/tests/rdwr_test.def +++ /dev/null @@ -1,32 +0,0 @@ -autogen definitions rdwr_test.tpl; - -data_type = { - name = "short" ; - type = "short" ; - format = "SF_FORMAT_PCM_16" ; - } ; - -data_type = { - name = "int" ; - type = "int" ; - format = "SF_FORMAT_PCM_32" ; - } ; - -data_type = { - name = "float" ; - type = "float" ; - format = "SF_FORMAT_FLOAT" ; - } ; - -data_type = { - name = "double" ; - type = "double" ; - format = "SF_FORMAT_DOUBLE" ; - } ; - -data_type = { - name = "raw" ; - type = "unsigned char" ; - format = "SF_FORMAT_PCM_U8" ; - } ; - diff --git a/libs/libsndfile/tests/rdwr_test.tpl b/libs/libsndfile/tests/rdwr_test.tpl deleted file mode 100644 index 8cfdd3687e..0000000000 --- a/libs/libsndfile/tests/rdwr_test.tpl +++ /dev/null @@ -1,105 +0,0 @@ -[+ AutoGen5 template c +] -/* -** Copyright (C) 2010-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#if (defined (WIN32) || defined (_WIN32)) -#include -#include -#endif - -#include - -#include "utils.h" - -[+ FOR data_type -+]static void rdwr_[+ (get "name") +]_test (const char *filename) ; -[+ ENDFOR data_type -+] - -int -main (void) -{ - rdwr_short_test ("rdwr_short.wav") ; - rdwr_int_test ("rdwr_int.wav") ; - rdwr_float_test ("rdwr_float.wav") ; - rdwr_double_test ("rdwr_double.wav") ; - rdwr_raw_test ("rdwr_raw.wav") ; - - return 0 ; -} /* main */ - - -/*============================================================================================ -** Here are the test functions. -*/ - -[+ FOR data_type -+]static void -rdwr_[+ (get "name") +]_test (const char *filename) -{ SNDFILE *file ; - SF_INFO sfinfo ; - sf_count_t frames ; - [+ (get "type") +] buffer [160] ; - - print_test_name ("rdwr_[+ (get "name") +]_test", filename) ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Create sound file with no data. */ - sfinfo.format = SF_FORMAT_WAV | [+ (get "format") +] ; - sfinfo.samplerate = 16000 ; - sfinfo.channels = 1 ; - - unlink (filename) ; - - frames = ARRAY_LEN (buffer) ; - - /* Open again for read/write. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - - test_write_[+ (get "name") +]_or_die (file, 0, buffer, frames, __LINE__) ; - - test_read_[+ (get "name") +]_or_die (file, 0, buffer, frames, __LINE__) ; - - sf_close (file) ; - unlink (filename) ; - - puts ("ok") ; - return ; -} /* rdwr_[+ (get "name") +]_test */ - -[+ ENDFOR data_type -+] - diff --git a/libs/libsndfile/tests/scale_clip_test.c b/libs/libsndfile/tests/scale_clip_test.c deleted file mode 100644 index 57b0b96073..0000000000 --- a/libs/libsndfile/tests/scale_clip_test.c +++ /dev/null @@ -1,1853 +0,0 @@ -/* -** Copyright (C) 1999-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include - -#include "utils.h" - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -#define HALF_BUFFER_SIZE (1 << 12) -#define BUFFER_SIZE (2 * HALF_BUFFER_SIZE) - -#define SINE_AMP 1.1 -#define MAX_ERROR 0.0202 - - -static void flt_scale_clip_test_16 (const char *filename, int filetype, float maxval) ; -static void flt_scale_clip_test_24 (const char *filename, int filetype, float maxval) ; -static void flt_scale_clip_test_32 (const char *filename, int filetype, float maxval) ; -static void flt_scale_clip_test_08 (const char *filename, int filetype, float maxval) ; - -static void dbl_scale_clip_test_16 (const char *filename, int filetype, float maxval) ; -static void dbl_scale_clip_test_24 (const char *filename, int filetype, float maxval) ; -static void dbl_scale_clip_test_32 (const char *filename, int filetype, float maxval) ; -static void dbl_scale_clip_test_08 (const char *filename, int filetype, float maxval) ; - - - -static void flt_short_clip_read_test (const char *filename, int filetype) ; -static void flt_int_clip_read_test (const char *filename, int filetype) ; - -static void dbl_short_clip_read_test (const char *filename, int filetype) ; -static void dbl_int_clip_read_test (const char *filename, int filetype) ; - - - -static void short_flt_scale_write_test (const char *filename, int filetype) ; -static void short_dbl_scale_write_test (const char *filename, int filetype) ; - -static void int_flt_scale_write_test (const char *filename, int filetype) ; -static void int_dbl_scale_write_test (const char *filename, int filetype) ; - - -typedef union -{ double dbl [BUFFER_SIZE] ; - float flt [BUFFER_SIZE] ; - int i [BUFFER_SIZE] ; - short s [BUFFER_SIZE] ; -} BUFFER ; - -/* Data buffer. */ -static BUFFER buffer_out ; -static BUFFER buffer_in ; - -int -main (void) -{ - flt_scale_clip_test_08 ("scale_clip_s8.au", SF_FORMAT_AU | SF_FORMAT_PCM_S8, 1.0 * 0x80) ; - flt_scale_clip_test_08 ("scale_clip_u8.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_U8, 1.0 * 0x80) ; - - dbl_scale_clip_test_08 ("scale_clip_s8.au", SF_FORMAT_AU | SF_FORMAT_PCM_S8, 1.0 * 0x80) ; - dbl_scale_clip_test_08 ("scale_clip_u8.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_U8, 1.0 * 0x80) ; - - /* - ** Now use SF_FORMAT_AU where possible because it allows both - ** big and little endian files. - */ - - flt_scale_clip_test_16 ("scale_clip_be16.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_16, 1.0 * 0x8000) ; - flt_scale_clip_test_16 ("scale_clip_le16.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_16, 1.0 * 0x8000) ; - flt_scale_clip_test_24 ("scale_clip_be24.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_24, 1.0 * 0x800000) ; - flt_scale_clip_test_24 ("scale_clip_le24.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_24, 1.0 * 0x800000) ; - flt_scale_clip_test_32 ("scale_clip_be32.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_32, 1.0 * 0x80000000) ; - flt_scale_clip_test_32 ("scale_clip_le32.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_32, 1.0 * 0x80000000) ; - - dbl_scale_clip_test_16 ("scale_clip_be16.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_16, 1.0 * 0x8000) ; - dbl_scale_clip_test_16 ("scale_clip_le16.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_16, 1.0 * 0x8000) ; - dbl_scale_clip_test_24 ("scale_clip_be24.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_24, 1.0 * 0x800000) ; - dbl_scale_clip_test_24 ("scale_clip_le24.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_24, 1.0 * 0x800000) ; - dbl_scale_clip_test_32 ("scale_clip_be32.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_32, 1.0 * 0x80000000) ; - dbl_scale_clip_test_32 ("scale_clip_le32.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_32, 1.0 * 0x80000000) ; - - flt_short_clip_read_test ("flt_short.au" , SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_FLOAT) ; - flt_int_clip_read_test ("flt_int.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_FLOAT) ; - dbl_short_clip_read_test ("dbl_short.au" , SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_DOUBLE) ; - dbl_int_clip_read_test ("dbl_int.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_DOUBLE) ; - - short_flt_scale_write_test ("short_flt.au" , SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_FLOAT) ; - int_flt_scale_write_test ("int_flt.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_FLOAT) ; - short_dbl_scale_write_test ("short_dbl.au" , SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_DOUBLE) ; - int_dbl_scale_write_test ("int_dbl.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_DOUBLE) ; - - return 0 ; -} /* main */ - -/*============================================================================================ -** Here are the test functions. -*/ - - -static void -flt_scale_clip_test_16 (const char *filename, int filetype, float maxval) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - float *data_out, *data_in ; - double diff, clip_max_diff ; - - print_test_name ("flt_scale_clip_test_16", filename) ; - - data_out = buffer_out.flt ; - data_in = buffer_in.flt ; - - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { data_out [k] = 1.2 * sin (2 * M_PI * k / HALF_BUFFER_SIZE) ; - data_out [k + HALF_BUFFER_SIZE] = data_out [k] * maxval ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* - ** Write two versions of the data: - ** normalized and clipped - ** un-normalized and clipped. - */ - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_write_float_or_die (file, 0, data_out, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - test_write_float_or_die (file, 0, data_out + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&buffer_in, 0, sizeof (buffer_in)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_float_or_die (file, 0, data_in, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - test_read_float_or_die (file, 0, data_in + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - /* Check normalized version. */ - clip_max_diff = 0.0 ; - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > 1.0) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > 1.0) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0 / 0x8000) - { printf ("\n\nLine %d: Clipping difference (%e) too large (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - /* Check the un-normalized data. */ - clip_max_diff = 0.0 ; - for (k = HALF_BUFFER_SIZE ; k < BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > maxval) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > maxval) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (un-normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0) - { printf ("\n\nLine %d: Clipping difference (%e) too large (un-normalised).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - printf ("ok\n") ; - unlink (filename) ; -} /* flt_scale_clip_test_16 */ - -static void -flt_scale_clip_test_24 (const char *filename, int filetype, float maxval) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - float *data_out, *data_in ; - double diff, clip_max_diff ; - - print_test_name ("flt_scale_clip_test_24", filename) ; - - data_out = buffer_out.flt ; - data_in = buffer_in.flt ; - - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { data_out [k] = 1.2 * sin (2 * M_PI * k / HALF_BUFFER_SIZE) ; - data_out [k + HALF_BUFFER_SIZE] = data_out [k] * maxval ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* - ** Write two versions of the data: - ** normalized and clipped - ** un-normalized and clipped. - */ - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_write_float_or_die (file, 0, data_out, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - test_write_float_or_die (file, 0, data_out + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&buffer_in, 0, sizeof (buffer_in)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_float_or_die (file, 0, data_in, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - test_read_float_or_die (file, 0, data_in + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - /* Check normalized version. */ - clip_max_diff = 0.0 ; - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > 1.0) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > 1.0) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0 / 0x800000) - { printf ("\n\nLine %d: Clipping difference (%e) too large (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - /* Check the un-normalized data. */ - clip_max_diff = 0.0 ; - for (k = HALF_BUFFER_SIZE ; k < BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > maxval) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > maxval) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (un-normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0) - { printf ("\n\nLine %d: Clipping difference (%e) too large (un-normalised).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - printf ("ok\n") ; - unlink (filename) ; -} /* flt_scale_clip_test_24 */ - -static void -flt_scale_clip_test_32 (const char *filename, int filetype, float maxval) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - float *data_out, *data_in ; - double diff, clip_max_diff ; - - print_test_name ("flt_scale_clip_test_32", filename) ; - - data_out = buffer_out.flt ; - data_in = buffer_in.flt ; - - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { data_out [k] = 1.2 * sin (2 * M_PI * k / HALF_BUFFER_SIZE) ; - data_out [k + HALF_BUFFER_SIZE] = data_out [k] * maxval ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* - ** Write two versions of the data: - ** normalized and clipped - ** un-normalized and clipped. - */ - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_write_float_or_die (file, 0, data_out, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - test_write_float_or_die (file, 0, data_out + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&buffer_in, 0, sizeof (buffer_in)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_float_or_die (file, 0, data_in, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - test_read_float_or_die (file, 0, data_in + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - /* Check normalized version. */ - clip_max_diff = 0.0 ; - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > 1.0) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > 1.0) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0 / 0x80000000) - { printf ("\n\nLine %d: Clipping difference (%e) too large (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - /* Check the un-normalized data. */ - clip_max_diff = 0.0 ; - for (k = HALF_BUFFER_SIZE ; k < BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > maxval) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > maxval) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (un-normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0) - { printf ("\n\nLine %d: Clipping difference (%e) too large (un-normalised).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - printf ("ok\n") ; - unlink (filename) ; -} /* flt_scale_clip_test_32 */ - -static void -flt_scale_clip_test_08 (const char *filename, int filetype, float maxval) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - float *data_out, *data_in ; - double diff, clip_max_diff ; - - print_test_name ("flt_scale_clip_test_08", filename) ; - - data_out = buffer_out.flt ; - data_in = buffer_in.flt ; - - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { data_out [k] = 1.2 * sin (2 * M_PI * k / HALF_BUFFER_SIZE) ; - data_out [k + HALF_BUFFER_SIZE] = data_out [k] * maxval ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* - ** Write two versions of the data: - ** normalized and clipped - ** un-normalized and clipped. - */ - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_write_float_or_die (file, 0, data_out, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - test_write_float_or_die (file, 0, data_out + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&buffer_in, 0, sizeof (buffer_in)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_float_or_die (file, 0, data_in, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; - test_read_float_or_die (file, 0, data_in + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - /* Check normalized version. */ - clip_max_diff = 0.0 ; - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > 1.0) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > 1.0) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0 / 0x80) - { printf ("\n\nLine %d: Clipping difference (%e) too large (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - /* Check the un-normalized data. */ - clip_max_diff = 0.0 ; - for (k = HALF_BUFFER_SIZE ; k < BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > maxval) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > maxval) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (un-normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0) - { printf ("\n\nLine %d: Clipping difference (%e) too large (un-normalised).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - printf ("ok\n") ; - unlink (filename) ; -} /* flt_scale_clip_test_08 */ - - - -static void -dbl_scale_clip_test_16 (const char *filename, int filetype, float maxval) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - double *data_out, *data_in ; - double diff, clip_max_diff ; - - print_test_name ("dbl_scale_clip_test_16", filename) ; - - data_out = buffer_out.dbl ; - data_in = buffer_in.dbl ; - - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { data_out [k] = 1.2 * sin (2 * M_PI * k / HALF_BUFFER_SIZE) ; - data_out [k + HALF_BUFFER_SIZE] = data_out [k] * maxval ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* - ** Write two versions of the data: - ** normalized and clipped - ** un-normalized and clipped. - */ - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_write_double_or_die (file, 0, data_out, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - test_write_double_or_die (file, 0, data_out + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&buffer_in, 0, sizeof (buffer_in)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, data_in, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - test_read_double_or_die (file, 0, data_in + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - /* Check normalized version. */ - clip_max_diff = 0.0 ; - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > 1.0) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > 1.0) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0 / 0x8000) - { printf ("\n\nLine %d: Clipping difference (%e) too large (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - /* Check the un-normalized data. */ - clip_max_diff = 0.0 ; - for (k = HALF_BUFFER_SIZE ; k < BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > maxval) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > maxval) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (un-normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0) - { printf ("\n\nLine %d: Clipping difference (%e) too large (un-normalised).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - printf ("ok\n") ; - unlink (filename) ; -} /* dbl_scale_clip_test_16 */ - -static void -dbl_scale_clip_test_24 (const char *filename, int filetype, float maxval) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - double *data_out, *data_in ; - double diff, clip_max_diff ; - - print_test_name ("dbl_scale_clip_test_24", filename) ; - - data_out = buffer_out.dbl ; - data_in = buffer_in.dbl ; - - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { data_out [k] = 1.2 * sin (2 * M_PI * k / HALF_BUFFER_SIZE) ; - data_out [k + HALF_BUFFER_SIZE] = data_out [k] * maxval ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* - ** Write two versions of the data: - ** normalized and clipped - ** un-normalized and clipped. - */ - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_write_double_or_die (file, 0, data_out, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - test_write_double_or_die (file, 0, data_out + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&buffer_in, 0, sizeof (buffer_in)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, data_in, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - test_read_double_or_die (file, 0, data_in + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - /* Check normalized version. */ - clip_max_diff = 0.0 ; - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > 1.0) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > 1.0) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0 / 0x800000) - { printf ("\n\nLine %d: Clipping difference (%e) too large (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - /* Check the un-normalized data. */ - clip_max_diff = 0.0 ; - for (k = HALF_BUFFER_SIZE ; k < BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > maxval) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > maxval) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (un-normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0) - { printf ("\n\nLine %d: Clipping difference (%e) too large (un-normalised).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - printf ("ok\n") ; - unlink (filename) ; -} /* dbl_scale_clip_test_24 */ - -static void -dbl_scale_clip_test_32 (const char *filename, int filetype, float maxval) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - double *data_out, *data_in ; - double diff, clip_max_diff ; - - print_test_name ("dbl_scale_clip_test_32", filename) ; - - data_out = buffer_out.dbl ; - data_in = buffer_in.dbl ; - - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { data_out [k] = 1.2 * sin (2 * M_PI * k / HALF_BUFFER_SIZE) ; - data_out [k + HALF_BUFFER_SIZE] = data_out [k] * maxval ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* - ** Write two versions of the data: - ** normalized and clipped - ** un-normalized and clipped. - */ - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_write_double_or_die (file, 0, data_out, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - test_write_double_or_die (file, 0, data_out + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&buffer_in, 0, sizeof (buffer_in)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, data_in, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - test_read_double_or_die (file, 0, data_in + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - /* Check normalized version. */ - clip_max_diff = 0.0 ; - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > 1.0) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > 1.0) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0 / 0x80000000) - { printf ("\n\nLine %d: Clipping difference (%e) too large (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - /* Check the un-normalized data. */ - clip_max_diff = 0.0 ; - for (k = HALF_BUFFER_SIZE ; k < BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > maxval) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > maxval) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (un-normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0) - { printf ("\n\nLine %d: Clipping difference (%e) too large (un-normalised).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - printf ("ok\n") ; - unlink (filename) ; -} /* dbl_scale_clip_test_32 */ - -static void -dbl_scale_clip_test_08 (const char *filename, int filetype, float maxval) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - double *data_out, *data_in ; - double diff, clip_max_diff ; - - print_test_name ("dbl_scale_clip_test_08", filename) ; - - data_out = buffer_out.dbl ; - data_in = buffer_in.dbl ; - - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { data_out [k] = 1.2 * sin (2 * M_PI * k / HALF_BUFFER_SIZE) ; - data_out [k + HALF_BUFFER_SIZE] = data_out [k] * maxval ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* - ** Write two versions of the data: - ** normalized and clipped - ** un-normalized and clipped. - */ - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_write_double_or_die (file, 0, data_out, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - test_write_double_or_die (file, 0, data_out + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&buffer_in, 0, sizeof (buffer_in)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, data_in, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; - test_read_double_or_die (file, 0, data_in + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - /* Check normalized version. */ - clip_max_diff = 0.0 ; - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > 1.0) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > 1.0) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0 / 0x80) - { printf ("\n\nLine %d: Clipping difference (%e) too large (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - /* Check the un-normalized data. */ - clip_max_diff = 0.0 ; - for (k = HALF_BUFFER_SIZE ; k < BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > maxval) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > maxval) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (un-normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0) - { printf ("\n\nLine %d: Clipping difference (%e) too large (un-normalised).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - printf ("ok\n") ; - unlink (filename) ; -} /* dbl_scale_clip_test_08 */ - - - - -/*============================================================================== -*/ - - -static void flt_short_clip_read_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - float *data_out ; - short *data_in, max_value ; - int k ; - - print_test_name ("flt_short_clip_read_test", filename) ; - - data_out = buffer_out.flt ; - data_in = buffer_in.s ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - data_out [k] = 0.995 * sin (4 * M_PI * k / BUFFER_SIZE) ; - data_out [BUFFER_SIZE / 8] = 1.0 ; - data_out [3 * BUFFER_SIZE / 8] = -1.000000001 ; - data_out [5 * BUFFER_SIZE / 8] = 1.0 ; - data_out [7 * BUFFER_SIZE / 8] = -1.000000001 ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* Save unclipped data to the file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_float_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_read_short_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - /*-sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ;-*/ - sf_close (file) ; - - /* Check the first half. */ - max_value = 0 ; - for (k = 0 ; k < sfinfo.frames ; k++) - { /* Check if data_out has different sign from data_in. */ - if ((data_out [k] < 0.0 && data_in [k] > 0) || (data_out [k] > 0.0 && data_in [k] < 0)) - { printf ("\n\nLine %d: Data wrap around at index %d/%d (%f -> %d).\n\n", __LINE__, k, BUFFER_SIZE, data_out [k], data_in [k]) ; - exit (1) ; - } ; - max_value = (max_value > abs (data_in [k])) ? max_value : abs (data_in [k]) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* flt_short_clip_read_test */ -static void flt_int_clip_read_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - float *data_out ; - int *data_in, max_value ; - int k ; - - print_test_name ("flt_int_clip_read_test", filename) ; - - data_out = buffer_out.flt ; - data_in = buffer_in.i ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - data_out [k] = 0.995 * sin (4 * M_PI * k / BUFFER_SIZE) ; - data_out [BUFFER_SIZE / 8] = 1.0 ; - data_out [3 * BUFFER_SIZE / 8] = -1.000000001 ; - data_out [5 * BUFFER_SIZE / 8] = 1.0 ; - data_out [7 * BUFFER_SIZE / 8] = -1.000000001 ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* Save unclipped data to the file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_float_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_read_int_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - /*-sf_command (file, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ;-*/ - sf_close (file) ; - - /* Check the first half. */ - max_value = 0 ; - for (k = 0 ; k < sfinfo.frames ; k++) - { /* Check if data_out has different sign from data_in. */ - if ((data_out [k] < 0.0 && data_in [k] > 0) || (data_out [k] > 0.0 && data_in [k] < 0)) - { printf ("\n\nLine %d: Data wrap around at index %d/%d (%f -> %d).\n\n", __LINE__, k, BUFFER_SIZE, data_out [k], data_in [k]) ; - exit (1) ; - } ; - max_value = (max_value > abs (data_in [k])) ? max_value : abs (data_in [k]) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* flt_int_clip_read_test */ - -static void dbl_short_clip_read_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - double *data_out ; - short *data_in, max_value ; - int k ; - - print_test_name ("dbl_short_clip_read_test", filename) ; - - data_out = buffer_out.dbl ; - data_in = buffer_in.s ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - data_out [k] = 0.995 * sin (4 * M_PI * k / BUFFER_SIZE) ; - data_out [BUFFER_SIZE / 8] = 1.0 ; - data_out [3 * BUFFER_SIZE / 8] = -1.000000001 ; - data_out [5 * BUFFER_SIZE / 8] = 1.0 ; - data_out [7 * BUFFER_SIZE / 8] = -1.000000001 ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* Save unclipped data to the file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_double_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_read_short_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - /*-sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ;-*/ - sf_close (file) ; - - /* Check the first half. */ - max_value = 0 ; - for (k = 0 ; k < sfinfo.frames ; k++) - { /* Check if data_out has different sign from data_in. */ - if ((data_out [k] < 0.0 && data_in [k] > 0) || (data_out [k] > 0.0 && data_in [k] < 0)) - { printf ("\n\nLine %d: Data wrap around at index %d/%d (%f -> %d).\n\n", __LINE__, k, BUFFER_SIZE, data_out [k], data_in [k]) ; - exit (1) ; - } ; - max_value = (max_value > abs (data_in [k])) ? max_value : abs (data_in [k]) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* dbl_short_clip_read_test */ -static void dbl_int_clip_read_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - double *data_out ; - int *data_in, max_value ; - int k ; - - print_test_name ("dbl_int_clip_read_test", filename) ; - - data_out = buffer_out.dbl ; - data_in = buffer_in.i ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - data_out [k] = 0.995 * sin (4 * M_PI * k / BUFFER_SIZE) ; - data_out [BUFFER_SIZE / 8] = 1.0 ; - data_out [3 * BUFFER_SIZE / 8] = -1.000000001 ; - data_out [5 * BUFFER_SIZE / 8] = 1.0 ; - data_out [7 * BUFFER_SIZE / 8] = -1.000000001 ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* Save unclipped data to the file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_double_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_read_int_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - /*-sf_command (file, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ;-*/ - sf_close (file) ; - - /* Check the first half. */ - max_value = 0 ; - for (k = 0 ; k < sfinfo.frames ; k++) - { /* Check if data_out has different sign from data_in. */ - if ((data_out [k] < 0.0 && data_in [k] > 0) || (data_out [k] > 0.0 && data_in [k] < 0)) - { printf ("\n\nLine %d: Data wrap around at index %d/%d (%f -> %d).\n\n", __LINE__, k, BUFFER_SIZE, data_out [k], data_in [k]) ; - exit (1) ; - } ; - max_value = (max_value > abs (data_in [k])) ? max_value : abs (data_in [k]) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* dbl_int_clip_read_test */ - - -/*============================================================================== -*/ - - -static void short_flt_scale_write_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - short *data_out ; - float *data_in, max_value ; - int k ; - - print_test_name ("short_flt_clip_write_test", filename) ; - - data_out = buffer_out.s ; - data_in = buffer_in.flt ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - data_out [k] = lrintf (0x7FFFF * 0.995 * sin (4 * M_PI * k / BUFFER_SIZE)) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_short_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_TRUE) ; - test_write_short_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_FALSE) ; - test_write_short_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != 3 * BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, 3 * BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - /* Check the first section. */ - test_read_float_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value < 1000.0) - { printf ("\n\nLine %d: Max value (%f) < 1000.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - /* Check the second section. */ - test_read_float_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value > 1.0) - { printf ("\n\nLine %d: Max value (%f) > 1.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - /* Check the third section. */ - test_read_float_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value < 1000.0) - { printf ("\n\nLine %d: Max value (%f) < 1000.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - puts ("ok") ; -} /* short_flt_scale_write_test */ -static void short_dbl_scale_write_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - short *data_out ; - double *data_in, max_value ; - int k ; - - print_test_name ("short_dbl_clip_write_test", filename) ; - - data_out = buffer_out.s ; - data_in = buffer_in.dbl ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - data_out [k] = lrint (0x7FFFF * 0.995 * sin (4 * M_PI * k / BUFFER_SIZE)) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_short_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_TRUE) ; - test_write_short_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_FALSE) ; - test_write_short_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != 3 * BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, 3 * BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - /* Check the first section. */ - test_read_double_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value < 1000.0) - { printf ("\n\nLine %d: Max value (%f) < 1000.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - /* Check the second section. */ - test_read_double_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value > 1.0) - { printf ("\n\nLine %d: Max value (%f) > 1.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - /* Check the third section. */ - test_read_double_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value < 1000.0) - { printf ("\n\nLine %d: Max value (%f) < 1000.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - puts ("ok") ; -} /* short_dbl_scale_write_test */ - -static void int_flt_scale_write_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int *data_out ; - float *data_in, max_value ; - int k ; - - print_test_name ("int_flt_clip_write_test", filename) ; - - data_out = buffer_out.i ; - data_in = buffer_in.flt ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - data_out [k] = lrintf (0x7FFFFFFF * 0.995 * sin (4 * M_PI * k / BUFFER_SIZE)) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_int_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_TRUE) ; - test_write_int_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_FALSE) ; - test_write_int_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != 3 * BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, 3 * BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - /* Check the first section. */ - test_read_float_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value < 1000.0) - { printf ("\n\nLine %d: Max value (%f) < 1000.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - /* Check the second section. */ - test_read_float_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value > 1.0) - { printf ("\n\nLine %d: Max value (%f) > 1.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - /* Check the third section. */ - test_read_float_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value < 1000.0) - { printf ("\n\nLine %d: Max value (%f) < 1000.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - puts ("ok") ; -} /* int_flt_scale_write_test */ -static void int_dbl_scale_write_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int *data_out ; - double *data_in, max_value ; - int k ; - - print_test_name ("int_dbl_clip_write_test", filename) ; - - data_out = buffer_out.i ; - data_in = buffer_in.dbl ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - data_out [k] = lrint (0x7FFFFFFF * 0.995 * sin (4 * M_PI * k / BUFFER_SIZE)) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_int_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_TRUE) ; - test_write_int_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_FALSE) ; - test_write_int_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != 3 * BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %ld).\n\n", __LINE__, 3 * BUFFER_SIZE, SF_COUNT_TO_LONG (sfinfo.frames)) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - /* Check the first section. */ - test_read_double_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value < 1000.0) - { printf ("\n\nLine %d: Max value (%f) < 1000.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - /* Check the second section. */ - test_read_double_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value > 1.0) - { printf ("\n\nLine %d: Max value (%f) > 1.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - /* Check the third section. */ - test_read_double_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value < 1000.0) - { printf ("\n\nLine %d: Max value (%f) < 1000.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - puts ("ok") ; -} /* int_dbl_scale_write_test */ - - - diff --git a/libs/libsndfile/tests/scale_clip_test.def b/libs/libsndfile/tests/scale_clip_test.def deleted file mode 100644 index 345981912b..0000000000 --- a/libs/libsndfile/tests/scale_clip_test.def +++ /dev/null @@ -1,56 +0,0 @@ -autogen definitions scale_clip_test.tpl; - -float_type = { - float_type_name = "float" ; - float_short_name = "flt" ; - float_upper_name = "FLOAT" ; - float_to_int = "lrintf" ; - } ; - -float_type = { - float_type_name = "double" ; - float_short_name = "dbl" ; - float_upper_name = "DOUBLE" ; - float_to_int = "lrint" ; - } ; - - - -int_type = { - int_type_name = "short" ; - int_short_name = "s" ; - int_max_value = 0x7FFFF ; - } ; - -int_type = { - int_type_name = "int" ; - int_short_name = "i" ; - int_max_value = 0x7FFFFFFF ; - } ; - - - -data_type = { - name = "16" ; - bit_count = 16 ; - error_val = "1.0 / 0x8000" ; - } ; - -data_type = { - name = "24" ; - bit_count = 24 ; - error_val = "1.0 / 0x800000" ; - } ; - -data_type = { - name = "32" ; - bit_count = 32 ; - error_val = "1.0 / 0x80000000" ; - } ; - -data_type = { - name = "08" ; - bit_count = 8 ; - error_val = "1.0 / 0x80" ; - } ; - diff --git a/libs/libsndfile/tests/scale_clip_test.tpl b/libs/libsndfile/tests/scale_clip_test.tpl deleted file mode 100644 index 39ddf57c1f..0000000000 --- a/libs/libsndfile/tests/scale_clip_test.tpl +++ /dev/null @@ -1,438 +0,0 @@ -[+ AutoGen5 template c +] -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -#define HALF_BUFFER_SIZE (1 << 12) -#define BUFFER_SIZE (2 * HALF_BUFFER_SIZE) - -#define SINE_AMP 1.1 -#define MAX_ERROR 0.0202 - -[+ FOR float_type +] -[+ FOR data_type -+]static void [+ (get "float_short_name") +]_scale_clip_test_[+ (get "name") +] (const char *filename, int filetype, float maxval) ; -[+ ENDFOR data_type -+][+ ENDFOR float_type +] - -[+ FOR float_type +] -[+ FOR int_type -+]static void [+ (get "float_short_name") +]_[+ (get "int_type_name") +]_clip_read_test (const char *filename, int filetype) ; -[+ ENDFOR int_type -+][+ ENDFOR float_type +] - -[+ FOR int_type +] -[+ FOR float_type -+]static void [+ (get "int_type_name") +]_[+ (get "float_short_name") +]_scale_write_test (const char *filename, int filetype) ; -[+ ENDFOR float_type -+][+ ENDFOR int_type +] - -typedef union -{ double dbl [BUFFER_SIZE] ; - float flt [BUFFER_SIZE] ; - int i [BUFFER_SIZE] ; - short s [BUFFER_SIZE] ; -} BUFFER ; - -/* Data buffer. */ -static BUFFER buffer_out ; -static BUFFER buffer_in ; - -int -main (void) -{ - flt_scale_clip_test_08 ("scale_clip_s8.au", SF_FORMAT_AU | SF_FORMAT_PCM_S8, 1.0 * 0x80) ; - flt_scale_clip_test_08 ("scale_clip_u8.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_U8, 1.0 * 0x80) ; - - dbl_scale_clip_test_08 ("scale_clip_s8.au", SF_FORMAT_AU | SF_FORMAT_PCM_S8, 1.0 * 0x80) ; - dbl_scale_clip_test_08 ("scale_clip_u8.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_U8, 1.0 * 0x80) ; - - /* - ** Now use SF_FORMAT_AU where possible because it allows both - ** big and little endian files. - */ - - flt_scale_clip_test_16 ("scale_clip_be16.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_16, 1.0 * 0x8000) ; - flt_scale_clip_test_16 ("scale_clip_le16.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_16, 1.0 * 0x8000) ; - flt_scale_clip_test_24 ("scale_clip_be24.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_24, 1.0 * 0x800000) ; - flt_scale_clip_test_24 ("scale_clip_le24.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_24, 1.0 * 0x800000) ; - flt_scale_clip_test_32 ("scale_clip_be32.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_32, 1.0 * 0x80000000) ; - flt_scale_clip_test_32 ("scale_clip_le32.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_32, 1.0 * 0x80000000) ; - - dbl_scale_clip_test_16 ("scale_clip_be16.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_16, 1.0 * 0x8000) ; - dbl_scale_clip_test_16 ("scale_clip_le16.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_16, 1.0 * 0x8000) ; - dbl_scale_clip_test_24 ("scale_clip_be24.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_24, 1.0 * 0x800000) ; - dbl_scale_clip_test_24 ("scale_clip_le24.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_24, 1.0 * 0x800000) ; - dbl_scale_clip_test_32 ("scale_clip_be32.au", SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_PCM_32, 1.0 * 0x80000000) ; - dbl_scale_clip_test_32 ("scale_clip_le32.au", SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_32, 1.0 * 0x80000000) ; - - flt_short_clip_read_test ("flt_short.au" , SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_FLOAT) ; - flt_int_clip_read_test ("flt_int.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_FLOAT) ; - dbl_short_clip_read_test ("dbl_short.au" , SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_DOUBLE) ; - dbl_int_clip_read_test ("dbl_int.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_DOUBLE) ; - - short_flt_scale_write_test ("short_flt.au" , SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_FLOAT) ; - int_flt_scale_write_test ("int_flt.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_FLOAT) ; - short_dbl_scale_write_test ("short_dbl.au" , SF_ENDIAN_BIG | SF_FORMAT_AU | SF_FORMAT_DOUBLE) ; - int_dbl_scale_write_test ("int_dbl.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_DOUBLE) ; - - return 0 ; -} /* main */ - -/*============================================================================================ -** Here are the test functions. -*/ - -[+ FOR float_type +] -[+ FOR data_type -+]static void -[+ (get "float_short_name") +]_scale_clip_test_[+ (get "name") +] (const char *filename, int filetype, float maxval) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k ; - [+ (get "float_type_name") +] *data_out, *data_in ; - double diff, clip_max_diff ; - - print_test_name ("[+ (get "float_short_name") +]_scale_clip_test_[+ (get "name") +]", filename) ; - - data_out = buffer_out.[+ (get "float_short_name") +] ; - data_in = buffer_in.[+ (get "float_short_name") +] ; - - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { data_out [k] = 1.2 * sin (2 * M_PI * k / HALF_BUFFER_SIZE) ; - data_out [k + HALF_BUFFER_SIZE] = data_out [k] * maxval ; - } ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* - ** Write two versions of the data: - ** normalized and clipped - ** un-normalized and clipped. - */ - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_write_[+ (get "float_type_name") +]_or_die (file, 0, data_out, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_[+ (get "float_upper_name") +], NULL, SF_FALSE) ; - test_write_[+ (get "float_type_name") +]_or_die (file, 0, data_out + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&buffer_in, 0, sizeof (buffer_in)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %" PRId64 ").\n\n", __LINE__, BUFFER_SIZE, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_[+ (get "float_type_name") +]_or_die (file, 0, data_in, HALF_BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_NORM_[+ (get "float_upper_name") +], NULL, SF_FALSE) ; - test_read_[+ (get "float_type_name") +]_or_die (file, 0, data_in + HALF_BUFFER_SIZE, HALF_BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - /* Check normalized version. */ - clip_max_diff = 0.0 ; - for (k = 0 ; k < HALF_BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > 1.0) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > 1.0) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > [+ (get "error_val") +]) - { printf ("\n\nLine %d: Clipping difference (%e) too large (normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - /* Check the un-normalized data. */ - clip_max_diff = 0.0 ; - for (k = HALF_BUFFER_SIZE ; k < BUFFER_SIZE ; k++) - { if (fabs (data_in [k]) > maxval) - { printf ("\n\nLine %d: Input sample %d/%d (%f) has not been clipped.\n\n", __LINE__, k, BUFFER_SIZE, data_in [k]) ; - exit (1) ; - } ; - - if (data_out [k] * data_in [k] < 0.0) - { printf ("\n\nLine %d: Data wrap around at index %d/%d.\n\n", __LINE__, k, BUFFER_SIZE) ; - exit (1) ; - } ; - - if (fabs (data_out [k]) > maxval) - continue ; - - diff = fabs (data_out [k] - data_in [k]) ; - if (diff > clip_max_diff) - clip_max_diff = diff ; - } ; - - if (clip_max_diff < 1e-20) - { printf ("\n\nLine %d: Clipping difference (%e) too small (un-normalized).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - if (clip_max_diff > 1.0) - { printf ("\n\nLine %d: Clipping difference (%e) too large (un-normalised).\n\n", __LINE__, clip_max_diff) ; - exit (1) ; - } ; - - printf ("ok\n") ; - unlink (filename) ; -} /* [+ (get "float_short_name") +]_scale_clip_test_[+ (get "name") +] */ - -[+ ENDFOR data_type -+] -[+ ENDFOR float_type +] - -/*============================================================================== -*/ - -[+ FOR float_type +] -[+ FOR int_type -+]static void [+ (get "float_short_name") +]_[+ (get "int_type_name") +]_clip_read_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - [+ (get "float_type_name") +] *data_out ; - [+ (get "int_type_name") +] *data_in, max_value ; - int k ; - - print_test_name ("[+ (get "float_short_name") +]_[+ (get "int_type_name") +]_clip_read_test", filename) ; - - data_out = buffer_out.[+ (get "float_short_name") +] ; - data_in = buffer_in.[+ (get "int_short_name") +] ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - data_out [k] = 0.995 * sin (4 * M_PI * k / BUFFER_SIZE) ; - data_out [BUFFER_SIZE / 8] = 1.0 ; - data_out [3 * BUFFER_SIZE / 8] = -1.000000001 ; - data_out [5 * BUFFER_SIZE / 8] = 1.0 ; - data_out [7 * BUFFER_SIZE / 8] = -1.000000001 ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - /* Save unclipped data to the file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_[+ (get "float_type_name") +]_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_FLOAT_INT_READ, NULL, SF_TRUE) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %" PRId64 ").\n\n", __LINE__, BUFFER_SIZE, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - sf_command (file, SFC_SET_CLIPPING, NULL, SF_TRUE) ; - test_read_[+ (get "int_type_name") +]_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - /*-sf_command (file, SFC_SET_NORM_[+ (get "float_upper_name") +], NULL, SF_FALSE) ;-*/ - sf_close (file) ; - - /* Check the first half. */ - max_value = 0 ; - for (k = 0 ; k < sfinfo.frames ; k++) - { /* Check if data_out has different sign from data_in. */ - if ((data_out [k] < 0.0 && data_in [k] > 0) || (data_out [k] > 0.0 && data_in [k] < 0)) - { printf ("\n\nLine %d: Data wrap around at index %d/%d (%f -> %d).\n\n", __LINE__, k, BUFFER_SIZE, data_out [k], data_in [k]) ; - exit (1) ; - } ; - max_value = (max_value > abs (data_in [k])) ? max_value : abs (data_in [k]) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* [+ (get "float_short_name") +]_[+ (get "int_type_name") +]_clip_read_test */ -[+ ENDFOR int_type -+][+ ENDFOR float_type +] - -/*============================================================================== -*/ - -[+ FOR int_type +] -[+ FOR float_type -+]static void [+ (get "int_type_name") +]_[+ (get "float_short_name") +]_scale_write_test (const char *filename, int filetype) -{ SNDFILE *file ; - SF_INFO sfinfo ; - [+ (get "int_type_name") +] *data_out ; - [+ (get "float_type_name") +] *data_in, max_value ; - int k ; - - print_test_name ("[+ (get "int_type_name") +]_[+ (get "float_short_name") +]_clip_write_test", filename) ; - - data_out = buffer_out.[+ (get "int_short_name") +] ; - data_in = buffer_in.[+ (get "float_short_name") +] ; - - for (k = 0 ; k < BUFFER_SIZE ; k++) - data_out [k] = [+ (get "float_to_int") +] ([+ (get "int_max_value") +] * 0.995 * sin (4 * M_PI * k / BUFFER_SIZE)) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.frames = 123456789 ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = filetype ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_[+ (get "int_type_name") +]_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_TRUE) ; - test_write_[+ (get "int_type_name") +]_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_command (file, SFC_SET_SCALE_INT_FLOAT_WRITE, NULL, SF_FALSE) ; - test_write_[+ (get "int_type_name") +]_or_die (file, 0, data_out, BUFFER_SIZE, __LINE__) ; - sf_close (file) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - sfinfo.format &= (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK) ; - - if (sfinfo.format != (filetype & (SF_FORMAT_TYPEMASK | SF_FORMAT_SUBMASK))) - { printf ("\n\nLine %d: Returned format incorrect (0x%08X => 0x%08X).\n\n", __LINE__, filetype, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames != 3 * BUFFER_SIZE) - { printf ("\n\nLine %d: Incorrect number of frames in file (%d => %" PRId64 ").\n\n", __LINE__, 3 * BUFFER_SIZE, sfinfo.frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d: Incorrect number of channels in file.\n\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - /* Check the first section. */ - test_read_[+ (get "float_type_name") +]_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value < 1000.0) - { printf ("\n\nLine %d: Max value (%f) < 1000.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - /* Check the second section. */ - test_read_[+ (get "float_type_name") +]_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value > 1.0) - { printf ("\n\nLine %d: Max value (%f) > 1.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - /* Check the third section. */ - test_read_[+ (get "float_type_name") +]_or_die (file, 0, data_in, BUFFER_SIZE, __LINE__) ; - - max_value = 0.0 ; - for (k = 0 ; k < BUFFER_SIZE ; k++) - max_value = (max_value > fabs (data_in [k])) ? max_value : fabs (data_in [k]) ; - - if (max_value < 1000.0) - { printf ("\n\nLine %d: Max value (%f) < 1000.0.\n\n", __LINE__, max_value) ; - exit (1) ; - } ; - - sf_close (file) ; - - unlink (filename) ; - puts ("ok") ; -} /* [+ (get "int_type_name") +]_[+ (get "float_short_name") +]_scale_write_test */ -[+ ENDFOR float_type -+][+ ENDFOR int_type +] - - diff --git a/libs/libsndfile/tests/sftest.c b/libs/libsndfile/tests/sftest.c deleted file mode 100644 index 78a9f7faaf..0000000000 --- a/libs/libsndfile/tests/sftest.c +++ /dev/null @@ -1,65 +0,0 @@ -/* -** Copyright (C) 1999-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#define BUFFER_SIZE (1024) - - -static short buffer [BUFFER_SIZE] ; - -int -main (int argc, char *argv []) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int k, count, max = 0, total = 0 ; - - if (argc < 2) - { printf ("Expecting input file name.\n") ; - return 0 ; - } ; - - if (! (file = sf_open (argv [1], SFM_READ, &sfinfo))) - { printf ("sf_open_read failed with error : ") ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - while ((count = sf_read_short (file, buffer, BUFFER_SIZE))) - { for (k = 0 ; k < count ; k++) - if (abs (buffer [k]) > max) - max = abs (buffer [k]) ; - total += count ; - } ; - - printf ("Total : %d\n", total) ; - printf ("Maximun value : %d\n", max) ; - - sf_close (file) ; - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/tests/sfversion.c b/libs/libsndfile/tests/sfversion.c deleted file mode 100644 index c464f08647..0000000000 --- a/libs/libsndfile/tests/sfversion.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -** Copyright (C) 1999-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include - -#include - -#define BUFFER_SIZE (256) - - -int -main (void) -{ static char strbuffer [BUFFER_SIZE] ; - const char * ver ; - - sf_command (NULL, SFC_GET_LIB_VERSION, strbuffer, sizeof (strbuffer)) ; - ver = sf_version_string () ; - - if (strcmp (ver, strbuffer) != 0) - { printf ("Version mismatch : '%s' != '%s'\n\n", ver, strbuffer) ; - exit (1) ; - } ; - - printf ("%s", strbuffer) ; - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/tests/stdin_test.c b/libs/libsndfile/tests/stdin_test.c deleted file mode 100644 index a893915cce..0000000000 --- a/libs/libsndfile/tests/stdin_test.c +++ /dev/null @@ -1,204 +0,0 @@ -/* -** Copyright (C) 2001-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_LEN (1 << 16) - -static void stdin_test (int typemajor, int count) ; - -int -main (int argc, char *argv []) -{ int do_all = 0, test_count = 0 ; - - if (BUFFER_LEN < PIPE_TEST_LEN) - { fprintf (stderr, "Error : BUFFER_LEN < PIPE_TEST_LEN.\n\n") ; - exit (1) ; - } ; - - if (argc != 2) - { fprintf (stderr, "This program cannot be run by itself. It needs\n") ; - fprintf (stderr, "to be run from the stdio_test program.\n") ; - exit (1) ; - } ; - - do_all = ! strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "raw")) - { stdin_test (SF_FORMAT_RAW, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "wav")) - { stdin_test (SF_FORMAT_WAV, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { stdin_test (SF_FORMAT_AIFF, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "au")) - { stdin_test (SF_FORMAT_AU, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "paf")) - { stdin_test (SF_FORMAT_PAF, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "svx")) - { stdin_test (SF_FORMAT_SVX, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "nist")) - { stdin_test (SF_FORMAT_NIST, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "ircam")) - { stdin_test (SF_FORMAT_IRCAM, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "voc")) - { stdin_test (SF_FORMAT_VOC, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "w64")) - { stdin_test (SF_FORMAT_W64, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat4")) - { stdin_test (SF_FORMAT_MAT4, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat5")) - { stdin_test (SF_FORMAT_MAT5, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "pvf")) - { stdin_test (SF_FORMAT_PVF, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "htk")) - { stdin_test (SF_FORMAT_HTK, PIPE_TEST_LEN) ; - test_count++ ; - } ; - - if (test_count == 0) - { fprintf (stderr, "\n*****************************************\n") ; - fprintf (stderr, "* stdin_test : No '%s' test defined.\n", argv [1]) ; - fprintf (stderr, "*****************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - -static void -stdin_test (int typemajor, int count) -{ static short data [BUFFER_LEN] ; - - SNDFILE *file ; - SF_INFO sfinfo ; - int k, total, err ; - - if (typemajor == SF_FORMAT_RAW) - { sfinfo.samplerate = 44100 ; - sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16 ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - } - else - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - if ((file = sf_open_fd (STDIN_FILENO, SFM_READ, &sfinfo, SF_TRUE)) == NULL) - { fprintf (stderr, "sf_open_fd failed with error : ") ; - puts (sf_strerror (NULL)) ; - dump_log_buffer (NULL) ; - exit (1) ; - } ; - - err = sf_error (file) ; - if (err != SF_ERR_NO_ERROR) - { printf ("Line %d : unexpected error : %s\n", __LINE__, sf_error_number (err)) ; - exit (1) ; - } ; - - if ((sfinfo.format & SF_FORMAT_TYPEMASK) != typemajor) - { fprintf (stderr, "\n\nError : File type doesn't match.\n") ; - exit (1) ; - } ; - - if (sfinfo.samplerate != 44100) - { fprintf (stderr, "\n\nError : Sample rate (%d) should be 44100\n", sfinfo.samplerate) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { fprintf (stderr, "\n\nError : Channels (%d) should be 1\n", sfinfo.channels) ; - exit (1) ; - } ; - - if (sfinfo.frames < count) - { fprintf (stderr, "\n\nError : Sample count (%ld) should be %d\n", (long) sfinfo.frames, count) ; - exit (1) ; - } ; - - total = 0 ; - while ((k = sf_read_short (file, data + total, BUFFER_LEN - total)) > 0) - total += k ; - - if (total != count) - { fprintf (stderr, "\n\nError : Expected %d frames, read %d.\n", count, total) ; - exit (1) ; - } ; - - for (k = 0 ; k < total ; k++) - if (data [k] != PIPE_INDEX (k)) - { printf ("\n\nError : data [%d] == %d, should have been %d.\n\n", k, data [k], k) ; - exit (1) ; - } ; - - sf_close (file) ; - - return ; -} /* stdin_test */ - diff --git a/libs/libsndfile/tests/stdio_test.c b/libs/libsndfile/tests/stdio_test.c deleted file mode 100644 index 80a696cf53..0000000000 --- a/libs/libsndfile/tests/stdio_test.c +++ /dev/null @@ -1,153 +0,0 @@ -/* -** Copyright (C) 2001-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/*========================================================================== -** This is a test program which tests reading from stdin and writing to -** stdout. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include -#include - -#if HAVE_SYS_WAIT_H -#include -#endif - -#include "utils.h" - -/* EMX is OS/2. */ -#if (OS_IS_WIN32) || defined (__EMX__) - -int -main (void) -{ - puts (" stdio_test : this test doesn't work on win32.") ; - return 0 ; -} /* main */ - -#else - -#ifndef WIFEXITED -#define WIFEXITED(s) (((s) & 0xff) == 0) -#endif -#ifndef WEXITSTATUS -#define WEXITSTATUS(s) (((s) & 0xff00) >> 8) -#endif - - -static size_t file_length (const char *filename) ; -static int file_exists (const char *filename) ; -static void stdio_test (const char *filetype) ; - -static const char *filetypes [] = -{ "raw", "wav", "aiff", "au", "paf", "svx", "nist", "ircam", - "voc", "w64", "mat4", "mat5", "pvf", - NULL -} ; - -int -main (void) -{ int k ; - - if (file_exists ("libsndfile.spec.in")) - exit_if_true (chdir ("tests") != 0, "\n Error : chdir ('tests') failed.\n") ; - - for (k = 0 ; filetypes [k] ; k++) - stdio_test (filetypes [k]) ; - - return 0 ; -} /* main */ - - -static void -stdio_test (const char *filetype) -{ static char buffer [256] ; - - int file_size, retval ; - - print_test_name ("stdio_test", filetype) ; - - snprintf (buffer, sizeof (buffer), "./stdout_test %s > stdio.%s", filetype, filetype) ; - if ((retval = system (buffer))) - { retval = WIFEXITED (retval) ? WEXITSTATUS (retval) : 1 ; - printf ("%s : %s", buffer, (strerror (retval))) ; - exit (1) ; - } ; - - snprintf (buffer, sizeof (buffer), "stdio.%s", filetype) ; - if ((file_size = file_length (buffer)) < PIPE_TEST_LEN) - { printf ("\n Error : test file '%s' too small (%d).\n\n", buffer, file_size) ; - exit (1) ; - } ; - - snprintf (buffer, sizeof (buffer), "./stdin_test %s < stdio.%s", filetype, filetype) ; - if ((retval = system (buffer))) - { retval = WIFEXITED (retval) ? WEXITSTATUS (retval) : 1 ; - printf ("%s : %s", buffer, (strerror (retval))) ; - exit (1) ; - } ; - - snprintf (buffer, sizeof (buffer), "rm stdio.%s", filetype) ; - if ((retval = system (buffer))) - { retval = WIFEXITED (retval) ? WEXITSTATUS (retval) : 1 ; - printf ("%s : %s", buffer, (strerror (retval))) ; - exit (1) ; - } ; - - puts ("ok") ; - - return ; -} /* stdio_test */ - - - - -static size_t -file_length (const char *filename) -{ struct stat buf ; - - if (stat (filename, &buf)) - { perror (filename) ; - exit (1) ; - } ; - - return buf.st_size ; -} /* file_length */ - -static int -file_exists (const char *filename) -{ struct stat buf ; - - if (stat (filename, &buf)) - return 0 ; - - return 1 ; -} /* file_exists */ - -#endif - diff --git a/libs/libsndfile/tests/stdout_test.c b/libs/libsndfile/tests/stdout_test.c deleted file mode 100644 index 850718dc1b..0000000000 --- a/libs/libsndfile/tests/stdout_test.c +++ /dev/null @@ -1,161 +0,0 @@ -/* -** Copyright (C) 2001-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -static void stdout_test (int typemajor, int count) ; - -int -main (int argc, char *argv []) -{ int do_all, test_count = 0 ; - - if (argc != 2) - { fprintf (stderr, "This program cannot be run by itself. It needs\n") ; - fprintf (stderr, "to be run from the stdio_test program.\n") ; - exit (1) ; - } ; - - do_all = ! strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "raw")) - { stdout_test (SF_FORMAT_RAW, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "wav")) - { stdout_test (SF_FORMAT_WAV, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { stdout_test (SF_FORMAT_AIFF, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "au")) - { stdout_test (SF_FORMAT_AU, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "paf")) - { stdout_test (SF_FORMAT_PAF, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "svx")) - { stdout_test (SF_FORMAT_SVX, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "nist")) - { stdout_test (SF_FORMAT_NIST, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "ircam")) - { stdout_test (SF_FORMAT_IRCAM, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "voc")) - { stdout_test (SF_FORMAT_VOC, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "w64")) - { stdout_test (SF_FORMAT_W64, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat4")) - { stdout_test (SF_FORMAT_MAT4, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat5")) - { stdout_test (SF_FORMAT_MAT5, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (do_all || ! strcmp (argv [1], "pvf")) - { stdout_test (SF_FORMAT_PVF, PIPE_TEST_LEN) ; - test_count ++ ; - } ; - - if (test_count == 0) - { fprintf (stderr, "\n******************************************\n") ; - fprintf (stderr, "* stdout_test : No '%s' test defined.\n", argv [1]) ; - fprintf (stderr, "******************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - -static void -stdout_test (int typemajor, int count) -{ static short data [PIPE_TEST_LEN] ; - - SNDFILE *file ; - SF_INFO sfinfo ; - int k, total, this_write ; - - sfinfo.samplerate = 44100 ; - sfinfo.format = (typemajor | SF_FORMAT_PCM_16) ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - - /* Create some random data. */ - for (k = 0 ; k < PIPE_TEST_LEN ; k++) - data [k] = PIPE_INDEX (k) ; - - if ((file = sf_open ("-", SFM_WRITE, &sfinfo)) == NULL) - { fprintf (stderr, "sf_open_write failed with error : ") ; - fprintf (stderr, "%s\n", sf_strerror (NULL)) ; - exit (1) ; - } ; - - total = 0 ; - - while (total < count) - { this_write = (count - total > 1024) ? 1024 : count - total ; - if ((k = sf_write_short (file, data + total, this_write)) != this_write) - { fprintf (stderr, "sf_write_short # %d failed with short write (%d -> %d)\n", count, this_write, k) ; - exit (1) ; - } ; - total += k ; - } ; - - sf_close (file) ; - - return ; -} /* stdout_test */ - diff --git a/libs/libsndfile/tests/string_test.c b/libs/libsndfile/tests/string_test.c deleted file mode 100644 index eac716e8b2..0000000000 --- a/libs/libsndfile/tests/string_test.c +++ /dev/null @@ -1,795 +0,0 @@ -/* -** Copyright (C) 2003-2013 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_LEN (1 << 10) -#define LOG_BUFFER_SIZE 1024 - -static void string_start_test (const char *filename, int typemajor) ; -static void string_start_end_test (const char *filename, int typemajor) ; -static void string_multi_set_test (const char *filename, int typemajor) ; -static void string_rdwr_test (const char *filename, int typemajor) ; -static void string_short_rdwr_test (const char *filename, int typemajor) ; -static void string_rdwr_grow_test (const char *filename, int typemajor) ; -static void string_header_update (const char *filename, int typemajor) ; - -static void software_string_test (const char *filename) ; - -static int str_count (const char * haystack, const char * needle) ; - -int -main (int argc, char *argv []) -{ int do_all = 0 ; - int test_count = 0 ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" wav - test adding strings to WAV files\n") ; - printf (" aiff - test adding strings to AIFF files\n") ; - printf (" flac - test adding strings to FLAC files\n") ; - printf (" ogg - test adding strings to OGG files\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all = ! strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "wav")) - { string_start_end_test ("strings.wav", SF_FORMAT_WAV) ; - string_multi_set_test ("multi.wav", SF_FORMAT_WAV) ; - string_rdwr_test ("rdwr.wav", SF_FORMAT_WAV) ; - string_short_rdwr_test ("short_rdwr.wav", SF_FORMAT_WAV) ; - string_rdwr_grow_test ("rdwr_grow.wav", SF_FORMAT_WAV) ; - string_header_update ("header_update.wav", SF_FORMAT_WAV) ; - - string_start_end_test ("strings.wavex", SF_FORMAT_WAVEX) ; - string_multi_set_test ("multi.wavex", SF_FORMAT_WAVEX) ; - string_rdwr_test ("rdwr.wavex", SF_FORMAT_WAVEX) ; - string_short_rdwr_test ("short_rdwr.wavex", SF_FORMAT_WAVEX) ; - - string_start_end_test ("strings.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV) ; - string_multi_set_test ("multi.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV) ; - string_rdwr_test ("rdwr.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV) ; - string_short_rdwr_test ("short_rdwr.rifx", SF_ENDIAN_BIG | SF_FORMAT_WAV) ; - - software_string_test ("software_string.wav") ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { string_start_end_test ("strings.aiff", SF_FORMAT_AIFF) ; - /* - TODO : Fix src/aiff.c so these tests pass. - string_multi_set_test ("multi.aiff", SF_FORMAT_AIFF) ; - string_rdwr_test ("rdwr.aiff", SF_FORMAT_AIFF) ; - string_short_rdwr_test ("short_rdwr.aiff", SF_FORMAT_AIFF) ; - string_rdwr_grow_test ("rdwr_grow.aiff", SF_FORMAT_AIFF) ; - string_header_update ("header_update.aiff", SF_FORMAT_AIFF) ; - */ - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "flac")) - { if (HAVE_EXTERNAL_LIBS) - string_start_test ("strings.flac", SF_FORMAT_FLAC) ; - else - puts (" No FLAC tests because FLAC support was not compiled in.") ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "ogg")) - { if (HAVE_EXTERNAL_LIBS) - string_start_test ("vorbis.oga", SF_FORMAT_OGG) ; - else - puts (" No Ogg/Vorbis tests because Ogg/Vorbis support was not compiled in.") ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "rf64")) - { puts ("\n\n **** String test not working yet for RF64 format. ****\n") ; - /* - string_start_end_test ("strings.rf64", SF_FORMAT_RF64) ; - string_multi_set_test ("multi.rf64", SF_FORMAT_RF64) ; - string_rdwr_test ("rdwr.rf64", SF_FORMAT_RF64) ; - string_short_rdwr_test ("short_rdwr.rf64", SF_FORMAT_RF64) ; - */ - test_count++ ; - } ; - - if (test_count == 0) - { printf ("Mono : ************************************\n") ; - printf ("Mono : * No '%s' test defined.\n", argv [1]) ; - printf ("Mono : ************************************\n") ; - return 1 ; - } ; - - return 0 ; -} /* main */ - - -/*============================================================================================ -** Here are the test functions. -*/ - -static const char - software [] = "software (libsndfile-X.Y.Z)", - artist [] = "The Artist", - copyright [] = "Copyright (c) 2001 Artist", - comment [] = "Comment goes here!!!", - date [] = "2001/01/27", - album [] = "The Album", - license [] = "The license", - title [] = "This is the title", - long_title [] = "This is a very long and very boring title for this file", - long_artist [] = "The artist who kept on changing its name", - genre [] = "The genre", - trackno [] = "Track three" ; - - -static short data_out [BUFFER_LEN] ; - -static void -string_start_end_test (const char *filename, int typemajor) -{ const char *cptr ; - SNDFILE *file ; - SF_INFO sfinfo ; - int errors = 0 ; - - print_test_name ("string_start_end_test", filename) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - sfinfo.format = typemajor | SF_FORMAT_PCM_16 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - /* Write stuff at start of file. */ - sf_set_string (file, SF_STR_TITLE, filename) ; - sf_set_string (file, SF_STR_SOFTWARE, software) ; - sf_set_string (file, SF_STR_ARTIST, artist) ; - sf_set_string (file, SF_STR_GENRE, genre) ; - sf_set_string (file, SF_STR_TRACKNUMBER, trackno) ; - - /* Write data to file. */ - test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ; - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - /* Write more stuff at end of file. */ - sf_set_string (file, SF_STR_COPYRIGHT, copyright) ; - sf_set_string (file, SF_STR_COMMENT, comment) ; - sf_set_string (file, SF_STR_DATE, date) ; - sf_set_string (file, SF_STR_ALBUM, album) ; - sf_set_string (file, SF_STR_LICENSE, license) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - check_log_buffer_or_die (file, __LINE__) ; - - if (sfinfo.frames != BUFFER_LEN) - { printf ("***** Bad frame count %d (should be %d)\n\n", (int) sfinfo.frames, BUFFER_LEN) ; - errors ++ ; - } ; - - cptr = sf_get_string (file, SF_STR_TITLE) ; - if (cptr == NULL || strcmp (filename, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad filename : %s\n", cptr) ; - } ; - - cptr = sf_get_string (file, SF_STR_COPYRIGHT) ; - if (cptr == NULL || strcmp (copyright, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad copyright : %s\n", cptr) ; - } ; - - cptr = sf_get_string (file, SF_STR_SOFTWARE) ; - if (cptr == NULL || strstr (cptr, software) != cptr) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad software : %s\n", cptr) ; - } ; - - if (str_count (cptr, "libsndfile") != 1) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad software : %s\n", cptr) ; - } ; - - cptr = sf_get_string (file, SF_STR_ARTIST) ; - if (cptr == NULL || strcmp (artist, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad artist : %s\n", cptr) ; - } ; - - cptr = sf_get_string (file, SF_STR_COMMENT) ; - if (cptr == NULL || strcmp (comment, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad comment : %s\n", cptr) ; - } ; - - if (typemajor != SF_FORMAT_AIFF) - { cptr = sf_get_string (file, SF_STR_DATE) ; - if (cptr == NULL || strcmp (date, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad date : %s\n", cptr) ; - } ; - - cptr = sf_get_string (file, SF_STR_GENRE) ; - if (cptr == NULL || strcmp (genre, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad genre : %s\n", cptr) ; - } ; - } ; - - switch (typemajor) - { case SF_FORMAT_AIFF : - case SF_FORMAT_WAV : - case SF_FORMAT_WAVEX : - case SF_ENDIAN_BIG | SF_FORMAT_WAV : - break ; - - default : - cptr = sf_get_string (file, SF_STR_ALBUM) ; - if (cptr == NULL || strcmp (album, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad album : %s\n", cptr) ; - } ; - - cptr = sf_get_string (file, SF_STR_LICENSE) ; - if (cptr == NULL || strcmp (license, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad license : %s\n", cptr) ; - } ; - - cptr = sf_get_string (file, SF_STR_TRACKNUMBER) ; - if (cptr == NULL || strcmp (genre, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad track no. : %s\n", cptr) ; - } ; - break ; - } ; - - if (errors > 0) - { printf ("\n*** Error count : %d ***\n\n", errors) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - sf_close (file) ; - unlink (filename) ; - - puts ("ok") ; -} /* string_start_end_test */ - -static void -string_start_test (const char *filename, int typemajor) -{ const char *cptr ; - SNDFILE *file ; - SF_INFO sfinfo ; - int errors = 0 ; - - print_test_name ("string_start_test", filename) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - - switch (typemajor) - { case SF_FORMAT_OGG : - sfinfo.format = typemajor | SF_FORMAT_VORBIS ; - break ; - - default : - sfinfo.format = typemajor | SF_FORMAT_PCM_16 ; - break ; - } ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - /* Write stuff at start of file. */ - sf_set_string (file, SF_STR_TITLE, filename) ; - sf_set_string (file, SF_STR_SOFTWARE, software) ; - sf_set_string (file, SF_STR_ARTIST, artist) ; - sf_set_string (file, SF_STR_COPYRIGHT, copyright) ; - sf_set_string (file, SF_STR_COMMENT, comment) ; - sf_set_string (file, SF_STR_DATE, date) ; - sf_set_string (file, SF_STR_ALBUM, album) ; - sf_set_string (file, SF_STR_LICENSE, license) ; - - /* Write data to file. */ - test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - - check_log_buffer_or_die (file, __LINE__) ; - - if (sfinfo.frames != BUFFER_LEN) - { printf ("***** Bad frame count %d (should be %d)\n\n", (int) sfinfo.frames, BUFFER_LEN) ; - errors ++ ; - } ; - - cptr = sf_get_string (file, SF_STR_TITLE) ; - if (cptr == NULL || strcmp (filename, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad filename : %s\n", cptr) ; - } ; - - cptr = sf_get_string (file, SF_STR_COPYRIGHT) ; - if (cptr == NULL || strcmp (copyright, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad copyright : %s\n", cptr) ; - } ; - - cptr = sf_get_string (file, SF_STR_SOFTWARE) ; - if (cptr == NULL || strstr (cptr, software) != cptr) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad software : %s\n", cptr) ; - } ; - - if (str_count (cptr, "libsndfile") != 1) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad software : %s\n", cptr) ; - } ; - - cptr = sf_get_string (file, SF_STR_ARTIST) ; - if (cptr == NULL || strcmp (artist, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad artist : %s\n", cptr) ; - } ; - - cptr = sf_get_string (file, SF_STR_COMMENT) ; - if (cptr == NULL || strcmp (comment, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad comment : %s\n", cptr) ; - } ; - - if (typemajor != SF_FORMAT_AIFF) - { cptr = sf_get_string (file, SF_STR_DATE) ; - if (cptr == NULL || strcmp (date, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad date : %s\n", cptr) ; - } ; - } ; - - if (typemajor != SF_FORMAT_WAV && typemajor != SF_FORMAT_AIFF) - { cptr = sf_get_string (file, SF_STR_ALBUM) ; - if (cptr == NULL || strcmp (album, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad album : %s\n", cptr) ; - } ; - } ; - - if (typemajor != SF_FORMAT_WAV && typemajor != SF_FORMAT_AIFF) - { cptr = sf_get_string (file, SF_STR_LICENSE) ; - if (cptr == NULL || strcmp (license, cptr) != 0) - { if (errors++ == 0) - puts ("\n") ; - printf (" Bad license : %s\n", cptr) ; - } ; - } ; - - if (errors > 0) - { printf ("\n*** Error count : %d ***\n\n", errors) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - sf_close (file) ; - unlink (filename) ; - - puts ("ok") ; -} /* string_start_test */ - -static void -string_multi_set_test (const char *filename, int typemajor) -{ static const char - new_software [] = "new software (libsndfile-X.Y.Z)", - new_copyright [] = "Copyright (c) 2001 New Artist", - new_artist [] = "The New Artist", - new_title [] = "This is the new title" ; - - static char buffer [2048] ; - SNDFILE *file ; - SF_INFO sfinfo ; - int count ; - - print_test_name (__func__, filename) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.format = typemajor | SF_FORMAT_PCM_16 ; - sfinfo.samplerate = 44100 ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - - /* Write stuff at start of file. */ - sf_set_string (file, SF_STR_TITLE, title) ; - sf_set_string (file, SF_STR_SOFTWARE, software) ; - sf_set_string (file, SF_STR_ARTIST, artist) ; - - /* Write data to file. */ - test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ; - - /* Write it all again. */ - - sf_set_string (file, SF_STR_TITLE, new_title) ; - sf_set_string (file, SF_STR_SOFTWARE, new_software) ; - sf_set_string (file, SF_STR_ARTIST, new_artist) ; - - sf_set_string (file, SF_STR_COPYRIGHT, copyright) ; - sf_set_string (file, SF_STR_COMMENT, comment) ; - sf_set_string (file, SF_STR_DATE, date) ; - sf_set_string (file, SF_STR_ALBUM, album) ; - sf_set_string (file, SF_STR_LICENSE, license) ; - sf_set_string (file, SF_STR_COPYRIGHT, new_copyright) ; - sf_set_string (file, SF_STR_COMMENT, comment) ; - sf_set_string (file, SF_STR_DATE, date) ; - sf_set_string (file, SF_STR_ALBUM, album) ; - sf_set_string (file, SF_STR_LICENSE, license) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - sf_command (file, SFC_GET_LOG_INFO, buffer, sizeof (buffer)) ; - sf_close (file) ; - - count = str_count (buffer, new_title) ; - exit_if_true (count < 1, "\n\nLine %d : Could not find new_title in :\n%s\n", __LINE__, buffer) ; - exit_if_true (count > 1, "\n\nLine %d : new_title appears %d times in :\n\n%s\n", __LINE__, count, buffer) ; - - count = str_count (buffer, software) ; - exit_if_true (count < 1, "\n\nLine %d : Could not find new_software in :\n%s\n", __LINE__, buffer) ; - exit_if_true (count > 1, "\n\nLine %d : new_software appears %d times in :\n\n%s\n", __LINE__, count, buffer) ; - - count = str_count (buffer, new_artist) ; - exit_if_true (count < 1, "\n\nLine %d : Could not find new_artist in :\n%s\n", __LINE__, buffer) ; - exit_if_true (count > 1, "\n\nLine %d : new_artist appears %d times in :\n\n%s\n", __LINE__, count, buffer) ; - - count = str_count (buffer, new_copyright) ; - exit_if_true (count < 1, "\n\nLine %d : Could not find new_copyright in :\n%s\n", __LINE__, buffer) ; - exit_if_true (count > 1, "\n\nLine %d : new_copyright appears %d times in :\n\n%s\n", __LINE__, count, buffer) ; - - unlink (filename) ; - - puts ("ok") ; -} /* string_multi_set_test */ - -static void -string_rdwr_test (const char *filename, int typemajor) -{ SNDFILE *file ; - SF_INFO sfinfo ; - sf_count_t frames ; - const char * str ; - - print_test_name (__func__, filename) ; - create_short_sndfile (filename, typemajor | SF_FORMAT_PCM_16, 2) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_FALSE, __LINE__) ; - frames = sfinfo.frames ; - sf_set_string (file, SF_STR_TITLE, title) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - exit_if_true (frames != sfinfo.frames, "\n\nLine %d : Frame count %" PRId64 " should be %" PRId64 ".\n", __LINE__, sfinfo.frames, frames) ; - str = sf_get_string (file, SF_STR_TITLE) ; - exit_if_true (str == NULL, "\n\nLine %d : SF_STR_TITLE string is NULL.\n", __LINE__) ; - exit_if_true (strcmp (str, title) != 0, "\n\nLine %d : SF_STR_TITLE doesn't match what was written.\n", __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_FALSE, __LINE__) ; - frames = sfinfo.frames ; - sf_set_string (file, SF_STR_TITLE, title) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_FALSE, __LINE__) ; - str = sf_get_string (file, SF_STR_TITLE) ; - exit_if_true (str == NULL, "\n\nLine %d : SF_STR_TITLE string is NULL.\n", __LINE__) ; - sf_set_string (file, SF_STR_ARTIST, artist) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - str = sf_get_string (file, SF_STR_ARTIST) ; - exit_if_true (str == NULL, "\n\nLine %d : SF_STR_ARTIST string is NULL.\n", __LINE__) ; - exit_if_true (strcmp (str, artist) != 0, "\n\nLine %d : SF_STR_ARTIST doesn't match what was written.\n", __LINE__) ; - - str = sf_get_string (file, SF_STR_TITLE) ; - exit_if_true (str == NULL, "\n\nLine %d : SF_STR_TITLE string is NULL.\n", __LINE__) ; - exit_if_true (strcmp (str, title) != 0, "\n\nLine %d : SF_STR_TITLE doesn't match what was written.\n", __LINE__) ; - - exit_if_true (frames != sfinfo.frames, "\n\nLine %d : Frame count %" PRId64 " should be %" PRId64 ".\n", __LINE__, sfinfo.frames, frames) ; - - sf_close (file) ; - unlink (filename) ; - - puts ("ok") ; -} /* string_rdwr_test */ - -static void -string_short_rdwr_test (const char *filename, int typemajor) -{ SNDFILE *file ; - SF_INFO sfinfo ; - sf_count_t frames = BUFFER_LEN ; - const char * str ; - - print_test_name (__func__, filename) ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.format = typemajor | SF_FORMAT_PCM_16 ; - sfinfo.samplerate = 44100 ; - sfinfo.channels = 1 ; - sfinfo.frames = 0 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - - /* Write data to file. */ - test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ; - - sf_set_string (file, SF_STR_TITLE, long_title) ; - sf_set_string (file, SF_STR_ARTIST, long_artist) ; - sf_close (file) ; - - /* Open the file RDWR. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_FALSE, __LINE__) ; - exit_if_true (frames != sfinfo.frames, "\n\nLine %d : Frame count %" PRId64 " should be %" PRId64 ".\n", __LINE__, sfinfo.frames, frames) ; - str = sf_get_string (file, SF_STR_TITLE) ; - exit_if_true (str == NULL, "\n\nLine %d : SF_STR_TITLE string is NULL.\n", __LINE__) ; - exit_if_true (strcmp (str, long_title) != 0, "\n\nLine %d : SF_STR_TITLE doesn't match what was written.\n", __LINE__) ; - str = sf_get_string (file, SF_STR_ARTIST) ; - exit_if_true (str == NULL, "\n\nLine %d : SF_STR_TITLE string is NULL.\n", __LINE__) ; - exit_if_true (strcmp (str, long_artist) != 0, "\n\nLine %d : SF_STR_ARTIST doesn't match what was written.\n", __LINE__) ; - - /* Change title and artist. */ - sf_set_string (file, SF_STR_TITLE, title) ; - sf_set_string (file, SF_STR_ARTIST, artist) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - - check_log_buffer_or_die (file, __LINE__) ; - - str = sf_get_string (file, SF_STR_TITLE) ; - exit_if_true (str == NULL, "\n\nLine %d : SF_STR_TITLE string is NULL.\n", __LINE__) ; - exit_if_true (strcmp (str, title) != 0, "\n\nLine %d : SF_STR_TITLE doesn't match what was written.\n", __LINE__) ; - - str = sf_get_string (file, SF_STR_ARTIST) ; - exit_if_true (str == NULL, "\n\nLine %d : SF_STR_ARTIST string is NULL.\n", __LINE__) ; - exit_if_true (strcmp (str, artist) != 0, "\n\nLine %d : SF_STR_ARTIST doesn't match what was written.\n", __LINE__) ; - - sf_close (file) ; - unlink (filename) ; - - puts ("ok") ; -} /* string_short_rdwr_test */ - -static int -str_count (const char * haystack, const char * needle) -{ int count = 0 ; - - while ((haystack = strstr (haystack, needle)) != NULL) - { count ++ ; - haystack ++ ; - } ; - - return count ; -} /* str_count */ - -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - -static void -software_string_test (const char *filename) -{ size_t k ; - - print_test_name (__func__, filename) ; - - for (k = 0 ; k < 50 ; k++) - { const char *result ; - char sfname [64] = "" ; - SNDFILE *file ; - SF_INFO info ; - - sf_info_setup (&info, SF_FORMAT_WAV | SF_FORMAT_PCM_16, 44100, 1) ; - file = test_open_file_or_die (filename, SFM_WRITE, &info, SF_TRUE, __LINE__) ; - - snprintf (sfname, MIN (k, sizeof (sfname)), "%s", "abcdefghijklmnopqrestvwxyz0123456789abcdefghijklmnopqrestvwxyz") ; - - exit_if_true (sf_set_string (file, SF_STR_SOFTWARE, sfname), - "\n\nLine %d : sf_set_string (f, SF_STR_SOFTWARE, '%s') failed : %s\n", __LINE__, sfname, sf_strerror (file)) ; - - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &info, SF_TRUE, __LINE__) ; - result = sf_get_string (file, SF_STR_SOFTWARE) ; - - exit_if_true (result == NULL, "\n\nLine %d : sf_get_string (file, SF_STR_SOFTWARE) returned NULL.\n\n", __LINE__) ; - - exit_if_true (strstr (result, sfname) != result, - "\n\nLine %d : Can't fine string '%s' in '%s'\n\n", __LINE__, sfname, result) ; - sf_close (file) ; - } ; - - unlink (filename) ; - puts ("ok") ; -} /* software_string_test */ - - -static void -string_rdwr_grow_test (const char *filename, int typemajor) -{ SNDFILE *file ; - SF_INFO sfinfo ; - sf_count_t frames ; - const char * str ; - - print_test_name (__func__, filename) ; - - /* Create a file that contains some strings. Then open the file in RDWR mode and - grow the file by writing more audio data to it. Check that the audio data has - been added to the file, and that the strings are still there. */ - - /* Create a short file that contains a string. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.channels = 2 ; - sfinfo.frames = 0 ; - sfinfo.format = typemajor | SF_FORMAT_PCM_16 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - /* Write data to file. */ - test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ; - - /* Write some strings at end of file. */ - sf_set_string (file, SF_STR_TITLE , title) ; - sf_set_string (file, SF_STR_COMMENT, comment) ; - sf_close (file) ; - - - /* Now open file again in SFM_RDWR mode and write more audio data to it. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - /* Write more data to file. */ - test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ; - sf_close (file) ; - - - /* Now open file again. It should now contain two BUFFER_LEN's worth of frames and the strings. */ - frames = 2 * BUFFER_LEN / sfinfo.channels ; - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - exit_if_true (frames != sfinfo.frames, "\n\nLine %d : Frame count %" PRId64 " should be %" PRId64 ".\n", __LINE__, sfinfo.frames, frames) ; - - /* Check the strings */ - str = sf_get_string (file, SF_STR_TITLE) ; - exit_if_true (str == NULL, "\n\nLine %d : SF_STR_TITLE string is NULL.\n", __LINE__) ; - exit_if_true (strcmp (str, title) != 0, "\n\nLine %d : SF_STR_TITLE doesn't match what was written.\n", __LINE__) ; - - str = sf_get_string (file, SF_STR_COMMENT) ; - exit_if_true (str == NULL, "\n\nLine %d : SF_STR_COMMENT string is NULL.\n", __LINE__) ; - exit_if_true (strcmp (str, comment) != 0, "\n\nLine %d : SF_STR_COMMENT doesn't match what was written.\n", __LINE__) ; - - sf_close (file) ; - unlink (filename) ; - - puts ("ok") ; -} /* string_rdwr_grow_test */ - -static void -string_header_update (const char *filename, int typemajor) -{ SNDFILE *file , *file1 ; - SF_INFO sfinfo , sfinfo1 ; - sf_count_t frames ; - const char * str ; - const int GROW_BUFFER_AMOUNT = 4 ; /* this should be less than half the size of the string header */ - - print_test_name (__func__, filename) ; - - /* Create a short file. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.samplerate = 44100 ; - sfinfo.channels = 2 ; - sfinfo.frames = 0 ; - sfinfo.format = typemajor | SF_FORMAT_PCM_16 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - test_write_short_or_die (file, 0, data_out, BUFFER_LEN, __LINE__) ; - sf_set_string (file, SF_STR_TITLE, long_title) ; - sf_close (file) ; - - - /* Check that SFC_UPDATE_HEADER_NOW correctly calculates datalength. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - /* Write a very small amount of new audio data that doesn't completely overwrite the existing header. */ - test_write_short_or_die (file, 0, data_out, GROW_BUFFER_AMOUNT, __LINE__) ; - - /* Update the header without closing the file. */ - sf_command (file, SFC_UPDATE_HEADER_NOW, NULL, 0) ; - - /* The file should now contain BUFFER_LEN + GROW_BUFFER_AMOUNT frames. - Open a second handle to the file and check the reported length. */ - memset (&sfinfo1, 0, sizeof (sfinfo1)) ; - file1 = test_open_file_or_die (filename, SFM_READ, &sfinfo1, SF_TRUE, __LINE__) ; - - frames = (BUFFER_LEN + GROW_BUFFER_AMOUNT) / sfinfo.channels ; - exit_if_true (frames != sfinfo1.frames, "\n\nLine %d : Frame count %" PRId64 " should be %" PRId64 ".\n", __LINE__, sfinfo1.frames, frames) ; - - /* The strings are probably not readable by the second soundfile handle because write_tailer has not yet been called. - It's a design decision whether SFC_UPDATE_HEADER_NOW should write the tailer. I think it's fine that it doesn't. */ - - sf_close (file1) ; - sf_close (file) ; - - - /* Check that sf_close correctly calculates datalength. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, SF_TRUE, __LINE__) ; - /* Write a very small amount of new audio data that doesn't completely overwrite the existing header. */ - test_write_short_or_die (file, 0, data_out, GROW_BUFFER_AMOUNT, __LINE__) ; - sf_close (file) ; - - - /* Open file again and verify data and string. */ - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_TRUE, __LINE__) ; - frames = (BUFFER_LEN + 2*GROW_BUFFER_AMOUNT) / sfinfo.channels ; - exit_if_true (frames != sfinfo.frames, "\n\nLine %d : Frame count %" PRId64 " should be %" PRId64 ".\n", __LINE__, sfinfo.frames, frames) ; - str = sf_get_string (file, SF_STR_TITLE) ; - exit_if_true (str == NULL, "\n\nLine %d : SF_STR_TITLE string is NULL.\n", __LINE__) ; - exit_if_true (strcmp (str, long_title) != 0, "\n\nLine %d : SF_STR_TITLE doesn't match what was written.\n", __LINE__) ; - sf_close (file) ; - unlink (filename) ; - puts ("ok") ; -} /* string_header_update */ diff --git a/libs/libsndfile/tests/test_wrapper.sh.in b/libs/libsndfile/tests/test_wrapper.sh.in deleted file mode 100644 index daf030b05f..0000000000 --- a/libs/libsndfile/tests/test_wrapper.sh.in +++ /dev/null @@ -1,365 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2008-2013 Erik de Castro Lopo -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# * Neither the author nor the names of any contributors may be used -# to endorse or promote products derived from this software without -# specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -HOST_TRIPLET=@HOST_TRIPLET@ -PACKAGE_VERSION=@PACKAGE_VERSION@ -LIB_VERSION=`echo $PACKAGE_VERSION | sed "s/[a-z].*//"` - -if test -f tests/sfversion@EXEEXT@ ; then - cd tests - fi - -if test ! -f sfversion@EXEEXT@ ; then - echo "Not able to find test executables." - exit 1 - fi - -if test -f libsndfile.so.$LIB_VERSION ; then - # This will work on Linux, but not on Mac. - # Windows is already sorted out. - export LD_LIBRARY_PATH=`pwd` - if test ! -f libsndfile.so.1 ; then - ln -s libsndfile.so.$LIB_VERSION libsndfile.so.1 - fi - fi - -sfversion=`./sfversion@EXEEXT@ | sed "s/-exp$//"` - -if test $sfversion != libsndfile-$PACKAGE_VERSION ; then - echo "Error : sfversion ($sfversion) and PACKAGE_VERSION ($PACKAGE_VERSION) don't match." - exit 1 - fi - -# Force exit on errors. -set -e - -# Generic-tests -uname -a - -# Check the header file. -sh pedantic-header-test.sh - -# Need this for when we're running from files collected into the -# libsndfile-testsuite-@PACKAGE_VERSION@ tarball. -if test -x test_main@EXEEXT@ ; then - echo "Running unit tests from src/ directory of source code tree." - ./test_main@EXEEXT@ - echo - echo "Running end-to-end tests from tests/ directory." - fi - -./error_test@EXEEXT@ -./pcm_test@EXEEXT@ -./ulaw_test@EXEEXT@ -./alaw_test@EXEEXT@ -./dwvw_test@EXEEXT@ -./command_test@EXEEXT@ ver -./command_test@EXEEXT@ norm -./command_test@EXEEXT@ format -./command_test@EXEEXT@ peak -./command_test@EXEEXT@ trunc -./command_test@EXEEXT@ inst -./command_test@EXEEXT@ current_sf_info -./command_test@EXEEXT@ bext -./command_test@EXEEXT@ bextch -./command_test@EXEEXT@ chanmap -./command_test@EXEEXT@ cart -./floating_point_test@EXEEXT@ -./checksum_test@EXEEXT@ -./scale_clip_test@EXEEXT@ -./headerless_test@EXEEXT@ -./rdwr_test@EXEEXT@ -./locale_test@EXEEXT@ -./win32_ordinal_test@EXEEXT@ -./external_libs_test@EXEEXT@ -./format_check_test@EXEEXT@ -./channel_test@EXEEXT@ - -# The w64 G++ compiler requires an extra runtime DLL which we don't have, -# so skip this test. -case "$HOST_TRIPLET" in - x86_64-w64-mingw32) - ;; - i686-w64-mingw32) - ;; - *) - ./cpp_test@EXEEXT@ - ;; - esac - -echo "----------------------------------------------------------------------" -echo " $sfversion passed common tests." -echo "----------------------------------------------------------------------" - -# aiff-tests -./write_read_test@EXEEXT@ aiff -./lossy_comp_test@EXEEXT@ aiff_ulaw -./lossy_comp_test@EXEEXT@ aiff_alaw -./lossy_comp_test@EXEEXT@ aiff_gsm610 -echo "==========================" -echo "./lossy_comp_test@EXEEXT@ aiff_ima" -echo "==========================" -./peak_chunk_test@EXEEXT@ aiff -./header_test@EXEEXT@ aiff -./misc_test@EXEEXT@ aiff -./string_test@EXEEXT@ aiff -./multi_file_test@EXEEXT@ aiff -./aiff_rw_test@EXEEXT@ -./chunk_test@EXEEXT@ aiff -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on AIFF files." -echo "----------------------------------------------------------------------" - -# au-tests -./write_read_test@EXEEXT@ au -./lossy_comp_test@EXEEXT@ au_ulaw -./lossy_comp_test@EXEEXT@ au_alaw -./lossy_comp_test@EXEEXT@ au_g721 -./lossy_comp_test@EXEEXT@ au_g723 -./header_test@EXEEXT@ au -./misc_test@EXEEXT@ au -./multi_file_test@EXEEXT@ au -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on AU files." -echo "----------------------------------------------------------------------" - -# caf-tests -./write_read_test@EXEEXT@ caf -./lossy_comp_test@EXEEXT@ caf_ulaw -./lossy_comp_test@EXEEXT@ caf_alaw -./header_test@EXEEXT@ caf -./peak_chunk_test@EXEEXT@ caf -./misc_test@EXEEXT@ caf -./chunk_test@EXEEXT@ caf -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on CAF files." -echo "----------------------------------------------------------------------" - -# wav-tests -./write_read_test@EXEEXT@ wav -./lossy_comp_test@EXEEXT@ wav_pcm -./lossy_comp_test@EXEEXT@ wav_ima -./lossy_comp_test@EXEEXT@ wav_msadpcm -./lossy_comp_test@EXEEXT@ wav_ulaw -./lossy_comp_test@EXEEXT@ wav_alaw -./lossy_comp_test@EXEEXT@ wav_gsm610 -./lossy_comp_test@EXEEXT@ wav_g721 -./peak_chunk_test@EXEEXT@ wav -./header_test@EXEEXT@ wav -./misc_test@EXEEXT@ wav -./string_test@EXEEXT@ wav -./multi_file_test@EXEEXT@ wav -./chunk_test@EXEEXT@ wav -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on WAV files." -echo "----------------------------------------------------------------------" - -# w64-tests -./write_read_test@EXEEXT@ w64 -./lossy_comp_test@EXEEXT@ w64_ima -./lossy_comp_test@EXEEXT@ w64_msadpcm -./lossy_comp_test@EXEEXT@ w64_ulaw -./lossy_comp_test@EXEEXT@ w64_alaw -./lossy_comp_test@EXEEXT@ w64_gsm610 -./header_test@EXEEXT@ w64 -./misc_test@EXEEXT@ w64 -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on W64 files." -echo "----------------------------------------------------------------------" - -# rf64-tests -./write_read_test@EXEEXT@ rf64 -./header_test@EXEEXT@ rf64 -./misc_test@EXEEXT@ rf64 -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on RF64 files." -echo "----------------------------------------------------------------------" - -# raw-tests -./write_read_test@EXEEXT@ raw -./lossy_comp_test@EXEEXT@ raw_ulaw -./lossy_comp_test@EXEEXT@ raw_alaw -./lossy_comp_test@EXEEXT@ raw_gsm610 -./lossy_comp_test@EXEEXT@ vox_adpcm -./raw_test@EXEEXT@ -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on RAW (header-less) files." -echo "----------------------------------------------------------------------" - -# paf-tests -./write_read_test@EXEEXT@ paf -./header_test@EXEEXT@ paf -./misc_test@EXEEXT@ paf -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on PAF files." -echo "----------------------------------------------------------------------" - -# svx-tests -./write_read_test@EXEEXT@ svx -./header_test@EXEEXT@ svx -./misc_test@EXEEXT@ svx -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on SVX files." -echo "----------------------------------------------------------------------" - -# nist-tests -./write_read_test@EXEEXT@ nist -./lossy_comp_test@EXEEXT@ nist_ulaw -./lossy_comp_test@EXEEXT@ nist_alaw -./header_test@EXEEXT@ nist -./misc_test@EXEEXT@ nist -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on NIST files." -echo "----------------------------------------------------------------------" - -# ircam-tests -./write_read_test@EXEEXT@ ircam -./lossy_comp_test@EXEEXT@ ircam_ulaw -./lossy_comp_test@EXEEXT@ ircam_alaw -./header_test@EXEEXT@ ircam -./misc_test@EXEEXT@ ircam -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on IRCAM files." -echo "----------------------------------------------------------------------" - -# voc-tests -./write_read_test@EXEEXT@ voc -./lossy_comp_test@EXEEXT@ voc_ulaw -./lossy_comp_test@EXEEXT@ voc_alaw -./header_test@EXEEXT@ voc -./misc_test@EXEEXT@ voc -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on VOC files." -echo "----------------------------------------------------------------------" - -# mat4-tests -./write_read_test@EXEEXT@ mat4 -./header_test@EXEEXT@ mat4 -./misc_test@EXEEXT@ mat4 -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on MAT4 files." -echo "----------------------------------------------------------------------" - -# mat5-tests -./write_read_test@EXEEXT@ mat5 -./header_test@EXEEXT@ mat5 -./misc_test@EXEEXT@ mat5 -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on MAT5 files." -echo "----------------------------------------------------------------------" - -# pvf-tests -./write_read_test@EXEEXT@ pvf -./header_test@EXEEXT@ pvf -./misc_test@EXEEXT@ pvf -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on PVF files." -echo "----------------------------------------------------------------------" - -# xi-tests -./lossy_comp_test@EXEEXT@ xi_dpcm -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on XI files." -echo "----------------------------------------------------------------------" - -# htk-tests -./write_read_test@EXEEXT@ htk -./header_test@EXEEXT@ htk -./misc_test@EXEEXT@ htk -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on HTK files." -echo "----------------------------------------------------------------------" - -# avr-tests -./write_read_test@EXEEXT@ avr -./header_test@EXEEXT@ avr -./misc_test@EXEEXT@ avr -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on AVR files." -echo "----------------------------------------------------------------------" - -# sds-tests -./write_read_test@EXEEXT@ sds -./header_test@EXEEXT@ sds -./misc_test@EXEEXT@ sds -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on SDS files." -echo "----------------------------------------------------------------------" - -# sd2-tests -./write_read_test@EXEEXT@ sd2 -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on SD2 files." -echo "----------------------------------------------------------------------" - -# wve-tests -./lossy_comp_test@EXEEXT@ wve -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on WVE files." -echo "----------------------------------------------------------------------" - -# mpc2k-tests -./write_read_test@EXEEXT@ mpc2k -./header_test@EXEEXT@ mpc2k -./misc_test@EXEEXT@ mpc2k -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on MPC 2000 files." -echo "----------------------------------------------------------------------" - -# flac-tests -./write_read_test@EXEEXT@ flac -./compression_size_test@EXEEXT@ flac -./string_test@EXEEXT@ flac -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on FLAC files." -echo "----------------------------------------------------------------------" - -# vorbis-tests -./ogg_test@EXEEXT@ -./compression_size_test@EXEEXT@ vorbis -./lossy_comp_test@EXEEXT@ ogg_vorbis -./string_test@EXEEXT@ ogg -./misc_test@EXEEXT@ ogg -echo "----------------------------------------------------------------------" -echo " $sfversion passed tests on OGG/VORBIS files." -echo "----------------------------------------------------------------------" - -# io-tests -./stdio_test@EXEEXT@ -./pipe_test@EXEEXT@ -./virtual_io_test@EXEEXT@ -echo "----------------------------------------------------------------------" -echo " $sfversion passed stdio/pipe/vio tests." -echo "----------------------------------------------------------------------" - - diff --git a/libs/libsndfile/tests/ulaw_test.c b/libs/libsndfile/tests/ulaw_test.c deleted file mode 100644 index fc0d497aa0..0000000000 --- a/libs/libsndfile/tests/ulaw_test.c +++ /dev/null @@ -1,257 +0,0 @@ -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" - -#define BUFFER_SIZE (65536) - -static unsigned char ulaw_encode (int sample) ; -static int ulaw_decode (unsigned int ulawbyte) ; - -static short short_buffer [BUFFER_SIZE] ; -static unsigned char ulaw_buffer [BUFFER_SIZE] ; - -int -main (void) -{ SNDFILE *file ; - SF_INFO sfinfo ; - const char *filename ; - int k ; - - print_test_name ("ulaw_test", "encoder") ; - - filename = "test.raw" ; - - sf_info_setup (&sfinfo, SF_FORMAT_RAW | SF_FORMAT_ULAW, 44100, 1) ; - - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("sf_open_write failed with error : ") ; - fflush (stdout) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - /* Generate a file containing all possible 16 bit sample values - ** and write it to disk as ulaw encoded.frames. - */ - - for (k = 0 ; k < 0x10000 ; k++) - short_buffer [k] = k & 0xFFFF ; - - sf_write_short (file, short_buffer, BUFFER_SIZE) ; - sf_close (file) ; - - /* Now open that file and compare the ulaw encoded sample values - ** with what they should be. - */ - - if ((file = sf_open (filename, SFM_READ, &sfinfo)) == NULL) - { printf ("sf_open_write failed with error : ") ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - if (sf_read_raw (file, ulaw_buffer, BUFFER_SIZE) != BUFFER_SIZE) - { printf ("sf_read_raw : ") ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - for (k = 0 ; k < 0x10000 ; k++) - if (ulaw_encode (short_buffer [k]) != ulaw_buffer [k]) - { printf ("Encoder error : sample #%d (0x%02X should be 0x%02X)\n", k, ulaw_buffer [k], ulaw_encode (short_buffer [k])) ; - exit (1) ; - } ; - - sf_close (file) ; - - puts ("ok") ; - - print_test_name ("ulaw_test", "decoder") ; - - /* Now generate a file containing all possible 8 bit encoded - ** sample values and write it to disk as ulaw encoded.frames. - */ - - if (! (file = sf_open (filename, SFM_WRITE, &sfinfo))) - { printf ("sf_open_write failed with error : ") ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - for (k = 0 ; k < 256 ; k++) - ulaw_buffer [k] = k & 0xFF ; - - sf_write_raw (file, ulaw_buffer, 256) ; - sf_close (file) ; - - /* Now open that file and compare the ulaw decoded sample values - ** with what they should be. - */ - - if (! (file = sf_open (filename, SFM_READ, &sfinfo))) - { printf ("sf_open_write failed with error : ") ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - if (sf_read_short (file, short_buffer, 256) != 256) - { printf ("sf_read_short : ") ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - - for (k = 0 ; k < 256 ; k++) - if (short_buffer [k] != ulaw_decode (ulaw_buffer [k])) - { printf ("Decoder error : sample #%d (0x%04X should be 0x%04X)\n", k, short_buffer [k], ulaw_decode (ulaw_buffer [k])) ; - exit (1) ; - } ; - - sf_close (file) ; - - puts ("ok") ; - - unlink (filename) ; - - return 0 ; -} /* main */ - - -/*================================================================================= -** The following routines came from the sox-12.15 (Sound eXcahcnge) distribution. -** -** This code is not compiled into libsndfile. It is only used to test the -** libsndfile lookup tables for correctness. -** -** I have included the original authors comments. -*/ - -/* -** This routine converts from linear to ulaw. -** -** Craig Reese: IDA/Supercomputing Research Center -** Joe Campbell: Department of Defense -** 29 September 1989 -** -** References: -** 1) CCITT Recommendation G.711 (very difficult to follow) -** 2) "A New Digital Technique for Implementation of Any -** Continuous PCM Companding Law," Villeret, Michel, -** et al. 1973 IEEE Int. Conf. on Communications, Vol 1, -** 1973, pg. 11.12-11.17 -** 3) MIL-STD-188-113,"Interoperability and Performance Standards -** for Analog-to_Digital Conversion Techniques," -** 17 February 1987 -** -** Input: Signed 16 bit linear sample -** Output: 8 bit ulaw sample -*/ - -#define uBIAS 0x84 /* define the add-in bias for 16 bit.frames */ -#define uCLIP 32635 - -static -unsigned char ulaw_encode (int sample) -{ static int exp_lut [256] = - { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 - } ; - - int sign, exponent, mantissa ; - unsigned char ulawbyte ; - - /* Get the sample into sign-magnitude. */ - sign = (sample >> 8) & 0x80 ; /* set aside the sign */ - if (sign != 0) - sample = -sample ; /* get magnitude */ - if (sample > uCLIP) - sample = uCLIP ; /* clip the magnitude */ - - /* Convert from 16 bit linear to ulaw. */ - sample = sample + uBIAS ; - exponent = exp_lut [(sample >> 7) & 0xFF] ; - mantissa = (sample >> (exponent + 3)) & 0x0F ; - ulawbyte = ~ (sign | (exponent << 4) | mantissa) ; - - return ulawbyte ; -} /* ulaw_encode */ - - -/* -** This routine converts from ulaw to 16 bit linear. -** -** Craig Reese: IDA/Supercomputing Research Center -** 29 September 1989 -** -** References: -** 1) CCITT Recommendation G.711 (very difficult to follow) -** 2) MIL-STD-188-113,"Interoperability and Performance Standards -** for Analog-to_Digital Conversion Techniques," -** 17 February 1987 -** -** Input: 8 bit ulaw sample -** Output: signed 16 bit linear sample -*/ - -static -int ulaw_decode (unsigned int ulawbyte) -{ static int exp_lut [8] = { 0, 132, 396, 924, 1980, 4092, 8316, 16764 } ; - int sign, exponent, mantissa, sample ; - - ulawbyte = ~ ulawbyte ; - sign = (ulawbyte & 0x80) ; - exponent = (ulawbyte >> 4) & 0x07 ; - mantissa = ulawbyte & 0x0F ; - sample = exp_lut [exponent] + (mantissa << (exponent + 3)) ; - if (sign != 0) - sample = -sample ; - - return sample ; -} /* ulaw_decode */ - diff --git a/libs/libsndfile/tests/utils.c b/libs/libsndfile/tests/utils.c deleted file mode 100644 index 882c969ab1..0000000000 --- a/libs/libsndfile/tests/utils.c +++ /dev/null @@ -1,1162 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** Utility functions to make writing the test suite easier. -** -** The .c and .h files were generated automagically with Autogen from -** the files utils.def and utils.tpl. -*/ - - - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include - -#include "utils.h" - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -#define LOG_BUFFER_SIZE 2048 - -/* -** Neat solution to the Win32/OS2 binary file flage requirement. -** If O_BINARY isn't already defined by the inclusion of the system -** headers, set it to zero. -*/ -#ifndef O_BINARY -#define O_BINARY 0 -#endif - - -void -gen_windowed_sine_float (float *data, int len, double maximum) -{ int k ; - - memset (data, 0, len * sizeof (float)) ; - /* - ** Choose a frequency of 1/32 so that it aligns perfectly with a DFT - ** bucket to minimise spreading of energy over more than one bucket. - ** Also do not want to make the frequency too high as some of the - ** codecs (ie gsm610) have a quite severe high frequency roll off. - */ - len /= 2 ; - - for (k = 0 ; k < len ; k++) - { data [k] = sin (2.0 * k * M_PI * 1.0 / 32.0 + 0.4) ; - - /* Apply Hanning Window. */ - data [k] *= maximum * (0.5 - 0.5 * cos (2.0 * M_PI * k / ((len) - 1))) ; - } - - return ; -} /* gen_windowed_sine_float */ - -void -gen_windowed_sine_double (double *data, int len, double maximum) -{ int k ; - - memset (data, 0, len * sizeof (double)) ; - /* - ** Choose a frequency of 1/32 so that it aligns perfectly with a DFT - ** bucket to minimise spreading of energy over more than one bucket. - ** Also do not want to make the frequency too high as some of the - ** codecs (ie gsm610) have a quite severe high frequency roll off. - */ - len /= 2 ; - - for (k = 0 ; k < len ; k++) - { data [k] = sin (2.0 * k * M_PI * 1.0 / 32.0 + 0.4) ; - - /* Apply Hanning Window. */ - data [k] *= maximum * (0.5 - 0.5 * cos (2.0 * M_PI * k / ((len) - 1))) ; - } - - return ; -} /* gen_windowed_sine_double */ - - -void -create_short_sndfile (const char *filename, int format, int channels) -{ short data [2 * 3 * 4 * 5 * 6 * 7] = { 0, } ; - SNDFILE *file ; - SF_INFO sfinfo ; - - sfinfo.samplerate = 44100 ; - sfinfo.channels = channels ; - sfinfo.format = format ; - - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("Error (%s, %d) : sf_open failed : %s\n", __FILE__, __LINE__, sf_strerror (file)) ; - exit (1) ; - } ; - - sf_write_short (file, data, ARRAY_LEN (data)) ; - - sf_close (file) ; -} /* create_short_sndfile */ - -void -check_file_hash_or_die (const char *filename, uint64_t target_hash, int line_num) -{ static unsigned char buf [4096] ; - uint64_t cksum ; - FILE *file ; - int k, read_count ; - - memset (buf, 0, sizeof (buf)) ; - - /* The 'b' in the mode string means binary for Win32. */ - if ((file = fopen (filename, "rb")) == NULL) - { printf ("\n\nLine %d: could not open file '%s'\n\n", line_num, filename) ; - exit (1) ; - } ; - - cksum = 0 ; - - while ((read_count = fread (buf, 1, sizeof (buf), file))) - for (k = 0 ; k < read_count ; k++) - cksum = cksum * 511 + buf [k] ; - - fclose (file) ; - - if (target_hash == 0) - { printf (" 0x%016" PRIx64 "\n", cksum) ; - return ; - } ; - - if (cksum != target_hash) - { printf ("\n\nLine %d: incorrect hash value 0x%016" PRIx64 " should be 0x%016" PRIx64 ".\n\n", line_num, cksum, target_hash) ; - exit (1) ; - } ; - - return ; -} /* check_file_hash_or_die */ - -void -print_test_name (const char *test, const char *filename) -{ int count ; - - if (test == NULL) - { printf (__FILE__ ": bad test of filename parameter.\n") ; - exit (1) ; - } ; - - if (filename == NULL || strlen (filename) == 0) - { printf (" %-30s : ", test) ; - count = 25 ; - } - else - { printf (" %-30s : %s ", test, filename) ; - count = 24 - strlen (filename) ; - } ; - - while (count -- > 0) - putchar ('.') ; - putchar (' ') ; - - fflush (stdout) ; -} /* print_test_name */ - -void -dump_data_to_file (const char *filename, const void *data, unsigned int datalen) -{ FILE *file ; - - if ((file = fopen (filename, "wb")) == NULL) - { printf ("\n\nLine %d : could not open file : %s\n\n", __LINE__, filename) ; - exit (1) ; - } ; - - if (fwrite (data, 1, datalen, file) != datalen) - { printf ("\n\nLine %d : fwrite failed.\n\n", __LINE__) ; - exit (1) ; - } ; - - fclose (file) ; - -} /* dump_data_to_file */ - -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -*/ - -static char octfilename [] = "error.dat" ; - -int -oct_save_short (const short *a, const short *b, int len) -{ FILE *file ; - int k ; - - if (! (file = fopen (octfilename, "w"))) - return 1 ; - - fprintf (file, "# Not created by Octave\n") ; - - fprintf (file, "# name: a\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, "% d" "\n", a [k]) ; - - fprintf (file, "# name: b\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, "% d" "\n", b [k]) ; - - fclose (file) ; - return 0 ; -} /* oct_save_short */ -int -oct_save_int (const int *a, const int *b, int len) -{ FILE *file ; - int k ; - - if (! (file = fopen (octfilename, "w"))) - return 1 ; - - fprintf (file, "# Not created by Octave\n") ; - - fprintf (file, "# name: a\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, "% d" "\n", a [k]) ; - - fprintf (file, "# name: b\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, "% d" "\n", b [k]) ; - - fclose (file) ; - return 0 ; -} /* oct_save_int */ -int -oct_save_float (const float *a, const float *b, int len) -{ FILE *file ; - int k ; - - if (! (file = fopen (octfilename, "w"))) - return 1 ; - - fprintf (file, "# Not created by Octave\n") ; - - fprintf (file, "# name: a\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, "% g" "\n", a [k]) ; - - fprintf (file, "# name: b\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, "% g" "\n", b [k]) ; - - fclose (file) ; - return 0 ; -} /* oct_save_float */ -int -oct_save_double (const double *a, const double *b, int len) -{ FILE *file ; - int k ; - - if (! (file = fopen (octfilename, "w"))) - return 1 ; - - fprintf (file, "# Not created by Octave\n") ; - - fprintf (file, "# name: a\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, "% g" "\n", a [k]) ; - - fprintf (file, "# name: b\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, "% g" "\n", b [k]) ; - - fclose (file) ; - return 0 ; -} /* oct_save_double */ - - -void -check_log_buffer_or_die (SNDFILE *file, int line_num) -{ static char buffer [LOG_BUFFER_SIZE] ; - int count ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Get the log buffer data. */ - count = sf_command (file, SFC_GET_LOG_INFO, buffer, LOG_BUFFER_SIZE) ; - - if (LOG_BUFFER_SIZE - count < 2) - { printf ("\n\nLine %d : Possible long log buffer.\n", line_num) ; - exit (1) ; - } - - /* Look for "Should" */ - if (strstr (buffer, "ould")) - { printf ("\n\nLine %d : Log buffer contains `ould'. Dumping.\n", line_num) ; - puts (buffer) ; - exit (1) ; - } ; - - /* Look for "**" */ - if (strstr (buffer, "*")) - { printf ("\n\nLine %d : Log buffer contains `*'. Dumping.\n", line_num) ; - puts (buffer) ; - exit (1) ; - } ; - - /* Look for "Should" */ - if (strstr (buffer, "nknown marker")) - { printf ("\n\nLine %d : Log buffer contains `nknown marker'. Dumping.\n", line_num) ; - puts (buffer) ; - exit (1) ; - } ; - - return ; -} /* check_log_buffer_or_die */ - -int -string_in_log_buffer (SNDFILE *file, const char *s) -{ static char buffer [LOG_BUFFER_SIZE] ; - int count ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Get the log buffer data. */ - count = sf_command (file, SFC_GET_LOG_INFO, buffer, LOG_BUFFER_SIZE) ; - - if (LOG_BUFFER_SIZE - count < 2) - { printf ("Possible long log buffer.\n") ; - exit (1) ; - } - - /* Look for string */ - return strstr (buffer, s) ? SF_TRUE : SF_FALSE ; -} /* string_in_log_buffer */ - -void -hexdump_file (const char * filename, sf_count_t offset, sf_count_t length) -{ - FILE * file ; - char buffer [16] ; - int k, m, ch, readcount ; - - if (length > 1000000) - { printf ("\n\nError : length (%ld) too long.\n\n", SF_COUNT_TO_LONG (offset)) ; - exit (1) ; - } ; - - if ((file = fopen (filename, "r")) == NULL) - { printf ("\n\nError : hexdump_file (%s) could not open file for read.\n\n", filename) ; - exit (1) ; - } ; - - if (fseek (file, offset, SEEK_SET) != 0) - { printf ("\n\nError : fseek(file, %ld, SEEK_SET) failed : %s\n\n", SF_COUNT_TO_LONG (offset), strerror (errno)) ; - exit (1) ; - } ; - - puts ("\n\n") ; - - for (k = 0 ; k < length ; k+= sizeof (buffer)) - { readcount = fread (buffer, 1, sizeof (buffer), file) ; - - printf ("%08lx : ", SF_COUNT_TO_LONG (offset + k)) ; - - for (m = 0 ; m < readcount ; m++) - printf ("%02x ", buffer [m] & 0xFF) ; - - for (m = readcount ; m < SIGNED_SIZEOF (buffer) ; m++) - printf (" ") ; - - printf (" ") ; - for (m = 0 ; m < readcount ; m++) - { ch = isprint (buffer [m]) ? buffer [m] : '.' ; - putchar (ch) ; - } ; - - if (readcount < SIGNED_SIZEOF (buffer)) - break ; - - putchar ('\n') ; - } ; - - puts ("\n") ; - - fclose (file) ; -} /* hexdump_file */ - -void -dump_log_buffer (SNDFILE *file) -{ static char buffer [LOG_BUFFER_SIZE] ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Get the log buffer data. */ - sf_command (file, SFC_GET_LOG_INFO, buffer, LOG_BUFFER_SIZE) ; - - if (strlen (buffer) < 1) - puts ("Log buffer empty.\n") ; - else - puts (buffer) ; - - return ; -} /* dump_log_buffer */ - -SNDFILE * -test_open_file_or_die (const char *filename, int mode, SF_INFO *sfinfo, int allow_fd, int line_num) -{ static int count = 0 ; - - SNDFILE *file ; - const char *modestr, *func_name ; - int oflags = 0, omode = 0, err ; - - /* - ** Need to test both sf_open() and sf_open_fd(). - ** Do so alternately. - */ - switch (mode) - { case SFM_READ : - modestr = "SFM_READ" ; - oflags = O_RDONLY | O_BINARY ; - omode = 0 ; - break ; - - case SFM_WRITE : - modestr = "SFM_WRITE" ; - oflags = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY ; - omode = S_IRUSR | S_IWUSR | S_IRGRP ; - break ; - - case SFM_RDWR : - modestr = "SFM_RDWR" ; - oflags = O_RDWR | O_CREAT | O_BINARY ; - omode = S_IRUSR | S_IWUSR | S_IRGRP ; - break ; - default : - printf ("\n\nLine %d: Bad mode.\n", line_num) ; - fflush (stdout) ; - exit (1) ; - } ; - - if (OS_IS_WIN32) - { /* Windows does not understand and ignores the S_IRGRP flag, but Wine - ** gives a run time warning message, so just clear it. - */ - omode &= ~S_IRGRP ; - } ; - - if (allow_fd && ((++count) & 1) == 1) - { int fd ; - - /* Only use the three argument open() function if omode != 0. */ - fd = (omode == 0) ? open (filename, oflags) : open (filename, oflags, omode) ; - - if (fd < 0) - { printf ("\n\n%s : open failed : %s\n", __func__, strerror (errno)) ; - exit (1) ; - } ; - - func_name = "sf_open_fd" ; - file = sf_open_fd (fd, mode, sfinfo, SF_TRUE) ; - } - else - { func_name = "sf_open" ; - file = sf_open (filename, mode, sfinfo) ; - } ; - - if (file == NULL) - { printf ("\n\nLine %d: %s (%s) failed : %s\n\n", line_num, func_name, modestr, sf_strerror (NULL)) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - err = sf_error (file) ; - if (err != SF_ERR_NO_ERROR) - { printf ("\n\nLine %d : sf_error : %s\n\n", line_num, sf_error_number (err)) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - return file ; -} /* test_open_file_or_die */ - -void -test_read_write_position_or_die (SNDFILE *file, int line_num, int pass, sf_count_t read_pos, sf_count_t write_pos) -{ sf_count_t pos ; - - /* Check the current read position. */ - if (read_pos >= 0 && (pos = sf_seek (file, 0, SEEK_CUR | SFM_READ)) != read_pos) - { printf ("\n\nLine %d ", line_num) ; - if (pass > 0) - printf ("(pass %d): ", pass) ; - printf ("Read position (%ld) should be %ld.\n", SF_COUNT_TO_LONG (pos), SF_COUNT_TO_LONG (read_pos)) ; - exit (1) ; - } ; - - /* Check the current write position. */ - if (write_pos >= 0 && (pos = sf_seek (file, 0, SEEK_CUR | SFM_WRITE)) != write_pos) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : Write position (%ld) should be %ld.\n", - SF_COUNT_TO_LONG (pos), SF_COUNT_TO_LONG (write_pos)) ; - exit (1) ; - } ; - - return ; -} /* test_read_write_position */ - -void -test_seek_or_die (SNDFILE *file, sf_count_t offset, int whence, sf_count_t new_pos, int channels, int line_num) -{ sf_count_t position ; - const char *channel_name, *whence_name ; - - switch (whence) - { case SEEK_SET : - whence_name = "SEEK_SET" ; - break ; - case SEEK_CUR : - whence_name = "SEEK_CUR" ; - break ; - case SEEK_END : - whence_name = "SEEK_END" ; - break ; - - /* SFM_READ */ - case SEEK_SET | SFM_READ : - whence_name = "SFM_READ | SEEK_SET" ; - break ; - case SEEK_CUR | SFM_READ : - whence_name = "SFM_READ | SEEK_CUR" ; - break ; - case SEEK_END | SFM_READ : - whence_name = "SFM_READ | SEEK_END" ; - break ; - - /* SFM_WRITE */ - case SEEK_SET | SFM_WRITE : - whence_name = "SFM_WRITE | SEEK_SET" ; - break ; - case SEEK_CUR | SFM_WRITE : - whence_name = "SFM_WRITE | SEEK_CUR" ; - break ; - case SEEK_END | SFM_WRITE : - whence_name = "SFM_WRITE | SEEK_END" ; - break ; - - default : - printf ("\n\nLine %d: bad whence parameter.\n", line_num) ; - exit (1) ; - } ; - - channel_name = (channels == 1) ? "Mono" : "Stereo" ; - - if ((position = sf_seek (file, offset, whence)) != new_pos) - { printf ("\n\nLine %d : %s : sf_seek (file, %ld, %s) returned %ld (should be %ld).\n\n", - line_num, channel_name, SF_COUNT_TO_LONG (offset), whence_name, - SF_COUNT_TO_LONG (position), SF_COUNT_TO_LONG (new_pos)) ; - exit (1) ; - } ; - -} /* test_seek_or_die */ - - - -void -test_read_short_or_die (SNDFILE *file, int pass, short *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_read_short (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_read_short failed with short read (%ld => %ld).\n", - SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_read_short_or_die */ - -void -test_read_int_or_die (SNDFILE *file, int pass, int *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_read_int (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_read_int failed with short read (%ld => %ld).\n", - SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_read_int_or_die */ - -void -test_read_float_or_die (SNDFILE *file, int pass, float *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_read_float (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_read_float failed with short read (%ld => %ld).\n", - SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_read_float_or_die */ - -void -test_read_double_or_die (SNDFILE *file, int pass, double *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_read_double (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_read_double failed with short read (%ld => %ld).\n", - SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_read_double_or_die */ - - -void -test_readf_short_or_die (SNDFILE *file, int pass, short *test, sf_count_t frames, int line_num) -{ sf_count_t count ; - - if ((count = sf_readf_short (file, test, frames)) != frames) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_readf_short failed with short readf (%ld => %ld).\n", - SF_COUNT_TO_LONG (frames), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_readf_short_or_die */ - -void -test_readf_int_or_die (SNDFILE *file, int pass, int *test, sf_count_t frames, int line_num) -{ sf_count_t count ; - - if ((count = sf_readf_int (file, test, frames)) != frames) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_readf_int failed with short readf (%ld => %ld).\n", - SF_COUNT_TO_LONG (frames), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_readf_int_or_die */ - -void -test_readf_float_or_die (SNDFILE *file, int pass, float *test, sf_count_t frames, int line_num) -{ sf_count_t count ; - - if ((count = sf_readf_float (file, test, frames)) != frames) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_readf_float failed with short readf (%ld => %ld).\n", - SF_COUNT_TO_LONG (frames), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_readf_float_or_die */ - -void -test_readf_double_or_die (SNDFILE *file, int pass, double *test, sf_count_t frames, int line_num) -{ sf_count_t count ; - - if ((count = sf_readf_double (file, test, frames)) != frames) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_readf_double failed with short readf (%ld => %ld).\n", - SF_COUNT_TO_LONG (frames), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_readf_double_or_die */ - - -void -test_read_raw_or_die (SNDFILE *file, int pass, void *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_read_raw (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_read_raw failed with short read (%ld => %ld).\n", - SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_read_raw_or_die */ - - - -void -test_write_short_or_die (SNDFILE *file, int pass, const short *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_write_short (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_write_short failed with short write (%ld => %ld).\n", - SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_write_short_or_die */ - -void -test_write_int_or_die (SNDFILE *file, int pass, const int *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_write_int (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_write_int failed with short write (%ld => %ld).\n", - SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_write_int_or_die */ - -void -test_write_float_or_die (SNDFILE *file, int pass, const float *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_write_float (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_write_float failed with short write (%ld => %ld).\n", - SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_write_float_or_die */ - -void -test_write_double_or_die (SNDFILE *file, int pass, const double *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_write_double (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_write_double failed with short write (%ld => %ld).\n", - SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_write_double_or_die */ - - -void -test_writef_short_or_die (SNDFILE *file, int pass, const short *test, sf_count_t frames, int line_num) -{ sf_count_t count ; - - if ((count = sf_writef_short (file, test, frames)) != frames) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_writef_short failed with short writef (%ld => %ld).\n", - SF_COUNT_TO_LONG (frames), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_writef_short_or_die */ - -void -test_writef_int_or_die (SNDFILE *file, int pass, const int *test, sf_count_t frames, int line_num) -{ sf_count_t count ; - - if ((count = sf_writef_int (file, test, frames)) != frames) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_writef_int failed with short writef (%ld => %ld).\n", - SF_COUNT_TO_LONG (frames), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_writef_int_or_die */ - -void -test_writef_float_or_die (SNDFILE *file, int pass, const float *test, sf_count_t frames, int line_num) -{ sf_count_t count ; - - if ((count = sf_writef_float (file, test, frames)) != frames) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_writef_float failed with short writef (%ld => %ld).\n", - SF_COUNT_TO_LONG (frames), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_writef_float_or_die */ - -void -test_writef_double_or_die (SNDFILE *file, int pass, const double *test, sf_count_t frames, int line_num) -{ sf_count_t count ; - - if ((count = sf_writef_double (file, test, frames)) != frames) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_writef_double failed with short writef (%ld => %ld).\n", - SF_COUNT_TO_LONG (frames), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_writef_double_or_die */ - - -void -test_write_raw_or_die (SNDFILE *file, int pass, const void *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_write_raw (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_write_raw failed with short write (%ld => %ld).\n", - SF_COUNT_TO_LONG (items), SF_COUNT_TO_LONG (count)) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_write_raw_or_die */ - - -void -compare_short_or_die (const short *left, const short *right, unsigned count, int line_num) -{ - unsigned k ; - - for (k = 0 ; k < count ;k++) - if (left [k] != right [k]) - { printf ("\n\nLine %d : Error at index %d, " "% d" " should be " "% d" ".\n\n", line_num, k, left [k], right [k]) ; - exit (1) ; - } ; - - return ; -} /* compare_short_or_die */ -void -compare_int_or_die (const int *left, const int *right, unsigned count, int line_num) -{ - unsigned k ; - - for (k = 0 ; k < count ;k++) - if (left [k] != right [k]) - { printf ("\n\nLine %d : Error at index %d, " "% d" " should be " "% d" ".\n\n", line_num, k, left [k], right [k]) ; - exit (1) ; - } ; - - return ; -} /* compare_int_or_die */ -void -compare_float_or_die (const float *left, const float *right, unsigned count, int line_num) -{ - unsigned k ; - - for (k = 0 ; k < count ;k++) - if (left [k] != right [k]) - { printf ("\n\nLine %d : Error at index %d, " "% g" " should be " "% g" ".\n\n", line_num, k, left [k], right [k]) ; - exit (1) ; - } ; - - return ; -} /* compare_float_or_die */ -void -compare_double_or_die (const double *left, const double *right, unsigned count, int line_num) -{ - unsigned k ; - - for (k = 0 ; k < count ;k++) - if (left [k] != right [k]) - { printf ("\n\nLine %d : Error at index %d, " "% g" " should be " "% g" ".\n\n", line_num, k, left [k], right [k]) ; - exit (1) ; - } ; - - return ; -} /* compare_double_or_die */ - - - -void -delete_file (int format, const char *filename) -{ char rsrc_name [512], *fname ; - - unlink (filename) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_SD2) - return ; - - /* - ** Now try for a resource fork stored as a separate file. - ** Grab the un-adulterated filename again. - */ - snprintf (rsrc_name, sizeof (rsrc_name), "%s", filename) ; - - if ((fname = strrchr (rsrc_name, '/')) != NULL) - fname ++ ; - else if ((fname = strrchr (rsrc_name, '\\')) != NULL) - fname ++ ; - else - fname = rsrc_name ; - - memmove (fname + 2, fname, strlen (fname) + 1) ; - fname [0] = '.' ; - fname [1] = '_' ; - - unlink (rsrc_name) ; -} /* delete_file */ - -static int allowed_open_files = -1 ; - -void -count_open_files (void) -{ -#if OS_IS_WIN32 - return ; -#else - int k, count = 0 ; - struct stat statbuf ; - - if (allowed_open_files > 0) - return ; - - for (k = 0 ; k < 1024 ; k++) - if (fstat (k, &statbuf) == 0) - count ++ ; - - allowed_open_files = count ; -#endif -} /* count_open_files */ - -void -increment_open_file_count (void) -{ allowed_open_files ++ ; -} /* increment_open_file_count */ - -void -check_open_file_count_or_die (int lineno) -{ -#if OS_IS_WIN32 - lineno = 0 ; - return ; -#else - int k, count = 0 ; - struct stat statbuf ; - - if (allowed_open_files < 0) - count_open_files () ; - - for (k = 0 ; k < 1024 ; k++) - if (fstat (k, &statbuf) == 0) - count ++ ; - - if (count > allowed_open_files) - { printf ("\nLine %d : number of open files (%d) > allowed (%d).\n\n", lineno, count, allowed_open_files) ; - exit (1) ; - } ; -#endif -} /* check_open_file_count_or_die */ - -void -write_mono_file (const char * filename, int format, int srate, float * output, int len) -{ SNDFILE * file ; - SF_INFO sfinfo ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - sfinfo.samplerate = srate ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("sf_open (%s) : %s\n", filename, sf_strerror (NULL)) ; - exit (1) ; - } ; - - sf_write_float (file, output, len) ; - - sf_close (file) ; -} /* write_mono_file */ - -void -gen_lowpass_noise_float (float *data, int len) -{ int32_t value = 0x1243456 ; - double sample, last_val = 0.0 ; - int k ; - - for (k = 0 ; k < len ; k++) - { /* Not a crypto quality RNG. */ - value = 11117 * value + 211231 ; - value = 11117 * value + 211231 ; - value = 11117 * value + 211231 ; - - sample = value / (0x7fffffff * 1.000001) ; - sample = 0.2 * sample - 0.9 * last_val ; - - data [k] = last_val = sample ; - } ; - -} /* gen_lowpass_noise_float */ - - -/* -** Windows is fucked. -** If a file is opened R/W and data is written to it, then fstat will return -** the correct file length, but stat will return zero. -*/ - -sf_count_t -file_length (const char * fname) -{ struct stat data ; - - if (stat (fname, &data) != 0) - return 0 ; - - return (sf_count_t) data.st_size ; -} /* file_length */ - -sf_count_t -file_length_fd (int fd) -{ struct stat data ; - - memset (&data, 0, sizeof (data)) ; - if (fstat (fd, &data) != 0) - return 0 ; - - return (sf_count_t) data.st_size ; -} /* file_length_fd */ - - - - diff --git a/libs/libsndfile/tests/utils.def b/libs/libsndfile/tests/utils.def deleted file mode 100644 index 0d94183d2e..0000000000 --- a/libs/libsndfile/tests/utils.def +++ /dev/null @@ -1,52 +0,0 @@ -autogen definitions utils.tpl; - -float_type = { - name = float ; - }; - -float_type = { - name = double ; - }; - -/*----------------------------------*/ - -io_type = { - io_element = short ; - format_str = "\"% d\"" ; - }; - -io_type = { - io_element = int ; - format_str = "\"% d\"" ; - }; - -io_type = { - io_element = float ; - format_str = "\"% g\"" ; - }; - -io_type = { - io_element = double ; - format_str = "\"% g\"" ; - }; - -read_op = { - op_element = read ; - count_name = items ; - }; - -read_op = { - op_element = readf ; - count_name = frames ; - }; - -write_op = { - op_element = write ; - count_name = items ; - }; - -write_op = { - op_element = writef ; - count_name = frames ; - }; - diff --git a/libs/libsndfile/tests/utils.h b/libs/libsndfile/tests/utils.h deleted file mode 100644 index 79da2861dc..0000000000 --- a/libs/libsndfile/tests/utils.h +++ /dev/null @@ -1,183 +0,0 @@ -/* -** Copyright (C) 2002-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** Utility functions to make writing the test suite easier. -** -** The .c and .h files were generated automagically with Autogen from -** the files utils.def and utils.tpl. -*/ - - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include - -#define SF_COUNT_TO_LONG(x) ((long) (x)) -#define ARRAY_LEN(x) ((int) (sizeof (x)) / (sizeof ((x) [0]))) -#define SIGNED_SIZEOF(x) ((int64_t) (sizeof (x))) -#define NOT(x) (! (x)) - -#define PIPE_INDEX(x) ((x) + 500) -#define PIPE_TEST_LEN 12345 - - -void gen_windowed_sine_float (float *data, int len, double maximum) ; -void gen_windowed_sine_double (double *data, int len, double maximum) ; - - -void create_short_sndfile (const char *filename, int format, int channels) ; - -void check_file_hash_or_die (const char *filename, uint64_t target_hash, int line_num) ; - -void print_test_name (const char *test, const char *filename) ; - -void dump_data_to_file (const char *filename, const void *data, unsigned int datalen) ; - -void write_mono_file (const char * filename, int format, int srate, float * output, int len) ; - -static inline void -exit_if_true (int test, const char *format, ...) -{ if (test) - { va_list argptr ; - va_start (argptr, format) ; - vprintf (format, argptr) ; - va_end (argptr) ; - exit (1) ; - } ; -} /* exit_if_true */ - -/* -** Functions for saving two vectors of data in an ascii text file which -** can then be loaded into GNU octave for comparison. -*/ - -int oct_save_short (const short *a, const short *b, int len) ; -int oct_save_int (const int *a, const int *b, int len) ; -int oct_save_float (const float *a, const float *b, int len) ; -int oct_save_double (const double *a, const double *b, int len) ; - - -void delete_file (int format, const char *filename) ; - -void count_open_files (void) ; -void increment_open_file_count (void) ; -void check_open_file_count_or_die (int lineno) ; - -#ifdef SNDFILE_H - -static inline void -sf_info_clear (SF_INFO * info) -{ memset (info, 0, sizeof (SF_INFO)) ; -} /* sf_info_clear */ - -static inline void -sf_info_setup (SF_INFO * info, int format, int samplerate, int channels) -{ sf_info_clear (info) ; - - info->format = format ; - info->samplerate = samplerate ; - info->channels = channels ; -} /* sf_info_setup */ - - -void dump_log_buffer (SNDFILE *file) ; -void check_log_buffer_or_die (SNDFILE *file, int line_num) ; -int string_in_log_buffer (SNDFILE *file, const char *s) ; -void hexdump_file (const char * filename, sf_count_t offset, sf_count_t length) ; - - -SNDFILE *test_open_file_or_die - (const char *filename, int mode, SF_INFO *sfinfo, int allow_fd, int line_num) ; - -void test_read_write_position_or_die - (SNDFILE *file, int line_num, int pass, sf_count_t read_pos, sf_count_t write_pos) ; - -void test_seek_or_die - (SNDFILE *file, sf_count_t offset, int whence, sf_count_t new_pos, int channels, int line_num) ; - - -void test_read_short_or_die - (SNDFILE *file, int pass, short *test, sf_count_t items, int line_num) ; -void test_read_int_or_die - (SNDFILE *file, int pass, int *test, sf_count_t items, int line_num) ; -void test_read_float_or_die - (SNDFILE *file, int pass, float *test, sf_count_t items, int line_num) ; -void test_read_double_or_die - (SNDFILE *file, int pass, double *test, sf_count_t items, int line_num) ; - -void test_readf_short_or_die - (SNDFILE *file, int pass, short *test, sf_count_t frames, int line_num) ; -void test_readf_int_or_die - (SNDFILE *file, int pass, int *test, sf_count_t frames, int line_num) ; -void test_readf_float_or_die - (SNDFILE *file, int pass, float *test, sf_count_t frames, int line_num) ; -void test_readf_double_or_die - (SNDFILE *file, int pass, double *test, sf_count_t frames, int line_num) ; - - -void -test_read_raw_or_die (SNDFILE *file, int pass, void *test, sf_count_t items, int line_num) ; - - -void test_write_short_or_die - (SNDFILE *file, int pass, const short *test, sf_count_t items, int line_num) ; -void test_write_int_or_die - (SNDFILE *file, int pass, const int *test, sf_count_t items, int line_num) ; -void test_write_float_or_die - (SNDFILE *file, int pass, const float *test, sf_count_t items, int line_num) ; -void test_write_double_or_die - (SNDFILE *file, int pass, const double *test, sf_count_t items, int line_num) ; - -void test_writef_short_or_die - (SNDFILE *file, int pass, const short *test, sf_count_t frames, int line_num) ; -void test_writef_int_or_die - (SNDFILE *file, int pass, const int *test, sf_count_t frames, int line_num) ; -void test_writef_float_or_die - (SNDFILE *file, int pass, const float *test, sf_count_t frames, int line_num) ; -void test_writef_double_or_die - (SNDFILE *file, int pass, const double *test, sf_count_t frames, int line_num) ; - - -void -test_write_raw_or_die (SNDFILE *file, int pass, const void *test, sf_count_t items, int line_num) ; - -void compare_short_or_die (const short *left, const short *right, unsigned count, int line_num) ; -void compare_int_or_die (const int *left, const int *right, unsigned count, int line_num) ; -void compare_float_or_die (const float *left, const float *right, unsigned count, int line_num) ; -void compare_double_or_die (const double *left, const double *right, unsigned count, int line_num) ; - - - -void gen_lowpass_noise_float (float *data, int len) ; - -sf_count_t file_length (const char * fname) ; -sf_count_t file_length_fd (int fd) ; - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - - - diff --git a/libs/libsndfile/tests/utils.tpl b/libs/libsndfile/tests/utils.tpl deleted file mode 100644 index d88e263ff0..0000000000 --- a/libs/libsndfile/tests/utils.tpl +++ /dev/null @@ -1,897 +0,0 @@ -[+ AutoGen5 template h c +] -/* -** Copyright (C) 2002-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** Utility functions to make writing the test suite easier. -** -** The .c and .h files were generated automagically with Autogen from -** the files utils.def and utils.tpl. -*/ - -[+ CASE (suffix) +] -[+ == h +] - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include - -#define ARRAY_LEN(x) ((int) (sizeof (x)) / (sizeof ((x) [0]))) -#define SIGNED_SIZEOF(x) ((int64_t) (sizeof (x))) -#define NOT(x) (! (x)) - -#define PIPE_INDEX(x) ((x) + 500) -#define PIPE_TEST_LEN 12345 - - -[+ FOR float_type -+]void gen_windowed_sine_[+ (get "name") +] ([+ (get "name") +] *data, int len, double maximum) ; -[+ ENDFOR float_type -+] - -void create_short_sndfile (const char *filename, int format, int channels) ; - -void check_file_hash_or_die (const char *filename, uint64_t target_hash, int line_num) ; - -void print_test_name (const char *test, const char *filename) ; - -void dump_data_to_file (const char *filename, const void *data, unsigned int datalen) ; - -void write_mono_file (const char * filename, int format, int srate, float * output, int len) ; - -#ifdef __GNUC__ -static inline void -exit_if_true (int test, const char *format, ...) -#ifdef __USE_MINGW_ANSI_STDIO - __attribute__ ((format (gnu_printf, 2, 3))) ; -#else - __attribute__ ((format (printf, 2, 3))) ; -#endif -#endif - -static inline void -exit_if_true (int test, const char *format, ...) -{ if (test) - { va_list argptr ; - va_start (argptr, format) ; - vprintf (format, argptr) ; - va_end (argptr) ; - exit (1) ; - } ; -} /* exit_if_true */ - -/* -** Functions for saving two vectors of data in an ascii text file which -** can then be loaded into GNU octave for comparison. -*/ - -[+ FOR io_type -+]int oct_save_[+ (get "io_element") +] (const [+ (get "io_element") +] *a, const [+ (get "io_element") +] *b, int len) ; -[+ ENDFOR io_type -+] - -void delete_file (int format, const char *filename) ; - -void count_open_files (void) ; -void increment_open_file_count (void) ; -void check_open_file_count_or_die (int lineno) ; - -#ifdef SNDFILE_H - -static inline void -sf_info_clear (SF_INFO * info) -{ memset (info, 0, sizeof (SF_INFO)) ; -} /* sf_info_clear */ - -static inline void -sf_info_setup (SF_INFO * info, int format, int samplerate, int channels) -{ sf_info_clear (info) ; - - info->format = format ; - info->samplerate = samplerate ; - info->channels = channels ; -} /* sf_info_setup */ - - -void dump_log_buffer (SNDFILE *file) ; -void check_log_buffer_or_die (SNDFILE *file, int line_num) ; -int string_in_log_buffer (SNDFILE *file, const char *s) ; -void hexdump_file (const char * filename, sf_count_t offset, sf_count_t length) ; - - -SNDFILE *test_open_file_or_die - (const char *filename, int mode, SF_INFO *sfinfo, int allow_fd, int line_num) ; - -void test_read_write_position_or_die - (SNDFILE *file, int line_num, int pass, sf_count_t read_pos, sf_count_t write_pos) ; - -void test_seek_or_die - (SNDFILE *file, sf_count_t offset, int whence, sf_count_t new_pos, int channels, int line_num) ; - -[+ FOR read_op +] -[+ FOR io_type -+]void test_[+ (get "op_element") +]_[+ (get "io_element") +]_or_die - (SNDFILE *file, int pass, [+ (get "io_element") +] *test, sf_count_t [+ (get "count_name") +], int line_num) ; -[+ ENDFOR io_type +][+ ENDFOR read_op +] - -void -test_read_raw_or_die (SNDFILE *file, int pass, void *test, sf_count_t items, int line_num) ; - -[+ FOR write_op +] -[+ FOR io_type -+]void test_[+ (get "op_element") +]_[+ (get "io_element") +]_or_die - (SNDFILE *file, int pass, const [+ (get "io_element") +] *test, sf_count_t [+ (get "count_name") +], int line_num) ; -[+ ENDFOR io_type +][+ ENDFOR write_op +] - -void -test_write_raw_or_die (SNDFILE *file, int pass, const void *test, sf_count_t items, int line_num) ; - -[+ FOR io_type -+]void compare_[+ (get "io_element") +]_or_die (const [+ (get "io_element") +] *expected, const [+ (get "io_element") +] *actual, unsigned count, int line_num) ; -[+ ENDFOR io_type +] - - -void gen_lowpass_signal_float (float *data, int len) ; - -sf_count_t file_length (const char * fname) ; -sf_count_t file_length_fd (int fd) ; - -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -[+ == c +] - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include - -#include "utils.h" - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338 -#endif - -#define LOG_BUFFER_SIZE 2048 - -/* -** Neat solution to the Win32/OS2 binary file flage requirement. -** If O_BINARY isn't already defined by the inclusion of the system -** headers, set it to zero. -*/ -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -[+ FOR float_type +] -void -gen_windowed_sine_[+ (get "name") +] ([+ (get "name") +] *data, int len, double maximum) -{ int k ; - - memset (data, 0, len * sizeof ([+ (get "name") +])) ; - /* - ** Choose a frequency of 1/32 so that it aligns perfectly with a DFT - ** bucket to minimise spreading of energy over more than one bucket. - ** Also do not want to make the frequency too high as some of the - ** codecs (ie gsm610) have a quite severe high frequency roll off. - */ - len /= 2 ; - - for (k = 0 ; k < len ; k++) - { data [k] = sin (2.0 * k * M_PI * 1.0 / 32.0 + 0.4) ; - - /* Apply Hanning Window. */ - data [k] *= maximum * (0.5 - 0.5 * cos (2.0 * M_PI * k / ((len) - 1))) ; - } - - return ; -} /* gen_windowed_sine_[+ (get "name") +] */ -[+ ENDFOR float_type +] - -void -create_short_sndfile (const char *filename, int format, int channels) -{ short data [2 * 3 * 4 * 5 * 6 * 7] = { 0, } ; - SNDFILE *file ; - SF_INFO sfinfo ; - - sfinfo.samplerate = 44100 ; - sfinfo.channels = channels ; - sfinfo.format = format ; - - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("Error (%s, %d) : sf_open failed : %s\n", __FILE__, __LINE__, sf_strerror (file)) ; - exit (1) ; - } ; - - sf_write_short (file, data, ARRAY_LEN (data)) ; - - sf_close (file) ; -} /* create_short_sndfile */ - -void -check_file_hash_or_die (const char *filename, uint64_t target_hash, int line_num) -{ static unsigned char buf [4096] ; - uint64_t cksum ; - FILE *file ; - int k, read_count ; - - memset (buf, 0, sizeof (buf)) ; - - /* The 'b' in the mode string means binary for Win32. */ - if ((file = fopen (filename, "rb")) == NULL) - { printf ("\n\nLine %d: could not open file '%s'\n\n", line_num, filename) ; - exit (1) ; - } ; - - cksum = 0 ; - - while ((read_count = fread (buf, 1, sizeof (buf), file))) - for (k = 0 ; k < read_count ; k++) - cksum = cksum * 511 + buf [k] ; - - fclose (file) ; - - if (target_hash == 0) - { printf (" 0x%016" PRIx64 "\n", cksum) ; - return ; - } ; - - if (cksum != target_hash) - { printf ("\n\nLine %d: incorrect hash value 0x%016" PRIx64 " should be 0x%016" PRIx64 ".\n\n", line_num, cksum, target_hash) ; - exit (1) ; - } ; - - return ; -} /* check_file_hash_or_die */ - -void -print_test_name (const char *test, const char *filename) -{ int count ; - - if (test == NULL) - { printf (__FILE__ ": bad test of filename parameter.\n") ; - exit (1) ; - } ; - - if (filename == NULL || strlen (filename) == 0) - { printf (" %-30s : ", test) ; - count = 25 ; - } - else - { printf (" %-30s : %s ", test, filename) ; - count = 24 - strlen (filename) ; - } ; - - while (count -- > 0) - putchar ('.') ; - putchar (' ') ; - - fflush (stdout) ; -} /* print_test_name */ - -void -dump_data_to_file (const char *filename, const void *data, unsigned int datalen) -{ FILE *file ; - - if ((file = fopen (filename, "wb")) == NULL) - { printf ("\n\nLine %d : could not open file : %s\n\n", __LINE__, filename) ; - exit (1) ; - } ; - - if (fwrite (data, 1, datalen, file) != datalen) - { printf ("\n\nLine %d : fwrite failed.\n\n", __LINE__) ; - exit (1) ; - } ; - - fclose (file) ; - -} /* dump_data_to_file */ - -/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -*/ - -static char octfilename [] = "error.dat" ; - -[+ FOR io_type -+]int -oct_save_[+ (get "io_element") +] (const [+ (get "io_element") +] *a, const [+ (get "io_element") +] *b, int len) -{ FILE *file ; - int k ; - - if (! (file = fopen (octfilename, "w"))) - return 1 ; - - fprintf (file, "# Not created by Octave\n") ; - - fprintf (file, "# name: a\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, [+ (get "format_str") +] "\n", a [k]) ; - - fprintf (file, "# name: b\n") ; - fprintf (file, "# type: matrix\n") ; - fprintf (file, "# rows: %d\n", len) ; - fprintf (file, "# columns: 1\n") ; - - for (k = 0 ; k < len ; k++) - fprintf (file, [+ (get "format_str") +] "\n", b [k]) ; - - fclose (file) ; - return 0 ; -} /* oct_save_[+ (get "io_element") +] */ -[+ ENDFOR io_type -+] - -void -check_log_buffer_or_die (SNDFILE *file, int line_num) -{ static char buffer [LOG_BUFFER_SIZE] ; - int count ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Get the log buffer data. */ - count = sf_command (file, SFC_GET_LOG_INFO, buffer, LOG_BUFFER_SIZE) ; - - if (LOG_BUFFER_SIZE - count < 2) - { printf ("\n\nLine %d : Possible long log buffer.\n", line_num) ; - exit (1) ; - } - - /* Look for "Should" */ - if (strstr (buffer, "ould")) - { printf ("\n\nLine %d : Log buffer contains `ould'. Dumping.\n", line_num) ; - puts (buffer) ; - exit (1) ; - } ; - - /* Look for "**" */ - if (strstr (buffer, "*")) - { printf ("\n\nLine %d : Log buffer contains `*'. Dumping.\n", line_num) ; - puts (buffer) ; - exit (1) ; - } ; - - /* Look for "Should" */ - if (strstr (buffer, "nknown marker")) - { printf ("\n\nLine %d : Log buffer contains `nknown marker'. Dumping.\n", line_num) ; - puts (buffer) ; - exit (1) ; - } ; - - return ; -} /* check_log_buffer_or_die */ - -int -string_in_log_buffer (SNDFILE *file, const char *s) -{ static char buffer [LOG_BUFFER_SIZE] ; - int count ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Get the log buffer data. */ - count = sf_command (file, SFC_GET_LOG_INFO, buffer, LOG_BUFFER_SIZE) ; - - if (LOG_BUFFER_SIZE - count < 2) - { printf ("Possible long log buffer.\n") ; - exit (1) ; - } - - /* Look for string */ - return strstr (buffer, s) ? SF_TRUE : SF_FALSE ; -} /* string_in_log_buffer */ - -void -hexdump_file (const char * filename, sf_count_t offset, sf_count_t length) -{ - FILE * file ; - char buffer [16] ; - int k, m, ch, readcount ; - - if (length > 1000000) - { printf ("\n\nError : length (%" PRId64 ") too long.\n\n", offset) ; - exit (1) ; - } ; - - if ((file = fopen (filename, "r")) == NULL) - { printf ("\n\nError : hexdump_file (%s) could not open file for read.\n\n", filename) ; - exit (1) ; - } ; - - if (fseek (file, offset, SEEK_SET) != 0) - { printf ("\n\nError : fseek(file, %" PRId64 ", SEEK_SET) failed : %s\n\n", offset, strerror (errno)) ; - exit (1) ; - } ; - - puts ("\n\n") ; - - for (k = 0 ; k < length ; k+= sizeof (buffer)) - { readcount = fread (buffer, 1, sizeof (buffer), file) ; - - printf ("%08" PRIx64 " : ", offset + k) ; - - for (m = 0 ; m < readcount ; m++) - printf ("%02x ", buffer [m] & 0xFF) ; - - for (m = readcount ; m < SIGNED_SIZEOF (buffer) ; m++) - printf (" ") ; - - printf (" ") ; - for (m = 0 ; m < readcount ; m++) - { ch = isprint (buffer [m]) ? buffer [m] : '.' ; - putchar (ch) ; - } ; - - if (readcount < SIGNED_SIZEOF (buffer)) - break ; - - putchar ('\n') ; - } ; - - puts ("\n") ; - - fclose (file) ; -} /* hexdump_file */ - -void -dump_log_buffer (SNDFILE *file) -{ static char buffer [LOG_BUFFER_SIZE] ; - - memset (buffer, 0, sizeof (buffer)) ; - - /* Get the log buffer data. */ - sf_command (file, SFC_GET_LOG_INFO, buffer, LOG_BUFFER_SIZE) ; - - if (strlen (buffer) < 1) - puts ("Log buffer empty.\n") ; - else - puts (buffer) ; - - return ; -} /* dump_log_buffer */ - -SNDFILE * -test_open_file_or_die (const char *filename, int mode, SF_INFO *sfinfo, int allow_fd, int line_num) -{ static int count = 0 ; - - SNDFILE *file ; - const char *modestr, *func_name ; - int oflags = 0, omode = 0, err ; - - /* - ** Need to test both sf_open() and sf_open_fd(). - ** Do so alternately. - */ - switch (mode) - { case SFM_READ : - modestr = "SFM_READ" ; - oflags = O_RDONLY | O_BINARY ; - omode = 0 ; - break ; - - case SFM_WRITE : - modestr = "SFM_WRITE" ; - oflags = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY ; - omode = S_IRUSR | S_IWUSR | S_IRGRP ; - break ; - - case SFM_RDWR : - modestr = "SFM_RDWR" ; - oflags = O_RDWR | O_CREAT | O_BINARY ; - omode = S_IRUSR | S_IWUSR | S_IRGRP ; - break ; - default : - printf ("\n\nLine %d: Bad mode.\n", line_num) ; - fflush (stdout) ; - exit (1) ; - } ; - - if (OS_IS_WIN32) - { /* Windows does not understand and ignores the S_IRGRP flag, but Wine - ** gives a run time warning message, so just clear it. - */ - omode &= ~S_IRGRP ; - } ; - - if (allow_fd && ((++count) & 1) == 1) - { int fd ; - - /* Only use the three argument open() function if omode != 0. */ - fd = (omode == 0) ? open (filename, oflags) : open (filename, oflags, omode) ; - - if (fd < 0) - { printf ("\n\n%s : open failed : %s\n", __func__, strerror (errno)) ; - exit (1) ; - } ; - - func_name = "sf_open_fd" ; - file = sf_open_fd (fd, mode, sfinfo, SF_TRUE) ; - } - else - { func_name = "sf_open" ; - file = sf_open (filename, mode, sfinfo) ; - } ; - - if (file == NULL) - { printf ("\n\nLine %d: %s (%s) failed : %s\n\n", line_num, func_name, modestr, sf_strerror (NULL)) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - err = sf_error (file) ; - if (err != SF_ERR_NO_ERROR) - { printf ("\n\nLine %d : sf_error : %s\n\n", line_num, sf_error_number (err)) ; - dump_log_buffer (file) ; - exit (1) ; - } ; - - return file ; -} /* test_open_file_or_die */ - -void -test_read_write_position_or_die (SNDFILE *file, int line_num, int pass, sf_count_t read_pos, sf_count_t write_pos) -{ sf_count_t pos ; - - /* Check the current read position. */ - if (read_pos >= 0 && (pos = sf_seek (file, 0, SEEK_CUR | SFM_READ)) != read_pos) - { printf ("\n\nLine %d ", line_num) ; - if (pass > 0) - printf ("(pass %d): ", pass) ; - printf ("Read position (%" PRId64 ") should be %" PRId64 ".\n", pos, read_pos) ; - exit (1) ; - } ; - - /* Check the current write position. */ - if (write_pos >= 0 && (pos = sf_seek (file, 0, SEEK_CUR | SFM_WRITE)) != write_pos) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : Write position (%" PRId64 ") should be %" PRId64 ".\n", pos, write_pos) ; - exit (1) ; - } ; - - return ; -} /* test_read_write_position */ - -void -test_seek_or_die (SNDFILE *file, sf_count_t offset, int whence, sf_count_t new_pos, int channels, int line_num) -{ sf_count_t position ; - const char *channel_name, *whence_name ; - - switch (whence) - { case SEEK_SET : - whence_name = "SEEK_SET" ; - break ; - case SEEK_CUR : - whence_name = "SEEK_CUR" ; - break ; - case SEEK_END : - whence_name = "SEEK_END" ; - break ; - - /* SFM_READ */ - case SEEK_SET | SFM_READ : - whence_name = "SFM_READ | SEEK_SET" ; - break ; - case SEEK_CUR | SFM_READ : - whence_name = "SFM_READ | SEEK_CUR" ; - break ; - case SEEK_END | SFM_READ : - whence_name = "SFM_READ | SEEK_END" ; - break ; - - /* SFM_WRITE */ - case SEEK_SET | SFM_WRITE : - whence_name = "SFM_WRITE | SEEK_SET" ; - break ; - case SEEK_CUR | SFM_WRITE : - whence_name = "SFM_WRITE | SEEK_CUR" ; - break ; - case SEEK_END | SFM_WRITE : - whence_name = "SFM_WRITE | SEEK_END" ; - break ; - - default : - printf ("\n\nLine %d: bad whence parameter.\n", line_num) ; - exit (1) ; - } ; - - channel_name = (channels == 1) ? "Mono" : "Stereo" ; - - if ((position = sf_seek (file, offset, whence)) != new_pos) - { printf ("\n\nLine %d : %s : sf_seek (file, %" PRId64 ", %s) returned %" PRId64 " (should be %" PRId64 ").\n\n", - line_num, channel_name, offset, whence_name, position, new_pos) ; - exit (1) ; - } ; - -} /* test_seek_or_die */ - -[+ FOR read_op +] -[+ FOR io_type +] -void -test_[+ (get "op_element") +]_[+ (get "io_element") +]_or_die (SNDFILE *file, int pass, [+ (get "io_element") +] *test, sf_count_t [+ (get "count_name") +], int line_num) -{ sf_count_t count ; - - if ((count = sf_[+ (get "op_element") +]_[+ (get "io_element") +] (file, test, [+ (get "count_name") +])) != [+ (get "count_name") +]) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_[+ (get "op_element") +]_[+ (get "io_element") +] failed with short [+ (get "op_element") +] (%" PRId64 " => %" PRId64 ").\n", - [+ (get "count_name") +], count) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_[+ (get "op_element") +]_[+ (get "io_element") +]_or_die */ -[+ ENDFOR io_type +][+ ENDFOR read_op +] - -void -test_read_raw_or_die (SNDFILE *file, int pass, void *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_read_raw (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_read_raw failed with short read (%" PRId64 " => %" PRId64 ").\n", items, count) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_read_raw_or_die */ - -[+ FOR write_op +] -[+ FOR io_type +] -void -test_[+ (get "op_element") +]_[+ (get "io_element") +]_or_die (SNDFILE *file, int pass, const [+ (get "io_element") +] *test, sf_count_t [+ (get "count_name") +], int line_num) -{ sf_count_t count ; - - if ((count = sf_[+ (get "op_element") +]_[+ (get "io_element") +] (file, test, [+ (get "count_name") +])) != [+ (get "count_name") +]) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_[+ (get "op_element") +]_[+ (get "io_element") +] failed with short [+ (get "op_element") +] (%" PRId64 " => %" PRId64 ").\n", - [+ (get "count_name") +], count) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_[+ (get "op_element") +]_[+ (get "io_element") +]_or_die */ -[+ ENDFOR io_type +][+ ENDFOR write_op +] - -void -test_write_raw_or_die (SNDFILE *file, int pass, const void *test, sf_count_t items, int line_num) -{ sf_count_t count ; - - if ((count = sf_write_raw (file, test, items)) != items) - { printf ("\n\nLine %d", line_num) ; - if (pass > 0) - printf (" (pass %d)", pass) ; - printf (" : sf_write_raw failed with short write (%" PRId64 " => %" PRId64 ").\n", items, count) ; - fflush (stdout) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - return ; -} /* test_write_raw_or_die */ - - -[+ FOR io_type -+]void -compare_[+ (get "io_element") +]_or_die (const [+ (get "io_element") +] *expected, const [+ (get "io_element") +] *actual, unsigned count, int line_num) -{ - unsigned k ; - - for (k = 0 ; k < count ; k++) - if (expected [k] != actual [k]) - { printf ("\n\nLine %d : Error at index %d, got " [+ (get "format_str") +] ", should be " [+ (get "format_str") +] ".\n\n", line_num, k, actual [k], expected [k]) ; - exit (1) ; - } ; - - return ; -} /* compare_[+ (get "io_element") +]_or_die */ -[+ ENDFOR io_type +] - - -void -delete_file (int format, const char *filename) -{ char rsrc_name [512], *fname ; - - unlink (filename) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_SD2) - return ; - - /* - ** Now try for a resource fork stored as a separate file. - ** Grab the un-adulterated filename again. - */ - snprintf (rsrc_name, sizeof (rsrc_name), "%s", filename) ; - - if ((fname = strrchr (rsrc_name, '/')) != NULL) - fname ++ ; - else if ((fname = strrchr (rsrc_name, '\\')) != NULL) - fname ++ ; - else - fname = rsrc_name ; - - memmove (fname + 2, fname, strlen (fname) + 1) ; - fname [0] = '.' ; - fname [1] = '_' ; - - unlink (rsrc_name) ; -} /* delete_file */ - -static int allowed_open_files = -1 ; - -void -count_open_files (void) -{ -#if OS_IS_WIN32 - return ; -#else - int k, count = 0 ; - struct stat statbuf ; - - if (allowed_open_files > 0) - return ; - - for (k = 0 ; k < 1024 ; k++) - if (fstat (k, &statbuf) == 0) - count ++ ; - - allowed_open_files = count ; -#endif -} /* count_open_files */ - -void -increment_open_file_count (void) -{ allowed_open_files ++ ; -} /* increment_open_file_count */ - -void -check_open_file_count_or_die (int lineno) -{ -#if OS_IS_WIN32 - (void) lineno ; - return ; -#else - int k, count = 0 ; - struct stat statbuf ; - - if (allowed_open_files < 0) - count_open_files () ; - - for (k = 0 ; k < 1024 ; k++) - if (fstat (k, &statbuf) == 0) - count ++ ; - - if (count > allowed_open_files) - { printf ("\nLine %d : number of open files (%d) > allowed (%d).\n\n", lineno, count, allowed_open_files) ; - exit (1) ; - } ; -#endif -} /* check_open_file_count_or_die */ - -void -write_mono_file (const char * filename, int format, int srate, float * output, int len) -{ SNDFILE * file ; - SF_INFO sfinfo ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - sfinfo.samplerate = srate ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { printf ("sf_open (%s) : %s\n", filename, sf_strerror (NULL)) ; - exit (1) ; - } ; - - sf_write_float (file, output, len) ; - - sf_close (file) ; -} /* write_mono_file */ - -void -gen_lowpass_signal_float (float *data, int len) -{ int32_t value = 0x1243456 ; - double sample, last_val = 0.0 ; - int k ; - - for (k = 0 ; k < len ; k++) - { /* Not a crypto quality RNG. */ - value = 11117 * value + 211231 ; - value = 11117 * value + 211231 ; - value = 11117 * value + 211231 ; - - sample = value / (0x7fffffff * 1.000001) ; - sample = 0.2 * sample - 0.9 * last_val ; - - last_val = sample ; - - data [k] = 0.5 * (sample + sin (2.0 * k * M_PI * 1.0 / 32.0)) ; - } ; - -} /* gen_lowpass_signal_float */ - - -/* -** Windows is fucked. -** If a file is opened R/W and data is written to it, then fstat will return -** the correct file length, but stat will return zero. -*/ - -sf_count_t -file_length (const char * fname) -{ struct stat data ; - - if (stat (fname, &data) != 0) - return 0 ; - - return (sf_count_t) data.st_size ; -} /* file_length */ - -sf_count_t -file_length_fd (int fd) -{ struct stat data ; - - memset (&data, 0, sizeof (data)) ; - if (fstat (fd, &data) != 0) - return 0 ; - - return (sf_count_t) data.st_size ; -} /* file_length_fd */ - - -[+ ESAC +] - diff --git a/libs/libsndfile/tests/virtual_io_test.c b/libs/libsndfile/tests/virtual_io_test.c deleted file mode 100644 index 1aae063df8..0000000000 --- a/libs/libsndfile/tests/virtual_io_test.c +++ /dev/null @@ -1,237 +0,0 @@ -/* -** Copyright (C) 1999-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include "utils.h" - -static void vio_test (const char *fname, int format) ; - -int -main (void) -{ - vio_test ("vio_pcm16.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - vio_test ("vio_pcm24.aiff", SF_FORMAT_AIFF | SF_FORMAT_PCM_24) ; - vio_test ("vio_float.au", SF_FORMAT_AU | SF_FORMAT_FLOAT) ; - vio_test ("vio_pcm24.paf", SF_FORMAT_PAF | SF_FORMAT_PCM_24) ; - - return 0 ; -} /* main */ - -/*============================================================================== -*/ - -typedef struct -{ sf_count_t offset, length ; - unsigned char data [16 * 1024] ; -} VIO_DATA ; - -static sf_count_t -vfget_filelen (void *user_data) -{ VIO_DATA *vf = (VIO_DATA *) user_data ; - - return vf->length ; -} /* vfget_filelen */ - -static sf_count_t -vfseek (sf_count_t offset, int whence, void *user_data) -{ VIO_DATA *vf = (VIO_DATA *) user_data ; - - switch (whence) - { case SEEK_SET : - vf->offset = offset ; - break ; - - case SEEK_CUR : - vf->offset = vf->offset + offset ; - break ; - - case SEEK_END : - vf->offset = vf->length + offset ; - break ; - default : - break ; - } ; - - return vf->offset ; -} /* vfseek */ - -static sf_count_t -vfread (void *ptr, sf_count_t count, void *user_data) -{ VIO_DATA *vf = (VIO_DATA *) user_data ; - - /* - ** This will brack badly for files over 2Gig in length, but - ** is sufficient for testing. - */ - if (vf->offset + count > vf->length) - count = vf->length - vf->offset ; - - memcpy (ptr, vf->data + vf->offset, count) ; - vf->offset += count ; - - return count ; -} /* vfread */ - -static sf_count_t -vfwrite (const void *ptr, sf_count_t count, void *user_data) -{ VIO_DATA *vf = (VIO_DATA *) user_data ; - - /* - ** This will break badly for files over 2Gig in length, but - ** is sufficient for testing. - */ - if (vf->offset >= SIGNED_SIZEOF (vf->data)) - return 0 ; - - if (vf->offset + count > SIGNED_SIZEOF (vf->data)) - count = sizeof (vf->data) - vf->offset ; - - memcpy (vf->data + vf->offset, ptr, (size_t) count) ; - vf->offset += count ; - - if (vf->offset > vf->length) - vf->length = vf->offset ; - - return count ; -} /* vfwrite */ - -static sf_count_t -vftell (void *user_data) -{ VIO_DATA *vf = (VIO_DATA *) user_data ; - - return vf->offset ; -} /* vftell */ - - -/*============================================================================== -*/ - -static void -gen_short_data (short * data, int len, int start) -{ int k ; - - for (k = 0 ; k < len ; k++) - data [k] = start + k ; -} /* gen_short_data */ - - -static void -check_short_data (short * data, int len, int start, int line) -{ int k ; - - for (k = 0 ; k < len ; k++) - if (data [k] != start + k) - { printf ("\n\nLine %d : data [%d] = %d (should be %d).\n\n", line, k, data [k], start + k) ; - exit (1) ; - } ; -} /* gen_short_data */ - -/*------------------------------------------------------------------------------ -*/ - -static void -vio_test (const char *fname, int format) -{ static VIO_DATA vio_data ; - static short data [256] ; - - SF_VIRTUAL_IO vio ; - SNDFILE * file ; - SF_INFO sfinfo ; - - print_test_name ("virtual i/o test", fname) ; - - /* Set up pointers to the locally defined functions. */ - vio.get_filelen = vfget_filelen ; - vio.seek = vfseek ; - vio.read = vfread ; - vio.write = vfwrite ; - vio.tell = vftell ; - - /* Set virtual file offset and length to zero. */ - vio_data.offset = 0 ; - vio_data.length = 0 ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.format = format ; - sfinfo.channels = 2 ; - sfinfo.samplerate = 44100 ; - - if ((file = sf_open_virtual (&vio, SFM_WRITE, &sfinfo, &vio_data)) == NULL) - { printf ("\n\nLine %d : sf_open_write failed with error : ", __LINE__) ; - fflush (stdout) ; - puts (sf_strerror (NULL)) ; - exit (1) ; - } ; - - if (vfget_filelen (&vio_data) < 0) - { printf ("\n\nLine %d : vfget_filelen returned negative length.\n\n", __LINE__) ; - exit (1) ; - } ; - - gen_short_data (data, ARRAY_LEN (data), 0) ; - sf_write_short (file, data, ARRAY_LEN (data)) ; - - gen_short_data (data, ARRAY_LEN (data), 1) ; - sf_write_short (file, data, ARRAY_LEN (data)) ; - - gen_short_data (data, ARRAY_LEN (data), 2) ; - sf_write_short (file, data, ARRAY_LEN (data)) ; - - sf_close (file) ; - - /* Now test read. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - vio_data.offset = 0 ; - - if ((file = sf_open_virtual (&vio, SFM_READ, &sfinfo, &vio_data)) == NULL) - { printf ("\n\nLine %d : sf_open_write failed with error : ", __LINE__) ; - fflush (stdout) ; - puts (sf_strerror (NULL)) ; - - dump_data_to_file (fname, vio_data.data, vio_data.length) ; - exit (1) ; - } ; - - - sf_read_short (file, data, ARRAY_LEN (data)) ; - check_short_data (data, ARRAY_LEN (data), 0, __LINE__) ; - - sf_read_short (file, data, ARRAY_LEN (data)) ; - check_short_data (data, ARRAY_LEN (data), 1, __LINE__) ; - - sf_read_short (file, data, ARRAY_LEN (data)) ; - check_short_data (data, ARRAY_LEN (data), 2, __LINE__) ; - - sf_close (file) ; - - puts ("ok") ; -} /* vio_test */ - diff --git a/libs/libsndfile/tests/vorbis_test.c b/libs/libsndfile/tests/vorbis_test.c deleted file mode 100644 index 9f5797fde9..0000000000 --- a/libs/libsndfile/tests/vorbis_test.c +++ /dev/null @@ -1,176 +0,0 @@ -/* -** Copyright (C) 2007-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include - -#include - -#include - -#include "utils.h" -#include "dft_cmp.h" - -#define SAMPLE_RATE 16000 -#define DATA_LENGTH (SAMPLE_RATE / 8) - -static float data_out [DATA_LENGTH] ; - -static inline float -max_float (float a, float b) -{ return a > b ? a : b ; -} /* max_float */ - -static void -vorbis_test (void) -{ static float float_data [DFT_DATA_LENGTH] ; - const char * filename = "vorbis_test.oga" ; - SNDFILE * file ; - SF_INFO sfinfo ; - float max_abs = 0.0 ; - unsigned k ; - - print_test_name ("vorbis_test", filename) ; - - /* Generate float data. */ - gen_windowed_sine_float (float_data, ARRAY_LEN (float_data), 1.0) ; - - /* Set up output file type. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - sfinfo.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ; - sfinfo.channels = 1 ; - sfinfo.samplerate = SAMPLE_RATE ; - - /* Write the output file. */ - - /* The Vorbis encoder has a bug on PowerPC and X86-64 with sample rates - ** <= 22050. Increasing the sample rate to 32000 avoids triggering it. - ** See https://trac.xiph.org/ticket/1229 - */ - if ((file = sf_open (filename, SFM_WRITE, &sfinfo)) == NULL) - { const char * errstr ; - - errstr = sf_strerror (NULL) ; - if (strstr (errstr, "Sample rate chosen is known to trigger a Vorbis") == NULL) - { printf ("Line %d: sf_open (SFM_WRITE) failed : %s\n", __LINE__, errstr) ; - dump_log_buffer (NULL) ; - exit (1) ; - } ; - - printf ("\n Sample rate -> 32kHz ") ; - sfinfo.samplerate = 32000 ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, SF_TRUE, __LINE__) ; - } ; - - test_write_float_or_die (file, 0, float_data, ARRAY_LEN (float_data), __LINE__) ; - sf_close (file) ; - - memset (float_data, 0, sizeof (float_data)) ; - - /* Read the file back in again. */ - memset (&sfinfo, 0, sizeof (sfinfo)) ; - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, SF_FALSE, __LINE__) ; - test_read_float_or_die (file, 0, float_data, ARRAY_LEN (float_data), __LINE__) ; - sf_close (file) ; - - for (k = 0 ; k < ARRAY_LEN (float_data) ; k ++) - max_abs = max_float (max_abs, fabs (float_data [k])) ; - - if (max_abs > 1.021) - { printf ("\n\n Error : max_abs %f should be < 1.021.\n\n", max_abs) ; - exit (1) ; - } ; - - puts ("ok") ; - unlink (filename) ; -} /* vorbis_test */ - -static void -vorbis_quality_test (void) -{ /* - ** Encode two files, one at quality 0.3 and one at quality 0.5 and then - ** make sure that the quality 0.3 files is the smaller of the two. - */ - const char * q3_fname = "q3_vorbis.oga" ; - const char * q5_fname = "q5_vorbis.oga" ; - - SNDFILE *q3_file, *q5_file ; - SF_INFO sfinfo ; - int q3_size, q5_size ; - double quality ; - int k ; - - print_test_name (__func__, "q[35]_vorbis.oga") ; - - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - /* Set up output file type. */ - sfinfo.format = SF_FORMAT_OGG | SF_FORMAT_VORBIS ; - sfinfo.channels = 1 ; - sfinfo.samplerate = SAMPLE_RATE ; - - /* Write the output file. */ - q3_file = test_open_file_or_die (q3_fname, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - q5_file = test_open_file_or_die (q5_fname, SFM_WRITE, &sfinfo, SF_FALSE, __LINE__) ; - - quality = 0.3 ; - sf_command (q3_file, SFC_SET_VBR_ENCODING_QUALITY, &quality, sizeof (quality)) ; - quality = 0.5 ; - sf_command (q5_file, SFC_SET_VBR_ENCODING_QUALITY, &quality, sizeof (quality)) ; - - for (k = 0 ; k < 5 ; k++) - { gen_lowpass_noise_float (data_out, ARRAY_LEN (data_out)) ; - test_write_float_or_die (q3_file, 0, data_out, ARRAY_LEN (data_out), __LINE__) ; - test_write_float_or_die (q5_file, 0, data_out, ARRAY_LEN (data_out), __LINE__) ; - } ; - - sf_close (q3_file) ; - sf_close (q5_file) ; - - q3_size = file_length (q3_fname) ; - q5_size = file_length (q5_fname) ; - - if (q3_size >= q5_size) - { printf ("\n\nLine %d : q3 size (%d) >= q5 size (%d)\n\n", __LINE__, q3_size, q5_size) ; - exit (1) ; - } ; - - puts ("ok") ; - unlink (q3_fname) ; - unlink (q5_fname) ; -} /* vorbis_quality_test */ - - - -int -main (void) -{ - if (HAVE_EXTERNAL_LIBS) - { vorbis_test () ; - vorbis_quality_test () ; - } - else - puts (" No Ogg/Vorbis tests because Ogg/Vorbis support was not compiled in.") ; - - return 0 ; -} /* main */ diff --git a/libs/libsndfile/tests/win32_ordinal_test.c b/libs/libsndfile/tests/win32_ordinal_test.c deleted file mode 100644 index 5324a2ed57..0000000000 --- a/libs/libsndfile/tests/win32_ordinal_test.c +++ /dev/null @@ -1,145 +0,0 @@ -/* -** Copyright (C) 2006-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#include -#include -#include - -#include "utils.h" - -#if (defined (WIN32) || defined (_WIN32) || defined (__CYGWIN__)) -#define TEST_WIN32 1 -#else -#define TEST_WIN32 0 -#endif - -#if TEST_WIN32 -#include - - -static const char * locations [] = -{ ".", "../src/", "src/", "../src/.libs/", "src/.libs/", - NULL -} ; /* locations. */ - -static int -test_ordinal (HMODULE hmod, const char * func_name, int ordinal) -{ char *lpmsg ; - void *name, *ord ; - - print_test_name ("win32_ordinal_test", func_name) ; - -#if SIZEOF_VOIDP == 8 -#define LPCSTR_OF_ORDINAL(x) ((LPCSTR) ((int64_t) (x))) -#else -#define LPCSTR_OF_ORDINAL(x) ((LPCSTR) (x)) -#endif - - ord = GetProcAddress (hmod, LPCSTR_OF_ORDINAL (ordinal)) ; - if ((name = GetProcAddress (hmod, func_name)) == NULL) - { FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError (), - MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpmsg, 0, NULL) ; - /*-puts (lpmsg) ;-*/ - } ; - - if (name != NULL && ord != NULL && name == ord) - { puts ("ok") ; - return 0 ; - } ; - - puts ("fail") ; - return 1 ; -} /* test_ordinal */ - -static void -win32_ordinal_test (void) -{ static char buffer [1024] ; - static char func_name [1024] ; - HMODULE hmod = NULL ; - FILE * file = NULL ; - int k, ordinal, errors = 0 ; - - for (k = 0 ; locations [k] != NULL ; k++) - { snprintf (buffer, sizeof (buffer), "%s/libsndfile-1.def", locations [k]) ; - if ((file = fopen (buffer, "r")) != NULL) - break ; - } ; - - if (file == NULL) - { puts ("\n\nError : cannot open DEF file.\n") ; - exit (1) ; - } ; - - for (k = 0 ; locations [k] != NULL ; k++) - { snprintf (buffer, sizeof (buffer), "%s/libsndfile-1.dll", locations [k]) ; - if ((hmod = (HMODULE) LoadLibrary (buffer)) != NULL) - break ; - } ; - - if (hmod == NULL) - { puts ("\n\nError : cannot load DLL.\n") ; - exit (1) ; - } ; - - while (fgets (buffer, sizeof (buffer), file) != NULL) - { func_name [0] = 0 ; - ordinal = 0 ; - - if (sscanf (buffer, "%s @%d", func_name, &ordinal) != 2) - continue ; - - errors += test_ordinal (hmod, func_name, ordinal) ; - } ; - - FreeLibrary (hmod) ; - - fclose (file) ; - - if (errors > 0) - { printf ("\n\nErrors : %d\n\n", errors) ; - exit (1) ; - } ; - - return ; -} /* win32_ordinal_test */ - -#endif - -int -main (void) -{ -#if (TEST_WIN32 && WIN32_TARGET_DLL) - win32_ordinal_test () ; -#endif - - return 0 ; -} /* main */ - diff --git a/libs/libsndfile/tests/win32_test.c b/libs/libsndfile/tests/win32_test.c deleted file mode 100644 index d0dc6d8ea4..0000000000 --- a/libs/libsndfile/tests/win32_test.c +++ /dev/null @@ -1,318 +0,0 @@ -/* -** Copyright (C) 2001-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" -#include "sndfile.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#if (HAVE_DECL_S_IRGRP == 0) -#include -#endif - -#include -#include -#include -#include -#include - -#define SIGNED_SIZEOF(x) ((int) sizeof (x)) - -/* EMX is OS/2. */ -#if defined (__CYGWIN__) || defined (__EMX__) - - #define LSEEK lseek - #define FSTAT fstat - - typedef struct stat STATBUF ; - typedef off_t INT64 ; - - static char dir_cmd [] = "ls -l" ; - -#elif (defined (WIN32) || defined (_WIN32)) - - #define LSEEK _lseeki64 - #define FSTAT _fstati64 - - typedef struct _stati64 STATBUF ; - typedef __int64 INT64 ; - - static char dir_cmd [] = "dir" ; - -#else - - #define LSEEK lseek - #define FSTAT fstat - - typedef struct stat STATBUF ; - typedef sf_count_t INT64 ; - - #define O_BINARY 0 - static char dir_cmd [] = "ls -l" ; - -#endif - -static void show_fstat_error (void) ; -static void show_lseek_error (void) ; -static void show_stat_fstat_error (void) ; -static void write_to_closed_file (void) ; - -int -main (void) -{ - puts ("\n\n\n\n" - "This program shows up errors in the Win32 implementation of\n" - "a couple of POSIX API functions on some versions of windoze.\n" - "It can also be compiled on Linux (which works correctly) and\n" - "other OSes just to provide a sanity check.\n" - ) ; - - show_fstat_error () ; - show_lseek_error () ; - show_stat_fstat_error () ; - write_to_closed_file () ; - - puts ("\n\n") ; - - return 0 ; -} /* main */ - -static void -show_fstat_error (void) -{ static const char *filename = "fstat.dat" ; - static char data [256] ; - - STATBUF statbuf ; - int fd, mode, flags ; - - if (sizeof (statbuf.st_size) != sizeof (INT64)) - { printf ("\n\nLine %d: Error, sizeof (statbuf.st_size) != 8.\n\n", __LINE__) ; - return ; - } ; - - puts ("\n64 bit fstat() test.\n--------------------") ; - - printf ("0) Create a file, write %d bytes and close it.\n", SIGNED_SIZEOF (data)) ; - mode = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY ; - flags = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ; - if ((fd = open (filename, mode, flags)) < 0) - { printf ("\n\nLine %d: open() failed : %s\n\n", __LINE__, strerror (errno)) ; - return ; - } ; - assert (write (fd, data, sizeof (data)) > 0) ; - close (fd) ; - - printf ("1) Re-open file in read/write mode and write another %d bytes at the end.\n", SIGNED_SIZEOF (data)) ; - mode = O_RDWR | O_BINARY ; - flags = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ; - if ((fd = open (filename, mode, flags)) < 0) - { printf ("\n\nLine %d: open() failed : %s\n\n", __LINE__, strerror (errno)) ; - return ; - } ; - LSEEK (fd, 0, SEEK_END) ; - assert (write (fd, data, sizeof (data)) > 0) ; - - printf ("2) Now use system (\"%s %s\") to show the file length.\n\n", dir_cmd, filename) ; - - /* Would use snprintf, but thats not really available on windows. */ - memset (data, 0, sizeof (data)) ; - strncpy (data, dir_cmd, sizeof (data) - 1) ; - strncat (data, " ", sizeof (data) - 1 - strlen (data)) ; - strncat (data, filename, sizeof (data) - 1 - strlen (data)) ; - - assert (system (data) >= 0) ; - puts ("") ; - - printf ("3) Now use fstat() to get the file length.\n") ; - if (FSTAT (fd, &statbuf) != 0) - { printf ("\n\nLine %d: fstat() returned error : %s\n", __LINE__, strerror (errno)) ; - return ; - } ; - - printf ("4) According to fstat(), the file length is %ld, ", (long) statbuf.st_size) ; - - close (fd) ; - - if (statbuf.st_size != 2 * sizeof (data)) - printf ("but thats just plain ***WRONG***.\n\n") ; - else - { printf ("which is correct.\n\n") ; - unlink (filename) ; - } ; - -} /* show_fstat_error */ - -static void -show_lseek_error (void) -{ static const char *filename = "fstat.dat" ; - static char data [256] ; - - INT64 retval ; - int fd, mode, flags ; - - puts ("\n64 bit lseek() test.\n--------------------") ; - - printf ("0) Create a file, write %d bytes and close it.\n", SIGNED_SIZEOF (data)) ; - mode = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY ; - flags = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ; - if ((fd = open (filename, mode, flags)) < 0) - { printf ("\n\nLine %d: open() failed : %s\n\n", __LINE__, strerror (errno)) ; - return ; - } ; - assert (write (fd, data, sizeof (data)) > 0) ; - close (fd) ; - - printf ("1) Re-open file in read/write mode and write another %d bytes at the end.\n", SIGNED_SIZEOF (data)) ; - mode = O_RDWR | O_BINARY ; - flags = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ; - if ((fd = open (filename, mode, flags)) < 0) - { printf ("\n\nLine %d: open() failed : %s\n\n", __LINE__, strerror (errno)) ; - return ; - } ; - - LSEEK (fd, 0, SEEK_END) ; - assert (write (fd, data, sizeof (data)) > 0) ; - - printf ("2) Now use system (\"%s %s\") to show the file length.\n\n", dir_cmd, filename) ; - - /* Would use snprintf, but thats not really available on windows. */ - memset (data, 0, sizeof (data)) ; - strncpy (data, dir_cmd, sizeof (data) - 1) ; - strncat (data, " ", sizeof (data) - 1 - strlen (data)) ; - strncat (data, filename, sizeof (data) - 1 - strlen (data)) ; - - assert (system (data) >= 0) ; - puts ("") ; - - printf ("3) Now use lseek() to go to the end of the file.\n") ; - retval = LSEEK (fd, 0, SEEK_END) ; - - printf ("4) We are now at position %ld, ", (long) retval) ; - - close (fd) ; - - if (retval != 2 * sizeof (data)) - printf ("but thats just plain ***WRONG***.\n\n") ; - else - { printf ("which is correct.\n\n") ; - unlink (filename) ; - } ; - -} /* show_lseek_error */ - -static void -show_stat_fstat_error (void) -{ static const char *filename = "stat_fstat.dat" ; - static char data [256] ; - - int fd, mode, flags ; - int stat_size, fstat_size ; - struct stat buf ; - - /* Known to fail on WinXP. */ - puts ("\nstat/fstat test.\n----------------") ; - - printf ("0) Create a file and write %d bytes.\n", SIGNED_SIZEOF (data)) ; - - mode = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY ; - flags = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ; - if ((fd = open (filename, mode, flags)) < 0) - { printf ("\n\nLine %d: open() failed : %s\n\n", __LINE__, strerror (errno)) ; - return ; - } ; - - assert (write (fd, data, sizeof (data)) > 0) ; - - printf ("1) Now call stat and fstat on the file and retreive the file lengths.\n") ; - - if (stat (filename, &buf) != 0) - { printf ("\n\nLine %d: stat() failed : %s\n\n", __LINE__, strerror (errno)) ; - goto error_exit ; - } ; - stat_size = buf.st_size ; - - if (fstat (fd, &buf) != 0) - { printf ("\n\nLine %d: fstat() failed : %s\n\n", __LINE__, strerror (errno)) ; - goto error_exit ; - } ; - fstat_size = buf.st_size ; - - printf ("2) Size returned by stat and fstat is %d and %d, ", stat_size, fstat_size) ; - - - if (stat_size == 0 || stat_size != fstat_size) - printf ("but thats just plain ***WRONG***.\n\n") ; - else - printf ("which is correct.\n\n") ; - -error_exit : - - close (fd) ; - unlink (filename) ; - - return ; -} /* show_stat_fstat_error */ - - -static void -write_to_closed_file (void) -{ const char * filename = "closed_write_test.txt" ; - struct stat buf ; - FILE * file ; - int fd ; - - puts ("\nWrite to closed file test.\n--------------------------") ; - - printf ("0) First we open file for write using fopen().\n") ; - if ((file = fopen (filename, "w")) == NULL) - { printf ("\n\nLine %d: fopen() failed : %s\n\n", __LINE__, strerror (errno)) ; - return ; - } ; - - printf ("1) Now we grab the file descriptor fileno().\n") ; - fd = fileno (file) ; - - printf ("2) Write some text via the file descriptor.\n") ; - assert (write (fd, "a\n", 2) > 0) ; - - printf ("3) Now we close the file using fclose().\n") ; - fclose (file) ; - - stat (filename, &buf) ; - printf (" File size is %d bytes.\n", (int) buf.st_size) ; - - printf ("4) Now write more data to the file descriptor which should fail.\n") ; - if (write (fd, "b\n", 2) < 0) - printf ("5) Good, write returned an error code as it should have.\n") ; - else - { printf ("5) Attempting to write to a closed file should have failed but didn't! *** WRONG ***\n") ; - - stat (filename, &buf) ; - printf (" File size is %d bytes.\n", (int) buf.st_size) ; - } ; - - unlink (filename) ; - - return ; -} /* write_to_closed_file */ diff --git a/libs/libsndfile/tests/write_read_test.c b/libs/libsndfile/tests/write_read_test.c deleted file mode 100644 index 9f8a8f538b..0000000000 --- a/libs/libsndfile/tests/write_read_test.c +++ /dev/null @@ -1,3731 +0,0 @@ -/* -** Copyright (C) 1999-2011 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#if (defined (WIN32) || defined (_WIN32)) -#include -static int truncate (const char *filename, int ignored) ; -#endif - -#include - -#include "utils.h" -#include "generate.h" - -#define SAMPLE_RATE 11025 -#define DATA_LENGTH (1<<12) - -#define SILLY_WRITE_COUNT (234) - -static void pcm_test_char (const char *str, int format, int long_file_okz) ; -static void pcm_test_short (const char *str, int format, int long_file_okz) ; -static void pcm_test_24bit (const char *str, int format, int long_file_okz) ; -static void pcm_test_int (const char *str, int format, int long_file_okz) ; -static void pcm_test_float (const char *str, int format, int long_file_okz) ; -static void pcm_test_double (const char *str, int format, int long_file_okz) ; - -static void empty_file_test (const char *filename, int format) ; - -typedef union -{ double d [DATA_LENGTH] ; - float f [DATA_LENGTH] ; - int i [DATA_LENGTH] ; - short s [DATA_LENGTH] ; - char c [DATA_LENGTH] ; -} BUFFER ; - -static BUFFER orig_data ; -static BUFFER test_data ; - -int -main (int argc, char **argv) -{ int do_all = 0 ; - int test_count = 0 ; - - count_open_files () ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" wav - test WAV file functions (little endian)\n") ; - printf (" aiff - test AIFF file functions (big endian)\n") ; - printf (" au - test AU file functions\n") ; - printf (" avr - test AVR file functions\n") ; - printf (" caf - test CAF file functions\n") ; - printf (" raw - test RAW header-less PCM file functions\n") ; - printf (" paf - test PAF file functions\n") ; - printf (" svx - test 8SVX/16SV file functions\n") ; - printf (" nist - test NIST Sphere file functions\n") ; - printf (" ircam - test IRCAM file functions\n") ; - printf (" voc - Create Voice file functions\n") ; - printf (" w64 - Sonic Foundry's W64 file functions\n") ; - printf (" flac - test FLAC file functions\n") ; - printf (" mpc2k - test MPC 2000 file functions\n") ; - printf (" rf64 - test RF64 file functions\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all = !strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "wav")) - { pcm_test_char ("char.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_32, SF_FALSE) ; - - pcm_test_char ("char.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_PCM_32, SF_FALSE) ; - - pcm_test_24bit ("24bit.wavex" , SF_FORMAT_WAVEX | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.wavex" , SF_FORMAT_WAVEX | SF_FORMAT_PCM_32, SF_FALSE) ; - - /* Lite remove start */ - pcm_test_float ("float.wav" , SF_FORMAT_WAV | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.wav" , SF_FORMAT_WAV | SF_FORMAT_DOUBLE, SF_FALSE) ; - - pcm_test_float ("float.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_DOUBLE, SF_FALSE) ; - - pcm_test_float ("float.wavex" , SF_FORMAT_WAVEX | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.wavex" , SF_FORMAT_WAVEX | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - - empty_file_test ("empty_char.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_U8) ; - empty_file_test ("empty_short.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.wav", SF_FORMAT_WAV | SF_FORMAT_FLOAT) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { pcm_test_char ("char_u8.aiff" , SF_FORMAT_AIFF | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_char ("char_s8.aiff" , SF_FORMAT_AIFF | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.aiff" , SF_FORMAT_AIFF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.aiff" , SF_FORMAT_AIFF | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.aiff" , SF_FORMAT_AIFF | SF_FORMAT_PCM_32, SF_FALSE) ; - - pcm_test_short ("short_sowt.aifc" , SF_ENDIAN_LITTLE | SF_FORMAT_AIFF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_sowt.aifc" , SF_ENDIAN_LITTLE | SF_FORMAT_AIFF | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_sowt.aifc" , SF_ENDIAN_LITTLE | SF_FORMAT_AIFF | SF_FORMAT_PCM_32, SF_FALSE) ; - - pcm_test_short ("short_twos.aifc" , SF_ENDIAN_BIG | SF_FORMAT_AIFF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_twos.aifc" , SF_ENDIAN_BIG | SF_FORMAT_AIFF | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_twos.aifc" , SF_ENDIAN_BIG | SF_FORMAT_AIFF | SF_FORMAT_PCM_32, SF_FALSE) ; - - /* Lite remove start */ - pcm_test_short ("dwvw16.aifc", SF_FORMAT_AIFF | SF_FORMAT_DWVW_16, SF_TRUE) ; - pcm_test_24bit ("dwvw24.aifc", SF_FORMAT_AIFF | SF_FORMAT_DWVW_24, SF_TRUE) ; - - pcm_test_float ("float.aifc" , SF_FORMAT_AIFF | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.aifc" , SF_FORMAT_AIFF | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - - empty_file_test ("empty_char.aiff", SF_FORMAT_AIFF | SF_FORMAT_PCM_U8) ; - empty_file_test ("empty_short.aiff", SF_FORMAT_AIFF | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.aiff", SF_FORMAT_AIFF | SF_FORMAT_FLOAT) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "au")) - { pcm_test_char ("char.au" , SF_FORMAT_AU | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.au" , SF_FORMAT_AU | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.au" , SF_FORMAT_AU | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.au" , SF_FORMAT_AU | SF_FORMAT_PCM_32, SF_FALSE) ; - /* Lite remove start */ - pcm_test_float ("float.au" , SF_FORMAT_AU | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.au", SF_FORMAT_AU | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - - pcm_test_char ("char_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_32, SF_FALSE) ; - /* Lite remove start */ - pcm_test_float ("float_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "caf")) - { pcm_test_char ("char.caf" , SF_FORMAT_CAF | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.caf" , SF_FORMAT_CAF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.caf" , SF_FORMAT_CAF | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.caf" , SF_FORMAT_CAF | SF_FORMAT_PCM_32, SF_FALSE) ; - /* Lite remove start */ - pcm_test_float ("float.caf" , SF_FORMAT_CAF | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.caf" , SF_FORMAT_CAF | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - - pcm_test_short ("short_le.caf" , SF_ENDIAN_LITTLE | SF_FORMAT_CAF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_le.caf" , SF_ENDIAN_LITTLE | SF_FORMAT_CAF | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_le.caf" , SF_ENDIAN_LITTLE | SF_FORMAT_CAF | SF_FORMAT_PCM_32, SF_FALSE) ; - /* Lite remove start */ - pcm_test_float ("float_le.caf" , SF_ENDIAN_LITTLE | SF_FORMAT_CAF | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double_le.caf", SF_ENDIAN_LITTLE | SF_FORMAT_CAF | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "raw")) - { pcm_test_char ("char_s8.raw" , SF_FORMAT_RAW | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_char ("char_u8.raw" , SF_FORMAT_RAW | SF_FORMAT_PCM_U8, SF_FALSE) ; - - pcm_test_short ("short_le.raw" , SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_be.raw" , SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_le.raw" , SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_24bit ("24bit_be.raw" , SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_le.raw" , SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_int ("int_be.raw" , SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_32, SF_FALSE) ; - - /* Lite remove start */ - pcm_test_float ("float_le.raw" , SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_float ("float_be.raw" , SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_FLOAT , SF_FALSE) ; - - pcm_test_double ("double_le.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, SF_FALSE) ; - pcm_test_double ("double_be.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - test_count++ ; - } ; - - /* Lite remove start */ - if (do_all || ! strcmp (argv [1], "paf")) - { pcm_test_char ("char_le.paf", SF_ENDIAN_LITTLE | SF_FORMAT_PAF | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_char ("char_be.paf", SF_ENDIAN_BIG | SF_FORMAT_PAF | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short_le.paf", SF_ENDIAN_LITTLE | SF_FORMAT_PAF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_be.paf", SF_ENDIAN_BIG | SF_FORMAT_PAF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_le.paf", SF_ENDIAN_LITTLE | SF_FORMAT_PAF | SF_FORMAT_PCM_24, SF_TRUE) ; - pcm_test_24bit ("24bit_be.paf", SF_ENDIAN_BIG | SF_FORMAT_PAF | SF_FORMAT_PCM_24, SF_TRUE) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "svx")) - { pcm_test_char ("char.svx" , SF_FORMAT_SVX | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.svx", SF_FORMAT_SVX | SF_FORMAT_PCM_16, SF_FALSE) ; - - empty_file_test ("empty_char.svx", SF_FORMAT_SVX | SF_FORMAT_PCM_S8) ; - empty_file_test ("empty_short.svx", SF_FORMAT_SVX | SF_FORMAT_PCM_16) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "nist")) - { pcm_test_short ("short_le.nist", SF_ENDIAN_LITTLE | SF_FORMAT_NIST | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_be.nist", SF_ENDIAN_BIG | SF_FORMAT_NIST | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_le.nist", SF_ENDIAN_LITTLE | SF_FORMAT_NIST | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_24bit ("24bit_be.nist", SF_ENDIAN_BIG | SF_FORMAT_NIST | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_le.nist" , SF_ENDIAN_LITTLE | SF_FORMAT_NIST | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_int ("int_be.nist" , SF_ENDIAN_BIG | SF_FORMAT_NIST | SF_FORMAT_PCM_32, SF_FALSE) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "ircam")) - { pcm_test_short ("short_be.ircam" , SF_ENDIAN_BIG | SF_FORMAT_IRCAM | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_le.ircam" , SF_ENDIAN_LITTLE | SF_FORMAT_IRCAM | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_int ("int_be.ircam" , SF_ENDIAN_BIG | SF_FORMAT_IRCAM | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_int ("int_le.ircam" , SF_ENDIAN_LITTLE | SF_FORMAT_IRCAM | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_float ("float_be.ircam" , SF_ENDIAN_BIG | SF_FORMAT_IRCAM | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_float ("float_le.ircam" , SF_ENDIAN_LITTLE | SF_FORMAT_IRCAM | SF_FORMAT_FLOAT , SF_FALSE) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "voc")) - { pcm_test_char ("char.voc" , SF_FORMAT_VOC | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short.voc", SF_FORMAT_VOC | SF_FORMAT_PCM_16, SF_FALSE) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat4")) - { pcm_test_short ("short_be.mat4" , SF_ENDIAN_BIG | SF_FORMAT_MAT4 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_le.mat4" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT4 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_int ("int_be.mat4" , SF_ENDIAN_BIG | SF_FORMAT_MAT4 | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_int ("int_le.mat4" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT4 | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_float ("float_be.mat4" , SF_ENDIAN_BIG | SF_FORMAT_MAT4 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_float ("float_le.mat4" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT4 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double_be.mat4" , SF_ENDIAN_BIG | SF_FORMAT_MAT4 | SF_FORMAT_DOUBLE, SF_FALSE) ; - pcm_test_double ("double_le.mat4" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT4 | SF_FORMAT_DOUBLE, SF_FALSE) ; - - empty_file_test ("empty_short.mat4", SF_FORMAT_MAT4 | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.mat4", SF_FORMAT_MAT4 | SF_FORMAT_FLOAT) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat5")) - { pcm_test_char ("char_be.mat5" , SF_ENDIAN_BIG | SF_FORMAT_MAT5 | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_char ("char_le.mat5" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT5 | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short_be.mat5" , SF_ENDIAN_BIG | SF_FORMAT_MAT5 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_le.mat5" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT5 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_int ("int_be.mat5" , SF_ENDIAN_BIG | SF_FORMAT_MAT5 | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_int ("int_le.mat5" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT5 | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_float ("float_be.mat5" , SF_ENDIAN_BIG | SF_FORMAT_MAT5 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_float ("float_le.mat5" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT5 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double_be.mat5" , SF_ENDIAN_BIG | SF_FORMAT_MAT5 | SF_FORMAT_DOUBLE, SF_FALSE) ; - pcm_test_double ("double_le.mat5" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT5 | SF_FORMAT_DOUBLE, SF_FALSE) ; - - increment_open_file_count () ; - - empty_file_test ("empty_char.mat5", SF_FORMAT_MAT5 | SF_FORMAT_PCM_U8) ; - empty_file_test ("empty_short.mat5", SF_FORMAT_MAT5 | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.mat5", SF_FORMAT_MAT5 | SF_FORMAT_FLOAT) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "pvf")) - { pcm_test_char ("char.pvf" , SF_FORMAT_PVF | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.pvf", SF_FORMAT_PVF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_int ("int.pvf" , SF_FORMAT_PVF | SF_FORMAT_PCM_32, SF_FALSE) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "htk")) - { pcm_test_short ("short.htk", SF_FORMAT_HTK | SF_FORMAT_PCM_16, SF_FALSE) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mpc2k")) - { pcm_test_short ("short.mpc", SF_FORMAT_MPC2K | SF_FORMAT_PCM_16, SF_FALSE) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "avr")) - { pcm_test_char ("char_u8.avr" , SF_FORMAT_AVR | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_char ("char_s8.avr" , SF_FORMAT_AVR | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.avr" , SF_FORMAT_AVR | SF_FORMAT_PCM_16, SF_FALSE) ; - test_count++ ; - } ; - /* Lite remove end */ - - if (do_all || ! strcmp (argv [1], "w64")) - { pcm_test_char ("char.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_32, SF_FALSE) ; - /* Lite remove start */ - pcm_test_float ("float.w64" , SF_FORMAT_W64 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.w64" , SF_FORMAT_W64 | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - - empty_file_test ("empty_char.w64", SF_FORMAT_W64 | SF_FORMAT_PCM_U8) ; - empty_file_test ("empty_short.w64", SF_FORMAT_W64 | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.w64", SF_FORMAT_W64 | SF_FORMAT_FLOAT) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "sds")) - { pcm_test_char ("char.sds" , SF_FORMAT_SDS | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.sds" , SF_FORMAT_SDS | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.sds" , SF_FORMAT_SDS | SF_FORMAT_PCM_24, SF_FALSE) ; - - empty_file_test ("empty_char.sds", SF_FORMAT_SDS | SF_FORMAT_PCM_S8) ; - empty_file_test ("empty_short.sds", SF_FORMAT_SDS | SF_FORMAT_PCM_16) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "sd2")) - { pcm_test_char ("char.sd2" , SF_FORMAT_SD2 | SF_FORMAT_PCM_S8, SF_TRUE) ; - pcm_test_short ("short.sd2" , SF_FORMAT_SD2 | SF_FORMAT_PCM_16, SF_TRUE) ; - pcm_test_24bit ("24bit.sd2" , SF_FORMAT_SD2 | SF_FORMAT_PCM_24, SF_TRUE) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "flac")) - { if (HAVE_EXTERNAL_LIBS) - { pcm_test_char ("char.flac" , SF_FORMAT_FLAC | SF_FORMAT_PCM_S8, SF_TRUE) ; - pcm_test_short ("short.flac" , SF_FORMAT_FLAC | SF_FORMAT_PCM_16, SF_TRUE) ; - pcm_test_24bit ("24bit.flac" , SF_FORMAT_FLAC | SF_FORMAT_PCM_24, SF_TRUE) ; - } - else - puts (" No FLAC tests because FLAC support was not compiled in.") ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "rf64")) - { pcm_test_char ("char.rf64" , SF_FORMAT_RF64 | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short.rf64" , SF_FORMAT_RF64 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.rf64" , SF_FORMAT_RF64 | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.rf64" , SF_FORMAT_RF64 | SF_FORMAT_PCM_32, SF_FALSE) ; - - /* Lite remove start */ - pcm_test_float ("float.rf64" , SF_FORMAT_RF64 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.rf64" , SF_FORMAT_RF64 | SF_FORMAT_DOUBLE, SF_FALSE) ; - empty_file_test ("empty_char.rf64", SF_FORMAT_RF64 | SF_FORMAT_PCM_U8) ; - empty_file_test ("empty_short.rf64", SF_FORMAT_RF64 | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.rf64", SF_FORMAT_RF64 | SF_FORMAT_FLOAT) ; - /* Lite remove end */ - - test_count++ ; - } ; - - if (test_count == 0) - { printf ("Mono : ************************************\n") ; - printf ("Mono : * No '%s' test defined.\n", argv [1]) ; - printf ("Mono : ************************************\n") ; - return 1 ; - } ; - - /* Only open file descriptors should be stdin, stdout and stderr. */ - check_open_file_count_or_die (__LINE__) ; - - return 0 ; -} /* main */ - -/*============================================================================================ -** Helper functions and macros. -*/ - -static void create_short_file (const char *filename) ; - -#define CHAR_ERROR(x,y) (abs ((x) - (y)) > 255) -#define INT_ERROR(x,y) (((x) - (y)) != 0) -#define TRIBYTE_ERROR(x,y) (abs ((x) - (y)) > 255) -#define FLOAT_ERROR(x,y) (fabs ((x) - (y)) > 1e-5) - -#define CONVERT_DATA(k,len,new,orig) \ - { for ((k) = 0 ; (k) < (len) ; (k) ++) \ - (new) [k] = (orig) [k] ; \ - } - - -/*====================================================================================== -*/ - -static void mono_char_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void stereo_char_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void mono_rdwr_char_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void new_rdwr_char_test (const char *filename, int format, int allow_fd) ; -static void multi_seek_test (const char * filename, int format) ; -static void write_seek_extend_test (const char * filename, int format) ; - -static void -pcm_test_char (const char *filename, int format, int long_file_ok) -{ SF_INFO sfinfo ; - short *orig ; - int k, allow_fd ; - - /* Sd2 files cannot be opened from an existing file descriptor. */ - allow_fd = ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) ? SF_FALSE : SF_TRUE ; - - print_test_name ("pcm_test_char", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, 32000.0) ; - - orig = orig_data.s ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - /* Some test broken out here. */ - - mono_char_test (filename, format, long_file_ok, allow_fd) ; - - /* Sub format DWVW does not allow seeking. */ - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { unlink (filename) ; - printf ("no seek : ok\n") ; - return ; - } ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - mono_rdwr_char_test (filename, format, long_file_ok, allow_fd) ; - - /* If the format doesn't support stereo we're done. */ - sfinfo.channels = 2 ; - if (sf_format_check (&sfinfo) == 0) - { unlink (filename) ; - puts ("no stereo : ok") ; - return ; - } ; - - stereo_char_test (filename, format, long_file_ok, allow_fd) ; - - /* New read/write test. Not sure if this is needed yet. */ - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_PAF && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_VOC && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - new_rdwr_char_test (filename, format, allow_fd) ; - - delete_file (format, filename) ; - - puts ("ok") ; - return ; -} /* pcm_test_char */ - -static void -mono_char_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - short *orig, *test ; - sf_count_t count ; - int k, items ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - orig = orig_data.s ; - test = test_data.s ; - - items = DATA_LENGTH ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_write_short_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - test_write_short_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - - /* Add non-audio data after the audio. */ - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (short)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Mono : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too long). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Mono : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_short_or_die (file, 0, test, items, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (CHAR_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d: Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - oct_save_short (orig, test, items) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_short_or_die (file, 0, test, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (CHAR_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { sf_close (file) ; - unlink (filename) ; - printf ("no seek : ") ; - return ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, items + 10, SEEK_SET, items + 10, sfinfo.channels, __LINE__) ; - - test_read_short_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (CHAR_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 6, SEEK_CUR, items + 20, sfinfo.channels, __LINE__) ; - - test_read_short_or_die (file, 0, test + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (CHAR_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_read_short_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (CHAR_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample D (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Check read past end of file followed by sf_seek (sndfile, 0, SEEK_CUR). */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - count = 0 ; - while (count < sfinfo.frames) - count += sf_read_short (file, test, 311) ; - - /* Check that no error has occurred. */ - if (sf_error (file)) - { printf ("\n\nLine %d : Mono : error where there shouldn't have been one.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - /* Check that we haven't read beyond EOF. */ - if (count > sfinfo.frames) - { printf ("\n\nLines %d : read past end of file (%ld should be %ld)\n", __LINE__, (long) count, (long) sfinfo.frames) ; - exit (1) ; - } ; - - test_seek_or_die (file, 0, SEEK_CUR, sfinfo.frames, sfinfo.channels, __LINE__) ; - - sf_close (file) ; - - multi_seek_test (filename, format) ; - write_seek_extend_test (filename, format) ; - -} /* mono_char_test */ - -static void -stereo_char_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - short *orig, *test ; - int k, items, frames ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, 32000.0) ; - - orig = orig_data.s ; - test = test_data.s ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_writef_short_or_die (file, 0, orig, frames, __LINE__) ; - - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (short)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Stereo : Returned format incorrect (0x%08X => 0x%08X).\n", - __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too short). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too long). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 2) - { printf ("\n\nLine %d : Stereo : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_short_or_die (file, 0, test, frames, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (CHAR_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_readf_short_or_die (file, 0, test, 2, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (CHAR_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - /* Check for errors here. */ - if (sf_error (file)) - { printf ("Line %d: Should NOT return an error.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - if (sf_read_short (file, test, 1) > 0) - { printf ("Line %d: Should return 0.\n", __LINE__) ; - exit (1) ; - } ; - - if (! sf_error (file)) - { printf ("Line %d: Should return an error.\n", __LINE__) ; - exit (1) ; - } ; - /*-----------------------*/ - - test_readf_short_or_die (file, 0, test + 10, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (CHAR_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 8, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_readf_short_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 40 ; k < 44 ; k++) - if (CHAR_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_readf_short_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (CHAR_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - sf_close (file) ; -} /* stereo_char_test */ - -static void -mono_rdwr_char_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - short *orig, *test ; - int k, pass ; - - orig = orig_data.s ; - test = test_data.s ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - if ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_RAW - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_AU - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) - unlink (filename) ; - else - { /* Create a short file. */ - create_short_file (filename) ; - - /* Opening a already existing short file (ie invalid header) RDWR is disallowed. - ** If this returns a valif pointer sf_open() screwed up. - */ - if ((file = sf_open (filename, SFM_RDWR, &sfinfo))) - { printf ("\n\nLine %d: sf_open should (SFM_RDWR) have failed but didn't.\n", __LINE__) ; - exit (1) ; - } ; - - /* Truncate the file to zero bytes. */ - if (truncate (filename, 0) < 0) - { printf ("\n\nLine %d: truncate (%s) failed", __LINE__, filename) ; - perror (NULL) ; - exit (1) ; - } ; - } ; - - /* Opening a zero length file RDWR is allowed, but the SF_INFO struct must contain - ** all the usual data required when opening the file in WRITE mode. - */ - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - /* Do 3 writes followed by reads. After each, check the data and the current - ** read and write offsets. - */ - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - /* Write some data. */ - test_write_short_or_die (file, pass, orig, DATA_LENGTH, __LINE__) ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, pass * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_short_or_die (file, 0, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (CHAR_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) A : Error at sample %d (0x%X => 0x%X).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_short (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - test_read_write_position_or_die (file, __LINE__, pass, pass * DATA_LENGTH, pass * DATA_LENGTH) ; - } ; /* for (pass ...) */ - - sf_close (file) ; - - /* Open the file again to check the data. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Not enough frames in file. (%ld < %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } - - if (! long_file_ok && sfinfo.frames != 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Incorrect number of frames in file. (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - if (! long_file_ok) - test_read_write_position_or_die (file, __LINE__, 0, 0, 3 * DATA_LENGTH) ; - else - test_seek_or_die (file, 3 * DATA_LENGTH, SFM_WRITE | SEEK_SET, 3 * DATA_LENGTH, sfinfo.channels, __LINE__) ; - - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, 3 * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_short_or_die (file, pass, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (CHAR_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) B : Error at sample %d (0x%X => 0x%X).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_short (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - } ; /* for (pass ...) */ - - sf_close (file) ; -} /* mono_rdwr_short_test */ - -static void -new_rdwr_char_test (const char *filename, int format, int allow_fd) -{ SNDFILE *wfile, *rwfile ; - SF_INFO sfinfo ; - short *orig, *test ; - int items, frames ; - - orig = orig_data.s ; - test = test_data.s ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - wfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - sf_command (wfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ; - test_writef_short_or_die (wfile, 1, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - test_writef_short_or_die (wfile, 2, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - - rwfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - if (sfinfo.frames != 2 * frames) - { printf ("\n\nLine %d : incorrect number of frames in file (%ld should be %d)\n\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 2 * frames) ; - exit (1) ; - } ; - - test_writef_short_or_die (wfile, 3, orig, frames, __LINE__) ; - - test_readf_short_or_die (rwfile, 1, test, frames, __LINE__) ; - test_readf_short_or_die (rwfile, 2, test, frames, __LINE__) ; - - sf_close (wfile) ; - sf_close (rwfile) ; -} /* new_rdwr_char_test */ - - -/*====================================================================================== -*/ - -static void mono_short_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void stereo_short_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void mono_rdwr_short_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void new_rdwr_short_test (const char *filename, int format, int allow_fd) ; -static void multi_seek_test (const char * filename, int format) ; -static void write_seek_extend_test (const char * filename, int format) ; - -static void -pcm_test_short (const char *filename, int format, int long_file_ok) -{ SF_INFO sfinfo ; - short *orig ; - int k, allow_fd ; - - /* Sd2 files cannot be opened from an existing file descriptor. */ - allow_fd = ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) ? SF_FALSE : SF_TRUE ; - - print_test_name ("pcm_test_short", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, 32000.0) ; - - orig = orig_data.s ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - /* Some test broken out here. */ - - mono_short_test (filename, format, long_file_ok, allow_fd) ; - - /* Sub format DWVW does not allow seeking. */ - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { unlink (filename) ; - printf ("no seek : ok\n") ; - return ; - } ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - mono_rdwr_short_test (filename, format, long_file_ok, allow_fd) ; - - /* If the format doesn't support stereo we're done. */ - sfinfo.channels = 2 ; - if (sf_format_check (&sfinfo) == 0) - { unlink (filename) ; - puts ("no stereo : ok") ; - return ; - } ; - - stereo_short_test (filename, format, long_file_ok, allow_fd) ; - - /* New read/write test. Not sure if this is needed yet. */ - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_PAF && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_VOC && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - new_rdwr_short_test (filename, format, allow_fd) ; - - delete_file (format, filename) ; - - puts ("ok") ; - return ; -} /* pcm_test_short */ - -static void -mono_short_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - short *orig, *test ; - sf_count_t count ; - int k, items ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - orig = orig_data.s ; - test = test_data.s ; - - items = DATA_LENGTH ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_write_short_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - test_write_short_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - - /* Add non-audio data after the audio. */ - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (short)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Mono : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too long). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Mono : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_short_or_die (file, 0, test, items, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d: Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - oct_save_short (orig, test, items) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_short_or_die (file, 0, test, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { sf_close (file) ; - unlink (filename) ; - printf ("no seek : ") ; - return ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, items + 10, SEEK_SET, items + 10, sfinfo.channels, __LINE__) ; - - test_read_short_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 6, SEEK_CUR, items + 20, sfinfo.channels, __LINE__) ; - - test_read_short_or_die (file, 0, test + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_read_short_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample D (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Check read past end of file followed by sf_seek (sndfile, 0, SEEK_CUR). */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - count = 0 ; - while (count < sfinfo.frames) - count += sf_read_short (file, test, 311) ; - - /* Check that no error has occurred. */ - if (sf_error (file)) - { printf ("\n\nLine %d : Mono : error where there shouldn't have been one.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - /* Check that we haven't read beyond EOF. */ - if (count > sfinfo.frames) - { printf ("\n\nLines %d : read past end of file (%ld should be %ld)\n", __LINE__, (long) count, (long) sfinfo.frames) ; - exit (1) ; - } ; - - test_seek_or_die (file, 0, SEEK_CUR, sfinfo.frames, sfinfo.channels, __LINE__) ; - - sf_close (file) ; - - multi_seek_test (filename, format) ; - write_seek_extend_test (filename, format) ; - -} /* mono_short_test */ - -static void -stereo_short_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - short *orig, *test ; - int k, items, frames ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, 32000.0) ; - - orig = orig_data.s ; - test = test_data.s ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_writef_short_or_die (file, 0, orig, frames, __LINE__) ; - - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (short)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Stereo : Returned format incorrect (0x%08X => 0x%08X).\n", - __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too short). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too long). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 2) - { printf ("\n\nLine %d : Stereo : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_short_or_die (file, 0, test, frames, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (INT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_readf_short_or_die (file, 0, test, 2, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (INT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - /* Check for errors here. */ - if (sf_error (file)) - { printf ("Line %d: Should NOT return an error.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - if (sf_read_short (file, test, 1) > 0) - { printf ("Line %d: Should return 0.\n", __LINE__) ; - exit (1) ; - } ; - - if (! sf_error (file)) - { printf ("Line %d: Should return an error.\n", __LINE__) ; - exit (1) ; - } ; - /*-----------------------*/ - - test_readf_short_or_die (file, 0, test + 10, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (INT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 8, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_readf_short_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 40 ; k < 44 ; k++) - if (INT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_readf_short_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (INT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - sf_close (file) ; -} /* stereo_short_test */ - -static void -mono_rdwr_short_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - short *orig, *test ; - int k, pass ; - - orig = orig_data.s ; - test = test_data.s ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - if ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_RAW - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_AU - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) - unlink (filename) ; - else - { /* Create a short file. */ - create_short_file (filename) ; - - /* Opening a already existing short file (ie invalid header) RDWR is disallowed. - ** If this returns a valif pointer sf_open() screwed up. - */ - if ((file = sf_open (filename, SFM_RDWR, &sfinfo))) - { printf ("\n\nLine %d: sf_open should (SFM_RDWR) have failed but didn't.\n", __LINE__) ; - exit (1) ; - } ; - - /* Truncate the file to zero bytes. */ - if (truncate (filename, 0) < 0) - { printf ("\n\nLine %d: truncate (%s) failed", __LINE__, filename) ; - perror (NULL) ; - exit (1) ; - } ; - } ; - - /* Opening a zero length file RDWR is allowed, but the SF_INFO struct must contain - ** all the usual data required when opening the file in WRITE mode. - */ - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - /* Do 3 writes followed by reads. After each, check the data and the current - ** read and write offsets. - */ - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - /* Write some data. */ - test_write_short_or_die (file, pass, orig, DATA_LENGTH, __LINE__) ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, pass * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_short_or_die (file, 0, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) A : Error at sample %d (0x%X => 0x%X).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_short (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - test_read_write_position_or_die (file, __LINE__, pass, pass * DATA_LENGTH, pass * DATA_LENGTH) ; - } ; /* for (pass ...) */ - - sf_close (file) ; - - /* Open the file again to check the data. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Not enough frames in file. (%ld < %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } - - if (! long_file_ok && sfinfo.frames != 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Incorrect number of frames in file. (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - if (! long_file_ok) - test_read_write_position_or_die (file, __LINE__, 0, 0, 3 * DATA_LENGTH) ; - else - test_seek_or_die (file, 3 * DATA_LENGTH, SFM_WRITE | SEEK_SET, 3 * DATA_LENGTH, sfinfo.channels, __LINE__) ; - - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, 3 * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_short_or_die (file, pass, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) B : Error at sample %d (0x%X => 0x%X).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_short (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - } ; /* for (pass ...) */ - - sf_close (file) ; -} /* mono_rdwr_short_test */ - -static void -new_rdwr_short_test (const char *filename, int format, int allow_fd) -{ SNDFILE *wfile, *rwfile ; - SF_INFO sfinfo ; - short *orig, *test ; - int items, frames ; - - orig = orig_data.s ; - test = test_data.s ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - wfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - sf_command (wfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ; - test_writef_short_or_die (wfile, 1, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - test_writef_short_or_die (wfile, 2, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - - rwfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - if (sfinfo.frames != 2 * frames) - { printf ("\n\nLine %d : incorrect number of frames in file (%ld should be %d)\n\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 2 * frames) ; - exit (1) ; - } ; - - test_writef_short_or_die (wfile, 3, orig, frames, __LINE__) ; - - test_readf_short_or_die (rwfile, 1, test, frames, __LINE__) ; - test_readf_short_or_die (rwfile, 2, test, frames, __LINE__) ; - - sf_close (wfile) ; - sf_close (rwfile) ; -} /* new_rdwr_short_test */ - - -/*====================================================================================== -*/ - -static void mono_24bit_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void stereo_24bit_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void mono_rdwr_24bit_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void new_rdwr_24bit_test (const char *filename, int format, int allow_fd) ; -static void multi_seek_test (const char * filename, int format) ; -static void write_seek_extend_test (const char * filename, int format) ; - -static void -pcm_test_24bit (const char *filename, int format, int long_file_ok) -{ SF_INFO sfinfo ; - int *orig ; - int k, allow_fd ; - - /* Sd2 files cannot be opened from an existing file descriptor. */ - allow_fd = ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) ? SF_FALSE : SF_TRUE ; - - print_test_name ("pcm_test_24bit", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, (1.0 * 0x7F000000)) ; - - orig = orig_data.i ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - /* Some test broken out here. */ - - mono_24bit_test (filename, format, long_file_ok, allow_fd) ; - - /* Sub format DWVW does not allow seeking. */ - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { unlink (filename) ; - printf ("no seek : ok\n") ; - return ; - } ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - mono_rdwr_24bit_test (filename, format, long_file_ok, allow_fd) ; - - /* If the format doesn't support stereo we're done. */ - sfinfo.channels = 2 ; - if (sf_format_check (&sfinfo) == 0) - { unlink (filename) ; - puts ("no stereo : ok") ; - return ; - } ; - - stereo_24bit_test (filename, format, long_file_ok, allow_fd) ; - - /* New read/write test. Not sure if this is needed yet. */ - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_PAF && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_VOC && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - new_rdwr_24bit_test (filename, format, allow_fd) ; - - delete_file (format, filename) ; - - puts ("ok") ; - return ; -} /* pcm_test_24bit */ - -static void -mono_24bit_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int *orig, *test ; - sf_count_t count ; - int k, items ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - orig = orig_data.i ; - test = test_data.i ; - - items = DATA_LENGTH ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_write_int_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - test_write_int_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - - /* Add non-audio data after the audio. */ - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (int)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Mono : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too long). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Mono : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_int_or_die (file, 0, test, items, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (TRIBYTE_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d: Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - oct_save_int (orig, test, items) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_int_or_die (file, 0, test, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (TRIBYTE_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { sf_close (file) ; - unlink (filename) ; - printf ("no seek : ") ; - return ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, items + 10, SEEK_SET, items + 10, sfinfo.channels, __LINE__) ; - - test_read_int_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (TRIBYTE_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 6, SEEK_CUR, items + 20, sfinfo.channels, __LINE__) ; - - test_read_int_or_die (file, 0, test + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (TRIBYTE_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_read_int_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (TRIBYTE_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample D (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Check read past end of file followed by sf_seek (sndfile, 0, SEEK_CUR). */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - count = 0 ; - while (count < sfinfo.frames) - count += sf_read_int (file, test, 311) ; - - /* Check that no error has occurred. */ - if (sf_error (file)) - { printf ("\n\nLine %d : Mono : error where there shouldn't have been one.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - /* Check that we haven't read beyond EOF. */ - if (count > sfinfo.frames) - { printf ("\n\nLines %d : read past end of file (%ld should be %ld)\n", __LINE__, (long) count, (long) sfinfo.frames) ; - exit (1) ; - } ; - - test_seek_or_die (file, 0, SEEK_CUR, sfinfo.frames, sfinfo.channels, __LINE__) ; - - sf_close (file) ; - - multi_seek_test (filename, format) ; - write_seek_extend_test (filename, format) ; - -} /* mono_24bit_test */ - -static void -stereo_24bit_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int *orig, *test ; - int k, items, frames ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, (1.0 * 0x7F000000)) ; - - orig = orig_data.i ; - test = test_data.i ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_writef_int_or_die (file, 0, orig, frames, __LINE__) ; - - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (int)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Stereo : Returned format incorrect (0x%08X => 0x%08X).\n", - __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too short). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too long). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 2) - { printf ("\n\nLine %d : Stereo : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_int_or_die (file, 0, test, frames, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (TRIBYTE_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_readf_int_or_die (file, 0, test, 2, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (TRIBYTE_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - /* Check for errors here. */ - if (sf_error (file)) - { printf ("Line %d: Should NOT return an error.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - if (sf_read_int (file, test, 1) > 0) - { printf ("Line %d: Should return 0.\n", __LINE__) ; - exit (1) ; - } ; - - if (! sf_error (file)) - { printf ("Line %d: Should return an error.\n", __LINE__) ; - exit (1) ; - } ; - /*-----------------------*/ - - test_readf_int_or_die (file, 0, test + 10, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (TRIBYTE_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 8, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_readf_int_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 40 ; k < 44 ; k++) - if (TRIBYTE_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_readf_int_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (TRIBYTE_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - sf_close (file) ; -} /* stereo_24bit_test */ - -static void -mono_rdwr_24bit_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int *orig, *test ; - int k, pass ; - - orig = orig_data.i ; - test = test_data.i ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - if ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_RAW - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_AU - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) - unlink (filename) ; - else - { /* Create a short file. */ - create_short_file (filename) ; - - /* Opening a already existing short file (ie invalid header) RDWR is disallowed. - ** If this returns a valif pointer sf_open() screwed up. - */ - if ((file = sf_open (filename, SFM_RDWR, &sfinfo))) - { printf ("\n\nLine %d: sf_open should (SFM_RDWR) have failed but didn't.\n", __LINE__) ; - exit (1) ; - } ; - - /* Truncate the file to zero bytes. */ - if (truncate (filename, 0) < 0) - { printf ("\n\nLine %d: truncate (%s) failed", __LINE__, filename) ; - perror (NULL) ; - exit (1) ; - } ; - } ; - - /* Opening a zero length file RDWR is allowed, but the SF_INFO struct must contain - ** all the usual data required when opening the file in WRITE mode. - */ - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - /* Do 3 writes followed by reads. After each, check the data and the current - ** read and write offsets. - */ - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - /* Write some data. */ - test_write_int_or_die (file, pass, orig, DATA_LENGTH, __LINE__) ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, pass * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_int_or_die (file, 0, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (TRIBYTE_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) A : Error at sample %d (0x%X => 0x%X).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_int (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - test_read_write_position_or_die (file, __LINE__, pass, pass * DATA_LENGTH, pass * DATA_LENGTH) ; - } ; /* for (pass ...) */ - - sf_close (file) ; - - /* Open the file again to check the data. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Not enough frames in file. (%ld < %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } - - if (! long_file_ok && sfinfo.frames != 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Incorrect number of frames in file. (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - if (! long_file_ok) - test_read_write_position_or_die (file, __LINE__, 0, 0, 3 * DATA_LENGTH) ; - else - test_seek_or_die (file, 3 * DATA_LENGTH, SFM_WRITE | SEEK_SET, 3 * DATA_LENGTH, sfinfo.channels, __LINE__) ; - - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, 3 * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_int_or_die (file, pass, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (TRIBYTE_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) B : Error at sample %d (0x%X => 0x%X).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_int (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - } ; /* for (pass ...) */ - - sf_close (file) ; -} /* mono_rdwr_int_test */ - -static void -new_rdwr_24bit_test (const char *filename, int format, int allow_fd) -{ SNDFILE *wfile, *rwfile ; - SF_INFO sfinfo ; - int *orig, *test ; - int items, frames ; - - orig = orig_data.i ; - test = test_data.i ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - wfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - sf_command (wfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ; - test_writef_int_or_die (wfile, 1, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - test_writef_int_or_die (wfile, 2, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - - rwfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - if (sfinfo.frames != 2 * frames) - { printf ("\n\nLine %d : incorrect number of frames in file (%ld should be %d)\n\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 2 * frames) ; - exit (1) ; - } ; - - test_writef_int_or_die (wfile, 3, orig, frames, __LINE__) ; - - test_readf_int_or_die (rwfile, 1, test, frames, __LINE__) ; - test_readf_int_or_die (rwfile, 2, test, frames, __LINE__) ; - - sf_close (wfile) ; - sf_close (rwfile) ; -} /* new_rdwr_24bit_test */ - - -/*====================================================================================== -*/ - -static void mono_int_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void stereo_int_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void mono_rdwr_int_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void new_rdwr_int_test (const char *filename, int format, int allow_fd) ; -static void multi_seek_test (const char * filename, int format) ; -static void write_seek_extend_test (const char * filename, int format) ; - -static void -pcm_test_int (const char *filename, int format, int long_file_ok) -{ SF_INFO sfinfo ; - int *orig ; - int k, allow_fd ; - - /* Sd2 files cannot be opened from an existing file descriptor. */ - allow_fd = ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) ? SF_FALSE : SF_TRUE ; - - print_test_name ("pcm_test_int", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, (1.0 * 0x7F000000)) ; - - orig = orig_data.i ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - /* Some test broken out here. */ - - mono_int_test (filename, format, long_file_ok, allow_fd) ; - - /* Sub format DWVW does not allow seeking. */ - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { unlink (filename) ; - printf ("no seek : ok\n") ; - return ; - } ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - mono_rdwr_int_test (filename, format, long_file_ok, allow_fd) ; - - /* If the format doesn't support stereo we're done. */ - sfinfo.channels = 2 ; - if (sf_format_check (&sfinfo) == 0) - { unlink (filename) ; - puts ("no stereo : ok") ; - return ; - } ; - - stereo_int_test (filename, format, long_file_ok, allow_fd) ; - - /* New read/write test. Not sure if this is needed yet. */ - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_PAF && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_VOC && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - new_rdwr_int_test (filename, format, allow_fd) ; - - delete_file (format, filename) ; - - puts ("ok") ; - return ; -} /* pcm_test_int */ - -static void -mono_int_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int *orig, *test ; - sf_count_t count ; - int k, items ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - orig = orig_data.i ; - test = test_data.i ; - - items = DATA_LENGTH ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_write_int_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - test_write_int_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - - /* Add non-audio data after the audio. */ - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (int)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Mono : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too long). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Mono : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_int_or_die (file, 0, test, items, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d: Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - oct_save_int (orig, test, items) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_int_or_die (file, 0, test, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { sf_close (file) ; - unlink (filename) ; - printf ("no seek : ") ; - return ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, items + 10, SEEK_SET, items + 10, sfinfo.channels, __LINE__) ; - - test_read_int_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 6, SEEK_CUR, items + 20, sfinfo.channels, __LINE__) ; - - test_read_int_or_die (file, 0, test + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_read_int_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample D (#%d : 0x%X => 0x%X).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Check read past end of file followed by sf_seek (sndfile, 0, SEEK_CUR). */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - count = 0 ; - while (count < sfinfo.frames) - count += sf_read_int (file, test, 311) ; - - /* Check that no error has occurred. */ - if (sf_error (file)) - { printf ("\n\nLine %d : Mono : error where there shouldn't have been one.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - /* Check that we haven't read beyond EOF. */ - if (count > sfinfo.frames) - { printf ("\n\nLines %d : read past end of file (%ld should be %ld)\n", __LINE__, (long) count, (long) sfinfo.frames) ; - exit (1) ; - } ; - - test_seek_or_die (file, 0, SEEK_CUR, sfinfo.frames, sfinfo.channels, __LINE__) ; - - sf_close (file) ; - - multi_seek_test (filename, format) ; - write_seek_extend_test (filename, format) ; - -} /* mono_int_test */ - -static void -stereo_int_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int *orig, *test ; - int k, items, frames ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, (1.0 * 0x7F000000)) ; - - orig = orig_data.i ; - test = test_data.i ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_writef_int_or_die (file, 0, orig, frames, __LINE__) ; - - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (int)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Stereo : Returned format incorrect (0x%08X => 0x%08X).\n", - __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too short). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too long). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 2) - { printf ("\n\nLine %d : Stereo : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_int_or_die (file, 0, test, frames, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (INT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_readf_int_or_die (file, 0, test, 2, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (INT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - /* Check for errors here. */ - if (sf_error (file)) - { printf ("Line %d: Should NOT return an error.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - if (sf_read_int (file, test, 1) > 0) - { printf ("Line %d: Should return 0.\n", __LINE__) ; - exit (1) ; - } ; - - if (! sf_error (file)) - { printf ("Line %d: Should return an error.\n", __LINE__) ; - exit (1) ; - } ; - /*-----------------------*/ - - test_readf_int_or_die (file, 0, test + 10, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (INT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 8, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_readf_int_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 40 ; k < 44 ; k++) - if (INT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_readf_int_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (INT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : 0x%X => 0x%X).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - sf_close (file) ; -} /* stereo_int_test */ - -static void -mono_rdwr_int_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - int *orig, *test ; - int k, pass ; - - orig = orig_data.i ; - test = test_data.i ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - if ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_RAW - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_AU - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) - unlink (filename) ; - else - { /* Create a short file. */ - create_short_file (filename) ; - - /* Opening a already existing short file (ie invalid header) RDWR is disallowed. - ** If this returns a valif pointer sf_open() screwed up. - */ - if ((file = sf_open (filename, SFM_RDWR, &sfinfo))) - { printf ("\n\nLine %d: sf_open should (SFM_RDWR) have failed but didn't.\n", __LINE__) ; - exit (1) ; - } ; - - /* Truncate the file to zero bytes. */ - if (truncate (filename, 0) < 0) - { printf ("\n\nLine %d: truncate (%s) failed", __LINE__, filename) ; - perror (NULL) ; - exit (1) ; - } ; - } ; - - /* Opening a zero length file RDWR is allowed, but the SF_INFO struct must contain - ** all the usual data required when opening the file in WRITE mode. - */ - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - /* Do 3 writes followed by reads. After each, check the data and the current - ** read and write offsets. - */ - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - /* Write some data. */ - test_write_int_or_die (file, pass, orig, DATA_LENGTH, __LINE__) ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, pass * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_int_or_die (file, 0, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) A : Error at sample %d (0x%X => 0x%X).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_int (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - test_read_write_position_or_die (file, __LINE__, pass, pass * DATA_LENGTH, pass * DATA_LENGTH) ; - } ; /* for (pass ...) */ - - sf_close (file) ; - - /* Open the file again to check the data. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Not enough frames in file. (%ld < %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } - - if (! long_file_ok && sfinfo.frames != 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Incorrect number of frames in file. (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - if (! long_file_ok) - test_read_write_position_or_die (file, __LINE__, 0, 0, 3 * DATA_LENGTH) ; - else - test_seek_or_die (file, 3 * DATA_LENGTH, SFM_WRITE | SEEK_SET, 3 * DATA_LENGTH, sfinfo.channels, __LINE__) ; - - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, 3 * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_int_or_die (file, pass, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (INT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) B : Error at sample %d (0x%X => 0x%X).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_int (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - } ; /* for (pass ...) */ - - sf_close (file) ; -} /* mono_rdwr_int_test */ - -static void -new_rdwr_int_test (const char *filename, int format, int allow_fd) -{ SNDFILE *wfile, *rwfile ; - SF_INFO sfinfo ; - int *orig, *test ; - int items, frames ; - - orig = orig_data.i ; - test = test_data.i ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - wfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - sf_command (wfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ; - test_writef_int_or_die (wfile, 1, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - test_writef_int_or_die (wfile, 2, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - - rwfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - if (sfinfo.frames != 2 * frames) - { printf ("\n\nLine %d : incorrect number of frames in file (%ld should be %d)\n\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 2 * frames) ; - exit (1) ; - } ; - - test_writef_int_or_die (wfile, 3, orig, frames, __LINE__) ; - - test_readf_int_or_die (rwfile, 1, test, frames, __LINE__) ; - test_readf_int_or_die (rwfile, 2, test, frames, __LINE__) ; - - sf_close (wfile) ; - sf_close (rwfile) ; -} /* new_rdwr_int_test */ - - -/*====================================================================================== -*/ - -static void mono_float_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void stereo_float_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void mono_rdwr_float_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void new_rdwr_float_test (const char *filename, int format, int allow_fd) ; -static void multi_seek_test (const char * filename, int format) ; -static void write_seek_extend_test (const char * filename, int format) ; - -static void -pcm_test_float (const char *filename, int format, int long_file_ok) -{ SF_INFO sfinfo ; - float *orig ; - int k, allow_fd ; - - /* Sd2 files cannot be opened from an existing file descriptor. */ - allow_fd = ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) ? SF_FALSE : SF_TRUE ; - - print_test_name ("pcm_test_float", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, 1.0) ; - - orig = orig_data.f ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - /* Some test broken out here. */ - - mono_float_test (filename, format, long_file_ok, allow_fd) ; - - /* Sub format DWVW does not allow seeking. */ - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { unlink (filename) ; - printf ("no seek : ok\n") ; - return ; - } ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - mono_rdwr_float_test (filename, format, long_file_ok, allow_fd) ; - - /* If the format doesn't support stereo we're done. */ - sfinfo.channels = 2 ; - if (sf_format_check (&sfinfo) == 0) - { unlink (filename) ; - puts ("no stereo : ok") ; - return ; - } ; - - stereo_float_test (filename, format, long_file_ok, allow_fd) ; - - /* New read/write test. Not sure if this is needed yet. */ - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_PAF && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_VOC && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - new_rdwr_float_test (filename, format, allow_fd) ; - - delete_file (format, filename) ; - - puts ("ok") ; - return ; -} /* pcm_test_float */ - -static void -mono_float_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - float *orig, *test ; - sf_count_t count ; - int k, items ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - orig = orig_data.f ; - test = test_data.f ; - - items = DATA_LENGTH ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_write_float_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - test_write_float_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - - /* Add non-audio data after the audio. */ - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (float)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Mono : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too long). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Mono : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_float_or_die (file, 0, test, items, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d: Mono : Incorrect sample A (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - oct_save_float (orig, test, items) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_float_or_die (file, 0, test, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { sf_close (file) ; - unlink (filename) ; - printf ("no seek : ") ; - return ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, items + 10, SEEK_SET, items + 10, sfinfo.channels, __LINE__) ; - - test_read_float_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : %g => %g).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 6, SEEK_CUR, items + 20, sfinfo.channels, __LINE__) ; - - test_read_float_or_die (file, 0, test + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : %g => %g).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_read_float_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample D (#%d : %g => %g).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Check read past end of file followed by sf_seek (sndfile, 0, SEEK_CUR). */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - count = 0 ; - while (count < sfinfo.frames) - count += sf_read_float (file, test, 311) ; - - /* Check that no error has occurred. */ - if (sf_error (file)) - { printf ("\n\nLine %d : Mono : error where there shouldn't have been one.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - /* Check that we haven't read beyond EOF. */ - if (count > sfinfo.frames) - { printf ("\n\nLines %d : read past end of file (%ld should be %ld)\n", __LINE__, (long) count, (long) sfinfo.frames) ; - exit (1) ; - } ; - - test_seek_or_die (file, 0, SEEK_CUR, sfinfo.frames, sfinfo.channels, __LINE__) ; - - sf_close (file) ; - - multi_seek_test (filename, format) ; - write_seek_extend_test (filename, format) ; - -} /* mono_float_test */ - -static void -stereo_float_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - float *orig, *test ; - int k, items, frames ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, 1.0) ; - - orig = orig_data.f ; - test = test_data.f ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_writef_float_or_die (file, 0, orig, frames, __LINE__) ; - - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (float)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Stereo : Returned format incorrect (0x%08X => 0x%08X).\n", - __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too short). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too long). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 2) - { printf ("\n\nLine %d : Stereo : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_float_or_die (file, 0, test, frames, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (FLOAT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_readf_float_or_die (file, 0, test, 2, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (FLOAT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - /* Check for errors here. */ - if (sf_error (file)) - { printf ("Line %d: Should NOT return an error.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - if (sf_read_float (file, test, 1) > 0) - { printf ("Line %d: Should return 0.\n", __LINE__) ; - exit (1) ; - } ; - - if (! sf_error (file)) - { printf ("Line %d: Should return an error.\n", __LINE__) ; - exit (1) ; - } ; - /*-----------------------*/ - - test_readf_float_or_die (file, 0, test + 10, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (FLOAT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 8, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_readf_float_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 40 ; k < 44 ; k++) - if (FLOAT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_readf_float_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (FLOAT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - sf_close (file) ; -} /* stereo_float_test */ - -static void -mono_rdwr_float_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - float *orig, *test ; - int k, pass ; - - orig = orig_data.f ; - test = test_data.f ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - if ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_RAW - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_AU - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) - unlink (filename) ; - else - { /* Create a short file. */ - create_short_file (filename) ; - - /* Opening a already existing short file (ie invalid header) RDWR is disallowed. - ** If this returns a valif pointer sf_open() screwed up. - */ - if ((file = sf_open (filename, SFM_RDWR, &sfinfo))) - { printf ("\n\nLine %d: sf_open should (SFM_RDWR) have failed but didn't.\n", __LINE__) ; - exit (1) ; - } ; - - /* Truncate the file to zero bytes. */ - if (truncate (filename, 0) < 0) - { printf ("\n\nLine %d: truncate (%s) failed", __LINE__, filename) ; - perror (NULL) ; - exit (1) ; - } ; - } ; - - /* Opening a zero length file RDWR is allowed, but the SF_INFO struct must contain - ** all the usual data required when opening the file in WRITE mode. - */ - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - /* Do 3 writes followed by reads. After each, check the data and the current - ** read and write offsets. - */ - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - /* Write some data. */ - test_write_float_or_die (file, pass, orig, DATA_LENGTH, __LINE__) ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, pass * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_float_or_die (file, 0, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) A : Error at sample %d (%g => %g).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_float (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - test_read_write_position_or_die (file, __LINE__, pass, pass * DATA_LENGTH, pass * DATA_LENGTH) ; - } ; /* for (pass ...) */ - - sf_close (file) ; - - /* Open the file again to check the data. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Not enough frames in file. (%ld < %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } - - if (! long_file_ok && sfinfo.frames != 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Incorrect number of frames in file. (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - if (! long_file_ok) - test_read_write_position_or_die (file, __LINE__, 0, 0, 3 * DATA_LENGTH) ; - else - test_seek_or_die (file, 3 * DATA_LENGTH, SFM_WRITE | SEEK_SET, 3 * DATA_LENGTH, sfinfo.channels, __LINE__) ; - - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, 3 * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_float_or_die (file, pass, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) B : Error at sample %d (%g => %g).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_float (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - } ; /* for (pass ...) */ - - sf_close (file) ; -} /* mono_rdwr_float_test */ - -static void -new_rdwr_float_test (const char *filename, int format, int allow_fd) -{ SNDFILE *wfile, *rwfile ; - SF_INFO sfinfo ; - float *orig, *test ; - int items, frames ; - - orig = orig_data.f ; - test = test_data.f ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - wfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - sf_command (wfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ; - test_writef_float_or_die (wfile, 1, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - test_writef_float_or_die (wfile, 2, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - - rwfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - if (sfinfo.frames != 2 * frames) - { printf ("\n\nLine %d : incorrect number of frames in file (%ld should be %d)\n\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 2 * frames) ; - exit (1) ; - } ; - - test_writef_float_or_die (wfile, 3, orig, frames, __LINE__) ; - - test_readf_float_or_die (rwfile, 1, test, frames, __LINE__) ; - test_readf_float_or_die (rwfile, 2, test, frames, __LINE__) ; - - sf_close (wfile) ; - sf_close (rwfile) ; -} /* new_rdwr_float_test */ - - -/*====================================================================================== -*/ - -static void mono_double_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void stereo_double_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void mono_rdwr_double_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void new_rdwr_double_test (const char *filename, int format, int allow_fd) ; -static void multi_seek_test (const char * filename, int format) ; -static void write_seek_extend_test (const char * filename, int format) ; - -static void -pcm_test_double (const char *filename, int format, int long_file_ok) -{ SF_INFO sfinfo ; - double *orig ; - int k, allow_fd ; - - /* Sd2 files cannot be opened from an existing file descriptor. */ - allow_fd = ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) ? SF_FALSE : SF_TRUE ; - - print_test_name ("pcm_test_double", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, 1.0) ; - - orig = orig_data.d ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - /* Some test broken out here. */ - - mono_double_test (filename, format, long_file_ok, allow_fd) ; - - /* Sub format DWVW does not allow seeking. */ - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { unlink (filename) ; - printf ("no seek : ok\n") ; - return ; - } ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - mono_rdwr_double_test (filename, format, long_file_ok, allow_fd) ; - - /* If the format doesn't support stereo we're done. */ - sfinfo.channels = 2 ; - if (sf_format_check (&sfinfo) == 0) - { unlink (filename) ; - puts ("no stereo : ok") ; - return ; - } ; - - stereo_double_test (filename, format, long_file_ok, allow_fd) ; - - /* New read/write test. Not sure if this is needed yet. */ - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_PAF && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_VOC && - (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC) - new_rdwr_double_test (filename, format, allow_fd) ; - - delete_file (format, filename) ; - - puts ("ok") ; - return ; -} /* pcm_test_double */ - -static void -mono_double_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - double *orig, *test ; - sf_count_t count ; - int k, items ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - orig = orig_data.d ; - test = test_data.d ; - - items = DATA_LENGTH ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_write_double_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - test_write_double_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - - /* Add non-audio data after the audio. */ - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (double)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Mono : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too short). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too long). (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), items) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Mono : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_double_or_die (file, 0, test, items, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d: Mono : Incorrect sample A (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - oct_save_double (orig, test, items) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, test, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { sf_close (file) ; - unlink (filename) ; - printf ("no seek : ") ; - return ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, items + 10, SEEK_SET, items + 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : %g => %g).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 6, SEEK_CUR, items + 20, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, test + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : %g => %g).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_read_double_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample D (#%d : %g => %g).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Check read past end of file followed by sf_seek (sndfile, 0, SEEK_CUR). */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - count = 0 ; - while (count < sfinfo.frames) - count += sf_read_double (file, test, 311) ; - - /* Check that no error has occurred. */ - if (sf_error (file)) - { printf ("\n\nLine %d : Mono : error where there shouldn't have been one.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - /* Check that we haven't read beyond EOF. */ - if (count > sfinfo.frames) - { printf ("\n\nLines %d : read past end of file (%ld should be %ld)\n", __LINE__, (long) count, (long) sfinfo.frames) ; - exit (1) ; - } ; - - test_seek_or_die (file, 0, SEEK_CUR, sfinfo.frames, sfinfo.channels, __LINE__) ; - - sf_close (file) ; - - multi_seek_test (filename, format) ; - write_seek_extend_test (filename, format) ; - -} /* mono_double_test */ - -static void -stereo_double_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - double *orig, *test ; - int k, items, frames ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, 1.0) ; - - orig = orig_data.d ; - test = test_data.d ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_writef_double_or_die (file, 0, orig, frames, __LINE__) ; - - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof (double)) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Stereo : Returned format incorrect (0x%08X => 0x%08X).\n", - __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too short). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too long). (%ld should be %d)\n", - __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 2) - { printf ("\n\nLine %d : Stereo : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_double_or_die (file, 0, test, frames, __LINE__) ; - for (k = 0 ; k < items ; k++) - if (FLOAT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, test, 2, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if (FLOAT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - /* Check for errors here. */ - if (sf_error (file)) - { printf ("Line %d: Should NOT return an error.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - if (sf_read_double (file, test, 1) > 0) - { printf ("Line %d: Should return 0.\n", __LINE__) ; - exit (1) ; - } ; - - if (! sf_error (file)) - { printf ("Line %d: Should return an error.\n", __LINE__) ; - exit (1) ; - } ; - /*-----------------------*/ - - test_readf_double_or_die (file, 0, test + 10, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (FLOAT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 8, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 40 ; k < 44 ; k++) - if (FLOAT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_readf_double_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if (FLOAT_ERROR (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : %g => %g).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - sf_close (file) ; -} /* stereo_double_test */ - -static void -mono_rdwr_double_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - double *orig, *test ; - int k, pass ; - - orig = orig_data.d ; - test = test_data.d ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - if ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_RAW - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_AU - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) - unlink (filename) ; - else - { /* Create a short file. */ - create_short_file (filename) ; - - /* Opening a already existing short file (ie invalid header) RDWR is disallowed. - ** If this returns a valif pointer sf_open() screwed up. - */ - if ((file = sf_open (filename, SFM_RDWR, &sfinfo))) - { printf ("\n\nLine %d: sf_open should (SFM_RDWR) have failed but didn't.\n", __LINE__) ; - exit (1) ; - } ; - - /* Truncate the file to zero bytes. */ - if (truncate (filename, 0) < 0) - { printf ("\n\nLine %d: truncate (%s) failed", __LINE__, filename) ; - perror (NULL) ; - exit (1) ; - } ; - } ; - - /* Opening a zero length file RDWR is allowed, but the SF_INFO struct must contain - ** all the usual data required when opening the file in WRITE mode. - */ - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - /* Do 3 writes followed by reads. After each, check the data and the current - ** read and write offsets. - */ - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - /* Write some data. */ - test_write_double_or_die (file, pass, orig, DATA_LENGTH, __LINE__) ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, pass * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_double_or_die (file, 0, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) A : Error at sample %d (%g => %g).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_double (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - test_read_write_position_or_die (file, __LINE__, pass, pass * DATA_LENGTH, pass * DATA_LENGTH) ; - } ; /* for (pass ...) */ - - sf_close (file) ; - - /* Open the file again to check the data. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Not enough frames in file. (%ld < %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } - - if (! long_file_ok && sfinfo.frames != 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Incorrect number of frames in file. (%ld should be %d)\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 3 * DATA_LENGTH ) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - if (! long_file_ok) - test_read_write_position_or_die (file, __LINE__, 0, 0, 3 * DATA_LENGTH) ; - else - test_seek_or_die (file, 3 * DATA_LENGTH, SFM_WRITE | SEEK_SET, 3 * DATA_LENGTH, sfinfo.channels, __LINE__) ; - - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, 3 * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_double_or_die (file, pass, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if (FLOAT_ERROR (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) B : Error at sample %d (%g => %g).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_double (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - } ; /* for (pass ...) */ - - sf_close (file) ; -} /* mono_rdwr_double_test */ - -static void -new_rdwr_double_test (const char *filename, int format, int allow_fd) -{ SNDFILE *wfile, *rwfile ; - SF_INFO sfinfo ; - double *orig, *test ; - int items, frames ; - - orig = orig_data.d ; - test = test_data.d ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - wfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - sf_command (wfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ; - test_writef_double_or_die (wfile, 1, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - test_writef_double_or_die (wfile, 2, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - - rwfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - if (sfinfo.frames != 2 * frames) - { printf ("\n\nLine %d : incorrect number of frames in file (%ld should be %d)\n\n", __LINE__, SF_COUNT_TO_LONG (sfinfo.frames), 2 * frames) ; - exit (1) ; - } ; - - test_writef_double_or_die (wfile, 3, orig, frames, __LINE__) ; - - test_readf_double_or_die (rwfile, 1, test, frames, __LINE__) ; - test_readf_double_or_die (rwfile, 2, test, frames, __LINE__) ; - - sf_close (wfile) ; - sf_close (rwfile) ; -} /* new_rdwr_double_test */ - - - -/*---------------------------------------------------------------------------------------- -*/ - -static void -empty_file_test (const char *filename, int format) -{ SNDFILE *file ; - SF_INFO info ; - int allow_fd ; - - /* Sd2 files cannot be opened from an existing file descriptor. */ - allow_fd = ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) ? SF_FALSE : SF_TRUE ; - - print_test_name ("empty_file_test", filename) ; - - unlink (filename) ; - - info.samplerate = 48000 ; - info.channels = 2 ; - info.format = format ; - - if (sf_format_check (&info) == SF_FALSE) - { info.channels = 1 ; - if (sf_format_check (&info) == SF_FALSE) - { puts ("invalid file format") ; - return ; - } ; - } ; - - /* Create an empty file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &info, allow_fd, __LINE__) ; - sf_close (file) ; - - /* Open for read and check the length. */ - file = test_open_file_or_die (filename, SFM_READ, &info, allow_fd, __LINE__) ; - - if (SF_COUNT_TO_LONG (info.frames) != 0) - { printf ("\n\nError : frame count (%ld) should be zero.\n", SF_COUNT_TO_LONG (info.frames)) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Open for read/write and check the length. */ - file = test_open_file_or_die (filename, SFM_RDWR, &info, allow_fd, __LINE__) ; - - if (SF_COUNT_TO_LONG (info.frames) != 0) - { printf ("\n\nError : frame count (%ld) should be zero.\n", SF_COUNT_TO_LONG (info.frames)) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Open for read and check the length. */ - file = test_open_file_or_die (filename, SFM_READ, &info, allow_fd, __LINE__) ; - - if (SF_COUNT_TO_LONG (info.frames) != 0) - { printf ("\n\nError : frame count (%ld) should be zero.\n", SF_COUNT_TO_LONG (info.frames)) ; - exit (1) ; - } ; - - sf_close (file) ; - - check_open_file_count_or_die (__LINE__) ; - - unlink (filename) ; - puts ("ok") ; - - return ; -} /* empty_file_test */ - - -/*---------------------------------------------------------------------------------------- -*/ - -static void -create_short_file (const char *filename) -{ FILE *file ; - - if (! (file = fopen (filename, "w"))) - { printf ("create_short_file : fopen (%s, \"w\") failed.", filename) ; - fflush (stdout) ; - perror (NULL) ; - exit (1) ; - } ; - - fprintf (file, "This is the file data.\n") ; - - fclose (file) ; -} /* create_short_file */ - -#if (defined (WIN32) || defined (__WIN32)) - -/* Win32 does not have truncate (nor does it have the POSIX function ftruncate). -** Hack somethng up here to over come this. This function can only truncate to a -** length of zero. -*/ - -static int -truncate (const char *filename, int ignored) -{ int fd ; - - ignored = 0 ; - - if ((fd = open (filename, O_RDWR | O_TRUNC | O_BINARY)) < 0) - return 0 ; - - close (fd) ; - - return 0 ; -} /* truncate */ - -#endif - -static void -multi_seek_test (const char * filename, int format) -{ SNDFILE * file ; - SF_INFO info ; - sf_count_t pos ; - int k ; - - /* This test doesn't work on the following. */ - switch (format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_RAW : - return ; - - default : - break ; - } ; - - memset (&info, 0, sizeof (info)) ; - - generate_file (filename, format, 88200) ; - - file = test_open_file_or_die (filename, SFM_READ, &info, SF_FALSE, __LINE__) ; - - for (k = 0 ; k < 10 ; k++) - { pos = info.frames / (k + 2) ; - test_seek_or_die (file, pos, SEEK_SET, pos, info.channels, __LINE__) ; - } ; - - sf_close (file) ; -} /* multi_seek_test */ - -static void -write_seek_extend_test (const char * filename, int format) -{ SNDFILE * file ; - SF_INFO info ; - short *orig, *test ; - unsigned items, k ; - - /* This test doesn't work on the following. */ - switch (format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_FLAC : - case SF_FORMAT_HTK : - case SF_FORMAT_PAF : - case SF_FORMAT_SDS : - case SF_FORMAT_SVX : - return ; - - default : - break ; - } ; - - memset (&info, 0, sizeof (info)) ; - - info.samplerate = 48000 ; - info.channels = 1 ; - info.format = format ; - - items = 512 ; - exit_if_true (items > ARRAY_LEN (orig_data.s), "Line %d : Bad assumption.\n", __LINE__) ; - - orig = orig_data.s ; - test = test_data.s ; - - for (k = 0 ; k < ARRAY_LEN (orig_data.s) ; k++) - orig [k] = 0x3fff ; - - file = test_open_file_or_die (filename, SFM_WRITE, &info, SF_FALSE, __LINE__) ; - test_write_short_or_die (file, 0, orig, items, __LINE__) ; - - /* Extend the file using a seek. */ - test_seek_or_die (file, 2 * items, SEEK_SET, 2 * items, info.channels, __LINE__) ; - - test_writef_short_or_die (file, 0, orig, items, __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &info, SF_FALSE, __LINE__) ; - test_read_short_or_die (file, 0, test, 3 * items, __LINE__) ; - sf_close (file) ; - - /* Can't do these formats due to scaling. */ - switch (format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - return ; - default : - break ; - } ; - - for (k = 0 ; k < items ; k++) - { exit_if_true (test [k] != 0x3fff, "Line %d : test [%d] == %d, should be 0x3fff.\n", __LINE__, k, test [k]) ; - exit_if_true (test [items + k] != 0, "Line %d : test [%d] == %d, should be 0.\n", __LINE__, items + k, test [items + k]) ; - exit_if_true (test [2 * items + k] != 0x3fff, "Line %d : test [%d] == %d, should be 0x3fff.\n", __LINE__, 2 * items + k, test [2 * items + k]) ; - } ; - - return ; -} /* write_seek_extend_test */ - - diff --git a/libs/libsndfile/tests/write_read_test.def b/libs/libsndfile/tests/write_read_test.def deleted file mode 100644 index 3316aec577..0000000000 --- a/libs/libsndfile/tests/write_read_test.def +++ /dev/null @@ -1,75 +0,0 @@ -autogen definitions write_read_test.tpl; - -data_type = { - type_name = char ; - data_type = short ; - data_field = s ; - error_func = CHAR_ERROR ; - format_char = "0x%X" ; - max_val = "32000.0" ; - max_error = "255" ; - } ; - -data_type = { - type_name = short ; - data_type = short ; - data_field = s ; - error_func = INT_ERROR ; - format_char = "0x%X" ; - max_val = "32000.0" ; - max_error = "0" ; - } ; - -data_type = { - type_name = "20bit" ; - data_type = int ; - data_field = i ; - error_func = BIT_20_ERROR ; - format_char = "0x%X" ; - max_val = "(1.0 * 0x7F00000)" ; - max_error = "4096" ; - } ; - -data_type = { - type_name = "24bit" ; - data_type = int ; - data_field = i ; - error_func = TRIBYTE_ERROR ; - format_char = "0x%X" ; - max_val = "(1.0 * 0x7F000000)" ; - max_error = "256" ; - } ; - -data_type = { - type_name = int ; - data_type = int ; - data_field = i ; - error_func = INT_ERROR ; - format_char = "0x%X" ; - max_val = "(1.0 * 0x7F000000)" ; - max_error = "0" ; - } ; - -/* Lite remove start */ - -data_type = { - type_name = float ; - data_type = float ; - data_field = f ; - error_func = FLOAT_ERROR ; - format_char = "%g" ; - max_val = "1.0" ; - max_error = "0" ; - } ; - -data_type = { - type_name = double ; - data_type = double ; - data_field = d ; - error_func = FLOAT_ERROR ; - format_char = "%g" ; - max_val = "1.0" ; - max_error = "0" ; - } ; - -/* Lite remove end */ diff --git a/libs/libsndfile/tests/write_read_test.tpl b/libs/libsndfile/tests/write_read_test.tpl deleted file mode 100644 index 55bf1db173..0000000000 --- a/libs/libsndfile/tests/write_read_test.tpl +++ /dev/null @@ -1,1184 +0,0 @@ -[+ AutoGen5 template c +] -/* -** Copyright (C) 1999-2012 Erik de Castro Lopo -** -** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "sfconfig.h" - -#include -#include -#include -#include -#include - - -#if HAVE_UNISTD_H -#include -#endif - -#include - -#include "utils.h" -#include "generate.h" - -#define SAMPLE_RATE 11025 -#define DATA_LENGTH (1 << 12) - -#define SILLY_WRITE_COUNT (234) - -[+ FOR data_type -+]static void pcm_test_[+ (get "type_name") +] (const char *str, int format, int long_file_okz) ; -[+ ENDFOR data_type -+] -static void empty_file_test (const char *filename, int format) ; - -typedef union -{ double d [DATA_LENGTH] ; - float f [DATA_LENGTH] ; - int i [DATA_LENGTH] ; - short s [DATA_LENGTH] ; - char c [DATA_LENGTH] ; -} BUFFER ; - -static BUFFER orig_data ; -static BUFFER test_data ; - -int -main (int argc, char **argv) -{ int do_all = 0 ; - int test_count = 0 ; - - count_open_files () ; - - if (argc != 2) - { printf ("Usage : %s \n", argv [0]) ; - printf (" Where is one of the following:\n") ; - printf (" wav - test WAV file functions (little endian)\n") ; - printf (" aiff - test AIFF file functions (big endian)\n") ; - printf (" au - test AU file functions\n") ; - printf (" avr - test AVR file functions\n") ; - printf (" caf - test CAF file functions\n") ; - printf (" raw - test RAW header-less PCM file functions\n") ; - printf (" paf - test PAF file functions\n") ; - printf (" svx - test 8SVX/16SV file functions\n") ; - printf (" nist - test NIST Sphere file functions\n") ; - printf (" ircam - test IRCAM file functions\n") ; - printf (" voc - Create Voice file functions\n") ; - printf (" w64 - Sonic Foundry's W64 file functions\n") ; - printf (" flac - test FLAC file functions\n") ; - printf (" mpc2k - test MPC 2000 file functions\n") ; - printf (" rf64 - test RF64 file functions\n") ; - printf (" all - perform all tests\n") ; - exit (1) ; - } ; - - do_all = !strcmp (argv [1], "all") ; - - if (do_all || ! strcmp (argv [1], "wav")) - { pcm_test_char ("char.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.wav" , SF_FORMAT_WAV | SF_FORMAT_PCM_32, SF_FALSE) ; - - pcm_test_char ("char.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_PCM_32, SF_FALSE) ; - - pcm_test_24bit ("24bit.wavex" , SF_FORMAT_WAVEX | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.wavex" , SF_FORMAT_WAVEX | SF_FORMAT_PCM_32, SF_FALSE) ; - - /* Lite remove start */ - pcm_test_float ("float.wav" , SF_FORMAT_WAV | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.wav" , SF_FORMAT_WAV | SF_FORMAT_DOUBLE, SF_FALSE) ; - - pcm_test_float ("float.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.rifx" , SF_ENDIAN_BIG | SF_FORMAT_WAV | SF_FORMAT_DOUBLE, SF_FALSE) ; - - pcm_test_float ("float.wavex" , SF_FORMAT_WAVEX | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.wavex" , SF_FORMAT_WAVEX | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - - empty_file_test ("empty_char.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_U8) ; - empty_file_test ("empty_short.wav", SF_FORMAT_WAV | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.wav", SF_FORMAT_WAV | SF_FORMAT_FLOAT) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "aiff")) - { pcm_test_char ("char_u8.aiff" , SF_FORMAT_AIFF | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_char ("char_s8.aiff" , SF_FORMAT_AIFF | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.aiff" , SF_FORMAT_AIFF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.aiff" , SF_FORMAT_AIFF | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.aiff" , SF_FORMAT_AIFF | SF_FORMAT_PCM_32, SF_FALSE) ; - - pcm_test_short ("short_sowt.aifc" , SF_ENDIAN_LITTLE | SF_FORMAT_AIFF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_sowt.aifc" , SF_ENDIAN_LITTLE | SF_FORMAT_AIFF | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_sowt.aifc" , SF_ENDIAN_LITTLE | SF_FORMAT_AIFF | SF_FORMAT_PCM_32, SF_FALSE) ; - - pcm_test_short ("short_twos.aifc" , SF_ENDIAN_BIG | SF_FORMAT_AIFF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_twos.aifc" , SF_ENDIAN_BIG | SF_FORMAT_AIFF | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_twos.aifc" , SF_ENDIAN_BIG | SF_FORMAT_AIFF | SF_FORMAT_PCM_32, SF_FALSE) ; - - /* Lite remove start */ - pcm_test_short ("dwvw16.aifc", SF_FORMAT_AIFF | SF_FORMAT_DWVW_16, SF_TRUE) ; - pcm_test_24bit ("dwvw24.aifc", SF_FORMAT_AIFF | SF_FORMAT_DWVW_24, SF_TRUE) ; - - pcm_test_float ("float.aifc" , SF_FORMAT_AIFF | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.aifc" , SF_FORMAT_AIFF | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - - empty_file_test ("empty_char.aiff", SF_FORMAT_AIFF | SF_FORMAT_PCM_U8) ; - empty_file_test ("empty_short.aiff", SF_FORMAT_AIFF | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.aiff", SF_FORMAT_AIFF | SF_FORMAT_FLOAT) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "au")) - { pcm_test_char ("char.au" , SF_FORMAT_AU | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.au" , SF_FORMAT_AU | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.au" , SF_FORMAT_AU | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.au" , SF_FORMAT_AU | SF_FORMAT_PCM_32, SF_FALSE) ; - /* Lite remove start */ - pcm_test_float ("float.au" , SF_FORMAT_AU | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.au", SF_FORMAT_AU | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - - pcm_test_char ("char_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_PCM_32, SF_FALSE) ; - /* Lite remove start */ - pcm_test_float ("float_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double_le.au" , SF_ENDIAN_LITTLE | SF_FORMAT_AU | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "caf")) - { pcm_test_char ("char.caf" , SF_FORMAT_CAF | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.caf" , SF_FORMAT_CAF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.caf" , SF_FORMAT_CAF | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.caf" , SF_FORMAT_CAF | SF_FORMAT_PCM_32, SF_FALSE) ; - /* Lite remove start */ - pcm_test_float ("float.caf" , SF_FORMAT_CAF | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.caf" , SF_FORMAT_CAF | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - - pcm_test_short ("short_le.caf" , SF_ENDIAN_LITTLE | SF_FORMAT_CAF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_le.caf" , SF_ENDIAN_LITTLE | SF_FORMAT_CAF | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_le.caf" , SF_ENDIAN_LITTLE | SF_FORMAT_CAF | SF_FORMAT_PCM_32, SF_FALSE) ; - /* Lite remove start */ - pcm_test_float ("float_le.caf" , SF_ENDIAN_LITTLE | SF_FORMAT_CAF | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double_le.caf", SF_ENDIAN_LITTLE | SF_FORMAT_CAF | SF_FORMAT_DOUBLE, SF_FALSE) ; - - pcm_test_short ("alac16.caf" , SF_FORMAT_CAF | SF_FORMAT_ALAC_16, SF_FALSE) ; - pcm_test_20bit ("alac20.caf" , SF_FORMAT_CAF | SF_FORMAT_ALAC_20, SF_FALSE) ; - pcm_test_24bit ("alac24.caf" , SF_FORMAT_CAF | SF_FORMAT_ALAC_24, SF_FALSE) ; - pcm_test_int ("alac32.caf" , SF_FORMAT_CAF | SF_FORMAT_ALAC_32, SF_FALSE) ; - - /* Lite remove end */ - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "raw")) - { pcm_test_char ("char_s8.raw" , SF_FORMAT_RAW | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_char ("char_u8.raw" , SF_FORMAT_RAW | SF_FORMAT_PCM_U8, SF_FALSE) ; - - pcm_test_short ("short_le.raw" , SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_be.raw" , SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_le.raw" , SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_24bit ("24bit_be.raw" , SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_le.raw" , SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_int ("int_be.raw" , SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_PCM_32, SF_FALSE) ; - - /* Lite remove start */ - pcm_test_float ("float_le.raw" , SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_float ("float_be.raw" , SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_FLOAT , SF_FALSE) ; - - pcm_test_double ("double_le.raw", SF_ENDIAN_LITTLE | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, SF_FALSE) ; - pcm_test_double ("double_be.raw", SF_ENDIAN_BIG | SF_FORMAT_RAW | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - test_count++ ; - } ; - - /* Lite remove start */ - if (do_all || ! strcmp (argv [1], "paf")) - { pcm_test_char ("char_le.paf", SF_ENDIAN_LITTLE | SF_FORMAT_PAF | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_char ("char_be.paf", SF_ENDIAN_BIG | SF_FORMAT_PAF | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short_le.paf", SF_ENDIAN_LITTLE | SF_FORMAT_PAF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_be.paf", SF_ENDIAN_BIG | SF_FORMAT_PAF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_le.paf", SF_ENDIAN_LITTLE | SF_FORMAT_PAF | SF_FORMAT_PCM_24, SF_TRUE) ; - pcm_test_24bit ("24bit_be.paf", SF_ENDIAN_BIG | SF_FORMAT_PAF | SF_FORMAT_PCM_24, SF_TRUE) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "svx")) - { pcm_test_char ("char.svx" , SF_FORMAT_SVX | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.svx", SF_FORMAT_SVX | SF_FORMAT_PCM_16, SF_FALSE) ; - - empty_file_test ("empty_char.svx", SF_FORMAT_SVX | SF_FORMAT_PCM_S8) ; - empty_file_test ("empty_short.svx", SF_FORMAT_SVX | SF_FORMAT_PCM_16) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "nist")) - { pcm_test_short ("short_le.nist", SF_ENDIAN_LITTLE | SF_FORMAT_NIST | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_be.nist", SF_ENDIAN_BIG | SF_FORMAT_NIST | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit_le.nist", SF_ENDIAN_LITTLE | SF_FORMAT_NIST | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_24bit ("24bit_be.nist", SF_ENDIAN_BIG | SF_FORMAT_NIST | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int_le.nist" , SF_ENDIAN_LITTLE | SF_FORMAT_NIST | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_int ("int_be.nist" , SF_ENDIAN_BIG | SF_FORMAT_NIST | SF_FORMAT_PCM_32, SF_FALSE) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "ircam")) - { pcm_test_short ("short_be.ircam" , SF_ENDIAN_BIG | SF_FORMAT_IRCAM | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_le.ircam" , SF_ENDIAN_LITTLE | SF_FORMAT_IRCAM | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_int ("int_be.ircam" , SF_ENDIAN_BIG | SF_FORMAT_IRCAM | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_int ("int_le.ircam" , SF_ENDIAN_LITTLE | SF_FORMAT_IRCAM | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_float ("float_be.ircam" , SF_ENDIAN_BIG | SF_FORMAT_IRCAM | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_float ("float_le.ircam" , SF_ENDIAN_LITTLE | SF_FORMAT_IRCAM | SF_FORMAT_FLOAT , SF_FALSE) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "voc")) - { pcm_test_char ("char.voc" , SF_FORMAT_VOC | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short.voc", SF_FORMAT_VOC | SF_FORMAT_PCM_16, SF_FALSE) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat4")) - { pcm_test_short ("short_be.mat4" , SF_ENDIAN_BIG | SF_FORMAT_MAT4 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_le.mat4" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT4 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_int ("int_be.mat4" , SF_ENDIAN_BIG | SF_FORMAT_MAT4 | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_int ("int_le.mat4" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT4 | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_float ("float_be.mat4" , SF_ENDIAN_BIG | SF_FORMAT_MAT4 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_float ("float_le.mat4" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT4 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double_be.mat4" , SF_ENDIAN_BIG | SF_FORMAT_MAT4 | SF_FORMAT_DOUBLE, SF_FALSE) ; - pcm_test_double ("double_le.mat4" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT4 | SF_FORMAT_DOUBLE, SF_FALSE) ; - - empty_file_test ("empty_short.mat4", SF_FORMAT_MAT4 | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.mat4", SF_FORMAT_MAT4 | SF_FORMAT_FLOAT) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mat5")) - { pcm_test_char ("char_be.mat5" , SF_ENDIAN_BIG | SF_FORMAT_MAT5 | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_char ("char_le.mat5" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT5 | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short_be.mat5" , SF_ENDIAN_BIG | SF_FORMAT_MAT5 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_short ("short_le.mat5" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT5 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_int ("int_be.mat5" , SF_ENDIAN_BIG | SF_FORMAT_MAT5 | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_int ("int_le.mat5" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT5 | SF_FORMAT_PCM_32, SF_FALSE) ; - pcm_test_float ("float_be.mat5" , SF_ENDIAN_BIG | SF_FORMAT_MAT5 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_float ("float_le.mat5" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT5 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double_be.mat5" , SF_ENDIAN_BIG | SF_FORMAT_MAT5 | SF_FORMAT_DOUBLE, SF_FALSE) ; - pcm_test_double ("double_le.mat5" , SF_ENDIAN_LITTLE | SF_FORMAT_MAT5 | SF_FORMAT_DOUBLE, SF_FALSE) ; - - increment_open_file_count () ; - - empty_file_test ("empty_char.mat5", SF_FORMAT_MAT5 | SF_FORMAT_PCM_U8) ; - empty_file_test ("empty_short.mat5", SF_FORMAT_MAT5 | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.mat5", SF_FORMAT_MAT5 | SF_FORMAT_FLOAT) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "pvf")) - { pcm_test_char ("char.pvf" , SF_FORMAT_PVF | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.pvf", SF_FORMAT_PVF | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_int ("int.pvf" , SF_FORMAT_PVF | SF_FORMAT_PCM_32, SF_FALSE) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "htk")) - { pcm_test_short ("short.htk", SF_FORMAT_HTK | SF_FORMAT_PCM_16, SF_FALSE) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "mpc2k")) - { pcm_test_short ("short.mpc", SF_FORMAT_MPC2K | SF_FORMAT_PCM_16, SF_FALSE) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "avr")) - { pcm_test_char ("char_u8.avr" , SF_FORMAT_AVR | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_char ("char_s8.avr" , SF_FORMAT_AVR | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.avr" , SF_FORMAT_AVR | SF_FORMAT_PCM_16, SF_FALSE) ; - test_count++ ; - } ; - /* Lite remove end */ - - if (do_all || ! strcmp (argv [1], "w64")) - { pcm_test_char ("char.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.w64" , SF_FORMAT_W64 | SF_FORMAT_PCM_32, SF_FALSE) ; - /* Lite remove start */ - pcm_test_float ("float.w64" , SF_FORMAT_W64 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.w64" , SF_FORMAT_W64 | SF_FORMAT_DOUBLE, SF_FALSE) ; - /* Lite remove end */ - - empty_file_test ("empty_char.w64", SF_FORMAT_W64 | SF_FORMAT_PCM_U8) ; - empty_file_test ("empty_short.w64", SF_FORMAT_W64 | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.w64", SF_FORMAT_W64 | SF_FORMAT_FLOAT) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "sds")) - { pcm_test_char ("char.sds" , SF_FORMAT_SDS | SF_FORMAT_PCM_S8, SF_FALSE) ; - pcm_test_short ("short.sds" , SF_FORMAT_SDS | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.sds" , SF_FORMAT_SDS | SF_FORMAT_PCM_24, SF_FALSE) ; - - empty_file_test ("empty_char.sds", SF_FORMAT_SDS | SF_FORMAT_PCM_S8) ; - empty_file_test ("empty_short.sds", SF_FORMAT_SDS | SF_FORMAT_PCM_16) ; - - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "sd2")) - { pcm_test_char ("char.sd2" , SF_FORMAT_SD2 | SF_FORMAT_PCM_S8, SF_TRUE) ; - pcm_test_short ("short.sd2" , SF_FORMAT_SD2 | SF_FORMAT_PCM_16, SF_TRUE) ; - pcm_test_24bit ("24bit.sd2" , SF_FORMAT_SD2 | SF_FORMAT_PCM_24, SF_TRUE) ; - pcm_test_int ("32bit.sd2" , SF_FORMAT_SD2 | SF_FORMAT_PCM_32, SF_TRUE) ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "flac")) - { if (HAVE_EXTERNAL_LIBS) - { pcm_test_char ("char.flac" , SF_FORMAT_FLAC | SF_FORMAT_PCM_S8, SF_TRUE) ; - pcm_test_short ("short.flac" , SF_FORMAT_FLAC | SF_FORMAT_PCM_16, SF_TRUE) ; - pcm_test_24bit ("24bit.flac" , SF_FORMAT_FLAC | SF_FORMAT_PCM_24, SF_TRUE) ; - } - else - puts (" No FLAC tests because FLAC support was not compiled in.") ; - test_count++ ; - } ; - - if (do_all || ! strcmp (argv [1], "rf64")) - { pcm_test_char ("char.rf64" , SF_FORMAT_RF64 | SF_FORMAT_PCM_U8, SF_FALSE) ; - pcm_test_short ("short.rf64" , SF_FORMAT_RF64 | SF_FORMAT_PCM_16, SF_FALSE) ; - pcm_test_24bit ("24bit.rf64" , SF_FORMAT_RF64 | SF_FORMAT_PCM_24, SF_FALSE) ; - pcm_test_int ("int.rf64" , SF_FORMAT_RF64 | SF_FORMAT_PCM_32, SF_FALSE) ; - - /* Lite remove start */ - pcm_test_float ("float.rf64" , SF_FORMAT_RF64 | SF_FORMAT_FLOAT , SF_FALSE) ; - pcm_test_double ("double.rf64" , SF_FORMAT_RF64 | SF_FORMAT_DOUBLE, SF_FALSE) ; - empty_file_test ("empty_char.rf64", SF_FORMAT_RF64 | SF_FORMAT_PCM_U8) ; - empty_file_test ("empty_short.rf64", SF_FORMAT_RF64 | SF_FORMAT_PCM_16) ; - empty_file_test ("empty_float.rf64", SF_FORMAT_RF64 | SF_FORMAT_FLOAT) ; - /* Lite remove end */ - - test_count++ ; - } ; - - if (test_count == 0) - { printf ("Mono : ************************************\n") ; - printf ("Mono : * No '%s' test defined.\n", argv [1]) ; - printf ("Mono : ************************************\n") ; - return 1 ; - } ; - - /* Only open file descriptors should be stdin, stdout and stderr. */ - check_open_file_count_or_die (__LINE__) ; - - return 0 ; -} /* main */ - -/*============================================================================================ -** Helper functions and macros. -*/ - -static void create_short_file (const char *filename) ; - -#define CHAR_ERROR(x, y) (abs ((x) - (y)) > 255) -#define INT_ERROR(x, y) (((x) - (y)) != 0) -#define BIT_20_ERROR(x, y) (abs ((x) - (y)) > 4095) -#define TRIBYTE_ERROR(x, y) (abs ((x) - (y)) > 255) -#define FLOAT_ERROR(x, y) (fabs ((x) - (y)) > 1e-5) - -#define CONVERT_DATA(k, len, new, orig) \ - { for ((k) = 0 ; (k) < (len) ; (k) ++) \ - (new) [k] = (orig) [k] ; \ - } - -[+ FOR data_type -+] -/*====================================================================================== -*/ - -static void mono_[+ (get "type_name") +]_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void stereo_[+ (get "type_name") +]_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void mono_rdwr_[+ (get "type_name") +]_test (const char *filename, int format, int long_file_ok, int allow_fd) ; -static void new_rdwr_[+ (get "type_name") +]_test (const char *filename, int format, int allow_fd) ; -static void multi_seek_test (const char * filename, int format) ; -static void write_seek_extend_test (const char * filename, int format) ; - -static void -pcm_test_[+ (get "type_name") +] (const char *filename, int format, int long_file_ok) -{ SF_INFO sfinfo ; - [+ (get "data_type") +] *orig ; - int k, allow_fd ; - - /* Sd2 files cannot be opened from an existing file descriptor. */ - allow_fd = ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) ? SF_FALSE : SF_TRUE ; - - print_test_name ("pcm_test_[+ (get "type_name") +]", filename) ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, [+ (get "max_val") +]) ; - - orig = orig_data.[+ (get "data_field") +] ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - /* Some test broken out here. */ - - mono_[+ (get "type_name") +]_test (filename, format, long_file_ok, allow_fd) ; - - /* Sub format DWVW does not allow seeking. */ - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { unlink (filename) ; - printf ("no seek : ok\n") ; - return ; - } ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC - && (format & SF_FORMAT_SUBMASK) != SF_FORMAT_ALAC_16 - && (format & SF_FORMAT_SUBMASK) != SF_FORMAT_ALAC_20 - && (format & SF_FORMAT_SUBMASK) != SF_FORMAT_ALAC_24 - && (format & SF_FORMAT_SUBMASK) != SF_FORMAT_ALAC_32 - ) - mono_rdwr_[+ (get "type_name") +]_test (filename, format, long_file_ok, allow_fd) ; - - /* If the format doesn't support stereo we're done. */ - sfinfo.channels = 2 ; - if (sf_format_check (&sfinfo) == 0) - { unlink (filename) ; - puts ("no stereo : ok") ; - return ; - } ; - - stereo_[+ (get "type_name") +]_test (filename, format, long_file_ok, allow_fd) ; - - /* New read/write test. Not sure if this is needed yet. */ - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_PAF - && (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_VOC - && (format & SF_FORMAT_TYPEMASK) != SF_FORMAT_FLAC - && (format & SF_FORMAT_SUBMASK) != SF_FORMAT_ALAC_16 - && (format & SF_FORMAT_SUBMASK) != SF_FORMAT_ALAC_20 - && (format & SF_FORMAT_SUBMASK) != SF_FORMAT_ALAC_24 - && (format & SF_FORMAT_SUBMASK) != SF_FORMAT_ALAC_32 - ) - new_rdwr_[+ (get "type_name") +]_test (filename, format, allow_fd) ; - - delete_file (format, filename) ; - - puts ("ok") ; - return ; -} /* pcm_test_[+ (get "type_name") +] */ - -static void -mono_[+ (get "type_name") +]_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - [+ (get "data_type") +] *orig, *test ; - sf_count_t count ; - int k, items, total ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 1 ; - sfinfo.format = format ; - - orig = orig_data.[+ (get "data_field") +] ; - test = test_data.[+ (get "data_field") +] ; - - items = DATA_LENGTH ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_write_[+ (get "data_type") +]_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - test_write_[+ (get "data_type") +]_or_die (file, 0, orig, items, __LINE__) ; - sf_write_sync (file) ; - - /* Add non-audio data after the audio. */ - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof ([+ (get "data_type") +])) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Mono : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too short). (%" PRId64 " should be %d)\n", __LINE__, sfinfo.frames, items) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > 2 * items) - { printf ("\n\nLine %d : Mono : Incorrect number of frames in file (too long). (%" PRId64 " should be %d)\n", __LINE__, sfinfo.frames, items) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Mono : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_read_[+ (get "data_type") +]_or_die (file, 0, test, items, __LINE__) ; - for (k = 0 ; k < items ; k++) - if ([+ (get "error_func") +] (orig [k], test [k])) - { printf ("\n\nLine %d: Mono : Incorrect sample A (#%d : [+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, k, orig [k], test [k]) ; - oct_save_[+ (get "data_type") +] (orig, test, items) ; - exit (1) ; - } ; - - /* Test multiple short reads. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - total = 0 ; - for (k = 1 ; k <= 32 ; k++) - { int ik ; - - test_read_[+ (get "data_type") +]_or_die (file, 0, test + total, k, __LINE__) ; - total += k ; - - for (ik = 0 ; ik < total ; ik++) - if ([+ (get "error_func") +] (orig [ik], test [ik])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : [+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, ik, orig [ik], test [ik]) ; - exit (1) ; - } ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_read_[+ (get "data_type") +]_or_die (file, 0, test, 4, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if ([+ (get "error_func") +] (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : [+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* For some codecs we can't go past here. */ - if ((format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_16 || - (format & SF_FORMAT_SUBMASK) == SF_FORMAT_DWVW_24) - { sf_close (file) ; - unlink (filename) ; - printf ("no seek : ") ; - return ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, items + 10, SEEK_SET, items + 10, sfinfo.channels, __LINE__) ; - - test_read_[+ (get "data_type") +]_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if ([+ (get "error_func") +] (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : [+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 6, SEEK_CUR, items + 20, sfinfo.channels, __LINE__) ; - - test_read_[+ (get "data_type") +]_or_die (file, 0, test + 20, 4, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if ([+ (get "error_func") +] (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample A (#%d : [+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_read_[+ (get "data_type") +]_or_die (file, 0, test + 10, 4, __LINE__) ; - for (k = 10 ; k < 14 ; k++) - if ([+ (get "error_func") +] (orig [k], test [k])) - { printf ("\n\nLine %d : Mono : Incorrect sample D (#%d : [+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, k, test [k], orig [k]) ; - exit (1) ; - } ; - - /* Check read past end of file followed by sf_seek (sndfile, 0, SEEK_CUR). */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - count = 0 ; - while (count < sfinfo.frames) - count += sf_read_[+ (get "data_type") +] (file, test, 311) ; - - /* Check that no error has occurred. */ - if (sf_error (file)) - { printf ("\n\nLine %d : Mono : error where there shouldn't have been one.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - /* Check that we haven't read beyond EOF. */ - if (count > sfinfo.frames) - { printf ("\n\nLines %d : read past end of file (%" PRId64 " should be %" PRId64 ")\n", __LINE__, count, sfinfo.frames) ; - exit (1) ; - } ; - - test_seek_or_die (file, 0, SEEK_CUR, sfinfo.frames, sfinfo.channels, __LINE__) ; - - sf_close (file) ; - - multi_seek_test (filename, format) ; - write_seek_extend_test (filename, format) ; - -} /* mono_[+ (get "type_name") +]_test */ - -static void -stereo_[+ (get "type_name") +]_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - [+ (get "data_type") +] *orig, *test ; - int k, items, frames ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - gen_windowed_sine_double (orig_data.d, DATA_LENGTH, [+ (get "max_val") +]) ; - - orig = orig_data.[+ (get "data_field") +] ; - test = test_data.[+ (get "data_field") +] ; - - /* Make this a macro so gdb steps over it in one go. */ - CONVERT_DATA (k, DATA_LENGTH, orig, orig_data.d) ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - file = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - - sf_set_string (file, SF_STR_ARTIST, "Your name here") ; - - test_writef_[+ (get "data_type") +]_or_die (file, 0, orig, frames, __LINE__) ; - - sf_set_string (file, SF_STR_COPYRIGHT, "Copyright (c) 2003") ; - - sf_close (file) ; - - memset (test, 0, items * sizeof ([+ (get "data_type") +])) ; - - if ((format & SF_FORMAT_TYPEMASK) != SF_FORMAT_RAW) - memset (&sfinfo, 0, sizeof (sfinfo)) ; - - file = test_open_file_or_die (filename, SFM_READ, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Stereo : Returned format incorrect (0x%08X => 0x%08X).\n", - __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too short). (%" PRId64 " should be %d)\n", - __LINE__, sfinfo.frames, frames) ; - exit (1) ; - } ; - - if (! long_file_ok && sfinfo.frames > frames) - { printf ("\n\nLine %d : Stereo : Incorrect number of frames in file (too long). (%" PRId64 " should be %d)\n", - __LINE__, sfinfo.frames, frames) ; - exit (1) ; - } ; - - if (sfinfo.channels != 2) - { printf ("\n\nLine %d : Stereo : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - check_log_buffer_or_die (file, __LINE__) ; - - test_readf_[+ (get "data_type") +]_or_die (file, 0, test, frames, __LINE__) ; - for (k = 0 ; k < items ; k++) - if ([+ (get "error_func") +] (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : [+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to start of file. */ - test_seek_or_die (file, 0, SEEK_SET, 0, sfinfo.channels, __LINE__) ; - - test_readf_[+ (get "data_type") +]_or_die (file, 0, test, 2, __LINE__) ; - for (k = 0 ; k < 4 ; k++) - if ([+ (get "error_func") +] (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : [+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from start of file. */ - test_seek_or_die (file, 10, SEEK_SET, 10, sfinfo.channels, __LINE__) ; - - /* Check for errors here. */ - if (sf_error (file)) - { printf ("Line %d: Should NOT return an error.\n", __LINE__) ; - puts (sf_strerror (file)) ; - exit (1) ; - } ; - - if (sf_read_[+ (get "data_type") +] (file, test, 1) > 0) - { printf ("Line %d: Should return 0.\n", __LINE__) ; - exit (1) ; - } ; - - if (! sf_error (file)) - { printf ("Line %d: Should return an error.\n", __LINE__) ; - exit (1) ; - } ; - /*-----------------------*/ - - test_readf_[+ (get "data_type") +]_or_die (file, 0, test + 10, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if ([+ (get "error_func") +] (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : [+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from current position. */ - test_seek_or_die (file, 8, SEEK_CUR, 20, sfinfo.channels, __LINE__) ; - - test_readf_[+ (get "data_type") +]_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 40 ; k < 44 ; k++) - if ([+ (get "error_func") +] (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : [+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - /* Seek to offset from end of file. */ - test_seek_or_die (file, -1 * (sfinfo.frames - 10), SEEK_END, 10, sfinfo.channels, __LINE__) ; - - test_readf_[+ (get "data_type") +]_or_die (file, 0, test + 20, 2, __LINE__) ; - for (k = 20 ; k < 24 ; k++) - if ([+ (get "error_func") +] (test [k], orig [k])) - { printf ("\n\nLine %d : Stereo : Incorrect sample (#%d : [+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, k, orig [k], test [k]) ; - exit (1) ; - } ; - - sf_close (file) ; -} /* stereo_[+ (get "type_name") +]_test */ - -static void -mono_rdwr_[+ (get "type_name") +]_test (const char *filename, int format, int long_file_ok, int allow_fd) -{ SNDFILE *file ; - SF_INFO sfinfo ; - [+ (get "data_type") +] *orig, *test ; - int k, pass ; - - switch (format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_ALAC_16 : - case SF_FORMAT_ALAC_20 : - case SF_FORMAT_ALAC_24 : - case SF_FORMAT_ALAC_32 : - allow_fd = 0 ; - break ; - - default : - break ; - } ; - - orig = orig_data.[+ (get "data_field") +] ; - test = test_data.[+ (get "data_field") +] ; - - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - if ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_RAW - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_AU - || (format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) - unlink (filename) ; - else - { /* Create a short file. */ - create_short_file (filename) ; - - /* Opening a already existing short file (ie invalid header) RDWR is disallowed. - ** If this returns a valif pointer sf_open() screwed up. - */ - if ((file = sf_open (filename, SFM_RDWR, &sfinfo))) - { printf ("\n\nLine %d: sf_open should (SFM_RDWR) have failed but didn't.\n", __LINE__) ; - exit (1) ; - } ; - - /* Truncate the file to zero bytes. */ - if (truncate (filename, 0) < 0) - { printf ("\n\nLine %d: truncate (%s) failed", __LINE__, filename) ; - perror (NULL) ; - exit (1) ; - } ; - } ; - - /* Opening a zero length file RDWR is allowed, but the SF_INFO struct must contain - ** all the usual data required when opening the file in WRITE mode. - */ - sfinfo.samplerate = SAMPLE_RATE ; - sfinfo.frames = DATA_LENGTH ; - sfinfo.channels = 1 ; - sfinfo.format = format ; - - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - /* Do 3 writes followed by reads. After each, check the data and the current - ** read and write offsets. - */ - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - /* Write some data. */ - test_write_[+ (get "data_type") +]_or_die (file, pass, orig, DATA_LENGTH, __LINE__) ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, pass * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_[+ (get "data_type") +]_or_die (file, 0, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if ([+ (get "error_func") +] (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) A : Error at sample %d ([+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_[+ (get "data_type") +] (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - test_read_write_position_or_die (file, __LINE__, pass, pass * DATA_LENGTH, pass * DATA_LENGTH) ; - } ; /* for (pass ...) */ - - sf_close (file) ; - - /* Open the file again to check the data. */ - file = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - - if (sfinfo.format != format) - { printf ("\n\nLine %d : Returned format incorrect (0x%08X => 0x%08X).\n", __LINE__, format, sfinfo.format) ; - exit (1) ; - } ; - - if (sfinfo.frames < 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Not enough frames in file. (%" PRId64 " < %d)\n", __LINE__, sfinfo.frames, 3 * DATA_LENGTH) ; - exit (1) ; - } - - if (! long_file_ok && sfinfo.frames != 3 * DATA_LENGTH) - { printf ("\n\nLine %d : Incorrect number of frames in file. (%" PRId64 " should be %d)\n", __LINE__, sfinfo.frames, 3 * DATA_LENGTH) ; - exit (1) ; - } ; - - if (sfinfo.channels != 1) - { printf ("\n\nLine %d : Incorrect number of channels in file.\n", __LINE__) ; - exit (1) ; - } ; - - if (! long_file_ok) - test_read_write_position_or_die (file, __LINE__, 0, 0, 3 * DATA_LENGTH) ; - else - test_seek_or_die (file, 3 * DATA_LENGTH, SFM_WRITE | SEEK_SET, 3 * DATA_LENGTH, sfinfo.channels, __LINE__) ; - - for (pass = 1 ; pass <= 3 ; pass ++) - { orig [20] = pass * 2 ; - - test_read_write_position_or_die (file, __LINE__, pass, (pass - 1) * DATA_LENGTH, 3 * DATA_LENGTH) ; - - /* Read what we just wrote. */ - test_read_[+ (get "data_type") +]_or_die (file, pass, test, DATA_LENGTH, __LINE__) ; - - /* Check the data. */ - for (k = 0 ; k < DATA_LENGTH ; k++) - if ([+ (get "error_func") +] (orig [k], test [k])) - { printf ("\n\nLine %d (pass %d) B : Error at sample %d ([+ (get "format_char") +] => [+ (get "format_char") +]).\n", __LINE__, pass, k, orig [k], test [k]) ; - oct_save_[+ (get "data_type") +] (orig, test, DATA_LENGTH) ; - exit (1) ; - } ; - - } ; /* for (pass ...) */ - - sf_close (file) ; -} /* mono_rdwr_[+ (get "data_type") +]_test */ - -static void -new_rdwr_[+ (get "type_name") +]_test (const char *filename, int format, int allow_fd) -{ SNDFILE *wfile, *rwfile ; - SF_INFO sfinfo ; - [+ (get "data_type") +] *orig, *test ; - int items, frames ; - - orig = orig_data.[+ (get "data_field") +] ; - test = test_data.[+ (get "data_field") +] ; - - sfinfo.samplerate = 44100 ; - sfinfo.frames = SILLY_WRITE_COUNT ; /* Wrong length. Library should correct this on sf_close. */ - sfinfo.channels = 2 ; - sfinfo.format = format ; - - items = DATA_LENGTH ; - frames = items / sfinfo.channels ; - - wfile = test_open_file_or_die (filename, SFM_WRITE, &sfinfo, allow_fd, __LINE__) ; - sf_command (wfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ; - test_writef_[+ (get "data_type") +]_or_die (wfile, 1, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - test_writef_[+ (get "data_type") +]_or_die (wfile, 2, orig, frames, __LINE__) ; - sf_write_sync (wfile) ; - - rwfile = test_open_file_or_die (filename, SFM_RDWR, &sfinfo, allow_fd, __LINE__) ; - if (sfinfo.frames != 2 * frames) - { printf ("\n\nLine %d : incorrect number of frames in file (%" PRId64 " should be %d)\n\n", __LINE__, sfinfo.frames, 2 * frames) ; - exit (1) ; - } ; - - test_writef_[+ (get "data_type") +]_or_die (wfile, 3, orig, frames, __LINE__) ; - - test_readf_[+ (get "data_type") +]_or_die (rwfile, 1, test, frames, __LINE__) ; - test_readf_[+ (get "data_type") +]_or_die (rwfile, 2, test, frames, __LINE__) ; - - sf_close (wfile) ; - sf_close (rwfile) ; -} /* new_rdwr_[+ (get "type_name") +]_test */ - -[+ ENDFOR data_type +] - -/*---------------------------------------------------------------------------------------- -*/ - -static void -empty_file_test (const char *filename, int format) -{ SNDFILE *file ; - SF_INFO info ; - int allow_fd ; - - /* Sd2 files cannot be opened from an existing file descriptor. */ - allow_fd = ((format & SF_FORMAT_TYPEMASK) == SF_FORMAT_SD2) ? SF_FALSE : SF_TRUE ; - - print_test_name ("empty_file_test", filename) ; - - unlink (filename) ; - - info.samplerate = 48000 ; - info.channels = 2 ; - info.format = format ; - - if (sf_format_check (&info) == SF_FALSE) - { info.channels = 1 ; - if (sf_format_check (&info) == SF_FALSE) - { puts ("invalid file format") ; - return ; - } ; - } ; - - /* Create an empty file. */ - file = test_open_file_or_die (filename, SFM_WRITE, &info, allow_fd, __LINE__) ; - sf_close (file) ; - - /* Open for read and check the length. */ - file = test_open_file_or_die (filename, SFM_READ, &info, allow_fd, __LINE__) ; - - if (info.frames != 0) - { printf ("\n\nError : frame count (%" PRId64 ") should be zero.\n", info.frames) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Open for read/write and check the length. */ - file = test_open_file_or_die (filename, SFM_RDWR, &info, allow_fd, __LINE__) ; - - if (info.frames != 0) - { printf ("\n\nError : frame count (%" PRId64 ") should be zero.\n", info.frames) ; - exit (1) ; - } ; - - sf_close (file) ; - - /* Open for read and check the length. */ - file = test_open_file_or_die (filename, SFM_READ, &info, allow_fd, __LINE__) ; - - if (info.frames != 0) - { printf ("\n\nError : frame count (%" PRId64 ") should be zero.\n", info.frames) ; - exit (1) ; - } ; - - sf_close (file) ; - - check_open_file_count_or_die (__LINE__) ; - - unlink (filename) ; - puts ("ok") ; - - return ; -} /* empty_file_test */ - - -/*---------------------------------------------------------------------------------------- -*/ - -static void -create_short_file (const char *filename) -{ FILE *file ; - - if (! (file = fopen (filename, "w"))) - { printf ("create_short_file : fopen (%s, \"w\") failed.", filename) ; - fflush (stdout) ; - perror (NULL) ; - exit (1) ; - } ; - - fprintf (file, "This is the file data.\n") ; - - fclose (file) ; -} /* create_short_file */ - - -static void -multi_seek_test (const char * filename, int format) -{ SNDFILE * file ; - SF_INFO info ; - sf_count_t pos ; - int k ; - - /* This test doesn't work on the following. */ - switch (format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_RAW : - return ; - - default : - break ; - } ; - - memset (&info, 0, sizeof (info)) ; - - generate_file (filename, format, 88200) ; - - file = test_open_file_or_die (filename, SFM_READ, &info, SF_FALSE, __LINE__) ; - - for (k = 0 ; k < 10 ; k++) - { pos = info.frames / (k + 2) ; - test_seek_or_die (file, pos, SEEK_SET, pos, info.channels, __LINE__) ; - } ; - - sf_close (file) ; -} /* multi_seek_test */ - -static void -write_seek_extend_test (const char * filename, int format) -{ SNDFILE * file ; - SF_INFO info ; - short *orig, *test ; - unsigned items, k ; - - /* This test doesn't work on the following container formats. */ - switch (format & SF_FORMAT_TYPEMASK) - { case SF_FORMAT_FLAC : - case SF_FORMAT_HTK : - case SF_FORMAT_PAF : - case SF_FORMAT_SDS : - case SF_FORMAT_SVX : - return ; - - default : - break ; - } ; - - /* This test doesn't work on the following codec formats. */ - switch (format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_ALAC_16 : - case SF_FORMAT_ALAC_20 : - case SF_FORMAT_ALAC_24 : - case SF_FORMAT_ALAC_32 : - return ; - - default : - break ; - } ; - - memset (&info, 0, sizeof (info)) ; - - info.samplerate = 48000 ; - info.channels = 1 ; - info.format = format ; - - items = 512 ; - exit_if_true (items > ARRAY_LEN (orig_data.s), "Line %d : Bad assumption.\n", __LINE__) ; - - orig = orig_data.s ; - test = test_data.s ; - - for (k = 0 ; k < ARRAY_LEN (orig_data.s) ; k++) - orig [k] = 0x3fff ; - - file = test_open_file_or_die (filename, SFM_WRITE, &info, SF_FALSE, __LINE__) ; - test_write_short_or_die (file, 0, orig, items, __LINE__) ; - - /* Extend the file using a seek. */ - test_seek_or_die (file, 2 * items, SEEK_SET, 2 * items, info.channels, __LINE__) ; - - test_writef_short_or_die (file, 0, orig, items, __LINE__) ; - sf_close (file) ; - - file = test_open_file_or_die (filename, SFM_READ, &info, SF_FALSE, __LINE__) ; - test_read_short_or_die (file, 0, test, 3 * items, __LINE__) ; - sf_close (file) ; - - /* Can't do these formats due to scaling. */ - switch (format & SF_FORMAT_SUBMASK) - { case SF_FORMAT_PCM_S8 : - case SF_FORMAT_PCM_U8 : - return ; - default : - break ; - } ; - - for (k = 0 ; k < items ; k++) - { exit_if_true (test [k] != 0x3fff, "Line %d : test [%d] == %d, should be 0x3fff.\n", __LINE__, k, test [k]) ; - exit_if_true (test [items + k] != 0, "Line %d : test [%d] == %d, should be 0.\n", __LINE__, items + k, test [items + k]) ; - exit_if_true (test [2 * items + k] != 0x3fff, "Line %d : test [%d] == %d, should be 0x3fff.\n", __LINE__, 2 * items + k, test [2 * items + k]) ; - } ; - - return ; -} /* write_seek_extend_test */ - - diff --git a/libs/win32/libsndfile/cleancount b/libs/win32/libsndfile/cleancount deleted file mode 100644 index 56a6051ca2..0000000000 --- a/libs/win32/libsndfile/cleancount +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/libs/win32/libsndfile/config.h b/libs/win32/libsndfile/config.h deleted file mode 100644 index d32301d30c..0000000000 --- a/libs/win32/libsndfile/config.h +++ /dev/null @@ -1,294 +0,0 @@ -/* -** Copyright (C) 2002-2004 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** This is the Win32 version of the file config.h which is autogenerated -** on Unix systems. -*/ - -#pragma warning (disable : 4244) -#pragma warning (disable : 4761) - -#include - -/* Set to 1 if the compile is GNU GCC. */ -/* #undef COMPILER_IS_GCC */ - -/* Target processor clips on negative float to int conversion. */ -#define CPU_CLIPS_NEGATIVE 1 - -/* Target processor clips on positive float to int conversion. */ -#define CPU_CLIPS_POSITIVE 0 - -/* Target processor is big endian. */ -#define CPU_IS_BIG_ENDIAN 0 - -/* Target processor is little endian. */ -#define CPU_IS_LITTLE_ENDIAN 1 - -/* Set to 1 to enable experimental code. */ -#define ENABLE_EXPERIMENTAL_CODE 0 - -/* Major version of GCC or 3 otherwise. */ -/* #undef GCC_MAJOR_VERSION */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ALSA_ASOUNDLIB_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_BYTESWAP_H */ - -/* Define to 1 if you have the `calloc' function. */ -#define HAVE_CALLOC 1 - -/* Define to 1 if you have the `ceil' function. */ -#define HAVE_CEIL 1 - -/* Set to 1 if S_IRGRP is defined. */ -#define HAVE_DECL_S_IRGRP 0 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_DLFCN_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ENDIAN_H */ - -/* Define to 1 if you have the `fdatasync' function. */ - -/* #undef HAVE_FDATASYNC */ - -/* Define to 1 if you have libflac 1.1.1 */ -/* #undef HAVE_FLAC_1_1_1 1 */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_FLAC_ALL_H 1 */ - -/* Set to 1 if the compile supports the struct hack. */ -#define HAVE_FLEXIBLE_ARRAY 1 - -/* Define to 1 if you have the `floor' function. */ -#define HAVE_FLOOR 1 - -/* Define to 1 if you have the `fmod' function. */ -#define HAVE_FMOD 1 - -/* Define to 1 if you have the `free' function. */ -#define HAVE_FREE 1 - -/* Define to 1 if you have the `fstat' function. */ -#define HAVE_FSTAT 1 - -/* Define to 1 if you have the `fsync' function. */ -/* #undef HAVE_FSYNC */ - -/* Define to 1 if you have the `ftruncate' function. */ -/* #undef HAVE_FTRUNCATE */ - -/* Define to 1 if you have the `getpagesize' function. */ -#define HAVE_GETPAGESIZE 1 - -/* Define to 1 if you have the `gmtime' function. */ -#define HAVE_GMTIME 1 - -/* Define to 1 if you have the `gmtime_r' function. */ -/* #undef HAVE_GMTIME_R */ - -/* Define to 1 if you have the header file. */ -/* #define HAVE_INTTYPES_H */ - -/* Define to 1 if you have the `m' library (-lm). */ -#define HAVE_LIBM 1 - -/* Define if you have C99's lrint function. */ -/* #undef HAVE_LRINT */ - -/* Define if you have C99's lrintf function. */ -/* #undef HAVE_LRINTF */ - -/* Define to 1 if you have the `lseek' function. */ -#define HAVE_LSEEK 1 - -/* Define to 1 if you have the `malloc' function. */ -#define HAVE_MALLOC 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `mmap' function. */ -/* #undef HAVE_MMAP */ - -/* Define to 1 if you have the `open' function. */ -#define HAVE_OPEN 1 - -/* Define to 1 if you have the `pread' function. */ -/* #undef HAVE_PREAD */ - -/* Define to 1 if you have the `pwrite' function. */ -/* #undef HAVE_PWRITE */ - -/* Define to 1 if you have the `read' function. */ -#define HAVE_READ 1 - -/* Define to 1 if you have the `realloc' function. */ -#define HAVE_REALLOC 1 - -/* Define to 1 if you have the `snprintf' function. */ -#define HAVE_SNPRINTF 1 - -/* Set to 1 if you have libsqlite3. */ -/* #undef HAVE_SQLITE3 */ - -/* Define to 1 if the system has the type `ssize_t'. */ -/* #undef HAVE_SSIZE_T */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have that is POSIX.1 compatible. */ -/* #undef HAVE_SYS_WAIT_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define to 1 if you have the `vsnprintf' function. */ -#define HAVE_VSNPRINTF 1 - -/* Define to 1 if you have the `write' function. */ -#define HAVE_WRITE 1 - -/* Set to 1 if compiling for MacOSX */ -#define OS_IS_MACOSX 0 - -/* Set to 1 if compiling for Win32 */ -#define OS_IS_WIN32 1 - -/* Name of package */ -#define PACKAGE "libsndfile" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "erikd@mega-nerd.com" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "libsndfile" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libsndfile 1.0.26pre5" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "libsndfile" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "1.0.26pre5" - -/* Set to maximum allowed value of sf_count_t type. */ -//#define SF_COUNT_MAX 0x7FFFFFFFFFFFFFFFi64 - -/* The size of a `double', as computed by sizeof. */ -#define SIZEOF_DOUBLE 8 - -/* The size of a `float', as computed by sizeof. */ -#define SIZEOF_FLOAT 4 - -/* The size of a `int', as computed by sizeof. */ -#define SIZEOF_INT 4 - -/* The size of a `int64_t', as computed by sizeof. */ -#define SIZEOF_INT64_T 0 - -/* The size of a `loff_t', as computed by sizeof. */ -#define SIZEOF_LOFF_T 0 - -/* The size of a `long', as computed by sizeof. */ -#define SIZEOF_LONG 4 - -/* The size of a `long long', as computed by sizeof. */ -#define SIZEOF_LONG_LONG 0 - -/* The size of a `off64_t', as computed by sizeof. */ -/* #undef SIZEOF_OFF64_T */ - -/* The size of a `off_t', as computed by sizeof. */ -#define SIZEOF_OFF_T 4 - -/* Set to sizeof (long) if unknown. */ -#define SIZEOF_SF_COUNT_T 8 - -/* The size of a `short', as computed by sizeof. */ -#define SIZEOF_SHORT 2 - -/* The size of a `size_t', as computed by sizeof. */ -#define SIZEOF_SIZE_T 4 - -/* The size of a `ssize_t', as computed by sizeof. */ -#define SIZEOF_SSIZE_T 4 - -/* The size of a `void*', as computed by sizeof. */ -#define SIZEOF_VOIDP 4 - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Set to long if unknown. */ -#define TYPEOF_SF_COUNT_T loff_t - -/* Set to 1 to use the native windows API */ -#define USE_WINDOWS_API 1 - -/* Version number of package */ -#define VERSION "1.0.18" - -#define HAVE_STDINT_H 1 - -/* Number of bits in a file offset, on hosts where this is settable. */ -/* #undef _FILE_OFFSET_BITS */ - -/* Define to make fseeko etc. visible, on some hosts. */ -/* #undef _LARGEFILE_SOURCE */ - -/* Define for large files, on AIX-style hosts. */ -/* #undef _LARGE_FILES */ - -#include - -typedef __int32 int32_t; -typedef intptr_t ssize_t; -typedef unsigned __int16 uint16_t; -typedef unsigned __int32 uint32_t; -#define PRId64 "I64d" - -#define __func__ __FUNCTION__ -#if _MSC_VER < 1900 -#define snprintf _snprintf -#endif - -#include \ No newline at end of file diff --git a/libs/win32/libsndfile/libsndfile.2010.vcxproj.filters b/libs/win32/libsndfile/libsndfile.2010.vcxproj.filters deleted file mode 100644 index a4335a1522..0000000000 --- a/libs/win32/libsndfile/libsndfile.2010.vcxproj.filters +++ /dev/null @@ -1,285 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {b116d731-aba1-4ebd-928f-51113eb4c45b} - - - {e24785ab-1f78-4bb6-98f3-6c4586e85648} - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - {f00f84d5-78ae-4996-bee3-00106a731232} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\GSM Sources - - - Source Files\G72X Sources - - - Source Files\G72X Sources - - - Source Files\G72X Sources - - - Source Files\G72X Sources - - - Source Files\G72X Sources - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files\ALLAC Sources - - - Source Files\ALLAC Sources - - - Source Files\ALLAC Sources - - - Source Files\ALLAC Sources - - - Source Files\ALLAC Sources - - - Source Files\ALLAC Sources - - - Source Files\ALLAC Sources - - - Source Files\ALLAC Sources - - - Source Files\ALLAC Sources - - - - - Source Files - - - Header Files - - - Source Files\ALLAC Sources - - - Source Files\ALLAC Sources - - - \ No newline at end of file diff --git a/libs/win32/libsndfile/libsndfile.2015.vcxproj b/libs/win32/libsndfile/libsndfile.2015.vcxproj deleted file mode 100644 index e6460ef81e..0000000000 --- a/libs/win32/libsndfile/libsndfile.2015.vcxproj +++ /dev/null @@ -1,222 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - libsndfile - {3D0370CA-BED2-4657-A475-32375CBCB6E4} - libsndfile - Win32Proj - - - - StaticLibrary - NotSet - true - v140 - - - StaticLibrary - NotSet - v140 - - - StaticLibrary - NotSet - true - v140 - - - StaticLibrary - NotSet - v140 - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - - - - Disabled - ..\..\libsndfile\src;.;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;inline=__inline;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level1 - CompileAsC - - - - - X64 - - - Disabled - ..\..\libsndfile\src;.;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_LIB;inline=__inline;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level1 - CompileAsC - - - - - ..\..\libsndfile\src;.;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;inline=__inline;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDLL - Level1 - CompileAsC - - - - - X64 - - - ..\..\libsndfile\src;.;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;inline=__inline;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) - MultiThreadedDLL - Level1 - CompileAsC - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - $(IntDir)%(Filename)1.obj - $(IntDir)%(Filename)1.xdc - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libs/win32/libsndfile/sndfile.h b/libs/win32/libsndfile/sndfile.h deleted file mode 100644 index fa11e700e2..0000000000 --- a/libs/win32/libsndfile/sndfile.h +++ /dev/null @@ -1,817 +0,0 @@ -/* -** Copyright (C) 1999-2013 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** sndfile.h -- system-wide definitions -** -** API documentation is in the doc/ directory of the source code tarball -** and at http://www.mega-nerd.com/libsndfile/api.html. -*/ - -#ifndef SNDFILE_H -#define SNDFILE_H - -/* This is the version 1.0.X header file. */ -#define SNDFILE_1 - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* The following file types can be read and written. -** A file type would consist of a major type (ie SF_FORMAT_WAV) bitwise -** ORed with a minor type (ie SF_FORMAT_PCM). SF_FORMAT_TYPEMASK and -** SF_FORMAT_SUBMASK can be used to separate the major and minor file -** types. -*/ - -enum -{ /* Major formats. */ - SF_FORMAT_WAV = 0x010000, /* Microsoft WAV format (little endian default). */ - SF_FORMAT_AIFF = 0x020000, /* Apple/SGI AIFF format (big endian). */ - SF_FORMAT_AU = 0x030000, /* Sun/NeXT AU format (big endian). */ - SF_FORMAT_RAW = 0x040000, /* RAW PCM data. */ - SF_FORMAT_PAF = 0x050000, /* Ensoniq PARIS file format. */ - SF_FORMAT_SVX = 0x060000, /* Amiga IFF / SVX8 / SV16 format. */ - SF_FORMAT_NIST = 0x070000, /* Sphere NIST format. */ - SF_FORMAT_VOC = 0x080000, /* VOC files. */ - SF_FORMAT_IRCAM = 0x0A0000, /* Berkeley/IRCAM/CARL */ - SF_FORMAT_W64 = 0x0B0000, /* Sonic Foundry's 64 bit RIFF/WAV */ - SF_FORMAT_MAT4 = 0x0C0000, /* Matlab (tm) V4.2 / GNU Octave 2.0 */ - SF_FORMAT_MAT5 = 0x0D0000, /* Matlab (tm) V5.0 / GNU Octave 2.1 */ - SF_FORMAT_PVF = 0x0E0000, /* Portable Voice Format */ - SF_FORMAT_XI = 0x0F0000, /* Fasttracker 2 Extended Instrument */ - SF_FORMAT_HTK = 0x100000, /* HMM Tool Kit format */ - SF_FORMAT_SDS = 0x110000, /* Midi Sample Dump Standard */ - SF_FORMAT_AVR = 0x120000, /* Audio Visual Research */ - SF_FORMAT_WAVEX = 0x130000, /* MS WAVE with WAVEFORMATEX */ - SF_FORMAT_SD2 = 0x160000, /* Sound Designer 2 */ - SF_FORMAT_FLAC = 0x170000, /* FLAC lossless file format */ - SF_FORMAT_CAF = 0x180000, /* Core Audio File format */ - SF_FORMAT_WVE = 0x190000, /* Psion WVE format */ - SF_FORMAT_OGG = 0x200000, /* Xiph OGG container */ - SF_FORMAT_MPC2K = 0x210000, /* Akai MPC 2000 sampler */ - SF_FORMAT_RF64 = 0x220000, /* RF64 WAV file */ - - /* Subtypes from here on. */ - - SF_FORMAT_PCM_S8 = 0x0001, /* Signed 8 bit data */ - SF_FORMAT_PCM_16 = 0x0002, /* Signed 16 bit data */ - SF_FORMAT_PCM_24 = 0x0003, /* Signed 24 bit data */ - SF_FORMAT_PCM_32 = 0x0004, /* Signed 32 bit data */ - - SF_FORMAT_PCM_U8 = 0x0005, /* Unsigned 8 bit data (WAV and RAW only) */ - - SF_FORMAT_FLOAT = 0x0006, /* 32 bit float data */ - SF_FORMAT_DOUBLE = 0x0007, /* 64 bit float data */ - - SF_FORMAT_ULAW = 0x0010, /* U-Law encoded. */ - SF_FORMAT_ALAW = 0x0011, /* A-Law encoded. */ - SF_FORMAT_IMA_ADPCM = 0x0012, /* IMA ADPCM. */ - SF_FORMAT_MS_ADPCM = 0x0013, /* Microsoft ADPCM. */ - - SF_FORMAT_GSM610 = 0x0020, /* GSM 6.10 encoding. */ - SF_FORMAT_VOX_ADPCM = 0x0021, /* OKI / Dialogix ADPCM */ - - SF_FORMAT_G721_32 = 0x0030, /* 32kbs G721 ADPCM encoding. */ - SF_FORMAT_G723_24 = 0x0031, /* 24kbs G723 ADPCM encoding. */ - SF_FORMAT_G723_40 = 0x0032, /* 40kbs G723 ADPCM encoding. */ - - SF_FORMAT_DWVW_12 = 0x0040, /* 12 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_16 = 0x0041, /* 16 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_24 = 0x0042, /* 24 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_N = 0x0043, /* N bit Delta Width Variable Word encoding. */ - - SF_FORMAT_DPCM_8 = 0x0050, /* 8 bit differential PCM (XI only) */ - SF_FORMAT_DPCM_16 = 0x0051, /* 16 bit differential PCM (XI only) */ - - SF_FORMAT_VORBIS = 0x0060, /* Xiph Vorbis encoding. */ - - SF_FORMAT_ALAC_16 = 0x0070, /* Apple Lossless Audio Codec (16 bit). */ - SF_FORMAT_ALAC_20 = 0x0071, /* Apple Lossless Audio Codec (20 bit). */ - SF_FORMAT_ALAC_24 = 0x0072, /* Apple Lossless Audio Codec (24 bit). */ - SF_FORMAT_ALAC_32 = 0x0073, /* Apple Lossless Audio Codec (32 bit). */ - - /* Endian-ness options. */ - - SF_ENDIAN_FILE = 0x00000000, /* Default file endian-ness. */ - SF_ENDIAN_LITTLE = 0x10000000, /* Force little endian-ness. */ - SF_ENDIAN_BIG = 0x20000000, /* Force big endian-ness. */ - SF_ENDIAN_CPU = 0x30000000, /* Force CPU endian-ness. */ - - SF_FORMAT_SUBMASK = 0x0000FFFF, - SF_FORMAT_TYPEMASK = 0x0FFF0000, - SF_FORMAT_ENDMASK = 0x30000000 -} ; - -/* -** The following are the valid command numbers for the sf_command() -** interface. The use of these commands is documented in the file -** command.html in the doc directory of the source code distribution. -*/ - -enum -{ SFC_GET_LIB_VERSION = 0x1000, - SFC_GET_LOG_INFO = 0x1001, - SFC_GET_CURRENT_SF_INFO = 0x1002, - - - SFC_GET_NORM_DOUBLE = 0x1010, - SFC_GET_NORM_FLOAT = 0x1011, - SFC_SET_NORM_DOUBLE = 0x1012, - SFC_SET_NORM_FLOAT = 0x1013, - SFC_SET_SCALE_FLOAT_INT_READ = 0x1014, - SFC_SET_SCALE_INT_FLOAT_WRITE = 0x1015, - - SFC_GET_SIMPLE_FORMAT_COUNT = 0x1020, - SFC_GET_SIMPLE_FORMAT = 0x1021, - - SFC_GET_FORMAT_INFO = 0x1028, - - SFC_GET_FORMAT_MAJOR_COUNT = 0x1030, - SFC_GET_FORMAT_MAJOR = 0x1031, - SFC_GET_FORMAT_SUBTYPE_COUNT = 0x1032, - SFC_GET_FORMAT_SUBTYPE = 0x1033, - - SFC_CALC_SIGNAL_MAX = 0x1040, - SFC_CALC_NORM_SIGNAL_MAX = 0x1041, - SFC_CALC_MAX_ALL_CHANNELS = 0x1042, - SFC_CALC_NORM_MAX_ALL_CHANNELS = 0x1043, - SFC_GET_SIGNAL_MAX = 0x1044, - SFC_GET_MAX_ALL_CHANNELS = 0x1045, - - SFC_SET_ADD_PEAK_CHUNK = 0x1050, - SFC_SET_ADD_HEADER_PAD_CHUNK = 0x1051, - - SFC_UPDATE_HEADER_NOW = 0x1060, - SFC_SET_UPDATE_HEADER_AUTO = 0x1061, - - SFC_FILE_TRUNCATE = 0x1080, - - SFC_SET_RAW_START_OFFSET = 0x1090, - - SFC_SET_DITHER_ON_WRITE = 0x10A0, - SFC_SET_DITHER_ON_READ = 0x10A1, - - SFC_GET_DITHER_INFO_COUNT = 0x10A2, - SFC_GET_DITHER_INFO = 0x10A3, - - SFC_GET_EMBED_FILE_INFO = 0x10B0, - - SFC_SET_CLIPPING = 0x10C0, - SFC_GET_CLIPPING = 0x10C1, - - SFC_GET_INSTRUMENT = 0x10D0, - SFC_SET_INSTRUMENT = 0x10D1, - - SFC_GET_LOOP_INFO = 0x10E0, - - SFC_GET_BROADCAST_INFO = 0x10F0, - SFC_SET_BROADCAST_INFO = 0x10F1, - - SFC_GET_CHANNEL_MAP_INFO = 0x1100, - SFC_SET_CHANNEL_MAP_INFO = 0x1101, - - SFC_RAW_DATA_NEEDS_ENDSWAP = 0x1110, - - /* Support for Wavex Ambisonics Format */ - SFC_WAVEX_SET_AMBISONIC = 0x1200, - SFC_WAVEX_GET_AMBISONIC = 0x1201, - - SFC_SET_VBR_ENCODING_QUALITY = 0x1300, - SFC_SET_COMPRESSION_LEVEL = 0x1301, - - /* Cart Chunk support */ - SFC_SET_CART_INFO = 0x1400, - SFC_GET_CART_INFO = 0x1401, - - /* Following commands for testing only. */ - SFC_TEST_IEEE_FLOAT_REPLACE = 0x6001, - - /* - ** SFC_SET_ADD_* values are deprecated and will disappear at some - ** time in the future. They are guaranteed to be here up to and - ** including version 1.0.8 to avoid breakage of existing software. - ** They currently do nothing and will continue to do nothing. - */ - SFC_SET_ADD_DITHER_ON_WRITE = 0x1070, - SFC_SET_ADD_DITHER_ON_READ = 0x1071 -} ; - - -/* -** String types that can be set and read from files. Not all file types -** support this and even the file types which support one, may not support -** all string types. -*/ - -enum -{ SF_STR_TITLE = 0x01, - SF_STR_COPYRIGHT = 0x02, - SF_STR_SOFTWARE = 0x03, - SF_STR_ARTIST = 0x04, - SF_STR_COMMENT = 0x05, - SF_STR_DATE = 0x06, - SF_STR_ALBUM = 0x07, - SF_STR_LICENSE = 0x08, - SF_STR_TRACKNUMBER = 0x09, - SF_STR_GENRE = 0x10 -} ; - -/* -** Use the following as the start and end index when doing metadata -** transcoding. -*/ - -#define SF_STR_FIRST SF_STR_TITLE -#define SF_STR_LAST SF_STR_GENRE - -enum -{ /* True and false */ - SF_FALSE = 0, - SF_TRUE = 1, - - /* Modes for opening files. */ - SFM_READ = 0x10, - SFM_WRITE = 0x20, - SFM_RDWR = 0x30, - - SF_AMBISONIC_NONE = 0x40, - SF_AMBISONIC_B_FORMAT = 0x41 -} ; - -/* Public error values. These are guaranteed to remain unchanged for the duration -** of the library major version number. -** There are also a large number of private error numbers which are internal to -** the library which can change at any time. -*/ - -enum -{ SF_ERR_NO_ERROR = 0, - SF_ERR_UNRECOGNISED_FORMAT = 1, - SF_ERR_SYSTEM = 2, - SF_ERR_MALFORMED_FILE = 3, - SF_ERR_UNSUPPORTED_ENCODING = 4 -} ; - - -/* Channel map values (used with SFC_SET/GET_CHANNEL_MAP). -*/ - -enum -{ SF_CHANNEL_MAP_INVALID = 0, - SF_CHANNEL_MAP_MONO = 1, - SF_CHANNEL_MAP_LEFT, /* Apple calls this 'Left' */ - SF_CHANNEL_MAP_RIGHT, /* Apple calls this 'Right' */ - SF_CHANNEL_MAP_CENTER, /* Apple calls this 'Center' */ - SF_CHANNEL_MAP_FRONT_LEFT, - SF_CHANNEL_MAP_FRONT_RIGHT, - SF_CHANNEL_MAP_FRONT_CENTER, - SF_CHANNEL_MAP_REAR_CENTER, /* Apple calls this 'Center Surround', Msft calls this 'Back Center' */ - SF_CHANNEL_MAP_REAR_LEFT, /* Apple calls this 'Left Surround', Msft calls this 'Back Left' */ - SF_CHANNEL_MAP_REAR_RIGHT, /* Apple calls this 'Right Surround', Msft calls this 'Back Right' */ - SF_CHANNEL_MAP_LFE, /* Apple calls this 'LFEScreen', Msft calls this 'Low Frequency' */ - SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER, /* Apple calls this 'Left Center' */ - SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER, /* Apple calls this 'Right Center */ - SF_CHANNEL_MAP_SIDE_LEFT, /* Apple calls this 'Left Surround Direct' */ - SF_CHANNEL_MAP_SIDE_RIGHT, /* Apple calls this 'Right Surround Direct' */ - SF_CHANNEL_MAP_TOP_CENTER, /* Apple calls this 'Top Center Surround' */ - SF_CHANNEL_MAP_TOP_FRONT_LEFT, /* Apple calls this 'Vertical Height Left' */ - SF_CHANNEL_MAP_TOP_FRONT_RIGHT, /* Apple calls this 'Vertical Height Right' */ - SF_CHANNEL_MAP_TOP_FRONT_CENTER, /* Apple calls this 'Vertical Height Center' */ - SF_CHANNEL_MAP_TOP_REAR_LEFT, /* Apple and MS call this 'Top Back Left' */ - SF_CHANNEL_MAP_TOP_REAR_RIGHT, /* Apple and MS call this 'Top Back Right' */ - SF_CHANNEL_MAP_TOP_REAR_CENTER, /* Apple and MS call this 'Top Back Center' */ - - SF_CHANNEL_MAP_AMBISONIC_B_W, - SF_CHANNEL_MAP_AMBISONIC_B_X, - SF_CHANNEL_MAP_AMBISONIC_B_Y, - SF_CHANNEL_MAP_AMBISONIC_B_Z, - - SF_CHANNEL_MAP_MAX -} ; - - -/* A SNDFILE* pointer can be passed around much like stdio.h's FILE* pointer. */ - -typedef struct SNDFILE_tag SNDFILE ; - -/* The following typedef is system specific and is defined when libsndfile is -** compiled. sf_count_t will be a 64 bit value when the underlying OS allows -** 64 bit file offsets. -** On windows, we need to allow the same header file to be compiler by both GCC -** and the Microsoft compiler. -*/ - -#if (defined (_MSCVER) || defined (_MSC_VER)) -typedef __int64 sf_count_t ; -#define SF_COUNT_MAX 0x7fffffffffffffffi64 -#else -typedef @TYPEOF_SF_COUNT_T@ sf_count_t ; -#define SF_COUNT_MAX @SF_COUNT_MAX@ -#endif - - -/* A pointer to a SF_INFO structure is passed to sf_open () and filled in. -** On write, the SF_INFO structure is filled in by the user and passed into -** sf_open (). -*/ - -struct SF_INFO -{ sf_count_t frames ; /* Used to be called samples. Changed to avoid confusion. */ - int samplerate ; - int channels ; - int format ; - int sections ; - int seekable ; -} ; - -typedef struct SF_INFO SF_INFO ; - -/* The SF_FORMAT_INFO struct is used to retrieve information about the sound -** file formats libsndfile supports using the sf_command () interface. -** -** Using this interface will allow applications to support new file formats -** and encoding types when libsndfile is upgraded, without requiring -** re-compilation of the application. -** -** Please consult the libsndfile documentation (particularly the information -** on the sf_command () interface) for examples of its use. -*/ - -typedef struct -{ int format ; - const char *name ; - const char *extension ; -} SF_FORMAT_INFO ; - -/* -** Enums and typedefs for adding dither on read and write. -** See the html documentation for sf_command(), SFC_SET_DITHER_ON_WRITE -** and SFC_SET_DITHER_ON_READ. -*/ - -enum -{ SFD_DEFAULT_LEVEL = 0, - SFD_CUSTOM_LEVEL = 0x40000000, - - SFD_NO_DITHER = 500, - SFD_WHITE = 501, - SFD_TRIANGULAR_PDF = 502 -} ; - -typedef struct -{ int type ; - double level ; - const char *name ; -} SF_DITHER_INFO ; - -/* Struct used to retrieve information about a file embedded within a -** larger file. See SFC_GET_EMBED_FILE_INFO. -*/ - -typedef struct -{ sf_count_t offset ; - sf_count_t length ; -} SF_EMBED_FILE_INFO ; - -/* -** Structs used to retrieve music sample information from a file. -*/ - -enum -{ /* - ** The loop mode field in SF_INSTRUMENT will be one of the following. - */ - SF_LOOP_NONE = 800, - SF_LOOP_FORWARD, - SF_LOOP_BACKWARD, - SF_LOOP_ALTERNATING -} ; - -typedef struct -{ int gain ; - char basenote, detune ; - char velocity_lo, velocity_hi ; - char key_lo, key_hi ; - int loop_count ; - - struct - { int mode ; - uint32_t start ; - uint32_t end ; - uint32_t count ; - } loops [16] ; /* make variable in a sensible way */ -} SF_INSTRUMENT ; - - - -/* Struct used to retrieve loop information from a file.*/ -typedef struct -{ - short time_sig_num ; /* any positive integer > 0 */ - short time_sig_den ; /* any positive power of 2 > 0 */ - int loop_mode ; /* see SF_LOOP enum */ - - int num_beats ; /* this is NOT the amount of quarter notes !!!*/ - /* a full bar of 4/4 is 4 beats */ - /* a full bar of 7/8 is 7 beats */ - - float bpm ; /* suggestion, as it can be calculated using other fields:*/ - /* file's length, file's sampleRate and our time_sig_den*/ - /* -> bpms are always the amount of _quarter notes_ per minute */ - - int root_key ; /* MIDI note, or -1 for None */ - int future [6] ; -} SF_LOOP_INFO ; - - -/* Struct used to retrieve broadcast (EBU) information from a file. -** Strongly (!) based on EBU "bext" chunk format used in Broadcast WAVE. -*/ -#define SF_BROADCAST_INFO_VAR(coding_hist_size) \ - struct \ - { char description [256] ; \ - char originator [32] ; \ - char originator_reference [32] ; \ - char origination_date [10] ; \ - char origination_time [8] ; \ - uint32_t time_reference_low ; \ - uint32_t time_reference_high ; \ - short version ; \ - char umid [64] ; \ - char reserved [190] ; \ - uint32_t coding_history_size ; \ - char coding_history [coding_hist_size] ; \ - } - -/* SF_BROADCAST_INFO is the above struct with coding_history field of 256 bytes. */ -typedef SF_BROADCAST_INFO_VAR (256) SF_BROADCAST_INFO ; - -struct SF_CART_TIMER -{ char usage[4] ; - int32_t value ; -} ; - -typedef struct SF_CART_TIMER SF_CART_TIMER ; - -#define SF_CART_INFO_VAR(p_tag_text_size) \ - struct \ - { char version [4] ; \ - char title [64] ; \ - char artist [64] ; \ - char cut_id [64] ; \ - char client_id [64] ; \ - char category [64] ; \ - char classification [64] ; \ - char out_cue [64] ; \ - char start_date [10] ; \ - char start_time [8] ; \ - char end_date [10] ; \ - char end_time [8] ; \ - char producer_app_id [64] ; \ - char producer_app_version [64] ; \ - char user_def [64] ; \ - int32_t level_reference ; \ - SF_CART_TIMER post_timers [8] ; \ - char reserved [276] ; \ - char url [1024] ; \ - uint32_t tag_text_size ; \ - char tag_text[p_tag_text_size] ; \ - } - -typedef SF_CART_INFO_VAR (256) SF_CART_INFO ; - -/* Virtual I/O functionality. */ - -typedef sf_count_t (*sf_vio_get_filelen) (void *user_data) ; -typedef sf_count_t (*sf_vio_seek) (sf_count_t offset, int whence, void *user_data) ; -typedef sf_count_t (*sf_vio_read) (void *ptr, sf_count_t count, void *user_data) ; -typedef sf_count_t (*sf_vio_write) (const void *ptr, sf_count_t count, void *user_data) ; -typedef sf_count_t (*sf_vio_tell) (void *user_data) ; - -struct SF_VIRTUAL_IO -{ sf_vio_get_filelen get_filelen ; - sf_vio_seek seek ; - sf_vio_read read ; - sf_vio_write write ; - sf_vio_tell tell ; -} ; - -typedef struct SF_VIRTUAL_IO SF_VIRTUAL_IO ; - - -/* Open the specified file for read, write or both. On error, this will -** return a NULL pointer. To find the error number, pass a NULL SNDFILE -** to sf_strerror (). -** All calls to sf_open() should be matched with a call to sf_close(). -*/ - -SNDFILE* sf_open (const char *path, int mode, SF_INFO *sfinfo) ; - - -/* Use the existing file descriptor to create a SNDFILE object. If close_desc -** is TRUE, the file descriptor will be closed when sf_close() is called. If -** it is FALSE, the descritor will not be closed. -** When passed a descriptor like this, the library will assume that the start -** of file header is at the current file offset. This allows sound files within -** larger container files to be read and/or written. -** On error, this will return a NULL pointer. To find the error number, pass a -** NULL SNDFILE to sf_strerror (). -** All calls to sf_open_fd() should be matched with a call to sf_close(). - -*/ - -SNDFILE* sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) ; - -SNDFILE* sf_open_virtual (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) ; - - -/* sf_error () returns a error number which can be translated to a text -** string using sf_error_number(). -*/ - -int sf_error (SNDFILE *sndfile) ; - - -/* sf_strerror () returns to the caller a pointer to the current error message for -** the given SNDFILE. -*/ - -const char* sf_strerror (SNDFILE *sndfile) ; - - -/* sf_error_number () allows the retrieval of the error string for each internal -** error number. -** -*/ - -const char* sf_error_number (int errnum) ; - - -/* The following two error functions are deprecated but they will remain in the -** library for the forseeable future. The function sf_strerror() should be used -** in their place. -*/ - -int sf_perror (SNDFILE *sndfile) ; -int sf_error_str (SNDFILE *sndfile, char* str, size_t len) ; - - -/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */ - -int sf_command (SNDFILE *sndfile, int command, void *data, int datasize) ; - - -/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */ - -int sf_format_check (const SF_INFO *info) ; - - -/* Seek within the waveform data chunk of the SNDFILE. sf_seek () uses -** the same values for whence (SEEK_SET, SEEK_CUR and SEEK_END) as -** stdio.h function fseek (). -** An offset of zero with whence set to SEEK_SET will position the -** read / write pointer to the first data sample. -** On success sf_seek returns the current position in (multi-channel) -** samples from the start of the file. -** Please see the libsndfile documentation for moving the read pointer -** separately from the write pointer on files open in mode SFM_RDWR. -** On error all of these functions return -1. -*/ - -sf_count_t sf_seek (SNDFILE *sndfile, sf_count_t frames, int whence) ; - - -/* Functions for retrieving and setting string data within sound files. -** Not all file types support this features; AIFF and WAV do. For both -** functions, the str_type parameter must be one of the SF_STR_* values -** defined above. -** On error, sf_set_string() returns non-zero while sf_get_string() -** returns NULL. -*/ - -int sf_set_string (SNDFILE *sndfile, int str_type, const char* str) ; - -const char* sf_get_string (SNDFILE *sndfile, int str_type) ; - - -/* Return the library version string. */ - -const char * sf_version_string (void) ; - -/* Return the current byterate at this point in the file. The byte rate in this -** case is the number of bytes per second of audio data. For instance, for a -** stereo, 18 bit PCM encoded file with an 16kHz sample rate, the byte rate -** would be 2 (stereo) * 2 (two bytes per sample) * 16000 => 64000 bytes/sec. -** For some file formats the returned value will be accurate and exact, for some -** it will be a close approximation, for some it will be the average bitrate for -** the whole file and for some it will be a time varying value that was accurate -** when the file was most recently read or written. -** To get the bitrate, multiple this value by 8. -** Returns -1 for unknown. -*/ -int sf_current_byterate (SNDFILE *sndfile) ; - -/* Functions for reading/writing the waveform data of a sound file. -*/ - -sf_count_t sf_read_raw (SNDFILE *sndfile, void *ptr, sf_count_t bytes) ; -sf_count_t sf_write_raw (SNDFILE *sndfile, const void *ptr, sf_count_t bytes) ; - - -/* Functions for reading and writing the data chunk in terms of frames. -** The number of items actually read/written = frames * number of channels. -** sf_xxxx_raw read/writes the raw data bytes from/to the file -** sf_xxxx_short passes data in the native short format -** sf_xxxx_int passes data in the native int format -** sf_xxxx_float passes data in the native float format -** sf_xxxx_double passes data in the native double format -** All of these read/write function return number of frames read/written. -*/ - -sf_count_t sf_readf_short (SNDFILE *sndfile, short *ptr, sf_count_t frames) ; -sf_count_t sf_writef_short (SNDFILE *sndfile, const short *ptr, sf_count_t frames) ; - -sf_count_t sf_readf_int (SNDFILE *sndfile, int *ptr, sf_count_t frames) ; -sf_count_t sf_writef_int (SNDFILE *sndfile, const int *ptr, sf_count_t frames) ; - -sf_count_t sf_readf_float (SNDFILE *sndfile, float *ptr, sf_count_t frames) ; -sf_count_t sf_writef_float (SNDFILE *sndfile, const float *ptr, sf_count_t frames) ; - -sf_count_t sf_readf_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) ; -sf_count_t sf_writef_double (SNDFILE *sndfile, const double *ptr, sf_count_t frames) ; - - -/* Functions for reading and writing the data chunk in terms of items. -** Otherwise similar to above. -** All of these read/write function return number of items read/written. -*/ - -sf_count_t sf_read_short (SNDFILE *sndfile, short *ptr, sf_count_t items) ; -sf_count_t sf_write_short (SNDFILE *sndfile, const short *ptr, sf_count_t items) ; - -sf_count_t sf_read_int (SNDFILE *sndfile, int *ptr, sf_count_t items) ; -sf_count_t sf_write_int (SNDFILE *sndfile, const int *ptr, sf_count_t items) ; - -sf_count_t sf_read_float (SNDFILE *sndfile, float *ptr, sf_count_t items) ; -sf_count_t sf_write_float (SNDFILE *sndfile, const float *ptr, sf_count_t items) ; - -sf_count_t sf_read_double (SNDFILE *sndfile, double *ptr, sf_count_t items) ; -sf_count_t sf_write_double (SNDFILE *sndfile, const double *ptr, sf_count_t items) ; - - -/* Close the SNDFILE and clean up all memory allocations associated with this -** file. -** Returns 0 on success, or an error number. -*/ - -int sf_close (SNDFILE *sndfile) ; - - -/* If the file is opened SFM_WRITE or SFM_RDWR, call fsync() on the file -** to force the writing of data to disk. If the file is opened SFM_READ -** no action is taken. -*/ - -void sf_write_sync (SNDFILE *sndfile) ; - - - -/* The function sf_wchar_open() is Windows Only! -** Open a file passing in a Windows Unicode filename. Otherwise, this is -** the same as sf_open(). -** -** In order for this to work, you need to do the following: -** -** #include -** #define ENABLE_SNDFILE_WINDOWS_PROTOTYPES 1 -** #including -*/ - -#if (defined (ENABLE_SNDFILE_WINDOWS_PROTOTYPES) && ENABLE_SNDFILE_WINDOWS_PROTOTYPES) -SNDFILE* sf_wchar_open (LPCWSTR wpath, int mode, SF_INFO *sfinfo) ; -#endif - - - - -/* Getting and setting of chunks from within a sound file. -** -** These functions allow the getting and setting of chunks within a sound file -** (for those formats which allow it). -** -** These functions fail safely. Specifically, they will not allow you to overwrite -** existing chunks or add extra versions of format specific reserved chunks but -** should allow you to retrieve any and all chunks (may not be implemented for -** all chunks or all file formats). -*/ - -struct SF_CHUNK_INFO -{ char id [64] ; /* The chunk identifier. */ - unsigned id_size ; /* The size of the chunk identifier. */ - unsigned datalen ; /* The size of that data. */ - void *data ; /* Pointer to the data. */ -} ; - -typedef struct SF_CHUNK_INFO SF_CHUNK_INFO ; - -/* Set the specified chunk info (must be done before any audio data is written -** to the file). This will fail for format specific reserved chunks. -** The chunk_info->data pointer must be valid until the file is closed. -** Returns SF_ERR_NO_ERROR on success or non-zero on failure. -*/ -int sf_set_chunk (SNDFILE * sndfile, const SF_CHUNK_INFO * chunk_info) ; - -/* -** An opaque structure to an iterator over the all chunks of a given id -*/ -typedef struct SF_CHUNK_ITERATOR SF_CHUNK_ITERATOR ; - -/* Get an iterator for all chunks matching chunk_info. -** The iterator will point to the first chunk matching chunk_info. -** Chunks are matching, if (chunk_info->id) matches the first -** (chunk_info->id_size) bytes of a chunk found in the SNDFILE* handle. -** If chunk_info is NULL, an iterator to all chunks in the SNDFILE* handle -** is returned. -** The values of chunk_info->datalen and chunk_info->data are ignored. -** If no matching chunks are found in the sndfile, NULL is returned. -** The returned iterator will stay valid until one of the following occurs: -** a) The sndfile is closed. -** b) A new chunk is added using sf_set_chunk(). -** c) Another chunk iterator function is called on the same SNDFILE* handle -** that causes the iterator to be modified. -** The memory for the iterator belongs to the SNDFILE* handle and is freed when -** sf_close() is called. -*/ -SF_CHUNK_ITERATOR * -sf_get_chunk_iterator (SNDFILE * sndfile, const SF_CHUNK_INFO * chunk_info) ; - -/* Iterate through chunks by incrementing the iterator. -** Increments the iterator and returns a handle to the new one. -** After this call, iterator will no longer be valid, and you must use the -** newly returned handle from now on. -** The returned handle can be used to access the next chunk matching -** the criteria as defined in sf_get_chunk_iterator(). -** If iterator points to the last chunk, this will free all resources -** associated with iterator and return NULL. -** The returned iterator will stay valid until sf_get_chunk_iterator_next -** is called again, the sndfile is closed or a new chunk us added. -*/ -SF_CHUNK_ITERATOR * -sf_next_chunk_iterator (SF_CHUNK_ITERATOR * iterator) ; - - -/* Get the size of the specified chunk. -** If the specified chunk exists, the size will be returned in the -** datalen field of the SF_CHUNK_INFO struct. -** Additionally, the id of the chunk will be copied to the id -** field of the SF_CHUNK_INFO struct and it's id_size field will -** be updated accordingly. -** If the chunk doesn't exist chunk_info->datalen will be zero, and the -** id and id_size fields will be undefined. -** The function will return SF_ERR_NO_ERROR on success or non-zero on -** failure. -*/ -int -sf_get_chunk_size (const SF_CHUNK_ITERATOR * it, SF_CHUNK_INFO * chunk_info) ; - -/* Get the specified chunk data. -** If the specified chunk exists, up to chunk_info->datalen bytes of -** the chunk data will be copied into the chunk_info->data buffer -** (allocated by the caller) and the chunk_info->datalen field -** updated to reflect the size of the data. The id and id_size -** field will be updated according to the retrieved chunk -** If the chunk doesn't exist chunk_info->datalen will be zero, and the -** id and id_size fields will be undefined. -** The function will return SF_ERR_NO_ERROR on success or non-zero on -** failure. -*/ -int -sf_get_chunk_data (const SF_CHUNK_ITERATOR * it, SF_CHUNK_INFO * chunk_info) ; - - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* SNDFILE_H */ - diff --git a/src/mod/formats/mod_sndfile/mod_sndfile.2015.vcxproj b/src/mod/formats/mod_sndfile/mod_sndfile.2015.vcxproj index e182fd0a60..59415f74ab 100644 --- a/src/mod/formats/mod_sndfile/mod_sndfile.2015.vcxproj +++ b/src/mod/formats/mod_sndfile/mod_sndfile.2015.vcxproj @@ -46,6 +46,7 @@ v140
+ @@ -70,13 +71,11 @@
- %(RootDir)%(Directory)..\..\..\..\libs\win32\libsndfile\;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions) - ..\..\..\..\libs\libsndfile\Win32\$(OutDir);%(AdditionalLibraryDirectories) false @@ -87,13 +86,11 @@ X64 - %(RootDir)%(Directory)..\..\..\..\libs\win32\libsndfile\;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions) - ..\..\..\..\libs\libsndfile\Win32\$(OutDir);%(AdditionalLibraryDirectories) false @@ -102,12 +99,10 @@ - %(RootDir)%(Directory)..\..\..\..\libs\win32\libsndfile\;%(AdditionalIncludeDirectories) - ..\..\..\..\libs\libsndfile\Win32\$(OutDir);%(AdditionalLibraryDirectories) false @@ -118,12 +113,10 @@ X64 - %(RootDir)%(Directory)..\..\..\..\libs\win32\libsndfile\;%(AdditionalIncludeDirectories) - ..\..\..\..\libs\libsndfile\Win32\$(OutDir);%(AdditionalLibraryDirectories) false @@ -138,10 +131,6 @@ {f6c55d93-b927-4483-bb69-15aef3dd2dff} false
- - {3d0370ca-bed2-4657-a475-32375cbcb6e4} - false - {202d7a4e-760d-4d0e-afa1-d7459ced30ff} false diff --git a/w32/libsndfile-version.props b/w32/libsndfile-version.props new file mode 100644 index 0000000000..c30e080fef --- /dev/null +++ b/w32/libsndfile-version.props @@ -0,0 +1,19 @@ + + + + + + + 1.0.28.1.fda9c8d + + + true + + + + + + $(libsndfileVersion) + + + diff --git a/w32/libsndfile.props b/w32/libsndfile.props new file mode 100644 index 0000000000..03dbd5a9bd --- /dev/null +++ b/w32/libsndfile.props @@ -0,0 +1,78 @@ + + + + true + + + + + + + + Debug + Release + + + + $(BaseDir)libs\libsndfile-$(libsndfileVersion) + + + + + + + + + + + + + + + + + + + + + $(SolutionDir)libs\libsndfile-$(libsndfileVersion)\include;%(AdditionalIncludeDirectories) + + + $(SolutionDir)libs\libsndfile-$(libsndfileVersion)\binaries\$(Platform)\$(LibraryConfiguration)\lib;%(AdditionalLibraryDirectories) + libsndfile-1.lib;%(AdditionalDependencies) + + + \ No newline at end of file From 6483ab8b65886465863584e8dcfee57084030b9c Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 6 Apr 2018 14:16:54 +0300 Subject: [PATCH 186/264] FS-11097: [mod_cv] Add OpenCV 3.x support. --- src/mod/applications/mod_cv/mod_cv.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mod/applications/mod_cv/mod_cv.cpp b/src/mod/applications/mod_cv/mod_cv.cpp index b0ba33b974..b1b33ec5ca 100644 --- a/src/mod/applications/mod_cv/mod_cv.cpp +++ b/src/mod/applications/mod_cv/mod_cv.cpp @@ -35,9 +35,6 @@ #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" -using namespace std; -using namespace cv; - #include #include "highgui.h" @@ -48,9 +45,14 @@ using namespace cv; switch_loadable_module_interface_t *MODULE_INTERFACE; +SWITCH_BEGIN_EXTERN_C SWITCH_MODULE_LOAD_FUNCTION(mod_cv_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_cv_shutdown); SWITCH_MODULE_DEFINITION(mod_cv, mod_cv_load, mod_cv_shutdown, NULL); +SWITCH_END_EXTERN_C + +using namespace std; +using namespace cv; static const int NCHANNELS = 3; @@ -559,7 +561,7 @@ static void parse_stats(struct detect_stats *stats, uint32_t size, uint64_t skip void detectAndDraw(cv_context_t *context) { double scale = 1; - Mat img(context->rawImage); + Mat img = cvarrToMat(context->rawImage); switch_mutex_lock(context->mutex); @@ -890,7 +892,7 @@ static switch_status_t video_thread_callback(switch_core_session_t *session, swi int shape_w, shape_h; int cx, cy; - if (!overlay->png || context->overlay[i]->abs == POS_NONE && !context->detect_event && !context->shape[0].cx) { + if (!overlay->png || (context->overlay[i]->abs == POS_NONE && !context->detect_event && !context->shape[0].cx)) { continue; } From 6ccc96a39c4d1d35b1c0be983547dc2ecaf7dfa7 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Fri, 6 Apr 2018 13:54:51 -0400 Subject: [PATCH 187/264] FS-10987: [mod_conference] fix member deadlock on write failure --- src/mod/applications/mod_conference/conference_loop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mod/applications/mod_conference/conference_loop.c b/src/mod/applications/mod_conference/conference_loop.c index 5bfc2738f9..60e5056435 100644 --- a/src/mod/applications/mod_conference/conference_loop.c +++ b/src/mod/applications/mod_conference/conference_loop.c @@ -1534,6 +1534,7 @@ void conference_loop_output(conference_member_t *member) if (switch_core_session_write_frame(member->session, &write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) { switch_mutex_unlock(member->audio_out_mutex); + switch_mutex_unlock(member->write_mutex); break; } } From bb92955e21e189d9bb76f625eaedc7c82d47214e Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Fri, 6 Apr 2018 15:10:02 -0400 Subject: [PATCH 188/264] FS-10997: [libvpx] CVE-2017-13194 --- libs/libvpx/vpx/src/vpx_image.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/libs/libvpx/vpx/src/vpx_image.c b/libs/libvpx/vpx/src/vpx_image.c index dba439c10a..af7c529a7b 100644 --- a/libs/libvpx/vpx/src/vpx_image.c +++ b/libs/libvpx/vpx/src/vpx_image.c @@ -88,11 +88,10 @@ static vpx_image_t *img_alloc_helper(vpx_image_t *img, vpx_img_fmt_t fmt, default: ycs = 0; break; } - /* Calculate storage sizes given the chroma subsampling */ - align = (1 << xcs) - 1; - w = (d_w + align) & ~align; - align = (1 << ycs) - 1; - h = (d_h + align) & ~align; + /* Calculate storage sizes. If the buffer was allocated externally, the width + * and height shouldn't be adjusted. */ + w = d_w; + h = d_h; s = (fmt & VPX_IMG_FMT_PLANAR) ? w : bps * w / 8; s = (s + stride_align - 1) & ~(stride_align - 1); stride_in_bytes = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? s * 2 : s; @@ -111,9 +110,18 @@ static vpx_image_t *img_alloc_helper(vpx_image_t *img, vpx_img_fmt_t fmt, img->img_data = img_data; if (!img_data) { - const uint64_t alloc_size = (fmt & VPX_IMG_FMT_PLANAR) - ? (uint64_t)h * s * bps / 8 - : (uint64_t)h * s; + uint64_t alloc_size; + /* Calculate storage sizes given the chroma subsampling */ + align = (1 << xcs) - 1; + w = (d_w + align) & ~align; + align = (1 << ycs) - 1; + h = (d_h + align) & ~align; + + s = (fmt & VPX_IMG_FMT_PLANAR) ? w : bps * w / 8; + s = (s + stride_align - 1) & ~(stride_align - 1); + stride_in_bytes = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? s * 2 : s; + alloc_size = (fmt & VPX_IMG_FMT_PLANAR) ? (uint64_t)h * s * bps / 8 + : (uint64_t)h * s; if (alloc_size != (size_t)alloc_size) goto fail; From daf02e96f56d70987e2d25cb12a22624d9e03f2d Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Fri, 6 Apr 2018 15:23:35 -0400 Subject: [PATCH 189/264] FS-10998: [libvpx] CVE-2017-0641 --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 2789737efd..907b832916 100644 --- a/Makefile.am +++ b/Makefile.am @@ -573,7 +573,7 @@ libs/libzrtp/libzrtp.a: cd libs/libzrtp && $(MAKE) libs/libvpx/Makefile: - cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --extra-cflags="$(VISIBILITY_FLAG)" + cd libs/libvpx && CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --enable-pic --disable-docs --disable-examples --disable-install-bins --disable-install-srcs --disable-unit-tests --size-limit=16384x16384 --extra-cflags="$(VISIBILITY_FLAG)" libs/libvpx/libvpx.a: libs/libvpx/Makefile @cd libs/libvpx && $(MAKE) From 727df6be1b6f7a6eaaa8e1c1da0e081d96e3026b Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Mon, 9 Apr 2018 12:30:30 -0400 Subject: [PATCH 190/264] FS-11055: [mod_av] resize image to recording image size if it does not match recording size --- src/mod/applications/mod_av/avformat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index 4d9929ea05..7443183891 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -775,10 +775,10 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void * if (!d_w) d_w = img->d_w; if (!d_h) d_h = img->d_h; - //if (d_w && d_h && (d_w != img->d_w || d_h != img->d_h)) { + if (d_w && d_h && (d_w != img->d_w || d_h != img->d_h)) { /* scale to match established stream */ - // switch_img_fit(&img, d_w, d_h, SWITCH_FIT_SIZE); - //} + switch_img_fit(&img, d_w, d_h, SWITCH_FIT_SIZE); + } } else { continue; } From 184fbd6a9fcf497d1c97a8d1c0c97ee5a5767c4e Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Tue, 10 Apr 2018 02:12:07 +0300 Subject: [PATCH 191/264] FS-11101: [mod_cv] Add mod_cv to the Windows build. --- Freeswitch.2015.sln | 15 ++ libs/.gitignore | 2 + .../applications/mod_cv/mod_cv.2015.vcxproj | 131 ++++++++++++++++++ w32/opencv-version.props | 19 +++ w32/opencv.props | 80 +++++++++++ 5 files changed, 247 insertions(+) create mode 100644 src/mod/applications/mod_cv/mod_cv.2015.vcxproj create mode 100644 w32/opencv-version.props create mode 100644 w32/opencv.props diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln index f0529beaca..add8584eac 100644 --- a/Freeswitch.2015.sln +++ b/Freeswitch.2015.sln @@ -638,6 +638,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_odbc_cdr", "src\mod\eve EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr_sqlite", "src\mod\event_handlers\mod_cdr_sqlite\mod_cdr_sqlite.2015.vcxproj", "{2CA661A7-01DD-4532-BF88-B6629DFB544A}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cv", "src\mod\applications\mod_cv\mod_cv.2015.vcxproj", "{40C4E2A2-B49B-496C-96D6-C04B890F7F88}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 @@ -2942,6 +2944,18 @@ Global {2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|Win32.Build.0 = Release|Win32 {2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|x64.ActiveCfg = Release|x64 {2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|x64.Build.0 = Release|x64 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|Win32.ActiveCfg = Release|Win32 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|Win32.Build.0 = Release|Win32 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|x64.ActiveCfg = Release|x64 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|x64.Build.0 = Release|x64 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|Win32.ActiveCfg = Debug|Win32 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|Win32.Build.0 = Debug|Win32 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|x64.ActiveCfg = Debug|x64 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|x64.Build.0 = Debug|x64 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|Win32.ActiveCfg = Release|Win32 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|Win32.Build.0 = Release|Win32 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|x64.ActiveCfg = Release|x64 + {40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3174,5 +3188,6 @@ Global {C955E1A9-C12C-4BAD-AC32-8D53D9268AF7} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} {096C9A84-55B2-4F9B-97E5-0FDF116FD25F} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0} {2CA661A7-01DD-4532-BF88-B6629DFB544A} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0} + {40C4E2A2-B49B-496C-96D6-C04B890F7F88} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78} EndGlobalSection EndGlobal diff --git a/libs/.gitignore b/libs/.gitignore index f66304d9f7..8555f1a4f1 100644 --- a/libs/.gitignore +++ b/libs/.gitignore @@ -856,3 +856,5 @@ pcre-*/ pcre-* libsndfile-*/ libsndfile-* +opencv-*/ +opencv-* diff --git a/src/mod/applications/mod_cv/mod_cv.2015.vcxproj b/src/mod/applications/mod_cv/mod_cv.2015.vcxproj new file mode 100644 index 0000000000..279dba98fa --- /dev/null +++ b/src/mod/applications/mod_cv/mod_cv.2015.vcxproj @@ -0,0 +1,131 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + mod_cv + mod_cv + Win32Proj + {40C4E2A2-B49B-496C-96D6-C04B890F7F88} + + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + DynamicLibrary + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + + + + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + + false + + + + + + + X64 + + + + + + + false + + + MachineX64 + + + + + + + + {202d7a4e-760d-4d0e-afa1-d7459ced30ff} + false + + + + + + \ No newline at end of file diff --git a/w32/opencv-version.props b/w32/opencv-version.props new file mode 100644 index 0000000000..681e44ac01 --- /dev/null +++ b/w32/opencv-version.props @@ -0,0 +1,19 @@ + + + + + + + 3.4.1 + + + true + + + + + + $(opencvVersion) + + + diff --git a/w32/opencv.props b/w32/opencv.props new file mode 100644 index 0000000000..ef415cb763 --- /dev/null +++ b/w32/opencv.props @@ -0,0 +1,80 @@ + + + + true + + + + + + + + Debug + Release + opencv_world341d + opencv_world341 + + + + $(BaseDir)libs\opencv-$(opencvVersion) + + + + + + + + + + + + + + + + + + + + + $(opencvLibDir)\include\;$(opencvLibDir)\include\opencv\;%(AdditionalIncludeDirectories) + + + $(SolutionDir)libs\opencv-$(opencvVersion)\binaries\$(Platform)\$(LibraryConfiguration)\lib;%(AdditionalLibraryDirectories) + $(OpenCVLibraryFileName).lib;%(AdditionalDependencies) + + + \ No newline at end of file From 5b24f62f98ec4ef7eba46dd4e33e234420d8903a Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Fri, 13 Apr 2018 16:12:54 -0500 Subject: [PATCH 192/264] FS-10867: [freeswitch-core] fix regression in stack smash protection --- src/switch_ivr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 462ed56b22..47e4105fb6 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -914,7 +914,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_ if (switch_channel_media_up(channel)) { switch_channel_clear_flag(channel, CF_BLOCK_BROADCAST_UNTIL_MEDIA); } else { - return SWITCH_STATUS_SUCCESS; + goto done; } } @@ -922,6 +922,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_ x++; } + done: switch_core_session_stack_count(session, -1); return SWITCH_STATUS_SUCCESS; From a8354158a31c79403f5144659baeebc1254272c9 Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 2 Apr 2018 17:33:09 -0500 Subject: [PATCH 193/264] FS-11109 #resove tweak bash rc --- support-d/.bashrc | 7 +- support-d/git-completion.bash | 2758 +++++++++++++++++++++++++++++++++ support-d/git-prompt.sh | 531 +++++++ 3 files changed, 3295 insertions(+), 1 deletion(-) create mode 100644 support-d/git-completion.bash create mode 100644 support-d/git-prompt.sh diff --git a/support-d/.bashrc b/support-d/.bashrc index 51e6ca5411..df5d727451 100644 --- a/support-d/.bashrc +++ b/support-d/.bashrc @@ -75,7 +75,7 @@ if [ "${UNAME}" = "Darwin" ]; then alias canary='CHROME_LOG_FILE=chrome.log /Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --args --enable-usermedia-screen-capturing --usermedia-screen-capturing --enable-logging --v=1 --vmodule=*source*/talk/*=5 2>&1 | tee console.log' fi if [ -d "/Applications/Google Chrome.app" ]; then - alias chrome='CHROME_LOG_FILE=chrome.log /Applications/Google\ Chrome.app/Concd outtents/MacOS/Google\ Chrome --args --enable-usermedia-screen-capturing --usermedia-screen-capturing --enable-logging --v=1 --vmodule=*source*/talk/*=5 2>&1 | tee console.log' + alias chrome='CHROME_LOG_FILE=chrome.log /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --enable-usermedia-screen-capturing --usermedia-screen-capturing --enable-logging --v=1 --vmodule=*source*/talk/*=5 2>&1 | tee console.log' fi fi @@ -92,6 +92,11 @@ export LESSCHARSET="latin1" export LESS="-R" export CHARSET="ISO-8859-1" export PS1='\n\[\033[01;31m\]\u@\h\[\033[01;36m\] [\d \@] \[\033[01;33m\] \w\n\[\033[00m\]<\#>:' +if [ -f /usr/src/freeswitch.git/support-d/git-prompt.sh ]; then + . /usr/src/freeswitch.git/support-d/git-prompt.sh + . /usr/src/freeswitch.git/support-d/git-completion.bash + export PS1='\n\[\033[01;31m\]\u@\h\[\033[01;36m\] [\d \@] \[\033[01;33m\] \w$(__git_ps1)\n\[\033[00m\]<\#>:' +fi export PS2="\[\033[1m\]> \[\033[0m\]" if [ -f ~/.viplease ]; then if [ -f /usr/bin/vim ]; then diff --git a/support-d/git-completion.bash b/support-d/git-completion.bash new file mode 100644 index 0000000000..111b05302b --- /dev/null +++ b/support-d/git-completion.bash @@ -0,0 +1,2758 @@ +# bash/zsh completion support for core Git. +# +# Copyright (C) 2006,2007 Shawn O. Pearce +# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). +# Distributed under the GNU General Public License, version 2.0. +# +# The contained completion routines provide support for completing: +# +# *) local and remote branch names +# *) local and remote tag names +# *) .git/remotes file names +# *) git 'subcommands' +# *) git email aliases for git-send-email +# *) tree paths within 'ref:path/to/file' expressions +# *) file paths within current working directory and index +# *) common --long-options +# +# To use these routines: +# +# 1) Copy this file to somewhere (e.g. ~/.git-completion.bash). +# 2) Add the following line to your .bashrc/.zshrc: +# source ~/.git-completion.bash +# 3) Consider changing your PS1 to also show the current branch, +# see git-prompt.sh for details. +# +# If you use complex aliases of form '!f() { ... }; f', you can use the null +# command ':' as the first command in the function body to declare the desired +# completion style. For example '!f() { : git commit ; ... }; f' will +# tell the completion to use commit completion. This also works with aliases +# of form "!sh -c '...'". For example, "!sh -c ': git commit ; ... '". + +case "$COMP_WORDBREAKS" in +*:*) : great ;; +*) COMP_WORDBREAKS="$COMP_WORDBREAKS:" +esac + +# __gitdir accepts 0 or 1 arguments (i.e., location) +# returns location of .git repo +__gitdir () +{ + if [ -z "${1-}" ]; then + if [ -n "${__git_dir-}" ]; then + echo "$__git_dir" + elif [ -n "${GIT_DIR-}" ]; then + test -d "${GIT_DIR-}" || return 1 + echo "$GIT_DIR" + elif [ -d .git ]; then + echo .git + else + git rev-parse --git-dir 2>/dev/null + fi + elif [ -d "$1/.git" ]; then + echo "$1/.git" + else + echo "$1" + fi +} + +# The following function is based on code from: +# +# bash_completion - programmable completion functions for bash 3.2+ +# +# Copyright © 2006-2008, Ian Macdonald +# © 2009-2010, Bash Completion Maintainers +# +# +# 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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# The latest version of this software can be obtained here: +# +# http://bash-completion.alioth.debian.org/ +# +# RELEASE: 2.x + +# This function can be used to access a tokenized list of words +# on the command line: +# +# __git_reassemble_comp_words_by_ref '=:' +# if test "${words_[cword_-1]}" = -w +# then +# ... +# fi +# +# The argument should be a collection of characters from the list of +# word completion separators (COMP_WORDBREAKS) to treat as ordinary +# characters. +# +# This is roughly equivalent to going back in time and setting +# COMP_WORDBREAKS to exclude those characters. The intent is to +# make option types like --date= and : easy to +# recognize by treating each shell word as a single token. +# +# It is best not to set COMP_WORDBREAKS directly because the value is +# shared with other completion scripts. By the time the completion +# function gets called, COMP_WORDS has already been populated so local +# changes to COMP_WORDBREAKS have no effect. +# +# Output: words_, cword_, cur_. + +__git_reassemble_comp_words_by_ref() +{ + local exclude i j first + # Which word separators to exclude? + exclude="${1//[^$COMP_WORDBREAKS]}" + cword_=$COMP_CWORD + if [ -z "$exclude" ]; then + words_=("${COMP_WORDS[@]}") + return + fi + # List of word completion separators has shrunk; + # re-assemble words to complete. + for ((i=0, j=0; i < ${#COMP_WORDS[@]}; i++, j++)); do + # Append each nonempty word consisting of just + # word separator characters to the current word. + first=t + while + [ $i -gt 0 ] && + [ -n "${COMP_WORDS[$i]}" ] && + # word consists of excluded word separators + [ "${COMP_WORDS[$i]//[^$exclude]}" = "${COMP_WORDS[$i]}" ] + do + # Attach to the previous token, + # unless the previous token is the command name. + if [ $j -ge 2 ] && [ -n "$first" ]; then + ((j--)) + fi + first= + words_[$j]=${words_[j]}${COMP_WORDS[i]} + if [ $i = $COMP_CWORD ]; then + cword_=$j + fi + if (($i < ${#COMP_WORDS[@]} - 1)); then + ((i++)) + else + # Done. + return + fi + done + words_[$j]=${words_[j]}${COMP_WORDS[i]} + if [ $i = $COMP_CWORD ]; then + cword_=$j + fi + done +} + +if ! type _get_comp_words_by_ref >/dev/null 2>&1; then +_get_comp_words_by_ref () +{ + local exclude cur_ words_ cword_ + if [ "$1" = "-n" ]; then + exclude=$2 + shift 2 + fi + __git_reassemble_comp_words_by_ref "$exclude" + cur_=${words_[cword_]} + while [ $# -gt 0 ]; do + case "$1" in + cur) + cur=$cur_ + ;; + prev) + prev=${words_[$cword_-1]} + ;; + words) + words=("${words_[@]}") + ;; + cword) + cword=$cword_ + ;; + esac + shift + done +} +fi + +__gitcompappend () +{ + local x i=${#COMPREPLY[@]} + for x in $1; do + if [[ "$x" == "$3"* ]]; then + COMPREPLY[i++]="$2$x$4" + fi + done +} + +__gitcompadd () +{ + COMPREPLY=() + __gitcompappend "$@" +} + +# Generates completion reply, appending a space to possible completion words, +# if necessary. +# It accepts 1 to 4 arguments: +# 1: List of possible completion words. +# 2: A prefix to be added to each possible completion word (optional). +# 3: Generate possible completion matches for this word (optional). +# 4: A suffix to be appended to each possible completion word (optional). +__gitcomp () +{ + local cur_="${3-$cur}" + + case "$cur_" in + --*=) + ;; + *) + local c i=0 IFS=$' \t\n' + for c in $1; do + c="$c${4-}" + if [[ $c == "$cur_"* ]]; then + case $c in + --*=*|*.) ;; + *) c="$c " ;; + esac + COMPREPLY[i++]="${2-}$c" + fi + done + ;; + esac +} + +# Variation of __gitcomp_nl () that appends to the existing list of +# completion candidates, COMPREPLY. +__gitcomp_nl_append () +{ + local IFS=$'\n' + __gitcompappend "$1" "${2-}" "${3-$cur}" "${4- }" +} + +# Generates completion reply from newline-separated possible completion words +# by appending a space to all of them. +# It accepts 1 to 4 arguments: +# 1: List of possible completion words, separated by a single newline. +# 2: A prefix to be added to each possible completion word (optional). +# 3: Generate possible completion matches for this word (optional). +# 4: A suffix to be appended to each possible completion word instead of +# the default space (optional). If specified but empty, nothing is +# appended. +__gitcomp_nl () +{ + COMPREPLY=() + __gitcomp_nl_append "$@" +} + +# Generates completion reply with compgen from newline-separated possible +# completion filenames. +# It accepts 1 to 3 arguments: +# 1: List of possible completion filenames, separated by a single newline. +# 2: A directory prefix to be added to each possible completion filename +# (optional). +# 3: Generate possible completion matches for this word (optional). +__gitcomp_file () +{ + local IFS=$'\n' + + # XXX does not work when the directory prefix contains a tilde, + # since tilde expansion is not applied. + # This means that COMPREPLY will be empty and Bash default + # completion will be used. + __gitcompadd "$1" "${2-}" "${3-$cur}" "" + + # use a hack to enable file mode in bash < 4 + compopt -o filenames +o nospace 2>/dev/null || + compgen -f /non-existing-dir/ > /dev/null +} + +# Execute 'git ls-files', unless the --committable option is specified, in +# which case it runs 'git diff-index' to find out the files that can be +# committed. It return paths relative to the directory specified in the first +# argument, and using the options specified in the second argument. +__git_ls_files_helper () +{ + if [ "$2" == "--committable" ]; then + git -C "$1" diff-index --name-only --relative HEAD + else + # NOTE: $2 is not quoted in order to support multiple options + git -C "$1" ls-files --exclude-standard $2 + fi 2>/dev/null +} + + +# __git_index_files accepts 1 or 2 arguments: +# 1: Options to pass to ls-files (required). +# 2: A directory path (optional). +# If provided, only files within the specified directory are listed. +# Sub directories are never recursed. Path must have a trailing +# slash. +__git_index_files () +{ + local dir="$(__gitdir)" root="${2-.}" file + + if [ -d "$dir" ]; then + __git_ls_files_helper "$root" "$1" | + while read -r file; do + case "$file" in + ?*/*) echo "${file%%/*}" ;; + *) echo "$file" ;; + esac + done | sort | uniq + fi +} + +__git_heads () +{ + local dir="$(__gitdir)" + if [ -d "$dir" ]; then + git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ + refs/heads + return + fi +} + +__git_tags () +{ + local dir="$(__gitdir)" + if [ -d "$dir" ]; then + git --git-dir="$dir" for-each-ref --format='%(refname:short)' \ + refs/tags + return + fi +} + +# __git_refs accepts 0, 1 (to pass to __gitdir), or 2 arguments +# presence of 2nd argument means use the guess heuristic employed +# by checkout for tracking branches +__git_refs () +{ + local i hash dir="$(__gitdir "${1-}")" track="${2-}" + local format refs + if [ -d "$dir" ]; then + case "$cur" in + refs|refs/*) + format="refname" + refs="${cur%/*}" + track="" + ;; + *) + for i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do + if [ -e "$dir/$i" ]; then echo $i; fi + done + format="refname:short" + refs="refs/tags refs/heads refs/remotes" + ;; + esac + git --git-dir="$dir" for-each-ref --format="%($format)" \ + $refs + if [ -n "$track" ]; then + # employ the heuristic used by git checkout + # Try to find a remote branch that matches the completion word + # but only output if the branch name is unique + local ref entry + git --git-dir="$dir" for-each-ref --shell --format="ref=%(refname:short)" \ + "refs/remotes/" | \ + while read -r entry; do + eval "$entry" + ref="${ref#*/}" + if [[ "$ref" == "$cur"* ]]; then + echo "$ref" + fi + done | sort | uniq -u + fi + return + fi + case "$cur" in + refs|refs/*) + git ls-remote "$dir" "$cur*" 2>/dev/null | \ + while read -r hash i; do + case "$i" in + *^{}) ;; + *) echo "$i" ;; + esac + done + ;; + *) + echo "HEAD" + git for-each-ref --format="%(refname:short)" -- \ + "refs/remotes/$dir/" 2>/dev/null | sed -e "s#^$dir/##" + ;; + esac +} + +# __git_refs2 requires 1 argument (to pass to __git_refs) +__git_refs2 () +{ + local i + for i in $(__git_refs "$1"); do + echo "$i:$i" + done +} + +# __git_refs_remotes requires 1 argument (to pass to ls-remote) +__git_refs_remotes () +{ + local i hash + git ls-remote "$1" 'refs/heads/*' 2>/dev/null | \ + while read -r hash i; do + echo "$i:refs/remotes/$1/${i#refs/heads/}" + done +} + +__git_remotes () +{ + local d="$(__gitdir)" + test -d "$d/remotes" && ls -1 "$d/remotes" + git --git-dir="$d" remote +} + +__git_list_merge_strategies () +{ + git merge -s help 2>&1 | + sed -n -e '/[Aa]vailable strategies are: /,/^$/{ + s/\.$// + s/.*:// + s/^[ ]*// + s/[ ]*$// + p + }' +} + +__git_merge_strategies= +# 'git merge -s help' (and thus detection of the merge strategy +# list) fails, unfortunately, if run outside of any git working +# tree. __git_merge_strategies is set to the empty string in +# that case, and the detection will be repeated the next time it +# is needed. +__git_compute_merge_strategies () +{ + test -n "$__git_merge_strategies" || + __git_merge_strategies=$(__git_list_merge_strategies) +} + +__git_complete_revlist_file () +{ + local pfx ls ref cur_="$cur" + case "$cur_" in + *..?*:*) + return + ;; + ?*:*) + ref="${cur_%%:*}" + cur_="${cur_#*:}" + case "$cur_" in + ?*/*) + pfx="${cur_%/*}" + cur_="${cur_##*/}" + ls="$ref:$pfx" + pfx="$pfx/" + ;; + *) + ls="$ref" + ;; + esac + + case "$COMP_WORDBREAKS" in + *:*) : great ;; + *) pfx="$ref:$pfx" ;; + esac + + __gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" 2>/dev/null \ + | sed '/^100... blob /{ + s,^.* ,, + s,$, , + } + /^120000 blob /{ + s,^.* ,, + s,$, , + } + /^040000 tree /{ + s,^.* ,, + s,$,/, + } + s/^.* //')" \ + "$pfx" "$cur_" "" + ;; + *...*) + pfx="${cur_%...*}..." + cur_="${cur_#*...}" + __gitcomp_nl "$(__git_refs)" "$pfx" "$cur_" + ;; + *..*) + pfx="${cur_%..*}.." + cur_="${cur_#*..}" + __gitcomp_nl "$(__git_refs)" "$pfx" "$cur_" + ;; + *) + __gitcomp_nl "$(__git_refs)" + ;; + esac +} + + +# __git_complete_index_file requires 1 argument: +# 1: the options to pass to ls-file +# +# The exception is --committable, which finds the files appropriate commit. +__git_complete_index_file () +{ + local pfx="" cur_="$cur" + + case "$cur_" in + ?*/*) + pfx="${cur_%/*}" + cur_="${cur_##*/}" + pfx="${pfx}/" + ;; + esac + + __gitcomp_file "$(__git_index_files "$1" ${pfx:+"$pfx"})" "$pfx" "$cur_" +} + +__git_complete_file () +{ + __git_complete_revlist_file +} + +__git_complete_revlist () +{ + __git_complete_revlist_file +} + +__git_complete_remote_or_refspec () +{ + local cur_="$cur" cmd="${words[1]}" + local i c=2 remote="" pfx="" lhs=1 no_complete_refspec=0 + if [ "$cmd" = "remote" ]; then + ((c++)) + fi + while [ $c -lt $cword ]; do + i="${words[c]}" + case "$i" in + --mirror) [ "$cmd" = "push" ] && no_complete_refspec=1 ;; + --all) + case "$cmd" in + push) no_complete_refspec=1 ;; + fetch) + return + ;; + *) ;; + esac + ;; + -*) ;; + *) remote="$i"; break ;; + esac + ((c++)) + done + if [ -z "$remote" ]; then + __gitcomp_nl "$(__git_remotes)" + return + fi + if [ $no_complete_refspec = 1 ]; then + return + fi + [ "$remote" = "." ] && remote= + case "$cur_" in + *:*) + case "$COMP_WORDBREAKS" in + *:*) : great ;; + *) pfx="${cur_%%:*}:" ;; + esac + cur_="${cur_#*:}" + lhs=0 + ;; + +*) + pfx="+" + cur_="${cur_#+}" + ;; + esac + case "$cmd" in + fetch) + if [ $lhs = 1 ]; then + __gitcomp_nl "$(__git_refs2 "$remote")" "$pfx" "$cur_" + else + __gitcomp_nl "$(__git_refs)" "$pfx" "$cur_" + fi + ;; + pull|remote) + if [ $lhs = 1 ]; then + __gitcomp_nl "$(__git_refs "$remote")" "$pfx" "$cur_" + else + __gitcomp_nl "$(__git_refs)" "$pfx" "$cur_" + fi + ;; + push) + if [ $lhs = 1 ]; then + __gitcomp_nl "$(__git_refs)" "$pfx" "$cur_" + else + __gitcomp_nl "$(__git_refs "$remote")" "$pfx" "$cur_" + fi + ;; + esac +} + +__git_complete_strategy () +{ + __git_compute_merge_strategies + case "$prev" in + -s|--strategy) + __gitcomp "$__git_merge_strategies" + return 0 + esac + case "$cur" in + --strategy=*) + __gitcomp "$__git_merge_strategies" "" "${cur##--strategy=}" + return 0 + ;; + esac + return 1 +} + +__git_commands () { + if test -n "${GIT_TESTING_COMMAND_COMPLETION:-}" + then + printf "%s" "${GIT_TESTING_COMMAND_COMPLETION}" + else + git help -a|egrep '^ [a-zA-Z0-9]' + fi +} + +__git_list_all_commands () +{ + local i IFS=" "$'\n' + for i in $(__git_commands) + do + case $i in + *--*) : helper pattern;; + *) echo $i;; + esac + done +} + +__git_all_commands= +__git_compute_all_commands () +{ + test -n "$__git_all_commands" || + __git_all_commands=$(__git_list_all_commands) +} + +__git_list_porcelain_commands () +{ + local i IFS=" "$'\n' + __git_compute_all_commands + for i in $__git_all_commands + do + case $i in + *--*) : helper pattern;; + applymbox) : ask gittus;; + applypatch) : ask gittus;; + archimport) : import;; + cat-file) : plumbing;; + check-attr) : plumbing;; + check-ignore) : plumbing;; + check-mailmap) : plumbing;; + check-ref-format) : plumbing;; + checkout-index) : plumbing;; + commit-tree) : plumbing;; + count-objects) : infrequent;; + credential) : credentials;; + credential-*) : credentials helper;; + cvsexportcommit) : export;; + cvsimport) : import;; + cvsserver) : daemon;; + daemon) : daemon;; + diff-files) : plumbing;; + diff-index) : plumbing;; + diff-tree) : plumbing;; + fast-import) : import;; + fast-export) : export;; + fsck-objects) : plumbing;; + fetch-pack) : plumbing;; + fmt-merge-msg) : plumbing;; + for-each-ref) : plumbing;; + hash-object) : plumbing;; + http-*) : transport;; + index-pack) : plumbing;; + init-db) : deprecated;; + local-fetch) : plumbing;; + ls-files) : plumbing;; + ls-remote) : plumbing;; + ls-tree) : plumbing;; + mailinfo) : plumbing;; + mailsplit) : plumbing;; + merge-*) : plumbing;; + mktree) : plumbing;; + mktag) : plumbing;; + pack-objects) : plumbing;; + pack-redundant) : plumbing;; + pack-refs) : plumbing;; + parse-remote) : plumbing;; + patch-id) : plumbing;; + prune) : plumbing;; + prune-packed) : plumbing;; + quiltimport) : import;; + read-tree) : plumbing;; + receive-pack) : plumbing;; + remote-*) : transport;; + rerere) : plumbing;; + rev-list) : plumbing;; + rev-parse) : plumbing;; + runstatus) : plumbing;; + sh-setup) : internal;; + shell) : daemon;; + show-ref) : plumbing;; + send-pack) : plumbing;; + show-index) : plumbing;; + ssh-*) : transport;; + stripspace) : plumbing;; + symbolic-ref) : plumbing;; + unpack-file) : plumbing;; + unpack-objects) : plumbing;; + update-index) : plumbing;; + update-ref) : plumbing;; + update-server-info) : daemon;; + upload-archive) : plumbing;; + upload-pack) : plumbing;; + write-tree) : plumbing;; + var) : infrequent;; + verify-pack) : infrequent;; + verify-tag) : plumbing;; + *) echo $i;; + esac + done +} + +__git_porcelain_commands= +__git_compute_porcelain_commands () +{ + test -n "$__git_porcelain_commands" || + __git_porcelain_commands=$(__git_list_porcelain_commands) +} + +# Lists all set config variables starting with the given section prefix, +# with the prefix removed. +__git_get_config_variables () +{ + local section="$1" i IFS=$'\n' + for i in $(git --git-dir="$(__gitdir)" config --name-only --get-regexp "^$section\..*" 2>/dev/null); do + echo "${i#$section.}" + done +} + +__git_pretty_aliases () +{ + __git_get_config_variables "pretty" +} + +__git_aliases () +{ + __git_get_config_variables "alias" +} + +# __git_aliased_command requires 1 argument +__git_aliased_command () +{ + local word cmdline=$(git --git-dir="$(__gitdir)" \ + config --get "alias.$1") + for word in $cmdline; do + case "$word" in + \!gitk|gitk) + echo "gitk" + return + ;; + \!*) : shell command alias ;; + -*) : option ;; + *=*) : setting env ;; + git) : git itself ;; + \(\)) : skip parens of shell function definition ;; + {) : skip start of shell helper function ;; + :) : skip null command ;; + \'*) : skip opening quote after sh -c ;; + *) + echo "$word" + return + esac + done +} + +# __git_find_on_cmdline requires 1 argument +__git_find_on_cmdline () +{ + local word subcommand c=1 + while [ $c -lt $cword ]; do + word="${words[c]}" + for subcommand in $1; do + if [ "$subcommand" = "$word" ]; then + echo "$subcommand" + return + fi + done + ((c++)) + done +} + +__git_has_doubledash () +{ + local c=1 + while [ $c -lt $cword ]; do + if [ "--" = "${words[c]}" ]; then + return 0 + fi + ((c++)) + done + return 1 +} + +# Try to count non option arguments passed on the command line for the +# specified git command. +# When options are used, it is necessary to use the special -- option to +# tell the implementation were non option arguments begin. +# XXX this can not be improved, since options can appear everywhere, as +# an example: +# git mv x -n y +# +# __git_count_arguments requires 1 argument: the git command executed. +__git_count_arguments () +{ + local word i c=0 + + # Skip "git" (first argument) + for ((i=1; i < ${#words[@]}; i++)); do + word="${words[i]}" + + case "$word" in + --) + # Good; we can assume that the following are only non + # option arguments. + ((c = 0)) + ;; + "$1") + # Skip the specified git command and discard git + # main options + ((c = 0)) + ;; + ?*) + ((c++)) + ;; + esac + done + + printf "%d" $c +} + +__git_whitespacelist="nowarn warn error error-all fix" + +_git_am () +{ + local dir="$(__gitdir)" + if [ -d "$dir"/rebase-apply ]; then + __gitcomp "--skip --continue --resolved --abort" + return + fi + case "$cur" in + --whitespace=*) + __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" + return + ;; + --*) + __gitcomp " + --3way --committer-date-is-author-date --ignore-date + --ignore-whitespace --ignore-space-change + --interactive --keep --no-utf8 --signoff --utf8 + --whitespace= --scissors + " + return + esac +} + +_git_apply () +{ + case "$cur" in + --whitespace=*) + __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" + return + ;; + --*) + __gitcomp " + --stat --numstat --summary --check --index + --cached --index-info --reverse --reject --unidiff-zero + --apply --no-add --exclude= + --ignore-whitespace --ignore-space-change + --whitespace= --inaccurate-eof --verbose + " + return + esac +} + +_git_add () +{ + case "$cur" in + --*) + __gitcomp " + --interactive --refresh --patch --update --dry-run + --ignore-errors --intent-to-add + " + return + esac + + # XXX should we check for --update and --all options ? + __git_complete_index_file "--others --modified --directory --no-empty-directory" +} + +_git_archive () +{ + case "$cur" in + --format=*) + __gitcomp "$(git archive --list)" "" "${cur##--format=}" + return + ;; + --remote=*) + __gitcomp_nl "$(__git_remotes)" "" "${cur##--remote=}" + return + ;; + --*) + __gitcomp " + --format= --list --verbose + --prefix= --remote= --exec= + " + return + ;; + esac + __git_complete_file +} + +_git_bisect () +{ + __git_has_doubledash && return + + local subcommands="start bad good skip reset visualize replay log run" + local subcommand="$(__git_find_on_cmdline "$subcommands")" + if [ -z "$subcommand" ]; then + if [ -f "$(__gitdir)"/BISECT_START ]; then + __gitcomp "$subcommands" + else + __gitcomp "replay start" + fi + return + fi + + case "$subcommand" in + bad|good|reset|skip|start) + __gitcomp_nl "$(__git_refs)" + ;; + *) + ;; + esac +} + +_git_branch () +{ + local i c=1 only_local_ref="n" has_r="n" + + while [ $c -lt $cword ]; do + i="${words[c]}" + case "$i" in + -d|-m) only_local_ref="y" ;; + -r) has_r="y" ;; + esac + ((c++)) + done + + case "$cur" in + --set-upstream-to=*) + __gitcomp_nl "$(__git_refs)" "" "${cur##--set-upstream-to=}" + ;; + --*) + __gitcomp " + --color --no-color --verbose --abbrev= --no-abbrev + --track --no-track --contains --merged --no-merged + --set-upstream-to= --edit-description --list + --unset-upstream + " + ;; + *) + if [ $only_local_ref = "y" -a $has_r = "n" ]; then + __gitcomp_nl "$(__git_heads)" + else + __gitcomp_nl "$(__git_refs)" + fi + ;; + esac +} + +_git_bundle () +{ + local cmd="${words[2]}" + case "$cword" in + 2) + __gitcomp "create list-heads verify unbundle" + ;; + 3) + # looking for a file + ;; + *) + case "$cmd" in + create) + __git_complete_revlist + ;; + esac + ;; + esac +} + +_git_checkout () +{ + __git_has_doubledash && return + + case "$cur" in + --conflict=*) + __gitcomp "diff3 merge" "" "${cur##--conflict=}" + ;; + --*) + __gitcomp " + --quiet --ours --theirs --track --no-track --merge + --conflict= --orphan --patch + " + ;; + *) + # check if --track, --no-track, or --no-guess was specified + # if so, disable DWIM mode + local flags="--track --no-track --no-guess" track=1 + if [ -n "$(__git_find_on_cmdline "$flags")" ]; then + track='' + fi + __gitcomp_nl "$(__git_refs '' $track)" + ;; + esac +} + +_git_cherry () +{ + __gitcomp_nl "$(__git_refs)" +} + +_git_cherry_pick () +{ + local dir="$(__gitdir)" + if [ -f "$dir"/CHERRY_PICK_HEAD ]; then + __gitcomp "--continue --quit --abort" + return + fi + case "$cur" in + --*) + __gitcomp "--edit --no-commit --signoff --strategy= --mainline" + ;; + *) + __gitcomp_nl "$(__git_refs)" + ;; + esac +} + +_git_clean () +{ + case "$cur" in + --*) + __gitcomp "--dry-run --quiet" + return + ;; + esac + + # XXX should we check for -x option ? + __git_complete_index_file "--others --directory" +} + +_git_clone () +{ + case "$cur" in + --*) + __gitcomp " + --local + --no-hardlinks + --shared + --reference + --quiet + --no-checkout + --bare + --mirror + --origin + --upload-pack + --template= + --depth + --single-branch + --branch + " + return + ;; + esac +} + +_git_commit () +{ + case "$prev" in + -c|-C) + __gitcomp_nl "$(__git_refs)" "" "${cur}" + return + ;; + esac + + case "$cur" in + --cleanup=*) + __gitcomp "default scissors strip verbatim whitespace + " "" "${cur##--cleanup=}" + return + ;; + --reuse-message=*|--reedit-message=*|\ + --fixup=*|--squash=*) + __gitcomp_nl "$(__git_refs)" "" "${cur#*=}" + return + ;; + --untracked-files=*) + __gitcomp "all no normal" "" "${cur##--untracked-files=}" + return + ;; + --*) + __gitcomp " + --all --author= --signoff --verify --no-verify + --edit --no-edit + --amend --include --only --interactive + --dry-run --reuse-message= --reedit-message= + --reset-author --file= --message= --template= + --cleanup= --untracked-files --untracked-files= + --verbose --quiet --fixup= --squash= + " + return + esac + + if git rev-parse --verify --quiet HEAD >/dev/null; then + __git_complete_index_file "--committable" + else + # This is the first commit + __git_complete_index_file "--cached" + fi +} + +_git_describe () +{ + case "$cur" in + --*) + __gitcomp " + --all --tags --contains --abbrev= --candidates= + --exact-match --debug --long --match --always + " + return + esac + __gitcomp_nl "$(__git_refs)" +} + +__git_diff_algorithms="myers minimal patience histogram" + +__git_diff_common_options="--stat --numstat --shortstat --summary + --patch-with-stat --name-only --name-status --color + --no-color --color-words --no-renames --check + --full-index --binary --abbrev --diff-filter= + --find-copies-harder + --text --ignore-space-at-eol --ignore-space-change + --ignore-all-space --ignore-blank-lines --exit-code + --quiet --ext-diff --no-ext-diff + --no-prefix --src-prefix= --dst-prefix= + --inter-hunk-context= + --patience --histogram --minimal + --raw --word-diff + --dirstat --dirstat= --dirstat-by-file + --dirstat-by-file= --cumulative + --diff-algorithm= +" + +_git_diff () +{ + __git_has_doubledash && return + + case "$cur" in + --diff-algorithm=*) + __gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}" + return + ;; + --*) + __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex + --base --ours --theirs --no-index + $__git_diff_common_options + " + return + ;; + esac + __git_complete_revlist_file +} + +__git_mergetools_common="diffuse diffmerge ecmerge emerge kdiff3 meld opendiff + tkdiff vimdiff gvimdiff xxdiff araxis p4merge bc codecompare +" + +_git_difftool () +{ + __git_has_doubledash && return + + case "$cur" in + --tool=*) + __gitcomp "$__git_mergetools_common kompare" "" "${cur##--tool=}" + return + ;; + --*) + __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex + --base --ours --theirs + --no-renames --diff-filter= --find-copies-harder + --relative --ignore-submodules + --tool=" + return + ;; + esac + __git_complete_revlist_file +} + +__git_fetch_recurse_submodules="yes on-demand no" + +__git_fetch_options=" + --quiet --verbose --append --upload-pack --force --keep --depth= + --tags --no-tags --all --prune --dry-run --recurse-submodules= +" + +_git_fetch () +{ + case "$cur" in + --recurse-submodules=*) + __gitcomp "$__git_fetch_recurse_submodules" "" "${cur##--recurse-submodules=}" + return + ;; + --*) + __gitcomp "$__git_fetch_options" + return + ;; + esac + __git_complete_remote_or_refspec +} + +__git_format_patch_options=" + --stdout --attach --no-attach --thread --thread= --no-thread + --numbered --start-number --numbered-files --keep-subject --signoff + --signature --no-signature --in-reply-to= --cc= --full-index --binary + --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix= + --inline --suffix= --ignore-if-in-upstream --subject-prefix= + --output-directory --reroll-count --to= --quiet --notes +" + +_git_format_patch () +{ + case "$cur" in + --thread=*) + __gitcomp " + deep shallow + " "" "${cur##--thread=}" + return + ;; + --*) + __gitcomp "$__git_format_patch_options" + return + ;; + esac + __git_complete_revlist +} + +_git_fsck () +{ + case "$cur" in + --*) + __gitcomp " + --tags --root --unreachable --cache --no-reflogs --full + --strict --verbose --lost-found + " + return + ;; + esac +} + +_git_gc () +{ + case "$cur" in + --*) + __gitcomp "--prune --aggressive" + return + ;; + esac +} + +_git_gitk () +{ + _gitk +} + +__git_match_ctag() { + awk "/^${1//\//\\/}/ { print \$1 }" "$2" +} + +_git_grep () +{ + __git_has_doubledash && return + + case "$cur" in + --*) + __gitcomp " + --cached + --text --ignore-case --word-regexp --invert-match + --full-name --line-number + --extended-regexp --basic-regexp --fixed-strings + --perl-regexp + --files-with-matches --name-only + --files-without-match + --max-depth + --count + --and --or --not --all-match + " + return + ;; + esac + + case "$cword,$prev" in + 2,*|*,-*) + if test -r tags; then + __gitcomp_nl "$(__git_match_ctag "$cur" tags)" + return + fi + ;; + esac + + __gitcomp_nl "$(__git_refs)" +} + +_git_help () +{ + case "$cur" in + --*) + __gitcomp "--all --info --man --web" + return + ;; + esac + __git_compute_all_commands + __gitcomp "$__git_all_commands $(__git_aliases) + attributes cli core-tutorial cvs-migration + diffcore gitk glossary hooks ignore modules + namespaces repository-layout tutorial tutorial-2 + workflows + " +} + +_git_init () +{ + case "$cur" in + --shared=*) + __gitcomp " + false true umask group all world everybody + " "" "${cur##--shared=}" + return + ;; + --*) + __gitcomp "--quiet --bare --template= --shared --shared=" + return + ;; + esac +} + +_git_ls_files () +{ + case "$cur" in + --*) + __gitcomp "--cached --deleted --modified --others --ignored + --stage --directory --no-empty-directory --unmerged + --killed --exclude= --exclude-from= + --exclude-per-directory= --exclude-standard + --error-unmatch --with-tree= --full-name + --abbrev --ignored --exclude-per-directory + " + return + ;; + esac + + # XXX ignore options like --modified and always suggest all cached + # files. + __git_complete_index_file "--cached" +} + +_git_ls_remote () +{ + __gitcomp_nl "$(__git_remotes)" +} + +_git_ls_tree () +{ + __git_complete_file +} + +# Options that go well for log, shortlog and gitk +__git_log_common_options=" + --not --all + --branches --tags --remotes + --first-parent --merges --no-merges + --max-count= + --max-age= --since= --after= + --min-age= --until= --before= + --min-parents= --max-parents= + --no-min-parents --no-max-parents +" +# Options that go well for log and gitk (not shortlog) +__git_log_gitk_options=" + --dense --sparse --full-history + --simplify-merges --simplify-by-decoration + --left-right --notes --no-notes +" +# Options that go well for log and shortlog (not gitk) +__git_log_shortlog_options=" + --author= --committer= --grep= + --all-match --invert-grep +" + +__git_log_pretty_formats="oneline short medium full fuller email raw format:" +__git_log_date_formats="relative iso8601 rfc2822 short local default raw" + +_git_log () +{ + __git_has_doubledash && return + + local g="$(git rev-parse --git-dir 2>/dev/null)" + local merge="" + if [ -f "$g/MERGE_HEAD" ]; then + merge="--merge" + fi + case "$cur" in + --pretty=*|--format=*) + __gitcomp "$__git_log_pretty_formats $(__git_pretty_aliases) + " "" "${cur#*=}" + return + ;; + --date=*) + __gitcomp "$__git_log_date_formats" "" "${cur##--date=}" + return + ;; + --decorate=*) + __gitcomp "full short no" "" "${cur##--decorate=}" + return + ;; + --*) + __gitcomp " + $__git_log_common_options + $__git_log_shortlog_options + $__git_log_gitk_options + --root --topo-order --date-order --reverse + --follow --full-diff + --abbrev-commit --abbrev= + --relative-date --date= + --pretty= --format= --oneline + --show-signature + --cherry-pick + --graph + --decorate --decorate= + --walk-reflogs + --parents --children + $merge + $__git_diff_common_options + --pickaxe-all --pickaxe-regex + " + return + ;; + esac + __git_complete_revlist +} + +# Common merge options shared by git-merge(1) and git-pull(1). +__git_merge_options=" + --no-commit --no-stat --log --no-log --squash --strategy + --commit --stat --no-squash --ff --no-ff --ff-only --edit --no-edit + --verify-signatures --no-verify-signatures --gpg-sign + --quiet --verbose --progress --no-progress +" + +_git_merge () +{ + __git_complete_strategy && return + + case "$cur" in + --*) + __gitcomp "$__git_merge_options + --rerere-autoupdate --no-rerere-autoupdate --abort" + return + esac + __gitcomp_nl "$(__git_refs)" +} + +_git_mergetool () +{ + case "$cur" in + --tool=*) + __gitcomp "$__git_mergetools_common tortoisemerge" "" "${cur##--tool=}" + return + ;; + --*) + __gitcomp "--tool=" + return + ;; + esac +} + +_git_merge_base () +{ + case "$cur" in + --*) + __gitcomp "--octopus --independent --is-ancestor --fork-point" + return + ;; + esac + __gitcomp_nl "$(__git_refs)" +} + +_git_mv () +{ + case "$cur" in + --*) + __gitcomp "--dry-run" + return + ;; + esac + + if [ $(__git_count_arguments "mv") -gt 0 ]; then + # We need to show both cached and untracked files (including + # empty directories) since this may not be the last argument. + __git_complete_index_file "--cached --others --directory" + else + __git_complete_index_file "--cached" + fi +} + +_git_name_rev () +{ + __gitcomp "--tags --all --stdin" +} + +_git_notes () +{ + local subcommands='add append copy edit list prune remove show' + local subcommand="$(__git_find_on_cmdline "$subcommands")" + + case "$subcommand,$cur" in + ,--*) + __gitcomp '--ref' + ;; + ,*) + case "$prev" in + --ref) + __gitcomp_nl "$(__git_refs)" + ;; + *) + __gitcomp "$subcommands --ref" + ;; + esac + ;; + add,--reuse-message=*|append,--reuse-message=*|\ + add,--reedit-message=*|append,--reedit-message=*) + __gitcomp_nl "$(__git_refs)" "" "${cur#*=}" + ;; + add,--*|append,--*) + __gitcomp '--file= --message= --reedit-message= + --reuse-message=' + ;; + copy,--*) + __gitcomp '--stdin' + ;; + prune,--*) + __gitcomp '--dry-run --verbose' + ;; + prune,*) + ;; + *) + case "$prev" in + -m|-F) + ;; + *) + __gitcomp_nl "$(__git_refs)" + ;; + esac + ;; + esac +} + +_git_pull () +{ + __git_complete_strategy && return + + case "$cur" in + --recurse-submodules=*) + __gitcomp "$__git_fetch_recurse_submodules" "" "${cur##--recurse-submodules=}" + return + ;; + --*) + __gitcomp " + --rebase --no-rebase + $__git_merge_options + $__git_fetch_options + " + return + ;; + esac + __git_complete_remote_or_refspec +} + +__git_push_recurse_submodules="check on-demand" + +__git_complete_force_with_lease () +{ + local cur_=$1 + + case "$cur_" in + --*=) + ;; + *:*) + __gitcomp_nl "$(__git_refs)" "" "${cur_#*:}" + ;; + *) + __gitcomp_nl "$(__git_refs)" "" "$cur_" + ;; + esac +} + +_git_push () +{ + case "$prev" in + --repo) + __gitcomp_nl "$(__git_remotes)" + return + ;; + --recurse-submodules) + __gitcomp "$__git_push_recurse_submodules" + return + ;; + esac + case "$cur" in + --repo=*) + __gitcomp_nl "$(__git_remotes)" "" "${cur##--repo=}" + return + ;; + --recurse-submodules=*) + __gitcomp "$__git_push_recurse_submodules" "" "${cur##--recurse-submodules=}" + return + ;; + --force-with-lease=*) + __git_complete_force_with_lease "${cur##--force-with-lease=}" + return + ;; + --*) + __gitcomp " + --all --mirror --tags --dry-run --force --verbose + --quiet --prune --delete --follow-tags + --receive-pack= --repo= --set-upstream + --force-with-lease --force-with-lease= --recurse-submodules= + " + return + ;; + esac + __git_complete_remote_or_refspec +} + +_git_rebase () +{ + local dir="$(__gitdir)" + if [ -f "$dir"/rebase-merge/interactive ]; then + __gitcomp "--continue --skip --abort --edit-todo" + return + elif [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then + __gitcomp "--continue --skip --abort" + return + fi + __git_complete_strategy && return + case "$cur" in + --whitespace=*) + __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" + return + ;; + --*) + __gitcomp " + --onto --merge --strategy --interactive + --preserve-merges --stat --no-stat + --committer-date-is-author-date --ignore-date + --ignore-whitespace --whitespace= + --autosquash --fork-point --no-fork-point + --autostash + " + + return + esac + __gitcomp_nl "$(__git_refs)" +} + +_git_reflog () +{ + local subcommands="show delete expire" + local subcommand="$(__git_find_on_cmdline "$subcommands")" + + if [ -z "$subcommand" ]; then + __gitcomp "$subcommands" + else + __gitcomp_nl "$(__git_refs)" + fi +} + +__git_send_email_confirm_options="always never auto cc compose" +__git_send_email_suppresscc_options="author self cc bodycc sob cccmd body all" + +_git_send_email () +{ + case "$prev" in + --to|--cc|--bcc|--from) + __gitcomp " + $(git --git-dir="$(__gitdir)" send-email --dump-aliases 2>/dev/null) + " "" "" + return + ;; + esac + + case "$cur" in + --confirm=*) + __gitcomp " + $__git_send_email_confirm_options + " "" "${cur##--confirm=}" + return + ;; + --suppress-cc=*) + __gitcomp " + $__git_send_email_suppresscc_options + " "" "${cur##--suppress-cc=}" + + return + ;; + --smtp-encryption=*) + __gitcomp "ssl tls" "" "${cur##--smtp-encryption=}" + return + ;; + --thread=*) + __gitcomp " + deep shallow + " "" "${cur##--thread=}" + return + ;; + --to=*|--cc=*|--bcc=*|--from=*) + __gitcomp " + $(git --git-dir="$(__gitdir)" send-email --dump-aliases 2>/dev/null) + " "" "${cur#--*=}" + return + ;; + --*) + __gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to + --compose --confirm= --dry-run --envelope-sender + --from --identity + --in-reply-to --no-chain-reply-to --no-signed-off-by-cc + --no-suppress-from --no-thread --quiet + --signed-off-by-cc --smtp-pass --smtp-server + --smtp-server-port --smtp-encryption= --smtp-user + --subject --suppress-cc= --suppress-from --thread --to + --validate --no-validate + $__git_format_patch_options" + return + ;; + esac + __git_complete_revlist +} + +_git_stage () +{ + _git_add +} + +__git_config_get_set_variables () +{ + local prevword word config_file= c=$cword + while [ $c -gt 1 ]; do + word="${words[c]}" + case "$word" in + --system|--global|--local|--file=*) + config_file="$word" + break + ;; + -f|--file) + config_file="$word $prevword" + break + ;; + esac + prevword=$word + c=$((--c)) + done + + git --git-dir="$(__gitdir)" config $config_file --name-only --list 2>/dev/null +} + +_git_config () +{ + case "$prev" in + branch.*.remote|branch.*.pushremote) + __gitcomp_nl "$(__git_remotes)" + return + ;; + branch.*.merge) + __gitcomp_nl "$(__git_refs)" + return + ;; + branch.*.rebase) + __gitcomp "false true" + return + ;; + remote.pushdefault) + __gitcomp_nl "$(__git_remotes)" + return + ;; + remote.*.fetch) + local remote="${prev#remote.}" + remote="${remote%.fetch}" + if [ -z "$cur" ]; then + __gitcomp_nl "refs/heads/" "" "" "" + return + fi + __gitcomp_nl "$(__git_refs_remotes "$remote")" + return + ;; + remote.*.push) + local remote="${prev#remote.}" + remote="${remote%.push}" + __gitcomp_nl "$(git --git-dir="$(__gitdir)" \ + for-each-ref --format='%(refname):%(refname)' \ + refs/heads)" + return + ;; + pull.twohead|pull.octopus) + __git_compute_merge_strategies + __gitcomp "$__git_merge_strategies" + return + ;; + color.branch|color.diff|color.interactive|\ + color.showbranch|color.status|color.ui) + __gitcomp "always never auto" + return + ;; + color.pager) + __gitcomp "false true" + return + ;; + color.*.*) + __gitcomp " + normal black red green yellow blue magenta cyan white + bold dim ul blink reverse + " + return + ;; + diff.submodule) + __gitcomp "log short" + return + ;; + help.format) + __gitcomp "man info web html" + return + ;; + log.date) + __gitcomp "$__git_log_date_formats" + return + ;; + sendemail.aliasesfiletype) + __gitcomp "mutt mailrc pine elm gnus" + return + ;; + sendemail.confirm) + __gitcomp "$__git_send_email_confirm_options" + return + ;; + sendemail.suppresscc) + __gitcomp "$__git_send_email_suppresscc_options" + return + ;; + sendemail.transferencoding) + __gitcomp "7bit 8bit quoted-printable base64" + return + ;; + --get|--get-all|--unset|--unset-all) + __gitcomp_nl "$(__git_config_get_set_variables)" + return + ;; + *.*) + return + ;; + esac + case "$cur" in + --*) + __gitcomp " + --system --global --local --file= + --list --replace-all + --get --get-all --get-regexp + --add --unset --unset-all + --remove-section --rename-section + --name-only + " + return + ;; + branch.*.*) + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp "remote pushremote merge mergeoptions rebase" "$pfx" "$cur_" + return + ;; + branch.*) + local pfx="${cur%.*}." cur_="${cur#*.}" + __gitcomp_nl "$(__git_heads)" "$pfx" "$cur_" "." + __gitcomp_nl_append $'autosetupmerge\nautosetuprebase\n' "$pfx" "$cur_" + return + ;; + guitool.*.*) + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp " + argprompt cmd confirm needsfile noconsole norescan + prompt revprompt revunmerged title + " "$pfx" "$cur_" + return + ;; + difftool.*.*) + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp "cmd path" "$pfx" "$cur_" + return + ;; + man.*.*) + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp "cmd path" "$pfx" "$cur_" + return + ;; + mergetool.*.*) + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp "cmd path trustExitCode" "$pfx" "$cur_" + return + ;; + pager.*) + local pfx="${cur%.*}." cur_="${cur#*.}" + __git_compute_all_commands + __gitcomp_nl "$__git_all_commands" "$pfx" "$cur_" + return + ;; + remote.*.*) + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp " + url proxy fetch push mirror skipDefaultUpdate + receivepack uploadpack tagopt pushurl + " "$pfx" "$cur_" + return + ;; + remote.*) + local pfx="${cur%.*}." cur_="${cur#*.}" + __gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "." + __gitcomp_nl_append "pushdefault" "$pfx" "$cur_" + return + ;; + url.*.*) + local pfx="${cur%.*}." cur_="${cur##*.}" + __gitcomp "insteadOf pushInsteadOf" "$pfx" "$cur_" + return + ;; + esac + __gitcomp " + add.ignoreErrors + advice.commitBeforeMerge + advice.detachedHead + advice.implicitIdentity + advice.pushNonFastForward + advice.resolveConflict + advice.statusHints + alias. + am.keepcr + apply.ignorewhitespace + apply.whitespace + branch.autosetupmerge + branch.autosetuprebase + browser. + clean.requireForce + color.branch + color.branch.current + color.branch.local + color.branch.plain + color.branch.remote + color.decorate.HEAD + color.decorate.branch + color.decorate.remoteBranch + color.decorate.stash + color.decorate.tag + color.diff + color.diff.commit + color.diff.frag + color.diff.func + color.diff.meta + color.diff.new + color.diff.old + color.diff.plain + color.diff.whitespace + color.grep + color.grep.context + color.grep.filename + color.grep.function + color.grep.linenumber + color.grep.match + color.grep.selected + color.grep.separator + color.interactive + color.interactive.error + color.interactive.header + color.interactive.help + color.interactive.prompt + color.pager + color.showbranch + color.status + color.status.added + color.status.changed + color.status.header + color.status.nobranch + color.status.unmerged + color.status.untracked + color.status.updated + color.ui + commit.status + commit.template + core.abbrev + core.askpass + core.attributesfile + core.autocrlf + core.bare + core.bigFileThreshold + core.compression + core.createObject + core.deltaBaseCacheLimit + core.editor + core.eol + core.excludesfile + core.fileMode + core.fsyncobjectfiles + core.gitProxy + core.ignoreStat + core.ignorecase + core.logAllRefUpdates + core.loosecompression + core.notesRef + core.packedGitLimit + core.packedGitWindowSize + core.pager + core.preferSymlinkRefs + core.preloadindex + core.quotepath + core.repositoryFormatVersion + core.safecrlf + core.sharedRepository + core.sparseCheckout + core.symlinks + core.trustctime + core.warnAmbiguousRefs + core.whitespace + core.worktree + diff.autorefreshindex + diff.external + diff.ignoreSubmodules + diff.mnemonicprefix + diff.noprefix + diff.renameLimit + diff.renames + diff.statGraphWidth + diff.submodule + diff.suppressBlankEmpty + diff.tool + diff.wordRegex + diff.algorithm + difftool. + difftool.prompt + fetch.recurseSubmodules + fetch.unpackLimit + format.attach + format.cc + format.coverLetter + format.headers + format.numbered + format.pretty + format.signature + format.signoff + format.subjectprefix + format.suffix + format.thread + format.to + gc. + gc.aggressiveWindow + gc.auto + gc.autopacklimit + gc.packrefs + gc.pruneexpire + gc.reflogexpire + gc.reflogexpireunreachable + gc.rerereresolved + gc.rerereunresolved + gitcvs.allbinary + gitcvs.commitmsgannotation + gitcvs.dbTableNamePrefix + gitcvs.dbdriver + gitcvs.dbname + gitcvs.dbpass + gitcvs.dbuser + gitcvs.enabled + gitcvs.logfile + gitcvs.usecrlfattr + guitool. + gui.blamehistoryctx + gui.commitmsgwidth + gui.copyblamethreshold + gui.diffcontext + gui.encoding + gui.fastcopyblame + gui.matchtrackingbranch + gui.newbranchtemplate + gui.pruneduringfetch + gui.spellingdictionary + gui.trustmtime + help.autocorrect + help.browser + help.format + http.lowSpeedLimit + http.lowSpeedTime + http.maxRequests + http.minSessions + http.noEPSV + http.postBuffer + http.proxy + http.sslCipherList + http.sslVersion + http.sslCAInfo + http.sslCAPath + http.sslCert + http.sslCertPasswordProtected + http.sslKey + http.sslVerify + http.useragent + i18n.commitEncoding + i18n.logOutputEncoding + imap.authMethod + imap.folder + imap.host + imap.pass + imap.port + imap.preformattedHTML + imap.sslverify + imap.tunnel + imap.user + init.templatedir + instaweb.browser + instaweb.httpd + instaweb.local + instaweb.modulepath + instaweb.port + interactive.singlekey + log.date + log.decorate + log.showroot + mailmap.file + man. + man.viewer + merge. + merge.conflictstyle + merge.log + merge.renameLimit + merge.renormalize + merge.stat + merge.tool + merge.verbosity + mergetool. + mergetool.keepBackup + mergetool.keepTemporaries + mergetool.prompt + notes.displayRef + notes.rewrite. + notes.rewrite.amend + notes.rewrite.rebase + notes.rewriteMode + notes.rewriteRef + pack.compression + pack.deltaCacheLimit + pack.deltaCacheSize + pack.depth + pack.indexVersion + pack.packSizeLimit + pack.threads + pack.window + pack.windowMemory + pager. + pretty. + pull.octopus + pull.twohead + push.default + push.followTags + rebase.autosquash + rebase.stat + receive.autogc + receive.denyCurrentBranch + receive.denyDeleteCurrent + receive.denyDeletes + receive.denyNonFastForwards + receive.fsckObjects + receive.unpackLimit + receive.updateserverinfo + remote.pushdefault + remotes. + repack.usedeltabaseoffset + rerere.autoupdate + rerere.enabled + sendemail. + sendemail.aliasesfile + sendemail.aliasfiletype + sendemail.bcc + sendemail.cc + sendemail.cccmd + sendemail.chainreplyto + sendemail.confirm + sendemail.envelopesender + sendemail.from + sendemail.identity + sendemail.multiedit + sendemail.signedoffbycc + sendemail.smtpdomain + sendemail.smtpencryption + sendemail.smtppass + sendemail.smtpserver + sendemail.smtpserveroption + sendemail.smtpserverport + sendemail.smtpuser + sendemail.suppresscc + sendemail.suppressfrom + sendemail.thread + sendemail.to + sendemail.validate + showbranch.default + status.relativePaths + status.showUntrackedFiles + status.submodulesummary + submodule. + tar.umask + transfer.unpackLimit + url. + user.email + user.name + user.signingkey + web.browser + branch. remote. + " +} + +_git_remote () +{ + local subcommands="add rename remove set-head set-branches set-url show prune update" + local subcommand="$(__git_find_on_cmdline "$subcommands")" + if [ -z "$subcommand" ]; then + __gitcomp "$subcommands" + return + fi + + case "$subcommand" in + rename|remove|set-url|show|prune) + __gitcomp_nl "$(__git_remotes)" + ;; + set-head|set-branches) + __git_complete_remote_or_refspec + ;; + update) + __gitcomp "$(__git_get_config_variables "remotes")" + ;; + *) + ;; + esac +} + +_git_replace () +{ + __gitcomp_nl "$(__git_refs)" +} + +_git_reset () +{ + __git_has_doubledash && return + + case "$cur" in + --*) + __gitcomp "--merge --mixed --hard --soft --patch" + return + ;; + esac + __gitcomp_nl "$(__git_refs)" +} + +_git_revert () +{ + local dir="$(__gitdir)" + if [ -f "$dir"/REVERT_HEAD ]; then + __gitcomp "--continue --quit --abort" + return + fi + case "$cur" in + --*) + __gitcomp "--edit --mainline --no-edit --no-commit --signoff" + return + ;; + esac + __gitcomp_nl "$(__git_refs)" +} + +_git_rm () +{ + case "$cur" in + --*) + __gitcomp "--cached --dry-run --ignore-unmatch --quiet" + return + ;; + esac + + __git_complete_index_file "--cached" +} + +_git_shortlog () +{ + __git_has_doubledash && return + + case "$cur" in + --*) + __gitcomp " + $__git_log_common_options + $__git_log_shortlog_options + --numbered --summary + " + return + ;; + esac + __git_complete_revlist +} + +_git_show () +{ + __git_has_doubledash && return + + case "$cur" in + --pretty=*|--format=*) + __gitcomp "$__git_log_pretty_formats $(__git_pretty_aliases) + " "" "${cur#*=}" + return + ;; + --diff-algorithm=*) + __gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}" + return + ;; + --*) + __gitcomp "--pretty= --format= --abbrev-commit --oneline + --show-signature + $__git_diff_common_options + " + return + ;; + esac + __git_complete_revlist_file +} + +_git_show_branch () +{ + case "$cur" in + --*) + __gitcomp " + --all --remotes --topo-order --current --more= + --list --independent --merge-base --no-name + --color --no-color + --sha1-name --sparse --topics --reflog + " + return + ;; + esac + __git_complete_revlist +} + +_git_stash () +{ + local save_opts='--keep-index --no-keep-index --quiet --patch' + local subcommands='save list show apply clear drop pop create branch' + local subcommand="$(__git_find_on_cmdline "$subcommands")" + if [ -z "$subcommand" ]; then + case "$cur" in + --*) + __gitcomp "$save_opts" + ;; + *) + if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then + __gitcomp "$subcommands" + fi + ;; + esac + else + case "$subcommand,$cur" in + save,--*) + __gitcomp "$save_opts" + ;; + apply,--*|pop,--*) + __gitcomp "--index --quiet" + ;; + show,--*|drop,--*|branch,--*) + ;; + show,*|apply,*|drop,*|pop,*|branch,*) + __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \ + | sed -n -e 's/:.*//p')" + ;; + *) + ;; + esac + fi +} + +_git_submodule () +{ + __git_has_doubledash && return + + local subcommands="add status init deinit update summary foreach sync" + if [ -z "$(__git_find_on_cmdline "$subcommands")" ]; then + case "$cur" in + --*) + __gitcomp "--quiet --cached" + ;; + *) + __gitcomp "$subcommands" + ;; + esac + return + fi +} + +_git_svn () +{ + local subcommands=" + init fetch clone rebase dcommit log find-rev + set-tree commit-diff info create-ignore propget + proplist show-ignore show-externals branch tag blame + migrate mkdirs reset gc + " + local subcommand="$(__git_find_on_cmdline "$subcommands")" + if [ -z "$subcommand" ]; then + __gitcomp "$subcommands" + else + local remote_opts="--username= --config-dir= --no-auth-cache" + local fc_opts=" + --follow-parent --authors-file= --repack= + --no-metadata --use-svm-props --use-svnsync-props + --log-window-size= --no-checkout --quiet + --repack-flags --use-log-author --localtime + --ignore-paths= --include-paths= $remote_opts + " + local init_opts=" + --template= --shared= --trunk= --tags= + --branches= --stdlayout --minimize-url + --no-metadata --use-svm-props --use-svnsync-props + --rewrite-root= --prefix= --use-log-author + --add-author-from $remote_opts + " + local cmt_opts=" + --edit --rmdir --find-copies-harder --copy-similarity= + " + + case "$subcommand,$cur" in + fetch,--*) + __gitcomp "--revision= --fetch-all $fc_opts" + ;; + clone,--*) + __gitcomp "--revision= $fc_opts $init_opts" + ;; + init,--*) + __gitcomp "$init_opts" + ;; + dcommit,--*) + __gitcomp " + --merge --strategy= --verbose --dry-run + --fetch-all --no-rebase --commit-url + --revision --interactive $cmt_opts $fc_opts + " + ;; + set-tree,--*) + __gitcomp "--stdin $cmt_opts $fc_opts" + ;; + create-ignore,--*|propget,--*|proplist,--*|show-ignore,--*|\ + show-externals,--*|mkdirs,--*) + __gitcomp "--revision=" + ;; + log,--*) + __gitcomp " + --limit= --revision= --verbose --incremental + --oneline --show-commit --non-recursive + --authors-file= --color + " + ;; + rebase,--*) + __gitcomp " + --merge --verbose --strategy= --local + --fetch-all --dry-run $fc_opts + " + ;; + commit-diff,--*) + __gitcomp "--message= --file= --revision= $cmt_opts" + ;; + info,--*) + __gitcomp "--url" + ;; + branch,--*) + __gitcomp "--dry-run --message --tag" + ;; + tag,--*) + __gitcomp "--dry-run --message" + ;; + blame,--*) + __gitcomp "--git-format" + ;; + migrate,--*) + __gitcomp " + --config-dir= --ignore-paths= --minimize + --no-auth-cache --username= + " + ;; + reset,--*) + __gitcomp "--revision= --parent" + ;; + *) + ;; + esac + fi +} + +_git_tag () +{ + local i c=1 f=0 + while [ $c -lt $cword ]; do + i="${words[c]}" + case "$i" in + -d|-v) + __gitcomp_nl "$(__git_tags)" + return + ;; + -f) + f=1 + ;; + esac + ((c++)) + done + + case "$prev" in + -m|-F) + ;; + -*|tag) + if [ $f = 1 ]; then + __gitcomp_nl "$(__git_tags)" + fi + ;; + *) + __gitcomp_nl "$(__git_refs)" + ;; + esac + + case "$cur" in + --*) + __gitcomp " + --list --delete --verify --annotate --message --file + --sign --cleanup --local-user --force --column --sort + --contains --points-at + " + ;; + esac +} + +_git_whatchanged () +{ + _git_log +} + +__git_main () +{ + local i c=1 command __git_dir + + while [ $c -lt $cword ]; do + i="${words[c]}" + case "$i" in + --git-dir=*) __git_dir="${i#--git-dir=}" ;; + --git-dir) ((c++)) ; __git_dir="${words[c]}" ;; + --bare) __git_dir="." ;; + --help) command="help"; break ;; + -c|--work-tree|--namespace) ((c++)) ;; + -*) ;; + *) command="$i"; break ;; + esac + ((c++)) + done + + if [ -z "$command" ]; then + case "$cur" in + --*) __gitcomp " + --paginate + --no-pager + --git-dir= + --bare + --version + --exec-path + --exec-path= + --html-path + --man-path + --info-path + --work-tree= + --namespace= + --no-replace-objects + --help + " + ;; + *) __git_compute_porcelain_commands + __gitcomp "$__git_porcelain_commands $(__git_aliases)" ;; + esac + return + fi + + local completion_func="_git_${command//-/_}" + declare -f $completion_func >/dev/null && $completion_func && return + + local expansion=$(__git_aliased_command "$command") + if [ -n "$expansion" ]; then + words[1]=$expansion + completion_func="_git_${expansion//-/_}" + declare -f $completion_func >/dev/null && $completion_func + fi +} + +__gitk_main () +{ + __git_has_doubledash && return + + local g="$(__gitdir)" + local merge="" + if [ -f "$g/MERGE_HEAD" ]; then + merge="--merge" + fi + case "$cur" in + --*) + __gitcomp " + $__git_log_common_options + $__git_log_gitk_options + $merge + " + return + ;; + esac + __git_complete_revlist +} + +if [[ -n ${ZSH_VERSION-} ]]; then + echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2 + + autoload -U +X compinit && compinit + + __gitcomp () + { + emulate -L zsh + + local cur_="${3-$cur}" + + case "$cur_" in + --*=) + ;; + *) + local c IFS=$' \t\n' + local -a array + for c in ${=1}; do + c="$c${4-}" + case $c in + --*=*|*.) ;; + *) c="$c " ;; + esac + array[${#array[@]}+1]="$c" + done + compset -P '*[=:]' + compadd -Q -S '' -p "${2-}" -a -- array && _ret=0 + ;; + esac + } + + __gitcomp_nl () + { + emulate -L zsh + + local IFS=$'\n' + compset -P '*[=:]' + compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 + } + + __gitcomp_file () + { + emulate -L zsh + + local IFS=$'\n' + compset -P '*[=:]' + compadd -Q -p "${2-}" -f -- ${=1} && _ret=0 + } + + _git () + { + local _ret=1 cur cword prev + cur=${words[CURRENT]} + prev=${words[CURRENT-1]} + let cword=CURRENT-1 + emulate ksh -c __${service}_main + let _ret && _default && _ret=0 + return _ret + } + + compdef _git git gitk + return +fi + +__git_func_wrap () +{ + local cur words cword prev + _get_comp_words_by_ref -n =: cur words cword prev + $1 +} + +# Setup completion for certain functions defined above by setting common +# variables and workarounds. +# This is NOT a public function; use at your own risk. +__git_complete () +{ + local wrapper="__git_wrap${2}" + eval "$wrapper () { __git_func_wrap $2 ; }" + complete -o bashdefault -o default -o nospace -F $wrapper $1 2>/dev/null \ + || complete -o default -o nospace -F $wrapper $1 +} + +# wrapper for backwards compatibility +_git () +{ + __git_wrap__git_main +} + +# wrapper for backwards compatibility +_gitk () +{ + __git_wrap__gitk_main +} + +__git_complete git __git_main +__git_complete gitk __gitk_main + +# The following are necessary only for Cygwin, and only are needed +# when the user has tab-completed the executable name and consequently +# included the '.exe' suffix. +# +if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then +__git_complete git.exe __git_main +fi diff --git a/support-d/git-prompt.sh b/support-d/git-prompt.sh new file mode 100644 index 0000000000..64219e631a --- /dev/null +++ b/support-d/git-prompt.sh @@ -0,0 +1,531 @@ +# bash/zsh git prompt support +# +# Copyright (C) 2006,2007 Shawn O. Pearce +# Distributed under the GNU General Public License, version 2.0. +# +# This script allows you to see repository status in your prompt. +# +# To enable: +# +# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). +# 2) Add the following line to your .bashrc/.zshrc: +# source ~/.git-prompt.sh +# 3a) Change your PS1 to call __git_ps1 as +# command-substitution: +# Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' +# ZSH: setopt PROMPT_SUBST ; PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ ' +# the optional argument will be used as format string. +# 3b) Alternatively, for a slightly faster prompt, __git_ps1 can +# be used for PROMPT_COMMAND in Bash or for precmd() in Zsh +# with two parameters,
 and , which are strings
+#        you would put in $PS1 before and after the status string
+#        generated by the git-prompt machinery.  e.g.
+#        Bash: PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
+#          will show username, at-sign, host, colon, cwd, then
+#          various status string, followed by dollar and SP, as
+#          your prompt.
+#        ZSH:  precmd () { __git_ps1 "%n" ":%~$ " "|%s" }
+#          will show username, pipe, then various status string,
+#          followed by colon, cwd, dollar and SP, as your prompt.
+#        Optionally, you can supply a third argument with a printf
+#        format string to finetune the output of the branch status
+#
+# The repository status will be displayed only if you are currently in a
+# git repository. The %s token is the placeholder for the shown status.
+#
+# The prompt status always includes the current branch name.
+#
+# In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value,
+# unstaged (*) and staged (+) changes will be shown next to the branch
+# name.  You can configure this per-repository with the
+# bash.showDirtyState variable, which defaults to true once
+# GIT_PS1_SHOWDIRTYSTATE is enabled.
+#
+# You can also see if currently something is stashed, by setting
+# GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed,
+# then a '$' will be shown next to the branch name.
+#
+# If you would like to see if there're untracked files, then you can set
+# GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked
+# files, then a '%' will be shown next to the branch name.  You can
+# configure this per-repository with the bash.showUntrackedFiles
+# variable, which defaults to true once GIT_PS1_SHOWUNTRACKEDFILES is
+# enabled.
+#
+# If you would like to see the difference between HEAD and its upstream,
+# set GIT_PS1_SHOWUPSTREAM="auto".  A "<" indicates you are behind, ">"
+# indicates you are ahead, "<>" indicates you have diverged and "="
+# indicates that there is no difference. You can further control
+# behaviour by setting GIT_PS1_SHOWUPSTREAM to a space-separated list
+# of values:
+#
+#     verbose       show number of commits ahead/behind (+/-) upstream
+#     name          if verbose, then also show the upstream abbrev name
+#     legacy        don't use the '--count' option available in recent
+#                   versions of git-rev-list
+#     git           always compare HEAD to @{upstream}
+#     svn           always compare HEAD to your SVN upstream
+#
+# You can change the separator between the branch name and the above
+# state symbols by setting GIT_PS1_STATESEPARATOR. The default separator
+# is SP.
+#
+# By default, __git_ps1 will compare HEAD to your SVN upstream if it can
+# find one, or @{upstream} otherwise.  Once you have set
+# GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by
+# setting the bash.showUpstream config variable.
+#
+# If you would like to see more information about the identity of
+# commits checked out as a detached HEAD, set GIT_PS1_DESCRIBE_STYLE
+# to one of these values:
+#
+#     contains      relative to newer annotated tag (v1.6.3.2~35)
+#     branch        relative to newer tag or branch (master~4)
+#     describe      relative to older annotated tag (v1.6.3.1-13-gdd42c2f)
+#     default       exactly matching tag
+#
+# If you would like a colored hint about the current dirty state, set
+# GIT_PS1_SHOWCOLORHINTS to a nonempty value. The colors are based on
+# the colored output of "git status -sb" and are available only when
+# using __git_ps1 for PROMPT_COMMAND or precmd.
+#
+# If you would like __git_ps1 to do nothing in the case when the current
+# directory is set up to be ignored by git, then set
+# GIT_PS1_HIDE_IF_PWD_IGNORED to a nonempty value. Override this on the
+# repository level by setting bash.hideIfPwdIgnored to "false".
+
+# check whether printf supports -v
+__git_printf_supports_v=
+printf -v __git_printf_supports_v -- '%s' yes >/dev/null 2>&1
+
+# stores the divergence from upstream in $p
+# used by GIT_PS1_SHOWUPSTREAM
+__git_ps1_show_upstream ()
+{
+	local key value
+	local svn_remote svn_url_pattern count n
+	local upstream=git legacy="" verbose="" name=""
+
+	svn_remote=()
+	# get some config options from git-config
+	local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
+	while read -r key value; do
+		case "$key" in
+		bash.showupstream)
+			GIT_PS1_SHOWUPSTREAM="$value"
+			if [[ -z "${GIT_PS1_SHOWUPSTREAM}" ]]; then
+				p=""
+				return
+			fi
+			;;
+		svn-remote.*.url)
+			svn_remote[$((${#svn_remote[@]} + 1))]="$value"
+			svn_url_pattern="$svn_url_pattern\\|$value"
+			upstream=svn+git # default upstream is SVN if available, else git
+			;;
+		esac
+	done <<< "$output"
+
+	# parse configuration values
+	for option in ${GIT_PS1_SHOWUPSTREAM}; do
+		case "$option" in
+		git|svn) upstream="$option" ;;
+		verbose) verbose=1 ;;
+		legacy)  legacy=1  ;;
+		name)    name=1 ;;
+		esac
+	done
+
+	# Find our upstream
+	case "$upstream" in
+	git)    upstream="@{upstream}" ;;
+	svn*)
+		# get the upstream from the "git-svn-id: ..." in a commit message
+		# (git-svn uses essentially the same procedure internally)
+		local -a svn_upstream
+		svn_upstream=($(git log --first-parent -1 \
+					--grep="^git-svn-id: \(${svn_url_pattern#??}\)" 2>/dev/null))
+		if [[ 0 -ne ${#svn_upstream[@]} ]]; then
+			svn_upstream=${svn_upstream[${#svn_upstream[@]} - 2]}
+			svn_upstream=${svn_upstream%@*}
+			local n_stop="${#svn_remote[@]}"
+			for ((n=1; n <= n_stop; n++)); do
+				svn_upstream=${svn_upstream#${svn_remote[$n]}}
+			done
+
+			if [[ -z "$svn_upstream" ]]; then
+				# default branch name for checkouts with no layout:
+				upstream=${GIT_SVN_ID:-git-svn}
+			else
+				upstream=${svn_upstream#/}
+			fi
+		elif [[ "svn+git" = "$upstream" ]]; then
+			upstream="@{upstream}"
+		fi
+		;;
+	esac
+
+	# Find how many commits we are ahead/behind our upstream
+	if [[ -z "$legacy" ]]; then
+		count="$(git rev-list --count --left-right \
+				"$upstream"...HEAD 2>/dev/null)"
+	else
+		# produce equivalent output to --count for older versions of git
+		local commits
+		if commits="$(git rev-list --left-right "$upstream"...HEAD 2>/dev/null)"
+		then
+			local commit behind=0 ahead=0
+			for commit in $commits
+			do
+				case "$commit" in
+				"<"*) ((behind++)) ;;
+				*)    ((ahead++))  ;;
+				esac
+			done
+			count="$behind	$ahead"
+		else
+			count=""
+		fi
+	fi
+
+	# calculate the result
+	if [[ -z "$verbose" ]]; then
+		case "$count" in
+		"") # no upstream
+			p="" ;;
+		"0	0") # equal to upstream
+			p="=" ;;
+		"0	"*) # ahead of upstream
+			p=">" ;;
+		*"	0") # behind upstream
+			p="<" ;;
+		*)	    # diverged from upstream
+			p="<>" ;;
+		esac
+	else
+		case "$count" in
+		"") # no upstream
+			p="" ;;
+		"0	0") # equal to upstream
+			p=" u=" ;;
+		"0	"*) # ahead of upstream
+			p=" u+${count#0	}" ;;
+		*"	0") # behind upstream
+			p=" u-${count%	0}" ;;
+		*)	    # diverged from upstream
+			p=" u+${count#*	}-${count%	*}" ;;
+		esac
+		if [[ -n "$count" && -n "$name" ]]; then
+			__git_ps1_upstream_name=$(git rev-parse \
+				--abbrev-ref "$upstream" 2>/dev/null)
+			if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
+				p="$p \${__git_ps1_upstream_name}"
+			else
+				p="$p ${__git_ps1_upstream_name}"
+				# not needed anymore; keep user's
+				# environment clean
+				unset __git_ps1_upstream_name
+			fi
+		fi
+	fi
+
+}
+
+# Helper function that is meant to be called from __git_ps1.  It
+# injects color codes into the appropriate gitstring variables used
+# to build a gitstring.
+__git_ps1_colorize_gitstring ()
+{
+	if [[ -n ${ZSH_VERSION-} ]]; then
+		local c_red='%F{red}'
+		local c_green='%F{green}'
+		local c_lblue='%F{blue}'
+		local c_clear='%f'
+	else
+		# Using \[ and \] around colors is necessary to prevent
+		# issues with command line editing/browsing/completion!
+		local c_red='\[\e[31m\]'
+		local c_green='\[\e[32m\]'
+		local c_lblue='\[\e[1;34m\]'
+		local c_clear='\[\e[0m\]'
+	fi
+	local bad_color=$c_red
+	local ok_color=$c_green
+	local flags_color="$c_lblue"
+
+	local branch_color=""
+	if [ $detached = no ]; then
+		branch_color="$ok_color"
+	else
+		branch_color="$bad_color"
+	fi
+	c="$branch_color$c"
+
+	z="$c_clear$z"
+	if [ "$w" = "*" ]; then
+		w="$bad_color$w"
+	fi
+	if [ -n "$i" ]; then
+		i="$ok_color$i"
+	fi
+	if [ -n "$s" ]; then
+		s="$flags_color$s"
+	fi
+	if [ -n "$u" ]; then
+		u="$bad_color$u"
+	fi
+	r="$c_clear$r"
+}
+
+__git_eread ()
+{
+	local f="$1"
+	shift
+	test -r "$f" && read "$@" <"$f"
+}
+
+# __git_ps1 accepts 0 or 1 arguments (i.e., format string)
+# when called from PS1 using command substitution
+# in this mode it prints text to add to bash PS1 prompt (includes branch name)
+#
+# __git_ps1 requires 2 or 3 arguments when called from PROMPT_COMMAND (pc)
+# in that case it _sets_ PS1. The arguments are parts of a PS1 string.
+# when two arguments are given, the first is prepended and the second appended
+# to the state string when assigned to PS1.
+# The optional third parameter will be used as printf format string to further
+# customize the output of the git-status string.
+# In this mode you can request colored hints using GIT_PS1_SHOWCOLORHINTS=true
+__git_ps1 ()
+{
+	# preserve exit status
+	local exit=$?
+	local pcmode=no
+	local detached=no
+	local ps1pc_start='\u@\h:\w '
+	local ps1pc_end='\$ '
+	local printf_format=' (%s)'
+
+	case "$#" in
+		2|3)	pcmode=yes
+			ps1pc_start="$1"
+			ps1pc_end="$2"
+			printf_format="${3:-$printf_format}"
+			# set PS1 to a plain prompt so that we can
+			# simply return early if the prompt should not
+			# be decorated
+			PS1="$ps1pc_start$ps1pc_end"
+		;;
+		0|1)	printf_format="${1:-$printf_format}"
+		;;
+		*)	return $exit
+		;;
+	esac
+
+	# ps1_expanded:  This variable is set to 'yes' if the shell
+	# subjects the value of PS1 to parameter expansion:
+	#
+	#   * bash does unless the promptvars option is disabled
+	#   * zsh does not unless the PROMPT_SUBST option is set
+	#   * POSIX shells always do
+	#
+	# If the shell would expand the contents of PS1 when drawing
+	# the prompt, a raw ref name must not be included in PS1.
+	# This protects the user from arbitrary code execution via
+	# specially crafted ref names.  For example, a ref named
+	# 'refs/heads/$(IFS=_;cmd=sudo_rm_-rf_/;$cmd)' might cause the
+	# shell to execute 'sudo rm -rf /' when the prompt is drawn.
+	#
+	# Instead, the ref name should be placed in a separate global
+	# variable (in the __git_ps1_* namespace to avoid colliding
+	# with the user's environment) and that variable should be
+	# referenced from PS1.  For example:
+	#
+	#     __git_ps1_foo=$(do_something_to_get_ref_name)
+	#     PS1="...stuff...\${__git_ps1_foo}...stuff..."
+	#
+	# If the shell does not expand the contents of PS1, the raw
+	# ref name must be included in PS1.
+	#
+	# The value of this variable is only relevant when in pcmode.
+	#
+	# Assume that the shell follows the POSIX specification and
+	# expands PS1 unless determined otherwise.  (This is more
+	# likely to be correct if the user has a non-bash, non-zsh
+	# shell and safer than the alternative if the assumption is
+	# incorrect.)
+	#
+	local ps1_expanded=yes
+	[ -z "$ZSH_VERSION" ] || [[ -o PROMPT_SUBST ]] || ps1_expanded=no
+	[ -z "$BASH_VERSION" ] || shopt -q promptvars || ps1_expanded=no
+
+	local repo_info rev_parse_exit_code
+	repo_info="$(git rev-parse --git-dir --is-inside-git-dir \
+		--is-bare-repository --is-inside-work-tree \
+		--short HEAD 2>/dev/null)"
+	rev_parse_exit_code="$?"
+
+	if [ -z "$repo_info" ]; then
+		return $exit
+	fi
+
+	local short_sha
+	if [ "$rev_parse_exit_code" = "0" ]; then
+		short_sha="${repo_info##*$'\n'}"
+		repo_info="${repo_info%$'\n'*}"
+	fi
+	local inside_worktree="${repo_info##*$'\n'}"
+	repo_info="${repo_info%$'\n'*}"
+	local bare_repo="${repo_info##*$'\n'}"
+	repo_info="${repo_info%$'\n'*}"
+	local inside_gitdir="${repo_info##*$'\n'}"
+	local g="${repo_info%$'\n'*}"
+
+	if [ "true" = "$inside_worktree" ] &&
+	   [ -n "${GIT_PS1_HIDE_IF_PWD_IGNORED-}" ] &&
+	   [ "$(git config --bool bash.hideIfPwdIgnored)" != "false" ] &&
+	   git check-ignore -q .
+	then
+		return $exit
+	fi
+
+	local r=""
+	local b=""
+	local step=""
+	local total=""
+	if [ -d "$g/rebase-merge" ]; then
+		__git_eread "$g/rebase-merge/head-name" b
+		__git_eread "$g/rebase-merge/msgnum" step
+		__git_eread "$g/rebase-merge/end" total
+		if [ -f "$g/rebase-merge/interactive" ]; then
+			r="|REBASE-i"
+		else
+			r="|REBASE-m"
+		fi
+	else
+		if [ -d "$g/rebase-apply" ]; then
+			__git_eread "$g/rebase-apply/next" step
+			__git_eread "$g/rebase-apply/last" total
+			if [ -f "$g/rebase-apply/rebasing" ]; then
+				__git_eread "$g/rebase-apply/head-name" b
+				r="|REBASE"
+			elif [ -f "$g/rebase-apply/applying" ]; then
+				r="|AM"
+			else
+				r="|AM/REBASE"
+			fi
+		elif [ -f "$g/MERGE_HEAD" ]; then
+			r="|MERGING"
+		elif [ -f "$g/CHERRY_PICK_HEAD" ]; then
+			r="|CHERRY-PICKING"
+		elif [ -f "$g/REVERT_HEAD" ]; then
+			r="|REVERTING"
+		elif [ -f "$g/BISECT_LOG" ]; then
+			r="|BISECTING"
+		fi
+
+		if [ -n "$b" ]; then
+			:
+		elif [ -h "$g/HEAD" ]; then
+			# symlink symbolic ref
+			b="$(git symbolic-ref HEAD 2>/dev/null)"
+		else
+			local head=""
+			if ! __git_eread "$g/HEAD" head; then
+				return $exit
+			fi
+			# is it a symbolic ref?
+			b="${head#ref: }"
+			if [ "$head" = "$b" ]; then
+				detached=yes
+				b="$(
+				case "${GIT_PS1_DESCRIBE_STYLE-}" in
+				(contains)
+					git describe --contains HEAD ;;
+				(branch)
+					git describe --contains --all HEAD ;;
+				(describe)
+					git describe HEAD ;;
+				(* | default)
+					git describe --tags --exact-match HEAD ;;
+				esac 2>/dev/null)" ||
+
+				b="$short_sha..."
+				b="($b)"
+			fi
+		fi
+	fi
+
+	if [ -n "$step" ] && [ -n "$total" ]; then
+		r="$r $step/$total"
+	fi
+
+	local w=""
+	local i=""
+	local s=""
+	local u=""
+	local c=""
+	local p=""
+
+	if [ "true" = "$inside_gitdir" ]; then
+		if [ "true" = "$bare_repo" ]; then
+			c="BARE:"
+		else
+			b="GIT_DIR!"
+		fi
+	elif [ "true" = "$inside_worktree" ]; then
+		if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ] &&
+		   [ "$(git config --bool bash.showDirtyState)" != "false" ]
+		then
+			git diff --no-ext-diff --quiet || w="*"
+			git diff --no-ext-diff --cached --quiet || i="+"
+			if [ -z "$short_sha" ] && [ -z "$i" ]; then
+				i="#"
+			fi
+		fi
+		if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ] &&
+		   git rev-parse --verify --quiet refs/stash >/dev/null
+		then
+			s="$"
+		fi
+
+		if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] &&
+		   [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
+		   git ls-files --others --exclude-standard --directory --no-empty-directory --error-unmatch -- ':/*' >/dev/null 2>/dev/null
+		then
+			u="%${ZSH_VERSION+%}"
+		fi
+
+		if [ -n "${GIT_PS1_SHOWUPSTREAM-}" ]; then
+			__git_ps1_show_upstream
+		fi
+	fi
+
+	local z="${GIT_PS1_STATESEPARATOR-" "}"
+
+	# NO color option unless in PROMPT_COMMAND mode
+	if [ $pcmode = yes ] && [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
+		__git_ps1_colorize_gitstring
+	fi
+
+	b=${b##refs/heads/}
+	if [ $pcmode = yes ] && [ $ps1_expanded = yes ]; then
+		__git_ps1_branch_name=$b
+		b="\${__git_ps1_branch_name}"
+	fi
+
+	local f="$w$i$s$u"
+	local gitstring="$c$b${f:+$z$f}$r$p"
+
+	if [ $pcmode = yes ]; then
+		if [ "${__git_printf_supports_v-}" != yes ]; then
+			gitstring=$(printf -- "$printf_format" "$gitstring")
+		else
+			printf -v gitstring -- "$printf_format" "$gitstring"
+		fi
+		PS1="$ps1pc_start$gitstring$ps1pc_end"
+	else
+		printf -- "$printf_format" "$gitstring"
+	fi
+
+	return $exit
+}

From 413ea14fd4861839c12f51f24a300d78de29e382 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Thu, 5 Apr 2018 15:44:35 +0800
Subject: [PATCH 194/264] [FS-11092] #resolve add cJSON_isTrue

---
 src/include/switch_json.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/include/switch_json.h b/src/include/switch_json.h
index 34ce5a05f9..03ee0beae8 100644
--- a/src/include/switch_json.h
+++ b/src/include/switch_json.h
@@ -93,6 +93,31 @@ static inline cJSON *json_add_child_string(cJSON *json, const char *name, const
 	return new_json;
 }
 
+static inline int cJSON_isTrue(cJSON *json)
+{
+	if (!json) return 0;
+
+	if (json->type == cJSON_True) return 1;
+
+	if (json->type == cJSON_String && (
+		!strcasecmp(json->valuestring, "yes") ||
+		!strcasecmp(json->valuestring, "on") ||
+		!strcasecmp(json->valuestring, "true") ||
+		!strcasecmp(json->valuestring, "t") ||
+		!strcasecmp(json->valuestring, "enabled") ||
+		!strcasecmp(json->valuestring, "active") ||
+		!strcasecmp(json->valuestring, "allow") ||
+		atoi(json->valuestring))) {
+		return 1;
+	}
+
+	if (json->type == cJSON_Number && (json->valueint || json->valuedouble)) {
+		return 1;
+	}
+
+	return 0;
+}
+
 #ifdef __cplusplus
 }
 #endif

From e55212f5d8699c380cd484085769b0f20c5c5392 Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Fri, 23 Mar 2018 18:04:40 +0000
Subject: [PATCH 195/264] FS-11111 #resolve add handle params to specify tts
 engine and voice from command text

---
 .../mod_conference/mod_conference.c           | 51 ++++++++++++-------
 1 file changed, 34 insertions(+), 17 deletions(-)

diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c
index 6026d63fa8..7b9c8207c8 100644
--- a/src/mod/applications/mod_conference/mod_conference.c
+++ b/src/mod/applications/mod_conference/mod_conference.c
@@ -895,7 +895,8 @@ switch_status_t conference_say(conference_obj_t *conference, const char *text, u
 	char *fp = NULL;
 	int channels;
 	const char *position = NULL;
-
+	const char *tts_engine = NULL, *tts_voice = NULL;
+	
 	switch_assert(conference != NULL);
 
 	channels = conference->channels;
@@ -908,9 +909,6 @@ switch_status_t conference_say(conference_obj_t *conference, const char *text, u
 	switch_mutex_lock(conference->mutex);
 	switch_mutex_lock(conference->member_mutex);
 	count = conference->count;
-	if (!(conference->tts_engine && conference->tts_voice)) {
-		count = 0;
-	}
 	switch_mutex_unlock(conference->member_mutex);
 	switch_mutex_unlock(conference->mutex);
 
@@ -951,29 +949,48 @@ switch_status_t conference_say(conference_obj_t *conference, const char *text, u
 	fnode->type = NODE_TYPE_SPEECH;
 	fnode->leadin = leadin;
 
-	if (params && (position = switch_event_get_header(params, "position"))) {
-		if (conference->channels != 2) {
-			position = NULL;
-		} else {
-			channels = 1;
-			fnode->al = conference_al_create(pool);
-			if (conference_al_parse_position(fnode->al, position) != SWITCH_STATUS_SUCCESS) {
-				fnode->al = NULL;
-				channels = conference->channels;
-				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Position Data.\n");
+	if (params) {
+		tts_engine = switch_event_get_header(params, "tts_engine");
+		tts_voice = switch_event_get_header(params, "tts_voice");
+
+		if ((position = switch_event_get_header(params, "position"))) {
+			if (conference->channels != 2) {
+				position = NULL;
+			} else {
+				channels = 1;
+				fnode->al = conference_al_create(pool);
+				if (conference_al_parse_position(fnode->al, position) != SWITCH_STATUS_SUCCESS) {
+					fnode->al = NULL;
+					channels = conference->channels;
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Position Data.\n");
+				}
 			}
 		}
 	}
-
+	
 	if (conference->sh && conference->last_speech_channels != channels) {
 		switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_NONE;
 		switch_core_speech_close(&conference->lsh, &flags);
 		conference->sh = NULL;
 	}
 
+	if (!tts_engine) {
+		tts_engine = conference->tts_engine;
+	}
+
+	if (!tts_voice) {
+		tts_voice = conference->tts_voice;
+	}
+
+	if (zstr(tts_engine) || zstr(tts_voice)) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing TTS engine or voice\n");
+		status = SWITCH_STATUS_FALSE;                                                                                                                       
+		goto end;
+	}
+	
 	if (!conference->sh) {
 		memset(&conference->lsh, 0, sizeof(conference->lsh));
-		if (switch_core_speech_open(&conference->lsh, conference->tts_engine, conference->tts_voice,
+		if (switch_core_speech_open(&conference->lsh, tts_engine, tts_voice,
 									conference->rate, conference->interval, channels, &flags, NULL) != SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid TTS module [%s]!\n", conference->tts_engine);
 			status = SWITCH_STATUS_FALSE;
@@ -1005,7 +1022,7 @@ switch_status_t conference_say(conference_obj_t *conference, const char *text, u
 			switch_core_speech_text_param_tts(fnode->sh, "voice", voice);
 		}
 	} else {
-		switch_core_speech_text_param_tts(fnode->sh, "voice", conference->tts_voice);
+		switch_core_speech_text_param_tts(fnode->sh, "voice", tts_voice);
 	}
 
 	/* Begin Generation */

From d48db7c979c0f113721fb9e7771bfaca80839a3a Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Mon, 9 Apr 2018 21:31:39 +0800
Subject: [PATCH 196/264] FS-11110 #resolve resume detect on next detect

---
 src/switch_ivr_async.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c
index 866601b356..bb574ee828 100644
--- a/src/switch_ivr_async.c
+++ b/src/switch_ivr_async.c
@@ -4901,6 +4901,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *
 		if (!(sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY))) {
 			return SWITCH_STATUS_NOT_INITALIZED;
 		}
+
+		switch_ivr_resume_detect_speech(session);
 	}
 
 	if (switch_core_asr_load_grammar(sth->ah, grammar, name) != SWITCH_STATUS_SUCCESS) {

From a0fd0a1b441f045ed0cb1d821cbe7debc31b04c5 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Fri, 13 Apr 2018 09:45:57 +0800
Subject: [PATCH 197/264] FS-11093 #resolve switch_true should return
 switch_bool_t

---
 src/include/switch_utils.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h
index 2bf3de880e..dd5adcbd89 100644
--- a/src/include/switch_utils.h
+++ b/src/include/switch_utils.h
@@ -495,7 +495,7 @@ SWITCH_DECLARE(char *) switch_find_parameter(const char *str, const char *param,
   \param expr a string expression
   \return true or false
 */
-static inline int switch_true(const char *expr)
+static inline switch_bool_t switch_true(const char *expr)
 {
 	return ((expr && ( !strcasecmp(expr, "yes") ||
 					   !strcasecmp(expr, "on") ||

From 3645facb849e6483ddd07790bb5e9d666176cb99 Mon Sep 17 00:00:00 2001
From: Andrey Volk 
Date: Thu, 19 Apr 2018 23:02:09 +0300
Subject: [PATCH 198/264] FS-11122: [Build-System] Fix improper use of debug
 symbols settings on Windows.

---
 .../mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj        | 4 ----
 src/mod/endpoints/mod_h323/mod_h323.2015.vcxproj          | 2 --
 src/mod/formats/mod_shout/mod_shout.2015.vcxproj          | 4 ----
 src/mod/languages/mod_managed/mod_managed.2015.vcxproj    | 4 ----
 w32/Console/FreeSwitchConsole.2015.vcxproj                | 4 ++--
 w32/Library/FreeSwitchCore.2015.vcxproj                   | 4 ++--
 w32/Setup/Setup.2015.wixproj                              | 8 ++++++++
 w32/module_debug.props                                    | 2 ++
 w32/module_release.props                                  | 1 +
 w32/modules.props                                         | 2 --
 10 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj b/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj
index 26151933f6..194b959a57 100644
--- a/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj
+++ b/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj
@@ -89,7 +89,6 @@
     
     
       $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
-      true
       Windows
       MachineX86
       false
@@ -116,7 +115,6 @@
     
     
       $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
-      true
       Windows
       MachineX64
     
@@ -141,7 +139,6 @@
     
     
       $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
-      true
       Windows
       true
       true
@@ -172,7 +169,6 @@
     
     
       $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
-      true
       Windows
       true
       true
diff --git a/src/mod/endpoints/mod_h323/mod_h323.2015.vcxproj b/src/mod/endpoints/mod_h323/mod_h323.2015.vcxproj
index e889d2c8c5..658934a24d 100644
--- a/src/mod/endpoints/mod_h323/mod_h323.2015.vcxproj
+++ b/src/mod/endpoints/mod_h323/mod_h323.2015.vcxproj
@@ -115,7 +115,6 @@
     
       h323plus.lib;ptlibs.lib;%(AdditionalDependencies)
       ..\..\..\..\..\ptlib\lib;..\..\..\..\..\h323plus\lib;%(AdditionalLibraryDirectories)
-      false
       false
       
       
@@ -132,7 +131,6 @@
     
       h323plus.lib;ptlibs.lib;%(AdditionalDependencies)
       ..\..\..\..\..\ptlib\lib\x64;..\..\..\..\..\h323plus\lib\x64;%(AdditionalLibraryDirectories)
-      false
       false
       
       
diff --git a/src/mod/formats/mod_shout/mod_shout.2015.vcxproj b/src/mod/formats/mod_shout/mod_shout.2015.vcxproj
index 8478ac139f..cef62a1ca8 100644
--- a/src/mod/formats/mod_shout/mod_shout.2015.vcxproj
+++ b/src/mod/formats/mod_shout/mod_shout.2015.vcxproj
@@ -86,7 +86,6 @@
     
     
       LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
-      true
       MachineX86
     
   
@@ -108,7 +107,6 @@
     
     
       LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
-      true
       MachineX64
     
   
@@ -126,7 +124,6 @@
     
     
       LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
-      false
       true
       true
       UseLinkTimeCodeGeneration
@@ -150,7 +147,6 @@
     
     
       LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
-      false
       true
       true
       UseLinkTimeCodeGeneration
diff --git a/src/mod/languages/mod_managed/mod_managed.2015.vcxproj b/src/mod/languages/mod_managed/mod_managed.2015.vcxproj
index e208298590..8cff1819a7 100644
--- a/src/mod/languages/mod_managed/mod_managed.2015.vcxproj
+++ b/src/mod/languages/mod_managed/mod_managed.2015.vcxproj
@@ -202,7 +202,6 @@
     
       
       
-      true
       true
       true
       /ignore:4248 %(AdditionalOptions)
@@ -223,7 +222,6 @@
     
       
       
-      true
       true
       true
       MachineX64
@@ -290,7 +288,6 @@
     
       
       
-      true
       true
       true
       /ignore:4248 %(AdditionalOptions)
@@ -313,7 +310,6 @@
     
       
       
-      true
       true
       true
       MachineX64
diff --git a/w32/Console/FreeSwitchConsole.2015.vcxproj b/w32/Console/FreeSwitchConsole.2015.vcxproj
index e6f186e610..bcf861ab13 100644
--- a/w32/Console/FreeSwitchConsole.2015.vcxproj
+++ b/w32/Console/FreeSwitchConsole.2015.vcxproj
@@ -155,7 +155,7 @@
     
     
       $(OutDir);%(AdditionalLibraryDirectories)
-      true
+      false
       Console
       true
       true
@@ -183,7 +183,7 @@
     
     
       $(OutDir);%(AdditionalLibraryDirectories)
-      true
+      false
       Console
       true
       true
diff --git a/w32/Library/FreeSwitchCore.2015.vcxproj b/w32/Library/FreeSwitchCore.2015.vcxproj
index fd636b4a2b..901563788d 100644
--- a/w32/Library/FreeSwitchCore.2015.vcxproj
+++ b/w32/Library/FreeSwitchCore.2015.vcxproj
@@ -258,7 +258,7 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs
     
       rpcrt4.lib;%(AdditionalDependencies)
       $(ProjectDir)..\..\libs\apr\$(OutDir);$(ProjectDir)..\..\libs\sqlite\$(OutDir) DLL;$(ProjectDir)..\..\libs\apr-util\$(OutDir);$(ProjectDir)..\..\libs\apr-iconv\$(OutDir);$(ProjectDir)..\..\libs\libresample\win;$(ProjectDir)..\..\libs\srtp\$(OutDir);%(AdditionalLibraryDirectories)
-      true
+      false
       Windows
       true
       true
@@ -309,7 +309,7 @@ if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs
     
       rpcrt4.lib;%(AdditionalDependencies)
       $(ProjectDir)..\..\libs\apr\$(OutDir);$(ProjectDir)..\..\libs\sqlite\$(OutDir) DLL;$(ProjectDir)..\..\libs\apr-util\$(OutDir);$(ProjectDir)..\..\libs\apr-iconv\$(OutDir);$(ProjectDir)..\..\libs\libresample\win;$(ProjectDir)..\..\libs\srtp\$(OutDir);%(AdditionalLibraryDirectories)
-      true
+      false
       Windows
       true
       true
diff --git a/w32/Setup/Setup.2015.wixproj b/w32/Setup/Setup.2015.wixproj
index 9c3a23349f..051c7722c7 100644
--- a/w32/Setup/Setup.2015.wixproj
+++ b/w32/Setup/Setup.2015.wixproj
@@ -135,6 +135,14 @@
       Binaries;Content;Satellites
       INSTALLFOLDER
     
+    
+      mod_cv
+      {40c4e2a2-b49b-496c-96d6-c04b890f7f88}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
     
       mod_db
       {f6a33240-8f29-48bd-98f0-826995911799}
diff --git a/w32/module_debug.props b/w32/module_debug.props
index 85c1d0c1d2..b25a85165a 100644
--- a/w32/module_debug.props
+++ b/w32/module_debug.props
@@ -17,6 +17,8 @@
       true
     
     
+      true
+      $(OutDir)$(TargetName).pdb
     
   
 
\ No newline at end of file
diff --git a/w32/module_release.props b/w32/module_release.props
index 8d9029d303..81633f09fc 100644
--- a/w32/module_release.props
+++ b/w32/module_release.props
@@ -18,6 +18,7 @@
       true
       true
       UseLinkTimeCodeGeneration
+      false
     
   
 
\ No newline at end of file
diff --git a/w32/modules.props b/w32/modules.props
index 664bbb93bd..80aa16563a 100644
--- a/w32/modules.props
+++ b/w32/modules.props
@@ -15,8 +15,6 @@
     
     
       $(OutDir)$(TargetName)$(TargetExt)
-      true
-      $(OutDir)$(TargetName).pdb
     
   
 
\ No newline at end of file

From 576938dc7a0bbc8235ac7fdced0fb89c0828295e Mon Sep 17 00:00:00 2001
From: Shane Bryldt 
Date: Wed, 1 Nov 2017 18:43:46 -0600
Subject: [PATCH 199/264] FS-10756: Removed all windows related libsodium
 stuff, no longer using it at all

---
 w32/sodium-version.props | 17 -----------------
 1 file changed, 17 deletions(-)
 delete mode 100644 w32/sodium-version.props

diff --git a/w32/sodium-version.props b/w32/sodium-version.props
deleted file mode 100644
index a63082b764..0000000000
--- a/w32/sodium-version.props
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-  
-  
-    1.0.12
-  
-  
-    true
-  
-  
-  
-  
-    
-      $(SodiumVersion)
-    
-  
-
\ No newline at end of file

From 414442c3b3feea30a3cee733f7467604fcc9c37f Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Fri, 20 Apr 2018 01:21:57 -0400
Subject: [PATCH 200/264] remove some unused files

This reverts commit 7944934d20acea26f6f25a4f3ea77033edfd0174.
This reverts commit b120ddb9d3c168d37b7220de28426198bb226a5b.
This reverts commit e8987b0d8cb8c8413b3812d9fc5a3922b0087813.
---
 libs/win32/Download civetweb.2015.vcxproj |  85 ------------
 libs/win32/civetweb/civetweb.2015.vcxproj | 156 ----------------------
 w32/civetweb-version.props                |  17 ---
 w32/civetweb.props                        |  15 ---
 w32/config-version.props                  |  17 ---
 5 files changed, 290 deletions(-)
 delete mode 100644 libs/win32/Download civetweb.2015.vcxproj
 delete mode 100644 libs/win32/civetweb/civetweb.2015.vcxproj
 delete mode 100644 w32/civetweb-version.props
 delete mode 100644 w32/civetweb.props
 delete mode 100644 w32/config-version.props

diff --git a/libs/win32/Download civetweb.2015.vcxproj b/libs/win32/Download civetweb.2015.vcxproj
deleted file mode 100644
index 3b9b293873..0000000000
--- a/libs/win32/Download civetweb.2015.vcxproj	
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download civetweb
-    Download civetweb
-    Win32Proj
-    {B9B7455D-F109-42BD-AD0A-98489B53FCF3}
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\civetweb\$(Configuration)\
-    $(PlatformName)\civetweb\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading civetweb.
-      if not exist "$(ProjectDir)..\civetweb-$(civetweb_Version)" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/civetweb-$(civetweb_Version).tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\civetweb-$(civetweb_Version);%(Outputs)
-      Downloading civetweb.
-      if not exist "$(ProjectDir)..\civetweb-$(civetweb_Version)" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/civetweb-$(civetweb_Version).tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\civetweb-$(civetweb_Version);%(Outputs)
-    
-  
-  
-  
-  
-
\ No newline at end of file
diff --git a/libs/win32/civetweb/civetweb.2015.vcxproj b/libs/win32/civetweb/civetweb.2015.vcxproj
deleted file mode 100644
index 4dce01ac9a..0000000000
--- a/libs/win32/civetweb/civetweb.2015.vcxproj
+++ /dev/null
@@ -1,156 +0,0 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    Win32Proj
-    civetweb
-    civetweb
-    {1FAAE8B0-C134-436D-9B13-74C16517FC03}
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-    
-    
-  
-  
-  
-    
-      Debug/
-      EnableFastChecks
-      CompileAsC
-      ProgramDatabase
-      
-      
-      Disabled
-      Disabled
-      NotUsing
-      MultiThreadedDebugDLL
-      true
-      Level4
-      WIN32;_WINDOWS;_DEBUG;USE_STACK_SIZE=102400;MAX_REQUEST_SIZE=16384;CMAKE_INTDIR="Debug";USE_DUKTAPE;USE_IPV6;LUA_COMPAT_ALL;USE_LUA;USE_LUA_SQLITE3;USE_LUA_FILE_SYSTEM;USE_WEBSOCKET;%(PreprocessorDefinitions)
-      $(IntDir)
-      4210;4100;4702;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      Release/
-      CompileAsC
-      
-      
-      AnySuitable
-      MaxSpeed
-      NotUsing
-      MultiThreadedDLL
-      true
-      Level4
-      WIN32;_WINDOWS;NDEBUG;USE_STACK_SIZE=102400;MAX_REQUEST_SIZE=16384;CMAKE_INTDIR="Release";USE_DUKTAPE;USE_IPV6;LUA_COMPAT_ALL;USE_LUA;USE_LUA_SQLITE3;USE_LUA_FILE_SYSTEM;USE_WEBSOCKET;%(PreprocessorDefinitions)
-      $(IntDir)
-      
-      
-      4210;4100;4702;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      X64
-    
-    
-      Debug/
-      EnableFastChecks
-      CompileAsC
-      ProgramDatabase
-      
-      
-      Disabled
-      Disabled
-      NotUsing
-      MultiThreadedDebugDLL
-      true
-      Level4
-      WIN32;_WINDOWS;_DEBUG;_WIN64;USE_STACK_SIZE=102400;MAX_REQUEST_SIZE=16384;CMAKE_INTDIR="Debug";USE_DUKTAPE;USE_IPV6;LUA_COMPAT_ALL;USE_LUA;USE_LUA_SQLITE3;USE_LUA_FILE_SYSTEM;USE_WEBSOCKET;%(PreprocessorDefinitions)
-      $(IntDir)
-      4210;4100;4702;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      X64
-    
-    
-      Release/
-      CompileAsC
-      
-      
-      AnySuitable
-      MaxSpeed
-      NotUsing
-      MultiThreadedDLL
-      true
-      Level4
-      WIN32;_WINDOWS;NDEBUG;USE_STACK_SIZE=102400;MAX_REQUEST_SIZE=16384;CMAKE_INTDIR="Release";USE_DUKTAPE;USE_IPV6;LUA_COMPAT_ALL;USE_LUA;USE_LUA_SQLITE3;USE_LUA_FILE_SYSTEM;USE_WEBSOCKET;_WIN64;%(PreprocessorDefinitions)
-      $(IntDir)
-      
-      
-      4210;4100;4702;%(DisableSpecificWarnings)
-    
-  
-  
-    
-  
-  
-    
-      {0a11689c-db6a-4bf6-97b2-ad32db863fbd}
-    
-    
-      {8f5e5d77-d269-4665-9e27-1045da6cf0d8}
-    
-    
-      {b9b7455d-f109-42bd-ad0a-98489b53fcf3}
-    
-  
-  
-  
-  
-
\ No newline at end of file
diff --git a/w32/civetweb-version.props b/w32/civetweb-version.props
deleted file mode 100644
index bdbdb07eb7..0000000000
--- a/w32/civetweb-version.props
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-  
-  
-    1.9.1
-  
-  
-    true
-  
-  
-  
-  
-    
-      $(civetweb_Version)
-    
-  
-
\ No newline at end of file
diff --git a/w32/civetweb.props b/w32/civetweb.props
deleted file mode 100644
index c0f4108924..0000000000
--- a/w32/civetweb.props
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-  
-    
-  
-  
-    $(SolutionDir)..\civetweb-$(civetweb_Version)\
-  
-  
-    
-      $(civetwebLibDir)\src\third_party\lua-5.2.4\src\;$(civetwebLibDir)\src\third_party\duktape-1.5.2\src\;$(civetwebLibDir)\src\third_party;$(civetwebLibDir)\include;%(AdditionalIncludeDirectories)
-	  USE_STACK_SIZE=102400;MAX_REQUEST_SIZE=16384;USE_DUKTAPE;USE_IPV6;LUA_COMPAT_ALL;USE_LUA;USE_LUA_SQLITE3;USE_LUA_FILE_SYSTEM;USE_WEBSOCKET;%(PreprocessorDefinitions)
-    
-  
-
\ No newline at end of file
diff --git a/w32/config-version.props b/w32/config-version.props
deleted file mode 100644
index 1bd8fe7b12..0000000000
--- a/w32/config-version.props
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-  
-  
-    1.5
-  
-  
-    true
-  
-  
-  
-  
-    
-      $(ConfigVersion)
-    
-  
-
\ No newline at end of file

From 561d18708533936379e59bbf189622764caf6f77 Mon Sep 17 00:00:00 2001
From: Andrey Volk 
Date: Fri, 20 Apr 2018 18:30:59 +0300
Subject: [PATCH 201/264] FS-11125: [Build-System] Remove unused files left
 from previous Visual Studio version.

---
 .../apr-util/libaprutil.2010.vcxproj.filters  |  307 -----
 libs/win32/apr-util/xml.2010.vcxproj.filters  |   79 --
 libs/win32/apr/libapr.2010.vcxproj.filters    |  406 -------
 .../iksemel/iksemel.2010.vcxproj.filters      |   69 --
 .../ldns-lib/ldns-lib.2010.vcxproj.filters    |  258 -----
 libs/win32/libcbt/libcbt.2010.vcxproj.filters |   40 -
 .../libjpeg/libjpeg.2010.vcxproj.filters      |  186 ---
 .../libmp3lame.2010.vcxproj.filters           |  170 ---
 libs/win32/libogg/libogg.2010.vcxproj.filters |   29 -
 .../mpg123/libmpg123.2010.vcxproj.filters     |   82 --
 libs/win32/opus/opus.2010.vcxproj.filters     |   93 --
 .../win32/opus/opus.celt.2010.vcxproj.filters |  147 ---
 .../opus.silk_common.2010.vcxproj.filters     |  315 -----
 .../opus/opus.silk_fixed.2010.vcxproj.filters |  111 --
 .../opus/opus.silk_float.2010.vcxproj.filters |  129 ---
 .../pocketsphinx.2010.vcxproj.filters         |  202 ----
 .../portaudio/portaudio.2010.vcxproj.filters  |  135 ---
 .../pthread/pthread.2010.vcxproj.filters      |   41 -
 ...ibsofia_sip_ua_static.2010.vcxproj.filters | 1025 -----------------
 .../win32/speex/libspeex.2010.vcxproj.filters |  177 ---
 .../sphinxbase.2010.vcxproj.filters           |  354 ------
 libs/win32/sqlite/sqlite.2010.vcxproj.filters |   23 -
 libs/win32/udns/libudns.2010.vcxproj.filters  |   66 --
 .../win32/xmlrpc-c/abyss.2010.vcxproj.filters |   69 --
 .../xmlrpc-c/xmlrpc.2010.vcxproj.filters      |  125 --
 .../xmlrpc-c/xmltok.2010.vcxproj.filters      |   45 -
 .../mod_avmd/mod_avmd.2010.vcxproj.filters    |   42 -
 src/mod/asr_tts/mod_unimrcp/unimrcp.props     |    2 +-
 src/mod/asr_tts/mod_unimrcp/unimrcp.vsprops   |   13 -
 .../mod_shout/mod_shout.vcxproj.filters       |   33 -
 src/mod/languages/mod_v8/gyp                  |   18 -
 .../mod_v8/mod_v8.2010.vcxproj.filters        |  128 --
 .../mod_v8/scripts/build-v8-tarballs.sh       |   93 --
 .../mod_v8/scripts/remove-v8-tests.patch      |   25 -
 src/mod/languages/mod_v8/v8-build.patch       |   11 -
 w32/apr.vsprops                               |   12 -
 w32/module_debug.vsprops                      |   22 -
 w32/module_release.vsprops                    |   23 -
 w32/modules.vsprops                           |   23 -
 w32/winlibs.vsprops                           |   12 -
 w32/xmlrpc.vsprops                            |   15 -
 41 files changed, 1 insertion(+), 5154 deletions(-)
 delete mode 100644 libs/win32/apr-util/libaprutil.2010.vcxproj.filters
 delete mode 100644 libs/win32/apr-util/xml.2010.vcxproj.filters
 delete mode 100644 libs/win32/apr/libapr.2010.vcxproj.filters
 delete mode 100644 libs/win32/iksemel/iksemel.2010.vcxproj.filters
 delete mode 100644 libs/win32/ldns/ldns-lib/ldns-lib.2010.vcxproj.filters
 delete mode 100644 libs/win32/libcbt/libcbt.2010.vcxproj.filters
 delete mode 100644 libs/win32/libjpeg/libjpeg.2010.vcxproj.filters
 delete mode 100644 libs/win32/libmp3lame/libmp3lame.2010.vcxproj.filters
 delete mode 100644 libs/win32/libogg/libogg.2010.vcxproj.filters
 delete mode 100644 libs/win32/mpg123/libmpg123.2010.vcxproj.filters
 delete mode 100644 libs/win32/opus/opus.2010.vcxproj.filters
 delete mode 100644 libs/win32/opus/opus.celt.2010.vcxproj.filters
 delete mode 100644 libs/win32/opus/opus.silk_common.2010.vcxproj.filters
 delete mode 100644 libs/win32/opus/opus.silk_fixed.2010.vcxproj.filters
 delete mode 100644 libs/win32/opus/opus.silk_float.2010.vcxproj.filters
 delete mode 100644 libs/win32/pocketsphinx/pocketsphinx.2010.vcxproj.filters
 delete mode 100644 libs/win32/portaudio/portaudio.2010.vcxproj.filters
 delete mode 100644 libs/win32/pthread/pthread.2010.vcxproj.filters
 delete mode 100644 libs/win32/sofia/libsofia_sip_ua_static.2010.vcxproj.filters
 delete mode 100644 libs/win32/speex/libspeex.2010.vcxproj.filters
 delete mode 100644 libs/win32/sphinxbase/sphinxbase.2010.vcxproj.filters
 delete mode 100644 libs/win32/sqlite/sqlite.2010.vcxproj.filters
 delete mode 100644 libs/win32/udns/libudns.2010.vcxproj.filters
 delete mode 100644 libs/win32/xmlrpc-c/abyss.2010.vcxproj.filters
 delete mode 100644 libs/win32/xmlrpc-c/xmlrpc.2010.vcxproj.filters
 delete mode 100644 libs/win32/xmlrpc-c/xmltok.2010.vcxproj.filters
 delete mode 100644 src/mod/applications/mod_avmd/mod_avmd.2010.vcxproj.filters
 delete mode 100644 src/mod/asr_tts/mod_unimrcp/unimrcp.vsprops
 delete mode 100644 src/mod/formats/mod_shout/mod_shout.vcxproj.filters
 delete mode 100755 src/mod/languages/mod_v8/gyp
 delete mode 100644 src/mod/languages/mod_v8/mod_v8.2010.vcxproj.filters
 delete mode 100755 src/mod/languages/mod_v8/scripts/build-v8-tarballs.sh
 delete mode 100644 src/mod/languages/mod_v8/scripts/remove-v8-tests.patch
 delete mode 100644 src/mod/languages/mod_v8/v8-build.patch
 delete mode 100644 w32/apr.vsprops
 delete mode 100644 w32/module_debug.vsprops
 delete mode 100644 w32/module_release.vsprops
 delete mode 100644 w32/modules.vsprops
 delete mode 100644 w32/winlibs.vsprops
 delete mode 100644 w32/xmlrpc.vsprops

diff --git a/libs/win32/apr-util/libaprutil.2010.vcxproj.filters b/libs/win32/apr-util/libaprutil.2010.vcxproj.filters
deleted file mode 100644
index 66ad7f99e0..0000000000
--- a/libs/win32/apr-util/libaprutil.2010.vcxproj.filters
+++ /dev/null
@@ -1,307 +0,0 @@
-
-
-  
-    
-      {fefe4b16-83a4-46b0-ab4b-858531a32218}
-    
-    
-      {66bee6b2-6ba2-4e7d-9c04-5e52ea75b8ee}
-    
-    
-      {ec602915-b144-4258-81ce-f8931434e1eb}
-    
-    
-      {47b5e91f-ec43-4b87-8d11-cc109d0f0733}
-    
-    
-      {12d41721-8bc3-476e-bffa-6bab3ebbcfef}
-    
-    
-      {aafe340f-5f94-4402-a3f4-977c302848c1}
-    
-    
-      {627c064a-54af-49ae-b154-01343f2be90e}
-    
-    
-      {3791a803-8653-410b-905e-934728270db6}
-    
-    
-      {5133e514-d14d-46b5-9e37-3ab909e4ef28}
-    
-    
-      {62959b64-29f8-483f-830f-91e3005c15b9}
-    
-    
-      {ec299ad2-8fa6-4923-95f4-b8c7f6184dcf}
-    
-    
-      {ef13505a-0a7a-4fdc-a55a-b47e92957a85}
-    
-    
-      {80fa8ffc-4776-4a21-bd8b-bfa055f9f46d}
-    
-    
-      {fdb27306-6946-4cf2-bdb6-39e03cdeeae6}
-    
-    
-      {ee62af10-73ee-4af5-85d1-442efcd33aa2}
-    
-    
-      {0ea472ce-22be-43c7-b06d-a50dd027a9fe}
-    
-  
-  
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\buckets
-    
-    
-      Source Files\crypto
-    
-    
-      Source Files\crypto
-    
-    
-      Source Files\crypto
-    
-    
-      Source Files\crypto
-    
-    
-      Source Files\crypto
-    
-    
-      Source Files\dbd
-    
-    
-      Source Files\dbd
-    
-    
-      Source Files\dbd
-    
-    
-      Source Files\dbd
-    
-    
-      Source Files\dbm
-    
-    
-      Source Files\dbm
-    
-    
-      Source Files\dbm
-    
-    
-      Source Files\dbm
-    
-    
-      Source Files\encoding
-    
-    
-      Source Files\hooks
-    
-    
-      Source Files\ldap
-    
-    
-      Source Files\ldap
-    
-    
-      Source Files\ldap
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\sdbm
-    
-    
-      Source Files\sdbm
-    
-    
-      Source Files\sdbm
-    
-    
-      Source Files\sdbm
-    
-    
-      Source Files\strmatch
-    
-    
-      Source Files\uri
-    
-    
-      Source Files\xlate
-    
-    
-  
-  
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-  
-  
-    
-      Generated Files
-    
-    
-      Generated Files
-    
-    
-      Generated Files
-    
-    
-      Generated Files
-    
-    
-      Generated Files
-    
-    
-      Generated Files
-    
-    
-      Generated Files
-    
-    
-      Generated Files
-    
-  
-  
-    
-  
-  
-    
-      Source Files\sdbm
-    
-    
-      Source Files\sdbm
-    
-    
-      Source Files\sdbm
-    
-  
-  
-    
-      Generated Files
-    
-    
-      Generated Files
-    
-    
-      Generated Files
-    
-    
-      Generated Files
-    
-    
-      Generated Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/apr-util/xml.2010.vcxproj.filters b/libs/win32/apr-util/xml.2010.vcxproj.filters
deleted file mode 100644
index 290e15f8fa..0000000000
--- a/libs/win32/apr-util/xml.2010.vcxproj.filters
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-  
-    
-      {e33b7b13-01f9-4f80-b853-993ecbce325e}
-      cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-    
-    
-      {da5f19e9-6a89-4668-815e-293aafff5410}
-      h;hpp;hxx;hm;inl
-    
-    
-      {9f1b6ff0-ef97-40e0-bcea-0b5b8b302288}
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-  
-    
-  
-  
-    
-      Generated Header Files
-    
-    
-      Generated Header Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/apr/libapr.2010.vcxproj.filters b/libs/win32/apr/libapr.2010.vcxproj.filters
deleted file mode 100644
index d8f55dc5f7..0000000000
--- a/libs/win32/apr/libapr.2010.vcxproj.filters
+++ /dev/null
@@ -1,406 +0,0 @@
-
-
-  
-    
-      {4fc8eb14-6896-4c69-bd8c-bddb16455565}
-      .c
-    
-    
-      {c89ee98b-64d0-48dd-b568-2ff6b59fc5c5}
-    
-    
-      {78b00836-5d44-4387-8462-4bb5e76ae5da}
-    
-    
-      {0fa9b52a-8504-44e2-8c0e-12b4aad8d27b}
-    
-    
-      {a4bc2b15-7e22-4e76-a2bc-bcd8fd793d09}
-    
-    
-      {07e65061-0cc8-4f41-879e-0c4f5a1b4592}
-    
-    
-      {2bb687cd-88a4-4477-8ee8-c0036b0b061c}
-    
-    
-      {8931e7d2-2589-4697-8eab-cbfdd7b78102}
-    
-    
-      {13d0cf3c-5d76-4e93-9dc9-20fc256f342e}
-    
-    
-      {c8b09a9b-d7a9-493c-af76-2f774f1ae867}
-    
-    
-      {8021a134-d200-4419-a9af-79c9330f7a50}
-    
-    
-      {5b36b756-ba67-41b3-82e8-19bf529b98e7}
-    
-    
-      {4792d1b4-2348-4cdc-9ac0-eced0c1e658e}
-    
-    
-      {bb1839cf-8ea0-43fd-a025-fe01e7ddd29e}
-    
-    
-      {f9664d77-a9cb-4eb7-9f86-b81860e8eac8}
-    
-    
-      {5d888443-39c7-4937-aed7-f100b0efc8bc}
-    
-    
-      {01c1e6ed-56bc-4d03-a1fd-1671ca1c2d90}
-    
-    
-      {243e3b60-6f34-46d7-8ffb-18936f283239}
-    
-    
-      {77829670-aaa9-4ff9-af8e-62ba7f507e32}
-    
-  
-  
-    
-      Source Files\atomic
-    
-    
-      Source Files\dso
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\file_io
-    
-    
-      Source Files\locks
-    
-    
-      Source Files\locks
-    
-    
-      Source Files\locks
-    
-    
-      Source Files\locks
-    
-    
-      Source Files\memory
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\misc
-    
-    
-      Source Files\mmap
-    
-    
-      Source Files\mmap
-    
-    
-      Source Files\network_io
-    
-    
-      Source Files\network_io
-    
-    
-      Source Files\network_io
-    
-    
-      Source Files\network_io
-    
-    
-      Source Files\network_io
-    
-    
-      Source Files\network_io
-    
-    
-      Source Files\network_io
-    
-    
-      Source Files\network_io
-    
-    
-      Source Files\passwd
-    
-    
-      Source Files\random
-    
-    
-      Source Files\random
-    
-    
-      Source Files\random
-    
-    
-      Source Files\shmem
-    
-    
-      Source Files\strings
-    
-    
-      Source Files\strings
-    
-    
-      Source Files\strings
-    
-    
-      Source Files\strings
-    
-    
-      Source Files\strings
-    
-    
-      Source Files\strings
-    
-    
-      Source Files\tables
-    
-    
-      Source Files\tables
-    
-    
-      Source Files\threadproc
-    
-    
-      Source Files\threadproc
-    
-    
-      Source Files\threadproc
-    
-    
-      Source Files\threadproc
-    
-    
-      Source Files\time
-    
-    
-      Source Files\time
-    
-    
-      Source Files\time
-    
-    
-      Source Files\user
-    
-    
-      Source Files\user
-    
-  
-  
-    
-      Private Header Files
-    
-    
-      Private Header Files
-    
-    
-      Private Header Files
-    
-    
-      Private Header Files
-    
-    
-      Private Header Files
-    
-    
-      Private Header Files
-    
-    
-      Private Header Files
-    
-    
-      Private Header Files
-    
-    
-      Private Header Files
-    
-    
-      Private Header Files
-    
-    
-      Private Header Files
-    
-    
-      Private Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-    
-      Public Header Files
-    
-  
-  
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/iksemel/iksemel.2010.vcxproj.filters b/libs/win32/iksemel/iksemel.2010.vcxproj.filters
deleted file mode 100644
index 27382de28b..0000000000
--- a/libs/win32/iksemel/iksemel.2010.vcxproj.filters
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/ldns/ldns-lib/ldns-lib.2010.vcxproj.filters b/libs/win32/ldns/ldns-lib/ldns-lib.2010.vcxproj.filters
deleted file mode 100644
index c76a57ea6f..0000000000
--- a/libs/win32/ldns/ldns-lib/ldns-lib.2010.vcxproj.filters
+++ /dev/null
@@ -1,258 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-  
-    
-      Header Files
-    
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/libcbt/libcbt.2010.vcxproj.filters b/libs/win32/libcbt/libcbt.2010.vcxproj.filters
deleted file mode 100644
index b5b7ad717d..0000000000
--- a/libs/win32/libcbt/libcbt.2010.vcxproj.filters
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-  
-    
-      {0a4bdcda-43d0-4907-83ce-01f3a87cdf59}
-    
-  
-  
-    
-      include
-    
-    
-      include
-    
-    
-      include
-    
-    
-      include
-    
-    
-      include
-    
-    
-      include
-    
-    
-      include
-    
-    
-      include
-    
-    
-      include
-    
-    
-      include
-    
-  
-
diff --git a/libs/win32/libjpeg/libjpeg.2010.vcxproj.filters b/libs/win32/libjpeg/libjpeg.2010.vcxproj.filters
deleted file mode 100644
index 6a63450cb4..0000000000
--- a/libs/win32/libjpeg/libjpeg.2010.vcxproj.filters
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/libmp3lame/libmp3lame.2010.vcxproj.filters b/libs/win32/libmp3lame/libmp3lame.2010.vcxproj.filters
deleted file mode 100644
index 227b9295f0..0000000000
--- a/libs/win32/libmp3lame/libmp3lame.2010.vcxproj.filters
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-  
-    
-      {f5641aca-51aa-43fe-94f1-8a3463d81fd2}
-      c
-    
-    
-      {35db8916-1b8b-4072-9a38-f62167263222}
-      h
-    
-    
-      {644a1cf1-f43b-4bd7-9e99-17500205a788}
-      .nas
-    
-  
-  
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-    
-      Source
-    
-  
-  
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-    
-      Include
-    
-  
-  
-    
-      Asm
-    
-    
-      Asm
-    
-    
-      Asm
-    
-    
-      Asm
-    
-    
-      Asm
-    
-    
-      Asm
-    
-    
-      Asm
-    
-    
-      Asm
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/libogg/libogg.2010.vcxproj.filters b/libs/win32/libogg/libogg.2010.vcxproj.filters
deleted file mode 100644
index e769aa60a3..0000000000
--- a/libs/win32/libogg/libogg.2010.vcxproj.filters
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-  
-    
-      {34e81afc-61be-40dc-b978-f4e20b9b1236}
-      cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-    
-    
-      {acd20529-ba9d-4ef9-8dc6-0c785bf72394}
-      h;hpp;hxx;hm;inl
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/mpg123/libmpg123.2010.vcxproj.filters b/libs/win32/mpg123/libmpg123.2010.vcxproj.filters
deleted file mode 100644
index c2b9a2adca..0000000000
--- a/libs/win32/mpg123/libmpg123.2010.vcxproj.filters
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/opus/opus.2010.vcxproj.filters b/libs/win32/opus/opus.2010.vcxproj.filters
deleted file mode 100644
index 80b78c2044..0000000000
--- a/libs/win32/opus/opus.2010.vcxproj.filters
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-
diff --git a/libs/win32/opus/opus.celt.2010.vcxproj.filters b/libs/win32/opus/opus.celt.2010.vcxproj.filters
deleted file mode 100644
index 9cdc36139e..0000000000
--- a/libs/win32/opus/opus.celt.2010.vcxproj.filters
+++ /dev/null
@@ -1,147 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-
diff --git a/libs/win32/opus/opus.silk_common.2010.vcxproj.filters b/libs/win32/opus/opus.silk_common.2010.vcxproj.filters
deleted file mode 100644
index 000040c0ca..0000000000
--- a/libs/win32/opus/opus.silk_common.2010.vcxproj.filters
+++ /dev/null
@@ -1,315 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-
diff --git a/libs/win32/opus/opus.silk_fixed.2010.vcxproj.filters b/libs/win32/opus/opus.silk_fixed.2010.vcxproj.filters
deleted file mode 100644
index d4c0785df5..0000000000
--- a/libs/win32/opus/opus.silk_fixed.2010.vcxproj.filters
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-
diff --git a/libs/win32/opus/opus.silk_float.2010.vcxproj.filters b/libs/win32/opus/opus.silk_float.2010.vcxproj.filters
deleted file mode 100644
index 4e132e1222..0000000000
--- a/libs/win32/opus/opus.silk_float.2010.vcxproj.filters
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-
diff --git a/libs/win32/pocketsphinx/pocketsphinx.2010.vcxproj.filters b/libs/win32/pocketsphinx/pocketsphinx.2010.vcxproj.filters
deleted file mode 100644
index 5d1afe56b6..0000000000
--- a/libs/win32/pocketsphinx/pocketsphinx.2010.vcxproj.filters
+++ /dev/null
@@ -1,202 +0,0 @@
-
-
-  
-    
-      {30a9f269-d81a-4ee2-adf0-8b402eb80fec}
-    
-    
-      {d54e4410-06e1-4361-b050-7aced67dff22}
-    
-    
-      {ebcc7cb5-8ca2-489c-b0e8-426058856ac8}
-      ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/portaudio/portaudio.2010.vcxproj.filters b/libs/win32/portaudio/portaudio.2010.vcxproj.filters
deleted file mode 100644
index 3f126704a6..0000000000
--- a/libs/win32/portaudio/portaudio.2010.vcxproj.filters
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-  
-    
-      {27479ed0-78ba-43cc-8fb5-31de44bbc8da}
-      cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-    
-    
-      {8f150320-dccc-4b5c-b43c-b3b91378f721}
-    
-    
-      {ac26acd3-797a-4668-a607-9694e9f10a16}
-    
-    
-      {03878aa4-e6a3-4d56-81fe-f93794a1e3a1}
-    
-    
-      {99774f7f-59c1-48cb-b72a-09d78537e6e4}
-    
-    
-      {f47fabee-145b-4c98-9423-3d1bb7c1f3b3}
-    
-    
-      {4ea57aa2-5b6b-4022-86b9-f3a02dd2284b}
-    
-    
-      {9c44aff3-3f53-4117-8097-ee8b810caba2}
-    
-    
-      {a20f633f-4213-4f4b-bd65-a8e49cf9f842}
-    
-    
-      {ce9a362c-b700-4ea4-88b4-51c222789754}
-    
-    
-      {6e72bafa-42f5-450a-90f4-0206faddcf3d}
-      ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-    
-    
-      {5060bc7a-2362-400f-bda0-ae74643cea86}
-      h;hpp;hxx;hm;inl
-    
-  
-  
-    
-      Source Files\common
-    
-    
-      Source Files\common
-    
-    
-      Source Files\common
-    
-    
-      Source Files\common
-    
-    
-      Source Files\common
-    
-    
-      Source Files\common
-    
-    
-      Source Files\common
-    
-    
-      Source Files\common
-    
-    
-      Source Files\common
-    
-    
-      Source Files\hostapi\ASIO
-    
-    
-      Source Files\hostapi\ASIO\ASIOSDK
-    
-    
-      Source Files\hostapi\ASIO\ASIOSDK
-    
-    
-      Source Files\hostapi\ASIO\ASIOSDK
-    
-    
-      Source Files\hostapi\ASIO\ASIOSDK
-    
-    
-      Source Files\hostapi\ASIO\ASIOSDK
-    
-    
-      Source Files\hostapi\ASIO\ASIOSDK
-    
-    
-      Source Files\hostapi\ASIO\ASIOSDK
-    
-    
-      Source Files\hostapi\dsound
-    
-    
-      Source Files\hostapi\dsound
-    
-    
-      Source Files\hostapi\wmme
-    
-    
-      Source Files\os\win
-    
-    
-      Source Files\os\win
-    
-    
-      Source Files\os\win
-    
-    
-      Source Files\os\win
-    
-    
-      Source Files\os\win
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Resource Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/pthread/pthread.2010.vcxproj.filters b/libs/win32/pthread/pthread.2010.vcxproj.filters
deleted file mode 100644
index e97efb4d6d..0000000000
--- a/libs/win32/pthread/pthread.2010.vcxproj.filters
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-  
-    
-      {eea9b312-399b-4998-b90c-92abe8150466}
-      cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-    
-    
-      {4fdd54b4-c31e-45b5-9b1a-09740020ae6f}
-      h;hpp;hxx;hm;inl
-    
-    
-      {d9df37d7-2c75-4916-bd8d-68f96aca4677}
-      ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-    
-  
-  
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-  
-    
-      Resource Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/sofia/libsofia_sip_ua_static.2010.vcxproj.filters b/libs/win32/sofia/libsofia_sip_ua_static.2010.vcxproj.filters
deleted file mode 100644
index f15af0508f..0000000000
--- a/libs/win32/sofia/libsofia_sip_ua_static.2010.vcxproj.filters
+++ /dev/null
@@ -1,1025 +0,0 @@
-
-
-  
-    
-      {e2fb9ce3-2e60-4ab8-a3f5-3acc0770c1fb}
-      cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-    
-    
-      {07c4085c-ab49-4d20-b4f4-bcd30b90ce73}
-      su*.c
-    
-    
-      {f302ae4a-7736-4563-b130-a88f67fb8420}
-    
-    
-      {0bd6f7dc-1416-4eba-a83b-9728b0f5ff09}
-      url*.c
-    
-    
-      {7d12ef13-6833-4299-a002-4cfa700aab08}
-      features*.c
-    
-    
-      {503e3513-dc29-4a8d-968f-eb9b85e37831}
-      bnf*.c
-    
-    
-      {3680f590-87b0-43fc-93d4-2f055947608c}
-      msg*.c
-    
-    
-      {71b15ca9-401c-4587-8b0e-1cbd01761e4c}
-    
-    
-      {777999e7-603f-4e2a-be29-0933e5d56c0d}
-    
-    
-      {0b33e411-4f7e-4275-9d87-9d674a0a294f}
-    
-    
-      {3e4054e5-d5cf-498d-afe4-feaee3b0df04}
-    
-    
-      {92d282a8-1180-42cf-baea-3b826d7fc6da}
-    
-    
-      {5dfb833d-6d12-41e4-9b84-35faae36eac9}
-    
-    
-      {ce2f9d87-410e-4558-8fb0-564ae88af551}
-    
-    
-      {a631bda8-f647-4fe1-92d1-6929887d822c}
-    
-    
-      {e7f1aa28-e4cd-4563-bb81-46e761435d07}
-    
-    
-      {c608280f-e56c-4f2b-94a8-052eac15f6e5}
-    
-    
-      {00e7d1cc-bb3a-4e76-b6b1-11db89ed6701}
-    
-    
-      {6b3531f0-aab2-44d2-8319-185e40c5c739}
-    
-    
-      {c1b1203d-95fa-41e3-bdea-df2b9915c4b9}
-    
-    
-      {ab318891-9ef3-4e56-baf7-8ce922a73e45}
-      h;hpp;hxx;hm;inl
-    
-    
-      {af1f4a99-a82d-4e82-b6ce-94a3cf7d1c37}
-      su*.h
-    
-    
-      {861289c7-2dec-4715-b158-2b3e00ab6040}
-    
-    
-      {ee802dd4-b53b-43d1-bdf2-3d4343d37779}
-    
-    
-      {bb636639-0b7f-41ed-a549-438d02a7d3ac}
-      url*.h
-    
-    
-      {d294ad27-4906-495b-8be4-5fc8aa291f3a}
-      features*.h
-    
-    
-      {566a4c1d-8cbb-4570-a8e8-3d1c6a6e3f71}
-      bnf*.h
-    
-    
-      {32c05478-a038-4b7d-bb4b-d33b82ab576d}
-    
-    
-      {84dbad62-348f-4e67-a48e-d8d22526b4a8}
-    
-    
-      {1441bb2b-94f7-4cbe-a4fc-82e7a88af588}
-    
-    
-      {bce41b99-f79a-45ee-9634-d0859695014f}
-    
-    
-      {ce670254-9dd6-4e3c-99ad-90f78c69d766}
-    
-    
-      {3b978047-99c5-4fd4-99fe-200151c76fd1}
-    
-    
-      {e9eaad41-1195-4c26-b813-d101ff7bf4f2}
-    
-    
-      {9ec1016a-8c36-4a62-bd3f-e226b3a6b479}
-    
-    
-      {4a392d00-3246-42cb-bff9-7b4f7889d8f2}
-    
-    
-      {e8343a7f-eed9-4051-85b0-d02fd78c06f1}
-    
-    
-      {17f68ee6-6245-4c14-8bda-387799431553}
-    
-    
-      {b08ddec7-8118-4a9d-8606-c62ffcbafc97}
-    
-    
-      {de42c0cc-17b9-4768-9981-abf8765ec30b}
-    
-  
-  
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\su
-    
-    
-      Source Files\ipt
-    
-    
-      Source Files\ipt
-    
-    
-      Source Files\ipt
-    
-    
-      Source Files\url
-    
-    
-      Source Files\url
-    
-    
-      Source Files\url
-    
-    
-      Source Files\features
-    
-    
-      Source Files\bnf
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\msg
-    
-    
-      Source Files\clib replacement
-    
-    
-      Source Files\clib replacement
-    
-    
-      Source Files\clib replacement
-    
-    
-      Source Files\clib replacement
-    
-    
-      Source Files\clib replacement
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\sip
-    
-    
-      Source Files\http
-    
-    
-      Source Files\http
-    
-    
-      Source Files\http
-    
-    
-      Source Files\http
-    
-    
-      Source Files\http
-    
-    
-      Source Files\http
-    
-    
-      Source Files\http
-    
-    
-      Source Files\http
-    
-    
-      Source Files\http
-    
-    
-      Source Files\nth
-    
-    
-      Source Files\nth
-    
-    
-      Source Files\nth
-    
-    
-      Source Files\nth
-    
-    
-      Source Files\sresolv
-    
-    
-      Source Files\sresolv
-    
-    
-      Source Files\sresolv
-    
-    
-      Source Files\sresolv
-    
-    
-      Source Files\sresolv
-    
-    
-      Source Files\nea
-    
-    
-      Source Files\nea
-    
-    
-      Source Files\nea
-    
-    
-      Source Files\nea
-    
-    
-      Source Files\nea
-    
-    
-      Source Files\nea
-    
-    
-      Source Files\iptsec
-    
-    
-      Source Files\iptsec
-    
-    
-      Source Files\iptsec
-    
-    
-      Source Files\iptsec
-    
-    
-      Source Files\iptsec
-    
-    
-      Source Files\iptsec
-    
-    
-      Source Files\iptsec
-    
-    
-      Source Files\iptsec
-    
-    
-      Source Files\iptsec
-    
-    
-      Source Files\iptsec
-    
-    
-      Source Files\iptsec
-    
-    
-      Source Files\stun
-    
-    
-      Source Files\stun
-    
-    
-      Source Files\stun
-    
-    
-      Source Files\stun
-    
-    
-      Source Files\stun
-    
-    
-      Source Files\stun
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nta
-    
-    
-      Source Files\nta
-    
-    
-      Source Files\nta
-    
-    
-      Source Files\nta
-    
-    
-      Source Files\nta
-    
-    
-      Source Files\nta
-    
-    
-      Source Files\nta
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\sdp
-    
-    
-      Source Files\sdp
-    
-    
-      Source Files\sdp
-    
-    
-      Source Files\sdp
-    
-    
-      Source Files\sdp
-    
-    
-      Source Files\soa
-    
-    
-      Source Files\soa
-    
-    
-      Source Files\soa
-    
-    
-      Source Files\soa
-    
-  
-  
-    
-      Source Files\stun
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\nua
-    
-    
-      Source Files\tport
-    
-    
-      Source Files\soa
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\su headers
-    
-    
-      Header Files\win32 headers
-    
-    
-      Header Files\win32 headers
-    
-    
-      Header Files\win32 headers
-    
-    
-      Header Files\ipt headers
-    
-    
-      Header Files\ipt headers
-    
-    
-      Header Files\ipt headers
-    
-    
-      Header Files\url headers
-    
-    
-      Header Files\url headers
-    
-    
-      Header Files\url headers
-    
-    
-      Header Files\features headers
-    
-    
-      Header Files\bnf headers
-    
-    
-      Header Files\bnf headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\msg headers
-    
-    
-      Header Files\sip headers
-    
-    
-      Header Files\sip headers
-    
-    
-      Header Files\sip headers
-    
-    
-      Header Files\sip headers
-    
-    
-      Header Files\sip headers
-    
-    
-      Header Files\sip headers
-    
-    
-      Header Files\sip headers
-    
-    
-      Header Files\sip headers
-    
-    
-      Header Files\sip headers
-    
-    
-      Header Files\sip headers
-    
-    
-      Header Files\sip headers
-    
-    
-      Header Files\http headers
-    
-    
-      Header Files\http headers
-    
-    
-      Header Files\http headers
-    
-    
-      Header Files\http headers
-    
-    
-      Header Files\http headers
-    
-    
-      Header Files\http headers
-    
-    
-      Header Files\http headers
-    
-    
-      Header Files\http headers
-    
-    
-      Header Files\nth headers
-    
-    
-      Header Files\nth headers
-    
-    
-      Header Files\sresolv headers
-    
-    
-      Header Files\sresolv headers
-    
-    
-      Header Files\sresolv headers
-    
-    
-      Header Files\sresolv headers
-    
-    
-      Header Files\sresolv headers
-    
-    
-      Header Files\sresolv headers
-    
-    
-      Header Files\nea headers
-    
-    
-      Header Files\nea headers
-    
-    
-      Header Files\nea headers
-    
-    
-      Header Files\iptsec headers
-    
-    
-      Header Files\iptsec headers
-    
-    
-      Header Files\iptsec headers
-    
-    
-      Header Files\iptsec headers
-    
-    
-      Header Files\iptsec headers
-    
-    
-      Header Files\iptsec headers
-    
-    
-      Header Files\stun headers
-    
-    
-      Header Files\stun headers
-    
-    
-      Header Files\stun headers
-    
-    
-      Header Files\nua headers
-    
-    
-      Header Files\nua headers
-    
-    
-      Header Files\nta headers
-    
-    
-      Header Files\nta headers
-    
-    
-      Header Files\nta headers
-    
-    
-      Header Files\nta headers
-    
-    
-      Header Files\nta headers
-    
-    
-      Header Files\nta headers
-    
-    
-      Header Files\tport headers
-    
-    
-      Header Files\tport headers
-    
-    
-      Header Files\tport headers
-    
-    
-      Header Files\tport headers
-    
-    
-      Header Files\sdp headers
-    
-    
-      Header Files\sdp headers
-    
-    
-      Header Files\soa headers
-    
-    
-      Header Files\soa headers
-    
-    
-      Header Files\soa headers
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/speex/libspeex.2010.vcxproj.filters b/libs/win32/speex/libspeex.2010.vcxproj.filters
deleted file mode 100644
index e799cdc160..0000000000
--- a/libs/win32/speex/libspeex.2010.vcxproj.filters
+++ /dev/null
@@ -1,177 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/sphinxbase/sphinxbase.2010.vcxproj.filters b/libs/win32/sphinxbase/sphinxbase.2010.vcxproj.filters
deleted file mode 100644
index 510e13f5f3..0000000000
--- a/libs/win32/sphinxbase/sphinxbase.2010.vcxproj.filters
+++ /dev/null
@@ -1,354 +0,0 @@
-
-
-  
-    
-      {5ce23960-a856-416b-a477-cf2d724bd43e}
-      cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-    
-    
-      {8d90e900-0942-4a25-b48a-b8dcd4382c28}
-      h;hpp;hxx;hm;inl
-    
-    
-      {cd06b891-4b88-427f-9f62-187bfead9b0f}
-      ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/sqlite/sqlite.2010.vcxproj.filters b/libs/win32/sqlite/sqlite.2010.vcxproj.filters
deleted file mode 100644
index fbeb745a62..0000000000
--- a/libs/win32/sqlite/sqlite.2010.vcxproj.filters
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-  
-  
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/udns/libudns.2010.vcxproj.filters b/libs/win32/udns/libudns.2010.vcxproj.filters
deleted file mode 100644
index f4e9018f39..0000000000
--- a/libs/win32/udns/libudns.2010.vcxproj.filters
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/xmlrpc-c/abyss.2010.vcxproj.filters b/libs/win32/xmlrpc-c/abyss.2010.vcxproj.filters
deleted file mode 100644
index dc60f95547..0000000000
--- a/libs/win32/xmlrpc-c/abyss.2010.vcxproj.filters
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-  
-    
-      {8ac4971f-a9ba-4930-a7e3-b291ad24d6ca}
-      cpp;c;cxx;rc;def;r;odl;idl;hpj;bat
-    
-    
-      {05489d43-6c6b-4bb8-95db-414e8137ee9e}
-      h;hpp;hxx;hm;inl
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/xmlrpc-c/xmlrpc.2010.vcxproj.filters b/libs/win32/xmlrpc-c/xmlrpc.2010.vcxproj.filters
deleted file mode 100644
index 8b6a1834a1..0000000000
--- a/libs/win32/xmlrpc-c/xmlrpc.2010.vcxproj.filters
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-  
-    
-      {7ca2b8b9-bf59-4407-aedf-588e548fe34a}
-      cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;cc
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/win32/xmlrpc-c/xmltok.2010.vcxproj.filters b/libs/win32/xmlrpc-c/xmltok.2010.vcxproj.filters
deleted file mode 100644
index edcb1d2353..0000000000
--- a/libs/win32/xmlrpc-c/xmltok.2010.vcxproj.filters
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-  
-    
-      {e8ec3017-8580-49f6-b5b5-4ba1c66c9b58}
-    
-    
-      {cf3bec2c-9e12-4a6c-8d1c-495721118adf}
-    
-  
-
\ No newline at end of file
diff --git a/src/mod/applications/mod_avmd/mod_avmd.2010.vcxproj.filters b/src/mod/applications/mod_avmd/mod_avmd.2010.vcxproj.filters
deleted file mode 100644
index e173af184d..0000000000
--- a/src/mod/applications/mod_avmd/mod_avmd.2010.vcxproj.filters
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-  
-    
-      {4ad6c9d4-436e-451a-8455-2cfce963ef3c}
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-  
-    
-    
-    
-    
-    
-    
-  
-
\ No newline at end of file
diff --git a/src/mod/asr_tts/mod_unimrcp/unimrcp.props b/src/mod/asr_tts/mod_unimrcp/unimrcp.props
index a904aa25db..6f304ae5f0 100644
--- a/src/mod/asr_tts/mod_unimrcp/unimrcp.props
+++ b/src/mod/asr_tts/mod_unimrcp/unimrcp.props
@@ -9,7 +9,7 @@
   
     
       $(SolutionDir)libs\unimrcp\platforms\libunimrcp-client\include;$(SolutionDir)libs\unimrcp\libs\mrcp-client\include;$(SolutionDir)libs\unimrcp\libs\mrcp-signaling\include;$(SolutionDir)libs\unimrcp\libs\apr-toolkit\include;$(SolutionDir)libs\unimrcp\build;$(SolutionDir)libs\unimrcp\libs\mrcp\include;$(SolutionDir)libs\unimrcp\libs\mrcp\message\include;$(SolutionDir)libs\unimrcp\libs\mrcp\control\include;$(SolutionDir)libs\unimrcp\libs\mrcp\resources\include;$(SolutionDir)libs\unimrcp\libs\mpf\include;$(SolutionDir)libs\unimrcp\libs\mrcpv2-transport\include;$(SolutionDir)libs\unimrcp\modules\mrcp-sofiasip\include;$(SolutionDir)libs\unimrcp\modules\mrcp-unirtsp\include;%(AdditionalIncludeDirectories)
-      MRCP_STATIC_LIB MPF_STATIC_LIB APT_STATIC_LIB;%(PreprocessorDefinitions)
+      MRCP_STATIC_LIB;MPF_STATIC_LIB;APT_STATIC_LIB;%(PreprocessorDefinitions)
     
   
 
\ No newline at end of file
diff --git a/src/mod/asr_tts/mod_unimrcp/unimrcp.vsprops b/src/mod/asr_tts/mod_unimrcp/unimrcp.vsprops
deleted file mode 100644
index 359408084a..0000000000
--- a/src/mod/asr_tts/mod_unimrcp/unimrcp.vsprops
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-	
-
diff --git a/src/mod/formats/mod_shout/mod_shout.vcxproj.filters b/src/mod/formats/mod_shout/mod_shout.vcxproj.filters
deleted file mode 100644
index ffd30b7d6d..0000000000
--- a/src/mod/formats/mod_shout/mod_shout.vcxproj.filters
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
-    
-  
-  
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-
\ No newline at end of file
diff --git a/src/mod/languages/mod_v8/gyp b/src/mod/languages/mod_v8/gyp
deleted file mode 100755
index 3d82e147f8..0000000000
--- a/src/mod/languages/mod_v8/gyp
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/env python2
-
-# Copyright (c) 2009 Google Inc. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import sys
-
-# TODO(mark): sys.path manipulation is some temporary testing stuff.
-try:
-  import gyp
-except ImportError, e:
-  import os.path
-  sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
-  import gyp
-
-if __name__ == '__main__':
-  sys.exit(gyp.main(sys.argv[1:]))
diff --git a/src/mod/languages/mod_v8/mod_v8.2010.vcxproj.filters b/src/mod/languages/mod_v8/mod_v8.2010.vcxproj.filters
deleted file mode 100644
index 42de878a39..0000000000
--- a/src/mod/languages/mod_v8/mod_v8.2010.vcxproj.filters
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-  
-    
-    
-      BaseClasses
-    
-    
-      BaseClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-    
-      FSClasses
-    
-  
-  
-    
-    
-      BaseClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-    
-      FSClasses\include
-    
-  
-  
-    
-      {57f55a0b-1790-4632-95e6-19acbe9015d3}
-    
-    
-      {dcda9b2f-890a-4820-84e3-4bbcf8f0b62c}
-    
-    
-      {ed9652cf-79bd-4567-9a98-1ed5077d5805}
-    
-    
-      {3efc073f-f052-4e3d-921c-8d6b6a5a7215}
-    
-  
-
\ No newline at end of file
diff --git a/src/mod/languages/mod_v8/scripts/build-v8-tarballs.sh b/src/mod/languages/mod_v8/scripts/build-v8-tarballs.sh
deleted file mode 100755
index d0ff656dbe..0000000000
--- a/src/mod/languages/mod_v8/scripts/build-v8-tarballs.sh
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/sh
-
-MY_CWD=$(pwd)
-
-report_error()
-{
-    echo "$1"
-
-    # Go back to the start directory and cleanup before we exit
-    cd "$MY_CWD"
-    rm -rf v8-$VERSION*
-
-    exit 1
-}
-        
-VERSION=$1
-
-if [ "$VERSION" = "" ]; then
-    report_error "You must provide the version to build!"
-fi
-
-echo "Will build tarballs for V8 version $VERSION"
-
-echo "Cleaning up earlier builds..."
-rm -rf v8-$VERSION* || report_error "Failed to cleanup, missing rights?"
-
-# Get current trunk version (which is the latest stable release)
-echo "Cloning V8 git repo..."
-git clone git://github.com/v8/v8.git v8-$VERSION > /dev/null || report_error "Failed to git clone Google V8"
-cd v8-$VERSION > /dev/null || report_error "Failed to enter the cloned directory"
-echo "Checking out version $VERSION from local V8 repo"
-git checkout tags/$VERSION > /dev/null || report_error "Failed to get version $VERSION"
-
-# Download dependencies releated to this version
-echo "Downloading V8 dependencies"
-make dependencies > /dev/null || report_error "Failed to get V8 dependencies"
-
-# Cleanup files we don't need
-echo "Cleaning up .git and .svn directories"
-for f in $(find | grep "\.git$")
-do
-    rm -rf "$f"
-done
-
-for f in $(find | grep "\.gitignore$")
-do
-    rm -rf "$f"
-done
-
-for f in $(find | grep "\.svn$")
-do
-    rm -rf "$f"
-done
-
-echo "Removing tests from build and packaging"
-rm -rf test
-rm -rf third_party/icu/source/test
-patch -p1 < ../remove-v8-tests.patch || report_error "Failed to apply build patch!"
-
-cd .. || report_error "Failed to change dir"
-
-echo "Creating new tarball..."
-tar cjpf v8-$VERSION.tar.bz2 v8-$VERSION || report_error "Failed to create tarball!"
-
-echo "cleaning up temporary data.."
-rm -rf v8-$VERSION || report_error "Failed to cleanup"
-
-echo "Finished building v8-$VERSION.tar.bz2"
-
-echo "Start building v8-$VERSION-win.tar.bz2"
-
-mkdir v8-$VERSION || report_error "Failed to create directory"
-cd v8-$VERSION || report_error "Failed to change dir"
-mkdir third_party || report_error "Failed to create directory"
-cd third_party || report_error "Failed to change dir"
-
-echo "Checking out files for Windows build..."
-svn co http://src.chromium.org/svn/trunk/tools/third_party/python_26 python_26 --revision 89111 > /dev/null || report_error "Failed to checkout python files"
-svn co http://src.chromium.org/svn/trunk/deps/third_party/cygwin cygwin --revision 231940 > /dev/null || report_error "Failed to checkout cygwin files"
-
-echo "Cleaning up .svn directories..."
-for f in $(find | grep "\.svn$")
-do
-    rm -rf "$f"
-done
-
-cd ../.. || report_error "Failed to change dir"
-
-echo "Creating new tarball..."
-tar cjpf v8-$VERSION-win.tar.bz2 v8-$VERSION || report_error "Failed to create tarball"
-
-echo "Cleaning up..."
-rm -rf v8-$VERSION
diff --git a/src/mod/languages/mod_v8/scripts/remove-v8-tests.patch b/src/mod/languages/mod_v8/scripts/remove-v8-tests.patch
deleted file mode 100644
index 4cbf996c68..0000000000
--- a/src/mod/languages/mod_v8/scripts/remove-v8-tests.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff --git a/Makefile b/Makefile
-index 8f21f7c..79e7a07 100644
---- a/Makefile
-+++ b/Makefile
-@@ -233,7 +233,7 @@ NACL_ARCHES = nacl_ia32 nacl_x64
- # List of files that trigger Makefile regeneration:
- GYPFILES = build/all.gyp build/features.gypi build/standalone.gypi \
-            build/toolchain.gypi samples/samples.gyp src/d8.gyp \
--           test/cctest/cctest.gyp tools/gyp/v8.gyp
-+           tools/gyp/v8.gyp
- 
- # If vtunejit=on, the v8vtune.gyp will be appended.
- ifeq ($(vtunejit), on)
-diff --git a/build/all.gyp b/build/all.gyp
-index 5fbd8c2..9c2a4db 100644
---- a/build/all.gyp
-+++ b/build/all.gyp
-@@ -10,7 +10,6 @@
-       'dependencies': [
-         '../samples/samples.gyp:*',
-         '../src/d8.gyp:d8',
--        '../test/cctest/cctest.gyp:*',
-       ],
-       'conditions': [
-         ['component!="shared_library"', {
diff --git a/src/mod/languages/mod_v8/v8-build.patch b/src/mod/languages/mod_v8/v8-build.patch
deleted file mode 100644
index 61b8ecdade..0000000000
--- a/src/mod/languages/mod_v8/v8-build.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- Makefile~	2014-01-11 14:45:55.000000000 +0100
-+++ Makefile	2014-03-19 09:25:47.700136526 +0100
-@@ -292,7 +292,7 @@
- native: $(OUTDIR)/Makefile.native
- 	@$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
- 	         CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \
--	         builddir="$(shell pwd)/$(OUTDIR)/$@"
-+	         builddir="$(OUTDIR)/$@"
- 
- $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES))
- 
diff --git a/w32/apr.vsprops b/w32/apr.vsprops
deleted file mode 100644
index bfaa0c7f05..0000000000
--- a/w32/apr.vsprops
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-	
-
diff --git a/w32/module_debug.vsprops b/w32/module_debug.vsprops
deleted file mode 100644
index cd30c6df81..0000000000
--- a/w32/module_debug.vsprops
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-	
-	
-
diff --git a/w32/module_release.vsprops b/w32/module_release.vsprops
deleted file mode 100644
index 37bd11c4a1..0000000000
--- a/w32/module_release.vsprops
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-	
-	
-
diff --git a/w32/modules.vsprops b/w32/modules.vsprops
deleted file mode 100644
index b80640adce..0000000000
--- a/w32/modules.vsprops
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-	
-	
-
diff --git a/w32/winlibs.vsprops b/w32/winlibs.vsprops
deleted file mode 100644
index 00ee4b0381..0000000000
--- a/w32/winlibs.vsprops
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-	
-
diff --git a/w32/xmlrpc.vsprops b/w32/xmlrpc.vsprops
deleted file mode 100644
index 580545ba3b..0000000000
--- a/w32/xmlrpc.vsprops
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-	
-	
-

From bb7013817b86d63b8fca3f36dcfcbca84c16b2ba Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Wed, 25 Apr 2018 13:33:22 -0500
Subject: [PATCH 202/264] FS-11138: [freeswitch-core] Leak in ESL client
 #resolve

---
 libs/esl/src/esl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c
index ab89b4c822..3f00a209f9 100644
--- a/libs/esl/src/esl.c
+++ b/libs/esl/src/esl.c
@@ -1018,6 +1018,8 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
 		goto fail;
 	}
 
+	handle->destroyed = 0;
+
 	if (timeout) {
 #ifdef WIN32
 		u_long arg = 1;
@@ -1115,7 +1117,7 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
 
  fail:
 
-	handle->connected = 0;
+	esl_disconnect(handle);
 
 	return ESL_FAIL;
 }

From 74f8ec77729ba8dffa4e4a35c6035ac3dd55704f Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Fri, 20 Apr 2018 13:33:57 -0500
Subject: [PATCH 203/264] FS-11127: [freeswitch-core] Improvements to Video JB
 and audio jb sync #resolve

---
 src/switch_core_media.c   | 23 +++++++++--------------
 src/switch_jitterbuffer.c | 12 ++++++------
 2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/src/switch_core_media.c b/src/switch_core_media.c
index e15dad3e09..1963a77954 100644
--- a/src/switch_core_media.c
+++ b/src/switch_core_media.c
@@ -2565,7 +2565,7 @@ static void check_jb_sync(switch_core_session_t *session)
 	uint32_t cur_frames = 0;
 	switch_media_handle_t *smh;
 	switch_rtp_engine_t *v_engine = NULL;
-	int sync_audio = 0, sync_video = 0;
+	int sync_audio = 0;
 
 	const char *var;
 
@@ -2607,34 +2607,29 @@ static void check_jb_sync(switch_core_session_t *session)
 
 	if (!fps) return;
 
+	sync_audio = 1;
 
 	if (!frames) {
-		sync_audio = 1;
-
 		if (cur_frames && min_frames && cur_frames >= min_frames) {
 			frames = cur_frames;
+		} else if (min_frames) {
+			frames = min_frames;
 		} else {
-			frames = fps / 15;
-			if (frames < 1) frames = 1;
+			frames = 0;
+			sync_audio = 0;
 		}
 	}
 
-	if (!jb_sync_msec) {
+	if (!jb_sync_msec && frames) {
 		jb_sync_msec = (double)(1000 / fps) * frames;
 	}
 
-	if (frames != cur_frames && frames > min_frames) {
-		switch_rtp_set_video_buffer_size(v_engine->rtp_session, frames, 0);
-		sync_audio = 1;
-		sync_video = 1;
-	}
-
 	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session),
-					  SWITCH_LOG_DEBUG1, "%s %s \"%s\" Sync A/V JB to %dms %u VFrames FPS %u a:%s v:%s sync_ms:%d\n",
+					  SWITCH_LOG_DEBUG1, "%s %s \"%s\" Sync A/V JB to %dms %u VFrames, FPS %u a:%s sync_ms:%d\n",
 					  switch_core_session_get_uuid(session),
 					  switch_channel_get_name(session->channel),
 					  switch_channel_get_variable_dup(session->channel, "caller_id_name", SWITCH_FALSE, -1),
-					  jb_sync_msec, frames, video_globals.fps, sync_audio ? "yes" : "no", sync_video ? "yes" : "no", jb_sync_msec);
+					  jb_sync_msec, frames, video_globals.fps, sync_audio ? "yes" : "no", jb_sync_msec);
 
 	if (sync_audio) {
 		check_jb(session, NULL, jb_sync_msec, 0, SWITCH_TRUE);
diff --git a/src/switch_jitterbuffer.c b/src/switch_jitterbuffer.c
index 3f1cb8d5e7..7f5d444f42 100644
--- a/src/switch_jitterbuffer.c
+++ b/src/switch_jitterbuffer.c
@@ -934,9 +934,13 @@ SWITCH_DECLARE(void) switch_jb_reset(switch_jb_t *jb)
 			switch_core_session_request_video_refresh(jb->session);
 		}
 	}
-
+	
 	jb_debug(jb, 2, "%s", "RESET BUFFER\n");
 
+	switch_mutex_lock(jb->mutex);
+	hide_nodes(jb);
+	switch_mutex_unlock(jb->mutex);
+	
 	jb->drop_flag = 0;
 	jb->last_target_seq = 0;
 	jb->target_seq = 0;
@@ -958,10 +962,6 @@ SWITCH_DECLARE(void) switch_jb_reset(switch_jb_t *jb)
 	jb->period_miss_inc = 0;
 	jb->target_ts = 0;
 	jb->last_target_ts = 0;
-
-	switch_mutex_lock(jb->mutex);
-	hide_nodes(jb);
-	switch_mutex_unlock(jb->mutex);
 }
 
 SWITCH_DECLARE(switch_status_t) switch_jb_peek_frame(switch_jb_t *jb, uint32_t ts, uint16_t seq, int peek, switch_frame_t *frame)
@@ -1377,7 +1377,7 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
 		if (!jb->read_init) jb->read_init = 1;
 	} else {
 		if (jb->type == SJB_VIDEO) {
-			switch_jb_reset(jb);
+			//switch_jb_reset(jb);
 
 			switch(status) {
 			case SWITCH_STATUS_RESTART:

From 0734899b9a6001a2e601605ad29d324956a4fe37 Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Thu, 26 Apr 2018 10:17:42 -0500
Subject: [PATCH 204/264] FS-10892: [mod_av] Lip Sync Improvements -- increase
 delta #resolve

---
 src/mod/applications/mod_av/avformat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c
index 7443183891..d35a853df8 100644
--- a/src/mod/applications/mod_av/avformat.c
+++ b/src/mod/applications/mod_av/avformat.c
@@ -1919,7 +1919,7 @@ GCC_DIAG_ON(deprecated-declarations)
 
 		 delta = context->video_timer.samplecount - context->last_vid_write;
 
-		 if (context->audio_timer || delta >= 60) {
+		 if (context->audio_timer || delta >= 200) {
 			 uint32_t new_pts = context->video_timer.samplecount * (handle->samplerate / 1000);
 			 if (!context->audio_timer) {
 				 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Delta of %d detected.  Video timer sync: %" SWITCH_UINT64_T_FMT "/%d %" SWITCH_UINT64_T_FMT "\n", delta, context->audio_st[0].next_pts, context->video_timer.samplecount, new_pts - context->audio_st[0].next_pts);

From 2450d637ce5914c56353eda21629ac8e1c161269 Mon Sep 17 00:00:00 2001
From: Joshua Young 
Date: Tue, 20 Feb 2018 17:40:44 -0500
Subject: [PATCH 205/264] FS-10972: [Verto-Communicator] add (-y) parameter to
 the verto install script debian8-install.sh #resolve

---
 html5/verto/verto_communicator/debian8-install.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/html5/verto/verto_communicator/debian8-install.sh b/html5/verto/verto_communicator/debian8-install.sh
index cf992b0906..a1e8fb252a 100755
--- a/html5/verto/verto_communicator/debian8-install.sh
+++ b/html5/verto/verto_communicator/debian8-install.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 apt-get update
-apt-get install npm nodejs-legacy
+apt-get -y install npm nodejs-legacy
 npm install -g grunt grunt-cli bower
 npm install
 bower --allow-root install

From 524ad35933fae1fd8d90970a2d567d64f48756bb Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Tue, 1 May 2018 17:30:14 -0500
Subject: [PATCH 206/264] FS-11047: add mod_v8 back to build

---
 configure.ac                         | 27 ++++++---------
 debian/bootstrap.sh                  |  1 -
 debian/control-modules               |  2 +-
 src/mod/languages/mod_v8/Makefile.am | 52 +++-------------------------
 4 files changed, 15 insertions(+), 67 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5345b354c1..7c41dbc465 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1451,6 +1451,16 @@ PKG_CHECK_MODULES([MEMCACHED], [libmemcached >= 0.31],[
   AM_CONDITIONAL([HAVE_MEMCACHED],[false])
 ])
 
+PKG_CHECK_MODULES([V8FS_STATIC], [v8fs_static >= 6.1.298],[
+  AM_CONDITIONAL([HAVE_V8FS],[true])],[
+  if module_enabled mod_v8; then
+    AC_MSG_ERROR([You need to either install libv8fs-dev (>= 6.1.298) or disable mod_v8 in modules.conf])
+  else
+    AC_MSG_RESULT([no])
+    AM_CONDITIONAL([HAVE_V8FS],[false])
+  fi
+])
+
 PKG_CHECK_MODULES([AMQP], [librabbitmq >= 0.5.2],[
   AM_CONDITIONAL([HAVE_AMQP],[true])],[
   AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_AMQP],[false])])
@@ -1549,23 +1559,6 @@ else
 fi
 
 AX_CHECK_JAVA
-
-# Option to enable static linking of Google's V8 inside mod_v8
-AC_ARG_ENABLE(static-v8,
-[AS_HELP_STRING([--enable-static-v8], [Statically link V8 into mod_v8])], [enable_static_v8="$enableval"], [enable_static_v8="no"])
-AM_CONDITIONAL([ENABLE_STATIC_V8],[test "x$enable_static_v8" != "xno"])
-
-# Option to disable parallel build of Google's V8
-AC_ARG_ENABLE(parallel-build-v8,
-[AS_HELP_STRING([--disable-parallel-build-v8], [Disable parallel build of V8])], [enable_parallel_build_v8="$enableval"], [enable_parallel_build_v8="yes"])
-AM_CONDITIONAL([ENABLE_PARALLEL_BUILD_V8],[test "x$enable_parallel_build_v8" != "xno"])
-
-if test "`uname -m`" = "x86_64"; then
-	V8_TARGET="x64"
-else
-	V8_TARGET="x86"
-fi
-AC_SUBST(V8_TARGET)
    
 AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"])
 AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"])
diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh
index bc8ea077c2..c12a8ce777 100755
--- a/debian/bootstrap.sh
+++ b/debian/bootstrap.sh
@@ -57,7 +57,6 @@ avoid_mods=(
   endpoints/mod_unicall
   event_handlers/mod_smpp
   formats/mod_webm
-  languages/mod_v8
   sdk/autotools
   xml_int/mod_xml_ldap
   xml_int/mod_xml_radius
diff --git a/debian/control-modules b/debian/control-modules
index 0053c7dfd9..1d3c0e81e6 100644
--- a/debian/control-modules
+++ b/debian/control-modules
@@ -650,7 +650,7 @@ Build-Depends: python-dev
 Module: languages/mod_v8
 Description: mod_v8
  Adds mod_v8.
-Build-Depends: git
+Build-Depends: git, libv8fs-6.1-dev
 
 Module: languages/mod_yaml
 Description: mod_yaml
diff --git a/src/mod/languages/mod_v8/Makefile.am b/src/mod/languages/mod_v8/Makefile.am
index 6ee67af022..1363d8b2c2 100644
--- a/src/mod/languages/mod_v8/Makefile.am
+++ b/src/mod/languages/mod_v8/Makefile.am
@@ -2,33 +2,14 @@ include $(top_srcdir)/build/modmake.rulesam
 
 AUTOMAKE_OPTIONS += foreign
 
-# V8 version to use
-V8_VERSION=6.1.298
-V8=v8-$(V8_VERSION)
-
-V8_DIR=$(switch_srcdir)/libs/$(V8)/v8
-V8_DEPOT_TOOLS_PATH=$(switch_builddir)/libs/$(V8)
-V8_BUILDDIR=$(V8_DEPOT_TOOLS_PATH)/v8
-
-V8_LIBDIR=$(V8_BUILDDIR)/out.gn/$(V8_TARGET).release
-
-if ISMAC
-V8_LIBEXT=dylib
-else
-V8_LIBEXT=so
-endif
-
-# Build the dynamic lib version of V8
-V8LIB=$(V8_LIBDIR)/libv8.$(V8_LIBEXT)
-
 MODNAME=mod_v8
 
-AM_CFLAGS    += -I. -I./include -I$(switch_srcdir)/src/mod/languages/mod_v8/include -I$(V8_DIR)/include
-AM_CPPFLAGS  += -I. -I./include -I$(switch_srcdir)/src/mod/languages/mod_v8/include -I$(V8_DIR)/include -std=c++11
+AM_CFLAGS    += -I. -I./include -I$(switch_srcdir)/src/mod/languages/mod_v8/include $(V8FS_STATIC_CFLAGS)
+AM_CPPFLAGS  += -I. -I./include -I$(switch_srcdir)/src/mod/languages/mod_v8/include $(V8FS_STATIC_CFLAGS) -std=c++11
 AM_LDFLAGS   += -avoid-version -module -no-undefined -shared
 
-AM_LIBADD     = $(switch_builddir)/libfreeswitch.la -lv8 -lv8_libbase -lv8_libplatform
-AM_LDFLAGS   += -L$(V8_LIBDIR)
+AM_LIBADD     = $(switch_builddir)/libfreeswitch.la
+AM_LDFLAGS   += $(V8FS_STATIC_LIBS)
 
 BUILT_SOURCES = $(V8LIB)
 
@@ -74,28 +55,3 @@ mod_v8_la_LDFLAGS  = $(CURL_LIBS) $(AM_LDFLAGS)
 #mod_v8_skel_la_LDFLAGS  = $(AM_LDFLAGS)
 
 $(SOURCES): $(BUILT_SOURCES)
-
-$(V8LIB):
-	mkdir -p $(V8_DEPOT_TOOLS_PATH)
-	cd $(V8_DEPOT_TOOLS_PATH) && \
-	export PATH=`pwd`/depot_tools:"$$PATH" && \
-	if [ ! -d "$(V8_DEPOT_TOOLS_PATH)/depot_tools" ] ; then git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git && fetch v8 ; fi && \
-	cd v8 && \
-	git checkout $(V8_VERSION) && \
-	gclient sync && \
-	tools/dev/v8gen.py -vv $(V8_TARGET).release -- is_debug=false is_component_build=true v8_enable_i18n_support=false v8_use_external_startup_data=false && \
-	ninja -C out.gn/$(V8_TARGET).release/ d8
-
-# This is a temporary solution to force Mac OSX build to load the libraries at the right place
-if ISMAC
-install-exec-local: $(DESTDIR)$(libdir)/libv8.$(V8_LIBEXT)
-	install_name_tool -change @rpath/libv8.$(V8_LIBEXT) $(libdir)/libv8.$(V8_LIBEXT) .libs/mod_v8.so
-	install_name_tool -change @rpath/libv8_libbase.$(V8_LIBEXT) $(libdir)/libv8_libbase.$(V8_LIBEXT) .libs/mod_v8.so
-	install_name_tool -change @rpath/libv8_libplatform.$(V8_LIBEXT) $(libdir)/libv8_libplatform.$(V8_LIBEXT) .libs/mod_v8.so
-else
-install-exec-local: $(DESTDIR)$(libdir)/libv8.$(V8_LIBEXT)
-endif
-$(DESTDIR)$(libdir)/libv8.$(V8_LIBEXT): $(V8LIB)
-	rm -f $(DESTDIR)$(libdir)/libv8.$(V8_LIBEXT) && cp -a $(V8_LIBDIR)/libv8.$(V8_LIBEXT) $(DESTDIR)$(libdir)/libv8.$(V8_LIBEXT)
-	rm -f $(DESTDIR)$(libdir)/libv8_libbase.$(V8_LIBEXT) && cp -a $(V8_LIBDIR)/libv8_libbase.$(V8_LIBEXT) $(DESTDIR)$(libdir)/libv8_libbase.$(V8_LIBEXT)
-	rm -f $(DESTDIR)$(libdir)/libv8_libplatform.$(V8_LIBEXT) && cp -a $(V8_LIBDIR)/libv8_libplatform.$(V8_LIBEXT) $(DESTDIR)$(libdir)/libv8_libplatform.$(V8_LIBEXT)

From b25358dc7c5d0aab16a6502636edf054e5201cac Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Wed, 2 May 2018 07:17:33 -0500
Subject: [PATCH 207/264] FS-11104: [build] use freeswitch custom ldns package
 if available

---
 debian/control-modules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/control-modules b/debian/control-modules
index 1d3c0e81e6..c4db1f0d2b 100644
--- a/debian/control-modules
+++ b/debian/control-modules
@@ -81,7 +81,7 @@ Description: Easyroute
 Module: applications/mod_enum
 Description: ENUM
  This module implements ENUM support.
-Build-Depends: libldns-dev
+Build-Depends: libldns2-fs | libldns-dev
 
 Module: applications/mod_esf
 Description: Multicast support

From 4d542c93b62a82d16598ce45c78c1c81cb282b8f Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Wed, 2 May 2018 13:42:54 -0500
Subject: [PATCH 208/264] FS-11104: [build] use the right openssl version
 everywhere

---
 debian/bootstrap.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh
index c12a8ce777..75a832458c 100755
--- a/debian/bootstrap.sh
+++ b/debian/bootstrap.sh
@@ -318,7 +318,7 @@ Build-Depends:
 # core codecs
  libogg-dev, libspeex-dev, libspeexdsp-dev,
 # configure options
- libssl-dev, unixodbc-dev, libpq-dev,
+ libssl1.0-dev | libssl-dev, unixodbc-dev, libpq-dev,
  libncurses5-dev, libjpeg62-turbo-dev | libjpeg-turbo8-dev | libjpeg62-dev | libjpeg8-dev,
  python-dev, python-all-dev, python-support (>= 0.90) | dh-python, erlang-dev,
 # documentation

From 9110f611602dc78083160b1b3c5885cf9a772c0e Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Wed, 2 May 2018 18:23:23 -0500
Subject: [PATCH 209/264] FS-11104: [build] use freeswitch custom ldns package
 if available

---
 debian/control-modules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/control-modules b/debian/control-modules
index c4db1f0d2b..275b5d3ccc 100644
--- a/debian/control-modules
+++ b/debian/control-modules
@@ -81,7 +81,7 @@ Description: Easyroute
 Module: applications/mod_enum
 Description: ENUM
  This module implements ENUM support.
-Build-Depends: libldns2-fs | libldns-dev
+Build-Depends: libldns-fs-dev | libldns-dev
 
 Module: applications/mod_esf
 Description: Multicast support

From 6cfe5e522ae927e7bf234b349e9ec3bebbd4edd6 Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Thu, 3 May 2018 14:31:48 -0400
Subject: [PATCH 210/264] FS-11047: [build] detect v8.pc as well

---
 configure.ac | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7c41dbc465..aaf6c270cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1453,12 +1453,15 @@ PKG_CHECK_MODULES([MEMCACHED], [libmemcached >= 0.31],[
 
 PKG_CHECK_MODULES([V8FS_STATIC], [v8fs_static >= 6.1.298],[
   AM_CONDITIONAL([HAVE_V8FS],[true])],[
-  if module_enabled mod_v8; then
-    AC_MSG_ERROR([You need to either install libv8fs-dev (>= 6.1.298) or disable mod_v8 in modules.conf])
-  else
-    AC_MSG_RESULT([no])
-    AM_CONDITIONAL([HAVE_V8FS],[false])
-  fi
+  PKG_CHECK_MODULES([V8FS_STATIC], [v8 >= 6.1.298],[
+    AM_CONDITIONAL([HAVE_V8FS],[true])],[
+    if module_enabled mod_v8; then
+      AC_MSG_ERROR([You need to either install libv8fs-dev (>= 6.1.298) or disable mod_v8 in modules.conf])
+    else
+      AC_MSG_RESULT([no])
+      AM_CONDITIONAL([HAVE_V8FS],[false])
+    fi
+  ])
 ])
 
 PKG_CHECK_MODULES([AMQP], [librabbitmq >= 0.5.2],[

From 54c2bbeda8ee583d2e22062ff2689915eb57b863 Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Thu, 3 May 2018 16:16:08 -0400
Subject: [PATCH 211/264] FS-11047: [build] support v8 6.6 fixes from Andrey
 Volk

---
 .../languages/mod_v8/include/javascript.hpp   |  2 +-
 src/mod/languages/mod_v8/mod_v8.cpp           |  4 ++--
 src/mod/languages/mod_v8/src/jsbase.cpp       | 19 ++++++-------------
 src/mod/languages/mod_v8/src/jsmain.cpp       |  8 ++++----
 4 files changed, 13 insertions(+), 20 deletions(-)

diff --git a/src/mod/languages/mod_v8/include/javascript.hpp b/src/mod/languages/mod_v8/include/javascript.hpp
index 5650ad18e1..a080a508de 100644
--- a/src/mod/languages/mod_v8/include/javascript.hpp
+++ b/src/mod/languages/mod_v8/include/javascript.hpp
@@ -127,7 +127,7 @@
 
 /* Macro for basic script state check (to know if the script is being terminated), should be called before calling any callback actual code */
 #define JS_CHECK_SCRIPT_STATE() \
-	if (v8::V8::IsExecutionTerminating(info.GetIsolate())) return;\
+	if (info.GetIsolate()->IsExecutionTerminating()) return;\
 	if (JSMain::GetScriptInstanceFromIsolate(info.GetIsolate()) && JSMain::GetScriptInstanceFromIsolate(info.GetIsolate())->GetForcedTermination()) return
 
 /* Macro for easy unlocking an isolate on a long running c call */
diff --git a/src/mod/languages/mod_v8/mod_v8.cpp b/src/mod/languages/mod_v8/mod_v8.cpp
index 636b93e5ac..9d1d8a9b91 100644
--- a/src/mod/languages/mod_v8/mod_v8.cpp
+++ b/src/mod/languages/mod_v8/mod_v8.cpp
@@ -645,7 +645,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
 			isolate->SetData(0, js);
 
 			// New global template
-			Handle global = ObjectTemplate::New();
+			Handle global = ObjectTemplate::New(isolate);
 
 			if (global.IsEmpty()) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create JS global object template\n");
@@ -793,7 +793,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
 							free(path);
 						}
 
-						TryCatch try_catch;
+						TryCatch try_catch(isolate);
 
 						// Compile the source code.
 #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
diff --git a/src/mod/languages/mod_v8/src/jsbase.cpp b/src/mod/languages/mod_v8/src/jsbase.cpp
index 4fd320f439..9e8b2032a5 100644
--- a/src/mod/languages/mod_v8/src/jsbase.cpp
+++ b/src/mod/languages/mod_v8/src/jsbase.cpp
@@ -153,17 +153,9 @@ void JSBase::CreateInstance(const v8::FunctionCallbackInfo& args)
 		autoDestroy = args[1]->BooleanValue();
 	} else {
 		// Create a new C++ instance
-#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
-		Isolate *isolate = args.GetIsolate();
-		v8::Local context = isolate->GetCurrentContext();
-		v8::Local key = String::NewFromUtf8(isolate, "constructor_method");
-		v8::Local privateKey = v8::Private::ForApi(isolate, key);
-		Handle ex;
-		v8::MaybeLocal hiddenValue = args.Callee()->GetPrivate(context, privateKey);
-		if (!hiddenValue.IsEmpty()) {
-			ex = Handle::Cast(hiddenValue.ToLocalChecked());
-		}
-#else
+#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=6 
+		Handle ex = Handle::Cast(args.Data());
+#else 
 		Handle ex = Handle::Cast(args.Callee()->GetHiddenValue(String::NewFromUtf8(args.GetIsolate(), "constructor_method")));
 #endif
 
@@ -232,13 +224,14 @@ void JSBase::Register(Isolate *isolate, const js_class_definition_t *desc)
 void JSBase::RegisterInstance(Isolate *isolate, string name, bool autoDestroy)
 {
 	// Get the context's global scope (that's where we'll put the constructor)
-	Handle global = isolate->GetCurrentContext()->Global();
+	Local context = isolate->GetCurrentContext();
+	Handle global = context->Global();
 
 	Local func = Local::Cast(global->Get(v8::String::NewFromUtf8(isolate, this->GetJSClassName().c_str())));
 
 	// Add the C++ instance as an argument, so it won't try to create another one.
 	Handle args[] = { External::New(isolate, this), Boolean::New(isolate, autoDestroy) };
-	Handle newObj = func->NewInstance(2, args);
+	Handle newObj = func->NewInstance(context, 2, args).ToLocalChecked();
 
 	// Add the instance to JavaScript.
 	if (name.size() > 0) {
diff --git a/src/mod/languages/mod_v8/src/jsmain.cpp b/src/mod/languages/mod_v8/src/jsmain.cpp
index e162460df2..86fed7b27f 100644
--- a/src/mod/languages/mod_v8/src/jsmain.cpp
+++ b/src/mod/languages/mod_v8/src/jsmain.cpp
@@ -209,7 +209,7 @@ const string JSMain::GetExceptionInfo(Isolate* isolate, TryCatch* try_catch)
 			ss << " ";
 		}
 
-		int end = message->GetEndColumn();
+		int32_t end = message->GetEndColumn(isolate->GetCurrentContext()).FromMaybe(0);
 
 		for (int i = start; i < end; i++) {
 			ss << "^";
@@ -292,7 +292,7 @@ const string JSMain::ExecuteString(const string& scriptData, const string& fileN
 
 			isolate->SetData(0, this);
 
-			Handle global = ObjectTemplate::New();
+			Handle global = ObjectTemplate::New(isolate);
 			global->Set(String::NewFromUtf8(isolate, "include"), FunctionTemplate::New(isolate, Include));
 			global->Set(String::NewFromUtf8(isolate, "require"), FunctionTemplate::New(isolate, Include));
 			global->Set(String::NewFromUtf8(isolate, "log"), FunctionTemplate::New(isolate, Log));
@@ -323,7 +323,7 @@ const string JSMain::ExecuteString(const string& scriptData, const string& fileN
 				inst->obj->RegisterInstance(isolate, inst->name, inst->auto_destroy);
 			}
 
-			TryCatch try_catch;
+			TryCatch try_catch(isolate);
 
 			// Compile the source code.
 #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
@@ -583,7 +583,7 @@ void JSMain::ExitScript(Isolate *isolate, const char *msg)
 		js->forcedTerminationScriptFile = GetStackInfo(isolate, &js->forcedTerminationLineNumber);
 	}
 
-	V8::TerminateExecution(isolate);
+	isolate->TerminateExecution();
 }
 
 char *JSMain::GetStackInfo(Isolate *isolate, int *lineNumber)

From b8b4517843ddc5077a5190d6d086c5191dfbf53f Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Thu, 3 May 2018 17:19:22 -0400
Subject: [PATCH 212/264] Revert "FS-11048: [build] support v8 6.6 fixes from
 Andrey Volk"

This reverts commit 27389f29377f84a4bee2625053cba64255980409.
---
 .../languages/mod_v8/include/javascript.hpp   |  2 +-
 src/mod/languages/mod_v8/mod_v8.cpp           |  4 ++--
 src/mod/languages/mod_v8/src/jsbase.cpp       | 19 +++++++++++++------
 src/mod/languages/mod_v8/src/jsmain.cpp       |  8 ++++----
 4 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/src/mod/languages/mod_v8/include/javascript.hpp b/src/mod/languages/mod_v8/include/javascript.hpp
index a080a508de..5650ad18e1 100644
--- a/src/mod/languages/mod_v8/include/javascript.hpp
+++ b/src/mod/languages/mod_v8/include/javascript.hpp
@@ -127,7 +127,7 @@
 
 /* Macro for basic script state check (to know if the script is being terminated), should be called before calling any callback actual code */
 #define JS_CHECK_SCRIPT_STATE() \
-	if (info.GetIsolate()->IsExecutionTerminating()) return;\
+	if (v8::V8::IsExecutionTerminating(info.GetIsolate())) return;\
 	if (JSMain::GetScriptInstanceFromIsolate(info.GetIsolate()) && JSMain::GetScriptInstanceFromIsolate(info.GetIsolate())->GetForcedTermination()) return
 
 /* Macro for easy unlocking an isolate on a long running c call */
diff --git a/src/mod/languages/mod_v8/mod_v8.cpp b/src/mod/languages/mod_v8/mod_v8.cpp
index 9d1d8a9b91..636b93e5ac 100644
--- a/src/mod/languages/mod_v8/mod_v8.cpp
+++ b/src/mod/languages/mod_v8/mod_v8.cpp
@@ -645,7 +645,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
 			isolate->SetData(0, js);
 
 			// New global template
-			Handle global = ObjectTemplate::New(isolate);
+			Handle global = ObjectTemplate::New();
 
 			if (global.IsEmpty()) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create JS global object template\n");
@@ -793,7 +793,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
 							free(path);
 						}
 
-						TryCatch try_catch(isolate);
+						TryCatch try_catch;
 
 						// Compile the source code.
 #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
diff --git a/src/mod/languages/mod_v8/src/jsbase.cpp b/src/mod/languages/mod_v8/src/jsbase.cpp
index 9e8b2032a5..4fd320f439 100644
--- a/src/mod/languages/mod_v8/src/jsbase.cpp
+++ b/src/mod/languages/mod_v8/src/jsbase.cpp
@@ -153,9 +153,17 @@ void JSBase::CreateInstance(const v8::FunctionCallbackInfo& args)
 		autoDestroy = args[1]->BooleanValue();
 	} else {
 		// Create a new C++ instance
-#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=6 
-		Handle ex = Handle::Cast(args.Data());
-#else 
+#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
+		Isolate *isolate = args.GetIsolate();
+		v8::Local context = isolate->GetCurrentContext();
+		v8::Local key = String::NewFromUtf8(isolate, "constructor_method");
+		v8::Local privateKey = v8::Private::ForApi(isolate, key);
+		Handle ex;
+		v8::MaybeLocal hiddenValue = args.Callee()->GetPrivate(context, privateKey);
+		if (!hiddenValue.IsEmpty()) {
+			ex = Handle::Cast(hiddenValue.ToLocalChecked());
+		}
+#else
 		Handle ex = Handle::Cast(args.Callee()->GetHiddenValue(String::NewFromUtf8(args.GetIsolate(), "constructor_method")));
 #endif
 
@@ -224,14 +232,13 @@ void JSBase::Register(Isolate *isolate, const js_class_definition_t *desc)
 void JSBase::RegisterInstance(Isolate *isolate, string name, bool autoDestroy)
 {
 	// Get the context's global scope (that's where we'll put the constructor)
-	Local context = isolate->GetCurrentContext();
-	Handle global = context->Global();
+	Handle global = isolate->GetCurrentContext()->Global();
 
 	Local func = Local::Cast(global->Get(v8::String::NewFromUtf8(isolate, this->GetJSClassName().c_str())));
 
 	// Add the C++ instance as an argument, so it won't try to create another one.
 	Handle args[] = { External::New(isolate, this), Boolean::New(isolate, autoDestroy) };
-	Handle newObj = func->NewInstance(context, 2, args).ToLocalChecked();
+	Handle newObj = func->NewInstance(2, args);
 
 	// Add the instance to JavaScript.
 	if (name.size() > 0) {
diff --git a/src/mod/languages/mod_v8/src/jsmain.cpp b/src/mod/languages/mod_v8/src/jsmain.cpp
index 86fed7b27f..e162460df2 100644
--- a/src/mod/languages/mod_v8/src/jsmain.cpp
+++ b/src/mod/languages/mod_v8/src/jsmain.cpp
@@ -209,7 +209,7 @@ const string JSMain::GetExceptionInfo(Isolate* isolate, TryCatch* try_catch)
 			ss << " ";
 		}
 
-		int32_t end = message->GetEndColumn(isolate->GetCurrentContext()).FromMaybe(0);
+		int end = message->GetEndColumn();
 
 		for (int i = start; i < end; i++) {
 			ss << "^";
@@ -292,7 +292,7 @@ const string JSMain::ExecuteString(const string& scriptData, const string& fileN
 
 			isolate->SetData(0, this);
 
-			Handle global = ObjectTemplate::New(isolate);
+			Handle global = ObjectTemplate::New();
 			global->Set(String::NewFromUtf8(isolate, "include"), FunctionTemplate::New(isolate, Include));
 			global->Set(String::NewFromUtf8(isolate, "require"), FunctionTemplate::New(isolate, Include));
 			global->Set(String::NewFromUtf8(isolate, "log"), FunctionTemplate::New(isolate, Log));
@@ -323,7 +323,7 @@ const string JSMain::ExecuteString(const string& scriptData, const string& fileN
 				inst->obj->RegisterInstance(isolate, inst->name, inst->auto_destroy);
 			}
 
-			TryCatch try_catch(isolate);
+			TryCatch try_catch;
 
 			// Compile the source code.
 #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
@@ -583,7 +583,7 @@ void JSMain::ExitScript(Isolate *isolate, const char *msg)
 		js->forcedTerminationScriptFile = GetStackInfo(isolate, &js->forcedTerminationLineNumber);
 	}
 
-	isolate->TerminateExecution();
+	V8::TerminateExecution(isolate);
 }
 
 char *JSMain::GetStackInfo(Isolate *isolate, int *lineNumber)

From bf59e825bd52d4a77a9bd21ef84609d9a5f84a68 Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Thu, 3 May 2018 19:13:05 -0400
Subject: [PATCH 213/264] FS-11047: [build] support v8 6.6 fixes from Andrey
 Volk

---
 .../languages/mod_v8/include/javascript.hpp   |  2 +-
 src/mod/languages/mod_v8/mod_v8.cpp           |  6 ++---
 src/mod/languages/mod_v8/src/fscoredb.cpp     |  5 ----
 src/mod/languages/mod_v8/src/fscurl.cpp       |  2 +-
 src/mod/languages/mod_v8/src/fsdbh.cpp        |  5 ----
 src/mod/languages/mod_v8/src/fsglobal.cpp     |  6 ++---
 src/mod/languages/mod_v8/src/fssession.cpp    |  8 +++----
 src/mod/languages/mod_v8/src/jsbase.cpp       | 23 ++++++-------------
 src/mod/languages/mod_v8/src/jsmain.cpp       |  8 +++----
 9 files changed, 23 insertions(+), 42 deletions(-)

diff --git a/src/mod/languages/mod_v8/include/javascript.hpp b/src/mod/languages/mod_v8/include/javascript.hpp
index 5650ad18e1..a080a508de 100644
--- a/src/mod/languages/mod_v8/include/javascript.hpp
+++ b/src/mod/languages/mod_v8/include/javascript.hpp
@@ -127,7 +127,7 @@
 
 /* Macro for basic script state check (to know if the script is being terminated), should be called before calling any callback actual code */
 #define JS_CHECK_SCRIPT_STATE() \
-	if (v8::V8::IsExecutionTerminating(info.GetIsolate())) return;\
+	if (info.GetIsolate()->IsExecutionTerminating()) return;\
 	if (JSMain::GetScriptInstanceFromIsolate(info.GetIsolate()) && JSMain::GetScriptInstanceFromIsolate(info.GetIsolate())->GetForcedTermination()) return
 
 /* Macro for easy unlocking an isolate on a long running c call */
diff --git a/src/mod/languages/mod_v8/mod_v8.cpp b/src/mod/languages/mod_v8/mod_v8.cpp
index 636b93e5ac..8c0d6c0bef 100644
--- a/src/mod/languages/mod_v8/mod_v8.cpp
+++ b/src/mod/languages/mod_v8/mod_v8.cpp
@@ -645,7 +645,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
 			isolate->SetData(0, js);
 
 			// New global template
-			Handle global = ObjectTemplate::New();
+			Handle global = ObjectTemplate::New(isolate);
 
 			if (global.IsEmpty()) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to create JS global object template\n");
@@ -793,7 +793,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
 							free(path);
 						}
 
-						TryCatch try_catch;
+						TryCatch try_catch(isolate);
 
 						// Compile the source code.
 #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
@@ -827,7 +827,7 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu
 							switch_mutex_lock(globals.mutex);
 							if (globals.performance_monitor) {
 								switch_time_t end = switch_time_now();
-								switch_time_t delay = (end - start);
+								unsigned int delay = (end - start);
 								switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Javascript execution time: %u microseconds\n", delay);
 							}
 							switch_mutex_unlock(globals.mutex);
diff --git a/src/mod/languages/mod_v8/src/fscoredb.cpp b/src/mod/languages/mod_v8/src/fscoredb.cpp
index b0b920df33..5af1bd5be8 100644
--- a/src/mod/languages/mod_v8/src/fscoredb.cpp
+++ b/src/mod/languages/mod_v8/src/fscoredb.cpp
@@ -396,11 +396,6 @@ JS_COREDB_GET_PROPERTY_IMPL(GetProperty)
 {
 	HandleScope handle_scope(info.GetIsolate());
 
-	if (!this) {
-		info.GetReturnValue().Set(false);
-		return;
-	}
-
 	String::Utf8Value str(property);
 
 	if (!strcmp(js_safe_str(*str), "path")) {
diff --git a/src/mod/languages/mod_v8/src/fscurl.cpp b/src/mod/languages/mod_v8/src/fscurl.cpp
index 60ad42f200..e35036b64a 100644
--- a/src/mod/languages/mod_v8/src/fscurl.cpp
+++ b/src/mod/languages/mod_v8/src/fscurl.cpp
@@ -60,7 +60,7 @@ string FSCURL::GetJSClassName()
 size_t FSCURL::FileCallback(void *ptr, size_t size, size_t nmemb, void *data)
 {
 	FSCURL *obj = static_cast(data);
-	register unsigned int realsize = (unsigned int) (size * nmemb);
+	unsigned int realsize = (unsigned int) (size * nmemb);
 	uint32_t argc = 0;
 	Handle argv[4];
 
diff --git a/src/mod/languages/mod_v8/src/fsdbh.cpp b/src/mod/languages/mod_v8/src/fsdbh.cpp
index 59bd3b8128..16f6b4f7b0 100644
--- a/src/mod/languages/mod_v8/src/fsdbh.cpp
+++ b/src/mod/languages/mod_v8/src/fsdbh.cpp
@@ -335,11 +335,6 @@ JS_DBH_GET_PROPERTY_IMPL(GetProperty)
 {
 	HandleScope handle_scope(info.GetIsolate());
 
-	if (!this) {
-		info.GetReturnValue().Set(false);
-		return;
-	}
-
 	String::Utf8Value str(property);
 
 	if (!strcmp(js_safe_str(*str), "dsn")) {
diff --git a/src/mod/languages/mod_v8/src/fsglobal.cpp b/src/mod/languages/mod_v8/src/fsglobal.cpp
index 4bea1094fb..89f94b40cb 100644
--- a/src/mod/languages/mod_v8/src/fsglobal.cpp
+++ b/src/mod/languages/mod_v8/src/fsglobal.cpp
@@ -63,7 +63,7 @@ public:
 
 size_t FSGlobal::HashCallback(void *ptr, size_t size, size_t nmemb, void *data)
 {
-	register size_t realsize = size * nmemb;
+	size_t realsize = size * nmemb;
 	char *line, lineb[2048], *nextline = NULL, *val = NULL, *p = NULL;
 	CURLCallbackData *config_data = (CURLCallbackData *)data;
 
@@ -112,7 +112,7 @@ size_t FSGlobal::HashCallback(void *ptr, size_t size, size_t nmemb, void *data)
 
 size_t FSGlobal::FileCallback(void *ptr, size_t size, size_t nmemb, void *data)
 {
-	register unsigned int realsize = (unsigned int) (size * nmemb);
+	unsigned int realsize = (unsigned int) (size * nmemb);
 	CURLCallbackData *config_data = (CURLCallbackData *)data;
 
 	if ((write(config_data->fileHandle, ptr, realsize) != (int) realsize)) {
@@ -124,7 +124,7 @@ size_t FSGlobal::FileCallback(void *ptr, size_t size, size_t nmemb, void *data)
 
 size_t FSGlobal::FetchUrlCallback(void *ptr, size_t size, size_t nmemb, void *data)
 {
-	register unsigned int realsize = (unsigned int) (size * nmemb);
+	unsigned int realsize = (unsigned int) (size * nmemb);
 	CURLCallbackData *config_data = (CURLCallbackData *)data;
 
 	/* Too much data. Do not increase buffer, but abort fetch instead. */
diff --git a/src/mod/languages/mod_v8/src/fssession.cpp b/src/mod/languages/mod_v8/src/fssession.cpp
index 644576ecf9..ca135206df 100644
--- a/src/mod/languages/mod_v8/src/fssession.cpp
+++ b/src/mod/languages/mod_v8/src/fssession.cpp
@@ -1221,28 +1221,28 @@ JS_SESSION_FUNCTION_IMPL(Ready)
 {
 	HandleScope handle_scope(info.GetIsolate());
 
-	info.GetReturnValue().Set((this && this->_session && switch_channel_ready(switch_core_session_get_channel(this->_session))) ? true : false);
+	info.GetReturnValue().Set((this->_session && switch_channel_ready(switch_core_session_get_channel(this->_session))) ? true : false);
 }
 
 JS_SESSION_FUNCTION_IMPL(MediaReady)
 {
 	HandleScope handle_scope(info.GetIsolate());
 
-	info.GetReturnValue().Set((this && this->_session && switch_channel_media_ready(switch_core_session_get_channel(this->_session))) ? true : false);
+	info.GetReturnValue().Set((this->_session && switch_channel_media_ready(switch_core_session_get_channel(this->_session))) ? true : false);
 }
 
 JS_SESSION_FUNCTION_IMPL(RingReady)
 {
 	HandleScope handle_scope(info.GetIsolate());
 
-	info.GetReturnValue().Set((this && this->_session && switch_channel_test_flag(switch_core_session_get_channel(this->_session), CF_RING_READY)) ? true : false);
+	info.GetReturnValue().Set((this->_session && switch_channel_test_flag(switch_core_session_get_channel(this->_session), CF_RING_READY)) ? true : false);
 }
 
 JS_SESSION_FUNCTION_IMPL(Answered)
 {
 	HandleScope handle_scope(info.GetIsolate());
 
-	info.GetReturnValue().Set((this && this->_session && switch_channel_test_flag(switch_core_session_get_channel(this->_session), CF_ANSWERED)) ? true : false);
+	info.GetReturnValue().Set((this->_session && switch_channel_test_flag(switch_core_session_get_channel(this->_session), CF_ANSWERED)) ? true : false);
 }
 
 JS_SESSION_FUNCTION_IMPL(WaitForMedia)
diff --git a/src/mod/languages/mod_v8/src/jsbase.cpp b/src/mod/languages/mod_v8/src/jsbase.cpp
index 4fd320f439..f3cf8fd57a 100644
--- a/src/mod/languages/mod_v8/src/jsbase.cpp
+++ b/src/mod/languages/mod_v8/src/jsbase.cpp
@@ -154,15 +154,7 @@ void JSBase::CreateInstance(const v8::FunctionCallbackInfo& args)
 	} else {
 		// Create a new C++ instance
 #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
-		Isolate *isolate = args.GetIsolate();
-		v8::Local context = isolate->GetCurrentContext();
-		v8::Local key = String::NewFromUtf8(isolate, "constructor_method");
-		v8::Local privateKey = v8::Private::ForApi(isolate, key);
-		Handle ex;
-		v8::MaybeLocal hiddenValue = args.Callee()->GetPrivate(context, privateKey);
-		if (!hiddenValue.IsEmpty()) {
-			ex = Handle::Cast(hiddenValue.ToLocalChecked());
-		}
+		Handle ex = Handle::Cast(args.Data());
 #else
 		Handle ex = Handle::Cast(args.Callee()->GetHiddenValue(String::NewFromUtf8(args.GetIsolate(), "constructor_method")));
 #endif
@@ -197,8 +189,10 @@ void JSBase::Register(Isolate *isolate, const js_class_definition_t *desc)
 	// Get the context's global scope (that's where we'll put the constructor)
 	Handle global = isolate->GetCurrentContext()->Global();
 
+	Local data = External::New(isolate, (void *)desc->constructor);
+
 	// Create function template for our constructor it will call the JSBase::createInstance method
-	Handle function = FunctionTemplate::New(isolate, JSBase::CreateInstance);
+	Handle function = FunctionTemplate::New(isolate, JSBase::CreateInstance, data);	
 	function->SetClassName(String::NewFromUtf8(isolate, desc->name));
 
 	// Make room for saving the C++ object reference somewhere
@@ -217,10 +211,6 @@ void JSBase::Register(Isolate *isolate, const js_class_definition_t *desc)
 	}
 
 #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
-	v8::Local context = isolate->GetCurrentContext();
-	v8::Local key = String::NewFromUtf8(isolate, "constructor_method");
-	v8::Local privateKey = v8::Private::ForApi(isolate, key);
-	function->GetFunction()->SetPrivate(context, privateKey, External::New(isolate, (void *)desc->constructor));
 #else
 	function->GetFunction()->SetHiddenValue(String::NewFromUtf8(isolate, "constructor_method"), External::New(isolate, (void *)desc->constructor));
 #endif
@@ -232,13 +222,14 @@ void JSBase::Register(Isolate *isolate, const js_class_definition_t *desc)
 void JSBase::RegisterInstance(Isolate *isolate, string name, bool autoDestroy)
 {
 	// Get the context's global scope (that's where we'll put the constructor)
-	Handle global = isolate->GetCurrentContext()->Global();
+	Local context = isolate->GetCurrentContext();
+	Handle global = context->Global();
 
 	Local func = Local::Cast(global->Get(v8::String::NewFromUtf8(isolate, this->GetJSClassName().c_str())));
 
 	// Add the C++ instance as an argument, so it won't try to create another one.
 	Handle args[] = { External::New(isolate, this), Boolean::New(isolate, autoDestroy) };
-	Handle newObj = func->NewInstance(2, args);
+	Handle newObj = func->NewInstance(context, 2, args).ToLocalChecked();
 
 	// Add the instance to JavaScript.
 	if (name.size() > 0) {
diff --git a/src/mod/languages/mod_v8/src/jsmain.cpp b/src/mod/languages/mod_v8/src/jsmain.cpp
index e162460df2..86fed7b27f 100644
--- a/src/mod/languages/mod_v8/src/jsmain.cpp
+++ b/src/mod/languages/mod_v8/src/jsmain.cpp
@@ -209,7 +209,7 @@ const string JSMain::GetExceptionInfo(Isolate* isolate, TryCatch* try_catch)
 			ss << " ";
 		}
 
-		int end = message->GetEndColumn();
+		int32_t end = message->GetEndColumn(isolate->GetCurrentContext()).FromMaybe(0);
 
 		for (int i = start; i < end; i++) {
 			ss << "^";
@@ -292,7 +292,7 @@ const string JSMain::ExecuteString(const string& scriptData, const string& fileN
 
 			isolate->SetData(0, this);
 
-			Handle global = ObjectTemplate::New();
+			Handle global = ObjectTemplate::New(isolate);
 			global->Set(String::NewFromUtf8(isolate, "include"), FunctionTemplate::New(isolate, Include));
 			global->Set(String::NewFromUtf8(isolate, "require"), FunctionTemplate::New(isolate, Include));
 			global->Set(String::NewFromUtf8(isolate, "log"), FunctionTemplate::New(isolate, Log));
@@ -323,7 +323,7 @@ const string JSMain::ExecuteString(const string& scriptData, const string& fileN
 				inst->obj->RegisterInstance(isolate, inst->name, inst->auto_destroy);
 			}
 
-			TryCatch try_catch;
+			TryCatch try_catch(isolate);
 
 			// Compile the source code.
 #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
@@ -583,7 +583,7 @@ void JSMain::ExitScript(Isolate *isolate, const char *msg)
 		js->forcedTerminationScriptFile = GetStackInfo(isolate, &js->forcedTerminationLineNumber);
 	}
 
-	V8::TerminateExecution(isolate);
+	isolate->TerminateExecution();
 }
 
 char *JSMain::GetStackInfo(Isolate *isolate, int *lineNumber)

From dc95ee3d669c9c5028ba7ceb26c6b746a36c8717 Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Thu, 3 May 2018 20:02:16 -0400
Subject: [PATCH 214/264] Revert "FS-11052: Allow alias for crypto suites"

This reverts commit 7cc6d5f99d16d2d63cb2548dd7b8345d579b7e9f.
---
 src/include/switch_rtp.h |  1 -
 src/switch_core_media.c  | 54 ++++++++++++++++++----------------------
 2 files changed, 24 insertions(+), 31 deletions(-)

diff --git a/src/include/switch_rtp.h b/src/include/switch_rtp.h
index 41e8637683..5566d36ff6 100644
--- a/src/include/switch_rtp.h
+++ b/src/include/switch_rtp.h
@@ -65,7 +65,6 @@ typedef enum {
 
 typedef struct switch_srtp_crypto_suite_s {
 	char *name;
-	const char *alias;
 	switch_rtp_crypto_key_type_t type;
 	int keysalt_len;
 	int salt_len;
diff --git a/src/switch_core_media.c b/src/switch_core_media.c
index 1963a77954..4591bfc2f5 100644
--- a/src/switch_core_media.c
+++ b/src/switch_core_media.c
@@ -273,15 +273,15 @@ struct switch_media_handle_s {
 };
 
 switch_srtp_crypto_suite_t SUITES[CRYPTO_INVALID] = {
-	{ "AEAD_AES_256_GCM_8", "", AEAD_AES_256_GCM_8, 44, 12},
-	{ "AEAD_AES_128_GCM_8", "", AEAD_AES_128_GCM_8, 28, 12},
-	{ "AES_256_CM_HMAC_SHA1_80", "AES_CM_256_HMAC_SHA1_80", AES_CM_256_HMAC_SHA1_80, 46, 14},
-	{ "AES_192_CM_HMAC_SHA1_80", "AES_CM_192_HMAC_SHA1_80", AES_CM_192_HMAC_SHA1_80, 38, 14},
-	{ "AES_CM_128_HMAC_SHA1_80", "", AES_CM_128_HMAC_SHA1_80, 30, 14},
-	{ "AES_256_CM_HMAC_SHA1_32", "AES_CM_256_HMAC_SHA1_32", AES_CM_256_HMAC_SHA1_32, 46, 14},
-	{ "AES_192_CM_HMAC_SHA1_32", "AES_CM_192_HMAC_SHA1_32", AES_CM_192_HMAC_SHA1_32, 38, 14},
-	{ "AES_CM_128_HMAC_SHA1_32", "", AES_CM_128_HMAC_SHA1_32, 30, 14},
-	{ "AES_CM_128_NULL_AUTH", "", AES_CM_128_NULL_AUTH, 30, 14}
+	{ "AEAD_AES_256_GCM_8", AEAD_AES_256_GCM_8, 44, 12},
+	{ "AEAD_AES_128_GCM_8", AEAD_AES_128_GCM_8, 28, 12},
+	{ "AES_CM_256_HMAC_SHA1_80", AES_CM_256_HMAC_SHA1_80, 46, 14},
+	{ "AES_CM_192_HMAC_SHA1_80", AES_CM_192_HMAC_SHA1_80, 38, 14},
+	{ "AES_CM_128_HMAC_SHA1_80", AES_CM_128_HMAC_SHA1_80, 30, 14},
+	{ "AES_CM_256_HMAC_SHA1_32", AES_CM_256_HMAC_SHA1_32, 46, 14},
+	{ "AES_CM_192_HMAC_SHA1_32", AES_CM_192_HMAC_SHA1_32, 38, 14},
+	{ "AES_CM_128_HMAC_SHA1_32", AES_CM_128_HMAC_SHA1_32, 30, 14},
+	{ "AES_CM_128_NULL_AUTH", AES_CM_128_NULL_AUTH, 30, 14}
 };
 
 SWITCH_DECLARE(switch_rtp_crypto_key_type_t) switch_core_media_crypto_str2type(const char *str)
@@ -289,7 +289,7 @@ SWITCH_DECLARE(switch_rtp_crypto_key_type_t) switch_core_media_crypto_str2type(c
 	int i;
 
 	for (i = 0; i < CRYPTO_INVALID; i++) {
-		if (!strncasecmp(str, SUITES[i].name, strlen(SUITES[i].name)) || (SUITES[i].alias && !strncasecmp(str, SUITES[i].alias, strlen(SUITES[i].alias)))) {
+		if (!strncasecmp(str, SUITES[i].name, strlen(SUITES[i].name))) {
 			return SUITES[i].type;
 		}
 	}
@@ -1140,12 +1140,10 @@ SWITCH_DECLARE(void) switch_core_media_parse_rtp_bugs(switch_rtp_bug_flag_t *fla
 	}
 }
 
-/**
- * If @use_alias != 0 then send crypto with alias name instead of name.
- */ 
+
 static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh,
 													  switch_media_type_t type,
-													  int index, switch_rtp_crypto_key_type_t ctype, switch_rtp_crypto_direction_t direction, int force, int use_alias)
+													  int index, switch_rtp_crypto_key_type_t ctype, switch_rtp_crypto_direction_t direction, int force)
 {
 	unsigned char b64_key[512] = "";
 	unsigned char *key;
@@ -1198,9 +1196,9 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh
 	if (index == SWITCH_NO_CRYPTO_TAG) index = ctype + 1;
 
 	if (switch_channel_var_true(channel, "rtp_secure_media_mki")) {	
-		engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s|2^31|1:1", index, (use_alias ? SUITES[ctype].alias : SUITES[ctype].name), b64_key);
+		engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s|2^31|1:1", index, SUITES[ctype].name, b64_key);
 	} else {
-		engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s", index, (use_alias ? SUITES[ctype].alias : SUITES[ctype].name), b64_key);
+		engine->ssec[ctype].local_crypto_key = switch_core_session_sprintf(smh->session, "%d %s inline:%s", index, SUITES[ctype].name, b64_key);
 	}
 
 	switch_channel_set_variable_name_printf(smh->session->channel, engine->ssec[ctype].local_crypto_key, "rtp_last_%s_local_crypto_key", type2str(type));
@@ -1220,6 +1218,7 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh
 	return SWITCH_STATUS_SUCCESS;
 }
 
+
 #define CRYPTO_KEY_MATERIAL_LIFETIME_MKI_ERR	0x0u
 #define CRYPTO_KEY_MATERIAL_MKI					0x1u
 #define CRYPTO_KEY_MATERIAL_LIFETIME			0x2u
@@ -1772,6 +1771,8 @@ static void switch_core_session_parse_crypto_prefs(switch_core_session_t *sessio
 	}
 }
 
+
+
 SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_session_t *session,
 															   const char *varname,
 															  switch_media_type_t type, const char *crypto, int crypto_tag, switch_sdp_type_t sdp_type)
@@ -1780,7 +1781,6 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio
 	int i = 0;
 	int ctype = 0;
 	const char *vval = NULL;
-	int use_alias = 0;
 	switch_rtp_engine_t *engine;
 	switch_media_handle_t *smh;
 
@@ -1801,21 +1801,15 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio
 	for (i = 0; smh->crypto_suite_order[i] != CRYPTO_INVALID; i++) {
 		switch_rtp_crypto_key_type_t j = SUITES[smh->crypto_suite_order[i]].type;
 
-		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "looking for crypto suite [%s]alias=[%s] in [%s]\n", SUITES[j].name, SUITES[j].alias, crypto);
+		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "looking for crypto suite [%s] in [%s]\n", SUITES[j].name, crypto);
 
-		if (switch_stristr(SUITES[j].alias, crypto)) {
-			use_alias = 1;
-		}
-		
-		if (use_alias || switch_stristr(SUITES[j].name, crypto)) {
+		if (switch_stristr(SUITES[j].name, crypto)) {
 			ctype = SUITES[j].type;
 			vval = SUITES[j].name;
 			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Found suite %s\n", vval);
 			switch_channel_set_variable(session->channel, "rtp_secure_media_negotiated", vval);
 			break;
 		}
-
-		use_alias = 0;
 	}
 
 	if (engine->ssec[engine->crypto_type].remote_crypto_key && switch_rtp_ready(engine->rtp_session)) {
@@ -1834,7 +1828,7 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio
 				}
 				switch_channel_set_variable(session->channel, varname, vval);
 
-				switch_core_media_build_crypto(session->media_handle, type, crypto_tag, ctype, SWITCH_RTP_CRYPTO_SEND, 1, use_alias);
+				switch_core_media_build_crypto(session->media_handle, type, crypto_tag, ctype, SWITCH_RTP_CRYPTO_SEND, 1);
 				switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_SEND, atoi(crypto), &engine->ssec[engine->crypto_type]);
 			}
 
@@ -1899,7 +1893,7 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio
 		switch_channel_set_flag(smh->session->channel, CF_SECURE);
 
 		if (zstr(engine->ssec[engine->crypto_type].local_crypto_key)) {
-			switch_core_media_build_crypto(session->media_handle, type, crypto_tag, ctype, SWITCH_RTP_CRYPTO_SEND, 1, use_alias);
+			switch_core_media_build_crypto(session->media_handle, type, crypto_tag, ctype, SWITCH_RTP_CRYPTO_SEND, 1);
 		}
 	}
 
@@ -1935,13 +1929,13 @@ SWITCH_DECLARE(void) switch_core_session_check_outgoing_crypto(switch_core_sessi
 
 	for (i = 0; smh->crypto_suite_order[i] != CRYPTO_INVALID; i++) {
 		switch_core_media_build_crypto(session->media_handle,
-									   SWITCH_MEDIA_TYPE_AUDIO, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0, 0);
+									   SWITCH_MEDIA_TYPE_AUDIO, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0);
 
 		switch_core_media_build_crypto(session->media_handle,
-									   SWITCH_MEDIA_TYPE_VIDEO, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0, 0);
+									   SWITCH_MEDIA_TYPE_VIDEO, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0);
 
 		switch_core_media_build_crypto(session->media_handle,
-									   SWITCH_MEDIA_TYPE_TEXT, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0, 0);
+									   SWITCH_MEDIA_TYPE_TEXT, SWITCH_NO_CRYPTO_TAG, smh->crypto_suite_order[i], SWITCH_RTP_CRYPTO_SEND, 0);
 	}
 
 }

From ca9a62c53949a75b4f8c7119c072e4611839373f Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Mon, 7 May 2018 22:58:07 -0400
Subject: [PATCH 215/264] FS-11119: [core] Fix video skew on oddly resized
 conference layers

---
 src/switch_core_video.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/switch_core_video.c b/src/switch_core_video.c
index 69e8f25032..66cbc6279f 100644
--- a/src/switch_core_video.c
+++ b/src/switch_core_video.c
@@ -532,18 +532,28 @@ SWITCH_DECLARE(void) switch_img_patch(switch_image_t *IMG, switch_image_t *img,
 SWITCH_DECLARE(void) switch_img_patch_rect(switch_image_t *IMG, int X, int Y, switch_image_t *img, uint32_t x, uint32_t y, uint32_t w, uint32_t h)
 {
 #ifdef SWITCH_HAVE_VPX
-	switch_image_t *tmp;
+	switch_image_t *tmp = NULL;
 	uint8_t *data;
 
 	if (x >= img->d_w || y >= img->d_h) return;
 
+	if (w == img->d_w && h == img->d_h) {
+		switch_img_patch(IMG, img, X, Y);
+		return;
+	}
+
 	if (!(img->fmt & SWITCH_IMG_FMT_PLANAR)) {
 		data = img->planes[SWITCH_PLANE_PACKED];
 	} else {
 		data = img->planes[SWITCH_PLANE_Y];
 	}
 
-	tmp = (switch_image_t *)vpx_img_wrap(NULL, img->fmt, img->d_w, img->d_h, 1, data);
+	if (img->d_w == img->stride[0]) {
+		tmp = (switch_image_t *)vpx_img_wrap(NULL, img->fmt, img->d_w, img->d_h, 1, data);
+	} else {
+		switch_img_copy(img, &tmp);
+	}
+
 	if (!tmp) return;
 
 	w = MIN(img->d_w - x, w);

From e7ff9036293ed0209217e3dd6d01be65ec75b626 Mon Sep 17 00:00:00 2001
From: Andrey Volk 
Date: Wed, 9 May 2018 18:47:29 +0300
Subject: [PATCH 216/264] FS-11150: [Build-System] Fix broken ESL in .Net
 project.

---
 Freeswitch.2015.sln                           |   2 +-
 libs/esl/fs_cli.2010.vcxproj.filters          |  40 -
 libs/esl/fs_cli.2015.vcxproj                  |   2 +-
 libs/esl/managed/.gitignore                   |   3 +
 libs/esl/managed/ESL.2010.vcxproj.filters     |  30 -
 libs/esl/managed/ESL.cs                       |  16 +-
 libs/esl/managed/ESLPINVOKE.2010.cs           | 331 ------
 libs/esl/managed/ESLPINVOKE.2015.cs           | 330 ++++++
 libs/esl/managed/ESLPINVOKE.cs                |  16 +-
 libs/esl/managed/ESLconnection.2015.cs        | 157 +++
 libs/esl/managed/ESLconnection.cs             |  16 +-
 .../{ESLevent.2010.cs => ESLevent.2015.cs}    | 287 +++---
 libs/esl/managed/ESLevent.cs                  |  16 +-
 libs/esl/managed/ManagedEsl.2010.csproj       |  93 --
 ...Esl.2012.csproj => ManagedEsl.2015.csproj} | 188 ++--
 ...naged_esl.2012.sln => ManagedEsl.2015.sln} | 127 ++-
 libs/esl/managed/ManagedEsl.csproj            |  56 -
 libs/esl/managed/ManagedEslTest/.gitignore    |   1 +
 .../ManagedEslTest/ManagedEslTest.2010.csproj |  99 --
 ...2012.csproj => ManagedEslTest.2015.csproj} | 200 ++--
 .../ManagedEslTest/ManagedEslTest.csproj      |  58 --
 .../ManagedEslTest/Properties/AssemblyInfo.cs |   2 +-
 libs/esl/managed/Properties/AssemblyInfo.cs   |   2 +-
 .../managed/SWIGTYPE_p_esl_event_t.2010.cs    |  27 -
 .../managed/SWIGTYPE_p_esl_event_t.2015.cs    |  26 +
 libs/esl/managed/SWIGTYPE_p_esl_event_t.cs    |  16 +-
 .../managed/SWIGTYPE_p_esl_priority_t.2010.cs |  27 -
 .../managed/SWIGTYPE_p_esl_priority_t.2015.cs |  26 +
 libs/esl/managed/SWIGTYPE_p_esl_priority_t.cs |  16 +-
 libs/esl/managed/esl.2010.cs                  |  18 -
 libs/esl/managed/esl.2015.cs                  |  17 +
 libs/esl/managed/esl.2015.vcxproj             | 216 ++++
 libs/esl/managed/esl_wrap.2015.cpp            | 967 ++++++++++++++++++
 libs/esl/managed/esl_wrap.cpp                 |  27 +-
 libs/esl/managed/managed_esl.2008.sln         |  60 --
 libs/esl/managed/managed_esl.2010.sln         |  52 -
 .../{runswig.2010.cmd => runswig.2015.cmd}    |  50 +-
 libs/esl/src/esl.2010.vcxproj.filters         |  47 -
 .../{esl.2015.vcxproj => libesl.2015.vcxproj} | 316 +++---
 .../mod_hash/mod_hash.2015.vcxproj            |   2 +-
 40 files changed, 2422 insertions(+), 1560 deletions(-)
 delete mode 100644 libs/esl/fs_cli.2010.vcxproj.filters
 create mode 100644 libs/esl/managed/.gitignore
 delete mode 100644 libs/esl/managed/ESL.2010.vcxproj.filters
 delete mode 100644 libs/esl/managed/ESLPINVOKE.2010.cs
 create mode 100644 libs/esl/managed/ESLPINVOKE.2015.cs
 create mode 100644 libs/esl/managed/ESLconnection.2015.cs
 rename libs/esl/managed/{ESLevent.2010.cs => ESLevent.2015.cs} (70%)
 delete mode 100644 libs/esl/managed/ManagedEsl.2010.csproj
 rename libs/esl/managed/{ManagedEsl.2012.csproj => ManagedEsl.2015.csproj} (89%)
 rename libs/esl/managed/{managed_esl.2012.sln => ManagedEsl.2015.sln} (50%)
 delete mode 100644 libs/esl/managed/ManagedEsl.csproj
 create mode 100644 libs/esl/managed/ManagedEslTest/.gitignore
 delete mode 100644 libs/esl/managed/ManagedEslTest/ManagedEslTest.2010.csproj
 rename libs/esl/managed/ManagedEslTest/{ManagedEslTest.2012.csproj => ManagedEslTest.2015.csproj} (93%)
 delete mode 100644 libs/esl/managed/ManagedEslTest/ManagedEslTest.csproj
 delete mode 100644 libs/esl/managed/SWIGTYPE_p_esl_event_t.2010.cs
 create mode 100644 libs/esl/managed/SWIGTYPE_p_esl_event_t.2015.cs
 delete mode 100644 libs/esl/managed/SWIGTYPE_p_esl_priority_t.2010.cs
 create mode 100644 libs/esl/managed/SWIGTYPE_p_esl_priority_t.2015.cs
 delete mode 100644 libs/esl/managed/esl.2010.cs
 create mode 100644 libs/esl/managed/esl.2015.cs
 create mode 100644 libs/esl/managed/esl.2015.vcxproj
 create mode 100644 libs/esl/managed/esl_wrap.2015.cpp
 delete mode 100644 libs/esl/managed/managed_esl.2008.sln
 delete mode 100644 libs/esl/managed/managed_esl.2010.sln
 rename libs/esl/managed/{runswig.2010.cmd => runswig.2015.cmd} (50%)
 delete mode 100644 libs/esl/src/esl.2010.vcxproj.filters
 rename libs/esl/src/{esl.2015.vcxproj => libesl.2015.vcxproj} (96%)

diff --git a/Freeswitch.2015.sln b/Freeswitch.2015.sln
index add8584eac..f8eabfd0a0 100644
--- a/Freeswitch.2015.sln
+++ b/Freeswitch.2015.sln
@@ -359,7 +359,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg722_1", "libs\win32\lib
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_siren", "src\mod\codecs\mod_siren\mod_siren.2015.vcxproj", "{0B6C905B-142E-4999-B39D-92FF7951E921}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esl", "libs\esl\src\esl.2015.vcxproj", "{CF405366-9558-4AE8-90EF-5E21B51CCB4E}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libesl", "libs\esl\src\libesl.2015.vcxproj", "{CF405366-9558-4AE8-90EF-5E21B51CCB4E}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fs_cli", "libs\esl\fs_cli.2015.vcxproj", "{D2FB8043-D208-4AEE-8F18-3B5857C871B9}"
 	ProjectSection(ProjectDependencies) = postProject
diff --git a/libs/esl/fs_cli.2010.vcxproj.filters b/libs/esl/fs_cli.2010.vcxproj.filters
deleted file mode 100644
index cd2e7a6bf7..0000000000
--- a/libs/esl/fs_cli.2010.vcxproj.filters
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-  
-  
-    
-      Version Files
-    
-  
-  
-    
-      Version Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/esl/fs_cli.2015.vcxproj b/libs/esl/fs_cli.2015.vcxproj
index 2692248736..9eeb01a1b0 100644
--- a/libs/esl/fs_cli.2015.vcxproj
+++ b/libs/esl/fs_cli.2015.vcxproj
@@ -203,7 +203,7 @@
     
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
     
-    
+    
       {cf405366-9558-4ae8-90ef-5e21b51ccb4e}
       false
     
diff --git a/libs/esl/managed/.gitignore b/libs/esl/managed/.gitignore
new file mode 100644
index 0000000000..4e46876e20
--- /dev/null
+++ b/libs/esl/managed/.gitignore
@@ -0,0 +1,3 @@
+swig/
+*.VC.db
+*.VC.VC.opendb
diff --git a/libs/esl/managed/ESL.2010.vcxproj.filters b/libs/esl/managed/ESL.2010.vcxproj.filters
deleted file mode 100644
index dfdab8436a..0000000000
--- a/libs/esl/managed/ESL.2010.vcxproj.filters
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-    
-      {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
-      rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/esl/managed/ESL.cs b/libs/esl/managed/ESL.cs
index 870e86b840..27de939b10 100644
--- a/libs/esl/managed/ESL.cs
+++ b/libs/esl/managed/ESL.cs
@@ -1,10 +1,12 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
 
 
 public class ESL {
diff --git a/libs/esl/managed/ESLPINVOKE.2010.cs b/libs/esl/managed/ESLPINVOKE.2010.cs
deleted file mode 100644
index ec6c9637a8..0000000000
--- a/libs/esl/managed/ESLPINVOKE.2010.cs
+++ /dev/null
@@ -1,331 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-
-using System;
-using System.Runtime.InteropServices;
-
-class ESLPINVOKE {
-
-  protected class SWIGExceptionHelper {
-
-    public delegate void ExceptionDelegate(string message);
-    public delegate void ExceptionArgumentDelegate(string message, string paramName);
-
-    static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException);
-    static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException);
-    static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException);
-    static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException);
-    static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException);
-    static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException);
-    static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException);
-    static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException);
-    static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException);
-    static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException);
-    static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException);
-
-    static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException);
-    static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException);
-    static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException);
-
-    [DllImport("ESL", EntryPoint="SWIGRegisterExceptionCallbacks_ESL")]
-    public static extern void SWIGRegisterExceptionCallbacks_ESL(
-                                ExceptionDelegate applicationDelegate,
-                                ExceptionDelegate arithmeticDelegate,
-                                ExceptionDelegate divideByZeroDelegate, 
-                                ExceptionDelegate indexOutOfRangeDelegate, 
-                                ExceptionDelegate invalidCastDelegate,
-                                ExceptionDelegate invalidOperationDelegate,
-                                ExceptionDelegate ioDelegate,
-                                ExceptionDelegate nullReferenceDelegate,
-                                ExceptionDelegate outOfMemoryDelegate, 
-                                ExceptionDelegate overflowDelegate, 
-                                ExceptionDelegate systemExceptionDelegate);
-
-    [DllImport("ESL", EntryPoint="SWIGRegisterExceptionArgumentCallbacks_ESL")]
-    public static extern void SWIGRegisterExceptionCallbacksArgument_ESL(
-                                ExceptionArgumentDelegate argumentDelegate,
-                                ExceptionArgumentDelegate argumentNullDelegate,
-                                ExceptionArgumentDelegate argumentOutOfRangeDelegate);
-
-    static void SetPendingApplicationException(string message) {
-      SWIGPendingException.Set(new System.ApplicationException(message, SWIGPendingException.Retrieve()));
-    }
-    static void SetPendingArithmeticException(string message) {
-      SWIGPendingException.Set(new System.ArithmeticException(message, SWIGPendingException.Retrieve()));
-    }
-    static void SetPendingDivideByZeroException(string message) {
-      SWIGPendingException.Set(new System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
-    }
-    static void SetPendingIndexOutOfRangeException(string message) {
-      SWIGPendingException.Set(new System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
-    }
-    static void SetPendingInvalidCastException(string message) {
-      SWIGPendingException.Set(new System.InvalidCastException(message, SWIGPendingException.Retrieve()));
-    }
-    static void SetPendingInvalidOperationException(string message) {
-      SWIGPendingException.Set(new System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
-    }
-    static void SetPendingIOException(string message) {
-      SWIGPendingException.Set(new System.IO.IOException(message, SWIGPendingException.Retrieve()));
-    }
-    static void SetPendingNullReferenceException(string message) {
-      SWIGPendingException.Set(new System.NullReferenceException(message, SWIGPendingException.Retrieve()));
-    }
-    static void SetPendingOutOfMemoryException(string message) {
-      SWIGPendingException.Set(new System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
-    }
-    static void SetPendingOverflowException(string message) {
-      SWIGPendingException.Set(new System.OverflowException(message, SWIGPendingException.Retrieve()));
-    }
-    static void SetPendingSystemException(string message) {
-      SWIGPendingException.Set(new System.SystemException(message, SWIGPendingException.Retrieve()));
-    }
-
-    static void SetPendingArgumentException(string message, string paramName) {
-      SWIGPendingException.Set(new System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
-    }
-    static void SetPendingArgumentNullException(string message, string paramName) {
-      Exception e = SWIGPendingException.Retrieve();
-      if (e != null) message = message + " Inner Exception: " + e.Message;
-      SWIGPendingException.Set(new System.ArgumentNullException(paramName, message));
-    }
-    static void SetPendingArgumentOutOfRangeException(string message, string paramName) {
-      Exception e = SWIGPendingException.Retrieve();
-      if (e != null) message = message + " Inner Exception: " + e.Message;
-      SWIGPendingException.Set(new System.ArgumentOutOfRangeException(paramName, message));
-    }
-
-    static SWIGExceptionHelper() {
-      SWIGRegisterExceptionCallbacks_ESL(
-                                applicationDelegate,
-                                arithmeticDelegate,
-                                divideByZeroDelegate,
-                                indexOutOfRangeDelegate,
-                                invalidCastDelegate,
-                                invalidOperationDelegate,
-                                ioDelegate,
-                                nullReferenceDelegate,
-                                outOfMemoryDelegate,
-                                overflowDelegate,
-                                systemDelegate);
-
-      SWIGRegisterExceptionCallbacksArgument_ESL(
-                                argumentDelegate,
-                                argumentNullDelegate,
-                                argumentOutOfRangeDelegate);
-    }
-  }
-
-  protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();
-
-  public class SWIGPendingException {
-    [ThreadStatic]
-    private static Exception pendingException = null;
-    private static int numExceptionsPending = 0;
-
-    public static bool Pending {
-      get {
-        bool pending = false;
-        if (numExceptionsPending > 0)
-          if (pendingException != null)
-            pending = true;
-        return pending;
-      } 
-    }
-
-    public static void Set(Exception e) {
-      if (pendingException != null)
-        throw new ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e);
-      pendingException = e;
-      lock(typeof(ESLPINVOKE)) {
-        numExceptionsPending++;
-      }
-    }
-
-    public static Exception Retrieve() {
-      Exception e = null;
-      if (numExceptionsPending > 0) {
-        if (pendingException != null) {
-          e = pendingException;
-          pendingException = null;
-          lock(typeof(ESLPINVOKE)) {
-            numExceptionsPending--;
-          }
-        }
-      }
-      return e;
-    }
-  }
-
-
-  protected class SWIGStringHelper {
-
-    public delegate string SWIGStringDelegate(string message);
-    static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString);
-
-    [DllImport("ESL", EntryPoint="SWIGRegisterStringCallback_ESL")]
-    public static extern void SWIGRegisterStringCallback_ESL(SWIGStringDelegate stringDelegate);
-
-    static string CreateString(string cString) {
-      return cString;
-    }
-
-    static SWIGStringHelper() {
-      SWIGRegisterStringCallback_ESL(stringDelegate);
-    }
-  }
-
-  static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper();
-
-
-  static ESLPINVOKE() {
-  }
-
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_Event_set")]
-  public static extern void ESLevent_Event_set(HandleRef jarg1, HandleRef jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_Event_get")]
-  public static extern IntPtr ESLevent_Event_get(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_SerializedString_set")]
-  public static extern void ESLevent_SerializedString_set(HandleRef jarg1, string jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_SerializedString_get")]
-  public static extern string ESLevent_SerializedString_get(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_Mine_set")]
-  public static extern void ESLevent_Mine_set(HandleRef jarg1, int jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_Mine_get")]
-  public static extern int ESLevent_Mine_get(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_new_ESLevent__SWIG_0")]
-  public static extern IntPtr new_ESLevent__SWIG_0(string jarg1, string jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_new_ESLevent__SWIG_1")]
-  public static extern IntPtr new_ESLevent__SWIG_1(HandleRef jarg1, int jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_new_ESLevent__SWIG_2")]
-  public static extern IntPtr new_ESLevent__SWIG_2(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_delete_ESLevent")]
-  public static extern void delete_ESLevent(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_Serialize")]
-  public static extern string ESLevent_Serialize(HandleRef jarg1, string jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_SetPriority")]
-  public static extern bool ESLevent_SetPriority(HandleRef jarg1, HandleRef jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_GetHeader")]
-  public static extern string ESLevent_GetHeader(HandleRef jarg1, string jarg2, int jarg3);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_GetBody")]
-  public static extern string ESLevent_GetBody(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_getType")]
-  public static extern string ESLevent_getType(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_AddBody")]
-  public static extern bool ESLevent_AddBody(HandleRef jarg1, string jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_AddHeader")]
-  public static extern bool ESLevent_AddHeader(HandleRef jarg1, string jarg2, string jarg3);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_pushHeader")]
-  public static extern bool ESLevent_pushHeader(HandleRef jarg1, string jarg2, string jarg3);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_unshiftHeader")]
-  public static extern bool ESLevent_unshiftHeader(HandleRef jarg1, string jarg2, string jarg3);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_DelHeader")]
-  public static extern bool ESLevent_DelHeader(HandleRef jarg1, string jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_FirstHeader")]
-  public static extern string ESLevent_FirstHeader(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLevent_NextHeader")]
-  public static extern string ESLevent_NextHeader(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_0")]
-  public static extern IntPtr new_ESLconnection__SWIG_0(string jarg1, int jarg2, string jarg3, string jarg4);
-
-  [DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_1")]
-  public static extern IntPtr new_ESLconnection__SWIG_1(string jarg1, int jarg2, string jarg3);
-
-  [DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_2")]
-  public static extern IntPtr new_ESLconnection__SWIG_2(string jarg1, string jarg2, string jarg3, string jarg4);
-
-  [DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_3")]
-  public static extern IntPtr new_ESLconnection__SWIG_3(string jarg1, string jarg2, string jarg3);
-
-  [DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_4")]
-  public static extern IntPtr new_ESLconnection__SWIG_4(int jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_delete_ESLconnection")]
-  public static extern void delete_ESLconnection(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_SocketDescriptor")]
-  public static extern int ESLconnection_SocketDescriptor(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_Connected")]
-  public static extern int ESLconnection_Connected(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_GetInfo")]
-  public static extern IntPtr ESLconnection_GetInfo(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_Send")]
-  public static extern int ESLconnection_Send(HandleRef jarg1, string jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_SendRecv")]
-  public static extern IntPtr ESLconnection_SendRecv(HandleRef jarg1, string jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_Api")]
-  public static extern IntPtr ESLconnection_Api(HandleRef jarg1, string jarg2, string jarg3);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_Bgapi")]
-  public static extern IntPtr ESLconnection_Bgapi(HandleRef jarg1, string jarg2, string jarg3, string jarg4);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_SendEvent")]
-  public static extern IntPtr ESLconnection_SendEvent(HandleRef jarg1, HandleRef jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_sendMSG")]
-  public static extern int ESLconnection_sendMSG(HandleRef jarg1, HandleRef jarg2, string jarg3);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_RecvEvent")]
-  public static extern IntPtr ESLconnection_RecvEvent(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_RecvEventTimed")]
-  public static extern IntPtr ESLconnection_RecvEventTimed(HandleRef jarg1, int jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_Filter")]
-  public static extern IntPtr ESLconnection_Filter(HandleRef jarg1, string jarg2, string jarg3);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_Events")]
-  public static extern int ESLconnection_Events(HandleRef jarg1, string jarg2, string jarg3);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_Execute")]
-  public static extern IntPtr ESLconnection_Execute(HandleRef jarg1, string jarg2, string jarg3, string jarg4);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_ExecuteAsync")]
-  public static extern IntPtr ESLconnection_ExecuteAsync(HandleRef jarg1, string jarg2, string jarg3, string jarg4);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_SetAsyncExecute")]
-  public static extern int ESLconnection_SetAsyncExecute(HandleRef jarg1, string jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_SetEventLock")]
-  public static extern int ESLconnection_SetEventLock(HandleRef jarg1, string jarg2);
-
-  [DllImport("ESL", EntryPoint="CSharp_ESLconnection_Disconnect")]
-  public static extern int ESLconnection_Disconnect(HandleRef jarg1);
-
-  [DllImport("ESL", EntryPoint="CSharp_eslSetLogLevel")]
-  public static extern void eslSetLogLevel(int jarg1);
-}
diff --git a/libs/esl/managed/ESLPINVOKE.2015.cs b/libs/esl/managed/ESLPINVOKE.2015.cs
new file mode 100644
index 0000000000..cf8082d436
--- /dev/null
+++ b/libs/esl/managed/ESLPINVOKE.2015.cs
@@ -0,0 +1,330 @@
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
+
+
+class ESLPINVOKE {
+
+  protected class SWIGExceptionHelper {
+
+    public delegate void ExceptionDelegate(string message);
+    public delegate void ExceptionArgumentDelegate(string message, string paramName);
+
+    static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException);
+    static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException);
+    static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException);
+    static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException);
+    static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException);
+    static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException);
+    static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException);
+    static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException);
+    static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException);
+    static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException);
+    static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException);
+
+    static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException);
+    static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException);
+    static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException);
+
+    [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="SWIGRegisterExceptionCallbacks_ESL")]
+    public static extern void SWIGRegisterExceptionCallbacks_ESL(
+                                ExceptionDelegate applicationDelegate,
+                                ExceptionDelegate arithmeticDelegate,
+                                ExceptionDelegate divideByZeroDelegate, 
+                                ExceptionDelegate indexOutOfRangeDelegate, 
+                                ExceptionDelegate invalidCastDelegate,
+                                ExceptionDelegate invalidOperationDelegate,
+                                ExceptionDelegate ioDelegate,
+                                ExceptionDelegate nullReferenceDelegate,
+                                ExceptionDelegate outOfMemoryDelegate, 
+                                ExceptionDelegate overflowDelegate, 
+                                ExceptionDelegate systemExceptionDelegate);
+
+    [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="SWIGRegisterExceptionArgumentCallbacks_ESL")]
+    public static extern void SWIGRegisterExceptionCallbacksArgument_ESL(
+                                ExceptionArgumentDelegate argumentDelegate,
+                                ExceptionArgumentDelegate argumentNullDelegate,
+                                ExceptionArgumentDelegate argumentOutOfRangeDelegate);
+
+    static void SetPendingApplicationException(string message) {
+      SWIGPendingException.Set(new global::System.ApplicationException(message, SWIGPendingException.Retrieve()));
+    }
+    static void SetPendingArithmeticException(string message) {
+      SWIGPendingException.Set(new global::System.ArithmeticException(message, SWIGPendingException.Retrieve()));
+    }
+    static void SetPendingDivideByZeroException(string message) {
+      SWIGPendingException.Set(new global::System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
+    }
+    static void SetPendingIndexOutOfRangeException(string message) {
+      SWIGPendingException.Set(new global::System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
+    }
+    static void SetPendingInvalidCastException(string message) {
+      SWIGPendingException.Set(new global::System.InvalidCastException(message, SWIGPendingException.Retrieve()));
+    }
+    static void SetPendingInvalidOperationException(string message) {
+      SWIGPendingException.Set(new global::System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
+    }
+    static void SetPendingIOException(string message) {
+      SWIGPendingException.Set(new global::System.IO.IOException(message, SWIGPendingException.Retrieve()));
+    }
+    static void SetPendingNullReferenceException(string message) {
+      SWIGPendingException.Set(new global::System.NullReferenceException(message, SWIGPendingException.Retrieve()));
+    }
+    static void SetPendingOutOfMemoryException(string message) {
+      SWIGPendingException.Set(new global::System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
+    }
+    static void SetPendingOverflowException(string message) {
+      SWIGPendingException.Set(new global::System.OverflowException(message, SWIGPendingException.Retrieve()));
+    }
+    static void SetPendingSystemException(string message) {
+      SWIGPendingException.Set(new global::System.SystemException(message, SWIGPendingException.Retrieve()));
+    }
+
+    static void SetPendingArgumentException(string message, string paramName) {
+      SWIGPendingException.Set(new global::System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
+    }
+    static void SetPendingArgumentNullException(string message, string paramName) {
+      global::System.Exception e = SWIGPendingException.Retrieve();
+      if (e != null) message = message + " Inner Exception: " + e.Message;
+      SWIGPendingException.Set(new global::System.ArgumentNullException(paramName, message));
+    }
+    static void SetPendingArgumentOutOfRangeException(string message, string paramName) {
+      global::System.Exception e = SWIGPendingException.Retrieve();
+      if (e != null) message = message + " Inner Exception: " + e.Message;
+      SWIGPendingException.Set(new global::System.ArgumentOutOfRangeException(paramName, message));
+    }
+
+    static SWIGExceptionHelper() {
+      SWIGRegisterExceptionCallbacks_ESL(
+                                applicationDelegate,
+                                arithmeticDelegate,
+                                divideByZeroDelegate,
+                                indexOutOfRangeDelegate,
+                                invalidCastDelegate,
+                                invalidOperationDelegate,
+                                ioDelegate,
+                                nullReferenceDelegate,
+                                outOfMemoryDelegate,
+                                overflowDelegate,
+                                systemDelegate);
+
+      SWIGRegisterExceptionCallbacksArgument_ESL(
+                                argumentDelegate,
+                                argumentNullDelegate,
+                                argumentOutOfRangeDelegate);
+    }
+  }
+
+  protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();
+
+  public class SWIGPendingException {
+    [global::System.ThreadStatic]
+    private static global::System.Exception pendingException = null;
+    private static int numExceptionsPending = 0;
+
+    public static bool Pending {
+      get {
+        bool pending = false;
+        if (numExceptionsPending > 0)
+          if (pendingException != null)
+            pending = true;
+        return pending;
+      } 
+    }
+
+    public static void Set(global::System.Exception e) {
+      if (pendingException != null)
+        throw new global::System.ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e);
+      pendingException = e;
+      lock(typeof(ESLPINVOKE)) {
+        numExceptionsPending++;
+      }
+    }
+
+    public static global::System.Exception Retrieve() {
+      global::System.Exception e = null;
+      if (numExceptionsPending > 0) {
+        if (pendingException != null) {
+          e = pendingException;
+          pendingException = null;
+          lock(typeof(ESLPINVOKE)) {
+            numExceptionsPending--;
+          }
+        }
+      }
+      return e;
+    }
+  }
+
+
+  protected class SWIGStringHelper {
+
+    public delegate string SWIGStringDelegate(string message);
+    static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString);
+
+    [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="SWIGRegisterStringCallback_ESL")]
+    public static extern void SWIGRegisterStringCallback_ESL(SWIGStringDelegate stringDelegate);
+
+    static string CreateString(string cString) {
+      return cString;
+    }
+
+    static SWIGStringHelper() {
+      SWIGRegisterStringCallback_ESL(stringDelegate);
+    }
+  }
+
+  static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper();
+
+
+  static ESLPINVOKE() {
+  }
+
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_Event_set")]
+  public static extern void ESLevent_Event_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_Event_get")]
+  public static extern global::System.IntPtr ESLevent_Event_get(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_SerializedString_set")]
+  public static extern void ESLevent_SerializedString_set(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_SerializedString_get")]
+  public static extern string ESLevent_SerializedString_get(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_Mine_set")]
+  public static extern void ESLevent_Mine_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_Mine_get")]
+  public static extern int ESLevent_Mine_get(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_new_ESLevent__SWIG_0")]
+  public static extern global::System.IntPtr new_ESLevent__SWIG_0(string jarg1, string jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_new_ESLevent__SWIG_1")]
+  public static extern global::System.IntPtr new_ESLevent__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_new_ESLevent__SWIG_2")]
+  public static extern global::System.IntPtr new_ESLevent__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_delete_ESLevent")]
+  public static extern void delete_ESLevent(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_Serialize")]
+  public static extern string ESLevent_Serialize(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_SetPriority")]
+  public static extern bool ESLevent_SetPriority(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_GetHeader")]
+  public static extern string ESLevent_GetHeader(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, int jarg3);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_GetBody")]
+  public static extern string ESLevent_GetBody(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_getType")]
+  public static extern string ESLevent_getType(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_AddBody")]
+  public static extern bool ESLevent_AddBody(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_AddHeader")]
+  public static extern bool ESLevent_AddHeader(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_pushHeader")]
+  public static extern bool ESLevent_pushHeader(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_unshiftHeader")]
+  public static extern bool ESLevent_unshiftHeader(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_DelHeader")]
+  public static extern bool ESLevent_DelHeader(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_FirstHeader")]
+  public static extern string ESLevent_FirstHeader(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLevent_NextHeader")]
+  public static extern string ESLevent_NextHeader(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_0")]
+  public static extern global::System.IntPtr new_ESLconnection__SWIG_0(string jarg1, int jarg2, string jarg3, string jarg4);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_1")]
+  public static extern global::System.IntPtr new_ESLconnection__SWIG_1(string jarg1, int jarg2, string jarg3);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_2")]
+  public static extern global::System.IntPtr new_ESLconnection__SWIG_2(string jarg1, string jarg2, string jarg3, string jarg4);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_3")]
+  public static extern global::System.IntPtr new_ESLconnection__SWIG_3(string jarg1, string jarg2, string jarg3);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_new_ESLconnection__SWIG_4")]
+  public static extern global::System.IntPtr new_ESLconnection__SWIG_4(int jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_delete_ESLconnection")]
+  public static extern void delete_ESLconnection(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_SocketDescriptor")]
+  public static extern int ESLconnection_SocketDescriptor(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_Connected")]
+  public static extern int ESLconnection_Connected(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_GetInfo")]
+  public static extern global::System.IntPtr ESLconnection_GetInfo(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_Send")]
+  public static extern int ESLconnection_Send(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_SendRecv")]
+  public static extern global::System.IntPtr ESLconnection_SendRecv(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_Api")]
+  public static extern global::System.IntPtr ESLconnection_Api(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_Bgapi")]
+  public static extern global::System.IntPtr ESLconnection_Bgapi(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3, string jarg4);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_SendEvent")]
+  public static extern global::System.IntPtr ESLconnection_SendEvent(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_sendMSG")]
+  public static extern int ESLconnection_sendMSG(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, string jarg3);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_RecvEvent")]
+  public static extern global::System.IntPtr ESLconnection_RecvEvent(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_RecvEventTimed")]
+  public static extern global::System.IntPtr ESLconnection_RecvEventTimed(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_Filter")]
+  public static extern global::System.IntPtr ESLconnection_Filter(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_Events")]
+  public static extern int ESLconnection_Events(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_Execute")]
+  public static extern global::System.IntPtr ESLconnection_Execute(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3, string jarg4);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_ExecuteAsync")]
+  public static extern global::System.IntPtr ESLconnection_ExecuteAsync(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3, string jarg4);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_SetAsyncExecute")]
+  public static extern int ESLconnection_SetAsyncExecute(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_SetEventLock")]
+  public static extern int ESLconnection_SetEventLock(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_ESLconnection_Disconnect")]
+  public static extern int ESLconnection_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+  [global::System.Runtime.InteropServices.DllImport("ESL", EntryPoint="CSharp_eslSetLogLevel")]
+  public static extern void eslSetLogLevel(int jarg1);
+}
diff --git a/libs/esl/managed/ESLPINVOKE.cs b/libs/esl/managed/ESLPINVOKE.cs
index b00dad06ec..cf8082d436 100644
--- a/libs/esl/managed/ESLPINVOKE.cs
+++ b/libs/esl/managed/ESLPINVOKE.cs
@@ -1,10 +1,12 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
 
 
 class ESLPINVOKE {
diff --git a/libs/esl/managed/ESLconnection.2015.cs b/libs/esl/managed/ESLconnection.2015.cs
new file mode 100644
index 0000000000..dad2ace4ab
--- /dev/null
+++ b/libs/esl/managed/ESLconnection.2015.cs
@@ -0,0 +1,157 @@
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
+
+
+public class ESLconnection : global::System.IDisposable {
+  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal ESLconnection(global::System.IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+  }
+
+  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ESLconnection obj) {
+    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~ESLconnection() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          ESLPINVOKE.delete_ESLconnection(swigCPtr);
+        }
+        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+      }
+      global::System.GC.SuppressFinalize(this);
+    }
+  }
+
+  public ESLconnection(string host, int port, string user, string password) : this(ESLPINVOKE.new_ESLconnection__SWIG_0(host, port, user, password), true) {
+  }
+
+  public ESLconnection(string host, int port, string password) : this(ESLPINVOKE.new_ESLconnection__SWIG_1(host, port, password), true) {
+  }
+
+  public ESLconnection(string host, string port, string user, string password) : this(ESLPINVOKE.new_ESLconnection__SWIG_2(host, port, user, password), true) {
+  }
+
+  public ESLconnection(string host, string port, string password) : this(ESLPINVOKE.new_ESLconnection__SWIG_3(host, port, password), true) {
+  }
+
+  public ESLconnection(int socket) : this(ESLPINVOKE.new_ESLconnection__SWIG_4(socket), true) {
+  }
+
+  public int SocketDescriptor() {
+    int ret = ESLPINVOKE.ESLconnection_SocketDescriptor(swigCPtr);
+    return ret;
+  }
+
+  public int Connected() {
+    int ret = ESLPINVOKE.ESLconnection_Connected(swigCPtr);
+    return ret;
+  }
+
+  public ESLevent GetInfo() {
+    global::System.IntPtr cPtr = ESLPINVOKE.ESLconnection_GetInfo(swigCPtr);
+    ESLevent ret = (cPtr == global::System.IntPtr.Zero) ? null : new ESLevent(cPtr, true);
+    return ret;
+  }
+
+  public int Send(string cmd) {
+    int ret = ESLPINVOKE.ESLconnection_Send(swigCPtr, cmd);
+    return ret;
+  }
+
+  public ESLevent SendRecv(string cmd) {
+    global::System.IntPtr cPtr = ESLPINVOKE.ESLconnection_SendRecv(swigCPtr, cmd);
+    ESLevent ret = (cPtr == global::System.IntPtr.Zero) ? null : new ESLevent(cPtr, true);
+    return ret;
+  }
+
+  public ESLevent Api(string cmd, string arg) {
+    global::System.IntPtr cPtr = ESLPINVOKE.ESLconnection_Api(swigCPtr, cmd, arg);
+    ESLevent ret = (cPtr == global::System.IntPtr.Zero) ? null : new ESLevent(cPtr, true);
+    return ret;
+  }
+
+  public ESLevent Bgapi(string cmd, string arg, string job_uuid) {
+    global::System.IntPtr cPtr = ESLPINVOKE.ESLconnection_Bgapi(swigCPtr, cmd, arg, job_uuid);
+    ESLevent ret = (cPtr == global::System.IntPtr.Zero) ? null : new ESLevent(cPtr, true);
+    return ret;
+  }
+
+  public ESLevent SendEvent(ESLevent send_me) {
+    global::System.IntPtr cPtr = ESLPINVOKE.ESLconnection_SendEvent(swigCPtr, ESLevent.getCPtr(send_me));
+    ESLevent ret = (cPtr == global::System.IntPtr.Zero) ? null : new ESLevent(cPtr, true);
+    return ret;
+  }
+
+  public int sendMSG(ESLevent send_me, string uuid) {
+    int ret = ESLPINVOKE.ESLconnection_sendMSG(swigCPtr, ESLevent.getCPtr(send_me), uuid);
+    return ret;
+  }
+
+  public ESLevent RecvEvent() {
+    global::System.IntPtr cPtr = ESLPINVOKE.ESLconnection_RecvEvent(swigCPtr);
+    ESLevent ret = (cPtr == global::System.IntPtr.Zero) ? null : new ESLevent(cPtr, true);
+    return ret;
+  }
+
+  public ESLevent RecvEventTimed(int ms) {
+    global::System.IntPtr cPtr = ESLPINVOKE.ESLconnection_RecvEventTimed(swigCPtr, ms);
+    ESLevent ret = (cPtr == global::System.IntPtr.Zero) ? null : new ESLevent(cPtr, true);
+    return ret;
+  }
+
+  public ESLevent Filter(string header, string value) {
+    global::System.IntPtr cPtr = ESLPINVOKE.ESLconnection_Filter(swigCPtr, header, value);
+    ESLevent ret = (cPtr == global::System.IntPtr.Zero) ? null : new ESLevent(cPtr, true);
+    return ret;
+  }
+
+  public int Events(string etype, string value) {
+    int ret = ESLPINVOKE.ESLconnection_Events(swigCPtr, etype, value);
+    return ret;
+  }
+
+  public ESLevent Execute(string app, string arg, string uuid) {
+    global::System.IntPtr cPtr = ESLPINVOKE.ESLconnection_Execute(swigCPtr, app, arg, uuid);
+    ESLevent ret = (cPtr == global::System.IntPtr.Zero) ? null : new ESLevent(cPtr, true);
+    return ret;
+  }
+
+  public ESLevent ExecuteAsync(string app, string arg, string uuid) {
+    global::System.IntPtr cPtr = ESLPINVOKE.ESLconnection_ExecuteAsync(swigCPtr, app, arg, uuid);
+    ESLevent ret = (cPtr == global::System.IntPtr.Zero) ? null : new ESLevent(cPtr, true);
+    return ret;
+  }
+
+  public int SetAsyncExecute(string val) {
+    int ret = ESLPINVOKE.ESLconnection_SetAsyncExecute(swigCPtr, val);
+    return ret;
+  }
+
+  public int SetEventLock(string val) {
+    int ret = ESLPINVOKE.ESLconnection_SetEventLock(swigCPtr, val);
+    return ret;
+  }
+
+  public int Disconnect() {
+    int ret = ESLPINVOKE.ESLconnection_Disconnect(swigCPtr);
+    return ret;
+  }
+
+}
diff --git a/libs/esl/managed/ESLconnection.cs b/libs/esl/managed/ESLconnection.cs
index e1c43d6b32..dad2ace4ab 100644
--- a/libs/esl/managed/ESLconnection.cs
+++ b/libs/esl/managed/ESLconnection.cs
@@ -1,10 +1,12 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
 
 
 public class ESLconnection : global::System.IDisposable {
diff --git a/libs/esl/managed/ESLevent.2010.cs b/libs/esl/managed/ESLevent.2015.cs
similarity index 70%
rename from libs/esl/managed/ESLevent.2010.cs
rename to libs/esl/managed/ESLevent.2015.cs
index 1ec47dfc77..1a72106285 100644
--- a/libs/esl/managed/ESLevent.2010.cs
+++ b/libs/esl/managed/ESLevent.2015.cs
@@ -1,144 +1,143 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-
-using System;
-using System.Runtime.InteropServices;
-
-public class ESLevent : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal ESLevent(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(ESLevent obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~ESLevent() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          ESLPINVOKE.delete_ESLevent(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public SWIGTYPE_p_esl_event_t Event {
-    set {
-      ESLPINVOKE.ESLevent_Event_set(swigCPtr, SWIGTYPE_p_esl_event_t.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = ESLPINVOKE.ESLevent_Event_get(swigCPtr);
-      SWIGTYPE_p_esl_event_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_esl_event_t(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public string SerializedString {
-    set {
-      ESLPINVOKE.ESLevent_SerializedString_set(swigCPtr, value);
-    } 
-    get {
-      string ret = ESLPINVOKE.ESLevent_SerializedString_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public int Mine {
-    set {
-      ESLPINVOKE.ESLevent_Mine_set(swigCPtr, value);
-    } 
-    get {
-      int ret = ESLPINVOKE.ESLevent_Mine_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public ESLevent(string type, string subclass_name) : this(ESLPINVOKE.new_ESLevent__SWIG_0(type, subclass_name), true) {
-  }
-
-  public ESLevent(SWIGTYPE_p_esl_event_t wrap_me, int free_me) : this(ESLPINVOKE.new_ESLevent__SWIG_1(SWIGTYPE_p_esl_event_t.getCPtr(wrap_me), free_me), true) {
-  }
-
-  public ESLevent(ESLevent me) : this(ESLPINVOKE.new_ESLevent__SWIG_2(ESLevent.getCPtr(me)), true) {
-  }
-
-  public string Serialize(string format) {
-    string ret = ESLPINVOKE.ESLevent_Serialize(swigCPtr, format);
-    return ret;
-  }
-
-  public bool SetPriority(SWIGTYPE_p_esl_priority_t priority) {
-    bool ret = ESLPINVOKE.ESLevent_SetPriority(swigCPtr, SWIGTYPE_p_esl_priority_t.getCPtr(priority));
-    if (ESLPINVOKE.SWIGPendingException.Pending) throw ESLPINVOKE.SWIGPendingException.Retrieve();
-    return ret;
-  }
-
-  public string GetHeader(string header_name, int idx) {
-    string ret = ESLPINVOKE.ESLevent_GetHeader(swigCPtr, header_name, idx);
-    return ret;
-  }
-
-  public string GetBody() {
-    string ret = ESLPINVOKE.ESLevent_GetBody(swigCPtr);
-    return ret;
-  }
-
-  public string getType() {
-    string ret = ESLPINVOKE.ESLevent_getType(swigCPtr);
-    return ret;
-  }
-
-  public bool AddBody(string value) {
-    bool ret = ESLPINVOKE.ESLevent_AddBody(swigCPtr, value);
-    return ret;
-  }
-
-  public bool AddHeader(string header_name, string value) {
-    bool ret = ESLPINVOKE.ESLevent_AddHeader(swigCPtr, header_name, value);
-    return ret;
-  }
-
-  public bool pushHeader(string header_name, string value) {
-    bool ret = ESLPINVOKE.ESLevent_pushHeader(swigCPtr, header_name, value);
-    return ret;
-  }
-
-  public bool unshiftHeader(string header_name, string value) {
-    bool ret = ESLPINVOKE.ESLevent_unshiftHeader(swigCPtr, header_name, value);
-    return ret;
-  }
-
-  public bool DelHeader(string header_name) {
-    bool ret = ESLPINVOKE.ESLevent_DelHeader(swigCPtr, header_name);
-    return ret;
-  }
-
-  public string FirstHeader() {
-    string ret = ESLPINVOKE.ESLevent_FirstHeader(swigCPtr);
-    return ret;
-  }
-
-  public string NextHeader() {
-    string ret = ESLPINVOKE.ESLevent_NextHeader(swigCPtr);
-    return ret;
-  }
-
-}
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
+
+
+public class ESLevent : global::System.IDisposable {
+  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal ESLevent(global::System.IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+  }
+
+  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ESLevent obj) {
+    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~ESLevent() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          ESLPINVOKE.delete_ESLevent(swigCPtr);
+        }
+        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+      }
+      global::System.GC.SuppressFinalize(this);
+    }
+  }
+
+  public SWIGTYPE_p_esl_event_t Event {
+    set {
+      ESLPINVOKE.ESLevent_Event_set(swigCPtr, SWIGTYPE_p_esl_event_t.getCPtr(value));
+    } 
+    get {
+      global::System.IntPtr cPtr = ESLPINVOKE.ESLevent_Event_get(swigCPtr);
+      SWIGTYPE_p_esl_event_t ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_esl_event_t(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public string SerializedString {
+    set {
+      ESLPINVOKE.ESLevent_SerializedString_set(swigCPtr, value);
+    } 
+    get {
+      string ret = ESLPINVOKE.ESLevent_SerializedString_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public int Mine {
+    set {
+      ESLPINVOKE.ESLevent_Mine_set(swigCPtr, value);
+    } 
+    get {
+      int ret = ESLPINVOKE.ESLevent_Mine_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public ESLevent(string type, string subclass_name) : this(ESLPINVOKE.new_ESLevent__SWIG_0(type, subclass_name), true) {
+  }
+
+  public ESLevent(SWIGTYPE_p_esl_event_t wrap_me, int free_me) : this(ESLPINVOKE.new_ESLevent__SWIG_1(SWIGTYPE_p_esl_event_t.getCPtr(wrap_me), free_me), true) {
+  }
+
+  public ESLevent(ESLevent me) : this(ESLPINVOKE.new_ESLevent__SWIG_2(ESLevent.getCPtr(me)), true) {
+  }
+
+  public string Serialize(string format) {
+    string ret = ESLPINVOKE.ESLevent_Serialize(swigCPtr, format);
+    return ret;
+  }
+
+  public bool SetPriority(SWIGTYPE_p_esl_priority_t priority) {
+    bool ret = ESLPINVOKE.ESLevent_SetPriority(swigCPtr, SWIGTYPE_p_esl_priority_t.getCPtr(priority));
+    if (ESLPINVOKE.SWIGPendingException.Pending) throw ESLPINVOKE.SWIGPendingException.Retrieve();
+    return ret;
+  }
+
+  public string GetHeader(string header_name, int idx) {
+    string ret = ESLPINVOKE.ESLevent_GetHeader(swigCPtr, header_name, idx);
+    return ret;
+  }
+
+  public string GetBody() {
+    string ret = ESLPINVOKE.ESLevent_GetBody(swigCPtr);
+    return ret;
+  }
+
+  public string getType() {
+    string ret = ESLPINVOKE.ESLevent_getType(swigCPtr);
+    return ret;
+  }
+
+  public bool AddBody(string value) {
+    bool ret = ESLPINVOKE.ESLevent_AddBody(swigCPtr, value);
+    return ret;
+  }
+
+  public bool AddHeader(string header_name, string value) {
+    bool ret = ESLPINVOKE.ESLevent_AddHeader(swigCPtr, header_name, value);
+    return ret;
+  }
+
+  public bool pushHeader(string header_name, string value) {
+    bool ret = ESLPINVOKE.ESLevent_pushHeader(swigCPtr, header_name, value);
+    return ret;
+  }
+
+  public bool unshiftHeader(string header_name, string value) {
+    bool ret = ESLPINVOKE.ESLevent_unshiftHeader(swigCPtr, header_name, value);
+    return ret;
+  }
+
+  public bool DelHeader(string header_name) {
+    bool ret = ESLPINVOKE.ESLevent_DelHeader(swigCPtr, header_name);
+    return ret;
+  }
+
+  public string FirstHeader() {
+    string ret = ESLPINVOKE.ESLevent_FirstHeader(swigCPtr);
+    return ret;
+  }
+
+  public string NextHeader() {
+    string ret = ESLPINVOKE.ESLevent_NextHeader(swigCPtr);
+    return ret;
+  }
+
+}
diff --git a/libs/esl/managed/ESLevent.cs b/libs/esl/managed/ESLevent.cs
index 2fcb062c85..1a72106285 100644
--- a/libs/esl/managed/ESLevent.cs
+++ b/libs/esl/managed/ESLevent.cs
@@ -1,10 +1,12 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
 
 
 public class ESLevent : global::System.IDisposable {
diff --git a/libs/esl/managed/ManagedEsl.2010.csproj b/libs/esl/managed/ManagedEsl.2010.csproj
deleted file mode 100644
index 732b707988..0000000000
--- a/libs/esl/managed/ManagedEsl.2010.csproj
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-  
-    Debug
-    AnyCPU
-    9.0.30729
-    2.0
-    {DEE5837B-E01D-4223-B351-EDF9418F3F8E}
-    Library
-    Properties
-    ManagedEsl
-    ManagedEsl
-    v4.0
-    512
-    
-    
-    3.5
-    
-    publish\
-    true
-    Disk
-    false
-    Foreground
-    7
-    Days
-    false
-    false
-    true
-    0
-    1.0.0.%2a
-    false
-    false
-    true
-    
-  
-  
-    true
-    full
-    false
-    Debug\
-    DEBUG;TRACE
-    prompt
-    4
-    AllRules.ruleset
-  
-  
-    pdbonly
-    true
-    Release\
-    TRACE
-    prompt
-    4
-    AllRules.ruleset
-  
-  
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      False
-      .NET Framework 3.5 SP1 Client Profile
-      false
-    
-    
-      False
-      .NET Framework 3.5 SP1
-      true
-    
-    
-      False
-      Windows Installer 3.1
-      true
-    
-  
-  
-  
-
\ No newline at end of file
diff --git a/libs/esl/managed/ManagedEsl.2012.csproj b/libs/esl/managed/ManagedEsl.2015.csproj
similarity index 89%
rename from libs/esl/managed/ManagedEsl.2012.csproj
rename to libs/esl/managed/ManagedEsl.2015.csproj
index f08c560db2..ce00513255 100644
--- a/libs/esl/managed/ManagedEsl.2012.csproj
+++ b/libs/esl/managed/ManagedEsl.2015.csproj
@@ -1,93 +1,95 @@
-
-
-  
-    Debug
-    AnyCPU
-    9.0.30729
-    2.0
-    {DEE5837B-E01D-4223-B351-EDF9418F3F8E}
-    Library
-    Properties
-    ManagedEsl
-    ManagedEsl
-    v4.0
-    512
-    
-    
-    3.5
-    
-    publish\
-    true
-    Disk
-    false
-    Foreground
-    7
-    Days
-    false
-    false
-    true
-    0
-    1.0.0.%2a
-    false
-    false
-    true
-    
-  
-  
-    true
-    full
-    false
-    Debug\
-    DEBUG;TRACE
-    prompt
-    4
-    AllRules.ruleset
-  
-  
-    pdbonly
-    true
-    Release\
-    TRACE
-    prompt
-    4
-    AllRules.ruleset
-  
-  
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      False
-      .NET Framework 3.5 SP1 Client Profile
-      false
-    
-    
-      False
-      .NET Framework 3.5 SP1
-      true
-    
-    
-      False
-      Windows Installer 3.1
-      true
-    
-  
-  
-  
-
\ No newline at end of file
+
+
+  
+    Debug
+    AnyCPU
+    9.0.30729
+    2.0
+    {DEE5837B-E01D-4223-B351-EDF9418F3F8E}
+    Library
+    Properties
+    ManagedEsl
+    ManagedEsl
+    v4.0
+    512
+    
+    
+    3.5
+    
+    publish\
+    true
+    Disk
+    false
+    Foreground
+    7
+    Days
+    false
+    false
+    true
+    0
+    1.0.0.%2a
+    false
+    false
+    true
+    
+  
+  
+    true
+    full
+    false
+    Debug\
+    DEBUG;TRACE
+    prompt
+    4
+    AllRules.ruleset
+    false
+  
+  
+    pdbonly
+    true
+    Release\
+    TRACE
+    prompt
+    4
+    AllRules.ruleset
+    false
+  
+  
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      False
+      .NET Framework 3.5 SP1 Client Profile
+      false
+    
+    
+      False
+      .NET Framework 3.5 SP1
+      true
+    
+    
+      False
+      Windows Installer 3.1
+      true
+    
+  
+  
+  
+
diff --git a/libs/esl/managed/managed_esl.2012.sln b/libs/esl/managed/ManagedEsl.2015.sln
similarity index 50%
rename from libs/esl/managed/managed_esl.2012.sln
rename to libs/esl/managed/ManagedEsl.2015.sln
index 66d2a1cab0..25bfba8cb2 100644
--- a/libs/esl/managed/managed_esl.2012.sln
+++ b/libs/esl/managed/ManagedEsl.2015.sln
@@ -1,52 +1,75 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ESL", "ESL.2012.vcxproj", "{FEA2D0AE-6713-4E41-A473-A143849BC7FF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEsl.2012", "ManagedEsl.2012.csproj", "{DEE5837B-E01D-4223-B351-EDF9418F3F8E}"
-	ProjectSection(ProjectDependencies) = postProject
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF} = {FEA2D0AE-6713-4E41-A473-A143849BC7FF}
-	EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEslTest.2012", "ManagedEslTest\ManagedEslTest.2012.csproj", "{2321D01A-D64B-4461-9837-FACF38652212}"
-	ProjectSection(ProjectDependencies) = postProject
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF} = {FEA2D0AE-6713-4E41-A473-A143849BC7FF}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Win32.Build.0 = Debug|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|x64.ActiveCfg = Debug|x64
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|x64.Build.0 = Debug|x64
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Win32.ActiveCfg = Release|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Win32.Build.0 = Release|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|x64.ActiveCfg = Release|x64
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|x64.Build.0 = Release|x64
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Win32.ActiveCfg = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Win32.Build.0 = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|x64.Build.0 = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Win32.ActiveCfg = Release|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Win32.Build.0 = Release|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|x64.ActiveCfg = Release|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|x64.Build.0 = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Win32.ActiveCfg = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Win32.Build.0 = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|x64.Build.0 = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Win32.ActiveCfg = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Win32.Build.0 = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|x64.ActiveCfg = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|x64.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEsl.2015", "ManagedEsl.2015.csproj", "{DEE5837B-E01D-4223-B351-EDF9418F3F8E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEslTest.2015", "ManagedEslTest\ManagedEslTest.2015.csproj", "{2321D01A-D64B-4461-9837-FACF38652212}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ESL", "esl.2015.vcxproj", "{FEA2D0AE-6713-4E41-A473-A143849BC7FF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libesl", "..\src\libesl.2015.vcxproj", "{CF405366-9558-4AE8-90EF-5E21B51CCB4E}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Release|Any CPU = Release|Any CPU
+		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Win32.Build.0 = Debug|Any CPU
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|x64.Build.0 = Debug|Any CPU
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Win32.ActiveCfg = Release|Any CPU
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Win32.Build.0 = Release|Any CPU
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|x64.ActiveCfg = Release|Any CPU
+		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|x64.Build.0 = Release|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Win32.Build.0 = Debug|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|x64.Build.0 = Debug|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Any CPU.Build.0 = Release|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Win32.ActiveCfg = Release|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Win32.Build.0 = Release|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Release|x64.ActiveCfg = Release|Any CPU
+		{2321D01A-D64B-4461-9837-FACF38652212}.Release|x64.Build.0 = Release|Any CPU
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Any CPU.ActiveCfg = Debug|x64
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Any CPU.Build.0 = Debug|x64
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Win32.Build.0 = Debug|Win32
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|x64.ActiveCfg = Debug|x64
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|x64.Build.0 = Debug|x64
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Any CPU.ActiveCfg = Release|x64
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Any CPU.Build.0 = Release|x64
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Win32.ActiveCfg = Release|Win32
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Win32.Build.0 = Release|Win32
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|x64.ActiveCfg = Release|x64
+		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|x64.Build.0 = Release|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|Any CPU.ActiveCfg = Debug|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|Any CPU.Build.0 = Debug|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|Win32.Build.0 = Debug|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|x64.ActiveCfg = Debug|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|x64.Build.0 = Debug|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Any CPU.ActiveCfg = Release|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Any CPU.Build.0 = Release|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.ActiveCfg = Release|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.Build.0 = Release|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|x64.ActiveCfg = Release|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|x64.Build.0 = Release|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/libs/esl/managed/ManagedEsl.csproj b/libs/esl/managed/ManagedEsl.csproj
deleted file mode 100644
index 25491c73f7..0000000000
--- a/libs/esl/managed/ManagedEsl.csproj
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-  
-    Debug
-    AnyCPU
-    9.0.30729
-    2.0
-    {DEE5837B-E01D-4223-B351-EDF9418F3F8E}
-    Library
-    Properties
-    ManagedEsl
-    ManagedEsl
-    v2.0
-    512
-    
-    
-  
-  
-    true
-    full
-    false
-    Debug\
-    DEBUG;TRACE
-    prompt
-    4
-  
-  
-    pdbonly
-    true
-    Release\
-    TRACE
-    prompt
-    4
-  
-  
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-  
-  
-  
-
\ No newline at end of file
diff --git a/libs/esl/managed/ManagedEslTest/.gitignore b/libs/esl/managed/ManagedEslTest/.gitignore
new file mode 100644
index 0000000000..33fc3188ff
--- /dev/null
+++ b/libs/esl/managed/ManagedEslTest/.gitignore
@@ -0,0 +1 @@
+app.config
diff --git a/libs/esl/managed/ManagedEslTest/ManagedEslTest.2010.csproj b/libs/esl/managed/ManagedEslTest/ManagedEslTest.2010.csproj
deleted file mode 100644
index 737d558189..0000000000
--- a/libs/esl/managed/ManagedEslTest/ManagedEslTest.2010.csproj
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-  
-    Debug
-    AnyCPU
-    9.0.30729
-    2.0
-    {2321D01A-D64B-4461-9837-FACF38652212}
-    Exe
-    Properties
-    ManagedEslTest
-    ManagedEslTest
-    v4.0
-    512
-    
-    
-    3.5
-    
-    publish\
-    true
-    Disk
-    false
-    Foreground
-    7
-    Days
-    false
-    false
-    true
-    0
-    1.0.0.%2a
-    false
-    false
-    true
-    
-  
-  
-    true
-    full
-    false
-    ..\Debug\
-    DEBUG;TRACE
-    prompt
-    4
-    AllRules.ruleset
-  
-  
-    pdbonly
-    true
-    ..\Release\
-    TRACE
-    prompt
-    4
-    AllRules.ruleset
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-      {FEA2D0AE-6713-4E41-A473-A143849BC7FF}
-      ESL
-    
-    
-      {DEE5837B-E01D-4223-B351-EDF9418F3F8E}
-      ManagedEsl
-      True
-    
-  
-  
-    
-      False
-      .NET Framework 3.5 SP1 Client Profile
-      false
-    
-    
-      False
-      .NET Framework 3.5 SP1
-      true
-    
-    
-      False
-      Windows Installer 3.1
-      true
-    
-  
-  
-  
-
\ No newline at end of file
diff --git a/libs/esl/managed/ManagedEslTest/ManagedEslTest.2012.csproj b/libs/esl/managed/ManagedEslTest/ManagedEslTest.2015.csproj
similarity index 93%
rename from libs/esl/managed/ManagedEslTest/ManagedEslTest.2012.csproj
rename to libs/esl/managed/ManagedEslTest/ManagedEslTest.2015.csproj
index 39ab1f01b7..f91e97df5d 100644
--- a/libs/esl/managed/ManagedEslTest/ManagedEslTest.2012.csproj
+++ b/libs/esl/managed/ManagedEslTest/ManagedEslTest.2015.csproj
@@ -1,99 +1,101 @@
-
-
-  
-    Debug
-    AnyCPU
-    9.0.30729
-    2.0
-    {2321D01A-D64B-4461-9837-FACF38652212}
-    Exe
-    Properties
-    ManagedEslTest
-    ManagedEslTest
-    v4.0
-    512
-    
-    
-    3.5
-    
-    publish\
-    true
-    Disk
-    false
-    Foreground
-    7
-    Days
-    false
-    false
-    true
-    0
-    1.0.0.%2a
-    false
-    false
-    true
-    
-  
-  
-    true
-    full
-    false
-    ..\Debug\
-    DEBUG;TRACE
-    prompt
-    4
-    AllRules.ruleset
-  
-  
-    pdbonly
-    true
-    ..\Release\
-    TRACE
-    prompt
-    4
-    AllRules.ruleset
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-      {fea2d0ae-6713-4e41-a473-a143849bc7ff}
-      ESL
-    
-    
-      {DEE5837B-E01D-4223-B351-EDF9418F3F8E}
-      ManagedEsl
-      True
-    
-  
-  
-    
-      False
-      .NET Framework 3.5 SP1 Client Profile
-      false
-    
-    
-      False
-      .NET Framework 3.5 SP1
-      true
-    
-    
-      False
-      Windows Installer 3.1
-      true
-    
-  
-  
-  
-
\ No newline at end of file
+
+
+  
+    Debug
+    AnyCPU
+    9.0.30729
+    2.0
+    {2321D01A-D64B-4461-9837-FACF38652212}
+    Exe
+    Properties
+    ManagedEslTest
+    ManagedEslTest
+    v4.0
+    512
+    
+    
+    3.5
+    
+    publish\
+    true
+    Disk
+    false
+    Foreground
+    7
+    Days
+    false
+    false
+    true
+    0
+    1.0.0.%2a
+    false
+    false
+    true
+    
+  
+  
+    true
+    full
+    false
+    ..\Debug\
+    DEBUG;TRACE
+    prompt
+    4
+    AllRules.ruleset
+    false
+  
+  
+    pdbonly
+    true
+    ..\Release\
+    TRACE
+    prompt
+    4
+    AllRules.ruleset
+    false
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+      {fea2d0ae-6713-4e41-a473-a143849bc7ff}
+      ESL
+    
+    
+      {DEE5837B-E01D-4223-B351-EDF9418F3F8E}
+      ManagedEsl
+      True
+    
+  
+  
+    
+      False
+      .NET Framework 3.5 SP1 Client Profile
+      false
+    
+    
+      False
+      .NET Framework 3.5 SP1
+      true
+    
+    
+      False
+      Windows Installer 3.1
+      true
+    
+  
+  
+  
+
diff --git a/libs/esl/managed/ManagedEslTest/ManagedEslTest.csproj b/libs/esl/managed/ManagedEslTest/ManagedEslTest.csproj
deleted file mode 100644
index c311fd7476..0000000000
--- a/libs/esl/managed/ManagedEslTest/ManagedEslTest.csproj
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-  
-    Debug
-    AnyCPU
-    9.0.30729
-    2.0
-    {2321D01A-D64B-4461-9837-FACF38652212}
-    Exe
-    Properties
-    ManagedEslTest
-    ManagedEslTest
-    v2.0
-    512
-    
-    
-  
-  
-    true
-    full
-    false
-    ..\Debug\
-    DEBUG;TRACE
-    prompt
-    4
-  
-  
-    pdbonly
-    true
-    ..\Release\
-    TRACE
-    prompt
-    4
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-      {DEE5837B-E01D-4223-B351-EDF9418F3F8E}
-      ManagedEsl
-      True
-    
-  
-  
-  
-
\ No newline at end of file
diff --git a/libs/esl/managed/ManagedEslTest/Properties/AssemblyInfo.cs b/libs/esl/managed/ManagedEslTest/Properties/AssemblyInfo.cs
index 2d46d2ab12..41ad8e83c7 100644
--- a/libs/esl/managed/ManagedEslTest/Properties/AssemblyInfo.cs
+++ b/libs/esl/managed/ManagedEslTest/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("ManagedEslTest")]
-[assembly: AssemblyCopyright("Copyright ©  2010")]
+[assembly: AssemblyCopyright("Copyright ©  2018")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
diff --git a/libs/esl/managed/Properties/AssemblyInfo.cs b/libs/esl/managed/Properties/AssemblyInfo.cs
index 433b35bbc3..f187076152 100644
--- a/libs/esl/managed/Properties/AssemblyInfo.cs
+++ b/libs/esl/managed/Properties/AssemblyInfo.cs
@@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
 [assembly: AssemblyProduct("ManagedEsl")]
-[assembly: AssemblyCopyright("Copyright ©  2010")]
+[assembly: AssemblyCopyright("Copyright ©  2018")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]
 
diff --git a/libs/esl/managed/SWIGTYPE_p_esl_event_t.2010.cs b/libs/esl/managed/SWIGTYPE_p_esl_event_t.2010.cs
deleted file mode 100644
index ddf3ec143d..0000000000
--- a/libs/esl/managed/SWIGTYPE_p_esl_event_t.2010.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_esl_event_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_esl_event_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_esl_event_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_esl_event_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
diff --git a/libs/esl/managed/SWIGTYPE_p_esl_event_t.2015.cs b/libs/esl/managed/SWIGTYPE_p_esl_event_t.2015.cs
new file mode 100644
index 0000000000..2e60d1922c
--- /dev/null
+++ b/libs/esl/managed/SWIGTYPE_p_esl_event_t.2015.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
+
+
+public class SWIGTYPE_p_esl_event_t {
+  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_esl_event_t(global::System.IntPtr cPtr, bool futureUse) {
+    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_esl_event_t() {
+    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+  }
+
+  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_esl_event_t obj) {
+    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+  }
+}
diff --git a/libs/esl/managed/SWIGTYPE_p_esl_event_t.cs b/libs/esl/managed/SWIGTYPE_p_esl_event_t.cs
index 9e257c5e8c..2e60d1922c 100644
--- a/libs/esl/managed/SWIGTYPE_p_esl_event_t.cs
+++ b/libs/esl/managed/SWIGTYPE_p_esl_event_t.cs
@@ -1,10 +1,12 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
 
 
 public class SWIGTYPE_p_esl_event_t {
diff --git a/libs/esl/managed/SWIGTYPE_p_esl_priority_t.2010.cs b/libs/esl/managed/SWIGTYPE_p_esl_priority_t.2010.cs
deleted file mode 100644
index 811d460362..0000000000
--- a/libs/esl/managed/SWIGTYPE_p_esl_priority_t.2010.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_esl_priority_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_esl_priority_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_esl_priority_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_esl_priority_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
diff --git a/libs/esl/managed/SWIGTYPE_p_esl_priority_t.2015.cs b/libs/esl/managed/SWIGTYPE_p_esl_priority_t.2015.cs
new file mode 100644
index 0000000000..e7c043d074
--- /dev/null
+++ b/libs/esl/managed/SWIGTYPE_p_esl_priority_t.2015.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
+
+
+public class SWIGTYPE_p_esl_priority_t {
+  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_esl_priority_t(global::System.IntPtr cPtr, bool futureUse) {
+    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_esl_priority_t() {
+    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+  }
+
+  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_esl_priority_t obj) {
+    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+  }
+}
diff --git a/libs/esl/managed/SWIGTYPE_p_esl_priority_t.cs b/libs/esl/managed/SWIGTYPE_p_esl_priority_t.cs
index 0ed478d2e2..e7c043d074 100644
--- a/libs/esl/managed/SWIGTYPE_p_esl_priority_t.cs
+++ b/libs/esl/managed/SWIGTYPE_p_esl_priority_t.cs
@@ -1,10 +1,12 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
 
 
 public class SWIGTYPE_p_esl_priority_t {
diff --git a/libs/esl/managed/esl.2010.cs b/libs/esl/managed/esl.2010.cs
deleted file mode 100644
index f9ed10a9df..0000000000
--- a/libs/esl/managed/esl.2010.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.1
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-
-using System;
-using System.Runtime.InteropServices;
-
-public class ESL {
-  public static void eslSetLogLevel(int level) {
-    ESLPINVOKE.eslSetLogLevel(level);
-  }
-
-}
diff --git a/libs/esl/managed/esl.2015.cs b/libs/esl/managed/esl.2015.cs
new file mode 100644
index 0000000000..27de939b10
--- /dev/null
+++ b/libs/esl/managed/esl.2015.cs
@@ -0,0 +1,17 @@
+//------------------------------------------------------------------------------
+// 
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
+
+
+public class ESL {
+  public static void eslSetLogLevel(int level) {
+    ESLPINVOKE.eslSetLogLevel(level);
+  }
+
+}
diff --git a/libs/esl/managed/esl.2015.vcxproj b/libs/esl/managed/esl.2015.vcxproj
new file mode 100644
index 0000000000..bfa550b905
--- /dev/null
+++ b/libs/esl/managed/esl.2015.vcxproj
@@ -0,0 +1,216 @@
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    ESL
+    {FEA2D0AE-6713-4E41-A473-A143849BC7FF}
+    ESL
+    ManagedCProj
+    8.1
+  
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    true
+    v140
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    v140
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    true
+    v140
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    v140
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Configuration)\
+    true
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Configuration)\
+    false
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    true
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    false
+    AllRules.ruleset
+    
+    
+    AllRules.ruleset
+    
+    
+    AllRules.ruleset
+    
+    
+    AllRules.ruleset
+    
+    
+  
+  
+    
+      CJSON_HIDE_SYMBOLS;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      Disabled
+      ..\src\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;%(PreprocessorDefinitions)
+      MultiThreadedDebugDLL
+      
+      
+      Level4
+      ProgramDatabase
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      ..\..\..\libs\esl\src\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
+      true
+      true
+      NotSet
+    
+  
+  
+    
+      ..\src\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+      Level3
+      ProgramDatabase
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      ..\..\..\libs\esl\src\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
+      true
+      MachineX86
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      ..\src\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;%(PreprocessorDefinitions)
+      MultiThreadedDebugDLL
+      
+      
+      Level4
+      ProgramDatabase
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      ..\..\..\libs\esl\src\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
+      true
+      true
+      MachineX64
+    
+  
+  
+    
+      X64
+    
+    
+      ..\src\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+      Level3
+      ProgramDatabase
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      ..\..\..\libs\esl\src\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)
+      true
+      MachineX64
+    
+  
+  
+    
+      true
+      true
+    
+    
+      true
+      true
+    
+    
+      true
+      true
+    
+  
+  
+    
+      false
+    
+    
+      false
+    
+    
+    
+  
+  
+    
+  
+  
+    
+      {CF405366-9558-4AE8-90EF-5E21B51CCB4E}
+    
+  
+  
+  
+  
+
diff --git a/libs/esl/managed/esl_wrap.2015.cpp b/libs/esl/managed/esl_wrap.2015.cpp
new file mode 100644
index 0000000000..adce6159a0
--- /dev/null
+++ b/libs/esl/managed/esl_wrap.2015.cpp
@@ -0,0 +1,967 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 3.0.12
+ *
+ * This file is not intended to be easily readable and contains a number of
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+
+#ifndef SWIGCSHARP
+#define SWIGCSHARP
+#endif
+
+
+
+#ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
+template class SwigValueWrapper {
+  struct SwigMovePointer {
+    T *ptr;
+    SwigMovePointer(T *p) : ptr(p) { }
+    ~SwigMovePointer() { delete ptr; }
+    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+  } pointer;
+  SwigValueWrapper& operator=(const SwigValueWrapper& rhs);
+  SwigValueWrapper(const SwigValueWrapper& rhs);
+public:
+  SwigValueWrapper() : pointer(0) { }
+  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
+  operator T&() const { return *pointer.ptr; }
+  T *operator&() { return pointer.ptr; }
+};
+
+template  T SwigValueInit() {
+  return T();
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__))
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__))
+# else
+#   define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if defined(__GNUC__)
+#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#    ifndef GCC_HASCLASSVISIBILITY
+#      define GCC_HASCLASSVISIBILITY
+#    endif
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
+#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
+# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
+#endif
+
+/* Intel's compiler complains if a variable which was never initialised is
+ * cast to void, which is a common idiom which we use to indicate that we
+ * are aware a variable isn't used.  So we just silence that warning.
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
+ */
+#ifdef __INTEL_COMPILER
+# pragma warning disable 592
+#endif
+
+
+#include 
+#include 
+#include 
+
+
+/* Support for throwing C# exceptions from C/C++. There are two types: 
+ * Exceptions that take a message and ArgumentExceptions that take a message and a parameter name. */
+typedef enum {
+  SWIG_CSharpApplicationException,
+  SWIG_CSharpArithmeticException,
+  SWIG_CSharpDivideByZeroException,
+  SWIG_CSharpIndexOutOfRangeException,
+  SWIG_CSharpInvalidCastException,
+  SWIG_CSharpInvalidOperationException,
+  SWIG_CSharpIOException,
+  SWIG_CSharpNullReferenceException,
+  SWIG_CSharpOutOfMemoryException,
+  SWIG_CSharpOverflowException,
+  SWIG_CSharpSystemException
+} SWIG_CSharpExceptionCodes;
+
+typedef enum {
+  SWIG_CSharpArgumentException,
+  SWIG_CSharpArgumentNullException,
+  SWIG_CSharpArgumentOutOfRangeException
+} SWIG_CSharpExceptionArgumentCodes;
+
+typedef void (SWIGSTDCALL* SWIG_CSharpExceptionCallback_t)(const char *);
+typedef void (SWIGSTDCALL* SWIG_CSharpExceptionArgumentCallback_t)(const char *, const char *);
+
+typedef struct {
+  SWIG_CSharpExceptionCodes code;
+  SWIG_CSharpExceptionCallback_t callback;
+} SWIG_CSharpException_t;
+
+typedef struct {
+  SWIG_CSharpExceptionArgumentCodes code;
+  SWIG_CSharpExceptionArgumentCallback_t callback;
+} SWIG_CSharpExceptionArgument_t;
+
+static SWIG_CSharpException_t SWIG_csharp_exceptions[] = {
+  { SWIG_CSharpApplicationException, NULL },
+  { SWIG_CSharpArithmeticException, NULL },
+  { SWIG_CSharpDivideByZeroException, NULL },
+  { SWIG_CSharpIndexOutOfRangeException, NULL },
+  { SWIG_CSharpInvalidCastException, NULL },
+  { SWIG_CSharpInvalidOperationException, NULL },
+  { SWIG_CSharpIOException, NULL },
+  { SWIG_CSharpNullReferenceException, NULL },
+  { SWIG_CSharpOutOfMemoryException, NULL },
+  { SWIG_CSharpOverflowException, NULL },
+  { SWIG_CSharpSystemException, NULL }
+};
+
+static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = {
+  { SWIG_CSharpArgumentException, NULL },
+  { SWIG_CSharpArgumentNullException, NULL },
+  { SWIG_CSharpArgumentOutOfRangeException, NULL }
+};
+
+static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) {
+  SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback;
+  if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) {
+    callback = SWIG_csharp_exceptions[code].callback;
+  }
+  callback(msg);
+}
+
+static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) {
+  SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback;
+  if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) {
+    callback = SWIG_csharp_exceptions_argument[code].callback;
+  }
+  callback(msg, param_name);
+}
+
+
+#ifdef __cplusplus
+extern "C" 
+#endif
+SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionCallbacks_ESL(
+                                                SWIG_CSharpExceptionCallback_t applicationCallback,
+                                                SWIG_CSharpExceptionCallback_t arithmeticCallback,
+                                                SWIG_CSharpExceptionCallback_t divideByZeroCallback, 
+                                                SWIG_CSharpExceptionCallback_t indexOutOfRangeCallback, 
+                                                SWIG_CSharpExceptionCallback_t invalidCastCallback,
+                                                SWIG_CSharpExceptionCallback_t invalidOperationCallback,
+                                                SWIG_CSharpExceptionCallback_t ioCallback,
+                                                SWIG_CSharpExceptionCallback_t nullReferenceCallback,
+                                                SWIG_CSharpExceptionCallback_t outOfMemoryCallback, 
+                                                SWIG_CSharpExceptionCallback_t overflowCallback, 
+                                                SWIG_CSharpExceptionCallback_t systemCallback) {
+  SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback = applicationCallback;
+  SWIG_csharp_exceptions[SWIG_CSharpArithmeticException].callback = arithmeticCallback;
+  SWIG_csharp_exceptions[SWIG_CSharpDivideByZeroException].callback = divideByZeroCallback;
+  SWIG_csharp_exceptions[SWIG_CSharpIndexOutOfRangeException].callback = indexOutOfRangeCallback;
+  SWIG_csharp_exceptions[SWIG_CSharpInvalidCastException].callback = invalidCastCallback;
+  SWIG_csharp_exceptions[SWIG_CSharpInvalidOperationException].callback = invalidOperationCallback;
+  SWIG_csharp_exceptions[SWIG_CSharpIOException].callback = ioCallback;
+  SWIG_csharp_exceptions[SWIG_CSharpNullReferenceException].callback = nullReferenceCallback;
+  SWIG_csharp_exceptions[SWIG_CSharpOutOfMemoryException].callback = outOfMemoryCallback;
+  SWIG_csharp_exceptions[SWIG_CSharpOverflowException].callback = overflowCallback;
+  SWIG_csharp_exceptions[SWIG_CSharpSystemException].callback = systemCallback;
+}
+
+#ifdef __cplusplus
+extern "C" 
+#endif
+SWIGEXPORT void SWIGSTDCALL SWIGRegisterExceptionArgumentCallbacks_ESL(
+                                                SWIG_CSharpExceptionArgumentCallback_t argumentCallback,
+                                                SWIG_CSharpExceptionArgumentCallback_t argumentNullCallback,
+                                                SWIG_CSharpExceptionArgumentCallback_t argumentOutOfRangeCallback) {
+  SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback = argumentCallback;
+  SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentNullException].callback = argumentNullCallback;
+  SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentOutOfRangeException].callback = argumentOutOfRangeCallback;
+}
+
+
+/* Callback for returning strings to C# without leaking memory */
+typedef char * (SWIGSTDCALL* SWIG_CSharpStringHelperCallback)(const char *);
+static SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback = NULL;
+
+
+#ifdef __cplusplus
+extern "C" 
+#endif
+SWIGEXPORT void SWIGSTDCALL SWIGRegisterStringCallback_ESL(SWIG_CSharpStringHelperCallback callback) {
+  SWIG_csharp_string_callback = callback;
+}
+
+
+/* Contract support */
+
+#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentOutOfRangeException, msg, ""); return nullreturn; } else
+
+
+#include "esl.h"
+#include "esl_oop.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT void SWIGSTDCALL CSharp_ESLevent_Event_set(void * jarg1, void * jarg2) {
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  esl_event_t *arg2 = (esl_event_t *) 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  arg2 = (esl_event_t *)jarg2; 
+  if (arg1) (arg1)->event = arg2;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLevent_Event_get(void * jarg1) {
+  void * jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  esl_event_t *result = 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  result = (esl_event_t *) ((arg1)->event);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_ESLevent_SerializedString_set(void * jarg1, char * jarg2) {
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *arg2 = (char *) 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  arg2 = (char *)jarg2; 
+  {
+    delete [] arg1->serialized_string;
+    if (arg2) {
+      arg1->serialized_string = (char *) (new char[strlen((const char *)arg2)+1]);
+      strcpy((char *)arg1->serialized_string, (const char *)arg2);
+    } else {
+      arg1->serialized_string = 0;
+    }
+  }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_SerializedString_get(void * jarg1) {
+  char * jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  result = (char *) ((arg1)->serialized_string);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_ESLevent_Mine_set(void * jarg1, int jarg2) {
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  int arg2 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  arg2 = (int)jarg2; 
+  if (arg1) (arg1)->mine = arg2;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_ESLevent_Mine_get(void * jarg1) {
+  int jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  int result;
+  
+  arg1 = (ESLevent *)jarg1; 
+  result = (int) ((arg1)->mine);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLevent__SWIG_0(char * jarg1, char * jarg2) {
+  void * jresult ;
+  char *arg1 = (char *) 0 ;
+  char *arg2 = (char *) NULL ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (char *)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (ESLevent *)new ESLevent((char const *)arg1,(char const *)arg2);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLevent__SWIG_1(void * jarg1, int jarg2) {
+  void * jresult ;
+  esl_event_t *arg1 = (esl_event_t *) 0 ;
+  int arg2 = (int) 0 ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (esl_event_t *)jarg1; 
+  arg2 = (int)jarg2; 
+  result = (ESLevent *)new ESLevent(arg1,arg2);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLevent__SWIG_2(void * jarg1) {
+  void * jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  result = (ESLevent *)new ESLevent(arg1);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_delete_ESLevent(void * jarg1) {
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  delete arg1;
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_Serialize(void * jarg1, char * jarg2) {
+  char * jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *arg2 = (char *) NULL ;
+  char *result = 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (char *)(arg1)->serialize((char const *)arg2);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_SetPriority(void * jarg1, void * jarg2) {
+  unsigned int jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  esl_priority_t arg2 = (esl_priority_t) ESL_PRIORITY_NORMAL ;
+  esl_priority_t *argp2 ;
+  bool result;
+  
+  arg1 = (ESLevent *)jarg1; 
+  argp2 = (esl_priority_t *)jarg2; 
+  if (!argp2) {
+    SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null esl_priority_t", 0);
+    return 0;
+  }
+  arg2 = *argp2; 
+  result = (bool)(arg1)->setPriority(arg2);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_GetHeader(void * jarg1, char * jarg2, int jarg3) {
+  char * jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *arg2 = (char *) 0 ;
+  int arg3 = (int) -1 ;
+  char *result = 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (int)jarg3; 
+  result = (char *)(arg1)->getHeader((char const *)arg2,arg3);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_GetBody(void * jarg1) {
+  char * jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  result = (char *)(arg1)->getBody();
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_getType(void * jarg1) {
+  char * jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  result = (char *)(arg1)->getType();
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_AddBody(void * jarg1, char * jarg2) {
+  unsigned int jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *arg2 = (char *) 0 ;
+  bool result;
+  
+  arg1 = (ESLevent *)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (bool)(arg1)->addBody((char const *)arg2);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_AddHeader(void * jarg1, char * jarg2, char * jarg3) {
+  unsigned int jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  bool result;
+  
+  arg1 = (ESLevent *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  result = (bool)(arg1)->addHeader((char const *)arg2,(char const *)arg3);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_pushHeader(void * jarg1, char * jarg2, char * jarg3) {
+  unsigned int jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  bool result;
+  
+  arg1 = (ESLevent *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  result = (bool)(arg1)->pushHeader((char const *)arg2,(char const *)arg3);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_unshiftHeader(void * jarg1, char * jarg2, char * jarg3) {
+  unsigned int jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  bool result;
+  
+  arg1 = (ESLevent *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  result = (bool)(arg1)->unshiftHeader((char const *)arg2,(char const *)arg3);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT unsigned int SWIGSTDCALL CSharp_ESLevent_DelHeader(void * jarg1, char * jarg2) {
+  unsigned int jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *arg2 = (char *) 0 ;
+  bool result;
+  
+  arg1 = (ESLevent *)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (bool)(arg1)->delHeader((char const *)arg2);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_FirstHeader(void * jarg1) {
+  char * jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  result = (char *)(arg1)->firstHeader();
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_ESLevent_NextHeader(void * jarg1) {
+  char * jresult ;
+  ESLevent *arg1 = (ESLevent *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (ESLevent *)jarg1; 
+  result = (char *)(arg1)->nextHeader();
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_0(char * jarg1, int jarg2, char * jarg3, char * jarg4) {
+  void * jresult ;
+  char *arg1 = (char *) 0 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  ESLconnection *result = 0 ;
+  
+  arg1 = (char *)jarg1; 
+  arg2 = (int)jarg2; 
+  arg3 = (char *)jarg3; 
+  arg4 = (char *)jarg4; 
+  result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_1(char * jarg1, int jarg2, char * jarg3) {
+  void * jresult ;
+  char *arg1 = (char *) 0 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  ESLconnection *result = 0 ;
+  
+  arg1 = (char *)jarg1; 
+  arg2 = (int)jarg2; 
+  arg3 = (char *)jarg3; 
+  result = (ESLconnection *)new ESLconnection((char const *)arg1,arg2,(char const *)arg3);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_2(char * jarg1, char * jarg2, char * jarg3, char * jarg4) {
+  void * jresult ;
+  char *arg1 = (char *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  ESLconnection *result = 0 ;
+  
+  arg1 = (char *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  arg4 = (char *)jarg4; 
+  result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_3(char * jarg1, char * jarg2, char * jarg3) {
+  void * jresult ;
+  char *arg1 = (char *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  ESLconnection *result = 0 ;
+  
+  arg1 = (char *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  result = (ESLconnection *)new ESLconnection((char const *)arg1,(char const *)arg2,(char const *)arg3);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_ESLconnection__SWIG_4(int jarg1) {
+  void * jresult ;
+  int arg1 ;
+  ESLconnection *result = 0 ;
+  
+  arg1 = (int)jarg1; 
+  result = (ESLconnection *)new ESLconnection(arg1);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_delete_ESLconnection(void * jarg1) {
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  delete arg1;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_SocketDescriptor(void * jarg1) {
+  int jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  int result;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  result = (int)(arg1)->socketDescriptor();
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_Connected(void * jarg1) {
+  int jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  int result;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  result = (int)(arg1)->connected();
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_GetInfo(void * jarg1) {
+  void * jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  result = (ESLevent *)(arg1)->getInfo();
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_Send(void * jarg1, char * jarg2) {
+  int jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  char *arg2 = (char *) 0 ;
+  int result;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (int)(arg1)->send((char const *)arg2);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_SendRecv(void * jarg1, char * jarg2) {
+  void * jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  char *arg2 = (char *) 0 ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (ESLevent *)(arg1)->sendRecv((char const *)arg2);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Api(void * jarg1, char * jarg2, char * jarg3) {
+  void * jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) NULL ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  result = (ESLevent *)(arg1)->api((char const *)arg2,(char const *)arg3);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Bgapi(void * jarg1, char * jarg2, char * jarg3, char * jarg4) {
+  void * jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) NULL ;
+  char *arg4 = (char *) NULL ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  arg4 = (char *)jarg4; 
+  result = (ESLevent *)(arg1)->bgapi((char const *)arg2,(char const *)arg3,(char const *)arg4);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_SendEvent(void * jarg1, void * jarg2) {
+  void * jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  ESLevent *arg2 = (ESLevent *) 0 ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (ESLevent *)jarg2; 
+  result = (ESLevent *)(arg1)->sendEvent(arg2);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_sendMSG(void * jarg1, void * jarg2, char * jarg3) {
+  int jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  ESLevent *arg2 = (ESLevent *) 0 ;
+  char *arg3 = (char *) NULL ;
+  int result;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (ESLevent *)jarg2; 
+  arg3 = (char *)jarg3; 
+  result = (int)(arg1)->sendMSG(arg2,(char const *)arg3);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_RecvEvent(void * jarg1) {
+  void * jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  result = (ESLevent *)(arg1)->recvEvent();
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_RecvEventTimed(void * jarg1, int jarg2) {
+  void * jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  int arg2 ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (int)jarg2; 
+  result = (ESLevent *)(arg1)->recvEventTimed(arg2);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Filter(void * jarg1, char * jarg2, char * jarg3) {
+  void * jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  result = (ESLevent *)(arg1)->filter((char const *)arg2,(char const *)arg3);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_Events(void * jarg1, char * jarg2, char * jarg3) {
+  int jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) 0 ;
+  int result;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  result = (int)(arg1)->events((char const *)arg2,(char const *)arg3);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_Execute(void * jarg1, char * jarg2, char * jarg3, char * jarg4) {
+  void * jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) NULL ;
+  char *arg4 = (char *) NULL ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  arg4 = (char *)jarg4; 
+  result = (ESLevent *)(arg1)->execute((char const *)arg2,(char const *)arg3,(char const *)arg4);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_ESLconnection_ExecuteAsync(void * jarg1, char * jarg2, char * jarg3, char * jarg4) {
+  void * jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  char *arg2 = (char *) 0 ;
+  char *arg3 = (char *) NULL ;
+  char *arg4 = (char *) NULL ;
+  ESLevent *result = 0 ;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (char *)jarg2; 
+  arg3 = (char *)jarg3; 
+  arg4 = (char *)jarg4; 
+  result = (ESLevent *)(arg1)->executeAsync((char const *)arg2,(char const *)arg3,(char const *)arg4);
+  jresult = (void *)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_SetAsyncExecute(void * jarg1, char * jarg2) {
+  int jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  char *arg2 = (char *) 0 ;
+  int result;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (int)(arg1)->setAsyncExecute((char const *)arg2);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_SetEventLock(void * jarg1, char * jarg2) {
+  int jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  char *arg2 = (char *) 0 ;
+  int result;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (int)(arg1)->setEventLock((char const *)arg2);
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_ESLconnection_Disconnect(void * jarg1) {
+  int jresult ;
+  ESLconnection *arg1 = (ESLconnection *) 0 ;
+  int result;
+  
+  arg1 = (ESLconnection *)jarg1; 
+  result = (int)(arg1)->disconnect();
+  jresult = result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_eslSetLogLevel(int jarg1) {
+  int arg1 ;
+  
+  arg1 = (int)jarg1; 
+  eslSetLogLevel(arg1);
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/libs/esl/managed/esl_wrap.cpp b/libs/esl/managed/esl_wrap.cpp
index 9c36dd75c4..adce6159a0 100644
--- a/libs/esl/managed/esl_wrap.cpp
+++ b/libs/esl/managed/esl_wrap.cpp
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.12
  *
  * This file is not intended to be easily readable and contains a number of
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -8,7 +8,11 @@
  * interface file instead.
  * ----------------------------------------------------------------------------- */
 
+
+#ifndef SWIGCSHARP
 #define SWIGCSHARP
+#endif
+
 
 
 #ifdef __cplusplus
@@ -101,9 +105,11 @@ template  T SwigValueInit() {
 #endif
 
 /* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#  ifndef GCC_HASCLASSVISIBILITY
-#    define GCC_HASCLASSVISIBILITY
+#if defined(__GNUC__)
+#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#    ifndef GCC_HASCLASSVISIBILITY
+#      define GCC_HASCLASSVISIBILITY
+#    endif
 #  endif
 #endif
 
@@ -142,6 +148,19 @@ template  T SwigValueInit() {
 # define _SCL_SECURE_NO_DEPRECATE
 #endif
 
+/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
+#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
+# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
+#endif
+
+/* Intel's compiler complains if a variable which was never initialised is
+ * cast to void, which is a common idiom which we use to indicate that we
+ * are aware a variable isn't used.  So we just silence that warning.
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
+ */
+#ifdef __INTEL_COMPILER
+# pragma warning disable 592
+#endif
 
 
 #include 
diff --git a/libs/esl/managed/managed_esl.2008.sln b/libs/esl/managed/managed_esl.2008.sln
deleted file mode 100644
index fd5f490d5a..0000000000
--- a/libs/esl/managed/managed_esl.2008.sln
+++ /dev/null
@@ -1,60 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ESL", "ESL.vcproj", "{FEA2D0AE-6713-4E41-A473-A143849BC7FF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEsl", "ManagedEsl.csproj", "{DEE5837B-E01D-4223-B351-EDF9418F3F8E}"
-	ProjectSection(ProjectDependencies) = postProject
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF} = {FEA2D0AE-6713-4E41-A473-A143849BC7FF}
-	EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEslTest", "ManagedEslTest\ManagedEslTest.csproj", "{2321D01A-D64B-4461-9837-FACF38652212}"
-	ProjectSection(ProjectDependencies) = postProject
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF} = {FEA2D0AE-6713-4E41-A473-A143849BC7FF}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Debug|Mixed Platforms = Debug|Mixed Platforms
-		Debug|Win32 = Debug|Win32
-		Release|Any CPU = Release|Any CPU
-		Release|Mixed Platforms = Release|Mixed Platforms
-		Release|Win32 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Any CPU.ActiveCfg = Debug|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Mixed Platforms.Build.0 = Debug|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Win32.Build.0 = Debug|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Any CPU.ActiveCfg = Release|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Mixed Platforms.ActiveCfg = Release|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Mixed Platforms.Build.0 = Release|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Win32.ActiveCfg = Release|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Win32.Build.0 = Release|Win32
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Win32.ActiveCfg = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Any CPU.Build.0 = Release|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Win32.ActiveCfg = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Win32.ActiveCfg = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Any CPU.Build.0 = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Win32.ActiveCfg = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/libs/esl/managed/managed_esl.2010.sln b/libs/esl/managed/managed_esl.2010.sln
deleted file mode 100644
index 78c5420542..0000000000
--- a/libs/esl/managed/managed_esl.2010.sln
+++ /dev/null
@@ -1,52 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ESL", "ESL.2010.vcxproj", "{FEA2D0AE-6713-4E41-A473-A143849BC7FF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEsl.2010", "ManagedEsl.2010.csproj", "{DEE5837B-E01D-4223-B351-EDF9418F3F8E}"
-	ProjectSection(ProjectDependencies) = postProject
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF} = {FEA2D0AE-6713-4E41-A473-A143849BC7FF}
-	EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEslTest.2010", "ManagedEslTest\ManagedEslTest.2010.csproj", "{2321D01A-D64B-4461-9837-FACF38652212}"
-	ProjectSection(ProjectDependencies) = postProject
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF} = {FEA2D0AE-6713-4E41-A473-A143849BC7FF}
-	EndProjectSection
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|Win32.Build.0 = Debug|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|x64.ActiveCfg = Debug|x64
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Debug|x64.Build.0 = Debug|x64
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Win32.ActiveCfg = Release|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|Win32.Build.0 = Release|Win32
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|x64.ActiveCfg = Release|x64
-		{FEA2D0AE-6713-4E41-A473-A143849BC7FF}.Release|x64.Build.0 = Release|x64
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Win32.ActiveCfg = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|Win32.Build.0 = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Debug|x64.Build.0 = Debug|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Win32.ActiveCfg = Release|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|Win32.Build.0 = Release|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|x64.ActiveCfg = Release|Any CPU
-		{DEE5837B-E01D-4223-B351-EDF9418F3F8E}.Release|x64.Build.0 = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Win32.ActiveCfg = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|Win32.Build.0 = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Debug|x64.Build.0 = Debug|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Win32.ActiveCfg = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|Win32.Build.0 = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|x64.ActiveCfg = Release|Any CPU
-		{2321D01A-D64B-4461-9837-FACF38652212}.Release|x64.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
diff --git a/libs/esl/managed/runswig.2010.cmd b/libs/esl/managed/runswig.2015.cmd
similarity index 50%
rename from libs/esl/managed/runswig.2010.cmd
rename to libs/esl/managed/runswig.2015.cmd
index 2e7999dafa..13e94018b8 100644
--- a/libs/esl/managed/runswig.2010.cmd
+++ b/libs/esl/managed/runswig.2015.cmd
@@ -1,25 +1,25 @@
-move esl_wrap.cpp esl_wrap.bak
-move esl.cs esl.bak
-move ESLconnection.cs ESLconnection.bak
-move ESLevent.cs ESLevent.bak
-move ESLPINVOKE.cs ESLPINVOKE.bak
-move SWIGTYPE_p_esl_event_t.cs SWIGTYPE_p_esl_event_t.bak
-move SWIGTYPE_p_esl_priority_t.cs SWIGTYPE_p_esl_priority_t.bak
-
-\dev\swig20\swig.exe -module ESL -csharp -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
-
-move esl_wrap.cpp esl_wrap.2010.cpp
-move esl.cs esl.2010.cs
-move ESLconnection.cs ESLconnection.2010.cs
-move ESLevent.cs ESLevent.2010.cs
-move ESLPINVOKE.cs ESLPINVOKE.2010.cs
-move SWIGTYPE_p_esl_event_t.cs SWIGTYPE_p_esl_event_t.2010.cs
-move SWIGTYPE_p_esl_priority_t.cs SWIGTYPE_p_esl_priority_t.2010.cs
-
-move esl_wrap.bak esl_wrap.cpp
-move esl.bak esl.cs
-move ESLconnection.bak ESLconnection.cs
-move ESLevent.bak ESLevent.cs
-move ESLPINVOKE.bak ESLPINVOKE.cs
-move SWIGTYPE_p_esl_event_t.bak SWIGTYPE_p_esl_event_t.cs
-move SWIGTYPE_p_esl_priority_t.bak SWIGTYPE_p_esl_priority_t.cs
\ No newline at end of file
+move esl_wrap.cpp esl_wrap.bak
+move esl.cs esl.bak
+move ESLconnection.cs ESLconnection.bak
+move ESLevent.cs ESLevent.bak
+move ESLPINVOKE.cs ESLPINVOKE.bak
+move SWIGTYPE_p_esl_event_t.cs SWIGTYPE_p_esl_event_t.bak
+move SWIGTYPE_p_esl_priority_t.cs SWIGTYPE_p_esl_priority_t.bak
+
+swig\swig.exe -module ESL -csharp -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
+
+move esl_wrap.cpp esl_wrap.2015.cpp
+move esl.cs esl.2015.cs
+move ESLconnection.cs ESLconnection.2015.cs
+move ESLevent.cs ESLevent.2015.cs
+move ESLPINVOKE.cs ESLPINVOKE.2015.cs
+move SWIGTYPE_p_esl_event_t.cs SWIGTYPE_p_esl_event_t.2015.cs
+move SWIGTYPE_p_esl_priority_t.cs SWIGTYPE_p_esl_priority_t.2015.cs
+
+move esl_wrap.bak esl_wrap.cpp
+move esl.bak esl.cs
+move ESLconnection.bak ESLconnection.cs
+move ESLevent.bak ESLevent.cs
+move ESLPINVOKE.bak ESLPINVOKE.cs
+move SWIGTYPE_p_esl_event_t.bak SWIGTYPE_p_esl_event_t.cs
+move SWIGTYPE_p_esl_priority_t.bak SWIGTYPE_p_esl_priority_t.cs
diff --git a/libs/esl/src/esl.2010.vcxproj.filters b/libs/esl/src/esl.2010.vcxproj.filters
deleted file mode 100644
index 9f202cffab..0000000000
--- a/libs/esl/src/esl.2010.vcxproj.filters
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-  
-    
-      {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
-      cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-    
-    
-      {93995380-89BD-4b04-88EB-625FBE52EBFB}
-      h;hpp;hxx;hm;inl;inc;xsd
-    
-  
-  
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-    
-      Source Files
-    
-  
-  
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-    
-      Header Files
-    
-  
-
\ No newline at end of file
diff --git a/libs/esl/src/esl.2015.vcxproj b/libs/esl/src/libesl.2015.vcxproj
similarity index 96%
rename from libs/esl/src/esl.2015.vcxproj
rename to libs/esl/src/libesl.2015.vcxproj
index b35f24a25c..3c6376d123 100644
--- a/libs/esl/src/esl.2015.vcxproj
+++ b/libs/esl/src/libesl.2015.vcxproj
@@ -1,158 +1,158 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    esl
-    {CF405366-9558-4AE8-90EF-5E21B51CCB4E}
-    esl
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      Disabled
-      include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level4
-      false
-      28253;28252;6031;4267;4244;4706;4100;%(DisableSpecificWarnings)
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level4
-      false
-      28253;28252;6031;4267;4244;4706;4100;%(DisableSpecificWarnings)
-      true
-    
-  
-  
-    
-      include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Level4
-      false
-      28253;28252;6031;4267;4244;4706;4100;%(DisableSpecificWarnings)
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Level4
-      false
-      28253;28252;6031;4267;4244;4706;4100;%(DisableSpecificWarnings)
-      true
-    
-  
-  
-    
-    
-    
-      6001;%(DisableSpecificWarnings)
-      6001;%(DisableSpecificWarnings)
-      6001;%(DisableSpecificWarnings)
-      6001;%(DisableSpecificWarnings)
-    
-    
-    
-      28125;%(DisableSpecificWarnings)
-      28125;%(DisableSpecificWarnings)
-      28125;%(DisableSpecificWarnings)
-      28125;%(DisableSpecificWarnings)
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-  
-  
-  
-  
-
\ No newline at end of file
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libesl
+    {CF405366-9558-4AE8-90EF-5E21B51CCB4E}
+    libesl
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v140
+  
+  
+    StaticLibrary
+    Unicode
+    v140
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v140
+  
+  
+    StaticLibrary
+    Unicode
+    v140
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      Disabled
+      include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level4
+      false
+      28253;28252;6031;4267;4244;4706;4100;%(DisableSpecificWarnings)
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level4
+      false
+      28253;28252;6031;4267;4244;4706;4100;%(DisableSpecificWarnings)
+      true
+    
+  
+  
+    
+      include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Level4
+      false
+      28253;28252;6031;4267;4244;4706;4100;%(DisableSpecificWarnings)
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Level4
+      false
+      28253;28252;6031;4267;4244;4706;4100;%(DisableSpecificWarnings)
+      true
+    
+  
+  
+    
+    
+    
+      6001;%(DisableSpecificWarnings)
+      6001;%(DisableSpecificWarnings)
+      6001;%(DisableSpecificWarnings)
+      6001;%(DisableSpecificWarnings)
+    
+    
+    
+      28125;%(DisableSpecificWarnings)
+      28125;%(DisableSpecificWarnings)
+      28125;%(DisableSpecificWarnings)
+      28125;%(DisableSpecificWarnings)
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+  
+  
+  
+  
+
diff --git a/src/mod/applications/mod_hash/mod_hash.2015.vcxproj b/src/mod/applications/mod_hash/mod_hash.2015.vcxproj
index b4a39b403f..cb03f0bc62 100644
--- a/src/mod/applications/mod_hash/mod_hash.2015.vcxproj
+++ b/src/mod/applications/mod_hash/mod_hash.2015.vcxproj
@@ -152,7 +152,7 @@
     
   
   
-    
+    
       {cf405366-9558-4ae8-90ef-5e21b51ccb4e}
     
     

From 5efecb1ffa83f674aa85e5a69f28764fdad63859 Mon Sep 17 00:00:00 2001
From: Brian West 
Date: Fri, 11 May 2018 09:16:13 -0500
Subject: [PATCH 217/264] FS-11156: [mod_dptools] wait for ack in application
 "deflect" #resolve

---
 src/mod/applications/mod_dptools/mod_dptools.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c
index 4cc8dfab64..d70a613b4a 100644
--- a/src/mod/applications/mod_dptools/mod_dptools.c
+++ b/src/mod/applications/mod_dptools/mod_dptools.c
@@ -1512,7 +1512,9 @@ SWITCH_STANDARD_APP(respond_function)
 SWITCH_STANDARD_APP(deflect_function)
 {
 	switch_core_session_message_t msg = { 0 };
+	switch_channel_t *channel = switch_core_session_get_channel(session);
 
+	switch_channel_wait_for_flag(channel, CF_MEDIA_ACK, SWITCH_TRUE, 10000, NULL);
 	/* Tell the channel to deflect the call */
 	msg.from = __FILE__;
 	msg.string_arg = data;

From 3e5938a540be1d0d6c96e611822b7a266444c833 Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Mon, 14 May 2018 19:02:54 -0400
Subject: [PATCH 218/264] FS-11162: [zrtp] Hangup race causing rare crash on
 zrtp calls

---
 src/switch_rtp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/switch_rtp.c b/src/switch_rtp.c
index a45a0a66c5..58232552e7 100644
--- a/src/switch_rtp.c
+++ b/src/switch_rtp.c
@@ -1330,6 +1330,10 @@ static int zrtp_send_rtp_callback(const zrtp_stream_t *stream, char *rtp_packet,
 	switch_size_t len = rtp_packet_length;
 	zrtp_status_t status = zrtp_status_ok;
 
+	if (!rtp_session->sock_output) {
+		return status;
+	}
+
 	switch_socket_sendto(rtp_session->sock_output, rtp_session->remote_addr, 0, rtp_packet, &len);
 	return status;
 }

From fef3711e31bf4ceeadc6d37b37e6b90330f61635 Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Tue, 15 May 2018 17:09:55 -0500
Subject: [PATCH 219/264] FS-11164: [freeswitch-core] Improve audio JB in bad
 conditions #resolve

---
 src/switch_jitterbuffer.c | 86 +++++++++++++++++++++++++--------------
 src/switch_rtp.c          | 12 +++++-
 2 files changed, 67 insertions(+), 31 deletions(-)

diff --git a/src/switch_jitterbuffer.c b/src/switch_jitterbuffer.c
index 7f5d444f42..7a74e9bd9d 100644
--- a/src/switch_jitterbuffer.c
+++ b/src/switch_jitterbuffer.c
@@ -200,6 +200,8 @@ switch_jb_node_t *sort_nodes(switch_jb_node_t *list, int (*cmp)(const void *, co
 	}
 }
 
+static inline void thin_frames(switch_jb_t *jb, int freq, int max);
+
 
 static inline switch_jb_node_t *new_node(switch_jb_t *jb)
 {
@@ -214,7 +216,7 @@ static inline switch_jb_node_t *new_node(switch_jb_t *jb)
 	}
 
 	if (!np) {
-		int mult = 25;
+		int mult = 2;
 
 		if (jb->type != SJB_VIDEO) {
 			mult = 2;
@@ -223,14 +225,14 @@ static inline switch_jb_node_t *new_node(switch_jb_t *jb)
 				mult = jb->max_packet_len;
 			}
 		}
-		
+
 		if (jb->allocated_nodes > jb->max_frame_len * mult) {
 			jb_debug(jb, 2, "ALLOCATED FRAMES TOO HIGH! %d\n", jb->allocated_nodes);
 			switch_jb_reset(jb);
 			switch_mutex_unlock(jb->list_mutex);
 			return NULL;
 		}
-
+		
 		np = switch_core_alloc(jb->pool, sizeof(*np));
 		jb->allocated_nodes++;
 		np->next = jb->node_list;
@@ -391,24 +393,25 @@ static inline uint32_t jb_find_lowest_ts(switch_jb_t *jb)
 
 static inline void thin_frames(switch_jb_t *jb, int freq, int max)
 {
-	switch_jb_node_t *node;
+	switch_jb_node_t *node, *this_node;
 	int i = -1;
 	int dropped = 0;
 
 	switch_mutex_lock(jb->list_mutex);
 	node = jb->node_list;
 
-	for (node = jb->node_list; node && jb->complete_frames > jb->max_frame_len && dropped < max; node = node->next) {
-
-		if (node->visible) {
+	while (node && dropped <= max) {
+		this_node = node;
+		node = node->next;
+		
+		if (this_node->visible) {
 			i++;
 		} else {
 			continue;
 		}
 
 		if ((i % freq) == 0) {
-			drop_ts(jb, node->packet.header.ts);
-			node = jb->node_list;
+			drop_ts(jb, this_node->packet.header.ts);
 			dropped++;
 		}
 	}
@@ -418,7 +421,6 @@ static inline void thin_frames(switch_jb_t *jb, int freq, int max)
 }
 
 
-
 #if 0
 static inline switch_jb_node_t *jb_find_highest_node(switch_jb_t *jb)
 {
@@ -437,6 +439,7 @@ static inline switch_jb_node_t *jb_find_highest_node(switch_jb_t *jb)
 	return highest ? highest : NULL;
 }
 
+
 static inline uint32_t jb_find_highest_ts(switch_jb_t *jb)
 {
 	switch_jb_node_t *highest = jb_find_highest_node(jb);
@@ -444,6 +447,17 @@ static inline uint32_t jb_find_highest_ts(switch_jb_t *jb)
 	return highest ? highest->packet.header.ts : 0;
 }
 
+static inline void drop_newest_frame(switch_jb_t *jb)
+{
+	uint32_t ts = jb_find_highest_ts(jb);
+
+	drop_ts(jb, ts);
+	jb_debug(jb, 1, "Dropping highest frame ts:%u\n", ntohl(ts));
+}
+
+
+
+
 static inline switch_jb_node_t *jb_find_penultimate_node(switch_jb_t *jb)
 {
 	switch_jb_node_t *np, *highest = NULL, *second_highest = NULL;
@@ -572,15 +586,9 @@ static inline void drop_oldest_frame(switch_jb_t *jb)
 	jb_debug(jb, 1, "Dropping oldest frame ts:%u\n", ntohl(ts));
 }
 
+
+
 #if 0
-static inline void drop_newest_frame(switch_jb_t *jb)
-{
-	uint32_t ts = jb_find_highest_ts(jb);
-
-	drop_ts(jb, ts);
-	jb_debug(jb, 1, "Dropping highest frame ts:%u\n", ntohl(ts));
-}
-
 static inline void drop_second_newest_frame(switch_jb_t *jb)
 {
 	switch_jb_node_t *second_newest = jb_find_penultimate_node(jb);
@@ -1241,6 +1249,7 @@ SWITCH_DECLARE(switch_status_t) switch_jb_put_packet(switch_jb_t *jb, switch_rtp
 		}
 	}
 
+
 	add_node(jb, packet, len);
 
 	if (switch_test_flag(jb, SJB_QUEUE_ONLY) && jb->complete_frames > jb->max_frame_len) {
@@ -1283,7 +1292,8 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
 	switch_jb_node_t *node = NULL;
 	switch_status_t status;
 	int plc = 0;
-
+	int too_big = 0;
+	
 	switch_mutex_lock(jb->mutex);
 
 	if (jb->complete_frames == 0) {
@@ -1350,10 +1360,10 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
 
 	jb->period_miss_pct = ((double)jb->period_miss_count / jb->period_count) * 100;
 
-	if (jb->period_miss_pct > 60.0f) {
-		jb_debug(jb, 2, "Miss percent %02f too high, resetting buffer.\n", jb->period_miss_pct);
-		switch_jb_reset(jb);
-	}
+	//if (jb->period_miss_pct > 60.0f) {
+	//	jb_debug(jb, 2, "Miss percent %02f too high, resetting buffer.\n", jb->period_miss_pct);
+	//	switch_jb_reset(jb);
+	//}
 
 	if ((status = jb_next_packet(jb, &node)) == SWITCH_STATUS_SUCCESS) {
 		jb_debug(jb, 2, "Found next frame cur ts: %u seq: %u\n", htonl(node->packet.header.ts), htons(node->packet.header.seq));
@@ -1397,7 +1407,7 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
 			case SWITCH_STATUS_NOTFOUND:
 			default:
 				if (jb->consec_miss_count > jb->frame_len) {
-					switch_jb_reset(jb);
+					//switch_jb_reset(jb);
 					jb_frame_inc(jb, 1);
 					jb_debug(jb, 2, "%s", "Too many frames not found, RESIZE\n");
 					switch_goto_status(SWITCH_STATUS_RESTART, end);
@@ -1445,15 +1455,31 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
 
 	switch_mutex_unlock(jb->mutex);
 
-	if (jb->complete_frames > jb->max_frame_len) {
-		thin_frames(jb, 8, 25);
+	if (jb->type == SJB_VIDEO) {
+		too_big = jb->max_frame_len * 15;
+	} else {
+		too_big = (int)(jb->max_frame_len * 1.5);
+	}
+	
+	if (jb->visible_nodes > too_big) {
+		//if (jb->complete_frames > jb->max_frame_len) {
+		//int b4 = jb->visible_nodes;
+		//thin_frames(jb, 2, jb->max_frame_len / 2);
+		//jb_debug(jb, 2, "JB TOO BIG (%d/%d), DROP SOME\n", b4, jb->visible_nodes);
+		//switch_jb_reset(jb);
 	}
 
-	if (jb->complete_frames > jb->max_frame_len * 2) {
-		jb_debug(jb, 2, "JB TOO BIG (%d), RESET\n", jb->complete_frames);
-		switch_jb_reset(jb);
-	}
+	//if (jb->complete_frames > jb->max_frame_len * 2) {
+	//	jb_debug(jb, 2, "JB TOO BIG (%d), RESET\n", jb->complete_frames);
+	//	switch_jb_reset(jb);
+	//}
 
+	if (jb->visible_nodes > too_big && status == SWITCH_STATUS_SUCCESS) {
+	//if (jb->frame_len >= jb->max_frame_len && status == SWITCH_STATUS_SUCCESS) {
+	//if (jb->allocated_nodes > jb->max_frame_len) {
+		status = SWITCH_STATUS_TIMEOUT;
+	}
+	
 	return status;
 }
 
diff --git a/src/switch_rtp.c b/src/switch_rtp.c
index 58232552e7..d7f72204c1 100644
--- a/src/switch_rtp.c
+++ b/src/switch_rtp.c
@@ -477,6 +477,7 @@ struct switch_rtp {
 	uint8_t punts;
 	uint8_t clean;
 	uint32_t last_max_vb_frames;
+	int skip_timer;
 #ifdef ENABLE_ZRTP
 	zrtp_session_t *zrtp_session;
 	zrtp_profile_t *zrtp_profile;
@@ -6296,8 +6297,12 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
 			case SWITCH_STATUS_BREAK:
 				break;
 			case SWITCH_STATUS_SUCCESS:
+			case SWITCH_STATUS_TIMEOUT:
 			default:
 				{
+					if (status == SWITCH_STATUS_TIMEOUT) {
+						rtp_session->skip_timer = 1;
+					}
 					rtp_session->stats.inbound.jb_packet_count++;
 					status = SWITCH_STATUS_SUCCESS;
 					rtp_session->last_rtp_hdr = rtp_session->recv_msg.header;
@@ -7098,7 +7103,12 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
 					if (slept) {
 						switch_cond_next();
 					} else {
-						switch_core_timer_next(&rtp_session->timer);
+						if (rtp_session->skip_timer) {
+							rtp_session->skip_timer = 0;
+							switch_cond_next();
+						} else {
+							switch_core_timer_next(&rtp_session->timer);
+						}
 						slept++;
 					}
 

From 13e77721bc8b56a8635be3e4d7efa0f6ff3d69b7 Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Tue, 15 May 2018 17:11:16 -0500
Subject: [PATCH 220/264] FS-11165: [freeswitch-core] Add more regex handling
 to dmachine #resolve

---
 src/switch_ivr_async.c | 67 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 60 insertions(+), 7 deletions(-)

diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c
index bb574ee828..bdbbe390b5 100644
--- a/src/switch_ivr_async.c
+++ b/src/switch_ivr_async.c
@@ -40,6 +40,9 @@
 
 struct switch_ivr_dmachine_binding {
 	char *digits;
+	char *repl;
+	int first_match;
+	char *substituted;
 	int32_t key;
 	uint8_t rmatch;
 	switch_ivr_dmachine_callback_t callback;
@@ -258,6 +261,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_bind(switch_ivr_dmachine_t *
 	switch_size_t len;
 	dm_binding_head_t *headp;
 	const char *msg = "";
+	char *repl = NULL;
+	char *digits_;
 
 	if (strlen(digits) > DMACHINE_MAX_DIGIT_LEN -1) {
 		return SWITCH_STATUS_FALSE;
@@ -286,16 +291,28 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_bind(switch_ivr_dmachine_t *
 
 	binding = switch_core_alloc(dmachine->pool, sizeof(*binding));
 
-	if (*digits == '~') {
+	digits_ = switch_core_strdup(dmachine->pool, digits);
+
+	if (*digits_ == '=') {
+		binding->first_match = 1;
+		digits_++;
+	}
+	
+	if (*digits_ == '~') {
 		binding->is_regex = 1;
-		digits++;
+		digits_++;
+		if ((repl = strchr(digits_, '~')) && *(repl+1) == '~') {
+			*repl++ = '\0';
+			*repl++ = '\0';
+		}
 	}
 
 	binding->key = key;
-	binding->digits = switch_core_strdup(dmachine->pool, digits);
+	binding->digits = digits_;
 	binding->is_priority = is_priority;
 	binding->callback = callback;
 	binding->user_data = user_data;
+	binding->repl = repl;
 
 	if (headp->tail) {
 		headp->tail->next = binding;
@@ -349,13 +366,44 @@ static dm_match_t switch_ivr_dmachine_check_match(switch_ivr_dmachine_t *dmachin
 
 	for(bp = dmachine->realm->binding_list; bp; bp = bp->next) {
 		if (bp->is_regex) {
-			switch_status_t r_status = switch_regex_match(dmachine->digits, bp->digits);
+			if (bp->repl) {
+				int ovector[30] = { 0 };
+				int proceed = 0;
+				switch_regex_t *re = NULL;
 
-			bp->rmatch = r_status == SWITCH_STATUS_SUCCESS;
+				
+				proceed = switch_regex_perform(dmachine->digits, bp->digits, &re, ovector, sizeof(ovector) / sizeof(ovector[0]));
+				
+				if (proceed) {
+					char *substituted = NULL;
+					switch_size_t len;
+				
+					len = (strlen(dmachine->digits) + strlen(bp->digits) + 10) * proceed;
+					substituted = malloc(len);
+					switch_assert(substituted);
+					memset(substituted, 0, len);
+					switch_perform_substitution(re, proceed, bp->repl, dmachine->digits, substituted, len, ovector);
+
+					if (!bp->substituted || strcmp(substituted, bp->substituted)) {
+						bp->substituted = switch_core_strdup(dmachine->pool, substituted);
+					}
+					free(substituted);
+					switch_regex_safe_free(re);
+					bp->rmatch = 1;
+				} else {
+					bp->substituted = NULL;
+					bp->rmatch = 0;
+				}
+			} else {
+				switch_status_t r_status = switch_regex_match(dmachine->digits, bp->digits);
+				bp->rmatch = r_status == SWITCH_STATUS_SUCCESS;
+			}
 
 			rmatches++;
 			pmatches++;
 
+			if (bp->rmatch && bp->first_match) break;
+			
 		} else {
 			if (!strncmp(dmachine->digits, bp->digits, strlen(dmachine->digits))) {
 				pmatches++;
@@ -383,7 +431,7 @@ static dm_match_t switch_ivr_dmachine_check_match(switch_ivr_dmachine_t *dmachin
 	for(bp = dmachine->realm->binding_list; bp; bp = bp->next) {
 		if (bp->is_regex) {
 			if (bp->rmatch) {
-				if ((bp->is_priority && ! ematches) || is_timeout || (bp == dmachine->realm->binding_list && !bp->next)) {
+				if (bp->first_match || (bp->is_priority && ! ematches) || is_timeout || (bp == dmachine->realm->binding_list && !bp->next)) {
 					best = DM_MATCH_EXACT;
 					exact_bp = bp;
 					break;
@@ -434,7 +482,12 @@ static dm_match_t switch_ivr_dmachine_check_match(switch_ivr_dmachine_t *dmachin
 
 	if (r_bp) {
 		dmachine->last_matching_binding = r_bp;
-		switch_set_string(dmachine->last_matching_digits, dmachine->digits);
+
+		if (r_bp->substituted) {
+			switch_set_string(dmachine->last_matching_digits, r_bp->substituted);
+		} else {
+			switch_set_string(dmachine->last_matching_digits, dmachine->digits);
+		}
 		best = DM_MATCH_EXACT;
 	}
 

From 611e38e8cb0cae2817d3122df2f307b2cc862072 Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Tue, 15 May 2018 17:48:53 -0500
Subject: [PATCH 221/264] FS-11165: [freeswitch-core] Add more regex handling
 to dmachine -- squashme #resolve

---
 src/switch_ivr_async.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c
index bdbbe390b5..8d1609ac2d 100644
--- a/src/switch_ivr_async.c
+++ b/src/switch_ivr_async.c
@@ -441,10 +441,10 @@ static dm_match_t switch_ivr_dmachine_check_match(switch_ivr_dmachine_t *dmachin
 		} else {
 			int pmatch = !strncmp(dmachine->digits, bp->digits, strlen(dmachine->digits));
 
-			if (!exact_bp && pmatch && (!rmatches || bp->is_priority || is_timeout) && !strcmp(bp->digits, dmachine->digits)) {
+			if (!exact_bp && pmatch && (bp->first_match || !rmatches || bp->is_priority || is_timeout) && !strcmp(bp->digits, dmachine->digits)) {
 				best = DM_MATCH_EXACT;
 				exact_bp = bp;
-				if (bp->is_priority || dmachine->cur_digit_len == dmachine->max_digit_len) break;
+				if (bp->first_match || bp->is_priority || dmachine->cur_digit_len == dmachine->max_digit_len) break;
 			}
 
 			if (!(both_bp && partial_bp) && strlen(bp->digits) != strlen(dmachine->digits) && pmatch) {

From 578d914b9680ad0497aea7724ad4194444188187 Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Fri, 25 May 2018 11:07:24 -0500
Subject: [PATCH 222/264] FS-11164: [freeswitch-core] Improve audio JB in bad
 conditions

---
 .../applications/mod_commands/mod_commands.c  | 40 +++++++++++++++++++
 src/switch_jitterbuffer.c                     | 34 +++++-----------
 src/switch_vpx.c                              |  6 +--
 3 files changed, 53 insertions(+), 27 deletions(-)

diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c
index 5b8e1a1cc9..1c3e59adfb 100644
--- a/src/mod/applications/mod_commands/mod_commands.c
+++ b/src/mod/applications/mod_commands/mod_commands.c
@@ -4435,6 +4435,44 @@ SWITCH_STANDARD_API(uuid_video_bitrate_function)
 	return SWITCH_STATUS_SUCCESS;
 }
 
+
+#define VIDEO_BITRATE_SYNTAX " "
+SWITCH_STANDARD_API(uuid_video_bandwidth_function)
+{
+	switch_status_t status = SWITCH_STATUS_FALSE;
+	char *mycmd = NULL, *argv[2] = { 0 };
+	int argc = 0;
+
+	if (!zstr(cmd) && (mycmd = strdup(cmd))) {
+		argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+	}
+
+	if (argc < 2) {
+		stream->write_function(stream, "-USAGE: %s\n", VIDEO_REFRESH_SYNTAX);
+	} else {
+		switch_core_session_t *lsession = NULL;
+
+		if ((lsession = switch_core_session_locate(argv[0]))) {
+			int kps;
+
+			kps = switch_parse_bandwidth_string(argv[1]);
+			switch_core_media_set_outgoing_bitrate(lsession, SWITCH_MEDIA_TYPE_VIDEO, kps);
+			status = SWITCH_STATUS_SUCCESS;
+			switch_core_session_rwunlock(lsession);
+		}
+	}
+
+	if (status == SWITCH_STATUS_SUCCESS) {
+		stream->write_function(stream, "+OK Success\n");
+	} else {
+		stream->write_function(stream, "-ERR Operation Failed\n");
+	}
+
+	switch_safe_free(mycmd);
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
 #define CODEC_DEBUG_SYNTAX " audio|video "
 SWITCH_STANDARD_API(uuid_codec_debug_function)
 {
@@ -7496,6 +7534,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
 	SWITCH_ADD_API(commands_api_interface, "uuid_send_info", "Send info to the endpoint", uuid_send_info_function, INFO_SYNTAX);
 	SWITCH_ADD_API(commands_api_interface, "uuid_set_media_stats", "Set media stats", uuid_set_media_stats, UUID_MEDIA_STATS_SYNTAX);
 	SWITCH_ADD_API(commands_api_interface, "uuid_video_bitrate", "Send video bitrate req.", uuid_video_bitrate_function, VIDEO_BITRATE_SYNTAX);
+	SWITCH_ADD_API(commands_api_interface, "uuid_video_bandwidth", "Send video bandwidth", uuid_video_bandwidth_function, VIDEO_BITRATE_SYNTAX);
 	SWITCH_ADD_API(commands_api_interface, "uuid_video_refresh", "Send video refresh.", uuid_video_refresh_function, VIDEO_REFRESH_SYNTAX);
 	SWITCH_ADD_API(commands_api_interface, "uuid_outgoing_answer", "Answer outgoing channel", outgoing_answer_function, OUTGOING_ANSWER_SYNTAX);
 	SWITCH_ADD_API(commands_api_interface, "uuid_limit", "Increase limit resource", uuid_limit_function, LIMIT_SYNTAX);
@@ -7719,6 +7758,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
 	switch_console_set_complete("add uuid_dual_transfer ::console::list_uuid");
 	switch_console_set_complete("add uuid_video_refresh ::console::list_uuid");
 	switch_console_set_complete("add uuid_video_bitrate ::console::list_uuid");
+	switch_console_set_complete("add uuid_video_bandwidth ::console::list_uuid");
 	switch_console_set_complete("add uuid_xfer_zombie ::console::list_uuid");
 	switch_console_set_complete("add version");
 	switch_console_set_complete("add uuid_warning ::console::list_uuid");
diff --git a/src/switch_jitterbuffer.c b/src/switch_jitterbuffer.c
index 7a74e9bd9d..7965413059 100644
--- a/src/switch_jitterbuffer.c
+++ b/src/switch_jitterbuffer.c
@@ -1292,7 +1292,6 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
 	switch_jb_node_t *node = NULL;
 	switch_status_t status;
 	int plc = 0;
-	int too_big = 0;
 	
 	switch_mutex_lock(jb->mutex);
 
@@ -1454,30 +1453,17 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
 	}
 
 	switch_mutex_unlock(jb->mutex);
-
-	if (jb->type == SJB_VIDEO) {
-		too_big = jb->max_frame_len * 15;
-	} else {
-		too_big = (int)(jb->max_frame_len * 1.5);
-	}
 	
-	if (jb->visible_nodes > too_big) {
-		//if (jb->complete_frames > jb->max_frame_len) {
-		//int b4 = jb->visible_nodes;
-		//thin_frames(jb, 2, jb->max_frame_len / 2);
-		//jb_debug(jb, 2, "JB TOO BIG (%d/%d), DROP SOME\n", b4, jb->visible_nodes);
-		//switch_jb_reset(jb);
-	}
-
-	//if (jb->complete_frames > jb->max_frame_len * 2) {
-	//	jb_debug(jb, 2, "JB TOO BIG (%d), RESET\n", jb->complete_frames);
-	//	switch_jb_reset(jb);
-	//}
-
-	if (jb->visible_nodes > too_big && status == SWITCH_STATUS_SUCCESS) {
-	//if (jb->frame_len >= jb->max_frame_len && status == SWITCH_STATUS_SUCCESS) {
-	//if (jb->allocated_nodes > jb->max_frame_len) {
-		status = SWITCH_STATUS_TIMEOUT;
+	if (jb->type == SJB_VIDEO) {
+		if (jb->complete_frames > jb->max_frame_len * 2) {
+			jb_debug(jb, 2, "JB TOO BIG (%d), RESET\n", jb->complete_frames);
+			switch_jb_reset(jb);
+		}
+	} else {
+		int too_big = (int)(jb->max_frame_len * 1.5);
+		if (jb->visible_nodes > too_big && status == SWITCH_STATUS_SUCCESS) {
+			status = SWITCH_STATUS_TIMEOUT;
+		}
 	}
 	
 	return status;
diff --git a/src/switch_vpx.c b/src/switch_vpx.c
index 02b5f3aadd..07cb64e40d 100644
--- a/src/switch_vpx.c
+++ b/src/switch_vpx.c
@@ -414,7 +414,7 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 	context->start_time = switch_micro_time_now();
 
 	config->g_timebase.num = 1;
-	config->g_timebase.den = 1000;//90000;
+	config->g_timebase.den = 90000;
 	config->g_pass = VPX_RC_ONE_PASS;
 	config->g_w = context->codec_settings.video.width;
 	config->g_h = context->codec_settings.video.height;
@@ -864,8 +864,8 @@ static switch_status_t switch_vpx_encode(switch_codec_t *codec, switch_frame_t *
 
 	context->framecount++;
 
-	pts = (now - context->start_time) / 1000;
-	//pts = frame->timestamp;
+	//pts = (now - context->start_time) / 1000;
+	pts = frame->timestamp;
 
 	dur = context->last_ms ? (now - context->last_ms) / 1000 : pts;
 

From d3d7b6878ee1873a9602e232e83b2439758be2ff Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Fri, 25 May 2018 19:18:04 -0500
Subject: [PATCH 223/264] FS-11173: [mod_conference] Don't send tmmbr for any
 higher than input res #resolve

---
 .../mod_conference/conference_video.c         | 25 ++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c
index 81f2fbc09d..86f41d9006 100644
--- a/src/mod/applications/mod_conference/conference_video.c
+++ b/src/mod/applications/mod_conference/conference_video.c
@@ -2875,6 +2875,13 @@ void conference_video_check_auto_bitrate(conference_member_t *member, mcu_layer_
 	int kps = 0, kps_in = 0;
 	int max = 0;
 	int min_layer = 0, min = 0;
+	int screen_w = 0, screen_h = 0;
+
+	if (layer) {
+		screen_w = layer->screen_w;
+		screen_h = layer->screen_h;
+	}
+	
 
 	if (!conference_utils_test_flag(member->conference, CFLAG_MANAGE_INBOUND_VIDEO_BITRATE) ||
 		switch_channel_test_flag(member->channel, CF_VIDEO_BITRATE_UNMANAGABLE)) {
@@ -2906,6 +2913,13 @@ void conference_video_check_auto_bitrate(conference_member_t *member, mcu_layer_
 
 	member->vid_params = vid_params;
 
+	if (member->vid_params.width && member->vid_params.height && (screen_w > member->vid_params.width || screen_h > member->vid_params.height)) {
+		//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s Layer is bigger than input res, limit size to %dx%d\n",
+		//switch_channel_get_name(member->channel), member->vid_params.width, member->vid_params.height);
+		screen_w = member->vid_params.width;
+		screen_h = member->vid_params.height;
+	}
+	
 	if (member->managed_kps_set) {
 		return;
 	}
@@ -2916,7 +2930,7 @@ void conference_video_check_auto_bitrate(conference_member_t *member, mcu_layer_
 	}
 
 	if (layer) {
-		kps = switch_calc_bitrate(layer->screen_w, layer->screen_h, member->conference->video_quality, (int)(member->conference->video_fps.fps));
+		kps = switch_calc_bitrate(screen_w, screen_h, member->conference->video_quality, (int)(member->conference->video_fps.fps));
 	} else {
 		kps = kps_in;
 	}
@@ -2940,8 +2954,13 @@ void conference_video_check_auto_bitrate(conference_member_t *member, mcu_layer_
 						  switch_channel_get_name(member->channel), kps);
 	} else {
 		if (layer && conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) {
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s auto-setting bitrate to %dkps to accommodate %dx%d resolution\n",
-							  switch_channel_get_name(member->channel), kps, layer->screen_w, layer->screen_h);
+			if (layer->screen_w != screen_w) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s auto-setting bitrate to %dkps (max res %dx%d) to accommodate %dx%d resolution\n",
+								  switch_channel_get_name(member->channel), kps, screen_w, screen_h, layer->screen_w, layer->screen_h);
+			} else {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s auto-setting bitrate to %dkps to accommodate %dx%d resolution\n",
+								  switch_channel_get_name(member->channel), kps, screen_w, screen_h);
+			}
 		} else {
 			kps = min;
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s auto-setting bitrate to %dkps because the user is not visible\n",

From fe8c1be575e2e2f9d1268479538ea0b56dd8ad5a Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Tue, 29 May 2018 14:04:41 -0500
Subject: [PATCH 224/264] FS-11177: [freeswitch-core] h264 vid tweaks #resolve

---
 src/mod/applications/mod_av/avcodec.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/mod/applications/mod_av/avcodec.c b/src/mod/applications/mod_av/avcodec.c
index 5994e48aba..96e6b154f0 100644
--- a/src/mod/applications/mod_av/avcodec.c
+++ b/src/mod/applications/mod_av/avcodec.c
@@ -829,7 +829,8 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt
 {
 	int sane = 0;
 	int threads = switch_core_cpu_count();
-
+	int fps = 15;
+	
 #ifdef NVENC_SUPPORT
 	if (!context->encoder) {
 		if (context->av_codec_id == AV_CODEC_ID_H264) {
@@ -903,10 +904,21 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt
 	}
 
 	if (threads > 4) threads = 4;
-	context->bandwidth *= 4;
 
+	context->bandwidth *= 3;
+
+	fps = context->codec_settings.video.fps;
+
+	if (!fps) fps = 20;
+		
 	context->encoder_ctx->bit_rate = context->bandwidth * 1024;
-
+	context->encoder_ctx->rc_min_rate = context->encoder_ctx->bit_rate;
+	context->encoder_ctx->rc_max_rate = context->encoder_ctx->bit_rate;
+	context->encoder_ctx->rc_buffer_size = context->encoder_ctx->bit_rate;
+	context->encoder_ctx->qcompress = 0.6;
+	context->encoder_ctx->gop_size = fps * 2;
+	context->encoder_ctx->keyint_min = fps * 2;
+	
 	context->encoder_ctx->width = context->codec_settings.video.width;
 	context->encoder_ctx->height = context->codec_settings.video.height;
 	/* frames per second */
@@ -915,9 +927,6 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt
 	context->encoder_ctx->pix_fmt = AV_PIX_FMT_YUV420P;
 	context->encoder_ctx->thread_count = threads;
 
-	context->encoder_ctx->rc_max_rate = context->bandwidth * 1024;
-	context->encoder_ctx->rc_buffer_size = context->bandwidth * 1024 * 4;
-
 	if (context->av_codec_id == AV_CODEC_ID_H263 || context->av_codec_id == AV_CODEC_ID_H263P) {
 #ifndef H263_MODE_B
 #    if defined(__ICL) || defined (__INTEL_COMPILER)
@@ -934,7 +943,6 @@ FF_DISABLE_DEPRECATION_WARNINGS
 		context->encoder_ctx->rtp_callback = rtp_callback;
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
-		context->encoder_ctx->rc_min_rate = context->encoder_ctx->rc_max_rate;
 		context->encoder_ctx->opaque = context;
 		av_opt_set_int(context->encoder_ctx->priv_data, "mb_info", SLICE_SIZE - 8, 0);
 	} else if (context->av_codec_id == AV_CODEC_ID_H264) {

From afcb1f8d51a32e7500af0ed702ea2202bcca2867 Mon Sep 17 00:00:00 2001
From: Joshua Young 
Date: Thu, 31 May 2018 18:24:32 -0400
Subject: [PATCH 225/264] FS-11178: [core] return switch_status_t from
 switch_ivr_intercept_session

---
 src/include/switch_ivr.h                      |  2 +-
 .../languages/mod_managed/freeswitch_wrap.cxx | 55 +++++++++++++++++--
 src/mod/languages/mod_managed/managed/swig.cs | 35 ++++++++++--
 src/switch_ivr_bridge.c                       | 15 ++---
 4 files changed, 90 insertions(+), 17 deletions(-)

diff --git a/src/include/switch_ivr.h b/src/include/switch_ivr.h
index 39f02339c8..a142927568 100644
--- a/src/include/switch_ivr.h
+++ b/src/include/switch_ivr.h
@@ -909,7 +909,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio
 #define switch_ivr_phrase_macro(session, macro_name, data, lang, args) switch_ivr_phrase_macro_event(session, macro_name, data, NULL, lang, args)
 SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint32_t delay_ms);
 SWITCH_DECLARE(switch_status_t) switch_ivr_find_bridged_uuid(const char *uuid, char *b_uuid, switch_size_t blen);
-SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid, switch_bool_t bleg);
+SWITCH_DECLARE(switch_status_t) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid, switch_bool_t bleg);
 SWITCH_DECLARE(void) switch_ivr_park_session(switch_core_session_t *session);
 SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t *session, switch_core_session_t *peer_session);
 
diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx
index 449dc0b525..5629ec362d 100644
--- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx
+++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx
@@ -20023,10 +20023,10 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_find_parameter(char * jarg1, char *
 SWIGEXPORT int SWIGSTDCALL CSharp_switch_true(char * jarg1) {
   int jresult ;
   char *arg1 = (char *) 0 ;
-  int result;
+  switch_bool_t result;
   
   arg1 = (char *)jarg1; 
-  result = (int)switch_true((char const *)arg1);
+  result = (switch_bool_t)switch_true((char const *)arg1);
   jresult = result; 
   return jresult;
 }
@@ -34833,6 +34833,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_pass_callee_id(void * jarg1, vo
 }
 
 
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_var_false(void * jarg1, char * jarg2) {
+  int jresult ;
+  switch_channel_t *arg1 = (switch_channel_t *) 0 ;
+  char *arg2 = (char *) 0 ;
+  int result;
+  
+  arg1 = (switch_channel_t *)jarg1; 
+  arg2 = (char *)jarg2; 
+  result = (int)switch_channel_var_false(arg1,(char const *)arg2);
+  jresult = result; 
+  return jresult;
+}
+
+
 SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_var_true(void * jarg1, char * jarg2) {
   int jresult ;
   switch_channel_t *arg1 = (switch_channel_t *) 0 ;
@@ -40954,15 +40968,19 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_find_bridged_uuid(char * jarg1, cha
 }
 
 
-SWIGEXPORT void SWIGSTDCALL CSharp_switch_ivr_intercept_session(void * jarg1, char * jarg2, int jarg3) {
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_intercept_session(void * jarg1, char * jarg2, int jarg3) {
+  int jresult ;
   switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
   char *arg2 = (char *) 0 ;
   switch_bool_t arg3 ;
+  switch_status_t result;
   
   arg1 = (switch_core_session_t *)jarg1; 
   arg2 = (char *)jarg2; 
   arg3 = (switch_bool_t)jarg3; 
-  switch_ivr_intercept_session(arg1,(char const *)arg2,arg3);
+  result = (switch_status_t)switch_ivr_intercept_session(arg1,(char const *)arg2,arg3);
+  jresult = result; 
+  return jresult;
 }
 
 
@@ -41935,6 +41953,35 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_name_get(void *
 }
 
 
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_alias_set(void * jarg1, char * jarg2) {
+  switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
+  char *arg2 = (char *) 0 ;
+  
+  arg1 = (switch_srtp_crypto_suite_s *)jarg1; 
+  arg2 = (char *)jarg2; 
+  {
+    if (arg2) {
+      arg1->alias = (char const *) (new char[strlen((const char *)arg2)+1]);
+      strcpy((char *)arg1->alias, (const char *)arg2);
+    } else {
+      arg1->alias = 0;
+    }
+  }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_alias_get(void * jarg1) {
+  char * jresult ;
+  switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (switch_srtp_crypto_suite_s *)jarg1; 
+  result = (char *) ((arg1)->alias);
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
 SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_type_set(void * jarg1, int jarg2) {
   switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
   switch_rtp_crypto_key_type_t arg2 ;
diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs
index fc4bf3cb1f..b66f1e845f 100644
--- a/src/mod/languages/mod_managed/managed/swig.cs
+++ b/src/mod/languages/mod_managed/managed/swig.cs
@@ -4019,8 +4019,8 @@ else
     return ret;
   }
 
-  public static int switch_true(string expr) {
-    int ret = freeswitchPINVOKE.switch_true(expr);
+  public static switch_bool_t switch_true(string expr) {
+    switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_true(expr);
     return ret;
   }
 
@@ -4842,6 +4842,11 @@ else
     return ret;
   }
 
+  public static int switch_channel_var_false(SWIGTYPE_p_switch_channel channel, string variable) {
+    int ret = freeswitchPINVOKE.switch_channel_var_false(SWIGTYPE_p_switch_channel.getCPtr(channel), variable);
+    return ret;
+  }
+
   public static int switch_channel_var_true(SWIGTYPE_p_switch_channel channel, string variable) {
     int ret = freeswitchPINVOKE.switch_channel_var_true(SWIGTYPE_p_switch_channel.getCPtr(channel), variable);
     return ret;
@@ -6397,8 +6402,9 @@ else
     return ret;
   }
 
-  public static void switch_ivr_intercept_session(SWIGTYPE_p_switch_core_session session, string uuid, switch_bool_t bleg) {
-    freeswitchPINVOKE.switch_ivr_intercept_session(SWIGTYPE_p_switch_core_session.getCPtr(session), uuid, (int)bleg);
+  public static switch_status_t switch_ivr_intercept_session(SWIGTYPE_p_switch_core_session session, string uuid, switch_bool_t bleg) {
+    switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_intercept_session(SWIGTYPE_p_switch_core_session.getCPtr(session), uuid, (int)bleg);
+    return ret;
   }
 
   public static void switch_ivr_park_session(SWIGTYPE_p_switch_core_session session) {
@@ -16707,6 +16713,9 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_pass_callee_id")]
   public static extern int switch_channel_pass_callee_id(HandleRef jarg1, HandleRef jarg2);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_var_false")]
+  public static extern int switch_channel_var_false(HandleRef jarg1, string jarg2);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_var_true")]
   public static extern int switch_channel_var_true(HandleRef jarg1, string jarg2);
 
@@ -18022,7 +18031,7 @@ class freeswitchPINVOKE {
   public static extern int switch_ivr_find_bridged_uuid(string jarg1, string jarg2, HandleRef jarg3);
 
   [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_intercept_session")]
-  public static extern void switch_ivr_intercept_session(HandleRef jarg1, string jarg2, int jarg3);
+  public static extern int switch_ivr_intercept_session(HandleRef jarg1, string jarg2, int jarg3);
 
   [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_park_session")]
   public static extern void switch_ivr_park_session(HandleRef jarg1);
@@ -18225,6 +18234,12 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_name_get")]
   public static extern string switch_srtp_crypto_suite_t_name_get(HandleRef jarg1);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_alias_set")]
+  public static extern void switch_srtp_crypto_suite_t_alias_set(HandleRef jarg1, string jarg2);
+
+  [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_alias_get")]
+  public static extern string switch_srtp_crypto_suite_t_alias_get(HandleRef jarg1);
+
   [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_type_set")]
   public static extern void switch_srtp_crypto_suite_t_type_set(HandleRef jarg1, int jarg2);
 
@@ -43150,6 +43165,16 @@ public class switch_srtp_crypto_suite_t : IDisposable {
     } 
   }
 
+  public string alias {
+    set {
+      freeswitchPINVOKE.switch_srtp_crypto_suite_t_alias_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.switch_srtp_crypto_suite_t_alias_get(swigCPtr);
+      return ret;
+    } 
+  }
+
   public switch_rtp_crypto_key_type_t type {
     set {
       freeswitchPINVOKE.switch_srtp_crypto_suite_t_type_set(swigCPtr, (int)value);
diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c
index 95ec9a4b2e..82f23cc3d3 100644
--- a/src/switch_ivr_bridge.c
+++ b/src/switch_ivr_bridge.c
@@ -2204,25 +2204,26 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_find_bridged_uuid(const char *uuid, c
 
 }
 
-SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid, switch_bool_t bleg)
+SWITCH_DECLARE(switch_status_t) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid, switch_bool_t bleg)
 {
 	switch_core_session_t *rsession, *bsession = NULL;
 	switch_channel_t *channel, *rchannel, *bchannel = NULL;
 	const char *buuid, *var;
 	char brto[SWITCH_UUID_FORMATTED_LENGTH + 1] = "";
+	switch_status_t status = SWITCH_STATUS_FALSE;
 
 	if (bleg) {
 		if (switch_ivr_find_bridged_uuid(uuid, brto, sizeof(brto)) == SWITCH_STATUS_SUCCESS) {
 			uuid = switch_core_session_strdup(session, brto);
 		} else {
 			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "no uuid bridged to %s\n", uuid);
-			return;
+			return status;
 		}
 	}
 
 	if (zstr(uuid) || !(rsession = switch_core_session_locate(uuid))) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "no uuid %s\n", uuid);
-		return;
+		return status;
 	}
 
 	channel = switch_core_session_get_channel(session);
@@ -2236,14 +2237,14 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session
 	if ((var = switch_channel_get_variable(channel, "intercept_unbridged_only")) && switch_true(var)) {
 		if ((switch_channel_test_flag(rchannel, CF_BRIDGED))) {
 			switch_core_session_rwunlock(rsession);
-			return;
+			return status;
 		}
 	}
 
 	if ((var = switch_channel_get_variable(channel, "intercept_unanswered_only")) && switch_true(var)) {
 		if ((switch_channel_test_flag(rchannel, CF_ANSWERED))) {
 			switch_core_session_rwunlock(rsession);
-			return;
+			return status;
 		}
 	}
 
@@ -2275,7 +2276,7 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session
 	}
 
 	switch_channel_set_flag(rchannel, CF_INTERCEPTED);
-	switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), uuid);
+	status = switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), uuid);
 	switch_core_session_rwunlock(rsession);
 
 	if (bsession) {
@@ -2283,7 +2284,7 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session
 		switch_core_session_rwunlock(bsession);
 	}
 
-
+	return status;
 
 }
 

From b81f432b8431d16033f74f9d678889e63f4ecebe Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Tue, 12 Jun 2018 18:07:34 -0500
Subject: [PATCH 226/264] FS-11177: [freeswitch-core] h264 vid tweaks --
 increase gop #resolve

---
 src/mod/applications/mod_av/avcodec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mod/applications/mod_av/avcodec.c b/src/mod/applications/mod_av/avcodec.c
index 96e6b154f0..d6bfca0167 100644
--- a/src/mod/applications/mod_av/avcodec.c
+++ b/src/mod/applications/mod_av/avcodec.c
@@ -916,8 +916,8 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt
 	context->encoder_ctx->rc_max_rate = context->encoder_ctx->bit_rate;
 	context->encoder_ctx->rc_buffer_size = context->encoder_ctx->bit_rate;
 	context->encoder_ctx->qcompress = 0.6;
-	context->encoder_ctx->gop_size = fps * 2;
-	context->encoder_ctx->keyint_min = fps * 2;
+	context->encoder_ctx->gop_size = 1000;
+	context->encoder_ctx->keyint_min = 1000;
 	
 	context->encoder_ctx->width = context->codec_settings.video.width;
 	context->encoder_ctx->height = context->codec_settings.video.height;

From a46cb42cdd69b33a2798b37aa8755dcec2d7027d Mon Sep 17 00:00:00 2001
From: Brian West 
Date: Wed, 13 Jun 2018 07:47:38 -0500
Subject: [PATCH 227/264] reswig

---
 src/mod/languages/mod_managed/managed/swig.cs | 14562 ++++++++--------
 1 file changed, 7281 insertions(+), 7281 deletions(-)

diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs
index b66f1e845f..630e932ceb 100644
--- a/src/mod/languages/mod_managed/managed/swig.cs
+++ b/src/mod/languages/mod_managed/managed/swig.cs
@@ -75,91 +75,6 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
-public class audio_buffer_header_t : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal audio_buffer_header_t(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(audio_buffer_header_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~audio_buffer_header_t() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_audio_buffer_header_t(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public uint ts {
-    set {
-      freeswitchPINVOKE.audio_buffer_header_t_ts_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.audio_buffer_header_t_ts_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public uint len {
-    set {
-      freeswitchPINVOKE.audio_buffer_header_t_len_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.audio_buffer_header_t_len_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public audio_buffer_header_t() : this(freeswitchPINVOKE.new_audio_buffer_header_t(), true) {
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum cache_db_flag_t {
-  CDF_INUSE = (1 << 0),
-  CDF_PRUNE = (1 << 1)
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
 public class CoreSession : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;
@@ -536,150 +451,6 @@ public class CoreSession : IDisposable {
 
 namespace FreeSWITCH.Native {
 
-public enum dm_match_type_t {
-  DM_MATCH_POSITIVE,
-  DM_MATCH_NEGATIVE
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class dtls_fingerprint_t : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal dtls_fingerprint_t(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(dtls_fingerprint_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~dtls_fingerprint_t() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_dtls_fingerprint_t(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public uint len {
-    set {
-      freeswitchPINVOKE.dtls_fingerprint_t_len_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.dtls_fingerprint_t_len_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public SWIGTYPE_p_unsigned_char data {
-    set {
-      freeswitchPINVOKE.dtls_fingerprint_t_data_set(swigCPtr, SWIGTYPE_p_unsigned_char.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.dtls_fingerprint_t_data_get(swigCPtr);
-      SWIGTYPE_p_unsigned_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public string type {
-    set {
-      freeswitchPINVOKE.dtls_fingerprint_t_type_set(swigCPtr, value);
-    } 
-    get {
-      string ret = freeswitchPINVOKE.dtls_fingerprint_t_type_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public string str {
-    set {
-      freeswitchPINVOKE.dtls_fingerprint_t_str_set(swigCPtr, value);
-    } 
-    get {
-      string ret = freeswitchPINVOKE.dtls_fingerprint_t_str_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public dtls_fingerprint_t() : this(freeswitchPINVOKE.new_dtls_fingerprint_t(), true) {
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum dtls_state_t {
-  DS_OFF,
-  DS_HANDSHAKE,
-  DS_SETUP,
-  DS_READY,
-  DS_FAIL,
-  DS_INVALID
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum dtls_type_t {
-  DTLS_TYPE_CLIENT = (1 << 0),
-  DTLS_TYPE_SERVER = (1 << 1),
-  DTLS_TYPE_RTP = (1 << 2),
-  DTLS_TYPE_RTCP = (1 << 3)
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
 using System;
 using System.Runtime.InteropServices;
 
@@ -749,9 +520,131 @@ public class DTMF : IDisposable {
 
 namespace FreeSWITCH.Native {
 
-public enum dtmf_flag_t {
-  DTMF_FLAG_SKIP_PROCESS = (1 << 0),
-  DTMF_FLAG_SENSITIVE = (1 << 1)
+using System;
+using System.Runtime.InteropServices;
+
+public partial class Event : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal Event(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(Event obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~Event() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_Event(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public switch_event InternalEvent {
+    set {
+      freeswitchPINVOKE.Event_InternalEvent_set(swigCPtr, switch_event.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.Event_InternalEvent_get(swigCPtr);
+      switch_event ret = (cPtr == IntPtr.Zero) ? null : new switch_event(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public string serialized_string {
+    set {
+      freeswitchPINVOKE.Event_serialized_string_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.Event_serialized_string_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public int mine {
+    set {
+      freeswitchPINVOKE.Event_mine_set(swigCPtr, value);
+    } 
+    get {
+      int ret = freeswitchPINVOKE.Event_mine_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public Event(string type, string subclass_name) : this(freeswitchPINVOKE.new_Event__SWIG_0(type, subclass_name), true) {
+  }
+
+  public Event(switch_event wrap_me, int free_me) : this(freeswitchPINVOKE.new_Event__SWIG_1(switch_event.getCPtr(wrap_me), free_me), true) {
+  }
+
+  public int chat_execute(string app, string data) {
+    int ret = freeswitchPINVOKE.Event_chat_execute(swigCPtr, app, data);
+    return ret;
+  }
+
+  public int chat_send(string dest_proto) {
+    int ret = freeswitchPINVOKE.Event_chat_send(swigCPtr, dest_proto);
+    return ret;
+  }
+
+  public string Serialize(string format) {
+    string ret = freeswitchPINVOKE.Event_Serialize(swigCPtr, format);
+    return ret;
+  }
+
+  public bool SetPriority(switch_priority_t priority) {
+    bool ret = freeswitchPINVOKE.Event_SetPriority(swigCPtr, (int)priority);
+    return ret;
+  }
+
+  public string GetHeader(string header_name) {
+    string ret = freeswitchPINVOKE.Event_GetHeader(swigCPtr, header_name);
+    return ret;
+  }
+
+  public string GetBody() {
+    string ret = freeswitchPINVOKE.Event_GetBody(swigCPtr);
+    return ret;
+  }
+
+  public string GetEventType() {
+    string ret = freeswitchPINVOKE.Event_GetEventType(swigCPtr);
+    return ret;
+  }
+
+  public bool AddBody(string value) {
+    bool ret = freeswitchPINVOKE.Event_AddBody(swigCPtr, value);
+    return ret;
+  }
+
+  public bool AddHeader(string header_name, string value) {
+    bool ret = freeswitchPINVOKE.Event_AddHeader(swigCPtr, header_name, value);
+    return ret;
+  }
+
+  public bool DeleteHeader(string header_name) {
+    bool ret = freeswitchPINVOKE.Event_DeleteHeader(swigCPtr, header_name);
+    return ret;
+  }
+
+  public bool Fire() {
+    bool ret = freeswitchPINVOKE.Event_Fire(swigCPtr);
+    return ret;
+  }
+
 }
 
 }
@@ -904,20 +797,20 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
-public partial class Event : IDisposable {
+public class IvrMenu : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;
 
-  internal Event(IntPtr cPtr, bool cMemoryOwn) {
+  internal IvrMenu(IntPtr cPtr, bool cMemoryOwn) {
     swigCMemOwn = cMemoryOwn;
     swigCPtr = new HandleRef(this, cPtr);
   }
 
-  internal static HandleRef getCPtr(Event obj) {
+  internal static HandleRef getCPtr(IvrMenu obj) {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
   }
 
-  ~Event() {
+  ~IvrMenu() {
     Dispose();
   }
 
@@ -926,7 +819,7 @@ public partial class Event : IDisposable {
       if (swigCPtr.Handle != IntPtr.Zero) {
         if (swigCMemOwn) {
           swigCMemOwn = false;
-          freeswitchPINVOKE.delete_Event(swigCPtr);
+          freeswitchPINVOKE.delete_IvrMenu(swigCPtr);
         }
         swigCPtr = new HandleRef(null, IntPtr.Zero);
       }
@@ -934,98 +827,6746 @@ public partial class Event : IDisposable {
     }
   }
 
-  public switch_event InternalEvent {
+  public IvrMenu(IvrMenu main, string name, string greeting_sound, string short_greeting_sound, string invalid_sound, string exit_sound, string transfer_sound, string confirm_macro, string confirm_key, string tts_engine, string tts_voice, int confirm_attempts, int inter_timeout, int digit_len, int timeout, int max_failures, int max_timeouts) : this(freeswitchPINVOKE.new_IvrMenu(IvrMenu.getCPtr(main), name, greeting_sound, short_greeting_sound, invalid_sound, exit_sound, transfer_sound, confirm_macro, confirm_key, tts_engine, tts_voice, confirm_attempts, inter_timeout, digit_len, timeout, max_failures, max_timeouts), true) {
+  }
+
+  public void bindAction(string action, string arg, string bind) {
+    freeswitchPINVOKE.IvrMenu_bindAction(swigCPtr, action, arg, bind);
+  }
+
+  public void Execute(CoreSession session, string name) {
+    freeswitchPINVOKE.IvrMenu_Execute(swigCPtr, CoreSession.getCPtr(session), name);
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public partial class ManagedSession : CoreSession {
+  private HandleRef swigCPtr;
+
+  internal ManagedSession(IntPtr cPtr, bool cMemoryOwn) : base(freeswitchPINVOKE.ManagedSession_SWIGUpcast(cPtr), cMemoryOwn) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(ManagedSession obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~ManagedSession() {
+    Dispose();
+  }
+
+  public override void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_ManagedSession(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+      base.Dispose();
+    }
+  }
+
+  public ManagedSession() : this(freeswitchPINVOKE.new_ManagedSession__SWIG_0(), true) {
+  }
+
+  public ManagedSession(string uuid) : this(freeswitchPINVOKE.new_ManagedSession__SWIG_1(uuid), true) {
+  }
+
+  public ManagedSession(SWIGTYPE_p_switch_core_session session) : this(freeswitchPINVOKE.new_ManagedSession__SWIG_2(SWIGTYPE_p_switch_core_session.getCPtr(session)), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_FILE {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_FILE(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_FILE() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_FILE obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_a_256__char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_a_256__char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_a_256__char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_a_256__char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_a_2__icand_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_a_2__icand_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_a_2__icand_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_a_2__icand_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_apr_pool_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_apr_pool_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_apr_pool_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_apr_pool_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_cJSON {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_cJSON(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_cJSON() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_cJSON obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_codec__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_codec__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_codec__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session__int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session__int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session__int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session__int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_void__p_void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_void__p_void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_void__p_void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_void__p_void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_event__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_event__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_event__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_event__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_event__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_event__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_media_bug_p_void__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_media_bug_p_void__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_media_bug_p_void__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_media_bug_p_void__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_scheduler_task__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_scheduler_task__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_scheduler_task__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_scheduler_task__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_timer__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_timer__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_timer__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_timer__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_void__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_void__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_void__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_void_p_q_const__char__int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_void_p_q_const__char__int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_void_p_q_const__char__int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_p_q_const__char__int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_void_p_switch_event__int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_void_p_switch_event__int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_void_p_switch_event__int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_p_switch_event__int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_void__p_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_void__p_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_void__p_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_void__p_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_void__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_void__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_void__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_void__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_float {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_float(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_float() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_float obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_in6_addr {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_in6_addr(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_in6_addr() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_in6_addr obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_apr_pool_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_apr_pool_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_apr_pool_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_apr_pool_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_cJSON {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_cJSON(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_cJSON() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_cJSON obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_p_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_p_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_p_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_p_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_payload_map_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_payload_map_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_payload_map_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_payload_map_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_real_pcre {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_real_pcre(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_real_pcre() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_real_pcre obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_sqlite3 {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_sqlite3(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_sqlite3() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_sqlite3 obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_sqlite3_stmt {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_sqlite3_stmt(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_sqlite3_stmt() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_sqlite3_stmt obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_agc_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_agc_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_agc_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_agc_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_audio_resampler_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_audio_resampler_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_audio_resampler_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_audio_resampler_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_buffer {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_buffer(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_buffer() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_buffer obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_cache_db_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_cache_db_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_cache_db_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_caller_extension {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_caller_extension(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_caller_extension() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_caller_extension obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_channel {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_channel(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_channel() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_channel obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_codec_implementation {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_codec_implementation(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_codec_implementation() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_codec_implementation obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_console_callback_match {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_console_callback_match(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_console_callback_match() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_console_callback_match obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_core_port_allocator {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_core_port_allocator(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_core_port_allocator() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_port_allocator obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_core_session {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_core_session(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_core_session() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_session obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_core_session_message {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_core_session_message(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_core_session_message() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_session_message obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_device_record_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_device_record_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_device_record_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_device_record_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_event {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_event(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_event() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_event obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_event_node {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_event_node(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_event_node() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_event_node obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_file_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_file_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_file_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_file_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_frame {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_frame(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_frame() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_frame obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_frame_buffer_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_frame_buffer_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_frame_buffer_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_frame_buffer_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_hashtable {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_hashtable(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_hashtable() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_hashtable obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_hashtable_iterator {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_hashtable_iterator(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_hashtable_iterator() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_hashtable_iterator obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_digit_stream {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_digit_stream(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_digit_stream() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_digit_stream obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_digit_stream_parser {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_digit_stream_parser(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_digit_stream_parser() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_digit_stream_parser obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_dmachine {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_dmachine(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_dmachine() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_dmachine obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_dmachine_match {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_dmachine_match(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_dmachine_match() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_dmachine_match obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_menu {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_menu(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_menu() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_menu obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_menu_xml_ctx {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_menu_xml_ctx(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_menu_xml_ctx() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_menu_xml_ctx obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_live_array_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_live_array_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_live_array_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_live_array_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_log_node_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_log_node_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_log_node_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_log_node_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_media_bug {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_media_bug(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_media_bug() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_media_bug obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_network_list {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_network_list(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_network_list() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_network_list obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_rtp {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_rtp(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_rtp() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_rtp obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_say_file_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_say_file_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_say_file_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_say_file_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_sql_queue_manager {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_sql_queue_manager(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_sql_queue_manager() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_sql_queue_manager obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_thread_data_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_thread_data_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_thread_data_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_thread_data_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_xml {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_xml(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_xml() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_xml_binding {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_xml_binding(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_xml_binding() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml_binding obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_unsigned_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_unsigned_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_unsigned_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_unsigned_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_pid_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_pid_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_pid_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_pid_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_real_pcre {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_real_pcre(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_real_pcre() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_real_pcre obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_short {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_short(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_short() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_short obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_sockaddr {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_sockaddr(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_sockaddr() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_sockaddr obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_sockaddr_in6 {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_sockaddr_in6(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_sockaddr_in6() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_sockaddr_in6 obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_socklen_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_socklen_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_socklen_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_socklen_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_sqlite3 {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_sqlite3(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_sqlite3() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_sqlite3 obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_sqlite3_stmt {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_sqlite3_stmt(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_sqlite3_stmt() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_sqlite3_stmt obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_agc_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_agc_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_agc_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_agc_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_buffer {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_buffer(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_buffer() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_buffer obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_cache_db_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_cache_db_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_cache_db_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_call_cause_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_call_cause_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_call_cause_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_call_cause_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_channel {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_channel(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_channel() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_channel obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_codec_control_type_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_codec_control_type_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_codec_control_type_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_codec_control_type_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_core_port_allocator {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_core_port_allocator(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_core_port_allocator() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_core_port_allocator obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_core_session {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_core_session(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_core_session() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_core_session obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_event_types_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_event_types_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_event_types_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_event_types_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_file_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_file_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_file_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_file_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_frame_buffer_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_frame_buffer_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_frame_buffer_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_frame_buffer_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_hashtable {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_hashtable(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_hashtable() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_hashtable obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_hashtable_iterator {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_hashtable_iterator(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_hashtable_iterator() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_hashtable_iterator obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_image_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_image_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_image_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_image_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_img_fmt_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_img_fmt_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_img_fmt_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_img_fmt_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_img_position_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_img_position_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_img_position_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_img_position_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_interval_time_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_interval_time_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_interval_time_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_interval_time_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_action_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_action_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_action_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_action_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_digit_stream {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_digit_stream(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_digit_stream() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_digit_stream obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_digit_stream_parser {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_digit_stream_parser(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_digit_stream_parser() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_digit_stream_parser obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_dmachine {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_dmachine(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_dmachine() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_dmachine obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_menu {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_menu(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_menu() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_menu_xml_ctx {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_menu_xml_ctx(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_menu_xml_ctx() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu_xml_ctx obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_jb_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_jb_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_jb_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_jb_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_live_array_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_live_array_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_live_array_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_live_array_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_media_bug {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_media_bug(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_media_bug() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_media_bug obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_mutex_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_mutex_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_mutex_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_mutex_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_network_list {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_network_list(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_network_list() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_network_list obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_odbc_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_odbc_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_odbc_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_odbc_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_pgsql_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_pgsql_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_pgsql_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_pgsql_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_pollfd_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_pollfd_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_pollfd_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_pollfd_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_queue_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_queue_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_queue_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_queue_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_rtcp_frame {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_rtcp_frame(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_rtcp_frame() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtcp_frame obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_rtp {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_rtp(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_rtp() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtp obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_rtp_flag_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_rtp_flag_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_rtp_flag_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtp_flag_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_say_file_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_say_file_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_say_file_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_say_file_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_size_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_size_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_size_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_size_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_sockaddr_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_sockaddr_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_sockaddr_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_sockaddr_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_socket_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_socket_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_socket_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_socket_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_sql_queue_manager {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_sql_queue_manager(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_sql_queue_manager() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_sql_queue_manager obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ssize_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ssize_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ssize_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ssize_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_thread_rwlock_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_thread_rwlock_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_thread_rwlock_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_rwlock_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_thread_start_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_thread_start_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_thread_start_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_start_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_thread_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_thread_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_thread_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_time_exp_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_time_exp_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_time_exp_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_time_exp_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_time_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_time_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_time_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_time_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_xml_binding {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_xml_binding(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_xml_binding() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_xml_binding obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_time_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_time_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_time_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_time_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_unsigned_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_unsigned_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_unsigned_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_unsigned_int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_unsigned_int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_unsigned_int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_unsigned_long {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_unsigned_long(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_unsigned_long() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_long obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_unsigned_short {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_unsigned_short(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_unsigned_short() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_short obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public partial class Stream : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal Stream(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(Stream obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~Stream() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_Stream(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public Stream() : this(freeswitchPINVOKE.new_Stream__SWIG_0(), true) {
+  }
+
+  public Stream(switch_stream_handle arg0) : this(freeswitchPINVOKE.new_Stream__SWIG_1(switch_stream_handle.getCPtr(arg0)), true) {
+  }
+
+  public string read(SWIGTYPE_p_int len) {
+    string ret = freeswitchPINVOKE.Stream_read(swigCPtr, SWIGTYPE_p_int.getCPtr(len));
+    return ret;
+  }
+
+  public void Write(string data) {
+    freeswitchPINVOKE.Stream_Write(swigCPtr, data);
+  }
+
+  public void raw_write(string data, int len) {
+    freeswitchPINVOKE.Stream_raw_write(swigCPtr, data, len);
+  }
+
+  public string get_data() {
+    string ret = freeswitchPINVOKE.Stream_get_data(swigCPtr);
+    return ret;
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class audio_buffer_header_t : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal audio_buffer_header_t(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(audio_buffer_header_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~audio_buffer_header_t() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_audio_buffer_header_t(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public uint ts {
     set {
-      freeswitchPINVOKE.Event_InternalEvent_set(swigCPtr, switch_event.getCPtr(value));
+      freeswitchPINVOKE.audio_buffer_header_t_ts_set(swigCPtr, value);
     } 
     get {
-      IntPtr cPtr = freeswitchPINVOKE.Event_InternalEvent_get(swigCPtr);
-      switch_event ret = (cPtr == IntPtr.Zero) ? null : new switch_event(cPtr, false);
+      uint ret = freeswitchPINVOKE.audio_buffer_header_t_ts_get(swigCPtr);
       return ret;
     } 
   }
 
-  public string serialized_string {
+  public uint len {
     set {
-      freeswitchPINVOKE.Event_serialized_string_set(swigCPtr, value);
+      freeswitchPINVOKE.audio_buffer_header_t_len_set(swigCPtr, value);
     } 
     get {
-      string ret = freeswitchPINVOKE.Event_serialized_string_get(swigCPtr);
+      uint ret = freeswitchPINVOKE.audio_buffer_header_t_len_get(swigCPtr);
       return ret;
     } 
   }
 
-  public int mine {
+  public audio_buffer_header_t() : this(freeswitchPINVOKE.new_audio_buffer_header_t(), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+public enum cache_db_flag_t {
+  CDF_INUSE = (1 << 0),
+  CDF_PRUNE = (1 << 1)
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+public enum dm_match_type_t {
+  DM_MATCH_POSITIVE,
+  DM_MATCH_NEGATIVE
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class dtls_fingerprint_t : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal dtls_fingerprint_t(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(dtls_fingerprint_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~dtls_fingerprint_t() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_dtls_fingerprint_t(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public uint len {
     set {
-      freeswitchPINVOKE.Event_mine_set(swigCPtr, value);
+      freeswitchPINVOKE.dtls_fingerprint_t_len_set(swigCPtr, value);
     } 
     get {
-      int ret = freeswitchPINVOKE.Event_mine_get(swigCPtr);
+      uint ret = freeswitchPINVOKE.dtls_fingerprint_t_len_get(swigCPtr);
       return ret;
     } 
   }
 
-  public Event(string type, string subclass_name) : this(freeswitchPINVOKE.new_Event__SWIG_0(type, subclass_name), true) {
+  public SWIGTYPE_p_unsigned_char data {
+    set {
+      freeswitchPINVOKE.dtls_fingerprint_t_data_set(swigCPtr, SWIGTYPE_p_unsigned_char.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.dtls_fingerprint_t_data_get(swigCPtr);
+      SWIGTYPE_p_unsigned_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
+      return ret;
+    } 
   }
 
-  public Event(switch_event wrap_me, int free_me) : this(freeswitchPINVOKE.new_Event__SWIG_1(switch_event.getCPtr(wrap_me), free_me), true) {
+  public string type {
+    set {
+      freeswitchPINVOKE.dtls_fingerprint_t_type_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.dtls_fingerprint_t_type_get(swigCPtr);
+      return ret;
+    } 
   }
 
-  public int chat_execute(string app, string data) {
-    int ret = freeswitchPINVOKE.Event_chat_execute(swigCPtr, app, data);
-    return ret;
+  public string str {
+    set {
+      freeswitchPINVOKE.dtls_fingerprint_t_str_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.dtls_fingerprint_t_str_get(swigCPtr);
+      return ret;
+    } 
   }
 
-  public int chat_send(string dest_proto) {
-    int ret = freeswitchPINVOKE.Event_chat_send(swigCPtr, dest_proto);
-    return ret;
+  public dtls_fingerprint_t() : this(freeswitchPINVOKE.new_dtls_fingerprint_t(), true) {
   }
 
-  public string Serialize(string format) {
-    string ret = freeswitchPINVOKE.Event_Serialize(swigCPtr, format);
-    return ret;
-  }
+}
 
-  public bool SetPriority(switch_priority_t priority) {
-    bool ret = freeswitchPINVOKE.Event_SetPriority(swigCPtr, (int)priority);
-    return ret;
-  }
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
 
-  public string GetHeader(string header_name) {
-    string ret = freeswitchPINVOKE.Event_GetHeader(swigCPtr, header_name);
-    return ret;
-  }
+namespace FreeSWITCH.Native {
 
-  public string GetBody() {
-    string ret = freeswitchPINVOKE.Event_GetBody(swigCPtr);
-    return ret;
-  }
+public enum dtls_state_t {
+  DS_OFF,
+  DS_HANDSHAKE,
+  DS_SETUP,
+  DS_READY,
+  DS_FAIL,
+  DS_INVALID
+}
 
-  public string GetEventType() {
-    string ret = freeswitchPINVOKE.Event_GetEventType(swigCPtr);
-    return ret;
-  }
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
 
-  public bool AddBody(string value) {
-    bool ret = freeswitchPINVOKE.Event_AddBody(swigCPtr, value);
-    return ret;
-  }
+namespace FreeSWITCH.Native {
 
-  public bool AddHeader(string header_name, string value) {
-    bool ret = freeswitchPINVOKE.Event_AddHeader(swigCPtr, header_name, value);
-    return ret;
-  }
+public enum dtls_type_t {
+  DTLS_TYPE_CLIENT = (1 << 0),
+  DTLS_TYPE_SERVER = (1 << 1),
+  DTLS_TYPE_RTP = (1 << 2),
+  DTLS_TYPE_RTCP = (1 << 3)
+}
 
-  public bool DeleteHeader(string header_name) {
-    bool ret = freeswitchPINVOKE.Event_DeleteHeader(swigCPtr, header_name);
-    return ret;
-  }
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
 
-  public bool Fire() {
-    bool ret = freeswitchPINVOKE.Event_Fire(swigCPtr);
-    return ret;
-  }
+namespace FreeSWITCH.Native {
 
+public enum dtmf_flag_t {
+  DTMF_FLAG_SKIP_PROCESS = (1 << 0),
+  DTMF_FLAG_SENSITIVE = (1 << 1)
 }
 
 }
@@ -20531,117 +27072,6 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
-public class IvrMenu : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal IvrMenu(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(IvrMenu obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~IvrMenu() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_IvrMenu(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public IvrMenu(IvrMenu main, string name, string greeting_sound, string short_greeting_sound, string invalid_sound, string exit_sound, string transfer_sound, string confirm_macro, string confirm_key, string tts_engine, string tts_voice, int confirm_attempts, int inter_timeout, int digit_len, int timeout, int max_failures, int max_timeouts) : this(freeswitchPINVOKE.new_IvrMenu(IvrMenu.getCPtr(main), name, greeting_sound, short_greeting_sound, invalid_sound, exit_sound, transfer_sound, confirm_macro, confirm_key, tts_engine, tts_voice, confirm_attempts, inter_timeout, digit_len, timeout, max_failures, max_timeouts), true) {
-  }
-
-  public void bindAction(string action, string arg, string bind) {
-    freeswitchPINVOKE.IvrMenu_bindAction(swigCPtr, action, arg, bind);
-  }
-
-  public void Execute(CoreSession session, string name) {
-    freeswitchPINVOKE.IvrMenu_Execute(swigCPtr, CoreSession.getCPtr(session), name);
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public partial class ManagedSession : CoreSession {
-  private HandleRef swigCPtr;
-
-  internal ManagedSession(IntPtr cPtr, bool cMemoryOwn) : base(freeswitchPINVOKE.ManagedSession_SWIGUpcast(cPtr), cMemoryOwn) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(ManagedSession obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~ManagedSession() {
-    Dispose();
-  }
-
-  public override void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_ManagedSession(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-      base.Dispose();
-    }
-  }
-
-  public ManagedSession() : this(freeswitchPINVOKE.new_ManagedSession__SWIG_0(), true) {
-  }
-
-  public ManagedSession(string uuid) : this(freeswitchPINVOKE.new_ManagedSession__SWIG_1(uuid), true) {
-  }
-
-  public ManagedSession(SWIGTYPE_p_switch_core_session session) : this(freeswitchPINVOKE.new_ManagedSession__SWIG_2(SWIGTYPE_p_switch_core_session.getCPtr(session)), true) {
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
 public class payload_map_t : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;
@@ -21124,6436 +27554,6 @@ namespace FreeSWITCH.Native {
 
 namespace FreeSWITCH.Native {
 
-using System;
-using System.Runtime.InteropServices;
-
-public partial class Stream : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal Stream(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(Stream obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~Stream() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_Stream(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public Stream() : this(freeswitchPINVOKE.new_Stream__SWIG_0(), true) {
-  }
-
-  public Stream(switch_stream_handle arg0) : this(freeswitchPINVOKE.new_Stream__SWIG_1(switch_stream_handle.getCPtr(arg0)), true) {
-  }
-
-  public string read(SWIGTYPE_p_int len) {
-    string ret = freeswitchPINVOKE.Stream_read(swigCPtr, SWIGTYPE_p_int.getCPtr(len));
-    return ret;
-  }
-
-  public void Write(string data) {
-    freeswitchPINVOKE.Stream_Write(swigCPtr, data);
-  }
-
-  public void raw_write(string data, int len) {
-    freeswitchPINVOKE.Stream_raw_write(swigCPtr, data, len);
-  }
-
-  public string get_data() {
-    string ret = freeswitchPINVOKE.Stream_get_data(swigCPtr);
-    return ret;
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_a_256__char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_a_256__char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_a_256__char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_a_256__char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_a_2__icand_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_a_2__icand_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_a_2__icand_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_a_2__icand_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_apr_pool_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_apr_pool_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_apr_pool_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_apr_pool_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_cJSON {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_cJSON(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_cJSON() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_cJSON obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_FILE {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_FILE(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_FILE() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_FILE obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_float {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_float(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_float() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_float obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_codec__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_codec__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_codec__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session__int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session__int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session__int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session__int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_void__p_void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_void__p_void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_void__p_void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_void__p_void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_event__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_event__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_event__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_event__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_event__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_event__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_media_bug_p_void__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_media_bug_p_void__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_media_bug_p_void__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_media_bug_p_void__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_scheduler_task__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_scheduler_task__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_scheduler_task__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_scheduler_task__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_timer__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_timer__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_timer__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_timer__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_void_p_q_const__char__int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_void_p_q_const__char__int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_void_p_q_const__char__int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_p_q_const__char__int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_void_p_switch_event__int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_void_p_switch_event__int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_void_p_switch_event__int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_p_switch_event__int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_void__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_void__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_void__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_void__p_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_void__p_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_void__p_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_void__p_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_void__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_void__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_void__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_void__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_in6_addr {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_in6_addr(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_in6_addr() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_in6_addr obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_apr_pool_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_apr_pool_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_apr_pool_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_apr_pool_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_cJSON {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_cJSON(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_cJSON() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_cJSON obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_pid_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_pid_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_pid_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_pid_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_payload_map_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_payload_map_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_payload_map_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_payload_map_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_p_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_p_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_p_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_p_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_real_pcre {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_real_pcre(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_real_pcre() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_real_pcre obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_sqlite3 {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_sqlite3(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_sqlite3() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_sqlite3 obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_sqlite3_stmt {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_sqlite3_stmt(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_sqlite3_stmt() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_sqlite3_stmt obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_agc_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_agc_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_agc_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_agc_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_audio_resampler_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_audio_resampler_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_audio_resampler_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_audio_resampler_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_buffer {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_buffer(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_buffer() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_buffer obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_cache_db_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_cache_db_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_cache_db_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_caller_extension {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_caller_extension(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_caller_extension() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_caller_extension obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_channel {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_channel(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_channel() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_channel obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_codec_implementation {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_codec_implementation(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_codec_implementation() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_codec_implementation obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_console_callback_match {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_console_callback_match(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_console_callback_match() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_console_callback_match obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_core_port_allocator {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_core_port_allocator(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_core_port_allocator() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_port_allocator obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_core_session {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_core_session(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_core_session() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_session obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_core_session_message {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_core_session_message(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_core_session_message() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_session_message obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_device_record_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_device_record_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_device_record_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_device_record_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_event {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_event(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_event() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_event obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_event_node {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_event_node(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_event_node() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_event_node obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_file_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_file_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_file_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_file_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_frame_buffer_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_frame_buffer_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_frame_buffer_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_frame_buffer_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_frame {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_frame(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_frame() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_frame obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_hashtable {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_hashtable(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_hashtable() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_hashtable obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_hashtable_iterator {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_hashtable_iterator(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_hashtable_iterator() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_hashtable_iterator obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_digit_stream {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_digit_stream(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_digit_stream() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_digit_stream obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_digit_stream_parser {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_digit_stream_parser(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_digit_stream_parser() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_digit_stream_parser obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_dmachine {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_dmachine(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_dmachine() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_dmachine obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_dmachine_match {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_dmachine_match(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_dmachine_match() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_dmachine_match obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_menu {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_menu(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_menu() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_menu obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_menu_xml_ctx {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_menu_xml_ctx(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_menu_xml_ctx() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_menu_xml_ctx obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_live_array_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_live_array_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_live_array_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_live_array_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_log_node_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_log_node_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_log_node_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_log_node_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_media_bug {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_media_bug(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_media_bug() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_media_bug obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_network_list {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_network_list(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_network_list() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_network_list obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_rtp {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_rtp(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_rtp() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_rtp obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_say_file_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_say_file_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_say_file_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_say_file_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_sql_queue_manager {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_sql_queue_manager(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_sql_queue_manager() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_sql_queue_manager obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_thread_data_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_thread_data_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_thread_data_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_thread_data_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_xml_binding {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_xml_binding(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_xml_binding() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml_binding obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_xml {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_xml(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_xml() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_unsigned_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_unsigned_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_unsigned_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_unsigned_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_real_pcre {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_real_pcre(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_real_pcre() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_real_pcre obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_short {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_short(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_short() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_short obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_sockaddr {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_sockaddr(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_sockaddr() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_sockaddr obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_sockaddr_in6 {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_sockaddr_in6(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_sockaddr_in6() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_sockaddr_in6 obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_socklen_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_socklen_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_socklen_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_socklen_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_sqlite3 {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_sqlite3(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_sqlite3() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_sqlite3 obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_sqlite3_stmt {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_sqlite3_stmt(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_sqlite3_stmt() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_sqlite3_stmt obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_agc_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_agc_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_agc_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_agc_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_buffer {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_buffer(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_buffer() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_buffer obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_cache_db_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_cache_db_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_cache_db_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_call_cause_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_call_cause_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_call_cause_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_call_cause_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_channel {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_channel(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_channel() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_channel obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_codec_control_type_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_codec_control_type_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_codec_control_type_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_codec_control_type_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_core_port_allocator {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_core_port_allocator(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_core_port_allocator() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_core_port_allocator obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_core_session {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_core_session(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_core_session() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_core_session obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_event_types_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_event_types_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_event_types_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_event_types_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_file_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_file_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_file_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_file_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_frame_buffer_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_frame_buffer_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_frame_buffer_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_frame_buffer_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_hashtable {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_hashtable(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_hashtable() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_hashtable obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_hashtable_iterator {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_hashtable_iterator(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_hashtable_iterator() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_hashtable_iterator obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_image_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_image_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_image_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_image_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_img_fmt_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_img_fmt_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_img_fmt_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_img_fmt_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_img_position_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_img_position_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_img_position_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_img_position_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_interval_time_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_interval_time_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_interval_time_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_interval_time_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_action_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_action_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_action_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_action_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_digit_stream {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_digit_stream(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_digit_stream() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_digit_stream obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_digit_stream_parser {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_digit_stream_parser(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_digit_stream_parser() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_digit_stream_parser obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_dmachine {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_dmachine(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_dmachine() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_dmachine obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_menu {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_menu(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_menu() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_menu_xml_ctx {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_menu_xml_ctx(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_menu_xml_ctx() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu_xml_ctx obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_jb_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_jb_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_jb_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_jb_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_live_array_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_live_array_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_live_array_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_live_array_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_media_bug {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_media_bug(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_media_bug() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_media_bug obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_mutex_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_mutex_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_mutex_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_mutex_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_network_list {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_network_list(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_network_list() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_network_list obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_odbc_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_odbc_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_odbc_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_odbc_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_pgsql_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_pgsql_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_pgsql_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_pgsql_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_pollfd_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_pollfd_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_pollfd_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_pollfd_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_queue_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_queue_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_queue_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_queue_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_rtcp_frame {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_rtcp_frame(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_rtcp_frame() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtcp_frame obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_rtp {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_rtp(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_rtp() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtp obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_rtp_flag_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_rtp_flag_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_rtp_flag_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtp_flag_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_say_file_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_say_file_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_say_file_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_say_file_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_size_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_size_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_size_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_size_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_sockaddr_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_sockaddr_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_sockaddr_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_sockaddr_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_socket_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_socket_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_socket_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_socket_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_sql_queue_manager {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_sql_queue_manager(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_sql_queue_manager() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_sql_queue_manager obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ssize_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ssize_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ssize_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ssize_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_thread_rwlock_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_thread_rwlock_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_thread_rwlock_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_rwlock_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_thread_start_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_thread_start_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_thread_start_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_start_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_thread_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_thread_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_thread_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_time_exp_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_time_exp_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_time_exp_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_time_exp_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_time_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_time_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_time_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_time_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_xml_binding {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_xml_binding(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_xml_binding() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_xml_binding obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_time_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_time_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_time_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_time_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_unsigned_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_unsigned_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_unsigned_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_unsigned_int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_unsigned_int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_unsigned_int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_unsigned_long {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_unsigned_long(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_unsigned_long() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_long obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_unsigned_short {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_unsigned_short(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_unsigned_short() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_short obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
 public enum switch_abc_type_t {
   SWITCH_ABC_TYPE_INIT,
   SWITCH_ABC_TYPE_READ,
@@ -27726,6 +27726,98 @@ public class switch_api_interface : IDisposable {
 
 namespace FreeSWITCH.Native {
 
+using System;
+using System.Runtime.InteropServices;
+
+public class switch_app_log : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal switch_app_log(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(switch_app_log obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~switch_app_log() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_switch_app_log(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public string app {
+    set {
+      freeswitchPINVOKE.switch_app_log_app_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.switch_app_log_app_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public string arg {
+    set {
+      freeswitchPINVOKE.switch_app_log_arg_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.switch_app_log_arg_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public SWIGTYPE_p_switch_time_t stamp {
+    set {
+      freeswitchPINVOKE.switch_app_log_stamp_set(swigCPtr, SWIGTYPE_p_switch_time_t.getCPtr(value));
+      if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
+    } 
+    get {
+      SWIGTYPE_p_switch_time_t ret = new SWIGTYPE_p_switch_time_t(freeswitchPINVOKE.switch_app_log_stamp_get(swigCPtr), true);
+      if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
+      return ret;
+    } 
+  }
+
+  public switch_app_log next {
+    set {
+      freeswitchPINVOKE.switch_app_log_next_set(swigCPtr, switch_app_log.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_app_log_next_get(swigCPtr);
+      switch_app_log ret = (cPtr == IntPtr.Zero) ? null : new switch_app_log(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_app_log() : this(freeswitchPINVOKE.new_switch_app_log(), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
 [System.Flags] public enum switch_application_flag_enum_t {
   SAF_NONE = 0,
   SAF_SUPPORT_NOMEDIA = (1 << 0),
@@ -27911,98 +28003,6 @@ public class switch_application_interface : IDisposable {
 
 namespace FreeSWITCH.Native {
 
-using System;
-using System.Runtime.InteropServices;
-
-public class switch_app_log : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal switch_app_log(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(switch_app_log obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~switch_app_log() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_switch_app_log(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public string app {
-    set {
-      freeswitchPINVOKE.switch_app_log_app_set(swigCPtr, value);
-    } 
-    get {
-      string ret = freeswitchPINVOKE.switch_app_log_app_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public string arg {
-    set {
-      freeswitchPINVOKE.switch_app_log_arg_set(swigCPtr, value);
-    } 
-    get {
-      string ret = freeswitchPINVOKE.switch_app_log_arg_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public SWIGTYPE_p_switch_time_t stamp {
-    set {
-      freeswitchPINVOKE.switch_app_log_stamp_set(swigCPtr, SWIGTYPE_p_switch_time_t.getCPtr(value));
-      if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
-    } 
-    get {
-      SWIGTYPE_p_switch_time_t ret = new SWIGTYPE_p_switch_time_t(freeswitchPINVOKE.switch_app_log_stamp_get(swigCPtr), true);
-      if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
-      return ret;
-    } 
-  }
-
-  public switch_app_log next {
-    set {
-      freeswitchPINVOKE.switch_app_log_next_set(swigCPtr, switch_app_log.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_app_log_next_get(swigCPtr);
-      switch_app_log ret = (cPtr == IntPtr.Zero) ? null : new switch_app_log(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_app_log() : this(freeswitchPINVOKE.new_switch_app_log(), true) {
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
 [System.Flags] public enum switch_asr_flag_enum_t {
   SWITCH_ASR_FLAG_NONE = 0,
   SWITCH_ASR_FLAG_DATA = (1 << 0),
@@ -30953,44 +30953,6 @@ public class switch_chat_interface : IDisposable {
 
 namespace FreeSWITCH.Native {
 
-public enum switch_codec_control_command_t {
-  SCC_VIDEO_GEN_KEYFRAME = 0,
-  SCC_VIDEO_BANDWIDTH,
-  SCC_VIDEO_RESET,
-  SCC_AUDIO_PACKET_LOSS,
-  SCC_AUDIO_ADJUST_BITRATE,
-  SCC_DEBUG,
-  SCC_CODEC_SPECIFIC
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum switch_codec_control_type_t {
-  SCCT_NONE = 0,
-  SCCT_STRING,
-  SCCT_INT
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
 using System;
 using System.Runtime.InteropServices;
 
@@ -31168,6 +31130,44 @@ public class switch_codec : IDisposable {
 
 namespace FreeSWITCH.Native {
 
+public enum switch_codec_control_command_t {
+  SCC_VIDEO_GEN_KEYFRAME = 0,
+  SCC_VIDEO_BANDWIDTH,
+  SCC_VIDEO_RESET,
+  SCC_AUDIO_PACKET_LOSS,
+  SCC_AUDIO_ADJUST_BITRATE,
+  SCC_DEBUG,
+  SCC_CODEC_SPECIFIC
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+public enum switch_codec_control_type_t {
+  SCCT_NONE = 0,
+  SCCT_STRING,
+  SCCT_INT
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
 [System.Flags] public enum switch_codec_flag_enum_t {
   SWITCH_CODEC_FLAG_ENCODE = (1 << 0),
   SWITCH_CODEC_FLAG_DECODE = (1 << 1),
@@ -37449,209 +37449,6 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
-public class switch_io_event_hooks : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal switch_io_event_hooks(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(switch_io_event_hooks obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~switch_io_event_hooks() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_switch_io_event_hooks(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public switch_io_event_hook_outgoing_channel outgoing_channel {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_set(swigCPtr, switch_io_event_hook_outgoing_channel.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_get(swigCPtr);
-      switch_io_event_hook_outgoing_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_outgoing_channel(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_receive_message receive_message {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_receive_message_set(swigCPtr, switch_io_event_hook_receive_message.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_message_get(swigCPtr);
-      switch_io_event_hook_receive_message ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_message(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_receive_event receive_event {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_receive_event_set(swigCPtr, switch_io_event_hook_receive_event.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_event_get(swigCPtr);
-      switch_io_event_hook_receive_event ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_event(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_read_frame read_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_read_frame_set(swigCPtr, switch_io_event_hook_read_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_read_frame_get(swigCPtr);
-      switch_io_event_hook_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_read_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_video_read_frame video_read_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_set(swigCPtr, switch_io_event_hook_video_read_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_get(swigCPtr);
-      switch_io_event_hook_video_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_read_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_write_frame write_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_write_frame_set(swigCPtr, switch_io_event_hook_write_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_write_frame_get(swigCPtr);
-      switch_io_event_hook_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_write_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_video_write_frame video_write_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_set(swigCPtr, switch_io_event_hook_video_write_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_get(swigCPtr);
-      switch_io_event_hook_video_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_write_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_text_write_frame text_write_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_text_write_frame_set(swigCPtr, switch_io_event_hook_text_write_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_text_write_frame_get(swigCPtr);
-      switch_io_event_hook_text_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_text_write_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_text_read_frame text_read_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_text_read_frame_set(swigCPtr, switch_io_event_hook_text_read_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_text_read_frame_get(swigCPtr);
-      switch_io_event_hook_text_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_text_read_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_kill_channel kill_channel {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_kill_channel_set(swigCPtr, switch_io_event_hook_kill_channel.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_kill_channel_get(swigCPtr);
-      switch_io_event_hook_kill_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_kill_channel(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_send_dtmf send_dtmf {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_set(swigCPtr, switch_io_event_hook_send_dtmf.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_get(swigCPtr);
-      switch_io_event_hook_send_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_send_dtmf(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_recv_dtmf recv_dtmf {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_set(swigCPtr, switch_io_event_hook_recv_dtmf.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_get(swigCPtr);
-      switch_io_event_hook_recv_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_recv_dtmf(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_state_change state_change {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_state_change_set(swigCPtr, switch_io_event_hook_state_change.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_change_get(swigCPtr);
-      switch_io_event_hook_state_change ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_change(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_state_run state_run {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_state_run_set(swigCPtr, switch_io_event_hook_state_run.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_run_get(swigCPtr);
-      switch_io_event_hook_state_run ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_run(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hooks() : this(freeswitchPINVOKE.new_switch_io_event_hooks(), true) {
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
 public class switch_io_event_hook_send_dtmf : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;
@@ -38217,6 +38014,209 @@ public class switch_io_event_hook_write_frame : IDisposable {
 
 namespace FreeSWITCH.Native {
 
+using System;
+using System.Runtime.InteropServices;
+
+public class switch_io_event_hooks : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal switch_io_event_hooks(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(switch_io_event_hooks obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~switch_io_event_hooks() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_switch_io_event_hooks(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public switch_io_event_hook_outgoing_channel outgoing_channel {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_set(swigCPtr, switch_io_event_hook_outgoing_channel.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_get(swigCPtr);
+      switch_io_event_hook_outgoing_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_outgoing_channel(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_receive_message receive_message {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_receive_message_set(swigCPtr, switch_io_event_hook_receive_message.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_message_get(swigCPtr);
+      switch_io_event_hook_receive_message ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_message(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_receive_event receive_event {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_receive_event_set(swigCPtr, switch_io_event_hook_receive_event.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_event_get(swigCPtr);
+      switch_io_event_hook_receive_event ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_event(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_read_frame read_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_read_frame_set(swigCPtr, switch_io_event_hook_read_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_read_frame_get(swigCPtr);
+      switch_io_event_hook_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_read_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_video_read_frame video_read_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_set(swigCPtr, switch_io_event_hook_video_read_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_get(swigCPtr);
+      switch_io_event_hook_video_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_read_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_write_frame write_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_write_frame_set(swigCPtr, switch_io_event_hook_write_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_write_frame_get(swigCPtr);
+      switch_io_event_hook_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_write_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_video_write_frame video_write_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_set(swigCPtr, switch_io_event_hook_video_write_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_get(swigCPtr);
+      switch_io_event_hook_video_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_write_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_text_write_frame text_write_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_text_write_frame_set(swigCPtr, switch_io_event_hook_text_write_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_text_write_frame_get(swigCPtr);
+      switch_io_event_hook_text_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_text_write_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_text_read_frame text_read_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_text_read_frame_set(swigCPtr, switch_io_event_hook_text_read_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_text_read_frame_get(swigCPtr);
+      switch_io_event_hook_text_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_text_read_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_kill_channel kill_channel {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_kill_channel_set(swigCPtr, switch_io_event_hook_kill_channel.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_kill_channel_get(swigCPtr);
+      switch_io_event_hook_kill_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_kill_channel(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_send_dtmf send_dtmf {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_set(swigCPtr, switch_io_event_hook_send_dtmf.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_get(swigCPtr);
+      switch_io_event_hook_send_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_send_dtmf(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_recv_dtmf recv_dtmf {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_set(swigCPtr, switch_io_event_hook_recv_dtmf.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_get(swigCPtr);
+      switch_io_event_hook_recv_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_recv_dtmf(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_state_change state_change {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_state_change_set(swigCPtr, switch_io_event_hook_state_change.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_change_get(swigCPtr);
+      switch_io_event_hook_state_change ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_change(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_state_run state_run {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_state_run_set(swigCPtr, switch_io_event_hook_state_run.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_run_get(swigCPtr);
+      switch_io_event_hook_state_run ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_run(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hooks() : this(freeswitchPINVOKE.new_switch_io_event_hooks(), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
 [System.Flags] public enum switch_io_flag_enum_t {
   SWITCH_IO_FLAG_NONE = 0,
   SWITCH_IO_FLAG_NOBLOCK = (1 << 0),
@@ -44698,6 +44698,122 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
+public class switch_vid_params_t : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal switch_vid_params_t(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(switch_vid_params_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~switch_vid_params_t() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_switch_vid_params_t(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public uint width {
+    set {
+      freeswitchPINVOKE.switch_vid_params_t_width_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_vid_params_t_width_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint height {
+    set {
+      freeswitchPINVOKE.switch_vid_params_t_height_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_vid_params_t_height_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint fps {
+    set {
+      freeswitchPINVOKE.switch_vid_params_t_fps_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_vid_params_t_fps_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint d_width {
+    set {
+      freeswitchPINVOKE.switch_vid_params_t_d_width_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_vid_params_t_d_width_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint d_height {
+    set {
+      freeswitchPINVOKE.switch_vid_params_t_d_height_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_vid_params_t_d_height_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public switch_vid_params_t() : this(freeswitchPINVOKE.new_switch_vid_params_t(), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+public enum switch_vid_spy_fmt_t {
+  SPY_LOWER_RIGHT_SMALL,
+  SPY_LOWER_RIGHT_LARGE,
+  SPY_DUAL_CROP
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
 public class switch_video_codec_settings : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;
@@ -44849,122 +44965,6 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
-public class switch_vid_params_t : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal switch_vid_params_t(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(switch_vid_params_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~switch_vid_params_t() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_switch_vid_params_t(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public uint width {
-    set {
-      freeswitchPINVOKE.switch_vid_params_t_width_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.switch_vid_params_t_width_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public uint height {
-    set {
-      freeswitchPINVOKE.switch_vid_params_t_height_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.switch_vid_params_t_height_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public uint fps {
-    set {
-      freeswitchPINVOKE.switch_vid_params_t_fps_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.switch_vid_params_t_fps_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public uint d_width {
-    set {
-      freeswitchPINVOKE.switch_vid_params_t_d_width_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.switch_vid_params_t_d_width_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public uint d_height {
-    set {
-      freeswitchPINVOKE.switch_vid_params_t_d_height_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.switch_vid_params_t_d_height_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public switch_vid_params_t() : this(freeswitchPINVOKE.new_switch_vid_params_t(), true) {
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum switch_vid_spy_fmt_t {
-  SPY_LOWER_RIGHT_SMALL,
-  SPY_LOWER_RIGHT_LARGE,
-  SPY_DUAL_CROP
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
 public class switch_waitlist_t : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;

From 70f21b828702e58fea53c141984dc63d2a4b683b Mon Sep 17 00:00:00 2001
From: Brian West 
Date: Wed, 13 Jun 2018 08:43:54 -0500
Subject: [PATCH 228/264] reswig

---
 .../mod_java/src/org/freeswitch/swig/API.java |     6 +-
 .../src/org/freeswitch/swig/CoreSession.java  |     6 +-
 .../src/org/freeswitch/swig/DTMF.java         |     6 +-
 .../src/org/freeswitch/swig/Event.java        |     6 +-
 .../org/freeswitch/swig/EventConsumer.java    |     6 +-
 .../src/org/freeswitch/swig/IVRMenu.java      |     6 +-
 .../src/org/freeswitch/swig/JavaSession.java  |     4 +-
 .../freeswitch/swig/SWIGTYPE_p_JavaVM.java    |     6 +-
 .../org/freeswitch/swig/SWIGTYPE_p_int.java   |     6 +-
 .../SWIGTYPE_p_p_switch_event_node_t.java     |     6 +-
 .../swig/SWIGTYPE_p_switch_call_cause_t.java  |     6 +-
 .../SWIGTYPE_p_switch_channel_state_t.java    |     6 +-
 .../swig/SWIGTYPE_p_switch_channel_t.java     |     6 +-
 .../SWIGTYPE_p_switch_core_session_t.java     |     6 +-
 .../swig/SWIGTYPE_p_switch_event_t.java       |     6 +-
 .../swig/SWIGTYPE_p_switch_event_types_t.java |     6 +-
 .../swig/SWIGTYPE_p_switch_input_args_t.java  |     6 +-
 .../swig/SWIGTYPE_p_switch_input_type_t.java  |     6 +-
 .../swig/SWIGTYPE_p_switch_priority_t.java    |     6 +-
 .../swig/SWIGTYPE_p_switch_queue_t.java       |     6 +-
 ...IGTYPE_p_switch_state_handler_table_t.java |     6 +-
 .../swig/SWIGTYPE_p_switch_status_t.java      |     6 +-
 .../SWIGTYPE_p_switch_stream_handle_t.java    |     6 +-
 .../freeswitch/swig/SWIGTYPE_p_uint32_t.java  |     6 +-
 .../org/freeswitch/swig/SWIGTYPE_p_void.java  |     6 +-
 .../src/org/freeswitch/swig/Stream.java       |     6 +-
 .../src/org/freeswitch/swig/freeswitch.java   |     2 +-
 .../org/freeswitch/swig/freeswitchJNI.java    |     2 +-
 .../swig/input_callback_state_t.java          |     6 +-
 .../org/freeswitch/swig/session_flag_t.java   |     2 +-
 .../languages/mod_java/switch_swig_wrap.cpp   |    27 +-
 src/mod/languages/mod_lua/mod_lua_wrap.cpp    |   119 +-
 .../languages/mod_managed/freeswitch_wrap.cxx |    43 -
 src/mod/languages/mod_managed/managed/swig.cs | 14594 ++++++++--------
 src/mod/languages/mod_perl/freeswitch.pm      |     2 +-
 src/mod/languages/mod_perl/mod_perl_wrap.cpp  |    82 +-
 src/mod/languages/mod_python/freeswitch.py    |   657 +-
 .../languages/mod_python/mod_python_wrap.cpp  |   342 +-
 38 files changed, 8227 insertions(+), 7805 deletions(-)

diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/API.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/API.java
index 3dd3f722b3..7d0824dbef 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/API.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/API.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,8 +9,8 @@
 package org.freeswitch.swig;
 
 public class API {
-  private long swigCPtr;
-  protected boolean swigCMemOwn;
+  private transient long swigCPtr;
+  protected transient boolean swigCMemOwn;
 
   protected API(long cPtr, boolean cMemoryOwn) {
     swigCMemOwn = cMemoryOwn;
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java
index 88d5a3df28..75b09e1448 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,8 +9,8 @@
 package org.freeswitch.swig;
 
 public class CoreSession {
-  private long swigCPtr;
-  protected boolean swigCMemOwn;
+  private transient long swigCPtr;
+  protected transient boolean swigCMemOwn;
 
   protected CoreSession(long cPtr, boolean cMemoryOwn) {
     swigCMemOwn = cMemoryOwn;
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/DTMF.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/DTMF.java
index cae50ff4c0..71d6198f44 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/DTMF.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/DTMF.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,8 +9,8 @@
 package org.freeswitch.swig;
 
 public class DTMF {
-  private long swigCPtr;
-  protected boolean swigCMemOwn;
+  private transient long swigCPtr;
+  protected transient boolean swigCMemOwn;
 
   protected DTMF(long cPtr, boolean cMemoryOwn) {
     swigCMemOwn = cMemoryOwn;
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/Event.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/Event.java
index c6a271e12c..f3a06a2177 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/Event.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/Event.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,8 +9,8 @@
 package org.freeswitch.swig;
 
 public class Event {
-  private long swigCPtr;
-  protected boolean swigCMemOwn;
+  private transient long swigCPtr;
+  protected transient boolean swigCMemOwn;
 
   protected Event(long cPtr, boolean cMemoryOwn) {
     swigCMemOwn = cMemoryOwn;
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/EventConsumer.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/EventConsumer.java
index 6decf27f82..9a69a6c5e6 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/EventConsumer.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/EventConsumer.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,8 +9,8 @@
 package org.freeswitch.swig;
 
 public class EventConsumer {
-  private long swigCPtr;
-  protected boolean swigCMemOwn;
+  private transient long swigCPtr;
+  protected transient boolean swigCMemOwn;
 
   protected EventConsumer(long cPtr, boolean cMemoryOwn) {
     swigCMemOwn = cMemoryOwn;
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/IVRMenu.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/IVRMenu.java
index 8c10dd95fc..84ca8671b9 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/IVRMenu.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/IVRMenu.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,8 +9,8 @@
 package org.freeswitch.swig;
 
 public class IVRMenu {
-  private long swigCPtr;
-  protected boolean swigCMemOwn;
+  private transient long swigCPtr;
+  protected transient boolean swigCMemOwn;
 
   protected IVRMenu(long cPtr, boolean cMemoryOwn) {
     swigCMemOwn = cMemoryOwn;
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/JavaSession.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/JavaSession.java
index a030fbd625..82573cbff9 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/JavaSession.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/JavaSession.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,7 +9,7 @@
 package org.freeswitch.swig;
 
 public class JavaSession extends CoreSession {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
   protected JavaSession(long cPtr, boolean cMemoryOwn) {
     super(freeswitchJNI.JavaSession_SWIGUpcast(cPtr), cMemoryOwn);
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_JavaVM.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_JavaVM.java
index 6308483c7c..87d2efd11f 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_JavaVM.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_JavaVM.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_JavaVM {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_JavaVM(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_JavaVM(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_int.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_int.java
index e189e7c4f1..b7aa92cec2 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_int.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_int.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_int {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_int(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_int(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_p_switch_event_node_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_p_switch_event_node_t.java
index 9ee3a23b22..bf20923d8f 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_p_switch_event_node_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_p_switch_event_node_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_p_switch_event_node_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_p_switch_event_node_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_p_switch_event_node_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_call_cause_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_call_cause_t.java
index 00c53135fd..c668c339ba 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_call_cause_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_call_cause_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_call_cause_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_call_cause_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_call_cause_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_channel_state_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_channel_state_t.java
index ea82d3b7ee..b0443427ae 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_channel_state_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_channel_state_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_channel_state_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_channel_state_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_channel_state_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_channel_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_channel_t.java
index b46a02db25..eea4e2e1bd 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_channel_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_channel_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_channel_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_channel_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_channel_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_core_session_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_core_session_t.java
index 2f811a74cc..fa595a7386 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_core_session_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_core_session_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_core_session_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_core_session_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_core_session_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_event_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_event_t.java
index 2e17094bfa..060199a96f 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_event_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_event_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_event_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_event_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_event_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_event_types_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_event_types_t.java
index 7c1ebebb4c..be40b44b6c 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_event_types_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_event_types_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_event_types_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_event_types_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_event_types_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_input_args_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_input_args_t.java
index a0ab192d0d..3fdb4a7d20 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_input_args_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_input_args_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_input_args_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_input_args_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_input_args_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_input_type_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_input_type_t.java
index 33731d5d33..8bfe879d51 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_input_type_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_input_type_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_input_type_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_input_type_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_input_type_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_priority_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_priority_t.java
index f5a8c4b604..713ca09d3d 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_priority_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_priority_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_priority_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_priority_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_priority_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_queue_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_queue_t.java
index c7da580c56..10e2d38666 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_queue_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_queue_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_queue_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_queue_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_queue_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_state_handler_table_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_state_handler_table_t.java
index 7a387036b1..989d3d403e 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_state_handler_table_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_state_handler_table_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_state_handler_table_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_state_handler_table_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_state_handler_table_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_status_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_status_t.java
index 0880fbaef2..dc28f2e1f8 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_status_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_status_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_status_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_status_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_status_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_stream_handle_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_stream_handle_t.java
index 659c247946..798349044c 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_stream_handle_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_switch_stream_handle_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_switch_stream_handle_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_switch_stream_handle_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_switch_stream_handle_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_uint32_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_uint32_t.java
index 08c3ef8c82..6e6ab7d8c3 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_uint32_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_uint32_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_uint32_t {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_uint32_t(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_uint32_t(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_void.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_void.java
index 9bc1acae98..20f5835447 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_void.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/SWIGTYPE_p_void.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,9 +9,9 @@
 package org.freeswitch.swig;
 
 public class SWIGTYPE_p_void {
-  private long swigCPtr;
+  private transient long swigCPtr;
 
-  protected SWIGTYPE_p_void(long cPtr, boolean futureUse) {
+  protected SWIGTYPE_p_void(long cPtr, @SuppressWarnings("unused") boolean futureUse) {
     swigCPtr = cPtr;
   }
 
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java
index f917c54c9c..23eab06f39 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/Stream.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,8 +9,8 @@
 package org.freeswitch.swig;
 
 public class Stream {
-  private long swigCPtr;
-  protected boolean swigCMemOwn;
+  private transient long swigCPtr;
+  protected transient boolean swigCMemOwn;
 
   protected Stream(long cPtr, boolean cMemoryOwn) {
     swigCMemOwn = cMemoryOwn;
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitch.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitch.java
index cfcd35e889..3d59d14638 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitch.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitch.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java
index 5005b518a6..8d708cace8 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/input_callback_state_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/input_callback_state_t.java
index e323161be2..f5bbcd6246 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/input_callback_state_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/input_callback_state_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
@@ -9,8 +9,8 @@
 package org.freeswitch.swig;
 
 public class input_callback_state_t {
-  private long swigCPtr;
-  protected boolean swigCMemOwn;
+  private transient long swigCPtr;
+  protected transient boolean swigCMemOwn;
 
   protected input_callback_state_t(long cPtr, boolean cMemoryOwn) {
     swigCMemOwn = cMemoryOwn;
diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/session_flag_t.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/session_flag_t.java
index d07c596b41..e4b6d10e88 100644
--- a/src/mod/languages/mod_java/src/org/freeswitch/swig/session_flag_t.java
+++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/session_flag_t.java
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * Do not make changes to this file unless you know what you are doing--modify
  * the SWIG interface file instead.
diff --git a/src/mod/languages/mod_java/switch_swig_wrap.cpp b/src/mod/languages/mod_java/switch_swig_wrap.cpp
index fe4c4db259..09b4baf16a 100644
--- a/src/mod/languages/mod_java/switch_swig_wrap.cpp
+++ b/src/mod/languages/mod_java/switch_swig_wrap.cpp
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * This file is not intended to be easily readable and contains a number of
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -8,7 +8,11 @@
  * interface file instead.
  * ----------------------------------------------------------------------------- */
 
+
+#ifndef SWIGJAVA
 #define SWIGJAVA
+#endif
+
 
 
 #ifdef __cplusplus
@@ -101,9 +105,11 @@ template  T SwigValueInit() {
 #endif
 
 /* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#  ifndef GCC_HASCLASSVISIBILITY
-#    define GCC_HASCLASSVISIBILITY
+#if defined(__GNUC__)
+#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#    ifndef GCC_HASCLASSVISIBILITY
+#      define GCC_HASCLASSVISIBILITY
+#    endif
 #  endif
 #endif
 
@@ -142,6 +148,19 @@ template  T SwigValueInit() {
 # define _SCL_SECURE_NO_DEPRECATE
 #endif
 
+/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
+#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
+# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
+#endif
+
+/* Intel's compiler complains if a variable which was never initialised is
+ * cast to void, which is a common idiom which we use to indicate that we
+ * are aware a variable isn't used.  So we just silence that warning.
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
+ */
+#ifdef __INTEL_COMPILER
+# pragma warning disable 592
+#endif
 
 
 /* Fix for jlong on some versions of gcc on Windows */
diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp
index ed046632c6..b5efc8595a 100644
--- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp
+++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * This file is not intended to be easily readable and contains a number of
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -8,7 +8,11 @@
  * interface file instead.
  * ----------------------------------------------------------------------------- */
 
+
+#ifndef SWIGLUA
 #define SWIGLUA
+#endif
+
 #define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
 #define SWIG_LUA_MODULE_GLOBAL
 
@@ -103,9 +107,11 @@ template  T SwigValueInit() {
 #endif
 
 /* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#  ifndef GCC_HASCLASSVISIBILITY
-#    define GCC_HASCLASSVISIBILITY
+#if defined(__GNUC__)
+#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#    ifndef GCC_HASCLASSVISIBILITY
+#      define GCC_HASCLASSVISIBILITY
+#    endif
 #  endif
 #endif
 
@@ -144,6 +150,19 @@ template  T SwigValueInit() {
 # define _SCL_SECURE_NO_DEPRECATE
 #endif
 
+/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
+#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
+# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
+#endif
+
+/* Intel's compiler complains if a variable which was never initialised is
+ * cast to void, which is a common idiom which we use to indicate that we
+ * are aware a variable isn't used.  So we just silence that warning.
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
+ */
+#ifdef __INTEL_COMPILER
+# pragma warning disable 592
+#endif
 
 /* -----------------------------------------------------------------------------
  * swigrun.swg
@@ -642,16 +661,16 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
     char d = *(c++);
     unsigned char uu;
     if ((d >= '0') && (d <= '9'))
-      uu = ((d - '0') << 4);
+      uu = (unsigned char)((d - '0') << 4);
     else if ((d >= 'a') && (d <= 'f'))
-      uu = ((d - ('a'-10)) << 4);
+      uu = (unsigned char)((d - ('a'-10)) << 4);
     else
       return (char *) 0;
     d = *(c++);
     if ((d >= '0') && (d <= '9'))
-      uu |= (d - '0');
+      uu |= (unsigned char)(d - '0');
     else if ((d >= 'a') && (d <= 'f'))
-      uu |= (d - ('a'-10));
+      uu |= (unsigned char)(d - ('a'-10));
     else
       return (char *) 0;
     *u = uu;
@@ -1526,6 +1545,44 @@ SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED
     return result;
 }
 
+/* The class.get method helper, performs the lookup of class attributes.
+ * It returns an error code. Number of function return values is passed inside 'ret'.
+ * first_arg is not used in this function because function always has 2 arguments.
+ */
+SWIGINTERN int  SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
+{
+/*  there should be 2 params passed in
+  (1) userdata (not the meta table)
+  (2) string name of the attribute
+*/
+  int bases_search_result;
+  int substack_start = lua_gettop(L)-2;
+  assert(first_arg == substack_start+1);
+  lua_checkstack(L,5);
+  assert(lua_isuserdata(L,-2));  /* just in case */
+  lua_getmetatable(L,-2);    /* get the meta table */
+  assert(lua_istable(L,-1));  /* just in case */
+  /* NEW: looks for the __getitem() fn
+  this is a user provided get fn */
+  SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
+  if (lua_iscfunction(L,-1))  /* if its there */
+  {  /* found it so call the fn & return its value */
+    lua_pushvalue(L,substack_start+1);  /* the userdata */
+    lua_pushvalue(L,substack_start+2);  /* the parameter */
+    lua_call(L,2,1);  /* 2 value in (userdata),1 out (result) */
+    lua_remove(L,-2); /* stack tidy, remove metatable */
+    if(ret) *ret = 1;
+    return SWIG_OK;
+  }
+  lua_pop(L,1);
+  /* Remove the metatable */
+  lua_pop(L,1);
+  /* Search in base classes */
+  bases_search_result = SWIG_Lua_iterate_bases(L,type,substack_start+1,SWIG_Lua_class_do_get_item,ret);
+  return bases_search_result;  /* sorry not known */
+}
+
+
 /* The class.get method helper, performs the lookup of class attributes.
  * It returns an error code. Number of function return values is passed inside 'ret'.
  * first_arg is not used in this function because function always has 2 arguments.
@@ -1573,19 +1630,6 @@ SWIGINTERN int  SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SW
     return SWIG_OK;
   }
   lua_pop(L,1);  /* remove whatever was there */
-  /* NEW: looks for the __getitem() fn
-  this is a user provided get fn */
-  SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
-  if (lua_iscfunction(L,-1))  /* if its there */
-  {  /* found it so call the fn & return its value */
-    lua_pushvalue(L,substack_start+1);  /* the userdata */
-    lua_pushvalue(L,substack_start+2);  /* the parameter */
-    lua_call(L,2,1);  /* 2 value in (userdata),1 out (result) */
-    lua_remove(L,-2); /* stack tidy, remove metatable */
-    if(ret) *ret = 1;
-    return SWIG_OK;
-  }
-  lua_pop(L,1);
   /* Remove the metatable */
   lua_pop(L,1);
   /* Search in base classes */
@@ -1612,6 +1656,10 @@ SWIGINTERN int  SWIG_Lua_class_get(lua_State *L)
   if(result == SWIG_OK)
     return ret;
 
+  result = SWIG_Lua_class_do_get_item(L,type,1,&ret);
+  if(result == SWIG_OK)
+    return ret;
+
   return 0;
 }
 
@@ -1881,7 +1929,7 @@ SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss)
 
 #if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
 /* Merges two tables  */
-SWIGINTERN int SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source)
+SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source)
 {
   /* iterating */
   lua_pushnil(L);
@@ -1897,7 +1945,7 @@ SWIGINTERN int SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int sour
 }
 
 /* Merges two tables with given name. original - index of target metatable, base - index of source metatable */
-SWIGINTERN int SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base)
+SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base)
 {
   /* push original[name], then base[name] */
   lua_pushstring(L,name);
@@ -1912,7 +1960,7 @@ SWIGINTERN int SWIG_Lua_merge_tables(lua_State *L, const char* name, int origina
 }
 
 /* Function takes all symbols from base and adds it to derived class. It's just a helper. */
-SWIGINTERN int SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls)
+SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls)
 {
   /* There is one parameter - original, i.e. 'derived' class metatable */
   assert(lua_istable(L,-1));
@@ -1926,7 +1974,7 @@ SWIGINTERN int SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls
 }
 
 /* Function squashes all symbols from 'clss' bases into itself */
-SWIGINTERN int  SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss)
+SWIGINTERN void  SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss)
 {
   int i;
   SWIG_Lua_get_class_metatable(L,clss->fqname);
@@ -2551,7 +2599,7 @@ SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) {
     switch(constants[i].type) {
     case SWIG_LUA_INT:
       lua_pushstring(L,constants[i].name);
-      lua_pushnumber(L,(lua_Number)constants[i].lvalue);
+      lua_pushinteger(L,(lua_Number)constants[i].lvalue);
       lua_rawset(L,-3);
       break;
     case SWIG_LUA_FLOAT:
@@ -2561,7 +2609,10 @@ SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) {
       break;
     case SWIG_LUA_CHAR:
       lua_pushstring(L,constants[i].name);
-      lua_pushfstring(L,"%c",(char)constants[i].lvalue);
+      {
+        char c = constants[i].lvalue;
+        lua_pushlstring(L,&c,1);
+      }
       lua_rawset(L,-3);
       break;
     case SWIG_LUA_STRING:
@@ -3684,7 +3735,7 @@ static int _wrap_DTMF_digit_get(lua_State* L) {
   }
   
   result = (char) ((arg1)->digit);
-  lua_pushfstring(L,"%c",result); SWIG_arg++;
+  lua_pushlstring(L, &result, 1); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;
@@ -9688,7 +9739,7 @@ SWIGRUNTIME void
 SWIG_InitializeModule(void *clientdata) {
   size_t i;
   swig_module_info *module_head, *iter;
-  int found, init;
+  int init;
 
   /* check to see if the circular list has been setup, if not, set it up */
   if (swig_module.next==0) {
@@ -9707,22 +9758,18 @@ SWIG_InitializeModule(void *clientdata) {
     /* This is the first module loaded for this interpreter */
     /* so set the swig module into the interpreter */
     SWIG_SetModule(clientdata, &swig_module);
-    module_head = &swig_module;
   } else {
     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
-    found=0;
     iter=module_head;
     do {
       if (iter==&swig_module) {
-        found=1;
-        break;
+        /* Our module is already in the list, so there's nothing more to do. */
+        return;
       }
       iter=iter->next;
     } while (iter!= module_head);
 
-    /* if the is found in the list, then all is done and we may leave */
-    if (found) return;
-    /* otherwise we must add out module into the list */
+    /* otherwise we must add our module into the list */
     swig_module.next = module_head->next;
     module_head->next = &swig_module;
   }
diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx
index 5629ec362d..2c74292495 100644
--- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx
+++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx
@@ -34833,20 +34833,6 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_pass_callee_id(void * jarg1, vo
 }
 
 
-SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_var_false(void * jarg1, char * jarg2) {
-  int jresult ;
-  switch_channel_t *arg1 = (switch_channel_t *) 0 ;
-  char *arg2 = (char *) 0 ;
-  int result;
-  
-  arg1 = (switch_channel_t *)jarg1; 
-  arg2 = (char *)jarg2; 
-  result = (int)switch_channel_var_false(arg1,(char const *)arg2);
-  jresult = result; 
-  return jresult;
-}
-
-
 SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_var_true(void * jarg1, char * jarg2) {
   int jresult ;
   switch_channel_t *arg1 = (switch_channel_t *) 0 ;
@@ -41953,35 +41939,6 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_name_get(void *
 }
 
 
-SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_alias_set(void * jarg1, char * jarg2) {
-  switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
-  char *arg2 = (char *) 0 ;
-  
-  arg1 = (switch_srtp_crypto_suite_s *)jarg1; 
-  arg2 = (char *)jarg2; 
-  {
-    if (arg2) {
-      arg1->alias = (char const *) (new char[strlen((const char *)arg2)+1]);
-      strcpy((char *)arg1->alias, (const char *)arg2);
-    } else {
-      arg1->alias = 0;
-    }
-  }
-}
-
-
-SWIGEXPORT char * SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_alias_get(void * jarg1) {
-  char * jresult ;
-  switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
-  char *result = 0 ;
-  
-  arg1 = (switch_srtp_crypto_suite_s *)jarg1; 
-  result = (char *) ((arg1)->alias);
-  jresult = SWIG_csharp_string_callback((const char *)result); 
-  return jresult;
-}
-
-
 SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_type_set(void * jarg1, int jarg2) {
   switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
   switch_rtp_crypto_key_type_t arg2 ;
diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs
index 630e932ceb..b9b7e0d462 100644
--- a/src/mod/languages/mod_managed/managed/swig.cs
+++ b/src/mod/languages/mod_managed/managed/swig.cs
@@ -75,6 +75,91 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
+public class audio_buffer_header_t : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal audio_buffer_header_t(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(audio_buffer_header_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~audio_buffer_header_t() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_audio_buffer_header_t(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public uint ts {
+    set {
+      freeswitchPINVOKE.audio_buffer_header_t_ts_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.audio_buffer_header_t_ts_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint len {
+    set {
+      freeswitchPINVOKE.audio_buffer_header_t_len_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.audio_buffer_header_t_len_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public audio_buffer_header_t() : this(freeswitchPINVOKE.new_audio_buffer_header_t(), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+public enum cache_db_flag_t {
+  CDF_INUSE = (1 << 0),
+  CDF_PRUNE = (1 << 1)
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
 public class CoreSession : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;
@@ -451,6 +536,150 @@ public class CoreSession : IDisposable {
 
 namespace FreeSWITCH.Native {
 
+public enum dm_match_type_t {
+  DM_MATCH_POSITIVE,
+  DM_MATCH_NEGATIVE
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class dtls_fingerprint_t : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal dtls_fingerprint_t(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(dtls_fingerprint_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~dtls_fingerprint_t() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_dtls_fingerprint_t(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public uint len {
+    set {
+      freeswitchPINVOKE.dtls_fingerprint_t_len_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.dtls_fingerprint_t_len_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public SWIGTYPE_p_unsigned_char data {
+    set {
+      freeswitchPINVOKE.dtls_fingerprint_t_data_set(swigCPtr, SWIGTYPE_p_unsigned_char.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.dtls_fingerprint_t_data_get(swigCPtr);
+      SWIGTYPE_p_unsigned_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public string type {
+    set {
+      freeswitchPINVOKE.dtls_fingerprint_t_type_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.dtls_fingerprint_t_type_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public string str {
+    set {
+      freeswitchPINVOKE.dtls_fingerprint_t_str_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.dtls_fingerprint_t_str_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public dtls_fingerprint_t() : this(freeswitchPINVOKE.new_dtls_fingerprint_t(), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+public enum dtls_state_t {
+  DS_OFF,
+  DS_HANDSHAKE,
+  DS_SETUP,
+  DS_READY,
+  DS_FAIL,
+  DS_INVALID
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+public enum dtls_type_t {
+  DTLS_TYPE_CLIENT = (1 << 0),
+  DTLS_TYPE_SERVER = (1 << 1),
+  DTLS_TYPE_RTP = (1 << 2),
+  DTLS_TYPE_RTCP = (1 << 3)
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
 using System;
 using System.Runtime.InteropServices;
 
@@ -520,131 +749,9 @@ public class DTMF : IDisposable {
 
 namespace FreeSWITCH.Native {
 
-using System;
-using System.Runtime.InteropServices;
-
-public partial class Event : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal Event(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(Event obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~Event() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_Event(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public switch_event InternalEvent {
-    set {
-      freeswitchPINVOKE.Event_InternalEvent_set(swigCPtr, switch_event.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.Event_InternalEvent_get(swigCPtr);
-      switch_event ret = (cPtr == IntPtr.Zero) ? null : new switch_event(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public string serialized_string {
-    set {
-      freeswitchPINVOKE.Event_serialized_string_set(swigCPtr, value);
-    } 
-    get {
-      string ret = freeswitchPINVOKE.Event_serialized_string_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public int mine {
-    set {
-      freeswitchPINVOKE.Event_mine_set(swigCPtr, value);
-    } 
-    get {
-      int ret = freeswitchPINVOKE.Event_mine_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public Event(string type, string subclass_name) : this(freeswitchPINVOKE.new_Event__SWIG_0(type, subclass_name), true) {
-  }
-
-  public Event(switch_event wrap_me, int free_me) : this(freeswitchPINVOKE.new_Event__SWIG_1(switch_event.getCPtr(wrap_me), free_me), true) {
-  }
-
-  public int chat_execute(string app, string data) {
-    int ret = freeswitchPINVOKE.Event_chat_execute(swigCPtr, app, data);
-    return ret;
-  }
-
-  public int chat_send(string dest_proto) {
-    int ret = freeswitchPINVOKE.Event_chat_send(swigCPtr, dest_proto);
-    return ret;
-  }
-
-  public string Serialize(string format) {
-    string ret = freeswitchPINVOKE.Event_Serialize(swigCPtr, format);
-    return ret;
-  }
-
-  public bool SetPriority(switch_priority_t priority) {
-    bool ret = freeswitchPINVOKE.Event_SetPriority(swigCPtr, (int)priority);
-    return ret;
-  }
-
-  public string GetHeader(string header_name) {
-    string ret = freeswitchPINVOKE.Event_GetHeader(swigCPtr, header_name);
-    return ret;
-  }
-
-  public string GetBody() {
-    string ret = freeswitchPINVOKE.Event_GetBody(swigCPtr);
-    return ret;
-  }
-
-  public string GetEventType() {
-    string ret = freeswitchPINVOKE.Event_GetEventType(swigCPtr);
-    return ret;
-  }
-
-  public bool AddBody(string value) {
-    bool ret = freeswitchPINVOKE.Event_AddBody(swigCPtr, value);
-    return ret;
-  }
-
-  public bool AddHeader(string header_name, string value) {
-    bool ret = freeswitchPINVOKE.Event_AddHeader(swigCPtr, header_name, value);
-    return ret;
-  }
-
-  public bool DeleteHeader(string header_name) {
-    bool ret = freeswitchPINVOKE.Event_DeleteHeader(swigCPtr, header_name);
-    return ret;
-  }
-
-  public bool Fire() {
-    bool ret = freeswitchPINVOKE.Event_Fire(swigCPtr);
-    return ret;
-  }
-
+public enum dtmf_flag_t {
+  DTMF_FLAG_SKIP_PROCESS = (1 << 0),
+  DTMF_FLAG_SENSITIVE = (1 << 1)
 }
 
 }
@@ -797,20 +904,20 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
-public class IvrMenu : IDisposable {
+public partial class Event : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;
 
-  internal IvrMenu(IntPtr cPtr, bool cMemoryOwn) {
+  internal Event(IntPtr cPtr, bool cMemoryOwn) {
     swigCMemOwn = cMemoryOwn;
     swigCPtr = new HandleRef(this, cPtr);
   }
 
-  internal static HandleRef getCPtr(IvrMenu obj) {
+  internal static HandleRef getCPtr(Event obj) {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
   }
 
-  ~IvrMenu() {
+  ~Event() {
     Dispose();
   }
 
@@ -819,7 +926,7 @@ public class IvrMenu : IDisposable {
       if (swigCPtr.Handle != IntPtr.Zero) {
         if (swigCMemOwn) {
           swigCMemOwn = false;
-          freeswitchPINVOKE.delete_IvrMenu(swigCPtr);
+          freeswitchPINVOKE.delete_Event(swigCPtr);
         }
         swigCPtr = new HandleRef(null, IntPtr.Zero);
       }
@@ -827,6746 +934,98 @@ public class IvrMenu : IDisposable {
     }
   }
 
-  public IvrMenu(IvrMenu main, string name, string greeting_sound, string short_greeting_sound, string invalid_sound, string exit_sound, string transfer_sound, string confirm_macro, string confirm_key, string tts_engine, string tts_voice, int confirm_attempts, int inter_timeout, int digit_len, int timeout, int max_failures, int max_timeouts) : this(freeswitchPINVOKE.new_IvrMenu(IvrMenu.getCPtr(main), name, greeting_sound, short_greeting_sound, invalid_sound, exit_sound, transfer_sound, confirm_macro, confirm_key, tts_engine, tts_voice, confirm_attempts, inter_timeout, digit_len, timeout, max_failures, max_timeouts), true) {
+  public switch_event InternalEvent {
+    set {
+      freeswitchPINVOKE.Event_InternalEvent_set(swigCPtr, switch_event.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.Event_InternalEvent_get(swigCPtr);
+      switch_event ret = (cPtr == IntPtr.Zero) ? null : new switch_event(cPtr, false);
+      return ret;
+    } 
   }
 
-  public void bindAction(string action, string arg, string bind) {
-    freeswitchPINVOKE.IvrMenu_bindAction(swigCPtr, action, arg, bind);
+  public string serialized_string {
+    set {
+      freeswitchPINVOKE.Event_serialized_string_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.Event_serialized_string_get(swigCPtr);
+      return ret;
+    } 
   }
 
-  public void Execute(CoreSession session, string name) {
-    freeswitchPINVOKE.IvrMenu_Execute(swigCPtr, CoreSession.getCPtr(session), name);
+  public int mine {
+    set {
+      freeswitchPINVOKE.Event_mine_set(swigCPtr, value);
+    } 
+    get {
+      int ret = freeswitchPINVOKE.Event_mine_get(swigCPtr);
+      return ret;
+    } 
   }
 
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public partial class ManagedSession : CoreSession {
-  private HandleRef swigCPtr;
-
-  internal ManagedSession(IntPtr cPtr, bool cMemoryOwn) : base(freeswitchPINVOKE.ManagedSession_SWIGUpcast(cPtr), cMemoryOwn) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(ManagedSession obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~ManagedSession() {
-    Dispose();
-  }
-
-  public override void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_ManagedSession(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-      base.Dispose();
-    }
-  }
-
-  public ManagedSession() : this(freeswitchPINVOKE.new_ManagedSession__SWIG_0(), true) {
-  }
-
-  public ManagedSession(string uuid) : this(freeswitchPINVOKE.new_ManagedSession__SWIG_1(uuid), true) {
-  }
-
-  public ManagedSession(SWIGTYPE_p_switch_core_session session) : this(freeswitchPINVOKE.new_ManagedSession__SWIG_2(SWIGTYPE_p_switch_core_session.getCPtr(session)), true) {
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_FILE {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_FILE(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_FILE() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_FILE obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_a_256__char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_a_256__char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_a_256__char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_a_256__char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_a_2__icand_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_a_2__icand_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_a_2__icand_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_a_2__icand_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_apr_pool_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_apr_pool_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_apr_pool_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_apr_pool_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_cJSON {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_cJSON(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_cJSON() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_cJSON obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_codec__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_codec__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_codec__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session__int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session__int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session__int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session__int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_void__p_void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_void__p_void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_void__p_void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_void__p_void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_event__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_event__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_event__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_event__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_event__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_event__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_media_bug_p_void__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_media_bug_p_void__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_media_bug_p_void__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_media_bug_p_void__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_scheduler_task__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_scheduler_task__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_scheduler_task__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_scheduler_task__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_timer__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_timer__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_timer__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_timer__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_void__void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_void__void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_void__void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void__void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_void_p_q_const__char__int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_void_p_q_const__char__int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_void_p_q_const__char__int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_p_q_const__char__int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_p_void_p_switch_event__int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_p_void_p_switch_event__int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_p_void_p_switch_event__int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_p_switch_event__int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_void__p_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_void__p_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_void__p_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_void__p_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_f_void__switch_status_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_f_void__switch_status_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_f_void__switch_status_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_f_void__switch_status_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_float {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_float(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_float() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_float obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_in6_addr {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_in6_addr(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_in6_addr() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_in6_addr obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_apr_pool_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_apr_pool_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_apr_pool_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_apr_pool_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_cJSON {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_cJSON(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_cJSON() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_cJSON obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_p_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_p_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_p_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_p_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_payload_map_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_payload_map_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_payload_map_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_payload_map_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_real_pcre {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_real_pcre(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_real_pcre() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_real_pcre obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_sqlite3 {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_sqlite3(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_sqlite3() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_sqlite3 obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_sqlite3_stmt {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_sqlite3_stmt(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_sqlite3_stmt() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_sqlite3_stmt obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_agc_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_agc_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_agc_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_agc_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_audio_resampler_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_audio_resampler_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_audio_resampler_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_audio_resampler_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_buffer {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_buffer(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_buffer() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_buffer obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_cache_db_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_cache_db_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_cache_db_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_caller_extension {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_caller_extension(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_caller_extension() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_caller_extension obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_channel {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_channel(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_channel() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_channel obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_codec_implementation {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_codec_implementation(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_codec_implementation() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_codec_implementation obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_console_callback_match {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_console_callback_match(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_console_callback_match() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_console_callback_match obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_core_port_allocator {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_core_port_allocator(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_core_port_allocator() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_port_allocator obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_core_session {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_core_session(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_core_session() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_session obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_core_session_message {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_core_session_message(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_core_session_message() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_session_message obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_device_record_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_device_record_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_device_record_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_device_record_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_event {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_event(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_event() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_event obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_event_node {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_event_node(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_event_node() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_event_node obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_file_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_file_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_file_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_file_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_frame {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_frame(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_frame() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_frame obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_frame_buffer_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_frame_buffer_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_frame_buffer_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_frame_buffer_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_hashtable {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_hashtable(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_hashtable() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_hashtable obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_hashtable_iterator {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_hashtable_iterator(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_hashtable_iterator() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_hashtable_iterator obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_digit_stream {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_digit_stream(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_digit_stream() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_digit_stream obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_digit_stream_parser {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_digit_stream_parser(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_digit_stream_parser() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_digit_stream_parser obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_dmachine {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_dmachine(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_dmachine() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_dmachine obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_dmachine_match {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_dmachine_match(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_dmachine_match() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_dmachine_match obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_menu {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_menu(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_menu() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_menu obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_ivr_menu_xml_ctx {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_ivr_menu_xml_ctx(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_ivr_menu_xml_ctx() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_menu_xml_ctx obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_live_array_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_live_array_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_live_array_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_live_array_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_log_node_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_log_node_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_log_node_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_log_node_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_media_bug {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_media_bug(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_media_bug() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_media_bug obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_network_list {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_network_list(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_network_list() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_network_list obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_rtp {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_rtp(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_rtp() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_rtp obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_say_file_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_say_file_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_say_file_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_say_file_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_sql_queue_manager {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_sql_queue_manager(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_sql_queue_manager() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_sql_queue_manager obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_thread_data_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_thread_data_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_thread_data_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_thread_data_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_xml {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_xml(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_xml() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_switch_xml_binding {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_switch_xml_binding(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_switch_xml_binding() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml_binding obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_unsigned_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_unsigned_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_unsigned_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_unsigned_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_p_void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_p_void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_p_void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_p_void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_pid_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_pid_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_pid_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_pid_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_real_pcre {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_real_pcre(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_real_pcre() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_real_pcre obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_short {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_short(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_short() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_short obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_sockaddr {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_sockaddr(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_sockaddr() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_sockaddr obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_sockaddr_in6 {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_sockaddr_in6(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_sockaddr_in6() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_sockaddr_in6 obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_socklen_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_socklen_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_socklen_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_socklen_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_sqlite3 {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_sqlite3(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_sqlite3() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_sqlite3 obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_sqlite3_stmt {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_sqlite3_stmt(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_sqlite3_stmt() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_sqlite3_stmt obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_agc_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_agc_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_agc_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_agc_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_buffer {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_buffer(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_buffer() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_buffer obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_cache_db_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_cache_db_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_cache_db_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_call_cause_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_call_cause_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_call_cause_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_call_cause_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_channel {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_channel(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_channel() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_channel obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_codec_control_type_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_codec_control_type_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_codec_control_type_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_codec_control_type_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_core_port_allocator {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_core_port_allocator(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_core_port_allocator() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_core_port_allocator obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_core_session {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_core_session(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_core_session() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_core_session obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_event_types_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_event_types_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_event_types_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_event_types_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_file_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_file_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_file_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_file_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_frame_buffer_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_frame_buffer_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_frame_buffer_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_frame_buffer_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_hashtable {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_hashtable(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_hashtable() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_hashtable obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_hashtable_iterator {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_hashtable_iterator(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_hashtable_iterator() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_hashtable_iterator obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_image_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_image_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_image_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_image_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_img_fmt_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_img_fmt_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_img_fmt_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_img_fmt_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_img_position_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_img_position_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_img_position_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_img_position_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_interval_time_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_interval_time_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_interval_time_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_interval_time_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_action_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_action_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_action_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_action_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_digit_stream {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_digit_stream(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_digit_stream() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_digit_stream obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_digit_stream_parser {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_digit_stream_parser(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_digit_stream_parser() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_digit_stream_parser obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_dmachine {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_dmachine(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_dmachine() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_dmachine obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_menu {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_menu(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_menu() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ivr_menu_xml_ctx {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ivr_menu_xml_ctx(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ivr_menu_xml_ctx() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu_xml_ctx obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_jb_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_jb_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_jb_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_jb_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_live_array_s {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_live_array_s(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_live_array_s() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_live_array_s obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_media_bug {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_media_bug(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_media_bug() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_media_bug obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_mutex_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_mutex_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_mutex_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_mutex_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_network_list {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_network_list(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_network_list() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_network_list obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_odbc_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_odbc_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_odbc_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_odbc_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_pgsql_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_pgsql_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_pgsql_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_pgsql_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_pollfd_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_pollfd_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_pollfd_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_pollfd_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_queue_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_queue_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_queue_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_queue_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_rtcp_frame {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_rtcp_frame(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_rtcp_frame() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtcp_frame obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_rtp {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_rtp(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_rtp() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtp obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_rtp_flag_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_rtp_flag_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_rtp_flag_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtp_flag_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_say_file_handle {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_say_file_handle(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_say_file_handle() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_say_file_handle obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_size_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_size_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_size_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_size_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_sockaddr_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_sockaddr_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_sockaddr_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_sockaddr_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_socket_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_socket_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_socket_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_socket_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_sql_queue_manager {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_sql_queue_manager(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_sql_queue_manager() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_sql_queue_manager obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_ssize_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_ssize_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_ssize_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ssize_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_thread_rwlock_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_thread_rwlock_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_thread_rwlock_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_rwlock_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_thread_start_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_thread_start_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_thread_start_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_start_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_thread_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_thread_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_thread_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_time_exp_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_time_exp_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_time_exp_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_time_exp_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_time_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_time_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_time_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_time_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_switch_xml_binding {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_switch_xml_binding(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_switch_xml_binding() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_switch_xml_binding obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_time_t {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_time_t(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_time_t() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_time_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_unsigned_char {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_unsigned_char(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_unsigned_char() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_char obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_unsigned_int {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_unsigned_int(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_unsigned_int() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_int obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_unsigned_long {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_unsigned_long(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_unsigned_long() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_long obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_unsigned_short {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_unsigned_short(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_unsigned_short() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_short obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class SWIGTYPE_p_void {
-  private HandleRef swigCPtr;
-
-  internal SWIGTYPE_p_void(IntPtr cPtr, bool futureUse) {
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  protected SWIGTYPE_p_void() {
-    swigCPtr = new HandleRef(null, IntPtr.Zero);
-  }
-
-  internal static HandleRef getCPtr(SWIGTYPE_p_void obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public partial class Stream : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal Stream(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(Stream obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~Stream() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_Stream(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public Stream() : this(freeswitchPINVOKE.new_Stream__SWIG_0(), true) {
+  public Event(string type, string subclass_name) : this(freeswitchPINVOKE.new_Event__SWIG_0(type, subclass_name), true) {
   }
 
-  public Stream(switch_stream_handle arg0) : this(freeswitchPINVOKE.new_Stream__SWIG_1(switch_stream_handle.getCPtr(arg0)), true) {
+  public Event(switch_event wrap_me, int free_me) : this(freeswitchPINVOKE.new_Event__SWIG_1(switch_event.getCPtr(wrap_me), free_me), true) {
   }
 
-  public string read(SWIGTYPE_p_int len) {
-    string ret = freeswitchPINVOKE.Stream_read(swigCPtr, SWIGTYPE_p_int.getCPtr(len));
+  public int chat_execute(string app, string data) {
+    int ret = freeswitchPINVOKE.Event_chat_execute(swigCPtr, app, data);
     return ret;
   }
 
-  public void Write(string data) {
-    freeswitchPINVOKE.Stream_Write(swigCPtr, data);
-  }
-
-  public void raw_write(string data, int len) {
-    freeswitchPINVOKE.Stream_raw_write(swigCPtr, data, len);
-  }
-
-  public string get_data() {
-    string ret = freeswitchPINVOKE.Stream_get_data(swigCPtr);
+  public int chat_send(string dest_proto) {
+    int ret = freeswitchPINVOKE.Event_chat_send(swigCPtr, dest_proto);
     return ret;
   }
 
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class audio_buffer_header_t : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal audio_buffer_header_t(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
+  public string Serialize(string format) {
+    string ret = freeswitchPINVOKE.Event_Serialize(swigCPtr, format);
+    return ret;
   }
 
-  internal static HandleRef getCPtr(audio_buffer_header_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  public bool SetPriority(switch_priority_t priority) {
+    bool ret = freeswitchPINVOKE.Event_SetPriority(swigCPtr, (int)priority);
+    return ret;
   }
 
-  ~audio_buffer_header_t() {
-    Dispose();
+  public string GetHeader(string header_name) {
+    string ret = freeswitchPINVOKE.Event_GetHeader(swigCPtr, header_name);
+    return ret;
   }
 
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_audio_buffer_header_t(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
+  public string GetBody() {
+    string ret = freeswitchPINVOKE.Event_GetBody(swigCPtr);
+    return ret;
   }
 
-  public uint ts {
-    set {
-      freeswitchPINVOKE.audio_buffer_header_t_ts_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.audio_buffer_header_t_ts_get(swigCPtr);
-      return ret;
-    } 
+  public string GetEventType() {
+    string ret = freeswitchPINVOKE.Event_GetEventType(swigCPtr);
+    return ret;
   }
 
-  public uint len {
-    set {
-      freeswitchPINVOKE.audio_buffer_header_t_len_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.audio_buffer_header_t_len_get(swigCPtr);
-      return ret;
-    } 
+  public bool AddBody(string value) {
+    bool ret = freeswitchPINVOKE.Event_AddBody(swigCPtr, value);
+    return ret;
   }
 
-  public audio_buffer_header_t() : this(freeswitchPINVOKE.new_audio_buffer_header_t(), true) {
+  public bool AddHeader(string header_name, string value) {
+    bool ret = freeswitchPINVOKE.Event_AddHeader(swigCPtr, header_name, value);
+    return ret;
   }
 
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum cache_db_flag_t {
-  CDF_INUSE = (1 << 0),
-  CDF_PRUNE = (1 << 1)
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum dm_match_type_t {
-  DM_MATCH_POSITIVE,
-  DM_MATCH_NEGATIVE
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class dtls_fingerprint_t : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal dtls_fingerprint_t(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
+  public bool DeleteHeader(string header_name) {
+    bool ret = freeswitchPINVOKE.Event_DeleteHeader(swigCPtr, header_name);
+    return ret;
   }
 
-  internal static HandleRef getCPtr(dtls_fingerprint_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  public bool Fire() {
+    bool ret = freeswitchPINVOKE.Event_Fire(swigCPtr);
+    return ret;
   }
 
-  ~dtls_fingerprint_t() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_dtls_fingerprint_t(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public uint len {
-    set {
-      freeswitchPINVOKE.dtls_fingerprint_t_len_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.dtls_fingerprint_t_len_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public SWIGTYPE_p_unsigned_char data {
-    set {
-      freeswitchPINVOKE.dtls_fingerprint_t_data_set(swigCPtr, SWIGTYPE_p_unsigned_char.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.dtls_fingerprint_t_data_get(swigCPtr);
-      SWIGTYPE_p_unsigned_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public string type {
-    set {
-      freeswitchPINVOKE.dtls_fingerprint_t_type_set(swigCPtr, value);
-    } 
-    get {
-      string ret = freeswitchPINVOKE.dtls_fingerprint_t_type_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public string str {
-    set {
-      freeswitchPINVOKE.dtls_fingerprint_t_str_set(swigCPtr, value);
-    } 
-    get {
-      string ret = freeswitchPINVOKE.dtls_fingerprint_t_str_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public dtls_fingerprint_t() : this(freeswitchPINVOKE.new_dtls_fingerprint_t(), true) {
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum dtls_state_t {
-  DS_OFF,
-  DS_HANDSHAKE,
-  DS_SETUP,
-  DS_READY,
-  DS_FAIL,
-  DS_INVALID
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum dtls_type_t {
-  DTLS_TYPE_CLIENT = (1 << 0),
-  DTLS_TYPE_SERVER = (1 << 1),
-  DTLS_TYPE_RTP = (1 << 2),
-  DTLS_TYPE_RTCP = (1 << 3)
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum dtmf_flag_t {
-  DTMF_FLAG_SKIP_PROCESS = (1 << 0),
-  DTMF_FLAG_SENSITIVE = (1 << 1)
 }
 
 }
@@ -11383,11 +4842,6 @@ else
     return ret;
   }
 
-  public static int switch_channel_var_false(SWIGTYPE_p_switch_channel channel, string variable) {
-    int ret = freeswitchPINVOKE.switch_channel_var_false(SWIGTYPE_p_switch_channel.getCPtr(channel), variable);
-    return ret;
-  }
-
   public static int switch_channel_var_true(SWIGTYPE_p_switch_channel channel, string variable) {
     int ret = freeswitchPINVOKE.switch_channel_var_true(SWIGTYPE_p_switch_channel.getCPtr(channel), variable);
     return ret;
@@ -23254,9 +16708,6 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_pass_callee_id")]
   public static extern int switch_channel_pass_callee_id(HandleRef jarg1, HandleRef jarg2);
 
-  [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_var_false")]
-  public static extern int switch_channel_var_false(HandleRef jarg1, string jarg2);
-
   [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_var_true")]
   public static extern int switch_channel_var_true(HandleRef jarg1, string jarg2);
 
@@ -24775,12 +18226,6 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_name_get")]
   public static extern string switch_srtp_crypto_suite_t_name_get(HandleRef jarg1);
 
-  [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_alias_set")]
-  public static extern void switch_srtp_crypto_suite_t_alias_set(HandleRef jarg1, string jarg2);
-
-  [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_alias_get")]
-  public static extern string switch_srtp_crypto_suite_t_alias_get(HandleRef jarg1);
-
   [DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_type_set")]
   public static extern void switch_srtp_crypto_suite_t_type_set(HandleRef jarg1, int jarg2);
 
@@ -27072,6 +20517,117 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
+public class IvrMenu : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal IvrMenu(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(IvrMenu obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~IvrMenu() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_IvrMenu(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public IvrMenu(IvrMenu main, string name, string greeting_sound, string short_greeting_sound, string invalid_sound, string exit_sound, string transfer_sound, string confirm_macro, string confirm_key, string tts_engine, string tts_voice, int confirm_attempts, int inter_timeout, int digit_len, int timeout, int max_failures, int max_timeouts) : this(freeswitchPINVOKE.new_IvrMenu(IvrMenu.getCPtr(main), name, greeting_sound, short_greeting_sound, invalid_sound, exit_sound, transfer_sound, confirm_macro, confirm_key, tts_engine, tts_voice, confirm_attempts, inter_timeout, digit_len, timeout, max_failures, max_timeouts), true) {
+  }
+
+  public void bindAction(string action, string arg, string bind) {
+    freeswitchPINVOKE.IvrMenu_bindAction(swigCPtr, action, arg, bind);
+  }
+
+  public void Execute(CoreSession session, string name) {
+    freeswitchPINVOKE.IvrMenu_Execute(swigCPtr, CoreSession.getCPtr(session), name);
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public partial class ManagedSession : CoreSession {
+  private HandleRef swigCPtr;
+
+  internal ManagedSession(IntPtr cPtr, bool cMemoryOwn) : base(freeswitchPINVOKE.ManagedSession_SWIGUpcast(cPtr), cMemoryOwn) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(ManagedSession obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~ManagedSession() {
+    Dispose();
+  }
+
+  public override void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_ManagedSession(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+      base.Dispose();
+    }
+  }
+
+  public ManagedSession() : this(freeswitchPINVOKE.new_ManagedSession__SWIG_0(), true) {
+  }
+
+  public ManagedSession(string uuid) : this(freeswitchPINVOKE.new_ManagedSession__SWIG_1(uuid), true) {
+  }
+
+  public ManagedSession(SWIGTYPE_p_switch_core_session session) : this(freeswitchPINVOKE.new_ManagedSession__SWIG_2(SWIGTYPE_p_switch_core_session.getCPtr(session)), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
 public class payload_map_t : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;
@@ -27554,6 +21110,6436 @@ namespace FreeSWITCH.Native {
 
 namespace FreeSWITCH.Native {
 
+using System;
+using System.Runtime.InteropServices;
+
+public partial class Stream : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal Stream(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(Stream obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~Stream() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_Stream(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public Stream() : this(freeswitchPINVOKE.new_Stream__SWIG_0(), true) {
+  }
+
+  public Stream(switch_stream_handle arg0) : this(freeswitchPINVOKE.new_Stream__SWIG_1(switch_stream_handle.getCPtr(arg0)), true) {
+  }
+
+  public string read(SWIGTYPE_p_int len) {
+    string ret = freeswitchPINVOKE.Stream_read(swigCPtr, SWIGTYPE_p_int.getCPtr(len));
+    return ret;
+  }
+
+  public void Write(string data) {
+    freeswitchPINVOKE.Stream_Write(swigCPtr, data);
+  }
+
+  public void raw_write(string data, int len) {
+    freeswitchPINVOKE.Stream_raw_write(swigCPtr, data, len);
+  }
+
+  public string get_data() {
+    string ret = freeswitchPINVOKE.Stream_get_data(swigCPtr);
+    return ret;
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_a_256__char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_a_256__char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_a_256__char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_a_256__char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_a_2__icand_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_a_2__icand_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_a_2__icand_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_a_2__icand_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_apr_pool_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_apr_pool_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_apr_pool_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_apr_pool_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_cJSON {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_cJSON(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_cJSON() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_cJSON obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_FILE {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_FILE(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_FILE() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_FILE obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_float {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_float(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_float() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_float obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_char_enum_switch_management_action_t_p_char_switch_size_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_cJSON_p_q_const__char_unsigned_long__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_p_switch_console_callback_match__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_q_const__char_p_q_const__char_p_switch_event_t_p_void__p_switch_xml obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_unsigned_long__int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char_p_void__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_switch_codec_fmtp__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__char_p_switch_core_session_p_switch_stream_handle__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__cJSON_p_switch_core_session_p_p_cJSON__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__switch_log_node_t_enum_switch_log_level_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_q_const__void_p_q_const__void_p_void__switch_bool_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_double__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_int__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_char_p_q_const__char__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_p_char_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_p_switch_event_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_int_p_q_const__char_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_q_const__switch_dtmf_t_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle_p_void_unsigned_int_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_asr_handle__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_enum_switch_codec_control_command_t_enum_switch_codec_control_type_t_p_void_enum_switch_codec_control_type_t_p_void_p_enum_switch_codec_control_type_t_p_p_void__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_p_switch_frame__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_codec__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_codec__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_codec__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_enum_switch_channel_callstate_t_p_switch_device_record_s__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session__int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session__int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session__int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session__int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_p_char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_char_p_switch_say_args_t_p_switch_input_args_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_p_switch_frame_unsigned_long_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char_q_const__int_q_const__int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_bool_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__char__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t_enum_switch_dtmf_direction_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_q_const__switch_dtmf_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_core_session_message__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_p_switch_core_session_p_p_apr_pool_t_unsigned_long_p_enum_switch_call_cause_t__switch_call_cause_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event_p_switch_caller_profile_p_switch_core_session_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_event__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_p_void__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_switch_frame_unsigned_long_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_p_void__p_void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_p_void__p_void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_p_void__p_void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_p_void__p_void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_t_switch_media_type_t__p_switch_jb_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char_p_char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_char_p_char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle_p_p_char_p_p_char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_directory_handle__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_event__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_event__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_event__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_event__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_event__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_event__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_audio_col_t_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_enum_switch_file_command_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_long_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_q_const__char__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame_enum_switch_video_read_flag_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_switch_frame__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_unsigned_int_long_long_int__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle_p_void_p_switch_size_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_file_handle__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_file_handle__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_file_handle__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_file_handle__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_ivr_dmachine_match__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_ivr_menu_p_char_p_char_size_t_p_void__switch_ivr_action_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_live_array_s_p_q_const__char_p_q_const__char_p_cJSON_p_void__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_media_bug_p_void_enum_switch_abc_type_t__switch_bool_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_media_bug_p_void__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_media_bug_p_void__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_media_bug_p_void__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_media_bug_p_void__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_rtp_p_switch_socket_t_p_void_switch_size_t_p_switch_sockaddr_t__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_scheduler_task__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_scheduler_task__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_scheduler_task__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_scheduler_task__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_double__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_int__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_q_const__char__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_char_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_q_const__char_int_int_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle_p_void_p_switch_size_t_p_unsigned_long__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_speech_handle__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_speech_handle__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_speech_handle__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_speech_handle__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_int__p_unsigned_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_q_const__char_v_______switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_stream_handle_p_unsigned_char_switch_size_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_thread_t_p_void__p_void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_timer_enum_switch_bool_t__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_switch_timer__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_switch_timer__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_switch_timer__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_timer__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_int_p_p_char_p_p_char__int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_void_p_q_const__char__int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_void_p_q_const__char__int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_void_p_q_const__char__int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_p_q_const__char__int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_void_p_switch_event__int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_void_p_switch_event__int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_void_p_switch_event__int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_p_switch_event__int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_p_void__void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_p_void__void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_p_void__void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void__void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_uint8_t_p_p_q_const__char_p_void__p_switch_xml obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_void__p_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_void__p_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_void__p_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_void__p_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_f_void__switch_status_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_f_void__switch_status_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_f_void__switch_status_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_f_void__switch_status_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_in6_addr {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_in6_addr(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_in6_addr() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_in6_addr obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_apr_pool_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_apr_pool_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_apr_pool_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_apr_pool_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_cJSON {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_cJSON(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_cJSON() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_cJSON obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_pid_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_pid_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_pid_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_pid_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_payload_map_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_payload_map_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_payload_map_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_payload_map_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_p_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_p_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_p_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_p_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_real_pcre {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_real_pcre(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_real_pcre() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_real_pcre obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_sqlite3 {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_sqlite3(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_sqlite3() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_sqlite3 obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_sqlite3_stmt {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_sqlite3_stmt(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_sqlite3_stmt() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_sqlite3_stmt obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_agc_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_agc_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_agc_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_agc_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_audio_resampler_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_audio_resampler_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_audio_resampler_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_audio_resampler_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_buffer {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_buffer(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_buffer() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_buffer obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_cache_db_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_cache_db_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_cache_db_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_caller_extension {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_caller_extension(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_caller_extension() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_caller_extension obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_channel {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_channel(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_channel() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_channel obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_codec_implementation {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_codec_implementation(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_codec_implementation() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_codec_implementation obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_console_callback_match {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_console_callback_match(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_console_callback_match() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_console_callback_match obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_core_port_allocator {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_core_port_allocator(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_core_port_allocator() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_port_allocator obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_core_session {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_core_session(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_core_session() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_session obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_core_session_message {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_core_session_message(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_core_session_message() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_core_session_message obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_device_record_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_device_record_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_device_record_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_device_record_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_event {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_event(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_event() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_event obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_event_node {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_event_node(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_event_node() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_event_node obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_file_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_file_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_file_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_file_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_frame_buffer_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_frame_buffer_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_frame_buffer_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_frame_buffer_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_frame {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_frame(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_frame() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_frame obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_hashtable {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_hashtable(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_hashtable() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_hashtable obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_hashtable_iterator {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_hashtable_iterator(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_hashtable_iterator() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_hashtable_iterator obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_digit_stream {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_digit_stream(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_digit_stream() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_digit_stream obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_digit_stream_parser {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_digit_stream_parser(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_digit_stream_parser() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_digit_stream_parser obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_dmachine {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_dmachine(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_dmachine() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_dmachine obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_dmachine_match {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_dmachine_match(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_dmachine_match() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_dmachine_match obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_menu {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_menu(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_menu() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_menu obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_ivr_menu_xml_ctx {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_ivr_menu_xml_ctx(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_ivr_menu_xml_ctx() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_ivr_menu_xml_ctx obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_live_array_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_live_array_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_live_array_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_live_array_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_log_node_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_log_node_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_log_node_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_log_node_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_media_bug {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_media_bug(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_media_bug() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_media_bug obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_network_list {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_network_list(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_network_list() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_network_list obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_rtp {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_rtp(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_rtp() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_rtp obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_say_file_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_say_file_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_say_file_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_say_file_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_sql_queue_manager {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_sql_queue_manager(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_sql_queue_manager() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_sql_queue_manager obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_thread_data_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_thread_data_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_thread_data_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_thread_data_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_xml_binding {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_xml_binding(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_xml_binding() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml_binding obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_switch_xml {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_switch_xml(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_switch_xml() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_unsigned_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_unsigned_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_unsigned_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_unsigned_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_p_void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_p_void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_p_void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_p_void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_real_pcre {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_real_pcre(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_real_pcre() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_real_pcre obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_short {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_short(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_short() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_short obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_sockaddr {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_sockaddr(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_sockaddr() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_sockaddr obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_sockaddr_in6 {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_sockaddr_in6(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_sockaddr_in6() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_sockaddr_in6 obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_socklen_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_socklen_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_socklen_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_socklen_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_sqlite3 {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_sqlite3(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_sqlite3() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_sqlite3 obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_sqlite3_stmt {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_sqlite3_stmt(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_sqlite3_stmt() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_sqlite3_stmt obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_agc_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_agc_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_agc_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_agc_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_buffer {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_buffer(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_buffer() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_buffer obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_cache_db_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_cache_db_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_cache_db_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_cache_db_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_call_cause_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_call_cause_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_call_cause_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_call_cause_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_channel {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_channel(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_channel() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_channel obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_codec_control_type_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_codec_control_type_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_codec_control_type_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_codec_control_type_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_core_port_allocator {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_core_port_allocator(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_core_port_allocator() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_core_port_allocator obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_core_session {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_core_session(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_core_session() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_core_session obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_event_types_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_event_types_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_event_types_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_event_types_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_file_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_file_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_file_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_file_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_frame_buffer_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_frame_buffer_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_frame_buffer_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_frame_buffer_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_hashtable {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_hashtable(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_hashtable() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_hashtable obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_hashtable_iterator {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_hashtable_iterator(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_hashtable_iterator() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_hashtable_iterator obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_image_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_image_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_image_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_image_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_img_fmt_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_img_fmt_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_img_fmt_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_img_fmt_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_img_position_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_img_position_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_img_position_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_img_position_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_interval_time_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_interval_time_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_interval_time_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_interval_time_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_action_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_action_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_action_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_action_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_digit_stream {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_digit_stream(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_digit_stream() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_digit_stream obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_digit_stream_parser {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_digit_stream_parser(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_digit_stream_parser() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_digit_stream_parser obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_dmachine {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_dmachine(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_dmachine() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_dmachine obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_menu {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_menu(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_menu() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ivr_menu_xml_ctx {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ivr_menu_xml_ctx(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ivr_menu_xml_ctx() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu_xml_ctx obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_jb_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_jb_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_jb_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_jb_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_live_array_s {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_live_array_s(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_live_array_s() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_live_array_s obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_media_bug {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_media_bug(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_media_bug() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_media_bug obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_mutex_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_mutex_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_mutex_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_mutex_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_network_list {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_network_list(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_network_list() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_network_list obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_odbc_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_odbc_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_odbc_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_odbc_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_pgsql_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_pgsql_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_pgsql_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_pgsql_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_pollfd_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_pollfd_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_pollfd_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_pollfd_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_queue_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_queue_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_queue_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_queue_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_rtcp_frame {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_rtcp_frame(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_rtcp_frame() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtcp_frame obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_rtp {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_rtp(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_rtp() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtp obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_rtp_flag_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_rtp_flag_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_rtp_flag_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_rtp_flag_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_say_file_handle {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_say_file_handle(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_say_file_handle() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_say_file_handle obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_size_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_size_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_size_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_size_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_sockaddr_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_sockaddr_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_sockaddr_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_sockaddr_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_socket_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_socket_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_socket_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_socket_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_sql_queue_manager {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_sql_queue_manager(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_sql_queue_manager() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_sql_queue_manager obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_ssize_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_ssize_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_ssize_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_ssize_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_thread_rwlock_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_thread_rwlock_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_thread_rwlock_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_rwlock_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_thread_start_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_thread_start_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_thread_start_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_start_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_thread_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_thread_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_thread_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_thread_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_time_exp_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_time_exp_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_time_exp_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_time_exp_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_time_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_time_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_time_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_time_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_switch_xml_binding {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_switch_xml_binding(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_switch_xml_binding() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_switch_xml_binding obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_time_t {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_time_t(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_time_t() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_time_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_unsigned_char {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_unsigned_char(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_unsigned_char() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_char obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_unsigned_int {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_unsigned_int(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_unsigned_int() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_int obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_unsigned_long {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_unsigned_long(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_unsigned_long() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_long obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_unsigned_short {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_unsigned_short(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_unsigned_short() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_unsigned_short obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class SWIGTYPE_p_void {
+  private HandleRef swigCPtr;
+
+  internal SWIGTYPE_p_void(IntPtr cPtr, bool futureUse) {
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  protected SWIGTYPE_p_void() {
+    swigCPtr = new HandleRef(null, IntPtr.Zero);
+  }
+
+  internal static HandleRef getCPtr(SWIGTYPE_p_void obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
 public enum switch_abc_type_t {
   SWITCH_ABC_TYPE_INIT,
   SWITCH_ABC_TYPE_READ,
@@ -27726,98 +27712,6 @@ public class switch_api_interface : IDisposable {
 
 namespace FreeSWITCH.Native {
 
-using System;
-using System.Runtime.InteropServices;
-
-public class switch_app_log : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal switch_app_log(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(switch_app_log obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~switch_app_log() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_switch_app_log(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public string app {
-    set {
-      freeswitchPINVOKE.switch_app_log_app_set(swigCPtr, value);
-    } 
-    get {
-      string ret = freeswitchPINVOKE.switch_app_log_app_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public string arg {
-    set {
-      freeswitchPINVOKE.switch_app_log_arg_set(swigCPtr, value);
-    } 
-    get {
-      string ret = freeswitchPINVOKE.switch_app_log_arg_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public SWIGTYPE_p_switch_time_t stamp {
-    set {
-      freeswitchPINVOKE.switch_app_log_stamp_set(swigCPtr, SWIGTYPE_p_switch_time_t.getCPtr(value));
-      if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
-    } 
-    get {
-      SWIGTYPE_p_switch_time_t ret = new SWIGTYPE_p_switch_time_t(freeswitchPINVOKE.switch_app_log_stamp_get(swigCPtr), true);
-      if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
-      return ret;
-    } 
-  }
-
-  public switch_app_log next {
-    set {
-      freeswitchPINVOKE.switch_app_log_next_set(swigCPtr, switch_app_log.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_app_log_next_get(swigCPtr);
-      switch_app_log ret = (cPtr == IntPtr.Zero) ? null : new switch_app_log(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_app_log() : this(freeswitchPINVOKE.new_switch_app_log(), true) {
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
 [System.Flags] public enum switch_application_flag_enum_t {
   SAF_NONE = 0,
   SAF_SUPPORT_NOMEDIA = (1 << 0),
@@ -28003,6 +27897,98 @@ public class switch_application_interface : IDisposable {
 
 namespace FreeSWITCH.Native {
 
+using System;
+using System.Runtime.InteropServices;
+
+public class switch_app_log : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal switch_app_log(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(switch_app_log obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~switch_app_log() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_switch_app_log(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public string app {
+    set {
+      freeswitchPINVOKE.switch_app_log_app_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.switch_app_log_app_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public string arg {
+    set {
+      freeswitchPINVOKE.switch_app_log_arg_set(swigCPtr, value);
+    } 
+    get {
+      string ret = freeswitchPINVOKE.switch_app_log_arg_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public SWIGTYPE_p_switch_time_t stamp {
+    set {
+      freeswitchPINVOKE.switch_app_log_stamp_set(swigCPtr, SWIGTYPE_p_switch_time_t.getCPtr(value));
+      if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
+    } 
+    get {
+      SWIGTYPE_p_switch_time_t ret = new SWIGTYPE_p_switch_time_t(freeswitchPINVOKE.switch_app_log_stamp_get(swigCPtr), true);
+      if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
+      return ret;
+    } 
+  }
+
+  public switch_app_log next {
+    set {
+      freeswitchPINVOKE.switch_app_log_next_set(swigCPtr, switch_app_log.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_app_log_next_get(swigCPtr);
+      switch_app_log ret = (cPtr == IntPtr.Zero) ? null : new switch_app_log(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_app_log() : this(freeswitchPINVOKE.new_switch_app_log(), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
 [System.Flags] public enum switch_asr_flag_enum_t {
   SWITCH_ASR_FLAG_NONE = 0,
   SWITCH_ASR_FLAG_DATA = (1 << 0),
@@ -30953,6 +30939,44 @@ public class switch_chat_interface : IDisposable {
 
 namespace FreeSWITCH.Native {
 
+public enum switch_codec_control_command_t {
+  SCC_VIDEO_GEN_KEYFRAME = 0,
+  SCC_VIDEO_BANDWIDTH,
+  SCC_VIDEO_RESET,
+  SCC_AUDIO_PACKET_LOSS,
+  SCC_AUDIO_ADJUST_BITRATE,
+  SCC_DEBUG,
+  SCC_CODEC_SPECIFIC
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+public enum switch_codec_control_type_t {
+  SCCT_NONE = 0,
+  SCCT_STRING,
+  SCCT_INT
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
 using System;
 using System.Runtime.InteropServices;
 
@@ -31130,44 +31154,6 @@ public class switch_codec : IDisposable {
 
 namespace FreeSWITCH.Native {
 
-public enum switch_codec_control_command_t {
-  SCC_VIDEO_GEN_KEYFRAME = 0,
-  SCC_VIDEO_BANDWIDTH,
-  SCC_VIDEO_RESET,
-  SCC_AUDIO_PACKET_LOSS,
-  SCC_AUDIO_ADJUST_BITRATE,
-  SCC_DEBUG,
-  SCC_CODEC_SPECIFIC
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum switch_codec_control_type_t {
-  SCCT_NONE = 0,
-  SCCT_STRING,
-  SCCT_INT
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
 [System.Flags] public enum switch_codec_flag_enum_t {
   SWITCH_CODEC_FLAG_ENCODE = (1 << 0),
   SWITCH_CODEC_FLAG_DECODE = (1 << 1),
@@ -37449,6 +37435,209 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
+public class switch_io_event_hooks : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal switch_io_event_hooks(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(switch_io_event_hooks obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~switch_io_event_hooks() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_switch_io_event_hooks(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public switch_io_event_hook_outgoing_channel outgoing_channel {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_set(swigCPtr, switch_io_event_hook_outgoing_channel.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_get(swigCPtr);
+      switch_io_event_hook_outgoing_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_outgoing_channel(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_receive_message receive_message {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_receive_message_set(swigCPtr, switch_io_event_hook_receive_message.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_message_get(swigCPtr);
+      switch_io_event_hook_receive_message ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_message(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_receive_event receive_event {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_receive_event_set(swigCPtr, switch_io_event_hook_receive_event.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_event_get(swigCPtr);
+      switch_io_event_hook_receive_event ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_event(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_read_frame read_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_read_frame_set(swigCPtr, switch_io_event_hook_read_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_read_frame_get(swigCPtr);
+      switch_io_event_hook_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_read_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_video_read_frame video_read_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_set(swigCPtr, switch_io_event_hook_video_read_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_get(swigCPtr);
+      switch_io_event_hook_video_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_read_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_write_frame write_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_write_frame_set(swigCPtr, switch_io_event_hook_write_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_write_frame_get(swigCPtr);
+      switch_io_event_hook_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_write_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_video_write_frame video_write_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_set(swigCPtr, switch_io_event_hook_video_write_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_get(swigCPtr);
+      switch_io_event_hook_video_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_write_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_text_write_frame text_write_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_text_write_frame_set(swigCPtr, switch_io_event_hook_text_write_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_text_write_frame_get(swigCPtr);
+      switch_io_event_hook_text_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_text_write_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_text_read_frame text_read_frame {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_text_read_frame_set(swigCPtr, switch_io_event_hook_text_read_frame.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_text_read_frame_get(swigCPtr);
+      switch_io_event_hook_text_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_text_read_frame(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_kill_channel kill_channel {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_kill_channel_set(swigCPtr, switch_io_event_hook_kill_channel.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_kill_channel_get(swigCPtr);
+      switch_io_event_hook_kill_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_kill_channel(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_send_dtmf send_dtmf {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_set(swigCPtr, switch_io_event_hook_send_dtmf.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_get(swigCPtr);
+      switch_io_event_hook_send_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_send_dtmf(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_recv_dtmf recv_dtmf {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_set(swigCPtr, switch_io_event_hook_recv_dtmf.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_get(swigCPtr);
+      switch_io_event_hook_recv_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_recv_dtmf(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_state_change state_change {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_state_change_set(swigCPtr, switch_io_event_hook_state_change.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_change_get(swigCPtr);
+      switch_io_event_hook_state_change ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_change(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hook_state_run state_run {
+    set {
+      freeswitchPINVOKE.switch_io_event_hooks_state_run_set(swigCPtr, switch_io_event_hook_state_run.getCPtr(value));
+    } 
+    get {
+      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_run_get(swigCPtr);
+      switch_io_event_hook_state_run ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_run(cPtr, false);
+      return ret;
+    } 
+  }
+
+  public switch_io_event_hooks() : this(freeswitchPINVOKE.new_switch_io_event_hooks(), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
 public class switch_io_event_hook_send_dtmf : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;
@@ -38014,209 +38203,6 @@ public class switch_io_event_hook_write_frame : IDisposable {
 
 namespace FreeSWITCH.Native {
 
-using System;
-using System.Runtime.InteropServices;
-
-public class switch_io_event_hooks : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal switch_io_event_hooks(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(switch_io_event_hooks obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~switch_io_event_hooks() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_switch_io_event_hooks(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public switch_io_event_hook_outgoing_channel outgoing_channel {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_set(swigCPtr, switch_io_event_hook_outgoing_channel.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_get(swigCPtr);
-      switch_io_event_hook_outgoing_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_outgoing_channel(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_receive_message receive_message {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_receive_message_set(swigCPtr, switch_io_event_hook_receive_message.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_message_get(swigCPtr);
-      switch_io_event_hook_receive_message ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_message(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_receive_event receive_event {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_receive_event_set(swigCPtr, switch_io_event_hook_receive_event.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_event_get(swigCPtr);
-      switch_io_event_hook_receive_event ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_event(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_read_frame read_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_read_frame_set(swigCPtr, switch_io_event_hook_read_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_read_frame_get(swigCPtr);
-      switch_io_event_hook_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_read_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_video_read_frame video_read_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_set(swigCPtr, switch_io_event_hook_video_read_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_get(swigCPtr);
-      switch_io_event_hook_video_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_read_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_write_frame write_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_write_frame_set(swigCPtr, switch_io_event_hook_write_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_write_frame_get(swigCPtr);
-      switch_io_event_hook_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_write_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_video_write_frame video_write_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_set(swigCPtr, switch_io_event_hook_video_write_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_get(swigCPtr);
-      switch_io_event_hook_video_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_write_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_text_write_frame text_write_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_text_write_frame_set(swigCPtr, switch_io_event_hook_text_write_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_text_write_frame_get(swigCPtr);
-      switch_io_event_hook_text_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_text_write_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_text_read_frame text_read_frame {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_text_read_frame_set(swigCPtr, switch_io_event_hook_text_read_frame.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_text_read_frame_get(swigCPtr);
-      switch_io_event_hook_text_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_text_read_frame(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_kill_channel kill_channel {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_kill_channel_set(swigCPtr, switch_io_event_hook_kill_channel.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_kill_channel_get(swigCPtr);
-      switch_io_event_hook_kill_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_kill_channel(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_send_dtmf send_dtmf {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_set(swigCPtr, switch_io_event_hook_send_dtmf.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_get(swigCPtr);
-      switch_io_event_hook_send_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_send_dtmf(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_recv_dtmf recv_dtmf {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_set(swigCPtr, switch_io_event_hook_recv_dtmf.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_get(swigCPtr);
-      switch_io_event_hook_recv_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_recv_dtmf(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_state_change state_change {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_state_change_set(swigCPtr, switch_io_event_hook_state_change.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_change_get(swigCPtr);
-      switch_io_event_hook_state_change ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_change(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hook_state_run state_run {
-    set {
-      freeswitchPINVOKE.switch_io_event_hooks_state_run_set(swigCPtr, switch_io_event_hook_state_run.getCPtr(value));
-    } 
-    get {
-      IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_run_get(swigCPtr);
-      switch_io_event_hook_state_run ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_run(cPtr, false);
-      return ret;
-    } 
-  }
-
-  public switch_io_event_hooks() : this(freeswitchPINVOKE.new_switch_io_event_hooks(), true) {
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
 [System.Flags] public enum switch_io_flag_enum_t {
   SWITCH_IO_FLAG_NONE = 0,
   SWITCH_IO_FLAG_NOBLOCK = (1 << 0),
@@ -43165,16 +43151,6 @@ public class switch_srtp_crypto_suite_t : IDisposable {
     } 
   }
 
-  public string alias {
-    set {
-      freeswitchPINVOKE.switch_srtp_crypto_suite_t_alias_set(swigCPtr, value);
-    } 
-    get {
-      string ret = freeswitchPINVOKE.switch_srtp_crypto_suite_t_alias_get(swigCPtr);
-      return ret;
-    } 
-  }
-
   public switch_rtp_crypto_key_type_t type {
     set {
       freeswitchPINVOKE.switch_srtp_crypto_suite_t_type_set(swigCPtr, (int)value);
@@ -44698,122 +44674,6 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
-public class switch_vid_params_t : IDisposable {
-  private HandleRef swigCPtr;
-  protected bool swigCMemOwn;
-
-  internal switch_vid_params_t(IntPtr cPtr, bool cMemoryOwn) {
-    swigCMemOwn = cMemoryOwn;
-    swigCPtr = new HandleRef(this, cPtr);
-  }
-
-  internal static HandleRef getCPtr(switch_vid_params_t obj) {
-    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
-  }
-
-  ~switch_vid_params_t() {
-    Dispose();
-  }
-
-  public virtual void Dispose() {
-    lock(this) {
-      if (swigCPtr.Handle != IntPtr.Zero) {
-        if (swigCMemOwn) {
-          swigCMemOwn = false;
-          freeswitchPINVOKE.delete_switch_vid_params_t(swigCPtr);
-        }
-        swigCPtr = new HandleRef(null, IntPtr.Zero);
-      }
-      GC.SuppressFinalize(this);
-    }
-  }
-
-  public uint width {
-    set {
-      freeswitchPINVOKE.switch_vid_params_t_width_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.switch_vid_params_t_width_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public uint height {
-    set {
-      freeswitchPINVOKE.switch_vid_params_t_height_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.switch_vid_params_t_height_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public uint fps {
-    set {
-      freeswitchPINVOKE.switch_vid_params_t_fps_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.switch_vid_params_t_fps_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public uint d_width {
-    set {
-      freeswitchPINVOKE.switch_vid_params_t_d_width_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.switch_vid_params_t_d_width_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public uint d_height {
-    set {
-      freeswitchPINVOKE.switch_vid_params_t_d_height_set(swigCPtr, value);
-    } 
-    get {
-      uint ret = freeswitchPINVOKE.switch_vid_params_t_d_height_get(swigCPtr);
-      return ret;
-    } 
-  }
-
-  public switch_vid_params_t() : this(freeswitchPINVOKE.new_switch_vid_params_t(), true) {
-  }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum switch_vid_spy_fmt_t {
-  SPY_LOWER_RIGHT_SMALL,
-  SPY_LOWER_RIGHT_LARGE,
-  SPY_DUAL_CROP
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 2.0.12
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
 public class switch_video_codec_settings : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;
@@ -44965,6 +44825,122 @@ namespace FreeSWITCH.Native {
 using System;
 using System.Runtime.InteropServices;
 
+public class switch_vid_params_t : IDisposable {
+  private HandleRef swigCPtr;
+  protected bool swigCMemOwn;
+
+  internal switch_vid_params_t(IntPtr cPtr, bool cMemoryOwn) {
+    swigCMemOwn = cMemoryOwn;
+    swigCPtr = new HandleRef(this, cPtr);
+  }
+
+  internal static HandleRef getCPtr(switch_vid_params_t obj) {
+    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+  }
+
+  ~switch_vid_params_t() {
+    Dispose();
+  }
+
+  public virtual void Dispose() {
+    lock(this) {
+      if (swigCPtr.Handle != IntPtr.Zero) {
+        if (swigCMemOwn) {
+          swigCMemOwn = false;
+          freeswitchPINVOKE.delete_switch_vid_params_t(swigCPtr);
+        }
+        swigCPtr = new HandleRef(null, IntPtr.Zero);
+      }
+      GC.SuppressFinalize(this);
+    }
+  }
+
+  public uint width {
+    set {
+      freeswitchPINVOKE.switch_vid_params_t_width_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_vid_params_t_width_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint height {
+    set {
+      freeswitchPINVOKE.switch_vid_params_t_height_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_vid_params_t_height_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint fps {
+    set {
+      freeswitchPINVOKE.switch_vid_params_t_fps_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_vid_params_t_fps_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint d_width {
+    set {
+      freeswitchPINVOKE.switch_vid_params_t_d_width_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_vid_params_t_d_width_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public uint d_height {
+    set {
+      freeswitchPINVOKE.switch_vid_params_t_d_height_set(swigCPtr, value);
+    } 
+    get {
+      uint ret = freeswitchPINVOKE.switch_vid_params_t_d_height_get(swigCPtr);
+      return ret;
+    } 
+  }
+
+  public switch_vid_params_t() : this(freeswitchPINVOKE.new_switch_vid_params_t(), true) {
+  }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+public enum switch_vid_spy_fmt_t {
+  SPY_LOWER_RIGHT_SMALL,
+  SPY_LOWER_RIGHT_LARGE,
+  SPY_DUAL_CROP
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.12
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
 public class switch_waitlist_t : IDisposable {
   private HandleRef swigCPtr;
   protected bool swigCMemOwn;
diff --git a/src/mod/languages/mod_perl/freeswitch.pm b/src/mod/languages/mod_perl/freeswitch.pm
index d2c7b02f39..33764f5a54 100644
--- a/src/mod/languages/mod_perl/freeswitch.pm
+++ b/src/mod/languages/mod_perl/freeswitch.pm
@@ -1,5 +1,5 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 3.0.2
+# Version 3.0.10
 #
 # Do not make changes to this file unless you know what you are doing--modify
 # the SWIG interface file instead.
diff --git a/src/mod/languages/mod_perl/mod_perl_wrap.cpp b/src/mod/languages/mod_perl/mod_perl_wrap.cpp
index fe0e3ee73e..1aa1ebbb5c 100644
--- a/src/mod/languages/mod_perl/mod_perl_wrap.cpp
+++ b/src/mod/languages/mod_perl/mod_perl_wrap.cpp
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * This file is not intended to be easily readable and contains a number of
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -8,7 +8,11 @@
  * interface file instead.
  * ----------------------------------------------------------------------------- */
 
+
+#ifndef SWIGPERL
 #define SWIGPERL
+#endif
+
 #define SWIG_CASTRANK_MODE
 
 
@@ -102,9 +106,11 @@ template  T SwigValueInit() {
 #endif
 
 /* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#  ifndef GCC_HASCLASSVISIBILITY
-#    define GCC_HASCLASSVISIBILITY
+#if defined(__GNUC__)
+#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#    ifndef GCC_HASCLASSVISIBILITY
+#      define GCC_HASCLASSVISIBILITY
+#    endif
 #  endif
 #endif
 
@@ -143,6 +149,19 @@ template  T SwigValueInit() {
 # define _SCL_SECURE_NO_DEPRECATE
 #endif
 
+/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
+#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
+# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
+#endif
+
+/* Intel's compiler complains if a variable which was never initialised is
+ * cast to void, which is a common idiom which we use to indicate that we
+ * are aware a variable isn't used.  So we just silence that warning.
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
+ */
+#ifdef __INTEL_COMPILER
+# pragma warning disable 592
+#endif
 
 /* -----------------------------------------------------------------------------
  * swigrun.swg
@@ -641,16 +660,16 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
     char d = *(c++);
     unsigned char uu;
     if ((d >= '0') && (d <= '9'))
-      uu = ((d - '0') << 4);
+      uu = (unsigned char)((d - '0') << 4);
     else if ((d >= 'a') && (d <= 'f'))
-      uu = ((d - ('a'-10)) << 4);
+      uu = (unsigned char)((d - ('a'-10)) << 4);
     else
       return (char *) 0;
     d = *(c++);
     if ((d >= '0') && (d <= '9'))
-      uu |= (d - '0');
+      uu |= (unsigned char)(d - '0');
     else if ((d >= 'a') && (d <= 'f'))
-      uu |= (d - ('a'-10));
+      uu |= (unsigned char)(d - ('a'-10));
     else
       return (char *) 0;
     *u = uu;
@@ -1018,9 +1037,9 @@ typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
 
 #  ifdef PERL_OBJECT
 #    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
-static void SWIG_Perl_croak_null(CPerlObj *pPerl)
+static void SWIGUNUSED SWIG_Perl_croak_null(CPerlObj *pPerl)
 #  else
-static void SWIG_croak_null()
+static void SWIGUNUSED SWIG_croak_null()
 #  endif
 {
   SV *err = get_sv("@", GV_ADD);
@@ -1489,6 +1508,9 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 #ifdef stat
   #undef stat
 #endif
+#ifdef seed
+  #undef seed
+#endif
 
 #ifdef bool
   /* Leave if macro is from C99 stdbool.h */
@@ -1549,7 +1571,7 @@ static swig_module_info swig_module = {swig_types, 29, 0, 0, 0, 0};
 #define SWIG_name   "freeswitchc::boot_freeswitch"
 #define SWIG_prefix "freeswitchc::"
 
-#define SWIGVERSION 0x030002 
+#define SWIGVERSION 0x030010 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -1664,6 +1686,17 @@ SWIG_FromCharPtr(const char *cptr)
 #endif
 
 
+#include 
+#ifdef _MSC_VER
+# ifndef strtoull
+#  define strtoull _strtoui64
+# endif
+# ifndef strtoll
+#  define strtoll _strtoi64
+# endif
+#endif
+
+
 SWIGINTERN int
 SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
 {
@@ -1736,14 +1769,14 @@ SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
 {
   if (SvUOK(obj)) {
     UV v = SvUV(obj);
-    if (v <= LONG_MAX) {
+    if (UVSIZE < sizeof(*val) || v <= LONG_MAX) {
       if (val) *val = v;
       return SWIG_OK;
     }
     return SWIG_OverflowError;
   } else if (SvIOK(obj)) {
     IV v = SvIV(obj);
-    if (v >= LONG_MIN && v <= LONG_MAX) {
+    if (IVSIZE <= sizeof(*val) || (v >= LONG_MIN && v <= LONG_MAX)) {
       if(val) *val = v;
       return SWIG_OK;
     }
@@ -1806,7 +1839,7 @@ SWIGINTERNINLINE SV *
 SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
 {
   SV *sv;
-  if (value >= IV_MIN && value <= IV_MAX)
+  if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX))
     sv = newSViv(value);
   else
     sv = newSVpvf("%ld", value);
@@ -1877,14 +1910,14 @@ SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
 {
   if (SvUOK(obj)) {
     UV v = SvUV(obj);
-    if (v <= ULONG_MAX) {
+    if (UVSIZE <= sizeof(*val) || v <= ULONG_MAX) {
       if (val) *val = v;
       return SWIG_OK;
     }
     return SWIG_OverflowError;
   } else if (SvIOK(obj)) {
     IV v = SvIV(obj);
-    if (v >= 0 && v <= ULONG_MAX) {
+    if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULONG_MAX)) {
       if (val) *val = v;
       return SWIG_OK;
     }
@@ -1940,7 +1973,7 @@ SWIGINTERNINLINE SV *
 SWIG_From_unsigned_SS_long  SWIG_PERL_DECL_ARGS_1(unsigned long value)
 {
   SV *sv;
-  if (value <= UV_MAX)
+  if (UVSIZE >= sizeof(value) || value <= UV_MAX)
     sv = newSVuv(value);
   else
     sv = newSVpvf("%lu", value);
@@ -10599,7 +10632,7 @@ SWIGRUNTIME void
 SWIG_InitializeModule(void *clientdata) {
   size_t i;
   swig_module_info *module_head, *iter;
-  int found, init;
+  int init;
   
   /* check to see if the circular list has been setup, if not, set it up */
   if (swig_module.next==0) {
@@ -10618,22 +10651,18 @@ SWIG_InitializeModule(void *clientdata) {
     /* This is the first module loaded for this interpreter */
     /* so set the swig module into the interpreter */
     SWIG_SetModule(clientdata, &swig_module);
-    module_head = &swig_module;
   } else {
     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
-    found=0;
     iter=module_head;
     do {
       if (iter==&swig_module) {
-        found=1;
-        break;
+        /* Our module is already in the list, so there's nothing more to do. */
+        return;
       }
       iter=iter->next;
     } while (iter!= module_head);
     
-    /* if the is found in the list, then all is done and we may leave */
-    if (found) return;
-    /* otherwise we must add out module into the list */
+    /* otherwise we must add our module into the list */
     swig_module.next = module_head->next;
     module_head->next = &swig_module;
   }
@@ -10779,13 +10808,14 @@ SWIG_PropagateClientData(void) {
 
 
 
-#ifdef __cplusplus
+#if defined(__cplusplus) && ! defined(XSPROTO)
 extern "C"
 #endif
 
 XS(SWIG_init) {
   dXSARGS;
   int i;
+  (void)items;
   
   SWIG_InitializeModule(0);
   
diff --git a/src/mod/languages/mod_python/freeswitch.py b/src/mod/languages/mod_python/freeswitch.py
index 82a55b8342..387b6af014 100644
--- a/src/mod/languages/mod_python/freeswitch.py
+++ b/src/mod/languages/mod_python/freeswitch.py
@@ -1,5 +1,5 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 3.0.2
+# Version 3.0.10
 #
 # Do not make changes to this file unless you know what you are doing--modify
 # the SWIG interface file instead.
@@ -8,8 +8,19 @@
 
 
 
-from sys import version_info
-if version_info >= (2,6,0):
+from sys import version_info as _swig_python_version_info
+if _swig_python_version_info >= (2, 7, 0):
+    def swig_import_helper():
+        import importlib
+        pkg = __name__.rpartition('.')[0]
+        mname = '.'.join((pkg, '_freeswitch')).lstrip('.')
+        try:
+            return importlib.import_module(mname)
+        except ImportError:
+            return importlib.import_module('_freeswitch')
+    _freeswitch = swig_import_helper()
+    del swig_import_helper
+elif _swig_python_version_info >= (2, 6, 0):
     def swig_import_helper():
         from os.path import dirname
         import imp
@@ -29,73 +40,91 @@ if version_info >= (2,6,0):
     del swig_import_helper
 else:
     import _freeswitch
-del version_info
+del _swig_python_version_info
 try:
     _swig_property = property
 except NameError:
-    pass # Python < 2.2 doesn't have 'property'.
-def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
-    if (name == "thisown"): return self.this.own(value)
+    pass  # Python < 2.2 doesn't have 'property'.
+
+try:
+    import builtins as __builtin__
+except ImportError:
+    import __builtin__
+
+def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
+    if (name == "thisown"):
+        return self.this.own(value)
     if (name == "this"):
         if type(value).__name__ == 'SwigPyObject':
             self.__dict__[name] = value
             return
-    method = class_type.__swig_setmethods__.get(name,None)
-    if method: return method(self,value)
+    method = class_type.__swig_setmethods__.get(name, None)
+    if method:
+        return method(self, value)
     if (not static):
-        self.__dict__[name] = value
+        if _newclass:
+            object.__setattr__(self, name, value)
+        else:
+            self.__dict__[name] = value
     else:
         raise AttributeError("You cannot add attributes to %s" % self)
 
-def _swig_setattr(self,class_type,name,value):
-    return _swig_setattr_nondynamic(self,class_type,name,value,0)
 
-def _swig_getattr(self,class_type,name):
-    if (name == "thisown"): return self.this.own()
-    method = class_type.__swig_getmethods__.get(name,None)
-    if method: return method(self)
-    raise AttributeError(name)
+def _swig_setattr(self, class_type, name, value):
+    return _swig_setattr_nondynamic(self, class_type, name, value, 0)
+
+
+def _swig_getattr(self, class_type, name):
+    if (name == "thisown"):
+        return self.this.own()
+    method = class_type.__swig_getmethods__.get(name, None)
+    if method:
+        return method(self)
+    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
+
 
 def _swig_repr(self):
-    try: strthis = "proxy of " + self.this.__repr__()
-    except: strthis = ""
+    try:
+        strthis = "proxy of " + self.this.__repr__()
+    except __builtin__.Exception:
+        strthis = ""
     return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
 
 try:
     _object = object
     _newclass = 1
-except AttributeError:
-    class _object : pass
+except __builtin__.Exception:
+    class _object:
+        pass
     _newclass = 0
 
 
-
-def setGlobalVariable(*args):
-  return _freeswitch.setGlobalVariable(*args)
+def setGlobalVariable(var_name, var_val):
+    return _freeswitch.setGlobalVariable(var_name, var_val)
 setGlobalVariable = _freeswitch.setGlobalVariable
 
-def getGlobalVariable(*args):
-  return _freeswitch.getGlobalVariable(*args)
+def getGlobalVariable(var_name):
+    return _freeswitch.getGlobalVariable(var_name)
 getGlobalVariable = _freeswitch.getGlobalVariable
 
-def consoleLog(*args):
-  return _freeswitch.consoleLog(*args)
+def consoleLog(level_str, msg):
+    return _freeswitch.consoleLog(level_str, msg)
 consoleLog = _freeswitch.consoleLog
 
-def consoleLog2(*args):
-  return _freeswitch.consoleLog2(*args)
+def consoleLog2(level_str, file, func, line, msg):
+    return _freeswitch.consoleLog2(level_str, file, func, line, msg)
 consoleLog2 = _freeswitch.consoleLog2
 
-def consoleCleanLog(*args):
-  return _freeswitch.consoleCleanLog(*args)
+def consoleCleanLog(msg):
+    return _freeswitch.consoleCleanLog(msg)
 consoleCleanLog = _freeswitch.consoleCleanLog
 
 def running():
-  return _freeswitch.running()
+    return _freeswitch.running()
 running = _freeswitch.running
 
-def email(*args):
-  return _freeswitch.email(*args)
+def email(to, arg2, headers=None, body=None, file=None, convert_cmd=None, convert_ext=None):
+    return _freeswitch.email(to, arg2, headers, body, file, convert_cmd, convert_ext)
 email = _freeswitch.email
 class IVRMenu(_object):
     __swig_setmethods__ = {}
@@ -103,14 +132,21 @@ class IVRMenu(_object):
     __swig_getmethods__ = {}
     __getattr__ = lambda self, name: _swig_getattr(self, IVRMenu, name)
     __repr__ = _swig_repr
-    def __init__(self, *args): 
-        this = _freeswitch.new_IVRMenu(*args)
-        try: self.this.append(this)
-        except: self.this = this
+
+    def __init__(self, main, name, greeting_sound, short_greeting_sound, invalid_sound, exit_sound, transfer_sound, confirm_macro, confirm_key, tts_engine, tts_voice, confirm_attempts, inter_timeout, digit_len, timeout, max_failures, max_timeouts):
+        this = _freeswitch.new_IVRMenu(main, name, greeting_sound, short_greeting_sound, invalid_sound, exit_sound, transfer_sound, confirm_macro, confirm_key, tts_engine, tts_voice, confirm_attempts, inter_timeout, digit_len, timeout, max_failures, max_timeouts)
+        try:
+            self.this.append(this)
+        except __builtin__.Exception:
+            self.this = this
     __swig_destroy__ = _freeswitch.delete_IVRMenu
-    __del__ = lambda self : None;
-    def bindAction(self, *args): return _freeswitch.IVRMenu_bindAction(self, *args)
-    def execute(self, *args): return _freeswitch.IVRMenu_execute(self, *args)
+    __del__ = lambda self: None
+
+    def bindAction(self, action, arg, bind):
+        return _freeswitch.IVRMenu_bindAction(self, action, arg, bind)
+
+    def execute(self, session, name):
+        return _freeswitch.IVRMenu_execute(self, session, name)
 IVRMenu_swigregister = _freeswitch.IVRMenu_swigregister
 IVRMenu_swigregister(IVRMenu)
 
@@ -120,15 +156,24 @@ class API(_object):
     __swig_getmethods__ = {}
     __getattr__ = lambda self, name: _swig_getattr(self, API, name)
     __repr__ = _swig_repr
-    def __init__(self, s=None): 
+
+    def __init__(self, s=None):
         this = _freeswitch.new_API(s)
-        try: self.this.append(this)
-        except: self.this = this
+        try:
+            self.this.append(this)
+        except __builtin__.Exception:
+            self.this = this
     __swig_destroy__ = _freeswitch.delete_API
-    __del__ = lambda self : None;
-    def execute(self, *args): return _freeswitch.API_execute(self, *args)
-    def executeString(self, *args): return _freeswitch.API_executeString(self, *args)
-    def getTime(self): return _freeswitch.API_getTime(self)
+    __del__ = lambda self: None
+
+    def execute(self, command, data=None):
+        return _freeswitch.API_execute(self, command, data)
+
+    def executeString(self, command):
+        return _freeswitch.API_executeString(self, command)
+
+    def getTime(self):
+        return _freeswitch.API_getTime(self)
 API_swigregister = _freeswitch.API_swigregister
 API_swigregister(API)
 
@@ -140,22 +185,29 @@ class input_callback_state_t(_object):
     __repr__ = _swig_repr
     __swig_setmethods__["function"] = _freeswitch.input_callback_state_t_function_set
     __swig_getmethods__["function"] = _freeswitch.input_callback_state_t_function_get
-    if _newclass:function = _swig_property(_freeswitch.input_callback_state_t_function_get, _freeswitch.input_callback_state_t_function_set)
+    if _newclass:
+        function = _swig_property(_freeswitch.input_callback_state_t_function_get, _freeswitch.input_callback_state_t_function_set)
     __swig_setmethods__["threadState"] = _freeswitch.input_callback_state_t_threadState_set
     __swig_getmethods__["threadState"] = _freeswitch.input_callback_state_t_threadState_get
-    if _newclass:threadState = _swig_property(_freeswitch.input_callback_state_t_threadState_get, _freeswitch.input_callback_state_t_threadState_set)
+    if _newclass:
+        threadState = _swig_property(_freeswitch.input_callback_state_t_threadState_get, _freeswitch.input_callback_state_t_threadState_set)
     __swig_setmethods__["extra"] = _freeswitch.input_callback_state_t_extra_set
     __swig_getmethods__["extra"] = _freeswitch.input_callback_state_t_extra_get
-    if _newclass:extra = _swig_property(_freeswitch.input_callback_state_t_extra_get, _freeswitch.input_callback_state_t_extra_set)
+    if _newclass:
+        extra = _swig_property(_freeswitch.input_callback_state_t_extra_get, _freeswitch.input_callback_state_t_extra_set)
     __swig_setmethods__["funcargs"] = _freeswitch.input_callback_state_t_funcargs_set
     __swig_getmethods__["funcargs"] = _freeswitch.input_callback_state_t_funcargs_get
-    if _newclass:funcargs = _swig_property(_freeswitch.input_callback_state_t_funcargs_get, _freeswitch.input_callback_state_t_funcargs_set)
-    def __init__(self): 
+    if _newclass:
+        funcargs = _swig_property(_freeswitch.input_callback_state_t_funcargs_get, _freeswitch.input_callback_state_t_funcargs_set)
+
+    def __init__(self):
         this = _freeswitch.new_input_callback_state_t()
-        try: self.this.append(this)
-        except: self.this = this
+        try:
+            self.this.append(this)
+        except __builtin__.Exception:
+            self.this = this
     __swig_destroy__ = _freeswitch.delete_input_callback_state_t
-    __del__ = lambda self : None;
+    __del__ = lambda self: None
 input_callback_state_t_swigregister = _freeswitch.input_callback_state_t_swigregister
 input_callback_state_t_swigregister(input_callback_state_t)
 
@@ -170,16 +222,21 @@ class DTMF(_object):
     __repr__ = _swig_repr
     __swig_setmethods__["digit"] = _freeswitch.DTMF_digit_set
     __swig_getmethods__["digit"] = _freeswitch.DTMF_digit_get
-    if _newclass:digit = _swig_property(_freeswitch.DTMF_digit_get, _freeswitch.DTMF_digit_set)
+    if _newclass:
+        digit = _swig_property(_freeswitch.DTMF_digit_get, _freeswitch.DTMF_digit_set)
     __swig_setmethods__["duration"] = _freeswitch.DTMF_duration_set
     __swig_getmethods__["duration"] = _freeswitch.DTMF_duration_get
-    if _newclass:duration = _swig_property(_freeswitch.DTMF_duration_get, _freeswitch.DTMF_duration_set)
-    def __init__(self, *args): 
+    if _newclass:
+        duration = _swig_property(_freeswitch.DTMF_duration_get, _freeswitch.DTMF_duration_set)
+
+    def __init__(self, *args):
         this = _freeswitch.new_DTMF(*args)
-        try: self.this.append(this)
-        except: self.this = this
+        try:
+            self.this.append(this)
+        except __builtin__.Exception:
+            self.this = this
     __swig_destroy__ = _freeswitch.delete_DTMF
-    __del__ = lambda self : None;
+    __del__ = lambda self: None
 DTMF_swigregister = _freeswitch.DTMF_swigregister
 DTMF_swigregister(DTMF)
 
@@ -189,16 +246,27 @@ class Stream(_object):
     __swig_getmethods__ = {}
     __getattr__ = lambda self, name: _swig_getattr(self, Stream, name)
     __repr__ = _swig_repr
-    def __init__(self, *args): 
+
+    def __init__(self, *args):
         this = _freeswitch.new_Stream(*args)
-        try: self.this.append(this)
-        except: self.this = this
+        try:
+            self.this.append(this)
+        except __builtin__.Exception:
+            self.this = this
     __swig_destroy__ = _freeswitch.delete_Stream
-    __del__ = lambda self : None;
-    def read(self, *args): return _freeswitch.Stream_read(self, *args)
-    def write(self, *args): return _freeswitch.Stream_write(self, *args)
-    def raw_write(self, *args): return _freeswitch.Stream_raw_write(self, *args)
-    def get_data(self): return _freeswitch.Stream_get_data(self)
+    __del__ = lambda self: None
+
+    def read(self, len):
+        return _freeswitch.Stream_read(self, len)
+
+    def write(self, data):
+        return _freeswitch.Stream_write(self, data)
+
+    def raw_write(self, data, len):
+        return _freeswitch.Stream_raw_write(self, data, len)
+
+    def get_data(self):
+        return _freeswitch.Stream_get_data(self)
 Stream_swigregister = _freeswitch.Stream_swigregister
 Stream_swigregister(Stream)
 
@@ -210,30 +278,58 @@ class Event(_object):
     __repr__ = _swig_repr
     __swig_setmethods__["event"] = _freeswitch.Event_event_set
     __swig_getmethods__["event"] = _freeswitch.Event_event_get
-    if _newclass:event = _swig_property(_freeswitch.Event_event_get, _freeswitch.Event_event_set)
+    if _newclass:
+        event = _swig_property(_freeswitch.Event_event_get, _freeswitch.Event_event_set)
     __swig_setmethods__["serialized_string"] = _freeswitch.Event_serialized_string_set
     __swig_getmethods__["serialized_string"] = _freeswitch.Event_serialized_string_get
-    if _newclass:serialized_string = _swig_property(_freeswitch.Event_serialized_string_get, _freeswitch.Event_serialized_string_set)
+    if _newclass:
+        serialized_string = _swig_property(_freeswitch.Event_serialized_string_get, _freeswitch.Event_serialized_string_set)
     __swig_setmethods__["mine"] = _freeswitch.Event_mine_set
     __swig_getmethods__["mine"] = _freeswitch.Event_mine_get
-    if _newclass:mine = _swig_property(_freeswitch.Event_mine_get, _freeswitch.Event_mine_set)
-    def __init__(self, *args): 
+    if _newclass:
+        mine = _swig_property(_freeswitch.Event_mine_get, _freeswitch.Event_mine_set)
+
+    def __init__(self, *args):
         this = _freeswitch.new_Event(*args)
-        try: self.this.append(this)
-        except: self.this = this
+        try:
+            self.this.append(this)
+        except __builtin__.Exception:
+            self.this = this
     __swig_destroy__ = _freeswitch.delete_Event
-    __del__ = lambda self : None;
-    def chat_execute(self, *args): return _freeswitch.Event_chat_execute(self, *args)
-    def chat_send(self, dest_proto=None): return _freeswitch.Event_chat_send(self, dest_proto)
-    def serialize(self, format=None): return _freeswitch.Event_serialize(self, format)
-    def setPriority(self, *args): return _freeswitch.Event_setPriority(self, *args)
-    def getHeader(self, *args): return _freeswitch.Event_getHeader(self, *args)
-    def getBody(self): return _freeswitch.Event_getBody(self)
-    def getType(self): return _freeswitch.Event_getType(self)
-    def addBody(self, *args): return _freeswitch.Event_addBody(self, *args)
-    def addHeader(self, *args): return _freeswitch.Event_addHeader(self, *args)
-    def delHeader(self, *args): return _freeswitch.Event_delHeader(self, *args)
-    def fire(self): return _freeswitch.Event_fire(self)
+    __del__ = lambda self: None
+
+    def chat_execute(self, app, data=None):
+        return _freeswitch.Event_chat_execute(self, app, data)
+
+    def chat_send(self, dest_proto=None):
+        return _freeswitch.Event_chat_send(self, dest_proto)
+
+    def serialize(self, format=None):
+        return _freeswitch.Event_serialize(self, format)
+
+    def setPriority(self, *args):
+        return _freeswitch.Event_setPriority(self, *args)
+
+    def getHeader(self, header_name):
+        return _freeswitch.Event_getHeader(self, header_name)
+
+    def getBody(self):
+        return _freeswitch.Event_getBody(self)
+
+    def getType(self):
+        return _freeswitch.Event_getType(self)
+
+    def addBody(self, value):
+        return _freeswitch.Event_addBody(self, value)
+
+    def addHeader(self, header_name, value):
+        return _freeswitch.Event_addHeader(self, header_name, value)
+
+    def delHeader(self, header_name):
+        return _freeswitch.Event_delHeader(self, header_name)
+
+    def fire(self):
+        return _freeswitch.Event_fire(self)
 Event_swigregister = _freeswitch.Event_swigregister
 Event_swigregister(Event)
 
@@ -245,34 +341,50 @@ class EventConsumer(_object):
     __repr__ = _swig_repr
     __swig_setmethods__["events"] = _freeswitch.EventConsumer_events_set
     __swig_getmethods__["events"] = _freeswitch.EventConsumer_events_get
-    if _newclass:events = _swig_property(_freeswitch.EventConsumer_events_get, _freeswitch.EventConsumer_events_set)
+    if _newclass:
+        events = _swig_property(_freeswitch.EventConsumer_events_get, _freeswitch.EventConsumer_events_set)
     __swig_setmethods__["e_event_id"] = _freeswitch.EventConsumer_e_event_id_set
     __swig_getmethods__["e_event_id"] = _freeswitch.EventConsumer_e_event_id_get
-    if _newclass:e_event_id = _swig_property(_freeswitch.EventConsumer_e_event_id_get, _freeswitch.EventConsumer_e_event_id_set)
+    if _newclass:
+        e_event_id = _swig_property(_freeswitch.EventConsumer_e_event_id_get, _freeswitch.EventConsumer_e_event_id_set)
     __swig_setmethods__["e_callback"] = _freeswitch.EventConsumer_e_callback_set
     __swig_getmethods__["e_callback"] = _freeswitch.EventConsumer_e_callback_get
-    if _newclass:e_callback = _swig_property(_freeswitch.EventConsumer_e_callback_get, _freeswitch.EventConsumer_e_callback_set)
+    if _newclass:
+        e_callback = _swig_property(_freeswitch.EventConsumer_e_callback_get, _freeswitch.EventConsumer_e_callback_set)
     __swig_setmethods__["e_subclass_name"] = _freeswitch.EventConsumer_e_subclass_name_set
     __swig_getmethods__["e_subclass_name"] = _freeswitch.EventConsumer_e_subclass_name_get
-    if _newclass:e_subclass_name = _swig_property(_freeswitch.EventConsumer_e_subclass_name_get, _freeswitch.EventConsumer_e_subclass_name_set)
+    if _newclass:
+        e_subclass_name = _swig_property(_freeswitch.EventConsumer_e_subclass_name_get, _freeswitch.EventConsumer_e_subclass_name_set)
     __swig_setmethods__["e_cb_arg"] = _freeswitch.EventConsumer_e_cb_arg_set
     __swig_getmethods__["e_cb_arg"] = _freeswitch.EventConsumer_e_cb_arg_get
-    if _newclass:e_cb_arg = _swig_property(_freeswitch.EventConsumer_e_cb_arg_get, _freeswitch.EventConsumer_e_cb_arg_set)
+    if _newclass:
+        e_cb_arg = _swig_property(_freeswitch.EventConsumer_e_cb_arg_get, _freeswitch.EventConsumer_e_cb_arg_set)
     __swig_setmethods__["enodes"] = _freeswitch.EventConsumer_enodes_set
     __swig_getmethods__["enodes"] = _freeswitch.EventConsumer_enodes_get
-    if _newclass:enodes = _swig_property(_freeswitch.EventConsumer_enodes_get, _freeswitch.EventConsumer_enodes_set)
+    if _newclass:
+        enodes = _swig_property(_freeswitch.EventConsumer_enodes_get, _freeswitch.EventConsumer_enodes_set)
     __swig_setmethods__["node_index"] = _freeswitch.EventConsumer_node_index_set
     __swig_getmethods__["node_index"] = _freeswitch.EventConsumer_node_index_get
-    if _newclass:node_index = _swig_property(_freeswitch.EventConsumer_node_index_get, _freeswitch.EventConsumer_node_index_set)
-    def __init__(self, event_name=None, subclass_name="", len=5000): 
-        this = _freeswitch.new_EventConsumer(event_name, subclass_name, len)
-        try: self.this.append(this)
-        except: self.this = this
+    if _newclass:
+        node_index = _swig_property(_freeswitch.EventConsumer_node_index_get, _freeswitch.EventConsumer_node_index_set)
+
+    def __init__(self, *args):
+        this = _freeswitch.new_EventConsumer(*args)
+        try:
+            self.this.append(this)
+        except __builtin__.Exception:
+            self.this = this
     __swig_destroy__ = _freeswitch.delete_EventConsumer
-    __del__ = lambda self : None;
-    def bind(self, *args): return _freeswitch.EventConsumer_bind(self, *args)
-    def pop(self, block=0, timeout=0): return _freeswitch.EventConsumer_pop(self, block, timeout)
-    def cleanup(self): return _freeswitch.EventConsumer_cleanup(self)
+    __del__ = lambda self: None
+
+    def bind(self, *args):
+        return _freeswitch.EventConsumer_bind(self, *args)
+
+    def pop(self, block=0, timeout=0):
+        return _freeswitch.EventConsumer_pop(self, block, timeout)
+
+    def cleanup(self):
+        return _freeswitch.EventConsumer_cleanup(self)
 EventConsumer_swigregister = _freeswitch.EventConsumer_swigregister
 EventConsumer_swigregister(EventConsumer)
 
@@ -281,158 +393,301 @@ class CoreSession(_object):
     __setattr__ = lambda self, name, value: _swig_setattr(self, CoreSession, name, value)
     __swig_getmethods__ = {}
     __getattr__ = lambda self, name: _swig_getattr(self, CoreSession, name)
-    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
+
+    def __init__(self, *args, **kwargs):
+        raise AttributeError("No constructor defined - class is abstract")
     __repr__ = _swig_repr
     __swig_destroy__ = _freeswitch.delete_CoreSession
-    __del__ = lambda self : None;
+    __del__ = lambda self: None
     __swig_setmethods__["session"] = _freeswitch.CoreSession_session_set
     __swig_getmethods__["session"] = _freeswitch.CoreSession_session_get
-    if _newclass:session = _swig_property(_freeswitch.CoreSession_session_get, _freeswitch.CoreSession_session_set)
+    if _newclass:
+        session = _swig_property(_freeswitch.CoreSession_session_get, _freeswitch.CoreSession_session_set)
     __swig_setmethods__["channel"] = _freeswitch.CoreSession_channel_set
     __swig_getmethods__["channel"] = _freeswitch.CoreSession_channel_get
-    if _newclass:channel = _swig_property(_freeswitch.CoreSession_channel_get, _freeswitch.CoreSession_channel_set)
+    if _newclass:
+        channel = _swig_property(_freeswitch.CoreSession_channel_get, _freeswitch.CoreSession_channel_set)
     __swig_setmethods__["flags"] = _freeswitch.CoreSession_flags_set
     __swig_getmethods__["flags"] = _freeswitch.CoreSession_flags_get
-    if _newclass:flags = _swig_property(_freeswitch.CoreSession_flags_get, _freeswitch.CoreSession_flags_set)
+    if _newclass:
+        flags = _swig_property(_freeswitch.CoreSession_flags_get, _freeswitch.CoreSession_flags_set)
     __swig_setmethods__["allocated"] = _freeswitch.CoreSession_allocated_set
     __swig_getmethods__["allocated"] = _freeswitch.CoreSession_allocated_get
-    if _newclass:allocated = _swig_property(_freeswitch.CoreSession_allocated_get, _freeswitch.CoreSession_allocated_set)
+    if _newclass:
+        allocated = _swig_property(_freeswitch.CoreSession_allocated_get, _freeswitch.CoreSession_allocated_set)
     __swig_setmethods__["cb_state"] = _freeswitch.CoreSession_cb_state_set
     __swig_getmethods__["cb_state"] = _freeswitch.CoreSession_cb_state_get
-    if _newclass:cb_state = _swig_property(_freeswitch.CoreSession_cb_state_get, _freeswitch.CoreSession_cb_state_set)
+    if _newclass:
+        cb_state = _swig_property(_freeswitch.CoreSession_cb_state_get, _freeswitch.CoreSession_cb_state_set)
     __swig_setmethods__["hook_state"] = _freeswitch.CoreSession_hook_state_set
     __swig_getmethods__["hook_state"] = _freeswitch.CoreSession_hook_state_get
-    if _newclass:hook_state = _swig_property(_freeswitch.CoreSession_hook_state_get, _freeswitch.CoreSession_hook_state_set)
+    if _newclass:
+        hook_state = _swig_property(_freeswitch.CoreSession_hook_state_get, _freeswitch.CoreSession_hook_state_set)
     __swig_setmethods__["cause"] = _freeswitch.CoreSession_cause_set
     __swig_getmethods__["cause"] = _freeswitch.CoreSession_cause_get
-    if _newclass:cause = _swig_property(_freeswitch.CoreSession_cause_get, _freeswitch.CoreSession_cause_set)
+    if _newclass:
+        cause = _swig_property(_freeswitch.CoreSession_cause_get, _freeswitch.CoreSession_cause_set)
     __swig_setmethods__["uuid"] = _freeswitch.CoreSession_uuid_set
     __swig_getmethods__["uuid"] = _freeswitch.CoreSession_uuid_get
-    if _newclass:uuid = _swig_property(_freeswitch.CoreSession_uuid_get, _freeswitch.CoreSession_uuid_set)
+    if _newclass:
+        uuid = _swig_property(_freeswitch.CoreSession_uuid_get, _freeswitch.CoreSession_uuid_set)
     __swig_setmethods__["tts_name"] = _freeswitch.CoreSession_tts_name_set
     __swig_getmethods__["tts_name"] = _freeswitch.CoreSession_tts_name_get
-    if _newclass:tts_name = _swig_property(_freeswitch.CoreSession_tts_name_get, _freeswitch.CoreSession_tts_name_set)
+    if _newclass:
+        tts_name = _swig_property(_freeswitch.CoreSession_tts_name_get, _freeswitch.CoreSession_tts_name_set)
     __swig_setmethods__["voice_name"] = _freeswitch.CoreSession_voice_name_set
     __swig_getmethods__["voice_name"] = _freeswitch.CoreSession_voice_name_get
-    if _newclass:voice_name = _swig_property(_freeswitch.CoreSession_voice_name_get, _freeswitch.CoreSession_voice_name_set)
-    def insertFile(self, *args): return _freeswitch.CoreSession_insertFile(self, *args)
-    def answer(self): return _freeswitch.CoreSession_answer(self)
-    def _print(self, *args): return _freeswitch.CoreSession__print(self, *args)
-    def preAnswer(self): return _freeswitch.CoreSession_preAnswer(self)
-    def hangup(self, cause="normal_clearing"): return _freeswitch.CoreSession_hangup(self, cause)
-    def hangupState(self): return _freeswitch.CoreSession_hangupState(self)
-    def setVariable(self, *args): return _freeswitch.CoreSession_setVariable(self, *args)
-    def setPrivate(self, *args): return _freeswitch.CoreSession_setPrivate(self, *args)
-    def getPrivate(self, *args): return _freeswitch.CoreSession_getPrivate(self, *args)
-    def getVariable(self, *args): return _freeswitch.CoreSession_getVariable(self, *args)
-    def process_callback_result(self, *args): return _freeswitch.CoreSession_process_callback_result(self, *args)
-    def say(self, *args): return _freeswitch.CoreSession_say(self, *args)
-    def sayPhrase(self, *args): return _freeswitch.CoreSession_sayPhrase(self, *args)
-    def hangupCause(self): return _freeswitch.CoreSession_hangupCause(self)
-    def getState(self): return _freeswitch.CoreSession_getState(self)
-    def recordFile(self, *args): return _freeswitch.CoreSession_recordFile(self, *args)
-    def originate(self, *args): return _freeswitch.CoreSession_originate(self, *args)
-    def destroy(self): return _freeswitch.CoreSession_destroy(self)
-    def setDTMFCallback(self, *args): return _freeswitch.CoreSession_setDTMFCallback(self, *args)
-    def speak(self, *args): return _freeswitch.CoreSession_speak(self, *args)
-    def set_tts_parms(self, *args): return _freeswitch.CoreSession_set_tts_parms(self, *args)
-    def set_tts_params(self, *args): return _freeswitch.CoreSession_set_tts_params(self, *args)
-    def collectDigits(self, *args): return _freeswitch.CoreSession_collectDigits(self, *args)
-    def getDigits(self, *args): return _freeswitch.CoreSession_getDigits(self, *args)
-    def transfer(self, *args): return _freeswitch.CoreSession_transfer(self, *args)
-    def read(self, *args): return _freeswitch.CoreSession_read(self, *args)
-    def playAndGetDigits(self, *args): return _freeswitch.CoreSession_playAndGetDigits(self, *args)
-    def streamFile(self, *args): return _freeswitch.CoreSession_streamFile(self, *args)
-    def sleep(self, *args): return _freeswitch.CoreSession_sleep(self, *args)
-    def flushEvents(self): return _freeswitch.CoreSession_flushEvents(self)
-    def flushDigits(self): return _freeswitch.CoreSession_flushDigits(self)
-    def setAutoHangup(self, *args): return _freeswitch.CoreSession_setAutoHangup(self, *args)
-    def setHangupHook(self, *args): return _freeswitch.CoreSession_setHangupHook(self, *args)
-    def ready(self): return _freeswitch.CoreSession_ready(self)
-    def bridged(self): return _freeswitch.CoreSession_bridged(self)
-    def answered(self): return _freeswitch.CoreSession_answered(self)
-    def mediaReady(self): return _freeswitch.CoreSession_mediaReady(self)
-    def waitForAnswer(self, *args): return _freeswitch.CoreSession_waitForAnswer(self, *args)
-    def execute(self, *args): return _freeswitch.CoreSession_execute(self, *args)
-    def sendEvent(self, *args): return _freeswitch.CoreSession_sendEvent(self, *args)
-    def setEventData(self, *args): return _freeswitch.CoreSession_setEventData(self, *args)
-    def getXMLCDR(self): return _freeswitch.CoreSession_getXMLCDR(self)
-    def begin_allow_threads(self): return _freeswitch.CoreSession_begin_allow_threads(self)
-    def end_allow_threads(self): return _freeswitch.CoreSession_end_allow_threads(self)
-    def get_uuid(self): return _freeswitch.CoreSession_get_uuid(self)
-    def get_cb_args(self): return _freeswitch.CoreSession_get_cb_args(self)
-    def check_hangup_hook(self): return _freeswitch.CoreSession_check_hangup_hook(self)
-    def run_dtmf_callback(self, *args): return _freeswitch.CoreSession_run_dtmf_callback(self, *args)
-    def consoleLog(self, *args): return _freeswitch.CoreSession_consoleLog(self, *args)
-    def consoleLog2(self, *args): return _freeswitch.CoreSession_consoleLog2(self, *args)
+    if _newclass:
+        voice_name = _swig_property(_freeswitch.CoreSession_voice_name_get, _freeswitch.CoreSession_voice_name_set)
+
+    def insertFile(self, file, insert_file, sample_point):
+        return _freeswitch.CoreSession_insertFile(self, file, insert_file, sample_point)
+
+    def answer(self):
+        return _freeswitch.CoreSession_answer(self)
+
+    def _print(self, txt):
+        return _freeswitch.CoreSession__print(self, txt)
+
+    def preAnswer(self):
+        return _freeswitch.CoreSession_preAnswer(self)
+
+    def hangup(self, *args):
+        return _freeswitch.CoreSession_hangup(self, *args)
+
+    def hangupState(self):
+        return _freeswitch.CoreSession_hangupState(self)
+
+    def setVariable(self, var, val):
+        return _freeswitch.CoreSession_setVariable(self, var, val)
+
+    def setPrivate(self, var, val):
+        return _freeswitch.CoreSession_setPrivate(self, var, val)
+
+    def getPrivate(self, var):
+        return _freeswitch.CoreSession_getPrivate(self, var)
+
+    def getVariable(self, var):
+        return _freeswitch.CoreSession_getVariable(self, var)
+
+    def process_callback_result(self, result):
+        return _freeswitch.CoreSession_process_callback_result(self, result)
+
+    def say(self, tosay, module_name, say_type, say_method, say_gender=None):
+        return _freeswitch.CoreSession_say(self, tosay, module_name, say_type, say_method, say_gender)
+
+    def sayPhrase(self, *args):
+        return _freeswitch.CoreSession_sayPhrase(self, *args)
+
+    def hangupCause(self):
+        return _freeswitch.CoreSession_hangupCause(self)
+
+    def getState(self):
+        return _freeswitch.CoreSession_getState(self)
+
+    def recordFile(self, file_name, time_limit=0, silence_threshold=0, silence_hits=0):
+        return _freeswitch.CoreSession_recordFile(self, file_name, time_limit, silence_threshold, silence_hits)
+
+    def originate(self, a_leg_session, dest, timeout=60, handlers=None):
+        return _freeswitch.CoreSession_originate(self, a_leg_session, dest, timeout, handlers)
+
+    def destroy(self):
+        return _freeswitch.CoreSession_destroy(self)
+
+    def setDTMFCallback(self, cbfunc, funcargs):
+        return _freeswitch.CoreSession_setDTMFCallback(self, cbfunc, funcargs)
+
+    def speak(self, text):
+        return _freeswitch.CoreSession_speak(self, text)
+
+    def set_tts_parms(self, tts_name, voice_name):
+        return _freeswitch.CoreSession_set_tts_parms(self, tts_name, voice_name)
+
+    def set_tts_params(self, tts_name, voice_name):
+        return _freeswitch.CoreSession_set_tts_params(self, tts_name, voice_name)
+
+    def collectDigits(self, *args):
+        return _freeswitch.CoreSession_collectDigits(self, *args)
+
+    def getDigits(self, *args):
+        return _freeswitch.CoreSession_getDigits(self, *args)
+
+    def transfer(self, extension, dialplan=None, context=None):
+        return _freeswitch.CoreSession_transfer(self, extension, dialplan, context)
+
+    def read(self, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators, digit_timeout=0):
+        return _freeswitch.CoreSession_read(self, min_digits, max_digits, prompt_audio_file, timeout, valid_terminators, digit_timeout)
+
+    def playAndGetDigits(self, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name=None, digit_timeout=0, transfer_on_failure=None):
+        return _freeswitch.CoreSession_playAndGetDigits(self, min_digits, max_digits, max_tries, timeout, terminators, audio_files, bad_input_audio_files, digits_regex, var_name, digit_timeout, transfer_on_failure)
+
+    def streamFile(self, file, starting_sample_count=0):
+        return _freeswitch.CoreSession_streamFile(self, file, starting_sample_count)
+
+    def sleep(self, ms, sync=0):
+        return _freeswitch.CoreSession_sleep(self, ms, sync)
+
+    def flushEvents(self):
+        return _freeswitch.CoreSession_flushEvents(self)
+
+    def flushDigits(self):
+        return _freeswitch.CoreSession_flushDigits(self)
+
+    def setAutoHangup(self, val):
+        return _freeswitch.CoreSession_setAutoHangup(self, val)
+
+    def setHangupHook(self, hangup_func):
+        return _freeswitch.CoreSession_setHangupHook(self, hangup_func)
+
+    def ready(self):
+        return _freeswitch.CoreSession_ready(self)
+
+    def bridged(self):
+        return _freeswitch.CoreSession_bridged(self)
+
+    def answered(self):
+        return _freeswitch.CoreSession_answered(self)
+
+    def mediaReady(self):
+        return _freeswitch.CoreSession_mediaReady(self)
+
+    def waitForAnswer(self, calling_session):
+        return _freeswitch.CoreSession_waitForAnswer(self, calling_session)
+
+    def execute(self, app, data=None):
+        return _freeswitch.CoreSession_execute(self, app, data)
+
+    def sendEvent(self, sendME):
+        return _freeswitch.CoreSession_sendEvent(self, sendME)
+
+    def setEventData(self, e):
+        return _freeswitch.CoreSession_setEventData(self, e)
+
+    def getXMLCDR(self):
+        return _freeswitch.CoreSession_getXMLCDR(self)
+
+    def begin_allow_threads(self):
+        return _freeswitch.CoreSession_begin_allow_threads(self)
+
+    def end_allow_threads(self):
+        return _freeswitch.CoreSession_end_allow_threads(self)
+
+    def get_uuid(self):
+        return _freeswitch.CoreSession_get_uuid(self)
+
+    def get_cb_args(self):
+        return _freeswitch.CoreSession_get_cb_args(self)
+
+    def check_hangup_hook(self):
+        return _freeswitch.CoreSession_check_hangup_hook(self)
+
+    def run_dtmf_callback(self, input, itype):
+        return _freeswitch.CoreSession_run_dtmf_callback(self, input, itype)
+
+    def consoleLog(self, level_str, msg):
+        return _freeswitch.CoreSession_consoleLog(self, level_str, msg)
+
+    def consoleLog2(self, level_str, file, func, line, msg):
+        return _freeswitch.CoreSession_consoleLog2(self, level_str, file, func, line, msg)
 CoreSession_swigregister = _freeswitch.CoreSession_swigregister
 CoreSession_swigregister(CoreSession)
 
 
-def console_log(*args):
-  return _freeswitch.console_log(*args)
+def console_log(level_str, msg):
+    return _freeswitch.console_log(level_str, msg)
 console_log = _freeswitch.console_log
 
-def console_log2(*args):
-  return _freeswitch.console_log2(*args)
+def console_log2(level_str, file, func, line, msg):
+    return _freeswitch.console_log2(level_str, file, func, line, msg)
 console_log2 = _freeswitch.console_log2
 
-def console_clean_log(*args):
-  return _freeswitch.console_clean_log(*args)
+def console_clean_log(msg):
+    return _freeswitch.console_clean_log(msg)
 console_clean_log = _freeswitch.console_clean_log
 
-def msleep(*args):
-  return _freeswitch.msleep(*args)
+def msleep(ms):
+    return _freeswitch.msleep(ms)
 msleep = _freeswitch.msleep
 
-def bridge(*args):
-  return _freeswitch.bridge(*args)
+def bridge(session_a, session_b):
+    return _freeswitch.bridge(session_a, session_b)
 bridge = _freeswitch.bridge
 
-def hanguphook(*args):
-  return _freeswitch.hanguphook(*args)
+def hanguphook(session):
+    return _freeswitch.hanguphook(session)
 hanguphook = _freeswitch.hanguphook
 
-def dtmf_callback(*args):
-  return _freeswitch.dtmf_callback(*args)
+def dtmf_callback(session, input, itype, buf, buflen):
+    return _freeswitch.dtmf_callback(session, input, itype, buf, buflen)
 dtmf_callback = _freeswitch.dtmf_callback
 class Session(CoreSession):
     __swig_setmethods__ = {}
-    for _s in [CoreSession]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
+    for _s in [CoreSession]:
+        __swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
     __setattr__ = lambda self, name, value: _swig_setattr(self, Session, name, value)
     __swig_getmethods__ = {}
-    for _s in [CoreSession]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
+    for _s in [CoreSession]:
+        __swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
     __getattr__ = lambda self, name: _swig_getattr(self, Session, name)
     __repr__ = _swig_repr
-    def __init__(self, *args): 
+
+    def __init__(self, *args):
         this = _freeswitch.new_Session(*args)
-        try: self.this.append(this)
-        except: self.this = this
+        try:
+            self.this.append(this)
+        except __builtin__.Exception:
+            self.this = this
     __swig_destroy__ = _freeswitch.delete_Session
-    __del__ = lambda self : None;
-    def begin_allow_threads(self): return _freeswitch.Session_begin_allow_threads(self)
-    def end_allow_threads(self): return _freeswitch.Session_end_allow_threads(self)
-    def check_hangup_hook(self): return _freeswitch.Session_check_hangup_hook(self)
-    def destroy(self): return _freeswitch.Session_destroy(self)
-    def run_dtmf_callback(self, *args): return _freeswitch.Session_run_dtmf_callback(self, *args)
-    def setInputCallback(self, *args): return _freeswitch.Session_setInputCallback(self, *args)
-    def unsetInputCallback(self): return _freeswitch.Session_unsetInputCallback(self)
-    def setHangupHook(self, *args): return _freeswitch.Session_setHangupHook(self, *args)
-    def ready(self): return _freeswitch.Session_ready(self)
+    __del__ = lambda self: None
+
+    def begin_allow_threads(self):
+        return _freeswitch.Session_begin_allow_threads(self)
+
+    def end_allow_threads(self):
+        return _freeswitch.Session_end_allow_threads(self)
+
+    def check_hangup_hook(self):
+        return _freeswitch.Session_check_hangup_hook(self)
+
+    def destroy(self):
+        return _freeswitch.Session_destroy(self)
+
+    def run_dtmf_callback(self, input, itype):
+        return _freeswitch.Session_run_dtmf_callback(self, input, itype)
+
+    def setInputCallback(self, cbfunc, funcargs=None):
+        return _freeswitch.Session_setInputCallback(self, cbfunc, funcargs)
+
+    def unsetInputCallback(self):
+        return _freeswitch.Session_unsetInputCallback(self)
+
+    def setHangupHook(self, pyfunc, arg=None):
+        return _freeswitch.Session_setHangupHook(self, pyfunc, arg)
+
+    def ready(self):
+        return _freeswitch.Session_ready(self)
     __swig_setmethods__["cb_function"] = _freeswitch.Session_cb_function_set
     __swig_getmethods__["cb_function"] = _freeswitch.Session_cb_function_get
-    if _newclass:cb_function = _swig_property(_freeswitch.Session_cb_function_get, _freeswitch.Session_cb_function_set)
+    if _newclass:
+        cb_function = _swig_property(_freeswitch.Session_cb_function_get, _freeswitch.Session_cb_function_set)
     __swig_setmethods__["cb_arg"] = _freeswitch.Session_cb_arg_set
     __swig_getmethods__["cb_arg"] = _freeswitch.Session_cb_arg_get
-    if _newclass:cb_arg = _swig_property(_freeswitch.Session_cb_arg_get, _freeswitch.Session_cb_arg_set)
+    if _newclass:
+        cb_arg = _swig_property(_freeswitch.Session_cb_arg_get, _freeswitch.Session_cb_arg_set)
     __swig_setmethods__["hangup_func"] = _freeswitch.Session_hangup_func_set
     __swig_getmethods__["hangup_func"] = _freeswitch.Session_hangup_func_get
-    if _newclass:hangup_func = _swig_property(_freeswitch.Session_hangup_func_get, _freeswitch.Session_hangup_func_set)
+    if _newclass:
+        hangup_func = _swig_property(_freeswitch.Session_hangup_func_get, _freeswitch.Session_hangup_func_set)
     __swig_setmethods__["hangup_func_arg"] = _freeswitch.Session_hangup_func_arg_set
     __swig_getmethods__["hangup_func_arg"] = _freeswitch.Session_hangup_func_arg_get
-    if _newclass:hangup_func_arg = _swig_property(_freeswitch.Session_hangup_func_arg_get, _freeswitch.Session_hangup_func_arg_set)
-    def setPython(self, *args): return _freeswitch.Session_setPython(self, *args)
-    def setSelf(self, *args): return _freeswitch.Session_setSelf(self, *args)
+    if _newclass:
+        hangup_func_arg = _swig_property(_freeswitch.Session_hangup_func_arg_get, _freeswitch.Session_hangup_func_arg_set)
+
+    def setPython(self, state):
+        return _freeswitch.Session_setPython(self, state)
+
+    def setSelf(self, state):
+        return _freeswitch.Session_setSelf(self, state)
 Session_swigregister = _freeswitch.Session_swigregister
 Session_swigregister(Session)
 
diff --git a/src/mod/languages/mod_python/mod_python_wrap.cpp b/src/mod/languages/mod_python/mod_python_wrap.cpp
index b4880a1ef2..80b95e8710 100644
--- a/src/mod/languages/mod_python/mod_python_wrap.cpp
+++ b/src/mod/languages/mod_python/mod_python_wrap.cpp
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 3.0.2
+ * Version 3.0.10
  *
  * This file is not intended to be easily readable and contains a number of
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -8,7 +8,11 @@
  * interface file instead.
  * ----------------------------------------------------------------------------- */
 
+
+#ifndef SWIGPYTHON
 #define SWIGPYTHON
+#endif
+
 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
 
 
@@ -102,9 +106,11 @@ template  T SwigValueInit() {
 #endif
 
 /* exporting methods */
-#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#  ifndef GCC_HASCLASSVISIBILITY
-#    define GCC_HASCLASSVISIBILITY
+#if defined(__GNUC__)
+#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#    ifndef GCC_HASCLASSVISIBILITY
+#      define GCC_HASCLASSVISIBILITY
+#    endif
 #  endif
 #endif
 
@@ -143,6 +149,19 @@ template  T SwigValueInit() {
 # define _SCL_SECURE_NO_DEPRECATE
 #endif
 
+/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
+#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
+# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
+#endif
+
+/* Intel's compiler complains if a variable which was never initialised is
+ * cast to void, which is a common idiom which we use to indicate that we
+ * are aware a variable isn't used.  So we just silence that warning.
+ * See: https://github.com/swig/swig/issues/192 for more discussion.
+ */
+#ifdef __INTEL_COMPILER
+# pragma warning disable 592
+#endif
 
 
 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
@@ -651,16 +670,16 @@ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
     char d = *(c++);
     unsigned char uu;
     if ((d >= '0') && (d <= '9'))
-      uu = ((d - '0') << 4);
+      uu = (unsigned char)((d - '0') << 4);
     else if ((d >= 'a') && (d <= 'f'))
-      uu = ((d - ('a'-10)) << 4);
+      uu = (unsigned char)((d - ('a'-10)) << 4);
     else
       return (char *) 0;
     d = *(c++);
     if ((d >= '0') && (d <= '9'))
-      uu |= (d - '0');
+      uu |= (unsigned char)(d - '0');
     else if ((d >= 'a') && (d <= 'f'))
-      uu |= (d - ('a'-10));
+      uu |= (unsigned char)(d - ('a'-10));
     else
       return (char *) 0;
     *u = uu;
@@ -843,10 +862,6 @@ PyString_FromFormat(const char *fmt, ...) {
 }
 #endif
 
-/* Add PyObject_Del for old Pythons */
-#if PY_VERSION_HEX < 0x01060000
-# define PyObject_Del(op) PyMem_DEL((op))
-#endif
 #ifndef PyObject_DEL
 # define PyObject_DEL PyObject_Del
 #endif
@@ -1312,7 +1327,7 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
 
 /* Unpack the argument tuple */
 
-SWIGINTERN int
+SWIGINTERN Py_ssize_t
 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
 {
   if (!args) {
@@ -1326,7 +1341,7 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi
   }  
   if (!PyTuple_Check(args)) {
     if (min <= 1 && max >= 1) {
-      int i;
+      Py_ssize_t i;
       objs[0] = args;
       for (i = 1; i < max; ++i) {
 	objs[i] = 0;
@@ -1346,7 +1361,7 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi
 		   name, (min == max ? "" : "at most "), (int)max, (int)l);
       return 0;
     } else {
-      int i;
+      Py_ssize_t i;
       for (i = 0; i < l; ++i) {
 	objs[i] = PyTuple_GET_ITEM(args, i);
       }
@@ -1532,6 +1547,23 @@ typedef struct {
 #endif
 } SwigPyObject;
 
+
+#ifdef SWIGPYTHON_BUILTIN
+
+SWIGRUNTIME PyObject *
+SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
+{
+  SwigPyObject *sobj = (SwigPyObject *)v;
+
+  if (!sobj->dict)
+    sobj->dict = PyDict_New();
+
+  Py_INCREF(sobj->dict);
+  return sobj->dict;
+}
+
+#endif
+
 SWIGRUNTIME PyObject *
 SwigPyObject_long(SwigPyObject *v)
 {
@@ -1670,16 +1702,32 @@ SwigPyObject_dealloc(PyObject *v)
     if (destroy) {
       /* destroy is always a VARARGS method */
       PyObject *res;
+
+      /* PyObject_CallFunction() has the potential to silently drop
+         the active active exception.  In cases of unnamed temporary
+         variable or where we just finished iterating over a generator
+         StopIteration will be active right now, and this needs to
+         remain true upon return from SwigPyObject_dealloc.  So save
+         and restore. */
+      
+      PyObject *val = NULL, *type = NULL, *tb = NULL;
+      PyErr_Fetch(&val, &type, &tb);
+
       if (data->delargs) {
-	/* we need to create a temporary object to carry the destroy operation */
-	PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
-	res = SWIG_Python_CallFunctor(destroy, tmp);
-	Py_DECREF(tmp);
+        /* we need to create a temporary object to carry the destroy operation */
+        PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
+        res = SWIG_Python_CallFunctor(destroy, tmp);
+        Py_DECREF(tmp);
       } else {
-	PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
-	PyObject *mself = PyCFunction_GET_SELF(destroy);
-	res = ((*meth)(mself, v));
+        PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
+        PyObject *mself = PyCFunction_GET_SELF(destroy);
+        res = ((*meth)(mself, v));
       }
+      if (!res)
+        PyErr_WriteUnraisable(destroy);
+
+      PyErr_Restore(val, type, tb);
+
       Py_XDECREF(res);
     } 
 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
@@ -1703,6 +1751,7 @@ SwigPyObject_append(PyObject* v, PyObject* next)
   next = tmp;
 #endif
   if (!SwigPyObject_Check(next)) {
+    PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
     return NULL;
   }
   sobj->next = next;
@@ -1802,7 +1851,7 @@ swigobject_methods[] = {
 static PyMethodDef
 swigobject_methods[] = {
   {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
-  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"acquires ownership of the pointer"},
   {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
   {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
   {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
@@ -1858,7 +1907,9 @@ SwigPyObject_TypeOnce(void) {
     (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
     (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
 #endif
-#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
+#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
+#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
 #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
@@ -1938,10 +1989,19 @@ SwigPyObject_TypeOnce(void) {
       0,                                    /* tp_del */
 #endif
 #if PY_VERSION_HEX >= 0x02060000
-      0,                                    /* tp_version */
+      0,                                    /* tp_version_tag */
+#endif
+#if PY_VERSION_HEX >= 0x03040000
+      0,                                    /* tp_finalize */
 #endif
 #ifdef COUNT_ALLOCS
-      0,0,0,0                               /* tp_alloc -> tp_next */
+      0,                                    /* tp_allocs */
+      0,                                    /* tp_frees */
+      0,                                    /* tp_maxalloc */
+#if PY_VERSION_HEX >= 0x02050000
+      0,                                    /* tp_prev */
+#endif
+      0                                     /* tp_next */
 #endif
     };
     swigpyobject_type = tmp;
@@ -2117,10 +2177,19 @@ SwigPyPacked_TypeOnce(void) {
       0,                                    /* tp_del */
 #endif
 #if PY_VERSION_HEX >= 0x02060000
-      0,                                    /* tp_version */
+      0,                                    /* tp_version_tag */
+#endif
+#if PY_VERSION_HEX >= 0x03040000
+      0,                                    /* tp_finalize */
 #endif
 #ifdef COUNT_ALLOCS
-      0,0,0,0                               /* tp_alloc -> tp_next */
+      0,                                    /* tp_allocs */
+      0,                                    /* tp_frees */
+      0,                                    /* tp_maxalloc */
+#if PY_VERSION_HEX >= 0x02050000
+      0,                                    /* tp_prev */
+#endif
+      0                                     /* tp_next */
 #endif
     };
     swigpypacked_type = tmp;
@@ -2571,18 +2640,21 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f
 	  newobj = (SwigPyObject *) newobj->next;
         newobj->next = next_self;
         newobj = (SwigPyObject *)next_self;
+#ifdef SWIGPYTHON_BUILTIN
+        newobj->dict = 0;
+#endif
       }
     } else {
       newobj = PyObject_New(SwigPyObject, clientdata->pytype);
+#ifdef SWIGPYTHON_BUILTIN
+      newobj->dict = 0;
+#endif
     }
     if (newobj) {
       newobj->ptr = ptr;
       newobj->ty = type;
       newobj->own = own;
       newobj->next = 0;
-#ifdef SWIGPYTHON_BUILTIN
-      newobj->dict = 0;
-#endif
       return (PyObject*) newobj;
     }
     return SWIG_Py_Void();
@@ -2645,13 +2717,11 @@ PyModule_AddObject(PyObject *m, char *name, PyObject *o)
 {
   PyObject *dict;
   if (!PyModule_Check(m)) {
-    PyErr_SetString(PyExc_TypeError,
-		    "PyModule_AddObject() needs module as first arg");
+    PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg");
     return SWIG_ERROR;
   }
   if (!o) {
-    PyErr_SetString(PyExc_TypeError,
-		    "PyModule_AddObject() needs non-NULL value");
+    PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value");
     return SWIG_ERROR;
   }
   
@@ -2987,7 +3057,7 @@ static swig_module_info swig_module = {swig_types, 28, 0, 0, 0, 0};
 #endif
 #define SWIG_name    "_freeswitch"
 
-#define SWIGVERSION 0x030002 
+#define SWIGVERSION 0x030010 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -3010,27 +3080,35 @@ namespace swig {
 
     SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
     {
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
       Py_XINCREF(_obj);      
+      SWIG_PYTHON_THREAD_END_BLOCK;
     }
     
     SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
     {
       if (initial_ref) {
+        SWIG_PYTHON_THREAD_BEGIN_BLOCK;
         Py_XINCREF(_obj);
+        SWIG_PYTHON_THREAD_END_BLOCK;
       }
     }
     
     SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) 
     {
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
       Py_XINCREF(item._obj);
       Py_XDECREF(_obj);
       _obj = item._obj;
+      SWIG_PYTHON_THREAD_END_BLOCK;
       return *this;      
     }
     
     ~SwigPtr_PyObject() 
     {
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
       Py_XDECREF(_obj);
+      SWIG_PYTHON_THREAD_END_BLOCK;
     }
     
     operator PyObject *() const
@@ -3081,13 +3159,18 @@ SWIGINTERN int
 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
 {
 #if PY_VERSION_HEX>=0x03000000
+#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
+  if (PyBytes_Check(obj))
+#else
   if (PyUnicode_Check(obj))
+#endif
 #else  
   if (PyString_Check(obj))
 #endif
   {
     char *cstr; Py_ssize_t len;
 #if PY_VERSION_HEX>=0x03000000
+#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
     if (!alloc && cptr) {
         /* We can't allow converting without allocation, since the internal
            representation of string in Python 3 is UCS-2/UCS-4 but we require
@@ -3096,8 +3179,9 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
         return SWIG_RuntimeError;
     }
     obj = PyUnicode_AsUTF8String(obj);
-    PyBytes_AsStringAndSize(obj, &cstr, &len);
     if(alloc) *alloc = SWIG_NEWOBJ;
+#endif
+    PyBytes_AsStringAndSize(obj, &cstr, &len);
 #else
     PyString_AsStringAndSize(obj, &cstr, &len);
 #endif
@@ -3117,27 +3201,58 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
 #else
 	if (*alloc == SWIG_NEWOBJ) 
 #endif
-	  {
-	    *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
-	    *alloc = SWIG_NEWOBJ;
-	  }
-	else {
+	{
+	  *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
+	  *alloc = SWIG_NEWOBJ;
+	} else {
 	  *cptr = cstr;
 	  *alloc = SWIG_OLDOBJ;
 	}
       } else {
-        #if PY_VERSION_HEX>=0x03000000
-        assert(0); /* Should never reach here in Python 3 */
-        #endif
+#if PY_VERSION_HEX>=0x03000000
+#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
+	*cptr = PyBytes_AsString(obj);
+#else
+	assert(0); /* Should never reach here with Unicode strings in Python 3 */
+#endif
+#else
 	*cptr = SWIG_Python_str_AsChar(obj);
+#endif
       }
     }
     if (psize) *psize = len + 1;
-#if PY_VERSION_HEX>=0x03000000
+#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
     Py_XDECREF(obj);
 #endif
     return SWIG_OK;
   } else {
+#if defined(SWIG_PYTHON_2_UNICODE)
+#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
+#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
+#endif
+#if PY_VERSION_HEX<0x03000000
+    if (PyUnicode_Check(obj)) {
+      char *cstr; Py_ssize_t len;
+      if (!alloc && cptr) {
+        return SWIG_RuntimeError;
+      }
+      obj = PyUnicode_AsUTF8String(obj);
+      if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
+        if (cptr) {
+          if (alloc) *alloc = SWIG_NEWOBJ;
+          *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
+        }
+        if (psize) *psize = len + 1;
+
+        Py_XDECREF(obj);
+        return SWIG_OK;
+      } else {
+        Py_XDECREF(obj);
+      }
+    }
+#endif
+#endif
+
     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
     if (pchar_descriptor) {
       void* vptr = 0;
@@ -3166,13 +3281,17 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
 	SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
     } else {
 #if PY_VERSION_HEX >= 0x03000000
-#if PY_VERSION_HEX >= 0x03010000
-      return PyUnicode_DecodeUTF8(carray, static_cast< int >(size), "surrogateescape");
+#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
+      return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
 #else
-      return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
+#if PY_VERSION_HEX >= 0x03010000
+      return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape");
+#else
+      return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
+#endif
 #endif
 #else
-      return PyString_FromStringAndSize(carray, static_cast< int >(size));
+      return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
 #endif
     }
   } else {
@@ -3205,9 +3324,11 @@ SWIG_AsVal_double (PyObject *obj, double *val)
   if (PyFloat_Check(obj)) {
     if (val) *val = PyFloat_AsDouble(obj);
     return SWIG_OK;
+#if PY_VERSION_HEX < 0x03000000
   } else if (PyInt_Check(obj)) {
     if (val) *val = PyInt_AsLong(obj);
     return SWIG_OK;
+#endif
   } else if (PyLong_Check(obj)) {
     double v = PyLong_AsDouble(obj);
     if (!PyErr_Occurred()) {
@@ -3281,16 +3402,20 @@ SWIG_CanCastAsInteger(double *d, double min, double max) {
 SWIGINTERN int
 SWIG_AsVal_long (PyObject *obj, long* val)
 {
+#if PY_VERSION_HEX < 0x03000000
   if (PyInt_Check(obj)) {
     if (val) *val = PyInt_AsLong(obj);
     return SWIG_OK;
-  } else if (PyLong_Check(obj)) {
+  } else
+#endif
+  if (PyLong_Check(obj)) {
     long v = PyLong_AsLong(obj);
     if (!PyErr_Occurred()) {
       if (val) *val = v;
       return SWIG_OK;
     } else {
       PyErr_Clear();
+      return SWIG_OverflowError;
     }
   }
 #ifdef SWIG_PYTHON_CAST_MODE
@@ -3419,18 +3544,7 @@ SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
       return SWIG_OK;
     } else {
       PyErr_Clear();
-#if PY_VERSION_HEX >= 0x03000000
-      {
-        long v = PyLong_AsLong(obj);
-        if (!PyErr_Occurred()) {
-          if (v < 0) {
-            return SWIG_OverflowError;
-          }
-        } else {
-          PyErr_Clear();
-        }
-      }
-#endif
+      return SWIG_OverflowError;
     }
   }
 #ifdef SWIG_PYTHON_CAST_MODE
@@ -4755,12 +4869,14 @@ fail:
 
 
 SWIGINTERN PyObject *_wrap_new_Stream(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[2];
-  int ii;
+  Py_ssize_t argc;
+  PyObject *argv[2] = {
+    0
+  };
+  Py_ssize_t ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = args ? (int)PyObject_Length(args) : 0;
+  argc = args ? PyObject_Length(args) : 0;
   for (ii = 0; (ii < 1) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
@@ -5180,12 +5296,14 @@ fail:
 
 
 SWIGINTERN PyObject *_wrap_new_Event(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[3];
-  int ii;
+  Py_ssize_t argc;
+  PyObject *argv[3] = {
+    0
+  };
+  Py_ssize_t ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = args ? (int)PyObject_Length(args) : 0;
+  argc = args ? PyObject_Length(args) : 0;
   for (ii = 0; (ii < 2) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
@@ -7781,12 +7899,14 @@ fail:
 
 
 SWIGINTERN PyObject *_wrap_CoreSession_collectDigits(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[4];
-  int ii;
+  Py_ssize_t argc;
+  PyObject *argv[4] = {
+    0
+  };
+  Py_ssize_t ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = args ? (int)PyObject_Length(args) : 0;
+  argc = args ? PyObject_Length(args) : 0;
   for (ii = 0; (ii < 3) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
@@ -8020,12 +8140,14 @@ fail:
 
 
 SWIGINTERN PyObject *_wrap_CoreSession_getDigits(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[7];
-  int ii;
+  Py_ssize_t argc;
+  PyObject *argv[7] = {
+    0
+  };
+  Py_ssize_t ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = args ? (int)PyObject_Length(args) : 0;
+  argc = args ? PyObject_Length(args) : 0;
   for (ii = 0; (ii < 6) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
@@ -9511,12 +9633,14 @@ fail:
 
 
 SWIGINTERN PyObject *_wrap_new_Session(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[3];
-  int ii;
+  Py_ssize_t argc;
+  PyObject *argv[3] = {
+    0
+  };
+  Py_ssize_t ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = args ? (int)PyObject_Length(args) : 0;
+  argc = args ? PyObject_Length(args) : 0;
   for (ii = 0; (ii < 2) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
@@ -9770,12 +9894,14 @@ fail:
 
 
 SWIGINTERN PyObject *_wrap_Session_setInputCallback(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[4];
-  int ii;
+  Py_ssize_t argc;
+  PyObject *argv[4] = {
+    0
+  };
+  Py_ssize_t ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = args ? (int)PyObject_Length(args) : 0;
+  argc = args ? PyObject_Length(args) : 0;
   for (ii = 0; (ii < 3) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
@@ -9889,12 +10015,14 @@ fail:
 
 
 SWIGINTERN PyObject *_wrap_Session_setHangupHook(PyObject *self, PyObject *args) {
-  int argc;
-  PyObject *argv[4];
-  int ii;
+  Py_ssize_t argc;
+  PyObject *argv[4] = {
+    0
+  };
+  Py_ssize_t ii;
   
   if (!PyTuple_Check(args)) SWIG_fail;
-  argc = args ? (int)PyObject_Length(args) : 0;
+  argc = args ? PyObject_Length(args) : 0;
   for (ii = 0; (ii < 3) && (ii < argc); ii++) {
     argv[ii] = PyTuple_GET_ITEM(args,ii);
   }
@@ -10577,7 +10705,7 @@ SWIGRUNTIME void
 SWIG_InitializeModule(void *clientdata) {
   size_t i;
   swig_module_info *module_head, *iter;
-  int found, init;
+  int init;
   
   /* check to see if the circular list has been setup, if not, set it up */
   if (swig_module.next==0) {
@@ -10596,22 +10724,18 @@ SWIG_InitializeModule(void *clientdata) {
     /* This is the first module loaded for this interpreter */
     /* so set the swig module into the interpreter */
     SWIG_SetModule(clientdata, &swig_module);
-    module_head = &swig_module;
   } else {
     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
-    found=0;
     iter=module_head;
     do {
       if (iter==&swig_module) {
-        found=1;
-        break;
+        /* Our module is already in the list, so there's nothing more to do. */
+        return;
       }
       iter=iter->next;
     } while (iter!= module_head);
     
-    /* if the is found in the list, then all is done and we may leave */
-    if (found) return;
-    /* otherwise we must add out module into the list */
+    /* otherwise we must add our module into the list */
     swig_module.next = module_head->next;
     module_head->next = &swig_module;
   }
@@ -10930,10 +11054,19 @@ extern "C" {
         0,                                  /* tp_del */
 #endif
 #if PY_VERSION_HEX >= 0x02060000
-        0,                                  /* tp_version */
+        0,                                  /* tp_version_tag */
+#endif
+#if PY_VERSION_HEX >= 0x03040000
+        0,                                  /* tp_finalize */
 #endif
 #ifdef COUNT_ALLOCS
-        0,0,0,0                             /* tp_alloc -> tp_next */
+        0,                                  /* tp_allocs */
+        0,                                  /* tp_frees */
+        0,                                  /* tp_maxalloc */
+#if PY_VERSION_HEX >= 0x02050000
+        0,                                  /* tp_prev */
+#endif
+        0                                   /* tp_next */
 #endif
       };
       varlink_type = tmp;
@@ -11022,7 +11155,9 @@ extern "C" {
     size_t i;
     for (i = 0; methods[i].ml_name; ++i) {
       const char *c = methods[i].ml_doc;
-      if (c && (c = strstr(c, "swig_ptr: "))) {
+      if (!c) continue;
+      c = strstr(c, "swig_ptr: ");
+      if (c) {
         int j;
         swig_const_info *ci = 0;
         const char *name = c + 10;
@@ -11124,6 +11259,7 @@ SWIG_init(void) {
   PyObject *public_interface, *public_symbol;
   PyObject *this_descr;
   PyObject *thisown_descr;
+  PyObject *self = 0;
   int i;
   
   (void)builtin_pytype;
@@ -11131,6 +11267,7 @@ SWIG_init(void) {
   (void)builtin_basetype;
   (void)tuple;
   (void)static_getset;
+  (void)self;
   
   /* metatype is used to implement static member variables. */
   metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
@@ -11150,6 +11287,7 @@ SWIG_init(void) {
 #else
   m = Py_InitModule((char *) SWIG_name, SwigMethods);
 #endif
+  
   md = d = PyModule_GetDict(m);
   (void)md;
   

From e66de38ba23ad42d7e7da906e2eb56344d905b21 Mon Sep 17 00:00:00 2001
From: Piotr Gregor 
Date: Thu, 21 Jun 2018 16:48:51 +0100
Subject: [PATCH 229/264] FS-11201 Filter out erroneous RTT values #fix

Erroneous DLSR in received RTCP report could
cause RTT to be negative (RTT = A - DLSR - LSR).
Add check for this and prevent corruption
of statistics and estimations (estimator code used
bad RTT values).
---
 src/switch_rtp.c | 62 +++++++++++++++++++++++++++++++++++-------------
 1 file changed, 45 insertions(+), 17 deletions(-)

diff --git a/src/switch_rtp.c b/src/switch_rtp.c
index d7f72204c1..2081daba52 100644
--- a/src/switch_rtp.c
+++ b/src/switch_rtp.c
@@ -6502,6 +6502,7 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
 			uint32_t lsr;
 			uint32_t packet_ssrc;
 			double rtt_now = 0;
+			uint8_t rtt_valid = 0;
 			int rtt_increase = 0, packet_loss_increase=0;
 
 			//if (msg->header.type == _RTCP_PT_SR && rtp_session->ice.ice_user) {
@@ -6511,7 +6512,7 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
 			now = switch_micro_time_now();  /* number of microseconds since 00:00:00 january 1, 1970 UTC */
 			sec = (uint32_t)(now/1000000);              /* converted to second (NTP most significant bits) */
 			ntp_sec = sec+NTP_TIME_OFFSET;  /* 32bits most significant */
-			ntp_usec = (uint32_t)(now - (sec*1000000)); /* micro seconds */
+			ntp_usec = (uint32_t)(now - (((switch_time_t) sec) * 1000000)); /* micro seconds */
 			lsr_now = (uint32_t)(ntp_usec*0.065536) | (ntp_sec&0x0000ffff)<<16; // 0.065536 is used for convertion from useconds
 
 			if (msg->header.type == _RTCP_PT_SR) { /* Sender report */
@@ -6589,23 +6590,47 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
 				rtp_session->rtcp_frame.reports[i].jitter = ntohl(report->jitter);
 				rtp_session->rtcp_frame.reports[i].lsr = ntohl(report->lsr);
 				rtp_session->rtcp_frame.reports[i].dlsr = ntohl(report->dlsr);
+				
 				if (rtp_session->rtcp_frame.reports[i].lsr && !rtp_session->flags[SWITCH_RTP_FLAG_RTCP_PASSTHRU]) {
+
 					switch_time_exp_gmt(&now_hr,now);
+						
 					/* Calculating RTT = A - DLSR - LSR */
 					rtt_now = (double)(lsr_now - rtp_session->rtcp_frame.reports[i].dlsr - rtp_session->rtcp_frame.reports[i].lsr)/65536;
-					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG3,
-									  "Receiving an RTCP packet\n[%04d-%02d-%02d %02d:%02d:%02d.%d] SSRC[0x%x]\n"
-									  "RTT[%f] = A[%u] - DLSR[%u] - LSR[%u]\n",
-									  1900 + now_hr.tm_year, now_hr.tm_mday, now_hr.tm_mon, now_hr.tm_hour, now_hr.tm_min, now_hr.tm_sec, now_hr.tm_usec,
-									  rtp_session->rtcp_frame.reports[i].ssrc, rtt_now,
-									  lsr_now, rtp_session->rtcp_frame.reports[i].dlsr, rtp_session->rtcp_frame.reports[i].lsr);
-					if (!rtp_session->rtcp_frame.reports[i].rtt_avg) {
-						rtp_session->rtcp_frame.reports[i].rtt_avg = rtt_now;
+
+					/* Only account RTT if it didn't overflow. */
+					if (lsr_now > rtp_session->rtcp_frame.reports[i].dlsr + rtp_session->rtcp_frame.reports[i].lsr) {
+
+						rtt_valid = 1;
+
+						switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG3,
+								"Receiving an RTCP packet\n[%04d-%02d-%02d %02d:%02d:%02d.%d] SSRC[0x%x]\n"
+								"RTT[%f] = A[%u] - DLSR[%u] - LSR[%u]\n",
+								1900 + now_hr.tm_year, now_hr.tm_mday, now_hr.tm_mon, now_hr.tm_hour, now_hr.tm_min, now_hr.tm_sec, now_hr.tm_usec,
+								rtp_session->rtcp_frame.reports[i].ssrc, rtt_now,
+								lsr_now, rtp_session->rtcp_frame.reports[i].dlsr, rtp_session->rtcp_frame.reports[i].lsr);
+						if (!rtp_session->rtcp_frame.reports[i].rtt_avg) {
+							rtp_session->rtcp_frame.reports[i].rtt_avg = rtt_now;
+						} else {
+							rtp_session->rtcp_frame.reports[i].rtt_avg = (double)((rtp_session->rtcp_frame.reports[i].rtt_avg * .7) + (rtt_now * .3 ));
+						}
 					} else {
-						rtp_session->rtcp_frame.reports[i].rtt_avg = (double)((rtp_session->rtcp_frame.reports[i].rtt_avg * .7) + (rtt_now * .3 ));
+
+#ifdef DEBUG_RTCP
+						switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING,
+								"Receiving RTCP packet\n[%04d-%02d-%02d %02d:%02d:%02d.%d] SSRC[0x%x]\n"
+								"Ignoring erroneous RTT[%f] = A[%u] - DLSR[%u] - LSR[%u]\n",
+								1900 + now_hr.tm_year, now_hr.tm_mday, now_hr.tm_mon, now_hr.tm_hour, now_hr.tm_min, now_hr.tm_sec, now_hr.tm_usec,
+								rtp_session->rtcp_frame.reports[i].ssrc, rtt_now,
+								lsr_now, rtp_session->rtcp_frame.reports[i].dlsr, rtp_session->rtcp_frame.reports[i].lsr);
+#endif
 					}
+
+					rtt_valid = 0;
+					rtt_now = 0;
+
 					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG3, "RTT average %f\n",
-									  rtp_session->rtcp_frame.reports[i].rtt_avg);
+							rtp_session->rtcp_frame.reports[i].rtt_avg);
 				}
 
 				if (rtp_session->flags[SWITCH_RTP_FLAG_ADJ_BITRATE_CAP] && rtp_session->flags[SWITCH_RTP_FLAG_ESTIMATORS] && !rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
@@ -6615,14 +6640,17 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
 					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG3, "Current packet loss: [%d %%] Current RTT: [%f ms]\n", percent_fraction, rtt_now);
 #endif
 
-					switch_kalman_estimate(rtp_session->estimators[EST_RTT], rtt_now, EST_RTT);
+					if (rtt_valid) {
 
-					if (switch_kalman_cusum_detect_change(rtp_session->detectors[EST_RTT], rtt_now, rtp_session->estimators[EST_RTT]->val_estimate_last)) {
-						/* sudden change in the mean value of RTT */
+						switch_kalman_estimate(rtp_session->estimators[EST_RTT], rtt_now, EST_RTT);
+
+						if (switch_kalman_cusum_detect_change(rtp_session->detectors[EST_RTT], rtt_now, rtp_session->estimators[EST_RTT]->val_estimate_last)) {
+							/* sudden change in the mean value of RTT */
 #ifdef DEBUG_ESTIMATORS_
-						switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG3,"Sudden change in the mean value of RTT !\n");
+							switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG3,"Sudden change in the mean value of RTT !\n");
 #endif
-						rtt_increase = 1;
+							rtt_increase = 1;
+						}
 					}
 
 					switch_kalman_estimate(rtp_session->estimators[EST_LOSS], percent_fraction, EST_LOSS);
@@ -6666,7 +6694,7 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
 															(void *)&rtp_session->rtcp_frame.reports[i].loss_avg,
 															SCCT_NONE, NULL, NULL, NULL);
 
-						} else if (!rtt_increase && rtp_session->estimators[EST_LOSS]->val_estimate_last >= rtp_session->rtcp_frame.reports[i].loss_avg ) {
+						} else if (rtt_valid && !rtt_increase && rtp_session->estimators[EST_LOSS]->val_estimate_last >= rtp_session->rtcp_frame.reports[i].loss_avg ) {
 							/* lossy because of congestion (queues full somewhere -> some packets are dropped , but RTT is good ), packet loss with many small gaps */
 #ifdef DEBUG_ESTIMATORS_
 							switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG3, "packet loss, but RTT is not bad\n");

From e554d48ef6caa3afa7051c950a380d5e9bbce92b Mon Sep 17 00:00:00 2001
From: Piotr Gregor 
Date: Fri, 22 Jun 2018 18:48:31 +0100
Subject: [PATCH 230/264] FS-11202 Add sanity check

Check value of sanity while looping over
switch_cache_db_get_db_handle_dsn() in switch_user_sql_thread.
---
 src/switch_core_sqldb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c
index e5c493e803..49a10e06c3 100644
--- a/src/switch_core_sqldb.c
+++ b/src/switch_core_sqldb.c
@@ -2054,7 +2054,7 @@ static void *SWITCH_THREAD_FUNC switch_user_sql_thread(switch_thread_t *thread,
 	switch_sql_queue_manager_t *qm = (switch_sql_queue_manager_t *) obj;
 	uint32_t i;
 
-	while (!qm->event_db) {
+	while (sanity && !qm->event_db) {
 		if (switch_cache_db_get_db_handle_dsn(&qm->event_db, qm->dsn) == SWITCH_STATUS_SUCCESS && qm->event_db)
 			break;
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s Error getting db handle, Retrying\n", qm->name);

From fe35b509267755eb501216ee60846fa6f267af34 Mon Sep 17 00:00:00 2001
From: Muteesa Fred 
Date: Thu, 28 Jun 2018 17:30:25 +0000
Subject: [PATCH 231/264] FS-11208: [Debian] Prefer libssl1.0 in deb packages

---
 debian/control-modules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/control-modules b/debian/control-modules
index 275b5d3ccc..978ecc49f3 100644
--- a/debian/control-modules
+++ b/debian/control-modules
@@ -507,7 +507,7 @@ Build-Depends: erlang-dev
 Module: event_handlers/mod_event_multicast
 Description: mod_event_multicast
  Adds mod_event_multicast.
-Build-Depends: libssl-dev
+Build-Depends: libssl1.0-dev | libssl-dev
 
 Module: event_handlers/mod_event_socket
 Description: mod_event_socket

From 0342762f593d954e885fa0a9cf3bbc8093dd9827 Mon Sep 17 00:00:00 2001
From: Muteesa Fred 
Date: Fri, 29 Jun 2018 12:24:49 +0000
Subject: [PATCH 232/264] FS-11209: [Debian] openssl linking

---
 debian/rules | 1 -
 1 file changed, 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index f890165553..7fdf7ff733 100755
--- a/debian/rules
+++ b/debian/rules
@@ -75,7 +75,6 @@ override_dh_auto_clean:
 		--prefix=/usr --localstatedir=/var --sysconfdir=/etc \
 		--with-gnu-ld --with-python --with-erlang --with-openssl \
 		--enable-core-odbc-support --enable-zrtp \
-		--enable-core-pgsql-support \
 		--enable-static-v8 --disable-parallel-build-v8
 	touch $@
 

From db2ee2692ee666a50147be391c460c2989f5e9d4 Mon Sep 17 00:00:00 2001
From: Muteesa Fred 
Date: Fri, 29 Jun 2018 12:59:58 +0000
Subject: [PATCH 233/264] FS-11209: [Debian] openssl linking

---
 debian/bootstrap.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh
index 75a832458c..e1bf1165a4 100755
--- a/debian/bootstrap.sh
+++ b/debian/bootstrap.sh
@@ -56,6 +56,7 @@ avoid_mods=(
   endpoints/mod_skypopen
   endpoints/mod_unicall
   event_handlers/mod_smpp
+  event_handlers/mod_cdr_pg_csv
   formats/mod_webm
   sdk/autotools
   xml_int/mod_xml_ldap

From bd794e6e083babdc38dfcd9d27b8816ef502e7a6 Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Mon, 9 Jul 2018 11:58:31 -0400
Subject: [PATCH 234/264] FS-10949: [mod_conference] allow vblind vunblind
 tvblind commands when caller is not sending video

---
 src/mod/applications/mod_conference/conference_api.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c
index bd379ea177..d4c427d8db 100644
--- a/src/mod/applications/mod_conference/conference_api.c
+++ b/src/mod/applications/mod_conference/conference_api.c
@@ -534,10 +534,6 @@ switch_status_t conference_api_sub_vblind(conference_member_t *member, switch_st
 	if (member == NULL)
 		return SWITCH_STATUS_GENERR;
 
-	if (switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY) {
-		return SWITCH_STATUS_SUCCESS;
-	}
-
 	switch_core_session_write_blank_video(member->session, 50);
 	conference_utils_member_clear_flag_locked(member, MFLAG_CAN_SEE);
 	conference_video_reset_video_bitrate_counters(member);
@@ -584,10 +580,6 @@ switch_status_t conference_api_sub_unvblind(conference_member_t *member, switch_
 	if (member == NULL)
 		return SWITCH_STATUS_GENERR;
 
-	if (switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY) {
-		return SWITCH_STATUS_SUCCESS;
-	}
-
 	conference_utils_member_set_flag_locked(member, MFLAG_CAN_SEE);
 	conference_video_reset_video_bitrate_counters(member);
 

From 3e509472954a32018ef418db661f86044ad3c1dd Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Mon, 9 Jul 2018 13:12:56 -0400
Subject: [PATCH 235/264] FS-11222: [core] NACK for multiple packets sends
 wrong packet after the first one

---
 src/switch_rtp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/switch_rtp.c b/src/switch_rtp.c
index 2081daba52..16aba214c5 100644
--- a/src/switch_rtp.c
+++ b/src/switch_rtp.c
@@ -6486,7 +6486,7 @@ static switch_status_t process_rtcp_report(switch_rtp_t *rtp_session, rtcp_msg_t
 
 
 			for (i = 0; i < ntohs(extp->header.length) - 2; i++) {
-				handle_nack(rtp_session, *nack);
+				handle_nack(rtp_session, nack[i]);
 			}
 
 			//switch_core_media_gen_key_frame(rtp_session->session);

From 84c97ea3ab3d6116717b8d4a0efd9f8f4b92a343 Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Mon, 9 Jul 2018 14:53:13 -0400
Subject: [PATCH 236/264] FS-11223: [core] fix Crash when firefox sends only
 rtcp and not rtp candidates on video media

---
 src/switch_core_media.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/switch_core_media.c b/src/switch_core_media.c
index 4591bfc2f5..5f0a9a1dde 100644
--- a/src/switch_core_media.c
+++ b/src/switch_core_media.c
@@ -9078,7 +9078,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
 					}
 
 
-					if (t_engine->ice_in.cands[t_engine->ice_in.chosen[1]][1].ready) {
+					if (t_engine->ice_in.cands[t_engine->ice_in.chosen[1]][1].ready && t_engine->ice_in.cands[t_engine->ice_in.chosen[0]][0].ready &&
+						!zstr(t_engine->ice_in.cands[t_engine->ice_in.chosen[1]][1].con_addr) && 
+						!zstr(t_engine->ice_in.cands[t_engine->ice_in.chosen[0]][0].con_addr)) {
 						if (t_engine->rtcp_mux > 0 && !strcmp(t_engine->ice_in.cands[t_engine->ice_in.chosen[1]][1].con_addr,
 															  t_engine->ice_in.cands[t_engine->ice_in.chosen[0]][0].con_addr) &&
 							t_engine->ice_in.cands[t_engine->ice_in.chosen[1]][1].con_port == t_engine->ice_in.cands[t_engine->ice_in.chosen[0]][0].con_port) {
@@ -9404,7 +9406,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
 					}
 
 
-					if (v_engine->ice_in.cands[v_engine->ice_in.chosen[1]][1].ready) {
+					if (v_engine->ice_in.cands[v_engine->ice_in.chosen[1]][1].ready && v_engine->ice_in.cands[v_engine->ice_in.chosen[0]][0].ready &&
+						!zstr(v_engine->ice_in.cands[v_engine->ice_in.chosen[1]][1].con_addr) && 
+						!zstr(v_engine->ice_in.cands[v_engine->ice_in.chosen[0]][0].con_addr)) {
 
 						if (v_engine->rtcp_mux > 0 && !strcmp(v_engine->ice_in.cands[v_engine->ice_in.chosen[1]][1].con_addr, v_engine->ice_in.cands[v_engine->ice_in.chosen[0]][0].con_addr)
 							&& v_engine->ice_in.cands[v_engine->ice_in.chosen[1]][1].con_port == v_engine->ice_in.cands[v_engine->ice_in.chosen[0]][0].con_port) {

From 837df198a501134590fe41d1e985fd21c53d123c Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Tue, 17 Jul 2018 12:35:56 -0500
Subject: [PATCH 237/264] FS-11238: [mod_conference] Regression from FS-10448
 can cause stuck sessions #resolve

---
 src/mod/applications/mod_conference/conference_video.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c
index 86f41d9006..69cf103bd4 100644
--- a/src/mod/applications/mod_conference/conference_video.c
+++ b/src/mod/applications/mod_conference/conference_video.c
@@ -4814,6 +4814,7 @@ void conference_video_write_frame(conference_obj_t *conference, conference_membe
 		}
 
 		if (!conference_utils_member_test_flag(imember, MFLAG_CAN_SEE)) {
+			switch_core_session_rwunlock(isession);
 			continue;
 		}
 

From 671da287960a58215876df106a3760699e0622e7 Mon Sep 17 00:00:00 2001
From: Andrey Volk 
Date: Fri, 20 Jul 2018 01:50:45 +0300
Subject: [PATCH 238/264] FS-11263: [Build-System] Move FreeSWITCH build system
 to Visual Studio 2017 on Windows.

---
 Freeswitch.2015.sln.bat                       |   88 -
 Freeswitch.2015.sln => Freeswitch.2017.sln    | 6389 +++++++++--------
 Freeswitch.2017.sln.bat                       |   81 +
 ...s_cli.2015.vcxproj => fs_cli.2017.vcxproj} |  458 +-
 ...{ESLPINVOKE.2015.cs => ESLPINVOKE.2017.cs} |    0
 ...nnection.2015.cs => ESLconnection.2017.cs} |    0
 .../{ESLevent.2015.cs => ESLevent.2017.cs}    |    0
 ...Esl.2015.csproj => ManagedEsl.2017.csproj} |   12 +-
 ...anagedEsl.2015.sln => ManagedEsl.2017.sln} |   15 +-
 ...2015.csproj => ManagedEslTest.2017.csproj} |    4 +-
 ...2015.cs => SWIGTYPE_p_esl_event_t.2017.cs} |    0
 ...5.cs => SWIGTYPE_p_esl_priority_t.2017.cs} |    0
 libs/esl/managed/{esl.2015.cs => esl.2017.cs} |    0
 .../{esl.2015.vcxproj => esl.2017.vcxproj}    |   16 +-
 .../{esl_wrap.2015.cpp => esl_wrap.2017.cpp}  |    0
 .../{runswig.2015.cmd => runswig.2017.cmd}    |   14 +-
 ...ibesl.2015.vcxproj => libesl.2017.vcxproj} |   12 +-
 ...2015.vcxproj => libdingaling.2017.vcxproj} |  604 +-
 ....2015.vcxproj => libteletone.2017.vcxproj} |  320 +-
 ...zrtp.2015.vcxproj => libzrtp.2017.vcxproj} |  514 +-
 ...p.2015.vcxproj => libspandsp.2017.vcxproj} |  938 +--
 ...tiff.2015.vcxproj => libtiff.2017.vcxproj} |  420 +-
 ...cxproj => make_at_dictionary.2017.vcxproj} |  136 +-
 ....vcxproj => make_cielab_luts.2017.vcxproj} |  136 +-
 ...oj => make_math_fixed_tables.2017.vcxproj} |  136 +-
 ...vcxproj => make_modem_filter.2017.vcxproj} |  198 +-
 ...=> make_t43_gray_code_tables.2017.vcxproj} |  136 +-
 ...srtp.2015.vcxproj => libsrtp.2017.vcxproj} |  838 +--
 ...t.2015.vcxproj => aprtoolkit.2017.vcxproj} |  332 +-
 .../{mpf.2015.vcxproj => mpf.2017.vcxproj}    |  390 +-
 ...t.2015.vcxproj => mrcpclient.2017.vcxproj} |  250 +-
 ...015.vcxproj => mrcpsignaling.2017.vcxproj} |  248 +-
 .../{mrcp.2015.vcxproj => mrcp.2017.vcxproj}  |  314 +-
 ...5.vcxproj => mrcpv2transport.2017.vcxproj} |  256 +-
 ...rtsp.2015.vcxproj => unirtsp.2017.vcxproj} |  270 +-
 ...2015.vcxproj => mrcpsofiasip.2017.vcxproj} |  284 +-
 ....2015.vcxproj => mrcpunirtsp.2017.vcxproj} |  280 +-
 ...roj => Download 16khz Sounds.2017.vcxproj} |  154 +-
 ...proj => Download 16khz music.2017.vcxproj} |  166 +-
 ...roj => Download 32khz Sounds.2017.vcxproj} |  152 +-
 ...proj => Download 32khz music.2017.vcxproj} |  166 +-
 ...proj => Download 8khz Sounds.2017.vcxproj} |  154 +-
 ...xproj => Download 8khz music.2017.vcxproj} |  162 +-
 ...015.vcxproj => Download CELT.2017.vcxproj} |  174 +-
 ...015.vcxproj => Download LAME.2017.vcxproj} |  166 +-
 ...015.vcxproj => Download LDNS.2017.vcxproj} |  166 +-
 ...vcxproj => Download LIBSHOUT.2017.vcxproj} |  166 +-
 ...2015.vcxproj => Download OGG.2017.vcxproj} |  166 +-
 ...015.vcxproj => Download OPUS.2017.vcxproj} |  158 +-
 ...cxproj => Download PORTAUDIO.2017.vcxproj} |  166 +-
 ....vcxproj => Download PTHREAD.2017.vcxproj} |  158 +-
 ...15.vcxproj => Download SPEEX.2017.vcxproj} |  168 +-
 ...5.vcxproj => Download SQLITE.2017.vcxproj} |  168 +-
 ...xproj => Download broadvoice.2017.vcxproj} |    6 +-
 ...vcxproj => Download freetype.2017.vcxproj} |    6 +-
 ...5.vcxproj => Download g722_1.2017.vcxproj} |    6 +-
 ...015.vcxproj => Download iLBC.2017.vcxproj} |    6 +-
 ...15.vcxproj => Download libav.2017.vcxproj} |    6 +-
 ...cxproj => Download libcodec2.2017.vcxproj} |    6 +-
 ....vcxproj => Download libjpeg.2017.vcxproj} |  166 +-
 ...5.vcxproj => Download libpng.2017.vcxproj} |    6 +-
 ....vcxproj => Download libsilk.2017.vcxproj} |    6 +-
 ....vcxproj => Download libx264.2017.vcxproj} |    6 +-
 ...5.vcxproj => Download mpg123.2017.vcxproj} |  170 +-
 ...roj => Download pocketsphinx.2017.vcxproj} |  158 +-
 ...xproj => Download sphinxbase.2017.vcxproj} |  158 +-
 ...proj => Download sphinxmodel.2017.vcxproj} |  164 +-
 ...015.vcxproj => Download tiff.2017.vcxproj} |    6 +-
 ...{16khz.2015.vcxproj => 16khz.2017.vcxproj} |  314 +-
 ...c.2015.vcxproj => 16khzmusic.2017.vcxproj} |  234 +-
 ...{32khz.2015.vcxproj => 32khz.2017.vcxproj} |  314 +-
 ...c.2015.vcxproj => 32khzmusic.2017.vcxproj} |  226 +-
 .../{8khz.2015.vcxproj => 8khz.2017.vcxproj}  |  314 +-
 ...ic.2015.vcxproj => 8khzmusic.2017.vcxproj} |  234 +-
 ...l.2015.vcxproj => libaprutil.2017.vcxproj} | 1918 ++---
 .../{xml.2015.vcxproj => xml.2017.vcxproj}    |  576 +-
 ...ibapr.2015.vcxproj => libapr.2017.vcxproj} |  684 +-
 ...015.vcxproj => libbroadvoice.2017.vcxproj} |   12 +-
 ...celt.2015.vcxproj => libcelt.2017.vcxproj} |  312 +-
 ...freetype.vcxproj => freetype.2017.vcxproj} |   12 +-
 ...emel.2015.vcxproj => iksemel.2017.vcxproj} |  280 +-
 ...ilbc.2015.vcxproj => libilbc.2017.vcxproj} |   12 +-
 ...lib.2015.vcxproj => ldns-lib.2017.vcxproj} |  540 +-
 ...{libav.2015.vcxproj => libav.2017.vcxproj} |   14 +-
 ...ibcbt.2015.vcxproj => libcbt.2017.vcxproj} |  334 +-
 ...c2.2015.vcxproj => libcodec2.2017.vcxproj} |   12 +-
 ..._1.2015.vcxproj => libg722_1.2017.vcxproj} |  316 +-
 ...jpeg.2015.vcxproj => libjpeg.2017.vcxproj} |  488 +-
 ...e.2015.vcxproj => libmp3lame.2017.vcxproj} |  954 +--
 ...ibogg.2015.vcxproj => libogg.2017.vcxproj} |  416 +-
 .../{libpng.vcxproj => libpng.2017.vcxproj}   |   14 +-
 ...out.2015.vcxproj => libshout.2017.vcxproj} |  382 +-
 ...FIX.2015.vcxproj => Silk_FIX.2017.vcxproj} |   12 +-
 ...ibvpx.2015.vcxproj => libvpx.2017.vcxproj} |   10 +-
 ...x264.2015.vcxproj => libx264.2017.vcxproj} |    2 +-
 ...ibyuv.2015.vcxproj => libyuv.2017.vcxproj} |   10 +-
 ...23.2015.vcxproj => libmpg123.2017.vcxproj} | 2670 +++----
 .../{opus.2015.vcxproj => opus.2017.vcxproj}  |  522 +-
 ...lt.2015.vcxproj => opus.celt.2017.vcxproj} |  522 +-
 ....vcxproj => opus.silk_common.2017.vcxproj} |  632 +-
 ...5.vcxproj => opus.silk_fixed.2017.vcxproj} |  412 +-
 ...5.vcxproj => opus.silk_float.2017.vcxproj} |  508 +-
 ...2015.vcxproj => pocketsphinx.2017.vcxproj} |  806 +--
 ...io.2015.vcxproj => portaudio.2017.vcxproj} | 1724 ++---
 ...read.2015.vcxproj => pthread.2017.vcxproj} |  910 +--
 ...oj => libsofia_sip_ua_static.2017.vcxproj} | 1058 +--
 ...eex.2015.vcxproj => libspeex.2017.vcxproj} | 1294 ++--
 ....2015.vcxproj => libspeexdsp.2017.vcxproj} |  768 +-
 ...e.2015.vcxproj => sphinxbase.2017.vcxproj} | 1316 ++--
 ...qlite.2015.vcxproj => sqlite.2017.vcxproj} |  674 +-
 ...udns.2015.vcxproj => libudns.2017.vcxproj} |  272 +-
 ...{abyss.2015.vcxproj => abyss.2017.vcxproj} |  408 +-
 ...tab.2015.vcxproj => gennmtab.2017.vcxproj} |  658 +-
 ...rse.2015.vcxproj => xmlparse.2017.vcxproj} |  514 +-
 ...mlrpc.2015.vcxproj => xmlrpc.2017.vcxproj} |  504 +-
 ...mltok.2015.vcxproj => xmltok.2017.vcxproj} |  414 +-
 ...5.vcxproj => mod_abstraction.2017.vcxproj} |  268 +-
 ...od_av.2015.vcxproj => mod_av.2017.vcxproj} |   16 +-
 ...vmd.2015.vcxproj => mod_avmd.2017.vcxproj} |  312 +-
 ...015.vcxproj => mod_blacklist.2017.vcxproj} |  276 +-
 ...15.vcxproj => mod_callcenter.2017.vcxproj} |  276 +-
 ...2015.vcxproj => mod_commands.2017.vcxproj} |  324 +-
 ...15.vcxproj => mod_conference.2017.vcxproj} |  360 +-
 ...url.2015.vcxproj => mod_curl.2017.vcxproj} |  272 +-
 ...od_cv.2015.vcxproj => mod_cv.2017.vcxproj} |   14 +-
 ...od_db.2015.vcxproj => mod_db.2017.vcxproj} |  268 +-
 ...015.vcxproj => mod_directory.2017.vcxproj} |  314 +-
 ...5.vcxproj => mod_distributor.2017.vcxproj} |  266 +-
 ....2015.vcxproj => mod_dptools.2017.vcxproj} |  316 +-
 ...015.vcxproj => mod_easyroute.2017.vcxproj} |  268 +-
 ...num.2015.vcxproj => mod_enum.2017.vcxproj} |  330 +-
 ..._esf.2015.vcxproj => mod_esf.2017.vcxproj} |  268 +-
 ...xpr.2015.vcxproj => mod_expr.2017.vcxproj} |  318 +-
 ...ifo.2015.vcxproj => mod_fifo.2017.vcxproj} |  276 +-
 ..._fsv.2015.vcxproj => mod_fsv.2017.vcxproj} |  268 +-
 ...ash.2015.vcxproj => mod_hash.2017.vcxproj} |  330 +-
 ...i.2015.vcxproj => mod_httapi.2017.vcxproj} |  286 +-
 ...he.vcxproj => mod_http_cache.2017.vcxproj} |   12 +-
 ..._lcr.2015.vcxproj => mod_lcr.2017.vcxproj} |  268 +-
 ...15.vcxproj => mod_nibblebill.2017.vcxproj} |  284 +-
 ...is.2015.vcxproj => mod_redis.2017.vcxproj} |  334 +-
 ..._rss.2015.vcxproj => mod_rss.2017.vcxproj} |  280 +-
 ...kel.2015.vcxproj => mod_skel.2017.vcxproj} |  268 +-
 ..._sms.2015.vcxproj => mod_sms.2017.vcxproj} |  268 +-
 ...nom.2015.vcxproj => mod_snom.2017.vcxproj} |  290 +-
 ....2015.vcxproj => mod_spandsp.2017.vcxproj} |  364 +-
 ..._spy.2015.vcxproj => mod_spy.2017.vcxproj} |  268 +-
 ...vcxproj => mod_valet_parking.2017.vcxproj} |  276 +-
 ..._vmd.2015.vcxproj => mod_vmd.2017.vcxproj} |  268 +-
 ...015.vcxproj => mod_voicemail.2017.vcxproj} |  276 +-
 ...2015.vcxproj => mod_cepstral.2017.vcxproj} |  290 +-
 ...te.2015.vcxproj => mod_flite.2017.vcxproj} |  282 +-
 ....vcxproj => mod_pocketsphinx.2017.vcxproj} |  410 +-
 ....2015.vcxproj => mod_unimrcp.2017.vcxproj} |  408 +-
 ..._amr.2015.vcxproj => mod_amr.2017.vcxproj} |  524 +-
 ...od_bv.2015.vcxproj => mod_bv.2017.vcxproj} |  278 +-
 ...codec2.vcxproj => mod_codec2.2017.vcxproj} |   14 +-
 ...1.2015.vcxproj => mod_g723_1.2017.vcxproj} |  542 +-
 ...729.2015.vcxproj => mod_g729.2017.vcxproj} |  540 +-
 ...26x.2015.vcxproj => mod_h26x.2017.vcxproj} |  284 +-
 ...lbc.2015.vcxproj => mod_ilbc.2017.vcxproj} |  278 +-
 ...SAC.2015.vcxproj => mod_iSAC.2017.vcxproj} |  506 +-
 ...pus.2015.vcxproj => mod_opus.2017.vcxproj} |  318 +-
 ...ilk.2015.vcxproj => mod_silk.2017.vcxproj} |  280 +-
 ...en.2015.vcxproj => mod_siren.2017.vcxproj} |  278 +-
 ...roj => mod_dialplan_asterisk.2017.vcxproj} |  268 +-
 ...oj => mod_dialplan_directory.2017.vcxproj} |  276 +-
 ....vcxproj => mod_dialplan_xml.2017.vcxproj} |  276 +-
 ...dap.2015.vcxproj => mod_ldap.2017.vcxproj} |  592 +-
 ...015.vcxproj => mod_dingaling.2017.vcxproj} |  328 +-
 ...smlib.2015.vcxproj => gsmlib.2017.vcxproj} |  498 +-
 ....2015.vcxproj => mod_gsmopen.2017.vcxproj} |  338 +-
 ...323.2015.vcxproj => mod_h323.2017.vcxproj} |  306 +-
 ...2015.vcxproj => mod_loopback.2017.vcxproj} |  280 +-
 ...pal.2015.vcxproj => mod_opal.2017.vcxproj} |  186 +-
 ...015.vcxproj => mod_PortAudio.2017.vcxproj} |  388 +-
 ..._rtc.2015.vcxproj => mod_rtc.2017.vcxproj} |  276 +-
 ...tmp.2015.vcxproj => mod_rtmp.2017.vcxproj} |  366 +-
 ...y.2015.vcxproj => mod_skinny.2017.vcxproj} |  362 +-
 ...ia.2015.vcxproj => mod_sofia.2017.vcxproj} |  392 +-
 ...to.2015.vcxproj => mod_verto.2017.vcxproj} |  318 +-
 ...mqp.2015.vcxproj => mod_amqp.2017.vcxproj} |   14 +-
 ....2015.vcxproj => mod_cdr_csv.2017.vcxproj} |  280 +-
 ...15.vcxproj => mod_cdr_pg_csv.2017.vcxproj} |   14 +-
 ...15.vcxproj => mod_cdr_sqlite.2017.vcxproj} |   12 +-
 ...xproj => mod_event_multicast.2017.vcxproj} |  286 +-
 ....vcxproj => mod_event_socket.2017.vcxproj} |  276 +-
 ...2015.vcxproj => mod_odbc_cdr.2017.vcxproj} |   12 +-
 ....vcxproj => mod_local_stream.2017.vcxproj} |  268 +-
 ...5.vcxproj => mod_native_file.2017.vcxproj} |  280 +-
 ..._png.2015.vcxproj => mod_png.2017.vcxproj} |   14 +-
 ...ut.2015.vcxproj => mod_shout.2017.vcxproj} |  382 +-
 ....2015.vcxproj => mod_sndfile.2017.vcxproj} |  282 +-
 ...5.vcxproj => mod_tone_stream.2017.vcxproj} |  288 +-
 ..._lua.2015.vcxproj => mod_lua.2017.vcxproj} |  322 +-
 ....csproj => FreeSWITCH.Managed.2017.csproj} |  200 +-
 .../examples/winFailToBan/winFailToBan.csproj |    2 +-
 ....2015.vcxproj => mod_managed.2017.vcxproj} |  694 +-
 ...od_v8.2015.vcxproj => mod_v8.2017.vcxproj} |  440 +-
 ....2015.vcxproj => mod_v8_skel.2017.vcxproj} |  398 +-
 ....2015.vcxproj => mod_console.2017.vcxproj} |  268 +-
 ....2015.vcxproj => mod_logfile.2017.vcxproj} |  276 +-
 ...e.2015.vcxproj => mod_say_de.2017.vcxproj} |  268 +-
 ...n.2015.vcxproj => mod_say_en.2017.vcxproj} |  276 +-
 ...s.2015.vcxproj => mod_say_es.2017.vcxproj} |  268 +-
 ...015.vcxproj => mod_say_es_ar.2017.vcxproj} |   14 +-
 ...a.2015.vcxproj => mod_say_fa.2017.vcxproj} |   14 +-
 ...r.2015.vcxproj => mod_say_fr.2017.vcxproj} |  268 +-
 ...e.2015.vcxproj => mod_say_he.2017.vcxproj} |   14 +-
 ...r.2015.vcxproj => mod_say_hr.2017.vcxproj} |   14 +-
 ...u.2015.vcxproj => mod_say_hu.2017.vcxproj} |   14 +-
 ...t.2015.vcxproj => mod_say_it.2017.vcxproj} |  268 +-
 ...a.2015.vcxproj => mod_say_ja.2017.vcxproj} |   14 +-
 ...l.2015.vcxproj => mod_say_nl.2017.vcxproj} |  292 +-
 ...l.2015.vcxproj => mod_say_pl.2017.vcxproj} |   14 +-
 ...t.2015.vcxproj => mod_say_pt.2017.vcxproj} |  268 +-
 ...u.2015.vcxproj => mod_say_ru.2017.vcxproj} |  268 +-
 ...v.2015.vcxproj => mod_say_sv.2017.vcxproj} |  276 +-
 ...h.2015.vcxproj => mod_say_th.2017.vcxproj} |   14 +-
 ...h.2015.vcxproj => mod_say_zh.2017.vcxproj} |  276 +-
 ....2015.vcxproj => mod_xml_cdr.2017.vcxproj} |  282 +-
 ...2015.vcxproj => mod_xml_curl.2017.vcxproj} |  280 +-
 ....2015.vcxproj => mod_xml_rpc.2017.vcxproj} |  374 +-
 ...vcxproj => FreeSwitchConsole.2017.vcxproj} |  482 +-
 ...15.vcxproj => FreeSwitchCore.2017.vcxproj} | 1844 ++---
 .../{Product.2015.wxs => Product.2017.wxs}    |  264 +-
 ...{Setup.2015.wixproj => Setup.2017.wixproj} | 1856 ++---
 227 files changed, 38050 insertions(+), 38051 deletions(-)
 delete mode 100644 Freeswitch.2015.sln.bat
 rename Freeswitch.2015.sln => Freeswitch.2017.sln (93%)
 create mode 100644 Freeswitch.2017.sln.bat
 rename libs/esl/{fs_cli.2015.vcxproj => fs_cli.2017.vcxproj} (96%)
 rename libs/esl/managed/{ESLPINVOKE.2015.cs => ESLPINVOKE.2017.cs} (100%)
 rename libs/esl/managed/{ESLconnection.2015.cs => ESLconnection.2017.cs} (100%)
 rename libs/esl/managed/{ESLevent.2015.cs => ESLevent.2017.cs} (100%)
 rename libs/esl/managed/{ManagedEsl.2015.csproj => ManagedEsl.2017.csproj} (92%)
 rename libs/esl/managed/{ManagedEsl.2015.sln => ManagedEsl.2017.sln} (91%)
 rename libs/esl/managed/ManagedEslTest/{ManagedEslTest.2015.csproj => ManagedEslTest.2017.csproj} (97%)
 rename libs/esl/managed/{SWIGTYPE_p_esl_event_t.2015.cs => SWIGTYPE_p_esl_event_t.2017.cs} (100%)
 rename libs/esl/managed/{SWIGTYPE_p_esl_priority_t.2015.cs => SWIGTYPE_p_esl_priority_t.2017.cs} (100%)
 rename libs/esl/managed/{esl.2015.cs => esl.2017.cs} (100%)
 rename libs/esl/managed/{esl.2015.vcxproj => esl.2017.vcxproj} (97%)
 rename libs/esl/managed/{esl_wrap.2015.cpp => esl_wrap.2017.cpp} (100%)
 rename libs/esl/managed/{runswig.2015.cmd => runswig.2017.cmd} (68%)
 rename libs/esl/src/{libesl.2015.vcxproj => libesl.2017.vcxproj} (97%)
 rename libs/libdingaling/{libdingaling.2015.vcxproj => libdingaling.2017.vcxproj} (95%)
 rename libs/libteletone/{libteletone.2015.vcxproj => libteletone.2017.vcxproj} (95%)
 rename libs/libzrtp/projects/win/{libzrtp.2015.vcxproj => libzrtp.2017.vcxproj} (96%)
 rename libs/spandsp/src/{libspandsp.2015.vcxproj => libspandsp.2017.vcxproj} (95%)
 rename libs/spandsp/src/{libtiff.2015.vcxproj => libtiff.2017.vcxproj} (95%)
 rename libs/spandsp/src/msvc/{make_at_dictionary.2015.vcxproj => make_at_dictionary.2017.vcxproj} (94%)
 rename libs/spandsp/src/msvc/{make_cielab_luts.2015.vcxproj => make_cielab_luts.2017.vcxproj} (94%)
 rename libs/spandsp/src/msvc/{make_math_fixed_tables.2015.vcxproj => make_math_fixed_tables.2017.vcxproj} (94%)
 rename libs/spandsp/src/msvc/{make_modem_filter.2015.vcxproj => make_modem_filter.2017.vcxproj} (96%)
 rename libs/spandsp/src/msvc/{make_t43_gray_code_tables.2015.vcxproj => make_t43_gray_code_tables.2017.vcxproj} (94%)
 rename libs/srtp/{libsrtp.2015.vcxproj => libsrtp.2017.vcxproj} (96%)
 rename libs/unimrcp/libs/apr-toolkit/{aprtoolkit.2015.vcxproj => aprtoolkit.2017.vcxproj} (95%)
 rename libs/unimrcp/libs/mpf/{mpf.2015.vcxproj => mpf.2017.vcxproj} (96%)
 rename libs/unimrcp/libs/mrcp-client/{mrcpclient.2015.vcxproj => mrcpclient.2017.vcxproj} (94%)
 rename libs/unimrcp/libs/mrcp-signaling/{mrcpsignaling.2015.vcxproj => mrcpsignaling.2017.vcxproj} (94%)
 rename libs/unimrcp/libs/mrcp/{mrcp.2015.vcxproj => mrcp.2017.vcxproj} (95%)
 rename libs/unimrcp/libs/mrcpv2-transport/{mrcpv2transport.2015.vcxproj => mrcpv2transport.2017.vcxproj} (95%)
 rename libs/unimrcp/libs/uni-rtsp/{unirtsp.2015.vcxproj => unirtsp.2017.vcxproj} (95%)
 rename libs/unimrcp/modules/mrcp-sofiasip/{mrcpsofiasip.2015.vcxproj => mrcpsofiasip.2017.vcxproj} (95%)
 rename libs/unimrcp/modules/mrcp-unirtsp/{mrcpunirtsp.2015.vcxproj => mrcpunirtsp.2017.vcxproj} (95%)
 rename libs/win32/{Download 16khz Sounds.2015.vcxproj => Download 16khz Sounds.2017.vcxproj} (94%)
 rename libs/win32/{Download 16khz music.2015.vcxproj => Download 16khz music.2017.vcxproj} (94%)
 rename libs/win32/{Download 32khz Sounds.2015.vcxproj => Download 32khz Sounds.2017.vcxproj} (94%)
 rename libs/win32/{Download 32khz music.2015.vcxproj => Download 32khz music.2017.vcxproj} (94%)
 rename libs/win32/{Download 8khz Sounds.2015.vcxproj => Download 8khz Sounds.2017.vcxproj} (94%)
 rename libs/win32/{Download 8khz music.2015.vcxproj => Download 8khz music.2017.vcxproj} (94%)
 rename libs/win32/{Download CELT.2015.vcxproj => Download CELT.2017.vcxproj} (94%)
 rename libs/win32/{Download LAME.2015.vcxproj => Download LAME.2017.vcxproj} (94%)
 rename libs/win32/{Download LDNS.2015.vcxproj => Download LDNS.2017.vcxproj} (94%)
 rename libs/win32/{Download LIBSHOUT.2015.vcxproj => Download LIBSHOUT.2017.vcxproj} (94%)
 rename libs/win32/{Download OGG.2015.vcxproj => Download OGG.2017.vcxproj} (94%)
 rename libs/win32/{Download OPUS.2015.vcxproj => Download OPUS.2017.vcxproj} (94%)
 rename libs/win32/{Download PORTAUDIO.2015.vcxproj => Download PORTAUDIO.2017.vcxproj} (94%)
 rename libs/win32/{Download PTHREAD.2015.vcxproj => Download PTHREAD.2017.vcxproj} (94%)
 rename libs/win32/{Download SPEEX.2015.vcxproj => Download SPEEX.2017.vcxproj} (94%)
 rename libs/win32/{Download SQLITE.2015.vcxproj => Download SQLITE.2017.vcxproj} (94%)
 rename libs/win32/{Download broadvoice.2015.vcxproj => Download broadvoice.2017.vcxproj} (96%)
 rename libs/win32/{Download freetype.2015.vcxproj => Download freetype.2017.vcxproj} (96%)
 rename libs/win32/{Download g722_1.2015.vcxproj => Download g722_1.2017.vcxproj} (96%)
 rename libs/win32/{Download iLBC.2015.vcxproj => Download iLBC.2017.vcxproj} (96%)
 rename libs/win32/{Download libav.2015.vcxproj => Download libav.2017.vcxproj} (96%)
 rename libs/win32/{Download libcodec2.2015.vcxproj => Download libcodec2.2017.vcxproj} (96%)
 rename libs/win32/{Download libjpeg.2015.vcxproj => Download libjpeg.2017.vcxproj} (94%)
 rename libs/win32/{Download libpng.2015.vcxproj => Download libpng.2017.vcxproj} (96%)
 rename libs/win32/{Download libsilk.2015.vcxproj => Download libsilk.2017.vcxproj} (96%)
 rename libs/win32/{Download libx264.2015.vcxproj => Download libx264.2017.vcxproj} (96%)
 rename libs/win32/{Download mpg123.2015.vcxproj => Download mpg123.2017.vcxproj} (94%)
 rename libs/win32/{Download pocketsphinx.2015.vcxproj => Download pocketsphinx.2017.vcxproj} (94%)
 rename libs/win32/{Download sphinxbase.2015.vcxproj => Download sphinxbase.2017.vcxproj} (94%)
 rename libs/win32/{Download sphinxmodel.2015.vcxproj => Download sphinxmodel.2017.vcxproj} (94%)
 rename libs/win32/{Download tiff.2015.vcxproj => Download tiff.2017.vcxproj} (96%)
 rename libs/win32/Sound_Files/{16khz.2015.vcxproj => 16khz.2017.vcxproj} (95%)
 rename libs/win32/Sound_Files/{16khzmusic.2015.vcxproj => 16khzmusic.2017.vcxproj} (93%)
 rename libs/win32/Sound_Files/{32khz.2015.vcxproj => 32khz.2017.vcxproj} (95%)
 rename libs/win32/Sound_Files/{32khzmusic.2015.vcxproj => 32khzmusic.2017.vcxproj} (93%)
 rename libs/win32/Sound_Files/{8khz.2015.vcxproj => 8khz.2017.vcxproj} (95%)
 rename libs/win32/Sound_Files/{8khzmusic.2015.vcxproj => 8khzmusic.2017.vcxproj} (93%)
 rename libs/win32/apr-util/{libaprutil.2015.vcxproj => libaprutil.2017.vcxproj} (98%)
 rename libs/win32/apr-util/{xml.2015.vcxproj => xml.2017.vcxproj} (97%)
 rename libs/win32/apr/{libapr.2015.vcxproj => libapr.2017.vcxproj} (97%)
 rename libs/win32/broadvoice/{libbroadvoice.2015.vcxproj => libbroadvoice.2017.vcxproj} (97%)
 rename libs/win32/celt/{libcelt.2015.vcxproj => libcelt.2017.vcxproj} (94%)
 rename libs/win32/freetype/{freetype.vcxproj => freetype.2017.vcxproj} (99%)
 rename libs/win32/iksemel/{iksemel.2015.vcxproj => iksemel.2017.vcxproj} (95%)
 rename libs/win32/ilbc/{libilbc.2015.vcxproj => libilbc.2017.vcxproj} (96%)
 rename libs/win32/ldns/ldns-lib/{ldns-lib.2015.vcxproj => ldns-lib.2017.vcxproj} (96%)
 rename libs/win32/libav/{libav.2015.vcxproj => libav.2017.vcxproj} (99%)
 rename libs/win32/libcbt/{libcbt.2015.vcxproj => libcbt.2017.vcxproj} (95%)
 rename libs/win32/libcodec2/{libcodec2.2015.vcxproj => libcodec2.2017.vcxproj} (96%)
 rename libs/win32/libg722_1/{libg722_1.2015.vcxproj => libg722_1.2017.vcxproj} (94%)
 rename libs/win32/libjpeg/{libjpeg.2015.vcxproj => libjpeg.2017.vcxproj} (96%)
 rename libs/win32/libmp3lame/{libmp3lame.2015.vcxproj => libmp3lame.2017.vcxproj} (98%)
 rename libs/win32/libogg/{libogg.2015.vcxproj => libogg.2017.vcxproj} (95%)
 rename libs/win32/libpng/{libpng.vcxproj => libpng.2017.vcxproj} (97%)
 rename libs/win32/libshout/{libshout.2015.vcxproj => libshout.2017.vcxproj} (94%)
 rename libs/win32/libsilk/{Silk_FIX.2015.vcxproj => Silk_FIX.2017.vcxproj} (98%)
 rename libs/win32/libvpx/{libvpx.2015.vcxproj => libvpx.2017.vcxproj} (99%)
 rename libs/win32/libx264/{libx264.2015.vcxproj => libx264.2017.vcxproj} (99%)
 rename libs/win32/libyuv/{libyuv.2015.vcxproj => libyuv.2017.vcxproj} (97%)
 rename libs/win32/mpg123/{libmpg123.2015.vcxproj => libmpg123.2017.vcxproj} (97%)
 rename libs/win32/opus/{opus.2015.vcxproj => opus.2017.vcxproj} (94%)
 rename libs/win32/opus/{opus.celt.2015.vcxproj => opus.celt.2017.vcxproj} (95%)
 rename libs/win32/opus/{opus.silk_common.2015.vcxproj => opus.silk_common.2017.vcxproj} (96%)
 rename libs/win32/opus/{opus.silk_fixed.2015.vcxproj => opus.silk_fixed.2017.vcxproj} (94%)
 rename libs/win32/opus/{opus.silk_float.2015.vcxproj => opus.silk_float.2017.vcxproj} (95%)
 rename libs/win32/pocketsphinx/{pocketsphinx.2015.vcxproj => pocketsphinx.2017.vcxproj} (97%)
 rename libs/win32/portaudio/{portaudio.2015.vcxproj => portaudio.2017.vcxproj} (98%)
 rename libs/win32/pthread/{pthread.2015.vcxproj => pthread.2017.vcxproj} (96%)
 rename libs/win32/sofia/{libsofia_sip_ua_static.2015.vcxproj => libsofia_sip_ua_static.2017.vcxproj} (97%)
 rename libs/win32/speex/{libspeex.2015.vcxproj => libspeex.2017.vcxproj} (96%)
 rename libs/win32/speex/{libspeexdsp.2015.vcxproj => libspeexdsp.2017.vcxproj} (96%)
 rename libs/win32/sphinxbase/{sphinxbase.2015.vcxproj => sphinxbase.2017.vcxproj} (98%)
 rename libs/win32/sqlite/{sqlite.2015.vcxproj => sqlite.2017.vcxproj} (95%)
 rename libs/win32/udns/{libudns.2015.vcxproj => libudns.2017.vcxproj} (94%)
 rename libs/win32/xmlrpc-c/{abyss.2015.vcxproj => abyss.2017.vcxproj} (95%)
 rename libs/win32/xmlrpc-c/{gennmtab.2015.vcxproj => gennmtab.2017.vcxproj} (96%)
 rename libs/win32/xmlrpc-c/{xmlparse.2015.vcxproj => xmlparse.2017.vcxproj} (95%)
 rename libs/win32/xmlrpc-c/{xmlrpc.2015.vcxproj => xmlrpc.2017.vcxproj} (95%)
 rename libs/win32/xmlrpc-c/{xmltok.2015.vcxproj => xmltok.2017.vcxproj} (95%)
 rename src/mod/applications/mod_abstraction/{mod_abstraction.2015.vcxproj => mod_abstraction.2017.vcxproj} (93%)
 rename src/mod/applications/mod_av/{mod_av.2015.vcxproj => mod_av.2017.vcxproj} (96%)
 rename src/mod/applications/mod_avmd/{mod_avmd.2015.vcxproj => mod_avmd.2017.vcxproj} (94%)
 rename src/mod/applications/mod_blacklist/{mod_blacklist.2015.vcxproj => mod_blacklist.2017.vcxproj} (93%)
 rename src/mod/applications/mod_callcenter/{mod_callcenter.2015.vcxproj => mod_callcenter.2017.vcxproj} (93%)
 rename src/mod/applications/mod_commands/{mod_commands.2015.vcxproj => mod_commands.2017.vcxproj} (94%)
 rename src/mod/applications/mod_conference/{mod_conference.2015.vcxproj => mod_conference.2017.vcxproj} (94%)
 rename src/mod/applications/mod_curl/{mod_curl.2015.vcxproj => mod_curl.2017.vcxproj} (92%)
 rename src/mod/applications/mod_cv/{mod_cv.2015.vcxproj => mod_cv.2017.vcxproj} (95%)
 rename src/mod/applications/mod_db/{mod_db.2015.vcxproj => mod_db.2017.vcxproj} (93%)
 rename src/mod/applications/mod_directory/{mod_directory.2015.vcxproj => mod_directory.2017.vcxproj} (94%)
 rename src/mod/applications/mod_distributor/{mod_distributor.2015.vcxproj => mod_distributor.2017.vcxproj} (93%)
 rename src/mod/applications/mod_dptools/{mod_dptools.2015.vcxproj => mod_dptools.2017.vcxproj} (94%)
 rename src/mod/applications/mod_easyroute/{mod_easyroute.2015.vcxproj => mod_easyroute.2017.vcxproj} (93%)
 rename src/mod/applications/mod_enum/{mod_enum.2015.vcxproj => mod_enum.2017.vcxproj} (94%)
 rename src/mod/applications/mod_esf/{mod_esf.2015.vcxproj => mod_esf.2017.vcxproj} (93%)
 rename src/mod/applications/mod_expr/{mod_expr.2015.vcxproj => mod_expr.2017.vcxproj} (94%)
 rename src/mod/applications/mod_fifo/{mod_fifo.2015.vcxproj => mod_fifo.2017.vcxproj} (93%)
 rename src/mod/applications/mod_fsv/{mod_fsv.2015.vcxproj => mod_fsv.2017.vcxproj} (93%)
 rename src/mod/applications/mod_hash/{mod_hash.2015.vcxproj => mod_hash.2017.vcxproj} (94%)
 rename src/mod/applications/mod_httapi/{mod_httapi.2015.vcxproj => mod_httapi.2017.vcxproj} (94%)
 rename src/mod/applications/mod_http_cache/{mod_http_cache.vcxproj => mod_http_cache.2017.vcxproj} (96%)
 rename src/mod/applications/mod_lcr/{mod_lcr.2015.vcxproj => mod_lcr.2017.vcxproj} (93%)
 rename src/mod/applications/mod_nibblebill/{mod_nibblebill.2015.vcxproj => mod_nibblebill.2017.vcxproj} (93%)
 rename src/mod/applications/mod_redis/{mod_redis.2015.vcxproj => mod_redis.2017.vcxproj} (95%)
 rename src/mod/applications/mod_rss/{mod_rss.2015.vcxproj => mod_rss.2017.vcxproj} (93%)
 rename src/mod/applications/mod_skel/{mod_skel.2015.vcxproj => mod_skel.2017.vcxproj} (93%)
 rename src/mod/applications/mod_sms/{mod_sms.2015.vcxproj => mod_sms.2017.vcxproj} (93%)
 rename src/mod/applications/mod_snom/{mod_snom.2015.vcxproj => mod_snom.2017.vcxproj} (94%)
 rename src/mod/applications/mod_spandsp/{mod_spandsp.2015.vcxproj => mod_spandsp.2017.vcxproj} (95%)
 rename src/mod/applications/mod_spy/{mod_spy.2015.vcxproj => mod_spy.2017.vcxproj} (93%)
 rename src/mod/applications/mod_valet_parking/{mod_valet_parking.2015.vcxproj => mod_valet_parking.2017.vcxproj} (93%)
 rename src/mod/applications/mod_vmd/{mod_vmd.2015.vcxproj => mod_vmd.2017.vcxproj} (93%)
 rename src/mod/applications/mod_voicemail/{mod_voicemail.2015.vcxproj => mod_voicemail.2017.vcxproj} (93%)
 rename src/mod/asr_tts/mod_cepstral/{mod_cepstral.2015.vcxproj => mod_cepstral.2017.vcxproj} (94%)
 rename src/mod/asr_tts/mod_flite/{mod_flite.2015.vcxproj => mod_flite.2017.vcxproj} (94%)
 rename src/mod/asr_tts/mod_pocketsphinx/{mod_pocketsphinx.2015.vcxproj => mod_pocketsphinx.2017.vcxproj} (95%)
 rename src/mod/asr_tts/mod_unimrcp/{mod_unimrcp.2015.vcxproj => mod_unimrcp.2017.vcxproj} (92%)
 rename src/mod/codecs/mod_amr/{mod_amr.2015.vcxproj => mod_amr.2017.vcxproj} (95%)
 rename src/mod/codecs/mod_bv/{mod_bv.2015.vcxproj => mod_bv.2017.vcxproj} (93%)
 rename src/mod/codecs/mod_codec2/{mod_codec2.vcxproj => mod_codec2.2017.vcxproj} (95%)
 rename src/mod/codecs/mod_g723_1/{mod_g723_1.2015.vcxproj => mod_g723_1.2017.vcxproj} (95%)
 rename src/mod/codecs/mod_g729/{mod_g729.2015.vcxproj => mod_g729.2017.vcxproj} (95%)
 rename src/mod/codecs/mod_h26x/{mod_h26x.2015.vcxproj => mod_h26x.2017.vcxproj} (94%)
 rename src/mod/codecs/mod_ilbc/{mod_ilbc.2015.vcxproj => mod_ilbc.2017.vcxproj} (93%)
 rename src/mod/codecs/mod_isac/{mod_iSAC.2015.vcxproj => mod_iSAC.2017.vcxproj} (95%)
 rename src/mod/codecs/mod_opus/{mod_opus.2015.vcxproj => mod_opus.2017.vcxproj} (93%)
 rename src/mod/codecs/mod_silk/{mod_silk.2015.vcxproj => mod_silk.2017.vcxproj} (93%)
 rename src/mod/codecs/mod_siren/{mod_siren.2015.vcxproj => mod_siren.2017.vcxproj} (93%)
 rename src/mod/dialplans/mod_dialplan_asterisk/{mod_dialplan_asterisk.2015.vcxproj => mod_dialplan_asterisk.2017.vcxproj} (93%)
 rename src/mod/dialplans/mod_dialplan_directory/{mod_dialplan_directory.2015.vcxproj => mod_dialplan_directory.2017.vcxproj} (93%)
 rename src/mod/dialplans/mod_dialplan_xml/{mod_dialplan_xml.2015.vcxproj => mod_dialplan_xml.2017.vcxproj} (93%)
 rename src/mod/directories/mod_ldap/{mod_ldap.2015.vcxproj => mod_ldap.2017.vcxproj} (95%)
 rename src/mod/endpoints/mod_dingaling/{mod_dingaling.2015.vcxproj => mod_dingaling.2017.vcxproj} (94%)
 rename src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/{gsmlib.2015.vcxproj => gsmlib.2017.vcxproj} (96%)
 rename src/mod/endpoints/mod_gsmopen/{mod_gsmopen.2015.vcxproj => mod_gsmopen.2017.vcxproj} (94%)
 rename src/mod/endpoints/mod_h323/{mod_h323.2015.vcxproj => mod_h323.2017.vcxproj} (95%)
 rename src/mod/endpoints/mod_loopback/{mod_loopback.2015.vcxproj => mod_loopback.2017.vcxproj} (94%)
 rename src/mod/endpoints/mod_opal/{mod_opal.2015.vcxproj => mod_opal.2017.vcxproj} (94%)
 rename src/mod/endpoints/mod_portaudio/{mod_PortAudio.2015.vcxproj => mod_PortAudio.2017.vcxproj} (95%)
 rename src/mod/endpoints/mod_rtc/{mod_rtc.2015.vcxproj => mod_rtc.2017.vcxproj} (93%)
 rename src/mod/endpoints/mod_rtmp/{mod_rtmp.2015.vcxproj => mod_rtmp.2017.vcxproj} (95%)
 rename src/mod/endpoints/mod_skinny/{mod_skinny.2015.vcxproj => mod_skinny.2017.vcxproj} (95%)
 rename src/mod/endpoints/mod_sofia/{mod_sofia.2015.vcxproj => mod_sofia.2017.vcxproj} (96%)
 rename src/mod/endpoints/mod_verto/{mod_verto.2015.vcxproj => mod_verto.2017.vcxproj} (95%)
 rename src/mod/event_handlers/mod_amqp/{mod_amqp.2015.vcxproj => mod_amqp.2017.vcxproj} (96%)
 rename src/mod/event_handlers/mod_cdr_csv/{mod_cdr_csv.2015.vcxproj => mod_cdr_csv.2017.vcxproj} (93%)
 rename src/mod/event_handlers/mod_cdr_pg_csv/{mod_cdr_pg_csv.2015.vcxproj => mod_cdr_pg_csv.2017.vcxproj} (95%)
 rename src/mod/event_handlers/mod_cdr_sqlite/{mod_cdr_sqlite.2015.vcxproj => mod_cdr_sqlite.2017.vcxproj} (95%)
 rename src/mod/event_handlers/mod_event_multicast/{mod_event_multicast.2015.vcxproj => mod_event_multicast.2017.vcxproj} (93%)
 rename src/mod/event_handlers/mod_event_socket/{mod_event_socket.2015.vcxproj => mod_event_socket.2017.vcxproj} (93%)
 rename src/mod/event_handlers/mod_odbc_cdr/{mod_odbc_cdr.2015.vcxproj => mod_odbc_cdr.2017.vcxproj} (96%)
 rename src/mod/formats/mod_local_stream/{mod_local_stream.2015.vcxproj => mod_local_stream.2017.vcxproj} (93%)
 rename src/mod/formats/mod_native_file/{mod_native_file.2015.vcxproj => mod_native_file.2017.vcxproj} (93%)
 rename src/mod/formats/mod_png/{mod_png.2015.vcxproj => mod_png.2017.vcxproj} (96%)
 rename src/mod/formats/mod_shout/{mod_shout.2015.vcxproj => mod_shout.2017.vcxproj} (94%)
 rename src/mod/formats/mod_sndfile/{mod_sndfile.2015.vcxproj => mod_sndfile.2017.vcxproj} (93%)
 rename src/mod/formats/mod_tone_stream/{mod_tone_stream.2015.vcxproj => mod_tone_stream.2017.vcxproj} (93%)
 rename src/mod/languages/mod_lua/{mod_lua.2015.vcxproj => mod_lua.2017.vcxproj} (95%)
 rename src/mod/languages/mod_managed/managed/{FreeSWITCH.Managed.2015.csproj => FreeSWITCH.Managed.2017.csproj} (97%)
 rename src/mod/languages/mod_managed/{mod_managed.2015.vcxproj => mod_managed.2017.vcxproj} (95%)
 rename src/mod/languages/mod_v8/{mod_v8.2015.vcxproj => mod_v8.2017.vcxproj} (95%)
 rename src/mod/languages/mod_v8/{mod_v8_skel.2015.vcxproj => mod_v8_skel.2017.vcxproj} (94%)
 rename src/mod/loggers/mod_console/{mod_console.2015.vcxproj => mod_console.2017.vcxproj} (93%)
 rename src/mod/loggers/mod_logfile/{mod_logfile.2015.vcxproj => mod_logfile.2017.vcxproj} (93%)
 rename src/mod/say/mod_say_de/{mod_say_de.2015.vcxproj => mod_say_de.2017.vcxproj} (93%)
 rename src/mod/say/mod_say_en/{mod_say_en.2015.vcxproj => mod_say_en.2017.vcxproj} (93%)
 rename src/mod/say/mod_say_es/{mod_say_es.2015.vcxproj => mod_say_es.2017.vcxproj} (93%)
 rename src/mod/say/mod_say_es_ar/{mod_say_es_ar.2015.vcxproj => mod_say_es_ar.2017.vcxproj} (95%)
 rename src/mod/say/mod_say_fa/{mod_say_fa.2015.vcxproj => mod_say_fa.2017.vcxproj} (95%)
 rename src/mod/say/mod_say_fr/{mod_say_fr.2015.vcxproj => mod_say_fr.2017.vcxproj} (93%)
 rename src/mod/say/mod_say_he/{mod_say_he.2015.vcxproj => mod_say_he.2017.vcxproj} (95%)
 rename src/mod/say/mod_say_hr/{mod_say_hr.2015.vcxproj => mod_say_hr.2017.vcxproj} (95%)
 rename src/mod/say/mod_say_hu/{mod_say_hu.2015.vcxproj => mod_say_hu.2017.vcxproj} (95%)
 rename src/mod/say/mod_say_it/{mod_say_it.2015.vcxproj => mod_say_it.2017.vcxproj} (93%)
 rename src/mod/say/mod_say_ja/{mod_say_ja.2015.vcxproj => mod_say_ja.2017.vcxproj} (95%)
 rename src/mod/say/mod_say_nl/{mod_say_nl.2015.vcxproj => mod_say_nl.2017.vcxproj} (94%)
 rename src/mod/say/mod_say_pl/{mod_say_pl.2015.vcxproj => mod_say_pl.2017.vcxproj} (95%)
 rename src/mod/say/mod_say_pt/{mod_say_pt.2015.vcxproj => mod_say_pt.2017.vcxproj} (93%)
 rename src/mod/say/mod_say_ru/{mod_say_ru.2015.vcxproj => mod_say_ru.2017.vcxproj} (93%)
 rename src/mod/say/mod_say_sv/{mod_say_sv.2015.vcxproj => mod_say_sv.2017.vcxproj} (93%)
 rename src/mod/say/mod_say_th/{mod_say_th.2015.vcxproj => mod_say_th.2017.vcxproj} (95%)
 rename src/mod/say/mod_say_zh/{mod_say_zh.2015.vcxproj => mod_say_zh.2017.vcxproj} (93%)
 rename src/mod/xml_int/mod_xml_cdr/{mod_xml_cdr.2015.vcxproj => mod_xml_cdr.2017.vcxproj} (93%)
 rename src/mod/xml_int/mod_xml_curl/{mod_xml_curl.2015.vcxproj => mod_xml_curl.2017.vcxproj} (92%)
 rename src/mod/xml_int/mod_xml_rpc/{mod_xml_rpc.2015.vcxproj => mod_xml_rpc.2017.vcxproj} (94%)
 rename w32/Console/{FreeSwitchConsole.2015.vcxproj => FreeSwitchConsole.2017.vcxproj} (95%)
 rename w32/Library/{FreeSwitchCore.2015.vcxproj => FreeSwitchCore.2017.vcxproj} (97%)
 rename w32/Setup/{Product.2015.wxs => Product.2017.wxs} (97%)
 rename w32/Setup/{Setup.2015.wixproj => Setup.2017.wixproj} (92%)

diff --git a/Freeswitch.2015.sln.bat b/Freeswitch.2015.sln.bat
deleted file mode 100644
index 35d28de1d6..0000000000
--- a/Freeswitch.2015.sln.bat
+++ /dev/null
@@ -1,88 +0,0 @@
-@REM this script builds freeswitch using VS2015
-@REM only one platform/configuration will be built
-@REM runs (probably only) from the commandline
-@REM usage: Freeswitch.2015.sln  [[[.*]ebug] [[.*]elease] [[.*]64] [[.*]32]]
-@REM e.g. Freeswitch.2015.sln Debug x64
-@REM      Freeswitch.2015.sln x64
-@REM 	  Freeswitch.2015.sln Debug
-@REM 	  Freeswitch.2015.sln
-
-@setlocal
-@echo on
-
-@REM default build
-@REM change these variables if you want to build differently by default
-@set configuration=Release
-@set platform=Win32
-
-
-@REM if commandline parameters contain "ebug" and/or "64 and/or 32"
-@REM set the configuration/platform to Debug and/or x64 and/or 32
-@if "%1"=="" (
-	@goto :paramsset
-)
-
-@set params=%*
-@set xparams=x%params: =%
-@if not y%xparams:ebug=%==y%xparams% (
-	set configuration=Debug
-)
-
-@if not x%xparams:64=%==x%xparams% (
-	set platform=x64
-)
-
-@if not x%xparams:32=%==x%xparams% (
-	set platform=Win32
-)
-
-@if not y%xparams:elease=%==y%xparams% (
-	set configuration=Debug
-)
-
-:paramsset
-
-@REM use all processors minus 1 when building
-@REM hmm, this doesn't seem to work as I expected as all my procs are used during the build
-@set procs=%NUMBER_OF_PROCESSORS%
-@set /a procs -= 1
-
-@REM check and set VS2015 environment
-@REM vcvars32.bat calls exit and will also exit whilie running this bat file ...
-@REM so you have to run it again if the VS2015 env is not yet set
-@if "%VS110COMNTOOLS%"=="" (
-	goto :error_no_VS110COMNTOOLSDIR
-)
-
-@if "%VSINSTALLDIR%"=="" (
-	goto :setvcvars
-)
-
-:build
-
-msbuild Freeswitch.2015.sln /m:%procs% /verbosity:normal /property:Configuration=%configuration% /property:Platform=%platform% /fl /flp:logfile=vs2015%platform%%configuration%.log;verbosity=normal
-@goto :end
-
-@REM -----------------------------------------------------------------------
-:setvcvars
-	@endlocal
-	@echo Now setting Visual Studio 2015 Environment
-	@call "%VS110COMNTOOLS%vsvars32"
-	@REM in order to prevent running vsvars32 multiple times and at the same time not
-	@REM cluttering up the environment variables proc/configuration/platform
-	@REM it is necessary to start the script again
-	@echo Run the script %0 again (and/or open a command prompt)
-	@goto :end
-
-:error_no_VS110COMNTOOLSDIR
-	@echo ERROR: Cannot determine the location of the VS2015 Common Tools folder.
-	@echo ERROR: Note this script will not work in a git bash environment
-	@goto :end
-
-:end
-@pause
-
-@REM ------ terminate :end with LF otherwise the label is not recognized by the command processor -----
-
-
-
diff --git a/Freeswitch.2015.sln b/Freeswitch.2017.sln
similarity index 93%
rename from Freeswitch.2015.sln
rename to Freeswitch.2017.sln
index f8eabfd0a0..d3d520bed1 100644
--- a/Freeswitch.2015.sln
+++ b/Freeswitch.2017.sln
@@ -1,3193 +1,3196 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Endpoints", "Endpoints", "{9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dialplans", "Dialplans", "{C5F182F9-754A-4EC5-B50F-76ED02BE13F4}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Event Handlers", "Event Handlers", "{9ADF1E48-2F5C-4ED7-A893-596259FABFE0}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Formats", "Formats", "{A5A27244-AD24-46E5-B01B-840CD296C91D}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{CBD81696-EFB4-4D2F-8451-1B8DAA86155A}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Directories", "Directories", "{B8F5B47B-8568-46EB-B320-64C17D2A98BC}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Languages", "Languages", "{0C808854-54D1-4230-BFF5-77B5FD905000}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ASR-TTS", "ASR-TTS", "{4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Loggers", "Loggers", "{A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XML Interfaces", "XML Interfaces", "{F69A4A6B-9360-4EBB-A280-22AA3C455AC5}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Libraries", "_Libraries", "{EB910B0D-F27D-4B62-B67B-DE834C99AC5B}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Downloads", "_Downloads", "{C120A020-773F-4EA3-923F-B67AF28B750D}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "say", "say", "{6CD61A1D-797C-470A-BE08-8C31B68BB336}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Config", "_Config", "{57D119DC-484F-420F-B9E9-8589FD9A8DF8}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Default", "Default", "{3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\freeswitch.xml = conf\vanilla\freeswitch.xml
-		conf\vanilla\vars.xml = conf\vanilla\vars.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Build System", "_Build System", "{DB1024A8-41BF-4AD7-9AE6-13202230D1F3}"
-	ProjectSection(SolutionItems) = preProject
-		acsite.m4 = acsite.m4
-		bootstrap.sh = bootstrap.sh
-		build\buildlib.sh = build\buildlib.sh
-		configure.in = configure.in
-		Makefile.am = Makefile.am
-		build\modmake.rules.in = build\modmake.rules.in
-		build\modules.conf.in = build\modules.conf.in
-		libs\win32\util.vbs = libs\win32\util.vbs
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "m4", "m4", "{CDE9B06A-3C27-4987-8FAE-DF1006BC705D}"
-	ProjectSection(SolutionItems) = preProject
-		build\config\ac_cflags_gcc_option.m4 = build\config\ac_cflags_gcc_option.m4
-		build\config\ac_cflags_sun_option.m4 = build\config\ac_cflags_sun_option.m4
-		build\config\ac_gcc_archflag.m4 = build\config\ac_gcc_archflag.m4
-		build\config\ac_gcc_x86_cpuid.m4 = build\config\ac_gcc_x86_cpuid.m4
-		build\config\ac_prog_gzip.m4 = build\config\ac_prog_gzip.m4
-		build\config\ac_prog_wget.m4 = build\config\ac_prog_wget.m4
-		build\config\ax_cc_maxopt.m4 = build\config\ax_cc_maxopt.m4
-		build\config\ax_cflags_warn_all_ansi.m4 = build\config\ax_cflags_warn_all_ansi.m4
-		build\config\ax_check_compiler_flags.m4 = build\config\ax_check_compiler_flags.m4
-		build\config\ax_compiler_vendor.m4 = build\config\ax_compiler_vendor.m4
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs", "autoload_configs", "{3C90CCF0-2CDD-4A7A-ACFF-208C1E271692}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\autoload_configs\alsa.conf.xml = conf\vanilla\autoload_configs\alsa.conf.xml
-		conf\vanilla\autoload_configs\conference.conf.xml = conf\vanilla\autoload_configs\conference.conf.xml
-		conf\vanilla\autoload_configs\console.conf.xml = conf\vanilla\autoload_configs\console.conf.xml
-		conf\vanilla\autoload_configs\dialplan_directory.conf.xml = conf\vanilla\autoload_configs\dialplan_directory.conf.xml
-		conf\vanilla\autoload_configs\dingaling.conf.xml = conf\vanilla\autoload_configs\dingaling.conf.xml
-		conf\vanilla\autoload_configs\enum.conf.xml = conf\vanilla\autoload_configs\enum.conf.xml
-		conf\vanilla\autoload_configs\event_multicast.conf.xml = conf\vanilla\autoload_configs\event_multicast.conf.xml
-		conf\vanilla\autoload_configs\event_socket.conf.xml = conf\vanilla\autoload_configs\event_socket.conf.xml
-		conf\vanilla\autoload_configs\ivr.conf.xml = conf\vanilla\autoload_configs\ivr.conf.xml
-		conf\vanilla\autoload_configs\java.conf.xml = conf\vanilla\autoload_configs\java.conf.xml
-		conf\vanilla\autoload_configs\limit.conf.xml = conf\vanilla\autoload_configs\limit.conf.xml
-		conf\vanilla\autoload_configs\local_stream.conf.xml = conf\vanilla\autoload_configs\local_stream.conf.xml
-		conf\vanilla\autoload_configs\logfile.conf.xml = conf\vanilla\autoload_configs\logfile.conf.xml
-		conf\vanilla\autoload_configs\modules.conf.xml = conf\vanilla\autoload_configs\modules.conf.xml
-		conf\vanilla\autoload_configs\openmrcp.conf.xml = conf\vanilla\autoload_configs\openmrcp.conf.xml
-		conf\vanilla\autoload_configs\portaudio.conf.xml = conf\vanilla\autoload_configs\portaudio.conf.xml
-		conf\vanilla\autoload_configs\rss.conf.xml = conf\vanilla\autoload_configs\rss.conf.xml
-		conf\vanilla\autoload_configs\sofia.conf.xml = conf\vanilla\autoload_configs\sofia.conf.xml
-		conf\vanilla\autoload_configs\switch.conf.xml = conf\vanilla\autoload_configs\switch.conf.xml
-		conf\vanilla\autoload_configs\syslog.conf.xml = conf\vanilla\autoload_configs\syslog.conf.xml
-		conf\vanilla\autoload_configs\v8.conf.xml = conf\vanilla\autoload_configs\v8.conf.xml
-		conf\vanilla\autoload_configs\voicemail.conf.xml = conf\vanilla\autoload_configs\voicemail.conf.xml
-		conf\vanilla\autoload_configs\wanpipe.conf.xml = conf\vanilla\autoload_configs\wanpipe.conf.xml
-		conf\vanilla\autoload_configs\woomera.conf.xml = conf\vanilla\autoload_configs\woomera.conf.xml
-		conf\vanilla\autoload_configs\xml_cdr.conf.xml = conf\vanilla\autoload_configs\xml_cdr.conf.xml
-		conf\vanilla\autoload_configs\xml_curl.conf.xml = conf\vanilla\autoload_configs\xml_curl.conf.xml
-		conf\vanilla\autoload_configs\xml_rpc.conf.xml = conf\vanilla\autoload_configs\xml_rpc.conf.xml
-		conf\vanilla\autoload_configs\zeroconf.conf.xml = conf\vanilla\autoload_configs\zeroconf.conf.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{C7E2382E-2C22-4D18-BF93-80C6A1FFA7AC}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\dialplan\default.xml = conf\vanilla\dialplan\default.xml
-		conf\vanilla\dialplan\public.xml = conf\vanilla\dialplan\public.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory", "directory", "{FC71C66E-E268-4EAD-B1F5-F008DC382E83}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\directory\default.xml = conf\vanilla\directory\default.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles", "sip_profiles", "{8E2E8798-8B6F-4A55-8E4F-4E6FDE40ED26}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\sip_profiles\external.xml = conf\vanilla\sip_profiles\external.xml
-		conf\vanilla\sip_profiles\internal.xml = conf\vanilla\sip_profiles\internal.xml
-		conf\vanilla\sip_profiles\nat.xml = conf\vanilla\sip_profiles\nat.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang", "lang", "{09455AA9-C243-4F16-A1A1-A016881A2765}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\directory\default.xml = conf\vanilla\directory\default.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "en", "en", "{57199684-EC63-4A60-9DC6-11815AF6B413}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\lang\en\en.xml = conf\vanilla\lang\en\en.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de", "de", "{2DED4BA2-D6B0-4064-BB2A-76DE3AA49E7C}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\lang\de\de.xml = conf\vanilla\lang\de\de.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr", "fr", "{D4A12E4C-DBDA-4614-BA26-3425AE9F60F5}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\lang\fr\fr.xml = conf\vanilla\lang\fr\fr.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{D3E5C8ED-3A6A-4FEA-92A2-48A0BA865358}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\lang\de\demo\demo.xml = conf\vanilla\lang\de\demo\demo.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{CC3E7F48-2590-49CB-AD8B-BE3650F55462}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\lang\de\vm\tts.xml = conf\vanilla\lang\de\vm\tts.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{765EF1B9-5027-4820-BC37-A44466A51631}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\lang\en\demo\demo.xml = conf\vanilla\lang\en\demo\demo.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{713E4747-1126-40B1-BD84-58F9A7745423}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\lang\en\vm\sounds.xml = conf\vanilla\lang\en\vm\sounds.xml
-		conf\vanilla\lang\en\vm\tts.xml = conf\vanilla\lang\en\vm\tts.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{F1B71990-EB04-4EB5-B28A-BC3EB6F7E843}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\lang\fr\demo\demo.xml = conf\vanilla\lang\fr\demo\demo.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{3DAF028C-AB5B-4183-A01B-DCC43F5A87F0}"
-	ProjectSection(SolutionItems) = preProject
-		conf\vanilla\lang\fr\vm\sounds.xml = conf\vanilla\lang\fr\vm\sounds.xml
-	EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sound Files", "Sound Files", "{4F227C26-768F-46A3-8684-1D08A46FB374}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unimrcp", "unimrcp", "{62F27B1A-C919-4A70-8478-51F178F3B18F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchConsole", "w32\Console\FreeSwitchConsole.2015.vcxproj", "{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchCoreLib", "w32\Library\FreeSwitchCore.2015.vcxproj", "{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g729", "src\mod\codecs\mod_g729\mod_g729.2015.vcxproj", "{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sndfile", "src\mod\formats\mod_sndfile\mod_sndfile.2015.vcxproj", "{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_PortAudio", "src\mod\endpoints\mod_portaudio\mod_PortAudio.2015.vcxproj", "{5FD31A25-5D83-4794-8BEE-904DAD84CE71}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "docs", "docs\docs.2015.vcxproj", "{1A1FF289-4FD6-4285-A422-D31DD67A4723}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_xml", "src\mod\dialplans\mod_dialplan_xml\mod_dialplan_xml.2015.vcxproj", "{07113B25-D3AF-4E04-BA77-4CD1171F022C}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ldap", "src\mod\directories\mod_ldap\mod_ldap.2015.vcxproj", "{EC3E5C7F-EE09-47E2-80FE-546363D14A98}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_directory", "src\mod\dialplans\mod_dialplan_directory\mod_dialplan_directory.2015.vcxproj", "{A27CCA23-1541-4337-81A4-F0A6413078A0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_multicast", "src\mod\event_handlers\mod_event_multicast\mod_event_multicast.2015.vcxproj", "{784113EF-44D9-4949-835D-7065D3C7AD08}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libteletone", "libs\libteletone\libteletone.2015.vcxproj", "{89385C74-5860-4174-9CAF-A39E7C48909C}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_v8", "src\mod\languages\mod_v8\mod_v8.2015.vcxproj", "{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_v8_skel", "src\mod\languages\mod_v8\mod_v8_skel.2015.vcxproj", "{8B754330-A434-4791-97E5-1EE67060BAC0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cepstral", "src\mod\asr_tts\mod_cepstral\mod_cepstral.2015.vcxproj", "{692F6330-4D87-4C82-81DF-40DB5892636E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ilbc", "src\mod\codecs\mod_ilbc\mod_ilbc.2015.vcxproj", "{D3EC0AFF-76FC-4210-A825-9A17410660A3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dingaling", "src\mod\endpoints\mod_dingaling\mod_dingaling.2015.vcxproj", "{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_commands", "src\mod\applications\mod_commands\mod_commands.2015.vcxproj", "{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_console", "src\mod\loggers\mod_console\mod_console.2015.vcxproj", "{1C453396-D912-4213-89FD-9B489162B7B5}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_rpc", "src\mod\xml_int\mod_xml_rpc\mod_xml_rpc.2015.vcxproj", "{CBEC7225-0C21-4DA8-978E-1F158F8AD950}"
-	ProjectSection(ProjectDependencies) = postProject
-		{BED7539C-0099-4A14-AD5D-30828F15A171} = {BED7539C-0099-4A14-AD5D-30828F15A171}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rss", "src\mod\applications\mod_rss\mod_rss.2015.vcxproj", "{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_conference", "src\mod\applications\mod_conference\mod_conference.2015.vcxproj", "{C24FB505-05D7-4319-8485-7540B44C8603}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dptools", "src\mod\applications\mod_dptools\mod_dptools.2015.vcxproj", "{B5881A85-FE70-4F64-8607-2CAAE52669C6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_socket", "src\mod\event_handlers\mod_event_socket\mod_event_socket.2015.vcxproj", "{05515420-16DE-4E63-BE73-85BE85BA5142}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdingaling", "libs\libdingaling\libdingaling.2015.vcxproj", "{1906D736-08BD-4EE1-924F-B536249B9A54}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsrtp", "libs\srtp\libsrtp.2015.vcxproj", "{EEF031CB-FED8-451E-A471-91EC8D4F6750}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsqlite", "libs\win32\sqlite\sqlite.2015.vcxproj", "{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libapr", "libs\win32\apr\libapr.2015.vcxproj", "{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "libs\win32\apr-util\libaprutil.2015.vcxproj", "{F057DA7F-79E5-4B00-845C-EF446EF055E3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iksemel", "libs\win32\iksemel\iksemel.2015.vcxproj", "{E727E8F6-935D-46FE-8B0E-37834748A0E3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "libs\win32\apr-util\xml.2015.vcxproj", "{155844C3-EC5F-407F-97A4-A2DDADED9B2F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sofia", "src\mod\endpoints\mod_sofia\mod_sofia.2015.vcxproj", "{0DF3ABD0-DDC0-4265-B778-07C66780979B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PTHREAD", "libs\win32\Download PTHREAD.2015.vcxproj", "{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pthread", "libs\win32\pthread\pthread.2015.vcxproj", "{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g723_1", "src\mod\codecs\mod_g723_1\mod_g723_1.2015.vcxproj", "{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_iSAC", "src\mod\codecs\mod_isac\mod_iSAC.2015.vcxproj", "{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_native_file", "src\mod\formats\mod_native_file\mod_native_file.2015.vcxproj", "{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libudns", "libs\win32\udns\libudns.2015.vcxproj", "{4043FC6A-9A30-4577-8AD5-9B233C9575D8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_enum", "src\mod\applications\mod_enum\mod_enum.2015.vcxproj", "{71A967D5-0E99-4CEF-A587-98836EE6F2EF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_curl", "src\mod\xml_int\mod_xml_curl\mod_xml_curl.2015.vcxproj", "{AB91A099-7690-4ECF-8994-E458F4EA1ED4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_en", "src\mod\say\mod_say_en\mod_say_en.2015.vcxproj", "{988CACF7-3FCB-4992-BE69-77872AE67DC8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "libs\win32\portaudio\portaudio.2015.vcxproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_cdr", "src\mod\xml_int\mod_xml_cdr\mod_xml_cdr.2015.vcxproj", "{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_amr", "src\mod\codecs\mod_amr\mod_amr.2015.vcxproj", "{8DEB383C-4091-4F42-A56F-C9E46D552D79}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_h26x", "src\mod\codecs\mod_h26x\mod_h26x.2015.vcxproj", "{2C3C2423-234B-4772-8899-D3B137E5CA35}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_esf", "src\mod\applications\mod_esf\mod_esf.2015.vcxproj", "{3850D93A-5F24-4922-BC1C-74D08C37C256}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_local_stream", "src\mod\formats\mod_local_stream\mod_local_stream.2015.vcxproj", "{2CA40887-1622-46A1-A7F9-17FD7E7E545B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_voicemail", "src\mod\applications\mod_voicemail\mod_voicemail.2015.vcxproj", "{D7F1E3F2-A3F4-474C-8555-15122571AF52}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_de", "src\mod\say\mod_say_de\mod_say_de.2015.vcxproj", "{5BC072DB-3826-48EA-AF34-FE32AA01E83B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_es", "src\mod\say\mod_say_es\mod_say_es.2015.vcxproj", "{FA429E98-8B03-45E6-A096-A4BC5E821DE4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_fr", "src\mod\say\mod_say_fr\mod_say_fr.2015.vcxproj", "{06E3A538-AB32-44F2-B477-755FF9CB5D37}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_it", "src\mod\say\mod_say_it\mod_say_it.2015.vcxproj", "{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_nl", "src\mod\say\mod_say_nl\mod_say_nl.2015.vcxproj", "{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_fifo", "src\mod\applications\mod_fifo\mod_fifo.2015.vcxproj", "{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_db", "src\mod\applications\mod_db\mod_db.2015.vcxproj", "{F6A33240-8F29-48BD-98F0-826995911799}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_expr", "src\mod\applications\mod_expr\mod_expr.2015.vcxproj", "{65A6273D-FCAB-4C55-B09E-65100141A5D4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_asterisk", "src\mod\dialplans\mod_dialplan_asterisk\mod_dialplan_asterisk.2015.vcxproj", "{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_logfile", "src\mod\loggers\mod_logfile\mod_logfile.2015.vcxproj", "{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr_csv", "src\mod\event_handlers\mod_cdr_csv\mod_cdr_csv.2015.vcxproj", "{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_tone_stream", "src\mod\formats\mod_tone_stream\mod_tone_stream.2015.vcxproj", "{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_fsv", "src\mod\applications\mod_fsv\mod_fsv.2015.vcxproj", "{E3246D17-E29B-4AB5-962A-C69B0C5837BB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_lua", "src\mod\languages\mod_lua\mod_lua.2015.vcxproj", "{7B077E7F-1BE7-4291-AB86-55E527B25CAC}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download sphinxbase", "libs\win32\Download sphinxbase.2015.vcxproj", "{4F92B672-DADB-4047-8D6A-4BB3796733FD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download sphinxmodel", "libs\win32\Download sphinxmodel.2015.vcxproj", "{2DEE4895-1134-439C-B688-52203E57D878}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download pocketsphinx", "libs\win32\Download pocketsphinx.2015.vcxproj", "{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sphinxbase", "libs\win32\sphinxbase\sphinxbase.2015.vcxproj", "{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pocketsphinx", "libs\win32\pocketsphinx\pocketsphinx.2015.vcxproj", "{94001A0E-A837-445C-8004-F918F10D0226}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_pocketsphinx", "src\mod\asr_tts\mod_pocketsphinx\mod_pocketsphinx.2015.vcxproj", "{2286DA73-9FC5-45BC-A508-85994C3317AB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 8khzsound", "libs\win32\Download 8khz Sounds.2015.vcxproj", "{3CE1DC99-8246-4DB1-A709-74F19F08EC67}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 16khzsound", "libs\win32\Download 16khz Sounds.2015.vcxproj", "{87A1FE3D-F410-4C8E-9591-8C625985BC70}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "8khz", "libs\win32\Sound_Files\8khz.2015.vcxproj", "{7A8D8174-B355-4114-AFC1-04777CB9DE0A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16khz", "libs\win32\Sound_Files\16khz.2015.vcxproj", "{7EB71250-F002-4ED8-92CA-CA218114537A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 32khzsound", "libs\win32\Download 32khz Sounds.2015.vcxproj", "{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "32khz", "libs\win32\Sound_Files\32khz.2015.vcxproj", "{464AAB78-5489-4916-BE51-BF8D61822311}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_flite", "src\mod\asr_tts\mod_flite\mod_flite.2015.vcxproj", "{66444AEE-554C-11DD-A9F0-8C5D56D89593}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download LAME", "libs\win32\Download LAME.2015.vcxproj", "{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download LIBSHOUT", "libs\win32\Download LIBSHOUT.2015.vcxproj", "{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download OGG", "libs\win32\Download OGG.2015.vcxproj", "{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp3lame", "libs\win32\libmp3lame\libmp3lame.2015.vcxproj", "{E316772F-5D8F-4F2A-8F71-094C3E859D34}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libshout", "libs\win32\libshout\libshout.2015.vcxproj", "{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_shout", "src\mod\formats\mod_shout\mod_shout.2015.vcxproj", "{38FE0559-9910-43A8-9E45-3E5004C27692}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libogg", "libs\win32\libogg\libogg.2015.vcxproj", "{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_snom", "src\mod\applications\mod_snom\mod_snom.2015.vcxproj", "{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_zh", "src\mod\say\mod_say_zh\mod_say_zh.2015.vcxproj", "{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_managed", "src\mod\languages\mod_managed\mod_managed.2015.vcxproj", "{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSWITCH.Managed.2015", "src\mod\languages\mod_managed\managed\FreeSWITCH.Managed.2015.csproj", "{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download mpg123", "libs\win32\Download mpg123.2015.vcxproj", "{E796E337-DE78-4303-8614-9A590862EE95}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpg123", "libs\win32\mpg123\libmpg123.2015.vcxproj", "{419C8F80-D858-4B48-A25C-AF4007608137}"
-	ProjectSection(ProjectDependencies) = postProject
-		{E796E337-DE78-4303-8614-9A590862EE95} = {E796E337-DE78-4303-8614-9A590862EE95}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_loopback", "src\mod\endpoints\mod_loopback\mod_loopback.2015.vcxproj", "{B3F424EC-3D8F-417C-B244-3919D5E1A577}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_vmd", "src\mod\applications\mod_vmd\mod_vmd.2015.vcxproj", "{14E4A972-9CFB-436D-B0A5-4943F3F80D47}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg722_1", "libs\win32\libg722_1\libg722_1.2015.vcxproj", "{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_siren", "src\mod\codecs\mod_siren\mod_siren.2015.vcxproj", "{0B6C905B-142E-4999-B39D-92FF7951E921}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libesl", "libs\esl\src\libesl.2015.vcxproj", "{CF405366-9558-4AE8-90EF-5E21B51CCB4E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fs_cli", "libs\esl\fs_cli.2015.vcxproj", "{D2FB8043-D208-4AEE-8F18-3B5857C871B9}"
-	ProjectSection(ProjectDependencies) = postProject
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_easyroute", "src\mod\applications\mod_easyroute\mod_easyroute.2015.vcxproj", "{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_lcr", "src\mod\applications\mod_lcr\mod_lcr.2015.vcxproj", "{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libs\spandsp\src\libtiff.2015.vcxproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libs\spandsp\src\libspandsp.2015.vcxproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspeex", "libs\win32\speex\libspeex.2015.vcxproj", "{E972C52F-9E85-4D65-B19C-031E511E9DB4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspeexdsp", "libs\win32\speex\libspeexdsp.2015.vcxproj", "{03207781-0D1C-4DB3-A71D-45C608F28DBD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libilbc", "libs\win32\ilbc\libilbc.2015.vcxproj", "{9A5DDF08-C88C-4A35-B7F6-D605228446BD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_opal", "src\mod\endpoints\mod_opal\mod_opal.2015.vcxproj", "{05C9FB27-480E-4D53-B3B7-6338E2526666}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skinny", "src\mod\endpoints\mod_skinny\mod_skinny.2015.vcxproj", "{CC1DD008-9406-448D-A0AD-33C3186CFADB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rtmp", "src\mod\endpoints\mod_rtmp\mod_rtmp.2015.vcxproj", "{48414740-C693-4968-9846-EE058020C64F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "libs\spandsp\src\msvc\make_at_dictionary.2015.vcxproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "libs\spandsp\src\msvc\make_modem_filter.2015.vcxproj", "{329A6FA0-0FCC-4435-A950-E670AEFA9838}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skel", "src\mod\applications\mod_skel\mod_skel.2015.vcxproj", "{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 32khz music", "libs\win32\Download 32khz music.2015.vcxproj", "{1F0A8A77-E661-418F-BB92-82172AE43803}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 8khz music", "libs\win32\Download 8khz music.2015.vcxproj", "{4F5C9D55-98EF-4256-8311-32D7BD360406}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 16khz music", "libs\win32\Download 16khz music.2015.vcxproj", "{E10571C4-E7F4-4608-B5F2-B22E7EB95400}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "8khz music", "libs\win32\Sound_Files\8khzmusic.2015.vcxproj", "{D1ABE208-6442-4FB4-9AAD-1677E41BC870}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16khz music", "libs\win32\Sound_Files\16khzmusic.2015.vcxproj", "{BA599D0A-4310-4505-91DA-6A6447B3E289}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "32khz music", "libs\win32\Sound_Files\32khzmusic.2015.vcxproj", "{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_nibblebill", "src\mod\applications\mod_nibblebill\mod_nibblebill.2015.vcxproj", "{3C977801-FE88-48F2-83D3-FA2EBFF6688E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_ru", "src\mod\say\mod_say_ru\mod_say_ru.2015.vcxproj", "{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_valet_parking", "src\mod\applications\mod_valet_parking\mod_valet_parking.2015.vcxproj", "{432DB165-1EB2-4781-A9C0-71E62610B20A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbroadvoice", "libs\win32\broadvoice\libbroadvoice.2015.vcxproj", "{CF70F278-3364-4395-A2E1-23501C9B8AD2}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_bv", "src\mod\codecs\mod_bv\mod_bv.2015.vcxproj", "{D5C87B19-150D-4EF3-A671-96589BD2D14A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aprtoolkit", "libs\unimrcp\libs\apr-toolkit\aprtoolkit.2015.vcxproj", "{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}"
-	ProjectSection(ProjectDependencies) = postProject
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpf", "libs\unimrcp\libs\mpf\mpf.2015.vcxproj", "{B5A00BFA-6083-4FAE-A097-71642D6473B5}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcp", "libs\unimrcp\libs\mrcp\mrcp.2015.vcxproj", "{1C320193-46A6-4B34-9C56-8AB584FC1B56}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpclient", "libs\unimrcp\libs\mrcp-client\mrcpclient.2015.vcxproj", "{72782932-37CC-46AE-8C7F-9A7B1A6EE108}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpsignaling", "libs\unimrcp\libs\mrcp-signaling\mrcpsignaling.2015.vcxproj", "{12A49562-BAB9-43A3-A21D-15B60BBB4C31}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpv2transport", "libs\unimrcp\libs\mrcpv2-transport\mrcpv2transport.2015.vcxproj", "{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unirtsp", "libs\unimrcp\libs\uni-rtsp\unirtsp.2015.vcxproj", "{504B3154-7A4F-459D-9877-B951021C3F1F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpsofiasip", "libs\unimrcp\modules\mrcp-sofiasip\mrcpsofiasip.2015.vcxproj", "{746F3632-5BB2-4570-9453-31D6D58A7D8E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpunirtsp", "libs\unimrcp\modules\mrcp-unirtsp\mrcpunirtsp.2015.vcxproj", "{DEB01ACB-D65F-4A62-AED9-58C1054499E9}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_unimrcp", "src\mod\asr_tts\mod_unimrcp\mod_unimrcp.2015.vcxproj", "{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download CELT", "libs\win32\Download CELT.2015.vcxproj", "{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcelt", "libs\win32\celt\libcelt.2015.vcxproj", "{ABB71A76-42B0-47A4-973A-42E3D920C6FD}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FSComm", "fscomm\FSComm.2015.vcxproj", "{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_curl", "src\mod\applications\mod_curl\mod_curl.2015.vcxproj", "{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_silk", "src\mod\codecs\mod_silk\mod_silk.2015.vcxproj", "{AFA983D6-4569-4F88-BA94-555ED00FD9A8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Silk_FIX", "libs\win32\libsilk\Silk_FIX.2015.vcxproj", "{56B91D01-9150-4BBF-AFA1-5B68AB991B76}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_avmd", "src\mod\applications\mod_avmd\mod_avmd.2015.vcxproj", "{990BAA76-89D3-4E38-8479-C7B28784EFC8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spandsp", "src\mod\applications\mod_spandsp\mod_spandsp.2015.vcxproj", "{1E21AFE0-6FDB-41D2-942D-863607C24B91}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_hash", "src\mod\applications\mod_hash\mod_hash.2015.vcxproj", "{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsofia_sip_ua_static", "libs\win32\sofia\libsofia_sip_ua_static.2015.vcxproj", "{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_directory", "src\mod\applications\mod_directory\mod_directory.2015.vcxproj", "{B889A18E-70A7-44B5-B2C9-47798D4F43B3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_h323", "src\mod\endpoints\mod_h323\mod_h323.2015.vcxproj", "{05C9FB27-480E-4D53-B3B7-7338E2514666}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_distributor", "src\mod\applications\mod_distributor\mod_distributor.2015.vcxproj", "{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_pt", "src\mod\say\mod_say_pt\mod_say_pt.2015.vcxproj", "{7C22BDFF-CC09-400C-8A09-660733980028}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_sv", "src\mod\say\mod_say_sv\mod_say_sv.2015.vcxproj", "{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ldns", "libs\win32\ldns\ldns-lib\ldns-lib.2015.vcxproj", "{23B4D303-79FC-49E0-89E2-2280E7E28940}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_callcenter", "src\mod\applications\mod_callcenter\mod_callcenter.2015.vcxproj", "{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_blacklist", "src\mod\applications\mod_blacklist\mod_blacklist.2015.vcxproj", "{50AAC2CE-BFC9-4912-87CC-C6381850D735}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spy", "src\mod\applications\mod_spy\mod_spy.2015.vcxproj", "{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_httapi", "src\mod\applications\mod_httapi\mod_httapi.2015.vcxproj", "{4748FF56-CA85-4809-97D6-A94C0FAC1D77}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_abstraction", "src\mod\applications\mod_abstraction\mod_abstraction.2015.vcxproj", "{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sms", "src\mod\applications\mod_sms\mod_sms.2015.vcxproj", "{2469B306-B027-4FF2-8815-C9C1EA2CAE79}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "xmlrpc-c", "xmlrpc-c", "{9DE35039-A8F6-4FBF-B1B6-EB527F802411}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmlib", "src\mod\endpoints\mod_gsmopen\gsmlib\gsmlib-1.10-patched-13ubuntu\win32\gsmlib.2015.vcxproj", "{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_gsmopen", "src\mod\endpoints\mod_gsmopen\mod_gsmopen.2015.vcxproj", "{74B120FF-6935-4DFE-A142-CDB6BEA99C90}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzrtp", "libs\libzrtp\projects\win\libzrtp.2015.vcxproj", "{C13CC324-0032-4492-9A30-310A6BD64FF5}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_redis", "src\mod\applications\mod_redis\mod_redis.2015.vcxproj", "{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libjpeg", "libs\win32\Download libjpeg.2015.vcxproj", "{652AD5F7-8488-489F-AAD0-7FBE064703B6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "libs\win32\libjpeg\libjpeg.2015.vcxproj", "{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}"
-	ProjectSection(ProjectDependencies) = postProject
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6} = {652AD5F7-8488-489F-AAD0-7FBE064703B6}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "abyss", "libs\win32\xmlrpc-c\abyss.2015.vcxproj", "{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}"
-	ProjectSection(ProjectDependencies) = postProject
-		{0D108721-EAE8-4BAF-8102-D8960EC93647} = {0D108721-EAE8-4BAF-8102-D8960EC93647}
-		{B535402E-38D2-4D54-8360-423ACBD17192} = {B535402E-38D2-4D54-8360-423ACBD17192}
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA} = {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gennmtab", "libs\win32\xmlrpc-c\gennmtab.2015.vcxproj", "{BED7539C-0099-4A14-AD5D-30828F15A171}"
-	ProjectSection(ProjectDependencies) = postProject
-		{0D108721-EAE8-4BAF-8102-D8960EC93647} = {0D108721-EAE8-4BAF-8102-D8960EC93647}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmlparse", "libs\win32\xmlrpc-c\xmlparse.2015.vcxproj", "{0D108721-EAE8-4BAF-8102-D8960EC93647}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmlrpc", "libs\win32\xmlrpc-c\xmlrpc.2015.vcxproj", "{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}"
-	ProjectSection(ProjectDependencies) = postProject
-		{0D108721-EAE8-4BAF-8102-D8960EC93647} = {0D108721-EAE8-4BAF-8102-D8960EC93647}
-		{B535402E-38D2-4D54-8360-423ACBD17192} = {B535402E-38D2-4D54-8360-423ACBD17192}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmltok", "libs\win32\xmlrpc-c\xmltok.2015.vcxproj", "{B535402E-38D2-4D54-8360-423ACBD17192}"
-	ProjectSection(ProjectDependencies) = postProject
-		{BED7539C-0099-4A14-AD5D-30828F15A171} = {BED7539C-0099-4A14-AD5D-30828F15A171}
-	EndProjectSection
-EndProject
-Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Setup.2015", "w32\Setup\Setup.2015.wixproj", "{47213370-B933-487D-9F45-BCA26D7E2B6F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_math_fixed_tables", "libs\spandsp\src\msvc\make_math_fixed_tables.2015.vcxproj", "{2386B892-35F5-46CF-A0F0-10394D2FBF9B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcbt", "libs\win32\libcbt\libcbt.2015.vcxproj", "{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_cielab_luts", "libs\spandsp\src\msvc\make_cielab_luts.2015.vcxproj", "{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download OPUS", "libs\win32\Download OPUS.2015.vcxproj", "{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "opus", "opus", "{ED2CA8B5-8E91-4296-A120-02BB0B674652}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus", "libs\win32\opus\opus.2015.vcxproj", "{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus.celt", "libs\win32\opus\opus.celt.2015.vcxproj", "{245603E3-F580-41A5-9632-B25FE3372CBF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus.silk_common", "libs\win32\opus\opus.silk_common.2015.vcxproj", "{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus.silk_fixed", "libs\win32\opus\opus.silk_fixed.2015.vcxproj", "{8484C90D-1561-402F-A91D-2DB10F8C5171}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus.silk_float", "libs\win32\opus\opus.silk_float.2015.vcxproj", "{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_opus", "src\mod\codecs\mod_opus\mod_opus.2015.vcxproj", "{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_t43_gray_code_tables", "libs\spandsp\src\msvc\make_t43_gray_code_tables.2015.vcxproj", "{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "winFailToBan", "src\mod\languages\mod_managed\managed\examples\winFailToBan\winFailToBan.csproj", "{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download SPEEX", "libs\win32\Download SPEEX.2015.vcxproj", "{1BDAB935-27DC-47E3-95EA-17E024D39C31}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download SQLITE", "libs\win32\Download SQLITE.2015.vcxproj", "{97D25665-34CD-4E0C-96E7-88F0795B8883}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download LDNS", "libs\win32\Download LDNS.2015.vcxproj", "{5BE9A596-F11F-4379-928C-412F81AE182B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PORTAUDIO", "libs\win32\Download PORTAUDIO.2015.vcxproj", "{C0779BCC-C037-4F58-B890-EF37BA956B3C}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rtc", "src\mod\endpoints\mod_rtc\mod_rtc.2015.vcxproj", "{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_verto", "src\mod\endpoints\mod_verto\mod_verto.2015.vcxproj", "{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyuv", "libs\win32\libyuv\libyuv.2015.vcxproj", "{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvpx", "libs\win32\libvpx\libvpx.2015.vcxproj", "{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "libs\win32\libpng\libpng.vcxproj", "{D6973076-9317-4EF2-A0B8-B7A18AC0713E}"
-	ProjectSection(ProjectDependencies) = postProject
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33} = {C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libpng", "libs\win32\Download libpng.2015.vcxproj", "{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "libs\win32\freetype\freetype.vcxproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"
-	ProjectSection(ProjectDependencies) = postProject
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A} = {0AD87FDA-989F-4638-B6E1-B0132BB0560A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download freetype", "libs\win32\Download freetype.2015.vcxproj", "{0AD87FDA-989F-4638-B6E1-B0132BB0560A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_png", "src\mod\formats\mod_png\mod_png.2015.vcxproj", "{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libav", "libs\win32\Download libav.2015.vcxproj", "{77C9E0A2-177D-4BD6-9EFD-75A56F886325}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libav", "libs\win32\libav\libav.2015.vcxproj", "{841C345F-FCC7-4F64-8F54-0281CEABEB01}"
-	ProjectSection(ProjectDependencies) = postProject
-		{77C9E0A2-177D-4BD6-9EFD-75A56F886325} = {77C9E0A2-177D-4BD6-9EFD-75A56F886325}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_av", "src\mod\applications\mod_av\mod_av.2015.vcxproj", "{7AEE504B-23B6-4B05-829E-7CD34855F146}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libx264", "libs\win32\libx264\libx264.2015.vcxproj", "{20179127-853B-4FE9-B7C0-9E817E6A3A72}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libx264", "libs\win32\Download libx264.2015.vcxproj", "{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download tiff", "libs\win32\Download tiff.2015.vcxproj", "{583D8CEA-4171-4493-9025-B63265F408D8}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_http_cache", "src\mod\applications\mod_http_cache\mod_http_cache.vcxproj", "{87933C2D-0159-46F7-B326-E1B6E982C21E}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download g722_1", "libs\win32\Download g722_1.2015.vcxproj", "{36603FE1-253F-4C2C-AAB6-12927A626135}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download iLBC", "libs\win32\Download iLBC.2015.vcxproj", "{53AADA60-DF12-46FF-BF94-566BBF849336}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download broadvoice", "libs\win32\Download broadvoice.2015.vcxproj", "{46502007-0D94-47AC-A640-C2B5EEA98333}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcodec2", "libs\win32\libcodec2\libcodec2.2015.vcxproj", "{19E934D6-1484-41C8-9305-78DC42FD61F2}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_codec2", "src\mod\codecs\mod_codec2\mod_codec2.vcxproj", "{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libcodec2", "libs\win32\Download libcodec2.2015.vcxproj", "{9CFA562C-C611-48A7-90A2-BB031B47FE6D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libsilk", "libs\win32\Download libsilk.2015.vcxproj", "{08782D64-E775-4E96-B707-CC633A226F32}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_amqp", "src\mod\event_handlers\mod_amqp\mod_amqp.2015.vcxproj", "{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr_pg_csv", "src\mod\event_handlers\mod_cdr_pg_csv\mod_cdr_pg_csv.2015.vcxproj", "{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_es_ar", "src\mod\say\mod_say_es_ar\mod_say_es_ar.2015.vcxproj", "{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_fa", "src\mod\say\mod_say_fa\mod_say_fa.2015.vcxproj", "{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_he", "src\mod\say\mod_say_he\mod_say_he.2015.vcxproj", "{A3D7C6CF-AEB1-4159-B741-160EB4B37345}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_hr", "src\mod\say\mod_say_hr\mod_say_hr.2015.vcxproj", "{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_hu", "src\mod\say\mod_say_hu\mod_say_hu.2015.vcxproj", "{AF675478-995A-4115-90C4-B2B0D6470688}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_ja", "src\mod\say\mod_say_ja\mod_say_ja.2015.vcxproj", "{07EA6E5A-D181-4ABB-BECF-67A906867D04}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_pl", "src\mod\say\mod_say_pl\mod_say_pl.2015.vcxproj", "{20B15650-F910-4211-8729-AAB0F520C805}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_th", "src\mod\say\mod_say_th\mod_say_th.2015.vcxproj", "{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_odbc_cdr", "src\mod\event_handlers\mod_odbc_cdr\mod_odbc_cdr.2015.vcxproj", "{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr_sqlite", "src\mod\event_handlers\mod_cdr_sqlite\mod_cdr_sqlite.2015.vcxproj", "{2CA661A7-01DD-4532-BF88-B6629DFB544A}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cv", "src\mod\applications\mod_cv\mod_cv.2015.vcxproj", "{40C4E2A2-B49B-496C-96D6-C04B890F7F88}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		All|Win32 = All|Win32
-		All|x64 = All|x64
-		Debug|Win32 = Debug|Win32
-		Debug|x64 = Debug|x64
-		Release|Win32 = Release|Win32
-		Release|x64 = Release|x64
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.All|Win32.ActiveCfg = Release|x64
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.All|x64.ActiveCfg = Release|x64
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.All|x64.Build.0 = Release|x64
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.Build.0 = Debug|Win32
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|x64.ActiveCfg = Debug|x64
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|x64.Build.0 = Debug|x64
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.ActiveCfg = Release|Win32
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.Build.0 = Release|Win32
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|x64.ActiveCfg = Release|x64
-		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|x64.Build.0 = Release|x64
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.All|Win32.ActiveCfg = Release|x64
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.All|x64.ActiveCfg = Release|x64
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.All|x64.Build.0 = Release|x64
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.Build.0 = Debug|Win32
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|x64.ActiveCfg = Debug|x64
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|x64.Build.0 = Debug|x64
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.ActiveCfg = Release|Win32
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.Build.0 = Release|Win32
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|x64.ActiveCfg = Release|x64
-		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|x64.Build.0 = Release|x64
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.All|Win32.ActiveCfg = Release Passthrough|x64
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.All|x64.ActiveCfg = Release Passthrough|x64
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.All|x64.Build.0 = Release Passthrough|x64
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.Build.0 = Debug Passthrough|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|x64.ActiveCfg = Debug Passthrough|x64
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|x64.Build.0 = Debug Passthrough|x64
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.ActiveCfg = Release Passthrough|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.Build.0 = Release Passthrough|Win32
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|x64.ActiveCfg = Release Passthrough|x64
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|x64.Build.0 = Release Passthrough|x64
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.All|Win32.ActiveCfg = Release|x64
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.All|x64.ActiveCfg = Release|x64
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.All|x64.Build.0 = Release|x64
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.Build.0 = Debug|Win32
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|x64.ActiveCfg = Debug|x64
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|x64.Build.0 = Debug|x64
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.ActiveCfg = Release|Win32
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.Build.0 = Release|Win32
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|x64.ActiveCfg = Release|x64
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|x64.Build.0 = Release|x64
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.All|Win32.ActiveCfg = Release|x64
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.All|x64.ActiveCfg = Release|x64
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.All|x64.Build.0 = Release|x64
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.Build.0 = Debug|Win32
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|x64.ActiveCfg = Debug|x64
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|x64.Build.0 = Debug|x64
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.ActiveCfg = Release|Win32
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.Build.0 = Release|Win32
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|x64.ActiveCfg = Release|x64
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|x64.Build.0 = Release|x64
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.All|Win32.ActiveCfg = Release|Win32
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.All|x64.ActiveCfg = Release|Win32
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|x64.ActiveCfg = Debug|Win32
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Win32.ActiveCfg = Release|Win32
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|x64.ActiveCfg = Release|Win32
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.All|Win32.ActiveCfg = Release|x64
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.All|x64.ActiveCfg = Release|x64
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.All|x64.Build.0 = Release|x64
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.ActiveCfg = Debug|Win32
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.Build.0 = Debug|Win32
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|x64.ActiveCfg = Debug|x64
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|x64.Build.0 = Debug|x64
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.ActiveCfg = Release|Win32
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.Build.0 = Release|Win32
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|x64.ActiveCfg = Release|x64
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|x64.Build.0 = Release|x64
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.All|Win32.ActiveCfg = Release MS-LDAP|x64
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.All|x64.ActiveCfg = Release MS-LDAP|x64
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.All|x64.Build.0 = Release MS-LDAP|x64
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.ActiveCfg = Debug MS-LDAP|Win32
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.Build.0 = Debug MS-LDAP|Win32
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|x64.ActiveCfg = Debug MS-LDAP|x64
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|x64.Build.0 = Debug MS-LDAP|x64
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.ActiveCfg = Release MS-LDAP|Win32
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.Build.0 = Release MS-LDAP|Win32
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|x64.ActiveCfg = Release MS-LDAP|x64
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|x64.Build.0 = Release MS-LDAP|x64
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.All|Win32.ActiveCfg = Release|x64
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.All|x64.ActiveCfg = Release|x64
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.All|x64.Build.0 = Release|x64
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.Build.0 = Debug|Win32
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|x64.ActiveCfg = Debug|x64
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|x64.Build.0 = Debug|x64
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.ActiveCfg = Release|Win32
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.Build.0 = Release|Win32
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|x64.ActiveCfg = Release|x64
-		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|x64.Build.0 = Release|x64
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.All|Win32.ActiveCfg = Release|x64
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.All|x64.ActiveCfg = Release|x64
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.All|x64.Build.0 = Release|x64
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.ActiveCfg = Debug|Win32
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.Build.0 = Debug|Win32
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|x64.ActiveCfg = Debug|x64
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|x64.Build.0 = Debug|x64
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.ActiveCfg = Release|Win32
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.Build.0 = Release|Win32
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|x64.ActiveCfg = Release|x64
-		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|x64.Build.0 = Release|x64
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.All|Win32.ActiveCfg = Release|x64
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.All|x64.ActiveCfg = Release|x64
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.All|x64.Build.0 = Release|x64
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.ActiveCfg = Debug|Win32
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.Build.0 = Debug|Win32
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|x64.ActiveCfg = Debug|x64
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|x64.Build.0 = Debug|x64
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.ActiveCfg = Release|Win32
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.Build.0 = Release|Win32
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|x64.ActiveCfg = Release|x64
-		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|x64.Build.0 = Release|x64
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.All|Win32.ActiveCfg = Release|x64
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.All|x64.ActiveCfg = Release|x64
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.All|x64.Build.0 = Release|x64
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|Win32.ActiveCfg = Debug|Win32
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|Win32.Build.0 = Debug|Win32
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|x64.ActiveCfg = Debug|x64
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|x64.Build.0 = Debug|x64
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Release|Win32.ActiveCfg = Release|Win32
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Release|Win32.Build.0 = Release|Win32
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Release|x64.ActiveCfg = Release|x64
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Release|x64.Build.0 = Release|x64
-		{8B754330-A434-4791-97E5-1EE67060BAC0}.All|Win32.ActiveCfg = Release|x64
-		{8B754330-A434-4791-97E5-1EE67060BAC0}.All|x64.ActiveCfg = Release|x64
-		{8B754330-A434-4791-97E5-1EE67060BAC0}.All|x64.Build.0 = Release|x64
-		{8B754330-A434-4791-97E5-1EE67060BAC0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8B754330-A434-4791-97E5-1EE67060BAC0}.Debug|x64.ActiveCfg = Debug|x64
-		{8B754330-A434-4791-97E5-1EE67060BAC0}.Release|Win32.ActiveCfg = Release|Win32
-		{8B754330-A434-4791-97E5-1EE67060BAC0}.Release|x64.ActiveCfg = Release|x64
-		{692F6330-4D87-4C82-81DF-40DB5892636E}.All|Win32.ActiveCfg = Release|x64
-		{692F6330-4D87-4C82-81DF-40DB5892636E}.All|x64.ActiveCfg = Release|x64
-		{692F6330-4D87-4C82-81DF-40DB5892636E}.All|x64.Build.0 = Release|x64
-		{692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|x64.ActiveCfg = Debug|x64
-		{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Win32.ActiveCfg = Release|Win32
-		{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x64.ActiveCfg = Release|x64
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|Win32.ActiveCfg = Release|x64
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|x64.ActiveCfg = Release|x64
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|x64.Build.0 = Release|x64
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.Build.0 = Debug|Win32
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.ActiveCfg = Debug|x64
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.Build.0 = Debug|x64
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.ActiveCfg = Release|Win32
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.Build.0 = Release|Win32
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|x64.ActiveCfg = Release|x64
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|x64.Build.0 = Release|x64
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.All|Win32.ActiveCfg = Release|x64
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.All|x64.ActiveCfg = Release|x64
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.All|x64.Build.0 = Release|x64
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.Build.0 = Debug|Win32
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|x64.ActiveCfg = Debug|x64
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|x64.Build.0 = Debug|x64
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.ActiveCfg = Release|Win32
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.Build.0 = Release|Win32
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|x64.ActiveCfg = Release|x64
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|x64.Build.0 = Release|x64
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.All|Win32.ActiveCfg = Release|x64
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.All|x64.ActiveCfg = Release|x64
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.All|x64.Build.0 = Release|x64
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.Build.0 = Debug|Win32
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|x64.ActiveCfg = Debug|x64
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|x64.Build.0 = Debug|x64
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.ActiveCfg = Release|Win32
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.Build.0 = Release|Win32
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|x64.ActiveCfg = Release|x64
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|x64.Build.0 = Release|x64
-		{1C453396-D912-4213-89FD-9B489162B7B5}.All|Win32.ActiveCfg = Release|x64
-		{1C453396-D912-4213-89FD-9B489162B7B5}.All|x64.ActiveCfg = Release|x64
-		{1C453396-D912-4213-89FD-9B489162B7B5}.All|x64.Build.0 = Release|x64
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.Build.0 = Debug|Win32
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|x64.ActiveCfg = Debug|x64
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|x64.Build.0 = Debug|x64
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.ActiveCfg = Release|Win32
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.Build.0 = Release|Win32
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|x64.ActiveCfg = Release|x64
-		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|x64.Build.0 = Release|x64
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.All|Win32.ActiveCfg = Release|x64
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.All|x64.ActiveCfg = Release|x64
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.All|x64.Build.0 = Release|x64
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.Build.0 = Debug|Win32
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|x64.ActiveCfg = Debug|x64
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|x64.Build.0 = Debug|x64
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.ActiveCfg = Release|Win32
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.Build.0 = Release|Win32
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|x64.ActiveCfg = Release|x64
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|x64.Build.0 = Release|x64
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.All|Win32.ActiveCfg = Release|x64
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.All|x64.ActiveCfg = Release|x64
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.All|x64.Build.0 = Release|x64
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.Build.0 = Debug|Win32
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|x64.ActiveCfg = Debug|x64
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|x64.Build.0 = Debug|x64
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.ActiveCfg = Release|Win32
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.Build.0 = Release|Win32
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|x64.ActiveCfg = Release|x64
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|x64.Build.0 = Release|x64
-		{C24FB505-05D7-4319-8485-7540B44C8603}.All|Win32.ActiveCfg = Release|x64
-		{C24FB505-05D7-4319-8485-7540B44C8603}.All|x64.ActiveCfg = Release|x64
-		{C24FB505-05D7-4319-8485-7540B44C8603}.All|x64.Build.0 = Release|x64
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.Build.0 = Debug|Win32
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|x64.ActiveCfg = Debug|x64
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|x64.Build.0 = Debug|x64
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.ActiveCfg = Release|Win32
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.Build.0 = Release|Win32
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|x64.ActiveCfg = Release|x64
-		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|x64.Build.0 = Release|x64
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.All|Win32.ActiveCfg = Release|x64
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.All|x64.ActiveCfg = Release|x64
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.All|x64.Build.0 = Release|x64
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.Build.0 = Debug|Win32
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|x64.ActiveCfg = Debug|x64
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|x64.Build.0 = Debug|x64
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.ActiveCfg = Release|Win32
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.Build.0 = Release|Win32
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|x64.ActiveCfg = Release|x64
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|x64.Build.0 = Release|x64
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.All|Win32.ActiveCfg = Release|x64
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.All|x64.ActiveCfg = Release|x64
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.All|x64.Build.0 = Release|x64
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.ActiveCfg = Debug|Win32
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.Build.0 = Debug|Win32
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|x64.ActiveCfg = Debug|x64
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|x64.Build.0 = Debug|x64
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.ActiveCfg = Release|Win32
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.Build.0 = Release|Win32
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|x64.ActiveCfg = Release|x64
-		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|x64.Build.0 = Release|x64
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.All|Win32.ActiveCfg = Release DLL|x64
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.All|x64.ActiveCfg = Release DLL|x64
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.All|x64.Build.0 = Release DLL|x64
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.Build.0 = Debug|Win32
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|x64.ActiveCfg = Debug|x64
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|x64.Build.0 = Debug|x64
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.ActiveCfg = Release|Win32
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.Build.0 = Release|Win32
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|x64.ActiveCfg = Release|x64
-		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|x64.Build.0 = Release|x64
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.All|Win32.ActiveCfg = Release Dll|x64
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.All|x64.ActiveCfg = Release Dll|x64
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.All|x64.Build.0 = Release Dll|x64
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.ActiveCfg = Debug|Win32
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.Build.0 = Debug|Win32
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|x64.ActiveCfg = Debug|x64
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|x64.Build.0 = Debug|x64
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.ActiveCfg = Release|Win32
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.Build.0 = Release|Win32
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|x64.ActiveCfg = Release|x64
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|x64.Build.0 = Release|x64
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.All|Win32.ActiveCfg = Release DLL|x64
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.All|x64.ActiveCfg = Release DLL|x64
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.All|x64.Build.0 = Release DLL|x64
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.Build.0 = Debug|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|x64.ActiveCfg = Debug|x64
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|x64.Build.0 = Debug|x64
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.ActiveCfg = Release|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.Build.0 = Release|Win32
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|x64.ActiveCfg = Release|x64
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|x64.Build.0 = Release|x64
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.All|Win32.ActiveCfg = Release|x64
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.All|x64.ActiveCfg = Release|x64
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.All|x64.Build.0 = Release|x64
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.Build.0 = Debug|Win32
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|x64.ActiveCfg = Debug|x64
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|x64.Build.0 = Debug|x64
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.ActiveCfg = Release|Win32
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.Build.0 = Release|Win32
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|x64.ActiveCfg = Release|x64
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|x64.Build.0 = Release|x64
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.All|Win32.ActiveCfg = Release|x64
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.All|x64.ActiveCfg = Release|x64
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.All|x64.Build.0 = Release|x64
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.Build.0 = Debug|Win32
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|x64.ActiveCfg = Debug|x64
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|x64.Build.0 = Debug|x64
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.ActiveCfg = Release|Win32
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.Build.0 = Release|Win32
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|x64.ActiveCfg = Release|x64
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|x64.Build.0 = Release|x64
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.All|Win32.ActiveCfg = Release|x64
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.All|x64.ActiveCfg = Release|x64
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.All|x64.Build.0 = Release|x64
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.Build.0 = Debug|Win32
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|x64.ActiveCfg = Debug|x64
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|x64.Build.0 = Debug|x64
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.ActiveCfg = Release|Win32
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.Build.0 = Release|Win32
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.ActiveCfg = Release|x64
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.Build.0 = Release|x64
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|Win32.ActiveCfg = Debug|x64
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|x64.ActiveCfg = Debug|x64
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|x64.Build.0 = Debug|x64
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.Build.0 = Debug|Win32
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|x64.ActiveCfg = Debug|x64
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|x64.Build.0 = Debug|x64
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.ActiveCfg = Release|Win32
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.Build.0 = Release|Win32
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|x64.ActiveCfg = Release|x64
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|x64.Build.0 = Release|x64
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.All|Win32.ActiveCfg = Release|x64
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.All|x64.ActiveCfg = Release|x64
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.All|x64.Build.0 = Release|x64
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.Build.0 = Debug|Win32
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|x64.ActiveCfg = Debug|x64
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|x64.Build.0 = Debug|x64
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.ActiveCfg = Release|Win32
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.Build.0 = Release|Win32
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|x64.ActiveCfg = Release|x64
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|x64.Build.0 = Release|x64
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.All|Win32.ActiveCfg = Release|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.All|Win32.Build.0 = Release|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.All|x64.ActiveCfg = Release|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.All|x64.Build.0 = Release|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.Build.0 = Debug|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|x64.ActiveCfg = Debug|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|x64.Build.0 = Debug|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.ActiveCfg = Release|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.Build.0 = Release|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|x64.ActiveCfg = Release|Win32
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|x64.Build.0 = Release|Win32
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.All|Win32.ActiveCfg = Release DLL|x64
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.All|x64.ActiveCfg = Release DLL|x64
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.All|x64.Build.0 = Release DLL|x64
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.ActiveCfg = Debug DLL|Win32
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.Build.0 = Debug DLL|Win32
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|x64.ActiveCfg = Debug DLL|x64
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|x64.Build.0 = Debug DLL|x64
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.ActiveCfg = Release DLL|Win32
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.Build.0 = Release DLL|Win32
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|x64.ActiveCfg = Release DLL|x64
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|x64.Build.0 = Release DLL|x64
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.All|Win32.ActiveCfg = Release Passthrough|x64
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.All|x64.ActiveCfg = Release Passthrough|x64
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.All|x64.Build.0 = Release Passthrough|x64
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.Build.0 = Debug Passthrough|Win32
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|x64.ActiveCfg = Debug Passthrough|x64
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|x64.Build.0 = Debug Passthrough|x64
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.ActiveCfg = Release Passthrough|Win32
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.Build.0 = Release Passthrough|Win32
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x64.ActiveCfg = Release Passthrough|x64
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x64.Build.0 = Release Passthrough|x64
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|Win32.ActiveCfg = Release|x64
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x64.ActiveCfg = Release|x64
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x64.Build.0 = Release|x64
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|Win32.ActiveCfg = Debug|Win32
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|Win32.Build.0 = Debug|Win32
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|x64.ActiveCfg = Debug|x64
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|x64.Build.0 = Debug|x64
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|Win32.ActiveCfg = Release|Win32
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|Win32.Build.0 = Release|Win32
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|x64.ActiveCfg = Release|x64
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|x64.Build.0 = Release|x64
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|Win32.ActiveCfg = Release|x64
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|x64.ActiveCfg = Release|x64
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|x64.Build.0 = Release|x64
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.ActiveCfg = Debug|Win32
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.Build.0 = Debug|Win32
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|x64.ActiveCfg = Debug|x64
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|x64.Build.0 = Debug|x64
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.ActiveCfg = Release|Win32
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.Build.0 = Release|Win32
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|x64.ActiveCfg = Release|x64
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|x64.Build.0 = Release|x64
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.All|Win32.ActiveCfg = Release|x64
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.All|x64.ActiveCfg = Release|x64
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.All|x64.Build.0 = Release|x64
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|x64.ActiveCfg = Debug|x64
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.ActiveCfg = Release|Win32
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|x64.ActiveCfg = Release|x64
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.All|Win32.ActiveCfg = Release|x64
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.All|x64.ActiveCfg = Release|x64
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.All|x64.Build.0 = Release|x64
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.Build.0 = Debug|Win32
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|x64.ActiveCfg = Debug|x64
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|x64.Build.0 = Debug|x64
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.ActiveCfg = Release|Win32
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.Build.0 = Release|Win32
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|x64.ActiveCfg = Release|x64
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|x64.Build.0 = Release|x64
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.All|Win32.ActiveCfg = Release|x64
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.All|x64.ActiveCfg = Release|x64
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.All|x64.Build.0 = Release|x64
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.Build.0 = Debug|Win32
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|x64.ActiveCfg = Debug|x64
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|x64.Build.0 = Debug|x64
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.ActiveCfg = Release|Win32
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.Build.0 = Release|Win32
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|x64.ActiveCfg = Release|x64
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|x64.Build.0 = Release|x64
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.All|Win32.ActiveCfg = Release|x64
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.All|x64.ActiveCfg = Release|x64
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.All|x64.Build.0 = Release|x64
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.Build.0 = Debug|Win32
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|x64.ActiveCfg = Debug|x64
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|x64.Build.0 = Debug|x64
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.ActiveCfg = Release|Win32
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.Build.0 = Release|Win32
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|x64.ActiveCfg = Release|x64
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|x64.Build.0 = Release|x64
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|Win32.ActiveCfg = Release DirectSound|x64
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|x64.ActiveCfg = Release DirectSound|x64
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|x64.Build.0 = Release DirectSound|x64
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug DirectSound|Win32
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug DirectSound|Win32
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug DirectSound|x64
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.Build.0 = Debug DirectSound|x64
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release DirectSound|Win32
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release DirectSound|Win32
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release DirectSound|x64
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.Build.0 = Release DirectSound|x64
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|Win32.ActiveCfg = Release|x64
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|x64.ActiveCfg = Release|x64
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|x64.Build.0 = Release|x64
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.ActiveCfg = Debug|Win32
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.Build.0 = Debug|Win32
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|x64.ActiveCfg = Debug|x64
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|x64.Build.0 = Debug|x64
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.ActiveCfg = Release|Win32
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.Build.0 = Release|Win32
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|x64.ActiveCfg = Release|x64
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|x64.Build.0 = Release|x64
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.All|Win32.ActiveCfg = Release Passthrough|x64
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.All|x64.ActiveCfg = Release Passthrough|x64
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.All|x64.Build.0 = Release Passthrough|x64
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.Build.0 = Debug Passthrough|Win32
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|x64.ActiveCfg = Debug Passthrough|x64
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|x64.Build.0 = Debug Passthrough|x64
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.ActiveCfg = Release Passthrough|Win32
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.Build.0 = Release Passthrough|Win32
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|x64.ActiveCfg = Release Passthrough|x64
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|x64.Build.0 = Release Passthrough|x64
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.All|Win32.ActiveCfg = Release|x64
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.All|x64.ActiveCfg = Release|x64
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.All|x64.Build.0 = Release|x64
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.Build.0 = Debug|Win32
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|x64.ActiveCfg = Debug|x64
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|x64.Build.0 = Debug|x64
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.ActiveCfg = Release|Win32
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.Build.0 = Release|Win32
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|x64.ActiveCfg = Release|x64
-		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|x64.Build.0 = Release|x64
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.All|Win32.ActiveCfg = Release|x64
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.All|x64.ActiveCfg = Release|x64
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.All|x64.Build.0 = Release|x64
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.ActiveCfg = Debug|Win32
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.Build.0 = Debug|Win32
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|x64.ActiveCfg = Debug|x64
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|x64.Build.0 = Debug|x64
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.ActiveCfg = Release|Win32
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.Build.0 = Release|Win32
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|x64.ActiveCfg = Release|x64
-		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|x64.Build.0 = Release|x64
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.All|Win32.ActiveCfg = Release|x64
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.All|x64.ActiveCfg = Release|x64
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.All|x64.Build.0 = Release|x64
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.Build.0 = Debug|Win32
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|x64.ActiveCfg = Debug|x64
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|x64.Build.0 = Debug|x64
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.ActiveCfg = Release|Win32
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.Build.0 = Release|Win32
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|x64.ActiveCfg = Release|x64
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|x64.Build.0 = Release|x64
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.All|Win32.ActiveCfg = Release|x64
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.All|x64.ActiveCfg = Release|x64
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.All|x64.Build.0 = Release|x64
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Win32.Build.0 = Debug|Win32
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|x64.ActiveCfg = Debug|x64
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|x64.Build.0 = Debug|x64
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Win32.ActiveCfg = Release|Win32
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Win32.Build.0 = Release|Win32
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|x64.ActiveCfg = Release|x64
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|x64.Build.0 = Release|x64
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.All|Win32.ActiveCfg = Release|x64
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.All|x64.ActiveCfg = Release|x64
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.All|x64.Build.0 = Release|x64
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Win32.Build.0 = Debug|Win32
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|x64.ActiveCfg = Debug|x64
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|x64.Build.0 = Debug|x64
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Win32.ActiveCfg = Release|Win32
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Win32.Build.0 = Release|Win32
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|x64.ActiveCfg = Release|x64
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|x64.Build.0 = Release|x64
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.All|Win32.ActiveCfg = Release|x64
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.All|x64.ActiveCfg = Release|x64
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.All|x64.Build.0 = Release|x64
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Win32.Build.0 = Debug|Win32
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|x64.ActiveCfg = Debug|x64
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|x64.Build.0 = Debug|x64
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Win32.ActiveCfg = Release|Win32
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Win32.Build.0 = Release|Win32
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|x64.ActiveCfg = Release|x64
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|x64.Build.0 = Release|x64
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.All|Win32.ActiveCfg = Release|x64
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.All|x64.ActiveCfg = Release|x64
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.All|x64.Build.0 = Release|x64
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Win32.ActiveCfg = Debug|Win32
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Win32.Build.0 = Debug|Win32
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|x64.ActiveCfg = Debug|x64
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|x64.Build.0 = Debug|x64
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Win32.ActiveCfg = Release|Win32
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Win32.Build.0 = Release|Win32
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|x64.ActiveCfg = Release|x64
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|x64.Build.0 = Release|x64
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.All|Win32.ActiveCfg = Release|x64
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.All|x64.ActiveCfg = Release|x64
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.All|x64.Build.0 = Release|x64
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Win32.ActiveCfg = Debug|Win32
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Win32.Build.0 = Debug|Win32
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|x64.ActiveCfg = Debug|x64
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|x64.Build.0 = Debug|x64
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Win32.ActiveCfg = Release|Win32
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Win32.Build.0 = Release|Win32
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|x64.ActiveCfg = Release|x64
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|x64.Build.0 = Release|x64
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.All|Win32.ActiveCfg = Release|x64
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.All|x64.ActiveCfg = Release|x64
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.All|x64.Build.0 = Release|x64
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Win32.ActiveCfg = Debug|Win32
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Win32.Build.0 = Debug|Win32
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|x64.ActiveCfg = Debug|x64
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|x64.Build.0 = Debug|x64
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Win32.ActiveCfg = Release|Win32
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Win32.Build.0 = Release|Win32
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|x64.ActiveCfg = Release|x64
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|x64.Build.0 = Release|x64
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.All|Win32.ActiveCfg = Release|x64
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.All|x64.ActiveCfg = Release|x64
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.All|x64.Build.0 = Release|x64
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Win32.ActiveCfg = Debug|Win32
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Win32.Build.0 = Debug|Win32
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|x64.ActiveCfg = Debug|x64
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|x64.Build.0 = Debug|x64
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Win32.ActiveCfg = Release|Win32
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Win32.Build.0 = Release|Win32
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|x64.ActiveCfg = Release|x64
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|x64.Build.0 = Release|x64
-		{F6A33240-8F29-48BD-98F0-826995911799}.All|Win32.ActiveCfg = Release|x64
-		{F6A33240-8F29-48BD-98F0-826995911799}.All|x64.ActiveCfg = Release|x64
-		{F6A33240-8F29-48BD-98F0-826995911799}.All|x64.Build.0 = Release|x64
-		{F6A33240-8F29-48BD-98F0-826995911799}.Debug|Win32.ActiveCfg = Debug|Win32
-		{F6A33240-8F29-48BD-98F0-826995911799}.Debug|Win32.Build.0 = Debug|Win32
-		{F6A33240-8F29-48BD-98F0-826995911799}.Debug|x64.ActiveCfg = Debug|x64
-		{F6A33240-8F29-48BD-98F0-826995911799}.Debug|x64.Build.0 = Debug|x64
-		{F6A33240-8F29-48BD-98F0-826995911799}.Release|Win32.ActiveCfg = Release|Win32
-		{F6A33240-8F29-48BD-98F0-826995911799}.Release|Win32.Build.0 = Release|Win32
-		{F6A33240-8F29-48BD-98F0-826995911799}.Release|x64.ActiveCfg = Release|x64
-		{F6A33240-8F29-48BD-98F0-826995911799}.Release|x64.Build.0 = Release|x64
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.All|Win32.ActiveCfg = Release|x64
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.All|x64.ActiveCfg = Release|x64
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.All|x64.Build.0 = Release|x64
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Win32.ActiveCfg = Debug|Win32
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Win32.Build.0 = Debug|Win32
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|x64.ActiveCfg = Debug|x64
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|x64.Build.0 = Debug|x64
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Win32.ActiveCfg = Release|Win32
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Win32.Build.0 = Release|Win32
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|x64.ActiveCfg = Release|x64
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|x64.Build.0 = Release|x64
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.All|Win32.ActiveCfg = Release|x64
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.All|x64.ActiveCfg = Release|x64
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.All|x64.Build.0 = Release|x64
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.Build.0 = Debug|Win32
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|x64.ActiveCfg = Debug|x64
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|x64.Build.0 = Debug|x64
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Win32.ActiveCfg = Release|Win32
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Win32.Build.0 = Release|Win32
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|x64.ActiveCfg = Release|x64
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|x64.Build.0 = Release|x64
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.All|Win32.ActiveCfg = Release|x64
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.All|x64.ActiveCfg = Release|x64
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.All|x64.Build.0 = Release|x64
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Win32.Build.0 = Debug|Win32
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|x64.ActiveCfg = Debug|x64
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|x64.Build.0 = Debug|x64
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Win32.ActiveCfg = Release|Win32
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Win32.Build.0 = Release|Win32
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|x64.ActiveCfg = Release|x64
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|x64.Build.0 = Release|x64
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.All|Win32.ActiveCfg = Release|x64
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.All|x64.ActiveCfg = Release|x64
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.All|x64.Build.0 = Release|x64
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Win32.Build.0 = Debug|Win32
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|x64.ActiveCfg = Debug|x64
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|x64.Build.0 = Debug|x64
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Win32.ActiveCfg = Release|Win32
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Win32.Build.0 = Release|Win32
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|x64.ActiveCfg = Release|x64
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|x64.Build.0 = Release|x64
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.All|Win32.ActiveCfg = Release|x64
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.All|x64.ActiveCfg = Release|x64
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.All|x64.Build.0 = Release|x64
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Win32.ActiveCfg = Debug|Win32
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Win32.Build.0 = Debug|Win32
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|x64.ActiveCfg = Debug|x64
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|x64.Build.0 = Debug|x64
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Win32.ActiveCfg = Release|Win32
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Win32.Build.0 = Release|Win32
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|x64.ActiveCfg = Release|x64
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|x64.Build.0 = Release|x64
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.All|Win32.ActiveCfg = Release|x64
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.All|x64.ActiveCfg = Release|x64
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.All|x64.Build.0 = Release|x64
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Win32.Build.0 = Debug|Win32
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|x64.ActiveCfg = Debug|x64
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|x64.Build.0 = Debug|x64
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Win32.ActiveCfg = Release|Win32
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Win32.Build.0 = Release|Win32
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|x64.ActiveCfg = Release|x64
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|x64.Build.0 = Release|x64
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.All|Win32.ActiveCfg = Release|x64
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.All|x64.ActiveCfg = Release|x64
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.All|x64.Build.0 = Release|x64
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.ActiveCfg = Debug|Win32
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.Build.0 = Debug|Win32
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.ActiveCfg = Debug|x64
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.Build.0 = Debug|x64
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.ActiveCfg = Release|Win32
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.Build.0 = Release|Win32
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.ActiveCfg = Release|x64
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.Build.0 = Release|x64
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.All|Win32.ActiveCfg = Release|Win32
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.All|Win32.Build.0 = Release|Win32
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.All|x64.ActiveCfg = Release|Win32
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.All|x64.Build.0 = Release|Win32
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Win32.ActiveCfg = Debug|Win32
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Win32.Build.0 = Debug|Win32
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|x64.ActiveCfg = Debug|Win32
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|x64.Build.0 = Debug|Win32
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Win32.ActiveCfg = Release|Win32
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Win32.Build.0 = Release|Win32
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|x64.ActiveCfg = Release|Win32
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|x64.Build.0 = Release|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.All|Win32.ActiveCfg = Release|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.All|Win32.Build.0 = Release|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.All|x64.ActiveCfg = Release|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.All|x64.Build.0 = Release|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.Debug|Win32.Build.0 = Debug|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.Debug|x64.ActiveCfg = Debug|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.Debug|x64.Build.0 = Debug|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.Release|Win32.ActiveCfg = Release|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.Release|Win32.Build.0 = Release|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.Release|x64.ActiveCfg = Release|Win32
-		{2DEE4895-1134-439C-B688-52203E57D878}.Release|x64.Build.0 = Release|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.All|Win32.ActiveCfg = Release|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.All|Win32.Build.0 = Release|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.All|x64.ActiveCfg = Release|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.All|x64.Build.0 = Release|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Win32.Build.0 = Debug|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|x64.ActiveCfg = Debug|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|x64.Build.0 = Debug|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Win32.ActiveCfg = Release|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Win32.Build.0 = Release|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|x64.ActiveCfg = Release|Win32
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|x64.Build.0 = Release|Win32
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.All|Win32.ActiveCfg = Debug|x64
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.All|x64.ActiveCfg = Debug|x64
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.All|x64.Build.0 = Debug|x64
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Win32.Build.0 = Debug|Win32
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|x64.ActiveCfg = Debug|x64
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|x64.Build.0 = Debug|x64
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Win32.ActiveCfg = Release|Win32
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Win32.Build.0 = Release|Win32
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|x64.ActiveCfg = Release|x64
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|x64.Build.0 = Release|x64
-		{94001A0E-A837-445C-8004-F918F10D0226}.All|Win32.ActiveCfg = Debug|x64
-		{94001A0E-A837-445C-8004-F918F10D0226}.All|x64.ActiveCfg = Debug|x64
-		{94001A0E-A837-445C-8004-F918F10D0226}.All|x64.Build.0 = Debug|x64
-		{94001A0E-A837-445C-8004-F918F10D0226}.Debug|Win32.ActiveCfg = Debug|Win32
-		{94001A0E-A837-445C-8004-F918F10D0226}.Debug|Win32.Build.0 = Debug|Win32
-		{94001A0E-A837-445C-8004-F918F10D0226}.Debug|x64.ActiveCfg = Debug|x64
-		{94001A0E-A837-445C-8004-F918F10D0226}.Debug|x64.Build.0 = Debug|x64
-		{94001A0E-A837-445C-8004-F918F10D0226}.Release|Win32.ActiveCfg = Release|Win32
-		{94001A0E-A837-445C-8004-F918F10D0226}.Release|Win32.Build.0 = Release|Win32
-		{94001A0E-A837-445C-8004-F918F10D0226}.Release|x64.ActiveCfg = Release|x64
-		{94001A0E-A837-445C-8004-F918F10D0226}.Release|x64.Build.0 = Release|x64
-		{2286DA73-9FC5-45BC-A508-85994C3317AB}.All|Win32.ActiveCfg = Release|x64
-		{2286DA73-9FC5-45BC-A508-85994C3317AB}.All|x64.ActiveCfg = Release|x64
-		{2286DA73-9FC5-45BC-A508-85994C3317AB}.All|x64.Build.0 = Release|x64
-		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Win32.Build.0 = Debug|Win32
-		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|x64.ActiveCfg = Debug|x64
-		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|x64.Build.0 = Debug|x64
-		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Win32.ActiveCfg = Release|Win32
-		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Win32.Build.0 = Release|Win32
-		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|x64.ActiveCfg = Release|x64
-		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|x64.Build.0 = Release|x64
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.All|Win32.ActiveCfg = Release|Win32
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.All|Win32.Build.0 = Release|Win32
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.All|x64.ActiveCfg = Release|Win32
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.All|x64.Build.0 = Release|Win32
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Win32.ActiveCfg = Debug|Win32
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Win32.Build.0 = Debug|Win32
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|x64.ActiveCfg = Debug|Win32
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|x64.Build.0 = Debug|Win32
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Win32.ActiveCfg = Release|Win32
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Win32.Build.0 = Release|Win32
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|x64.ActiveCfg = Release|Win32
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|x64.Build.0 = Release|Win32
-		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.All|Win32.ActiveCfg = Release|Win32
-		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.All|x64.ActiveCfg = Release|Win32
-		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|Win32.ActiveCfg = Debug|Win32
-		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|Win32.Build.0 = Debug|Win32
-		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|x64.ActiveCfg = Debug|Win32
-		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|Win32.ActiveCfg = Release|Win32
-		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|x64.ActiveCfg = Release|Win32
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.All|Win32.ActiveCfg = Release|Win32
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.All|Win32.Build.0 = Release|Win32
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.All|x64.ActiveCfg = Release|Win32
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.All|x64.Build.0 = Release|Win32
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Win32.Build.0 = Debug|Win32
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|x64.ActiveCfg = Debug|x64
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|x64.Build.0 = Debug|x64
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Win32.ActiveCfg = Release|Win32
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Win32.Build.0 = Release|Win32
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|x64.ActiveCfg = Release|x64
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|x64.Build.0 = Release|x64
-		{7EB71250-F002-4ED8-92CA-CA218114537A}.All|Win32.ActiveCfg = Release|Win32
-		{7EB71250-F002-4ED8-92CA-CA218114537A}.All|x64.ActiveCfg = Release|Win32
-		{7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|Win32.Build.0 = Debug|Win32
-		{7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|x64.ActiveCfg = Debug|x64
-		{7EB71250-F002-4ED8-92CA-CA218114537A}.Release|Win32.ActiveCfg = Release|Win32
-		{7EB71250-F002-4ED8-92CA-CA218114537A}.Release|x64.ActiveCfg = Release|x64
-		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.All|Win32.ActiveCfg = Release|Win32
-		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.All|x64.ActiveCfg = Release|Win32
-		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|Win32.Build.0 = Debug|Win32
-		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|x64.ActiveCfg = Debug|Win32
-		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|Win32.ActiveCfg = Release|Win32
-		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|x64.ActiveCfg = Release|Win32
-		{464AAB78-5489-4916-BE51-BF8D61822311}.All|Win32.ActiveCfg = Release|Win32
-		{464AAB78-5489-4916-BE51-BF8D61822311}.All|x64.ActiveCfg = Release|Win32
-		{464AAB78-5489-4916-BE51-BF8D61822311}.Debug|Win32.ActiveCfg = Debug|Win32
-		{464AAB78-5489-4916-BE51-BF8D61822311}.Debug|Win32.Build.0 = Debug|Win32
-		{464AAB78-5489-4916-BE51-BF8D61822311}.Debug|x64.ActiveCfg = Debug|x64
-		{464AAB78-5489-4916-BE51-BF8D61822311}.Release|Win32.ActiveCfg = Release|Win32
-		{464AAB78-5489-4916-BE51-BF8D61822311}.Release|x64.ActiveCfg = Release|x64
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.All|Win32.ActiveCfg = Release|Win32
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.All|Win32.Build.0 = Release|Win32
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.All|x64.ActiveCfg = Release|x64
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.All|x64.Build.0 = Release|x64
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Win32.ActiveCfg = Debug|Win32
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Win32.Build.0 = Debug|Win32
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|x64.ActiveCfg = Debug|x64
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|x64.Build.0 = Debug|x64
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Win32.ActiveCfg = Release|Win32
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Win32.Build.0 = Release|Win32
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|x64.ActiveCfg = Release|x64
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|x64.Build.0 = Release|x64
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.All|Win32.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.All|Win32.Build.0 = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.All|x64.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.All|x64.Build.0 = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Win32.Build.0 = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|x64.ActiveCfg = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|x64.Build.0 = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Win32.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Win32.Build.0 = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|x64.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|x64.Build.0 = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.All|Win32.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.All|Win32.Build.0 = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.All|x64.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.All|x64.Build.0 = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Win32.Build.0 = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|x64.ActiveCfg = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|x64.Build.0 = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Win32.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Win32.Build.0 = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|x64.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|x64.Build.0 = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.All|Win32.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.All|Win32.Build.0 = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.All|x64.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.All|x64.Build.0 = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Win32.Build.0 = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|x64.ActiveCfg = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|x64.Build.0 = Debug|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Win32.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Win32.Build.0 = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|x64.ActiveCfg = Release|Win32
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|x64.Build.0 = Release|Win32
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.All|Win32.ActiveCfg = Debug|x64
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.All|x64.ActiveCfg = Debug|x64
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.All|x64.Build.0 = Debug|x64
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Win32.Build.0 = Debug|Win32
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|x64.ActiveCfg = Debug|x64
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|x64.Build.0 = Debug|x64
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Win32.ActiveCfg = Release|Win32
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Win32.Build.0 = Release|Win32
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|x64.ActiveCfg = Release|x64
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|x64.Build.0 = Release|x64
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.All|Win32.ActiveCfg = Debug|x64
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.All|x64.ActiveCfg = Debug|x64
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.All|x64.Build.0 = Debug|x64
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Win32.Build.0 = Debug|Win32
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|x64.ActiveCfg = Debug|x64
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|x64.Build.0 = Debug|x64
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Win32.ActiveCfg = Release|Win32
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Win32.Build.0 = Release|Win32
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|x64.ActiveCfg = Release|x64
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|x64.Build.0 = Release|x64
-		{38FE0559-9910-43A8-9E45-3E5004C27692}.All|Win32.ActiveCfg = Release|x64
-		{38FE0559-9910-43A8-9E45-3E5004C27692}.All|x64.ActiveCfg = Release|x64
-		{38FE0559-9910-43A8-9E45-3E5004C27692}.All|x64.Build.0 = Release|x64
-		{38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Win32.ActiveCfg = Debug|Win32
-		{38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Win32.Build.0 = Debug|Win32
-		{38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|x64.ActiveCfg = Debug|x64
-		{38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|x64.Build.0 = Debug|x64
-		{38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Win32.ActiveCfg = Release|Win32
-		{38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Win32.Build.0 = Release|Win32
-		{38FE0559-9910-43A8-9E45-3E5004C27692}.Release|x64.ActiveCfg = Release|x64
-		{38FE0559-9910-43A8-9E45-3E5004C27692}.Release|x64.Build.0 = Release|x64
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.All|Win32.ActiveCfg = Debug|x64
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.All|x64.ActiveCfg = Debug|x64
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.All|x64.Build.0 = Debug|x64
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Win32.Build.0 = Debug|Win32
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|x64.ActiveCfg = Debug|x64
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|x64.Build.0 = Debug|x64
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Win32.ActiveCfg = Release|Win32
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Win32.Build.0 = Release|Win32
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|x64.ActiveCfg = Release|x64
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|x64.Build.0 = Release|x64
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.All|Win32.ActiveCfg = Release|x64
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.All|x64.ActiveCfg = Release|x64
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.All|x64.Build.0 = Release|x64
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Win32.Build.0 = Debug|Win32
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|x64.ActiveCfg = Debug|x64
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|x64.Build.0 = Debug|x64
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.ActiveCfg = Release|Win32
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.Build.0 = Release|Win32
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|x64.ActiveCfg = Release|x64
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|x64.Build.0 = Release|x64
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.All|Win32.ActiveCfg = Release|x64
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.All|x64.ActiveCfg = Release|x64
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.All|x64.Build.0 = Release|x64
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.Build.0 = Debug|Win32
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|x64.ActiveCfg = Debug|x64
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|x64.Build.0 = Debug|x64
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.ActiveCfg = Release|Win32
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.Build.0 = Release|Win32
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|x64.ActiveCfg = Release|x64
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|x64.Build.0 = Release|x64
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.All|Win32.ActiveCfg = Release_Mono|x64
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.All|x64.ActiveCfg = Release_Mono|x64
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.All|x64.Build.0 = Release_Mono|x64
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Win32.ActiveCfg = Debug_CLR|Win32
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Win32.Build.0 = Debug_CLR|Win32
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|x64.ActiveCfg = Debug_CLR|x64
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|x64.Build.0 = Debug_CLR|x64
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|Win32.ActiveCfg = Release_CLR|Win32
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|Win32.Build.0 = Release_CLR|Win32
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|x64.ActiveCfg = Release_CLR|x64
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|x64.Build.0 = Release_CLR|x64
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.All|Win32.ActiveCfg = Release|Any CPU
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.All|x64.ActiveCfg = Release|Any CPU
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.ActiveCfg = Debug|Any CPU
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.Build.0 = Debug|Any CPU
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|x64.ActiveCfg = Debug|x64
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|x64.Build.0 = Debug|x64
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.ActiveCfg = Release|Any CPU
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.Build.0 = Release|Any CPU
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|x64.ActiveCfg = Release|x64
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|x64.Build.0 = Release|x64
-		{E796E337-DE78-4303-8614-9A590862EE95}.All|Win32.ActiveCfg = Release|Win32
-		{E796E337-DE78-4303-8614-9A590862EE95}.All|Win32.Build.0 = Release|Win32
-		{E796E337-DE78-4303-8614-9A590862EE95}.All|x64.ActiveCfg = Release|Win32
-		{E796E337-DE78-4303-8614-9A590862EE95}.All|x64.Build.0 = Release|Win32
-		{E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.Build.0 = Debug|Win32
-		{E796E337-DE78-4303-8614-9A590862EE95}.Debug|x64.ActiveCfg = Debug|Win32
-		{E796E337-DE78-4303-8614-9A590862EE95}.Debug|x64.Build.0 = Debug|Win32
-		{E796E337-DE78-4303-8614-9A590862EE95}.Release|Win32.ActiveCfg = Release|Win32
-		{E796E337-DE78-4303-8614-9A590862EE95}.Release|Win32.Build.0 = Release|Win32
-		{E796E337-DE78-4303-8614-9A590862EE95}.Release|x64.ActiveCfg = Release|Win32
-		{E796E337-DE78-4303-8614-9A590862EE95}.Release|x64.Build.0 = Release|Win32
-		{419C8F80-D858-4B48-A25C-AF4007608137}.All|Win32.ActiveCfg = Debug_Generic_Dll|Win32
-		{419C8F80-D858-4B48-A25C-AF4007608137}.All|Win32.Build.0 = Debug_Generic_Dll|Win32
-		{419C8F80-D858-4B48-A25C-AF4007608137}.All|x64.ActiveCfg = Debug_Generic_Dll|Win32
-		{419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Win32.ActiveCfg = Debug_Generic|Win32
-		{419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Win32.Build.0 = Debug_Generic|Win32
-		{419C8F80-D858-4B48-A25C-AF4007608137}.Debug|x64.ActiveCfg = Debug_Generic|x64
-		{419C8F80-D858-4B48-A25C-AF4007608137}.Debug|x64.Build.0 = Debug_Generic|x64
-		{419C8F80-D858-4B48-A25C-AF4007608137}.Release|Win32.ActiveCfg = Release_Generic|Win32
-		{419C8F80-D858-4B48-A25C-AF4007608137}.Release|Win32.Build.0 = Release_Generic|Win32
-		{419C8F80-D858-4B48-A25C-AF4007608137}.Release|x64.ActiveCfg = Release_Generic|x64
-		{419C8F80-D858-4B48-A25C-AF4007608137}.Release|x64.Build.0 = Release_Generic|x64
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.All|Win32.ActiveCfg = Release|x64
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.All|x64.ActiveCfg = Release|x64
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.All|x64.Build.0 = Release|x64
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Win32.Build.0 = Debug|Win32
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|x64.ActiveCfg = Debug|x64
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|x64.Build.0 = Debug|x64
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.ActiveCfg = Release|Win32
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.Build.0 = Release|Win32
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|x64.ActiveCfg = Release|x64
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|x64.Build.0 = Release|x64
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.All|Win32.ActiveCfg = Release|x64
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.All|x64.ActiveCfg = Release|x64
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.All|x64.Build.0 = Release|x64
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.ActiveCfg = Debug|Win32
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.Build.0 = Debug|Win32
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|x64.ActiveCfg = Debug|x64
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|x64.Build.0 = Debug|x64
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.ActiveCfg = Release|Win32
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.Build.0 = Release|Win32
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|x64.ActiveCfg = Release|x64
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|x64.Build.0 = Release|x64
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.All|Win32.ActiveCfg = Release|x64
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.All|x64.ActiveCfg = Release|x64
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.All|x64.Build.0 = Release|x64
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Debug|Win32.Build.0 = Debug|Win32
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Debug|x64.ActiveCfg = Debug|x64
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Debug|x64.Build.0 = Debug|x64
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Release|Win32.ActiveCfg = Release|Win32
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Release|Win32.Build.0 = Release|Win32
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Release|x64.ActiveCfg = Release|x64
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Release|x64.Build.0 = Release|x64
-		{0B6C905B-142E-4999-B39D-92FF7951E921}.All|Win32.ActiveCfg = Release|x64
-		{0B6C905B-142E-4999-B39D-92FF7951E921}.All|x64.ActiveCfg = Release|x64
-		{0B6C905B-142E-4999-B39D-92FF7951E921}.All|x64.Build.0 = Release|x64
-		{0B6C905B-142E-4999-B39D-92FF7951E921}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0B6C905B-142E-4999-B39D-92FF7951E921}.Debug|Win32.Build.0 = Debug|Win32
-		{0B6C905B-142E-4999-B39D-92FF7951E921}.Debug|x64.ActiveCfg = Debug|x64
-		{0B6C905B-142E-4999-B39D-92FF7951E921}.Debug|x64.Build.0 = Debug|x64
-		{0B6C905B-142E-4999-B39D-92FF7951E921}.Release|Win32.ActiveCfg = Release|Win32
-		{0B6C905B-142E-4999-B39D-92FF7951E921}.Release|Win32.Build.0 = Release|Win32
-		{0B6C905B-142E-4999-B39D-92FF7951E921}.Release|x64.ActiveCfg = Release|x64
-		{0B6C905B-142E-4999-B39D-92FF7951E921}.Release|x64.Build.0 = Release|x64
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.All|Win32.ActiveCfg = Release|x64
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.All|x64.ActiveCfg = Release|x64
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.All|x64.Build.0 = Release|x64
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|Win32.Build.0 = Debug|Win32
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|x64.ActiveCfg = Debug|x64
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|x64.Build.0 = Debug|x64
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.ActiveCfg = Release|Win32
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.Build.0 = Release|Win32
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|x64.ActiveCfg = Release|x64
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|x64.Build.0 = Release|x64
-		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.All|Win32.ActiveCfg = Release|x64
-		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.All|x64.ActiveCfg = Release|x64
-		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.All|x64.Build.0 = Release|x64
-		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|Win32.Build.0 = Debug|Win32
-		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|x64.ActiveCfg = Debug|x64
-		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|x64.Build.0 = Debug|x64
-		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|Win32.ActiveCfg = Release|Win32
-		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|Win32.Build.0 = Release|Win32
-		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|x64.ActiveCfg = Release|x64
-		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|x64.Build.0 = Release|x64
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.All|Win32.ActiveCfg = Release|x64
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.All|x64.ActiveCfg = Release|x64
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.All|x64.Build.0 = Release|x64
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Debug|Win32.ActiveCfg = Debug|Win32
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Debug|Win32.Build.0 = Debug|Win32
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Debug|x64.ActiveCfg = Debug|x64
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Debug|x64.Build.0 = Debug|x64
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Release|Win32.ActiveCfg = Release|Win32
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Release|Win32.Build.0 = Release|Win32
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Release|x64.ActiveCfg = Release|x64
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Release|x64.Build.0 = Release|x64
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.All|Win32.ActiveCfg = Release|x64
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.All|x64.ActiveCfg = Release|x64
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.All|x64.Build.0 = Release|x64
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|Win32.Build.0 = Debug|Win32
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|x64.ActiveCfg = Debug|x64
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|x64.Build.0 = Debug|x64
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Release|Win32.ActiveCfg = Release|Win32
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Release|Win32.Build.0 = Release|Win32
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Release|x64.ActiveCfg = Release|x64
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Release|x64.Build.0 = Release|x64
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|Win32.ActiveCfg = Release|x64
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|x64.ActiveCfg = Release|x64
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|x64.Build.0 = Release|x64
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.ActiveCfg = Debug|Win32
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.Build.0 = Debug|Win32
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|x64.ActiveCfg = Debug|x64
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|x64.Build.0 = Debug|x64
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.ActiveCfg = Release|Win32
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.Build.0 = Release|Win32
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|x64.ActiveCfg = Release|x64
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|x64.Build.0 = Release|x64
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|Win32.ActiveCfg = Release|x64
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|x64.ActiveCfg = Release|x64
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|x64.Build.0 = Release|x64
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.Build.0 = Debug|Win32
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|x64.ActiveCfg = Debug|x64
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|x64.Build.0 = Debug|x64
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.ActiveCfg = Release|Win32
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.Build.0 = Release|Win32
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|x64.ActiveCfg = Release|x64
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|x64.Build.0 = Release|x64
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.All|Win32.ActiveCfg = Release_Dynamic|Win32
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.All|Win32.Build.0 = Release_Dynamic|Win32
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.All|x64.ActiveCfg = Release_Dynamic|x64
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.All|x64.Build.0 = Release_Dynamic|x64
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Debug|Win32.Build.0 = Debug|Win32
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Debug|x64.ActiveCfg = Debug|x64
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Debug|x64.Build.0 = Debug|x64
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Release|Win32.ActiveCfg = Release|Win32
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Release|Win32.Build.0 = Release|Win32
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Release|x64.ActiveCfg = Release|x64
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Release|x64.Build.0 = Release|x64
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.All|Win32.ActiveCfg = Release_Static_SSE|x64
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.All|x64.ActiveCfg = Release_Static_SSE|x64
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.All|x64.Build.0 = Release_Static_SSE|x64
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Debug|Win32.ActiveCfg = Debug|Win32
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Debug|Win32.Build.0 = Debug|Win32
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Debug|x64.ActiveCfg = Debug|x64
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Debug|x64.Build.0 = Debug|x64
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Release|Win32.ActiveCfg = Release|Win32
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Release|Win32.Build.0 = Release|Win32
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Release|x64.ActiveCfg = Release|x64
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Release|x64.Build.0 = Release|x64
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.All|Win32.ActiveCfg = Release|x64
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.All|x64.ActiveCfg = Release|x64
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.All|x64.Build.0 = Release|x64
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Debug|Win32.ActiveCfg = Debug|Win32
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Debug|Win32.Build.0 = Debug|Win32
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Debug|x64.ActiveCfg = Debug|x64
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Debug|x64.Build.0 = Debug|x64
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Release|Win32.ActiveCfg = Release|Win32
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Release|Win32.Build.0 = Release|Win32
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Release|x64.ActiveCfg = Release|x64
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Release|x64.Build.0 = Release|x64
-		{05C9FB27-480E-4D53-B3B7-6338E2526666}.All|Win32.ActiveCfg = Release|Win32
-		{05C9FB27-480E-4D53-B3B7-6338E2526666}.All|Win32.Build.0 = Release|Win32
-		{05C9FB27-480E-4D53-B3B7-6338E2526666}.All|x64.ActiveCfg = Release|Win32
-		{05C9FB27-480E-4D53-B3B7-6338E2526666}.Debug|Win32.ActiveCfg = Debug|Win32
-		{05C9FB27-480E-4D53-B3B7-6338E2526666}.Debug|x64.ActiveCfg = Debug|Win32
-		{05C9FB27-480E-4D53-B3B7-6338E2526666}.Release|Win32.ActiveCfg = Release|Win32
-		{05C9FB27-480E-4D53-B3B7-6338E2526666}.Release|x64.ActiveCfg = Release|Win32
-		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.All|Win32.ActiveCfg = Release|Win32
-		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.All|x64.ActiveCfg = Release|Win32
-		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Debug|Win32.Build.0 = Debug|Win32
-		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Debug|x64.ActiveCfg = Debug|x64
-		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Debug|x64.Build.0 = Debug|x64
-		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Release|Win32.ActiveCfg = Release|Win32
-		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Release|Win32.Build.0 = Release|Win32
-		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Release|x64.ActiveCfg = Release|x64
-		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Release|x64.Build.0 = Release|x64
-		{48414740-C693-4968-9846-EE058020C64F}.All|Win32.ActiveCfg = Release|Win32
-		{48414740-C693-4968-9846-EE058020C64F}.All|x64.ActiveCfg = Release|Win32
-		{48414740-C693-4968-9846-EE058020C64F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{48414740-C693-4968-9846-EE058020C64F}.Debug|Win32.Build.0 = Debug|Win32
-		{48414740-C693-4968-9846-EE058020C64F}.Debug|x64.ActiveCfg = Debug|x64
-		{48414740-C693-4968-9846-EE058020C64F}.Debug|x64.Build.0 = Debug|x64
-		{48414740-C693-4968-9846-EE058020C64F}.Release|Win32.ActiveCfg = Release|Win32
-		{48414740-C693-4968-9846-EE058020C64F}.Release|Win32.Build.0 = Release|Win32
-		{48414740-C693-4968-9846-EE058020C64F}.Release|x64.ActiveCfg = Release|x64
-		{48414740-C693-4968-9846-EE058020C64F}.Release|x64.Build.0 = Release|x64
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.ActiveCfg = All|Win32
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.Build.0 = All|Win32
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|x64.ActiveCfg = All|Win32
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.ActiveCfg = All|Win32
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.Build.0 = All|Win32
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|x64.ActiveCfg = All|Win32
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|x64.Build.0 = All|Win32
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|Win32.ActiveCfg = All|Win32
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|Win32.Build.0 = All|Win32
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|x64.ActiveCfg = All|Win32
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|x64.Build.0 = All|Win32
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.ActiveCfg = All|Win32
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.Build.0 = All|Win32
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|x64.ActiveCfg = All|Win32
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.ActiveCfg = All|Win32
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.Build.0 = All|Win32
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|x64.ActiveCfg = All|Win32
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|x64.Build.0 = All|Win32
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|Win32.ActiveCfg = All|Win32
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|Win32.Build.0 = All|Win32
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|x64.ActiveCfg = All|Win32
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|x64.Build.0 = All|Win32
-		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.All|Win32.ActiveCfg = Release|x64
-		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.All|x64.ActiveCfg = Release|x64
-		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.All|x64.Build.0 = Release|x64
-		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.Debug|Win32.ActiveCfg = Debug|Win32
-		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.Debug|x64.ActiveCfg = Debug|x64
-		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.Release|Win32.ActiveCfg = Release|Win32
-		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.Release|x64.ActiveCfg = Release|x64
-		{1F0A8A77-E661-418F-BB92-82172AE43803}.All|Win32.ActiveCfg = Release|Win32
-		{1F0A8A77-E661-418F-BB92-82172AE43803}.All|x64.ActiveCfg = Release|Win32
-		{1F0A8A77-E661-418F-BB92-82172AE43803}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1F0A8A77-E661-418F-BB92-82172AE43803}.Debug|Win32.Build.0 = Debug|Win32
-		{1F0A8A77-E661-418F-BB92-82172AE43803}.Debug|x64.ActiveCfg = Debug|Win32
-		{1F0A8A77-E661-418F-BB92-82172AE43803}.Release|Win32.ActiveCfg = Release|Win32
-		{1F0A8A77-E661-418F-BB92-82172AE43803}.Release|x64.ActiveCfg = Release|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.All|Win32.ActiveCfg = Release|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.All|Win32.Build.0 = Release|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.All|x64.ActiveCfg = Release|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.All|x64.Build.0 = Release|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Debug|Win32.ActiveCfg = Debug|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Debug|Win32.Build.0 = Debug|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Debug|x64.ActiveCfg = Debug|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Debug|x64.Build.0 = Debug|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Release|Win32.ActiveCfg = Release|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Release|Win32.Build.0 = Release|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Release|x64.ActiveCfg = Release|Win32
-		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Release|x64.Build.0 = Release|Win32
-		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.All|Win32.ActiveCfg = Release|Win32
-		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.All|x64.ActiveCfg = Release|Win32
-		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.Debug|Win32.ActiveCfg = Debug|Win32
-		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.Debug|Win32.Build.0 = Debug|Win32
-		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.Debug|x64.ActiveCfg = Debug|Win32
-		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.Release|Win32.ActiveCfg = Release|Win32
-		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.Release|x64.ActiveCfg = Release|Win32
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.All|Win32.ActiveCfg = Release|Win32
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.All|Win32.Build.0 = Release|Win32
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.All|x64.ActiveCfg = Release|Win32
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.All|x64.Build.0 = Release|Win32
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Debug|Win32.Build.0 = Debug|Win32
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Debug|x64.ActiveCfg = Debug|x64
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Debug|x64.Build.0 = Debug|x64
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Release|Win32.ActiveCfg = Release|Win32
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Release|Win32.Build.0 = Release|Win32
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Release|x64.ActiveCfg = Release|x64
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Release|x64.Build.0 = Release|x64
-		{BA599D0A-4310-4505-91DA-6A6447B3E289}.All|Win32.ActiveCfg = Release|Win32
-		{BA599D0A-4310-4505-91DA-6A6447B3E289}.All|x64.ActiveCfg = Release|Win32
-		{BA599D0A-4310-4505-91DA-6A6447B3E289}.Debug|Win32.ActiveCfg = Debug|Win32
-		{BA599D0A-4310-4505-91DA-6A6447B3E289}.Debug|Win32.Build.0 = Debug|Win32
-		{BA599D0A-4310-4505-91DA-6A6447B3E289}.Debug|x64.ActiveCfg = Debug|x64
-		{BA599D0A-4310-4505-91DA-6A6447B3E289}.Release|Win32.ActiveCfg = Release|Win32
-		{BA599D0A-4310-4505-91DA-6A6447B3E289}.Release|x64.ActiveCfg = Release|x64
-		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.All|Win32.ActiveCfg = Release|Win32
-		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.All|x64.ActiveCfg = Release|Win32
-		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Debug|Win32.ActiveCfg = Debug|Win32
-		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Debug|Win32.Build.0 = Debug|Win32
-		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Debug|x64.ActiveCfg = Debug|x64
-		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Release|Win32.ActiveCfg = Release|Win32
-		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Release|x64.ActiveCfg = Release|x64
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.All|Win32.ActiveCfg = Release|x64
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.All|x64.ActiveCfg = Release|x64
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.All|x64.Build.0 = Release|x64
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|Win32.Build.0 = Debug|Win32
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|x64.ActiveCfg = Debug|x64
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|x64.Build.0 = Debug|x64
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Release|Win32.ActiveCfg = Release|Win32
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Release|Win32.Build.0 = Release|Win32
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Release|x64.ActiveCfg = Release|x64
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Release|x64.Build.0 = Release|x64
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.All|Win32.ActiveCfg = Release|x64
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.All|Win32.Build.0 = Release|x64
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.All|x64.ActiveCfg = Release|x64
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.All|x64.Build.0 = Release|x64
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Debug|Win32.Build.0 = Debug|Win32
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Debug|x64.ActiveCfg = Debug|x64
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Debug|x64.Build.0 = Debug|x64
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Release|Win32.ActiveCfg = Release|Win32
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Release|Win32.Build.0 = Release|Win32
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Release|x64.ActiveCfg = Release|x64
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Release|x64.Build.0 = Release|x64
-		{432DB165-1EB2-4781-A9C0-71E62610B20A}.All|Win32.ActiveCfg = Release|x64
-		{432DB165-1EB2-4781-A9C0-71E62610B20A}.All|x64.ActiveCfg = Release|x64
-		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|Win32.Build.0 = Debug|Win32
-		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|x64.ActiveCfg = Debug|x64
-		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|x64.Build.0 = Debug|x64
-		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|Win32.ActiveCfg = Release|Win32
-		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|Win32.Build.0 = Release|Win32
-		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|x64.ActiveCfg = Release|x64
-		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|x64.Build.0 = Release|x64
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|Win32.ActiveCfg = Release|Win32
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|Win32.Build.0 = Release|Win32
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|x64.ActiveCfg = Release|Win32
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.Build.0 = Debug|Win32
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|x64.ActiveCfg = Debug|x64
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|x64.Build.0 = Debug|x64
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.ActiveCfg = Release|Win32
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.Build.0 = Release|Win32
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|x64.ActiveCfg = Release|x64
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|x64.Build.0 = Release|x64
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.All|Win32.ActiveCfg = Release|x64
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.All|x64.ActiveCfg = Release|x64
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.All|x64.Build.0 = Release|x64
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Debug|Win32.Build.0 = Debug|Win32
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Debug|x64.ActiveCfg = Debug|x64
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Debug|x64.Build.0 = Debug|x64
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Release|Win32.ActiveCfg = Release|Win32
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Release|Win32.Build.0 = Release|Win32
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Release|x64.ActiveCfg = Release|x64
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Release|x64.Build.0 = Release|x64
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.All|Win32.ActiveCfg = Release|Win32
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.All|Win32.Build.0 = Release|Win32
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.All|x64.ActiveCfg = Release|Win32
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Win32.ActiveCfg = Debug|Win32
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Win32.Build.0 = Debug|Win32
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|x64.ActiveCfg = Debug|x64
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|x64.Build.0 = Debug|x64
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Win32.ActiveCfg = Release|Win32
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Win32.Build.0 = Release|Win32
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|x64.ActiveCfg = Release|x64
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|x64.Build.0 = Release|x64
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.All|Win32.ActiveCfg = Release|Win32
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.All|Win32.Build.0 = Release|Win32
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.All|x64.ActiveCfg = Release|Win32
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Debug|Win32.Build.0 = Debug|Win32
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Debug|x64.ActiveCfg = Debug|x64
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Debug|x64.Build.0 = Debug|x64
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Release|Win32.ActiveCfg = Release|Win32
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Release|Win32.Build.0 = Release|Win32
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Release|x64.ActiveCfg = Release|x64
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Release|x64.Build.0 = Release|x64
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.All|Win32.ActiveCfg = Release|Win32
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.All|Win32.Build.0 = Release|Win32
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.All|x64.ActiveCfg = Release|Win32
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Debug|Win32.Build.0 = Debug|Win32
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Debug|x64.ActiveCfg = Debug|x64
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Debug|x64.Build.0 = Debug|x64
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Release|Win32.ActiveCfg = Release|Win32
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Release|Win32.Build.0 = Release|Win32
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Release|x64.ActiveCfg = Release|x64
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Release|x64.Build.0 = Release|x64
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.All|Win32.ActiveCfg = Release|Win32
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.All|Win32.Build.0 = Release|Win32
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.All|x64.ActiveCfg = Release|Win32
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Debug|Win32.ActiveCfg = Debug|Win32
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Debug|Win32.Build.0 = Debug|Win32
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Debug|x64.ActiveCfg = Debug|x64
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Debug|x64.Build.0 = Debug|x64
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Release|Win32.ActiveCfg = Release|Win32
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Release|Win32.Build.0 = Release|Win32
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Release|x64.ActiveCfg = Release|x64
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Release|x64.Build.0 = Release|x64
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.All|Win32.ActiveCfg = Release|Win32
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.All|Win32.Build.0 = Release|Win32
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.All|x64.ActiveCfg = Release|Win32
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Debug|Win32.ActiveCfg = Debug|Win32
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Debug|Win32.Build.0 = Debug|Win32
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Debug|x64.ActiveCfg = Debug|x64
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Debug|x64.Build.0 = Debug|x64
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Release|Win32.ActiveCfg = Release|Win32
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Release|Win32.Build.0 = Release|Win32
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Release|x64.ActiveCfg = Release|x64
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Release|x64.Build.0 = Release|x64
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.All|Win32.ActiveCfg = Release|Win32
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.All|Win32.Build.0 = Release|Win32
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.All|x64.ActiveCfg = Release|Win32
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Debug|Win32.ActiveCfg = Debug|Win32
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Debug|Win32.Build.0 = Debug|Win32
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Debug|x64.ActiveCfg = Debug|x64
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Debug|x64.Build.0 = Debug|x64
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Release|Win32.ActiveCfg = Release|Win32
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Release|Win32.Build.0 = Release|Win32
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Release|x64.ActiveCfg = Release|x64
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Release|x64.Build.0 = Release|x64
-		{504B3154-7A4F-459D-9877-B951021C3F1F}.All|Win32.ActiveCfg = Release|Win32
-		{504B3154-7A4F-459D-9877-B951021C3F1F}.All|Win32.Build.0 = Release|Win32
-		{504B3154-7A4F-459D-9877-B951021C3F1F}.All|x64.ActiveCfg = Release|Win32
-		{504B3154-7A4F-459D-9877-B951021C3F1F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{504B3154-7A4F-459D-9877-B951021C3F1F}.Debug|Win32.Build.0 = Debug|Win32
-		{504B3154-7A4F-459D-9877-B951021C3F1F}.Debug|x64.ActiveCfg = Debug|x64
-		{504B3154-7A4F-459D-9877-B951021C3F1F}.Debug|x64.Build.0 = Debug|x64
-		{504B3154-7A4F-459D-9877-B951021C3F1F}.Release|Win32.ActiveCfg = Release|Win32
-		{504B3154-7A4F-459D-9877-B951021C3F1F}.Release|Win32.Build.0 = Release|Win32
-		{504B3154-7A4F-459D-9877-B951021C3F1F}.Release|x64.ActiveCfg = Release|x64
-		{504B3154-7A4F-459D-9877-B951021C3F1F}.Release|x64.Build.0 = Release|x64
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.All|Win32.ActiveCfg = Release|Win32
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.All|Win32.Build.0 = Release|Win32
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.All|x64.ActiveCfg = Release|Win32
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Debug|Win32.Build.0 = Debug|Win32
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Debug|x64.ActiveCfg = Debug|x64
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Debug|x64.Build.0 = Debug|x64
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Release|Win32.ActiveCfg = Release|Win32
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Release|Win32.Build.0 = Release|Win32
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Release|x64.ActiveCfg = Release|x64
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Release|x64.Build.0 = Release|x64
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.All|Win32.ActiveCfg = Release|Win32
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.All|Win32.Build.0 = Release|Win32
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.All|x64.ActiveCfg = Release|Win32
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Debug|Win32.Build.0 = Debug|Win32
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Debug|x64.ActiveCfg = Debug|x64
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Debug|x64.Build.0 = Debug|x64
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Release|Win32.ActiveCfg = Release|Win32
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Release|Win32.Build.0 = Release|Win32
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Release|x64.ActiveCfg = Release|x64
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Release|x64.Build.0 = Release|x64
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.All|Win32.ActiveCfg = Release|x64
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.All|x64.ActiveCfg = Release|x64
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.All|x64.Build.0 = Release|x64
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Debug|Win32.Build.0 = Debug|Win32
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Debug|x64.ActiveCfg = Debug|x64
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Debug|x64.Build.0 = Debug|x64
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Release|Win32.ActiveCfg = Release|Win32
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Release|Win32.Build.0 = Release|Win32
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Release|x64.ActiveCfg = Release|x64
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Release|x64.Build.0 = Release|x64
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.All|Win32.ActiveCfg = Release|Win32
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.All|Win32.Build.0 = Release|Win32
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.All|x64.ActiveCfg = Release|Win32
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Debug|Win32.Build.0 = Debug|Win32
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Debug|x64.ActiveCfg = Debug|Win32
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Debug|x64.Build.0 = Debug|Win32
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Release|Win32.ActiveCfg = Release|Win32
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Release|Win32.Build.0 = Release|Win32
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Release|x64.ActiveCfg = Release|Win32
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Release|x64.Build.0 = Release|Win32
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.All|Win32.ActiveCfg = Release|x64
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.All|x64.ActiveCfg = Release|x64
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.All|x64.Build.0 = Release|x64
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Debug|Win32.ActiveCfg = Debug|Win32
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Debug|Win32.Build.0 = Debug|Win32
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Debug|x64.ActiveCfg = Debug|x64
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Debug|x64.Build.0 = Debug|x64
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Release|Win32.ActiveCfg = Release|Win32
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Release|Win32.Build.0 = Release|Win32
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Release|x64.ActiveCfg = Release|x64
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Release|x64.Build.0 = Release|x64
-		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.All|Win32.ActiveCfg = Release|Win32
-		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.All|Win32.Build.0 = Release|Win32
-		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.All|x64.ActiveCfg = Release|Win32
-		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.Debug|x64.ActiveCfg = Debug|Win32
-		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.Release|Win32.ActiveCfg = Release|Win32
-		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.Release|x64.ActiveCfg = Release|Win32
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.All|Win32.ActiveCfg = Release|x64
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.All|x64.ActiveCfg = Release|x64
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.All|x64.Build.0 = Release|x64
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Debug|Win32.ActiveCfg = Debug|Win32
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Debug|Win32.Build.0 = Debug|Win32
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Debug|x64.ActiveCfg = Debug|x64
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Debug|x64.Build.0 = Debug|x64
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Release|Win32.ActiveCfg = Release|Win32
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Release|Win32.Build.0 = Release|Win32
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Release|x64.ActiveCfg = Release|x64
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Release|x64.Build.0 = Release|x64
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.All|Win32.ActiveCfg = Release|x64
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.All|x64.ActiveCfg = Release|x64
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.All|x64.Build.0 = Release|x64
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Debug|Win32.Build.0 = Debug|Win32
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Debug|x64.ActiveCfg = Debug|x64
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Debug|x64.Build.0 = Debug|x64
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Release|Win32.ActiveCfg = Release|Win32
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Release|Win32.Build.0 = Release|Win32
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Release|x64.ActiveCfg = Release|x64
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Release|x64.Build.0 = Release|x64
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.All|Win32.ActiveCfg = Release|Win32
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.All|Win32.Build.0 = Release|Win32
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.All|x64.ActiveCfg = Release|Win32
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|Win32.ActiveCfg = Debug|Win32
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|Win32.Build.0 = Debug|Win32
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|x64.ActiveCfg = Debug|x64
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|x64.Build.0 = Debug|x64
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|Win32.ActiveCfg = Release|Win32
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|Win32.Build.0 = Release|Win32
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|x64.ActiveCfg = Release|x64
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|x64.Build.0 = Release|x64
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.All|Win32.ActiveCfg = Release|Win32
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.All|Win32.Build.0 = Release|Win32
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.All|x64.ActiveCfg = Release|Win32
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Debug|Win32.Build.0 = Debug|Win32
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Debug|x64.ActiveCfg = Debug|x64
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Debug|x64.Build.0 = Debug|x64
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Release|Win32.ActiveCfg = Release|Win32
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Release|Win32.Build.0 = Release|Win32
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Release|x64.ActiveCfg = Release|x64
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Release|x64.Build.0 = Release|x64
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.All|Win32.ActiveCfg = Release|x64
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.All|x64.ActiveCfg = Release|x64
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.All|x64.Build.0 = Release|x64
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Debug|Win32.Build.0 = Debug|Win32
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Debug|x64.ActiveCfg = Debug|x64
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Debug|x64.Build.0 = Debug|x64
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Release|Win32.ActiveCfg = Release|Win32
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Release|Win32.Build.0 = Release|Win32
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Release|x64.ActiveCfg = Release|x64
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Release|x64.Build.0 = Release|x64
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.All|Win32.ActiveCfg = Release|x64
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.All|x64.ActiveCfg = Release|x64
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.All|x64.Build.0 = Release|x64
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Debug|Win32.Build.0 = Debug|Win32
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Debug|x64.ActiveCfg = Debug|x64
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Debug|x64.Build.0 = Debug|x64
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Release|Win32.ActiveCfg = Release|Win32
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Release|Win32.Build.0 = Release|Win32
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Release|x64.ActiveCfg = Release|x64
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Release|x64.Build.0 = Release|x64
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|Win32.ActiveCfg = Release|x64
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|x64.ActiveCfg = Release|x64
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|x64.Build.0 = Release|x64
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.ActiveCfg = Debug|Win32
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.Build.0 = Debug|Win32
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|x64.ActiveCfg = Debug|x64
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|x64.Build.0 = Debug|x64
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.ActiveCfg = Release|Win32
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.Build.0 = Release|Win32
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|x64.ActiveCfg = Release|x64
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|x64.Build.0 = Release|x64
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.All|Win32.ActiveCfg = Release|x64
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.All|x64.ActiveCfg = Release|x64
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.All|x64.Build.0 = Release|x64
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Debug|Win32.Build.0 = Debug|Win32
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Debug|x64.ActiveCfg = Debug|x64
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Debug|x64.Build.0 = Debug|x64
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Release|Win32.ActiveCfg = Release|Win32
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Release|Win32.Build.0 = Release|Win32
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Release|x64.ActiveCfg = Release|x64
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Release|x64.Build.0 = Release|x64
-		{05C9FB27-480E-4D53-B3B7-7338E2514666}.All|Win32.ActiveCfg = Release|Win32
-		{05C9FB27-480E-4D53-B3B7-7338E2514666}.All|Win32.Build.0 = Release|Win32
-		{05C9FB27-480E-4D53-B3B7-7338E2514666}.All|x64.ActiveCfg = Release|Win32
-		{05C9FB27-480E-4D53-B3B7-7338E2514666}.Debug|Win32.ActiveCfg = Debug|Win32
-		{05C9FB27-480E-4D53-B3B7-7338E2514666}.Debug|x64.ActiveCfg = Debug|x64
-		{05C9FB27-480E-4D53-B3B7-7338E2514666}.Release|Win32.ActiveCfg = Release|Win32
-		{05C9FB27-480E-4D53-B3B7-7338E2514666}.Release|x64.ActiveCfg = Release|x64
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.All|Win32.ActiveCfg = Release|x64
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.All|x64.ActiveCfg = Release|x64
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.All|x64.Build.0 = Release|x64
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Debug|Win32.Build.0 = Debug|Win32
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Debug|x64.ActiveCfg = Debug|x64
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Debug|x64.Build.0 = Debug|x64
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Release|Win32.ActiveCfg = Release|Win32
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Release|Win32.Build.0 = Release|Win32
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Release|x64.ActiveCfg = Release|x64
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Release|x64.Build.0 = Release|x64
-		{7C22BDFF-CC09-400C-8A09-660733980028}.All|Win32.ActiveCfg = Release|x64
-		{7C22BDFF-CC09-400C-8A09-660733980028}.All|x64.ActiveCfg = Release|x64
-		{7C22BDFF-CC09-400C-8A09-660733980028}.All|x64.Build.0 = Release|x64
-		{7C22BDFF-CC09-400C-8A09-660733980028}.Debug|Win32.ActiveCfg = Debug|Win32
-		{7C22BDFF-CC09-400C-8A09-660733980028}.Debug|Win32.Build.0 = Debug|Win32
-		{7C22BDFF-CC09-400C-8A09-660733980028}.Debug|x64.ActiveCfg = Debug|x64
-		{7C22BDFF-CC09-400C-8A09-660733980028}.Debug|x64.Build.0 = Debug|x64
-		{7C22BDFF-CC09-400C-8A09-660733980028}.Release|Win32.ActiveCfg = Release|Win32
-		{7C22BDFF-CC09-400C-8A09-660733980028}.Release|Win32.Build.0 = Release|Win32
-		{7C22BDFF-CC09-400C-8A09-660733980028}.Release|x64.ActiveCfg = Release|x64
-		{7C22BDFF-CC09-400C-8A09-660733980028}.Release|x64.Build.0 = Release|x64
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.All|Win32.ActiveCfg = Release|Win32
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.All|Win32.Build.0 = Release|Win32
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.All|x64.ActiveCfg = Release|x64
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.All|x64.Build.0 = Release|x64
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Debug|Win32.Build.0 = Debug|Win32
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Debug|x64.ActiveCfg = Debug|x64
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Debug|x64.Build.0 = Debug|x64
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Release|Win32.ActiveCfg = Release|Win32
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Release|Win32.Build.0 = Release|Win32
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Release|x64.ActiveCfg = Release|x64
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Release|x64.Build.0 = Release|x64
-		{23B4D303-79FC-49E0-89E2-2280E7E28940}.All|Win32.ActiveCfg = Release|x64
-		{23B4D303-79FC-49E0-89E2-2280E7E28940}.All|x64.ActiveCfg = Release|x64
-		{23B4D303-79FC-49E0-89E2-2280E7E28940}.All|x64.Build.0 = Release|x64
-		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Debug|Win32.ActiveCfg = Debug|Win32
-		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Debug|Win32.Build.0 = Debug|Win32
-		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Debug|x64.ActiveCfg = Debug|x64
-		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Debug|x64.Build.0 = Debug|x64
-		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|Win32.ActiveCfg = Release|Win32
-		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|Win32.Build.0 = Release|Win32
-		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|x64.ActiveCfg = Release|x64
-		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|x64.Build.0 = Release|x64
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.All|Win32.ActiveCfg = Release|x64
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.All|x64.ActiveCfg = Release|x64
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.All|x64.Build.0 = Release|x64
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Debug|Win32.Build.0 = Debug|Win32
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Debug|x64.ActiveCfg = Debug|x64
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Debug|x64.Build.0 = Debug|x64
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|Win32.ActiveCfg = Release|Win32
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|Win32.Build.0 = Release|Win32
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|x64.ActiveCfg = Release|x64
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|x64.Build.0 = Release|x64
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.All|Win32.ActiveCfg = Release|x64
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.All|x64.ActiveCfg = Release|x64
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.All|x64.Build.0 = Release|x64
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|Win32.ActiveCfg = Debug|Win32
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|Win32.Build.0 = Debug|Win32
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|x64.ActiveCfg = Debug|x64
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|x64.Build.0 = Debug|x64
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|Win32.ActiveCfg = Release|Win32
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|Win32.Build.0 = Release|Win32
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|x64.ActiveCfg = Release|x64
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|x64.Build.0 = Release|x64
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.All|Win32.ActiveCfg = Release|x64
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.All|x64.ActiveCfg = Release|x64
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.All|x64.Build.0 = Release|x64
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Debug|Win32.ActiveCfg = Debug|Win32
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Debug|Win32.Build.0 = Debug|Win32
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Debug|x64.ActiveCfg = Debug|x64
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Debug|x64.Build.0 = Debug|x64
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Release|Win32.ActiveCfg = Release|Win32
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Release|Win32.Build.0 = Release|Win32
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Release|x64.ActiveCfg = Release|x64
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Release|x64.Build.0 = Release|x64
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.All|Win32.ActiveCfg = Release|x64
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.All|x64.ActiveCfg = Release|x64
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.All|x64.Build.0 = Release|x64
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|Win32.ActiveCfg = Debug|Win32
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|Win32.Build.0 = Debug|Win32
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|x64.ActiveCfg = Debug|x64
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|x64.Build.0 = Debug|x64
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|Win32.ActiveCfg = Release|Win32
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|Win32.Build.0 = Release|Win32
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|x64.ActiveCfg = Release|x64
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|x64.Build.0 = Release|x64
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.All|Win32.ActiveCfg = Release|x64
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.All|x64.ActiveCfg = Release|x64
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.All|x64.Build.0 = Release|x64
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|Win32.Build.0 = Debug|Win32
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|x64.ActiveCfg = Debug|x64
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|x64.Build.0 = Debug|x64
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|Win32.ActiveCfg = Release|Win32
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|Win32.Build.0 = Release|Win32
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|x64.ActiveCfg = Release|x64
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|x64.Build.0 = Release|x64
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.All|Win32.ActiveCfg = Release|x64
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.All|x64.ActiveCfg = Release|x64
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.All|x64.Build.0 = Release|x64
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|Win32.Build.0 = Debug|Win32
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|x64.ActiveCfg = Debug|x64
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|x64.Build.0 = Debug|x64
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|Win32.ActiveCfg = Release|Win32
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|Win32.Build.0 = Release|Win32
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|x64.ActiveCfg = Release|x64
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|x64.Build.0 = Release|x64
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|Win32.ActiveCfg = Release|x64
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|x64.ActiveCfg = Release|x64
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|x64.Build.0 = Release|x64
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.ActiveCfg = Debug|Win32
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.Build.0 = Debug|Win32
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x64.ActiveCfg = Debug|x64
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x64.Build.0 = Debug|x64
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.ActiveCfg = Release|Win32
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.Build.0 = Release|Win32
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x64.ActiveCfg = Release|x64
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x64.Build.0 = Release|x64
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|Win32.ActiveCfg = Release|x64
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64.ActiveCfg = Release|x64
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64.Build.0 = Release|x64
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|Win32.ActiveCfg = Debug|Win32
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|Win32.Build.0 = Debug|Win32
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x64.ActiveCfg = Debug|x64
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x64.Build.0 = Debug|x64
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|Win32.ActiveCfg = Release|Win32
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|Win32.Build.0 = Release|Win32
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x64.ActiveCfg = Release|x64
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x64.Build.0 = Release|x64
-		{C13CC324-0032-4492-9A30-310A6BD64FF5}.All|Win32.ActiveCfg = Release|Win32
-		{C13CC324-0032-4492-9A30-310A6BD64FF5}.All|Win32.Build.0 = Release|Win32
-		{C13CC324-0032-4492-9A30-310A6BD64FF5}.All|x64.ActiveCfg = Release|Win32
-		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|Win32.Build.0 = Debug|Win32
-		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|x64.ActiveCfg = Debug|x64
-		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|x64.Build.0 = Debug|x64
-		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|Win32.ActiveCfg = Release|Win32
-		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|Win32.Build.0 = Release|Win32
-		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|x64.ActiveCfg = Release|x64
-		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|x64.Build.0 = Release|x64
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.All|Win32.ActiveCfg = Release|x64
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.All|x64.ActiveCfg = Release|x64
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.All|x64.Build.0 = Release|x64
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|Win32.Build.0 = Debug|Win32
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|x64.ActiveCfg = Debug|x64
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|x64.Build.0 = Debug|x64
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Release|Win32.ActiveCfg = Release|Win32
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Release|Win32.Build.0 = Release|Win32
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Release|x64.ActiveCfg = Release|x64
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Release|x64.Build.0 = Release|x64
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.All|Win32.ActiveCfg = Release|Win32
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.All|Win32.Build.0 = Release|Win32
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.All|x64.ActiveCfg = Release|Win32
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Debug|Win32.Build.0 = Debug|Win32
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Debug|x64.ActiveCfg = Debug|Win32
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Debug|x64.Build.0 = Debug|Win32
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Release|Win32.ActiveCfg = Release|Win32
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Release|Win32.Build.0 = Release|Win32
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Release|x64.ActiveCfg = Release|Win32
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Release|x64.Build.0 = Release|Win32
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.All|Win32.ActiveCfg = Release|Win32
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.All|Win32.Build.0 = Release|Win32
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.All|x64.ActiveCfg = Release|Win32
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Debug|Win32.ActiveCfg = Debug|Win32
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Debug|Win32.Build.0 = Debug|Win32
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Debug|x64.ActiveCfg = Debug|x64
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Debug|x64.Build.0 = Debug|x64
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.ActiveCfg = Release|Win32
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.Build.0 = Release|Win32
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|x64.ActiveCfg = Release|x64
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|x64.Build.0 = Release|x64
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.All|Win32.ActiveCfg = Release|x64
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.All|x64.ActiveCfg = Release|x64
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.All|x64.Build.0 = Release|x64
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Win32.Build.0 = Debug|Win32
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|x64.ActiveCfg = Debug|x64
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|x64.Build.0 = Debug|x64
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Win32.ActiveCfg = Release|Win32
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Win32.Build.0 = Release|Win32
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|x64.ActiveCfg = Release|x64
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|x64.Build.0 = Release|x64
-		{BED7539C-0099-4A14-AD5D-30828F15A171}.All|Win32.ActiveCfg = Release|x64
-		{BED7539C-0099-4A14-AD5D-30828F15A171}.All|x64.ActiveCfg = Release|x64
-		{BED7539C-0099-4A14-AD5D-30828F15A171}.All|x64.Build.0 = Release|x64
-		{BED7539C-0099-4A14-AD5D-30828F15A171}.Debug|Win32.ActiveCfg = Debug|Win32
-		{BED7539C-0099-4A14-AD5D-30828F15A171}.Debug|Win32.Build.0 = Debug|Win32
-		{BED7539C-0099-4A14-AD5D-30828F15A171}.Debug|x64.ActiveCfg = Debug|Win32
-		{BED7539C-0099-4A14-AD5D-30828F15A171}.Debug|x64.Build.0 = Debug|Win32
-		{BED7539C-0099-4A14-AD5D-30828F15A171}.Release|Win32.ActiveCfg = Release|Win32
-		{BED7539C-0099-4A14-AD5D-30828F15A171}.Release|Win32.Build.0 = Release|Win32
-		{BED7539C-0099-4A14-AD5D-30828F15A171}.Release|x64.ActiveCfg = Release|Win32
-		{BED7539C-0099-4A14-AD5D-30828F15A171}.Release|x64.Build.0 = Release|Win32
-		{0D108721-EAE8-4BAF-8102-D8960EC93647}.All|Win32.ActiveCfg = Release|x64
-		{0D108721-EAE8-4BAF-8102-D8960EC93647}.All|x64.ActiveCfg = Release|x64
-		{0D108721-EAE8-4BAF-8102-D8960EC93647}.All|x64.Build.0 = Release|x64
-		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Win32.Build.0 = Debug|Win32
-		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|x64.ActiveCfg = Debug|x64
-		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|x64.Build.0 = Debug|x64
-		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Win32.ActiveCfg = Release|Win32
-		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Win32.Build.0 = Release|Win32
-		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|x64.ActiveCfg = Release|x64
-		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|x64.Build.0 = Release|x64
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.All|Win32.ActiveCfg = Release|x64
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.All|x64.ActiveCfg = Release|x64
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.All|x64.Build.0 = Release|x64
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Win32.Build.0 = Debug|Win32
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|x64.ActiveCfg = Debug|x64
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|x64.Build.0 = Debug|x64
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Win32.ActiveCfg = Release|Win32
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Win32.Build.0 = Release|Win32
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|x64.ActiveCfg = Release|x64
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|x64.Build.0 = Release|x64
-		{B535402E-38D2-4D54-8360-423ACBD17192}.All|Win32.ActiveCfg = Release|x64
-		{B535402E-38D2-4D54-8360-423ACBD17192}.All|x64.ActiveCfg = Release|x64
-		{B535402E-38D2-4D54-8360-423ACBD17192}.All|x64.Build.0 = Release|x64
-		{B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Win32.Build.0 = Debug|Win32
-		{B535402E-38D2-4D54-8360-423ACBD17192}.Debug|x64.ActiveCfg = Debug|x64
-		{B535402E-38D2-4D54-8360-423ACBD17192}.Debug|x64.Build.0 = Debug|x64
-		{B535402E-38D2-4D54-8360-423ACBD17192}.Release|Win32.ActiveCfg = Release|Win32
-		{B535402E-38D2-4D54-8360-423ACBD17192}.Release|Win32.Build.0 = Release|Win32
-		{B535402E-38D2-4D54-8360-423ACBD17192}.Release|x64.ActiveCfg = Release|x64
-		{B535402E-38D2-4D54-8360-423ACBD17192}.Release|x64.Build.0 = Release|x64
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.All|Win32.ActiveCfg = Release|x86
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.All|Win32.Build.0 = Release|x86
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.All|x64.ActiveCfg = Release|x64
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.All|x64.Build.0 = Release|x64
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Debug|Win32.ActiveCfg = Debug|x86
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Debug|Win32.Build.0 = Debug|x86
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Debug|x64.ActiveCfg = Debug|x64
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Debug|x64.Build.0 = Debug|x64
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Release|Win32.ActiveCfg = Release|x86
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Release|Win32.Build.0 = Release|x86
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Release|x64.ActiveCfg = Release|x64
-		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Release|x64.Build.0 = Release|x64
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.All|Win32.ActiveCfg = All|Win32
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.All|Win32.Build.0 = All|Win32
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.All|x64.ActiveCfg = All|Win32
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|Win32.ActiveCfg = All|Win32
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|Win32.Build.0 = All|Win32
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|x64.ActiveCfg = All|Win32
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|x64.Build.0 = All|Win32
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|Win32.ActiveCfg = All|Win32
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|Win32.Build.0 = All|Win32
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|x64.ActiveCfg = All|Win32
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|x64.Build.0 = All|Win32
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.All|Win32.ActiveCfg = Release|Win32
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.All|Win32.Build.0 = Release|Win32
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.All|x64.ActiveCfg = Release|Win32
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|Win32.ActiveCfg = Debug|Win32
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|Win32.Build.0 = Debug|Win32
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|x64.ActiveCfg = Debug|x64
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|x64.Build.0 = Debug|x64
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|Win32.ActiveCfg = Release|Win32
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|Win32.Build.0 = Release|Win32
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|x64.ActiveCfg = Release|x64
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|x64.Build.0 = Release|x64
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.All|Win32.ActiveCfg = All|Win32
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.All|Win32.Build.0 = All|Win32
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.All|x64.ActiveCfg = All|Win32
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Debug|Win32.ActiveCfg = All|Win32
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Debug|Win32.Build.0 = All|Win32
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Debug|x64.ActiveCfg = All|Win32
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Debug|x64.Build.0 = All|Win32
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Release|Win32.ActiveCfg = All|Win32
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Release|Win32.Build.0 = All|Win32
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Release|x64.ActiveCfg = All|Win32
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Release|x64.Build.0 = All|Win32
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.All|Win32.ActiveCfg = Release|Win32
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.All|Win32.Build.0 = Release|Win32
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.All|x64.ActiveCfg = Release|Win32
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Debug|Win32.ActiveCfg = Debug|Win32
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Debug|Win32.Build.0 = Debug|Win32
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Debug|x64.ActiveCfg = Debug|Win32
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Debug|x64.Build.0 = Debug|Win32
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Release|Win32.ActiveCfg = Release|Win32
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Release|Win32.Build.0 = Release|Win32
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Release|x64.ActiveCfg = Release|Win32
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Release|x64.Build.0 = Release|Win32
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.All|Win32.ActiveCfg = Release|Win32
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.All|Win32.Build.0 = Release|Win32
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.All|x64.ActiveCfg = Release|x64
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.All|x64.Build.0 = Release|x64
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Debug|Win32.Build.0 = Debug|Win32
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Debug|x64.ActiveCfg = Debug|x64
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Debug|x64.Build.0 = Debug|x64
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Release|Win32.ActiveCfg = Release|Win32
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Release|Win32.Build.0 = Release|Win32
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Release|x64.ActiveCfg = Release|x64
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Release|x64.Build.0 = Release|x64
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.All|Win32.ActiveCfg = Release|Win32
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.All|Win32.Build.0 = Release|Win32
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.All|x64.ActiveCfg = Release|x64
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.All|x64.Build.0 = Release|x64
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|Win32.Build.0 = Debug|Win32
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|x64.ActiveCfg = Debug|x64
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|x64.Build.0 = Debug|x64
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.Release|Win32.ActiveCfg = Release|Win32
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.Release|Win32.Build.0 = Release|Win32
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.Release|x64.ActiveCfg = Release|x64
-		{245603E3-F580-41A5-9632-B25FE3372CBF}.Release|x64.Build.0 = Release|x64
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.All|Win32.ActiveCfg = Release|Win32
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.All|Win32.Build.0 = Release|Win32
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.All|x64.ActiveCfg = Release|x64
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.All|x64.Build.0 = Release|x64
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Debug|Win32.Build.0 = Debug|Win32
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Debug|x64.ActiveCfg = Debug|x64
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Debug|x64.Build.0 = Debug|x64
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Release|Win32.ActiveCfg = Release|Win32
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Release|Win32.Build.0 = Release|Win32
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Release|x64.ActiveCfg = Release|x64
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Release|x64.Build.0 = Release|x64
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.All|Win32.ActiveCfg = Release|Win32
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.All|Win32.Build.0 = Release|Win32
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.All|x64.ActiveCfg = Release|x64
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.All|x64.Build.0 = Release|x64
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Debug|Win32.ActiveCfg = Debug|Win32
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Debug|Win32.Build.0 = Debug|Win32
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Debug|x64.ActiveCfg = Debug|x64
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Debug|x64.Build.0 = Debug|x64
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Release|Win32.ActiveCfg = Release|Win32
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Release|Win32.Build.0 = Release|Win32
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Release|x64.ActiveCfg = Release|x64
-		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Release|x64.Build.0 = Release|x64
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.All|Win32.ActiveCfg = Release|Win32
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.All|Win32.Build.0 = Release|Win32
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.All|x64.ActiveCfg = Release|x64
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.All|x64.Build.0 = Release|x64
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Debug|Win32.ActiveCfg = Debug|Win32
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Debug|Win32.Build.0 = Debug|Win32
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Debug|x64.ActiveCfg = Debug|x64
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Debug|x64.Build.0 = Debug|x64
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|Win32.ActiveCfg = Release|Win32
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|Win32.Build.0 = Release|Win32
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|x64.ActiveCfg = Release|x64
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|x64.Build.0 = Release|x64
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.All|Win32.ActiveCfg = Release|Win32
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.All|Win32.Build.0 = Release|Win32
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.All|x64.ActiveCfg = Release|x64
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.All|x64.Build.0 = Release|x64
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Debug|Win32.ActiveCfg = Debug|Win32
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Debug|Win32.Build.0 = Debug|Win32
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Debug|x64.ActiveCfg = Debug|x64
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Debug|x64.Build.0 = Debug|x64
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Release|Win32.ActiveCfg = Release|Win32
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Release|Win32.Build.0 = Release|Win32
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Release|x64.ActiveCfg = Release|x64
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Release|x64.Build.0 = Release|x64
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.All|Win32.ActiveCfg = All|Win32
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.All|Win32.Build.0 = All|Win32
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.All|x64.ActiveCfg = All|Win32
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Debug|Win32.ActiveCfg = All|Win32
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Debug|Win32.Build.0 = All|Win32
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Debug|x64.ActiveCfg = All|Win32
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Debug|x64.Build.0 = All|Win32
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Release|Win32.ActiveCfg = All|Win32
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Release|Win32.Build.0 = All|Win32
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Release|x64.ActiveCfg = All|Win32
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Release|x64.Build.0 = All|Win32
-		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.All|Win32.ActiveCfg = Release|Any CPU
-		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.All|x64.ActiveCfg = Release|Any CPU
-		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.Debug|Win32.ActiveCfg = Debug|Any CPU
-		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.Release|Win32.ActiveCfg = Release|Any CPU
-		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.Release|x64.ActiveCfg = Release|Any CPU
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.All|Win32.ActiveCfg = Release|Win32
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.All|Win32.Build.0 = Release|Win32
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.All|x64.ActiveCfg = Release|Win32
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Debug|Win32.Build.0 = Debug|Win32
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Debug|x64.ActiveCfg = Debug|Win32
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Debug|x64.Build.0 = Debug|Win32
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Release|Win32.ActiveCfg = Release|Win32
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Release|Win32.Build.0 = Release|Win32
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Release|x64.ActiveCfg = Release|Win32
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Release|x64.Build.0 = Release|Win32
-		{97D25665-34CD-4E0C-96E7-88F0795B8883}.All|Win32.ActiveCfg = Release|Win32
-		{97D25665-34CD-4E0C-96E7-88F0795B8883}.All|Win32.Build.0 = Release|Win32
-		{97D25665-34CD-4E0C-96E7-88F0795B8883}.All|x64.ActiveCfg = Release|Win32
-		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Debug|Win32.ActiveCfg = Debug|Win32
-		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Debug|Win32.Build.0 = Debug|Win32
-		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Debug|x64.ActiveCfg = Debug|Win32
-		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Debug|x64.Build.0 = Debug|Win32
-		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Release|Win32.ActiveCfg = Release|Win32
-		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Release|Win32.Build.0 = Release|Win32
-		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Release|x64.ActiveCfg = Release|Win32
-		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Release|x64.Build.0 = Release|Win32
-		{5BE9A596-F11F-4379-928C-412F81AE182B}.All|Win32.ActiveCfg = Release|Win32
-		{5BE9A596-F11F-4379-928C-412F81AE182B}.All|Win32.Build.0 = Release|Win32
-		{5BE9A596-F11F-4379-928C-412F81AE182B}.All|x64.ActiveCfg = Release|Win32
-		{5BE9A596-F11F-4379-928C-412F81AE182B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5BE9A596-F11F-4379-928C-412F81AE182B}.Debug|Win32.Build.0 = Debug|Win32
-		{5BE9A596-F11F-4379-928C-412F81AE182B}.Debug|x64.ActiveCfg = Debug|Win32
-		{5BE9A596-F11F-4379-928C-412F81AE182B}.Debug|x64.Build.0 = Debug|Win32
-		{5BE9A596-F11F-4379-928C-412F81AE182B}.Release|Win32.ActiveCfg = Release|Win32
-		{5BE9A596-F11F-4379-928C-412F81AE182B}.Release|Win32.Build.0 = Release|Win32
-		{5BE9A596-F11F-4379-928C-412F81AE182B}.Release|x64.ActiveCfg = Release|Win32
-		{5BE9A596-F11F-4379-928C-412F81AE182B}.Release|x64.Build.0 = Release|Win32
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.All|Win32.ActiveCfg = Release|Win32
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.All|Win32.Build.0 = Release|Win32
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.All|x64.ActiveCfg = Release|Win32
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Debug|Win32.Build.0 = Debug|Win32
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Debug|x64.ActiveCfg = Debug|Win32
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Debug|x64.Build.0 = Debug|Win32
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Release|Win32.ActiveCfg = Release|Win32
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Release|Win32.Build.0 = Release|Win32
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Release|x64.ActiveCfg = Release|Win32
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Release|x64.Build.0 = Release|Win32
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.All|Win32.ActiveCfg = Release|x64
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.All|x64.ActiveCfg = Release|x64
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.All|x64.Build.0 = Release|x64
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Debug|Win32.Build.0 = Debug|Win32
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Debug|x64.ActiveCfg = Debug|x64
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Debug|x64.Build.0 = Debug|x64
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Release|Win32.ActiveCfg = Release|Win32
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Release|Win32.Build.0 = Release|Win32
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Release|x64.ActiveCfg = Release|x64
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Release|x64.Build.0 = Release|x64
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.All|Win32.ActiveCfg = Release|x64
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.All|x64.ActiveCfg = Release|x64
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.All|x64.Build.0 = Release|x64
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|Win32.ActiveCfg = Debug|Win32
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|Win32.Build.0 = Debug|Win32
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|x64.ActiveCfg = Debug|x64
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|x64.Build.0 = Debug|x64
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Release|Win32.ActiveCfg = Release|Win32
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Release|Win32.Build.0 = Release|Win32
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Release|x64.ActiveCfg = Release|x64
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Release|x64.Build.0 = Release|x64
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.All|Win32.ActiveCfg = Release|Win32
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.All|Win32.Build.0 = Release|Win32
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.All|x64.ActiveCfg = Release|x64
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.All|x64.Build.0 = Release|x64
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Debug|Win32.ActiveCfg = Debug|Win32
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Debug|Win32.Build.0 = Debug|Win32
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Debug|x64.ActiveCfg = Debug|x64
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Debug|x64.Build.0 = Debug|x64
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Release|Win32.ActiveCfg = Release|Win32
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Release|Win32.Build.0 = Release|Win32
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Release|x64.ActiveCfg = Release|x64
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Release|x64.Build.0 = Release|x64
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.All|Win32.ActiveCfg = Release|Win32
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.All|Win32.Build.0 = Release|Win32
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.All|x64.ActiveCfg = Release|x64
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.All|x64.Build.0 = Release|x64
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|Win32.Build.0 = Debug|Win32
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|x64.ActiveCfg = Debug|x64
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|x64.Build.0 = Debug|x64
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Win32.ActiveCfg = Release|Win32
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Win32.Build.0 = Release|Win32
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|x64.ActiveCfg = Release|x64
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|x64.Build.0 = Release|x64
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.All|Win32.ActiveCfg = Release|Win32
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.All|Win32.Build.0 = Release|Win32
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.All|x64.ActiveCfg = Release|x64
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.All|x64.Build.0 = Release|x64
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|Win32.Build.0 = Debug|Win32
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|x64.ActiveCfg = Debug|x64
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|x64.Build.0 = Debug|x64
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|Win32.ActiveCfg = Release|Win32
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|Win32.Build.0 = Release|Win32
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|x64.ActiveCfg = Release|x64
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|x64.Build.0 = Release|x64
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.All|Win32.ActiveCfg = Release|Win32
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.All|Win32.Build.0 = Release|Win32
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.All|x64.ActiveCfg = Release|Win32
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.All|x64.Build.0 = Release|Win32
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Debug|Win32.Build.0 = Debug|Win32
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Debug|x64.ActiveCfg = Debug|Win32
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Debug|x64.Build.0 = Debug|Win32
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Release|Win32.ActiveCfg = Release|Win32
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Release|Win32.Build.0 = Release|Win32
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Release|x64.ActiveCfg = Release|Win32
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Release|x64.Build.0 = Release|Win32
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.All|Win32.ActiveCfg = Release|Win32
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.All|Win32.Build.0 = Release|Win32
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.All|x64.ActiveCfg = Release|x64
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.All|x64.Build.0 = Release|x64
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.All|Win32.ActiveCfg = Release|Win32
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.All|Win32.Build.0 = Release|Win32
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.All|x64.ActiveCfg = Release|Win32
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.All|x64.Build.0 = Release|Win32
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Debug|Win32.Build.0 = Debug|Win32
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Debug|x64.ActiveCfg = Debug|Win32
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Debug|x64.Build.0 = Debug|Win32
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Release|Win32.ActiveCfg = Release|Win32
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Release|Win32.Build.0 = Release|Win32
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Release|x64.ActiveCfg = Release|Win32
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Release|x64.Build.0 = Release|Win32
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.All|Win32.ActiveCfg = Release|Win32
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.All|Win32.Build.0 = Release|Win32
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.All|x64.ActiveCfg = Release|x64
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.All|x64.Build.0 = Release|x64
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Debug|Win32.Build.0 = Debug|Win32
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Debug|x64.ActiveCfg = Debug|x64
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Debug|x64.Build.0 = Debug|x64
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Release|Win32.ActiveCfg = Release|Win32
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Release|Win32.Build.0 = Release|Win32
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Release|x64.ActiveCfg = Release|x64
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Release|x64.Build.0 = Release|x64
-		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.All|Win32.ActiveCfg = Release|Win32
-		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.All|Win32.Build.0 = Release|Win32
-		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.All|x64.ActiveCfg = Release|Win32
-		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.All|x64.Build.0 = Release|Win32
-		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Debug|Win32.ActiveCfg = Debug|Win32
-		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Debug|x64.ActiveCfg = Debug|Win32
-		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Release|Win32.ActiveCfg = Release|Win32
-		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Release|x64.ActiveCfg = Release|Win32
-		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|Win32.ActiveCfg = Release|Win32
-		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|Win32.Build.0 = Release|Win32
-		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|x64.ActiveCfg = Release|x64
-		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|x64.Build.0 = Release|x64
-		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.Debug|Win32.ActiveCfg = Debug|Win32
-		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.Debug|x64.ActiveCfg = Debug|x64
-		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.Release|Win32.ActiveCfg = Release|Win32
-		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.Release|x64.ActiveCfg = Release|x64
-		{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|Win32.ActiveCfg = Release|Win32
-		{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|Win32.Build.0 = Release|Win32
-		{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|x64.ActiveCfg = Release|x64
-		{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|x64.Build.0 = Release|x64
-		{7AEE504B-23B6-4B05-829E-7CD34855F146}.Debug|Win32.ActiveCfg = Debug|Win32
-		{7AEE504B-23B6-4B05-829E-7CD34855F146}.Debug|x64.ActiveCfg = Debug|x64
-		{7AEE504B-23B6-4B05-829E-7CD34855F146}.Release|Win32.ActiveCfg = Release|Win32
-		{7AEE504B-23B6-4B05-829E-7CD34855F146}.Release|x64.ActiveCfg = Release|x64
-		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|Win32.ActiveCfg = Release|Win32
-		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|Win32.Build.0 = Release|Win32
-		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|x64.ActiveCfg = Release|x64
-		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|x64.Build.0 = Release|x64
-		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.Debug|Win32.ActiveCfg = Debug|Win32
-		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.Debug|x64.ActiveCfg = Debug|x64
-		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.Release|Win32.ActiveCfg = Release|Win32
-		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.Release|x64.ActiveCfg = Release|x64
-		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|Win32.ActiveCfg = Release|Win32
-		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|Win32.Build.0 = Release|Win32
-		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|x64.ActiveCfg = Release|Win32
-		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|x64.Build.0 = Release|Win32
-		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Debug|Win32.ActiveCfg = Debug|Win32
-		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Debug|x64.ActiveCfg = Debug|Win32
-		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Release|Win32.ActiveCfg = Release|Win32
-		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Release|x64.ActiveCfg = Release|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.All|Win32.ActiveCfg = Release|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.All|Win32.Build.0 = Release|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.All|x64.ActiveCfg = Release|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.All|x64.Build.0 = Release|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.Debug|Win32.ActiveCfg = Debug|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.Debug|Win32.Build.0 = Debug|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.Debug|x64.ActiveCfg = Debug|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.Debug|x64.Build.0 = Debug|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.Release|Win32.ActiveCfg = Release|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.Release|Win32.Build.0 = Release|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.Release|x64.ActiveCfg = Release|Win32
-		{583D8CEA-4171-4493-9025-B63265F408D8}.Release|x64.Build.0 = Release|Win32
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.All|Win32.ActiveCfg = Release|Win32
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.All|Win32.Build.0 = Release|Win32
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.All|x64.ActiveCfg = Release|x64
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.All|x64.Build.0 = Release|x64
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|Win32.ActiveCfg = Debug|Win32
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|Win32.Build.0 = Debug|Win32
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|x64.ActiveCfg = Debug|x64
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|x64.Build.0 = Debug|x64
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|Win32.ActiveCfg = Release|Win32
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|Win32.Build.0 = Release|Win32
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|x64.ActiveCfg = Release|x64
-		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|x64.Build.0 = Release|x64
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.All|Win32.ActiveCfg = Release|Win32
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.All|Win32.Build.0 = Release|Win32
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.All|x64.ActiveCfg = Release|Win32
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.All|x64.Build.0 = Release|Win32
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.Debug|Win32.ActiveCfg = Debug|Win32
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.Debug|Win32.Build.0 = Debug|Win32
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.Debug|x64.ActiveCfg = Debug|Win32
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.Debug|x64.Build.0 = Debug|Win32
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.Release|Win32.ActiveCfg = Release|Win32
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.Release|Win32.Build.0 = Release|Win32
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.Release|x64.ActiveCfg = Release|Win32
-		{36603FE1-253F-4C2C-AAB6-12927A626135}.Release|x64.Build.0 = Release|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.All|Win32.ActiveCfg = Release|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.All|Win32.Build.0 = Release|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.All|x64.ActiveCfg = Release|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.All|x64.Build.0 = Release|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.Debug|Win32.ActiveCfg = Debug|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.Debug|Win32.Build.0 = Debug|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.Debug|x64.ActiveCfg = Debug|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.Debug|x64.Build.0 = Debug|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.Release|Win32.ActiveCfg = Release|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.Release|Win32.Build.0 = Release|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.Release|x64.ActiveCfg = Release|Win32
-		{53AADA60-DF12-46FF-BF94-566BBF849336}.Release|x64.Build.0 = Release|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.All|Win32.ActiveCfg = Release|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.All|Win32.Build.0 = Release|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.All|x64.ActiveCfg = Release|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.All|x64.Build.0 = Release|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.Debug|Win32.ActiveCfg = Debug|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.Debug|Win32.Build.0 = Debug|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.Debug|x64.ActiveCfg = Debug|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.Debug|x64.Build.0 = Debug|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.Release|Win32.ActiveCfg = Release|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.Release|Win32.Build.0 = Release|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.Release|x64.ActiveCfg = Release|Win32
-		{46502007-0D94-47AC-A640-C2B5EEA98333}.Release|x64.Build.0 = Release|Win32
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.All|Win32.ActiveCfg = Release|Win32
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.All|Win32.Build.0 = Release|Win32
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.All|x64.ActiveCfg = Release|x64
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.All|x64.Build.0 = Release|x64
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Debug|Win32.ActiveCfg = Debug|Win32
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Debug|Win32.Build.0 = Debug|Win32
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Debug|x64.ActiveCfg = Debug|x64
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Debug|x64.Build.0 = Debug|x64
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Release|Win32.ActiveCfg = Release|Win32
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Release|Win32.Build.0 = Release|Win32
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Release|x64.ActiveCfg = Release|x64
-		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Release|x64.Build.0 = Release|x64
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.All|Win32.ActiveCfg = Release|Win32
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.All|Win32.Build.0 = Release|Win32
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.All|x64.ActiveCfg = Release|x64
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.All|x64.Build.0 = Release|x64
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Debug|Win32.Build.0 = Debug|Win32
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Debug|x64.ActiveCfg = Debug|x64
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Debug|x64.Build.0 = Debug|x64
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Release|Win32.ActiveCfg = Release|Win32
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Release|Win32.Build.0 = Release|Win32
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Release|x64.ActiveCfg = Release|x64
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Release|x64.Build.0 = Release|x64
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.All|Win32.ActiveCfg = Release|Win32
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.All|Win32.Build.0 = Release|Win32
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.All|x64.ActiveCfg = Release|Win32
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.All|x64.Build.0 = Release|Win32
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Debug|Win32.ActiveCfg = Debug|Win32
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Debug|Win32.Build.0 = Debug|Win32
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Debug|x64.ActiveCfg = Debug|Win32
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Debug|x64.Build.0 = Debug|Win32
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Release|Win32.ActiveCfg = Release|Win32
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Release|Win32.Build.0 = Release|Win32
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Release|x64.ActiveCfg = Release|Win32
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Release|x64.Build.0 = Release|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.All|Win32.ActiveCfg = Release|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.All|Win32.Build.0 = Release|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.All|x64.ActiveCfg = Release|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.All|x64.Build.0 = Release|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.Debug|Win32.ActiveCfg = Debug|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.Debug|Win32.Build.0 = Debug|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.Debug|x64.ActiveCfg = Debug|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.Debug|x64.Build.0 = Debug|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.Release|Win32.ActiveCfg = Release|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.Release|Win32.Build.0 = Release|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.Release|x64.ActiveCfg = Release|Win32
-		{08782D64-E775-4E96-B707-CC633A226F32}.Release|x64.Build.0 = Release|Win32
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|Win32.ActiveCfg = Release|Win32
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|Win32.Build.0 = Release|Win32
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|x64.ActiveCfg = Release|x64
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|x64.Build.0 = Release|x64
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|Win32.Build.0 = Debug|Win32
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|x64.ActiveCfg = Debug|x64
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|x64.Build.0 = Debug|x64
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|Win32.ActiveCfg = Release|Win32
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|Win32.Build.0 = Release|Win32
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|x64.ActiveCfg = Release|x64
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|x64.Build.0 = Release|x64
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|Win32.ActiveCfg = Release|Win32
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|Win32.Build.0 = Release|Win32
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|x64.ActiveCfg = Release|x64
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|x64.Build.0 = Release|x64
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|Win32.ActiveCfg = Debug|Win32
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|Win32.Build.0 = Debug|Win32
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|x64.ActiveCfg = Debug|x64
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|x64.Build.0 = Debug|x64
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|Win32.ActiveCfg = Release|Win32
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|Win32.Build.0 = Release|Win32
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|x64.ActiveCfg = Release|x64
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|x64.Build.0 = Release|x64
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|Win32.ActiveCfg = Release|Win32
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|Win32.Build.0 = Release|Win32
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|x64.ActiveCfg = Release|x64
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|x64.Build.0 = Release|x64
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|Win32.ActiveCfg = Debug|Win32
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|Win32.Build.0 = Debug|Win32
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|x64.ActiveCfg = Debug|x64
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|x64.Build.0 = Debug|x64
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|Win32.ActiveCfg = Release|Win32
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|Win32.Build.0 = Release|Win32
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|x64.ActiveCfg = Release|x64
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|x64.Build.0 = Release|x64
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|Win32.ActiveCfg = Release|Win32
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|Win32.Build.0 = Release|Win32
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|x64.ActiveCfg = Release|x64
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|x64.Build.0 = Release|x64
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|Win32.Build.0 = Debug|Win32
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|x64.ActiveCfg = Debug|x64
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|x64.Build.0 = Debug|x64
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|Win32.ActiveCfg = Release|Win32
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|Win32.Build.0 = Release|Win32
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|x64.ActiveCfg = Release|x64
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|x64.Build.0 = Release|x64
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|Win32.ActiveCfg = Release|Win32
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|Win32.Build.0 = Release|Win32
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|x64.ActiveCfg = Release|x64
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|x64.Build.0 = Release|x64
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|Win32.ActiveCfg = Debug|Win32
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|Win32.Build.0 = Debug|Win32
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|x64.ActiveCfg = Debug|x64
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|x64.Build.0 = Debug|x64
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|Win32.ActiveCfg = Release|Win32
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|Win32.Build.0 = Release|Win32
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|x64.ActiveCfg = Release|x64
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|x64.Build.0 = Release|x64
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|Win32.ActiveCfg = Release|Win32
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|Win32.Build.0 = Release|Win32
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|x64.ActiveCfg = Release|x64
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|x64.Build.0 = Release|x64
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|Win32.ActiveCfg = Debug|Win32
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|Win32.Build.0 = Debug|Win32
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|x64.ActiveCfg = Debug|x64
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|x64.Build.0 = Debug|x64
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|Win32.ActiveCfg = Release|Win32
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|Win32.Build.0 = Release|Win32
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|x64.ActiveCfg = Release|x64
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|x64.Build.0 = Release|x64
-		{AF675478-995A-4115-90C4-B2B0D6470688}.All|Win32.ActiveCfg = Release|Win32
-		{AF675478-995A-4115-90C4-B2B0D6470688}.All|Win32.Build.0 = Release|Win32
-		{AF675478-995A-4115-90C4-B2B0D6470688}.All|x64.ActiveCfg = Release|x64
-		{AF675478-995A-4115-90C4-B2B0D6470688}.All|x64.Build.0 = Release|x64
-		{AF675478-995A-4115-90C4-B2B0D6470688}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AF675478-995A-4115-90C4-B2B0D6470688}.Debug|Win32.Build.0 = Debug|Win32
-		{AF675478-995A-4115-90C4-B2B0D6470688}.Debug|x64.ActiveCfg = Debug|x64
-		{AF675478-995A-4115-90C4-B2B0D6470688}.Debug|x64.Build.0 = Debug|x64
-		{AF675478-995A-4115-90C4-B2B0D6470688}.Release|Win32.ActiveCfg = Release|Win32
-		{AF675478-995A-4115-90C4-B2B0D6470688}.Release|Win32.Build.0 = Release|Win32
-		{AF675478-995A-4115-90C4-B2B0D6470688}.Release|x64.ActiveCfg = Release|x64
-		{AF675478-995A-4115-90C4-B2B0D6470688}.Release|x64.Build.0 = Release|x64
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|Win32.ActiveCfg = Release|Win32
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|Win32.Build.0 = Release|Win32
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|x64.ActiveCfg = Release|x64
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|x64.Build.0 = Release|x64
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|Win32.ActiveCfg = Debug|Win32
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|Win32.Build.0 = Debug|Win32
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|x64.ActiveCfg = Debug|x64
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|x64.Build.0 = Debug|x64
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|Win32.ActiveCfg = Release|Win32
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|Win32.Build.0 = Release|Win32
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|x64.ActiveCfg = Release|x64
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|x64.Build.0 = Release|x64
-		{20B15650-F910-4211-8729-AAB0F520C805}.All|Win32.ActiveCfg = Release|Win32
-		{20B15650-F910-4211-8729-AAB0F520C805}.All|Win32.Build.0 = Release|Win32
-		{20B15650-F910-4211-8729-AAB0F520C805}.All|x64.ActiveCfg = Release|x64
-		{20B15650-F910-4211-8729-AAB0F520C805}.All|x64.Build.0 = Release|x64
-		{20B15650-F910-4211-8729-AAB0F520C805}.Debug|Win32.ActiveCfg = Debug|Win32
-		{20B15650-F910-4211-8729-AAB0F520C805}.Debug|Win32.Build.0 = Debug|Win32
-		{20B15650-F910-4211-8729-AAB0F520C805}.Debug|x64.ActiveCfg = Debug|x64
-		{20B15650-F910-4211-8729-AAB0F520C805}.Debug|x64.Build.0 = Debug|x64
-		{20B15650-F910-4211-8729-AAB0F520C805}.Release|Win32.ActiveCfg = Release|Win32
-		{20B15650-F910-4211-8729-AAB0F520C805}.Release|Win32.Build.0 = Release|Win32
-		{20B15650-F910-4211-8729-AAB0F520C805}.Release|x64.ActiveCfg = Release|x64
-		{20B15650-F910-4211-8729-AAB0F520C805}.Release|x64.Build.0 = Release|x64
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|Win32.ActiveCfg = Release|Win32
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|Win32.Build.0 = Release|Win32
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|x64.ActiveCfg = Release|x64
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|x64.Build.0 = Release|x64
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|Win32.ActiveCfg = Debug|Win32
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|Win32.Build.0 = Debug|Win32
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|x64.ActiveCfg = Debug|x64
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|x64.Build.0 = Debug|x64
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|Win32.ActiveCfg = Release|Win32
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|Win32.Build.0 = Release|Win32
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|x64.ActiveCfg = Release|x64
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|x64.Build.0 = Release|x64
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|Win32.ActiveCfg = Release|Win32
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|Win32.Build.0 = Release|Win32
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|x64.ActiveCfg = Release|x64
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|x64.Build.0 = Release|x64
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|Win32.ActiveCfg = Debug|Win32
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|Win32.Build.0 = Debug|Win32
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|x64.ActiveCfg = Debug|x64
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|x64.Build.0 = Debug|x64
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|Win32.ActiveCfg = Release|Win32
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|Win32.Build.0 = Release|Win32
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|x64.ActiveCfg = Release|x64
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|x64.Build.0 = Release|x64
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|Win32.ActiveCfg = Release|Win32
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|Win32.Build.0 = Release|Win32
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|x64.ActiveCfg = Release|x64
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|x64.Build.0 = Release|x64
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|Win32.Build.0 = Debug|Win32
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|x64.ActiveCfg = Debug|x64
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|x64.Build.0 = Debug|x64
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|Win32.ActiveCfg = Release|Win32
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|Win32.Build.0 = Release|Win32
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|x64.ActiveCfg = Release|x64
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|x64.Build.0 = Release|x64
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|Win32.ActiveCfg = Release|Win32
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|Win32.Build.0 = Release|Win32
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|x64.ActiveCfg = Release|x64
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|x64.Build.0 = Release|x64
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|Win32.ActiveCfg = Debug|Win32
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|Win32.Build.0 = Debug|Win32
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|x64.ActiveCfg = Debug|x64
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|x64.Build.0 = Debug|x64
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|Win32.ActiveCfg = Release|Win32
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|Win32.Build.0 = Release|Win32
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|x64.ActiveCfg = Release|x64
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|x64.Build.0 = Release|x64
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(NestedProjects) = preSolution
-		{CBD81696-EFB4-4D2F-8451-1B8DAA86155A} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{3B08FEFD-4D3D-4C16-BA94-EE83509E32A0} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8}
-		{CDE9B06A-3C27-4987-8FAE-DF1006BC705D} = {DB1024A8-41BF-4AD7-9AE6-13202230D1F3}
-		{3C90CCF0-2CDD-4A7A-ACFF-208C1E271692} = {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}
-		{C7E2382E-2C22-4D18-BF93-80C6A1FFA7AC} = {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}
-		{FC71C66E-E268-4EAD-B1F5-F008DC382E83} = {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}
-		{8E2E8798-8B6F-4A55-8E4F-4E6FDE40ED26} = {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}
-		{09455AA9-C243-4F16-A1A1-A016881A2765} = {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}
-		{57199684-EC63-4A60-9DC6-11815AF6B413} = {09455AA9-C243-4F16-A1A1-A016881A2765}
-		{2DED4BA2-D6B0-4064-BB2A-76DE3AA49E7C} = {09455AA9-C243-4F16-A1A1-A016881A2765}
-		{D4A12E4C-DBDA-4614-BA26-3425AE9F60F5} = {09455AA9-C243-4F16-A1A1-A016881A2765}
-		{D3E5C8ED-3A6A-4FEA-92A2-48A0BA865358} = {2DED4BA2-D6B0-4064-BB2A-76DE3AA49E7C}
-		{CC3E7F48-2590-49CB-AD8B-BE3650F55462} = {2DED4BA2-D6B0-4064-BB2A-76DE3AA49E7C}
-		{765EF1B9-5027-4820-BC37-A44466A51631} = {57199684-EC63-4A60-9DC6-11815AF6B413}
-		{713E4747-1126-40B1-BD84-58F9A7745423} = {57199684-EC63-4A60-9DC6-11815AF6B413}
-		{F1B71990-EB04-4EB5-B28A-BC3EB6F7E843} = {D4A12E4C-DBDA-4614-BA26-3425AE9F60F5}
-		{3DAF028C-AB5B-4183-A01B-DCC43F5A87F0} = {D4A12E4C-DBDA-4614-BA26-3425AE9F60F5}
-		{62F27B1A-C919-4A70-8478-51F178F3B18F} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
-		{5FD31A25-5D83-4794-8BEE-904DAD84CE71} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{1A1FF289-4FD6-4285-A422-D31DD67A4723} = {CBD81696-EFB4-4D2F-8451-1B8DAA86155A}
-		{07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
-		{EC3E5C7F-EE09-47E2-80FE-546363D14A98} = {B8F5B47B-8568-46EB-B320-64C17D2A98BC}
-		{A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
-		{784113EF-44D9-4949-835D-7065D3C7AD08} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{89385C74-5860-4174-9CAF-A39E7C48909C} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{8B754330-A434-4791-97E5-1EE67060BAC0} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{692F6330-4D87-4C82-81DF-40DB5892636E} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
-		{D3EC0AFF-76FC-4210-A825-9A17410660A3} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{1C453396-D912-4213-89FD-9B489162B7B5} = {A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}
-		{CBEC7225-0C21-4DA8-978E-1F158F8AD950} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
-		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{B5881A85-FE70-4F64-8607-2CAAE52669C6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{05515420-16DE-4E63-BE73-85BE85BA5142} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{1906D736-08BD-4EE1-924F-B536249B9A54} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{0DF3ABD0-DDC0-4265-B778-07C66780979B} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
-		{4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{71A967D5-0E99-4CEF-A587-98836EE6F2EF} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{AB91A099-7690-4ECF-8994-E458F4EA1ED4} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
-		{988CACF7-3FCB-4992-BE69-77872AE67DC8} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{0A18A071-125E-442F-AFF7-A3F68ABECF99} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
-		{8DEB383C-4091-4F42-A56F-C9E46D552D79} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{2C3C2423-234B-4772-8899-D3B137E5CA35} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{3850D93A-5F24-4922-BC1C-74D08C37C256} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{2CA40887-1622-46A1-A7F9-17FD7E7E545B} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
-		{D7F1E3F2-A3F4-474C-8555-15122571AF52} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{5BC072DB-3826-48EA-AF34-FE32AA01E83B} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{FA429E98-8B03-45E6-A096-A4BC5E821DE4} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{06E3A538-AB32-44F2-B477-755FF9CB5D37} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{F6A33240-8F29-48BD-98F0-826995911799} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{65A6273D-FCAB-4C55-B09E-65100141A5D4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
-		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909} = {A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}
-		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
-		{E3246D17-E29B-4AB5-962A-C69B0C5837BB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{7B077E7F-1BE7-4291-AB86-55E527B25CAC} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{4F92B672-DADB-4047-8D6A-4BB3796733FD} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{2DEE4895-1134-439C-B688-52203E57D878} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{94001A0E-A837-445C-8004-F918F10D0226} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{2286DA73-9FC5-45BC-A508-85994C3317AB} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
-		{3CE1DC99-8246-4DB1-A709-74F19F08EC67} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{87A1FE3D-F410-4C8E-9591-8C625985BC70} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{7A8D8174-B355-4114-AFC1-04777CB9DE0A} = {4F227C26-768F-46A3-8684-1D08A46FB374}
-		{7EB71250-F002-4ED8-92CA-CA218114537A} = {4F227C26-768F-46A3-8684-1D08A46FB374}
-		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{464AAB78-5489-4916-BE51-BF8D61822311} = {4F227C26-768F-46A3-8684-1D08A46FB374}
-		{66444AEE-554C-11DD-A9F0-8C5D56D89593} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
-		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{E316772F-5D8F-4F2A-8F71-094C3E859D34} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{38FE0559-9910-43A8-9E45-3E5004C27692} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
-		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{E796E337-DE78-4303-8614-9A590862EE95} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{419C8F80-D858-4B48-A25C-AF4007608137} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{B3F424EC-3D8F-417C-B244-3919D5E1A577} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{14E4A972-9CFB-436D-B0A5-4943F3F80D47} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{0B6C905B-142E-4999-B39D-92FF7951E921} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{CF405366-9558-4AE8-90EF-5E21B51CCB4E} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{E972C52F-9E85-4D65-B19C-031E511E9DB4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{03207781-0D1C-4DB3-A71D-45C608F28DBD} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{9A5DDF08-C88C-4A35-B7F6-D605228446BD} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{05C9FB27-480E-4D53-B3B7-6338E2526666} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{CC1DD008-9406-448D-A0AD-33C3186CFADB} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{48414740-C693-4968-9846-EE058020C64F} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{DEE932AB-5911-4700-9EEB-8C7090A0A330} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{329A6FA0-0FCC-4435-A950-E670AEFA9838} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{1F0A8A77-E661-418F-BB92-82172AE43803} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{4F5C9D55-98EF-4256-8311-32D7BD360406} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{E10571C4-E7F4-4608-B5F2-B22E7EB95400} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{D1ABE208-6442-4FB4-9AAD-1677E41BC870} = {4F227C26-768F-46A3-8684-1D08A46FB374}
-		{BA599D0A-4310-4505-91DA-6A6447B3E289} = {4F227C26-768F-46A3-8684-1D08A46FB374}
-		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959} = {4F227C26-768F-46A3-8684-1D08A46FB374}
-		{3C977801-FE88-48F2-83D3-FA2EBFF6688E} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{432DB165-1EB2-4781-A9C0-71E62610B20A} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{CF70F278-3364-4395-A2E1-23501C9B8AD2} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{D5C87B19-150D-4EF3-A671-96589BD2D14A} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
-		{B5A00BFA-6083-4FAE-A097-71642D6473B5} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
-		{1C320193-46A6-4B34-9C56-8AB584FC1B56} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
-		{72782932-37CC-46AE-8C7F-9A7B1A6EE108} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
-		{12A49562-BAB9-43A3-A21D-15B60BBB4C31} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
-		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
-		{504B3154-7A4F-459D-9877-B951021C3F1F} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
-		{746F3632-5BB2-4570-9453-31D6D58A7D8E} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
-		{DEB01ACB-D65F-4A62-AED9-58C1054499E9} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
-		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
-		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{ABB71A76-42B0-47A4-973A-42E3D920C6FD} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{AFA983D6-4569-4F88-BA94-555ED00FD9A8} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{56B91D01-9150-4BBF-AFA1-5B68AB991B76} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{990BAA76-89D3-4E38-8479-C7B28784EFC8} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{1E21AFE0-6FDB-41D2-942D-863607C24B91} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{B889A18E-70A7-44B5-B2C9-47798D4F43B3} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{05C9FB27-480E-4D53-B3B7-7338E2514666} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{7C22BDFF-CC09-400C-8A09-660733980028} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{23B4D303-79FC-49E0-89E2-2280E7E28940} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{50AAC2CE-BFC9-4912-87CC-C6381850D735} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{4748FF56-CA85-4809-97D6-A94C0FAC1D77} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{2469B306-B027-4FF2-8815-C9C1EA2CAE79} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{9DE35039-A8F6-4FBF-B1B6-EB527F802411} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{74B120FF-6935-4DFE-A142-CDB6BEA99C90} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{C13CC324-0032-4492-9A30-310A6BD64FF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{652AD5F7-8488-489F-AAD0-7FBE064703B6} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411}
-		{BED7539C-0099-4A14-AD5D-30828F15A171} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411}
-		{0D108721-EAE8-4BAF-8102-D8960EC93647} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411}
-		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411}
-		{B535402E-38D2-4D54-8360-423ACBD17192} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411}
-		{2386B892-35F5-46CF-A0F0-10394D2FBF9B} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{ED2CA8B5-8E91-4296-A120-02BB0B674652} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E} = {ED2CA8B5-8E91-4296-A120-02BB0B674652}
-		{245603E3-F580-41A5-9632-B25FE3372CBF} = {ED2CA8B5-8E91-4296-A120-02BB0B674652}
-		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} = {ED2CA8B5-8E91-4296-A120-02BB0B674652}
-		{8484C90D-1561-402F-A91D-2DB10F8C5171} = {ED2CA8B5-8E91-4296-A120-02BB0B674652}
-		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782} = {ED2CA8B5-8E91-4296-A120-02BB0B674652}
-		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0} = {0C808854-54D1-4230-BFF5-77B5FD905000}
-		{1BDAB935-27DC-47E3-95EA-17E024D39C31} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{97D25665-34CD-4E0C-96E7-88F0795B8883} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{5BE9A596-F11F-4379-928C-412F81AE182B} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{C0779BCC-C037-4F58-B890-EF37BA956B3C} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
-		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{0AD87FDA-989F-4638-B6E1-B0132BB0560A} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
-		{77C9E0A2-177D-4BD6-9EFD-75A56F886325} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{841C345F-FCC7-4F64-8F54-0281CEABEB01} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{7AEE504B-23B6-4B05-829E-7CD34855F146} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{20179127-853B-4FE9-B7C0-9E817E6A3A72} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{583D8CEA-4171-4493-9025-B63265F408D8} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{87933C2D-0159-46F7-B326-E1B6E982C21E} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-		{36603FE1-253F-4C2C-AAB6-12927A626135} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{53AADA60-DF12-46FF-BF94-566BBF849336} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{46502007-0D94-47AC-A640-C2B5EEA98333} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{19E934D6-1484-41C8-9305-78DC42FD61F2} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
-		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
-		{9CFA562C-C611-48A7-90A2-BB031B47FE6D} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{08782D64-E775-4E96-B707-CC633A226F32} = {C120A020-773F-4EA3-923F-B67AF28B750D}
-		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{A3D7C6CF-AEB1-4159-B741-160EB4B37345} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{AF675478-995A-4115-90C4-B2B0D6470688} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{07EA6E5A-D181-4ABB-BECF-67A906867D04} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{20B15650-F910-4211-8729-AAB0F520C805} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
-		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{2CA661A7-01DD-4532-BF88-B6629DFB544A} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
-		{40C4E2A2-B49B-496C-96D6-C04B890F7F88} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
-	EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27130.2010
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Codecs", "Codecs", "{F881ADA2-2F1A-4046-9FEB-191D9422D781}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Endpoints", "Endpoints", "{9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dialplans", "Dialplans", "{C5F182F9-754A-4EC5-B50F-76ED02BE13F4}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Event Handlers", "Event Handlers", "{9ADF1E48-2F5C-4ED7-A893-596259FABFE0}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Formats", "Formats", "{A5A27244-AD24-46E5-B01B-840CD296C91D}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{CBD81696-EFB4-4D2F-8451-1B8DAA86155A}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Directories", "Directories", "{B8F5B47B-8568-46EB-B320-64C17D2A98BC}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Languages", "Languages", "{0C808854-54D1-4230-BFF5-77B5FD905000}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ASR-TTS", "ASR-TTS", "{4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Loggers", "Loggers", "{A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XML Interfaces", "XML Interfaces", "{F69A4A6B-9360-4EBB-A280-22AA3C455AC5}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Libraries", "_Libraries", "{EB910B0D-F27D-4B62-B67B-DE834C99AC5B}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Downloads", "_Downloads", "{C120A020-773F-4EA3-923F-B67AF28B750D}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "say", "say", "{6CD61A1D-797C-470A-BE08-8C31B68BB336}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Config", "_Config", "{57D119DC-484F-420F-B9E9-8589FD9A8DF8}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Default", "Default", "{3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\freeswitch.xml = conf\vanilla\freeswitch.xml
+		conf\vanilla\vars.xml = conf\vanilla\vars.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Build System", "_Build System", "{DB1024A8-41BF-4AD7-9AE6-13202230D1F3}"
+	ProjectSection(SolutionItems) = preProject
+		acsite.m4 = acsite.m4
+		bootstrap.sh = bootstrap.sh
+		build\buildlib.sh = build\buildlib.sh
+		configure.in = configure.in
+		Makefile.am = Makefile.am
+		build\modmake.rules.in = build\modmake.rules.in
+		build\modules.conf.in = build\modules.conf.in
+		libs\win32\util.vbs = libs\win32\util.vbs
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "m4", "m4", "{CDE9B06A-3C27-4987-8FAE-DF1006BC705D}"
+	ProjectSection(SolutionItems) = preProject
+		build\config\ac_cflags_gcc_option.m4 = build\config\ac_cflags_gcc_option.m4
+		build\config\ac_cflags_sun_option.m4 = build\config\ac_cflags_sun_option.m4
+		build\config\ac_gcc_archflag.m4 = build\config\ac_gcc_archflag.m4
+		build\config\ac_gcc_x86_cpuid.m4 = build\config\ac_gcc_x86_cpuid.m4
+		build\config\ac_prog_gzip.m4 = build\config\ac_prog_gzip.m4
+		build\config\ac_prog_wget.m4 = build\config\ac_prog_wget.m4
+		build\config\ax_cc_maxopt.m4 = build\config\ax_cc_maxopt.m4
+		build\config\ax_cflags_warn_all_ansi.m4 = build\config\ax_cflags_warn_all_ansi.m4
+		build\config\ax_check_compiler_flags.m4 = build\config\ax_check_compiler_flags.m4
+		build\config\ax_compiler_vendor.m4 = build\config\ax_compiler_vendor.m4
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs", "autoload_configs", "{3C90CCF0-2CDD-4A7A-ACFF-208C1E271692}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\autoload_configs\alsa.conf.xml = conf\vanilla\autoload_configs\alsa.conf.xml
+		conf\vanilla\autoload_configs\conference.conf.xml = conf\vanilla\autoload_configs\conference.conf.xml
+		conf\vanilla\autoload_configs\console.conf.xml = conf\vanilla\autoload_configs\console.conf.xml
+		conf\vanilla\autoload_configs\dialplan_directory.conf.xml = conf\vanilla\autoload_configs\dialplan_directory.conf.xml
+		conf\vanilla\autoload_configs\dingaling.conf.xml = conf\vanilla\autoload_configs\dingaling.conf.xml
+		conf\vanilla\autoload_configs\enum.conf.xml = conf\vanilla\autoload_configs\enum.conf.xml
+		conf\vanilla\autoload_configs\event_multicast.conf.xml = conf\vanilla\autoload_configs\event_multicast.conf.xml
+		conf\vanilla\autoload_configs\event_socket.conf.xml = conf\vanilla\autoload_configs\event_socket.conf.xml
+		conf\vanilla\autoload_configs\ivr.conf.xml = conf\vanilla\autoload_configs\ivr.conf.xml
+		conf\vanilla\autoload_configs\java.conf.xml = conf\vanilla\autoload_configs\java.conf.xml
+		conf\vanilla\autoload_configs\limit.conf.xml = conf\vanilla\autoload_configs\limit.conf.xml
+		conf\vanilla\autoload_configs\local_stream.conf.xml = conf\vanilla\autoload_configs\local_stream.conf.xml
+		conf\vanilla\autoload_configs\logfile.conf.xml = conf\vanilla\autoload_configs\logfile.conf.xml
+		conf\vanilla\autoload_configs\modules.conf.xml = conf\vanilla\autoload_configs\modules.conf.xml
+		conf\vanilla\autoload_configs\openmrcp.conf.xml = conf\vanilla\autoload_configs\openmrcp.conf.xml
+		conf\vanilla\autoload_configs\portaudio.conf.xml = conf\vanilla\autoload_configs\portaudio.conf.xml
+		conf\vanilla\autoload_configs\rss.conf.xml = conf\vanilla\autoload_configs\rss.conf.xml
+		conf\vanilla\autoload_configs\sofia.conf.xml = conf\vanilla\autoload_configs\sofia.conf.xml
+		conf\vanilla\autoload_configs\switch.conf.xml = conf\vanilla\autoload_configs\switch.conf.xml
+		conf\vanilla\autoload_configs\syslog.conf.xml = conf\vanilla\autoload_configs\syslog.conf.xml
+		conf\vanilla\autoload_configs\v8.conf.xml = conf\vanilla\autoload_configs\v8.conf.xml
+		conf\vanilla\autoload_configs\voicemail.conf.xml = conf\vanilla\autoload_configs\voicemail.conf.xml
+		conf\vanilla\autoload_configs\wanpipe.conf.xml = conf\vanilla\autoload_configs\wanpipe.conf.xml
+		conf\vanilla\autoload_configs\woomera.conf.xml = conf\vanilla\autoload_configs\woomera.conf.xml
+		conf\vanilla\autoload_configs\xml_cdr.conf.xml = conf\vanilla\autoload_configs\xml_cdr.conf.xml
+		conf\vanilla\autoload_configs\xml_curl.conf.xml = conf\vanilla\autoload_configs\xml_curl.conf.xml
+		conf\vanilla\autoload_configs\xml_rpc.conf.xml = conf\vanilla\autoload_configs\xml_rpc.conf.xml
+		conf\vanilla\autoload_configs\zeroconf.conf.xml = conf\vanilla\autoload_configs\zeroconf.conf.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{C7E2382E-2C22-4D18-BF93-80C6A1FFA7AC}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\dialplan\default.xml = conf\vanilla\dialplan\default.xml
+		conf\vanilla\dialplan\public.xml = conf\vanilla\dialplan\public.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "directory", "directory", "{FC71C66E-E268-4EAD-B1F5-F008DC382E83}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\directory\default.xml = conf\vanilla\directory\default.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles", "sip_profiles", "{8E2E8798-8B6F-4A55-8E4F-4E6FDE40ED26}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\sip_profiles\external.xml = conf\vanilla\sip_profiles\external.xml
+		conf\vanilla\sip_profiles\internal.xml = conf\vanilla\sip_profiles\internal.xml
+		conf\vanilla\sip_profiles\nat.xml = conf\vanilla\sip_profiles\nat.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lang", "lang", "{09455AA9-C243-4F16-A1A1-A016881A2765}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\directory\default.xml = conf\vanilla\directory\default.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "en", "en", "{57199684-EC63-4A60-9DC6-11815AF6B413}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\lang\en\en.xml = conf\vanilla\lang\en\en.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "de", "de", "{2DED4BA2-D6B0-4064-BB2A-76DE3AA49E7C}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\lang\de\de.xml = conf\vanilla\lang\de\de.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fr", "fr", "{D4A12E4C-DBDA-4614-BA26-3425AE9F60F5}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\lang\fr\fr.xml = conf\vanilla\lang\fr\fr.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{D3E5C8ED-3A6A-4FEA-92A2-48A0BA865358}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\lang\de\demo\demo.xml = conf\vanilla\lang\de\demo\demo.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{CC3E7F48-2590-49CB-AD8B-BE3650F55462}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\lang\de\vm\tts.xml = conf\vanilla\lang\de\vm\tts.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{765EF1B9-5027-4820-BC37-A44466A51631}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\lang\en\demo\demo.xml = conf\vanilla\lang\en\demo\demo.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{713E4747-1126-40B1-BD84-58F9A7745423}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\lang\en\vm\sounds.xml = conf\vanilla\lang\en\vm\sounds.xml
+		conf\vanilla\lang\en\vm\tts.xml = conf\vanilla\lang\en\vm\tts.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{F1B71990-EB04-4EB5-B28A-BC3EB6F7E843}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\lang\fr\demo\demo.xml = conf\vanilla\lang\fr\demo\demo.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "vm", "vm", "{3DAF028C-AB5B-4183-A01B-DCC43F5A87F0}"
+	ProjectSection(SolutionItems) = preProject
+		conf\vanilla\lang\fr\vm\sounds.xml = conf\vanilla\lang\fr\vm\sounds.xml
+	EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sound Files", "Sound Files", "{4F227C26-768F-46A3-8684-1D08A46FB374}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unimrcp", "unimrcp", "{62F27B1A-C919-4A70-8478-51F178F3B18F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchConsole", "w32\Console\FreeSwitchConsole.2017.vcxproj", "{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FreeSwitchCoreLib", "w32\Library\FreeSwitchCore.2017.vcxproj", "{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g729", "src\mod\codecs\mod_g729\mod_g729.2017.vcxproj", "{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sndfile", "src\mod\formats\mod_sndfile\mod_sndfile.2017.vcxproj", "{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_PortAudio", "src\mod\endpoints\mod_portaudio\mod_PortAudio.2017.vcxproj", "{5FD31A25-5D83-4794-8BEE-904DAD84CE71}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "docs", "docs\docs.2017.vcxproj", "{1A1FF289-4FD6-4285-A422-D31DD67A4723}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_xml", "src\mod\dialplans\mod_dialplan_xml\mod_dialplan_xml.2017.vcxproj", "{07113B25-D3AF-4E04-BA77-4CD1171F022C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ldap", "src\mod\directories\mod_ldap\mod_ldap.2017.vcxproj", "{EC3E5C7F-EE09-47E2-80FE-546363D14A98}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_directory", "src\mod\dialplans\mod_dialplan_directory\mod_dialplan_directory.2017.vcxproj", "{A27CCA23-1541-4337-81A4-F0A6413078A0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_multicast", "src\mod\event_handlers\mod_event_multicast\mod_event_multicast.2017.vcxproj", "{784113EF-44D9-4949-835D-7065D3C7AD08}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libteletone", "libs\libteletone\libteletone.2017.vcxproj", "{89385C74-5860-4174-9CAF-A39E7C48909C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_v8", "src\mod\languages\mod_v8\mod_v8.2017.vcxproj", "{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_v8_skel", "src\mod\languages\mod_v8\mod_v8_skel.2017.vcxproj", "{8B754330-A434-4791-97E5-1EE67060BAC0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cepstral", "src\mod\asr_tts\mod_cepstral\mod_cepstral.2017.vcxproj", "{692F6330-4D87-4C82-81DF-40DB5892636E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_ilbc", "src\mod\codecs\mod_ilbc\mod_ilbc.2017.vcxproj", "{D3EC0AFF-76FC-4210-A825-9A17410660A3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dingaling", "src\mod\endpoints\mod_dingaling\mod_dingaling.2017.vcxproj", "{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_commands", "src\mod\applications\mod_commands\mod_commands.2017.vcxproj", "{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_console", "src\mod\loggers\mod_console\mod_console.2017.vcxproj", "{1C453396-D912-4213-89FD-9B489162B7B5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_rpc", "src\mod\xml_int\mod_xml_rpc\mod_xml_rpc.2017.vcxproj", "{CBEC7225-0C21-4DA8-978E-1F158F8AD950}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BED7539C-0099-4A14-AD5D-30828F15A171} = {BED7539C-0099-4A14-AD5D-30828F15A171}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rss", "src\mod\applications\mod_rss\mod_rss.2017.vcxproj", "{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_conference", "src\mod\applications\mod_conference\mod_conference.2017.vcxproj", "{C24FB505-05D7-4319-8485-7540B44C8603}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dptools", "src\mod\applications\mod_dptools\mod_dptools.2017.vcxproj", "{B5881A85-FE70-4F64-8607-2CAAE52669C6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_event_socket", "src\mod\event_handlers\mod_event_socket\mod_event_socket.2017.vcxproj", "{05515420-16DE-4E63-BE73-85BE85BA5142}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdingaling", "libs\libdingaling\libdingaling.2017.vcxproj", "{1906D736-08BD-4EE1-924F-B536249B9A54}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsrtp", "libs\srtp\libsrtp.2017.vcxproj", "{EEF031CB-FED8-451E-A471-91EC8D4F6750}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsqlite", "libs\win32\sqlite\sqlite.2017.vcxproj", "{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libapr", "libs\win32\apr\libapr.2017.vcxproj", "{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "libs\win32\apr-util\libaprutil.2017.vcxproj", "{F057DA7F-79E5-4B00-845C-EF446EF055E3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iksemel", "libs\win32\iksemel\iksemel.2017.vcxproj", "{E727E8F6-935D-46FE-8B0E-37834748A0E3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml", "libs\win32\apr-util\xml.2017.vcxproj", "{155844C3-EC5F-407F-97A4-A2DDADED9B2F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sofia", "src\mod\endpoints\mod_sofia\mod_sofia.2017.vcxproj", "{0DF3ABD0-DDC0-4265-B778-07C66780979B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PTHREAD", "libs\win32\Download PTHREAD.2017.vcxproj", "{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pthread", "libs\win32\pthread\pthread.2017.vcxproj", "{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_g723_1", "src\mod\codecs\mod_g723_1\mod_g723_1.2017.vcxproj", "{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_iSAC", "src\mod\codecs\mod_isac\mod_iSAC.2017.vcxproj", "{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_native_file", "src\mod\formats\mod_native_file\mod_native_file.2017.vcxproj", "{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libudns", "libs\win32\udns\libudns.2017.vcxproj", "{4043FC6A-9A30-4577-8AD5-9B233C9575D8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_enum", "src\mod\applications\mod_enum\mod_enum.2017.vcxproj", "{71A967D5-0E99-4CEF-A587-98836EE6F2EF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_curl", "src\mod\xml_int\mod_xml_curl\mod_xml_curl.2017.vcxproj", "{AB91A099-7690-4ECF-8994-E458F4EA1ED4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_en", "src\mod\say\mod_say_en\mod_say_en.2017.vcxproj", "{988CACF7-3FCB-4992-BE69-77872AE67DC8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "libs\win32\portaudio\portaudio.2017.vcxproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_xml_cdr", "src\mod\xml_int\mod_xml_cdr\mod_xml_cdr.2017.vcxproj", "{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_amr", "src\mod\codecs\mod_amr\mod_amr.2017.vcxproj", "{8DEB383C-4091-4F42-A56F-C9E46D552D79}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_h26x", "src\mod\codecs\mod_h26x\mod_h26x.2017.vcxproj", "{2C3C2423-234B-4772-8899-D3B137E5CA35}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_esf", "src\mod\applications\mod_esf\mod_esf.2017.vcxproj", "{3850D93A-5F24-4922-BC1C-74D08C37C256}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_local_stream", "src\mod\formats\mod_local_stream\mod_local_stream.2017.vcxproj", "{2CA40887-1622-46A1-A7F9-17FD7E7E545B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_voicemail", "src\mod\applications\mod_voicemail\mod_voicemail.2017.vcxproj", "{D7F1E3F2-A3F4-474C-8555-15122571AF52}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_de", "src\mod\say\mod_say_de\mod_say_de.2017.vcxproj", "{5BC072DB-3826-48EA-AF34-FE32AA01E83B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_es", "src\mod\say\mod_say_es\mod_say_es.2017.vcxproj", "{FA429E98-8B03-45E6-A096-A4BC5E821DE4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_fr", "src\mod\say\mod_say_fr\mod_say_fr.2017.vcxproj", "{06E3A538-AB32-44F2-B477-755FF9CB5D37}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_it", "src\mod\say\mod_say_it\mod_say_it.2017.vcxproj", "{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_nl", "src\mod\say\mod_say_nl\mod_say_nl.2017.vcxproj", "{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_fifo", "src\mod\applications\mod_fifo\mod_fifo.2017.vcxproj", "{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_db", "src\mod\applications\mod_db\mod_db.2017.vcxproj", "{F6A33240-8F29-48BD-98F0-826995911799}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_expr", "src\mod\applications\mod_expr\mod_expr.2017.vcxproj", "{65A6273D-FCAB-4C55-B09E-65100141A5D4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_dialplan_asterisk", "src\mod\dialplans\mod_dialplan_asterisk\mod_dialplan_asterisk.2017.vcxproj", "{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_logfile", "src\mod\loggers\mod_logfile\mod_logfile.2017.vcxproj", "{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr_csv", "src\mod\event_handlers\mod_cdr_csv\mod_cdr_csv.2017.vcxproj", "{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_tone_stream", "src\mod\formats\mod_tone_stream\mod_tone_stream.2017.vcxproj", "{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_fsv", "src\mod\applications\mod_fsv\mod_fsv.2017.vcxproj", "{E3246D17-E29B-4AB5-962A-C69B0C5837BB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_lua", "src\mod\languages\mod_lua\mod_lua.2017.vcxproj", "{7B077E7F-1BE7-4291-AB86-55E527B25CAC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download sphinxbase", "libs\win32\Download sphinxbase.2017.vcxproj", "{4F92B672-DADB-4047-8D6A-4BB3796733FD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download sphinxmodel", "libs\win32\Download sphinxmodel.2017.vcxproj", "{2DEE4895-1134-439C-B688-52203E57D878}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download pocketsphinx", "libs\win32\Download pocketsphinx.2017.vcxproj", "{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sphinxbase", "libs\win32\sphinxbase\sphinxbase.2017.vcxproj", "{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pocketsphinx", "libs\win32\pocketsphinx\pocketsphinx.2017.vcxproj", "{94001A0E-A837-445C-8004-F918F10D0226}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_pocketsphinx", "src\mod\asr_tts\mod_pocketsphinx\mod_pocketsphinx.2017.vcxproj", "{2286DA73-9FC5-45BC-A508-85994C3317AB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 8khzsound", "libs\win32\Download 8khz Sounds.2017.vcxproj", "{3CE1DC99-8246-4DB1-A709-74F19F08EC67}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 16khzsound", "libs\win32\Download 16khz Sounds.2017.vcxproj", "{87A1FE3D-F410-4C8E-9591-8C625985BC70}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "8khz", "libs\win32\Sound_Files\8khz.2017.vcxproj", "{7A8D8174-B355-4114-AFC1-04777CB9DE0A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16khz", "libs\win32\Sound_Files\16khz.2017.vcxproj", "{7EB71250-F002-4ED8-92CA-CA218114537A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 32khzsound", "libs\win32\Download 32khz Sounds.2017.vcxproj", "{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "32khz", "libs\win32\Sound_Files\32khz.2017.vcxproj", "{464AAB78-5489-4916-BE51-BF8D61822311}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_flite", "src\mod\asr_tts\mod_flite\mod_flite.2017.vcxproj", "{66444AEE-554C-11DD-A9F0-8C5D56D89593}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download LAME", "libs\win32\Download LAME.2017.vcxproj", "{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download LIBSHOUT", "libs\win32\Download LIBSHOUT.2017.vcxproj", "{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download OGG", "libs\win32\Download OGG.2017.vcxproj", "{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp3lame", "libs\win32\libmp3lame\libmp3lame.2017.vcxproj", "{E316772F-5D8F-4F2A-8F71-094C3E859D34}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libshout", "libs\win32\libshout\libshout.2017.vcxproj", "{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_shout", "src\mod\formats\mod_shout\mod_shout.2017.vcxproj", "{38FE0559-9910-43A8-9E45-3E5004C27692}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libogg", "libs\win32\libogg\libogg.2017.vcxproj", "{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_snom", "src\mod\applications\mod_snom\mod_snom.2017.vcxproj", "{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_zh", "src\mod\say\mod_say_zh\mod_say_zh.2017.vcxproj", "{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_managed", "src\mod\languages\mod_managed\mod_managed.2017.vcxproj", "{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FreeSWITCH.Managed.2017", "src\mod\languages\mod_managed\managed\FreeSWITCH.Managed.2017.csproj", "{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download mpg123", "libs\win32\Download mpg123.2017.vcxproj", "{E796E337-DE78-4303-8614-9A590862EE95}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmpg123", "libs\win32\mpg123\libmpg123.2017.vcxproj", "{419C8F80-D858-4B48-A25C-AF4007608137}"
+	ProjectSection(ProjectDependencies) = postProject
+		{E796E337-DE78-4303-8614-9A590862EE95} = {E796E337-DE78-4303-8614-9A590862EE95}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_loopback", "src\mod\endpoints\mod_loopback\mod_loopback.2017.vcxproj", "{B3F424EC-3D8F-417C-B244-3919D5E1A577}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_vmd", "src\mod\applications\mod_vmd\mod_vmd.2017.vcxproj", "{14E4A972-9CFB-436D-B0A5-4943F3F80D47}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libg722_1", "libs\win32\libg722_1\libg722_1.2017.vcxproj", "{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_siren", "src\mod\codecs\mod_siren\mod_siren.2017.vcxproj", "{0B6C905B-142E-4999-B39D-92FF7951E921}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libesl", "libs\esl\src\libesl.2017.vcxproj", "{CF405366-9558-4AE8-90EF-5E21B51CCB4E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fs_cli", "libs\esl\fs_cli.2017.vcxproj", "{D2FB8043-D208-4AEE-8F18-3B5857C871B9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_easyroute", "src\mod\applications\mod_easyroute\mod_easyroute.2017.vcxproj", "{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_lcr", "src\mod\applications\mod_lcr\mod_lcr.2017.vcxproj", "{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libs\spandsp\src\libtiff.2017.vcxproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libs\spandsp\src\libspandsp.2017.vcxproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspeex", "libs\win32\speex\libspeex.2017.vcxproj", "{E972C52F-9E85-4D65-B19C-031E511E9DB4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspeexdsp", "libs\win32\speex\libspeexdsp.2017.vcxproj", "{03207781-0D1C-4DB3-A71D-45C608F28DBD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libilbc", "libs\win32\ilbc\libilbc.2017.vcxproj", "{9A5DDF08-C88C-4A35-B7F6-D605228446BD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_opal", "src\mod\endpoints\mod_opal\mod_opal.2017.vcxproj", "{05C9FB27-480E-4D53-B3B7-6338E2526666}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skinny", "src\mod\endpoints\mod_skinny\mod_skinny.2017.vcxproj", "{CC1DD008-9406-448D-A0AD-33C3186CFADB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rtmp", "src\mod\endpoints\mod_rtmp\mod_rtmp.2017.vcxproj", "{48414740-C693-4968-9846-EE058020C64F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "libs\spandsp\src\msvc\make_at_dictionary.2017.vcxproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "libs\spandsp\src\msvc\make_modem_filter.2017.vcxproj", "{329A6FA0-0FCC-4435-A950-E670AEFA9838}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skel", "src\mod\applications\mod_skel\mod_skel.2017.vcxproj", "{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 32khz music", "libs\win32\Download 32khz music.2017.vcxproj", "{1F0A8A77-E661-418F-BB92-82172AE43803}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 8khz music", "libs\win32\Download 8khz music.2017.vcxproj", "{4F5C9D55-98EF-4256-8311-32D7BD360406}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download 16khz music", "libs\win32\Download 16khz music.2017.vcxproj", "{E10571C4-E7F4-4608-B5F2-B22E7EB95400}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "8khz music", "libs\win32\Sound_Files\8khzmusic.2017.vcxproj", "{D1ABE208-6442-4FB4-9AAD-1677E41BC870}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "16khz music", "libs\win32\Sound_Files\16khzmusic.2017.vcxproj", "{BA599D0A-4310-4505-91DA-6A6447B3E289}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "32khz music", "libs\win32\Sound_Files\32khzmusic.2017.vcxproj", "{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_nibblebill", "src\mod\applications\mod_nibblebill\mod_nibblebill.2017.vcxproj", "{3C977801-FE88-48F2-83D3-FA2EBFF6688E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_ru", "src\mod\say\mod_say_ru\mod_say_ru.2017.vcxproj", "{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_valet_parking", "src\mod\applications\mod_valet_parking\mod_valet_parking.2017.vcxproj", "{432DB165-1EB2-4781-A9C0-71E62610B20A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbroadvoice", "libs\win32\broadvoice\libbroadvoice.2017.vcxproj", "{CF70F278-3364-4395-A2E1-23501C9B8AD2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_bv", "src\mod\codecs\mod_bv\mod_bv.2017.vcxproj", "{D5C87B19-150D-4EF3-A671-96589BD2D14A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "aprtoolkit", "libs\unimrcp\libs\apr-toolkit\aprtoolkit.2017.vcxproj", "{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}"
+	ProjectSection(ProjectDependencies) = postProject
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mpf", "libs\unimrcp\libs\mpf\mpf.2017.vcxproj", "{B5A00BFA-6083-4FAE-A097-71642D6473B5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcp", "libs\unimrcp\libs\mrcp\mrcp.2017.vcxproj", "{1C320193-46A6-4B34-9C56-8AB584FC1B56}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpclient", "libs\unimrcp\libs\mrcp-client\mrcpclient.2017.vcxproj", "{72782932-37CC-46AE-8C7F-9A7B1A6EE108}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpsignaling", "libs\unimrcp\libs\mrcp-signaling\mrcpsignaling.2017.vcxproj", "{12A49562-BAB9-43A3-A21D-15B60BBB4C31}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpv2transport", "libs\unimrcp\libs\mrcpv2-transport\mrcpv2transport.2017.vcxproj", "{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unirtsp", "libs\unimrcp\libs\uni-rtsp\unirtsp.2017.vcxproj", "{504B3154-7A4F-459D-9877-B951021C3F1F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpsofiasip", "libs\unimrcp\modules\mrcp-sofiasip\mrcpsofiasip.2017.vcxproj", "{746F3632-5BB2-4570-9453-31D6D58A7D8E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mrcpunirtsp", "libs\unimrcp\modules\mrcp-unirtsp\mrcpunirtsp.2017.vcxproj", "{DEB01ACB-D65F-4A62-AED9-58C1054499E9}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_unimrcp", "src\mod\asr_tts\mod_unimrcp\mod_unimrcp.2017.vcxproj", "{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download CELT", "libs\win32\Download CELT.2017.vcxproj", "{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcelt", "libs\win32\celt\libcelt.2017.vcxproj", "{ABB71A76-42B0-47A4-973A-42E3D920C6FD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FSComm", "fscomm\FSComm.2017.vcxproj", "{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_curl", "src\mod\applications\mod_curl\mod_curl.2017.vcxproj", "{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_silk", "src\mod\codecs\mod_silk\mod_silk.2017.vcxproj", "{AFA983D6-4569-4F88-BA94-555ED00FD9A8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Silk_FIX", "libs\win32\libsilk\Silk_FIX.2017.vcxproj", "{56B91D01-9150-4BBF-AFA1-5B68AB991B76}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_avmd", "src\mod\applications\mod_avmd\mod_avmd.2017.vcxproj", "{990BAA76-89D3-4E38-8479-C7B28784EFC8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spandsp", "src\mod\applications\mod_spandsp\mod_spandsp.2017.vcxproj", "{1E21AFE0-6FDB-41D2-942D-863607C24B91}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_hash", "src\mod\applications\mod_hash\mod_hash.2017.vcxproj", "{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsofia_sip_ua_static", "libs\win32\sofia\libsofia_sip_ua_static.2017.vcxproj", "{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_directory", "src\mod\applications\mod_directory\mod_directory.2017.vcxproj", "{B889A18E-70A7-44B5-B2C9-47798D4F43B3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_h323", "src\mod\endpoints\mod_h323\mod_h323.2017.vcxproj", "{05C9FB27-480E-4D53-B3B7-7338E2514666}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_distributor", "src\mod\applications\mod_distributor\mod_distributor.2017.vcxproj", "{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_pt", "src\mod\say\mod_say_pt\mod_say_pt.2017.vcxproj", "{7C22BDFF-CC09-400C-8A09-660733980028}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_sv", "src\mod\say\mod_say_sv\mod_say_sv.2017.vcxproj", "{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ldns", "libs\win32\ldns\ldns-lib\ldns-lib.2017.vcxproj", "{23B4D303-79FC-49E0-89E2-2280E7E28940}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_callcenter", "src\mod\applications\mod_callcenter\mod_callcenter.2017.vcxproj", "{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_blacklist", "src\mod\applications\mod_blacklist\mod_blacklist.2017.vcxproj", "{50AAC2CE-BFC9-4912-87CC-C6381850D735}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spy", "src\mod\applications\mod_spy\mod_spy.2017.vcxproj", "{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_httapi", "src\mod\applications\mod_httapi\mod_httapi.2017.vcxproj", "{4748FF56-CA85-4809-97D6-A94C0FAC1D77}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_abstraction", "src\mod\applications\mod_abstraction\mod_abstraction.2017.vcxproj", "{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_sms", "src\mod\applications\mod_sms\mod_sms.2017.vcxproj", "{2469B306-B027-4FF2-8815-C9C1EA2CAE79}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "xmlrpc-c", "xmlrpc-c", "{9DE35039-A8F6-4FBF-B1B6-EB527F802411}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsmlib", "src\mod\endpoints\mod_gsmopen\gsmlib\gsmlib-1.10-patched-13ubuntu\win32\gsmlib.2017.vcxproj", "{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_gsmopen", "src\mod\endpoints\mod_gsmopen\mod_gsmopen.2017.vcxproj", "{74B120FF-6935-4DFE-A142-CDB6BEA99C90}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzrtp", "libs\libzrtp\projects\win\libzrtp.2017.vcxproj", "{C13CC324-0032-4492-9A30-310A6BD64FF5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_redis", "src\mod\applications\mod_redis\mod_redis.2017.vcxproj", "{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libjpeg", "libs\win32\Download libjpeg.2017.vcxproj", "{652AD5F7-8488-489F-AAD0-7FBE064703B6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "libs\win32\libjpeg\libjpeg.2017.vcxproj", "{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}"
+	ProjectSection(ProjectDependencies) = postProject
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6} = {652AD5F7-8488-489F-AAD0-7FBE064703B6}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "abyss", "libs\win32\xmlrpc-c\abyss.2017.vcxproj", "{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}"
+	ProjectSection(ProjectDependencies) = postProject
+		{0D108721-EAE8-4BAF-8102-D8960EC93647} = {0D108721-EAE8-4BAF-8102-D8960EC93647}
+		{B535402E-38D2-4D54-8360-423ACBD17192} = {B535402E-38D2-4D54-8360-423ACBD17192}
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA} = {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gennmtab", "libs\win32\xmlrpc-c\gennmtab.2017.vcxproj", "{BED7539C-0099-4A14-AD5D-30828F15A171}"
+	ProjectSection(ProjectDependencies) = postProject
+		{0D108721-EAE8-4BAF-8102-D8960EC93647} = {0D108721-EAE8-4BAF-8102-D8960EC93647}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmlparse", "libs\win32\xmlrpc-c\xmlparse.2017.vcxproj", "{0D108721-EAE8-4BAF-8102-D8960EC93647}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmlrpc", "libs\win32\xmlrpc-c\xmlrpc.2017.vcxproj", "{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}"
+	ProjectSection(ProjectDependencies) = postProject
+		{0D108721-EAE8-4BAF-8102-D8960EC93647} = {0D108721-EAE8-4BAF-8102-D8960EC93647}
+		{B535402E-38D2-4D54-8360-423ACBD17192} = {B535402E-38D2-4D54-8360-423ACBD17192}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmltok", "libs\win32\xmlrpc-c\xmltok.2017.vcxproj", "{B535402E-38D2-4D54-8360-423ACBD17192}"
+	ProjectSection(ProjectDependencies) = postProject
+		{BED7539C-0099-4A14-AD5D-30828F15A171} = {BED7539C-0099-4A14-AD5D-30828F15A171}
+	EndProjectSection
+EndProject
+Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Setup.2017", "w32\Setup\Setup.2017.wixproj", "{47213370-B933-487D-9F45-BCA26D7E2B6F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_math_fixed_tables", "libs\spandsp\src\msvc\make_math_fixed_tables.2017.vcxproj", "{2386B892-35F5-46CF-A0F0-10394D2FBF9B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcbt", "libs\win32\libcbt\libcbt.2017.vcxproj", "{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_cielab_luts", "libs\spandsp\src\msvc\make_cielab_luts.2017.vcxproj", "{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download OPUS", "libs\win32\Download OPUS.2017.vcxproj", "{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "opus", "opus", "{ED2CA8B5-8E91-4296-A120-02BB0B674652}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus", "libs\win32\opus\opus.2017.vcxproj", "{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus.celt", "libs\win32\opus\opus.celt.2017.vcxproj", "{245603E3-F580-41A5-9632-B25FE3372CBF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus.silk_common", "libs\win32\opus\opus.silk_common.2017.vcxproj", "{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus.silk_fixed", "libs\win32\opus\opus.silk_fixed.2017.vcxproj", "{8484C90D-1561-402F-A91D-2DB10F8C5171}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opus.silk_float", "libs\win32\opus\opus.silk_float.2017.vcxproj", "{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_opus", "src\mod\codecs\mod_opus\mod_opus.2017.vcxproj", "{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_t43_gray_code_tables", "libs\spandsp\src\msvc\make_t43_gray_code_tables.2017.vcxproj", "{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "winFailToBan", "src\mod\languages\mod_managed\managed\examples\winFailToBan\winFailToBan.csproj", "{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download SPEEX", "libs\win32\Download SPEEX.2017.vcxproj", "{1BDAB935-27DC-47E3-95EA-17E024D39C31}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download SQLITE", "libs\win32\Download SQLITE.2017.vcxproj", "{97D25665-34CD-4E0C-96E7-88F0795B8883}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download LDNS", "libs\win32\Download LDNS.2017.vcxproj", "{5BE9A596-F11F-4379-928C-412F81AE182B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download PORTAUDIO", "libs\win32\Download PORTAUDIO.2017.vcxproj", "{C0779BCC-C037-4F58-B890-EF37BA956B3C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_rtc", "src\mod\endpoints\mod_rtc\mod_rtc.2017.vcxproj", "{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_verto", "src\mod\endpoints\mod_verto\mod_verto.2017.vcxproj", "{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libyuv", "libs\win32\libyuv\libyuv.2017.vcxproj", "{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvpx", "libs\win32\libvpx\libvpx.2017.vcxproj", "{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "libs\win32\libpng\libpng.2017.vcxproj", "{D6973076-9317-4EF2-A0B8-B7A18AC0713E}"
+	ProjectSection(ProjectDependencies) = postProject
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33} = {C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libpng", "libs\win32\Download libpng.2017.vcxproj", "{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype.2017", "libs\win32\freetype\freetype.2017.vcxproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"
+	ProjectSection(ProjectDependencies) = postProject
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A} = {0AD87FDA-989F-4638-B6E1-B0132BB0560A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download freetype", "libs\win32\Download freetype.2017.vcxproj", "{0AD87FDA-989F-4638-B6E1-B0132BB0560A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_png", "src\mod\formats\mod_png\mod_png.2017.vcxproj", "{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libav", "libs\win32\Download libav.2017.vcxproj", "{77C9E0A2-177D-4BD6-9EFD-75A56F886325}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libav", "libs\win32\libav\libav.2017.vcxproj", "{841C345F-FCC7-4F64-8F54-0281CEABEB01}"
+	ProjectSection(ProjectDependencies) = postProject
+		{77C9E0A2-177D-4BD6-9EFD-75A56F886325} = {77C9E0A2-177D-4BD6-9EFD-75A56F886325}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_av", "src\mod\applications\mod_av\mod_av.2017.vcxproj", "{7AEE504B-23B6-4B05-829E-7CD34855F146}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libx264", "libs\win32\libx264\libx264.2017.vcxproj", "{20179127-853B-4FE9-B7C0-9E817E6A3A72}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libx264", "libs\win32\Download libx264.2017.vcxproj", "{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download tiff", "libs\win32\Download tiff.2017.vcxproj", "{583D8CEA-4171-4493-9025-B63265F408D8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_http_cache", "src\mod\applications\mod_http_cache\mod_http_cache.2017.vcxproj", "{87933C2D-0159-46F7-B326-E1B6E982C21E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download g722_1", "libs\win32\Download g722_1.2017.vcxproj", "{36603FE1-253F-4C2C-AAB6-12927A626135}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download iLBC", "libs\win32\Download iLBC.2017.vcxproj", "{53AADA60-DF12-46FF-BF94-566BBF849336}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download broadvoice", "libs\win32\Download broadvoice.2017.vcxproj", "{46502007-0D94-47AC-A640-C2B5EEA98333}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcodec2", "libs\win32\libcodec2\libcodec2.2017.vcxproj", "{19E934D6-1484-41C8-9305-78DC42FD61F2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_codec2", "src\mod\codecs\mod_codec2\mod_codec2.2017.vcxproj", "{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libcodec2", "libs\win32\Download libcodec2.2017.vcxproj", "{9CFA562C-C611-48A7-90A2-BB031B47FE6D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download libsilk", "libs\win32\Download libsilk.2017.vcxproj", "{08782D64-E775-4E96-B707-CC633A226F32}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_amqp", "src\mod\event_handlers\mod_amqp\mod_amqp.2017.vcxproj", "{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr_pg_csv", "src\mod\event_handlers\mod_cdr_pg_csv\mod_cdr_pg_csv.2017.vcxproj", "{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_es_ar", "src\mod\say\mod_say_es_ar\mod_say_es_ar.2017.vcxproj", "{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_fa", "src\mod\say\mod_say_fa\mod_say_fa.2017.vcxproj", "{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_he", "src\mod\say\mod_say_he\mod_say_he.2017.vcxproj", "{A3D7C6CF-AEB1-4159-B741-160EB4B37345}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_hr", "src\mod\say\mod_say_hr\mod_say_hr.2017.vcxproj", "{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_hu", "src\mod\say\mod_say_hu\mod_say_hu.2017.vcxproj", "{AF675478-995A-4115-90C4-B2B0D6470688}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_ja", "src\mod\say\mod_say_ja\mod_say_ja.2017.vcxproj", "{07EA6E5A-D181-4ABB-BECF-67A906867D04}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_pl", "src\mod\say\mod_say_pl\mod_say_pl.2017.vcxproj", "{20B15650-F910-4211-8729-AAB0F520C805}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_th", "src\mod\say\mod_say_th\mod_say_th.2017.vcxproj", "{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_odbc_cdr", "src\mod\event_handlers\mod_odbc_cdr\mod_odbc_cdr.2017.vcxproj", "{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cdr_sqlite", "src\mod\event_handlers\mod_cdr_sqlite\mod_cdr_sqlite.2017.vcxproj", "{2CA661A7-01DD-4532-BF88-B6629DFB544A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cv", "src\mod\applications\mod_cv\mod_cv.2017.vcxproj", "{40C4E2A2-B49B-496C-96D6-C04B890F7F88}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		All|Win32 = All|Win32
+		All|x64 = All|x64
+		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.All|Win32.ActiveCfg = Release|x64
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.All|x64.ActiveCfg = Release|x64
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.All|x64.Build.0 = Release|x64
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.Build.0 = Debug|Win32
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|x64.ActiveCfg = Debug|x64
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|x64.Build.0 = Debug|x64
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.ActiveCfg = Release|Win32
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.Build.0 = Release|Win32
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|x64.ActiveCfg = Release|x64
+		{1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|x64.Build.0 = Release|x64
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.All|Win32.ActiveCfg = Release|x64
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.All|x64.ActiveCfg = Release|x64
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.All|x64.Build.0 = Release|x64
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.Build.0 = Debug|Win32
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|x64.ActiveCfg = Debug|x64
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|x64.Build.0 = Debug|x64
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.ActiveCfg = Release|Win32
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.Build.0 = Release|Win32
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|x64.ActiveCfg = Release|x64
+		{202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|x64.Build.0 = Release|x64
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.All|Win32.ActiveCfg = Release Passthrough|x64
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.All|x64.ActiveCfg = Release Passthrough|x64
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.All|x64.Build.0 = Release Passthrough|x64
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.Build.0 = Debug Passthrough|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|x64.ActiveCfg = Debug Passthrough|x64
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|x64.Build.0 = Debug Passthrough|x64
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.ActiveCfg = Release Passthrough|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.Build.0 = Release Passthrough|Win32
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|x64.ActiveCfg = Release Passthrough|x64
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|x64.Build.0 = Release Passthrough|x64
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.All|Win32.ActiveCfg = Release|x64
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.All|x64.ActiveCfg = Release|x64
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.All|x64.Build.0 = Release|x64
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.Build.0 = Debug|Win32
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|x64.ActiveCfg = Debug|x64
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|x64.Build.0 = Debug|x64
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.ActiveCfg = Release|Win32
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.Build.0 = Release|Win32
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|x64.ActiveCfg = Release|x64
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|x64.Build.0 = Release|x64
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.All|Win32.ActiveCfg = Release|x64
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.All|x64.ActiveCfg = Release|x64
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.All|x64.Build.0 = Release|x64
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.Build.0 = Debug|Win32
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|x64.ActiveCfg = Debug|x64
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|x64.Build.0 = Debug|x64
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.ActiveCfg = Release|Win32
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.Build.0 = Release|Win32
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|x64.ActiveCfg = Release|x64
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|x64.Build.0 = Release|x64
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.All|Win32.ActiveCfg = Release|Win32
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.All|x64.ActiveCfg = Release|Win32
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|x64.ActiveCfg = Debug|Win32
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Win32.ActiveCfg = Release|Win32
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|x64.ActiveCfg = Release|Win32
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.All|Win32.ActiveCfg = Release|x64
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.All|x64.ActiveCfg = Release|x64
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.All|x64.Build.0 = Release|x64
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.Build.0 = Debug|Win32
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|x64.ActiveCfg = Debug|x64
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|x64.Build.0 = Debug|x64
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.ActiveCfg = Release|Win32
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.Build.0 = Release|Win32
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|x64.ActiveCfg = Release|x64
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|x64.Build.0 = Release|x64
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.All|Win32.ActiveCfg = Release MS-LDAP|x64
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.All|x64.ActiveCfg = Release MS-LDAP|x64
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.All|x64.Build.0 = Release MS-LDAP|x64
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.ActiveCfg = Debug MS-LDAP|Win32
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.Build.0 = Debug MS-LDAP|Win32
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|x64.ActiveCfg = Debug MS-LDAP|x64
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|x64.Build.0 = Debug MS-LDAP|x64
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.ActiveCfg = Release MS-LDAP|Win32
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.Build.0 = Release MS-LDAP|Win32
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|x64.ActiveCfg = Release MS-LDAP|x64
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|x64.Build.0 = Release MS-LDAP|x64
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.All|Win32.ActiveCfg = Release|x64
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.All|x64.ActiveCfg = Release|x64
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.All|x64.Build.0 = Release|x64
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.Build.0 = Debug|Win32
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|x64.ActiveCfg = Debug|x64
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|x64.Build.0 = Debug|x64
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.ActiveCfg = Release|Win32
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.Build.0 = Release|Win32
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|x64.ActiveCfg = Release|x64
+		{A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|x64.Build.0 = Release|x64
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.All|Win32.ActiveCfg = Release|x64
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.All|x64.ActiveCfg = Release|x64
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.All|x64.Build.0 = Release|x64
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.ActiveCfg = Debug|Win32
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.Build.0 = Debug|Win32
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|x64.ActiveCfg = Debug|x64
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|x64.Build.0 = Debug|x64
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.ActiveCfg = Release|Win32
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.Build.0 = Release|Win32
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|x64.ActiveCfg = Release|x64
+		{784113EF-44D9-4949-835D-7065D3C7AD08}.Release|x64.Build.0 = Release|x64
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.All|Win32.ActiveCfg = Release|x64
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.All|x64.ActiveCfg = Release|x64
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.All|x64.Build.0 = Release|x64
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.Build.0 = Debug|Win32
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|x64.ActiveCfg = Debug|x64
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|x64.Build.0 = Debug|x64
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.ActiveCfg = Release|Win32
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.Build.0 = Release|Win32
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|x64.ActiveCfg = Release|x64
+		{89385C74-5860-4174-9CAF-A39E7C48909C}.Release|x64.Build.0 = Release|x64
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.All|Win32.ActiveCfg = Release|x64
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.All|x64.ActiveCfg = Release|x64
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.All|x64.Build.0 = Release|x64
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|Win32.ActiveCfg = Debug|Win32
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|Win32.Build.0 = Debug|Win32
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|x64.ActiveCfg = Debug|x64
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Debug|x64.Build.0 = Debug|x64
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Release|Win32.ActiveCfg = Release|Win32
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Release|Win32.Build.0 = Release|Win32
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Release|x64.ActiveCfg = Release|x64
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064}.Release|x64.Build.0 = Release|x64
+		{8B754330-A434-4791-97E5-1EE67060BAC0}.All|Win32.ActiveCfg = Release|x64
+		{8B754330-A434-4791-97E5-1EE67060BAC0}.All|x64.ActiveCfg = Release|x64
+		{8B754330-A434-4791-97E5-1EE67060BAC0}.All|x64.Build.0 = Release|x64
+		{8B754330-A434-4791-97E5-1EE67060BAC0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8B754330-A434-4791-97E5-1EE67060BAC0}.Debug|x64.ActiveCfg = Debug|x64
+		{8B754330-A434-4791-97E5-1EE67060BAC0}.Release|Win32.ActiveCfg = Release|Win32
+		{8B754330-A434-4791-97E5-1EE67060BAC0}.Release|x64.ActiveCfg = Release|x64
+		{692F6330-4D87-4C82-81DF-40DB5892636E}.All|Win32.ActiveCfg = Release|x64
+		{692F6330-4D87-4C82-81DF-40DB5892636E}.All|x64.ActiveCfg = Release|x64
+		{692F6330-4D87-4C82-81DF-40DB5892636E}.All|x64.Build.0 = Release|x64
+		{692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|x64.ActiveCfg = Debug|x64
+		{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Win32.ActiveCfg = Release|Win32
+		{692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x64.ActiveCfg = Release|x64
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|Win32.ActiveCfg = Release|x64
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|x64.ActiveCfg = Release|x64
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|x64.Build.0 = Release|x64
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.Build.0 = Debug|Win32
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.ActiveCfg = Debug|x64
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.Build.0 = Debug|x64
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.ActiveCfg = Release|Win32
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.Build.0 = Release|Win32
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|x64.ActiveCfg = Release|x64
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|x64.Build.0 = Release|x64
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.All|Win32.ActiveCfg = Release|x64
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.All|x64.ActiveCfg = Release|x64
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.All|x64.Build.0 = Release|x64
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.Build.0 = Debug|Win32
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|x64.ActiveCfg = Debug|x64
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|x64.Build.0 = Debug|x64
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.ActiveCfg = Release|Win32
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.Build.0 = Release|Win32
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|x64.ActiveCfg = Release|x64
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|x64.Build.0 = Release|x64
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.All|Win32.ActiveCfg = Release|x64
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.All|x64.ActiveCfg = Release|x64
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.All|x64.Build.0 = Release|x64
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.Build.0 = Debug|Win32
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|x64.ActiveCfg = Debug|x64
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|x64.Build.0 = Debug|x64
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.ActiveCfg = Release|Win32
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.Build.0 = Release|Win32
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|x64.ActiveCfg = Release|x64
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|x64.Build.0 = Release|x64
+		{1C453396-D912-4213-89FD-9B489162B7B5}.All|Win32.ActiveCfg = Release|x64
+		{1C453396-D912-4213-89FD-9B489162B7B5}.All|x64.ActiveCfg = Release|x64
+		{1C453396-D912-4213-89FD-9B489162B7B5}.All|x64.Build.0 = Release|x64
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.Build.0 = Debug|Win32
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|x64.ActiveCfg = Debug|x64
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Debug|x64.Build.0 = Debug|x64
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.ActiveCfg = Release|Win32
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.Build.0 = Release|Win32
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|x64.ActiveCfg = Release|x64
+		{1C453396-D912-4213-89FD-9B489162B7B5}.Release|x64.Build.0 = Release|x64
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.All|Win32.ActiveCfg = Release|x64
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.All|x64.ActiveCfg = Release|x64
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.All|x64.Build.0 = Release|x64
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.Build.0 = Debug|Win32
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|x64.ActiveCfg = Debug|x64
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|x64.Build.0 = Debug|x64
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.ActiveCfg = Release|Win32
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.Build.0 = Release|Win32
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|x64.ActiveCfg = Release|x64
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|x64.Build.0 = Release|x64
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.All|Win32.ActiveCfg = Release|x64
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.All|x64.ActiveCfg = Release|x64
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.All|x64.Build.0 = Release|x64
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.Build.0 = Debug|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|x64.ActiveCfg = Debug|x64
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|x64.Build.0 = Debug|x64
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.ActiveCfg = Release|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.Build.0 = Release|Win32
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|x64.ActiveCfg = Release|x64
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|x64.Build.0 = Release|x64
+		{C24FB505-05D7-4319-8485-7540B44C8603}.All|Win32.ActiveCfg = Release|x64
+		{C24FB505-05D7-4319-8485-7540B44C8603}.All|x64.ActiveCfg = Release|x64
+		{C24FB505-05D7-4319-8485-7540B44C8603}.All|x64.Build.0 = Release|x64
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.Build.0 = Debug|Win32
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|x64.ActiveCfg = Debug|x64
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Debug|x64.Build.0 = Debug|x64
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.ActiveCfg = Release|Win32
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.Build.0 = Release|Win32
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|x64.ActiveCfg = Release|x64
+		{C24FB505-05D7-4319-8485-7540B44C8603}.Release|x64.Build.0 = Release|x64
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.All|Win32.ActiveCfg = Release|x64
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.All|x64.ActiveCfg = Release|x64
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.All|x64.Build.0 = Release|x64
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.Build.0 = Debug|Win32
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|x64.ActiveCfg = Debug|x64
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|x64.Build.0 = Debug|x64
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.ActiveCfg = Release|Win32
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.Build.0 = Release|Win32
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|x64.ActiveCfg = Release|x64
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|x64.Build.0 = Release|x64
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.All|Win32.ActiveCfg = Release|x64
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.All|x64.ActiveCfg = Release|x64
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.All|x64.Build.0 = Release|x64
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.ActiveCfg = Debug|Win32
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.Build.0 = Debug|Win32
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|x64.ActiveCfg = Debug|x64
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|x64.Build.0 = Debug|x64
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.ActiveCfg = Release|Win32
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.Build.0 = Release|Win32
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|x64.ActiveCfg = Release|x64
+		{05515420-16DE-4E63-BE73-85BE85BA5142}.Release|x64.Build.0 = Release|x64
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.All|Win32.ActiveCfg = Release DLL|x64
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.All|x64.ActiveCfg = Release DLL|x64
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.All|x64.Build.0 = Release DLL|x64
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.Build.0 = Debug|Win32
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|x64.ActiveCfg = Debug|x64
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|x64.Build.0 = Debug|x64
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.ActiveCfg = Release|Win32
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.Build.0 = Release|Win32
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|x64.ActiveCfg = Release|x64
+		{1906D736-08BD-4EE1-924F-B536249B9A54}.Release|x64.Build.0 = Release|x64
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.All|Win32.ActiveCfg = Release Dll|x64
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.All|x64.ActiveCfg = Release Dll|x64
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.All|x64.Build.0 = Release Dll|x64
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.Build.0 = Debug|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|x64.ActiveCfg = Debug|x64
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|x64.Build.0 = Debug|x64
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.ActiveCfg = Release|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.Build.0 = Release|Win32
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|x64.ActiveCfg = Release|x64
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|x64.Build.0 = Release|x64
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.All|Win32.ActiveCfg = Release DLL|x64
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.All|x64.ActiveCfg = Release DLL|x64
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.All|x64.Build.0 = Release DLL|x64
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.Build.0 = Debug|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|x64.ActiveCfg = Debug|x64
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|x64.Build.0 = Debug|x64
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.ActiveCfg = Release|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.Build.0 = Release|Win32
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|x64.ActiveCfg = Release|x64
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|x64.Build.0 = Release|x64
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.All|Win32.ActiveCfg = Release|x64
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.All|x64.ActiveCfg = Release|x64
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.All|x64.Build.0 = Release|x64
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.Build.0 = Debug|Win32
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|x64.ActiveCfg = Debug|x64
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|x64.Build.0 = Debug|x64
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.ActiveCfg = Release|Win32
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.Build.0 = Release|Win32
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|x64.ActiveCfg = Release|x64
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|x64.Build.0 = Release|x64
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.All|Win32.ActiveCfg = Release|x64
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.All|x64.ActiveCfg = Release|x64
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.All|x64.Build.0 = Release|x64
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.Build.0 = Debug|Win32
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|x64.ActiveCfg = Debug|x64
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|x64.Build.0 = Debug|x64
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.ActiveCfg = Release|Win32
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.Build.0 = Release|Win32
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|x64.ActiveCfg = Release|x64
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|x64.Build.0 = Release|x64
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.All|Win32.ActiveCfg = Release|x64
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.All|x64.ActiveCfg = Release|x64
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.All|x64.Build.0 = Release|x64
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.Build.0 = Debug|Win32
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|x64.ActiveCfg = Debug|x64
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|x64.Build.0 = Debug|x64
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.ActiveCfg = Release|Win32
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.Build.0 = Release|Win32
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.ActiveCfg = Release|x64
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.Build.0 = Release|x64
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|Win32.ActiveCfg = Debug|x64
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|x64.ActiveCfg = Debug|x64
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|x64.Build.0 = Debug|x64
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.Build.0 = Debug|Win32
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|x64.ActiveCfg = Debug|x64
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|x64.Build.0 = Debug|x64
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.ActiveCfg = Release|Win32
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.Build.0 = Release|Win32
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|x64.ActiveCfg = Release|x64
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|x64.Build.0 = Release|x64
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.All|Win32.ActiveCfg = Release|x64
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.All|x64.ActiveCfg = Release|x64
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.All|x64.Build.0 = Release|x64
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.Build.0 = Debug|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|x64.ActiveCfg = Debug|x64
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|x64.Build.0 = Debug|x64
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.ActiveCfg = Release|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.Build.0 = Release|Win32
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|x64.ActiveCfg = Release|x64
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|x64.Build.0 = Release|x64
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.All|Win32.ActiveCfg = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.All|Win32.Build.0 = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.All|x64.ActiveCfg = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.All|x64.Build.0 = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.Build.0 = Debug|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|x64.ActiveCfg = Debug|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|x64.Build.0 = Debug|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.ActiveCfg = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.Build.0 = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|x64.ActiveCfg = Release|Win32
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|x64.Build.0 = Release|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.All|Win32.ActiveCfg = Release DLL|x64
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.All|x64.ActiveCfg = Release DLL|x64
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.All|x64.Build.0 = Release DLL|x64
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.ActiveCfg = Debug DLL|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.Build.0 = Debug DLL|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|x64.ActiveCfg = Debug DLL|x64
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|x64.Build.0 = Debug DLL|x64
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.ActiveCfg = Release DLL|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.Build.0 = Release DLL|Win32
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|x64.ActiveCfg = Release DLL|x64
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|x64.Build.0 = Release DLL|x64
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.All|Win32.ActiveCfg = Release Passthrough|x64
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.All|x64.ActiveCfg = Release Passthrough|x64
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.All|x64.Build.0 = Release Passthrough|x64
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.Build.0 = Debug Passthrough|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|x64.ActiveCfg = Debug Passthrough|x64
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|x64.Build.0 = Debug Passthrough|x64
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.ActiveCfg = Release Passthrough|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.Build.0 = Release Passthrough|Win32
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x64.ActiveCfg = Release Passthrough|x64
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x64.Build.0 = Release Passthrough|x64
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|Win32.ActiveCfg = Release|x64
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x64.ActiveCfg = Release|x64
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.All|x64.Build.0 = Release|x64
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|Win32.Build.0 = Debug|Win32
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|x64.ActiveCfg = Debug|x64
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Debug|x64.Build.0 = Debug|x64
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|Win32.ActiveCfg = Release|Win32
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|Win32.Build.0 = Release|Win32
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|x64.ActiveCfg = Release|x64
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}.Release|x64.Build.0 = Release|x64
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|Win32.ActiveCfg = Release|x64
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|x64.ActiveCfg = Release|x64
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|x64.Build.0 = Release|x64
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.ActiveCfg = Debug|Win32
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.Build.0 = Debug|Win32
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|x64.ActiveCfg = Debug|x64
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|x64.Build.0 = Debug|x64
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.ActiveCfg = Release|Win32
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.Build.0 = Release|Win32
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|x64.ActiveCfg = Release|x64
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|x64.Build.0 = Release|x64
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.All|Win32.ActiveCfg = Release|x64
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.All|x64.ActiveCfg = Release|x64
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.All|x64.Build.0 = Release|x64
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|x64.ActiveCfg = Debug|x64
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.ActiveCfg = Release|Win32
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|x64.ActiveCfg = Release|x64
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.All|Win32.ActiveCfg = Release|x64
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.All|x64.ActiveCfg = Release|x64
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.All|x64.Build.0 = Release|x64
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.Build.0 = Debug|Win32
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|x64.ActiveCfg = Debug|x64
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|x64.Build.0 = Debug|x64
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.ActiveCfg = Release|Win32
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.Build.0 = Release|Win32
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|x64.ActiveCfg = Release|x64
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|x64.Build.0 = Release|x64
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.All|Win32.ActiveCfg = Release|x64
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.All|x64.ActiveCfg = Release|x64
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.All|x64.Build.0 = Release|x64
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.Build.0 = Debug|Win32
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|x64.ActiveCfg = Debug|x64
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|x64.Build.0 = Debug|x64
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.ActiveCfg = Release|Win32
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.Build.0 = Release|Win32
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|x64.ActiveCfg = Release|x64
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|x64.Build.0 = Release|x64
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.All|Win32.ActiveCfg = Release|x64
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.All|x64.ActiveCfg = Release|x64
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.All|x64.Build.0 = Release|x64
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.Build.0 = Debug|Win32
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|x64.ActiveCfg = Debug|x64
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|x64.Build.0 = Debug|x64
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.ActiveCfg = Release|Win32
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.Build.0 = Release|Win32
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|x64.ActiveCfg = Release|x64
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|x64.Build.0 = Release|x64
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|Win32.ActiveCfg = Release DirectSound|x64
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|x64.ActiveCfg = Release DirectSound|x64
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|x64.Build.0 = Release DirectSound|x64
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug DirectSound|Win32
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug DirectSound|Win32
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug DirectSound|x64
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.Build.0 = Debug DirectSound|x64
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release DirectSound|Win32
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release DirectSound|Win32
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release DirectSound|x64
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.Build.0 = Release DirectSound|x64
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|Win32.ActiveCfg = Release|x64
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|x64.ActiveCfg = Release|x64
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|x64.Build.0 = Release|x64
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.ActiveCfg = Debug|Win32
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.Build.0 = Debug|Win32
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|x64.ActiveCfg = Debug|x64
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|x64.Build.0 = Debug|x64
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.ActiveCfg = Release|Win32
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.Build.0 = Release|Win32
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|x64.ActiveCfg = Release|x64
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|x64.Build.0 = Release|x64
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.All|Win32.ActiveCfg = Release Passthrough|x64
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.All|x64.ActiveCfg = Release Passthrough|x64
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.All|x64.Build.0 = Release Passthrough|x64
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.Build.0 = Debug Passthrough|Win32
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|x64.ActiveCfg = Debug Passthrough|x64
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|x64.Build.0 = Debug Passthrough|x64
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.ActiveCfg = Release Passthrough|Win32
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.Build.0 = Release Passthrough|Win32
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|x64.ActiveCfg = Release Passthrough|x64
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|x64.Build.0 = Release Passthrough|x64
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.All|Win32.ActiveCfg = Release|x64
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.All|x64.ActiveCfg = Release|x64
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.All|x64.Build.0 = Release|x64
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.Build.0 = Debug|Win32
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|x64.ActiveCfg = Debug|x64
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|x64.Build.0 = Debug|x64
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.ActiveCfg = Release|Win32
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.Build.0 = Release|Win32
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|x64.ActiveCfg = Release|x64
+		{2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|x64.Build.0 = Release|x64
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.All|Win32.ActiveCfg = Release|x64
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.All|x64.ActiveCfg = Release|x64
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.All|x64.Build.0 = Release|x64
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.Build.0 = Debug|Win32
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|x64.ActiveCfg = Debug|x64
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|x64.Build.0 = Debug|x64
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.ActiveCfg = Release|Win32
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.Build.0 = Release|Win32
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|x64.ActiveCfg = Release|x64
+		{3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|x64.Build.0 = Release|x64
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.All|Win32.ActiveCfg = Release|x64
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.All|x64.ActiveCfg = Release|x64
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.All|x64.Build.0 = Release|x64
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.Build.0 = Debug|Win32
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|x64.ActiveCfg = Debug|x64
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|x64.Build.0 = Debug|x64
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.ActiveCfg = Release|Win32
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.Build.0 = Release|Win32
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|x64.ActiveCfg = Release|x64
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|x64.Build.0 = Release|x64
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.All|Win32.ActiveCfg = Release|x64
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.All|x64.ActiveCfg = Release|x64
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.All|x64.Build.0 = Release|x64
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Win32.Build.0 = Debug|Win32
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|x64.ActiveCfg = Debug|x64
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|x64.Build.0 = Debug|x64
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Win32.ActiveCfg = Release|Win32
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Win32.Build.0 = Release|Win32
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|x64.ActiveCfg = Release|x64
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|x64.Build.0 = Release|x64
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.All|Win32.ActiveCfg = Release|x64
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.All|x64.ActiveCfg = Release|x64
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.All|x64.Build.0 = Release|x64
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Win32.Build.0 = Debug|Win32
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|x64.ActiveCfg = Debug|x64
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|x64.Build.0 = Debug|x64
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Win32.ActiveCfg = Release|Win32
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Win32.Build.0 = Release|Win32
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|x64.ActiveCfg = Release|x64
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|x64.Build.0 = Release|x64
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.All|Win32.ActiveCfg = Release|x64
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.All|x64.ActiveCfg = Release|x64
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.All|x64.Build.0 = Release|x64
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Win32.Build.0 = Debug|Win32
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|x64.ActiveCfg = Debug|x64
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|x64.Build.0 = Debug|x64
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Win32.ActiveCfg = Release|Win32
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Win32.Build.0 = Release|Win32
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|x64.ActiveCfg = Release|x64
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|x64.Build.0 = Release|x64
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.All|Win32.ActiveCfg = Release|x64
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.All|x64.ActiveCfg = Release|x64
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.All|x64.Build.0 = Release|x64
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Win32.ActiveCfg = Debug|Win32
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Win32.Build.0 = Debug|Win32
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|x64.ActiveCfg = Debug|x64
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|x64.Build.0 = Debug|x64
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Win32.ActiveCfg = Release|Win32
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Win32.Build.0 = Release|Win32
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|x64.ActiveCfg = Release|x64
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|x64.Build.0 = Release|x64
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.All|Win32.ActiveCfg = Release|x64
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.All|x64.ActiveCfg = Release|x64
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.All|x64.Build.0 = Release|x64
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Win32.Build.0 = Debug|Win32
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|x64.ActiveCfg = Debug|x64
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|x64.Build.0 = Debug|x64
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Win32.ActiveCfg = Release|Win32
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Win32.Build.0 = Release|Win32
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|x64.ActiveCfg = Release|x64
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|x64.Build.0 = Release|x64
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.All|Win32.ActiveCfg = Release|x64
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.All|x64.ActiveCfg = Release|x64
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.All|x64.Build.0 = Release|x64
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Win32.Build.0 = Debug|Win32
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|x64.ActiveCfg = Debug|x64
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|x64.Build.0 = Debug|x64
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Win32.ActiveCfg = Release|Win32
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Win32.Build.0 = Release|Win32
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|x64.ActiveCfg = Release|x64
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|x64.Build.0 = Release|x64
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.All|Win32.ActiveCfg = Release|x64
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.All|x64.ActiveCfg = Release|x64
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.All|x64.Build.0 = Release|x64
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Win32.ActiveCfg = Debug|Win32
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Win32.Build.0 = Debug|Win32
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|x64.ActiveCfg = Debug|x64
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|x64.Build.0 = Debug|x64
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Win32.ActiveCfg = Release|Win32
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Win32.Build.0 = Release|Win32
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|x64.ActiveCfg = Release|x64
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|x64.Build.0 = Release|x64
+		{F6A33240-8F29-48BD-98F0-826995911799}.All|Win32.ActiveCfg = Release|x64
+		{F6A33240-8F29-48BD-98F0-826995911799}.All|x64.ActiveCfg = Release|x64
+		{F6A33240-8F29-48BD-98F0-826995911799}.All|x64.Build.0 = Release|x64
+		{F6A33240-8F29-48BD-98F0-826995911799}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F6A33240-8F29-48BD-98F0-826995911799}.Debug|Win32.Build.0 = Debug|Win32
+		{F6A33240-8F29-48BD-98F0-826995911799}.Debug|x64.ActiveCfg = Debug|x64
+		{F6A33240-8F29-48BD-98F0-826995911799}.Debug|x64.Build.0 = Debug|x64
+		{F6A33240-8F29-48BD-98F0-826995911799}.Release|Win32.ActiveCfg = Release|Win32
+		{F6A33240-8F29-48BD-98F0-826995911799}.Release|Win32.Build.0 = Release|Win32
+		{F6A33240-8F29-48BD-98F0-826995911799}.Release|x64.ActiveCfg = Release|x64
+		{F6A33240-8F29-48BD-98F0-826995911799}.Release|x64.Build.0 = Release|x64
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.All|Win32.ActiveCfg = Release|x64
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.All|x64.ActiveCfg = Release|x64
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.All|x64.Build.0 = Release|x64
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Win32.Build.0 = Debug|Win32
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|x64.ActiveCfg = Debug|x64
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|x64.Build.0 = Debug|x64
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Win32.ActiveCfg = Release|Win32
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Win32.Build.0 = Release|Win32
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|x64.ActiveCfg = Release|x64
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|x64.Build.0 = Release|x64
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.All|Win32.ActiveCfg = Release|x64
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.All|x64.ActiveCfg = Release|x64
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.All|x64.Build.0 = Release|x64
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.Build.0 = Debug|Win32
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|x64.ActiveCfg = Debug|x64
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|x64.Build.0 = Debug|x64
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Win32.ActiveCfg = Release|Win32
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Win32.Build.0 = Release|Win32
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|x64.ActiveCfg = Release|x64
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|x64.Build.0 = Release|x64
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.All|Win32.ActiveCfg = Release|x64
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.All|x64.ActiveCfg = Release|x64
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.All|x64.Build.0 = Release|x64
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Win32.Build.0 = Debug|Win32
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|x64.ActiveCfg = Debug|x64
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|x64.Build.0 = Debug|x64
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Win32.ActiveCfg = Release|Win32
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Win32.Build.0 = Release|Win32
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|x64.ActiveCfg = Release|x64
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|x64.Build.0 = Release|x64
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.All|Win32.ActiveCfg = Release|x64
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.All|x64.ActiveCfg = Release|x64
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.All|x64.Build.0 = Release|x64
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Win32.Build.0 = Debug|Win32
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|x64.ActiveCfg = Debug|x64
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|x64.Build.0 = Debug|x64
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Win32.ActiveCfg = Release|Win32
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Win32.Build.0 = Release|Win32
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|x64.ActiveCfg = Release|x64
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|x64.Build.0 = Release|x64
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.All|Win32.ActiveCfg = Release|x64
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.All|x64.ActiveCfg = Release|x64
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.All|x64.Build.0 = Release|x64
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|Win32.Build.0 = Debug|Win32
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|x64.ActiveCfg = Debug|x64
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Debug|x64.Build.0 = Debug|x64
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Win32.ActiveCfg = Release|Win32
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Win32.Build.0 = Release|Win32
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|x64.ActiveCfg = Release|x64
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|x64.Build.0 = Release|x64
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.All|Win32.ActiveCfg = Release|x64
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.All|x64.ActiveCfg = Release|x64
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.All|x64.Build.0 = Release|x64
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|Win32.Build.0 = Debug|Win32
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|x64.ActiveCfg = Debug|x64
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Debug|x64.Build.0 = Debug|x64
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Win32.ActiveCfg = Release|Win32
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|Win32.Build.0 = Release|Win32
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|x64.ActiveCfg = Release|x64
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB}.Release|x64.Build.0 = Release|x64
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.All|Win32.ActiveCfg = Release|x64
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.All|x64.ActiveCfg = Release|x64
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.All|x64.Build.0 = Release|x64
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.Build.0 = Debug|Win32
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.ActiveCfg = Debug|x64
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.Build.0 = Debug|x64
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.ActiveCfg = Release|Win32
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.Build.0 = Release|Win32
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.ActiveCfg = Release|x64
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.Build.0 = Release|x64
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.All|Win32.ActiveCfg = Release|Win32
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.All|Win32.Build.0 = Release|Win32
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.All|x64.ActiveCfg = Release|Win32
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.All|x64.Build.0 = Release|Win32
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|Win32.Build.0 = Debug|Win32
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|x64.ActiveCfg = Debug|Win32
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Debug|x64.Build.0 = Debug|Win32
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Win32.ActiveCfg = Release|Win32
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|Win32.Build.0 = Release|Win32
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|x64.ActiveCfg = Release|Win32
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD}.Release|x64.Build.0 = Release|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.All|Win32.ActiveCfg = Release|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.All|Win32.Build.0 = Release|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.All|x64.ActiveCfg = Release|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.All|x64.Build.0 = Release|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.Debug|Win32.Build.0 = Debug|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.Debug|x64.ActiveCfg = Debug|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.Debug|x64.Build.0 = Debug|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.Release|Win32.ActiveCfg = Release|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.Release|Win32.Build.0 = Release|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.Release|x64.ActiveCfg = Release|Win32
+		{2DEE4895-1134-439C-B688-52203E57D878}.Release|x64.Build.0 = Release|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.All|Win32.ActiveCfg = Release|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.All|Win32.Build.0 = Release|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.All|x64.ActiveCfg = Release|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.All|x64.Build.0 = Release|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|Win32.Build.0 = Debug|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|x64.ActiveCfg = Debug|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Debug|x64.Build.0 = Debug|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Win32.ActiveCfg = Release|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|Win32.Build.0 = Release|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|x64.ActiveCfg = Release|Win32
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}.Release|x64.Build.0 = Release|Win32
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.All|Win32.ActiveCfg = Debug|x64
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.All|x64.ActiveCfg = Debug|x64
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.All|x64.Build.0 = Debug|x64
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|Win32.Build.0 = Debug|Win32
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|x64.ActiveCfg = Debug|x64
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Debug|x64.Build.0 = Debug|x64
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Win32.ActiveCfg = Release|Win32
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|Win32.Build.0 = Release|Win32
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|x64.ActiveCfg = Release|x64
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}.Release|x64.Build.0 = Release|x64
+		{94001A0E-A837-445C-8004-F918F10D0226}.All|Win32.ActiveCfg = Debug|x64
+		{94001A0E-A837-445C-8004-F918F10D0226}.All|x64.ActiveCfg = Debug|x64
+		{94001A0E-A837-445C-8004-F918F10D0226}.All|x64.Build.0 = Debug|x64
+		{94001A0E-A837-445C-8004-F918F10D0226}.Debug|Win32.ActiveCfg = Debug|Win32
+		{94001A0E-A837-445C-8004-F918F10D0226}.Debug|Win32.Build.0 = Debug|Win32
+		{94001A0E-A837-445C-8004-F918F10D0226}.Debug|x64.ActiveCfg = Debug|x64
+		{94001A0E-A837-445C-8004-F918F10D0226}.Debug|x64.Build.0 = Debug|x64
+		{94001A0E-A837-445C-8004-F918F10D0226}.Release|Win32.ActiveCfg = Release|Win32
+		{94001A0E-A837-445C-8004-F918F10D0226}.Release|Win32.Build.0 = Release|Win32
+		{94001A0E-A837-445C-8004-F918F10D0226}.Release|x64.ActiveCfg = Release|x64
+		{94001A0E-A837-445C-8004-F918F10D0226}.Release|x64.Build.0 = Release|x64
+		{2286DA73-9FC5-45BC-A508-85994C3317AB}.All|Win32.ActiveCfg = Release|x64
+		{2286DA73-9FC5-45BC-A508-85994C3317AB}.All|x64.ActiveCfg = Release|x64
+		{2286DA73-9FC5-45BC-A508-85994C3317AB}.All|x64.Build.0 = Release|x64
+		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|Win32.Build.0 = Debug|Win32
+		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|x64.ActiveCfg = Debug|x64
+		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Debug|x64.Build.0 = Debug|x64
+		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Win32.ActiveCfg = Release|Win32
+		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|Win32.Build.0 = Release|Win32
+		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|x64.ActiveCfg = Release|x64
+		{2286DA73-9FC5-45BC-A508-85994C3317AB}.Release|x64.Build.0 = Release|x64
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.All|Win32.ActiveCfg = Release|Win32
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.All|Win32.Build.0 = Release|Win32
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.All|x64.ActiveCfg = Release|Win32
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.All|x64.Build.0 = Release|Win32
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|Win32.Build.0 = Debug|Win32
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|x64.ActiveCfg = Debug|Win32
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Debug|x64.Build.0 = Debug|Win32
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Win32.ActiveCfg = Release|Win32
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|Win32.Build.0 = Release|Win32
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|x64.ActiveCfg = Release|Win32
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67}.Release|x64.Build.0 = Release|Win32
+		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.All|Win32.ActiveCfg = Release|Win32
+		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.All|x64.ActiveCfg = Release|Win32
+		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|Win32.ActiveCfg = Debug|Win32
+		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|Win32.Build.0 = Debug|Win32
+		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.Debug|x64.ActiveCfg = Debug|Win32
+		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|Win32.ActiveCfg = Release|Win32
+		{87A1FE3D-F410-4C8E-9591-8C625985BC70}.Release|x64.ActiveCfg = Release|Win32
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.All|Win32.ActiveCfg = Release|Win32
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.All|Win32.Build.0 = Release|Win32
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.All|x64.ActiveCfg = Release|Win32
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.All|x64.Build.0 = Release|Win32
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|Win32.Build.0 = Debug|Win32
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|x64.ActiveCfg = Debug|x64
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Debug|x64.Build.0 = Debug|x64
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Win32.ActiveCfg = Release|Win32
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|Win32.Build.0 = Release|Win32
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|x64.ActiveCfg = Release|x64
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A}.Release|x64.Build.0 = Release|x64
+		{7EB71250-F002-4ED8-92CA-CA218114537A}.All|Win32.ActiveCfg = Release|Win32
+		{7EB71250-F002-4ED8-92CA-CA218114537A}.All|x64.ActiveCfg = Release|Win32
+		{7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|Win32.Build.0 = Debug|Win32
+		{7EB71250-F002-4ED8-92CA-CA218114537A}.Debug|x64.ActiveCfg = Debug|x64
+		{7EB71250-F002-4ED8-92CA-CA218114537A}.Release|Win32.ActiveCfg = Release|Win32
+		{7EB71250-F002-4ED8-92CA-CA218114537A}.Release|x64.ActiveCfg = Release|x64
+		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.All|Win32.ActiveCfg = Release|Win32
+		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.All|x64.ActiveCfg = Release|Win32
+		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|Win32.Build.0 = Debug|Win32
+		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Debug|x64.ActiveCfg = Debug|Win32
+		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|Win32.ActiveCfg = Release|Win32
+		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}.Release|x64.ActiveCfg = Release|Win32
+		{464AAB78-5489-4916-BE51-BF8D61822311}.All|Win32.ActiveCfg = Release|Win32
+		{464AAB78-5489-4916-BE51-BF8D61822311}.All|x64.ActiveCfg = Release|Win32
+		{464AAB78-5489-4916-BE51-BF8D61822311}.Debug|Win32.ActiveCfg = Debug|Win32
+		{464AAB78-5489-4916-BE51-BF8D61822311}.Debug|Win32.Build.0 = Debug|Win32
+		{464AAB78-5489-4916-BE51-BF8D61822311}.Debug|x64.ActiveCfg = Debug|x64
+		{464AAB78-5489-4916-BE51-BF8D61822311}.Release|Win32.ActiveCfg = Release|Win32
+		{464AAB78-5489-4916-BE51-BF8D61822311}.Release|x64.ActiveCfg = Release|x64
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.All|Win32.ActiveCfg = Release|Win32
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.All|Win32.Build.0 = Release|Win32
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.All|x64.ActiveCfg = Release|x64
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.All|x64.Build.0 = Release|x64
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Win32.ActiveCfg = Debug|Win32
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|Win32.Build.0 = Debug|Win32
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|x64.ActiveCfg = Debug|x64
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Debug|x64.Build.0 = Debug|x64
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Win32.ActiveCfg = Release|Win32
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|Win32.Build.0 = Release|Win32
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|x64.ActiveCfg = Release|x64
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593}.Release|x64.Build.0 = Release|x64
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.All|Win32.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.All|Win32.Build.0 = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.All|x64.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.All|x64.Build.0 = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|Win32.Build.0 = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|x64.ActiveCfg = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Debug|x64.Build.0 = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Win32.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|Win32.Build.0 = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|x64.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}.Release|x64.Build.0 = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.All|Win32.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.All|Win32.Build.0 = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.All|x64.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.All|x64.Build.0 = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|Win32.Build.0 = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|x64.ActiveCfg = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Debug|x64.Build.0 = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Win32.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|Win32.Build.0 = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|x64.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}.Release|x64.Build.0 = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.All|Win32.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.All|Win32.Build.0 = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.All|x64.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.All|x64.Build.0 = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|Win32.Build.0 = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|x64.ActiveCfg = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Debug|x64.Build.0 = Debug|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Win32.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|Win32.Build.0 = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|x64.ActiveCfg = Release|Win32
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}.Release|x64.Build.0 = Release|Win32
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.All|Win32.ActiveCfg = Debug|x64
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.All|x64.ActiveCfg = Debug|x64
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.All|x64.Build.0 = Debug|x64
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|Win32.Build.0 = Debug|Win32
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|x64.ActiveCfg = Debug|x64
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Debug|x64.Build.0 = Debug|x64
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Win32.ActiveCfg = Release|Win32
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|Win32.Build.0 = Release|Win32
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|x64.ActiveCfg = Release|x64
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34}.Release|x64.Build.0 = Release|x64
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.All|Win32.ActiveCfg = Debug|x64
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.All|x64.ActiveCfg = Debug|x64
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.All|x64.Build.0 = Debug|x64
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|Win32.Build.0 = Debug|Win32
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|x64.ActiveCfg = Debug|x64
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Debug|x64.Build.0 = Debug|x64
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Win32.ActiveCfg = Release|Win32
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|Win32.Build.0 = Release|Win32
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|x64.ActiveCfg = Release|x64
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5}.Release|x64.Build.0 = Release|x64
+		{38FE0559-9910-43A8-9E45-3E5004C27692}.All|Win32.ActiveCfg = Release|x64
+		{38FE0559-9910-43A8-9E45-3E5004C27692}.All|x64.ActiveCfg = Release|x64
+		{38FE0559-9910-43A8-9E45-3E5004C27692}.All|x64.Build.0 = Release|x64
+		{38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Win32.ActiveCfg = Debug|Win32
+		{38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|Win32.Build.0 = Debug|Win32
+		{38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|x64.ActiveCfg = Debug|x64
+		{38FE0559-9910-43A8-9E45-3E5004C27692}.Debug|x64.Build.0 = Debug|x64
+		{38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Win32.ActiveCfg = Release|Win32
+		{38FE0559-9910-43A8-9E45-3E5004C27692}.Release|Win32.Build.0 = Release|Win32
+		{38FE0559-9910-43A8-9E45-3E5004C27692}.Release|x64.ActiveCfg = Release|x64
+		{38FE0559-9910-43A8-9E45-3E5004C27692}.Release|x64.Build.0 = Release|x64
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.All|Win32.ActiveCfg = Debug|x64
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.All|x64.ActiveCfg = Debug|x64
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.All|x64.Build.0 = Debug|x64
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|Win32.Build.0 = Debug|Win32
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|x64.ActiveCfg = Debug|x64
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Debug|x64.Build.0 = Debug|x64
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Win32.ActiveCfg = Release|Win32
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|Win32.Build.0 = Release|Win32
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|x64.ActiveCfg = Release|x64
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}.Release|x64.Build.0 = Release|x64
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.All|Win32.ActiveCfg = Release|x64
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.All|x64.ActiveCfg = Release|x64
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.All|x64.Build.0 = Release|x64
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|Win32.Build.0 = Debug|Win32
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|x64.ActiveCfg = Debug|x64
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Debug|x64.Build.0 = Debug|x64
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.ActiveCfg = Release|Win32
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.Build.0 = Release|Win32
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|x64.ActiveCfg = Release|x64
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|x64.Build.0 = Release|x64
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.All|Win32.ActiveCfg = Release|x64
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.All|x64.ActiveCfg = Release|x64
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.All|x64.Build.0 = Release|x64
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.Build.0 = Debug|Win32
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|x64.ActiveCfg = Debug|x64
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|x64.Build.0 = Debug|x64
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.ActiveCfg = Release|Win32
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.Build.0 = Release|Win32
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|x64.ActiveCfg = Release|x64
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|x64.Build.0 = Release|x64
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.All|Win32.ActiveCfg = Release_Mono|x64
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.All|x64.ActiveCfg = Release_Mono|x64
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.All|x64.Build.0 = Release_Mono|x64
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Win32.ActiveCfg = Debug_CLR|Win32
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|Win32.Build.0 = Debug_CLR|Win32
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|x64.ActiveCfg = Debug_CLR|x64
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Debug|x64.Build.0 = Debug_CLR|x64
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|Win32.ActiveCfg = Release_CLR|Win32
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|Win32.Build.0 = Release_CLR|Win32
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|x64.ActiveCfg = Release_CLR|x64
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}.Release|x64.Build.0 = Release_CLR|x64
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.All|Win32.ActiveCfg = Release|Any CPU
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.All|x64.ActiveCfg = Release|Any CPU
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.Build.0 = Debug|Any CPU
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|x64.ActiveCfg = Debug|x64
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|x64.Build.0 = Debug|x64
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.ActiveCfg = Release|Any CPU
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.Build.0 = Release|Any CPU
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|x64.ActiveCfg = Release|x64
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|x64.Build.0 = Release|x64
+		{E796E337-DE78-4303-8614-9A590862EE95}.All|Win32.ActiveCfg = Release|Win32
+		{E796E337-DE78-4303-8614-9A590862EE95}.All|Win32.Build.0 = Release|Win32
+		{E796E337-DE78-4303-8614-9A590862EE95}.All|x64.ActiveCfg = Release|Win32
+		{E796E337-DE78-4303-8614-9A590862EE95}.All|x64.Build.0 = Release|Win32
+		{E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E796E337-DE78-4303-8614-9A590862EE95}.Debug|Win32.Build.0 = Debug|Win32
+		{E796E337-DE78-4303-8614-9A590862EE95}.Debug|x64.ActiveCfg = Debug|Win32
+		{E796E337-DE78-4303-8614-9A590862EE95}.Debug|x64.Build.0 = Debug|Win32
+		{E796E337-DE78-4303-8614-9A590862EE95}.Release|Win32.ActiveCfg = Release|Win32
+		{E796E337-DE78-4303-8614-9A590862EE95}.Release|Win32.Build.0 = Release|Win32
+		{E796E337-DE78-4303-8614-9A590862EE95}.Release|x64.ActiveCfg = Release|Win32
+		{E796E337-DE78-4303-8614-9A590862EE95}.Release|x64.Build.0 = Release|Win32
+		{419C8F80-D858-4B48-A25C-AF4007608137}.All|Win32.ActiveCfg = Debug_Generic_Dll|Win32
+		{419C8F80-D858-4B48-A25C-AF4007608137}.All|Win32.Build.0 = Debug_Generic_Dll|Win32
+		{419C8F80-D858-4B48-A25C-AF4007608137}.All|x64.ActiveCfg = Debug_Generic_Dll|Win32
+		{419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Win32.ActiveCfg = Debug_Generic|Win32
+		{419C8F80-D858-4B48-A25C-AF4007608137}.Debug|Win32.Build.0 = Debug_Generic|Win32
+		{419C8F80-D858-4B48-A25C-AF4007608137}.Debug|x64.ActiveCfg = Debug_Generic|x64
+		{419C8F80-D858-4B48-A25C-AF4007608137}.Debug|x64.Build.0 = Debug_Generic|x64
+		{419C8F80-D858-4B48-A25C-AF4007608137}.Release|Win32.ActiveCfg = Release_Generic|Win32
+		{419C8F80-D858-4B48-A25C-AF4007608137}.Release|Win32.Build.0 = Release_Generic|Win32
+		{419C8F80-D858-4B48-A25C-AF4007608137}.Release|x64.ActiveCfg = Release_Generic|x64
+		{419C8F80-D858-4B48-A25C-AF4007608137}.Release|x64.Build.0 = Release_Generic|x64
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.All|Win32.ActiveCfg = Release|x64
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.All|x64.ActiveCfg = Release|x64
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.All|x64.Build.0 = Release|x64
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|Win32.Build.0 = Debug|Win32
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|x64.ActiveCfg = Debug|x64
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Debug|x64.Build.0 = Debug|x64
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.ActiveCfg = Release|Win32
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|Win32.Build.0 = Release|Win32
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|x64.ActiveCfg = Release|x64
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577}.Release|x64.Build.0 = Release|x64
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.All|Win32.ActiveCfg = Release|x64
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.All|x64.ActiveCfg = Release|x64
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.All|x64.Build.0 = Release|x64
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.ActiveCfg = Debug|Win32
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|Win32.Build.0 = Debug|Win32
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|x64.ActiveCfg = Debug|x64
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Debug|x64.Build.0 = Debug|x64
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.ActiveCfg = Release|Win32
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|Win32.Build.0 = Release|Win32
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|x64.ActiveCfg = Release|x64
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47}.Release|x64.Build.0 = Release|x64
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.All|Win32.ActiveCfg = Release|x64
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.All|x64.ActiveCfg = Release|x64
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.All|x64.Build.0 = Release|x64
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Debug|Win32.Build.0 = Debug|Win32
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Debug|x64.ActiveCfg = Debug|x64
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Debug|x64.Build.0 = Debug|x64
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Release|Win32.ActiveCfg = Release|Win32
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Release|Win32.Build.0 = Release|Win32
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Release|x64.ActiveCfg = Release|x64
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}.Release|x64.Build.0 = Release|x64
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.All|Win32.ActiveCfg = Release|x64
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.All|x64.ActiveCfg = Release|x64
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.All|x64.Build.0 = Release|x64
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Debug|Win32.Build.0 = Debug|Win32
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Debug|x64.ActiveCfg = Debug|x64
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Debug|x64.Build.0 = Debug|x64
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Release|Win32.ActiveCfg = Release|Win32
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Release|Win32.Build.0 = Release|Win32
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Release|x64.ActiveCfg = Release|x64
+		{0B6C905B-142E-4999-B39D-92FF7951E921}.Release|x64.Build.0 = Release|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.All|Win32.ActiveCfg = Release|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.All|x64.ActiveCfg = Release|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.All|x64.Build.0 = Release|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|Win32.Build.0 = Debug|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|x64.ActiveCfg = Debug|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Debug|x64.Build.0 = Debug|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.ActiveCfg = Release|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|Win32.Build.0 = Release|Win32
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|x64.ActiveCfg = Release|x64
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E}.Release|x64.Build.0 = Release|x64
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.All|Win32.ActiveCfg = Release|x64
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.All|x64.ActiveCfg = Release|x64
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.All|x64.Build.0 = Release|x64
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|Win32.Build.0 = Debug|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|x64.ActiveCfg = Debug|x64
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Debug|x64.Build.0 = Debug|x64
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|Win32.ActiveCfg = Release|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|Win32.Build.0 = Release|Win32
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|x64.ActiveCfg = Release|x64
+		{D2FB8043-D208-4AEE-8F18-3B5857C871B9}.Release|x64.Build.0 = Release|x64
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.All|Win32.ActiveCfg = Release|x64
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.All|x64.ActiveCfg = Release|x64
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.All|x64.Build.0 = Release|x64
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Debug|Win32.ActiveCfg = Debug|Win32
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Debug|Win32.Build.0 = Debug|Win32
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Debug|x64.ActiveCfg = Debug|x64
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Debug|x64.Build.0 = Debug|x64
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Release|Win32.ActiveCfg = Release|Win32
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Release|Win32.Build.0 = Release|Win32
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Release|x64.ActiveCfg = Release|x64
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36}.Release|x64.Build.0 = Release|x64
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.All|Win32.ActiveCfg = Release|x64
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.All|x64.ActiveCfg = Release|x64
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.All|x64.Build.0 = Release|x64
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|Win32.Build.0 = Debug|Win32
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|x64.ActiveCfg = Debug|x64
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Debug|x64.Build.0 = Debug|x64
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Release|Win32.ActiveCfg = Release|Win32
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Release|Win32.Build.0 = Release|Win32
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Release|x64.ActiveCfg = Release|x64
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}.Release|x64.Build.0 = Release|x64
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|Win32.ActiveCfg = Release|x64
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|x64.ActiveCfg = Release|x64
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|x64.Build.0 = Release|x64
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.ActiveCfg = Debug|Win32
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.Build.0 = Debug|Win32
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|x64.ActiveCfg = Debug|x64
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|x64.Build.0 = Debug|x64
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.ActiveCfg = Release|Win32
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.Build.0 = Release|Win32
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|x64.ActiveCfg = Release|x64
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|x64.Build.0 = Release|x64
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|Win32.ActiveCfg = Release|x64
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|x64.ActiveCfg = Release|x64
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|x64.Build.0 = Release|x64
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.Build.0 = Debug|Win32
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|x64.ActiveCfg = Debug|x64
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|x64.Build.0 = Debug|x64
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.ActiveCfg = Release|Win32
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.Build.0 = Release|Win32
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|x64.ActiveCfg = Release|x64
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|x64.Build.0 = Release|x64
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.All|Win32.ActiveCfg = Release_Dynamic|Win32
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.All|Win32.Build.0 = Release_Dynamic|Win32
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.All|x64.ActiveCfg = Release_Dynamic|x64
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.All|x64.Build.0 = Release_Dynamic|x64
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Debug|Win32.Build.0 = Debug|Win32
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Debug|x64.ActiveCfg = Debug|x64
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Debug|x64.Build.0 = Debug|x64
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Release|Win32.ActiveCfg = Release|Win32
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Release|Win32.Build.0 = Release|Win32
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Release|x64.ActiveCfg = Release|x64
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4}.Release|x64.Build.0 = Release|x64
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.All|Win32.ActiveCfg = Release_Static_SSE|x64
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.All|x64.ActiveCfg = Release_Static_SSE|x64
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.All|x64.Build.0 = Release_Static_SSE|x64
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Debug|Win32.ActiveCfg = Debug|Win32
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Debug|Win32.Build.0 = Debug|Win32
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Debug|x64.ActiveCfg = Debug|x64
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Debug|x64.Build.0 = Debug|x64
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Release|Win32.ActiveCfg = Release|Win32
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Release|Win32.Build.0 = Release|Win32
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Release|x64.ActiveCfg = Release|x64
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD}.Release|x64.Build.0 = Release|x64
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.All|Win32.ActiveCfg = Release|x64
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.All|x64.ActiveCfg = Release|x64
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.All|x64.Build.0 = Release|x64
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Debug|Win32.ActiveCfg = Debug|Win32
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Debug|Win32.Build.0 = Debug|Win32
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Debug|x64.ActiveCfg = Debug|x64
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Debug|x64.Build.0 = Debug|x64
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Release|Win32.ActiveCfg = Release|Win32
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Release|Win32.Build.0 = Release|Win32
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Release|x64.ActiveCfg = Release|x64
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD}.Release|x64.Build.0 = Release|x64
+		{05C9FB27-480E-4D53-B3B7-6338E2526666}.All|Win32.ActiveCfg = Release|Win32
+		{05C9FB27-480E-4D53-B3B7-6338E2526666}.All|Win32.Build.0 = Release|Win32
+		{05C9FB27-480E-4D53-B3B7-6338E2526666}.All|x64.ActiveCfg = Release|Win32
+		{05C9FB27-480E-4D53-B3B7-6338E2526666}.Debug|Win32.ActiveCfg = Debug|Win32
+		{05C9FB27-480E-4D53-B3B7-6338E2526666}.Debug|x64.ActiveCfg = Debug|Win32
+		{05C9FB27-480E-4D53-B3B7-6338E2526666}.Release|Win32.ActiveCfg = Release|Win32
+		{05C9FB27-480E-4D53-B3B7-6338E2526666}.Release|x64.ActiveCfg = Release|Win32
+		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.All|Win32.ActiveCfg = Release|Win32
+		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.All|x64.ActiveCfg = Release|Win32
+		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Debug|Win32.Build.0 = Debug|Win32
+		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Debug|x64.ActiveCfg = Debug|x64
+		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Debug|x64.Build.0 = Debug|x64
+		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Release|Win32.ActiveCfg = Release|Win32
+		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Release|Win32.Build.0 = Release|Win32
+		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Release|x64.ActiveCfg = Release|x64
+		{CC1DD008-9406-448D-A0AD-33C3186CFADB}.Release|x64.Build.0 = Release|x64
+		{48414740-C693-4968-9846-EE058020C64F}.All|Win32.ActiveCfg = Release|Win32
+		{48414740-C693-4968-9846-EE058020C64F}.All|x64.ActiveCfg = Release|Win32
+		{48414740-C693-4968-9846-EE058020C64F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{48414740-C693-4968-9846-EE058020C64F}.Debug|Win32.Build.0 = Debug|Win32
+		{48414740-C693-4968-9846-EE058020C64F}.Debug|x64.ActiveCfg = Debug|x64
+		{48414740-C693-4968-9846-EE058020C64F}.Debug|x64.Build.0 = Debug|x64
+		{48414740-C693-4968-9846-EE058020C64F}.Release|Win32.ActiveCfg = Release|Win32
+		{48414740-C693-4968-9846-EE058020C64F}.Release|Win32.Build.0 = Release|Win32
+		{48414740-C693-4968-9846-EE058020C64F}.Release|x64.ActiveCfg = Release|x64
+		{48414740-C693-4968-9846-EE058020C64F}.Release|x64.Build.0 = Release|x64
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.ActiveCfg = All|Win32
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.Build.0 = All|Win32
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|x64.ActiveCfg = All|Win32
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.ActiveCfg = All|Win32
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.Build.0 = All|Win32
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|x64.ActiveCfg = All|Win32
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|x64.Build.0 = All|Win32
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|Win32.ActiveCfg = All|Win32
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|Win32.Build.0 = All|Win32
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|x64.ActiveCfg = All|Win32
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|x64.Build.0 = All|Win32
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.ActiveCfg = All|Win32
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.Build.0 = All|Win32
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|x64.ActiveCfg = All|Win32
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.ActiveCfg = All|Win32
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.Build.0 = All|Win32
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|x64.ActiveCfg = All|Win32
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|x64.Build.0 = All|Win32
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|Win32.ActiveCfg = All|Win32
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|Win32.Build.0 = All|Win32
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|x64.ActiveCfg = All|Win32
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|x64.Build.0 = All|Win32
+		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.All|Win32.ActiveCfg = Release|x64
+		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.All|x64.ActiveCfg = Release|x64
+		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.All|x64.Build.0 = Release|x64
+		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.Debug|Win32.ActiveCfg = Debug|Win32
+		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.Debug|x64.ActiveCfg = Debug|x64
+		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.Release|Win32.ActiveCfg = Release|Win32
+		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}.Release|x64.ActiveCfg = Release|x64
+		{1F0A8A77-E661-418F-BB92-82172AE43803}.All|Win32.ActiveCfg = Release|Win32
+		{1F0A8A77-E661-418F-BB92-82172AE43803}.All|x64.ActiveCfg = Release|Win32
+		{1F0A8A77-E661-418F-BB92-82172AE43803}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1F0A8A77-E661-418F-BB92-82172AE43803}.Debug|Win32.Build.0 = Debug|Win32
+		{1F0A8A77-E661-418F-BB92-82172AE43803}.Debug|x64.ActiveCfg = Debug|Win32
+		{1F0A8A77-E661-418F-BB92-82172AE43803}.Release|Win32.ActiveCfg = Release|Win32
+		{1F0A8A77-E661-418F-BB92-82172AE43803}.Release|x64.ActiveCfg = Release|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.All|Win32.ActiveCfg = Release|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.All|Win32.Build.0 = Release|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.All|x64.ActiveCfg = Release|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.All|x64.Build.0 = Release|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Debug|Win32.Build.0 = Debug|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Debug|x64.ActiveCfg = Debug|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Debug|x64.Build.0 = Debug|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Release|Win32.ActiveCfg = Release|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Release|Win32.Build.0 = Release|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Release|x64.ActiveCfg = Release|Win32
+		{4F5C9D55-98EF-4256-8311-32D7BD360406}.Release|x64.Build.0 = Release|Win32
+		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.All|Win32.ActiveCfg = Release|Win32
+		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.All|x64.ActiveCfg = Release|Win32
+		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.Debug|Win32.Build.0 = Debug|Win32
+		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.Debug|x64.ActiveCfg = Debug|Win32
+		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.Release|Win32.ActiveCfg = Release|Win32
+		{E10571C4-E7F4-4608-B5F2-B22E7EB95400}.Release|x64.ActiveCfg = Release|Win32
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.All|Win32.ActiveCfg = Release|Win32
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.All|Win32.Build.0 = Release|Win32
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.All|x64.ActiveCfg = Release|Win32
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.All|x64.Build.0 = Release|Win32
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Debug|Win32.Build.0 = Debug|Win32
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Debug|x64.ActiveCfg = Debug|x64
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Debug|x64.Build.0 = Debug|x64
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Release|Win32.ActiveCfg = Release|Win32
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Release|Win32.Build.0 = Release|Win32
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Release|x64.ActiveCfg = Release|x64
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870}.Release|x64.Build.0 = Release|x64
+		{BA599D0A-4310-4505-91DA-6A6447B3E289}.All|Win32.ActiveCfg = Release|Win32
+		{BA599D0A-4310-4505-91DA-6A6447B3E289}.All|x64.ActiveCfg = Release|Win32
+		{BA599D0A-4310-4505-91DA-6A6447B3E289}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BA599D0A-4310-4505-91DA-6A6447B3E289}.Debug|Win32.Build.0 = Debug|Win32
+		{BA599D0A-4310-4505-91DA-6A6447B3E289}.Debug|x64.ActiveCfg = Debug|x64
+		{BA599D0A-4310-4505-91DA-6A6447B3E289}.Release|Win32.ActiveCfg = Release|Win32
+		{BA599D0A-4310-4505-91DA-6A6447B3E289}.Release|x64.ActiveCfg = Release|x64
+		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.All|Win32.ActiveCfg = Release|Win32
+		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.All|x64.ActiveCfg = Release|Win32
+		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Debug|Win32.Build.0 = Debug|Win32
+		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Debug|x64.ActiveCfg = Debug|x64
+		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Release|Win32.ActiveCfg = Release|Win32
+		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}.Release|x64.ActiveCfg = Release|x64
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.All|Win32.ActiveCfg = Release|x64
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.All|x64.ActiveCfg = Release|x64
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.All|x64.Build.0 = Release|x64
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|Win32.Build.0 = Debug|Win32
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|x64.ActiveCfg = Debug|x64
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Debug|x64.Build.0 = Debug|x64
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Release|Win32.ActiveCfg = Release|Win32
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Release|Win32.Build.0 = Release|Win32
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Release|x64.ActiveCfg = Release|x64
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E}.Release|x64.Build.0 = Release|x64
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.All|Win32.ActiveCfg = Release|x64
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.All|Win32.Build.0 = Release|x64
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.All|x64.ActiveCfg = Release|x64
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.All|x64.Build.0 = Release|x64
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Debug|Win32.Build.0 = Debug|Win32
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Debug|x64.ActiveCfg = Debug|x64
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Debug|x64.Build.0 = Debug|x64
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Release|Win32.ActiveCfg = Release|Win32
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Release|Win32.Build.0 = Release|Win32
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Release|x64.ActiveCfg = Release|x64
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Release|x64.Build.0 = Release|x64
+		{432DB165-1EB2-4781-A9C0-71E62610B20A}.All|Win32.ActiveCfg = Release|x64
+		{432DB165-1EB2-4781-A9C0-71E62610B20A}.All|x64.ActiveCfg = Release|x64
+		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|Win32.Build.0 = Debug|Win32
+		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|x64.ActiveCfg = Debug|x64
+		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|x64.Build.0 = Debug|x64
+		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|Win32.ActiveCfg = Release|Win32
+		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|Win32.Build.0 = Release|Win32
+		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|x64.ActiveCfg = Release|x64
+		{432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|x64.Build.0 = Release|x64
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|Win32.ActiveCfg = Release|Win32
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|Win32.Build.0 = Release|Win32
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|x64.ActiveCfg = Release|Win32
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.Build.0 = Debug|Win32
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|x64.ActiveCfg = Debug|x64
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|x64.Build.0 = Debug|x64
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.ActiveCfg = Release|Win32
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.Build.0 = Release|Win32
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|x64.ActiveCfg = Release|x64
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|x64.Build.0 = Release|x64
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.All|Win32.ActiveCfg = Release|x64
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.All|x64.ActiveCfg = Release|x64
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.All|x64.Build.0 = Release|x64
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Debug|Win32.Build.0 = Debug|Win32
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Debug|x64.ActiveCfg = Debug|x64
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Debug|x64.Build.0 = Debug|x64
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Release|Win32.ActiveCfg = Release|Win32
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Release|Win32.Build.0 = Release|Win32
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Release|x64.ActiveCfg = Release|x64
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A}.Release|x64.Build.0 = Release|x64
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.All|Win32.ActiveCfg = Release|Win32
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.All|Win32.Build.0 = Release|Win32
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.All|x64.ActiveCfg = Release|Win32
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Win32.ActiveCfg = Debug|Win32
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|Win32.Build.0 = Debug|Win32
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|x64.ActiveCfg = Debug|x64
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Debug|x64.Build.0 = Debug|x64
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Win32.ActiveCfg = Release|Win32
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|Win32.Build.0 = Release|Win32
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|x64.ActiveCfg = Release|x64
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}.Release|x64.Build.0 = Release|x64
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.All|Win32.ActiveCfg = Release|Win32
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.All|Win32.Build.0 = Release|Win32
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.All|x64.ActiveCfg = Release|Win32
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Debug|Win32.Build.0 = Debug|Win32
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Debug|x64.ActiveCfg = Debug|x64
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Debug|x64.Build.0 = Debug|x64
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Release|Win32.ActiveCfg = Release|Win32
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Release|Win32.Build.0 = Release|Win32
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Release|x64.ActiveCfg = Release|x64
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5}.Release|x64.Build.0 = Release|x64
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.All|Win32.ActiveCfg = Release|Win32
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.All|Win32.Build.0 = Release|Win32
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.All|x64.ActiveCfg = Release|Win32
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Debug|Win32.Build.0 = Debug|Win32
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Debug|x64.ActiveCfg = Debug|x64
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Debug|x64.Build.0 = Debug|x64
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Release|Win32.ActiveCfg = Release|Win32
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Release|Win32.Build.0 = Release|Win32
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Release|x64.ActiveCfg = Release|x64
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56}.Release|x64.Build.0 = Release|x64
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.All|Win32.ActiveCfg = Release|Win32
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.All|Win32.Build.0 = Release|Win32
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.All|x64.ActiveCfg = Release|Win32
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Debug|Win32.ActiveCfg = Debug|Win32
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Debug|Win32.Build.0 = Debug|Win32
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Debug|x64.ActiveCfg = Debug|x64
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Debug|x64.Build.0 = Debug|x64
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Release|Win32.ActiveCfg = Release|Win32
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Release|Win32.Build.0 = Release|Win32
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Release|x64.ActiveCfg = Release|x64
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108}.Release|x64.Build.0 = Release|x64
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.All|Win32.ActiveCfg = Release|Win32
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.All|Win32.Build.0 = Release|Win32
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.All|x64.ActiveCfg = Release|Win32
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Debug|Win32.ActiveCfg = Debug|Win32
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Debug|Win32.Build.0 = Debug|Win32
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Debug|x64.ActiveCfg = Debug|x64
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Debug|x64.Build.0 = Debug|x64
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Release|Win32.ActiveCfg = Release|Win32
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Release|Win32.Build.0 = Release|Win32
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Release|x64.ActiveCfg = Release|x64
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31}.Release|x64.Build.0 = Release|x64
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.All|Win32.ActiveCfg = Release|Win32
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.All|Win32.Build.0 = Release|Win32
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.All|x64.ActiveCfg = Release|Win32
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Debug|Win32.Build.0 = Debug|Win32
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Debug|x64.ActiveCfg = Debug|x64
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Debug|x64.Build.0 = Debug|x64
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Release|Win32.ActiveCfg = Release|Win32
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Release|Win32.Build.0 = Release|Win32
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Release|x64.ActiveCfg = Release|x64
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}.Release|x64.Build.0 = Release|x64
+		{504B3154-7A4F-459D-9877-B951021C3F1F}.All|Win32.ActiveCfg = Release|Win32
+		{504B3154-7A4F-459D-9877-B951021C3F1F}.All|Win32.Build.0 = Release|Win32
+		{504B3154-7A4F-459D-9877-B951021C3F1F}.All|x64.ActiveCfg = Release|Win32
+		{504B3154-7A4F-459D-9877-B951021C3F1F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{504B3154-7A4F-459D-9877-B951021C3F1F}.Debug|Win32.Build.0 = Debug|Win32
+		{504B3154-7A4F-459D-9877-B951021C3F1F}.Debug|x64.ActiveCfg = Debug|x64
+		{504B3154-7A4F-459D-9877-B951021C3F1F}.Debug|x64.Build.0 = Debug|x64
+		{504B3154-7A4F-459D-9877-B951021C3F1F}.Release|Win32.ActiveCfg = Release|Win32
+		{504B3154-7A4F-459D-9877-B951021C3F1F}.Release|Win32.Build.0 = Release|Win32
+		{504B3154-7A4F-459D-9877-B951021C3F1F}.Release|x64.ActiveCfg = Release|x64
+		{504B3154-7A4F-459D-9877-B951021C3F1F}.Release|x64.Build.0 = Release|x64
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.All|Win32.ActiveCfg = Release|Win32
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.All|Win32.Build.0 = Release|Win32
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.All|x64.ActiveCfg = Release|Win32
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Debug|Win32.Build.0 = Debug|Win32
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Debug|x64.ActiveCfg = Debug|x64
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Debug|x64.Build.0 = Debug|x64
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Release|Win32.ActiveCfg = Release|Win32
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Release|Win32.Build.0 = Release|Win32
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Release|x64.ActiveCfg = Release|x64
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E}.Release|x64.Build.0 = Release|x64
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.All|Win32.ActiveCfg = Release|Win32
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.All|Win32.Build.0 = Release|Win32
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.All|x64.ActiveCfg = Release|Win32
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Debug|Win32.Build.0 = Debug|Win32
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Debug|x64.ActiveCfg = Debug|x64
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Debug|x64.Build.0 = Debug|x64
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Release|Win32.ActiveCfg = Release|Win32
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Release|Win32.Build.0 = Release|Win32
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Release|x64.ActiveCfg = Release|x64
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9}.Release|x64.Build.0 = Release|x64
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.All|Win32.ActiveCfg = Release|x64
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.All|x64.ActiveCfg = Release|x64
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.All|x64.Build.0 = Release|x64
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Debug|Win32.Build.0 = Debug|Win32
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Debug|x64.ActiveCfg = Debug|x64
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Debug|x64.Build.0 = Debug|x64
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Release|Win32.ActiveCfg = Release|Win32
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Release|Win32.Build.0 = Release|Win32
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Release|x64.ActiveCfg = Release|x64
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}.Release|x64.Build.0 = Release|x64
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.All|Win32.ActiveCfg = Release|Win32
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.All|Win32.Build.0 = Release|Win32
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.All|x64.ActiveCfg = Release|Win32
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Debug|Win32.Build.0 = Debug|Win32
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Debug|x64.ActiveCfg = Debug|Win32
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Debug|x64.Build.0 = Debug|Win32
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Release|Win32.ActiveCfg = Release|Win32
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Release|Win32.Build.0 = Release|Win32
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Release|x64.ActiveCfg = Release|Win32
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}.Release|x64.Build.0 = Release|Win32
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.All|Win32.ActiveCfg = Release|x64
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.All|x64.ActiveCfg = Release|x64
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.All|x64.Build.0 = Release|x64
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Debug|Win32.ActiveCfg = Debug|Win32
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Debug|Win32.Build.0 = Debug|Win32
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Debug|x64.ActiveCfg = Debug|x64
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Debug|x64.Build.0 = Debug|x64
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Release|Win32.ActiveCfg = Release|Win32
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Release|Win32.Build.0 = Release|Win32
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Release|x64.ActiveCfg = Release|x64
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD}.Release|x64.Build.0 = Release|x64
+		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.All|Win32.ActiveCfg = Release|Win32
+		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.All|Win32.Build.0 = Release|Win32
+		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.All|x64.ActiveCfg = Release|Win32
+		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.Debug|x64.ActiveCfg = Debug|Win32
+		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.Release|Win32.ActiveCfg = Release|Win32
+		{7D3122C7-C9D0-3748-81F8-F0DDCB40BF5E}.Release|x64.ActiveCfg = Release|Win32
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.All|Win32.ActiveCfg = Release|x64
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.All|x64.ActiveCfg = Release|x64
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.All|x64.Build.0 = Release|x64
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Debug|Win32.Build.0 = Debug|Win32
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Debug|x64.ActiveCfg = Debug|x64
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Debug|x64.Build.0 = Debug|x64
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Release|Win32.ActiveCfg = Release|Win32
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Release|Win32.Build.0 = Release|Win32
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Release|x64.ActiveCfg = Release|x64
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}.Release|x64.Build.0 = Release|x64
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.All|Win32.ActiveCfg = Release|x64
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.All|x64.ActiveCfg = Release|x64
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.All|x64.Build.0 = Release|x64
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Debug|Win32.Build.0 = Debug|Win32
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Debug|x64.ActiveCfg = Debug|x64
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Debug|x64.Build.0 = Debug|x64
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Release|Win32.ActiveCfg = Release|Win32
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Release|Win32.Build.0 = Release|Win32
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Release|x64.ActiveCfg = Release|x64
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8}.Release|x64.Build.0 = Release|x64
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.All|Win32.ActiveCfg = Release|Win32
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.All|Win32.Build.0 = Release|Win32
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.All|x64.ActiveCfg = Release|Win32
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|Win32.ActiveCfg = Debug|Win32
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|Win32.Build.0 = Debug|Win32
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|x64.ActiveCfg = Debug|x64
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Debug|x64.Build.0 = Debug|x64
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|Win32.ActiveCfg = Release|Win32
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|Win32.Build.0 = Release|Win32
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|x64.ActiveCfg = Release|x64
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76}.Release|x64.Build.0 = Release|x64
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.All|Win32.ActiveCfg = Release|Win32
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.All|Win32.Build.0 = Release|Win32
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.All|x64.ActiveCfg = Release|Win32
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Debug|Win32.Build.0 = Debug|Win32
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Debug|x64.ActiveCfg = Debug|x64
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Debug|x64.Build.0 = Debug|x64
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Release|Win32.ActiveCfg = Release|Win32
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Release|Win32.Build.0 = Release|Win32
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Release|x64.ActiveCfg = Release|x64
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8}.Release|x64.Build.0 = Release|x64
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.All|Win32.ActiveCfg = Release|x64
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.All|x64.ActiveCfg = Release|x64
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.All|x64.Build.0 = Release|x64
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Debug|Win32.Build.0 = Debug|Win32
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Debug|x64.ActiveCfg = Debug|x64
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Debug|x64.Build.0 = Debug|x64
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Release|Win32.ActiveCfg = Release|Win32
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Release|Win32.Build.0 = Release|Win32
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Release|x64.ActiveCfg = Release|x64
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91}.Release|x64.Build.0 = Release|x64
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.All|Win32.ActiveCfg = Release|x64
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.All|x64.ActiveCfg = Release|x64
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.All|x64.Build.0 = Release|x64
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Debug|Win32.Build.0 = Debug|Win32
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Debug|x64.ActiveCfg = Debug|x64
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Debug|x64.Build.0 = Debug|x64
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Release|Win32.ActiveCfg = Release|Win32
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Release|Win32.Build.0 = Release|Win32
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Release|x64.ActiveCfg = Release|x64
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65}.Release|x64.Build.0 = Release|x64
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|Win32.ActiveCfg = Release|x64
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|x64.ActiveCfg = Release|x64
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|x64.Build.0 = Release|x64
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.Build.0 = Debug|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|x64.ActiveCfg = Debug|x64
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|x64.Build.0 = Debug|x64
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.ActiveCfg = Release|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.Build.0 = Release|Win32
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|x64.ActiveCfg = Release|x64
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|x64.Build.0 = Release|x64
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.All|Win32.ActiveCfg = Release|x64
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.All|x64.ActiveCfg = Release|x64
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.All|x64.Build.0 = Release|x64
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Debug|Win32.Build.0 = Debug|Win32
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Debug|x64.ActiveCfg = Debug|x64
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Debug|x64.Build.0 = Debug|x64
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Release|Win32.ActiveCfg = Release|Win32
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Release|Win32.Build.0 = Release|Win32
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Release|x64.ActiveCfg = Release|x64
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3}.Release|x64.Build.0 = Release|x64
+		{05C9FB27-480E-4D53-B3B7-7338E2514666}.All|Win32.ActiveCfg = Release|Win32
+		{05C9FB27-480E-4D53-B3B7-7338E2514666}.All|Win32.Build.0 = Release|Win32
+		{05C9FB27-480E-4D53-B3B7-7338E2514666}.All|x64.ActiveCfg = Release|Win32
+		{05C9FB27-480E-4D53-B3B7-7338E2514666}.Debug|Win32.ActiveCfg = Debug|Win32
+		{05C9FB27-480E-4D53-B3B7-7338E2514666}.Debug|x64.ActiveCfg = Debug|x64
+		{05C9FB27-480E-4D53-B3B7-7338E2514666}.Release|Win32.ActiveCfg = Release|Win32
+		{05C9FB27-480E-4D53-B3B7-7338E2514666}.Release|x64.ActiveCfg = Release|x64
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.All|Win32.ActiveCfg = Release|x64
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.All|x64.ActiveCfg = Release|x64
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.All|x64.Build.0 = Release|x64
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Debug|Win32.Build.0 = Debug|Win32
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Debug|x64.ActiveCfg = Debug|x64
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Debug|x64.Build.0 = Debug|x64
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Release|Win32.ActiveCfg = Release|Win32
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Release|Win32.Build.0 = Release|Win32
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Release|x64.ActiveCfg = Release|x64
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}.Release|x64.Build.0 = Release|x64
+		{7C22BDFF-CC09-400C-8A09-660733980028}.All|Win32.ActiveCfg = Release|x64
+		{7C22BDFF-CC09-400C-8A09-660733980028}.All|x64.ActiveCfg = Release|x64
+		{7C22BDFF-CC09-400C-8A09-660733980028}.All|x64.Build.0 = Release|x64
+		{7C22BDFF-CC09-400C-8A09-660733980028}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7C22BDFF-CC09-400C-8A09-660733980028}.Debug|Win32.Build.0 = Debug|Win32
+		{7C22BDFF-CC09-400C-8A09-660733980028}.Debug|x64.ActiveCfg = Debug|x64
+		{7C22BDFF-CC09-400C-8A09-660733980028}.Debug|x64.Build.0 = Debug|x64
+		{7C22BDFF-CC09-400C-8A09-660733980028}.Release|Win32.ActiveCfg = Release|Win32
+		{7C22BDFF-CC09-400C-8A09-660733980028}.Release|Win32.Build.0 = Release|Win32
+		{7C22BDFF-CC09-400C-8A09-660733980028}.Release|x64.ActiveCfg = Release|x64
+		{7C22BDFF-CC09-400C-8A09-660733980028}.Release|x64.Build.0 = Release|x64
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.All|Win32.ActiveCfg = Release|Win32
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.All|Win32.Build.0 = Release|Win32
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.All|x64.ActiveCfg = Release|x64
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.All|x64.Build.0 = Release|x64
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Debug|Win32.Build.0 = Debug|Win32
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Debug|x64.ActiveCfg = Debug|x64
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Debug|x64.Build.0 = Debug|x64
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Release|Win32.ActiveCfg = Release|Win32
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Release|Win32.Build.0 = Release|Win32
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Release|x64.ActiveCfg = Release|x64
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}.Release|x64.Build.0 = Release|x64
+		{23B4D303-79FC-49E0-89E2-2280E7E28940}.All|Win32.ActiveCfg = Release|x64
+		{23B4D303-79FC-49E0-89E2-2280E7E28940}.All|x64.ActiveCfg = Release|x64
+		{23B4D303-79FC-49E0-89E2-2280E7E28940}.All|x64.Build.0 = Release|x64
+		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Debug|Win32.ActiveCfg = Debug|Win32
+		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Debug|Win32.Build.0 = Debug|Win32
+		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Debug|x64.ActiveCfg = Debug|x64
+		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Debug|x64.Build.0 = Debug|x64
+		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|Win32.ActiveCfg = Release|Win32
+		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|Win32.Build.0 = Release|Win32
+		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|x64.ActiveCfg = Release|x64
+		{23B4D303-79FC-49E0-89E2-2280E7E28940}.Release|x64.Build.0 = Release|x64
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.All|Win32.ActiveCfg = Release|x64
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.All|x64.ActiveCfg = Release|x64
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.All|x64.Build.0 = Release|x64
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Debug|Win32.Build.0 = Debug|Win32
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Debug|x64.ActiveCfg = Debug|x64
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Debug|x64.Build.0 = Debug|x64
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|Win32.ActiveCfg = Release|Win32
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|Win32.Build.0 = Release|Win32
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|x64.ActiveCfg = Release|x64
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}.Release|x64.Build.0 = Release|x64
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.All|Win32.ActiveCfg = Release|x64
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.All|x64.ActiveCfg = Release|x64
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.All|x64.Build.0 = Release|x64
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|Win32.ActiveCfg = Debug|Win32
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|Win32.Build.0 = Debug|Win32
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|x64.ActiveCfg = Debug|x64
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Debug|x64.Build.0 = Debug|x64
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|Win32.ActiveCfg = Release|Win32
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|Win32.Build.0 = Release|Win32
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|x64.ActiveCfg = Release|x64
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735}.Release|x64.Build.0 = Release|x64
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.All|Win32.ActiveCfg = Release|x64
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.All|x64.ActiveCfg = Release|x64
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.All|x64.Build.0 = Release|x64
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Debug|Win32.Build.0 = Debug|Win32
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Debug|x64.ActiveCfg = Debug|x64
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Debug|x64.Build.0 = Debug|x64
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Release|Win32.ActiveCfg = Release|Win32
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Release|Win32.Build.0 = Release|Win32
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Release|x64.ActiveCfg = Release|x64
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}.Release|x64.Build.0 = Release|x64
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.All|Win32.ActiveCfg = Release|x64
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.All|x64.ActiveCfg = Release|x64
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.All|x64.Build.0 = Release|x64
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|Win32.Build.0 = Debug|Win32
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|x64.ActiveCfg = Debug|x64
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Debug|x64.Build.0 = Debug|x64
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|Win32.ActiveCfg = Release|Win32
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|Win32.Build.0 = Release|Win32
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|x64.ActiveCfg = Release|x64
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77}.Release|x64.Build.0 = Release|x64
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.All|Win32.ActiveCfg = Release|x64
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.All|x64.ActiveCfg = Release|x64
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.All|x64.Build.0 = Release|x64
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|Win32.Build.0 = Debug|Win32
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|x64.ActiveCfg = Debug|x64
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Debug|x64.Build.0 = Debug|x64
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|Win32.ActiveCfg = Release|Win32
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|Win32.Build.0 = Release|Win32
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|x64.ActiveCfg = Release|x64
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}.Release|x64.Build.0 = Release|x64
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.All|Win32.ActiveCfg = Release|x64
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.All|x64.ActiveCfg = Release|x64
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.All|x64.Build.0 = Release|x64
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|Win32.Build.0 = Debug|Win32
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|x64.ActiveCfg = Debug|x64
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Debug|x64.Build.0 = Debug|x64
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|Win32.ActiveCfg = Release|Win32
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|Win32.Build.0 = Release|Win32
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|x64.ActiveCfg = Release|x64
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79}.Release|x64.Build.0 = Release|x64
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|Win32.ActiveCfg = Release|x64
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|x64.ActiveCfg = Release|x64
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.All|x64.Build.0 = Release|x64
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.ActiveCfg = Debug|Win32
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|Win32.Build.0 = Debug|Win32
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x64.ActiveCfg = Debug|x64
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Debug|x64.Build.0 = Debug|x64
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.ActiveCfg = Release|Win32
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|Win32.Build.0 = Release|Win32
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x64.ActiveCfg = Release|x64
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}.Release|x64.Build.0 = Release|x64
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|Win32.ActiveCfg = Release|x64
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64.ActiveCfg = Release|x64
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.All|x64.Build.0 = Release|x64
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|Win32.ActiveCfg = Debug|Win32
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|Win32.Build.0 = Debug|Win32
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x64.ActiveCfg = Debug|x64
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Debug|x64.Build.0 = Debug|x64
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|Win32.ActiveCfg = Release|Win32
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|Win32.Build.0 = Release|Win32
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x64.ActiveCfg = Release|x64
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90}.Release|x64.Build.0 = Release|x64
+		{C13CC324-0032-4492-9A30-310A6BD64FF5}.All|Win32.ActiveCfg = Release|Win32
+		{C13CC324-0032-4492-9A30-310A6BD64FF5}.All|Win32.Build.0 = Release|Win32
+		{C13CC324-0032-4492-9A30-310A6BD64FF5}.All|x64.ActiveCfg = Release|Win32
+		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|Win32.Build.0 = Debug|Win32
+		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|x64.ActiveCfg = Debug|x64
+		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Debug|x64.Build.0 = Debug|x64
+		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|Win32.ActiveCfg = Release|Win32
+		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|Win32.Build.0 = Release|Win32
+		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|x64.ActiveCfg = Release|x64
+		{C13CC324-0032-4492-9A30-310A6BD64FF5}.Release|x64.Build.0 = Release|x64
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.All|Win32.ActiveCfg = Release|x64
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.All|x64.ActiveCfg = Release|x64
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.All|x64.Build.0 = Release|x64
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|Win32.Build.0 = Debug|Win32
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|x64.ActiveCfg = Debug|x64
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Debug|x64.Build.0 = Debug|x64
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Release|Win32.ActiveCfg = Release|Win32
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Release|Win32.Build.0 = Release|Win32
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Release|x64.ActiveCfg = Release|x64
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}.Release|x64.Build.0 = Release|x64
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.All|Win32.ActiveCfg = Release|Win32
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.All|Win32.Build.0 = Release|Win32
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.All|x64.ActiveCfg = Release|Win32
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Debug|Win32.Build.0 = Debug|Win32
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Debug|x64.ActiveCfg = Debug|Win32
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Debug|x64.Build.0 = Debug|Win32
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Release|Win32.ActiveCfg = Release|Win32
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Release|Win32.Build.0 = Release|Win32
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Release|x64.ActiveCfg = Release|Win32
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6}.Release|x64.Build.0 = Release|Win32
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.All|Win32.ActiveCfg = Release|Win32
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.All|Win32.Build.0 = Release|Win32
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.All|x64.ActiveCfg = Release|Win32
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Debug|Win32.ActiveCfg = Debug|Win32
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Debug|Win32.Build.0 = Debug|Win32
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Debug|x64.ActiveCfg = Debug|x64
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Debug|x64.Build.0 = Debug|x64
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.ActiveCfg = Release|Win32
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.Build.0 = Release|Win32
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|x64.ActiveCfg = Release|x64
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|x64.Build.0 = Release|x64
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.All|Win32.ActiveCfg = Release|x64
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.All|x64.ActiveCfg = Release|x64
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.All|x64.Build.0 = Release|x64
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Win32.Build.0 = Debug|Win32
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|x64.ActiveCfg = Debug|x64
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|x64.Build.0 = Debug|x64
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Win32.ActiveCfg = Release|Win32
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Win32.Build.0 = Release|Win32
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|x64.ActiveCfg = Release|x64
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|x64.Build.0 = Release|x64
+		{BED7539C-0099-4A14-AD5D-30828F15A171}.All|Win32.ActiveCfg = Release|x64
+		{BED7539C-0099-4A14-AD5D-30828F15A171}.All|x64.ActiveCfg = Release|x64
+		{BED7539C-0099-4A14-AD5D-30828F15A171}.All|x64.Build.0 = Release|x64
+		{BED7539C-0099-4A14-AD5D-30828F15A171}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BED7539C-0099-4A14-AD5D-30828F15A171}.Debug|Win32.Build.0 = Debug|Win32
+		{BED7539C-0099-4A14-AD5D-30828F15A171}.Debug|x64.ActiveCfg = Debug|Win32
+		{BED7539C-0099-4A14-AD5D-30828F15A171}.Debug|x64.Build.0 = Debug|Win32
+		{BED7539C-0099-4A14-AD5D-30828F15A171}.Release|Win32.ActiveCfg = Release|Win32
+		{BED7539C-0099-4A14-AD5D-30828F15A171}.Release|Win32.Build.0 = Release|Win32
+		{BED7539C-0099-4A14-AD5D-30828F15A171}.Release|x64.ActiveCfg = Release|Win32
+		{BED7539C-0099-4A14-AD5D-30828F15A171}.Release|x64.Build.0 = Release|Win32
+		{0D108721-EAE8-4BAF-8102-D8960EC93647}.All|Win32.ActiveCfg = Release|x64
+		{0D108721-EAE8-4BAF-8102-D8960EC93647}.All|x64.ActiveCfg = Release|x64
+		{0D108721-EAE8-4BAF-8102-D8960EC93647}.All|x64.Build.0 = Release|x64
+		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Win32.Build.0 = Debug|Win32
+		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|x64.ActiveCfg = Debug|x64
+		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|x64.Build.0 = Debug|x64
+		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Win32.ActiveCfg = Release|Win32
+		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Win32.Build.0 = Release|Win32
+		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|x64.ActiveCfg = Release|x64
+		{0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|x64.Build.0 = Release|x64
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.All|Win32.ActiveCfg = Release|x64
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.All|x64.ActiveCfg = Release|x64
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.All|x64.Build.0 = Release|x64
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Win32.Build.0 = Debug|Win32
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|x64.ActiveCfg = Debug|x64
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|x64.Build.0 = Debug|x64
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Win32.ActiveCfg = Release|Win32
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Win32.Build.0 = Release|Win32
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|x64.ActiveCfg = Release|x64
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|x64.Build.0 = Release|x64
+		{B535402E-38D2-4D54-8360-423ACBD17192}.All|Win32.ActiveCfg = Release|x64
+		{B535402E-38D2-4D54-8360-423ACBD17192}.All|x64.ActiveCfg = Release|x64
+		{B535402E-38D2-4D54-8360-423ACBD17192}.All|x64.Build.0 = Release|x64
+		{B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Win32.Build.0 = Debug|Win32
+		{B535402E-38D2-4D54-8360-423ACBD17192}.Debug|x64.ActiveCfg = Debug|x64
+		{B535402E-38D2-4D54-8360-423ACBD17192}.Debug|x64.Build.0 = Debug|x64
+		{B535402E-38D2-4D54-8360-423ACBD17192}.Release|Win32.ActiveCfg = Release|Win32
+		{B535402E-38D2-4D54-8360-423ACBD17192}.Release|Win32.Build.0 = Release|Win32
+		{B535402E-38D2-4D54-8360-423ACBD17192}.Release|x64.ActiveCfg = Release|x64
+		{B535402E-38D2-4D54-8360-423ACBD17192}.Release|x64.Build.0 = Release|x64
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.All|Win32.ActiveCfg = Release|x86
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.All|Win32.Build.0 = Release|x86
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.All|x64.ActiveCfg = Release|x64
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.All|x64.Build.0 = Release|x64
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Debug|Win32.ActiveCfg = Debug|x86
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Debug|Win32.Build.0 = Debug|x86
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Debug|x64.ActiveCfg = Debug|x64
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Debug|x64.Build.0 = Debug|x64
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Release|Win32.ActiveCfg = Release|x86
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Release|Win32.Build.0 = Release|x86
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Release|x64.ActiveCfg = Release|x64
+		{47213370-B933-487D-9F45-BCA26D7E2B6F}.Release|x64.Build.0 = Release|x64
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.All|Win32.ActiveCfg = All|Win32
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.All|Win32.Build.0 = All|Win32
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.All|x64.ActiveCfg = All|Win32
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|Win32.ActiveCfg = All|Win32
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|Win32.Build.0 = All|Win32
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|x64.ActiveCfg = All|Win32
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Debug|x64.Build.0 = All|Win32
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|Win32.ActiveCfg = All|Win32
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|Win32.Build.0 = All|Win32
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|x64.ActiveCfg = All|Win32
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B}.Release|x64.Build.0 = All|Win32
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.All|Win32.ActiveCfg = Release|Win32
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.All|Win32.Build.0 = Release|Win32
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.All|x64.ActiveCfg = Release|Win32
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|Win32.Build.0 = Debug|Win32
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|x64.ActiveCfg = Debug|x64
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Debug|x64.Build.0 = Debug|x64
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|Win32.ActiveCfg = Release|Win32
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|Win32.Build.0 = Release|Win32
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|x64.ActiveCfg = Release|x64
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}.Release|x64.Build.0 = Release|x64
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.All|Win32.ActiveCfg = All|Win32
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.All|Win32.Build.0 = All|Win32
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.All|x64.ActiveCfg = All|Win32
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Debug|Win32.ActiveCfg = All|Win32
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Debug|Win32.Build.0 = All|Win32
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Debug|x64.ActiveCfg = All|Win32
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Debug|x64.Build.0 = All|Win32
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Release|Win32.ActiveCfg = All|Win32
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Release|Win32.Build.0 = All|Win32
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Release|x64.ActiveCfg = All|Win32
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}.Release|x64.Build.0 = All|Win32
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.All|Win32.ActiveCfg = Release|Win32
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.All|Win32.Build.0 = Release|Win32
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.All|x64.ActiveCfg = Release|Win32
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Debug|Win32.ActiveCfg = Debug|Win32
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Debug|Win32.Build.0 = Debug|Win32
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Debug|x64.ActiveCfg = Debug|Win32
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Debug|x64.Build.0 = Debug|Win32
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Release|Win32.ActiveCfg = Release|Win32
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Release|Win32.Build.0 = Release|Win32
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Release|x64.ActiveCfg = Release|Win32
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547}.Release|x64.Build.0 = Release|Win32
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.All|Win32.ActiveCfg = Release|Win32
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.All|Win32.Build.0 = Release|Win32
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.All|x64.ActiveCfg = Release|x64
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.All|x64.Build.0 = Release|x64
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Debug|Win32.Build.0 = Debug|Win32
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Debug|x64.ActiveCfg = Debug|x64
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Debug|x64.Build.0 = Debug|x64
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Release|Win32.ActiveCfg = Release|Win32
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Release|Win32.Build.0 = Release|Win32
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Release|x64.ActiveCfg = Release|x64
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}.Release|x64.Build.0 = Release|x64
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.All|Win32.ActiveCfg = Release|Win32
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.All|Win32.Build.0 = Release|Win32
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.All|x64.ActiveCfg = Release|x64
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.All|x64.Build.0 = Release|x64
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|Win32.Build.0 = Debug|Win32
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|x64.ActiveCfg = Debug|x64
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.Debug|x64.Build.0 = Debug|x64
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.Release|Win32.ActiveCfg = Release|Win32
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.Release|Win32.Build.0 = Release|Win32
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.Release|x64.ActiveCfg = Release|x64
+		{245603E3-F580-41A5-9632-B25FE3372CBF}.Release|x64.Build.0 = Release|x64
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.All|Win32.ActiveCfg = Release|Win32
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.All|Win32.Build.0 = Release|Win32
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.All|x64.ActiveCfg = Release|x64
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.All|x64.Build.0 = Release|x64
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Debug|Win32.Build.0 = Debug|Win32
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Debug|x64.ActiveCfg = Debug|x64
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Debug|x64.Build.0 = Debug|x64
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Release|Win32.ActiveCfg = Release|Win32
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Release|Win32.Build.0 = Release|Win32
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Release|x64.ActiveCfg = Release|x64
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}.Release|x64.Build.0 = Release|x64
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.All|Win32.ActiveCfg = Release|Win32
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.All|Win32.Build.0 = Release|Win32
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.All|x64.ActiveCfg = Release|x64
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.All|x64.Build.0 = Release|x64
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Debug|Win32.Build.0 = Debug|Win32
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Debug|x64.ActiveCfg = Debug|x64
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Debug|x64.Build.0 = Debug|x64
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Release|Win32.ActiveCfg = Release|Win32
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Release|Win32.Build.0 = Release|Win32
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Release|x64.ActiveCfg = Release|x64
+		{8484C90D-1561-402F-A91D-2DB10F8C5171}.Release|x64.Build.0 = Release|x64
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.All|Win32.ActiveCfg = Release|Win32
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.All|Win32.Build.0 = Release|Win32
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.All|x64.ActiveCfg = Release|x64
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.All|x64.Build.0 = Release|x64
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Debug|Win32.ActiveCfg = Debug|Win32
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Debug|Win32.Build.0 = Debug|Win32
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Debug|x64.ActiveCfg = Debug|x64
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Debug|x64.Build.0 = Debug|x64
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|Win32.ActiveCfg = Release|Win32
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|Win32.Build.0 = Release|Win32
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|x64.ActiveCfg = Release|x64
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}.Release|x64.Build.0 = Release|x64
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.All|Win32.ActiveCfg = Release|Win32
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.All|Win32.Build.0 = Release|Win32
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.All|x64.ActiveCfg = Release|x64
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.All|x64.Build.0 = Release|x64
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Debug|Win32.Build.0 = Debug|Win32
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Debug|x64.ActiveCfg = Debug|x64
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Debug|x64.Build.0 = Debug|x64
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Release|Win32.ActiveCfg = Release|Win32
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Release|Win32.Build.0 = Release|Win32
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Release|x64.ActiveCfg = Release|x64
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}.Release|x64.Build.0 = Release|x64
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.All|Win32.ActiveCfg = All|Win32
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.All|Win32.Build.0 = All|Win32
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.All|x64.ActiveCfg = All|Win32
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Debug|Win32.ActiveCfg = All|Win32
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Debug|Win32.Build.0 = All|Win32
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Debug|x64.ActiveCfg = All|Win32
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Debug|x64.Build.0 = All|Win32
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Release|Win32.ActiveCfg = All|Win32
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Release|Win32.Build.0 = All|Win32
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Release|x64.ActiveCfg = All|Win32
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}.Release|x64.Build.0 = All|Win32
+		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.All|Win32.ActiveCfg = Release|Any CPU
+		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.All|x64.ActiveCfg = Release|Any CPU
+		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.Release|Win32.ActiveCfg = Release|Any CPU
+		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0}.Release|x64.ActiveCfg = Release|Any CPU
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.All|Win32.ActiveCfg = Release|Win32
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.All|Win32.Build.0 = Release|Win32
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.All|x64.ActiveCfg = Release|Win32
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Debug|Win32.Build.0 = Debug|Win32
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Debug|x64.ActiveCfg = Debug|Win32
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Debug|x64.Build.0 = Debug|Win32
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Release|Win32.ActiveCfg = Release|Win32
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Release|Win32.Build.0 = Release|Win32
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Release|x64.ActiveCfg = Release|Win32
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31}.Release|x64.Build.0 = Release|Win32
+		{97D25665-34CD-4E0C-96E7-88F0795B8883}.All|Win32.ActiveCfg = Release|Win32
+		{97D25665-34CD-4E0C-96E7-88F0795B8883}.All|Win32.Build.0 = Release|Win32
+		{97D25665-34CD-4E0C-96E7-88F0795B8883}.All|x64.ActiveCfg = Release|Win32
+		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Debug|Win32.ActiveCfg = Debug|Win32
+		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Debug|Win32.Build.0 = Debug|Win32
+		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Debug|x64.ActiveCfg = Debug|Win32
+		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Debug|x64.Build.0 = Debug|Win32
+		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Release|Win32.ActiveCfg = Release|Win32
+		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Release|Win32.Build.0 = Release|Win32
+		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Release|x64.ActiveCfg = Release|Win32
+		{97D25665-34CD-4E0C-96E7-88F0795B8883}.Release|x64.Build.0 = Release|Win32
+		{5BE9A596-F11F-4379-928C-412F81AE182B}.All|Win32.ActiveCfg = Release|Win32
+		{5BE9A596-F11F-4379-928C-412F81AE182B}.All|Win32.Build.0 = Release|Win32
+		{5BE9A596-F11F-4379-928C-412F81AE182B}.All|x64.ActiveCfg = Release|Win32
+		{5BE9A596-F11F-4379-928C-412F81AE182B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5BE9A596-F11F-4379-928C-412F81AE182B}.Debug|Win32.Build.0 = Debug|Win32
+		{5BE9A596-F11F-4379-928C-412F81AE182B}.Debug|x64.ActiveCfg = Debug|Win32
+		{5BE9A596-F11F-4379-928C-412F81AE182B}.Debug|x64.Build.0 = Debug|Win32
+		{5BE9A596-F11F-4379-928C-412F81AE182B}.Release|Win32.ActiveCfg = Release|Win32
+		{5BE9A596-F11F-4379-928C-412F81AE182B}.Release|Win32.Build.0 = Release|Win32
+		{5BE9A596-F11F-4379-928C-412F81AE182B}.Release|x64.ActiveCfg = Release|Win32
+		{5BE9A596-F11F-4379-928C-412F81AE182B}.Release|x64.Build.0 = Release|Win32
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.All|Win32.ActiveCfg = Release|Win32
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.All|Win32.Build.0 = Release|Win32
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.All|x64.ActiveCfg = Release|Win32
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Debug|Win32.Build.0 = Debug|Win32
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Debug|x64.ActiveCfg = Debug|Win32
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Debug|x64.Build.0 = Debug|Win32
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Release|Win32.ActiveCfg = Release|Win32
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Release|Win32.Build.0 = Release|Win32
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Release|x64.ActiveCfg = Release|Win32
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C}.Release|x64.Build.0 = Release|Win32
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.All|Win32.ActiveCfg = Release|x64
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.All|x64.ActiveCfg = Release|x64
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.All|x64.Build.0 = Release|x64
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Debug|Win32.Build.0 = Debug|Win32
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Debug|x64.ActiveCfg = Debug|x64
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Debug|x64.Build.0 = Debug|x64
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Release|Win32.ActiveCfg = Release|Win32
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Release|Win32.Build.0 = Release|Win32
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Release|x64.ActiveCfg = Release|x64
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}.Release|x64.Build.0 = Release|x64
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.All|Win32.ActiveCfg = Release|x64
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.All|x64.ActiveCfg = Release|x64
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.All|x64.Build.0 = Release|x64
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|Win32.Build.0 = Debug|Win32
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|x64.ActiveCfg = Debug|x64
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Debug|x64.Build.0 = Debug|x64
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Release|Win32.ActiveCfg = Release|Win32
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Release|Win32.Build.0 = Release|Win32
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Release|x64.ActiveCfg = Release|x64
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}.Release|x64.Build.0 = Release|x64
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.All|Win32.ActiveCfg = Release|Win32
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.All|Win32.Build.0 = Release|Win32
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.All|x64.ActiveCfg = Release|x64
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.All|x64.Build.0 = Release|x64
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Debug|Win32.Build.0 = Debug|Win32
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Debug|x64.ActiveCfg = Debug|x64
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Debug|x64.Build.0 = Debug|x64
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Release|Win32.ActiveCfg = Release|Win32
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Release|Win32.Build.0 = Release|Win32
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Release|x64.ActiveCfg = Release|x64
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99}.Release|x64.Build.0 = Release|x64
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.All|Win32.ActiveCfg = Release|Win32
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.All|Win32.Build.0 = Release|Win32
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.All|x64.ActiveCfg = Release|x64
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.All|x64.Build.0 = Release|x64
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|Win32.Build.0 = Debug|Win32
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|x64.ActiveCfg = Debug|x64
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Debug|x64.Build.0 = Debug|x64
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Win32.ActiveCfg = Release|Win32
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|Win32.Build.0 = Release|Win32
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|x64.ActiveCfg = Release|x64
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74}.Release|x64.Build.0 = Release|x64
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.All|Win32.ActiveCfg = Release|Win32
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.All|Win32.Build.0 = Release|Win32
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.All|x64.ActiveCfg = Release|x64
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.All|x64.Build.0 = Release|x64
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|Win32.Build.0 = Debug|Win32
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|x64.ActiveCfg = Debug|x64
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Debug|x64.Build.0 = Debug|x64
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|Win32.ActiveCfg = Release|Win32
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|Win32.Build.0 = Release|Win32
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|x64.ActiveCfg = Release|x64
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E}.Release|x64.Build.0 = Release|x64
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.All|Win32.ActiveCfg = Release|Win32
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.All|Win32.Build.0 = Release|Win32
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.All|x64.ActiveCfg = Release|Win32
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.All|x64.Build.0 = Release|Win32
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Debug|Win32.Build.0 = Debug|Win32
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Debug|x64.ActiveCfg = Debug|Win32
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Debug|x64.Build.0 = Debug|Win32
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Release|Win32.ActiveCfg = Release|Win32
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Release|Win32.Build.0 = Release|Win32
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Release|x64.ActiveCfg = Release|Win32
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33}.Release|x64.Build.0 = Release|Win32
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.All|Win32.ActiveCfg = Release|Win32
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.All|Win32.Build.0 = Release|Win32
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.All|x64.ActiveCfg = Release|x64
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.All|x64.Build.0 = Release|x64
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.All|Win32.ActiveCfg = Release|Win32
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.All|Win32.Build.0 = Release|Win32
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.All|x64.ActiveCfg = Release|Win32
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.All|x64.Build.0 = Release|Win32
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Debug|Win32.Build.0 = Debug|Win32
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Debug|x64.ActiveCfg = Debug|Win32
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Debug|x64.Build.0 = Debug|Win32
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Release|Win32.ActiveCfg = Release|Win32
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Release|Win32.Build.0 = Release|Win32
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Release|x64.ActiveCfg = Release|Win32
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A}.Release|x64.Build.0 = Release|Win32
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.All|Win32.ActiveCfg = Release|Win32
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.All|Win32.Build.0 = Release|Win32
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.All|x64.ActiveCfg = Release|x64
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.All|x64.Build.0 = Release|x64
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Debug|Win32.Build.0 = Debug|Win32
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Debug|x64.ActiveCfg = Debug|x64
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Debug|x64.Build.0 = Debug|x64
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Release|Win32.ActiveCfg = Release|Win32
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Release|Win32.Build.0 = Release|Win32
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Release|x64.ActiveCfg = Release|x64
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B}.Release|x64.Build.0 = Release|x64
+		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.All|Win32.ActiveCfg = Release|Win32
+		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.All|Win32.Build.0 = Release|Win32
+		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.All|x64.ActiveCfg = Release|Win32
+		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.All|x64.Build.0 = Release|Win32
+		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Debug|Win32.ActiveCfg = Debug|Win32
+		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Debug|x64.ActiveCfg = Debug|Win32
+		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Release|Win32.ActiveCfg = Release|Win32
+		{77C9E0A2-177D-4BD6-9EFD-75A56F886325}.Release|x64.ActiveCfg = Release|Win32
+		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|Win32.ActiveCfg = Release|Win32
+		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|Win32.Build.0 = Release|Win32
+		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|x64.ActiveCfg = Release|x64
+		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.All|x64.Build.0 = Release|x64
+		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.Debug|Win32.ActiveCfg = Debug|Win32
+		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.Debug|x64.ActiveCfg = Debug|x64
+		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.Release|Win32.ActiveCfg = Release|Win32
+		{841C345F-FCC7-4F64-8F54-0281CEABEB01}.Release|x64.ActiveCfg = Release|x64
+		{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|Win32.ActiveCfg = Release|Win32
+		{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|Win32.Build.0 = Release|Win32
+		{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|x64.ActiveCfg = Release|x64
+		{7AEE504B-23B6-4B05-829E-7CD34855F146}.All|x64.Build.0 = Release|x64
+		{7AEE504B-23B6-4B05-829E-7CD34855F146}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7AEE504B-23B6-4B05-829E-7CD34855F146}.Debug|x64.ActiveCfg = Debug|x64
+		{7AEE504B-23B6-4B05-829E-7CD34855F146}.Release|Win32.ActiveCfg = Release|Win32
+		{7AEE504B-23B6-4B05-829E-7CD34855F146}.Release|x64.ActiveCfg = Release|x64
+		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|Win32.ActiveCfg = Release|Win32
+		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|Win32.Build.0 = Release|Win32
+		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|x64.ActiveCfg = Release|x64
+		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.All|x64.Build.0 = Release|x64
+		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.Debug|Win32.ActiveCfg = Debug|Win32
+		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.Debug|x64.ActiveCfg = Debug|x64
+		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.Release|Win32.ActiveCfg = Release|Win32
+		{20179127-853B-4FE9-B7C0-9E817E6A3A72}.Release|x64.ActiveCfg = Release|x64
+		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|Win32.ActiveCfg = Release|Win32
+		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|Win32.Build.0 = Release|Win32
+		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|x64.ActiveCfg = Release|Win32
+		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.All|x64.Build.0 = Release|Win32
+		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Debug|x64.ActiveCfg = Debug|Win32
+		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Release|Win32.ActiveCfg = Release|Win32
+		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA}.Release|x64.ActiveCfg = Release|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.All|Win32.ActiveCfg = Release|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.All|Win32.Build.0 = Release|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.All|x64.ActiveCfg = Release|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.All|x64.Build.0 = Release|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.Debug|Win32.Build.0 = Debug|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.Debug|x64.ActiveCfg = Debug|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.Debug|x64.Build.0 = Debug|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.Release|Win32.ActiveCfg = Release|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.Release|Win32.Build.0 = Release|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.Release|x64.ActiveCfg = Release|Win32
+		{583D8CEA-4171-4493-9025-B63265F408D8}.Release|x64.Build.0 = Release|Win32
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.All|Win32.ActiveCfg = Release|Win32
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.All|Win32.Build.0 = Release|Win32
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.All|x64.ActiveCfg = Release|x64
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.All|x64.Build.0 = Release|x64
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|Win32.Build.0 = Debug|Win32
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|x64.ActiveCfg = Debug|x64
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Debug|x64.Build.0 = Debug|x64
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|Win32.ActiveCfg = Release|Win32
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|Win32.Build.0 = Release|Win32
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|x64.ActiveCfg = Release|x64
+		{87933C2D-0159-46F7-B326-E1B6E982C21E}.Release|x64.Build.0 = Release|x64
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.All|Win32.ActiveCfg = Release|Win32
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.All|Win32.Build.0 = Release|Win32
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.All|x64.ActiveCfg = Release|Win32
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.All|x64.Build.0 = Release|Win32
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.Debug|Win32.ActiveCfg = Debug|Win32
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.Debug|Win32.Build.0 = Debug|Win32
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.Debug|x64.ActiveCfg = Debug|Win32
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.Debug|x64.Build.0 = Debug|Win32
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.Release|Win32.ActiveCfg = Release|Win32
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.Release|Win32.Build.0 = Release|Win32
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.Release|x64.ActiveCfg = Release|Win32
+		{36603FE1-253F-4C2C-AAB6-12927A626135}.Release|x64.Build.0 = Release|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.All|Win32.ActiveCfg = Release|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.All|Win32.Build.0 = Release|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.All|x64.ActiveCfg = Release|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.All|x64.Build.0 = Release|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.Debug|Win32.ActiveCfg = Debug|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.Debug|Win32.Build.0 = Debug|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.Debug|x64.ActiveCfg = Debug|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.Debug|x64.Build.0 = Debug|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.Release|Win32.ActiveCfg = Release|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.Release|Win32.Build.0 = Release|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.Release|x64.ActiveCfg = Release|Win32
+		{53AADA60-DF12-46FF-BF94-566BBF849336}.Release|x64.Build.0 = Release|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.All|Win32.ActiveCfg = Release|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.All|Win32.Build.0 = Release|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.All|x64.ActiveCfg = Release|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.All|x64.Build.0 = Release|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.Debug|Win32.ActiveCfg = Debug|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.Debug|Win32.Build.0 = Debug|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.Debug|x64.ActiveCfg = Debug|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.Debug|x64.Build.0 = Debug|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.Release|Win32.ActiveCfg = Release|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.Release|Win32.Build.0 = Release|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.Release|x64.ActiveCfg = Release|Win32
+		{46502007-0D94-47AC-A640-C2B5EEA98333}.Release|x64.Build.0 = Release|Win32
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.All|Win32.ActiveCfg = Release|Win32
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.All|Win32.Build.0 = Release|Win32
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.All|x64.ActiveCfg = Release|x64
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.All|x64.Build.0 = Release|x64
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Debug|Win32.ActiveCfg = Debug|Win32
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Debug|Win32.Build.0 = Debug|Win32
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Debug|x64.ActiveCfg = Debug|x64
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Debug|x64.Build.0 = Debug|x64
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Release|Win32.ActiveCfg = Release|Win32
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Release|Win32.Build.0 = Release|Win32
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Release|x64.ActiveCfg = Release|x64
+		{19E934D6-1484-41C8-9305-78DC42FD61F2}.Release|x64.Build.0 = Release|x64
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.All|Win32.ActiveCfg = Release|Win32
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.All|Win32.Build.0 = Release|Win32
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.All|x64.ActiveCfg = Release|x64
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.All|x64.Build.0 = Release|x64
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Debug|Win32.Build.0 = Debug|Win32
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Debug|x64.ActiveCfg = Debug|x64
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Debug|x64.Build.0 = Debug|x64
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Release|Win32.ActiveCfg = Release|Win32
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Release|Win32.Build.0 = Release|Win32
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Release|x64.ActiveCfg = Release|x64
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17}.Release|x64.Build.0 = Release|x64
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.All|Win32.ActiveCfg = Release|Win32
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.All|Win32.Build.0 = Release|Win32
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.All|x64.ActiveCfg = Release|Win32
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.All|x64.Build.0 = Release|Win32
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Debug|Win32.Build.0 = Debug|Win32
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Debug|x64.ActiveCfg = Debug|Win32
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Debug|x64.Build.0 = Debug|Win32
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Release|Win32.ActiveCfg = Release|Win32
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Release|Win32.Build.0 = Release|Win32
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Release|x64.ActiveCfg = Release|Win32
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D}.Release|x64.Build.0 = Release|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.All|Win32.ActiveCfg = Release|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.All|Win32.Build.0 = Release|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.All|x64.ActiveCfg = Release|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.All|x64.Build.0 = Release|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.Debug|Win32.ActiveCfg = Debug|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.Debug|Win32.Build.0 = Debug|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.Debug|x64.ActiveCfg = Debug|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.Debug|x64.Build.0 = Debug|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.Release|Win32.ActiveCfg = Release|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.Release|Win32.Build.0 = Release|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.Release|x64.ActiveCfg = Release|Win32
+		{08782D64-E775-4E96-B707-CC633A226F32}.Release|x64.Build.0 = Release|Win32
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|Win32.ActiveCfg = Release|Win32
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|Win32.Build.0 = Release|Win32
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|x64.ActiveCfg = Release|x64
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.All|x64.Build.0 = Release|x64
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|Win32.Build.0 = Debug|Win32
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|x64.ActiveCfg = Debug|x64
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Debug|x64.Build.0 = Debug|x64
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|Win32.ActiveCfg = Release|Win32
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|Win32.Build.0 = Release|Win32
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|x64.ActiveCfg = Release|x64
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3}.Release|x64.Build.0 = Release|x64
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|Win32.ActiveCfg = Release|Win32
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|Win32.Build.0 = Release|Win32
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|x64.ActiveCfg = Release|x64
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.All|x64.Build.0 = Release|x64
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|Win32.Build.0 = Debug|Win32
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|x64.ActiveCfg = Debug|x64
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Debug|x64.Build.0 = Debug|x64
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|Win32.ActiveCfg = Release|Win32
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|Win32.Build.0 = Release|Win32
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|x64.ActiveCfg = Release|x64
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF}.Release|x64.Build.0 = Release|x64
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|Win32.ActiveCfg = Release|Win32
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|Win32.Build.0 = Release|Win32
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|x64.ActiveCfg = Release|x64
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.All|x64.Build.0 = Release|x64
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|Win32.Build.0 = Debug|Win32
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|x64.ActiveCfg = Debug|x64
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Debug|x64.Build.0 = Debug|x64
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|Win32.ActiveCfg = Release|Win32
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|Win32.Build.0 = Release|Win32
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|x64.ActiveCfg = Release|x64
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136}.Release|x64.Build.0 = Release|x64
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|Win32.ActiveCfg = Release|Win32
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|Win32.Build.0 = Release|Win32
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|x64.ActiveCfg = Release|x64
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.All|x64.Build.0 = Release|x64
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|Win32.Build.0 = Debug|Win32
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|x64.ActiveCfg = Debug|x64
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Debug|x64.Build.0 = Debug|x64
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|Win32.ActiveCfg = Release|Win32
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|Win32.Build.0 = Release|Win32
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|x64.ActiveCfg = Release|x64
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3}.Release|x64.Build.0 = Release|x64
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|Win32.ActiveCfg = Release|Win32
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|Win32.Build.0 = Release|Win32
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|x64.ActiveCfg = Release|x64
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.All|x64.Build.0 = Release|x64
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|Win32.Build.0 = Debug|Win32
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|x64.ActiveCfg = Debug|x64
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Debug|x64.Build.0 = Debug|x64
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|Win32.ActiveCfg = Release|Win32
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|Win32.Build.0 = Release|Win32
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|x64.ActiveCfg = Release|x64
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345}.Release|x64.Build.0 = Release|x64
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|Win32.ActiveCfg = Release|Win32
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|Win32.Build.0 = Release|Win32
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|x64.ActiveCfg = Release|x64
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.All|x64.Build.0 = Release|x64
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|Win32.Build.0 = Debug|Win32
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|x64.ActiveCfg = Debug|x64
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Debug|x64.Build.0 = Debug|x64
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|Win32.ActiveCfg = Release|Win32
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|Win32.Build.0 = Release|Win32
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|x64.ActiveCfg = Release|x64
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B}.Release|x64.Build.0 = Release|x64
+		{AF675478-995A-4115-90C4-B2B0D6470688}.All|Win32.ActiveCfg = Release|Win32
+		{AF675478-995A-4115-90C4-B2B0D6470688}.All|Win32.Build.0 = Release|Win32
+		{AF675478-995A-4115-90C4-B2B0D6470688}.All|x64.ActiveCfg = Release|x64
+		{AF675478-995A-4115-90C4-B2B0D6470688}.All|x64.Build.0 = Release|x64
+		{AF675478-995A-4115-90C4-B2B0D6470688}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AF675478-995A-4115-90C4-B2B0D6470688}.Debug|Win32.Build.0 = Debug|Win32
+		{AF675478-995A-4115-90C4-B2B0D6470688}.Debug|x64.ActiveCfg = Debug|x64
+		{AF675478-995A-4115-90C4-B2B0D6470688}.Debug|x64.Build.0 = Debug|x64
+		{AF675478-995A-4115-90C4-B2B0D6470688}.Release|Win32.ActiveCfg = Release|Win32
+		{AF675478-995A-4115-90C4-B2B0D6470688}.Release|Win32.Build.0 = Release|Win32
+		{AF675478-995A-4115-90C4-B2B0D6470688}.Release|x64.ActiveCfg = Release|x64
+		{AF675478-995A-4115-90C4-B2B0D6470688}.Release|x64.Build.0 = Release|x64
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|Win32.ActiveCfg = Release|Win32
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|Win32.Build.0 = Release|Win32
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|x64.ActiveCfg = Release|x64
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.All|x64.Build.0 = Release|x64
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|Win32.ActiveCfg = Debug|Win32
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|Win32.Build.0 = Debug|Win32
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|x64.ActiveCfg = Debug|x64
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Debug|x64.Build.0 = Debug|x64
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|Win32.ActiveCfg = Release|Win32
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|Win32.Build.0 = Release|Win32
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|x64.ActiveCfg = Release|x64
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04}.Release|x64.Build.0 = Release|x64
+		{20B15650-F910-4211-8729-AAB0F520C805}.All|Win32.ActiveCfg = Release|Win32
+		{20B15650-F910-4211-8729-AAB0F520C805}.All|Win32.Build.0 = Release|Win32
+		{20B15650-F910-4211-8729-AAB0F520C805}.All|x64.ActiveCfg = Release|x64
+		{20B15650-F910-4211-8729-AAB0F520C805}.All|x64.Build.0 = Release|x64
+		{20B15650-F910-4211-8729-AAB0F520C805}.Debug|Win32.ActiveCfg = Debug|Win32
+		{20B15650-F910-4211-8729-AAB0F520C805}.Debug|Win32.Build.0 = Debug|Win32
+		{20B15650-F910-4211-8729-AAB0F520C805}.Debug|x64.ActiveCfg = Debug|x64
+		{20B15650-F910-4211-8729-AAB0F520C805}.Debug|x64.Build.0 = Debug|x64
+		{20B15650-F910-4211-8729-AAB0F520C805}.Release|Win32.ActiveCfg = Release|Win32
+		{20B15650-F910-4211-8729-AAB0F520C805}.Release|Win32.Build.0 = Release|Win32
+		{20B15650-F910-4211-8729-AAB0F520C805}.Release|x64.ActiveCfg = Release|x64
+		{20B15650-F910-4211-8729-AAB0F520C805}.Release|x64.Build.0 = Release|x64
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|Win32.ActiveCfg = Release|Win32
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|Win32.Build.0 = Release|Win32
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|x64.ActiveCfg = Release|x64
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.All|x64.Build.0 = Release|x64
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|Win32.Build.0 = Debug|Win32
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|x64.ActiveCfg = Debug|x64
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Debug|x64.Build.0 = Debug|x64
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|Win32.ActiveCfg = Release|Win32
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|Win32.Build.0 = Release|Win32
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|x64.ActiveCfg = Release|x64
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7}.Release|x64.Build.0 = Release|x64
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|Win32.ActiveCfg = Release|Win32
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|Win32.Build.0 = Release|Win32
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|x64.ActiveCfg = Release|x64
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.All|x64.Build.0 = Release|x64
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|Win32.Build.0 = Debug|Win32
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|x64.ActiveCfg = Debug|x64
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Debug|x64.Build.0 = Debug|x64
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|Win32.ActiveCfg = Release|Win32
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|Win32.Build.0 = Release|Win32
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|x64.ActiveCfg = Release|x64
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F}.Release|x64.Build.0 = Release|x64
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|Win32.ActiveCfg = Release|Win32
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|Win32.Build.0 = Release|Win32
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|x64.ActiveCfg = Release|x64
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.All|x64.Build.0 = Release|x64
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|Win32.Build.0 = Debug|Win32
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|x64.ActiveCfg = Debug|x64
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Debug|x64.Build.0 = Debug|x64
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|Win32.ActiveCfg = Release|Win32
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|Win32.Build.0 = Release|Win32
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|x64.ActiveCfg = Release|x64
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A}.Release|x64.Build.0 = Release|x64
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|Win32.ActiveCfg = Release|Win32
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|Win32.Build.0 = Release|Win32
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|x64.ActiveCfg = Release|x64
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.All|x64.Build.0 = Release|x64
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|Win32.ActiveCfg = Debug|Win32
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|Win32.Build.0 = Debug|Win32
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|x64.ActiveCfg = Debug|x64
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Debug|x64.Build.0 = Debug|x64
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|Win32.ActiveCfg = Release|Win32
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|Win32.Build.0 = Release|Win32
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|x64.ActiveCfg = Release|x64
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88}.Release|x64.Build.0 = Release|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(NestedProjects) = preSolution
+		{CBD81696-EFB4-4D2F-8451-1B8DAA86155A} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{3B08FEFD-4D3D-4C16-BA94-EE83509E32A0} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8}
+		{CDE9B06A-3C27-4987-8FAE-DF1006BC705D} = {DB1024A8-41BF-4AD7-9AE6-13202230D1F3}
+		{3C90CCF0-2CDD-4A7A-ACFF-208C1E271692} = {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}
+		{C7E2382E-2C22-4D18-BF93-80C6A1FFA7AC} = {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}
+		{FC71C66E-E268-4EAD-B1F5-F008DC382E83} = {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}
+		{8E2E8798-8B6F-4A55-8E4F-4E6FDE40ED26} = {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}
+		{09455AA9-C243-4F16-A1A1-A016881A2765} = {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0}
+		{57199684-EC63-4A60-9DC6-11815AF6B413} = {09455AA9-C243-4F16-A1A1-A016881A2765}
+		{2DED4BA2-D6B0-4064-BB2A-76DE3AA49E7C} = {09455AA9-C243-4F16-A1A1-A016881A2765}
+		{D4A12E4C-DBDA-4614-BA26-3425AE9F60F5} = {09455AA9-C243-4F16-A1A1-A016881A2765}
+		{D3E5C8ED-3A6A-4FEA-92A2-48A0BA865358} = {2DED4BA2-D6B0-4064-BB2A-76DE3AA49E7C}
+		{CC3E7F48-2590-49CB-AD8B-BE3650F55462} = {2DED4BA2-D6B0-4064-BB2A-76DE3AA49E7C}
+		{765EF1B9-5027-4820-BC37-A44466A51631} = {57199684-EC63-4A60-9DC6-11815AF6B413}
+		{713E4747-1126-40B1-BD84-58F9A7745423} = {57199684-EC63-4A60-9DC6-11815AF6B413}
+		{F1B71990-EB04-4EB5-B28A-BC3EB6F7E843} = {D4A12E4C-DBDA-4614-BA26-3425AE9F60F5}
+		{3DAF028C-AB5B-4183-A01B-DCC43F5A87F0} = {D4A12E4C-DBDA-4614-BA26-3425AE9F60F5}
+		{62F27B1A-C919-4A70-8478-51F178F3B18F} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
+		{5FD31A25-5D83-4794-8BEE-904DAD84CE71} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{1A1FF289-4FD6-4285-A422-D31DD67A4723} = {CBD81696-EFB4-4D2F-8451-1B8DAA86155A}
+		{07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
+		{EC3E5C7F-EE09-47E2-80FE-546363D14A98} = {B8F5B47B-8568-46EB-B320-64C17D2A98BC}
+		{A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
+		{784113EF-44D9-4949-835D-7065D3C7AD08} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{89385C74-5860-4174-9CAF-A39E7C48909C} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{9B9D2551-D6BD-4F20-8BE5-DE30E154A064} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{8B754330-A434-4791-97E5-1EE67060BAC0} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{692F6330-4D87-4C82-81DF-40DB5892636E} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
+		{D3EC0AFF-76FC-4210-A825-9A17410660A3} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{30A5B29C-983E-4580-9FD0-D647CCDCC7EB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{1C453396-D912-4213-89FD-9B489162B7B5} = {A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}
+		{CBEC7225-0C21-4DA8-978E-1F158F8AD950} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
+		{B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{B5881A85-FE70-4F64-8607-2CAAE52669C6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{05515420-16DE-4E63-BE73-85BE85BA5142} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{1906D736-08BD-4EE1-924F-B536249B9A54} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{EEF031CB-FED8-451E-A471-91EC8D4F6750} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{6EDFEFD5-3596-4FA9-8EBA-B331547B35A3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{F057DA7F-79E5-4B00-845C-EF446EF055E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{E727E8F6-935D-46FE-8B0E-37834748A0E3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{0DF3ABD0-DDC0-4265-B778-07C66780979B} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{FEA1EEF7-876F-48DE-88BF-C0E3E606D758} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{7F1610F1-DD5A-4CF7-8610-30AB12C60ADD} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{9254C4B0-6F60-42B6-BB3A-36D63FC001C7} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
+		{4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{71A967D5-0E99-4CEF-A587-98836EE6F2EF} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{AB91A099-7690-4ECF-8994-E458F4EA1ED4} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
+		{988CACF7-3FCB-4992-BE69-77872AE67DC8} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{0A18A071-125E-442F-AFF7-A3F68ABECF99} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{08DAD348-9E0A-4A2E-97F1-F1E7E24A7836} = {F69A4A6B-9360-4EBB-A280-22AA3C455AC5}
+		{8DEB383C-4091-4F42-A56F-C9E46D552D79} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{2C3C2423-234B-4772-8899-D3B137E5CA35} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{3850D93A-5F24-4922-BC1C-74D08C37C256} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{2CA40887-1622-46A1-A7F9-17FD7E7E545B} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
+		{D7F1E3F2-A3F4-474C-8555-15122571AF52} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{5BC072DB-3826-48EA-AF34-FE32AA01E83B} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{FA429E98-8B03-45E6-A096-A4BC5E821DE4} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{06E3A538-AB32-44F2-B477-755FF9CB5D37} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{A4B122CF-5196-476B-8C0E-D8BD59AC3C14} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{F6A33240-8F29-48BD-98F0-826995911799} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{65A6273D-FCAB-4C55-B09E-65100141A5D4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
+		{D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909} = {A7AB4405-FDB7-4853-9FBB-1516B1C3D80A}
+		{44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
+		{E3246D17-E29B-4AB5-962A-C69B0C5837BB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{7B077E7F-1BE7-4291-AB86-55E527B25CAC} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{4F92B672-DADB-4047-8D6A-4BB3796733FD} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{2DEE4895-1134-439C-B688-52203E57D878} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{AF8163EE-FA76-4904-A11D-7D70A1B5BA2E} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{94001A0E-A837-445C-8004-F918F10D0226} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{2286DA73-9FC5-45BC-A508-85994C3317AB} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
+		{3CE1DC99-8246-4DB1-A709-74F19F08EC67} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{87A1FE3D-F410-4C8E-9591-8C625985BC70} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{7A8D8174-B355-4114-AFC1-04777CB9DE0A} = {4F227C26-768F-46A3-8684-1D08A46FB374}
+		{7EB71250-F002-4ED8-92CA-CA218114537A} = {4F227C26-768F-46A3-8684-1D08A46FB374}
+		{6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{464AAB78-5489-4916-BE51-BF8D61822311} = {4F227C26-768F-46A3-8684-1D08A46FB374}
+		{66444AEE-554C-11DD-A9F0-8C5D56D89593} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
+		{D5D2BF72-29FE-4982-A9FA-82AB2086DB1B} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{D5D2BF72-29FE-4982-A9FA-82AB3086DB1B} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{D5D2BF72-29FE-4982-A9FA-82AB1086DB1B} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{E316772F-5D8F-4F2A-8F71-094C3E859D34} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{D3D8B329-20BE-475E-9E83-653CEA0E0EF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{38FE0559-9910-43A8-9E45-3E5004C27692} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
+		{0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{7B42BDA1-72C0-4378-A9B6-5C530F8CD61E} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{E796E337-DE78-4303-8614-9A590862EE95} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{419C8F80-D858-4B48-A25C-AF4007608137} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{B3F424EC-3D8F-417C-B244-3919D5E1A577} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{14E4A972-9CFB-436D-B0A5-4943F3F80D47} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{1BC8A8EC-E03B-44DF-BCD9-088650F4D29C} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{0B6C905B-142E-4999-B39D-92FF7951E921} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{CF405366-9558-4AE8-90EF-5E21B51CCB4E} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{329FD5B0-EF28-4606-86D0-F6EA21CF8E36} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{1A3793D1-05D1-4B57-9B0F-5AF3E79DC439} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{E972C52F-9E85-4D65-B19C-031E511E9DB4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{03207781-0D1C-4DB3-A71D-45C608F28DBD} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{9A5DDF08-C88C-4A35-B7F6-D605228446BD} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{05C9FB27-480E-4D53-B3B7-6338E2526666} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{CC1DD008-9406-448D-A0AD-33C3186CFADB} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{48414740-C693-4968-9846-EE058020C64F} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{DEE932AB-5911-4700-9EEB-8C7090A0A330} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{329A6FA0-0FCC-4435-A950-E670AEFA9838} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{1F0A8A77-E661-418F-BB92-82172AE43803} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{4F5C9D55-98EF-4256-8311-32D7BD360406} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{E10571C4-E7F4-4608-B5F2-B22E7EB95400} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{D1ABE208-6442-4FB4-9AAD-1677E41BC870} = {4F227C26-768F-46A3-8684-1D08A46FB374}
+		{BA599D0A-4310-4505-91DA-6A6447B3E289} = {4F227C26-768F-46A3-8684-1D08A46FB374}
+		{EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959} = {4F227C26-768F-46A3-8684-1D08A46FB374}
+		{3C977801-FE88-48F2-83D3-FA2EBFF6688E} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{0382E8FD-CFDC-41C0-8B03-792C7C84FC31} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{432DB165-1EB2-4781-A9C0-71E62610B20A} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{CF70F278-3364-4395-A2E1-23501C9B8AD2} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{D5C87B19-150D-4EF3-A671-96589BD2D14A} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
+		{B5A00BFA-6083-4FAE-A097-71642D6473B5} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
+		{1C320193-46A6-4B34-9C56-8AB584FC1B56} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
+		{72782932-37CC-46AE-8C7F-9A7B1A6EE108} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
+		{12A49562-BAB9-43A3-A21D-15B60BBB4C31} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
+		{A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
+		{504B3154-7A4F-459D-9877-B951021C3F1F} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
+		{746F3632-5BB2-4570-9453-31D6D58A7D8E} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
+		{DEB01ACB-D65F-4A62-AED9-58C1054499E9} = {62F27B1A-C919-4A70-8478-51F178F3B18F}
+		{D07C378A-F5F7-438F-ADF3-4AC4FB1883CD} = {4CF6A6AC-07DE-4B9E-ABE1-7F98B64E0BB0}
+		{FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{ABB71A76-42B0-47A4-973A-42E3D920C6FD} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{EF300386-A8DF-4372-B6D8-FB9BFFCA9AED} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{AFA983D6-4569-4F88-BA94-555ED00FD9A8} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{56B91D01-9150-4BBF-AFA1-5B68AB991B76} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{990BAA76-89D3-4E38-8479-C7B28784EFC8} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{1E21AFE0-6FDB-41D2-942D-863607C24B91} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{2E250296-0C08-4342-9C8A-BCBDD0E7DF65} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{70A49BC2-7500-41D0-B75D-EDCC5BE987A0} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{B889A18E-70A7-44B5-B2C9-47798D4F43B3} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{05C9FB27-480E-4D53-B3B7-7338E2514666} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{7C22BDFF-CC09-400C-8A09-660733980028} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{8CDA2B34-FA44-49CC-9EC2-B8F35856CD15} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{23B4D303-79FC-49E0-89E2-2280E7E28940} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{50AAC2CE-BFC9-4912-87CC-C6381850D735} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{A61D7CB4-75A5-4A55-8CA1-BE5AF615D921} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{4748FF56-CA85-4809-97D6-A94C0FAC1D77} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{60C542EE-6882-4EA2-8C21-5AB6DB1BA73F} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{2469B306-B027-4FF2-8815-C9C1EA2CAE79} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{9DE35039-A8F6-4FBF-B1B6-EB527F802411} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{26C82FCE-E0CF-4D10-A00C-D8E582FFEB53} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{74B120FF-6935-4DFE-A142-CDB6BEA99C90} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{C13CC324-0032-4492-9A30-310A6BD64FF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{652AD5F7-8488-489F-AAD0-7FBE064703B6} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{D2396DD7-7D38-473A-ABB7-6F96D65AE1B9} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411}
+		{BED7539C-0099-4A14-AD5D-30828F15A171} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411}
+		{0D108721-EAE8-4BAF-8102-D8960EC93647} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411}
+		{CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411}
+		{B535402E-38D2-4D54-8360-423ACBD17192} = {9DE35039-A8F6-4FBF-B1B6-EB527F802411}
+		{2386B892-35F5-46CF-A0F0-10394D2FBF9B} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{77BC1DD2-C9A1-44D7-BFFA-1320370CACB9} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{85F0CF8C-C7AB-48F6-BA19-CC94CF87F981} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{092124C9-09ED-43C7-BD6D-4AE5D6B3C547} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{ED2CA8B5-8E91-4296-A120-02BB0B674652} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{FD60942F-72D6-4CA1-8B57-EA1D1B95A89E} = {ED2CA8B5-8E91-4296-A120-02BB0B674652}
+		{245603E3-F580-41A5-9632-B25FE3372CBF} = {ED2CA8B5-8E91-4296-A120-02BB0B674652}
+		{C303D2FC-FF97-49B8-9DDD-467B4C9A0B16} = {ED2CA8B5-8E91-4296-A120-02BB0B674652}
+		{8484C90D-1561-402F-A91D-2DB10F8C5171} = {ED2CA8B5-8E91-4296-A120-02BB0B674652}
+		{9C4961D2-5DDB-40C7-9BE8-CA918DC4E782} = {ED2CA8B5-8E91-4296-A120-02BB0B674652}
+		{64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{5BA0D5BD-330D-4EE2-B959-CAFEA04E50E0} = {0C808854-54D1-4230-BFF5-77B5FD905000}
+		{1BDAB935-27DC-47E3-95EA-17E024D39C31} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{97D25665-34CD-4E0C-96E7-88F0795B8883} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{5BE9A596-F11F-4379-928C-412F81AE182B} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{C0779BCC-C037-4F58-B890-EF37BA956B3C} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+		{B6E22500-3DB6-4E6E-8CD5-591B781D7D99} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{C2D5EB6D-F4DE-4DEE-B5B8-B6FD26C22D33} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{0AD87FDA-989F-4638-B6E1-B0132BB0560A} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{FBC7E2A4-B989-4289-BA7F-68F440E9EF8B} = {A5A27244-AD24-46E5-B01B-840CD296C91D}
+		{77C9E0A2-177D-4BD6-9EFD-75A56F886325} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{841C345F-FCC7-4F64-8F54-0281CEABEB01} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{7AEE504B-23B6-4B05-829E-7CD34855F146} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{20179127-853B-4FE9-B7C0-9E817E6A3A72} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{6D1BC01C-3F97-4C08-8A45-69C9B94281AA} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{583D8CEA-4171-4493-9025-B63265F408D8} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{87933C2D-0159-46F7-B326-E1B6E982C21E} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+		{36603FE1-253F-4C2C-AAB6-12927A626135} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{53AADA60-DF12-46FF-BF94-566BBF849336} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{46502007-0D94-47AC-A640-C2B5EEA98333} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{19E934D6-1484-41C8-9305-78DC42FD61F2} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+		{CB4E68A1-8D19-4B5E-87B9-97A895E1BA17} = {F881ADA2-2F1A-4046-9FEB-191D9422D781}
+		{9CFA562C-C611-48A7-90A2-BB031B47FE6D} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{08782D64-E775-4E96-B707-CC633A226F32} = {C120A020-773F-4EA3-923F-B67AF28B750D}
+		{7AC7AB4F-5EF3-40A0-AD2B-CF4D9720FAC3} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{411F6D43-9F09-47D0-8B04-E1EB6B67C5BF} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{CEEE31E6-8A08-42C7-BEBD-5EC12072C136} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{0E469F3A-DDD0-43BA-A94F-7D93C02219F3} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{A3D7C6CF-AEB1-4159-B741-160EB4B37345} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{DA7ADDF1-DA33-4194-83A5-B48DB714D35B} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{AF675478-995A-4115-90C4-B2B0D6470688} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{07EA6E5A-D181-4ABB-BECF-67A906867D04} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{20B15650-F910-4211-8729-AAB0F520C805} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{C955E1A9-C12C-4BAD-AC32-8D53D9268AF7} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}
+		{096C9A84-55B2-4F9B-97E5-0FDF116FD25F} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{2CA661A7-01DD-4532-BF88-B6629DFB544A} = {9ADF1E48-2F5C-4ED7-A893-596259FABFE0}
+		{40C4E2A2-B49B-496C-96D6-C04B890F7F88} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {09840DE7-9208-45AA-9667-1A71EE93BD1E}
+	EndGlobalSection
+EndGlobal
diff --git a/Freeswitch.2017.sln.bat b/Freeswitch.2017.sln.bat
new file mode 100644
index 0000000000..db4bb005aa
--- /dev/null
+++ b/Freeswitch.2017.sln.bat
@@ -0,0 +1,81 @@
+@REM this script builds freeswitch using VS2017
+@REM only one platform/configuration will be built
+@REM runs (probably only) from the commandline
+@REM usage: Freeswitch.2017.sln  [[[.*]ebug] [[.*]elease] [[.*]64] [[.*]32]]
+@REM e.g. Freeswitch.2017.sln Debug x64
+@REM      Freeswitch.2017.sln x64
+@REM 	  Freeswitch.2017.sln Debug
+@REM 	  Freeswitch.2017.sln
+
+@setlocal
+@echo on
+
+@REM default build
+@REM change these variables if you want to build differently by default
+@set configuration=Release
+@set platform=Win32
+
+
+@REM if commandline parameters contain "ebug" and/or "64 and/or 32"
+@REM set the configuration/platform to Debug and/or x64 and/or 32
+@if "%1"=="" (
+	@goto :paramsset
+)
+
+@set params=%*
+@set xparams=x%params: =%
+@if not y%xparams:ebug=%==y%xparams% (
+	set configuration=Debug
+)
+
+@if not x%xparams:64=%==x%xparams% (
+	set platform=x64
+)
+
+@if not x%xparams:32=%==x%xparams% (
+	set platform=Win32
+)
+
+@if not y%xparams:elease=%==y%xparams% (
+	set configuration=Debug
+)
+
+:paramsset
+
+@REM use all processors minus 1 when building
+@REM hmm, this doesn't seem to work as I expected as all my procs are used during the build
+@set procs=%NUMBER_OF_PROCESSORS%
+@set /a procs -= 1
+
+@REM check and set VS2017 environment
+rem VS2017U2 contains vswhere.exe
+if "%VSWHERE%"=="" set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
+
+rem Use %ProgramFiles% in a 32-bit program prior to Windows 10)
+If Not Exist "%VSWHERE%" set "VSWHERE=%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
+
+If Not Exist "%VSWHERE%" (
+    echo "WARNING: Can't find vswhere.exe. It is a part of VS 2017 version 15.2 or later. Trying known path..."
+    set "InstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
+) ELSE (
+    for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
+       set InstallDir=%%i
+    )
+)
+
+echo Install dir is "%InstallDir%"
+if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" (
+    set msbuild="%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe"
+)
+
+if exist %msbuild% (
+%msbuild% Freeswitch.2017.sln /m:%procs% /verbosity:normal /property:Configuration=%configuration% /property:Platform=%platform% /fl /flp:logfile=vs2017%platform%%configuration%.log;verbosity=normal
+) ELSE (
+    echo "echo ERROR: Cannot find msbuild. You need Visual Studio 2017 to compile this solution."
+)
+@pause
+
+@REM ------ terminate :end with LF otherwise the label is not recognized by the command processor -----
+
+
+
diff --git a/libs/esl/fs_cli.2015.vcxproj b/libs/esl/fs_cli.2017.vcxproj
similarity index 96%
rename from libs/esl/fs_cli.2015.vcxproj
rename to libs/esl/fs_cli.2017.vcxproj
index 9eeb01a1b0..ec41f67c6f 100644
--- a/libs/esl/fs_cli.2015.vcxproj
+++ b/libs/esl/fs_cli.2017.vcxproj
@@ -1,230 +1,230 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    fs_cli
-    {D2FB8043-D208-4AEE-8F18-3B5857C871B9}
-    fs_cli
-    Win32Proj
-  
-  
-  
-    Application
-    MultiByte
-    v140
-  
-  
-    Application
-    MultiByte
-    v140
-  
-  
-    Application
-    MultiByte
-    v140
-  
-  
-    Application
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    false
-    $(SolutionDir)$(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    false
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    false
-    $(SolutionDir)$(Platform)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    false
-  
-  
-    
-    
-      Disabled
-      $(ProjectDir)getopt;$(ProjectDir)src/include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      4100;6053;4706;%(DisableSpecificWarnings)
-    
-    
-      Ws2_32.lib;%(AdditionalDependencies)
-      $(OutDir);%(AdditionalLibraryDirectories)
-      true
-      $(OutDir)fs_cli.pdb
-      Console
-      true
-      
-      
-      MachineX86
-    
-  
-  
-    
-    
-      X64
-    
-    
-      Disabled
-      $(ProjectDir)getopt;$(ProjectDir)src/include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      4100;6053;4706;%(DisableSpecificWarnings)
-    
-    
-      Ws2_32.lib;%(AdditionalDependencies)
-      $(OutDir);%(AdditionalLibraryDirectories)
-      true
-      $(OutDir)fs_cli.pdb
-      Console
-      true
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-      $(ProjectDir)getopt;$(ProjectDir)src/include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      4100;6053;4706;%(DisableSpecificWarnings)
-    
-    
-      Ws2_32.lib;%(AdditionalDependencies)
-      $(OutDir);%(AdditionalLibraryDirectories)
-      true
-      $(OutDir)fs_cli.pdb
-      Console
-      true
-      true
-      true
-      
-      
-      MachineX86
-    
-  
-  
-    
-    
-      X64
-    
-    
-      $(ProjectDir)getopt;$(ProjectDir)src/include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      4100;6053;4706;%(DisableSpecificWarnings)
-    
-    
-      Ws2_32.lib;%(AdditionalDependencies)
-      $(OutDir);%(AdditionalLibraryDirectories)
-      true
-      $(OutDir)fs_cli.pdb
-      Console
-      true
-      true
-      true
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-    
-    
-      {cf405366-9558-4ae8-90ef-5e21b51ccb4e}
-      false
-    
-  
-  
-    
-      $(SolutionDir)\w32\Library
-      $(SolutionDir)\w32\Library
-      $(SolutionDir)\w32\Library
-      $(SolutionDir)\w32\Library
-      _DEBUG
-      
-      
-      _WIN64;_DEBUG
-      _WIN64
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    fs_cli
+    {D2FB8043-D208-4AEE-8F18-3B5857C871B9}
+    fs_cli
+    Win32Proj
+  
+  
+  
+    Application
+    MultiByte
+    v141
+  
+  
+    Application
+    MultiByte
+    v141
+  
+  
+    Application
+    MultiByte
+    v141
+  
+  
+    Application
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    false
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    false
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    false
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    false
+  
+  
+    
+    
+      Disabled
+      $(ProjectDir)getopt;$(ProjectDir)src/include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      4100;6053;4706;%(DisableSpecificWarnings)
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      $(OutDir);%(AdditionalLibraryDirectories)
+      true
+      $(OutDir)fs_cli.pdb
+      Console
+      true
+      
+      
+      MachineX86
+    
+  
+  
+    
+    
+      X64
+    
+    
+      Disabled
+      $(ProjectDir)getopt;$(ProjectDir)src/include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      4100;6053;4706;%(DisableSpecificWarnings)
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      $(OutDir);%(AdditionalLibraryDirectories)
+      true
+      $(OutDir)fs_cli.pdb
+      Console
+      true
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+      $(ProjectDir)getopt;$(ProjectDir)src/include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      4100;6053;4706;%(DisableSpecificWarnings)
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      $(OutDir);%(AdditionalLibraryDirectories)
+      true
+      $(OutDir)fs_cli.pdb
+      Console
+      true
+      true
+      true
+      
+      
+      MachineX86
+    
+  
+  
+    
+    
+      X64
+    
+    
+      $(ProjectDir)getopt;$(ProjectDir)src/include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      4100;6053;4706;%(DisableSpecificWarnings)
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      $(OutDir);%(AdditionalLibraryDirectories)
+      true
+      $(OutDir)fs_cli.pdb
+      Console
+      true
+      true
+      true
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+    
+    
+      {cf405366-9558-4ae8-90ef-5e21b51ccb4e}
+      false
+    
+  
+  
+    
+      $(SolutionDir)\w32\Library
+      $(SolutionDir)\w32\Library
+      $(SolutionDir)\w32\Library
+      $(SolutionDir)\w32\Library
+      _DEBUG
+      
+      
+      _WIN64;_DEBUG
+      _WIN64
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/esl/managed/ESLPINVOKE.2015.cs b/libs/esl/managed/ESLPINVOKE.2017.cs
similarity index 100%
rename from libs/esl/managed/ESLPINVOKE.2015.cs
rename to libs/esl/managed/ESLPINVOKE.2017.cs
diff --git a/libs/esl/managed/ESLconnection.2015.cs b/libs/esl/managed/ESLconnection.2017.cs
similarity index 100%
rename from libs/esl/managed/ESLconnection.2015.cs
rename to libs/esl/managed/ESLconnection.2017.cs
diff --git a/libs/esl/managed/ESLevent.2015.cs b/libs/esl/managed/ESLevent.2017.cs
similarity index 100%
rename from libs/esl/managed/ESLevent.2015.cs
rename to libs/esl/managed/ESLevent.2017.cs
diff --git a/libs/esl/managed/ManagedEsl.2015.csproj b/libs/esl/managed/ManagedEsl.2017.csproj
similarity index 92%
rename from libs/esl/managed/ManagedEsl.2015.csproj
rename to libs/esl/managed/ManagedEsl.2017.csproj
index ce00513255..fdf57d1c86 100644
--- a/libs/esl/managed/ManagedEsl.2015.csproj
+++ b/libs/esl/managed/ManagedEsl.2017.csproj
@@ -59,13 +59,13 @@
     
   
   
-    
-    
-    
-    
+    
+    
+    
+    
     
-    
-    
+    
+    
   
   
     
diff --git a/libs/esl/managed/ManagedEsl.2015.sln b/libs/esl/managed/ManagedEsl.2017.sln
similarity index 91%
rename from libs/esl/managed/ManagedEsl.2015.sln
rename to libs/esl/managed/ManagedEsl.2017.sln
index 25bfba8cb2..4d53f2e9a9 100644
--- a/libs/esl/managed/ManagedEsl.2015.sln
+++ b/libs/esl/managed/ManagedEsl.2017.sln
@@ -1,14 +1,14 @@
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
+# Visual Studio 15
+VisualStudioVersion = 15.0.27130.2010
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEsl.2015", "ManagedEsl.2015.csproj", "{DEE5837B-E01D-4223-B351-EDF9418F3F8E}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEsl.2017", "ManagedEsl.2017.csproj", "{DEE5837B-E01D-4223-B351-EDF9418F3F8E}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEslTest.2015", "ManagedEslTest\ManagedEslTest.2015.csproj", "{2321D01A-D64B-4461-9837-FACF38652212}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedEslTest.2017", "ManagedEslTest\ManagedEslTest.2017.csproj", "{2321D01A-D64B-4461-9837-FACF38652212}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ESL", "esl.2015.vcxproj", "{FEA2D0AE-6713-4E41-A473-A143849BC7FF}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ESL", "esl.2017.vcxproj", "{FEA2D0AE-6713-4E41-A473-A143849BC7FF}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libesl", "..\src\libesl.2015.vcxproj", "{CF405366-9558-4AE8-90EF-5E21B51CCB4E}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libesl", "..\src\libesl.2017.vcxproj", "{CF405366-9558-4AE8-90EF-5E21B51CCB4E}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -72,4 +72,7 @@ Global
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {FF52F7CB-95B9-4B97-B0E0-55C34CDA7C48}
+	EndGlobalSection
 EndGlobal
diff --git a/libs/esl/managed/ManagedEslTest/ManagedEslTest.2015.csproj b/libs/esl/managed/ManagedEslTest/ManagedEslTest.2017.csproj
similarity index 97%
rename from libs/esl/managed/ManagedEslTest/ManagedEslTest.2015.csproj
rename to libs/esl/managed/ManagedEslTest/ManagedEslTest.2017.csproj
index f91e97df5d..c09cce91e8 100644
--- a/libs/esl/managed/ManagedEslTest/ManagedEslTest.2015.csproj
+++ b/libs/esl/managed/ManagedEslTest/ManagedEslTest.2017.csproj
@@ -63,11 +63,11 @@
     
   
   
-    
+    
       {fea2d0ae-6713-4e41-a473-a143849bc7ff}
       ESL
     
-    
+    
       {DEE5837B-E01D-4223-B351-EDF9418F3F8E}
       ManagedEsl
       True
diff --git a/libs/esl/managed/SWIGTYPE_p_esl_event_t.2015.cs b/libs/esl/managed/SWIGTYPE_p_esl_event_t.2017.cs
similarity index 100%
rename from libs/esl/managed/SWIGTYPE_p_esl_event_t.2015.cs
rename to libs/esl/managed/SWIGTYPE_p_esl_event_t.2017.cs
diff --git a/libs/esl/managed/SWIGTYPE_p_esl_priority_t.2015.cs b/libs/esl/managed/SWIGTYPE_p_esl_priority_t.2017.cs
similarity index 100%
rename from libs/esl/managed/SWIGTYPE_p_esl_priority_t.2015.cs
rename to libs/esl/managed/SWIGTYPE_p_esl_priority_t.2017.cs
diff --git a/libs/esl/managed/esl.2015.cs b/libs/esl/managed/esl.2017.cs
similarity index 100%
rename from libs/esl/managed/esl.2015.cs
rename to libs/esl/managed/esl.2017.cs
diff --git a/libs/esl/managed/esl.2015.vcxproj b/libs/esl/managed/esl.2017.vcxproj
similarity index 97%
rename from libs/esl/managed/esl.2015.vcxproj
rename to libs/esl/managed/esl.2017.vcxproj
index bfa550b905..34224929c7 100644
--- a/libs/esl/managed/esl.2015.vcxproj
+++ b/libs/esl/managed/esl.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -31,26 +31,26 @@
     Unicode
     true
     true
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
     true
-    v140
+    v141
   
   
     DynamicLibrary
     Unicode
     true
     true
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
     true
-    v140
+    v141
   
   
   
@@ -200,17 +200,17 @@
       false
     
     
-    
+    
   
   
     
   
   
-    
+    
       {CF405366-9558-4AE8-90EF-5E21B51CCB4E}
     
   
   
   
   
-
+
\ No newline at end of file
diff --git a/libs/esl/managed/esl_wrap.2015.cpp b/libs/esl/managed/esl_wrap.2017.cpp
similarity index 100%
rename from libs/esl/managed/esl_wrap.2015.cpp
rename to libs/esl/managed/esl_wrap.2017.cpp
diff --git a/libs/esl/managed/runswig.2015.cmd b/libs/esl/managed/runswig.2017.cmd
similarity index 68%
rename from libs/esl/managed/runswig.2015.cmd
rename to libs/esl/managed/runswig.2017.cmd
index 13e94018b8..356533d6ed 100644
--- a/libs/esl/managed/runswig.2015.cmd
+++ b/libs/esl/managed/runswig.2017.cmd
@@ -8,13 +8,13 @@ move SWIGTYPE_p_esl_priority_t.cs SWIGTYPE_p_esl_priority_t.bak
 
 swig\swig.exe -module ESL -csharp -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
 
-move esl_wrap.cpp esl_wrap.2015.cpp
-move esl.cs esl.2015.cs
-move ESLconnection.cs ESLconnection.2015.cs
-move ESLevent.cs ESLevent.2015.cs
-move ESLPINVOKE.cs ESLPINVOKE.2015.cs
-move SWIGTYPE_p_esl_event_t.cs SWIGTYPE_p_esl_event_t.2015.cs
-move SWIGTYPE_p_esl_priority_t.cs SWIGTYPE_p_esl_priority_t.2015.cs
+move esl_wrap.cpp esl_wrap.2017.cpp
+move esl.cs esl.2017.cs
+move ESLconnection.cs ESLconnection.2017.cs
+move ESLevent.cs ESLevent.2017.cs
+move ESLPINVOKE.cs ESLPINVOKE.2017.cs
+move SWIGTYPE_p_esl_event_t.cs SWIGTYPE_p_esl_event_t.2017.cs
+move SWIGTYPE_p_esl_priority_t.cs SWIGTYPE_p_esl_priority_t.2017.cs
 
 move esl_wrap.bak esl_wrap.cpp
 move esl.bak esl.cs
diff --git a/libs/esl/src/libesl.2015.vcxproj b/libs/esl/src/libesl.2017.vcxproj
similarity index 97%
rename from libs/esl/src/libesl.2015.vcxproj
rename to libs/esl/src/libesl.2017.vcxproj
index 3c6376d123..0a21b3c8b4 100644
--- a/libs/esl/src/libesl.2015.vcxproj
+++ b/libs/esl/src/libesl.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -29,23 +29,23 @@
     StaticLibrary
     Unicode
     true
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
     true
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
-    v140
+    v141
   
   
   
@@ -155,4 +155,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/libs/libdingaling/libdingaling.2015.vcxproj b/libs/libdingaling/libdingaling.2017.vcxproj
similarity index 95%
rename from libs/libdingaling/libdingaling.2015.vcxproj
rename to libs/libdingaling/libdingaling.2017.vcxproj
index e050221330..4de29cd70e 100644
--- a/libs/libdingaling/libdingaling.2015.vcxproj
+++ b/libs/libdingaling/libdingaling.2017.vcxproj
@@ -1,303 +1,303 @@
-
-
-  
-    
-      Debug DLL
-      Win32
-    
-    
-      Debug DLL
-      x64
-    
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release DLL
-      Win32
-    
-    
-      Release DLL
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libdingaling
-    {1906D736-08BD-4EE1-924F-B536249B9A54}
-    libdingaling
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(SolutionDir)Debug\
-    $(Configuration)\
-    $(SolutionDir)Release\
-    $(Configuration)\
-    $(SolutionDir)$(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(SolutionDir)$(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-  
-  
-    
-      Disabled
-      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level4
-      4718;4456;4457;4701;4702;4703;4100;4706;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Level4
-      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      Disabled
-      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;APR_DECLARE_STATIC;APU_DECLARE_STATIC;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      Level4
-      EditAndContinue
-      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
-    
-    
-      libapr-1.lib;libaprutil-1.lib;iksemel.lib;Ws2_32.lib;%(AdditionalDependencies)
-      ..\apr\Debug;..\apr-util\Debug;..\iksemel\Debug;%(AdditionalLibraryDirectories)
-      .\src\dingaling.def
-      true
-      false
-      false
-      false
-      
-      
-    
-  
-  
-    
-      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;APR_DECLARE_STATIC;APU_DECLARE_STATIC;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      
-      
-      Level4
-      ProgramDatabase
-      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
-    
-    
-      libapr-1.lib;libaprutil-1.lib;iksemel.lib;Ws2_32.lib;%(AdditionalDependencies)
-      ..\apr\Release;..\apr-util\Release;..\iksemel\Release;%(AdditionalLibraryDirectories)
-      .\src\dingaling.def
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level4
-      4718;4456;4457;4701;4702;4703;4100;4706;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      X64
-    
-    
-      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Level4
-      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;APR_DECLARE_STATIC;APU_DECLARE_STATIC;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      Level4
-      ProgramDatabase
-      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
-    
-    
-      libapr-1.lib;libaprutil-1.lib;iksemel.lib;Ws2_32.lib;%(AdditionalDependencies)
-      ..\apr\Debug;..\apr-util\Debug;..\iksemel\Debug;%(AdditionalLibraryDirectories)
-      .\src\dingaling.def
-      true
-      false
-      false
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      X64
-    
-    
-      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;APR_DECLARE_STATIC;APU_DECLARE_STATIC;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      
-      
-      Level4
-      ProgramDatabase
-      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
-    
-    
-      libapr-1.lib;libaprutil-1.lib;iksemel.lib;Ws2_32.lib;%(AdditionalDependencies)
-      ..\apr\Release;..\apr-util\Release;..\iksemel\Release;%(AdditionalLibraryDirectories)
-      .\src\dingaling.def
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-    
-      {f057da7f-79e5-4b00-845c-ef446ef055e3}
-      false
-    
-    
-      {e727e8f6-935d-46fe-8b0e-37834748a0e3}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug DLL
+      Win32
+    
+    
+      Debug DLL
+      x64
+    
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release DLL
+      Win32
+    
+    
+      Release DLL
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libdingaling
+    {1906D736-08BD-4EE1-924F-B536249B9A54}
+    libdingaling
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(SolutionDir)Debug\
+    $(Configuration)\
+    $(SolutionDir)Release\
+    $(Configuration)\
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+  
+  
+    
+      Disabled
+      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level4
+      4718;4456;4457;4701;4702;4703;4100;4706;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Level4
+      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      Disabled
+      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;APR_DECLARE_STATIC;APU_DECLARE_STATIC;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      Level4
+      EditAndContinue
+      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
+    
+    
+      libapr-1.lib;libaprutil-1.lib;iksemel.lib;Ws2_32.lib;%(AdditionalDependencies)
+      ..\apr\Debug;..\apr-util\Debug;..\iksemel\Debug;%(AdditionalLibraryDirectories)
+      .\src\dingaling.def
+      true
+      false
+      false
+      false
+      
+      
+    
+  
+  
+    
+      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;APR_DECLARE_STATIC;APU_DECLARE_STATIC;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+      Level4
+      ProgramDatabase
+      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
+    
+    
+      libapr-1.lib;libaprutil-1.lib;iksemel.lib;Ws2_32.lib;%(AdditionalDependencies)
+      ..\apr\Release;..\apr-util\Release;..\iksemel\Release;%(AdditionalLibraryDirectories)
+      .\src\dingaling.def
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level4
+      4718;4456;4457;4701;4702;4703;4100;4706;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      X64
+    
+    
+      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Level4
+      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;APR_DECLARE_STATIC;APU_DECLARE_STATIC;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      Level4
+      ProgramDatabase
+      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
+    
+    
+      libapr-1.lib;libaprutil-1.lib;iksemel.lib;Ws2_32.lib;%(AdditionalDependencies)
+      ..\apr\Debug;..\apr-util\Debug;..\iksemel\Debug;%(AdditionalLibraryDirectories)
+      .\src\dingaling.def
+      true
+      false
+      false
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      X64
+    
+    
+      .;.\src;..\iksemel\include;..\include;..\apr\include;..\iksemel-1.2\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;APR_DECLARE_STATIC;APU_DECLARE_STATIC;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+      Level4
+      ProgramDatabase
+      4718;4456;4457;4701;4702;4703;4100;%(DisableSpecificWarnings)
+    
+    
+      libapr-1.lib;libaprutil-1.lib;iksemel.lib;Ws2_32.lib;%(AdditionalDependencies)
+      ..\apr\Release;..\apr-util\Release;..\iksemel\Release;%(AdditionalLibraryDirectories)
+      .\src\dingaling.def
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+      {f057da7f-79e5-4b00-845c-ef446ef055e3}
+      false
+    
+    
+      {e727e8f6-935d-46fe-8b0e-37834748a0e3}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/libteletone/libteletone.2015.vcxproj b/libs/libteletone/libteletone.2017.vcxproj
similarity index 95%
rename from libs/libteletone/libteletone.2015.vcxproj
rename to libs/libteletone/libteletone.2017.vcxproj
index e7faadecde..ad5afb203d 100644
--- a/libs/libteletone/libteletone.2015.vcxproj
+++ b/libs/libteletone/libteletone.2017.vcxproj
@@ -1,161 +1,161 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libteletone
-    {89385C74-5860-4174-9CAF-A39E7C48909C}
-    libteletone
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      Disabled
-      src;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;TELETONE_EXPORTS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level4
-      false
-      true
-      28252;28253
-    
-    
-      false
-      false
-      false
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      src;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;TELETONE_EXPORTS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level4
-      false
-      true
-      28252;28253
-    
-    
-      false
-      false
-      false
-      MachineX64
-      true
-    
-  
-  
-    
-      src;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;TELETONE_EXPORTS;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Level4
-      false
-      true
-      28252;28253
-    
-    
-      false
-    
-  
-  
-    
-      X64
-    
-    
-      src;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;TELETONE_EXPORTS;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Level4
-      false
-      true
-      28252;28253
-    
-    
-      false
-      MachineX64
-    
-  
-  
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libteletone
+    {89385C74-5860-4174-9CAF-A39E7C48909C}
+    libteletone
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      Disabled
+      src;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;TELETONE_EXPORTS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level4
+      false
+      true
+      28252;28253
+    
+    
+      false
+      false
+      false
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      src;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;TELETONE_EXPORTS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level4
+      false
+      true
+      28252;28253
+    
+    
+      false
+      false
+      false
+      MachineX64
+      true
+    
+  
+  
+    
+      src;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;TELETONE_EXPORTS;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Level4
+      false
+      true
+      28252;28253
+    
+    
+      false
+    
+  
+  
+    
+      X64
+    
+    
+      src;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;TELETONE_EXPORTS;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Level4
+      false
+      true
+      28252;28253
+    
+    
+      false
+      MachineX64
+    
+  
+  
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/libzrtp/projects/win/libzrtp.2015.vcxproj b/libs/libzrtp/projects/win/libzrtp.2017.vcxproj
similarity index 96%
rename from libs/libzrtp/projects/win/libzrtp.2015.vcxproj
rename to libs/libzrtp/projects/win/libzrtp.2017.vcxproj
index 71c04af568..322de462cb 100644
--- a/libs/libzrtp/projects/win/libzrtp.2015.vcxproj
+++ b/libs/libzrtp/projects/win/libzrtp.2017.vcxproj
@@ -1,258 +1,258 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {C13CC324-0032-4492-9A30-310A6BD64FF5}
-    libzrtp.x32
-    Win32Proj
-    libzrtp
-  
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    AllRules.ruleset
-    AllRules.ruleset
-    
-    
-    
-    
-    AllRules.ruleset
-    AllRules.ruleset
-    
-    
-    
-    
-  
-  
-    
-      Disabled
-      ../../include;../../third_party/bnlib;../../third_party/bgaes;../../test/include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Default
-      
-      
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4267;%(DisableSpecificWarnings)
-    
-    
-    
-      if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h"
-    
-  
-  
-    
-      Disabled
-      ../../include;../../third_party/bnlib;../../third_party/bgaes;../../test/include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions)
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Default
-      
-      
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4267;%(DisableSpecificWarnings)
-    
-    
-    
-      if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h"
-    
-  
-  
-    
-      ../../include;../../third_party/bnlib;../../third_party/bgaes;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions)
-      
-      
-      MultiThreadedDLL
-      Default
-      false
-      
-      
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4267;%(DisableSpecificWarnings)
-    
-    
-    
-      if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h"
-    
-  
-  
-    
-      ../../include;../../third_party/bnlib;../../third_party/bgaes;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions)
-      
-      
-      MultiThreadedDLL
-      Default
-      false
-      
-      
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4267;%(DisableSpecificWarnings)
-    
-    
-    
-      if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h"
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {C13CC324-0032-4492-9A30-310A6BD64FF5}
+    libzrtp.x32
+    Win32Proj
+    libzrtp
+  
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    AllRules.ruleset
+    AllRules.ruleset
+    
+    
+    
+    
+    AllRules.ruleset
+    AllRules.ruleset
+    
+    
+    
+    
+  
+  
+    
+      Disabled
+      ../../include;../../third_party/bnlib;../../third_party/bgaes;../../test/include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Default
+      
+      
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4267;%(DisableSpecificWarnings)
+    
+    
+    
+      if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h"
+    
+  
+  
+    
+      Disabled
+      ../../include;../../third_party/bnlib;../../third_party/bgaes;../../test/include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions)
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Default
+      
+      
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4267;%(DisableSpecificWarnings)
+    
+    
+    
+      if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h"
+    
+  
+  
+    
+      ../../include;../../third_party/bnlib;../../third_party/bgaes;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions)
+      
+      
+      MultiThreadedDLL
+      Default
+      false
+      
+      
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4267;%(DisableSpecificWarnings)
+    
+    
+    
+      if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h"
+    
+  
+  
+    
+      ../../include;../../third_party/bnlib;../../third_party/bgaes;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H=1;ZRTP_ENABLE_EC=0;ZRTP_USE_BUILTIN_CACHE=1;%(PreprocessorDefinitions)
+      
+      
+      MultiThreadedDLL
+      Default
+      false
+      
+      
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4267;%(DisableSpecificWarnings)
+    
+    
+    
+      if not exist "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h" copy "$(ProjectDir)..\..\third_party\bnlib\bnconfig.win" "$(ProjectDir)..\..\third_party\bnlib\bnconfig.h"
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/spandsp/src/libspandsp.2015.vcxproj b/libs/spandsp/src/libspandsp.2017.vcxproj
similarity index 95%
rename from libs/spandsp/src/libspandsp.2015.vcxproj
rename to libs/spandsp/src/libspandsp.2017.vcxproj
index 4a4f389223..61f621544a 100644
--- a/libs/spandsp/src/libspandsp.2015.vcxproj
+++ b/libs/spandsp/src/libspandsp.2017.vcxproj
@@ -1,470 +1,470 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libspandsp
-    {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
-    libspandsp
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-    false
-    true
-    false
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      Disabled
-      .;..\..\src\spandsp;..\..\src;..\..\src\msvc;.\spandsp;.\msvc;..\..\jpeg-8d;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level4
-      CompileAsC
-      4127;4324;4267;4306;%(DisableSpecificWarnings)
-    
-    
-      true
-      Windows
-      false
-      MachineX86
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      .;.\spandsp;.\msvc;..\..\jpeg-8d;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Level4
-      4127;4324;4267;4306;%(DisableSpecificWarnings)
-    
-    
-      true
-      Windows
-      true
-      true
-      false
-      MachineX86
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      Disabled
-      .;.\spandsp;.\msvc;..\..\jpeg-8d;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level4
-      CompileAsC
-      4127;4324;4267;4306;%(DisableSpecificWarnings)
-    
-    
-      true
-      Windows
-      false
-      MachineX64
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      .;.\spandsp;.\msvc;..\..\jpeg-8d;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Level4
-      4127;4324;4267;4306;%(DisableSpecificWarnings)
-    
-    
-      true
-      Windows
-      true
-      true
-      false
-      MachineX64
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-      Copying %(FullPath) to $(ProjectDir)%(Filename)%(Extension)
-      copy "%(FullPath)" "$(ProjectDir)%(Filename)%(Extension)"
-      $(ProjectDir)%(Filename)%(Extension);%(Outputs)
-      Copying %(FullPath) to $(ProjectDir)%(Filename)%(Extension)
-      copy "%(FullPath)" "$(ProjectDir)%(Filename)%(Extension)"
-      $(ProjectDir)%(Filename)%(Extension);%(Outputs)
-      Copying %(FullPath) to $(ProjectDir)%(Filename)%(Extension)
-      copy "%(FullPath)" "$(ProjectDir)%(Filename)%(Extension)"
-      $(ProjectDir)%(Filename)%(Extension);%(Outputs)
-      Copying %(FullPath) to $(ProjectDir)%(Filename)%(Extension)
-      copy "%(FullPath)" "$(ProjectDir)%(Filename)%(Extension)"
-      $(ProjectDir)%(Filename)%(Extension);%(Outputs)
-    
-  
-  
-    
-      {019dbd2a-273d-4ba4-bf86-b5efe2ed76b1}
-      true
-      false
-      false
-      true
-      false
-    
-    
-      {401a40cd-5db4-4e34-ac68-fa99e9fac014}
-      false
-    
-    
-      {dee932ab-5911-4700-9eeb-8c7090a0a330}
-      false
-    
-    
-      {85f0cf8c-c7ab-48f6-ba19-cc94cf87f981}
-    
-    
-      {2386b892-35f5-46cf-a0f0-10394d2fbf9b}
-    
-    
-      {329a6fa0-0fcc-4435-a950-e670aefa9838}
-      false
-    
-    
-      {eddb8ab9-c53e-44c0-a620-0e86c2cbd5d5}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libspandsp
+    {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
+    libspandsp
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+    false
+    true
+    false
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      Disabled
+      .;..\..\src\spandsp;..\..\src;..\..\src\msvc;.\spandsp;.\msvc;..\..\jpeg-8d;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level4
+      CompileAsC
+      4127;4324;4267;4306;%(DisableSpecificWarnings)
+    
+    
+      true
+      Windows
+      false
+      MachineX86
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      .;.\spandsp;.\msvc;..\..\jpeg-8d;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Level4
+      4127;4324;4267;4306;%(DisableSpecificWarnings)
+    
+    
+      true
+      Windows
+      true
+      true
+      false
+      MachineX86
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      Disabled
+      .;.\spandsp;.\msvc;..\..\jpeg-8d;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level4
+      CompileAsC
+      4127;4324;4267;4306;%(DisableSpecificWarnings)
+    
+    
+      true
+      Windows
+      false
+      MachineX64
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      .;.\spandsp;.\msvc;..\..\jpeg-8d;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBSPANDSP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Level4
+      4127;4324;4267;4306;%(DisableSpecificWarnings)
+    
+    
+      true
+      Windows
+      true
+      true
+      false
+      MachineX64
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+      Copying %(FullPath) to $(ProjectDir)%(Filename)%(Extension)
+      copy "%(FullPath)" "$(ProjectDir)%(Filename)%(Extension)"
+      $(ProjectDir)%(Filename)%(Extension);%(Outputs)
+      Copying %(FullPath) to $(ProjectDir)%(Filename)%(Extension)
+      copy "%(FullPath)" "$(ProjectDir)%(Filename)%(Extension)"
+      $(ProjectDir)%(Filename)%(Extension);%(Outputs)
+      Copying %(FullPath) to $(ProjectDir)%(Filename)%(Extension)
+      copy "%(FullPath)" "$(ProjectDir)%(Filename)%(Extension)"
+      $(ProjectDir)%(Filename)%(Extension);%(Outputs)
+      Copying %(FullPath) to $(ProjectDir)%(Filename)%(Extension)
+      copy "%(FullPath)" "$(ProjectDir)%(Filename)%(Extension)"
+      $(ProjectDir)%(Filename)%(Extension);%(Outputs)
+    
+  
+  
+    
+      {019dbd2a-273d-4ba4-bf86-b5efe2ed76b1}
+      true
+      false
+      false
+      true
+      false
+    
+    
+      {401a40cd-5db4-4e34-ac68-fa99e9fac014}
+      false
+    
+    
+      {dee932ab-5911-4700-9eeb-8c7090a0a330}
+      false
+    
+    
+      {85f0cf8c-c7ab-48f6-ba19-cc94cf87f981}
+    
+    
+      {2386b892-35f5-46cf-a0f0-10394d2fbf9b}
+    
+    
+      {329a6fa0-0fcc-4435-a950-e670aefa9838}
+      false
+    
+    
+      {eddb8ab9-c53e-44c0-a620-0e86c2cbd5d5}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/spandsp/src/libtiff.2015.vcxproj b/libs/spandsp/src/libtiff.2017.vcxproj
similarity index 95%
rename from libs/spandsp/src/libtiff.2015.vcxproj
rename to libs/spandsp/src/libtiff.2017.vcxproj
index e620319470..21a67fbed2 100644
--- a/libs/spandsp/src/libtiff.2015.vcxproj
+++ b/libs/spandsp/src/libtiff.2017.vcxproj
@@ -1,211 +1,211 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libtiff
-    {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}
-    libtiff
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\libtiff\$(Configuration)\
-    $(PlatformName)\libtiff\$(Configuration)\
-    $(PlatformName)\libtiff\$(Configuration)\
-    $(PlatformName)\libtiff\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      if not exist "$(TiffDir)/tiffconf.h" copy "$(TiffDir)\tiffconf.vc.h" "$(TiffDir)\tiffconf.h" /Y
-if not exist "$(TiffDir)/tif_config.h" copy "$(TiffDir)\tif_config.vc.h" "$(TiffDir)\tif_config.h" /Y
-
-    
-    
-      .;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;FILLODER_LSB2MSB;TIF_PLATFORM_CONSOLE;CCITT_SUPPORT;PACKBITS_SUPPORT;LZW_SUPPORT;THUNDER_SUPPORT;NEXT_SUPPORT;LOGLUV_SUPPORT;TRIPCHOP_DEFAULT=TIFF_STRIPCHOP;STRIP_SIZE_DEFAULT=8192;DEFAULT_EXTRASAMPLE_AS_ALPHA;CHECK_JPEG_YCBCR_SUBSAMPLING;AVOID_WIN32_FILEIO;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      CompileAsC
-      Disabled
-    
-  
-  
-    
-      if not exist "$(TiffDir)/tiffconf.h" copy "$(TiffDir)\tiffconf.vc.h" "$(TiffDir)\tiffconf.h" /Y
-if not exist "$(TiffDir)/tif_config.h" copy "$(TiffDir)\tif_config.vc.h" "$(TiffDir)\tif_config.h" /Y
-
-    
-    
-      X64
-    
-    
-      Disabled
-      .;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;FILLODER_LSB2MSB;TIF_PLATFORM_CONSOLE;CCITT_SUPPORT;PACKBITS_SUPPORT;LZW_SUPPORT;THUNDER_SUPPORT;NEXT_SUPPORT;LOGLUV_SUPPORT;TRIPCHOP_DEFAULT=TIFF_STRIPCHOP;STRIP_SIZE_DEFAULT=8192;DEFAULT_EXTRASAMPLE_AS_ALPHA;CHECK_JPEG_YCBCR_SUBSAMPLING;AVOID_WIN32_FILEIO;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      CompileAsC
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      if not exist "$(TiffDir)/tiffconf.h" copy "$(TiffDir)\tiffconf.vc.h" "$(TiffDir)\tiffconf.h" /Y
-if not exist "$(TiffDir)/tif_config.h" copy "$(TiffDir)\tif_config.vc.h" "$(TiffDir)\tif_config.h" /Y
-
-    
-    
-      .;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_WINDOWS;_USRDLL;FILLODER_LSB2MSB;TIF_PLATFORM_CONSOLE;CCITT_SUPPORT;PACKBITS_SUPPORT;LZW_SUPPORT;THUNDER_SUPPORT;NEXT_SUPPORT;LOGLUV_SUPPORT;TRIPCHOP_DEFAULT=TIFF_STRIPCHOP;STRIP_SIZE_DEFAULT=8192;DEFAULT_EXTRASAMPLE_AS_ALPHA;CHECK_JPEG_YCBCR_SUBSAMPLING;AVOID_WIN32_FILEIO;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      TurnOffAllWarnings
-    
-  
-  
-    
-      if not exist "$(TiffDir)/tiffconf.h" copy "$(TiffDir)\tiffconf.vc.h" "$(TiffDir)\tiffconf.h" /Y
-if not exist "$(TiffDir)/tif_config.h" copy "$(TiffDir)\tif_config.vc.h" "$(TiffDir)\tif_config.h" /Y
-
-    
-    
-      X64
-    
-    
-      .;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_WINDOWS;_USRDLL;FILLODER_LSB2MSB;TIF_PLATFORM_CONSOLE;CCITT_SUPPORT;PACKBITS_SUPPORT;LZW_SUPPORT;THUNDER_SUPPORT;NEXT_SUPPORT;LOGLUV_SUPPORT;TRIPCHOP_DEFAULT=TIFF_STRIPCHOP;STRIP_SIZE_DEFAULT=8192;DEFAULT_EXTRASAMPLE_AS_ALPHA;CHECK_JPEG_YCBCR_SUBSAMPLING;AVOID_WIN32_FILEIO;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      TurnOffAllWarnings
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {583d8cea-4171-4493-9025-b63265f408d8}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libtiff
+    {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}
+    libtiff
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\libtiff\$(Configuration)\
+    $(PlatformName)\libtiff\$(Configuration)\
+    $(PlatformName)\libtiff\$(Configuration)\
+    $(PlatformName)\libtiff\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      if not exist "$(TiffDir)/tiffconf.h" copy "$(TiffDir)\tiffconf.vc.h" "$(TiffDir)\tiffconf.h" /Y
+if not exist "$(TiffDir)/tif_config.h" copy "$(TiffDir)\tif_config.vc.h" "$(TiffDir)\tif_config.h" /Y
+
+    
+    
+      .;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;FILLODER_LSB2MSB;TIF_PLATFORM_CONSOLE;CCITT_SUPPORT;PACKBITS_SUPPORT;LZW_SUPPORT;THUNDER_SUPPORT;NEXT_SUPPORT;LOGLUV_SUPPORT;TRIPCHOP_DEFAULT=TIFF_STRIPCHOP;STRIP_SIZE_DEFAULT=8192;DEFAULT_EXTRASAMPLE_AS_ALPHA;CHECK_JPEG_YCBCR_SUBSAMPLING;AVOID_WIN32_FILEIO;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      CompileAsC
+      Disabled
+    
+  
+  
+    
+      if not exist "$(TiffDir)/tiffconf.h" copy "$(TiffDir)\tiffconf.vc.h" "$(TiffDir)\tiffconf.h" /Y
+if not exist "$(TiffDir)/tif_config.h" copy "$(TiffDir)\tif_config.vc.h" "$(TiffDir)\tif_config.h" /Y
+
+    
+    
+      X64
+    
+    
+      Disabled
+      .;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;FILLODER_LSB2MSB;TIF_PLATFORM_CONSOLE;CCITT_SUPPORT;PACKBITS_SUPPORT;LZW_SUPPORT;THUNDER_SUPPORT;NEXT_SUPPORT;LOGLUV_SUPPORT;TRIPCHOP_DEFAULT=TIFF_STRIPCHOP;STRIP_SIZE_DEFAULT=8192;DEFAULT_EXTRASAMPLE_AS_ALPHA;CHECK_JPEG_YCBCR_SUBSAMPLING;AVOID_WIN32_FILEIO;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      CompileAsC
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      if not exist "$(TiffDir)/tiffconf.h" copy "$(TiffDir)\tiffconf.vc.h" "$(TiffDir)\tiffconf.h" /Y
+if not exist "$(TiffDir)/tif_config.h" copy "$(TiffDir)\tif_config.vc.h" "$(TiffDir)\tif_config.h" /Y
+
+    
+    
+      .;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_WINDOWS;_USRDLL;FILLODER_LSB2MSB;TIF_PLATFORM_CONSOLE;CCITT_SUPPORT;PACKBITS_SUPPORT;LZW_SUPPORT;THUNDER_SUPPORT;NEXT_SUPPORT;LOGLUV_SUPPORT;TRIPCHOP_DEFAULT=TIFF_STRIPCHOP;STRIP_SIZE_DEFAULT=8192;DEFAULT_EXTRASAMPLE_AS_ALPHA;CHECK_JPEG_YCBCR_SUBSAMPLING;AVOID_WIN32_FILEIO;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      TurnOffAllWarnings
+    
+  
+  
+    
+      if not exist "$(TiffDir)/tiffconf.h" copy "$(TiffDir)\tiffconf.vc.h" "$(TiffDir)\tiffconf.h" /Y
+if not exist "$(TiffDir)/tif_config.h" copy "$(TiffDir)\tif_config.vc.h" "$(TiffDir)\tif_config.h" /Y
+
+    
+    
+      X64
+    
+    
+      .;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_WINDOWS;_USRDLL;FILLODER_LSB2MSB;TIF_PLATFORM_CONSOLE;CCITT_SUPPORT;PACKBITS_SUPPORT;LZW_SUPPORT;THUNDER_SUPPORT;NEXT_SUPPORT;LOGLUV_SUPPORT;TRIPCHOP_DEFAULT=TIFF_STRIPCHOP;STRIP_SIZE_DEFAULT=8192;DEFAULT_EXTRASAMPLE_AS_ALPHA;CHECK_JPEG_YCBCR_SUBSAMPLING;AVOID_WIN32_FILEIO;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      TurnOffAllWarnings
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {583d8cea-4171-4493-9025-b63265f408d8}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/spandsp/src/msvc/make_at_dictionary.2015.vcxproj b/libs/spandsp/src/msvc/make_at_dictionary.2017.vcxproj
similarity index 94%
rename from libs/spandsp/src/msvc/make_at_dictionary.2015.vcxproj
rename to libs/spandsp/src/msvc/make_at_dictionary.2017.vcxproj
index cbc5bdc63b..c7f5ab0c95 100644
--- a/libs/spandsp/src/msvc/make_at_dictionary.2015.vcxproj
+++ b/libs/spandsp/src/msvc/make_at_dictionary.2017.vcxproj
@@ -1,69 +1,69 @@
-
-
-  
-    
-      All
-      Win32
-    
-  
-  
-    make_at_dictionary
-    {DEE932AB-5911-4700-9EEB-8C7090A0A330}
-    make_at_dictionary
-    Win32Proj
-  
-  
-  
-    Application
-    Unicode
-    v140
-  
-  
-  
-    
-  
-  
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\make_at_dictionary\$(Configuration)\
-    false
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      Disabled
-      .;.\spandsp;.\msvc;.\generated;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      $(IntDir)$(TargetName).pdb
-      Level3
-      ProgramDatabase
-    
-    
-      true
-      Console
-      MachineX86
-    
-    
-      "$(TargetPath)" >"$(ProjectDir)..\at_interpreter_dictionary.h"
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      All
+      Win32
+    
+  
+  
+    make_at_dictionary
+    {DEE932AB-5911-4700-9EEB-8C7090A0A330}
+    make_at_dictionary
+    Win32Proj
+  
+  
+  
+    Application
+    Unicode
+    v141
+  
+  
+  
+    
+  
+  
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\make_at_dictionary\$(Configuration)\
+    false
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      Disabled
+      .;.\spandsp;.\msvc;.\generated;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      $(IntDir)$(TargetName).pdb
+      Level3
+      ProgramDatabase
+    
+    
+      true
+      Console
+      MachineX86
+    
+    
+      "$(TargetPath)" >"$(ProjectDir)..\at_interpreter_dictionary.h"
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/spandsp/src/msvc/make_cielab_luts.2015.vcxproj b/libs/spandsp/src/msvc/make_cielab_luts.2017.vcxproj
similarity index 94%
rename from libs/spandsp/src/msvc/make_cielab_luts.2015.vcxproj
rename to libs/spandsp/src/msvc/make_cielab_luts.2017.vcxproj
index 7e0c3aec0e..c93fa21693 100644
--- a/libs/spandsp/src/msvc/make_cielab_luts.2015.vcxproj
+++ b/libs/spandsp/src/msvc/make_cielab_luts.2017.vcxproj
@@ -1,69 +1,69 @@
-
-
-  
-    
-      All
-      Win32
-    
-  
-  
-    make_cielab_luts
-    {85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}
-    make_cielab_luts
-    Win32Proj
-  
-  
-  
-    Application
-    Unicode
-    v140
-  
-  
-  
-    
-  
-  
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\make_cielab_luts\$(Configuration)\
-    false
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      Disabled
-      .;.\spandsp;.\msvc;.\generated;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      $(IntDir)$(TargetName).pdb
-      Level3
-      ProgramDatabase
-    
-    
-      true
-      Console
-      MachineX86
-    
-    
-      "$(TargetPath)" >"$(ProjectDir)..\cielab_luts.h"
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      All
+      Win32
+    
+  
+  
+    make_cielab_luts
+    {85F0CF8C-C7AB-48F6-BA19-CC94CF87F981}
+    make_cielab_luts
+    Win32Proj
+  
+  
+  
+    Application
+    Unicode
+    v141
+  
+  
+  
+    
+  
+  
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\make_cielab_luts\$(Configuration)\
+    false
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      Disabled
+      .;.\spandsp;.\msvc;.\generated;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      $(IntDir)$(TargetName).pdb
+      Level3
+      ProgramDatabase
+    
+    
+      true
+      Console
+      MachineX86
+    
+    
+      "$(TargetPath)" >"$(ProjectDir)..\cielab_luts.h"
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/spandsp/src/msvc/make_math_fixed_tables.2015.vcxproj b/libs/spandsp/src/msvc/make_math_fixed_tables.2017.vcxproj
similarity index 94%
rename from libs/spandsp/src/msvc/make_math_fixed_tables.2015.vcxproj
rename to libs/spandsp/src/msvc/make_math_fixed_tables.2017.vcxproj
index ebbc07b1d5..80cf2c2461 100644
--- a/libs/spandsp/src/msvc/make_math_fixed_tables.2015.vcxproj
+++ b/libs/spandsp/src/msvc/make_math_fixed_tables.2017.vcxproj
@@ -1,69 +1,69 @@
-
-
-  
-    
-      All
-      Win32
-    
-  
-  
-    make_math_fixed_tables
-    {2386B892-35F5-46CF-A0F0-10394D2FBF9B}
-    make_at_dictionary
-    Win32Proj
-  
-  
-  
-    Application
-    Unicode
-    v140
-  
-  
-  
-    
-  
-  
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\make_math_fixed_tables\$(Configuration)\
-    false
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      Disabled
-      .;.\spandsp;.\msvc;.\generated;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      $(IntDir)$(TargetName).pdb
-      Level3
-      ProgramDatabase
-    
-    
-      true
-      Console
-      MachineX86
-    
-    
-      "$(TargetPath)" >"$(ProjectDir)..\math_fixed_tables.h"
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      All
+      Win32
+    
+  
+  
+    make_math_fixed_tables
+    {2386B892-35F5-46CF-A0F0-10394D2FBF9B}
+    make_at_dictionary
+    Win32Proj
+  
+  
+  
+    Application
+    Unicode
+    v141
+  
+  
+  
+    
+  
+  
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\make_math_fixed_tables\$(Configuration)\
+    false
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      Disabled
+      .;.\spandsp;.\msvc;.\generated;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      $(IntDir)$(TargetName).pdb
+      Level3
+      ProgramDatabase
+    
+    
+      true
+      Console
+      MachineX86
+    
+    
+      "$(TargetPath)" >"$(ProjectDir)..\math_fixed_tables.h"
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/spandsp/src/msvc/make_modem_filter.2015.vcxproj b/libs/spandsp/src/msvc/make_modem_filter.2017.vcxproj
similarity index 96%
rename from libs/spandsp/src/msvc/make_modem_filter.2015.vcxproj
rename to libs/spandsp/src/msvc/make_modem_filter.2017.vcxproj
index 58b43bd73f..5444b6f25c 100644
--- a/libs/spandsp/src/msvc/make_modem_filter.2015.vcxproj
+++ b/libs/spandsp/src/msvc/make_modem_filter.2017.vcxproj
@@ -1,100 +1,100 @@
-
-
-  
-    
-      All
-      Win32
-    
-  
-  
-    make_modem_filter
-    {329A6FA0-0FCC-4435-A950-E670AEFA9838}
-    make_modem_filter
-    Win32Proj
-  
-  
-  
-    Application
-    Unicode
-    v140
-  
-  
-  
-    
-  
-  
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\make_modem_filter\$(Configuration)\
-    false
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      Disabled
-      .;.\spandsp;.\msvc;.\generated;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      $(IntDir)$(TargetName).pdb
-      Level3
-      ProgramDatabase
-    
-    
-      true
-      Console
-      MachineX86
-    
-    
-      "$(TargetPath)" -m V.17 -r >"$(ProjectDir)..\v17_v32bis_rx_rrc.h"
-"$(TargetPath)" -m V.17 -r >"$(ProjectDir)..\v17_v32bis_rx_floating_rrc.h"
-
-"$(TargetPath)" -m V.17 -t >"$(ProjectDir)..\v17_v32bis_tx_rrc.h"
-"$(TargetPath)" -m V.17 -t >"$(ProjectDir)..\v17_v32bis_tx_floating_rrc.h"
-
-"$(TargetPath)" -m V.22bis1200 -r >"$(ProjectDir)..\v22bis_rx_1200_rrc.h"
-"$(TargetPath)" -m V.22bis2400 -r >"$(ProjectDir)..\v22bis_rx_2400_rrc.h"
-"$(TargetPath)" -m V.22bis1200 -r >"$(ProjectDir)..\v22bis_rx_1200_floating_rrc.h"
-"$(TargetPath)" -m V.22bis2400 -r >"$(ProjectDir)..\v22bis_rx_2400_floating_rrc.h"
-"$(TargetPath)" -m V.22bis -t >"$(ProjectDir)..\v22bis_tx_rrc.h"
-"$(TargetPath)" -m V.22bis -t >"$(ProjectDir)..\v22bis_tx_floating_rrc.h"
-
-"$(TargetPath)" -m V.27ter2400 -r >"$(ProjectDir)..\v27ter_rx_2400_rrc.h"
-"$(TargetPath)" -m V.27ter4800 -r >"$(ProjectDir)..\v27ter_rx_4800_rrc.h"
-"$(TargetPath)" -m V.27ter2400 -r >"$(ProjectDir)..\v27ter_rx_2400_floating_rrc.h"
-"$(TargetPath)" -m V.27ter4800 -r >"$(ProjectDir)..\v27ter_rx_4800_floating_rrc.h"
-"$(TargetPath)" -m V.27ter2400 -t >"$(ProjectDir)..\v27ter_tx_2400_rrc.h"
-"$(TargetPath)" -m V.27ter4800 -t >"$(ProjectDir)..\v27ter_tx_4800_rrc.h"
-"$(TargetPath)" -m V.27ter2400 -t >"$(ProjectDir)..\v27ter_tx_2400_floating_rrc.h"
-"$(TargetPath)" -m V.27ter4800 -t >"$(ProjectDir)..\v27ter_tx_4800_floating_rrc.h"
-
-"$(TargetPath)" -m V.29 -r >"$(ProjectDir)..\v29rx_rrc.h"
-"$(TargetPath)" -m V.29 -r >"$(ProjectDir)..\v29rx_floating_rrc.h"
-"$(TargetPath)" -m V.29 -t >"$(ProjectDir)..\v29tx_rrc.h"
-"$(TargetPath)" -m V.29 -t >"$(ProjectDir)..\v29tx_floating_rrc.h"
-
-    
-  
-  
-    
-    
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      All
+      Win32
+    
+  
+  
+    make_modem_filter
+    {329A6FA0-0FCC-4435-A950-E670AEFA9838}
+    make_modem_filter
+    Win32Proj
+  
+  
+  
+    Application
+    Unicode
+    v141
+  
+  
+  
+    
+  
+  
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\make_modem_filter\$(Configuration)\
+    false
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      Disabled
+      .;.\spandsp;.\msvc;.\generated;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      $(IntDir)$(TargetName).pdb
+      Level3
+      ProgramDatabase
+    
+    
+      true
+      Console
+      MachineX86
+    
+    
+      "$(TargetPath)" -m V.17 -r >"$(ProjectDir)..\v17_v32bis_rx_rrc.h"
+"$(TargetPath)" -m V.17 -r >"$(ProjectDir)..\v17_v32bis_rx_floating_rrc.h"
+
+"$(TargetPath)" -m V.17 -t >"$(ProjectDir)..\v17_v32bis_tx_rrc.h"
+"$(TargetPath)" -m V.17 -t >"$(ProjectDir)..\v17_v32bis_tx_floating_rrc.h"
+
+"$(TargetPath)" -m V.22bis1200 -r >"$(ProjectDir)..\v22bis_rx_1200_rrc.h"
+"$(TargetPath)" -m V.22bis2400 -r >"$(ProjectDir)..\v22bis_rx_2400_rrc.h"
+"$(TargetPath)" -m V.22bis1200 -r >"$(ProjectDir)..\v22bis_rx_1200_floating_rrc.h"
+"$(TargetPath)" -m V.22bis2400 -r >"$(ProjectDir)..\v22bis_rx_2400_floating_rrc.h"
+"$(TargetPath)" -m V.22bis -t >"$(ProjectDir)..\v22bis_tx_rrc.h"
+"$(TargetPath)" -m V.22bis -t >"$(ProjectDir)..\v22bis_tx_floating_rrc.h"
+
+"$(TargetPath)" -m V.27ter2400 -r >"$(ProjectDir)..\v27ter_rx_2400_rrc.h"
+"$(TargetPath)" -m V.27ter4800 -r >"$(ProjectDir)..\v27ter_rx_4800_rrc.h"
+"$(TargetPath)" -m V.27ter2400 -r >"$(ProjectDir)..\v27ter_rx_2400_floating_rrc.h"
+"$(TargetPath)" -m V.27ter4800 -r >"$(ProjectDir)..\v27ter_rx_4800_floating_rrc.h"
+"$(TargetPath)" -m V.27ter2400 -t >"$(ProjectDir)..\v27ter_tx_2400_rrc.h"
+"$(TargetPath)" -m V.27ter4800 -t >"$(ProjectDir)..\v27ter_tx_4800_rrc.h"
+"$(TargetPath)" -m V.27ter2400 -t >"$(ProjectDir)..\v27ter_tx_2400_floating_rrc.h"
+"$(TargetPath)" -m V.27ter4800 -t >"$(ProjectDir)..\v27ter_tx_4800_floating_rrc.h"
+
+"$(TargetPath)" -m V.29 -r >"$(ProjectDir)..\v29rx_rrc.h"
+"$(TargetPath)" -m V.29 -r >"$(ProjectDir)..\v29rx_floating_rrc.h"
+"$(TargetPath)" -m V.29 -t >"$(ProjectDir)..\v29tx_rrc.h"
+"$(TargetPath)" -m V.29 -t >"$(ProjectDir)..\v29tx_floating_rrc.h"
+
+    
+  
+  
+    
+    
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/spandsp/src/msvc/make_t43_gray_code_tables.2015.vcxproj b/libs/spandsp/src/msvc/make_t43_gray_code_tables.2017.vcxproj
similarity index 94%
rename from libs/spandsp/src/msvc/make_t43_gray_code_tables.2015.vcxproj
rename to libs/spandsp/src/msvc/make_t43_gray_code_tables.2017.vcxproj
index f9f6c820c2..4cee1b1664 100644
--- a/libs/spandsp/src/msvc/make_t43_gray_code_tables.2015.vcxproj
+++ b/libs/spandsp/src/msvc/make_t43_gray_code_tables.2017.vcxproj
@@ -1,69 +1,69 @@
-
-
-  
-    
-      All
-      Win32
-    
-  
-  
-    make_t43_gray_code_tables
-    {EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}
-    make_t43_gray_code_tables
-    Win32Proj
-  
-  
-  
-    Application
-    Unicode
-    v140
-  
-  
-  
-    
-  
-  
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\make_t43_gray_code_tables\$(Configuration)\
-    false
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      Disabled
-      .;.\spandsp;.\msvc;.\generated;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      $(IntDir)$(TargetName).pdb
-      Level3
-      ProgramDatabase
-    
-    
-      true
-      Console
-      MachineX86
-    
-    
-      "$(TargetPath)" >"$(ProjectDir)..\t43_gray_code_tables.h"
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      All
+      Win32
+    
+  
+  
+    make_t43_gray_code_tables
+    {EDDB8AB9-C53E-44C0-A620-0E86C2CBD5D5}
+    make_t43_gray_code_tables
+    Win32Proj
+  
+  
+  
+    Application
+    Unicode
+    v141
+  
+  
+  
+    
+  
+  
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\make_t43_gray_code_tables\$(Configuration)\
+    false
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      Disabled
+      .;.\spandsp;.\msvc;.\generated;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      $(IntDir)$(TargetName).pdb
+      Level3
+      ProgramDatabase
+    
+    
+      true
+      Console
+      MachineX86
+    
+    
+      "$(TargetPath)" >"$(ProjectDir)..\t43_gray_code_tables.h"
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/srtp/libsrtp.2015.vcxproj b/libs/srtp/libsrtp.2017.vcxproj
similarity index 96%
rename from libs/srtp/libsrtp.2015.vcxproj
rename to libs/srtp/libsrtp.2017.vcxproj
index e5be6338d2..576bcd8cb2 100644
--- a/libs/srtp/libsrtp.2015.vcxproj
+++ b/libs/srtp/libsrtp.2017.vcxproj
@@ -1,419 +1,419 @@
-
-
-  
-    
-      Debug Dll
-      Win32
-    
-    
-      Debug Dll
-      x64
-    
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release Dll
-      Win32
-    
-    
-      Release Dll
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libsrtp
-    {EEF031CB-FED8-451E-A471-91EC8D4F6750}
-    libsrtp
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(SolutionDir)Debug\
-    $(Configuration)\
-    $(SolutionDir)$(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(SolutionDir)Release\
-    $(Configuration)\
-    $(SolutionDir)$(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-  
-  
-    
-      Creating config.h from config.hw
-      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
-    
-    
-      Disabled
-      crypto/include;include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Default
-      false
-      Level4
-      false
-      4389;4013;4018;4702;4305;4100;4244;4389;4018;4013;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      Creating config.h from config.hw
-      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
-    
-    
-      X64
-    
-    
-      Disabled
-      crypto/include;include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Default
-      Level4
-      false
-      4389;4013;4018;4702;4305;4100;4244;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      Creating config.h from config.hw
-      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
-    
-    
-      crypto/include;include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Default
-      Level4
-      false
-      4389;4013;4018;4702;4305;4100;4244;4389;4018;4013;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      Creating config.h from config.hw
-      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
-    
-    
-      X64
-    
-    
-      crypto/include;include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Default
-      Level4
-      false
-      4389;4013;4018;4702;4305;4100;4244;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      Creating config.h from config.hw
-      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
-    
-    
-      
-      
-      
-      
-      %(Outputs)
-    
-    
-      Disabled
-      true
-      crypto/include;include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Default
-      false
-      
-      
-      Level4
-      false
-      EditAndContinue
-      4389;4013;4018;4702;4305;%(DisableSpecificWarnings)
-    
-    
-      Ws2_32.lib;%(AdditionalDependencies)
-      srtp.def
-      false
-      false
-      
-      
-      false
-      
-      
-    
-  
-  
-    
-      Creating config.h from config.hw
-      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
-    
-    
-      
-      
-      
-      
-      %(Outputs)
-    
-    
-      X64
-    
-    
-      Disabled
-      true
-      crypto/include;include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Default
-      
-      
-      Level4
-      false
-      ProgramDatabase
-      4389;4013;4018;4702;4305;%(DisableSpecificWarnings)
-    
-    
-      Ws2_32.lib;%(AdditionalDependencies)
-      srtp.def
-      false
-      false
-      
-      
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      Creating config.h from config.hw
-      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
-    
-    
-      
-      
-      
-      
-      %(Outputs)
-    
-    
-      crypto/include;include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Default
-      false
-      
-      
-      Level4
-      false
-      ProgramDatabase
-      4389;4013;4018;4702;4305;%(DisableSpecificWarnings)
-    
-    
-      Ws2_32.lib;%(AdditionalDependencies)
-      srtp.def
-      false
-      
-      
-    
-  
-  
-    
-      Creating config.h from config.hw
-      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
-    
-    
-      
-      
-      
-      
-      %(Outputs)
-    
-    
-      X64
-    
-    
-      crypto/include;include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Default
-      
-      
-      Level4
-      false
-      ProgramDatabase
-      4389;4013;4018;4702;4305;%(DisableSpecificWarnings)
-    
-    
-      Ws2_32.lib;%(AdditionalDependencies)
-      srtp.def
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-      Default
-      false
-      false
-      Default
-      false
-      false
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-  
-  
-  
-  
-
+
+
+  
+    
+      Debug Dll
+      Win32
+    
+    
+      Debug Dll
+      x64
+    
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release Dll
+      Win32
+    
+    
+      Release Dll
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libsrtp
+    {EEF031CB-FED8-451E-A471-91EC8D4F6750}
+    libsrtp
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(SolutionDir)Debug\
+    $(Configuration)\
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(SolutionDir)Release\
+    $(Configuration)\
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+  
+  
+    
+      Creating config.h from config.hw
+      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
+    
+    
+      Disabled
+      crypto/include;include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Default
+      false
+      Level4
+      false
+      4389;4013;4018;4702;4305;4100;4244;4389;4018;4013;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      Creating config.h from config.hw
+      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
+    
+    
+      X64
+    
+    
+      Disabled
+      crypto/include;include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Default
+      Level4
+      false
+      4389;4013;4018;4702;4305;4100;4244;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      Creating config.h from config.hw
+      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
+    
+    
+      crypto/include;include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Default
+      Level4
+      false
+      4389;4013;4018;4702;4305;4100;4244;4389;4018;4013;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      Creating config.h from config.hw
+      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
+    
+    
+      X64
+    
+    
+      crypto/include;include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Default
+      Level4
+      false
+      4389;4013;4018;4702;4305;4100;4244;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      Creating config.h from config.hw
+      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
+    
+    
+      
+      
+      
+      
+      %(Outputs)
+    
+    
+      Disabled
+      true
+      crypto/include;include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Default
+      false
+      
+      
+      Level4
+      false
+      EditAndContinue
+      4389;4013;4018;4702;4305;%(DisableSpecificWarnings)
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      srtp.def
+      false
+      false
+      
+      
+      false
+      
+      
+    
+  
+  
+    
+      Creating config.h from config.hw
+      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
+    
+    
+      
+      
+      
+      
+      %(Outputs)
+    
+    
+      X64
+    
+    
+      Disabled
+      true
+      crypto/include;include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Default
+      
+      
+      Level4
+      false
+      ProgramDatabase
+      4389;4013;4018;4702;4305;%(DisableSpecificWarnings)
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      srtp.def
+      false
+      false
+      
+      
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      Creating config.h from config.hw
+      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
+    
+    
+      
+      
+      
+      
+      %(Outputs)
+    
+    
+      crypto/include;include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Default
+      false
+      
+      
+      Level4
+      false
+      ProgramDatabase
+      4389;4013;4018;4702;4305;%(DisableSpecificWarnings)
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      srtp.def
+      false
+      
+      
+    
+  
+  
+    
+      Creating config.h from config.hw
+      copy /Y "$(ProjectDir)config.hw" "$(ProjectDir)crypto\include\config.h" > NUL
+    
+    
+      
+      
+      
+      
+      %(Outputs)
+    
+    
+      X64
+    
+    
+      crypto/include;include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Default
+      
+      
+      Level4
+      false
+      ProgramDatabase
+      4389;4013;4018;4702;4305;%(DisableSpecificWarnings)
+    
+    
+      Ws2_32.lib;%(AdditionalDependencies)
+      srtp.def
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+      Default
+      false
+      false
+      Default
+      false
+      false
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+  
+  
+  
+  
+
\ No newline at end of file
diff --git a/libs/unimrcp/libs/apr-toolkit/aprtoolkit.2015.vcxproj b/libs/unimrcp/libs/apr-toolkit/aprtoolkit.2017.vcxproj
similarity index 95%
rename from libs/unimrcp/libs/apr-toolkit/aprtoolkit.2015.vcxproj
rename to libs/unimrcp/libs/apr-toolkit/aprtoolkit.2017.vcxproj
index 90d5cd4d15..a94be26353 100644
--- a/libs/unimrcp/libs/apr-toolkit/aprtoolkit.2015.vcxproj
+++ b/libs/unimrcp/libs/apr-toolkit/aprtoolkit.2017.vcxproj
@@ -1,167 +1,167 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    aprtoolkit
-    {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}
-    aprtoolkit
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-  
-  
-    
-      APT_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      APT_STATIC_LIB;%(PreprocessorDefinitions)
-      ProgramDatabase
-    
-  
-  
-    
-      APT_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      APT_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {f057da7f-79e5-4b00-845c-ef446ef055e3}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    aprtoolkit
+    {13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}
+    aprtoolkit
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+  
+  
+    
+      APT_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      APT_STATIC_LIB;%(PreprocessorDefinitions)
+      ProgramDatabase
+    
+  
+  
+    
+      APT_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      APT_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {f057da7f-79e5-4b00-845c-ef446ef055e3}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/unimrcp/libs/mpf/mpf.2015.vcxproj b/libs/unimrcp/libs/mpf/mpf.2017.vcxproj
similarity index 96%
rename from libs/unimrcp/libs/mpf/mpf.2015.vcxproj
rename to libs/unimrcp/libs/mpf/mpf.2017.vcxproj
index 5eec95c5fc..e9aafc1cad 100644
--- a/libs/unimrcp/libs/mpf/mpf.2015.vcxproj
+++ b/libs/unimrcp/libs/mpf/mpf.2017.vcxproj
@@ -1,196 +1,196 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mpf
-    {B5A00BFA-6083-4FAE-A097-71642D6473B5}
-    mpf
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-  
-  
-    
-      codecs;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      codecs;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;%(PreprocessorDefinitions)
-      false
-      ProgramDatabase
-    
-  
-  
-    
-      codecs;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      codecs;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;%(PreprocessorDefinitions)
-      false
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mpf
+    {B5A00BFA-6083-4FAE-A097-71642D6473B5}
+    mpf
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+  
+  
+    
+      codecs;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      codecs;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;%(PreprocessorDefinitions)
+      false
+      ProgramDatabase
+    
+  
+  
+    
+      codecs;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      codecs;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;%(PreprocessorDefinitions)
+      false
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/unimrcp/libs/mrcp-client/mrcpclient.2015.vcxproj b/libs/unimrcp/libs/mrcp-client/mrcpclient.2017.vcxproj
similarity index 94%
rename from libs/unimrcp/libs/mrcp-client/mrcpclient.2015.vcxproj
rename to libs/unimrcp/libs/mrcp-client/mrcpclient.2017.vcxproj
index 7e0172344a..e3ef5b295a 100644
--- a/libs/unimrcp/libs/mrcp-client/mrcpclient.2015.vcxproj
+++ b/libs/unimrcp/libs/mrcp-client/mrcpclient.2017.vcxproj
@@ -1,126 +1,126 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mrcpclient
-    {72782932-37CC-46AE-8C7F-9A7B1A6EE108}
-    mrcpclient
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-  
-  
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-      ProgramDatabase
-    
-  
-  
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mrcpclient
+    {72782932-37CC-46AE-8C7F-9A7B1A6EE108}
+    mrcpclient
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+  
+  
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+      ProgramDatabase
+    
+  
+  
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/unimrcp/libs/mrcp-signaling/mrcpsignaling.2015.vcxproj b/libs/unimrcp/libs/mrcp-signaling/mrcpsignaling.2017.vcxproj
similarity index 94%
rename from libs/unimrcp/libs/mrcp-signaling/mrcpsignaling.2015.vcxproj
rename to libs/unimrcp/libs/mrcp-signaling/mrcpsignaling.2017.vcxproj
index c01bab9a09..ba82c5d423 100644
--- a/libs/unimrcp/libs/mrcp-signaling/mrcpsignaling.2015.vcxproj
+++ b/libs/unimrcp/libs/mrcp-signaling/mrcpsignaling.2017.vcxproj
@@ -1,125 +1,125 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mrcpsignaling
-    {12A49562-BAB9-43A3-A21D-15B60BBB4C31}
-    mrcpsignaling
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-  
-  
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-      ProgramDatabase
-    
-  
-  
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-    
-    
-    
-  
-  
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mrcpsignaling
+    {12A49562-BAB9-43A3-A21D-15B60BBB4C31}
+    mrcpsignaling
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+  
+  
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+      ProgramDatabase
+    
+  
+  
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+    
+    
+    
+  
+  
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/unimrcp/libs/mrcp/mrcp.2015.vcxproj b/libs/unimrcp/libs/mrcp/mrcp.2017.vcxproj
similarity index 95%
rename from libs/unimrcp/libs/mrcp/mrcp.2015.vcxproj
rename to libs/unimrcp/libs/mrcp/mrcp.2017.vcxproj
index fe24840097..47a3665b6c 100644
--- a/libs/unimrcp/libs/mrcp/mrcp.2015.vcxproj
+++ b/libs/unimrcp/libs/mrcp/mrcp.2017.vcxproj
@@ -1,158 +1,158 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mrcp
-    {1C320193-46A6-4B34-9C56-8AB584FC1B56}
-    mrcp
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      %(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-      ProgramDatabase
-    
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      %(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mrcp
+    {1C320193-46A6-4B34-9C56-8AB584FC1B56}
+    mrcp
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      %(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+      ProgramDatabase
+    
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      %(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/unimrcp/libs/mrcpv2-transport/mrcpv2transport.2015.vcxproj b/libs/unimrcp/libs/mrcpv2-transport/mrcpv2transport.2017.vcxproj
similarity index 95%
rename from libs/unimrcp/libs/mrcpv2-transport/mrcpv2transport.2015.vcxproj
rename to libs/unimrcp/libs/mrcpv2-transport/mrcpv2transport.2017.vcxproj
index f5eeac138f..6ba07b2a04 100644
--- a/libs/unimrcp/libs/mrcpv2-transport/mrcpv2transport.2015.vcxproj
+++ b/libs/unimrcp/libs/mrcpv2-transport/mrcpv2transport.2017.vcxproj
@@ -1,129 +1,129 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mrcpv2transport
-    {A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}
-    mrcpv2transport
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-  
-  
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-      ProgramDatabase
-    
-  
-  
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mrcpv2transport
+    {A9EDAC04-6A5F-4BA7-BC0D-CCE7B255B6EA}
+    mrcpv2transport
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+  
+  
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+      ProgramDatabase
+    
+  
+  
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/unimrcp/libs/uni-rtsp/unirtsp.2015.vcxproj b/libs/unimrcp/libs/uni-rtsp/unirtsp.2017.vcxproj
similarity index 95%
rename from libs/unimrcp/libs/uni-rtsp/unirtsp.2015.vcxproj
rename to libs/unimrcp/libs/uni-rtsp/unirtsp.2017.vcxproj
index 8a86938fb0..0f8789a816 100644
--- a/libs/unimrcp/libs/uni-rtsp/unirtsp.2015.vcxproj
+++ b/libs/unimrcp/libs/uni-rtsp/unirtsp.2017.vcxproj
@@ -1,136 +1,136 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    unirtsp
-    {504B3154-7A4F-459D-9877-B951021C3F1F}
-    unirtsp
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-  
-  
-    
-      codecs;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      codecs;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;%(PreprocessorDefinitions)
-      ProgramDatabase
-    
-  
-  
-    
-      codecs;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      codecs;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;%(PreprocessorDefinitions)
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    unirtsp
+    {504B3154-7A4F-459D-9877-B951021C3F1F}
+    unirtsp
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+  
+  
+    
+      codecs;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      codecs;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;%(PreprocessorDefinitions)
+      ProgramDatabase
+    
+  
+  
+    
+      codecs;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      codecs;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;%(PreprocessorDefinitions)
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/unimrcp/modules/mrcp-sofiasip/mrcpsofiasip.2015.vcxproj b/libs/unimrcp/modules/mrcp-sofiasip/mrcpsofiasip.2017.vcxproj
similarity index 95%
rename from libs/unimrcp/modules/mrcp-sofiasip/mrcpsofiasip.2015.vcxproj
rename to libs/unimrcp/modules/mrcp-sofiasip/mrcpsofiasip.2017.vcxproj
index 1be84a722c..66c9b8b2cd 100644
--- a/libs/unimrcp/modules/mrcp-sofiasip/mrcpsofiasip.2015.vcxproj
+++ b/libs/unimrcp/modules/mrcp-sofiasip/mrcpsofiasip.2017.vcxproj
@@ -1,143 +1,143 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mrcpsofiasip
-    {746F3632-5BB2-4570-9453-31D6D58A7D8E}
-    mrcpsofiasip
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-  
-  
-    
-      include;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      include;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-      ProgramDatabase
-    
-  
-  
-    
-      include;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-    
-  
-  
-    
-      X64
-    
-    
-      include;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-    
-  
-  
-    
-      {70a49bc2-7500-41d0-b75d-edcc5be987a0}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mrcpsofiasip
+    {746F3632-5BB2-4570-9453-31D6D58A7D8E}
+    mrcpsofiasip
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+  
+  
+    
+      include;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      include;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+      ProgramDatabase
+    
+  
+  
+    
+      include;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+    
+  
+  
+    
+      X64
+    
+    
+      include;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+    
+  
+  
+    
+      {70a49bc2-7500-41d0-b75d-edcc5be987a0}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/unimrcp/modules/mrcp-unirtsp/mrcpunirtsp.2015.vcxproj b/libs/unimrcp/modules/mrcp-unirtsp/mrcpunirtsp.2017.vcxproj
similarity index 95%
rename from libs/unimrcp/modules/mrcp-unirtsp/mrcpunirtsp.2015.vcxproj
rename to libs/unimrcp/modules/mrcp-unirtsp/mrcpunirtsp.2017.vcxproj
index 392975ee90..94ba026952 100644
--- a/libs/unimrcp/modules/mrcp-unirtsp/mrcpunirtsp.2015.vcxproj
+++ b/libs/unimrcp/modules/mrcp-unirtsp/mrcpunirtsp.2017.vcxproj
@@ -1,141 +1,141 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mrcpunirtsp
-    {DEB01ACB-D65F-4A62-AED9-58C1054499E9}
-    mrcpunirtsp
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-  
-  
-    
-      include;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;RTSP_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-      4456;4100;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      X64
-    
-    
-      include;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;RTSP_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-      ProgramDatabase
-      4456;4100;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      include;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;RTSP_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-      4456;4100;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      X64
-    
-    
-      include;%(AdditionalIncludeDirectories)
-      APT_STATIC_LIB;RTSP_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-      4456;4100;%(DisableSpecificWarnings)
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mrcpunirtsp
+    {DEB01ACB-D65F-4A62-AED9-58C1054499E9}
+    mrcpunirtsp
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+  
+  
+    
+      include;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;RTSP_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+      4456;4100;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      X64
+    
+    
+      include;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;RTSP_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+      ProgramDatabase
+      4456;4100;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      include;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;RTSP_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+      4456;4100;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      X64
+    
+    
+      include;%(AdditionalIncludeDirectories)
+      APT_STATIC_LIB;RTSP_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+      4456;4100;%(DisableSpecificWarnings)
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download 16khz Sounds.2015.vcxproj b/libs/win32/Download 16khz Sounds.2017.vcxproj
similarity index 94%
rename from libs/win32/Download 16khz Sounds.2015.vcxproj
rename to libs/win32/Download 16khz Sounds.2017.vcxproj
index 71b537f101..a33c0caa91 100644
--- a/libs/win32/Download 16khz Sounds.2015.vcxproj	
+++ b/libs/win32/Download 16khz Sounds.2017.vcxproj	
@@ -1,78 +1,78 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download 16khzsound
-    {87A1FE3D-F410-4C8E-9591-8C625985BC70}
-    Download 16khzsound
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\16khzsounds\$(Configuration)\
-    $(PlatformName)\16khzsounds\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading 16khzsound.
-      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\16000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 16000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
-      $(ProjectDir)..\sounds\en\us\callie\voicemail\16000;%(Outputs)
-      Downloading 16khzsound.
-      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\16000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 16000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
-      $(ProjectDir)..\sounds\en\us\callie\voicemail\16000;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download 16khzsound
+    {87A1FE3D-F410-4C8E-9591-8C625985BC70}
+    Download 16khzsound
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\16khzsounds\$(Configuration)\
+    $(PlatformName)\16khzsounds\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading 16khzsound.
+      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\16000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 16000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
+      $(ProjectDir)..\sounds\en\us\callie\voicemail\16000;%(Outputs)
+      Downloading 16khzsound.
+      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\16000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 16000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
+      $(ProjectDir)..\sounds\en\us\callie\voicemail\16000;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download 16khz music.2015.vcxproj b/libs/win32/Download 16khz music.2017.vcxproj
similarity index 94%
rename from libs/win32/Download 16khz music.2015.vcxproj
rename to libs/win32/Download 16khz music.2017.vcxproj
index 3f96887fdc..259b8f5877 100644
--- a/libs/win32/Download 16khz music.2015.vcxproj	
+++ b/libs/win32/Download 16khz music.2017.vcxproj	
@@ -1,84 +1,84 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download 16khz music
-    {E10571C4-E7F4-4608-B5F2-B22E7EB95400}
-    Download 16khz music
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\16khzmusic\$(Configuration)\
-    $(PlatformName)\16khzmusic\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading 16khzsound.
-      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
-if not exist "$(ProjectDir)..\sounds\music\16000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-16000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
-
-
-      $(ProjectDir)..\sounds\music\16000;%(Outputs)
-      Downloading 16khzsound.
-      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
-if not exist "$(ProjectDir)..\sounds\music\16000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-16000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
-
-
-      $(ProjectDir)..\sounds\music\16000;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download 16khz music
+    {E10571C4-E7F4-4608-B5F2-B22E7EB95400}
+    Download 16khz music
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\16khzmusic\$(Configuration)\
+    $(PlatformName)\16khzmusic\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading 16khzsound.
+      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
+if not exist "$(ProjectDir)..\sounds\music\16000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-16000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
+
+
+      $(ProjectDir)..\sounds\music\16000;%(Outputs)
+      Downloading 16khzsound.
+      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
+if not exist "$(ProjectDir)..\sounds\music\16000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-16000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
+
+
+      $(ProjectDir)..\sounds\music\16000;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download 32khz Sounds.2015.vcxproj b/libs/win32/Download 32khz Sounds.2017.vcxproj
similarity index 94%
rename from libs/win32/Download 32khz Sounds.2015.vcxproj
rename to libs/win32/Download 32khz Sounds.2017.vcxproj
index 7d35f5a943..8c5ee153f1 100644
--- a/libs/win32/Download 32khz Sounds.2015.vcxproj	
+++ b/libs/win32/Download 32khz Sounds.2017.vcxproj	
@@ -1,77 +1,77 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download 32khzsound
-    {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}
-    Download 32khzsound
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\32khzsounds\$(Configuration)\
-    $(PlatformName)\32khzsounds\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading 32khzsound.
-      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\32000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 32000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
-      $(ProjectDir)..\sounds\en\us\callie\voicemail\32000;%(Outputs)
-      Downloading 32khzsound.
-      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\32000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 32000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
-      $(ProjectDir)..\sounds\en\us\callie\voicemail\32000;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download 32khzsound
+    {6E49F6C2-ADDA-4BFB-81FE-AB9AF51B455F}
+    Download 32khzsound
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\32khzsounds\$(Configuration)\
+    $(PlatformName)\32khzsounds\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading 32khzsound.
+      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\32000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 32000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
+      $(ProjectDir)..\sounds\en\us\callie\voicemail\32000;%(Outputs)
+      Downloading 32khzsound.
+      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\32000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 32000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
+      $(ProjectDir)..\sounds\en\us\callie\voicemail\32000;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download 32khz music.2015.vcxproj b/libs/win32/Download 32khz music.2017.vcxproj
similarity index 94%
rename from libs/win32/Download 32khz music.2015.vcxproj
rename to libs/win32/Download 32khz music.2017.vcxproj
index 3f7f9c99f7..40bfc687da 100644
--- a/libs/win32/Download 32khz music.2015.vcxproj	
+++ b/libs/win32/Download 32khz music.2017.vcxproj	
@@ -1,84 +1,84 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download 32khz music
-    {1F0A8A77-E661-418F-BB92-82172AE43803}
-    Download 32khz music
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\32khzmusic\$(Configuration)\
-    $(PlatformName)\32khzmusic\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading 32khzsound.
-      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
-if not exist "$(ProjectDir)..\sounds\music\32000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-32000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
-
-
-      $(ProjectDir)..\sounds\music\32000;%(Outputs)
-      Downloading 32khzsound.
-      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
-if not exist "$(ProjectDir)..\sounds\music\32000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-32000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
-
-
-      $(ProjectDir)..\sounds\music\32000;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download 32khz music
+    {1F0A8A77-E661-418F-BB92-82172AE43803}
+    Download 32khz music
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\32khzmusic\$(Configuration)\
+    $(PlatformName)\32khzmusic\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading 32khzsound.
+      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
+if not exist "$(ProjectDir)..\sounds\music\32000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-32000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
+
+
+      $(ProjectDir)..\sounds\music\32000;%(Outputs)
+      Downloading 32khzsound.
+      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
+if not exist "$(ProjectDir)..\sounds\music\32000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-32000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
+
+
+      $(ProjectDir)..\sounds\music\32000;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download 8khz Sounds.2015.vcxproj b/libs/win32/Download 8khz Sounds.2017.vcxproj
similarity index 94%
rename from libs/win32/Download 8khz Sounds.2015.vcxproj
rename to libs/win32/Download 8khz Sounds.2017.vcxproj
index 487cdb3907..9a178bb5b5 100644
--- a/libs/win32/Download 8khz Sounds.2015.vcxproj	
+++ b/libs/win32/Download 8khz Sounds.2017.vcxproj	
@@ -1,78 +1,78 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download 8khzsound
-    {3CE1DC99-8246-4DB1-A709-74F19F08EC67}
-    Download 8khzsound
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\8khzsounds\$(Configuration)\
-    $(PlatformName)\8khzsounds\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading 8khzsound.
-      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\8000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 8000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
-      $(ProjectDir)..\sounds\en\us\callie\voicemail\8000;%(Outputs)
-      Downloading 8khzsound.
-      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\8000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 8000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
-      $(ProjectDir)..\sounds\en\us\callie\voicemail\8000;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download 8khzsound
+    {3CE1DC99-8246-4DB1-A709-74F19F08EC67}
+    Download 8khzsound
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\8khzsounds\$(Configuration)\
+    $(PlatformName)\8khzsounds\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading 8khzsound.
+      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\8000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 8000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
+      $(ProjectDir)..\sounds\en\us\callie\voicemail\8000;%(Outputs)
+      Downloading 8khzsound.
+      if not exist "$(ProjectDir)..\sounds\en\us\callie\voicemail\8000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzipSounds en-us-callie 8000 "$(ProjectDir)..\sounds" "$(ProjectDir)..\..\build\sounds_version.txt"
+      $(ProjectDir)..\sounds\en\us\callie\voicemail\8000;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download 8khz music.2015.vcxproj b/libs/win32/Download 8khz music.2017.vcxproj
similarity index 94%
rename from libs/win32/Download 8khz music.2015.vcxproj
rename to libs/win32/Download 8khz music.2017.vcxproj
index d10cdf8b36..d64735a0df 100644
--- a/libs/win32/Download 8khz music.2015.vcxproj	
+++ b/libs/win32/Download 8khz music.2017.vcxproj	
@@ -1,82 +1,82 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download 8khz music
-    {4F5C9D55-98EF-4256-8311-32D7BD360406}
-    Download 8khz music
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\8khzmusic\$(Configuration)\
-    $(PlatformName)\8khzmusic\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading 8khzsound.
-      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
-if not exist "$(ProjectDir)..\sounds\music\8000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-8000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
-
-      $(ProjectDir)..\sounds\music\8000;%(Outputs)
-      Downloading 8khzsound.
-      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
-if not exist "$(ProjectDir)..\sounds\music\8000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-8000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
-
-      $(ProjectDir)..\sounds\music\8000;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download 8khz music
+    {4F5C9D55-98EF-4256-8311-32D7BD360406}
+    Download 8khz music
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\8khzmusic\$(Configuration)\
+    $(PlatformName)\8khzmusic\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading 8khzsound.
+      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
+if not exist "$(ProjectDir)..\sounds\music\8000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-8000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
+
+      $(ProjectDir)..\sounds\music\8000;%(Outputs)
+      Downloading 8khzsound.
+      set /P SOUND_VERSION=<"$(ProjectDir)..\..\build\moh_version.txt"
+if not exist "$(ProjectDir)..\sounds\music\8000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/freeswitch-sounds-music-8000-%SOUND_VERSION%.tar.gz "$(ProjectDir)..\sounds"
+
+      $(ProjectDir)..\sounds\music\8000;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download CELT.2015.vcxproj b/libs/win32/Download CELT.2017.vcxproj
similarity index 94%
rename from libs/win32/Download CELT.2015.vcxproj
rename to libs/win32/Download CELT.2017.vcxproj
index 3f968e8885..fcb4a331d4 100644
--- a/libs/win32/Download CELT.2015.vcxproj	
+++ b/libs/win32/Download CELT.2017.vcxproj	
@@ -1,88 +1,88 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    {FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}
-    Download CELT
-    Win32Proj
-    Download CELT
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\CELT\$(Configuration)\
-    $(PlatformName)\CELT\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading CELT.
-      if not exist "$(ProjectDir)..\celt-0.10.0" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/celt-0.10.0.tar.gz "$(ProjectDir).."
-xcopy "$(ProjectDir)\celt\config.h" "$(ProjectDir)..\celt-0.10.0\libcelt" /C /D /Y /S /I
-xcopy "$(ProjectDir)\celt\float_cast.h" "$(ProjectDir)..\celt-0.10.0\libcelt" /C /D /Y /S /I
-
-      $(ProjectDir)..\CELT;%(Outputs)
-      Downloading CELT.
-      if not exist "$(ProjectDir)..\celt-0.10.0" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/celt-0.10.0.tar.gz "$(ProjectDir).."
-xcopy "$(ProjectDir)\celt\config.h" "$(ProjectDir)..\celt-0.10.0\libcelt" /C /D /Y /S /I
-xcopy "$(ProjectDir)\celt\float_cast.h" "$(ProjectDir)..\celt-0.10.0\libcelt" /C /D /Y /S /I
-
-      $(ProjectDir)..\CELT;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    {FFF82F9B-6A2B-4BE3-95D8-DC5A4FC71E19}
+    Download CELT
+    Win32Proj
+    Download CELT
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\CELT\$(Configuration)\
+    $(PlatformName)\CELT\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading CELT.
+      if not exist "$(ProjectDir)..\celt-0.10.0" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/celt-0.10.0.tar.gz "$(ProjectDir).."
+xcopy "$(ProjectDir)\celt\config.h" "$(ProjectDir)..\celt-0.10.0\libcelt" /C /D /Y /S /I
+xcopy "$(ProjectDir)\celt\float_cast.h" "$(ProjectDir)..\celt-0.10.0\libcelt" /C /D /Y /S /I
+
+      $(ProjectDir)..\CELT;%(Outputs)
+      Downloading CELT.
+      if not exist "$(ProjectDir)..\celt-0.10.0" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/celt-0.10.0.tar.gz "$(ProjectDir).."
+xcopy "$(ProjectDir)\celt\config.h" "$(ProjectDir)..\celt-0.10.0\libcelt" /C /D /Y /S /I
+xcopy "$(ProjectDir)\celt\float_cast.h" "$(ProjectDir)..\celt-0.10.0\libcelt" /C /D /Y /S /I
+
+      $(ProjectDir)..\CELT;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download LAME.2015.vcxproj b/libs/win32/Download LAME.2017.vcxproj
similarity index 94%
rename from libs/win32/Download LAME.2015.vcxproj
rename to libs/win32/Download LAME.2017.vcxproj
index 2a48d74019..2203eebb94 100644
--- a/libs/win32/Download LAME.2015.vcxproj	
+++ b/libs/win32/Download LAME.2017.vcxproj	
@@ -1,84 +1,84 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download LAME
-    {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}
-    Download LAME
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\LAME\$(Configuration)\
-    $(PlatformName)\LAME\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading Lame.
-      if not exist "$(ProjectDir)..\lame-3.98.4" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/lame-3.98.4-1.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\lame-3.98.4;%(Outputs)
-      Downloading Lame.
-      if not exist "$(ProjectDir)..\lame-3.98.4" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/lame-3.98.4-1.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\lame-3.98.4;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download LAME
+    {D5D2BF72-29FE-4982-A9FA-82AB2086DB1B}
+    Download LAME
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\LAME\$(Configuration)\
+    $(PlatformName)\LAME\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading Lame.
+      if not exist "$(ProjectDir)..\lame-3.98.4" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/lame-3.98.4-1.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\lame-3.98.4;%(Outputs)
+      Downloading Lame.
+      if not exist "$(ProjectDir)..\lame-3.98.4" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/lame-3.98.4-1.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\lame-3.98.4;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download LDNS.2015.vcxproj b/libs/win32/Download LDNS.2017.vcxproj
similarity index 94%
rename from libs/win32/Download LDNS.2015.vcxproj
rename to libs/win32/Download LDNS.2017.vcxproj
index fb8c055c7f..cc398216fe 100644
--- a/libs/win32/Download LDNS.2015.vcxproj	
+++ b/libs/win32/Download LDNS.2017.vcxproj	
@@ -1,84 +1,84 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download LDNS
-    {5BE9A596-F11F-4379-928C-412F81AE182B}
-    Download LDNS
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\LDNS\$(Configuration)\
-    $(PlatformName)\LDNS\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading LDNS.
-      if not exist "$(ProjectDir)..\ldns" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/ldns-1.6.9-1-win.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\ldns;%(Outputs)
-      Downloading LDNS.
-      if not exist "$(ProjectDir)..\ldns" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/ldns-1.6.9-1-win.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\ldns;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download LDNS
+    {5BE9A596-F11F-4379-928C-412F81AE182B}
+    Download LDNS
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\LDNS\$(Configuration)\
+    $(PlatformName)\LDNS\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading LDNS.
+      if not exist "$(ProjectDir)..\ldns" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/ldns-1.6.9-1-win.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\ldns;%(Outputs)
+      Downloading LDNS.
+      if not exist "$(ProjectDir)..\ldns" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/ldns-1.6.9-1-win.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\ldns;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download LIBSHOUT.2015.vcxproj b/libs/win32/Download LIBSHOUT.2017.vcxproj
similarity index 94%
rename from libs/win32/Download LIBSHOUT.2015.vcxproj
rename to libs/win32/Download LIBSHOUT.2017.vcxproj
index dd001adcc9..b9d1dfb6fc 100644
--- a/libs/win32/Download LIBSHOUT.2015.vcxproj	
+++ b/libs/win32/Download LIBSHOUT.2017.vcxproj	
@@ -1,84 +1,84 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download LIBSHOUT
-    {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}
-    Download LIBSHOUT
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\LIBSHOUT\$(Configuration)\
-    $(PlatformName)\LIBSHOUT\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading libshout.
-      if not exist "$(ProjectDir)..\libshout-2.2.2" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/libshout-2.2.2.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\libshout-2.2.2;%(Outputs)
-      Downloading libshout.
-      if not exist "$(ProjectDir)..\libshout-2.2.2" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/libshout-2.2.2.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\libshout-2.2.2;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download LIBSHOUT
+    {D5D2BF72-29FE-4982-A9FA-82AB3086DB1B}
+    Download LIBSHOUT
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\LIBSHOUT\$(Configuration)\
+    $(PlatformName)\LIBSHOUT\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading libshout.
+      if not exist "$(ProjectDir)..\libshout-2.2.2" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/libshout-2.2.2.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\libshout-2.2.2;%(Outputs)
+      Downloading libshout.
+      if not exist "$(ProjectDir)..\libshout-2.2.2" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/libshout-2.2.2.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\libshout-2.2.2;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download OGG.2015.vcxproj b/libs/win32/Download OGG.2017.vcxproj
similarity index 94%
rename from libs/win32/Download OGG.2015.vcxproj
rename to libs/win32/Download OGG.2017.vcxproj
index 15c42db37a..d90abbefa4 100644
--- a/libs/win32/Download OGG.2015.vcxproj	
+++ b/libs/win32/Download OGG.2017.vcxproj	
@@ -1,84 +1,84 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download OGG
-    {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}
-    Download OGG
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\OGG\$(Configuration)\
-    $(PlatformName)\OGG\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading OGG.
-      if not exist "$(ProjectDir)..\libogg-1.1.3" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\libogg-1.1.3;%(Outputs)
-      Downloading OGG.
-      if not exist "$(ProjectDir)..\libogg-1.1.3" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\libogg-1.1.3;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download OGG
+    {D5D2BF72-29FE-4982-A9FA-82AB1086DB1B}
+    Download OGG
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\OGG\$(Configuration)\
+    $(PlatformName)\OGG\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading OGG.
+      if not exist "$(ProjectDir)..\libogg-1.1.3" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\libogg-1.1.3;%(Outputs)
+      Downloading OGG.
+      if not exist "$(ProjectDir)..\libogg-1.1.3" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\libogg-1.1.3;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download OPUS.2015.vcxproj b/libs/win32/Download OPUS.2017.vcxproj
similarity index 94%
rename from libs/win32/Download OPUS.2015.vcxproj
rename to libs/win32/Download OPUS.2017.vcxproj
index 883a9dcbe3..56c2db2125 100644
--- a/libs/win32/Download OPUS.2015.vcxproj	
+++ b/libs/win32/Download OPUS.2017.vcxproj	
@@ -1,80 +1,80 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download OPUS
-    {092124C9-09ED-43C7-BD6D-4AE5D6B3C547}
-    Download OPUS
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\OPUS\$(Configuration)\
-    $(PlatformName)\OPUS\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading OPUS.
-      if not exist "$(ProjectDir)..\opus-1.1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/opus-1.1.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\opus-1.1;%(Outputs)
-      Downloading OPUS.
-      if not exist "$(ProjectDir)..\opus-1.1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/opus-1.1.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\opus-1.1;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download OPUS
+    {092124C9-09ED-43C7-BD6D-4AE5D6B3C547}
+    Download OPUS
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\OPUS\$(Configuration)\
+    $(PlatformName)\OPUS\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading OPUS.
+      if not exist "$(ProjectDir)..\opus-1.1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/opus-1.1.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\opus-1.1;%(Outputs)
+      Downloading OPUS.
+      if not exist "$(ProjectDir)..\opus-1.1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/opus-1.1.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\opus-1.1;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download PORTAUDIO.2015.vcxproj b/libs/win32/Download PORTAUDIO.2017.vcxproj
similarity index 94%
rename from libs/win32/Download PORTAUDIO.2015.vcxproj
rename to libs/win32/Download PORTAUDIO.2017.vcxproj
index 7ccc6894d3..f7d0b90a01 100644
--- a/libs/win32/Download PORTAUDIO.2015.vcxproj	
+++ b/libs/win32/Download PORTAUDIO.2017.vcxproj	
@@ -1,84 +1,84 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download PORTAUDIO
-    {C0779BCC-C037-4F58-B890-EF37BA956B3C}
-    Download PORTAUDIO
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\PORTAUDIO\$(Configuration)\
-    $(PlatformName)\PORTAUDIO\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading PORTAUDIO.
-      if not exist "$(ProjectDir)..\portaudio" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pa_stable_v19_20140130.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\portaudio;%(Outputs)
-      Downloading PORTAUDIO.
-      if not exist "$(ProjectDir)..\portaudio" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pa_stable_v19_20140130.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\portaudio;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download PORTAUDIO
+    {C0779BCC-C037-4F58-B890-EF37BA956B3C}
+    Download PORTAUDIO
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\PORTAUDIO\$(Configuration)\
+    $(PlatformName)\PORTAUDIO\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading PORTAUDIO.
+      if not exist "$(ProjectDir)..\portaudio" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pa_stable_v19_20140130.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\portaudio;%(Outputs)
+      Downloading PORTAUDIO.
+      if not exist "$(ProjectDir)..\portaudio" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pa_stable_v19_20140130.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\portaudio;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download PTHREAD.2015.vcxproj b/libs/win32/Download PTHREAD.2017.vcxproj
similarity index 94%
rename from libs/win32/Download PTHREAD.2015.vcxproj
rename to libs/win32/Download PTHREAD.2017.vcxproj
index b1ea15e77e..208f30c48a 100644
--- a/libs/win32/Download PTHREAD.2015.vcxproj	
+++ b/libs/win32/Download PTHREAD.2017.vcxproj	
@@ -1,80 +1,80 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download PTHREAD
-    {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
-    Download PTHREAD
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\PTHREAD\$(Configuration)\
-    $(PlatformName)\PTHREAD\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading PTHREAD.
-      if not exist "$(ProjectDir)..\pthreads-w32-2-9-1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pthreads-w32-2-9-1.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\pthreads-w32-2-9-1;%(Outputs)
-      Downloading PTHREAD.
-      if not exist "$(ProjectDir)..\pthreads-w32-2-9-1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pthreads-w32-2-9-1.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\pthreads-w32-2-9-1;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download PTHREAD
+    {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}
+    Download PTHREAD
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\PTHREAD\$(Configuration)\
+    $(PlatformName)\PTHREAD\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading PTHREAD.
+      if not exist "$(ProjectDir)..\pthreads-w32-2-9-1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pthreads-w32-2-9-1.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\pthreads-w32-2-9-1;%(Outputs)
+      Downloading PTHREAD.
+      if not exist "$(ProjectDir)..\pthreads-w32-2-9-1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pthreads-w32-2-9-1.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\pthreads-w32-2-9-1;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download SPEEX.2015.vcxproj b/libs/win32/Download SPEEX.2017.vcxproj
similarity index 94%
rename from libs/win32/Download SPEEX.2015.vcxproj
rename to libs/win32/Download SPEEX.2017.vcxproj
index 751b919cac..ace2ba4886 100644
--- a/libs/win32/Download SPEEX.2015.vcxproj	
+++ b/libs/win32/Download SPEEX.2017.vcxproj	
@@ -1,85 +1,85 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download SPEEX
-    {1BDAB935-27DC-47E3-95EA-17E024D39C31}
-    Download SPEEX
-    Win32Proj
-    8.1
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\SPEEX\$(Configuration)\
-    $(PlatformName)\SPEEX\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading SPEEX.
-      if not exist "$(ProjectDir)..\speex-1.2rc1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/speex-1.2rc1.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\speex-1.2rc1;%(Outputs)
-      Downloading SPEEX.
-      if not exist "$(ProjectDir)..\speex-1.2rc1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/speex-1.2rc1.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\speex-1.2rc1;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download SPEEX
+    {1BDAB935-27DC-47E3-95EA-17E024D39C31}
+    Download SPEEX
+    Win32Proj
+    8.1
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\SPEEX\$(Configuration)\
+    $(PlatformName)\SPEEX\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading SPEEX.
+      if not exist "$(ProjectDir)..\speex-1.2rc1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/speex-1.2rc1.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\speex-1.2rc1;%(Outputs)
+      Downloading SPEEX.
+      if not exist "$(ProjectDir)..\speex-1.2rc1" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/speex-1.2rc1.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\speex-1.2rc1;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download SQLITE.2015.vcxproj b/libs/win32/Download SQLITE.2017.vcxproj
similarity index 94%
rename from libs/win32/Download SQLITE.2015.vcxproj
rename to libs/win32/Download SQLITE.2017.vcxproj
index e1e0eee570..2b1334cf85 100644
--- a/libs/win32/Download SQLITE.2015.vcxproj	
+++ b/libs/win32/Download SQLITE.2017.vcxproj	
@@ -1,85 +1,85 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download SQLITE
-    {97D25665-34CD-4E0C-96E7-88F0795B8883}
-    Download SQLITE
-    Win32Proj
-    8.1
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\SQLITE\$(Configuration)\
-    $(PlatformName)\SQLITE\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading SQLITE.
-      if not exist "$(ProjectDir)..\sqlite-amalgamation-3080401" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/sqlite-amalgamation-3080401.zip "$(ProjectDir).."
-
-      $(ProjectDir)..\sqlite-amalgamation-3080401;%(Outputs)
-      Downloading SQLITE.
-      if not exist "$(ProjectDir)..\sqlite-amalgamation-3080401" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/sqlite-amalgamation-3080401.zip "$(ProjectDir).."
-
-      $(ProjectDir)..\sqlite-amalgamation-3080401;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download SQLITE
+    {97D25665-34CD-4E0C-96E7-88F0795B8883}
+    Download SQLITE
+    Win32Proj
+    8.1
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\SQLITE\$(Configuration)\
+    $(PlatformName)\SQLITE\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading SQLITE.
+      if not exist "$(ProjectDir)..\sqlite-amalgamation-3080401" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/sqlite-amalgamation-3080401.zip "$(ProjectDir).."
+
+      $(ProjectDir)..\sqlite-amalgamation-3080401;%(Outputs)
+      Downloading SQLITE.
+      if not exist "$(ProjectDir)..\sqlite-amalgamation-3080401" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/sqlite-amalgamation-3080401.zip "$(ProjectDir).."
+
+      $(ProjectDir)..\sqlite-amalgamation-3080401;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download broadvoice.2015.vcxproj b/libs/win32/Download broadvoice.2017.vcxproj
similarity index 96%
rename from libs/win32/Download broadvoice.2015.vcxproj
rename to libs/win32/Download broadvoice.2017.vcxproj
index 6fa19bf2a7..e2ca45abb6 100644
--- a/libs/win32/Download broadvoice.2015.vcxproj	
+++ b/libs/win32/Download broadvoice.2017.vcxproj	
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -20,12 +20,12 @@
   
     Utility
     MultiByte
-    v140
+    v141
   
   
     Utility
     MultiByte
-    v140
+    v141
   
   
   
diff --git a/libs/win32/Download freetype.2015.vcxproj b/libs/win32/Download freetype.2017.vcxproj
similarity index 96%
rename from libs/win32/Download freetype.2015.vcxproj
rename to libs/win32/Download freetype.2017.vcxproj
index 8ef9071c55..be38c22566 100644
--- a/libs/win32/Download freetype.2015.vcxproj	
+++ b/libs/win32/Download freetype.2017.vcxproj	
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -20,12 +20,12 @@
   
     Utility
     MultiByte
-    v140
+    v141
   
   
     Utility
     MultiByte
-    v140
+    v141
   
   
   
diff --git a/libs/win32/Download g722_1.2015.vcxproj b/libs/win32/Download g722_1.2017.vcxproj
similarity index 96%
rename from libs/win32/Download g722_1.2015.vcxproj
rename to libs/win32/Download g722_1.2017.vcxproj
index 46e1038698..5af4fed270 100644
--- a/libs/win32/Download g722_1.2015.vcxproj	
+++ b/libs/win32/Download g722_1.2017.vcxproj	
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -20,12 +20,12 @@
   
     Utility
     MultiByte
-    v140
+    v141
   
   
     Utility
     MultiByte
-    v140
+    v141
   
   
   
diff --git a/libs/win32/Download iLBC.2015.vcxproj b/libs/win32/Download iLBC.2017.vcxproj
similarity index 96%
rename from libs/win32/Download iLBC.2015.vcxproj
rename to libs/win32/Download iLBC.2017.vcxproj
index 7930394232..1f169d8972 100644
--- a/libs/win32/Download iLBC.2015.vcxproj	
+++ b/libs/win32/Download iLBC.2017.vcxproj	
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -20,12 +20,12 @@
   
     Utility
     MultiByte
-    v140
+    v141
   
   
     Utility
     MultiByte
-    v140
+    v141
   
   
   
diff --git a/libs/win32/Download libav.2015.vcxproj b/libs/win32/Download libav.2017.vcxproj
similarity index 96%
rename from libs/win32/Download libav.2015.vcxproj
rename to libs/win32/Download libav.2017.vcxproj
index b7fc458fb3..e0dcb03339 100644
--- a/libs/win32/Download libav.2015.vcxproj	
+++ b/libs/win32/Download libav.2017.vcxproj	
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -20,12 +20,12 @@
   
     Utility
     MultiByte
-    v140
+    v141
   
   
     Utility
     MultiByte
-    v140
+    v141
   
   
   
diff --git a/libs/win32/Download libcodec2.2015.vcxproj b/libs/win32/Download libcodec2.2017.vcxproj
similarity index 96%
rename from libs/win32/Download libcodec2.2015.vcxproj
rename to libs/win32/Download libcodec2.2017.vcxproj
index 9cddd2a69d..7e85186c7f 100644
--- a/libs/win32/Download libcodec2.2015.vcxproj	
+++ b/libs/win32/Download libcodec2.2017.vcxproj	
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -20,12 +20,12 @@
   
     Utility
     MultiByte
-    v140
+    v141
   
   
     Utility
     MultiByte
-    v140
+    v141
   
   
   
diff --git a/libs/win32/Download libjpeg.2015.vcxproj b/libs/win32/Download libjpeg.2017.vcxproj
similarity index 94%
rename from libs/win32/Download libjpeg.2015.vcxproj
rename to libs/win32/Download libjpeg.2017.vcxproj
index 6e29895166..4aa5113de2 100644
--- a/libs/win32/Download libjpeg.2015.vcxproj	
+++ b/libs/win32/Download libjpeg.2017.vcxproj	
@@ -1,84 +1,84 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download libjpeg
-    {652AD5F7-8488-489F-AAD0-7FBE064703B6}
-    Download libjpeg
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\jpeg-8d\$(Configuration)\
-    $(PlatformName)\jpeg-8d\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading libjpeg.
-      if not exist "$(ProjectDir)..\jpeg-8d" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://www.ijg.org/files/jpegsrc.v8d.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\jpeg-8d;%(Outputs)
-      Downloading libjpeg.
-      if not exist "$(ProjectDir)..\jpeg-8d" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://www.ijg.org/files/jpegsrc.v8d.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\jpeg-8d;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download libjpeg
+    {652AD5F7-8488-489F-AAD0-7FBE064703B6}
+    Download libjpeg
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\jpeg-8d\$(Configuration)\
+    $(PlatformName)\jpeg-8d\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading libjpeg.
+      if not exist "$(ProjectDir)..\jpeg-8d" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://www.ijg.org/files/jpegsrc.v8d.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\jpeg-8d;%(Outputs)
+      Downloading libjpeg.
+      if not exist "$(ProjectDir)..\jpeg-8d" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://www.ijg.org/files/jpegsrc.v8d.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\jpeg-8d;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download libpng.2015.vcxproj b/libs/win32/Download libpng.2017.vcxproj
similarity index 96%
rename from libs/win32/Download libpng.2015.vcxproj
rename to libs/win32/Download libpng.2017.vcxproj
index 78b0b52ee6..cabea06a76 100644
--- a/libs/win32/Download libpng.2015.vcxproj	
+++ b/libs/win32/Download libpng.2017.vcxproj	
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -20,12 +20,12 @@
   
     Utility
     MultiByte
-    v140
+    v141
   
   
     Utility
     MultiByte
-    v140
+    v141
   
   
   
diff --git a/libs/win32/Download libsilk.2015.vcxproj b/libs/win32/Download libsilk.2017.vcxproj
similarity index 96%
rename from libs/win32/Download libsilk.2015.vcxproj
rename to libs/win32/Download libsilk.2017.vcxproj
index 8970ab86b4..544d4b0dbe 100644
--- a/libs/win32/Download libsilk.2015.vcxproj	
+++ b/libs/win32/Download libsilk.2017.vcxproj	
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -20,12 +20,12 @@
   
     Utility
     MultiByte
-    v140
+    v141
   
   
     Utility
     MultiByte
-    v140
+    v141
   
   
   
diff --git a/libs/win32/Download libx264.2015.vcxproj b/libs/win32/Download libx264.2017.vcxproj
similarity index 96%
rename from libs/win32/Download libx264.2015.vcxproj
rename to libs/win32/Download libx264.2017.vcxproj
index 07d773a9a1..938bf3cba4 100644
--- a/libs/win32/Download libx264.2015.vcxproj	
+++ b/libs/win32/Download libx264.2017.vcxproj	
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -20,12 +20,12 @@
   
     Utility
     MultiByte
-    v140
+    v141
   
   
     Utility
     MultiByte
-    v140
+    v141
   
   
   
diff --git a/libs/win32/Download mpg123.2015.vcxproj b/libs/win32/Download mpg123.2017.vcxproj
similarity index 94%
rename from libs/win32/Download mpg123.2015.vcxproj
rename to libs/win32/Download mpg123.2017.vcxproj
index 2e04186b16..39fccba18b 100644
--- a/libs/win32/Download mpg123.2015.vcxproj	
+++ b/libs/win32/Download mpg123.2017.vcxproj	
@@ -1,86 +1,86 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download mpg123
-    {E796E337-DE78-4303-8614-9A590862EE95}
-    Download mpg123
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\mpg123\$(Configuration)\
-    $(PlatformName)\mpg123\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading mpg123.
-      if not exist "$(ProjectDir)..\libmpg123" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/mpg123-1.14.4.tar.bz2 "$(ProjectDir).."
-if not exist "$(ProjectDir)..\libmpg123" move "$(ProjectDir)..\mpg123-1.14.4" "$(ProjectDir)..\libmpg123"
-
-      $(ProjectDir)..\libmpg123;%(Outputs)
-      Downloading mpg123.
-      if not exist "$(ProjectDir)..\libmpg123" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/mpg123-1.14.4.tar.bz2 "$(ProjectDir).."
-if not exist "$(ProjectDir)..\libmpg123" move "$(ProjectDir)..\mpg123-1.14.4" "$(ProjectDir)..\libmpg123"
-
-      $(ProjectDir)..\libmpg123;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download mpg123
+    {E796E337-DE78-4303-8614-9A590862EE95}
+    Download mpg123
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\mpg123\$(Configuration)\
+    $(PlatformName)\mpg123\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading mpg123.
+      if not exist "$(ProjectDir)..\libmpg123" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/mpg123-1.14.4.tar.bz2 "$(ProjectDir).."
+if not exist "$(ProjectDir)..\libmpg123" move "$(ProjectDir)..\mpg123-1.14.4" "$(ProjectDir)..\libmpg123"
+
+      $(ProjectDir)..\libmpg123;%(Outputs)
+      Downloading mpg123.
+      if not exist "$(ProjectDir)..\libmpg123" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/mpg123-1.14.4.tar.bz2 "$(ProjectDir).."
+if not exist "$(ProjectDir)..\libmpg123" move "$(ProjectDir)..\mpg123-1.14.4" "$(ProjectDir)..\libmpg123"
+
+      $(ProjectDir)..\libmpg123;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download pocketsphinx.2015.vcxproj b/libs/win32/Download pocketsphinx.2017.vcxproj
similarity index 94%
rename from libs/win32/Download pocketsphinx.2015.vcxproj
rename to libs/win32/Download pocketsphinx.2017.vcxproj
index 05d8a455e9..7ede947247 100644
--- a/libs/win32/Download pocketsphinx.2015.vcxproj	
+++ b/libs/win32/Download pocketsphinx.2017.vcxproj	
@@ -1,80 +1,80 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download pocketsphinx
-    {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}
-    Download pocketsphinx
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\pocketsphinx\$(Configuration)\
-    $(PlatformName)\pocketsphinx\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading pocketsphinx.
-      if not exist "$(ProjectDir)..\pocketsphinx-0.7" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pocketsphinx-0.7.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\pocketsphinx-0.7;%(Outputs)
-      Downloading pocketsphinx.
-      if not exist "$(ProjectDir)..\pocketsphinx-0.7" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pocketsphinx-0.7.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\pocketsphinx-0.7;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download pocketsphinx
+    {AF8163EE-FA76-4904-A11D-7D70A1B5BA2E}
+    Download pocketsphinx
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\pocketsphinx\$(Configuration)\
+    $(PlatformName)\pocketsphinx\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading pocketsphinx.
+      if not exist "$(ProjectDir)..\pocketsphinx-0.7" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pocketsphinx-0.7.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\pocketsphinx-0.7;%(Outputs)
+      Downloading pocketsphinx.
+      if not exist "$(ProjectDir)..\pocketsphinx-0.7" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/pocketsphinx-0.7.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\pocketsphinx-0.7;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download sphinxbase.2015.vcxproj b/libs/win32/Download sphinxbase.2017.vcxproj
similarity index 94%
rename from libs/win32/Download sphinxbase.2015.vcxproj
rename to libs/win32/Download sphinxbase.2017.vcxproj
index 80d2b89c1f..74b9856374 100644
--- a/libs/win32/Download sphinxbase.2015.vcxproj	
+++ b/libs/win32/Download sphinxbase.2017.vcxproj	
@@ -1,80 +1,80 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download sphinxbase
-    {4F92B672-DADB-4047-8D6A-4BB3796733FD}
-    Download sphinxbase
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\sphinxbase\$(Configuration)\
-    $(PlatformName)\sphinxbase\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading sphinxbase.
-      if not exist "$(ProjectDir)..\sphinxbase-0.7" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/sphinxbase-0.7.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\sphinxbase-0.7;%(Outputs)
-      Downloading sphinxbase.
-      if not exist "$(ProjectDir)..\sphinxbase-0.7" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/sphinxbase-0.7.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\sphinxbase-0.7;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download sphinxbase
+    {4F92B672-DADB-4047-8D6A-4BB3796733FD}
+    Download sphinxbase
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\sphinxbase\$(Configuration)\
+    $(PlatformName)\sphinxbase\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading sphinxbase.
+      if not exist "$(ProjectDir)..\sphinxbase-0.7" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/sphinxbase-0.7.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\sphinxbase-0.7;%(Outputs)
+      Downloading sphinxbase.
+      if not exist "$(ProjectDir)..\sphinxbase-0.7" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/sphinxbase-0.7.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\sphinxbase-0.7;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download sphinxmodel.2015.vcxproj b/libs/win32/Download sphinxmodel.2017.vcxproj
similarity index 94%
rename from libs/win32/Download sphinxmodel.2015.vcxproj
rename to libs/win32/Download sphinxmodel.2017.vcxproj
index 91edb2f0f5..83876e5009 100644
--- a/libs/win32/Download sphinxmodel.2015.vcxproj	
+++ b/libs/win32/Download sphinxmodel.2017.vcxproj	
@@ -1,83 +1,83 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    Download sphinxmodel
-    {2DEE4895-1134-439C-B688-52203E57D878}
-    Download sphinxmodel
-    Win32Proj
-  
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\sphinxmodel\$(Configuration)\
-    $(PlatformName)\sphinxmodel\$(Configuration)\
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-  
-  
-    
-      $(IntDir)BuildLog $(ProjectName).htm
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Document
-      Downloading sphinxmodel.
-      if not exist "$(SolutionDir)\libs\Communicator_semi_40.cd_semi_6000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/communicator_semi_6000_20080321.tar.gz "$(ProjectDir).."
-
-      $(ProjectDir)..\Communicator_semi_40.cd_semi_6000;%(Outputs)
-      Downloading sphinxmodel.
-      if not exist "$(SolutionDir)\libs\Communicator_semi_40.cd_semi_6000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/communicator_semi_6000_20080321.tar.gz "$(ProjectDir).."
-      $(ProjectDir)..\Communicator_semi_40.cd_semi_6000;%(Outputs)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    Download sphinxmodel
+    {2DEE4895-1134-439C-B688-52203E57D878}
+    Download sphinxmodel
+    Win32Proj
+  
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\sphinxmodel\$(Configuration)\
+    $(PlatformName)\sphinxmodel\$(Configuration)\
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+  
+  
+    
+      $(IntDir)BuildLog $(ProjectName).htm
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Document
+      Downloading sphinxmodel.
+      if not exist "$(SolutionDir)\libs\Communicator_semi_40.cd_semi_6000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/communicator_semi_6000_20080321.tar.gz "$(ProjectDir).."
+
+      $(ProjectDir)..\Communicator_semi_40.cd_semi_6000;%(Outputs)
+      Downloading sphinxmodel.
+      if not exist "$(SolutionDir)\libs\Communicator_semi_40.cd_semi_6000" cscript /nologo "$(ProjectDir)util.vbs" GetUnzip http://files.freeswitch.org/downloads/libs/communicator_semi_6000_20080321.tar.gz "$(ProjectDir).."
+      $(ProjectDir)..\Communicator_semi_40.cd_semi_6000;%(Outputs)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Download tiff.2015.vcxproj b/libs/win32/Download tiff.2017.vcxproj
similarity index 96%
rename from libs/win32/Download tiff.2015.vcxproj
rename to libs/win32/Download tiff.2017.vcxproj
index d269cc0067..bd590988e5 100644
--- a/libs/win32/Download tiff.2015.vcxproj	
+++ b/libs/win32/Download tiff.2017.vcxproj	
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -20,12 +20,12 @@
   
     Utility
     MultiByte
-    v140
+    v141
   
   
     Utility
     MultiByte
-    v140
+    v141
   
   
   
diff --git a/libs/win32/Sound_Files/16khz.2015.vcxproj b/libs/win32/Sound_Files/16khz.2017.vcxproj
similarity index 95%
rename from libs/win32/Sound_Files/16khz.2015.vcxproj
rename to libs/win32/Sound_Files/16khz.2017.vcxproj
index cd4c9017b2..345104617a 100644
--- a/libs/win32/Sound_Files/16khz.2015.vcxproj
+++ b/libs/win32/Sound_Files/16khz.2017.vcxproj
@@ -1,158 +1,158 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    16khz
-    {7EB71250-F002-4ED8-92CA-CA218114537A}
-    My16khz
-    8.1
-  
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\16000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\16000\*.*" "$(OutDir)sounds\en\us\callie\ivr\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\16000\*.*" "$(OutDir)sounds\en\us\callie\conference\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\16000\*.*" "$(OutDir)sounds\en\us\callie\time\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\16000\*.*" "$(OutDir)sounds\en\us\callie\digits\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\ascii\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\16000\*.*" "$(OutDir)sounds\en\us\callie\misc\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\16000\*.*" "$(OutDir)sounds\en\us\callie\currency\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\16000\*.*" "$(OutDir)sounds\en\us\callie\directory\16000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\16000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\16000\*.*" "$(OutDir)sounds\en\us\callie\ivr\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\16000\*.*" "$(OutDir)sounds\en\us\callie\conference\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\16000\*.*" "$(OutDir)sounds\en\us\callie\time\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\16000\*.*" "$(OutDir)sounds\en\us\callie\digits\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\ascii\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\16000\*.*" "$(OutDir)sounds\en\us\callie\misc\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\16000\*.*" "$(OutDir)sounds\en\us\callie\currency\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\16000\*.*" "$(OutDir)sounds\en\us\callie\directory\16000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\16000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\16000\*.*" "$(OutDir)sounds\en\us\callie\ivr\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\16000\*.*" "$(OutDir)sounds\en\us\callie\conference\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\16000\*.*" "$(OutDir)sounds\en\us\callie\time\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\16000\*.*" "$(OutDir)sounds\en\us\callie\digits\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\ascii\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\16000\*.*" "$(OutDir)sounds\en\us\callie\misc\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\16000\*.*" "$(OutDir)sounds\en\us\callie\currency\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\16000\*.*" "$(OutDir)sounds\en\us\callie\directory\16000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\16000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\16000\*.*" "$(OutDir)sounds\en\us\callie\ivr\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\16000\*.*" "$(OutDir)sounds\en\us\callie\conference\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\16000\*.*" "$(OutDir)sounds\en\us\callie\time\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\16000\*.*" "$(OutDir)sounds\en\us\callie\digits\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\ascii\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\16000\*.*" "$(OutDir)sounds\en\us\callie\misc\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\16000\*.*" "$(OutDir)sounds\en\us\callie\currency\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\16000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\16000\*.*" "$(OutDir)sounds\en\us\callie\directory\16000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      {87a1fe3d-f410-4c8e-9591-8c625985bc70}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    16khz
+    {7EB71250-F002-4ED8-92CA-CA218114537A}
+    My16khz
+    8.1
+  
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\16000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\16000\*.*" "$(OutDir)sounds\en\us\callie\ivr\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\16000\*.*" "$(OutDir)sounds\en\us\callie\conference\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\16000\*.*" "$(OutDir)sounds\en\us\callie\time\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\16000\*.*" "$(OutDir)sounds\en\us\callie\digits\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\ascii\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\16000\*.*" "$(OutDir)sounds\en\us\callie\misc\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\16000\*.*" "$(OutDir)sounds\en\us\callie\currency\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\16000\*.*" "$(OutDir)sounds\en\us\callie\directory\16000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\16000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\16000\*.*" "$(OutDir)sounds\en\us\callie\ivr\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\16000\*.*" "$(OutDir)sounds\en\us\callie\conference\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\16000\*.*" "$(OutDir)sounds\en\us\callie\time\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\16000\*.*" "$(OutDir)sounds\en\us\callie\digits\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\ascii\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\16000\*.*" "$(OutDir)sounds\en\us\callie\misc\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\16000\*.*" "$(OutDir)sounds\en\us\callie\currency\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\16000\*.*" "$(OutDir)sounds\en\us\callie\directory\16000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\16000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\16000\*.*" "$(OutDir)sounds\en\us\callie\ivr\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\16000\*.*" "$(OutDir)sounds\en\us\callie\conference\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\16000\*.*" "$(OutDir)sounds\en\us\callie\time\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\16000\*.*" "$(OutDir)sounds\en\us\callie\digits\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\ascii\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\16000\*.*" "$(OutDir)sounds\en\us\callie\misc\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\16000\*.*" "$(OutDir)sounds\en\us\callie\currency\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\16000\*.*" "$(OutDir)sounds\en\us\callie\directory\16000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\16000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\16000\*.*" "$(OutDir)sounds\en\us\callie\ivr\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\16000\*.*" "$(OutDir)sounds\en\us\callie\conference\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\16000\*.*" "$(OutDir)sounds\en\us\callie\time\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\16000\*.*" "$(OutDir)sounds\en\us\callie\digits\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\ascii\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\16000\*.*" "$(OutDir)sounds\en\us\callie\misc\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\16000\*.*" "$(OutDir)sounds\en\us\callie\currency\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\16000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\16000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\16000\*.*" "$(OutDir)sounds\en\us\callie\directory\16000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      {87a1fe3d-f410-4c8e-9591-8c625985bc70}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Sound_Files/16khzmusic.2015.vcxproj b/libs/win32/Sound_Files/16khzmusic.2017.vcxproj
similarity index 93%
rename from libs/win32/Sound_Files/16khzmusic.2015.vcxproj
rename to libs/win32/Sound_Files/16khzmusic.2017.vcxproj
index 9016cae8f1..3309d2611b 100644
--- a/libs/win32/Sound_Files/16khzmusic.2015.vcxproj
+++ b/libs/win32/Sound_Files/16khzmusic.2017.vcxproj
@@ -1,118 +1,118 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    16khz music
-    {BA599D0A-4310-4505-91DA-6A6447B3E289}
-    My16khzmusic
-    8.1
-  
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\16000\*.*" "$(OutDir)sounds\music\16000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\16000\*.*" "$(OutDir)sounds\music\16000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\16000\*.*" "$(OutDir)sounds\music\16000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\16000\*.*" "$(OutDir)sounds\music\16000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      {e10571c4-e7f4-4608-b5f2-b22e7eb95400}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    16khz music
+    {BA599D0A-4310-4505-91DA-6A6447B3E289}
+    My16khzmusic
+    8.1
+  
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\16000\*.*" "$(OutDir)sounds\music\16000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\16000\*.*" "$(OutDir)sounds\music\16000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\16000\*.*" "$(OutDir)sounds\music\16000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\16000\*.*" "$(OutDir)sounds\music\16000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      {e10571c4-e7f4-4608-b5f2-b22e7eb95400}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Sound_Files/32khz.2015.vcxproj b/libs/win32/Sound_Files/32khz.2017.vcxproj
similarity index 95%
rename from libs/win32/Sound_Files/32khz.2015.vcxproj
rename to libs/win32/Sound_Files/32khz.2017.vcxproj
index d926eda33c..cb96a82c8e 100644
--- a/libs/win32/Sound_Files/32khz.2015.vcxproj
+++ b/libs/win32/Sound_Files/32khz.2017.vcxproj
@@ -1,158 +1,158 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    32khz
-    {464AAB78-5489-4916-BE51-BF8D61822311}
-    My32khz
-    8.1
-  
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\32000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\32000\*.*" "$(OutDir)sounds\en\us\callie\ivr\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\32000\*.*" "$(OutDir)sounds\en\us\callie\conference\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\32000\*.*" "$(OutDir)sounds\en\us\callie\time\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\32000\*.*" "$(OutDir)sounds\en\us\callie\digits\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\ascii\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\32000\*.*" "$(OutDir)sounds\en\us\callie\misc\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\32000\*.*" "$(OutDir)sounds\en\us\callie\currency\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\32000\*.*" "$(OutDir)sounds\en\us\callie\directory\32000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\32000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\32000\*.*" "$(OutDir)sounds\en\us\callie\ivr\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\32000\*.*" "$(OutDir)sounds\en\us\callie\conference\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\32000\*.*" "$(OutDir)sounds\en\us\callie\time\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\32000\*.*" "$(OutDir)sounds\en\us\callie\digits\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\ascii\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\32000\*.*" "$(OutDir)sounds\en\us\callie\misc\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\32000\*.*" "$(OutDir)sounds\en\us\callie\currency\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\32000\*.*" "$(OutDir)sounds\en\us\callie\directory\32000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\32000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\32000\*.*" "$(OutDir)sounds\en\us\callie\ivr\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\32000\*.*" "$(OutDir)sounds\en\us\callie\conference\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\32000\*.*" "$(OutDir)sounds\en\us\callie\time\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\32000\*.*" "$(OutDir)sounds\en\us\callie\digits\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\ascii\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\32000\*.*" "$(OutDir)sounds\en\us\callie\misc\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\32000\*.*" "$(OutDir)sounds\en\us\callie\currency\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\32000\*.*" "$(OutDir)sounds\en\us\callie\directory\32000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\32000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\32000\*.*" "$(OutDir)sounds\en\us\callie\ivr\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\32000\*.*" "$(OutDir)sounds\en\us\callie\conference\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\32000\*.*" "$(OutDir)sounds\en\us\callie\time\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\32000\*.*" "$(OutDir)sounds\en\us\callie\digits\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\ascii\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\32000\*.*" "$(OutDir)sounds\en\us\callie\misc\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\32000\*.*" "$(OutDir)sounds\en\us\callie\currency\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\32000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\32000\*.*" "$(OutDir)sounds\en\us\callie\directory\32000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      {6e49f6c2-adda-4bfb-81fe-ab9af51b455f}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    32khz
+    {464AAB78-5489-4916-BE51-BF8D61822311}
+    My32khz
+    8.1
+  
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\32000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\32000\*.*" "$(OutDir)sounds\en\us\callie\ivr\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\32000\*.*" "$(OutDir)sounds\en\us\callie\conference\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\32000\*.*" "$(OutDir)sounds\en\us\callie\time\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\32000\*.*" "$(OutDir)sounds\en\us\callie\digits\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\ascii\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\32000\*.*" "$(OutDir)sounds\en\us\callie\misc\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\32000\*.*" "$(OutDir)sounds\en\us\callie\currency\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\32000\*.*" "$(OutDir)sounds\en\us\callie\directory\32000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\32000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\32000\*.*" "$(OutDir)sounds\en\us\callie\ivr\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\32000\*.*" "$(OutDir)sounds\en\us\callie\conference\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\32000\*.*" "$(OutDir)sounds\en\us\callie\time\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\32000\*.*" "$(OutDir)sounds\en\us\callie\digits\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\ascii\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\32000\*.*" "$(OutDir)sounds\en\us\callie\misc\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\32000\*.*" "$(OutDir)sounds\en\us\callie\currency\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\32000\*.*" "$(OutDir)sounds\en\us\callie\directory\32000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\32000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\32000\*.*" "$(OutDir)sounds\en\us\callie\ivr\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\32000\*.*" "$(OutDir)sounds\en\us\callie\conference\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\32000\*.*" "$(OutDir)sounds\en\us\callie\time\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\32000\*.*" "$(OutDir)sounds\en\us\callie\digits\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\ascii\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\32000\*.*" "$(OutDir)sounds\en\us\callie\misc\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\32000\*.*" "$(OutDir)sounds\en\us\callie\currency\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\32000\*.*" "$(OutDir)sounds\en\us\callie\directory\32000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\32000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\32000\*.*" "$(OutDir)sounds\en\us\callie\ivr\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\32000\*.*" "$(OutDir)sounds\en\us\callie\conference\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\32000\*.*" "$(OutDir)sounds\en\us\callie\time\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\32000\*.*" "$(OutDir)sounds\en\us\callie\digits\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\ascii\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\32000\*.*" "$(OutDir)sounds\en\us\callie\misc\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\32000\*.*" "$(OutDir)sounds\en\us\callie\currency\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\32000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\32000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\32000\*.*" "$(OutDir)sounds\en\us\callie\directory\32000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      {6e49f6c2-adda-4bfb-81fe-ab9af51b455f}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Sound_Files/32khzmusic.2015.vcxproj b/libs/win32/Sound_Files/32khzmusic.2017.vcxproj
similarity index 93%
rename from libs/win32/Sound_Files/32khzmusic.2015.vcxproj
rename to libs/win32/Sound_Files/32khzmusic.2017.vcxproj
index 29edffc562..a25542d716 100644
--- a/libs/win32/Sound_Files/32khzmusic.2015.vcxproj
+++ b/libs/win32/Sound_Files/32khzmusic.2017.vcxproj
@@ -1,114 +1,114 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    32khz music
-    {EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}
-    My32khz music
-    8.1
-  
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\32000\*.*" "$(OutDir)sounds\music\32000" /C /D /Y /S /I
-    
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\32000\*.*" "$(OutDir)sounds\music\32000" /C /D /Y /S /I
-    
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\32000\*.*" "$(OutDir)sounds\music\32000" /C /D /Y /S /I
-    
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\32000\*.*" "$(OutDir)sounds\music\32000" /C /D /Y /S /I
-    
-  
-  
-    
-      {1f0a8a77-e661-418f-bb92-82172ae43803}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    32khz music
+    {EED13FC7-4F81-4E6F-93DB-CDB7DF5CF959}
+    My32khz music
+    8.1
+  
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\32000\*.*" "$(OutDir)sounds\music\32000" /C /D /Y /S /I
+    
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\32000\*.*" "$(OutDir)sounds\music\32000" /C /D /Y /S /I
+    
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\32000\*.*" "$(OutDir)sounds\music\32000" /C /D /Y /S /I
+    
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\32000\*.*" "$(OutDir)sounds\music\32000" /C /D /Y /S /I
+    
+  
+  
+    
+      {1f0a8a77-e661-418f-bb92-82172ae43803}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Sound_Files/8khz.2015.vcxproj b/libs/win32/Sound_Files/8khz.2017.vcxproj
similarity index 95%
rename from libs/win32/Sound_Files/8khz.2015.vcxproj
rename to libs/win32/Sound_Files/8khz.2017.vcxproj
index d868a845f3..eeb84c9a34 100644
--- a/libs/win32/Sound_Files/8khz.2015.vcxproj
+++ b/libs/win32/Sound_Files/8khz.2017.vcxproj
@@ -1,158 +1,158 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    8khz
-    {7A8D8174-B355-4114-AFC1-04777CB9DE0A}
-    Sound_Files
-    8.1
-  
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\8000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\8000\*.*" "$(OutDir)sounds\en\us\callie\ivr\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\8000\*.*" "$(OutDir)sounds\en\us\callie\conference\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\8000\*.*" "$(OutDir)sounds\en\us\callie\time\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\8000\*.*" "$(OutDir)sounds\en\us\callie\digits\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\ascii\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\8000\*.*" "$(OutDir)sounds\en\us\callie\misc\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\8000\*.*" "$(OutDir)sounds\en\us\callie\currency\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\8000\*.*" "$(OutDir)sounds\en\us\callie\directory\8000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\8000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\8000\*.*" "$(OutDir)sounds\en\us\callie\ivr\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\8000\*.*" "$(OutDir)sounds\en\us\callie\conference\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\8000\*.*" "$(OutDir)sounds\en\us\callie\time\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\8000\*.*" "$(OutDir)sounds\en\us\callie\digits\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\ascii\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\8000\*.*" "$(OutDir)sounds\en\us\callie\misc\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\8000\*.*" "$(OutDir)sounds\en\us\callie\currency\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\8000\*.*" "$(OutDir)sounds\en\us\callie\directory\8000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\8000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\8000\*.*" "$(OutDir)sounds\en\us\callie\ivr\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\8000\*.*" "$(OutDir)sounds\en\us\callie\conference\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\8000\*.*" "$(OutDir)sounds\en\us\callie\time\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\8000\*.*" "$(OutDir)sounds\en\us\callie\digits\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\ascii\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\8000\*.*" "$(OutDir)sounds\en\us\callie\misc\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\8000\*.*" "$(OutDir)sounds\en\us\callie\currency\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\8000\*.*" "$(OutDir)sounds\en\us\callie\directory\8000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\8000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\8000\*.*" "$(OutDir)sounds\en\us\callie\ivr\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\8000\*.*" "$(OutDir)sounds\en\us\callie\conference\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\8000\*.*" "$(OutDir)sounds\en\us\callie\time\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\8000\*.*" "$(OutDir)sounds\en\us\callie\digits\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\ascii\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\8000\*.*" "$(OutDir)sounds\en\us\callie\misc\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\8000\*.*" "$(OutDir)sounds\en\us\callie\currency\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\8000" /C /D /Y /S /I
-xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\8000\*.*" "$(OutDir)sounds\en\us\callie\directory\8000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      {3ce1dc99-8246-4db1-a709-74f19f08ec67}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    8khz
+    {7A8D8174-B355-4114-AFC1-04777CB9DE0A}
+    Sound_Files
+    8.1
+  
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\8000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\8000\*.*" "$(OutDir)sounds\en\us\callie\ivr\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\8000\*.*" "$(OutDir)sounds\en\us\callie\conference\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\8000\*.*" "$(OutDir)sounds\en\us\callie\time\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\8000\*.*" "$(OutDir)sounds\en\us\callie\digits\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\ascii\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\8000\*.*" "$(OutDir)sounds\en\us\callie\misc\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\8000\*.*" "$(OutDir)sounds\en\us\callie\currency\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\8000\*.*" "$(OutDir)sounds\en\us\callie\directory\8000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\8000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\8000\*.*" "$(OutDir)sounds\en\us\callie\ivr\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\8000\*.*" "$(OutDir)sounds\en\us\callie\conference\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\8000\*.*" "$(OutDir)sounds\en\us\callie\time\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\8000\*.*" "$(OutDir)sounds\en\us\callie\digits\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\ascii\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\8000\*.*" "$(OutDir)sounds\en\us\callie\misc\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\8000\*.*" "$(OutDir)sounds\en\us\callie\currency\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\8000\*.*" "$(OutDir)sounds\en\us\callie\directory\8000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\8000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\8000\*.*" "$(OutDir)sounds\en\us\callie\ivr\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\8000\*.*" "$(OutDir)sounds\en\us\callie\conference\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\8000\*.*" "$(OutDir)sounds\en\us\callie\time\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\8000\*.*" "$(OutDir)sounds\en\us\callie\digits\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\ascii\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\8000\*.*" "$(OutDir)sounds\en\us\callie\misc\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\8000\*.*" "$(OutDir)sounds\en\us\callie\currency\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\8000\*.*" "$(OutDir)sounds\en\us\callie\directory\8000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\voicemail\8000\*.*" "$(OutDir)sounds\en\us\callie\voicemail\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ivr\8000\*.*" "$(OutDir)sounds\en\us\callie\ivr\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\conference\8000\*.*" "$(OutDir)sounds\en\us\callie\conference\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\time\8000\*.*" "$(OutDir)sounds\en\us\callie\time\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\digits\8000\*.*" "$(OutDir)sounds\en\us\callie\digits\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\ascii\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\misc\8000\*.*" "$(OutDir)sounds\en\us\callie\misc\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\currency\8000\*.*" "$(OutDir)sounds\en\us\callie\currency\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\phonetic-ascii\8000\*.*" "$(OutDir)sounds\en\us\callie\phonetic-ascii\8000" /C /D /Y /S /I
+xcopy "$(SolutionDir)libs\sounds\en\us\callie\directory\8000\*.*" "$(OutDir)sounds\en\us\callie\directory\8000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      {3ce1dc99-8246-4db1-a709-74f19f08ec67}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/Sound_Files/8khzmusic.2015.vcxproj b/libs/win32/Sound_Files/8khzmusic.2017.vcxproj
similarity index 93%
rename from libs/win32/Sound_Files/8khzmusic.2015.vcxproj
rename to libs/win32/Sound_Files/8khzmusic.2017.vcxproj
index a41d90a986..77a8569299 100644
--- a/libs/win32/Sound_Files/8khzmusic.2015.vcxproj
+++ b/libs/win32/Sound_Files/8khzmusic.2017.vcxproj
@@ -1,118 +1,118 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    8khz music
-    {D1ABE208-6442-4FB4-9AAD-1677E41BC870}
-    8khz music
-    8.1
-  
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    true
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-    Utility
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(PlatformName)\$(Configuration)\$(ProjectName)\
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\8000\*.*" "$(OutDir)sounds\music\8000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\8000\*.*" "$(OutDir)sounds\music\8000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\8000\*.*" "$(OutDir)sounds\music\8000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      xcopy "$(SolutionDir)libs\sounds\music\8000\*.*" "$(OutDir)sounds\music\8000" /C /D /Y /S /I
-
-    
-  
-  
-    
-      {4f5c9d55-98ef-4256-8311-32d7bd360406}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    8khz music
+    {D1ABE208-6442-4FB4-9AAD-1677E41BC870}
+    8khz music
+    8.1
+  
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    true
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+    Utility
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(PlatformName)\$(Configuration)\$(ProjectName)\
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\8000\*.*" "$(OutDir)sounds\music\8000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\8000\*.*" "$(OutDir)sounds\music\8000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\8000\*.*" "$(OutDir)sounds\music\8000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      xcopy "$(SolutionDir)libs\sounds\music\8000\*.*" "$(OutDir)sounds\music\8000" /C /D /Y /S /I
+
+    
+  
+  
+    
+      {4f5c9d55-98ef-4256-8311-32d7bd360406}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/apr-util/libaprutil.2015.vcxproj b/libs/win32/apr-util/libaprutil.2017.vcxproj
similarity index 98%
rename from libs/win32/apr-util/libaprutil.2015.vcxproj
rename to libs/win32/apr-util/libaprutil.2017.vcxproj
index 7f9a819983..14c92948b3 100644
--- a/libs/win32/apr-util/libaprutil.2015.vcxproj
+++ b/libs/win32/apr-util/libaprutil.2017.vcxproj
@@ -1,960 +1,960 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libaprutil
-    {F057DA7F-79E5-4B00-845C-EF446EF055E3}
-    libaprutil
-  
-  
-  
-    DynamicLibrary
-    false
-    v140
-  
-  
-    DynamicLibrary
-    false
-    v140
-  
-  
-    DynamicLibrary
-    false
-    v140
-  
-  
-    DynamicLibrary
-    false
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    false
-    false
-    false
-    false
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\apr-util\include\apr_ldap.h" type "$(ProjectDir)..\..\apr-util\include\apr_ldap.hw" > "$(ProjectDir)..\..\apr-util\include\apr_ldap.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\..\apr-util\include\apu.hw" > "$(ProjectDir)..\..\apr-util\include\apu.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" > "$(ProjectDir)..\..\apr-util\include\apu_config.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" > "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" > "$(ProjectDir)..\..\apr-util\include\apu_want.h"
-xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
-
-    
-    
-      /EHsc  %(AdditionalOptions)
-      Disabled
-      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr\include;..\..\apr-util\xml\expat\lib;%(AdditionalIncludeDirectories)
-      _DEBUG;APU_DECLARE_EXPORT;APU_USE_SDBM;WIN32;_WINDOWS;%(PreprocessorDefinitions)
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4244;4018;4267;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;APU_VERSION_ONLY;%(PreprocessorDefinitions)
-      0x0409
-      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr-1.2.7\include;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)
-      true
-      %(AdditionalLibraryDirectories)
-      true
-      Windows
-      0x6EE60000
-      false
-      MachineX86
-    
-    
-      true
-    
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\apr-util\include\apr_ldap.h" type "$(ProjectDir)..\..\apr-util\include\apr_ldap.hw" > "$(ProjectDir)..\..\apr-util\include\apr_ldap.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\..\apr-util\include\apu.hw" > "$(ProjectDir)..\..\apr-util\include\apu.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" > "$(ProjectDir)..\..\apr-util\include\apu_config.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" > "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" > "$(ProjectDir)..\..\apr-util\include\apu_want.h"
-xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
-
-    
-    
-      /EHsc  %(AdditionalOptions)
-      Disabled
-      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr\include;..\..\apr-util\xml\expat\lib;%(AdditionalIncludeDirectories)
-      _DEBUG;APU_DECLARE_EXPORT;APU_USE_SDBM;WIN32;_WINDOWS;%(PreprocessorDefinitions)
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4244;4018;4267;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;APU_VERSION_ONLY;%(PreprocessorDefinitions)
-      0x0409
-      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr-1.2.7\include;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)
-      true
-      %(AdditionalLibraryDirectories)
-      true
-      Windows
-      0x6EE60000
-      false
-      MachineX64
-    
-    
-      true
-    
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\apr-util\include\apr_ldap.h" type "$(ProjectDir)..\..\apr-util\include\apr_ldap.hw" > "$(ProjectDir)..\..\apr-util\include\apr_ldap.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\..\apr-util\include\apu.hw" > "$(ProjectDir)..\..\apr-util\include\apu.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" > "$(ProjectDir)..\..\apr-util\include\apu_config.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" > "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" > "$(ProjectDir)..\..\apr-util\include\apu_want.h"
-xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
-
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr\include;..\..\apr-util\xml\expat\lib;%(AdditionalIncludeDirectories)
-      NDEBUG;APU_DECLARE_EXPORT;APU_USE_SDBM;WIN32;_WINDOWS;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4244;4018;4267;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;APU_VERSION_ONLY;%(PreprocessorDefinitions)
-      0x0409
-      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr-1.2.7\include;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)
-      true
-      %(AdditionalLibraryDirectories)
-      true
-      Windows
-      true
-      0x6EE60000
-      false
-      MachineX86
-    
-    
-      true
-    
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\apr-util\include\apr_ldap.h" type "$(ProjectDir)..\..\apr-util\include\apr_ldap.hw" > "$(ProjectDir)..\..\apr-util\include\apr_ldap.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\..\apr-util\include\apu.hw" > "$(ProjectDir)..\..\apr-util\include\apu.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" > "$(ProjectDir)..\..\apr-util\include\apu_config.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" > "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
-if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" > "$(ProjectDir)..\..\apr-util\include\apu_want.h"
-xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
-
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr\include;..\..\apr-util\xml\expat\lib;%(AdditionalIncludeDirectories)
-      NDEBUG;APU_DECLARE_EXPORT;APU_USE_SDBM;WIN32;_WINDOWS;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4244;4018;4267;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;APU_VERSION_ONLY;%(PreprocessorDefinitions)
-      0x0409
-      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr-1.2.7\include;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)
-      true
-      %(AdditionalLibraryDirectories)
-      true
-      Windows
-      true
-      0x6EE60000
-      false
-      MachineX64
-    
-    
-      true
-    
-  
-  
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-  
-  
-    
-      true
-      true
-      true
-      true
-    
-    
-      true
-      true
-      true
-      true
-    
-    
-      true
-      true
-      true
-      true
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-      Creating apr_ldap.h from apr_ldap.hw
-      if not exist ..\..\apr-util\include\apr_ldap.h type ..\..\apr-util\include\apr_ldap.hw > ..\..\apr-util\include\apr_ldap.h
-
-      ..\..\apr-util\include\apr_ldap.h;%(Outputs)
-      Creating apr_ldap.h from apr_ldap.hw
-      if not exist ..\..\apr-util\include\apr_ldap.h type ..\..\apr-util\include\apr_ldap.hw > ..\..\apr-util\include\apr_ldap.h
-
-      ..\..\apr-util\include\apr_ldap.h;%(Outputs)
-      Creating apr_ldap.h from apr_ldap.hw
-      if not exist ..\..\apr-util\include\apr_ldap.h type ..\..\apr-util\include\apr_ldap.hw > ..\..\apr-util\include\apr_ldap.h
-
-      ..\..\apr-util\include\apr_ldap.h;%(Outputs)
-      Creating apr_ldap.h from apr_ldap.hw
-      if not exist ..\..\apr-util\include\apr_ldap.h type ..\..\apr-util\include\apr_ldap.hw > ..\..\apr-util\include\apr_ldap.h
-
-      ..\..\apr-util\include\apr_ldap.h;%(Outputs)
-    
-    
-    
-    
-      Creating apu.h from apu.hw
-      if not exist ..\..\apr-util\include\apu.h type ..\..\apr-util\include\apu.hw > ..\..\apr-util\include\apu.h
-
-      ..\..\apr-util\include\apu.h;%(Outputs)
-      Creating apu.h from apu.hw
-      if not exist ..\..\apr-util\include\apu.h type ..\..\apr-util\include\apu.hw > ..\..\apr-util\include\apu.h
-
-      ..\..\apr-util\include\apu.h;%(Outputs)
-      Creating apu.h from apu.hw
-      if not exist ..\..\apr-util\include\apu.h type ..\..\apr-util\include\apu.hw > ..\..\apr-util\include\apu.h
-
-      ..\..\apr-util\include\apu.h;%(Outputs)
-      Creating apu.h from apu.hw
-      if not exist ..\..\apr-util\include\apu.h type ..\..\apr-util\include\apu.hw > ..\..\apr-util\include\apu.h
-
-      ..\..\apr-util\include\apu.h;%(Outputs)
-    
-    
-    
-      Creating apu_config.h from apu_config.hw
-      if not exist ..\..\apr-util\include\private\apu_config.h type ..\..\apr-util\include\private\apu_config.hw > ..\..\apr-util\include\private\apu_config.h
-
-      ..\..\apr-util\include\private\apu_config.h;%(Outputs)
-      Creating apu_config.h from apu_config.hw
-      if not exist ..\..\apr-util\include\private\apu_config.h type ..\..\apr-util\include\private\apu_config.hw > ..\..\apr-util\include\private\apu_config.h
-
-      ..\..\apr-util\include\private\apu_config.h;%(Outputs)
-      Creating apu_config.h from apu_config.hw
-      if not exist ..\..\apr-util\include\private\apu_config.h type ..\..\apr-util\include\private\apu_config.hw > ..\..\apr-util\include\private\apu_config.h
-
-      ..\..\apr-util\include\private\apu_config.h;%(Outputs)
-      Creating apu_config.h from apu_config.hw
-      if not exist ..\..\apr-util\include\private\apu_config.h type ..\..\apr-util\include\private\apu_config.hw > ..\..\apr-util\include\private\apu_config.h
-
-      ..\..\apr-util\include\private\apu_config.h;%(Outputs)
-    
-    
-    
-      Creating apu_select_dbm.h from apu_select_dbm.hw
-      if not exist ..\..\apr-util\include\private\apu_select_dbm.h type ..\..\apr-util\include\private\apu_select_dbm.hw > ..\..\apr-util\include\private\apu_select_dbm.h
-
-      ..\..\apr-util\include\private\apu_select_dbm.h;%(Outputs)
-      Creating apu_select_dbm.h from apu_select_dbm.hw
-      if not exist ..\..\apr-util\include\private\apu_select_dbm.h type ..\..\apr-util\include\private\apu_select_dbm.hw > ..\..\apr-util\include\private\apu_select_dbm.h
-
-      ..\..\apr-util\include\private\apu_select_dbm.h;%(Outputs)
-      Creating apu_select_dbm.h from apu_select_dbm.hw
-      if not exist ..\..\apr-util\include\private\apu_select_dbm.h type ..\..\apr-util\include\private\apu_select_dbm.hw > ..\..\apr-util\include\private\apu_select_dbm.h
-
-      ..\..\apr-util\include\private\apu_select_dbm.h;%(Outputs)
-      Creating apu_select_dbm.h from apu_select_dbm.hw
-      if not exist ..\..\apr-util\include\private\apu_select_dbm.h type ..\..\apr-util\include\private\apu_select_dbm.hw > ..\..\apr-util\include\private\apu_select_dbm.h
-
-      ..\..\apr-util\include\private\apu_select_dbm.h;%(Outputs)
-    
-    
-    
-    
-      Creating apu_want.h from apu_want.hw
-      if not exist ..\..\apr-util\include\apu_want.h type ..\..\apr-util\include\apu_want.hw > ..\..\apr-util\include\apu_want.h
-
-      ..\..\apr-util\include\apu_want.h;%(Outputs)
-      Creating apu_want.h from apu_want.hw
-      if not exist ..\..\apr-util\include\apu_want.h type ..\..\apr-util\include\apu_want.hw > ..\..\apr-util\include\apu_want.h
-
-      ..\..\apr-util\include\apu_want.h;%(Outputs)
-      Creating apu_want.h from apu_want.hw
-      if not exist ..\..\apr-util\include\apu_want.h type ..\..\apr-util\include\apu_want.hw > ..\..\apr-util\include\apu_want.h
-
-      ..\..\apr-util\include\apu_want.h;%(Outputs)
-      Creating apu_want.h from apu_want.hw
-      if not exist ..\..\apr-util\include\apu_want.h type ..\..\apr-util\include\apu_want.hw > ..\..\apr-util\include\apu_want.h
-
-      ..\..\apr-util\include\apu_want.h;%(Outputs)
-    
-  
-  
-    
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-    
-    
-      {155844c3-ec5f-407f-97a4-a2ddaded9b2f}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libaprutil
+    {F057DA7F-79E5-4B00-845C-EF446EF055E3}
+    libaprutil
+  
+  
+  
+    DynamicLibrary
+    false
+    v141
+  
+  
+    DynamicLibrary
+    false
+    v141
+  
+  
+    DynamicLibrary
+    false
+    v141
+  
+  
+    DynamicLibrary
+    false
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    false
+    false
+    false
+    false
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\apr-util\include\apr_ldap.h" type "$(ProjectDir)..\..\apr-util\include\apr_ldap.hw" > "$(ProjectDir)..\..\apr-util\include\apr_ldap.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\..\apr-util\include\apu.hw" > "$(ProjectDir)..\..\apr-util\include\apu.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" > "$(ProjectDir)..\..\apr-util\include\apu_config.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" > "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" > "$(ProjectDir)..\..\apr-util\include\apu_want.h"
+xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
+
+    
+    
+      /EHsc  %(AdditionalOptions)
+      Disabled
+      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr\include;..\..\apr-util\xml\expat\lib;%(AdditionalIncludeDirectories)
+      _DEBUG;APU_DECLARE_EXPORT;APU_USE_SDBM;WIN32;_WINDOWS;%(PreprocessorDefinitions)
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4244;4018;4267;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;APU_VERSION_ONLY;%(PreprocessorDefinitions)
+      0x0409
+      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr-1.2.7\include;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)
+      true
+      %(AdditionalLibraryDirectories)
+      true
+      Windows
+      0x6EE60000
+      false
+      MachineX86
+    
+    
+      true
+    
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\apr-util\include\apr_ldap.h" type "$(ProjectDir)..\..\apr-util\include\apr_ldap.hw" > "$(ProjectDir)..\..\apr-util\include\apr_ldap.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\..\apr-util\include\apu.hw" > "$(ProjectDir)..\..\apr-util\include\apu.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" > "$(ProjectDir)..\..\apr-util\include\apu_config.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" > "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" > "$(ProjectDir)..\..\apr-util\include\apu_want.h"
+xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
+
+    
+    
+      /EHsc  %(AdditionalOptions)
+      Disabled
+      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr\include;..\..\apr-util\xml\expat\lib;%(AdditionalIncludeDirectories)
+      _DEBUG;APU_DECLARE_EXPORT;APU_USE_SDBM;WIN32;_WINDOWS;%(PreprocessorDefinitions)
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4244;4018;4267;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;APU_VERSION_ONLY;%(PreprocessorDefinitions)
+      0x0409
+      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr-1.2.7\include;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)
+      true
+      %(AdditionalLibraryDirectories)
+      true
+      Windows
+      0x6EE60000
+      false
+      MachineX64
+    
+    
+      true
+    
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\apr-util\include\apr_ldap.h" type "$(ProjectDir)..\..\apr-util\include\apr_ldap.hw" > "$(ProjectDir)..\..\apr-util\include\apr_ldap.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\..\apr-util\include\apu.hw" > "$(ProjectDir)..\..\apr-util\include\apu.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" > "$(ProjectDir)..\..\apr-util\include\apu_config.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" > "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" > "$(ProjectDir)..\..\apr-util\include\apu_want.h"
+xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
+
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr\include;..\..\apr-util\xml\expat\lib;%(AdditionalIncludeDirectories)
+      NDEBUG;APU_DECLARE_EXPORT;APU_USE_SDBM;WIN32;_WINDOWS;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4244;4018;4267;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;APU_VERSION_ONLY;%(PreprocessorDefinitions)
+      0x0409
+      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr-1.2.7\include;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)
+      true
+      %(AdditionalLibraryDirectories)
+      true
+      Windows
+      true
+      0x6EE60000
+      false
+      MachineX86
+    
+    
+      true
+    
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\apr-util\include\apr_ldap.h" type "$(ProjectDir)..\..\apr-util\include\apr_ldap.hw" > "$(ProjectDir)..\..\apr-util\include\apr_ldap.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu.h" type "$(ProjectDir)..\..\apr-util\include\apu.hw" > "$(ProjectDir)..\..\apr-util\include\apu.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_config.h" type "$(ProjectDir)..\..\apr-util\include\apu_config.hw" > "$(ProjectDir)..\..\apr-util\include\apu_config.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h" type "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.hw" > "$(ProjectDir)..\..\apr-util\include\apu_select_dbm.h"
+if not exist "$(ProjectDir)..\..\apr-util\include\apu_want.h" type "$(ProjectDir)..\..\apr-util\include\apu_want.hw" > "$(ProjectDir)..\..\apr-util\include\apu_want.h"
+xcopy "$(ProjectDir)..\..\apr-util\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
+
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr\include;..\..\apr-util\xml\expat\lib;%(AdditionalIncludeDirectories)
+      NDEBUG;APU_DECLARE_EXPORT;APU_USE_SDBM;WIN32;_WINDOWS;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4244;4018;4267;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;APU_VERSION_ONLY;%(PreprocessorDefinitions)
+      0x0409
+      ..\..\apr-util\include;..\..\apr-util\include/private;..\..\apr-util\dbm/sdbm;..\..\apr-iconv-1.1.1\include;..\..\apr-1.2.7\include;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;mswsock.lib;wldap32.lib;%(AdditionalDependencies)
+      true
+      %(AdditionalLibraryDirectories)
+      true
+      Windows
+      true
+      0x6EE60000
+      false
+      MachineX64
+    
+    
+      true
+    
+  
+  
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+  
+  
+    
+      true
+      true
+      true
+      true
+    
+    
+      true
+      true
+      true
+      true
+    
+    
+      true
+      true
+      true
+      true
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+      Creating apr_ldap.h from apr_ldap.hw
+      if not exist ..\..\apr-util\include\apr_ldap.h type ..\..\apr-util\include\apr_ldap.hw > ..\..\apr-util\include\apr_ldap.h
+
+      ..\..\apr-util\include\apr_ldap.h;%(Outputs)
+      Creating apr_ldap.h from apr_ldap.hw
+      if not exist ..\..\apr-util\include\apr_ldap.h type ..\..\apr-util\include\apr_ldap.hw > ..\..\apr-util\include\apr_ldap.h
+
+      ..\..\apr-util\include\apr_ldap.h;%(Outputs)
+      Creating apr_ldap.h from apr_ldap.hw
+      if not exist ..\..\apr-util\include\apr_ldap.h type ..\..\apr-util\include\apr_ldap.hw > ..\..\apr-util\include\apr_ldap.h
+
+      ..\..\apr-util\include\apr_ldap.h;%(Outputs)
+      Creating apr_ldap.h from apr_ldap.hw
+      if not exist ..\..\apr-util\include\apr_ldap.h type ..\..\apr-util\include\apr_ldap.hw > ..\..\apr-util\include\apr_ldap.h
+
+      ..\..\apr-util\include\apr_ldap.h;%(Outputs)
+    
+    
+    
+    
+      Creating apu.h from apu.hw
+      if not exist ..\..\apr-util\include\apu.h type ..\..\apr-util\include\apu.hw > ..\..\apr-util\include\apu.h
+
+      ..\..\apr-util\include\apu.h;%(Outputs)
+      Creating apu.h from apu.hw
+      if not exist ..\..\apr-util\include\apu.h type ..\..\apr-util\include\apu.hw > ..\..\apr-util\include\apu.h
+
+      ..\..\apr-util\include\apu.h;%(Outputs)
+      Creating apu.h from apu.hw
+      if not exist ..\..\apr-util\include\apu.h type ..\..\apr-util\include\apu.hw > ..\..\apr-util\include\apu.h
+
+      ..\..\apr-util\include\apu.h;%(Outputs)
+      Creating apu.h from apu.hw
+      if not exist ..\..\apr-util\include\apu.h type ..\..\apr-util\include\apu.hw > ..\..\apr-util\include\apu.h
+
+      ..\..\apr-util\include\apu.h;%(Outputs)
+    
+    
+    
+      Creating apu_config.h from apu_config.hw
+      if not exist ..\..\apr-util\include\private\apu_config.h type ..\..\apr-util\include\private\apu_config.hw > ..\..\apr-util\include\private\apu_config.h
+
+      ..\..\apr-util\include\private\apu_config.h;%(Outputs)
+      Creating apu_config.h from apu_config.hw
+      if not exist ..\..\apr-util\include\private\apu_config.h type ..\..\apr-util\include\private\apu_config.hw > ..\..\apr-util\include\private\apu_config.h
+
+      ..\..\apr-util\include\private\apu_config.h;%(Outputs)
+      Creating apu_config.h from apu_config.hw
+      if not exist ..\..\apr-util\include\private\apu_config.h type ..\..\apr-util\include\private\apu_config.hw > ..\..\apr-util\include\private\apu_config.h
+
+      ..\..\apr-util\include\private\apu_config.h;%(Outputs)
+      Creating apu_config.h from apu_config.hw
+      if not exist ..\..\apr-util\include\private\apu_config.h type ..\..\apr-util\include\private\apu_config.hw > ..\..\apr-util\include\private\apu_config.h
+
+      ..\..\apr-util\include\private\apu_config.h;%(Outputs)
+    
+    
+    
+      Creating apu_select_dbm.h from apu_select_dbm.hw
+      if not exist ..\..\apr-util\include\private\apu_select_dbm.h type ..\..\apr-util\include\private\apu_select_dbm.hw > ..\..\apr-util\include\private\apu_select_dbm.h
+
+      ..\..\apr-util\include\private\apu_select_dbm.h;%(Outputs)
+      Creating apu_select_dbm.h from apu_select_dbm.hw
+      if not exist ..\..\apr-util\include\private\apu_select_dbm.h type ..\..\apr-util\include\private\apu_select_dbm.hw > ..\..\apr-util\include\private\apu_select_dbm.h
+
+      ..\..\apr-util\include\private\apu_select_dbm.h;%(Outputs)
+      Creating apu_select_dbm.h from apu_select_dbm.hw
+      if not exist ..\..\apr-util\include\private\apu_select_dbm.h type ..\..\apr-util\include\private\apu_select_dbm.hw > ..\..\apr-util\include\private\apu_select_dbm.h
+
+      ..\..\apr-util\include\private\apu_select_dbm.h;%(Outputs)
+      Creating apu_select_dbm.h from apu_select_dbm.hw
+      if not exist ..\..\apr-util\include\private\apu_select_dbm.h type ..\..\apr-util\include\private\apu_select_dbm.hw > ..\..\apr-util\include\private\apu_select_dbm.h
+
+      ..\..\apr-util\include\private\apu_select_dbm.h;%(Outputs)
+    
+    
+    
+    
+      Creating apu_want.h from apu_want.hw
+      if not exist ..\..\apr-util\include\apu_want.h type ..\..\apr-util\include\apu_want.hw > ..\..\apr-util\include\apu_want.h
+
+      ..\..\apr-util\include\apu_want.h;%(Outputs)
+      Creating apu_want.h from apu_want.hw
+      if not exist ..\..\apr-util\include\apu_want.h type ..\..\apr-util\include\apu_want.hw > ..\..\apr-util\include\apu_want.h
+
+      ..\..\apr-util\include\apu_want.h;%(Outputs)
+      Creating apu_want.h from apu_want.hw
+      if not exist ..\..\apr-util\include\apu_want.h type ..\..\apr-util\include\apu_want.hw > ..\..\apr-util\include\apu_want.h
+
+      ..\..\apr-util\include\apu_want.h;%(Outputs)
+      Creating apu_want.h from apu_want.hw
+      if not exist ..\..\apr-util\include\apu_want.h type ..\..\apr-util\include\apu_want.hw > ..\..\apr-util\include\apu_want.h
+
+      ..\..\apr-util\include\apu_want.h;%(Outputs)
+    
+  
+  
+    
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+    
+    
+      {155844c3-ec5f-407f-97a4-a2ddaded9b2f}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/apr-util/xml.2015.vcxproj b/libs/win32/apr-util/xml.2017.vcxproj
similarity index 97%
rename from libs/win32/apr-util/xml.2015.vcxproj
rename to libs/win32/apr-util/xml.2017.vcxproj
index 0462a640c1..e9815d300e 100644
--- a/libs/win32/apr-util/xml.2015.vcxproj
+++ b/libs/win32/apr-util/xml.2017.vcxproj
@@ -1,289 +1,289 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    xml
-    {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
-    xml
-  
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    true
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\xml\$(Configuration)\
-    $(PlatformName)\xml\$(Configuration)\
-    $(PlatformName)\xml\$(Configuration)\
-    $(PlatformName)\xml\$(Configuration)\
-  
-  
-    
-      MaxSpeed
-      OnlyExplicitInline
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_WINDOWS;VERSION="expat_1.95.2";%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4244;%(DisableSpecificWarnings)
-    
-    
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_WINDOWS;VERSION="expat_1.95.2";%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4244;%(DisableSpecificWarnings)
-    
-    
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-      /EHsc  %(AdditionalOptions)
-      Disabled
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;VERSION="expat_1.95.2";%(PreprocessorDefinitions)
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4244;%(DisableSpecificWarnings)
-    
-    
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      /EHsc  %(AdditionalOptions)
-      Disabled
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;VERSION="expat_1.95.2";%(PreprocessorDefinitions)
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4244;%(DisableSpecificWarnings)
-    
-    
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-      Creating config.h from winconfig.h
-      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\winconfig.h" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h"
-
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\config.h;%(Outputs)
-      Creating config.h from winconfig.h
-      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\winconfig.h" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h"
-
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\config.h;%(Outputs)
-      Creating config.h from winconfig.h
-      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\winconfig.h" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h"
-
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\config.h;%(Outputs)
-      Creating config.h from winconfig.h
-      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\winconfig.h" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h"
-
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\config.h;%(Outputs)
-    
-  
-  
-    
-      Creating expat.h from expat.h.in
-      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h.in" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h"
-
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h;%(Outputs)
-      Creating expat.h from expat.h.in
-      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h.in" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h"
-
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h;%(Outputs)
-      Creating expat.h from expat.h.in
-      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h.in" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h"
-
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h;%(Outputs)
-      Creating expat.h from expat.h.in
-      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h.in" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h"
-
-      $(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h;%(Outputs)
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    xml
+    {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
+    xml
+  
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    true
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\xml\$(Configuration)\
+    $(PlatformName)\xml\$(Configuration)\
+    $(PlatformName)\xml\$(Configuration)\
+    $(PlatformName)\xml\$(Configuration)\
+  
+  
+    
+      MaxSpeed
+      OnlyExplicitInline
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_WINDOWS;VERSION="expat_1.95.2";%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4244;%(DisableSpecificWarnings)
+    
+    
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_WINDOWS;VERSION="expat_1.95.2";%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4244;%(DisableSpecificWarnings)
+    
+    
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+      /EHsc  %(AdditionalOptions)
+      Disabled
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;VERSION="expat_1.95.2";%(PreprocessorDefinitions)
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4244;%(DisableSpecificWarnings)
+    
+    
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      /EHsc  %(AdditionalOptions)
+      Disabled
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;VERSION="expat_1.95.2";%(PreprocessorDefinitions)
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4244;%(DisableSpecificWarnings)
+    
+    
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+      Creating config.h from winconfig.h
+      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\winconfig.h" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h"
+
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\config.h;%(Outputs)
+      Creating config.h from winconfig.h
+      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\winconfig.h" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h"
+
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\config.h;%(Outputs)
+      Creating config.h from winconfig.h
+      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\winconfig.h" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h"
+
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\config.h;%(Outputs)
+      Creating config.h from winconfig.h
+      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\winconfig.h" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\config.h"
+
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\config.h;%(Outputs)
+    
+  
+  
+    
+      Creating expat.h from expat.h.in
+      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h.in" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h"
+
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h;%(Outputs)
+      Creating expat.h from expat.h.in
+      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h.in" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h"
+
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h;%(Outputs)
+      Creating expat.h from expat.h.in
+      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h.in" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h"
+
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h;%(Outputs)
+      Creating expat.h from expat.h.in
+      if not exist "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h" type "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h.in" > "$(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h"
+
+      $(ProjectDir)..\..\apr-util\xml\expat\lib\expat.h;%(Outputs)
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/apr/libapr.2015.vcxproj b/libs/win32/apr/libapr.2017.vcxproj
similarity index 97%
rename from libs/win32/apr/libapr.2015.vcxproj
rename to libs/win32/apr/libapr.2017.vcxproj
index d2e6efd656..a6ffecf1b7 100644
--- a/libs/win32/apr/libapr.2015.vcxproj
+++ b/libs/win32/apr/libapr.2017.vcxproj
@@ -1,343 +1,343 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libapr
-    {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
-    libapr
-  
-  
-  
-    DynamicLibrary
-    false
-    v140
-  
-  
-    DynamicLibrary
-    false
-    v140
-  
-  
-    DynamicLibrary
-    false
-    v140
-  
-  
-    DynamicLibrary
-    false
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    false
-    false
-    false
-    false
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" > "$(ProjectDir)..\..\apr\include\apr.h"
-xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
-
-    
-    
-      /EHsc  %(AdditionalOptions)
-      Disabled
-      ..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)
-      _DEBUG;APR_DECLARE_EXPORT;WIN32;_WINDOWS;%(PreprocessorDefinitions)
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4311;4313;4477;4244;4018;4267;4090;4133;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;APR_VERSION_ONLY;%(PreprocessorDefinitions)
-      0x0409
-      ..\..\apr\include;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)
-      true
-      true
-      Windows
-      0x6EEC0000
-      false
-      
-      
-      MachineX86
-    
-    
-      true
-    
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" > "$(ProjectDir)..\..\apr\include\apr.h"
-xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
-
-    
-    
-      /EHsc  %(AdditionalOptions)
-      Disabled
-      ..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)
-      _DEBUG;APR_DECLARE_EXPORT;APR_VOID_P_IS_QUAD;WIN32;_WINDOWS;%(PreprocessorDefinitions)
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4311;4312;4313;4477;4244;4018;4267;4090;4133;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;APR_VERSION_ONLY;%(PreprocessorDefinitions)
-      0x0409
-      ..\..\apr\include;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)
-      true
-      true
-      Windows
-      0x6EEC0000
-      false
-      MachineX64
-    
-    
-      true
-    
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" > "$(ProjectDir)..\..\apr\include\apr.h"
-xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
-
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)
-      NDEBUG;APR_DECLARE_EXPORT;WIN32;_WINDOWS;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4311;4313;4477;4244;4018;4267;4090;4133;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;APR_VERSION_ONLY;%(PreprocessorDefinitions)
-      0x0409
-      ..\..\apr\;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)
-      true
-      true
-      Windows
-      true
-      0x6EEC0000
-      false
-      MachineX86
-    
-    
-      true
-    
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" > "$(ProjectDir)..\..\apr\include\apr.h"
-xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
-
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)
-      NDEBUG;APR_DECLARE_EXPORT;APR_VOID_P_IS_QUAD;WIN32;_WINDOWS;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4311;4312;4313;4477;4244;4018;4267;4090;4133;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;APR_VERSION_ONLY;%(PreprocessorDefinitions)
-      0x0409
-      ..\..\apr\;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)
-      true
-      true
-      Windows
-      true
-      0x6EEC0000
-      false
-      MachineX64
-    
-    
-      true
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      ..\..\apr\include;%(AdditionalIncludeDirectories)
-      ..\..\apr\include;%(AdditionalIncludeDirectories)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libapr
+    {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
+    libapr
+  
+  
+  
+    DynamicLibrary
+    false
+    v141
+  
+  
+    DynamicLibrary
+    false
+    v141
+  
+  
+    DynamicLibrary
+    false
+    v141
+  
+  
+    DynamicLibrary
+    false
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    false
+    false
+    false
+    false
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" > "$(ProjectDir)..\..\apr\include\apr.h"
+xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
+
+    
+    
+      /EHsc  %(AdditionalOptions)
+      Disabled
+      ..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)
+      _DEBUG;APR_DECLARE_EXPORT;WIN32;_WINDOWS;%(PreprocessorDefinitions)
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4311;4313;4477;4244;4018;4267;4090;4133;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;APR_VERSION_ONLY;%(PreprocessorDefinitions)
+      0x0409
+      ..\..\apr\include;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)
+      true
+      true
+      Windows
+      0x6EEC0000
+      false
+      
+      
+      MachineX86
+    
+    
+      true
+    
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" > "$(ProjectDir)..\..\apr\include\apr.h"
+xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
+
+    
+    
+      /EHsc  %(AdditionalOptions)
+      Disabled
+      ..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)
+      _DEBUG;APR_DECLARE_EXPORT;APR_VOID_P_IS_QUAD;WIN32;_WINDOWS;%(PreprocessorDefinitions)
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4311;4312;4313;4477;4244;4018;4267;4090;4133;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;APR_VERSION_ONLY;%(PreprocessorDefinitions)
+      0x0409
+      ..\..\apr\include;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)
+      true
+      true
+      Windows
+      0x6EEC0000
+      false
+      MachineX64
+    
+    
+      true
+    
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" > "$(ProjectDir)..\..\apr\include\apr.h"
+xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
+
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)
+      NDEBUG;APR_DECLARE_EXPORT;WIN32;_WINDOWS;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4311;4313;4477;4244;4018;4267;4090;4133;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;APR_VERSION_ONLY;%(PreprocessorDefinitions)
+      0x0409
+      ..\..\apr\;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)
+      true
+      true
+      Windows
+      true
+      0x6EEC0000
+      false
+      MachineX86
+    
+    
+      true
+    
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\apr\include\apr.h" type "$(ProjectDir)apr.hw" > "$(ProjectDir)..\..\apr\include\apr.h"
+xcopy "$(ProjectDir)..\..\apr\include\*.h" "$(ProjectDir)..\..\include\" /C /D /Y
+
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\..\apr\include;..\..\apr\include/arch;..\..\apr\include/arch/win32;..\..\apr\include/arch/unix;%(AdditionalIncludeDirectories)
+      NDEBUG;APR_DECLARE_EXPORT;APR_VOID_P_IS_QUAD;WIN32;_WINDOWS;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4311;4312;4313;4477;4244;4018;4267;4090;4133;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;APR_VERSION_ONLY;%(PreprocessorDefinitions)
+      0x0409
+      ..\..\apr\;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;mswsock.lib;rpcrt4.lib;advapi32.lib;%(AdditionalDependencies)
+      true
+      true
+      Windows
+      true
+      0x6EEC0000
+      false
+      MachineX64
+    
+    
+      true
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      ..\..\apr\include;%(AdditionalIncludeDirectories)
+      ..\..\apr\include;%(AdditionalIncludeDirectories)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/broadvoice/libbroadvoice.2015.vcxproj b/libs/win32/broadvoice/libbroadvoice.2017.vcxproj
similarity index 97%
rename from libs/win32/broadvoice/libbroadvoice.2015.vcxproj
rename to libs/win32/broadvoice/libbroadvoice.2017.vcxproj
index 2bd1ef958c..a6da2a5e99 100644
--- a/libs/win32/broadvoice/libbroadvoice.2015.vcxproj
+++ b/libs/win32/broadvoice/libbroadvoice.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -29,23 +29,23 @@
     DynamicLibrary
     Unicode
     true
-    v140
+    v141
   
   
     DynamicLibrary
     Unicode
-    v140
+    v141
   
   
     DynamicLibrary
     Unicode
     true
-    v140
+    v141
   
   
     DynamicLibrary
     Unicode
-    v140
+    v141
   
   
   
@@ -201,7 +201,7 @@
     
   
   
-    
+    
       {46502007-0d94-47ac-a640-c2b5eea98333}
     
   
diff --git a/libs/win32/celt/libcelt.2015.vcxproj b/libs/win32/celt/libcelt.2017.vcxproj
similarity index 94%
rename from libs/win32/celt/libcelt.2015.vcxproj
rename to libs/win32/celt/libcelt.2017.vcxproj
index e01ca96c9f..b66efba609 100644
--- a/libs/win32/celt/libcelt.2015.vcxproj
+++ b/libs/win32/celt/libcelt.2017.vcxproj
@@ -1,157 +1,157 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {ABB71A76-42B0-47A4-973A-42E3D920C6FD}
-    celt
-    Win32Proj
-    libcelt
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      Disabled
-      ..\..\celt-0.10.0\libcelt;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      4305;4267;4101;4554;4018;4244;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      ..\..\celt-0.10.0\libcelt;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;_AMD64_;_WIN64;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      4305;4267;4101;4554;4018;4244;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      MaxSpeed
-      true
-      ..\..\celt-0.10.0\libcelt;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      true
-      Level3
-      4305;4267;4101;4554;4018;4244;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      true
-      ..\..\celt-0.10.0\libcelt;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;_AMD64_;_WIN64;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      true
-      Level3
-      4305;4267;4101;4554;4018;4244;%(DisableSpecificWarnings)
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {fff82f9b-6a2b-4be3-95d8-dc5a4fc71e19}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {ABB71A76-42B0-47A4-973A-42E3D920C6FD}
+    celt
+    Win32Proj
+    libcelt
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      Disabled
+      ..\..\celt-0.10.0\libcelt;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      4305;4267;4101;4554;4018;4244;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      ..\..\celt-0.10.0\libcelt;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;_AMD64_;_WIN64;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      4305;4267;4101;4554;4018;4244;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      MaxSpeed
+      true
+      ..\..\celt-0.10.0\libcelt;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      true
+      Level3
+      4305;4267;4101;4554;4018;4244;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      true
+      ..\..\celt-0.10.0\libcelt;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;_AMD64_;_WIN64;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      true
+      Level3
+      4305;4267;4101;4554;4018;4244;%(DisableSpecificWarnings)
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {fff82f9b-6a2b-4be3-95d8-dc5a4fc71e19}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/freetype/freetype.vcxproj b/libs/win32/freetype/freetype.2017.vcxproj
similarity index 99%
rename from libs/win32/freetype/freetype.vcxproj
rename to libs/win32/freetype/freetype.2017.vcxproj
index 30f76bee3c..629d041817 100644
--- a/libs/win32/freetype/freetype.vcxproj
+++ b/libs/win32/freetype/freetype.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -26,25 +26,25 @@
     StaticLibrary
     false
     MultiByte
-    v140
+    v141
   
   
     StaticLibrary
     false
     MultiByte
-    v140
+    v141
   
   
     StaticLibrary
     false
     MultiByte
-    v140
+    v141
   
   
     StaticLibrary
     false
     MultiByte
-    v140
+    v141
   
   
   
@@ -632,7 +632,7 @@
     
   
   
-    
+    
       {0ad87fda-989f-4638-b6e1-b0132bb0560a}
     
   
diff --git a/libs/win32/iksemel/iksemel.2015.vcxproj b/libs/win32/iksemel/iksemel.2017.vcxproj
similarity index 95%
rename from libs/win32/iksemel/iksemel.2015.vcxproj
rename to libs/win32/iksemel/iksemel.2017.vcxproj
index 28eb1bbe2a..731adf8a4b 100644
--- a/libs/win32/iksemel/iksemel.2015.vcxproj
+++ b/libs/win32/iksemel/iksemel.2017.vcxproj
@@ -1,141 +1,141 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    iksemel
-    {E727E8F6-935D-46FE-8B0E-37834748A0E3}
-    iksemel
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      Disabled
-      ..\..\iksemel\include;.;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;HAVE_SSL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-    
-  
-  
-    
-      ..\..\iksemel\include;.;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;HAVE_SSL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      TurnOffAllWarnings
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      ..\..\iksemel\include;.;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;HAVE_SSL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-    
-  
-  
-    
-      X64
-    
-    
-      ..\..\iksemel\include;.;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;HAVE_SSL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      TurnOffAllWarnings
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    iksemel
+    {E727E8F6-935D-46FE-8B0E-37834748A0E3}
+    iksemel
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      Disabled
+      ..\..\iksemel\include;.;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;HAVE_SSL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+    
+  
+  
+    
+      ..\..\iksemel\include;.;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;HAVE_SSL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      TurnOffAllWarnings
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      ..\..\iksemel\include;.;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;HAVE_SSL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+    
+  
+  
+    
+      X64
+    
+    
+      ..\..\iksemel\include;.;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;HAVE_SSL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      TurnOffAllWarnings
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/ilbc/libilbc.2015.vcxproj b/libs/win32/ilbc/libilbc.2017.vcxproj
similarity index 96%
rename from libs/win32/ilbc/libilbc.2015.vcxproj
rename to libs/win32/ilbc/libilbc.2017.vcxproj
index 41db5cb6f5..e3dec17bb6 100644
--- a/libs/win32/ilbc/libilbc.2015.vcxproj
+++ b/libs/win32/ilbc/libilbc.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -29,23 +29,23 @@
     StaticLibrary
     Unicode
     true
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
     true
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
-    v140
+    v141
   
   
   
@@ -167,7 +167,7 @@
     
   
   
-    
+    
       {53aada60-df12-46ff-bf94-566bbf849336}
     
   
diff --git a/libs/win32/ldns/ldns-lib/ldns-lib.2015.vcxproj b/libs/win32/ldns/ldns-lib/ldns-lib.2017.vcxproj
similarity index 96%
rename from libs/win32/ldns/ldns-lib/ldns-lib.2015.vcxproj
rename to libs/win32/ldns/ldns-lib/ldns-lib.2017.vcxproj
index 1db946397d..92ca65a874 100644
--- a/libs/win32/ldns/ldns-lib/ldns-lib.2015.vcxproj
+++ b/libs/win32/ldns/ldns-lib/ldns-lib.2017.vcxproj
@@ -1,271 +1,271 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    ldns
-    {23B4D303-79FC-49E0-89E2-2280E7E28940}
-    ldns
-  
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.40219.1
-    AllRules.ruleset
-    AllRules.ruleset
-    
-    
-    
-    
-    AllRules.ruleset
-    AllRules.ruleset
-    
-    
-    
-    
-  
-  
-    
-      Disabled
-      ..\..\..\ldns\;.;%(AdditionalIncludeDirectories)
-      HAVE_ISBLANK;HAVE_STRUCT_ADDRINFO;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      ProgramDatabase
-      4013;4101;4996;4267;4244;%(DisableSpecificWarnings)
-    
-    
-      if not exist "$(ProjectDir)..\..\..\ldns\ldns\config.h" type "$(ProjectDir)\config.h" > "$(ProjectDir)..\..\..\ldns\ldns\config.h"
-if not exist "$(ProjectDir)..\..\..\ldns\ldns\util.h" type "$(ProjectDir)\util.h" > "$(ProjectDir)..\..\..\ldns\ldns\util.h"
-if not exist "$(ProjectDir)..\..\..\ldns\ldns\net.h" type "$(ProjectDir)\net.h" > "$(ProjectDir)..\..\..\ldns\ldns\net.h"
-    
-    
-      /ignore:4221 %(AdditionalOptions)
-    
-  
-  
-    
-      Disabled
-      ..\..\..\ldns\;.;%(AdditionalIncludeDirectories)
-      HAVE_ISBLANK;HAVE_STRUCT_ADDRINFO;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      ProgramDatabase
-      4013;4101;4996;4267;4244;%(DisableSpecificWarnings)
-    
-    
-      if not exist "$(ProjectDir)..\..\..\ldns\ldns\config.h" type "$(ProjectDir)\config.h" > "$(ProjectDir)..\..\..\ldns\ldns\config.h"
-if not exist "$(ProjectDir)..\..\..\ldns\ldns\util.h" type "$(ProjectDir)\util.h" > "$(ProjectDir)..\..\..\ldns\ldns\util.h"
-if not exist "$(ProjectDir)..\..\..\ldns\ldns\net.h" type "$(ProjectDir)\net.h" > "$(ProjectDir)..\..\..\ldns\ldns\net.h"
-    
-    
-      /ignore:4221 %(AdditionalOptions)
-    
-  
-  
-    
-      MaxSpeed
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      ProgramDatabase
-      HAVE_ISBLANK;HAVE_STRUCT_ADDRINFO;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;_MBCS;%(PreprocessorDefinitions)
-      ..\..\..\ldns\;.;%(AdditionalIncludeDirectories)
-      4013;4101;4996;4267;4244;%(DisableSpecificWarnings)
-    
-    
-      true
-      true
-      true
-      MachineX86
-    
-    
-      if not exist "$(ProjectDir)..\..\..\ldns\ldns\config.h" type "$(ProjectDir)\config.h" > "$(ProjectDir)..\..\..\ldns\ldns\config.h"
-if not exist "$(ProjectDir)..\..\..\ldns\ldns\util.h" type "$(ProjectDir)\util.h" > "$(ProjectDir)..\..\..\ldns\ldns\util.h"
-if not exist "$(ProjectDir)..\..\..\ldns\ldns\net.h" type "$(ProjectDir)\net.h" > "$(ProjectDir)..\..\..\ldns\ldns\net.h"
-    
-    
-      /ignore:4221 %(AdditionalOptions)
-    
-  
-  
-    
-      MaxSpeed
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      ProgramDatabase
-      HAVE_ISBLANK;HAVE_STRUCT_ADDRINFO;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;_MBCS;%(PreprocessorDefinitions)
-      ..\..\..\ldns\;.;%(AdditionalIncludeDirectories)
-      4013;4101;4996;4267;4244;%(DisableSpecificWarnings)
-    
-    
-      true
-      true
-      true
-      kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
-    
-    
-      if not exist "$(ProjectDir)..\..\..\ldns\ldns\config.h" type "$(ProjectDir)\config.h" > "$(ProjectDir)..\..\..\ldns\ldns\config.h"
-if not exist "$(ProjectDir)..\..\..\ldns\ldns\util.h" type "$(ProjectDir)\util.h" > "$(ProjectDir)..\..\..\ldns\ldns\util.h"
-if not exist "$(ProjectDir)..\..\..\ldns\ldns\net.h" type "$(ProjectDir)\net.h" > "$(ProjectDir)..\..\..\ldns\ldns\net.h"
-    
-    
-      /ignore:4221 %(AdditionalOptions)
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-  
-  
-    
-      {5be9a596-f11f-4379-928c-412f81ae182b}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    ldns
+    {23B4D303-79FC-49E0-89E2-2280E7E28940}
+    ldns
+  
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.40219.1
+    AllRules.ruleset
+    AllRules.ruleset
+    
+    
+    
+    
+    AllRules.ruleset
+    AllRules.ruleset
+    
+    
+    
+    
+  
+  
+    
+      Disabled
+      ..\..\..\ldns\;.;%(AdditionalIncludeDirectories)
+      HAVE_ISBLANK;HAVE_STRUCT_ADDRINFO;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      ProgramDatabase
+      4013;4101;4996;4267;4244;%(DisableSpecificWarnings)
+    
+    
+      if not exist "$(ProjectDir)..\..\..\ldns\ldns\config.h" type "$(ProjectDir)\config.h" > "$(ProjectDir)..\..\..\ldns\ldns\config.h"
+if not exist "$(ProjectDir)..\..\..\ldns\ldns\util.h" type "$(ProjectDir)\util.h" > "$(ProjectDir)..\..\..\ldns\ldns\util.h"
+if not exist "$(ProjectDir)..\..\..\ldns\ldns\net.h" type "$(ProjectDir)\net.h" > "$(ProjectDir)..\..\..\ldns\ldns\net.h"
+    
+    
+      /ignore:4221 %(AdditionalOptions)
+    
+  
+  
+    
+      Disabled
+      ..\..\..\ldns\;.;%(AdditionalIncludeDirectories)
+      HAVE_ISBLANK;HAVE_STRUCT_ADDRINFO;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      ProgramDatabase
+      4013;4101;4996;4267;4244;%(DisableSpecificWarnings)
+    
+    
+      if not exist "$(ProjectDir)..\..\..\ldns\ldns\config.h" type "$(ProjectDir)\config.h" > "$(ProjectDir)..\..\..\ldns\ldns\config.h"
+if not exist "$(ProjectDir)..\..\..\ldns\ldns\util.h" type "$(ProjectDir)\util.h" > "$(ProjectDir)..\..\..\ldns\ldns\util.h"
+if not exist "$(ProjectDir)..\..\..\ldns\ldns\net.h" type "$(ProjectDir)\net.h" > "$(ProjectDir)..\..\..\ldns\ldns\net.h"
+    
+    
+      /ignore:4221 %(AdditionalOptions)
+    
+  
+  
+    
+      MaxSpeed
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      ProgramDatabase
+      HAVE_ISBLANK;HAVE_STRUCT_ADDRINFO;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;_MBCS;%(PreprocessorDefinitions)
+      ..\..\..\ldns\;.;%(AdditionalIncludeDirectories)
+      4013;4101;4996;4267;4244;%(DisableSpecificWarnings)
+    
+    
+      true
+      true
+      true
+      MachineX86
+    
+    
+      if not exist "$(ProjectDir)..\..\..\ldns\ldns\config.h" type "$(ProjectDir)\config.h" > "$(ProjectDir)..\..\..\ldns\ldns\config.h"
+if not exist "$(ProjectDir)..\..\..\ldns\ldns\util.h" type "$(ProjectDir)\util.h" > "$(ProjectDir)..\..\..\ldns\ldns\util.h"
+if not exist "$(ProjectDir)..\..\..\ldns\ldns\net.h" type "$(ProjectDir)\net.h" > "$(ProjectDir)..\..\..\ldns\ldns\net.h"
+    
+    
+      /ignore:4221 %(AdditionalOptions)
+    
+  
+  
+    
+      MaxSpeed
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      ProgramDatabase
+      HAVE_ISBLANK;HAVE_STRUCT_ADDRINFO;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;_MBCS;%(PreprocessorDefinitions)
+      ..\..\..\ldns\;.;%(AdditionalIncludeDirectories)
+      4013;4101;4996;4267;4244;%(DisableSpecificWarnings)
+    
+    
+      true
+      true
+      true
+      kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+    
+    
+      if not exist "$(ProjectDir)..\..\..\ldns\ldns\config.h" type "$(ProjectDir)\config.h" > "$(ProjectDir)..\..\..\ldns\ldns\config.h"
+if not exist "$(ProjectDir)..\..\..\ldns\ldns\util.h" type "$(ProjectDir)\util.h" > "$(ProjectDir)..\..\..\ldns\ldns\util.h"
+if not exist "$(ProjectDir)..\..\..\ldns\ldns\net.h" type "$(ProjectDir)\net.h" > "$(ProjectDir)..\..\..\ldns\ldns\net.h"
+    
+    
+      /ignore:4221 %(AdditionalOptions)
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+  
+  
+    
+      {5be9a596-f11f-4379-928c-412f81ae182b}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/libav/libav.2015.vcxproj b/libs/win32/libav/libav.2017.vcxproj
similarity index 99%
rename from libs/win32/libav/libav.2015.vcxproj
rename to libs/win32/libav/libav.2017.vcxproj
index 772bdea162..7a1381e0c4 100644
--- a/libs/win32/libav/libav.2015.vcxproj
+++ b/libs/win32/libav/libav.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -27,27 +27,27 @@
   
   
     StaticLibrary
-    v140
+    v141
     MultiByte
     false
     $(SolutionDir)libs\yasm.exe -f win32 -DPREFIX -I./../../libav/ -P.\..\..\libs\libav\config_x86\config.asm
   
   
     StaticLibrary
-    v140
+    v141
     MultiByte
     $(SolutionDir)libs\yasm.exe -f win32 -DPREFIX -I./../../libav/ -P.\..\..\libs\libav\config_x86\config.asm
   
   
     StaticLibrary
-    v140
+    v141
     MultiByte
     false
     $(SolutionDir)libs\yasm.exe -f x64 -I./../../libav/ -P.\..\..\libs\libav\config_x64\config.asm
   
   
     StaticLibrary
-    v140
+    v141
     MultiByte
     $(SolutionDir)libs\yasm.exe -f x64 -I./../../libav/ -P.\..\..\libs\libav\config_x64\config.asm
   
@@ -1642,10 +1642,10 @@
     
   
   
-    
+    
       {77c9e0a2-177d-4bd6-9efd-75a56f886325}
     
-    
+    
       {20179127-853b-4fe9-b7c0-9e817e6a3a72}
     
   
diff --git a/libs/win32/libcbt/libcbt.2015.vcxproj b/libs/win32/libcbt/libcbt.2017.vcxproj
similarity index 95%
rename from libs/win32/libcbt/libcbt.2015.vcxproj
rename to libs/win32/libcbt/libcbt.2017.vcxproj
index 0a8037c892..356c30f30f 100644
--- a/libs/win32/libcbt/libcbt.2015.vcxproj
+++ b/libs/win32/libcbt/libcbt.2017.vcxproj
@@ -1,168 +1,168 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}
-    libcbt
-  
-  
-  
-    StaticLibrary
-    true
-    v140
-    MultiByte
-  
-  
-    StaticLibrary
-    false
-    v140
-    true
-    MultiByte
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-  
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    .lib
-  
-  
-    
-      NotUsing
-      Level3
-      Disabled
-      _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;%(PreprocessorDefinitions)
-      true
-      $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include
-      4311;4302;4800;4101;4267;%(DisableSpecificWarnings)
-      ProgramDatabase
-    
-    
-      Windows
-      true
-    
-    
-      /ignore:4042 %(AdditionalOptions)
-    
-  
-  
-    
-      NotUsing
-      Level3
-      Disabled
-      _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;%(PreprocessorDefinitions)
-      true
-      $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include
-      4311;4302;4800;4101;4267;%(DisableSpecificWarnings)
-    
-    
-      Windows
-      true
-    
-    
-      /ignore:4042 %(AdditionalOptions)
-    
-  
-  
-    
-      Level3
-      NotUsing
-      MaxSpeed
-      true
-      true
-      _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      true
-      $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include
-      4311;4302;4800;4101;4267;%(DisableSpecificWarnings)
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      /ignore:4042 %(AdditionalOptions)
-    
-  
-  
-    
-      Level3
-      NotUsing
-      MaxSpeed
-      true
-      true
-      _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      true
-      $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include
-      4311;4302;4800;4101;4267;%(DisableSpecificWarnings)
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      /ignore:4042 %(AdditionalOptions)
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    {77BC1DD2-C9A1-44D7-BFFA-1320370CACB9}
+    libcbt
+  
+  
+  
+    StaticLibrary
+    true
+    v141
+    MultiByte
+  
+  
+    StaticLibrary
+    false
+    v141
+    true
+    MultiByte
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+  
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    .lib
+  
+  
+    
+      NotUsing
+      Level3
+      Disabled
+      _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;%(PreprocessorDefinitions)
+      true
+      $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include
+      4311;4302;4800;4101;4267;%(DisableSpecificWarnings)
+      ProgramDatabase
+    
+    
+      Windows
+      true
+    
+    
+      /ignore:4042 %(AdditionalOptions)
+    
+  
+  
+    
+      NotUsing
+      Level3
+      Disabled
+      _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;%(PreprocessorDefinitions)
+      true
+      $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include
+      4311;4302;4800;4101;4267;%(DisableSpecificWarnings)
+    
+    
+      Windows
+      true
+    
+    
+      /ignore:4042 %(AdditionalOptions)
+    
+  
+  
+    
+      Level3
+      NotUsing
+      MaxSpeed
+      true
+      true
+      _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      true
+      $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include
+      4311;4302;4800;4101;4267;%(DisableSpecificWarnings)
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      /ignore:4042 %(AdditionalOptions)
+    
+  
+  
+    
+      Level3
+      NotUsing
+      MaxSpeed
+      true
+      true
+      _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      true
+      $(SolutionDir)src\mod\endpoints\mod_gsmopen\libctb-0.16\include
+      4311;4302;4800;4101;4267;%(DisableSpecificWarnings)
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      /ignore:4042 %(AdditionalOptions)
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/libcodec2/libcodec2.2015.vcxproj b/libs/win32/libcodec2/libcodec2.2017.vcxproj
similarity index 96%
rename from libs/win32/libcodec2/libcodec2.2015.vcxproj
rename to libs/win32/libcodec2/libcodec2.2017.vcxproj
index ff3ffb2af3..986051c822 100644
--- a/libs/win32/libcodec2/libcodec2.2015.vcxproj
+++ b/libs/win32/libcodec2/libcodec2.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -29,23 +29,23 @@
     StaticLibrary
     Unicode
     true
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
     true
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
-    v140
+    v141
   
   
   
@@ -171,7 +171,7 @@ xcopy "$(ProjectDir)generated\*" "$(libcodec2LibDir)\src\" /C /D /Y
     
   
   
-    
+    
       {9cfa562c-c611-48a7-90a2-bb031b47fe6d}
     
   
diff --git a/libs/win32/libg722_1/libg722_1.2015.vcxproj b/libs/win32/libg722_1/libg722_1.2017.vcxproj
similarity index 94%
rename from libs/win32/libg722_1/libg722_1.2015.vcxproj
rename to libs/win32/libg722_1/libg722_1.2017.vcxproj
index e652a92726..e272f5e73c 100644
--- a/libs/win32/libg722_1/libg722_1.2015.vcxproj
+++ b/libs/win32/libg722_1/libg722_1.2017.vcxproj
@@ -1,159 +1,159 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}
-    libg722_1
-    Win32Proj
-    libg722_1
-  
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      Disabled
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBG722_1_EXPORTS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-    
-  
-  
-    
-      MaxSpeed
-      true
-      WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBG722_1_EXPORTS;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      true
-      Level3
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBG722_1_EXPORTS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      true
-      WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBG722_1_EXPORTS;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      true
-      Level3
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {36603fe1-253f-4c2c-aab6-12927a626135}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {1BC8A8EC-E03B-44DF-BCD9-088650F4D29C}
+    libg722_1
+    Win32Proj
+    libg722_1
+  
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      Disabled
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBG722_1_EXPORTS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+    
+  
+  
+    
+      MaxSpeed
+      true
+      WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBG722_1_EXPORTS;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      true
+      Level3
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBG722_1_EXPORTS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      true
+      WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBG722_1_EXPORTS;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      true
+      Level3
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {36603fe1-253f-4c2c-aab6-12927a626135}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/libjpeg/libjpeg.2015.vcxproj b/libs/win32/libjpeg/libjpeg.2017.vcxproj
similarity index 96%
rename from libs/win32/libjpeg/libjpeg.2015.vcxproj
rename to libs/win32/libjpeg/libjpeg.2017.vcxproj
index b968786823..7ab8df590a 100644
--- a/libs/win32/libjpeg/libjpeg.2015.vcxproj
+++ b/libs/win32/libjpeg/libjpeg.2017.vcxproj
@@ -1,245 +1,245 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-      Disabled
-      Disabled
-      Disabled
-      Disabled
-      false
-      false
-      false
-      false
-    
-  
-  
-    libjpeg
-    {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}
-    Win32Proj
-    libjpeg
-  
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-  
-    
-      Level3
-      NotUsing
-      Full
-      true
-      false
-      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS
-      true
-      true
-      ..\..\jpeg-8d;%(AdditionalIncludeDirectories)
-      4267;%(DisableSpecificWarnings)
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      if not exist "$(ProjectDir)..\..\jpeg-8d\jconfig.h" type "$(ProjectDir)..\..\jpeg-8d\jconfig.vc" > "$(ProjectDir)..\..\jpeg-8d\jconfig.h"
-    
-  
-  
-    
-      Level3
-      NotUsing
-      Full
-      true
-      false
-      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS
-      true
-      true
-      ..\..\jpeg-8d;%(AdditionalIncludeDirectories)
-      4267;%(DisableSpecificWarnings)
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      if not exist "$(ProjectDir)..\..\jpeg-8d\jconfig.h" type "$(ProjectDir)..\..\jpeg-8d\jconfig.vc" > "$(ProjectDir)..\..\jpeg-8d\jconfig.h"
-    
-  
-  
-    
-      Level3
-      NotUsing
-      true
-      false
-      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS
-      true
-      true
-      ..\..\jpeg-8d;%(AdditionalIncludeDirectories)
-      false
-      Disabled
-      4267;%(DisableSpecificWarnings)
-      MultiThreadedDebugDLL
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      if not exist "$(ProjectDir)..\..\jpeg-8d\jconfig.h" type "$(ProjectDir)..\..\jpeg-8d\jconfig.vc" > "$(ProjectDir)..\..\jpeg-8d\jconfig.h"
-    
-  
-  
-    
-      Level3
-      NotUsing
-      Disabled
-      true
-      false
-      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS
-      
-      
-      false
-      ..\..\jpeg-8d;%(AdditionalIncludeDirectories)
-      false
-      MultiThreadedDebugDLL
-      4267;%(DisableSpecificWarnings)
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      if not exist "$(ProjectDir)..\..\jpeg-8d\jconfig.h" type "$(ProjectDir)..\..\jpeg-8d\jconfig.vc" > "$(ProjectDir)..\..\jpeg-8d\jconfig.h"
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+      Disabled
+      Disabled
+      Disabled
+      Disabled
+      false
+      false
+      false
+      false
+    
+  
+  
+    libjpeg
+    {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}
+    Win32Proj
+    libjpeg
+  
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+  
+    
+      Level3
+      NotUsing
+      Full
+      true
+      false
+      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS
+      true
+      true
+      ..\..\jpeg-8d;%(AdditionalIncludeDirectories)
+      4267;%(DisableSpecificWarnings)
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      if not exist "$(ProjectDir)..\..\jpeg-8d\jconfig.h" type "$(ProjectDir)..\..\jpeg-8d\jconfig.vc" > "$(ProjectDir)..\..\jpeg-8d\jconfig.h"
+    
+  
+  
+    
+      Level3
+      NotUsing
+      Full
+      true
+      false
+      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS
+      true
+      true
+      ..\..\jpeg-8d;%(AdditionalIncludeDirectories)
+      4267;%(DisableSpecificWarnings)
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      if not exist "$(ProjectDir)..\..\jpeg-8d\jconfig.h" type "$(ProjectDir)..\..\jpeg-8d\jconfig.vc" > "$(ProjectDir)..\..\jpeg-8d\jconfig.h"
+    
+  
+  
+    
+      Level3
+      NotUsing
+      true
+      false
+      WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS
+      true
+      true
+      ..\..\jpeg-8d;%(AdditionalIncludeDirectories)
+      false
+      Disabled
+      4267;%(DisableSpecificWarnings)
+      MultiThreadedDebugDLL
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      if not exist "$(ProjectDir)..\..\jpeg-8d\jconfig.h" type "$(ProjectDir)..\..\jpeg-8d\jconfig.vc" > "$(ProjectDir)..\..\jpeg-8d\jconfig.h"
+    
+  
+  
+    
+      Level3
+      NotUsing
+      Disabled
+      true
+      false
+      WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS
+      
+      
+      false
+      ..\..\jpeg-8d;%(AdditionalIncludeDirectories)
+      false
+      MultiThreadedDebugDLL
+      4267;%(DisableSpecificWarnings)
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      if not exist "$(ProjectDir)..\..\jpeg-8d\jconfig.h" type "$(ProjectDir)..\..\jpeg-8d\jconfig.vc" > "$(ProjectDir)..\..\jpeg-8d\jconfig.h"
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/libmp3lame/libmp3lame.2015.vcxproj b/libs/win32/libmp3lame/libmp3lame.2017.vcxproj
similarity index 98%
rename from libs/win32/libmp3lame/libmp3lame.2015.vcxproj
rename to libs/win32/libmp3lame/libmp3lame.2017.vcxproj
index 24817dd1a7..9074fc38c8 100644
--- a/libs/win32/libmp3lame/libmp3lame.2015.vcxproj
+++ b/libs/win32/libmp3lame/libmp3lame.2017.vcxproj
@@ -1,478 +1,478 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libmp3lame
-    {E316772F-5D8F-4F2A-8F71-094C3E859D34}
-    libmp3lame
-  
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      /GAy %(AdditionalOptions)
-      MaxSpeed
-      .;..\..\lame-3.98.4;..\..\lame-3.98.4\include;%(AdditionalIncludeDirectories)
-      NDEBUG;_WINDOWS;WIN32;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      MultiThreaded
-      true
-      TurnOffAllWarnings
-      true
-    
-    
-      0x0409
-    
-    
-      $(OutDir)libmp3lame.lib
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      /GAy %(AdditionalOptions)
-      MaxSpeed
-      .;..\..\lame-3.98.4;..\..\lame-3.98.4\include;%(AdditionalIncludeDirectories)
-      NDEBUG;_WINDOWS;WIN32;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      MultiThreaded
-      true
-      TurnOffAllWarnings
-      true
-    
-    
-      0x0409
-    
-    
-      $(OutDir)libmp3lame.lib
-      true
-    
-  
-  
-    
-      Disabled
-      .;..\..\lame-3.98.4;..\..\lame-3.98.4\include;%(AdditionalIncludeDirectories)
-      _DEBUG;_WINDOWS;WIN32;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      MultiThreadedDebug
-      TurnOffAllWarnings
-      true
-    
-    
-      0x0409
-    
-    
-      $(OutDir)libmp3lame.lib
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      .;..\..\lame-3.98.4;..\..\lame-3.98.4\include;%(AdditionalIncludeDirectories)
-      _DEBUG;_WINDOWS;WIN32;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      MultiThreadedDebug
-      TurnOffAllWarnings
-      true
-    
-    
-      0x0409
-    
-    
-      $(OutDir)libmp3lame.lib
-      true
-    
-  
-  
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Level1
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Level1
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Level1
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Level1
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      Disabled
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MaxSpeed
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {d5d2bf72-29fe-4982-a9fa-82ab2086db1b}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libmp3lame
+    {E316772F-5D8F-4F2A-8F71-094C3E859D34}
+    libmp3lame
+  
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      /GAy %(AdditionalOptions)
+      MaxSpeed
+      .;..\..\lame-3.98.4;..\..\lame-3.98.4\include;%(AdditionalIncludeDirectories)
+      NDEBUG;_WINDOWS;WIN32;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      MultiThreaded
+      true
+      TurnOffAllWarnings
+      true
+    
+    
+      0x0409
+    
+    
+      $(OutDir)libmp3lame.lib
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      /GAy %(AdditionalOptions)
+      MaxSpeed
+      .;..\..\lame-3.98.4;..\..\lame-3.98.4\include;%(AdditionalIncludeDirectories)
+      NDEBUG;_WINDOWS;WIN32;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      MultiThreaded
+      true
+      TurnOffAllWarnings
+      true
+    
+    
+      0x0409
+    
+    
+      $(OutDir)libmp3lame.lib
+      true
+    
+  
+  
+    
+      Disabled
+      .;..\..\lame-3.98.4;..\..\lame-3.98.4\include;%(AdditionalIncludeDirectories)
+      _DEBUG;_WINDOWS;WIN32;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      MultiThreadedDebug
+      TurnOffAllWarnings
+      true
+    
+    
+      0x0409
+    
+    
+      $(OutDir)libmp3lame.lib
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      .;..\..\lame-3.98.4;..\..\lame-3.98.4\include;%(AdditionalIncludeDirectories)
+      _DEBUG;_WINDOWS;WIN32;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      MultiThreadedDebug
+      TurnOffAllWarnings
+      true
+    
+    
+      0x0409
+    
+    
+      $(OutDir)libmp3lame.lib
+      true
+    
+  
+  
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Level1
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Level1
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Level1
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Level1
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      Disabled
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MaxSpeed
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {d5d2bf72-29fe-4982-a9fa-82ab2086db1b}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/libogg/libogg.2015.vcxproj b/libs/win32/libogg/libogg.2017.vcxproj
similarity index 95%
rename from libs/win32/libogg/libogg.2015.vcxproj
rename to libs/win32/libogg/libogg.2017.vcxproj
index 7b3d1d737e..58ab9e4dfd 100644
--- a/libs/win32/libogg/libogg.2015.vcxproj
+++ b/libs/win32/libogg/libogg.2017.vcxproj
@@ -1,209 +1,209 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libogg
-    {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}
-    libogg
-  
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\..\libogg-1.1.3\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      true
-      MultiThreaded
-      true
-      TurnOffAllWarnings
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      $(OutDir)libogg.lib
-      true
-    
-    
-      true
-      .\Static_Release/ogg_static.bsc
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\..\libogg-1.1.3\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      true
-      MultiThreaded
-      true
-      TurnOffAllWarnings
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      $(OutDir)libogg.lib
-      true
-    
-    
-      true
-      .\Static_Release/ogg_static.bsc
-    
-  
-  
-    
-      Disabled
-      ..\..\libogg-1.1.3\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebug
-      TurnOffAllWarnings
-      true
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      $(OutDir)libogg.lib
-      true
-    
-    
-      true
-      .\Static_Debug/ogg_static.bsc
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      ..\..\libogg-1.1.3\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebug
-      TurnOffAllWarnings
-      true
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      $(OutDir)libogg.lib
-      true
-    
-    
-      true
-      .\Static_Debug/ogg_static.bsc
-    
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-  
-  
-    
-    
-  
-  
-    
-      {d5d2bf72-29fe-4982-a9fa-82ab1086db1b}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libogg
+    {0FEEAEC6-4399-4C46-B7DB-62ECE80D15B4}
+    libogg
+  
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\..\libogg-1.1.3\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      true
+      MultiThreaded
+      true
+      TurnOffAllWarnings
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      $(OutDir)libogg.lib
+      true
+    
+    
+      true
+      .\Static_Release/ogg_static.bsc
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\..\libogg-1.1.3\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      true
+      MultiThreaded
+      true
+      TurnOffAllWarnings
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      $(OutDir)libogg.lib
+      true
+    
+    
+      true
+      .\Static_Release/ogg_static.bsc
+    
+  
+  
+    
+      Disabled
+      ..\..\libogg-1.1.3\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebug
+      TurnOffAllWarnings
+      true
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      $(OutDir)libogg.lib
+      true
+    
+    
+      true
+      .\Static_Debug/ogg_static.bsc
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      ..\..\libogg-1.1.3\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebug
+      TurnOffAllWarnings
+      true
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      $(OutDir)libogg.lib
+      true
+    
+    
+      true
+      .\Static_Debug/ogg_static.bsc
+    
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+  
+  
+    
+    
+  
+  
+    
+      {d5d2bf72-29fe-4982-a9fa-82ab1086db1b}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/libpng/libpng.vcxproj b/libs/win32/libpng/libpng.2017.vcxproj
similarity index 97%
rename from libs/win32/libpng/libpng.vcxproj
rename to libs/win32/libpng/libpng.2017.vcxproj
index a14b4b3dd9..f808287b7a 100644
--- a/libs/win32/libpng/libpng.vcxproj
+++ b/libs/win32/libpng/libpng.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -25,27 +25,27 @@
     libpng
   
   
-  
+  
   
     DynamicLibrary
     MultiByte
     true
-    v140
+    v141
   
   
     DynamicLibrary
     true
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
-    v140
+    v141
     false
   
   
     DynamicLibrary
-    v140
+    v141
   
   
   
@@ -230,7 +230,7 @@
     
   
   
-    
+    
       {c2d5eb6d-f4de-4dee-b5b8-b6fd26c22d33}
     
   
diff --git a/libs/win32/libshout/libshout.2015.vcxproj b/libs/win32/libshout/libshout.2017.vcxproj
similarity index 94%
rename from libs/win32/libshout/libshout.2015.vcxproj
rename to libs/win32/libshout/libshout.2017.vcxproj
index 9d5e267a5e..a387a70a03 100644
--- a/libs/win32/libshout/libshout.2015.vcxproj
+++ b/libs/win32/libshout/libshout.2017.vcxproj
@@ -1,192 +1,192 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}
-    libshout
-    libshout
-  
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      MaxSpeed
-      OnlyExplicitInline
-      .\;..\..\libshout-2.2.2\src;..\..\libshout-2.2.2\include;..\..\libogg-1.1.3\include;..\..\pthreads-w32-2-9-1;..\..\libshout-2.2.2\win32\include;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;WIN32;_LIB;_WIN32;VERSION="2.0.0";LIBSHOUT_MAJOR=2;LIBSHOUT_MINOR=0;LIBSHOUT_MICRO=0;HAVE_WINSOCK2_H;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      MultiThreaded
-      true
-      TurnOffAllWarnings
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      .\;..\..\libshout-2.2.2\src;..\..\libshout-2.2.2\include;..\..\libogg-1.1.3\include;..\..\pthreads-w32-2-9-1;..\..\libshout-2.2.2\win32\include;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;WIN32;_LIB;_WIN32;VERSION="2.0.0";LIBSHOUT_MAJOR=2;LIBSHOUT_MINOR=0;LIBSHOUT_MICRO=0;HAVE_WINSOCK2_H;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      MultiThreaded
-      true
-      TurnOffAllWarnings
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-      Disabled
-      .\;..\..\libshout-2.2.2\src;..\..\libshout-2.2.2\include;..\..\libogg-1.1.3\include;..\..\pthreads-w32-2-9-1;..\..\libshout-2.2.2\win32\include;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;WIN32;_DEBUG;_LIB;_WIN32;VERSION="2.0.0";LIBSHOUT_MAJOR=2;LIBSHOUT_MINOR=0;LIBSHOUT_MICRO=0;HAVE_WINSOCK2_H;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebug
-      TurnOffAllWarnings
-      true
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      .\;..\..\libshout-2.2.2\src;..\..\libshout-2.2.2\include;..\..\libogg-1.1.3\include;..\..\pthreads-w32-2-9-1;..\..\libshout-2.2.2\win32\include;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;WIN32;_DEBUG;_LIB;_WIN32;VERSION="2.0.0";LIBSHOUT_MAJOR=2;LIBSHOUT_MINOR=0;LIBSHOUT_MICRO=0;HAVE_WINSOCK2_H;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebug
-      TurnOffAllWarnings
-      true
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {d5d2bf72-29fe-4982-a9fa-82ab3086db1b}
-      false
-    
-    
-      {0feeaec6-4399-4c46-b7db-62ece80d15b4}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {D3D8B329-20BE-475E-9E83-653CEA0E0EF5}
+    libshout
+    libshout
+  
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      MaxSpeed
+      OnlyExplicitInline
+      .\;..\..\libshout-2.2.2\src;..\..\libshout-2.2.2\include;..\..\libogg-1.1.3\include;..\..\pthreads-w32-2-9-1;..\..\libshout-2.2.2\win32\include;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;WIN32;_LIB;_WIN32;VERSION="2.0.0";LIBSHOUT_MAJOR=2;LIBSHOUT_MINOR=0;LIBSHOUT_MICRO=0;HAVE_WINSOCK2_H;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      MultiThreaded
+      true
+      TurnOffAllWarnings
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      .\;..\..\libshout-2.2.2\src;..\..\libshout-2.2.2\include;..\..\libogg-1.1.3\include;..\..\pthreads-w32-2-9-1;..\..\libshout-2.2.2\win32\include;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;WIN32;_LIB;_WIN32;VERSION="2.0.0";LIBSHOUT_MAJOR=2;LIBSHOUT_MINOR=0;LIBSHOUT_MICRO=0;HAVE_WINSOCK2_H;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      MultiThreaded
+      true
+      TurnOffAllWarnings
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+      Disabled
+      .\;..\..\libshout-2.2.2\src;..\..\libshout-2.2.2\include;..\..\libogg-1.1.3\include;..\..\pthreads-w32-2-9-1;..\..\libshout-2.2.2\win32\include;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;WIN32;_DEBUG;_LIB;_WIN32;VERSION="2.0.0";LIBSHOUT_MAJOR=2;LIBSHOUT_MINOR=0;LIBSHOUT_MICRO=0;HAVE_WINSOCK2_H;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebug
+      TurnOffAllWarnings
+      true
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      .\;..\..\libshout-2.2.2\src;..\..\libshout-2.2.2\include;..\..\libogg-1.1.3\include;..\..\pthreads-w32-2-9-1;..\..\libshout-2.2.2\win32\include;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;WIN32;_DEBUG;_LIB;_WIN32;VERSION="2.0.0";LIBSHOUT_MAJOR=2;LIBSHOUT_MINOR=0;LIBSHOUT_MICRO=0;HAVE_WINSOCK2_H;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebug
+      TurnOffAllWarnings
+      true
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {d5d2bf72-29fe-4982-a9fa-82ab3086db1b}
+      false
+    
+    
+      {0feeaec6-4399-4c46-b7db-62ece80d15b4}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/libsilk/Silk_FIX.2015.vcxproj b/libs/win32/libsilk/Silk_FIX.2017.vcxproj
similarity index 98%
rename from libs/win32/libsilk/Silk_FIX.2015.vcxproj
rename to libs/win32/libsilk/Silk_FIX.2017.vcxproj
index 37d625b549..4039879cd9 100644
--- a/libs/win32/libsilk/Silk_FIX.2015.vcxproj
+++ b/libs/win32/libsilk/Silk_FIX.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -29,23 +29,23 @@
     StaticLibrary
     Unicode
     true
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
     true
-    v140
+    v141
   
   
     StaticLibrary
     Unicode
-    v140
+    v141
   
   
   
@@ -265,7 +265,7 @@
     
   
   
-    
+    
       {08782d64-e775-4e96-b707-cc633a226f32}
     
   
diff --git a/libs/win32/libvpx/libvpx.2015.vcxproj b/libs/win32/libvpx/libvpx.2017.vcxproj
similarity index 99%
rename from libs/win32/libvpx/libvpx.2015.vcxproj
rename to libs/win32/libvpx/libvpx.2017.vcxproj
index 8ba9c089bd..752b587e04 100644
--- a/libs/win32/libvpx/libvpx.2015.vcxproj
+++ b/libs/win32/libvpx/libvpx.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -27,24 +27,24 @@
   
   
     StaticLibrary
-    v140
+    v141
     Unicode
     true
   
   
     StaticLibrary
-    v140
+    v141
     Unicode
   
   
     StaticLibrary
-    v140
+    v141
     Unicode
     true
   
   
     StaticLibrary
-    v140
+    v141
     Unicode
   
   
diff --git a/libs/win32/libx264/libx264.2015.vcxproj b/libs/win32/libx264/libx264.2017.vcxproj
similarity index 99%
rename from libs/win32/libx264/libx264.2015.vcxproj
rename to libs/win32/libx264/libx264.2017.vcxproj
index 3fccc49f4b..498a7c4469 100644
--- a/libs/win32/libx264/libx264.2015.vcxproj
+++ b/libs/win32/libx264/libx264.2017.vcxproj
@@ -492,7 +492,7 @@ del /f /q $(OutDir)\x264.txt
     
   
   
-    
+    
       {6d1bc01c-3f97-4c08-8a45-69c9b94281aa}
     
   
diff --git a/libs/win32/libyuv/libyuv.2015.vcxproj b/libs/win32/libyuv/libyuv.2017.vcxproj
similarity index 97%
rename from libs/win32/libyuv/libyuv.2015.vcxproj
rename to libs/win32/libyuv/libyuv.2017.vcxproj
index 571cc3fc54..229232ba78 100644
--- a/libs/win32/libyuv/libyuv.2015.vcxproj
+++ b/libs/win32/libyuv/libyuv.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,24 +28,24 @@
   
   
     StaticLibrary
-    v140
+    v141
     MultiByte
     false
   
   
     StaticLibrary
-    v140
+    v141
     MultiByte
   
   
     StaticLibrary
-    v140
+    v141
     MultiByte
     false
   
   
     StaticLibrary
-    v140
+    v141
     MultiByte
   
   
diff --git a/libs/win32/mpg123/libmpg123.2015.vcxproj b/libs/win32/mpg123/libmpg123.2017.vcxproj
similarity index 97%
rename from libs/win32/mpg123/libmpg123.2015.vcxproj
rename to libs/win32/mpg123/libmpg123.2017.vcxproj
index 44ce7db15b..0ae15e003c 100644
--- a/libs/win32/mpg123/libmpg123.2015.vcxproj
+++ b/libs/win32/mpg123/libmpg123.2017.vcxproj
@@ -1,1336 +1,1336 @@
-
-
-  
-    
-      Debug_Generic_Dll
-      Win32
-    
-    
-      Debug_Generic_Dll
-      x64
-    
-    
-      Debug_Generic
-      Win32
-    
-    
-      Debug_Generic
-      x64
-    
-    
-      Debug_x86_Dll
-      Win32
-    
-    
-      Debug_x86_Dll
-      x64
-    
-    
-      Debug_x86
-      Win32
-    
-    
-      Debug_x86
-      x64
-    
-    
-      Release_Generic_Dll
-      Win32
-    
-    
-      Release_Generic_Dll
-      x64
-    
-    
-      Release_Generic
-      Win32
-    
-    
-      Release_Generic
-      x64
-    
-    
-      Release_x86_Dll
-      Win32
-    
-    
-      Release_x86_Dll
-      x64
-    
-    
-      Release_x86
-      Win32
-    
-    
-      Release_x86
-      x64
-    
-  
-  
-    {419C8F80-D858-4B48-A25C-AF4007608137}
-    libmpg123
-    libmpg123
-  
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    true
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.21006.1
-    false
-    false
-  
-  
-    
-      Disabled
-      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;%(PreprocessorDefinitions)
-      false
-      
-      
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      false
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-  
-  
-    
-      Disabled
-      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;%(PreprocessorDefinitions)
-      false
-      
-      
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      false
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-  
-  
-    
-      MaxSpeed
-      AnySuitable
-      true
-      Speed
-      true
-      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;%(PreprocessorDefinitions)
-      
-      
-      MultiThreadedDLL
-      false
-      false
-      StreamingSIMDExtensions
-      Precise
-      false
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-  
-  
-    
-      MaxSpeed
-      AnySuitable
-      true
-      Speed
-      true
-      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;%(PreprocessorDefinitions)
-      
-      
-      MultiThreadedDLL
-      false
-      false
-      NotSet
-      Precise
-      false
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-  
-  
-    
-      Disabled
-      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;BUILD_MPG123_DLL;ACCURATE_ROUNDING;IEEE_FLOAT;%(PreprocessorDefinitions)
-      false
-      
-      
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      false
-      Level3
-      false
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      $(ProjectDir)Debug\$(ProjectName).dll
-      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
-      true
-      true
-      0x63000000
-      false
-      true
-    
-  
-  
-    
-      Disabled
-      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;BUILD_MPG123_DLL;ACCURATE_ROUNDING;IEEE_FLOAT;%(PreprocessorDefinitions)
-      false
-      
-      
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      false
-      Level3
-      false
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      $(ProjectDir)Debug\$(ProjectName).dll
-      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
-      true
-      true
-      0x63000000
-      false
-      true
-    
-  
-  
-    
-      MaxSpeed
-      AnySuitable
-      true
-      Speed
-      true
-      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;BUILD_MPG123_DLL;%(PreprocessorDefinitions)
-      
-      
-      MultiThreadedDLL
-      false
-      false
-      StreamingSIMDExtensions
-      Precise
-      false
-      Level3
-      false
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      $(ProjectDir)Release\$(ProjectName).dll
-      true
-      0x63000000
-      false
-      true
-    
-  
-  
-    
-      MaxSpeed
-      AnySuitable
-      true
-      Speed
-      true
-      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;BUILD_MPG123_DLL;%(PreprocessorDefinitions)
-      
-      
-      MultiThreadedDLL
-      false
-      false
-      StreamingSIMDExtensions
-      Precise
-      false
-      Level3
-      false
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      $(ProjectDir)Release\$(ProjectName).dll
-      true
-      0x63000000
-      false
-      true
-    
-  
-  
-    
-      Disabled
-      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions)
-      false
-      
-      
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      false
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\getcpuflags.o" "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_i586.o" "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_mmx.o" "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
-
-    
-    
-      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
-      $(ProjectDir)Debug\$(ProjectName).lib
-      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
-    
-  
-  
-    
-      Disabled
-      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions)
-      false
-      
-      
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      false
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\getcpuflags.o" "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_i586.o" "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_mmx.o" "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
-
-    
-    
-      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
-      $(ProjectDir)Debug\$(ProjectName).lib
-      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
-    
-  
-  
-    
-      MaxSpeed
-      AnySuitable
-      true
-      Speed
-      true
-      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions)
-      
-      
-      MultiThreadedDLL
-      false
-      false
-      StreamingSIMDExtensions
-      Precise
-      false
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\getcpuflags.o" "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_i586.o" "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_mmx.o" "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse.o" "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
-
-    
-    
-      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
-      $(ProjectDir)Release\$(ProjectName).lib
-      $(ProjectDir)\Release;%(AdditionalLibraryDirectories)
-    
-  
-  
-    
-      MaxSpeed
-      AnySuitable
-      true
-      Speed
-      true
-      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions)
-      
-      
-      MultiThreadedDLL
-      false
-      false
-      StreamingSIMDExtensions
-      Precise
-      false
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\getcpuflags.o" "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_i586.o" "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_mmx.o" "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse.o" "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
-
-    
-    
-      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
-      $(ProjectDir)Release\$(ProjectName).lib
-      $(ProjectDir)\Release;%(AdditionalLibraryDirectories)
-    
-  
-  
-    
-      Disabled
-      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions)
-      false
-      
-      
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Precise
-      false
-      Level3
-      false
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\getcpuflags.o" "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_i586.o" "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_mmx.o" "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
-
-    
-    
-      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
-      $(ProjectDir)Debug\$(ProjectName).dll
-      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
-      true
-      true
-      0x63000000
-      true
-      false
-    
-  
-  
-    
-      Disabled
-      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions)
-      false
-      
-      
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Precise
-      false
-      Level3
-      false
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\getcpuflags.o" "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_i586.o" "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_mmx.o" "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
-
-    
-    
-      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
-      $(ProjectDir)Debug\$(ProjectName).dll
-      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
-      true
-      true
-      0x63000000
-      true
-      false
-    
-  
-  
-    
-      
-      
-    
-    
-      MaxSpeed
-      AnySuitable
-      true
-      Speed
-      true
-      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions)
-      
-      
-      MultiThreadedDLL
-      false
-      false
-      StreamingSIMDExtensions
-      Precise
-      false
-      Level3
-      false
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\getcpuflags.o" "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_i586.o" "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_mmx.o" "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse.o" "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
-
-    
-    
-      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
-      $(ProjectDir)Release\$(ProjectName).dll
-      $(ProjectDir)\Release;%(AdditionalLibraryDirectories)
-      true
-      0x63000000
-      false
-      true
-    
-    
-      
-      
-    
-  
-  
-    
-      
-      
-    
-    
-      MaxSpeed
-      AnySuitable
-      true
-      Speed
-      true
-      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
-      WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions)
-      
-      
-      MultiThreadedDLL
-      false
-      false
-      StreamingSIMDExtensions
-      Precise
-      false
-      Level3
-      false
-      ProgramDatabase
-      CompileAsC
-      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
-    
-    
-      cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\getcpuflags.o" "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_i586.o" "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_mmx.o" "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse.o" "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
-
-cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
-yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
-
-    
-    
-      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
-      $(ProjectDir)Release\$(ProjectName).dll
-      $(ProjectDir)\Release;%(AdditionalLibraryDirectories)
-      true
-      0x63000000
-      false
-      true
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-    
-    
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-      true
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {e796e337-de78-4303-8614-9a590862ee95}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug_Generic_Dll
+      Win32
+    
+    
+      Debug_Generic_Dll
+      x64
+    
+    
+      Debug_Generic
+      Win32
+    
+    
+      Debug_Generic
+      x64
+    
+    
+      Debug_x86_Dll
+      Win32
+    
+    
+      Debug_x86_Dll
+      x64
+    
+    
+      Debug_x86
+      Win32
+    
+    
+      Debug_x86
+      x64
+    
+    
+      Release_Generic_Dll
+      Win32
+    
+    
+      Release_Generic_Dll
+      x64
+    
+    
+      Release_Generic
+      Win32
+    
+    
+      Release_Generic
+      x64
+    
+    
+      Release_x86_Dll
+      Win32
+    
+    
+      Release_x86_Dll
+      x64
+    
+    
+      Release_x86
+      Win32
+    
+    
+      Release_x86
+      x64
+    
+  
+  
+    {419C8F80-D858-4B48-A25C-AF4007608137}
+    libmpg123
+    libmpg123
+  
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    true
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.21006.1
+    false
+    false
+  
+  
+    
+      Disabled
+      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;%(PreprocessorDefinitions)
+      false
+      
+      
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      false
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+  
+  
+    
+      Disabled
+      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;%(PreprocessorDefinitions)
+      false
+      
+      
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      false
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+  
+  
+    
+      MaxSpeed
+      AnySuitable
+      true
+      Speed
+      true
+      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;%(PreprocessorDefinitions)
+      
+      
+      MultiThreadedDLL
+      false
+      false
+      StreamingSIMDExtensions
+      Precise
+      false
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+  
+  
+    
+      MaxSpeed
+      AnySuitable
+      true
+      Speed
+      true
+      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;%(PreprocessorDefinitions)
+      
+      
+      MultiThreadedDLL
+      false
+      false
+      NotSet
+      Precise
+      false
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+  
+  
+    
+      Disabled
+      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;BUILD_MPG123_DLL;ACCURATE_ROUNDING;IEEE_FLOAT;%(PreprocessorDefinitions)
+      false
+      
+      
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      false
+      Level3
+      false
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      $(ProjectDir)Debug\$(ProjectName).dll
+      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
+      true
+      true
+      0x63000000
+      false
+      true
+    
+  
+  
+    
+      Disabled
+      ../../libmpg123/ports\MSVC++;../../libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;_DEBUG;BUILD_MPG123_DLL;ACCURATE_ROUNDING;IEEE_FLOAT;%(PreprocessorDefinitions)
+      false
+      
+      
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      false
+      Level3
+      false
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      $(ProjectDir)Debug\$(ProjectName).dll
+      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
+      true
+      true
+      0x63000000
+      false
+      true
+    
+  
+  
+    
+      MaxSpeed
+      AnySuitable
+      true
+      Speed
+      true
+      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;BUILD_MPG123_DLL;%(PreprocessorDefinitions)
+      
+      
+      MultiThreadedDLL
+      false
+      false
+      StreamingSIMDExtensions
+      Precise
+      false
+      Level3
+      false
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      $(ProjectDir)Release\$(ProjectName).dll
+      true
+      0x63000000
+      false
+      true
+    
+  
+  
+    
+      MaxSpeed
+      AnySuitable
+      true
+      Speed
+      true
+      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_GENERIC;BUILD_MPG123_DLL;%(PreprocessorDefinitions)
+      
+      
+      MultiThreadedDLL
+      false
+      false
+      StreamingSIMDExtensions
+      Precise
+      false
+      Level3
+      false
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      $(ProjectDir)Release\$(ProjectName).dll
+      true
+      0x63000000
+      false
+      true
+    
+  
+  
+    
+      Disabled
+      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions)
+      false
+      
+      
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      false
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\getcpuflags.o" "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_i586.o" "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_mmx.o" "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
+
+    
+    
+      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
+      $(ProjectDir)Debug\$(ProjectName).lib
+      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
+    
+  
+  
+    
+      Disabled
+      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions)
+      false
+      
+      
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      false
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\getcpuflags.o" "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_i586.o" "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_mmx.o" "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
+
+    
+    
+      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
+      $(ProjectDir)Debug\$(ProjectName).lib
+      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
+    
+  
+  
+    
+      MaxSpeed
+      AnySuitable
+      true
+      Speed
+      true
+      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions)
+      
+      
+      MultiThreadedDLL
+      false
+      false
+      StreamingSIMDExtensions
+      Precise
+      false
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\getcpuflags.o" "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_i586.o" "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_mmx.o" "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse.o" "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
+
+    
+    
+      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
+      $(ProjectDir)Release\$(ProjectName).lib
+      $(ProjectDir)\Release;%(AdditionalLibraryDirectories)
+    
+  
+  
+    
+      MaxSpeed
+      AnySuitable
+      true
+      Speed
+      true
+      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;%(PreprocessorDefinitions)
+      
+      
+      MultiThreadedDLL
+      false
+      false
+      StreamingSIMDExtensions
+      Precise
+      false
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\getcpuflags.o" "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_i586.o" "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_mmx.o" "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse.o" "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
+
+    
+    
+      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
+      $(ProjectDir)Release\$(ProjectName).lib
+      $(ProjectDir)\Release;%(AdditionalLibraryDirectories)
+    
+  
+  
+    
+      Disabled
+      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions)
+      false
+      
+      
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Precise
+      false
+      Level3
+      false
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\getcpuflags.o" "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_i586.o" "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_mmx.o" "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
+
+    
+    
+      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
+      $(ProjectDir)Debug\$(ProjectName).dll
+      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
+      true
+      true
+      0x63000000
+      true
+      false
+    
+  
+  
+    
+      Disabled
+      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions)
+      false
+      
+      
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Precise
+      false
+      Level3
+      false
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct36_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\dct64_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Debug\dct64_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\dct64_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\equalizer_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\getcpuflags.o" "$(ProjectDir)..\libmpg123\Debug\getcpuflags.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Debug\synth_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_i586.o" "$(ProjectDir)..\libmpg123\Debug\synth_i586.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_mmx.o" "$(ProjectDir)..\libmpg123\Debug\synth_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Debug\tabinit_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_sse_s32.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Debug\synth_stereo_sse_s32.asm"
+
+    
+    
+      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
+      $(ProjectDir)Debug\$(ProjectName).dll
+      $(ProjectDir)\Debug;%(AdditionalLibraryDirectories)
+      true
+      true
+      0x63000000
+      true
+      false
+    
+  
+  
+    
+      
+      
+    
+    
+      MaxSpeed
+      AnySuitable
+      true
+      Speed
+      true
+      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions)
+      
+      
+      MultiThreadedDLL
+      false
+      false
+      StreamingSIMDExtensions
+      Precise
+      false
+      Level3
+      false
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\getcpuflags.o" "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_i586.o" "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_mmx.o" "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse.o" "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
+
+    
+    
+      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
+      $(ProjectDir)Release\$(ProjectName).dll
+      $(ProjectDir)\Release;%(AdditionalLibraryDirectories)
+      true
+      0x63000000
+      false
+      true
+    
+    
+      
+      
+    
+  
+  
+    
+      
+      
+    
+    
+      MaxSpeed
+      AnySuitable
+      true
+      Speed
+      true
+      ../../libmpg123/ports\MSVC++;../..//libmpg123/src/libmpg123;%(AdditionalIncludeDirectories)
+      WIN32;_CRT_SECURE_NO_WARNINGS;BUILD_MPG123_DLL;OPT_MULTI;OPT_GENERIC;OPT_I386;OPT_I586;OPT_MMX;OPT_3DNOW;OPT_3DNOWEXT;OPT_SSE;_BIND_TO_CURRENT_VCLIBS_VERSION=1;%(PreprocessorDefinitions)
+      
+      
+      MultiThreadedDLL
+      false
+      false
+      StreamingSIMDExtensions
+      Precise
+      false
+      Level3
+      false
+      ProgramDatabase
+      CompileAsC
+      4477;4028;4334;4267;4996;%(DisableSpecificWarnings)
+    
+    
+      cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct36_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct36_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct36_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\dct64_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_mmx.o" "$(ProjectDir)..\libmpg123\Release\dct64_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\dct64_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.o" "$(ProjectDir)..\libmpg123\Release\dct64_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\equalizer_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.o" "$(ProjectDir)..\libmpg123\Release\equalizer_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\getcpuflags.S" /nologo > "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\getcpuflags.o" "$(ProjectDir)..\libmpg123\Release\getcpuflags.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_3dnow.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnow.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnow.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_3dnowext.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.o" "$(ProjectDir)..\libmpg123\Release\synth_3dnowext.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_i586.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_i586.o" "$(ProjectDir)..\libmpg123\Release\synth_i586.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_mmx.o" "$(ProjectDir)..\libmpg123\Release\synth_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse.o" "$(ProjectDir)..\libmpg123\Release\synth_sse.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_float.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_float.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\tabinit_mmx.S" /nologo > "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.o" "$(ProjectDir)..\libmpg123\Release\tabinit_mmx.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_sse_s32.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_accurate.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_accurate.asm"
+
+cl /I "..\.." /EP /TC "$(ProjectDir)..\..\libmpg123\src\libmpg123\synth_stereo_sse_s32.S" /nologo > "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
+yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.o" "$(ProjectDir)..\libmpg123\Release\synth_stereo_sse_s32.asm"
+
+    
+    
+      dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies)
+      $(ProjectDir)Release\$(ProjectName).dll
+      $(ProjectDir)\Release;%(AdditionalLibraryDirectories)
+      true
+      0x63000000
+      false
+      true
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+    
+    
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+      true
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {e796e337-de78-4303-8614-9a590862ee95}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/opus/opus.2015.vcxproj b/libs/win32/opus/opus.2017.vcxproj
similarity index 94%
rename from libs/win32/opus/opus.2015.vcxproj
rename to libs/win32/opus/opus.2017.vcxproj
index 50a160a44f..86ef8e7688 100644
--- a/libs/win32/opus/opus.2015.vcxproj
+++ b/libs/win32/opus/opus.2017.vcxproj
@@ -1,262 +1,262 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    Win32Proj
-    opus
-    {FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}
-  
-  
-  
-    StaticLibrary
-    true
-    v140
-  
-  
-    StaticLibrary
-    true
-    v140
-  
-  
-    false
-    StaticLibrary
-    true
-    v140
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    true
-    opus
-    $(Platform)\$(Configuration)\opus\
-  
-  
-    true
-    opus
-    $(Platform)\$(Configuration)\opus\
-  
-  
-    false
-    opus
-    $(Platform)\$(Configuration)\opus\
-  
-  
-    false
-    
-    
-    opus
-    $(Platform)\$(Configuration)\opus\
-  
-  
-    
-      _CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk;..\..\opus-1.1\celt;..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
-      MultiThreadedDebugDLL
-      Level3
-      ProgramDatabase
-      Disabled
-      4334;4244;%(DisableSpecificWarnings)
-    
-    
-      MachineX86
-      true
-      Console
-      $(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)
-      celt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      _CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk;..\..\opus-1.1\celt;..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
-      MultiThreadedDebugDLL
-      Level3
-      ProgramDatabase
-      Disabled
-      4334;4244;%(DisableSpecificWarnings)
-    
-    
-      true
-      Console
-      $(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)
-      celt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      _CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk;..\..\opus-1.1\celt;..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
-      MultiThreadedDLL
-      Level3
-      ProgramDatabase
-      true
-      4334;4244;%(DisableSpecificWarnings)
-    
-    
-      MachineX86
-      false
-      Console
-      true
-      true
-      celt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
-      $(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)
-      false
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      _CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk;..\..\opus-1.1\celt;..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
-      MultiThreadedDLL
-      Level3
-      ProgramDatabase
-      4334;4244;%(DisableSpecificWarnings)
-    
-    
-      false
-      Console
-      true
-      true
-      celt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
-      $(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)
-      false
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {092124c9-09ed-43c7-bd6d-4ae5d6b3c547}
-      false
-      false
-      false
-      false
-      false
-    
-    
-      {245603e3-f580-41a5-9632-b25fe3372cbf}
-    
-    
-      {c303d2fc-ff97-49b8-9ddd-467b4c9a0b16}
-    
-    
-      {8484c90d-1561-402f-a91d-2db10f8c5171}
-    
-    
-      {9c4961d2-5ddb-40c7-9be8-ca918dc4e782}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    Win32Proj
+    opus
+    {FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}
+  
+  
+  
+    StaticLibrary
+    true
+    v141
+  
+  
+    StaticLibrary
+    true
+    v141
+  
+  
+    false
+    StaticLibrary
+    true
+    v141
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    true
+    opus
+    $(Platform)\$(Configuration)\opus\
+  
+  
+    true
+    opus
+    $(Platform)\$(Configuration)\opus\
+  
+  
+    false
+    opus
+    $(Platform)\$(Configuration)\opus\
+  
+  
+    false
+    
+    
+    opus
+    $(Platform)\$(Configuration)\opus\
+  
+  
+    
+      _CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk;..\..\opus-1.1\celt;..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
+      MultiThreadedDebugDLL
+      Level3
+      ProgramDatabase
+      Disabled
+      4334;4244;%(DisableSpecificWarnings)
+    
+    
+      MachineX86
+      true
+      Console
+      $(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)
+      celt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      _CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk;..\..\opus-1.1\celt;..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
+      MultiThreadedDebugDLL
+      Level3
+      ProgramDatabase
+      Disabled
+      4334;4244;%(DisableSpecificWarnings)
+    
+    
+      true
+      Console
+      $(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)
+      celt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      _CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk;..\..\opus-1.1\celt;..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
+      MultiThreadedDLL
+      Level3
+      ProgramDatabase
+      true
+      4334;4244;%(DisableSpecificWarnings)
+    
+    
+      MachineX86
+      false
+      Console
+      true
+      true
+      celt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+      $(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)
+      false
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      _CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk;..\..\opus-1.1\celt;..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
+      MultiThreadedDLL
+      Level3
+      ProgramDatabase
+      4334;4244;%(DisableSpecificWarnings)
+    
+    
+      false
+      Console
+      true
+      true
+      celt.lib;silk_common.lib;silk_fixed.lib;silk_float.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)
+      $(SolutionDir)$(Configuration)$(PlatformArchitecture);%(AdditionalLibraryDirectories)
+      false
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {092124c9-09ed-43c7-bd6d-4ae5d6b3c547}
+      false
+      false
+      false
+      false
+      false
+    
+    
+      {245603e3-f580-41a5-9632-b25fe3372cbf}
+    
+    
+      {c303d2fc-ff97-49b8-9ddd-467b4c9a0b16}
+    
+    
+      {8484c90d-1561-402f-a91d-2db10f8c5171}
+    
+    
+      {9c4961d2-5ddb-40c7-9be8-ca918dc4e782}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/opus/opus.celt.2015.vcxproj b/libs/win32/opus/opus.celt.2017.vcxproj
similarity index 95%
rename from libs/win32/opus/opus.celt.2015.vcxproj
rename to libs/win32/opus/opus.celt.2017.vcxproj
index 624f6c1d87..8af97696a1 100644
--- a/libs/win32/opus/opus.celt.2015.vcxproj
+++ b/libs/win32/opus/opus.celt.2017.vcxproj
@@ -1,262 +1,262 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {245603E3-F580-41A5-9632-B25FE3372CBF}
-    Win32Proj
-    opus.celt
-    opus.celt
-  
-  
-  
-    StaticLibrary
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-  
-  
-    
-    
-    celt
-    $(Platform)\$(Configuration)\opus.celt\
-  
-  
-  
-    celt
-    $(Platform)\$(Configuration)\opus.celt\
-  
-  
-  
-    celt
-    $(Platform)\$(Configuration)\opus.celt\
-  
-  
-    celt
-    $(Platform)\$(Configuration)\opus.celt\
-  
-  
-    
-      
-      
-      Level3
-      Disabled
-      HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
-      MultiThreadedDebugDLL
-      ProgramDatabase
-    
-    
-      Windows
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      
-      
-      Level3
-      Disabled
-      HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
-      MultiThreadedDebugDLL
-      ProgramDatabase
-    
-    
-      Windows
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Level3
-      
-      
-      true
-      true
-      HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
-      MultiThreadedDLL
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Level3
-      
-      
-      MaxSpeed
-      true
-      true
-      HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
-      MultiThreadedDLL
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {092124c9-09ed-43c7-bd6d-4ae5d6b3c547}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {245603E3-F580-41A5-9632-B25FE3372CBF}
+    Win32Proj
+    opus.celt
+    opus.celt
+  
+  
+  
+    StaticLibrary
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+  
+  
+    
+    
+    celt
+    $(Platform)\$(Configuration)\opus.celt\
+  
+  
+  
+    celt
+    $(Platform)\$(Configuration)\opus.celt\
+  
+  
+  
+    celt
+    $(Platform)\$(Configuration)\opus.celt\
+  
+  
+    celt
+    $(Platform)\$(Configuration)\opus.celt\
+  
+  
+    
+      
+      
+      Level3
+      Disabled
+      HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
+      MultiThreadedDebugDLL
+      ProgramDatabase
+    
+    
+      Windows
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      
+      
+      Level3
+      Disabled
+      HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
+      MultiThreadedDebugDLL
+      ProgramDatabase
+    
+    
+      Windows
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Level3
+      
+      
+      true
+      true
+      HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
+      MultiThreadedDLL
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Level3
+      
+      
+      MaxSpeed
+      true
+      true
+      HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\win32;..\..\opus-1.1\include;%(AdditionalIncludeDirectories)
+      MultiThreadedDLL
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {092124c9-09ed-43c7-bd6d-4ae5d6b3c547}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/opus/opus.silk_common.2015.vcxproj b/libs/win32/opus/opus.silk_common.2017.vcxproj
similarity index 96%
rename from libs/win32/opus/opus.silk_common.2015.vcxproj
rename to libs/win32/opus/opus.silk_common.2017.vcxproj
index 23c9fbc515..6ddf75c73a 100644
--- a/libs/win32/opus/opus.silk_common.2015.vcxproj
+++ b/libs/win32/opus/opus.silk_common.2017.vcxproj
@@ -1,317 +1,317 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}
-    Win32Proj
-    src_common
-    opus.silk_common
-  
-  
-  
-    StaticLibrary
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    silk_common
-    $(Platform)\$(Configuration)\opus.silk_common\
-  
-  
-    silk_common
-    $(Platform)\$(Configuration)\opus.silk_common\
-  
-  
-    silk_common
-    $(Platform)\$(Configuration)\opus.silk_common\
-  
-  
-    
-    
-    silk_common
-    $(Platform)\$(Configuration)\opus.silk_common\
-  
-  
-    
-      
-      
-      Level3
-      Disabled
-      HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk\fixed;..\..\opus-1.1\silk\float;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDebugDLL
-      ProgramDatabase
-    
-    
-      Windows
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      
-      
-      Level3
-      Disabled
-      HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk\fixed;..\..\opus-1.1\silk\float;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDebugDLL
-      ProgramDatabase
-    
-    
-      Windows
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Level3
-      
-      
-      true
-      true
-      HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk\fixed;..\..\opus-1.1\silk\float;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDLL
-      Fast
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Level3
-      
-      
-      MaxSpeed
-      true
-      true
-      HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk\fixed;..\..\opus-1.1\silk\float;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDLL
-      Fast
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {092124c9-09ed-43c7-bd6d-4ae5d6b3c547}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {C303D2FC-FF97-49B8-9DDD-467B4C9A0B16}
+    Win32Proj
+    src_common
+    opus.silk_common
+  
+  
+  
+    StaticLibrary
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    silk_common
+    $(Platform)\$(Configuration)\opus.silk_common\
+  
+  
+    silk_common
+    $(Platform)\$(Configuration)\opus.silk_common\
+  
+  
+    silk_common
+    $(Platform)\$(Configuration)\opus.silk_common\
+  
+  
+    
+    
+    silk_common
+    $(Platform)\$(Configuration)\opus.silk_common\
+  
+  
+    
+      
+      
+      Level3
+      Disabled
+      HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk\fixed;..\..\opus-1.1\silk\float;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDebugDLL
+      ProgramDatabase
+    
+    
+      Windows
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      
+      
+      Level3
+      Disabled
+      HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk\fixed;..\..\opus-1.1\silk\float;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDebugDLL
+      ProgramDatabase
+    
+    
+      Windows
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Level3
+      
+      
+      true
+      true
+      HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk\fixed;..\..\opus-1.1\silk\float;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDLL
+      Fast
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Level3
+      
+      
+      MaxSpeed
+      true
+      true
+      HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk\fixed;..\..\opus-1.1\silk\float;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDLL
+      Fast
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {092124c9-09ed-43c7-bd6d-4ae5d6b3c547}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/opus/opus.silk_fixed.2015.vcxproj b/libs/win32/opus/opus.silk_fixed.2017.vcxproj
similarity index 94%
rename from libs/win32/opus/opus.silk_fixed.2015.vcxproj
rename to libs/win32/opus/opus.silk_fixed.2017.vcxproj
index a1f416eb44..16da6b597e 100644
--- a/libs/win32/opus/opus.silk_fixed.2015.vcxproj
+++ b/libs/win32/opus/opus.silk_fixed.2017.vcxproj
@@ -1,207 +1,207 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {8484C90D-1561-402F-A91D-2DB10F8C5171}
-    Win32Proj
-    src_FIX
-    opus.silk_fixed
-  
-  
-  
-    StaticLibrary
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    silk_fixed
-    $(Platform)\$(Configuration)\silk_fixed\
-  
-  
-    silk_fixed
-    $(Platform)\$(Configuration)\silk_fixed\
-  
-  
-    silk_fixed
-    $(Platform)\$(Configuration)\silk_fixed\
-  
-  
-    silk_fixed
-    $(Platform)\$(Configuration)\silk_fixed\
-  
-  
-    
-      
-      
-      Level3
-      Disabled
-      HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk\;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDebugDLL
-      4244;4133;%(DisableSpecificWarnings)
-      ProgramDatabase
-    
-    
-      Windows
-      true
-    
-  
-  
-    
-      
-      
-      Level3
-      Disabled
-      HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk\;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDebugDLL
-      4244;4133;%(DisableSpecificWarnings)
-      ProgramDatabase
-    
-    
-      Windows
-      true
-    
-  
-  
-    
-      Level3
-      
-      
-      true
-      true
-      HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk\;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDLL
-      4244;4133;%(DisableSpecificWarnings)
-    
-    
-      Windows
-      true
-      true
-      true
-    
-  
-  
-    
-      Level3
-      
-      
-      MaxSpeed
-      true
-      true
-      HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk\;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDLL
-      4244;4133;%(DisableSpecificWarnings)
-    
-    
-      Windows
-      true
-      true
-      true
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-  
-  
-    
-      {092124c9-09ed-43c7-bd6d-4ae5d6b3c547}
-    
-    
-      {c303d2fc-ff97-49b8-9ddd-467b4c9a0b16}
-    
-    
-      {9c4961d2-5ddb-40c7-9be8-ca918dc4e782}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {8484C90D-1561-402F-A91D-2DB10F8C5171}
+    Win32Proj
+    src_FIX
+    opus.silk_fixed
+  
+  
+  
+    StaticLibrary
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    silk_fixed
+    $(Platform)\$(Configuration)\silk_fixed\
+  
+  
+    silk_fixed
+    $(Platform)\$(Configuration)\silk_fixed\
+  
+  
+    silk_fixed
+    $(Platform)\$(Configuration)\silk_fixed\
+  
+  
+    silk_fixed
+    $(Platform)\$(Configuration)\silk_fixed\
+  
+  
+    
+      
+      
+      Level3
+      Disabled
+      HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk\;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDebugDLL
+      4244;4133;%(DisableSpecificWarnings)
+      ProgramDatabase
+    
+    
+      Windows
+      true
+    
+  
+  
+    
+      
+      
+      Level3
+      Disabled
+      HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk\;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDebugDLL
+      4244;4133;%(DisableSpecificWarnings)
+      ProgramDatabase
+    
+    
+      Windows
+      true
+    
+  
+  
+    
+      Level3
+      
+      
+      true
+      true
+      HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk\;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDLL
+      4244;4133;%(DisableSpecificWarnings)
+    
+    
+      Windows
+      true
+      true
+      true
+    
+  
+  
+    
+      Level3
+      
+      
+      MaxSpeed
+      true
+      true
+      HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk\;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDLL
+      4244;4133;%(DisableSpecificWarnings)
+    
+    
+      Windows
+      true
+      true
+      true
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+  
+  
+    
+      {092124c9-09ed-43c7-bd6d-4ae5d6b3c547}
+    
+    
+      {c303d2fc-ff97-49b8-9ddd-467b4c9a0b16}
+    
+    
+      {9c4961d2-5ddb-40c7-9be8-ca918dc4e782}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/opus/opus.silk_float.2015.vcxproj b/libs/win32/opus/opus.silk_float.2017.vcxproj
similarity index 95%
rename from libs/win32/opus/opus.silk_float.2015.vcxproj
rename to libs/win32/opus/opus.silk_float.2017.vcxproj
index 52268b88f2..e420354909 100644
--- a/libs/win32/opus/opus.silk_float.2015.vcxproj
+++ b/libs/win32/opus/opus.silk_float.2017.vcxproj
@@ -1,255 +1,255 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}
-    Win32Proj
-    src_FLP
-    opus.silk_float
-  
-  
-  
-    StaticLibrary
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-    StaticLibrary
-    false
-    true
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    silk_float
-    $(Platform)\$(Configuration)\silk_float\
-  
-  
-    silk_float
-    $(Platform)\$(Configuration)\silk_float\
-  
-  
-    silk_float
-    $(Platform)\$(Configuration)\silk_float\
-  
-  
-    Compile
-    silk_float
-    $(Platform)\$(Configuration)\silk_float\
-  
-  
-    
-      
-      
-      Level3
-      Disabled
-      HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk;..\..\opus-1.1\silk\fixed;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDebugDLL
-      ProgramDatabase
-    
-    
-      Windows
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      
-      
-      Level3
-      Disabled
-      HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk;..\..\opus-1.1\silk\fixed;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDebugDLL
-      ProgramDatabase
-    
-    
-      Windows
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Level3
-      
-      
-      true
-      true
-      HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk;..\..\opus-1.1\silk\fixed;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDLL
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-      Level3
-      
-      
-      MaxSpeed
-      true
-      true
-      HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      ..\..\opus-1.1\silk;..\..\opus-1.1\silk\fixed;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
-      MultiThreadedDLL
-    
-    
-      Windows
-      true
-      true
-      true
-    
-    
-      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
-      Generating version.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-  
-  
-    
-      {092124c9-09ed-43c7-bd6d-4ae5d6b3c547}
-    
-    
-      {c303d2fc-ff97-49b8-9ddd-467b4c9a0b16}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {9C4961D2-5DDB-40C7-9BE8-CA918DC4E782}
+    Win32Proj
+    src_FLP
+    opus.silk_float
+  
+  
+  
+    StaticLibrary
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+    StaticLibrary
+    false
+    true
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    silk_float
+    $(Platform)\$(Configuration)\silk_float\
+  
+  
+    silk_float
+    $(Platform)\$(Configuration)\silk_float\
+  
+  
+    silk_float
+    $(Platform)\$(Configuration)\silk_float\
+  
+  
+    Compile
+    silk_float
+    $(Platform)\$(Configuration)\silk_float\
+  
+  
+    
+      
+      
+      Level3
+      Disabled
+      HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk;..\..\opus-1.1\silk\fixed;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDebugDLL
+      ProgramDatabase
+    
+    
+      Windows
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      
+      
+      Level3
+      Disabled
+      HAVE_CONFIG_H;WIN32;WIN64;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk;..\..\opus-1.1\silk\fixed;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDebugDLL
+      ProgramDatabase
+    
+    
+      Windows
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Level3
+      
+      
+      true
+      true
+      HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk;..\..\opus-1.1\silk\fixed;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDLL
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+      Level3
+      
+      
+      MaxSpeed
+      true
+      true
+      HAVE_CONFIG_H;WIN32;WIN64;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      ..\..\opus-1.1\silk;..\..\opus-1.1\silk\fixed;..\..\opus-1.1\win32;..\..\opus-1.1\celt;..\..\opus-1.1\include
+      MultiThreadedDLL
+    
+    
+      Windows
+      true
+      true
+      true
+    
+    
+      "$(ProjectDir)..\..\opus-1.1\win32\genversion.bat" "$(ProjectDir)..\..\opus-1.1\win32\version.h" OPUS_VERSION
+      Generating version.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+  
+  
+    
+      {092124c9-09ed-43c7-bd6d-4ae5d6b3c547}
+    
+    
+      {c303d2fc-ff97-49b8-9ddd-467b4c9a0b16}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/pocketsphinx/pocketsphinx.2015.vcxproj b/libs/win32/pocketsphinx/pocketsphinx.2017.vcxproj
similarity index 97%
rename from libs/win32/pocketsphinx/pocketsphinx.2015.vcxproj
rename to libs/win32/pocketsphinx/pocketsphinx.2017.vcxproj
index 46981c1dae..4a8dd95ca1 100644
--- a/libs/win32/pocketsphinx/pocketsphinx.2015.vcxproj
+++ b/libs/win32/pocketsphinx/pocketsphinx.2017.vcxproj
@@ -1,404 +1,404 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    pocketsphinx
-    {94001A0E-A837-445C-8004-F918F10D0226}
-    pocketsphinx
-  
-  
-  
-    DynamicLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    false
-    Unicode
-    v140
-  
-  
-    DynamicLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    false
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-    true
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ../../../include;../../../../sphinxbase/include;../../../../sphinxbase/include/win32;..\..\pocketsphinx-0.7/src/libpocketsphinx;..\..\sphinxbase-0.7\include;..\..\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
-      NDEBUG;WIN32;_WINDOWS;_USRDLL;POCKETSPHINX_EXPORTS;SPHINXDLL;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      TurnOffAllWarnings
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      winmm.lib;%(AdditionalDependencies)
-      ..\..\..\Release;%(AdditionalLibraryDirectories)
-    
-    
-      true
-    
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ../../../include;../../../../sphinxbase/include;../../../../sphinxbase/include/win32;..\..\pocketsphinx-0.7/src/libpocketsphinx;..\..\sphinxbase-0.7\include;..\..\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
-      NDEBUG;WIN32;_WINDOWS;_USRDLL;POCKETSPHINX_EXPORTS;SPHINXDLL;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      TurnOffAllWarnings
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      winmm.lib;%(AdditionalDependencies)
-      ..\..\..\Release;%(AdditionalLibraryDirectories)
-      MachineX64
-    
-    
-      true
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-    
-    
-      Disabled
-      ../../../include;../../../../sphinxbase/include;../../../../sphinxbase/include/win32;..\..\pocketsphinx-0.7/src/libpocketsphinx;..\..\sphinxbase-0.7\include;..\..\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
-      _DEBUG;WIN32;_WINDOWS;_USRDLL;POCKETSPHINX_EXPORTS;SPHINXDLL;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      true
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      winmm.lib;%(AdditionalDependencies)
-      $(OutDir)$(ProjectName).dll
-      true
-      ..\..\..\Debug;%(AdditionalLibraryDirectories)
-      true
-      false
-      MachineX86
-    
-    
-      true
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-    
-    
-      Disabled
-      ../../../include;../../../../sphinxbase/include;../../../../sphinxbase/include/win32;..\..\pocketsphinx-0.7/src/libpocketsphinx;..\..\sphinxbase-0.7\include;..\..\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
-      _DEBUG;WIN32;_WINDOWS;_USRDLL;POCKETSPHINX_EXPORTS;SPHINXDLL;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      true
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      winmm.lib;%(AdditionalDependencies)
-      $(OutDir)$(ProjectName).dll
-      true
-      ..\..\..\Debug;%(AdditionalLibraryDirectories)
-      true
-      false
-      MachineX64
-    
-    
-      true
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-  
-  
-    
-      {af8163ee-fa76-4904-a11d-7d70a1b5ba2e}
-      false
-    
-    
-      {2f025ead-99bd-40f5-b2cc-f0a28cad7f2d}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    pocketsphinx
+    {94001A0E-A837-445C-8004-F918F10D0226}
+    pocketsphinx
+  
+  
+  
+    DynamicLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    false
+    Unicode
+    v141
+  
+  
+    DynamicLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    false
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+    true
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ../../../include;../../../../sphinxbase/include;../../../../sphinxbase/include/win32;..\..\pocketsphinx-0.7/src/libpocketsphinx;..\..\sphinxbase-0.7\include;..\..\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
+      NDEBUG;WIN32;_WINDOWS;_USRDLL;POCKETSPHINX_EXPORTS;SPHINXDLL;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      TurnOffAllWarnings
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      winmm.lib;%(AdditionalDependencies)
+      ..\..\..\Release;%(AdditionalLibraryDirectories)
+    
+    
+      true
+    
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ../../../include;../../../../sphinxbase/include;../../../../sphinxbase/include/win32;..\..\pocketsphinx-0.7/src/libpocketsphinx;..\..\sphinxbase-0.7\include;..\..\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
+      NDEBUG;WIN32;_WINDOWS;_USRDLL;POCKETSPHINX_EXPORTS;SPHINXDLL;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      TurnOffAllWarnings
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      winmm.lib;%(AdditionalDependencies)
+      ..\..\..\Release;%(AdditionalLibraryDirectories)
+      MachineX64
+    
+    
+      true
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+    
+    
+      Disabled
+      ../../../include;../../../../sphinxbase/include;../../../../sphinxbase/include/win32;..\..\pocketsphinx-0.7/src/libpocketsphinx;..\..\sphinxbase-0.7\include;..\..\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
+      _DEBUG;WIN32;_WINDOWS;_USRDLL;POCKETSPHINX_EXPORTS;SPHINXDLL;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      true
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      winmm.lib;%(AdditionalDependencies)
+      $(OutDir)$(ProjectName).dll
+      true
+      ..\..\..\Debug;%(AdditionalLibraryDirectories)
+      true
+      false
+      MachineX86
+    
+    
+      true
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+    
+    
+      Disabled
+      ../../../include;../../../../sphinxbase/include;../../../../sphinxbase/include/win32;..\..\pocketsphinx-0.7/src/libpocketsphinx;..\..\sphinxbase-0.7\include;..\..\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
+      _DEBUG;WIN32;_WINDOWS;_USRDLL;POCKETSPHINX_EXPORTS;SPHINXDLL;HAVE_CONFIG_H;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      true
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      winmm.lib;%(AdditionalDependencies)
+      $(OutDir)$(ProjectName).dll
+      true
+      ..\..\..\Debug;%(AdditionalLibraryDirectories)
+      true
+      false
+      MachineX64
+    
+    
+      true
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+  
+  
+    
+      {af8163ee-fa76-4904-a11d-7d70a1b5ba2e}
+      false
+    
+    
+      {2f025ead-99bd-40f5-b2cc-f0a28cad7f2d}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/portaudio/portaudio.2015.vcxproj b/libs/win32/portaudio/portaudio.2017.vcxproj
similarity index 98%
rename from libs/win32/portaudio/portaudio.2015.vcxproj
rename to libs/win32/portaudio/portaudio.2017.vcxproj
index c5569daac3..3ba285f451 100644
--- a/libs/win32/portaudio/portaudio.2015.vcxproj
+++ b/libs/win32/portaudio/portaudio.2017.vcxproj
@@ -1,863 +1,863 @@
-
-
-  
-    
-      Debug DirectSound
-      Win32
-    
-    
-      Debug DirectSound
-      x64
-    
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release DirectSound
-      Win32
-    
-    
-      Release DirectSound
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    portaudio
-    {0A18A071-125E-442F-AFF7-A3F68ABECF99}
-    portaudio
-  
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-    StaticLibrary
-    false
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-    
-    
-      Disabled
-      Default
-      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_DS;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4996;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_DS;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4996;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-    
-    
-      Disabled
-      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_DS;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4996;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-    
-    
-      Disabled
-      ..\..\portaudio\src\common;..\..\portaudio\include;.\;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_DS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4996;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-    
-    
-      Disabled
-      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_USE_DS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4996;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-    
-    
-      Disabled
-      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_USE_DS;PAWIN_USE_WDMKS_DEVICE_INFO;PAWIN_WDMKS_NO_KSGUID_LIB;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4996;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-    
-    
-      MaxSpeed
-      Default
-      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_USE_DS;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4996;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-    
-    
-      MaxSpeed
-      Default
-      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_USE_DS;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4996;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-  
-  
-    
-  
-  
-    
-      {c0779bcc-c037-4f58-b890-ef37ba956b3c}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug DirectSound
+      Win32
+    
+    
+      Debug DirectSound
+      x64
+    
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release DirectSound
+      Win32
+    
+    
+      Release DirectSound
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    portaudio
+    {0A18A071-125E-442F-AFF7-A3F68ABECF99}
+    portaudio
+  
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+    StaticLibrary
+    false
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+    
+    
+      Disabled
+      Default
+      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_DS;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4996;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_DS;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4996;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+    
+    
+      Disabled
+      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_DS;PAWIN_USE_WDMKS_DEVICE_INFO;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4996;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+    
+    
+      Disabled
+      ..\..\portaudio\src\common;..\..\portaudio\include;.\;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_NO_ASIO;PA_NO_DS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4996;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+    
+    
+      Disabled
+      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_USE_DS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4996;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+    
+    
+      Disabled
+      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_USE_DS;PAWIN_USE_WDMKS_DEVICE_INFO;PAWIN_WDMKS_NO_KSGUID_LIB;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4996;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+    
+    
+      MaxSpeed
+      Default
+      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_USE_DS;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4996;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+    
+    
+      MaxSpeed
+      Default
+      ..\..\portaudio\src\common;..\..\portaudio\include;.\;..\..\portaudio\src\os\win;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PA_USE_DS;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4996;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      ..\..\portaudio\src\hostapi\asio\ASIOSDK\host;..\..\portaudio\src\hostapi\asio\ASIOSDK\host\pc;..\..\portaudio\src\hostapi\asio\ASIOSDK\common;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+  
+  
+    
+  
+  
+    
+      {c0779bcc-c037-4f58-b890-ef37ba956b3c}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/pthread/pthread.2015.vcxproj b/libs/win32/pthread/pthread.2017.vcxproj
similarity index 96%
rename from libs/win32/pthread/pthread.2015.vcxproj
rename to libs/win32/pthread/pthread.2017.vcxproj
index 82c0fb2493..f9f6f9c817 100644
--- a/libs/win32/pthread/pthread.2015.vcxproj
+++ b/libs/win32/pthread/pthread.2017.vcxproj
@@ -1,456 +1,456 @@
-
-
-  
-    
-      Debug DLL
-      Win32
-    
-    
-      Debug DLL
-      x64
-    
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release DLL
-      Win32
-    
-    
-      Release DLL
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    pthread
-    {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
-    pthread
-  
-  
-  
-    DynamicLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(Platform)\$(Configuration)\
-    $(Platform)\pthread\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\pthread\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\pthread\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\pthread\$(Configuration)\
-    true
-    true
-    false
-    false
-    $(SolutionDir)$(PlatformName)\debug\
-    $(SolutionDir)$(PlatformName)\release\
-    $(SolutionDir)$(PlatformName)\release\
-    $(SolutionDir)$(PlatformName)\debug\
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-      .\./pthread.tlb
-      
-      
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PTW32_STATIC_LIB;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      .\./pthread.pch
-      $(IntDir)
-      $(IntDir)
-      $(IntDir)vc80.pdb
-      false
-      Level3
-      true
-    
-    
-      NDEBUG;PTW32_RC_MSC;PTW32_ARCHx86;%(PreprocessorDefinitions)
-      0x0409
-      .;%(AdditionalIncludeDirectories)
-    
-    
-      true
-      .\./pthread.bsc
-    
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-      .\./pthread.tlb
-      
-      
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PTW32_STATIC_LIB;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      .\./pthread.pch
-      $(IntDir)
-      $(IntDir)
-      $(IntDir)vc80.pdb
-      false
-      Level3
-      true
-    
-    
-      NDEBUG;PTW32_RC_MSC;PTW32_ARCHx64;WIN64;%(PreprocessorDefinitions)
-      0x0409
-      .;%(AdditionalIncludeDirectories)
-    
-    
-      true
-      .\./pthread.bsc
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-      .\./pthread.tlb
-      
-      
-    
-    
-      Disabled
-      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PTW32_STATIC_LIB;%(PreprocessorDefinitions)
-      false
-      Default
-      MultiThreadedDebugDLL
-      .\./pthread.pch
-      $(IntDir)
-      $(IntDir)
-      $(IntDir)vc80.pdb
-      false
-      Level3
-      true
-      ProgramDatabase
-    
-    
-      _DEBUG;PTW32_RC_MSC;PTW32_ARCHx86;%(PreprocessorDefinitions)
-      0x0409
-      .;%(AdditionalIncludeDirectories)
-    
-    
-      true
-      .\./pthread.bsc
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-      .\./pthread.tlb
-      
-      
-    
-    
-      Disabled
-      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PTW32_STATIC_LIB;%(PreprocessorDefinitions)
-      false
-      Default
-      MultiThreadedDebugDLL
-      .\./pthread.pch
-      $(IntDir)
-      $(IntDir)
-      $(IntDir)vc80.pdb
-      false
-      Level3
-      true
-      ProgramDatabase
-    
-    
-      _DEBUG;PTW32_RC_MSC;PTW32_ARCHx64;WIN64;%(PreprocessorDefinitions)
-      0x0409
-      .;%(AdditionalIncludeDirectories)
-    
-    
-      true
-      .\./pthread.bsc
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-    
-    
-      Disabled
-      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-    
-    
-      _DEBUG;PTW32_RC_MSC;PTW32_ARCHx86;%(PreprocessorDefinitions)
-      0x0409
-      .;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      true
-      true
-      false
-      MachineX86
-    
-    
-      true
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-    
-    
-      Disabled
-      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-    
-    
-      _DEBUG;PTW32_RC_MSC;PTW32_ARCHx64;WIN64;%(PreprocessorDefinitions)
-      0x0409
-      .;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      true
-      true
-      false
-      MachineX64
-    
-    
-      true
-    
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-    
-    
-      NDEBUG;PTW32_RC_MSC;PTW32_ARCHx86;%(PreprocessorDefinitions)
-      0x0409
-      .;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      true
-      false
-      MachineX86
-    
-    
-      true
-    
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-    
-    
-      NDEBUG;PTW32_RC_MSC;PTW32_ARCHx64;WIN64;%(PreprocessorDefinitions)
-      0x0409
-      .;%(AdditionalIncludeDirectories)
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      true
-      false
-      MachineX64
-    
-    
-      true
-    
-  
-  
-    
-  
-  
-    
-    
-    
-    
-  
-  
-    
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-    
-  
-  
-    
-      {8b3b4c4c-13c2-446c-beb0-f412cc2cfb9a}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug DLL
+      Win32
+    
+    
+      Debug DLL
+      x64
+    
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release DLL
+      Win32
+    
+    
+      Release DLL
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    pthread
+    {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}
+    pthread
+  
+  
+  
+    DynamicLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(Platform)\$(Configuration)\
+    $(Platform)\pthread\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\pthread\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\pthread\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\pthread\$(Configuration)\
+    true
+    true
+    false
+    false
+    $(SolutionDir)$(PlatformName)\debug\
+    $(SolutionDir)$(PlatformName)\release\
+    $(SolutionDir)$(PlatformName)\release\
+    $(SolutionDir)$(PlatformName)\debug\
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+      .\./pthread.tlb
+      
+      
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PTW32_STATIC_LIB;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      .\./pthread.pch
+      $(IntDir)
+      $(IntDir)
+      $(IntDir)vc80.pdb
+      false
+      Level3
+      true
+    
+    
+      NDEBUG;PTW32_RC_MSC;PTW32_ARCHx86;%(PreprocessorDefinitions)
+      0x0409
+      .;%(AdditionalIncludeDirectories)
+    
+    
+      true
+      .\./pthread.bsc
+    
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+      .\./pthread.tlb
+      
+      
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PTW32_STATIC_LIB;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      .\./pthread.pch
+      $(IntDir)
+      $(IntDir)
+      $(IntDir)vc80.pdb
+      false
+      Level3
+      true
+    
+    
+      NDEBUG;PTW32_RC_MSC;PTW32_ARCHx64;WIN64;%(PreprocessorDefinitions)
+      0x0409
+      .;%(AdditionalIncludeDirectories)
+    
+    
+      true
+      .\./pthread.bsc
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+      .\./pthread.tlb
+      
+      
+    
+    
+      Disabled
+      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PTW32_STATIC_LIB;%(PreprocessorDefinitions)
+      false
+      Default
+      MultiThreadedDebugDLL
+      .\./pthread.pch
+      $(IntDir)
+      $(IntDir)
+      $(IntDir)vc80.pdb
+      false
+      Level3
+      true
+      ProgramDatabase
+    
+    
+      _DEBUG;PTW32_RC_MSC;PTW32_ARCHx86;%(PreprocessorDefinitions)
+      0x0409
+      .;%(AdditionalIncludeDirectories)
+    
+    
+      true
+      .\./pthread.bsc
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+      .\./pthread.tlb
+      
+      
+    
+    
+      Disabled
+      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PTW32_STATIC_LIB;%(PreprocessorDefinitions)
+      false
+      Default
+      MultiThreadedDebugDLL
+      .\./pthread.pch
+      $(IntDir)
+      $(IntDir)
+      $(IntDir)vc80.pdb
+      false
+      Level3
+      true
+      ProgramDatabase
+    
+    
+      _DEBUG;PTW32_RC_MSC;PTW32_ARCHx64;WIN64;%(PreprocessorDefinitions)
+      0x0409
+      .;%(AdditionalIncludeDirectories)
+    
+    
+      true
+      .\./pthread.bsc
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+    
+    
+      Disabled
+      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+    
+    
+      _DEBUG;PTW32_RC_MSC;PTW32_ARCHx86;%(PreprocessorDefinitions)
+      0x0409
+      .;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      true
+      true
+      false
+      MachineX86
+    
+    
+      true
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+    
+    
+      Disabled
+      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+    
+    
+      _DEBUG;PTW32_RC_MSC;PTW32_ARCHx64;WIN64;%(PreprocessorDefinitions)
+      0x0409
+      .;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      true
+      true
+      false
+      MachineX64
+    
+    
+      true
+    
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+    
+    
+      NDEBUG;PTW32_RC_MSC;PTW32_ARCHx86;%(PreprocessorDefinitions)
+      0x0409
+      .;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      true
+      false
+      MachineX86
+    
+    
+      true
+    
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ../../pthreads-w32-2-9-1/;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;HAVE_CONFIG_H;__CLEANUP_C;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+    
+    
+      NDEBUG;PTW32_RC_MSC;PTW32_ARCHx64;WIN64;%(PreprocessorDefinitions)
+      0x0409
+      .;%(AdditionalIncludeDirectories)
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      true
+      false
+      MachineX64
+    
+    
+      true
+    
+  
+  
+    
+  
+  
+    
+    
+    
+    
+  
+  
+    
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+    
+  
+  
+    
+      {8b3b4c4c-13c2-446c-beb0-f412cc2cfb9a}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/sofia/libsofia_sip_ua_static.2015.vcxproj b/libs/win32/sofia/libsofia_sip_ua_static.2017.vcxproj
similarity index 97%
rename from libs/win32/sofia/libsofia_sip_ua_static.2015.vcxproj
rename to libs/win32/sofia/libsofia_sip_ua_static.2017.vcxproj
index d5717772be..faf9b7094a 100644
--- a/libs/win32/sofia/libsofia_sip_ua_static.2015.vcxproj
+++ b/libs/win32/sofia/libsofia_sip_ua_static.2017.vcxproj
@@ -1,529 +1,529 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libsofia_sip_ua_static
-    {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
-    libsofia_sip_ua_static
-  
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\sofia-sip\win32\gawk.exe" cscript /nologo "$(ProjectDir)..\util.vbs" Get http://files.freeswitch.org/downloads/win32/gawk.exe "$(ProjectDir)..\..\sofia-sip\win32\"
-cd /D "$(ProjectDir)..\..\sofia-sip\win32\"
-set AWK="$(ProjectDir)..\..\sofia-sip\win32\gawk.exe"
-if not exist "$(ProjectDir)..\..\sofia-sip\libsofia-sip-ua\http\http_parser_table.c"  "autogen.cmd"
-if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
-
-    
-    
-      Disabled
-      ..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\..\src\include;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      true
-      Level4
-      false
-      true
-      4456;4457;4459;4477;4244;4267;4306;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x040b
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\sofia-sip\win32\gawk.exe" cscript /nologo "$(ProjectDir)..\util.vbs" Get http://files.freeswitch.org/downloads/win32/gawk.exe "$(ProjectDir)..\..\sofia-sip\win32\"
-cd /D "$(ProjectDir)..\..\sofia-sip\win32\"
-set AWK="$(ProjectDir)..\..\sofia-sip\win32\gawk.exe"
-if not exist "$(ProjectDir)..\..\sofia-sip\libsofia-sip-ua\http\http_parser_table.c"  "autogen.cmd"
-if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
-
-
-    
-    
-      X64
-    
-    
-      Disabled
-      ..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\..\src\include;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;_WIN64;WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      true
-      Level4
-      false
-      true
-      4456;4457;4459;4477;4244;4267;4306;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x040b
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\sofia-sip\win32\gawk.exe" cscript /nologo "$(ProjectDir)..\util.vbs" Get http://files.freeswitch.org/downloads/win32/gawk.exe "$(ProjectDir)..\..\sofia-sip\win32\"
-cd /D "$(ProjectDir)..\..\sofia-sip\win32\"
-set AWK="$(ProjectDir)..\..\sofia-sip\win32\gawk.exe"
-if not exist "$(ProjectDir)..\..\sofia-sip\libsofia-sip-ua\http\http_parser_table.c"  "autogen.cmd"
-if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
-
-
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\..\src\include;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      true
-      Level4
-      false
-      true
-      4456;4457;4459;4477;4244;4267;4306;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x040b
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-      if not exist "$(ProjectDir)..\..\sofia-sip\win32\gawk.exe" cscript /nologo "$(ProjectDir)..\util.vbs" Get http://files.freeswitch.org/downloads/win32/gawk.exe "$(ProjectDir)..\..\sofia-sip\win32\"
-cd /D "$(ProjectDir)..\..\sofia-sip\win32\"
-set AWK="$(ProjectDir)..\..\sofia-sip\win32\gawk.exe"
-if not exist "$(ProjectDir)..\..\sofia-sip\libsofia-sip-ua\http\http_parser_table.c"  "autogen.cmd"
-if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
-
-
-    
-    
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\..\src\include;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;_WIN64;WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      true
-      Level4
-      false
-      true
-      4456;4457;4459;4477;4244;4267;4306;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x040b
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {8b3b4c4c-13c2-446c-beb0-f412cc2cfb9a}
-      false
-    
-    
-      {df018947-0fff-4eb3-bdee-441dc81da7a4}
-      false
-    
-  
-  
-  
-  
-
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libsofia_sip_ua_static
+    {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}
+    libsofia_sip_ua_static
+  
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\sofia-sip\win32\gawk.exe" cscript /nologo "$(ProjectDir)..\util.vbs" Get http://files.freeswitch.org/downloads/win32/gawk.exe "$(ProjectDir)..\..\sofia-sip\win32\"
+cd /D "$(ProjectDir)..\..\sofia-sip\win32\"
+set AWK="$(ProjectDir)..\..\sofia-sip\win32\gawk.exe"
+if not exist "$(ProjectDir)..\..\sofia-sip\libsofia-sip-ua\http\http_parser_table.c"  "autogen.cmd"
+if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
+
+    
+    
+      Disabled
+      ..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\..\src\include;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      true
+      Level4
+      false
+      true
+      4456;4457;4459;4477;4244;4267;4306;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x040b
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\sofia-sip\win32\gawk.exe" cscript /nologo "$(ProjectDir)..\util.vbs" Get http://files.freeswitch.org/downloads/win32/gawk.exe "$(ProjectDir)..\..\sofia-sip\win32\"
+cd /D "$(ProjectDir)..\..\sofia-sip\win32\"
+set AWK="$(ProjectDir)..\..\sofia-sip\win32\gawk.exe"
+if not exist "$(ProjectDir)..\..\sofia-sip\libsofia-sip-ua\http\http_parser_table.c"  "autogen.cmd"
+if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
+
+
+    
+    
+      X64
+    
+    
+      Disabled
+      ..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\..\src\include;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;_WIN64;WIN32;_DEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      true
+      Level4
+      false
+      true
+      4456;4457;4459;4477;4244;4267;4306;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x040b
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\sofia-sip\win32\gawk.exe" cscript /nologo "$(ProjectDir)..\util.vbs" Get http://files.freeswitch.org/downloads/win32/gawk.exe "$(ProjectDir)..\..\sofia-sip\win32\"
+cd /D "$(ProjectDir)..\..\sofia-sip\win32\"
+set AWK="$(ProjectDir)..\..\sofia-sip\win32\gawk.exe"
+if not exist "$(ProjectDir)..\..\sofia-sip\libsofia-sip-ua\http\http_parser_table.c"  "autogen.cmd"
+if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
+
+
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\..\src\include;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      true
+      Level4
+      false
+      true
+      4456;4457;4459;4477;4244;4267;4306;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x040b
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+      if not exist "$(ProjectDir)..\..\sofia-sip\win32\gawk.exe" cscript /nologo "$(ProjectDir)..\util.vbs" Get http://files.freeswitch.org/downloads/win32/gawk.exe "$(ProjectDir)..\..\sofia-sip\win32\"
+cd /D "$(ProjectDir)..\..\sofia-sip\win32\"
+set AWK="$(ProjectDir)..\..\sofia-sip\win32\gawk.exe"
+if not exist "$(ProjectDir)..\..\sofia-sip\libsofia-sip-ua\http\http_parser_table.c"  "autogen.cmd"
+if not exist "$(ProjectDir)$(IntDir)\auth_client.obj" "autogen.cmd"
+
+
+    
+    
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\..\sofia-sip\win32;..\..\sofia-sip\libsofia-sip-ua\su;..\..\sofia-sip\libsofia-sip-ua\ipt;..\..\sofia-sip\libsofia-sip-ua\sresolv;..\..\sofia-sip\libsofia-sip-ua\bnf;..\..\sofia-sip\libsofia-sip-ua\url;..\..\sofia-sip\libsofia-sip-ua\msg;..\..\sofia-sip\libsofia-sip-ua\sip;..\..\sofia-sip\libsofia-sip-ua\nta;..\..\sofia-sip\libsofia-sip-ua\nua;..\..\sofia-sip\libsofia-sip-ua\iptsec;..\..\sofia-sip\libsofia-sip-ua\http;..\..\sofia-sip\libsofia-sip-ua\nth;..\..\sofia-sip\libsofia-sip-ua\nea;..\..\sofia-sip\libsofia-sip-ua\sdp;..\..\sofia-sip\libsofia-sip-ua\soa;..\..\sofia-sip\libsofia-sip-ua\stun;..\..\sofia-sip\libsofia-sip-ua\tport;..\..\sofia-sip\libsofia-sip-ua\tport\include;..\..\sofia-sip\libsofia-sip-ua\features;..\..\pthreads-w32-2-9-1;.;..\..\..\src\include;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;_WIN64;WIN32;NDEBUG;_LIB;IN_LIBSOFIA_SIP_UA_STATIC;LIBSOFIA_SIP_UA_STATIC;LIBSRES_STATIC;PTW32_STATIC_LIB;HAVE_IPHLPAPI_H;SU_DEBUG=0;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      true
+      Level4
+      false
+      true
+      4456;4457;4459;4477;4244;4267;4306;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x040b
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {8b3b4c4c-13c2-446c-beb0-f412cc2cfb9a}
+      false
+    
+    
+      {df018947-0fff-4eb3-bdee-441dc81da7a4}
+      false
+    
+  
+  
+  
+  
+
\ No newline at end of file
diff --git a/libs/win32/speex/libspeex.2015.vcxproj b/libs/win32/speex/libspeex.2017.vcxproj
similarity index 96%
rename from libs/win32/speex/libspeex.2015.vcxproj
rename to libs/win32/speex/libspeex.2017.vcxproj
index 3a0024468e..990bba9591 100644
--- a/libs/win32/speex/libspeex.2015.vcxproj
+++ b/libs/win32/speex/libspeex.2017.vcxproj
@@ -1,648 +1,648 @@
-
-
-  
-    
-      Debug_RTL_dll
-      Win32
-    
-    
-      Debug_RTL_dll
-      x64
-    
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release_Dynamic
-      Win32
-    
-    
-      Release_Dynamic
-      x64
-    
-    
-      Release_RTL_dll
-      Win32
-    
-    
-      Release_RTL_dll
-      x64
-    
-    
-      Release_SSE2
-      Win32
-    
-    
-      Release_SSE2
-      x64
-    
-    
-      Release_SSE
-      Win32
-    
-    
-      Release_SSE
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {E972C52F-9E85-4D65-B19C-031E511E9DB4}
-    libspeex
-    Win32Proj
-    libspeex
-  
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(Configuration)\
-    $(Configuration)\
-    $(Configuration)\
-    $(Configuration)\
-    $(Configuration)\
-    $(Configuration)\
-    $(Configuration)\
-    $(Configuration)\
-    $(Configuration)\
-    $(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-  
-  
-    
-      Disabled
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      CompileAsC
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      false
-      
-      
-      TurnOffAllWarnings
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreaded
-      false
-      StreamingSIMDExtensions
-      
-      
-      Level4
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreaded
-      false
-      StreamingSIMDExtensions2
-      
-      
-      Level4
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreaded
-      false
-      
-      
-      Level4
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      libspeex.def
-      true
-      true
-      false
-      
-      
-    
-  
-  
-    
-      Disabled
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      Level4
-      EditAndContinue
-      CompileAsC
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreadedDLL
-      false
-      
-      
-      Level4
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      CompileAsC
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-      X64
-    
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      false
-      TurnOffAllWarnings
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-      X64
-    
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreaded
-      false
-      StreamingSIMDExtensions
-      
-      
-      Level4
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-      X64
-    
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreaded
-      false
-      StreamingSIMDExtensions2
-      
-      
-      Level4
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-      X64
-    
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreaded
-      false
-      
-      
-      Level4
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      libspeex.def
-      true
-      true
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      Level4
-      ProgramDatabase
-      CompileAsC
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-      X64
-    
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreadedDLL
-      false
-      
-      
-      Level4
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      $(OutDir)libspeex.lib
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {1bdab935-27dc-47e3-95ea-17e024d39c31}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug_RTL_dll
+      Win32
+    
+    
+      Debug_RTL_dll
+      x64
+    
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release_Dynamic
+      Win32
+    
+    
+      Release_Dynamic
+      x64
+    
+    
+      Release_RTL_dll
+      Win32
+    
+    
+      Release_RTL_dll
+      x64
+    
+    
+      Release_SSE2
+      Win32
+    
+    
+      Release_SSE2
+      x64
+    
+    
+      Release_SSE
+      Win32
+    
+    
+      Release_SSE
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {E972C52F-9E85-4D65-B19C-031E511E9DB4}
+    libspeex
+    Win32Proj
+    libspeex
+  
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(Configuration)\
+    $(Configuration)\
+    $(Configuration)\
+    $(Configuration)\
+    $(Configuration)\
+    $(Configuration)\
+    $(Configuration)\
+    $(Configuration)\
+    $(Configuration)\
+    $(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+  
+  
+    
+      Disabled
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      CompileAsC
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      false
+      
+      
+      TurnOffAllWarnings
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreaded
+      false
+      StreamingSIMDExtensions
+      
+      
+      Level4
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreaded
+      false
+      StreamingSIMDExtensions2
+      
+      
+      Level4
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreaded
+      false
+      
+      
+      Level4
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      libspeex.def
+      true
+      true
+      false
+      
+      
+    
+  
+  
+    
+      Disabled
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      Level4
+      EditAndContinue
+      CompileAsC
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreadedDLL
+      false
+      
+      
+      Level4
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      CompileAsC
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+      X64
+    
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      false
+      TurnOffAllWarnings
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+      X64
+    
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreaded
+      false
+      StreamingSIMDExtensions
+      
+      
+      Level4
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+      X64
+    
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreaded
+      false
+      StreamingSIMDExtensions2
+      
+      
+      Level4
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+      X64
+    
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreaded
+      false
+      
+      
+      Level4
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      libspeex.def
+      true
+      true
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      Level4
+      ProgramDatabase
+      CompileAsC
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+      X64
+    
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreadedDLL
+      false
+      
+      
+      Level4
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      $(OutDir)libspeex.lib
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {1bdab935-27dc-47e3-95ea-17e024d39c31}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/speex/libspeexdsp.2015.vcxproj b/libs/win32/speex/libspeexdsp.2017.vcxproj
similarity index 96%
rename from libs/win32/speex/libspeexdsp.2015.vcxproj
rename to libs/win32/speex/libspeexdsp.2017.vcxproj
index b30ea4e3d2..a62eacefda 100644
--- a/libs/win32/speex/libspeexdsp.2015.vcxproj
+++ b/libs/win32/speex/libspeexdsp.2017.vcxproj
@@ -1,385 +1,385 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release_Dynamic_SSE
-      Win32
-    
-    
-      Release_Dynamic_SSE
-      x64
-    
-    
-      Release_Static_SSE
-      Win32
-    
-    
-      Release_Static_SSE
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {03207781-0D1C-4DB3-A71D-45C608F28DBD}
-    Win32Proj
-    libspeexdsp
-    8.1
-  
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(Configuration)\
-    $(Platform)\$(Configuration)\$(ProjectName)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\$(ProjectName)\
-    $(Configuration)\
-    $(Platform)\$(Configuration)\$(ProjectName)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(Platform)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(Platform)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(Platform)\$(Configuration)\$(ProjectName)\
-  
-  
-    $(Platform)\$(Configuration)\$(ProjectName)\
-  
-  
-    
-      Disabled
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      CompileAsC
-      /FS %(AdditionalOptions)
-    
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      CompileAsC
-      /FS %(AdditionalOptions)
-    
-    
-  
-  
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      false
-      TurnOffAllWarnings
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-  
-  
-    
-      X64
-    
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      false
-      TurnOffAllWarnings
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-  
-  
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      _USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreadedDLL
-      false
-      StreamingSIMDExtensions
-      
-      
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      ../../../bin/libspeexdsp.dll
-      ..\..\libspeexdsp.def
-      Windows
-      true
-      true
-      false
-      
-      
-      ../../../lib/libspeexdsp.lib
-      MachineX86
-    
-  
-  
-    
-      X64
-    
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      _USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreadedDLL
-      false
-      StreamingSIMDExtensions
-      
-      
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      ../../../bin/libspeexdsp.dll
-      ..\..\libspeexdsp.def
-      Windows
-      true
-      true
-      false
-      
-      
-      ../../../lib/libspeexdsp.lib
-      MachineX64
-    
-  
-  
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      _USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreadedDLL
-      false
-      StreamingSIMDExtensions
-      
-      
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      ../../../lib/libspeexdsp.lib
-    
-  
-  
-    
-      X64
-    
-    
-      Full
-      AnySuitable
-      true
-      Speed
-      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
-      _USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      
-      
-      MultiThreadedDLL
-      false
-      StreamingSIMDExtensions
-      
-      
-      Level3
-      ProgramDatabase
-      CompileAsC
-      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
-      /FS %(AdditionalOptions)
-    
-    
-      ../../../lib/libspeexdsp.lib
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {1bdab935-27dc-47e3-95ea-17e024d39c31}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release_Dynamic_SSE
+      Win32
+    
+    
+      Release_Dynamic_SSE
+      x64
+    
+    
+      Release_Static_SSE
+      Win32
+    
+    
+      Release_Static_SSE
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {03207781-0D1C-4DB3-A71D-45C608F28DBD}
+    Win32Proj
+    libspeexdsp
+    8.1
+  
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(Configuration)\
+    $(Platform)\$(Configuration)\$(ProjectName)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\$(ProjectName)\
+    $(Configuration)\
+    $(Platform)\$(Configuration)\$(ProjectName)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(Platform)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(Platform)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(Platform)\$(Configuration)\$(ProjectName)\
+  
+  
+    $(Platform)\$(Configuration)\$(ProjectName)\
+  
+  
+    
+      Disabled
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      CompileAsC
+      /FS %(AdditionalOptions)
+    
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      CompileAsC
+      /FS %(AdditionalOptions)
+    
+    
+  
+  
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      false
+      TurnOffAllWarnings
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+  
+  
+    
+      X64
+    
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      false
+      TurnOffAllWarnings
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+  
+  
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      _USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreadedDLL
+      false
+      StreamingSIMDExtensions
+      
+      
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      ../../../bin/libspeexdsp.dll
+      ..\..\libspeexdsp.def
+      Windows
+      true
+      true
+      false
+      
+      
+      ../../../lib/libspeexdsp.lib
+      MachineX86
+    
+  
+  
+    
+      X64
+    
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      _USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreadedDLL
+      false
+      StreamingSIMDExtensions
+      
+      
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      ../../../bin/libspeexdsp.dll
+      ..\..\libspeexdsp.def
+      Windows
+      true
+      true
+      false
+      
+      
+      ../../../lib/libspeexdsp.lib
+      MachineX64
+    
+  
+  
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      _USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreadedDLL
+      false
+      StreamingSIMDExtensions
+      
+      
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      ../../../lib/libspeexdsp.lib
+    
+  
+  
+    
+      X64
+    
+    
+      Full
+      AnySuitable
+      true
+      Speed
+      $(ProjectDir);..\..\speex-1.2rc1\include;%(AdditionalIncludeDirectories)
+      _USE_SSE;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      
+      
+      MultiThreadedDLL
+      false
+      StreamingSIMDExtensions
+      
+      
+      Level3
+      ProgramDatabase
+      CompileAsC
+      4244;4305;4311;4100;4127;%(DisableSpecificWarnings)
+      /FS %(AdditionalOptions)
+    
+    
+      ../../../lib/libspeexdsp.lib
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {1bdab935-27dc-47e3-95ea-17e024d39c31}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/sphinxbase/sphinxbase.2015.vcxproj b/libs/win32/sphinxbase/sphinxbase.2017.vcxproj
similarity index 98%
rename from libs/win32/sphinxbase/sphinxbase.2015.vcxproj
rename to libs/win32/sphinxbase/sphinxbase.2017.vcxproj
index 78e22746ae..2b4fd6cb22 100644
--- a/libs/win32/sphinxbase/sphinxbase.2015.vcxproj
+++ b/libs/win32/sphinxbase/sphinxbase.2017.vcxproj
@@ -1,659 +1,659 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    sphinxbase
-    {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}
-    sphinxbase
-  
-  
-  
-    DynamicLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    false
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-    true
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\..\sphinxbase-0.7\include\win32;..\..\sphinxbase-0.7\include;%(AdditionalIncludeDirectories)
-      NDEBUG;WIN32;_WINDOWS;_USRDLL;SPHINXBASE_EXPORTS;HAVE_CONFIG_H;SPHINXDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      TurnOffAllWarnings
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      winmm.lib;%(AdditionalDependencies)
-      ..\..\..\Release;%(AdditionalLibraryDirectories)
-    
-    
-      true
-    
-  
-  
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\..\sphinxbase-0.7\include\win32;..\..\sphinxbase-0.7\include;%(AdditionalIncludeDirectories)
-      NDEBUG;WIN32;_WINDOWS;_USRDLL;SPHINXBASE_EXPORTS;HAVE_CONFIG_H;SPHINXDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      TurnOffAllWarnings
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      winmm.lib;%(AdditionalDependencies)
-      ..\..\..\Release;%(AdditionalLibraryDirectories)
-      MachineX64
-    
-    
-      true
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      Win32
-    
-    
-      Disabled
-      ..\..\sphinxbase-0.7\include\win32;..\..\sphinxbase-0.7\include;%(AdditionalIncludeDirectories)
-      _DEBUG;WIN32;_WINDOWS;_USRDLL;SPHINXBASE_EXPORTS;HAVE_CONFIG_H;SPHINXDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      true
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      winmm.lib;%(AdditionalDependencies)
-      true
-      ..\..\..\Debug;%(AdditionalLibraryDirectories)
-      true
-      false
-      MachineX86
-    
-    
-      true
-    
-  
-  
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      true
-      true
-      X64
-    
-    
-      Disabled
-      ..\..\sphinxbase-0.7\include\win32;..\..\sphinxbase-0.7\include;%(AdditionalIncludeDirectories)
-      _DEBUG;WIN32;_WINDOWS;_USRDLL;SPHINXBASE_EXPORTS;HAVE_CONFIG_H;SPHINXDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      true
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      winmm.lib;%(AdditionalDependencies)
-      true
-      ..\..\..\Debug;%(AdditionalLibraryDirectories)
-      true
-      false
-      MachineX64
-    
-    
-      true
-    
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-    
-    
-    
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {4f92b672-dadb-4047-8d6a-4bb3796733fd}
-      false
-    
-    
-      {2dee4895-1134-439c-b688-52203e57d878}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    sphinxbase
+    {2F025EAD-99BD-40F5-B2CC-F0A28CAD7F2D}
+    sphinxbase
+  
+  
+  
+    DynamicLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    false
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+    true
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\..\sphinxbase-0.7\include\win32;..\..\sphinxbase-0.7\include;%(AdditionalIncludeDirectories)
+      NDEBUG;WIN32;_WINDOWS;_USRDLL;SPHINXBASE_EXPORTS;HAVE_CONFIG_H;SPHINXDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      TurnOffAllWarnings
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      winmm.lib;%(AdditionalDependencies)
+      ..\..\..\Release;%(AdditionalLibraryDirectories)
+    
+    
+      true
+    
+  
+  
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\..\sphinxbase-0.7\include\win32;..\..\sphinxbase-0.7\include;%(AdditionalIncludeDirectories)
+      NDEBUG;WIN32;_WINDOWS;_USRDLL;SPHINXBASE_EXPORTS;HAVE_CONFIG_H;SPHINXDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      TurnOffAllWarnings
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      winmm.lib;%(AdditionalDependencies)
+      ..\..\..\Release;%(AdditionalLibraryDirectories)
+      MachineX64
+    
+    
+      true
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      Win32
+    
+    
+      Disabled
+      ..\..\sphinxbase-0.7\include\win32;..\..\sphinxbase-0.7\include;%(AdditionalIncludeDirectories)
+      _DEBUG;WIN32;_WINDOWS;_USRDLL;SPHINXBASE_EXPORTS;HAVE_CONFIG_H;SPHINXDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      true
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      winmm.lib;%(AdditionalDependencies)
+      true
+      ..\..\..\Debug;%(AdditionalLibraryDirectories)
+      true
+      false
+      MachineX86
+    
+    
+      true
+    
+  
+  
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      true
+      true
+      X64
+    
+    
+      Disabled
+      ..\..\sphinxbase-0.7\include\win32;..\..\sphinxbase-0.7\include;%(AdditionalIncludeDirectories)
+      _DEBUG;WIN32;_WINDOWS;_USRDLL;SPHINXBASE_EXPORTS;HAVE_CONFIG_H;SPHINXDLL;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      true
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      winmm.lib;%(AdditionalDependencies)
+      true
+      ..\..\..\Debug;%(AdditionalLibraryDirectories)
+      true
+      false
+      MachineX64
+    
+    
+      true
+    
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+    
+    
+    
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {4f92b672-dadb-4047-8d6a-4bb3796733fd}
+      false
+    
+    
+      {2dee4895-1134-439c-b688-52203e57d878}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/sqlite/sqlite.2015.vcxproj b/libs/win32/sqlite/sqlite.2017.vcxproj
similarity index 95%
rename from libs/win32/sqlite/sqlite.2015.vcxproj
rename to libs/win32/sqlite/sqlite.2017.vcxproj
index 316790eb4f..3c85ec0763 100644
--- a/libs/win32/sqlite/sqlite.2015.vcxproj
+++ b/libs/win32/sqlite/sqlite.2017.vcxproj
@@ -1,338 +1,338 @@
-
-
-  
-    
-      Debug DLL
-      Win32
-    
-    
-      Debug DLL
-      x64
-    
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release DLL
-      Win32
-    
-    
-      Release DLL
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libsqlite
-    {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
-    libsqlite
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-  
-  
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(SolutionDir)$(Platform)\$(Configuration)\
-    $(Platform)\sqlite\$(Configuration)\
-    false
-    $(SolutionDir)$(Platform)\$(Configuration)\
-    $(Platform)\sqlite\$(Configuration)\
-    false
-    $(SolutionDir)$(Platform)\$(Configuration)\
-    $(Platform)\sqlite\$(Configuration)\
-    false
-    $(SolutionDir)$(Platform)\$(Configuration)\
-    $(Platform)\sqlite\$(Configuration)\
-    false
-  
-  
-    
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;SQLITE_DEBUG;THREADSAFE=1;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      /FS %(AdditionalOptions)
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-      X64
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;SQLITE_DEBUG;THREADSAFE=1;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      TurnOffAllWarnings
-      /FS %(AdditionalOptions)
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;THREADSAFE=1;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      TurnOffAllWarnings
-      /FS %(AdditionalOptions)
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-      X64
-    
-    
-      %(AdditionalIncludeDirectories)
-      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;THREADSAFE=1;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      TurnOffAllWarnings
-      /FS %(AdditionalOptions)
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;SQLITE_DEBUG;THREADSAFE=1;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      TurnOffAllWarnings
-      ProgramDatabase
-      /FS %(AdditionalOptions)
-    
-    
-      sqlite3.def
-      true
-      $(IntDir)$(ProjectName).pdb
-      Windows
-      false
-      
-      
-      $(IntDir)$(TargetName).lib
-      MachineX86
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-      X64
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;SQLITE_DEBUG;THREADSAFE=1;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      TurnOffAllWarnings
-      ProgramDatabase
-      /FS %(AdditionalOptions)
-    
-    
-      sqlite3.def
-      true
-      $(IntDir)$(ProjectName).pdb
-      Windows
-      false
-      
-      
-      $(IntDir)$(TargetName).lib
-      MachineX64
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-      %(AdditionalIncludeDirectories)
-      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;THREADSAFE=1;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      
-      
-      TurnOffAllWarnings
-      ProgramDatabase
-      /FS %(AdditionalOptions)
-    
-    
-      sqlite3.def
-      false
-      
-      
-      $(IntDir)$(TargetName).lib
-    
-    
-      
-      
-    
-  
-  
-    
-    
-    
-      X64
-    
-    
-      %(AdditionalIncludeDirectories)
-      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;THREADSAFE=1;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      
-      
-      TurnOffAllWarnings
-      ProgramDatabase
-      /FS %(AdditionalOptions)
-    
-    
-      sqlite3.def
-      false
-      
-      
-      $(IntDir)$(TargetName).lib
-      MachineX64
-    
-    
-      
-      
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-      {97d25665-34cd-4e0c-96e7-88f0795b8883}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug DLL
+      Win32
+    
+    
+      Debug DLL
+      x64
+    
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release DLL
+      Win32
+    
+    
+      Release DLL
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libsqlite
+    {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}
+    libsqlite
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\sqlite\$(Configuration)\
+    false
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\sqlite\$(Configuration)\
+    false
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\sqlite\$(Configuration)\
+    false
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\sqlite\$(Configuration)\
+    false
+  
+  
+    
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;SQLITE_DEBUG;THREADSAFE=1;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      /FS %(AdditionalOptions)
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+      X64
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;SQLITE_DEBUG;THREADSAFE=1;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      TurnOffAllWarnings
+      /FS %(AdditionalOptions)
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;THREADSAFE=1;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      TurnOffAllWarnings
+      /FS %(AdditionalOptions)
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+      X64
+    
+    
+      %(AdditionalIncludeDirectories)
+      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;THREADSAFE=1;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      TurnOffAllWarnings
+      /FS %(AdditionalOptions)
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;SQLITE_DEBUG;THREADSAFE=1;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      TurnOffAllWarnings
+      ProgramDatabase
+      /FS %(AdditionalOptions)
+    
+    
+      sqlite3.def
+      true
+      $(IntDir)$(ProjectName).pdb
+      Windows
+      false
+      
+      
+      $(IntDir)$(TargetName).lib
+      MachineX86
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+      X64
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_DEBUG;_LIB;SQLITE_DEBUG;THREADSAFE=1;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      TurnOffAllWarnings
+      ProgramDatabase
+      /FS %(AdditionalOptions)
+    
+    
+      sqlite3.def
+      true
+      $(IntDir)$(ProjectName).pdb
+      Windows
+      false
+      
+      
+      $(IntDir)$(TargetName).lib
+      MachineX64
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+      %(AdditionalIncludeDirectories)
+      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;THREADSAFE=1;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+      TurnOffAllWarnings
+      ProgramDatabase
+      /FS %(AdditionalOptions)
+    
+    
+      sqlite3.def
+      false
+      
+      
+      $(IntDir)$(TargetName).lib
+    
+    
+      
+      
+    
+  
+  
+    
+    
+    
+      X64
+    
+    
+      %(AdditionalIncludeDirectories)
+      _CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32;NDEBUG;_LIB;THREADSAFE=1;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+      TurnOffAllWarnings
+      ProgramDatabase
+      /FS %(AdditionalOptions)
+    
+    
+      sqlite3.def
+      false
+      
+      
+      $(IntDir)$(TargetName).lib
+      MachineX64
+    
+    
+      
+      
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+      {97d25665-34cd-4e0c-96e7-88f0795b8883}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/udns/libudns.2015.vcxproj b/libs/win32/udns/libudns.2017.vcxproj
similarity index 94%
rename from libs/win32/udns/libudns.2015.vcxproj
rename to libs/win32/udns/libudns.2017.vcxproj
index f078ad67fc..b6e9fb0479 100644
--- a/libs/win32/udns/libudns.2015.vcxproj
+++ b/libs/win32/udns/libudns.2017.vcxproj
@@ -1,137 +1,137 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    libudns
-    {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
-    libudns
-    Win32Proj
-  
-  
-  
-    StaticLibrary
-    NotSet
-    false
-    v140
-  
-  
-    StaticLibrary
-    NotSet
-    v140
-  
-  
-    StaticLibrary
-    NotSet
-    false
-    v140
-  
-  
-    StaticLibrary
-    NotSet
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      Disabled
-      WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-    
-  
-  
-    
-      Disabled
-      WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Level3
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Level3
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    libudns
+    {4043FC6A-9A30-4577-8AD5-9B233C9575D8}
+    libudns
+    Win32Proj
+  
+  
+  
+    StaticLibrary
+    NotSet
+    false
+    v141
+  
+  
+    StaticLibrary
+    NotSet
+    v141
+  
+  
+    StaticLibrary
+    NotSet
+    false
+    v141
+  
+  
+    StaticLibrary
+    NotSet
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      Disabled
+      WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+    
+  
+  
+    
+      Disabled
+      WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Level3
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Level3
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/xmlrpc-c/abyss.2015.vcxproj b/libs/win32/xmlrpc-c/abyss.2017.vcxproj
similarity index 95%
rename from libs/win32/xmlrpc-c/abyss.2015.vcxproj
rename to libs/win32/xmlrpc-c/abyss.2017.vcxproj
index 8cae3b07e9..0d5172757b 100644
--- a/libs/win32/xmlrpc-c/abyss.2015.vcxproj
+++ b/libs/win32/xmlrpc-c/abyss.2017.vcxproj
@@ -1,205 +1,205 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    abyss
-    {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}
-    abyss
-  
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\abyss\$(Configuration)\
-    $(PlatformName)\abyss\$(Configuration)\
-    $(PlatformName)\abyss\$(Configuration)\
-    $(PlatformName)\abyss\$(Configuration)\
-  
-  
-    
-      Disabled
-      ..\;..\include;..\lib\util\include;.;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;ABYSS_WIN32;_THREAD;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4267;4244;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      ..\;..\include;..\lib\util\include;.;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;ABYSS_WIN32;_THREAD;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-      4267;4244;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\;..\include;..\lib\util\include;.;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;ABYSS_WIN32;_THREAD;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4267;4244;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..\;..\include;..\lib\util\include;.;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;ABYSS_WIN32;_THREAD;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4267;4244;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    abyss
+    {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}
+    abyss
+  
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\abyss\$(Configuration)\
+    $(PlatformName)\abyss\$(Configuration)\
+    $(PlatformName)\abyss\$(Configuration)\
+    $(PlatformName)\abyss\$(Configuration)\
+  
+  
+    
+      Disabled
+      ..\;..\include;..\lib\util\include;.;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;ABYSS_WIN32;_THREAD;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4267;4244;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      ..\;..\include;..\lib\util\include;.;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;ABYSS_WIN32;_THREAD;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+      4267;4244;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\;..\include;..\lib\util\include;.;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;ABYSS_WIN32;_THREAD;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4267;4244;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..\;..\include;..\lib\util\include;.;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;ABYSS_WIN32;_THREAD;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4267;4244;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/xmlrpc-c/gennmtab.2015.vcxproj b/libs/win32/xmlrpc-c/gennmtab.2017.vcxproj
similarity index 96%
rename from libs/win32/xmlrpc-c/gennmtab.2015.vcxproj
rename to libs/win32/xmlrpc-c/gennmtab.2017.vcxproj
index ddc62f6254..8ed58fe423 100644
--- a/libs/win32/xmlrpc-c/gennmtab.2015.vcxproj
+++ b/libs/win32/xmlrpc-c/gennmtab.2017.vcxproj
@@ -1,330 +1,330 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {BED7539C-0099-4A14-AD5D-30828F15A171}
-    gennmtab
-  
-  
-  
-    Application
-    false
-    v140
-  
-  
-    Application
-    false
-    v140
-  
-  
-    Application
-    false
-    v140
-  
-  
-    Application
-    false
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\gennmtab\$(Configuration)\
-    $(PlatformName)\gennmtab\$(Configuration)\
-    true
-    true
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    $(PlatformName)\gennmtab\$(Configuration)\
-    $(PlatformName)\gennmtab\$(Configuration)\
-    false
-    false
-    AllRules.ruleset
-    AllRules.ruleset
-    
-    
-    
-    
-    AllRules.ruleset
-    AllRules.ruleset
-    
-    
-    
-    
-    true
-    true
-    true
-    true
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    false
-  
-  
-    false
-  
-  
-    false
-  
-  
-    false
-  
-  
-    
-      .\Debug\gennmtab/gennmtab.tlb
-      
-      
-    
-    
-      Disabled
-      ..;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDebug
-      Level3
-      true
-      EditAndContinue
-      
-      
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0809
-    
-    
-      true
-      true
-      Console
-      false
-      
-      
-      MachineX86
-      false
-    
-    
-      true
-      .\Debug\gennmtab/gennmtab.bsc
-    
-    
-      Generating nametab.h ...
-      $(OutDir)$(TargetName) > $(XMLRPCDir)lib\expat\xmltok\nametab.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      NoOutput
-    
-  
-  
-    
-      .\Debug\gennmtab/gennmtab.tlb
-      
-      
-    
-    
-      Disabled
-      ..;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      MultiThreadedDebug
-      
-      
-      Level3
-      true
-      ProgramDatabase
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0809
-    
-    
-      $(OutDir)$(TargetName)$(TargetExt)
-      true
-      true
-      Console
-      false
-      
-      
-      false
-    
-    
-      true
-      .\Debug\gennmtab/gennmtab.bsc
-    
-    
-      Generating nametab.h ...
-      $(OutDir)$(TargetName) > $(XMLRPCDir)lib\expat\xmltok\nametab.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      NoOutput
-    
-  
-  
-    
-      .\Release\gennmtab/gennmtab.tlb
-      
-      
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      true
-      MultiThreaded
-      true
-      
-      
-      Level3
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0809
-    
-    
-      true
-      Console
-      false
-      
-      
-      MachineX86
-    
-    
-      true
-      .\Release\gennmtab/gennmtab.bsc
-    
-    
-      Generating nametab.h ...
-      $(OutDir)$(TargetName) > $(XMLRPCDir)lib\expat\xmltok\nametab.h
-    
-    
-      
-      
-    
-    
-      NoOutput
-      
-      
-    
-  
-  
-    
-      .\Release\gennmtab/gennmtab.tlb
-      
-      
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ..;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      true
-      MultiThreaded
-      true
-      
-      
-      Level3
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0809
-    
-    
-      $(OutDir)$(TargetName)$(TargetExt)
-      true
-      Console
-      false
-      
-      
-    
-    
-      true
-      .\Release\gennmtab/gennmtab.bsc
-    
-    
-      Generating nametab.h ...
-      $(OutDir)$(TargetName) > $(XMLRPCDir)lib\expat\xmltok\nametab.h
-    
-    
-      
-      
-    
-    
-      
-      
-    
-    
-      NoOutput
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {BED7539C-0099-4A14-AD5D-30828F15A171}
+    gennmtab
+  
+  
+  
+    Application
+    false
+    v141
+  
+  
+    Application
+    false
+    v141
+  
+  
+    Application
+    false
+    v141
+  
+  
+    Application
+    false
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\gennmtab\$(Configuration)\
+    $(PlatformName)\gennmtab\$(Configuration)\
+    true
+    true
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    $(PlatformName)\gennmtab\$(Configuration)\
+    $(PlatformName)\gennmtab\$(Configuration)\
+    false
+    false
+    AllRules.ruleset
+    AllRules.ruleset
+    
+    
+    
+    
+    AllRules.ruleset
+    AllRules.ruleset
+    
+    
+    
+    
+    true
+    true
+    true
+    true
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    false
+  
+  
+    false
+  
+  
+    false
+  
+  
+    false
+  
+  
+    
+      .\Debug\gennmtab/gennmtab.tlb
+      
+      
+    
+    
+      Disabled
+      ..;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDebug
+      Level3
+      true
+      EditAndContinue
+      
+      
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0809
+    
+    
+      true
+      true
+      Console
+      false
+      
+      
+      MachineX86
+      false
+    
+    
+      true
+      .\Debug\gennmtab/gennmtab.bsc
+    
+    
+      Generating nametab.h ...
+      $(OutDir)$(TargetName) > $(XMLRPCDir)lib\expat\xmltok\nametab.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+    
+      NoOutput
+    
+  
+  
+    
+      .\Debug\gennmtab/gennmtab.tlb
+      
+      
+    
+    
+      Disabled
+      ..;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      MultiThreadedDebug
+      
+      
+      Level3
+      true
+      ProgramDatabase
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0809
+    
+    
+      $(OutDir)$(TargetName)$(TargetExt)
+      true
+      true
+      Console
+      false
+      
+      
+      false
+    
+    
+      true
+      .\Debug\gennmtab/gennmtab.bsc
+    
+    
+      Generating nametab.h ...
+      $(OutDir)$(TargetName) > $(XMLRPCDir)lib\expat\xmltok\nametab.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+    
+      NoOutput
+    
+  
+  
+    
+      .\Release\gennmtab/gennmtab.tlb
+      
+      
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      true
+      MultiThreaded
+      true
+      
+      
+      Level3
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0809
+    
+    
+      true
+      Console
+      false
+      
+      
+      MachineX86
+    
+    
+      true
+      .\Release\gennmtab/gennmtab.bsc
+    
+    
+      Generating nametab.h ...
+      $(OutDir)$(TargetName) > $(XMLRPCDir)lib\expat\xmltok\nametab.h
+    
+    
+      
+      
+    
+    
+      NoOutput
+      
+      
+    
+  
+  
+    
+      .\Release\gennmtab/gennmtab.tlb
+      
+      
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ..;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      true
+      MultiThreaded
+      true
+      
+      
+      Level3
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0809
+    
+    
+      $(OutDir)$(TargetName)$(TargetExt)
+      true
+      Console
+      false
+      
+      
+    
+    
+      true
+      .\Release\gennmtab/gennmtab.bsc
+    
+    
+      Generating nametab.h ...
+      $(OutDir)$(TargetName) > $(XMLRPCDir)lib\expat\xmltok\nametab.h
+    
+    
+      
+      
+    
+    
+      
+      
+    
+    
+      NoOutput
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/xmlrpc-c/xmlparse.2015.vcxproj b/libs/win32/xmlrpc-c/xmlparse.2017.vcxproj
similarity index 95%
rename from libs/win32/xmlrpc-c/xmlparse.2015.vcxproj
rename to libs/win32/xmlrpc-c/xmlparse.2017.vcxproj
index d57624da0f..b6f648e344 100644
--- a/libs/win32/xmlrpc-c/xmlparse.2015.vcxproj
+++ b/libs/win32/xmlrpc-c/xmlparse.2017.vcxproj
@@ -1,258 +1,258 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    xmlparse
-    {0D108721-EAE8-4BAF-8102-D8960EC93647}
-    xmlparse
-  
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\xmlparse\$(Configuration)\
-    $(PlatformName)\xmlparse\$(Configuration)\
-    $(PlatformName)\xmlparse\$(Configuration)\
-    $(PlatformName)\xmlparse\$(Configuration)\
-    $(ProjectDir)..\version.h;$(ExtensionsToDeleteOnClean)
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      MaxSpeed
-      OnlyExplicitInline
-      $(XMLRPCDir)lib\expat\xmltok;$(XMLRPCDir)lib\expat\xmlwf;%(AdditionalIncludeDirectories)
-      NDEBUG;WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4267;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-    
-      if not exist "$(XMLRPCDir)xmlrpc_config.h" (
-pushd $(XMLRPCDir)Windows
-"ConfigureWin32.bat"
-popd
-)
-	
-    
-    
-      
-      
-      NoOutput
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      $(XMLRPCDir)lib\expat\xmltok;$(XMLRPCDir)lib\expat\xmlwf;%(AdditionalIncludeDirectories)
-      NDEBUG;WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      4267;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-    
-      if not exist "$(XMLRPCDir)xmlrpc_config.h" (
-pushd $(XMLRPCDir)Windows
-"ConfigureWin32.bat"
-popd
-)	
-      
-    
-    
-      
-      
-      NoOutput
-    
-  
-  
-    
-      Disabled
-      $(XMLRPCDir)lib\expat\xmltok;$(XMLRPCDir)lib\expat\xmlwf;%(AdditionalIncludeDirectories)
-      WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-      ProgramDatabase
-      4267;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-    
-      if not exist "$(XMLRPCDir)xmlrpc_config.h" (
-pushd $(XMLRPCDir)Windows
-"ConfigureWin32.bat"
-popd
-)	
-      
-    
-    
-      
-      
-      NoOutput
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      $(XMLRPCDir)lib\expat\xmltok;$(XMLRPCDir)lib\expat\xmlwf;%(AdditionalIncludeDirectories)
-      WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-      ProgramDatabase
-      4267;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-    
-      if not exist "$(XMLRPCDir)xmlrpc_config.h" (
-pushd $(XMLRPCDir)Windows
-"ConfigureWin32.bat"
-popd
-)	
-      
-    
-    
-      
-      
-      NoOutput
-    
-  
-  
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    xmlparse
+    {0D108721-EAE8-4BAF-8102-D8960EC93647}
+    xmlparse
+  
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\xmlparse\$(Configuration)\
+    $(PlatformName)\xmlparse\$(Configuration)\
+    $(PlatformName)\xmlparse\$(Configuration)\
+    $(PlatformName)\xmlparse\$(Configuration)\
+    $(ProjectDir)..\version.h;$(ExtensionsToDeleteOnClean)
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      MaxSpeed
+      OnlyExplicitInline
+      $(XMLRPCDir)lib\expat\xmltok;$(XMLRPCDir)lib\expat\xmlwf;%(AdditionalIncludeDirectories)
+      NDEBUG;WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4267;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+    
+      if not exist "$(XMLRPCDir)xmlrpc_config.h" (
+pushd $(XMLRPCDir)Windows
+"ConfigureWin32.bat"
+popd
+)
+	
+    
+    
+      
+      
+      NoOutput
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      $(XMLRPCDir)lib\expat\xmltok;$(XMLRPCDir)lib\expat\xmlwf;%(AdditionalIncludeDirectories)
+      NDEBUG;WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      4267;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+    
+      if not exist "$(XMLRPCDir)xmlrpc_config.h" (
+pushd $(XMLRPCDir)Windows
+"ConfigureWin32.bat"
+popd
+)	
+      
+    
+    
+      
+      
+      NoOutput
+    
+  
+  
+    
+      Disabled
+      $(XMLRPCDir)lib\expat\xmltok;$(XMLRPCDir)lib\expat\xmlwf;%(AdditionalIncludeDirectories)
+      WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+      ProgramDatabase
+      4267;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+    
+      if not exist "$(XMLRPCDir)xmlrpc_config.h" (
+pushd $(XMLRPCDir)Windows
+"ConfigureWin32.bat"
+popd
+)	
+      
+    
+    
+      
+      
+      NoOutput
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      $(XMLRPCDir)lib\expat\xmltok;$(XMLRPCDir)lib\expat\xmlwf;%(AdditionalIncludeDirectories)
+      WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+      ProgramDatabase
+      4267;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+    
+      if not exist "$(XMLRPCDir)xmlrpc_config.h" (
+pushd $(XMLRPCDir)Windows
+"ConfigureWin32.bat"
+popd
+)	
+      
+    
+    
+      
+      
+      NoOutput
+    
+  
+  
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/xmlrpc-c/xmlrpc.2015.vcxproj b/libs/win32/xmlrpc-c/xmlrpc.2017.vcxproj
similarity index 95%
rename from libs/win32/xmlrpc-c/xmlrpc.2015.vcxproj
rename to libs/win32/xmlrpc-c/xmlrpc.2017.vcxproj
index c9234e2f6c..2fcbb5b6ff 100644
--- a/libs/win32/xmlrpc-c/xmlrpc.2015.vcxproj
+++ b/libs/win32/xmlrpc-c/xmlrpc.2017.vcxproj
@@ -1,253 +1,253 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    xmlrpc
-    {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}
-    xmlrpc
-  
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\xmlrpc\$(Configuration)\
-    $(PlatformName)\xmlrpc\$(Configuration)\
-    $(PlatformName)\xmlrpc\$(Configuration)\
-    $(PlatformName)\xmlrpc\$(Configuration)\
-    
-    
-  
-  
-    
-      Disabled
-      $(XMLRPCDir)lib\expat\xmlparse;%(AdditionalIncludeDirectories)
-      _DEBUG;WIN32;_LIB;ABYSS_WIN32;CURL_STATICLIB;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-      6031;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-    
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      $(XMLRPCDir)lib\expat\xmlparse;%(AdditionalIncludeDirectories)
-      _DEBUG;WIN32;_LIB;ABYSS_WIN32;CURL_STATICLIB;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-      6031;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-      .\Debug\xmlrpc/xmlrpc.bsc
-    
-    
-      
-      
-    
-  
-  
-    
-      MaxSpeed
-      OnlyExplicitInline
-      $(XMLRPCDir)lib\expat\xmlparse;%(AdditionalIncludeDirectories)
-      NDEBUG;WIN32;_LIB;ABYSS_WIN32;CURL_STATICLIB;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      6031;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-    
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      $(XMLRPCDir)lib\expat\xmlparse;%(AdditionalIncludeDirectories)
-      NDEBUG;WIN32;_LIB;ABYSS_WIN32;CURL_STATICLIB;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-      6031;4312;4267;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-    
-      
-      
-      
-      
-      
-      
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {0d108721-eae8-4baf-8102-d8960ec93647}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    xmlrpc
+    {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}
+    xmlrpc
+  
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\xmlrpc\$(Configuration)\
+    $(PlatformName)\xmlrpc\$(Configuration)\
+    $(PlatformName)\xmlrpc\$(Configuration)\
+    $(PlatformName)\xmlrpc\$(Configuration)\
+    
+    
+  
+  
+    
+      Disabled
+      $(XMLRPCDir)lib\expat\xmlparse;%(AdditionalIncludeDirectories)
+      _DEBUG;WIN32;_LIB;ABYSS_WIN32;CURL_STATICLIB;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+      6031;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+    
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      $(XMLRPCDir)lib\expat\xmlparse;%(AdditionalIncludeDirectories)
+      _DEBUG;WIN32;_LIB;ABYSS_WIN32;CURL_STATICLIB;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+      6031;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+      .\Debug\xmlrpc/xmlrpc.bsc
+    
+    
+      
+      
+    
+  
+  
+    
+      MaxSpeed
+      OnlyExplicitInline
+      $(XMLRPCDir)lib\expat\xmlparse;%(AdditionalIncludeDirectories)
+      NDEBUG;WIN32;_LIB;ABYSS_WIN32;CURL_STATICLIB;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      6031;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+    
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      $(XMLRPCDir)lib\expat\xmlparse;%(AdditionalIncludeDirectories)
+      NDEBUG;WIN32;_LIB;ABYSS_WIN32;CURL_STATICLIB;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+      6031;4312;4267;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+    
+      
+      
+      
+      
+      
+      
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {0d108721-eae8-4baf-8102-d8960ec93647}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/libs/win32/xmlrpc-c/xmltok.2015.vcxproj b/libs/win32/xmlrpc-c/xmltok.2017.vcxproj
similarity index 95%
rename from libs/win32/xmlrpc-c/xmltok.2015.vcxproj
rename to libs/win32/xmlrpc-c/xmltok.2017.vcxproj
index 485670aa48..51a4c27df6 100644
--- a/libs/win32/xmlrpc-c/xmltok.2015.vcxproj
+++ b/libs/win32/xmlrpc-c/xmltok.2017.vcxproj
@@ -1,208 +1,208 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    xmltok
-    {B535402E-38D2-4D54-8360-423ACBD17192}
-    xmltok
-  
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\xmltok\$(Configuration)\
-    $(PlatformName)\xmltok\$(Configuration)\
-    $(PlatformName)\xmltok\$(Configuration)\
-    $(PlatformName)\xmltok\$(Configuration)\
-  
-  
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      _DEBUG;WIN32;_WINDOWS;XML_DTD;XML_NS;_LIB;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-      .\Debug\xmltok/xmltok.bsc
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      _DEBUG;WIN32;_WINDOWS;XML_DTD;XML_NS;_LIB;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      true
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-      .\Debug\xmltok/xmltok.bsc
-    
-  
-  
-    
-      MaxSpeed
-      OnlyExplicitInline
-      %(AdditionalIncludeDirectories)
-      NDEBUG;XML_NS;WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-      .\Release\xmltok/xmltok.bsc
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      %(AdditionalIncludeDirectories)
-      NDEBUG;XML_NS;WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      Level3
-      true
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-      .\Release\xmltok/xmltok.bsc
-    
-  
-  
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {bed7539c-0099-4a14-ad5d-30828f15a171}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    xmltok
+    {B535402E-38D2-4D54-8360-423ACBD17192}
+    xmltok
+  
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\xmltok\$(Configuration)\
+    $(PlatformName)\xmltok\$(Configuration)\
+    $(PlatformName)\xmltok\$(Configuration)\
+    $(PlatformName)\xmltok\$(Configuration)\
+  
+  
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      _DEBUG;WIN32;_WINDOWS;XML_DTD;XML_NS;_LIB;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+      .\Debug\xmltok/xmltok.bsc
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      _DEBUG;WIN32;_WINDOWS;XML_DTD;XML_NS;_LIB;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      true
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+      .\Debug\xmltok/xmltok.bsc
+    
+  
+  
+    
+      MaxSpeed
+      OnlyExplicitInline
+      %(AdditionalIncludeDirectories)
+      NDEBUG;XML_NS;WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+      .\Release\xmltok/xmltok.bsc
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      %(AdditionalIncludeDirectories)
+      NDEBUG;XML_NS;WIN32;_WINDOWS;XML_DTD;_LIB;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      Level3
+      true
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+      .\Release\xmltok/xmltok.bsc
+    
+  
+  
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {bed7539c-0099-4a14-ad5d-30828f15a171}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_abstraction/mod_abstraction.2015.vcxproj b/src/mod/applications/mod_abstraction/mod_abstraction.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_abstraction/mod_abstraction.2015.vcxproj
rename to src/mod/applications/mod_abstraction/mod_abstraction.2017.vcxproj
index 4103b2a84f..b734db2233 100644
--- a/src/mod/applications/mod_abstraction/mod_abstraction.2015.vcxproj
+++ b/src/mod/applications/mod_abstraction/mod_abstraction.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_abstraction
-    {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}
-    mod_abstraction
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_abstraction
+    {60C542EE-6882-4EA2-8C21-5AB6DB1BA73F}
+    mod_abstraction
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_av/mod_av.2015.vcxproj b/src/mod/applications/mod_av/mod_av.2017.vcxproj
similarity index 96%
rename from src/mod/applications/mod_av/mod_av.2015.vcxproj
rename to src/mod/applications/mod_av/mod_av.2017.vcxproj
index 20b0354f71..0ce841de08 100644
--- a/src/mod/applications/mod_av/mod_av.2015.vcxproj
+++ b/src/mod/applications/mod_av/mod_av.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,25 +28,25 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
-  
+  
   
   
   
@@ -141,11 +141,11 @@
     
   
   
-    
+    
       {841C345F-FCC7-4F64-8F54-0281CEABEB01}
       false
     
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
diff --git a/src/mod/applications/mod_avmd/mod_avmd.2015.vcxproj b/src/mod/applications/mod_avmd/mod_avmd.2017.vcxproj
similarity index 94%
rename from src/mod/applications/mod_avmd/mod_avmd.2015.vcxproj
rename to src/mod/applications/mod_avmd/mod_avmd.2017.vcxproj
index af115acd8c..f75d309b75 100644
--- a/src/mod/applications/mod_avmd/mod_avmd.2015.vcxproj
+++ b/src/mod/applications/mod_avmd/mod_avmd.2017.vcxproj
@@ -1,157 +1,157 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_avmd
-    {990BAA76-89D3-4E38-8479-C7B28784EFC8}
-    mod_avmd
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-    
-      false
-      
-      
-      %(AdditionalDependencies)
-      %(AdditionalLibraryDirectories)
-    
-    
-      
-      
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      true
-      false
-      false
-      true
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_avmd
+    {990BAA76-89D3-4E38-8479-C7B28784EFC8}
+    mod_avmd
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+    
+      false
+      
+      
+      %(AdditionalDependencies)
+      %(AdditionalLibraryDirectories)
+    
+    
+      
+      
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      true
+      false
+      false
+      true
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_blacklist/mod_blacklist.2015.vcxproj b/src/mod/applications/mod_blacklist/mod_blacklist.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_blacklist/mod_blacklist.2015.vcxproj
rename to src/mod/applications/mod_blacklist/mod_blacklist.2017.vcxproj
index fe36d21488..bae441c616 100644
--- a/src/mod/applications/mod_blacklist/mod_blacklist.2015.vcxproj
+++ b/src/mod/applications/mod_blacklist/mod_blacklist.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_blacklist
-    {50AAC2CE-BFC9-4912-87CC-C6381850D735}
-    mod_blacklist
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_blacklist
+    {50AAC2CE-BFC9-4912-87CC-C6381850D735}
+    mod_blacklist
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.2015.vcxproj b/src/mod/applications/mod_callcenter/mod_callcenter.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_callcenter/mod_callcenter.2015.vcxproj
rename to src/mod/applications/mod_callcenter/mod_callcenter.2017.vcxproj
index 8a7807fa77..63f7dc7f3d 100644
--- a/src/mod/applications/mod_callcenter/mod_callcenter.2015.vcxproj
+++ b/src/mod/applications/mod_callcenter/mod_callcenter.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_callcenter
-    {47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}
-    mod_callcenter
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      4127;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4127;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      4127;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4127;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_callcenter
+    {47886A6C-CCA6-4F9F-A7D4-F97D06FB2B1A}
+    mod_callcenter
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      4127;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4127;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      4127;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4127;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_commands/mod_commands.2015.vcxproj b/src/mod/applications/mod_commands/mod_commands.2017.vcxproj
similarity index 94%
rename from src/mod/applications/mod_commands/mod_commands.2015.vcxproj
rename to src/mod/applications/mod_commands/mod_commands.2017.vcxproj
index 639fe0ac48..6bcc93307b 100644
--- a/src/mod/applications/mod_commands/mod_commands.2015.vcxproj
+++ b/src/mod/applications/mod_commands/mod_commands.2017.vcxproj
@@ -1,163 +1,163 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_commands
-    {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}
-    mod_commands
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      
-      
-      false
-      4457;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      false
-      4457;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      false
-      4457;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      false
-      4457;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_commands
+    {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}
+    mod_commands
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      
+      
+      false
+      4457;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      false
+      4457;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      false
+      4457;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      false
+      4457;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_conference/mod_conference.2015.vcxproj b/src/mod/applications/mod_conference/mod_conference.2017.vcxproj
similarity index 94%
rename from src/mod/applications/mod_conference/mod_conference.2015.vcxproj
rename to src/mod/applications/mod_conference/mod_conference.2017.vcxproj
index 7fe1465936..0103cea35f 100644
--- a/src/mod/applications/mod_conference/mod_conference.2015.vcxproj
+++ b/src/mod/applications/mod_conference/mod_conference.2017.vcxproj
@@ -1,181 +1,181 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_conference
-    {C24FB505-05D7-4319-8485-7540B44C8603}
-    mod_conference
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-    $(ProjectDir);$(IncludePath)
-  
-  
-    NativeMinimumRules.ruleset
-    false
-    $(ProjectDir);$(IncludePath)
-  
-  
-    NativeMinimumRules.ruleset
-    false
-    $(ProjectDir);$(IncludePath)
-  
-  
-    NativeMinimumRules.ruleset
-    false
-    $(ProjectDir);$(IncludePath)
-  
-  
-    
-      
-      
-      false
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      false
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      false
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      false
-      $(ProjectDir);%(AdditionalIncludeDirectories)
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_conference
+    {C24FB505-05D7-4319-8485-7540B44C8603}
+    mod_conference
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+    $(ProjectDir);$(IncludePath)
+  
+  
+    NativeMinimumRules.ruleset
+    false
+    $(ProjectDir);$(IncludePath)
+  
+  
+    NativeMinimumRules.ruleset
+    false
+    $(ProjectDir);$(IncludePath)
+  
+  
+    NativeMinimumRules.ruleset
+    false
+    $(ProjectDir);$(IncludePath)
+  
+  
+    
+      
+      
+      false
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      false
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      false
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      false
+      $(ProjectDir);%(AdditionalIncludeDirectories)
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_curl/mod_curl.2015.vcxproj b/src/mod/applications/mod_curl/mod_curl.2017.vcxproj
similarity index 92%
rename from src/mod/applications/mod_curl/mod_curl.2015.vcxproj
rename to src/mod/applications/mod_curl/mod_curl.2017.vcxproj
index 10e6e4736e..083402039f 100644
--- a/src/mod/applications/mod_curl/mod_curl.2015.vcxproj
+++ b/src/mod/applications/mod_curl/mod_curl.2017.vcxproj
@@ -1,137 +1,137 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_curl
-    {EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}
-    mod_curl
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_curl
+    {EF300386-A8DF-4372-B6D8-FB9BFFCA9AED}
+    mod_curl
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_cv/mod_cv.2015.vcxproj b/src/mod/applications/mod_cv/mod_cv.2017.vcxproj
similarity index 95%
rename from src/mod/applications/mod_cv/mod_cv.2015.vcxproj
rename to src/mod/applications/mod_cv/mod_cv.2017.vcxproj
index 279dba98fa..b25e73589a 100644
--- a/src/mod/applications/mod_cv/mod_cv.2015.vcxproj
+++ b/src/mod/applications/mod_cv/mod_cv.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,26 +28,26 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
-    
+    
   
   
     
@@ -120,7 +120,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
diff --git a/src/mod/applications/mod_db/mod_db.2015.vcxproj b/src/mod/applications/mod_db/mod_db.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_db/mod_db.2015.vcxproj
rename to src/mod/applications/mod_db/mod_db.2017.vcxproj
index 51b021c4b8..ce2969fbdf 100644
--- a/src/mod/applications/mod_db/mod_db.2015.vcxproj
+++ b/src/mod/applications/mod_db/mod_db.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_db
-    {F6A33240-8F29-48BD-98F0-826995911799}
-    mod_db
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_db
+    {F6A33240-8F29-48BD-98F0-826995911799}
+    mod_db
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_directory/mod_directory.2015.vcxproj b/src/mod/applications/mod_directory/mod_directory.2017.vcxproj
similarity index 94%
rename from src/mod/applications/mod_directory/mod_directory.2015.vcxproj
rename to src/mod/applications/mod_directory/mod_directory.2017.vcxproj
index 76bdf0d2b3..54570af498 100644
--- a/src/mod/applications/mod_directory/mod_directory.2015.vcxproj
+++ b/src/mod/applications/mod_directory/mod_directory.2017.vcxproj
@@ -1,158 +1,158 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_directory
-    {B889A18E-70A7-44B5-B2C9-47798D4F43B3}
-    mod_directory
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      
-      
-      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_directory
+    {B889A18E-70A7-44B5-B2C9-47798D4F43B3}
+    mod_directory
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      
+      
+      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_distributor/mod_distributor.2015.vcxproj b/src/mod/applications/mod_distributor/mod_distributor.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_distributor/mod_distributor.2015.vcxproj
rename to src/mod/applications/mod_distributor/mod_distributor.2017.vcxproj
index 963603a45e..2e3119f4f8 100644
--- a/src/mod/applications/mod_distributor/mod_distributor.2015.vcxproj
+++ b/src/mod/applications/mod_distributor/mod_distributor.2017.vcxproj
@@ -1,134 +1,134 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_distributor
-    {5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}
-    mod_distributor
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_distributor
+    {5C2B4D88-3BEA-4FE0-90DF-FA9836099D5F}
+    mod_distributor
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_dptools/mod_dptools.2015.vcxproj b/src/mod/applications/mod_dptools/mod_dptools.2017.vcxproj
similarity index 94%
rename from src/mod/applications/mod_dptools/mod_dptools.2015.vcxproj
rename to src/mod/applications/mod_dptools/mod_dptools.2017.vcxproj
index 995951fc01..dcb83767e5 100644
--- a/src/mod/applications/mod_dptools/mod_dptools.2015.vcxproj
+++ b/src/mod/applications/mod_dptools/mod_dptools.2017.vcxproj
@@ -1,159 +1,159 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_dptools
-    {B5881A85-FE70-4F64-8607-2CAAE52669C6}
-    mod_dptools
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      
-      
-      false
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      false
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      false
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      false
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_dptools
+    {B5881A85-FE70-4F64-8607-2CAAE52669C6}
+    mod_dptools
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      
+      
+      false
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      false
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      false
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      false
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_easyroute/mod_easyroute.2015.vcxproj b/src/mod/applications/mod_easyroute/mod_easyroute.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_easyroute/mod_easyroute.2015.vcxproj
rename to src/mod/applications/mod_easyroute/mod_easyroute.2017.vcxproj
index 6a31728a68..a0a2ccd218 100644
--- a/src/mod/applications/mod_easyroute/mod_easyroute.2015.vcxproj
+++ b/src/mod/applications/mod_easyroute/mod_easyroute.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_easyroute
-    {329FD5B0-EF28-4606-86D0-F6EA21CF8E36}
-    mod_easyroute
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_easyroute
+    {329FD5B0-EF28-4606-86D0-F6EA21CF8E36}
+    mod_easyroute
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_enum/mod_enum.2015.vcxproj b/src/mod/applications/mod_enum/mod_enum.2017.vcxproj
similarity index 94%
rename from src/mod/applications/mod_enum/mod_enum.2015.vcxproj
rename to src/mod/applications/mod_enum/mod_enum.2017.vcxproj
index 9cc515a8ee..17bd25e751 100644
--- a/src/mod/applications/mod_enum/mod_enum.2015.vcxproj
+++ b/src/mod/applications/mod_enum/mod_enum.2017.vcxproj
@@ -1,166 +1,166 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_enum
-    {71A967D5-0E99-4CEF-A587-98836EE6F2EF}
-    mod_enum
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    NotSet
-    v140
-  
-  
-    DynamicLibrary
-    NotSet
-    v140
-  
-  
-    DynamicLibrary
-    NotSet
-    v140
-  
-  
-    DynamicLibrary
-    NotSet
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\ldns;%(AdditionalIncludeDirectories)
-      
-      
-      false
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\ldns;%(AdditionalIncludeDirectories)
-      
-      
-      false
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\ldns;%(AdditionalIncludeDirectories)
-      
-      
-      false
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\ldns;%(AdditionalIncludeDirectories)
-      
-      
-      false
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {23b4d303-79fc-49e0-89e2-2280e7e28940}
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_enum
+    {71A967D5-0E99-4CEF-A587-98836EE6F2EF}
+    mod_enum
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    NotSet
+    v141
+  
+  
+    DynamicLibrary
+    NotSet
+    v141
+  
+  
+    DynamicLibrary
+    NotSet
+    v141
+  
+  
+    DynamicLibrary
+    NotSet
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\ldns;%(AdditionalIncludeDirectories)
+      
+      
+      false
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\ldns;%(AdditionalIncludeDirectories)
+      
+      
+      false
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\ldns;%(AdditionalIncludeDirectories)
+      
+      
+      false
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\ldns;%(AdditionalIncludeDirectories)
+      
+      
+      false
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {23b4d303-79fc-49e0-89e2-2280e7e28940}
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_esf/mod_esf.2015.vcxproj b/src/mod/applications/mod_esf/mod_esf.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_esf/mod_esf.2015.vcxproj
rename to src/mod/applications/mod_esf/mod_esf.2017.vcxproj
index 781676f73b..0e4097d1d9 100644
--- a/src/mod/applications/mod_esf/mod_esf.2015.vcxproj
+++ b/src/mod/applications/mod_esf/mod_esf.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_esf
-    {3850D93A-5F24-4922-BC1C-74D08C37C256}
-    mod_esf
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_esf
+    {3850D93A-5F24-4922-BC1C-74D08C37C256}
+    mod_esf
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_expr/mod_expr.2015.vcxproj b/src/mod/applications/mod_expr/mod_expr.2017.vcxproj
similarity index 94%
rename from src/mod/applications/mod_expr/mod_expr.2015.vcxproj
rename to src/mod/applications/mod_expr/mod_expr.2017.vcxproj
index 462c474894..4782d57e89 100644
--- a/src/mod/applications/mod_expr/mod_expr.2015.vcxproj
+++ b/src/mod/applications/mod_expr/mod_expr.2017.vcxproj
@@ -1,160 +1,160 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_expr
-    {65A6273D-FCAB-4C55-B09E-65100141A5D4}
-    mod_expr
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-       /J
-      
-      
-      6031;4100;4701;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-       /J
-      
-      
-      6031;4100;4701;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-       /J
-      
-      
-      6031;4100;4701;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-       /J
-      
-      
-      6031;4100;4701;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_expr
+    {65A6273D-FCAB-4C55-B09E-65100141A5D4}
+    mod_expr
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+       /J
+      
+      
+      6031;4100;4701;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+       /J
+      
+      
+      6031;4100;4701;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+       /J
+      
+      
+      6031;4100;4701;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+       /J
+      
+      
+      6031;4100;4701;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_fifo/mod_fifo.2015.vcxproj b/src/mod/applications/mod_fifo/mod_fifo.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_fifo/mod_fifo.2015.vcxproj
rename to src/mod/applications/mod_fifo/mod_fifo.2017.vcxproj
index de0e1180f5..381d1ce3fc 100644
--- a/src/mod/applications/mod_fifo/mod_fifo.2015.vcxproj
+++ b/src/mod/applications/mod_fifo/mod_fifo.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_fifo
-    {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}
-    mod_fifo
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_fifo
+    {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}
+    mod_fifo
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_fsv/mod_fsv.2015.vcxproj b/src/mod/applications/mod_fsv/mod_fsv.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_fsv/mod_fsv.2015.vcxproj
rename to src/mod/applications/mod_fsv/mod_fsv.2017.vcxproj
index 29ee68002f..241102d7dc 100644
--- a/src/mod/applications/mod_fsv/mod_fsv.2015.vcxproj
+++ b/src/mod/applications/mod_fsv/mod_fsv.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_fsv
-    {E3246D17-E29B-4AB5-962A-C69B0C5837BB}
-    mod_fsv
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_fsv
+    {E3246D17-E29B-4AB5-962A-C69B0C5837BB}
+    mod_fsv
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_hash/mod_hash.2015.vcxproj b/src/mod/applications/mod_hash/mod_hash.2017.vcxproj
similarity index 94%
rename from src/mod/applications/mod_hash/mod_hash.2015.vcxproj
rename to src/mod/applications/mod_hash/mod_hash.2017.vcxproj
index cb03f0bc62..de6f135654 100644
--- a/src/mod/applications/mod_hash/mod_hash.2015.vcxproj
+++ b/src/mod/applications/mod_hash/mod_hash.2017.vcxproj
@@ -1,166 +1,166 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_hash
-    {2E250296-0C08-4342-9C8A-BCBDD0E7DF65}
-    mod_hash
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      
-      
-      ..\..\..\..\libs\esl\src\include;%(AdditionalIncludeDirectories)
-      ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      false
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      ..\..\..\..\libs\esl\src\include;%(AdditionalIncludeDirectories)
-      ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      false
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      ..\..\..\..\libs\esl\src\include;%(AdditionalIncludeDirectories)
-      ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      false
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      ..\..\..\..\libs\esl\src\include;%(AdditionalIncludeDirectories)
-      ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
-      false
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {cf405366-9558-4ae8-90ef-5e21b51ccb4e}
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_hash
+    {2E250296-0C08-4342-9C8A-BCBDD0E7DF65}
+    mod_hash
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      
+      
+      ..\..\..\..\libs\esl\src\include;%(AdditionalIncludeDirectories)
+      ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      false
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      ..\..\..\..\libs\esl\src\include;%(AdditionalIncludeDirectories)
+      ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      false
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      ..\..\..\..\libs\esl\src\include;%(AdditionalIncludeDirectories)
+      ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      false
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      ..\..\..\..\libs\esl\src\include;%(AdditionalIncludeDirectories)
+      ESL_DECLARE_STATIC;%(PreprocessorDefinitions)
+      false
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {cf405366-9558-4ae8-90ef-5e21b51ccb4e}
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_httapi/mod_httapi.2015.vcxproj b/src/mod/applications/mod_httapi/mod_httapi.2017.vcxproj
similarity index 94%
rename from src/mod/applications/mod_httapi/mod_httapi.2015.vcxproj
rename to src/mod/applications/mod_httapi/mod_httapi.2017.vcxproj
index 30c314c7e2..9c92595da0 100644
--- a/src/mod/applications/mod_httapi/mod_httapi.2015.vcxproj
+++ b/src/mod/applications/mod_httapi/mod_httapi.2017.vcxproj
@@ -1,144 +1,144 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_httapi
-    {4748FF56-CA85-4809-97D6-A94C0FAC1D77}
-    mod_httapi
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      4456;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4456;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      4456;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4456;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_httapi
+    {4748FF56-CA85-4809-97D6-A94C0FAC1D77}
+    mod_httapi
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      4456;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4456;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      4456;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4456;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_http_cache/mod_http_cache.vcxproj b/src/mod/applications/mod_http_cache/mod_http_cache.2017.vcxproj
similarity index 96%
rename from src/mod/applications/mod_http_cache/mod_http_cache.vcxproj
rename to src/mod/applications/mod_http_cache/mod_http_cache.2017.vcxproj
index 5d0cf7e87d..de677011c0 100644
--- a/src/mod/applications/mod_http_cache/mod_http_cache.vcxproj
+++ b/src/mod/applications/mod_http_cache/mod_http_cache.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -133,7 +133,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
diff --git a/src/mod/applications/mod_lcr/mod_lcr.2015.vcxproj b/src/mod/applications/mod_lcr/mod_lcr.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_lcr/mod_lcr.2015.vcxproj
rename to src/mod/applications/mod_lcr/mod_lcr.2017.vcxproj
index 864fd28aec..fd6707770a 100644
--- a/src/mod/applications/mod_lcr/mod_lcr.2015.vcxproj
+++ b/src/mod/applications/mod_lcr/mod_lcr.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_lcr
-    {1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}
-    mod_lcr
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_lcr
+    {1A3793D1-05D1-4B57-9B0F-5AF3E79DC439}
+    mod_lcr
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_nibblebill/mod_nibblebill.2015.vcxproj b/src/mod/applications/mod_nibblebill/mod_nibblebill.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_nibblebill/mod_nibblebill.2015.vcxproj
rename to src/mod/applications/mod_nibblebill/mod_nibblebill.2017.vcxproj
index bc8ae355e4..b6c7f8b5dc 100644
--- a/src/mod/applications/mod_nibblebill/mod_nibblebill.2015.vcxproj
+++ b/src/mod/applications/mod_nibblebill/mod_nibblebill.2017.vcxproj
@@ -1,143 +1,143 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_nibblebill
-    {3C977801-FE88-48F2-83D3-FA2EBFF6688E}
-    mod_nibblebill
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      %(PreprocessorDefinitions)
-      
-      
-      true
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(PreprocessorDefinitions)
-      
-      
-      false
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_nibblebill
+    {3C977801-FE88-48F2-83D3-FA2EBFF6688E}
+    mod_nibblebill
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      %(PreprocessorDefinitions)
+      
+      
+      true
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(PreprocessorDefinitions)
+      
+      
+      false
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_redis/mod_redis.2015.vcxproj b/src/mod/applications/mod_redis/mod_redis.2017.vcxproj
similarity index 95%
rename from src/mod/applications/mod_redis/mod_redis.2015.vcxproj
rename to src/mod/applications/mod_redis/mod_redis.2017.vcxproj
index 442bba7634..55ffb1516f 100644
--- a/src/mod/applications/mod_redis/mod_redis.2015.vcxproj
+++ b/src/mod/applications/mod_redis/mod_redis.2017.vcxproj
@@ -1,168 +1,168 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_redis
-    {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}
-    mod_redis
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-    
-      false
-      
-      
-    
-    
-      _CRT_SECURE_NO_WARNINGS;_DEBUG;DEBUG;%(PreprocessorDefinitions)
-      4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-  
-  
-    
-      X64
-    
-    
-    
-      false
-      
-      
-      MachineX64
-    
-    
-      _CRT_SECURE_NO_WARNINGS;_DEBUG;DEBUG;%(PreprocessorDefinitions)
-      4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-  
-  
-    
-    
-      false
-      
-      
-    
-    
-      _CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)
-      4389;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-  
-  
-    
-      X64
-    
-    
-    
-      false
-      
-      
-      MachineX64
-    
-    
-      _CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)
-      4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-  
-  
-    
-    
-      4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_redis
+    {886B5E9D-F2C2-4AF2-98C8-EF98C4C770E6}
+    mod_redis
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+    
+      false
+      
+      
+    
+    
+      _CRT_SECURE_NO_WARNINGS;_DEBUG;DEBUG;%(PreprocessorDefinitions)
+      4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+  
+  
+    
+      X64
+    
+    
+    
+      false
+      
+      
+      MachineX64
+    
+    
+      _CRT_SECURE_NO_WARNINGS;_DEBUG;DEBUG;%(PreprocessorDefinitions)
+      4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+  
+  
+    
+    
+      false
+      
+      
+    
+    
+      _CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)
+      4389;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+  
+  
+    
+      X64
+    
+    
+    
+      false
+      
+      
+      MachineX64
+    
+    
+      _CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)
+      4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+  
+  
+    
+    
+      4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      4005;4389;4133;4244;4706;4306;4996;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_rss/mod_rss.2015.vcxproj b/src/mod/applications/mod_rss/mod_rss.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_rss/mod_rss.2015.vcxproj
rename to src/mod/applications/mod_rss/mod_rss.2017.vcxproj
index 7c4e28a284..6e47953e0d 100644
--- a/src/mod/applications/mod_rss/mod_rss.2015.vcxproj
+++ b/src/mod/applications/mod_rss/mod_rss.2017.vcxproj
@@ -1,141 +1,141 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_rss
-    {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}
-    mod_rss
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_rss
+    {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}
+    mod_rss
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_skel/mod_skel.2015.vcxproj b/src/mod/applications/mod_skel/mod_skel.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_skel/mod_skel.2015.vcxproj
rename to src/mod/applications/mod_skel/mod_skel.2017.vcxproj
index d5bab16ed5..aff675b33e 100644
--- a/src/mod/applications/mod_skel/mod_skel.2015.vcxproj
+++ b/src/mod/applications/mod_skel/mod_skel.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_skel
-    {11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}
-    mod_skel
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_skel
+    {11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}
+    mod_skel
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_sms/mod_sms.2015.vcxproj b/src/mod/applications/mod_sms/mod_sms.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_sms/mod_sms.2015.vcxproj
rename to src/mod/applications/mod_sms/mod_sms.2017.vcxproj
index ecf7fae3f5..b056bc9125 100644
--- a/src/mod/applications/mod_sms/mod_sms.2015.vcxproj
+++ b/src/mod/applications/mod_sms/mod_sms.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_sms
-    {2469B306-B027-4FF2-8815-C9C1EA2CAE79}
-    mod_sms
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_sms
+    {2469B306-B027-4FF2-8815-C9C1EA2CAE79}
+    mod_sms
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_snom/mod_snom.2015.vcxproj b/src/mod/applications/mod_snom/mod_snom.2017.vcxproj
similarity index 94%
rename from src/mod/applications/mod_snom/mod_snom.2015.vcxproj
rename to src/mod/applications/mod_snom/mod_snom.2017.vcxproj
index 3e5288b0d3..21ec65cbd9 100644
--- a/src/mod/applications/mod_snom/mod_snom.2015.vcxproj
+++ b/src/mod/applications/mod_snom/mod_snom.2017.vcxproj
@@ -1,146 +1,146 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_snom
-    {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}
-    mod_snom
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      6385;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      6385;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      6385;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      6385;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_snom
+    {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}
+    mod_snom
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      6385;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      6385;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      6385;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      6385;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.2015.vcxproj b/src/mod/applications/mod_spandsp/mod_spandsp.2017.vcxproj
similarity index 95%
rename from src/mod/applications/mod_spandsp/mod_spandsp.2015.vcxproj
rename to src/mod/applications/mod_spandsp/mod_spandsp.2017.vcxproj
index 6f0721e12c..33e90eecfc 100644
--- a/src/mod/applications/mod_spandsp/mod_spandsp.2015.vcxproj
+++ b/src/mod/applications/mod_spandsp/mod_spandsp.2017.vcxproj
@@ -1,183 +1,183 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_spandsp
-    {1E21AFE0-6FDB-41D2-942D-863607C24B91}
-    mod_spandsp
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    NotSet
-    v140
-  
-  
-    DynamicLibrary
-    NotSet
-    v140
-  
-  
-    DynamicLibrary
-    NotSet
-    v140
-  
-  
-    DynamicLibrary
-    NotSet
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
-      
-      
-      4189;6031;4456;4024;4047;4324;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
-      
-      
-      4189;6031;4456;4024;4047;4324;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
-      
-      
-      4189;6031;4456;4024;4047;4324;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
-      
-      
-      4189;6031;4456;4024;4047;4324;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-  
-  
-    
-      {1cbb0077-18c5-455f-801c-0a0ce7b0bbf5}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_spandsp
+    {1E21AFE0-6FDB-41D2-942D-863607C24B91}
+    mod_spandsp
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    NotSet
+    v141
+  
+  
+    DynamicLibrary
+    NotSet
+    v141
+  
+  
+    DynamicLibrary
+    NotSet
+    v141
+  
+  
+    DynamicLibrary
+    NotSet
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
+      
+      
+      4189;6031;4456;4024;4047;4324;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
+      
+      
+      4189;6031;4456;4024;4047;4324;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
+      
+      
+      4189;6031;4456;4024;4047;4324;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
+      
+      
+      4189;6031;4456;4024;4047;4324;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+  
+  
+    
+      {1cbb0077-18c5-455f-801c-0a0ce7b0bbf5}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_spy/mod_spy.2015.vcxproj b/src/mod/applications/mod_spy/mod_spy.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_spy/mod_spy.2015.vcxproj
rename to src/mod/applications/mod_spy/mod_spy.2017.vcxproj
index fcf115780f..9ebca840bd 100644
--- a/src/mod/applications/mod_spy/mod_spy.2015.vcxproj
+++ b/src/mod/applications/mod_spy/mod_spy.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_spy
-    {A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}
-    mod_spy
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_spy
+    {A61D7CB4-75A5-4A55-8CA1-BE5AF615D921}
+    mod_spy
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_valet_parking/mod_valet_parking.2015.vcxproj b/src/mod/applications/mod_valet_parking/mod_valet_parking.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_valet_parking/mod_valet_parking.2015.vcxproj
rename to src/mod/applications/mod_valet_parking/mod_valet_parking.2017.vcxproj
index 12c778be1c..ffb48a328c 100644
--- a/src/mod/applications/mod_valet_parking/mod_valet_parking.2015.vcxproj
+++ b/src/mod/applications/mod_valet_parking/mod_valet_parking.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_valet_parking
-    {432DB165-1EB2-4781-A9C0-71E62610B20A}
-    mod_valet_parking
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_valet_parking
+    {432DB165-1EB2-4781-A9C0-71E62610B20A}
+    mod_valet_parking
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4456;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_vmd/mod_vmd.2015.vcxproj b/src/mod/applications/mod_vmd/mod_vmd.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_vmd/mod_vmd.2015.vcxproj
rename to src/mod/applications/mod_vmd/mod_vmd.2017.vcxproj
index 9dab152473..e2d5a5aace 100644
--- a/src/mod/applications/mod_vmd/mod_vmd.2015.vcxproj
+++ b/src/mod/applications/mod_vmd/mod_vmd.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_vmd
-    {14E4A972-9CFB-436D-B0A5-4943F3F80D47}
-    mod_vmd
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_vmd
+    {14E4A972-9CFB-436D-B0A5-4943F3F80D47}
+    mod_vmd
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.2015.vcxproj b/src/mod/applications/mod_voicemail/mod_voicemail.2017.vcxproj
similarity index 93%
rename from src/mod/applications/mod_voicemail/mod_voicemail.2015.vcxproj
rename to src/mod/applications/mod_voicemail/mod_voicemail.2017.vcxproj
index ef91a5bea8..f3457b890b 100644
--- a/src/mod/applications/mod_voicemail/mod_voicemail.2015.vcxproj
+++ b/src/mod/applications/mod_voicemail/mod_voicemail.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_voicemail
-    {D7F1E3F2-A3F4-474C-8555-15122571AF52}
-    mod_voicemail
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      6385;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      6385;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      6385;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      6385;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_voicemail
+    {D7F1E3F2-A3F4-474C-8555-15122571AF52}
+    mod_voicemail
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      6385;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      6385;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      6385;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      6385;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/asr_tts/mod_cepstral/mod_cepstral.2015.vcxproj b/src/mod/asr_tts/mod_cepstral/mod_cepstral.2017.vcxproj
similarity index 94%
rename from src/mod/asr_tts/mod_cepstral/mod_cepstral.2015.vcxproj
rename to src/mod/asr_tts/mod_cepstral/mod_cepstral.2017.vcxproj
index b22a9e78f9..f6340e175f 100644
--- a/src/mod/asr_tts/mod_cepstral/mod_cepstral.2015.vcxproj
+++ b/src/mod/asr_tts/mod_cepstral/mod_cepstral.2017.vcxproj
@@ -1,146 +1,146 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_cepstral
-    {692F6330-4D87-4C82-81DF-40DB5892636E}
-    mod_cepstral
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      swift.lib;%(AdditionalDependencies)
-      C:\dev\cepstral\sdk\lib\lib-windows;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      swift.lib;%(AdditionalDependencies)
-      C:\dev\cepstral\sdk\lib\lib-windows_x64;%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      swift.lib;%(AdditionalDependencies)
-      C:\dev\cepstral\sdk\lib\lib-windows;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      swift.lib;%(AdditionalDependencies)
-      C:\dev\cepstral\sdk\lib\lib-windows_x64;%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_cepstral
+    {692F6330-4D87-4C82-81DF-40DB5892636E}
+    mod_cepstral
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      swift.lib;%(AdditionalDependencies)
+      C:\dev\cepstral\sdk\lib\lib-windows;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      swift.lib;%(AdditionalDependencies)
+      C:\dev\cepstral\sdk\lib\lib-windows_x64;%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      swift.lib;%(AdditionalDependencies)
+      C:\dev\cepstral\sdk\lib\lib-windows;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      C:\dev\cepstral\sdk\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      swift.lib;%(AdditionalDependencies)
+      C:\dev\cepstral\sdk\lib\lib-windows_x64;%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/asr_tts/mod_flite/mod_flite.2015.vcxproj b/src/mod/asr_tts/mod_flite/mod_flite.2017.vcxproj
similarity index 94%
rename from src/mod/asr_tts/mod_flite/mod_flite.2015.vcxproj
rename to src/mod/asr_tts/mod_flite/mod_flite.2017.vcxproj
index 050ac33b8e..60ce433890 100644
--- a/src/mod/asr_tts/mod_flite/mod_flite.2015.vcxproj
+++ b/src/mod/asr_tts/mod_flite/mod_flite.2017.vcxproj
@@ -1,142 +1,142 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_flite
-    {66444AEE-554C-11DD-A9F0-8C5D56D89593}
-    mod_flite
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-    true
-  
-  
-    
-      APT_LIB_EXPORT;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      APT_LIB_EXPORT;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      APT_LIB_EXPORT;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      APT_LIB_EXPORT;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_flite
+    {66444AEE-554C-11DD-A9F0-8C5D56D89593}
+    mod_flite
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+    true
+  
+  
+    
+      APT_LIB_EXPORT;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      APT_LIB_EXPORT;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      APT_LIB_EXPORT;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      APT_LIB_EXPORT;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj b/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2017.vcxproj
similarity index 95%
rename from src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj
rename to src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2017.vcxproj
index 194b959a57..a48b62a406 100644
--- a/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2015.vcxproj
+++ b/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.2017.vcxproj
@@ -1,206 +1,206 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_pocketsphinx
-    {2286DA73-9FC5-45BC-A508-85994C3317AB}
-    mod_pocketsphinx
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-    true
-    false
-    false
-  
-  
-    
-      Disabled
-      ..\..\..\..\libs\sphinxbase-0.7\include;..\..\..\..\libs\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_POCKETSPHINX_EXPORTS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      Level3
-      EditAndContinue
-    
-    
-      $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
-      Windows
-      MachineX86
-      false
-    
-    
-      if not exist "$(OutDir)grammar\model\communicator" xcopy "$(SolutionDir)libs\Communicator_semi_40.cd_semi_6000\*.*" "$(OutDir)..\grammar\model\communicator" /C /D /Y /S /I
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      ..\..\..\..\libs\sphinxbase-0.7\include;..\..\..\..\libs\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_POCKETSPHINX_EXPORTS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      Level3
-      ProgramDatabase
-    
-    
-      $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
-      Windows
-      MachineX64
-    
-    
-      if not exist "$(OutDir)grammar\model\communicator" xcopy "$(SolutionDir)libs\Communicator_semi_40.cd_semi_6000\*.*" "$(OutDir)..\grammar\model\communicator" /C /D /Y /S /I
-    
-  
-  
-    
-      MaxSpeed
-      true
-      ..\..\..\..\libs\sphinxbase-0.7\include;..\..\..\..\libs\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_POCKETSPHINX_EXPORTS;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      true
-      Use
-      Level3
-      ProgramDatabase
-    
-    
-      false
-    
-    
-      $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
-      Windows
-      true
-      true
-      MachineX86
-    
-    
-      if not exist "$(OutDir)grammar\model\communicator" xcopy "$(SolutionDir)libs\Communicator_semi_40.cd_semi_6000\*.*" "$(OutDir)..\grammar\model\communicator" /C /D /Y /S /I
-
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      true
-      ..\..\..\..\libs\sphinxbase-0.7\include;..\..\..\..\libs\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_POCKETSPHINX_EXPORTS;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      true
-      Use
-      Level3
-      ProgramDatabase
-    
-    
-      false
-    
-    
-      $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
-      Windows
-      true
-      true
-      MachineX64
-    
-    
-      if not exist "$(OutDir)grammar\model\communicator" xcopy "$(SolutionDir)libs\Communicator_semi_40.cd_semi_6000\*.*" "$(OutDir)..\grammar\model\communicator" /C /D /Y /S /I
-    
-  
-  
-    
-      
-      
-      
-      
-    
-  
-  
-    
-      {94001a0e-a837-445c-8004-f918f10d0226}
-      false
-    
-    
-      {2f025ead-99bd-40f5-b2cc-f0a28cad7f2d}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_pocketsphinx
+    {2286DA73-9FC5-45BC-A508-85994C3317AB}
+    mod_pocketsphinx
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+    true
+    false
+    false
+  
+  
+    
+      Disabled
+      ..\..\..\..\libs\sphinxbase-0.7\include;..\..\..\..\libs\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_POCKETSPHINX_EXPORTS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      Level3
+      EditAndContinue
+    
+    
+      $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
+      Windows
+      MachineX86
+      false
+    
+    
+      if not exist "$(OutDir)grammar\model\communicator" xcopy "$(SolutionDir)libs\Communicator_semi_40.cd_semi_6000\*.*" "$(OutDir)..\grammar\model\communicator" /C /D /Y /S /I
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      ..\..\..\..\libs\sphinxbase-0.7\include;..\..\..\..\libs\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_POCKETSPHINX_EXPORTS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      Level3
+      ProgramDatabase
+    
+    
+      $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
+      Windows
+      MachineX64
+    
+    
+      if not exist "$(OutDir)grammar\model\communicator" xcopy "$(SolutionDir)libs\Communicator_semi_40.cd_semi_6000\*.*" "$(OutDir)..\grammar\model\communicator" /C /D /Y /S /I
+    
+  
+  
+    
+      MaxSpeed
+      true
+      ..\..\..\..\libs\sphinxbase-0.7\include;..\..\..\..\libs\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_POCKETSPHINX_EXPORTS;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      true
+      Use
+      Level3
+      ProgramDatabase
+    
+    
+      false
+    
+    
+      $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
+      Windows
+      true
+      true
+      MachineX86
+    
+    
+      if not exist "$(OutDir)grammar\model\communicator" xcopy "$(SolutionDir)libs\Communicator_semi_40.cd_semi_6000\*.*" "$(OutDir)..\grammar\model\communicator" /C /D /Y /S /I
+
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      true
+      ..\..\..\..\libs\sphinxbase-0.7\include;..\..\..\..\libs\pocketsphinx-0.7\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_POCKETSPHINX_EXPORTS;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      true
+      Use
+      Level3
+      ProgramDatabase
+    
+    
+      false
+    
+    
+      $(SolutionDir)$(Configuration);%(AdditionalLibraryDirectories)
+      Windows
+      true
+      true
+      MachineX64
+    
+    
+      if not exist "$(OutDir)grammar\model\communicator" xcopy "$(SolutionDir)libs\Communicator_semi_40.cd_semi_6000\*.*" "$(OutDir)..\grammar\model\communicator" /C /D /Y /S /I
+    
+  
+  
+    
+      
+      
+      
+      
+    
+  
+  
+    
+      {94001a0e-a837-445c-8004-f918f10d0226}
+      false
+    
+    
+      {2f025ead-99bd-40f5-b2cc-f0a28cad7f2d}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.2015.vcxproj b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.2017.vcxproj
similarity index 92%
rename from src/mod/asr_tts/mod_unimrcp/mod_unimrcp.2015.vcxproj
rename to src/mod/asr_tts/mod_unimrcp/mod_unimrcp.2017.vcxproj
index c8f0402c35..20246e605c 100644
--- a/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.2015.vcxproj
+++ b/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.2017.vcxproj
@@ -1,205 +1,205 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_unimrcp
-    {D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}
-    mod_unimrcp
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-    
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(Configuration)\
-    $(Platform)\$(Configuration)\
-  
-  
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      $(SolutionDir)Debug/bin;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      $(SolutionDir)$(PlatformName)\$(Configuration)\;%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      $(SolutionDir)Release/bin;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      $(SolutionDir)$(PlatformName)\$(Configuration)\;%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      CompileAsC
-      CompileAsC
-      CompileAsC
-      CompileAsC
-    
-  
-  
-    
-      {13deeca0-bdd4-4744-a1a2-8eb0a44df3d2}
-      false
-    
-    
-      {b5a00bfa-6083-4fae-a097-71642d6473b5}
-      false
-    
-    
-      {72782932-37cc-46ae-8c7f-9a7b1a6ee108}
-      false
-    
-    
-      {12a49562-bab9-43a3-a21d-15b60bbb4c31}
-      false
-    
-    
-      {a9edac04-6a5f-4ba7-bc0d-cce7b255b6ea}
-      false
-    
-    
-      {1c320193-46a6-4b34-9c56-8ab584fc1b56}
-      false
-    
-    
-      {504b3154-7a4f-459d-9877-b951021c3f1f}
-      false
-    
-    
-      {746f3632-5bb2-4570-9453-31d6d58a7d8e}
-      false
-    
-    
-      {deb01acb-d65f-4a62-aed9-58c1054499e9}
-      false
-    
-    
-      {f057da7f-79e5-4b00-845c-ef446ef055e3}
-      false
-    
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {df018947-0fff-4eb3-bdee-441dc81da7a4}
-    
-    
-      {70a49bc2-7500-41d0-b75d-edcc5be987a0}
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_unimrcp
+    {D07C378A-F5F7-438F-ADF3-4AC4FB1883CD}
+    mod_unimrcp
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+    
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(Configuration)\
+    $(Platform)\$(Configuration)\
+  
+  
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      $(SolutionDir)Debug/bin;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      $(SolutionDir)$(PlatformName)\$(Configuration)\;%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      $(SolutionDir)Release/bin;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      APT_STATIC_LIB;MPF_STATIC_LIB;MRCP_STATIC_LIB;LIBSOFIA_SIP_UA_STATIC;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      $(SolutionDir)$(PlatformName)\$(Configuration)\;%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      CompileAsC
+      CompileAsC
+      CompileAsC
+      CompileAsC
+    
+  
+  
+    
+      {13deeca0-bdd4-4744-a1a2-8eb0a44df3d2}
+      false
+    
+    
+      {b5a00bfa-6083-4fae-a097-71642d6473b5}
+      false
+    
+    
+      {72782932-37cc-46ae-8c7f-9a7b1a6ee108}
+      false
+    
+    
+      {12a49562-bab9-43a3-a21d-15b60bbb4c31}
+      false
+    
+    
+      {a9edac04-6a5f-4ba7-bc0d-cce7b255b6ea}
+      false
+    
+    
+      {1c320193-46a6-4b34-9c56-8ab584fc1b56}
+      false
+    
+    
+      {504b3154-7a4f-459d-9877-b951021c3f1f}
+      false
+    
+    
+      {746f3632-5bb2-4570-9453-31d6d58a7d8e}
+      false
+    
+    
+      {deb01acb-d65f-4a62-aed9-58c1054499e9}
+      false
+    
+    
+      {f057da7f-79e5-4b00-845c-ef446ef055e3}
+      false
+    
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {df018947-0fff-4eb3-bdee-441dc81da7a4}
+    
+    
+      {70a49bc2-7500-41d0-b75d-edcc5be987a0}
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/codecs/mod_amr/mod_amr.2015.vcxproj b/src/mod/codecs/mod_amr/mod_amr.2017.vcxproj
similarity index 95%
rename from src/mod/codecs/mod_amr/mod_amr.2015.vcxproj
rename to src/mod/codecs/mod_amr/mod_amr.2017.vcxproj
index 46ed0d3ba1..b5e2b53691 100644
--- a/src/mod/codecs/mod_amr/mod_amr.2015.vcxproj
+++ b/src/mod/codecs/mod_amr/mod_amr.2017.vcxproj
@@ -1,263 +1,263 @@
-
-
-  
-    
-      Debug Passthrough
-      Win32
-    
-    
-      Debug Passthrough
-      x64
-    
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release Passthrough
-      Win32
-    
-    
-      Release Passthrough
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_amr
-    {8DEB383C-4091-4F42-A56F-C9E46D552D79}
-    mod_amr
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-    $(SolutionDir)$(PlatformName)\Release\mod\
-    $(SolutionDir)$(PlatformName)\Release\mod\
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libamr.lib;%(AdditionalDependencies)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libamr.lib;%(AdditionalDependencies)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libamr.lib;%(AdditionalDependencies)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libamr.lib;%(AdditionalDependencies)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
-      AMR_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
-      AMR_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
-      AMR_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
-      AMR_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug Passthrough
+      Win32
+    
+    
+      Debug Passthrough
+      x64
+    
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release Passthrough
+      Win32
+    
+    
+      Release Passthrough
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_amr
+    {8DEB383C-4091-4F42-A56F-C9E46D552D79}
+    mod_amr
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+    $(SolutionDir)$(PlatformName)\Release\mod\
+    $(SolutionDir)$(PlatformName)\Release\mod\
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libamr.lib;%(AdditionalDependencies)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libamr.lib;%(AdditionalDependencies)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libamr.lib;%(AdditionalDependencies)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libamr.lib;%(AdditionalDependencies)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
+      AMR_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
+      AMR_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
+      AMR_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libamr\src\include;%(AdditionalIncludeDirectories)
+      AMR_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/codecs/mod_bv/mod_bv.2015.vcxproj b/src/mod/codecs/mod_bv/mod_bv.2017.vcxproj
similarity index 93%
rename from src/mod/codecs/mod_bv/mod_bv.2015.vcxproj
rename to src/mod/codecs/mod_bv/mod_bv.2017.vcxproj
index 387698cc5e..4c3e3c275a 100644
--- a/src/mod/codecs/mod_bv/mod_bv.2015.vcxproj
+++ b/src/mod/codecs/mod_bv/mod_bv.2017.vcxproj
@@ -1,140 +1,140 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_bv
-    {D5C87B19-150D-4EF3-A671-96589BD2D14A}
-    mod_bv
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {cf70f278-3364-4395-a2e1-23501c9b8ad2}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_bv
+    {D5C87B19-150D-4EF3-A671-96589BD2D14A}
+    mod_bv
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {cf70f278-3364-4395-a2e1-23501c9b8ad2}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/codecs/mod_codec2/mod_codec2.vcxproj b/src/mod/codecs/mod_codec2/mod_codec2.2017.vcxproj
similarity index 95%
rename from src/mod/codecs/mod_codec2/mod_codec2.vcxproj
rename to src/mod/codecs/mod_codec2/mod_codec2.2017.vcxproj
index 3f03523a56..ee8d1edfcd 100644
--- a/src/mod/codecs/mod_codec2/mod_codec2.vcxproj
+++ b/src/mod/codecs/mod_codec2/mod_codec2.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -125,10 +125,10 @@
     
   
   
-    
+    
       {19e934d6-1484-41c8-9305-78dc42fd61f2}
     
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
diff --git a/src/mod/codecs/mod_g723_1/mod_g723_1.2015.vcxproj b/src/mod/codecs/mod_g723_1/mod_g723_1.2017.vcxproj
similarity index 95%
rename from src/mod/codecs/mod_g723_1/mod_g723_1.2015.vcxproj
rename to src/mod/codecs/mod_g723_1/mod_g723_1.2017.vcxproj
index c87882f888..c1109ed139 100644
--- a/src/mod/codecs/mod_g723_1/mod_g723_1.2015.vcxproj
+++ b/src/mod/codecs/mod_g723_1/mod_g723_1.2017.vcxproj
@@ -1,272 +1,272 @@
-
-
-  
-    
-      Debug Passthrough
-      Win32
-    
-    
-      Debug Passthrough
-      x64
-    
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release Passthrough
-      Win32
-    
-    
-      Release Passthrough
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_g723_1
-    {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}
-    mod_g723_1
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-    $(SolutionDir)$(PlatformName)\Release\mod\
-    $(SolutionDir)$(PlatformName)\Release\mod\
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libg723.lib;%(AdditionalDependencies)
-      false
-      
-      
-      $(OutDir)mod_g723_1.lib
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libg723.lib;%(AdditionalDependencies)
-      
-      
-      false
-      
-      
-      $(OutDir)mod_g723_1.lib
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libg723.lib;%(AdditionalDependencies)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libg723.lib;%(AdditionalDependencies)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
-      G723_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
-      G723_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
-      G723_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
-      G723_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      $(SolutionDir)$(Platform)\release/mod/$(ProjectName).dll
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug Passthrough
+      Win32
+    
+    
+      Debug Passthrough
+      x64
+    
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release Passthrough
+      Win32
+    
+    
+      Release Passthrough
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_g723_1
+    {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}
+    mod_g723_1
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+    $(SolutionDir)$(PlatformName)\Release\mod\
+    $(SolutionDir)$(PlatformName)\Release\mod\
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libg723.lib;%(AdditionalDependencies)
+      false
+      
+      
+      $(OutDir)mod_g723_1.lib
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libg723.lib;%(AdditionalDependencies)
+      
+      
+      false
+      
+      
+      $(OutDir)mod_g723_1.lib
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libg723.lib;%(AdditionalDependencies)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libg723.lib;%(AdditionalDependencies)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
+      G723_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
+      G723_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
+      G723_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg723\src\include;%(AdditionalIncludeDirectories)
+      G723_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      $(SolutionDir)$(Platform)\release/mod/$(ProjectName).dll
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/codecs/mod_g729/mod_g729.2015.vcxproj b/src/mod/codecs/mod_g729/mod_g729.2017.vcxproj
similarity index 95%
rename from src/mod/codecs/mod_g729/mod_g729.2015.vcxproj
rename to src/mod/codecs/mod_g729/mod_g729.2017.vcxproj
index dc35b15558..e43d75f4a2 100644
--- a/src/mod/codecs/mod_g729/mod_g729.2015.vcxproj
+++ b/src/mod/codecs/mod_g729/mod_g729.2017.vcxproj
@@ -1,271 +1,271 @@
-
-
-  
-    
-      Debug Passthrough
-      Win32
-    
-    
-      Debug Passthrough
-      x64
-    
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release Passthrough
-      Win32
-    
-    
-      Release Passthrough
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_g729
-    {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}
-    mod_g729
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-    $(SolutionDir)$(PlatformName)\Release\mod\
-    $(SolutionDir)$(PlatformName)\Release\mod\
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libg729.lib;FreeSwitchCore.lib;%(AdditionalDependencies)
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libg729.lib;FreeSwitchCore.lib;%(AdditionalDependencies)
-      
-      
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libg729.lib;%(AdditionalDependencies)
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      libg729.lib;%(AdditionalDependencies)
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-      
-      
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
-      G729_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
-      G729_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
-      G729_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
-      G729_PASSTHROUGH;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug Passthrough
+      Win32
+    
+    
+      Debug Passthrough
+      x64
+    
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release Passthrough
+      Win32
+    
+    
+      Release Passthrough
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_g729
+    {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}
+    mod_g729
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+    $(SolutionDir)$(PlatformName)\Release\mod\
+    $(SolutionDir)$(PlatformName)\Release\mod\
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libg729.lib;FreeSwitchCore.lib;%(AdditionalDependencies)
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libg729.lib;FreeSwitchCore.lib;%(AdditionalDependencies)
+      
+      
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libg729.lib;%(AdditionalDependencies)
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      libg729.lib;%(AdditionalDependencies)
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+      
+      
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
+      G729_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
+      G729_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
+      G729_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\codec\libg729\src\include;%(AdditionalIncludeDirectories)
+      G729_PASSTHROUGH;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/codecs/mod_h26x/mod_h26x.2015.vcxproj b/src/mod/codecs/mod_h26x/mod_h26x.2017.vcxproj
similarity index 94%
rename from src/mod/codecs/mod_h26x/mod_h26x.2015.vcxproj
rename to src/mod/codecs/mod_h26x/mod_h26x.2017.vcxproj
index 891d33dec0..3d2dc9d581 100644
--- a/src/mod/codecs/mod_h26x/mod_h26x.2015.vcxproj
+++ b/src/mod/codecs/mod_h26x/mod_h26x.2017.vcxproj
@@ -1,143 +1,143 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_h26x
-    {2C3C2423-234B-4772-8899-D3B137E5CA35}
-    mod_h26x
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\libresample\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      $(ProjectDir)..\..\..\..\libs\libresample\win;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\libresample\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      $(ProjectDir)..\..\..\..\libs\libresample\win;%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\libresample\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      $(ProjectDir)..\..\..\..\libs\libresample\win;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\libresample\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      $(ProjectDir)..\..\..\..\libs\libresample\win;%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_h26x
+    {2C3C2423-234B-4772-8899-D3B137E5CA35}
+    mod_h26x
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\libresample\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      $(ProjectDir)..\..\..\..\libs\libresample\win;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\libresample\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      $(ProjectDir)..\..\..\..\libs\libresample\win;%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\libresample\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      $(ProjectDir)..\..\..\..\libs\libresample\win;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\libresample\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      $(ProjectDir)..\..\..\..\libs\libresample\win;%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/codecs/mod_ilbc/mod_ilbc.2015.vcxproj b/src/mod/codecs/mod_ilbc/mod_ilbc.2017.vcxproj
similarity index 93%
rename from src/mod/codecs/mod_ilbc/mod_ilbc.2015.vcxproj
rename to src/mod/codecs/mod_ilbc/mod_ilbc.2017.vcxproj
index 820a2c9db4..5ff6153727 100644
--- a/src/mod/codecs/mod_ilbc/mod_ilbc.2015.vcxproj
+++ b/src/mod/codecs/mod_ilbc/mod_ilbc.2017.vcxproj
@@ -1,140 +1,140 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_ilbc
-    {D3EC0AFF-76FC-4210-A825-9A17410660A3}
-    mod_ilbc
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {9a5ddf08-c88c-4a35-b7f6-d605228446bd}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_ilbc
+    {D3EC0AFF-76FC-4210-A825-9A17410660A3}
+    mod_ilbc
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {9a5ddf08-c88c-4a35-b7f6-d605228446bd}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/codecs/mod_isac/mod_iSAC.2015.vcxproj b/src/mod/codecs/mod_isac/mod_iSAC.2017.vcxproj
similarity index 95%
rename from src/mod/codecs/mod_isac/mod_iSAC.2015.vcxproj
rename to src/mod/codecs/mod_isac/mod_iSAC.2017.vcxproj
index ac2d7f9c41..bdd8a2a7fb 100644
--- a/src/mod/codecs/mod_isac/mod_iSAC.2015.vcxproj
+++ b/src/mod/codecs/mod_isac/mod_iSAC.2017.vcxproj
@@ -1,254 +1,254 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_iSAC
-    {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}
-    mod_iSAC
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      
-      
-      _CRT_SECURE_NO_WARNINGS;_DEBUG;DEBUG;%(PreprocessorDefinitions)
-      4206;4100;4244;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      _CRT_SECURE_NO_WARNINGS;_DEBUG;DEBUG;%(PreprocessorDefinitions)
-      4206;4100;4244;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      _CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)
-      4206;4100;4244;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      _CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)
-      4206;4100;4244;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_iSAC
+    {7F1610F1-DD5A-4CF7-8610-30AB12C60ADD}
+    mod_iSAC
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      
+      
+      _CRT_SECURE_NO_WARNINGS;_DEBUG;DEBUG;%(PreprocessorDefinitions)
+      4206;4100;4244;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      _CRT_SECURE_NO_WARNINGS;_DEBUG;DEBUG;%(PreprocessorDefinitions)
+      4206;4100;4244;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      _CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)
+      4206;4100;4244;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      _CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)
+      4206;4100;4244;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/codecs/mod_opus/mod_opus.2015.vcxproj b/src/mod/codecs/mod_opus/mod_opus.2017.vcxproj
similarity index 93%
rename from src/mod/codecs/mod_opus/mod_opus.2015.vcxproj
rename to src/mod/codecs/mod_opus/mod_opus.2017.vcxproj
index 0ded01f8d2..09233fd3f8 100644
--- a/src/mod/codecs/mod_opus/mod_opus.2015.vcxproj
+++ b/src/mod/codecs/mod_opus/mod_opus.2017.vcxproj
@@ -1,160 +1,160 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}
-    mod_opus
-    Win32Proj
-    mod_opus
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      ..\..\..\..\libs\opus-1.1\include;%(AdditionalIncludeDirectories)
-      
-      
-      6031;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      ..\..\..\..\libs\opus-1.1\include;%(AdditionalIncludeDirectories)
-      
-      
-      6031;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      ..\..\..\..\libs\opus-1.1\include;%(AdditionalIncludeDirectories)
-      
-      
-      6031;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      ..\..\..\..\libs\opus-1.1\include;%(AdditionalIncludeDirectories)
-      
-      
-      6031;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}
-      true
-      false
-      false
-      true
-      false
-    
-    
-      {245603e3-f580-41a5-9632-b25fe3372cbf}
-    
-    
-      {c303d2fc-ff97-49b8-9ddd-467b4c9a0b16}
-    
-    
-      {9c4961d2-5ddb-40c7-9be8-ca918dc4e782}
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {64E99CCA-3C6F-4AEB-9FA3-CFAC711257BB}
+    mod_opus
+    Win32Proj
+    mod_opus
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      ..\..\..\..\libs\opus-1.1\include;%(AdditionalIncludeDirectories)
+      
+      
+      6031;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      ..\..\..\..\libs\opus-1.1\include;%(AdditionalIncludeDirectories)
+      
+      
+      6031;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      ..\..\..\..\libs\opus-1.1\include;%(AdditionalIncludeDirectories)
+      
+      
+      6031;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      ..\..\..\..\libs\opus-1.1\include;%(AdditionalIncludeDirectories)
+      
+      
+      6031;6053;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {FD60942F-72D6-4CA1-8B57-EA1D1B95A89E}
+      true
+      false
+      false
+      true
+      false
+    
+    
+      {245603e3-f580-41a5-9632-b25fe3372cbf}
+    
+    
+      {c303d2fc-ff97-49b8-9ddd-467b4c9a0b16}
+    
+    
+      {9c4961d2-5ddb-40c7-9be8-ca918dc4e782}
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/codecs/mod_silk/mod_silk.2015.vcxproj b/src/mod/codecs/mod_silk/mod_silk.2017.vcxproj
similarity index 93%
rename from src/mod/codecs/mod_silk/mod_silk.2015.vcxproj
rename to src/mod/codecs/mod_silk/mod_silk.2017.vcxproj
index 3bacaf09a3..71e4a4d876 100644
--- a/src/mod/codecs/mod_silk/mod_silk.2015.vcxproj
+++ b/src/mod/codecs/mod_silk/mod_silk.2017.vcxproj
@@ -1,141 +1,141 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_silk
-    {AFA983D6-4569-4F88-BA94-555ED00FD9A8}
-    mod_silk
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      /analyze:stacksize65535
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {56b91d01-9150-4bbf-afa1-5b68ab991b76}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_silk
+    {AFA983D6-4569-4F88-BA94-555ED00FD9A8}
+    mod_silk
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      /analyze:stacksize65535
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {56b91d01-9150-4bbf-afa1-5b68ab991b76}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/codecs/mod_siren/mod_siren.2015.vcxproj b/src/mod/codecs/mod_siren/mod_siren.2017.vcxproj
similarity index 93%
rename from src/mod/codecs/mod_siren/mod_siren.2015.vcxproj
rename to src/mod/codecs/mod_siren/mod_siren.2017.vcxproj
index a42ab7a62d..f6d281e465 100644
--- a/src/mod/codecs/mod_siren/mod_siren.2015.vcxproj
+++ b/src/mod/codecs/mod_siren/mod_siren.2017.vcxproj
@@ -1,140 +1,140 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_siren
-    {0B6C905B-142E-4999-B39D-92FF7951E921}
-    mod_siren
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {1bc8a8ec-e03b-44df-bcd9-088650f4d29c}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_siren
+    {0B6C905B-142E-4999-B39D-92FF7951E921}
+    mod_siren
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {1bc8a8ec-e03b-44df-bcd9-088650f4d29c}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.2015.vcxproj b/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.2017.vcxproj
similarity index 93%
rename from src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.2015.vcxproj
rename to src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.2017.vcxproj
index d75f0c35a8..b0147c10a7 100644
--- a/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.2015.vcxproj
+++ b/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_dialplan_asterisk
-    {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}
-    mod_dialplan_asterisk
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_dialplan_asterisk
+    {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}
+    mod_dialplan_asterisk
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.2015.vcxproj b/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.2017.vcxproj
similarity index 93%
rename from src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.2015.vcxproj
rename to src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.2017.vcxproj
index 4f23a2ce52..5003629582 100644
--- a/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.2015.vcxproj
+++ b/src/mod/dialplans/mod_dialplan_directory/mod_dialplan_directory.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_dialplan_directory
-    {A27CCA23-1541-4337-81A4-F0A6413078A0}
-    mod_dialplan_directory
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_dialplan_directory
+    {A27CCA23-1541-4337-81A4-F0A6413078A0}
+    mod_dialplan_directory
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.2015.vcxproj b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.2017.vcxproj
similarity index 93%
rename from src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.2015.vcxproj
rename to src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.2017.vcxproj
index b2fa826aed..fdde6e5473 100644
--- a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.2015.vcxproj
+++ b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_dialplan_xml
-    {07113B25-D3AF-4E04-BA77-4CD1171F022C}
-    mod_dialplan_xml
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_dialplan_xml
+    {07113B25-D3AF-4E04-BA77-4CD1171F022C}
+    mod_dialplan_xml
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/directories/mod_ldap/mod_ldap.2015.vcxproj b/src/mod/directories/mod_ldap/mod_ldap.2017.vcxproj
similarity index 95%
rename from src/mod/directories/mod_ldap/mod_ldap.2015.vcxproj
rename to src/mod/directories/mod_ldap/mod_ldap.2017.vcxproj
index 2df088a23c..cb45a5a428 100644
--- a/src/mod/directories/mod_ldap/mod_ldap.2015.vcxproj
+++ b/src/mod/directories/mod_ldap/mod_ldap.2017.vcxproj
@@ -1,297 +1,297 @@
-
-
-  
-    
-      Debug MS-LDAP
-      Win32
-    
-    
-      Debug MS-LDAP
-      x64
-    
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release MS-LDAP
-      Win32
-    
-    
-      Release MS-LDAP
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_ldap
-    {EC3E5C7F-EE09-47E2-80FE-546363D14A98}
-    mod_ldap
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    true
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    false
-    false
-    false
-    false
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-    $(SolutionDir)$(PlatformName)\Release\mod\
-    $(SolutionDir)$(PlatformName)\Release\mod\
-  
-  
-    
-      cscript /nologo "$(ProjectDir)..\..\..\..\w32\vsnet\getlibs.vbs" Mod_ldap Debug
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;LDAP_DEPRECATED;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      olber32.lib;oldap_r.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      cscript /nologo "$(ProjectDir)..\..\..\..\w32\vsnet\getlibs.vbs" Mod_ldap Debug
-    
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;LDAP_DEPRECATED;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      olber32.lib;oldap_r.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      cscript /nologo "$(ProjectDir)..\..\..\..\w32\vsnet\getlibs.vbs" Mod_ldap Release
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      olber32.lib;oldap_r.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      cscript /nologo "$(ProjectDir)..\..\..\..\w32\vsnet\getlibs.vbs" Mod_ldap Release
-    
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      olber32.lib;oldap_r.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
-      MSLDAP;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      Wldap32.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
-      MSLDAP;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      Wldap32.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;MSLDAP;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      
-      
-    
-    
-      Wldap32.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;MSLDAP;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      
-      
-    
-    
-      Wldap32.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug MS-LDAP
+      Win32
+    
+    
+      Debug MS-LDAP
+      x64
+    
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release MS-LDAP
+      Win32
+    
+    
+      Release MS-LDAP
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_ldap
+    {EC3E5C7F-EE09-47E2-80FE-546363D14A98}
+    mod_ldap
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    true
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    false
+    false
+    false
+    false
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+    $(SolutionDir)$(PlatformName)\Release\mod\
+    $(SolutionDir)$(PlatformName)\Release\mod\
+  
+  
+    
+      cscript /nologo "$(ProjectDir)..\..\..\..\w32\vsnet\getlibs.vbs" Mod_ldap Debug
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;LDAP_DEPRECATED;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      olber32.lib;oldap_r.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      cscript /nologo "$(ProjectDir)..\..\..\..\w32\vsnet\getlibs.vbs" Mod_ldap Debug
+    
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;LDAP_DEPRECATED;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      olber32.lib;oldap_r.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      cscript /nologo "$(ProjectDir)..\..\..\..\w32\vsnet\getlibs.vbs" Mod_ldap Release
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      olber32.lib;oldap_r.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      cscript /nologo "$(ProjectDir)..\..\..\..\w32\vsnet\getlibs.vbs" Mod_ldap Release
+    
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      olber32.lib;oldap_r.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
+      MSLDAP;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      Wldap32.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
+      MSLDAP;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      Wldap32.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;MSLDAP;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+    
+    
+      Wldap32.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\openldap\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;MSLDAP;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+    
+    
+      Wldap32.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\openldap\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.2015.vcxproj b/src/mod/endpoints/mod_dingaling/mod_dingaling.2017.vcxproj
similarity index 94%
rename from src/mod/endpoints/mod_dingaling/mod_dingaling.2015.vcxproj
rename to src/mod/endpoints/mod_dingaling/mod_dingaling.2017.vcxproj
index abf3a7424a..73a2f25ff8 100644
--- a/src/mod/endpoints/mod_dingaling/mod_dingaling.2015.vcxproj
+++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.2017.vcxproj
@@ -1,165 +1,165 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_dingaling
-    {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}
-    mod_dingaling
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\libdingaling\src;%(AdditionalIncludeDirectories)
-      
-      
-      4718;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
-      $(ProjectDir)..\..\..\..\libs\libdingaling\$(OutDir);$(ProjectDir)..\..\..\..\libs\iksemel\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\libdingaling\src;%(AdditionalIncludeDirectories)
-      
-      
-      4718;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
-      $(ProjectDir)..\..\..\..\libs\libdingaling\$(OutDir);$(ProjectDir)..\..\..\..\libs\iksemel\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\libdingaling\src;%(AdditionalIncludeDirectories)
-      
-      
-      4718;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      $(ProjectDir)..\..\..\..\libs\libdingaling\$(OutDir);$(ProjectDir)..\..\..\..\libs\iksemel\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\libdingaling\src;%(AdditionalIncludeDirectories)
-      
-      
-      4718;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      $(ProjectDir)..\..\..\..\libs\libdingaling\$(OutDir);$(ProjectDir)..\..\..\..\libs\iksemel\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {1906d736-08bd-4ee1-924f-b536249b9a54}
-      false
-    
-    
-      {f057da7f-79e5-4b00-845c-ef446ef055e3}
-    
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {e727e8f6-935d-46fe-8b0e-37834748a0e3}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_dingaling
+    {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}
+    mod_dingaling
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\libdingaling\src;%(AdditionalIncludeDirectories)
+      
+      
+      4718;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
+      $(ProjectDir)..\..\..\..\libs\libdingaling\$(OutDir);$(ProjectDir)..\..\..\..\libs\iksemel\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\libdingaling\src;%(AdditionalIncludeDirectories)
+      
+      
+      4718;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
+      $(ProjectDir)..\..\..\..\libs\libdingaling\$(OutDir);$(ProjectDir)..\..\..\..\libs\iksemel\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\libdingaling\src;%(AdditionalIncludeDirectories)
+      
+      
+      4718;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      $(ProjectDir)..\..\..\..\libs\libdingaling\$(OutDir);$(ProjectDir)..\..\..\..\libs\iksemel\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\libdingaling\src;%(AdditionalIncludeDirectories)
+      
+      
+      4718;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      $(ProjectDir)..\..\..\..\libs\libdingaling\$(OutDir);$(ProjectDir)..\..\..\..\libs\iksemel\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {1906d736-08bd-4ee1-924f-b536249b9a54}
+      false
+    
+    
+      {f057da7f-79e5-4b00-845c-ef446ef055e3}
+    
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {e727e8f6-935d-46fe-8b0e-37834748a0e3}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2015.vcxproj b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2017.vcxproj
similarity index 96%
rename from src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2015.vcxproj
rename to src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2017.vcxproj
index dd468b6f13..2f540cc23b 100644
--- a/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2015.vcxproj
+++ b/src/mod/endpoints/mod_gsmopen/gsmlib/gsmlib-1.10-patched-13ubuntu/win32/gsmlib.2017.vcxproj
@@ -1,250 +1,250 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    gsmlib
-    {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}
-  
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-    StaticLibrary
-    false
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    $(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    AllRules.ruleset
-    
-    
-    AllRules.ruleset
-    
-    
-    AllRules.ruleset
-    
-    
-    AllRules.ruleset
-    
-    
-  
-  
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ../vcproject;..;.;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      true
-      .\Release/gsmlib.pch
-      .\Release/
-      .\Release/
-      .\Release/
-      true
-      Level3
-      true
-      /wd4290 /wd4996 %(AdditionalOptions)
-      4838;4267;4101;4244;4554;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-      /ignore:4221 %(AdditionalOptions)
-    
-    
-      true
-    
-  
-  
-    
-      Disabled
-      ..;.;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      true
-      Level3
-      true
-      ProgramDatabase
-      /wd4290 /wd4996 %(AdditionalOptions)
-      4838;4267;4101;4244;4554;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-      false
-      %(IgnoreSpecificDefaultLibraries)
-      /ignore:4221 %(AdditionalOptions)
-    
-    
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      OnlyExplicitInline
-      ../vcproject;..;.;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      MultiThreadedDLL
-      true
-      true
-      true
-      Level3
-      true
-      /wd4290 /wd4996 %(AdditionalOptions)
-      4838;4267;4101;4244;4554;%(DisableSpecificWarnings)
-    
-    
-      NDEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-    
-    
-      true
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      ..;.;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      true
-      Level3
-      true
-      ProgramDatabase
-      /wd4290 /wd4996 %(AdditionalOptions)
-      4838;4267;4101;4244;4554;%(DisableSpecificWarnings)
-    
-    
-      _DEBUG;%(PreprocessorDefinitions)
-      0x0409
-    
-    
-      true
-      false
-      %(IgnoreSpecificDefaultLibraries)
-    
-    
-      true
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    gsmlib
+    {26C82FCE-E0CF-4D10-A00C-D8E582FFEB53}
+  
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+    StaticLibrary
+    false
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    $(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    AllRules.ruleset
+    
+    
+    AllRules.ruleset
+    
+    
+    AllRules.ruleset
+    
+    
+    AllRules.ruleset
+    
+    
+  
+  
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ../vcproject;..;.;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      true
+      .\Release/gsmlib.pch
+      .\Release/
+      .\Release/
+      .\Release/
+      true
+      Level3
+      true
+      /wd4290 /wd4996 %(AdditionalOptions)
+      4838;4267;4101;4244;4554;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+      /ignore:4221 %(AdditionalOptions)
+    
+    
+      true
+    
+  
+  
+    
+      Disabled
+      ..;.;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      true
+      Level3
+      true
+      ProgramDatabase
+      /wd4290 /wd4996 %(AdditionalOptions)
+      4838;4267;4101;4244;4554;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+      false
+      %(IgnoreSpecificDefaultLibraries)
+      /ignore:4221 %(AdditionalOptions)
+    
+    
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      OnlyExplicitInline
+      ../vcproject;..;.;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      MultiThreadedDLL
+      true
+      true
+      true
+      Level3
+      true
+      /wd4290 /wd4996 %(AdditionalOptions)
+      4838;4267;4101;4244;4554;%(DisableSpecificWarnings)
+    
+    
+      NDEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+    
+    
+      true
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      ..;.;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      true
+      Level3
+      true
+      ProgramDatabase
+      /wd4290 /wd4996 %(AdditionalOptions)
+      4838;4267;4101;4244;4554;%(DisableSpecificWarnings)
+    
+    
+      _DEBUG;%(PreprocessorDefinitions)
+      0x0409
+    
+    
+      true
+      false
+      %(IgnoreSpecificDefaultLibraries)
+    
+    
+      true
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2015.vcxproj b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2017.vcxproj
similarity index 94%
rename from src/mod/endpoints/mod_gsmopen/mod_gsmopen.2015.vcxproj
rename to src/mod/endpoints/mod_gsmopen/mod_gsmopen.2017.vcxproj
index 7cc2e15b53..24c976aa7c 100644
--- a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2015.vcxproj
+++ b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.2017.vcxproj
@@ -1,170 +1,170 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_gsmopen
-    {74B120FF-6935-4DFE-A142-CDB6BEA99C90}
-    mod_skypiax
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.40219.1
-    false
-  
-  
-    
-      gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
-      NO_ALSA;%(PreprocessorDefinitions)
-      
-      
-      Level4
-      false
-      4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      false
-      
-      
-      %(AdditionalDependencies)
-    
-  
-  
-    
-      gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
-      
-      
-      4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      %(AdditionalDependencies)
-    
-  
-  
-    
-      X64
-    
-    
-      gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
-      NO_ALSA;%(PreprocessorDefinitions)
-      
-      
-      Level4
-      false
-      4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-      %(AdditionalDependencies)
-    
-  
-  
-    
-      X64
-    
-    
-      gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
-      
-      
-      4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      %(AdditionalDependencies)
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-    
-  
-  
-    
-      {1cbb0077-18c5-455f-801c-0a0ce7b0bbf5}
-    
-    
-      {77bc1dd2-c9a1-44d7-bffa-1320370cacb9}
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-    
-    
-      {26c82fce-e0cf-4d10-a00c-d8e582ffeb53}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_gsmopen
+    {74B120FF-6935-4DFE-A142-CDB6BEA99C90}
+    mod_skypiax
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.40219.1
+    false
+  
+  
+    
+      gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
+      NO_ALSA;%(PreprocessorDefinitions)
+      
+      
+      Level4
+      false
+      4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      false
+      
+      
+      %(AdditionalDependencies)
+    
+  
+  
+    
+      gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
+      
+      
+      4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      %(AdditionalDependencies)
+    
+  
+  
+    
+      X64
+    
+    
+      gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
+      NO_ALSA;%(PreprocessorDefinitions)
+      
+      
+      Level4
+      false
+      4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+      %(AdditionalDependencies)
+    
+  
+  
+    
+      X64
+    
+    
+      gsmlib\gsmlib-1.10-patched-13ubuntu;libctb-0.16\include;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src\msvc;%(RootDir)%(Directory)..\..\..\..\libs\spandsp\src;%(RootDir)%(Directory)..\..\..\..\libs\jpeg-8d;%(AdditionalIncludeDirectories)
+      
+      
+      4554;4324;4389;4244;4267;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      %(AdditionalDependencies)
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+      {1cbb0077-18c5-455f-801c-0a0ce7b0bbf5}
+    
+    
+      {77bc1dd2-c9a1-44d7-bffa-1320370cacb9}
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+    
+    
+      {26c82fce-e0cf-4d10-a00c-d8e582ffeb53}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_h323/mod_h323.2015.vcxproj b/src/mod/endpoints/mod_h323/mod_h323.2017.vcxproj
similarity index 95%
rename from src/mod/endpoints/mod_h323/mod_h323.2015.vcxproj
rename to src/mod/endpoints/mod_h323/mod_h323.2017.vcxproj
index 658934a24d..7e7ae60c99 100644
--- a/src/mod/endpoints/mod_h323/mod_h323.2015.vcxproj
+++ b/src/mod/endpoints/mod_h323/mod_h323.2017.vcxproj
@@ -1,154 +1,154 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_h323
-    {05C9FB27-480E-4D53-B3B7-7338E2514666}
-    mod_h323
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-    true
-  
-  
-    
-      ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
-      
-      
-      4100;4101;%(DisableSpecificWarnings)
-    
-    
-      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
-      h323plusd.lib;ptlibsd.lib;%(AdditionalDependencies)
-      ..\..\..\..\..\ptlib\lib;..\..\..\..\..\h323plus\lib;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
-      
-      
-      4100;4101;%(DisableSpecificWarnings)
-    
-    
-      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
-      h323plusd.lib;ptlibsd.lib;%(AdditionalDependencies)
-      ..\..\..\..\..\ptlib\lib\x64;..\..\..\..\..\h323plus\lib\x64;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories)
-      WIN32;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      4100;4101;%(DisableSpecificWarnings)
-    
-    
-      h323plus.lib;ptlibs.lib;%(AdditionalDependencies)
-      ..\..\..\..\..\ptlib\lib;..\..\..\..\..\h323plus\lib;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories)
-      WIN32;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      4100;4101;%(DisableSpecificWarnings)
-    
-    
-      h323plus.lib;ptlibs.lib;%(AdditionalDependencies)
-      ..\..\..\..\..\ptlib\lib\x64;..\..\..\..\..\h323plus\lib\x64;%(AdditionalLibraryDirectories)
-      false
-      
-      
-      false
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_h323
+    {05C9FB27-480E-4D53-B3B7-7338E2514666}
+    mod_h323
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+    true
+  
+  
+    
+      ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
+      
+      
+      4100;4101;%(DisableSpecificWarnings)
+    
+    
+      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
+      h323plusd.lib;ptlibsd.lib;%(AdditionalDependencies)
+      ..\..\..\..\..\ptlib\lib;..\..\..\..\..\h323plus\lib;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
+      
+      
+      4100;4101;%(DisableSpecificWarnings)
+    
+    
+      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
+      h323plusd.lib;ptlibsd.lib;%(AdditionalDependencies)
+      ..\..\..\..\..\ptlib\lib\x64;..\..\..\..\..\h323plus\lib\x64;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories)
+      WIN32;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      4100;4101;%(DisableSpecificWarnings)
+    
+    
+      h323plus.lib;ptlibs.lib;%(AdditionalDependencies)
+      ..\..\..\..\..\ptlib\lib;..\..\..\..\..\h323plus\lib;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      ..\..\..\..\..\ptlib\include;..\..\..\..\..\h323plus\include;%(AdditionalIncludeDirectories)
+      WIN32;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      4100;4101;%(DisableSpecificWarnings)
+    
+    
+      h323plus.lib;ptlibs.lib;%(AdditionalDependencies)
+      ..\..\..\..\..\ptlib\lib\x64;..\..\..\..\..\h323plus\lib\x64;%(AdditionalLibraryDirectories)
+      false
+      
+      
+      false
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_loopback/mod_loopback.2015.vcxproj b/src/mod/endpoints/mod_loopback/mod_loopback.2017.vcxproj
similarity index 94%
rename from src/mod/endpoints/mod_loopback/mod_loopback.2015.vcxproj
rename to src/mod/endpoints/mod_loopback/mod_loopback.2017.vcxproj
index 896b668e13..1e29ea6910 100644
--- a/src/mod/endpoints/mod_loopback/mod_loopback.2015.vcxproj
+++ b/src/mod/endpoints/mod_loopback/mod_loopback.2017.vcxproj
@@ -1,141 +1,141 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_loopback
-    {B3F424EC-3D8F-417C-B244-3919D5E1A577}
-    mod_loopback
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      6244;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      6244;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      6244;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      6244;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_loopback
+    {B3F424EC-3D8F-417C-B244-3919D5E1A577}
+    mod_loopback
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      6244;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      6244;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      6244;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      6244;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_opal/mod_opal.2015.vcxproj b/src/mod/endpoints/mod_opal/mod_opal.2017.vcxproj
similarity index 94%
rename from src/mod/endpoints/mod_opal/mod_opal.2015.vcxproj
rename to src/mod/endpoints/mod_opal/mod_opal.2017.vcxproj
index b8814e992f..3c7c46da03 100644
--- a/src/mod/endpoints/mod_opal/mod_opal.2015.vcxproj
+++ b/src/mod/endpoints/mod_opal/mod_opal.2017.vcxproj
@@ -1,94 +1,94 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Release
-      Win32
-    
-  
-  
-    mod_opal
-    {05C9FB27-480E-4D53-B3B7-6338E2526666}
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
-      
-      
-      4100;4101;%(DisableSpecificWarnings)
-      true
-    
-    
-      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
-      opalsd.lib;ptlibsd.lib;%(AdditionalDependencies)
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      
-      
-      4100;4101;%(DisableSpecificWarnings)
-    
-    
-      opals.lib;ptlibs.lib;%(AdditionalDependencies)
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Release
+      Win32
+    
+  
+  
+    mod_opal
+    {05C9FB27-480E-4D53-B3B7-6338E2526666}
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
+      
+      
+      4100;4101;%(DisableSpecificWarnings)
+      true
+    
+    
+      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
+      opalsd.lib;ptlibsd.lib;%(AdditionalDependencies)
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      
+      
+      4100;4101;%(DisableSpecificWarnings)
+    
+    
+      opals.lib;ptlibs.lib;%(AdditionalDependencies)
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_portaudio/mod_PortAudio.2015.vcxproj b/src/mod/endpoints/mod_portaudio/mod_PortAudio.2017.vcxproj
similarity index 95%
rename from src/mod/endpoints/mod_portaudio/mod_PortAudio.2015.vcxproj
rename to src/mod/endpoints/mod_portaudio/mod_PortAudio.2017.vcxproj
index f9502902a0..ccd35b3c09 100644
--- a/src/mod/endpoints/mod_portaudio/mod_PortAudio.2015.vcxproj
+++ b/src/mod/endpoints/mod_portaudio/mod_PortAudio.2017.vcxproj
@@ -1,195 +1,195 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_PortAudio
-    {5FD31A25-5D83-4794-8BEE-904DAD84CE71}
-    mod_PortAudio
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\portaudio\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
-      
-      
-      4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
-      ksuser.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\portaudio\winvc\Lib;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\portaudio\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
-      
-      
-      4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
-      ksuser.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\portaudio\winvc\Lib;%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\portaudio\include;%(AdditionalIncludeDirectories)
-      ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
-      
-      
-      4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      ksuser.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\portaudio\winvc\Lib;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\portaudio\include;%(AdditionalIncludeDirectories)
-      ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
-      
-      
-      4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      ksuser.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\portaudio\winvc\Lib;%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      6011;4100;4101;%(DisableSpecificWarnings)
-      6011;4100;4101;%(DisableSpecificWarnings)
-      6011;4100;4101;%(DisableSpecificWarnings)
-      6011;4100;4101;%(DisableSpecificWarnings)
-    
-    
-    
-  
-  
-    
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {0a18a071-125e-442f-aff7-a3f68abecf99}
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_PortAudio
+    {5FD31A25-5D83-4794-8BEE-904DAD84CE71}
+    mod_PortAudio
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\portaudio\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
+      
+      
+      4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
+      ksuser.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\portaudio\winvc\Lib;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\portaudio\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
+      
+      
+      4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
+      ksuser.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\portaudio\winvc\Lib;%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\portaudio\include;%(AdditionalIncludeDirectories)
+      ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
+      
+      
+      4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      ksuser.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\portaudio\winvc\Lib;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\portaudio\include;%(AdditionalIncludeDirectories)
+      ALLOW_SMP_DANGERS;%(PreprocessorDefinitions)
+      
+      
+      4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      ksuser.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\portaudio\winvc\Lib;%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      6011;4100;4101;%(DisableSpecificWarnings)
+      6011;4100;4101;%(DisableSpecificWarnings)
+      6011;4100;4101;%(DisableSpecificWarnings)
+      6011;4100;4101;%(DisableSpecificWarnings)
+    
+    
+    
+  
+  
+    
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {0a18a071-125e-442f-aff7-a3f68abecf99}
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_rtc/mod_rtc.2015.vcxproj b/src/mod/endpoints/mod_rtc/mod_rtc.2017.vcxproj
similarity index 93%
rename from src/mod/endpoints/mod_rtc/mod_rtc.2015.vcxproj
rename to src/mod/endpoints/mod_rtc/mod_rtc.2017.vcxproj
index ed07ba9eb3..98a0788662 100644
--- a/src/mod/endpoints/mod_rtc/mod_rtc.2015.vcxproj
+++ b/src/mod/endpoints/mod_rtc/mod_rtc.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_rtc
-    {3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}
-    mod_rtc
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      4189;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4189;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      4189;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      4189;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_rtc
+    {3884ADD2-91D0-4CD6-86D3-D5FB2D4AAB9E}
+    mod_rtc
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      4189;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4189;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      4189;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      4189;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_rtmp/mod_rtmp.2015.vcxproj b/src/mod/endpoints/mod_rtmp/mod_rtmp.2017.vcxproj
similarity index 95%
rename from src/mod/endpoints/mod_rtmp/mod_rtmp.2015.vcxproj
rename to src/mod/endpoints/mod_rtmp/mod_rtmp.2017.vcxproj
index 7aabad1e93..f4633f0c38 100644
--- a/src/mod/endpoints/mod_rtmp/mod_rtmp.2015.vcxproj
+++ b/src/mod/endpoints/mod_rtmp/mod_rtmp.2017.vcxproj
@@ -1,184 +1,184 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_rtmp
-    {48414740-C693-4968-9846-EE058020C64F}
-    mod_rtmp
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-    true
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      ./libamf/src;../../../../libs/win32/;./;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      4189;4456;4221;4127;6001;6011;6385;6244;6259;4090;4306;4244;4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;Iphlpapi.lib;Winmm.lib;%(AdditionalDependencies)
-    
-  
-  
-    
-      ./libamf/src;../../../../libs/win32/;./;%(AdditionalIncludeDirectories)
-      _DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      4189;4456;4221;4127;6001;6011;6385;6244;6259;4090;4306;4244;4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;Iphlpapi.lib;Winmm.lib;%(AdditionalDependencies)
-    
-  
-  
-    
-      ./libamf/src;../../../../libs/win32/;./;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      4189;4456;4221;4127;6001;6011;6385;6244;6259;4090;4306;4244;4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;Iphlpapi.lib;Winmm.lib;%(AdditionalDependencies)
-    
-  
-  
-    
-      ./libamf/src;../../../../libs/win32/;./;%(AdditionalIncludeDirectories)
-      NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      4189;4456;4221;4127;6001;6011;6385;6244;6259;4090;4306;4244;4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;Iphlpapi.lib;Winmm.lib;%(AdditionalDependencies)
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_rtmp
+    {48414740-C693-4968-9846-EE058020C64F}
+    mod_rtmp
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+    true
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      ./libamf/src;../../../../libs/win32/;./;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      4189;4456;4221;4127;6001;6011;6385;6244;6259;4090;4306;4244;4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;Iphlpapi.lib;Winmm.lib;%(AdditionalDependencies)
+    
+  
+  
+    
+      ./libamf/src;../../../../libs/win32/;./;%(AdditionalIncludeDirectories)
+      _DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      4189;4456;4221;4127;6001;6011;6385;6244;6259;4090;4306;4244;4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;Iphlpapi.lib;Winmm.lib;%(AdditionalDependencies)
+    
+  
+  
+    
+      ./libamf/src;../../../../libs/win32/;./;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      4189;4456;4221;4127;6001;6011;6385;6244;6259;4090;4306;4244;4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;Iphlpapi.lib;Winmm.lib;%(AdditionalDependencies)
+    
+  
+  
+    
+      ./libamf/src;../../../../libs/win32/;./;%(AdditionalIncludeDirectories)
+      NDEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      4189;4456;4221;4127;6001;6011;6385;6244;6259;4090;4306;4244;4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;Iphlpapi.lib;Winmm.lib;%(AdditionalDependencies)
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.2015.vcxproj b/src/mod/endpoints/mod_skinny/mod_skinny.2017.vcxproj
similarity index 95%
rename from src/mod/endpoints/mod_skinny/mod_skinny.2015.vcxproj
rename to src/mod/endpoints/mod_skinny/mod_skinny.2017.vcxproj
index ed6e63a786..83585068c3 100644
--- a/src/mod/endpoints/mod_skinny/mod_skinny.2015.vcxproj
+++ b/src/mod/endpoints/mod_skinny/mod_skinny.2017.vcxproj
@@ -1,182 +1,182 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_skinny
-    {CC1DD008-9406-448D-A0AD-33C3186CFADB}
-    mod_skinny
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-    true
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      4456;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-      4456;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      
-      
-      4456;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      
-      
-      4456;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
-      false
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      4310;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
-      4310;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
-      4310;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
-      4310;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_skinny
+    {CC1DD008-9406-448D-A0AD-33C3186CFADB}
+    mod_skinny
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+    true
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      4456;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+      4456;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      /NODEFAULTLIB:LIMBCTD %(AdditionalOptions)
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      
+      
+      4456;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      
+      
+      4456;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
+      false
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      4310;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
+      4310;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
+      4310;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
+      4310;4245;4267;4389;4244;6011;4100;4101;%(DisableSpecificWarnings)
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.2015.vcxproj b/src/mod/endpoints/mod_sofia/mod_sofia.2017.vcxproj
similarity index 96%
rename from src/mod/endpoints/mod_sofia/mod_sofia.2015.vcxproj
rename to src/mod/endpoints/mod_sofia/mod_sofia.2017.vcxproj
index afaaafac46..442a50e830 100644
--- a/src/mod/endpoints/mod_sofia/mod_sofia.2015.vcxproj
+++ b/src/mod/endpoints/mod_sofia/mod_sofia.2017.vcxproj
@@ -1,197 +1,197 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_sofia
-    {0DF3ABD0-DDC0-4265-B778-07C66780979B}
-    mod_sofia
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)
-      LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)
-      
-      
-      4456;4457;4201;%(DisableSpecificWarnings)
-      false
-    
-    
-      ws2_32.lib;advapi32.lib;iphlpapi.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\sofia-sip\win32\pthread;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)
-      LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)
-      
-      
-      4456;4457;4201;%(DisableSpecificWarnings)
-      false
-    
-    
-      ws2_32.lib;advapi32.lib;iphlpapi.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\sofia-sip\win32\pthread;%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)
-      LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)
-      
-      
-      4456;4457;4201;%(DisableSpecificWarnings)
-      false
-    
-    
-      ws2_32.lib;advapi32.lib;iphlpapi.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\sofia-sip\win32\pthread;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)
-      LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)
-      
-      
-      4456;4457;4201;%(DisableSpecificWarnings)
-      false
-    
-    
-      ws2_32.lib;advapi32.lib;iphlpapi.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\..\..\libs\sofia-sip\win32\pthread;%(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {df018947-0fff-4eb3-bdee-441dc81da7a4}
-      false
-    
-    
-      {70a49bc2-7500-41d0-b75d-edcc5be987a0}
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_sofia
+    {0DF3ABD0-DDC0-4265-B778-07C66780979B}
+    mod_sofia
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)
+      LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)
+      
+      
+      4456;4457;4201;%(DisableSpecificWarnings)
+      false
+    
+    
+      ws2_32.lib;advapi32.lib;iphlpapi.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\sofia-sip\win32\pthread;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)
+      LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)
+      
+      
+      4456;4457;4201;%(DisableSpecificWarnings)
+      false
+    
+    
+      ws2_32.lib;advapi32.lib;iphlpapi.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\sofia-sip\win32\pthread;%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)
+      LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)
+      
+      
+      4456;4457;4201;%(DisableSpecificWarnings)
+      false
+    
+    
+      ws2_32.lib;advapi32.lib;iphlpapi.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\sofia-sip\win32\pthread;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\su;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nua;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\win32;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\url;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sip;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\msg;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sdp;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nta;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\nea;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\soa;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\iptsec;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\bnf;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\tport;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\sresolv;%(RootDir)%(Directory)..\..\..\..\libs\sofia-sip\libsofia-sip-ua\ipt;%(AdditionalIncludeDirectories)
+      LIBSOFIA_SIP_UA_STATIC;PTW32_STATIC_LIB;LIBSRES_STATIC;%(PreprocessorDefinitions)
+      
+      
+      4456;4457;4201;%(DisableSpecificWarnings)
+      false
+    
+    
+      ws2_32.lib;advapi32.lib;iphlpapi.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\..\..\libs\sofia-sip\win32\pthread;%(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {df018947-0fff-4eb3-bdee-441dc81da7a4}
+      false
+    
+    
+      {70a49bc2-7500-41d0-b75d-edcc5be987a0}
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/endpoints/mod_verto/mod_verto.2015.vcxproj b/src/mod/endpoints/mod_verto/mod_verto.2017.vcxproj
similarity index 95%
rename from src/mod/endpoints/mod_verto/mod_verto.2015.vcxproj
rename to src/mod/endpoints/mod_verto/mod_verto.2017.vcxproj
index 8a56082a9b..c76047fd81 100644
--- a/src/mod/endpoints/mod_verto/mod_verto.2015.vcxproj
+++ b/src/mod/endpoints/mod_verto/mod_verto.2017.vcxproj
@@ -1,160 +1,160 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_verto
-    {5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}
-    mod_verto
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast
-      _TIMESPEC_DEFINED;_DEBUG;DEBUG;%(PreprocessorDefinitions)
-      6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast
-      _TIMESPEC_DEFINED;_DEBUG;DEBUG;%(PreprocessorDefinitions)
-      6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast
-      _TIMESPEC_DEFINED;NDEBUG;%(PreprocessorDefinitions)
-      6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast
-      _TIMESPEC_DEFINED;NDEBUG;%(PreprocessorDefinitions)
-      6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-      6386;4267;4244;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      6386;4267;4244;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      6386;4267;4244;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      6386;4267;4244;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-    
-      {df018947-0fff-4eb3-bdee-441dc81da7a4}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_verto
+    {5B2BACE4-0F5A-4A21-930D-C0F4B1F58FA6}
+    mod_verto
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast
+      _TIMESPEC_DEFINED;_DEBUG;DEBUG;%(PreprocessorDefinitions)
+      6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast
+      _TIMESPEC_DEFINED;_DEBUG;DEBUG;%(PreprocessorDefinitions)
+      6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast
+      _TIMESPEC_DEFINED;NDEBUG;%(PreprocessorDefinitions)
+      6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      $(SolutionDir)\src\include;%(AdditionalIncludeDirectories);$(ProjectDir)..\..\..\..\libs\pthreads-w32-2-9-1;.\;.\mcast
+      _TIMESPEC_DEFINED;NDEBUG;%(PreprocessorDefinitions)
+      6053;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+      6386;4267;4244;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      6386;4267;4244;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      6386;4267;4244;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      6386;4267;4244;6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+    
+      {df018947-0fff-4eb3-bdee-441dc81da7a4}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp.2015.vcxproj b/src/mod/event_handlers/mod_amqp/mod_amqp.2017.vcxproj
similarity index 96%
rename from src/mod/event_handlers/mod_amqp/mod_amqp.2015.vcxproj
rename to src/mod/event_handlers/mod_amqp/mod_amqp.2017.vcxproj
index f0ba526010..0b4d65db37 100644
--- a/src/mod/event_handlers/mod_amqp/mod_amqp.2015.vcxproj
+++ b/src/mod/event_handlers/mod_amqp/mod_amqp.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -140,7 +140,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
@@ -148,4 +148,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.2015.vcxproj b/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.2017.vcxproj
similarity index 93%
rename from src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.2015.vcxproj
rename to src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.2017.vcxproj
index f21b0f98b4..e200ab0c54 100644
--- a/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.2015.vcxproj
+++ b/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.2017.vcxproj
@@ -1,141 +1,141 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_cdr_csv
-    {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}
-    mod_cdr_csv
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(AdditionalIncludeDirectories)
-      
-      
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_cdr_csv
+    {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}
+    mod_cdr_csv
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(AdditionalIncludeDirectories)
+      
+      
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.2015.vcxproj b/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.2017.vcxproj
similarity index 95%
rename from src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.2015.vcxproj
rename to src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.2017.vcxproj
index 3f9242914f..28b9e69fec 100644
--- a/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.2015.vcxproj
+++ b/src/mod/event_handlers/mod_cdr_pg_csv/mod_cdr_pg_csv.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -125,7 +125,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
@@ -133,4 +133,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.2015.vcxproj b/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.2017.vcxproj
similarity index 95%
rename from src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.2015.vcxproj
rename to src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.2017.vcxproj
index 73a038d54f..c05cd4f5db 100644
--- a/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.2015.vcxproj
+++ b/src/mod/event_handlers/mod_cdr_sqlite/mod_cdr_sqlite.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -124,7 +124,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
diff --git a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.2015.vcxproj b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.2017.vcxproj
similarity index 93%
rename from src/mod/event_handlers/mod_event_multicast/mod_event_multicast.2015.vcxproj
rename to src/mod/event_handlers/mod_event_multicast/mod_event_multicast.2017.vcxproj
index 3ba75a3dbb..c826e465fc 100644
--- a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.2015.vcxproj
+++ b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.2017.vcxproj
@@ -1,144 +1,144 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_event_multicast
-    {784113EF-44D9-4949-835D-7065D3C7AD08}
-    mod_event_multicast
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      ws2_32.lib;%(AdditionalDependencies)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_event_multicast
+    {784113EF-44D9-4949-835D-7065D3C7AD08}
+    mod_event_multicast
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      ws2_32.lib;%(AdditionalDependencies)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/event_handlers/mod_event_socket/mod_event_socket.2015.vcxproj b/src/mod/event_handlers/mod_event_socket/mod_event_socket.2017.vcxproj
similarity index 93%
rename from src/mod/event_handlers/mod_event_socket/mod_event_socket.2015.vcxproj
rename to src/mod/event_handlers/mod_event_socket/mod_event_socket.2017.vcxproj
index bee1735189..52753cd16d 100644
--- a/src/mod/event_handlers/mod_event_socket/mod_event_socket.2015.vcxproj
+++ b/src/mod/event_handlers/mod_event_socket/mod_event_socket.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_event_socket
-    {05515420-16DE-4E63-BE73-85BE85BA5142}
-    mod_event_socket
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_event_socket
+    {05515420-16DE-4E63-BE73-85BE85BA5142}
+    mod_event_socket
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/event_handlers/mod_odbc_cdr/mod_odbc_cdr.2015.vcxproj b/src/mod/event_handlers/mod_odbc_cdr/mod_odbc_cdr.2017.vcxproj
similarity index 96%
rename from src/mod/event_handlers/mod_odbc_cdr/mod_odbc_cdr.2015.vcxproj
rename to src/mod/event_handlers/mod_odbc_cdr/mod_odbc_cdr.2017.vcxproj
index 7c43b6a407..e516f04e9e 100644
--- a/src/mod/event_handlers/mod_odbc_cdr/mod_odbc_cdr.2015.vcxproj
+++ b/src/mod/event_handlers/mod_odbc_cdr/mod_odbc_cdr.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -130,7 +130,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
diff --git a/src/mod/formats/mod_local_stream/mod_local_stream.2015.vcxproj b/src/mod/formats/mod_local_stream/mod_local_stream.2017.vcxproj
similarity index 93%
rename from src/mod/formats/mod_local_stream/mod_local_stream.2015.vcxproj
rename to src/mod/formats/mod_local_stream/mod_local_stream.2017.vcxproj
index 5a1a038b3b..4fe1784d65 100644
--- a/src/mod/formats/mod_local_stream/mod_local_stream.2015.vcxproj
+++ b/src/mod/formats/mod_local_stream/mod_local_stream.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_local_stream
-    {2CA40887-1622-46A1-A7F9-17FD7E7E545B}
-    mod_local_stream
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_local_stream
+    {2CA40887-1622-46A1-A7F9-17FD7E7E545B}
+    mod_local_stream
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/formats/mod_native_file/mod_native_file.2015.vcxproj b/src/mod/formats/mod_native_file/mod_native_file.2017.vcxproj
similarity index 93%
rename from src/mod/formats/mod_native_file/mod_native_file.2015.vcxproj
rename to src/mod/formats/mod_native_file/mod_native_file.2017.vcxproj
index f59a4b784d..da699ab358 100644
--- a/src/mod/formats/mod_native_file/mod_native_file.2015.vcxproj
+++ b/src/mod/formats/mod_native_file/mod_native_file.2017.vcxproj
@@ -1,141 +1,141 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_native_file
-    {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}
-    mod_native_file
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_native_file
+    {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}
+    mod_native_file
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/formats/mod_png/mod_png.2015.vcxproj b/src/mod/formats/mod_png/mod_png.2017.vcxproj
similarity index 96%
rename from src/mod/formats/mod_png/mod_png.2015.vcxproj
rename to src/mod/formats/mod_png/mod_png.2017.vcxproj
index 862258c444..6fa296247e 100644
--- a/src/mod/formats/mod_png/mod_png.2015.vcxproj
+++ b/src/mod/formats/mod_png/mod_png.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -134,11 +134,11 @@
     
   
   
-    
+    
       {D6973076-9317-4EF2-A0B8-B7A18AC0713E}
       false
     
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
diff --git a/src/mod/formats/mod_shout/mod_shout.2015.vcxproj b/src/mod/formats/mod_shout/mod_shout.2017.vcxproj
similarity index 94%
rename from src/mod/formats/mod_shout/mod_shout.2015.vcxproj
rename to src/mod/formats/mod_shout/mod_shout.2017.vcxproj
index cef62a1ca8..a147687522 100644
--- a/src/mod/formats/mod_shout/mod_shout.2015.vcxproj
+++ b/src/mod/formats/mod_shout/mod_shout.2017.vcxproj
@@ -1,192 +1,192 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    {38FE0559-9910-43A8-9E45-3E5004C27692}
-    mod_shout
-    mod_shout
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      Disabled
-      ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      false
-      ProgramDatabase
-      false
-    
-    
-      LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
-      MachineX86
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Level3
-      false
-      ProgramDatabase
-      false
-    
-    
-      LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
-      MachineX64
-    
-  
-  
-    
-      MaxSpeed
-      true
-      ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories)
-      _TIMESPEC_DEFINED;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      true
-      Level3
-      false
-      ProgramDatabase
-    
-    
-      LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
-      true
-      true
-      UseLinkTimeCodeGeneration
-      MachineX86
-    
-  
-  
-    
-      X64
-    
-    
-      MaxSpeed
-      true
-      ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories)
-      %(PreprocessorDefinitions)
-      MultiThreadedDLL
-      true
-      Level3
-      false
-      ProgramDatabase
-    
-    
-      LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
-      true
-      true
-      UseLinkTimeCodeGeneration
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-    
-    
-  
-  
-    
-      {e316772f-5d8f-4f2a-8f71-094c3e859d34}
-      false
-    
-    
-      {0feeaec6-4399-4c46-b7db-62ece80d15b4}
-    
-    
-      {d3d8b329-20be-475e-9e83-653cea0e0ef5}
-      false
-    
-    
-      {419c8f80-d858-4b48-a25c-af4007608137}
-      false
-    
-    
-      {df018947-0fff-4eb3-bdee-441dc81da7a4}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    {38FE0559-9910-43A8-9E45-3E5004C27692}
+    mod_shout
+    mod_shout
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      Disabled
+      ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      false
+      ProgramDatabase
+      false
+    
+    
+      LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
+      MachineX86
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Level3
+      false
+      ProgramDatabase
+      false
+    
+    
+      LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
+      MachineX64
+    
+  
+  
+    
+      MaxSpeed
+      true
+      ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories)
+      _TIMESPEC_DEFINED;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      true
+      Level3
+      false
+      ProgramDatabase
+    
+    
+      LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
+      true
+      true
+      UseLinkTimeCodeGeneration
+      MachineX86
+    
+  
+  
+    
+      X64
+    
+    
+      MaxSpeed
+      true
+      ../../../../libs/lame-3.98.4/include;..\..\..\..\libs\win32\libshout;..\..\..\..\libs\libshout-2.2.2\include;..\..\..\..\libs\mpg123\src;..\..\..\..\libs\win32\mpg123;..\..\..\..\libs\win32\mpg123\libmpg123;%(AdditionalIncludeDirectories)
+      %(PreprocessorDefinitions)
+      MultiThreadedDLL
+      true
+      Level3
+      false
+      ProgramDatabase
+    
+    
+      LIBCMTD.LIB;LIBCMT.LIB;%(IgnoreSpecificDefaultLibraries)
+      true
+      true
+      UseLinkTimeCodeGeneration
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+    
+    
+  
+  
+    
+      {e316772f-5d8f-4f2a-8f71-094c3e859d34}
+      false
+    
+    
+      {0feeaec6-4399-4c46-b7db-62ece80d15b4}
+    
+    
+      {d3d8b329-20be-475e-9e83-653cea0e0ef5}
+      false
+    
+    
+      {419c8f80-d858-4b48-a25c-af4007608137}
+      false
+    
+    
+      {df018947-0fff-4eb3-bdee-441dc81da7a4}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/formats/mod_sndfile/mod_sndfile.2015.vcxproj b/src/mod/formats/mod_sndfile/mod_sndfile.2017.vcxproj
similarity index 93%
rename from src/mod/formats/mod_sndfile/mod_sndfile.2015.vcxproj
rename to src/mod/formats/mod_sndfile/mod_sndfile.2017.vcxproj
index 59415f74ab..83b403ae51 100644
--- a/src/mod/formats/mod_sndfile/mod_sndfile.2015.vcxproj
+++ b/src/mod/formats/mod_sndfile/mod_sndfile.2017.vcxproj
@@ -1,142 +1,142 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_sndfile
-    {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}
-    mod_sndfile
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_sndfile
+    {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}
+    mod_sndfile
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/formats/mod_tone_stream/mod_tone_stream.2015.vcxproj b/src/mod/formats/mod_tone_stream/mod_tone_stream.2017.vcxproj
similarity index 93%
rename from src/mod/formats/mod_tone_stream/mod_tone_stream.2015.vcxproj
rename to src/mod/formats/mod_tone_stream/mod_tone_stream.2017.vcxproj
index b65f6b9b3a..fad8998769 100644
--- a/src/mod/formats/mod_tone_stream/mod_tone_stream.2015.vcxproj
+++ b/src/mod/formats/mod_tone_stream/mod_tone_stream.2017.vcxproj
@@ -1,145 +1,145 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_tone_stream
-    {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}
-    mod_tone_stream
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      /analyze:stacksize32768
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      /analyze:stacksize32768
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {89385c74-5860-4174-9caf-a39e7c48909c}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_tone_stream
+    {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}
+    mod_tone_stream
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      /analyze:stacksize32768
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      /analyze:stacksize32768
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {89385c74-5860-4174-9caf-a39e7c48909c}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/languages/mod_lua/mod_lua.2015.vcxproj b/src/mod/languages/mod_lua/mod_lua.2017.vcxproj
similarity index 95%
rename from src/mod/languages/mod_lua/mod_lua.2015.vcxproj
rename to src/mod/languages/mod_lua/mod_lua.2017.vcxproj
index ba4e217fb6..3d34cd4663 100644
--- a/src/mod/languages/mod_lua/mod_lua.2015.vcxproj
+++ b/src/mod/languages/mod_lua/mod_lua.2017.vcxproj
@@ -1,162 +1,162 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_lua
-    {7B077E7F-1BE7-4291-AB86-55E527B25CAC}
-    mod_lua
-    Win32Proj
-  
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      .;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_WIN32;%(PreprocessorDefinitions)
-      
-      
-      4127; 4505;%(DisableSpecificWarnings)
-      false
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      .;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_WIN32;%(PreprocessorDefinitions)
-      
-      
-      4127; 4505;%(DisableSpecificWarnings)
-      false
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      .;%(AdditionalIncludeDirectories)
-      _CRT_SECURE_NO_DEPRECATE;_WIN32;%(PreprocessorDefinitions)
-      
-      
-      4127; 4505;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      .;%(AdditionalIncludeDirectories)
-      _CRT_SECURE_NO_DEPRECATE;_WIN32;%(PreprocessorDefinitions)
-      
-      
-      4127; 4505;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      4244;4127; 4505;%(DisableSpecificWarnings)
-      4244;4127; 4505;%(DisableSpecificWarnings)
-      4244;4127; 4505;%(DisableSpecificWarnings)
-      4244;4127; 4505;%(DisableSpecificWarnings)
-    
-    
-    
-      4311;4302;6385;%(DisableSpecificWarnings)
-      4311;4302;6385;%(DisableSpecificWarnings)
-      4311;4302;6385;%(DisableSpecificWarnings)
-      4311;4302;6385;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_lua
+    {7B077E7F-1BE7-4291-AB86-55E527B25CAC}
+    mod_lua
+    Win32Proj
+  
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      .;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_WIN32;%(PreprocessorDefinitions)
+      
+      
+      4127; 4505;%(DisableSpecificWarnings)
+      false
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      .;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;_CRT_SECURE_NO_DEPRECATE;_WIN32;%(PreprocessorDefinitions)
+      
+      
+      4127; 4505;%(DisableSpecificWarnings)
+      false
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      .;%(AdditionalIncludeDirectories)
+      _CRT_SECURE_NO_DEPRECATE;_WIN32;%(PreprocessorDefinitions)
+      
+      
+      4127; 4505;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      .;%(AdditionalIncludeDirectories)
+      _CRT_SECURE_NO_DEPRECATE;_WIN32;%(PreprocessorDefinitions)
+      
+      
+      4127; 4505;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      4244;4127; 4505;%(DisableSpecificWarnings)
+      4244;4127; 4505;%(DisableSpecificWarnings)
+      4244;4127; 4505;%(DisableSpecificWarnings)
+      4244;4127; 4505;%(DisableSpecificWarnings)
+    
+    
+    
+      4311;4302;6385;%(DisableSpecificWarnings)
+      4311;4302;6385;%(DisableSpecificWarnings)
+      4311;4302;6385;%(DisableSpecificWarnings)
+      4311;4302;6385;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/languages/mod_managed/managed/FreeSWITCH.Managed.2015.csproj b/src/mod/languages/mod_managed/managed/FreeSWITCH.Managed.2017.csproj
similarity index 97%
rename from src/mod/languages/mod_managed/managed/FreeSWITCH.Managed.2015.csproj
rename to src/mod/languages/mod_managed/managed/FreeSWITCH.Managed.2017.csproj
index 527cf441bd..cec860ab1d 100644
--- a/src/mod/languages/mod_managed/managed/FreeSWITCH.Managed.2015.csproj
+++ b/src/mod/languages/mod_managed/managed/FreeSWITCH.Managed.2017.csproj
@@ -1,100 +1,100 @@
-
-
-  
-    Debug
-    AnyCPU
-    9.0.30729
-    2.0
-    {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}
-    Library
-    Properties
-    FreeSWITCH.Managed
-    FreeSWITCH.Managed
-    v4.0
-    512
-    
-    
-    
-    
-    3.5
-    
-    
-  
-  
-    true
-    full
-    false
-    ..\..\..\..\..\Win32\Debug\mod\
-    TRACE;DEBUG;CLR_VERSION40
-    prompt
-    4
-  
-  
-    pdbonly
-    true
-    ..\..\..\..\..\Win32\Release\mod\
-    TRACE;CLR_VERSION40
-    prompt
-    4
-  
-  
-    true
-    ..\..\..\..\..\x64\Debug\mod\
-    TRACE;DEBUG;CLR_VERSION40
-    full
-    x64
-    prompt
-    true
-    true
-    true
-  
-  
-    ..\..\..\..\..\x64\Release\mod\
-    TRACE;CLR_VERSION40
-    true
-    pdbonly
-    x64
-    prompt
-    true
-    true
-    true
-  
-  
-    
-    
-      3.5
-    
-    
-      3.5
-    
-    
-      3.5
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-  
-
+
+
+  
+    Debug
+    AnyCPU
+    9.0.30729
+    2.0
+    {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}
+    Library
+    Properties
+    FreeSWITCH.Managed
+    FreeSWITCH.Managed
+    v4.0
+    512
+    
+    
+    
+    
+    3.5
+    
+    
+  
+  
+    true
+    full
+    false
+    ..\..\..\..\..\Win32\Debug\mod\
+    TRACE;DEBUG;CLR_VERSION40
+    prompt
+    4
+  
+  
+    pdbonly
+    true
+    ..\..\..\..\..\Win32\Release\mod\
+    TRACE;CLR_VERSION40
+    prompt
+    4
+  
+  
+    true
+    ..\..\..\..\..\x64\Debug\mod\
+    TRACE;DEBUG;CLR_VERSION40
+    full
+    x64
+    prompt
+    true
+    true
+    true
+  
+  
+    ..\..\..\..\..\x64\Release\mod\
+    TRACE;CLR_VERSION40
+    true
+    pdbonly
+    x64
+    prompt
+    true
+    true
+    true
+  
+  
+    
+    
+      3.5
+    
+    
+      3.5
+    
+    
+      3.5
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+  
+
diff --git a/src/mod/languages/mod_managed/managed/examples/winFailToBan/winFailToBan.csproj b/src/mod/languages/mod_managed/managed/examples/winFailToBan/winFailToBan.csproj
index 250f105d3c..4efad57215 100644
--- a/src/mod/languages/mod_managed/managed/examples/winFailToBan/winFailToBan.csproj
+++ b/src/mod/languages/mod_managed/managed/examples/winFailToBan/winFailToBan.csproj
@@ -49,7 +49,7 @@
     
   
   
-    
+    
       {834e2b2f-5483-4b80-8fe3-fe48ff76e5c0}
       FreeSWITCH.Managed.2015
     
diff --git a/src/mod/languages/mod_managed/mod_managed.2015.vcxproj b/src/mod/languages/mod_managed/mod_managed.2017.vcxproj
similarity index 95%
rename from src/mod/languages/mod_managed/mod_managed.2015.vcxproj
rename to src/mod/languages/mod_managed/mod_managed.2017.vcxproj
index 8cff1819a7..bea9135354 100644
--- a/src/mod/languages/mod_managed/mod_managed.2015.vcxproj
+++ b/src/mod/languages/mod_managed/mod_managed.2017.vcxproj
@@ -1,347 +1,347 @@
-
-
-  
-    
-      Debug_CLR
-      Win32
-    
-    
-      Debug_CLR
-      x64
-    
-    
-      Debug_Mono
-      Win32
-    
-    
-      Debug_Mono
-      x64
-    
-    
-      Release_CLR
-      Win32
-    
-    
-      Release_CLR
-      x64
-    
-    
-      Release_Mono
-      Win32
-    
-    
-      Release_Mono
-      x64
-    
-  
-  
-    {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}
-    mod_managed
-    Win32Proj
-    mod_managed
-  
-  
-  
-    DynamicLibrary
-    Unicode
-    false
-    true
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    false
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    true
-    true
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    true
-    v140
-  
-  
-    DynamicLibrary
-    Unicode
-    false
-    true
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    false
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    true
-    true
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    true
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-    true
-    false
-    false
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-    true
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-    true
-    $(SolutionDir)$(PlatformName)\Release\mod\
-    false
-    $(SolutionDir)$(PlatformName)\Release\mod\
-    false
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-    $(SolutionDir)$(PlatformName)\Release\mod\
-    $(SolutionDir)$(PlatformName)\Release\mod\
-    $(SolutionDir)$(PlatformName)\Debug\mod\
-  
-  
-    
-      false
-      Default
-      MultiThreadedDebugDLL
-      
-      
-      4505;%(DisableSpecificWarnings)
-      true
-    
-    
-      shlwapi.lib;mscoree.lib;%(AdditionalDependencies)
-      
-      
-      false
-      true
-      /ignore:4248 %(AdditionalOptions)
-    
-  
-  
-    
-      X64
-    
-    
-      false
-      Default
-      MultiThreadedDebugDLL
-      
-      
-      true
-      4505;%(DisableSpecificWarnings)
-    
-    
-      shlwapi.lib;mscoree.lib;%(AdditionalDependencies)
-      
-      
-      true
-      false
-      MachineX64
-      /ignore:4248 %(AdditionalOptions)
-    
-  
-  
-    
-      MultiThreadedDLL
-      true
-      
-      
-      4505;%(DisableSpecificWarnings)
-      true
-    
-    
-      
-      
-      true
-      true
-      /ignore:4248 %(AdditionalOptions)
-    
-  
-  
-    
-      X64
-    
-    
-      true
-      MultiThreadedDLL
-      true
-      
-      
-      4505;%(DisableSpecificWarnings)
-    
-    
-      
-      
-      true
-      true
-      MachineX64
-      /ignore:4248 %(AdditionalOptions)
-    
-  
-  
-    
-      C:\Program Files\Mono\lib\glib-2.0\include;C:\Program Files\Mono\include\glib-2.0;C:\Program Files\Mono\include\mono-1.0;%(AdditionalIncludeDirectories)
-      false
-      Default
-      MultiThreadedDebugDLL
-      
-      
-      true
-      4505;%(DisableSpecificWarnings)
-    
-    
-      shlwapi.lib;mono.lib;C:\program Files\Mono\lib\glib-2.0.lib;%(AdditionalDependencies)
-      
-      
-      
-      
-      false
-      /ignore:4248 %(AdditionalOptions)
-    
-  
-  
-    
-      X64
-    
-    
-      C:\Program Files\Mono\lib\glib-2.0\include;C:\Program Files\Mono\include\glib-2.0;C:\Program Files\Mono\include\mono-1.0;%(AdditionalIncludeDirectories)
-      false
-      Default
-      MultiThreadedDebugDLL
-      
-      
-      true
-      4505;%(DisableSpecificWarnings)
-    
-    
-      shlwapi.lib;mono.lib;C:\program Files\Mono\lib\glib-2.0.lib;%(AdditionalDependencies)
-      
-      
-      
-      
-      false
-      MachineX64
-      /ignore:4248 %(AdditionalOptions)
-    
-  
-  
-    
-      true
-      ..\..\..\..\libs\apr\include;%(AdditionalIncludeDirectories)
-      MultiThreadedDLL
-      true
-      
-      
-      Level3
-      4505;%(DisableSpecificWarnings)
-    
-    
-      
-      
-      true
-      true
-      /ignore:4248 %(AdditionalOptions)
-    
-  
-  
-    
-      X64
-    
-    
-      true
-      ..\..\..\..\libs\apr\include;%(AdditionalIncludeDirectories)
-      MultiThreadedDLL
-      true
-      
-      
-      Level3
-      4505;%(DisableSpecificWarnings)
-    
-    
-      
-      
-      true
-      true
-      MachineX64
-      /ignore:4248 %(AdditionalOptions)
-    
-  
-  
-    
-    
-      4505;4244;%(DisableSpecificWarnings)
-      4505;4244;%(DisableSpecificWarnings)
-      4505;4244;%(DisableSpecificWarnings)
-      4505;4244;%(DisableSpecificWarnings)
-    
-    
-  
-  
-    
-  
-  
-    
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-    
-    
-      {834e2b2f-5483-4b80-8fe3-fe48ff76e5c0}
-    
-  
-  
-  
-  
-
+
+
+  
+    
+      Debug_CLR
+      Win32
+    
+    
+      Debug_CLR
+      x64
+    
+    
+      Debug_Mono
+      Win32
+    
+    
+      Debug_Mono
+      x64
+    
+    
+      Release_CLR
+      Win32
+    
+    
+      Release_CLR
+      x64
+    
+    
+      Release_Mono
+      Win32
+    
+    
+      Release_Mono
+      x64
+    
+  
+  
+    {7B42BDA1-72C0-4378-A9B6-5C530F8CD61E}
+    mod_managed
+    Win32Proj
+    mod_managed
+  
+  
+  
+    DynamicLibrary
+    Unicode
+    false
+    true
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    false
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    true
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    v141
+  
+  
+    DynamicLibrary
+    Unicode
+    false
+    true
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    false
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    true
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    true
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+    true
+    false
+    false
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+    true
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+    true
+    $(SolutionDir)$(PlatformName)\Release\mod\
+    false
+    $(SolutionDir)$(PlatformName)\Release\mod\
+    false
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+    $(SolutionDir)$(PlatformName)\Release\mod\
+    $(SolutionDir)$(PlatformName)\Release\mod\
+    $(SolutionDir)$(PlatformName)\Debug\mod\
+  
+  
+    
+      false
+      Default
+      MultiThreadedDebugDLL
+      
+      
+      4505;%(DisableSpecificWarnings)
+      true
+    
+    
+      shlwapi.lib;mscoree.lib;%(AdditionalDependencies)
+      
+      
+      false
+      true
+      /ignore:4248 %(AdditionalOptions)
+    
+  
+  
+    
+      X64
+    
+    
+      false
+      Default
+      MultiThreadedDebugDLL
+      
+      
+      true
+      4505;%(DisableSpecificWarnings)
+    
+    
+      shlwapi.lib;mscoree.lib;%(AdditionalDependencies)
+      
+      
+      true
+      false
+      MachineX64
+      /ignore:4248 %(AdditionalOptions)
+    
+  
+  
+    
+      MultiThreadedDLL
+      true
+      
+      
+      4505;%(DisableSpecificWarnings)
+      true
+    
+    
+      
+      
+      true
+      true
+      /ignore:4248 %(AdditionalOptions)
+    
+  
+  
+    
+      X64
+    
+    
+      true
+      MultiThreadedDLL
+      true
+      
+      
+      4505;%(DisableSpecificWarnings)
+    
+    
+      
+      
+      true
+      true
+      MachineX64
+      /ignore:4248 %(AdditionalOptions)
+    
+  
+  
+    
+      C:\Program Files\Mono\lib\glib-2.0\include;C:\Program Files\Mono\include\glib-2.0;C:\Program Files\Mono\include\mono-1.0;%(AdditionalIncludeDirectories)
+      false
+      Default
+      MultiThreadedDebugDLL
+      
+      
+      true
+      4505;%(DisableSpecificWarnings)
+    
+    
+      shlwapi.lib;mono.lib;C:\program Files\Mono\lib\glib-2.0.lib;%(AdditionalDependencies)
+      
+      
+      
+      
+      false
+      /ignore:4248 %(AdditionalOptions)
+    
+  
+  
+    
+      X64
+    
+    
+      C:\Program Files\Mono\lib\glib-2.0\include;C:\Program Files\Mono\include\glib-2.0;C:\Program Files\Mono\include\mono-1.0;%(AdditionalIncludeDirectories)
+      false
+      Default
+      MultiThreadedDebugDLL
+      
+      
+      true
+      4505;%(DisableSpecificWarnings)
+    
+    
+      shlwapi.lib;mono.lib;C:\program Files\Mono\lib\glib-2.0.lib;%(AdditionalDependencies)
+      
+      
+      
+      
+      false
+      MachineX64
+      /ignore:4248 %(AdditionalOptions)
+    
+  
+  
+    
+      true
+      ..\..\..\..\libs\apr\include;%(AdditionalIncludeDirectories)
+      MultiThreadedDLL
+      true
+      
+      
+      Level3
+      4505;%(DisableSpecificWarnings)
+    
+    
+      
+      
+      true
+      true
+      /ignore:4248 %(AdditionalOptions)
+    
+  
+  
+    
+      X64
+    
+    
+      true
+      ..\..\..\..\libs\apr\include;%(AdditionalIncludeDirectories)
+      MultiThreadedDLL
+      true
+      
+      
+      Level3
+      4505;%(DisableSpecificWarnings)
+    
+    
+      
+      
+      true
+      true
+      MachineX64
+      /ignore:4248 %(AdditionalOptions)
+    
+  
+  
+    
+    
+      4505;4244;%(DisableSpecificWarnings)
+      4505;4244;%(DisableSpecificWarnings)
+      4505;4244;%(DisableSpecificWarnings)
+      4505;4244;%(DisableSpecificWarnings)
+    
+    
+  
+  
+    
+  
+  
+    
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+    
+    
+      {834e2b2f-5483-4b80-8fe3-fe48ff76e5c0}
+    
+  
+  
+  
+  
+
\ No newline at end of file
diff --git a/src/mod/languages/mod_v8/mod_v8.2015.vcxproj b/src/mod/languages/mod_v8/mod_v8.2017.vcxproj
similarity index 95%
rename from src/mod/languages/mod_v8/mod_v8.2015.vcxproj
rename to src/mod/languages/mod_v8/mod_v8.2017.vcxproj
index 1c25a1b01c..41bfc12205 100644
--- a/src/mod/languages/mod_v8/mod_v8.2015.vcxproj
+++ b/src/mod/languages/mod_v8/mod_v8.2017.vcxproj
@@ -1,221 +1,221 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_v8
-    {9B9D2551-D6BD-4F20-8BE5-DE30E154A064}
-    mod_v8
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      4100;%(DisableSpecificWarnings)
-    
-  
-  
-    
-      Disabled
-      %(PreprocessorDefinitions)
-      
-      
-      false
-      false
-    
-    
-      $(Platform)\$(Configuration)\$(ProjectName).lib
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      %(PreprocessorDefinitions)
-      
-      
-      false
-      false
-    
-    
-      $(Platform)\$(Configuration)\$(ProjectName).lib
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      %(PreprocessorDefinitions)
-      
-      
-      false
-      false
-    
-    
-      $(Platform)\$(Configuration)\$(ProjectName).lib
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      %(PreprocessorDefinitions)
-      
-      
-      false
-      false
-    
-    
-      $(Platform)\$(Configuration)\$(ProjectName).lib
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {89385c74-5860-4174-9caf-a39e7c48909c}
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_v8
+    {9B9D2551-D6BD-4F20-8BE5-DE30E154A064}
+    mod_v8
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      4100;%(DisableSpecificWarnings)
+    
+  
+  
+    
+      Disabled
+      %(PreprocessorDefinitions)
+      
+      
+      false
+      false
+    
+    
+      $(Platform)\$(Configuration)\$(ProjectName).lib
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      %(PreprocessorDefinitions)
+      
+      
+      false
+      false
+    
+    
+      $(Platform)\$(Configuration)\$(ProjectName).lib
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      %(PreprocessorDefinitions)
+      
+      
+      false
+      false
+    
+    
+      $(Platform)\$(Configuration)\$(ProjectName).lib
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      %(PreprocessorDefinitions)
+      
+      
+      false
+      false
+    
+    
+      $(Platform)\$(Configuration)\$(ProjectName).lib
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {89385c74-5860-4174-9caf-a39e7c48909c}
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/languages/mod_v8/mod_v8_skel.2015.vcxproj b/src/mod/languages/mod_v8/mod_v8_skel.2017.vcxproj
similarity index 94%
rename from src/mod/languages/mod_v8/mod_v8_skel.2015.vcxproj
rename to src/mod/languages/mod_v8/mod_v8_skel.2017.vcxproj
index 6231095ec7..12e688d759 100644
--- a/src/mod/languages/mod_v8/mod_v8_skel.2015.vcxproj
+++ b/src/mod/languages/mod_v8/mod_v8_skel.2017.vcxproj
@@ -1,200 +1,200 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_v8_skel
-    {8B754330-A434-4791-97E5-1EE67060BAC0}
-    mod_v8_skel
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(PlatformName)\$(Configuration)\mod_v8_skel\
-    $(PlatformName)\$(Configuration)\mod_v8_skel\
-    $(PlatformName)\$(Configuration)\mod_v8_skel\
-    $(PlatformName)\$(Configuration)\mod_v8_skel\
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      
-      
-    
-    
-      JSMOD_IMPORT;%(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      
-      
-      false
-      false
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      
-      
-    
-    
-      X64
-    
-    
-      JSMOD_IMPORT;%(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      
-      
-      false
-      false
-    
-    
-      $(SolutionDir)$(Platform)\$(Configuration)/mod/$(ProjectName).dll
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      JSMOD_IMPORT;%(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      
-      
-      false
-      false
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      
-      
-    
-    
-      X64
-    
-    
-      JSMOD_IMPORT;%(PreprocessorDefinitions)
-      %(AdditionalIncludeDirectories)
-      
-      
-      false
-      false
-    
-    
-      $(SolutionDir)$(Platform)\$(Configuration)/mod/$(ProjectName).dll
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-    
-      {9B9D2551-D6BD-4F20-8BE5-DE30E154A064}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_v8_skel
+    {8B754330-A434-4791-97E5-1EE67060BAC0}
+    mod_v8_skel
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(PlatformName)\$(Configuration)\mod_v8_skel\
+    $(PlatformName)\$(Configuration)\mod_v8_skel\
+    $(PlatformName)\$(Configuration)\mod_v8_skel\
+    $(PlatformName)\$(Configuration)\mod_v8_skel\
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      
+      
+    
+    
+      JSMOD_IMPORT;%(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      
+      
+      false
+      false
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      
+      
+    
+    
+      X64
+    
+    
+      JSMOD_IMPORT;%(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      
+      
+      false
+      false
+    
+    
+      $(SolutionDir)$(Platform)\$(Configuration)/mod/$(ProjectName).dll
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      JSMOD_IMPORT;%(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      
+      
+      false
+      false
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      
+      
+    
+    
+      X64
+    
+    
+      JSMOD_IMPORT;%(PreprocessorDefinitions)
+      %(AdditionalIncludeDirectories)
+      
+      
+      false
+      false
+    
+    
+      $(SolutionDir)$(Platform)\$(Configuration)/mod/$(ProjectName).dll
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+    
+      {9B9D2551-D6BD-4F20-8BE5-DE30E154A064}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/loggers/mod_console/mod_console.2015.vcxproj b/src/mod/loggers/mod_console/mod_console.2017.vcxproj
similarity index 93%
rename from src/mod/loggers/mod_console/mod_console.2015.vcxproj
rename to src/mod/loggers/mod_console/mod_console.2017.vcxproj
index 8d526539e5..4fc33eee1f 100644
--- a/src/mod/loggers/mod_console/mod_console.2015.vcxproj
+++ b/src/mod/loggers/mod_console/mod_console.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_console
-    {1C453396-D912-4213-89FD-9B489162B7B5}
-    mod_console
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_console
+    {1C453396-D912-4213-89FD-9B489162B7B5}
+    mod_console
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/loggers/mod_logfile/mod_logfile.2015.vcxproj b/src/mod/loggers/mod_logfile/mod_logfile.2017.vcxproj
similarity index 93%
rename from src/mod/loggers/mod_logfile/mod_logfile.2015.vcxproj
rename to src/mod/loggers/mod_logfile/mod_logfile.2017.vcxproj
index d964c2f453..42b36579eb 100644
--- a/src/mod/loggers/mod_logfile/mod_logfile.2015.vcxproj
+++ b/src/mod/loggers/mod_logfile/mod_logfile.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_logfile
-    {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}
-    mod_logfile
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      6297;4334;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      6297;4334;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      6297;4334;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      6297;4334;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_logfile
+    {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}
+    mod_logfile
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      6297;4334;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      6297;4334;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      6297;4334;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      6297;4334;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/say/mod_say_de/mod_say_de.2015.vcxproj b/src/mod/say/mod_say_de/mod_say_de.2017.vcxproj
similarity index 93%
rename from src/mod/say/mod_say_de/mod_say_de.2015.vcxproj
rename to src/mod/say/mod_say_de/mod_say_de.2017.vcxproj
index 91f9c77a7e..93c59fea8d 100644
--- a/src/mod/say/mod_say_de/mod_say_de.2015.vcxproj
+++ b/src/mod/say/mod_say_de/mod_say_de.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_say_de
-    {5BC072DB-3826-48EA-AF34-FE32AA01E83B}
-    mod_say_de
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_say_de
+    {5BC072DB-3826-48EA-AF34-FE32AA01E83B}
+    mod_say_de
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/say/mod_say_en/mod_say_en.2015.vcxproj b/src/mod/say/mod_say_en/mod_say_en.2017.vcxproj
similarity index 93%
rename from src/mod/say/mod_say_en/mod_say_en.2015.vcxproj
rename to src/mod/say/mod_say_en/mod_say_en.2017.vcxproj
index 25c4a37450..4f636b0b75 100644
--- a/src/mod/say/mod_say_en/mod_say_en.2015.vcxproj
+++ b/src/mod/say/mod_say_en/mod_say_en.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_say_en
-    {988CACF7-3FCB-4992-BE69-77872AE67DC8}
-    mod_say_en
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_say_en
+    {988CACF7-3FCB-4992-BE69-77872AE67DC8}
+    mod_say_en
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/say/mod_say_es/mod_say_es.2015.vcxproj b/src/mod/say/mod_say_es/mod_say_es.2017.vcxproj
similarity index 93%
rename from src/mod/say/mod_say_es/mod_say_es.2015.vcxproj
rename to src/mod/say/mod_say_es/mod_say_es.2017.vcxproj
index ac4feae1a4..ebb5f9f985 100644
--- a/src/mod/say/mod_say_es/mod_say_es.2015.vcxproj
+++ b/src/mod/say/mod_say_es/mod_say_es.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_say_es
-    {FA429E98-8B03-45E6-A096-A4BC5E821DE4}
-    mod_say_es
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_say_es
+    {FA429E98-8B03-45E6-A096-A4BC5E821DE4}
+    mod_say_es
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/say/mod_say_es_ar/mod_say_es_ar.2015.vcxproj b/src/mod/say/mod_say_es_ar/mod_say_es_ar.2017.vcxproj
similarity index 95%
rename from src/mod/say/mod_say_es_ar/mod_say_es_ar.2015.vcxproj
rename to src/mod/say/mod_say_es_ar/mod_say_es_ar.2017.vcxproj
index 0283041c41..4ac9b746a4 100644
--- a/src/mod/say/mod_say_es_ar/mod_say_es_ar.2015.vcxproj
+++ b/src/mod/say/mod_say_es_ar/mod_say_es_ar.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -124,7 +124,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
@@ -132,4 +132,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/src/mod/say/mod_say_fa/mod_say_fa.2015.vcxproj b/src/mod/say/mod_say_fa/mod_say_fa.2017.vcxproj
similarity index 95%
rename from src/mod/say/mod_say_fa/mod_say_fa.2015.vcxproj
rename to src/mod/say/mod_say_fa/mod_say_fa.2017.vcxproj
index 87e115b18d..b58348ffd7 100644
--- a/src/mod/say/mod_say_fa/mod_say_fa.2015.vcxproj
+++ b/src/mod/say/mod_say_fa/mod_say_fa.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -124,7 +124,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
@@ -132,4 +132,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/src/mod/say/mod_say_fr/mod_say_fr.2015.vcxproj b/src/mod/say/mod_say_fr/mod_say_fr.2017.vcxproj
similarity index 93%
rename from src/mod/say/mod_say_fr/mod_say_fr.2015.vcxproj
rename to src/mod/say/mod_say_fr/mod_say_fr.2017.vcxproj
index bba8e4434c..76d63f77ed 100644
--- a/src/mod/say/mod_say_fr/mod_say_fr.2015.vcxproj
+++ b/src/mod/say/mod_say_fr/mod_say_fr.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_say_fr
-    {06E3A538-AB32-44F2-B477-755FF9CB5D37}
-    mod_say_fr
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_say_fr
+    {06E3A538-AB32-44F2-B477-755FF9CB5D37}
+    mod_say_fr
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/say/mod_say_he/mod_say_he.2015.vcxproj b/src/mod/say/mod_say_he/mod_say_he.2017.vcxproj
similarity index 95%
rename from src/mod/say/mod_say_he/mod_say_he.2015.vcxproj
rename to src/mod/say/mod_say_he/mod_say_he.2017.vcxproj
index c2ddbf6024..9aa46f4c80 100644
--- a/src/mod/say/mod_say_he/mod_say_he.2015.vcxproj
+++ b/src/mod/say/mod_say_he/mod_say_he.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -124,7 +124,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
@@ -132,4 +132,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/src/mod/say/mod_say_hr/mod_say_hr.2015.vcxproj b/src/mod/say/mod_say_hr/mod_say_hr.2017.vcxproj
similarity index 95%
rename from src/mod/say/mod_say_hr/mod_say_hr.2015.vcxproj
rename to src/mod/say/mod_say_hr/mod_say_hr.2017.vcxproj
index 5b4325c085..c3c18b8eea 100644
--- a/src/mod/say/mod_say_hr/mod_say_hr.2015.vcxproj
+++ b/src/mod/say/mod_say_hr/mod_say_hr.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -124,7 +124,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
@@ -132,4 +132,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/src/mod/say/mod_say_hu/mod_say_hu.2015.vcxproj b/src/mod/say/mod_say_hu/mod_say_hu.2017.vcxproj
similarity index 95%
rename from src/mod/say/mod_say_hu/mod_say_hu.2015.vcxproj
rename to src/mod/say/mod_say_hu/mod_say_hu.2017.vcxproj
index 839c0c9328..2b18607bdf 100644
--- a/src/mod/say/mod_say_hu/mod_say_hu.2015.vcxproj
+++ b/src/mod/say/mod_say_hu/mod_say_hu.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -124,7 +124,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
@@ -132,4 +132,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/src/mod/say/mod_say_it/mod_say_it.2015.vcxproj b/src/mod/say/mod_say_it/mod_say_it.2017.vcxproj
similarity index 93%
rename from src/mod/say/mod_say_it/mod_say_it.2015.vcxproj
rename to src/mod/say/mod_say_it/mod_say_it.2017.vcxproj
index 06e5757bfe..e5cf724471 100644
--- a/src/mod/say/mod_say_it/mod_say_it.2015.vcxproj
+++ b/src/mod/say/mod_say_it/mod_say_it.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_say_it
-    {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}
-    mod_say_it
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_say_it
+    {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}
+    mod_say_it
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/say/mod_say_ja/mod_say_ja.2015.vcxproj b/src/mod/say/mod_say_ja/mod_say_ja.2017.vcxproj
similarity index 95%
rename from src/mod/say/mod_say_ja/mod_say_ja.2015.vcxproj
rename to src/mod/say/mod_say_ja/mod_say_ja.2017.vcxproj
index 97416be382..13d4cc477c 100644
--- a/src/mod/say/mod_say_ja/mod_say_ja.2015.vcxproj
+++ b/src/mod/say/mod_say_ja/mod_say_ja.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -124,7 +124,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
@@ -132,4 +132,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/src/mod/say/mod_say_nl/mod_say_nl.2015.vcxproj b/src/mod/say/mod_say_nl/mod_say_nl.2017.vcxproj
similarity index 94%
rename from src/mod/say/mod_say_nl/mod_say_nl.2015.vcxproj
rename to src/mod/say/mod_say_nl/mod_say_nl.2017.vcxproj
index acede2dac1..efda79f892 100644
--- a/src/mod/say/mod_say_nl/mod_say_nl.2015.vcxproj
+++ b/src/mod/say/mod_say_nl/mod_say_nl.2017.vcxproj
@@ -1,147 +1,147 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_say_nl
-    {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}
-    mod_say_nl
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      Disabled
-      %(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_say_nl
+    {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}
+    mod_say_nl
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      Disabled
+      %(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_EXPORTS;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/say/mod_say_pl/mod_say_pl.2015.vcxproj b/src/mod/say/mod_say_pl/mod_say_pl.2017.vcxproj
similarity index 95%
rename from src/mod/say/mod_say_pl/mod_say_pl.2015.vcxproj
rename to src/mod/say/mod_say_pl/mod_say_pl.2017.vcxproj
index 9b640e3857..cb11215d7d 100644
--- a/src/mod/say/mod_say_pl/mod_say_pl.2015.vcxproj
+++ b/src/mod/say/mod_say_pl/mod_say_pl.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -124,7 +124,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
@@ -132,4 +132,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/src/mod/say/mod_say_pt/mod_say_pt.2015.vcxproj b/src/mod/say/mod_say_pt/mod_say_pt.2017.vcxproj
similarity index 93%
rename from src/mod/say/mod_say_pt/mod_say_pt.2015.vcxproj
rename to src/mod/say/mod_say_pt/mod_say_pt.2017.vcxproj
index f2eab83bf4..6a145e325c 100644
--- a/src/mod/say/mod_say_pt/mod_say_pt.2015.vcxproj
+++ b/src/mod/say/mod_say_pt/mod_say_pt.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_say_pt
-    {7C22BDFF-CC09-400C-8A09-660733980028}
-    mod_say_pt
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_say_pt
+    {7C22BDFF-CC09-400C-8A09-660733980028}
+    mod_say_pt
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/say/mod_say_ru/mod_say_ru.2015.vcxproj b/src/mod/say/mod_say_ru/mod_say_ru.2017.vcxproj
similarity index 93%
rename from src/mod/say/mod_say_ru/mod_say_ru.2015.vcxproj
rename to src/mod/say/mod_say_ru/mod_say_ru.2017.vcxproj
index a9e4229b90..24ebc96775 100644
--- a/src/mod/say/mod_say_ru/mod_say_ru.2015.vcxproj
+++ b/src/mod/say/mod_say_ru/mod_say_ru.2017.vcxproj
@@ -1,135 +1,135 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_say_ru
-    {0382E8FD-CFDC-41C0-8B03-792C7C84FC31}
-    mod_say_ru
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_say_ru
+    {0382E8FD-CFDC-41C0-8B03-792C7C84FC31}
+    mod_say_ru
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/say/mod_say_sv/mod_say_sv.2015.vcxproj b/src/mod/say/mod_say_sv/mod_say_sv.2017.vcxproj
similarity index 93%
rename from src/mod/say/mod_say_sv/mod_say_sv.2015.vcxproj
rename to src/mod/say/mod_say_sv/mod_say_sv.2017.vcxproj
index 10210ec949..c75fe28736 100644
--- a/src/mod/say/mod_say_sv/mod_say_sv.2015.vcxproj
+++ b/src/mod/say/mod_say_sv/mod_say_sv.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_say_sv
-    {8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}
-    mod_say_sv
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_say_sv
+    {8CDA2B34-FA44-49CC-9EC2-B8F35856CD15}
+    mod_say_sv
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/say/mod_say_th/mod_say_th.2015.vcxproj b/src/mod/say/mod_say_th/mod_say_th.2017.vcxproj
similarity index 95%
rename from src/mod/say/mod_say_th/mod_say_th.2015.vcxproj
rename to src/mod/say/mod_say_th/mod_say_th.2017.vcxproj
index 1de59de2c5..524c59768a 100644
--- a/src/mod/say/mod_say_th/mod_say_th.2015.vcxproj
+++ b/src/mod/say/mod_say_th/mod_say_th.2017.vcxproj
@@ -1,5 +1,5 @@
 
-
+
   
     
       Debug
@@ -28,22 +28,22 @@
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
     DynamicLibrary
     MultiByte
-    v140
+    v141
   
   
   
@@ -124,7 +124,7 @@
     
   
   
-    
+    
       {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
       false
     
@@ -132,4 +132,4 @@
   
   
   
-
+
\ No newline at end of file
diff --git a/src/mod/say/mod_say_zh/mod_say_zh.2015.vcxproj b/src/mod/say/mod_say_zh/mod_say_zh.2017.vcxproj
similarity index 93%
rename from src/mod/say/mod_say_zh/mod_say_zh.2015.vcxproj
rename to src/mod/say/mod_say_zh/mod_say_zh.2017.vcxproj
index 25d0e192a7..e7cff7a69c 100644
--- a/src/mod/say/mod_say_zh/mod_say_zh.2015.vcxproj
+++ b/src/mod/say/mod_say_zh/mod_say_zh.2017.vcxproj
@@ -1,139 +1,139 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_say_zh
-    {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}
-    mod_say_zh
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_say_zh
+    {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}
+    mod_say_zh
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.2015.vcxproj b/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.2017.vcxproj
similarity index 93%
rename from src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.2015.vcxproj
rename to src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.2017.vcxproj
index 6f3796937a..778449bfdd 100644
--- a/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.2015.vcxproj
+++ b/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.2017.vcxproj
@@ -1,142 +1,142 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_xml_cdr
-    {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}
-    mod_xml_cdr
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_xml_cdr
+    {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}
+    mod_xml_cdr
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.2015.vcxproj b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.2017.vcxproj
similarity index 92%
rename from src/mod/xml_int/mod_xml_curl/mod_xml_curl.2015.vcxproj
rename to src/mod/xml_int/mod_xml_curl/mod_xml_curl.2017.vcxproj
index d3bdcbde51..8f42fc6ed5 100644
--- a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.2015.vcxproj
+++ b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.2017.vcxproj
@@ -1,141 +1,141 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_xml_curl
-    {AB91A099-7690-4ECF-8994-E458F4EA1ED4}
-    mod_xml_curl
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    
-      
-      
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      
-      
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      
-      
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_xml_curl
+    {AB91A099-7690-4ECF-8994-E458F4EA1ED4}
+    mod_xml_curl
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    
+      
+      
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      
+      
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      
+      
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.2015.vcxproj b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.2017.vcxproj
similarity index 94%
rename from src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.2015.vcxproj
rename to src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.2017.vcxproj
index ce8e71c011..f9283c9fe9 100644
--- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.2015.vcxproj
+++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.2017.vcxproj
@@ -1,188 +1,188 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    mod_xml_rpc
-    {CBEC7225-0C21-4DA8-978E-1F158F8AD950}
-    mod_xml_rpc
-    Win32Proj
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    NativeMinimumRules.ruleset
-    false
-  
-  
-    
-      $(SolutionDir)libs\xmlrpc-c\include;$(SolutionDir)libs\xmlrpc-c\lib\abyss\src;$(SolutionDir)libs\xmlrpc-c\lib\util\include;%(AdditionalIncludeDirectories)
-      ABYSS_WIN32;%(PreprocessorDefinitions)
-      
-      
-      4090;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      ..\..\..\..\libs\xmlrpc\lib;..\..\..\..\libs\xmlrpc\lib\abyss\src\$(OutDir);..\..\..\..\libs\apr-util\xml\expat\lib\LibD;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      $(SolutionDir)libs\xmlrpc-c\include;$(SolutionDir)libs\xmlrpc-c\lib\abyss\src;$(SolutionDir)libs\xmlrpc-c\lib\util\include;%(AdditionalIncludeDirectories)
-      ABYSS_WIN32;%(PreprocessorDefinitions)
-      
-      
-      4090;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-      $(SolutionDir)libs\xmlrpc-c\include;$(SolutionDir)libs\xmlrpc-c\lib\abyss\src;$(SolutionDir)libs\xmlrpc-c\lib\util\include;%(AdditionalIncludeDirectories)
-      ABYSS_WIN32;%(PreprocessorDefinitions)
-      
-      
-      4090;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      ..\..\..\..\libs\xmlrpc\lib;..\..\..\..\libs\xmlrpc\lib\abyss\src\$(OutDir);..\..\..\..\libs\apr-util\xml\expat\lib\LibR;%(AdditionalLibraryDirectories)
-      false
-      
-      
-    
-  
-  
-    
-      X64
-    
-    
-      $(SolutionDir)libs\xmlrpc-c\include;$(SolutionDir)libs\xmlrpc-c\lib\abyss\src;$(SolutionDir)libs\xmlrpc-c\lib\util\include;%(AdditionalIncludeDirectories)
-      ABYSS_WIN32;%(PreprocessorDefinitions)
-      
-      
-      4090;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
-      false
-    
-    
-      %(AdditionalLibraryDirectories)
-      false
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-  
-  
-    
-      {d2396dd7-7d38-473a-abb7-6f96d65ae1b9}
-    
-    
-      {0d108721-eae8-4baf-8102-d8960ec93647}
-    
-    
-      {cee544a9-0303-44c2-8ece-efa7d7bcbbba}
-    
-    
-      {b535402e-38d2-4d54-8360-423acbd17192}
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    mod_xml_rpc
+    {CBEC7225-0C21-4DA8-978E-1F158F8AD950}
+    mod_xml_rpc
+    Win32Proj
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    NativeMinimumRules.ruleset
+    false
+  
+  
+    
+      $(SolutionDir)libs\xmlrpc-c\include;$(SolutionDir)libs\xmlrpc-c\lib\abyss\src;$(SolutionDir)libs\xmlrpc-c\lib\util\include;%(AdditionalIncludeDirectories)
+      ABYSS_WIN32;%(PreprocessorDefinitions)
+      
+      
+      4090;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      ..\..\..\..\libs\xmlrpc\lib;..\..\..\..\libs\xmlrpc\lib\abyss\src\$(OutDir);..\..\..\..\libs\apr-util\xml\expat\lib\LibD;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      $(SolutionDir)libs\xmlrpc-c\include;$(SolutionDir)libs\xmlrpc-c\lib\abyss\src;$(SolutionDir)libs\xmlrpc-c\lib\util\include;%(AdditionalIncludeDirectories)
+      ABYSS_WIN32;%(PreprocessorDefinitions)
+      
+      
+      4090;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+      $(SolutionDir)libs\xmlrpc-c\include;$(SolutionDir)libs\xmlrpc-c\lib\abyss\src;$(SolutionDir)libs\xmlrpc-c\lib\util\include;%(AdditionalIncludeDirectories)
+      ABYSS_WIN32;%(PreprocessorDefinitions)
+      
+      
+      4090;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      ..\..\..\..\libs\xmlrpc\lib;..\..\..\..\libs\xmlrpc\lib\abyss\src\$(OutDir);..\..\..\..\libs\apr-util\xml\expat\lib\LibR;%(AdditionalLibraryDirectories)
+      false
+      
+      
+    
+  
+  
+    
+      X64
+    
+    
+      $(SolutionDir)libs\xmlrpc-c\include;$(SolutionDir)libs\xmlrpc-c\lib\abyss\src;$(SolutionDir)libs\xmlrpc-c\lib\util\include;%(AdditionalIncludeDirectories)
+      ABYSS_WIN32;%(PreprocessorDefinitions)
+      
+      
+      4090;4306;6340;6246;6011;6387;%(DisableSpecificWarnings)
+      false
+    
+    
+      %(AdditionalLibraryDirectories)
+      false
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+  
+  
+    
+      {d2396dd7-7d38-473a-abb7-6f96d65ae1b9}
+    
+    
+      {0d108721-eae8-4baf-8102-d8960ec93647}
+    
+    
+      {cee544a9-0303-44c2-8ece-efa7d7bcbbba}
+    
+    
+      {b535402e-38d2-4d54-8360-423acbd17192}
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/w32/Console/FreeSwitchConsole.2015.vcxproj b/w32/Console/FreeSwitchConsole.2017.vcxproj
similarity index 95%
rename from w32/Console/FreeSwitchConsole.2015.vcxproj
rename to w32/Console/FreeSwitchConsole.2017.vcxproj
index bcf861ab13..b1d105c08e 100644
--- a/w32/Console/FreeSwitchConsole.2015.vcxproj
+++ b/w32/Console/FreeSwitchConsole.2017.vcxproj
@@ -1,242 +1,242 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    FreeSwitchConsole
-    {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}
-    FreeSwitchConsole
-    Win32Proj
-  
-  
-  
-    Application
-    MultiByte
-    v140
-  
-  
-    Application
-    MultiByte
-    v140
-  
-  
-    Application
-    MultiByte
-    v140
-  
-  
-    Application
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    false
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    false
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    false
-    $(SolutionDir)$(Platform)\$(Configuration)\
-    $(Platform)\$(Configuration)\
-    false
-  
-  
-    
-    
-      Disabled
-      %(RootDir)%(Directory)include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;%(RootDir)%(Directory)..\libs\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      true
-      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      $(OutDir);%(AdditionalLibraryDirectories)
-      true
-      Console
-      true
-      
-      
-      MachineX86
-    
-  
-  
-    
-    
-      X64
-    
-    
-      Disabled
-      %(RootDir)%(Directory)include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;%(RootDir)%(Directory)..\libs\include;%(AdditionalIncludeDirectories)
-      WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      true
-      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      $(OutDir);%(AdditionalLibraryDirectories)
-      true
-      Console
-      true
-      
-      
-      MachineX64
-    
-  
-  
-    
-    
-      %(RootDir)%(Directory)include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;%(RootDir)%(Directory)..\libs\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      $(OutDir);%(AdditionalLibraryDirectories)
-      false
-      Console
-      true
-      true
-      true
-      
-      
-      MachineX86
-    
-  
-  
-    
-    
-      X64
-    
-    
-      %(RootDir)%(Directory)include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;%(RootDir)%(Directory)..\libs\include;%(AdditionalIncludeDirectories)
-      WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      $(OutDir);%(AdditionalLibraryDirectories)
-      false
-      Console
-      true
-      true
-      true
-      
-      
-      MachineX64
-    
-  
-  
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-    
-    
-      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
-      false
-    
-  
-  
-    
-      $(SolutionDir)\w32\Library
-      $(SolutionDir)\w32\Library
-      $(SolutionDir)\w32\Library
-      $(SolutionDir)\w32\Library
-      _DEBUG
-      
-      
-      _WIN64;_DEBUG
-      _WIN64
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    FreeSwitchConsole
+    {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}
+    FreeSwitchConsole
+    Win32Proj
+  
+  
+  
+    Application
+    MultiByte
+    v141
+  
+  
+    Application
+    MultiByte
+    v141
+  
+  
+    Application
+    MultiByte
+    v141
+  
+  
+    Application
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    false
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    false
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    false
+    $(SolutionDir)$(Platform)\$(Configuration)\
+    $(Platform)\$(Configuration)\
+    false
+  
+  
+    
+    
+      Disabled
+      %(RootDir)%(Directory)include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;%(RootDir)%(Directory)..\libs\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      true
+      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      $(OutDir);%(AdditionalLibraryDirectories)
+      true
+      Console
+      true
+      
+      
+      MachineX86
+    
+  
+  
+    
+    
+      X64
+    
+    
+      Disabled
+      %(RootDir)%(Directory)include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;%(RootDir)%(Directory)..\libs\include;%(AdditionalIncludeDirectories)
+      WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      true
+      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      $(OutDir);%(AdditionalLibraryDirectories)
+      true
+      Console
+      true
+      
+      
+      MachineX64
+    
+  
+  
+    
+    
+      %(RootDir)%(Directory)include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;%(RootDir)%(Directory)..\libs\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      $(OutDir);%(AdditionalLibraryDirectories)
+      false
+      Console
+      true
+      true
+      true
+      
+      
+      MachineX86
+    
+  
+  
+    
+    
+      X64
+    
+    
+      %(RootDir)%(Directory)include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;%(RootDir)%(Directory)..\libs\include;%(AdditionalIncludeDirectories)
+      WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      6031;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      $(OutDir);%(AdditionalLibraryDirectories)
+      false
+      Console
+      true
+      true
+      true
+      
+      
+      MachineX64
+    
+  
+  
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+    
+    
+      {202d7a4e-760d-4d0e-afa1-d7459ced30ff}
+      false
+    
+  
+  
+    
+      $(SolutionDir)\w32\Library
+      $(SolutionDir)\w32\Library
+      $(SolutionDir)\w32\Library
+      $(SolutionDir)\w32\Library
+      _DEBUG
+      
+      
+      _WIN64;_DEBUG
+      _WIN64
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/w32/Library/FreeSwitchCore.2015.vcxproj b/w32/Library/FreeSwitchCore.2017.vcxproj
similarity index 97%
rename from w32/Library/FreeSwitchCore.2015.vcxproj
rename to w32/Library/FreeSwitchCore.2017.vcxproj
index 901563788d..55e2c23754 100644
--- a/w32/Library/FreeSwitchCore.2015.vcxproj
+++ b/w32/Library/FreeSwitchCore.2017.vcxproj
@@ -1,923 +1,923 @@
-
-
-  
-    
-      Debug
-      Win32
-    
-    
-      Debug
-      x64
-    
-    
-      Release
-      Win32
-    
-    
-      Release
-      x64
-    
-  
-  
-    FreeSwitchCoreLib
-    {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
-    FreeSwitchCoreLib
-    Win32Proj
-    8.1
-  
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-    DynamicLibrary
-    MultiByte
-    v140
-  
-  
-  
-  
-  
-  
-  
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-    
-  
-  
-    
-  
-  
-  
-    <_ProjectFileVersion>10.0.30319.1
-    true
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    true
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    false
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    $(PlatformName)\$(Configuration)\
-    false
-    $(SolutionDir)$(PlatformName)\$(Configuration)\
-    FreeSwitch
-    FreeSwitch
-    FreeSwitch
-    FreeSwitch
-    $(PlatformName)\$(Configuration)\
-  
-  
-    AllRules.ruleset
-    false
-  
-  
-    AllRules.ruleset
-    false
-  
-  
-    AllRules.ruleset
-    false
-  
-  
-    AllRules.ruleset
-    false
-  
-  
-    
-      ..\..\libs\apr\include\arch\win32;%(AdditionalIncludeDirectories)
-    
-  
-  
-    
-    
-      
-      
-    
-    
-      Disabled
-      ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)
-      CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;ENABLE_ZRTP;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Create
-      switch.h
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      %(ForcedIncludeFiles)
-      false
-      Default
-      false
-      4706;4456;4457;4458;4459;4456;4703;4305;4306;4701;4996;4018;4389;4996;4267;4244;4127;4100;4232;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      true
-    
-    
-      rpcrt4.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\libs\apr\$(OutDir);$(ProjectDir)..\..\libs\sqlite\$(OutDir) DLL;$(ProjectDir)..\..\libs\apr-util\$(OutDir);$(ProjectDir)..\..\libs\apr-iconv\$(OutDir);$(ProjectDir)..\..\libs\libresample\win;$(ProjectDir)..\..\libs\srtp\$(OutDir);%(AdditionalLibraryDirectories)
-      %(AddModuleNamesToAssembly)
-      true
-      Windows
-      
-      
-      
-      
-      false
-      
-      
-      $(OutDir)FreeSwitchCore.lib
-      MachineX86
-      
-      
-    
-    
-      if not exist "$(OutDir)conf" xcopy "$(SolutionDir)conf\vanilla\*.*" "$(OutDir)conf\" /C /D /Y /S
-if not exist "$(OutDir)db" md  "$(OutDir)db"
-if not exist "$(OutDir)log" md  "$(OutDir)log"
-if not exist "$(OutDir)htdocs" md  "$(OutDir)htdocs"
-if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs\" /C /D /Y /S
-
-
-    
-    
-      $(SolutionDir)src\include
-    
-  
-  
-    
-    
-      
-      
-    
-    
-      X64
-    
-    
-      Disabled
-      ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)
-      CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;ENABLE_ZRTP;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)
-      true
-      EnableFastChecks
-      MultiThreadedDebugDLL
-      Create
-      switch.h
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      %(ForcedIncludeFiles)
-      false
-      false
-      4706;4456;4457;4458;4459;4456;4703;4305;4306;4701;4996;4018;4389;4996;4267;4244;4127;4100;4232;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      true
-    
-    
-      rpcrt4.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\libs\apr\$(OutDir);$(ProjectDir)..\..\libs\sqlite\$(OutDir) DLL;$(ProjectDir)..\..\libs\apr-util\$(OutDir);$(ProjectDir)..\..\libs\apr-iconv\$(OutDir);$(ProjectDir)..\..\libs\libresample\win;$(ProjectDir)..\..\libs\srtp\$(OutDir);%(AdditionalLibraryDirectories)
-      %(AddModuleNamesToAssembly)
-      true
-      Windows
-      
-      
-      
-      
-      false
-      
-      
-      $(OutDir)FreeSwitchCore.lib
-      MachineX64
-    
-    
-      if not exist "$(OutDir)conf" xcopy "$(SolutionDir)conf\vanilla\*.*" "$(OutDir)conf\" /C /D /Y /S
-if not exist "$(OutDir)db" md  "$(OutDir)db"
-if not exist "$(OutDir)log" md  "$(OutDir)log"
-if not exist "$(OutDir)htdocs" md  "$(OutDir)htdocs"
-if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs\" /C /D /Y /S
-
-
-    
-  
-  
-    
-    
-      
-      
-    
-    
-      MaxSpeed
-      ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)
-      CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;ENABLE_ZRTP;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Create
-      switch.h
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      false
-      false
-      4706;4456;4457;4458;4459;4456;4703;4305;4306;4701;4996;4018;4389;4996;4267;4244;4127;4100;4232;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      true
-    
-    
-      rpcrt4.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\libs\apr\$(OutDir);$(ProjectDir)..\..\libs\sqlite\$(OutDir) DLL;$(ProjectDir)..\..\libs\apr-util\$(OutDir);$(ProjectDir)..\..\libs\apr-iconv\$(OutDir);$(ProjectDir)..\..\libs\libresample\win;$(ProjectDir)..\..\libs\srtp\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      Windows
-      true
-      true
-      false
-      
-      
-      $(OutDir)FreeSwitchCore.lib
-      MachineX86
-    
-    
-      if not exist "$(OutDir)conf" xcopy "$(SolutionDir)conf\vanilla\*.*" "$(OutDir)conf\" /C /D /Y /S
-if not exist "$(OutDir)db" md  "$(OutDir)db"
-if not exist "$(OutDir)log" md  "$(OutDir)log"
-if not exist "$(OutDir)htdocs" md  "$(OutDir)htdocs"
-if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs\" /C /D /Y /S
-
-
-    
-  
-  
-    
-    
-      
-      
-    
-    
-      X64
-    
-    
-      MaxSpeed
-      ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)
-      CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;ENABLE_ZRTP;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)
-      MultiThreadedDLL
-      Create
-      switch.h
-      
-      
-      Level4
-      true
-      ProgramDatabase
-      false
-      false
-      4706;4456;4457;4458;4459;4456;4703;4305;4306;4701;4996;4018;4389;4996;4267;4244;4127;4100;4232;6340;6246;6011;6387;%(DisableSpecificWarnings)
-    
-    
-      true
-    
-    
-      rpcrt4.lib;%(AdditionalDependencies)
-      $(ProjectDir)..\..\libs\apr\$(OutDir);$(ProjectDir)..\..\libs\sqlite\$(OutDir) DLL;$(ProjectDir)..\..\libs\apr-util\$(OutDir);$(ProjectDir)..\..\libs\apr-iconv\$(OutDir);$(ProjectDir)..\..\libs\libresample\win;$(ProjectDir)..\..\libs\srtp\$(OutDir);%(AdditionalLibraryDirectories)
-      false
-      Windows
-      true
-      true
-      false
-      
-      
-      $(OutDir)FreeSwitchCore.lib
-      MachineX64
-    
-    
-      if not exist "$(OutDir)conf" xcopy "$(SolutionDir)conf\vanilla\*.*" "$(OutDir)conf\" /C /D /Y /S
-if not exist "$(OutDir)db" md  "$(OutDir)db"
-if not exist "$(OutDir)log" md  "$(OutDir)log"
-if not exist "$(OutDir)htdocs" md  "$(OutDir)htdocs"
-if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs\" /C /D /Y /S
-
-
-    
-  
-  
-    
-      NotUsing
-      false
-      NotUsing
-      false
-      NotUsing
-      false
-      NotUsing
-      false
-    
-    
-      NotUsing
-      false
-      NotUsing
-      false
-      NotUsing
-      false
-      NotUsing
-      false
-    
-    
-      
-      
-      
-      
-      
-      
-      
-      
-    
-    
-      
-      
-      
-      
-      
-      
-      
-      
-    
-    
-    
-    
-      Create
-      Create
-      Create
-      Create
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-      6385;%(DisableSpecificWarnings)
-      6385;%(DisableSpecificWarnings)
-    
-    
-    
-    
-    
-    
-      
-      
-      
-      
-      
-      
-      
-      
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-      
-      
-      
-      
-      
-      
-      
-      
-      28183;6387;%(DisableSpecificWarnings)
-      28183;6387;%(DisableSpecificWarnings)
-      28183;6387;%(DisableSpecificWarnings)
-      28183;6387;%(DisableSpecificWarnings)
-    
-    
-    
-    
-      NotUsing
-    
-    
-      NotUsing
-    
-    
-    
-    
-    
-    
-    
-    
-      4389;4127;%(DisableSpecificWarnings)
-      4389;4127;%(DisableSpecificWarnings)
-      4389;4127;%(DisableSpecificWarnings)
-      4389;4127;%(DisableSpecificWarnings)
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-    
-    
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-    
-    
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-    
-    
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;4389;4706;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;4389;4706;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;4389;4706;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;4389;4706;%(DisableSpecificWarnings)
-    
-    
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-    
-    
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-    
-    
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-    
-    
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-    
-    
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      
-      
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
-      
-      
-      4100;4127;%(DisableSpecificWarnings)
-    
-    
-      
-      
-      
-      
-      
-      
-      4100;%(DisableSpecificWarnings)
-      
-      
-      4100;%(DisableSpecificWarnings)
-      
-      
-      
-      
-      
-      
-      4100;%(DisableSpecificWarnings)
-      
-      
-      4100;%(DisableSpecificWarnings)
-    
-    
-      
-      
-      
-      
-      
-      
-      4100;%(DisableSpecificWarnings)
-      
-      
-      4100;%(DisableSpecificWarnings)
-      
-      
-      
-      
-      
-      
-      4100;%(DisableSpecificWarnings)
-      
-      
-      4100;%(DisableSpecificWarnings)
-    
-    
-      
-      
-      
-      
-      
-      
-      
-      
-    
-  
-  
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-      Document
-      true
-      true
-      true
-      true
-    
-    
-      Generating switch_version.h
-      cscript /nologo "$(ProjectDir)..\..\libs\win32\util.vbs" Version  "$(ProjectDir)" "$(ProjectDir)..\..\" "$(ProjectDir)..\..\src\include\switch_version.h.template" "$(ProjectDir)..\..\src\include\switch_version.h"
-
-      ..\..\src\include\switch.h;..\..\src\include\switch_apr.h;..\..\src\include\switch_buffer.h;..\..\src\include\switch_caller.h;..\..\src\include\switch_channel.h;..\..\src\include\switch_console.h;..\..\src\include\switch_core.h;..\..\src\include\switch_event.h;..\..\src\include\switch_frame.h;..\..\src\include\switch_ivr.h;..\..\src\include\switch_loadable_module.h;..\..\src\include\switch_log.h;..\..\src\include\switch_module_interfaces.h;..\..\src\include\switch_platform.h;..\..\src\include\switch_resample.h;..\..\src\include\switch_rtp.h;..\..\src\include\switch_sqlite.h;..\..\src\include\switch_stun.h;..\..\src\include\switch_types.h;..\..\src\include\switch_utils.h;..\..\src\include\switch_xml.h;..\..\src\switch_buffer.c;..\..\src\switch_caller.c;..\..\src\switch_channel.c;..\..\src\switch_config.c;..\..\src\switch_console.c;..\..\src\switch_core.c;..\..\src\switch_event.c;..\..\src\switch_ivr.c;..\..\src\switch_loadable_module.c;..\..\src\switch_log.c;..\..\src\switch_resample.c;..\..\src\switch_rtp.c;..\..\src\switch_stun.c;..\..\src\switch_utils.c;..\..\src\switch_xml.c;%(AdditionalInputs)
-      ..\..\src\include\switch_version.h;lastversion;%(Outputs)
-      Generating switch_version.h
-      cscript /nologo "$(ProjectDir)..\..\libs\win32\util.vbs" Version  "$(ProjectDir)" "$(ProjectDir)..\..\" "$(ProjectDir)..\..\src\include\switch_version.h.template" "$(ProjectDir)..\..\src\include\switch_version.h"
-
-      ..\..\src\include\switch.h;..\..\src\include\switch_apr.h;..\..\src\include\switch_buffer.h;..\..\src\include\switch_caller.h;..\..\src\include\switch_channel.h;..\..\src\include\switch_console.h;..\..\src\include\switch_core.h;..\..\src\include\switch_event.h;..\..\src\include\switch_frame.h;..\..\src\include\switch_ivr.h;..\..\src\include\switch_loadable_module.h;..\..\src\include\switch_log.h;..\..\src\include\switch_module_interfaces.h;..\..\src\include\switch_platform.h;..\..\src\include\switch_resample.h;..\..\src\include\switch_rtp.h;..\..\src\include\switch_sqlite.h;..\..\src\include\switch_stun.h;..\..\src\include\switch_types.h;..\..\src\include\switch_utils.h;..\..\src\include\switch_xml.h;..\..\src\switch_buffer.c;..\..\src\switch_caller.c;..\..\src\switch_channel.c;..\..\src\switch_config.c;..\..\src\switch_console.c;..\..\src\switch_core.c;..\..\src\switch_event.c;..\..\src\switch_ivr.c;..\..\src\switch_loadable_module.c;..\..\src\switch_log.c;..\..\src\switch_resample.c;..\..\src\switch_rtp.c;..\..\src\switch_stun.c;..\..\src\switch_utils.c;..\..\src\switch_xml.c;%(AdditionalInputs)
-      ..\..\src\include\switch_version.h;lastversion;%(Outputs)
-      Generating switch_version.h
-      cscript /nologo "$(ProjectDir)..\..\libs\win32\util.vbs" Version  "$(ProjectDir)" "$(ProjectDir)..\..\" "$(ProjectDir)..\..\src\include\switch_version.h.template" "$(ProjectDir)..\..\src\include\switch_version.h"
-
-      ..\..\src\include\switch.h;..\..\src\include\switch_apr.h;..\..\src\include\switch_buffer.h;..\..\src\include\switch_caller.h;..\..\src\include\switch_channel.h;..\..\src\include\switch_console.h;..\..\src\include\switch_core.h;..\..\src\include\switch_event.h;..\..\src\include\switch_frame.h;..\..\src\include\switch_ivr.h;..\..\src\include\switch_loadable_module.h;..\..\src\include\switch_log.h;..\..\src\include\switch_module_interfaces.h;..\..\src\include\switch_platform.h;..\..\src\include\switch_resample.h;..\..\src\include\switch_rtp.h;..\..\src\include\switch_sqlite.h;..\..\src\include\switch_stun.h;..\..\src\include\switch_types.h;..\..\src\include\switch_utils.h;..\..\src\include\switch_xml.h;..\..\src\switch_buffer.c;..\..\src\switch_caller.c;..\..\src\switch_channel.c;..\..\src\switch_config.c;..\..\src\switch_console.c;..\..\src\switch_core.c;..\..\src\switch_event.c;..\..\src\switch_ivr.c;..\..\src\switch_loadable_module.c;..\..\src\switch_log.c;..\..\src\switch_resample.c;..\..\src\switch_rtp.c;..\..\src\switch_stun.c;..\..\src\switch_utils.c;..\..\src\switch_xml.c;%(AdditionalInputs)
-      ..\..\src\include\switch_version.h;lastversion;%(Outputs)
-      Generating switch_version.h
-      cscript /nologo "$(ProjectDir)..\..\libs\win32\util.vbs" Version  "$(ProjectDir)" "$(ProjectDir)..\..\" "$(ProjectDir)..\..\src\include\switch_version.h.template" "$(ProjectDir)..\..\src\include\switch_version.h"
-
-      ..\..\src\include\switch.h;..\..\src\include\switch_apr.h;..\..\src\include\switch_buffer.h;..\..\src\include\switch_caller.h;..\..\src\include\switch_channel.h;..\..\src\include\switch_console.h;..\..\src\include\switch_core.h;..\..\src\include\switch_event.h;..\..\src\include\switch_frame.h;..\..\src\include\switch_ivr.h;..\..\src\include\switch_loadable_module.h;..\..\src\include\switch_log.h;..\..\src\include\switch_module_interfaces.h;..\..\src\include\switch_platform.h;..\..\src\include\switch_resample.h;..\..\src\include\switch_rtp.h;..\..\src\include\switch_sqlite.h;..\..\src\include\switch_stun.h;..\..\src\include\switch_types.h;..\..\src\include\switch_utils.h;..\..\src\include\switch_xml.h;..\..\src\switch_buffer.c;..\..\src\switch_caller.c;..\..\src\switch_channel.c;..\..\src\switch_config.c;..\..\src\switch_console.c;..\..\src\switch_core.c;..\..\src\switch_event.c;..\..\src\switch_ivr.c;..\..\src\switch_loadable_module.c;..\..\src\switch_log.c;..\..\src\switch_resample.c;..\..\src\switch_rtp.c;..\..\src\switch_stun.c;..\..\src\switch_utils.c;..\..\src\switch_xml.c;%(AdditionalInputs)
-      ..\..\src\include\switch_version.h;lastversion;%(Outputs)
-    
-    
-      Generating switch_version.inc
-      cscript /nologo "$(ProjectDir)..\..\libs\win32\util.vbs" Version  "$(ProjectDir)" "$(ProjectDir)..\..\" "$(ProjectDir)switch_version.inc.template" "$(ProjectDir)switch_version.inc"
-      $(ProjectDir)switch_version.inc
-      $ProjectDir)include\switch_version.h;$(ProjectDir)lastversion
-      $ProjectDir)include\switch_version.h;$(ProjectDir)lastversion
-      $ProjectDir)include\switch_version.h;$(ProjectDir)lastversion
-      $ProjectDir)include\switch_version.h;$(ProjectDir)lastversion
-    
-  
-  
-    
-      {89385c74-5860-4174-9caf-a39e7c48909c}
-      false
-    
-    
-      {c13cc324-0032-4492-9a30-310a6bd64ff5}
-    
-    
-      {1cbb0077-18c5-455f-801c-0a0ce7b0bbf5}
-    
-    
-      {78b079bd-9fc7-4b9e-b4a6-96da0f00248b}
-    
-    
-      {d6973076-9317-4ef2-a0b8-b7a18ac0713e}
-    
-    
-      {dce19daf-69ac-46db-b14a-39f0faa5db74}
-    
-    
-      {b6e22500-3db6-4e6e-8cd5-591b781d7d99}
-    
-    
-      {03207781-0d1c-4db3-a71d-45c608f28dbd}
-      false
-    
-    
-      {e972c52f-9e85-4d65-b19c-031e511e9db4}
-    
-    
-      {eef031cb-fed8-451e-a471-91ec8d4f6750}
-      false
-    
-    
-      {f057da7f-79e5-4b00-845c-ef446ef055e3}
-      false
-    
-    
-      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
-      false
-      true
-      false
-      true
-      false
-    
-    
-      {6edfefd5-3596-4fa9-8eba-b331547b35a3}
-      false
-    
-  
-  
-    
-      _DEBUG
-      
-      
-      _WIN64;_DEBUG
-      _WIN64
-      $(ProjectDir)
-    
-  
-  
-    
-  
-  
-  
-  
+
+
+  
+    
+      Debug
+      Win32
+    
+    
+      Debug
+      x64
+    
+    
+      Release
+      Win32
+    
+    
+      Release
+      x64
+    
+  
+  
+    FreeSwitchCoreLib
+    {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+    FreeSwitchCoreLib
+    Win32Proj
+    8.1
+  
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+    DynamicLibrary
+    MultiByte
+    v141
+  
+  
+  
+  
+  
+  
+  
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+    
+  
+  
+    
+  
+  
+  
+    <_ProjectFileVersion>10.0.30319.1
+    true
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    true
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    false
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    $(PlatformName)\$(Configuration)\
+    false
+    $(SolutionDir)$(PlatformName)\$(Configuration)\
+    FreeSwitch
+    FreeSwitch
+    FreeSwitch
+    FreeSwitch
+    $(PlatformName)\$(Configuration)\
+  
+  
+    AllRules.ruleset
+    false
+  
+  
+    AllRules.ruleset
+    false
+  
+  
+    AllRules.ruleset
+    false
+  
+  
+    AllRules.ruleset
+    false
+  
+  
+    
+      ..\..\libs\apr\include\arch\win32;%(AdditionalIncludeDirectories)
+    
+  
+  
+    
+    
+      
+      
+    
+    
+      Disabled
+      ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)
+      CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;ENABLE_ZRTP;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Create
+      switch.h
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      %(ForcedIncludeFiles)
+      false
+      Default
+      false
+      4706;4456;4457;4458;4459;4456;4703;4305;4306;4701;4996;4018;4389;4996;4267;4244;4127;4100;4232;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      true
+    
+    
+      rpcrt4.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\libs\apr\$(OutDir);$(ProjectDir)..\..\libs\sqlite\$(OutDir) DLL;$(ProjectDir)..\..\libs\apr-util\$(OutDir);$(ProjectDir)..\..\libs\apr-iconv\$(OutDir);$(ProjectDir)..\..\libs\libresample\win;$(ProjectDir)..\..\libs\srtp\$(OutDir);%(AdditionalLibraryDirectories)
+      %(AddModuleNamesToAssembly)
+      true
+      Windows
+      
+      
+      
+      
+      false
+      
+      
+      $(OutDir)FreeSwitchCore.lib
+      MachineX86
+      
+      
+    
+    
+      if not exist "$(OutDir)conf" xcopy "$(SolutionDir)conf\vanilla\*.*" "$(OutDir)conf\" /C /D /Y /S
+if not exist "$(OutDir)db" md  "$(OutDir)db"
+if not exist "$(OutDir)log" md  "$(OutDir)log"
+if not exist "$(OutDir)htdocs" md  "$(OutDir)htdocs"
+if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs\" /C /D /Y /S
+
+
+    
+    
+      $(SolutionDir)src\include
+    
+  
+  
+    
+    
+      
+      
+    
+    
+      X64
+    
+    
+      Disabled
+      ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)
+      CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;ENABLE_ZRTP;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)
+      true
+      EnableFastChecks
+      MultiThreadedDebugDLL
+      Create
+      switch.h
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      %(ForcedIncludeFiles)
+      false
+      false
+      4706;4456;4457;4458;4459;4456;4703;4305;4306;4701;4996;4018;4389;4996;4267;4244;4127;4100;4232;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      true
+    
+    
+      rpcrt4.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\libs\apr\$(OutDir);$(ProjectDir)..\..\libs\sqlite\$(OutDir) DLL;$(ProjectDir)..\..\libs\apr-util\$(OutDir);$(ProjectDir)..\..\libs\apr-iconv\$(OutDir);$(ProjectDir)..\..\libs\libresample\win;$(ProjectDir)..\..\libs\srtp\$(OutDir);%(AdditionalLibraryDirectories)
+      %(AddModuleNamesToAssembly)
+      true
+      Windows
+      
+      
+      
+      
+      false
+      
+      
+      $(OutDir)FreeSwitchCore.lib
+      MachineX64
+    
+    
+      if not exist "$(OutDir)conf" xcopy "$(SolutionDir)conf\vanilla\*.*" "$(OutDir)conf\" /C /D /Y /S
+if not exist "$(OutDir)db" md  "$(OutDir)db"
+if not exist "$(OutDir)log" md  "$(OutDir)log"
+if not exist "$(OutDir)htdocs" md  "$(OutDir)htdocs"
+if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs\" /C /D /Y /S
+
+
+    
+  
+  
+    
+    
+      
+      
+    
+    
+      MaxSpeed
+      ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)
+      CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;ENABLE_ZRTP;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Create
+      switch.h
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      false
+      false
+      4706;4456;4457;4458;4459;4456;4703;4305;4306;4701;4996;4018;4389;4996;4267;4244;4127;4100;4232;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      true
+    
+    
+      rpcrt4.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\libs\apr\$(OutDir);$(ProjectDir)..\..\libs\sqlite\$(OutDir) DLL;$(ProjectDir)..\..\libs\apr-util\$(OutDir);$(ProjectDir)..\..\libs\apr-iconv\$(OutDir);$(ProjectDir)..\..\libs\libresample\win;$(ProjectDir)..\..\libs\srtp\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      Windows
+      true
+      true
+      false
+      
+      
+      $(OutDir)FreeSwitchCore.lib
+      MachineX86
+    
+    
+      if not exist "$(OutDir)conf" xcopy "$(SolutionDir)conf\vanilla\*.*" "$(OutDir)conf\" /C /D /Y /S
+if not exist "$(OutDir)db" md  "$(OutDir)db"
+if not exist "$(OutDir)log" md  "$(OutDir)log"
+if not exist "$(OutDir)htdocs" md  "$(OutDir)htdocs"
+if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs\" /C /D /Y /S
+
+
+    
+  
+  
+    
+    
+      
+      
+    
+    
+      X64
+    
+    
+      MaxSpeed
+      ..\..\src\include;..\..\libs\include;..\..\libs\srtp\include;..\..\libs\srtp\crypto\include;..\..\libs\libteletone\src;..\..\libs\sqlite-amalgamation-3080401;..\..\libs\speex-1.2rc1\include;..\..\libs\spandsp\src\msvc;..\..\libs\spandsp\src;..\..\libs\libzrtp\include;..\..\libs\libzrtp\third_party\bgaes;..\..\libs\libzrtp\third_party\bnlib;..\..\libs\libtpl-1.5\src;..\..\libs\libtpl-1.5\src\win;..\..\libs\sofia-sip\libsofia-sip-ua\sdp;..\..\libs\sofia-sip\libsofia-sip-ua\su;..\..\libs\sofia-sip\win32;..\..\libs\libyuv\include;..\..\libs\freetype\include;..\..\libs\libpng;..\..\libs\libvpx;%(AdditionalIncludeDirectories)
+      CJSON_EXPORT_SYMBOLS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;FREESWITCHCORE_EXPORTS;STATICLIB;CRASH_PROT;ENABLE_ZRTP;TPL_NOLIB;LIBSOFIA_SIP_UA_STATIC;SWITCH_HAVE_YUV;SWITCH_HAVE_VPX;SWITCH_HAVE_PNG;SWITCH_HAVE_FREETYPE;%(PreprocessorDefinitions)
+      MultiThreadedDLL
+      Create
+      switch.h
+      
+      
+      Level4
+      true
+      ProgramDatabase
+      false
+      false
+      4706;4456;4457;4458;4459;4456;4703;4305;4306;4701;4996;4018;4389;4996;4267;4244;4127;4100;4232;6340;6246;6011;6387;%(DisableSpecificWarnings)
+    
+    
+      true
+    
+    
+      rpcrt4.lib;%(AdditionalDependencies)
+      $(ProjectDir)..\..\libs\apr\$(OutDir);$(ProjectDir)..\..\libs\sqlite\$(OutDir) DLL;$(ProjectDir)..\..\libs\apr-util\$(OutDir);$(ProjectDir)..\..\libs\apr-iconv\$(OutDir);$(ProjectDir)..\..\libs\libresample\win;$(ProjectDir)..\..\libs\srtp\$(OutDir);%(AdditionalLibraryDirectories)
+      false
+      Windows
+      true
+      true
+      false
+      
+      
+      $(OutDir)FreeSwitchCore.lib
+      MachineX64
+    
+    
+      if not exist "$(OutDir)conf" xcopy "$(SolutionDir)conf\vanilla\*.*" "$(OutDir)conf\" /C /D /Y /S
+if not exist "$(OutDir)db" md  "$(OutDir)db"
+if not exist "$(OutDir)log" md  "$(OutDir)log"
+if not exist "$(OutDir)htdocs" md  "$(OutDir)htdocs"
+if not exist "$(OutDir)htdocs" xcopy "$(SolutionDir)htdocs\*.*" "$(OutDir)htdocs\" /C /D /Y /S
+
+
+    
+  
+  
+    
+      NotUsing
+      false
+      NotUsing
+      false
+      NotUsing
+      false
+      NotUsing
+      false
+    
+    
+      NotUsing
+      false
+      NotUsing
+      false
+      NotUsing
+      false
+      NotUsing
+      false
+    
+    
+      
+      
+      
+      
+      
+      
+      
+      
+    
+    
+      
+      
+      
+      
+      
+      
+      
+      
+    
+    
+    
+    
+      Create
+      Create
+      Create
+      Create
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+      6385;%(DisableSpecificWarnings)
+      6385;%(DisableSpecificWarnings)
+    
+    
+    
+    
+    
+    
+      
+      
+      
+      
+      
+      
+      
+      
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+      
+      
+      
+      
+      
+      
+      
+      
+      28183;6387;%(DisableSpecificWarnings)
+      28183;6387;%(DisableSpecificWarnings)
+      28183;6387;%(DisableSpecificWarnings)
+      28183;6387;%(DisableSpecificWarnings)
+    
+    
+    
+    
+      NotUsing
+    
+    
+      NotUsing
+    
+    
+    
+    
+    
+    
+    
+    
+      4389;4127;%(DisableSpecificWarnings)
+      4389;4127;%(DisableSpecificWarnings)
+      4389;4127;%(DisableSpecificWarnings)
+      4389;4127;%(DisableSpecificWarnings)
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+    
+    
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+    
+    
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+    
+    
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;4389;4706;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;4389;4706;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;4389;4706;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;4389;4706;%(DisableSpecificWarnings)
+    
+    
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+    
+    
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+    
+    
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+    
+    
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+    
+    
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      
+      
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+      _CRT_SECURE_NO_DEPRECATE;STATICLIB;%(PreprocessorDefinitions)
+      
+      
+      4100;4127;%(DisableSpecificWarnings)
+    
+    
+      
+      
+      
+      
+      
+      
+      4100;%(DisableSpecificWarnings)
+      
+      
+      4100;%(DisableSpecificWarnings)
+      
+      
+      
+      
+      
+      
+      4100;%(DisableSpecificWarnings)
+      
+      
+      4100;%(DisableSpecificWarnings)
+    
+    
+      
+      
+      
+      
+      
+      
+      4100;%(DisableSpecificWarnings)
+      
+      
+      4100;%(DisableSpecificWarnings)
+      
+      
+      
+      
+      
+      
+      4100;%(DisableSpecificWarnings)
+      
+      
+      4100;%(DisableSpecificWarnings)
+    
+    
+      
+      
+      
+      
+      
+      
+      
+      
+    
+  
+  
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+      Document
+      true
+      true
+      true
+      true
+    
+    
+      Generating switch_version.h
+      cscript /nologo "$(ProjectDir)..\..\libs\win32\util.vbs" Version  "$(ProjectDir)" "$(ProjectDir)..\..\" "$(ProjectDir)..\..\src\include\switch_version.h.template" "$(ProjectDir)..\..\src\include\switch_version.h"
+
+      ..\..\src\include\switch.h;..\..\src\include\switch_apr.h;..\..\src\include\switch_buffer.h;..\..\src\include\switch_caller.h;..\..\src\include\switch_channel.h;..\..\src\include\switch_console.h;..\..\src\include\switch_core.h;..\..\src\include\switch_event.h;..\..\src\include\switch_frame.h;..\..\src\include\switch_ivr.h;..\..\src\include\switch_loadable_module.h;..\..\src\include\switch_log.h;..\..\src\include\switch_module_interfaces.h;..\..\src\include\switch_platform.h;..\..\src\include\switch_resample.h;..\..\src\include\switch_rtp.h;..\..\src\include\switch_sqlite.h;..\..\src\include\switch_stun.h;..\..\src\include\switch_types.h;..\..\src\include\switch_utils.h;..\..\src\include\switch_xml.h;..\..\src\switch_buffer.c;..\..\src\switch_caller.c;..\..\src\switch_channel.c;..\..\src\switch_config.c;..\..\src\switch_console.c;..\..\src\switch_core.c;..\..\src\switch_event.c;..\..\src\switch_ivr.c;..\..\src\switch_loadable_module.c;..\..\src\switch_log.c;..\..\src\switch_resample.c;..\..\src\switch_rtp.c;..\..\src\switch_stun.c;..\..\src\switch_utils.c;..\..\src\switch_xml.c;%(AdditionalInputs)
+      ..\..\src\include\switch_version.h;lastversion;%(Outputs)
+      Generating switch_version.h
+      cscript /nologo "$(ProjectDir)..\..\libs\win32\util.vbs" Version  "$(ProjectDir)" "$(ProjectDir)..\..\" "$(ProjectDir)..\..\src\include\switch_version.h.template" "$(ProjectDir)..\..\src\include\switch_version.h"
+
+      ..\..\src\include\switch.h;..\..\src\include\switch_apr.h;..\..\src\include\switch_buffer.h;..\..\src\include\switch_caller.h;..\..\src\include\switch_channel.h;..\..\src\include\switch_console.h;..\..\src\include\switch_core.h;..\..\src\include\switch_event.h;..\..\src\include\switch_frame.h;..\..\src\include\switch_ivr.h;..\..\src\include\switch_loadable_module.h;..\..\src\include\switch_log.h;..\..\src\include\switch_module_interfaces.h;..\..\src\include\switch_platform.h;..\..\src\include\switch_resample.h;..\..\src\include\switch_rtp.h;..\..\src\include\switch_sqlite.h;..\..\src\include\switch_stun.h;..\..\src\include\switch_types.h;..\..\src\include\switch_utils.h;..\..\src\include\switch_xml.h;..\..\src\switch_buffer.c;..\..\src\switch_caller.c;..\..\src\switch_channel.c;..\..\src\switch_config.c;..\..\src\switch_console.c;..\..\src\switch_core.c;..\..\src\switch_event.c;..\..\src\switch_ivr.c;..\..\src\switch_loadable_module.c;..\..\src\switch_log.c;..\..\src\switch_resample.c;..\..\src\switch_rtp.c;..\..\src\switch_stun.c;..\..\src\switch_utils.c;..\..\src\switch_xml.c;%(AdditionalInputs)
+      ..\..\src\include\switch_version.h;lastversion;%(Outputs)
+      Generating switch_version.h
+      cscript /nologo "$(ProjectDir)..\..\libs\win32\util.vbs" Version  "$(ProjectDir)" "$(ProjectDir)..\..\" "$(ProjectDir)..\..\src\include\switch_version.h.template" "$(ProjectDir)..\..\src\include\switch_version.h"
+
+      ..\..\src\include\switch.h;..\..\src\include\switch_apr.h;..\..\src\include\switch_buffer.h;..\..\src\include\switch_caller.h;..\..\src\include\switch_channel.h;..\..\src\include\switch_console.h;..\..\src\include\switch_core.h;..\..\src\include\switch_event.h;..\..\src\include\switch_frame.h;..\..\src\include\switch_ivr.h;..\..\src\include\switch_loadable_module.h;..\..\src\include\switch_log.h;..\..\src\include\switch_module_interfaces.h;..\..\src\include\switch_platform.h;..\..\src\include\switch_resample.h;..\..\src\include\switch_rtp.h;..\..\src\include\switch_sqlite.h;..\..\src\include\switch_stun.h;..\..\src\include\switch_types.h;..\..\src\include\switch_utils.h;..\..\src\include\switch_xml.h;..\..\src\switch_buffer.c;..\..\src\switch_caller.c;..\..\src\switch_channel.c;..\..\src\switch_config.c;..\..\src\switch_console.c;..\..\src\switch_core.c;..\..\src\switch_event.c;..\..\src\switch_ivr.c;..\..\src\switch_loadable_module.c;..\..\src\switch_log.c;..\..\src\switch_resample.c;..\..\src\switch_rtp.c;..\..\src\switch_stun.c;..\..\src\switch_utils.c;..\..\src\switch_xml.c;%(AdditionalInputs)
+      ..\..\src\include\switch_version.h;lastversion;%(Outputs)
+      Generating switch_version.h
+      cscript /nologo "$(ProjectDir)..\..\libs\win32\util.vbs" Version  "$(ProjectDir)" "$(ProjectDir)..\..\" "$(ProjectDir)..\..\src\include\switch_version.h.template" "$(ProjectDir)..\..\src\include\switch_version.h"
+
+      ..\..\src\include\switch.h;..\..\src\include\switch_apr.h;..\..\src\include\switch_buffer.h;..\..\src\include\switch_caller.h;..\..\src\include\switch_channel.h;..\..\src\include\switch_console.h;..\..\src\include\switch_core.h;..\..\src\include\switch_event.h;..\..\src\include\switch_frame.h;..\..\src\include\switch_ivr.h;..\..\src\include\switch_loadable_module.h;..\..\src\include\switch_log.h;..\..\src\include\switch_module_interfaces.h;..\..\src\include\switch_platform.h;..\..\src\include\switch_resample.h;..\..\src\include\switch_rtp.h;..\..\src\include\switch_sqlite.h;..\..\src\include\switch_stun.h;..\..\src\include\switch_types.h;..\..\src\include\switch_utils.h;..\..\src\include\switch_xml.h;..\..\src\switch_buffer.c;..\..\src\switch_caller.c;..\..\src\switch_channel.c;..\..\src\switch_config.c;..\..\src\switch_console.c;..\..\src\switch_core.c;..\..\src\switch_event.c;..\..\src\switch_ivr.c;..\..\src\switch_loadable_module.c;..\..\src\switch_log.c;..\..\src\switch_resample.c;..\..\src\switch_rtp.c;..\..\src\switch_stun.c;..\..\src\switch_utils.c;..\..\src\switch_xml.c;%(AdditionalInputs)
+      ..\..\src\include\switch_version.h;lastversion;%(Outputs)
+    
+    
+      Generating switch_version.inc
+      cscript /nologo "$(ProjectDir)..\..\libs\win32\util.vbs" Version  "$(ProjectDir)" "$(ProjectDir)..\..\" "$(ProjectDir)switch_version.inc.template" "$(ProjectDir)switch_version.inc"
+      $(ProjectDir)switch_version.inc
+      $ProjectDir)include\switch_version.h;$(ProjectDir)lastversion
+      $ProjectDir)include\switch_version.h;$(ProjectDir)lastversion
+      $ProjectDir)include\switch_version.h;$(ProjectDir)lastversion
+      $ProjectDir)include\switch_version.h;$(ProjectDir)lastversion
+    
+  
+  
+    
+      {89385c74-5860-4174-9caf-a39e7c48909c}
+      false
+    
+    
+      {c13cc324-0032-4492-9a30-310a6bd64ff5}
+    
+    
+      {1cbb0077-18c5-455f-801c-0a0ce7b0bbf5}
+    
+    
+      {78b079bd-9fc7-4b9e-b4a6-96da0f00248b}
+    
+    
+      {d6973076-9317-4ef2-a0b8-b7a18ac0713e}
+    
+    
+      {dce19daf-69ac-46db-b14a-39f0faa5db74}
+    
+    
+      {b6e22500-3db6-4e6e-8cd5-591b781d7d99}
+    
+    
+      {03207781-0d1c-4db3-a71d-45c608f28dbd}
+      false
+    
+    
+      {e972c52f-9e85-4d65-b19c-031e511e9db4}
+    
+    
+      {eef031cb-fed8-451e-a471-91ec8d4f6750}
+      false
+    
+    
+      {f057da7f-79e5-4b00-845c-ef446ef055e3}
+      false
+    
+    
+      {f6c55d93-b927-4483-bb69-15aef3dd2dff}
+      false
+      true
+      false
+      true
+      false
+    
+    
+      {6edfefd5-3596-4fa9-8eba-b331547b35a3}
+      false
+    
+  
+  
+    
+      _DEBUG
+      
+      
+      _WIN64;_DEBUG
+      _WIN64
+      $(ProjectDir)
+    
+  
+  
+    
+  
+  
+  
+  
 
\ No newline at end of file
diff --git a/w32/Setup/Product.2015.wxs b/w32/Setup/Product.2017.wxs
similarity index 97%
rename from w32/Setup/Product.2015.wxs
rename to w32/Setup/Product.2017.wxs
index 8cefee4210..bbda12f1c8 100644
--- a/w32/Setup/Product.2015.wxs
+++ b/w32/Setup/Product.2017.wxs
@@ -1,132 +1,132 @@
-
-
-
-  
-  
-	
-  
-	
-  
-  
-  
-
-  
-  
-	
-  
-	
-  
-  
-  
-
-
-
-  
-
-  
-
-
-
-	
-		
-
-		
-
-		
-
-		
-		  
-			
-		  
-		
-
-		
-		  
-			
-		  
-		
-
-		
-			
-				
-					 
-					 
-					 
-					 
-					 
-					 
-					
-					
-						
-					
-					
-						
-					
-					
-						
-					
-				
-			
-			
-				
-			
-		
-
-		
-			
-				
-				
-				
-			
-			
-				
-				
-			
-			
-		
-			
-			
-			
-			
-      
-      
-      
-			
-			
-			  
-			
-			
-			  
-			
-		
-		
-			
-		
-		
-			
-		
-		
-			
-		
-		
-			
-		
-    
-  
-
+
+
+
+  
+  
+	
+  
+	
+  
+  
+  
+
+  
+  
+	
+  
+	
+  
+  
+  
+
+
+
+  
+
+  
+
+
+
+	
+		
+
+		
+
+		
+
+		
+		  
+			
+		  
+		
+
+		
+		  
+			
+		  
+		
+
+		
+			
+				
+					 
+					 
+					 
+					 
+					 
+					 
+					
+					
+						
+					
+					
+						
+					
+					
+						
+					
+				
+			
+			
+				
+			
+		
+
+		
+			
+				
+				
+				
+			
+			
+				
+				
+			
+			
+		
+			
+			
+			
+			
+      
+      
+      
+			
+			
+			  
+			
+			
+			  
+			
+		
+		
+			
+		
+		
+			
+		
+		
+			
+		
+		
+			
+		
+    
+  
+
diff --git a/w32/Setup/Setup.2015.wixproj b/w32/Setup/Setup.2017.wixproj
similarity index 92%
rename from w32/Setup/Setup.2015.wixproj
rename to w32/Setup/Setup.2017.wixproj
index 051c7722c7..6aa691a187 100644
--- a/w32/Setup/Setup.2015.wixproj
+++ b/w32/Setup/Setup.2017.wixproj
@@ -1,929 +1,929 @@
-
-
-  
-    true
-  
-  
-    
-  
-  
-    {47213370-b933-487d-9f45-bca26d7e2b6f}
-    2.0
-    FreeSWITCH
-    Package
-    $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets
-    $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets
-  
-  
-    bin\x86\Debug\
-    obj\X86\$(Configuration)\
-    Debug;FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\Win32\debug\sounds;FreeSWITCHBaseDir=$(SolutionDir)Win32\$(Configuration);PlatformDir=Win32;
-    
-    
-  
-  
-    bin\x86\release\
-    obj\X86\$(Configuration)\
-    FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\Win32\release\sounds;FreeSWITCHBaseDir=$(SolutionDir)Win32\$(Configuration);
-  
-  
-    bin\x64\Debug\
-    obj\X64\$(Configuration)\
-    Debug;FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\x64\debug\sounds;FreeSWITCHBaseDir=$(SolutionDir)$(Platform)\$(Configuration);
-    
-    
-  
-  
-    bin\x64\Release\
-    obj\X64\$(Configuration)\
-    FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\x64\release\sounds;FreeSWITCHBaseDir=$(SolutionDir)$(Platform)\$(Configuration);
-  
-  
-    
-    
-    
-    
-    
-  
-  
-    
-      $(WixExtDir)\WixUIExtension.dll
-      WixUIExtension
-    
-  
-  
-    
-  
-  
-    
-      fs_cli
-      {d2fb8043-d208-4aee-8f18-3b5857c871b9}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      8khz
-      {7a8d8174-b355-4114-afc1-04777cb9de0a}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      8khz music
-      {d1abe208-6442-4fb4-9aad-1677e41bc870}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_abstraction
-      {60c542ee-6882-4ea2-8c21-5ab6db1ba73f}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_avmd
-      {990baa76-89d3-4e38-8479-c7b28784efc8}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_blacklist
-      {50aac2ce-bfc9-4912-87cc-c6381850d735}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_callcenter
-      {47886a6c-cca6-4f9f-a7d4-f97d06fb2b1a}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_commands
-      {30a5b29c-983e-4580-9fd0-d647ccdcc7eb}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_conference
-      {c24fb505-05d7-4319-8485-7540b44c8603}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_curl
-      {ef300386-a8df-4372-b6d8-fb9bffca9aed}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_cv
-      {40c4e2a2-b49b-496c-96d6-c04b890f7f88}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_db
-      {f6a33240-8f29-48bd-98f0-826995911799}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_directory
-      {b889a18e-70a7-44b5-b2c9-47798d4f43b3}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_distributor
-      {5c2b4d88-3bea-4fe0-90df-fa9836099d5f}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_dptools
-      {b5881a85-fe70-4f64-8607-2caae52669c6}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_easyroute
-      {329fd5b0-ef28-4606-86d0-f6ea21cf8e36}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_enum
-      {71a967d5-0e99-4cef-a587-98836ee6f2ef}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_esf
-      {3850d93a-5f24-4922-bc1c-74d08c37c256}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_expr
-      {65a6273d-fcab-4c55-b09e-65100141a5d4}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_fifo
-      {75df7f29-2fbf-47f7-b5af-5b4952dc1abd}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_fsv
-      {e3246d17-e29b-4ab5-962a-c69b0c5837bb}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_hash
-      {2e250296-0c08-4342-9c8a-bcbdd0e7df65}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_httapi
-      {4748ff56-ca85-4809-97d6-a94c0fac1d77}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_http_cache
-      {87933c2d-0159-46f7-b326-e1b6e982c21e}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_lcr
-      {1a3793d1-05d1-4b57-9b0f-5af3e79dc439}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_nibblebill
-      {3c977801-fe88-48f2-83d3-fa2ebff6688e}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_redis
-      {886b5e9d-f2c2-4af2-98c8-ef98c4c770e6}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_rss
-      {b69247fa-ecd6-40ed-8e44-5ca6c3baf9a4}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_sms
-      {2469b306-b027-4ff2-8815-c9c1ea2cae79}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_snom
-      {2a3d00c6-588d-4e86-81ac-9ef5ede86e03}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_spandsp
-      {1e21afe0-6fdb-41d2-942d-863607c24b91}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_spy
-      {a61d7cb4-75a5-4a55-8ca1-be5af615d921}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_valet_parking
-      {432db165-1eb2-4781-a9c0-71e62610b20a}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_vmd
-      {14e4a972-9cfb-436d-b0a5-4943f3f80d47}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_voicemail
-      {d7f1e3f2-a3f4-474c-8555-15122571af52}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_flite
-      {66444aee-554c-11dd-a9f0-8c5d56d89593}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_pocketsphinx
-      {2286da73-9fc5-45bc-a508-85994c3317ab}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_unimrcp
-      {d07c378a-f5f7-438f-adf3-4ac4fb1883cd}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_amr
-      {8deb383c-4091-4f42-a56f-c9e46d552d79}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_bv
-      {d5c87b19-150d-4ef3-a671-96589bd2d14a}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_codec2
-      {cb4e68a1-8d19-4b5e-87b9-97a895e1ba17}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_g723_1
-      {fea1eef7-876f-48de-88bf-c0e3e606d758}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_g729
-      {1d95cd95-0de2-48c3-ac23-d5c7d1c9c0f0}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_h26x
-      {2c3c2423-234b-4772-8899-d3b137e5ca35}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_ilbc
-      {d3ec0aff-76fc-4210-a825-9a17410660a3}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_iSAC
-      {7f1610f1-dd5a-4cf7-8610-30ab12c60add}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_opus
-      {64e99cca-3c6f-4aeb-9fa3-cfac711257bb}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_silk
-      {afa983d6-4569-4f88-ba94-555ed00fd9a8}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_siren
-      {0b6c905b-142e-4999-b39d-92ff7951e921}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_dialplan_asterisk
-      {e7bc026c-7cc5-45a3-bc7c-3b88eef01f24}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_dialplan_directory
-      {a27cca23-1541-4337-81a4-f0a6413078a0}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_dialplan_xml
-      {07113b25-d3af-4e04-ba77-4cd1171f022c}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_ldap
-      {ec3e5c7f-ee09-47e2-80fe-546363d14a98}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_dingaling
-      {ffaa4c52-3a53-4f99-90c1-d59d1f0427f3}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_gsmopen
-      {74b120ff-6935-4dfe-a142-cdb6bea99c90}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_loopback
-      {b3f424ec-3d8f-417c-b244-3919d5e1a577}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_PortAudio
-      {5fd31a25-5d83-4794-8bee-904dad84ce71}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_rtc
-      {3884add2-91d0-4cd6-86d3-d5fb2d4aab9e}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_rtmp
-      {48414740-c693-4968-9846-ee058020c64f}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_skinny
-      {cc1dd008-9406-448d-a0ad-33c3186cfadb}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_sofia
-      {0df3abd0-ddc0-4265-b778-07c66780979b}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_verto
-      {5b2bace4-0f5a-4a21-930d-c0f4b1f58fa6}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_amqp
-      {7ac7ab4f-5ef3-40a0-ad2b-cf4d9720fac3}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_cdr_csv
-      {44d7deaf-fda5-495e-8b9d-1439e4f4c21e}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_cdr_pg_csv
-      {411f6d43-9f09-47d0-8b04-e1eb6b67c5bf}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_cdr_sqlite
-      {2ca661a7-01dd-4532-bf88-b6629dfb544a}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_event_multicast
-      {784113ef-44d9-4949-835d-7065d3c7ad08}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_event_socket
-      {05515420-16de-4e63-be73-85be85ba5142}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_odbc_cdr
-      {096c9a84-55b2-4f9b-97e5-0fdf116fd25f}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_local_stream
-      {2ca40887-1622-46a1-a7f9-17fd7e7e545b}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_native_file
-      {9254c4b0-6f60-42b6-bb3a-36d63fc001c7}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_png
-      {fbc7e2a4-b989-4289-ba7f-68f440e9ef8b}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_shout
-      {38fe0559-9910-43a8-9e45-3e5004c27692}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_sndfile
-      {afac0568-7548-42d5-9f6a-8d3400a1e4f6}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_tone_stream
-      {6ff941ac-82c5-429f-aa4c-ad2fb9e5da52}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_lua
-      {7b077e7f-1be7-4291-ab86-55e527b25cac}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_managed
-      {7b42bda1-72c0-4378-a9b6-5c530f8cd61e}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_v8
-      {9b9d2551-d6bd-4f20-8be5-de30e154a064}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_console
-      {1c453396-d912-4213-89fd-9b489162b7b5}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_logfile
-      {d0bcac02-d94b-46b8-9b49-cddcc2bd7909}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_de
-      {5bc072db-3826-48ea-af34-fe32aa01e83b}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_en
-      {988cacf7-3fcb-4992-be69-77872ae67dc8}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_es
-      {fa429e98-8b03-45e6-a096-a4bc5e821de4}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_es_ar
-      {ceee31e6-8a08-42c7-bebd-5ec12072c136}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_fa
-      {0e469f3a-ddd0-43ba-a94f-7d93c02219f3}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_fr
-      {06e3a538-ab32-44f2-b477-755ff9cb5d37}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_he
-      {a3d7c6cf-aeb1-4159-b741-160eb4b37345}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_hr
-      {da7addf1-da33-4194-83a5-b48db714d35b}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_hu
-      {af675478-995a-4115-90c4-b2b0d6470688}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_it
-      {6d1bec70-4dcd-4fe9-adbd-4a43a67e4d05}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_ja
-      {07ea6e5a-d181-4abb-becf-67a906867d04}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_nl
-      {a4b122cf-5196-476b-8c0e-d8bd59ac3c14}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_pl
-      {20b15650-f910-4211-8729-aab0f520c805}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_pt
-      {7c22bdff-cc09-400c-8a09-660733980028}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_ru
-      {0382e8fd-cfdc-41c0-8b03-792c7c84fc31}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_sv
-      {8cda2b34-fa44-49cc-9ec2-b8f35856cd15}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_th
-      {c955e1a9-c12c-4bad-ac32-8d53d9268af7}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_say_zh
-      {b6a9fb7a-1cc4-442b-812d-ec33e4e4a36e}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_xml_cdr
-      {08dad348-9e0a-4a2e-97f1-f1e7e24a7836}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_xml_curl
-      {ab91a099-7690-4ecf-8994-e458f4ea1ed4}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      mod_xml_rpc
-      {cbec7225-0c21-4da8-978e-1f158f8ad950}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-    
-      FreeSwitchConsole
-      {1af3a893-f7be-43dd-b697-8ab2397c0d67}
-      True
-      True
-      Binaries;Content;Satellites
-      INSTALLFOLDER
-    
-  
-  
-    
-  
-  
-  
-    "$(WixToolPath)\heat.exe" dir "$(ProjectDir)..\..\conf\vanilla" -cg FreeSWITCHConfFiles -gg -scom -sreg -sfrag -srd -dr CONFLOCATION -var var.FreeSWITCHConfFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHConfFiles.wxs"
-"$(WixToolPath)\heat.exe" dir "$(SolutionDir)Win32\$(Configuration)\sounds" -cg FreeSWITCHSoundFiles8 -gg -scom -sreg -sfrag -srd -dr SOUNDLOCATION -var var.FreeSWITCHSoundFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHSoundFiles8.wxs"
-"$(WixToolPath)\heat.exe" dir "$(SolutionDir)Win32\$(Configuration)" -t $(ProjectDir)filter.xslt -cg FreeSWITCHBaseFiles -gg -scom -sreg -sfrag -srd -dr INSTALLLOCATION -var var.FreeSWITCHBaseDir -out "$(ProjectDir)Fragments\FreeSWITCHBaseFiles.wxs"
-  
-  
-    "$(WixToolPath)\heat.exe" dir "$(ProjectDir)..\..\conf\vanilla" -cg FreeSWITCHConfFiles -gg -scom -sreg -sfrag -srd -dr CONFLOCATION -var var.FreeSWITCHConfFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHConfFiles.wxs"
-"$(WixToolPath)\heat.exe" dir "$(SolutionDir)x64\$(Configuration)\sounds" -cg FreeSWITCHSoundFiles8 -gg -scom -sreg -sfrag -srd -dr SOUNDLOCATION -var var.FreeSWITCHSoundFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHSoundFiles8.wxs"
-"$(WixToolPath)\heat.exe" dir "$(SolutionDir)x64\$(Configuration)" -t $(ProjectDir)filter.xslt -cg FreeSWITCHBaseFiles -gg -scom -sreg -sfrag -srd -dr INSTALLLOCATION -var var.FreeSWITCHBaseDir -out "$(ProjectDir)Fragments\FreeSWITCHBaseFiles.wxs"
-  
-  
-    
-      
-    
-    
-      
-    
-    
-      
-    
-    
-      
-    
-    
-      
-    
-    
-      
-    
-    
-      
-    
-  
-  
-  
-    
-    
-    
-    
-    
-    
-    
-  
-  
-    
-    
-  
+
+
+  
+    true
+  
+  
+    
+  
+  
+    {47213370-b933-487d-9f45-bca26d7e2b6f}
+    2.0
+    FreeSWITCH
+    Package
+    $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets
+    $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets
+  
+  
+    bin\x86\Debug\
+    obj\X86\$(Configuration)\
+    Debug;FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\Win32\debug\sounds;FreeSWITCHBaseDir=$(SolutionDir)Win32\$(Configuration);PlatformDir=Win32;
+    
+    
+  
+  
+    bin\x86\release\
+    obj\X86\$(Configuration)\
+    FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\Win32\release\sounds;FreeSWITCHBaseDir=$(SolutionDir)Win32\$(Configuration);
+  
+  
+    bin\x64\Debug\
+    obj\X64\$(Configuration)\
+    Debug;FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\x64\debug\sounds;FreeSWITCHBaseDir=$(SolutionDir)$(Platform)\$(Configuration);
+    
+    
+  
+  
+    bin\x64\Release\
+    obj\X64\$(Configuration)\
+    FreeSWITCHConfFilesDir=$(ProjectDir)..\..\conf\vanilla;FreeSWITCHSoundFilesDir=$(ProjectDir)..\..\x64\release\sounds;FreeSWITCHBaseDir=$(SolutionDir)$(Platform)\$(Configuration);
+  
+  
+    
+    
+    
+    
+    
+  
+  
+    
+      $(WixExtDir)\WixUIExtension.dll
+      WixUIExtension
+    
+  
+  
+    
+  
+  
+    
+      fs_cli
+      {d2fb8043-d208-4aee-8f18-3b5857c871b9}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      8khz
+      {7a8d8174-b355-4114-afc1-04777cb9de0a}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      8khz music
+      {d1abe208-6442-4fb4-9aad-1677e41bc870}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_abstraction
+      {60c542ee-6882-4ea2-8c21-5ab6db1ba73f}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_avmd
+      {990baa76-89d3-4e38-8479-c7b28784efc8}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_blacklist
+      {50aac2ce-bfc9-4912-87cc-c6381850d735}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_callcenter
+      {47886a6c-cca6-4f9f-a7d4-f97d06fb2b1a}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_commands
+      {30a5b29c-983e-4580-9fd0-d647ccdcc7eb}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_conference
+      {c24fb505-05d7-4319-8485-7540b44c8603}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_curl
+      {ef300386-a8df-4372-b6d8-fb9bffca9aed}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_cv
+      {40c4e2a2-b49b-496c-96d6-c04b890f7f88}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_db
+      {f6a33240-8f29-48bd-98f0-826995911799}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_directory
+      {b889a18e-70a7-44b5-b2c9-47798d4f43b3}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_distributor
+      {5c2b4d88-3bea-4fe0-90df-fa9836099d5f}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_dptools
+      {b5881a85-fe70-4f64-8607-2caae52669c6}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_easyroute
+      {329fd5b0-ef28-4606-86d0-f6ea21cf8e36}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_enum
+      {71a967d5-0e99-4cef-a587-98836ee6f2ef}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_esf
+      {3850d93a-5f24-4922-bc1c-74d08c37c256}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_expr
+      {65a6273d-fcab-4c55-b09e-65100141a5d4}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_fifo
+      {75df7f29-2fbf-47f7-b5af-5b4952dc1abd}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_fsv
+      {e3246d17-e29b-4ab5-962a-c69b0c5837bb}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_hash
+      {2e250296-0c08-4342-9c8a-bcbdd0e7df65}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_httapi
+      {4748ff56-ca85-4809-97d6-a94c0fac1d77}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_http_cache
+      {87933c2d-0159-46f7-b326-e1b6e982c21e}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_lcr
+      {1a3793d1-05d1-4b57-9b0f-5af3e79dc439}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_nibblebill
+      {3c977801-fe88-48f2-83d3-fa2ebff6688e}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_redis
+      {886b5e9d-f2c2-4af2-98c8-ef98c4c770e6}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_rss
+      {b69247fa-ecd6-40ed-8e44-5ca6c3baf9a4}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_sms
+      {2469b306-b027-4ff2-8815-c9c1ea2cae79}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_snom
+      {2a3d00c6-588d-4e86-81ac-9ef5ede86e03}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_spandsp
+      {1e21afe0-6fdb-41d2-942d-863607c24b91}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_spy
+      {a61d7cb4-75a5-4a55-8ca1-be5af615d921}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_valet_parking
+      {432db165-1eb2-4781-a9c0-71e62610b20a}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_vmd
+      {14e4a972-9cfb-436d-b0a5-4943f3f80d47}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_voicemail
+      {d7f1e3f2-a3f4-474c-8555-15122571af52}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_flite
+      {66444aee-554c-11dd-a9f0-8c5d56d89593}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_pocketsphinx
+      {2286da73-9fc5-45bc-a508-85994c3317ab}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_unimrcp
+      {d07c378a-f5f7-438f-adf3-4ac4fb1883cd}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_amr
+      {8deb383c-4091-4f42-a56f-c9e46d552d79}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_bv
+      {d5c87b19-150d-4ef3-a671-96589bd2d14a}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_codec2
+      {cb4e68a1-8d19-4b5e-87b9-97a895e1ba17}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_g723_1
+      {fea1eef7-876f-48de-88bf-c0e3e606d758}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_g729
+      {1d95cd95-0de2-48c3-ac23-d5c7d1c9c0f0}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_h26x
+      {2c3c2423-234b-4772-8899-d3b137e5ca35}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_ilbc
+      {d3ec0aff-76fc-4210-a825-9a17410660a3}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_iSAC
+      {7f1610f1-dd5a-4cf7-8610-30ab12c60add}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_opus
+      {64e99cca-3c6f-4aeb-9fa3-cfac711257bb}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_silk
+      {afa983d6-4569-4f88-ba94-555ed00fd9a8}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_siren
+      {0b6c905b-142e-4999-b39d-92ff7951e921}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_dialplan_asterisk
+      {e7bc026c-7cc5-45a3-bc7c-3b88eef01f24}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_dialplan_directory
+      {a27cca23-1541-4337-81a4-f0a6413078a0}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_dialplan_xml
+      {07113b25-d3af-4e04-ba77-4cd1171f022c}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_ldap
+      {ec3e5c7f-ee09-47e2-80fe-546363d14a98}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_dingaling
+      {ffaa4c52-3a53-4f99-90c1-d59d1f0427f3}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_gsmopen
+      {74b120ff-6935-4dfe-a142-cdb6bea99c90}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_loopback
+      {b3f424ec-3d8f-417c-b244-3919d5e1a577}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_PortAudio
+      {5fd31a25-5d83-4794-8bee-904dad84ce71}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_rtc
+      {3884add2-91d0-4cd6-86d3-d5fb2d4aab9e}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_rtmp
+      {48414740-c693-4968-9846-ee058020c64f}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_skinny
+      {cc1dd008-9406-448d-a0ad-33c3186cfadb}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_sofia
+      {0df3abd0-ddc0-4265-b778-07c66780979b}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_verto
+      {5b2bace4-0f5a-4a21-930d-c0f4b1f58fa6}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_amqp
+      {7ac7ab4f-5ef3-40a0-ad2b-cf4d9720fac3}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_cdr_csv
+      {44d7deaf-fda5-495e-8b9d-1439e4f4c21e}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_cdr_pg_csv
+      {411f6d43-9f09-47d0-8b04-e1eb6b67c5bf}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_cdr_sqlite
+      {2ca661a7-01dd-4532-bf88-b6629dfb544a}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_event_multicast
+      {784113ef-44d9-4949-835d-7065d3c7ad08}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_event_socket
+      {05515420-16de-4e63-be73-85be85ba5142}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_odbc_cdr
+      {096c9a84-55b2-4f9b-97e5-0fdf116fd25f}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_local_stream
+      {2ca40887-1622-46a1-a7f9-17fd7e7e545b}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_native_file
+      {9254c4b0-6f60-42b6-bb3a-36d63fc001c7}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_png
+      {fbc7e2a4-b989-4289-ba7f-68f440e9ef8b}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_shout
+      {38fe0559-9910-43a8-9e45-3e5004c27692}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_sndfile
+      {afac0568-7548-42d5-9f6a-8d3400a1e4f6}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_tone_stream
+      {6ff941ac-82c5-429f-aa4c-ad2fb9e5da52}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_lua
+      {7b077e7f-1be7-4291-ab86-55e527b25cac}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_managed
+      {7b42bda1-72c0-4378-a9b6-5c530f8cd61e}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_v8
+      {9b9d2551-d6bd-4f20-8be5-de30e154a064}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_console
+      {1c453396-d912-4213-89fd-9b489162b7b5}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_logfile
+      {d0bcac02-d94b-46b8-9b49-cddcc2bd7909}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_de
+      {5bc072db-3826-48ea-af34-fe32aa01e83b}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_en
+      {988cacf7-3fcb-4992-be69-77872ae67dc8}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_es
+      {fa429e98-8b03-45e6-a096-a4bc5e821de4}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_es_ar
+      {ceee31e6-8a08-42c7-bebd-5ec12072c136}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_fa
+      {0e469f3a-ddd0-43ba-a94f-7d93c02219f3}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_fr
+      {06e3a538-ab32-44f2-b477-755ff9cb5d37}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_he
+      {a3d7c6cf-aeb1-4159-b741-160eb4b37345}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_hr
+      {da7addf1-da33-4194-83a5-b48db714d35b}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_hu
+      {af675478-995a-4115-90c4-b2b0d6470688}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_it
+      {6d1bec70-4dcd-4fe9-adbd-4a43a67e4d05}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_ja
+      {07ea6e5a-d181-4abb-becf-67a906867d04}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_nl
+      {a4b122cf-5196-476b-8c0e-d8bd59ac3c14}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_pl
+      {20b15650-f910-4211-8729-aab0f520c805}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_pt
+      {7c22bdff-cc09-400c-8a09-660733980028}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_ru
+      {0382e8fd-cfdc-41c0-8b03-792c7c84fc31}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_sv
+      {8cda2b34-fa44-49cc-9ec2-b8f35856cd15}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_th
+      {c955e1a9-c12c-4bad-ac32-8d53d9268af7}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_say_zh
+      {b6a9fb7a-1cc4-442b-812d-ec33e4e4a36e}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_xml_cdr
+      {08dad348-9e0a-4a2e-97f1-f1e7e24a7836}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_xml_curl
+      {ab91a099-7690-4ecf-8994-e458f4ea1ed4}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      mod_xml_rpc
+      {cbec7225-0c21-4da8-978e-1f158f8ad950}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+    
+      FreeSwitchConsole
+      {1af3a893-f7be-43dd-b697-8ab2397c0d67}
+      True
+      True
+      Binaries;Content;Satellites
+      INSTALLFOLDER
+    
+  
+  
+    
+  
+  
+  
+    "$(WixToolPath)\heat.exe" dir "$(ProjectDir)..\..\conf\vanilla" -cg FreeSWITCHConfFiles -gg -scom -sreg -sfrag -srd -dr CONFLOCATION -var var.FreeSWITCHConfFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHConfFiles.wxs"
+"$(WixToolPath)\heat.exe" dir "$(SolutionDir)Win32\$(Configuration)\sounds" -cg FreeSWITCHSoundFiles8 -gg -scom -sreg -sfrag -srd -dr SOUNDLOCATION -var var.FreeSWITCHSoundFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHSoundFiles8.wxs"
+"$(WixToolPath)\heat.exe" dir "$(SolutionDir)Win32\$(Configuration)" -t $(ProjectDir)filter.xslt -cg FreeSWITCHBaseFiles -gg -scom -sreg -sfrag -srd -dr INSTALLLOCATION -var var.FreeSWITCHBaseDir -out "$(ProjectDir)Fragments\FreeSWITCHBaseFiles.wxs"
+  
+  
+    "$(WixToolPath)\heat.exe" dir "$(ProjectDir)..\..\conf\vanilla" -cg FreeSWITCHConfFiles -gg -scom -sreg -sfrag -srd -dr CONFLOCATION -var var.FreeSWITCHConfFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHConfFiles.wxs"
+"$(WixToolPath)\heat.exe" dir "$(SolutionDir)x64\$(Configuration)\sounds" -cg FreeSWITCHSoundFiles8 -gg -scom -sreg -sfrag -srd -dr SOUNDLOCATION -var var.FreeSWITCHSoundFilesDir -out "$(ProjectDir)Fragments\FreeSWITCHSoundFiles8.wxs"
+"$(WixToolPath)\heat.exe" dir "$(SolutionDir)x64\$(Configuration)" -t $(ProjectDir)filter.xslt -cg FreeSWITCHBaseFiles -gg -scom -sreg -sfrag -srd -dr INSTALLLOCATION -var var.FreeSWITCHBaseDir -out "$(ProjectDir)Fragments\FreeSWITCHBaseFiles.wxs"
+  
+  
+    
+      
+    
+    
+      
+    
+    
+      
+    
+    
+      
+    
+    
+      
+    
+    
+      
+    
+    
+      
+    
+  
+  
+  
+    
+    
+    
+    
+    
+    
+    
+  
+  
+    
+    
+  
 
\ No newline at end of file

From d88df785f1d5538dbcff24eefb93616dd900d084 Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Mon, 9 Jul 2018 19:50:27 +0000
Subject: [PATCH 239/264] FS-11211: [Verto-Communicator] Add turnServer and
 verto server fallback options -- FS side to only do relay as a last resort
 #resolve

---
 src/switch_core_media.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/switch_core_media.c b/src/switch_core_media.c
index 5f0a9a1dde..5ec1909be9 100644
--- a/src/switch_core_media.c
+++ b/src/switch_core_media.c
@@ -4054,7 +4054,7 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
 	sdp_attribute_t *attr = NULL, *attrs[2] = { 0 };
 	int i = 0, got_rtcp_mux = 0;
 	const char *val;
-	int ice_seen = 0, cid = 0, ai = 0, attr_idx = 0, cand_seen = 0;
+	int ice_seen = 0, cid = 0, ai = 0, attr_idx = 0, cand_seen = 0, relay_ok = 0;
 
 	if (switch_true(switch_channel_get_variable_dup(smh->session->channel, "ignore_sdp_ice", SWITCH_FALSE, -1))) {
 		return SWITCH_STATUS_BREAK;
@@ -4240,12 +4240,19 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
 		return SWITCH_STATUS_SUCCESS;
 	}
 
-
+	relay_ok = 0;
+	
+ relay:
+	
 	for (cid = 0; cid < 2; cid++) {
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_DEBUG, "Searching for %s candidate.\n", cid ? "rtcp" : "rtp");
 
 		for (ai = 0; ai < engine->cand_acl_count; ai++) {
 			for (i = 0; i < engine->ice_in.cand_idx[cid]; i++) {
+				int is_relay = !strcmp(engine->ice_in.cands[i][cid].cand_type, "relay");
+
+				if (relay_ok != is_relay) continue;
+
 				if (switch_check_network_list_ip(engine->ice_in.cands[i][cid].con_addr, engine->cand_acl[ai])) {
 					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_DEBUG,
 									  "Choose %s candidate, index %d, %s:%d\n", cid ? "rtcp" : "rtp", i,
@@ -4283,8 +4290,13 @@ static switch_status_t check_ice(switch_media_handle_t *smh, switch_media_type_t
 
  done_choosing:
 
-
 	if (!engine->ice_in.is_chosen[0]) {
+		if (!relay_ok) {
+			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_DEBUG, "Look for Relay Candidates as last resort\n");
+			relay_ok = 1;
+			goto relay;
+		}
+
 		/* PUNT */
 		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_DEBUG, "%s no suitable candidates found.\n",
 						  switch_channel_get_name(smh->session->channel));

From 8bacb4991d75d0287738a13395994fdc17360ea9 Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Mon, 9 Jul 2018 20:00:45 +0000
Subject: [PATCH 240/264] FS-11224: [freeswitch-core] Fix VC build #resolve

---
 html5/verto/verto_communicator/bower.json     | 6 +++---
 html5/verto/verto_communicator/src/index.html | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/html5/verto/verto_communicator/bower.json b/html5/verto/verto_communicator/bower.json
index 68a96ec31f..444ccf6021 100644
--- a/html5/verto/verto_communicator/bower.json
+++ b/html5/verto/verto_communicator/bower.json
@@ -24,6 +24,9 @@
     "tests"
   ],
   "dependencies": {
+    "jquery": "~2.1.4",
+    "jquery-cookie": "~1.4.1",
+    "jquery-json": "~2.5.1",
     "angular-gravatar": "~0.4.1",
     "bootstrap": "~3.3.4",
     "angular-toastr": "~1.4.1",
@@ -34,13 +37,10 @@
     "angular-animate": "~1.3.15",
     "angular-cookies": "~1.3.15",
     "angular-directive.g-signin": "~0.1.2",
-    "jquery": "~2.1.4",
     "angular-fullscreen": "~1.0.1",
     "ngstorage": "~0.3.9",
     "angular-timer": "~1.3.3",
     "angular-tooltips": "~0.1.21",
-    "jquery-cookie": "~1.4.1",
-    "jquery-json": "~2.5.1",
     "datatables": "~1.10.8",
     "angular-bootstrap": "~0.14.3",
     "bootstrap-material-design": "~0.3.0",
diff --git a/html5/verto/verto_communicator/src/index.html b/html5/verto/verto_communicator/src/index.html
index 87879b5ae9..d3f5cc1825 100644
--- a/html5/verto/verto_communicator/src/index.html
+++ b/html5/verto/verto_communicator/src/index.html
@@ -75,6 +75,8 @@
     
     
     
+    
+    
     
     
     
@@ -92,8 +94,6 @@
     
     
     
-    
-    
     
     
     

From bc3e1c9e7de1855eec454bba467fd2586e5e251b Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Mon, 9 Jul 2018 20:02:13 +0000
Subject: [PATCH 241/264] FS-11225: [freeswitch-core] Crash in fs_cli #resolve

---
 libs/esl/fs_cli.c | 88 +++++++++++++++++++++++++++++------------------
 1 file changed, 55 insertions(+), 33 deletions(-)

diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c
index 39c445ba5c..b4a5838175 100644
--- a/libs/esl/fs_cli.c
+++ b/libs/esl/fs_cli.c
@@ -89,7 +89,7 @@ static int pcount = 0;
 static esl_handle_t *global_handle;
 static cli_profile_t *global_profile;
 static int running = 1;
-static int thread_running = 0;
+static int thread_running = 0, thread_up = 0, check_up = 0;
 static char *filter_uuid;
 static char *logfilter;
 static int timeout = 0;
@@ -671,40 +671,45 @@ static void clear_line(void)
 
 static void redisplay(void)
 {
-#ifdef HAVE_LIBEDIT
-#ifdef HAVE_DECL_EL_REFRESH
-#ifdef HAVE_EL_WSET
-	/* Current libedit versions don't implement EL_REFRESH in eln.c so
-	 * use the wide version instead. */
-	el_wset(el, EL_REFRESH);
-#else
-	/* This will work on future libedit versions and versions built
-	 * without wide character support. */
-	el_set(el, EL_REFRESH);
-#endif
-#else
-	/* Old libedit versions don't implement EL_REFRESH at all so use
-	 * our own implementation instead. */
-	const LineInfo *lf = el_line(el);
-	const char *c = lf->buffer;
-	if (global_profile->batch_mode) return;
-	printf("%s",prompt_str);
-	while (c < lf->lastchar && *c) {
-		putchar(*c);
-		c++;
-	}
+	esl_mutex_lock(MUTEX);
 	{
-		int pos = (int)(lf->cursor - lf->buffer);
-		char s1[12], s2[12];
-		putchar('\r');
-		snprintf(s1, sizeof(s1), "\033[%dC", bare_prompt_str_len);
-		snprintf(s2, sizeof(s2), "\033[%dC", pos);
-		printf("%s%s",s1,s2);
+#ifdef HAVE_LIBEDIT
+#ifdef XHAVE_DECL_EL_REFRESH
+#ifdef HAVE_EL_WSET
+		/* Current libedit versions don't implement EL_REFRESH in eln.c so
+		 * use the wide version instead. */
+		el_wset(el, EL_REFRESH);
+#else
+		/* This will work on future libedit versions and versions built
+		 * without wide character support. */
+		el_set(el, EL_REFRESH);
+#endif
+#else
+		/* Old libedit versions don't implement EL_REFRESH at all so use
+		 * our own implementation instead. */
+		const LineInfo *lf = el_line(el);
+		const char *c = lf->buffer;
+		if (global_profile->batch_mode) return;
+		printf("%s",prompt_str);
+		while (c < lf->lastchar && *c) {
+			putchar(*c);
+			c++;
+		}
+		{
+			int pos = (int)(lf->cursor - lf->buffer);
+			char s1[12], s2[12] = "";
+			
+			putchar('\r');
+			snprintf(s1, sizeof(s1), "\033[%dC", bare_prompt_str_len);			
+			if (pos) snprintf(s2, sizeof(s2), "\033[%dC", pos);
+			printf("%s%s",s1,s2);
+		}
+		fflush(stdout);
+#endif
+#endif
 	}
-	fflush(stdout);
+	esl_mutex_unlock(MUTEX);
 	return;
-#endif
-#endif
 }
 
 static int output_printf(const char *fmt, ...)
@@ -726,6 +731,9 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
 {
 	esl_handle_t *handle = (esl_handle_t *) obj;
 	thread_running = 1;
+	esl_mutex_lock(MUTEX);
+	thread_up = 1;
+	esl_mutex_unlock(MUTEX);
 	while(thread_running && handle->connected) {
 		int aok = 1;
 		esl_status_t status;
@@ -846,6 +854,10 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
 		}
 		//sleep_ms(1);
 	}
+
+	esl_mutex_lock(MUTEX);  
+	thread_up = 0;
+	esl_mutex_unlock(MUTEX);  
 	thread_running = 0;
 	esl_log(ESL_LOG_DEBUG, "Thread Done\n");
 	return NULL;
@@ -1165,8 +1177,10 @@ static unsigned char esl_console_complete(const char *buffer, const char *cursor
 		snprintf(cmd_str, sizeof(cmd_str), "api console_complete %s\n\n", buf);
 	}
 
+	esl_mutex_lock(MUTEX);
 	esl_send_recv(global_handle, cmd_str);
-
+	esl_mutex_unlock(MUTEX);
+	
 	if (global_handle->last_sr_event && global_handle->last_sr_event->body) {
 		char *r = global_handle->last_sr_event->body;
 		char *w, *p1;
@@ -1828,6 +1842,7 @@ int main(int argc, char *argv[])
 	output_printf("%s\n", handle.last_sr_reply);
 	while (running > 0) {
 		int r;
+
 #ifdef HAVE_LIBEDIT
 		if (!(global_profile->batch_mode)) {
 			line = el_gets(el, &count);
@@ -1869,6 +1884,13 @@ int main(int argc, char *argv[])
 	global_handle = NULL;
 	thread_running = 0;
 
+	do {
+		esl_mutex_lock(MUTEX);
+		check_up = thread_up;
+		esl_mutex_unlock(MUTEX);
+		sleep_ms(10);
+	} while (check_up > 0);
+	
 	esl_mutex_destroy(&MUTEX);
 
 	return 0;

From 79ccf87ae7d785e52580954cc3d0f003fd2961e2 Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Mon, 9 Jul 2018 20:04:28 +0000
Subject: [PATCH 242/264] FS-11226: [freeswitch-core,mod_conference] Missing
 font files can lead to crash in conference #resolve

---
 .../mod_conference/conference_video.c         | 42 +++++++++++--------
 src/switch_core_video.c                       |  8 ++++
 2 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c
index 69cf103bd4..44ad6d3d54 100644
--- a/src/mod/applications/mod_conference/conference_video.c
+++ b/src/mod/applications/mod_conference/conference_video.c
@@ -1199,16 +1199,20 @@ void conference_member_set_logo(conference_member_t *member, const char *path)
 					if (y < 0) y = 0;
 				}
 
-				img = switch_img_write_text_img(member->video_logo->d_w, member->video_logo->d_h, SWITCH_FALSE, var);
-				switch_img_fit(&img, member->video_logo->d_w, member->video_logo->d_h, SWITCH_FIT_NECESSARY);
-				switch_img_attenuate(member->video_logo);
+				if ((img = switch_img_write_text_img(member->video_logo->d_w, member->video_logo->d_h, SWITCH_FALSE, var))) {
+					switch_img_fit(&img, member->video_logo->d_w, member->video_logo->d_h, SWITCH_FIT_NECESSARY);
+					switch_img_attenuate(member->video_logo);
 
-				if (center) {
-					x = center_off + ((member->video_logo->d_w - center_off - img->d_w) / 2);
+
+					if (center) {
+						x = center_off + ((member->video_logo->d_w - center_off - img->d_w) / 2);
+					}
+
+					switch_img_patch(member->video_logo, img, x, y);
+					switch_img_free(&img);
+				} else {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to write text on image!\n");
 				}
-
-				switch_img_patch(member->video_logo, img, x, y);
-				switch_img_free(&img);
 			}
 
 			if (params && (var = switch_event_get_header(params, "alt_text"))) {
@@ -1236,17 +1240,21 @@ void conference_member_set_logo(conference_member_t *member, const char *path)
 					y = atoi(tmp);
 					if (y < 0) y = 0;
 				}
+				
+				if ((img = switch_img_write_text_img(member->video_logo->d_w, member->video_logo->d_h, SWITCH_FALSE, var))) {
+					switch_img_fit(&img, member->video_logo->d_w, member->video_logo->d_h, SWITCH_FIT_NECESSARY);
+					switch_img_attenuate(member->video_logo);
+					
+					if (center) {
+						x = center_off + ((member->video_logo->d_w - center_off - img->d_w) / 2);
+					}
 
-				img = switch_img_write_text_img(member->video_logo->d_w, member->video_logo->d_h, SWITCH_FALSE, var);
-				switch_img_fit(&img, member->video_logo->d_w, member->video_logo->d_h, SWITCH_FIT_NECESSARY);
-				switch_img_attenuate(member->video_logo);
-
-				if (center) {
-					x = center_off + ((member->video_logo->d_w - center_off - img->d_w) / 2);
+					switch_img_patch(member->video_logo, img, x, y);
+					switch_img_free(&img);
+				} else {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to write text on image!\n");
 				}
-
-				switch_img_patch(member->video_logo, img, x, y);
-				switch_img_free(&img);
+						 
 			}
 			
 		}
diff --git a/src/switch_core_video.c b/src/switch_core_video.c
index 66cbc6279f..96a39a107f 100644
--- a/src/switch_core_video.c
+++ b/src/switch_core_video.c
@@ -2196,6 +2196,11 @@ SWITCH_DECLARE(switch_image_t *) switch_img_write_text_img(int w, int h, switch_
 	} else {
 		width = pre_width;
 	}
+
+	if (width == 0 || height == 0) {
+		txtimg = NULL;
+		goto done;
+	}
 	
 	//if (bg) {
 	//	txtimg = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, width, height, 1);
@@ -2224,6 +2229,9 @@ SWITCH_DECLARE(switch_image_t *) switch_img_write_text_img(int w, int h, switch_
 								txtimg,
 								x, y,
 								txt, NULL, fg, bg, 0, 0);
+
+ done:
+	
 	switch_img_txt_handle_destroy(&txthandle);
 
 	switch_safe_free(duptxt);

From 2cb4e49432db20a769415e5f1a3807f0d681633b Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Sat, 14 Jul 2018 06:25:35 +0800
Subject: [PATCH 243/264] FS-11231 #resolve deprecate start_input_timers and
 add start-input-timers

---
 src/mod/applications/mod_dptools/mod_dptools.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c
index d70a613b4a..3d22b350ef 100644
--- a/src/mod/applications/mod_dptools/mod_dptools.c
+++ b/src/mod/applications/mod_dptools/mod_dptools.c
@@ -494,7 +494,10 @@ SWITCH_STANDARD_APP(detect_speech_function)
 			switch_ivr_stop_detect_speech(session);
 		} else if (!strcasecmp(argv[0], "param")) {
 			switch_ivr_set_param_detect_speech(session, argv[1], argv[2]);
+		} else if (!strcasecmp(argv[0], "start-input-timers")) {
+			switch_ivr_detect_speech_start_input_timers(session);
 		} else if (!strcasecmp(argv[0], "start_input_timers")) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "start_input_timers is deprecated, please use start-input-timers instead!\n");
 			switch_ivr_detect_speech_start_input_timers(session);
 		} else if (argc >= 3) {
 			switch_ivr_detect_speech(session, argv[0], argv[1], argv[2], argv[3], NULL);

From 868e92649ec597f42552db92fa98264734114017 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Thu, 7 Jun 2018 10:23:04 +0800
Subject: [PATCH 244/264] FS-11183 improve strip to save out buffer size

---
 src/switch_utils.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/switch_utils.c b/src/switch_utils.c
index 0b480fcbea..bd21e7ee75 100644
--- a/src/switch_utils.c
+++ b/src/switch_utils.c
@@ -1405,12 +1405,12 @@ SWITCH_DECLARE(char *) switch_strip_commas(char *in, char *out, switch_size_t le
 	for (; p && *p; p++) {
 		if ((*p > 47 && *p < 58)) {
 			*q++ = *p;
-		} else if (*p != ',') {
-			ret = NULL;
-			break;
-		}
 
-		if (++x > len) {
+			if (++x > len) {
+				ret = NULL;
+				break;
+			}
+		} else if (*p != ',') {
 			ret = NULL;
 			break;
 		}
@@ -1428,11 +1428,11 @@ SWITCH_DECLARE(char *) switch_strip_nonnumerics(char *in, char *out, switch_size
 	for (; p && *p; p++) {
 		if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
 			*q++ = *p;
-		}
 
-		if (++x > len) {
-			ret = NULL;
-			break;
+			if (++x > len) {
+				ret = NULL;
+				break;
+			}
 		}
 	}
 

From 7f3878dfcb363bb7b895acf437a5faec58a9007f Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Thu, 21 Jun 2018 05:32:22 -0400
Subject: [PATCH 245/264] FS-11206: [mod_conference] add conference hold
 feature

---
 .../mod_conference/conference_al.c            |   8 +-
 .../mod_conference/conference_api.c           | 163 ++++++++++++++++++
 .../mod_conference/conference_loop.c          |  20 ++-
 .../mod_conference/conference_member.c        |   5 +-
 .../mod_conference/conference_utils.c         |   6 +-
 .../mod_conference/conference_video.c         |  29 +++-
 .../mod_conference/mod_conference.c           |  36 ++--
 .../mod_conference/mod_conference.h           |   5 +-
 8 files changed, 242 insertions(+), 30 deletions(-)

diff --git a/src/mod/applications/mod_conference/conference_al.c b/src/mod/applications/mod_conference/conference_al.c
index 41eeb8cda1..2d4f0ad7a9 100644
--- a/src/mod/applications/mod_conference/conference_al.c
+++ b/src/mod/applications/mod_conference/conference_al.c
@@ -78,7 +78,9 @@ void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t
 
 	switch_mutex_lock(conference->member_mutex);
 	for (member = conference->members; member; member = member->next) {
-		if (member->channel && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conference_utils_member_test_flag(member, MFLAG_NO_POSITIONAL)) {
+		if (member->channel && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) &&
+			!conference_utils_member_test_flag(member, MFLAG_HOLD) &&
+			!conference_utils_member_test_flag(member, MFLAG_NO_POSITIONAL)) {
 			count++;
 		}
 	}
@@ -112,7 +114,9 @@ void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t
 
 	for (member = conference->members; member; member = member->next) {
 
-		if (!member->channel || conference_utils_member_test_flag(member, MFLAG_NO_POSITIONAL) || !conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
+		if (!member->channel || conference_utils_member_test_flag(member, MFLAG_NO_POSITIONAL) ||
+			conference_utils_member_test_flag(member, MFLAG_HOLD) ||
+			!conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
 			continue;
 		}
 
diff --git a/src/mod/applications/mod_conference/conference_api.c b/src/mod/applications/mod_conference/conference_api.c
index d4c427d8db..96c2bc8bc4 100644
--- a/src/mod/applications/mod_conference/conference_api.c
+++ b/src/mod/applications/mod_conference/conference_api.c
@@ -72,6 +72,8 @@ api_command_t conference_api_sub_commands[] = {
 	{"vid-flip", (void_fn_t) & conference_api_sub_vid_flip, CONF_API_SUB_MEMBER_TARGET, "vid-flip", "<[member_id|all|last|non_moderator]>"},
 	{"vid-border", (void_fn_t) & conference_api_sub_vid_border, CONF_API_SUB_MEMBER_TARGET, "vid-border", "<[member_id|all|last|non_moderator]>"},
 	{"hup", (void_fn_t) & conference_api_sub_hup, CONF_API_SUB_MEMBER_TARGET, "hup", "<[member_id|all|last|non_moderator]>"},
+	{"hold", (void_fn_t) & conference_api_sub_hold, CONF_API_SUB_MEMBER_TARGET, "hold", "<[member_id|all]|last|non_moderator> [file]"},
+	{"unhold", (void_fn_t) & conference_api_sub_unhold, CONF_API_SUB_MEMBER_TARGET, "unhold", "<[member_id|all]|last|non_moderator>"},
 	{"mute", (void_fn_t) & conference_api_sub_mute, CONF_API_SUB_MEMBER_TARGET, "mute", "<[member_id|all]|last|non_moderator> []"},
 	{"tmute", (void_fn_t) & conference_api_sub_tmute, CONF_API_SUB_MEMBER_TARGET, "tmute", "<[member_id|all]|last|non_moderator> []"},
 	{"unmute", (void_fn_t) & conference_api_sub_unmute, CONF_API_SUB_MEMBER_TARGET, "unmute", "<[member_id|all]|last|non_moderator> []"},
@@ -313,6 +315,11 @@ switch_status_t conference_api_sub_mute(conference_member_t *member, switch_stre
 	if (member == NULL)
 		return SWITCH_STATUS_GENERR;
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR mute %u\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	conference_utils_member_clear_flag_locked(member, MFLAG_CAN_SPEAK);
 	conference_utils_member_clear_flag_locked(member, MFLAG_TALKING);
 
@@ -345,6 +352,107 @@ switch_status_t conference_api_sub_mute(conference_member_t *member, switch_stre
 	return SWITCH_STATUS_SUCCESS;
 }
 
+switch_status_t conference_api_sub_unhold(conference_member_t *member, switch_stream_handle_t *stream, void *data)
+{
+	mcu_layer_t *layer = NULL;
+	switch_event_t *event;
+
+	if (member == NULL)
+		return SWITCH_STATUS_GENERR;
+
+	conference_utils_member_clear_flag_locked(member, MFLAG_HOLD);
+
+	if (member->session && !conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT)) {
+		switch_core_media_hard_mute(member->session, SWITCH_FALSE);
+	}
+
+	conference_member_stop_file(member, FILE_STOP_ALL);
+
+	if (switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY) {
+		if ((layer = conference_video_get_layer_locked(member))) {
+			layer->clear = 1;
+			conference_video_release_layer(&layer);
+		}
+
+		conference_video_reset_video_bitrate_counters(member);
+
+		if (member->channel) {
+			switch_channel_clear_flag(member->channel, CF_VIDEO_PAUSE_READ);
+			switch_channel_video_sync(member->channel);
+		}
+	}
+	
+	if (stream != NULL) {
+		stream->write_function(stream, "+OK unhold %u\n", member->id);
+	}
+
+	if (test_eflag(member->conference, EFLAG_HOLD_MEMBER) &&
+		switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
+		conference_member_add_event_data(member, event);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "unhold-member");
+		switch_event_fire(&event);
+	}
+
+	if (conference_utils_test_flag(member->conference, CFLAG_POSITIONAL)) {
+		conference_al_gen_arc(member->conference, NULL);
+	}
+
+	conference_member_update_status_field(member);
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t conference_api_sub_hold(conference_member_t *member, switch_stream_handle_t *stream, void *data)
+{
+	switch_event_t *event;
+
+	if (member == NULL)
+		return SWITCH_STATUS_GENERR;
+
+	conference_utils_member_clear_flag_locked(member, MFLAG_TALKING);
+
+	if (switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY) {
+		conference_video_reset_video_bitrate_counters(member);
+
+		if (member->channel) {
+			switch_channel_set_flag(member->channel, CF_VIDEO_PAUSE_READ);
+			switch_core_session_request_video_refresh(member->session);
+			switch_channel_video_sync(member->channel);
+		}
+	}
+
+	if (member->session) {
+		switch_core_media_hard_mute(member->session, SWITCH_TRUE);
+	}
+
+	conference_utils_member_set_flag(member, MFLAG_HOLD);
+	
+	conference_member_set_score_iir(member, 0);
+
+	if (!zstr(data)) {
+		conference_member_play_file(member, data, 0, SWITCH_FALSE);
+	}
+
+	if (stream != NULL) {
+		stream->write_function(stream, "+OK hold %u\n", member->id);
+	}
+
+	if (test_eflag(member->conference, EFLAG_HOLD_MEMBER) &&
+		switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
+		conference_member_add_event_data(member, event);
+		switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "hold-member");
+		switch_event_fire(&event);
+	}
+
+	if (conference_utils_test_flag(member->conference, CFLAG_POSITIONAL)) {
+		conference_al_gen_arc(member->conference, NULL);
+	}
+
+	conference_member_update_status_field(member);
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
 
 switch_status_t conference_api_sub_tmute(conference_member_t *member, switch_stream_handle_t *stream, void *data)
 {
@@ -352,6 +460,11 @@ switch_status_t conference_api_sub_tmute(conference_member_t *member, switch_str
 	if (member == NULL)
 		return SWITCH_STATUS_GENERR;
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR mute %u\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
 		return conference_api_sub_mute(member, stream, data);
 	}
@@ -367,6 +480,11 @@ switch_status_t conference_api_sub_unmute(conference_member_t *member, switch_st
 	if (member == NULL)
 		return SWITCH_STATUS_GENERR;
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR unmute %u\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	conference_utils_member_set_flag_locked(member, MFLAG_CAN_SPEAK);
 
 	if (member->session && !conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT)) {
@@ -413,6 +531,11 @@ switch_status_t conference_api_sub_conference_video_vmute_snap(conference_member
 		return SWITCH_STATUS_SUCCESS;
 	}
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR member %u is on hold\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	if (stream != NULL) {
 		stream->write_function(stream, "+OK vmute image snapped %u\n", member->id);
 	}
@@ -437,6 +560,11 @@ switch_status_t conference_api_sub_vmute(conference_member_t *member, switch_str
 		return SWITCH_STATUS_SUCCESS;
 	}
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR member %u is on hold\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	conference_utils_member_clear_flag_locked(member, MFLAG_CAN_BE_SEEN);
 	conference_video_reset_video_bitrate_counters(member);
 
@@ -473,6 +601,11 @@ switch_status_t conference_api_sub_tvmute(conference_member_t *member, switch_st
 	if (member == NULL)
 		return SWITCH_STATUS_GENERR;
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR member %u is on hold\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) {
 		return conference_api_sub_vmute(member, stream, data);
 	}
@@ -493,6 +626,11 @@ switch_status_t conference_api_sub_unvmute(conference_member_t *member, switch_s
 		return SWITCH_STATUS_SUCCESS;
 	}
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR member %u is on hold\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	if ((layer = conference_video_get_layer_locked(member))) {
 		layer->clear = 1;
 		conference_video_release_layer(&layer);
@@ -534,6 +672,11 @@ switch_status_t conference_api_sub_vblind(conference_member_t *member, switch_st
 	if (member == NULL)
 		return SWITCH_STATUS_GENERR;
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR member %u is on hold\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	switch_core_session_write_blank_video(member->session, 50);
 	conference_utils_member_clear_flag_locked(member, MFLAG_CAN_SEE);
 	conference_video_reset_video_bitrate_counters(member);
@@ -565,6 +708,11 @@ switch_status_t conference_api_sub_tvblind(conference_member_t *member, switch_s
 	if (member == NULL)
 		return SWITCH_STATUS_GENERR;
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR member %u is on hold\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	if (conference_utils_member_test_flag(member, MFLAG_CAN_SEE)) {
 		return conference_api_sub_vblind(member, stream, data);
 	}
@@ -580,6 +728,11 @@ switch_status_t conference_api_sub_unvblind(conference_member_t *member, switch_
 	if (member == NULL)
 		return SWITCH_STATUS_GENERR;
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR member %u is on hold\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	conference_utils_member_set_flag_locked(member, MFLAG_CAN_SEE);
 	conference_video_reset_video_bitrate_counters(member);
 
@@ -613,6 +766,11 @@ switch_status_t conference_api_sub_deaf(conference_member_t *member, switch_stre
 	if (member == NULL)
 		return SWITCH_STATUS_GENERR;
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR member %u is on hold\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	conference_utils_member_clear_flag_locked(member, MFLAG_CAN_HEAR);
 
 	if (!(data) || !strstr((char *) data, "quiet")) {
@@ -655,6 +813,11 @@ switch_status_t conference_api_sub_undeaf(conference_member_t *member, switch_st
 	if (member == NULL)
 		return SWITCH_STATUS_GENERR;
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		if (stream) stream->write_function(stream, "-ERR member %u is on hold\n", member->id);
+		return SWITCH_STATUS_SUCCESS;
+	}
+
 	conference_utils_member_set_flag_locked(member, MFLAG_CAN_HEAR);
 
 	if (!(data) || !strstr((char *) data, "quiet")) {
diff --git a/src/mod/applications/mod_conference/conference_loop.c b/src/mod/applications/mod_conference/conference_loop.c
index 60e5056435..49377312c6 100644
--- a/src/mod/applications/mod_conference/conference_loop.c
+++ b/src/mod/applications/mod_conference/conference_loop.c
@@ -132,6 +132,8 @@ void conference_loop_mute_toggle(conference_member_t *member, caller_control_act
 	if (member == NULL)
 		return;
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) return;
+
 	if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
 		conference_api_sub_mute(member, NULL, NULL);
 	} else {
@@ -144,6 +146,8 @@ void conference_loop_mute_toggle(conference_member_t *member, caller_control_act
 
 void conference_loop_mute_on(conference_member_t *member, caller_control_action_t *action)
 {
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) return;
+
 	if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
 		conference_api_sub_mute(member, NULL, NULL);
 	}
@@ -151,6 +155,8 @@ void conference_loop_mute_on(conference_member_t *member, caller_control_action_
 
 void conference_loop_mute_off(conference_member_t *member, caller_control_action_t *action)
 {
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) return;
+
 	if (!conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
 		conference_api_sub_unmute(member, NULL, NULL);
 		if (!conference_utils_member_test_flag(member, MFLAG_CAN_HEAR)) {
@@ -280,6 +286,8 @@ void conference_loop_deafmute_toggle(conference_member_t *member, caller_control
 	if (member == NULL)
 		return;
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) return;
+
 	if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
 		conference_api_sub_mute(member, NULL, NULL);
 		if (conference_utils_member_test_flag(member, MFLAG_CAN_HEAR)) {
@@ -933,7 +941,8 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob
 
 		/* if the member can speak, compute the audio energy level and */
 		/* generate events when the level crosses the threshold        */
-		if ((conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) || conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT))) {
+		if (((conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conference_utils_member_test_flag(member, MFLAG_HOLD)) ||
+			 conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT))) {
 			uint32_t energy = 0, i = 0, samples = 0, j = 0;
 			int16_t *data;
 			int gate_check = 0;
@@ -990,7 +999,7 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob
 
 			gate_check = conference_member_noise_gate_check(member);
 
-			if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
+			if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conference_utils_member_test_flag(member, MFLAG_HOLD)) {
 				if (member->max_energy_level) {
 					if (member->score > member->max_energy_level && ++member->max_energy_hits > member->max_energy_hit_trigger) {
 						member->mute_counter = member->burst_mute_count;
@@ -1131,6 +1140,7 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob
 						member->talking_count = 0;
 						
 						if (test_eflag(member->conference, EFLAG_START_TALKING) && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) &&
+							!conference_utils_member_test_flag(member, MFLAG_HOLD) &&
 							switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
 							conference_member_add_event_data(member, event);
 							switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "start-talking");
@@ -1157,7 +1167,8 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob
 					hangunder_hits--;
 				}
 
-				if (conference_utils_member_test_flag(member, MFLAG_TALKING) && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
+				if (conference_utils_member_test_flag(member, MFLAG_TALKING) && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) &&
+					!conference_utils_member_test_flag(member, MFLAG_HOLD)) {
 					if (++hangover_hits >= hangover) {
 						hangover_hits = hangunder_hits = 0;
 
@@ -1188,7 +1199,8 @@ void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *ob
 
 		/* skip frames that are not actual media or when we are muted or silent */
 		if ((conference_utils_member_test_flag(member, MFLAG_TALKING) || member->energy_level == 0 || conference_utils_test_flag(member->conference, CFLAG_AUDIO_ALWAYS))
-			&& conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) &&	!conference_utils_test_flag(member->conference, CFLAG_WAIT_MOD)
+			&& conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) && !conference_utils_test_flag(member->conference, CFLAG_WAIT_MOD)
+			&& !conference_utils_member_test_flag(member, MFLAG_HOLD)
 			&& (member->conference->count > 1 || (member->conference->record_count && member->conference->count >= member->conference->min_recording_participants))) {
 			switch_audio_resampler_t *read_resampler = member->read_resampler;
 			void *data;
diff --git a/src/mod/applications/mod_conference/conference_member.c b/src/mod/applications/mod_conference/conference_member.c
index b530a6e3ff..d72fcf5153 100644
--- a/src/mod/applications/mod_conference/conference_member.c
+++ b/src/mod/applications/mod_conference/conference_member.c
@@ -133,7 +133,9 @@ void conference_member_update_status_field(conference_member_t *member)
 
 	switch_live_array_lock(member->conference->la);
 
-	if (!conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		str = "HOLD";
+	} else if (!conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
 		str = "MUTE";
 	} else if (switch_channel_test_flag(member->channel, CF_HOLD)) {
 		str = "HOLD";
@@ -258,6 +260,7 @@ switch_status_t conference_member_add_event_data(conference_member_t *member, sw
 	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Speak", "%s", conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) ? "true" : "false" );
 	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Talking", "%s", conference_utils_member_test_flag(member, MFLAG_TALKING) ? "true" : "false" );
 	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Mute-Detect", "%s", conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT) ? "true" : "false" );
+	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Hold", "%s", conference_utils_member_test_flag(member, MFLAG_HOLD) ? "true" : "false" );
 	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-Type", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "moderator" : "member");
 	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-Ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false");
diff --git a/src/mod/applications/mod_conference/conference_utils.c b/src/mod/applications/mod_conference/conference_utils.c
index 5940c06358..c1932ead74 100644
--- a/src/mod/applications/mod_conference/conference_utils.c
+++ b/src/mod/applications/mod_conference/conference_utils.c
@@ -237,9 +237,7 @@ void conference_utils_clear_eflags(char *events, uint32_t *f)
 				*next++ = '\0';
 			}
 
-			if (!strcmp(event, "add-member")) {
-				*f &= ~EFLAG_ADD_MEMBER;
-			} else if (!strcmp(event, "del-member")) {
+			if (!strcmp(event, "del-member")) {
 				*f &= ~EFLAG_DEL_MEMBER;
 			} else if (!strcmp(event, "energy-level")) {
 				*f &= ~EFLAG_ENERGY_LEVEL;
@@ -257,6 +255,8 @@ void conference_utils_clear_eflags(char *events, uint32_t *f)
 				*f &= ~EFLAG_MUTE_DETECT;
 			} else if (!strcmp(event, "mute-member")) {
 				*f &= ~EFLAG_MUTE_MEMBER;
+			} else if (!strcmp(event, "hold-member")) {
+				*f &= ~EFLAG_HOLD_MEMBER;
 			} else if (!strcmp(event, "kick-member")) {
 				*f &= ~EFLAG_KICK_MEMBER;
 			} else if (!strcmp(event, "dtmf-member")) {
diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c
index 44ad6d3d54..859b135515 100644
--- a/src/mod/applications/mod_conference/conference_video.c
+++ b/src/mod/applications/mod_conference/conference_video.c
@@ -1414,6 +1414,10 @@ switch_status_t conference_video_attach_video_layer(conference_member_t *member,
 		return SWITCH_STATUS_FALSE;
 	}
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		conference_utils_member_clear_flag(member, MFLAG_DED_VID_LAYER);
+		return SWITCH_STATUS_FALSE;
+	}
 
 	if (!switch_channel_test_flag(channel, CF_VIDEO_READY) && !member->avatar_png_img) {
 		conference_utils_member_clear_flag(member, MFLAG_DED_VID_LAYER);
@@ -1425,6 +1429,8 @@ switch_status_t conference_video_attach_video_layer(conference_member_t *member,
 		return SWITCH_STATUS_FALSE;
 	}
 
+	
+
 	switch_mutex_lock(canvas->mutex);
 
 	layer = &canvas->layers[idx];
@@ -2606,6 +2612,10 @@ switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_ca
 		return SWITCH_STATUS_FALSE;
 	}
 
+	if (conference_utils_member_test_flag(member, MFLAG_HOLD)) {
+		return SWITCH_STATUS_FALSE;
+	}
+	
 	switch_mutex_lock(canvas->mutex);
 
 	for (i = 0; i < canvas->total_layers; i++) {
@@ -2730,7 +2740,7 @@ void conference_video_pop_next_image(conference_member_t *member, switch_image_t
 			size = switch_queue_size(member->video_queue);
 		} while(size > 1);
 
-		if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) &&
+		if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && !conference_utils_member_test_flag(member, MFLAG_HOLD) &&
 			member->video_layer_id > -1 &&
 			switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY &&
 			switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_INACTIVE
@@ -2961,7 +2971,7 @@ void conference_video_check_auto_bitrate(conference_member_t *member, mcu_layer_
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s setting bitrate to %dkps because it was forced.\n",
 						  switch_channel_get_name(member->channel), kps);
 	} else {
-		if (layer && conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)) {
+		if (layer && conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && !conference_utils_member_test_flag(member, MFLAG_HOLD)) {
 			if (layer->screen_w != screen_w) {
 				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s auto-setting bitrate to %dkps (max res %dx%d) to accommodate %dx%d resolution\n",
 								  switch_channel_get_name(member->channel), kps, screen_w, screen_h, layer->screen_w, layer->screen_h);
@@ -3177,6 +3187,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
 			int no_muted = conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS);
 			int no_av = conference_utils_test_flag(imember->conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS);
 			int seen = conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN);
+			int hold = conference_utils_member_test_flag(imember, MFLAG_HOLD);
 
 			if (imember->channel && switch_channel_ready(imember->channel) && switch_channel_test_flag(imember->channel, CF_VIDEO_READY) &&
 				imember->watching_canvas_id == canvas->canvas_id) {
@@ -3184,7 +3195,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
 			}
 
 			if (imember->channel && switch_channel_ready(imember->channel) && switch_channel_test_flag(imember->channel, CF_VIDEO_READY) &&
-				!conference_utils_member_test_flag(imember, MFLAG_SECOND_SCREEN) && 
+				!conference_utils_member_test_flag(imember, MFLAG_SECOND_SCREEN) && !hold &&
 				conference_utils_member_test_flag(imember, MFLAG_RUNNING) && (!no_muted || seen) && (!no_av || (no_av && !imember->avatar_png_img))
 				&& imember->canvas_id == canvas->canvas_id && imember->video_media_flow != SWITCH_MEDIA_FLOW_SENDONLY && imember->video_media_flow != SWITCH_MEDIA_FLOW_INACTIVE) {
 				video_count++;
@@ -3403,8 +3414,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
 				continue;
 			}
 
-			if (conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS) &&
-				!conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN) && imember->video_layer_id > -1) {
+			if ((conference_utils_member_test_flag(imember, MFLAG_HOLD) ||
+				(conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS) &&
+				 !conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN))) && imember->video_layer_id > -1) {
 				conference_video_detach_video_layer(imember);
 				switch_img_free(&imember->video_mute_img);
 
@@ -3518,7 +3530,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
 				//	switch_img_free(&layer->cur_img);
 				//}
 
-				if (conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN) || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE || conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS)) {
+				if ((conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN) && !conference_utils_member_test_flag(imember, MFLAG_HOLD)) || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE || conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS)) {
 					layer->mute_patched = 0;
 				} else {
 
@@ -3637,7 +3649,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
 
 					if (total > 0 &&
 						(!conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS) ||
-						 conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN)) &&
+						 (conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN) && !conference_utils_member_test_flag(imember, MFLAG_HOLD))) &&
 						imember->session && switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY &&
 						imember->session && switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_INACTIVE) {
 
@@ -3804,7 +3816,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
 						}
 
 						if (layer) {
-							if (conference_utils_member_test_flag(omember, MFLAG_CAN_BE_SEEN)) {
+							if (conference_utils_member_test_flag(omember, MFLAG_CAN_BE_SEEN) && !conference_utils_member_test_flag(imember, MFLAG_HOLD)) {
 								layer->mute_patched = 0;
 							} else if (!conference_utils_test_flag(omember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS)) {
 								if (!layer->mute_patched) {
@@ -4954,6 +4966,7 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session,
 
 		if (frame->img && (((member->video_layer_id > -1) && canvas_id > -1) || member->canvas) &&
 			conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) &&
+			!conference_utils_member_test_flag(member, MFLAG_HOLD) &&
 			switch_queue_size(member->video_queue) < member->conference->video_fps.fps &&
 			!member->conference->canvases[canvas_id]->playing_video_file) {
 
diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c
index 7b9c8207c8..6efb7c72df 100644
--- a/src/mod/applications/mod_conference/mod_conference.c
+++ b/src/mod/applications/mod_conference/mod_conference.c
@@ -84,6 +84,7 @@ void conference_list(conference_obj_t *conference, switch_stream_handle_t *strea
 		char *uuid;
 		char *name;
 		uint32_t count = 0;
+		switch_bool_t hold = conference_utils_member_test_flag(member, MFLAG_HOLD);
 
 		if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) {
 			continue;
@@ -97,21 +98,26 @@ void conference_list(conference_obj_t *conference, switch_stream_handle_t *strea
 		stream->write_function(stream, "%u%s%s%s%s%s%s%s%s%s",
 							   member->id, delim, name, delim, uuid, delim, profile->caller_id_name, delim, profile->caller_id_number, delim);
 
-		if (conference_utils_member_test_flag(member, MFLAG_CAN_HEAR)) {
+		if (!hold && conference_utils_member_test_flag(member, MFLAG_CAN_HEAR)) {
 			stream->write_function(stream, "hear");
 			count++;
 		}
 
-		if (conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
+		if (!hold && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
 			stream->write_function(stream, "%s%s", count ? "|" : "", "speak");
 			count++;
 		}
 
-		if (conference_utils_member_test_flag(member, MFLAG_TALKING)) {
+		if (!hold && conference_utils_member_test_flag(member, MFLAG_TALKING)) {
 			stream->write_function(stream, "%s%s", count ? "|" : "", "talking");
 			count++;
 		}
 
+		if (hold) {
+			stream->write_function(stream, "%s%s", count ? "|" : "", "hold");
+			count++;
+		}
+
 		if (switch_channel_test_flag(switch_core_session_get_channel(member->session), CF_VIDEO)) {
 			stream->write_function(stream, "%s%s", count ? "|" : "", "video");
 			count++;
@@ -331,6 +337,7 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
 					switch_channel_test_flag(channel, CF_VIDEO_READY) &&
 					imember->video_media_flow != SWITCH_MEDIA_FLOW_SENDONLY &&
 					!conference_utils_member_test_flag(imember, MFLAG_SECOND_SCREEN) &&
+					!conference_utils_member_test_flag(imember, MFLAG_HOLD) &&
 					(!conference_utils_test_flag(conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS) ||
 					 conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN))) {
 					members_with_video++;
@@ -1225,7 +1232,8 @@ void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, i
 		switch_xml_t x_tag;
 		int toff = 0;
 		char tmp[50] = "";
-
+		switch_bool_t hold = conference_utils_member_test_flag(member, MFLAG_HOLD);
+		
 		if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) {
 			if (member->rec_path) {
 				x_member = switch_xml_add_child_d(x_members, "member", moff++);
@@ -1286,19 +1294,22 @@ void conference_xlist(conference_obj_t *conference, switch_xml_t x_conference, i
 		switch_assert(x_flags);
 
 		x_tag = switch_xml_add_child_d(x_flags, "can_hear", count++);
-		switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_CAN_HEAR) ? "true" : "false");
+		switch_xml_set_txt_d(x_tag, (!hold && conference_utils_member_test_flag(member, MFLAG_CAN_HEAR)) ? "true" : "false");
 
 		x_tag = switch_xml_add_child_d(x_flags, "can_see", count++);
-		switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_CAN_SEE) ? "true" : "false");
+		switch_xml_set_txt_d(x_tag, (!hold && conference_utils_member_test_flag(member, MFLAG_CAN_SEE)) ? "true" : "false");
 
 		x_tag = switch_xml_add_child_d(x_flags, "can_speak", count++);
-		switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK) ? "true" : "false");
+		switch_xml_set_txt_d(x_tag, (!hold && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) ? "true" : "false");
 
 		x_tag = switch_xml_add_child_d(x_flags, "mute_detect", count++);
 		switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT) ? "true" : "false");
 
 		x_tag = switch_xml_add_child_d(x_flags, "talking", count++);
-		switch_xml_set_txt_d(x_tag, conference_utils_member_test_flag(member, MFLAG_TALKING) ? "true" : "false");
+		switch_xml_set_txt_d(x_tag, (!hold && conference_utils_member_test_flag(member, MFLAG_TALKING)) ? "true" : "false");
+
+		x_tag = switch_xml_add_child_d(x_flags, "hold", count++);
+		switch_xml_set_txt_d(x_tag, hold ? "true" : "false");
 
 		x_tag = switch_xml_add_child_d(x_flags, "has_video", count++);
 		switch_xml_set_txt_d(x_tag, switch_channel_test_flag(switch_core_session_get_channel(member->session), CF_VIDEO) ? "true" : "false");
@@ -1374,6 +1385,8 @@ void conference_jlist(conference_obj_t *conference, cJSON *json_conferences)
 		switch_channel_t *channel;
 		switch_caller_profile_t *profile;
 		char *uuid;
+		switch_bool_t hold = conference_utils_member_test_flag(member, MFLAG_HOLD);
+
 		cJSON_AddItemToObject(json_conference_members, "member", json_conference_member = cJSON_CreateObject());
 
 		if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL)) {
@@ -1405,9 +1418,10 @@ void conference_jlist(conference_obj_t *conference, cJSON *json_conferences)
 		cJSON_AddNumberToObject(json_conference_member, "volume_out", member->volume_out_level);
 		cJSON_AddNumberToObject(json_conference_member, "output-volume", member->volume_out_level);
 		cJSON_AddNumberToObject(json_conference_member, "input-volume", member->volume_in_level);
-		ADDBOOL(json_conference_member_flags, "can_hear", conference_utils_member_test_flag(member, MFLAG_CAN_HEAR));
-		ADDBOOL(json_conference_member_flags, "can_see", conference_utils_member_test_flag(member, MFLAG_CAN_SEE));
-		ADDBOOL(json_conference_member_flags, "can_speak", conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK));
+		ADDBOOL(json_conference_member_flags, "can_hear", !hold && conference_utils_member_test_flag(member, MFLAG_CAN_HEAR));
+		ADDBOOL(json_conference_member_flags, "can_see", !hold && conference_utils_member_test_flag(member, MFLAG_CAN_SEE));
+		ADDBOOL(json_conference_member_flags, "can_speak", !hold && conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK));
+		ADDBOOL(json_conference_member_flags, "hold", hold);
 		ADDBOOL(json_conference_member_flags, "mute_detect", conference_utils_member_test_flag(member, MFLAG_MUTE_DETECT));
 		ADDBOOL(json_conference_member_flags, "talking", conference_utils_member_test_flag(member, MFLAG_TALKING));
 		ADDBOOL(json_conference_member_flags, "has_video", switch_channel_test_flag(switch_core_session_get_channel(member->session), CF_VIDEO));
diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h
index c4f7b14fba..60920410a2 100644
--- a/src/mod/applications/mod_conference/mod_conference.h
+++ b/src/mod/applications/mod_conference/mod_conference.h
@@ -220,6 +220,7 @@ typedef enum {
 	MFLAG_NO_VIDEO_BLANKS,
 	MFLAG_VIDEO_JOIN,
 	MFLAG_DED_VID_LAYER,
+	MFLAG_HOLD,
 	///////////////////////////
 	MFLAG_MAX
 } member_flag_t;
@@ -322,7 +323,7 @@ typedef enum {
 } node_flag_t;
 
 typedef enum {
-	EFLAG_ADD_MEMBER = (1 << 0),
+	EFLAG_HOLD_MEMBER = (1 << 0),
 	EFLAG_DEL_MEMBER = (1 << 1),
 	EFLAG_ENERGY_LEVEL = (1 << 2),
 	EFLAG_VOLUME_LEVEL = (1 << 3),
@@ -1210,6 +1211,8 @@ switch_status_t conference_api_sub_file_seek(conference_obj_t *conference, switc
 switch_status_t conference_api_sub_cam(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv);
 switch_status_t conference_api_sub_stop(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv);
 switch_status_t conference_api_sub_hup(conference_member_t *member, switch_stream_handle_t *stream, void *data);
+switch_status_t conference_api_sub_hold(conference_member_t *member, switch_stream_handle_t *stream, void *data);
+switch_status_t conference_api_sub_unhold(conference_member_t *member, switch_stream_handle_t *stream, void *data);
 switch_status_t conference_api_sub_pauserec(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv);
 switch_status_t conference_api_sub_volume_out(conference_member_t *member, switch_stream_handle_t *stream, void *data);
 switch_status_t conference_api_sub_lock(conference_obj_t *conference, switch_stream_handle_t *stream, int argc, char **argv);

From e1e8ebc0ab7da1ed7e70797cd35e924a9df9a1a6 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Wed, 13 Jun 2018 13:52:18 +0800
Subject: [PATCH 246/264] FS-11189: [core] add func to parse cpu string

---
 src/include/switch_utils.h | 55 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h
index dd5adcbd89..7e812bb130 100644
--- a/src/include/switch_utils.h
+++ b/src/include/switch_utils.h
@@ -1084,6 +1084,61 @@ static inline int32_t switch_parse_bandwidth_string(const char *bwv)
 	return (int32_t) roundf(bw);
 }
 
+static inline uint32_t switch_parse_cpu_string(const char *cpu)
+{
+	int cpu_count = switch_core_cpu_count();
+	int ncpu = cpu_count;
+
+	if (!cpu) return 1;
+
+	if (!strcasecmp(cpu, "auto")) {
+		if (cpu_count > 4) return 4;
+		if (cpu_count <= 2) return 1;
+
+		return (uint32_t)(cpu_count / 2);
+	}
+
+	if (!strncasecmp(cpu, "cpu/", 4)) { /* cpu/2 or cpu/2/  */
+		const char *has_max = cpu;
+		float divisor;
+		int max = cpu_count;
+
+		cpu +=4;
+
+		has_max = strchr(cpu, '/');
+
+		if (has_max > cpu) {
+			max = atoi(has_max + 1);
+		}
+
+		divisor = atof(cpu);
+
+		if (divisor <= 0) divisor = 1;
+
+		ncpu = cpu_count / divisor;
+
+		if (ncpu <= 0) return 1;
+
+		if (ncpu > max) return (uint32_t)max;
+
+		return (uint32_t)ncpu;
+	} else if (!strcasecmp(cpu, "cpu")) {
+		ncpu = cpu_count;
+	} else {
+		ncpu = atoi(cpu);
+
+		if (cpu && strrchr(cpu, '%')) {
+			ncpu = (int) (cpu_count * ((float)ncpu / 100));
+		}
+	}
+
+	if (ncpu > cpu_count) return (uint32_t)cpu_count;
+
+	if (ncpu <= 0) return 1;
+
+	return ncpu;
+}
+
 static inline int switch_needs_url_encode(const char *s)
 {
 	const char hex[] = "0123456789ABCDEF";

From 7fe031a9f53c8ae34123cbbbc2bc7eae38e37a54 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Wed, 13 Jun 2018 13:52:54 +0800
Subject: [PATCH 247/264] FS-11189: add vpx settings

load time:
first load config default settings
merge any settings in XML

run time:
merge any dynamic settings
---
 src/switch_vpx.c | 478 ++++++++++++++++++++++++++++++++++-------------
 1 file changed, 350 insertions(+), 128 deletions(-)

diff --git a/src/switch_vpx.c b/src/switch_vpx.c
index 07cb64e40d..3cb3f861a7 100644
--- a/src/switch_vpx.c
+++ b/src/switch_vpx.c
@@ -276,7 +276,7 @@ struct vpx_context {
 	unsigned int flags;
 	switch_codec_settings_t codec_settings;
 	unsigned int bandwidth;
-	vpx_codec_enc_cfg_t	config;
+	vpx_codec_enc_cfg_t config;
 	switch_time_t last_key_frame;
 
 	vpx_codec_ctx_t	encoder;
@@ -314,6 +314,21 @@ struct vpx_context {
 };
 typedef struct vpx_context vpx_context_t;
 
+struct vpx_globals {
+	int debug;
+	uint32_t max_bitrate;
+	char vp8_profile[20];
+	char vp9_profile[20];
+	char vp10_profile[20];
+	vpx_codec_enc_cfg_t vp8_enc_cfg;
+	vpx_codec_dec_cfg_t vp8_dec_cfg;
+	vpx_codec_enc_cfg_t vp9_enc_cfg;
+	vpx_codec_dec_cfg_t vp9_dec_cfg;
+	vpx_codec_enc_cfg_t vp10_enc_cfg;
+	vpx_codec_dec_cfg_t vp10_dec_cfg;
+};
+
+struct vpx_globals vpx_globals = { 0 };
 
 static switch_status_t init_decoder(switch_codec_t *codec)
 {
@@ -329,14 +344,11 @@ static switch_status_t init_decoder(switch_codec_t *codec)
 		//	context->decoder_init = 0;
 		//}
 
-		//cfg.threads = 1;//(switch_core_cpu_count() > 1) ? 2 : 1;
-
-		cfg.threads = switch_core_cpu_count() / 2;
-		if (cfg.threads > 4) cfg.threads = 4;
-		if (cfg.threads < 1) cfg.threads = 1;
-
-		if (!context->is_vp9) { // vp8 only
+		if (context->is_vp9) {
+			cfg.threads = vpx_globals.vp9_dec_cfg.threads;
+		} else {
 			// dec_flags = VPX_CODEC_USE_POSTPROC;
+			cfg.threads = vpx_globals.vp8_dec_cfg.threads;
 		}
 
 		if (vpx_codec_dec_init(&context->decoder, context->decoder_interface, &cfg, dec_flags) != VPX_CODEC_OK) {
@@ -377,7 +389,14 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 	vpx_codec_enc_cfg_t *config = &context->config;
 	int token_parts = 1;
 	int cpus = switch_core_cpu_count();
-	int sane, threads = 1;
+	vpx_codec_enc_cfg_t *vp8_enc_cfg = &vpx_globals.vp8_enc_cfg;
+	vpx_codec_enc_cfg_t *vp9_enc_cfg = &vpx_globals.vp9_enc_cfg;
+
+	if (context->is_vp9) {
+		*config = *vp9_enc_cfg;
+	} else {
+		*config = *vp8_enc_cfg;
+	}
 
 	if (!context->codec_settings.video.width) {
 		context->codec_settings.video.width = 1280;
@@ -395,14 +414,11 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 		context->bandwidth = context->codec_settings.video.bandwidth;
 	} else {
 		context->bandwidth = switch_calc_bitrate(context->codec_settings.video.width, context->codec_settings.video.height, 1, 15);
-
 	}
 
-	sane = switch_calc_bitrate(1920, 1080, 5, 60);
-
-	if (context->bandwidth > sane) {
-		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(codec->session), SWITCH_LOG_WARNING, "BITRATE TRUNCATED FROM %d TO %d\n", context->bandwidth, sane);
-		context->bandwidth = sane;
+	if (context->bandwidth > vpx_globals.max_bitrate) {
+		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(codec->session), SWITCH_LOG_WARNING, "BITRATE TRUNCATED FROM %d TO %d\n", context->bandwidth, vpx_globals.max_bitrate);
+		context->bandwidth = vpx_globals.max_bitrate;
 	}
 
 	context->pkt = NULL;
@@ -413,29 +429,16 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 
 	context->start_time = switch_micro_time_now();
 
-	config->g_timebase.num = 1;
-	config->g_timebase.den = 90000;
-	config->g_pass = VPX_RC_ONE_PASS;
 	config->g_w = context->codec_settings.video.width;
 	config->g_h = context->codec_settings.video.height;
 	config->rc_target_bitrate = context->bandwidth;
-	config->g_lag_in_frames = 0;
-	config->kf_max_dist = 360;//2000;
-	threads = cpus / 2;
-	if (threads > 4) threads = 4;
-	if (threads < 1) threads = 1;
-	config->g_threads = threads;
 
 	if (context->is_vp9) {
-		//config->rc_dropframe_thresh = 2;
 		token_parts = (cpus > 1) ? 3 : 0;
 
 		if (context->lossless) {
 			config->rc_min_quantizer = 0;
 			config->rc_max_quantizer = 0;
-		} else {
-			config->rc_min_quantizer = 0;
-			config->rc_max_quantizer = 63;
 		}
 
 		config->temporal_layering_mode = VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING;
@@ -444,63 +447,7 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 		config->ts_periodicity = 1;
 		config->ts_layer_id[0] = 0;
 	} else {
-
-		// settings
-		config->g_profile = 2;
-		config->g_error_resilient = VPX_ERROR_RESILIENT_PARTITIONS;
 		token_parts = (cpus > 1) ? 3 : 0;
-
-		// rate control settings
-		config->rc_dropframe_thresh = 0;
-		config->rc_end_usage = VPX_CBR;
-		//config->g_pass = VPX_RC_ONE_PASS;
-		config->kf_mode = VPX_KF_AUTO;
-		config->kf_max_dist = 360;//1000;
-
-		//config->kf_mode = VPX_KF_DISABLED;
-		config->rc_resize_allowed = 1;
-		//config->rc_min_quantizer = 0;
-		//config->rc_max_quantizer = 63;
-		config->rc_min_quantizer = 0;
-		config->rc_max_quantizer = 63;
-		//Rate control adaptation undershoot control.
-		//	This value, expressed as a percentage of the target bitrate,
-		//	controls the maximum allowed adaptation speed of the codec.
-		//	This factor controls the maximum amount of bits that can be
-		//	subtracted from the target bitrate in order to compensate for
-		//	prior overshoot.
-		//	Valid values in the range 0-1000.
-		config->rc_undershoot_pct = 100;
-		//Rate control adaptation overshoot control.
-		//	This value, expressed as a percentage of the target bitrate,
-		//	controls the maximum allowed adaptation speed of the codec.
-		//	This factor controls the maximum amount of bits that can be
-		//	added to the target bitrate in order to compensate for prior
-		//	undershoot.
-		//	Valid values in the range 0-1000.
-		config->rc_overshoot_pct = 15;
-		//Decoder Buffer Size.
-		//	This value indicates the amount of data that may be buffered
-		//	by the decoding application. Note that this value is expressed
-		//	in units of time (milliseconds). For example, a value of 5000
-		//	indicates that the client will buffer (at least) 5000ms worth
-		//	of encoded data. Use the target bitrate (rc_target_bitrate) to
-		//	convert to bits/bytes, if necessary.
-		config->rc_buf_sz = 5000;
-		//Decoder Buffer Initial Size.
-		//	This value indicates the amount of data that will be buffered
-		//	by the decoding application prior to beginning playback.
-		//	This value is expressed in units of time (milliseconds).
-		//	Use the target bitrate (rc_target_bitrate) to convert to
-		//	bits/bytes, if necessary.
-		config->rc_buf_initial_sz = 1000;
-		//Decoder Buffer Optimal Size.
-		//	This value indicates the amount of data that the encoder should
-		//	try to maintain in the decoder's buffer. This value is expressed
-		//	in units of time (milliseconds).
-		//	Use the target bitrate (rc_target_bitrate) to convert to
-		//	bits/bytes, if necessary.
-		config->rc_buf_optimal_sz = 1000;
 	}
 
 	if (context->encoder_init) {
@@ -510,45 +457,45 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 		}
 	} else if (context->flags & SWITCH_CODEC_FLAG_ENCODE) {
 
-		// #define SHOW(field) fprintf(stderr, "    %-28s = %d\n", #field, config->field);
+		if (vpx_globals.debug) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec: %s\n", vpx_codec_iface_name(context->encoder_interface));
 
-#ifdef SHOW
-		fprintf(stderr, "Codec: %s\n", vpx_codec_iface_name(context->encoder_interface));
+#define SHOW(field) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "    %-28s = %d\n", #field, config->field);
 
-		SHOW(g_usage);
-		SHOW(g_threads);
-		SHOW(g_profile);
-		SHOW(g_w);
-		SHOW(g_h);
-		SHOW(g_bit_depth);
-		SHOW(g_input_bit_depth);
-		SHOW(g_timebase.num);
-		SHOW(g_timebase.den);
-		SHOW(g_error_resilient);
-		SHOW(g_pass);
-		SHOW(g_lag_in_frames);
-		SHOW(rc_dropframe_thresh);
-		SHOW(rc_resize_allowed);
-		SHOW(rc_scaled_width);
-		SHOW(rc_scaled_height);
-		SHOW(rc_resize_up_thresh);
-		SHOW(rc_resize_down_thresh);
-		SHOW(rc_end_usage);
-		SHOW(rc_target_bitrate);
-		SHOW(rc_min_quantizer);
-		SHOW(rc_max_quantizer);
-		SHOW(rc_undershoot_pct);
-		SHOW(rc_overshoot_pct);
-		SHOW(rc_buf_sz);
-		SHOW(rc_buf_initial_sz);
-		SHOW(rc_buf_optimal_sz);
-		SHOW(rc_2pass_vbr_bias_pct);
-		SHOW(rc_2pass_vbr_minsection_pct);
-		SHOW(rc_2pass_vbr_maxsection_pct);
-		SHOW(kf_mode);
-		SHOW(kf_min_dist);
-		SHOW(kf_max_dist);
-#endif
+			SHOW(g_usage);
+			SHOW(g_threads);
+			SHOW(g_profile);
+			SHOW(g_w);
+			SHOW(g_h);
+			SHOW(g_bit_depth);
+			SHOW(g_input_bit_depth);
+			SHOW(g_timebase.num);
+			SHOW(g_timebase.den);
+			SHOW(g_error_resilient);
+			SHOW(g_pass);
+			SHOW(g_lag_in_frames);
+			SHOW(rc_dropframe_thresh);
+			SHOW(rc_resize_allowed);
+			SHOW(rc_scaled_width);
+			SHOW(rc_scaled_height);
+			SHOW(rc_resize_up_thresh);
+			SHOW(rc_resize_down_thresh);
+			SHOW(rc_end_usage);
+			SHOW(rc_target_bitrate);
+			SHOW(rc_min_quantizer);
+			SHOW(rc_max_quantizer);
+			SHOW(rc_undershoot_pct);
+			SHOW(rc_overshoot_pct);
+			SHOW(rc_buf_sz);
+			SHOW(rc_buf_initial_sz);
+			SHOW(rc_buf_optimal_sz);
+			SHOW(rc_2pass_vbr_bias_pct);
+			SHOW(rc_2pass_vbr_minsection_pct);
+			SHOW(rc_2pass_vbr_maxsection_pct);
+			SHOW(kf_mode);
+			SHOW(kf_min_dist);
+			SHOW(kf_max_dist);
+		}
 
 		if (vpx_codec_enc_init(&context->encoder, context->encoder_interface, config, 0 & VPX_CODEC_USE_OUTPUT_PARTITION) != VPX_CODEC_OK) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s init error: [%d:%s]\n", vpx_codec_iface_name(context->encoder_interface), context->encoder.err, context->encoder.err_detail);
@@ -625,11 +572,6 @@ static switch_status_t switch_vpx_init(switch_codec_t *codec, switch_codec_flag_
 		codec->fmtp_out = switch_core_strdup(codec->memory_pool, codec->fmtp_in);
 	}
 
-	if (vpx_codec_enc_config_default(context->encoder_interface, &context->config, 0) != VPX_CODEC_OK) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Encoder config Error\n");
-		return SWITCH_STATUS_FALSE;
-	}
-
 	context->codec_settings.video.width = 320;
 	context->codec_settings.video.height = 240;
 
@@ -826,7 +768,7 @@ static switch_status_t switch_vpx_encode(switch_codec_t *codec, switch_frame_t *
 		height = frame->img->h;
 	}
 
-	if (context->config.g_w != width || context->config.g_h != height) {
+	if (context->codec_settings.video.width != width || context->codec_settings.video.height != height) {
 		context->codec_settings.video.width = width;
 		context->codec_settings.video.height = height;
 		reset_codec_encoder(codec);
@@ -834,7 +776,6 @@ static switch_status_t switch_vpx_encode(switch_codec_t *codec, switch_frame_t *
 		context->need_key_frame = 3;
 	}
 
-
 	if (!context->encoder_init) {
 		if (init_encoder(codec) != SWITCH_STATUS_SUCCESS) {
 			return SWITCH_STATUS_FALSE;
@@ -1386,12 +1327,290 @@ static switch_status_t switch_vpx_destroy(switch_codec_t *codec)
 	return SWITCH_STATUS_SUCCESS;
 }
 
+#define UINTVAL(v) (v > 0 ? v : 0);
+
+static void load_config()
+{
+	switch_xml_t cfg = NULL, xml = NULL;
+
+	vpx_codec_enc_config_default(vpx_codec_vp8_cx(), &vpx_globals.vp8_enc_cfg, 0);
+	vpx_codec_enc_config_default(vpx_codec_vp9_cx(), &vpx_globals.vp9_enc_cfg, 0);
+
+	switch_set_string(vpx_globals.vp8_profile, "vp8");
+	switch_set_string(vpx_globals.vp9_profile, "vp9");
+	switch_set_string(vpx_globals.vp10_profile, "vp10");
+
+	vpx_globals.max_bitrate = 0;
+
+	xml = switch_xml_open_cfg("vpx.conf", &cfg, NULL);
+
+	if (xml) {
+		switch_xml_t settings = switch_xml_child(cfg, "settings");
+		switch_xml_t profiles = switch_xml_child(cfg, "profiles");
+
+		if (settings) {
+			switch_xml_t param;
+
+			for (param = switch_xml_child(settings, "param"); param; param = param->next) {
+				const char *name = switch_xml_attr(param, "name");
+				const char *value = switch_xml_attr(param, "value");
+
+				if (zstr(name) || zstr(value)) continue;
+
+				if (!strcmp(name, "max-bitrate")) {
+					vpx_globals.max_bitrate = switch_parse_bandwidth_string(value);
+				} else if (!strcmp(name, "dec-threads")) {
+					vpx_globals.vp8_dec_cfg.threads = switch_parse_cpu_string(value);
+					vpx_globals.vp9_dec_cfg.threads = switch_parse_cpu_string(value);
+					vpx_globals.vp10_dec_cfg.threads = switch_parse_cpu_string(value);
+				} else if (!strcmp(name, "enc-threads")) {
+					vpx_globals.vp8_enc_cfg.g_threads = switch_parse_cpu_string(value);
+					vpx_globals.vp9_enc_cfg.g_threads = switch_parse_cpu_string(value);
+					vpx_globals.vp10_enc_cfg.g_threads = switch_parse_cpu_string(value);
+				} else if (!strcmp(name, "vp8-profile")) {
+					switch_set_string(vpx_globals.vp8_profile, value);
+				} else if (!strcmp(name, "vp9-profile")) {
+					switch_set_string(vpx_globals.vp9_profile, value);
+				} else if (!strcmp(name, "vp10-profile")) {
+					switch_set_string(vpx_globals.vp10_profile, value);
+				}
+			}
+		}
+
+		if (profiles) {
+			switch_xml_t profile = switch_xml_child(profiles, "profile");
+
+			for (; profile; profile = profile->next) {
+				switch_xml_t param = NULL;
+				const char *profile_name = switch_xml_attr(profile, "name");
+				vpx_codec_dec_cfg_t *dec_cfg = NULL;
+				vpx_codec_enc_cfg_t *enc_cfg = NULL;
+
+				if (zstr(profile_name)) continue;
+
+				if (!strcmp(profile_name, vpx_globals.vp8_profile)) {
+					dec_cfg = &vpx_globals.vp8_dec_cfg;
+					enc_cfg = &vpx_globals.vp8_enc_cfg;
+				} else if (!strcmp(profile_name, vpx_globals.vp9_profile)) {
+					dec_cfg = &vpx_globals.vp9_dec_cfg;
+					enc_cfg = &vpx_globals.vp9_enc_cfg;
+				} else if (!strcmp(profile_name, vpx_globals.vp10_profile)) {
+					dec_cfg = &vpx_globals.vp10_dec_cfg;
+					enc_cfg = &vpx_globals.vp10_enc_cfg;
+				}
+
+				for (param = switch_xml_child(profile, "param"); param; param = param->next) {
+					const char *name = switch_xml_attr(param, "name");
+					const char *value = switch_xml_attr(param, "value");
+					int val;
+
+					if (!enc_cfg || !dec_cfg) break;
+					if (zstr(name) || zstr(value)) continue;
+
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s: %s = %s\n", profile_name, name, value);
+
+					val = atoi(value);
+
+					if (!strcmp(name, "dec-threads")) {
+						dec_cfg->threads = switch_parse_cpu_string(value);
+					} else if (!strcmp(name, "enc-threads")) {
+						enc_cfg->g_threads = switch_parse_cpu_string(value);
+					} else if (!strcmp(name, "g-profile")) {
+						enc_cfg->g_profile = UINTVAL(val);
+					} else if (!strcmp(name, "g-timebase")) {
+						int num = 0;
+						int den = 0;
+						char *slash = strchr(value, '/');
+
+						num = UINTVAL(val);
+
+						if (slash) {
+							slash++;
+							den = atoi(slash);
+
+							if (den < 0) den = 0;
+						}
+
+						if (num && den) {
+							enc_cfg->g_timebase.num = num;
+							enc_cfg->g_timebase.den = den;
+						}
+					} else if (!strcmp(name, "g-error-resilient")) {
+						char *s = strdup(value);
+						vpx_codec_er_flags_t res = 0;
+
+						if (s) {
+							int argc;
+							char *argv[10];
+							int i;
+
+							argc = switch_separate_string(s, '|', argv, (sizeof(argv) / sizeof(argv[0])));
+
+							for (i = 0; i < argc; i++) {
+								if (!strcasecmp(argv[i], "DEFAULT")) {
+									res |= VPX_ERROR_RESILIENT_DEFAULT;
+								} else if (!strcasecmp(argv[i], "PARTITIONS")) {
+									res |= VPX_ERROR_RESILIENT_PARTITIONS;
+								}
+							}
+
+							free(s);
+							enc_cfg->g_error_resilient = res;
+						}
+					} else if (!strcmp(name, "g-pass")) {
+						int pass = 0;
+
+						if (!strcasecmp(value, "ONE_PASS")) {
+							pass = VPX_RC_ONE_PASS;
+						} else if (!strcasecmp(value, "FIRST_PASS")) {
+							pass = VPX_RC_FIRST_PASS;
+						} else if (!strcasecmp(value, "LAST_PASS")) {
+							pass = VPX_RC_FIRST_PASS;
+						}
+
+						enc_cfg->g_pass = pass;
+					} else if (!strcmp(name, "g-lag-in-frames")) {
+						enc_cfg->g_lag_in_frames = UINTVAL(val);
+					} else if (!strcmp(name, "rc_dropframe_thresh")) {
+						enc_cfg->rc_dropframe_thresh = UINTVAL(val);
+					} else if (!strcmp(name, "rc-resize-allowed")) {
+						enc_cfg->rc_resize_allowed = UINTVAL(val);
+					} else if (!strcmp(name, "rc-scaled-width")) {
+						enc_cfg->rc_scaled_width = UINTVAL(val);
+					} else if (!strcmp(name, "rc-scaled-height")) {
+						enc_cfg->rc_scaled_height = UINTVAL(val);
+					} else if (!strcmp(name, "rc-resize-up-thresh")) {
+						enc_cfg->rc_resize_up_thresh = UINTVAL(val);
+					} else if (!strcmp(name, "rc-resize-down-thresh")) {
+						enc_cfg->rc_resize_down_thresh = UINTVAL(val);
+					} else if (!strcmp(name, "rc-end-usage")) {
+						int mode = 0;
+
+						if (!strcasecmp(value, "VBR")) {
+							mode = VPX_VBR;
+						} else if (!strcasecmp(value, "CBR")) {
+							mode = VPX_CBR;
+						} else if (!strcasecmp(value, "CQ")) {
+							mode = VPX_CQ;
+						} else if (!strcasecmp(value, "Q")) {
+							mode = VPX_Q;
+						}
+						enc_cfg->rc_end_usage = mode;
+					} else if (!strcmp(name, "rc-target-bitrate")) {
+						int br = switch_parse_bandwidth_string(value);
+
+						if (br > 0) {
+							enc_cfg->rc_target_bitrate = br;
+						}
+					} else if (!strcmp(name, "rc-min-quantizer")) {
+						enc_cfg->rc_min_quantizer = UINTVAL(val);
+					} else if (!strcmp(name, "rc-max-quantizer")) {
+						enc_cfg->rc_max_quantizer = UINTVAL(val);
+					} else if (!strcmp(name, "rc-undershoot-pct")) {
+						enc_cfg->rc_undershoot_pct = UINTVAL(val);
+					} else if (!strcmp(name, "rc-overshoot-pct")) {
+						enc_cfg->rc_overshoot_pct = UINTVAL(val);
+					} else if (!strcmp(name, "rc-buf-sz")) {
+						enc_cfg->rc_buf_sz = UINTVAL(val);
+					} else if (!strcmp(name, "rc-buf-initial-sz")) {
+						enc_cfg->rc_buf_initial_sz = UINTVAL(val);
+					} else if (!strcmp(name, "rc-buf-optimal-sz")) {
+						enc_cfg->rc_buf_optimal_sz = UINTVAL(val);
+					} else if (!strcmp(name, "rc-2pass-vbr-bias-pct")) {
+						enc_cfg->rc_2pass_vbr_bias_pct = UINTVAL(val);
+					} else if (!strcmp(name, "rc-2pass-vbr-minsection-pct")) {
+						enc_cfg->rc_2pass_vbr_minsection_pct = UINTVAL(val);
+					} else if (!strcmp(name, "rc-2pass-vbr-maxsection-pct")) {
+						enc_cfg->rc_2pass_vbr_maxsection_pct = UINTVAL(val);
+					} else if (!strcmp(name, "kf-mode")) {
+						int mode = 0;
+
+						if (!strcasecmp(value, "AUTO")) {
+							mode = VPX_KF_AUTO;
+						} else if (!strcasecmp(value, "DISABLED")) {
+							mode = VPX_KF_DISABLED;
+						}
+
+						enc_cfg->kf_mode = mode;
+					} else if (!strcmp(name, "kf-min-dist")) {
+						enc_cfg->kf_min_dist = UINTVAL(val);
+					} else if (!strcmp(name, "kf-max-dist")) {
+						enc_cfg->kf_max_dist = UINTVAL(val);
+					} else if (!strcmp(name, "ss-number-layers")) {
+						enc_cfg->ss_number_layers = UINTVAL(val);
+					} else if (!strcmp(name, "ts-number-layers")) {
+						enc_cfg->ts_number_layers = UINTVAL(val);
+					} else if (!strcmp(name, "ts-periodicity")) {
+						enc_cfg->ts_periodicity = UINTVAL(val);
+					} else if (!strcmp(name, "temporal-layering-mode")) {
+						enc_cfg->temporal_layering_mode = UINTVAL(val);
+					}
+				} // for param
+			} // for profile
+		} // profiles
+
+		switch_xml_free(xml);
+	} // xml
+
+	if (vpx_globals.max_bitrate <= 0) {
+		vpx_globals.max_bitrate = switch_calc_bitrate(1920, 1080, 5, 60);
+	}
+
+	if (!vpx_globals.vp8_enc_cfg.g_threads) vpx_globals.vp8_enc_cfg.g_threads = 1;
+	if (!vpx_globals.vp8_dec_cfg.threads) vpx_globals.vp8_dec_cfg.threads = switch_parse_cpu_string("cpu/2/4");
+	if (!vpx_globals.vp9_enc_cfg.g_threads) vpx_globals.vp9_enc_cfg.g_threads = vpx_globals.vp8_enc_cfg.g_threads;
+	if (!vpx_globals.vp9_dec_cfg.threads) vpx_globals.vp9_dec_cfg.threads = vpx_globals.vp8_dec_cfg.threads;
+	if (!vpx_globals.vp10_enc_cfg.g_threads) vpx_globals.vp10_enc_cfg.g_threads = vpx_globals.vp8_enc_cfg.g_threads;
+	if (!vpx_globals.vp10_dec_cfg.threads) vpx_globals.vp10_dec_cfg.threads = vpx_globals.vp8_dec_cfg.threads;
+}
+
+#define VPX_API_SYNTAX ">"
+SWITCH_STANDARD_API(vpx_api_function)
+{
+	if (session) {
+		return SWITCH_STATUS_FALSE;
+	}
+
+	if (zstr(cmd)) {
+		goto usage;
+	}
+
+	if (!strcasecmp(cmd, "reload")) {
+		const char *err;
+
+		switch_xml_reload(&err);
+		stream->write_function(stream, "Reload XML [%s]\n", err);
+
+		load_config();
+		stream->write_function(stream, "+OK\n");
+	} else if (!strcasecmp(cmd, "debug")) {
+		stream->write_function(stream, "+OK debug %s\n", vpx_globals.debug ? "on" : "off");
+	} else if (!strcasecmp(cmd, "debug on")) {
+		vpx_globals.debug = 1;
+		stream->write_function(stream, "+OK debug on\n");
+	} else if (!strcasecmp(cmd, "debug off")) {
+		vpx_globals.debug = 0;
+		stream->write_function(stream, "+OK debug off\n");
+	}
+
+	return SWITCH_STATUS_SUCCESS;
+
+  usage:
+	stream->write_function(stream, "USAGE: %s\n", VPX_API_SYNTAX);
+	return SWITCH_STATUS_SUCCESS;
+}
+
 SWITCH_MODULE_LOAD_FUNCTION(mod_vpx_load)
 {
 	switch_codec_interface_t *codec_interface;
+	switch_api_interface_t *vpx_api_interface;
+
+	memset(&vpx_globals, 0, sizeof(struct vpx_globals));
+	load_config();
 
 	/* connect my internal structure to the blank pointer passed to me */
 	*module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
 	SWITCH_ADD_CODEC(codec_interface, "VP8 Video");
 	switch_core_codec_add_video_implementation(pool, codec_interface, 99, "VP8", NULL,
 											   switch_vpx_init, switch_vpx_encode, switch_vpx_decode, switch_vpx_control, switch_vpx_destroy);
@@ -1399,6 +1618,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_vpx_load)
 	switch_core_codec_add_video_implementation(pool, codec_interface, 99, "VP9", NULL,
 											   switch_vpx_init, switch_vpx_encode, switch_vpx_decode, switch_vpx_control, switch_vpx_destroy);
 
+	SWITCH_ADD_API(vpx_api_interface, "vpx",
+				   "VPX API", vpx_api_function, VPX_API_SYNTAX);
+
 	/* indicate that the module should continue to be loaded */
 	return SWITCH_STATUS_SUCCESS;
 }

From 32b155941788b8b1e7b3a643c530416f2159783f Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Wed, 13 Jun 2018 21:55:25 +0800
Subject: [PATCH 248/264] FS-11189 add vpx config

---
 conf/vanilla/autoload_configs/vpx.conf.xml | 100 +++++++++++++++++++++
 1 file changed, 100 insertions(+)
 create mode 100644 conf/vanilla/autoload_configs/vpx.conf.xml

diff --git a/conf/vanilla/autoload_configs/vpx.conf.xml b/conf/vanilla/autoload_configs/vpx.conf.xml
new file mode 100644
index 0000000000..eeb6e20584
--- /dev/null
+++ b/conf/vanilla/autoload_configs/vpx.conf.xml
@@ -0,0 +1,100 @@
+
+  
+    
+    
+
+    
+    
+    
+    
+    
+    
+  
+
+  
+    
+      
+      
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+    
+
+    
+      
+      
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+    
+
+    
+    
+  
+

From c58da50f4482af96533d25ae751f42daed4dfb6a Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Thu, 14 Jun 2018 08:14:30 +0800
Subject: [PATCH 249/264] FS-11189 tweak log

---
 src/switch_vpx.c | 90 ++++++++++++++++++++++++++++--------------------
 1 file changed, 53 insertions(+), 37 deletions(-)

diff --git a/src/switch_vpx.c b/src/switch_vpx.c
index 3cb3f861a7..4fa899aa9e 100644
--- a/src/switch_vpx.c
+++ b/src/switch_vpx.c
@@ -51,6 +51,45 @@
 #define SLICE_SIZE SWITCH_DEFAULT_VIDEO_SIZE
 #define KEY_FRAME_MIN_FREQ 250000
 
+#define SHOW(cfg, field) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-28s = %d\n", #field, cfg->field);
+
+static void show_enc_config(vpx_codec_enc_cfg_t *cfg)
+{
+	SHOW(cfg, g_usage);
+	SHOW(cfg, g_threads);
+	SHOW(cfg, g_profile);
+	SHOW(cfg, g_w);
+	SHOW(cfg, g_h);
+	SHOW(cfg, g_bit_depth);
+	SHOW(cfg, g_input_bit_depth);
+	SHOW(cfg, g_timebase.num);
+	SHOW(cfg, g_timebase.den);
+	SHOW(cfg, g_error_resilient);
+	SHOW(cfg, g_pass);
+	SHOW(cfg, g_lag_in_frames);
+	SHOW(cfg, rc_dropframe_thresh);
+	SHOW(cfg, rc_resize_allowed);
+	SHOW(cfg, rc_scaled_width);
+	SHOW(cfg, rc_scaled_height);
+	SHOW(cfg, rc_resize_up_thresh);
+	SHOW(cfg, rc_resize_down_thresh);
+	SHOW(cfg, rc_end_usage);
+	SHOW(cfg, rc_target_bitrate);
+	SHOW(cfg, rc_min_quantizer);
+	SHOW(cfg, rc_max_quantizer);
+	SHOW(cfg, rc_undershoot_pct);
+	SHOW(cfg, rc_overshoot_pct);
+	SHOW(cfg, rc_buf_sz);
+	SHOW(cfg, rc_buf_initial_sz);
+	SHOW(cfg, rc_buf_optimal_sz);
+	SHOW(cfg, rc_2pass_vbr_bias_pct);
+	SHOW(cfg, rc_2pass_vbr_minsection_pct);
+	SHOW(cfg, rc_2pass_vbr_maxsection_pct);
+	SHOW(cfg, kf_mode);
+	SHOW(cfg, kf_min_dist);
+	SHOW(cfg, kf_max_dist);
+}
+
 /*	http://tools.ietf.org/html/draft-ietf-payload-vp8-10
 
 	The first octets after the RTP header are the VP8 payload descriptor, with the following structure.
@@ -458,43 +497,8 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 	} else if (context->flags & SWITCH_CODEC_FLAG_ENCODE) {
 
 		if (vpx_globals.debug) {
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec: %s\n", vpx_codec_iface_name(context->encoder_interface));
-
-#define SHOW(field) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "    %-28s = %d\n", #field, config->field);
-
-			SHOW(g_usage);
-			SHOW(g_threads);
-			SHOW(g_profile);
-			SHOW(g_w);
-			SHOW(g_h);
-			SHOW(g_bit_depth);
-			SHOW(g_input_bit_depth);
-			SHOW(g_timebase.num);
-			SHOW(g_timebase.den);
-			SHOW(g_error_resilient);
-			SHOW(g_pass);
-			SHOW(g_lag_in_frames);
-			SHOW(rc_dropframe_thresh);
-			SHOW(rc_resize_allowed);
-			SHOW(rc_scaled_width);
-			SHOW(rc_scaled_height);
-			SHOW(rc_resize_up_thresh);
-			SHOW(rc_resize_down_thresh);
-			SHOW(rc_end_usage);
-			SHOW(rc_target_bitrate);
-			SHOW(rc_min_quantizer);
-			SHOW(rc_max_quantizer);
-			SHOW(rc_undershoot_pct);
-			SHOW(rc_overshoot_pct);
-			SHOW(rc_buf_sz);
-			SHOW(rc_buf_initial_sz);
-			SHOW(rc_buf_optimal_sz);
-			SHOW(rc_2pass_vbr_bias_pct);
-			SHOW(rc_2pass_vbr_minsection_pct);
-			SHOW(rc_2pass_vbr_maxsection_pct);
-			SHOW(kf_mode);
-			SHOW(kf_min_dist);
-			SHOW(kf_max_dist);
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Codec: %s\n", vpx_codec_iface_name(context->encoder_interface));
+			show_enc_config(config);
 		}
 
 		if (vpx_codec_enc_init(&context->encoder, context->encoder_interface, config, 0 & VPX_CODEC_USE_OUTPUT_PARTITION) != VPX_CODEC_OK) {
@@ -1582,6 +1586,18 @@ SWITCH_STANDARD_API(vpx_api_function)
 		stream->write_function(stream, "Reload XML [%s]\n", err);
 
 		load_config();
+
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp8-dec-threads", vpx_globals.vp8_dec_cfg.threads);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp9-dec-threads", vpx_globals.vp9_dec_cfg.threads);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp10-dec-threads", vpx_globals.vp10_dec_cfg.threads);
+
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Codec: %s\n", vpx_codec_iface_name(vpx_codec_vp8_cx()));
+		show_enc_config(&vpx_globals.vp8_enc_cfg);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Codec: %s\n", vpx_codec_iface_name(vpx_codec_vp9_cx()));
+		show_enc_config(&vpx_globals.vp9_enc_cfg);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Codec: VP10\n");
+		show_enc_config(&vpx_globals.vp10_enc_cfg);
+
 		stream->write_function(stream, "+OK\n");
 	} else if (!strcasecmp(cmd, "debug")) {
 		stream->write_function(stream, "+OK debug %s\n", vpx_globals.debug ? "on" : "off");

From 1eacc9f418862db0c1a680bfed7c736ab4f17548 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Thu, 14 Jun 2018 10:49:33 +0800
Subject: [PATCH 250/264] FS-11189 add vpx codec specific and debug controls

---
 src/switch_vpx.c | 60 ++++++++++++++++++++++++++++++++----------------
 1 file changed, 40 insertions(+), 20 deletions(-)

diff --git a/src/switch_vpx.c b/src/switch_vpx.c
index 4fa899aa9e..08a3841a83 100644
--- a/src/switch_vpx.c
+++ b/src/switch_vpx.c
@@ -306,6 +306,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_vpx_load);
 SWITCH_MODULE_DEFINITION(CORE_VPX_MODULE, mod_vpx_load, NULL, NULL);
 
 struct vpx_context {
+	int debug;
 	switch_codec_t *codec;
 	int is_vp9;
 	vp9_info_t vp9;
@@ -840,11 +841,10 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
 	uint8_t DES;
 	//	uint8_t PID;
 	int len;
-#if 0
-	int key = 0;
 
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
-					  "VIDEO VPX: seq: %d ts: %u len: %ld %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x mark: %d\n",
+	if (context->debug > 0) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, context->debug,
+					  "VIDEO VPX: seq: %d ts: %u len: %u %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x mark: %d\n",
 					  frame->seq, frame->timestamp, frame->datalen,
 					  *((uint8_t *)data), *((uint8_t *)data + 1),
 					  *((uint8_t *)data + 2), *((uint8_t *)data + 3),
@@ -852,8 +852,7 @@ static switch_status_t buffer_vp8_packets(vpx_context_t *context, switch_frame_t
 					  *((uint8_t *)data + 6), *((uint8_t *)data + 7),
 					  *((uint8_t *)data + 8), *((uint8_t *)data + 9),
 					  *((uint8_t *)data + 10), frame->m);
-#endif
-
+	}
 
 	DES = *data;
 	data++;
@@ -931,8 +930,8 @@ static switch_status_t buffer_vp9_packets(vpx_context_t *context, switch_frame_t
 	vp9_payload_descriptor_t *desc = (vp9_payload_descriptor_t *)vp9;
 	int len = 0;
 
-#ifdef DEBUG_VP9
-	switch_log_printf(SWITCH_CHANNEL_LOG, frame->m ? SWITCH_LOG_ERROR : SWITCH_LOG_INFO,
+	if (context->debug > 0) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, frame->m ? SWITCH_LOG_ERROR : SWITCH_LOG_INFO,
 					"[%02x %02x %02x %02x] m=%d len=%4d seq=%d ts=%u ssrc=%u "
 					"have_pid=%d "
 					"have_p_layer=%d "
@@ -951,7 +950,7 @@ static switch_status_t buffer_vp9_packets(vpx_context_t *context, switch_frame_t
 					desc->end,
 					desc->have_ss,
 					desc->zero);
-#endif
+	}
 
 	vp9++;
 
@@ -1066,12 +1065,12 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	int is_start = 0, is_keyframe = 0, get_refresh = 0;
 
-#if 0
-	vp9_payload_descriptor_t *desc = (vp9_payload_descriptor_t *)frame->data;
-	uint8_t *data = frame->data;
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%02x %02x %02x %02x m=%d start=%d end=%d m=%d len=%d\n",
-		*data, *(data+1), *(data+2), *(data+3), frame->m, desc->start, desc->end, frame->m, frame->datalen);
-#endif
+	if (context->debug > 0 && context->debug < 4) {
+		vp9_payload_descriptor_t *desc = (vp9_payload_descriptor_t *)frame->data;
+		uint8_t *data = frame->data;
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%02x %02x %02x %02x m=%d start=%d end=%d m=%d len=%d\n",
+			*data, *(data+1), *(data+2), *(data+3), frame->m, desc->start, desc->end, frame->m, frame->datalen);
+	}
 
 	if (context->is_vp9) {
 		is_keyframe = IS_VP9_KEY_FRAME(*(unsigned char *)frame->data);
@@ -1090,10 +1089,6 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
 	} else { // vp8
 		is_start = (*(unsigned char *)frame->data & 0x10);
 		is_keyframe = IS_VP8_KEY_FRAME((uint8_t *)frame->data);
-
-#ifdef DEBUG_VP9
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "VP8\n");
-#endif
 	}
 
     if (!is_keyframe && context->got_key_frame <= 0) {
@@ -1106,7 +1101,9 @@ static switch_status_t switch_vpx_decode(switch_codec_t *codec, switch_frame_t *
 		}
     }
 
-	// if (is_keyframe) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "got key %d\n", context->got_key_frame);
+	if (context->debug > 0 && is_keyframe) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "GOT KEY FRAME %d\n", context->got_key_frame);
+	}
 
 	if (context->need_decoder_reset != 0) {
 		vpx_codec_destroy(&context->decoder);
@@ -1294,6 +1291,29 @@ static switch_status_t switch_vpx_control(switch_codec_t *codec,
 			}
 		}
 		break;
+	case SCC_CODEC_SPECIFIC:
+		{
+			const char *command = (const char *)cmd_data;
+
+			if (ctype == SCCT_INT) {
+			} else if (ctype == SCCT_STRING && !zstr(command)) {
+				if (!strcasecmp(command, "VP8E_SET_CPUUSED")) {
+					vpx_codec_control(&context->encoder, VP8E_SET_CPUUSED, *(int *)cmd_arg);
+				} else if (!strcasecmp(command, "VP8E_SET_TOKEN_PARTITIONS")) {
+					vpx_codec_control(&context->encoder, VP8E_SET_TOKEN_PARTITIONS, *(int *)cmd_arg);
+				} else if (!strcasecmp(command, "VP8E_SET_NOISE_SENSITIVITY")) {
+					vpx_codec_control(&context->encoder, VP8E_SET_NOISE_SENSITIVITY, *(int *)cmd_arg);
+				}
+			}
+
+		}
+		break;
+	case SCC_DEBUG:
+		{
+			int32_t level = *((uint32_t *) cmd_data);
+			context->debug = level;
+		}
+		break;
 	default:
 		break;
 	}

From e19687e0f24d20c2388e8bcea436e40cc4b4a6a8 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Thu, 14 Jun 2018 16:18:45 +0800
Subject: [PATCH 251/264] FS-11189 refactor and add more params

---
 conf/vanilla/autoload_configs/vpx.conf.xml |  20 +++
 src/switch_vpx.c                           | 178 ++++++++++++++-------
 2 files changed, 136 insertions(+), 62 deletions(-)

diff --git a/conf/vanilla/autoload_configs/vpx.conf.xml b/conf/vanilla/autoload_configs/vpx.conf.xml
index eeb6e20584..cdf677710a 100644
--- a/conf/vanilla/autoload_configs/vpx.conf.xml
+++ b/conf/vanilla/autoload_configs/vpx.conf.xml
@@ -51,6 +51,16 @@
       
       
       
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
     
 
     
@@ -92,6 +102,16 @@
       
       
       
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
     
 
     
diff --git a/src/switch_vpx.c b/src/switch_vpx.c
index 08a3841a83..ae1cc6ddab 100644
--- a/src/switch_vpx.c
+++ b/src/switch_vpx.c
@@ -51,10 +51,33 @@
 #define SLICE_SIZE SWITCH_DEFAULT_VIDEO_SIZE
 #define KEY_FRAME_MIN_FREQ 250000
 
+typedef struct my_vpx_cfg_s {
+	int lossless;
+	int cpuused;
+	int token_parts;
+	int static_thresh;
+	int noise_sensitivity;
+	int max_intra_bitrate_pct;
+	vp9e_tune_content tune_content;
+
+	vpx_codec_enc_cfg_t enc_cfg;
+	vpx_codec_dec_cfg_t dec_cfg;
+} my_vpx_cfg_t;
+
 #define SHOW(cfg, field) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-28s = %d\n", #field, cfg->field);
 
-static void show_enc_config(vpx_codec_enc_cfg_t *cfg)
+static void show_config(my_vpx_cfg_t *my_cfg)
 {
+	vpx_codec_enc_cfg_t *cfg = &my_cfg->enc_cfg;
+
+	SHOW(my_cfg, lossless);
+	SHOW(my_cfg, cpuused);
+	SHOW(my_cfg, token_parts);
+	SHOW(my_cfg, static_thresh);
+	SHOW(my_cfg, noise_sensitivity);
+	SHOW(my_cfg, max_intra_bitrate_pct);
+	SHOW(my_cfg, tune_content);
+
 	SHOW(cfg, g_usage);
 	SHOW(cfg, g_threads);
 	SHOW(cfg, g_profile);
@@ -360,12 +383,10 @@ struct vpx_globals {
 	char vp8_profile[20];
 	char vp9_profile[20];
 	char vp10_profile[20];
-	vpx_codec_enc_cfg_t vp8_enc_cfg;
-	vpx_codec_dec_cfg_t vp8_dec_cfg;
-	vpx_codec_enc_cfg_t vp9_enc_cfg;
-	vpx_codec_dec_cfg_t vp9_dec_cfg;
-	vpx_codec_enc_cfg_t vp10_enc_cfg;
-	vpx_codec_dec_cfg_t vp10_dec_cfg;
+
+	my_vpx_cfg_t vp8;
+	my_vpx_cfg_t vp9;
+	my_vpx_cfg_t vp10;
 };
 
 struct vpx_globals vpx_globals = { 0 };
@@ -385,10 +406,10 @@ static switch_status_t init_decoder(switch_codec_t *codec)
 		//}
 
 		if (context->is_vp9) {
-			cfg.threads = vpx_globals.vp9_dec_cfg.threads;
+			cfg.threads = vpx_globals.vp9.dec_cfg.threads;
 		} else {
 			// dec_flags = VPX_CODEC_USE_POSTPROC;
-			cfg.threads = vpx_globals.vp8_dec_cfg.threads;
+			cfg.threads = vpx_globals.vp8.dec_cfg.threads;
 		}
 
 		if (vpx_codec_dec_init(&context->decoder, context->decoder_interface, &cfg, dec_flags) != VPX_CODEC_OK) {
@@ -429,13 +450,16 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 	vpx_codec_enc_cfg_t *config = &context->config;
 	int token_parts = 1;
 	int cpus = switch_core_cpu_count();
-	vpx_codec_enc_cfg_t *vp8_enc_cfg = &vpx_globals.vp8_enc_cfg;
-	vpx_codec_enc_cfg_t *vp9_enc_cfg = &vpx_globals.vp9_enc_cfg;
+	vpx_codec_enc_cfg_t *vp8_enc_cfg = &vpx_globals.vp8.enc_cfg;
+	vpx_codec_enc_cfg_t *vp9_enc_cfg = &vpx_globals.vp9.enc_cfg;
+	my_vpx_cfg_t *my_cfg = NULL;
 
 	if (context->is_vp9) {
 		*config = *vp9_enc_cfg;
+		my_cfg = &vpx_globals.vp9;
 	} else {
 		*config = *vp8_enc_cfg;
+		my_cfg = &vpx_globals.vp8;
 	}
 
 	if (!context->codec_settings.video.width) {
@@ -473,8 +497,12 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 	config->g_h = context->codec_settings.video.height;
 	config->rc_target_bitrate = context->bandwidth;
 
+	token_parts = (cpus > 1) ? 3 : 0;
+
 	if (context->is_vp9) {
-		token_parts = (cpus > 1) ? 3 : 0;
+		if (vpx_globals.vp9.token_parts > 0) {
+			token_parts = vpx_globals.vp9.token_parts;
+		}
 
 		if (context->lossless) {
 			config->rc_min_quantizer = 0;
@@ -487,7 +515,9 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 		config->ts_periodicity = 1;
 		config->ts_layer_id[0] = 0;
 	} else {
-		token_parts = (cpus > 1) ? 3 : 0;
+		if (vpx_globals.vp8.token_parts > 0) {
+			token_parts = vpx_globals.vp8.token_parts;
+		}
 	}
 
 	if (context->encoder_init) {
@@ -499,7 +529,7 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 
 		if (vpx_globals.debug) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Codec: %s\n", vpx_codec_iface_name(context->encoder_interface));
-			show_enc_config(config);
+			show_config(my_cfg);
 		}
 
 		if (vpx_codec_enc_init(&context->encoder, context->encoder_interface, config, 0 & VPX_CODEC_USE_OUTPUT_PARTITION) != VPX_CODEC_OK) {
@@ -509,34 +539,24 @@ static switch_status_t init_encoder(switch_codec_t *codec)
 
 		context->encoder_init = 1;
 
+		vpx_codec_control(&context->encoder, VP8E_SET_TOKEN_PARTITIONS, token_parts);
+
 		if (context->is_vp9) {
-			if (context->lossless) {
+			if (context->lossless || vpx_globals.vp9.lossless) {
 				vpx_codec_control(&context->encoder, VP9E_SET_LOSSLESS, 1);
-				vpx_codec_control(&context->encoder, VP8E_SET_CPUUSED, -6);
-			} else {
-				vpx_codec_control(&context->encoder, VP8E_SET_CPUUSED, -8);
 			}
 
-			vpx_codec_control(&context->encoder, VP8E_SET_STATIC_THRESHOLD, 1000);
-			vpx_codec_control(&context->encoder, VP8E_SET_TOKEN_PARTITIONS, token_parts);
-			vpx_codec_control(&context->encoder, VP9E_SET_TUNE_CONTENT, VP9E_CONTENT_SCREEN);
-
+			vpx_codec_control(&context->encoder, VP8E_SET_CPUUSED, vpx_globals.vp9.cpuused);
+			vpx_codec_control(&context->encoder, VP8E_SET_STATIC_THRESHOLD, vpx_globals.vp9.static_thresh);
+			vpx_codec_control(&context->encoder, VP9E_SET_TUNE_CONTENT, vpx_globals.vp9.tune_content);
 		} else {
-			// The static threshold imposes a change threshold on blocks below which they will be skipped by the encoder.
-			vpx_codec_control(&context->encoder, VP8E_SET_STATIC_THRESHOLD, 100);
-			//Set cpu usage, a bit lower than normal (-6) but higher than android (-12)
-			vpx_codec_control(&context->encoder, VP8E_SET_CPUUSED, -6);
-			vpx_codec_control(&context->encoder, VP8E_SET_TOKEN_PARTITIONS, token_parts);
+			vpx_codec_control(&context->encoder, VP8E_SET_STATIC_THRESHOLD, vpx_globals.vp8.static_thresh);
+			vpx_codec_control(&context->encoder, VP8E_SET_CPUUSED, vpx_globals.vp8.cpuused);
+			vpx_codec_control(&context->encoder, VP8E_SET_NOISE_SENSITIVITY, vpx_globals.vp8.noise_sensitivity);
 
-			// Enable noise reduction
-			vpx_codec_control(&context->encoder, VP8E_SET_NOISE_SENSITIVITY, 1);
-			//Set max data rate for Intra frames.
-			//	This value controls additional clamping on the maximum size of a keyframe.
-			//	It is expressed as a percentage of the average per-frame bitrate, with the
-			//	special (and default) value 0 meaning unlimited, or no additional clamping
-			//	beyond the codec's built-in algorithm.
-			//	For example, to allocate no more than 4.5 frames worth of bitrate to a keyframe, set this to 450.
-			//vpx_codec_control(&context->encoder, VP8E_SET_MAX_INTRA_BITRATE_PCT, 0);
+			if (vpx_globals.vp8.max_intra_bitrate_pct) {
+				vpx_codec_control(&context->encoder, VP8E_SET_MAX_INTRA_BITRATE_PCT, vpx_globals.vp8.max_intra_bitrate_pct);
+			}
 		}
 	}
 
@@ -1357,14 +1377,17 @@ static void load_config()
 {
 	switch_xml_t cfg = NULL, xml = NULL;
 
-	vpx_codec_enc_config_default(vpx_codec_vp8_cx(), &vpx_globals.vp8_enc_cfg, 0);
-	vpx_codec_enc_config_default(vpx_codec_vp9_cx(), &vpx_globals.vp9_enc_cfg, 0);
+	vpx_codec_enc_config_default(vpx_codec_vp8_cx(), &vpx_globals.vp8.enc_cfg, 0);
+	vpx_codec_enc_config_default(vpx_codec_vp9_cx(), &vpx_globals.vp9.enc_cfg, 0);
 
 	switch_set_string(vpx_globals.vp8_profile, "vp8");
 	switch_set_string(vpx_globals.vp9_profile, "vp9");
 	switch_set_string(vpx_globals.vp10_profile, "vp10");
 
 	vpx_globals.max_bitrate = 0;
+	vpx_globals.vp8.cpuused = -6;
+	vpx_globals.vp9.cpuused = -6;
+	vpx_globals.vp10.cpuused = -6;
 
 	xml = switch_xml_open_cfg("vpx.conf", &cfg, NULL);
 
@@ -1384,13 +1407,13 @@ static void load_config()
 				if (!strcmp(name, "max-bitrate")) {
 					vpx_globals.max_bitrate = switch_parse_bandwidth_string(value);
 				} else if (!strcmp(name, "dec-threads")) {
-					vpx_globals.vp8_dec_cfg.threads = switch_parse_cpu_string(value);
-					vpx_globals.vp9_dec_cfg.threads = switch_parse_cpu_string(value);
-					vpx_globals.vp10_dec_cfg.threads = switch_parse_cpu_string(value);
+					vpx_globals.vp8.dec_cfg.threads = switch_parse_cpu_string(value);
+					vpx_globals.vp9.dec_cfg.threads = switch_parse_cpu_string(value);
+					vpx_globals.vp10.dec_cfg.threads = switch_parse_cpu_string(value);
 				} else if (!strcmp(name, "enc-threads")) {
-					vpx_globals.vp8_enc_cfg.g_threads = switch_parse_cpu_string(value);
-					vpx_globals.vp9_enc_cfg.g_threads = switch_parse_cpu_string(value);
-					vpx_globals.vp10_enc_cfg.g_threads = switch_parse_cpu_string(value);
+					vpx_globals.vp8.enc_cfg.g_threads = switch_parse_cpu_string(value);
+					vpx_globals.vp9.enc_cfg.g_threads = switch_parse_cpu_string(value);
+					vpx_globals.vp10.enc_cfg.g_threads = switch_parse_cpu_string(value);
 				} else if (!strcmp(name, "vp8-profile")) {
 					switch_set_string(vpx_globals.vp8_profile, value);
 				} else if (!strcmp(name, "vp9-profile")) {
@@ -1409,20 +1432,23 @@ static void load_config()
 				const char *profile_name = switch_xml_attr(profile, "name");
 				vpx_codec_dec_cfg_t *dec_cfg = NULL;
 				vpx_codec_enc_cfg_t *enc_cfg = NULL;
+				my_vpx_cfg_t *my_cfg = NULL;
 
 				if (zstr(profile_name)) continue;
 
 				if (!strcmp(profile_name, vpx_globals.vp8_profile)) {
-					dec_cfg = &vpx_globals.vp8_dec_cfg;
-					enc_cfg = &vpx_globals.vp8_enc_cfg;
+					my_cfg = &vpx_globals.vp8;
 				} else if (!strcmp(profile_name, vpx_globals.vp9_profile)) {
-					dec_cfg = &vpx_globals.vp9_dec_cfg;
-					enc_cfg = &vpx_globals.vp9_enc_cfg;
+					my_cfg = &vpx_globals.vp9;
 				} else if (!strcmp(profile_name, vpx_globals.vp10_profile)) {
-					dec_cfg = &vpx_globals.vp10_dec_cfg;
-					enc_cfg = &vpx_globals.vp10_enc_cfg;
+					my_cfg = &vpx_globals.vp10;
 				}
 
+				if (!my_cfg) continue;
+
+				dec_cfg = &my_cfg->dec_cfg;
+				enc_cfg = &my_cfg->enc_cfg;
+
 				for (param = switch_xml_child(profile, "param"); param; param = param->next) {
 					const char *name = switch_xml_attr(param, "name");
 					const char *value = switch_xml_attr(param, "value");
@@ -1568,6 +1594,34 @@ static void load_config()
 						enc_cfg->ts_periodicity = UINTVAL(val);
 					} else if (!strcmp(name, "temporal-layering-mode")) {
 						enc_cfg->temporal_layering_mode = UINTVAL(val);
+					} else if (!strcmp(name, "lossless")) {
+						my_cfg->lossless = UINTVAL(val);
+					} else if (!strcmp(name, "cpuused")) {
+						if (my_cfg == &vpx_globals.vp8) {
+							if (val < -16) val = -16;
+							if (val > 16) val = 16;
+						} else if (my_cfg == &vpx_globals.vp9) {
+							if (val < -8) val = -8;
+							if (val > 8) val = 8;
+						}
+
+						my_cfg->cpuused = val;
+					} else if (!strcmp(name, "token-parts")) {
+						my_cfg->token_parts = switch_parse_cpu_string(value);
+					} else if (!strcmp(name, "static-thresh")) {
+						my_cfg->static_thresh = UINTVAL(val);
+					} else if (!strcmp(name, "noise-sensitivity")) {
+						my_cfg->noise_sensitivity = UINTVAL(val);
+					} else if (!strcmp(name, "losmax-intra-bitrate-pct")) {
+						my_cfg->max_intra_bitrate_pct = UINTVAL(val);
+					} else if (!strcmp(name, "tune-content")) {
+						uint32_t tune = VP9E_CONTENT_DEFAULT;
+
+						if (!strcasecmp(value, "SCREEN")) {
+							tune = VP9E_CONTENT_SCREEN;
+						}
+
+						my_cfg->tune_content = tune;
 					}
 				} // for param
 			} // for profile
@@ -1580,12 +1634,12 @@ static void load_config()
 		vpx_globals.max_bitrate = switch_calc_bitrate(1920, 1080, 5, 60);
 	}
 
-	if (!vpx_globals.vp8_enc_cfg.g_threads) vpx_globals.vp8_enc_cfg.g_threads = 1;
-	if (!vpx_globals.vp8_dec_cfg.threads) vpx_globals.vp8_dec_cfg.threads = switch_parse_cpu_string("cpu/2/4");
-	if (!vpx_globals.vp9_enc_cfg.g_threads) vpx_globals.vp9_enc_cfg.g_threads = vpx_globals.vp8_enc_cfg.g_threads;
-	if (!vpx_globals.vp9_dec_cfg.threads) vpx_globals.vp9_dec_cfg.threads = vpx_globals.vp8_dec_cfg.threads;
-	if (!vpx_globals.vp10_enc_cfg.g_threads) vpx_globals.vp10_enc_cfg.g_threads = vpx_globals.vp8_enc_cfg.g_threads;
-	if (!vpx_globals.vp10_dec_cfg.threads) vpx_globals.vp10_dec_cfg.threads = vpx_globals.vp8_dec_cfg.threads;
+	if (!vpx_globals.vp8.enc_cfg.g_threads) vpx_globals.vp8.enc_cfg.g_threads = 1;
+	if (!vpx_globals.vp8.dec_cfg.threads) vpx_globals.vp8.dec_cfg.threads = switch_parse_cpu_string("cpu/2/4");
+	if (!vpx_globals.vp9.enc_cfg.g_threads) vpx_globals.vp9.enc_cfg.g_threads = vpx_globals.vp8.enc_cfg.g_threads;
+	if (!vpx_globals.vp9.dec_cfg.threads) vpx_globals.vp9.dec_cfg.threads = vpx_globals.vp8.dec_cfg.threads;
+	if (!vpx_globals.vp10.enc_cfg.g_threads) vpx_globals.vp10.enc_cfg.g_threads = vpx_globals.vp8.enc_cfg.g_threads;
+	if (!vpx_globals.vp10.dec_cfg.threads) vpx_globals.vp10.dec_cfg.threads = vpx_globals.vp8.dec_cfg.threads;
 }
 
 #define VPX_API_SYNTAX ">"
@@ -1607,16 +1661,16 @@ SWITCH_STANDARD_API(vpx_api_function)
 
 		load_config();
 
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp8-dec-threads", vpx_globals.vp8_dec_cfg.threads);
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp9-dec-threads", vpx_globals.vp9_dec_cfg.threads);
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp10-dec-threads", vpx_globals.vp10_dec_cfg.threads);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp8-dec-threads", vpx_globals.vp8.dec_cfg.threads);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp9-dec-threads", vpx_globals.vp9.dec_cfg.threads);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp10-dec-threads", vpx_globals.vp10.dec_cfg.threads);
 
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Codec: %s\n", vpx_codec_iface_name(vpx_codec_vp8_cx()));
-		show_enc_config(&vpx_globals.vp8_enc_cfg);
+		show_config(&vpx_globals.vp8);
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Codec: %s\n", vpx_codec_iface_name(vpx_codec_vp9_cx()));
-		show_enc_config(&vpx_globals.vp9_enc_cfg);
+		show_config(&vpx_globals.vp9);
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Codec: VP10\n");
-		show_enc_config(&vpx_globals.vp10_enc_cfg);
+		show_config(&vpx_globals.vp10);
 
 		stream->write_function(stream, "+OK\n");
 	} else if (!strcasecmp(cmd, "debug")) {

From 0ad867f3ddad48004beb7dff4f497e6e42899377 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Thu, 14 Jun 2018 16:56:41 +0800
Subject: [PATCH 252/264] FS-11189 make rtp-slice-size and key-frame-min-freq
 configurable

---
 conf/vanilla/autoload_configs/vpx.conf.xml |  5 +++++
 src/switch_vpx.c                           | 25 ++++++++++++++++++++--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/conf/vanilla/autoload_configs/vpx.conf.xml b/conf/vanilla/autoload_configs/vpx.conf.xml
index cdf677710a..f20f984e01 100644
--- a/conf/vanilla/autoload_configs/vpx.conf.xml
+++ b/conf/vanilla/autoload_configs/vpx.conf.xml
@@ -3,6 +3,11 @@
     
     
 
+    
+
+    
+    
+
     
     
     
diff --git a/src/switch_vpx.c b/src/switch_vpx.c
index ae1cc6ddab..eff164eae4 100644
--- a/src/switch_vpx.c
+++ b/src/switch_vpx.c
@@ -380,6 +380,9 @@ typedef struct vpx_context vpx_context_t;
 struct vpx_globals {
 	int debug;
 	uint32_t max_bitrate;
+	uint32_t rtp_slice_size;
+	uint32_t key_frame_min_freq;
+
 	char vp8_profile[20];
 	char vp9_profile[20];
 	char vp10_profile[20];
@@ -651,7 +654,7 @@ static switch_status_t consume_partition(vpx_context_t *context, switch_frame_t
 	// if !extended
 	hdrlen = 1;
 	body = ((uint8_t *)frame->data) + hdrlen;
-	packet_size = SLICE_SIZE;
+	packet_size = vpx_globals.rtp_slice_size;
 	payload_size = packet_size - hdrlen;
 	// else add extended TBD
 
@@ -820,7 +823,7 @@ static switch_status_t switch_vpx_encode(switch_codec_t *codec, switch_frame_t *
 	if (context->need_key_frame > 0) {
 		// force generate a key frame
 
-		if (!context->last_key_frame || (now - context->last_key_frame) > KEY_FRAME_MIN_FREQ) {
+		if (!context->last_key_frame || (now - context->last_key_frame) > vpx_globals.key_frame_min_freq) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "VPX KEYFRAME GENERATED\n");
 			vpx_flags |= VPX_EFLAG_FORCE_KF;
 			context->need_key_frame = 0;
@@ -1406,6 +1409,13 @@ static void load_config()
 
 				if (!strcmp(name, "max-bitrate")) {
 					vpx_globals.max_bitrate = switch_parse_bandwidth_string(value);
+				} else if (!strcmp(name, "rtp-slice-size")) {
+					int val = atoi(value);
+					vpx_globals.rtp_slice_size = UINTVAL(val);
+				} else if (!strcmp(name, "key-frame-min-freq")) {
+					int val = atoi(value);
+					vpx_globals.key_frame_min_freq = UINTVAL(val);
+					vpx_globals.key_frame_min_freq *= 1000;
 				} else if (!strcmp(name, "dec-threads")) {
 					vpx_globals.vp8.dec_cfg.threads = switch_parse_cpu_string(value);
 					vpx_globals.vp9.dec_cfg.threads = switch_parse_cpu_string(value);
@@ -1634,6 +1644,14 @@ static void load_config()
 		vpx_globals.max_bitrate = switch_calc_bitrate(1920, 1080, 5, 60);
 	}
 
+	if (vpx_globals.rtp_slice_size < 500 || vpx_globals.rtp_slice_size > 1500) {
+		vpx_globals.rtp_slice_size = SLICE_SIZE;
+	}
+
+	if (vpx_globals.key_frame_min_freq < 10000 || vpx_globals.key_frame_min_freq > 3 * 1000000) {
+		vpx_globals.key_frame_min_freq = KEY_FRAME_MIN_FREQ;
+	}
+
 	if (!vpx_globals.vp8.enc_cfg.g_threads) vpx_globals.vp8.enc_cfg.g_threads = 1;
 	if (!vpx_globals.vp8.dec_cfg.threads) vpx_globals.vp8.dec_cfg.threads = switch_parse_cpu_string("cpu/2/4");
 	if (!vpx_globals.vp9.enc_cfg.g_threads) vpx_globals.vp9.enc_cfg.g_threads = vpx_globals.vp8.enc_cfg.g_threads;
@@ -1661,6 +1679,9 @@ SWITCH_STANDARD_API(vpx_api_function)
 
 		load_config();
 
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "rtp-slice-size", vpx_globals.rtp_slice_size);
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "key-frame-min-freq", vpx_globals.key_frame_min_freq);
+
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp8-dec-threads", vpx_globals.vp8.dec_cfg.threads);
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp9-dec-threads", vpx_globals.vp9.dec_cfg.threads);
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "    %-26s = %d\n", "vp10-dec-threads", vpx_globals.vp10.dec_cfg.threads);

From 18bcc4ddff0dfb9602ad82efd5c8645a401157d2 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Wed, 20 Jun 2018 19:00:22 +0800
Subject: [PATCH 253/264] FS-11189 add avcodec settings

---
 .../mod_av/autoload_configs/av.conf.xml       | 144 ++++++
 src/mod/applications/mod_av/avcodec.c         | 444 ++++++++++++++++--
 2 files changed, 541 insertions(+), 47 deletions(-)
 create mode 100644 src/mod/applications/mod_av/autoload_configs/av.conf.xml

diff --git a/src/mod/applications/mod_av/autoload_configs/av.conf.xml b/src/mod/applications/mod_av/autoload_configs/av.conf.xml
new file mode 100644
index 0000000000..d9aaa0abcc
--- /dev/null
+++ b/src/mod/applications/mod_av/autoload_configs/av.conf.xml
@@ -0,0 +1,144 @@
+
+  
+    
+    
+
+    
+
+    
+    
+
+    
+    
+    
+    
+    
+    
+    
+  
+
+  
+    
+    
+
+    
+    
+
+    
+      
+      
+
+      
+      
+      
+
+
+
+      
+
+
+
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      
+
+
+      
+
+
+      
+
+      
+      
+      
+      
+      
+      
+      
+
+    
+
+    
+    
+  
+
+
+
+  
+  
+
diff --git a/src/mod/applications/mod_av/avcodec.c b/src/mod/applications/mod_av/avcodec.c
index d6bfca0167..593581825d 100644
--- a/src/mod/applications/mod_av/avcodec.c
+++ b/src/mod/applications/mod_av/avcodec.c
@@ -38,10 +38,12 @@
 #include 
 #include 
 
-#define SLICE_SIZE SWITCH_DEFAULT_VIDEO_SIZE
+int SLICE_SIZE = SWITCH_DEFAULT_VIDEO_SIZE;
+
 #define H264_NALU_BUFFER_SIZE 65536
-#define MAX_NALUS 128
+#define MAX_NALUS 256
 #define H263_MODE_B // else Mode A only
+#define KEY_FRAME_MIN_FREQ 250000
 
 SWITCH_MODULE_LOAD_FUNCTION(mod_avcodec_load);
 
@@ -194,6 +196,55 @@ typedef struct h264_codec_context_s {
 
 static uint8_t ff_input_buffer_padding[FF_INPUT_BUFFER_PADDING_SIZE] = { 0 };
 
+#define MAX_CODECS 4
+
+typedef struct avcodec_profile_s {
+	char name[20];
+	int decoder_thread_count;
+	AVCodecContext ctx;
+	struct {
+		char preset[20];
+		char tune[64];
+		int intra_refresh;
+		int sc_threshold;
+		int b_strategy;
+		int crf;
+	} x264;
+} avcodec_profile_t;
+
+struct avcodec_globals {
+	int debug;
+	uint32_t max_bitrate;
+	uint32_t rtp_slice_size;
+	uint32_t key_frame_min_freq;
+
+	avcodec_profile_t profiles[MAX_CODECS];
+};
+
+struct avcodec_globals avcodec_globals = { 0 };
+
+char *CODEC_MAPS[] = {
+	"H263",
+	"H263+",
+	"H264",
+	"H265",
+	NULL
+};
+
+static int get_codec_index(const char *cstr)
+{
+	int i;
+
+	for (i = 0; ; i++) {
+		if (!strcasecmp(cstr, CODEC_MAPS[i])) {
+			return i;
+		}
+	}
+
+	abort();
+	return -1;
+}
+
 static switch_status_t buffer_h264_nalu(h264_codec_context_t *context, switch_frame_t *frame)
 {
 	uint8_t nalu_type = 0;
@@ -827,9 +878,8 @@ static switch_status_t consume_nalu(h264_codec_context_t *context, switch_frame_
 
 static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t width, uint32_t height)
 {
-	int sane = 0;
-	int threads = switch_core_cpu_count();
 	int fps = 15;
+	avcodec_profile_t *profile = NULL;
 	
 #ifdef NVENC_SUPPORT
 	if (!context->encoder) {
@@ -860,6 +910,18 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt
 		return SWITCH_STATUS_FALSE;
 	}
 
+	if (context->av_codec_id == AV_CODEC_ID_H263) {
+		profile = &avcodec_globals.profiles[get_codec_index("H263")];
+	} else if (context->av_codec_id == AV_CODEC_ID_H263P) {
+		profile = &avcodec_globals.profiles[get_codec_index("H263+")];
+	} else if (context->av_codec_id == AV_CODEC_ID_H264) {
+		profile = &avcodec_globals.profiles[get_codec_index("H264")];
+	} else if (context->av_codec_id == AV_CODEC_ID_H265) {
+		profile = &avcodec_globals.profiles[get_codec_index("H265")];
+	}
+
+	if (!profile) return SWITCH_STATUS_FALSE;
+
 	if (context->encoder_ctx) {
 		if (avcodec_is_open(context->encoder_ctx)) {
 			avcodec_close(context->encoder_ctx);
@@ -896,15 +958,11 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt
 		context->bandwidth = switch_calc_bitrate(context->codec_settings.video.width, context->codec_settings.video.height, 1, fps);
 	}
 
-	sane = switch_calc_bitrate(1920, 1080, 3, 60);
-
-	if (context->bandwidth > sane) {
-		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "BITRATE TRUNCATED TO %d\n", sane);
-		context->bandwidth = sane;
+	if (context->bandwidth > avcodec_globals.max_bitrate) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "BITRATE TRUNCATED TO %d\n", avcodec_globals.max_bitrate);
+		context->bandwidth = avcodec_globals.max_bitrate;
 	}
 
-	if (threads > 4) threads = 4;
-
 	context->bandwidth *= 3;
 
 	fps = context->codec_settings.video.fps;
@@ -921,11 +979,10 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt
 	
 	context->encoder_ctx->width = context->codec_settings.video.width;
 	context->encoder_ctx->height = context->codec_settings.video.height;
-	/* frames per second */
 	context->encoder_ctx->time_base = (AVRational){1, 90};
-	context->encoder_ctx->max_b_frames = 0;
+	context->encoder_ctx->max_b_frames = profile->ctx.max_b_frames;
 	context->encoder_ctx->pix_fmt = AV_PIX_FMT_YUV420P;
-	context->encoder_ctx->thread_count = threads;
+	context->encoder_ctx->thread_count = profile->ctx.thread_count;
 
 	if (context->av_codec_id == AV_CODEC_ID_H263 || context->av_codec_id == AV_CODEC_ID_H263P) {
 #ifndef H263_MODE_B
@@ -946,44 +1003,38 @@ FF_ENABLE_DEPRECATION_WARNINGS
 		context->encoder_ctx->opaque = context;
 		av_opt_set_int(context->encoder_ctx->priv_data, "mb_info", SLICE_SIZE - 8, 0);
 	} else if (context->av_codec_id == AV_CODEC_ID_H264) {
-		context->encoder_ctx->profile = FF_PROFILE_H264_BASELINE;
-		context->encoder_ctx->level = 31;
+		context->encoder_ctx->profile = profile->ctx.profile;
+		context->encoder_ctx->level = profile->ctx.level;
 
 		if (context->hw_encoder) {
 			av_opt_set(context->encoder_ctx->priv_data, "preset", "llhp", 0);
 			av_opt_set_int(context->encoder_ctx->priv_data, "2pass", 1, 0);
 		} else {
-			av_opt_set_int(context->encoder_ctx->priv_data, "intra-refresh", 1, 0);
-			av_opt_set(context->encoder_ctx->priv_data, "preset", "veryfast", 0);
-			av_opt_set(context->encoder_ctx->priv_data, "tune", "animation+zerolatency", 0);
-			av_opt_set(context->encoder_ctx->priv_data, "profile", "baseline", 0);
+			av_opt_set_int(context->encoder_ctx->priv_data, "intra-refresh", profile->x264.intra_refresh, 0);
+			av_opt_set(context->encoder_ctx->priv_data, "preset", profile->x264.preset, 0);
+			av_opt_set(context->encoder_ctx->priv_data, "tune", profile->x264.tune, 0);
 			av_opt_set_int(context->encoder_ctx->priv_data, "slice-max-size", SLICE_SIZE, 0);
 
-			
-			context->encoder_ctx->colorspace = AVCOL_SPC_RGB;
-			context->encoder_ctx->color_range = AVCOL_RANGE_JPEG;
+			context->encoder_ctx->colorspace = profile->ctx.colorspace;
+			context->encoder_ctx->color_range = profile->ctx.color_range;
 
-			/*
-			av_opt_set_int(context->encoder_ctx->priv_data, "sc_threshold", 40, 0);
-			av_opt_set_int(context->encoder_ctx->priv_data, "b_strategy", 1, 0);
-			av_opt_set_int(context->encoder_ctx->priv_data, "crf",  18, 0);
+			if (profile->x264.sc_threshold > 0) av_opt_set_int(context->encoder_ctx->priv_data, "sc_threshold", profile->x264.sc_threshold, 0);
+			if (profile->x264.b_strategy > 0)av_opt_set_int(context->encoder_ctx->priv_data, "b_strategy", profile->x264.b_strategy, 0);
+			if (profile->x264.crf > 0)av_opt_set_int(context->encoder_ctx->priv_data, "crf",  profile->x264.crf, 0);
 
-			// libx264-medium.ffpreset preset
-
-			context->encoder_ctx->flags|=CODEC_FLAG_LOOP_FILTER;   // flags=+loop
-			context->encoder_ctx->me_cmp|= 1;  // cmp=+chroma, where CHROMA = 1
-			context->encoder_ctx->me_range = 21;   // me_range=16
-			context->encoder_ctx->max_b_frames = 3;    // bf=3
-			//context->encoder_ctx->refs = 3;    // refs=3
-			context->encoder_ctx->gop_size = 250;  // g=250
-			context->encoder_ctx->keyint_min = 25; // keyint_min=25
-			context->encoder_ctx->i_quant_factor = 0.71; // i_qfactor=0.71
-			context->encoder_ctx->b_quant_factor = 0.76923078; // Qscale difference between P-frames and B-frames.
-			context->encoder_ctx->qcompress = 0;//0.6; // qcomp=0.6
-			context->encoder_ctx->qmin = 10;   // qmin=10
-			context->encoder_ctx->qmax = 51;   // qmax=51
-			context->encoder_ctx->max_qdiff = 4;   // qdiff=4
-			*/
+			context->encoder_ctx->flags |= profile->ctx.flags; // CODEC_FLAG_LOOP_FILTER;   // flags=+loop
+			if (profile->ctx.me_cmp >= 0) context->encoder_ctx->me_cmp = profile->ctx.me_cmp;  // cmp=+chroma, where CHROMA = 1
+			if (profile->ctx.me_range >= 0) context->encoder_ctx->me_range = profile->ctx.me_range;
+			if (profile->ctx.max_b_frames >= 0) context->encoder_ctx->max_b_frames = profile->ctx.max_b_frames;
+			if (profile->ctx.refs >= 0) context->encoder_ctx->refs = profile->ctx.refs;
+			if (profile->ctx.gop_size >= 0) context->encoder_ctx->gop_size = profile->ctx.gop_size;
+			if (profile->ctx.keyint_min >= 0) context->encoder_ctx->keyint_min = profile->ctx.keyint_min;
+			if (profile->ctx.i_quant_factor >= 0) context->encoder_ctx->i_quant_factor = profile->ctx.i_quant_factor;
+			if (profile->ctx.b_quant_factor >= 0) context->encoder_ctx->b_quant_factor = profile->ctx.b_quant_factor;
+			if (profile->ctx.qcompress >= 0) context->encoder_ctx->qcompress = profile->ctx.qcompress;
+			if (profile->ctx.qmin >= 0) context->encoder_ctx->qmin = profile->ctx.qmin;
+			if (profile->ctx.qmax >= 0) context->encoder_ctx->qmax = profile->ctx.qmax;
+			if (profile->ctx.max_qdiff >= 0) context->encoder_ctx->max_qdiff = profile->ctx.max_qdiff;
 		}
 	}
 
@@ -999,7 +1050,7 @@ static switch_status_t switch_h264_init(switch_codec_t *codec, switch_codec_flag
 {
 	int encoding, decoding;
 	h264_codec_context_t *context = NULL;
-	int threads = switch_core_cpu_count();
+	avcodec_profile_t *profile = NULL;
 
 	encoding = (flags & SWITCH_CODEC_FLAG_ENCODE);
 	decoding = (flags & SWITCH_CODEC_FLAG_DECODE);
@@ -1022,12 +1073,17 @@ static switch_status_t switch_h264_init(switch_codec_t *codec, switch_codec_flag
 
 	if (!strcmp(codec->implementation->iananame, "H263")) {
 		context->av_codec_id = AV_CODEC_ID_H263;
+		profile = &avcodec_globals.profiles[get_codec_index("H263")];
 	} else if (!strcmp(codec->implementation->iananame, "H263-1998")) {
 		context->av_codec_id = AV_CODEC_ID_H263P;
+		profile = &avcodec_globals.profiles[get_codec_index("H263+")];
 	} else {
 		context->av_codec_id = AV_CODEC_ID_H264;
+		profile = &avcodec_globals.profiles[get_codec_index("H264")];
 	}
 
+	switch_assert(profile);
+
 	if (decoding) {
 		context->decoder = avcodec_find_decoder(context->av_codec_id);
 
@@ -1042,11 +1098,9 @@ static switch_status_t switch_h264_init(switch_codec_t *codec, switch_codec_flag
 		}
 
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "codec: id=%d %s\n", context->decoder->id, context->decoder->long_name);
-
-		if (threads > 4) threads = 4;
 		
 		context->decoder_ctx = avcodec_alloc_context3(context->decoder);
-		//context->decoder_ctx->thread_count = threads;
+		context->decoder_ctx->thread_count = profile->decoder_thread_count;
 		if (avcodec_open2(context->decoder_ctx, context->decoder, NULL) < 0) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error openning codec\n");
 			goto error;
@@ -1247,6 +1301,10 @@ GCC_DIAG_ON(deprecated-declarations)
 				while (!(*p++)) ; /* eat the sync bytes, what ever 0 0 1 or 0 0 0 1 */
 				context->nalus[i].start = p;
 				context->nalus[i].eat = p;
+
+				if (mod_av_globals.debug && (*p & 0x1f) == 7) {
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "KEY FRAME GENERATED\n");
+				}
 			} else {
 				context->nalus[i].len = p - context->nalus[i].start;
 				while (!(*p++)) ; /* eat the sync bytes, what ever 0 0 1 or 0 0 0 1 */
@@ -1558,10 +1616,302 @@ void show_codecs(switch_stream_handle_t *stream)
 	av_free(codecs);
 }
 
+#define UINTVAL(v) (v > 0 ? v : 0);
+
+static void load_config()
+{
+	switch_xml_t cfg = NULL, xml = NULL;
+	int i;
+
+	switch_set_string(avcodec_globals.profiles[get_codec_index("H263")].name, "H263");
+	switch_set_string(avcodec_globals.profiles[get_codec_index("H263+")].name, "H263+");
+	switch_set_string(avcodec_globals.profiles[get_codec_index("H264")].name, "H264");
+	switch_set_string(avcodec_globals.profiles[get_codec_index("H265")].name, "H265");
+
+	for (i = 0; i < MAX_CODECS; i++) {
+		avcodec_profile_t *profile = &avcodec_globals.profiles[i];
+
+		profile->ctx.colorspace = AVCOL_SPC_RGB;
+		profile->ctx.color_range = AVCOL_RANGE_JPEG;
+		profile->ctx.flags = 0;
+		profile->ctx.me_cmp = -1;
+		profile->ctx.me_range = -1;
+		profile->ctx.max_b_frames = -1;
+		profile->ctx.refs = -1;
+		profile->ctx.gop_size = -1;
+		profile->ctx.keyint_min = -1;
+		profile->ctx.i_quant_factor = -1;
+		profile->ctx.b_quant_factor = -1;
+		profile->ctx.qcompress = -1;
+		profile->ctx.qmin = -1;
+		profile->ctx.qmax = -1;
+		profile->ctx.max_qdiff = -1;
+
+		profile->x264.sc_threshold = 0;
+		profile->x264.b_strategy = 0;
+		profile->x264.crf = 0;
+
+		if (!strcasecmp(CODEC_MAPS[i], "H264")) {
+			profile->ctx.profile = FF_PROFILE_H264_BASELINE;
+			profile->ctx.level = 41;
+		}
+	}
+
+	avcodec_globals.max_bitrate = 0;
+
+	xml = switch_xml_open_cfg("avcodec.conf", &cfg, NULL);
+
+	if (xml) {
+		switch_xml_t settings = switch_xml_child(cfg, "settings");
+		switch_xml_t profiles = switch_xml_child(cfg, "profiles");
+
+		if (settings) {
+			switch_xml_t param;
+
+			for (param = switch_xml_child(settings, "param"); param; param = param->next) {
+				const char *name = switch_xml_attr(param, "name");
+				const char *value = switch_xml_attr(param, "value");
+
+				if (zstr(name) || zstr(value)) continue;
+
+				if (!strcmp(name, "max-bitrate")) {
+					avcodec_globals.max_bitrate = switch_parse_bandwidth_string(value);
+				} else if (!strcmp(name, "rtp-slice-size")) {
+					int val = atoi(value);
+					avcodec_globals.rtp_slice_size = UINTVAL(val);
+				} else if (!strcmp(name, "key-frame-min-freq")) {
+					int val = atoi(value);
+					avcodec_globals.key_frame_min_freq = UINTVAL(val);
+					avcodec_globals.key_frame_min_freq *= 1000;
+				} else if (!strcmp(name, "dec-threads")) {
+					int i;
+					uint threads = switch_parse_cpu_string(value);
+
+					for (i = 0; i < MAX_CODECS; i++) {
+						avcodec_globals.profiles[i].decoder_thread_count = threads;
+					}
+				} else if (!strcmp(name, "enc-threads")) {
+					int i;
+					uint threads = switch_parse_cpu_string(value);
+
+					for (i = 0; i < MAX_CODECS; i++) {
+						avcodec_globals.profiles[i].ctx.thread_count = threads;
+					}
+				} else if (!strcasecmp(name, "h263-profile")) {
+					switch_set_string(avcodec_globals.profiles[get_codec_index("H263")].name, value);
+				} else if (!strcasecmp(name, "h263+-profile")) {
+					switch_set_string(avcodec_globals.profiles[get_codec_index("H263+")].name, value);
+				} else if (!strcasecmp(name, "h264-profile")) {
+					switch_set_string(avcodec_globals.profiles[get_codec_index("H264")].name, value);
+				} else if (!strcasecmp(name, "h265-profile")) {
+					switch_set_string(avcodec_globals.profiles[get_codec_index("H265")].name, value);
+				}
+			}
+		}
+
+		if (profiles) {
+			switch_xml_t profile = switch_xml_child(profiles, "profile");
+
+			for (; profile; profile = profile->next) {
+				switch_xml_t param = NULL;
+				const char *profile_name = switch_xml_attr(profile, "name");
+				avcodec_profile_t *aprofile = NULL;
+				AVCodecContext *ctx = NULL;
+				int i;
+
+				if (zstr(profile_name)) continue;
+
+				for (i = 0; i < MAX_CODECS; i++) {
+					if (!strcmp(profile_name, avcodec_globals.profiles[i].name)) {
+						aprofile = &avcodec_globals.profiles[i];
+						ctx = &aprofile->ctx;
+						break;
+					}
+				}
+
+				if (!ctx) continue;
+
+				for (param = switch_xml_child(profile, "param"); param; param = param->next) {
+					const char *name = switch_xml_attr(param, "name");
+					const char *value = switch_xml_attr(param, "value");
+					int val;
+
+					if (zstr(name) || zstr(value)) continue;
+
+					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s: %s = %s\n", profile_name, name, value);
+
+					val = atoi(value);
+
+					if (!strcmp(name, "dec-threads")) {
+						aprofile->decoder_thread_count = switch_parse_cpu_string(value);
+					} else if (!strcmp(name, "enc-threads")) {
+						ctx->thread_count = switch_parse_cpu_string(value);
+					} else if (!strcmp(name, "profile")) {
+						ctx->profile = UINTVAL(val);
+
+						if (ctx->profile == 0 && !strcasecmp(CODEC_MAPS[i], "H264")) {
+							if (!strcasecmp(value, "baseline")) {
+								ctx->profile = FF_PROFILE_H264_BASELINE;
+							} else if (!strcasecmp(value, "main")) {
+								ctx->profile = FF_PROFILE_H264_MAIN;
+							} else if (!strcasecmp(value, "high")) {
+								ctx->profile = FF_PROFILE_H264_HIGH;
+							}
+						}
+					} else if (!strcmp(name, "level")) {
+						ctx->level = UINTVAL(val);
+					} else if (!strcmp(name, "timebase")) {
+						int num = 0;
+						int den = 0;
+						char *slash = strchr(value, '/');
+
+						num = UINTVAL(val);
+
+						if (slash) {
+							slash++;
+							den = atoi(slash);
+
+							if (den < 0) den = 0;
+						}
+
+						if (num && den) {
+							ctx->time_base.num = num;
+							ctx->time_base.den = den;
+						}
+					} else if (!strcmp(name, "preset")) {
+						switch_set_string(aprofile->x264.preset, value);
+					} else if (!strcmp(name, "flags")) {
+						char *s = strdup(value);
+						int flags = 0;
+
+						if (s) {
+							int argc;
+							char *argv[20];
+							int i;
+
+							argc = switch_separate_string(s, '|', argv, (sizeof(argv) / sizeof(argv[0])));
+
+							for (i = 0; i < argc; i++) {
+								if (!strcasecmp(argv[i], "UNALIGNED")) {
+									flags |= AV_CODEC_FLAG_UNALIGNED;
+								} else if (!strcasecmp(argv[i], "QSCALE")) {
+									flags |= AV_CODEC_FLAG_QSCALE;
+								} else if (!strcasecmp(argv[i], "QSCALE")) {
+									flags |= AV_CODEC_FLAG_QSCALE;
+								} else if (!strcasecmp(argv[i], "4MV")) {
+									flags |= AV_CODEC_FLAG_4MV;
+								} else if (!strcasecmp(argv[i], "CORRUPT")) {
+									flags |= AV_CODEC_FLAG_OUTPUT_CORRUPT;
+								} else if (!strcasecmp(argv[i], "QPEL")) {
+									flags |= AV_CODEC_FLAG_QPEL;
+								} else if (!strcasecmp(argv[i], "PASS1")) {
+									flags |= AV_CODEC_FLAG_PASS1;
+								} else if (!strcasecmp(argv[i], "PASS2")) {
+									flags |= AV_CODEC_FLAG_PASS2;
+								} else if (!strcasecmp(argv[i], "FILTER")) {
+									flags |= AV_CODEC_FLAG_LOOP_FILTER;
+								} else if (!strcasecmp(argv[i], "GRAY")) {
+									flags |= AV_CODEC_FLAG_GRAY;
+								} else if (!strcasecmp(argv[i], "PSNR")) {
+									flags |= AV_CODEC_FLAG_PSNR;
+								} else if (!strcasecmp(argv[i], "TRUNCATED")) {
+									flags |= AV_CODEC_FLAG_TRUNCATED;
+								} else if (!strcasecmp(argv[i], "INTERLACED_DCT")) {
+									flags |= AV_CODEC_FLAG_INTERLACED_DCT;
+								} else if (!strcasecmp(argv[i], "LOW_DELAY")) {
+									flags |= AV_CODEC_FLAG_LOW_DELAY;
+								} else if (!strcasecmp(argv[i], "HEADER")) {
+									flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+								} else if (!strcasecmp(argv[i], "BITEXACT")) {
+									flags |= AV_CODEC_FLAG_BITEXACT;
+								} else if (!strcasecmp(argv[i], "AC_PRED")) {
+									flags |= AV_CODEC_FLAG_AC_PRED;
+								} else if (!strcasecmp(argv[i], "INTERLACED_ME")) {
+									flags |= AV_CODEC_FLAG_INTERLACED_ME;
+								} else if (!strcasecmp(argv[i], "CLOSED_GOP")) {
+									flags |= AV_CODEC_FLAG_CLOSED_GOP;
+								}
+							}
+
+							free(s);
+							ctx->flags = flags;
+						}
+					} else if (!strcmp(name, "me-cmp")) {
+						ctx->me_cmp = UINTVAL(val);
+					} else if (!strcmp(name, "me-range")) {
+						ctx->me_range = UINTVAL(val);
+					} else if (!strcmp(name, "max-b-frames")) {
+						ctx->max_b_frames = UINTVAL(val);
+					} else if (!strcmp(name, "refs")) {
+						ctx->refs = UINTVAL(val);
+					} else if (!strcmp(name, "gop-size")) {
+						ctx->gop_size = UINTVAL(val);
+					} else if (!strcmp(name, "keyint-min")) {
+						ctx->keyint_min = UINTVAL(val);
+					} else if (!strcmp(name, "i-quant-factor")) {
+						ctx->i_quant_factor = UINTVAL(val);
+					} else if (!strcmp(name, "b-quant-factor")) {
+						ctx->b_quant_factor = UINTVAL(val);
+					} else if (!strcmp(name, "qcompress")) {
+						ctx->qcompress = UINTVAL(val);
+					} else if (!strcmp(name, "qmin")) {
+						ctx->qmin = UINTVAL(val);
+					} else if (!strcmp(name, "qmax")) {
+						ctx->qmax = UINTVAL(val);
+					} else if (!strcmp(name, "max-qdiff")) {
+						ctx->max_qdiff = UINTVAL(val);
+					} else if (!strcmp(name, "colorspace")) {
+						ctx->colorspace = UINTVAL(val);
+
+						if (ctx->colorspace > AVCOL_SPC_NB) {
+							ctx->colorspace = AVCOL_SPC_RGB;
+						}
+					} else if (!strcmp(name, "color-range")) {
+						ctx->color_range = UINTVAL(val);
+
+						if (ctx->color_range >  AVCOL_RANGE_NB) {
+							ctx->color_range = 0;
+						}
+					} else if (!strcmp(name, "x264-preset")) {
+						switch_set_string(aprofile->x264.preset, value);
+					} else if (!strcmp(name, "x264-tune")) {
+						switch_set_string(aprofile->x264.tune, value);
+					} else if (!strcmp(name, "x264-sc-threshold")) {
+						aprofile->x264.sc_threshold = UINTVAL(val);
+					} else if (!strcmp(name, "x264-b-strategy")) {
+						aprofile->x264.b_strategy = UINTVAL(val);
+					} else if (!strcmp(name, "x264-crf")) {
+						aprofile->x264.crf = UINTVAL(val);
+					}
+				} // for param
+			} // for profile
+		} // profiles
+
+		switch_xml_free(xml);
+	} // xml
+
+	if (avcodec_globals.max_bitrate <= 0) {
+		avcodec_globals.max_bitrate = switch_calc_bitrate(1920, 1080, 5, 60);
+	}
+
+	if (avcodec_globals.rtp_slice_size < 500 || avcodec_globals.rtp_slice_size > 1500) {
+		avcodec_globals.rtp_slice_size = SWITCH_DEFAULT_VIDEO_SIZE;
+	}
+
+	SLICE_SIZE = avcodec_globals.rtp_slice_size;
+
+	if (avcodec_globals.key_frame_min_freq < 10000 || avcodec_globals.key_frame_min_freq > 3 * 1000000) {
+		avcodec_globals.key_frame_min_freq = KEY_FRAME_MIN_FREQ;
+	}
+}
+
 SWITCH_MODULE_LOAD_FUNCTION(mod_avcodec_load)
 {
 	switch_codec_interface_t *codec_interface;
 
+	memset(&avcodec_globals, 0, sizeof(struct avcodec_globals));
+	load_config();
+
 	SWITCH_ADD_CODEC(codec_interface, "H264 Video");
 	switch_core_codec_add_video_implementation(pool, codec_interface, 99, "H264", NULL,
 											   switch_h264_init, switch_h264_encode, switch_h264_decode, switch_h264_control, switch_h264_destroy);

From 12e3b7177c55be78943a30008642ef793b882d24 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Wed, 20 Jun 2018 21:22:06 +0800
Subject: [PATCH 254/264] FS-11189 refactor to support any possible codec
 specific private options

---
 .../mod_av/autoload_configs/av.conf.xml       | 17 ++--
 src/mod/applications/mod_av/avcodec.c         | 80 +++++++++++--------
 src/mod/applications/mod_av/mod_av.c          |  2 +
 3 files changed, 59 insertions(+), 40 deletions(-)

diff --git a/src/mod/applications/mod_av/autoload_configs/av.conf.xml b/src/mod/applications/mod_av/autoload_configs/av.conf.xml
index d9aaa0abcc..7d0390646a 100644
--- a/src/mod/applications/mod_av/autoload_configs/av.conf.xml
+++ b/src/mod/applications/mod_av/autoload_configs/av.conf.xml
@@ -123,14 +123,15 @@ enum AVColorRange {
 -->
       
 
-      
-      
-      
-      
-      
-      
-      
-
+      
+      
+        
     
 
     
diff --git a/src/mod/applications/mod_av/avcodec.c b/src/mod/applications/mod_av/avcodec.c
index 593581825d..09988caf46 100644
--- a/src/mod/applications/mod_av/avcodec.c
+++ b/src/mod/applications/mod_av/avcodec.c
@@ -46,6 +46,7 @@ int SLICE_SIZE = SWITCH_DEFAULT_VIDEO_SIZE;
 #define KEY_FRAME_MIN_FREQ 250000
 
 SWITCH_MODULE_LOAD_FUNCTION(mod_avcodec_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_avcodec_shutdown);
 
 /*  ff_avc_find_startcode is not exposed in the ffmpeg lib but you can use it
 	Either include the avc.h which available in the ffmpeg source, or
@@ -202,14 +203,7 @@ typedef struct avcodec_profile_s {
 	char name[20];
 	int decoder_thread_count;
 	AVCodecContext ctx;
-	struct {
-		char preset[20];
-		char tune[64];
-		int intra_refresh;
-		int sc_threshold;
-		int b_strategy;
-		int crf;
-	} x264;
+	switch_event_t *options;
 } avcodec_profile_t;
 
 struct avcodec_globals {
@@ -1010,18 +1004,18 @@ FF_ENABLE_DEPRECATION_WARNINGS
 			av_opt_set(context->encoder_ctx->priv_data, "preset", "llhp", 0);
 			av_opt_set_int(context->encoder_ctx->priv_data, "2pass", 1, 0);
 		} else {
-			av_opt_set_int(context->encoder_ctx->priv_data, "intra-refresh", profile->x264.intra_refresh, 0);
-			av_opt_set(context->encoder_ctx->priv_data, "preset", profile->x264.preset, 0);
-			av_opt_set(context->encoder_ctx->priv_data, "tune", profile->x264.tune, 0);
-			av_opt_set_int(context->encoder_ctx->priv_data, "slice-max-size", SLICE_SIZE, 0);
+			if (profile->options) {
+				switch_event_header_t *hp;
+
+				for (hp = profile->options->headers; hp; hp = hp->next) {
+					// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s: %s\n", hp->name, hp->value);
+					av_opt_set(context->encoder_ctx->priv_data, hp->name, hp->value, 0);
+				}
+			}
 
 			context->encoder_ctx->colorspace = profile->ctx.colorspace;
 			context->encoder_ctx->color_range = profile->ctx.color_range;
 
-			if (profile->x264.sc_threshold > 0) av_opt_set_int(context->encoder_ctx->priv_data, "sc_threshold", profile->x264.sc_threshold, 0);
-			if (profile->x264.b_strategy > 0)av_opt_set_int(context->encoder_ctx->priv_data, "b_strategy", profile->x264.b_strategy, 0);
-			if (profile->x264.crf > 0)av_opt_set_int(context->encoder_ctx->priv_data, "crf",  profile->x264.crf, 0);
-
 			context->encoder_ctx->flags |= profile->ctx.flags; // CODEC_FLAG_LOOP_FILTER;   // flags=+loop
 			if (profile->ctx.me_cmp >= 0) context->encoder_ctx->me_cmp = profile->ctx.me_cmp;  // cmp=+chroma, where CHROMA = 1
 			if (profile->ctx.me_range >= 0) context->encoder_ctx->me_range = profile->ctx.me_range;
@@ -1647,10 +1641,6 @@ static void load_config()
 		profile->ctx.qmax = -1;
 		profile->ctx.max_qdiff = -1;
 
-		profile->x264.sc_threshold = 0;
-		profile->x264.b_strategy = 0;
-		profile->x264.crf = 0;
-
 		if (!strcasecmp(CODEC_MAPS[i], "H264")) {
 			profile->ctx.profile = FF_PROFILE_H264_BASELINE;
 			profile->ctx.level = 41;
@@ -1713,6 +1703,7 @@ static void load_config()
 			switch_xml_t profile = switch_xml_child(profiles, "profile");
 
 			for (; profile; profile = profile->next) {
+				switch_xml_t options = switch_xml_child(profile, "options");
 				switch_xml_t param = NULL;
 				const char *profile_name = switch_xml_attr(profile, "name");
 				avcodec_profile_t *aprofile = NULL;
@@ -1778,8 +1769,6 @@ static void load_config()
 							ctx->time_base.num = num;
 							ctx->time_base.den = den;
 						}
-					} else if (!strcmp(name, "preset")) {
-						switch_set_string(aprofile->x264.preset, value);
 					} else if (!strcmp(name, "flags")) {
 						char *s = strdup(value);
 						int flags = 0;
@@ -1872,18 +1861,30 @@ static void load_config()
 						if (ctx->color_range >  AVCOL_RANGE_NB) {
 							ctx->color_range = 0;
 						}
-					} else if (!strcmp(name, "x264-preset")) {
-						switch_set_string(aprofile->x264.preset, value);
-					} else if (!strcmp(name, "x264-tune")) {
-						switch_set_string(aprofile->x264.tune, value);
-					} else if (!strcmp(name, "x264-sc-threshold")) {
-						aprofile->x264.sc_threshold = UINTVAL(val);
-					} else if (!strcmp(name, "x264-b-strategy")) {
-						aprofile->x264.b_strategy = UINTVAL(val);
-					} else if (!strcmp(name, "x264-crf")) {
-						aprofile->x264.crf = UINTVAL(val);
 					}
 				} // for param
+
+				if (options) {
+					switch_xml_t option = switch_xml_child(options, "option");
+
+					if (aprofile->options) {
+						switch_event_destroy(&aprofile->options);
+					}
+
+					switch_event_create(&aprofile->options, SWITCH_EVENT_CLONE);
+					aprofile->options->flags |= EF_UNIQ_HEADERS;
+
+					for (; option; option = option->next) {
+						const char *name = switch_xml_attr(option, "name");
+						const char *value = switch_xml_attr(option, "value");
+
+						if (zstr(name) || zstr(value)) continue;
+
+						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s: %s\n", name, value);
+
+						switch_event_add_header_string(aprofile->options, SWITCH_STACK_BOTTOM, name, value);
+					}
+				} // for options
 			} // for profile
 		} // profiles
 
@@ -1928,6 +1929,21 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_avcodec_load)
 	return SWITCH_STATUS_SUCCESS;
 }
 
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_avcodec_shutdown)
+{
+	int i;
+
+	for (i = 0; i < MAX_CODECS; i++) {
+		avcodec_profile_t *profile = &avcodec_globals.profiles[i];
+
+		if (profile->options) {
+			switch_event_destroy(&profile->options);
+		}
+	}
+
+	return SWITCH_STATUS_SUCCESS;
+}
+
 /* For Emacs:
  * Local Variables:
  * mode:c
diff --git a/src/mod/applications/mod_av/mod_av.c b/src/mod/applications/mod_av/mod_av.c
index fcf4e54af6..68f363bff5 100644
--- a/src/mod/applications/mod_av/mod_av.c
+++ b/src/mod/applications/mod_av/mod_av.c
@@ -38,6 +38,7 @@
 SWITCH_MODULE_LOAD_FUNCTION(mod_avformat_load);
 SWITCH_MODULE_LOAD_FUNCTION(mod_avcodec_load);
 SWITCH_MODULE_LOAD_FUNCTION(mod_av_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_avcodec_shutdown);
 SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_av_shutdown);
 SWITCH_MODULE_DEFINITION(mod_av, mod_av_load, mod_av_shutdown, NULL);
 
@@ -124,6 +125,7 @@ static void log_callback(void *ptr, int level, const char *fmt, va_list vl)
 
 SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_av_shutdown)
 {
+	mod_avcodec_shutdown();
 	avformat_network_deinit();
 	av_log_set_callback(NULL);
 	av_lockmgr_register(NULL);

From 9d0ad92d108b6276f18b36b604a44de97b78ce57 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Tue, 17 Jul 2018 10:28:19 +0800
Subject: [PATCH 255/264] FS-11237 #resolve speak text with colon

---
 src/switch_ivr_play_say.c | 34 +++++++++-------------------------
 1 file changed, 9 insertions(+), 25 deletions(-)

diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c
index b16dbaf388..9ebca40e8d 100644
--- a/src/switch_ivr_play_say.c
+++ b/src/switch_ivr_play_say.c
@@ -1307,38 +1307,22 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
 					continue;
 				}
 			} else if (!strncasecmp(file, "say:", 4)) {
-				char *engine = NULL, *voice = NULL, *text = NULL;
+				const char *engine = NULL, *voice = NULL, *text = NULL;
+
 				alt = file + 4;
-				dup = switch_core_session_strdup(session, alt);
-				engine = dup;
+				text = alt;
+				engine = switch_channel_get_variable(channel, "tts_engine");
+				voice = switch_channel_get_variable(channel, "tts_voice");
 
-				if (!zstr(engine)) {
-					if ((voice = strchr(engine, ':'))) {
-						*voice++ = '\0';
-						if (!zstr(voice) && (text = strchr(voice, ':'))) {
-							*text++ = '\0';
-						}
-					}
-				}
-
-				if (!zstr(engine) && !zstr(voice) && !zstr(text)) {
-					if ((status = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) {
+				if (engine && text) {
+					if ((status = switch_ivr_speak_text(session, engine, voice, (char *)text, args)) != SWITCH_STATUS_SUCCESS) {
 						arg_recursion_check_stop(args);
 						return status;
 					}
 				} else {
-					text = engine;
-					engine = (char *) switch_channel_get_variable(channel, "tts_engine");
-					voice = (char *) switch_channel_get_variable(channel, "tts_voice");
-					if (engine && text) {
-						if ((status = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) {
-							arg_recursion_check_stop(args);
-							return status;
-						}
-					} else {
-						switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Args\n");
-					}
+					switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Args\n");
 				}
+
 				continue;
 			}
 

From 33238099855bb7a48c50a9049bd117c602305afc Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Thu, 19 Jul 2018 02:59:40 +0000
Subject: [PATCH 256/264] FS-11259: [mod_perl] mod_perl tweaks #resolve

---
 .../languages/mod_perl/freeswitch_perl.cpp    | 126 ++++++++++--------
 src/mod/languages/mod_perl/freeswitch_perl.h  |   3 +
 src/mod/languages/mod_perl/mod_perl.c         |   4 +
 3 files changed, 78 insertions(+), 55 deletions(-)

diff --git a/src/mod/languages/mod_perl/freeswitch_perl.cpp b/src/mod/languages/mod_perl/freeswitch_perl.cpp
index 220a16054f..642ea1d587 100644
--- a/src/mod/languages/mod_perl/freeswitch_perl.cpp
+++ b/src/mod/languages/mod_perl/freeswitch_perl.cpp
@@ -16,6 +16,8 @@ Session::Session():CoreSession()
 Session::Session(char *uuid, CoreSession *a_leg):CoreSession(uuid, a_leg)
 {
 	init_me();
+	switch_mutex_init(&callback_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
+	
 	if (session && allocated) {
 		suuid = switch_core_session_sprintf(session, "main::uuid_%s\n", switch_core_session_get_uuid(session));
 		for (char *p = suuid; p && *p; p++) {
@@ -32,6 +34,8 @@ Session::Session(char *uuid, CoreSession *a_leg):CoreSession(uuid, a_leg)
 Session::Session(switch_core_session_t *new_session):CoreSession(new_session)
 {
 	init_me();
+	switch_mutex_init(&callback_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
+
 	if (session) {
 		suuid = switch_core_session_sprintf(session, "main::uuid_%s\n", switch_core_session_get_uuid(session));
 		for (char *p = suuid; p && *p; p++) {
@@ -52,6 +56,10 @@ void Session::destroy(void)
 		return;
 	}
 
+	switch_mutex_lock(callback_mutex);
+	destroying = 1;
+	switch_mutex_unlock(callback_mutex);
+
 	if (session) {
 		if (!channel) {
 			channel = switch_core_session_get_channel(session);
@@ -216,71 +224,79 @@ void Session::setInputCallback(char *cbfunc, char *funcargs)
 
 switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t itype)
 {
+	switch_status_t status = SWITCH_STATUS_SUCCESS;
+	
 	if (!getPERL()) {
 		return SWITCH_STATUS_FALSE;;
 	}
 
-	switch (itype) {
-	case SWITCH_INPUT_TYPE_DTMF:
-		{
-			switch_dtmf_t *dtmf = (switch_dtmf_t *) input;
-			char str[32] = "";
-			int arg_count = 2;
-			HV *hash;
-			SV *this_sv;
-			char *code;
+	switch_mutex_lock(callback_mutex);
 
-			if (!(hash = get_hv("__dtmf", TRUE))) {
-				abort();
-			}
+	if (!destroying) {
+		switch (itype) {
+		case SWITCH_INPUT_TYPE_DTMF:
+			{
+				switch_dtmf_t *dtmf = (switch_dtmf_t *) input;
+				char str[32] = "";
+				int arg_count = 2;
+				HV *hash;
+				SV *this_sv;
+				char *code;
 
-			str[0] = dtmf->digit;
-			this_sv = newSV(strlen(str) + 1);
-			sv_setpv(this_sv, str);
-			hv_store(hash, "digit", 5, this_sv, 0);
-
-			switch_snprintf(str, sizeof(str), "%d", dtmf->duration);
-			this_sv = newSV(strlen(str) + 1);
-			sv_setpv(this_sv, str);
-			hv_store(hash, "duration", 8, this_sv, 0);
-
-			code = switch_mprintf("eval { $__RV = &%s($%s, 'dtmf', \\%%__dtmf, %s);};", cb_function, suuid, switch_str_nil(cb_arg));
-			Perl_eval_pv(my_perl, code, FALSE);
-			free(code);
-
-			return process_callback_result(SvPV(get_sv("__RV", TRUE), n_a));
-		}
-		break;
-	case SWITCH_INPUT_TYPE_EVENT:
-		{
-			switch_event_t *event = (switch_event_t *) input;
-			int arg_count = 2;
-			char *code;
-			switch_uuid_t uuid;
-			char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
-			char var_name[SWITCH_UUID_FORMATTED_LENGTH + 25];
-			char *p;
-
-			switch_uuid_get(&uuid);
-			switch_uuid_format(uuid_str, &uuid);
-
-			switch_snprintf(var_name, sizeof(var_name), "main::__event_%s", uuid_str);
-			for(p = var_name; p && *p; p++) {
-				if (*p == '-') {
-					*p = '_';
+				if (!(hash = get_hv("__dtmf", TRUE))) {
+					abort();
 				}
+
+				str[0] = dtmf->digit;
+				this_sv = newSV(strlen(str) + 1);
+				sv_setpv(this_sv, str);
+				hv_store(hash, "digit", 5, this_sv, 0);
+
+				switch_snprintf(str, sizeof(str), "%d", dtmf->duration);
+				this_sv = newSV(strlen(str) + 1);
+				sv_setpv(this_sv, str);
+				hv_store(hash, "duration", 8, this_sv, 0);
+
+				code = switch_mprintf("eval { $__RV = &%s($%s, 'dtmf', \\%%__dtmf, %s);};", cb_function, suuid, switch_str_nil(cb_arg));
+				Perl_eval_pv(my_perl, code, FALSE);
+				free(code);
+
+				status = process_callback_result(SvPV(get_sv("__RV", TRUE), n_a));
 			}
+			break;
+		case SWITCH_INPUT_TYPE_EVENT:
+			{
+				switch_event_t *event = (switch_event_t *) input;
+				int arg_count = 2;
+				char *code;
+				switch_uuid_t uuid;
+				char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1] = "";
+				char var_name[SWITCH_UUID_FORMATTED_LENGTH + 25] = "";
+				char *p;
 
-			mod_perl_conjure_event(my_perl, event, var_name);
-			code = switch_mprintf("eval {$__RV = &%s($%s, 'event', $%s, '%s');};$%s = undef;",
-								  cb_function, suuid, var_name, switch_str_nil(cb_arg), var_name);
-			Perl_eval_pv(my_perl, code, FALSE);
-			free(code);
+				switch_uuid_get(&uuid);
+				switch_uuid_format(uuid_str, &uuid);
 
-			return process_callback_result(SvPV(get_sv("__RV", TRUE), n_a));
+				switch_snprintf(var_name, sizeof(var_name), "__event_%s", uuid_str);
+				for(p = var_name; p && *p; p++) {
+					if (*p == '-') {
+						*p = '_';
+					}
+				}
+
+				mod_perl_conjure_event(my_perl, event, var_name);
+				code = switch_mprintf("eval {$__RV = &%s($%s, 'event', $%s, '%s');};$%s = undef;",
+									  cb_function, suuid, var_name, switch_str_nil(cb_arg), var_name);
+				Perl_eval_pv(my_perl, code, FALSE);
+				free(code);
+
+				status = process_callback_result(SvPV(get_sv("__RV", TRUE), n_a));
+			}
+			break;
 		}
-		break;
 	}
-
-	return SWITCH_STATUS_SUCCESS;
+	
+	switch_mutex_unlock(callback_mutex);
+		
+	return status;
 }
diff --git a/src/mod/languages/mod_perl/freeswitch_perl.h b/src/mod/languages/mod_perl/freeswitch_perl.h
index 5c0e6cc3c3..2d98295c4e 100644
--- a/src/mod/languages/mod_perl/freeswitch_perl.h
+++ b/src/mod/languages/mod_perl/freeswitch_perl.h
@@ -41,6 +41,9 @@ namespace PERL {
 		void unsetInputCallback(void);
 		void setHangupHook(char *func, char *arg = NULL);
 		bool ready();
+		switch_mutex_t *callback_mutex;
+		int destroying = 0;
+		int event_idx = 0;
 		char *suuid;
 		char *cb_function;
 		char *cb_arg;
diff --git a/src/mod/languages/mod_perl/mod_perl.c b/src/mod/languages/mod_perl/mod_perl.c
index 24efaefb98..01795fafbb 100644
--- a/src/mod/languages/mod_perl/mod_perl.c
+++ b/src/mod/languages/mod_perl/mod_perl.c
@@ -143,7 +143,11 @@ static int perl_parse_and_execute(PerlInterpreter * my_perl, char *input_code, c
 	return error;
 }
 
+#ifdef DEBUG_PERL
+#define HACK_CLEAN_CODE "eval{foreach my $kl(keys %main::) {eval{print qq'DEBUG: ' . $kl . '/' . $$kl . '/' . $$$kl . qq'\n';undef($$kl);} if (defined($$kl) && ($kl =~ /^\\w+[\\w\\d_]+$/))}}"
+#else
 #define HACK_CLEAN_CODE "eval{foreach my $kl(keys %main::) {eval{undef($$kl);} if (defined($$kl) && ($kl =~ /^\\w+[\\w\\d_]+$/))}}"
+#endif
 
 static void destroy_perl(PerlInterpreter ** to_destroy)
 {

From 6d1b8e12b54786f8db33376f3add8e898f8afc08 Mon Sep 17 00:00:00 2001
From: Seven Du 
Date: Thu, 19 Jul 2018 09:23:29 +0800
Subject: [PATCH 257/264] FS-11014 fix fvad_free and validate vad_mode

---
 src/switch_vad.c | 29 ++++++++++++++++++++++-------
 1 file changed, 22 insertions(+), 7 deletions(-)

diff --git a/src/switch_vad.c b/src/switch_vad.c
index c22ed2f352..8d12c3bdb1 100644
--- a/src/switch_vad.c
+++ b/src/switch_vad.c
@@ -75,17 +75,32 @@ SWITCH_DECLARE(switch_vad_t *) switch_vad_init(int sample_rate, int channels)
 	return vad;
 }
 
-//Valid modes are 0 ("quality"), 1 ("low bitrate"), 2 ("aggressive"), and 3 * ("very aggressive"). The default mode is 0.
 SWITCH_DECLARE(int) switch_vad_set_mode(switch_vad_t *vad, int mode)
 {
 #ifdef SWITCH_HAVE_FVAD
-	int ret;
+	int ret = 0;
 
-	if (mode < 0) return 0;
+	if (mode < 0 && vad->fvad) {
+		fvad_free(vad->fvad);
+		vad->fvad = NULL;
+		return ret;
+	} else if (mode > 3) {
+		mode = 3;
+	}
+
+	if (!vad->fvad) {
+		vad->fvad = fvad_new();
+
+		if (!vad->fvad) {
+			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "libfvad init error\n");
+		}
+	}
+
+	if (vad->fvad) {
+		ret = fvad_set_mode(vad->fvad, mode);
+		fvad_set_sample_rate(vad->fvad, vad->sample_rate);
+	}
 
-	vad->fvad = fvad_new();
-	ret = fvad_set_mode(vad->fvad, mode);
-	fvad_set_sample_rate(vad->fvad, vad->sample_rate);
 	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "libfvad started, mode = %d\n", mode);
 	return ret;
 #else
@@ -210,7 +225,7 @@ SWITCH_DECLARE(void) switch_vad_destroy(switch_vad_t **vad)
 	if (*vad) {
 
 #ifdef SWITCH_HAVE_FVAD
-		if ((*vad)->fvad) free ((*vad)->fvad);
+		if ((*vad)->fvad) fvad_free ((*vad)->fvad);
 #endif
 
 		free(*vad);

From bf6b61f911f92205464f3c32430862092e4f1931 Mon Sep 17 00:00:00 2001
From: Anthony Minessale 
Date: Sat, 21 Jul 2018 02:40:12 +0000
Subject: [PATCH 258/264] FS-11264: [freeswitch-core] Remove old speech handle
 when asr failure happens #resolve

---
 src/switch_ivr_async.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c
index 8d1609ac2d..2e9cd6e29a 100644
--- a/src/switch_ivr_async.c
+++ b/src/switch_ivr_async.c
@@ -86,6 +86,7 @@ struct switch_ivr_dmachine {
 	uint8_t pinging;
 };
 
+static switch_status_t speech_on_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf, switch_dtmf_direction_t direction);
 
 SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_last_ping(switch_ivr_dmachine_t *dmachine)
 {
@@ -4677,7 +4678,12 @@ static switch_bool_t speech_callback(switch_media_bug_t *bug, void *user_data, s
 	case SWITCH_ABC_TYPE_CLOSE:
 		{
 			switch_status_t st;
-
+			switch_core_session_t *session = switch_core_media_bug_get_session(bug);
+			switch_channel_t *channel = switch_core_session_get_channel(session);
+			
+			switch_channel_set_private(channel, SWITCH_SPEECH_KEY, NULL);
+			switch_core_event_hook_remove_recv_dtmf(session, speech_on_dtmf);
+			
 			switch_core_asr_close(sth->ah, &flags);
 			if (sth->mutex && sth->cond && sth->ready) {
 				if (switch_mutex_trylock(sth->mutex) == SWITCH_STATUS_SUCCESS) {

From 3930250b7905a39d8a30b8d5d03678f74dd2c924 Mon Sep 17 00:00:00 2001
From: Mariah Yang 
Date: Thu, 19 Jul 2018 16:42:27 +0800
Subject: [PATCH 259/264] FS-11260 fix set_tts_params segs when the second arg
 is NULL

---
 src/switch_cpp.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp
index bec23291fb..3741ba2ffd 100644
--- a/src/switch_cpp.cpp
+++ b/src/switch_cpp.cpp
@@ -855,8 +855,8 @@ SWITCH_DECLARE(void) CoreSession::set_tts_params(char *tts_name_p, char *voice_n
 	sanity_check_noreturn;
 	switch_safe_free(tts_name);
 	switch_safe_free(voice_name);
-    tts_name = strdup(tts_name_p);
-    voice_name = strdup(voice_name_p);
+	tts_name = strdup(switch_str_nil(tts_name_p));
+	voice_name = strdup(switch_str_nil(voice_name_p));
 }
 
 SWITCH_DECLARE(int) CoreSession::collectDigits(int abs_timeout) {

From bec920c99078bd35e47bd8e1a89d46eb19d86070 Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Tue, 24 Jul 2018 05:14:22 +0000
Subject: [PATCH 260/264] FS-11189: [mod_av] fix build on older libav

---
 src/mod/applications/mod_av/avcodec.c | 40 +++++++++++++++++++++++++--
 1 file changed, 38 insertions(+), 2 deletions(-)

diff --git a/src/mod/applications/mod_av/avcodec.c b/src/mod/applications/mod_av/avcodec.c
index 09988caf46..4614f23ee5 100644
--- a/src/mod/applications/mod_av/avcodec.c
+++ b/src/mod/applications/mod_av/avcodec.c
@@ -910,8 +910,10 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt
 		profile = &avcodec_globals.profiles[get_codec_index("H263+")];
 	} else if (context->av_codec_id == AV_CODEC_ID_H264) {
 		profile = &avcodec_globals.profiles[get_codec_index("H264")];
+#ifdef AV_CODEC_ID_H265
 	} else if (context->av_codec_id == AV_CODEC_ID_H265) {
 		profile = &avcodec_globals.profiles[get_codec_index("H265")];
+#endif
 	}
 
 	if (!profile) return SWITCH_STATUS_FALSE;
@@ -1782,43 +1784,77 @@ static void load_config()
 
 							for (i = 0; i < argc; i++) {
 								if (!strcasecmp(argv[i], "UNALIGNED")) {
+#ifdef AV_CODEC_FLAG_UNALIGNED
 									flags |= AV_CODEC_FLAG_UNALIGNED;
+#endif
 								} else if (!strcasecmp(argv[i], "QSCALE")) {
+#ifdef AV_CODEC_FLAG_QSCALE
 									flags |= AV_CODEC_FLAG_QSCALE;
-								} else if (!strcasecmp(argv[i], "QSCALE")) {
-									flags |= AV_CODEC_FLAG_QSCALE;
+#endif
 								} else if (!strcasecmp(argv[i], "4MV")) {
+#ifdef AV_CODEC_FLAG_4MV
 									flags |= AV_CODEC_FLAG_4MV;
+#endif
 								} else if (!strcasecmp(argv[i], "CORRUPT")) {
+#ifdef AV_CODEC_FLAG_OUTPUT_CORRUPT
 									flags |= AV_CODEC_FLAG_OUTPUT_CORRUPT;
+#endif
 								} else if (!strcasecmp(argv[i], "QPEL")) {
+#ifdef AV_CODEC_FLAG_QPEL
 									flags |= AV_CODEC_FLAG_QPEL;
+#endif
 								} else if (!strcasecmp(argv[i], "PASS1")) {
+#ifdef AV_CODEC_FLAG_PASS1
 									flags |= AV_CODEC_FLAG_PASS1;
+#endif
 								} else if (!strcasecmp(argv[i], "PASS2")) {
+#ifdef AV_CODEC_FLAG_PASS2
 									flags |= AV_CODEC_FLAG_PASS2;
+#endif
 								} else if (!strcasecmp(argv[i], "FILTER")) {
+#ifdef AV_CODEC_FLAG_LOOP_FILTER
 									flags |= AV_CODEC_FLAG_LOOP_FILTER;
+#endif
 								} else if (!strcasecmp(argv[i], "GRAY")) {
+#ifdef AV_CODEC_FLAG_GRAY
 									flags |= AV_CODEC_FLAG_GRAY;
+#endif
 								} else if (!strcasecmp(argv[i], "PSNR")) {
+#ifdef AV_CODEC_FLAG_PSNR
 									flags |= AV_CODEC_FLAG_PSNR;
+#endif
 								} else if (!strcasecmp(argv[i], "TRUNCATED")) {
+#ifdef AV_CODEC_FLAG_TRUNCATED
 									flags |= AV_CODEC_FLAG_TRUNCATED;
+#endif
 								} else if (!strcasecmp(argv[i], "INTERLACED_DCT")) {
+#ifdef AV_CODEC_FLAG_INTERLACED_DCT
 									flags |= AV_CODEC_FLAG_INTERLACED_DCT;
+#endif
 								} else if (!strcasecmp(argv[i], "LOW_DELAY")) {
+#ifdef AV_CODEC_FLAG_LOW_DELAY
 									flags |= AV_CODEC_FLAG_LOW_DELAY;
+#endif
 								} else if (!strcasecmp(argv[i], "HEADER")) {
+#ifdef AV_CODEC_FLAG_GLOBAL_HEADER
 									flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+#endif
 								} else if (!strcasecmp(argv[i], "BITEXACT")) {
+#ifdef AV_CODEC_FLAG_BITEXACT
 									flags |= AV_CODEC_FLAG_BITEXACT;
+#endif
 								} else if (!strcasecmp(argv[i], "AC_PRED")) {
+#ifdef AV_CODEC_FLAG_AC_PRED
 									flags |= AV_CODEC_FLAG_AC_PRED;
+#endif
 								} else if (!strcasecmp(argv[i], "INTERLACED_ME")) {
+#ifdef AV_CODEC_FLAG_INTERLACED_ME
 									flags |= AV_CODEC_FLAG_INTERLACED_ME;
+#endif
 								} else if (!strcasecmp(argv[i], "CLOSED_GOP")) {
+#ifdef AV_CODEC_FLAG_CLOSED_GOP
 									flags |= AV_CODEC_FLAG_CLOSED_GOP;
+#endif
 								}
 							}
 

From 68e7817f92bff84516b7d75893410bcc3fff4c09 Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Tue, 24 Jul 2018 08:19:56 +0000
Subject: [PATCH 261/264] version bump

---
 build/next-release.txt | 2 +-
 configure.ac           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/build/next-release.txt b/build/next-release.txt
index f8e233b273..a8fdfda1c7 100644
--- a/build/next-release.txt
+++ b/build/next-release.txt
@@ -1 +1 @@
-1.9.0
+1.8.1
diff --git a/configure.ac b/configure.ac
index aaf6c270cf..e487072263 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,8 +5,8 @@
 # For a release, set revision for that tagged release as well and uncomment
 AC_INIT([freeswitch], [1.9.0], bugs@freeswitch.org)
 AC_SUBST(SWITCH_VERSION_MAJOR, [1])
-AC_SUBST(SWITCH_VERSION_MINOR, [9])
-AC_SUBST(SWITCH_VERSION_MICRO, [0])
+AC_SUBST(SWITCH_VERSION_MINOR, [8])
+AC_SUBST(SWITCH_VERSION_MICRO, [1])
 AC_SUBST(SWITCH_VERSION_REVISION, [])
 AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, [])
 

From 4f54cff36a0bc1d093746646e552cad08acbfbb8 Mon Sep 17 00:00:00 2001
From: Andrey Volk 
Date: Tue, 24 Jul 2018 16:11:54 +0300
Subject: [PATCH 262/264] FS-11189: [Build-System] Fix Windows build.

---
 src/include/switch_utils.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h
index 7e812bb130..0d56510aa0 100644
--- a/src/include/switch_utils.h
+++ b/src/include/switch_utils.h
@@ -1111,7 +1111,7 @@ static inline uint32_t switch_parse_cpu_string(const char *cpu)
 			max = atoi(has_max + 1);
 		}
 
-		divisor = atof(cpu);
+		divisor = (float)atof(cpu);
 
 		if (divisor <= 0) divisor = 1;
 

From 6fde1befa8540f86b3fba1778cfeb9f9fc365a75 Mon Sep 17 00:00:00 2001
From: Andrey Volk 
Date: Tue, 24 Jul 2018 17:46:38 +0300
Subject: [PATCH 263/264] FS-11189: [Build-System] Windows build regression
 fix.

---
 src/include/switch_utils.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h
index 0d56510aa0..4b7d949579 100644
--- a/src/include/switch_utils.h
+++ b/src/include/switch_utils.h
@@ -1115,7 +1115,7 @@ static inline uint32_t switch_parse_cpu_string(const char *cpu)
 
 		if (divisor <= 0) divisor = 1;
 
-		ncpu = cpu_count / divisor;
+		ncpu = (int)(cpu_count / divisor);
 
 		if (ncpu <= 0) return 1;
 

From b33bc925c52b19eda0cafc079015f5bac8fe68d1 Mon Sep 17 00:00:00 2001
From: Mike Jerris 
Date: Tue, 24 Jul 2018 16:05:24 +0000
Subject: [PATCH 264/264] version bump

---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index e487072263..9cc9f7ed42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
 
 # Must change all of the below together
 # For a release, set revision for that tagged release as well and uncomment
-AC_INIT([freeswitch], [1.9.0], bugs@freeswitch.org)
+AC_INIT([freeswitch], [1.8.1], bugs@freeswitch.org)
 AC_SUBST(SWITCH_VERSION_MAJOR, [1])
 AC_SUBST(SWITCH_VERSION_MINOR, [8])
 AC_SUBST(SWITCH_VERSION_MICRO, [1])